@epam/ai-dial-ui-kit 0.5.0-rc.29 → 0.5.0-rc.30

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.
@@ -48269,10 +48269,10 @@ const BA = ({ selectionLabel: e, onClearSelection: t, actions: s }) => {
48269
48269
  [f]
48270
48270
  );
48271
48271
  me(() => {
48272
- const S = d.current;
48273
- if (!S) return;
48272
+ let S = d.current;
48273
+ S || (S = document.createElement("input"), S.type = "file", S.multiple = !0, S.style.display = "none", document.body.appendChild(S), d.current = S);
48274
48274
  const x = async () => {
48275
- if (!S.files?.length) return;
48275
+ if (!S?.files?.length) return;
48276
48276
  const P = Array.from(S.files).map((M) => ({
48277
48277
  fileContent: M,
48278
48278
  name: M.name
@@ -48284,16 +48284,12 @@ const BA = ({ selectionLabel: e, onClearSelection: t, actions: s }) => {
48284
48284
  ), S.value = "";
48285
48285
  };
48286
48286
  return S.addEventListener("change", x), () => {
48287
- S.removeEventListener("change", x);
48287
+ S && (S.removeEventListener("change", x), d.current === S && (document.body.removeChild(S), d.current = null));
48288
48288
  };
48289
48289
  }, [f]);
48290
48290
  const y = A(
48291
48291
  (S, x) => {
48292
- if (u.current = S, h.current = x, !d.current) {
48293
- const E = document.createElement("input");
48294
- E.type = "file", E.multiple = !0, E.style.display = "none", d.current = E, document.body.appendChild(E);
48295
- }
48296
- d.current.click();
48292
+ u.current = S, h.current = x, d.current && d.current.click();
48297
48293
  },
48298
48294
  []
48299
48295
  ), R = A(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-ui-kit",
3
- "version": "0.5.0-rc.29",
3
+ "version": "0.5.0-rc.30",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",