@pexip-engage-public/plugin-react 2.1.54 → 2.1.55
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PexipEngagePlugin.d.ts","sourceRoot":"","sources":["../src/PexipEngagePlugin.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"PexipEngagePlugin.d.ts","sourceRoot":"","sources":["../src/PexipEngagePlugin.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAI3E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAI7E,UAAU,sBAAuB,SAAQ,6BAA6B;IACpE,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,KAAK,OAAO,CAAC;IAChE,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAGD,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,QAAQ,EACR,EAAE,EACF,gBAAgB,EAAE,iBAAwB,EAC1C,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,MAAM,EACV,EAAE,KAAK,CAAC,iBAAiB,CAAC,sBAAsB,CAAC,2CAiCjD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useRefEffectEvent } from "@pexip-engage-public/utils/use-effect-event";
|
|
3
|
+
import { isValidElement, useEffect, useRef } from "react";
|
|
3
4
|
import { usePexipEngagePlugin } from "./usePexipEngagePlugin.js";
|
|
4
5
|
import { usePluginConfiguration } from "./usePluginConfiguration.js";
|
|
5
6
|
function NOOP() { }
|
|
@@ -7,7 +8,7 @@ export function PexipEngagePlugin({ className, fallback, id, onInstanceChange: _
|
|
|
7
8
|
const { Plugin, status } = usePexipEngagePlugin(scriptSrc);
|
|
8
9
|
const options = usePluginConfiguration(config);
|
|
9
10
|
const containerRef = useRef(null);
|
|
10
|
-
const onInstanceChange =
|
|
11
|
+
const onInstanceChange = useRefEffectEvent(_onInstanceChange);
|
|
11
12
|
useEffect(() => {
|
|
12
13
|
if (Plugin && containerRef.current) {
|
|
13
14
|
const instance = new Plugin(containerRef.current, { config: options });
|
|
@@ -17,7 +18,7 @@ export function PexipEngagePlugin({ className, fallback, id, onInstanceChange: _
|
|
|
17
18
|
onInstanceChange(null);
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
|
-
}, [Plugin, options]);
|
|
21
|
+
}, [Plugin, options, onInstanceChange]);
|
|
21
22
|
if (status === "failed" && isValidElement(fallback)) {
|
|
22
23
|
return fallback;
|
|
23
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PexipEngagePlugin.js","sourceRoot":"","sources":["../src/PexipEngagePlugin.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PexipEngagePlugin.js","sourceRoot":"","sources":["../src/PexipEngagePlugin.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAUrE,SAAS,IAAI,KAAI,CA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react",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.55",
|
|
4
4
|
"description": "React wrapper component for the Pexip Engage Plugin",
|
|
5
5
|
"homepage": "https://github.com/skedify/frontend-mono/tree/develop/apps/booking-plugin/packages/plugin-react#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@pexip-engage/tsconfig": "0.1.1",
|
|
37
|
-
"eslint-config-pexip-engage": "1.2.
|
|
37
|
+
"eslint-config-pexip-engage": "1.2.4"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PluginInstance } from "@pexip-engage-public/plugin/instance";
|
|
2
|
-
import {
|
|
2
|
+
import { useRefEffectEvent } from "@pexip-engage-public/utils/use-effect-event";
|
|
3
|
+
import { isValidElement, useEffect, useRef } from "react";
|
|
3
4
|
|
|
4
5
|
import type { PexipEngagePluginContextProps } from "./PexipEngageContext.js";
|
|
5
6
|
import { usePexipEngagePlugin } from "./usePexipEngagePlugin.js";
|
|
@@ -27,7 +28,7 @@ export function PexipEngagePlugin({
|
|
|
27
28
|
const { Plugin, status } = usePexipEngagePlugin(scriptSrc);
|
|
28
29
|
const options = usePluginConfiguration(config);
|
|
29
30
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
30
|
-
const onInstanceChange =
|
|
31
|
+
const onInstanceChange = useRefEffectEvent(_onInstanceChange);
|
|
31
32
|
|
|
32
33
|
useEffect(() => {
|
|
33
34
|
if (Plugin && containerRef.current) {
|
|
@@ -39,7 +40,7 @@ export function PexipEngagePlugin({
|
|
|
39
40
|
onInstanceChange(null);
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
|
-
}, [Plugin, options]);
|
|
43
|
+
}, [Plugin, options, onInstanceChange]);
|
|
43
44
|
|
|
44
45
|
if (status === "failed" && isValidElement(fallback)) {
|
|
45
46
|
return fallback;
|