quickblox-react-ui-kit 0.4.4-alpha.9 → 0.4.5-beta.2
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/dist/index-ui.js +11 -11
- package/package.json +3 -1
- package/src/Data/Stubs.ts +6 -6
- package/src/Presentation/Views/Dialog/MessageItem/MessageItem.tsx +2 -2
- package/src/Presentation/layouts/TestStage/LoginView/Login.scss +6 -3
- package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.stories.tsx +5 -4
- package/src/Presentation/ui-components/Header/Header.scss +5 -0
- package/src/Presentation/ui-components/Message/Bubble/TextBubble/TextBubble.scss +0 -1
- package/src/Presentation/ui-components/Message/FileUrl/FileUrl.scss +0 -3
- package/src/Presentation/ui-components/Placeholder/Placeholder.scss +5 -0
- package/webpack.lib.config-debug.js +87 -0
- package/webpack.lib.config.js +78 -78
- package/dist/stories/Button.d.ts +0 -15
- package/dist/stories/Button.d.ts.map +0 -1
- package/dist/stories/Button.stories.d.ts +0 -23
- package/dist/stories/Button.stories.d.ts.map +0 -1
- package/dist/stories/Header.d.ts +0 -12
- package/dist/stories/Header.d.ts.map +0 -1
- package/dist/stories/Header.stories.d.ts +0 -18
- package/dist/stories/Header.stories.d.ts.map +0 -1
- package/dist/stories/Page.d.ts +0 -4
- package/dist/stories/Page.d.ts.map +0 -1
- package/dist/stories/Page.stories.d.ts +0 -13
- package/dist/stories/Page.stories.d.ts.map +0 -1
- package/src/stories/Button.stories.ts +0 -53
- package/src/stories/Button.tsx +0 -37
- package/src/stories/Configure.mdx +0 -364
- package/src/stories/Header.stories.ts +0 -33
- package/src/stories/Header.tsx +0 -56
- package/src/stories/Page.stories.ts +0 -32
- package/src/stories/Page.tsx +0 -73
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -1
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -1
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -1
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -1
- package/src/stories/assets/youtube.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/src/stories/page.css +0 -68
- /package/{webpack.lib.config-old.js → webpack.lib.config-prev.js} +0 -0
package/dist/index-ui.js
CHANGED
|
@@ -297,7 +297,7 @@ module.exports = styleTagTransform;
|
|
|
297
297
|
|
|
298
298
|
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
299
299
|
// Module
|
|
300
|
-
___CSS_LOADER_EXPORT___.push([module.id, `.placeholder{display:flex;flex-direction:column;align-items:center}.placeholder,.placeholder *{box-sizing:border-box}.placeholder__text{font-family:"Roboto";font-weight:400;font-size:16px;line-height:24px;letter-spacing:.15px;color:var(--caption);text-align:center}.placeholder__icon{width:52px;height:52px;margin-bottom:16px;fill:var(--caption)}.placeholder__retry{display:flex;align-items:center;padding:4px 8px 4px 8px;fill:#3978fc;color:#3978fc;font-family:"Roboto";font-weight:700;font-size:14px;line-height:16px;letter-spacing:.4px}.placeholder__retry-icon{width:24px;height:24px;margin-right:8px;cursor:pointer}`, ""]);
|
|
300
|
+
___CSS_LOADER_EXPORT___.push([module.id, `.placeholder{display:flex;flex-direction:column;align-items:center}.placeholder,.placeholder *{box-sizing:border-box}.placeholder__text{font-family:"Roboto";font-weight:400;font-size:16px;line-height:24px;letter-spacing:.15px;color:var(--caption);text-align:center}.placeholder__icon{width:52px;height:52px;margin-bottom:16px;fill:var(--caption)}.placeholder__icon svg{width:52px;height:52px}.placeholder__retry{display:flex;align-items:center;padding:4px 8px 4px 8px;fill:#3978fc;color:#3978fc;font-family:"Roboto";font-weight:700;font-size:14px;line-height:16px;letter-spacing:.4px}.placeholder__retry-icon{width:24px;height:24px;margin-right:8px;cursor:pointer}`, ""]);
|
|
301
301
|
// Exports
|
|
302
302
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
303
303
|
|
|
@@ -58446,7 +58446,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.dialog-preview-container{display:flex
|
|
|
58446
58446
|
|
|
58447
58447
|
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
58448
58448
|
// Module
|
|
58449
|
-
___CSS_LOADER_EXPORT___.push([module.id, `.dialog-header{width:100%;padding:12px 16px 12px 20px;display:flex;align-items:center;gap:33px}.dialog-header,.dialog-header *{box-sizing:border-box}.dialog-header__icon{cursor:pointer;width:24px;height:24px;flex-shrink:0}.dialog-header__back{color:var(--main-elements)}.dialog-header__body{width:100%;display:flex;gap:33px;align-items:center;justify-content:space-between;overflow:hidden}.dialog-header__body-left{display:flex;align-items:center;justify-content:flex-start;gap:8px;overflow:hidden}.dialog-header__body-right{height:24px;display:flex;align-items:center;gap:16px}.dialog-header__title{color:var(--main-text, #0b1b0f);text-align:left;font:var(--title-title-medium);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dialog-header__line{border-style:solid;border-color:var(--color-divider, #e7efff);border-width:0 0 1px 0}@media only screen and (max-width: var(--min-width-screen-desktop)){.dialog-header__body-left{gap:3px}}@media only screen and (min-width: 981px){.dialog-header__back{display:none}}`, ""]);
|
|
58449
|
+
___CSS_LOADER_EXPORT___.push([module.id, `.dialog-header{width:100%;padding:12px 16px 12px 20px;display:flex;align-items:center;gap:33px}.dialog-header,.dialog-header *{box-sizing:border-box}.dialog-header__icon{cursor:pointer;width:24px;height:24px;flex-shrink:0}.dialog-header__icon svg{width:24px;height:24px}.dialog-header__back{color:var(--main-elements)}.dialog-header__body{width:100%;display:flex;gap:33px;align-items:center;justify-content:space-between;overflow:hidden}.dialog-header__body-left{display:flex;align-items:center;justify-content:flex-start;gap:8px;overflow:hidden}.dialog-header__body-right{height:24px;display:flex;align-items:center;gap:16px}.dialog-header__title{color:var(--main-text, #0b1b0f);text-align:left;font:var(--title-title-medium);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dialog-header__line{border-style:solid;border-color:var(--color-divider, #e7efff);border-width:0 0 1px 0}@media only screen and (max-width: var(--min-width-screen-desktop)){.dialog-header__body-left{gap:3px}}@media only screen and (min-width: 981px){.dialog-header__back{display:none}}`, ""]);
|
|
58450
58450
|
// Exports
|
|
58451
58451
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
58452
58452
|
|
|
@@ -59285,7 +59285,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.message-view-container{display:flex;f
|
|
|
59285
59285
|
|
|
59286
59286
|
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
59287
59287
|
// Module
|
|
59288
|
-
___CSS_LOADER_EXPORT___.push([module.id, `.file-attachment{display:flex;flex-direction:row;gap:8px;align-items:center;justify-content:flex-start;align-self:stretch;flex-shrink:0;position:relative}.file-attachment__placeholder{flex-shrink:0;width:32px;height:32px;position:static}.file-attachment__placeholder__bg{background:var(--tertiary-elements, #636d78);border-radius:8px;width:32px;height:32px;position:absolute;left:0px;top:0px}.file-attachment__placeholder__bg__icon{border-radius:4px;padding:4px;display:flex;flex-direction:row;gap:0px;align-items:center;justify-content:center;width:24px;height:24px
|
|
59288
|
+
___CSS_LOADER_EXPORT___.push([module.id, `.file-attachment{display:flex;flex-direction:row;gap:8px;align-items:center;justify-content:flex-start;align-self:stretch;flex-shrink:0;position:relative}.file-attachment__placeholder{flex-shrink:0;width:32px;height:32px;position:static}.file-attachment__placeholder__bg{background:var(--tertiary-elements, #636d78);border-radius:8px;width:32px;height:32px;position:absolute;left:0px;top:0px}.file-attachment__placeholder__bg__icon{border-radius:4px;padding:4px;display:flex;flex-direction:row;gap:0px;align-items:center;justify-content:center;width:24px;height:24px}.file-attachment__file-name{color:var(--secondary-text, #636d78);text-align:left;font:var(--body-body-medium);position:relative}.message-icon-file{align-self:stretch;flex:1;height:auto;position:relative;overflow:visible;fill:var(--color-media-icon, #ffffff)}`, ""]);
|
|
59289
59289
|
// Exports
|
|
59290
59290
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
59291
59291
|
|
|
@@ -59434,7 +59434,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.main-button {
|
|
|
59434
59434
|
|
|
59435
59435
|
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
59436
59436
|
// Module
|
|
59437
|
-
___CSS_LOADER_EXPORT___.push([module.id, `.bubble-content-text{overflow-wrap:break-word;max-width:calc(var(--max-width-message-bubble) - 20px);color:var(--main-tex, #0b1b0f);text-align:left;font:var(--body-body-medium, 400 14px/20px "Roboto-Regular", sans-serif)}.text-bubble-background__incoming{background:var(--incoming-background, #e4e6e8);border-radius:22px 22px 22px 0px;padding:8px 12px 8px 12px;display:flex;flex-direction:row;gap:10px;align-items:flex-start;justify-content:flex-start;flex-shrink:0;position:relative
|
|
59437
|
+
___CSS_LOADER_EXPORT___.push([module.id, `.bubble-content-text{overflow-wrap:break-word;max-width:calc(var(--max-width-message-bubble) - 20px);color:var(--main-tex, #0b1b0f);text-align:left;font:var(--body-body-medium, 400 14px/20px "Roboto-Regular", sans-serif)}.text-bubble-background__incoming{background:var(--incoming-background, #e4e6e8);border-radius:22px 22px 22px 0px;padding:8px 12px 8px 12px;display:flex;flex-direction:row;gap:10px;align-items:flex-start;justify-content:flex-start;flex-shrink:0;position:relative}.text-bubble-background__outgoing{background:var(--outgoing-background, #E7EFFF);border-radius:22px 22px 0px 22px;padding:8px 12px 8px 12px;display:flex;flex-direction:row;gap:10px;align-items:flex-start;justify-content:flex-start;flex-shrink:0;position:relative}`, ""]);
|
|
59438
59438
|
// Exports
|
|
59439
59439
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
59440
59440
|
|
|
@@ -62518,12 +62518,12 @@ class Stubs {
|
|
|
62518
62518
|
id: '10231',
|
|
62519
62519
|
type: FileType.image,
|
|
62520
62520
|
uid: '10231',
|
|
62521
|
-
url: 'https://
|
|
62521
|
+
url: 'https://files.readme.io/00b5563-small-qb-logo-docs-white-9px.png',
|
|
62522
62522
|
file: {
|
|
62523
62523
|
id: '10231',
|
|
62524
62524
|
uid: '',
|
|
62525
62525
|
type: FileType.image,
|
|
62526
|
-
url: 'https://
|
|
62526
|
+
url: 'https://files.readme.io/00b5563-small-qb-logo-docs-white-9px.png',
|
|
62527
62527
|
},
|
|
62528
62528
|
};
|
|
62529
62529
|
const photoAttachments = [photo];
|
|
@@ -62612,12 +62612,12 @@ class Stubs {
|
|
|
62612
62612
|
id: '10231',
|
|
62613
62613
|
type: FileType.image,
|
|
62614
62614
|
uid: '10231',
|
|
62615
|
-
url: 'https://
|
|
62615
|
+
url: 'https://cdn-ikpjoif.nitrocdn.com/WZsqFPiehrtwFaaeJNQAQZrkRMgaTuyL/assets/images/optimized/rev-83f47e6/quickblox.com/wp-content/themes/QuickbloxTheme2021/img/chat-api-feature-rich-sdk.jpg',
|
|
62616
62616
|
file: {
|
|
62617
62617
|
id: '10231',
|
|
62618
62618
|
uid: '',
|
|
62619
62619
|
type: FileType.image,
|
|
62620
|
-
url: 'https://
|
|
62620
|
+
url: 'https://cdn-ikpjoif.nitrocdn.com/WZsqFPiehrtwFaaeJNQAQZrkRMgaTuyL/assets/images/optimized/rev-83f47e6/quickblox.com/wp-content/themes/QuickbloxTheme2021/img/chat-api-feature-rich-sdk.jpg',
|
|
62621
62621
|
},
|
|
62622
62622
|
};
|
|
62623
62623
|
const photoAttachments = [photo];
|
|
@@ -63100,12 +63100,12 @@ class Stubs {
|
|
|
63100
63100
|
id: '10231',
|
|
63101
63101
|
type: FileType.image,
|
|
63102
63102
|
uid: '10231',
|
|
63103
|
-
url: 'https://
|
|
63103
|
+
url: 'https://files.readme.io/00b5563-small-qb-logo-docs-white-9px.png',
|
|
63104
63104
|
file: {
|
|
63105
63105
|
id: '10231',
|
|
63106
63106
|
uid: '',
|
|
63107
63107
|
type: FileType.image,
|
|
63108
|
-
url: 'https://
|
|
63108
|
+
url: 'https://files.readme.io/00b5563-small-qb-logo-docs-white-9px.png',
|
|
63109
63109
|
},
|
|
63110
63110
|
};
|
|
63111
63111
|
const photoAttachments = [photo];
|
|
@@ -75100,7 +75100,7 @@ listRef, messagesToView, AITranslateWidget, AIAssistWidget, maxTokens, defaultTr
|
|
|
75100
75100
|
? state[message.id].translatedText.length === 0
|
|
75101
75101
|
: true, loading: state[message.id] && state[message.id].loading
|
|
75102
75102
|
? state[message.id].loading
|
|
75103
|
-
: false, onLoading: (isFetching, id) => fetchingHandler(isFetching, id), onError: onError, messageToTranslate: message, messageHistory: messagesToView, currentUserId: currentUserId, maxTokens: maxTokens, onTranslated: (id, textTranslated) => translatedHandler(id, textTranslated) })) : undefined, additionalPart: (0,jsx_runtime_.jsx)("div", { className: "message-item-additional-part", children: renderAdditionalPart(messageTypes, message) }), children: message.attachments && message.attachments.length > 0 ? ((0,jsx_runtime_.jsx)(
|
|
75103
|
+
: false, onLoading: (isFetching, id) => fetchingHandler(isFetching, id), onError: onError, messageToTranslate: message, messageHistory: messagesToView, currentUserId: currentUserId, maxTokens: maxTokens, onTranslated: (id, textTranslated) => translatedHandler(id, textTranslated) })) : undefined, additionalPart: (0,jsx_runtime_.jsx)("div", { className: "message-item-additional-part", children: renderAdditionalPart(messageTypes, message) }), children: message.attachments && message.attachments.length > 0 ? ((0,jsx_runtime_.jsx)(jsx_runtime_.Fragment, { children: message.attachments.map((attachment) => {
|
|
75104
75104
|
return ((0,jsx_runtime_.jsx)(AttachmentBubble, { attachment: attachment, typeMessage: messageTypes }));
|
|
75105
75105
|
}) })) : ((0,jsx_runtime_.jsx)(TextBubble_TextBubble_TextBubble, { text: state[message.id] &&
|
|
75106
75106
|
state[message.id].translatedText &&
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quickblox-react-ui-kit",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5-beta.2",
|
|
4
4
|
"main": "dist/index-ui.js",
|
|
5
5
|
"types": "dist/index-ui.d.ts",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"@typescript-eslint/eslint-plugin-tslint": "^5.45.1",
|
|
46
46
|
"@typescript-eslint/parser": "^5.45.1",
|
|
47
47
|
"babel-loader": "^9.2.1",
|
|
48
|
+
"compression-webpack-plugin": "^11.1.0",
|
|
48
49
|
"css-loader": "^6.11.0",
|
|
49
50
|
"eslint": "^8.29.0",
|
|
50
51
|
"eslint-config-airbnb": "^19.0.4",
|
|
@@ -61,6 +62,7 @@
|
|
|
61
62
|
"eslint-plugin-storybook": "^0.11.3",
|
|
62
63
|
"file-loader": "^6.2.0",
|
|
63
64
|
"html-webpack-plugin": "^5.6.3",
|
|
65
|
+
"mini-css-extract-plugin": "^2.9.2",
|
|
64
66
|
"path-browserify": "^1.0.1",
|
|
65
67
|
"prettier": "^2.8.0",
|
|
66
68
|
"process": "^0.11.10",
|
package/src/Data/Stubs.ts
CHANGED
|
@@ -131,12 +131,12 @@ export class Stubs {
|
|
|
131
131
|
id: '10231',
|
|
132
132
|
type: FileType.image,
|
|
133
133
|
uid: '10231',
|
|
134
|
-
url: 'https://
|
|
134
|
+
url: 'https://files.readme.io/00b5563-small-qb-logo-docs-white-9px.png',
|
|
135
135
|
file: {
|
|
136
136
|
id: '10231',
|
|
137
137
|
uid: '',
|
|
138
138
|
type: FileType.image,
|
|
139
|
-
url: 'https://
|
|
139
|
+
url: 'https://files.readme.io/00b5563-small-qb-logo-docs-white-9px.png',
|
|
140
140
|
},
|
|
141
141
|
};
|
|
142
142
|
const photoAttachments: ChatMessageAttachmentEntity[] = [photo];
|
|
@@ -267,12 +267,12 @@ export class Stubs {
|
|
|
267
267
|
id: '10231',
|
|
268
268
|
type: FileType.image,
|
|
269
269
|
uid: '10231',
|
|
270
|
-
url: 'https://
|
|
270
|
+
url: 'https://cdn-ikpjoif.nitrocdn.com/WZsqFPiehrtwFaaeJNQAQZrkRMgaTuyL/assets/images/optimized/rev-83f47e6/quickblox.com/wp-content/themes/QuickbloxTheme2021/img/chat-api-feature-rich-sdk.jpg',
|
|
271
271
|
file: {
|
|
272
272
|
id: '10231',
|
|
273
273
|
uid: '',
|
|
274
274
|
type: FileType.image,
|
|
275
|
-
url: 'https://
|
|
275
|
+
url: 'https://cdn-ikpjoif.nitrocdn.com/WZsqFPiehrtwFaaeJNQAQZrkRMgaTuyL/assets/images/optimized/rev-83f47e6/quickblox.com/wp-content/themes/QuickbloxTheme2021/img/chat-api-feature-rich-sdk.jpg',
|
|
276
276
|
},
|
|
277
277
|
};
|
|
278
278
|
const photoAttachments: ChatMessageAttachmentEntity[] = [photo];
|
|
@@ -1029,12 +1029,12 @@ export class Stubs {
|
|
|
1029
1029
|
id: '10231',
|
|
1030
1030
|
type: FileType.image,
|
|
1031
1031
|
uid: '10231',
|
|
1032
|
-
url: 'https://
|
|
1032
|
+
url: 'https://files.readme.io/00b5563-small-qb-logo-docs-white-9px.png',
|
|
1033
1033
|
file: {
|
|
1034
1034
|
id: '10231',
|
|
1035
1035
|
uid: '',
|
|
1036
1036
|
type: FileType.image,
|
|
1037
|
-
url: 'https://
|
|
1037
|
+
url: 'https://files.readme.io/00b5563-small-qb-logo-docs-white-9px.png',
|
|
1038
1038
|
},
|
|
1039
1039
|
};
|
|
1040
1040
|
const photoAttachments: ChatMessageAttachmentEntity[] = [photo];
|
|
@@ -346,7 +346,7 @@ export default function MessageItem({
|
|
|
346
346
|
}
|
|
347
347
|
>
|
|
348
348
|
{message.attachments && message.attachments.length > 0 ? (
|
|
349
|
-
|
|
349
|
+
<>
|
|
350
350
|
{message.attachments.map((attachment) => {
|
|
351
351
|
return (
|
|
352
352
|
<AttachmentBubble
|
|
@@ -355,7 +355,7 @@ export default function MessageItem({
|
|
|
355
355
|
/>
|
|
356
356
|
);
|
|
357
357
|
})}
|
|
358
|
-
|
|
358
|
+
</>
|
|
359
359
|
) : (
|
|
360
360
|
<TextBubble
|
|
361
361
|
text={
|
|
@@ -15,23 +15,26 @@ strong {
|
|
|
15
15
|
/* ---------- LOGIN ---------- */
|
|
16
16
|
|
|
17
17
|
#login {
|
|
18
|
-
border: 3px solid #6c38cc;
|
|
19
18
|
margin: 50px auto;
|
|
20
19
|
width: 100%;
|
|
21
20
|
}
|
|
22
21
|
|
|
22
|
+
form {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-flow: column;
|
|
25
|
+
}
|
|
26
|
+
|
|
23
27
|
form fieldset input[type="text"],
|
|
24
28
|
input[type="password"] {
|
|
25
29
|
appearance: none;
|
|
26
30
|
background: #e5e5e5;
|
|
27
|
-
border: none;
|
|
28
31
|
border-radius: 3px;
|
|
29
32
|
color: #5a5656;
|
|
30
33
|
font-family: inherit;
|
|
31
34
|
font-size: 14px;
|
|
32
35
|
height: 50px;
|
|
33
36
|
outline: none;
|
|
34
|
-
padding:
|
|
37
|
+
padding: 0;
|
|
35
38
|
width: 100%;
|
|
36
39
|
border: 1px solid #008dde;
|
|
37
40
|
margin: 1px;
|
|
@@ -119,7 +119,7 @@ export const DialogItemPreviewDefault: Story = {
|
|
|
119
119
|
},
|
|
120
120
|
render: (args) => {
|
|
121
121
|
// eslint-disable-next-line no-param-reassign
|
|
122
|
-
args.date = new Date(args.date!).toLocaleDateString();
|
|
122
|
+
args.date = args.date ? new Date(args.date!).toLocaleDateString() : new Date().toLocaleDateString();
|
|
123
123
|
|
|
124
124
|
return <DialogItemPreview {...args} />;
|
|
125
125
|
},
|
|
@@ -134,6 +134,7 @@ export const DialogItemPreviewFullScreen: Story = {
|
|
|
134
134
|
"Hello, dear Mr. User. Thank you for choosing us. I'm here to assist with your order's delivery. Please provide your preferred address and any specific instructions. We offer standard, express, and same-day delivery in select areas. Let us know your convenience, and we'll ensure a smooth process.",
|
|
135
135
|
badge: <Badge count={5} />,
|
|
136
136
|
contextMenu: <MoreSvg />,
|
|
137
|
+
|
|
137
138
|
},
|
|
138
139
|
parameters: {
|
|
139
140
|
viewport: {
|
|
@@ -142,7 +143,7 @@ export const DialogItemPreviewFullScreen: Story = {
|
|
|
142
143
|
},
|
|
143
144
|
render: (args) => {
|
|
144
145
|
// eslint-disable-next-line no-param-reassign
|
|
145
|
-
args.date = new Date(
|
|
146
|
+
args.date = new Date().toLocaleDateString();
|
|
146
147
|
|
|
147
148
|
return <DialogItemPreview {...args} />;
|
|
148
149
|
},
|
|
@@ -165,7 +166,7 @@ export const DialogItemPreviewMobileScreen: Story = {
|
|
|
165
166
|
},
|
|
166
167
|
render: (args) => {
|
|
167
168
|
// eslint-disable-next-line no-param-reassign
|
|
168
|
-
args.date = new Date(args.date!).toLocaleDateString();
|
|
169
|
+
args.date = args.date ? new Date(args.date!).toLocaleDateString() : new Date().toLocaleDateString();
|
|
169
170
|
|
|
170
171
|
return <DialogItemPreview {...args} />;
|
|
171
172
|
},
|
|
@@ -188,7 +189,7 @@ export const DialogItemPreviewMobileScreenIPad: Story = {
|
|
|
188
189
|
},
|
|
189
190
|
render: (args) => {
|
|
190
191
|
// eslint-disable-next-line no-param-reassign
|
|
191
|
-
args.date = new Date(args.date!).toLocaleDateString();
|
|
192
|
+
args.date = args.date ? new Date(args.date!).toLocaleDateString() : new Date().toLocaleDateString();
|
|
192
193
|
|
|
193
194
|
return <DialogItemPreview {...args} />;
|
|
194
195
|
},
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
mode: 'production',
|
|
5
|
+
entry: path.resolve(__dirname, 'src/index-ui.ts'),
|
|
6
|
+
output: {
|
|
7
|
+
filename: 'index-ui.js',
|
|
8
|
+
path: path.resolve(__dirname, 'dist'),
|
|
9
|
+
library: {
|
|
10
|
+
name: 'QuickBloxUIKit',
|
|
11
|
+
type: 'umd',
|
|
12
|
+
},
|
|
13
|
+
globalObject: 'this',
|
|
14
|
+
clean: true,
|
|
15
|
+
assetModuleFilename: '[name][ext]', // Сохраняем оригинальные имена файлов
|
|
16
|
+
},
|
|
17
|
+
resolve: {
|
|
18
|
+
extensions: ['.tsx', '.ts', '.js'],
|
|
19
|
+
modules: [path.resolve(__dirname, 'src'), 'node_modules'],
|
|
20
|
+
},
|
|
21
|
+
externals: {
|
|
22
|
+
react: {
|
|
23
|
+
commonjs: 'react',
|
|
24
|
+
commonjs2: 'react',
|
|
25
|
+
amd: 'react',
|
|
26
|
+
root: 'React',
|
|
27
|
+
},
|
|
28
|
+
'react-dom': {
|
|
29
|
+
commonjs: 'react-dom',
|
|
30
|
+
commonjs2: 'react-dom',
|
|
31
|
+
amd: 'react-dom',
|
|
32
|
+
root: 'ReactDOM',
|
|
33
|
+
},
|
|
34
|
+
'react/jsx-runtime': 'react/jsx-runtime',
|
|
35
|
+
},
|
|
36
|
+
module: {
|
|
37
|
+
rules: [
|
|
38
|
+
{
|
|
39
|
+
test: /\.(ts|tsx)$/,
|
|
40
|
+
use: {
|
|
41
|
+
loader: 'ts-loader',
|
|
42
|
+
options: {
|
|
43
|
+
configFile: path.resolve(__dirname, 'tsconfig.buildlib.json'),
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
exclude: [/node_modules/, /stories/],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
test: /\.css$/i,
|
|
50
|
+
use: ['style-loader', 'css-loader'],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
test: /\.s[ac]ss$/i,
|
|
54
|
+
use: ['style-loader', 'css-loader', 'sass-loader'],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
test: /\.svg$/i, // 🔥 Все SVG → импортируются **ТОЛЬКО** как React-компоненты
|
|
58
|
+
use: [
|
|
59
|
+
{
|
|
60
|
+
loader: '@svgr/webpack',
|
|
61
|
+
options: {
|
|
62
|
+
icon: true,
|
|
63
|
+
esModule: true,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
test: /\.(png|jpg|jpeg|gif)$/i, // Поддержка изображений, без хеширования
|
|
70
|
+
type: 'asset/resource',
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
optimization: {
|
|
75
|
+
minimize: false, // 🔥 Отключаем минимизацию JS и CSS
|
|
76
|
+
splitChunks: false, // 🔥 Отключаем разделение чанков
|
|
77
|
+
removeAvailableModules: false, // Оставляем модули без изменений
|
|
78
|
+
removeEmptyChunks: false, // Не удаляем пустые чанки
|
|
79
|
+
mergeDuplicateChunks: false, // Не объединяем дубликаты
|
|
80
|
+
},
|
|
81
|
+
performance: {
|
|
82
|
+
hints: false, // 🔥 Отключаем предупреждения о производительности
|
|
83
|
+
},
|
|
84
|
+
experiments: {
|
|
85
|
+
outputModule: false, // Отключаем ES-модули (так как UMD не поддерживает их)
|
|
86
|
+
},
|
|
87
|
+
};
|
package/webpack.lib.config.js
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
resolve: {
|
|
18
|
-
extensions: ['.tsx', '.ts', '.js'],
|
|
19
|
-
modules: [path.resolve(__dirname, 'src'), 'node_modules'],
|
|
20
|
-
},
|
|
21
|
-
externals: {
|
|
22
|
-
react: {
|
|
23
|
-
commonjs: 'react',
|
|
24
|
-
commonjs2: 'react',
|
|
25
|
-
amd: 'react',
|
|
26
|
-
root: 'React',
|
|
4
|
+
mode: 'production',
|
|
5
|
+
entry: path.resolve(__dirname, 'src/index-ui.ts'),
|
|
6
|
+
output: {
|
|
7
|
+
filename: 'index-ui.js',
|
|
8
|
+
path: path.resolve(__dirname, 'dist'),
|
|
9
|
+
library: {
|
|
10
|
+
name: 'QuickBloxUIKit',
|
|
11
|
+
type: 'umd',
|
|
12
|
+
},
|
|
13
|
+
globalObject: 'this',
|
|
14
|
+
clean: true,
|
|
15
|
+
assetModuleFilename: '[name][ext]', // Сохраняем оригинальные имена файлов
|
|
27
16
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
amd: 'react-dom',
|
|
32
|
-
root: 'ReactDOM',
|
|
17
|
+
resolve: {
|
|
18
|
+
extensions: ['.tsx', '.ts', '.js'],
|
|
19
|
+
modules: [path.resolve(__dirname, 'src'), 'node_modules'],
|
|
33
20
|
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
21
|
+
externals: {
|
|
22
|
+
react: {
|
|
23
|
+
commonjs: 'react',
|
|
24
|
+
commonjs2: 'react',
|
|
25
|
+
amd: 'react',
|
|
26
|
+
root: 'React',
|
|
27
|
+
},
|
|
28
|
+
'react-dom': {
|
|
29
|
+
commonjs: 'react-dom',
|
|
30
|
+
commonjs2: 'react-dom',
|
|
31
|
+
amd: 'react-dom',
|
|
32
|
+
root: 'ReactDOM',
|
|
45
33
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
34
|
+
'react/jsx-runtime': 'react/jsx-runtime',
|
|
35
|
+
},
|
|
36
|
+
module: {
|
|
37
|
+
rules: [
|
|
38
|
+
{
|
|
39
|
+
test: /\.(ts|tsx)$/,
|
|
40
|
+
use: {
|
|
41
|
+
loader: 'ts-loader',
|
|
42
|
+
options: {
|
|
43
|
+
configFile: path.resolve(__dirname, 'tsconfig.buildlib.json'),
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
exclude: [/node_modules/, /stories/],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
test: /\.css$/i,
|
|
50
|
+
use: ['style-loader', 'css-loader'],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
test: /\.s[ac]ss$/i,
|
|
54
|
+
use: ['style-loader', 'css-loader', 'sass-loader'],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
test: /\.svg$/i, // 🔥 Все SVG → импортируются **ТОЛЬКО** как React-компоненты
|
|
58
|
+
use: [
|
|
59
|
+
{
|
|
60
|
+
loader: '@svgr/webpack',
|
|
61
|
+
options: {
|
|
62
|
+
icon: true,
|
|
63
|
+
esModule: true,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
test: /\.(png|jpg|jpeg|gif)$/i, // Поддержка изображений, без хеширования
|
|
70
|
+
type: 'asset/resource',
|
|
64
71
|
},
|
|
65
|
-
},
|
|
66
72
|
],
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
performance: {
|
|
82
|
-
hints: false, // 🔥 Отключаем предупреждения о производительности
|
|
83
|
-
},
|
|
84
|
-
experiments: {
|
|
85
|
-
outputModule: false, // Отключаем ES-модули (так как UMD не поддерживает их)
|
|
86
|
-
},
|
|
73
|
+
},
|
|
74
|
+
optimization: {
|
|
75
|
+
minimize: false, // 🔥 Отключаем минимизацию JS и CSS
|
|
76
|
+
splitChunks: false, // 🔥 Отключаем разделение чанков
|
|
77
|
+
removeAvailableModules: false, // Оставляем модули без изменений
|
|
78
|
+
removeEmptyChunks: false, // Не удаляем пустые чанки
|
|
79
|
+
mergeDuplicateChunks: false, // Не объединяем дубликаты
|
|
80
|
+
},
|
|
81
|
+
performance: {
|
|
82
|
+
hints: false, // 🔥 Отключаем предупреждения о производительности
|
|
83
|
+
},
|
|
84
|
+
experiments: {
|
|
85
|
+
outputModule: false, // Отключаем ES-модули (так как UMD не поддерживает их)
|
|
86
|
+
},
|
|
87
87
|
};
|
package/dist/stories/Button.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import './button.css';
|
|
2
|
-
export interface ButtonProps {
|
|
3
|
-
/** Is this the principal call to action on the page? */
|
|
4
|
-
primary?: boolean;
|
|
5
|
-
/** What background color to use */
|
|
6
|
-
backgroundColor?: string;
|
|
7
|
-
/** How large should the button be? */
|
|
8
|
-
size?: 'small' | 'medium' | 'large';
|
|
9
|
-
/** Button contents */
|
|
10
|
-
label: string;
|
|
11
|
-
/** Optional click handler */
|
|
12
|
-
onClick?: () => void;
|
|
13
|
-
}
|
|
14
|
-
/** Primary UI component for user interaction */
|
|
15
|
-
export declare const Button: ({ primary, size, backgroundColor, label, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/stories/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,WAAW;IAC1B,wDAAwD;IACxD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mCAAmC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sCAAsC;IACtC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,gDAAgD;AAChD,eAAO,MAAM,MAAM,wDAMhB,WAAW,4CAYb,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react';
|
|
2
|
-
declare const meta: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: ({ primary, size, backgroundColor, label, ...props }: import("./Button").ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
parameters: {
|
|
6
|
-
layout: string;
|
|
7
|
-
};
|
|
8
|
-
tags: string[];
|
|
9
|
-
argTypes: {
|
|
10
|
-
backgroundColor: {
|
|
11
|
-
control: "color";
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
args: {
|
|
15
|
-
onClick: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export default meta;
|
|
19
|
-
type Story = StoryObj<typeof meta>;
|
|
20
|
-
export declare const Primary: Story;
|
|
21
|
-
export declare const Secondary: Story;
|
|
22
|
-
export declare const Large: Story;
|
|
23
|
-
export declare const Small: Story;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../src/stories/Button.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAMvD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;CAeqB,CAAC;AAEhC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAIvB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAC"}
|
package/dist/stories/Header.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import './header.css';
|
|
2
|
-
type User = {
|
|
3
|
-
name: string;
|
|
4
|
-
};
|
|
5
|
-
export interface HeaderProps {
|
|
6
|
-
user?: User;
|
|
7
|
-
onLogin?: () => void;
|
|
8
|
-
onLogout?: () => void;
|
|
9
|
-
onCreateAccount?: () => void;
|
|
10
|
-
}
|
|
11
|
-
export declare const Header: ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/stories/Header.tsx"],"names":[],"mappings":"AAGA,OAAO,cAAc,CAAC;AAEtB,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,eAAO,MAAM,MAAM,iDAAkD,WAAW,4CAuC/E,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react';
|
|
2
|
-
declare const meta: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: ({ user, onLogin, onLogout, onCreateAccount }: import("./Header").HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
tags: string[];
|
|
6
|
-
parameters: {
|
|
7
|
-
layout: string;
|
|
8
|
-
};
|
|
9
|
-
args: {
|
|
10
|
-
onLogin: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
11
|
-
onLogout: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
12
|
-
onCreateAccount: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export default meta;
|
|
16
|
-
type Story = StoryObj<typeof meta>;
|
|
17
|
-
export declare const LoggedIn: Story;
|
|
18
|
-
export declare const LoggedOut: Story;
|