diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e72b3ba..5f3f0172 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [14.x] + node-version: [16.x] steps: - uses: actions/checkout@v2 @@ -33,7 +33,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - node-version: [14.x] + node-version: [16.x] steps: - uses: actions/checkout@v2 @@ -53,7 +53,7 @@ jobs: strategy: matrix: - node-version: [14.x] + node-version: [16.x] steps: - uses: actions/checkout@v2 diff --git a/package.json b/package.json index bc14b217..273d02f0 100644 --- a/package.json +++ b/package.json @@ -40,9 +40,9 @@ "@types/react-router": "^5.1.11", "@types/react-router-dom": "^5.1.7", "@types/react-table": "^7.0.28", - "choices.js": "^10.1.0", + "@formio/choices.js": "^10.2.0", "connected-react-router": "6.9.1", - "formiojs": "^4.14.8", + "formiojs": "^4.14.13", "history": "5.3.0", "lerna": "5.1.8", "lodash": "4.17.20", diff --git a/packages/config/jest/jest.web.config.js b/packages/config/jest/jest.web.config.js index 44bccbe7..a92f4b29 100644 --- a/packages/config/jest/jest.web.config.js +++ b/packages/config/jest/jest.web.config.js @@ -1,8 +1,8 @@ /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ module.exports = { roots: ["/src"], - collectCoverageFrom: ["src/**/*.{js,jsx,ts,tsx}", "!src/**/*.d.ts", "!src/mocks/**", "!src/__mock__/**"], - coveragePathIgnorePatterns: [], + collectCoverageFrom: ["src/**/*.{js,jsx,ts,tsx}", "!src/**/*.d.ts"], + coveragePathIgnorePatterns: [".stories.tsx", "__mock__/", "mocks/"], testEnvironment: "jsdom", setupFilesAfterEnv: [require.resolve("./setupTest.js")], transform: { diff --git a/packages/react-formio-container/package.json b/packages/react-formio-container/package.json index 345ab163..07dcfde5 100644 --- a/packages/react-formio-container/package.json +++ b/packages/react-formio-container/package.json @@ -17,11 +17,12 @@ "peerDependencies": { "@tsed/react-formio": "^1.4.0", "@tsed/redux-utils": "^1.4.0", - "choices.js": "^10.1.0", + "@tsed/react-formio-stores": "^1.4.0", + "@formio/choices.js": "^10.2.0", "classnames": "^2.3.1", "connected-react-router": "^6.9.1", "file-saver": "^2.0.5", - "formiojs": "^4.14.8", + "formiojs": "^4.14.13", "lodash": "^4.17.21", "prop-types": "^15.8.1", "react": "^17.0.2", @@ -36,6 +37,7 @@ }, "devDependencies": { "@tsed/react-formio": "1.14.1", + "@tsed/react-formio-stores": "1.14.1", "@types/file-saver": "^2.0.1", "file-saver": "^2.0.5" }, @@ -90,4 +92,4 @@ } }, "dependencies": {} -} \ No newline at end of file +} diff --git a/packages/react-formio-container/readme.md b/packages/react-formio-container/readme.md index 8cc83024..00aa402e 100644 --- a/packages/react-formio-container/readme.md +++ b/packages/react-formio-container/readme.md @@ -42,7 +42,7 @@ npm-compatible packaging system such as [Browserify](http://browserify.org/) or [webpack](http://webpack.github.io/). ```bash -npm install --save @tsed/react-formio-container file-saver +npm install --save @tsed/react-formio-stores @tsed/react-formio @tsed/react-formio-container file-saver npm install --save-dev @types/file-saver ``` diff --git a/packages/react-formio-container/src/hooks/useAction.hook.tsx b/packages/react-formio-container/src/hooks/useAction.hook.tsx index 77928b0a..fc5b95ad 100644 --- a/packages/react-formio-container/src/hooks/useAction.hook.tsx +++ b/packages/react-formio-container/src/hooks/useAction.hook.tsx @@ -13,7 +13,7 @@ import { selectForm, Submission, Utils -} from "@tsed/react-formio"; +} from "@tsed/react-formio-stores"; import { push } from "connected-react-router"; import noop from "lodash/noop"; import { useCallback, useEffect } from "react"; diff --git a/packages/react-formio-container/src/hooks/useActions.hook.ts b/packages/react-formio-container/src/hooks/useActions.hook.ts index 4a630fef..ce922e4e 100644 --- a/packages/react-formio-container/src/hooks/useActions.hook.ts +++ b/packages/react-formio-container/src/hooks/useActions.hook.ts @@ -7,7 +7,7 @@ import { selectAvailableActions, selectError, selectForm -} from "@tsed/react-formio"; +} from "@tsed/react-formio-stores"; import { push } from "connected-react-router"; import { useState } from "react"; import { useDispatch, useSelector } from "react-redux"; diff --git a/packages/react-formio-container/src/hooks/useForm.hook.ts b/packages/react-formio-container/src/hooks/useForm.hook.ts index 34210b15..fc7378f3 100644 --- a/packages/react-formio-container/src/hooks/useForm.hook.ts +++ b/packages/react-formio-container/src/hooks/useForm.hook.ts @@ -13,7 +13,7 @@ import { selectError, selectForm, selectRoot -} from "@tsed/react-formio"; +} from "@tsed/react-formio-stores"; import { push } from "connected-react-router"; import noop from "lodash/noop"; import { useEffect, useState } from "react"; diff --git a/packages/react-formio-container/src/hooks/useFormExport.tsx b/packages/react-formio-container/src/hooks/useFormExport.tsx index a4ac78ef..d0912896 100644 --- a/packages/react-formio-container/src/hooks/useFormExport.tsx +++ b/packages/react-formio-container/src/hooks/useFormExport.tsx @@ -1,4 +1,4 @@ -import { AuthState, selectAuth, selectForm } from "@tsed/react-formio"; +import { AuthState, selectAuth, selectForm } from "@tsed/react-formio-stores"; import noop from "lodash/noop"; import { useSelector } from "react-redux"; diff --git a/packages/react-formio-container/src/hooks/useForms.hook.ts b/packages/react-formio-container/src/hooks/useForms.hook.ts index bd001739..0783023b 100644 --- a/packages/react-formio-container/src/hooks/useForms.hook.ts +++ b/packages/react-formio-container/src/hooks/useForms.hook.ts @@ -1,4 +1,4 @@ -import { FormSchema, FormsState, getForms, Operation, selectRoot } from "@tsed/react-formio"; +import { FormSchema, FormsState, getForms, Operation, selectRoot } from "@tsed/react-formio-stores"; import { push } from "connected-react-router"; import { useCallback, useEffect, useState } from "react"; import { useDispatch, useSelector } from "react-redux"; diff --git a/packages/react-formio-container/src/hooks/useSubmission.hook.tsx b/packages/react-formio-container/src/hooks/useSubmission.hook.tsx index f26481ef..32a23f3e 100644 --- a/packages/react-formio-container/src/hooks/useSubmission.hook.tsx +++ b/packages/react-formio-container/src/hooks/useSubmission.hook.tsx @@ -13,7 +13,7 @@ import { selectRoot, selectSubmission, Submission -} from "@tsed/react-formio"; +} from "@tsed/react-formio-stores"; import { push } from "connected-react-router"; import noop from "lodash/noop"; import { useEffect, useRef } from "react"; diff --git a/packages/react-formio-container/src/hooks/useSubmissions.hook.tsx b/packages/react-formio-container/src/hooks/useSubmissions.hook.tsx index ffa2ae4a..4a0a6516 100644 --- a/packages/react-formio-container/src/hooks/useSubmissions.hook.tsx +++ b/packages/react-formio-container/src/hooks/useSubmissions.hook.tsx @@ -1,4 +1,4 @@ -import { getSubmissions, Operation, selectAuth, selectForm, selectRoot, Submission, SubmissionsState } from "@tsed/react-formio"; +import { getSubmissions, Operation, selectAuth, selectForm, selectRoot, Submission, SubmissionsState } from "@tsed/react-formio-stores"; import { push } from "connected-react-router"; import { useCallback, useEffect, useState } from "react"; import { useDispatch, useSelector } from "react-redux"; diff --git a/packages/react-formio-container/src/views/form.routes.tsx b/packages/react-formio-container/src/views/form.routes.tsx index 348f7a4a..2e6fbc4d 100644 --- a/packages/react-formio-container/src/views/form.routes.tsx +++ b/packages/react-formio-container/src/views/form.routes.tsx @@ -1,5 +1,5 @@ -import { AuthState, checkRoleFormAccess, FormSchema } from "@tsed/react-formio"; -import { TabsItemProps } from "@tsed/react-formio/src/components/tabs/tabs.component"; +import type { TabsItemProps } from "@tsed/react-formio"; +import { AuthState, checkRoleFormAccess, FormSchema } from "@tsed/react-formio-stores"; import React from "react"; import { FormAccessView } from "./formAccess.view"; diff --git a/packages/react-formio-stores/.env b/packages/react-formio-stores/.env new file mode 100644 index 00000000..6dfcc1a7 --- /dev/null +++ b/packages/react-formio-stores/.env @@ -0,0 +1,2 @@ +DISABLE_NEW_JSX_TRANSFORM=true +SKIP_PREFLIGHT_CHECK=true diff --git a/packages/react-formio-stores/.eslintignore b/packages/react-formio-stores/.eslintignore new file mode 100644 index 00000000..474be905 --- /dev/null +++ b/packages/react-formio-stores/.eslintignore @@ -0,0 +1,13 @@ +**/node_modules +docs +docs-references +**/lib +**/build +**/dist +**/coverage +**/.nyc_output +**/node_modules +*-lock.json +*.lock +benchmarks.* +**/generated diff --git a/packages/react-formio-stores/.eslintrc.js b/packages/react-formio-stores/.eslintrc.js new file mode 100644 index 00000000..3d887dbf --- /dev/null +++ b/packages/react-formio-stores/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: [require.resolve("@tsed/config/eslint/web")], + rules: { + "import/no-anonymous-default-export": 0, + "jsx-a11y/no-autofocus": 1 + } +}; diff --git a/packages/react-formio-stores/coverage.json b/packages/react-formio-stores/coverage.json new file mode 100644 index 00000000..39491537 --- /dev/null +++ b/packages/react-formio-stores/coverage.json @@ -0,0 +1,6 @@ +{ + "statements": 69.09, + "branches": 49.84, + "functions": 62.46, + "lines": 67.89 +} diff --git a/packages/react-formio-stores/jest.config.js b/packages/react-formio-stores/jest.config.js new file mode 100644 index 00000000..fe16413a --- /dev/null +++ b/packages/react-formio-stores/jest.config.js @@ -0,0 +1,6 @@ +module.exports = { + ...require("@tsed/config/jest/jest.web.config.js"), + coverageThreshold: { + global: require("./coverage.json") + } +}; diff --git a/packages/react-formio-stores/package.json b/packages/react-formio-stores/package.json new file mode 100644 index 00000000..93e2d7ec --- /dev/null +++ b/packages/react-formio-stores/package.json @@ -0,0 +1,37 @@ +{ + "name": "@tsed/react-formio-stores", + "version": "1.14.1", + "description": "Provide redux stores and action around formio.js API. Written in TypeScript.", + "main": "dist/index.js", + "module": "dist/index.modern.js", + "source": "src/index.ts", + "license": "MIT", + "scripts": { + "lint": "eslint \"**/*.{js,jsx,ts,tsx}\"", + "lint:fix": "yarn lint --fix", + "test": "cross-env NODE_ENV=test jest --coverage", + "test:coverage:update": "write-coverage", + "build": "microbundle --no-compress --format modern,cjs --jsx React.createElement --jsxFragment React.Fragment --globals react/jsx-runtime=jsx", + "watch": "microbundle watch --no-compress --format modern,cjs --jsx React.createElement --jsxFragment React.Fragment --globals react/jsx-runtime=jsx" + }, + "dependencies": { + "@tsed/redux-utils": "1.14.1", + "@tsed/react-formio": "1.14.1", + "eventemitter2": "^6.4.3", + "prop-types": "^15.7.2" + }, + "peerDependencies": { + "@formio/choices.js": ">=9.0.1", + "formiojs": ">=4.0.0", + "lodash": ">=4.17.20", + "prop-types": ">=15.7.2", + "react": ">=16.14.0", + "react-dom": ">=16.14.0", + "react-table": ">=7.6.3", + "tooltip.js": ">=1.3.3" + }, + "devDependencies": { + "@tsed/tailwind": "1.14.1", + "@tsed/tailwind-formio": "1.14.1" + } +} diff --git a/packages/react-formio-stores/readme.md b/packages/react-formio-stores/readme.md new file mode 100644 index 00000000..6cc94900 --- /dev/null +++ b/packages/react-formio-stores/readme.md @@ -0,0 +1,138 @@ +

+ Ts.ED logo +

+ +
+ +

Ts.ED - React Formio stores

+ +[![Build & Release](https://github.com/tsedio/tsed-formio/actions/workflows/build.yml/badge.svg)](https://github.com/tsedio/tsed-formio/actions/workflows/build.yml) +[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) +[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) +[![backers](https://opencollective.com/tsed/tiers/badge.svg)](https://opencollective.com/tsed) + +
+ +
+ Website +   •   + Tutorial +   •   + Slack +   •   + Twitter +
+ +
+ +A [React](http://facebook.github.io/react/) library for rendering out forms based on the [Form.io](https://www.form.io) +platform. + +This module is based on the original [react-formio](https://github.com/formio/react-formio) and add extra features +listed above. + +See our [storybook](https://formio.tsed.io/) to see all available components. + +## Install + +`@tsed/react-formio-stores` can be used on the server, or bundled for the client using an +npm-compatible packaging system such as [Browserify](http://browserify.org/) or +[webpack](http://webpack.github.io/). + +```bash +npm install @tsed/react-formio @tsed/react-formio-stores react-table --save +npm install formiojs @formio/choices.js --save // Install formiojs since it is a peerDependency +``` + +## Usage + +`@tsed/react-formio-stores` contain Redux actions, reducers and selectors to simplify the API requests made for `form.io` forms. +reducers, actions and selectors. +The following reducers have names: + +- formsReducers: manage the forms, +- formReducers: manage the current form, +- submissionsReducers: manage the submissions of a form. +- submissionReducers: manage the current submission of a form + +This provides namespaces so the same actions and reducers can be re-used within the same redux state. + +In addition, the package provides the follwing reducers + +- actionsReducers: Manage actions of a form. +- actionReducers: Manage the current action of a form. +- actionInfoReducers: Manage the available actions for all forms and resources. +- authReducers: Manage formio authentication. + +By default, `@tsed/react-formio-stores` provides defaults combined reducers as following: + +```typescript +export const defaultFormioReducer = combine( + authReducer, + actionsReducer, + actionReducer, + actionInfoReducer, + formReducer("form"), + formsReducer("forms", { query: { type: "form" } }), + formReducer("resource"), + formsReducer("resources", { query: { type: "resource" } }), + submissionReducer("submission"), + submissionsReducer("submissions") +); +``` + +This `defaultFormioReducer` can be added and configured in your rootReducer as following : + +```typescript +import { combine } from "@tsed/redux-utils"; +import { defaultFormioReducer, formsReducer } from "@tsed/react-formio-stores"; +import { connectRouter } from "connected-react-router"; +import { combineReducers } from "redux"; + +export const rootReducers = (history: any) => + combineReducers({ + router: connectRouter(history), + ...defaultFormioReducer, + // override defaultFormioReducer can done as following + ...combine( + formsReducer("forms", { query: { type: "form", tags: ["common"] } }), // return only forms with the common tags + formsReducer("resources", { query: { type: "resource", tags: ["common"] } }) // return only resources with the common tags + ) + }); +``` + +## Contributors + +Please read [contributing guidelines here](./CONTRIBUTING.md). + + + +## Backers + +Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/tsed#backer)] + + + +## Sponsors + +Support this project by becoming a sponsor. Your logo will show up here with a link to your +website. [[Become a sponsor](https://opencollective.com/tsed#sponsor)] + +## License + +The MIT License (MIT) + +Copyright (c) 2016 - 2021 Romain Lenzotti + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/react-formio-stores/src/index.ts b/packages/react-formio-stores/src/index.ts new file mode 100644 index 00000000..9465590b --- /dev/null +++ b/packages/react-formio-stores/src/index.ts @@ -0,0 +1,4 @@ +export * from "./stores"; +export * from "./utils/clean"; +export * from "./utils/url"; +export * from "@tsed/react-formio"; diff --git a/packages/react-formio/src/stores/action-info/action-info.actions.spec.ts b/packages/react-formio-stores/src/stores/action-info/action-info.actions.spec.ts similarity index 100% rename from packages/react-formio/src/stores/action-info/action-info.actions.spec.ts rename to packages/react-formio-stores/src/stores/action-info/action-info.actions.spec.ts diff --git a/packages/react-formio/src/stores/action-info/action-info.actions.ts b/packages/react-formio-stores/src/stores/action-info/action-info.actions.ts similarity index 100% rename from packages/react-formio/src/stores/action-info/action-info.actions.ts rename to packages/react-formio-stores/src/stores/action-info/action-info.actions.ts diff --git a/packages/react-formio/src/stores/action-info/action-info.constant.ts b/packages/react-formio-stores/src/stores/action-info/action-info.constant.ts similarity index 100% rename from packages/react-formio/src/stores/action-info/action-info.constant.ts rename to packages/react-formio-stores/src/stores/action-info/action-info.constant.ts diff --git a/packages/react-formio/src/stores/action-info/action-info.reducers.spec.ts b/packages/react-formio-stores/src/stores/action-info/action-info.reducers.spec.ts similarity index 100% rename from packages/react-formio/src/stores/action-info/action-info.reducers.spec.ts rename to packages/react-formio-stores/src/stores/action-info/action-info.reducers.spec.ts diff --git a/packages/react-formio/src/stores/action-info/action-info.reducers.ts b/packages/react-formio-stores/src/stores/action-info/action-info.reducers.ts similarity index 95% rename from packages/react-formio/src/stores/action-info/action-info.reducers.ts rename to packages/react-formio-stores/src/stores/action-info/action-info.reducers.ts index 94558e44..eda2d2ed 100644 --- a/packages/react-formio/src/stores/action-info/action-info.reducers.ts +++ b/packages/react-formio-stores/src/stores/action-info/action-info.reducers.ts @@ -1,6 +1,6 @@ +import type { ActionSchema } from "@tsed/react-formio"; import { createReducer, InitialStateCreator } from "@tsed/redux-utils"; -import { ActionSchema } from "../../interfaces"; import { failActionInfo, receiveActionInfo, requestActionInfo, resetActionInfo } from "./action-info.actions"; import { ACTION_INFO } from "./action-info.constant"; diff --git a/packages/react-formio/src/stores/action-info/action-info.selectors.spec.ts b/packages/react-formio-stores/src/stores/action-info/action-info.selectors.spec.ts similarity index 100% rename from packages/react-formio/src/stores/action-info/action-info.selectors.spec.ts rename to packages/react-formio-stores/src/stores/action-info/action-info.selectors.spec.ts diff --git a/packages/react-formio/src/stores/action-info/action-info.selectors.ts b/packages/react-formio-stores/src/stores/action-info/action-info.selectors.ts similarity index 83% rename from packages/react-formio/src/stores/action-info/action-info.selectors.ts rename to packages/react-formio-stores/src/stores/action-info/action-info.selectors.ts index 76f1bc30..1da79913 100644 --- a/packages/react-formio/src/stores/action-info/action-info.selectors.ts +++ b/packages/react-formio-stores/src/stores/action-info/action-info.selectors.ts @@ -1,4 +1,5 @@ -import { ActionSchema } from "../../interfaces"; +import type { ActionSchema } from "@tsed/react-formio"; + import { selectRoot } from "../root"; import { ACTION_INFO } from "./action-info.constant"; import { ActionInfoState } from "./action-info.reducers"; diff --git a/packages/react-formio/src/stores/action-info/index.ts b/packages/react-formio-stores/src/stores/action-info/index.ts similarity index 100% rename from packages/react-formio/src/stores/action-info/index.ts rename to packages/react-formio-stores/src/stores/action-info/index.ts diff --git a/packages/react-formio/src/stores/action/action.actions.spec.ts b/packages/react-formio-stores/src/stores/action/action.actions.spec.ts similarity index 100% rename from packages/react-formio/src/stores/action/action.actions.spec.ts rename to packages/react-formio-stores/src/stores/action/action.actions.spec.ts diff --git a/packages/react-formio/src/stores/action/action.actions.ts b/packages/react-formio-stores/src/stores/action/action.actions.ts similarity index 100% rename from packages/react-formio/src/stores/action/action.actions.ts rename to packages/react-formio-stores/src/stores/action/action.actions.ts diff --git a/packages/react-formio/src/stores/action/action.constant.ts b/packages/react-formio-stores/src/stores/action/action.constant.ts similarity index 100% rename from packages/react-formio/src/stores/action/action.constant.ts rename to packages/react-formio-stores/src/stores/action/action.constant.ts diff --git a/packages/react-formio/src/stores/action/action.reducers.spec.ts b/packages/react-formio-stores/src/stores/action/action.reducers.spec.ts similarity index 100% rename from packages/react-formio/src/stores/action/action.reducers.spec.ts rename to packages/react-formio-stores/src/stores/action/action.reducers.spec.ts diff --git a/packages/react-formio/src/stores/action/action.reducers.ts b/packages/react-formio-stores/src/stores/action/action.reducers.ts similarity index 95% rename from packages/react-formio/src/stores/action/action.reducers.ts rename to packages/react-formio-stores/src/stores/action/action.reducers.ts index dff0a106..38eb4ccc 100644 --- a/packages/react-formio/src/stores/action/action.reducers.ts +++ b/packages/react-formio-stores/src/stores/action/action.reducers.ts @@ -1,6 +1,6 @@ +import type { ActionSchema } from "@tsed/react-formio"; import { createReducer, InitialStateCreator } from "@tsed/redux-utils"; -import { ActionSchema } from "../../interfaces"; import { clearActionError, failAction, receiveAction, requestAction, resetAction, sendAction } from "./action.actions"; import { ACTION } from "./action.constant"; diff --git a/packages/react-formio/src/stores/action/action.selectors.spec.ts b/packages/react-formio-stores/src/stores/action/action.selectors.spec.ts similarity index 100% rename from packages/react-formio/src/stores/action/action.selectors.spec.ts rename to packages/react-formio-stores/src/stores/action/action.selectors.spec.ts diff --git a/packages/react-formio/src/stores/action/action.selectors.ts b/packages/react-formio-stores/src/stores/action/action.selectors.ts similarity index 81% rename from packages/react-formio/src/stores/action/action.selectors.ts rename to packages/react-formio-stores/src/stores/action/action.selectors.ts index d7b4b38a..2413583c 100644 --- a/packages/react-formio/src/stores/action/action.selectors.ts +++ b/packages/react-formio-stores/src/stores/action/action.selectors.ts @@ -1,4 +1,5 @@ -import { ActionSchema } from "../../interfaces"; +import type { ActionSchema } from "@tsed/react-formio"; + import { selectRoot } from "../root"; import { ACTION } from "./action.constant"; import { ActionState } from "./action.reducers"; diff --git a/packages/react-formio/src/stores/action/index.ts b/packages/react-formio-stores/src/stores/action/index.ts similarity index 100% rename from packages/react-formio/src/stores/action/index.ts rename to packages/react-formio-stores/src/stores/action/index.ts diff --git a/packages/react-formio/src/stores/actions/actions.actions.spec.ts b/packages/react-formio-stores/src/stores/actions/actions.actions.spec.ts similarity index 100% rename from packages/react-formio/src/stores/actions/actions.actions.spec.ts rename to packages/react-formio-stores/src/stores/actions/actions.actions.spec.ts diff --git a/packages/react-formio/src/stores/actions/actions.actions.ts b/packages/react-formio-stores/src/stores/actions/actions.actions.ts similarity index 100% rename from packages/react-formio/src/stores/actions/actions.actions.ts rename to packages/react-formio-stores/src/stores/actions/actions.actions.ts diff --git a/packages/react-formio/src/stores/actions/actions.constant.ts b/packages/react-formio-stores/src/stores/actions/actions.constant.ts similarity index 100% rename from packages/react-formio/src/stores/actions/actions.constant.ts rename to packages/react-formio-stores/src/stores/actions/actions.constant.ts diff --git a/packages/react-formio/src/stores/actions/actions.reducers.spec.ts b/packages/react-formio-stores/src/stores/actions/actions.reducers.spec.ts similarity index 100% rename from packages/react-formio/src/stores/actions/actions.reducers.spec.ts rename to packages/react-formio-stores/src/stores/actions/actions.reducers.spec.ts diff --git a/packages/react-formio/src/stores/actions/actions.reducers.ts b/packages/react-formio-stores/src/stores/actions/actions.reducers.ts similarity index 93% rename from packages/react-formio/src/stores/actions/actions.reducers.ts rename to packages/react-formio-stores/src/stores/actions/actions.reducers.ts index e6b89ec5..8245af4c 100644 --- a/packages/react-formio/src/stores/actions/actions.reducers.ts +++ b/packages/react-formio-stores/src/stores/actions/actions.reducers.ts @@ -1,6 +1,6 @@ +import type { ActionInfoSchema, ActionSchema } from "@tsed/react-formio"; import { createReducer, InitialStateCreator } from "@tsed/redux-utils"; -import { ActionInfoSchema, ActionSchema } from "../../interfaces"; import { failActions, receiveActions, requestActions, resetActions } from "./actions.actions"; import { ACTIONS } from "./actions.constant"; diff --git a/packages/react-formio/src/stores/actions/actions.selectors.spec.ts b/packages/react-formio-stores/src/stores/actions/actions.selectors.spec.ts similarity index 100% rename from packages/react-formio/src/stores/actions/actions.selectors.spec.ts rename to packages/react-formio-stores/src/stores/actions/actions.selectors.spec.ts diff --git a/packages/react-formio/src/stores/actions/actions.selectors.ts b/packages/react-formio-stores/src/stores/actions/actions.selectors.ts similarity index 100% rename from packages/react-formio/src/stores/actions/actions.selectors.ts rename to packages/react-formio-stores/src/stores/actions/actions.selectors.ts diff --git a/packages/react-formio/src/stores/actions/index.ts b/packages/react-formio-stores/src/stores/actions/index.ts similarity index 100% rename from packages/react-formio/src/stores/actions/index.ts rename to packages/react-formio-stores/src/stores/actions/index.ts diff --git a/packages/react-formio/src/stores/auth/auth.actions.ts b/packages/react-formio-stores/src/stores/auth/auth.actions.ts old mode 100755 new mode 100644 similarity index 89% rename from packages/react-formio/src/stores/auth/auth.actions.ts rename to packages/react-formio-stores/src/stores/auth/auth.actions.ts index cf02c9ad..9c12930e --- a/packages/react-formio/src/stores/auth/auth.actions.ts +++ b/packages/react-formio-stores/src/stores/auth/auth.actions.ts @@ -1,7 +1,6 @@ +import type { FormSchema, RoleSchema, Submission } from "@tsed/react-formio"; import { createAction } from "@tsed/redux-utils"; -import { FormSchema, RoleSchema, Submission } from "../../interfaces"; - export const requestUser = createAction(); export const receiveUser = createAction<{ user: Submission }>(); export const failUser = createAction<{ error: Error }>(); diff --git a/packages/react-formio/src/stores/auth/auth.constant.ts b/packages/react-formio-stores/src/stores/auth/auth.constant.ts similarity index 100% rename from packages/react-formio/src/stores/auth/auth.constant.ts rename to packages/react-formio-stores/src/stores/auth/auth.constant.ts diff --git a/packages/react-formio/src/stores/auth/auth.reducers.spec.ts b/packages/react-formio-stores/src/stores/auth/auth.reducers.spec.ts similarity index 100% rename from packages/react-formio/src/stores/auth/auth.reducers.spec.ts rename to packages/react-formio-stores/src/stores/auth/auth.reducers.spec.ts diff --git a/packages/react-formio/src/stores/auth/auth.reducers.ts b/packages/react-formio-stores/src/stores/auth/auth.reducers.ts old mode 100755 new mode 100644 similarity index 96% rename from packages/react-formio/src/stores/auth/auth.reducers.ts rename to packages/react-formio-stores/src/stores/auth/auth.reducers.ts index 364b653b..c2890ec9 --- a/packages/react-formio/src/stores/auth/auth.reducers.ts +++ b/packages/react-formio-stores/src/stores/auth/auth.reducers.ts @@ -1,7 +1,6 @@ +import type { FormSchema, RoleSchema, Submission } from "@tsed/react-formio"; import { createReducer } from "@tsed/redux-utils"; -import { FormSchema, Submission } from "../../interfaces"; -import { RoleSchema } from "../../interfaces/RoleSchema"; import { failUser, formAccessUser, diff --git a/packages/react-formio/src/stores/auth/auth.selectors.spec.ts b/packages/react-formio-stores/src/stores/auth/auth.selectors.spec.ts similarity index 100% rename from packages/react-formio/src/stores/auth/auth.selectors.spec.ts rename to packages/react-formio-stores/src/stores/auth/auth.selectors.spec.ts diff --git a/packages/react-formio/src/stores/auth/auth.selectors.ts b/packages/react-formio-stores/src/stores/auth/auth.selectors.ts old mode 100755 new mode 100644 similarity index 89% rename from packages/react-formio/src/stores/auth/auth.selectors.ts rename to packages/react-formio-stores/src/stores/auth/auth.selectors.ts index e3bcb4dd..03db35c5 --- a/packages/react-formio/src/stores/auth/auth.selectors.ts +++ b/packages/react-formio-stores/src/stores/auth/auth.selectors.ts @@ -1,6 +1,6 @@ +import type { RoleSchema, Submission } from "@tsed/react-formio"; import get from "lodash/get"; -import { RoleSchema, Submission } from "../../interfaces"; import { selectRoot } from "../root"; import { AUTH } from "./auth.constant"; import { AuthState } from "./auth.reducers"; diff --git a/packages/react-formio/src/stores/auth/auth.utils.spec.ts b/packages/react-formio-stores/src/stores/auth/auth.utils.spec.ts similarity index 100% rename from packages/react-formio/src/stores/auth/auth.utils.spec.ts rename to packages/react-formio-stores/src/stores/auth/auth.utils.spec.ts diff --git a/packages/react-formio/src/stores/auth/auth.utils.tsx b/packages/react-formio-stores/src/stores/auth/auth.utils.tsx similarity index 93% rename from packages/react-formio/src/stores/auth/auth.utils.tsx rename to packages/react-formio-stores/src/stores/auth/auth.utils.tsx index 1bd72c4a..c7733d68 100644 --- a/packages/react-formio/src/stores/auth/auth.utils.tsx +++ b/packages/react-formio-stores/src/stores/auth/auth.utils.tsx @@ -1,6 +1,6 @@ +import type { FormSchema } from "@tsed/react-formio"; import get from "lodash/get"; -import { FormSchema } from "../../interfaces/FormSchema"; import { AuthState } from "./auth.reducers"; export function hasRole(auth: AuthState, role: string): boolean { diff --git a/packages/react-formio/src/stores/auth/getAccess.action.spec.ts b/packages/react-formio-stores/src/stores/auth/getAccess.action.spec.ts similarity index 100% rename from packages/react-formio/src/stores/auth/getAccess.action.spec.ts rename to packages/react-formio-stores/src/stores/auth/getAccess.action.spec.ts diff --git a/packages/react-formio/src/stores/auth/getAccess.action.ts b/packages/react-formio-stores/src/stores/auth/getAccess.action.ts similarity index 93% rename from packages/react-formio/src/stores/auth/getAccess.action.ts rename to packages/react-formio-stores/src/stores/auth/getAccess.action.ts index 44b1ab13..e44f2a8b 100644 --- a/packages/react-formio/src/stores/auth/getAccess.action.ts +++ b/packages/react-formio-stores/src/stores/auth/getAccess.action.ts @@ -1,7 +1,6 @@ +import type { FormSchema, RoleSchema } from "@tsed/react-formio"; import { Formio } from "formiojs"; -import { RoleSchema } from "../../interfaces"; -import { FormSchema } from "../../interfaces/FormSchema"; import { formAccessUser, submissionAccessUser, userForms, userRoles } from "./auth.actions"; import { AUTH } from "./auth.constant"; diff --git a/packages/react-formio/src/stores/auth/getProjectAccess.action.ts b/packages/react-formio-stores/src/stores/auth/getProjectAccess.action.ts similarity index 100% rename from packages/react-formio/src/stores/auth/getProjectAccess.action.ts rename to packages/react-formio-stores/src/stores/auth/getProjectAccess.action.ts diff --git a/packages/react-formio/src/stores/auth/index.ts b/packages/react-formio-stores/src/stores/auth/index.ts old mode 100755 new mode 100644 similarity index 100% rename from packages/react-formio/src/stores/auth/index.ts rename to packages/react-formio-stores/src/stores/auth/index.ts diff --git a/packages/react-formio/src/stores/auth/initAuth.action.spec.ts b/packages/react-formio-stores/src/stores/auth/initAuth.action.spec.ts similarity index 100% rename from packages/react-formio/src/stores/auth/initAuth.action.spec.ts rename to packages/react-formio-stores/src/stores/auth/initAuth.action.spec.ts diff --git a/packages/react-formio/src/stores/auth/initAuth.action.ts b/packages/react-formio-stores/src/stores/auth/initAuth.action.ts similarity index 100% rename from packages/react-formio/src/stores/auth/initAuth.action.ts rename to packages/react-formio-stores/src/stores/auth/initAuth.action.ts diff --git a/packages/react-formio/src/stores/auth/logout.action.spec.ts b/packages/react-formio-stores/src/stores/auth/logout.action.spec.ts similarity index 100% rename from packages/react-formio/src/stores/auth/logout.action.spec.ts rename to packages/react-formio-stores/src/stores/auth/logout.action.spec.ts diff --git a/packages/react-formio/src/stores/auth/logout.action.ts b/packages/react-formio-stores/src/stores/auth/logout.action.ts similarity index 100% rename from packages/react-formio/src/stores/auth/logout.action.ts rename to packages/react-formio-stores/src/stores/auth/logout.action.ts diff --git a/packages/react-formio/src/stores/auth/setUser.action.spec.ts b/packages/react-formio-stores/src/stores/auth/setUser.action.spec.ts similarity index 100% rename from packages/react-formio/src/stores/auth/setUser.action.spec.ts rename to packages/react-formio-stores/src/stores/auth/setUser.action.spec.ts diff --git a/packages/react-formio/src/stores/auth/setUser.action.ts b/packages/react-formio-stores/src/stores/auth/setUser.action.ts similarity index 100% rename from packages/react-formio/src/stores/auth/setUser.action.ts rename to packages/react-formio-stores/src/stores/auth/setUser.action.ts diff --git a/packages/react-formio/src/stores/form/form.actions.spec.ts b/packages/react-formio-stores/src/stores/form/form.actions.spec.ts similarity index 100% rename from packages/react-formio/src/stores/form/form.actions.spec.ts rename to packages/react-formio-stores/src/stores/form/form.actions.spec.ts diff --git a/packages/react-formio/src/stores/form/form.actions.ts b/packages/react-formio-stores/src/stores/form/form.actions.ts old mode 100755 new mode 100644 similarity index 97% rename from packages/react-formio/src/stores/form/form.actions.ts rename to packages/react-formio-stores/src/stores/form/form.actions.ts index e29e3104..3386ec3c --- a/packages/react-formio/src/stores/form/form.actions.ts +++ b/packages/react-formio-stores/src/stores/form/form.actions.ts @@ -1,8 +1,8 @@ +import type { FormSchema } from "@tsed/react-formio"; import { createAction } from "@tsed/redux-utils"; import { Formio } from "formiojs"; import noop from "lodash/noop"; -import { FormSchema } from "../../interfaces"; import { getFormUrl } from "../../utils/url"; import { getActions } from "../actions"; import { selectForm } from "./form.selectors"; diff --git a/packages/react-formio/src/stores/form/form.reducers.spec.ts b/packages/react-formio-stores/src/stores/form/form.reducers.spec.ts similarity index 100% rename from packages/react-formio/src/stores/form/form.reducers.spec.ts rename to packages/react-formio-stores/src/stores/form/form.reducers.spec.ts diff --git a/packages/react-formio/src/stores/form/form.reducers.ts b/packages/react-formio-stores/src/stores/form/form.reducers.ts old mode 100755 new mode 100644 similarity index 96% rename from packages/react-formio/src/stores/form/form.reducers.ts rename to packages/react-formio-stores/src/stores/form/form.reducers.ts index 1acd9c81..bc143e78 --- a/packages/react-formio/src/stores/form/form.reducers.ts +++ b/packages/react-formio-stores/src/stores/form/form.reducers.ts @@ -1,6 +1,6 @@ +import type { FormSchema } from "@tsed/react-formio"; import { createReducer, InitialStateCreator } from "@tsed/redux-utils"; -import { FormSchema } from "../../interfaces"; import { clearFormError, failForm, receiveForm, requestForm, resetForm, sendForm } from "./form.actions"; export interface FormState { diff --git a/packages/react-formio/src/stores/form/form.selectors.spec.ts b/packages/react-formio-stores/src/stores/form/form.selectors.spec.ts similarity index 100% rename from packages/react-formio/src/stores/form/form.selectors.spec.ts rename to packages/react-formio-stores/src/stores/form/form.selectors.spec.ts diff --git a/packages/react-formio/src/stores/form/form.selectors.ts b/packages/react-formio-stores/src/stores/form/form.selectors.ts old mode 100755 new mode 100644 similarity index 78% rename from packages/react-formio/src/stores/form/form.selectors.ts rename to packages/react-formio-stores/src/stores/form/form.selectors.ts index b33358e4..6e7dd9f1 --- a/packages/react-formio/src/stores/form/form.selectors.ts +++ b/packages/react-formio-stores/src/stores/form/form.selectors.ts @@ -1,4 +1,5 @@ -import { FormSchema } from "../../interfaces"; +import type { FormSchema } from "@tsed/react-formio"; + import { selectRoot } from "../root"; import { FormState } from "./form.reducers"; diff --git a/packages/react-formio/src/stores/form/index.ts b/packages/react-formio-stores/src/stores/form/index.ts old mode 100755 new mode 100644 similarity index 100% rename from packages/react-formio/src/stores/form/index.ts rename to packages/react-formio-stores/src/stores/form/index.ts diff --git a/packages/react-formio/src/stores/forms/forms.actions.spec.ts b/packages/react-formio-stores/src/stores/forms/forms.actions.spec.ts similarity index 100% rename from packages/react-formio/src/stores/forms/forms.actions.spec.ts rename to packages/react-formio-stores/src/stores/forms/forms.actions.spec.ts diff --git a/packages/react-formio/src/stores/forms/forms.actions.ts b/packages/react-formio-stores/src/stores/forms/forms.actions.ts old mode 100755 new mode 100644 similarity index 88% rename from packages/react-formio/src/stores/forms/forms.actions.ts rename to packages/react-formio-stores/src/stores/forms/forms.actions.ts index 5edb7fd2..f10383ec --- a/packages/react-formio/src/stores/forms/forms.actions.ts +++ b/packages/react-formio-stores/src/stores/forms/forms.actions.ts @@ -1,10 +1,9 @@ +import type { FormSchema } from "@tsed/react-formio"; import { createAction } from "@tsed/redux-utils"; import { Formio } from "formiojs"; import noop from "lodash/noop"; -import { FormSchema } from "../../interfaces"; -import type { RequestParamsOptions } from "../../utils/mapRequestParams"; -import { mapRequestParams } from "../../utils/mapRequestParams"; +import { mapRequestParams, RequestParamsOptions } from "../../utils/mapRequestParams"; import { selectFormsParameters } from "./forms.selectors"; export const resetForms = createAction(); diff --git a/packages/react-formio/src/stores/forms/forms.reducers.spec.ts b/packages/react-formio-stores/src/stores/forms/forms.reducers.spec.ts similarity index 100% rename from packages/react-formio/src/stores/forms/forms.reducers.spec.ts rename to packages/react-formio-stores/src/stores/forms/forms.reducers.spec.ts diff --git a/packages/react-formio/src/stores/forms/forms.reducers.ts b/packages/react-formio-stores/src/stores/forms/forms.reducers.ts old mode 100755 new mode 100644 similarity index 96% rename from packages/react-formio/src/stores/forms/forms.reducers.ts rename to packages/react-formio-stores/src/stores/forms/forms.reducers.ts index c49c121f..469632ef --- a/packages/react-formio/src/stores/forms/forms.reducers.ts +++ b/packages/react-formio-stores/src/stores/forms/forms.reducers.ts @@ -1,6 +1,6 @@ +import type { FormSchema } from "@tsed/react-formio"; import { createReducer } from "@tsed/redux-utils"; -import { FormSchema } from "../../interfaces"; import { failForms, receiveForms, requestForms, resetForms } from "./forms.actions"; export interface FormsState { diff --git a/packages/react-formio/src/stores/forms/forms.selectors.spec.ts b/packages/react-formio-stores/src/stores/forms/forms.selectors.spec.ts similarity index 100% rename from packages/react-formio/src/stores/forms/forms.selectors.spec.ts rename to packages/react-formio-stores/src/stores/forms/forms.selectors.spec.ts diff --git a/packages/react-formio/src/stores/forms/forms.selectors.ts b/packages/react-formio-stores/src/stores/forms/forms.selectors.ts old mode 100755 new mode 100644 similarity index 100% rename from packages/react-formio/src/stores/forms/forms.selectors.ts rename to packages/react-formio-stores/src/stores/forms/forms.selectors.ts diff --git a/packages/react-formio/src/stores/forms/index.ts b/packages/react-formio-stores/src/stores/forms/index.ts old mode 100755 new mode 100644 similarity index 100% rename from packages/react-formio/src/stores/forms/index.ts rename to packages/react-formio-stores/src/stores/forms/index.ts diff --git a/packages/react-formio/src/stores/index.spec.ts b/packages/react-formio-stores/src/stores/index.spec.ts similarity index 100% rename from packages/react-formio/src/stores/index.spec.ts rename to packages/react-formio-stores/src/stores/index.spec.ts diff --git a/packages/react-formio/src/stores/index.ts b/packages/react-formio-stores/src/stores/index.ts similarity index 100% rename from packages/react-formio/src/stores/index.ts rename to packages/react-formio-stores/src/stores/index.ts diff --git a/packages/react-formio/src/stores/root/index.ts b/packages/react-formio-stores/src/stores/root/index.ts old mode 100755 new mode 100644 similarity index 100% rename from packages/react-formio/src/stores/root/index.ts rename to packages/react-formio-stores/src/stores/root/index.ts diff --git a/packages/react-formio/src/stores/root/root.selectors.spec.ts b/packages/react-formio-stores/src/stores/root/root.selectors.spec.ts similarity index 100% rename from packages/react-formio/src/stores/root/root.selectors.spec.ts rename to packages/react-formio-stores/src/stores/root/root.selectors.spec.ts diff --git a/packages/react-formio/src/stores/root/root.selectors.ts b/packages/react-formio-stores/src/stores/root/root.selectors.ts old mode 100755 new mode 100644 similarity index 100% rename from packages/react-formio/src/stores/root/root.selectors.ts rename to packages/react-formio-stores/src/stores/root/root.selectors.ts diff --git a/packages/react-formio/src/stores/submission/index.ts b/packages/react-formio-stores/src/stores/submission/index.ts old mode 100755 new mode 100644 similarity index 100% rename from packages/react-formio/src/stores/submission/index.ts rename to packages/react-formio-stores/src/stores/submission/index.ts diff --git a/packages/react-formio/src/stores/submission/submission.actions.spec.ts b/packages/react-formio-stores/src/stores/submission/submission.actions.spec.ts similarity index 100% rename from packages/react-formio/src/stores/submission/submission.actions.spec.ts rename to packages/react-formio-stores/src/stores/submission/submission.actions.spec.ts diff --git a/packages/react-formio/src/stores/submission/submission.actions.ts b/packages/react-formio-stores/src/stores/submission/submission.actions.ts old mode 100755 new mode 100644 similarity index 97% rename from packages/react-formio/src/stores/submission/submission.actions.ts rename to packages/react-formio-stores/src/stores/submission/submission.actions.ts index c5ed4ea9..6fd90f5f --- a/packages/react-formio/src/stores/submission/submission.actions.ts +++ b/packages/react-formio-stores/src/stores/submission/submission.actions.ts @@ -1,8 +1,8 @@ +import { Submission } from "@tsed/react-formio"; import { createAction } from "@tsed/redux-utils"; import { Formio } from "formiojs"; import noop from "lodash/noop"; -import { Submission } from "../../interfaces"; import { getSubmissionUrl } from "../../utils/url"; export const clearSubmissionError = createAction(); diff --git a/packages/react-formio/src/stores/submission/submission.reducers.spec.ts b/packages/react-formio-stores/src/stores/submission/submission.reducers.spec.ts similarity index 100% rename from packages/react-formio/src/stores/submission/submission.reducers.spec.ts rename to packages/react-formio-stores/src/stores/submission/submission.reducers.spec.ts diff --git a/packages/react-formio/src/stores/submission/submission.reducers.ts b/packages/react-formio-stores/src/stores/submission/submission.reducers.ts old mode 100755 new mode 100644 similarity index 96% rename from packages/react-formio/src/stores/submission/submission.reducers.ts rename to packages/react-formio-stores/src/stores/submission/submission.reducers.ts index b6ed05f4..4551402e --- a/packages/react-formio/src/stores/submission/submission.reducers.ts +++ b/packages/react-formio-stores/src/stores/submission/submission.reducers.ts @@ -1,6 +1,6 @@ +import type { Submission } from "@tsed/react-formio"; import { createReducer, InitialStateCreator } from "@tsed/redux-utils"; -import { Submission } from "../../interfaces"; import { clearSubmissionError, failSubmission, diff --git a/packages/react-formio/src/stores/submission/submission.selectors.spec.ts b/packages/react-formio-stores/src/stores/submission/submission.selectors.spec.ts similarity index 100% rename from packages/react-formio/src/stores/submission/submission.selectors.spec.ts rename to packages/react-formio-stores/src/stores/submission/submission.selectors.spec.ts diff --git a/packages/react-formio/src/stores/submission/submission.selectors.ts b/packages/react-formio-stores/src/stores/submission/submission.selectors.ts old mode 100755 new mode 100644 similarity index 80% rename from packages/react-formio/src/stores/submission/submission.selectors.ts rename to packages/react-formio-stores/src/stores/submission/submission.selectors.ts index 1e5cdbb5..0758dba7 --- a/packages/react-formio/src/stores/submission/submission.selectors.ts +++ b/packages/react-formio-stores/src/stores/submission/submission.selectors.ts @@ -1,4 +1,5 @@ -import { Submission } from "../../interfaces"; +import type { Submission } from "@tsed/react-formio"; + import { selectRoot } from "../root"; import { SubmissionState } from "./submission.reducers"; diff --git a/packages/react-formio/src/stores/submissions/index.ts b/packages/react-formio-stores/src/stores/submissions/index.ts similarity index 100% rename from packages/react-formio/src/stores/submissions/index.ts rename to packages/react-formio-stores/src/stores/submissions/index.ts diff --git a/packages/react-formio/src/stores/submissions/submissions.actions.spec.ts b/packages/react-formio-stores/src/stores/submissions/submissions.actions.spec.ts similarity index 100% rename from packages/react-formio/src/stores/submissions/submissions.actions.spec.ts rename to packages/react-formio-stores/src/stores/submissions/submissions.actions.spec.ts diff --git a/packages/react-formio/src/stores/submissions/submissions.actions.ts b/packages/react-formio-stores/src/stores/submissions/submissions.actions.ts similarity index 100% rename from packages/react-formio/src/stores/submissions/submissions.actions.ts rename to packages/react-formio-stores/src/stores/submissions/submissions.actions.ts diff --git a/packages/react-formio/src/stores/submissions/submissions.reducers.spec.ts b/packages/react-formio-stores/src/stores/submissions/submissions.reducers.spec.ts similarity index 100% rename from packages/react-formio/src/stores/submissions/submissions.reducers.spec.ts rename to packages/react-formio-stores/src/stores/submissions/submissions.reducers.spec.ts diff --git a/packages/react-formio/src/stores/submissions/submissions.reducers.ts b/packages/react-formio-stores/src/stores/submissions/submissions.reducers.ts similarity index 96% rename from packages/react-formio/src/stores/submissions/submissions.reducers.ts rename to packages/react-formio-stores/src/stores/submissions/submissions.reducers.ts index 57de92af..0d838a6a 100644 --- a/packages/react-formio/src/stores/submissions/submissions.reducers.ts +++ b/packages/react-formio-stores/src/stores/submissions/submissions.reducers.ts @@ -1,6 +1,6 @@ +import type { Submission } from "@tsed/react-formio"; import { createReducer } from "@tsed/redux-utils"; -import { Submission } from "../../interfaces/Submission"; import { failSubmissions, receiveSubmissions, requestSubmissions, resetSubmissions } from "./submissions.actions"; export interface SubmissionsState { diff --git a/packages/react-formio/src/stores/submissions/submissions.selectors.spec.ts b/packages/react-formio-stores/src/stores/submissions/submissions.selectors.spec.ts similarity index 100% rename from packages/react-formio/src/stores/submissions/submissions.selectors.spec.ts rename to packages/react-formio-stores/src/stores/submissions/submissions.selectors.spec.ts diff --git a/packages/react-formio/src/stores/submissions/submissions.selectors.ts b/packages/react-formio-stores/src/stores/submissions/submissions.selectors.ts similarity index 100% rename from packages/react-formio/src/stores/submissions/submissions.selectors.ts rename to packages/react-formio-stores/src/stores/submissions/submissions.selectors.ts diff --git a/packages/react-formio/src/utils/clean.test.ts b/packages/react-formio-stores/src/utils/clean.test.ts similarity index 100% rename from packages/react-formio/src/utils/clean.test.ts rename to packages/react-formio-stores/src/utils/clean.test.ts diff --git a/packages/react-formio/src/utils/clean.ts b/packages/react-formio-stores/src/utils/clean.ts similarity index 100% rename from packages/react-formio/src/utils/clean.ts rename to packages/react-formio-stores/src/utils/clean.ts diff --git a/packages/react-formio/src/utils/mapRequestParams.test.ts b/packages/react-formio-stores/src/utils/mapRequestParams.test.ts similarity index 100% rename from packages/react-formio/src/utils/mapRequestParams.test.ts rename to packages/react-formio-stores/src/utils/mapRequestParams.test.ts diff --git a/packages/react-formio/src/utils/mapRequestParams.ts b/packages/react-formio-stores/src/utils/mapRequestParams.ts similarity index 93% rename from packages/react-formio/src/utils/mapRequestParams.ts rename to packages/react-formio-stores/src/utils/mapRequestParams.ts index 1aa44cc3..93e0ce16 100644 --- a/packages/react-formio/src/utils/mapRequestParams.ts +++ b/packages/react-formio-stores/src/utils/mapRequestParams.ts @@ -1,4 +1,5 @@ -import { QueryOptions } from "../interfaces/QueryOptions"; +import type { QueryOptions } from "@tsed/react-formio"; + import { clean } from "./clean"; export interface RequestParamsOptions extends QueryOptions { @@ -6,6 +7,7 @@ export interface RequestParamsOptions extends QueryOptions { query: { [key: string]: string; }; + [key: string]: any; } diff --git a/packages/react-formio/src/utils/url.test.ts b/packages/react-formio-stores/src/utils/url.test.ts similarity index 100% rename from packages/react-formio/src/utils/url.test.ts rename to packages/react-formio-stores/src/utils/url.test.ts diff --git a/packages/react-formio/src/utils/url.ts b/packages/react-formio-stores/src/utils/url.ts similarity index 100% rename from packages/react-formio/src/utils/url.ts rename to packages/react-formio-stores/src/utils/url.ts diff --git a/packages/react-formio-stores/tsconfig.json b/packages/react-formio-stores/tsconfig.json new file mode 100644 index 00000000..d189cbb5 --- /dev/null +++ b/packages/react-formio-stores/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "@tsed/config/tsconfig.web.json", + "compilerOptions": { + "rootDir": "src" + }, + "include": ["src"], + "references": [ + { + "path": "./tsconfig.node.json" + }, + { + "path": "../redux-utils/tsconfig.json" + } + ] +} diff --git a/packages/react-formio-stores/tsconfig.node.json b/packages/react-formio-stores/tsconfig.node.json new file mode 100644 index 00000000..8ce10716 --- /dev/null +++ b/packages/react-formio-stores/tsconfig.node.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "composite": true, + "module": "esnext", + "moduleResolution": "node" + }, + "include": [] +} diff --git a/packages/react-formio/coverage.json b/packages/react-formio/coverage.json index 39491537..164c6c46 100644 --- a/packages/react-formio/coverage.json +++ b/packages/react-formio/coverage.json @@ -1,6 +1,6 @@ { - "statements": 69.09, - "branches": 49.84, - "functions": 62.46, - "lines": 67.89 + "statements": 57.05, + "branches": 47.58, + "functions": 51.6, + "lines": 57.04 } diff --git a/packages/react-formio/package.json b/packages/react-formio/package.json index 6396ef01..fe82c625 100644 --- a/packages/react-formio/package.json +++ b/packages/react-formio/package.json @@ -15,12 +15,11 @@ "watch": "microbundle watch --no-compress --format modern,cjs --jsx React.createElement --jsxFragment React.Fragment --globals react/jsx-runtime=jsx" }, "dependencies": { - "@tsed/redux-utils": "1.14.1", "eventemitter2": "^6.4.3", "prop-types": "^15.7.2" }, "peerDependencies": { - "choices.js": ">=9.0.1", + "@formio/choices.js": ">=10.2.0", "formiojs": ">=4.0.0", "lodash": ">=4.17.20", "prop-types": ">=15.7.2", @@ -33,4 +32,4 @@ "@tsed/tailwind": "1.14.1", "@tsed/tailwind-formio": "1.14.1" } -} \ No newline at end of file +} diff --git a/packages/react-formio/readme.md b/packages/react-formio/readme.md index 31228ddc..e1da804e 100644 --- a/packages/react-formio/readme.md +++ b/packages/react-formio/readme.md @@ -53,6 +53,15 @@ See our [storybook](https://formio.tsed.io/) to see all available components. - TypeScript support. - Tailwind support. +## Migrate from v1 + +If you use redux actions from v1, you have to install `@tsed/redux-formio-stores` and remplace your imports: + +```diff +- import { defaultFormioReducer, formsReducer } from "@tsed/react-formio"; ++ import { defaultFormioReducer, formsReducer } from "@tsed/react-formio-stores"; +``` + ## Install `@tsed/react-formio` can be used on the server, or bundled for the client using an @@ -262,63 +271,6 @@ The submisison grid will render a list of submissions and allow clicking on one | `data` | array of submissions | [] | A list of submissions to be rendered in the grid. | | `form` | object | {} | The form definition for the submissions. This is used to render the submissions. | -## Redux - -@tsed/react-formio contain Redux actions, reducers and selectors to simplify the API requests made for `form.io` forms. -reducers, actions and selectors. -The following reducers have names: - -- formsReducers: manage the forms, -- formReducers: manage the current form, -- submissionsReducers: manage the submissions of a form. -- submissionReducers: manage the current submission of a form - -This provides namespaces so the same actions and reducers can be re-used within the same redux state. - -In addition, the package provides the follwing reducers - -- actionsReducers: Manage actions of a form. -- actionReducers: Manage the current action of a form. -- actionInfoReducers: Manage the available actions for all forms and resources. -- authReducers: Manage formio authentication. - -By default, `@tsed/react-formio` provides defaults combined reducers as following: - -```typescript -export const defaultFormioReducer = combine( - authReducer, - actionsReducer, - actionReducer, - actionInfoReducer, - formReducer("form"), - formsReducer("forms", { query: { type: "form" } }), - formReducer("resource"), - formsReducer("resources", { query: { type: "resource" } }), - submissionReducer("submission"), - submissionsReducer("submissions") -); -``` - -This `defaultFormioReducer` can be added and configured in your rootReducer as following : - -```typescript -import { combine } from "@tsed/redux-utils"; -import { defaultFormioReducer, formsReducer } from "@tsed/react-formio"; -import { connectRouter } from "connected-react-router"; -import { combineReducers } from "redux"; - -export const rootReducers = (history: any) => - combineReducers({ - router: connectRouter(history), - ...defaultFormioReducer, - // override defaultFormioReducer can done as following - ...combine( - formsReducer("forms", { query: { type: "form", tags: ["common"] } }), // return only forms with the common tags - formsReducer("resources", { query: { type: "resource", tags: ["common"] } }) // return only resources with the common tags - ) - }); -``` - ## Contributors Please read [contributing guidelines here](./CONTRIBUTING.md). diff --git a/packages/react-formio/src/components/input-tags/inputTags.component.tsx b/packages/react-formio/src/components/input-tags/inputTags.component.tsx index 108f2aad..2bdf5503 100644 --- a/packages/react-formio/src/components/input-tags/inputTags.component.tsx +++ b/packages/react-formio/src/components/input-tags/inputTags.component.tsx @@ -1,4 +1,4 @@ -import Choices from "choices.js"; +import Choices from "@formio/choices.js"; import uniq from "lodash/uniq"; import PropTypes from "prop-types"; import React, { useEffect, useRef } from "react"; diff --git a/packages/react-formio/src/components/select/select.component.tsx b/packages/react-formio/src/components/select/select.component.tsx index eaa9816e..f9687331 100644 --- a/packages/react-formio/src/components/select/select.component.tsx +++ b/packages/react-formio/src/components/select/select.component.tsx @@ -1,4 +1,4 @@ -import Choices from "choices.js"; +import Choices from "@formio/choices.js"; import classnames from "classnames"; import PropTypes from "prop-types"; import React, { ReactElement, useEffect, useRef } from "react"; diff --git a/packages/react-formio/src/components/table/filters/sliderColumnFilter.component.tsx b/packages/react-formio/src/components/table/filters/sliderColumnFilter.component.tsx index 63845079..b574402d 100644 --- a/packages/react-formio/src/components/table/filters/sliderColumnFilter.component.tsx +++ b/packages/react-formio/src/components/table/filters/sliderColumnFilter.component.tsx @@ -8,8 +8,8 @@ export function SliderColumnFilter = {}>({ let min = preFilteredRows.length ? preFilteredRows[0].values[id] : 0; let max = preFilteredRows.length ? preFilteredRows[0].values[id] : 0; preFilteredRows.forEach((row) => { - min = Math.min(row.values[id], min); - max = Math.max(row.values[id], max); + min = Math.min(row?.values[id], min); + max = Math.max(row?.values[id], max); }); return [min, max]; }, [id, preFilteredRows]); diff --git a/packages/react-formio/src/index.ts b/packages/react-formio/src/index.ts index b2f16348..a7f13584 100644 --- a/packages/react-formio/src/index.ts +++ b/packages/react-formio/src/index.ts @@ -13,7 +13,8 @@ export { export * from "./components"; export * from "./hooks/useTooltip"; export * from "./interfaces"; -export * from "./stores"; +export * from "./utils/callLast"; export * from "./utils/iconClass"; -export * from "./utils/url"; +export * from "./utils/mapPagination"; +export * from "./utils/stopPropagationWrapper"; export { Components, Formio, Templates, Utils } from "formiojs"; diff --git a/yarn.lock b/yarn.lock index c0462f74..fd7e443f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2557,6 +2557,15 @@ dependencies: resize-observer-polyfill "^1.5.1" +"@formio/choices.js@^10.2.0": + version "10.2.0" + resolved "https://registry.yarnpkg.com/@formio/choices.js/-/choices.js-10.2.0.tgz#cfd089873ce3fae1e679570b4f471d25b5153593" + integrity sha512-dEF+es4yj3pstKHif7Ck14vQCZdN+b1Afojl0ufTmKw5WIjqas1KXEIBBgtsg4eY6bxqFkgEjtxsK4ecvEeZsA== + dependencies: + deepmerge "^4.2.2" + fuse.js "^6.6.2" + redux "^4.2.0" + "@formio/choices.js@^9.0.1": version "9.0.1" resolved "https://registry.yarnpkg.com/@formio/choices.js/-/choices.js-9.0.1.tgz#edc36a2e66b50957dc5f77ff0f4337e39dd61ba4" @@ -2571,10 +2580,15 @@ resolved "https://registry.yarnpkg.com/@formio/semantic/-/semantic-2.6.0.tgz#b506de32b6d8ec3fecb3ce6c59eca846c99ea858" integrity sha512-RwMEVXkyz+B6RivflrrKIqvvnGR/eZDLQs74u67StcrzO6n3/5D2J8XqTQRSUzQzr5QV6Wq0eZ51z/+mGm6THw== -"@formio/vanilla-text-mask@^5.1.1": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@formio/vanilla-text-mask/-/vanilla-text-mask-5.1.1.tgz#2bd690a34b0e191b7f23a589ff1c2497564307de" - integrity sha512-7MhrbMypySPi7RLchg0ys7HnS3Wqddbq/btAijKB1nA94TE7AOOLhpZJWcNm3kOlX0Y3nHfoavj/HP7vsvF34Q== +"@formio/text-mask-addons@^3.8.0-formio.2": + version "3.8.0-formio.2" + resolved "https://registry.yarnpkg.com/@formio/text-mask-addons/-/text-mask-addons-3.8.0-formio.2.tgz#b9489e68911c70a31997b97dd846d8a7cca6abdb" + integrity sha512-H4Sm+1Sx59jbrlKxtKbzethhp5OIcP8Oi4JBpsvH/SB8P/KCRmtjKbN5ACqURnXmYtBHLJC6Yr9KZibOVRGxpA== + +"@formio/vanilla-text-mask@^5.1.1-formio.1": + version "5.1.1-formio.1" + resolved "https://registry.yarnpkg.com/@formio/vanilla-text-mask/-/vanilla-text-mask-5.1.1-formio.1.tgz#f53fc7f4cb37c6ae38f2857488055e781e5adba9" + integrity sha512-rYBlvIPMNUd6sAaduOaiIwI4vfTAjHDRonko2qJn2RP1O//TQ7rcFIPYVYePJZ4OtOpwHiHAvAIh79McphZotQ== "@fullhuman/postcss-purgecss@^3.1.3": version "3.1.3" @@ -9078,15 +9092,6 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -choices.js@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/choices.js/-/choices.js-10.1.0.tgz#034a40b7aa82e2a38f19ff8fae5bbfa6047862f4" - integrity sha512-NtrFt7c7ZQEGmkWsAV+EHynJhADWoZ82JEfg1+vQ9MMKJD4Ax2rzYPxXe+Q64i0HgUgWG/XTN3gN2pB8UFFFlA== - dependencies: - deepmerge "^4.2.2" - fuse.js "^6.5.3" - redux "^4.1.2" - chokidar@^2.0.0, chokidar@^2.0.4, chokidar@^2.1.8: version "2.1.8" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" @@ -12673,15 +12678,16 @@ formats@1.0.0: resolved "https://registry.yarnpkg.com/formats/-/formats-1.0.0.tgz#327154084786eac09d3b839cab28d150b982b163" integrity sha512-For0Y8egwEK96JgJo4NONErPhtl7H2QzeB2NYGmzeGeJ8a1JZqPgLYOtM3oJRCYhmgsdDFd6KGRYyfe37XY4Yg== -formiojs@^4.14.8: - version "4.14.8" - resolved "https://registry.yarnpkg.com/formiojs/-/formiojs-4.14.8.tgz#412fb77fcfaa98346980f68204168f78c8a16f44" - integrity sha512-BZucLSxCGWhBe1FQATR6GgxfHtwxEZxp2ur29DjAjo6ErlUTnl2Zbmb1IjW8NNfw0jn81SfSKtxh/SRSY5Ut7A== +formiojs@^4.14.13: + version "4.14.13" + resolved "https://registry.yarnpkg.com/formiojs/-/formiojs-4.14.13.tgz#88f6bc67afd633888d194ba34508f1581104a7a7" + integrity sha512-x8ZFYexjc6hYL9sVT6vv6YUId9adq8g84sOB92ZH6MEOw3OyDfaTzVUrb4oo7zlEHZw2UC4CNKrIHoXffwYN3Q== dependencies: "@formio/bootstrap3" "^2.12.2" "@formio/choices.js" "^9.0.1" "@formio/semantic" "^2.6.0" - "@formio/vanilla-text-mask" "^5.1.1" + "@formio/text-mask-addons" "^3.8.0-formio.2" + "@formio/vanilla-text-mask" "^5.1.1-formio.1" autocompleter "^6.1.2" browser-cookies "^1.2.0" browser-md5-file "^1.1.1" @@ -12703,14 +12709,13 @@ formiojs@^4.14.8: jstimezonedetect "^1.0.7" jwt-decode "^3.1.2" lodash "^4.17.21" - moment "^2.29.2" - moment-timezone "^0.5.34" + moment "^2.29.4" + moment-timezone "^0.5.40" native-promise-only "^0.8.1" quill "^2.0.0-dev.3" resize-observer-polyfill "^1.5.1" signature_pad "^4.0.4" string-hash "^1.1.3" - text-mask-addons "^3.8.0" tippy.js "^6.3.7" uuid "^8.3.2" vanilla-picker "^2.12.1" @@ -12887,7 +12892,7 @@ fuse.js@^3.4.5, fuse.js@^3.4.6: resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-3.6.1.tgz#7de85fdd6e1b3377c23ce010892656385fd9b10c" integrity sha512-hT9yh/tiinkmirKrlv4KWOjztdoZo1mx9Qh4KvWqC7isoXwdUY3PNWUxceF4/qO9R6riA2C29jdTOeQOIROjgw== -fuse.js@^6.5.3: +fuse.js@^6.6.2: version "6.6.2" resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-6.6.2.tgz#fe463fed4b98c0226ac3da2856a415576dc9a111" integrity sha512-cJaJkxCCxC8qIIcPBF9yGxY0W/tVZS3uEISDxhYIdtk8OL93pe+6Zj7LjCqVV4dzbqcriOZ+kQ/NE4RXZHsIGA== @@ -17590,27 +17595,22 @@ modify-values@^1.0.0: resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== -moment-timezone@^0.5.34: - version "0.5.34" - resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.34.tgz#a75938f7476b88f155d3504a9343f7519d9a405c" - integrity sha512-3zAEHh2hKUs3EXLESx/wsgw6IQdusOT8Bxm3D9UrHPQR7zlMmzwybC8zHEM1tQ4LJwP7fcxrWr8tuBg05fFCbg== +moment-timezone@^0.5.40: + version "0.5.43" + resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.43.tgz#3dd7f3d0c67f78c23cd1906b9b2137a09b3c4790" + integrity sha512-72j3aNyuIsDxdF1i7CEgV2FfxM1r6aaqJyLB2vwb33mXYyoyLly+F1zbWqhA3/bVIoJ4szlUoMbUnVdid32NUQ== dependencies: - moment ">= 2.9.0" + moment "^2.29.4" moment@2.22.2: version "2.22.2" resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.2.tgz#3c257f9839fc0e93ff53149632239eb90783ff66" integrity sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y= -"moment@>= 2.9.0": - version "2.29.1" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3" - integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ== - -moment@^2.29.2: - version "2.29.3" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.3.tgz#edd47411c322413999f7a5940d526de183c031f3" - integrity sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw== +moment@^2.29.4: + version "2.29.4" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108" + integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w== morgan@1.9.1: version "1.9.1" @@ -21091,10 +21091,10 @@ redux@^4.0.0, redux@^4.0.4: loose-envify "^1.4.0" symbol-observable "^1.2.0" -redux@^4.1.2: - version "4.2.0" - resolved "https://registry.yarnpkg.com/redux/-/redux-4.2.0.tgz#46f10d6e29b6666df758780437651eeb2b969f13" - integrity sha512-oSBmcKKIuIR4ME29/AeNUnl5L+hvBq7OaJWzaptTQJAntaPvxIJqfnjbaEiCzzaIz+XmVILfqAM3Ob0aXLPfjA== +redux@^4.2.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/redux/-/redux-4.2.1.tgz#c08f4306826c49b5e9dc901dee0452ea8fce6197" + integrity sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w== dependencies: "@babel/runtime" "^7.9.2" @@ -23526,11 +23526,6 @@ text-extensions@^1.0.0: resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.9.0.tgz#1853e45fee39c945ce6f6c36b2d659b5aabc2a26" integrity sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ== -text-mask-addons@^3.8.0: - version "3.8.0" - resolved "https://registry.yarnpkg.com/text-mask-addons/-/text-mask-addons-3.8.0.tgz#17b61ef665a4f36811f2ea1f01a223b4be61ab26" - integrity sha1-F7Ye9mWk82gR8uofAaIjtL5hqyY= - text-table@0.2.0, text-table@^0.2.0, text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"