@integry/sdk 4.5.25 → 4.5.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integry/sdk",
3
- "version": "4.5.25",
3
+ "version": "4.5.26",
4
4
  "description": "Integry SDK",
5
5
  "main": "dist/umd/index.umd.js",
6
6
  "module": "dist/esm/index.csm.js",
@@ -1,6 +1,5 @@
1
1
  /* eslint-disable no-nested-ternary */
2
2
  /* eslint-disable @typescript-eslint/no-explicit-any */
3
- import React from 'react';
4
3
  import { NestedObject } from '@/interfaces';
5
4
  import { html } from 'htm/preact';
6
5
  import { createRef } from 'preact';
@@ -9,7 +8,7 @@ import { isScrolledIntoView } from '@/utils/common';
9
8
  import { searchJSON } from '@/utils/searchJson';
10
9
  import { Input } from '@/components/Input';
11
10
  import { createElement } from 'preact/compat';
12
- import { createRoot } from 'react-dom/client';
11
+ import { renderToString } from 'react-dom/server';
13
12
  import { TagOptions } from '../TagOptions';
14
13
  import { ThreeDotLoader } from '../../ThreeDotLoader';
15
14
  import styles from './styles.module.scss';
@@ -221,34 +220,6 @@ const FieldDropdown = (props: FieldMenuProps) => {
221
220
  });
222
221
  }
223
222
 
224
- // This component handles rendering React components in a Preact app
225
- const ReactPortal = () => {
226
- const reactRootRef = useRef<HTMLDivElement | null>(null);
227
-
228
- useEffect(() => {
229
- if (reactRootRef.current) {
230
- // Ensure it's a valid React element
231
- const reactElement = React.createElement(tagsComponent, {
232
- onSelect: () => alert('Selected from React!'),
233
- });
234
-
235
- // Render using React's createRoot
236
- const root = createRoot(reactRootRef.current);
237
- root.render(reactElement);
238
-
239
- // Cleanup on unmount
240
- return () => root.unmount();
241
- }
242
-
243
- // Return a no-op cleanup to satisfy ESLint
244
- return () => {
245
- // No cleanup needed if reactRootRef is not set
246
- };
247
- }, []);
248
-
249
- return html`<div ref=${reactRootRef}></div>`;
250
- };
251
-
252
223
  return html` <div
253
224
  class=${`${styles.tagMenu} ${enableSearch ? styles.tagMenuWithSearch : ''}`}
254
225
  style=${parentContainer && tagMenyStyleRef?.current
@@ -374,7 +345,7 @@ const FieldDropdown = (props: FieldMenuProps) => {
374
345
  </div>`
375
346
  : html` <div className="${styles.mappedFieldMenu}">
376
347
  ${tagsComponent
377
- ? html`<${ReactPortal} />`
348
+ ? html`<div>${renderToString(tagsComponentRender)}</div>`
378
349
  : html`${Object.keys(
379
350
  !isEditable ? searchJSON(tags, searchValue) : tags,
380
351
  ).length > 0