@ikonai/sdk-react-ui-rive 0.0.27 → 0.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +353 -353
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,6 +1,7 @@
1
- import me, { useMemo as B, useRef as oe, useEffect as V, useCallback as Y } from "react";
2
- import { Fit as T, Alignment as O, Layout as ge, useRive as be, EventType as G } from "@rive-app/react-canvas";
3
- var q = { exports: {} }, D = {};
1
+ import me, { memo as ge, useMemo as V, useRef as se, useEffect as Y, useCallback as q } from "react";
2
+ import { Fit as _, Alignment as O, Layout as be, useRive as ve, EventType as Z } from "@rive-app/react-canvas";
3
+ import { useUiNode as he } from "@ikonai/sdk-react-ui";
4
+ var U = { exports: {} }, z = {};
4
5
  /**
5
6
  * @license React
6
7
  * react-jsx-runtime.production.js
@@ -10,29 +11,29 @@ var q = { exports: {} }, D = {};
10
11
  * This source code is licensed under the MIT license found in the
11
12
  * LICENSE file in the root directory of this source tree.
12
13
  */
13
- var ie;
14
- function he() {
15
- if (ie) return D;
16
- ie = 1;
17
- var e = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
18
- function o(a, i, r) {
19
- var l = null;
20
- if (r !== void 0 && (l = "" + r), i.key !== void 0 && (l = "" + i.key), "key" in i) {
21
- r = {};
22
- for (var p in i)
23
- p !== "key" && (r[p] = i[p]);
24
- } else r = i;
25
- return i = r.ref, {
14
+ var ae;
15
+ function pe() {
16
+ if (ae) return z;
17
+ ae = 1;
18
+ var e = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
19
+ function o(a, i, n) {
20
+ var f = null;
21
+ if (n !== void 0 && (f = "" + n), i.key !== void 0 && (f = "" + i.key), "key" in i) {
22
+ n = {};
23
+ for (var E in i)
24
+ E !== "key" && (n[E] = i[E]);
25
+ } else n = i;
26
+ return i = n.ref, {
26
27
  $$typeof: e,
27
28
  type: a,
28
- key: l,
29
+ key: f,
29
30
  ref: i !== void 0 ? i : null,
30
- props: r
31
+ props: n
31
32
  };
32
33
  }
33
- return D.Fragment = n, D.jsx = o, D.jsxs = o, D;
34
+ return z.Fragment = r, z.jsx = o, z.jsxs = o, z;
34
35
  }
35
- var z = {};
36
+ var B = {};
36
37
  /**
37
38
  * @license React
38
39
  * react-jsx-runtime.development.js
@@ -42,26 +43,26 @@ var z = {};
42
43
  * This source code is licensed under the MIT license found in the
43
44
  * LICENSE file in the root directory of this source tree.
44
45
  */
45
- var se;
46
- function ve() {
47
- return se || (se = 1, process.env.NODE_ENV !== "production" && function() {
46
+ var ce;
47
+ function ye() {
48
+ return ce || (ce = 1, process.env.NODE_ENV !== "production" && function() {
48
49
  function e(t) {
49
50
  if (t == null) return null;
50
51
  if (typeof t == "function")
51
- return t.$$typeof === le ? null : t.displayName || t.name || null;
52
+ return t.$$typeof === W ? null : t.displayName || t.name || null;
52
53
  if (typeof t == "string") return t;
53
54
  switch (t) {
54
- case M:
55
+ case x:
55
56
  return "Fragment";
56
57
  case S:
57
58
  return "Profiler";
58
59
  case P:
59
60
  return "StrictMode";
60
- case g:
61
- return "Suspense";
62
61
  case b:
62
+ return "Suspense";
63
+ case v:
63
64
  return "SuspenseList";
64
- case ue:
65
+ case K:
65
66
  return "Activity";
66
67
  }
67
68
  if (typeof t == "object")
@@ -74,10 +75,10 @@ function ve() {
74
75
  return (t.displayName || "Context") + ".Provider";
75
76
  case u:
76
77
  return (t._context.displayName || "Context") + ".Consumer";
77
- case f:
78
+ case d:
78
79
  var s = t.render;
79
80
  return t = t.displayName, t || (t = s.displayName || s.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
80
- case d:
81
+ case m:
81
82
  return s = t.displayName || null, s !== null ? s : e(t.type) || "Memo";
82
83
  case h:
83
84
  s = t._payload, t = t._init;
@@ -88,28 +89,28 @@ function ve() {
88
89
  }
89
90
  return null;
90
91
  }
91
- function n(t) {
92
+ function r(t) {
92
93
  return "" + t;
93
94
  }
94
95
  function o(t) {
95
96
  try {
96
- n(t);
97
+ r(t);
97
98
  var s = !1;
98
99
  } catch {
99
100
  s = !0;
100
101
  }
101
102
  if (s) {
102
103
  s = console;
103
- var m = s.error, y = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
104
- return m.call(
104
+ var g = s.error, y = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
105
+ return g.call(
105
106
  s,
106
107
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
107
108
  y
108
- ), n(t);
109
+ ), r(t);
109
110
  }
110
111
  }
111
112
  function a(t) {
112
- if (t === M) return "<>";
113
+ if (t === x) return "<>";
113
114
  if (typeof t == "object" && t !== null && t.$$typeof === h)
114
115
  return "<...>";
115
116
  try {
@@ -120,47 +121,47 @@ function ve() {
120
121
  }
121
122
  }
122
123
  function i() {
123
- var t = $.A;
124
+ var t = D.A;
124
125
  return t === null ? null : t.getOwner();
125
126
  }
126
- function r() {
127
+ function n() {
127
128
  return Error("react-stack-top-frame");
128
129
  }
129
- function l(t) {
130
- if (Z.call(t, "key")) {
130
+ function f(t) {
131
+ if (ee.call(t, "key")) {
131
132
  var s = Object.getOwnPropertyDescriptor(t, "key").get;
132
133
  if (s && s.isReactWarning) return !1;
133
134
  }
134
135
  return t.key !== void 0;
135
136
  }
136
- function p(t, s) {
137
- function m() {
138
- Q || (Q = !0, console.error(
137
+ function E(t, s) {
138
+ function g() {
139
+ te || (te = !0, console.error(
139
140
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
140
141
  s
141
142
  ));
142
143
  }
143
- m.isReactWarning = !0, Object.defineProperty(t, "key", {
144
- get: m,
144
+ g.isReactWarning = !0, Object.defineProperty(t, "key", {
145
+ get: g,
145
146
  configurable: !0
146
147
  });
147
148
  }
148
- function _() {
149
+ function l() {
149
150
  var t = e(this.type);
150
- return ee[t] || (ee[t] = !0, console.error(
151
+ return re[t] || (re[t] = !0, console.error(
151
152
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
152
153
  )), t = this.props.ref, t !== void 0 ? t : null;
153
154
  }
154
- function k(t, s, m, y, N, A, W, H) {
155
- return m = A.ref, t = {
155
+ function T(t, s, g, y, N, A, J, G) {
156
+ return g = A.ref, t = {
156
157
  $$typeof: I,
157
158
  type: t,
158
159
  key: s,
159
160
  props: A,
160
161
  _owner: N
161
- }, (m !== void 0 ? m : null) !== null ? Object.defineProperty(t, "ref", {
162
+ }, (g !== void 0 ? g : null) !== null ? Object.defineProperty(t, "ref", {
162
163
  enumerable: !1,
163
- get: _
164
+ get: l
164
165
  }) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
165
166
  configurable: !1,
166
167
  enumerable: !1,
@@ -175,33 +176,33 @@ function ve() {
175
176
  configurable: !1,
176
177
  enumerable: !1,
177
178
  writable: !0,
178
- value: W
179
+ value: J
179
180
  }), Object.defineProperty(t, "_debugTask", {
180
181
  configurable: !1,
181
182
  enumerable: !1,
182
183
  writable: !0,
183
- value: H
184
+ value: G
184
185
  }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
185
186
  }
186
- function v(t, s, m, y, N, A, W, H) {
187
+ function p(t, s, g, y, N, A, J, G) {
187
188
  var R = s.children;
188
189
  if (R !== void 0)
189
190
  if (y)
190
191
  if (fe(R)) {
191
192
  for (y = 0; y < R.length; y++)
192
- E(R[y]);
193
+ w(R[y]);
193
194
  Object.freeze && Object.freeze(R);
194
195
  } else
195
196
  console.error(
196
197
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
197
198
  );
198
- else E(R);
199
- if (Z.call(s, "key")) {
199
+ else w(R);
200
+ if (ee.call(s, "key")) {
200
201
  R = e(t);
201
202
  var F = Object.keys(s).filter(function(de) {
202
203
  return de !== "key";
203
204
  });
204
- y = 0 < F.length ? "{key: someKey, " + F.join(": ..., ") + ": ...}" : "{key: someKey}", ne[R + y] || (F = 0 < F.length ? "{" + F.join(": ..., ") + ": ...}" : "{}", console.error(
205
+ y = 0 < F.length ? "{key: someKey, " + F.join(": ..., ") + ": ...}" : "{key: someKey}", ie[R + y] || (F = 0 < F.length ? "{" + F.join(": ..., ") + ": ...}" : "{}", console.error(
205
206
  `A props object containing a "key" prop is being spread into JSX:
206
207
  let props = %s;
207
208
  <%s {...props} />
@@ -212,31 +213,31 @@ React keys must be passed directly to JSX without using spread:
212
213
  R,
213
214
  F,
214
215
  R
215
- ), ne[R + y] = !0);
216
+ ), ie[R + y] = !0);
216
217
  }
217
- if (R = null, m !== void 0 && (o(m), R = "" + m), l(s) && (o(s.key), R = "" + s.key), "key" in s) {
218
- m = {};
219
- for (var J in s)
220
- J !== "key" && (m[J] = s[J]);
221
- } else m = s;
222
- return R && p(
223
- m,
218
+ if (R = null, g !== void 0 && (o(g), R = "" + g), f(s) && (o(s.key), R = "" + s.key), "key" in s) {
219
+ g = {};
220
+ for (var X in s)
221
+ X !== "key" && (g[X] = s[X]);
222
+ } else g = s;
223
+ return R && E(
224
+ g,
224
225
  typeof t == "function" ? t.displayName || t.name || "Unknown" : t
225
- ), k(
226
+ ), T(
226
227
  t,
227
228
  R,
228
229
  A,
229
230
  N,
230
231
  i(),
231
- m,
232
- W,
233
- H
232
+ g,
233
+ J,
234
+ G
234
235
  );
235
236
  }
236
- function E(t) {
237
+ function w(t) {
237
238
  typeof t == "object" && t !== null && t.$$typeof === I && t._store && (t._store.validated = 1);
238
239
  }
239
- var j = me, I = Symbol.for("react.transitional.element"), L = Symbol.for("react.portal"), M = Symbol.for("react.fragment"), P = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), u = Symbol.for("react.consumer"), c = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), ue = Symbol.for("react.activity"), le = Symbol.for("react.client.reference"), $ = j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Z = Object.prototype.hasOwnProperty, fe = Array.isArray, K = console.createTask ? console.createTask : function() {
240
+ var j = me, I = Symbol.for("react.transitional.element"), L = Symbol.for("react.portal"), x = Symbol.for("react.fragment"), P = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), u = Symbol.for("react.consumer"), c = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), b = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), K = Symbol.for("react.activity"), W = Symbol.for("react.client.reference"), D = j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ee = Object.prototype.hasOwnProperty, fe = Array.isArray, H = console.createTask ? console.createTask : function() {
240
241
  return null;
241
242
  };
242
243
  j = {
@@ -244,52 +245,52 @@ React keys must be passed directly to JSX without using spread:
244
245
  return t();
245
246
  }
246
247
  };
247
- var Q, ee = {}, te = j["react-stack-bottom-frame"].bind(
248
+ var te, re = {}, ne = j["react-stack-bottom-frame"].bind(
248
249
  j,
249
- r
250
- )(), re = K(a(r)), ne = {};
251
- z.Fragment = M, z.jsx = function(t, s, m, y, N) {
252
- var A = 1e4 > $.recentlyCreatedOwnerStacks++;
253
- return v(
250
+ n
251
+ )(), oe = H(a(n)), ie = {};
252
+ B.Fragment = x, B.jsx = function(t, s, g, y, N) {
253
+ var A = 1e4 > D.recentlyCreatedOwnerStacks++;
254
+ return p(
254
255
  t,
255
256
  s,
256
- m,
257
+ g,
257
258
  !1,
258
259
  y,
259
260
  N,
260
- A ? Error("react-stack-top-frame") : te,
261
- A ? K(a(t)) : re
261
+ A ? Error("react-stack-top-frame") : ne,
262
+ A ? H(a(t)) : oe
262
263
  );
263
- }, z.jsxs = function(t, s, m, y, N) {
264
- var A = 1e4 > $.recentlyCreatedOwnerStacks++;
265
- return v(
264
+ }, B.jsxs = function(t, s, g, y, N) {
265
+ var A = 1e4 > D.recentlyCreatedOwnerStacks++;
266
+ return p(
266
267
  t,
267
268
  s,
268
- m,
269
+ g,
269
270
  !0,
270
271
  y,
271
272
  N,
272
- A ? Error("react-stack-top-frame") : te,
273
- A ? K(a(t)) : re
273
+ A ? Error("react-stack-top-frame") : ne,
274
+ A ? H(a(t)) : oe
274
275
  );
275
276
  };
276
- }()), z;
277
+ }()), B;
277
278
  }
278
- var ae;
279
- function pe() {
280
- return ae || (ae = 1, process.env.NODE_ENV === "production" ? q.exports = he() : q.exports = ve()), q.exports;
279
+ var ue;
280
+ function Re() {
281
+ return ue || (ue = 1, process.env.NODE_ENV === "production" ? U.exports = pe() : U.exports = ye()), U.exports;
281
282
  }
282
- var X = pe();
283
+ var Q = Re();
283
284
  function C(e) {
284
285
  return typeof e == "object" && e !== null && !Array.isArray(e);
285
286
  }
286
- function w(e) {
287
+ function k(e) {
287
288
  if (typeof e == "string") {
288
- const n = e.trim();
289
- return n.length > 0 ? n : void 0;
289
+ const r = e.trim();
290
+ return r.length > 0 ? r : void 0;
290
291
  }
291
292
  }
292
- function x(e) {
293
+ function M(e) {
293
294
  if (typeof e == "boolean")
294
295
  return e;
295
296
  if (typeof e == "string") {
@@ -299,31 +300,31 @@ function x(e) {
299
300
  return !1;
300
301
  }
301
302
  }
302
- function U(e) {
303
+ function $(e) {
303
304
  if (typeof e == "number" && Number.isFinite(e))
304
305
  return e;
305
306
  if (typeof e == "string") {
306
- const n = Number(e.trim());
307
- return Number.isFinite(n) ? n : void 0;
307
+ const r = Number(e.trim());
308
+ return Number.isFinite(r) ? r : void 0;
308
309
  }
309
310
  }
310
- function ce(e) {
311
+ function le(e) {
311
312
  if (typeof e == "number" && Number.isFinite(e))
312
313
  return `${e}px`;
313
314
  if (typeof e == "string") {
314
- const n = e.trim();
315
- return n.length > 0 ? n : void 0;
315
+ const r = e.trim();
316
+ return r.length > 0 ? r : void 0;
316
317
  }
317
318
  }
318
- function ye(e, n, o) {
319
+ function Ee(e, r, o) {
319
320
  const a = [];
320
321
  for (const i of e)
321
322
  if (typeof i == "string") {
322
- const r = i.trim();
323
- r.length > 0 && a.push(r);
323
+ const n = i.trim();
324
+ n.length > 0 && a.push(n);
324
325
  }
325
- if (typeof n == "string") {
326
- const i = n.trim();
326
+ if (typeof r == "string") {
327
+ const i = r.trim();
327
328
  i.length > 0 && a.push(i);
328
329
  }
329
330
  if (typeof o == "string") {
@@ -332,36 +333,36 @@ function ye(e, n, o) {
332
333
  }
333
334
  return a.length > 0 ? a.join(" ") : void 0;
334
335
  }
335
- function Re(e) {
336
+ function we(e) {
336
337
  if (typeof e == "string") {
337
- const n = e.trim();
338
- return n.length > 0 ? [n] : void 0;
338
+ const r = e.trim();
339
+ return r.length > 0 ? [r] : void 0;
339
340
  }
340
341
  if (Array.isArray(e)) {
341
- const n = e.map((o) => typeof o == "string" ? o.trim() : "").filter((o) => o.length > 0);
342
- return n.length > 0 ? Array.from(new Set(n)) : void 0;
342
+ const r = e.map((o) => typeof o == "string" ? o.trim() : "").filter((o) => o.length > 0);
343
+ return r.length > 0 ? Array.from(new Set(r)) : void 0;
343
344
  }
344
345
  }
345
- const Ee = {
346
- contain: T.Contain,
347
- cover: T.Cover,
348
- fill: T.Fill,
349
- fitwidth: T.FitWidth,
350
- fitheight: T.FitHeight,
351
- width: T.FitWidth,
352
- height: T.FitHeight,
353
- scaledown: T.ScaleDown,
354
- layout: T.Layout,
355
- stretch: T.Fill,
356
- none: T.None
346
+ const ke = {
347
+ contain: _.Contain,
348
+ cover: _.Cover,
349
+ fill: _.Fill,
350
+ fitwidth: _.FitWidth,
351
+ fitheight: _.FitHeight,
352
+ width: _.FitWidth,
353
+ height: _.FitHeight,
354
+ scaledown: _.ScaleDown,
355
+ layout: _.Layout,
356
+ stretch: _.Fill,
357
+ none: _.None
357
358
  };
358
- function we(e) {
359
+ function Te(e) {
359
360
  if (typeof e != "string")
360
361
  return;
361
- const n = e.replace(/[-_\s]/g, "").toLowerCase();
362
- return Ee[n];
362
+ const r = e.replace(/[-_\s]/g, "").toLowerCase();
363
+ return ke[r];
363
364
  }
364
- const ke = {
365
+ const _e = {
365
366
  center: O.Center,
366
367
  topleft: O.TopLeft,
367
368
  topcenter: O.TopCenter,
@@ -372,185 +373,185 @@ const ke = {
372
373
  bottomcenter: O.BottomCenter,
373
374
  bottomright: O.BottomRight
374
375
  };
375
- function Te(e) {
376
+ function Ae(e) {
376
377
  if (typeof e != "string")
377
378
  return;
378
- const n = e.replace(/[-_\s]/g, "").toLowerCase();
379
- return ke[n];
379
+ const r = e.replace(/[-_\s]/g, "").toLowerCase();
380
+ return _e[r];
380
381
  }
381
- function _e(e) {
382
+ function Oe(e) {
382
383
  if (!C(e))
383
384
  return;
384
- const n = {};
385
+ const r = {};
385
386
  let o = !1;
386
387
  for (const [a, i] of Object.entries(e)) {
387
- const r = a.trim();
388
- if (!r)
388
+ const n = a.trim();
389
+ if (!n)
389
390
  continue;
390
- const l = x(i);
391
- l !== void 0 && (n[r] = l, o = !0);
391
+ const f = M(i);
392
+ f !== void 0 && (r[n] = f, o = !0);
392
393
  }
393
- return o ? n : void 0;
394
+ return o ? r : void 0;
394
395
  }
395
- function Ae(e) {
396
+ function Se(e) {
396
397
  if (!C(e))
397
398
  return;
398
- const n = {};
399
+ const r = {};
399
400
  let o = !1;
400
401
  for (const [a, i] of Object.entries(e)) {
401
- const r = a.trim();
402
- if (!r)
402
+ const n = a.trim();
403
+ if (!n)
403
404
  continue;
404
- const l = U(i);
405
- l !== void 0 && (n[r] = l, o = !0);
405
+ const f = $(i);
406
+ f !== void 0 && (r[n] = f, o = !0);
406
407
  }
407
- return o ? n : void 0;
408
+ return o ? r : void 0;
408
409
  }
409
- function Oe(e) {
410
+ function Ce(e) {
410
411
  if (!C(e))
411
412
  return;
412
- const n = {};
413
+ const r = {};
413
414
  let o = !1;
414
415
  for (const [a, i] of Object.entries(e)) {
415
- const r = a.trim();
416
- if (!r)
416
+ const n = a.trim();
417
+ if (!n)
417
418
  continue;
418
- const l = w(i);
419
- l && (n[r] = l, o = !0);
419
+ const f = k(i);
420
+ f && (r[n] = f, o = !0);
420
421
  }
421
- return o ? n : void 0;
422
+ return o ? r : void 0;
422
423
  }
423
- function Se(e) {
424
+ function je(e) {
424
425
  if (!C(e))
425
426
  return;
426
- const n = _e(e.booleans), o = Ae(e.numbers), a = Oe(e.strings);
427
- if (!(!n && !o && !a))
428
- return { booleans: n, numbers: o, strings: a };
427
+ const r = Oe(e.booleans), o = Se(e.numbers), a = Ce(e.strings);
428
+ if (!(!r && !o && !a))
429
+ return { booleans: r, numbers: o, strings: a };
429
430
  }
430
- function Ce(e) {
431
+ function Pe(e) {
431
432
  if (!Array.isArray(e))
432
433
  return;
433
- const n = [];
434
+ const r = [];
434
435
  for (const o of e) {
435
436
  if (!C(o))
436
437
  continue;
437
- const a = w(o.name), i = U(o.sequence);
438
- !a || i === void 0 || n.push({ name: a, sequence: i });
438
+ const a = k(o.name), i = $(o.sequence);
439
+ !a || i === void 0 || r.push({ name: a, sequence: i });
439
440
  }
440
- if (n.length !== 0)
441
- return n;
441
+ if (r.length !== 0)
442
+ return r;
442
443
  }
443
- function je(e) {
444
+ function Ne(e) {
444
445
  if (!C(e))
445
446
  return;
446
- const n = {};
447
+ const r = {};
447
448
  let o = !1;
448
449
  for (const [a, i] of Object.entries(e)) {
449
- const r = a.trim();
450
- if (r) {
450
+ const n = a.trim();
451
+ if (n) {
451
452
  if (typeof i == "boolean") {
452
- n[r] = i, o = !0;
453
+ r[n] = i, o = !0;
453
454
  continue;
454
455
  }
455
456
  if (typeof i == "number" && Number.isFinite(i)) {
456
- n[r] = i, o = !0;
457
+ r[n] = i, o = !0;
457
458
  continue;
458
459
  }
459
460
  if (typeof i == "string") {
460
- const l = i.trim();
461
- if (!l)
461
+ const f = i.trim();
462
+ if (!f)
462
463
  continue;
463
- n[r] = l, o = !0;
464
+ r[n] = f, o = !0;
464
465
  }
465
466
  }
466
467
  }
467
- return o ? n : void 0;
468
+ return o ? r : void 0;
468
469
  }
469
- function Pe(e) {
470
+ function Me(e) {
470
471
  if (!C(e))
471
472
  return;
472
- const n = w(e.name);
473
- if (!n)
473
+ const r = k(e.name);
474
+ if (!r)
474
475
  return;
475
- const o = U(e.type), a = U(e.delay), i = w(e.url), r = w(e.target), l = je(e.properties);
476
+ const o = $(e.type), a = $(e.delay), i = k(e.url), n = k(e.target), f = Ne(e.properties);
476
477
  return {
477
- name: n,
478
+ name: r,
478
479
  type: o === void 0 ? void 0 : Math.trunc(o),
479
480
  delay: a,
480
481
  url: i,
481
- target: r,
482
- properties: l
482
+ target: n,
483
+ properties: f
483
484
  };
484
485
  }
485
- function Ne(e) {
486
+ function xe(e) {
486
487
  if (!C(e))
487
488
  return;
488
- const n = {};
489
+ const r = {};
489
490
  let o = !1;
490
491
  for (const [a, i] of Object.entries(e)) {
491
- const r = a.trim();
492
- if (!r)
492
+ const n = a.trim();
493
+ if (!n)
493
494
  continue;
494
- const l = w(i);
495
- l && (n[r] = l, o = !0);
495
+ const f = k(i);
496
+ f && (r[n] = f, o = !0);
496
497
  }
497
- return o ? n : void 0;
498
+ return o ? r : void 0;
498
499
  }
499
- function xe(e) {
500
+ function Ie(e) {
500
501
  if (!Array.isArray(e))
501
502
  return;
502
- const n = [];
503
+ const r = [];
503
504
  for (const o of e) {
504
505
  if (!C(o))
505
506
  continue;
506
- const a = w(o.key), i = w(o.input), r = w(o.kind);
507
- if (!a || !i || !r)
507
+ const a = k(o.key), i = k(o.input), n = k(o.kind);
508
+ if (!a || !i || !n)
508
509
  continue;
509
- const l = a.replace(/[-_\s]+/g, "").toLowerCase();
510
- let p;
511
- switch (l) {
510
+ const f = a.replace(/[-_\s]+/g, "").toLowerCase();
511
+ let E;
512
+ switch (f) {
512
513
  case "arrowup":
513
514
  case "up":
514
- p = "ArrowUp";
515
+ E = "ArrowUp";
515
516
  break;
516
517
  case "arrowdown":
517
518
  case "down":
518
- p = "ArrowDown";
519
+ E = "ArrowDown";
519
520
  break;
520
521
  case "arrowleft":
521
522
  case "left":
522
- p = "ArrowLeft";
523
+ E = "ArrowLeft";
523
524
  break;
524
525
  case "arrowright":
525
526
  case "right":
526
- p = "ArrowRight";
527
+ E = "ArrowRight";
527
528
  break;
528
529
  default:
529
530
  continue;
530
531
  }
531
- const _ = r.replace(/[-_\s]+/g, "").toLowerCase();
532
- let k;
533
- _ === "boolean" ? k = "boolean" : _ === "trigger" && (k = "trigger"), k && n.push({ key: p, input: i, kind: k });
532
+ const l = n.replace(/[-_\s]+/g, "").toLowerCase();
533
+ let T;
534
+ l === "boolean" ? T = "boolean" : l === "trigger" && (T = "trigger"), T && r.push({ key: E, input: i, kind: T });
534
535
  }
535
- return n.length > 0 ? n : void 0;
536
+ return r.length > 0 ? r : void 0;
536
537
  }
537
- function Me(e, n) {
538
- return n.byteLength > 0 ? (e.decode(n), !0) : !1;
538
+ function Fe(e, r) {
539
+ return r.byteLength > 0 ? (e.decode(r), !0) : !1;
539
540
  }
540
- function Ie() {
541
+ function Le() {
541
542
  if (typeof globalThis > "u")
542
543
  return !1;
543
- const e = globalThis, n = typeof e.OffscreenCanvas < "u", o = typeof e.crossOriginIsolated == "boolean" ? e.crossOriginIsolated : !1;
544
- return n && o;
544
+ const e = globalThis, r = typeof e.OffscreenCanvas < "u", o = typeof e.crossOriginIsolated == "boolean" ? e.crossOriginIsolated : !1;
545
+ return r && o;
545
546
  }
546
- function Fe(e) {
547
- const n = B(
548
- () => new ge({
549
- fit: e.layoutFit ?? T.Contain,
547
+ function De(e) {
548
+ const r = V(
549
+ () => new be({
550
+ fit: e.layoutFit ?? _.Contain,
550
551
  alignment: e.layoutAlignment ?? O.Center
551
552
  }),
552
553
  [e.layoutFit, e.layoutAlignment]
553
- ), o = B(() => Ie(), []), a = (e.useOffscreenRenderer ?? !0) && o, i = {
554
+ ), o = V(() => Le(), []), a = (e.useOffscreenRenderer ?? !0) && o, i = {
554
555
  src: e.src,
555
556
  stateMachines: e.stateMachines,
556
557
  autoplay: e.autoplay ?? !0,
@@ -560,220 +561,219 @@ function Fe(e) {
560
561
  dispatchPointerExit: e.dispatchPointerExit,
561
562
  isTouchScrollEnabled: e.isTouchScrollEnabled,
562
563
  shouldDisableRiveListeners: e.shouldDisableRiveListeners,
563
- layout: n,
564
- assetLoader: Me
565
- }, { rive: r, RiveComponent: l } = be(i), p = oe(/* @__PURE__ */ new Map()), { dispatchAction: _ } = e, k = B(() => {
564
+ layout: r,
565
+ assetLoader: Fe
566
+ }, { rive: n, RiveComponent: f } = ve(i), E = se(/* @__PURE__ */ new Map()), { dispatchAction: l } = e, T = V(() => {
566
567
  if (!e.eventHandlers)
567
568
  return;
568
569
  const u = Object.entries(e.eventHandlers);
569
570
  if (u.length === 0)
570
571
  return;
571
572
  const c = /* @__PURE__ */ new Map();
572
- for (const [f, g] of u) {
573
- const b = f.trim();
574
- if (!b)
573
+ for (const [d, b] of u) {
574
+ const v = d.trim();
575
+ if (!v)
575
576
  continue;
576
- const d = g.trim();
577
- d && c.set(b, d);
577
+ const m = b.trim();
578
+ m && c.set(v, m);
578
579
  }
579
580
  return c.size > 0 ? c : void 0;
580
- }, [e.eventHandlers]), v = B(() => {
581
+ }, [e.eventHandlers]), p = V(() => {
581
582
  if (!e.keyboardBindings || e.keyboardBindings.length === 0)
582
583
  return;
583
584
  const u = /* @__PURE__ */ new Map();
584
585
  for (const c of e.keyboardBindings) {
585
- const f = u.get(c.key);
586
- f ? f.push(c) : u.set(c.key, [c]);
586
+ const d = u.get(c.key);
587
+ d ? d.push(c) : u.set(c.key, [c]);
587
588
  }
588
589
  return u;
589
- }, [e.keyboardBindings]), E = oe(/* @__PURE__ */ new Set());
590
- V(() => {
591
- E.current.clear();
592
- }, [v]), V(() => {
593
- const u = r?.viewModelInstance;
590
+ }, [e.keyboardBindings]), w = se(/* @__PURE__ */ new Set());
591
+ Y(() => {
592
+ w.current.clear();
593
+ }, [p]), Y(() => {
594
+ const u = n?.viewModelInstance;
594
595
  if (!u)
595
596
  return;
596
597
  const c = e.viewModel?.booleans;
597
598
  if (c)
598
- for (const [b, d] of Object.entries(c)) {
599
- const h = u.boolean(b);
600
- h && (h.value = d);
599
+ for (const [v, m] of Object.entries(c)) {
600
+ const h = u.boolean(v);
601
+ h && (h.value = m);
601
602
  }
602
- const f = e.viewModel?.numbers;
603
- if (f)
604
- for (const [b, d] of Object.entries(f)) {
605
- const h = u.number(b);
606
- h && (h.value = d);
603
+ const d = e.viewModel?.numbers;
604
+ if (d)
605
+ for (const [v, m] of Object.entries(d)) {
606
+ const h = u.number(v);
607
+ h && (h.value = m);
607
608
  }
608
- const g = e.viewModel?.strings;
609
- if (g)
610
- for (const [b, d] of Object.entries(g)) {
611
- const h = u.string(b);
612
- h && (h.value = d);
609
+ const b = e.viewModel?.strings;
610
+ if (b)
611
+ for (const [v, m] of Object.entries(b)) {
612
+ const h = u.string(v);
613
+ h && (h.value = m);
613
614
  }
614
- }, [e.viewModel, r]), V(() => {
615
- const u = r?.viewModelInstance;
615
+ }, [e.viewModel, n]), Y(() => {
616
+ const u = n?.viewModelInstance;
616
617
  if (!(!u || !e.triggerRequests))
617
618
  for (const c of e.triggerRequests) {
618
- const f = p.current.get(c.name);
619
- if (f !== void 0 && c.sequence <= f)
619
+ const d = E.current.get(c.name);
620
+ if (d !== void 0 && c.sequence <= d)
620
621
  continue;
621
- p.current.set(c.name, c.sequence), u.trigger(c.name)?.trigger();
622
+ E.current.set(c.name, c.sequence), u.trigger(c.name)?.trigger();
622
623
  }
623
- }, [e.triggerRequests, r]), V(() => {
624
- if (!r || !k || !_)
624
+ }, [e.triggerRequests, n]), Y(() => {
625
+ if (!n || !T || !l)
625
626
  return;
626
627
  const u = (c) => {
627
- if (c.type !== G.RiveEvent)
628
+ if (c.type !== Z.RiveEvent)
628
629
  return;
629
- const f = Pe(c.data);
630
- if (!f)
630
+ const d = Me(c.data);
631
+ if (!d)
631
632
  return;
632
- const g = k.get(f.name);
633
- g && _(g, f);
633
+ const b = T.get(d.name);
634
+ b && l(b, d);
634
635
  };
635
- return r.on?.(G.RiveEvent, u), () => {
636
- r.off?.(G.RiveEvent, u);
636
+ return n.on?.(Z.RiveEvent, u), () => {
637
+ n.off?.(Z.RiveEvent, u);
637
638
  };
638
- }, [r, k, _]);
639
- const j = Y(
639
+ }, [n, T, l]);
640
+ const j = q(
640
641
  (u) => {
641
- v && u.currentTarget.focus();
642
+ p && u.currentTarget.focus();
642
643
  },
643
- [v]
644
- ), I = Y(
644
+ [p]
645
+ ), I = q(
645
646
  (u) => {
646
- if (!v)
647
+ if (!p)
647
648
  return;
648
- const c = u.key, f = v.get(c);
649
- if (!f || f.length === 0)
649
+ const c = u.key, d = p.get(c);
650
+ if (!d || d.length === 0)
650
651
  return;
651
- if (E.current.has(c)) {
652
+ if (w.current.has(c)) {
652
653
  u.preventDefault();
653
654
  return;
654
655
  }
655
- const g = r?.viewModelInstance;
656
- if (!g)
656
+ const b = n?.viewModelInstance;
657
+ if (!b)
657
658
  return;
658
- let b = !1;
659
- for (const d of f)
660
- if (d.kind === "boolean") {
661
- const h = g.boolean(d.input);
662
- h && (h.value = !0, b = !0);
663
- } else if (d.kind === "trigger") {
664
- const h = g.trigger(d.input);
665
- h && (h.trigger(), b = !0);
659
+ let v = !1;
660
+ for (const m of d)
661
+ if (m.kind === "boolean") {
662
+ const h = b.boolean(m.input);
663
+ h && (h.value = !0, v = !0);
664
+ } else if (m.kind === "trigger") {
665
+ const h = b.trigger(m.input);
666
+ h && (h.trigger(), v = !0);
666
667
  }
667
- b && (E.current.add(c), u.preventDefault());
668
+ v && (w.current.add(c), u.preventDefault());
668
669
  },
669
- [v, r]
670
- ), L = Y(
670
+ [p, n]
671
+ ), L = q(
671
672
  (u) => {
672
- if (!v)
673
+ if (!p)
673
674
  return;
674
- const c = u.key, f = v.get(c);
675
- if (!f || f.length === 0)
675
+ const c = u.key, d = p.get(c);
676
+ if (!d || d.length === 0)
676
677
  return;
677
- const g = r?.viewModelInstance;
678
- if (!g) {
679
- E.current.delete(c);
678
+ const b = n?.viewModelInstance;
679
+ if (!b) {
680
+ w.current.delete(c);
680
681
  return;
681
682
  }
682
- E.current.delete(c);
683
- let b = !1;
684
- for (const d of f) {
685
- if (d.kind !== "boolean")
683
+ w.current.delete(c);
684
+ let v = !1;
685
+ for (const m of d) {
686
+ if (m.kind !== "boolean")
686
687
  continue;
687
- const h = g.boolean(d.input);
688
- h && (h.value = !1, b = !0);
688
+ const h = b.boolean(m.input);
689
+ h && (h.value = !1, v = !0);
689
690
  }
690
- b && u.preventDefault();
691
+ v && u.preventDefault();
691
692
  },
692
- [v, r]
693
- ), M = Y(() => {
694
- if (!v || v.size === 0) {
695
- E.current.clear();
693
+ [p, n]
694
+ ), x = q(() => {
695
+ if (!p || p.size === 0) {
696
+ w.current.clear();
696
697
  return;
697
698
  }
698
- const u = r?.viewModelInstance, c = Array.from(E.current);
699
- if (E.current.clear(), !!u)
700
- for (const f of c) {
701
- const g = v.get(f);
702
- if (g)
703
- for (const b of g) {
704
- if (b.kind !== "boolean")
699
+ const u = n?.viewModelInstance, c = Array.from(w.current);
700
+ if (w.current.clear(), !!u)
701
+ for (const d of c) {
702
+ const b = p.get(d);
703
+ if (b)
704
+ for (const v of b) {
705
+ if (v.kind !== "boolean")
705
706
  continue;
706
- const d = u.boolean(b.input);
707
- d && (d.value = !1);
707
+ const m = u.boolean(v.input);
708
+ m && (m.value = !1);
708
709
  }
709
710
  }
710
- }, [v, r]), P = {};
711
+ }, [p, n]), P = {};
711
712
  e.backgroundColor && (P.backgroundColor = e.backgroundColor), e.width && (P.width = e.width), e.height && (P.height = e.height);
712
- const S = !!v;
713
- return /* @__PURE__ */ X.jsx("div", { className: e.className, style: P, children: /* @__PURE__ */ X.jsx(
714
- l,
713
+ const S = !!p;
714
+ return /* @__PURE__ */ Q.jsx("div", { className: e.className, style: P, children: /* @__PURE__ */ Q.jsx(
715
+ f,
715
716
  {
716
717
  style: { width: "100%", height: "100%", backgroundColor: "transparent" },
717
718
  tabIndex: S ? 0 : void 0,
718
719
  onPointerDown: S ? j : void 0,
719
720
  onKeyDown: S ? I : void 0,
720
721
  onKeyUp: S ? L : void 0,
721
- onBlur: S ? M : void 0
722
+ onBlur: S ? x : void 0
722
723
  }
723
724
  ) });
724
725
  }
725
- function Le() {
726
+ function ze() {
726
727
  return (e) => {
727
728
  if (e.type !== "rive-canvas")
728
729
  return;
729
- const n = w(e.props.src);
730
- if (n)
731
- return ({ node: o, context: a, className: i }) => {
732
- const r = o ?? e, l = w(r.props.src) ?? n, p = Re(r.props.stateMachines), _ = x(r.props.autoplay), k = x(r.props.autoBind), v = x(r.props.useOffscreenRenderer), E = x(r.props.enableMultiTouch), j = x(r.props.dispatchPointerExit), I = x(r.props.isTouchScrollEnabled), L = x(r.props.shouldDisableRiveListeners), M = xe(r.props.keyboardBindings), P = we(r.props.layoutFit), S = Te(r.props.layoutAlignment), u = w(r.props.backgroundColor), c = ce(r.props.width), f = ce(r.props.height), g = Se(r.props.viewModel), b = Ce(r.props.triggerRequests), d = Ne(r.props.eventHandlers), h = ye(
733
- r.styleIds,
734
- i,
735
- w(r.props.style)
736
- );
737
- return /* @__PURE__ */ X.jsx(
738
- Fe,
739
- {
740
- src: l,
741
- stateMachines: p,
742
- autoplay: _,
743
- autoBind: k,
744
- useOffscreenRenderer: v,
745
- enableMultiTouch: E,
746
- dispatchPointerExit: j,
747
- isTouchScrollEnabled: I,
748
- shouldDisableRiveListeners: L,
749
- keyboardBindings: M,
750
- layoutFit: P,
751
- layoutAlignment: S,
752
- backgroundColor: u,
753
- width: c,
754
- height: f,
755
- viewModel: g,
756
- triggerRequests: b,
757
- eventHandlers: d,
758
- dispatchAction: a.dispatchAction,
759
- className: h
760
- }
761
- );
762
- };
730
+ const r = k(e.props.src);
731
+ return r ? ge(function({ nodeId: i, context: n, className: f }) {
732
+ const l = he(n.store, i) ?? e, T = k(l.props.src) ?? r, p = we(l.props.stateMachines), w = M(l.props.autoplay), j = M(l.props.autoBind), I = M(l.props.useOffscreenRenderer), L = M(l.props.enableMultiTouch), x = M(l.props.dispatchPointerExit), P = M(l.props.isTouchScrollEnabled), S = M(l.props.shouldDisableRiveListeners), u = Ie(l.props.keyboardBindings), c = Te(l.props.layoutFit), d = Ae(l.props.layoutAlignment), b = k(l.props.backgroundColor), v = le(l.props.width), m = le(l.props.height), h = je(l.props.viewModel), K = Pe(l.props.triggerRequests), W = xe(l.props.eventHandlers), D = Ee(
733
+ l.styleIds,
734
+ f,
735
+ k(l.props.style)
736
+ );
737
+ return /* @__PURE__ */ Q.jsx(
738
+ De,
739
+ {
740
+ src: T,
741
+ stateMachines: p,
742
+ autoplay: w,
743
+ autoBind: j,
744
+ useOffscreenRenderer: I,
745
+ enableMultiTouch: L,
746
+ dispatchPointerExit: x,
747
+ isTouchScrollEnabled: P,
748
+ shouldDisableRiveListeners: S,
749
+ keyboardBindings: u,
750
+ layoutFit: c,
751
+ layoutAlignment: d,
752
+ backgroundColor: b,
753
+ width: v,
754
+ height: m,
755
+ viewModel: h,
756
+ triggerRequests: K,
757
+ eventHandlers: W,
758
+ dispatchAction: n.dispatchAction,
759
+ className: D
760
+ }
761
+ );
762
+ }) : void 0;
763
763
  };
764
764
  }
765
- const De = "rive";
766
- function ze() {
767
- return [Le()];
765
+ const Be = "rive";
766
+ function Ve() {
767
+ return [ze()];
768
768
  }
769
- const Be = () => ze();
770
- function qe(e) {
771
- e.registerModule(De, Be);
769
+ const Ye = () => Ve();
770
+ function Ke(e) {
771
+ e.registerModule(Be, Ye);
772
772
  }
773
773
  export {
774
- De as IKON_UI_RIVE_MODULE,
775
- Le as createRiveCanvasResolver,
776
- ze as createRiveResolvers,
777
- Be as loadRiveModule,
778
- qe as registerRiveModule
774
+ Be as IKON_UI_RIVE_MODULE,
775
+ ze as createRiveCanvasResolver,
776
+ Ve as createRiveResolvers,
777
+ Ye as loadRiveModule,
778
+ Ke as registerRiveModule
779
779
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikonai/sdk-react-ui-rive",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",