@yourgoods/ui-smart 0.50.1 → 0.51.0

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.
Files changed (21) hide show
  1. package/dist/{ProfileEmailDialog-_xFNmM53.js → ProfileEmailDialog-CLM-pIRG.js} +306 -306
  2. package/dist/{ProfilePasswordDialog-BRL-NxyC.js → ProfilePasswordDialog-BY5VAdH3.js} +1 -1
  3. package/dist/{ProfilePhoneDialog-DJzWkfsA.js → ProfilePhoneDialog-BdAKmUji.js} +198 -185
  4. package/dist/components/PEditUserContact/PEditUserContact.vue.d.ts +2 -0
  5. package/dist/components/PEditUserContact/ProfileDialogs/DialogManager.vue.d.ts +2 -0
  6. package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/AddNewEmailContent.vue.d.ts +3 -1
  7. package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/AddNewPhoneContent.vue.d.ts +4 -1
  8. package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/NewEmailContent.vue.d.ts +4 -2
  9. package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/NewPhoneContent.vue.d.ts +3 -1
  10. package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/OldEmailContent.vue.d.ts +3 -1
  11. package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/OldPhoneContent.vue.d.ts +3 -1
  12. package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/ThrottlerTimer.vue.d.ts +31 -43
  13. package/dist/components/PEditUserContact/ProfileDialogs/ProfilePhoneDialog.vue.d.ts +1 -0
  14. package/dist/components/PEditUserContact/index.vue.d.ts +2 -0
  15. package/dist/{index-Dt-xD4lU.js → index-5nM1qYsp.js} +196 -190
  16. package/dist/index.js +2 -2
  17. package/dist/types.d.ts +10 -0
  18. package/dist/useRateLimitToast-BS-y9G79.js +151 -0
  19. package/dist/utils/url.d.ts +2 -0
  20. package/package.json +1 -1
  21. package/dist/useRateLimitToast-DID9XsBg.js +0 -134
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".avatar-input[data-v-99f62cbb] .p-input-file .overlay{visibility:hidden}.avatar-input[data-v-99f62cbb] .p-input-file:hover .overlay{visibility:visible}.icon-locked{pointer-events:auto;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.input-wrapper{position:relative;width:100%}.dialogTitle{z-index:10;width:100%;font-size:16px;font-weight:600;line-height:24px;text-align:center;color:#2b3238}.dialogDefaultContainer{display:flex;align-items:flex-start;flex-direction:column;width:100%;gap:32px;margin-top:16px;padding:10px 16px}.dialogDefaultContainerTextHint{font-weight:400;font-size:14px;line-height:20px;text-align:center;color:#1b1b1b}.dialogDefaultContainerRateLimitText{font-weight:600;font-size:14px;line-height:20px;color:#d0dbe4}.dialogDefaultContainerInsideContent{width:100%;display:flex;flex-direction:column;gap:24px}.dialogDefaultContainerRateLimitTextActive{color:#1c7ef1;cursor:pointer}.dialogDefaultContainerSendCodeBySmsText{color:#1c7ef1;cursor:pointer;font-size:14px;font-weight:600;display:flex;align-items:center;text-align:center}.chip{display:flex;align-items:center;justify-content:center;flex-direction:row;gap:4px;height:24px;font-size:12px;font-weight:600;color:#1b1b1b;padding:4px;line-height:16px;background-color:#b6d7ff4d;border-radius:4px;text-align:center;margin-left:5px}.cross{cursor:pointer;text-align:end}.finalLimitWrapper{display:flex;flex-direction:column;align-items:center;padding:12px 0;gap:12px;width:440px;min-height:94px;background:#e4606026;border-radius:8px}.finalLimitText{text-align:center;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#5d7285}.finalLimitLink{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:20px;color:#1c7ef1;text-align:center;cursor:pointer;text-decoration:none}.finalLimitLink:hover{text-decoration:underline}.toastWrapper{position:fixed;bottom:1rem;right:1rem;z-index:9999}.toast{width:100%}.base-container{margin-top:1.5rem;display:flex;flex-direction:column;gap:1.25rem;width:490px;height:428px}.icon-disabled{pointer-events:none;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.centered-overlay{position:absolute;left:50%;top:50%;z-index:1000;height:100%;width:100%;transform:translate(-50%,-50%)}.buttons-container{display:flex;flex-wrap:wrap;gap:12px;justify-content:flex-start}.buttons-container PButton{flex:1 1 100%}._loaderOverlay_cpu73_1[data-v-9e697525]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:#ffffffb3;border-radius:16px;z-index:99}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- import { a as o } from "./index-Dt-xD4lU.js";
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".avatar-input[data-v-05cc0841] .p-input-file .overlay{visibility:hidden}.avatar-input[data-v-05cc0841] .p-input-file:hover .overlay{visibility:visible}.icon-locked{pointer-events:auto;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.input-wrapper{position:relative;width:100%}.dialogTitle{z-index:10;width:100%;font-size:16px;font-weight:600;line-height:24px;text-align:center;color:#2b3238}.dialogDefaultContainer{display:flex;align-items:flex-start;flex-direction:column;width:100%;gap:32px;margin-top:16px;padding:10px 16px}.dialogDefaultContainerTextHint{font-weight:400;font-size:14px;line-height:20px;text-align:center;color:#1b1b1b}.dialogDefaultContainerRateLimitText{font-weight:600;font-size:14px;line-height:20px;color:#d0dbe4}.dialogDefaultContainerInsideContent{width:100%;display:flex;flex-direction:column;gap:24px}.dialogDefaultContainerRateLimitTextActive{color:#1c7ef1;cursor:pointer}.dialogDefaultContainerSendCodeBySmsText{color:#1c7ef1;cursor:pointer;font-size:14px;font-weight:600;display:flex;align-items:center;text-align:center}.chip{display:flex;align-items:center;justify-content:center;flex-direction:row;gap:4px;height:24px;font-size:12px;font-weight:600;color:#1b1b1b;padding:4px;line-height:16px;background-color:#b6d7ff4d;border-radius:4px;text-align:center;margin-left:5px}.cross{cursor:pointer;text-align:end}.finalLimitWrapper{display:flex;flex-direction:column;align-items:center;padding:12px 0;gap:12px;width:440px;min-height:94px;background:#e4606026;border-radius:8px}.finalLimitText{text-align:center;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#5d7285}.finalLimitLink{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:20px;color:#1c7ef1;text-align:center;cursor:pointer;text-decoration:none}.finalLimitLink:hover{text-decoration:underline}.toastWrapper{position:fixed;bottom:1rem;right:1rem;z-index:9999}.toast{width:100%}.base-container{margin-top:1.5rem;display:flex;flex-direction:column;gap:1.25rem;width:490px;height:428px}.icon-disabled{pointer-events:none;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.centered-overlay{position:absolute;left:50%;top:50%;z-index:1000;height:100%;width:100%;transform:translate(-50%,-50%)}.buttons-container{display:flex;flex-wrap:wrap;gap:12px;justify-content:flex-start}.buttons-container PButton{flex:1 1 100%}._loaderOverlay_cpu73_1[data-v-9e697525]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:#ffffffb3;border-radius:16px;z-index:99}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
+ import { a as o } from "./index-5nM1qYsp.js";
3
3
  export {
4
4
  o as PEditUserContact
5
5
  };
