@depict-ai/ui 2.0.20 → 2.0.22
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 +59 -32
- package/ES10/index.d.ts +5 -5
- package/ES10/index.js +60 -33
- package/latest/index.cjs +55 -26
- package/latest/index.d.ts +5 -5
- package/latest/index.js +56 -27
- package/package.json +2 -2
- package/server/ES10/index.cjs +50 -30
- package/server/ES10/index.d.ts +5 -5
- package/server/ES10/index.js +51 -31
- package/server/latest/index.cjs +46 -24
- package/server/latest/index.d.ts +5 -5
- package/server/latest/index.js +47 -25
- package/locales/require.js +0 -1152
package/server/latest/index.cjs
CHANGED
|
@@ -66,7 +66,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$expo
|
|
|
66
66
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
|
|
67
67
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
68
68
|
/*! Depict.ai search and product listing SDK */
|
|
69
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "2.0.
|
|
69
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "2.0.22";
|
|
70
70
|
const $84798aaa863a4909$var$ListingContext = /*@__PURE__*/$5vyXB$solidjs.createContext();
|
|
71
71
|
function $84798aaa863a4909$export$e68cff63f76bd15b(props) {
|
|
72
72
|
const our_object = {};
|
|
@@ -990,6 +990,14 @@ function $c77c68e559a1506c$export$3b621d86b1566b2(props = {}) {
|
|
|
990
990
|
"viewBox": "0 0 21.064 21.064"
|
|
991
991
|
}), () => $5vyXB$solidjsweb.ssr($c77c68e559a1506c$var$_tmpl$), true);
|
|
992
992
|
}
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* Lower cases a string if possible. Mostly used to make the filter url values case-insensitive.
|
|
996
|
+
*/
|
|
997
|
+
function $daa394359b026187$export$325f75597868c4f0(stuff) {
|
|
998
|
+
if (typeof stuff !== "string") return stuff;
|
|
999
|
+
return stuff.toLowerCase();
|
|
1000
|
+
}
|
|
993
1001
|
const $235a2771a44e28e9$var$_tmpl$ = ["<button", ' class="clear-all-filters minor">', "</button>"],
|
|
994
1002
|
$235a2771a44e28e9$var$_tmpl$2 = ["<div", ' class="inner"><span class="title"><!--#-->', "<!--/-->: </span><!--#-->", "<!--/--></div>"],
|
|
995
1003
|
$235a2771a44e28e9$var$_tmpl$3 = ["<button", ' class="clear-filter major"><!--#-->', "<!--/--><span><!--#-->", "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--> – <!--#-->", "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--></span></button>"],
|
|
@@ -1052,7 +1060,7 @@ function $235a2771a44e28e9$export$fecbb157621501bd({
|
|
|
1052
1060
|
let parent_ = {};
|
|
1053
1061
|
let created_an_object = false;
|
|
1054
1062
|
for (let j = 0; j < value.length; j++) {
|
|
1055
|
-
const this_categories_name = value[j];
|
|
1063
|
+
const this_categories_name = $daa394359b026187$export$325f75597868c4f0(value[j]);
|
|
1056
1064
|
const obj = pointer[this_categories_name] ||= (() => {
|
|
1057
1065
|
const value_as_string = value.map(v => typeof v === "number" ? v + "" : v); // don't think backend will ever send numbers but technically it's allowed;
|
|
1058
1066
|
const created_obj = {
|
|
@@ -1124,7 +1132,7 @@ function $235a2771a44e28e9$export$fecbb157621501bd({
|
|
|
1124
1132
|
const index_of_us_in_meta = $5vyXB$solidjs.createMemo(() => {
|
|
1125
1133
|
const sel_d = selected_data();
|
|
1126
1134
|
return meta()?.values?.findIndex(value => {
|
|
1127
|
-
return value === sel_d || Array.isArray(value) && Array.isArray(sel_d) && value.length === sel_d.length && value.every((item, index) => sel_d[index] === item);
|
|
1135
|
+
return $daa394359b026187$export$325f75597868c4f0(value) === $daa394359b026187$export$325f75597868c4f0(sel_d) || Array.isArray(value) && Array.isArray(sel_d) && value.length === sel_d.length && value.every((item, index) => $daa394359b026187$export$325f75597868c4f0(sel_d[index]) === $daa394359b026187$export$325f75597868c4f0(item));
|
|
1128
1136
|
});
|
|
1129
1137
|
});
|
|
1130
1138
|
const name = $5vyXB$solidjs.createMemo(() => {
|
|
@@ -1138,7 +1146,7 @@ function $235a2771a44e28e9$export$fecbb157621501bd({
|
|
|
1138
1146
|
let we_in_structure;
|
|
1139
1147
|
let pointer = structure;
|
|
1140
1148
|
for (const step of selected_data()) {
|
|
1141
|
-
we_in_structure = pointer?.[step];
|
|
1149
|
+
we_in_structure = pointer?.[$daa394359b026187$export$325f75597868c4f0(step)];
|
|
1142
1150
|
pointer = we_in_structure?.children_;
|
|
1143
1151
|
}
|
|
1144
1152
|
return we_in_structure;
|
|
@@ -1149,7 +1157,7 @@ function $235a2771a44e28e9$export$fecbb157621501bd({
|
|
|
1149
1157
|
const siblings = parent?.children_;
|
|
1150
1158
|
if (siblings) return [parent, ...Object.values(siblings)].every(({
|
|
1151
1159
|
value_: value_
|
|
1152
|
-
}) => iterable_selected_filter_data()?.some(v => Array.isArray(v) && v.length === value_.length && value_.every((val, index) => v[index] === val)));
|
|
1160
|
+
}) => iterable_selected_filter_data()?.some(v => Array.isArray(v) && v.length === value_.length && value_.every((val, index) => $daa394359b026187$export$325f75597868c4f0(v[index]) === $daa394359b026187$export$325f75597868c4f0(val))));
|
|
1153
1161
|
return false;
|
|
1154
1162
|
});
|
|
1155
1163
|
return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
@@ -1259,6 +1267,11 @@ function $d94869c80e337a3d$export$dd948f91abc3a1c4({
|
|
|
1259
1267
|
});
|
|
1260
1268
|
const render_checkbox = checkbox => {
|
|
1261
1269
|
// Checkbox always calls the getters in props, so we don't wrap these values into memos
|
|
1270
|
+
const is_checked = $5vyXB$solidjs.createMemo(() => {
|
|
1271
|
+
const data = existing_filter()?.data;
|
|
1272
|
+
const value = $daa394359b026187$export$325f75597868c4f0(checkbox().value_);
|
|
1273
|
+
return !!data?.some(item => $daa394359b026187$export$325f75597868c4f0(item) === value);
|
|
1274
|
+
});
|
|
1262
1275
|
return $5vyXB$solidjsweb.createComponent((0, $1c63082b2da848ad$export$48513f6b9f8ce62d), {
|
|
1263
1276
|
get value_() {
|
|
1264
1277
|
return checkbox().value_;
|
|
@@ -1270,7 +1283,7 @@ function $d94869c80e337a3d$export$dd948f91abc3a1c4({
|
|
|
1270
1283
|
return checkbox().count_;
|
|
1271
1284
|
},
|
|
1272
1285
|
get checked_() {
|
|
1273
|
-
return
|
|
1286
|
+
return is_checked();
|
|
1274
1287
|
}
|
|
1275
1288
|
});
|
|
1276
1289
|
};
|
|
@@ -1349,7 +1362,7 @@ function $c1dc1554c1b94233$export$430444115f70a734({
|
|
|
1349
1362
|
return $5vyXB$solidjsweb.ssr($c1dc1554c1b94233$var$_tmpl$3, $5vyXB$solidjsweb.ssrHydrationKey(), `input-row ${count() === 0 ? "count-0" : ""}`, $5vyXB$solidjsweb.ssrAttribute("for", $5vyXB$solidjsweb.escape(random_selector, true), false), $5vyXB$solidjsweb.ssrAttribute("id", $5vyXB$solidjsweb.escape(random_selector, true), false) + $5vyXB$solidjsweb.ssrAttribute("name", $5vyXB$solidjsweb.escape(radio_name, true), false), $5vyXB$solidjsweb.ssrAttribute("checked", $5vyXB$solidjs.createMemo(() => {
|
|
1350
1363
|
const v = value();
|
|
1351
1364
|
const data = existing_filter()?.data;
|
|
1352
|
-
if (data === v) return true;
|
|
1365
|
+
if ($daa394359b026187$export$325f75597868c4f0(data) === $daa394359b026187$export$325f75597868c4f0(v)) return true;
|
|
1353
1366
|
return Array.isArray(data) && data.every((item, index) => item === v[index]);
|
|
1354
1367
|
})(), true), $5vyXB$solidjsweb.escape($5vyXB$solidjs.createMemo(() => {
|
|
1355
1368
|
const name = filter_().meta?.names?.[index];
|
|
@@ -1887,7 +1900,7 @@ function $3bdc00a1353c1150$var$create_updating_signal({
|
|
|
1887
1900
|
const on_structure_complete_ = () => {
|
|
1888
1901
|
// wait for the children to have populated and us to have received the correct value_ and name_ values
|
|
1889
1902
|
let updating_blocked = false;
|
|
1890
|
-
const index_of_us_in_selected_filter = existing_filter_?.data?.findIndex?.(el => el.length === self_.value_.length && el.every((sub_el, index) => self_.value_[index] === sub_el));
|
|
1903
|
+
const index_of_us_in_selected_filter = existing_filter_?.data?.findIndex?.(el => el.length === self_.value_.length && el.every((sub_el, index) => $daa394359b026187$export$325f75597868c4f0(self_.value_[index]) === $daa394359b026187$export$325f75597868c4f0(sub_el)));
|
|
1891
1904
|
signal_.push(...$5vyXB$solidjs.createSignal(index_of_us_in_selected_filter >= 0));
|
|
1892
1905
|
const [read_checked, write_checked] = signal_;
|
|
1893
1906
|
const child_objects = Object.values(self_.children_);
|
|
@@ -2053,7 +2066,11 @@ const $0ef1681699140f1a$export$414f6a19d38e655c = ({
|
|
|
2053
2066
|
return buttons();
|
|
2054
2067
|
},
|
|
2055
2068
|
children: value => {
|
|
2056
|
-
const is_selected = $5vyXB$solidjs.createMemo(() =>
|
|
2069
|
+
const is_selected = $5vyXB$solidjs.createMemo(() => {
|
|
2070
|
+
const data = existing_filter()?.data;
|
|
2071
|
+
const current_value = $daa394359b026187$export$325f75597868c4f0(value().value_);
|
|
2072
|
+
return !!data?.some(item => $daa394359b026187$export$325f75597868c4f0(item) === current_value);
|
|
2073
|
+
});
|
|
2057
2074
|
const MakeButton = attributes => $5vyXB$solidjsweb.ssrElement("button", () => ({
|
|
2058
2075
|
...attributes,
|
|
2059
2076
|
"disabled": value().count_ === 0 && !is_selected(),
|
|
@@ -2150,13 +2167,6 @@ function $0ef1681699140f1a$var$adjust_sizes(container_width, sizes, set_cols_at_
|
|
|
2150
2167
|
overrides: column_to_row_result
|
|
2151
2168
|
}]]);
|
|
2152
2169
|
}
|
|
2153
|
-
function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
|
|
2154
|
-
const signal = $5vyXB$solidjs.createSignal(false);
|
|
2155
|
-
$5vyXB$solidjs.onCleanup($5vyXB$depictaiutilishared.javascript_media_query(media_query, ({
|
|
2156
|
-
matches: matches
|
|
2157
|
-
}) => signal[1](matches)).remove);
|
|
2158
|
-
return signal[0];
|
|
2159
|
-
}
|
|
2160
2170
|
const $b51a2b8b9355e66c$var$_tmpl$ = ["<form", ' class="checkbox-color"><!--#-->', "<!--/--><!--#-->", "<!--/--></form>"];
|
|
2161
2171
|
const $b51a2b8b9355e66c$var$max_visible_without_collapsing = 30;
|
|
2162
2172
|
const $b51a2b8b9355e66c$var$show_non_collapsible_when_collapsed = 8;
|
|
@@ -2166,7 +2176,6 @@ function $b51a2b8b9355e66c$export$82ed4b28ecb67608({
|
|
|
2166
2176
|
i18n_: i18n_,
|
|
2167
2177
|
view_more_button_below_group_: [_get_view_more_button_below_group_, set_view_more_button_below_group_]
|
|
2168
2178
|
}) {
|
|
2169
|
-
const supports_hover = $b54e6192d0caa293$export$d9f36cf74e24d595("not all and (hover: none)");
|
|
2170
2179
|
// same as in CheckboxFilter, maybe we should make this DRY at some point
|
|
2171
2180
|
const existing_filter = $5vyXB$solidjs.createMemo(() => {
|
|
2172
2181
|
const {
|
|
@@ -2194,6 +2203,11 @@ function $b51a2b8b9355e66c$export$82ed4b28ecb67608({
|
|
|
2194
2203
|
const hex_color = $5vyXB$solidjs.createMemo(() => checkbox().value_.split(";")?.[1] || "");
|
|
2195
2204
|
const rgb_color = $5vyXB$solidjs.createMemo(() => $5vyXB$depictaiutilishared.hex_to_rgb(hex_color()));
|
|
2196
2205
|
const black_contrast_better = $5vyXB$solidjs.createMemo(() => rgb_color() ? $b51a2b8b9355e66c$var$does_black_contrast_better(rgb_color()) : false);
|
|
2206
|
+
const is_checked = $5vyXB$solidjs.createMemo(() => {
|
|
2207
|
+
const data = existing_filter()?.data;
|
|
2208
|
+
const value = $daa394359b026187$export$325f75597868c4f0(checkbox().value_);
|
|
2209
|
+
return !!data?.some(item => $daa394359b026187$export$325f75597868c4f0(item) === value);
|
|
2210
|
+
});
|
|
2197
2211
|
const input_row = $5vyXB$solidjsweb.createComponent((0, $1c63082b2da848ad$export$48513f6b9f8ce62d), {
|
|
2198
2212
|
get value_() {
|
|
2199
2213
|
return checkbox().value_;
|
|
@@ -2205,7 +2219,7 @@ function $b51a2b8b9355e66c$export$82ed4b28ecb67608({
|
|
|
2205
2219
|
return checkbox().count_;
|
|
2206
2220
|
},
|
|
2207
2221
|
get checked_() {
|
|
2208
|
-
return
|
|
2222
|
+
return is_checked();
|
|
2209
2223
|
},
|
|
2210
2224
|
custom_indicator_ref: span => {
|
|
2211
2225
|
const {
|
|
@@ -2358,7 +2372,7 @@ function $b064919833b3e80b$export$53c59af873b303c9({
|
|
|
2358
2372
|
break try_specific;
|
|
2359
2373
|
}
|
|
2360
2374
|
const needle = data_is_array ? data[0] : data;
|
|
2361
|
-
const index_in_meta = meta.values.findIndex(value => needle === value || Array.isArray(needle) && Array.isArray(value) && needle.length === value.length && value.every((item, index) => needle[index] === item));
|
|
2375
|
+
const index_in_meta = meta.values.findIndex(value => $daa394359b026187$export$325f75597868c4f0(needle) === $daa394359b026187$export$325f75597868c4f0(value) || Array.isArray(needle) && Array.isArray(value) && needle.length === value.length && value.every((item, index) => $daa394359b026187$export$325f75597868c4f0(needle[index]) === $daa394359b026187$export$325f75597868c4f0(item)));
|
|
2362
2376
|
return meta.names?.[index_in_meta] || meta.values?.[index_in_meta];
|
|
2363
2377
|
}
|
|
2364
2378
|
}
|
|
@@ -2455,7 +2469,7 @@ const $aff9a96d30ed3563$var$_tmpl$ = ["<div", ' class="filter-collapsible">', "<
|
|
|
2455
2469
|
$aff9a96d30ed3563$var$_tmpl$2 = ["<button", ' class="clear-group"><!--#-->', "<!--/--><span>", "</span></button>"],
|
|
2456
2470
|
$aff9a96d30ed3563$var$_tmpl$3 = ["<div", ' class="view-more-clear"><!--#-->', "<!--/--><!--#-->", "<!--/--></div>"],
|
|
2457
2471
|
$aff9a96d30ed3563$var$_tmpl$4 = ["<div", ' class="filter-collapsible-body"><div class="filter-part">', "</div><!--#-->", "<!--/--></div>"],
|
|
2458
|
-
$aff9a96d30ed3563$var$_tmpl$5 = ["<details", ' class="filter-collapsible"></details>
|
|
2472
|
+
$aff9a96d30ed3563$var$_tmpl$5 = ["<details", ' class="filter-collapsible"', "></details>"],
|
|
2459
2473
|
$aff9a96d30ed3563$var$_tmpl$6 = ["<summary", ' class="filter-group-summary"><div class="summary"><span>', '</span><div class="selected-w-sign"><!--#-->', "<!--/--><!--#-->", "<!--/--></div></div></summary>"],
|
|
2460
2474
|
$aff9a96d30ed3563$var$_tmpl$7 = ["<div", ' class="ungrouped">', "</div>"],
|
|
2461
2475
|
$aff9a96d30ed3563$var$_tmpl$8 = ["<button", ' class="clear-all-filters major">', "</button>"];
|
|
@@ -2520,7 +2534,7 @@ function $aff9a96d30ed3563$var$ActualFilterBody(props) {
|
|
|
2520
2534
|
return $5vyXB$solidjsweb.createComponent((0, $a69e505a12a77874$export$6c6d7a51fa9aa15d), {
|
|
2521
2535
|
is_open_: is_open,
|
|
2522
2536
|
get details_() {
|
|
2523
|
-
return $5vyXB$solidjsweb.ssr($aff9a96d30ed3563$var$_tmpl$5, $5vyXB$solidjsweb.ssrHydrationKey());
|
|
2537
|
+
return $5vyXB$solidjsweb.ssr($aff9a96d30ed3563$var$_tmpl$5, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrAttribute("data-group-title", $5vyXB$solidjsweb.escape(section_, true), false));
|
|
2524
2538
|
},
|
|
2525
2539
|
get summary_() {
|
|
2526
2540
|
return $5vyXB$solidjsweb.ssr($aff9a96d30ed3563$var$_tmpl$6, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape(section_), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
@@ -2829,7 +2843,8 @@ function $6e22b5314fb52f4c$export$e183a13865960371(params_to_default_value, rout
|
|
|
2829
2843
|
const signals = {};
|
|
2830
2844
|
const entries = Object.entries(params_to_default_value);
|
|
2831
2845
|
const event_handler = $5vyXB$depictaiutilishared.catchify((what_happened, args) => {
|
|
2832
|
-
|
|
2846
|
+
// Intentionally always update our signals to the history state to allow external control of SDK state for doing things like https://linear.app/depictai/issue/X-1432/is-this-possible-with-the-depict-sdk
|
|
2847
|
+
$6e22b5314fb52f4c$var$history_state_change(signals, entries, what_happened === "popstate" ? args.state : history.state);
|
|
2833
2848
|
});
|
|
2834
2849
|
// createRenderEffect because we need the instant execution so the signals always contain values, even before solid's render phase
|
|
2835
2850
|
$5vyXB$solidjs.createRenderEffect(() => {
|
|
@@ -3198,6 +3213,13 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
3198
3213
|
}));
|
|
3199
3214
|
}
|
|
3200
3215
|
}
|
|
3216
|
+
function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
|
|
3217
|
+
const signal = $5vyXB$solidjs.createSignal(false);
|
|
3218
|
+
$5vyXB$solidjs.onCleanup($5vyXB$depictaiutilishared.javascript_media_query(media_query, ({
|
|
3219
|
+
matches: matches
|
|
3220
|
+
}) => signal[1](matches)).remove);
|
|
3221
|
+
return signal[0];
|
|
3222
|
+
}
|
|
3201
3223
|
const $6b384adf40a5f4d7$var$get_available_range = (available_filters_, search_for_field) => {
|
|
3202
3224
|
const maybe_meta = $5vyXB$solidjs.untrack(available_filters_)?.find(({
|
|
3203
3225
|
op: op,
|
|
@@ -8990,7 +9012,7 @@ class $0a6acf31d1eae57c$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8990
9012
|
}, "failed to open page");
|
|
8991
9013
|
#empty_page_bugfix() {
|
|
8992
9014
|
// Called when a "page" is "opened" using PageReplacer
|
|
8993
|
-
const on_maybe_popstate = what_happened => {
|
|
9015
|
+
const on_maybe_popstate = $5vyXB$depictaiutilishared.catchify(what_happened => {
|
|
8994
9016
|
if (what_happened !== "popstate") return;
|
|
8995
9017
|
const cleaned_current_url = $0a6acf31d1eae57c$var$clean_url(location.href);
|
|
8996
9018
|
if (!$0a6acf31d1eae57c$export$3ccaa27d81dd8556.#visited_urls.has(cleaned_current_url)) {
|
|
@@ -9019,7 +9041,7 @@ class $0a6acf31d1eae57c$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
9019
9041
|
$0a6acf31d1eae57c$export$3ccaa27d81dd8556.#reverting_permitted = false; // Disallow any reverting since we can't - it would flash a white page until the reload has finished.
|
|
9020
9042
|
this.#unload(); // Call unload to "kill" the solid-js stuff quicker so that it stops updating - the user is expecting the next thing that happens to be a navigation to the actual page the URL says they're on.
|
|
9021
9043
|
}
|
|
9022
|
-
};
|
|
9044
|
+
});
|
|
9023
9045
|
|
|
9024
9046
|
(0, $5vyXB$depictaiutilishared.instant_exec_on_suspect_history_change).add(on_maybe_popstate);
|
|
9025
9047
|
this.#revert_fns.push(() => (0, $5vyXB$depictaiutilishared.instant_exec_on_suspect_history_change).delete(on_maybe_popstate)); // Don't run the bugfixer if there isn't a PageReplacer page open since I assume the bug only happens when going back from a PageReplace'd page
|
package/server/latest/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { CategorySuggestion, SearchSuggestionsResponse } from "@depict-ai/types/
|
|
|
7
7
|
import { BaseSearchRequest } from "@depict-ai/types/api/BaseSearchRequest";
|
|
8
8
|
import { SearchSuggestionsRequest } from "@depict-ai/types/api/SearchSuggestionsRequest";
|
|
9
9
|
import { ProductListingRequest } from "@depict-ai/types/api/ProductListingRequest";
|
|
10
|
-
export const version = "2.0.
|
|
10
|
+
export const version = "2.0.22";
|
|
11
11
|
/**
|
|
12
12
|
* Provider to wrap every listing (group of products) in
|
|
13
13
|
* Used for example for deduplicating ResizeObservers for responsive images
|
|
@@ -342,10 +342,6 @@ export function SelectedFilters({
|
|
|
342
342
|
selected_filters_: Signal<FilterWithData[]>;
|
|
343
343
|
local_filter_cache_: Signal<SearchFilter[]>;
|
|
344
344
|
}): HTMLDivElement;
|
|
345
|
-
/**
|
|
346
|
-
* Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
|
|
347
|
-
*/
|
|
348
|
-
export function media_query_to_accessor(media_query: string): import("solid-js").Accessor<boolean>;
|
|
349
345
|
/**
|
|
350
346
|
* Base placeholder component used by ImagePlaceholder and TextPlaceholder
|
|
351
347
|
*/
|
|
@@ -614,6 +610,10 @@ export class DepictAPI<InputDisplay extends Display, OutputDisplay extends Moder
|
|
|
614
610
|
failed?: true | undefined;
|
|
615
611
|
}>;
|
|
616
612
|
}
|
|
613
|
+
/**
|
|
614
|
+
* Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
|
|
615
|
+
*/
|
|
616
|
+
export function media_query_to_accessor(media_query: string): import("solid-js").Accessor<boolean>;
|
|
617
617
|
/**
|
|
618
618
|
* Disables scrolling until the solidjs reactive scoped is disposed (onCleanup)
|
|
619
619
|
* @returns A cleanup function to manually re-enable scrolling.
|
package/server/latest/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { add_to_version_info as $i7OB2$add_to_version_info, queueMacroTask as $i7OB2$queueMacroTask, catchify as $i7OB2$catchify, is_safari as $i7OB2$is_safari, observer as $i7OB2$observer, Amazing_Slider as $i7OB2$Amazing_Slider, slider_snap_css as $i7OB2$slider_snap_css, slider_fading_factory as $i7OB2$slider_fading_factory, slider_fractional_factory as $i7OB2$slider_fractional_factory, dlog as $i7OB2$dlog, camelCasifyObject as $i7OB2$camelCasifyObject, make_random_classname as $i7OB2$make_random_classname, n_col_styling_with_dist as $i7OB2$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $i7OB2$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $i7OB2$layout_get_total_rec_amount_for_row, layout_media_query_header as $i7OB2$layout_media_query_header, report as $i7OB2$report, useExpandingContainer as $i7OB2$useExpandingContainer, standard_price_format as $i7OB2$standard_price_format, hex_to_rgb as $i7OB2$hex_to_rgb, relative_luminance_from_rgb as $i7OB2$relative_luminance_from_rgb,
|
|
1
|
+
import { add_to_version_info as $i7OB2$add_to_version_info, queueMacroTask as $i7OB2$queueMacroTask, catchify as $i7OB2$catchify, is_safari as $i7OB2$is_safari, observer as $i7OB2$observer, Amazing_Slider as $i7OB2$Amazing_Slider, slider_snap_css as $i7OB2$slider_snap_css, slider_fading_factory as $i7OB2$slider_fading_factory, slider_fractional_factory as $i7OB2$slider_fractional_factory, dlog as $i7OB2$dlog, camelCasifyObject as $i7OB2$camelCasifyObject, make_random_classname as $i7OB2$make_random_classname, n_col_styling_with_dist as $i7OB2$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $i7OB2$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $i7OB2$layout_get_total_rec_amount_for_row, layout_media_query_header as $i7OB2$layout_media_query_header, report as $i7OB2$report, useExpandingContainer as $i7OB2$useExpandingContainer, standard_price_format as $i7OB2$standard_price_format, hex_to_rgb as $i7OB2$hex_to_rgb, relative_luminance_from_rgb as $i7OB2$relative_luminance_from_rgb, fetch_recs as $i7OB2$fetch_recs, snakeCasifyObject as $i7OB2$snakeCasifyObject, instant_exec_on_suspect_history_change as $i7OB2$instant_exec_on_suspect_history_change, base_url as $i7OB2$base_url, get_depict_id as $i7OB2$get_depict_id, get_user_id as $i7OB2$get_user_id, get_session_id as $i7OB2$get_session_id, sort_obj as $i7OB2$sort_obj, fetch_retry as $i7OB2$fetch_retry, add_version_query_params as $i7OB2$add_version_query_params, dwarn as $i7OB2$dwarn, make_url_with_query_params as $i7OB2$make_url_with_query_params, edit_current_page_meta_tags as $i7OB2$edit_current_page_meta_tags, javascript_media_query as $i7OB2$javascript_media_query, use_href_accessor as $i7OB2$use_href_accessor, base64_encode_unicode as $i7OB2$base64_encode_unicode, base64_decode_unicode as $i7OB2$base64_decode_unicode, make_asyncIterable_exiter as $i7OB2$make_asyncIterable_exiter, href_change_ipns as $i7OB2$href_change_ipns, ContainedImage as $i7OB2$ContainedImage, deparallelize_no_drop as $i7OB2$deparallelize_no_drop, ListenableSet as $i7OB2$ListenableSet, insert_surfaces as $i7OB2$insert_surfaces } from "@depict-ai/utilishared/latest";
|
|
2
2
|
import { createComponent as $i7OB2$createComponent, ssr as $i7OB2$ssr, ssrHydrationKey as $i7OB2$ssrHydrationKey, ssrStyle as $i7OB2$ssrStyle, ssrElement as $i7OB2$ssrElement, escape as $i7OB2$escape, insert as $i7OB2$insert, ssrAttribute as $i7OB2$ssrAttribute, mergeProps as $i7OB2$mergeProps, isServer as $i7OB2$isServer, ssrClassList as $i7OB2$ssrClassList, Dynamic as $i7OB2$Dynamic } from "solid-js/web";
|
|
3
3
|
import { createSignal as $i7OB2$createSignal, getOwner as $i7OB2$getOwner, createEffect as $i7OB2$createEffect, runWithOwner as $i7OB2$runWithOwner, onCleanup as $i7OB2$onCleanup, createMemo as $i7OB2$createMemo, createContext as $i7OB2$createContext, useContext as $i7OB2$useContext, createResource as $i7OB2$createResource, Suspense as $i7OB2$Suspense, Show as $i7OB2$Show, createRenderEffect as $i7OB2$createRenderEffect, createRoot as $i7OB2$createRoot, For as $i7OB2$For, createUniqueId as $i7OB2$createUniqueId, untrack as $i7OB2$untrack, createComputed as $i7OB2$createComputed, ErrorBoundary as $i7OB2$ErrorBoundary, Index as $i7OB2$Index, on as $i7OB2$on, batch as $i7OB2$batch, createReaction as $i7OB2$createReaction } from "solid-js";
|
|
4
4
|
|
|
5
5
|
/*! Depict.ai search and product listing SDK */
|
|
6
6
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
7
7
|
register_es_version("ui", "latest");
|
|
8
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "2.0.
|
|
8
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "2.0.22";
|
|
9
9
|
const $011607bdf658f807$var$ListingContext = /*@__PURE__*/$i7OB2$createContext();
|
|
10
10
|
function $011607bdf658f807$export$e68cff63f76bd15b(props) {
|
|
11
11
|
const our_object = {};
|
|
@@ -929,6 +929,14 @@ function $19976a74d273070d$export$3b621d86b1566b2(props = {}) {
|
|
|
929
929
|
"viewBox": "0 0 21.064 21.064"
|
|
930
930
|
}), () => $i7OB2$ssr($19976a74d273070d$var$_tmpl$), true);
|
|
931
931
|
}
|
|
932
|
+
|
|
933
|
+
/**
|
|
934
|
+
* Lower cases a string if possible. Mostly used to make the filter url values case-insensitive.
|
|
935
|
+
*/
|
|
936
|
+
function $91aa8ee9f431800d$export$325f75597868c4f0(stuff) {
|
|
937
|
+
if (typeof stuff !== "string") return stuff;
|
|
938
|
+
return stuff.toLowerCase();
|
|
939
|
+
}
|
|
932
940
|
const $1adfe60f3a14a1d7$var$_tmpl$ = ["<button", ' class="clear-all-filters minor">', "</button>"],
|
|
933
941
|
$1adfe60f3a14a1d7$var$_tmpl$2 = ["<div", ' class="inner"><span class="title"><!--#-->', "<!--/-->: </span><!--#-->", "<!--/--></div>"],
|
|
934
942
|
$1adfe60f3a14a1d7$var$_tmpl$3 = ["<button", ' class="clear-filter major"><!--#-->', "<!--/--><span><!--#-->", "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--> – <!--#-->", "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--></span></button>"],
|
|
@@ -991,7 +999,7 @@ function $1adfe60f3a14a1d7$export$fecbb157621501bd({
|
|
|
991
999
|
let parent_ = {};
|
|
992
1000
|
let created_an_object = false;
|
|
993
1001
|
for (let j = 0; j < value.length; j++) {
|
|
994
|
-
const this_categories_name = value[j];
|
|
1002
|
+
const this_categories_name = $91aa8ee9f431800d$export$325f75597868c4f0(value[j]);
|
|
995
1003
|
const obj = pointer[this_categories_name] ||= (() => {
|
|
996
1004
|
const value_as_string = value.map(v => typeof v === "number" ? v + "" : v); // don't think backend will ever send numbers but technically it's allowed;
|
|
997
1005
|
const created_obj = {
|
|
@@ -1063,7 +1071,7 @@ function $1adfe60f3a14a1d7$export$fecbb157621501bd({
|
|
|
1063
1071
|
const index_of_us_in_meta = $i7OB2$createMemo(() => {
|
|
1064
1072
|
const sel_d = selected_data();
|
|
1065
1073
|
return meta()?.values?.findIndex(value => {
|
|
1066
|
-
return value === sel_d || Array.isArray(value) && Array.isArray(sel_d) && value.length === sel_d.length && value.every((item, index) => sel_d[index] === item);
|
|
1074
|
+
return $91aa8ee9f431800d$export$325f75597868c4f0(value) === $91aa8ee9f431800d$export$325f75597868c4f0(sel_d) || Array.isArray(value) && Array.isArray(sel_d) && value.length === sel_d.length && value.every((item, index) => $91aa8ee9f431800d$export$325f75597868c4f0(sel_d[index]) === $91aa8ee9f431800d$export$325f75597868c4f0(item));
|
|
1067
1075
|
});
|
|
1068
1076
|
});
|
|
1069
1077
|
const name = $i7OB2$createMemo(() => {
|
|
@@ -1077,7 +1085,7 @@ function $1adfe60f3a14a1d7$export$fecbb157621501bd({
|
|
|
1077
1085
|
let we_in_structure;
|
|
1078
1086
|
let pointer = structure;
|
|
1079
1087
|
for (const step of selected_data()) {
|
|
1080
|
-
we_in_structure = pointer?.[step];
|
|
1088
|
+
we_in_structure = pointer?.[$91aa8ee9f431800d$export$325f75597868c4f0(step)];
|
|
1081
1089
|
pointer = we_in_structure?.children_;
|
|
1082
1090
|
}
|
|
1083
1091
|
return we_in_structure;
|
|
@@ -1088,7 +1096,7 @@ function $1adfe60f3a14a1d7$export$fecbb157621501bd({
|
|
|
1088
1096
|
const siblings = parent?.children_;
|
|
1089
1097
|
if (siblings) return [parent, ...Object.values(siblings)].every(({
|
|
1090
1098
|
value_: value_
|
|
1091
|
-
}) => iterable_selected_filter_data()?.some(v => Array.isArray(v) && v.length === value_.length && value_.every((val, index) => v[index] === val)));
|
|
1099
|
+
}) => iterable_selected_filter_data()?.some(v => Array.isArray(v) && v.length === value_.length && value_.every((val, index) => $91aa8ee9f431800d$export$325f75597868c4f0(v[index]) === $91aa8ee9f431800d$export$325f75597868c4f0(val))));
|
|
1092
1100
|
return false;
|
|
1093
1101
|
});
|
|
1094
1102
|
return $i7OB2$createComponent((0, $i7OB2$Show), {
|
|
@@ -1198,6 +1206,11 @@ function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({
|
|
|
1198
1206
|
});
|
|
1199
1207
|
const render_checkbox = checkbox => {
|
|
1200
1208
|
// Checkbox always calls the getters in props, so we don't wrap these values into memos
|
|
1209
|
+
const is_checked = $i7OB2$createMemo(() => {
|
|
1210
|
+
const data = existing_filter()?.data;
|
|
1211
|
+
const value = $91aa8ee9f431800d$export$325f75597868c4f0(checkbox().value_);
|
|
1212
|
+
return !!data?.some(item => $91aa8ee9f431800d$export$325f75597868c4f0(item) === value);
|
|
1213
|
+
});
|
|
1201
1214
|
return $i7OB2$createComponent((0, $49b79728e7d9e2a1$export$48513f6b9f8ce62d), {
|
|
1202
1215
|
get value_() {
|
|
1203
1216
|
return checkbox().value_;
|
|
@@ -1209,7 +1222,7 @@ function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({
|
|
|
1209
1222
|
return checkbox().count_;
|
|
1210
1223
|
},
|
|
1211
1224
|
get checked_() {
|
|
1212
|
-
return
|
|
1225
|
+
return is_checked();
|
|
1213
1226
|
}
|
|
1214
1227
|
});
|
|
1215
1228
|
};
|
|
@@ -1288,7 +1301,7 @@ function $eb8d9bf3b5700c26$export$430444115f70a734({
|
|
|
1288
1301
|
return $i7OB2$ssr($eb8d9bf3b5700c26$var$_tmpl$3, $i7OB2$ssrHydrationKey(), `input-row ${count() === 0 ? "count-0" : ""}`, $i7OB2$ssrAttribute("for", $i7OB2$escape(random_selector, true), false), $i7OB2$ssrAttribute("id", $i7OB2$escape(random_selector, true), false) + $i7OB2$ssrAttribute("name", $i7OB2$escape(radio_name, true), false), $i7OB2$ssrAttribute("checked", $i7OB2$createMemo(() => {
|
|
1289
1302
|
const v = value();
|
|
1290
1303
|
const data = existing_filter()?.data;
|
|
1291
|
-
if (data === v) return true;
|
|
1304
|
+
if ($91aa8ee9f431800d$export$325f75597868c4f0(data) === $91aa8ee9f431800d$export$325f75597868c4f0(v)) return true;
|
|
1292
1305
|
return Array.isArray(data) && data.every((item, index) => item === v[index]);
|
|
1293
1306
|
})(), true), $i7OB2$escape($i7OB2$createMemo(() => {
|
|
1294
1307
|
const name = filter_().meta?.names?.[index];
|
|
@@ -1826,7 +1839,7 @@ function $1c8cac76cb67e9af$var$create_updating_signal({
|
|
|
1826
1839
|
const on_structure_complete_ = () => {
|
|
1827
1840
|
// wait for the children to have populated and us to have received the correct value_ and name_ values
|
|
1828
1841
|
let updating_blocked = false;
|
|
1829
|
-
const index_of_us_in_selected_filter = existing_filter_?.data?.findIndex?.(el => el.length === self_.value_.length && el.every((sub_el, index) => self_.value_[index] === sub_el));
|
|
1842
|
+
const index_of_us_in_selected_filter = existing_filter_?.data?.findIndex?.(el => el.length === self_.value_.length && el.every((sub_el, index) => $91aa8ee9f431800d$export$325f75597868c4f0(self_.value_[index]) === $91aa8ee9f431800d$export$325f75597868c4f0(sub_el)));
|
|
1830
1843
|
signal_.push(...$i7OB2$createSignal(index_of_us_in_selected_filter >= 0));
|
|
1831
1844
|
const [read_checked, write_checked] = signal_;
|
|
1832
1845
|
const child_objects = Object.values(self_.children_);
|
|
@@ -1992,7 +2005,11 @@ const $93716a9ad0dea854$export$414f6a19d38e655c = ({
|
|
|
1992
2005
|
return buttons();
|
|
1993
2006
|
},
|
|
1994
2007
|
children: value => {
|
|
1995
|
-
const is_selected = $i7OB2$createMemo(() =>
|
|
2008
|
+
const is_selected = $i7OB2$createMemo(() => {
|
|
2009
|
+
const data = existing_filter()?.data;
|
|
2010
|
+
const current_value = $91aa8ee9f431800d$export$325f75597868c4f0(value().value_);
|
|
2011
|
+
return !!data?.some(item => $91aa8ee9f431800d$export$325f75597868c4f0(item) === current_value);
|
|
2012
|
+
});
|
|
1996
2013
|
const MakeButton = attributes => $i7OB2$ssrElement("button", () => ({
|
|
1997
2014
|
...attributes,
|
|
1998
2015
|
"disabled": value().count_ === 0 && !is_selected(),
|
|
@@ -2089,13 +2106,6 @@ function $93716a9ad0dea854$var$adjust_sizes(container_width, sizes, set_cols_at_
|
|
|
2089
2106
|
overrides: column_to_row_result
|
|
2090
2107
|
}]]);
|
|
2091
2108
|
}
|
|
2092
|
-
function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
|
|
2093
|
-
const signal = $i7OB2$createSignal(false);
|
|
2094
|
-
$i7OB2$onCleanup($i7OB2$javascript_media_query(media_query, ({
|
|
2095
|
-
matches: matches
|
|
2096
|
-
}) => signal[1](matches)).remove);
|
|
2097
|
-
return signal[0];
|
|
2098
|
-
}
|
|
2099
2109
|
const $e731d52d97444b7c$var$_tmpl$ = ["<form", ' class="checkbox-color"><!--#-->', "<!--/--><!--#-->", "<!--/--></form>"];
|
|
2100
2110
|
const $e731d52d97444b7c$var$max_visible_without_collapsing = 30;
|
|
2101
2111
|
const $e731d52d97444b7c$var$show_non_collapsible_when_collapsed = 8;
|
|
@@ -2105,7 +2115,6 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({
|
|
|
2105
2115
|
i18n_: i18n_,
|
|
2106
2116
|
view_more_button_below_group_: [_get_view_more_button_below_group_, set_view_more_button_below_group_]
|
|
2107
2117
|
}) {
|
|
2108
|
-
const supports_hover = $dc9262ef6f786812$export$d9f36cf74e24d595("not all and (hover: none)");
|
|
2109
2118
|
// same as in CheckboxFilter, maybe we should make this DRY at some point
|
|
2110
2119
|
const existing_filter = $i7OB2$createMemo(() => {
|
|
2111
2120
|
const {
|
|
@@ -2133,6 +2142,11 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({
|
|
|
2133
2142
|
const hex_color = $i7OB2$createMemo(() => checkbox().value_.split(";")?.[1] || "");
|
|
2134
2143
|
const rgb_color = $i7OB2$createMemo(() => $i7OB2$hex_to_rgb(hex_color()));
|
|
2135
2144
|
const black_contrast_better = $i7OB2$createMemo(() => rgb_color() ? $e731d52d97444b7c$var$does_black_contrast_better(rgb_color()) : false);
|
|
2145
|
+
const is_checked = $i7OB2$createMemo(() => {
|
|
2146
|
+
const data = existing_filter()?.data;
|
|
2147
|
+
const value = $91aa8ee9f431800d$export$325f75597868c4f0(checkbox().value_);
|
|
2148
|
+
return !!data?.some(item => $91aa8ee9f431800d$export$325f75597868c4f0(item) === value);
|
|
2149
|
+
});
|
|
2136
2150
|
const input_row = $i7OB2$createComponent((0, $49b79728e7d9e2a1$export$48513f6b9f8ce62d), {
|
|
2137
2151
|
get value_() {
|
|
2138
2152
|
return checkbox().value_;
|
|
@@ -2144,7 +2158,7 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({
|
|
|
2144
2158
|
return checkbox().count_;
|
|
2145
2159
|
},
|
|
2146
2160
|
get checked_() {
|
|
2147
|
-
return
|
|
2161
|
+
return is_checked();
|
|
2148
2162
|
},
|
|
2149
2163
|
custom_indicator_ref: span => {
|
|
2150
2164
|
const {
|
|
@@ -2297,7 +2311,7 @@ function $a7b58cb3bcffd156$export$53c59af873b303c9({
|
|
|
2297
2311
|
break try_specific;
|
|
2298
2312
|
}
|
|
2299
2313
|
const needle = data_is_array ? data[0] : data;
|
|
2300
|
-
const index_in_meta = meta.values.findIndex(value => needle === value || Array.isArray(needle) && Array.isArray(value) && needle.length === value.length && value.every((item, index) => needle[index] === item));
|
|
2314
|
+
const index_in_meta = meta.values.findIndex(value => $91aa8ee9f431800d$export$325f75597868c4f0(needle) === $91aa8ee9f431800d$export$325f75597868c4f0(value) || Array.isArray(needle) && Array.isArray(value) && needle.length === value.length && value.every((item, index) => $91aa8ee9f431800d$export$325f75597868c4f0(needle[index]) === $91aa8ee9f431800d$export$325f75597868c4f0(item)));
|
|
2301
2315
|
return meta.names?.[index_in_meta] || meta.values?.[index_in_meta];
|
|
2302
2316
|
}
|
|
2303
2317
|
}
|
|
@@ -2394,7 +2408,7 @@ const $fab07f52c9861732$var$_tmpl$ = ["<div", ' class="filter-collapsible">', "<
|
|
|
2394
2408
|
$fab07f52c9861732$var$_tmpl$2 = ["<button", ' class="clear-group"><!--#-->', "<!--/--><span>", "</span></button>"],
|
|
2395
2409
|
$fab07f52c9861732$var$_tmpl$3 = ["<div", ' class="view-more-clear"><!--#-->', "<!--/--><!--#-->", "<!--/--></div>"],
|
|
2396
2410
|
$fab07f52c9861732$var$_tmpl$4 = ["<div", ' class="filter-collapsible-body"><div class="filter-part">', "</div><!--#-->", "<!--/--></div>"],
|
|
2397
|
-
$fab07f52c9861732$var$_tmpl$5 = ["<details", ' class="filter-collapsible"></details>
|
|
2411
|
+
$fab07f52c9861732$var$_tmpl$5 = ["<details", ' class="filter-collapsible"', "></details>"],
|
|
2398
2412
|
$fab07f52c9861732$var$_tmpl$6 = ["<summary", ' class="filter-group-summary"><div class="summary"><span>', '</span><div class="selected-w-sign"><!--#-->', "<!--/--><!--#-->", "<!--/--></div></div></summary>"],
|
|
2399
2413
|
$fab07f52c9861732$var$_tmpl$7 = ["<div", ' class="ungrouped">', "</div>"],
|
|
2400
2414
|
$fab07f52c9861732$var$_tmpl$8 = ["<button", ' class="clear-all-filters major">', "</button>"];
|
|
@@ -2459,7 +2473,7 @@ function $fab07f52c9861732$var$ActualFilterBody(props) {
|
|
|
2459
2473
|
return $i7OB2$createComponent((0, $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d), {
|
|
2460
2474
|
is_open_: is_open,
|
|
2461
2475
|
get details_() {
|
|
2462
|
-
return $i7OB2$ssr($fab07f52c9861732$var$_tmpl$5, $i7OB2$ssrHydrationKey());
|
|
2476
|
+
return $i7OB2$ssr($fab07f52c9861732$var$_tmpl$5, $i7OB2$ssrHydrationKey(), $i7OB2$ssrAttribute("data-group-title", $i7OB2$escape(section_, true), false));
|
|
2463
2477
|
},
|
|
2464
2478
|
get summary_() {
|
|
2465
2479
|
return $i7OB2$ssr($fab07f52c9861732$var$_tmpl$6, $i7OB2$ssrHydrationKey(), $i7OB2$escape(section_), $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
@@ -2768,7 +2782,8 @@ function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value, rout
|
|
|
2768
2782
|
const signals = {};
|
|
2769
2783
|
const entries = Object.entries(params_to_default_value);
|
|
2770
2784
|
const event_handler = $i7OB2$catchify((what_happened, args) => {
|
|
2771
|
-
|
|
2785
|
+
// Intentionally always update our signals to the history state to allow external control of SDK state for doing things like https://linear.app/depictai/issue/X-1432/is-this-possible-with-the-depict-sdk
|
|
2786
|
+
$ca6f574bd8772184$var$history_state_change(signals, entries, what_happened === "popstate" ? args.state : history.state);
|
|
2772
2787
|
});
|
|
2773
2788
|
// createRenderEffect because we need the instant execution so the signals always contain values, even before solid's render phase
|
|
2774
2789
|
$i7OB2$createRenderEffect(() => {
|
|
@@ -3137,6 +3152,13 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
3137
3152
|
}));
|
|
3138
3153
|
}
|
|
3139
3154
|
}
|
|
3155
|
+
function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
|
|
3156
|
+
const signal = $i7OB2$createSignal(false);
|
|
3157
|
+
$i7OB2$onCleanup($i7OB2$javascript_media_query(media_query, ({
|
|
3158
|
+
matches: matches
|
|
3159
|
+
}) => signal[1](matches)).remove);
|
|
3160
|
+
return signal[0];
|
|
3161
|
+
}
|
|
3140
3162
|
const $fc5a12f3a857ca30$var$get_available_range = (available_filters_, search_for_field) => {
|
|
3141
3163
|
const maybe_meta = $i7OB2$untrack(available_filters_)?.find(({
|
|
3142
3164
|
op: op,
|
|
@@ -8929,7 +8951,7 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8929
8951
|
}, "failed to open page");
|
|
8930
8952
|
#empty_page_bugfix() {
|
|
8931
8953
|
// Called when a "page" is "opened" using PageReplacer
|
|
8932
|
-
const on_maybe_popstate = what_happened => {
|
|
8954
|
+
const on_maybe_popstate = $i7OB2$catchify(what_happened => {
|
|
8933
8955
|
if (what_happened !== "popstate") return;
|
|
8934
8956
|
const cleaned_current_url = $753e9b2889a47c89$var$clean_url(location.href);
|
|
8935
8957
|
if (!$753e9b2889a47c89$export$3ccaa27d81dd8556.#visited_urls.has(cleaned_current_url)) {
|
|
@@ -8958,7 +8980,7 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8958
8980
|
$753e9b2889a47c89$export$3ccaa27d81dd8556.#reverting_permitted = false; // Disallow any reverting since we can't - it would flash a white page until the reload has finished.
|
|
8959
8981
|
this.#unload(); // Call unload to "kill" the solid-js stuff quicker so that it stops updating - the user is expecting the next thing that happens to be a navigation to the actual page the URL says they're on.
|
|
8960
8982
|
}
|
|
8961
|
-
};
|
|
8983
|
+
});
|
|
8962
8984
|
|
|
8963
8985
|
(0, $i7OB2$instant_exec_on_suspect_history_change).add(on_maybe_popstate);
|
|
8964
8986
|
this.#revert_fns.push(() => (0, $i7OB2$instant_exec_on_suspect_history_change).delete(on_maybe_popstate)); // Don't run the bugfixer if there isn't a PageReplacer page open since I assume the bug only happens when going back from a PageReplace'd page
|