@cuemath/leap 3.2.17-j1 → 3.2.17-mb
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/assets/illustrations/illustrations.js +0 -5
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/lottie/lottie.js +1 -11
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/auth/account-selector/account-selector.js +25 -26
- package/dist/features/auth/account-selector/account-selector.js.map +1 -1
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +14 -20
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
- package/dist/features/auth/comps/resend-otp/resend-otp.js +47 -54
- package/dist/features/auth/comps/resend-otp/resend-otp.js.map +1 -1
- package/dist/features/auth/comps/tabs/tab-tem/tab-item.js +17 -29
- package/dist/features/auth/comps/tabs/tab-tem/tab-item.js.map +1 -1
- package/dist/features/auth/comps/tabs/tabs-styled.js +10 -22
- package/dist/features/auth/comps/tabs/tabs-styled.js.map +1 -1
- package/dist/features/auth/comps/tabs/tabs.js +5 -5
- package/dist/features/auth/comps/tabs/tabs.js.map +1 -1
- package/dist/features/auth/comps/user-list/user-item/user-item.js +31 -30
- package/dist/features/auth/comps/user-list/user-item/user-item.js.map +1 -1
- package/dist/features/auth/comps/user-list/user-list.js +34 -35
- package/dist/features/auth/comps/user-list/user-list.js.map +1 -1
- package/dist/features/auth/forgot-password/forgot-password-styled.js +15 -14
- package/dist/features/auth/forgot-password/forgot-password-styled.js.map +1 -1
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js +7 -6
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js.map +1 -1
- package/dist/features/auth/login/login-styled.js +9 -8
- package/dist/features/auth/login/login-styled.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +7 -7
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js +4 -4
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +85 -85
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +98 -121
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js +28 -29
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +42 -43
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -1
- package/dist/features/circle-games/games/tutorial/tutorial.js +35 -43
- package/dist/features/circle-games/games/tutorial/tutorial.js.map +1 -1
- package/dist/features/circle-games/sign-up/comp/grade-input/grade-input-styled.js +2 -2
- package/dist/features/circle-games/sign-up/comp/grade-input/grade-input-styled.js.map +1 -1
- package/dist/features/circle-games/sign-up/comp/grade-input/grade-input.js +1 -1
- package/dist/features/circle-games/sign-up/comp/grade-input/grade-input.js.map +1 -1
- package/dist/features/circle-games/sign-up/comp/username-input/username-input.js +24 -26
- package/dist/features/circle-games/sign-up/comp/username-input/username-input.js.map +1 -1
- package/dist/features/circle-games/sign-up/constants.js +1 -3
- package/dist/features/circle-games/sign-up/constants.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js +42 -42
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js.map +1 -1
- package/dist/features/hooks/use-viewport/use-viewport.js +22 -0
- package/dist/features/hooks/use-viewport/use-viewport.js.map +1 -0
- package/dist/features/journey/comps/coachmark/coachmark.js +27 -29
- package/dist/features/journey/comps/coachmark/coachmark.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js +2 -2
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/use-journey/journey-context-provider.js +72 -73
- package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
- package/dist/features/journey/use-journey/journey-styled.js +4 -6
- package/dist/features/journey/use-journey/journey-styled.js.map +1 -1
- package/dist/features/stickers/sticker-data.js +234 -0
- package/dist/features/stickers/sticker-data.js.map +1 -0
- package/dist/features/{ui/sticker-grid/sticker-grid-styles.js → stickers/sticker-selector/sticker-selector-styles.js} +4 -3
- package/dist/features/stickers/sticker-selector/sticker-selector-styles.js.map +1 -0
- package/dist/features/stickers/sticker-selector/sticker-selector.js +25 -0
- package/dist/features/stickers/sticker-selector/sticker-selector.js.map +1 -0
- package/dist/features/stickers/sticker-selector/sticker.js +57 -0
- package/dist/features/stickers/sticker-selector/sticker.js.map +1 -0
- package/dist/features/{ui/stickers/stickers-effects.js → stickers/stickers-effects/effects.js} +6 -6
- package/dist/features/stickers/stickers-effects/effects.js.map +1 -0
- package/dist/features/{ui/stickers/stickers-styled.js → stickers/stickers-effects/stickers-effects-styled.js} +2 -2
- package/dist/features/stickers/stickers-effects/stickers-effects-styled.js.map +1 -0
- package/dist/features/{ui/stickers/stickers-utils.js → stickers/stickers-effects/stickers-effects-utils.js} +6 -6
- package/dist/features/stickers/stickers-effects/stickers-effects-utils.js.map +1 -0
- package/dist/features/stickers/stickers-effects/stickers-effects.js +39 -0
- package/dist/features/stickers/stickers-effects/stickers-effects.js.map +1 -0
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js +60 -12
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js.map +1 -1
- package/dist/features/ui/arrow-tooltip/arrow-tooltip.js +77 -72
- package/dist/features/ui/arrow-tooltip/arrow-tooltip.js.map +1 -1
- package/dist/features/ui/error/error.js +27 -65
- package/dist/features/ui/error/error.js.map +1 -1
- package/dist/features/ui/image/image.js +1 -1
- package/dist/features/ui/image/image.js.map +1 -1
- package/dist/features/ui/lottie-animation/lottie-animation.js +29 -25
- package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
- package/dist/features/ui/modals/modal-styled.js +58 -34
- package/dist/features/ui/modals/modal-styled.js.map +1 -1
- package/dist/features/ui/modals/modal.js +14 -40
- package/dist/features/ui/modals/modal.js.map +1 -1
- package/dist/features/ui/nudge/nudge-styled.js +7 -14
- package/dist/features/ui/nudge/nudge-styled.js.map +1 -1
- package/dist/features/ui/nudge/nudge.js +12 -13
- package/dist/features/ui/nudge/nudge.js.map +1 -1
- package/dist/features/ui/streak-icon/streak-icon-styled.js +13 -13
- package/dist/features/ui/streak-icon/streak-icon-styled.js.map +1 -1
- package/dist/features/ui/streak-icon/streak-icon.js +15 -17
- package/dist/features/ui/streak-icon/streak-icon.js.map +1 -1
- package/dist/features/ui/text/text.js +36 -40
- package/dist/features/ui/text/text.js.map +1 -1
- package/dist/features/ui/theme/button.js +78 -78
- package/dist/features/ui/theme/button.js.map +1 -1
- package/dist/features/ui/theme/constants.js +2 -4
- package/dist/features/ui/theme/constants.js.map +1 -1
- package/dist/features/ui/theme/get-device.js +3 -3
- package/dist/features/ui/theme/get-device.js.map +1 -1
- package/dist/features/worksheet/worksheet/constants.js +13 -12
- package/dist/features/worksheet/worksheet/constants.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +24 -24
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +260 -246
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-styled.js +28 -37
- package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet.js +164 -166
- package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
- package/dist/index.d.ts +55 -184
- package/dist/index.js +541 -579
- package/dist/index.js.map +1 -1
- package/dist/node_modules/query-string/base.js +1 -1
- package/dist/node_modules/query-string/node_modules/decode-uri-component/index.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +5 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +2 -3
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +10 -6
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +9 -12
- package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +8 -0
- package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +1 -0
- package/dist/static/nudge-tap.5cb30093.json +1057 -0
- package/package.json +1 -1
- package/dist/assets/line-icons/icons/after-noon.js +0 -34
- package/dist/assets/line-icons/icons/after-noon.js.map +0 -1
- package/dist/assets/line-icons/icons/apple-icon-white.js +0 -42
- package/dist/assets/line-icons/icons/apple-icon-white.js.map +0 -1
- package/dist/assets/line-icons/icons/cue-board-filled.js +0 -33
- package/dist/assets/line-icons/icons/cue-board-filled.js.map +0 -1
- package/dist/assets/line-icons/icons/cue-board.js +0 -23
- package/dist/assets/line-icons/icons/cue-board.js.map +0 -1
- package/dist/assets/line-icons/icons/evening.js +0 -35
- package/dist/assets/line-icons/icons/evening.js.map +0 -1
- package/dist/assets/line-icons/icons/hint-fill.js +0 -35
- package/dist/assets/line-icons/icons/hint-fill.js.map +0 -1
- package/dist/assets/line-icons/icons/morning.js +0 -35
- package/dist/assets/line-icons/icons/morning.js.map +0 -1
- package/dist/assets/line-icons/icons/screen-grab-filled.js +0 -35
- package/dist/assets/line-icons/icons/screen-grab-filled.js.map +0 -1
- package/dist/assets/line-icons/icons/screen-grab.js +0 -23
- package/dist/assets/line-icons/icons/screen-grab.js.map +0 -1
- package/dist/assets/line-icons/icons/sticker-filled.js +0 -64
- package/dist/assets/line-icons/icons/sticker-filled.js.map +0 -1
- package/dist/assets/line-icons/icons/sticker.js +0 -46
- package/dist/assets/line-icons/icons/sticker.js.map +0 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-constants.js +0 -9
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-constants.js.map +0 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js +0 -52
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js.map +0 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js +0 -95
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js.map +0 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text-styled.js +0 -10
- package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text-styled.js.map +0 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text.js +0 -17
- package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text.js.map +0 -1
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar-styled.js +0 -12
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar-styled.js.map +0 -1
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js +0 -34
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js.map +0 -1
- package/dist/features/auth/comps/otp-input/otp-input-styled.js +0 -22
- package/dist/features/auth/comps/otp-input/otp-input-styled.js.map +0 -1
- package/dist/features/auth/comps/otp-input/otp-input.js +0 -51
- package/dist/features/auth/comps/otp-input/otp-input.js.map +0 -1
- package/dist/features/auth/comps/pill-button/pill-button-styled.js +0 -44
- package/dist/features/auth/comps/pill-button/pill-button-styled.js.map +0 -1
- package/dist/features/auth/comps/pill-button/pill-button.js +0 -75
- package/dist/features/auth/comps/pill-button/pill-button.js.map +0 -1
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card-styled.js +0 -17
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card-styled.js.map +0 -1
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js +0 -67
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js.map +0 -1
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-constants.js +0 -19
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-constants.js.map +0 -1
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-styled.js +0 -32
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-styled.js.map +0 -1
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide.js +0 -44
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide.js.map +0 -1
- package/dist/features/auth/pla-signup/signup-header/signup-header.js +0 -54
- package/dist/features/auth/pla-signup/signup-header/signup-header.js.map +0 -1
- package/dist/features/auth/pla-signup/signup-options/signup-options.js +0 -83
- package/dist/features/auth/pla-signup/signup-options/signup-options.js.map +0 -1
- package/dist/features/puzzles/app/puzzle-app-styled.js +0 -81
- package/dist/features/puzzles/app/puzzle-app-styled.js.map +0 -1
- package/dist/features/puzzles/app/puzzle-app-view.js +0 -120
- package/dist/features/puzzles/app/puzzle-app-view.js.map +0 -1
- package/dist/features/puzzles/app/puzzle-app.js +0 -62
- package/dist/features/puzzles/app/puzzle-app.js.map +0 -1
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js +0 -6
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js.map +0 -1
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js +0 -63
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js.map +0 -1
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js +0 -21
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js.map +0 -1
- package/dist/features/ui/drawer/drawer-styled.js +0 -34
- package/dist/features/ui/drawer/drawer-styled.js.map +0 -1
- package/dist/features/ui/drawer/drawer.js +0 -42
- package/dist/features/ui/drawer/drawer.js.map +0 -1
- package/dist/features/ui/sticker-grid/sticker-grid-styles.js.map +0 -1
- package/dist/features/ui/sticker-grid/sticker-grid.js +0 -24
- package/dist/features/ui/sticker-grid/sticker-grid.js.map +0 -1
- package/dist/features/ui/sticker-grid/sticker.js +0 -57
- package/dist/features/ui/sticker-grid/sticker.js.map +0 -1
- package/dist/features/ui/stickers/constants.js +0 -6
- package/dist/features/ui/stickers/constants.js.map +0 -1
- package/dist/features/ui/stickers/stickers-effects.js.map +0 -1
- package/dist/features/ui/stickers/stickers-styled.js.map +0 -1
- package/dist/features/ui/stickers/stickers-utils.js.map +0 -1
- package/dist/features/ui/stickers/stickers.js +0 -40
- package/dist/features/ui/stickers/stickers.js.map +0 -1
- package/dist/node_modules/decode-uri-component/index.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/native.js +0 -7
- package/dist/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
- package/dist/static/animated-avatar.1ad58b1d.json +0 -1
- package/dist/static/animated-avatar.69b07505.json +0 -1
- package/dist/static/animated-avatar.9c560b46.json +0 -1
- package/dist/static/calendar-purple.1a840b41.svg +0 -1
- package/dist/static/flying-disk.c7f6ed39.json +0 -1
- package/dist/static/graduation-cap.3be3340a.json +0 -1
- package/dist/static/handshake.287e7dfb.svg +0 -1
- package/dist/static/light-bulb.c6db0b23.json +0 -1
- package/dist/static/money.332aacf1.svg +0 -1
- package/dist/static/muscle.9bcfb8a7.json +0 -1
- package/dist/static/nudge-tap.0591aef4.json +0 -1
- package/dist/static/parent-avatar.822c7b9b.svg +0 -1
- package/dist/static/pencil.23df9da0.json +0 -1
- package/dist/static/plus-sign.de6af957.json +0 -1
- package/dist/static/racing-car.2cbf864e.json +0 -1
- package/dist/static/rocket.0a3ccab0.json +0 -1
- package/dist/static/shovel.abeec04c.json +0 -1
- package/dist/static/trustpilot.bd3d79e1.svg +0 -1
- /package/dist/node_modules/{decode-uri-component → query-string/node_modules/decode-uri-component}/index.js +0 -0
@@ -1,55 +1,55 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { createContext as
|
3
|
-
import { Coachmark as
|
4
|
-
import { usePostUserJourney as
|
5
|
-
import { Overlay as
|
6
|
-
const
|
7
|
-
const [
|
1
|
+
import { jsxs as L, jsx as O } from "react/jsx-runtime";
|
2
|
+
import { createContext as N, useState as c, useRef as v, useCallback as h, useMemo as R, useEffect as T } from "react";
|
3
|
+
import { Coachmark as W } from "../comps/coachmark/coachmark.js";
|
4
|
+
import { usePostUserJourney as M, useGetUserJourney as V } from "../user-journey-api/user-journey-api.js";
|
5
|
+
import { Overlay as G } from "./journey-styled.js";
|
6
|
+
const F = N(null), I = ({ children: b, appId: i, userId: u }) => {
|
7
|
+
const [U, q] = c(!1), [k, p] = c(null), [a, l] = c([]), [f, x] = c(!1), m = v(-1), t = v(void 0), w = v([]), [z, B] = c(!1), [A, D] = c({
|
8
8
|
height: window.innerHeight,
|
9
9
|
width: window.innerWidth
|
10
|
-
}), { post:
|
11
|
-
(e, r, o
|
12
|
-
var
|
13
|
-
if (
|
10
|
+
}), { post: _ } = M(), { data: C = null, get: $ } = V(), E = h(
|
11
|
+
(e, r, o) => {
|
12
|
+
var J, y;
|
13
|
+
if (a.length > 0) {
|
14
14
|
console.error(
|
15
15
|
`setJourney: Other Journey is already active, Current Journey: ${t.current}, New Journey Request: ${e}`
|
16
16
|
);
|
17
17
|
return;
|
18
18
|
}
|
19
|
-
x(!0),
|
20
|
-
r.map((
|
21
|
-
...
|
19
|
+
x(!0), t.current = e, m.current = -1, l(
|
20
|
+
r.map((n) => ({
|
21
|
+
...n,
|
22
22
|
isActive: !1
|
23
23
|
// New coachmarks are inactive by default
|
24
24
|
}))
|
25
|
-
), o && (
|
26
|
-
height: ((
|
27
|
-
width: ((
|
28
|
-
}),
|
25
|
+
), o && (D({
|
26
|
+
height: ((J = o.current) == null ? void 0 : J.clientHeight) || window.innerHeight,
|
27
|
+
width: ((y = o.current) == null ? void 0 : y.clientWidth) || window.innerWidth
|
28
|
+
}), B(!0));
|
29
29
|
},
|
30
|
-
[
|
31
|
-
),
|
32
|
-
|
30
|
+
[a.length]
|
31
|
+
), s = h(() => {
|
32
|
+
w.current.forEach((e) => {
|
33
33
|
clearTimeout(e);
|
34
|
-
}),
|
35
|
-
}, []),
|
34
|
+
}), w.current = [], t.current = void 0, m.current = -1, l([]), x(!1);
|
35
|
+
}, []), P = h(
|
36
36
|
(e) => {
|
37
|
-
|
38
|
-
app_id:
|
39
|
-
user_id:
|
37
|
+
s(), p((r) => r && !r.includes(e) ? [...r, e] : r), _({
|
38
|
+
app_id: i,
|
39
|
+
user_id: u,
|
40
40
|
journey_id: e,
|
41
41
|
journey_status: "COMPLETED"
|
42
42
|
});
|
43
43
|
},
|
44
|
-
[
|
45
|
-
),
|
44
|
+
[i, s, _, u]
|
45
|
+
), S = h((e, r) => {
|
46
46
|
if (!t.current || e !== t.current) {
|
47
47
|
console.error(
|
48
48
|
t.current ? `A Journey is already active, Current Journey: ${t.current}, New Journey Request: ${e}` : "addCoachmark was called before setJourney and Journey ID is undefined"
|
49
49
|
);
|
50
50
|
return;
|
51
51
|
}
|
52
|
-
|
52
|
+
l((o) => [
|
53
53
|
...o,
|
54
54
|
{
|
55
55
|
...r,
|
@@ -57,87 +57,86 @@ const K = W(null), re = ({ children: T, appId: a, userId: c }) => {
|
|
57
57
|
// New coachmarks are inactive by default
|
58
58
|
}
|
59
59
|
]);
|
60
|
-
}, []),
|
61
|
-
(e, r = !1, o = 0,
|
60
|
+
}, []), j = h(
|
61
|
+
(e, r = !1, o = 0, J = !1) => {
|
62
62
|
if (!t.current || e !== t.current) {
|
63
63
|
console.error(
|
64
64
|
t.current ? "nextCoachmark was called before setJourney" : `A Journey is already active, Current Journey: ${t.current}, New Journey Request: ${e}`
|
65
65
|
);
|
66
66
|
return;
|
67
67
|
}
|
68
|
-
|
69
|
-
const
|
70
|
-
clearTimeout(
|
68
|
+
q(J), o !== 0 && l((n) => n.map((d) => ({ ...d, isActive: !1 })));
|
69
|
+
const y = setTimeout(() => {
|
70
|
+
clearTimeout(y);
|
71
71
|
const n = m.current + 1;
|
72
|
-
|
73
|
-
if (n >=
|
74
|
-
return
|
72
|
+
l((d) => {
|
73
|
+
if (n >= d.length || d.length === 0)
|
74
|
+
return s(), [];
|
75
75
|
m.current = n;
|
76
|
-
const g = [...
|
76
|
+
const g = [...d];
|
77
77
|
return g[n].isActive = !0, n > 0 && (g[n - 1].isActive = r), g;
|
78
78
|
});
|
79
79
|
}, o);
|
80
|
-
|
80
|
+
w.current.push(y);
|
81
81
|
},
|
82
|
-
[
|
83
|
-
),
|
82
|
+
[s]
|
83
|
+
), H = R(
|
84
84
|
() => ({
|
85
|
-
nextCoachmark:
|
86
|
-
setJourney:
|
87
|
-
addCoachmark:
|
88
|
-
clearJourney:
|
89
|
-
endJourney:
|
90
|
-
coachmarks:
|
91
|
-
userCompletedJourneyIds:
|
92
|
-
isJourneyActive:
|
85
|
+
nextCoachmark: j,
|
86
|
+
setJourney: E,
|
87
|
+
addCoachmark: S,
|
88
|
+
clearJourney: s,
|
89
|
+
endJourney: P,
|
90
|
+
coachmarks: a,
|
91
|
+
userCompletedJourneyIds: k,
|
92
|
+
isJourneyActive: f
|
93
93
|
}),
|
94
94
|
[
|
95
|
+
j,
|
96
|
+
E,
|
95
97
|
S,
|
96
|
-
|
98
|
+
s,
|
97
99
|
P,
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
v,
|
102
|
-
J
|
100
|
+
a,
|
101
|
+
k,
|
102
|
+
f
|
103
103
|
]
|
104
104
|
);
|
105
|
-
return
|
106
|
-
|
107
|
-
app_id:
|
108
|
-
user_id:
|
105
|
+
return T(() => {
|
106
|
+
i && u && $(u, {
|
107
|
+
app_id: i,
|
108
|
+
user_id: u,
|
109
109
|
journey_status: "COMPLETED"
|
110
110
|
});
|
111
|
-
}, [
|
112
|
-
if (
|
113
|
-
const e =
|
111
|
+
}, [i, $, u]), T(() => {
|
112
|
+
if (C) {
|
113
|
+
const e = C.map((r) => r.journey_id);
|
114
114
|
p(e);
|
115
115
|
}
|
116
|
-
}, [
|
117
|
-
|
118
|
-
|
116
|
+
}, [C]), /* @__PURE__ */ L(F.Provider, { value: H, children: [
|
117
|
+
f && /* @__PURE__ */ O(
|
118
|
+
G,
|
119
119
|
{
|
120
120
|
about: "journey-overlay",
|
121
121
|
height: A.height,
|
122
122
|
width: A.width,
|
123
|
-
$isJourneyBlurred:
|
124
|
-
$isBlockingJourney: b,
|
123
|
+
$isJourneyBlurred: U,
|
125
124
|
"data-testid": t.current,
|
126
|
-
children:
|
127
|
-
|
125
|
+
children: a.map((e, r) => /* @__PURE__ */ O(
|
126
|
+
W,
|
128
127
|
{
|
129
128
|
coachmark: e,
|
130
|
-
isInsideScrollView:
|
129
|
+
isInsideScrollView: z
|
131
130
|
},
|
132
131
|
`coachmark-${r}`
|
133
132
|
))
|
134
133
|
}
|
135
134
|
),
|
136
|
-
|
135
|
+
b
|
137
136
|
] });
|
138
137
|
};
|
139
138
|
export {
|
140
|
-
|
141
|
-
|
139
|
+
F as JourneyContext,
|
140
|
+
I as JourneyProvider
|
142
141
|
};
|
143
142
|
//# sourceMappingURL=journey-context-provider.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"journey-context-provider.js","sources":["../../../../src/features/journey/use-journey/journey-context-provider.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport type { TJourneyId } from '../journey-id/journey-id-types';\nimport type {\n ICoachmarkProps,\n IJourneyContext,\n IJourneyProviderProps,\n TCoachmarkJourneyProps,\n} from './journey-context-types';\nimport type { FC, RefObject } from 'react';\n\nimport { createContext, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Coachmark } from '../comps/coachmark/coachmark';\nimport { useGetUserJourney, usePostUserJourney } from '../user-journey-api/user-journey-api';\nimport * as S from './journey-styled';\n\nexport const JourneyContext = createContext<IJourneyContext | null>(null);\n\nexport const JourneyProvider: FC<IJourneyProviderProps> = ({ children, appId, userId }) => {\n const [isBlockingJourney, setIsBlockingJourney] = useState<boolean>(true);\n const [isJourneyBlurred, setIsJourneyBlurred] = useState<boolean>(false);\n const [userCompletedJourneyIds, setUserCompletedJourneyIds] = useState<TJourneyId[] | null>(null);\n const [coachmarkList, setCoachmarkList] = useState<ICoachmarkProps[]>([]);\n const [isJourneyActive, setIsJourneyActive] = useState(false);\n const currentIndex = useRef(-1);\n const currentJourneyId = useRef<TJourneyId | undefined>(undefined);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const [isScrollableJourney, setIsScrollableJourney] = useState<boolean>(false);\n const [overlaySize, setOverlaySize] = useState({\n height: window.innerHeight,\n width: window.innerWidth,\n });\n\n const { post: postJourneyCompletion } = usePostUserJourney();\n const { data: userCompletedJourneys = null, get: getJourneyProgress } = useGetUserJourney();\n\n const setJourney = useCallback(\n (\n id: TJourneyId,\n coachmarks: TCoachmarkJourneyProps[],\n scrollableContRef?: RefObject<HTMLDivElement | null>,\n isBlocking: boolean = true,\n ) => {\n if (coachmarkList.length > 0) {\n console.error(\n `setJourney: Other Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n setIsJourneyActive(true);\n setIsBlockingJourney(isBlocking);\n currentJourneyId.current = id;\n currentIndex.current = -1;\n setCoachmarkList(\n coachmarks.map((item: TCoachmarkJourneyProps) => {\n return {\n ...item,\n isActive: false, // New coachmarks are inactive by default\n } as ICoachmarkProps;\n }),\n );\n if (scrollableContRef) {\n setOverlaySize({\n height: scrollableContRef.current?.clientHeight || window.innerHeight,\n width: scrollableContRef.current?.clientWidth || window.innerWidth,\n });\n setIsScrollableJourney(true);\n }\n },\n [coachmarkList.length],\n );\n\n const clearJourney = useCallback(() => {\n // Clear all timers\n timerRefs.current.forEach(timer => {\n clearTimeout(timer);\n });\n timerRefs.current = [];\n currentJourneyId.current = undefined;\n currentIndex.current = -1;\n setCoachmarkList([]);\n setIsJourneyActive(false);\n }, []);\n\n const endJourney = useCallback(\n (journeyId: TJourneyId) => {\n clearJourney();\n setUserCompletedJourneyIds(prev => {\n if (prev && !prev.includes(journeyId)) {\n return [...prev, journeyId];\n }\n\n return prev;\n });\n // fire the API (doesn’t block the UI)\n postJourneyCompletion({\n app_id: appId,\n user_id: userId,\n journey_id: journeyId,\n journey_status: 'COMPLETED',\n });\n },\n [appId, clearJourney, postJourneyCompletion, userId],\n );\n\n const addCoachmark = useCallback((id: TJourneyId, coachmark: TCoachmarkJourneyProps) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`\n : `addCoachmark was called before setJourney and Journey ID is undefined`,\n );\n\n return;\n }\n\n setCoachmarkList(prev => [\n ...prev,\n {\n ...coachmark,\n isActive: false, // New coachmarks are inactive by default\n } as ICoachmarkProps,\n ]);\n }, []);\n\n const nextCoachmark = useCallback(\n (\n id: TJourneyId,\n keepPrevActive: boolean = false,\n delayInMs: number = 0,\n shouldBlurNextJourney: boolean = false,\n ) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `nextCoachmark was called before setJourney`\n : `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n\n setIsJourneyBlurred(shouldBlurNextJourney);\n\n if (delayInMs !== 0) {\n // If delay is not 0, we will hide all them coachmarks and reveal only after the delay\n setCoachmarkList(prevList => {\n return prevList.map((item: TCoachmarkJourneyProps) => {\n return { ...item, isActive: false };\n });\n });\n }\n\n const timer = setTimeout(() => {\n clearTimeout(timer);\n const currIndex = currentIndex.current + 1;\n\n setCoachmarkList(prevList => {\n // Finish onboarding\n if (currIndex >= prevList.length || prevList.length === 0) {\n clearJourney();\n\n return [];\n }\n\n currentIndex.current = currIndex;\n const updatedCoachmarkList = [...prevList];\n\n (updatedCoachmarkList[currIndex] as ICoachmarkProps).isActive = true;\n\n if (currIndex > 0) {\n (updatedCoachmarkList[currIndex - 1] as ICoachmarkProps).isActive = keepPrevActive;\n }\n\n return updatedCoachmarkList;\n });\n }, delayInMs);\n\n timerRefs.current.push(timer);\n },\n [clearJourney],\n );\n\n const memoizedContextValue: IJourneyContext = useMemo(\n () => ({\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarks: coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n }),\n [\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n ],\n );\n\n // Get the initial state of incompleteJourneys\n useEffect(() => {\n if (appId && userId) {\n getJourneyProgress(userId, {\n app_id: appId,\n user_id: userId,\n journey_status: 'COMPLETED',\n });\n }\n }, [appId, getJourneyProgress, userId]);\n\n // Set the data to context state initially\n useEffect(() => {\n if (userCompletedJourneys) {\n const completedUserJourneysIds = userCompletedJourneys.map(journey => journey.journey_id);\n\n setUserCompletedJourneyIds(completedUserJourneysIds);\n }\n }, [userCompletedJourneys]);\n\n return (\n <JourneyContext.Provider value={memoizedContextValue}>\n {isJourneyActive && (\n <S.Overlay\n about=\"journey-overlay\"\n height={overlaySize.height}\n width={overlaySize.width}\n $isJourneyBlurred={isJourneyBlurred}\n $isBlockingJourney={isBlockingJourney}\n data-testid={currentJourneyId.current}\n >\n {coachmarkList.map((coachmark, index) => (\n <Coachmark\n key={`coachmark-${index}`}\n coachmark={coachmark}\n isInsideScrollView={isScrollableJourney}\n />\n ))}\n </S.Overlay>\n )}\n {children}\n </JourneyContext.Provider>\n );\n};\n"],"names":["JourneyContext","createContext","JourneyProvider","children","appId","userId","isBlockingJourney","setIsBlockingJourney","useState","isJourneyBlurred","setIsJourneyBlurred","userCompletedJourneyIds","setUserCompletedJourneyIds","coachmarkList","setCoachmarkList","isJourneyActive","setIsJourneyActive","currentIndex","useRef","currentJourneyId","timerRefs","isScrollableJourney","setIsScrollableJourney","overlaySize","setOverlaySize","postJourneyCompletion","usePostUserJourney","userCompletedJourneys","getJourneyProgress","useGetUserJourney","setJourney","useCallback","id","coachmarks","scrollableContRef","isBlocking","item","_a","_b","clearJourney","timer","endJourney","journeyId","prev","addCoachmark","coachmark","nextCoachmark","keepPrevActive","delayInMs","shouldBlurNextJourney","prevList","currIndex","updatedCoachmarkList","memoizedContextValue","useMemo","useEffect","completedUserJourneysIds","journey","jsxs","jsx","S.Overlay","index","Coachmark"],"mappings":";;;;;AAgBa,MAAAA,IAAiBC,EAAsC,IAAI,GAE3DC,KAA6C,CAAC,EAAE,UAAAC,GAAU,OAAAC,GAAO,QAAAC,QAAa;AACzF,QAAM,CAACC,GAAmBC,CAAoB,IAAIC,EAAkB,EAAI,GAClE,CAACC,GAAkBC,CAAmB,IAAIF,EAAkB,EAAK,GACjE,CAACG,GAAyBC,CAA0B,IAAIJ,EAA8B,IAAI,GAC1F,CAACK,GAAeC,CAAgB,IAAIN,EAA4B,CAAE,CAAA,GAClE,CAACO,GAAiBC,CAAkB,IAAIR,EAAS,EAAK,GACtDS,IAAeC,EAAO,EAAE,GACxBC,IAAmBD,EAA+B,MAAS,GAC3DE,IAAYF,EAAwC,CAAA,CAAE,GAEtD,CAACG,GAAqBC,CAAsB,IAAId,EAAkB,EAAK,GACvE,CAACe,GAAaC,CAAc,IAAIhB,EAAS;AAAA,IAC7C,QAAQ,OAAO;AAAA,IACf,OAAO,OAAO;AAAA,EAAA,CACf,GAEK,EAAE,MAAMiB,EAAsB,IAAIC,EAAmB,GACrD,EAAE,MAAMC,IAAwB,MAAM,KAAKC,EAAA,IAAuBC,KAElEC,IAAaC;AAAA,IACjB,CACEC,GACAC,GACAC,GACAC,IAAsB,OACnB;;AACC,UAAAtB,EAAc,SAAS,GAAG;AACpB,gBAAA;AAAA,UACN,iEAAiEM,EAAiB,OAAO,0BAA0Ba,CAAE;AAAA,QAAA;AAGvH;AAAA,MACF;AACA,MAAA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AAAA,MACZ,yBAAAF;AAAA,MACA,iBAAAI;AAAA,IAAA;AAAA,IAEF;AAAA,MACE+B;AAAA,MACAhB;AAAA,MACAc;AAAA,MACAL;AAAA,MACAE;AAAA,MACA5B;AAAA,MACAF;AAAA,MACAI;AAAA,IACF;AAAA,EAAA;AAIF,SAAAwC,EAAU,MAAM;AACd,IAAInD,KAASC,KACXuB,EAAmBvB,GAAQ;AAAA,MACzB,QAAQD;AAAA,MACR,SAASC;AAAA,MACT,gBAAgB;AAAA,IAAA,CACjB;AAAA,EAEF,GAAA,CAACD,GAAOwB,GAAoBvB,CAAM,CAAC,GAGtCkD,EAAU,MAAM;AACd,QAAI5B,GAAuB;AACzB,YAAM6B,IAA2B7B,EAAsB,IAAI,CAAA8B,MAAWA,EAAQ,UAAU;AAExF,MAAA7C,EAA2B4C,CAAwB;AAAA,IACrD;AAAA,EAAA,GACC,CAAC7B,CAAqB,CAAC,GAGvB,gBAAA+B,EAAA1D,EAAe,UAAf,EAAwB,OAAOqD,GAC7B,UAAA;AAAA,IACCtC,KAAA,gBAAA4C;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,QAAQrC,EAAY;AAAA,QACpB,OAAOA,EAAY;AAAA,QACnB,mBAAmBd;AAAA,QACnB,oBAAoBH;AAAA,QACpB,eAAaa,EAAiB;AAAA,QAE7B,UAAcN,EAAA,IAAI,CAACgC,GAAWgB,MAC7B,gBAAAF;AAAA,UAACG;AAAA,UAAA;AAAA,YAEC,WAAAjB;AAAA,YACA,oBAAoBxB;AAAA,UAAA;AAAA,UAFf,aAAawC,CAAK;AAAA,QAAA,CAI1B;AAAA,MAAA;AAAA,IACH;AAAA,IAED1D;AAAA,EACH,EAAA,CAAA;AAEJ;"}
|
1
|
+
{"version":3,"file":"journey-context-provider.js","sources":["../../../../src/features/journey/use-journey/journey-context-provider.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport type { TJourneyId } from '../journey-id/journey-id-types';\nimport type {\n ICoachmarkProps,\n IJourneyContext,\n IJourneyProviderProps,\n TCoachmarkJourneyProps,\n} from './journey-context-types';\nimport type { FC, RefObject } from 'react';\n\nimport { createContext, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Coachmark } from '../comps/coachmark/coachmark';\nimport { useGetUserJourney, usePostUserJourney } from '../user-journey-api/user-journey-api';\nimport * as S from './journey-styled';\n\nexport const JourneyContext = createContext<IJourneyContext | null>(null);\n\nexport const JourneyProvider: FC<IJourneyProviderProps> = ({ children, appId, userId }) => {\n const [isJourneyBlurred, setIsJourneyBlurred] = useState<boolean>(false);\n const [userCompletedJourneyIds, setUserCompletedJourneyIds] = useState<TJourneyId[] | null>(null);\n const [coachmarkList, setCoachmarkList] = useState<ICoachmarkProps[]>([]);\n const [isJourneyActive, setIsJourneyActive] = useState(false);\n const currentIndex = useRef(-1);\n const currentJourneyId = useRef<TJourneyId | undefined>(undefined);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const [isScrollableJourney, setIsScrollableJourney] = useState<boolean>(false);\n const [overlaySize, setOverlaySize] = useState({\n height: window.innerHeight,\n width: window.innerWidth,\n });\n\n const { post: postJourneyCompletion } = usePostUserJourney();\n const { data: userCompletedJourneys = null, get: getJourneyProgress } = useGetUserJourney();\n\n const setJourney = useCallback(\n (\n id: TJourneyId,\n coachmarks: TCoachmarkJourneyProps[],\n scrollableContRef?: RefObject<HTMLDivElement | null>,\n ) => {\n if (coachmarkList.length > 0) {\n console.error(\n `setJourney: Other Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n setIsJourneyActive(true);\n currentJourneyId.current = id;\n currentIndex.current = -1;\n setCoachmarkList(\n coachmarks.map((item: TCoachmarkJourneyProps) => {\n return {\n ...item,\n isActive: false, // New coachmarks are inactive by default\n } as ICoachmarkProps;\n }),\n );\n if (scrollableContRef) {\n setOverlaySize({\n height: scrollableContRef.current?.clientHeight || window.innerHeight,\n width: scrollableContRef.current?.clientWidth || window.innerWidth,\n });\n setIsScrollableJourney(true);\n }\n },\n [coachmarkList.length],\n );\n\n const clearJourney = useCallback(() => {\n // Clear all timers\n timerRefs.current.forEach(timer => {\n clearTimeout(timer);\n });\n timerRefs.current = [];\n currentJourneyId.current = undefined;\n currentIndex.current = -1;\n setCoachmarkList([]);\n setIsJourneyActive(false);\n }, []);\n\n const endJourney = useCallback(\n (journeyId: TJourneyId) => {\n clearJourney();\n setUserCompletedJourneyIds(prev => {\n if (prev && !prev.includes(journeyId)) {\n return [...prev, journeyId];\n }\n\n return prev;\n });\n // fire the API (doesn’t block the UI)\n postJourneyCompletion({\n app_id: appId,\n user_id: userId,\n journey_id: journeyId,\n journey_status: 'COMPLETED',\n });\n },\n [appId, clearJourney, postJourneyCompletion, userId],\n );\n\n const addCoachmark = useCallback((id: TJourneyId, coachmark: TCoachmarkJourneyProps) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`\n : `addCoachmark was called before setJourney and Journey ID is undefined`,\n );\n\n return;\n }\n\n setCoachmarkList(prev => [\n ...prev,\n {\n ...coachmark,\n isActive: false, // New coachmarks are inactive by default\n } as ICoachmarkProps,\n ]);\n }, []);\n\n const nextCoachmark = useCallback(\n (\n id: TJourneyId,\n keepPrevActive: boolean = false,\n delayInMs: number = 0,\n shouldBlurNextJourney: boolean = false,\n ) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `nextCoachmark was called before setJourney`\n : `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n\n setIsJourneyBlurred(shouldBlurNextJourney);\n\n if (delayInMs !== 0) {\n // If delay is not 0, we will hide all them coachmarks and reveal only after the delay\n setCoachmarkList(prevList => {\n return prevList.map((item: TCoachmarkJourneyProps) => {\n return { ...item, isActive: false };\n });\n });\n }\n\n const timer = setTimeout(() => {\n clearTimeout(timer);\n const currIndex = currentIndex.current + 1;\n\n setCoachmarkList(prevList => {\n // Finish onboarding\n if (currIndex >= prevList.length || prevList.length === 0) {\n clearJourney();\n\n return [];\n }\n\n currentIndex.current = currIndex;\n const updatedCoachmarkList = [...prevList];\n\n (updatedCoachmarkList[currIndex] as ICoachmarkProps).isActive = true;\n\n if (currIndex > 0) {\n (updatedCoachmarkList[currIndex - 1] as ICoachmarkProps).isActive = keepPrevActive;\n }\n\n return updatedCoachmarkList;\n });\n }, delayInMs);\n\n timerRefs.current.push(timer);\n },\n [clearJourney],\n );\n\n const memoizedContextValue: IJourneyContext = useMemo(\n () => ({\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarks: coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n }),\n [\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n ],\n );\n\n // Get the initial state of incompleteJourneys\n useEffect(() => {\n if (appId && userId) {\n getJourneyProgress(userId, {\n app_id: appId,\n user_id: userId,\n journey_status: 'COMPLETED',\n });\n }\n }, [appId, getJourneyProgress, userId]);\n\n // Set the data to context state initially\n useEffect(() => {\n if (userCompletedJourneys) {\n const completedUserJourneysIds = userCompletedJourneys.map(journey => journey.journey_id);\n\n setUserCompletedJourneyIds(completedUserJourneysIds);\n }\n }, [userCompletedJourneys]);\n\n return (\n <JourneyContext.Provider value={memoizedContextValue}>\n {isJourneyActive && (\n <S.Overlay\n about=\"journey-overlay\"\n height={overlaySize.height}\n width={overlaySize.width}\n $isJourneyBlurred={isJourneyBlurred}\n data-testid={currentJourneyId.current}\n >\n {coachmarkList.map((coachmark, index) => (\n <Coachmark\n key={`coachmark-${index}`}\n coachmark={coachmark}\n isInsideScrollView={isScrollableJourney}\n />\n ))}\n </S.Overlay>\n )}\n {children}\n </JourneyContext.Provider>\n );\n};\n"],"names":["JourneyContext","createContext","JourneyProvider","children","appId","userId","isJourneyBlurred","setIsJourneyBlurred","useState","userCompletedJourneyIds","setUserCompletedJourneyIds","coachmarkList","setCoachmarkList","isJourneyActive","setIsJourneyActive","currentIndex","useRef","currentJourneyId","timerRefs","isScrollableJourney","setIsScrollableJourney","overlaySize","setOverlaySize","postJourneyCompletion","usePostUserJourney","userCompletedJourneys","getJourneyProgress","useGetUserJourney","setJourney","useCallback","id","coachmarks","scrollableContRef","item","_a","_b","clearJourney","timer","endJourney","journeyId","prev","addCoachmark","coachmark","nextCoachmark","keepPrevActive","delayInMs","shouldBlurNextJourney","prevList","currIndex","updatedCoachmarkList","memoizedContextValue","useMemo","useEffect","completedUserJourneysIds","journey","jsxs","jsx","S.Overlay","index","Coachmark"],"mappings":";;;;;AAgBa,MAAAA,IAAiBC,EAAsC,IAAI,GAE3DC,IAA6C,CAAC,EAAE,UAAAC,GAAU,OAAAC,GAAO,QAAAC,QAAa;AACzF,QAAM,CAACC,GAAkBC,CAAmB,IAAIC,EAAkB,EAAK,GACjE,CAACC,GAAyBC,CAA0B,IAAIF,EAA8B,IAAI,GAC1F,CAACG,GAAeC,CAAgB,IAAIJ,EAA4B,CAAE,CAAA,GAClE,CAACK,GAAiBC,CAAkB,IAAIN,EAAS,EAAK,GACtDO,IAAeC,EAAO,EAAE,GACxBC,IAAmBD,EAA+B,MAAS,GAC3DE,IAAYF,EAAwC,CAAA,CAAE,GAEtD,CAACG,GAAqBC,CAAsB,IAAIZ,EAAkB,EAAK,GACvE,CAACa,GAAaC,CAAc,IAAId,EAAS;AAAA,IAC7C,QAAQ,OAAO;AAAA,IACf,OAAO,OAAO;AAAA,EAAA,CACf,GAEK,EAAE,MAAMe,EAAsB,IAAIC,EAAmB,GACrD,EAAE,MAAMC,IAAwB,MAAM,KAAKC,EAAA,IAAuBC,KAElEC,IAAaC;AAAA,IACjB,CACEC,GACAC,GACAC,MACG;;AACC,UAAArB,EAAc,SAAS,GAAG;AACpB,gBAAA;AA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position: absolute;
|
4
4
|
top: 0;
|
5
5
|
right: 0;
|
6
6
|
bottom: 0;
|
7
7
|
left: 0;
|
8
|
-
z-index: ${({
|
9
|
-
pointer-events: ${({ $isBlockingJourney: t }) => t ? "auto" : "none"};
|
10
|
-
|
8
|
+
z-index: ${({ theme: t }) => t.zIndex.JOURNEY_OVERLAY};
|
11
9
|
height: ${({ height: t }) => t}px;
|
12
10
|
width: ${({ width: t }) => t}px;
|
13
|
-
${({ $isJourneyBlurred: t, theme: o }) => t &&
|
11
|
+
${({ $isJourneyBlurred: t, theme: o }) => t && e`
|
14
12
|
background: ${o.colors.BLACK_T_38};
|
15
13
|
backdrop-filter: blur(80px);
|
16
14
|
-webkit-backdrop-filter: blur(80px);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"journey-styled.js","sources":["../../../../src/features/journey/use-journey/journey-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { css } from 'styled-components';\n\nexport const Overlay = styled.div<{\n $isJourneyBlurred: boolean;\n
|
1
|
+
{"version":3,"file":"journey-styled.js","sources":["../../../../src/features/journey/use-journey/journey-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { css } from 'styled-components';\n\nexport const Overlay = styled.div<{\n $isJourneyBlurred: boolean;\n height: number;\n width: number;\n}>`\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: ${({ theme }) => theme.zIndex.JOURNEY_OVERLAY};\n height: ${({ height }) => height}px;\n width: ${({ width }) => width}px;\n ${({ $isJourneyBlurred, theme }) =>\n $isJourneyBlurred &&\n css`\n background: ${theme.colors.BLACK_T_38};\n backdrop-filter: blur(80px);\n -webkit-backdrop-filter: blur(80px);\n `}\n`;\n"],"names":["Overlay","styled","theme","height","width","$isJourneyBlurred","css"],"mappings":";AAGO,MAAMA,IAAUC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAUjB,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,eAAe;AAAA,YAC5C,CAAC,EAAE,QAAAC,EAAO,MAAMA,CAAM;AAAA,WACvB,CAAC,EAAE,OAAAC,EAAM,MAAMA,CAAK;AAAA,IAC3B,CAAC,EAAE,mBAAAC,GAAmB,OAAAH,EAAA,MACtBG,KACAC;AAAA,oBACgBJ,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA,KAGtC;AAAA;"}
|
@@ -0,0 +1,234 @@
|
|
1
|
+
const t = [
|
2
|
+
{
|
3
|
+
id: "star-struck",
|
4
|
+
emoji: "🤩",
|
5
|
+
name: "Star-Struck",
|
6
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f929/lottie.json"
|
7
|
+
},
|
8
|
+
{
|
9
|
+
id: "heart-eyes",
|
10
|
+
emoji: "😍",
|
11
|
+
name: "Heart Eyes",
|
12
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f60d/lottie.json"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
id: "holding-back-tears",
|
16
|
+
emoji: "🥹",
|
17
|
+
name: "Holding Back Tears",
|
18
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f979/lottie.json"
|
19
|
+
},
|
20
|
+
{
|
21
|
+
id: "sunglasses",
|
22
|
+
emoji: "😎",
|
23
|
+
name: "Sunglasses",
|
24
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f60e/lottie.json"
|
25
|
+
},
|
26
|
+
{
|
27
|
+
id: "exploding-head",
|
28
|
+
emoji: "🤯",
|
29
|
+
name: "Exploding Head",
|
30
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f92f/lottie.json"
|
31
|
+
},
|
32
|
+
{
|
33
|
+
id: "thinking",
|
34
|
+
emoji: "🤔",
|
35
|
+
name: "Thinking",
|
36
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f914/lottie.json"
|
37
|
+
},
|
38
|
+
{
|
39
|
+
id: "party",
|
40
|
+
emoji: "🥳",
|
41
|
+
name: "Party",
|
42
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f973/lottie.json"
|
43
|
+
},
|
44
|
+
{
|
45
|
+
id: "confetti-ball",
|
46
|
+
emoji: "🎊",
|
47
|
+
name: "Confetti Ball",
|
48
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f38a/lottie.json"
|
49
|
+
},
|
50
|
+
{
|
51
|
+
id: "celebration",
|
52
|
+
emoji: "🎉",
|
53
|
+
name: "Celebration",
|
54
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f389/lottie.json"
|
55
|
+
},
|
56
|
+
{
|
57
|
+
id: "balloon",
|
58
|
+
emoji: "🎈",
|
59
|
+
name: "Balloon",
|
60
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f388/lottie.json"
|
61
|
+
},
|
62
|
+
{
|
63
|
+
id: "cake",
|
64
|
+
emoji: "🎂",
|
65
|
+
name: "Cake",
|
66
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f382/lottie.json"
|
67
|
+
},
|
68
|
+
{
|
69
|
+
id: "clapping",
|
70
|
+
emoji: "👏",
|
71
|
+
name: "Clapping",
|
72
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f44f/lottie.json"
|
73
|
+
},
|
74
|
+
{
|
75
|
+
id: "thumbs-up",
|
76
|
+
emoji: "👍",
|
77
|
+
name: "Thumbs Up",
|
78
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f44d/lottie.json"
|
79
|
+
},
|
80
|
+
{
|
81
|
+
id: "peace",
|
82
|
+
emoji: "✌️",
|
83
|
+
name: "Peace",
|
84
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/270c_fe0f/lottie.json"
|
85
|
+
},
|
86
|
+
{
|
87
|
+
id: "ok-hand",
|
88
|
+
emoji: "👌",
|
89
|
+
name: "OK Hand",
|
90
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f44c/lottie.json"
|
91
|
+
},
|
92
|
+
{
|
93
|
+
id: "muscle",
|
94
|
+
emoji: "💪",
|
95
|
+
name: "Muscle",
|
96
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f4aa/lottie.json"
|
97
|
+
},
|
98
|
+
{
|
99
|
+
id: "rock-on",
|
100
|
+
emoji: "🤟",
|
101
|
+
name: "Rock On",
|
102
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f91f/lottie.json"
|
103
|
+
},
|
104
|
+
{
|
105
|
+
id: "heart",
|
106
|
+
emoji: "❤️",
|
107
|
+
name: "Heart",
|
108
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/2764_fe0f/lottie.json"
|
109
|
+
},
|
110
|
+
{
|
111
|
+
id: "trophy",
|
112
|
+
emoji: "🏆",
|
113
|
+
name: "Trophy",
|
114
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f3c6/lottie.json"
|
115
|
+
},
|
116
|
+
{
|
117
|
+
id: "hundred",
|
118
|
+
emoji: "💯",
|
119
|
+
name: "Hundred",
|
120
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f4af/lottie.json"
|
121
|
+
},
|
122
|
+
{
|
123
|
+
id: "gold-medal",
|
124
|
+
emoji: "🥇",
|
125
|
+
name: "Gold Medal",
|
126
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f947/lottie.json"
|
127
|
+
},
|
128
|
+
{
|
129
|
+
id: "silver-medal",
|
130
|
+
emoji: "🥈",
|
131
|
+
name: "Silver Medal",
|
132
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f948/lottie.json"
|
133
|
+
},
|
134
|
+
{
|
135
|
+
id: "bronze-medal",
|
136
|
+
emoji: "🥉",
|
137
|
+
name: "Bronze Medal",
|
138
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f949/lottie.json"
|
139
|
+
},
|
140
|
+
{
|
141
|
+
id: "target",
|
142
|
+
emoji: "🎯",
|
143
|
+
name: "Target",
|
144
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f3af/lottie.json"
|
145
|
+
},
|
146
|
+
{
|
147
|
+
id: "glowing-star",
|
148
|
+
emoji: "🌟",
|
149
|
+
name: "Glowing Star",
|
150
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f31f/lottie.json"
|
151
|
+
},
|
152
|
+
{
|
153
|
+
id: "lightning",
|
154
|
+
emoji: "⚡️",
|
155
|
+
name: "Lightning",
|
156
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/26a1/lottie.json"
|
157
|
+
},
|
158
|
+
{
|
159
|
+
id: "rocket",
|
160
|
+
emoji: "🚀",
|
161
|
+
name: "Rocket",
|
162
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/lottie.json"
|
163
|
+
},
|
164
|
+
{
|
165
|
+
id: "explosion",
|
166
|
+
emoji: "💥",
|
167
|
+
name: "Explosion",
|
168
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f4a5/lottie.json"
|
169
|
+
},
|
170
|
+
{
|
171
|
+
id: "graduation",
|
172
|
+
emoji: "🎓",
|
173
|
+
name: "Graduation",
|
174
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f393/lottie.json"
|
175
|
+
},
|
176
|
+
{
|
177
|
+
id: "clock",
|
178
|
+
emoji: "⏰",
|
179
|
+
name: "Clock",
|
180
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/23f0/lottie.json"
|
181
|
+
},
|
182
|
+
{
|
183
|
+
id: "bulb",
|
184
|
+
emoji: "💡",
|
185
|
+
name: "Bulb",
|
186
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f4a1/lottie.json"
|
187
|
+
},
|
188
|
+
{
|
189
|
+
id: "rainbow",
|
190
|
+
emoji: "🌈",
|
191
|
+
name: "Rainbow",
|
192
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f308/lottie.json"
|
193
|
+
},
|
194
|
+
{
|
195
|
+
id: "clown",
|
196
|
+
emoji: "🤡",
|
197
|
+
name: "Clown",
|
198
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f921/lottie.json"
|
199
|
+
},
|
200
|
+
{
|
201
|
+
id: "dancer",
|
202
|
+
emoji: "💃",
|
203
|
+
name: "Dancer",
|
204
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f483/lottie.json"
|
205
|
+
},
|
206
|
+
{
|
207
|
+
id: "flowers",
|
208
|
+
emoji: "💐",
|
209
|
+
name: "Flowers",
|
210
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f490/lottie.json"
|
211
|
+
},
|
212
|
+
{
|
213
|
+
id: "unicorn",
|
214
|
+
emoji: "🦄",
|
215
|
+
name: "Unicorn",
|
216
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f984/lottie.json"
|
217
|
+
},
|
218
|
+
{
|
219
|
+
id: "drum",
|
220
|
+
emoji: "🥁",
|
221
|
+
name: "Drum",
|
222
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f941/lottie.json"
|
223
|
+
},
|
224
|
+
{
|
225
|
+
id: "diamond",
|
226
|
+
emoji: "💎",
|
227
|
+
name: "Diamond",
|
228
|
+
lottieUrl: "https://fonts.gstatic.com/s/e/notoemoji/latest/1f48e/lottie.json"
|
229
|
+
}
|
230
|
+
];
|
231
|
+
export {
|
232
|
+
t as stickerData
|
233
|
+
};
|
234
|
+
//# sourceMappingURL=sticker-data.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"sticker-data.js","sources":["../../../src/features/stickers/sticker-data.ts"],"sourcesContent":["import type { IStickerData } from './sticker-selector/sticker-selector-types';\n\nexport const stickerData: IStickerData[] = [\n {\n id: 'star-struck',\n emoji: '🤩',\n name: 'Star-Struck',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f929/lottie.json',\n },\n {\n id: 'heart-eyes',\n emoji: '😍',\n name: 'Heart Eyes',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f60d/lottie.json',\n },\n {\n id: 'holding-back-tears',\n emoji: '🥹',\n name: 'Holding Back Tears',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f979/lottie.json',\n },\n {\n id: 'sunglasses',\n emoji: '😎',\n name: 'Sunglasses',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f60e/lottie.json',\n },\n {\n id: 'exploding-head',\n emoji: '🤯',\n name: 'Exploding Head',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f92f/lottie.json',\n },\n {\n id: 'thinking',\n emoji: '🤔',\n name: 'Thinking',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f914/lottie.json',\n },\n {\n id: 'party',\n emoji: '🥳',\n name: 'Party',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f973/lottie.json',\n },\n {\n id: 'confetti-ball',\n emoji: '🎊',\n name: 'Confetti Ball',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f38a/lottie.json',\n },\n {\n id: 'celebration',\n emoji: '🎉',\n name: 'Celebration',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f389/lottie.json',\n },\n {\n id: 'balloon',\n emoji: '🎈',\n name: 'Balloon',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f388/lottie.json',\n },\n {\n id: 'cake',\n emoji: '🎂',\n name: 'Cake',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f382/lottie.json',\n },\n {\n id: 'clapping',\n emoji: '👏',\n name: 'Clapping',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f44f/lottie.json',\n },\n {\n id: 'thumbs-up',\n emoji: '👍',\n name: 'Thumbs Up',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f44d/lottie.json',\n },\n {\n id: 'peace',\n emoji: '✌️',\n name: 'Peace',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/270c_fe0f/lottie.json',\n },\n {\n id: 'ok-hand',\n emoji: '👌',\n name: 'OK Hand',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f44c/lottie.json',\n },\n {\n id: 'muscle',\n emoji: '💪',\n name: 'Muscle',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f4aa/lottie.json',\n },\n {\n id: 'rock-on',\n emoji: '🤟',\n name: 'Rock On',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f91f/lottie.json',\n },\n {\n id: 'heart',\n emoji: '❤️',\n name: 'Heart',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/2764_fe0f/lottie.json',\n },\n {\n id: 'trophy',\n emoji: '🏆',\n name: 'Trophy',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f3c6/lottie.json',\n },\n {\n id: 'hundred',\n emoji: '💯',\n name: 'Hundred',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f4af/lottie.json',\n },\n {\n id: 'gold-medal',\n emoji: '🥇',\n name: 'Gold Medal',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f947/lottie.json',\n },\n {\n id: 'silver-medal',\n emoji: '🥈',\n name: 'Silver Medal',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f948/lottie.json',\n },\n {\n id: 'bronze-medal',\n emoji: '🥉',\n name: 'Bronze Medal',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f949/lottie.json',\n },\n {\n id: 'target',\n emoji: '🎯',\n name: 'Target',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f3af/lottie.json',\n },\n {\n id: 'glowing-star',\n emoji: '🌟',\n name: 'Glowing Star',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f31f/lottie.json',\n },\n {\n id: 'lightning',\n emoji: '⚡️',\n name: 'Lightning',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/26a1/lottie.json',\n },\n {\n id: 'rocket',\n emoji: '🚀',\n name: 'Rocket',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/lottie.json',\n },\n {\n id: 'explosion',\n emoji: '💥',\n name: 'Explosion',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f4a5/lottie.json',\n },\n {\n id: 'graduation',\n emoji: '🎓',\n name: 'Graduation',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f393/lottie.json',\n },\n {\n id: 'clock',\n emoji: '⏰',\n name: 'Clock',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/23f0/lottie.json',\n },\n {\n id: 'bulb',\n emoji: '💡',\n name: 'Bulb',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f4a1/lottie.json',\n },\n {\n id: 'rainbow',\n emoji: '🌈',\n name: 'Rainbow',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f308/lottie.json',\n },\n {\n id: 'clown',\n emoji: '🤡',\n name: 'Clown',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f921/lottie.json',\n },\n {\n id: 'dancer',\n emoji: '💃',\n name: 'Dancer',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f483/lottie.json',\n },\n {\n id: 'flowers',\n emoji: '💐',\n name: 'Flowers',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f490/lottie.json',\n },\n {\n id: 'unicorn',\n emoji: '🦄',\n name: 'Unicorn',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f984/lottie.json',\n },\n {\n id: 'drum',\n emoji: '🥁',\n name: 'Drum',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f941/lottie.json',\n },\n {\n id: 'diamond',\n emoji: '💎',\n name: 'Diamond',\n lottieUrl: 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f48e/lottie.json',\n },\n];\n"],"names":["stickerData"],"mappings":"AAEO,MAAMA,IAA8B;AAAA,EACzC;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA,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IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AACF;"}
|
@@ -36,11 +36,12 @@ const e = r.div`
|
|
36
36
|
left: 50%;
|
37
37
|
width: ${({ $size: t }) => typeof t == "number" ? `${t * 0.7}px` : t};
|
38
38
|
height: ${({ $size: t }) => typeof t == "number" ? `${t * 0.7}px` : t};
|
39
|
-
opacity: 0;
|
40
|
-
transition: opacity 0.2s ease;
|
41
39
|
transform: translate(-50%, -50%);
|
42
40
|
pointer-events: none;
|
43
41
|
|
42
|
+
opacity: ${({ $visible: t }) => t ? 1 : 0};
|
43
|
+
transition: opacity 0.2s ease;
|
44
|
+
|
44
45
|
${e}:hover & {
|
45
46
|
opacity: 1;
|
46
47
|
}
|
@@ -83,4 +84,4 @@ export {
|
|
83
84
|
i as StickerGrid,
|
84
85
|
c as StickerGridContainer
|
85
86
|
};
|
86
|
-
//# sourceMappingURL=sticker-
|
87
|
+
//# sourceMappingURL=sticker-selector-styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"sticker-selector-styles.js","sources":["../../../../src/features/stickers/sticker-selector/sticker-selector-styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StickerContainer = styled.div<{\n $size: number | string;\n $disabled?: boolean;\n}>`\n position: relative;\n width: ${({ $size }) => (typeof $size === 'number' ? `${$size}px` : $size)};\n height: ${({ $size }) => (typeof $size === 'number' ? `${$size}px` : $size)};\n cursor: ${({ $disabled }) => ($disabled ? 'none' : 'pointer')};\n border-radius: 8px;\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n background-color: transparent;\n opacity: ${({ $disabled }) => ($disabled ? 0.5 : 1)};\n\n &:hover {\n transform: ${({ $disabled }) => ($disabled ? 'none' : 'scale(1.1)')};\n background-color: rgba(255, 255, 255, 0.1);\n }\n\n &:active {\n transform: ${({ $disabled }) => ($disabled ? 'none' : 'scale(0.95)')};\n }\n`;\n\nexport const StaticEmoji = styled.div<{ $size: number | string }>`\n font-size: ${({ $size }) => {\n if (typeof $size === 'number') {\n return `${$size * 0.7}px`;\n }\n\n return '70%';\n }};\n line-height: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n transition: opacity 0.2s ease;\n`;\n\nexport const LottieContainer = styled.div<{\n $size: number | string;\n $visible?: boolean; // ← NEW\n}>`\n position: absolute;\n top: 50%;\n left: 50%;\n width: ${({ $size }) => (typeof $size === 'number' ? `${$size * 0.7}px` : $size)};\n height: ${({ $size }) => (typeof $size === 'number' ? `${$size * 0.7}px` : $size)};\n transform: translate(-50%, -50%);\n pointer-events: none;\n\n opacity: ${({ $visible }) => ($visible ? 1 : 0)};\n transition: opacity 0.2s ease;\n\n ${StickerContainer}:hover & {\n opacity: 1;\n }\n`;\n\nexport const StickerGrid = styled.div<{\n $columns: number;\n $gap: number;\n}>`\n display: grid;\n grid-template-columns: repeat(${({ $columns }) => $columns}, 1fr);\n gap: ${({ $gap }) => $gap}px;\n padding: 16px;\n background-color: #2a2a2a;\n border-radius: 12px;\n max-height: 400px;\n overflow-y: auto;\n\n &::-webkit-scrollbar {\n width: 8px;\n }\n\n &::-webkit-scrollbar-track {\n background: rgba(255, 255, 255, 0.1);\n border-radius: 4px;\n }\n\n &::-webkit-scrollbar-thumb {\n background: rgba(255, 255, 255, 0.3);\n border-radius: 4px;\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background: rgba(255, 255, 255, 0.5);\n }\n`;\n\nexport const StickerGridContainer = styled.div<{\n $width: string;\n $height: string;\n}>`\n width: 100%;\n max-width: ${({ $width }) => $width};\n max-height: ${({ $height }) => $height};\n`;\n"],"names":["StickerContainer","styled","$size","$disabled","StaticEmoji","LottieContainer","$visible","StickerGrid","$columns","$gap","StickerGridContainer","$width","$height"],"mappings":";AAEO,MAAMA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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GA0BdC,IAAuBT,EAAO;AAAA;AAAA,eAK5B,CAAC,EAAE,QAAAU,EAAO,MAAMA,CAAM;AAAA,gBACrB,CAAC,EAAE,SAAAC,EAAQ,MAAMA,CAAO;AAAA;"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
2
|
+
import { memo as a } from "react";
|
3
|
+
import { stickerData as d } from "../sticker-data.js";
|
4
|
+
import l from "./sticker.js";
|
5
|
+
import { StickerGridContainer as f, StickerGrid as h } from "./sticker-selector-styles.js";
|
6
|
+
const n = ({
|
7
|
+
stickers: e = d,
|
8
|
+
columns: m = 4,
|
9
|
+
gap: i = 8,
|
10
|
+
stickerSize: p = 48,
|
11
|
+
onStickerClick: o
|
12
|
+
}) => /* @__PURE__ */ t(f, { $width: "350px", $height: "400px", children: /* @__PURE__ */ t(h, { $columns: m, $gap: i, children: e.map((r) => /* @__PURE__ */ t(
|
13
|
+
l,
|
14
|
+
{
|
15
|
+
emoji: r.emoji,
|
16
|
+
lottieUrl: r.lottieUrl,
|
17
|
+
size: p,
|
18
|
+
onClick: () => o == null ? void 0 : o(r)
|
19
|
+
},
|
20
|
+
r.id
|
21
|
+
)) }) }), u = a(n);
|
22
|
+
export {
|
23
|
+
u as default
|
24
|
+
};
|
25
|
+
//# sourceMappingURL=sticker-selector.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"sticker-selector.js","sources":["../../../../src/features/stickers/sticker-selector/sticker-selector.tsx"],"sourcesContent":["import type { IStickerSelectorProps } from './sticker-selector-types';\n\nimport React, { memo } from 'react';\n\nimport { stickerData } from '../sticker-data';\nimport Sticker from './sticker';\nimport * as S from './sticker-selector-styles';\n\nconst StickerSelector: React.FC<IStickerSelectorProps> = ({\n stickers = stickerData,\n columns = 4,\n gap = 8,\n stickerSize = 48,\n onStickerClick,\n}) => {\n return (\n <S.StickerGridContainer $width=\"350px\" $height=\"400px\">\n <S.StickerGrid $columns={columns} $gap={gap}>\n {stickers.map(sticker => (\n <Sticker\n key={sticker.id}\n emoji={sticker.emoji}\n lottieUrl={sticker.lottieUrl}\n size={stickerSize}\n onClick={() => onStickerClick?.(sticker)}\n />\n ))}\n </S.StickerGrid>\n </S.StickerGridContainer>\n );\n};\n\nexport default memo(StickerSelector);\n"],"names":["StickerSelector","stickers","stickerData","columns","gap","stickerSize","onStickerClick","S.StickerGridContainer","jsx","S.StickerGrid","sticker","Sticker","stickerSelector","memo"],"mappings":";;;;;AAQA,MAAMA,IAAmD,CAAC;AAAA,EACxD,UAAAC,IAAWC;AAAA,EACX,SAAAC,IAAU;AAAA,EACV,KAAAC,IAAM;AAAA,EACN,aAAAC,IAAc;AAAA,EACd,gBAAAC;AACF,wBAEKC,GAAA,EAAuB,QAAO,SAAQ,SAAQ,SAC7C,UAAA,gBAAAC,EAACC,GAAA,EAAc,UAAUN,GAAS,MAAMC,GACrC,UAAAH,EAAS,IAAI,CACZS,MAAA,gBAAAF;AAAA,EAACG;AAAA,EAAA;AAAA,IAEC,OAAOD,EAAQ;AAAA,IACf,WAAWA,EAAQ;AAAA,IACnB,MAAML;AAAA,IACN,SAAS,MAAMC,KAAA,gBAAAA,EAAiBI;AAAA,EAAO;AAAA,EAJlCA,EAAQ;AAAA,CAMhB,GACH,EACF,CAAA,GAIWE,IAAAC,EAAKb,CAAe;"}
|