@pushwoosh/smart-components-kit 1.3.6 → 1.3.7

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
- export { MMS_ALLOWED_EXTENSIONS, MMS_MAX_ATTACHMENTS, MMS_SAFE_FILE_SIZE_BYTES, MMS_SUBJECT_MAX_ASCII_LENGTH, MMS_SUBJECT_MAX_UNICODE_LENGTH, getMmsSubjectLength, getMmsSubjectMaxLength, isMmsAttachmentOversized, isMmsAttachmentUrl, isMmsMessageAtValid, isMmsSubjectTooLong, } from './rules';
1
+ export { MMS_ALLOWED_EXTENSIONS, MMS_MAX_ATTACHMENTS, MMS_MAX_FILE_SIZE_BYTES, MMS_SUBJECT_MAX_ASCII_LENGTH, MMS_SUBJECT_MAX_UNICODE_LENGTH, getMmsSubjectLength, getMmsSubjectMaxLength, isMmsAttachmentOversized, isMmsAttachmentUrl, isMmsMessageAtValid, isMmsSubjectTooLong, } from './rules';
@@ -1 +1 @@
1
- export { MMS_ALLOWED_EXTENSIONS, MMS_MAX_ATTACHMENTS, MMS_SAFE_FILE_SIZE_BYTES, MMS_SUBJECT_MAX_ASCII_LENGTH, MMS_SUBJECT_MAX_UNICODE_LENGTH, getMmsSubjectLength, getMmsSubjectMaxLength, isMmsAttachmentOversized, isMmsAttachmentUrl, isMmsMessageAtValid, isMmsSubjectTooLong } from './rules';
1
+ export { MMS_ALLOWED_EXTENSIONS, MMS_MAX_ATTACHMENTS, MMS_MAX_FILE_SIZE_BYTES, MMS_SUBJECT_MAX_ASCII_LENGTH, MMS_SUBJECT_MAX_UNICODE_LENGTH, getMmsSubjectLength, getMmsSubjectMaxLength, isMmsAttachmentOversized, isMmsAttachmentUrl, isMmsMessageAtValid, isMmsSubjectTooLong } from './rules';
@@ -8,20 +8,20 @@ export declare const MMS_SUBJECT_MAX_ASCII_LENGTH = 40;
8
8
  export declare const MMS_SUBJECT_MAX_UNICODE_LENGTH = 13;
9
9
  export declare const MMS_ALLOWED_EXTENSIONS: string[];
10
10
  /**
11
- * Attachments above this stay compatible with older networks and handsets. It is a
12
- * recommendation, not a provider limit — warn, never block.
11
+ * The provider rejects anything heavier, so an oversized attachment fails the whole send.
12
+ * Media-library sizes are not always known, so the forms warn on it instead of blocking.
13
13
  */
14
- export declare const MMS_SAFE_FILE_SIZE_BYTES: number;
14
+ export declare const MMS_MAX_FILE_SIZE_BYTES: number;
15
15
  /**
16
16
  * The provider downloads the attachment itself, so it has to be a public https url whose
17
17
  * *path* ends with a supported image extension. Checking the path (not the whole url) matches
18
18
  * the backend and keeps query strings — signatures, cache busters — from passing as extensions.
19
19
  *
20
- * The same rule also hides WebP and the legacy media-library files stored without an extension:
21
- * both are fetchable, neither is accepted downstream.
20
+ * PNG, JPEG, WebP and the legacy media-library files stored without an extension drop out
21
+ * here: all of them are fetchable, none is decoded by the provider.
22
22
  */
23
23
  export declare const isMmsAttachmentUrl: (url: string) => boolean;
24
- /** Whether the file is large enough to warrant the "may not arrive" warning. */
24
+ /** Whether the file is over the provider's size limit and will be rejected on send. */
25
25
  export declare const isMmsAttachmentOversized: (file: MediaFile) => boolean;
26
26
  /**
27
27
  * Subject length budget: the provider counts non-ASCII subjects against a much shorter
@@ -5,19 +5,19 @@
5
5
  export const MMS_MAX_ATTACHMENTS = 3;
6
6
  export const MMS_SUBJECT_MAX_ASCII_LENGTH = 40;
7
7
  export const MMS_SUBJECT_MAX_UNICODE_LENGTH = 13;
8
- export const MMS_ALLOWED_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.gif'];
8
+ export const MMS_ALLOWED_EXTENSIONS = ['.jpg', '.gif'];
9
9
  /**
10
- * Attachments above this stay compatible with older networks and handsets. It is a
11
- * recommendation, not a provider limit — warn, never block.
10
+ * The provider rejects anything heavier, so an oversized attachment fails the whole send.
11
+ * Media-library sizes are not always known, so the forms warn on it instead of blocking.
12
12
  */
13
- export const MMS_SAFE_FILE_SIZE_BYTES = 300 * 1024;
13
+ export const MMS_MAX_FILE_SIZE_BYTES = 200 * 1024;
14
14
  /**
15
15
  * The provider downloads the attachment itself, so it has to be a public https url whose
16
16
  * *path* ends with a supported image extension. Checking the path (not the whole url) matches
17
17
  * the backend and keeps query strings — signatures, cache busters — from passing as extensions.
18
18
  *
19
- * The same rule also hides WebP and the legacy media-library files stored without an extension:
20
- * both are fetchable, neither is accepted downstream.
19
+ * PNG, JPEG, WebP and the legacy media-library files stored without an extension drop out
20
+ * here: all of them are fetchable, none is decoded by the provider.
21
21
  */
22
22
  export const isMmsAttachmentUrl = url => {
23
23
  let parsed;
@@ -30,8 +30,8 @@ export const isMmsAttachmentUrl = url => {
30
30
  const path = parsed.pathname.toLowerCase();
31
31
  return MMS_ALLOWED_EXTENSIONS.some(extension => path.endsWith(extension));
32
32
  };
33
- /** Whether the file is large enough to warrant the "may not arrive" warning. */
34
- export const isMmsAttachmentOversized = file => file.fileSize > MMS_SAFE_FILE_SIZE_BYTES;
33
+ /** Whether the file is over the provider's size limit and will be rejected on send. */
34
+ export const isMmsAttachmentOversized = file => file.fileSize > MMS_MAX_FILE_SIZE_BYTES;
35
35
  /**
36
36
  * Subject length budget: the provider counts non-ASCII subjects against a much shorter
37
37
  * limit, so a single non-ASCII character drops the whole subject to 13.
package/package.json CHANGED
@@ -52,5 +52,5 @@
52
52
  "react": "^16.14.0 || ^18.0.0",
53
53
  "react-dom": "^16.14.0 || ^18.0.0"
54
54
  },
55
- "version": "1.3.6"
55
+ "version": "1.3.7"
56
56
  }