@plitzi/sdk-interactions 0.32.4 → 0.32.6
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @plitzi/sdk-interactions
|
|
2
2
|
|
|
3
|
+
## 0.32.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- v0.32.6
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @plitzi/sdk-auth@0.32.6
|
|
10
|
+
- @plitzi/sdk-collections@0.32.6
|
|
11
|
+
- @plitzi/sdk-dev-tools@0.32.6
|
|
12
|
+
- @plitzi/sdk-event-bridge@0.32.6
|
|
13
|
+
- @plitzi/sdk-navigation@0.32.6
|
|
14
|
+
- @plitzi/sdk-shared@0.32.6
|
|
15
|
+
|
|
16
|
+
## 0.32.5
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- v0.32.4
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
- @plitzi/sdk-auth@0.32.5
|
|
23
|
+
- @plitzi/sdk-collections@0.32.5
|
|
24
|
+
- @plitzi/sdk-dev-tools@0.32.5
|
|
25
|
+
- @plitzi/sdk-event-bridge@0.32.5
|
|
26
|
+
- @plitzi/sdk-navigation@0.32.5
|
|
27
|
+
- @plitzi/sdk-shared@0.32.5
|
|
28
|
+
|
|
3
29
|
## 0.32.4
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
|
@@ -22,7 +22,7 @@ declare class InteractionsManager {
|
|
|
22
22
|
getCallbacksAvailables(): {
|
|
23
23
|
[x: string]: Record<string, InteractionCallback> | Record<string, InteractionCallback<any>>;
|
|
24
24
|
};
|
|
25
|
-
interactionTrigger(subscriptorId: string, eventName: string, params?: Record<string, unknown>): Promise<unknown[]
|
|
25
|
+
interactionTrigger(subscriptorId: string | undefined, eventName: string, params?: Record<string, unknown>): Promise<unknown[]> | undefined;
|
|
26
26
|
createChildManager: (routeParams?: Record<string, string>, queryParams?: Record<string, string>) => InteractionsManager;
|
|
27
27
|
removeChildManager: (childManager: InteractionsManager) => void;
|
|
28
28
|
onUpdate(listener: InteractionUpdateListener): () => void;
|
|
@@ -36,7 +36,7 @@ var i = class i {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
subscribe(e, t = {}, r = {}, i = {}, a) {
|
|
39
|
-
if (this.subscriptors[e]) return !1;
|
|
39
|
+
if (!e || this.subscriptors[e]) return !1;
|
|
40
40
|
n(this.subscriptors, e, {
|
|
41
41
|
id: e,
|
|
42
42
|
triggers: r,
|
|
@@ -91,7 +91,7 @@ var i = class i {
|
|
|
91
91
|
return this.parentManager ? this.getRootManager()?.getCallbacksAvailablesInternal() ?? {} : this.getCallbacksAvailablesInternal();
|
|
92
92
|
}
|
|
93
93
|
interactionTrigger(e, t, n = {}) {
|
|
94
|
-
return this.eventBridge.emit("interaction", e, e, t, n);
|
|
94
|
+
if (e) return this.eventBridge.emit("interaction", e, e, t, n);
|
|
95
95
|
}
|
|
96
96
|
createChildManager = (e = {}, t = {}) => {
|
|
97
97
|
let n = new i(this.interactionsData.currentPageId, e, t);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ElementInteraction, InteractionCallback, Subscriptor } from '@plitzi/sdk-shared';
|
|
2
2
|
export type UseInteractionsProps<TParams extends Record<string, unknown> = Record<string, unknown>> = {
|
|
3
|
-
|
|
3
|
+
/** The element's idRef: interactions are wired by ref only. Absent for an element that has none, which is then
|
|
4
|
+
* left unregistered rather than falling back to its opaque id. */
|
|
5
|
+
id?: string;
|
|
4
6
|
interactions?: Record<string, ElementInteraction>;
|
|
5
7
|
triggers?: Record<string, InteractionCallback<TParams>>;
|
|
6
8
|
callbacks?: Record<string, InteractionCallback<TParams>>;
|
|
@@ -3,9 +3,11 @@ import { use as t, useEffect as n } from "react";
|
|
|
3
3
|
//#region src/hooks/useInteractions.ts
|
|
4
4
|
var r = ({ id: r, interactions: i, triggers: a, callbacks: o, getAdditionalParams: s }) => {
|
|
5
5
|
let { interactionsManager: c } = t(e);
|
|
6
|
-
n(() =>
|
|
7
|
-
c.
|
|
8
|
-
|
|
6
|
+
n(() => {
|
|
7
|
+
if (r) return c.subscribe(r, i, a, o, s), () => {
|
|
8
|
+
c.unsubscribe(r);
|
|
9
|
+
};
|
|
10
|
+
}, [
|
|
9
11
|
r,
|
|
10
12
|
i,
|
|
11
13
|
a,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-interactions",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.6",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -127,18 +127,18 @@
|
|
|
127
127
|
"type": "module",
|
|
128
128
|
"sideEffects": false,
|
|
129
129
|
"devDependencies": {
|
|
130
|
-
"eslint": "^9.39.
|
|
130
|
+
"eslint": "^9.39.5",
|
|
131
131
|
"typescript": "^6.0.3",
|
|
132
|
-
"vite": "^8.
|
|
133
|
-
"vitest": "^4.1.
|
|
132
|
+
"vite": "^8.1.5",
|
|
133
|
+
"vitest": "^4.1.10"
|
|
134
134
|
},
|
|
135
135
|
"dependencies": {
|
|
136
|
-
"@plitzi/plitzi-ui": "^1.6.
|
|
137
|
-
"@plitzi/sdk-auth": "0.32.
|
|
138
|
-
"@plitzi/sdk-collections": "0.32.
|
|
139
|
-
"@plitzi/sdk-dev-tools": "0.32.
|
|
140
|
-
"@plitzi/sdk-event-bridge": "0.32.
|
|
141
|
-
"@plitzi/sdk-navigation": "0.32.
|
|
142
|
-
"@plitzi/sdk-shared": "0.32.
|
|
136
|
+
"@plitzi/plitzi-ui": "^1.6.17",
|
|
137
|
+
"@plitzi/sdk-auth": "0.32.6",
|
|
138
|
+
"@plitzi/sdk-collections": "0.32.6",
|
|
139
|
+
"@plitzi/sdk-dev-tools": "0.32.6",
|
|
140
|
+
"@plitzi/sdk-event-bridge": "0.32.6",
|
|
141
|
+
"@plitzi/sdk-navigation": "0.32.6",
|
|
142
|
+
"@plitzi/sdk-shared": "0.32.6"
|
|
143
143
|
}
|
|
144
144
|
}
|