@epam/ai-dial-chat-hooks 1.1.0-dev.320 → 1.1.0-dev.322

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.
@@ -1 +1 @@
1
- {"version":3,"file":"useAttachmentValidation.d.ts","sourceRoot":"","sources":["../../../src/attachment/useAttachmentValidation/useAttachmentValidation.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,qBAAqB,EACrB,KAAK,UAAU,EAChB,MAAM,2BAA2B,CAAC;AAMnC,sDAAsD;AACtD,oBAAY,+BAA+B;IACzC,4EAA4E;IAC5E,cAAc,mBAAmB;IACjC,yEAAyE;IACzE,eAAe,oBAAoB;CACpC;AAED,8GAA8G;AAC9G,MAAM,WAAW,8BAA8B;IAC7C,2CAA2C;IAC3C,MAAM,EAAE,+BAA+B,CAAC;IACxC,4EAA4E;IAC5E,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,6HAA6H;IAC7H,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,sDAAsD;AACtD,MAAM,WAAW,6BAA6B;IAC5C,6DAA6D;IAC7D,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,+GAA+G;IAC/G,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,IAAI,CAAC;IACpE,wGAAwG;IACxG,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,uDAAuD;AACvD,MAAM,WAAW,6BAA6B;IAC5C,uGAAuG;IACvG,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,2DAA2D;IAC3D,oBAAoB,EAAE,OAAO,CAAC;IAC9B,+FAA+F;IAC/F,kBAAkB,EAAE,CAClB,UAAU,EAAE,UAAU,KACnB,qBAAqB,GAAG,SAAS,CAAC;IACvC,gHAAgH;IAChH,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAAI,sDAIrC,6BAA6B,KAAG,6BAqDlC,CAAC"}
1
+ {"version":3,"file":"useAttachmentValidation.d.ts","sourceRoot":"","sources":["../../../src/attachment/useAttachmentValidation/useAttachmentValidation.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,qBAAqB,EACrB,KAAK,UAAU,EAChB,MAAM,2BAA2B,CAAC;AAMnC,sDAAsD;AACtD,oBAAY,+BAA+B;IACzC,4EAA4E;IAC5E,cAAc,mBAAmB;IACjC,yEAAyE;IACzE,eAAe,oBAAoB;CACpC;AAED,8GAA8G;AAC9G,MAAM,WAAW,8BAA8B;IAC7C,2CAA2C;IAC3C,MAAM,EAAE,+BAA+B,CAAC;IACxC,4EAA4E;IAC5E,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,6HAA6H;IAC7H,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,sDAAsD;AACtD,MAAM,WAAW,6BAA6B;IAC5C,6DAA6D;IAC7D,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,+GAA+G;IAC/G,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,IAAI,CAAC;IACpE,wGAAwG;IACxG,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,uDAAuD;AACvD,MAAM,WAAW,6BAA6B;IAC5C,uGAAuG;IACvG,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,2DAA2D;IAC3D,oBAAoB,EAAE,OAAO,CAAC;IAC9B,+FAA+F;IAC/F,kBAAkB,EAAE,CAClB,UAAU,EAAE,UAAU,KACnB,qBAAqB,GAAG,SAAS,CAAC;IACvC,gHAAgH;IAChH,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAAI,sDAIrC,6BAA6B,KAAG,6BAmElC,CAAC"}
package/index.js CHANGED
@@ -7937,27 +7937,29 @@ var Je = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, Xe = Objec
7937
7937
  }).join(", "), Ht = 100, Ut = /* @__PURE__ */ function(e) {
7938
7938
  return e.NoTypesAllowed = "noTypesAllowed", e.UnsupportedType = "unsupportedType", e;
7939
7939
  }({}), Wt = ({ allowedMimeTypes: e, onValidationError: t, debounceMs: n = Ht }) => {
7940
- let r = e.length > 0, i = N(() => Bt(e), [e]), o = P(null);
7940
+ let r = P(e);
7941
+ (r.current.length !== e.length || r.current.some((t, n) => t !== e[n])) && (r.current = e);
7942
+ let i = r.current, o = i.length > 0, s = N(() => Bt(i), [i]), c = P(null);
7941
7943
  return j(() => () => {
7942
- o.current != null && clearTimeout(o.current);
7944
+ c.current != null && clearTimeout(c.current);
7943
7945
  }, []), {
7944
- inputAttachmentTypes: e,
7945
- isAttachmentsAllowed: r,
7946
- validateAttachment: A((r) => {
7947
- if (!I(r.contentType, e)) return o.current != null && clearTimeout(o.current), o.current = setTimeout(() => {
7948
- let n = e.length === 0;
7946
+ inputAttachmentTypes: i,
7947
+ isAttachmentsAllowed: o,
7948
+ validateAttachment: A((e) => {
7949
+ if (!I(e.contentType, i)) return c.current != null && clearTimeout(c.current), c.current = setTimeout(() => {
7950
+ let e = i.length === 0;
7949
7951
  t?.({
7950
- reason: n ? "noTypesAllowed" : "unsupportedType",
7951
- allowedMimeTypes: e,
7952
- ...n ? {} : { formats: he(e) }
7953
- }), o.current = null;
7952
+ reason: e ? "noTypesAllowed" : "unsupportedType",
7953
+ allowedMimeTypes: i,
7954
+ ...e ? {} : { formats: he(i) }
7955
+ }), c.current = null;
7954
7956
  }, n), a.UnsupportedType;
7955
7957
  }, [
7956
- e,
7958
+ i,
7957
7959
  n,
7958
7960
  t
7959
7961
  ]),
7960
- fileAccept: i
7962
+ fileAccept: s
7961
7963
  };
7962
7964
  }, Gt = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Kt = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}`, qt = /* @__PURE__ */ function(e) {
7963
7965
  return e.WithAttachments = "withAttachments", e.WithoutAttachments = "withoutAttachments", e;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-chat-hooks",
3
3
  "description": "Framework-level React hooks extracted from AI DIAL Chat for building custom chat interfaces",
4
- "version": "1.1.0-dev.320",
4
+ "version": "1.1.0-dev.322",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -23,20 +23,20 @@
23
23
  },
24
24
  "peerDependencies": {
25
25
  "react": "^19.2.6",
26
- "@epam/ai-dial-attachment-canvas": "1.1.0-dev.320",
27
- "@epam/ai-dial-attachment-input": "1.1.0-dev.320",
28
- "@epam/ai-dial-catalog": "1.1.0-dev.320",
29
- "@epam/ai-dial-chat-api-client": "1.1.0-dev.320",
30
- "@epam/ai-dial-chat-overlay": "1.1.0-dev.320",
31
- "@epam/ai-dial-chat-shared": "1.1.0-dev.320",
32
- "@epam/ai-dial-deployment-creation-form": "1.1.0-dev.320",
33
- "@epam/ai-dial-publish-panel": "1.1.0-dev.320",
34
- "@epam/ai-dial-quotations": "1.1.0-dev.320",
26
+ "@epam/ai-dial-attachment-canvas": "1.1.0-dev.322",
27
+ "@epam/ai-dial-attachment-input": "1.1.0-dev.322",
28
+ "@epam/ai-dial-catalog": "1.1.0-dev.322",
29
+ "@epam/ai-dial-chat-api-client": "1.1.0-dev.322",
30
+ "@epam/ai-dial-chat-overlay": "1.1.0-dev.322",
31
+ "@epam/ai-dial-chat-shared": "1.1.0-dev.322",
32
+ "@epam/ai-dial-deployment-creation-form": "1.1.0-dev.322",
33
+ "@epam/ai-dial-publish-panel": "1.1.0-dev.322",
34
+ "@epam/ai-dial-quotations": "1.1.0-dev.322",
35
35
  "@epam/ai-dial-react-file-manager": "*",
36
- "@epam/ai-dial-scheduled-tasks": "1.1.0-dev.320",
37
- "@epam/ai-dial-share": "1.1.0-dev.320",
38
- "@epam/ai-dial-skill-editor": "1.1.0-dev.320",
39
- "@epam/ai-dial-source-panel": "1.1.0-dev.320",
36
+ "@epam/ai-dial-scheduled-tasks": "1.1.0-dev.322",
37
+ "@epam/ai-dial-share": "1.1.0-dev.322",
38
+ "@epam/ai-dial-skill-editor": "1.1.0-dev.322",
39
+ "@epam/ai-dial-source-panel": "1.1.0-dev.322",
40
40
  "@epam/ai-dial-ui-kit": "*",
41
41
  "fflate": "^0.8.3"
42
42
  },