@epam/ai-dial-celebrations 1.3.0-dev.234 → 1.3.0-dev.241
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/halloween.js +3158 -3333
- package/index.css +1 -1
- package/models/lottie-scene.d.ts +7 -0
- package/models/lottie-scene.d.ts.map +1 -1
- package/new-year/components/NewYear/NewYearSceneOverlay.d.ts.map +1 -1
- package/new-year/components/NewYearSnowmanDelivery/NewYearSnowmanDelivery.d.ts +5 -0
- package/new-year/components/NewYearSnowmanDelivery/NewYearSnowmanDelivery.d.ts.map +1 -0
- package/new-year/components/NewYearSnowmanDelivery/SnowmanDeliveryStill.d.ts +4 -0
- package/new-year/components/NewYearSnowmanDelivery/SnowmanDeliveryStill.d.ts.map +1 -0
- package/new-year/constants/labels.d.ts +1 -0
- package/new-year/constants/labels.d.ts.map +1 -1
- package/new-year/constants/new-year.d.ts +2 -2
- package/new-year/constants/new-year.d.ts.map +1 -1
- package/new-year/event.d.ts.map +1 -1
- package/new-year/models/labels.d.ts +2 -0
- package/new-year/models/labels.d.ts.map +1 -1
- package/new-year/types/new-year.d.ts +16 -1
- package/new-year/types/new-year.d.ts.map +1 -1
- package/new-year/utils/snowman-delivery-animation.d.ts +7 -0
- package/new-year/utils/snowman-delivery-animation.d.ts.map +1 -0
- package/new-year/utils/snowman-delivery-art.d.ts +96 -0
- package/new-year/utils/snowman-delivery-art.d.ts.map +1 -0
- package/new-year/utils/snowman-delivery-card.d.ts +12 -0
- package/new-year/utils/snowman-delivery-card.d.ts.map +1 -0
- package/new-year/utils/snowman-delivery-composition.d.ts +161 -0
- package/new-year/utils/snowman-delivery-composition.d.ts.map +1 -0
- package/new-year/utils/snowman-delivery-rig.d.ts +87 -0
- package/new-year/utils/snowman-delivery-rig.d.ts.map +1 -0
- package/new-year/utils/snowman-delivery-targets.d.ts +65 -0
- package/new-year/utils/snowman-delivery-targets.d.ts.map +1 -0
- package/new-year/utils/snowman-delivery-timeline.d.ts +47 -0
- package/new-year/utils/snowman-delivery-timeline.d.ts.map +1 -0
- package/new-year.js +2123 -586
- package/package.json +2 -2
- package/scene-targets-BgiQPucY.js +184 -0
- package/utils/lottie-scene-session.d.ts.map +1 -1
- package/useReducedMotion-BWIeAFB_.js +0 -8
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-celebrations",
|
|
3
3
|
"description": "Seasonal start-page celebrations with lazily loaded Halloween and New Year scenes that hosts can switch on and off one by one",
|
|
4
|
-
"version": "1.3.0-dev.
|
|
4
|
+
"version": "1.3.0-dev.241",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"react-error-boundary": "^6.1.5"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@epam/ai-dial-chat-shared": "1.3.0-dev.
|
|
34
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.241",
|
|
35
35
|
"@epam/ai-dial-ui-kit": "^0.16.0-dev.45",
|
|
36
36
|
"react": "^19.2.8",
|
|
37
37
|
"react-dom": "^19.2.8"
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { i as e } from "./CelebrationEnvironmentContext-BxzY78Zg.js";
|
|
2
|
+
import { useSyncExternalStore as t } from "react";
|
|
3
|
+
//#region src/hooks/useReducedMotion.ts
|
|
4
|
+
var n = "(prefers-reduced-motion: reduce)", r = (e) => {
|
|
5
|
+
let t = window.matchMedia?.(n);
|
|
6
|
+
return t?.addEventListener("change", e), () => t?.removeEventListener("change", e);
|
|
7
|
+
}, i = () => window.matchMedia?.(n).matches ?? !1, a = () => t(r, i, () => !0), o = 0, s = (e, t) => {
|
|
8
|
+
let n = [e, ...e.querySelectorAll("*")];
|
|
9
|
+
if (n.length > 1500) throw Error("Decorative snapshot exceeds its node budget");
|
|
10
|
+
let r = e.cloneNode(!0), i = [r, ...r.querySelectorAll("*")], a = `celebration-copy-${++o}-`, s = /* @__PURE__ */ new Map();
|
|
11
|
+
n.forEach((e, t) => {
|
|
12
|
+
let n = i[t], r = getComputedStyle(e);
|
|
13
|
+
for (let e of Array.from(r)) n.style.setProperty(e, r.getPropertyValue(e));
|
|
14
|
+
n.style.animation = "none", n.style.transition = "none", n.id &&= (s.set(n.id, `${a}${t}`), `${a}${t}`), e instanceof HTMLTextAreaElement && n instanceof HTMLTextAreaElement && (n.value = e.value), e instanceof HTMLInputElement && n instanceof HTMLInputElement && e.type !== "file" && (n.value = e.value, n.checked = e.checked), n.removeAttribute("autofocus"), n.removeAttribute("name"), n.tagName.toLowerCase() === "a" && n.removeAttribute("href");
|
|
15
|
+
}), i.forEach((e) => {
|
|
16
|
+
for (let t of [
|
|
17
|
+
"fill",
|
|
18
|
+
"stroke",
|
|
19
|
+
"clip-path",
|
|
20
|
+
"mask",
|
|
21
|
+
"filter"
|
|
22
|
+
]) {
|
|
23
|
+
let n = e.getAttribute(t)?.match(/^url\(#(.+)\)$/)?.[1];
|
|
24
|
+
if (n && s.has(n)) {
|
|
25
|
+
let r = `url(#${s.get(n)})`;
|
|
26
|
+
e.setAttribute(t, r), e.style.setProperty(t, r);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}), Object.assign(r.style, {
|
|
30
|
+
position: "relative",
|
|
31
|
+
inset: "auto",
|
|
32
|
+
margin: "0",
|
|
33
|
+
transform: "none",
|
|
34
|
+
width: `${t.width}px`,
|
|
35
|
+
height: `${t.height}px`,
|
|
36
|
+
minWidth: "0",
|
|
37
|
+
minHeight: "0",
|
|
38
|
+
maxWidth: "none",
|
|
39
|
+
maxHeight: "none",
|
|
40
|
+
animation: "none",
|
|
41
|
+
transition: "none"
|
|
42
|
+
});
|
|
43
|
+
let c = document.createElement("div");
|
|
44
|
+
return c.inert = !0, c.setAttribute("aria-hidden", "true"), Object.assign(c.style, {
|
|
45
|
+
position: "absolute",
|
|
46
|
+
left: `${t.left}px`,
|
|
47
|
+
top: `${t.top}px`,
|
|
48
|
+
width: `${t.width}px`,
|
|
49
|
+
height: `${t.height}px`,
|
|
50
|
+
overflow: "hidden",
|
|
51
|
+
pointerEvents: "none",
|
|
52
|
+
margin: "0",
|
|
53
|
+
transformOrigin: "center"
|
|
54
|
+
}), c.appendChild(r), c.dataset.celebrationSnapshot = "true", c;
|
|
55
|
+
}, c = (e, t, n) => {
|
|
56
|
+
if (!e.length || typeof t.animate != "function") return () => void 0;
|
|
57
|
+
let r = [], i = [], a = !1, o, c = [
|
|
58
|
+
"scroll",
|
|
59
|
+
"pointerdown",
|
|
60
|
+
"focusin",
|
|
61
|
+
"keydown",
|
|
62
|
+
"beforeinput",
|
|
63
|
+
"input",
|
|
64
|
+
"compositionstart",
|
|
65
|
+
"visibilitychange"
|
|
66
|
+
], l = () => {
|
|
67
|
+
a || (a = !0, clearTimeout(o), d.disconnect(), i.forEach((e) => e.cancel()), r.forEach((e) => e.remove()), c.forEach((e) => document.removeEventListener(e, u, !0)), window.removeEventListener("resize", l), n.onStop?.());
|
|
68
|
+
}, u = (e) => {
|
|
69
|
+
e.type === "scroll" && e.target instanceof Node && t.contains(e.target) || l();
|
|
70
|
+
}, d = new MutationObserver((t) => {
|
|
71
|
+
e.some(({ element: e }) => !e.isConnected || e.closest("[inert], [aria-hidden=\"true\"]") || t.some((t) => e.contains(t.target) || t.type === "attributes" && t.target instanceof Element && t.target.contains(e))) && l();
|
|
72
|
+
});
|
|
73
|
+
try {
|
|
74
|
+
e.forEach(({ element: e, rect: a }, o) => {
|
|
75
|
+
let c = s(e, a);
|
|
76
|
+
r.push(c), t.appendChild(c);
|
|
77
|
+
let l = [e, ...e.querySelectorAll("*")], u = c.firstElementChild;
|
|
78
|
+
if (!u) throw Error("Snapshot is empty");
|
|
79
|
+
let d = [u, ...u.querySelectorAll("*")];
|
|
80
|
+
if (l.forEach((e, t) => {
|
|
81
|
+
d[t].scrollTop = e.scrollTop, d[t].scrollLeft = e.scrollLeft;
|
|
82
|
+
}), n.decorateCopy?.(c, o), i.push(c.animate(n.frames(a, o).map((e) => ({
|
|
83
|
+
...e,
|
|
84
|
+
easing: e.easing ?? "ease-in-out"
|
|
85
|
+
})), {
|
|
86
|
+
duration: n.durationMs,
|
|
87
|
+
fill: "both"
|
|
88
|
+
})), n.hideOriginal !== !1) {
|
|
89
|
+
let t = getComputedStyle(e).opacity, r = typeof n.hideAt == "function" ? n.hideAt(o) : n.hideAt;
|
|
90
|
+
i.push(e.animate([
|
|
91
|
+
{
|
|
92
|
+
offset: 0,
|
|
93
|
+
opacity: t
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
offset: r - .01,
|
|
97
|
+
opacity: t
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
offset: r,
|
|
101
|
+
opacity: 0
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
offset: n.restoreAt,
|
|
105
|
+
opacity: 0
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
offset: Math.min(1, n.restoreAt + .04),
|
|
109
|
+
opacity: t
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
offset: 1,
|
|
113
|
+
opacity: t
|
|
114
|
+
}
|
|
115
|
+
], {
|
|
116
|
+
duration: n.durationMs,
|
|
117
|
+
fill: "both"
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
}), n.startTime !== void 0 && i.forEach((e) => {
|
|
121
|
+
e.startTime = n.startTime ?? null;
|
|
122
|
+
}), d.observe(document.body, {
|
|
123
|
+
subtree: !0,
|
|
124
|
+
childList: !0,
|
|
125
|
+
characterData: !0,
|
|
126
|
+
attributes: !0,
|
|
127
|
+
attributeFilter: [
|
|
128
|
+
"href",
|
|
129
|
+
"inert",
|
|
130
|
+
"aria-hidden",
|
|
131
|
+
"aria-expanded",
|
|
132
|
+
"class",
|
|
133
|
+
"style",
|
|
134
|
+
"dir"
|
|
135
|
+
]
|
|
136
|
+
}), c.forEach((e) => document.addEventListener(e, u, !0)), window.addEventListener("resize", l), o = setTimeout(l, n.durationMs);
|
|
137
|
+
} catch {
|
|
138
|
+
l();
|
|
139
|
+
}
|
|
140
|
+
return l;
|
|
141
|
+
}, l = "[role=\"region\"]", u = ({ historyContainer: e, historyRowLink: t }) => e && t ? `.${e} ${t}` : null, d = ({ historyContainer: e }) => e ? `.${e}` : null, f = ({ historyContainer: e }) => e ? `.${e} h2, .${e} button` : null, p = (e, t = document) => e ? Array.from(t.querySelectorAll(e)) : [], m = (e, { welcomeRegion: t }) => e?.closest(t ?? l) ?? null, h = .5, g = (t, n, r = []) => {
|
|
142
|
+
if (!t.length) return () => void 0;
|
|
143
|
+
let i = [...new Set(t)].map((e) => ({
|
|
144
|
+
element: e,
|
|
145
|
+
rect: e.getBoundingClientRect()
|
|
146
|
+
})), a = !1, o = () => {
|
|
147
|
+
a || (a = !0, u.disconnect(), d?.disconnect());
|
|
148
|
+
}, s = () => {
|
|
149
|
+
a || (o(), n());
|
|
150
|
+
}, c = () => {
|
|
151
|
+
a || i.some(({ element: e, rect: t }) => {
|
|
152
|
+
if (!e.isConnected) return !0;
|
|
153
|
+
let n = e.getBoundingClientRect();
|
|
154
|
+
return [
|
|
155
|
+
"left",
|
|
156
|
+
"top",
|
|
157
|
+
"width",
|
|
158
|
+
"height"
|
|
159
|
+
].some((e) => Math.abs(n[e] - t[e]) > h);
|
|
160
|
+
}) && s();
|
|
161
|
+
}, l = (t) => r.some((e) => e === t || e.contains(t)) || t instanceof Element && !!t.closest(`.${e.sceneLayer}`), u = new MutationObserver((e) => {
|
|
162
|
+
if (a) return;
|
|
163
|
+
let t = e.filter((e) => !l(e.target) && (e.type !== "childList" || ![...e.addedNodes, ...e.removedNodes].every(l)));
|
|
164
|
+
i.some(({ element: e }) => !e.isConnected || t.some((t) => e.contains(t.target) || t.type === "attributes" && t.target.contains(e))) ? s() : t.some((e) => e.type === "childList" && i.some(({ element: t }) => e.target.contains(t))) && c();
|
|
165
|
+
}), d = typeof ResizeObserver == "function" ? new ResizeObserver(c) : void 0;
|
|
166
|
+
return u.observe(document.documentElement, {
|
|
167
|
+
subtree: !0,
|
|
168
|
+
childList: !0,
|
|
169
|
+
characterData: !0,
|
|
170
|
+
attributes: !0,
|
|
171
|
+
attributeFilter: [
|
|
172
|
+
"class",
|
|
173
|
+
"style",
|
|
174
|
+
"dir",
|
|
175
|
+
"hidden",
|
|
176
|
+
"inert",
|
|
177
|
+
"aria-hidden",
|
|
178
|
+
"aria-expanded",
|
|
179
|
+
"href"
|
|
180
|
+
]
|
|
181
|
+
}), i.forEach(({ element: e }) => d?.observe(e)), o;
|
|
182
|
+
};
|
|
183
|
+
//#endregion
|
|
184
|
+
export { u as a, a as c, f as i, m as n, p as o, d as r, c as s, g as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lottie-scene-session.d.ts","sourceRoot":"","sources":["../../src/utils/lottie-scene-session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAgChC,iGAAiG;AACjG,eAAO,MAAM,wBAAwB,GAAI,CAAC,EAAE,4DAMzC,yBAAyB,CAAC,CAAC,CAAC,KAAG,
|
|
1
|
+
{"version":3,"file":"lottie-scene-session.d.ts","sourceRoot":"","sources":["../../src/utils/lottie-scene-session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAgChC,iGAAiG;AACjG,eAAO,MAAM,wBAAwB,GAAI,CAAC,EAAE,4DAMzC,yBAAyB,CAAC,CAAC,CAAC,KAAG,kBA6KjC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { useSyncExternalStore as e } from "react";
|
|
2
|
-
//#region src/hooks/useReducedMotion.ts
|
|
3
|
-
var t = "(prefers-reduced-motion: reduce)", n = (e) => {
|
|
4
|
-
let n = window.matchMedia?.(t);
|
|
5
|
-
return n?.addEventListener("change", e), () => n?.removeEventListener("change", e);
|
|
6
|
-
}, r = () => window.matchMedia?.(t).matches ?? !1, i = () => e(n, r, () => !0);
|
|
7
|
-
//#endregion
|
|
8
|
-
export { i as t };
|