@pexip-engage-public/plugin-react
Advanced tools
Comparing version 1.0.7 to 1.0.8
# @pexip-engage-public/plugin-react | ||
## 1.0.8 | ||
### Patch Changes | ||
- f8a23b8ec: chore: update prop passing signature to plugin-react | ||
- Updated dependencies [c5b0843cf] | ||
- @pexip-engage-public/plugin-configuration-parser@1.0.7 | ||
- @pexip-engage-public/plugin-instance@1.0.8 | ||
## 1.0.7 | ||
@@ -4,0 +13,0 @@ |
{ | ||
"name": "@pexip-engage-public/plugin-react", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "React wrapper component for the Pexip Engage Plugin", | ||
@@ -40,4 +40,4 @@ "homepage": "https://github.com/skedify/frontend-mono/tree/develop/apps/plugin-remix/packages/plugin-react#readme", | ||
"deepmerge": "4.2.2", | ||
"@pexip-engage-public/plugin-configuration-parser": "1.0.6", | ||
"@pexip-engage-public/plugin-instance": "1.0.7" | ||
"@pexip-engage-public/plugin-configuration-parser": "1.0.7", | ||
"@pexip-engage-public/plugin-instance": "1.0.8" | ||
}, | ||
@@ -44,0 +44,0 @@ "devDependencies": { |
@@ -7,4 +7,4 @@ # @pexip-engage-public/plugin-react | ||
- `<PexipEngagePlugin configuration={configuration} />`: | ||
React Component that renders the plugin inside a `div`. You can pass plugin options to it using the `configuration` prop. All other props are passed through to the underlying `div` element. | ||
- `<PexipEngagePlugin {...configuration} />`: | ||
React Component that renders the plugin inside a `div`. You can pass plugin options to it. `className`, `id` & `style` are passed through to the underlying `div` element. | ||
@@ -23,3 +23,3 @@ - `<PexipEngagePluginProvider value={configuration}>`: | ||
meetingTypes: "video", | ||
offices: { ids: "1" } | ||
office: { ids: "1" } | ||
}; | ||
@@ -31,3 +31,3 @@ | ||
{/* All <PexipEngagePlugin /> components will now merge their own passed configuration with the defaultConfig value */} | ||
<PexipEngagePlugin configuration={{ config: { subjects: { ids: "1" } }}}> | ||
<PexipEngagePlugin subject={{ ids: "1" }}> | ||
</PexipEngagePluginProvider> | ||
@@ -34,0 +34,0 @@ ); |
@@ -10,4 +10,6 @@ import { useEffect, useReducer } from "react"; | ||
function createPlugin(src: string) { | ||
if (!document.getElementById(src)) { | ||
function createPlugin({ onError, src }: { src: string; onError: () => unknown }) { | ||
const scriptEl = document.getElementById(src); | ||
if (!scriptEl) { | ||
const script = document.createElement("script"); | ||
@@ -18,3 +20,9 @@ script.src = src; | ||
script.id = src; | ||
script.onerror = () => { | ||
script.setAttribute("data-status", "error"); | ||
onError(); | ||
}; | ||
document.body.appendChild(script); | ||
} else if (scriptEl.getAttribute("data-status") === "error") { | ||
onError(); | ||
} | ||
@@ -80,3 +88,3 @@ } | ||
createPlugin(src); | ||
createPlugin({ src, onError: () => dispatch({ type: "failed" }) }); | ||
@@ -83,0 +91,0 @@ return () => document.removeEventListener(PEXIP_ENGAGE_PLUGIN_EVENT, listener); |
@@ -5,2 +5,3 @@ export type { PexipEngagePluginContextProps } from "./PexipEngageContext"; | ||
export { usePexipEngagePlugin } from "./usePexipEngagePlugin"; | ||
export { PEXIP_ENGAGE_PLUGIN_EVENT } from "@pexip-engage-public/plugin-instance"; | ||
//# sourceMappingURL=index.d.ts.map |
/// <reference types="react" /> | ||
import { PluginInstance } from "@pexip-engage-public/plugin-instance"; | ||
import { PexipEngagePluginContextProps } from "./PexipEngageContext"; | ||
interface PexipEngagePluginProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> { | ||
config?: PexipEngagePluginContextProps; | ||
interface PexipEngagePluginProps extends PexipEngagePluginContextProps { | ||
onInstanceChange?: (instance: PluginInstance | null) => unknown; | ||
fallback?: React.ReactElement<unknown, string | React.FunctionComponent> | null; | ||
className?: string; | ||
id?: string; | ||
style?: React.CSSProperties; | ||
} | ||
export declare function PexipEngagePlugin({ onInstanceChange, config: { scriptSrc, ...config }, ...props }: PexipEngagePluginProps): JSX.Element; | ||
export declare function PexipEngagePlugin({ className, fallback, id, onInstanceChange, scriptSrc, style, ...config }: PexipEngagePluginProps): JSX.Element; | ||
export {}; | ||
//# sourceMappingURL=PexipEngagePlugin.d.ts.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
129278
437
+ Added@pexip-engage-public/plugin-configuration@1.0.3(transitive)
+ Added@pexip-engage-public/plugin-configuration-parser@1.0.7(transitive)
+ Added@pexip-engage-public/plugin-events@1.0.4(transitive)
+ Added@pexip-engage-public/plugin-instance@1.0.8(transitive)
+ Added@pexip-engage-public/plugin-state@1.0.3(transitive)
+ Addedcall-bind-apply-helpers@1.0.1(transitive)
+ Addedzod@3.24.1(transitive)
- Removed@pexip-engage-public/plugin-configuration@1.0.2(transitive)
- Removed@pexip-engage-public/plugin-configuration-parser@1.0.6(transitive)
- Removed@pexip-engage-public/plugin-events@1.0.3(transitive)
- Removed@pexip-engage-public/plugin-instance@1.0.7(transitive)
- Removed@pexip-engage-public/plugin-state@1.0.2(transitive)
- Removedcall-bind-apply-helpers@1.0.2(transitive)
- Removedzod@3.24.2(transitive)
Updated@pexip-engage-public/plugin-configuration-parser@1.0.7