@webority/support-react 0.13.3 → 0.13.5

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.
@@ -224,8 +224,7 @@ function q(e) {
224
224
  //#endregion
225
225
  //#region src/lib/files.js
226
226
  function ie(e) {
227
- let t = e?.allowedContentTypes ?? [];
228
- return t.length > 0 ? t.join(",") : void 0;
227
+ return (e?.allowedContentTypes ?? []).join(",");
229
228
  }
230
229
  function ae(e, t) {
231
230
  if (t.length === 0) return !0;
@@ -255,7 +254,7 @@ function Y(e) {
255
254
  //#endregion
256
255
  //#region src/components/AttachmentField.jsx
257
256
  function X({ id: e, label: t = "Attachments", files: n, onChange: r, config: i, error: a }) {
258
- let o = i?.maxAttachmentBytes ?? 0, s = o > 0 ? Math.round(o / (1024 * 1024) * 10) / 10 : void 0;
257
+ let o = i?.maxAttachmentBytes ?? 0, s = o > 0 ? Math.max(.1, Math.round(o / (1024 * 1024) * 10) / 10) : 0;
259
258
  return /* @__PURE__ */ j(h, {
260
259
  id: e,
261
260
  label: t,
@@ -2,6 +2,8 @@
2
2
  * Picked, dropped or pasted files for a message, limited to what the support config allows.
3
3
  * The caller checks every file against the config and passes the one message through `error`,
4
4
  * so the field's own check stays off and a rejected pick never shows two messages.
5
+ * A limit the config leaves open (no types listed, a size of 0) is passed as open, so the
6
+ * field accepts any file and its hint names only the limits that exist.
5
7
  *
6
8
  * @param {object} props
7
9
  * @param {string} [props.id]
@@ -1,12 +1,14 @@
1
1
  /**
2
- * The `accept` attribute for a file input, from the config's allowed content types.
2
+ * The `accept` attribute for a file input, from the config's allowed content types. An empty
3
+ * list means any type, so this returns "" rather than undefined: undefined would let the field
4
+ * fall back to its own images-only default.
3
5
  *
4
6
  * @param {{ allowedContentTypes?: string[] }|null|undefined} config
5
- * @returns {string|undefined}
7
+ * @returns {string}
6
8
  */
7
9
  export declare function acceptOf(config: {
8
10
  allowedContentTypes?: string[];
9
- } | null | undefined): string | undefined;
11
+ } | null | undefined): string;
10
12
  /**
11
13
  * Checks files against the config before anything uploads. Returns the first problem as a
12
14
  * sentence for the person, or null when every file can go.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/support-react",
3
- "version": "0.13.3",
3
+ "version": "0.13.5",
4
4
  "description": "Webority customer support for React portals: ticket centre, report-an-issue with a page screenshot, and support contact details, built on @webority/ui-react.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  "react": "^19.0.0",
33
33
  "react-bootstrap": "^2.10.0",
34
34
  "react-dom": "^19.0.0",
35
- "@webority/ui-react": "0.13.3"
35
+ "@webority/ui-react": "0.13.5"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@testing-library/dom": "10.4.2",
@@ -50,7 +50,7 @@
50
50
  "typescript": "^7.0.2",
51
51
  "vite": "^8.0.12",
52
52
  "vitest": "5.0.1",
53
- "@webority/ui-react": "0.13.3"
53
+ "@webority/ui-react": "0.13.5"
54
54
  },
55
55
  "dependencies": {
56
56
  "html-to-image": "^1.11.13"