@streamlayer/react 1.21.2 → 1.21.3
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/lib/cjs/advertisement.js +1 -1
- package/lib/cjs/insight.js +1 -1
- package/lib/cjs/notification.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/provider.js +1 -1
- package/lib/cjs/useStreamLayerApp2.js +1 -1
- package/lib/classic/cjs/advertisement.js +1 -1
- package/lib/classic/cjs/insight.js +1 -1
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/points.js +1 -1
- package/lib/classic/cjs/provider.js +1 -1
- package/lib/classic/cjs/useStreamLayerApp2.js +1 -1
- package/lib/classic/es/advertisement.js +1 -1
- package/lib/classic/es/insight.js +1 -1
- package/lib/classic/es/notification.js +1 -1
- package/lib/classic/es/points.js +1 -1
- package/lib/classic/es/provider.js +18 -18
- package/lib/classic/es/useStreamLayerApp2.js +1 -1
- package/lib/dist/cjs/gamification-feature2.js +1 -1
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +2 -2
- package/lib/dist/es/gamification-feature2.js +1 -1
- package/lib/dist/es/index.js +1 -1
- package/lib/dist/es/masters.js +51 -51
- package/lib/es/advertisement.js +1 -1
- package/lib/es/insight.js +1 -1
- package/lib/es/notification.js +1 -1
- package/lib/es/points.js +1 -1
- package/lib/es/provider.js +18 -18
- package/lib/es/useStreamLayerApp2.js +1 -1
- package/package.json +14 -14
package/lib/es/provider.js
CHANGED
|
@@ -3,7 +3,7 @@ var Nn = (e, t, n) => t in e ? Hn(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var p1 = (e, t, n) => Nn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import { jsx as a, jsxs as g, Fragment as d1 } from "react/jsx-runtime";
|
|
5
5
|
import * as d from "react";
|
|
6
|
-
import
|
|
6
|
+
import H1, { useState as Z, useEffect as j, useRef as l1, createContext as R6, useContext as Y1, useCallback as o1, useMemo as f1, useLayoutEffect as $6, forwardRef as F3, memo as Dn, Component as qn, createElement as Bn, PureComponent as Pn, lazy as Zn, Suspense as Kn } from "react";
|
|
7
7
|
import { S as A1, Q as S, k as Un, h as U1, i as i2, A as S6, f as jn, e as L3, I as k6, l as zn, m as x2, u as Gn } from "./useStreamLayerApp2.js";
|
|
8
8
|
import { listenKeys as Wn } from "nanostores";
|
|
9
9
|
import { pino as Qn } from "pino";
|
|
@@ -247,8 +247,8 @@ function h7(e) {
|
|
|
247
247
|
f[T] = y[T];
|
|
248
248
|
}), C.style = f;
|
|
249
249
|
}
|
|
250
|
-
return e.__wyw_meta && e !== l ? (C.as = l,
|
|
251
|
-
}, i =
|
|
250
|
+
return e.__wyw_meta && e !== l ? (C.as = l, H1.createElement(e, C)) : H1.createElement(l, C);
|
|
251
|
+
}, i = H1.forwardRef ? H1.forwardRef(r) : (
|
|
252
252
|
// React.forwardRef won't available on older React versions and in Preact
|
|
253
253
|
// Fallback to a innerRef prop in that case
|
|
254
254
|
(s) => {
|
|
@@ -310,7 +310,7 @@ var g2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
310
310
|
* This source code is licensed under the MIT license found in the
|
|
311
311
|
* LICENSE file in the root directory of this source tree.
|
|
312
312
|
*/
|
|
313
|
-
var o2 =
|
|
313
|
+
var o2 = H1;
|
|
314
314
|
function _7(e, t) {
|
|
315
315
|
return e === t && (e !== 0 || 1 / e === 1 / t) || e !== e && t !== t;
|
|
316
316
|
}
|
|
@@ -352,17 +352,17 @@ const X2 = (e, t) => (n) => {
|
|
|
352
352
|
e.current !== n && (e.current = n, t());
|
|
353
353
|
};
|
|
354
354
|
function V7(e, { keys: t, deps: n = [e, t] } = {}) {
|
|
355
|
-
const r =
|
|
355
|
+
const r = H1.useRef();
|
|
356
356
|
r.current = e.get();
|
|
357
|
-
const i =
|
|
358
|
-
return
|
|
357
|
+
const i = H1.useCallback((o) => (X2(r, o)(e.value), (t == null ? void 0 : t.length) > 0 ? Wn(e, t, X2(r, o)) : e.listen(X2(r, o))), n), s = () => r.current;
|
|
358
|
+
return H1.useSyncExternalStore ? H1.useSyncExternalStore(i, s, s) : F7.useSyncExternalStore(i, s, s);
|
|
359
359
|
}
|
|
360
360
|
const J = V7, O7 = () => [
|
|
361
361
|
!1,
|
|
362
362
|
(e) => {
|
|
363
363
|
window.requestAnimationFrame(() => e());
|
|
364
364
|
}
|
|
365
|
-
], H7 =
|
|
365
|
+
], H7 = H1.useTransition || O7, N7 = (e) => {
|
|
366
366
|
const t = J(e.getActiveFeature()), n = J(e.streamStore()), [r, i] = Z(null);
|
|
367
367
|
return j(() => {
|
|
368
368
|
const s = e.getFeatures();
|
|
@@ -2572,7 +2572,7 @@ function vs() {
|
|
|
2572
2572
|
}
|
|
2573
2573
|
(function(e, t) {
|
|
2574
2574
|
(function(n, r) {
|
|
2575
|
-
e.exports = r(K6(), Kr(), J9(), ts(), rs(), ss(), as(), os(), hs(), fs(), vs(),
|
|
2575
|
+
e.exports = r(K6(), Kr(), J9(), ts(), rs(), ss(), as(), os(), hs(), fs(), vs(), H1);
|
|
2576
2576
|
})(g2, function(n, r, i, s, o, l, u, p, C, v, f, y) {
|
|
2577
2577
|
return function() {
|
|
2578
2578
|
var A = { 654: function(L, m, w) {
|
|
@@ -2646,8 +2646,8 @@ function vs() {
|
|
|
2646
2646
|
return Math.abs(G - n1);
|
|
2647
2647
|
}
|
|
2648
2648
|
if (R === "edges") {
|
|
2649
|
-
var b1 = Math.min(X, Q), c1 = Math.min(z, u1), k1 = Math.max(X, Q), P1 = Math.max(z, u1),
|
|
2650
|
-
return Math.min(
|
|
2649
|
+
var b1 = Math.min(X, Q), c1 = Math.min(z, u1), k1 = Math.max(X, Q), P1 = Math.max(z, u1), N1 = Math.abs(b1 - c1), M1 = Math.abs(k1 - P1);
|
|
2650
|
+
return Math.min(N1, M1);
|
|
2651
2651
|
}
|
|
2652
2652
|
var h2 = [Math.abs(z - X), Math.abs(z - Q), Math.abs(u1 - X), Math.abs(u1 - Q)];
|
|
2653
2653
|
return Math.min.apply(Math, h2);
|
|
@@ -2658,8 +2658,8 @@ function vs() {
|
|
|
2658
2658
|
return V.log("smartNavigate", "distance (primary, secondary, total weighted) for ".concat(U.focusKey, " relative to ").concat(R, " is"), z, u1, G), V.log("smartNavigate", "priority for ".concat(U.focusKey, " relative to ").concat(R, " is"), n1), V.visualDebugger && (V.visualDebugger.drawPoint(t1.a.x, t1.a.y, "yellow", 6), V.visualDebugger.drawPoint(t1.b.x, t1.b.y, "yellow", 6)), n1;
|
|
2659
2659
|
});
|
|
2660
2660
|
}, x.prototype.init = function(h) {
|
|
2661
|
-
var b = this, I = h === void 0 ? {} : h, R = I.debug, V = R !== void 0 && R, q = I.visualDebug, B = q !== void 0 && q, U = I.nativeMode, t1 = U !== void 0 && U, e1 = I.throttle, X = e1 === void 0 ? 0 : e1, Q = I.throttleKeypresses, z = Q !== void 0 && Q, u1 = I.useGetBoundingClientRect, G = u1 !== void 0 && u1, n1 = I.shouldFocusDOMNode, b1 = n1 !== void 0 && n1, c1 = I.domNodeFocusOptions, k1 = c1 === void 0 ? {} : c1, P1 = I.shouldUseNativeEvents,
|
|
2662
|
-
if (!this.enabled && (this.domNodeFocusOptions = k1, this.enabled = !0, this.nativeMode = t1, this.throttleKeypresses = z, this.useGetBoundingClientRect = G, this.shouldFocusDOMNode = b1 && !t1, this.shouldUseNativeEvents =
|
|
2661
|
+
var b = this, I = h === void 0 ? {} : h, R = I.debug, V = R !== void 0 && R, q = I.visualDebug, B = q !== void 0 && q, U = I.nativeMode, t1 = U !== void 0 && U, e1 = I.throttle, X = e1 === void 0 ? 0 : e1, Q = I.throttleKeypresses, z = Q !== void 0 && Q, u1 = I.useGetBoundingClientRect, G = u1 !== void 0 && u1, n1 = I.shouldFocusDOMNode, b1 = n1 !== void 0 && n1, c1 = I.domNodeFocusOptions, k1 = c1 === void 0 ? {} : c1, P1 = I.shouldUseNativeEvents, N1 = P1 !== void 0 && P1, M1 = I.rtl, h2 = M1 !== void 0 && M1, h1 = I.distanceCalculationMethod, E1 = h1 === void 0 ? "corners" : h1, at = I.customDistanceCalculationFunction, Vn = at === void 0 ? void 0 : at;
|
|
2662
|
+
if (!this.enabled && (this.domNodeFocusOptions = k1, this.enabled = !0, this.nativeMode = t1, this.throttleKeypresses = z, this.useGetBoundingClientRect = G, this.shouldFocusDOMNode = b1 && !t1, this.shouldUseNativeEvents = N1, this.writingDirection = h2 ? C1.default.RTL : C1.default.LTR, this.distanceCalculationMethod = E1, this.customDistanceCalculationFunction = Vn, this.debug = V, !this.nativeMode && (Number.isInteger(X) && X > 0 && (this.throttle = X), this.bindEventHandlers(), B))) {
|
|
2663
2663
|
this.visualDebugger = new I1.default(this.writingDirection);
|
|
2664
2664
|
var ot = function() {
|
|
2665
2665
|
requestAnimationFrame(function() {
|
|
@@ -2811,12 +2811,12 @@ function vs() {
|
|
|
2811
2811
|
var b = h.focusKey, I = h.node, R = h.parentFocusKey, V = h.onEnterPress, q = h.onEnterRelease, B = h.onArrowPress, U = h.onArrowRelease, t1 = h.onFocus, e1 = h.onBlur, X = h.saveLastFocusedChild, Q = h.trackChildren, z = h.onUpdateFocus, u1 = h.onUpdateHasFocusedChild, G = h.preferredChildFocusKey, n1 = h.autoRestoreFocus, b1 = h.forceFocus, c1 = h.focusable, k1 = h.isFocusBoundary, P1 = h.focusBoundaryDirections;
|
|
2812
2812
|
if (this.focusableComponents[b] = { focusKey: b, node: I, parentFocusKey: R, onEnterPress: V, onEnterRelease: q, onArrowPress: B, onArrowRelease: U, onFocus: t1, onBlur: e1, onUpdateFocus: z, onUpdateHasFocusedChild: u1, saveLastFocusedChild: X, trackChildren: Q, preferredChildFocusKey: G, focusable: c1, isFocusBoundary: k1, focusBoundaryDirections: P1, autoRestoreFocus: n1, forceFocus: b1, lastFocusedChildKey: null, layout: { x: 0, y: 0, width: 0, height: 0, left: 0, top: 0, right: 0, bottom: 0, node: I }, layoutUpdated: !1 }, I || console.warn('Component added without a node reference. This will result in its coordinates being empty and may cause lost focus. Check the "ref" passed to "useFocusable": ', this.focusableComponents[b]), !this.nativeMode) {
|
|
2813
2813
|
this.updateLayout(b), this.log("addFocusable", "Component added: ", this.focusableComponents[b]), b === this.focusKey && this.setFocus(G || b);
|
|
2814
|
-
for (var
|
|
2815
|
-
if (
|
|
2814
|
+
for (var N1 = this.focusableComponents[this.focusKey]; N1; ) {
|
|
2815
|
+
if (N1.parentFocusKey === b) {
|
|
2816
2816
|
this.updateParentsHasFocusedChild(this.focusKey, {}), this.updateParentsLastFocusedChild(this.focusKey);
|
|
2817
2817
|
break;
|
|
2818
2818
|
}
|
|
2819
|
-
|
|
2819
|
+
N1 = this.focusableComponents[N1.parentFocusKey];
|
|
2820
2820
|
}
|
|
2821
2821
|
}
|
|
2822
2822
|
}, x.prototype.removeFocusable = function(h) {
|
|
@@ -3023,14 +3023,14 @@ function vs() {
|
|
|
3023
3023
|
R(h1, B, E1);
|
|
3024
3024
|
}, [B, R]), z = (0, E.useCallback)(function(h1, E1) {
|
|
3025
3025
|
q(h1, B, E1);
|
|
3026
|
-
}, [B, q]), u1 = (0, E.useRef)(null), G = (0, E.useState)(!1), n1 = G[0], b1 = G[1], c1 = (0, E.useState)(!1), k1 = c1[0], P1 = c1[1],
|
|
3026
|
+
}, [B, q]), u1 = (0, E.useRef)(null), G = (0, E.useState)(!1), n1 = G[0], b1 = G[1], c1 = (0, E.useState)(!1), k1 = c1[0], P1 = c1[1], N1 = (0, N.useFocusContext)(), M1 = (0, E.useMemo)(function() {
|
|
3027
3027
|
return S1 || (0, k.default)("sn:focusable-item-");
|
|
3028
3028
|
}, [S1]), h2 = (0, E.useCallback)(function(h1) {
|
|
3029
3029
|
h1 === void 0 && (h1 = {}), F.SpatialNavigation.setFocus(M1, h1);
|
|
3030
3030
|
}, [M1]);
|
|
3031
3031
|
return (0, E.useEffect)(function() {
|
|
3032
3032
|
var h1 = u1.current;
|
|
3033
|
-
return F.SpatialNavigation.addFocusable({ focusKey: M1, node: h1, parentFocusKey:
|
|
3033
|
+
return F.SpatialNavigation.addFocusable({ focusKey: M1, node: h1, parentFocusKey: N1, preferredChildFocusKey: Y, onEnterPress: U, onEnterRelease: t1, onArrowPress: e1, onArrowRelease: X, onFocus: Q, onBlur: z, onUpdateFocus: function(E1) {
|
|
3034
3034
|
return E1 === void 0 && (E1 = !1), b1(E1);
|
|
3035
3035
|
}, onUpdateHasFocusedChild: function(E1) {
|
|
3036
3036
|
return E1 === void 0 && (E1 = !1), P1(E1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react",
|
|
3
|
-
"version": "1.21.
|
|
3
|
+
"version": "1.21.3",
|
|
4
4
|
"author": "StreamLayer, Inc (https://streamlayer.io)",
|
|
5
5
|
"maintainers": [
|
|
6
6
|
{
|
|
@@ -133,18 +133,18 @@
|
|
|
133
133
|
],
|
|
134
134
|
"dependencies": {
|
|
135
135
|
"@streamlayer/sl-eslib": "^5.225.0",
|
|
136
|
-
"@streamlayer/feature-gamification": "^1.23.
|
|
137
|
-
"@streamlayer/react-polyfills": "^0.1.
|
|
138
|
-
"@streamlayer/sdk-web
|
|
139
|
-
"@streamlayer/sdk-web-
|
|
140
|
-
"@streamlayer/sdk-web": "^1.
|
|
141
|
-
"@streamlayer/sdk-web-core": "^1.17.
|
|
142
|
-
"@streamlayer/sdk-web-
|
|
143
|
-
"@streamlayer/sdk-web-
|
|
144
|
-
"@streamlayer/sdk-web-
|
|
145
|
-
"@streamlayer/sdk-web-
|
|
146
|
-
"@streamlayer/sdk-web-
|
|
147
|
-
"@streamlayer/sdk-web-
|
|
136
|
+
"@streamlayer/feature-gamification": "^1.23.3",
|
|
137
|
+
"@streamlayer/react-polyfills": "^0.1.48",
|
|
138
|
+
"@streamlayer/sdk-web": "^1.16.3",
|
|
139
|
+
"@streamlayer/sdk-web-analytics": "^1.13.3",
|
|
140
|
+
"@streamlayer/sdk-web-api": "^1.14.3",
|
|
141
|
+
"@streamlayer/sdk-web-core": "^1.17.3",
|
|
142
|
+
"@streamlayer/sdk-web-interfaces": "^1.8.3",
|
|
143
|
+
"@streamlayer/sdk-web-notifications": "^1.3.50",
|
|
144
|
+
"@streamlayer/sdk-web-features": "^1.0.88",
|
|
145
|
+
"@streamlayer/sdk-web-storage": "^1.0.88",
|
|
146
|
+
"@streamlayer/sdk-web-types": "^1.16.3",
|
|
147
|
+
"@streamlayer/sdk-web-logger": "^1.0.88"
|
|
148
148
|
},
|
|
149
149
|
"peerDependencies": {
|
|
150
150
|
"@bufbuild/protobuf": "^2.2.2",
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
"size-limit": "^11.1.6",
|
|
200
200
|
"url-loader": "^4.1.1",
|
|
201
201
|
"vite-plugin-dts": "^4.2.3",
|
|
202
|
-
"@streamlayer/react-ui": "^1.32.
|
|
202
|
+
"@streamlayer/react-ui": "^1.32.3"
|
|
203
203
|
},
|
|
204
204
|
"scripts": {
|
|
205
205
|
"size-limit": "size-limit"
|