@getpara/graz-connector 0.1.0-alpha.6 → 2.0.0-dev.10

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.
@@ -1,36 +0,0 @@
1
- "use client";
2
- import {
3
- __async,
4
- __spreadProps,
5
- __spreadValues
6
- } from "./chunk-IV3L3JVM.js";
7
- import { jsx } from "react/jsx-runtime";
8
- import { ParaModal } from "@getpara/react-sdk";
9
- function renderModal(para, modalProps, onCloseArg) {
10
- const existingContainer = document.getElementById("para-modal");
11
- const container = existingContainer != null ? existingContainer : document.createElement("div");
12
- container.id = "para-modal";
13
- if (!existingContainer) {
14
- document.body.appendChild(container);
15
- }
16
- const onClose = () => {
17
- onCloseArg();
18
- modalProps.onClose && modalProps.onClose();
19
- render(false);
20
- };
21
- const render = (isOpen) => __async(this, null, function* () {
22
- const Modal = /* @__PURE__ */ jsx(ParaModal, __spreadProps(__spreadValues({}, modalProps), { onClose, para, isOpen }));
23
- try {
24
- const client = yield import("react-dom/client");
25
- const root = client.createRoot(container);
26
- root.render(Modal);
27
- } catch (e) {
28
- const ReactDOM = yield import("react-dom");
29
- ReactDOM.render(Modal, container);
30
- }
31
- });
32
- render(true);
33
- }
34
- export {
35
- renderModal
36
- };
@@ -1,32 +0,0 @@
1
- import ParaWeb, { ParaModal, ParaModalProps } from '@getpara/react-sdk';
2
-
3
- export function renderModal(para: ParaWeb, modalProps: Partial<ParaModalProps>, onCloseArg: () => void): void {
4
- const existingContainer = document.getElementById('para-modal');
5
- const container = existingContainer ?? document.createElement('div');
6
- container.id = 'para-modal';
7
-
8
- if (!existingContainer) {
9
- document.body.appendChild(container);
10
- }
11
-
12
- const onClose = () => {
13
- onCloseArg();
14
- modalProps.onClose && modalProps.onClose();
15
- render(false);
16
- };
17
-
18
- const render = async (isOpen: boolean) => {
19
- const Modal = <ParaModal {...modalProps} onClose={onClose} para={para} isOpen={isOpen} />;
20
-
21
- try {
22
- const client = await import('react-dom/client');
23
- const root = client.createRoot(container);
24
- root.render(Modal);
25
- } catch (e) {
26
- const ReactDOM = await import('react-dom');
27
- ReactDOM.render(Modal, container);
28
- }
29
- };
30
-
31
- render(true);
32
- }