@htmlbricks/hb-messages-send 0.71.36 → 0.71.37

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # hb-messages-send
1
+ # `hb-messages-send`
2
2
 
3
- **Category:** messaging · **Tags:** messaging, chat
3
+ **Category:** messaging · **Tags:** messaging, chat · **Package:** `@htmlbricks/hb-messages-send`
4
4
 
5
5
  ## Overview
6
6
 
@@ -62,13 +62,20 @@ The authoring **`Component`** type may list **`style`** for TypeScript wrappers;
62
62
 
63
63
  | Name | `detail` shape |
64
64
  |------|----------------|
65
- | `sendMessage` | **`text`:** `string` — composer text. **`id`:** `string` — value of the `id` prop. **`tags`:** `string[]` — ids of tags the user toggled on. **`files`:** array of staged items: each entry includes **`id`**, **`name`**, **`mimetype`**, **`fileSize`**, and **`content`** (`File` from the browser), matching what the composer staged before send. |
66
-
67
- > **Note:** The repo’s `Events` typing may describe **`files`** as `File[]`. At runtime the event carries the internal staged objects above; use **`detail.files.map((f) => f.content)`** (or equivalent) when you need plain `File` instances.
65
+ | `sendMessage` | **`text`:** `string` — composer text. **`id`:** `string` — value of the `id` prop. **`tags`:** `string[]` — ids of tags the user toggled on. **`files`:** array of staged items (`MessageSendFileItem`): **`id`**, **`name`**, **`mimetype`**, **`fileSize`**, **`content`** (`File`), optional **`objectUrl`**. Use **`detail.files.map((f) => f.content)`** when you need plain **`File`** instances. |
68
66
 
69
67
  ## TypeScript (authoring / wrappers)
70
68
 
71
69
  ```typescript
70
+ export type MessageSendFileItem = {
71
+ id: string;
72
+ name: string;
73
+ mimetype: string;
74
+ fileSize: number;
75
+ content: File;
76
+ objectUrl?: string;
77
+ };
78
+
72
79
  export type Component = {
73
80
  id?: string;
74
81
  style?: string;
@@ -86,7 +93,12 @@ export type Component = {
86
93
  };
87
94
 
88
95
  export type Events = {
89
- sendMessage: { text?: string; id: string; tags: string[]; files: File[] };
96
+ sendMessage: {
97
+ text?: string;
98
+ id: string;
99
+ tags: string[];
100
+ files: MessageSendFileItem[];
101
+ };
90
102
  };
91
103
  ```
92
104
 
package/manifest.json CHANGED
@@ -12,32 +12,7 @@
12
12
  "properties": {
13
13
  "files": {
14
14
  "items": {
15
- "additionalProperties": false,
16
- "properties": {
17
- "lastModified": {
18
- "type": "number"
19
- },
20
- "name": {
21
- "type": "string"
22
- },
23
- "size": {
24
- "type": "number"
25
- },
26
- "type": {
27
- "type": "string"
28
- },
29
- "webkitRelativePath": {
30
- "type": "string"
31
- }
32
- },
33
- "required": [
34
- "lastModified",
35
- "name",
36
- "size",
37
- "type",
38
- "webkitRelativePath"
39
- ],
40
- "type": "object"
15
+ "$ref": "#/definitions/MessageSendFileItem"
41
16
  },
42
17
  "type": "array"
43
18
  },
@@ -66,6 +41,63 @@
66
41
  "sendMessage"
67
42
  ],
68
43
  "type": "object"
44
+ },
45
+ "MessageSendFileItem": {
46
+ "additionalProperties": false,
47
+ "description": "Staged file row emitted on `sendMessage` (internal shape from the composer).",
48
+ "properties": {
49
+ "content": {
50
+ "additionalProperties": false,
51
+ "properties": {
52
+ "lastModified": {
53
+ "type": "number"
54
+ },
55
+ "name": {
56
+ "type": "string"
57
+ },
58
+ "size": {
59
+ "type": "number"
60
+ },
61
+ "type": {
62
+ "type": "string"
63
+ },
64
+ "webkitRelativePath": {
65
+ "type": "string"
66
+ }
67
+ },
68
+ "required": [
69
+ "lastModified",
70
+ "name",
71
+ "size",
72
+ "type",
73
+ "webkitRelativePath"
74
+ ],
75
+ "type": "object"
76
+ },
77
+ "fileSize": {
78
+ "type": "number"
79
+ },
80
+ "id": {
81
+ "type": "string"
82
+ },
83
+ "mimetype": {
84
+ "type": "string"
85
+ },
86
+ "name": {
87
+ "type": "string"
88
+ },
89
+ "objectUrl": {
90
+ "type": "string"
91
+ }
92
+ },
93
+ "required": [
94
+ "id",
95
+ "name",
96
+ "mimetype",
97
+ "fileSize",
98
+ "content"
99
+ ],
100
+ "type": "object"
69
101
  }
