@depict-ai/utilishared 1.0.46 → 1.0.48
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 +10 -7
- package/ES10/index.d.ts +11 -5
- package/ES10/index.js +10 -7
- package/latest/index.cjs +10 -7
- package/latest/index.d.ts +11 -5
- package/latest/index.js +10 -7
- package/package.json +5 -5
package/ES10/index.cjs
CHANGED
|
@@ -279,7 +279,7 @@ $parcel$export(module.exports, "add_to_version_info", () => $045fb30107c9eecc$ex
|
|
|
279
279
|
$parcel$export(module.exports, "edit_current_page_meta_tags", () => $0126fdc29a9f7f2d$export$ef73ea4f975745ba);
|
|
280
280
|
$parcel$export(module.exports, "sync_el_content_with_accessor", () => $84d13ab567309a50$export$c3f56a35e076f139);
|
|
281
281
|
$parcel$export(module.exports, "use_href_accessor", () => $59b7011b96010a8e$export$e35115e6d0715f77);
|
|
282
|
-
const $ce0ab19b284b64fa$export$83d89fbfd8236492 = "1.0.
|
|
282
|
+
const $ce0ab19b284b64fa$export$83d89fbfd8236492 = "1.0.48";
|
|
283
283
|
const $9e9538f4aff6f83c$export$55fe61489d2c7417 = /*@__PURE__*/((_globalThis$document, _globalThis$document$, _globalThis$document$2, _globalThis$localStor, _globalThis$localStor2) => process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && ((globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : (_globalThis$document$ = _globalThis$document.currentScript) === null || _globalThis$document$ === void 0 ? void 0 : (_globalThis$document$2 = _globalThis$document$.dataset) === null || _globalThis$document$2 === void 0 ? void 0 : _globalThis$document$2.debug) === "true" || (globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$localStor = globalThis.localStorage) === null || _globalThis$localStor === void 0 ? void 0 : (_globalThis$localStor2 = _globalThis$localStor.getItem) === null || _globalThis$localStor2 === void 0 ? void 0 : _globalThis$localStor2.call(_globalThis$localStor, "debug")) === "true"))();
|
|
284
284
|
const $7f95f77417d06249$var$browser_prefix_styling = "color: #fff;";
|
|
285
285
|
let $7f95f77417d06249$var$browser_prefix = "[Depict]";
|
|
@@ -5939,7 +5939,7 @@ function $0c2e69f971c62390$export$483bdd1f1186de13(rows, max_recs, options) {
|
|
|
5939
5939
|
while ((visible_recs = $0c2e69f971c62390$export$3dc5e2383c924ebf(rows--, options)) > max_recs);
|
|
5940
5940
|
return visible_recs;
|
|
5941
5941
|
}
|
|
5942
|
-
function $0c2e69f971c62390$export$17c3166a7ebd4688(selector_beginning, default_grid_spacing_text, cols_at_size, layout, override_vertical_spacing) {
|
|
5942
|
+
function $0c2e69f971c62390$export$17c3166a7ebd4688(selector_beginning, default_grid_spacing_text, cols_at_size, layout, override_vertical_spacing, only_generate_top_margins) {
|
|
5943
5943
|
function get_width_of_middle_elements(n_cols, spacing) {
|
|
5944
5944
|
return "width:".concat($0c2e69f971c62390$var$css_subtract($0c2e69f971c62390$var$css_divide(new $0c2e69f971c62390$var$CSSMeasurement("100%"), n_cols), $0c2e69f971c62390$var$css_divide($0c2e69f971c62390$var$css_multiply(n_cols * 2 - 2, spacing), n_cols)));
|
|
5945
5945
|
}
|
|
@@ -5954,7 +5954,8 @@ function $0c2e69f971c62390$export$17c3166a7ebd4688(selector_beginning, default_g
|
|
|
5954
5954
|
return left_removed_css + right_removed_css;
|
|
5955
5955
|
}
|
|
5956
5956
|
function get_vertical_spacing_css(selector, spacing, options) {
|
|
5957
|
-
const
|
|
5957
|
+
const shorten_top_row_by = only_generate_top_margins !== null && only_generate_top_margins !== void 0 ? only_generate_top_margins : 0;
|
|
5958
|
+
const top_row_selector = "".concat(selector, ":nth-child(n+1):nth-child(-n+").concat($0c2e69f971c62390$export$3dc5e2383c924ebf(1, options) - shorten_top_row_by, ")");
|
|
5958
5959
|
const between_spacing_css = "".concat(selector, ":not(").concat(top_row_selector, "){margin-top:").concat(override_vertical_spacing !== null && override_vertical_spacing !== void 0 ? override_vertical_spacing : $0c2e69f971c62390$var$css_multiply(spacing, 2), "}");
|
|
5959
5960
|
return between_spacing_css;
|
|
5960
5961
|
}
|
|
@@ -5990,10 +5991,12 @@ function $0c2e69f971c62390$export$17c3166a7ebd4688(selector_beginning, default_g
|
|
|
5990
5991
|
const is_last_iteration = row === max_row;
|
|
5991
5992
|
let row_selector = selector_beginning;
|
|
5992
5993
|
if (is_last_iteration) row_selector += ":nth-child(n+".concat(start, ")");else row_selector += ":nth-child(n+".concat(start, "):nth-child(-n+").concat(end, ")");
|
|
5993
|
-
|
|
5994
|
-
|
|
5994
|
+
if (only_generate_top_margins == undefined) {
|
|
5995
|
+
media_query_body += get_width_css(real_n_cols, row_selector, half_spacing);
|
|
5996
|
+
media_query_body += get_horizontal_spacing_css(start, end, row_selector, half_spacing);
|
|
5997
|
+
}
|
|
5995
5998
|
media_query_body += get_vertical_spacing_css(row_selector, half_spacing, options);
|
|
5996
|
-
if (is_last_iteration) media_query_body += get_left_right_0_spacing_rest_of_rows_css(n_cols, start, selector_beginning);
|
|
5999
|
+
if (is_last_iteration && only_generate_top_margins == undefined) media_query_body += get_left_right_0_spacing_rest_of_rows_css(n_cols, start, selector_beginning);
|
|
5997
6000
|
}
|
|
5998
6001
|
} else if (layout == "slider") {
|
|
5999
6002
|
const margin_and_width_of_middle_elements = get_width_css(n_cols, "".concat(selector_beginning, "*"), half_spacing);
|
|
@@ -8969,7 +8972,7 @@ function $8f50d4679e508333$export$b481488de1caa85(obj) {
|
|
|
8969
8972
|
let [key, value] = _ref2;
|
|
8970
8973
|
return [key.replace(/[A-Z]/g, match => "_" + match.toLowerCase()), value];
|
|
8971
8974
|
}));
|
|
8972
|
-
}
|
|
8975
|
+
} // Surce: https://gist.github.com/kuroski/9a7ae8e5e5c9e22985364d1ddbf3389d
|
|
8973
8976
|
|
|
8974
8977
|
/**
|
|
8975
8978
|
* Converts RGB to HSL
|
package/ES10/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference path="../jsx.d.ts" />
|
|
2
2
|
import { EUnavailabilityType } from "@depict-ai/types/api/TrackV2Request";
|
|
3
3
|
import { Accessor } from "solid-js";
|
|
4
|
-
export const version = "1.0.
|
|
4
|
+
export const version = "1.0.48";
|
|
5
5
|
export const is_debug: boolean;
|
|
6
6
|
/**
|
|
7
7
|
* Sets the prefix of dlog, dwarn, and derror messages in the browser console. Defaults to `[Depict]`.
|
|
@@ -980,7 +980,7 @@ export const wait: (delay: number) => Promise<unknown>;
|
|
|
980
980
|
* @param max_retries Max number of retries, defaults to 10
|
|
981
981
|
* @returns The fetch response
|
|
982
982
|
*/
|
|
983
|
-
export function fetch_retry(url: RequestInfo, options?: RequestInit, max_retries?: number): Promise<false | Response>;
|
|
983
|
+
export function fetch_retry(url: RequestInfo | URL, options?: RequestInit, max_retries?: number): Promise<false | Response>;
|
|
984
984
|
type PossibleEndpoint = "general" | "product" | "products" | "category";
|
|
985
985
|
type ExclusiveId = {
|
|
986
986
|
category_id: string;
|
|
@@ -1655,10 +1655,12 @@ export function layout_get_visible_recs_without_partial_rows(rows: number, max_r
|
|
|
1655
1655
|
* @param selector_beginning Main selector targeting container classname to use in generated css
|
|
1656
1656
|
* @param default_grid_spacing_text Spacing to use if not specified in cols_at_size for a specific size
|
|
1657
1657
|
* @param cols_at_size An array with sub arrays looking like this: [n_cols, min_width_media_query, max_width_media_query, grid_spacing_for_size], everything after [n_cols, min_width] is optional. falsey value for min_width = no min_width
|
|
1658
|
+
* @param layout "slider" or "grid"
|
|
1658
1659
|
* @param override_vertical_spacing by default, the grid_spacing is used both horizontally and vertically, with this you can specify a separate spacing
|
|
1660
|
+
* @param only_generate_top_margins if a number, only generates top margins, not widths or side margins (this is used by the content block code to allow still having relative gap's). The provided number subtracts from the top row (makes us pretend it's shorter, for content blocks). Only works for layout = "grid"
|
|
1659
1661
|
* @return String of generated CSS
|
|
1660
1662
|
*/
|
|
1661
|
-
export function n_col_styling_with_dist(selector_beginning: string, default_grid_spacing_text: string, cols_at_size: ColsAtSize, layout: "slider" | "grid", override_vertical_spacing?: string): string;
|
|
1663
|
+
export function n_col_styling_with_dist(selector_beginning: string, default_grid_spacing_text: string, cols_at_size: ColsAtSize, layout: "slider" | "grid", override_vertical_spacing?: string, only_generate_top_margins?: number): string;
|
|
1662
1664
|
export interface RecommendationGridOptions<T extends Display> extends Omit<LayoutOptions, "container_element" | "layout"> {
|
|
1663
1665
|
container_elements: Node_Array;
|
|
1664
1666
|
container_selector?: string;
|
|
@@ -2521,7 +2523,7 @@ export const ContainedHoverImage: ({
|
|
|
2521
2523
|
*/
|
|
2522
2524
|
export function camelCasifyObject<T extends {
|
|
2523
2525
|
[key: string]: any;
|
|
2524
|
-
}
|
|
2526
|
+
}>(obj: T): KeysToCamelCase<T>;
|
|
2525
2527
|
/**
|
|
2526
2528
|
* Shallowly converts all keys in an object from camelCase to snake_case.
|
|
2527
2529
|
* Does not support symbol keys.
|
|
@@ -2529,7 +2531,11 @@ export function camelCasifyObject<T extends {
|
|
|
2529
2531
|
*/
|
|
2530
2532
|
export function snakeCasifyObject<T extends {
|
|
2531
2533
|
[key: string]: any;
|
|
2532
|
-
}
|
|
2534
|
+
}>(obj: T): KeysToSnakeCase<T>;
|
|
2535
|
+
type CamelCase<S extends string> = S extends `${infer P1}_${infer P2}${infer P3}` ? `${Lowercase<P1>}${Uppercase<P2>}${CamelCase<P3>}` : Lowercase<S>;
|
|
2536
|
+
type KeysToCamelCase<T> = { [K in keyof T as CamelCase<string & K>]: T[K] };
|
|
2537
|
+
type CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ? `${T extends Capitalize<T> ? "_" : ""}${Lowercase<T>}${CamelToSnakeCase<U>}` : S;
|
|
2538
|
+
type KeysToSnakeCase<T> = { [K in keyof T as CamelToSnakeCase<string & K>]: T[K] };
|
|
2533
2539
|
/**
|
|
2534
2540
|
* Converts RGB to HSL
|
|
2535
2541
|
* Source of function: https://www.30secondsofcode.org/js/s/rgb-to-hsl
|
package/ES10/index.js
CHANGED
|
@@ -15,7 +15,7 @@ function $parcel$export(e, n, v, s) {
|
|
|
15
15
|
function $parcel$interopDefault(a) {
|
|
16
16
|
return a && a.__esModule ? a.default : a;
|
|
17
17
|
}
|
|
18
|
-
const $b9e07ce3c67aa344$export$83d89fbfd8236492 = "1.0.
|
|
18
|
+
const $b9e07ce3c67aa344$export$83d89fbfd8236492 = "1.0.48";
|
|
19
19
|
const $a5a2bdb4ae93374b$export$55fe61489d2c7417 = /*@__PURE__*/((_globalThis$document, _globalThis$document$, _globalThis$document$2, _globalThis$localStor, _globalThis$localStor2) => process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && ((globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : (_globalThis$document$ = _globalThis$document.currentScript) === null || _globalThis$document$ === void 0 ? void 0 : (_globalThis$document$2 = _globalThis$document$.dataset) === null || _globalThis$document$2 === void 0 ? void 0 : _globalThis$document$2.debug) === "true" || (globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$localStor = globalThis.localStorage) === null || _globalThis$localStor === void 0 ? void 0 : (_globalThis$localStor2 = _globalThis$localStor.getItem) === null || _globalThis$localStor2 === void 0 ? void 0 : _globalThis$localStor2.call(_globalThis$localStor, "debug")) === "true"))();
|
|
20
20
|
const $241f2f02cc612a49$var$browser_prefix_styling = "color: #fff;";
|
|
21
21
|
let $241f2f02cc612a49$var$browser_prefix = "[Depict]";
|
|
@@ -5675,7 +5675,7 @@ function $df6d080cba513381$export$483bdd1f1186de13(rows, max_recs, options) {
|
|
|
5675
5675
|
while ((visible_recs = $df6d080cba513381$export$3dc5e2383c924ebf(rows--, options)) > max_recs);
|
|
5676
5676
|
return visible_recs;
|
|
5677
5677
|
}
|
|
5678
|
-
function $df6d080cba513381$export$17c3166a7ebd4688(selector_beginning, default_grid_spacing_text, cols_at_size, layout, override_vertical_spacing) {
|
|
5678
|
+
function $df6d080cba513381$export$17c3166a7ebd4688(selector_beginning, default_grid_spacing_text, cols_at_size, layout, override_vertical_spacing, only_generate_top_margins) {
|
|
5679
5679
|
function get_width_of_middle_elements(n_cols, spacing) {
|
|
5680
5680
|
return "width:".concat($df6d080cba513381$var$css_subtract($df6d080cba513381$var$css_divide(new $df6d080cba513381$var$CSSMeasurement("100%"), n_cols), $df6d080cba513381$var$css_divide($df6d080cba513381$var$css_multiply(n_cols * 2 - 2, spacing), n_cols)));
|
|
5681
5681
|
}
|
|
@@ -5690,7 +5690,8 @@ function $df6d080cba513381$export$17c3166a7ebd4688(selector_beginning, default_g
|
|
|
5690
5690
|
return left_removed_css + right_removed_css;
|
|
5691
5691
|
}
|
|
5692
5692
|
function get_vertical_spacing_css(selector, spacing, options) {
|
|
5693
|
-
const
|
|
5693
|
+
const shorten_top_row_by = only_generate_top_margins !== null && only_generate_top_margins !== void 0 ? only_generate_top_margins : 0;
|
|
5694
|
+
const top_row_selector = "".concat(selector, ":nth-child(n+1):nth-child(-n+").concat($df6d080cba513381$export$3dc5e2383c924ebf(1, options) - shorten_top_row_by, ")");
|
|
5694
5695
|
const between_spacing_css = "".concat(selector, ":not(").concat(top_row_selector, "){margin-top:").concat(override_vertical_spacing !== null && override_vertical_spacing !== void 0 ? override_vertical_spacing : $df6d080cba513381$var$css_multiply(spacing, 2), "}");
|
|
5695
5696
|
return between_spacing_css;
|
|
5696
5697
|
}
|
|
@@ -5726,10 +5727,12 @@ function $df6d080cba513381$export$17c3166a7ebd4688(selector_beginning, default_g
|
|
|
5726
5727
|
const is_last_iteration = row === max_row;
|
|
5727
5728
|
let row_selector = selector_beginning;
|
|
5728
5729
|
if (is_last_iteration) row_selector += ":nth-child(n+".concat(start, ")");else row_selector += ":nth-child(n+".concat(start, "):nth-child(-n+").concat(end, ")");
|
|
5729
|
-
|
|
5730
|
-
|
|
5730
|
+
if (only_generate_top_margins == undefined) {
|
|
5731
|
+
media_query_body += get_width_css(real_n_cols, row_selector, half_spacing);
|
|
5732
|
+
media_query_body += get_horizontal_spacing_css(start, end, row_selector, half_spacing);
|
|
5733
|
+
}
|
|
5731
5734
|
media_query_body += get_vertical_spacing_css(row_selector, half_spacing, options);
|
|
5732
|
-
if (is_last_iteration) media_query_body += get_left_right_0_spacing_rest_of_rows_css(n_cols, start, selector_beginning);
|
|
5735
|
+
if (is_last_iteration && only_generate_top_margins == undefined) media_query_body += get_left_right_0_spacing_rest_of_rows_css(n_cols, start, selector_beginning);
|
|
5733
5736
|
}
|
|
5734
5737
|
} else if (layout == "slider") {
|
|
5735
5738
|
const margin_and_width_of_middle_elements = get_width_css(n_cols, "".concat(selector_beginning, "*"), half_spacing);
|
|
@@ -8705,7 +8708,7 @@ function $c07f1f2ffdcaec61$export$b481488de1caa85(obj) {
|
|
|
8705
8708
|
let [key, value] = _ref2;
|
|
8706
8709
|
return [key.replace(/[A-Z]/g, match => "_" + match.toLowerCase()), value];
|
|
8707
8710
|
}));
|
|
8708
|
-
}
|
|
8711
|
+
} // Surce: https://gist.github.com/kuroski/9a7ae8e5e5c9e22985364d1ddbf3389d
|
|
8709
8712
|
|
|
8710
8713
|
/**
|
|
8711
8714
|
* Converts RGB to HSL
|
package/latest/index.cjs
CHANGED
|
@@ -276,7 +276,7 @@ $parcel$export(module.exports, "add_to_version_info", () => $e4a18bf12ad092d9$ex
|
|
|
276
276
|
$parcel$export(module.exports, "edit_current_page_meta_tags", () => $8838e3e61b748a8b$export$ef73ea4f975745ba);
|
|
277
277
|
$parcel$export(module.exports, "sync_el_content_with_accessor", () => $35303d72263038db$export$c3f56a35e076f139);
|
|
278
278
|
$parcel$export(module.exports, "use_href_accessor", () => $da35c7e27be2a442$export$e35115e6d0715f77);
|
|
279
|
-
const $815f67c61b4c0a42$export$83d89fbfd8236492 = "1.0.
|
|
279
|
+
const $815f67c61b4c0a42$export$83d89fbfd8236492 = "1.0.48";
|
|
280
280
|
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" && (globalThis?.document?.currentScript?.dataset?.debug === "true" || globalThis?.localStorage?.getItem?.("debug") === "true"))();
|
|
281
281
|
const $e6c6e7929ea385ae$var$browser_prefix_styling = "color: #fff;";
|
|
282
282
|
let $e6c6e7929ea385ae$var$browser_prefix = "[Depict]";
|
|
@@ -5439,7 +5439,7 @@ function $1cc2444a0f1b992e$export$483bdd1f1186de13(rows, max_recs, options) {
|
|
|
5439
5439
|
while ((visible_recs = $1cc2444a0f1b992e$export$3dc5e2383c924ebf(rows--, options)) > max_recs);
|
|
5440
5440
|
return visible_recs;
|
|
5441
5441
|
}
|
|
5442
|
-
function $1cc2444a0f1b992e$export$17c3166a7ebd4688(selector_beginning, default_grid_spacing_text, cols_at_size, layout, override_vertical_spacing) {
|
|
5442
|
+
function $1cc2444a0f1b992e$export$17c3166a7ebd4688(selector_beginning, default_grid_spacing_text, cols_at_size, layout, override_vertical_spacing, only_generate_top_margins) {
|
|
5443
5443
|
function get_width_of_middle_elements(n_cols, spacing) {
|
|
5444
5444
|
return `width:${$1cc2444a0f1b992e$var$css_subtract($1cc2444a0f1b992e$var$css_divide(new $1cc2444a0f1b992e$var$CSSMeasurement("100%"), n_cols), $1cc2444a0f1b992e$var$css_divide($1cc2444a0f1b992e$var$css_multiply(n_cols * 2 - 2, spacing), n_cols))}`;
|
|
5445
5445
|
}
|
|
@@ -5454,7 +5454,8 @@ function $1cc2444a0f1b992e$export$17c3166a7ebd4688(selector_beginning, default_g
|
|
|
5454
5454
|
return left_removed_css + right_removed_css;
|
|
5455
5455
|
}
|
|
5456
5456
|
function get_vertical_spacing_css(selector, spacing, options) {
|
|
5457
|
-
const
|
|
5457
|
+
const shorten_top_row_by = only_generate_top_margins ?? 0;
|
|
5458
|
+
const top_row_selector = `${selector}:nth-child(n+1):nth-child(-n+${$1cc2444a0f1b992e$export$3dc5e2383c924ebf(1, options) - shorten_top_row_by})`;
|
|
5458
5459
|
const between_spacing_css = `${selector}:not(${top_row_selector}){margin-top:${override_vertical_spacing ?? $1cc2444a0f1b992e$var$css_multiply(spacing, 2)}}`;
|
|
5459
5460
|
return between_spacing_css;
|
|
5460
5461
|
}
|
|
@@ -5490,10 +5491,12 @@ function $1cc2444a0f1b992e$export$17c3166a7ebd4688(selector_beginning, default_g
|
|
|
5490
5491
|
const is_last_iteration = row === max_row;
|
|
5491
5492
|
let row_selector = selector_beginning;
|
|
5492
5493
|
if (is_last_iteration) row_selector += `:nth-child(n+${start})`;else row_selector += `:nth-child(n+${start}):nth-child(-n+${end})`;
|
|
5493
|
-
|
|
5494
|
-
|
|
5494
|
+
if (only_generate_top_margins == undefined) {
|
|
5495
|
+
media_query_body += get_width_css(real_n_cols, row_selector, half_spacing);
|
|
5496
|
+
media_query_body += get_horizontal_spacing_css(start, end, row_selector, half_spacing);
|
|
5497
|
+
}
|
|
5495
5498
|
media_query_body += get_vertical_spacing_css(row_selector, half_spacing, options);
|
|
5496
|
-
if (is_last_iteration) media_query_body += get_left_right_0_spacing_rest_of_rows_css(n_cols, start, selector_beginning);
|
|
5499
|
+
if (is_last_iteration && only_generate_top_margins == undefined) media_query_body += get_left_right_0_spacing_rest_of_rows_css(n_cols, start, selector_beginning);
|
|
5497
5500
|
}
|
|
5498
5501
|
} else if (layout == "slider") {
|
|
5499
5502
|
const margin_and_width_of_middle_elements = get_width_css(n_cols, `${selector_beginning}*`, half_spacing);
|
|
@@ -8335,7 +8338,7 @@ function $89758b55120b0cbd$export$9dc8f3a0aa3efc85(obj) {
|
|
|
8335
8338
|
}
|
|
8336
8339
|
function $89758b55120b0cbd$export$b481488de1caa85(obj) {
|
|
8337
8340
|
return Object.fromEntries(Object.entries(obj).map(([key, value]) => [key.replace(/[A-Z]/g, match => "_" + match.toLowerCase()), value]));
|
|
8338
|
-
}
|
|
8341
|
+
} // Surce: https://gist.github.com/kuroski/9a7ae8e5e5c9e22985364d1ddbf3389d
|
|
8339
8342
|
|
|
8340
8343
|
/**
|
|
8341
8344
|
* Converts RGB to HSL
|
package/latest/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference path="../jsx.d.ts" />
|
|
2
2
|
import { EUnavailabilityType } from "@depict-ai/types/api/TrackV2Request";
|
|
3
3
|
import { Accessor } from "solid-js";
|
|
4
|
-
export const version = "1.0.
|
|
4
|
+
export const version = "1.0.48";
|
|
5
5
|
export const is_debug: boolean;
|
|
6
6
|
/**
|
|
7
7
|
* Sets the prefix of dlog, dwarn, and derror messages in the browser console. Defaults to `[Depict]`.
|
|
@@ -980,7 +980,7 @@ export const wait: (delay: number) => Promise<unknown>;
|
|
|
980
980
|
* @param max_retries Max number of retries, defaults to 10
|
|
981
981
|
* @returns The fetch response
|
|
982
982
|
*/
|
|
983
|
-
export function fetch_retry(url: RequestInfo, options?: RequestInit, max_retries?: number): Promise<false | Response>;
|
|
983
|
+
export function fetch_retry(url: RequestInfo | URL, options?: RequestInit, max_retries?: number): Promise<false | Response>;
|
|
984
984
|
type PossibleEndpoint = "general" | "product" | "products" | "category";
|
|
985
985
|
type ExclusiveId = {
|
|
986
986
|
category_id: string;
|
|
@@ -1655,10 +1655,12 @@ export function layout_get_visible_recs_without_partial_rows(rows: number, max_r
|
|
|
1655
1655
|
* @param selector_beginning Main selector targeting container classname to use in generated css
|
|
1656
1656
|
* @param default_grid_spacing_text Spacing to use if not specified in cols_at_size for a specific size
|
|
1657
1657
|
* @param cols_at_size An array with sub arrays looking like this: [n_cols, min_width_media_query, max_width_media_query, grid_spacing_for_size], everything after [n_cols, min_width] is optional. falsey value for min_width = no min_width
|
|
1658
|
+
* @param layout "slider" or "grid"
|
|
1658
1659
|
* @param override_vertical_spacing by default, the grid_spacing is used both horizontally and vertically, with this you can specify a separate spacing
|
|
1660
|
+
* @param only_generate_top_margins if a number, only generates top margins, not widths or side margins (this is used by the content block code to allow still having relative gap's). The provided number subtracts from the top row (makes us pretend it's shorter, for content blocks). Only works for layout = "grid"
|
|
1659
1661
|
* @return String of generated CSS
|
|
1660
1662
|
*/
|
|
1661
|
-
export function n_col_styling_with_dist(selector_beginning: string, default_grid_spacing_text: string, cols_at_size: ColsAtSize, layout: "slider" | "grid", override_vertical_spacing?: string): string;
|
|
1663
|
+
export function n_col_styling_with_dist(selector_beginning: string, default_grid_spacing_text: string, cols_at_size: ColsAtSize, layout: "slider" | "grid", override_vertical_spacing?: string, only_generate_top_margins?: number): string;
|
|
1662
1664
|
export interface RecommendationGridOptions<T extends Display> extends Omit<LayoutOptions, "container_element" | "layout"> {
|
|
1663
1665
|
container_elements: Node_Array;
|
|
1664
1666
|
container_selector?: string;
|
|
@@ -2521,7 +2523,7 @@ export const ContainedHoverImage: ({
|
|
|
2521
2523
|
*/
|
|
2522
2524
|
export function camelCasifyObject<T extends {
|
|
2523
2525
|
[key: string]: any;
|
|
2524
|
-
}
|
|
2526
|
+
}>(obj: T): KeysToCamelCase<T>;
|
|
2525
2527
|
/**
|
|
2526
2528
|
* Shallowly converts all keys in an object from camelCase to snake_case.
|
|
2527
2529
|
* Does not support symbol keys.
|
|
@@ -2529,7 +2531,11 @@ export function camelCasifyObject<T extends {
|
|
|
2529
2531
|
*/
|
|
2530
2532
|
export function snakeCasifyObject<T extends {
|
|
2531
2533
|
[key: string]: any;
|
|
2532
|
-
}
|
|
2534
|
+
}>(obj: T): KeysToSnakeCase<T>;
|
|
2535
|
+
type CamelCase<S extends string> = S extends `${infer P1}_${infer P2}${infer P3}` ? `${Lowercase<P1>}${Uppercase<P2>}${CamelCase<P3>}` : Lowercase<S>;
|
|
2536
|
+
type KeysToCamelCase<T> = { [K in keyof T as CamelCase<string & K>]: T[K] };
|
|
2537
|
+
type CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ? `${T extends Capitalize<T> ? "_" : ""}${Lowercase<T>}${CamelToSnakeCase<U>}` : S;
|
|
2538
|
+
type KeysToSnakeCase<T> = { [K in keyof T as CamelToSnakeCase<string & K>]: T[K] };
|
|
2533
2539
|
/**
|
|
2534
2540
|
* Converts RGB to HSL
|
|
2535
2541
|
* Source of function: https://www.30secondsofcode.org/js/s/rgb-to-hsl
|
package/latest/index.js
CHANGED
|
@@ -12,7 +12,7 @@ function $parcel$export(e, n, v, s) {
|
|
|
12
12
|
function $parcel$interopDefault(a) {
|
|
13
13
|
return a && a.__esModule ? a.default : a;
|
|
14
14
|
}
|
|
15
|
-
const $0766c85d387a9765$export$83d89fbfd8236492 = "1.0.
|
|
15
|
+
const $0766c85d387a9765$export$83d89fbfd8236492 = "1.0.48";
|
|
16
16
|
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" && (globalThis?.document?.currentScript?.dataset?.debug === "true" || globalThis?.localStorage?.getItem?.("debug") === "true"))();
|
|
17
17
|
const $649f456f663da9fc$var$browser_prefix_styling = "color: #fff;";
|
|
18
18
|
let $649f456f663da9fc$var$browser_prefix = "[Depict]";
|
|
@@ -5175,7 +5175,7 @@ function $30e801eaa3dc319e$export$483bdd1f1186de13(rows, max_recs, options) {
|
|
|
5175
5175
|
while ((visible_recs = $30e801eaa3dc319e$export$3dc5e2383c924ebf(rows--, options)) > max_recs);
|
|
5176
5176
|
return visible_recs;
|
|
5177
5177
|
}
|
|
5178
|
-
function $30e801eaa3dc319e$export$17c3166a7ebd4688(selector_beginning, default_grid_spacing_text, cols_at_size, layout, override_vertical_spacing) {
|
|
5178
|
+
function $30e801eaa3dc319e$export$17c3166a7ebd4688(selector_beginning, default_grid_spacing_text, cols_at_size, layout, override_vertical_spacing, only_generate_top_margins) {
|
|
5179
5179
|
function get_width_of_middle_elements(n_cols, spacing) {
|
|
5180
5180
|
return `width:${$30e801eaa3dc319e$var$css_subtract($30e801eaa3dc319e$var$css_divide(new $30e801eaa3dc319e$var$CSSMeasurement("100%"), n_cols), $30e801eaa3dc319e$var$css_divide($30e801eaa3dc319e$var$css_multiply(n_cols * 2 - 2, spacing), n_cols))}`;
|
|
5181
5181
|
}
|
|
@@ -5190,7 +5190,8 @@ function $30e801eaa3dc319e$export$17c3166a7ebd4688(selector_beginning, default_g
|
|
|
5190
5190
|
return left_removed_css + right_removed_css;
|
|
5191
5191
|
}
|
|
5192
5192
|
function get_vertical_spacing_css(selector, spacing, options) {
|
|
5193
|
-
const
|
|
5193
|
+
const shorten_top_row_by = only_generate_top_margins ?? 0;
|
|
5194
|
+
const top_row_selector = `${selector}:nth-child(n+1):nth-child(-n+${$30e801eaa3dc319e$export$3dc5e2383c924ebf(1, options) - shorten_top_row_by})`;
|
|
5194
5195
|
const between_spacing_css = `${selector}:not(${top_row_selector}){margin-top:${override_vertical_spacing ?? $30e801eaa3dc319e$var$css_multiply(spacing, 2)}}`;
|
|
5195
5196
|
return between_spacing_css;
|
|
5196
5197
|
}
|
|
@@ -5226,10 +5227,12 @@ function $30e801eaa3dc319e$export$17c3166a7ebd4688(selector_beginning, default_g
|
|
|
5226
5227
|
const is_last_iteration = row === max_row;
|
|
5227
5228
|
let row_selector = selector_beginning;
|
|
5228
5229
|
if (is_last_iteration) row_selector += `:nth-child(n+${start})`;else row_selector += `:nth-child(n+${start}):nth-child(-n+${end})`;
|
|
5229
|
-
|
|
5230
|
-
|
|
5230
|
+
if (only_generate_top_margins == undefined) {
|
|
5231
|
+
media_query_body += get_width_css(real_n_cols, row_selector, half_spacing);
|
|
5232
|
+
media_query_body += get_horizontal_spacing_css(start, end, row_selector, half_spacing);
|
|
5233
|
+
}
|
|
5231
5234
|
media_query_body += get_vertical_spacing_css(row_selector, half_spacing, options);
|
|
5232
|
-
if (is_last_iteration) media_query_body += get_left_right_0_spacing_rest_of_rows_css(n_cols, start, selector_beginning);
|
|
5235
|
+
if (is_last_iteration && only_generate_top_margins == undefined) media_query_body += get_left_right_0_spacing_rest_of_rows_css(n_cols, start, selector_beginning);
|
|
5233
5236
|
}
|
|
5234
5237
|
} else if (layout == "slider") {
|
|
5235
5238
|
const margin_and_width_of_middle_elements = get_width_css(n_cols, `${selector_beginning}*`, half_spacing);
|
|
@@ -8071,7 +8074,7 @@ function $4d49697a7a9a77a6$export$9dc8f3a0aa3efc85(obj) {
|
|
|
8071
8074
|
}
|
|
8072
8075
|
function $4d49697a7a9a77a6$export$b481488de1caa85(obj) {
|
|
8073
8076
|
return Object.fromEntries(Object.entries(obj).map(([key, value]) => [key.replace(/[A-Z]/g, match => "_" + match.toLowerCase()), value]));
|
|
8074
|
-
}
|
|
8077
|
+
} // Surce: https://gist.github.com/kuroski/9a7ae8e5e5c9e22985364d1ddbf3389d
|
|
8075
8078
|
|
|
8076
8079
|
/**
|
|
8077
8080
|
* Converts RGB to HSL
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/utilishared",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.48",
|
|
4
4
|
"packageManager": "yarn@3.2.2",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"types": "ES10/index.d.ts",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"@babel/core": "latest",
|
|
82
82
|
"@depict-ai/types": "^1.0.39",
|
|
83
83
|
"@parcel/resolver-default": "^2.9.3",
|
|
84
|
-
"@sentry/cli": "
|
|
85
|
-
"@sentry/types": "^7.
|
|
84
|
+
"@sentry/cli": "^2.21.2",
|
|
85
|
+
"@sentry/types": "^7.75.1",
|
|
86
86
|
"@types/jest": "^29.2.5",
|
|
87
87
|
"@types/node": "^18.11.9",
|
|
88
88
|
"jest": "^29.3.1",
|
|
@@ -93,8 +93,8 @@
|
|
|
93
93
|
"@babel/plugin-transform-typescript": "^7.22.9",
|
|
94
94
|
"@babel/runtime": "latest",
|
|
95
95
|
"@babel/runtime-corejs3": "latest",
|
|
96
|
-
"@sentry/browser": "^7.
|
|
97
|
-
"solid-js": "^1.
|
|
96
|
+
"@sentry/browser": "^7.75.1",
|
|
97
|
+
"solid-js": "^1.8.1"
|
|
98
98
|
},
|
|
99
99
|
"type": "module",
|
|
100
100
|
"main": "ES10/index.cjs",
|