@integration-app/react 2.0.1 → 2.0.3-beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. package/dist/index.d.ts +19953 -3
  2. package/dist/index.js +807 -65
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.module.d.mts +20575 -0
  5. package/dist/index.module.mjs +809 -68
  6. package/dist/index.module.mjs.map +1 -1
  7. package/dist/tsconfig.tsbuildinfo +1 -0
  8. package/package.json +46 -15
  9. package/DEVELOPMENT.md +0 -82
  10. package/bundle-tests/test-frameworks/README.md +0 -4
  11. package/bundle-tests/test-frameworks/cra5react17/package-lock.json +0 -30749
  12. package/bundle-tests/test-frameworks/cra5react17/package.json +0 -42
  13. package/bundle-tests/test-frameworks/cra5react17/patches/react-scripts+5.0.0.patch +0 -15
  14. package/bundle-tests/test-frameworks/cra5react17/public/favicon.ico +0 -0
  15. package/bundle-tests/test-frameworks/cra5react17/public/index.html +0 -43
  16. package/bundle-tests/test-frameworks/cra5react17/public/logo192.png +0 -0
  17. package/bundle-tests/test-frameworks/cra5react17/public/logo512.png +0 -0
  18. package/bundle-tests/test-frameworks/cra5react17/public/manifest.json +0 -25
  19. package/bundle-tests/test-frameworks/cra5react17/public/robots.txt +0 -3
  20. package/bundle-tests/test-frameworks/cra5react17/src/IntegrationsTest.jsx +0 -42
  21. package/bundle-tests/test-frameworks/cra5react17/src/index.tsx +0 -10
  22. package/bundle-tests/test-frameworks/cra5react17/src/react-app-env.d.ts +0 -1
  23. package/bundle-tests/test-frameworks/cra5react17/tsconfig.json +0 -26
  24. package/bundle-tests/test-frameworks/cra5react18/package-lock.json +0 -30328
  25. package/bundle-tests/test-frameworks/cra5react18/package.json +0 -38
  26. package/bundle-tests/test-frameworks/cra5react18/public/favicon.ico +0 -0
  27. package/bundle-tests/test-frameworks/cra5react18/public/index.html +0 -43
  28. package/bundle-tests/test-frameworks/cra5react18/public/logo192.png +0 -0
  29. package/bundle-tests/test-frameworks/cra5react18/public/logo512.png +0 -0
  30. package/bundle-tests/test-frameworks/cra5react18/public/manifest.json +0 -25
  31. package/bundle-tests/test-frameworks/cra5react18/public/robots.txt +0 -3
  32. package/bundle-tests/test-frameworks/cra5react18/src/IntegrationsTest.jsx +0 -42
  33. package/bundle-tests/test-frameworks/cra5react18/src/index.tsx +0 -10
  34. package/bundle-tests/test-frameworks/cra5react18/src/logo.svg +0 -1
  35. package/bundle-tests/test-frameworks/cra5react18/src/react-app-env.d.ts +0 -1
  36. package/bundle-tests/test-frameworks/cra5react18/tsconfig.json +0 -26
  37. package/bundle-tests/test-frameworks/next12react17/next.config.js +0 -6
  38. package/bundle-tests/test-frameworks/next12react17/package.json +0 -18
  39. package/bundle-tests/test-frameworks/next12react17/pages/_app.js +0 -5
  40. package/bundle-tests/test-frameworks/next12react17/pages/index.js +0 -5
  41. package/bundle-tests/test-frameworks/next12react17/src/IntegrationsTest.jsx +0 -25
  42. package/bundle-tests/test-frameworks/next12react18/next.config.js +0 -6
  43. package/bundle-tests/test-frameworks/next12react18/package.json +0 -18
  44. package/bundle-tests/test-frameworks/next12react18/pages/_app.js +0 -5
  45. package/bundle-tests/test-frameworks/next12react18/pages/index.js +0 -5
  46. package/bundle-tests/test-frameworks/next12react18/src/IntegrationsTest.jsx +0 -41
  47. package/bundle-tests/test-frameworks/next13react18/app/layout.tsx +0 -18
  48. package/bundle-tests/test-frameworks/next13react18/app/page.tsx +0 -5
  49. package/bundle-tests/test-frameworks/next13react18/next-env.d.ts +0 -5
  50. package/bundle-tests/test-frameworks/next13react18/next.config.js +0 -6
  51. package/bundle-tests/test-frameworks/next13react18/package.json +0 -22
  52. package/bundle-tests/test-frameworks/next13react18/src/IntegrationsTest.tsx +0 -43
  53. package/bundle-tests/test-frameworks/next13react18/src/IntegrationsTestReact.tsx +0 -28
  54. package/bundle-tests/test-frameworks/next13react18/src/IntegrationsTestSdk.tsx +0 -19
  55. package/bundle-tests/test-frameworks/next13react18/tsconfig.json +0 -34
  56. package/bundle-tests/test-frameworks/parcel2react17/package.json +0 -21
  57. package/bundle-tests/test-frameworks/parcel2react17/src/IntegrationsTest.js +0 -41
  58. package/bundle-tests/test-frameworks/parcel2react17/src/index.html +0 -12
  59. package/bundle-tests/test-frameworks/parcel2react17/src/index.js +0 -12
  60. package/bundle-tests/test-frameworks/parcel2react18/package.json +0 -21
  61. package/bundle-tests/test-frameworks/parcel2react18/src/IntegrationsTest.js +0 -41
  62. package/bundle-tests/test-frameworks/parcel2react18/src/index.html +0 -12
  63. package/bundle-tests/test-frameworks/parcel2react18/src/index.js +0 -11
  64. package/bundle-tests/test-frameworks/vite3react17/index.html +0 -12
  65. package/bundle-tests/test-frameworks/vite3react17/package.json +0 -26
  66. package/bundle-tests/test-frameworks/vite3react17/src/IntegrationsTest.tsx +0 -41
  67. package/bundle-tests/test-frameworks/vite3react17/src/main.tsx +0 -10
  68. package/bundle-tests/test-frameworks/vite3react17/src/vite-env.d.ts +0 -1
  69. package/bundle-tests/test-frameworks/vite3react17/tsconfig.json +0 -25
  70. package/bundle-tests/test-frameworks/vite3react17/tsconfig.node.json +0 -10
  71. package/bundle-tests/test-frameworks/vite3react17/vite.config.ts +0 -7
  72. package/bundle-tests/test-frameworks/vite4react17/index.html +0 -12
  73. package/bundle-tests/test-frameworks/vite4react17/package.json +0 -26
  74. package/bundle-tests/test-frameworks/vite4react17/src/IntegrationsTest.tsx +0 -41
  75. package/bundle-tests/test-frameworks/vite4react17/src/main.tsx +0 -10
  76. package/bundle-tests/test-frameworks/vite4react17/src/vite-env.d.ts +0 -1
  77. package/bundle-tests/test-frameworks/vite4react17/tsconfig.json +0 -25
  78. package/bundle-tests/test-frameworks/vite4react17/tsconfig.node.json +0 -10
  79. package/bundle-tests/test-frameworks/vite4react17/vite.config.ts +0 -7
  80. package/bundle-tests/test-frameworks/vite4react18/index.html +0 -12
  81. package/bundle-tests/test-frameworks/vite4react18/package.json +0 -26
  82. package/bundle-tests/test-frameworks/vite4react18/src/IntegrationsTest.tsx +0 -41
  83. package/bundle-tests/test-frameworks/vite4react18/src/main.tsx +0 -11
  84. package/bundle-tests/test-frameworks/vite4react18/src/vite-env.d.ts +0 -1
  85. package/bundle-tests/test-frameworks/vite4react18/tsconfig.json +0 -25
  86. package/bundle-tests/test-frameworks/vite4react18/tsconfig.node.json +0 -10
  87. package/bundle-tests/test-frameworks/vite4react18/vite.config.ts +0 -7
  88. package/bundle-tests/test-package/package.json +0 -10
  89. package/bundle-tests/test-package/test-cjs.js +0 -11
  90. package/bundle-tests/test-package/test-esm.mjs +0 -11
  91. package/bundle-tests/test-package/test-umd.js +0 -25
  92. package/bundle-tests/test-package/test.sh +0 -30
  93. package/dist/index.module.d.ts +0 -625
  94. package/src/_modules/README.txt +0 -1
  95. package/src/_modules/awesome-debounce-promise.ts +0 -8
  96. package/src/contexts/index.tsx +0 -4
  97. package/src/contexts/integration-app-context.tsx +0 -61
  98. package/src/hooks/actions/useAction.ts +0 -37
  99. package/src/hooks/actions/useActionInstance.ts +0 -60
  100. package/src/hooks/actions/useActionInstances.ts +0 -11
  101. package/src/hooks/actions/useActions.ts +0 -11
  102. package/src/hooks/app-data-schemas/useAppDataSchema.ts +0 -20
  103. package/src/hooks/app-data-schemas/useAppDataSchemaInstance.ts +0 -43
  104. package/src/hooks/app-data-schemas/useAppDataSchemaInstances.ts +0 -19
  105. package/src/hooks/app-data-schemas/useAppDataSchemas.ts +0 -11
  106. package/src/hooks/app-events/useAppEventSubscription.ts +0 -22
  107. package/src/hooks/app-events/useAppEventSubscriptions.ts +0 -19
  108. package/src/hooks/app-events/useAppEventType.ts +0 -20
  109. package/src/hooks/app-events/useAppEventTypes.ts +0 -11
  110. package/src/hooks/app-events/useAppEvents.ts +0 -11
  111. package/src/hooks/customers/useCustomer.ts +0 -19
  112. package/src/hooks/customers/useCustomers.ts +0 -11
  113. package/src/hooks/data-collections/useDataCollectionSpec.ts +0 -30
  114. package/src/hooks/data-form/index.tsx +0 -3
  115. package/src/hooks/data-links/useDataLinkTable.ts +0 -20
  116. package/src/hooks/data-links/useDataLinkTableInstance.ts +0 -39
  117. package/src/hooks/data-links/useDataLinkTableInstances.ts +0 -19
  118. package/src/hooks/data-links/useDataLinkTables.ts +0 -11
  119. package/src/hooks/data-sources/useDataSource.ts +0 -39
  120. package/src/hooks/data-sources/useDataSourceInstance.ts +0 -105
  121. package/src/hooks/data-sources/useDataSourceInstanceCollection.ts +0 -29
  122. package/src/hooks/data-sources/useDataSourceInstances.ts +0 -17
  123. package/src/hooks/data-sources/useDataSources.ts +0 -11
  124. package/src/hooks/external-events/useExternalEventSubscription.ts +0 -60
  125. package/src/hooks/external-events/useExternalEventSubscriptions.ts +0 -19
  126. package/src/hooks/field-mappings/useFieldMapping.ts +0 -39
  127. package/src/hooks/field-mappings/useFieldMappingInstance.ts +0 -56
  128. package/src/hooks/field-mappings/useFieldMappingInstances.ts +0 -19
  129. package/src/hooks/field-mappings/useFieldMappings.ts +0 -11
  130. package/src/hooks/flows/useFlow.ts +0 -35
  131. package/src/hooks/flows/useFlowInstance.ts +0 -79
  132. package/src/hooks/flows/useFlowInstances.ts +0 -11
  133. package/src/hooks/flows/useFlowRun.ts +0 -24
  134. package/src/hooks/flows/useFlowRuns.ts +0 -11
  135. package/src/hooks/flows/useFlows.ts +0 -11
  136. package/src/hooks/integrations/useConnection.ts +0 -21
  137. package/src/hooks/integrations/useConnections.ts +0 -12
  138. package/src/hooks/integrations/useConnectorSpec.ts +0 -16
  139. package/src/hooks/integrations/useIntegration.ts +0 -20
  140. package/src/hooks/integrations/useIntegrations.ts +0 -12
  141. package/src/hooks/scenarios/useScenario.tsx +0 -20
  142. package/src/hooks/scenarios/useScenarios.tsx +0 -11
  143. package/src/hooks/screens/useScreen.ts +0 -19
  144. package/src/hooks/useElement.tsx +0 -199
  145. package/src/hooks/useElements.tsx +0 -108
  146. package/src/hooks/useIntegrationAppSWR.tsx +0 -13
  147. package/src/hooks/useIntegrationElement.tsx +0 -19
  148. package/src/index.tsx +0 -70
  149. package/tsconfig.json +0 -40