70
102
  }
71
103
  },
@@ -298,5 +330,5 @@
298
330
  "size": {},
299
331
  "iifePath": "main.iife.js",
300
332
  "repoName": "@htmlbricks/hb-messages-send",
301
- "version": "0.71.36"
333
+ "version": "0.71.37"
302
334
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htmlbricks/hb-messages-send",
3
- "version": "0.71.36",
3
+ "version": "0.71.37",
4
4
  "contributors": [],
5
5
  "description": "Message composer with auto-growing textarea (optional `expandable` and maximize control), Enter-to-send, file attachments with previews (`files.mode` single or multiple), and optional `tags` as toggleable chips. Dispatches `sendMessage` with `text`, selected `tags`, and staged `files` when the user sends.",
6
6
  "licenses": [
@@ -1,3 +1,13 @@
1
+ /** Staged file row emitted on `sendMessage` (internal shape from the composer). */
2
+ export type MessageSendFileItem = {
3
+ id: string;
4
+ name: string;
5
+ mimetype: string;
6
+ fileSize: number;
7
+ content: File;
8
+ objectUrl?: string;
9
+ };
10
+
1
11
  export type Component = {
2
12
  id?: string;
3
13
  style?: string;
@@ -6,14 +16,19 @@ export type Component = {
6
16
  tags?: {
7
17
  label?: string;
8
18
  icon?: string;
9
- id: string
19
+ id: string;
10
20
  color?: string;
11
- }[]
21
+ }[];
12
22
  files?: {
13
23
  mode: "single" | "multiple";
14
- }
24
+ };
15
25
  };
16
26
 
17
27
  export type Events = {
18
- sendMessage: { text?: string; id: string; tags: string[]; files: File[] };
28
+ sendMessage: {
29
+ text?: string;
30
+ id: string;
31
+ tags: string[];
32
+ files: MessageSendFileItem[];
33
+ };
19
34
  };
@@ -10,32 +10,7 @@
10
10
  "properties": {
11
11
  "files": {
12
12
  "items": {
13
- "additionalProperties": false,
14
- "properties": {
15
- "lastModified": {
16
- "type": "number"
17
- },
18
- "name": {
19
- "type": "string"
20
- },
21
- "size": {
22
- "type": "number"
23
- },
24
- "type": {
25
- "type": "string"
26
- },
27
- "webkitRelativePath": {
28
- "type": "string"
29
- }
30
- },
31
- "required": [
32
- "lastModified",
33
- "name",
34
- "size",
35
- "type",
36
- "webkitRelativePath"
37
- ],
38
- "type": "object"
13
+ "$ref": "#/definitions/MessageSendFileItem"
39
14
  },
40
15
  "type": "array"
41
16
  },
@@ -64,6 +39,63 @@
64
39
  "sendMessage"
65
40
  ],
66
41
  "type": "object"
42
+ },
43
+ "MessageSendFileItem": {
44
+ "additionalProperties": false,
45
+ "description": "Staged file row emitted on `sendMessage` (internal shape from the composer).",
46
+ "properties": {
47
+ "content": {
48
+ "additionalProperties": false,
49
+ "properties": {
50
+ "lastModified": {
51
+ "type": "number"
52
+ },
53
+ "name": {
54
+ "type": "string"
55
+ },
56
+ "size": {
57
+ "type": "number"
58
+ },
59
+ "type": {
60
+ "type": "string"
61
+ },
62
+ "webkitRelativePath": {
63
+ "type": "string"
64
+ }
65
+ },
66
+ "required": [
67
+ "lastModified",
68
+ "name",
69
+ "size",
70
+ "type",
71
+ "webkitRelativePath"
72
+ ],
73
+ "type": "object"
74
+ },
75
+ "fileSize": {
76
+ "type": "number"
77
+ },
78
+ "id": {
79
+ "type": "string"
80
+ },
81
+ "mimetype": {
82
+ "type": "string"
83
+ },
84
+ "name": {
85
+ "type": "string"
86
+ },
87
+ "objectUrl": {
88
+ "type": "string"
89
+ }
90
+ },
91
+ "required": [
92
+ "id",
93
+ "name",
94
+ "mimetype",
95
+ "fileSize",
96
+ "content"
97
+ ],
98
+ "type": "object"
67
99
  }
68
100
  }
69
101
  }