├── .editorconfig ├── .gitattributes ├── .github └── workflows │ └── npm-publish.yml ├── .gitignore ├── .storybook ├── main.js └── preview.js ├── .vscode ├── extensions.json └── settings.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── INDIVIDUAL_CONTRIBUTOR_LICENSE.md ├── LICENSE ├── NOTICE.txt ├── docs ├── 0.1db6407b6f251cb99757.manager.bundle.js ├── 0.97dc7c88.iframe.bundle.js ├── 1.08e48cd2b295b33abac5.manager.bundle.js ├── 10.58b60afe35d013b05f26.manager.bundle.js ├── 11.7f35c06cd77f40a88403.manager.bundle.js ├── 11.7f35c06cd77f40a88403.manager.bundle.js.LICENSE.txt ├── 12.2f8d9cc3bdcfbb59dabf.manager.bundle.js ├── 4.9a151b1b.iframe.bundle.js ├── 4.9a151b1b.iframe.bundle.js.LICENSE.txt ├── 4.9a151b1b.iframe.bundle.js.map ├── 5.4d5248d1e985d19512e5.manager.bundle.js ├── 5.4d5248d1e985d19512e5.manager.bundle.js.LICENSE.txt ├── 5.c9d755ea.iframe.bundle.js ├── 6.297d139ca80380169c9a.manager.bundle.js ├── 6.f7f9ab19.iframe.bundle.js ├── 6.f7f9ab19.iframe.bundle.js.LICENSE.txt ├── 6.f7f9ab19.iframe.bundle.js.map ├── 7.1dd6103d8c4adf231b89.manager.bundle.js ├── 7.7766ae9b.iframe.bundle.js ├── 8.0c32e96f86b87a58d415.manager.bundle.js ├── 9.da52dd791e7234e0495a.manager.bundle.js ├── asset-manifest.json ├── favicon.ico ├── iframe.html ├── index.html ├── main.57da3f9fe16e02557812.manager.bundle.js ├── main.c7f46bdf.iframe.bundle.js ├── runtime~main.335986b66fb5bcf65138.manager.bundle.js ├── runtime~main.806b4e7e.iframe.bundle.js ├── vendors~main.0b7555aaeb5d052c07aa.manager.bundle.js ├── vendors~main.0b7555aaeb5d052c07aa.manager.bundle.js.LICENSE.txt ├── vendors~main.2b0e6e48.iframe.bundle.js ├── vendors~main.2b0e6e48.iframe.bundle.js.LICENSE.txt └── vendors~main.2b0e6e48.iframe.bundle.js.map ├── package-lock.json ├── package.json ├── readme.md ├── src ├── JsonSchemaEditor.test.tsx ├── JsonSchemaEditor.types.ts ├── JsonSchemaEditor │ ├── JsonSchemaEditor.scss │ ├── JsonSchemaEditor.tsx │ ├── advanced-boolean │ │ └── index.tsx │ ├── advanced-number │ │ └── index.tsx │ ├── advanced-string │ │ └── index.tsx │ ├── drop-plus │ │ └── index.tsx │ ├── schema-advanced │ │ └── index.tsx │ ├── schema-array │ │ └── index.tsx │ ├── schema-item │ │ └── index.tsx │ ├── schema-object │ │ └── index.tsx │ ├── schema-root │ │ └── index.tsx │ ├── state │ │ ├── index.ts │ │ ├── schema.ts │ │ └── test.ts │ ├── utils.ts │ └── whoops.tsx ├── index.ts ├── react-app-env.d.ts ├── setupTests.ts ├── stories │ ├── JsonSchemaEditor.stories.tsx │ └── helper.ts └── test-utils.tsx └── tsconfig.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.yml] 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /.github/workflows/npm-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages 3 | 4 | name: Node.js Package 5 | 6 | on: 7 | release: 8 | types: [created] 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | - uses: actions/setup-node@v1 16 | with: 17 | node-version: 12 18 | - run: npm ci 19 | 20 | publish-npm: 21 | needs: build 22 | runs-on: ubuntu-latest 23 | steps: 24 | - uses: actions/checkout@v2 25 | - uses: actions/setup-node@v1 26 | with: 27 | node-version: 12 28 | registry-url: https://registry.npmjs.org/ 29 | - run: npm ci 30 | - run: npm run build 31 | - run: npm publish 32 | env: 33 | NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} 34 | 35 | publish-gpr: 36 | needs: build 37 | runs-on: ubuntu-latest 38 | steps: 39 | - uses: actions/checkout@v2 40 | - uses: actions/setup-node@v1 41 | with: 42 | node-version: 12 43 | registry-url: https://npm.pkg.github.com/ 44 | - run: npm ci 45 | - run: npm run build 46 | - run: npm publish 47 | env: 48 | NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Compiled binary addons (https://nodejs.org/api/addons.html) 24 | build/Release 25 | 26 | # Dependency directories 27 | node_modules/ 28 | jspm_packages/ 29 | 30 | # TypeScript v1 declaration files 31 | typings/ 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional eslint cache 37 | .eslintcache 38 | 39 | # Optional REPL history 40 | .node_repl_history 41 | 42 | # Output of 'npm pack' 43 | *.tgz 44 | 45 | # Yarn Integrity file 46 | .yarn-integrity 47 | 48 | # dotenv environment variables file 49 | .env 50 | 51 | # OSX 52 | .DS_Store 53 | 54 | # compiled server output 55 | dist 56 | 57 | # storybook 58 | storybook-static 59 | .cache 60 | 61 | yarn-error.log 62 | -------------------------------------------------------------------------------- /.storybook/main.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | 3 | const toPath = (_path) => path.join(process.cwd(), _path); 4 | 5 | module.exports = { 6 | stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"], 7 | addons: [ 8 | "@storybook/addon-links", 9 | "@storybook/addon-essentials", 10 | "@storybook/preset-create-react-app", 11 | ], 12 | webpackFinal: async (config) => { 13 | return { 14 | ...config, 15 | resolve: { 16 | ...config.resolve, 17 | alias: { 18 | ...config.resolve.alias, 19 | "@emotion/core": toPath("node_modules/@emotion/react"), 20 | "emotion-theming": toPath("node_modules/@emotion/react"), 21 | }, 22 | }, 23 | }; 24 | }, 25 | }; 26 | -------------------------------------------------------------------------------- /.storybook/preview.js: -------------------------------------------------------------------------------- 1 | import "@storybook/addon-console"; 2 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "esbenp.prettier-vscode" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "javascript.format.enable": false, 3 | "javascript.validate.enable": false, 4 | "prettier.tabWidth": 4, 5 | "prettier.singleQuote": true, 6 | "[json]": { 7 | "editor.formatOnSave": true, 8 | "editor.defaultFormatter": "esbenp.prettier-vscode" 9 | }, 10 | "[javascript]": { 11 | "editor.formatOnSave": true, 12 | "editor.defaultFormatter": "esbenp.prettier-vscode" 13 | }, 14 | "[typescript]": { 15 | "editor.formatOnSave": true, 16 | "editor.defaultFormatter": "esbenp.prettier-vscode" 17 | }, 18 | "[typescriptreact]": { 19 | "editor.formatOnSave": true, 20 | "editor.defaultFormatter": "esbenp.prettier-vscode" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at [opensource@optum.com][email]. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at [http://contributor-covenant.org/version/1/4][version] 72 | 73 | [homepage]: http://contributor-covenant.org 74 | [version]: http://contributor-covenant.org/version/1/4/ 75 | [email]: mailto:opensource@optum.com 76 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to *jsonschema-editor-react* 2 | 3 | ## Introduction 4 | 5 | ### Welcome to project jsonschema-editor-react! 6 | 7 | >Thank you for considering a contribution to *jsonschema-editor-react*. Your support of this project will assist the broader open source community as we strive to provide tools and information leading to better license compliance, acknowledgment of intellectual property rights, and reduction of vulnerabilities in our code. 8 | 9 | # Contribution Guidelines 10 | 11 | Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. Please also review our [Contributor License Agreement ("CLA")](INDIVIDUAL_CONTRIBUTOR_LICENSE.md) prior to submitting changes to the project. You will need to attest to this agreement following the instructions in the [Paperwork for Pull Requests](#paperwork-for-pull-requests) section below. 12 | 13 | --- 14 | ## How to Contribute 15 | 16 | Now that we have the disclaimer out of the way, let's get into how you can be a part of our project. There are many different ways to contribute. 17 | 18 | ### Issues 19 | 20 | We track our work using Issues in GitHub. Feel free to open up your own issue to point out areas for improvement or to suggest your own new experiment. If you are comfortable with signing the waiver linked above and contributing code or documentation, grab your own issue and start working. 21 | 22 | ### Pull Requests 23 | 24 | If you've gotten as far as reading this section, then thank you for your suggestions. 25 | 26 | ### Paperwork for Pull Requests 27 | 28 | * Please read this guide and make sure you agree with our [Contributor License Agreement ("CLA")](INDIVIDUAL_CONTRIBUTOR_LICENSE.md). 29 | * Make sure git knows your name and email address: 30 | ``` 31 | $ git config user.name "J. Random User" 32 | $ git config user.email "j.random.user@example.com" 33 | ``` 34 | >The name and email address must be valid as we cannot accept anonymous contributions. 35 | * Write good commit messages. 36 | > Concise commit messages that describe your changes help us better understand your contributions. 37 | * The first time you open a pull request in this repository, you will see a comment on your PR with a link that will allow you to sign our Contributor License Agreement (CLA) if necessary. 38 | > The link will take you to a page that allows you to view our CLA. You will need to click the `Sign in with GitHub to agree button` and authorize the cla-assistant application to access the email addresses associated with your GitHub account. Agreeing to the CLA is also considered to be an attestation that you either wrote or have the rights to contribute the code. All committers to the PR branch will be required to sign the CLA, but you will only need to sign once. This CLA applies to all repositories in the Optum org. 39 | 40 | ### General Guidelines 41 | 42 | Ensure your pull request (PR) adheres to the following guidelines: 43 | 44 | * Try to make the name concise and descriptive. 45 | * Give a good description of the change being made. Since this is very subjective, see the [Updating Your Pull Request (PR)](#updating-your-pull-request-pr) section below for further details. 46 | * Every pull request should be associated with one or more issues. If no issue exists yet, please create your own. 47 | * Make sure that all applicable issues are mentioned somewhere in the PR description. This can be done by typing # to bring up a list of issues. 48 | 49 | #### Updating Your Pull Request (PR) 50 | 51 | A lot of times, making a PR adhere to the standards above can be difficult. If the maintainers notice anything that we'd like changed, we'll ask you to edit your PR before we merge it. This applies to both the content documented in the PR and the changed contained within the branch being merged. There's no need to open a new PR. Just edit the existing one. 52 | 53 | [email]: mailto:opensource@optum.com 54 | -------------------------------------------------------------------------------- /INDIVIDUAL_CONTRIBUTOR_LICENSE.md: -------------------------------------------------------------------------------- 1 | # Individual Contributor License Agreement ("Agreement") V2.0 2 | 3 | Thank you for your interest in this Optum project (the "PROJECT"). In order to clarify the intellectual property license granted with Contributions from any person or entity, the PROJECT must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of the PROJECT and its users; it does not change your rights to use your own Contributions for any other purpose. 4 | 5 | You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the PROJECT. In return, the PROJECT shall not use Your Contributions in a way that is inconsistent with stated project goals in effect at the time of the Contribution. Except for the license granted herein to the PROJECT and recipients of software distributed by the PROJECT, You reserve all right, title, and interest in and to Your Contributions. 6 | 1. Definitions. 7 | 8 | "You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with the PROJECT. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. 9 | 10 | "Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to the PROJECT for inclusion in, or documentation of, any of the products owned or managed by the PROJECT (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the PROJECT or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the PROJECT for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution." 11 | 12 | 2. Grant of Copyright License. 13 | 14 | Subject to the terms and conditions of this Agreement, You hereby grant to the PROJECT and to recipients of software distributed by the PROJECT a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works. 15 | 16 | 3. Grant of Patent License. 17 | 18 | Subject to the terms and conditions of this Agreement, You hereby grant to the PROJECT and to recipients of software distributed by the PROJECT a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable(except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed. 19 | 20 | 4. Representations. 21 | 22 | (a) You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to the PROJECT, or that your employer has executed a separate Corporate CLA with the PROJECT. 23 | 24 | (b) You represent that each of Your Contributions is Your original creation (see section 6 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions. 25 | 26 | 5. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. 27 | 28 | 6. Should You wish to submit work that is not Your original creation, You may submit it to the PROJECT separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]". 29 | 30 | 7. You agree to notify the PROJECT of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect. 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2021 Optum 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /NOTICE.txt: -------------------------------------------------------------------------------- 1 | jsonschema-editor-react 2 | 3 | Copyright 2020 Optum 4 | 5 | Project Description: 6 | ==================== 7 | A react module for maintaining json schema. Built with Chakra-UI 8 | 9 | Author(s): 10 | Ryan Sites (@seesharpguy) 11 | -------------------------------------------------------------------------------- /docs/0.1db6407b6f251cb99757.manager.bundle.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[0],{455:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"WithTooltipPure",(function(){return WithTooltip_WithTooltipPure})),__webpack_require__.d(__webpack_exports__,"WithToolTipState",(function(){return WithTooltip_WithToolTipState})),__webpack_require__.d(__webpack_exports__,"WithTooltip",(function(){return WithTooltip_WithToolTipState}));__webpack_require__(34),__webpack_require__(109),__webpack_require__(31),__webpack_require__(35);var react=__webpack_require__(0),react_default=__webpack_require__.n(react),esm=__webpack_require__(1),global_window=__webpack_require__(3),react_popper_tooltip=__webpack_require__(935),memoizerific=(__webpack_require__(7),__webpack_require__(21),__webpack_require__(14),__webpack_require__(18),__webpack_require__(74),__webpack_require__(171),__webpack_require__(20)),memoizerific_default=__webpack_require__.n(memoizerific),utils=__webpack_require__(99);function _extends(){return(_extends=Object.assign||function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var _templateObject,_templateObject2,match=memoizerific_default()(1e3)((function(requests,actual,value){var fallback=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return actual.split("-")[0]===requests?value:fallback})),Arrow=esm.styled.div({position:"absolute",borderStyle:"solid"},(function(_ref){var placement=_ref.placement,x=0,y=0;switch(!0){case placement.startsWith("left")||placement.startsWith("right"):y=8;break;case placement.startsWith("top")||placement.startsWith("bottom"):x=8}return{transform:"translate3d(".concat(x,"px, ").concat(y,"px, 0px)")}}),(function(_ref2){var theme=_ref2.theme,color=_ref2.color,placement=_ref2.placement;return{bottom:"".concat(match("top",placement,-8,"auto"),"px"),top:"".concat(match("bottom",placement,-8,"auto"),"px"),right:"".concat(match("left",placement,-8,"auto"),"px"),left:"".concat(match("right",placement,-8,"auto"),"px"),borderBottomWidth:"".concat(match("top",placement,"0",8),"px"),borderTopWidth:"".concat(match("bottom",placement,"0",8),"px"),borderRightWidth:"".concat(match("left",placement,"0",8),"px"),borderLeftWidth:"".concat(match("right",placement,"0",8),"px"),borderTopColor:match("top",placement,theme.color[color]||color||"light"===theme.base?Object(utils.c)(theme.background.app):Object(utils.a)(theme.background.app),"transparent"),borderBottomColor:match("bottom",placement,theme.color[color]||color||"light"===theme.base?Object(utils.c)(theme.background.app):Object(utils.a)(theme.background.app),"transparent"),borderLeftColor:match("left",placement,theme.color[color]||color||"light"===theme.base?Object(utils.c)(theme.background.app):Object(utils.a)(theme.background.app),"transparent"),borderRightColor:match("right",placement,theme.color[color]||color||"light"===theme.base?Object(utils.c)(theme.background.app):Object(utils.a)(theme.background.app),"transparent")}})),Wrapper=esm.styled.div((function(_ref3){return{display:_ref3.hidden?"none":"inline-block",zIndex:2147483647}}),(function(_ref4){var theme=_ref4.theme,color=_ref4.color;return _ref4.hasChrome?{background:theme.color[color]||color||"light"===theme.base?Object(utils.c)(theme.background.app):Object(utils.a)(theme.background.app),filter:"\n drop-shadow(0px 5px 5px rgba(0,0,0,0.05))\n drop-shadow(0 1px 3px rgba(0,0,0,0.1))\n ",borderRadius:2*theme.appBorderRadius,fontSize:theme.typography.size.s1}:{}})),Tooltip_Tooltip=function Tooltip(_ref5){var placement=_ref5.placement,hasChrome=_ref5.hasChrome,children=_ref5.children,arrowProps=_ref5.arrowProps,tooltipRef=_ref5.tooltipRef,arrowRef=_ref5.arrowRef,color=_ref5.color,props=_objectWithoutProperties(_ref5,["placement","hasChrome","children","arrowProps","tooltipRef","arrowRef","color"]);return react_default.a.createElement(Wrapper,_extends({hasChrome:hasChrome,placement:placement,ref:tooltipRef},props,{color:color}),hasChrome&&react_default.a.createElement(Arrow,_extends({placement:placement,ref:arrowRef},arrowProps,{color:color})),children)};function _slicedToArray(arr,i){return function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function _iterableToArrayLimit(arr,i){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function _unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr,i)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _taggedTemplateLiteral(strings,raw){return raw||(raw=strings.slice(0)),Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}))}Tooltip_Tooltip.displayName="Tooltip",Tooltip_Tooltip.defaultProps={color:void 0,arrowRef:void 0,tooltipRef:void 0,hasChrome:!0,placement:"top",arrowProps:{}};var TargetContainer=esm.styled.div(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n display: inline-block;\n cursor: ",";\n"])),(function(props){return"hover"===props.mode?"default":"pointer"})),TargetSvgContainer=esm.styled.g(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n cursor: ",";\n"])),(function(props){return"hover"===props.mode?"default":"pointer"})),WithTooltip_WithTooltipPure=function WithTooltipPure(_ref){var svg=_ref.svg,trigger=_ref.trigger,placement=(_ref.closeOnClick,_ref.placement),modifiers=_ref.modifiers,hasChrome=_ref.hasChrome,_tooltip=_ref.tooltip,children=_ref.children,tooltipShown=_ref.tooltipShown,onVisibilityChange=_ref.onVisibilityChange,props=WithTooltip_objectWithoutProperties(_ref,["svg","trigger","closeOnClick","placement","modifiers","hasChrome","tooltip","children","tooltipShown","onVisibilityChange"]),Container=svg?TargetSvgContainer:TargetContainer;return react_default.a.createElement(react_popper_tooltip.a,{placement:placement,trigger:trigger,modifiers:modifiers,tooltipShown:tooltipShown,onVisibilityChange:onVisibilityChange,tooltip:function tooltip(_ref2){var getTooltipProps=_ref2.getTooltipProps,getArrowProps=_ref2.getArrowProps,tooltipRef=_ref2.tooltipRef,arrowRef=_ref2.arrowRef,tooltipPlacement=_ref2.placement;return react_default.a.createElement(Tooltip_Tooltip,WithTooltip_extends({hasChrome:hasChrome,placement:tooltipPlacement,tooltipRef:tooltipRef,arrowRef:arrowRef,arrowProps:getArrowProps()},getTooltipProps()),"function"==typeof _tooltip?_tooltip({onHide:function onHide(){return onVisibilityChange(!1)}}):_tooltip)}},(function(_ref3){var getTriggerProps=_ref3.getTriggerProps,triggerRef=_ref3.triggerRef;return react_default.a.createElement(Container,WithTooltip_extends({ref:triggerRef},getTriggerProps(),props),children)}))};WithTooltip_WithTooltipPure.displayName="WithTooltipPure",WithTooltip_WithTooltipPure.defaultProps={svg:!1,trigger:"hover",closeOnClick:!1,placement:"top",modifiers:[{name:"preventOverflow",options:{padding:8}},{name:"offset",options:{offset:[8,8]}},{name:"arrow",options:{padding:8}}],hasChrome:!0,tooltipShown:!1};var WithTooltip_WithToolTipState=function WithToolTipState(_ref4){var startOpen=_ref4.startOpen,onChange=_ref4.onVisibilityChange,rest=WithTooltip_objectWithoutProperties(_ref4,["startOpen","onVisibilityChange"]),_useState2=_slicedToArray(Object(react.useState)(startOpen||!1),2),tooltipShown=_useState2[0],setTooltipShown=_useState2[1],onVisibilityChange=Object(react.useCallback)((function(visibility){onChange&&!1===onChange(visibility)||setTooltipShown(visibility)}),[onChange]);return Object(react.useEffect)((function(){var hide=function hide(){return onVisibilityChange(!1)};global_window.document.addEventListener("keydown",hide,!1);var iframes=Array.from(global_window.document.getElementsByTagName("iframe")),unbinders=[];return iframes.forEach((function(iframe){var bind=function bind(){try{iframe.contentWindow.document&&(iframe.contentWindow.document.addEventListener("click",hide),unbinders.push((function(){try{iframe.contentWindow.document.removeEventListener("click",hide)}catch(e){}})))}catch(e){}};bind(),iframe.addEventListener("load",bind),unbinders.push((function(){iframe.removeEventListener("load",bind)}))})),function(){global_window.document.removeEventListener("keydown",hide),unbinders.forEach((function(unbind){unbind()}))}})),react_default.a.createElement(WithTooltip_WithTooltipPure,WithTooltip_extends({},rest,{tooltipShown:tooltipShown,onVisibilityChange:onVisibilityChange}))};WithTooltip_WithToolTipState.displayName="WithToolTipState"}}]); -------------------------------------------------------------------------------- /docs/10.58b60afe35d013b05f26.manager.bundle.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[10],{856:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"SyntaxHighlighter",(function(){return syntaxhighlighter_SyntaxHighlighter}));__webpack_require__(36),__webpack_require__(9),__webpack_require__(42),__webpack_require__(108),__webpack_require__(100);var react=__webpack_require__(0),react_default=__webpack_require__.n(react),esm=__webpack_require__(17),dist_esm=__webpack_require__(1),global_window=__webpack_require__(3),memoizerific=__webpack_require__(20),memoizerific_default=__webpack_require__.n(memoizerific),jsx=__webpack_require__(915),jsx_default=__webpack_require__.n(jsx),bash=__webpack_require__(922),bash_default=__webpack_require__.n(bash),css=__webpack_require__(924),css_default=__webpack_require__.n(css),js_extras=__webpack_require__(913),js_extras_default=__webpack_require__.n(js_extras),json=__webpack_require__(916),json_default=__webpack_require__.n(json),graphql=__webpack_require__(929),graphql_default=__webpack_require__.n(graphql),markup=__webpack_require__(925),markup_default=__webpack_require__.n(markup),markdown=__webpack_require__(920),markdown_default=__webpack_require__.n(markdown),yaml=__webpack_require__(918),yaml_default=__webpack_require__.n(yaml),tsx=__webpack_require__(926),tsx_default=__webpack_require__.n(tsx),typescript=__webpack_require__(928),typescript_default=__webpack_require__.n(typescript),prism_light=__webpack_require__(880),prism_light_default=__webpack_require__.n(prism_light),ActionBar=__webpack_require__(853),ScrollArea=__webpack_require__(409),dist=__webpack_require__(30),dist_default=__webpack_require__.n(dist),formatter=memoizerific_default()(2)((function(code){return dist_default()(code)}));function _extends(){return(_extends=Object.assign||function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _slicedToArray(arr,i){return function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function _iterableToArrayLimit(arr,i){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function _unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr,i)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i 5 | * @author Lea Verou 6 | * @namespace 7 | * @public 8 | */ 9 | -------------------------------------------------------------------------------- /docs/4.9a151b1b.iframe.bundle.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"4.9a151b1b.iframe.bundle.js","sources":[],"mappings":";A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/5.4d5248d1e985d19512e5.manager.bundle.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Prism: Lightweight, robust, elegant syntax highlighting 3 | * 4 | * @license MIT 5 | * @author Lea Verou 6 | * @namespace 7 | * @public 8 | */ 9 | -------------------------------------------------------------------------------- /docs/6.297d139ca80380169c9a.manager.bundle.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[6],{876:function(module,exports,__webpack_require__){const cssKeywords=__webpack_require__(932),reverseKeywords={};for(const key of Object.keys(cssKeywords))reverseKeywords[cssKeywords[key]]=key;const convert={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};module.exports=convert;for(const model of Object.keys(convert)){if(!("channels"in convert[model]))throw new Error("missing channels property: "+model);if(!("labels"in convert[model]))throw new Error("missing channel labels property: "+model);if(convert[model].labels.length!==convert[model].channels)throw new Error("channel and label counts mismatch: "+model);const{channels:channels,labels:labels}=convert[model];delete convert[model].channels,delete convert[model].labels,Object.defineProperty(convert[model],"channels",{value:channels}),Object.defineProperty(convert[model],"labels",{value:labels})}convert.rgb.hsl=function(rgb){const r=rgb[0]/255,g=rgb[1]/255,b=rgb[2]/255,min=Math.min(r,g,b),max=Math.max(r,g,b),delta=max-min;let h,s;max===min?h=0:r===max?h=(g-b)/delta:g===max?h=2+(b-r)/delta:b===max&&(h=4+(r-g)/delta),h=Math.min(60*h,360),h<0&&(h+=360);const l=(min+max)/2;return s=max===min?0:l<=.5?delta/(max+min):delta/(2-max-min),[h,100*s,100*l]},convert.rgb.hsv=function(rgb){let rdif,gdif,bdif,h,s;const r=rgb[0]/255,g=rgb[1]/255,b=rgb[2]/255,v=Math.max(r,g,b),diff=v-Math.min(r,g,b),diffc=function(c){return(v-c)/6/diff+.5};return 0===diff?(h=0,s=0):(s=diff/v,rdif=diffc(r),gdif=diffc(g),bdif=diffc(b),r===v?h=bdif-gdif:g===v?h=1/3+rdif-bdif:b===v&&(h=2/3+gdif-rdif),h<0?h+=1:h>1&&(h-=1)),[360*h,100*s,100*v]},convert.rgb.hwb=function(rgb){const r=rgb[0],g=rgb[1];let b=rgb[2];const h=convert.rgb.hsl(rgb)[0],w=1/255*Math.min(r,Math.min(g,b));return b=1-1/255*Math.max(r,Math.max(g,b)),[h,100*w,100*b]},convert.rgb.cmyk=function(rgb){const r=rgb[0]/255,g=rgb[1]/255,b=rgb[2]/255,k=Math.min(1-r,1-g,1-b);return[100*((1-r-k)/(1-k)||0),100*((1-g-k)/(1-k)||0),100*((1-b-k)/(1-k)||0),100*k]},convert.rgb.keyword=function(rgb){const reversed=reverseKeywords[rgb];if(reversed)return reversed;let currentClosestKeyword,currentClosestDistance=1/0;for(const keyword of Object.keys(cssKeywords)){const value=cssKeywords[keyword],distance=(y=value,((x=rgb)[0]-y[0])**2+(x[1]-y[1])**2+(x[2]-y[2])**2);distance.04045?((r+.055)/1.055)**2.4:r/12.92,g=g>.04045?((g+.055)/1.055)**2.4:g/12.92,b=b>.04045?((b+.055)/1.055)**2.4:b/12.92;return[100*(.4124*r+.3576*g+.1805*b),100*(.2126*r+.7152*g+.0722*b),100*(.0193*r+.1192*g+.9505*b)]},convert.rgb.lab=function(rgb){const xyz=convert.rgb.xyz(rgb);let x=xyz[0],y=xyz[1],z=xyz[2];x/=95.047,y/=100,z/=108.883,x=x>.008856?x**(1/3):7.787*x+16/116,y=y>.008856?y**(1/3):7.787*y+16/116,z=z>.008856?z**(1/3):7.787*z+16/116;return[116*y-16,500*(x-y),200*(y-z)]},convert.hsl.rgb=function(hsl){const h=hsl[0]/360,s=hsl[1]/100,l=hsl[2]/100;let t2,t3,val;if(0===s)return val=255*l,[val,val,val];t2=l<.5?l*(1+s):l+s-l*s;const t1=2*l-t2,rgb=[0,0,0];for(let i=0;i<3;i++)t3=h+1/3*-(i-1),t3<0&&t3++,t3>1&&t3--,val=6*t3<1?t1+6*(t2-t1)*t3:2*t3<1?t2:3*t3<2?t1+(t2-t1)*(2/3-t3)*6:t1,rgb[i]=255*val;return rgb},convert.hsl.hsv=function(hsl){const h=hsl[0];let s=hsl[1]/100,l=hsl[2]/100,smin=s;const lmin=Math.max(l,.01);l*=2,s*=l<=1?l:2-l,smin*=lmin<=1?lmin:2-lmin;return[h,100*(0===l?2*smin/(lmin+smin):2*s/(l+s)),100*((l+s)/2)]},convert.hsv.rgb=function(hsv){const h=hsv[0]/60,s=hsv[1]/100;let v=hsv[2]/100;const hi=Math.floor(h)%6,f=h-Math.floor(h),p=255*v*(1-s),q=255*v*(1-s*f),t=255*v*(1-s*(1-f));switch(v*=255,hi){case 0:return[v,t,p];case 1:return[q,v,p];case 2:return[p,v,t];case 3:return[p,q,v];case 4:return[t,p,v];case 5:return[v,p,q]}},convert.hsv.hsl=function(hsv){const h=hsv[0],s=hsv[1]/100,v=hsv[2]/100,vmin=Math.max(v,.01);let sl,l;l=(2-s)*v;const lmin=(2-s)*vmin;return sl=s*vmin,sl/=lmin<=1?lmin:2-lmin,sl=sl||0,l/=2,[h,100*sl,100*l]},convert.hwb.rgb=function(hwb){const h=hwb[0]/360;let wh=hwb[1]/100,bl=hwb[2]/100;const ratio=wh+bl;let f;ratio>1&&(wh/=ratio,bl/=ratio);const i=Math.floor(6*h),v=1-bl;f=6*h-i,0!=(1&i)&&(f=1-f);const n=wh+f*(v-wh);let r,g,b;switch(i){default:case 6:case 0:r=v,g=n,b=wh;break;case 1:r=n,g=v,b=wh;break;case 2:r=wh,g=v,b=n;break;case 3:r=wh,g=n,b=v;break;case 4:r=n,g=wh,b=v;break;case 5:r=v,g=wh,b=n}return[255*r,255*g,255*b]},convert.cmyk.rgb=function(cmyk){const c=cmyk[0]/100,m=cmyk[1]/100,y=cmyk[2]/100,k=cmyk[3]/100;return[255*(1-Math.min(1,c*(1-k)+k)),255*(1-Math.min(1,m*(1-k)+k)),255*(1-Math.min(1,y*(1-k)+k))]},convert.xyz.rgb=function(xyz){const x=xyz[0]/100,y=xyz[1]/100,z=xyz[2]/100;let r,g,b;return r=3.2406*x+-1.5372*y+-.4986*z,g=-.9689*x+1.8758*y+.0415*z,b=.0557*x+-.204*y+1.057*z,r=r>.0031308?1.055*r**(1/2.4)-.055:12.92*r,g=g>.0031308?1.055*g**(1/2.4)-.055:12.92*g,b=b>.0031308?1.055*b**(1/2.4)-.055:12.92*b,r=Math.min(Math.max(0,r),1),g=Math.min(Math.max(0,g),1),b=Math.min(Math.max(0,b),1),[255*r,255*g,255*b]},convert.xyz.lab=function(xyz){let x=xyz[0],y=xyz[1],z=xyz[2];x/=95.047,y/=100,z/=108.883,x=x>.008856?x**(1/3):7.787*x+16/116,y=y>.008856?y**(1/3):7.787*y+16/116,z=z>.008856?z**(1/3):7.787*z+16/116;return[116*y-16,500*(x-y),200*(y-z)]},convert.lab.xyz=function(lab){let x,y,z;y=(lab[0]+16)/116,x=lab[1]/500+y,z=y-lab[2]/200;const y2=y**3,x2=x**3,z2=z**3;return y=y2>.008856?y2:(y-16/116)/7.787,x=x2>.008856?x2:(x-16/116)/7.787,z=z2>.008856?z2:(z-16/116)/7.787,x*=95.047,y*=100,z*=108.883,[x,y,z]},convert.lab.lch=function(lab){const l=lab[0],a=lab[1],b=lab[2];let h;h=360*Math.atan2(b,a)/2/Math.PI,h<0&&(h+=360);return[l,Math.sqrt(a*a+b*b),h]},convert.lch.lab=function(lch){const l=lch[0],c=lch[1],hr=lch[2]/360*2*Math.PI;return[l,c*Math.cos(hr),c*Math.sin(hr)]},convert.rgb.ansi16=function(args,saturation=null){const[r,g,b]=args;let value=null===saturation?convert.rgb.hsv(args)[2]:saturation;if(value=Math.round(value/50),0===value)return 30;let ansi=30+(Math.round(b/255)<<2|Math.round(g/255)<<1|Math.round(r/255));return 2===value&&(ansi+=60),ansi},convert.hsv.ansi16=function(args){return convert.rgb.ansi16(convert.hsv.rgb(args),args[2])},convert.rgb.ansi256=function(args){const r=args[0],g=args[1],b=args[2];if(r===g&&g===b)return r<8?16:r>248?231:Math.round((r-8)/247*24)+232;return 16+36*Math.round(r/255*5)+6*Math.round(g/255*5)+Math.round(b/255*5)},convert.ansi16.rgb=function(args){let color=args%10;if(0===color||7===color)return args>50&&(color+=3.5),color=color/10.5*255,[color,color,color];const mult=.5*(1+~~(args>50));return[(1&color)*mult*255,(color>>1&1)*mult*255,(color>>2&1)*mult*255]},convert.ansi256.rgb=function(args){if(args>=232){const c=10*(args-232)+8;return[c,c,c]}let rem;args-=16;return[Math.floor(args/36)/5*255,Math.floor((rem=args%36)/6)/5*255,rem%6/5*255]},convert.rgb.hex=function(args){const string=(((255&Math.round(args[0]))<<16)+((255&Math.round(args[1]))<<8)+(255&Math.round(args[2]))).toString(16).toUpperCase();return"000000".substring(string.length)+string},convert.hex.rgb=function(args){const match=args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!match)return[0,0,0];let colorString=match[0];3===match[0].length&&(colorString=colorString.split("").map(char=>char+char).join(""));const integer=parseInt(colorString,16);return[integer>>16&255,integer>>8&255,255&integer]},convert.rgb.hcg=function(rgb){const r=rgb[0]/255,g=rgb[1]/255,b=rgb[2]/255,max=Math.max(Math.max(r,g),b),min=Math.min(Math.min(r,g),b),chroma=max-min;let grayscale,hue;return grayscale=chroma<1?min/(1-chroma):0,hue=chroma<=0?0:max===r?(g-b)/chroma%6:max===g?2+(b-r)/chroma:4+(r-g)/chroma,hue/=6,hue%=1,[360*hue,100*chroma,100*grayscale]},convert.hsl.hcg=function(hsl){const s=hsl[1]/100,l=hsl[2]/100,c=l<.5?2*s*l:2*s*(1-l);let f=0;return c<1&&(f=(l-.5*c)/(1-c)),[hsl[0],100*c,100*f]},convert.hsv.hcg=function(hsv){const s=hsv[1]/100,v=hsv[2]/100,c=s*v;let f=0;return c<1&&(f=(v-c)/(1-c)),[hsv[0],100*c,100*f]},convert.hcg.rgb=function(hcg){const h=hcg[0]/360,c=hcg[1]/100,g=hcg[2]/100;if(0===c)return[255*g,255*g,255*g];const pure=[0,0,0],hi=h%1*6,v=hi%1,w=1-v;let mg=0;switch(Math.floor(hi)){case 0:pure[0]=1,pure[1]=v,pure[2]=0;break;case 1:pure[0]=w,pure[1]=1,pure[2]=0;break;case 2:pure[0]=0,pure[1]=1,pure[2]=v;break;case 3:pure[0]=0,pure[1]=w,pure[2]=1;break;case 4:pure[0]=v,pure[1]=0,pure[2]=1;break;default:pure[0]=1,pure[1]=0,pure[2]=w}return mg=(1-c)*g,[255*(c*pure[0]+mg),255*(c*pure[1]+mg),255*(c*pure[2]+mg)]},convert.hcg.hsv=function(hcg){const c=hcg[1]/100,v=c+hcg[2]/100*(1-c);let f=0;return v>0&&(f=c/v),[hcg[0],100*f,100*v]},convert.hcg.hsl=function(hcg){const c=hcg[1]/100,l=hcg[2]/100*(1-c)+.5*c;let s=0;return l>0&&l<.5?s=c/(2*l):l>=.5&&l<1&&(s=c/(2*(1-l))),[hcg[0],100*s,100*l]},convert.hcg.hwb=function(hcg){const c=hcg[1]/100,v=c+hcg[2]/100*(1-c);return[hcg[0],100*(v-c),100*(1-v)]},convert.hwb.hcg=function(hwb){const w=hwb[1]/100,v=1-hwb[2]/100,c=v-w;let g=0;return c<1&&(g=(v-c)/(1-c)),[hwb[0],100*c,100*g]},convert.apple.rgb=function(apple){return[apple[0]/65535*255,apple[1]/65535*255,apple[2]/65535*255]},convert.rgb.apple=function(rgb){return[rgb[0]/255*65535,rgb[1]/255*65535,rgb[2]/255*65535]},convert.gray.rgb=function(args){return[args[0]/100*255,args[0]/100*255,args[0]/100*255]},convert.gray.hsl=function(args){return[0,0,args[0]]},convert.gray.hsv=convert.gray.hsl,convert.gray.hwb=function(gray){return[0,100,gray[0]]},convert.gray.cmyk=function(gray){return[0,0,0,gray[0]]},convert.gray.lab=function(gray){return[gray[0],0,0]},convert.gray.hex=function(gray){const val=255&Math.round(gray[0]/100*255),string=((val<<16)+(val<<8)+val).toString(16).toUpperCase();return"000000".substring(string.length)+string},convert.rgb.gray=function(rgb){return[(rgb[0]+rgb[1]+rgb[2])/3/255*100]}},931:function(module,exports,__webpack_require__){const conversions=__webpack_require__(876),route=__webpack_require__(933),convert={};Object.keys(conversions).forEach(fromModel=>{convert[fromModel]={},Object.defineProperty(convert[fromModel],"channels",{value:conversions[fromModel].channels}),Object.defineProperty(convert[fromModel],"labels",{value:conversions[fromModel].labels});const routes=route(fromModel);Object.keys(routes).forEach(toModel=>{const fn=routes[toModel];convert[fromModel][toModel]=function wrapRounded(fn){const wrappedFn=function(...args){const arg0=args[0];if(null==arg0)return arg0;arg0.length>1&&(args=arg0);const result=fn(args);if("object"==typeof result)for(let len=result.length,i=0;i1&&(args=arg0),fn(args))};return"conversion"in fn&&(wrappedFn.conversion=fn.conversion),wrappedFn}(fn)})}),module.exports=convert},932:function(module,exports,__webpack_require__){"use strict";module.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},933:function(module,exports,__webpack_require__){const conversions=__webpack_require__(876);function deriveBFS(fromModel){const graph=function buildGraph(){const graph={},models=Object.keys(conversions);for(let len=models.length,i=0;i=0||(n[t]=e[t]);return n}var c="undefined"!=typeof window?react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect:react__WEBPACK_IMPORTED_MODULE_0__.useEffect;function i(e){var r=Object(react__WEBPACK_IMPORTED_MODULE_0__.useRef)(e);return Object(react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((function(){r.current=e})),Object(react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((function(e){return r.current&&r.current(e)}),[])}var s=function(e,r,t){return void 0===r&&(r=0),void 0===t&&(t=1),e>t?t:e0:e.buttons>0)&&h.current?_(v(h.current,e)):b(!1)}),[_]),x=Object(react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((function(e){var r=e.nativeEvent;r.preventDefault(),function(e){return!(m.current&&!f(e)||(m.current||(m.current=f(e)),0))}(r)&&(_(v(h.current,r)),b(!0))}),[_]),H=Object(react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((function(e){var r=e.which||e.keyCode;r<37||r>40||(e.preventDefault(),C({left:39===r?.05:37===r?-.05:0,top:40===r?.05:38===r?-.05:0}))}),[C]),N=Object(react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((function(){return b(!1)}),[]),M=Object(react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((function(e){var r=e?window.addEventListener:window.removeEventListener;r(m.current?"touchmove":"mousemove",E),r(m.current?"touchend":"mouseup",N)}),[E,N]);return c((function(){return M(p),function(){p&&M(!1)}}),[p,M]),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",l({},d,{className:"react-colorful__interactive",ref:h,onTouchStart:x,onMouseDown:x,onKeyDown:H,tabIndex:0,role:"slider"}))})),h=function(e){return e.filter(Boolean).join(" ")},m=function(r){var t=r.color,o=r.left,n=r.top,a=void 0===n?.5:n,l=h(["react-colorful__pointer",r.className]);return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",{className:l,style:{top:100*a+"%",left:100*o+"%"}},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},g=function(e,r,t){return void 0===r&&(r=0),void 0===t&&(t=Math.pow(10,r)),Math.round(t*e)/t},p=function(e){return"#"===e[0]&&(e=e.substr(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:1}:{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:1}},b=function(e){var r=/hsla?\((\d+\.?\d*),\s*(\d+\.?\d*)%?,\s*(\d+\.?\d*)%?,?\s*(\d+\.?\d*)?\)/.exec(e);return r?C({h:Number(r[1]),s:Number(r[2]),l:Number(r[3]),a:void 0===r[4]?1:Number(r[4])}):{h:0,s:0,v:0,a:1}},C=function(e){var r=e.s,t=e.l;return{h:e.h,s:(r*=(t<50?t:100-t)/100)>0?2*r/(t+r)*100:0,v:t+r,a:e.a}},E=function(e){var r=e.s,t=e.v,o=e.a,n=(200-r)*t/100;return{h:g(e.h),s:g(n>0&&n<200?r*t/100/(n<=100?n:200-n)*100:0),l:g(n/2),a:g(o,2)}},x=function(e){var r=E(e);return"hsl("+r.h+", "+r.s+"%, "+r.l+"%)"},H=function(e){var r=E(e);return"hsla("+r.h+", "+r.s+"%, "+r.l+"%, "+r.a+")"},N=function(e){var r=e.h,t=e.s,o=e.v,n=e.a;r=r/360*6,t/=100,o/=100;var a=Math.floor(r),l=o*(1-t),u=o*(1-(r-a)*t),c=o*(1-(1-r+a)*t),i=a%6;return{r:g(255*[o,u,l,l,c,o][i]),g:g(255*[c,o,o,u,l,l][i]),b:g(255*[l,l,c,o,o,u][i]),a:g(n,2)}},y=function(e){var r=/rgba?\((\d+),\s*(\d+),\s*(\d+),?\s*(\d+\.?\d*)?\)/.exec(e);return r?O({r:Number(r[1]),g:Number(r[2]),b:Number(r[3]),a:void 0===r[4]?1:Number(r[4])}):{h:0,s:0,v:0,a:1}},k=function(e){var r=e.toString(16);return r.length<2?"0"+r:r},O=function(e){var r=e.r,t=e.g,o=e.b,n=e.a,a=Math.max(r,t,o),l=a-Math.min(r,t,o),u=l?a===r?(t-o)/l:a===t?2+(o-r)/l:4+(r-t)/l:0;return{h:g(60*(u<0?u+6:u)),s:g(a?l/a*100:0),v:g(a/255*100),a:n}},j=react__WEBPACK_IMPORTED_MODULE_0___default.a.memo((function(r){var t=r.hue,o=r.onChange,n=h(["react-colorful__hue",r.className]);return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",{className:n},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(d,{onMove:function(e){o({h:360*e.left})},onKey:function(e){o({h:s(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuetext":g(t)},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(m,{className:"react-colorful__hue-pointer",left:t/360,color:x({h:t,s:100,v:100,a:1})})))})),z=react__WEBPACK_IMPORTED_MODULE_0___default.a.memo((function(r){var t=r.hsva,o=r.onChange,n={backgroundColor:x({h:t.h,s:100,v:100,a:1})};return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",{className:"react-colorful__saturation",style:n},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(d,{onMove:function(e){o({s:100*e.left,v:100-100*e.top})},onKey:function(e){o({s:s(t.s+100*e.left,0,100),v:s(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+g(t.s)+"%, Brightness "+g(t.v)+"%"},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(m,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:x(t)})))})),B=function(e,r){if(e===r)return!0;for(var t in e)if(e[t]!==r[t])return!1;return!0},K=function(e,r){return e.replace(/\s/g,"")===r.replace(/\s/g,"")};function D(e,r,l){var u=i(l),c=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)((function(){return e.toHsva(r)})),s=c[0],f=c[1],v=Object(react__WEBPACK_IMPORTED_MODULE_0__.useRef)({color:r,hsva:s});Object(react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((function(){if(!e.equal(r,v.current.color)){var t=e.toHsva(r);v.current={hsva:t,color:r},f(t)}}),[r,e]),Object(react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((function(){var r;B(s,v.current.hsva)||e.equal(r=e.fromHsva(s),v.current.color)||(v.current={hsva:s,color:r},u(r))}),[s,e,u]);var d=Object(react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((function(e){f((function(r){return Object.assign({},r,e)}))}),[]);return[s,d]}var L,A=function(){c((function(){"undefined"==typeof document||L||((L=document.head.appendChild(document.createElement("style"))).innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}')}),[])},F=function(r){var t=r.className,o=r.colorModel,n=r.color,a=void 0===n?o.defaultColor:n,c=r.onChange,i=u(r,["className","colorModel","color","onChange"]);A();var s=D(o,a,c),f=s[0],v=s[1],d=h(["react-colorful",t]);return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",l({},i,{className:d}),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(z,{hsva:f,onChange:v}),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(j,{hue:f.h,onChange:v,className:"react-colorful__last-control"}))},S={defaultColor:"000",toHsva:function(e){return O(p(e))},fromHsva:function(e){return t=(r=N(e)).g,o=r.b,"#"+k(r.r)+k(t)+k(o);var r,t,o},equal:function(e,r){return e.toLowerCase()===r.toLowerCase()||B(p(e),p(r))}},T=function(r){return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(F,l({},r,{colorModel:S}))},X=function(r){var t=r.className,o=r.hsva,n=r.onChange,a={backgroundImage:"linear-gradient(90deg, "+H(Object.assign({},o,{a:0}))+", "+H(Object.assign({},o,{a:1}))+")"},l=h(["react-colorful__alpha",t]);return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",{className:l},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",{className:"react-colorful__alpha-gradient",style:a}),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(d,{onMove:function(e){n({a:e.left})},onKey:function(e){n({a:s(o.a+e.left)})},"aria-label":"Alpha","aria-valuetext":g(100*o.a)+"%"},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(m,{className:"react-colorful__alpha-pointer",left:o.a,color:H(o)})))},Y=function(r){var t=r.className,o=r.colorModel,n=r.color,a=void 0===n?o.defaultColor:n,c=r.onChange,i=u(r,["className","colorModel","color","onChange"]);A();var s=D(o,a,c),f=s[0],v=s[1],d=h(["react-colorful",t]);return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",l({},i,{className:d}),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(z,{hsva:f,onChange:v}),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(j,{hue:f.h,onChange:v}),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(X,{hsva:f,onChange:v,className:"react-colorful__last-control"}))},R={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:b,fromHsva:H,equal:K},G=function(r){return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Y,l({},r,{colorModel:R}))},ce={defaultColor:"rgba(0, 0, 0, 1)",toHsva:y,fromHsva:function(e){var r=N(e);return"rgba("+r.r+", "+r.g+", "+r.b+", "+r.a+")"},equal:K},ie=function(r){return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Y,l({},r,{colorModel:ce}))}}}]); -------------------------------------------------------------------------------- /docs/6.f7f9ab19.iframe.bundle.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | * OverlayScrollbars 3 | * https://github.com/KingSora/OverlayScrollbars 4 | * 5 | * Version: 1.13.0 6 | * 7 | * Copyright KingSora | Rene Haas. 8 | * https://github.com/KingSora 9 | * 10 | * Released under the MIT license. 11 | * Date: 02.08.2020 12 | */ 13 | -------------------------------------------------------------------------------- /docs/6.f7f9ab19.iframe.bundle.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"6.f7f9ab19.iframe.bundle.js","sources":[],"mappings":";A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/7.1dd6103d8c4adf231b89.manager.bundle.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[7],{854:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"getScrollAreaStyles",(function(){return getScrollAreaStyles}));var _templateObject,react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),react__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__),_storybook_theming__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(51);var hsResizeObserverDummyAnimation=Object(_storybook_theming__WEBPACK_IMPORTED_MODULE_1__.d)(_templateObject||(_templateObject=function _taggedTemplateLiteral(strings,raw){return raw||(raw=strings.slice(0)),Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}))}(["0%{z-index:0}to{z-index:-1}"]))),getScrollAreaStyles=function getScrollAreaStyles(theme){return{"html.os-html, html.os-html>.os-host":{display:"block",overflow:"hidden",boxSizing:"border-box",height:"100%!important",width:"100%!important",minWidth:"100%!important",minHeight:"100%!important",margin:"0!important",position:"absolute!important"},"html.os-html>.os-host>.os-padding":{position:"absolute"},"body.os-dragging, body.os-dragging *":{cursor:"default"},".os-host, .os-host-textarea":{position:"relative",overflow:"visible!important",flexDirection:"column",flexWrap:"nowrap",justifyContent:"flex-start",alignContent:"flex-start",alignItems:"flex-start"},".os-host-flexbox":{overflow:"hidden!important",display:"flex"},".os-host-flexbox>.os-size-auto-observer":{height:"inherit!important"},".os-host-flexbox>.os-content-glue":{flexGrow:1,flexShrink:0},".os-host-flexbox>.os-size-auto-observer, .os-host-flexbox>.os-content-glue":{minHeight:0,minWidth:0,flexGrow:0,flexShrink:1,flexBasis:"auto"},"#os-dummy-scrollbar-size":{position:"fixed",opacity:0,visibility:"hidden",overflow:"scroll",height:500,width:500},"#os-dummy-scrollbar-size>div":{width:"200%",height:"200%",margin:10},"#os-dummy-scrollbar-size, .os-viewport":{},".os-viewport-native-scrollbars-invisible#os-dummy-scrollbar-size, .os-viewport-native-scrollbars-invisible.os-viewport":{scrollbarWidth:"none!important"},".os-viewport-native-scrollbars-invisible#os-dummy-scrollbar-size::-webkit-scrollbar, .os-viewport-native-scrollbars-invisible.os-viewport::-webkit-scrollbar, .os-viewport-native-scrollbars-invisible#os-dummy-scrollbar-size::-webkit-scrollbar-corner, .os-viewport-native-scrollbars-invisible.os-viewport::-webkit-scrollbar-corner":{display:"none!important",width:"0!important",height:"0!important",visibility:"hidden!important",background:"0 0!important"},".os-content-glue":{boxSizing:"inherit",maxHeight:"100%",maxWidth:"100%",width:"100%",pointerEvents:"none"},".os-padding":{boxSizing:"inherit",direction:"inherit",position:"absolute",overflow:"visible",padding:0,margin:0,left:0,top:0,bottom:0,right:0,width:"auto!important",height:"auto!important",zIndex:1},".os-host-overflow>.os-padding":{overflow:"hidden"},".os-viewport":{direction:"inherit!important",boxSizing:"inherit!important",resize:"none!important",outline:"0!important",position:"absolute",overflow:"hidden",top:0,left:0,bottom:0,right:0,padding:0,margin:0},".os-content-arrange":{position:"absolute",zIndex:-1,minHeight:1,minWidth:1,pointerEvents:"none"},".os-content":{direction:"inherit",boxSizing:"border-box!important",position:"relative",display:"block",height:"100%",width:"100%",visibility:"visible"},".os-content:before, .os-content:after":{content:"''",display:"table",width:0,height:0,lineHeight:0,fontSize:0},".os-content>.os-textarea":{boxSizing:"border-box!important",direction:"inherit!important",background:"0 0!important",outline:"0 transparent!important",overflow:"hidden!important",position:"absolute!important",display:"block!important",top:"0!important",left:"0!important",margin:"0!important",borderRadius:"0!important",float:"none!important",filter:"none!important",border:"0!important",resize:"none!important",transform:"none!important",maxWidth:"none!important",maxHeight:"none!important",boxShadow:"none!important",perspective:"none!important",opacity:"1!important",zIndex:"1!important",clip:"auto!important",verticalAlign:"baseline!important",padding:0},".os-host-rtl>.os-padding>.os-viewport>.os-content>.os-textarea":{right:"0!important"},".os-content>.os-textarea-cover":{zIndex:-1,pointerEvents:"none"},".os-content>.os-textarea[wrap=off]":{whiteSpace:"pre!important",margin:"0!important"},".os-text-inherit":{fontFamily:"inherit",fontSize:"inherit",fontWeight:"inherit",fontStyle:"inherit",fontVariant:"inherit",textTransform:"inherit",textDecoration:"inherit",textIndent:"inherit",textAlign:"inherit",textShadow:"inherit",textOverflow:"inherit",letterSpacing:"inherit",wordSpacing:"inherit",lineHeight:"inherit",unicodeBidi:"inherit",direction:"inherit",color:"inherit",cursor:"text"},".os-resize-observer, .os-resize-observer-host":{boxSizing:"inherit",display:"block",opacity:0,position:"absolute",top:0,left:0,height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none",zIndex:-1},".os-resize-observer-host":{padding:"inherit",border:"inherit",borderColor:"transparent",borderStyle:"solid",boxSizing:"border-box"},".os-resize-observer-host:after":{content:"''"},".os-resize-observer-host>.os-resize-observer, .os-resize-observer-host:after":{height:"200%",width:"200%",padding:"inherit",border:"inherit",margin:0,display:"block",boxSizing:"content-box"},".os-resize-observer.observed, object.os-resize-observer":{boxSizing:"border-box!important"},".os-size-auto-observer":{boxSizing:"inherit!important",height:"100%",width:"inherit",maxWidth:1,position:"relative",float:"left",maxHeight:1,overflow:"hidden",zIndex:-1,padding:0,margin:0,pointerEvents:"none",flexGrow:"inherit",flexShrink:0,flexBasis:0},".os-size-auto-observer>.os-resize-observer":{width:"1000%",height:"1000%",minHeight:1,minWidth:1},".os-resize-observer-item":{position:"absolute",top:0,right:0,bottom:0,left:0,overflow:"hidden",zIndex:-1,opacity:0,direction:"ltr!important",flex:"none!important"},".os-resize-observer-item-final":{position:"absolute",left:0,top:0,transition:"none!important",flex:"none!important"},".os-resize-observer":{animationDuration:".001s",animationName:"".concat(hsResizeObserverDummyAnimation)},".os-host-transition>.os-scrollbar, .os-host-transition>.os-scrollbar-corner":{transition:"opacity .3s,visibility .3s,top .3s,right .3s,bottom .3s,left .3s"},"html.os-html>.os-host>.os-scrollbar":{position:"absolute",zIndex:999999},".os-scrollbar, .os-scrollbar-corner":{position:"absolute",opacity:1,zIndex:1},".os-scrollbar-corner":{bottom:0,right:0,height:10,width:10,backgroundColor:"transparent"},".os-scrollbar":{pointerEvents:"none",padding:2,boxSizing:"border-box",background:0},".os-scrollbar-track":{pointerEvents:"auto",position:"relative",height:"100%",width:"100%",padding:"0!important",border:"0!important"},".os-scrollbar-handle":{pointerEvents:"auto",position:"absolute",width:"100%",height:"100%"},".os-scrollbar-handle-off, .os-scrollbar-track-off":{pointerEvents:"none"},".os-scrollbar.os-scrollbar-unusable, .os-scrollbar.os-scrollbar-unusable *":{pointerEvents:"none!important"},".os-scrollbar.os-scrollbar-unusable .os-scrollbar-handle":{opacity:"0!important"},".os-scrollbar-horizontal":{bottom:0,left:0,right:10,height:10},".os-scrollbar-vertical":{top:0,right:0,bottom:10,width:10},".os-host-rtl>.os-scrollbar-horizontal":{right:0},".os-host-rtl>.os-scrollbar-vertical":{right:"auto",left:0},".os-host-rtl>.os-scrollbar-corner":{right:"auto",left:0},".os-scrollbar-auto-hidden, .os-padding+.os-scrollbar-corner, .os-host-resize-disabled.os-host-scrollbar-horizontal-hidden>.os-scrollbar-corner, .os-host-scrollbar-horizontal-hidden>.os-scrollbar-horizontal, .os-host-resize-disabled.os-host-scrollbar-vertical-hidden>.os-scrollbar-corner, .os-host-scrollbar-vertical-hidden>.os-scrollbar-vertical, .os-scrollbar-horizontal.os-scrollbar-auto-hidden+.os-scrollbar-vertical+.os-scrollbar-corner, .os-scrollbar-horizontal+.os-scrollbar-vertical.os-scrollbar-auto-hidden+.os-scrollbar-corner, .os-scrollbar-horizontal.os-scrollbar-auto-hidden+.os-scrollbar-vertical.os-scrollbar-auto-hidden+.os-scrollbar-corner":{opacity:0,visibility:"hidden",pointerEvents:"none"},".os-scrollbar-corner-resize-both":{cursor:"nwse-resize"},".os-host-rtl>.os-scrollbar-corner-resize-both":{cursor:"nesw-resize"},".os-scrollbar-corner-resize-horizontal":{cursor:"ew-resize"},".os-scrollbar-corner-resize-vertical":{cursor:"ns-resize"},".os-dragging .os-scrollbar-corner.os-scrollbar-corner-resize":{cursor:"default"},".os-host-resize-disabled.os-host-scrollbar-horizontal-hidden>.os-scrollbar-vertical":{top:0,bottom:0},".os-host-resize-disabled.os-host-scrollbar-vertical-hidden>.os-scrollbar-horizontal, .os-host-rtl.os-host-resize-disabled.os-host-scrollbar-vertical-hidden>.os-scrollbar-horizontal":{right:0,left:0},".os-scrollbar:hover, .os-scrollbar-corner.os-scrollbar-corner-resize":{opacity:"1!important",visibility:"visible!important"},".os-scrollbar-corner.os-scrollbar-corner-resize":{backgroundImage:"linear-gradient(135deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 50%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.4) 100%)",backgroundRepeat:"no-repeat",backgroundPosition:"100% 100%",pointerEvents:"auto!important"},".os-host-rtl>.os-scrollbar-corner.os-scrollbar-corner-resize":{transform:"scale(-1,1)"},".os-host-overflow":{overflow:"hidden!important"},".os-theme-dark.os-host-rtl>.os-scrollbar-horizontal":{left:10,right:0},".os-scrollbar.os-scrollbar-unusable":{background:0},".os-scrollbar>.os-scrollbar-track":{background:0},".os-scrollbar-horizontal>.os-scrollbar-track>.os-scrollbar-handle":{minWidth:30},".os-scrollbar-vertical>.os-scrollbar-track>.os-scrollbar-handle":{minHeight:30},".os-theme-dark.os-host-transition>.os-scrollbar>.os-scrollbar-track>.os-scrollbar-handle":{transition:"background-color .3s"},".os-scrollbar>.os-scrollbar-track>.os-scrollbar-handle, .os-scrollbar>.os-scrollbar-track":{borderRadius:10},".os-scrollbar>.os-scrollbar-track>.os-scrollbar-handle":{background:theme.color.darker,opacity:.5},".os-scrollbar:hover>.os-scrollbar-track>.os-scrollbar-handle":{opacity:.6},".os-scrollbar-horizontal .os-scrollbar-handle:before, .os-scrollbar-vertical .os-scrollbar-handle:before":{content:"''",position:"absolute",left:0,right:0,top:0,bottom:0,display:"block"},".os-theme-dark.os-host-scrollbar-horizontal-hidden>.os-scrollbar-horizontal .os-scrollbar-handle:before, .os-theme-dark.os-host-scrollbar-vertical-hidden>.os-scrollbar-vertical .os-scrollbar-handle:before":{display:"none"},".os-scrollbar-horizontal .os-scrollbar-handle:before":{top:-6,bottom:-2},".os-scrollbar-vertical .os-scrollbar-handle:before":{left:-6,right:-2},".os-host-rtl.os-scrollbar-vertical .os-scrollbar-handle:before":{right:-6,left:-2}}},GlobalScrollAreaStyles=function GlobalScrollAreaStyles(){return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_storybook_theming__WEBPACK_IMPORTED_MODULE_1__.a,{styles:getScrollAreaStyles})};GlobalScrollAreaStyles.displayName="GlobalScrollAreaStyles",__webpack_exports__.default=GlobalScrollAreaStyles}}]); -------------------------------------------------------------------------------- /docs/7.7766ae9b.iframe.bundle.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[7],{982:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"getScrollAreaStyles",(function(){return getScrollAreaStyles}));var _templateObject,react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(1),react__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__),_storybook_theming__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(56);var hsResizeObserverDummyAnimation=Object(_storybook_theming__WEBPACK_IMPORTED_MODULE_1__.c)(_templateObject||(_templateObject=function _taggedTemplateLiteral(strings,raw){return raw||(raw=strings.slice(0)),Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}))}(["0%{z-index:0}to{z-index:-1}"]))),getScrollAreaStyles=function getScrollAreaStyles(theme){return{"html.os-html, html.os-html>.os-host":{display:"block",overflow:"hidden",boxSizing:"border-box",height:"100%!important",width:"100%!important",minWidth:"100%!important",minHeight:"100%!important",margin:"0!important",position:"absolute!important"},"html.os-html>.os-host>.os-padding":{position:"absolute"},"body.os-dragging, body.os-dragging *":{cursor:"default"},".os-host, .os-host-textarea":{position:"relative",overflow:"visible!important",flexDirection:"column",flexWrap:"nowrap",justifyContent:"flex-start",alignContent:"flex-start",alignItems:"flex-start"},".os-host-flexbox":{overflow:"hidden!important",display:"flex"},".os-host-flexbox>.os-size-auto-observer":{height:"inherit!important"},".os-host-flexbox>.os-content-glue":{flexGrow:1,flexShrink:0},".os-host-flexbox>.os-size-auto-observer, .os-host-flexbox>.os-content-glue":{minHeight:0,minWidth:0,flexGrow:0,flexShrink:1,flexBasis:"auto"},"#os-dummy-scrollbar-size":{position:"fixed",opacity:0,visibility:"hidden",overflow:"scroll",height:500,width:500},"#os-dummy-scrollbar-size>div":{width:"200%",height:"200%",margin:10},"#os-dummy-scrollbar-size, .os-viewport":{},".os-viewport-native-scrollbars-invisible#os-dummy-scrollbar-size, .os-viewport-native-scrollbars-invisible.os-viewport":{scrollbarWidth:"none!important"},".os-viewport-native-scrollbars-invisible#os-dummy-scrollbar-size::-webkit-scrollbar, .os-viewport-native-scrollbars-invisible.os-viewport::-webkit-scrollbar, .os-viewport-native-scrollbars-invisible#os-dummy-scrollbar-size::-webkit-scrollbar-corner, .os-viewport-native-scrollbars-invisible.os-viewport::-webkit-scrollbar-corner":{display:"none!important",width:"0!important",height:"0!important",visibility:"hidden!important",background:"0 0!important"},".os-content-glue":{boxSizing:"inherit",maxHeight:"100%",maxWidth:"100%",width:"100%",pointerEvents:"none"},".os-padding":{boxSizing:"inherit",direction:"inherit",position:"absolute",overflow:"visible",padding:0,margin:0,left:0,top:0,bottom:0,right:0,width:"auto!important",height:"auto!important",zIndex:1},".os-host-overflow>.os-padding":{overflow:"hidden"},".os-viewport":{direction:"inherit!important",boxSizing:"inherit!important",resize:"none!important",outline:"0!important",position:"absolute",overflow:"hidden",top:0,left:0,bottom:0,right:0,padding:0,margin:0},".os-content-arrange":{position:"absolute",zIndex:-1,minHeight:1,minWidth:1,pointerEvents:"none"},".os-content":{direction:"inherit",boxSizing:"border-box!important",position:"relative",display:"block",height:"100%",width:"100%",visibility:"visible"},".os-content:before, .os-content:after":{content:"''",display:"table",width:0,height:0,lineHeight:0,fontSize:0},".os-content>.os-textarea":{boxSizing:"border-box!important",direction:"inherit!important",background:"0 0!important",outline:"0 transparent!important",overflow:"hidden!important",position:"absolute!important",display:"block!important",top:"0!important",left:"0!important",margin:"0!important",borderRadius:"0!important",float:"none!important",filter:"none!important",border:"0!important",resize:"none!important",transform:"none!important",maxWidth:"none!important",maxHeight:"none!important",boxShadow:"none!important",perspective:"none!important",opacity:"1!important",zIndex:"1!important",clip:"auto!important",verticalAlign:"baseline!important",padding:0},".os-host-rtl>.os-padding>.os-viewport>.os-content>.os-textarea":{right:"0!important"},".os-content>.os-textarea-cover":{zIndex:-1,pointerEvents:"none"},".os-content>.os-textarea[wrap=off]":{whiteSpace:"pre!important",margin:"0!important"},".os-text-inherit":{fontFamily:"inherit",fontSize:"inherit",fontWeight:"inherit",fontStyle:"inherit",fontVariant:"inherit",textTransform:"inherit",textDecoration:"inherit",textIndent:"inherit",textAlign:"inherit",textShadow:"inherit",textOverflow:"inherit",letterSpacing:"inherit",wordSpacing:"inherit",lineHeight:"inherit",unicodeBidi:"inherit",direction:"inherit",color:"inherit",cursor:"text"},".os-resize-observer, .os-resize-observer-host":{boxSizing:"inherit",display:"block",opacity:0,position:"absolute",top:0,left:0,height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none",zIndex:-1},".os-resize-observer-host":{padding:"inherit",border:"inherit",borderColor:"transparent",borderStyle:"solid",boxSizing:"border-box"},".os-resize-observer-host:after":{content:"''"},".os-resize-observer-host>.os-resize-observer, .os-resize-observer-host:after":{height:"200%",width:"200%",padding:"inherit",border:"inherit",margin:0,display:"block",boxSizing:"content-box"},".os-resize-observer.observed, object.os-resize-observer":{boxSizing:"border-box!important"},".os-size-auto-observer":{boxSizing:"inherit!important",height:"100%",width:"inherit",maxWidth:1,position:"relative",float:"left",maxHeight:1,overflow:"hidden",zIndex:-1,padding:0,margin:0,pointerEvents:"none",flexGrow:"inherit",flexShrink:0,flexBasis:0},".os-size-auto-observer>.os-resize-observer":{width:"1000%",height:"1000%",minHeight:1,minWidth:1},".os-resize-observer-item":{position:"absolute",top:0,right:0,bottom:0,left:0,overflow:"hidden",zIndex:-1,opacity:0,direction:"ltr!important",flex:"none!important"},".os-resize-observer-item-final":{position:"absolute",left:0,top:0,transition:"none!important",flex:"none!important"},".os-resize-observer":{animationDuration:".001s",animationName:"".concat(hsResizeObserverDummyAnimation)},".os-host-transition>.os-scrollbar, .os-host-transition>.os-scrollbar-corner":{transition:"opacity .3s,visibility .3s,top .3s,right .3s,bottom .3s,left .3s"},"html.os-html>.os-host>.os-scrollbar":{position:"absolute",zIndex:999999},".os-scrollbar, .os-scrollbar-corner":{position:"absolute",opacity:1,zIndex:1},".os-scrollbar-corner":{bottom:0,right:0,height:10,width:10,backgroundColor:"transparent"},".os-scrollbar":{pointerEvents:"none",padding:2,boxSizing:"border-box",background:0},".os-scrollbar-track":{pointerEvents:"auto",position:"relative",height:"100%",width:"100%",padding:"0!important",border:"0!important"},".os-scrollbar-handle":{pointerEvents:"auto",position:"absolute",width:"100%",height:"100%"},".os-scrollbar-handle-off, .os-scrollbar-track-off":{pointerEvents:"none"},".os-scrollbar.os-scrollbar-unusable, .os-scrollbar.os-scrollbar-unusable *":{pointerEvents:"none!important"},".os-scrollbar.os-scrollbar-unusable .os-scrollbar-handle":{opacity:"0!important"},".os-scrollbar-horizontal":{bottom:0,left:0,right:10,height:10},".os-scrollbar-vertical":{top:0,right:0,bottom:10,width:10},".os-host-rtl>.os-scrollbar-horizontal":{right:0},".os-host-rtl>.os-scrollbar-vertical":{right:"auto",left:0},".os-host-rtl>.os-scrollbar-corner":{right:"auto",left:0},".os-scrollbar-auto-hidden, .os-padding+.os-scrollbar-corner, .os-host-resize-disabled.os-host-scrollbar-horizontal-hidden>.os-scrollbar-corner, .os-host-scrollbar-horizontal-hidden>.os-scrollbar-horizontal, .os-host-resize-disabled.os-host-scrollbar-vertical-hidden>.os-scrollbar-corner, .os-host-scrollbar-vertical-hidden>.os-scrollbar-vertical, .os-scrollbar-horizontal.os-scrollbar-auto-hidden+.os-scrollbar-vertical+.os-scrollbar-corner, .os-scrollbar-horizontal+.os-scrollbar-vertical.os-scrollbar-auto-hidden+.os-scrollbar-corner, .os-scrollbar-horizontal.os-scrollbar-auto-hidden+.os-scrollbar-vertical.os-scrollbar-auto-hidden+.os-scrollbar-corner":{opacity:0,visibility:"hidden",pointerEvents:"none"},".os-scrollbar-corner-resize-both":{cursor:"nwse-resize"},".os-host-rtl>.os-scrollbar-corner-resize-both":{cursor:"nesw-resize"},".os-scrollbar-corner-resize-horizontal":{cursor:"ew-resize"},".os-scrollbar-corner-resize-vertical":{cursor:"ns-resize"},".os-dragging .os-scrollbar-corner.os-scrollbar-corner-resize":{cursor:"default"},".os-host-resize-disabled.os-host-scrollbar-horizontal-hidden>.os-scrollbar-vertical":{top:0,bottom:0},".os-host-resize-disabled.os-host-scrollbar-vertical-hidden>.os-scrollbar-horizontal, .os-host-rtl.os-host-resize-disabled.os-host-scrollbar-vertical-hidden>.os-scrollbar-horizontal":{right:0,left:0},".os-scrollbar:hover, .os-scrollbar-corner.os-scrollbar-corner-resize":{opacity:"1!important",visibility:"visible!important"},".os-scrollbar-corner.os-scrollbar-corner-resize":{backgroundImage:"linear-gradient(135deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 50%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.4) 100%)",backgroundRepeat:"no-repeat",backgroundPosition:"100% 100%",pointerEvents:"auto!important"},".os-host-rtl>.os-scrollbar-corner.os-scrollbar-corner-resize":{transform:"scale(-1,1)"},".os-host-overflow":{overflow:"hidden!important"},".os-theme-dark.os-host-rtl>.os-scrollbar-horizontal":{left:10,right:0},".os-scrollbar.os-scrollbar-unusable":{background:0},".os-scrollbar>.os-scrollbar-track":{background:0},".os-scrollbar-horizontal>.os-scrollbar-track>.os-scrollbar-handle":{minWidth:30},".os-scrollbar-vertical>.os-scrollbar-track>.os-scrollbar-handle":{minHeight:30},".os-theme-dark.os-host-transition>.os-scrollbar>.os-scrollbar-track>.os-scrollbar-handle":{transition:"background-color .3s"},".os-scrollbar>.os-scrollbar-track>.os-scrollbar-handle, .os-scrollbar>.os-scrollbar-track":{borderRadius:10},".os-scrollbar>.os-scrollbar-track>.os-scrollbar-handle":{background:theme.color.darker,opacity:.5},".os-scrollbar:hover>.os-scrollbar-track>.os-scrollbar-handle":{opacity:.6},".os-scrollbar-horizontal .os-scrollbar-handle:before, .os-scrollbar-vertical .os-scrollbar-handle:before":{content:"''",position:"absolute",left:0,right:0,top:0,bottom:0,display:"block"},".os-theme-dark.os-host-scrollbar-horizontal-hidden>.os-scrollbar-horizontal .os-scrollbar-handle:before, .os-theme-dark.os-host-scrollbar-vertical-hidden>.os-scrollbar-vertical .os-scrollbar-handle:before":{display:"none"},".os-scrollbar-horizontal .os-scrollbar-handle:before":{top:-6,bottom:-2},".os-scrollbar-vertical .os-scrollbar-handle:before":{left:-6,right:-2},".os-host-rtl.os-scrollbar-vertical .os-scrollbar-handle:before":{right:-6,left:-2}}},GlobalScrollAreaStyles=function GlobalScrollAreaStyles(){return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_storybook_theming__WEBPACK_IMPORTED_MODULE_1__.a,{styles:getScrollAreaStyles})};GlobalScrollAreaStyles.displayName="GlobalScrollAreaStyles",__webpack_exports__.default=GlobalScrollAreaStyles}}]); -------------------------------------------------------------------------------- /docs/8.0c32e96f86b87a58d415.manager.bundle.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[8],{855:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"OverlayScrollbarsComponent",(function(){return OverlayScrollbarsComponent}));__webpack_require__(7),__webpack_require__(27),__webpack_require__(21),__webpack_require__(66),__webpack_require__(14),__webpack_require__(454),__webpack_require__(18),__webpack_require__(85),__webpack_require__(39),__webpack_require__(84),__webpack_require__(74);var react__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(0),react__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_11__),overlayscrollbars__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(879),overlayscrollbars__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(overlayscrollbars__WEBPACK_IMPORTED_MODULE_12__);function _extends(){return(_extends=Object.assign||function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var OverlayScrollbarsComponent=function OverlayScrollbarsComponent(_ref){var _ref$options=_ref.options,options=void 0===_ref$options?{}:_ref$options,extensions=_ref.extensions,className=_ref.className,children=_ref.children,rest=_objectWithoutProperties(_ref,["options","extensions","className","children"]),osTargetRef=react__WEBPACK_IMPORTED_MODULE_11___default.a.useRef(),osInstance=react__WEBPACK_IMPORTED_MODULE_11___default.a.useRef();return react__WEBPACK_IMPORTED_MODULE_11___default.a.useEffect((function(){return osInstance.current=overlayscrollbars__WEBPACK_IMPORTED_MODULE_12___default()(osTargetRef.current,options,extensions),mergeHostClassNames(osInstance.current,className),function(){overlayscrollbars__WEBPACK_IMPORTED_MODULE_12___default.a.valid(osInstance.current)&&(osInstance.current.destroy(),osInstance.current=null)}}),[]),react__WEBPACK_IMPORTED_MODULE_11___default.a.useEffect((function(){overlayscrollbars__WEBPACK_IMPORTED_MODULE_12___default.a.valid(osInstance.current)&&osInstance.current.options(options)}),[options]),react__WEBPACK_IMPORTED_MODULE_11___default.a.useEffect((function(){overlayscrollbars__WEBPACK_IMPORTED_MODULE_12___default.a.valid(osInstance.current)&&mergeHostClassNames(osInstance.current,className)}),[className]),react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement("div",_extends({className:"os-host"},rest,{ref:osTargetRef}),react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement("div",{className:"os-resize-observer-host"}),react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement("div",{className:"os-padding"},react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement("div",{className:"os-viewport"},react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement("div",{className:"os-content"},children))),react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement("div",{className:"os-scrollbar os-scrollbar-horizontal "},react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement("div",{className:"os-scrollbar-track"},react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement("div",{className:"os-scrollbar-handle"}))),react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement("div",{className:"os-scrollbar os-scrollbar-vertical"},react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement("div",{className:"os-scrollbar-track"},react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement("div",{className:"os-scrollbar-handle"}))),react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement("div",{className:"os-scrollbar-corner"}))};function mergeHostClassNames(osInstance,className){if(overlayscrollbars__WEBPACK_IMPORTED_MODULE_12___default.a.valid(osInstance)){var host=osInstance.getElements().host,regex=new RegExp("(^os-host([-_].+|)$)|".concat(osInstance.options().className.replace(/\s/g,"$|"),"$"),"g"),osClassNames=host.className.split(" ").filter((function(name){return name.match(regex)})).join(" ");host.className="".concat(osClassNames," ").concat(className||"")}}OverlayScrollbarsComponent.displayName="OverlayScrollbarsComponent",__webpack_exports__.default=OverlayScrollbarsComponent}}]); -------------------------------------------------------------------------------- /docs/9.da52dd791e7234e0495a.manager.bundle.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[9],{857:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"ColorControl",(function(){return Color_ColorControl}));__webpack_require__(7),__webpack_require__(27),__webpack_require__(21),__webpack_require__(12),__webpack_require__(52),__webpack_require__(119),__webpack_require__(140),__webpack_require__(9),__webpack_require__(14),__webpack_require__(65),__webpack_require__(18),__webpack_require__(39),__webpack_require__(84),__webpack_require__(74),__webpack_require__(171);var react=__webpack_require__(0),react_default=__webpack_require__.n(react),index_module=__webpack_require__(934),color_convert=__webpack_require__(931),color_convert_default=__webpack_require__.n(color_convert),throttle=__webpack_require__(410),throttle_default=__webpack_require__.n(throttle),esm=__webpack_require__(1);__webpack_require__(43);function _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var Note=esm.styled.div((function(_ref){var theme=_ref.theme;return{padding:"2px 6px",lineHeight:"16px",fontSize:10,fontWeight:theme.typography.weight.bold,color:theme.color.lightest,boxShadow:"0 0 5px 0 rgba(0, 0, 0, 0.3)",borderRadius:4,whiteSpace:"nowrap",pointerEvents:"none",zIndex:-1,background:"rgba(0, 0, 0, 0.4)",margin:6}})),TooltipNote_TooltipNote=function TooltipNote(_ref2){var note=_ref2.note,props=_objectWithoutProperties(_ref2,["note"]);return react_default.a.createElement(Note,props,note)};TooltipNote_TooltipNote.displayName="TooltipNote";var _ColorPicker,_fallbackColor,lazy_WithTooltip=__webpack_require__(408),esm_form=__webpack_require__(82),icon=__webpack_require__(58);function _slicedToArray(arr,i){return function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function _iterableToArrayLimit(arr,i){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function _unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr,i)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var Wrapper=esm.styled.div({position:"relative",maxWidth:250}),PickerTooltip=Object(esm.styled)(lazy_WithTooltip.a)({position:"absolute",zIndex:1,top:4,left:4}),TooltipContent=esm.styled.div({width:200,margin:5,".react-colorful__saturation":{borderRadius:"4px 4px 0 0"},".react-colorful__hue":{boxShadow:"inset 0 0 0 1px rgb(0 0 0 / 5%)"},".react-colorful__last-control":{borderRadius:"0 0 4px 4px"}}),Color_Note=Object(esm.styled)(TooltipNote_TooltipNote)((function(_ref){return{fontFamily:_ref.theme.typography.fonts.base}})),Swatches=esm.styled.div({display:"grid",gridTemplateColumns:"repeat(9, 16px)",gap:6,padding:3,marginTop:5,width:200}),SwatchColor=esm.styled.div((function(_ref2){var theme=_ref2.theme;return{width:16,height:16,boxShadow:_ref2.active?"".concat(theme.appBorderColor," 0 0 0 1px inset, ").concat(theme.color.mediumdark,"50 0 0 0 4px"):"".concat(theme.appBorderColor," 0 0 0 1px inset"),borderRadius:theme.appBorderRadius}})),Color_Swatch=function Swatch(_ref3){var value=_ref3.value,active=_ref3.active,onClick=_ref3.onClick,style=_ref3.style,props=Color_objectWithoutProperties(_ref3,["value","active","onClick","style"]),backgroundImage="linear-gradient(".concat(value,", ").concat(value,"), ").concat('url(\'data:image/svg+xml;charset=utf-8,\')',", linear-gradient(#fff, #fff)");return react_default.a.createElement(SwatchColor,_extends({},props,{active:active,onClick:onClick,style:Object.assign({},style,{backgroundImage:backgroundImage})}))};Color_Swatch.displayName="Swatch";var ColorSpace,Input=Object(esm.styled)(esm_form.a.Input)((function(_ref4){return{width:"100%",paddingLeft:30,paddingRight:30,boxSizing:"border-box",fontFamily:_ref4.theme.typography.fonts.base}})),ToggleIcon=Object(esm.styled)(icon.a)((function(_ref5){return{position:"absolute",zIndex:1,top:6,right:7,width:20,height:20,padding:4,boxSizing:"border-box",cursor:"pointer",color:_ref5.theme.input.color}}));!function(ColorSpace){ColorSpace.RGB="rgb",ColorSpace.HSL="hsl",ColorSpace.HEX="hex"}(ColorSpace||(ColorSpace={}));var COLOR_SPACES=Object.values(ColorSpace),COLOR_REGEXP=/\(([0-9]+),\s*([0-9]+)%?,\s*([0-9]+)%?,?\s*([0-9.]+)?\)/,RGB_REGEXP=/^\s*rgba?\(([0-9]+),\s*([0-9]+),\s*([0-9]+),?\s*([0-9.]+)?\)\s*$/i,HSL_REGEXP=/^\s*hsla?\(([0-9]+),\s*([0-9]+)%,\s*([0-9]+)%,?\s*([0-9.]+)?\)\s*$/i,HEX_REGEXP=/^\s*#?([0-9a-f]{3}|[0-9a-f]{6})\s*$/i,SHORTHEX_REGEXP=/^\s*#?([0-9a-f]{3})\s*$/i,ColorPicker=(_defineProperty(_ColorPicker={},ColorSpace.HEX,index_module.a),_defineProperty(_ColorPicker,ColorSpace.RGB,index_module.c),_defineProperty(_ColorPicker,ColorSpace.HSL,index_module.b),_ColorPicker),fallbackColor=(_defineProperty(_fallbackColor={},ColorSpace.HEX,"transparent"),_defineProperty(_fallbackColor,ColorSpace.RGB,"rgba(0, 0, 0, 0)"),_defineProperty(_fallbackColor,ColorSpace.HSL,"hsla(0, 0%, 0%, 0)"),_fallbackColor),stringToArgs=function stringToArgs(value){var match=null==value?void 0:value.match(COLOR_REGEXP);if(!match)return[0,0,0,1];var _match=_slicedToArray(match,5),x=_match[1],y=_match[2],z=_match[3],_match$=_match[4];return[x,y,z,void 0===_match$?1:_match$].map(Number)},Color_parseValue=function parseValue(value){var _ref12;if(value){var valid=!0;if(RGB_REGEXP.test(value)){var _ref8,_stringToArgs2=_slicedToArray(stringToArgs(value),4),r=_stringToArgs2[0],g=_stringToArgs2[1],b=_stringToArgs2[2],a=_stringToArgs2[3],_ref7=_slicedToArray(color_convert_default.a.rgb.hsl([r,g,b])||[0,0,0],3),h=_ref7[0],s=_ref7[1],l=_ref7[2];return _defineProperty(_ref8={valid:valid,value:value,keyword:color_convert_default.a.rgb.keyword([r,g,b]),colorSpace:ColorSpace.RGB},ColorSpace.RGB,value),_defineProperty(_ref8,ColorSpace.HSL,"hsla(".concat(h,", ").concat(s,"%, ").concat(l,"%, ").concat(a,")")),_defineProperty(_ref8,ColorSpace.HEX,"#".concat(color_convert_default.a.rgb.hex([r,g,b]).toLowerCase())),_ref8}if(HSL_REGEXP.test(value)){var _ref11,_stringToArgs4=_slicedToArray(stringToArgs(value),4),_h=_stringToArgs4[0],_s2=_stringToArgs4[1],_l=_stringToArgs4[2],_a=_stringToArgs4[3],_ref10=_slicedToArray(color_convert_default.a.hsl.rgb([_h,_s2,_l])||[0,0,0],3),_r=_ref10[0],_g=_ref10[1],_b=_ref10[2];return _defineProperty(_ref11={valid:valid,value:value,keyword:color_convert_default.a.hsl.keyword([_h,_s2,_l]),colorSpace:ColorSpace.HSL},ColorSpace.RGB,"rgba(".concat(_r,", ").concat(_g,", ").concat(_b,", ").concat(_a,")")),_defineProperty(_ref11,ColorSpace.HSL,value),_defineProperty(_ref11,ColorSpace.HEX,"#".concat(color_convert_default.a.hsl.hex([_h,_s2,_l]).toLowerCase())),_ref11}var plain=value.replace("#",""),rgb=color_convert_default.a.keyword.rgb(plain)||color_convert_default.a.hex.rgb(plain),hsl=color_convert_default.a.rgb.hsl(rgb),mapped=value;if(/[^#a-f0-9]/i.test(value)?mapped=plain:HEX_REGEXP.test(value)&&(mapped="#".concat(plain)),mapped.startsWith("#"))valid=HEX_REGEXP.test(mapped);else try{color_convert_default.a.keyword.hex(mapped)}catch(e){valid=!1}return _defineProperty(_ref12={valid:valid,value:mapped,keyword:color_convert_default.a.rgb.keyword(rgb),colorSpace:ColorSpace.HEX},ColorSpace.RGB,"rgba(".concat(rgb[0],", ").concat(rgb[1],", ").concat(rgb[2],", 1)")),_defineProperty(_ref12,ColorSpace.HSL,"hsla(".concat(hsl[0],", ").concat(hsl[1],"%, ").concat(hsl[2],"%, 1)")),_defineProperty(_ref12,ColorSpace.HEX,mapped),_ref12}},Color_useColorInput=function useColorInput(initialValue,onChange){var _useState2=_slicedToArray(Object(react.useState)(initialValue||""),2),value=_useState2[0],setValue=_useState2[1],_useState4=_slicedToArray(Object(react.useState)((function(){return Color_parseValue(value)})),2),color=_useState4[0],setColor=_useState4[1],_useState6=_slicedToArray(Object(react.useState)((null==color?void 0:color.colorSpace)||ColorSpace.HEX),2),colorSpace=_useState6[0],setColorSpace=_useState6[1],realValue=Object(react.useMemo)((function(){return function getRealValue(value,color,colorSpace){if(!value||null==color||!color.valid)return fallbackColor[colorSpace];if(colorSpace!==ColorSpace.HEX)return(null==color?void 0:color[colorSpace])||fallbackColor[colorSpace];if(!color.hex.startsWith("#"))try{return"#".concat(color_convert_default.a.keyword.hex(color.hex))}catch(e){return fallbackColor.hex}var short=color.hex.match(SHORTHEX_REGEXP);if(!short)return HEX_REGEXP.test(color.hex)?color.hex:fallbackColor.hex;var _short$1$split2=_slicedToArray(short[1].split(""),3),r=_short$1$split2[0],g=_short$1$split2[1],b=_short$1$split2[2];return"#".concat(r).concat(r).concat(g).concat(g).concat(b).concat(b)}(value,color,colorSpace).toLowerCase()}),[value,color,colorSpace]),updateValue=Object(react.useCallback)((function(update){var parsed=Color_parseValue(update);setValue((null==parsed?void 0:parsed.value)||update||""),parsed&&(setColor(parsed),setColorSpace(parsed.colorSpace),onChange(parsed.value))}),[onChange]),cycleColorSpace=Object(react.useCallback)((function(){var next=COLOR_SPACES.indexOf(colorSpace)+1;next>=COLOR_SPACES.length&&(next=0),setColorSpace(COLOR_SPACES[next]);var update=(null==color?void 0:color[COLOR_SPACES[next]])||"";setValue(update),onChange(update)}),[color,colorSpace,onChange]);return{value:value,realValue:realValue,updateValue:updateValue,color:color,colorSpace:colorSpace,cycleColorSpace:cycleColorSpace}},id=function id(value){return value.replace(/\s*/,"").toLowerCase()},Color_ColorControl=function ColorControl(_ref13){var initialValue=_ref13.value,onChange=_ref13.onChange,onFocus=_ref13.onFocus,onBlur=_ref13.onBlur,presetColors=_ref13.presetColors,startOpen=_ref13.startOpen,_useColorInput=Color_useColorInput(initialValue,throttle_default()(onChange,200)),value=_useColorInput.value,realValue=_useColorInput.realValue,updateValue=_useColorInput.updateValue,color=_useColorInput.color,colorSpace=_useColorInput.colorSpace,cycleColorSpace=_useColorInput.cycleColorSpace,_usePresets=function usePresets(presetColors,currentColor,colorSpace){var _useState8=_slicedToArray(Object(react.useState)(null!=currentColor&¤tColor.valid?[currentColor]:[]),2),selectedColors=_useState8[0],setSelectedColors=_useState8[1],presets=Object(react.useMemo)((function(){return(presetColors||[]).map((function(preset){return"string"==typeof preset?Color_parseValue(preset):preset.title?Object.assign({},Color_parseValue(preset.color),{keyword:preset.title}):Color_parseValue(preset.color)})).concat(selectedColors).filter(Boolean).slice(-27)}),[presetColors,selectedColors]),addPreset=Object(react.useCallback)((function(color){null!=color&&color.valid&&(presets.some((function(preset){return id(preset[colorSpace])===id(color[colorSpace])}))||setSelectedColors((function(arr){return arr.concat(color)})))}),[colorSpace,presets]);return{presets:presets,addPreset:addPreset}}(presetColors,color,colorSpace),presets=_usePresets.presets,addPreset=_usePresets.addPreset,Picker=ColorPicker[colorSpace];return react_default.a.createElement(Wrapper,null,react_default.a.createElement(PickerTooltip,{trigger:"click",startOpen:startOpen,closeOnClick:!0,onVisibilityChange:function onVisibilityChange(){return addPreset(color)},tooltip:react_default.a.createElement(TooltipContent,null,react_default.a.createElement(Picker,{color:"transparent"===realValue?"#000000":realValue,onChange:updateValue,onFocus:onFocus,onBlur:onBlur}),presets.length>0&&react_default.a.createElement(Swatches,null,presets.map((function(preset){return react_default.a.createElement(lazy_WithTooltip.a,{key:preset.value,hasChrome:!1,tooltip:react_default.a.createElement(Color_Note,{note:preset.keyword||preset.value})},react_default.a.createElement(Color_Swatch,{value:preset[colorSpace],active:color&&id(preset[colorSpace])===id(color[colorSpace]),onClick:function onClick(){return updateValue(preset.value)}}))}))))},react_default.a.createElement(Color_Swatch,{value:realValue,style:{margin:4}})),react_default.a.createElement(Input,{value:value,onChange:function onChange(e){return updateValue(e.target.value)},onFocus:function onFocus(e){return e.target.select()},placeholder:"Choose color"}),react_default.a.createElement(ToggleIcon,{icon:"markup",onClick:cycleColorSpace}))};Color_ColorControl.displayName="ColorControl";__webpack_exports__.default=Color_ColorControl}}]); -------------------------------------------------------------------------------- /docs/asset-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": { 3 | "0.97dc7c88.iframe.bundle.js": "./0.97dc7c88.iframe.bundle.js", 4 | "main.js": "./main.c7f46bdf.iframe.bundle.js", 5 | "runtime~main.js": "./runtime~main.806b4e7e.iframe.bundle.js", 6 | "vendors~main.js": "./vendors~main.2b0e6e48.iframe.bundle.js", 7 | "vendors~main.js.map": "./vendors~main.2b0e6e48.iframe.bundle.js.map", 8 | "4.9a151b1b.iframe.bundle.js": "./4.9a151b1b.iframe.bundle.js", 9 | "4.9a151b1b.iframe.bundle.js.map": "./4.9a151b1b.iframe.bundle.js.map", 10 | "5.c9d755ea.iframe.bundle.js": "./5.c9d755ea.iframe.bundle.js", 11 | "6.f7f9ab19.iframe.bundle.js": "./6.f7f9ab19.iframe.bundle.js", 12 | "6.f7f9ab19.iframe.bundle.js.map": "./6.f7f9ab19.iframe.bundle.js.map", 13 | "7.7766ae9b.iframe.bundle.js": "./7.7766ae9b.iframe.bundle.js", 14 | "4.9a151b1b.iframe.bundle.js.LICENSE.txt": "./4.9a151b1b.iframe.bundle.js.LICENSE.txt", 15 | "6.f7f9ab19.iframe.bundle.js.LICENSE.txt": "./6.f7f9ab19.iframe.bundle.js.LICENSE.txt", 16 | "iframe.html": "./iframe.html", 17 | "vendors~main.2b0e6e48.iframe.bundle.js.LICENSE.txt": "./vendors~main.2b0e6e48.iframe.bundle.js.LICENSE.txt" 18 | }, 19 | "entrypoints": [ 20 | "runtime~main.806b4e7e.iframe.bundle.js", 21 | "vendors~main.2b0e6e48.iframe.bundle.js", 22 | "main.c7f46bdf.iframe.bundle.js" 23 | ] 24 | } -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Optum/jsonschema-editor-react/cb1dd7c1e247232f14505d2ddf2dcfc5b203fa5e/docs/favicon.ico -------------------------------------------------------------------------------- /docs/iframe.html: -------------------------------------------------------------------------------- 1 | Storybook