package/package.json CHANGED
@@ -1,29 +1,38 @@
1
1
  {
2
2
  "name": "@integration-app/react",
3
- "version": "2.0.1",
3
+ "version": "2.0.3-beta.0",
4
4
  "description": "",
5
5
  "author": "Integration.app",
6
- "source": "src/index.ts",
6
+ "source": "src/index.tsx",
7
+ "main": "dist/index.js",
8
+ "module": "dist/index.module.mjs",
9
+ "unpkg": "./dist/index.umd.js",
7
10
  "exports": {
8
- "types": "./dist/index.d.ts",
9
- "require": "./dist/index.js",
10
- "import": "./dist/index.module.mjs"
11
+ "import": {
12
+ "types": "./dist/index.module.d.mts",
13
+ "default": "./dist/index.module.mjs"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.js"
18
+ }
11
19
  },
12
- "types": "./dist/index.d.ts",
13
- "main": "./dist/index.js",
14
- "module": "./dist/index.module.mjs",
20
+ "types": "dist/index.d.ts",
21
+ "files": [
22
+ "dist"
23
+ ],
15
24
  "scripts": {
16
25
  "build": "npm run prep:dev && npm run build:bundle && npm run build:dts",
17
26
  "build:publish": "npm run prep:publish && npm run build:bundle && npm run build:dts",
18
27
  "build:bundle": "rollup -c rollup.config.mjs",
19
- "build:dts": "rollup -c rollup.dts.config.mjs",
28
+ "build:dts": "rollup -c rollup.dts.config.mjs && rimraf ./dist/src",
20
29
  "clean": "rimraf ./dist",
21
30
  "docs": "typedoc --tsconfig tsconfig.json --plugin typedoc-plugin-missing-exports",
22
31
  "docs:dev": "typedoc --tsconfig tsconfig.json --plugin typedoc-plugin-missing-exports --watch",
23
32
  "dev": "npm run build && concurrently 'npm run dev:bundle' 'npm run dev:dts'",
24
33
  "dev:bundle": "rollup -c rollup.config.mjs --watch",
25
34
  "dev:dts": "rollup -c rollup.dts.config.mjs --watch",
26
- "install:publishDeps": "npm i @integration-app/sdk@latest --save",
35
+ "install:publishDeps": "npm i @integration-app/sdk@latest --save && panda codegen",
27
36
  "install:localDeps": "npm i ../sdk --save",
28
37
  "prep:publish": "npm run clean && npm run install:publishDeps",
29
38
  "prep:dev": "npm run clean && npm run install:localDeps && npm run removeReactPackages",
@@ -32,29 +41,51 @@
32
41
  "removeReactPackages": "rimraf -rf ./node_modules/react ./node_modules/react-dom",
33
42
  "test:package": "cd bundle-tests/test-package && ./test.sh && cd ..",
34
43
  "version": "npm version",
35
- "lint": "npx publint"
44
+ "lint": "npx publint",
45
+ "prepare": "panda codegen",
46
+ "storybook": "storybook dev -p 6006",
47
+ "build-storybook": "storybook build"
36
48
  },
37
49
  "dependencies": {
38
- "@integration-app/sdk": "^1.3.1",
50
+ "@ark-ui/react": "^3.9.0",
51
+ "@integration-app/sdk": "^1.3.3",
39
52
  "awesome-debounce-promise": "^2.1.0",
40
53
  "query-string": "^7.1.1",
41
- "swr": "^2.2.0"
54
+ "swr": "^2.2.0",
55
+ "vite-tsconfig-paths": "^5.0.1"
42
56
  },
43
57
  "peerDependencies": {
44
58
  "react": "^18.3.1",
45
59
  "react-dom": "^18.3.1"
46
60
  },
47
61
  "devDependencies": {
62
+ "@chromatic-com/storybook": "^1.7.0",
63
+ "@pandacss/dev": "^0.45.1",
64
+ "@park-ui/panda-preset": "^0.42.0",
48
65
  "@rollup/plugin-commonjs": "^26.0.1",
49
66
  "@rollup/plugin-json": "^6.1.0",
50
67
  "@rollup/plugin-node-resolve": "^15.2.3",
51
68
  "@rollup/plugin-typescript": "^11.1.6",
52
- "@types/react": "^17.0.37",
53
- "@types/react-dom": "^17.0.11",
69
+ "@storybook/addon-essentials": "^8.2.9",
70
+ "@storybook/addon-interactions": "^8.2.9",
71
+ "@storybook/addon-links": "^8.2.9",
72
+ "@storybook/addon-mdx-gfm": "^8.2.9",
73
+ "@storybook/addon-onboarding": "^8.2.9",
74
+ "@storybook/blocks": "^8.2.9",
75
+ "@storybook/react": "^8.2.9",
76
+ "@storybook/react-vite": "^8.2.9",
77
+ "@storybook/test": "^8.2.9",
78
+ "@types/react": "^18.3.0",
79
+ "@types/react-dom": "^18.3.0",
80
+ "@vitejs/plugin-react": "^4.3.1",
54
81
  "concurrently": "^8.0.1",
55
82
  "rimraf": "^5.0.5",
56
83
  "rollup": "^4.21.0",
84
+ "rollup-plugin-copy": "^3.5.0",
57
85
  "rollup-plugin-dts": "^6.1.1",
86
+ "rollup-plugin-tsc-alias": "^1.1.2",
87
+ "rollup-plugin-tsconfig-paths": "^1.5.2",
88
+ "storybook": "^8.2.9",
58
89
  "typedoc": "^0.25.4",
59
90
  "typedoc-plugin-mark-react-functional-components": "^0.2.2",
60
91
  "typedoc-plugin-missing-exports": "^2.1.0",
package/DEVELOPMENT.md DELETED
@@ -1,82 +0,0 @@
1
- ## Releasing Package
2
-
3
- To release a new version of a package (@integration-app/sdk, @integration-app/ui, @integration-app/react), do the following:
4
-
5
- * Go to the package and type `npm version -- patch` (or `npm version -- minor` or `npm version -- major`) to bump the version.
6
- * Create a PR with the changes.
7
- * Merge the PR.
8
- * Run a Github Action to publish a package.
9
-
10
- # Rollup Configuration
11
-
12
- To see the complete configuration, refer to the `rollup.config.mjs` and `rollup.dts.config.mjs` files. Although these files are self-explanatory, here's some additional information:
13
-
14
- In `rollup.config.mjs`, we set `{external: [/node_modules/]}` to exclude our dependencies from being bundled.
15
-
16
- ## Bundle and DTS File Generation
17
-
18
- We encountered issues with `rollup-plugin-dts` generating incorrect DTS files when used in the same configuration as `@rollup/plugin-typescript`. To resolve this, we use two Rollup configurations:
19
- - `rollup.config.mjs` for bundle generation
20
- - `rollup.dts.config.mjs` for DTS file generation.
21
-
22
- ## Externals
23
-
24
- We set external dependencies in `rollup.config.mjs`:
25
- - `{external: [/node_modules/]}` to exclude all `node_modules`.
26
- - `@integration-app/sdk` to prevent Rollup from bundling the `@integration-app/sdk` package during local development, when it is used via a symlink to the SDK in the root folder.
27
- - `react` and `react/jsx-runtime` are excluded to avoid unresolved dependency errors, as React is a peer dependency.
28
-
29
- ## Bundle and DTS File Generation Workflow
30
-
31
- When using `rollup-plugin-dts` and `@rollup/plugin-typescript` in the same configuration, we experienced issues with generating incorrect DTS files. To solve this, we use two Rollup configurations:
32
- - `rollup.config.mjs` for generating bundles
33
- - `rollup.dts.config.mjs` for generating DTS files.
34
-
35
- ### Build
36
-
37
- For local build, the following steps are taken:
38
-
39
- - Clean the `/dist` folder.
40
- - Install local `@integration-app/sdk` pointed to `sdk` folder
41
- - Remove `react` and `react-dom` packages from `node_modules` folder
42
- - We should do it to allow out package work in `console`, `engine` and other local projects
43
- - Rollup with `rollup.config.mjs` configuration generates bundle files and basic DTS files, which are placed in the `dist/dts` folder.
44
- - Rollup with `rollup.dts.config.mjs` configuration uses the basic DTS files to generate `*.d.ts` files for each bundle.
45
-
46
- ### Development
47
-
48
- During development, the following steps are taken:
49
-
50
- - Run `build` to generate bundle and DTS files.
51
- - If not, Rollup with `rollup.dts.config.mjs` in watch mode fails due to missing DTS files (race condition).
52
- - Concurrently run two Rollup processes **in watch mode**:
53
- - Rollup with `rollup.config.mjs` configuration to generate bundle files and basic DTS files.
54
- - Rollup with `rollup.dts.config.mjs` configuration to generate DTS files for each bundle.
55
-
56
- ### Publish via GitHub
57
-
58
- During publishing via GitHub, the following steps are taken:
59
-
60
- - Clean the `/dist` folder.
61
- - Install `@integration-app/sdk@latest` package
62
- - Rollup with `rollup.config.mjs` configuration generates bundle files and basic DTS files, which are placed in the `dist/dts` folder.
63
- - Rollup with `rollup.dts.config.mjs` configuration uses the basic DTS files to generate `*.d.ts` files for each bundle.
64
-
65
- The `build:publish` command is used in GitHub Actions to ensure that the package uses the latest `@integration-app/sdk` package.
66
-
67
- # Package.json exports
68
-
69
- ```json5
70
- {
71
- "exports": {
72
- "types": "./dist/index.d.ts", // TypeScript typings for NodeNext modules
73
- "require": "./dist/index.js", // used for require() in Node 12+
74
- "import": "./dist/index.module.mjs" // ESM bundle
75
- },
76
- "types": "./dist/index.d.ts", // TypeScript typings
77
- "main": "./dist/index.js", // CommonJS bundle
78
- "module": "./dist/index.module.mjs", // ESM bundle
79
- "unpkg": "./dist/index.umd.js", // UMD bundle
80
- }
81
- ```
82
-
@@ -1,4 +0,0 @@
1
- # How to run test-frameworks locally
2
-
3
- 1. Install `act`: https://github.com/nektos/act
4
- 2. Run `act -j packages-framework-test` from the root of the repo