@htmlbricks/hb-messages-box 0.20.18 → 0.50.0-alpha.11
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/main.iife.js +6 -0
- package/{release/manifest.json → manifest.json} +20 -21
- package/package.json +15 -83
- package/types/webcomponent.type.d.json +166 -0
- package/types/webcomponent_events.type.d.json +58 -0
- package/LICENSE.md +0 -68
- package/README.md +0 -1
- package/extra/docs.ts +0 -192
- package/release/docs.js +0 -193
- package/release/docs.js.map +0 -1
- package/release/docs.ts +0 -192
- package/release/release.js +0 -2
- package/release/release.js.map +0 -1
- /package/{release → types}/webcomponent.type.d.ts +0 -0
package/extra/docs.ts
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import type { CssPart, CssVar, HtmlSlot, i18nLang, StyleSetup, ComponentSetup } from "wc-js-utils/main";
|
|
2
|
-
import type { Component } from "../app/types/webcomponent.type";
|
|
3
|
-
|
|
4
|
-
export const storybookArgs = {
|
|
5
|
-
messages: { control: { type: "object" } },
|
|
6
|
-
authors: { control: { type: "object" } },
|
|
7
|
-
options: { control: { type: "object" } },
|
|
8
|
-
message: { control: { type: "object" } },
|
|
9
|
-
sendMessage: { action: "sendMessageEvent" },
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const cssVars: CssVar[] = [];
|
|
13
|
-
export const cssParts: CssPart[] = [{ name: "testpart", description: "test css part on 2 div tag" }];
|
|
14
|
-
export const htmlSlots: HtmlSlot[] = [{ name: "skelcontent", description: "test slot" }];
|
|
15
|
-
export const i18nLanguages: i18nLang[] = [];
|
|
16
|
-
|
|
17
|
-
export const styleSetup: StyleSetup = {
|
|
18
|
-
vars: cssVars,
|
|
19
|
-
parts: cssParts,
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const defaultExampleMessages: Component["messages"] = [
|
|
23
|
-
{
|
|
24
|
-
id: "1",
|
|
25
|
-
text: "Hello",
|
|
26
|
-
timestamp: new Date(Date.now() - 36_000),
|
|
27
|
-
type: "text",
|
|
28
|
-
status: "sent",
|
|
29
|
-
authorId: "1",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
id: "2",
|
|
33
|
-
text: "Hi",
|
|
34
|
-
timestamp: new Date(Date.now()),
|
|
35
|
-
type: "text",
|
|
36
|
-
status: "received",
|
|
37
|
-
authorId: "2",
|
|
38
|
-
},
|
|
39
|
-
];
|
|
40
|
-
const moreExampleMessages: Component["messages"] = [
|
|
41
|
-
...defaultExampleMessages,
|
|
42
|
-
{
|
|
43
|
-
id: "3",
|
|
44
|
-
text: "How are you?",
|
|
45
|
-
timestamp: new Date(Date.now()),
|
|
46
|
-
type: "text",
|
|
47
|
-
status: "received",
|
|
48
|
-
authorId: "2",
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
id: "4",
|
|
52
|
-
text: "I'm fine, thanks",
|
|
53
|
-
timestamp: new Date(Date.now()),
|
|
54
|
-
type: "text",
|
|
55
|
-
status: "sent",
|
|
56
|
-
authorId: "1",
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
id: "5",
|
|
60
|
-
|
|
61
|
-
text: "What about you?",
|
|
62
|
-
timestamp: new Date(Date.now()),
|
|
63
|
-
type: "text",
|
|
64
|
-
status: "received",
|
|
65
|
-
authorId: "2",
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
id: "6",
|
|
69
|
-
text: "I'm fine too, thanks for asking",
|
|
70
|
-
timestamp: new Date(Date.now()),
|
|
71
|
-
type: "text",
|
|
72
|
-
status: "sent",
|
|
73
|
-
authorId: "1",
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
id: "7",
|
|
77
|
-
text: "You're welcome",
|
|
78
|
-
timestamp: new Date(Date.now()),
|
|
79
|
-
type: "text",
|
|
80
|
-
status: "received",
|
|
81
|
-
authorId: "2",
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
id: "8",
|
|
85
|
-
text: "Bye",
|
|
86
|
-
timestamp: new Date(Date.now()),
|
|
87
|
-
type: "text",
|
|
88
|
-
status: "sent",
|
|
89
|
-
authorId: "1",
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
id: "9",
|
|
93
|
-
text: "Bye",
|
|
94
|
-
timestamp: new Date(Date.now()),
|
|
95
|
-
type: "text",
|
|
96
|
-
status: "received",
|
|
97
|
-
authorId: "2",
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
id: "10",
|
|
101
|
-
text: "See you later",
|
|
102
|
-
timestamp: new Date(Date.now()),
|
|
103
|
-
type: "text",
|
|
104
|
-
status: "sent",
|
|
105
|
-
authorId: "1",
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
id: "11",
|
|
109
|
-
text: "See you later",
|
|
110
|
-
timestamp: new Date(Date.now()),
|
|
111
|
-
type: "text",
|
|
112
|
-
status: "received",
|
|
113
|
-
authorId: "2",
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
id: "12",
|
|
117
|
-
text: "Bye",
|
|
118
|
-
timestamp: new Date(Date.now()),
|
|
119
|
-
type: "text",
|
|
120
|
-
status: "sent",
|
|
121
|
-
authorId: "1",
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
id: "13",
|
|
125
|
-
text: "Bye",
|
|
126
|
-
timestamp: new Date(Date.now()),
|
|
127
|
-
type: "text",
|
|
128
|
-
status: "received",
|
|
129
|
-
authorId: "2",
|
|
130
|
-
},
|
|
131
|
-
];
|
|
132
|
-
const defaultExampleAuthors: Component["authors"] = [
|
|
133
|
-
{
|
|
134
|
-
id: "1",
|
|
135
|
-
name: "John",
|
|
136
|
-
avatar: "https://i.pravatar.cc/300?img=1",
|
|
137
|
-
status: "online",
|
|
138
|
-
me: true,
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
id: "2",
|
|
142
|
-
name: "Mary",
|
|
143
|
-
avatar: "https://i.pravatar.cc/300?img=2",
|
|
144
|
-
status: "online",
|
|
145
|
-
},
|
|
146
|
-
];
|
|
147
|
-
|
|
148
|
-
const examples: { name: string; description?: string; data: Component }[] = [
|
|
149
|
-
{
|
|
150
|
-
name: "default",
|
|
151
|
-
data: {
|
|
152
|
-
messages: defaultExampleMessages,
|
|
153
|
-
authors: defaultExampleAuthors,
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
name: "withAMessage",
|
|
158
|
-
data: {
|
|
159
|
-
message: { text: 'This is a message from the "message" property' },
|
|
160
|
-
messages: defaultExampleMessages,
|
|
161
|
-
authors: defaultExampleAuthors,
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
name: "moreMessages",
|
|
166
|
-
data: {
|
|
167
|
-
messages: moreExampleMessages,
|
|
168
|
-
authors: defaultExampleAuthors,
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
];
|
|
172
|
-
export const componentSetup: ComponentSetup & { examples: { name: string; description?: string; data: Component }[] } = {
|
|
173
|
-
definitions: null as any,
|
|
174
|
-
storybookArgs,
|
|
175
|
-
styleSetup,
|
|
176
|
-
author: null as any,
|
|
177
|
-
contributors: [],
|
|
178
|
-
owner: null as any,
|
|
179
|
-
htmlSlots,
|
|
180
|
-
i18n: i18nLanguages,
|
|
181
|
-
examples,
|
|
182
|
-
screenshots: [],
|
|
183
|
-
licenses: [{ type: "Apache-2.0", path: "LICENSE.md", cost: 0, currency: "EUR" }],
|
|
184
|
-
readmePath: "README.md",
|
|
185
|
-
name: "hb-messages-box",
|
|
186
|
-
category: "messages",
|
|
187
|
-
tags: ["messages"],
|
|
188
|
-
size: {},
|
|
189
|
-
iifePath: "release/release.js",
|
|
190
|
-
repoName: "@htmlbricks/hb-messages-box",
|
|
191
|
-
version: null as any,
|
|
192
|
-
};
|
package/release/docs.js
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
-
if (ar || !(i in from)) {
|
|
4
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
-
ar[i] = from[i];
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
-
};
|
|
10
|
-
export var storybookArgs = {
|
|
11
|
-
messages: { control: { type: "object" } },
|
|
12
|
-
authors: { control: { type: "object" } },
|
|
13
|
-
options: { control: { type: "object" } },
|
|
14
|
-
message: { control: { type: "object" } },
|
|
15
|
-
sendMessage: { action: "sendMessageEvent" }
|
|
16
|
-
};
|
|
17
|
-
var cssVars = [];
|
|
18
|
-
export var cssParts = [{ name: "testpart", description: "test css part on 2 div tag" }];
|
|
19
|
-
export var htmlSlots = [{ name: "skelcontent", description: "test slot" }];
|
|
20
|
-
export var i18nLanguages = [];
|
|
21
|
-
export var styleSetup = {
|
|
22
|
-
vars: cssVars,
|
|
23
|
-
parts: cssParts
|
|
24
|
-
};
|
|
25
|
-
var defaultExampleMessages = [
|
|
26
|
-
{
|
|
27
|
-
id: "1",
|
|
28
|
-
text: "Hello",
|
|
29
|
-
timestamp: new Date(Date.now() - 36000),
|
|
30
|
-
type: "text",
|
|
31
|
-
status: "sent",
|
|
32
|
-
authorId: "1"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
id: "2",
|
|
36
|
-
text: "Hi",
|
|
37
|
-
timestamp: new Date(Date.now()),
|
|
38
|
-
type: "text",
|
|
39
|
-
status: "received",
|
|
40
|
-
authorId: "2"
|
|
41
|
-
},
|
|
42
|
-
];
|
|
43
|
-
var moreExampleMessages = __spreadArray(__spreadArray([], defaultExampleMessages, true), [
|
|
44
|
-
{
|
|
45
|
-
id: "3",
|
|
46
|
-
text: "How are you?",
|
|
47
|
-
timestamp: new Date(Date.now()),
|
|
48
|
-
type: "text",
|
|
49
|
-
status: "received",
|
|
50
|
-
authorId: "2"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
id: "4",
|
|
54
|
-
text: "I'm fine, thanks",
|
|
55
|
-
timestamp: new Date(Date.now()),
|
|
56
|
-
type: "text",
|
|
57
|
-
status: "sent",
|
|
58
|
-
authorId: "1"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
id: "5",
|
|
62
|
-
text: "What about you?",
|
|
63
|
-
timestamp: new Date(Date.now()),
|
|
64
|
-
type: "text",
|
|
65
|
-
status: "received",
|
|
66
|
-
authorId: "2"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
id: "6",
|
|
70
|
-
text: "I'm fine too, thanks for asking",
|
|
71
|
-
timestamp: new Date(Date.now()),
|
|
72
|
-
type: "text",
|
|
73
|
-
status: "sent",
|
|
74
|
-
authorId: "1"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
id: "7",
|
|
78
|
-
text: "You're welcome",
|
|
79
|
-
timestamp: new Date(Date.now()),
|
|
80
|
-
type: "text",
|
|
81
|
-
status: "received",
|
|
82
|
-
authorId: "2"
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
id: "8",
|
|
86
|
-
text: "Bye",
|
|
87
|
-
timestamp: new Date(Date.now()),
|
|
88
|
-
type: "text",
|
|
89
|
-
status: "sent",
|
|
90
|
-
authorId: "1"
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
id: "9",
|
|
94
|
-
text: "Bye",
|
|
95
|
-
timestamp: new Date(Date.now()),
|
|
96
|
-
type: "text",
|
|
97
|
-
status: "received",
|
|
98
|
-
authorId: "2"
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
id: "10",
|
|
102
|
-
text: "See you later",
|
|
103
|
-
timestamp: new Date(Date.now()),
|
|
104
|
-
type: "text",
|
|
105
|
-
status: "sent",
|
|
106
|
-
authorId: "1"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
id: "11",
|
|
110
|
-
text: "See you later",
|
|
111
|
-
timestamp: new Date(Date.now()),
|
|
112
|
-
type: "text",
|
|
113
|
-
status: "received",
|
|
114
|
-
authorId: "2"
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
id: "12",
|
|
118
|
-
text: "Bye",
|
|
119
|
-
timestamp: new Date(Date.now()),
|
|
120
|
-
type: "text",
|
|
121
|
-
status: "sent",
|
|
122
|
-
authorId: "1"
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
id: "13",
|
|
126
|
-
text: "Bye",
|
|
127
|
-
timestamp: new Date(Date.now()),
|
|
128
|
-
type: "text",
|
|
129
|
-
status: "received",
|
|
130
|
-
authorId: "2"
|
|
131
|
-
},
|
|
132
|
-
], false);
|
|
133
|
-
var defaultExampleAuthors = [
|
|
134
|
-
{
|
|
135
|
-
id: "1",
|
|
136
|
-
name: "John",
|
|
137
|
-
avatar: "https://i.pravatar.cc/300?img=1",
|
|
138
|
-
status: "online",
|
|
139
|
-
me: true
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
id: "2",
|
|
143
|
-
name: "Mary",
|
|
144
|
-
avatar: "https://i.pravatar.cc/300?img=2",
|
|
145
|
-
status: "online"
|
|
146
|
-
},
|
|
147
|
-
];
|
|
148
|
-
var examples = [
|
|
149
|
-
{
|
|
150
|
-
name: "default",
|
|
151
|
-
data: {
|
|
152
|
-
messages: defaultExampleMessages,
|
|
153
|
-
authors: defaultExampleAuthors
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
name: "withAMessage",
|
|
158
|
-
data: {
|
|
159
|
-
message: { text: 'This is a message from the "message" property' },
|
|
160
|
-
messages: defaultExampleMessages,
|
|
161
|
-
authors: defaultExampleAuthors
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
name: "moreMessages",
|
|
166
|
-
data: {
|
|
167
|
-
messages: moreExampleMessages,
|
|
168
|
-
authors: defaultExampleAuthors
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
];
|
|
172
|
-
export var componentSetup = {
|
|
173
|
-
definitions: null,
|
|
174
|
-
storybookArgs: storybookArgs,
|
|
175
|
-
styleSetup: styleSetup,
|
|
176
|
-
author: null,
|
|
177
|
-
contributors: [],
|
|
178
|
-
owner: null,
|
|
179
|
-
htmlSlots: htmlSlots,
|
|
180
|
-
i18n: i18nLanguages,
|
|
181
|
-
examples: examples,
|
|
182
|
-
screenshots: [],
|
|
183
|
-
licenses: [{ type: "Apache-2.0", path: "LICENSE.md", cost: 0, currency: "EUR" }],
|
|
184
|
-
readmePath: "README.md",
|
|
185
|
-
name: "hb-messages-box",
|
|
186
|
-
category: "messages",
|
|
187
|
-
tags: ["messages"],
|
|
188
|
-
size: {},
|
|
189
|
-
iifePath: "release/release.js",
|
|
190
|
-
repoName: "@htmlbricks/hb-messages-box",
|
|
191
|
-
version: null
|
|
192
|
-
};
|
|
193
|
-
//# sourceMappingURL=docs.js.map
|
package/release/docs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../extra/docs.ts"],"names":[],"mappings":";;;;;;;;;AAGA,MAAM,CAAC,IAAM,aAAa,GAAG;IAC5B,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACzC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACxC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACxC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACxC,WAAW,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE;CAC3C,CAAC;AAEF,IAAM,OAAO,GAAa,EAAE,CAAC;AAC7B,MAAM,CAAC,IAAM,QAAQ,GAAc,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,4BAA4B,EAA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AU,YAAA;IACV,MAAM,EAAE,IAAW;IACnB,YAAY,EAAE,EAAE;IAChB,KAAK,EAAE,IAAW;IAClB,SAAS,WAAA;IACT,IAAI,EAAE,aAAa;IACnB,QAAQ,UAAA;IACR,WAAW,EAAE,EAAE;IACf,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAChF,UAAU,EAAE,WAAW;IACvB,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,oBAAoB;IAC9B,QAAQ,EAAE,6BAA6B;IACvC,OAAO,EAAE,IAAW;CACpB,CAAC"}
|
package/release/docs.ts
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import type { CssPart, CssVar, HtmlSlot, i18nLang, StyleSetup, ComponentSetup } from "wc-js-utils/main";
|
|
2
|
-
import type { Component } from "../app/types/webcomponent.type";
|
|
3
|
-
|
|
4
|
-
export const storybookArgs = {
|
|
5
|
-
messages: { control: { type: "object" } },
|
|
6
|
-
authors: { control: { type: "object" } },
|
|
7
|
-
options: { control: { type: "object" } },
|
|
8
|
-
message: { control: { type: "object" } },
|
|
9
|
-
sendMessage: { action: "sendMessageEvent" },
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const cssVars: CssVar[] = [];
|
|
13
|
-
export const cssParts: CssPart[] = [{ name: "testpart", description: "test css part on 2 div tag" }];
|
|
14
|
-
export const htmlSlots: HtmlSlot[] = [{ name: "skelcontent", description: "test slot" }];
|
|
15
|
-
export const i18nLanguages: i18nLang[] = [];
|
|
16
|
-
|
|
17
|
-
export const styleSetup: StyleSetup = {
|
|
18
|
-
vars: cssVars,
|
|
19
|
-
parts: cssParts,
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const defaultExampleMessages: Component["messages"] = [
|
|
23
|
-
{
|
|
24
|
-
id: "1",
|
|
25
|
-
text: "Hello",
|
|
26
|
-
timestamp: new Date(Date.now() - 36_000),
|
|
27
|
-
type: "text",
|
|
28
|
-
status: "sent",
|
|
29
|
-
authorId: "1",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
id: "2",
|
|
33
|
-
text: "Hi",
|
|
34
|
-
timestamp: new Date(Date.now()),
|
|
35
|
-
type: "text",
|
|
36
|
-
status: "received",
|
|
37
|
-
authorId: "2",
|
|
38
|
-
},
|
|
39
|
-
];
|
|
40
|
-
const moreExampleMessages: Component["messages"] = [
|
|
41
|
-
...defaultExampleMessages,
|
|
42
|
-
{
|
|
43
|
-
id: "3",
|
|
44
|
-
text: "How are you?",
|
|
45
|
-
timestamp: new Date(Date.now()),
|
|
46
|
-
type: "text",
|
|
47
|
-
status: "received",
|
|
48
|
-
authorId: "2",
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
id: "4",
|
|
52
|
-
text: "I'm fine, thanks",
|
|
53
|
-
timestamp: new Date(Date.now()),
|
|
54
|
-
type: "text",
|
|
55
|
-
status: "sent",
|
|
56
|
-
authorId: "1",
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
id: "5",
|
|
60
|
-
|
|
61
|
-
text: "What about you?",
|
|
62
|
-
timestamp: new Date(Date.now()),
|
|
63
|
-
type: "text",
|
|
64
|
-
status: "received",
|
|
65
|
-
authorId: "2",
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
id: "6",
|
|
69
|
-
text: "I'm fine too, thanks for asking",
|
|
70
|
-
timestamp: new Date(Date.now()),
|
|
71
|
-
type: "text",
|
|
72
|
-
status: "sent",
|
|
73
|
-
authorId: "1",
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
id: "7",
|
|
77
|
-
text: "You're welcome",
|
|
78
|
-
timestamp: new Date(Date.now()),
|
|
79
|
-
type: "text",
|
|
80
|
-
status: "received",
|
|
81
|
-
authorId: "2",
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
id: "8",
|
|
85
|
-
text: "Bye",
|
|
86
|
-
timestamp: new Date(Date.now()),
|
|
87
|
-
type: "text",
|
|
88
|
-
status: "sent",
|
|
89
|
-
authorId: "1",
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
id: "9",
|
|
93
|
-
text: "Bye",
|
|
94
|
-
timestamp: new Date(Date.now()),
|
|
95
|
-
type: "text",
|
|
96
|
-
status: "received",
|
|
97
|
-
authorId: "2",
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
id: "10",
|
|
101
|
-
text: "See you later",
|
|
102
|
-
timestamp: new Date(Date.now()),
|
|
103
|
-
type: "text",
|
|
104
|
-
status: "sent",
|
|
105
|
-
authorId: "1",
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
id: "11",
|
|
109
|
-
text: "See you later",
|
|
110
|
-
timestamp: new Date(Date.now()),
|
|
111
|
-
type: "text",
|
|
112
|
-
status: "received",
|
|
113
|
-
authorId: "2",
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
id: "12",
|
|
117
|
-
text: "Bye",
|
|
118
|
-
timestamp: new Date(Date.now()),
|
|
119
|
-
type: "text",
|
|
120
|
-
status: "sent",
|
|
121
|
-
authorId: "1",
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
id: "13",
|
|
125
|
-
text: "Bye",
|
|
126
|
-
timestamp: new Date(Date.now()),
|
|
127
|
-
type: "text",
|
|
128
|
-
status: "received",
|
|
129
|
-
authorId: "2",
|
|
130
|
-
},
|
|
131
|
-
];
|
|
132
|
-
const defaultExampleAuthors: Component["authors"] = [
|
|
133
|
-
{
|
|
134
|
-
id: "1",
|
|
135
|
-
name: "John",
|
|
136
|
-
avatar: "https://i.pravatar.cc/300?img=1",
|
|
137
|
-
status: "online",
|
|
138
|
-
me: true,
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
id: "2",
|
|
142
|
-
name: "Mary",
|
|
143
|
-
avatar: "https://i.pravatar.cc/300?img=2",
|
|
144
|
-
status: "online",
|
|
145
|
-
},
|
|
146
|
-
];
|
|
147
|
-
|
|
148
|
-
const examples: { name: string; description?: string; data: Component }[] = [
|
|
149
|
-
{
|
|
150
|
-
name: "default",
|
|
151
|
-
data: {
|
|
152
|
-
messages: defaultExampleMessages,
|
|
153
|
-
authors: defaultExampleAuthors,
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
name: "withAMessage",
|
|
158
|
-
data: {
|
|
159
|
-
message: { text: 'This is a message from the "message" property' },
|
|
160
|
-
messages: defaultExampleMessages,
|
|
161
|
-
authors: defaultExampleAuthors,
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
name: "moreMessages",
|
|
166
|
-
data: {
|
|
167
|
-
messages: moreExampleMessages,
|
|
168
|
-
authors: defaultExampleAuthors,
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
];
|
|
172
|
-
export const componentSetup: ComponentSetup & { examples: { name: string; description?: string; data: Component }[] } = {
|
|
173
|
-
definitions: null as any,
|
|
174
|
-
storybookArgs,
|
|
175
|
-
styleSetup,
|
|
176
|
-
author: null as any,
|
|
177
|
-
contributors: [],
|
|
178
|
-
owner: null as any,
|
|
179
|
-
htmlSlots,
|
|
180
|
-
i18n: i18nLanguages,
|
|
181
|
-
examples,
|
|
182
|
-
screenshots: [],
|
|
183
|
-
licenses: [{ type: "Apache-2.0", path: "LICENSE.md", cost: 0, currency: "EUR" }],
|
|
184
|
-
readmePath: "README.md",
|
|
185
|
-
name: "hb-messages-box",
|
|
186
|
-
category: "messages",
|
|
187
|
-
tags: ["messages"],
|
|
188
|
-
size: {},
|
|
189
|
-
iifePath: "release/release.js",
|
|
190
|
-
repoName: "@htmlbricks/hb-messages-box",
|
|
191
|
-
version: null as any,
|
|
192
|
-
};
|
package/release/release.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var release=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(t,e){t.appendChild(e)}function i(t,e,n){t.insertBefore(e,n||null)}function c(t){t.parentNode&&t.parentNode.removeChild(t)}function l(t){return document.createElement(t)}function u(){return t=" ",document.createTextNode(t);var t}function d(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function f(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:d(t,e,n)}function p(t){const e={};for(const n of t)e[n.name]=n.value;return e}let h;function m(t){h=t}function g(){if(!h)throw new Error("Function called outside component initialization");return h}function v(){const t=g();return(e,n,{cancelable:o=!1}={})=>{const r=t.$$.callbacks[e];if(r){const s=function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}(e,n,{cancelable:o});return r.slice().forEach((e=>{e.call(t,s)})),!s.defaultPrevented}return!0}}const y=[],$=[];let w=[];const x=[],b=Promise.resolve();let D=!1;function E(t){w.push(t)}const _=new Set;let k=0;function C(){if(0!==k)return;const t=h;do{try{for(;k<y.length;){const t=y[k];k++,m(t),I(t.$$)}}catch(t){throw y.length=0,k=0,t}for(m(null),y.length=0,k=0;$.length;)$.pop()();for(let t=0;t<w.length;t+=1){const e=w[t];_.has(e)||(_.add(e),e())}w.length=0}while(y.length);for(;x.length;)x.pop()();D=!1,_.clear(),m(t)}function I(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(E)}}const L=new Set;function A(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];w.forEach((o=>-1===t.indexOf(o)?e.push(o):n.push(o))),n.forEach((t=>t())),w=e}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function N(t,e){-1===t.$$.dirty[0]&&(y.push(t),D||(D=!0,b.then(C)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function T(s,a,i,l,u,d,f,p=[-1]){const g=h;m(s);const v=s.$$={fragment:null,ctx:[],props:d,update:t,not_equal:u,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(a.context||(g?g.$$.context:[])),callbacks:n(),dirty:p,skip_bound:!1,root:a.target||g.$$.root};f&&f(v.root);let y=!1;if(v.ctx=i?i(s,a.props||{},((t,e,...n)=>{const o=n.length?n[0]:e;return v.ctx&&u(v.ctx[t],v.ctx[t]=o)&&(!v.skip_bound&&v.bound[t]&&v.bound[t](o),y&&N(s,t)),e})):[],v.update(),y=!0,o(v.before_update),v.fragment=!!l&&l(v.ctx),a.target){if(a.hydrate){const t=function(t){return Array.from(t.childNodes)}(a.target);v.fragment&&v.fragment.l(t),t.forEach(c)}else v.fragment&&v.fragment.c();a.intro&&(($=s.$$.fragment)&&$.i&&(L.delete($),$.i(w))),function(t,n,s,a){const{fragment:i,after_update:c}=t.$$;i&&i.m(n,s),a||E((()=>{const n=t.$$.on_mount.map(e).filter(r);t.$$.on_destroy?t.$$.on_destroy.push(...n):o(n),t.$$.on_mount=[]})),c.forEach(E)}(s,a.target,a.anchor,a.customElement),C()}var $,w;m(g)}let S;"function"==typeof HTMLElement&&(S=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){A(this,1),this.$destroy=t}$on(e,n){if(!r(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var j="0.20.18",O=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,P=/\n/g,M=/^\s*/,B=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,H=/^:\s*/,R=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,W=/^[;\s]*/,z=/^\s+|\s+$/g,F="";function q(t){return t?t.replace(z,F):F}var J=function(t,e){var n,o=null;if(!t||"string"!=typeof t)return o;for(var r,s,a=function(t,e){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,o=1;function r(t){var e=t.match(P);e&&(n+=e.length);var r=t.lastIndexOf("\n");o=~r?t.length-r:o+t.length}function s(){var t={line:n,column:o};return function(e){return e.position=new a(t),l(),e}}function a(t){this.start=t,this.end={line:n,column:o},this.source=e.source}function i(r){var s=new Error(e.source+":"+n+":"+o+": "+r);if(s.reason=r,s.filename=e.source,s.line=n,s.column=o,s.source=t,!e.silent)throw s}function c(e){var n=e.exec(t);if(n){var o=n[0];return r(o),t=t.slice(o.length),n}}function l(){c(M)}function u(t){var e;for(t=t||[];e=d();)!1!==e&&t.push(e);return t}function d(){var e=s();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var n=2;F!=t.charAt(n)&&("*"!=t.charAt(n)||"/"!=t.charAt(n+1));)++n;if(n+=2,F===t.charAt(n-1))return i("End of comment missing");var a=t.slice(2,n-2);return o+=2,r(a),t=t.slice(n),o+=2,e({type:"comment",comment:a})}}function f(){var t=s(),e=c(B);if(e){if(d(),!c(H))return i("property missing ':'");var n=c(R),o=t({type:"declaration",property:q(e[0].replace(O,F)),value:n?q(n[0].replace(O,F)):F});return c(W),o}}return a.prototype.content=t,l(),function(){var t,e=[];for(u(e);t=f();)!1!==t&&(e.push(t),u(e));return e}()}(t),i="function"==typeof e,c=0,l=a.length;c<l;c++)r=(n=a[c]).property,s=n.value,i?e(r,s,n):s&&(o||(o={}),o[r]=s);return o};var K,V=(function(t,e){e.__esModule=!0,e.LanguageTranslator=e.addComponent=e.getChildStyleToPass=void 0,e.getChildStyleToPass=function(t,e){var n,o,r="";if(t&&(null==e?void 0:e.length)&&(null===(n=Object.keys(t))||void 0===n?void 0:n.length)&&(null===(o=null==e?void 0:e.filter((function(e){return Object.keys(t).includes(e.name)})))||void 0===o?void 0:o.length))for(var s=function(n){(null==e?void 0:e.filter((function(e){return e.name===n&&e.defaultValue!==t[n]})))&&(r+="".concat(n,":").concat(t[n],";"))},a=0,i=Object.keys(t);a<i.length;a++)s(i[a]);return r},e.addComponent=function(t){var e,n=(null===(e=null==t?void 0:t.repoName.split("/"))||void 0===e?void 0:e[1])||(null==t?void 0:t.repoName);if(!n)throw new Error("wrong componentPath "+(null==t?void 0:t.repoName));if(!(null==t?void 0:t.version))throw new Error("wrong version "+(null==t?void 0:t.version));var o=(null==t?void 0:t.iifePath)||"release/release.js";if(!document.getElementById(n+"-script"))try{var r=document.createElement("script");r.id=n+"-script",r.src="https://cdn.jsdelivr.net/npm/".concat(t.repoName,"@").concat(t.version,"/").concat(o),(null==t?void 0:t.local)&&location.href.includes("localhost")&&(r.src="".concat(t.local)),document.head.appendChild(r)}catch(t){console.warn(t)}};var n=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(e){e||(e=t.getDefaultLang()),this.lang=e},t.prototype.translateWord=function(e,n){return t.getDictionaryWord(e,this.dictionary,n||this.lang)},t.prototype.translateDate=function(e,n,o){return t.formatDate(e,n,o||this.lang)},t.getDefaultLang=function(){var t,e,n,o,r,s="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(n=null===(e=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||void 0===n?void 0:n.length)&&(s=null===(r=null===(o=navigator.languages[0])||void 0===o?void 0:o.split("-")[0])||void 0===r?void 0:r.toLowerCase()),s},t.getDictionaryWord=function(e,n,o){var r;if(!e)throw new Error("no wordKey provided");if(!n)throw new Error("no dictionary provided");if(o&&(null===(r=n[o])||void 0===r?void 0:r[e]))return n[o][e];var s="",a=t.getDefaultLang();if(!o||a!==o){var i=null==n?void 0:n[a];(null==i?void 0:i[e])&&(s=i[e])}return s},t.formatDate=function(e,n,o){if(!e)throw new Error("no date provided");if("function"!=typeof e.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(o||t.getDefaultLang(),n).format(e)},t}();e.LanguageTranslator=n}(K={exports:{}},K.exports),K.exports),Y=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,s=e.length;r<s;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},G={vars:[],parts:[{name:"testpart",description:"test css part on 2 div tag"}]};Y(Y([],[{id:"1",text:"Hello",timestamp:new Date(Date.now()-36e3),type:"text",status:"sent",authorId:"1"},{id:"2",text:"Hi",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"}],!0),[{id:"3",text:"How are you?",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"},{id:"4",text:"I'm fine, thanks",timestamp:new Date(Date.now()),type:"text",status:"sent",authorId:"1"},{id:"5",text:"What about you?",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"},{id:"6",text:"I'm fine too, thanks for asking",timestamp:new Date(Date.now()),type:"text",status:"sent",authorId:"1"},{id:"7",text:"You're welcome",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"},{id:"8",text:"Bye",timestamp:new Date(Date.now()),type:"text",status:"sent",authorId:"1"},{id:"9",text:"Bye",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"},{id:"10",text:"See you later",timestamp:new Date(Date.now()),type:"text",status:"sent",authorId:"1"},{id:"11",text:"See you later",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"},{id:"12",text:"Bye",timestamp:new Date(Date.now()),type:"text",status:"sent",authorId:"1"},{id:"13",text:"Bye",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"}],!1);var Q={vars:[],parts:[{name:"testpart",description:"test css part on 2 div tag"}]};function U(t){let e,n,o,r,s,p,h;return{c(){e=l("div"),n=l("hb-messages-list"),o=u(),r=l("div"),s=l("hb-messages-send"),f(n,"messages",t[0]),f(n,"authors",t[1]),f(n,"options",t[2]),f(n,"style",t[4]),f(n,"class","msglist"),f(n,"part","msglist"),d(e,"id","message-list"),f(s,"text",t[3]),f(s,"part","msgsend"),f(s,"class","msgsend"),f(s,"style",t[5]),d(r,"id","prompt")},m(c,l){var u,d,f,m;i(c,e,l),a(e,n),i(c,o,l),i(c,r,l),a(r,s),p||(u=s,d="sendMessage",f=t[11],u.addEventListener(d,f,m),h=()=>u.removeEventListener(d,f,m),p=!0)},p(t,e){1&e&&f(n,"messages",t[0]),2&e&&f(n,"authors",t[1]),4&e&&f(n,"options",t[2]),16&e&&f(n,"style",t[4]),8&e&&f(s,"text",t[3]),32&e&&f(s,"style",t[5])},d(t){t&&c(e),t&&c(o),t&&c(r),p=!1,h()}}}function X(e){let n,o=e[1]?.length&&e[0]?.length&&U(e);return{c(){n=l("div"),o&&o.c(),this.c=t,d(n,"id","container")},m(t,e){i(t,n,e),o&&o.m(n,null)},p(t,[e]){t[1]?.length&&t[0]?.length?o?o.p(t,e):(o=U(t),o.c(),o.m(n,null)):o&&(o.d(1),o=null)},i:t,o:t,d(t){t&&c(n),o&&o.d()}}}function Z(t,e,n){const o=g(),r=v();let s,a,{id:i}=e,{style:c}=e,{messages:l}=e,{authors:u}=e,{options:d}=e,{message:f}=e,p="",h="";function m(t){if(!t.file&&!t.text)return console.warn("no message to received",t);!function(t,e){r(t,e),o.dispatchEvent&&o.dispatchEvent(new CustomEvent(t,{detail:e}))}("sendMessage",t),n(3,a=t.text),n(3,a="")}V.addComponent({repoName:"@htmlbricks/hb-messages-list",version:j}),V.addComponent({repoName:"@htmlbricks/hb-messages-send",version:j});return t.$$set=t=>{"id"in t&&n(7,i=t.id),"style"in t&&n(9,c=t.style),"messages"in t&&n(0,l=t.messages),"authors"in t&&n(1,u=t.authors),"options"in t&&n(2,d=t.options),"message"in t&&n(8,f=t.message)},t.$$.update=()=>{if(1928&t.$$.dirty){if(i||n(7,i=""),c&&(n(10,s=J(c)),n(4,p=V.getChildStyleToPass(s,null==G?void 0:G.vars)),n(5,h=V.getChildStyleToPass(s,null==Q?void 0:Q.vars))),"string"==typeof f)try{n(8,f=JSON.parse(f))}catch(t){console.error("error parsing message",t)}f||n(8,f={text:""}),a||""===a||n(3,a=(null==f?void 0:f.text)?f.text:"")}},[l,u,d,a,p,h,m,i,f,c,s,t=>m(t.detail)]}class tt extends S{constructor(t){super();const e=document.createElement("style");e.textContent='@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css");:host{font-family:"Roboto", sans-serif}#container{display:flex;flex-direction:column;height:100vh}#message-list{flex:1;overflow-y:auto;margin-bottom:200px}#prompt{height:100px;background-color:red;position:fixed;bottom:0;width:100%;z-index:100}.msgsend{background-color:red;display:block}',this.shadowRoot.appendChild(e),T(this,{target:this.shadowRoot,props:p(this.attributes),customElement:!0},Z,X,s,{id:7,style:9,messages:0,authors:1,options:2,message:8},null),t&&(t.target&&i(t.target,this,t.anchor),t.props&&(this.$set(t.props),C()))}static get observedAttributes(){return["id","style","messages","authors","options","message"]}get id(){return this.$$.ctx[7]}set id(t){this.$$set({id:t}),C()}get style(){return this.$$.ctx[9]}set style(t){this.$$set({style:t}),C()}get messages(){return this.$$.ctx[0]}set messages(t){this.$$set({messages:t}),C()}get authors(){return this.$$.ctx[1]}set authors(t){this.$$set({authors:t}),C()}get options(){return this.$$.ctx[2]}set options(t){this.$$set({options:t}),C()}get message(){return this.$$.ctx[8]}set message(t){this.$$set({message:t}),C()}}return customElements.define("hb-messages-box",tt),tt}();
|
|
2
|
-
//# sourceMappingURL=release.js.map
|