No Preview

Sorry, but you either have no stories or none are selected somehow.

  • Please check the Storybook config.
  • Try reloading the page.

If the problem persists, check the browser console, or the terminal you've run Storybook from.

-------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | Storybook
-------------------------------------------------------------------------------- /docs/runtime~main.335986b66fb5bcf65138.manager.bundle.js: -------------------------------------------------------------------------------- 1 | !function(modules){function webpackJsonpCallback(data){for(var moduleId,chunkId,chunkIds=data[0],moreModules=data[1],executeModules=data[2],i=0,resolves=[];i 40 | * 41 | * Copyright (c) 2014-2017, Jon Schlinkert. 42 | * Released under the MIT License. 43 | */ 44 | 45 | /** @license React v0.19.1 46 | * scheduler.production.min.js 47 | * 48 | * Copyright (c) Facebook, Inc. and its affiliates. 49 | * 50 | * This source code is licensed under the MIT license found in the 51 | * LICENSE file in the root directory of this source tree. 52 | */ 53 | 54 | /** @license React v16.13.1 55 | * react-is.production.min.js 56 | * 57 | * Copyright (c) Facebook, Inc. and its affiliates. 58 | * 59 | * This source code is licensed under the MIT license found in the 60 | * LICENSE file in the root directory of this source tree. 61 | */ 62 | 63 | /** @license React v16.14.0 64 | * react-dom.production.min.js 65 | * 66 | * Copyright (c) Facebook, Inc. and its affiliates. 67 | * 68 | * This source code is licensed under the MIT license found in the 69 | * LICENSE file in the root directory of this source tree. 70 | */ 71 | 72 | /** @license React v16.14.0 73 | * react.production.min.js 74 | * 75 | * Copyright (c) Facebook, Inc. and its affiliates. 76 | * 77 | * This source code is licensed under the MIT license found in the 78 | * LICENSE file in the root directory of this source tree. 79 | */ 80 | 81 | /** @license React v17.0.1 82 | * react-is.production.min.js 83 | * 84 | * Copyright (c) Facebook, Inc. and its affiliates. 85 | * 86 | * This source code is licensed under the MIT license found in the 87 | * LICENSE file in the root directory of this source tree. 88 | */ 89 | -------------------------------------------------------------------------------- /docs/vendors~main.2b0e6e48.iframe.bundle.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | object-assign 3 | (c) Sindre Sorhus 4 | @license MIT 5 | */ 6 | 7 | /*! 8 | * The buffer module from node.js, for the browser. 9 | * 10 | * @author Feross Aboukhadijeh 11 | * @license MIT 12 | */ 13 | 14 | /*! 15 | * https://github.com/es-shims/es5-shim 16 | * @license es5-shim Copyright 2009-2020 by contributors, MIT License 17 | * see https://github.com/es-shims/es5-shim/blob/master/LICENSE 18 | */ 19 | 20 | /*! 21 | * https://github.com/paulmillr/es6-shim 22 | * @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com) 23 | * and contributors, MIT License 24 | * es6-shim: v0.35.4 25 | * see https://github.com/paulmillr/es6-shim/blob/0.35.3/LICENSE 26 | * Details and documentation: 27 | * https://github.com/paulmillr/es6-shim/ 28 | */ 29 | 30 | /*! 31 | * is-plain-object 32 | * 33 | * Copyright (c) 2014-2017, Jon Schlinkert. 34 | * Released under the MIT License. 35 | */ 36 | 37 | /*! 38 | * isobject 39 | * 40 | * Copyright (c) 2014-2017, Jon Schlinkert. 41 | * Released under the MIT License. 42 | */ 43 | 44 | /*! ***************************************************************************** 45 | Copyright (c) Microsoft Corporation. 46 | 47 | Permission to use, copy, modify, and/or distribute this software for any 48 | purpose with or without fee is hereby granted. 49 | 50 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 51 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 52 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 53 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 54 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 55 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 56 | PERFORMANCE OF THIS SOFTWARE. 57 | ***************************************************************************** */ 58 | 59 | /** @license React v0.20.2 60 | * scheduler.production.min.js 61 | * 62 | * Copyright (c) Facebook, Inc. and its affiliates. 63 | * 64 | * This source code is licensed under the MIT license found in the 65 | * LICENSE file in the root directory of this source tree. 66 | */ 67 | 68 | /** @license React v16.13.1 69 | * react-is.production.min.js 70 | * 71 | * Copyright (c) Facebook, Inc. and its affiliates. 72 | * 73 | * This source code is licensed under the MIT license found in the 74 | * LICENSE file in the root directory of this source tree. 75 | */ 76 | 77 | /** @license React v17.0.2 78 | * react-dom.production.min.js 79 | * 80 | * Copyright (c) Facebook, Inc. and its affiliates. 81 | * 82 | * This source code is licensed under the MIT license found in the 83 | * LICENSE file in the root directory of this source tree. 84 | */ 85 | 86 | /** @license React v17.0.2 87 | * react-jsx-runtime.production.min.js 88 | * 89 | * Copyright (c) Facebook, Inc. and its affiliates. 90 | * 91 | * This source code is licensed under the MIT license found in the 92 | * LICENSE file in the root directory of this source tree. 93 | */ 94 | 95 | /** @license React v17.0.2 96 | * react.production.min.js 97 | * 98 | * Copyright (c) Facebook, Inc. and its affiliates. 99 | * 100 | * This source code is licensed under the MIT license found in the 101 | * LICENSE file in the root directory of this source tree. 102 | */ 103 | 104 | /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ 105 | 106 | //! stable.js 0.1.8, https://github.com/Two-Screen/stable 107 | 108 | //! © 2018 Angry Bytes and contributors. MIT licensed. 109 | -------------------------------------------------------------------------------- /docs/vendors~main.2b0e6e48.iframe.bundle.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vendors~main.2b0e6e48.iframe.bundle.js","sources":[],"mappings":";A","sourceRoot":""} -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@optum/json-schema-editor", 3 | "version": "2.1.0", 4 | "description": "JsonSchema Editor React Control", 5 | "repository": "https://github.com/optum/jsonschema-editor-react", 6 | "license": "Apache 2.0", 7 | "engines": { 8 | "node": ">=10.18.0 <11 || >=12.14.0 <13 || >=13.5.0" 9 | }, 10 | "source": "src/index.ts", 11 | "publishConfig": { 12 | "access": "public", 13 | "registry": "https://registry.npmjs.org" 14 | }, 15 | "main": "dist/index.js", 16 | "files": [ 17 | "dist" 18 | ], 19 | "keywords": [ 20 | "react" 21 | ], 22 | "scripts": { 23 | "start": "react-scripts start", 24 | "build": "microbundle --jsx React.createElement", 25 | "test": "react-scripts test", 26 | "eject": "react-scripts eject", 27 | "storybook": "rimraf docs && start-storybook -p 6006 -s docs", 28 | "build-storybook": "rimraf docs && build-storybook --docs -o docs" 29 | }, 30 | "eslintConfig": { 31 | "extends": "react-app", 32 | "overrides": [ 33 | { 34 | "files": [ 35 | "**/*.stories.*" 36 | ], 37 | "rules": { 38 | "import/no-anonymous-default-export": "off" 39 | } 40 | } 41 | ] 42 | }, 43 | "browserslist": { 44 | "production": [ 45 | ">0.2%", 46 | "not dead", 47 | "not op_mini all" 48 | ], 49 | "development": [ 50 | "last 1 chrome version", 51 | "last 1 firefox version", 52 | "last 1 safari version" 53 | ] 54 | }, 55 | "dependencies": { 56 | "@chakra-ui/react": "1.6.0", 57 | "@emotion/react": "^11.0.0", 58 | "@emotion/styled": "^11.0.0", 59 | "@hookstate/core": "^3.0.7", 60 | "framer-motion": "^4.0.0", 61 | "ramda": "^0.27.1", 62 | "react-icons": "^3.0.0", 63 | "typescript": "^3.9.5", 64 | "use-debounce": "^6.0.1", 65 | "web-vitals": "^0.2.2" 66 | }, 67 | "peerDependencies": { 68 | "react": "^17.0.1", 69 | "react-dom": "^17.0.1" 70 | }, 71 | "devDependencies": { 72 | "@storybook/addon-actions": "^6.2.9", 73 | "@storybook/addon-console": "^1.2.3", 74 | "@storybook/addon-essentials": "^6.2.9", 75 | "@storybook/addon-links": "^6.2.9", 76 | "@storybook/node-logger": "^6.2.9", 77 | "@storybook/preset-create-react-app": "^3.1.7", 78 | "@storybook/react": "^6.2.9", 79 | "@testing-library/jest-dom": "^5.9.0", 80 | "@testing-library/react": "^10.2.1", 81 | "@testing-library/user-event": "^12.0.2", 82 | "@types/jest": "^25.0.0", 83 | "@types/node": "^12.0.0", 84 | "@types/ramda": "^0.27.40", 85 | "@types/react": "^16.0.0", 86 | "@types/react-dom": "^16.0.0", 87 | "microbundle": "^0.13.1", 88 | "react": "^17.0.1", 89 | "react-dom": "^17.0.1", 90 | "react-scripts": "4.0.3" 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 |

2 | json-schema-editor - A React Component 3 |

4 | 5 |

6 | ➕ 7 | ➕ 8 | ➕ 9 | 10 |

11 | 12 | ## Description 13 | 14 | > JSON Schema is hypermedia ready, and ideal for annotating your existing JSON-based HTTP API. JSON Schema documents are identified by URIs, which can be used in HTTP Link headers, and inside JSON Schema documents to allow recursive definitions. - [json-schema.org](https://json-schema.org/) 15 | 16 | JsonSchemaEditor is a React component library that allows the easy generation of valid `Draft 07` JsonSchema from a UI, so that it can be easily persisted in a schema management system. 17 | 18 | Benefits include: 19 | 20 | - Describes your existing data format(s). 21 | - Provides clear human- and machine- readable - documentation. 22 | - Validates data which is useful for: 23 | - Automated testing. 24 | - Ensuring quality of client submitted data. 25 | 26 | ## Documentation 27 | 28 | Control documentation and demo can be viewed [here](https://optum.github.io/jsonschema-editor-react/) 29 | 30 | ## Install 31 | 32 | ```shell 33 | npm install @optum/json-schema-editor 34 | ``` 35 | 36 | or 37 | 38 | ```shell 39 | yarn add @optum/json-schema-editor 40 | ``` 41 | 42 | ## Props 43 | 44 | | property | type | description | default | 45 | | -------------- | ---------------------------------- | -------------------------------------------- | --------------------- | 46 | | data | object | the initial data for the editor | {} | 47 | | readOnly | boolean | make editor read only | false | 48 | | onSchemaChange | callback (results: string) => void | callback method to capture changes to schema | required (no default) | 49 | 50 | ## Usage 51 | 52 | ```js 53 | import JsonSchemaEditor from "@optum/json-schema-editor"; 54 | 55 | export const printIt = (schema) => { 56 | console.log(schema); 57 | }; 58 | 59 | function App() { 60 | return ( 61 |
62 | 63 |
64 | ); 65 | } 66 | 67 | export default App; 68 | ``` 69 | 70 | ## License 71 | 72 | jsonchema-editor-react is Copyright © 2021 Optum. It is free software and may be redistributed under the Apache 2.0 license. 73 | 74 | ## Development 75 | 76 | ### Commands 77 | 78 | > Run storybook 79 | 80 | ```shell 81 | npm run storybook 82 | ``` 83 | 84 | > Create docs and build for release 85 | 86 | ```shell 87 | npm run build-storybook 88 | ``` 89 | 90 | > Run tests locally 91 | 92 | ```shell 93 | npm test 94 | ``` 95 | 96 | > Build dist 97 | 98 | ```shell 99 | npm run build 100 | ``` 101 | -------------------------------------------------------------------------------- /src/JsonSchemaEditor.test.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { render } from "@testing-library/react"; 3 | 4 | import JsonSchemaEditor from "."; 5 | import { SchemaEditorProps } from "./JsonSchemaEditor.types"; 6 | 7 | const printIt = (schema: string) => { 8 | console.log(schema); 9 | }; 10 | 11 | describe("JsonSchemaEditor", () => { 12 | let props: SchemaEditorProps; 13 | 14 | beforeEach(() => { 15 | props = { 16 | onSchemaChange: printIt, 17 | }; 18 | }); 19 | 20 | const renderComponent = () => render(); 21 | 22 | it("should have primary className with default props", () => { 23 | renderComponent(); 24 | 25 | const { container } = renderComponent(); 26 | 27 | // const testComponent = getByTestId("jsonschema-editor"); 28 | console.log(container.innerHTML); 29 | 30 | // expect(testComponent).toHaveClass("test-component-primary"); 31 | 32 | // console.log(result.asFragment.toString); 33 | // // expect(screen.getByText("root")).toBeInTheDocument(); 34 | // expect(true).toBe(true); 35 | }); 36 | }); 37 | 38 | // test("renders learn react link", () => { 39 | // render( {}} />); 40 | // const linkElement = screen.getByText(/learn chakra/i); 41 | // expect(linkElement).toBeInTheDocument(); 42 | // }); 43 | -------------------------------------------------------------------------------- /src/JsonSchemaEditor.types.ts: -------------------------------------------------------------------------------- 1 | import { State } from "@hookstate/core"; 2 | 3 | export interface SchemaEditorProps { 4 | /** 5 | * Text component 6 | */ 7 | data?: JSONSchema7 | undefined; 8 | onSchemaChange: (results: string) => void; 9 | readOnly?: boolean; 10 | } 11 | 12 | export type Schema2 = { 13 | jsonSchema: JSONSchema7; 14 | isValidSchema?: boolean; 15 | errorMessage?: string; 16 | isReadOnly: boolean; 17 | fieldId: number; 18 | }; 19 | export interface AdvancedItemStateProps { 20 | itemStateProp: State; 21 | } 22 | 23 | //================================================================================================== 24 | // JSON Schema Draft 07 25 | //================================================================================================== 26 | // https://tools.ietf.org/html/draft-handrews-json-schema-validation-01 27 | //-------------------------------------------------------------------------------------------------- 28 | 29 | /** 30 | * Primitive type 31 | * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1 32 | */ 33 | export type JSONSchema7TypeName = 34 | | "string" // 35 | | "number" 36 | | "integer" 37 | | "boolean" 38 | | "object" 39 | | "array" 40 | | "null"; 41 | 42 | /** 43 | * Primitive type 44 | * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1 45 | */ 46 | export type JSONSchema7Type = 47 | | string // 48 | | number 49 | | boolean 50 | | JSONSchema7Object 51 | | JSONSchema7Array 52 | | null; 53 | 54 | // Workaround for infinite type recursion 55 | export interface JSONSchema7Object { 56 | [key: string]: JSONSchema7Type; 57 | } 58 | 59 | // Workaround for infinite type recursion 60 | // https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540 61 | export interface JSONSchema7Array extends Array {} 62 | 63 | /** 64 | * Meta schema 65 | * 66 | * Recommended values: 67 | * - 'http://json-schema.org/schema#' 68 | * - 'http://json-schema.org/hyper-schema#' 69 | * - 'http://json-schema.org/draft-07/schema#' 70 | * - 'http://json-schema.org/draft-07/hyper-schema#' 71 | * 72 | * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 73 | */ 74 | export type JSONSchema7Version = string; 75 | 76 | /** 77 | * JSON Schema v7 78 | * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01 79 | */ 80 | export type JSONSchema7Definition = JSONSchema7 | boolean; 81 | export interface JSONSchema7 { 82 | $id?: string; 83 | $ref?: string; 84 | $schema?: JSONSchema7Version; 85 | $comment?: string; 86 | 87 | /** 88 | * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1 89 | */ 90 | type?: JSONSchema7TypeName | JSONSchema7TypeName[]; 91 | enum?: JSONSchema7Type[]; 92 | const?: JSONSchema7Type; 93 | 94 | /** 95 | * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2 96 | */ 97 | multipleOf?: number; 98 | maximum?: number; 99 | exclusiveMaximum?: number; 100 | minimum?: number; 101 | exclusiveMinimum?: number; 102 | 103 | /** 104 | * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3 105 | */ 106 | maxLength?: number; 107 | minLength?: number; 108 | pattern?: string; 109 | 110 | /** 111 | * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4 112 | */ 113 | items?: JSONSchema7Definition | JSONSchema7Definition[]; 114 | additionalItems?: JSONSchema7Definition; 115 | maxItems?: number; 116 | minItems?: number; 117 | uniqueItems?: boolean; 118 | contains?: JSONSchema7; 119 | 120 | /** 121 | * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5 122 | */ 123 | maxProperties?: number; 124 | minProperties?: number; 125 | required?: string[]; 126 | properties?: { 127 | [key: string]: JSONSchema7Definition; 128 | }; 129 | patternProperties?: { 130 | [key: string]: JSONSchema7Definition; 131 | }; 132 | additionalProperties?: JSONSchema7Definition; 133 | dependencies?: { 134 | [key: string]: JSONSchema7Definition | string[]; 135 | }; 136 | propertyNames?: JSONSchema7Definition; 137 | 138 | /** 139 | * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6 140 | */ 141 | if?: JSONSchema7Definition; 142 | then?: JSONSchema7Definition; 143 | else?: JSONSchema7Definition; 144 | 145 | /** 146 | * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7 147 | */ 148 | allOf?: JSONSchema7Definition[]; 149 | anyOf?: JSONSchema7Definition[]; 150 | oneOf?: JSONSchema7Definition[]; 151 | not?: JSONSchema7Definition; 152 | 153 | /** 154 | * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7 155 | */ 156 | format?: string; 157 | 158 | /** 159 | * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8 160 | */ 161 | contentMediaType?: string; 162 | contentEncoding?: string; 163 | 164 | /** 165 | * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9 166 | */ 167 | definitions?: { 168 | [key: string]: JSONSchema7Definition; 169 | }; 170 | 171 | /** 172 | * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10 173 | */ 174 | title?: string; 175 | description?: string; 176 | default?: JSONSchema7Type; 177 | readOnly?: boolean; 178 | writeOnly?: boolean; 179 | examples?: JSONSchema7Type; 180 | } 181 | -------------------------------------------------------------------------------- /src/JsonSchemaEditor/JsonSchemaEditor.scss: -------------------------------------------------------------------------------- 1 | @import "../variables.scss"; 2 | @import "../typography.scss"; 3 | 4 | .test-component { 5 | background-color: $harvey-white; 6 | border: 1px solid $harvey-black; 7 | padding: 16px; 8 | width: 360px; 9 | text-align: center; 10 | 11 | .heading { 12 | @include heading; 13 | } 14 | 15 | &.test-component-secondary { 16 | background-color: $harvey-black; 17 | color: $harvey-white; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/JsonSchemaEditor/JsonSchemaEditor.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { useState } from "@hookstate/core"; 3 | import { useSchemaState, defaultSchema } from "./state"; 4 | import { SchemaEditorProps } from "../JsonSchemaEditor.types"; 5 | import { Flex, ChakraProvider, theme } from "@chakra-ui/react"; 6 | 7 | import { SchemaRoot } from "./schema-root"; 8 | import { Whoops } from "./whoops"; 9 | import { SchemaObject } from "./schema-object"; 10 | import { SchemaArray } from "./schema-array"; 11 | 12 | export * from "../JsonSchemaEditor.types"; 13 | 14 | export const JsonSchemaEditor = (props: SchemaEditorProps) => { 15 | const { onSchemaChange, readOnly, data } = props; 16 | 17 | const schemaState = useSchemaState({ 18 | jsonSchema: data ?? defaultSchema(), 19 | isReadOnly: readOnly ?? false, 20 | fieldId: 0, 21 | }); 22 | 23 | const jsonSchemaState = useState(schemaState.jsonSchema); 24 | 25 | return ( 26 | 27 | {schemaState.isValidSchema ? ( 28 | 29 | 34 | 35 | {jsonSchemaState.type.value === "object" && ( 36 | 40 | )} 41 | 42 | {jsonSchemaState.type.value === "array" && ( 43 | 47 | )} 48 | 49 | ) : ( 50 | 51 | 52 | 53 | )} 54 | {/* 60 | 61 | 62 | Advanced Schema Settings 63 | 64 | 65 | 66 | 67 | 68 | 69 | 77 | 78 | 79 | */} 80 | 81 | ); 82 | }; 83 | -------------------------------------------------------------------------------- /src/JsonSchemaEditor/advanced-boolean/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { Flex, FormLabel, Stack, Select } from "@chakra-ui/react"; 3 | 4 | import { AdvancedItemStateProps } from "../../JsonSchemaEditor.types"; 5 | import { useState } from "@hookstate/core"; 6 | 7 | export const AdvancedBoolean: React.FunctionComponent = ( 8 | props: React.PropsWithChildren 9 | ) => { 10 | const { itemStateProp } = props; 11 | 12 | const item = useState(itemStateProp); 13 | 14 | return ( 15 | 16 | 23 | 24 | Default:{" "} 25 | 26 | 43 | 44 | 45 | ); 46 | }; 47 | -------------------------------------------------------------------------------- /src/JsonSchemaEditor/advanced-number/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { 3 | Flex, 4 | FormLabel, 5 | Stack, 6 | NumberInput, 7 | NumberInputField, 8 | NumberInputStepper, 9 | NumberIncrementStepper, 10 | NumberDecrementStepper, 11 | Checkbox, 12 | Textarea, 13 | } from "@chakra-ui/react"; 14 | 15 | import { 16 | AdvancedItemStateProps, 17 | JSONSchema7, 18 | } from "../../JsonSchemaEditor.types"; 19 | import { none, useState } from "@hookstate/core"; 20 | 21 | export const AdvancedNumber: React.FunctionComponent = ( 22 | props: React.PropsWithChildren 23 | ) => { 24 | const { itemStateProp } = props; 25 | 26 | const changeEnumOtherValue = (value: string): string[] | null => { 27 | const array = value.split("\n"); 28 | if (array.length === 0 || (array.length === 1 && !array[0])) { 29 | return null; 30 | } 31 | 32 | return array; 33 | }; 34 | 35 | const itemState = useState(itemStateProp); 36 | 37 | const isEnumChecked = (itemState.value as JSONSchema7).enum !== undefined; 38 | const enumData = (itemState.value as JSONSchema7).enum 39 | ? (itemState.enum.value as string[]) 40 | : []; 41 | const enumValue = enumData?.join("\n"); 42 | 43 | return ( 44 | 45 | 52 | Default: 53 | 54 | { 59 | itemState.default.set(Number(value)); 60 | }} 61 | > 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 77 | Min Value: 78 | { 82 | itemState.minimum.set(Number(value)); 83 | }} 84 | > 85 | 86 | 87 | 88 | 89 | 90 | 91 | Max Value: 92 | { 96 | itemState.maximum.set(Number(value)); 97 | }} 98 | > 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 113 | Enum: 114 | ) => { 117 | if (!evt.target.checked) { 118 | itemState.enum.set(none); 119 | } else { 120 | itemState.enum.set(Array()); 121 | } 122 | }} 123 | /> 124 |