@depict-ai/react-ui 0.0.64 → 0.0.65

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
@@ -449,7 +449,7 @@ interface UseDepictSearchFieldReturn {
449
449
  * @returns {JSX.Element}
450
450
  */
451
451
  export const useDepictSearchField: (props: SearchFieldProps) => UseDepictSearchFieldReturn;
452
- export const version = "0.0.64";
452
+ export const version = "0.0.65";
453
453
  /**
454
454
  * Helper function to navigate to a new page depending on the navigation library used.
455
455
  */
package/dist/main.js CHANGED
@@ -410,7 +410,6 @@ const $7c8b440edc188ad5$export$89c6019e4baa40b1 = ({ width: width , height: heig
410
410
 
411
411
 
412
412
 
413
-
414
413
  const $ef7db890e488d4f4$export$d69d8daa20eae175 = (createOpenModalParams)=>{
415
414
  const { globalState: globalState , location: location , alignerRef: alignerRef } = createOpenModalParams;
416
415
  const openModal = ()=>{
@@ -423,17 +422,11 @@ const $ef7db890e488d4f4$export$d69d8daa20eae175 = (createOpenModalParams)=>{
423
422
  globalState.search.modal_open = true;
424
423
  return;
425
424
  }
426
- const style_element = document.createElement("style");
427
- document.head.append(style_element);
428
- const resize_observer = new ResizeObserver((0, $4GYXz$depictaiutilishared.catchify)(()=>{
429
- const styles = (0, $4GYXz$depictaiui.styles_to_valid_css_string)({
430
- ".depict.plp .depict-search-modal .query-input": {
431
- "height": `${headerAligner?.clientHeight}px`
432
- }
433
- });
434
- style_element.replaceChildren(styles);
435
- }));
436
- resize_observer.observe(headerAligner);
425
+ if (!headerAligner) // Very important not to throw here, as it just means the ref hasn't been set by react yet.
426
+ // This is a race condition that will be resolved in the next render.
427
+ // If we throw here, the app will crash.
428
+ return;
429
+ const { cleanup: cleanup } = (0, $4GYXz$depictaiui.connect_query_input_height_to_aligner_height)(headerAligner);
437
430
  let dispose_aligner;
438
431
  /**
439
432
  * Setting position to fixed is important to make the modal work with align_field.
@@ -442,8 +435,7 @@ const $ef7db890e488d4f4$export$d69d8daa20eae175 = (createOpenModalParams)=>{
442
435
  });
443
436
  (0, $4GYXz$solidjs.createRoot)((dispose)=>{
444
437
  dispose_aligner = ()=>{
445
- resize_observer.disconnect();
446
- style_element.remove();
438
+ cleanup();
447
439
  dispose();
448
440
  };
449
441
  (0, $4GYXz$depictaiui.align_field)(style_props_, headerAligner, undefined, false, "top");
@@ -497,7 +489,7 @@ const $ca5840628781f899$export$45080d603eda647c = (props)=>{
497
489
 
498
490
 
499
491
 
500
- const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.64";
492
+ const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.65";
501
493
 
502
494
 
503
495
 
package/dist/module.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import {dlog as $TZSbU$dlog, catchify as $TZSbU$catchify, observer as $TZSbU$observer, history_replacer as $TZSbU$history_replacer, queueMacroTask as $TZSbU$queueMacroTask, href_change_ipns as $TZSbU$href_change_ipns, ContainedPlaceholderImage as $TZSbU$ContainedPlaceholderImage, Placeholder as $TZSbU$Placeholder} from "@depict-ai/utilishared";
2
- import {add_to_version_info as $TZSbU$add_to_version_info, CategoryTitle as $43099132aad1ceb6$re_export$CategoryTitle, embedded_num_products as $43099132aad1ceb6$re_export$EmbeddedNumProducts, DepictSearch as $TZSbU$DepictSearch, DepictCategory as $TZSbU$DepictCategory, get_search_query_updating_blocked_signal as $TZSbU$get_search_query_updating_blocked_signal, SearchPage as $TZSbU$SearchPage, CategoryPage as $TZSbU$CategoryPage, BreadCrumbs as $TZSbU$BreadCrumbs, QuickLinks as $TZSbU$QuickLinks, styles_to_valid_css_string as $TZSbU$styles_to_valid_css_string, align_field as $TZSbU$align_field, SearchField as $TZSbU$SearchField} from "@depict-ai/ui";
2
+ import {add_to_version_info as $TZSbU$add_to_version_info, CategoryTitle as $43099132aad1ceb6$re_export$CategoryTitle, embedded_num_products as $43099132aad1ceb6$re_export$EmbeddedNumProducts, DepictSearch as $TZSbU$DepictSearch, DepictCategory as $TZSbU$DepictCategory, get_search_query_updating_blocked_signal as $TZSbU$get_search_query_updating_blocked_signal, SearchPage as $TZSbU$SearchPage, CategoryPage as $TZSbU$CategoryPage, BreadCrumbs as $TZSbU$BreadCrumbs, QuickLinks as $TZSbU$QuickLinks, connect_query_input_height_to_aligner_height as $TZSbU$connect_query_input_height_to_aligner_height, align_field as $TZSbU$align_field, SearchField as $TZSbU$SearchField} from "@depict-ai/ui";
3
3
  import {createRoot as $TZSbU$createRoot, untrack as $TZSbU$untrack, createSignal as $TZSbU$createSignal, createComponent as $TZSbU$createComponent, Show as $TZSbU$Show, onCleanup as $TZSbU$onCleanup, createComputed as $TZSbU$createComputed} from "solid-js";
4
4
  import {createElement as $TZSbU$createElement, Fragment as $TZSbU$Fragment, useState as $TZSbU$useState, useRef as $TZSbU$useRef, useEffect as $TZSbU$useEffect, forwardRef as $TZSbU$forwardRef} from "react";
5
5
  import {en as $TZSbU$en} from "@depict-ai/ui/locales";
@@ -392,7 +392,6 @@ const $cbd250061abf11cb$export$89c6019e4baa40b1 = ({ width: width , height: heig
392
392
 
393
393
 
394
394
 
395
-
396
395
  const $5e26376d86621891$export$d69d8daa20eae175 = (createOpenModalParams)=>{
397
396
  const { globalState: globalState , location: location , alignerRef: alignerRef } = createOpenModalParams;
398
397
  const openModal = ()=>{
@@ -405,17 +404,11 @@ const $5e26376d86621891$export$d69d8daa20eae175 = (createOpenModalParams)=>{
405
404
  globalState.search.modal_open = true;
406
405
  return;
407
406
  }
408
- const style_element = document.createElement("style");
409
- document.head.append(style_element);
410
- const resize_observer = new ResizeObserver((0, $TZSbU$catchify)(()=>{
411
- const styles = (0, $TZSbU$styles_to_valid_css_string)({
412
- ".depict.plp .depict-search-modal .query-input": {
413
- "height": `${headerAligner?.clientHeight}px`
414
- }
415
- });
416
- style_element.replaceChildren(styles);
417
- }));
418
- resize_observer.observe(headerAligner);
407
+ if (!headerAligner) // Very important not to throw here, as it just means the ref hasn't been set by react yet.
408
+ // This is a race condition that will be resolved in the next render.
409
+ // If we throw here, the app will crash.
410
+ return;
411
+ const { cleanup: cleanup } = (0, $TZSbU$connect_query_input_height_to_aligner_height)(headerAligner);
419
412
  let dispose_aligner;
420
413
  /**
421
414
  * Setting position to fixed is important to make the modal work with align_field.
@@ -424,8 +417,7 @@ const $5e26376d86621891$export$d69d8daa20eae175 = (createOpenModalParams)=>{
424
417
  });
425
418
  (0, $TZSbU$createRoot)((dispose)=>{
426
419
  dispose_aligner = ()=>{
427
- resize_observer.disconnect();
428
- style_element.remove();
420
+ cleanup();
429
421
  dispose();
430
422
  };
431
423
  (0, $TZSbU$align_field)(style_props_, headerAligner, undefined, false, "top");
@@ -479,7 +471,7 @@ const $e3ccaca62718bae4$export$45080d603eda647c = (props)=>{
479
471
 
480
472
 
481
473
 
482
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.64";
474
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.65";
483
475
 
484
476
 
485
477
 
@@ -9,7 +9,7 @@ interface UseDepictSearchFieldReturn {
9
9
  */
10
10
  DepictSearchField: () => ReactElement;
11
11
  }
12
- export const version = "0.0.64";
12
+ export const version = "0.0.65";
13
13
  export function DepictProvider(props: any): any;
14
14
  export function DepictSearchPage(): any;
15
15
  export function DepictCategoryPage(): any;
@@ -19,7 +19,7 @@ $parcel$export(module.exports, "useDepictSearchModal", () => $41e7e5d85b5e0d49$e
19
19
  $parcel$export(module.exports, "version", () => $db7b67857900028b$export$83d89fbfd8236492);
20
20
 
21
21
 
22
- const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.64";
22
+ const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.65";
23
23
 
24
24
 
25
25
  function $41e7e5d85b5e0d49$export$9fac37a9c21c2f3b(props) {
@@ -3,7 +3,7 @@ import {jsx as $1RlIW$jsx} from "react/jsx-runtime";
3
3
 
4
4
 
5
5
 
6
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.64";
6
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.65";
7
7
 
8
8
 
9
9
  function $2b1fdeb83610500f$export$9fac37a9c21c2f3b(props) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/react-ui",
3
- "version": "0.0.64",
3
+ "version": "0.0.65",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/main.js",
@@ -90,8 +90,8 @@
90
90
  "/locales"
91
91
  ],
92
92
  "dependencies": {
93
- "@depict-ai/ui": "^0.0.41",
94
- "@depict-ai/utilishared": "^0.0.39",
93
+ "@depict-ai/ui": "^0.0.42",
94
+ "@depict-ai/utilishared": "^0.0.40",
95
95
  "solid-js": "^1.6.2"
96
96
  },
97
97
  "peerDependencies": {