@@ -0,0 +1,10 @@
1
+ export type ValuesType<T> = T[keyof T];
2
+ export declare const Provider: {
3
+ readonly Crm: "crm";
4
+ readonly Widget: "widget";
5
+ readonly Sendbot: "sendbot";
6
+ readonly Logic: "logic";
7
+ readonly Planner: "planner";
8
+ readonly Dengi: "dengi";
9
+ };
10
+ export type Provider = ValuesType<typeof Provider>;
@@ -0,0 +1,151 @@
1
+ import { ref as r, defineComponent as _, createElementBlock as f, openBlock as v, normalizeClass as c, createVNode as T, unref as h, computed as L, renderSlot as m, createCommentVNode as b, createElementVNode as n, toDisplayString as g, createTextVNode as p } from "vue";
2
+ import { PLoader as k } from "@profeat/ui-kit";
3
+ import { _ as $, g as C, p as R } from "./index-5nM1qYsp.js";
4
+ function y(e) {
5
+ const a = Math.floor(e / 60), s = e % 60;
6
+ return `${String(a).padStart(2, "0")}:${String(s).padStart(2, "0")}`;
7
+ }
8
+ function G() {
9
+ let e = null;
10
+ const a = r(0), s = r(!1), t = r("00:00"), o = r(0), i = r(0), l = r(!1);
11
+ return {
12
+ startTimer: (u, d) => {
13
+ e && clearInterval(e), l.value = !1, a.value = u, s.value = u > 0, t.value = y(u);
14
+ const w = Date.now() + u * 1e3;
15
+ e = setInterval(() => {
16
+ a.value > 1 ? (a.value = Math.max(0, Math.round((w - Date.now()) / 1e3)), t.value = y(a.value)) : (clearInterval(e), a.value = 0, s.value = !1, l.value = !0, d && typeof d == "function" && d());
17
+ }, 1e3);
18
+ },
19
+ isShowRateTimers: s,
20
+ remainingSeconds: t,
21
+ totalRateAttempts: o,
22
+ currentRateAttempt: i,
23
+ isAvailableForSendAgain: l
24
+ };
25
+ }
26
+ const S = /* @__PURE__ */ _({
27
+ __name: "ProfileOverlayLoading",
28
+ setup(e) {
29
+ return (a, s) => (v(), f("div", {
30
+ class: c(a.$style.loaderOverlay)
31
+ }, [
32
+ T(h(k), {
33
+ class: "relative m-auto",
34
+ size: "normal"
35
+ })
36
+ ], 2));
37
+ }
38
+ }), F = "_loaderOverlay_cpu73_1", M = {
39
+ loaderOverlay: F
40
+ }, A = {
41
+ $style: M
42
+ }, H = /* @__PURE__ */ $(S, [["__cssModules", A], ["__scopeId", "data-v-9e697525"]]);
43
+ function J(e) {
44
+ const a = r("edit"), s = L(() => e.value === "edit" && a.value === "edit");
45
+ return {
46
+ modeFlowFromBack: a,
47
+ isEditFlow: s,
48
+ getFlow: async (o) => {
49
+ const l = (await C("/users/profile/session/flow", { params: { field: o } })).data.data;
50
+ return a.value = l.mode, l.mode;
51
+ }
52
+ };
53
+ }
54
+ const K = async (e, a) => {
55
+ try {
56
+ return await R("/users/profile/contact/check-availability", {
57
+ email: e,
58
+ phone: a
59
+ });
60
+ } catch (s) {
61
+ throw console.error("Ошибка проверки доступности", s), s;
62
+ }
63
+ };
64
+ function x(e) {
65
+ switch (e) {
66
+ case "widget":
67
+ return "https://t.me/yourgoodwidget_bot";
68
+ case "planner":
69
+ return "https://t.me/Yourgood_planner_bot";
70
+ case "sendbot":
71
+ return "https://t.me/care_sendbot";
72
+ case "logic":
73
+ return "https://t.me/yourgoodwidget_bot";
74
+ case "crm":
75
+ return "https://t.me/YourgoodsCRM_bot";
76
+ case "dengi":
77
+ return "https://t.me/yourgoodwidget_bot";
78
+ default:
79
+ return "https://t.me/yourgoodwidget_bot";
80
+ }
81
+ }
82
+ const O = {
83
+ key: 0,
84
+ class: "spacer",
85
+ style: { height: "20px", width: "100%" }
86
+ }, B = { key: 1 }, D = { style: { display: "flex", "align-items": "center", "justify-content": "space-between" } }, I = { style: { display: "inline" } }, N = ["href"], P = "dialogDefaultContainerRateLimitText", V = "dialogDefaultContainerRateLimitTextActive", E = "finalLimitWrapper", z = "finalLimitText", W = "finalLimitLink", Q = /* @__PURE__ */ _({
87
+ __name: "ThrottlerTimer",
88
+ props: {
89
+ loading: { type: Boolean, default: !1 },
90
+ rateLimitText: {},
91
+ isFinalLimit: { type: Boolean },
92
+ onSendAgain: {},
93
+ product: {}
94
+ },
95
+ setup(e) {
96
+ const a = e, s = L(() => a.rateLimitText === "Повторить");
97
+ return (t, o) => t.loading ? (v(), f("div", O)) : (v(), f("div", B, [
98
+ t.isFinalLimit ? t.isFinalLimit && t.rateLimitText !== "Повторить" ? m(t.$slots, "final", { key: 1 }, () => [
99
+ n("div", {
100
+ class: c(E)
101
+ }, [
102
+ n("div", {
103
+ class: c(z)
104
+ }, [
105
+ o[1] || (o[1] = p(" Вы слишком часто запрашивали код. ")),
106
+ o[2] || (o[2] = n("br", null, null, -1)),
107
+ p(" Новый код можно получить через " + g(t.rateLimitText) + ". ", 1)
108
+ ]),
109
+ n("span", I, [
110
+ o[3] || (o[3] = p(" Если есть вопросы — ")),
111
+ n("a", {
112
+ class: c(W),
113
+ href: h(x)(t.product),
114
+ target: "_blank"
115
+ }, "пишите в Telegram.", 8, N)
116
+ ])
117
+ ])
118
+ ]) : b("", !0) : m(t.$slots, "active", { key: 0 }, () => [
119
+ n("div", D, [
120
+ n("span", {
121
+ class: c([P, { [V]: s.value }]),
122
+ onClick: o[0] || (o[0] = (i) => s.value && t.onSendAgain())
123
+ }, g(s.value ? "Повторить" : `Повторить через ${t.rateLimitText}`), 3),
124
+ m(t.$slots, "extra")
125
+ ])
126
+ ])
127
+ ]));
128
+ }
129
+ });
130
+ function X(e) {
131
+ return { showRateLimitToast: (t) => {
132
+ if (!t) return;
133
+ const { attemptsLeft: o } = t, i = {
134
+ 2: "Осталось 2 попытки. После исчерпания лимита ввод кода будет заблокирован на 5 минут",
135
+ 1: "Осталась 1 попытка. После следующей ошибки ввод кода будет заблокирован на 5 минут",
136
+ 0: "Достигнут лимит попыток ввода кода. Попробуйте снова через 5 минут"
137
+ };
138
+ i[o] && e("on-toast", {
139
+ color: "error",
140
+ text: i[o]
141
+ });
142
+ } };
143
+ }
144
+ export {
145
+ H as P,
146
+ Q as _,
147
+ G as a,
148
+ X as b,
149
+ K as c,
150
+ J as u
151
+ };
@@ -0,0 +1,2 @@
1
+ import { Provider } from '../types';
2
+ export declare function getSupportUrl(product: Provider): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yourgoods/ui-smart",
3
- "version": "0.50.1",
3
+ "version": "0.51.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -1,134 +0,0 @@
1
- import { ref as r, defineComponent as L, createElementBlock as f, openBlock as v, normalizeClass as l, createVNode as E, unref as F, computed as T, renderSlot as d, createCommentVNode as $, createElementVNode as o, toDisplayString as y, createTextVNode as p } from "vue";
2
- import { PLoader as w } from "@profeat/ui-kit";
3
- import { _ as g, g as R, p as h } from "./index-Dt-xD4lU.js";
4
- function C(e) {
5
- const t = Math.floor(e / 60), a = e % 60;
6
- return `${String(t).padStart(2, "0")}:${String(a).padStart(2, "0")}`;
7
- }
8
- function x() {
9
- let e = null;
10
- const t = r(0), a = r(!1), s = r("00:00"), u = r(0), n = r(0), i = r(!1);
11
- return {
12
- startTimer: (c, m) => {
13
- e && clearInterval(e), i.value = !1, t.value = c, a.value = c > 0, s.value = C(c);
14
- const k = Date.now() + c * 1e3;
15
- e = setInterval(() => {
16
- t.value > 1 ? (t.value = Math.max(0, Math.round((k - Date.now()) / 1e3)), s.value = C(t.value)) : (clearInterval(e), t.value = 0, a.value = !1, i.value = !0, m && typeof m == "function" && m());
17
- }, 1e3);
18
- },
19
- isShowRateTimers: a,
20
- remainingSeconds: s,
21
- totalRateAttempts: u,
22
- currentRateAttempt: n,
23
- isAvailableForSendAgain: i
24
- };
25
- }
26
- const S = /* @__PURE__ */ L({
27
- __name: "ProfileOverlayLoading",
28
- setup(e) {
29
- return (t, a) => (v(), f("div", {
30
- class: l(t.$style.loaderOverlay)
31
- }, [
32
- E(F(w), {
33
- class: "relative m-auto",
34
- size: "normal"
35
- })
36
- ], 2));
37
- }
38
- }), B = "_loaderOverlay_cpu73_1", b = {
39
- loaderOverlay: B
40
- }, A = {
41
- $style: b
42
- }, z = /* @__PURE__ */ g(S, [["__cssModules", A], ["__scopeId", "data-v-9e697525"]]);
43
- function j(e) {
44
- const t = r("edit"), a = T(() => e.value === "edit" && t.value === "edit");
45
- return {
46
- modeFlowFromBack: t,
47
- isEditFlow: a,
48
- getFlow: async (u) => {
49
- const i = (await R("/users/profile/session/flow", { params: { field: u } })).data.data;
50
- return t.value = i.mode, i.mode;
51
- }
52
- };
53
- }
54
- const M = L({
55
- name: "RateLimitTimer",
56
- props: {
57
- loading: { type: Boolean, default: !1 },
58
- rateLimitText: { type: String, required: !0 },
59
- isFinalLimit: { type: Boolean, required: !0 },
60
- onSendAgain: { type: Function, required: !0 }
61
- },
62
- setup(e) {
63
- return { isRepeat: T(() => e.rateLimitText === "Повторить"), defaultClass: "dialogDefaultContainerRateLimitText", activeClass: "dialogDefaultContainerRateLimitTextActive", finalWrapperClass: "finalLimitWrapper", finalTextClass: "finalLimitText", finalLinkClass: "finalLimitLink" };
64
- }
65
- }), D = {
66
- key: 0,
67
- class: "spacer",
68
- style: { height: "20px", width: "100%" }
69
- }, O = { key: 1 }, _ = { style: { display: "flex", "align-items": "center", "justify-content": "space-between" } }, I = { style: { display: "inline" } };
70
- function N(e, t, a, s, u, n) {
71
- return e.loading ? (v(), f("div", D)) : (v(), f("div", O, [
72
- e.isFinalLimit ? e.isFinalLimit && e.rateLimitText !== "Повторить" ? d(e.$slots, "final", { key: 1 }, () => [
73
- o("div", {
74
- class: l(e.finalWrapperClass)
75
- }, [
76
- o("div", {
77
- class: l(e.finalTextClass)
78
- }, [
79
- t[1] || (t[1] = p(" Вы слишком часто запрашивали код. ")),
80
- t[2] || (t[2] = o("br", null, null, -1)),
81
- p(" Новый код можно получить через " + y(e.rateLimitText) + ". ", 1)
82
- ], 2),
83
- o("span", I, [
84
- t[3] || (t[3] = p(" Если есть вопросы — ")),
85
- o("a", {
86
- class: l(e.finalLinkClass),
87
- href: "https://t.me/yourSupportLink",
88
- target: "_blank"
89
- }, "пишите в Telegram.", 2)
90
- ])
91
- ], 2)
92
- ]) : $("", !0) : d(e.$slots, "active", { key: 0 }, () => [
93
- o("div", _, [
94
- o("span", {
95
- class: l([e.defaultClass, { [e.activeClass]: e.isRepeat }]),
96
- onClick: t[0] || (t[0] = (i) => e.isRepeat && e.onSendAgain())
97
- }, y(e.isRepeat ? "Повторить" : `Повторить через ${e.rateLimitText}`), 3),
98
- d(e.$slots, "extra")
99
- ])
100
- ])
101
- ]));
102
- }
103
- const G = /* @__PURE__ */ g(M, [["render", N]]), H = async (e, t) => {
104
- try {
105
- return await h("/users/profile/contact/check-availability", {
106
- email: e,
107
- phone: t
108
- });
109
- } catch (a) {
110
- throw console.error("Ошибка проверки доступности", a), a;
111
- }
112
- };
113
- function J(e) {
114
- return { showRateLimitToast: (s) => {
115
- if (!s) return;
116
- const { attemptsLeft: u } = s, n = {
117
- 2: "Осталось 2 попытки. После исчерпания лимита ввод кода будет заблокирован на 5 минут",
118
- 1: "Осталась 1 попытка. После следующей ошибки ввод кода будет заблокирован на 5 минут",
119
- 0: "Достигнут лимит попыток ввода кода. Попробуйте снова через 5 минут"
120
- };
121
- n[u] && e("on-toast", {
122
- color: "error",
123
- text: n[u]
124
- });
125
- } };
126
- }
127
- export {
128
- z as P,
129
- G as T,
130
- x as a,
131
- J as b,
132
- H as c,
133
- j as u
134
- };