chesai-ui 0.16.2 → 0.16.4
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/chesai-ui.css +1 -1
- package/dist/components/charts/bar-chart.d.ts +3 -1
- package/dist/components/charts/bar-chart.mjs +87 -74
- package/dist/components/charts/chart-utils.d.ts +7 -0
- package/dist/components/charts/chart-utils.mjs +24 -7
- package/dist/components/charts/heatmap-chart.d.ts +25 -0
- package/dist/components/playlist-studio/elements.d.ts +10 -2
- package/dist/components/playlist-studio/elements.mjs +289 -120
- package/dist/components/playlist-studio/index.d.ts +1 -0
- package/dist/components/playlist-studio/item-renderer.d.ts +2 -1
- package/dist/components/playlist-studio/item-renderer.mjs +66 -55
- package/dist/components/playlist-studio/player.d.ts +3 -1
- package/dist/components/playlist-studio/player.mjs +438 -71
- package/dist/components/playlist-studio/preload-context.d.ts +8 -0
- package/dist/components/playlist-studio/preload-context.mjs +6 -0
- package/dist/components/playlist-studio/types.d.ts +3 -0
- package/dist/components/textarea/textarea-styles.mjs +4 -4
- package/dist/components/textarea/use-textarea.d.ts +2 -2
- package/dist/components/textarea/use-textarea.mjs +72 -69
- package/dist/context/ChesaiProvider.d.ts +5 -1
- package/dist/context/ChesaiProvider.mjs +28 -24
- package/dist/context/ThemeProvider.d.ts +5 -1
- package/dist/context/ThemeProvider.mjs +130 -112
- package/dist/context/heatmap-chart.d.ts +25 -0
- package/dist/index.mjs +67 -63
- package/dist/utils/theme-generator.d.ts +1 -1
- package/dist/utils/theme-generator.mjs +39 -39
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as I } from "react/jsx-runtime";
|
|
2
|
-
import { useMotionValueEvent as
|
|
3
|
-
import
|
|
2
|
+
import { useMotionValueEvent as G, useTransform as g, cubicBezier as b, motion as H } from "framer-motion";
|
|
3
|
+
import K, { useState as Q } from "react";
|
|
4
4
|
const P = 2e3, o = 200, z = (e) => {
|
|
5
5
|
const t = [...e];
|
|
6
6
|
for (let s = 1; s < t.length; s++)
|
|
@@ -71,31 +71,40 @@ const P = 2e3, o = 200, z = (e) => {
|
|
|
71
71
|
default:
|
|
72
72
|
return { opacity: 0 };
|
|
73
73
|
}
|
|
74
|
-
}, f = (e) => e,
|
|
75
|
-
f,
|
|
76
|
-
Q,
|
|
74
|
+
}, f = (e) => e, W = b(0.05, 0.7, 0.1, 1), Z = b(0.3, 0, 0.8, 0.15), V = b(0, 0, 0.2, 1), v = b(0.4, 0, 1, 1), tt = [
|
|
77
75
|
f,
|
|
78
76
|
W,
|
|
79
|
-
f
|
|
80
|
-
], tt = [
|
|
81
77
|
f,
|
|
82
78
|
Z,
|
|
79
|
+
f
|
|
80
|
+
], et = [
|
|
83
81
|
f,
|
|
84
82
|
V,
|
|
83
|
+
f,
|
|
84
|
+
v,
|
|
85
85
|
f
|
|
86
|
-
],
|
|
87
|
-
({
|
|
86
|
+
], ot = K.memo(
|
|
87
|
+
({
|
|
88
|
+
item: e,
|
|
89
|
+
playhead: t,
|
|
90
|
+
components: s,
|
|
91
|
+
isTimelinePlaying: n,
|
|
92
|
+
isSeeking: $
|
|
93
|
+
}) => {
|
|
88
94
|
const w = s[e.type];
|
|
89
95
|
if (!w)
|
|
90
96
|
return console.warn(
|
|
91
97
|
`[PlaylistPlayer] Element type "${e.type}" is not registered.`
|
|
92
98
|
), null;
|
|
93
|
-
const { startTime:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
a !== x && A(a);
|
|
99
|
+
const { startTime: r, duration: k, layout: c, transitions: a } = e, l = r + k, [x, A] = Q(() => {
|
|
100
|
+
const i = t.get();
|
|
101
|
+
return i >= r && i < l;
|
|
97
102
|
});
|
|
98
|
-
|
|
103
|
+
G(t, "change", (i) => {
|
|
104
|
+
const u = i >= r && i < l;
|
|
105
|
+
u !== x && A(u);
|
|
106
|
+
});
|
|
107
|
+
const O = r, N = r + (a?.in?.duration || 0), R = l - (a?.out?.duration || 0), T = l, S = z([
|
|
99
108
|
O - 1,
|
|
100
109
|
O,
|
|
101
110
|
N,
|
|
@@ -105,24 +114,24 @@ const P = 2e3, o = 200, z = (e) => {
|
|
|
105
114
|
]), X = g(
|
|
106
115
|
t,
|
|
107
116
|
z([
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
117
|
+
r - P - 1,
|
|
118
|
+
r - P,
|
|
119
|
+
l,
|
|
120
|
+
l + 1
|
|
112
121
|
]),
|
|
113
122
|
["none", "block", "block", "none"]
|
|
114
|
-
), d =
|
|
115
|
-
|
|
123
|
+
), d = c.opacity ?? 1, y = F(
|
|
124
|
+
a?.in?.type || "none",
|
|
116
125
|
"in",
|
|
117
126
|
d
|
|
118
|
-
),
|
|
119
|
-
|
|
127
|
+
), p = F(
|
|
128
|
+
a?.out?.type || "none",
|
|
120
129
|
"out",
|
|
121
130
|
d
|
|
122
|
-
),
|
|
131
|
+
), m = (i, u, E) => g(t, S, [i, i, E, E, u, u], {
|
|
123
132
|
clamp: !0,
|
|
124
|
-
ease:
|
|
125
|
-
}), Y =
|
|
133
|
+
ease: tt
|
|
134
|
+
}), Y = a?.in && a.in.type !== "none", M = a?.out && a.out.type !== "none", _ = g(t, S, [
|
|
126
135
|
0,
|
|
127
136
|
Y ? 0 : d,
|
|
128
137
|
d,
|
|
@@ -131,61 +140,63 @@ const P = 2e3, o = 200, z = (e) => {
|
|
|
131
140
|
0
|
|
132
141
|
], {
|
|
133
142
|
clamp: !0,
|
|
134
|
-
ease:
|
|
135
|
-
}),
|
|
136
|
-
l.rotate ?? 0,
|
|
143
|
+
ease: et
|
|
144
|
+
}), J = m(y.x ?? 0, p.x ?? 0, 0), L = m(y.y ?? 0, p.y ?? 0, 0), j = m(y.scale ?? 1, p.scale ?? 1, 1), B = m(
|
|
137
145
|
y.rotate ?? 0,
|
|
146
|
+
p.rotate ?? 0,
|
|
138
147
|
0
|
|
139
|
-
),
|
|
140
|
-
l.rotateX ?? 0,
|
|
148
|
+
), C = m(
|
|
141
149
|
y.rotateX ?? 0,
|
|
150
|
+
p.rotateX ?? 0,
|
|
142
151
|
0
|
|
143
|
-
),
|
|
144
|
-
l.rotateY ?? 0,
|
|
152
|
+
), D = m(
|
|
145
153
|
y.rotateY ?? 0,
|
|
154
|
+
p.rotateY ?? 0,
|
|
146
155
|
0
|
|
147
|
-
),
|
|
148
|
-
const
|
|
149
|
-
return
|
|
156
|
+
), U = m(y.blur ?? 0, p.blur ?? 0, 0), q = g(U, (i) => {
|
|
157
|
+
const u = c.style?.filter || "";
|
|
158
|
+
return i > 0 ? `${u} blur(${i}px)`.trim() : u || "none";
|
|
150
159
|
});
|
|
151
160
|
return /* @__PURE__ */ I(
|
|
152
|
-
|
|
161
|
+
H.div,
|
|
153
162
|
{
|
|
154
163
|
className: "absolute origin-center will-change-[transform,opacity,filter]",
|
|
155
164
|
style: {
|
|
156
165
|
display: X,
|
|
157
166
|
opacity: _,
|
|
158
|
-
x:
|
|
159
|
-
y:
|
|
160
|
-
scale:
|
|
161
|
-
rotate:
|
|
162
|
-
rotateX:
|
|
163
|
-
rotateY:
|
|
164
|
-
filter:
|
|
165
|
-
left: h(
|
|
166
|
-
top: h(
|
|
167
|
-
width: h(
|
|
168
|
-
height: h(
|
|
169
|
-
zIndex:
|
|
170
|
-
...
|
|
167
|
+
x: J,
|
|
168
|
+
y: L,
|
|
169
|
+
scale: j,
|
|
170
|
+
rotate: B,
|
|
171
|
+
rotateX: C,
|
|
172
|
+
rotateY: D,
|
|
173
|
+
filter: q,
|
|
174
|
+
left: h(c.x),
|
|
175
|
+
top: h(c.y),
|
|
176
|
+
width: h(c.width),
|
|
177
|
+
height: h(c.height),
|
|
178
|
+
zIndex: c.zIndex || 1,
|
|
179
|
+
...c.style
|
|
171
180
|
},
|
|
172
181
|
children: /* @__PURE__ */ I(
|
|
173
182
|
w,
|
|
174
183
|
{
|
|
184
|
+
id: e.id,
|
|
175
185
|
data: e.props,
|
|
176
186
|
playhead: t,
|
|
177
187
|
isActive: x,
|
|
178
|
-
startTime:
|
|
179
|
-
endTime:
|
|
180
|
-
isTimelinePlaying: n
|
|
188
|
+
startTime: r,
|
|
189
|
+
endTime: l,
|
|
190
|
+
isTimelinePlaying: n,
|
|
191
|
+
isSeeking: $
|
|
181
192
|
}
|
|
182
193
|
)
|
|
183
194
|
}
|
|
184
195
|
);
|
|
185
196
|
},
|
|
186
|
-
(e, t) => e.isTimelinePlaying === t.isTimelinePlaying && e.item.id === t.item.id && e.item.startTime === t.item.startTime && e.item.duration === t.item.duration && e.item.layout.x === t.item.layout.x && e.item.layout.y === t.item.layout.y && e.item.layout.width === t.item.layout.width && e.item.layout.height === t.item.layout.height && JSON.stringify(e.item.layout.style) === JSON.stringify(t.item.layout.style)
|
|
197
|
+
(e, t) => e.isTimelinePlaying === t.isTimelinePlaying && e.isSeeking === t.isSeeking && e.item.id === t.item.id && e.item.startTime === t.item.startTime && e.item.duration === t.item.duration && e.item.layout.x === t.item.layout.x && e.item.layout.y === t.item.layout.y && e.item.layout.width === t.item.layout.width && e.item.layout.height === t.item.layout.height && JSON.stringify(e.item.layout.style) === JSON.stringify(t.item.layout.style)
|
|
187
198
|
);
|
|
188
|
-
|
|
199
|
+
ot.displayName = "ItemRenderer";
|
|
189
200
|
export {
|
|
190
|
-
|
|
201
|
+
ot as ItemRenderer
|
|
191
202
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { PlaylistSchema, PlaylistComponentRegistry } from './types';
|
|
3
3
|
export interface PlaylistPlayerProps {
|
|
4
|
-
schema
|
|
4
|
+
schema?: PlaylistSchema;
|
|
5
|
+
schemas?: PlaylistSchema | PlaylistSchema[];
|
|
5
6
|
components?: PlaylistComponentRegistry;
|
|
6
7
|
playing?: boolean;
|
|
8
|
+
showControls?: boolean;
|
|
7
9
|
className?: string;
|
|
8
10
|
onLoop?: () => void;
|
|
9
11
|
outerBackgroundColor?: string;
|