@layers-app/shared 0.2.6 → 0.2.7
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/components/AppContainer/components/AppSidebarButton.d.ts +1 -1
- package/dist/components/AppContainer/components/AppSidebarButton.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppSidebarButton.js +4 -4
- package/dist/components/AppContainer/components/AppsSidebar/AppsSection.js +22 -22
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +25 -25
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +41 -41
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.js +40 -37
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +3 -2
- package/dist/components/AppContainer/types.d.ts +1 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/FormViewer/components/OneSlideLayput.js +39 -37
- package/dist/components/FormViewer/hooks/useCreateFormContext.d.ts.map +1 -1
- package/dist/components/FormViewer/hooks/useCreateFormContext.js +10 -10
- package/dist/components/FormViewer/store/formStoreApi.js +13 -13
- package/dist/components/ImageCropper/ImageCropper.d.ts.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.js +185 -183
- package/dist/components/LanguagePicker/LanguagePicker.d.ts.map +1 -1
- package/dist/components/LanguagePicker/LanguagePicker.js +41 -32
- package/dist/components/LanguagePicker/LanguagePicker.module.css.js +6 -4
- package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuItem.js +53 -50
- package/dist/components/NavMenu/types.d.ts +1 -0
- package/dist/components/NavMenu/types.d.ts.map +1 -1
- package/dist/components/SocialLinkRow/index.d.ts.map +1 -1
- package/dist/components/SocialLinkRow/index.js +80 -58
- package/dist/components/TimezonePicker/index.d.ts.map +1 -1
- package/dist/components/TimezonePicker/index.js +42 -41
- package/dist/components/UserAvatar/index.d.ts.map +1 -1
- package/dist/components/UserAvatar/index.js +11 -10
- package/dist/components/WorkspaceMenu/WorkspaceItem.js +1 -1
- package/dist/helpers/showFeatureFeedback.d.ts +16 -0
- package/dist/helpers/showFeatureFeedback.d.ts.map +1 -0
- package/dist/helpers/showFeatureFeedback.js +109 -0
- package/dist/helpers/showFeatureFeedback.module.css.js +9 -0
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +81 -113
- package/dist/helpers/showNotifications.module.css.js +10 -10
- package/dist/hooks/useFeatureFeedback.d.ts +23 -0
- package/dist/hooks/useFeatureFeedback.d.ts.map +1 -0
- package/dist/hooks/useFeatureFeedback.js +48 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +322 -310
- package/dist/lib/layersVisitData.d.ts +13 -0
- package/dist/lib/layersVisitData.d.ts.map +1 -0
- package/dist/lib/layersVisitData.js +37 -0
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NotificationData } from '@mantine/notifications';
|
|
2
|
+
import type { createBrowserRouter } from 'react-router-dom';
|
|
3
|
+
import { FeatureRating } from '../hooks/useFeatureFeedback';
|
|
4
|
+
declare global {
|
|
5
|
+
interface Window {
|
|
6
|
+
appRoute: ReturnType<typeof createBrowserRouter>;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export type ShowFeatureFeedbackOptions = Omit<Partial<NotificationData>, 'message' | 'onClose'> & {
|
|
10
|
+
feature: string;
|
|
11
|
+
delay?: number;
|
|
12
|
+
onRate?: (rating: FeatureRating) => void;
|
|
13
|
+
onClose?: () => void;
|
|
14
|
+
};
|
|
15
|
+
export declare function showFeatureFeedback({ feature, title, delay, onRate, onClose, ...notificationProps }: ShowFeatureFeedbackOptions): void;
|
|
16
|
+
//# sourceMappingURL=showFeatureFeedback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"showFeatureFeedback.d.ts","sourceRoot":"","sources":["../../src/helpers/showFeatureFeedback.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAiB,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EACL,aAAa,EAEd,MAAM,6BAA6B,CAAC;AAKrC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,QAAQ,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;KAClD;CACF;AA2DD,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAC3C,OAAO,CAAC,gBAAgB,CAAC,EACzB,SAAS,GAAG,SAAS,CACtB,GAAG;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,KAAK,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,GAAG,iBAAiB,EACrB,EAAE,0BAA0B,QA2F5B"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import { Rating as F } from "@mantine/core";
|
|
3
|
+
import { notifications as d } from "@mantine/notifications";
|
|
4
|
+
import { trackFeatureFeedback as p } from "../hooks/useFeatureFeedback.js";
|
|
5
|
+
import { setFeatureRating as v } from "../lib/layersVisitData.js";
|
|
6
|
+
import O from "./showFeatureFeedback.module.css.js";
|
|
7
|
+
const _ = "feature-feedback-", k = 2e3, M = 12e3;
|
|
8
|
+
function C(e) {
|
|
9
|
+
const t = new MutationObserver(() => {
|
|
10
|
+
document.querySelector('[role="dialog"]') && e();
|
|
11
|
+
});
|
|
12
|
+
return t.observe(document.body, { childList: !0, subtree: !0 }), () => t.disconnect();
|
|
13
|
+
}
|
|
14
|
+
function y(e) {
|
|
15
|
+
const t = window.appRoute;
|
|
16
|
+
if (!t) return null;
|
|
17
|
+
const o = t.state.location.pathname;
|
|
18
|
+
return t.subscribe((s) => {
|
|
19
|
+
s.location.pathname !== o && e();
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const x = [
|
|
23
|
+
"😠",
|
|
24
|
+
// 😠 1 = terrible
|
|
25
|
+
"😟",
|
|
26
|
+
// 😟 2 = bad
|
|
27
|
+
"😐",
|
|
28
|
+
// 😐 3 = okay
|
|
29
|
+
"🙂",
|
|
30
|
+
// 🙂 4 = good
|
|
31
|
+
"🥰"
|
|
32
|
+
// 🥰 5 = great
|
|
33
|
+
], N = [
|
|
34
|
+
"var(--mantine-color-red-light-hover)",
|
|
35
|
+
"var(--mantine-color-orange-light-hover)",
|
|
36
|
+
"var(--mantine-color-orange-light-hover)",
|
|
37
|
+
"var(--mantine-color-orange-light-hover)",
|
|
38
|
+
"var(--mantine-color-green-light-hover)"
|
|
39
|
+
], A = {
|
|
40
|
+
width: 40,
|
|
41
|
+
height: 40,
|
|
42
|
+
borderRadius: 100,
|
|
43
|
+
display: "flex",
|
|
44
|
+
alignItems: "center",
|
|
45
|
+
justifyContent: "center",
|
|
46
|
+
fontSize: 24,
|
|
47
|
+
lineHeight: 1
|
|
48
|
+
}, S = (e) => {
|
|
49
|
+
const t = x[e - 1], o = N[e - 1];
|
|
50
|
+
return !t || !o ? null : /* @__PURE__ */ h("div", { style: { ...A, background: o }, children: t });
|
|
51
|
+
};
|
|
52
|
+
function H({
|
|
53
|
+
feature: e,
|
|
54
|
+
title: t,
|
|
55
|
+
delay: o,
|
|
56
|
+
onRate: s,
|
|
57
|
+
onClose: w,
|
|
58
|
+
...R
|
|
59
|
+
}) {
|
|
60
|
+
const a = `${_}${e}`;
|
|
61
|
+
let c = !1, u = !1, r = null, i = null, l = null;
|
|
62
|
+
const n = () => {
|
|
63
|
+
r && clearTimeout(r), r = null, i?.(), i = null, l?.(), l = null;
|
|
64
|
+
}, g = () => {
|
|
65
|
+
c || (c = !0, u = !0, n(), d.hide(a));
|
|
66
|
+
}, f = () => {
|
|
67
|
+
n(), c = !1, u = !1;
|
|
68
|
+
let b = !1;
|
|
69
|
+
const I = (T) => {
|
|
70
|
+
const m = T;
|
|
71
|
+
b = !0, n(), p(e, m), v(e, m), s?.(m), d.update({
|
|
72
|
+
id: a,
|
|
73
|
+
title: "Thanks!",
|
|
74
|
+
message: "",
|
|
75
|
+
icon: null,
|
|
76
|
+
autoClose: k,
|
|
77
|
+
withCloseButton: !0
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
d.show({
|
|
81
|
+
icon: null,
|
|
82
|
+
autoClose: M,
|
|
83
|
+
withCloseButton: !0,
|
|
84
|
+
withBorder: !0,
|
|
85
|
+
...R,
|
|
86
|
+
title: t,
|
|
87
|
+
classNames: O,
|
|
88
|
+
id: a,
|
|
89
|
+
message: /* @__PURE__ */ h("div", { className: O.rating, children: /* @__PURE__ */ h(
|
|
90
|
+
F,
|
|
91
|
+
{
|
|
92
|
+
emptySymbol: S,
|
|
93
|
+
fullSymbol: S,
|
|
94
|
+
highlightSelectedOnly: !0,
|
|
95
|
+
size: "xl",
|
|
96
|
+
onChange: I,
|
|
97
|
+
styles: { root: { gap: 10, margin: "8px" } }
|
|
98
|
+
}
|
|
99
|
+
) }),
|
|
100
|
+
onClose: () => {
|
|
101
|
+
n(), !(b || u) && (p(e, 0), v(e, 0), w?.());
|
|
102
|
+
}
|
|
103
|
+
}), i = C(g), l = y(g) ?? null;
|
|
104
|
+
};
|
|
105
|
+
o && o > 0 ? (r = setTimeout(f, o * 1e3), l = y(() => n()) ?? null, i = C(() => n())) : f();
|
|
106
|
+
}
|
|
107
|
+
export {
|
|
108
|
+
H as showFeatureFeedback
|
|
109
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"showNotifications.d.ts","sourceRoot":"","sources":["../../src/helpers/showNotifications.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"showNotifications.d.ts","sourceRoot":"","sources":["../../src/helpers/showNotifications.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,wBAAwB,CAAC;AAKhC,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,gBAAgB,CAAC;AAetD,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAChC;AAED,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG;IACzE,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAChC,CAAC;AAmEF,eAAO,MAAM,wBAAwB,GACnC,QAAQ,EACR,OAAO,SAAS,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,EAErD,SAAS,OAAO,EAChB,UAAS;IACP,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAK,WAAW,CAAC,GAAG,WAAW,CAAC;IAC5D,QAAQ,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,KAAK,WAAW,CAAC,GAAG,WAAW,CAAC;CACjD,iBA+BP,CAAC;AAwCF,eAAO,MAAM,uBAAuB,GAAI,OAAO,wBAAwB,SAKtE,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,OAAO,wBAAwB,SAKtE,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,OAAO,wBAAwB,SAKtE,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,OAAO,wBAAwB,SAKpE,CAAC"}
|
|
@@ -1,163 +1,131 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import { InformationCircleIcon as C, CheckmarkCircle02Icon as y, Alert01Icon as b, Alert02Icon as x } from "@hugeicons/core-free-icons";
|
|
1
|
+
import { jsx as i, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { InformationCircleIcon as v, CheckmarkCircle02Icon as I, Alert01Icon as g, Alert02Icon as p } from "@hugeicons/core-free-icons";
|
|
4
3
|
import { HugeiconsIcon as d } from "@hugeicons/react";
|
|
5
|
-
import { CloseButton as
|
|
6
|
-
import { showNotification as
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
|
|
14
|
-
O,
|
|
4
|
+
import { CloseButton as C, Box as u, Button as b } from "@mantine/core";
|
|
5
|
+
import { showNotification as y, notifications as B } from "@mantine/notifications";
|
|
6
|
+
import { isFunction as h, isObject as N } from "lodash-es";
|
|
7
|
+
import c from "./showNotifications.module.css.js";
|
|
8
|
+
let k = 0;
|
|
9
|
+
const z = /* @__PURE__ */ i(d, { icon: I, size: 14, color: "white" }), x = /* @__PURE__ */ i(d, { icon: p, size: 14, color: "white" }), S = /* @__PURE__ */ i(d, { icon: g, size: 14, color: "white" }), M = /* @__PURE__ */ i(d, { icon: v, size: 14, color: "white" }), O = (o, n) => n?.length ? /* @__PURE__ */ l(u, { children: [
|
|
10
|
+
/* @__PURE__ */ i(u, { children: o }),
|
|
11
|
+
/* @__PURE__ */ i(u, { className: c.actions, children: n.map((t, e) => /* @__PURE__ */ i(
|
|
12
|
+
b,
|
|
15
13
|
{
|
|
16
14
|
size: "compact-sm",
|
|
17
|
-
variant:
|
|
18
|
-
onClick:
|
|
15
|
+
variant: t.variant ?? "default",
|
|
16
|
+
onClick: t.onClick,
|
|
19
17
|
radius: "md",
|
|
20
|
-
children:
|
|
18
|
+
children: t.label
|
|
21
19
|
},
|
|
22
|
-
|
|
20
|
+
e
|
|
23
21
|
)) })
|
|
24
22
|
] }) : o;
|
|
25
|
-
function
|
|
23
|
+
function R({
|
|
26
24
|
id: o,
|
|
27
|
-
title:
|
|
28
|
-
icon:
|
|
29
|
-
children:
|
|
25
|
+
title: n,
|
|
26
|
+
icon: t,
|
|
27
|
+
children: e
|
|
30
28
|
}) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
initial: { width: 48, maxHeight: 48 },
|
|
39
|
-
animate: t ? { width: [316, 316, 48], maxHeight: [300, 48, 48] } : { width: [48, 316, 316], maxHeight: [48, 48, 300] },
|
|
40
|
-
transition: t ? { duration: 0.5, ease: "easeIn", times: [0, 0.35, 1] } : { duration: 0.5, ease: "easeOut", times: [0, 0.65, 1] },
|
|
41
|
-
children: [
|
|
42
|
-
/* @__PURE__ */ l("div", { className: i ? s.contentRow : s.contentRowCentered, children: [
|
|
43
|
-
/* @__PURE__ */ n("div", { className: s.icon, children: e }),
|
|
44
|
-
/* @__PURE__ */ l(
|
|
45
|
-
h.div,
|
|
46
|
-
{
|
|
47
|
-
className: s.body,
|
|
48
|
-
initial: { opacity: 0 },
|
|
49
|
-
animate: { opacity: t ? 0 : 1 },
|
|
50
|
-
transition: t ? { duration: 0.15, ease: "easeIn" } : { duration: 0.2, delay: 0.3, ease: "easeOut" },
|
|
51
|
-
children: [
|
|
52
|
-
i && /* @__PURE__ */ n("div", { className: s.title, children: i }),
|
|
53
|
-
c && /* @__PURE__ */ n(
|
|
54
|
-
"div",
|
|
55
|
-
{
|
|
56
|
-
className: i ? s.description : s.descriptionWithoutTitle,
|
|
57
|
-
children: c
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
]
|
|
61
|
-
}
|
|
62
|
-
)
|
|
63
|
-
] }),
|
|
64
|
-
/* @__PURE__ */ n(
|
|
65
|
-
h.div,
|
|
29
|
+
return /* @__PURE__ */ l("div", { className: c.root, children: [
|
|
30
|
+
/* @__PURE__ */ l("div", { className: n ? c.contentRow : c.contentRowCentered, children: [
|
|
31
|
+
/* @__PURE__ */ i("div", { className: c.icon, children: t }),
|
|
32
|
+
/* @__PURE__ */ l("div", { className: c.body, children: [
|
|
33
|
+
n && /* @__PURE__ */ i("div", { className: c.title, children: n }),
|
|
34
|
+
e && /* @__PURE__ */ i(
|
|
35
|
+
"div",
|
|
66
36
|
{
|
|
67
|
-
className:
|
|
68
|
-
|
|
69
|
-
animate: { opacity: t ? 0 : 1 },
|
|
70
|
-
transition: t ? { duration: 0.15, ease: "easeIn" } : { duration: 0.2, delay: 0.3, ease: "easeOut" },
|
|
71
|
-
children: /* @__PURE__ */ n(
|
|
72
|
-
B,
|
|
73
|
-
{
|
|
74
|
-
className: s.closeButton,
|
|
75
|
-
size: 24,
|
|
76
|
-
onClick: () => z.hide(o)
|
|
77
|
-
}
|
|
78
|
-
)
|
|
37
|
+
className: n ? c.description : c.descriptionWithoutTitle,
|
|
38
|
+
children: e
|
|
79
39
|
}
|
|
80
40
|
)
|
|
81
|
-
]
|
|
82
|
-
}
|
|
83
|
-
|
|
41
|
+
] })
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ i("div", { className: c.closeButtonWrapper, children: /* @__PURE__ */ i(
|
|
44
|
+
C,
|
|
45
|
+
{
|
|
46
|
+
className: c.closeButton,
|
|
47
|
+
size: 24,
|
|
48
|
+
onClick: () => B.hide(o)
|
|
49
|
+
}
|
|
50
|
+
) })
|
|
51
|
+
] });
|
|
84
52
|
}
|
|
85
|
-
const
|
|
86
|
-
const { successMsg:
|
|
87
|
-
return o.then((
|
|
88
|
-
if (
|
|
89
|
-
const
|
|
90
|
-
id:
|
|
91
|
-
...
|
|
53
|
+
const $ = (o, n = {}) => {
|
|
54
|
+
const { successMsg: t, errorMsg: e } = n;
|
|
55
|
+
return o.then((r) => {
|
|
56
|
+
if (t) {
|
|
57
|
+
const s = h(t) ? t(r) : t, a = {
|
|
58
|
+
id: n.notifyId,
|
|
59
|
+
...N(s) ? s : { message: s }
|
|
92
60
|
};
|
|
93
|
-
|
|
61
|
+
W(a);
|
|
94
62
|
}
|
|
95
|
-
return
|
|
96
|
-
}).catch((
|
|
97
|
-
if (
|
|
98
|
-
const
|
|
99
|
-
id:
|
|
100
|
-
...
|
|
63
|
+
return r;
|
|
64
|
+
}).catch((r) => {
|
|
65
|
+
if (e) {
|
|
66
|
+
const s = h(e) ? e(r) : e, a = {
|
|
67
|
+
id: n.notifyId,
|
|
68
|
+
...N(s) ? s : { message: s }
|
|
101
69
|
};
|
|
102
|
-
|
|
70
|
+
j(a);
|
|
103
71
|
}
|
|
104
|
-
return
|
|
72
|
+
return r;
|
|
105
73
|
});
|
|
106
|
-
}, m = (o,
|
|
107
|
-
const { actions:
|
|
108
|
-
|
|
109
|
-
color:
|
|
74
|
+
}, m = (o, n) => {
|
|
75
|
+
const { actions: t, title: e, message: r, onClose: s, ...a } = o, w = `ntf-${++k}`, f = a.id ?? w;
|
|
76
|
+
y({
|
|
77
|
+
color: n.color,
|
|
110
78
|
radius: 12,
|
|
111
79
|
...a,
|
|
112
|
-
id:
|
|
80
|
+
id: f,
|
|
113
81
|
icon: void 0,
|
|
114
82
|
title: void 0,
|
|
115
83
|
withCloseButton: !1,
|
|
116
84
|
withBorder: !1,
|
|
117
85
|
p: 0,
|
|
118
|
-
classNames: { root:
|
|
86
|
+
classNames: { root: c.mantineRoot },
|
|
119
87
|
styles: {
|
|
120
88
|
root: { background: "none", border: "none", boxShadow: "none" },
|
|
121
89
|
body: { margin: 0 }
|
|
122
90
|
},
|
|
123
91
|
onClose: () => {
|
|
124
|
-
|
|
92
|
+
s?.(o);
|
|
125
93
|
},
|
|
126
|
-
message: /* @__PURE__ */
|
|
127
|
-
|
|
94
|
+
message: /* @__PURE__ */ i(
|
|
95
|
+
R,
|
|
128
96
|
{
|
|
129
|
-
id:
|
|
130
|
-
title:
|
|
131
|
-
icon:
|
|
132
|
-
children:
|
|
97
|
+
id: f,
|
|
98
|
+
title: e,
|
|
99
|
+
icon: n.icon,
|
|
100
|
+
children: O(r, t)
|
|
133
101
|
}
|
|
134
102
|
)
|
|
135
103
|
});
|
|
136
|
-
},
|
|
104
|
+
}, D = (o) => {
|
|
137
105
|
m(o, {
|
|
138
106
|
color: "var(--mantine-color-blue-outline)",
|
|
139
|
-
icon:
|
|
107
|
+
icon: M
|
|
140
108
|
});
|
|
141
|
-
},
|
|
109
|
+
}, W = (o) => {
|
|
142
110
|
m(o, {
|
|
143
111
|
color: "var(--mantine-color-green-outline)",
|
|
144
|
-
icon:
|
|
112
|
+
icon: z
|
|
145
113
|
});
|
|
146
|
-
},
|
|
114
|
+
}, G = (o) => {
|
|
147
115
|
m(o, {
|
|
148
116
|
color: "var(--mantine-color-yellow-outline)",
|
|
149
|
-
icon:
|
|
117
|
+
icon: S
|
|
150
118
|
});
|
|
151
|
-
},
|
|
119
|
+
}, j = (o) => {
|
|
152
120
|
m(o, {
|
|
153
121
|
color: "var(--mantine-color-red-outline)",
|
|
154
|
-
icon:
|
|
122
|
+
icon: x
|
|
155
123
|
});
|
|
156
124
|
};
|
|
157
125
|
export {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
126
|
+
j as showErrorNotification,
|
|
127
|
+
D as showMessageNotification,
|
|
128
|
+
$ as showRequestNotifications,
|
|
129
|
+
W as showSuccessNotification,
|
|
130
|
+
G as showWarningNotification
|
|
163
131
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_mantineRoot_17m8q_1", o = "_root_17m8q_5", n = "_contentRow_17m8q_16", e = "_contentRowCentered_17m8q_21", c = "_icon_17m8q_26", _ = "_body_17m8q_39", s = "_title_17m8q_44", i = "_description_17m8q_56", r = "_descriptionWithoutTitle_17m8q_62", m = "_closeButtonWrapper_17m8q_69", l = "_closeButton_17m8q_69", d = "_actions_17m8q_79", p = {
|
|
2
2
|
mantineRoot: t,
|
|
3
3
|
root: o,
|
|
4
4
|
contentRow: n,
|
|
@@ -7,21 +7,21 @@ const t = "_mantineRoot_1pbtj_2", o = "_root_1pbtj_11", n = "_contentRow_1pbtj_2
|
|
|
7
7
|
body: _,
|
|
8
8
|
title: s,
|
|
9
9
|
description: i,
|
|
10
|
-
descriptionWithoutTitle:
|
|
11
|
-
closeButtonWrapper:
|
|
12
|
-
closeButton:
|
|
13
|
-
actions:
|
|
10
|
+
descriptionWithoutTitle: r,
|
|
11
|
+
closeButtonWrapper: m,
|
|
12
|
+
closeButton: l,
|
|
13
|
+
actions: d
|
|
14
14
|
};
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
d as actions,
|
|
17
17
|
_ as body,
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
l as closeButton,
|
|
19
|
+
m as closeButtonWrapper,
|
|
20
20
|
n as contentRow,
|
|
21
21
|
e as contentRowCentered,
|
|
22
|
-
|
|
22
|
+
p as default,
|
|
23
23
|
i as description,
|
|
24
|
-
|
|
24
|
+
r as descriptionWithoutTitle,
|
|
25
25
|
c as icon,
|
|
26
26
|
t as mantineRoot,
|
|
27
27
|
o as root,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** 0 = skip (closed without rating), 1-5 = actual rating */
|
|
2
|
+
export type FeatureRating = 0 | 1 | 2 | 3 | 4 | 5;
|
|
3
|
+
export declare const FEATURE_KEYS: {
|
|
4
|
+
readonly COMMENTS: "comments";
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Sends `feature_feedback` goal hit + visit params.
|
|
8
|
+
*
|
|
9
|
+
* Metrika hierarchy (auto-discovers new features):
|
|
10
|
+
* feature_feedback > {feature_key} > {1-5 | skip}
|
|
11
|
+
*/
|
|
12
|
+
export declare function trackFeatureFeedback(feature: string, rating: FeatureRating): void;
|
|
13
|
+
/**
|
|
14
|
+
* Shows feedback prompt after `delaySeconds`. Fires once per feature (localStorage).
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
* const { shouldShow, dismiss } = useDelayedFeatureFeedback('comments', 8);
|
|
18
|
+
*/
|
|
19
|
+
export declare function useDelayedFeatureFeedback(feature: string, delaySeconds: number): {
|
|
20
|
+
readonly shouldShow: boolean;
|
|
21
|
+
readonly dismiss: (rating?: FeatureRating) => void;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=useFeatureFeedback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFeatureFeedback.d.ts","sourceRoot":"","sources":["../../src/hooks/useFeatureFeedback.ts"],"names":[],"mappings":"AAOA,4DAA4D;AAC5D,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAElD,eAAO,MAAM,YAAY;;CAEf,CAAC;AAaX;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,aAAa,QA0BtB;AAgBD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM;;gCAlBT,aAAa;EAiCzB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useState as c, useEffect as a, useCallback as d } from "react";
|
|
2
|
+
import { isFeatureRated as m, setFeatureRating as f } from "../lib/layersVisitData.js";
|
|
3
|
+
const y = {
|
|
4
|
+
COMMENTS: "comments"
|
|
5
|
+
}, o = 98921675;
|
|
6
|
+
function l() {
|
|
7
|
+
const e = window.ym;
|
|
8
|
+
return typeof e == "function" ? e : null;
|
|
9
|
+
}
|
|
10
|
+
function k(e, t) {
|
|
11
|
+
const s = String(e ?? "").trim().slice(0, 120);
|
|
12
|
+
if (!s || ![0, 1, 2, 3, 4, 5].includes(t)) return;
|
|
13
|
+
const n = t === 0 ? "skip" : String(t), r = { feature_feedback: { [s]: { [n]: 1 } } };
|
|
14
|
+
try {
|
|
15
|
+
const i = l();
|
|
16
|
+
i && (i(o, "reachGoal", "feature_feedback", r), i(o, "params", r));
|
|
17
|
+
} catch {
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
(window.dataLayer = window.dataLayer || []).push({ event: "feature_feedback", feature: s, rating: t });
|
|
21
|
+
} catch {
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function h(e) {
|
|
25
|
+
const [t, s] = c(() => m(e)), n = d(
|
|
26
|
+
(r = 0) => {
|
|
27
|
+
s(!0), f(e, r);
|
|
28
|
+
},
|
|
29
|
+
[e]
|
|
30
|
+
);
|
|
31
|
+
return { shouldShow: !t, dismiss: n };
|
|
32
|
+
}
|
|
33
|
+
function p(e, t) {
|
|
34
|
+
const { shouldShow: s, dismiss: n } = h(e), [r, i] = c(!1);
|
|
35
|
+
return a(() => {
|
|
36
|
+
if (!s) return;
|
|
37
|
+
const u = setTimeout(
|
|
38
|
+
() => i(!0),
|
|
39
|
+
t * 1e3
|
|
40
|
+
);
|
|
41
|
+
return () => clearTimeout(u);
|
|
42
|
+
}, [s, t]), { shouldShow: s && r, dismiss: n };
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
y as FEATURE_KEYS,
|
|
46
|
+
k as trackFeatureFeedback,
|
|
47
|
+
p as useDelayedFeatureFeedback
|
|
48
|
+
};
|