@mirai/core 0.4.243 → 0.4.245
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/build/Core.js +0 -8
- package/build/Core.js.map +1 -1
- package/build/components/Chat/Chat.constants.js +6 -3
- package/build/components/Chat/Chat.constants.js.map +1 -1
- package/build/components/Chat/Chat.js +48 -34
- package/build/components/Chat/Chat.js.map +1 -1
- package/build/components/Chat/Chat.l10n.js +2 -20
- package/build/components/Chat/Chat.l10n.js.map +1 -1
- package/build/components/Chat/Chat.module.css +14 -189
- package/build/components/Chat/components/Avatar/Avatar.module.css +3 -2
- package/build/components/Chat/{Chat.ButtonAvatar.js → components/ButtonDispatcher/ButtonDispatcher.js} +21 -18
- package/build/components/Chat/components/ButtonDispatcher/ButtonDispatcher.js.map +1 -0
- package/build/components/Chat/components/ButtonDispatcher/ButtonDispatcher.l10n.js +15 -0
- package/build/components/Chat/components/ButtonDispatcher/ButtonDispatcher.l10n.js.map +1 -0
- package/build/components/Chat/components/ButtonDispatcher/ButtonDispatcher.module.css +134 -0
- package/build/components/Chat/components/ButtonDispatcher/index.js +17 -0
- package/build/components/Chat/components/ButtonDispatcher/index.js.map +1 -0
- package/build/components/Chat/components/Header/Header.js +72 -0
- package/build/components/Chat/components/Header/Header.js.map +1 -0
- package/build/components/Chat/components/Header/Header.l10n.js +15 -0
- package/build/components/Chat/components/Header/Header.l10n.js.map +1 -0
- package/build/components/Chat/components/Header/Header.module.css +15 -0
- package/build/components/Chat/components/{InputRich → Header}/index.js +4 -4
- package/build/components/Chat/components/Header/index.js.map +1 -0
- package/build/components/Chat/components/Input/Input.Context.js +75 -0
- package/build/components/Chat/components/Input/Input.Context.js.map +1 -0
- package/build/components/Chat/components/Input/Input.js +42 -17
- package/build/components/Chat/components/Input/Input.js.map +1 -1
- package/build/components/Chat/components/Input/Input.module.css +46 -9
- package/build/components/Chat/components/Message/Message.Action.js +8 -65
- package/build/components/Chat/components/Message/Message.Action.js.map +1 -1
- package/build/components/Chat/components/Message/Message.Requirement.js +141 -0
- package/build/components/Chat/components/Message/Message.Requirement.js.map +1 -0
- package/build/components/Chat/components/Message/Message.constants.js +18 -2
- package/build/components/Chat/components/Message/Message.constants.js.map +1 -1
- package/build/components/Chat/components/Message/Message.js +35 -30
- package/build/components/Chat/components/Message/Message.js.map +1 -1
- package/build/components/Chat/components/{InputRich/InputRich.l10n.js → Message/Message.l10n.js} +4 -1
- package/build/components/Chat/components/Message/Message.l10n.js.map +1 -0
- package/build/components/Chat/components/Message/Message.module.css +66 -49
- package/build/components/Chat/components/Message/components/Card.js +8 -6
- package/build/components/Chat/components/Message/components/Card.js.map +1 -1
- package/build/components/Chat/components/Message/components/Card.module.css +25 -15
- package/build/components/Chat/components/Message/components/Environment.js +2 -3
- package/build/components/Chat/components/Message/components/Environment.js.map +1 -1
- package/build/components/Chat/components/Message/components/Environment.module.css +11 -5
- package/build/components/Chat/components/{InputRich/InputRich.List.js → Message/components/List/List.js} +2 -2
- package/build/components/Chat/components/Message/components/List/List.js.map +1 -0
- package/build/components/Chat/components/Message/components/List/List.module.css +44 -0
- package/build/components/Chat/components/Message/components/List/helpers/getVerboseList.js.map +1 -0
- package/build/components/Chat/components/{InputRich → Message/components/List}/helpers/index.js +0 -11
- package/build/components/Chat/components/Message/components/List/helpers/index.js.map +1 -0
- package/build/components/Chat/components/Message/components/List/index.js +17 -0
- package/build/components/Chat/components/Message/components/List/index.js.map +1 -0
- package/build/components/Chat/components/Message/components/Typewriter/Typewriter.js +74 -0
- package/build/components/Chat/components/Message/components/Typewriter/Typewriter.js.map +1 -0
- package/build/components/Chat/components/Message/components/Typewriter/Typewriter.module.css +17 -0
- package/build/components/Chat/components/Message/components/Typewriter/index.js +17 -0
- package/build/components/Chat/components/Message/components/Typewriter/index.js.map +1 -0
- package/build/components/Chat/components/Message/components/index.js +22 -0
- package/build/components/Chat/components/Message/components/index.js.map +1 -1
- package/build/components/Chat/components/Message/intents/BookingQuery.js +1 -3
- package/build/components/Chat/components/Message/intents/BookingQuery.js.map +1 -1
- package/build/components/Chat/components/Message/intents/HotelInfo.js +3 -4
- package/build/components/Chat/components/Message/intents/HotelInfo.js.map +1 -1
- package/build/components/Chat/components/Message/intents/Login/Login.js +123 -0
- package/build/components/Chat/components/Message/intents/Login/Login.js.map +1 -0
- package/build/components/Chat/components/Message/intents/Login/Login.l10n.js +24 -0
- package/build/components/Chat/components/Message/intents/Login/Login.l10n.js.map +1 -0
- package/build/components/Chat/components/Message/intents/Login/Login.module.css +12 -0
- package/build/components/Chat/components/Message/intents/Login/index.js +17 -0
- package/build/components/Chat/components/Message/intents/Login/index.js.map +1 -0
- package/build/components/Chat/components/Message/intents/index.js +11 -0
- package/build/components/Chat/components/Message/intents/index.js.map +1 -1
- package/build/components/Chat/components/Welcome/Welcome.constants.js +17 -0
- package/build/components/Chat/components/Welcome/Welcome.constants.js.map +1 -0
- package/build/components/Chat/components/Welcome/Welcome.js +128 -0
- package/build/components/Chat/components/Welcome/Welcome.js.map +1 -0
- package/build/components/Chat/components/Welcome/Welcome.l10n.js +15 -0
- package/build/components/Chat/components/Welcome/Welcome.l10n.js.map +1 -0
- package/build/components/Chat/components/Welcome/Welcome.module.css +127 -0
- package/build/components/Chat/components/Welcome/index.js +17 -0
- package/build/components/Chat/components/Welcome/index.js.map +1 -0
- package/build/components/Chat/components/index.js +30 -8
- package/build/components/Chat/components/index.js.map +1 -1
- package/build/components/Checkout/helpers/getFieldProps.js +3 -2
- package/build/components/Checkout/helpers/getFieldProps.js.map +1 -1
- package/build/components/Checkout/partials/Checkout.Form.js +3 -0
- package/build/components/Checkout/partials/Checkout.Form.js.map +1 -1
- package/build/components/Signup/Signup.js +9 -3
- package/build/components/Signup/Signup.js.map +1 -1
- package/build/components/__shared__/Footer/Footer.js +3 -1
- package/build/components/__shared__/Footer/Footer.js.map +1 -1
- package/build/components/helpers/ICON.js +6 -2
- package/build/components/helpers/ICON.js.map +1 -1
- package/build/helpers/getClub.js +1 -6
- package/build/helpers/getClub.js.map +1 -1
- package/build/helpers/index.js +0 -11
- package/build/helpers/index.js.map +1 -1
- package/build/theme.css +13 -28
- package/package.json +1 -1
- package/build/components/Chat/Chat.ButtonAvatar.js.map +0 -1
- package/build/components/Chat/Chat.Header.js +0 -144
- package/build/components/Chat/Chat.Header.js.map +0 -1
- package/build/components/Chat/components/InputRich/InputRich.List.js.map +0 -1
- package/build/components/Chat/components/InputRich/InputRich.js +0 -179
- package/build/components/Chat/components/InputRich/InputRich.js.map +0 -1
- package/build/components/Chat/components/InputRich/InputRich.l10n.js.map +0 -1
- package/build/components/Chat/components/InputRich/InputRich.module.css +0 -109
- package/build/components/Chat/components/InputRich/helpers/getVerboseList.js.map +0 -1
- package/build/components/Chat/components/InputRich/helpers/getVerboseOccupation.js +0 -27
- package/build/components/Chat/components/InputRich/helpers/getVerboseOccupation.js.map +0 -1
- package/build/components/Chat/components/InputRich/helpers/index.js.map +0 -1
- package/build/components/Chat/components/InputRich/index.js.map +0 -1
- package/build/components/Chat/components/Message/components/Typewriter.js +0 -47
- package/build/components/Chat/components/Message/components/Typewriter.js.map +0 -1
- package/build/helpers/getClubUrl.js +0 -26
- package/build/helpers/getClubUrl.js.map +0 -1
- /package/build/components/Chat/components/{InputRich → Message/components/List}/helpers/getVerboseList.js +0 -0
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
backdrop-filter: blur(8px);
|
|
3
|
-
background-color: var(--mirai-chat-base-opacity);
|
|
4
|
-
bottom: 0;
|
|
5
|
-
height: 100%;
|
|
6
|
-
justify-content: flex-end;
|
|
7
|
-
left: 0;
|
|
8
|
-
pointer-events: none;
|
|
9
|
-
position: absolute;
|
|
10
|
-
opacity: 0;
|
|
11
|
-
transition: opacity var(--mirai-ui-motion-expand) var(--mirai-ui-motion-easing);
|
|
12
|
-
transition-delay: var(--mirai-ui-motion-expand);
|
|
13
|
-
width: 100%;
|
|
14
|
-
z-index: 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.container.visible {
|
|
18
|
-
opacity: 1;
|
|
19
|
-
pointer-events: all;
|
|
20
|
-
transition-delay: var(--mirai-ui-motion-expand);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.content {
|
|
24
|
-
transform: translateY(100%);
|
|
25
|
-
transition: transform var(--mirai-ui-motion-expand) var(--mirai-ui-motion-easing);
|
|
26
|
-
transition-delay: 0;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.content.visible {
|
|
30
|
-
transform: translateY(0%);
|
|
31
|
-
transition-delay: var(--mirai-ui-motion-expand);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.content .header {
|
|
35
|
-
gap: calc(var(--mirai-chat-space) / 2);
|
|
36
|
-
padding: var(--mirai-chat-space);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.content .component {
|
|
40
|
-
margin: 0 var(--mirai-chat-space);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.content .component:not(.inputText) {
|
|
44
|
-
border: solid var(--mirai-ui-border-width) var(--mirai-ui-content-border);
|
|
45
|
-
border-radius: var(--mirai-chat-border-radius);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.content .component.inputText > * {
|
|
49
|
-
margin-bottom: 0;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.content .component > * {
|
|
53
|
-
width: 100%;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.content .footer {
|
|
57
|
-
gap: var(--mirai-chat-space);
|
|
58
|
-
padding: var(--mirai-chat-space);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.content .footer > * {
|
|
62
|
-
flex: 1;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/* -- InputRich.List.jsx */
|
|
66
|
-
.list {
|
|
67
|
-
flex: 1;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.list .item {
|
|
71
|
-
display: flex;
|
|
72
|
-
flex-direction: row;
|
|
73
|
-
gap: calc(var(--mirai-chat-space) / 2);
|
|
74
|
-
padding: var(--mirai-chat-message-offset);
|
|
75
|
-
width: 100%;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.list .item.category {
|
|
79
|
-
cursor: default;
|
|
80
|
-
padding-bottom: 0;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.list .item.category:not(:first-child) {
|
|
84
|
-
border-top: solid var(--mirai-ui-border-width) var(--mirai-ui-content-border);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.list .item.option.selected,
|
|
88
|
-
.list .item.option:hover {
|
|
89
|
-
background-color: var(--mirai-chat-text-color);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.list .item.option.selected *,
|
|
93
|
-
.list .item.option:hover * {
|
|
94
|
-
color: var(--mirai-chat-text-accent-color);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/* S */
|
|
98
|
-
@media only screen and (max-width: 480px) {
|
|
99
|
-
.list {
|
|
100
|
-
max-height: calc(100svh - calc(var(--mirai-ui-space-XL) * 3.2));
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/* M & L */
|
|
105
|
-
@media only screen and (min-width: 481px) {
|
|
106
|
-
.list {
|
|
107
|
-
max-height: calc(70svh - calc(var(--mirai-ui-space-XL) * 3.2));
|
|
108
|
-
}
|
|
109
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getVerboseList.js","names":["getVerboseList","id","options","arguments","length","undefined","text","find","item","exports"],"sources":["../../../../../../src/components/Chat/components/InputRich/helpers/getVerboseList.js"],"sourcesContent":["export const getVerboseList = (id, { options = [] } = {}) => {\n const { text } = options.find((item = {}) => item.id === id) || {};\n\n return text || id;\n};\n"],"mappings":";;;;;;AAAO,MAAMA,cAAc,GAAG,SAAAA,CAACC,EAAE,EAA4B;EAAA,IAA1B;IAAEC,OAAO,GAAG;EAAG,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACtD,MAAM;IAAEG;EAAK,CAAC,GAAGJ,OAAO,CAACK,IAAI,CAAC;IAAA,IAACC,IAAI,GAAAL,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IAAA,OAAKK,IAAI,CAACP,EAAE,KAAKA,EAAE;EAAA,EAAC,IAAI,CAAC,CAAC;EAElE,OAAOK,IAAI,IAAIL,EAAE;AACnB,CAAC;AAACQ,OAAA,CAAAT,cAAA,GAAAA,cAAA"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getVerboseOccupation = void 0;
|
|
7
|
-
var _locale = require("@mirai/locale");
|
|
8
|
-
var _helpers = require("../../../../helpers");
|
|
9
|
-
const getVerboseOccupation = function () {
|
|
10
|
-
let {
|
|
11
|
-
store: {
|
|
12
|
-
config: {
|
|
13
|
-
hotels: dataSource,
|
|
14
|
-
lodgingDenomination: individual
|
|
15
|
-
} = {}
|
|
16
|
-
} = {},
|
|
17
|
-
translate = _locale.translate,
|
|
18
|
-
value
|
|
19
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
20
|
-
return (0, _helpers.getOccupationSummary)(value, translate, (0, _helpers.getAccommodationType)({
|
|
21
|
-
dataSource,
|
|
22
|
-
hotels: [],
|
|
23
|
-
individual
|
|
24
|
-
})).trim();
|
|
25
|
-
};
|
|
26
|
-
exports.getVerboseOccupation = getVerboseOccupation;
|
|
27
|
-
//# sourceMappingURL=getVerboseOccupation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getVerboseOccupation.js","names":["_locale","require","_helpers","getVerboseOccupation","store","config","hotels","dataSource","lodgingDenomination","individual","translate","translateBase","value","arguments","length","undefined","getOccupationSummary","getAccommodationType","trim","exports"],"sources":["../../../../../../src/components/Chat/components/InputRich/helpers/getVerboseOccupation.js"],"sourcesContent":["import { translate as translateBase } from '@mirai/locale';\n\nimport { getAccommodationType, getOccupationSummary } from '../../../../helpers';\n\nexport const getVerboseOccupation = ({\n store: { config: { hotels: dataSource, lodgingDenomination: individual } = {} } = {},\n translate = translateBase,\n value,\n} = {}) => getOccupationSummary(value, translate, getAccommodationType({ dataSource, hotels: [], individual })).trim();\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAEO,MAAME,oBAAoB,GAAG,SAAAA,CAAA;EAAA,IAAC;IACnCC,KAAK,EAAE;MAAEC,MAAM,EAAE;QAAEC,MAAM,EAAEC,UAAU;QAAEC,mBAAmB,EAAEC;MAAW,CAAC,GAAG,CAAC;IAAE,CAAC,GAAG,CAAC,CAAC;IACpFC,SAAS,GAAGC,iBAAa;IACzBC;EACF,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAAA,OAAK,IAAAG,6BAAoB,EAACJ,KAAK,EAAEF,SAAS,EAAE,IAAAO,6BAAoB,EAAC;IAAEV,UAAU;IAAED,MAAM,EAAE,EAAE;IAAEG;EAAW,CAAC,CAAC,CAAC,CAACS,IAAI,CAAC,CAAC;AAAA;AAACC,OAAA,CAAAhB,oBAAA,GAAAA,oBAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_getVerboseOccupation","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_getVerboseList"],"sources":["../../../../../../src/components/Chat/components/InputRich/helpers/index.js"],"sourcesContent":["export * from './getVerboseOccupation';\nexport * from './getVerboseList';\n"],"mappings":";;;;;AAAA,IAAAA,qBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,qBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,qBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,qBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,eAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,eAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,eAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,eAAA,CAAAL,GAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_InputRich","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../../../src/components/Chat/components/InputRich/index.js"],"sourcesContent":["export * from './InputRich';\n"],"mappings":";;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,UAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,UAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,UAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Typewriter = void 0;
|
|
7
|
-
var _ui = require("@mirai/ui");
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
const TOTAL_DURATION = 1000;
|
|
14
|
-
const MIN_SPEED = 60;
|
|
15
|
-
const Typewriter = _ref => {
|
|
16
|
-
let {
|
|
17
|
-
children = '',
|
|
18
|
-
onTyped,
|
|
19
|
-
...others
|
|
20
|
-
} = _ref;
|
|
21
|
-
const [displayedText, setDisplayedText] = (0, _react.useState)('');
|
|
22
|
-
const [index, setIndex] = (0, _react.useState)(0);
|
|
23
|
-
const words = children.split(' ');
|
|
24
|
-
const speed = Math.min(TOTAL_DURATION / words.length, MIN_SPEED);
|
|
25
|
-
(0, _react.useEffect)(() => {
|
|
26
|
-
if (index < words.length) {
|
|
27
|
-
const timeout = setTimeout(() => {
|
|
28
|
-
setDisplayedText(previous => previous ? previous + ' ' + words[index] : words[index]);
|
|
29
|
-
setIndex(index + 1);
|
|
30
|
-
onTyped && onTyped();
|
|
31
|
-
}, speed);
|
|
32
|
-
return () => clearTimeout(timeout);
|
|
33
|
-
} else if (onTyped) {
|
|
34
|
-
onTyped();
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
38
|
-
}, [index, words]);
|
|
39
|
-
return /*#__PURE__*/_react.default.createElement(_ui.Text, others, displayedText);
|
|
40
|
-
};
|
|
41
|
-
exports.Typewriter = Typewriter;
|
|
42
|
-
Typewriter.displayName = 'Typewriter';
|
|
43
|
-
Typewriter.propTypes = {
|
|
44
|
-
children: _propTypes.default.string,
|
|
45
|
-
onTyped: _propTypes.default.func
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=Typewriter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Typewriter.js","names":["_ui","require","_propTypes","_interopRequireDefault","_react","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","TOTAL_DURATION","MIN_SPEED","Typewriter","_ref","children","onTyped","others","displayedText","setDisplayedText","useState","index","setIndex","words","split","speed","Math","min","length","useEffect","timeout","setTimeout","previous","clearTimeout","createElement","Text","exports","displayName","propTypes","PropTypes","string","func"],"sources":["../../../../../../src/components/Chat/components/Message/components/Typewriter.jsx"],"sourcesContent":["import { Text } from '@mirai/ui';\nimport PropTypes from 'prop-types';\nimport React, { useEffect, useState } from 'react';\n\nconst TOTAL_DURATION = 1000;\nconst MIN_SPEED = 60;\n\nconst Typewriter = ({ children = '', onTyped, ...others }) => {\n const [displayedText, setDisplayedText] = useState('');\n const [index, setIndex] = useState(0);\n\n const words = children.split(' ');\n const speed = Math.min(TOTAL_DURATION / words.length, MIN_SPEED);\n\n useEffect(() => {\n if (index < words.length) {\n const timeout = setTimeout(() => {\n setDisplayedText((previous) => (previous ? previous + ' ' + words[index] : words[index]));\n setIndex(index + 1);\n onTyped && onTyped();\n }, speed);\n\n return () => clearTimeout(timeout);\n } else if (onTyped) {\n onTyped();\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [index, words]);\n\n return <Text {...others}>{displayedText}</Text>;\n};\n\nTypewriter.displayName = 'Typewriter';\n\nTypewriter.propTypes = {\n children: PropTypes.string,\n onTyped: PropTypes.func,\n};\n\nexport { Typewriter };\n"],"mappings":"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"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getClubUrl = void 0;
|
|
7
|
-
var _locale = require("@mirai/locale");
|
|
8
|
-
const [DEFAULT_LANGUAGE] = _locale.DEFAULT_LOCALE.split('-');
|
|
9
|
-
const getClubUrl = _ref => {
|
|
10
|
-
let {
|
|
11
|
-
language,
|
|
12
|
-
url = {}
|
|
13
|
-
} = _ref;
|
|
14
|
-
const {
|
|
15
|
-
conditions,
|
|
16
|
-
privacy
|
|
17
|
-
} = url;
|
|
18
|
-
return {
|
|
19
|
-
url: {
|
|
20
|
-
conditions: conditions[language] || conditions[DEFAULT_LANGUAGE],
|
|
21
|
-
privacy: privacy[language] || privacy[DEFAULT_LANGUAGE]
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
exports.getClubUrl = getClubUrl;
|
|
26
|
-
//# sourceMappingURL=getClubUrl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getClubUrl.js","names":["_locale","require","DEFAULT_LANGUAGE","DEFAULT_LOCALE","split","getClubUrl","_ref","language","url","conditions","privacy","exports"],"sources":["../../src/helpers/getClubUrl.js"],"sourcesContent":["import { DEFAULT_LOCALE } from '@mirai/locale';\n\nconst [DEFAULT_LANGUAGE] = DEFAULT_LOCALE.split('-');\n\nexport const getClubUrl = ({ language, url = {} }) => {\n const { conditions, privacy } = url;\n\n return {\n url: {\n conditions: conditions[language] || conditions[DEFAULT_LANGUAGE],\n privacy: privacy[language] || privacy[DEFAULT_LANGUAGE],\n },\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,MAAM,CAACC,gBAAgB,CAAC,GAAGC,sBAAc,CAACC,KAAK,CAAC,GAAG,CAAC;AAE7C,MAAMC,UAAU,GAAGC,IAAA,IAA4B;EAAA,IAA3B;IAAEC,QAAQ;IAAEC,GAAG,GAAG,CAAC;EAAE,CAAC,GAAAF,IAAA;EAC/C,MAAM;IAAEG,UAAU;IAAEC;EAAQ,CAAC,GAAGF,GAAG;EAEnC,OAAO;IACLA,GAAG,EAAE;MACHC,UAAU,EAAEA,UAAU,CAACF,QAAQ,CAAC,IAAIE,UAAU,CAACP,gBAAgB,CAAC;MAChEQ,OAAO,EAAEA,OAAO,CAACH,QAAQ,CAAC,IAAIG,OAAO,CAACR,gBAAgB;IACxD;EACF,CAAC;AACH,CAAC;AAACS,OAAA,CAAAN,UAAA,GAAAA,UAAA"}
|
|
File without changes
|