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

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/tsconfig.json CHANGED
@@ -6,8 +6,8 @@
6
6
  "jsx": "react-jsx",
7
7
  "module": "ESNext",
8
8
  "declaration": true,
9
- "declarationDir": "dist"
9
+ "declarationDir": "./dist"
10
10
  },
11
- "include": ["**/*.ts", "**/*.tsx"],
12
- "exclude": ["node_modules", "dist"]
11
+ "include": ["src/**/*.ts", "src/**/*.tsx"],
12
+ "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.test.tsx", "__tests__"]
13
13
  }
@@ -0,0 +1,22 @@
1
+ import { mergeConfig } from 'vite';
2
+ import baseConfig from '../../vitest.config.js';
3
+
4
+ export default mergeConfig(baseConfig, {
5
+ test: {
6
+ environment: 'jsdom',
7
+ coverage: {
8
+ provider: 'v8',
9
+ reporter: ['html', 'text'],
10
+ all: true,
11
+ include: ['src/**/*.{ts,tsx,js,jsx}'],
12
+ thresholds: {
13
+ lines: 98,
14
+ functions: 90,
15
+ branches: 98,
16
+ statements: 98,
17
+ },
18
+ reportOnFailure: true,
19
+ exclude: ['src/index.ts'],
20
+ },
21
+ },
22
+ });
@@ -1,46 +0,0 @@
1
- "use client";
2
- var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __spreadValues = (a, b) => {
10
- for (var prop in b || (b = {}))
11
- if (__hasOwnProp.call(b, prop))
12
- __defNormalProp(a, prop, b[prop]);
13
- if (__getOwnPropSymbols)
14
- for (var prop of __getOwnPropSymbols(b)) {
15
- if (__propIsEnum.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- }
18
- return a;
19
- };
20
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
- var __async = (__this, __arguments, generator) => {
22
- return new Promise((resolve, reject) => {
23
- var fulfilled = (value) => {
24
- try {
25
- step(generator.next(value));
26
- } catch (e) {
27
- reject(e);
28
- }
29
- };
30
- var rejected = (value) => {
31
- try {
32
- step(generator.throw(value));
33
- } catch (e) {
34
- reject(e);
35
- }
36
- };
37
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
38
- step((generator = generator.apply(__this, __arguments)).next());
39
- });
40
- };
41
-
42
- export {
43
- __spreadValues,
44
- __spreadProps,
45
- __async
46
- };
@@ -1,2 +0,0 @@
1
- import ParaWeb, { ParaModalProps } from '@getpara/react-sdk';
2
- export declare function renderModal(para: ParaWeb, modalProps: Partial<ParaModalProps>, onCloseArg: () => void): void;
@@ -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
- }