Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

Initial commit

Akshay Agrawald0e3d8a6ba19
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml
new file mode 100644
index 0000000000..abf28e65dd
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yaml
@@ -0,0 +1,32 @@
+name: "🐞 Bug report"
+description: Report an issue with marimo
+labels: [pending triage, bug]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thank you for filing this bug report and helping us improve marimo!
+ - type: textarea
+ id: bug-description
+ attributes:
+ label: Describe the bug
+ description: |
+ A clear and concise description of the bug. If you have a workaround or plan to submit a PR for this issue, please let us know.
+ You may also include a stack trace or screenshots here.
+ placeholder: What happened?
+ validations:
+ required: true
+ - type: input
+ id: version
+ attributes:
+ label: Version
+ description: Please provide the version of marimo you are using.
+ placeholder: pip show marimo
+ validations:
+ required: true
+ - type: textarea
+ id: reproduction-code
+ attributes:
+ label: Code to reproduce
+ description: If possible, paste a minimal reproducible example or link to a repository that reproduces the issue.
+ placeholder: import marimo
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000000..2cd189dc94
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,8 @@
+blank_issues_enabled: false
+contact_links:
+ - name: Discord Chat
+ url: https://discord.gg/JE7nhX6mD8
+ about: Ask questions and discuss with other marimo users.
+ - name: Questions & Discussions
+ url: https://github.com/marimo-team/marimo/discussions
+ about: Use GitHub discussions for message-board style questions and discussions.
diff --git a/.github/ISSUE_TEMPLATE/documentation.yaml b/.github/ISSUE_TEMPLATE/documentation.yaml
new file mode 100644
index 0000000000..2a5f24d2f8
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/documentation.yaml
@@ -0,0 +1,30 @@
+name: "📚 Documentation"
+description: Suggest a change or new page to be added to docs.marimo.io
+labels: [documentation]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thank you for taking the time to fill out this issue!
+ - type: checkboxes
+ id: documentation_is
+ attributes:
+ label: Documentation is
+ options:
+ - label: Missing
+ - label: Outdated
+ - label: Confusing
+ - label: Not sure?
+ - type: textarea
+ id: description
+ attributes:
+ label: Explain in Detail
+ description: A clear and concise description of your suggestion. If you intend to submit a PR for this issue, tell us in the description. Thanks!
+ validations:
+ required: true
+ - type: textarea
+ id: suggestion
+ attributes:
+ label: Your Suggestion for Changes
+ validations:
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml
new file mode 100644
index 0000000000..3db61d6e3c
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yaml
@@ -0,0 +1,32 @@
+name: "🚀 New feature proposal"
+description: Propose a new feature to be added to marimo
+labels: ["enhancement: pending triage"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for your interest in marimo and sharing what features you would like to see!
+ - type: textarea
+ id: feature-description
+ attributes:
+ label: Description
+ description: "Clear and concise description of the problem. Please make the reason and usecases as detailed as possible. If you intend to submit a PR for this issue, tell us in the description. Thanks!"
+ placeholder: I am hoping to be able to...
+ validations:
+ required: true
+ - type: textarea
+ id: suggested-solution
+ attributes:
+ label: Suggested solution
+ validations:
+ required: true
+ - type: textarea
+ id: alternative
+ attributes:
+ label: Alternative
+ description: "Clear and concise description of any alternative solutions or features you've considered."
+ - type: textarea
+ id: additional-context
+ attributes:
+ label: Additional context
+ description: Any other context or screenshots about the feature request here.
diff --git a/.github/renovate.json b/.github/renovate.json
new file mode 100644
index 0000000000..598b79de22
--- /dev/null
+++ b/.github/renovate.json
@@ -0,0 +1,48 @@
+{
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
+ "extends": ["config:base", "schedule:weekly"],
+ "labels": ["dependencies"],
+ "pin": false,
+ "rangeStrategy": "bump",
+ "python": {
+ "enabled": false
+ },
+ "pep621": {
+ "enabled": false
+ },
+ "packageRules": [
+ {
+ "depTypeList": ["peerDependencies"],
+ "enabled": false
+ },
+ {
+ "packageNames": ["node"],
+ "enabled": false
+ },
+ {
+ "matchUpdateTypes": ["minor", "patch"],
+ "groupName": "all non-major dependencies",
+ "groupSlug": "all-minor-patch",
+ "excludePackagePatterns": [".*eslint.*", ".*radix.*", ".*storybook.*"],
+ "excludePackageNames": ["typescript", "partysocket"]
+ },
+ {
+ "packagePatterns": [".*radix.*"],
+ "groupName": "all radix dependencies",
+ "groupSlug": "all-radix",
+ "matchUpdateTypes": ["minor", "patch", "major"]
+ },
+ {
+ "packagePatterns": [".*storybook.*"],
+ "groupName": "all storybook dependencies",
+ "groupSlug": "all-storybook",
+ "matchUpdateTypes": ["minor", "patch", "major"]
+ },
+ {
+ "packagePatterns": [".*eslint.*"],
+ "groupName": "all eslint dependencies",
+ "groupSlug": "all-eslint",
+ "matchUpdateTypes": ["minor", "patch", "major"]
+ }
+ ]
+}
diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml
new file mode 100644
index 0000000000..c0c85c07d6
--- /dev/null
+++ b/.github/workflows/playwright.yml
@@ -0,0 +1,84 @@
+name: 🎭 E2E Tests
+
+on:
+ push:
+ branches: [main]
+ pull_request: {}
+
+jobs:
+ test:
+ timeout-minutes: 10
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ shell: bash
+ env:
+ NODE_ENV: test
+ DEBUG: "pw:webserver"
+
+ steps:
+ - name: 🛑 Cancel Previous Runs
+ uses: styfle/[email protected]
+
+ - name: ⬇️ Checkout repo
+ uses: actions/checkout@v3
+
+ - uses: pnpm/action-setup@v2
+ with:
+ version: 8
+
+ - name: ⎔ Setup Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: 18
+ cache: "pnpm"
+ cache-dependency-path: "**/pnpm-lock.yaml"
+
+ - name: 📥 Install pnpm dependencies
+ working-directory: ./frontend
+ run: pnpm install
+
+ - name: 📦 Build frontend
+ run: ./scripts/buildfrontend.sh
+
+ - name: 🐍 Setup Python 3.10
+ uses: actions/setup-python@v4
+ with:
+ python-version: "3.10"
+
+ - name: 🐍 Install marimo
+ run: |
+ python -m pip install --upgrade pip
+ pip install .
+
+ - name: 🎭 Get installed Playwright version
+ id: playwright-version
+ working-directory: ./frontend
+ run: |
+ PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test | grep @playwright | sed 's/.*@//')
+ echo "Playwright's Version: $PLAYWRIGHT_VERSION"
+ echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
+
+ - name: 📦 Cache playwright binaries
+ uses: actions/cache@v3
+ id: playwright-cache
+ with:
+ path: |
+ ~/.cache/ms-playwright
+ key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
+
+ - name: 📥 Install Playwright Browsers
+ working-directory: ./frontend
+ if: steps.playwright-cache.outputs.cache-hit != 'true'
+ run: npx playwright install chromium --with-deps
+
+ - name: 🎭 Run Playwright tests
+ working-directory: ./frontend
+ run: npx playwright test
+
+ - uses: actions/upload-artifact@v3
+ if: always()
+ with:
+ name: playwright-report
+ path: frontend/playwright-report/
+ retention-days: 1
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
new file mode 100644
index 0000000000..d6a802028b
--- /dev/null
+++ b/.github/workflows/test.yaml
@@ -0,0 +1,76 @@
+name: test
+
+on:
+ push:
+ branches: [main]
+ pull_request: {}
+
+jobs:
+ test_frontend:
+ name: 🖥️ Lint, test, build frontend
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ working-directory: ./frontend
+ shell: bash
+
+ steps:
+ - name: 🛑 Cancel Previous Runs
+ uses: styfle/[email protected]
+
+ - name: ⬇️ Checkout repo
+ uses: actions/checkout@v3
+
+ - uses: pnpm/action-setup@v2
+ with:
+ version: 8
+
+ - name: ⎔ Use Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: 18
+ cache: "pnpm"
+ cache-dependency-path: "**/pnpm-lock.yaml"
+
+ - name: 📥 Install dependencies
+ run: pnpm install
+
+ - name: 🧹 Lint
+ run: pnpm run lint
+
+ - name: 🔎 Type check
+ run: pnpm run typecheck
+
+ - name: 🧪 Test
+ run: pnpm run test
+
+ - name: 📦 Build
+ run: pnpm run build
+
+ test_python:
+ name: Tests on Ubuntu, Python ${{ matrix.python-version }}
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version: ["3.8", "3.9", "3.10"]
+
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Install marimo with dev dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install .[dev]
+ - name: Lint
+ run: |
+ ruff marimo/
+ - name: Typecheck
+ if: ${{ matrix.python-version == '3.9' || matrix.python-version == '3.10' }}
+ run: |
+ mypy --config-file pyproject.toml marimo/
+ - name: Test
+ run: |
+ pytest -v marimo/ -k "not test_cli"
diff --git a/.github/workflows/test_cli.yaml b/.github/workflows/test_cli.yaml
new file mode 100644
index 0000000000..6f126e8a0a
--- /dev/null
+++ b/.github/workflows/test_cli.yaml
@@ -0,0 +1,93 @@
+name: cli test
+
+on:
+ push:
+ branches: [main]
+ pull_request: {}
+
+jobs:
+ build_wheel:
+ name: Build marimo wheel
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ shell: bash
+
+ steps:
+ - name: 🛑 Cancel Previous Runs
+ uses: styfle/[email protected]
+
+ - name: ⬇️ Checkout repo
+ uses: actions/checkout@v3
+
+ - uses: pnpm/action-setup@v2
+ with:
+ version: 8
+
+ - name: ⎔ Setup Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: 18
+ cache: "pnpm"
+ cache-dependency-path: "**/pnpm-lock.yaml"
+
+ - name: 📥 Install pnpm dependencies
+ working-directory: ./frontend
+ run: pnpm install
+
+ - name: 📦 Build frontend
+ run: ./scripts/buildfrontend.sh
+
+ - name: 🐍 Setup Python 3.10
+ uses: actions/setup-python@v4
+ with:
+ python-version: "3.10"
+
+ - name: 📦 Build marimo wheel
+ run: |
+ python -m pip install --upgrade pip
+ pip install build
+ pip install .
+ python -m build
+
+ - name: Upload wheel
+ uses: actions/upload-artifact@v3
+ with:
+ name: testwheel
+ path: dist/*.whl
+ retention-days: 1
+
+ test_cli:
+ name: Tests CLI on ${{ matrix.os }} ${{ matrix.python-version }}
+ needs: build_wheel
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ # TODO(akshayka): consider adding 3.8, 3.9; macos, windows
+ python-version: ["3.10"]
+ os: [ubuntu-latest]
+
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ - name: Install Python deps
+ run: |
+ python -m pip install --upgrade pip
+ pip install pytest
+
+ - name: Download wheel
+ uses: actions/download-artifact@v3
+ with:
+ name: testwheel
+
+ - name: Install marimo
+ shell: bash
+ run: pip install marimo*whl
+
+ - name: Test CLI
+ shell: bash
+ run: pytest -v marimo/_cli/test_cli.py
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..1f76ed7a4b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,108 @@
+# Data files, images
+*.csv
+*.pdf
+*.txt
+
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+pip-wheel-metadata/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+.hypothesis/
+.pytest_cache/
+
+# Translations
+*.mo
+*.pot
+
+# Sphinx documentation
+docs/_build/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+.python-version
+
+# pipenv
+# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+# However, in case of collaboration, if having platform-specific dependencies or dependencies
+# having no cross-platform support, pipenv may install dependencies that don't work, or not
+# install all needed dependencies.
+#Pipfile.lock
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# editors
+*.swp
+
+# misc
+.DS_Store
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+
+marimo/_static/
+
+.vscode
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000000..9e2490d385
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,226 @@
+# Contributing Guide
+
+We welcome all kinds of contributions. _You don't need to be an expert
+in frontend or Python development to help out._
+
+## Checklist
+
+Contributions are made through
+[pull requests](https://help.github.com/articles/using-pull-requests/).
+Before sending a pull request, make sure to do the following:
+
+- [Lint, typecheck, and format](#lint-typecheck-format) your code
+- [Write tests](#tests)
+- [Run tests](#tests) and check that they pass
+
+_Please reach out to the marimo team before starting work on a large
+contribution._ Get in touch at
+[Github issues](https://github.com/marimo-team/marimo/issues)
+or [on Discord](https://discord.gg/JE7nhX6mD8).
+
+## Building from source
+
+You'll need to build marimo from source to edit and test code.
+
+**Build dependencies.**
+To build marimo from source, you'll need to have Node.js, pnpm, GNU make, and
+Python (>=3.8) installed.
+
+- Install [Node.js](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm#using-a-node-version-manager-to-install-nodejs-and-npm)
+- Install [pnpm](https://github.com/pnpm/pnpm) with `npm install -g pnpm`
+- Install [GNU Make](https://www.gnu.org/software/make/) (you may already have it installed)
+- Install [Python](https://www.python.org/). (You may already it installed. To see your version, use
+ `python -v` at the command line.)
+
+**Build from source.**
+After installing the dependencies, run the following in a fresh Python virtual
+environment (such as [venv](https://docs.python.org/3/library/venv.html) or
+[virtualenv](https://virtualenv.pypa.io/en/latest/)):
+
+```bash
+make fe && make py
+```
+
+`make fe` builds the frontend. `make py` does an [editable install](https://setuptools.pypa.io/en/latest/userguide/development_mode.html) of marimo.
+
+(All `make` commands should be run in the project's root directory.)
+
+## Lint, Typecheck, Format
+
+**All checks.**
+
+```bash
+make check
+```
+
+**Frontend.**
+```bash
+make fe-check
+```
+
+**Python.**
+```bash
+make py-check
+```
+
+## Tests
+
+We have frontend unit tests, Python unit tests, and end-to-end tests.
+Code changes should be accompanied by unit tests. Some changes
+should also be accompanied by end-to-end tests.
+
+To run all tests:
+
+```bash
+make test
+```
+
+This can take some time. To run just frontend tests, just Python tests, or just
+end-to-end tests, read below.
+
+### Frontend
+
+In the root directory, run:
+
+```bash
+make fe-test
+```
+
+### Python
+
+In the root directory, run
+
+```bash
+make py-test
+```
+
+### End-to-end
+
+We use playwright to write and run end-to-end tests, which exercise both the
+marimo library and the frontend.
+
+(The first time you run, you may be prompted by playwright to install some
+dependencies; follow those instructions.)
+
+For best practices on writing end-to-end tests, check out the [Best Practices
+doc](https://playwright.dev/docs/best-practices).
+
+**Run end-to-end tests.**
+
+In the root directory, run:
+
+```bash
+make e2e
+```
+
+**Run tests interactively.**
+
+In `frontend/`:
+
+```bash
+npx playwright test --ui
+```
+
+**Run a specific test.**
+
+In `frontend/`:
+
+```bash
+npx playwright test <filename> --ui
+# e.g.
+npx playwright test cells.test.ts --ui
+```
+
+or
+
+```bash
+npx playwright test --debug <filename>
+```
+
+
+## Storybook
+
+To open Storybook, run the following:
+
+```bash
+cd frontend/
+pnpm storybook
+```
+
+## Hot reloading / development mode
+
+You can develop on marimo with hot reloading on the frontend and/or development
+mode on the server (which automatically restarts the server on code changes).
+These modes especially helpful when you're making many small changes and
+want to see changes end-to-end very quickly.
+
+For the frontend, you can run either
+
+```bash
+# starts a dev server on localhost:3000 and proxy requests to your marimo server
+# has hot reloading and the fastest way to develop the frontend
+# read caveats below
+pnpm dev
+```
+
+_OR_
+
+```bash
+# OR, in order to test closer to production, you can build the frontend and watch for changes
+pnpm build:watch
+```
+
+For the backend, you can start marimo in development mode with
+
+```bash
+marimo -d edit
+```
+
+- **When to run with hot-reloading?**: When you are developing on the frontend
+ and want to see changes immediately. This is useful for styling, layout, new
+ plugins, etc. Developing through the Vite server may have inconsistent
+ behavior due to proxied api/websocket request and since the marimo Python
+ server is not serving the HTML.
+- **When to develop with the frontend in watch mode?**: When you are making few
+ frontend changes, or when you want to test the frontend in a way that is
+ closer to production.
+- **When to run marimo CLI with development mode?**: When you are making
+ changes to the backend and you want your changes to be auto-reloaded so you
+ don't have to restart the server every time you make a change. If you are
+ running the frontend in watch mode, you will want to run the marimo server in
+ debug mode so that it will reload on changes.
+
+**Caveats for running `pnpm dev`**
+
+Running `pnpm dev` will serve the frontend from a Vite dev server, not from the
+marimo server. This means that:
+
+1. You will want to run your marimo server with `--headless` so it does not open a new browser tab, as it will
+ interfere with the frontend dev server.
+2. You should open an existing notebook instead of creating a new one, as the
+ frontend dev server will not be able to create or save notebooks.
+3. marimo normally sets the filename, mode, and config. These will be
+ mocked/disabled when running in the frontend in dev mode.
+4. The tradeoff of using the frontend dev server is that it is faster to
+ develop on the frontend, but you will not be able to test the frontend in
+ the same way that it will be used in production.
+
+
+
+## Editor settings
+
+If use use vscode, you might find the following `settings.json` useful:
+
+```json
+{
+ "editor.formatOnSave": true,
+ "editor.formatOnPaste": false,
+ "[typescript]": {
+ "editor.defaultFormatter": "esbenp.prettier-vscode"
+ },
+ "[typescriptreact]": {
+ "editor.defaultFormatter": "esbenp.prettier-vscode"
+ },
+ "prettier.configPath": "./frontend/.prettierrc.json"
+}
+```
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000000..d645695673
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. 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.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor 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
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You 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 the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You 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 such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its 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. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000000..de4bec6ada
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,2 @@
+recursive-include marimo/_static *
+include marimo/py.typed
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000000..697088c30b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,89 @@
+.PHONY: help
+# show this help
+help:
+ @# prints help for rules preceded with comment
+ @# https://stackoverflow.com/a/35730928
+ @awk '/^#/{c=substr($$0,3);next}c&&/^[[:alpha:]][[:alnum:]_-]+:/{print substr($$1,1,index($$1,":")),c}1{c=0}' Makefile | column -s: -t
+
+.PHONY: fe
+# install/build frontend
+fe: fe-install fe-build
+
+.PHONY: py
+# editable python install; only need to run once
+py:
+ pip install -e .[dev]
+
+.PHONY: check
+# run all checks
+check: fe-check py-check
+
+.PHONY: check-test
+# run all checks and tests
+check-test: check fe-test e2e py-test
+
+.PHONY: test
+# run all checks and tests
+test: fe-test e2e py-test
+
+.PHONY: fe-check
+# check frontend
+fe-check: fe-lint fe-typecheck
+
+.PHONY: fe-test
+# test frontend
+fe-test:
+ cd frontend; pnpm test
+
+.PHONY: e2e
+# test end-to-end
+e2e:
+ cd frontend; npx playwright install; npx playwright test
+
+.PHONY: fe-lint
+fe-lint:
+ cd frontend; pnpm lint:fix
+
+.PHONY: fe-typecheck
+fe-typecheck:
+ cd frontend; pnpm typecheck
+
+.PHONY: py-check
+# check python
+py-check:
+ ./scripts/pyfix.sh
+
+.PHONY: py-test
+# test python
+py-test:
+ pytest
+
+.PHONY: fe-build
+fe-build:
+ ./scripts/buildfrontend.sh
+
+.PHONY: fe-install
+fe-install:
+ cd frontend; pnpm install
+
+.PHONY: install-all
+# install everything; takes a long time due to editable install
+install-all: fe py
+
+.PHONY: wheel
+# build wheel
+wheel:
+ python -m build
+
+
+.PHONY: docs
+# build docs
+# use make ARGS="-a" docs to force docs to rebuild, useful when
+# modifying static files / assets
+docs:
+ sphinx-build $(ARGS) docs/ docs/_build
+
+.PHONY: docs-auto
+# autobuild docs
+docs-auto:
+ sphinx-autobuild $(ARGS) docs/ docs/_build
diff --git a/README.md b/README.md
new file mode 100644
index 0000000000..1f440ea66a
--- /dev/null
+++ b/README.md
@@ -0,0 +1,452 @@
+<p align="center">
+ <img src="docs/_static/marimo-logotype-thick.svg">
+</p>
+
+<p align="center">
+ Next-generation Python notebooks and apps.
+
+<p align="center">
+ <a href="https://docs.marimo.io" target="_blank"><strong>Docs</strong></a> ·
+ <a href="https://discord.gg/JE7nhX6mD8" target="_blank"><strong>Discord</strong></a> ·
+ <a href="https://marimo.io/examples" target="_blank"><strong>Examples</strong></a>
+</p>
+
+**marimo** is a Python library for creating **reactive notebooks
+that double as apps**. marimo is:
+
+- **reactive**: run a cell and marimo automatically runs cells that depend on it
+- **interactive**: interact with sliders, dropdowns, tables, and more to
+ automatically run dependent cells
+- **expressive**: parametrize markdown with interactive elements, plots, or anything else
+- **simple**: no callbacks, no magical syntax
+- **Pythonic**: cells only run Python; notebooks stored as `.py` files (clean git diffs!)
+- **performant**: powered by static analysis, zero runtime overhead
+
+marimo was built from the ground up to solve many [well-known problems
+with traditional notebooks](#faq-jupyter). marimo is _not_ built on top of
+Jupyter or any other notebook or app library.
+
+![marimo](docs/_static/intro_condensed.gif)
+
+**Contents.**
+
+<!-- toc -->
+
+- [Getting Started](#getting-started)
+ - [Installation](#installation)
+ - [Tutorials](#tutorials)
+ - [Notebooks](#notebooks)
+ - [Apps](#apps)
+ - [Convert Jupyter notebooks](#convert-jupyter-notebooks)
+- [Concepts](#concepts)
+- [Examples](#examples)
+- [FAQ](#faq)
+- [Contributing](#contributing)
+- [License](#license)
+- [Community](#community)
+
+<!-- tocstop -->
+
+## Getting Started
+
+Installing marimo gets you the `marimo` command-line interface (CLI), the
+entry point to all things marimo.
+
+### Installation
+
+In a terminal, run
+
+```bash
+pip install marimo
+marimo tutorial intro
+```
+
+You should see a tutorial notebook in your browser:
+
+<div align="center">
+<img src="docs/_static/intro_tutorial.gif" width="400px" />
+</div>
+
+If that doesn't work, please [open a Github issue](https://github.com/marimo-team/marimo/issues).
+
+### Tutorials
+
+`marimo tutorial intro` opens the intro tutorial. List all tutorials with
+
+```bash
+marimo tutorial --help
+```
+
+### Notebooks
+
+Create and edit notebooks with `marimo edit`.
+
+- create a new notebook:
+
+```bash
+marimo edit
+```
+
+- create or edit a notebook with a given name:
+
+```bash
+marimo edit your_notebook.py
+```
+
+### Apps
+
+Use `marimo run` to serve your notebook as an app, with Python code hidden and
+uneditable.
+
+```bash
+marimo run your_notebook.py
+```
+
+### Convert Jupyter notebooks
+
+Automatically translate Jupyter notebooks to marimo notebooks with `marimo convert`:
+
+```bash
+marimo convert your_notebook.ipynb > your_notebook.py
+```
+
+Because marimo is different from traditional notebooks, your converted
+notebook will likely have errors that you'll need to fix. marimo
+will guide you through fixing them when you open it with `marimo edit`.
+
+## Concepts
+
+marimo notebooks are **reactive**: they automatically react to your code
+changes and UI interactions and keep your notebook up-to-date (like a
+spreadsheet).
+
+### Cells
+
+A marimo notebook is made of small blocks of Python code called **cells**.
+_When you run a cell, marimo automatically runs all cells that read any global
+variables defined by that cell._ This is reactive execution.
+
+> **Reactive execution lets your notebooks double as interactive
+apps**. It also guarantees that your code and program state are
+consistent.
+
+<div align="center">
+<figure>
+<img src="docs/_static/reactive.gif" width="600px"/>
+</figure>
+</div>
+
+**Execution order.**
+The order of cells on the page has no bearing on the order cells are
+executed in: execution order is completely determined by the variables
+cells define and the cells they read. You have full freedom over
+how to organize your code and tell your stories: move helper functions and
+other "appendices" to the bottom of your notebook, or put cells with important
+outputs at the top.
+
+**No hidden state.**
+marimo notebooks have no hidden state because the program state is
+automatically synchronized with your code changes and UI interactions. And if
+you delete a cell, marimo automatically deletes that cell's variables,
+preventing painful bugs that arise in traditional notebooks.
+
+**No magical syntax.**
+There's no magical syntax or API required to opt-in to reactivity: cells are
+Python and _only Python_. Behind-the-scenes, marimo statically analyzes each
+cell's code just once, creating a directed acyclic graph based on the
+global names each cell defines and reads. This is how data flows
+in a marimo notebook.
+
+
+For more on reactive execution, open the dataflow tutorial:
+
+```bash
+marimo tutorial dataflow
+```
+
+### The marimo library
+
+marimo is both a notebook and a library. The marimo library lets you use
+markdown, interactive UI elements, layout elements, and more in your marimo
+notebooks.
+
+We recommend starting each marimo notebook with a cell containing a single
+line of code,
+
+
+```python3
+import marimo as mo
+```
+
+### Outputs
+
+marimo visualizes the last expression of each cell as its **output**. Outputs
+can be any Python value, including markdown and interactive elements created
+with the marimo library, _e.g._, `mo.md(...)`, `mo.ui.slider(...)`.
+You can even interpolate Python values into markdown and other marimo elements
+to build rich composite outputs.
+
+<div align="center">
+<figure>
+<img src="docs/_static/outputs.gif" width="600px"/>
+</figure>
+</div>
+
+> Thanks to reactive execution, running a
+cell refreshes all the relevant outputs in your notebook.
+
+For more on outputs, try these tutorials:
+
+```bash
+marimo tutorial markdown
+marimo tutorial plots
+marimo tutorial layout
+```
+
+
+### Interactive elements
+
+The marimo library comes with many interactive stateful elements in
+`marimo.ui`, including simple ones like sliders, dropdowns, text fields, and file
+upload areas, as well as composite ones like forms, arrays, and dictionaries
+that can wrap other UI elements.
+
+<div align="center">
+<figure>
+<img src="docs/_static/readme-ui.gif" width="600px"/>
+</figure>
+</div>
+
+**Using UI elements.**
+To use a UI element, create it with `marimo.ui` and **assign it to a global
+variable.** When you interact with a UI element in your browser (_e.g._,
+sliding a slider), _marimo sends the new value back to Python and reactively
+runs all cells that use the element_, which you can access via its `value`
+attribute.
+
+> **This combination of interactivity and reactivity is very powerful**: use it
+to make your data tangible during exploration and to build all kinds of tools
+and apps.
+
+ _marimo can only synchronize UI elements that are assigned to
+global variables._ You can use composite elements like `mo.ui.array` and
+`mo.ui.dictionary` if the set of UI elements is not known until runtime.
+
+For more on interactive elements, run the UI tutorial:
+
+```bash
+marimo tutorial ui
+```
+
+#### Composite elements
+
+marimo's composite UI elements let you wrap other UI
+elements to create powerful UIs. For example,
+`marimo.ui.form` lets you gate elements on submission, while
+`marimo.ui.dictionary` and `marimo.ui.array` let you batch arbitrary
+collections of elements.
+
+<div align="center">
+<figure>
+<img src="docs/_static/readme-ui-form.gif" width="600px"/>
+</figure>
+</div>
+
+
+### Layout
+
+The marimo library also comes with layout elements, including `mo.hstack`,
+`mo.vstack`, `mo.tabs`, and more.
+
+## Examples
+
+Examples are available in the `examples/` directory. Community examples can be
+found and shared in the [marimo cookbook](https://github.com/marimo-team/cookbook).
+
+## FAQ
+
+- [Choosing marimo](#choosing-marimo)
+ - [How is marimo different from Jupyter?](#faq-jupyter)
+ - [How is marimo.ui different from Jupyter widgets?](#faq-widgets)
+- [Using marimo](#using-marimo)
+ - [Is marimo a notebook or a library?](#faq-notebook-or-library)
+ - [How does marimo know what cells to run?](#faq-reactivity)
+ - [How do I use sliders and other interactive elements?](#faq-interactivity)
+ - [How do I add a submit button to UI elements?](#faq-form)
+ - [How do I write markdown?](#faq-markdown)
+ - [How do I display plots?](#faq-plots)
+ - [How do I display objects in rows and columns?](#faq-rows-columns)
+ - [What packages can I use?](#faq-packages)
+ - [What's the difference between a marimo notebook and a marimo app?](#faq-notebook-app)
+ - [How do I deploy apps?](#faq-app-deploy)
+ - [Is marimo free?](#faq-marimo-free)
+
+<!--With interactivity and reactivity, marimo enables rapid data exploration and
+and makes it seamless to turn notebooks into powerful apps for yourself and
+others. marimo also solves many well-documented problems associated with
+traditional notebooks by eliminating the problem of inconsistent state, making
+your notebooks more reproducible and saving you from costly bugs. -->
+
+### Choosing marimo
+
+<a name="faq-jupyter" ></a>
+**How is marimo different from Jupyter?**
+
+marimo is a brand new Python notebook that is both _interactive_, with
+UI elements like sliders, dropdowns, etc., and _reactive_, like a
+spreadsheet. marimo solves many well-documented problems associated with
+traditional notebooks like Jupyter
+[[1]](https://austinhenley.com/pubs/Chattopadhyay2020CHI_NotebookPainpoints.pdf)
+[[2]](https://docs.google.com/presentation/d/1n2RlMdmv1p25Xy5thJUhkKGvjtV-dkAIsUXP-AL4ffI/edit#slide=id.g362da58057_0_1):
+
+- **no hidden state**: running a cell automatically runs all
+ cells that depend on it, and deleting a cell automatically deletes its
+variables, eliminating hidden state and hidden bugs
+- **interactive data exploration**: UI elements and reactivity make your data
+ tangible
+- **sharing**: use the marimo CLI to run notebooks as apps
+- **Python, not JSON**: stored as executable Python, with clean git diffs
+ and potential for code reuse
+- **fast, reliable autocomplete**: code completion is fast and works out of the
+ box
+
+
+<a name="faq-widgets" ></a>
+**How is `marimo.ui` different from Jupyter widgets?**
+
+
+Unlike Jupyter widgets, marimo's interactive elements are automatically
+synchronized with the Python kernel: no callbacks, no observers, no manually
+re-running cells.
+
+
+<p align="center">
+<img src="docs/_static/faq-marimo-ui.gif" width="600px" />
+</p>
+
+### Using marimo
+
+**Is marimo a notebook or a library?**
+
+marimo is both a notebook and a library.
+
+- Create _marimo notebooks_ with the editor that opens in your
+ browser when you run `marimo edit`.
+- Use the _marimo library_ (`import marimo as mo`) in
+ marimo notebooks. Write markdown with `mo.md(...)`,
+ create stateful interactive elements with `mo.ui` (`mo.ui.slider(...)`), and
+ more. See the docs for an [API reference](https://docs.marimo.io/api/).
+
+<a name="faq-reactivity" ></a>
+**How does marimo know what cells to run?**
+
+marimo reads each cell once to determine what global names it defines and what
+global names it reads. When a cell is run, marimo runs all other cells that
+read any of the global names it defines. A global name can refer to a variable,
+class, function, or import.
+
+In other words, marimo uses _static analysis_ to make a dataflow graph out of
+your cells. Each cell is a node in the graph across which global
+variables "flow". Whenever a cell is run, either because you changed its
+code or interacted with a UI element it reads, all its descendants run in turn.
+
+<a name="faq-interactivity" ></a>
+**How do I use sliders and other interactive elements?**
+
+Interactive UI elements like sliders are available in `marimo.ui`.
+
+- Assign the UI element to a global variable (`slider = mo.ui.slider(0,
+ 100)`)
+- Include it in the last expression of a cell to display
+it (`slider` or `mo.md(f"Choose a value: {slider}")`)
+- Read its current value in another cell via its `value` attribute (`slider.value`)
+
+If you have many UI elements or don't know the elements
+you'll create until runtime, use `marimo.ui.array` and `marimo.ui.dictionary`
+to create UI elements that wrap other UI elements (`sliders =
+mo.ui.array([slider(1, 100) for _ in range(n_sliders)])`).
+
+All this and more is explained in the UI tutorial. Run it with
+
+```bash
+marimo tutorial ui
+```
+
+at the command line.
+
+<a name="faq-form" ></a>
+**How do I add a submit button to UI elements?**
+
+Use the `form` method to add a submit button to a UI element. For
+example,
+
+```python
+form = marimo.ui.text_area().form()
+```
+ When wrapped in a form, the
+text area's value will only be sent to Python when you click the submit button.
+Access the last submitted value of the text area with `form.value`.
+
+<a name="faq-markdown" ></a>
+**How do I write markdown?**
+
+Import `marimo` (as `mo`) in a notebook, and use the `mo.md` function.
+
+
+<a name="faq-plots" ></a>
+**How do I display plots?**
+
+Include plots in the last expression of a cell to display them, just like all
+other outputs. If you're using matplotlib, you can display the `Figure` object
+(get the current figure with `plt.gcf()`). For examples, run the plots tutorial:
+
+```bash
+marimo tutorial plots
+```
+
+<a name="faq-rows-columns" ></a>
+**How do I display objects in rows and columns?**
+
+Use `marimo.hstack` and `marimo.vstack`. See the layout tutorial for details:
+
+```bash
+marimo tutorial layout
+```
+<a name="faq-packages" ></a>
+**What packages can I use?**
+
+You can use any Python package. marimo cells run arbitrary Python code.
+
+<a name="faq-notebook-app" ></a>
+**What's the difference between a marimo notebook and a marimo app?**
+
+You can think of marimo programs as notebooks, apps, or both. Edit a marimo
+program as notebook with `marimo edit`, or run it as an app, rendering cell
+outputs without their code, with `marimo run`.
+
+<a name="faq-app-deploy" ></a>
+**How do I deploy apps?**
+
+Use the marimo CLI's `run` command to serve a notebook as an app:
+
+```
+marimo run notebook.py
+```
+
+<a name="faq-marimo-free" ></a>
+**Is marimo free?**
+
+Yes!
+
+## Contributing
+
+We appreciate all contributions. You don't need to be an expert to help out.
+Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more details on how to get
+started.
+
+> Questions? Reach out to us [on Discord](https://discord.gg/JE7nhX6mD8).
+
+## Community
+
+We're building a community [on Discord](https://discord.gg/JE7nhX6mD8). Come
+hang out with us!
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000000..d4bb2cbb9e
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,20 @@
+# Minimal makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line, and also
+# from the environment for the first two.
+SPHINXOPTS ?=
+SPHINXBUILD ?= sphinx-build
+SOURCEDIR = .
+BUILDDIR = _build
+
+# Put it first so that "make" without argument is like "make help".
+help:
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+
+.PHONY: help Makefile
+
+# Catch-all target: route all unknown targets to Sphinx using the new
+# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
+%: Makefile
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
diff --git a/docs/_static/CalSans-SemiBold.woff b/docs/_static/CalSans-SemiBold.woff
new file mode 100644
index 0000000000..da459913f0
Binary files /dev/null and b/docs/_static/CalSans-SemiBold.woff differ
diff --git a/docs/_static/array.png b/docs/_static/array.png
new file mode 100644
index 0000000000..7740d460ef
Binary files /dev/null and b/docs/_static/array.png differ
diff --git a/docs/_static/css/custom.css b/docs/_static/css/custom.css
new file mode 100644
index 0000000000..400c7a098d
--- /dev/null
+++ b/docs/_static/css/custom.css
@@ -0,0 +1,79 @@
+@font-face {
+ font-family: "CalSans";
+ src: url("../CalSans-SemiBold.woff");
+}
+
+body .page {
+ --api-font-size: var(--font-size--normal) !important;
+}
+
+.sidebar-brand-text {
+ font-family: "CalSans";
+ color: #1c7362;
+ font-weight: 600;
+ font-size: 1.85rem;
+ line-height: 1.5rem;
+}
+
+h1,
+h2 {
+ font-family: "CalSans";
+}
+
+[data-theme="dark"] .sidebar-brand-text {
+ color: #fff;
+}
+
+iframe.demo {
+ width: 100%;
+ height: 250px;
+ border: 1px solid var(--color-background-border);
+ border-radius: 5px;
+}
+
+iframe.demo.medium {
+ height: 400px;
+}
+
+iframe.demo.large {
+ height: 600px;
+}
+
+.highlight {
+ border-radius: 0.4rem;
+}
+
+/* Better formatting of signatures from https://github.com/sphinx-doc/sphinx/issues/1514#issuecomment-742703082 */
+/* Newlines (\a) and spaces (\20) before each parameter */
+.sig-param::before {
+ content: "\a\20\20";
+ white-space: pre;
+}
+
+/* Newline after the last parameter (so the closing bracket is on a new line) */
+dt em.sig-param:last-of-type::after {
+ content: "\a";
+ white-space: pre;
+}
+
+.sidebar-logo-container {
+ height: 150px;
+}
+
+figcaption {
+ font-size: 0.875rem;
+ color: gray;
+}
+
+[data-theme="dark"] figcaption {
+ color: var(--color-content-foreground);
+}
+
+figure img {
+ border: 1px solid #bbbbbb;
+ border-radius: 5px;
+}
+
+blockquote {
+ border-left-color: #1c7362;
+}
diff --git a/docs/_static/docs-delete-cell.gif b/docs/_static/docs-delete-cell.gif
new file mode 100644
index 0000000000..260a400562
Binary files /dev/null and b/docs/_static/docs-delete-cell.gif differ
diff --git a/docs/_static/docs-intro-app.gif b/docs/_static/docs-intro-app.gif
new file mode 100644
index 0000000000..55edc9549d
Binary files /dev/null and b/docs/_static/docs-intro-app.gif differ
diff --git a/docs/_static/faq-marimo-ui.gif b/docs/_static/faq-marimo-ui.gif
new file mode 100644
index 0000000000..c2ac860975
Binary files /dev/null and b/docs/_static/faq-marimo-ui.gif differ
diff --git a/docs/_static/favicon-32x32.png b/docs/_static/favicon-32x32.png
new file mode 100644
index 0000000000..6e61dbe756
Binary files /dev/null and b/docs/_static/favicon-32x32.png differ
diff --git a/docs/_static/intro_condensed.gif b/docs/_static/intro_condensed.gif
new file mode 100644
index 0000000000..6ad93ec29f
Binary files /dev/null and b/docs/_static/intro_condensed.gif differ
diff --git a/docs/_static/intro_tutorial.gif b/docs/_static/intro_tutorial.gif
new file mode 100644
index 0000000000..cf93544f87
Binary files /dev/null and b/docs/_static/intro_tutorial.gif differ
diff --git a/docs/_static/js/analytics.js b/docs/_static/js/analytics.js
new file mode 100644
index 0000000000..db34727284
--- /dev/null
+++ b/docs/_static/js/analytics.js
@@ -0,0 +1,7 @@
+// @ts-ignore
+// prettier-ignore
+!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagPayload reloadFeatureFlags group updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures getActiveMatchingSurveys getSurveys".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
+// @ts-ignore
+posthog.init("phc_U2xS6waxdmM6YDt9l6jwDdluVinawgkSn69qPAohz59", {
+ api_host: "https://app.posthog.com",
+});
diff --git a/docs/_static/marimo-logotype-thick.svg b/docs/_static/marimo-logotype-thick.svg
new file mode 100644
index 0000000000..30a70b4875
--- /dev/null
+++ b/docs/_static/marimo-logotype-thick.svg
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ width="185.53143"
+ height="148.3338"
+ viewBox="0 0 139.14857 111.25034"
+ version="1.1"
+ id="svg1568"
+ sodipodi:docname="marimo-logotype-thick.svg"
+ inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <defs
+ id="defs1572" />
+ <sodipodi:namedview
+ id="namedview1570"
+ pagecolor="#ffffff"
+ bordercolor="#000000"
+ borderopacity="0.25"
+ inkscape:showpageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ inkscape:deskcolor="#d1d1d1"
+ inkscape:document-units="pt"
+ showgrid="false"
+ inkscape:zoom="1.6749344"
+ inkscape:cx="-180.30557"
+ inkscape:cy="-47.166028"
+ inkscape:window-width="2560"
+ inkscape:window-height="1403"
+ inkscape:window-x="2560"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg1568" />
+ <g
+ id="surface1"
+ transform="matrix(0.32633463,0,0,0.32633463,-126.64588,-120.45361)">
+ <path
+ style="fill:#1c7361;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 388.08594,708.44141 h 23.32422 v -33.30079 c 0,-4.83203 2.625,-7.03906 6.30078,-7.03906 3.88672,0 6.19922,2.20703 6.19922,7.03906 v 33.30079 h 23.32031 v -33.30079 c 0,-4.83203 2.51953,-7.03906 6.30469,-7.03906 3.99218,0 6.30078,2.20703 6.30078,7.03906 v 33.30079 h 23.42578 V 670.625 c 0,-17.33594 -9.13672,-23.11328 -20.48438,-23.11328 -9.875,0 -15.96875,5.67578 -17.4375,10.92578 H 444.5 c -3.57422,-8.19141 -8.82422,-10.92578 -16.59766,-10.92578 -8.30078,0 -14.18359,4.9375 -15.65234,9.98047 h -0.83984 v -8.40235 h -23.32422 z m 102.53125,-29.625 c 0,18.28125 10.82031,31.20312 26.26172,31.20312 7.98437,0 14.18359,-3.46875 16.80859,-9.98047 h 0.73437 v 8.40235 h 23.11329 v -59.35157 h -23.11329 v 8.40235 h -0.73437 c -2.625,-6.40625 -8.82422,-9.98047 -16.80859,-9.98047 -14.4961,0 -26.26172,12.29297 -26.26172,31.30469 z m 33.71875,10.61328 c -5.77735,0 -10.29297,-3.67969 -10.29297,-10.71485 0,-6.82812 4.41015,-10.61328 10.29297,-10.61328 5.67578,0 10.1914,3.67969 10.1914,10.61328 0,7.03516 -4.51562,10.71485 -10.1914,10.71485 z m 84.04297,-15.02344 v -26.89453 c -9.2461,0 -15.65235,4.9375 -18.80469,14.70703 h -0.83985 v -13.12891 h -21.11718 v 59.35157 H 590.625 v -21.42969 c 0,-8.71875 4.83203,-13.44531 11.87109,-13.44531 2.625,0 4.6211,0.41796 5.88282,0.83984 z m 7.14062,34.03516 h 23.21875 v -59.35157 h -23.21875 z m 0,-65.55079 h 23.21875 v -6.40625 h -23.21875 z m 33.30078,65.55079 h 23.32422 v -33.30079 c 0,-4.83203 2.625,-7.03906 6.30078,-7.03906 3.88672,0 6.19922,2.20703 6.19922,7.03906 v 33.30079 h 23.32031 v -33.30079 c 0,-4.83203 2.52344,-7.03906 6.30469,-7.03906 3.99219,0 6.30078,2.20703 6.30078,7.03906 v 33.30079 h 23.42578 V 670.625 c 0,-17.33594 -9.13672,-23.11328 -20.48437,-23.11328 -9.875,0 -15.96485,5.67578 -17.4375,10.92578 h -0.83985 c -3.57031,-8.19141 -8.82421,-10.92578 -16.59765,-10.92578 -8.30078,0 -14.1836,4.9375 -15.65235,9.98047 h -0.83984 v -8.40235 h -23.32422 z m 134.15235,1.57812 c 18.27734,0 31.51171,-13.02734 31.51171,-31.30469 0,-18.80468 -13.23437,-31.20312 -31.51171,-31.20312 -18.38672,0 -31.6211,12.39844 -31.6211,31.20312 0,18.27735 11.13672,31.30469 31.6211,31.30469 z m 0,-20.58984 c -5.77735,0 -10.29688,-3.67969 -10.29688,-10.71485 0,-6.82812 4.41406,-10.61328 10.29688,-10.61328 5.67187,0 10.1875,3.67969 10.1875,10.61328 0,7.03516 -4.51563,10.71485 -10.1875,10.71485 z m 0,0"
+ id="path1531" />
+ <path
+ style="fill:#1c7361;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 517.37109,413.55859 c 1.51172,-1.78125 3.1875,-4.15625 2.10547,-6.26172 6.04688,-3.5625 11.39063,-8.26171 15.76172,-13.76562 -2.375,1.89062 -4.96484,3.40234 -7.71875,4.58984 20.67578,-20.40625 51.76953,-29.6914 80.32422,-23.96875 -22.99609,-0.86328 -46.42188,5.23438 -65.42578,18.19141 -19.05469,12.90234 -33.51953,32.71094 -39.07813,55.05859 8.41797,-24.45312 26.17969,-45.55859 48.85157,-57.97265 -1.78125,1.83593 -3.56641,3.72265 -5.39844,5.55859 8.63672,-3.5625 16.46094,-8.90625 25.04687,-12.63281 25.20703,-11.01172 55.54297,-6.85547 79.02344,7.5039 23.48047,14.35938 40.37891,37.89454 50.20313,63.58985 4.3164,11.22656 7.33984,23.69531 3.50781,35.08594 -0.86328,-14.84375 -5.72266,-29.14844 -12.03906,-42.58985 -10.47266,-22.40234 -25.47657,-43.39844 -46.58204,-56.24609 -21.10546,-12.79297 -49.01562,-16.19531 -70.60546,-4.15625 11.0664,-1.1875 22.23828,-1.83594 33.19531,-0.26953 20.62109,2.91406 39.67578,13.71093 54.14062,28.66015 14.41407,15.00782 24.40235,33.95313 30.28516,53.8711 5.72266,19.48828 7.60937,40.97265 0.26953,59.97265 21.42969,-34.65625 17.86719,-82.91015 -8.3125,-114.05859 -10.95703,-13.00781 -25.15625,-22.99609 -40.48437,-30.22656 -17.70704,-8.3125 -37.14063,-13.11719 -56.67969,-12.57813 -19.53906,0.53906 -39.08203,6.64063 -54.67969,18.40625 12.95313,-11.44531 29.84766,-17.92187 47.01563,-19.70312 17.21875,-1.72657 34.65234,1.08203 51.01171,6.58593 34.00391,11.55079 64.98829,37.03125 74.97657,71.52344 2.53515,8.85156 3.66797,18.02735 4.69531,27.20703 0.86328,7.9336 1.56641,15.86719 1.40234,23.85547 -0.7539,39.46094 -25.96484,78.00391 -62.72265,92.41406 -10.41797,4.05079 -21.42969,6.26172 -32.4961,7.82813 -17.70703,2.48047 -36.05859,3.23828 -53.11718,-2.05078 -8.79688,-2.75391 -17.00391,-7.01953 -24.61329,-12.25391 -31.52343,-21.59375 -51.4414,-59.21484 -51.4414,-97.43359 0,-6.80078 0.59375,-13.54688 1.51172,-20.24219 0.80859,-6.15234 1.88672,-12.25391 3.66797,-18.19141 2.69921,-8.74609 6.91015,-17.0039 12.47265,-24.28906 0.96875,-0.59375 1.94141,-1.24219 2.85938,-1.89062 -12.79297,27.04297 -20.40625,59 -8.69141,86.58203 -4.21094,-17.97266 -4.48047,-36.8125 -0.75391,-54.84375 1.1875,-0.42969 2.375,-0.91406 3.50782,-1.40235 0.0547,-1.1875 0.10547,-2.32031 0.16015,-3.50781 -0.86328,0.97266 -1.67187,1.94141 -2.53515,2.85938 1.99609,-14.30469 8.14843,-27.85157 17.3789,-38.8086 m 8.69141,-0.70312 c 3.34766,-2.26563 6.69531,-4.53516 10.04297,-6.80078 -2.10547,4.26562 -5.99219,7.60937 -10.52735,9.12109 -21.05078,21.75391 -27.53125,54.19531 -25.04687,84.31641 0.97266,11.39062 3.29297,23.21093 10.63281,31.95703 -5.125,-21.05469 -5.39844,-43.29297 -0.69922,-64.45313 0.91797,-0.0547 1.23828,1.13282 1.23828,2.05078 0.37891,14.19922 -2.05078,28.39454 -1.02343,42.58985 1.02343,14.14453 6.3164,29.09765 18.1914,36.8164 9.28516,6.04297 18.51563,12.08985 27.7461,18.13672 -21.59375,-6.91015 -40.4336,-21.91797 -52.08985,-41.34765 3.12891,8.47265 7.5,16.51562 12.89844,23.75 -0.69922,-1.94532 -1.34766,-3.94141 -2.05078,-5.9375 5.45312,5.1289 10.95703,10.14843 16.41016,15.22265 3.99609,3.72266 10.25781,7.5 14.35937,3.9375 0.64844,1.35157 -0.53906,3.02344 -1.99609,3.40235 -1.46094,0.43359 -3.02344,0 -4.48047,-0.4336 6.53125,4.69922 13.33203,9.01563 20.34765,12.95703 -1.02343,0.16016 -1.34765,1.67188 -0.69921,2.53516 0.64453,0.86719 1.72656,1.08203 2.75,1.35156 25.75,5.5586 53.17187,3.50782 77.78515,-5.99218 -21.16015,4.96484 -43.72265,6.10156 -64.23437,-1.07813 -17.32813,-6.04687 -32.4961,-17.97656 -42.42969,-33.35937 -3.18359,-4.96875 -5.82813,-10.20313 -8.25781,-15.54688 -7.82813,-17.59766 -12.79297,-36.8125 -11.39063,-56.03125 1.40625,-19.21484 9.82422,-38.37891 24.94141,-50.25391 1.5625,-1.24218 3.50781,-2.42968 5.44922,-1.94531 -14.89844,10.79688 -23.75,28.66406 -26.07032,46.91016 -2.32031,18.29687 1.45704,36.86719 8.09766,54.03125 4.75,12.14844 11.0625,23.91406 19.75391,33.6289 3.72656,4.15625 7.9375,7.9375 12.73828,10.79688 8.80078,5.28906 19.21875,7.28906 29.42187,8.58203 13.8711,1.78125 27.85157,2.53906 41.83203,2.21484 -17.65234,4.15625 -36.11328,1.1875 -53.98046,-1.78125 30.33984,11.39063 65.91015,4.42579 91.98437,-14.73828 5.17969,-3.83203 10.09375,-8.09375 14.03125,-13.22265 6.04688,-7.88282 9.66406,-17.48828 11.5,-27.26172 4.75,-25.47656 -2.05078,-52.08985 -14.41406,-74.92188 -8.58203,-15.87109 -19.97266,-30.55078 -34.97656,-40.53906 -14.03516,-9.28516 -30.71485,-14.19531 -47.50391,-15.11328 -25.80078,-1.51172 -53.11328,7.01562 -70.28125,26.44922 M 576.75,588.17969 c 11.60547,2.91406 23.32031,5.01953 35.19531,6.42578 -14.57422,3.34375 -29.58203,-1.78125 -43.66797,-6.80078 -8.3164,-2.91797 -16.73437,-5.94141 -24.45312,-10.25782 -18.67969,-10.36328 -32.71485,-28.125 -40.86328,-47.8789 -1.40235,-3.50781 -2.69922,-7.01953 -3.77735,-10.58203 -0.10937,-0.42969 -0.43359,0.59375 0,0.3789 0.42969,-0.16015 0.375,-0.80859 0.16016,-1.24218 -4.85938,-11.71094 -7.82813,-24.28907 -8.74609,-36.92188 -0.91797,19.10938 3.83203,38.32422 12.46875,55.4375 9.39453,18.62109 23.48437,34.98047 41.1875,46.04297 17.65234,11.06641 38.91796,16.67969 59.64843,14.68359 29.14844,-2.85937 54.73438,-19.86328 78.21485,-37.30078 -10.36328,13.71094 -26.07032,22.1875 -41.34766,30.17578 26.39453,-7.39453 47.55469,-28.28515 60.29688,-52.57422 -6.31641,10.79297 -16.19532,19.26954 -26.9375,25.63672 -10.79688,6.3711 -22.61719,10.79688 -34.4375,15.0625 -5.1836,1.89063 -10.41797,3.72266 -15.76172,5.23438 -15.27735,4.375 -31.36328,5.88672 -47.17969,4.48047 m 107.95703,-36.48828 c 2.69922,-2.53907 5.34766,-5.12891 7.50391,-8.04297 3.40234,-4.69532 5.66797,-10.14844 7.82812,-15.54688 2.91406,-7.33984 5.88281,-14.73828 6.64063,-22.61719 -1.40625,1.24219 -1.89063,3.07813 -2.42969,4.85938 -7.17969,24.88281 -24.9375,46.58203 -47.98828,58.45703 10.85156,-2.42969 20.1875,-9.5 28.44531,-17.10937 m -131.92187,26.44921 c 1.13281,0.26954 2.53515,0.75391 2.58984,1.89063 0.42969,-0.75781 1.72656,-0.75781 2.21094,0 0.21875,-0.0547 0.0547,-0.43359 -0.21485,-0.54297 -1.61718,-0.86328 -3.23828,-1.72656 -4.80468,-2.58984 -6.53125,-3.50782 -12.52344,-7.87891 -17.86719,-12.95313 -0.64844,1.40235 -0.16016,3.1836 1.08203,4.04688 2.375,1.72656 4.75,3.45312 7.125,5.18359 2.85937,2.375 6.26172,4.10156 9.87891,4.96484 m 155.89062,-81.61718 c -0.21484,3.99609 -0.43359,8.04297 -0.70312,12.03906 -0.0508,0.53906 -0.0508,1.07812 -0.0508,1.61719 -0.0547,0.97265 -0.10937,1.94531 -0.21875,2.86328 -0.0547,1.1875 -0.10546,2.26562 -0.10546,3.45312 2.26562,-9.17578 3.07421,-18.78515 2.375,-28.17578 -0.26954,-0.10937 -0.54297,-0.26953 -0.75782,-0.43359 -0.16015,2.85937 -0.3789,5.72265 -0.53906,8.63672 m -209.8164,-59.16016 c -0.3789,0.69922 -0.70312,1.40234 -1.02734,2.10547 0.37891,0.48437 1.07813,-0.10938 1.24219,-0.70313 0.16015,-0.53906 0.32422,-1.29687 0.91797,-1.34765 -0.26953,-0.27344 -0.53907,-0.54297 -0.8086,-0.8125 -0.10937,0.21875 -0.21875,0.53906 -0.10937,0.75781 m 39.02734,-44.80469 c 0.53906,-0.42968 1.07813,-0.86328 1.61719,-1.34765 -0.91797,-0.37891 -2.10547,0.10547 -2.48047,1.07812 0.26953,0.10938 0.53906,0.21485 0.86328,0.26953 m 1.67188,-2.53515 c 1.1875,0.26953 2.53906,-0.0547 3.50781,-0.86328 -1.23828,-0.0547 -2.48047,0.21484 -3.50781,0.86328 m -42.96485,54.78906 c -0.0547,-0.26953 -0.10937,-0.53906 -0.10937,-0.75781 -1.02735,0.3789 -1.51172,1.78125 -0.91797,2.69922 0.21484,-0.69922 0.53906,-1.34766 1.02734,-1.94141 m -6.10156,27.52734 c -0.26953,0.37891 -0.0547,1.02735 0.43359,1.08203 0.26954,-0.86328 0.21485,-1.78125 -0.0547,-2.69921 -0.53907,0.26953 -0.70313,1.02343 -0.37891,1.51171"
+ id="path1533" />
+ <path
+ style="fill:#1c7361;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 527.08984,398.39062 c 0.10547,0.16016 0.21485,0.375 0.32422,0.53907 -0.48828,0.69922 -1.40625,1.02343 -2.21484,0.80859 0.43359,-0.59375 1.08203,-1.02344 1.78125,-1.1875"
+ id="path1535" />
+ <path
+ style="fill:#1c7361;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 522.82422,401.84375 c 0.75781,-0.26953 1.5664,-0.43359 2.375,-0.37891 -0.16016,1.1875 -2.16016,1.51172 -2.64453,0.37891"
+ id="path1537" />
+ <path
+ style="fill:#1c7361;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 520.125,399.35937 c 0.48828,-0.7539 1.40234,-1.29296 2.375,-1.1875 0.21484,0.54297 0.0547,1.1875 -0.37891,1.56641 -0.7539,0.10938 -1.67187,0.21484 -2.21093,-0.37891"
+ id="path1539" />
+ <path
+ style="fill:#1c7361;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 671.42969,402.92187 c 0.32422,-0.0508 0.64843,0.26954 0.59375,0.59375 -0.0547,0.32422 -0.42969,0.54297 -0.75391,0.4336 -0.48828,-0.53906 -0.97266,-1.13281 -1.45703,-1.72656 0.53906,-0.4336 1.50781,-0.0547 1.61719,0.59375"
+ id="path1541" />
+ <path
+ style="fill:#1c7361;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 524.98437,394.93359 c 0.37891,-0.42968 1.13282,-0.42968 1.56641,-0.0547 -0.70312,0.70312 -1.62109,1.1875 -2.59375,1.51171 -0.10547,-0.59375 0.43359,-1.29296 1.02734,-1.24218"
+ id="path1543" />
+ <path
+ style="fill:#1c7361;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 516.13281,445.13672 c 0.48438,-0.70313 1.78125,-0.4336 1.94141,0.42969 -0.64844,-0.10547 -1.34766,0.10937 -1.78125,0.59375 -0.26953,0.10937 -0.70313,-0.10547 -0.70313,-0.42969 -0.0508,-0.26953 0.27344,-0.59375 0.59375,-0.54297"
+ id="path1545" />
+ <path
+ style="fill:#1c7361;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 547.00781,410.58984 c 0.26953,-0.10937 0.64844,-0.21875 0.91797,-0.10937 0.32422,0.10937 0.48438,0.59375 0.26953,0.80859 -1.02734,0.64844 -2.21484,1.02735 -3.40234,1.08203 0.54297,-0.75781 1.35156,-1.35156 2.21484,-1.78125"
+ id="path1547" />
+ <path
+ style="fill:#1c7361;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 562.92969,579.27344 c 0.54297,0.3789 1.13672,0.75781 1.67578,1.13281 -1.1875,0.48828 -2.58985,0.21875 -3.5625,-0.64453 -0.21485,-0.37891 0.21484,-0.91797 0.59375,-0.91797 0.48437,-0.0547 0.91797,0.21484 1.29297,0.42969"
+ id="path1549" />
+ <path
+ style="fill:#1c7361;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 538.26172,405.62109 c -0.26953,-0.80859 -0.0547,-1.78125 0.59375,-2.375 0.43359,-0.10547 0.86328,-0.42968 1.02734,-0.91797 0.69922,0.26954 1.34766,0.54297 2.05078,0.8125 -1.1875,0.8086 -2.42968,1.61719 -3.67187,2.48047"
+ id="path1551" />
+ <path
+ style="fill:#1c7361;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 511.92187,463.59766 c 0,-0.32422 0,-0.64844 0,-0.97266 0.53907,-0.26953 1.13282,-0.26953 1.61719,-0.0547 -0.96875,1.02735 -1.51172,2.42969 -1.40234,3.83203 -0.59375,-0.42968 -1.24219,-0.91797 -1.89063,-1.34765 0.54297,-0.4336 1.13672,-0.91797 1.73047,-1.40625"
+ id="path1553" />
+ <path
+ style="fill:#1c7361;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 508.35937,415.93359 c 0.21485,-1.67578 1.1875,-3.1875 2.53516,-4.21093 0.37891,-0.26954 0.97266,-0.4336 1.1875,-0.0547 -1.1875,1.1875 -2.16016,2.53515 -2.85937,4.04687 -0.16407,0.27344 -0.59375,0.4336 -0.86329,0.21875"
+ id="path1555" />
+ <path
+ style="fill:#1c7361;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 513.91797,449.39844 c 1.07812,-0.8086 2.10547,-1.61719 3.18359,-2.42969 -0.26953,1.02734 -0.53906,1.94531 -0.80859,2.96875 -0.37891,0.21875 -0.64844,0.59766 -1.02344,0.8125 -0.37891,0.21484 -0.91797,0.26953 -1.1875,-0.10938 -0.21875,-0.3789 0.375,-0.91796 0.59375,-0.53906 -0.21875,-0.21484 -0.48828,-0.43359 -0.75781,-0.70312"
+ id="path1557" />
+ <path
+ style="fill:#1c7361;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 555.05078,407.56641 c -0.10937,0.26953 -0.21484,0.53906 -0.10937,0.86328 -0.86329,0.16015 -1.67188,0.32422 -2.42969,0.48437 -0.10547,0.32422 -0.21485,0.64844 -0.32031,0.97266 -0.64844,-0.0547 -1.29688,-0.0547 -1.89063,-0.0547 -0.53906,-0.26953 0,-1.02344 0.53906,-1.29297 1.07813,-0.54297 2.21485,-0.86719 3.40235,-1.02734 -0.16407,-0.26953 -0.32422,-0.48438 -0.48828,-0.75391 0.86328,-0.70312 1.89062,-1.1875 3.02343,-1.51172 0.21485,0.375 0.26953,0.8086 0.16407,1.23828 -0.37891,0.16407 -0.75782,0.21875 -1.13672,0.10938 0.0547,0.26953 0.10937,0.53906 0.16406,0.86328 -0.37891,0.10938 -0.64844,0.16406 -0.91797,0.10938"
+ id="path1559" />
+ <path
+ style="fill:#1c7361;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 512.83984,412.64062 c 0.42969,-0.26953 1.02344,-0.3789 1.51172,-0.26953 -0.21875,-0.26953 -0.3789,-0.54297 -0.54297,-0.8125 0.54297,-0.10547 1.08203,-0.21484 1.67578,-0.26953 0.21485,-0.53906 0.21485,-1.1875 0,-1.72656 0.59375,-0.0547 1.24219,0.0547 1.78125,0.26953 0.16016,0.21484 0.21485,0.53906 0.16016,0.80859 -0.26953,0.10938 -0.59375,0.21875 -0.91797,0.32422 -0.10547,0.54297 -0.26953,1.08203 -0.375,1.6211 -0.26953,0.16015 -0.70312,0.21484 -1.02734,0.10937 -0.48438,2.91406 -3.67188,4.58594 -4.80469,7.28516 -0.37891,0.91797 -0.75391,2.10547 -1.72656,2.10547 -0.26953,-0.32422 -0.21485,-0.91797 0.16015,-1.1875 -0.375,-0.10938 -0.69921,-0.21485 -1.02343,-0.32422 -0.0547,-0.59375 0.91797,-0.42969 1.40234,-0.0547 0.43359,-0.375 0.0547,-1.24219 -0.48437,-1.24219 0.59375,-0.48437 0.97265,-1.23828 1.07812,-1.99609 0.59375,0.0547 1.1875,-0.16016 1.56641,-0.59375 -0.4336,0.10937 -0.91797,-0.21484 -1.02735,-0.69922 0.86328,0.16016 1.73047,-0.64844 1.67578,-1.51172 0.64844,-0.3789 1.29297,-0.75781 1.94141,-1.13672 -0.26953,-0.16015 -0.64844,-0.42968 -1.02344,-0.69922"
+ id="path1561" />
+ <path
+ style="fill:#1c7361;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 682.38672,415.5 c -1.1875,-1.61719 -2.42969,-3.18359 -3.9375,-4.53516 -2.10547,-1.88672 -4.80469,-3.5625 -5.23828,-6.36718 12.6875,10.74218 22.45703,24.9375 27.90625,40.64453 0.48828,0.43359 -0.0508,1.40625 -0.64453,1.24218 -4.75,-10.95703 -10.85157,-21.42968 -18.08594,-30.98437"
+ id="path1563" />
+ <path
+ style="fill:#1c7361;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 539.88281,406.97266 c 2.21094,-1.78125 4.75,-3.45704 5.66797,-6.15625 0.26953,-0.75391 1.02344,-1.34766 1.72656,-1.78125 10.90235,-6.85547 23.64453,-10.63282 36.48828,-10.84766 -6.42187,1.72656 -12.79296,3.39844 -19.21484,5.12891 -9.98437,2.64453 -17.32812,10.90234 -24.07422,18.78515 -5.83203,6.85547 -11.71484,13.71094 -17.54297,20.61719 -0.70312,1.89062 -1.35156,3.83203 -2.05078,5.72266 -0.26953,0.86328 -0.59375,1.72656 -1.35156,2.26562 -0.69922,0.54297 -1.88672,0.54297 -2.32031,-0.26953 2.58984,-4.53125 5.18359,-9.12109 7.82812,-13.71094 4.21094,-7.125 8.41797,-14.46484 14.84375,-19.7539"
+ id="path1565" />
+ </g>
+</svg>
diff --git a/docs/_static/outputs.gif b/docs/_static/outputs.gif
new file mode 100644
index 0000000000..b2aa061d4c
Binary files /dev/null and b/docs/_static/outputs.gif differ
diff --git a/docs/_static/reactive.gif b/docs/_static/reactive.gif
new file mode 100644
index 0000000000..168a5cb151
Binary files /dev/null and b/docs/_static/reactive.gif differ
diff --git a/docs/_static/readme-ui-form.gif b/docs/_static/readme-ui-form.gif
new file mode 100644
index 0000000000..24c54ba01d
Binary files /dev/null and b/docs/_static/readme-ui-form.gif differ
diff --git a/docs/_static/readme-ui.gif b/docs/_static/readme-ui.gif
new file mode 100644
index 0000000000..a684186fa7
Binary files /dev/null and b/docs/_static/readme-ui.gif differ
diff --git a/docs/_static/readme.gif b/docs/_static/readme.gif
new file mode 100644
index 0000000000..abb0d2a400
Binary files /dev/null and b/docs/_static/readme.gif differ
diff --git a/docs/api/html.md b/docs/api/html.md
new file mode 100644
index 0000000000..67e8f06816
--- /dev/null
+++ b/docs/api/html.md
@@ -0,0 +1,14 @@
+# HTML
+
+All marimo elements extend the HTML element class.
+
+```{eval-rst}
+.. autofunction:: marimo.as_html
+```
+
+```{eval-rst}
+.. autoclass:: marimo.Html
+ :members:
+
+ .. autoclasstoc::
+```
diff --git a/docs/api/index.md b/docs/api/index.md
new file mode 100644
index 0000000000..92a6b81365
--- /dev/null
+++ b/docs/api/index.md
@@ -0,0 +1,27 @@
+# API Reference
+
+```{eval-rst}
+.. toctree::
+ :maxdepth: 1
+ :hidden:
+
+ markdown
+ inputs/index
+ layouts/index
+ html
+ misc
+```
+
+The marimo library comes with UI elements that you can use to make your data
+tangible and build applications. Some elements like sliders and dropdowns are
+interactive and can be used to collect user input and drive execution, while
+others are static and can be used to display or layout information like
+markdown and tabs.
+
+| | |
+| :------------------- | :---------------------------------------------------------------- |
+| {doc}`markdown` | Write markdown with `mo.md` |
+| {doc}`inputs/index` | Seamlessly connect sliders, dropdowns, tables, and more to Python |
+| {doc}`layouts/index` | Customize outputs with accordions, tabs, stacks, and more |
+| {doc}`html` | Working with HTML objects |
+| {doc}`misc` | Miscellaneous utilities |
diff --git a/docs/api/inputs/array.md b/docs/api/inputs/array.md
new file mode 100644
index 0000000000..b626d5ae53
--- /dev/null
+++ b/docs/api/inputs/array.md
@@ -0,0 +1,10 @@
+# Array
+
+<iframe class="demo medium" src="https://components.marimo.io/?component=array" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autoclass:: marimo.ui.array
+ :members:
+
+ .. autoclasstoc:: marimo._plugins.ui._impl.array.array
+```
diff --git a/docs/api/inputs/batch.md b/docs/api/inputs/batch.md
new file mode 100644
index 0000000000..f19e6acf02
--- /dev/null
+++ b/docs/api/inputs/batch.md
@@ -0,0 +1,10 @@
+# Batch
+
+<iframe class="demo medium" src="https://components.marimo.io/?component=batch" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autoclass:: marimo.ui.batch
+ :members:
+
+ .. autoclasstoc:: marimo._plugins.ui._impl.batch.batch
+```
diff --git a/docs/api/inputs/button.md b/docs/api/inputs/button.md
new file mode 100644
index 0000000000..b263884cfa
--- /dev/null
+++ b/docs/api/inputs/button.md
@@ -0,0 +1,10 @@
+# Button
+
+<iframe class="demo" src="https://components.marimo.io/?component=button" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autoclass:: marimo.ui.button
+ :members:
+
+ .. autoclasstoc:: marimo._plugins.ui._impl.input.button
+```
diff --git a/docs/api/inputs/checkbox.md b/docs/api/inputs/checkbox.md
new file mode 100644
index 0000000000..4d1b07a0ed
--- /dev/null
+++ b/docs/api/inputs/checkbox.md
@@ -0,0 +1,10 @@
+# Checkbox
+
+<iframe class="demo" src="https://components.marimo.io/?component=checkbox" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autoclass:: marimo.ui.checkbox
+ :members:
+
+ .. autoclasstoc:: marimo._plugins.ui._impl.input.checkbox
+```
diff --git a/docs/api/inputs/date.md b/docs/api/inputs/date.md
new file mode 100644
index 0000000000..ec72dc0042
--- /dev/null
+++ b/docs/api/inputs/date.md
@@ -0,0 +1,10 @@
+# Date
+
+<iframe class="demo" src="https://components.marimo.io/?component=date" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autoclass:: marimo.ui.date
+ :members:
+
+ .. autoclasstoc:: marimo._plugins.ui._impl.input.date
+```
diff --git a/docs/api/inputs/dictionary.md b/docs/api/inputs/dictionary.md
new file mode 100644
index 0000000000..bfbfbf61e2
--- /dev/null
+++ b/docs/api/inputs/dictionary.md
@@ -0,0 +1,10 @@
+# Dictionary
+
+<iframe class="demo medium" src="https://components.marimo.io/?component=dictionary" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autoclass:: marimo.ui.dictionary
+ :members:
+
+ .. autoclasstoc:: marimo._plugins.ui._impl.dictionary.dictionary
+```
diff --git a/docs/api/inputs/dropdown.md b/docs/api/inputs/dropdown.md
new file mode 100644
index 0000000000..9271d4e751
--- /dev/null
+++ b/docs/api/inputs/dropdown.md
@@ -0,0 +1,10 @@
+# Dropdown
+
+<iframe class="demo" src="https://components.marimo.io/?component=dropdown" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autoclass:: marimo.ui.dropdown
+ :members:
+
+ .. autoclasstoc:: marimo._plugins.ui._impl.input.dropdown
+```
diff --git a/docs/api/inputs/file.md b/docs/api/inputs/file.md
new file mode 100644
index 0000000000..da224c6a0b
--- /dev/null
+++ b/docs/api/inputs/file.md
@@ -0,0 +1,10 @@
+# File
+
+<iframe class="demo medium" src="https://components.marimo.io/?component=file" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autoclass:: marimo.ui.file
+ :members:
+
+ .. autoclasstoc:: marimo._plugins.ui._impl.input.file
+```
diff --git a/docs/api/inputs/form.md b/docs/api/inputs/form.md
new file mode 100644
index 0000000000..42c8c0ee1b
--- /dev/null
+++ b/docs/api/inputs/form.md
@@ -0,0 +1,10 @@
+# Form
+
+<iframe class="demo large" src="https://components.marimo.io/?component=form" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autoclass:: marimo.ui.form
+ :members:
+
+ .. autoclasstoc:: marimo._plugins.ui._impl.input.form
+```
diff --git a/docs/api/inputs/index.md b/docs/api/inputs/index.md
new file mode 100644
index 0000000000..1584a4003b
--- /dev/null
+++ b/docs/api/inputs/index.md
@@ -0,0 +1,56 @@
+# Inputs
+
+```{eval-rst}
+.. toctree::
+ :maxdepth: 1
+ :hidden:
+
+ array
+ batch
+ button
+ checkbox
+ date
+ dictionary
+ dropdown
+ file
+ form
+ multiselect
+ number
+ radio
+ slider
+ switch
+ table
+ text_area
+ text
+```
+
+marimo comes packaged with interactive UI elements that you can use to build
+powerful notebooks and apps. These elements are available in `marimo.ui`.
+
+```{eval-rst}
+.. autosummary::
+ :nosignatures:
+
+ marimo.ui.array
+ marimo.ui.batch
+ marimo.ui.button
+ marimo.ui.checkbox
+ marimo.ui.date
+ marimo.ui.dictionary
+ marimo.ui.dropdown
+ marimo.ui.file
+ marimo.ui.form
+ marimo.ui.multiselect
+ marimo.ui.number
+ marimo.ui.radio
+ marimo.ui.slider
+ marimo.ui.switch
+ marimo.ui.table
+ marimo.ui.text_area
+ marimo.ui.text
+```
+
+To use a UI element, assign it to a global variable and output it in a cell.
+When you interact with the frontend element, the Python object's `value`
+attribute is automatically updated, and all cells referencing that object
+automatically run with the element's latest value.
diff --git a/docs/api/inputs/multiselect.md b/docs/api/inputs/multiselect.md
new file mode 100644
index 0000000000..0fb2b60636
--- /dev/null
+++ b/docs/api/inputs/multiselect.md
@@ -0,0 +1,10 @@
+# Multiselect
+
+<iframe class="demo" src="https://components.marimo.io/?component=multiselect" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autoclass:: marimo.ui.multiselect
+ :members:
+
+ .. autoclasstoc:: marimo._plugins.ui._impl.input.multiselect
+```
diff --git a/docs/api/inputs/number.md b/docs/api/inputs/number.md
new file mode 100644
index 0000000000..ed36b78716
--- /dev/null
+++ b/docs/api/inputs/number.md
@@ -0,0 +1,10 @@
+# Number
+
+<iframe class="demo" src="https://components.marimo.io/?component=number" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autoclass:: marimo.ui.number
+ :members:
+
+ .. autoclasstoc:: marimo._plugins.ui._impl.input.number
+```
diff --git a/docs/api/inputs/radio.md b/docs/api/inputs/radio.md
new file mode 100644
index 0000000000..d7fe9a76dc
--- /dev/null
+++ b/docs/api/inputs/radio.md
@@ -0,0 +1,10 @@
+# Radio
+
+<iframe class="demo" src="https://components.marimo.io/?component=radio" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autoclass:: marimo.ui.radio
+ :members:
+
+ .. autoclasstoc:: marimo._plugins.ui._impl.input.radio
+```
diff --git a/docs/api/inputs/slider.md b/docs/api/inputs/slider.md
new file mode 100644
index 0000000000..dddd2f3a8c
--- /dev/null
+++ b/docs/api/inputs/slider.md
@@ -0,0 +1,10 @@
+# Slider
+
+<iframe class="demo" src="https://components.marimo.io/?component=slider" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autoclass:: marimo.ui.slider
+ :members:
+
+ .. autoclasstoc:: marimo._plugins.ui._impl.input.slider
+```
diff --git a/docs/api/inputs/switch.md b/docs/api/inputs/switch.md
new file mode 100644
index 0000000000..07e6d51c38
--- /dev/null
+++ b/docs/api/inputs/switch.md
@@ -0,0 +1,10 @@
+# Switch
+
+<iframe class="demo" src="https://components.marimo.io/?component=switch" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autoclass:: marimo.ui.switch
+ :members:
+
+ .. autoclasstoc:: marimo._plugins.ui._impl.switch.switch
+```
diff --git a/docs/api/inputs/table.md b/docs/api/inputs/table.md
new file mode 100644
index 0000000000..d7e7fce7b1
--- /dev/null
+++ b/docs/api/inputs/table.md
@@ -0,0 +1,10 @@
+# Table
+
+<iframe class="demo medium" src="https://components.marimo.io/?component=table" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autoclass:: marimo.ui.table
+ :members:
+
+ .. autoclasstoc:: marimo._plugins.ui._impl.input.table
+```
diff --git a/docs/api/inputs/text.md b/docs/api/inputs/text.md
new file mode 100644
index 0000000000..262cf638f6
--- /dev/null
+++ b/docs/api/inputs/text.md
@@ -0,0 +1,10 @@
+# Text
+
+<iframe class="demo" src="https://components.marimo.io/?component=text" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autoclass:: marimo.ui.text
+ :members:
+
+ .. autoclasstoc:: marimo._plugins.ui._impl.input.text
+```
diff --git a/docs/api/inputs/text_area.md b/docs/api/inputs/text_area.md
new file mode 100644
index 0000000000..e7bb51c59a
--- /dev/null
+++ b/docs/api/inputs/text_area.md
@@ -0,0 +1,10 @@
+# Text Area
+
+<iframe class="demo" src="https://components.marimo.io/?component=text_area" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autoclass:: marimo.ui.text_area
+ :members:
+
+ .. autoclasstoc:: marimo._plugins.ui._impl.input.text_area
+```
diff --git a/docs/api/layouts/accordion.md b/docs/api/layouts/accordion.md
new file mode 100644
index 0000000000..585a5ebdd6
--- /dev/null
+++ b/docs/api/layouts/accordion.md
@@ -0,0 +1,7 @@
+# Accordion
+
+<iframe class="demo large" src="https://components.marimo.io/?component=accordion" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autofunction:: marimo.accordion
+```
diff --git a/docs/api/layouts/callout.md b/docs/api/layouts/callout.md
new file mode 100644
index 0000000000..72c60a3b8b
--- /dev/null
+++ b/docs/api/layouts/callout.md
@@ -0,0 +1,7 @@
+# Callout
+
+<iframe class="demo large" src="https://components.marimo.io/?component=callout" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autofunction:: marimo.callout
+```
diff --git a/docs/api/layouts/index.md b/docs/api/layouts/index.md
new file mode 100644
index 0000000000..74d812d1f4
--- /dev/null
+++ b/docs/api/layouts/index.md
@@ -0,0 +1,29 @@
+# Layouts
+
+```{eval-rst}
+.. toctree::
+ :maxdepth: 1
+ :hidden:
+
+ accordion
+ callout
+ stacks
+ tabs
+ tree
+```
+
+marimo has higher-order layout elements. Unlike elements in `marimo.ui`, these
+don't have any values associated with them but just render their children in a
+certain way.
+
+```{eval-rst}
+.. autosummary::
+ :nosignatures:
+
+ marimo.accordion
+ marimo.callout
+ marimo.hstack
+ marimo.vstack
+ marimo.tabs
+ marimo.tree
+```
diff --git a/docs/api/layouts/stacks.md b/docs/api/layouts/stacks.md
new file mode 100644
index 0000000000..4855b14159
--- /dev/null
+++ b/docs/api/layouts/stacks.md
@@ -0,0 +1,11 @@
+# Stacks
+
+<iframe class="demo large" src="https://components.marimo.io/?component=stacks" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autofunction:: marimo.hstack
+```
+
+```{eval-rst}
+.. autofunction:: marimo.vstack
+```
diff --git a/docs/api/layouts/tabs.md b/docs/api/layouts/tabs.md
new file mode 100644
index 0000000000..cd9a3e0621
--- /dev/null
+++ b/docs/api/layouts/tabs.md
@@ -0,0 +1,7 @@
+# Tabs
+
+<iframe class="demo large" src="https://components.marimo.io/?component=tabs" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autofunction:: marimo.tabs
+```
diff --git a/docs/api/layouts/tree.md b/docs/api/layouts/tree.md
new file mode 100644
index 0000000000..208ad498af
--- /dev/null
+++ b/docs/api/layouts/tree.md
@@ -0,0 +1,7 @@
+# Tree
+
+<iframe class="demo large" src="https://components.marimo.io/?component=tree" frameborder="no"></iframe>
+
+```{eval-rst}
+.. autofunction:: marimo.tree
+```
diff --git a/docs/api/markdown.md b/docs/api/markdown.md
new file mode 100644
index 0000000000..e4d2b0218a
--- /dev/null
+++ b/docs/api/markdown.md
@@ -0,0 +1,9 @@
+# Markdown
+
+Write markdown with `mo.md`; make your markdown **interactive**, **dynamic**,
+and **visually rich** by interpolating arbitrary Python values and marimo
+elements .
+
+```{eval-rst}
+.. autofunction:: marimo.md
+```
diff --git a/docs/api/misc.md b/docs/api/misc.md
new file mode 100644
index 0000000000..28ff2e66ae
--- /dev/null
+++ b/docs/api/misc.md
@@ -0,0 +1,12 @@
+# Misc
+
+Use `mo.defs` and `mo.refs` to get the global definitions and references of
+a cell.
+
+```{eval-rst}
+.. autofunction:: marimo.defs
+```
+
+```{eval-rst}
+.. autofunction:: marimo.refs
+```
diff --git a/docs/apps/embedding_numbers.py b/docs/apps/embedding_numbers.py
new file mode 100644
index 0000000000..0f7e59ae10
--- /dev/null
+++ b/docs/apps/embedding_numbers.py
@@ -0,0 +1,167 @@
+import marimo
+
+__generated_with = "0.0.5"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md(
+ """# Embedding MNIST
+
+ This app shows how to use the function `pymde.preserve_neighbors`
+ to produce embeddings that highlight the local structure of your
+ data, using MNIST as a case study. In these embeddings similar
+ digits are near each other, and dissimilar digits are not near each other.
+
+ ## Data
+ The data we'll embed are 70,000 28x28 grayscale images of handwritten
+ digits:
+ """
+ )
+ return
+
+
+def __(button, show_random_images):
+ button
+
+ show_random_images(5)
+ return
+
+
+def __(mo):
+ button = mo.ui.button(label="Click this button")
+ mo.md(f"{button} _to view another random sample of images._").center()
+ return button,
+
+
+def __(mo):
+ params = (
+ mo.md(
+ """
+ ### Try these controls <span style="font-size: 28px">🎮</span>
+ Here are some parameters you can play around with to control the
+ embedding.
+
+ - embedding dimension (2 or 3): {embedding_dimension}
+ - constraint: {constraint_type}
+ """
+ )
+ .batch(
+ embedding_dimension=mo.ui.slider(2, 3, value=2),
+ constraint_type=mo.ui.dropdown(
+ ("Centered", "Standardized"), value="Centered"
+ ),
+ )
+ .form()
+ )
+
+ params
+ return params,
+
+
+def __(params):
+ if params.value is not None:
+ embedding_dimension, constraint_type = (
+ params.value["embedding_dimension"],
+ params.value["constraint_type"],
+ )
+ else:
+ embedding_dimension, constraint_type = None, None
+ return constraint_type, embedding_dimension
+
+
+def __(constraint_type, pymde):
+ if constraint_type is not None:
+ _constraints = {
+ "Centered": pymde.Centered(),
+ "Standardized": pymde.Standardized(),
+ }
+
+ constraint = _constraints[constraint_type]
+ return constraint,
+
+
+def __(
+ compute_embedding,
+ constraint,
+ embedding_dimension,
+ mnist,
+ plt,
+ pymde,
+):
+ def show_embedding():
+ _, embedding = compute_embedding(embedding_dimension, constraint)
+ pymde.plot(embedding, color_by=mnist.attributes["digits"])
+ plt.tight_layout()
+ return plt.gca()
+
+
+ show_embedding() if embedding_dimension is not None else None
+ return show_embedding,
+
+
+def __(mnist, pymde, torch):
+ embedding_cache = {}
+
+
+ def compute_embedding(embedding_dim, constraint):
+ key = (embedding_dim, constraint)
+ if key in embedding_cache:
+ return embedding_cache[key]
+
+ mde = pymde.preserve_neighbors(
+ mnist.data,
+ embedding_dim=embedding_dim,
+ constraint=constraint,
+ device="cuda" if torch.cuda.is_available() else "cpu",
+ verbose=True,
+ )
+ X = mde.embed(verbose=True)
+ value = (mde, X)
+ embedding_cache[key] = value
+ return value
+ return compute_embedding, embedding_cache
+
+
+def __(pymde):
+ mnist = pymde.datasets.MNIST()
+ return mnist,
+
+
+def __(mnist, plt, torch):
+ def show_random_images(n_images):
+ indices = torch.randperm(mnist.data.shape[0])[:n_images]
+ images = mnist.data[indices].reshape((-1, 28, 28))
+ fig, axes = plt.subplots(1, n_images)
+ fig.set_size_inches(6.5, 1.5)
+ for im, ax in zip(images, axes.flat):
+ ax.imshow(im, cmap="gray")
+ ax.set_yticks([])
+ ax.set_xticks([])
+ plt.tight_layout()
+ return fig
+ return show_random_images,
+
+
+def __():
+ import matplotlib.pyplot as plt
+ import pymde
+ import torch
+
+ import marimo as mo
+ return mo, plt, pymde, torch
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/docs/apps/intro.py b/docs/apps/intro.py
new file mode 100644
index 0000000000..0bb9ae6b5f
--- /dev/null
+++ b/docs/apps/intro.py
@@ -0,0 +1,63 @@
+import marimo
+
+__generated_with = "0.0.6"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# Welcome to marimo! 🌊🍃")
+ return
+
+
+def __(mo):
+ slider = mo.ui.slider(1, 22)
+ return slider,
+
+
+def __(mo, slider):
+ mo.md(
+ f"""
+ marimo is a Python library for creating reactive and interactive
+ notebooks and apps.
+
+ Unlike traditional notebooks, marimo notebooks **run
+ automatically** when you modify them or
+ interact with UI elements, like this slider: {slider}.
+
+ {"##" + "🍃" * slider.value}
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.accordion(
+ {
+ "A notebook or an app?": (
+ """
+ Because marimo notebooks react to changes and UI interactions,
+ they can also be thought of as apps: click
+ the app window icon to see an "app view" that
+ hides code.
+
+ Depending on how you use marimo, you can think
+ of marimo programs as notebooks, apps, or both.
+ """
+ )
+ }
+ )
+ return
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/docs/apps/output.py b/docs/apps/output.py
new file mode 100644
index 0000000000..28b07f158b
--- /dev/null
+++ b/docs/apps/output.py
@@ -0,0 +1,162 @@
+import marimo
+
+__generated_with = "0.0.6"
+app = marimo.App()
+
+
+def __(tabs):
+ tabs
+ return
+
+
+def __(array, ax, dictionary, mo, plots, table, text):
+ tabs = mo.tabs(
+ {
+ "markdown": mo.md(
+ """
+ Use `mo.md` to write markdown, with support for LaTeX:
+
+ \[
+ e = \sum_{k=0}^{\infty} 1/k!.
+ \]
+ """
+ + f"""
+ You can even interpolate arbitrary Python values and marimo
+ elements into your markdown. Try typing your name below:
+
+ {mo.hstack([
+ text, mo.md("Hello, " + text.value + "!")
+ ], justify="center")}
+ """
+ ).left(),
+ "lists and dicts": mo.hstack(
+ [array, dictionary], justify="space-around"
+ ),
+ "tables": mo.md(
+ f"""
+ {table}
+
+ Employee of the month: {table.value[0]["first_name"] + "! 🎉" if table.value else ""}
+ """
+ ),
+ "accordion": mo.accordion(
+ {
+ "Tip!": f"""
+ Express yourself with outputs! Put anything in accordions,
+ like plots:
+
+ {mo.as_html(ax)}.
+ """
+ }
+ ),
+ "rows and columns": plots,
+ "and more ...": mo.md(
+ "**Build anything you can imagine**. Check out our tutorials and examples for inspiration."
+ ),
+ }
+ )
+ return tabs,
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+def __(mo):
+ text = mo.ui.text(value="stranger")
+ return text,
+
+
+def __(mo):
+ slider = mo.ui.slider(2, 4, step=1)
+ return slider,
+
+
+def __(plt, slider, x):
+ plt.figure(figsize=(2, 2))
+ plt.plot(x, x**slider.value)
+ ax = plt.gca()
+ ax.set_xticks([])
+ ax.set_yticks([])
+ None
+ return ax,
+
+
+def __(ax, mo, slider):
+ array = [slider, mo.md(f"$f(x) = x^{slider.value}$"), ax]
+ return array,
+
+
+def __(array, mo):
+ dictionary = {"md": mo.md("nest lists and dicts!"), "list": array}
+ return dictionary,
+
+
+def __(mo):
+ table = mo.ui.table(
+ [
+ {
+ "first_name": "Michael",
+ "last_name": "Scott",
+ "ability": mo.ui.slider(1, 10, value=3),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Jim",
+ "last_name": "Halpert",
+ "ability": mo.ui.slider(1, 10, value=7),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ ],
+ selection="single"
+ )
+ return table,
+
+
+def __(mo, np, plt):
+ def plot(x, y, title):
+ plt.figure(figsize=(2, 2))
+ plt.plot(x, y)
+ plt.title(title)
+ plt.tight_layout()
+ return plt.gca()
+
+ x = np.linspace(-2, 2, 100)
+ linear = plot(x, x, "$x$")
+ quadratic = plot(x, x**2, "$x^2$")
+ sine = plot(x, np.sin(x), "$\sin(x)$")
+ cos = plot(x, np.cos(x), "$\cos(x)$")
+ exp = plot(x, np.exp(x), "$\exp(x)$")
+
+ plots = mo.vstack([
+ mo.hstack([linear, quadratic]),
+ mo.hstack([sine, cos, exp])
+ ], align="center")
+ return cos, exp, linear, plot, plots, quadratic, sine, x
+
+
+def __():
+ import numpy as np
+ return np,
+
+
+def __():
+ import matplotlib.pyplot as plt
+ return plt,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/docs/apps/readme_ui.py b/docs/apps/readme_ui.py
new file mode 100644
index 0000000000..d7f1a22112
--- /dev/null
+++ b/docs/apps/readme_ui.py
@@ -0,0 +1,46 @@
+import marimo
+
+__generated_with = "0.0.13"
+app = marimo.App()
+
+
+def __(mo):
+ x = mo.ui.slider(1, 9)
+ x
+ return x,
+
+
+def __(math, mo, x):
+ mo.md(f"$e^{x.value} = {math.exp(x.value):0.3f}$")
+ return
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+def __(mo):
+ form = mo.ui.slider(1, 9).form()
+ form
+ return form,
+
+
+def __(form, mo):
+ mo.md(f"The last submitted value is **{form.value}**")
+ return
+
+
+def __():
+ import math
+ return math,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000000..d05cf4911f
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,125 @@
+# Configuration file for the Sphinx documentation builder.
+#
+# For the full list of built-in configuration values, see the documentation:
+# https://www.sphinx-doc.org/en/master/usage/configuration.html
+
+# -- Project information -----------------------------------------------------
+# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
+
+import datetime
+import os
+import sys
+
+# If modules to document with autodoc (or sphinx extensions) are in another
+# directory, add these directories to sys.path here. If the directory is
+# relative to the documentation root, use os.path.abspath to make it absolute,
+# like shown here.
+#
+# To import marimo:
+sys.path.insert(0, os.path.abspath(".."))
+# To import helpers
+sys.path.insert(0, os.path.abspath("."))
+
+from helpers.md2rst import md2rst
+from helpers.sections import PublicMethods
+from helpers.copy_readme import ReadmePartDirective
+
+import marimo
+
+project = "marimo"
+copyright = f"{datetime.datetime.now().year}, marimo-team"
+author = "marimo-team"
+release = marimo.__version__
+
+# -- General configuration ---------------------------------------------------
+# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
+
+extensions = [
+ # Write source in markdown, not rst
+ "myst_parser",
+ # For API docs
+ "sphinx.ext.autodoc",
+ "sphinx.ext.autosummary",
+ "sphinx_copybutton",
+ "sphinx_new_tab_link",
+ # To generate tables of inherited members
+ "autoclasstoc",
+]
+
+
+autoclasstoc_sections = [
+ PublicMethods.key,
+ "public-attrs",
+]
+
+# Group symbols by the order they appear in source
+autodoc_member_order = "bysource"
+
+templates_path = ["_templates"]
+exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
+
+
+# -- Options for HTML output -------------------------------------------------
+# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
+
+html_theme = "furo"
+html_static_path = ["_static"]
+html_favicon = "_static/favicon-32x32.png"
+html_css_files = [
+ # Font Awesome
+ "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/fontawesome.min.css",
+ "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/solid.min.css",
+ "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/brands.min.css",
+ # Inter font
+ "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=block",
+ # Fira Mono font
+ "https://fonts.googleapis.com/css2?family=Fira+Mono&display=block",
+ "css/custom.css",
+]
+html_js_files = [
+ "js/analytics.js",
+]
+html_title = f"{project}"
+html_theme_options = {
+ "sidebar_hide_name": True,
+ "light_logo": "marimo-logotype-thick.svg",
+ "dark_logo": "marimo-logotype-thick.svg",
+ # Show edit on github button
+ "source_repository": "https://github.com/marimo-team/marimo",
+ "source_branch": "main",
+ "source_directory": "docs/",
+ "light_css_variables": {
+ "color-brand-primary": "#1C7362",
+ "color-brand-content": "#1C7362",
+ },
+ "light_css_variables": {
+ "font-stack": "Inter, sans-serif",
+ "font-stack--monospace": "Fira Mono",
+ "code-font-size": "0.875rem",
+ },
+ "footer_icons": [
+ {
+ "name": "GitHub",
+ "url": "https://github.com/marimo-team/marimo",
+ "html": "",
+ "class": "fa-brands fa-solid fa-github fa-2x",
+ },
+ {
+ "name": "Discord",
+ "url": "https://discord.gg/JE7nhX6mD8",
+ "html": "",
+ "class": "fa-brands fa-solid fa-discord fa-2x",
+ }
+ ],
+}
+
+pygments_style = "monokai"
+pygments_dark_style = "monokai"
+
+
+# -- Hooks -------------------------------------------------------------------
+# https://www.sphinx-doc.org/en/master/extdev/appapi.html#events
+def setup(app):
+ # https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#docstring-preprocessing
+ app.connect("autodoc-process-docstring", md2rst)
+ app.add_directive('readmepart', ReadmePartDirective)
diff --git a/docs/getting_started/examples.md b/docs/getting_started/examples.md
new file mode 100644
index 0000000000..520e22c0a8
--- /dev/null
+++ b/docs/getting_started/examples.md
@@ -0,0 +1,5 @@
+# Examples
+
+```{eval-rst}
+.. readmepart:: Examples
+```
diff --git a/docs/getting_started/faq.md b/docs/getting_started/faq.md
new file mode 100644
index 0000000000..fd83455d53
--- /dev/null
+++ b/docs/getting_started/faq.md
@@ -0,0 +1,5 @@
+# FAQ
+
+```{eval-rst}
+.. readmepart:: FAQ
+```
diff --git a/docs/getting_started/index.md b/docs/getting_started/index.md
new file mode 100644
index 0000000000..a6a9d84c86
--- /dev/null
+++ b/docs/getting_started/index.md
@@ -0,0 +1,5 @@
+# Getting Started
+
+```{eval-rst}
+.. readmepart:: Getting Started
+```
diff --git a/docs/guides/apps.md b/docs/guides/apps.md
new file mode 100644
index 0000000000..a0ab52dc43
--- /dev/null
+++ b/docs/guides/apps.md
@@ -0,0 +1,21 @@
+# Apps
+
+The marimo CLI lets you run any notebook as an app: `marimo run` hides the
+notebook's code and starts a web server that hosts the resulting app.
+
+```
+Usage: marimo run [OPTIONS] NAME
+
+ Run as an app in read-only mode.
+
+ If NAME is a url, the app will be downloaded to a temporary file.
+
+ Example:
+
+ * marimo run your_app.py
+
+Options:
+ -p, --port INTEGER Port to attach to.
+ --headless Don't launch a browser.
+ --help Show this message and exit.
+```
diff --git a/docs/guides/best_practices.md b/docs/guides/best_practices.md
new file mode 100644
index 0000000000..2fb7333b69
--- /dev/null
+++ b/docs/guides/best_practices.md
@@ -0,0 +1,48 @@
+# Best Practices
+
+The few constraints marimo puts on your notebooks are natural consequences of
+the fact that marimo programs are directed acyclic graphs. As long as you keep
+this fact in mind, you'll quickly adapt to the marimo way of writing notebooks
+and apps. You'll also find yourself writing better, more reproducible code.
+
+Follow these tips to stay on the marimo way:
+
+**Use global variables sparingly.** Keep the number of global variables in your
+program small to avoid name collisions.
+
+**Use descriptive names.** Use descriptive variable names, especially for
+global variables. This will help you minimize name clashes, and will also
+result in better code.
+
+**Use functions.**
+Encapsulate logic into functions to avoid polluting the global namespace with
+temporary or intermediate variables, and to avoid code duplication.
+
+**Use Python modules.** If your notebook gets too long, split complex logic
+into helper Python modules and import them into your notebook.
+
+**Minimize mutations.** marimo does not track mutations to objects. Try to
+only mutate an object in the cell that creates it, or create new objects
+instead of mutating existing ones.
+
+**Write idempotent cells.** Write cells whose outputs and behavior are the same
+when given the same inputs (references); such cells are called idempotent. This
+will help you avoid bugs and cache expensive intermediate computations.
+
+**Cache computations with `@functools.cache`.** Use Python's builtin
+`functools` library to cache expensive computations.
+
+For example,
+
+```python
+import functools
+
+def compute_predictions(problem_parameters):
+ ...
+```
+
+Whenever `compute_predictions` is called with a value of `problem_parameters`
+it has not seen, it will compute the predictions and store them in a cache. The
+next time it is called with the same parameters, instead of recomputing the
+predictions, it will return the previously computed value from the cache.
diff --git a/docs/guides/index.md b/docs/guides/index.md
new file mode 100644
index 0000000000..8b3ed13ebd
--- /dev/null
+++ b/docs/guides/index.md
@@ -0,0 +1,31 @@
+# Guides
+
+```{eval-rst}
+.. toctree::
+ :maxdepth: 2
+ :hidden:
+
+ overview
+ reactivity
+ interactivity
+ outputs
+ apps
+ best_practices
+```
+
+_The best way to learn marimo is to use it._ marimo even comes packaged
+with tutorials that you can launch at the command line using the `marimo
+tutorial` command.
+
+If you prefer reading docs, the guides below are a thorough walkthrough
+of marimo's core concepts.
+
+| | |
+| :-------------------- | :---------------------------------------- |
+| {doc}`overview` | An overview of basic concepts |
+| {doc}`reactivity` | How reactive execution works |
+| {doc}`interactivity` | Using interactive UI elements |
+| {doc}`outputs` | Markdown, plots, and other visual outputs |
+| {doc}`apps` | Running notebooks as apps |
+| {doc}`best_practices` | Best practices when working with marimo |
+
diff --git a/docs/guides/interactivity.md b/docs/guides/interactivity.md
new file mode 100644
index 0000000000..8c0d9cbb04
--- /dev/null
+++ b/docs/guides/interactivity.md
@@ -0,0 +1,77 @@
+# Interactivity
+
+One of marimo's most powerful features is its first-class support for
+interactive, stateful user interface (UI) elements: create them using
+[`marimo.ui`](/api/inputs/index/). **Interacting with a UI element bound to a
+global variable automatically runs all cells that reference it.**
+
+<div align="center">
+<figure>
+<img src="/_static/readme-ui.gif"/>
+</figure>
+</div>
+
+## How interactions run cells
+
+Every UI element you make using `marimo.ui` has a value, accessible via its
+`value` attribute. When you interact with a UI element bound to a global
+variable, its value is sent back to Python. A single rule determines what
+happens next:
+
+```{admonition} Interaction rule
+:class: tip
+
+When a UI element assigned to a global variable is interacted with, marimo
+automatically runs all cells that reference the variable (but don't define it).
+```
+
+In the clip at the top of this page, interacting with the slider in the
+second cell re-runs the third cell (which outputs markdown) because it
+references the slider variable `x`. It doesn't re-run the second cell, because
+that cell defines `x`.
+
+**For interactions on a UI element to have any effect, the element must be
+assign to a global variable.**
+
+## Displaying UI elements
+
+Display UI elements in the output area above a cell by including them in the
+last expression, just like any other object. You can also embed elements
+in [markdown](#marimo.md) using Python f-strings, like so:
+
+```python3
+slider = mo.ui.slider(1, 10)
+mo.md(f"Choose a value: {slider})")
+```
+
+## Composite elements
+
+Composite elements are advanced elements let you build UI elements out of other
+UI elements. The following composite elements are available:
+
+- [`mo.ui.form`](#marimo.ui.form)
+- [`mo.ui.array`](#marimo.ui.array)
+- [`mo.ui.dictionary`](#marimo.ui.dictionary)
+- [`mo.ui.batch`](#marimo.ui.batch)
+
+Use these powerful elements to gate the sending of value on form submission
+or logically group together related elements. These elements are especially
+useful when a set of UI elements is only known at runtime (so you can't
+assign each to a global variable individually, but can assign them to
+an array or dictionary).
+
+<div align="center">
+<figure>
+<img src="/_static/readme-ui-form.gif"/>
+<figcaption>Use a form to gate value updates on submission</figcaption>
+</figure>
+</div>
+
+<div align="center">
+<figure>
+<img src="/_static/array.png" width="700px"/>
+<figcaption>Use an array to group together elements or create a collection of elements that is determined at runtime</figcaption>
+</figure>
+</div>
+
+
diff --git a/docs/guides/outputs.md b/docs/guides/outputs.md
new file mode 100644
index 0000000000..09b1570b81
--- /dev/null
+++ b/docs/guides/outputs.md
@@ -0,0 +1,13 @@
+# Outputs
+
+The last expression of a cell is its visual output, rendered above the cell.
+Outputs are included in the "app" or read-only view of the notebook. marimo
+comes out of the box a number of elements to help you make rich outputs,
+documented in the [API reference](/api/index/).
+
+
+<div align="center">
+<figure>
+<img src="/_static/outputs.gif"/>
+</figure>
+</div>
diff --git a/docs/guides/overview.md b/docs/guides/overview.md
new file mode 100644
index 0000000000..2b344dab85
--- /dev/null
+++ b/docs/guides/overview.md
@@ -0,0 +1,5 @@
+# Overview
+
+```{eval-rst}
+.. readmepart:: Concepts
+```
diff --git a/docs/guides/reactivity.md b/docs/guides/reactivity.md
new file mode 100644
index 0000000000..6e5a2639bf
--- /dev/null
+++ b/docs/guides/reactivity.md
@@ -0,0 +1,130 @@
+# Reactivity
+
+marimo notebooks _react_ to your code changes. Reactive execution is based
+on a single rule:
+
+```{admonition} Runtime Rule
+:class: tip
+
+When a cell is run, marimo automatically runs all other cells that
+**reference** any of the global variables it **defines**.
+```
+
+To provide reactive execution, marimo creates a directed acyclic graph
+(DAG) out of your cells. Execution order is determined by the DAG, not by the
+order of cells on the page.
+
+## References and definitions
+A marimo notebook is a DAG where nodes are cells and edges are
+data dependencies. marimo creates this graph by analyzing each cell, without
+running it, to determine its
+
+- references, the global variables it reads but doesn't define;
+- definitions, the global variables it defines.
+
+```{admonition} Global variables
+:class: tip
+
+A global variable can refer to any Python object. In particular, functions,
+classes, and imported names can all count as global variables.
+```
+
+
+There is an edge from one cell to another if the latter cell references any
+global variables defined by the former cell. The rule for reactive execution
+can be restated in terms of the graph: when a cell is run, its descendants are
+run automatically.
+
+
+## Global variable names must be unique
+
+To make sure your notebook is DAG, marimo requires that every global
+variable be defined by only one cell.
+
+```{admonition} Local variables
+:class: note
+
+Variables prefixed with an underscore are local to a cell (_.e.g._, `_x`). You
+can use this in a pinch to fix multiple definition errors, but try instead to
+refactor your code.
+```
+
+This rule encourages you to keep the number of global variables in your
+program small, which is generally considered good practice.
+
+## No hidden state
+
+Traditional notebooks like Jupyter have _hidden state_: running a cell may
+change the values of global variables, but these changes are not propagated to
+the cells that use them. Worse, deleting a cell removes global
+variables from visible code but _not_ from program memory, a common
+source of bugs. The problem of hidden state has been discussed by
+many others
+[[1]](https://austinhenley.com/pubs/Chattopadhyay2020CHI_NotebookPainpoints.pdf)
+[[2]](https://docs.google.com/presentation/d/1n2RlMdmv1p25Xy5thJUhkKGvjtV-dkAIsUXP-AL4ffI/edit#slide=id.g362da58057_0_1).
+
+**marimo eliminates the problem of hidden state**: running
+a cell automatically refreshes downstream outputs, and _deleting a cell
+deletes its global variables from program memory_.
+
+<div align="center">
+<figure>
+<img src="/_static/docs-delete-cell.gif"/>
+<figcaption>No hidden state: deleting a cell deletes its variables.</figcaption>
+</figure>
+</div>
+
+## Mutations and attributes not tracked
+
+marimo's reactive execution is based only on the global variables a cell reads
+and the global variables it defines. In particular, _marimo does not track
+mutations to objects_, _i.e._, mutations don't trigger reactive re-runs of
+other cells. It also does not track the definition or mutation of object
+attributes.
+
+If you must mutate a variable in a downstream cell, try creating a new variable
+instead.
+
+_Don't_ do this:
+```python
+l = [1]
+```
+
+```python
+l.append(2)
+```
+
+```python
+l
+```
+
+_Instead_, do this:
+
+```python
+l = [1]
+```
+
+```python
+ll = [1, 2]
+```
+
+```python
+ll
+```
+
+```{admonition} Why not track mutations?
+:class: note
+
+Tracking mutations is fundamentally error-prone, with steep usability cliffs. The
+simplicity of marimo's static analysis approach makes marimo easier to
+understand, and encourages well-organized notebook code.
+```
+
+## Local variables
+
+Global variables prefixed with an underscore are "local" to a cell: they can't
+be read by other cells. Multiple cells can reuse the same local variables
+names.
+
+If you encapsulate your code using functions and classes when needed,
+you likely won't need to use many local variables, if any.
diff --git a/docs/helpers/__init__.py b/docs/helpers/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/docs/helpers/copy_readme.py b/docs/helpers/copy_readme.py
new file mode 100644
index 0000000000..36bc38769a
--- /dev/null
+++ b/docs/helpers/copy_readme.py
@@ -0,0 +1,42 @@
+from docutils.parsers.rst import Directive
+import re
+import os
+from myst_parser.docutils_ import Parser
+
+
+class ReadmePartDirective(Directive):
+ required_arguments = 1
+ optional_arguments = 0
+ final_argument_whitespace = True
+ has_content = False
+
+ def run(self):
+ header = self.arguments[0]
+
+ # Read and parse the README.md file
+ current_dir = os.path.dirname(os.path.realpath(__file__))
+ readme = os.path.join(current_dir, '..', '..', 'README.md')
+ with open(readme, 'r') as file:
+ content = file.read()
+
+ # Find the header
+ header_pattern = r'#{1,6} ' + re.escape(header)
+ match = re.search(header_pattern, content, re.IGNORECASE)
+ if not match:
+ return []
+ level = match.group(0).count('#')
+ next_header_with_same_level = r'\n#{' + str(level) + r'} '
+ next_match = re.search(next_header_with_same_level, content[match.end():], re.IGNORECASE)
+
+ stripped_content = ''
+ if match:
+ # Extract everything below the header, up to the next header
+ if next_match and next_match.group(0):
+ stripped_content = content[match.end():match.end() + next_match.start()].strip()
+ else:
+ stripped_content = content[match.end():].strip()
+
+ # Update asset links, add a leading slash if needed
+ stripped_content = stripped_content.replace("/docs/_static/", "/_static/").replace("docs/_static/", "/_static/")
+ Parser().parse(stripped_content, self.state.document)
+ return []
diff --git a/docs/helpers/md2rst.py b/docs/helpers/md2rst.py
new file mode 100644
index 0000000000..0c19832e18
--- /dev/null
+++ b/docs/helpers/md2rst.py
@@ -0,0 +1,13 @@
+import pypandoc
+
+
+# Convert markdown docstrings to RST.
+#
+# LaTeX written with single or double $ is supported, but not with \[ \],
+# as per Pandoc Markdown syntax.
+def md2rst(app, what, name, obj, options, lines):
+ del app, what, name, obj, options
+ md = "\n".join(lines)
+ rst = pypandoc.convert_text(md, "rst", format="md")
+ lines.clear()
+ lines += rst.splitlines()
diff --git a/docs/helpers/sections.py b/docs/helpers/sections.py
new file mode 100644
index 0000000000..9fe0a99f05
--- /dev/null
+++ b/docs/helpers/sections.py
@@ -0,0 +1,10 @@
+from autoclasstoc import Section, is_method
+
+
+class PublicMethods(Section):
+ key = "public-methods-no-dunder"
+ title = "Public methods"
+
+ def predicate(self, name, attr, meta):
+ del meta
+ return is_method(name, attr) and not name.startswith("_")
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 0000000000..9b135f9a5d
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,72 @@
+<p align="center" style="margin-top: 40px; margin-bottom: 40px;">
+ <img src="_static/marimo-logotype-thick.svg" width="210px">
+</p>
+
+**marimo** is a Python library for creating **reactive notebooks
+that double as apps**. marimo is:
+
+- **reactive**: run a cell and marimo automatically runs cells that depend on it
+- **interactive**: interact with sliders, tables, and more to run cells
+- **reproducible**: no hidden state
+- **simple**: no complicated callbacks, no magical syntax
+- **expressive**: parametrize markdown with interactive elements, plots, or anything else
+- **Pythonic**: cells only run Python; notebooks stored as `.py` files (clean git diffs!)
+- **performant**: powered by static analysis, zero runtime overhead
+
+marimo was built from the ground up to solve many
+<a href="/getting_started/faq.html#faq-jupyter">well-known problems associated with traditional notebooks</a>;
+marimo is _not_ built on Jupyter or any other notebook or app library.
+
+
+> ⚡ marimo notebooks run automatically with interactions and code changes
+
+<div align="center">
+<figure>
+<img src="/_static/readme-ui.gif"/>
+</figure>
+</div>
+
+
+> ✨ express yourself with markdown, LaTeX, tables, accordions, tabs, grids, and more
+
+<div align="center">
+<figure>
+<img src="/_static/outputs.gif"/>
+</figure>
+</div>
+
+
+> 🔬 do reproducible science in an environment that makes your data tangible
+
+<div align="center">
+<figure>
+<img src="/_static/faq-marimo-ui.gif"/>
+</figure>
+</div>
+
+> 🚀 deploy your creations as interactive web apps
+
+<div align="center">
+<figure>
+<img src="/_static/docs-intro-app.gif"/>
+</figure>
+</div>
+
+<h3>Contents</h3>
+
+```{eval-rst}
+.. toctree::
+ :maxdepth: 2
+
+ getting_started/index
+ guides/index
+ api/index
+ getting_started/examples
+ getting_started/faq
+```
+
+<h3>Index</h3>
+
+```{eval-rst}
+* :ref:`genindex`
+```
diff --git a/docs/make.bat b/docs/make.bat
new file mode 100644
index 0000000000..32bb24529f
--- /dev/null
+++ b/docs/make.bat
@@ -0,0 +1,35 @@
+@ECHO OFF
+
+pushd %~dp0
+
+REM Command file for Sphinx documentation
+
+if "%SPHINXBUILD%" == "" (
+ set SPHINXBUILD=sphinx-build
+)
+set SOURCEDIR=.
+set BUILDDIR=_build
+
+%SPHINXBUILD% >NUL 2>NUL
+if errorlevel 9009 (
+ echo.
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
+ echo.installed, then set the SPHINXBUILD environment variable to point
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
+ echo.may add the Sphinx directory to PATH.
+ echo.
+ echo.If you don't have Sphinx installed, grab it from
+ echo.https://www.sphinx-doc.org/
+ exit /b 1
+)
+
+if "%1" == "" goto help
+
+%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
+goto end
+
+:help
+%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
+
+:end
+popd
diff --git a/examples/README.md b/examples/README.md
new file mode 100644
index 0000000000..c237f0c28d
--- /dev/null
+++ b/examples/README.md
@@ -0,0 +1,7 @@
+# Examples
+
+This folder contains example marimo notebooks.
+
+- The requirements used by these notebooks are in `requirements.txt`.
+- Install the requirements in your virtual environment with `pip install -r requirements.txt`
+- Open an example with `marimo edit`
diff --git a/examples/ai/openai.py b/examples/ai/openai.py
new file mode 100644
index 0000000000..f4a6de82b1
--- /dev/null
+++ b/examples/ai/openai.py
@@ -0,0 +1,162 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("## Build a Superhero with Generative AI")
+ return
+
+
+def __(mo):
+ openaikey = mo.ui.text(label="🤖 OpenAI Key", kind="password")
+ config = mo.hstack([openaikey])
+ mo.accordion({"⚙️ Enter your OpenAI key": config})
+ return config, openaikey
+
+
+def __(mo):
+ item = mo.ui.text(label="Enter the name of an animal: ").form()
+ item
+ return item,
+
+
+def __(item, mo):
+ content = f"💬 Suggest three superhero names, given the following animal: {item.value}"
+
+ mo.md(content) if item.value else None
+ return content,
+
+
+def __(content, item, mo, openai, openaikey):
+ openai.api_key = openaikey.value
+
+ result = None
+ if item.value:
+ response = openai.ChatCompletion.create(
+ model="gpt-3.5-turbo",
+ messages=[
+ {
+ "role": "system",
+ "content": "You are a creative assistant. Your responses should use newlines.",
+ },
+ {"role": "user", "content": content},
+ ],
+ )
+
+ result = response.choices[0].message.content
+
+ mo.md(
+ f"""
+ 🤖 Response:
+
+ {result}
+ """
+ ) if item.value else None
+ result = None
+ if item.value:
+ response = openai.ChatCompletion.create(
+ model="gpt-3.5-turbo",
+ messages=[
+ {
+ "role": "system",
+ "content": "You are a creative assistant. Your responses should use newlines.",
+ },
+ {"role": "user", "content": content},
+ ],
+ )
+
+ result = response.choices[0].message.content
+
+ mo.md(
+ f"""
+ 🤖 Response:
+
+ {result}
+ """
+ ) if item.value else None
+ return response, result
+
+
+def __(mo, result):
+ choices = result.split("\n") if result else []
+ superhero = mo.ui.dropdown(choices)
+
+ mo.md(
+ f"""
+ Choose a super hero: {superhero}
+ """
+ ) if result else None
+ return choices, superhero
+
+
+def __(mo, openai, superhero):
+ catchphrase = None
+
+ if superhero.value:
+ catchphraseResponse = openai.ChatCompletion.create(
+ model="gpt-3.5-turbo",
+ messages=[
+ {"role": "system", "content": "You are a creative assistant."},
+ {
+ "role": "user",
+ "content": f"Create a catchphrase for {superhero.value}",
+ },
+ ],
+ )
+
+ catchphrase = catchphraseResponse.choices[0].message.content
+
+ mo.md(
+ f"""
+ 💬 Create a catchphrase for {superhero.value}
+
+ 🤖 Response:
+
+ {catchphrase}
+ """
+ ) if superhero.value else None
+ return catchphrase, catchphraseResponse
+
+
+def __(catchphrase, mo):
+ generate_image_button = mo.ui.button(label="📷 Generate Image")
+ generate_image_button if catchphrase else None
+ return generate_image_button,
+
+
+def __(generate_image_button, mo, openai, superhero):
+ generate_image_button
+
+ url = None
+ if superhero.value:
+ res = openai.Image.create(
+ prompt=superhero.value,
+ n=1,
+ size="256x256",
+ )
+ url = res["data"][0]["url"]
+
+ mo.Html(f"<img src={url} />") if url else None
+ return res, url
+
+
+def __():
+ import marimo as mo
+ import openai
+ return mo, openai
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/ai/question-pdf.py b/examples/ai/question-pdf.py
new file mode 100644
index 0000000000..22c44907c5
--- /dev/null
+++ b/examples/ai/question-pdf.py
@@ -0,0 +1,170 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# PDF Q&A")
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ This app lets you upload a PDF and ask questions about it.
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.accordion({
+ "How is this app implemented?": """
+ - Your PDF is tokenized into chunks, which are embedded using
+ OpenAI's `text-embedding-ada-002`.
+ - Your question is embedded using the same model.
+ - We use an approximate k-nearest neighbor search on the PDF embeddings to
+ retrieve relevant chunks.
+ - The most relevant chunks are added to the context of your prompt, which
+ is processed by a GPT model.
+ """
+ })
+ return
+
+
+def __(mo):
+ openaikey = mo.ui.text(label="🤖 OpenAI Key", kind="password")
+ config = mo.hstack([openaikey])
+ mo.accordion({"⚙️ Config": config})
+ return config, openaikey
+
+
+def __(mo, openaikey):
+ pdf = mo.ui.file(
+ label="Upload PDF", filetypes=[".pdf"], multiple=False, kind="area"
+ )
+ pdf if openaikey.value else mo.md("👆 Add an Open AI Key").callout(kind="warn")
+ return pdf,
+
+
+def __(
+ CharacterTextSplitter,
+ FAISS,
+ OpenAIEmbeddings,
+ PdfReader,
+ io,
+ openai,
+ openaikey,
+ pdf,
+):
+ openai.api_key = openaikey.value
+
+
+ def parse_pdf():
+ if not pdf.value:
+ print("No PDF")
+ return None
+ if not pdf.value[0]:
+ print("No PDF")
+ return None
+
+ contents = pdf.value[0].contents
+ file = io.BytesIO(contents)
+ pdf_reader = PdfReader(file)
+ text = ""
+ for page in pdf_reader.pages:
+ text += page.extract_text()
+
+ # split into chunks
+ text_splitter = CharacterTextSplitter(
+ separator="\n", chunk_size=1000, chunk_overlap=200, length_function=len
+ )
+ chunks = text_splitter.split_text(text)
+
+ # create embeddings
+ embeddings = OpenAIEmbeddings(openai_api_key=openaikey.value)
+ return FAISS.from_texts(chunks, embeddings)
+
+
+ knowledge_base = parse_pdf()
+ return knowledge_base, parse_pdf
+
+
+def __(mo):
+ user_question = mo.ui.text_area(
+ placeholder="💬 What are the 3 key points of the document?"
+ ).form()
+ user_question
+ return user_question,
+
+
+def __(
+ OpenAI,
+ get_openai_callback,
+ knowledge_base,
+ load_qa_chain,
+ mo,
+ openaikey,
+ user_question,
+):
+ def query_pdf():
+ if not user_question.value or not knowledge_base:
+ return ""
+
+ docs = knowledge_base.similarity_search(user_question.value)
+ llm = OpenAI(openai_api_key=openaikey.value)
+ chain = load_qa_chain(llm, chain_type="stuff")
+ with get_openai_callback() as cb:
+ response = chain.run(
+ input_documents=docs, question=user_question.value
+ )
+ print(cb)
+ return response
+
+
+ res = query_pdf()
+ mo.md(res)
+ return query_pdf, res
+
+
+def __():
+ import marimo as mo
+ import openai
+
+ import io
+ from PyPDF2 import PdfReader
+ from langchain.text_splitter import CharacterTextSplitter
+ from langchain.embeddings.openai import OpenAIEmbeddings
+ from langchain.vectorstores import FAISS
+ from langchain.chains.question_answering import load_qa_chain
+ from langchain.llms import OpenAI
+ from langchain.callbacks import get_openai_callback
+
+ import os
+ return (
+ CharacterTextSplitter,
+ FAISS,
+ OpenAI,
+ OpenAIEmbeddings,
+ PdfReader,
+ get_openai_callback,
+ io,
+ load_qa_chain,
+ mo,
+ openai,
+ os,
+ )
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/arrays_and_dicts.py b/examples/arrays_and_dicts.py
new file mode 100644
index 0000000000..bf35b0f41f
--- /dev/null
+++ b/examples/arrays_and_dicts.py
@@ -0,0 +1,82 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# Arrays and Dictionaries")
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ Use `mo.ui.array` and `mo.ui.dictionary` to create UI elements that wrap
+ other elements.
+
+ Because UI elements must be assigned to global variables,
+ these functions are required when the set of elements to create is not
+ known unitl runtime.
+ """
+ )
+ return
+
+
+def __(mo):
+ create = mo.ui.button(label="Create new collections")
+ return create,
+
+
+def __(create):
+ create.center()
+ return
+
+
+def __(mo):
+ mo.md("UI Elements ...")
+ return
+
+
+def __(create, mo, random):
+ create
+
+ array = mo.ui.array(
+ [mo.ui.text()]
+ + [mo.ui.slider(1, 10) for _ in range(0, random.randint(2, 5))],
+ )
+ dictionary = mo.ui.dictionary(
+ {str(i): mo.ui.slider(1, 10) for i in range(0, random.randint(2, 5))}
+ )
+
+ mo.hstack([array, dictionary], justify="space-around")
+ return array, dictionary
+
+
+def __(mo):
+ mo.md(" ... and their values")
+ return
+
+
+def __(array, dictionary, mo):
+ mo.hstack([array.value, dictionary.value], justify="space-around")
+ return
+
+
+def __():
+ import marimo as mo
+ import random
+ return mo, random
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/batch_and_form.py b/examples/batch_and_form.py
new file mode 100644
index 0000000000..e597097d8c
--- /dev/null
+++ b/examples/batch_and_form.py
@@ -0,0 +1,97 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# Batch and Form")
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ Make custom UI elements using `batch()`, and turn any UI element
+ into a form with `form()`.
+ """
+ )
+ return
+
+
+def __(mo, reset):
+ reset
+
+ variables = (
+ mo.md(
+ """
+ Choose your variable values
+
+ {x}
+
+ {y}
+ """
+ )
+ .batch(
+ x=mo.ui.slider(start=1, stop=10, step=1, label="$x =$"),
+ y=mo.ui.slider(start=1, stop=10, step=1, label="$y =$"),
+ )
+ .form()
+ )
+
+ variables
+ return variables,
+
+
+def __(mo, reset, submitted_values, variables):
+ if variables.value is not None:
+ submitted_values["x"].add(variables.value["x"])
+ submitted_values["y"].add(variables.value["y"])
+
+ x = variables.value["x"] if variables.value else "\ldots"
+ y = variables.value["y"] if variables.value else "\ldots"
+
+
+ mo.md(
+ f"""
+ At the moment,
+ $x = {x}$ and $y = {y}$
+
+ All values ever assumed by $x$ and $y$ are
+
+ {mo.hstack([mo.tree(submitted_values), reset],
+ justify="start", align="center", gap=4)}
+ """
+ ).callout()
+ return x, y
+
+
+def __(reset):
+ reset
+
+ submitted_values = {
+ "x": set(),
+ "y": set()
+ }
+ return submitted_values,
+
+
+def __(mo):
+ reset = mo.ui.button(label="reset history")
+ return reset,
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/data_explorer.py b/examples/data_explorer.py
new file mode 100644
index 0000000000..b497a75251
--- /dev/null
+++ b/examples/data_explorer.py
@@ -0,0 +1,104 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# Data Explorer")
+ return
+
+
+def __(mo):
+ mo.md("This notebook lets you upload a CSV and plot its columns.")
+ return
+
+
+def __(df, mo, uploaded_file):
+ callout_kind = (
+ "alert"
+ if (uploaded_file.name() is None)
+ else "neutral"
+ )
+
+ mo.md(
+ f"""
+ {mo.hstack([mo.md("**Upload a CSV.**")], "center")}
+
+ {uploaded_file}
+
+ {mo.as_html(df.head()) if df is not None else ""}
+ """
+ ).callout(kind=callout_kind)
+ return callout_kind,
+
+
+def __(io, mo, pd, uploaded_file):
+ df = None
+ columns = None
+ plot_type = mo.ui.dropdown(
+ ["line", "hist"], value="line", label="Choose a plot type: "
+ )
+
+ if uploaded_file.name() is not None:
+ df = pd.read_csv(io.StringIO(uploaded_file.contents().decode()))
+ columns = mo.ui.dropdown(df.columns[1:], label="Choose a column: ")
+ return columns, df, plot_type
+
+
+def __(columns, mo, plot_type):
+ def column_selector():
+ if columns is None:
+ return None
+
+ return mo.hstack([columns, plot_type], justify="space-around").callout(
+ kind="warn" if columns.value is None else "neutral"
+ )
+
+ column_selector()
+ return column_selector,
+
+
+def __(columns, df, plot_type, plt):
+ def plot_data():
+ if df is not None and columns.value is not None:
+ data = df[columns.value].to_numpy()
+ if plot_type.value == "line":
+ plt.plot(data)
+ else:
+ plt.hist(data)
+ plt.title(columns.value)
+ return plt.gca()
+ else:
+ return None
+
+
+ plot = plot_data()
+ plot
+ return plot, plot_data
+
+
+def __(mo):
+ uploaded_file = mo.ui.file(filetypes=[".csv"], kind="area")
+ return uploaded_file,
+
+
+def __():
+ import marimo as mo
+
+ import io
+ import matplotlib.pyplot as plt
+ import pandas as pd
+ return io, mo, pd, plt
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/embeddings/complete_graph.py b/examples/embeddings/complete_graph.py
new file mode 100644
index 0000000000..557d41722d
--- /dev/null
+++ b/examples/embeddings/complete_graph.py
@@ -0,0 +1,96 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# Visualizing Complete Graphs")
+ return
+
+
+def __(mo):
+ n_items = mo.ui.slider(start=3, stop=64, step=1)
+ mo.md(
+ f"""
+ Choose a number of items $n$: {n_items}
+ """
+ )
+ return n_items,
+
+
+def __(mo, pymde):
+ penalty_function = mo.ui.dropdown(
+ options={
+ "Linear": pymde.penalties.Linear,
+ "Quadratic": pymde.penalties.Quadratic,
+ "Cubic": pymde.penalties.Cubic
+ },
+ value="Cubic"
+ )
+ mo.md(
+ f"""
+ Choose a penalty function: {penalty_function}
+ """
+ )
+ return penalty_function,
+
+
+def __(complete_graph, mo, n_items, penalty_function):
+ plot = complete_graph(n_items.value, penalty_function.value)
+
+ mo.md(
+ f"""
+ Here is a plot of $K_n$ with $n={n_items.value}$, i.e., a complete graph on
+ ${n_items.value}$ nodes. This graph has
+
+ \[
+ (n)(n-1)/2 = {n_items.value*(n_items.value-1)//2}
+ \]
+
+ edges. The plot was obtained using a
+ {penalty_function.value.__name__.lower()} penalty function.
+
+ {mo.as_html(plot)}
+ """
+ )
+ return plot,
+
+
+def __(pymde):
+ import functools
+
+ @functools.cache
+ def complete_graph(n_items, penalty_function):
+ edges = pymde.all_edges(n_items)
+ mde = pymde.MDE(
+ n_items,
+ embedding_dim=2,
+ edges=edges,
+ distortion_function=penalty_function(weights=1.0),
+ constraint=pymde.Standardized()
+ )
+ mde.embed(verbose=True)
+ return mde.plot(edges=edges)
+ return complete_graph, functools
+
+
+def __():
+ import pymde
+ return pymde,
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/embeddings/debugging_embeddings.py b/examples/embeddings/debugging_embeddings.py
new file mode 100644
index 0000000000..15c8b816f6
--- /dev/null
+++ b/examples/embeddings/debugging_embeddings.py
@@ -0,0 +1,226 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md(
+ """
+ # Sanity-Checking Embeddings
+
+ This app shows you the basics of sanity-checking an embedding made with
+ the `PyMDE` library. We'll use MNIST as a case study.
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ We'll start by making a simple neighborhood-preserving embedding. This
+ means that we'll try to identify pairs of images that are similar, using
+ a heuristic, and we'll tell PyMDE to place these pairs near each other in
+ the embedding.
+ """
+ )
+ return
+
+
+def __(n_neighbors):
+ n_neighbors
+ return
+
+
+def __(n_neighbors):
+ ready = n_neighbors.value is not None
+ return ready,
+
+
+def __(mo, ready):
+ mo.md(
+ """
+ Below, we've plotted an embedding along with a CDF of the distortions
+ per pair. We see that most pairs were embedded with
+ very low distortion, but some pairs have much higher distortion
+ that the rest. These will be interesting to examine up close.
+ """
+ ) if ready else None
+ return
+
+
+def __(mnist, plt, quadratic_mde, ready):
+ def compute_embedding():
+ _ = quadratic_mde.embed(verbose=True)
+ quadratic_mde.plot(color_by=mnist.attributes["digits"])
+ ax1 = plt.gca()
+ quadratic_mde.distortions_cdf()
+ ax2 = plt.gca()
+
+ pairs, distortions = quadratic_mde.high_distortion_pairs()
+ return pairs, distortions, (ax1, ax2)
+
+
+ pairs, distortions, plots = (
+ compute_embedding() if ready else (None, None, None)
+ )
+ plots
+ return compute_embedding, distortions, pairs, plots
+
+
+def __(mo):
+ n_neighbors = mo.ui.slider(
+ 3, 30, step=1, value=15, label="Number of neighbors in $k$-NN graph"
+ ).form()
+ return n_neighbors,
+
+
+def __(knn, n_neighbors, ready):
+ knn_graph = knn(n_neighbors.value) if ready else None
+ return knn_graph,
+
+
+def __(functools, mnist, pymde):
+ @functools.cache
+ def knn(n_neighbors):
+ return pymde.preprocess.k_nearest_neighbors(
+ mnist.data, k=n_neighbors, verbose=True
+ )
+
+ return knn,
+
+
+def __(knn_graph, mnist, pymde, ready, torch):
+ def construct_mde_problem():
+ if torch.cuda.is_available():
+ device = "cuda"
+ else:
+ device = "cpu"
+
+ return pymde.MDE(
+ n_items=mnist.data.shape[0],
+ embedding_dim=2,
+ edges=knn_graph.edges,
+ distortion_function=pymde.penalties.Quadratic(knn_graph.weights),
+ constraint=pymde.Standardized(),
+ device=device,
+ )
+
+ quadratic_mde = construct_mde_problem() if ready else None
+ return construct_mde_problem, quadratic_mde
+
+
+def __(mo, ready):
+ mo.md(
+ """
+ ## Pairs with highest and lowest distortion
+
+ Let's visualize a few pairs of images with low distortion (meaning they
+ were similar and placed near each other by the embedding) and with high
+ distortion (meaning they were similar but the embedding failed to place
+ them near each other).
+ """
+ ) if ready else None
+ return
+
+
+def __(mo, ready):
+ n_pairs = mo.ui.slider(5, 10, label="number of pairs")
+ n_pairs if ready else None
+ return n_pairs,
+
+
+def __(mo, ready):
+ mo.md(
+ """### Low distortion pairs
+
+ These are examples of pairs of images that were known to be similar,
+ and that the embedding placed very near each other.
+ """
+ ) if ready else None
+ return
+
+
+def __(n_pairs, pairs, plot_pairs, ready):
+ plot_pairs(pairs[-n_pairs.value :]) if ready else None
+ return
+
+
+def __(mo, ready):
+ mo.md(
+ """
+ ### High distortion pairs
+
+ Notice that some of these pairs of images are actually not the same digit;
+ we told our embedding to put them close together, but the embedding refused
+ to do so (in some cases, rightly so!). In other cases, the images in a pair
+ do depict the same digit, but are very strangely drawn. In a very real
+ sense, these pairs can be considered to be **outliers** in our original
+ data.
+ """
+ ) if ready else None
+ return
+
+
+def __(n_pairs, pairs, plot_pairs, ready):
+ plot_pairs(pairs[: n_pairs.value]) if ready else None
+ return
+
+
+def __(mnist, plt):
+ def plot_pairs(pairs):
+ fig, axs = plt.subplots(2, pairs.shape[0], figsize=(15.0, 3.0))
+ for pair_index in range(pairs.shape[0]):
+ i = pairs[pair_index][0]
+ j = pairs[pair_index][1]
+ im_i = mnist.data[i].reshape(28, 28)
+ im_j = mnist.data[j].reshape(28, 28)
+ axs[0][pair_index].imshow(im_i)
+ axs[0][pair_index].set_xticks([])
+ axs[0][pair_index].set_yticks([])
+ axs[1][pair_index].imshow(im_j)
+ axs[1][pair_index].set_xticks([])
+ axs[1][pair_index].set_yticks([])
+ plt.tight_layout()
+ return plt.gca()
+ return plot_pairs,
+
+
+def __(pymde):
+ mnist = pymde.datasets.MNIST()
+ return mnist,
+
+
+def __():
+ import functools
+
+ import matplotlib.pyplot as plt
+ import pymde
+ import torch
+
+ import marimo as mo
+ return functools, mo, plt, pymde, torch
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/embeddings/drawing_graphs.py b/examples/embeddings/drawing_graphs.py
new file mode 100644
index 0000000000..d94939b41f
--- /dev/null
+++ b/examples/embeddings/drawing_graphs.py
@@ -0,0 +1,146 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# Drawing Graphs")
+ return
+
+
+def __(mo):
+ n_items = mo.ui.slider(3, 15)
+ return n_items,
+
+
+def __(mo, n_items):
+ mo.md(f"Embedding graphs on {n_items} **{n_items.value}** items")
+ return
+
+
+def __(draw_graphs, loss, n_items, penalty):
+ draw_graphs(n_items, penalty, loss)
+ return
+
+
+def __(mo, pymde):
+ penalties = {
+ "Linear": pymde.penalties.Linear,
+ "Quadratic": pymde.penalties.Quadratic,
+ "Cubic": pymde.penalties.Cubic,
+ }
+
+ penalty = mo.ui.dropdown(penalties.keys(), "Cubic", label="penalty")
+ return penalties, penalty
+
+
+def __(mo, pymde):
+ losses = {
+ "Linear": pymde.losses.Absolute,
+ "Quadratic": pymde.losses.Quadratic,
+ "WeightedQuadratic": pymde.losses.WeightedQuadratic,
+ }
+ loss = mo.ui.dropdown(losses.keys(), "WeightedQuadratic", label="loss")
+ return loss, losses
+
+
+def __(complete_graph, mo, tree):
+ def draw_graphs(n_items, penalty, loss):
+ complete_graph_tab = [penalty, complete_graph(n_items.value, penalty.value)]
+ tree_tab = [loss, tree(n_items.value, loss.value)]
+ return mo.tabs(
+ {
+ "Complete graph": complete_graph_tab,
+ "Binary tree": tree_tab,
+ }
+ )
+ return draw_graphs,
+
+
+def __():
+ embedding_dim = 2
+ return embedding_dim,
+
+
+def __(format_axis, functools, penalties, pymde):
+ @functools.cache
+ def complete_graph(n_items, penalty):
+ edges = pymde.all_edges(n_items)
+ mde = pymde.MDE(
+ n_items,
+ embedding_dim=2,
+ edges=edges,
+ distortion_function=penalties[penalty](weights=1.0),
+ constraint=pymde.Standardized(),
+ )
+ mde.embed(verbose=False)
+ return format_axis(mde.plot(edges=edges))
+ return complete_graph,
+
+
+def __(embedding_dim, format_axis, functools, losses, pymde, torch):
+ @functools.cache
+ def tree(n_items, loss):
+ edges = []
+ stack = [0]
+ while stack:
+ root = stack.pop()
+ c1 = root * 2 + 1
+ c2 = root * 2 + 2
+ if c1 < n_items:
+ edges.append((root, c1))
+ stack.append(c1)
+ if c2 < n_items:
+ edges.append((root, c2))
+ stack.append(c2)
+ tree = pymde.Graph.from_edges(torch.tensor(edges))
+ shortest_paths_graph = pymde.preprocess.graph.shortest_paths(tree)
+
+ mde = pymde.MDE(
+ n_items,
+ embedding_dim,
+ shortest_paths_graph.edges,
+ losses[loss](shortest_paths_graph.distances),
+ )
+ mde.embed(snapshot_every=1, max_iter=20, verbose=False)
+ return format_axis(mde.plot(edges=tree.edges))
+ return tree,
+
+
+def __():
+ def format_axis(ax):
+ ax.figure.set_size_inches(3.5, 3.5)
+ ax.set_title("embedding")
+ ax.figure.tight_layout()
+ ax.set_xticks([])
+ ax.set_yticks([])
+ return ax
+ return format_axis,
+
+
+def __():
+ import marimo as mo
+ import pymde
+
+ import functools
+ import numpy as np
+ import scipy.sparse as sp
+ import torch
+ return functools, mo, np, pymde, sp, torch
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/embeddings/embedding_numbers.py b/examples/embeddings/embedding_numbers.py
new file mode 100644
index 0000000000..7930406ddb
--- /dev/null
+++ b/examples/embeddings/embedding_numbers.py
@@ -0,0 +1,173 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md(
+ """# Embedding MNIST
+
+ This app shows how to use the function `pymde.preserve_neighbors`
+ to produce embeddings that highlight the local structure of your
+ data, using MNIST as a case study. In these embeddings similar
+ digits are near each other, and dissimilar digits are not near each other.
+
+ ## Data
+ The data we'll embed are 70,000 28x28 grayscale images of handwritten
+ digits:
+ """
+ )
+ return
+
+
+def __(button, show_random_images):
+ button
+
+ show_random_images(5)
+ return
+
+
+def __(mo):
+ button = mo.ui.button(label="Click this button")
+ mo.md(f"{button} _to view another random sample of images._").center()
+ return button,
+
+
+def __(mo):
+ params = (
+ mo.md(
+ """
+ ### Try these controls <span style="font-size: 28px">🎮</span>
+ Here are some parameters you can play around with to control the
+ embedding.
+
+ - embedding dimension (2 or 3): {embedding_dimension}
+ - constraint: {constraint_type}
+ """
+ )
+ .batch(
+ embedding_dimension=mo.ui.slider(2, 3, value=2),
+ constraint_type=mo.ui.dropdown(
+ ("Centered", "Standardized"), value="Centered"
+ ),
+ )
+ .form()
+ )
+
+ params
+ return params,
+
+
+def __(params):
+ params.value
+ return
+
+
+def __(params):
+ if params.value is not None:
+ embedding_dimension, constraint_type = (
+ params.value["embedding_dimension"],
+ params.value["constraint_type"],
+ )
+ else:
+ embedding_dimension, constraint_type = None, None
+ return constraint_type, embedding_dimension
+
+
+def __(constraint_type, pymde):
+ if constraint_type is not None:
+ _constraints = {
+ "Centered": pymde.Centered(),
+ "Standardized": pymde.Standardized(),
+ }
+
+ constraint = _constraints[constraint_type]
+ return constraint,
+
+
+def __(
+ compute_embedding,
+ constraint,
+ embedding_dimension,
+ mnist,
+ plt,
+ pymde,
+):
+ def show_embedding():
+ _, embedding = compute_embedding(embedding_dimension, constraint)
+ pymde.plot(embedding, color_by=mnist.attributes["digits"])
+ plt.tight_layout()
+ return plt.gca()
+
+
+ show_embedding() if embedding_dimension is not None else None
+ return show_embedding,
+
+
+def __(mnist, pymde, torch):
+ embedding_cache = {}
+
+
+ def compute_embedding(embedding_dim, constraint):
+ key = (embedding_dim, constraint)
+ if key in embedding_cache:
+ return embedding_cache[key]
+
+ mde = pymde.preserve_neighbors(
+ mnist.data,
+ embedding_dim=embedding_dim,
+ constraint=constraint,
+ device="cuda" if torch.cuda.is_available() else "cpu",
+ verbose=True,
+ )
+ X = mde.embed(verbose=True)
+ value = (mde, X)
+ embedding_cache[key] = value
+ return value
+ return compute_embedding, embedding_cache
+
+
+def __(pymde):
+ mnist = pymde.datasets.MNIST()
+ return mnist,
+
+
+def __(mnist, plt, torch):
+ def show_random_images(n_images):
+ indices = torch.randperm(mnist.data.shape[0])[:n_images]
+ images = mnist.data[indices].reshape((-1, 28, 28))
+ fig, axes = plt.subplots(1, n_images)
+ fig.set_size_inches(6.5, 1.5)
+ for im, ax in zip(images, axes.flat):
+ ax.imshow(im, cmap="gray")
+ ax.set_yticks([])
+ ax.set_xticks([])
+ plt.tight_layout()
+ return fig
+ return show_random_images,
+
+
+def __():
+ import matplotlib.pyplot as plt
+ import pymde
+ import torch
+
+ import marimo as mo
+ return mo, plt, pymde, torch
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/embeddings/tree.py b/examples/embeddings/tree.py
new file mode 100644
index 0000000000..05a7cc6825
--- /dev/null
+++ b/examples/embeddings/tree.py
@@ -0,0 +1,96 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo, n_items):
+ mo.md(
+ f"""
+ # Embedding binary trees
+
+ In this example, we'll use PyMDE to draw binary trees. Sweep the
+ slider to draw bigger trees ...
+
+ {n_items}
+ """
+ )
+ return
+
+
+def __(mo, n_items):
+ mo.md(f"Let's embed a binary tree on **{n_items.value}** vertices.")
+ return
+
+
+def __(embedding, pymde, tree):
+ pymde.plot(embedding, edges=tree.edges)
+ return
+
+
+def __(embed, make_graph, n_items):
+ tree, graph = make_graph(n_items.value)
+ embedding = embed(graph)
+ return embedding, graph, tree
+
+
+def __(mo):
+ n_items = mo.ui.slider(64, 1024, step=64)
+ return n_items,
+
+
+def __(functools, pymde, torch):
+ @functools.cache
+ def make_graph(n_items):
+ edges = []
+ stack = [0]
+ while stack:
+ root = stack.pop()
+ c1 = root * 2 + 1
+ c2 = root * 2 + 2
+ if c1 < n_items:
+ edges.append((root, c1))
+ stack.append(c1)
+ if c2 < n_items:
+ edges.append((root, c2))
+ stack.append(c2)
+ tree = pymde.Graph.from_edges(torch.tensor(edges))
+ return tree, pymde.preprocess.graph.shortest_paths(tree)
+ return make_graph,
+
+
+def __(functools, pymde):
+ @functools.cache
+ def embed(shortest_paths_graph):
+ mde = pymde.MDE(
+ shortest_paths_graph.n_items,
+ embedding_dim=2,
+ edges=shortest_paths_graph.edges,
+ distortion_function=pymde.losses.WeightedQuadratic(
+ shortest_paths_graph.distances
+ ),
+ )
+ return mde.embed(verbose=True)
+ return embed,
+
+
+def __():
+ import functools
+
+ import pymde
+ import torch
+
+ import marimo as mo
+ return functools, mo, pymde, torch
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/geometry/mandelbrot.py b/examples/geometry/mandelbrot.py
new file mode 100644
index 0000000000..07feab7508
--- /dev/null
+++ b/examples/geometry/mandelbrot.py
@@ -0,0 +1,146 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# The Mandelbrot Set")
+ return
+
+
+def __(mo):
+ mo.md(
+ r"""
+ This program computes uses an iterative algorithm to visualize the
+ [_Mandelbrot set_](https://mathworld.wolfram.com/MandelbrotSet.html),
+ the set of complex numbers $c$ for which the sequence defined by the
+ iteration
+
+ \[
+ z_n = z_{n-1}^2 + c, \quad z_0 = 0
+ \]
+
+ is bounded in absolute value.
+
+
+ In the visualization, every point not in the set is colored by the
+ number of iterations the algorithm required to disprove its membership in
+ the set. In any iteration, points in the darkest region may
+ be in the computed set; once the number of iterations is very high, we
+ can be confident that the dark region is the desired Mandelbrot set.
+ """
+ )
+ return
+
+
+def __(mo, n_max):
+ mo.md(
+ f"""
+ You can play with the number of iterations to see when points are
+ eliminated from the set:
+
+ - _Number of iterations_: {n_max}
+ """
+ )
+ return
+
+
+def __(mo, reset_plot_scale, x_offset, y_offset, zoom):
+ mo.md(
+ f"""
+ **Plot controls.**
+
+ Here are some controls to play with the plot. ( {reset_plot_scale} )
+
+ - _Zoom_: {zoom}
+ - _Pan left/right_: {x_offset}
+ - _Pan down/up_: {y_offset}
+ """
+ )
+ return
+
+
+def __(compute_mandelbrot, n_max, x_offset, y_offset, zoom):
+ compute_mandelbrot(n_max.value, 2., 601, 401,
+ zoom=zoom.value,
+ x_offset=x_offset.value,
+ y_offset=y_offset.value)
+ return
+
+
+def __(mo):
+ n_max = mo.ui.slider(2, 256, step=1, value=30)
+ return n_max,
+
+
+def __(mo):
+ reset_plot_scale = mo.ui.button(label="Click to reset")
+ return reset_plot_scale,
+
+
+def __(mo, reset_plot_scale):
+ reset_plot_scale
+
+ zoom = mo.ui.slider(1, 10, step=0.1)
+ x_offset = mo.ui.slider(-3, 3, value=0, step=0.01)
+ y_offset = mo.ui.slider(-3, 3, value=0, step=0.01)
+ return x_offset, y_offset, zoom
+
+
+def __(np, plt):
+ import functools
+
+ @functools.cache
+ def compute_mandelbrot(N_max, some_threshold, nx, ny, zoom=1,
+ x_offset=0, y_offset=0):
+ # A grid of c-values
+ x = np.linspace((-2)/zoom, (1)/zoom, nx)
+ y = np.linspace((-1.5)/zoom, (1.5)/zoom, ny)
+
+ c = x[:,np.newaxis] + 1j*y[np.newaxis,:] + x_offset + 1j*y_offset
+
+ # Mandelbrot iteration
+ z = c
+ mandelbrot_set = np.zeros(z.shape)
+ for j in range(N_max):
+ z = np.where(np.abs(z) > some_threshold,
+ some_threshold + 1,
+ z**2 + c)
+
+ mask = (abs(z) > some_threshold) * (mandelbrot_set == 0)
+ mandelbrot_set[mask] = j**(1/3)
+
+ plt.imshow(
+ mandelbrot_set.T, extent=[x[0], x[-1], y[0], y[-1]],
+ cmap='viridis',
+ )
+ plt.colorbar()
+ return plt.gca()
+ return compute_mandelbrot, functools
+
+
+def __():
+ import numpy as np
+ import matplotlib.pyplot as plt
+ return np, plt
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/geometry/surfaces.py b/examples/geometry/surfaces.py
new file mode 100644
index 0000000000..64e7883e59
--- /dev/null
+++ b/examples/geometry/surfaces.py
@@ -0,0 +1,298 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# Surfaces")
+ return
+
+
+def __(plot_3d_surface, selected_function):
+ ax = plot_3d_surface(selected_function)
+ return ax,
+
+
+def __(ax, xlim, ylim, zlim):
+ ax.set_xlim(xlim.value)
+ ax.set_ylim(ylim.value)
+ ax.set_zlim(zlim.value)
+ ax
+ return
+
+
+def __(
+ a,
+ b,
+ function,
+ mo,
+ saddle_param_a,
+ saddle_param_b,
+ sphere_param_r,
+ torus_param_a,
+ torus_param_c,
+):
+ if function.value == "paraboloid":
+ _prose = rf"""defined by the function
+
+ \[
+ f(x, y) = ax^2 + by^2,
+ \]
+
+ where $a={a.value}$ and $b={b.value}$.
+ """
+ elif function.value == "saddle":
+ _prose = rf"""defined by the function
+
+ \[
+ f(x, y) = ax^2 - by^4,
+ \]
+
+ where $a=${saddle_param_a.value} and $b$={saddle_param_b.value}.
+ """
+ elif function.value == "sphere":
+ _prose = rf"""given by
+
+ \[
+ (x, y, z) =
+ r \begin{{bmatrix}}
+ \cos(\theta)\sin(\phi) \\
+ \sin(\theta)\sin(\phi) \\
+ \cos(\phi)
+ \end{{bmatrix}}
+ \]
+
+ where $\theta \in [0, 2\pi]$ and $\phi \in [0, \pi]$ and
+ $r={sphere_param_r.value}$ is the radius.
+ """
+ elif function.value == "torus":
+ _prose = rf"""given by
+
+ \[
+ (x, y, z) = \begin{{bmatrix}}
+ (c + a\cos(v))\cos(u) \\
+ (c + a\cos(v))\sin(u) \\
+ a\sin(v) \\
+ \end{{bmatrix}}
+ \]
+
+ where $u \in [0, 2\pi]$ and $v \in [0, 2\pi]$,
+ $c={torus_param_c.value}$ is radius of the torus from the origin,
+ and $a={torus_param_a.value}$ is inner radius of the torus.
+ """
+ mo.md(
+ rf"""You are looking at a **{function}**. This is a
+ surface in $\mathbf{{R}}^3$ {_prose}
+ """
+ )
+ return
+
+
+def __(function, function_options):
+ selected_function = function_options[function.value]
+ return selected_function,
+
+
+def __(paraboloid, saddle, sphere, torus):
+ function_options = {
+ "paraboloid": paraboloid,
+ "saddle": saddle,
+ "sphere": sphere,
+ "torus": torus,
+ }
+ return function_options,
+
+
+def __(mo):
+ function = mo.ui.dropdown(
+ options=[
+ "paraboloid",
+ "saddle",
+ "sphere",
+ "torus"
+ ], value='paraboloid'
+ )
+ return function,
+
+
+def __(plt):
+ def plot_3d_surface(surface_function):
+ fig = plt.figure()
+ ax = fig.add_subplot(111, projection='3d')
+
+ x, y, z = surface_function()
+ ax.plot_surface(x, y, z, cmap='viridis')
+
+ ax.set_xlabel('x')
+ ax.set_ylabel('y')
+ ax.set_zlabel('z')
+
+ fig.set_size_inches(7, 7)
+
+ return ax
+ return plot_3d_surface,
+
+
+def __(mo):
+ mo.md("### Controls")
+ return
+
+
+def __(function, mo):
+ if function.value == "paraboloid":
+ _xlim, _ylim, _zlim = (-1, 1), (-1, 1), (0, 2)
+ elif function.value == "saddle":
+ _xlim, _ylim, _zlim = (-1, 1), (-1, 1), (-1, 1)
+ elif function.value == "sphere" or function.value == "torus":
+ _xlim, _ylim, _zlim = (-5, 5), (-5, 5), (-5, 5)
+ else:
+ raise ValueError("Unrecognized function value ", function.value)
+
+
+ xlim = mo.ui.array([
+ mo.ui.number(-10, 10, value=_xlim[0]),
+ mo.ui.number(-10, 10, value=_xlim[1]),
+ ], label='xlim')
+ ylim = mo.ui.array([
+ mo.ui.number(-10, 10, value=_ylim[0]),
+ mo.ui.number(-10, 10, value=_ylim[1]),
+ ], label='ylim')
+ zlim = mo.ui.array([
+ mo.ui.number(-10, 10, value=_zlim[0]),
+ mo.ui.number(-10, 10, value=_zlim[1]),
+ ], label='zlim')
+
+ mo.md(
+ f"""
+ You can adjust the plot using these controls:
+
+ **Axes.**
+
+ {mo.hstack([xlim, ylim, zlim])}
+ """
+ )
+ return xlim, ylim, zlim
+
+
+def __(function, mo):
+ if function.value == "paraboloid":
+ a = mo.ui.slider(1, 10)
+ b = mo.ui.slider(1, 10)
+ _prose = f"""
+ - $a$: {a}
+ - $b$: {b}
+ """
+ elif function.value == "saddle":
+ saddle_param_a = mo.ui.slider(1, 10)
+ saddle_param_b = mo.ui.slider(1, 10)
+ _prose = f"""
+ - $a$: {saddle_param_a}
+ - $b$: {saddle_param_b}
+ """
+ elif function.value == "sphere":
+ sphere_param_r = mo.ui.slider(1, 10)
+ _prose = f"""
+ - $r$: {sphere_param_r}
+ """
+ elif function.value == "torus":
+ torus_param_c = mo.ui.slider(0, 10, value=1)
+ torus_param_a = mo.ui.slider(0.5, 10)
+ _prose = f"""
+ - $c$: {torus_param_c}
+ - $a$: {torus_param_a}
+ """
+ else:
+ _prose = ""
+
+ mo.md("**Parameters.**\n" + _prose) if _prose else None
+ return (
+ a,
+ b,
+ saddle_param_a,
+ saddle_param_b,
+ sphere_param_r,
+ torus_param_a,
+ torus_param_c,
+ )
+
+
+def __(grid, saddle_param_a, saddle_param_b):
+ def saddle():
+ x, y = grid(xlim=(-1, 1), ylim=(-1, 1))
+ return x, y, saddle_param_a.value*x**2 - saddle_param_b.value*y**4
+ return saddle,
+
+
+def __(a, b, grid):
+ def paraboloid():
+ x, y = grid(xlim=(-1, 1), ylim=(-1, 1))
+ return x, y, a.value*x**2 / 2 + b.value*y**2/ 2
+ return paraboloid,
+
+
+def __(grid, np, sphere_param_r):
+ def sphere():
+ theta, phi = grid(xlim=(0, 2*np.pi), ylim=(0, np.pi))
+ x = np.cos(theta)*np.sin(phi)
+ y = np.sin(theta)*np.sin(phi)
+ z = np.cos(phi)
+ return sphere_param_r.value*x, sphere_param_r.value*y, sphere_param_r.value*z
+ return sphere,
+
+
+def __(grid, np, torus_param_a, torus_param_c):
+ def torus():
+ theta, phi = grid((0, 2 * np.pi), (0, 2 * np.pi))
+ center_radius = torus_param_c.value
+ tube_radius = torus_param_a.value
+
+ x = (center_radius + tube_radius*np.cos(theta)) * np.cos(phi)
+ y = (center_radius + tube_radius*np.cos(theta)) * np.sin(phi)
+ z = tube_radius*np.sin(theta)
+ return x, y, z
+ return torus,
+
+
+def __(np):
+ def grid(xlim, ylim):
+ xmin, xmax = xlim
+ ymin, ymax = ylim
+ x = np.linspace(xmin, xmax, 100)
+ y = np.linspace(ymin, ymax, 100)
+ return np.meshgrid(x, y)
+ return grid,
+
+
+def __():
+ import matplotlib.pyplot as plt
+ from mpl_toolkits.mplot3d import Axes3D
+ import numpy as np
+ return Axes3D, np, plt
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/layout.py b/examples/layout.py
new file mode 100644
index 0000000000..e3b1fddb09
--- /dev/null
+++ b/examples/layout.py
@@ -0,0 +1,98 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# Stacks")
+ return
+
+
+def __(mo):
+ mo.md("Use `mo.hstack` and `mo.vstack` to layout outputs in rows and columns.")
+ return
+
+
+def __(mo):
+ align = mo.ui.dropdown(
+ label="Align", options=["start", "end", "center", "stretch"]
+ )
+ justify = mo.ui.dropdown(
+ label="Justify",
+ options=["start", "center", "end", "space-between", "space-around"],
+ )
+ gap = mo.ui.number(label="Gap", start=0, stop=100, value=1)
+ size = mo.ui.slider(label="Size", start=60, stop=500)
+ wrap = mo.ui.checkbox(label="Wrap")
+
+ mo.md(
+ f"""
+ **Stack parameters**
+
+ {mo.hstack([align, justify, gap, wrap], gap=0.25)}
+
+ **Boxes {size}**
+ """
+ )
+ return align, gap, justify, size, wrap
+
+
+def __(mo):
+ mo.md("## Horizontal Stack: `hstack`")
+ return
+
+
+def __(align, boxes, gap, justify, mo, wrap):
+ mo.hstack(
+ boxes,
+ align=align.value,
+ justify=justify.value,
+ gap=gap.value,
+ wrap=wrap.value,
+ )
+ return
+
+
+def __(mo):
+ mo.md("## Vertical Stack: `vstack`")
+ return
+
+
+def __(align, boxes, gap, mo):
+ mo.vstack(
+ boxes,
+ align=align.value,
+ gap=gap.value,
+ )
+ return
+
+
+def __(mo, size):
+ def create_box(num):
+ box_size = size.value + num * 10
+ return mo.Html(
+ f"<div style='min-width: {box_size}px; min-height: {box_size}px; background-color: orange; text-align: center; line-height: {box_size}px'>{str(num)}</div>"
+ )
+
+
+ boxes = [create_box(i) for i in range(1, 5)]
+ return boxes, create_box
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/optimization/regularization_and_sparsity.py b/examples/optimization/regularization_and_sparsity.py
new file mode 100644
index 0000000000..1ef8f4432c
--- /dev/null
+++ b/examples/optimization/regularization_and_sparsity.py
@@ -0,0 +1,221 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# Regularization and Sparsity")
+ return
+
+
+def __(mo):
+ mo.md(
+ r"""
+ This app shows how the choice of regularization in a least squares regression
+ problem can affect the sparsity of solutions.
+
+ We will use CVXPY to solve the problem
+
+ \[
+ \begin{equation*}
+ \begin{array}{ll}
+ \text{minimize} & \|A x - b\|_2^2 + \lambda \|x \|_p \\
+ \end{array}
+ \end{equation*}
+ \]
+
+ where $A \in \mathbf{R}^{m \times n}$ and $b \in \mathbf{R}^{m}$ are problem
+ data, $x \in \mathbf{R}^n$ is the optimization variable, and
+ $\lambda > 0$ is
+ a scalar that controls the strength of the regularization.
+
+ Let's experiment how solutions to this problem differ for $p=1$,
+
+ \[
+ \|x\|_1 = \sqrt{|x_1| + |x_2| + \cdots + |x_n|},
+ \]
+
+ and $p=2$,
+
+ \[
+ \|x\|_2 = \sqrt{x_1^2 + x_2^2 + \cdots + x_n^2}.
+ \]
+ """
+ )
+ return
+
+
+def __():
+ m = 100
+ n = 20
+ return m, n
+
+
+def __(m, n, np):
+ np.random.seed(0)
+ A = np.random.randn(m, n)
+ b = np.random.randn(m)
+ return A, b
+
+
+def __(A, b, sparse_solver):
+ l2_solver = sparse_solver(A, b, p=2)
+ l1_solver = sparse_solver(A, b, p=1)
+ return l1_solver, l2_solver
+
+
+def __(functools, l1_solver, l2_solver, np, sparsity_parameter):
+ x_min_max= [np.inf, -np.inf]
+
+ @functools.cache
+ def solve(lambd):
+ return l2_solver(lambd), l1_solver(lambd)
+
+ x_l2, x_l1 = solve(sparsity_parameter.value)
+ return solve, x_l1, x_l2, x_min_max
+
+
+def __(mo):
+ mo.md("## Parameter selection")
+ return
+
+
+def __(mo):
+ sparsity_parameter = mo.ui.slider(0, 10, step=0.1)
+ mo.md(
+ f"""
+ Choose the regularization strength $\lambda$: {sparsity_parameter}
+ """)
+ return sparsity_parameter,
+
+
+def __(mo, n, number_of_zeros, sparsity_parameter, x_l1, x_l2):
+ (
+ mo.md(
+ """
+ **$\lambda$ = 0.**
+
+ No regularization is applied. The solutions are the same.
+ """
+ )
+ if sparsity_parameter.value == 0 else
+ mo.md(
+ f"""
+ **$\lambda$ = {sparsity_parameter.value}.**
+
+ Watch how the fraction of entries of $x$ near $0$ changes as $\lambda$
+ increases.
+
+ **$p=1$**: {number_of_zeros(x_l1) / n * 100:.02f}% of the entries of
+ $x$ are extremely close to $0$.
+
+ **$p=2$**: {number_of_zeros(x_l2) / n * 100:.02f}% of the entries of
+ $x$ are extremely close to $0$.
+ """
+ )
+ )
+ return
+
+
+def __(cdf, plt, x_l1, x_l2):
+ cdf_figure, cdf_axs = plt.subplots(2, 1, sharex=True)
+ cdf(x_l1, cdf_axs[0]).set_title("$p=1$")
+ cdf(x_l2, cdf_axs[1]).set_title("$p=2$")
+ plt.tight_layout()
+ cdf_figure
+ return cdf_axs, cdf_figure
+
+
+def __(mo):
+ mo.md(
+ """
+ ## Sparsity
+
+ The $\ell_1$ norm, when used as a regularizer, encourages solutions
+ to be _sparse_: to have many zeros and only a few nonzeros.
+
+ A sparse regressor (if it is a good model) encodes which featuers
+ are important for making predictions, and which are not: If a component
+ of $x$ is $0$, then the corresponding feature or measurement
+ must not be important in making predictions.
+ """
+ )
+ return
+
+
+def __(np):
+ def number_of_zeros(x):
+ return np.isclose(x, 0).sum()
+ return number_of_zeros,
+
+
+def __(np, x_min_max):
+ def cdf(x, ax):
+ heights = np.arange(1, x.size+1) / x.size
+ xs = np.sort(x)
+ if np.min(xs) < x_min_max[0]:
+ x_min_max[0] = np.min(xs)
+ if np.max(xs) > x_min_max[1]:
+ x_min_max[1] = np.max(xs)
+ ax.set_xlim(-0.2, 0.2)
+ ax.step(xs, heights)
+ ax.set_xlabel('$x_i$')
+ ax.set_ylabel('fraction of components')
+ return ax
+ return cdf,
+
+
+def __(cp):
+ def sparse_solver(A, b, p):
+ x = cp.Variable(A.shape[1])
+ lambd = cp.Parameter(nonneg=True)
+ objective = cp.Minimize(
+ cp.norm(A @ x - b) +
+ lambd*cp.norm(x, p)
+ )
+ problem = cp.Problem(objective, [cp.abs(x) <= 0.5])
+ def solve(v):
+ lambd.value = v
+ problem.solve()
+ return x.value
+ return solve
+ return sparse_solver,
+
+
+def __():
+ import cvxpy as cp
+ import matplotlib.pyplot as plt
+ import numpy as np
+ return cp, np, plt
+
+
+def __():
+ import functools
+ return functools,
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/optimization/signals/app.py b/examples/optimization/signals/app.py
new file mode 100644
index 0000000000..a6068eb948
--- /dev/null
+++ b/examples/optimization/signals/app.py
@@ -0,0 +1,939 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# Signal Decomposition")
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ This app is a hands-on introduction to _signal decomposition_, an
+ age-old problem about breaking down a complex signal, also known as a
+ time series, into the sum of simpler interpretable ones.
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ The simpler signals that come out of a decomposition are called
+ _components_. When doing a signal decomposition, we have to specify
+ two things:
+
+ 1. How many components do we want?
+ 2. What kinds of components, or "component classes", do we want?
+ """
+ )
+ return
+
+
+def __(complib, mo):
+ component_options = [
+ complib.Components.TREND_LINE,
+ complib.Components.PERIODIC,
+ complib.Components.PIECEWISE_CONSTANT,
+ ]
+
+ # will be used to track which options the user has tried
+ component_radio_tracker = set()
+
+ component_radio = mo.ui.radio(component_options, label="**Component Class**")
+ other_component_radio = mo.ui.radio(
+ component_options, label="**Component Class**"
+ )
+ return (
+ component_options,
+ component_radio,
+ component_radio_tracker,
+ other_component_radio,
+ )
+
+
+def __(component_radio, other_component_radio):
+ radios = [component_radio, other_component_radio]
+ return radios,
+
+
+def __(intro_problem, mo):
+ intro = intro_problem.IntroProblem()
+
+ mo.md(
+ f"""
+ ## Part 1: Understanding components
+
+ Let's build a decomposition for this signal:
+
+ {mo.as_html(intro.plot())}
+ """
+ )
+ return intro,
+
+
+def __(mo, show_third_component):
+ _n_components = "2" if not show_third_component else "3"
+ _three_component_text = " and third " if show_third_component else ""
+
+ mo.md(
+ f"""
+ - Every decomposition needs at least two components. We'll make
+ **{_n_components}** components.
+
+ - We have to choose the component classes out of a library of
+ available classes.
+
+ - _Noise component_: The first component always represents noise,
+ or a residual; we typically want it to be small.
+
+ - _Other components_: What to choose for
+ the other components depends on what properties we suspect the
+ underlying simpler signals to have.
+
+ Use the radio buttons to try a few options for the second
+ {_three_component_text} component.
+ """
+ )
+ return
+
+
+def __(intro, mo, radios, show_third_component):
+ # Show radios
+ (
+ mo.hstack(
+ [
+ radios[0],
+ *intro.plot_decomp(
+ (radios[0].value,) if radios[0].value is not None else tuple(),
+ width=2.5,
+ height=2,
+ min_plots=2,
+ ),
+ ],
+ )
+ if not show_third_component
+ else mo.hstack(radios, justify="space-around")
+ )
+ return
+
+
+def __(component_options, component_radio_tracker, radios):
+ if radios[0].value is not None:
+ component_radio_tracker.add(radios[0].value)
+
+
+ def user_tried_all_components():
+ return len(component_radio_tracker) == len(component_options)
+ return user_tried_all_components,
+
+
+def __(intro, mo, radios, show_third_component):
+ # Plot 3-component decomposition
+ (
+ None
+ if not show_third_component
+ else mo.hstack(
+ [
+ *intro.plot_decomp(
+ tuple(r.value for r in radios if r.value is not None),
+ width=2.5,
+ height=2,
+ min_plots=3,
+ )
+ ]
+ )
+ )
+ return
+
+
+def __(explainer, mo, radios, show_third_component):
+ # Component explainer callout
+ (
+ mo.md(explainer.explainer(radios[0].value)).callout(kind="neutral")
+ if not show_third_component and radios[0].value is not None
+ else None
+ )
+ return
+
+
+def __(mo):
+ class _Toggle:
+ value = False
+
+ def toggle(self):
+ self.value = not self.value
+ return self
+
+ def __bool__(self):
+ return self.value
+
+
+ _show_third_component = _Toggle()
+ add_component_button = mo.ui.button(
+ label="Add another component 🔧",
+ value=_show_third_component,
+ on_click=lambda v: v.toggle(),
+ )
+ remove_component_button = mo.ui.button(
+ label="Remove third component 🔧",
+ value=_show_third_component,
+ on_click=lambda v: v.toggle(),
+ )
+ return add_component_button, remove_component_button
+
+
+def __(
+ add_component_button,
+ mo,
+ show_third_component,
+ solved,
+ user_tried_all_components,
+):
+ # Add component callout
+ (
+ mo.md(
+ f"""
+ {add_component_button.center()}
+
+ It looks like you tried all the component classes. No matter which
+ one you tried, the noise signal that came out didn't really look
+ small and random. _When that happens, that usually means we
+ need to add another component to our decomposition_.
+ """
+ ).callout(kind="alert")
+ if user_tried_all_components()
+ and not show_third_component
+ and not solved.now
+ else None
+ )
+ return
+
+
+def __():
+ class StickyBool:
+ value = False
+
+ def set(self):
+ self.value = True
+ return self
+
+ def __bool__(self):
+ return self.value
+
+
+ solved_ever = StickyBool()
+ return StickyBool, solved_ever
+
+
+def __(complib, radios, solved_ever):
+ _chosen_components = set([r.value for r in radios])
+
+
+ class Solved:
+ def __init__(self, sticky_bool):
+ self.ever = sticky_bool
+ self.now = False
+
+
+ solved = Solved(solved_ever)
+ solved.now = _chosen_components == set(
+ [complib.Components.TREND_LINE, complib.Components.PERIODIC]
+ )
+ if solved.now:
+ solved_ever.set()
+ return Solved, solved
+
+
+def __(mo, show_third_component, solved):
+ # Solved callout
+ (
+ mo.md(
+ f"""
+ 🎉 **_You did it!_**
+
+ The noise is small and looks random, and the decomposition has
+ linear and seasonal components. In fact, the signal was
+ generated by adding a line to a sine wave.
+
+ In the real world, where signals are measurements of messy
+ data, you won't ever know if you've "solved" a signal
+ decomposition problem. Instead you'll have to use your own
+ intuition to guide the selection of component classes.
+
+ In this sense, signal decomposition is kind of like
+ unsupervised machine learning tasks, like clustering or
+ embedding: it's up to you to judge whether or not your
+ decomposition is a good one.
+
+ **Part 2 is now available**.
+ """
+ ).callout(kind="success")
+ if show_third_component and solved.now
+ else None
+ )
+ return
+
+
+def __(mo, solved):
+ (
+ mo.md(
+ """**Heads up!**
+
+ In part 2, you'll encounter something new: component class
+ parameters. Parameters are knobs you can use to customize
+ components.
+
+ You'll also encounter some new component classes. If you're
+ ever unsure about what a component does, check out the reference
+ at the bottom of the page.
+ """
+ ).callout(kind="alert")
+ if solved.ever
+ else None
+ )
+ return
+
+
+def __(
+ mo,
+ remove_component_button,
+ show_third_component,
+ solved,
+ user_tried_all_components,
+):
+ # Remove component button: shown when 3 components active
+ (
+ mo.md(
+ f"""
+ {remove_component_button.center()}
+
+ Try making a decomposition with three components.
+ We'll tell you once you've found the "right" decomposition.
+
+ Hint: we generated the signal by adding a seasonal fluctuation
+ to a line with constant slope.
+ """
+ ).callout(kind="alert")
+ if user_tried_all_components() and show_third_component and not solved.now
+ else None
+ )
+ return
+
+
+def __(add_component_button, remove_component_button):
+ # Interacting with either button should update `show_third_component`
+ (add_component_button, remove_component_button)
+
+ show_third_component = add_component_button.value
+ return show_third_component,
+
+
+def __(mo):
+ mo.md("## Part 2: More Decompositions")
+ return
+
+
+def __(mo, problems):
+ selected_problem = mo.ui.dropdown(
+ {
+ problems.MaunaLoa.name(): problems.MaunaLoa,
+ problems.ChangePoint.name(): problems.ChangePoint,
+ problems.SolarPower.name(): problems.SolarPower,
+ problems.Soiling.name(): problems.Soiling,
+ problems.CustomDataProblem.name(): problems.CustomDataProblem,
+ },
+ label="Choose a signal:",
+ )
+ return selected_problem,
+
+
+def __(mo, selected_problem, solved):
+ # Solve part 1 callout
+ (
+ mo.md(
+ f"""
+ **Part 1** taught you the basics of signal decomposition. In
+ **Part 2**, you'll apply what you learned to decompose some real-world
+ signals, as well as some more synthetic ones.
+
+ Start by choosing a signal. We
+ recommend starting with the CO~2~ signal, which tracks atmospheric
+ emissions at the Mauna Loa Observatory.
+
+ {selected_problem.center()}
+ """
+ )
+ if solved.ever
+ else mo.md(
+ """
+ 🛑 Part 2 isn't available yet. Keep experimenting with
+ component classes in part 1 until you've "solved" the decomposition,
+ then return here.
+ """
+ ).callout(kind="warn")
+ )
+ return
+
+
+def __(problems, selected_problem):
+ show_data_uploader = selected_problem.value == problems.CustomDataProblem
+ return show_data_uploader,
+
+
+def __(mo):
+ data_uploader = mo.ui.file(filetypes=[".csv"], kind="area")
+ csv_has_header = mo.ui.checkbox(value=True)
+ return csv_has_header, data_uploader
+
+
+def __(csv_has_header, data_uploader, mo, show_data_uploader):
+ def read_uploaded_csv():
+ from io import BytesIO
+ import pandas as pd
+
+ if data_uploader.value:
+ header = "infer" if csv_has_header.value else None
+ return pd.read_csv(BytesIO(data_uploader.contents()), header=header)
+ return None
+
+
+ _uploaded_df = read_uploaded_csv()
+ column_name = (
+ mo.ui.dropdown({str(c): c for c in _uploaded_df.columns.tolist()})
+ if _uploaded_df is not None
+ else None
+ )
+
+
+ def _show_csv_parameters():
+ if _uploaded_df is not None:
+ return f"""
+
+ _Check if your data file has a header:_ {csv_has_header}
+
+ _Column containing signal:_ {column_name}
+
+ Here's a preview of what you uploaded:
+
+ {mo.hstack([_uploaded_df.head()], justify="center")}
+ """
+ else:
+ return ""
+
+
+ (
+ mo.md(
+ f"""
+ **Upload a signal.**
+
+ You can upload your own signal and use this app to build a
+ decomposition for it. Your signal should be a CSV file.
+
+ {data_uploader}
+
+ {_show_csv_parameters()}
+ """
+ ).callout()
+ if show_data_uploader
+ else None
+ )
+ return column_name, read_uploaded_csv
+
+
+def __(
+ column_name,
+ data_uploader,
+ problems,
+ read_uploaded_csv,
+ selected_problem,
+):
+ def _construct_problem(problem_class):
+ if problem_class == problems.CustomDataProblem:
+ if not data_uploader.value or column_name.value is None:
+ return None
+ df = read_uploaded_csv()
+ return problems.CustomDataProblem(
+ df[column_name.value], column_name.value
+ )
+ elif problem_class is not None:
+ return problem_class()
+ else:
+ return None
+
+
+ problem = _construct_problem(selected_problem.value)
+ return problem,
+
+
+def __(mo, problem):
+ mo.md(f"### {problem.name()}") if problem is not None else None
+ return
+
+
+def __(problem):
+ problem.description() if problem is not None else None
+ return
+
+
+def __(mo, problem):
+ # Add a ref to `problem`:
+ # When the problem is changed, this cell should be reset.
+ problem
+
+
+ class _Counter:
+ def __init__(self, value):
+ self.value = value
+
+ def increment(self):
+ self.value += 1
+ return self
+
+ def decrement(self):
+ self.value = max(2, self.value - 1)
+ return self
+
+
+ part_two_n_components_counter = _Counter(2)
+
+ add_button = mo.ui.button(
+ value=part_two_n_components_counter,
+ on_click=lambda v: v.increment(),
+ label="Add a component",
+ )
+ remove_button = mo.ui.button(
+ value=part_two_n_components_counter,
+ on_click=lambda v: v.decrement(),
+ label="Remove a component",
+ )
+ return add_button, part_two_n_components_counter, remove_button
+
+
+def __(add_button, part_two_n_components_counter, remove_button):
+ (add_button, remove_button)
+
+ part_two_k = part_two_n_components_counter.value
+ return part_two_k,
+
+
+def __(problem):
+ # Add a ref to `problem`:
+ # When the problem is changed, this cell should be reset.
+ problem
+
+ selected_components = []
+ selected_params = {}
+
+
+ def get_default_component_value(index):
+ if index >= len(selected_components):
+ return None
+ return selected_components[index]
+ return get_default_component_value, selected_components, selected_params
+
+
+def __(
+ component_array,
+ component_params,
+ selected_components,
+ selected_params,
+):
+ # When the component classes or their parameters change, we need to update
+ # their default values
+ selected_components[:] = component_array.value
+
+ selected_params.clear()
+ selected_params.update(component_params.value)
+ return
+
+
+def __(complib, get_default_component_value, mo, part_two_k):
+ _dropdowns = [
+ mo.ui.dropdown(
+ complib.RESIDUAL_COMPONENTS if i == 0 else complib.COMPONENT_LIBRARY,
+ value=get_default_component_value(i),
+ allow_select_none=True,
+ )
+ for i in range(part_two_k)
+ ]
+
+ component_array = mo.ui.array(_dropdowns, label="Components")
+ return component_array,
+
+
+def __(
+ add_button,
+ complib,
+ component_array,
+ mo,
+ problem,
+ remove_button,
+ selected_params,
+):
+ # Add a ref to `problem`:
+ # This cell shouldn't show when a problem isn't selected,
+ # and when the problem is changed, this cell should be reset.
+ problem
+
+ component_params = mo.ui.dictionary(
+ {
+ f"{i}": complib.parameter_controls(c, selected_params.get(str(i), {}))
+ for i, c in enumerate(component_array.value)
+ if c is not None
+ },
+ label="Parameters",
+ )
+
+ (
+ mo.md(
+ f"""
+ ## {mo.md(f"{add_button} {remove_button}").center()}
+ """
+ )
+ if problem is not None
+ else None
+ )
+ return component_params,
+
+
+def __(component_array, component_params, mo, problem):
+ (
+ mo.hstack([component_array, component_params])
+ if problem is not None
+ else None
+ )
+ return
+
+
+def __(component_array):
+ noise_component_selected = component_array.value[0] is not None
+ return noise_component_selected,
+
+
+def __(component_array, noise_component_selected, problem):
+ should_compute_decomposition = (
+ noise_component_selected
+ and sum(1 for v in component_array.value if v is not None) >= 2
+ ) and problem is not None
+ return should_compute_decomposition,
+
+
+def __(problem):
+ problem
+
+ selected_aggregate_components = {}
+ selected_aggregate_params = {}
+
+
+ def get_default_aggregate_component_value(key, index):
+ if key not in selected_aggregate_components:
+ return None
+ selected_components = selected_aggregate_components[key]
+ if index >= len(selected_components):
+ return None
+ return selected_components[index]
+ return (
+ get_default_aggregate_component_value,
+ selected_aggregate_components,
+ selected_aggregate_params,
+ )
+
+
+def __(
+ complib,
+ component_array,
+ component_params,
+ get_default_aggregate_component_value,
+ mo,
+):
+ _aggregates = {}
+ _options = [v for v in complib.COMPONENT_LIBRARY if v != "Aggregate"]
+
+ for _i, _component in enumerate(component_array.value):
+ _key = str(_i)
+ if _component == "Aggregate":
+ _dropdowns = [
+ mo.ui.dropdown(
+ _options,
+ get_default_aggregate_component_value(_key, i),
+ allow_select_none=True,
+ )
+ for i in range(component_params.value[_key]["components"])
+ ]
+ _aggregates[_key] = mo.ui.array(_dropdowns, label="components")
+
+ aggregates = mo.ui.dictionary(_aggregates, label="Aggregates")
+ return aggregates,
+
+
+def __(
+ aggregate_params,
+ aggregates,
+ selected_aggregate_components,
+ selected_aggregate_params,
+):
+ selected_aggregate_components.clear()
+ selected_aggregate_components.update(aggregates.value)
+
+ selected_aggregate_params.clear()
+ selected_aggregate_params.update(aggregate_params.value)
+ return
+
+
+def __(aggregates, complib, mo, problem, selected_aggregate_params):
+ problem
+
+ _aggregate_params = {}
+
+ for _key, _components in aggregates.value.items():
+ defaults = selected_aggregate_params.get(_key, {})
+ _aggregate_params[_key] = mo.ui.dictionary(
+ {
+ f"{i}": complib.parameter_controls(c, defaults.get(str(i), {}))
+ for i, c in enumerate(_components)
+ if c is not None
+ },
+ label="Parameters",
+ )
+
+ aggregate_params = mo.ui.dictionary(
+ _aggregate_params, label="Aggregate Parameters"
+ )
+
+ (mo.hstack([aggregates, aggregate_params]) if aggregates.value else None)
+ return aggregate_params, defaults
+
+
+def __(aggregate_params, aggregates, component_params):
+ def _rollup_aggregate_params(aggregates, aggregate_params, params_dict):
+ params_dict = params_dict.copy()
+ for component_key, components in aggregates.items():
+ children = []
+ params = aggregate_params[component_key]
+ for i, component in enumerate(components):
+ if component is not None:
+ children.append((component, params[str(i)]))
+ params_dict[component_key]["children"] = children
+ return tuple(params_dict.values())
+
+
+ rolled_up_params = _rollup_aggregate_params(
+ aggregates.value, aggregate_params.value, component_params.value
+ )
+ return rolled_up_params,
+
+
+def __(
+ component_array,
+ mo,
+ noise_component_selected,
+ problem,
+ rolled_up_params,
+ should_compute_decomposition,
+):
+ def _feedback():
+ if not noise_component_selected and any(
+ v is not None for v in component_array.value
+ ):
+ return mo.md(
+ """
+ Make sure to set the first component, which represents noise.
+ """
+ ).callout(kind="alert")
+ elif noise_component_selected and not should_compute_decomposition:
+ return mo.md(
+ """
+ Great job choosing the noise component. Now choose at least one
+ more component.
+ """
+ ).callout(kind="neutral")
+ elif should_compute_decomposition:
+ return problem.feedback(
+ [c for c in component_array.value if c is not None],
+ rolled_up_params,
+ )
+
+
+ _feedback() if problem is not None else None
+ return
+
+
+def __(complib, problem, problems):
+ def construct_components(names, parameters):
+ center_periodic = isinstance(problem, problems.MaunaLoa)
+ return list(
+ filter(
+ lambda v: v is not None,
+ [
+ complib.construct_component(name, param_group, center_periodic)
+ for name, param_group in zip(names, parameters)
+ ],
+ )
+ )
+ return construct_components,
+
+
+def __(construct_components):
+ def decompose(problem, components, params):
+ c = construct_components(components, params)
+ f = problem.decompose(c)
+ f.set_figwidth(6.4)
+ return f
+ return decompose,
+
+
+def __(
+ component_array,
+ decompose,
+ plt,
+ problem,
+ rolled_up_params,
+ should_compute_decomposition,
+):
+ def _do_decomposition():
+ components = tuple([v for v in component_array.value if v is not None])
+ f = decompose(problem, components, rolled_up_params)
+ plt.tight_layout()
+ f.axes[0].set_title("Noise Component: %s" % components[0])
+ for i, c in enumerate(components[1:]):
+ if c is not None:
+ f.axes[i + 1].set_title(c + " Component")
+ f.axes[-1].set_title("Denoised Signal")
+ return f
+
+
+ _do_decomposition() if should_compute_decomposition else None
+ return
+
+
+def __(complib, mo):
+ explainer_choice = mo.ui.dropdown(complib.COMPONENT_LIBRARY)
+ return explainer_choice,
+
+
+def __(explainer_choice, mo, solved):
+ (
+ mo.md(
+ f"""
+ ## Reference
+
+ Tell me more about the {explainer_choice} component class.
+ """
+ )
+ if solved.ever
+ else None
+ )
+ return
+
+
+def __(explainer, explainer_choice, mo):
+ mo.md(
+ explainer.explainer(explainer_choice.value)
+ ).callout() if explainer_choice.value is not None else ""
+ return
+
+
+def __(mo, solved):
+ (
+ mo.md(
+ """
+ #### More about Signal Decomposition
+
+ This tutorial is based on the research book, ["Signal Decomposition
+ Using Masked Proximal Operators"](https://web.stanford.edu/~boyd/papers/sig_decomp_mprox.html),
+ by Bennet Meyers and Stephen Boyd. It uses the [`signal-decomp`](https://github.com/cvxgrp/signal-decomposition) Python library to
+ compute decompositions.
+
+ We hope this app shows that math can be intuitive, actionable,
+ and fun.
+ """
+ )
+ if solved.ever
+ else None
+ )
+ return
+
+
+def __():
+ import gfosd
+ import gfosd.components as gfc
+ import numpy as np
+ import marimo as mo
+ import matplotlib.pyplot as plt
+ return gfc, gfosd, mo, np, plt
+
+
+def __():
+ import importlib
+ import modules.components as complib
+ import modules.intro_problem as intro_problem
+ import modules.problems as problems
+ import modules.explainer as explainer
+
+ problems.configure_matplotlib()
+ _ = importlib.reload(complib)
+ _ = importlib.reload(explainer)
+ _ = importlib.reload(problems)
+ _ = importlib.reload(intro_problem)
+ return complib, explainer, importlib, intro_problem, problems
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/optimization/signals/assets/solar_power_soiling_reference.png b/examples/optimization/signals/assets/solar_power_soiling_reference.png
new file mode 100644
index 0000000000..7babcc8592
Binary files /dev/null and b/examples/optimization/signals/assets/solar_power_soiling_reference.png differ
diff --git a/examples/optimization/signals/examples.py b/examples/optimization/signals/examples.py
new file mode 100644
index 0000000000..f0a247e82b
--- /dev/null
+++ b/examples/optimization/signals/examples.py
@@ -0,0 +1,236 @@
+import marimo
+
+__generated_with = "0.0.1a0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# Examples")
+ return
+
+
+def _(mo):
+ mo.md("## Real Data")
+ return
+
+
+def _(mo):
+ mo.md("### NOAA CO2")
+ return
+
+
+def _(dataloaders, mo, plt):
+ co2_df = dataloaders.get_c02_data()
+
+ plt.figure(figsize=(6, 3))
+ co2_df.plot(y="average", x="decimal", ax=plt.gca())
+ plt.tight_layout()
+ mo.tree([co2_df.head(2), plt.gca()], label="data")
+ return co2_df,
+
+
+def _(co2_df, mo, solutions):
+ co2_problem = solutions.co2_problem(co2_df)
+ co2_problem.decompose()
+ mo.tree(
+ [co2_problem.plot_decomposition(figsize=(6, 5))], label="decomposition"
+ )
+ return co2_problem,
+
+
+def _(co2_df, co2_problem, mo, plt):
+ co2_df.plot(y="average", x="decimal")
+ plt.figure(figsize=(6, 3))
+ plt.plot(co2_df["decimal"], co2_problem.decomposition[1])
+ plt.legend(["measured weekly average", "long-term trend"])
+ plt.tight_layout()
+ mo.tree([plt.gca()], "long-term trend")
+ return
+
+
+def _(mo):
+ mo.md("### Solar power generation")
+ return
+
+
+def _(dataloaders, mo, plt):
+ pv_df = dataloaders.get_pvdaq_data()
+ _fig = pv_df.loc[:"2011-01-15"].plot(y="dc_power", figsize=(6, 3))
+ plt.tight_layout()
+ mo.tree(
+ [
+ pv_df.head(2),
+ _fig,
+ ],
+ label="data",
+ )
+ return pv_df,
+
+
+def _(mo, pv_df, solutions):
+ pv_problem = solutions.pvdaq_problem(pv_df)
+ pv_problem.decompose()
+ mo.tree(
+ [pv_problem.plot_decomposition(exponentiate=True, figsize=(6, 5))],
+ label="decomposition",
+ )
+ return pv_problem,
+
+
+def _(mo):
+ mo.md("## Synthetic Data")
+ return
+
+
+def _(mo):
+ mo.md("### Basic changepoint detection")
+ return
+
+
+def _(dataloaders, mo, plt):
+ bcd_y, bcd_X_real = dataloaders.make_changepoint_data()
+ plt.figure(figsize=(6.5, 3))
+ plt.plot(bcd_y, label="observed data, $y$")
+ plt.plot(bcd_X_real[1], label="true denoised signal")
+ plt.legend()
+ mo.tree([plt.gca()], "data")
+ return bcd_X_real, bcd_y
+
+
+def _(mo):
+ mo.md("**Exact, nonconvex version**")
+ return
+
+
+def _(bcd_X_real, bcd_y, mo, solutions):
+ bcd_problem_ncvx = solutions.basic_changepoint_problem_exact(bcd_y)
+ bcd_problem_ncvx.decompose()
+ mo.tree(
+ [
+ bcd_problem_ncvx.plot_decomposition(
+ X_real=bcd_X_real, figsize=(6, 5)
+ )
+ ],
+ label="decomposition",
+ )
+ return bcd_problem_ncvx,
+
+
+def _(mo):
+ mo.md("**Heuristic, convex version**")
+ return
+
+
+def _(bcd_X_real, bcd_y, mo, solutions):
+ bcd_problem = solutions.basic_changepoint_problem_heuristic(bcd_y)
+ bcd_problem.decompose()
+ mo.tree(
+ [bcd_problem.plot_decomposition(X_real=bcd_X_real, figsize=(6, 5))],
+ "decomposition",
+ )
+ return bcd_problem,
+
+
+def _(mo):
+ mo.md("### Harder changepoint detection")
+ return
+
+
+def _(dataloaders, mo, plt):
+ hcd_y, hcd_X_real = dataloaders.make_changepoint_data(
+ include_periodic_component=True
+ )
+ plt.figure(figsize=(6, 3))
+ plt.plot(hcd_y, label="observed data, $y$")
+ plt.plot(hcd_X_real[1] + hcd_X_real[2], label="true denoised signal")
+ plt.legend()
+ plt.tight_layout()
+ mo.tree([plt.gca()], "data")
+ return hcd_X_real, hcd_y
+
+
+def _(hcd_X_real, hcd_y, mo, solutions):
+ hcd_problem = solutions.hard_changepoint_problem(hcd_y)
+ hcd_problem.decompose()
+ mo.tree(
+ [hcd_problem.plot_decomposition(X_real=hcd_X_real, figsize=(6, 5))],
+ "decomposition",
+ )
+ return hcd_problem,
+
+
+def _(mo):
+ mo.md("### Synthetic soiling data")
+ return
+
+
+def _(dataloaders, mo, plt):
+ ss_df, _name = dataloaders.make_soiling_data()
+ plt.figure(figsize=(6, 3))
+ plt.scatter(ss_df.index, ss_df.daily_norm, 5, alpha=0.5, label="data, $y$")
+ plt.plot(
+ ss_df.index,
+ ss_df.PI_no_noise,
+ "k",
+ alpha=0.5,
+ label="true signal with no noise",
+ )
+ plt.ylim(0.6, 1.06)
+ plt.legend(loc=3)
+ plt.title(_name)
+ mo.tree([plt.gca()], label="data")
+ return ss_df,
+
+
+def _(mo, np, plt, solutions, ss_df):
+ ss_problem, _xr = solutions.soiling_problem(ss_df)
+ ss_problem.decompose()
+ _fig = ss_problem.plot_decomposition(X_real=_xr, figsize=(6, 12))
+ _avg = np.average(ss_problem.decomposition[1])
+ _fig.axes[1].set_ylim(_avg - 2.5, _avg + 2.5)
+ plt.tight_layout()
+ mo.tree([plt.gca()], "decomposition")
+ return ss_problem,
+
+
+def __():
+ import matplotlib.pyplot as plt
+ import numpy as np
+ import pandas as pd
+
+ import modules.dataloaders as dataloaders
+ import modules.solutions as solutions
+ return dataloaders, np, pd, plt, solutions
+
+
+def _():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/optimization/signals/modules/__init__.py b/examples/optimization/signals/modules/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/examples/optimization/signals/modules/components.py b/examples/optimization/signals/modules/components.py
new file mode 100644
index 0000000000..9c45067214
--- /dev/null
+++ b/examples/optimization/signals/modules/components.py
@@ -0,0 +1,138 @@
+from __future__ import annotations
+from dataclasses import dataclass, fields
+
+import marimo as mo
+from gfosd import components as gfc
+
+
+@dataclass
+class Components:
+ UNIFORMLY_SMALL: str = "Small, Uniformly"
+ SPARSE_SMALL: str = "Small, Sparse"
+ ASYMMETRIC_SMALL: str = "Small, Asymmetrically"
+ SMOOTH: str = "Smooth"
+ PERIODIC: str = "Periodic"
+ PIECEWISE_CONSTANT: str = "Piecewise Constant"
+ TREND_LINE: str = "Trend-line"
+ AGGREGATE: str = "Aggregate"
+ AVERAGE_EQUAL: str = "Average Equal"
+ CONSTANT: str = "Constant"
+ FIRST_VALUE_FIXED: str = "First Value Fixed"
+
+
+@dataclass
+class ResidualComponents:
+ UNIFORMLY_SMALL: str = Components.UNIFORMLY_SMALL
+ SPARSE_SMALL: str = Components.SPARSE_SMALL
+ ASYMMETRIC_SMALL: str = Components.ASYMMETRIC_SMALL
+
+
+def _sorted(collection) -> list:
+ return list(sorted(collection))
+
+
+RESIDUAL_COMPONENTS = _sorted([e.default for e in fields(ResidualComponents)])
+COMPONENT_LIBRARY = _sorted([e.default for e in fields(Components)])
+
+
+@dataclass
+class Parameters:
+ PERIOD: str = "period"
+ WEIGHT: str = "weight"
+ THRESHOLD: str = "threshold"
+ COMPONENTS: str = "components"
+ FIRST_VALUE: str = "first value"
+ AVERAGE: str = "average"
+ CHILDREN: str = "children"
+
+
+PARAMETER_UNIVERSE = {
+ Parameters.PERIOD: [Components.PERIODIC],
+ Parameters.WEIGHT: [
+ Components.SMOOTH,
+ Components.PIECEWISE_CONSTANT,
+ ],
+ Parameters.THRESHOLD: [ResidualComponents.ASYMMETRIC_SMALL],
+ Parameters.COMPONENTS: [Components.AGGREGATE],
+ Parameters.FIRST_VALUE: [Components.FIRST_VALUE_FIXED],
+ Parameters.AVERAGE: [Components.AVERAGE_EQUAL],
+}
+
+PARAMETER_DEFAULTS = {
+ Parameters.PERIOD: [182, lambda v: mo.ui.slider(1, 365, step=1, value=v)],
+ Parameters.WEIGHT: [0, lambda v: mo.ui.slider(-3, 3, value=v)],
+ Parameters.THRESHOLD: [
+ 0.5,
+ lambda v: mo.ui.slider(0, 1, step=0.05, value=v),
+ ],
+ Parameters.COMPONENTS: [2, lambda v: mo.ui.number(1, 5, step=1, value=v)],
+ Parameters.FIRST_VALUE: [
+ 0,
+ lambda v: mo.ui.number(-100, 100, step=1, value=v),
+ ],
+ Parameters.AVERAGE: [
+ 0,
+ lambda v: mo.ui.number(-100, 100, step=1, value=v),
+ ],
+}
+
+
+def parameter_controls(
+ component: Components | ResidualComponents, default_values
+) -> mo.ui.dictionary:
+ params = {}
+ for param in PARAMETER_UNIVERSE:
+ if component in PARAMETER_UNIVERSE[param]:
+ v, ctor = PARAMETER_DEFAULTS[param]
+ try:
+ v = default_values[param]
+ except KeyError:
+ pass
+ params[param] = ctor(v)
+ return mo.ui.dictionary(params, label=f"{component}")
+
+
+def construct_component(name, parameters, center_periodic=False):
+ if name == Components.UNIFORMLY_SMALL:
+ return gfc.SumSquare(weight=1)
+ elif name == Components.SPARSE_SMALL:
+ return gfc.SumAbs(weight=1)
+ elif name == Components.ASYMMETRIC_SMALL:
+ return gfc.SumQuantile(weight=1, tau=parameters[Parameters.THRESHOLD])
+ elif name == Components.SMOOTH:
+ return gfc.SumSquare(
+ diff=2, weight=10 ** parameters[Parameters.WEIGHT]
+ )
+ elif name == Components.PIECEWISE_CONSTANT:
+ return gfc.SumAbs(diff=1, weight=10 ** parameters[Parameters.WEIGHT])
+ elif name == Components.CONSTANT:
+ return gfc.NoSlope()
+ elif name == Components.PERIODIC:
+ if center_periodic:
+ return gfc.Aggregate(
+ [
+ gfc.Periodic(period=parameters[Parameters.PERIOD]),
+ gfc.AverageEqual(0),
+ ]
+ )
+ else:
+ return gfc.Periodic(period=parameters[Parameters.PERIOD])
+ elif name == Components.FIRST_VALUE_FIXED:
+ return gfc.FirstValEqual(parameters[Parameters.FIRST_VALUE])
+ elif name == Components.AVERAGE_EQUAL:
+ return gfc.AverageEqual(parameters[Parameters.AVERAGE])
+ elif name == Components.TREND_LINE:
+ return gfc.NoCurvature()
+ elif name == Components.AGGREGATE:
+ components = [
+ construct_component(name, params)
+ for name, params in parameters[Parameters.CHILDREN]
+ ]
+ if components:
+ return gfc.Aggregate(components)
+ else:
+ return None
+ elif name is None:
+ return None
+ else:
+ raise ValueError("Unknown component ", name)
diff --git a/examples/optimization/signals/modules/dataloaders.py b/examples/optimization/signals/modules/dataloaders.py
new file mode 100644
index 0000000000..5b8ec0e1db
--- /dev/null
+++ b/examples/optimization/signals/modules/dataloaders.py
@@ -0,0 +1,344 @@
+from __future__ import annotations
+
+import os.path
+from typing import Tuple, cast
+
+import numpy as np
+import numpy.typing as npt
+import pandas as pd
+
+
+def get_c02_data() -> pd.DataFrame:
+ path = "../data/co2_weekly_mlo.csv"
+ if not os.path.isfile(path):
+ path = (
+ "https://gml.noaa.gov/webdata/ccgg/trends/co2/co2_weekly_mlo.csv"
+ )
+ df = pd.read_csv(
+ path,
+ # column names on row 52, data starts on row 53
+ skiprows=51,
+ index_col=False,
+ na_values=[-999.99],
+ )
+ # group by year and count the number of rows for each year
+ year_counts = df.groupby("year").count()
+ # find the years with less than 53 rows
+ missing_years = year_counts[year_counts["decimal"] < 53].index.tolist()[
+ 1:-1
+ ]
+ new_rows = [df]
+ # make every year have exactly 53 entries by inserting NaNs at the end of
+ # the year
+ for year in missing_years:
+ num_blank_rows = 53 - year_counts.loc[year]["decimal"]
+ # Create a new DataFrame with blank rows and the same columns as the
+ # original
+ blank_rows = pd.DataFrame(
+ np.nan, index=np.arange(num_blank_rows), columns=df.columns
+ )
+ blank_rows["year"] = year
+ blank_rows["decimal"] = year + 0.995
+ # Append the current year's rows to the list of new rows
+ new_rows.append(blank_rows)
+ return pd.concat(new_rows).sort_values("decimal")
+
+
+def make_changepoint_data(
+ seed: int = 243, include_periodic_component: bool = False
+) -> Tuple[npt.NDArray, npt.NDArray]:
+ np.random.seed(seed)
+ true = np.ones(1000) * 12
+ true[400:] -= 1.5
+ msk = np.logical_and(
+ np.arange(1000) > 600, (np.arange(1000) // 100) % 2 == 0
+ )
+ true[msk] += 1
+ msk = np.logical_and(
+ np.arange(1000) > 750, (np.arange(1000) // 100) % 2 == 0
+ )
+ true[msk] += 1
+ noise = np.random.randn(1000) * 0.15
+ if include_periodic_component:
+ xs = np.arange(len(true))
+ smooth_per = np.sin(xs * 2 * np.pi / 400)
+ y = true + noise + smooth_per
+ return y, np.c_[noise, true, smooth_per].T
+ else:
+ y = true + noise
+ return y, np.c_[noise, true].T
+
+
+def get_pvdaq_data() -> pd.DataFrame:
+ path = "../data/pvdaq_data.csv"
+ if not os.path.isfile(path):
+ from solardatatools import get_pvdaq_data
+
+ pv_df = cast(
+ pd.DataFrame,
+ get_pvdaq_data(sysid=34, year=2011, api_key="DEMO_KEY"),
+ )
+ else:
+ pv_df = pd.read_csv(path, index_col=0)
+ pv_df.index = pd.DatetimeIndex(pv_df.index, freq="900S")
+ pv_df = pv_df.sort_index()
+
+ pv_df.loc[pv_df["dc_power"] < 0, "dc_power"] = np.nan
+ return pv_df
+
+
+def make_soiling_data(seed: int = 243) -> Tuple[pd.DataFrame, str]:
+ np.random.seed(seed)
+
+ def simulate_PV_time_series(
+ first_date,
+ last_date,
+ freq="1D",
+ degradation_rate=-0.005,
+ noise_scale=0.01,
+ seasonality_scale=0.01,
+ nr_of_cleaning_events=120,
+ soiling_rate_low=0.0001,
+ soiling_rate_high=0.003,
+ smooth_rates=False,
+ random_seed=False,
+ ):
+ if random_seed: # Have seed for repeatability
+ if not type(np.random.seed) == int:
+ np.random.seed(int(random_seed))
+
+ # Initialize time series and data frame
+ times = pd.date_range(first_date, last_date, freq=freq)
+ df = pd.DataFrame(
+ index=times,
+ columns=[
+ "day",
+ "noise",
+ "seasonality",
+ "degradation",
+ "soiling",
+ "cleaning_events",
+ ],
+ )
+ n = len(times)
+
+ df["day"] = range(n)
+ df["noise"] = np.random.normal(1.0, scale=noise_scale, size=n)
+ df["seasonality"] = (
+ seasonality_scale * np.sin(df["day"] / 365.25 * 2 * np.pi) + 1
+ )
+ df["degradation"] = 1 + degradation_rate / 365.25 * df["day"]
+
+ # simulate soiling
+ cleaning_events = np.random.choice(
+ df["day"], nr_of_cleaning_events, replace="False"
+ )
+ cleaning_events = np.sort(cleaning_events)
+
+ x = np.full(n, 1)
+ intervals = np.split(x, cleaning_events)
+ soiling_rate = []
+ for interval in intervals:
+ rate = np.random.uniform(
+ low=soiling_rate_low, high=soiling_rate_high, size=1
+ ) * np.ones(len(interval))
+ soiling_rate.append(rate)
+ df["soiling_rate"] = np.concatenate(soiling_rate)
+ if smooth_rates:
+ df.soiling_rate = (
+ df.soiling_rate.rolling(smooth_rates, center=True)
+ .mean()
+ .ffill()
+ .bfill()
+ )
+ derate = np.concatenate(
+ [
+ np.cumsum(si)
+ for si in np.split(df["soiling_rate"].values, cleaning_events)
+ ]
+ )
+ df["soiling"] = 1 - derate
+
+ # Generate Performance Indexes
+ df["PI_no_noise"] = (
+ df["seasonality"] * df["degradation"] * df["soiling"]
+ )
+ df["PI_no_soil"] = df["seasonality"] * df["degradation"] * df["noise"]
+ df["PI_no_degrad"] = df["seasonality"] * df["soiling"]
+ df["daily_norm"] = df["noise"] * df["PI_no_noise"]
+
+ return df
+
+ def simulate_PV_time_series_seasonal_soiling(
+ first_date,
+ last_date,
+ freq="1D",
+ degradation_rate=-0.005,
+ noise_scale=0.01,
+ seasonality_scale=0.01,
+ nr_of_cleaning_events=120,
+ soiling_rate_center=0.002,
+ soiling_rate_std=0.001,
+ soiling_seasonality_scale=0.9,
+ random_seed=False,
+ smooth_rates=False,
+ seasonal_rates=False,
+ ):
+ """As the name implies, this function models soiling rates that vary from day to day according
+ to a Gaussian distribution"""
+ if random_seed: # Have seed for repeatability
+ if not type(np.random.seed) == int:
+ np.random.seed(int(random_seed))
+
+ # Initialize time series and data frame
+ times = pd.date_range(first_date, last_date, freq=freq)
+ df = pd.DataFrame(index=times)
+ n = len(times)
+
+ df["day"] = range(n)
+ df["noise"] = np.random.normal(1.0, scale=noise_scale, size=n)
+ df["seasonality"] = (
+ seasonality_scale * np.sin(df["day"] / 365.25 * 2 * np.pi) + 1
+ )
+ df["degradation"] = 1 + degradation_rate / 365.25 * df["day"]
+
+ soiling_seasonality = (
+ soiling_rate_center
+ * soiling_seasonality_scale
+ * np.sin(
+ df["day"] / 365.25 * 2 * np.pi
+ + np.random.uniform(10, size=1) * np.pi
+ )
+ )
+ cleaning_probability = (
+ 2 - soiling_seasonality_scale
+ ) * soiling_seasonality.max() + soiling_seasonality
+ cleaning_probability /= cleaning_probability.sum()
+
+ # simulate soiling
+ cleaning_events = np.random.choice(
+ df["day"].values,
+ nr_of_cleaning_events,
+ replace="False",
+ p=cleaning_probability.values,
+ )
+ cleaning_events = np.sort(cleaning_events)
+ df["cleaning_events"] = [
+ True if day in cleaning_events else False for day in df.day
+ ]
+
+ x = np.full(n, 1)
+ intervals = np.split(x, cleaning_events)
+ soiling = []
+ soiling_rate = []
+ for interval in intervals:
+ if len(soiling) > 0:
+ pos = len(np.concatenate(soiling))
+ else:
+ pos = 0
+ if seasonal_rates:
+ if smooth_rates:
+ soiling_season = soiling_seasonality[
+ pos : pos + len(interval)
+ ]
+ rate = np.random.normal(
+ soiling_rate_center + soiling_season,
+ soiling_rate_std,
+ size=len(interval),
+ )
+ else:
+ soiling_season = soiling_seasonality[pos]
+ rate = np.random.normal(
+ soiling_rate_center + soiling_season,
+ soiling_rate_std,
+ size=1,
+ ) * np.ones(len(interval))
+ else:
+ if smooth_rates:
+ print("Smooth rates not possible without seasonal rates")
+ soiling_season = 0
+ rate = np.random.normal(
+ soiling_rate_center + soiling_season,
+ soiling_rate_std,
+ size=1,
+ ) * np.ones(len(interval))
+ derate = 1 - np.matmul(half_one_matrix(len(interval)), rate)
+ soiling.append(derate)
+ soiling_rate.append(rate)
+ df["soiling"] = np.concatenate(soiling)
+ df["soiling_rate"] = np.concatenate(soiling_rate)
+
+ # Generate Performance Indexes
+ df["PI_no_noise"] = (
+ df["seasonality"] * df["degradation"] * df["soiling"]
+ )
+ df["PI_no_soil"] = df["seasonality"] * df["degradation"] * df["noise"]
+ df["PI_no_degrad"] = df["seasonality"] * df["soiling"]
+ df["daily_norm"] = df["noise"] * df["PI_no_noise"]
+
+ return df
+
+ def generate_my_soiling_signals(
+ high=0.02, low=0.01, index_form="Datetime"
+ ):
+ first_date = "2010/01/01"
+ last_date = "2020/01/01"
+ noises = [low, low, high, low, low, low]
+ seasonality_scales = [low, high, low, low, low, low]
+ soiling_levels = [0.003, 0.001, 0.001, 0.0005, 0.0005, 0.0001]
+ names = [
+ "normal",
+ "M Soil, H season",
+ "M Soil, H noise",
+ "Seasonal cleaning",
+ "L/M Soil (.0005)",
+ "Low Soil (.0001)",
+ ]
+ dfs = []
+ for i in range(6):
+ if i == 3:
+ df = simulate_PV_time_series_seasonal_soiling(
+ first_date,
+ last_date,
+ noise_scale=noises[i],
+ seasonality_scale=seasonality_scales[i],
+ soiling_rate_std=0,
+ soiling_rate_center=soiling_levels[i],
+ soiling_seasonality_scale=0.95,
+ smooth_rates=False,
+ seasonal_rates=False,
+ )
+ else:
+ df = simulate_PV_time_series(
+ first_date,
+ last_date,
+ noise_scale=noises[i],
+ seasonality_scale=seasonality_scales[i],
+ nr_of_cleaning_events=120,
+ soiling_rate_low=0,
+ soiling_rate_high=soiling_levels[i],
+ degradation_rate=-0.005,
+ )
+ if index_form == "numeric":
+ df.index = np.arange(len(df))
+
+ dfs.append(df)
+
+ return dfs, names
+
+ def half_one_matrix(size):
+ dummy = np.zeros((size, size))
+ dummy[np.triu_indices(size, k=1)] = 1
+ return dummy.T
+
+ dfs, _ = generate_my_soiling_signals()
+ names = [
+ "Base case (max soiling rate = 0.3 %/d)",
+ "Double seasonality (max soiling rate = 0.1% per day)",
+ "Double noise (max soiling rate = 0.1 %/d)",
+ "Seasonal cleaning (constant soiling rate = 0.05 %/d)",
+ "Little soiling (max soiling rate = 0.05%/d)",
+ "Very little soiling (max soiling rate = 0.01 %/d)",
+ ]
+ ss_df = dfs[1]
+ return cast(pd.DataFrame, ss_df), names[1]
diff --git a/examples/optimization/signals/modules/explainer.py b/examples/optimization/signals/modules/explainer.py
new file mode 100644
index 0000000000..3fcb457e6e
--- /dev/null
+++ b/examples/optimization/signals/modules/explainer.py
@@ -0,0 +1,95 @@
+from typing import Optional
+
+from . import components
+
+
+LIB = components.Components
+
+
+def explainer(component: str) -> Optional[str]:
+ explainers = {
+ LIB.ASYMMETRIC_SMALL: (
+ f"""
+ The **{component}** creates a component that treats values
+ bigger and smaller than the component mean asymetrically. It's
+ often used as a residual component class. Use the threshold
+ parameter to control the trade-off between positive and negative
+ values (or, when building a multiplicative decomposition, between
+ values greater than and less than 1).
+ """
+ ),
+ LIB.UNIFORMLY_SMALL: (
+ f"""
+ The **{component}** class creates a component that is encouraged
+ to be small, uniformly through time. It's often used as a residual
+ component class.
+ """
+ ),
+ LIB.SPARSE_SMALL: (
+ f"""
+ The **{component}** class creates a component that is encouraged
+ to be small, with only a few non-zero entries but possible with some
+ entries that are somewhat not small. It's often used as a residual
+ component class."""
+ ),
+ LIB.AGGREGATE: (
+ f"""
+ The **{component}** class is a special class that wraps other
+ component classes, creating a component that tries to have
+ the properties of all its wrapped classes. For example,
+ an aggregate of a Periodic and an Average Equal class
+ creates a periodic component centered around a specific number,
+ while an aggregate of a Periodic and Trend-line class creates
+ a periodic component that varies smoothly.
+ """
+ ),
+ LIB.AVERAGE_EQUAL: (
+ f"""
+ The **{component}** class creates a component that has a given
+ average value (which you specifiy). Typically used as part of
+ an aggregate.
+ """
+ ),
+ LIB.CONSTANT: (
+ f"""
+ The **{component}** class creates a component that has a constant
+ value.
+ """
+ ),
+ LIB.FIRST_VALUE_FIXED: (
+ f"""
+ The **{component}** creates a component that has a given first
+ value (which you specify). Typically used as part of an aggregate.
+ """
+ ),
+ LIB.TREND_LINE: (
+ f"""
+ The **{component}** class create a component that has no curvature
+ at all. It's useful if you want to extract a linear trend.
+ """
+ ),
+ LIB.PIECEWISE_CONSTANT: (
+ f"""
+ The **{component}** creates a component that is mostly constant,
+ but possibly with a few jumps. It's useful to detect
+ abrupt changes.
+ """
+ ),
+ LIB.PERIODIC: (
+ f"""
+ The **{component}** class creates components that repeat
+ themselves
+ after a number of time-steps that you choose. It's useful
+ for signals with seasonal or daily patterns.
+ """
+ ),
+ LIB.SMOOTH: (
+ f"""
+ The **{component}** class creates a component that is encouraged
+ vary smoothly, without large swings in value. This is useful
+ if you think your signal doesn't have large fluctuations.
+ """
+ ),
+ }
+
+ return explainers[component] if component in explainers else None
diff --git a/examples/optimization/signals/modules/intro_problem.py b/examples/optimization/signals/modules/intro_problem.py
new file mode 100644
index 0000000000..854ed604ee
--- /dev/null
+++ b/examples/optimization/signals/modules/intro_problem.py
@@ -0,0 +1,101 @@
+from typing import cast
+
+import gfosd
+import numpy as np
+from gfosd import components as gfc
+
+from . import problems
+from . import components as complib
+
+
+def _plot_empty(width, height, xlim, ylim):
+ return problems.plot_line(
+ x=None,
+ y=None,
+ x_label=" ",
+ y_label=" ",
+ title=" ",
+ width=width,
+ height=height,
+ xlim=xlim,
+ ylim=ylim,
+ )
+
+
+def generate_synthetic_data(seed=42, samples=100):
+ class Data:
+ time: np.ndarray
+ signal: np.ndarray
+
+ np.random.seed(seed)
+ t = np.linspace(0, 1000, samples)
+ sine_wave = 1.5 * np.sin(2 * np.pi * t * 1 / (500.0))
+ trend = np.linspace(0, 10, samples)
+ noise = 0.1 * np.random.randn(len(sine_wave))
+ X = np.vstack([sine_wave, noise, trend])
+ data = Data()
+ data.time = t
+ data.signal = X.sum(axis=0)
+ return data
+
+
+class IntroProblem:
+ def __init__(self, seed=42):
+ self.data = generate_synthetic_data(seed=seed)
+ self.options = {
+ complib.Components.TREND_LINE: gfc.NoCurvature(),
+ complib.Components.PERIODIC: gfc.Periodic(
+ period=self.data.time.shape[0] // 2
+ ),
+ complib.Components.PIECEWISE_CONSTANT: gfc.SumCard(
+ diff=1,
+ weight=2,
+ ),
+ }
+
+ def plot(self):
+ return problems.plot_line(
+ self.data.time,
+ self.data.signal,
+ x_label="time",
+ y_label="measurement",
+ )
+
+ def plot_decomp(self, components, min_plots, width=210, height=210):
+ xrange = [0, 1000]
+ yrange = [-4, 12]
+ if not components:
+ return [
+ _plot_empty(
+ width=width,
+ height=height,
+ xlim=xrange,
+ ylim=yrange,
+ )
+ ] * min_plots
+ else:
+ component_classes = [self.options[c] for c in components]
+ names = [
+ f"Noise Component: {complib.Components.UNIFORMLY_SMALL}",
+ *components,
+ ]
+ c = [gfc.SumSquare(weight=1e-2), *component_classes]
+ problem = gfosd.Problem(self.data.signal, c)
+ problem.decompose(verbose=False)
+ decomposition = cast(np.ndarray, problem.decomposition)
+ plots = []
+ for i in range(decomposition.shape[0]):
+ plots.append(
+ problems.plot_line(
+ x=self.data.time,
+ y=decomposition[i, :],
+ width=width,
+ height=height,
+ xlim=xrange,
+ ylim=yrange,
+ title=f"{names[i]}",
+ )
+ )
+ if len(plots) < min_plots:
+ plots.append(_plot_empty(width, height, xrange, yrange))
+ return plots
diff --git a/examples/optimization/signals/modules/layout.py b/examples/optimization/signals/modules/layout.py
new file mode 100644
index 0000000000..179c4410ca
--- /dev/null
+++ b/examples/optimization/signals/modules/layout.py
@@ -0,0 +1,17 @@
+import base64
+import io
+
+import marimo as mo
+from PIL import Image
+
+
+def _pillow_image_to_base64_string(img):
+ buffered = io.BytesIO()
+ img.save(buffered, format="PNG")
+ return base64.b64encode(buffered.getvalue()).decode("utf-8")
+
+
+def image(path: str) -> str:
+ img = Image.open(path)
+ data_url = "data:image/png;base64," + _pillow_image_to_base64_string(img)
+ return f"<img src='{data_url}' />"
diff --git a/examples/optimization/signals/modules/problems.py b/examples/optimization/signals/modules/problems.py
new file mode 100644
index 0000000000..d8795e4f65
--- /dev/null
+++ b/examples/optimization/signals/modules/problems.py
@@ -0,0 +1,546 @@
+from __future__ import annotations
+
+import abc
+from typing import Optional, cast
+
+import gfosd.components as gfc
+import matplotlib
+import matplotlib.pyplot as plt
+import marimo as mo
+import numpy as np
+
+from . import components as componentlib
+from . import dataloaders
+from . import layout
+from . import solutions
+from gfosd import Problem
+from sklearn.preprocessing import MinMaxScaler
+
+clib = componentlib.Components
+plib = componentlib.Parameters
+
+
+def configure_matplotlib(font_size=10):
+ params = {
+ "axes.labelsize": font_size,
+ "axes.titlesize": font_size,
+ "font.size": font_size,
+ "legend.fontsize": font_size,
+ "xtick.labelsize": font_size,
+ "ytick.labelsize": font_size,
+ "font.family": "sans serif",
+ }
+ matplotlib.rcParams.update(params)
+
+
+def plot_line(
+ x,
+ y,
+ x_label=None,
+ y_label=None,
+ title=None,
+ color=None,
+ width=6.4,
+ height=2.5,
+ xlim=None,
+ ylim=None,
+ ax=None,
+):
+ if ax is None:
+ plt.figure(figsize=(width, height))
+ ax = cast(plt.Axes, plt.gca())
+ if x is not None and y is not None:
+ ax.plot(x, y, color=color)
+ ax.set_title(title)
+ ax.set_xlabel(x_label)
+ ax.set_ylabel(y_label)
+ ax.set_xlim(xlim)
+ ax.set_ylim(ylim)
+ return ax
+
+
+class OSDProblem(abc.ABC):
+ @staticmethod
+ @abc.abstractmethod
+ def name() -> str:
+ pass
+
+ # TODO returns mo.Html, or at least html showable ...
+ @abc.abstractmethod
+ def description(self):
+ pass
+
+ @abc.abstractmethod
+ def plot_signal(self, ax: Optional[plt.Axes] = None) -> plt.Axes:
+ pass
+
+ @abc.abstractmethod
+ def decompose(self, components):
+ pass
+
+ @abc.abstractmethod
+ def feedback(self, components, parameters):
+ pass
+
+
+class MaunaLoa(OSDProblem):
+ def __init__(self):
+ self.df = dataloaders.get_c02_data()
+
+ @staticmethod
+ def name() -> str:
+ return "Mauna Loa Observatory: Carbon Dioxide Emissions"
+
+ def description(self):
+ return mo.md(
+ f"""
+ Let's look at a signal that's very relevant to us today:
+ atmospheric CO~2~ levels from May 1974 through June 2021, measured
+ at Mauna Loa, Hawaii. Here's the signal:
+
+ {mo.as_html(self.plot_signal()).center()}
+
+ Because of climate change, we expect emissions to increase with
+ time, and they do. But we also see that the signal has seasonal
+ fluctuations, and probably some noise.
+
+ **Your task**: Build a decomposition that isolates the long-term
+ trend from the seasonal fluctuation.
+ """
+ )
+
+ def plot_signal(self, ax: Optional[plt.Axes] = None) -> plt.Axes:
+ return plot_line(
+ self.df["decimal"],
+ self.df["average"],
+ x_label="Year",
+ y_label="Average Emissions (ppm)",
+ ax=ax,
+ )
+
+ def decompose(self, components):
+ problem = Problem(
+ data=self.df["average"].values, components=components
+ )
+ problem.decompose(verbose=False, max_iter=1000)
+ return problem.plot_decomposition()
+
+ def feedback(self, components: list[componentlib.Components], params):
+ if components[0] == clib.UNIFORMLY_SMALL and set(
+ components[1:]
+ ) == set([clib.SMOOTH, clib.PERIODIC]):
+ for c, p in zip(components[1:], params[1:]):
+ if c == clib.PERIODIC and p[plib.PERIOD] == 53:
+ return mo.md(
+ """
+ 🎉 **You did it!**
+
+ You just made a "seasonal-trend decomposition".
+ The "Denoised Signal" plotted below is the sum of
+ your components, excluding the noise component;
+ it's an idealized or cleaned-up version of the
+ data that captures the seasonality and trend.
+
+ Seasonal-trend decompositions are widely used
+ in weather and evironment-related applications,
+ as well as in economics.
+ """
+ ).callout(kind="success")
+ elif c == clib.PERIODIC and p[plib.PERIOD] == 52:
+ return mo.md(
+ """
+ So close!
+
+ Hint: No year has exactly 52 weeks.
+ """
+ ).callout(kind="alert")
+
+ return mo.md(
+ """
+ Almost! But your period isn't quite right. How long, in weeks,
+ do you expect each seasonal cycle to last?
+ """
+ ).callout(kind="alert")
+ elif (
+ len(components) == 3
+ and clib.SMOOTH in components
+ and clib.PERIODIC in components
+ ):
+ return mo.md(
+ """
+ Almost there!
+
+ Hint: The first component (which always represents noise)
+ should resemble small random error left-over from the
+ decomposition.
+ """
+ ).callout(kind="alert")
+ elif len(components) > 3:
+ return mo.md(
+ """
+ Not quite there. Hint: You only need 3 components for
+ a seasonal-trend decomposition.
+ """
+ ).callout(kind="alert")
+ elif len(components) >= 1:
+ return mo.md(
+ """
+ Nice job getting started. Keep experimenting.
+ """
+ ).callout()
+
+
+class SolarPower(OSDProblem):
+ def __init__(self):
+ self.df = dataloaders.get_pvdaq_data()
+ self._preprocessed_signal = solutions._preprocess_pvdaq(self.df)
+
+ @staticmethod
+ def name() -> str:
+ return "National Renewable Energy Lab: Solar Power Generation"
+
+ def description(self):
+ product_callout = mo.md(
+ """
+ In this decomposition, the _product_ of the components will equal
+ the original signal, not the sum. We achieve this by taking
+ logs of the data before computing the decomposition,
+ and exponentiating it after. A multiplicative decomposition is
+ more interpretable for this example (why?).
+ """
+ ).callout(kind="alert")
+
+ return mo.md(
+ f"""
+ This signal measures DC power generated by a collection of solar
+ panels. (The data was provided by the National Renewable Energy
+ Laboratory.) Shown below is two week's worth of data, from Jan. 1
+ through Jan. 14 2011, sampled every 15 minutes. Each peak represents
+ the max DC power generation for a given day.
+
+ {mo.as_html(self.plot_signal())}
+
+
+ The signal roughly repeats every day (which equals 96 15-minute
+ periods), though there is slight to sometimes considerable variance in
+ the amount of power generated on each day.
+
+ **Your task**: Create a decomposition that captures the gross daily
+ pattern of the power generation and also captures generation
+ performance at any point in time as a fraction of typical performance.
+ Aim for typical performance of 90,000, ie, peaks of roughly 90,000
+ in the period component. You'll only need two components.
+
+
+ {product_callout}
+ """
+ )
+
+ def decompose(self, components):
+ problem = Problem(
+ data=self._preprocessed_signal, components=components
+ )
+ problem.decompose(verbose=False, max_iter=2000)
+ return problem.plot_decomposition(exponentiate=True)
+
+ def plot_signal(self, ax: Optional[plt.Axes] = None) -> plt.Axes:
+ subdf = self.df.loc[:"2011-01-14"]
+ y = subdf["dc_power"].values
+ ax = plot_line(
+ x=np.arange(y.size),
+ y=y,
+ x_label="Samples (every 15 minutes)",
+ y_label="DC Power",
+ ax=ax,
+ )
+ plt.tight_layout()
+ return ax
+
+ def feedback(self, components, params):
+ if components == [clib.ASYMMETRIC_SMALL, clib.PERIODIC]:
+ if params[0][plib.THRESHOLD] < 0.8:
+ return mo.md(
+ f"""
+ Nice! A **{clib.ASYMMETRIC_SMALL}** component might be
+ useful. Try adjusting the threshold parameter. Remember
+ that in this example, noise represents deviations
+ from clear-sky power generation.
+ """
+ ).callout(kind="alert")
+ if params[1][plib.PERIOD] != 96:
+ return mo.md(
+ """
+ Almost there! What should the period be?
+ """
+ ).callout(kind="alert")
+ return mo.md(
+ f"""
+ 🎉 **You did it!**
+
+ You just made a multiplicative model of real data. Your
+ model captures the average daily pattern of solar panel
+ generation.
+
+ You used the **{clib.ASYMMETRIC_SMALL}** component class to
+ explain when the data deviates from that pattern, and by how
+ much. By choosing a large threshold, you chose to build a
+ decomposition that emphasizes the "clear-sky" power generation,
+ with the noise component representing weather events that
+ decrease the power generated.
+
+ **Just for fun:** Try replacing a Periodic component
+ with an **{clib.AGGREGATE}** of a **{clib.PERIODIC} component**
+ and a **{clib.SMOOTH}** component: you should find that this
+ smooths out the jagged features that are currently in your
+ Periodic component.
+ """
+ ).callout(kind="success")
+ elif components == [clib.ASYMMETRIC_SMALL, clib.AGGREGATE]:
+ if params[0][plib.THRESHOLD] < 0.8:
+ return mo.md(
+ f"""
+ Nice! A {clib.ASYMMETRIC_SMALL} component might be useful.
+ Try adjusting the threshold parameter.
+ """
+ ).callout(kind="alert")
+ if params[1][plib.COMPONENTS] == 2:
+ child_components = list(c for c, _ in params[1][plib.CHILDREN])
+ if set(child_components) == set((clib.SMOOTH, clib.PERIODIC)):
+ child_params = list(p for _, p in params[1][plib.CHILDREN])
+ periodic_index = (
+ 0 if child_components[0] == clib.PERIODIC else 1
+ )
+ if (
+ child_params[periodic_index][plib.PERIOD] == 96
+ and child_params[(periodic_index + 1) % 2][plib.WEIGHT]
+ >= 1
+ ):
+ return mo.md(
+ """
+ 🎉 **Wow!**
+
+ That's a pretty advanced decomposition you just made.
+ """
+ ).callout(kind="success")
+ return mo.md(
+ f"""
+ Almost there! Use **{clib.PERIODIC}** (use period = 96) and
+ **{clib.SMOOTH}** (use weight = 1) child components for your
+ aggregate.
+ """
+ ).callout(kind="alert")
+ elif components[0] != clib.ASYMMETRIC_SMALL:
+ return mo.md(
+ """
+ Hint: Try a different noise component. This component should
+ capture when power generation degrades.
+ """
+ ).callout(kind="alert")
+ elif len(components) > 2:
+ return mo.md(
+ """
+ You only need two components.
+ """
+ ).callout(kind="alert")
+ elif len(components) >= 1:
+ return mo.md(
+ """
+ Nice job getting started. Keep experimenting.
+ """
+ ).callout()
+
+
+class ChangePoint(OSDProblem):
+ def __init__(self):
+ self.y, self.X = dataloaders.make_changepoint_data()
+
+ @staticmethod
+ def name() -> str:
+ return "Change Point Detection"
+
+ def description(self):
+ return mo.md(
+ f"""
+ This synthetic signal has a few abrupt changes in it, at time-steps
+ 400, 600, 700, 800, and 900.
+
+ {mo.as_html(self.plot_signal())}
+
+ **Your task:** Create a decomposition that isolates the changes.
+ """
+ )
+
+ def decompose(self, components):
+ problem = Problem(data=self.y, components=components)
+ problem.decompose(verbose=False, max_iter=1000)
+ return problem.plot_decomposition()
+
+ def plot_signal(self, ax: Optional[plt.Axes] = None) -> plt.Axes:
+ return plot_line(
+ np.arange(self.y.size),
+ self.y,
+ x_label="Time",
+ y_label="Measurement",
+ ax=ax,
+ )
+
+ def feedback(self, components, parameters):
+ if components[1] == clib.PIECEWISE_CONSTANT:
+ if parameters[1][plib.WEIGHT] == 1:
+ return mo.md(
+ f"""
+ 🎉 **You did it!**
+
+ You just deteced some change points. Every time the non-noise
+ component jumps is a change point. (If the component doesn't
+ look piecewise-constant, you may need to adjust the weights.)
+
+ Change point detection is a very old problem with applications
+ in many fields, including in photovoltaic systems, medicine,
+ finance, and others. Change point detection can be a very
+ challenging problem, and is intractable in general. That said,
+ signal decomposition can be a very good heuristic for it.
+ """
+ ).callout(kind="success")
+ else:
+ return mo.md(
+ f"""
+ So close! Try adjusting the weight of the
+ **{clib.PIECEWISE_CONSTANT}** component.
+ """
+ ).callout(kind="alert")
+ elif len(components) >= 3:
+ return mo.md(
+ """
+ Hint: You only need two components.
+ """
+ ).callout(kind="alert")
+ elif len(components) >= 1:
+ return mo.md(
+ """
+ Nice job getting started. Keep experimenting.
+ """
+ ).callout()
+ else:
+ return None
+
+
+class Soiling(OSDProblem):
+ def __init__(self):
+ self.df, _ = dataloaders.make_soiling_data()
+ y0 = self.df["daily_norm"].values.copy()
+ y1 = np.log(y0)
+ prescaling = MinMaxScaler(feature_range=(0, 10))
+ y2 = prescaling.fit_transform(y1.reshape(-1, 1)).ravel()
+ self.y = y2
+
+ @staticmethod
+ def name() -> str:
+ return "Solar Panel Soiling"
+
+ def description(self):
+ reference_decomposition = mo.Html(
+ layout.image("assets/solar_power_soiling_reference.png")
+ )
+ return mo.md(
+ f"""
+ This signal represents generation efficiency of an array
+ of solar panels. Solar panel performance decreases with time, as
+ dust and other particulates collect on the panels, blocking
+ sunlight. This degradation is known as 'soiling loss'.
+
+ {mo.as_html(self.plot_signal())}
+
+ This is a synthetic signal, but it captures some key
+ characteristics. The power generation
+
+ - is noisy
+ - osciallates around a constant average efficiency
+ - slowly degrades linearly over the years
+ - has a periodic component with a period of 365 days
+ - degrades and recover as panels are soiled and cleaned
+
+ We've created what we think is a good decomposition for this
+ data. Here it is:
+
+ {mo.tree([reference_decomposition], label="Reference Decomposition")}
+
+ **Your task:** Create a decomposition that matches our reference
+ decomposition.
+
+ {
+ mo.md(
+ '''
+ Hint: There are many different decompositions that can capture
+ the signal's key characteristics. Unlike the previous
+ examples, this one doesn't really have a "right" answer, so we
+ won't give you any feedback on your choices. Just try your
+ best to match our decomposition using what you've learned so
+ far, and have fun!
+ '''
+ ).callout()
+ }
+ """
+ )
+
+ def decompose(self, components):
+ problem = Problem(data=self.y, components=components)
+ problem.decompose(verbose=False, max_iter=1000)
+ f = problem.plot_decomposition()
+ for i, component in enumerate(components):
+ if isinstance(component, gfc.NoSlope):
+ avg = np.average(problem.decomposition[i])
+ f.axes[i].set_ylim(avg - 2.5, avg + 2.5)
+ break
+ return f
+
+ def plot_signal(self, ax: Optional[plt.Axes] = None) -> plt.Axes:
+ ax = plot_line(
+ x=self.df.index,
+ y=self.y,
+ x_label="Year",
+ y_label="Power Generation",
+ )
+ ax.set_title("Solar Panel Generation, with Soiling")
+ return ax
+
+ def feedback(self):
+ raise NotImplementedError
+
+
+class CustomDataProblem(abc.ABC):
+ def __init__(self, signal, title):
+ self.signal = signal
+ self.title = title
+
+ @staticmethod
+ def name() -> str:
+ return "Upload Your Own Signal"
+
+ def description(self):
+ return mo.md(
+ f"""
+ Here is a plot of the signal you uploaded.
+
+ {mo.as_html(self.plot_signal())}
+ """
+ )
+
+ def plot_signal(self, ax: Optional[plt.Axes] = None) -> plt.Axes:
+ ax = plot_line(
+ x=np.arange(self.signal.size),
+ y=self.signal,
+ ax=ax,
+ )
+ ax.set_title(self.title)
+ return ax
+
+ def decompose(self, components):
+ problem = Problem(data=self.signal, components=components)
+ problem.decompose(verbose=False, max_iter=1000)
+ return problem.plot_decomposition()
+
+ def feedback(self, components, parameters):
+ del components
+ del parameters
+ return None
diff --git a/examples/optimization/signals/modules/solutions.py b/examples/optimization/signals/modules/solutions.py
new file mode 100644
index 0000000000..bd247f83c5
--- /dev/null
+++ b/examples/optimization/signals/modules/solutions.py
@@ -0,0 +1,124 @@
+from __future__ import annotations
+
+from typing import Tuple
+
+import gfosd.components as comp
+import numpy as np
+import numpy.typing as npt
+import pandas as pd
+from gfosd import Problem
+from sklearn.preprocessing import MinMaxScaler
+
+
+def co2_problem(co2_dataframe) -> Problem:
+ return Problem(
+ data=co2_dataframe["average"].values,
+ components=[
+ comp.SumSquare(weight=1 / len(co2_dataframe)),
+ comp.SumSquare(diff=1, weight=1e-2),
+ comp.Aggregate(
+ [comp.Periodic(period=53), comp.AverageEqual(0, period=53)]
+ ),
+ ],
+ )
+
+
+def _preprocess_pvdaq(pv_dataframe) -> np.ndarray:
+ # data preprocessing
+ y0 = pv_dataframe.loc[:"2011-01-14", "dc_power"].values.copy()
+ # take log
+ y1 = np.ones_like(y0) * np.nan
+ y1[y0 > 0] = np.log(y0[y0 > 0])
+ return y1
+
+
+def pvdaq_problem(pv_dataframe) -> Problem:
+ period = pv_dataframe.loc[:"2011-01-15", "dc_power"].values.shape[0] // 15
+ ss_y = _preprocess_pvdaq(pv_dataframe)
+ pv_problem = Problem(
+ data=ss_y,
+ components=[
+ comp.SumQuantile(weight=1 / len(pv_dataframe), tau=0.85),
+ comp.Aggregate(
+ [
+ comp.SumSquare(diff=2, weight=1e-2),
+ comp.Periodic(period=period),
+ ]
+ ),
+ ],
+ )
+ return pv_problem
+
+
+def basic_changepoint_problem_exact(signal) -> Problem:
+ c1 = comp.SumSquare(weight=1 / len(signal))
+ c2 = comp.SumCard(weight=1e-3, diff=1)
+ return Problem(signal, [c1, c2])
+
+
+def basic_changepoint_problem_heuristic(signal) -> Problem:
+ c1 = comp.SumSquare(weight=1 / len(signal))
+ c2 = comp.SumAbs(weight=1e-3, diff=1)
+ return Problem(signal, [c1, c2])
+
+
+def hard_changepoint_problem(signal) -> Problem:
+ return Problem(
+ signal,
+ [
+ comp.SumSquare(weight=1 / len(signal)),
+ comp.SumCard(weight=1e-3, diff=1),
+ comp.Aggregate(
+ [
+ comp.SumSquare(weight=1e2, diff=2),
+ comp.Periodic(period=400),
+ comp.AverageEqual(0, period=400),
+ ]
+ ),
+ ],
+ )
+
+
+def soiling_problem(ss_df: pd.DataFrame) -> Tuple[Problem, npt.NDArray]:
+ # data preprocessing
+ _y0 = ss_df["daily_norm"].values.copy()
+ _y1 = np.log(_y0)
+ prescaling = MinMaxScaler(feature_range=(0, 10))
+ _y2 = prescaling.fit_transform(_y1.reshape(-1, 1)).ravel()
+ ss_y = _y2
+
+ # residual component
+ c1 = comp.SumSquare(weight=1 / len(ss_y))
+ # constant component
+ c2 = comp.NoSlope()
+ # linear degradation component
+ c3 = comp.Aggregate([comp.NoCurvature(), comp.FirstValEqual(0)])
+ # seasonal baseline component
+ c4 = comp.Aggregate(
+ [
+ comp.SumSquare(weight=5e0, diff=2),
+ comp.Periodic(365),
+ comp.AverageEqual(0, period=365),
+ ]
+ )
+ # soiling component
+ c5 = comp.Aggregate(
+ [
+ comp.Inequality(vmax=0),
+ comp.SumAbs(weight=1e-5),
+ comp.SumQuantile(weight=1e-5, diff=1, tau=0.9),
+ comp.SumAbs(weight=5e-3, diff=2),
+ ]
+ )
+
+ ss_problem = Problem(data=ss_y, components=[c1, c2, c3, c4, c5])
+ ss_problem.decompose()
+
+ # real signal
+ xr = ss_df[["noise", "degradation", "seasonality", "soiling"]]
+ xr.insert(1, "bias", np.ones(len(ss_df)))
+ xr = np.log(xr.values.T)
+ xr[0] *= prescaling.scale_
+ xr[1] = prescaling.transform(xr[1].reshape(-1, 1)).ravel()
+ xr[2:] *= prescaling.scale_
+ return ss_problem, xr
diff --git a/examples/optimization/smallest_enclosing_circle.py b/examples/optimization/smallest_enclosing_circle.py
new file mode 100644
index 0000000000..4103d7497a
--- /dev/null
+++ b/examples/optimization/smallest_enclosing_circle.py
@@ -0,0 +1,174 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md(
+ """
+ # Smallest Enclosing Circle
+
+ This program computes the circle of smallest radius that encloses a given
+ randomly sampled set of circles. This is a generalization of the
+ [smallest-circle problem](https://en.wikipedia.org/wiki/Smallest-circle_problem).
+
+ We solve this problem using [CVXPY](https://www.cvxpy.org), a Python library for specifying and
+ solving convex optimization problems.
+
+ _Use the slider below to choose the number of circles to sample:_
+ """
+ )
+ return
+
+
+def __(mo):
+ number_of_circles = mo.ui.slider(
+ 1, 15, value=3, label='Number of circles')
+ number_of_circles
+ return number_of_circles,
+
+
+def __(mo, number_of_circles):
+ resample_button = mo.ui.button(label='Click this button')
+ mo.md(
+ f"""
+ {resample_button} to solve this problem for another set of
+ {number_of_circles.value} circles.
+ """
+ )
+ return resample_button,
+
+
+def __(np):
+ def generate_circles(number_of_circles):
+ circles = []
+ for i in range(number_of_circles):
+ c_i = np.random.randn(2)
+ r_i = np.abs(np.random.randn())
+ circles.append((c_i, r_i))
+ return circles
+ return generate_circles,
+
+
+def __(generate_circles, number_of_circles, resample_button):
+ resample_button
+
+ circles = generate_circles(number_of_circles.value)
+ return circles,
+
+
+def __(circles, smallest_enclosing_circle):
+ center, radius = smallest_enclosing_circle(circles)
+ return center, radius
+
+
+def __(center, circles, plot_circle, plt, radius):
+ for (c_i, r_i) in circles:
+ plot_circle(c_i, r_i, color='gray')
+ plot_circle(center, radius, color='green', label='smallest enclosing circle')
+ plt.xlim(-5, 5)
+ plt.ylim(-5, 5)
+ plt.legend(loc='upper right')
+ plt.gcf().set_size_inches((6, 6))
+ plt.gca()
+ return c_i, r_i
+
+
+def __(plt):
+ def plot_circle(center, radius, ax=None, **kwargs):
+ ax = plt.gca() if ax is None else ax
+ ax.add_patch(plt.Circle(center, radius, fill=False, **kwargs))
+ return ax
+ return plot_circle,
+
+
+def __(mo):
+ mo.md("## The solution method")
+ return
+
+
+def __(mo):
+ mo.md(
+ r"""
+ We can write down a convex optimization problem whose solution gives us
+ the smallest circle enclosing the $n$ given circles. Once we do this,
+ we can just code up the problem in CVXPY to obtain a solution.
+
+ Here's the problem:
+
+ We seek a circle, parameterized by a center $c = (x, y) \in \mathbf{R}^2$
+ and a radius $r \in \mathbf{R}$ satisfying
+
+ \[
+ \begin{equation*}
+ \begin{array}{ll}
+ \text{minimize} & r \\
+ \text{subject to } & \|c - c_i\|_2 + r_i \leq r, \quad i=1, \ldots, n,
+ \end{array}
+ \end{equation*}
+ \]
+
+ where $c_1, \ldots, c_n$ and $r_1, \ldots, r_n$ are the centers and radii
+ of the $n$ given circles.
+
+ And here's the code:
+
+ ```python3
+ def smallest_enclosing_circle(circles):
+ radius = cp.Variable()
+ center = cp.Variable(2)
+ constraints = [
+ cp.norm(center - c_i) + r_i <= radius
+ for (c_i, r_i) in circles
+ ]
+ objective = cp.Minimize(radius)
+ cp.Problem(objective, constraints).solve()
+ return (center.value, radius.value)
+ ```
+ """
+ )
+ return
+
+
+def __(cp):
+ def smallest_enclosing_circle(circles):
+ radius = cp.Variable()
+ center = cp.Variable(2)
+ constraints = [
+ cp.norm(center - c_i) + r_i <= radius
+ for (c_i, r_i) in circles
+ ]
+ objective = cp.Minimize(radius)
+ cp.Problem(objective, constraints).solve()
+ return (center.value, radius.value)
+ return smallest_enclosing_circle,
+
+
+def __():
+ import matplotlib.pyplot as plt
+ import numpy as np
+ import cvxpy as cp
+ return cp, np, plt
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/personal_finance/compound_interest.py b/examples/personal_finance/compound_interest.py
new file mode 100644
index 0000000000..31eb0a78c0
--- /dev/null
+++ b/examples/personal_finance/compound_interest.py
@@ -0,0 +1,161 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# Compound Interest")
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ This notebook illustrates exponential growth, using compound interest
+ as an example.
+ """
+ ).callout()
+ return
+
+
+def __(mo):
+ initial_investment = mo.ui.slider(0, 1000000, step=1e4, value=10000)
+ monthly_investment = mo.ui.slider(0, 50000, value=1000, step=1e3)
+ annual_return = mo.ui.slider(0, 0.15, value=0.07, step=0.01)
+ years = mo.ui.slider(1, 60, value=30)
+ capital_gains_tax_rate = mo.ui.slider(0.0, 1.0, value=0.32, step=0.01)
+
+ table = mo.ui.table(
+ [
+ {
+ "parameter": "initial investment",
+ "control": initial_investment,
+ },
+ {
+ "parameter": "monthly investment",
+ "control": monthly_investment,
+ },
+ {
+ "parameter": "annual return",
+ "control": annual_return,
+ },
+ {
+ "parameter": "years",
+ "control": years,
+ },
+ {
+ "parameter": "capital gains tax rate",
+ "control": capital_gains_tax_rate,
+ },
+ ],
+ selection=None,
+ )
+
+ mo.md(
+ f"""## Investment Parameters
+
+ {table}
+ """)
+ return (
+ annual_return,
+ capital_gains_tax_rate,
+ initial_investment,
+ monthly_investment,
+ table,
+ years,
+ )
+
+
+def simulate(
+ annual_return,
+ capital_gains_tax_rate,
+ initial_investment,
+ mo,
+ monthly_investment,
+ plt,
+ years,
+):
+ class Portfolio:
+ def __init__(self, value, annual_return):
+ self.value = value
+ self.annual_return = annual_return
+ self.monthly_return = (1 + self.annual_return) ** (1.0 / 12) - 1
+
+ def simulate_month(self, additional_investment):
+ self.value += additional_investment
+ self.value *= 1 + self.monthly_return
+ return self.value
+
+ def total_return(self, months):
+ return (1 + self.monthly_return) ** months
+
+
+ portfolio = Portfolio(initial_investment.value, annual_return.value)
+ values = [portfolio.value]
+ investment_principals = [portfolio.value]
+ values_less_taxes = [portfolio.value]
+
+ _months = years.value * 12
+ for _ in range(_months):
+ values.append(portfolio.simulate_month(monthly_investment.value))
+ investment_principals.append(
+ investment_principals[-1] + monthly_investment.value
+ )
+ values_less_taxes.append(
+ investment_principals[-1]
+ + (1 - capital_gains_tax_rate.value)
+ * (values[-1] - investment_principals[-1])
+ )
+
+ plt.plot(values, label="Portfolio Value")
+ plt.plot(values_less_taxes, label="Value, Less Capital Gains Taxes")
+ plt.plot(investment_principals, label="Contributed")
+ plt.legend()
+ plt.xlabel("Month")
+ plt.title("Net Wealth")
+
+ _prose = f"""
+ ## Net Worth
+
+ With an initial investment of **\${initial_investment.value :,.02f}**, an annual
+ return of **{annual_return.value * 100:.02f}%** with
+ **\${monthly_investment.value:,.02f}** invested monthly, in {years.value} years
+ you will have approximately **\${values[-1]:,.02f}** accumulated in
+ equities. Assuming a long-term capitals gain tax of
+ **{capital_gains_tax_rate.value*100:.02f}%**, the net portfolio value is
+ **\${values_less_taxes[-1]:,.02f}**. Compare that to the
+ **\${investment_principals[-1]:,.02f}** that you contributed in total.
+ """
+
+ ax = plt.gca()
+ mo.md(_prose)
+ return (
+ Portfolio,
+ ax,
+ investment_principals,
+ portfolio,
+ values,
+ values_less_taxes,
+ )
+
+
+def __(ax):
+ ax
+ return
+
+
+def __():
+ import marimo as mo
+ import matplotlib.pyplot as plt
+ return mo, plt
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/personal_finance/mortgage_calculator.py b/examples/personal_finance/mortgage_calculator.py
new file mode 100644
index 0000000000..b036a6e9c0
--- /dev/null
+++ b/examples/personal_finance/mortgage_calculator.py
@@ -0,0 +1,404 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# Mortgage Calculator")
+ return
+
+
+def __(mo):
+ mo.md("## Income")
+ return
+
+
+def __(mo):
+ income = mo.ui.number(1, 1e8, step=50, value=100, label="income (thousands)")
+ retirement_contribution = mo.ui.number(10, 40, step=10, value=19.5)
+
+ mo.md(
+ f"""
+ How much do you expect to make this year, **after taxes**?
+
+ {income.center()}
+ """
+ )
+ return income, retirement_contribution
+
+
+def __(mo):
+ mo.callout(
+ mo.md(
+ """
+ **Heads-up!**
+
+ This calculator does not take taxes into account. Please make sure
+ that you provide **after-tax** income. Also exclude 401k contributions.
+
+ You can estimate your federal and state taxes using an online
+ calculator, such as the one
+ [linked here](https://smartasset.com/taxes/income-taxes).
+ """
+ ),
+ kind="warn",
+ )
+ return
+
+
+def __(income, mo, np, retirement_contribution):
+ standard_deduction = 25100
+ taxable_income = (
+ income.value * 1000
+ - standard_deduction
+ - retirement_contribution.value * 1000
+ )
+
+
+ def calculate_federal_tax(income):
+ brackets = [
+ (0.10, 0, 20550),
+ (0.12, 20551, 83550),
+ (0.22, 83551, 178150),
+ (0.24, 178151, 340100),
+ (0.32, 340101, 431900),
+ (0.35, 431901, 647850),
+ (0.37, 647850, np.inf),
+ ]
+
+ tax = 0
+ for rate, low, high in brackets:
+ tax += rate * (min(income, high) - low)
+ if income <= high:
+ break
+ return tax
+
+
+ fed_tax = calculate_federal_tax(taxable_income)
+ ca_tax = 5390.38 + 0.093 * (taxable_income - 122428)
+
+ net_cash = income.value * 1000
+ net_cash_per_month = net_cash / 12
+
+ mo.md(
+ f"""
+ With an after-tax income of **\${income.value*1000:,}**, you'll take home
+ **\${net_cash_per_month:,.02f}** every month.
+ """
+ )
+ return (
+ ca_tax,
+ calculate_federal_tax,
+ fed_tax,
+ net_cash,
+ net_cash_per_month,
+ standard_deduction,
+ taxable_income,
+ )
+
+
+def __(mo):
+ home_price = mo.ui.number(
+ 100, 5000, step=100, value=500, label="home price (thousands)"
+ )
+ down_payment_pct = mo.ui.number(
+ 0, 100, step=5, value=20, label="down payment (%)"
+ )
+ rate = mo.ui.number(1.0, 8.0, step=0.25, value=5.0, label="interest rate (%)")
+ years = mo.ui.number(5, 45, step=1, value=30, label="mortgage term (years)")
+ property_tax_rate = mo.ui.number(
+ 1, 10, step=0.25, value=1.25, label="property tax (%)"
+ )
+ utilities = mo.ui.number(100, 1000, value=500, label="utilities monthly ($)")
+ home_insurance = mo.ui.number(
+ 100, 1000, value=150, label="home insurance monthly ($)"
+ )
+
+ home_purchase_parameters = [home_price, down_payment_pct, rate, years]
+ home_expense_parameters = [
+ property_tax_rate,
+ utilities,
+ home_insurance,
+ ]
+
+ mo.md(
+ f"""
+ ## Loan
+
+ Next, enter some details about the home you'd like to purchase,
+ the mortgage you qualify for, and additional home expenses.
+ """
+ )
+ return (
+ down_payment_pct,
+ home_expense_parameters,
+ home_insurance,
+ home_price,
+ home_purchase_parameters,
+ property_tax_rate,
+ rate,
+ utilities,
+ years,
+ )
+
+
+def __(home_expense_parameters, home_purchase_parameters, mo):
+ mo.hstack([home_purchase_parameters, home_expense_parameters])
+ return
+
+
+def __(down_payment_pct, home_price, mortgage, rate, years):
+ down_payment = down_payment_pct.value / 100 * home_price.value
+ principal = home_price.value - down_payment
+
+ loan = mortgage.Loan(
+ principal=principal * 1e3, interest=rate.value / 100, term=years.value
+ )
+ return down_payment, loan, principal
+
+
+def __(
+ down_payment,
+ home_insurance,
+ home_price,
+ loan,
+ mo,
+ net_cash,
+ net_cash_per_month,
+ property_tax_rate,
+ rate,
+ utilities,
+):
+ property_tax_monthly = (
+ property_tax_rate.value / 100 * home_price.value * 1e3 / 12
+ )
+ home_insurance_monthly = home_insurance.value
+ mortgage_monthly = float(loan.monthly_payment)
+ utilities_monthly = utilities.value
+
+ monthly_home_payment = (
+ property_tax_monthly
+ + home_insurance_monthly
+ + mortgage_monthly
+ + utilities_monthly
+ )
+
+ annual_home_payment = monthly_home_payment * 12
+ cash_less_housing = net_cash - annual_home_payment
+
+ mo.md(
+ f"""
+ You're purchasing a home worth **\${home_price.value * 1000:,}**, with a
+ down payment of **\${down_payment*1000:,.02f}**.
+
+ At a rate of **{rate.value}**%,
+ you will owe **\${annual_home_payment:,.02f}** per year on home expenses.
+ That's **\${monthly_home_payment:,.02f}** per month, which is
+ **{monthly_home_payment / (net_cash_per_month) * 100:,.02f}%** of
+ your take-home pay.
+
+ You'll have **\${cash_less_housing/12:,.02f}** left over per
+ month for expenses and saving.
+ """
+ ).callout()
+ return (
+ annual_home_payment,
+ cash_less_housing,
+ home_insurance_monthly,
+ monthly_home_payment,
+ mortgage_monthly,
+ property_tax_monthly,
+ utilities_monthly,
+ )
+
+
+def __(mo):
+ mo.md("## Monthly Expenses")
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ In addition to paying for your home, you'll have monthly expenses on
+ necessities and entertainment. Let's estimate these to see how much
+ you'll save per month, after all expenses.
+ """
+ )
+ return
+
+
+def __(mo):
+ vacation = mo.ui.number(0, 100000, step=100, value=100)
+ groceries = mo.ui.number(0, 100000, step=100, value=100)
+ dining_out = mo.ui.number(0, 100000, step=100, value=100)
+ gifts = mo.ui.number(0, 100000, step=100, value=100)
+ car_payment = mo.ui.number(0, 100000, step=100, value=100)
+ entertainment = mo.ui.number(0, 100000, value=100)
+ clothing = mo.ui.number(0, 100000, value=100)
+ misc = mo.ui.number(0, 100000, step=100, value=100)
+ return (
+ car_payment,
+ clothing,
+ dining_out,
+ entertainment,
+ gifts,
+ groceries,
+ misc,
+ vacation,
+ )
+
+
+def __(
+ car_payment,
+ clothing,
+ dining_out,
+ entertainment,
+ gifts,
+ groceries,
+ misc,
+ mo,
+ vacation,
+):
+ def _row(kind, control):
+ return {"Expense": kind, "Amount ($)": control}
+
+
+ mo.ui.table(
+ [
+ _row("groceries", groceries),
+ _row("dining out", dining_out),
+ _row("gifts", gifts),
+ _row("car payment", car_payment),
+ _row("entertainment", entertainment),
+ _row("clothing", clothing),
+ _row("vacation", vacation),
+ _row("miscellaneous", misc),
+ ]
+ )
+ return
+
+
+def __(
+ car_payment,
+ cash_less_housing,
+ clothing,
+ dining_out,
+ entertainment,
+ gifts,
+ groceries,
+ misc,
+ mo,
+ vacation,
+):
+ monthly_expenses = (
+ groceries.value
+ + dining_out.value
+ + gifts.value
+ + car_payment.value
+ + entertainment.value
+ + clothing.value
+ + vacation.value
+ + misc.value
+ )
+
+ annual_cash_saved = cash_less_housing - monthly_expenses * 12
+
+ mo.md(
+ f"""
+ Your total monthly expenses are **\${monthly_expenses:,.02f}**.
+
+ This means you will save **\${annual_cash_saved/12:,.02f}** per month,
+ or **\${annual_cash_saved:,.02f}** annually.
+ """
+ )
+ return annual_cash_saved, monthly_expenses
+
+
+def __(loan):
+ schedule = loan.schedule()[1:]
+ return schedule,
+
+
+def __(np, schedule):
+ _interest, _principal = zip(
+ *[(payment.interest, payment.principal) for payment in schedule]
+ )
+
+ interest_payments = np.array(_interest)
+ principal_payments = np.array(_principal)
+ return interest_payments, principal_payments
+
+
+def __(interest_payments, mo, np, principal_payments, years):
+ import matplotlib.pyplot as plt
+
+ fig, axs = plt.subplots(1, 2)
+ fig.set_size_inches(9, 3)
+
+ _cum_interest = np.cumsum(interest_payments)
+ _cum_principal = np.cumsum(principal_payments)
+
+ axs[0].plot(_cum_interest, label="interest")
+ axs[0].plot(_cum_principal, label="principal")
+ axs[0].plot(_cum_interest + _cum_principal, label="total")
+
+ for _year in range(5, years.value, 5):
+ axs[1].axvline(_year * 12, linestyle="--", color="lightgray")
+
+ axs[0].legend()
+ axs[0].set_title("Cumulative")
+ axs[0].set_xlabel("Months")
+
+ axs[1].plot(interest_payments, label="interest")
+ axs[1].plot(principal_payments, label="principal")
+ axs[1].plot(interest_payments + principal_payments, label="total")
+ for _year in range(5, years.value, 5):
+ axs[1].axvline(_year * 12, linestyle="--", color="lightgray")
+ axs[1].set_title("Monthly")
+ axs[1].legend()
+ axs[1].set_xlabel("Months")
+ plt.tight_layout()
+
+ mo.md(
+ f"""
+ ## Payments
+
+ The plots below visualize your mortgage payments, over the duration of the
+ entire mortgage. The left plot shows cumulative payments, and the right one
+ shows monthly payments.
+
+ {mo.as_html(fig)}
+ """
+ )
+ return axs, fig, plt
+
+
+def __():
+ import marimo as mo
+ import mortgage
+ import numpy as np
+ return mo, mortgage, np
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/pokemon_stats/pokemon.py b/examples/pokemon_stats/pokemon.py
new file mode 100644
index 0000000000..8d0ec8bdf3
--- /dev/null
+++ b/examples/pokemon_stats/pokemon.py
@@ -0,0 +1,260 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# Pokémon Statistics 📊🔬")
+ return
+
+
+def __(mo, pokemon_types):
+ mo.md(
+ f"""
+ Compare Pokémon by primary type, or drill down into
+ statistics of individual Pokémon.
+
+ Start by choosing one or more types: {pokemon_types}
+ """
+ )
+ return
+
+
+def __(pokemon):
+ types = pokemon.groupby(["Type 1"])["#"].count()
+ types_name = list(types.keys())
+ types_name.sort()
+ return types, types_name
+
+
+def __(mo):
+ clear_selection = mo.ui.button(label="_Clear selection_")
+ return clear_selection,
+
+
+def __(clear_selection, mo, types_name):
+ clear_selection
+ pokemon_types = mo.ui.multiselect(types_name)
+ return pokemon_types,
+
+
+def __(mo):
+ attribute = mo.ui.dropdown(
+ {
+ "HP": "HP",
+ "Speed": "Speed",
+ "Attack": "Attack",
+ "Defense": "Defense",
+ "Attack / Defense": "Attack / Defense",
+ "Sp. Attack": "Sp. Atk",
+ "Sp. Defense": "Sp. Def",
+ "Sp. Attack / Sp. Defense": "Sp. Atk / Sp. Def",
+ }
+ )
+ return attribute,
+
+
+def __(clear_selection, mo, pokemon_types):
+ mo.hstack(
+ [mo.as_html(pokemon_types.value), clear_selection],
+ justify="start",
+ align="start",
+ gap=2,
+ ).center() if pokemon_types.value else None
+ return
+
+
+def __(mo, pokemon_types):
+ mo.md(
+ """
+ **Compare distributions** by type or **drill down**
+ into specific Pokémon's statistics 👇
+ """
+ ).callout(kind="alert") if pokemon_types.value else None
+ return
+
+
+def __(pokemon, pokemon_types):
+ def get_filtered_pokemon(value):
+ if value == "All":
+ return pokemon
+ else:
+ return pokemon[pokemon["Type 1"] == value]
+
+ filtered_pokemons = {}
+ for pokemon_type in pokemon_types.value:
+ filtered_pokemons[pokemon_type] = get_filtered_pokemon(pokemon_type)
+ return filtered_pokemons, get_filtered_pokemon, pokemon_type
+
+
+def __(distribution_plot, drilldown, mo, pokemon_types):
+ mo.tabs(
+ {
+ "**Compare distributions**": distribution_plot,
+ "**Drill down**": drilldown,
+ }
+ ) if pokemon_types.value else None
+ return
+
+
+def __(plot_pokemon, table):
+ _names = [v["Name"] for v in table.value] if table is not None else []
+ plot_pokemon(_names) if _names else None
+ return
+
+
+def __(attribute, colors, filtered_pokemons, mo, plt, pokemon_types, sns):
+ def plot():
+ plt.figure(figsize=(6.5, 4))
+ if attribute.value is not None:
+ plt.title(attribute.value)
+ for ptype, df in filtered_pokemons.items():
+ sns.histplot(
+ df[attribute.value],
+ label=ptype,
+ color=colors[ptype],
+ kde=True,
+ )
+ plt.legend()
+
+ return mo.md(
+ f"""
+ Visualized below is the distribution of {attribute}.
+
+ {mo.as_html(plt.gca())}
+ """
+ ).center()
+
+
+ distribution_plot = (
+ plot() if pokemon_types.value else None
+ )
+ return distribution_plot, plot
+
+
+def __(filtered_pokemons, mo, pokemon_types):
+ def make_table():
+ records = [
+ row
+ for df in filtered_pokemons.values()
+ for row in df.to_dict(orient="records")
+ ]
+ return mo.ui.table(records, pagination=True, selection="multi")
+
+
+ table = make_table() if pokemon_types.value else None
+ drilldown = mo.md(
+ f"""
+ Select one or more Pokémon using the checkboxes. Then scroll down for
+ a plot.
+
+ {table}
+ """
+ )
+ return drilldown, make_table, table
+
+
+def __(pokemon):
+ def plot_single_pokemon(ax, angles, labels, name):
+ pkmn = pokemon[pokemon.Name == name]
+
+ stats = [
+ pkmn["HP"].values[0],
+ pkmn["Attack"].values[0],
+ pkmn["Defense"].values[0],
+ pkmn["Sp. Atk"].values[0],
+ pkmn["Sp. Def"].values[0],
+ pkmn["Speed"].values[0],
+ pkmn["HP"].values[
+ 0
+ ], # repeat the first value to close the circular graph
+ ]
+ ax.fill(angles, stats, alpha=0.2, label=name)
+ return ax
+ return plot_single_pokemon,
+
+
+def __(np, plot_single_pokemon, plt):
+ def plot_pokemon(names):
+ fig, ax = plt.subplots(figsize=(6, 6), subplot_kw=dict(polar=True))
+ labels = np.array(
+ ["HP", "Attack", "Defense", "Sp. Atk", "Sp. Def", "Speed", "HP"]
+ )
+ angles = np.linspace(0, 2 * np.pi, len(labels), endpoint=False).tolist()
+ ax.set_xticks(angles)
+ ax.set_xticklabels(labels)
+ for name in names:
+ plot_single_pokemon(ax, angles, labels, name)
+ plt.legend(loc="upper left")
+ return ax
+ return plot_pokemon,
+
+
+def __():
+ import marimo as mo
+ import numpy as np
+ import pandas as pd
+ import matplotlib.pyplot as plt
+ import seaborn as sns
+
+ import os
+
+ print(os.listdir("./input"))
+
+ pokemon = pd.read_csv("./input/Pokemon.csv")
+ pokemon["Attack / Defense"] = pokemon["Attack"] / pokemon["Defense"]
+ pokemon["Sp. Atk / Sp. Def"] = pokemon["Sp. Atk"] / pokemon["Sp. Def"]
+ return mo, np, os, pd, plt, pokemon, sns
+
+
+def __():
+ # Defining colors for graphs
+ colors = {
+ "Bug": "#A6B91A",
+ "Dark": "#705746",
+ "Dragon": "#6F35FC",
+ "Electric": "#F7D02C",
+ "Fairy": "#D685AD",
+ "Fighting": "#C22E28",
+ "Fire": "#EE8130",
+ "Flying": "#A98FF3",
+ "Ghost": "#735797",
+ "Grass": "#7AC74C",
+ "Ground": "#E2BF65",
+ "Ice": "#96D9D6",
+ "Normal": "#A8A77A",
+ "Poison": "#A33EA1",
+ "Psychic": "#F95587",
+ "Rock": "#B6A136",
+ "Steel": "#B7B7CE",
+ "Water": "#6390F0",
+ }
+ return colors,
+
+
+def __():
+ import plotly.express as px
+ return px,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/sine_wave.py b/examples/sine_wave.py
new file mode 100644
index 0000000000..24eb43d9e9
--- /dev/null
+++ b/examples/sine_wave.py
@@ -0,0 +1,63 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# Plotting a Sine Wave")
+ return
+
+
+def __(mo, np):
+ period = mo.ui.slider(start=np.pi, stop=2*np.pi, label="period")
+ amplitude = mo.ui.slider(start=1, stop=2, step=0.1, label="amplitude")
+
+ [period, amplitude]
+ return amplitude, period
+
+
+def __(amplitude, mo, period):
+ mo.md(
+ f"""
+ Here's a plot of
+ $f(x) = {amplitude.value:.02f}\sin((2\pi/{period.value:.02f}) x)$:
+ """
+ )
+ return
+
+
+def __(amplitude, period, plot_sine_wave):
+ plot_sine_wave(period.value, amplitude.value)
+ return
+
+
+def __(np, plt):
+ def plot_sine_wave(period, amplitude):
+ x = np.linspace(0, 2*np.pi, num=100)
+ plt.figure(figsize=(6.7, 2.5))
+ plt.plot(x, amplitude*np.sin(x*2*np.pi / period))
+ plt.xlabel('$x$')
+ plt.xlim(0, 2*np.pi)
+ plt.ylim(-2, 2)
+ plt.tight_layout()
+ return plt.gca()
+ return plot_sine_wave,
+
+
+def __():
+ import marimo as mo
+
+ import numpy as np
+ import matplotlib.pyplot as plt
+ return mo, np, plt
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/table.py b/examples/table.py
new file mode 100644
index 0000000000..6c63948738
--- /dev/null
+++ b/examples/table.py
@@ -0,0 +1,220 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("""
+ # Tables
+
+ > “Sometimes I’ll start a sentence and I don’t even know where it’s going. I just hope I find it along the way.”
+ — Michael Scott
+ """)
+ return
+
+
+def __(mo):
+ mo.md("_Create rich tables with selectable rows using_ `mo.ui.table`.")
+ return
+
+
+def __(mo):
+ mo.md("**Single selection.**")
+ return
+
+
+def __(mo, office_characters):
+ single_select_table = mo.ui.table(
+ office_characters,
+ selection="single",
+ pagination=True,
+ )
+ return single_select_table,
+
+
+def __(mo, single_select_table):
+ mo.tabs({"table": single_select_table, "selection": single_select_table.value})
+ return
+
+
+def __(mo):
+ mo.md("**Multi-selection.**")
+ return
+
+
+def __(mo, office_characters):
+ multi_select_table = mo.ui.table(
+ office_characters,
+ selection="multi",
+ pagination=True,
+ )
+ return multi_select_table,
+
+
+def __(mo, multi_select_table):
+ mo.tabs({"table": multi_select_table, "selection": multi_select_table.value})
+ return
+
+
+def __(mo):
+ mo.md("**No selection.**")
+ return
+
+
+def __(mo, office_characters):
+ table = mo.ui.table(
+ office_characters,
+ label="Employees",
+ selection=None,
+ )
+
+ table
+ return table,
+
+
+def __(mo):
+ office_characters = [
+ {
+ "first_name": "Michael",
+ "last_name": "Scott",
+ "ability": mo.ui.slider(1, 10, value=3),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Jim",
+ "last_name": "Halpert",
+ "ability": mo.ui.slider(1, 10, value=7),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Pam",
+ "last_name": "Beesly",
+ "ability": mo.ui.slider(1, 10, value=3),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Dwight",
+ "last_name": "Schrute",
+ "ability": mo.ui.slider(1, 10, value=7),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Angela",
+ "last_name": "Martin",
+ "ability": mo.ui.slider(1, 10, value=5),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Kevin",
+ "last_name": "Malone",
+ "ability": mo.ui.slider(1, 10, value=3),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Oscar",
+ "last_name": "Martinez",
+ "ability": mo.ui.slider(1, 10, value=3),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Stanley",
+ "last_name": "Hudson",
+ "ability": mo.ui.slider(1, 10, value=5),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Phyllis",
+ "last_name": "Vance",
+ "ability": mo.ui.slider(1, 10, value=5),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Meredith",
+ "last_name": "Palmer",
+ "ability": mo.ui.slider(1, 10, value=7),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Creed",
+ "last_name": "Bratton",
+ "ability": mo.ui.slider(1, 10, value=3),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Ryan",
+ "last_name": "Howard",
+ "ability": mo.ui.slider(1, 10, value=5),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Kelly",
+ "last_name": "Kapoor",
+ "ability": mo.ui.slider(1, 10, value=3),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Toby",
+ "last_name": "Flenderson",
+ "ability": mo.ui.slider(1, 10, value=3),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Darryl",
+ "last_name": "Philbin",
+ "ability": mo.ui.slider(1, 10, value=7),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Erin",
+ "last_name": "Hannon",
+ "ability": mo.ui.slider(1, 10, value=5),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Andy",
+ "last_name": "Bernard",
+ "ability": mo.ui.slider(1, 10, value=5),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Jan",
+ "last_name": "Levinson",
+ "ability": mo.ui.slider(1, 10, value=5),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "David",
+ "last_name": "Wallace",
+ "ability": mo.ui.slider(1, 10, value=3),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ {
+ "first_name": "Holly",
+ "last_name": "Flax",
+ "ability": mo.ui.slider(1, 10, value=7),
+ "favorite place": mo.md("![img](https://picsum.photos/100)"),
+ },
+ ]
+ return office_characters,
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/tabs.py b/examples/tabs.py
new file mode 100644
index 0000000000..6f0fbfb376
--- /dev/null
+++ b/examples/tabs.py
@@ -0,0 +1,68 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# Tabs")
+ return
+
+
+def __(mo):
+ mo.md("Use `mo.ui.tabs` to organize outputs.")
+ return
+
+
+def __(mo):
+ settings = mo.vstack(
+ [
+ mo.md("Edit User"),
+ first := mo.ui.text(label="First Name"),
+ last := mo.ui.text(label="Last Name"),
+ ]
+ )
+
+ organization = mo.vstack(
+ [
+ mo.md("Edit Organization"),
+ org := mo.ui.text(label="Organization Name", value="..."),
+ employees := mo.ui.number(
+ label="Number of Employees", start=0, stop=1000
+ ),
+ ]
+ )
+
+ mo.tabs(
+ {
+ "🧙‍♀ User": settings,
+ "🏢 Organization": organization,
+ }
+ )
+ return employees, first, last, org, organization, settings
+
+
+def __(employees, first, last, mo, org):
+ mo.md(
+ f"""
+ Welcome **{first.value} {last.value}** to **{org.value}**! You are
+ employee no. **{employees.value + 1}**.
+
+ #{"🎉" * (min(employees.value + 1, 1000))}
+ """
+ ) if all([first.value, last.value, org.value]) else None
+ return
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/examples/task_list.py b/examples/task_list.py
new file mode 100644
index 0000000000..d1dfb4911d
--- /dev/null
+++ b/examples/task_list.py
@@ -0,0 +1,108 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# Task List")
+ return
+
+
+def __(add_task_button, clear_tasks_button, mo, state, task):
+ # Construct the task list based on the task list state.
+ #
+ # This cell will re-run and reconstruct the task list with updated state
+ # whenever either of the buttons are clicked, since they include references
+ # to the button elements.
+ task_list = mo.ui.array(
+ [
+ mo.ui.checkbox(value=v, label=l)
+ for v, l in zip(state.values, state.labels)
+ ],
+ label="tasks",
+ )
+
+ (
+ task,
+ add_task_button,
+ clear_tasks_button,
+ task_list if state.values else mo.md("No tasks! 🎉"),
+ )
+ return task_list,
+
+
+def __(state, task_list):
+ # This cell runs whenever a task is checked or unchecked, updating the state.
+ #
+ # This makes use of the fact that writing to attributes (non-globals) doesn't
+ # trigger reactive execution.
+ #
+ # In the future we may introduce an API for setting state.
+ state.values[:] = task_list.value
+ return
+
+
+def __(mo):
+ # A text input for entering a task
+ task = mo.ui.text(placeholder="a task ...")
+
+ class TaskListState:
+ """
+ This class holds the state of the task list: the tasks (labels),
+ and whether they've been completed (values).
+ """
+ def __init__(self):
+ # The task labels
+ self.labels = []
+ # Whether each label is checked
+ self.values = []
+
+ def add_task(self):
+ if task.value:
+ # Add the current value of the task input to `self.labels`
+ self.labels.append(task.value)
+ # The task starts as incomplete
+ self.values.append(False)
+ return self
+
+ def clear_tasks(self):
+ # Remove all completed tasks from state
+ self.labels[:] = [
+ label
+ for i, label in enumerate(self.labels)
+ if not self.values[i]
+ ]
+ self.values[:] = [v for v in self.values if not v]
+ return self
+
+ state = TaskListState()
+
+ # Buttons to add and remove tasks; these buttons mutate state when they
+ # are clicked.
+ add_task_button = mo.ui.button(
+ value=state,
+ on_click=lambda state: state.add_task(),
+ label="add task",
+ )
+
+ clear_tasks_button = mo.ui.button(
+ value=state,
+ on_click=lambda state: state.clear_tasks(),
+ label="clear completed tasks",
+ )
+ return TaskListState, add_task_button, clear_tasks_button, state, task
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js
new file mode 100644
index 0000000000..3885dda82e
--- /dev/null
+++ b/frontend/.eslintrc.js
@@ -0,0 +1,105 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+/**
+ * @type {import('eslint').Linter.Config}
+ */
+module.exports = {
+ root: true,
+ extends: [
+ "react-app",
+ "react-app/jest",
+ "eslint:recommended",
+ "plugin:react/recommended",
+ "plugin:react/jsx-runtime",
+ "plugin:@typescript-eslint/recommended",
+ "plugin:ssr-friendly/recommended",
+ "plugin:storybook/recommended",
+ "plugin:unicorn/recommended",
+ // This removes rules that conflict with prettier.
+ "prettier",
+ ],
+ parser: "@typescript-eslint/parser",
+ plugins: ["@typescript-eslint", "header"],
+ rules: {
+ "header/header": [
+ "error",
+ "block",
+ " Copyright 2023 Marimo. All rights reserved. ",
+ ],
+
+ // These rules don't require type information and have autofixes
+ "@typescript-eslint/array-type": ["error", { default: "array-simple" }],
+ "@typescript-eslint/consistent-generic-constructors": "error",
+ "@typescript-eslint/consistent-type-definitions": "error",
+ "@typescript-eslint/no-confusing-non-null-assertion": "error",
+ "@typescript-eslint/no-dynamic-delete": "error",
+ "@typescript-eslint/prefer-ts-expect-error": "error",
+ curly: "error",
+
+ // Turn off recommended we don't want
+ "ssr-friendly/no-dom-globals-in-react-fc": "off",
+ "ssr-friendly/no-dom-globals-in-constructor": "off",
+ "react/prop-types": "off",
+ "react/no-unescaped-entities": "off",
+ "@typescript-eslint/ban-types": [
+ "error",
+ {
+ types: {
+ // un-ban {}
+ "{}": false,
+ },
+ extendDefaults: true,
+ },
+ ],
+ // Turn of unicorn rules that don't have autofixes or that we don't want
+ "unicorn/consistent-function-scoping": "off",
+ "unicorn/expiring-todo-comments": "off",
+ "unicorn/filename-case": "off",
+ "unicorn/no-array-callback-reference": "off",
+ "unicorn/no-array-for-each": "off",
+ "unicorn/no-array-method-this-argument": "off", // false positives
+ "unicorn/no-array-reduce": "off",
+ "unicorn/no-await-expression-member": "off",
+ "unicorn/no-null": "off",
+ "unicorn/no-useless-undefined": "off",
+ "unicorn/prefer-add-event-listener": "off",
+ "unicorn/prefer-at": "off",
+ "unicorn/prefer-code-point": "off",
+ "unicorn/prefer-module": "off",
+ "unicorn/prefer-query-selector": "off",
+ "unicorn/prefer-dom-node-text-content": "off",
+ "unicorn/prefer-top-level-await": "off",
+ "unicorn/prevent-abbreviations": "off",
+
+ // These rules aim to reduce bikeshedding during code reviews
+ // Often there are multiple ways to do something and this forces consistency
+ "prefer-template": "error", // Use template literals instead of string concatenation
+ "unicorn/switch-case-braces": ["error", "avoid"], // Only braces when necessary
+ "unicorn/consistent-destructuring": "error",
+ "unicorn/prefer-logical-operator-over-ternary": "error",
+ "unicorn/prefer-spread": "error",
+ "unicorn/no-object-as-default-parameter": "error",
+ "unicorn/prefer-number-properties": "error",
+ "unicorn/prefer-ternary": "error",
+ "unicorn/prefer-array-some": "error",
+ "react/jsx-boolean-value": ["error", "always"], // Force `={true}` or `={false}` as it's more explicit
+ "react/hook-use-state": "error",
+ "react/jsx-no-useless-fragment": "error",
+ "react/jsx-pascal-case": "error",
+ "react/self-closing-comp": "error",
+ "react/function-component-definition": [
+ "error",
+ {
+ namedComponents: "arrow-function",
+ unnamedComponents: "arrow-function",
+ },
+ ],
+ },
+ overrides: [
+ {
+ files: ["**/e2e-tests/**"],
+ rules: {
+ "testing-library/prefer-screen-queries": "off",
+ },
+ },
+ ],
+};
diff --git a/frontend/.gitignore b/frontend/.gitignore
new file mode 100644
index 0000000000..29d3a7ecd0
--- /dev/null
+++ b/frontend/.gitignore
@@ -0,0 +1,19 @@
+# dependencies
+/node_modules
+/.pnp
+.pnp.js
+
+# testing
+/coverage
+
+# production
+/build
+
+# library output
+/lib
+!/src/lib
+
+# playwright
+/test-results/
+/playwright-report/
+/playwright/.cache/
diff --git a/frontend/.prettierignore b/frontend/.prettierignore
new file mode 100644
index 0000000000..836b5779ea
--- /dev/null
+++ b/frontend/.prettierignore
@@ -0,0 +1,3 @@
+dist
+lib
+pnpm-lock.yaml
diff --git a/frontend/.prettierrc.json b/frontend/.prettierrc.json
new file mode 100644
index 0000000000..0d0bbc9456
--- /dev/null
+++ b/frontend/.prettierrc.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "http://json.schemastore.org/prettierrc",
+ "singleQuote": false
+}
diff --git a/frontend/.storybook/main.ts b/frontend/.storybook/main.ts
new file mode 100644
index 0000000000..6b2471fc67
--- /dev/null
+++ b/frontend/.storybook/main.ts
@@ -0,0 +1,19 @@
+import type { StorybookConfig } from "@storybook/react-vite";
+const config: StorybookConfig = {
+ stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx|mdx)"],
+ addons: [
+ "@storybook/addon-links",
+ "@storybook/addon-essentials",
+ "@storybook/addon-interactions",
+ "@storybook/addon-styling",
+ ],
+ framework: {
+ name: "@storybook/react-vite",
+ options: {},
+ },
+ docs: {
+ autodocs: "tag",
+ docsMode: false,
+ },
+};
+export default config;
diff --git a/frontend/.storybook/preview.tsx b/frontend/.storybook/preview.tsx
new file mode 100644
index 0000000000..2c7d7991a5
--- /dev/null
+++ b/frontend/.storybook/preview.tsx
@@ -0,0 +1,48 @@
+import type { Preview, Decorator } from "@storybook/react";
+import "../src/css/index.css";
+import "../src/css/App.css";
+import "./sb.css";
+import "tailwindcss/tailwind.css";
+import { useEffect } from "react";
+import { cn } from "../src/lib/utils";
+
+const withTheme: Decorator = (Story, context) => {
+ const theme = context.globals.theme || "light";
+ useEffect(() => {
+ document.body.classList.add(theme, `${theme}-theme`);
+ return () => document.body.classList.remove(theme, `${theme}-theme`);
+ }, [theme]);
+
+ return (
+ <div className={cn(theme, "p-5")}>
+ <Story />
+ </div>
+ );
+};
+
+const preview: Preview = {
+ parameters: {
+ actions: { argTypesRegex: "^on[A-Z].*" },
+ controls: {
+ matchers: {
+ color: /(background|color)$/i,
+ date: /Date$/,
+ },
+ },
+ },
+ globalTypes: {
+ theme: {
+ description: "Global theme",
+ defaultValue: "light",
+ toolbar: {
+ title: "Theme",
+ icon: "circlehollow",
+ items: ["light", "dark"],
+ dynamicTitle: true,
+ },
+ },
+ },
+ decorators: [withTheme],
+};
+
+export default preview;
diff --git a/frontend/.storybook/sb.css b/frontend/.storybook/sb.css
new file mode 100644
index 0000000000..8c2be027bd
--- /dev/null
+++ b/frontend/.storybook/sb.css
@@ -0,0 +1,5 @@
+.sbdocs-content {
+ display: flex;
+ gap: 20px;
+ flex-direction: column;
+}
diff --git a/frontend/.stylelintrc.js b/frontend/.stylelintrc.js
new file mode 100644
index 0000000000..cadb6597b8
--- /dev/null
+++ b/frontend/.stylelintrc.js
@@ -0,0 +1,55 @@
+module.exports = {
+ extends: ["stylelint-config-standard"],
+ ignoreFiles: ["**/*.tsx", "**/*.ts", "dist/**"],
+ fix: true,
+ reportNeedlessDisables: true,
+ rules: {
+ // We ideally want these rules to be enabled, but we need to fix a lot
+ "selector-class-pattern": null,
+ "selector-id-pattern": null,
+ "no-descending-specificity": null,
+ // Turn off rules from the standard config
+ "at-rule-no-unknown": [true, { ignoreAtRules: ["tailwind"] }],
+ "font-family-no-missing-generic-family-keyword": null,
+ "number-max-precision": null,
+ // Force font-size to be in rem
+ "unit-allowed-list": [
+ [
+ // fonts
+ "rem",
+ // spacing
+ "%",
+ "vw",
+ "vh",
+ // time
+ "ms",
+ "s",
+ // grid
+ "fr",
+ // angle
+ "turn",
+ "deg",
+ ],
+ {
+ ignoreProperties: {
+ px: [
+ /border/,
+ /radius/,
+ /width/,
+ /height/,
+ /padding/,
+ /margin/,
+ /gap/,
+ /top/,
+ /bottom/,
+ /left/,
+ /right/,
+ /shadow/,
+ /outline/,
+ /clip/,
+ ],
+ },
+ },
+ ],
+ },
+};
diff --git a/frontend/components.json b/frontend/components.json
new file mode 100644
index 0000000000..60129a898b
--- /dev/null
+++ b/frontend/components.json
@@ -0,0 +1,15 @@
+{
+ "$schema": "https://ui.shadcn.com/schema.json",
+ "style": "default",
+ "rsc": false,
+ "tailwind": {
+ "config": "src/tailwind.config.js",
+ "css": "src/css/global.css",
+ "baseColor": "slate",
+ "cssVariables": true
+ },
+ "aliases": {
+ "components": "@/components",
+ "utils": "@/lib/utils"
+ }
+}
diff --git a/frontend/e2e-tests/badButton.spec.ts b/frontend/e2e-tests/badButton.spec.ts
new file mode 100644
index 0000000000..30c3fd211b
--- /dev/null
+++ b/frontend/e2e-tests/badButton.spec.ts
@@ -0,0 +1,12 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { test, expect } from "@playwright/test";
+import { getAppUrl } from "../playwright.config";
+
+const appUrl = getAppUrl("bad_button.py");
+
+test("invalid on_click does not crash kernel", async ({ page }) => {
+ await page.goto(appUrl);
+ await page.getByRole("button", { name: "Bad button" }).click();
+ // the kernel should still be alive
+ await expect(page.getByText("kernel not found")).toHaveCount(0);
+});
diff --git a/frontend/e2e-tests/bugs.spec.ts b/frontend/e2e-tests/bugs.spec.ts
new file mode 100644
index 0000000000..be2bd4c053
--- /dev/null
+++ b/frontend/e2e-tests/bugs.spec.ts
@@ -0,0 +1,44 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { test, expect } from "@playwright/test";
+import { getAppUrl } from "../playwright.config";
+import { createCellBelow, runCell } from "./helper";
+
+/**
+ * This test makes sure that downstream UI elements are re-initialized when
+ * upstream source cells are re-run.
+ */
+test("correctly initializes cells", async ({ page }) => {
+ const appUrl = getAppUrl("bugs.py");
+ await page.goto(appUrl);
+
+ // Is initialized to 1
+ const number = page.getByRole("spinbutton");
+ await expect(number).toBeVisible();
+ await expect(number.inputValue()).resolves.toBe("1");
+
+ // Change the value to 5
+ await number.fill("5");
+
+ // Create a new cell, add `bug_1` to it, and run it
+ await createCellBelow({
+ page,
+ cellSelector: "text=bug 1",
+ content: `bug_1`,
+ run: true,
+ });
+
+ // Check they are both 5
+ let numberInputs = page.getByRole("spinbutton");
+ await expect(numberInputs).toHaveCount(2);
+ await expect(numberInputs.first()).toHaveValue("5");
+ await expect(numberInputs.last()).toHaveValue("5");
+
+ // Run first cell
+ await runCell({ page, cellSelector: "text=bug 1" });
+
+ // Check each number input is 1
+ numberInputs = page.getByRole("spinbutton");
+ await expect(numberInputs).toHaveCount(2);
+ await expect(numberInputs.first()).toHaveValue("1");
+ await expect(numberInputs.last()).toHaveValue("1");
+});
diff --git a/frontend/e2e-tests/cells.spec.ts b/frontend/e2e-tests/cells.spec.ts
new file mode 100644
index 0000000000..e1b8477d37
--- /dev/null
+++ b/frontend/e2e-tests/cells.spec.ts
@@ -0,0 +1,108 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { test, expect } from "@playwright/test";
+import { getAppUrl } from "../playwright.config";
+
+/**
+ * Cell re-render count is a good indicator of performance.
+ */
+test("keeps re-renders from growing", async ({ page }) => {
+ const appUrl = getAppUrl("cells.py");
+ await page.goto(appUrl);
+ await page.waitForLoadState("networkidle");
+
+ // Read the render count
+ const cellRenderCount = await page.evaluate(
+ () => document.body.dataset.cellRenderCount
+ );
+
+ // This count may grow with the addition of new features. If this is the case,
+ // it is okay to increase the count. However, if the count is growing
+ // unexpectedly, it is a sign that something is causing cells to re-render.
+ // It is also ok to decrease the count if we find a way to reduce the number
+ // of renders.
+ await expect(cellRenderCount).toBe("10");
+});
+
+/**
+ * This tests:
+ * - adding cells above and below existing cells.
+ * - running individual cells
+ * - moving cells up and down
+ */
+test("page renders 2 cells", async ({ page }) => {
+ const appUrl = getAppUrl("cells.py");
+ await page.goto(appUrl);
+
+ // Can see output / code
+ await expect(page.locator("h1").getByText("Cell 1")).toBeVisible();
+ await expect(page.locator("h1").getByText("Cell 2")).toBeVisible();
+
+ // No add buttons are visible
+ await expect(
+ page.getByTestId("create-cell-button").locator(":visible").count()
+ ).resolves.toBe(0);
+
+ // Hover over a cell the 'add cell' button appears
+ await page.hover("text=Cell 1");
+ await expect(
+ page.getByTestId("create-cell-button").locator(":visible").count()
+ ).resolves.toBe(2);
+
+ // Clicking the first button creates a new cell at the top
+ await page
+ .getByTestId("create-cell-button")
+ .locator(":visible")
+ .first()
+ .click();
+ // Type into the currently focused cell
+ await page.locator("*:focus").type(`mo.md("# Cell 0")`);
+
+ // Check the rendered cells
+ await expect(page.locator("h1")).toHaveText(["Cell 1", "Cell 2"]);
+
+ // Run the new cell
+ await page.getByTestId("run-button").locator(":visible").first().click();
+
+ // Check the rendered cells
+ await expect(page.locator("h1")).toHaveText(["Cell 0", "Cell 1", "Cell 2"]);
+
+ // Add cell below, text, and run
+ await page.hover("text=Cell 1");
+ await page
+ .getByTestId("create-cell-button")
+ .locator(":visible")
+ .last()
+ .click();
+ await page.locator("*:focus").type(`mo.md("# Cell 1.5")`);
+ await page.getByTestId("run-button").locator(":visible").last().click();
+
+ // Verify the rendered cells
+ await expect(page.locator("h1")).toHaveText([
+ "Cell 0",
+ "Cell 1",
+ "Cell 1.5",
+ "Cell 2",
+ ]);
+
+ // Focus on Cell 0 and move it down
+ await page
+ .getByRole("textbox")
+ .filter({ hasText: 'mo.md("# Cell 0")' })
+ .click();
+ await page.keyboard.press("Control+Shift+J");
+
+ // Focus on Cell 2 and move it up
+ await page
+ .getByRole("textbox")
+ .filter({ hasText: 'mo.md("# Cell 2")' })
+ .click();
+ await page.keyboard.press("Control+Shift+K");
+
+ // Verify the rendered cells
+ await expect(page.locator("h1")).toHaveText([
+ "Cell 1",
+ "Cell 0",
+ "Cell 2",
+ "Cell 1.5",
+ ]);
+});
diff --git a/frontend/e2e-tests/components.spec.ts b/frontend/e2e-tests/components.spec.ts
new file mode 100644
index 0000000000..b2880f5ad3
--- /dev/null
+++ b/frontend/e2e-tests/components.spec.ts
@@ -0,0 +1,456 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { test, expect } from "@playwright/test";
+import { getAppUrl } from "../playwright.config";
+
+test.beforeEach(async ({ page }) => {
+ const appUrl = getAppUrl("components.py");
+ await page.goto(appUrl);
+});
+
+const pageHelper = async (page) => {
+ return {
+ selectBasicComponent: async (type: string) => {
+ const select = await page.locator("#cell-1").locator("select");
+ await select.selectOption({ label: type });
+ },
+ selectComplexComponent: async (type: string) => {
+ const select = await page.locator("#cell-4").locator("select");
+ await select.selectOption({ label: type });
+ },
+ verifyOutput: async (text: string) => {
+ await expect(
+ page.getByText(`The element's current value is ${text}`)
+ ).toBeVisible();
+ },
+ };
+};
+
+test("page renders read only view in read mode", async ({ page }) => {
+ // Filename is not visible
+ await expect(page.getByText("components.py").last()).not.toBeVisible();
+ // Has elements with class name 'controls'
+ expect(await page.locator("#save-button").count()).toBe(0);
+
+ // Can see output
+ await expect(page.locator("h1").getByText("UI Elements")).toBeVisible();
+});
+
+test("button", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectBasicComponent("button");
+ const element = page.locator("button").getByText("click me");
+
+ // Verify is visible
+ await expect(element).toBeVisible();
+ // Verify output
+ await helper.verifyOutput("0");
+ // Click button
+ await element.click();
+ // Verify output
+ await helper.verifyOutput("1");
+});
+
+test("checkbox", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectBasicComponent("checkbox");
+ const element = page.getByText("check me");
+
+ // Verify is visible
+ await expect(element).toBeVisible();
+ // Verify output
+ await helper.verifyOutput("False");
+ // Click checkbox
+ await element.click();
+ // Verify output
+ await helper.verifyOutput("True");
+ // Click checkbox
+ await element.click();
+ // Verify output
+ await helper.verifyOutput("False");
+});
+
+test("date", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectBasicComponent("date");
+ const element = page.getByRole("textbox");
+
+ // Verify is visible
+ await expect(element).toBeVisible();
+ await element.fill("2020-01-20");
+ // Verify output
+ await helper.verifyOutput("2020-01-20");
+});
+
+test("dropdown", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectBasicComponent("dropdown");
+ const element = page.locator("#cell-2").getByRole("combobox");
+
+ // Verify is visible
+ await expect(element).toBeVisible();
+ // Verify output
+ await helper.verifyOutput("None");
+ // Select option
+ await element.selectOption({ label: "b" });
+ // Verify output
+ await helper.verifyOutput("b");
+});
+
+test("file button", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectBasicComponent("file button");
+ const element = page.getByRole("button", { name: "Upload", exact: true });
+ // Verify is visible
+ await expect(element).toBeVisible();
+ // Verify output
+ await helper.verifyOutput("None");
+});
+
+test("file area", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectBasicComponent("file area");
+ const element = page.getByText("Drag and drop files here");
+ // Verify is visible
+ await expect(element).toBeVisible();
+ // Verify output
+ await helper.verifyOutput("None");
+});
+
+test("multiselect", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectBasicComponent("multiselect");
+ let element = page.locator("marimo-multiselect div svg").last();
+
+ // Verify is visible
+ await expect(element).toBeVisible();
+ // Verify output
+ await helper.verifyOutput("");
+ // Select option
+ await element.click();
+ await page.getByText("b", { exact: true }).click();
+ // Verify output
+ await helper.verifyOutput("b");
+ // Select option
+ element = page.locator("marimo-multiselect div svg").last();
+ await element.click();
+ await page.getByText("c", { exact: true }).click();
+ // Verify output
+ await helper.verifyOutput("b, c");
+});
+
+test("number", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectBasicComponent("number");
+ const element = page.getByRole("spinbutton");
+
+ // Verify is visible
+ await expect(element).toBeVisible();
+ // Verify output
+ await helper.verifyOutput("1");
+ // Select option
+ await element.fill("5");
+ // Verify output
+ await helper.verifyOutput("5");
+});
+
+test("radio", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectBasicComponent("radio");
+ const element = page.getByRole("radiogroup").getByText("a");
+
+ // Verify is visible and selected
+ await expect(element).toBeVisible();
+ // Verify output
+ await helper.verifyOutput("a");
+ // Select option
+ await page.getByRole("radiogroup").getByText("b").click();
+ // Verify a is not selected
+ // Verify output
+ await helper.verifyOutput("b");
+});
+
+test("slider", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectBasicComponent("slider");
+ const element = page.getByRole("slider");
+
+ // Verify is visible and selected
+ await expect(element).toBeVisible();
+ // Verify output
+ await helper.verifyOutput("1");
+ // Move slider
+ await element.dragTo(page.locator("marimo-slider"));
+ // Verify output
+ await helper.verifyOutput("6");
+});
+
+test("switch", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectBasicComponent("switch");
+ const element = page.getByRole("switch");
+
+ // Verify is visible
+ await expect(element).toBeVisible();
+ // Verify output
+ await helper.verifyOutput("False");
+ // Click checkbox
+ await element.click();
+ // Verify output
+ await helper.verifyOutput("True");
+ // Click checkbox
+ await element.click();
+ // Verify output
+ await helper.verifyOutput("False");
+});
+
+test("table", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectBasicComponent("table");
+ const element = page.getByText("Michael");
+
+ // Verify is visible
+ await expect(element).toBeVisible();
+ // Click first checkbox to select all
+ await page.getByRole("checkbox").first().click();
+ await page.waitForTimeout(100); // Sleeps are not ideal
+ const output = await page
+ .locator("#cell-3")
+ .locator(".marimo-json-output")
+ .first()
+ .innerText();
+ expect(output).toMatch(
+ `
+[2 Items
+0:{2 Items
+"first_name":"Michael"
+"last_name":"Scott"
+}
+1:{2 Items
+"first_name":"Dwight"
+"last_name":"Schrute"
+}
+]
+ `.trim()
+ );
+
+ // Click second checkbox to remove first row
+ await page.getByRole("checkbox").nth(1).click();
+ await page.waitForTimeout(100); // Sleeps are not ideal
+ const output2 = await page
+ .locator("#cell-3")
+ .locator(".marimo-json-output")
+ .first()
+ .innerText();
+ expect(output2).toMatch(
+ `
+[1 Items
+0:{2 Items
+"first_name":"Dwight"
+"last_name":"Schrute"
+}
+]
+`.trim()
+ );
+});
+
+test("text", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectBasicComponent("text");
+ const element = page.getByRole("textbox");
+
+ // Verify is visible
+ await expect(element).toBeVisible();
+ // Select option
+ await element.fill("hello");
+ // Verify output
+ await helper.verifyOutput("hello");
+});
+
+test("text_area", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectBasicComponent("text_area");
+ const element = page.getByRole("textbox");
+
+ // Verify is visible
+ await expect(element).toBeVisible();
+ // Select option
+ await element.fill("hello");
+ // Verify output
+ await helper.verifyOutput("hello");
+});
+
+test("complex - array", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectComplexComponent("array");
+
+ // Check the elements
+ const textbox = page.getByRole("textbox").first();
+ const slider = page.getByRole("slider");
+ const date = page.getByRole("textbox").last();
+ // Verify they are visible
+ await expect(textbox).toBeVisible();
+ await expect(slider).toBeVisible();
+ await expect(date).toBeVisible();
+ // Fill
+ await textbox.fill("hi marimo");
+ await slider.dragTo(page.locator("marimo-slider").first());
+ await date.fill("2020-01-20");
+ // Verify output
+ await page.waitForTimeout(100); // Sleeps are not ideal
+ const output = await page
+ .locator("#cell-6")
+ .locator(".marimo-json-output")
+ .first()
+ .innerText();
+ expect(output).toMatch(
+ `
+[3 Items
+0:"hi marimo"
+1:6
+2:2020-01-20
+]
+`.trim()
+ );
+});
+
+test("complex - batch", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectComplexComponent("batch");
+
+ // Check the elements
+ const textbox = page.getByRole("textbox").first();
+ const date = page.getByRole("textbox").last();
+ // Verify they are visible
+ await expect(textbox).toBeVisible();
+ await expect(date).toBeVisible();
+ // Fill
+ await textbox.fill("hi again marimo");
+ await date.fill("2020-04-20");
+ // Verify output
+ await page.waitForTimeout(100); // Sleeps are not ideal
+ const output = await page
+ .locator("#cell-6")
+ .locator(".marimo-json-output")
+ .first()
+ .innerText();
+ expect(output).toMatch(
+ `
+{2 Items
+"name":"hi again marimo"
+"date":2020-04-20
+}
+`.trim()
+ );
+});
+
+test("complex - dictionary", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectComplexComponent("dictionary");
+
+ // Check the elements
+ const textbox = page.getByRole("textbox").first();
+ const buttons = page.locator("button:visible").getByText("click here");
+ // Verify they are visible
+ await expect(textbox).toBeVisible();
+ await expect(buttons).toHaveCount(3);
+ // Fill
+ await textbox.fill("something!");
+ // Click first button twice
+ await buttons.first().click();
+ await buttons.first().click();
+ // Click last once
+ await buttons.last().click();
+ // Verify output
+ await page.waitForTimeout(100); // Sleeps are not ideal
+ const output = await page
+ .locator("#cell-6")
+ .locator(".marimo-json-output")
+ .first()
+ .innerText();
+ expect(output).toMatch(
+ `
+{3 Items
+"slider":1
+"text":"something!"
+"array":[3 Items
+0:2
+1:0
+2:1
+]
+}
+`.trim()
+ );
+});
+
+test("complex - form", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectComplexComponent("form");
+
+ // Check the elements
+ const texteara = page.locator("textarea:visible");
+ // Verify they are visible
+ await expect(texteara).toBeVisible();
+ // Verify no output
+ await helper.verifyOutput("None");
+ // Fill
+ await texteara.fill("something!");
+ // Verify output is still empty until submit
+ await helper.verifyOutput("None");
+
+ // Click submit
+ await page.locator("button:visible").getByText("Submit").click();
+ // Verify output
+ await helper.verifyOutput("something!");
+});
+
+test("complex - reused in json", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectComplexComponent("reused-in-json");
+
+ // Check the elements
+ const textbox = page.getByRole("textbox");
+ const number = page.getByRole("spinbutton");
+ // Verify they are visible
+ await expect(textbox).toHaveCount(2);
+ await expect(number).toHaveCount(2);
+
+ // Fill the first one
+ await textbox.first().fill("hello");
+ await number.first().fill("5");
+ // Verify all have the same value
+ await expect(textbox.last()).toHaveValue("hello");
+ await expect(number.last()).toHaveValue("5");
+
+ // Fill the last one
+ await textbox.last().fill("world");
+ await number.last().fill("10");
+ // Verify all have the same value
+ await expect(textbox.first()).toHaveValue("world");
+ await expect(number.first()).toHaveValue("10");
+});
+
+test("complex - reused in markdown", async ({ page }) => {
+ const helper = await pageHelper(page);
+ await helper.selectComplexComponent("reused-in-markdown");
+
+ // Check the elements
+ const textbox = page.getByRole("textbox");
+ const number = page.getByRole("spinbutton");
+ // Verify they are visible
+ await expect(textbox).toHaveCount(2);
+ await expect(number).toHaveCount(2);
+
+ // Fill the first one
+ await textbox.first().fill("hello");
+ await number.first().fill("5");
+ // Verify all have the same value
+ await expect(textbox.last()).toHaveValue("hello");
+ await expect(number.last()).toHaveValue("5");
+
+ // Fill the last one
+ await textbox.last().fill("world");
+ await number.last().fill("10");
+ // Verify all have the same value
+ await expect(textbox.first()).toHaveValue("world");
+ await expect(number.first()).toHaveValue("10");
+});
diff --git a/frontend/e2e-tests/helper.ts b/frontend/e2e-tests/helper.ts
new file mode 100644
index 0000000000..48434e17f7
--- /dev/null
+++ b/frontend/e2e-tests/helper.ts
@@ -0,0 +1,44 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { Page, expect } from "@playwright/test";
+
+export async function createCellBelow(opts: {
+ page: Page;
+ cellSelector: string;
+ content: string;
+ run: boolean;
+}) {
+ const { page, cellSelector, content, run } = opts;
+
+ // Hover over a cell the 'add cell' button appears
+ await page.hover(cellSelector);
+ await expect(
+ page.getByTestId("create-cell-button").locator(":visible").count()
+ ).resolves.toBe(2);
+
+ // Clicking the first button creates a new cell below
+ await page
+ .getByTestId("create-cell-button")
+ .locator(":visible")
+ .last()
+ .click();
+ // Type into the currently focused cell
+ if (content) {
+ await page.locator("*:focus").type(content);
+ }
+
+ // Run the new cell
+ if (run) {
+ await page.locator("*:focus").hover();
+ await page.getByTestId("run-button").locator(":visible").first().click();
+ }
+}
+
+export async function runCell(opts: { page: Page; cellSelector: string }) {
+ const { page, cellSelector } = opts;
+
+ // Hover over a cell
+ await page.hover(cellSelector);
+
+ // Run the new cell
+ await page.getByTestId("run-button").locator(":visible").first().click();
+}
diff --git a/frontend/e2e-tests/mode.spec.ts b/frontend/e2e-tests/mode.spec.ts
new file mode 100644
index 0000000000..7f12a24b54
--- /dev/null
+++ b/frontend/e2e-tests/mode.spec.ts
@@ -0,0 +1,51 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { test, expect } from "@playwright/test";
+import { getAppUrl } from "../playwright.config";
+
+test("page renders edit feature in edit mode", async ({ page }) => {
+ const appUrl = getAppUrl("title.py");
+ await page.goto(appUrl);
+
+ // Has elements with class name 'controls'
+ expect(await page.locator("#save-button").count()).toBeGreaterThan(0);
+
+ // Can see output
+ await expect(page.locator("h1").getByText("Hello Marimo!")).toBeVisible();
+});
+
+test("can toggle to read mode", async ({ page }) => {
+ const appUrl = getAppUrl("title.py");
+ await page.goto(appUrl);
+
+ // Can see output and code
+ await expect(page.locator("h1").getByText("Hello Marimo!")).toBeVisible();
+ await expect(page.getByText("# Hello Marimo!")).toBeVisible();
+
+ // Toggle preview-button
+ await page.locator("#preview-button").click();
+
+ // Can see output
+ await expect(page.locator("h1").getByText("Hello Marimo!")).toBeVisible();
+ // No code
+ await expect(page.getByText("# Hello Marimo!")).not.toBeVisible();
+
+ // Toggle preview-button again
+ await page.locator("#preview-button").click();
+
+ // Can see output and code
+ await expect(page.locator("h1").getByText("Hello Marimo!")).toBeVisible();
+ await expect(page.getByText("# Hello Marimo!")).toBeVisible();
+});
+
+test("page renders read only view in read mode", async ({ page }) => {
+ const appUrl = getAppUrl("components.py");
+ await page.goto(appUrl);
+
+ // Filename is not visible
+ await expect(page.getByText("components.py").last()).not.toBeVisible();
+ // Has elements with class name 'controls'
+ expect(await page.locator("#save-button").count()).toBe(0);
+
+ // Can see output
+ await expect(page.locator("h1").getByText("UI Elements")).toBeVisible();
+});
diff --git a/frontend/e2e-tests/py/bad_button.py b/frontend/e2e-tests/py/bad_button.py
new file mode 100644
index 0000000000..38571d8b10
--- /dev/null
+++ b/frontend/e2e-tests/py/bad_button.py
@@ -0,0 +1,27 @@
+import marimo
+
+__generated_with = "0.0.1"
+app = marimo.App()
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+def __(mo):
+ b = mo.ui.button(value=None, label='Bad button', on_click=lambda v: v + 1)
+ b
+ return b,
+
+
+def __(b):
+ b.value
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/frontend/e2e-tests/py/bugs.py b/frontend/e2e-tests/py/bugs.py
new file mode 100644
index 0000000000..a056e10081
--- /dev/null
+++ b/frontend/e2e-tests/py/bugs.py
@@ -0,0 +1,33 @@
+import marimo
+
+__generated_with = "0.0.6"
+app = marimo.App()
+
+
+def __():
+ import marimo as mo
+ mo.md("This is an e2e test to capture bugs encountered that we don't want to show up again.")
+ return mo,
+
+
+def __(mo):
+ bug_1 = mo.ui.number(1, 10)
+ mo.md("bug 1")
+ return bug_1,
+
+def __(bug_1):
+ bug_1
+ return
+
+
+def __(bug_1):
+ bug_1.value
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/frontend/e2e-tests/py/cells.py b/frontend/e2e-tests/py/cells.py
new file mode 100644
index 0000000000..6b1a98d3fe
--- /dev/null
+++ b/frontend/e2e-tests/py/cells.py
@@ -0,0 +1,21 @@
+import marimo
+
+__generated_with = "0.0.5"
+app = marimo.App()
+
+
+def __():
+ import marimo as mo
+ mo.md("# Cell 1")
+ return mo,
+
+
+def __(mo):
+ mo.md("# Cell 2")
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/frontend/e2e-tests/py/components.py b/frontend/e2e-tests/py/components.py
new file mode 100644
index 0000000000..0b2c2ccd55
--- /dev/null
+++ b/frontend/e2e-tests/py/components.py
@@ -0,0 +1,226 @@
+import marimo
+
+__generated_with = "0.0.5"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("""# UI Elements""")
+ return
+
+
+def __(basic_ui_elements, mo):
+ mo.md(
+ f"""### Basic elements
+
+ {basic_ui_elements}
+ """
+ )
+ return
+
+
+def __(basic_ui_elements, construct_element, show_element):
+ selected_element = construct_element(basic_ui_elements.value)
+ show_element(selected_element)
+ return selected_element,
+
+
+def __(selected_element, value):
+ value(selected_element)
+ return
+
+
+def __(composite_elements, mo):
+ mo.md(
+ f"""### Composite elements
+
+ {composite_elements}
+ """
+ )
+ return
+
+
+def __(composite_elements, construct_element, show_element):
+ composite_element = construct_element(composite_elements.value)
+ show_element(composite_element)
+ return composite_element,
+
+
+def __(composite_element, value):
+ value(composite_element)
+ return
+
+
+def __(mo):
+ composite_elements = mo.ui.dropdown(
+ options=dict(sorted({
+ 'array': mo.ui.array,
+ 'batch': mo.ui.batch,
+ 'dictionary': mo.ui.dictionary,
+ 'form': mo.ui.form,
+ 'reused-in-markdown': 'reused-in-markdown',
+ 'reused-in-json': 'reused-in-json',
+ }.items())),
+ )
+ return composite_elements,
+
+
+def __(mo):
+ file_button = lambda: mo.ui.file(kind="button")
+ file_area = lambda: mo.ui.file(kind="area")
+
+ basic_ui_elements = mo.ui.dropdown(
+ options=dict(
+ sorted(
+ {
+ "button": mo.ui.button,
+ "checkbox": mo.ui.checkbox,
+ "date": mo.ui.date,
+ "dropdown": mo.ui.dropdown,
+ "file button": file_button,
+ "file area": file_area,
+ "multiselect": mo.ui.multiselect,
+ "number": mo.ui.number,
+ "radio": mo.ui.radio,
+ "slider": mo.ui.slider,
+ "switch": mo.ui.switch,
+ "table": mo.ui.table,
+ "text": mo.ui.text,
+ "text_area": mo.ui.text_area,
+ }.items()
+ )
+ ),
+ )
+ return basic_ui_elements, file_area, file_button
+
+
+def __(file_area, file_button, mo):
+ def construct_element(value):
+ if value == mo.ui.array:
+ return mo.ui.array([mo.ui.text(), mo.ui.slider(1, 10), mo.ui.date()])
+ elif value == mo.ui.batch:
+ return mo.md(
+ """
+ - Name: {name}
+ - Date: {date}
+ """
+ ).batch(name=mo.ui.text(), date=mo.ui.date())
+ elif value == mo.ui.button:
+ return mo.ui.button(
+ value=0, label="click me", on_click=lambda value: value + 1
+ )
+ elif value == mo.ui.checkbox:
+ return mo.ui.checkbox(label="check me")
+ elif value == mo.ui.date:
+ return mo.ui.date()
+ elif value == mo.ui.dictionary:
+ return mo.ui.dictionary(
+ {
+ "slider": mo.ui.slider(1, 10),
+ "text": mo.ui.text("type something!"),
+ "array": mo.ui.array(
+ [
+ mo.ui.button(value=0, on_click=lambda v: v + 1)
+ for _ in range(3)
+ ],
+ label="buttons",
+ ),
+ }
+ )
+ elif value == 'reused-in-markdown':
+ text = mo.ui.text()
+ number = mo.ui.number(1, 10)
+ return mo.md(f"""
+ Text: {text}
+ Same Text: {text}
+ Number: {number}
+ Same Number: {number}
+ """)
+ elif value == 'reused-in-json':
+ text = mo.ui.text()
+ number = mo.ui.number(1, 10)
+ return mo.as_html([text, number, text, number])
+ elif value == mo.ui.dropdown:
+ return mo.ui.dropdown(["a", "b", "c"])
+ elif value == file_button:
+ return file_button()
+ elif value == file_area:
+ return file_area()
+ elif value == mo.ui.form:
+ return mo.ui.text_area(placeholder="...").form()
+ elif value == mo.ui.multiselect:
+ return mo.ui.multiselect(["a", "b", "c"])
+ elif value == mo.ui.number:
+ return mo.ui.number(start=1, stop=10, step=0.5)
+ elif value == mo.ui.radio:
+ return mo.ui.radio(["a", "b", "c"], value="a")
+ elif value == mo.ui.slider:
+ return mo.ui.slider(start=1, stop=10, step=1)
+ elif value == mo.ui.switch:
+ return mo.ui.switch()
+ elif value == mo.ui.table:
+ return mo.ui.table(
+ data=[
+ {"first_name": "Michael", "last_name": "Scott"},
+ {"first_name": "Dwight", "last_name": "Schrute"},
+ ],
+ label="Employees",
+ )
+ elif value == mo.ui.text:
+ return mo.ui.text()
+ elif value == mo.ui.text_area:
+ return mo.ui.text_area()
+ return None
+ return construct_element,
+
+
+def __(mo):
+ def show_element(element):
+ if element is not None:
+ return mo.hstack([element], "center")
+ return show_element,
+
+
+def __(mo):
+ def value(element):
+ def all_values_are_strings(values):
+ if values is not None and isinstance(values, list):
+ return all(isinstance(v, str) for v in values)
+
+ if element is not None:
+ v = (
+ element.value
+ if not isinstance(element, mo.ui.file)
+ else element.name()
+ )
+ printed_value = (
+ mo.as_html(v) if not all_values_are_strings(v) else ", ".join(v)
+ )
+ return mo.md(
+ f"""
+ The element's current value is {printed_value}
+ """
+ )
+ return value,
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/frontend/e2e-tests/py/shutdown.py b/frontend/e2e-tests/py/shutdown.py
new file mode 100644
index 0000000000..a273d84362
--- /dev/null
+++ b/frontend/e2e-tests/py/shutdown.py
@@ -0,0 +1,14 @@
+import marimo
+
+__generated_with = "0.0.1"
+app = marimo.App()
+
+
+def __():
+ print('123')
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/frontend/e2e-tests/py/streams.py b/frontend/e2e-tests/py/streams.py
new file mode 100644
index 0000000000..fc9fc570c6
--- /dev/null
+++ b/frontend/e2e-tests/py/streams.py
@@ -0,0 +1,27 @@
+import marimo
+
+__generated_with = "0.0.1"
+app = marimo.App()
+
+
+def __():
+ import os
+ return os,
+
+
+def __():
+ print('Hello, python!')
+ return
+
+
+def __(os):
+ os.system('echo Hello, stdout!')
+ os.system('echo Hello, stderr! 1>&2')
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/frontend/e2e-tests/py/title.py b/frontend/e2e-tests/py/title.py
new file mode 100644
index 0000000000..6b038e93da
--- /dev/null
+++ b/frontend/e2e-tests/py/title.py
@@ -0,0 +1,15 @@
+import marimo
+
+__generated_with = "0.0.1"
+app = marimo.App()
+
+
+def __():
+ import marimo as mo
+ mo.md("# Hello Marimo!")
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/frontend/e2e-tests/shutdown.spec.ts b/frontend/e2e-tests/shutdown.spec.ts
new file mode 100644
index 0000000000..e967a295e4
--- /dev/null
+++ b/frontend/e2e-tests/shutdown.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { test, expect } from "@playwright/test";
+import { getAppUrl } from "../playwright.config";
+
+test("shutdown shows disconnected text", async ({ page }) => {
+ const appUrl = getAppUrl("shutdown.py");
+ await page.goto(appUrl);
+ await page.getByRole("button", { name: "Shutdown" }).click();
+ // TODO(akshayka): there's some kind of timing bug; just wait
+ // a small amount of time for now as a hack
+ await new Promise((resolve) => setTimeout(resolve, 100));
+ // confirm shutdown on modal
+ await page.getByRole("button", { name: "Confirm Shutdown" }).click();
+
+ // kernel disconnected message to be on the page
+ await expect(page.getByText("kernel not found")).toBeVisible();
+
+ // when no unsaved changes, recovery modal should not be shown
+ await page.getByRole("button", { name: "Save" }).click();
+ await expect(page.getByText("Download unsaved changes?")).toHaveCount(0);
+
+ // when changes are made, recovery modal should be shown
+ await page
+ .getByRole("textbox")
+ .filter({ hasText: "print('123')" })
+ .type("1234");
+ await page.getByRole("button", { name: "Save" }).click();
+ await expect(page.getByText("Download unsaved changes?")).toHaveCount(1);
+});
diff --git a/frontend/e2e-tests/streams.spec.ts b/frontend/e2e-tests/streams.spec.ts
new file mode 100644
index 0000000000..01af3e5982
--- /dev/null
+++ b/frontend/e2e-tests/streams.spec.ts
@@ -0,0 +1,18 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { test, expect } from "@playwright/test";
+import { getAppUrl } from "../playwright.config";
+
+const appUrl = getAppUrl("streams.py");
+
+test("stdout, stderr redirected to browser", async ({ page }) => {
+ await page.goto(appUrl);
+
+ await expect(page).toHaveTitle("streams");
+ expect(page.getByText("streams.py")).toBeTruthy();
+
+ // text printed using Python to be in the document.
+ await expect(page.getByText(/^Hello, python!/)).toBeVisible();
+ // text echoed to stdout, stderr to be in the document.
+ await expect(page.getByText(/^Hello, stdout!/)).toBeVisible();
+ await expect(page.getByText(/^Hello, stderr!/)).toBeVisible();
+});
diff --git a/frontend/e2e-tests/title.spec.ts b/frontend/e2e-tests/title.spec.ts
new file mode 100644
index 0000000000..5d95788039
--- /dev/null
+++ b/frontend/e2e-tests/title.spec.ts
@@ -0,0 +1,15 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { test, expect } from "@playwright/test";
+import { getAppUrl } from "../playwright.config";
+
+const appUrl = getAppUrl("title.py");
+
+test("can open url and see filename", async ({ page }) => {
+ await page.goto(appUrl);
+
+ // Expect a title equal to the file name.
+ await expect(page).toHaveTitle("title");
+
+ // 'title.py' to be in the document.
+ expect(await page.getByText("title.py").count()).toBeGreaterThan(0);
+});
diff --git a/frontend/index.html b/frontend/index.html
new file mode 100644
index 0000000000..5ac407bace
--- /dev/null
+++ b/frontend/index.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <link rel="icon" href="/favicon.ico" />
+ <link rel="preload" href="/gradient.png" as="image" />
+ <link rel="preload" href="/noise.png" as="image" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <meta name="theme-color" content="#000000" />
+ <meta name="description" content="a marimo app" />
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
+ <link rel="manifest" href="/manifest.json" />
+
+ <script>
+ function __resizeIframe(obj) {
+ obj.style.height =
+ obj.contentWindow.document.documentElement.scrollHeight + "px";
+ }
+ </script>
+ <marimo-filename hidden>{{ filename }}</marimo-filename>
+ <marimo-mode data-mode={{ mode }} hidden></marimo-mode>
+ <marimo-config data-config='{{ config }}' hidden></marimo-config>
+ <title>{{ title }}</title>
+ </head>
+ <body>
+ <noscript>You need to enable JavaScript to run this app.</noscript>
+ <div id="root"></div>
+ <script type="module" src="/src/main.tsx"></script>
+ </body>
+</html>
diff --git a/frontend/package.json b/frontend/package.json
new file mode 100644
index 0000000000..be9b194d5a
--- /dev/null
+++ b/frontend/package.json
@@ -0,0 +1,152 @@
+{
+ "name": "@marimo-team/app",
+ "version": "0.1.15",
+ "main": "lib/marimo.js",
+ "types": "lib/index.d.ts",
+ "sideEffects": [
+ "*.css",
+ "*.css.ts"
+ ],
+ "files": [
+ "lib"
+ ],
+ "dependencies": {
+ "@codemirror/autocomplete": "^6.9.0",
+ "@codemirror/commands": "^6.2.4",
+ "@codemirror/lang-python": "^6.1.3",
+ "@codemirror/language": "^6.8.0",
+ "@codemirror/lint": "^6.4.0",
+ "@codemirror/search": "^6.5.1",
+ "@codemirror/state": "^6.2.1",
+ "@codemirror/theme-one-dark": "^6.1.2",
+ "@codemirror/view": "^6.16.0",
+ "@dnd-kit/core": "^6.0.8",
+ "@dnd-kit/modifiers": "^6.0.1",
+ "@dnd-kit/sortable": "^7.0.2",
+ "@dnd-kit/utilities": "^3.2.1",
+ "@emotion/cache": "^11.11.0",
+ "@emotion/react": "^11.11.1",
+ "@hookform/resolvers": "^3.2.0",
+ "@lezer/common": "^1.0.3",
+ "@lezer/highlight": "^1.1.6",
+ "@lezer/lr": "^1.3.9",
+ "@radix-ui/colors": "^2.0.1",
+ "@radix-ui/react-accordion": "^1.1.2",
+ "@radix-ui/react-alert-dialog": "^1.0.4",
+ "@radix-ui/react-checkbox": "^1.0.4",
+ "@radix-ui/react-dialog": "^1.0.4",
+ "@radix-ui/react-dropdown-menu": "^2.0.5",
+ "@radix-ui/react-icons": "^1.3.0",
+ "@radix-ui/react-label": "^2.0.2",
+ "@radix-ui/react-popover": "^1.0.6",
+ "@radix-ui/react-radio-group": "^1.1.3",
+ "@radix-ui/react-select": "^1.2.2",
+ "@radix-ui/react-slider": "^1.1.2",
+ "@radix-ui/react-slot": "^1.0.2",
+ "@radix-ui/react-switch": "^1.0.3",
+ "@radix-ui/react-tabs": "^1.0.4",
+ "@radix-ui/react-toast": "^1.1.4",
+ "@radix-ui/react-tooltip": "^1.0.6",
+ "@radix-ui/react-use-controllable-state": "^1.0.1",
+ "@storybook/addon-styling": "^1.3.6",
+ "@tanstack/react-table": "^8.9.3",
+ "@textea/json-viewer": "^3.1.1",
+ "class-variance-authority": "^0.7.0",
+ "clsx": "^1.2.1",
+ "cmdk": "^0.2.0",
+ "codemirror": "^6.0.1",
+ "cssnano": "^6.0.1",
+ "date-fns": "^2.30.0",
+ "eslint-plugin-header": "^3.1.1",
+ "htm": "^3.1.1",
+ "html-react-parser": "^4.2.0",
+ "jotai": "^2.3.1",
+ "katex": "^0.16.8",
+ "lucide-react": "^0.265.0",
+ "partysocket": "0.0.0-fffe721",
+ "react-day-picker": "^8.8.0",
+ "react-dropzone": "^14.2.3",
+ "react-error-boundary": "^4.0.10",
+ "react-hook-form": "^7.45.4",
+ "react-use-event-hook": "^0.9.6",
+ "tailwind-merge": "^1.14.0",
+ "tailwindcss-animate": "^1.0.6",
+ "web-vitals": "^3.4.0",
+ "zod": "^3.21.4"
+ },
+ "scripts": {
+ "preinstall": "npx only-allow pnpm",
+ "ci": "run-s lint typecheck test build",
+ "start": "vite",
+ "dev": "vite",
+ "dev:msw": "VITE_MSW=true vite",
+ "build:watch": "vite build --watch --outDir ../marimo/_static",
+ "build": "vite build",
+ "build:library": "vite build -c vite.lib.config.ts && tsc --declaration --emitDeclarationOnly --declarationDir lib",
+ "test": "vitest",
+ "typecheck": "tsc --noEmit",
+ "lint": "run-s lint:eslint lint:stylelint lint:prettier",
+ "lint:eslint": "TIMING=1 eslint src e2e-tests --max-warnings=0",
+ "lint:prettier": "prettier --check src/ e2e-tests/",
+ "lint:stylelint": "stylelint src/**/*.css",
+ "lint:fix": "run-s lint:eslint:fix lint:stylelint:fix lint:prettier:fix",
+ "lint:eslint:fix": "pnpm run lint:eslint --fix",
+ "lint:stylelint:fix": "pnpm run lint:stylelint --fix",
+ "lint:prettier:fix": "prettier --write src/ e2e-tests/",
+ "format": "prettier --write src/ e2e-tests/",
+ "preview": "vite preview",
+ "storybook": "storybook dev -p 6006",
+ "build-storybook": "storybook build"
+ },
+ "peerDependencies": {
+ "react": "^17 || ^18",
+ "react-dom": "^17 || ^18"
+ },
+ "devDependencies": {
+ "@playwright/test": "^1.36.2",
+ "@storybook/addon-docs": "^7.2.3",
+ "@storybook/addon-essentials": "^7.2.3",
+ "@storybook/addon-interactions": "^7.2.3",
+ "@storybook/addon-links": "^7.2.3",
+ "@storybook/blocks": "^7.2.3",
+ "@storybook/react": "^7.2.3",
+ "@storybook/react-vite": "^7.2.3",
+ "@storybook/testing-library": "^0.2.0",
+ "@testing-library/jest-dom": "^5.17.0",
+ "@testing-library/react": "^14.0.0",
+ "@testing-library/user-event": "^14.4.3",
+ "@types/katex": "^0.16.2",
+ "@types/react": "^18.2.19",
+ "@types/react-dom": "^18.2.7",
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
+ "@typescript-eslint/parser": "^5.62.0",
+ "@vitejs/plugin-react-swc": "^3.3.2",
+ "autoprefixer": "^10.4.14",
+ "eslint": "^8.46.0",
+ "eslint-config-prettier": "^8.10.0",
+ "eslint-config-react-app": "^7.0.1",
+ "eslint-plugin-ssr-friendly": "^1.2.0",
+ "eslint-plugin-storybook": "^0.6.13",
+ "eslint-plugin-unicorn": "^47.0.0",
+ "jsdom": "^22.1.0",
+ "mock-socket": "^9.2.1",
+ "msw": "^1.2.3",
+ "npm-run-all": "^4.1.5",
+ "postcss": "^8.4.27",
+ "prettier": "^2.8.8",
+ "prop-types": "^15.8.1",
+ "react": "^18.2.0",
+ "react-dom": "^18.2.0",
+ "storybook": "^7.2.3",
+ "stylelint": "^15.10.2",
+ "stylelint-config-standard": "^34.0.0",
+ "tailwindcss": "^3.3.3",
+ "typescript": "^5.1.6",
+ "vite": "^4.4.9",
+ "vite-tsconfig-paths": "^4.2.0",
+ "vitest": "^0.34.1"
+ },
+ "msw": {
+ "workerDirectory": "public"
+ }
+}
diff --git a/frontend/playwright.config.ts b/frontend/playwright.config.ts
new file mode 100644
index 0000000000..0ce0e049f4
--- /dev/null
+++ b/frontend/playwright.config.ts
@@ -0,0 +1,100 @@
+import type { PlaywrightTestConfig } from "@playwright/test";
+import { devices } from "@playwright/test";
+import path from "node:path";
+
+export interface ServerOptions {
+ command: "edit" | "run";
+ port: number;
+}
+
+// Read environment variables from file. See https://github.com/motdotla/dotenv
+// require('dotenv').config();
+
+// Location of python files needed for testing
+const pydir = path.join("e2e-tests", "py");
+
+// Mapping from Python app name to { browserName => port } object.
+//
+// Each app is served by a different server.
+let _port = 2718;
+function port(): number {
+ return _port++;
+}
+
+const appToOptions = {
+ "title.py": { port: port(), command: "edit" },
+ "streams.py": { port: port(), command: "edit" },
+ "bad_button.py": { port: port(), command: "edit" },
+ "shutdown.py": { port: port(), command: "edit" },
+ "components.py": { port: port(), command: "run" },
+ "cells.py": { port: port(), command: "edit" },
+ "bugs.py": { port: port(), command: "edit" },
+} satisfies Record<string, ServerOptions>;
+
+export type ApplicationNames = keyof typeof appToOptions;
+
+function getUrl(port: number): string {
+ return `http://127.0.0.1:${port}`;
+}
+
+// For tests to lookup their url/server
+export function getAppUrl(app: ApplicationNames): string {
+ return getUrl(appToOptions[app].port);
+}
+
+// See https://playwright.dev/docs/test-configuration.
+const config: PlaywrightTestConfig = {
+ testDir: "./e2e-tests",
+ // Maximum time one test can run for
+ timeout: 30 * 1000,
+ expect: {
+ // Maximum time expect() should wait for the condition to be met.
+ // For example in `await expect(locator).toHaveText();`
+ timeout: 5000,
+ },
+ // Run tests in files in parallel
+ fullyParallel: false,
+ // Fail the build on CI if you accidentally left test.only in the source
+ forbidOnly: !!process.env.CI,
+ // Retry on CI only
+ retries: process.env.CI ? 2 : 0,
+ // Opt out of parallel tests until marimo server can support multiple edit
+ // connections.
+ workers: 1,
+ // Reporter to use. See https://playwright.dev/docs/test-reporters
+ reporter: "html",
+ // Suppress tests stdout/stderr.
+ quiet: true,
+ // Shared settings for all the projects below. See
+ // https://playwright.dev/docs/api/class-testoptions.
+ use: {
+ // Max time each action (eg `click()`) can take. Defaults to 0 (no limit).
+ actionTimeout: 0,
+ // Collect trace when retrying the failed test. See
+ // https://playwright.dev/docs/trace-viewer
+ trace: "on-first-retry",
+ },
+
+ // TODO(akshayka): Consider testing on firefox, safari
+ projects: [
+ {
+ name: "chromium",
+ use: {
+ ...devices["Desktop Chrome"],
+ },
+ },
+ ],
+
+ // Run marimo servers before starting the tests, one for each app/test
+ webServer: Object.entries(appToOptions).map(([app, options]) => {
+ return {
+ command: `marimo -q ${options.command} ${path.join(pydir, app)} -p ${
+ options.port
+ } --headless`,
+ url: getUrl(options.port),
+ reuseExistingServer: false,
+ };
+ }),
+};
+
+export default config;
diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml
new file mode 100644
index 0000000000..ea714ba8b2
--- /dev/null
+++ b/frontend/pnpm-lock.yaml
@@ -0,0 +1,13716 @@
+lockfileVersion: '6.0'
+
+settings:
+ autoInstallPeers: true
+ excludeLinksFromLockfile: false
+
+dependencies:
+ '@codemirror/autocomplete':
+ specifier: ^6.9.0
+ version: 6.9.0(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected])
+ '@codemirror/commands':
+ specifier: ^6.2.4
+ version: 6.2.4
+ '@codemirror/lang-python':
+ specifier: ^6.1.3
+ version: 6.1.3(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected])
+ '@codemirror/language':
+ specifier: ^6.8.0
+ version: 6.8.0
+ '@codemirror/lint':
+ specifier: ^6.4.0
+ version: 6.4.0
+ '@codemirror/search':
+ specifier: ^6.5.1
+ version: 6.5.1
+ '@codemirror/state':
+ specifier: ^6.2.1
+ version: 6.2.1
+ '@codemirror/theme-one-dark':
+ specifier: ^6.1.2
+ version: 6.1.2
+ '@codemirror/view':
+ specifier: ^6.16.0
+ version: 6.16.0
+ '@dnd-kit/core':
+ specifier: ^6.0.8
+ '@dnd-kit/modifiers':
+ specifier: ^6.0.1
+ version: 6.0.1(@dnd-kit/[email protected])([email protected])
+ '@dnd-kit/sortable':
+ specifier: ^7.0.2
+ version: 7.0.2(@dnd-kit/[email protected])([email protected])
+ '@dnd-kit/utilities':
+ specifier: ^3.2.1
+ version: 3.2.1([email protected])
+ '@emotion/cache':
+ specifier: ^11.11.0
+ version: 11.11.0
+ '@emotion/react':
+ specifier: ^11.11.1
+ version: 11.11.1(@types/[email protected])([email protected])
+ '@hookform/resolvers':
+ specifier: ^3.2.0
+ version: 3.2.0([email protected])
+ '@lezer/common':
+ specifier: ^1.0.3
+ version: 1.0.3
+ '@lezer/highlight':
+ specifier: ^1.1.6
+ version: 1.1.6
+ '@lezer/lr':
+ specifier: ^1.3.9
+ version: 1.3.9
+ '@radix-ui/colors':
+ specifier: ^2.0.1
+ version: 2.0.1
+ '@radix-ui/react-accordion':
+ specifier: ^1.1.2
+ '@radix-ui/react-alert-dialog':
+ specifier: ^1.0.4
+ '@radix-ui/react-checkbox':
+ specifier: ^1.0.4
+ '@radix-ui/react-dialog':
+ specifier: ^1.0.4
+ '@radix-ui/react-dropdown-menu':
+ specifier: ^2.0.5
+ '@radix-ui/react-icons':
+ specifier: ^1.3.0
+ version: 1.3.0([email protected])
+ '@radix-ui/react-label':
+ specifier: ^2.0.2
+ '@radix-ui/react-popover':
+ specifier: ^1.0.6
+ '@radix-ui/react-radio-group':
+ specifier: ^1.1.3
+ '@radix-ui/react-select':
+ specifier: ^1.2.2
+ '@radix-ui/react-slider':
+ specifier: ^1.1.2
+ '@radix-ui/react-slot':
+ specifier: ^1.0.2
+ version: 1.0.2(@types/[email protected])([email protected])
+ '@radix-ui/react-switch':
+ specifier: ^1.0.3
+ '@radix-ui/react-tabs':
+ specifier: ^1.0.4
+ '@radix-ui/react-toast':
+ specifier: ^1.1.4
+ '@radix-ui/react-tooltip':
+ specifier: ^1.0.6
+ '@radix-ui/react-use-controllable-state':
+ specifier: ^1.0.1
+ version: 1.0.1(@types/[email protected])([email protected])
+ '@storybook/addon-styling':
+ specifier: ^1.3.6
+ '@tanstack/react-table':
+ specifier: ^8.9.3
+ '@textea/json-viewer':
+ specifier: ^3.1.1
+ class-variance-authority:
+ specifier: ^0.7.0
+ version: 0.7.0
+ clsx:
+ specifier: ^1.2.1
+ version: 1.2.1
+ cmdk:
+ specifier: ^0.2.0
+ codemirror:
+ specifier: ^6.0.1
+ version: 6.0.1(@lezer/[email protected])
+ cssnano:
+ specifier: ^6.0.1
+ version: 6.0.1([email protected])
+ date-fns:
+ specifier: ^2.30.0
+ version: 2.30.0
+ eslint-plugin-header:
+ specifier: ^3.1.1
+ version: 3.1.1([email protected])
+ htm:
+ specifier: ^3.1.1
+ version: 3.1.1
+ html-react-parser:
+ specifier: ^4.2.0
+ version: 4.2.0([email protected])
+ jotai:
+ specifier: ^2.3.1
+ version: 2.3.1(@types/[email protected])([email protected])
+ katex:
+ specifier: ^0.16.8
+ version: 0.16.8
+ lucide-react:
+ specifier: ^0.265.0
+ version: 0.265.0([email protected])
+ partysocket:
+ specifier: 0.0.0-fffe721
+ version: 0.0.0-fffe721
+ react-day-picker:
+ specifier: ^8.8.0
+ react-dropzone:
+ specifier: ^14.2.3
+ version: 14.2.3([email protected])
+ react-error-boundary:
+ specifier: ^4.0.10
+ version: 4.0.10([email protected])
+ react-hook-form:
+ specifier: ^7.45.4
+ version: 7.45.4([email protected])
+ react-use-event-hook:
+ specifier: ^0.9.6
+ version: 0.9.6([email protected])
+ tailwind-merge:
+ specifier: ^1.14.0
+ version: 1.14.0
+ tailwindcss-animate:
+ specifier: ^1.0.6
+ version: 1.0.6([email protected])
+ web-vitals:
+ specifier: ^3.4.0
+ version: 3.4.0
+ zod:
+ specifier: ^3.21.4
+ version: 3.21.4
+
+devDependencies:
+ '@playwright/test':
+ specifier: ^1.36.2
+ version: 1.36.2
+ '@storybook/addon-docs':
+ specifier: ^7.2.3
+ '@storybook/addon-essentials':
+ specifier: ^7.2.3
+ '@storybook/addon-interactions':
+ specifier: ^7.2.3
+ '@storybook/addon-links':
+ specifier: ^7.2.3
+ '@storybook/blocks':
+ specifier: ^7.2.3
+ '@storybook/react':
+ specifier: ^7.2.3
+ '@storybook/react-vite':
+ specifier: ^7.2.3
+ '@storybook/testing-library':
+ specifier: ^0.2.0
+ version: 0.2.0
+ '@testing-library/jest-dom':
+ specifier: ^5.17.0
+ version: 5.17.0
+ '@testing-library/react':
+ specifier: ^14.0.0
+ '@testing-library/user-event':
+ specifier: ^14.4.3
+ version: 14.4.3(@testing-library/[email protected])
+ '@types/katex':
+ specifier: ^0.16.2
+ version: 0.16.2
+ '@types/react':
+ specifier: ^18.2.19
+ version: 18.2.19
+ '@types/react-dom':
+ specifier: ^18.2.7
+ version: 18.2.7
+ '@typescript-eslint/eslint-plugin':
+ specifier: ^5.62.0
+ version: 5.62.0(@typescript-eslint/[email protected])([email protected])([email protected])
+ '@typescript-eslint/parser':
+ specifier: ^5.62.0
+ '@vitejs/plugin-react-swc':
+ specifier: ^3.3.2
+ version: 3.3.2([email protected])
+ autoprefixer:
+ specifier: ^10.4.14
+ version: 10.4.14([email protected])
+ eslint:
+ specifier: ^8.46.0
+ version: 8.46.0
+ eslint-config-prettier:
+ specifier: ^8.10.0
+ version: 8.10.0([email protected])
+ eslint-config-react-app:
+ specifier: ^7.0.1
+ eslint-plugin-ssr-friendly:
+ specifier: ^1.2.0
+ version: 1.2.0([email protected])
+ eslint-plugin-storybook:
+ specifier: ^0.6.13
+ eslint-plugin-unicorn:
+ specifier: ^47.0.0
+ version: 47.0.0([email protected])
+ jsdom:
+ specifier: ^22.1.0
+ version: 22.1.0
+ mock-socket:
+ specifier: ^9.2.1
+ version: 9.2.1
+ msw:
+ specifier: ^1.2.3
+ version: 1.2.3([email protected])
+ npm-run-all:
+ specifier: ^4.1.5
+ version: 4.1.5
+ postcss:
+ specifier: ^8.4.27
+ version: 8.4.27
+ prettier:
+ specifier: ^2.8.8
+ version: 2.8.8
+ prop-types:
+ specifier: ^15.8.1
+ version: 15.8.1
+ react:
+ specifier: ^18.2.0
+ version: 18.2.0
+ react-dom:
+ specifier: ^18.2.0
+ version: 18.2.0([email protected])
+ storybook:
+ specifier: ^7.2.3
+ version: 7.2.3
+ stylelint:
+ specifier: ^15.10.2
+ version: 15.10.2
+ stylelint-config-standard:
+ specifier: ^34.0.0
+ version: 34.0.0([email protected])
+ tailwindcss:
+ specifier: ^3.3.3
+ version: 3.3.3
+ typescript:
+ specifier: ^5.1.6
+ version: 5.1.6
+ vite:
+ specifier: ^4.4.9
+ version: 4.4.9(@types/[email protected])([email protected])
+ vite-tsconfig-paths:
+ specifier: ^4.2.0
+ vitest:
+ specifier: ^0.34.1
+
+packages:
+
+ /@aashutoshrathi/[email protected]:
+ resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-E09FiIft46CmH5Qnjb0wsW54/YQd69LsxeKUOWawmws1XWvyFGURnAChH0mlr7YPFR1ofwvUQfcL0J3lMxXqPA==}
+ dev: true
+
+ resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==}
+ engines: {node: '>=10'}
+
+ /@ampproject/[email protected]:
+ resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==}
+ engines: {node: '>=6.0.0'}
+ dependencies:
+ '@jridgewell/gen-mapping': 0.3.3
+ '@jridgewell/trace-mapping': 0.3.18
+ dev: true
+
+ /@aw-web-design/[email protected]:
+ resolution: {integrity: sha512-Xk1sIhyNC/esHGGVjL/niHLowM0csl/kFO5uawBy4IrWwy0o1G8LGt3jP6nmWGz+USxeeqbihAmp/oVZju6wug==}
+ hasBin: true
+ dependencies:
+ default-browser-id: 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/highlight': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/highlight': 7.22.5
+
+ resolution: {integrity: sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==}
+ engines: {node: '>=6.9.0'}
+ dev: true
+
+ resolution: {integrity: sha512-YeM22Sondbo523Sz0+CirSPnbj9bG3P0CdHcBZdqUuaeOaYEFbOLoGU7lebvGP6P5J/WE9wOn7u7C4J9HvS1xQ==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@ampproject/remapping': 2.2.1
+ '@babel/code-frame': 7.22.5
+ '@babel/generator': 7.22.9
+ '@babel/helper-compilation-targets': 7.22.9(@babel/[email protected])
+ '@babel/helper-module-transforms': 7.22.9(@babel/[email protected])
+ '@babel/helpers': 7.22.6
+ '@babel/parser': 7.22.7
+ '@babel/template': 7.22.5
+ '@babel/traverse': 7.22.8
+ '@babel/types': 7.22.5
+ convert-source-map: 1.8.0
+ debug: 4.3.4
+ gensync: 1.0.0-beta.2
+ json5: 2.2.3
+ semver: 6.3.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-G2EgeufBcYw27U4hhoIwFcgc1XU7TlXJ3mv04oOv1WCuo900U/anZSPzEqNjwdjgffkk2Gs0AN0dW1CKVLcG7w==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@ampproject/remapping': 2.2.1
+ '@babel/code-frame': 7.22.5
+ '@babel/generator': 7.22.9
+ '@babel/helper-compilation-targets': 7.22.9(@babel/[email protected])
+ '@babel/helper-module-transforms': 7.22.9(@babel/[email protected])
+ '@babel/helpers': 7.22.6
+ '@babel/parser': 7.22.7
+ '@babel/template': 7.22.5
+ '@babel/traverse': 7.22.8
+ '@babel/types': 7.22.5
+ convert-source-map: 1.8.0
+ debug: 4.3.4
+ gensync: 1.0.0-beta.2
+ json5: 2.2.3
+ semver: 6.3.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-oFQYkE8SuH14+uR51JVAmdqwKYXGRjEXx7s+WiagVjqQ+HPE+nnwyF2qlVG8evUsUHmPcA+6YXMEDbIhEyQc5A==}
+ engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0}
+ peerDependencies:
+ '@babel/core': '>=7.11.0'
+ eslint: ^7.5.0 || ^8.0.0
+ dependencies:
+ '@babel/core': 7.21.8
+ eslint: 8.46.0
+ eslint-scope: 5.1.1
+ eslint-visitor-keys: 2.1.0
+ semver: 6.3.1
+ dev: true
+
+ resolution: {integrity: sha512-KtLMbmicyuK2Ak/FTCJVbDnkN1SlT8/kceFTiuDiiRUUSMnHMidxSCdG4ndkTOHHpoomWe/4xkvHkEOncwjYIw==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/types': 7.22.5
+ '@jridgewell/gen-mapping': 0.3.3
+ '@jridgewell/trace-mapping': 0.3.18
+ jsesc: 2.5.2
+ dev: true
+
+ resolution: {integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/types': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-m1EP3lVOPptR+2DwD125gziZNcmoNSHGmJROKoy87loWUQyJaVXDgpmruWqDARZSmtYQ+Dl25okU8+qhVzuykw==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/types': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-7qYrNM6HjpnPHJbopxmb8hSPoZ0gsX8IvUS32JGVoy+pU9e5N0nLr1VjJoR6kA4d9dmGLxNYOjeB8sUDal2WMw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+ dependencies:
+ '@babel/compat-data': 7.22.9
+ '@babel/core': 7.21.8
+ '@babel/helper-validator-option': 7.22.5
+ browserslist: 4.21.9
+ lru-cache: 5.1.1
+ semver: 6.3.1
+ dev: true
+
+ resolution: {integrity: sha512-7qYrNM6HjpnPHJbopxmb8hSPoZ0gsX8IvUS32JGVoy+pU9e5N0nLr1VjJoR6kA4d9dmGLxNYOjeB8sUDal2WMw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+ dependencies:
+ '@babel/compat-data': 7.22.9
+ '@babel/core': 7.22.9
+ '@babel/helper-validator-option': 7.22.5
+ browserslist: 4.21.9
+ lru-cache: 5.1.1
+ semver: 6.3.1
+ dev: true
+
+ resolution: {integrity: sha512-Pwyi89uO4YrGKxL/eNJ8lfEH55DnRloGPOseaA8NFNL6jAUnn+KccaISiFazCj5IolPPDjGSdzQzXVzODVRqUQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-annotate-as-pure': 7.22.5
+ '@babel/helper-environment-visitor': 7.22.5
+ '@babel/helper-function-name': 7.22.5
+ '@babel/helper-member-expression-to-functions': 7.22.5
+ '@babel/helper-optimise-call-expression': 7.22.5
+ '@babel/helper-replace-supers': 7.22.9(@babel/[email protected])
+ '@babel/helper-skip-transparent-expression-wrappers': 7.22.5
+ '@babel/helper-split-export-declaration': 7.22.6
+ semver: 6.3.1
+ dev: true
+
+ resolution: {integrity: sha512-+svjVa/tFwsNSG4NEy1h85+HQ5imbT92Q5/bgtS7P0GTQlP8WuFdqsiABmQouhiFGyV66oGxZFpeYHza1rNsKw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-annotate-as-pure': 7.22.5
+ regexpu-core: 5.3.2
+ semver: 6.3.1
+ dev: true
+
+ resolution: {integrity: sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww==}
+ peerDependencies:
+ '@babel/core': ^7.4.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-compilation-targets': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ debug: 4.3.4
+ lodash.debounce: 4.0.8
+ resolve: 1.22.2
+ semver: 6.3.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-k0qnnOqHn5dK9pZpfD5XXZ9SojAITdCKRn2Lp6rnDGzIbaP0rHyMPk/4wsSxVBVz4RfN0q6VpXWP2pDGIoQ7hw==}
+ peerDependencies:
+ '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-compilation-targets': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ debug: 4.3.4
+ lodash.debounce: 4.0.8
+ resolve: 1.22.2
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==}
+ engines: {node: '>=6.9.0'}
+ dev: true
+
+ resolution: {integrity: sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/template': 7.22.5
+ '@babel/types': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/types': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/types': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/types': 7.22.5
+ dev: false
+
+ resolution: {integrity: sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/types': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+ dependencies:
+ '@babel/core': 7.21.8
+ '@babel/helper-environment-visitor': 7.22.5
+ '@babel/helper-module-imports': 7.22.5
+ '@babel/helper-simple-access': 7.22.5
+ '@babel/helper-split-export-declaration': 7.22.6
+ '@babel/helper-validator-identifier': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-environment-visitor': 7.22.5
+ '@babel/helper-module-imports': 7.22.5
+ '@babel/helper-simple-access': 7.22.5
+ '@babel/helper-split-export-declaration': 7.22.6
+ '@babel/helper-validator-identifier': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/types': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==}
+ engines: {node: '>=6.9.0'}
+ dev: true
+
+ resolution: {integrity: sha512-8WWC4oR4Px+tr+Fp0X3RHDVfINGpF3ad1HIbrc8A77epiR6eMMc6jsgozkzT2uDiOOdoS9cLIQ+XD2XvI2WSmQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-annotate-as-pure': 7.22.5
+ '@babel/helper-environment-visitor': 7.22.5
+ '@babel/helper-wrap-function': 7.22.9
+ dev: true
+
+ resolution: {integrity: sha512-LJIKvvpgPOPUThdYqcX6IXRuIcTkcAub0IaDRGCZH0p5GPUp7PhRU9QVgFcDDd51BaPkk77ZjqFwh6DZTAEmGg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-environment-visitor': 7.22.5
+ '@babel/helper-member-expression-to-functions': 7.22.5
+ '@babel/helper-optimise-call-expression': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/types': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/types': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/types': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==}
+ engines: {node: '>=6.9.0'}
+
+ resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==}
+ engines: {node: '>=6.9.0'}
+ dev: true
+
+ resolution: {integrity: sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==}
+ engines: {node: '>=6.9.0'}
+
+ resolution: {integrity: sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==}
+ engines: {node: '>=6.9.0'}
+ dev: true
+
+ resolution: {integrity: sha512-sZ+QzfauuUEfxSEjKFmi3qDSHgLsTPK/pEpoD/qonZKOtTPTLbf59oabPQ4rKekt9lFcj/hTZaOhWwFYrgjk+Q==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/helper-function-name': 7.22.5
+ '@babel/template': 7.22.5
+ '@babel/types': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-YjDs6y/fVOYFV8hAf1rxd1QvR9wJe1pDBZ2AREKq/SDayfPzgk0PBnVuTCE5X1acEpMMNOVUqoe+OwiZGJ+OaA==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/template': 7.22.5
+ '@babel/traverse': 7.22.8
+ '@babel/types': 7.22.5
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/helper-validator-identifier': 7.22.5
+ chalk: 2.4.2
+ js-tokens: 4.0.0
+
+ resolution: {integrity: sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==}
+ engines: {node: '>=6.0.0'}
+ hasBin: true
+ dependencies:
+ '@babel/types': 7.22.5
+
+ /@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.22.5(@babel/[email protected]):
+ resolution: {integrity: sha512-NP1M5Rf+u2Gw9qfSO4ihjcTGW5zXTi36ITLd4/EoAcEhIZ0yjMqmftDNl3QC19CX7olhrjpyU454g/2W7X0jvQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-31Bb65aZaUwqCbWMnZPduIZxCBngHFlzyN6Dq6KAJjtx+lx6ohKHubc61OomYi7XwVD4Ol0XCVz4h+pYFR048g==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.13.0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/helper-skip-transparent-expression-wrappers': 7.22.5
+ '@babel/plugin-transform-optional-chaining': 7.22.6(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-create-class-features-plugin': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-kbDISufFOxeczi0v4NQP3p5kIeW6izn/6klfWBrIIdGZZe4UpHR+QU03FAoWjGGd9SUXAwbw2pup1kaL4OQsJQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-create-class-features-plugin': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/helper-replace-supers': 7.22.9(@babel/[email protected])
+ '@babel/helper-split-export-declaration': 7.22.6
+ '@babel/plugin-syntax-decorators': 7.17.12(@babel/[email protected])
+ charcodes: 0.2.0
+ dev: true
+
+ resolution: {integrity: sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/helper-skip-transparent-expression-wrappers': 7.22.5
+ '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-create-class-features-plugin': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-ha4zfehbJjc5MmXBlHec1igel5TJXXLDDRbuJ4+XT2TJcyD9/V1919BA8gMvsdHcNMBy4WBUBiRb3nw/EQUtBw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-annotate-as-pure': 7.22.5
+ '@babel/helper-create-class-features-plugin': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/[email protected])
+ dev: true
+
+ /@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/[email protected]):
+ resolution: {integrity: sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ dev: true
+
+ resolution: {integrity: sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==}
+ engines: {node: '>=4'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-create-regexp-features-plugin': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-D1Hz0qtGTza8K2xGyEdVNCYLdVHukAcbQr4K3/s6r/esadyEriZovpJimQOpu8ju4/jV8dW/1xdaE0UpDroidw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-9RdCl0i+q0QExayk2nOS7853w08yLucnnPML6EN9S8fgMPVtdLDCdx/cOQ/i44Lb9UeQX9A35yaqBBOMMZxPxQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-KwvoWDeNKPETmozyFE0P2rOLqh39EoQHNjqizrI5B8Vt0ZNS7M56s7dAiAqbYfiAYOuIzIh96z3iR2ktgu3tEg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-5hewiLct5OKyh6PLKEYaFclcqtIgCb6bmELouxjF6up5q3Sov7rOayW4RwhbaBL0dit8rA80GNfY+UuDp2mBbQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-create-regexp-features-plugin': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-7HmE7pk/Fmke45TODvxvkxRMV9RazV+ZZzhOL9AG8G29TLrr3jkjwF7uJfxZ30EoXpO+LJkq4oA8NjO2DTnEDg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-environment-visitor': 7.22.5
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/helper-remap-async-to-generator': 7.22.9(@babel/[email protected])
+ '@babel/plugin-syntax-async-generators': 7.8.4(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-b1A8D8ZzE/VhNDoV1MSJTnpKkCG5bJo+19R4o4oy03zM7ws8yEMK755j61Dc3EyvdysbqH5BOOTquJ7ZX9C6vQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-module-imports': 7.22.5
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/helper-remap-async-to-generator': 7.22.9(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-tdXZ2UdknEKQWKJP1KMNmuF5Lx3MymtMN/pvA+p/VEkhK8jVcQ1fzSy8KM9qRYhAf2/lV33hoMPKI/xaI9sADA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-EcACl1i5fSQ6bt+YGuU/XGCeZKStLmyVGytWkpyhCLeQVA0eu6Wtiw92V+I1T/hnezUv7j74dA/Ro69gWcU+hg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-nDkQ0NfkOhPTq8YCLiWNxp1+f9fCobEjCb0n8WdbNUBc4IB5V7P1QnX9IjpSoquKrXF5SKojHleVNs2vGeHCHQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-create-class-features-plugin': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-SPToJ5eYZLxlnp1UzdARpOGeC2GbHvr9d/UV0EukuVx8atktg194oe+C5BqQ8jRTkgLRVOPYeXRSBg1IlMoVRA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.12.0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-create-class-features-plugin': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-58EgM6nuPNG6Py4Z3zSuu0xWu2VfodiMi72Jt5Kj2FECmaYk1RrTXA45z6KBFsu9tRgwQDwIiY4FXTt+YsSFAQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-annotate-as-pure': 7.22.5
+ '@babel/helper-compilation-targets': 7.22.9(@babel/[email protected])
+ '@babel/helper-environment-visitor': 7.22.5
+ '@babel/helper-function-name': 7.22.5
+ '@babel/helper-optimise-call-expression': 7.22.5
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/helper-replace-supers': 7.22.9(@babel/[email protected])
+ '@babel/helper-split-export-declaration': 7.22.6
+ globals: 11.12.0
+ dev: true
+
+ resolution: {integrity: sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/template': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-GfqcFuGW8vnEqTUBM7UtPd5A4q797LTvvwKxXTgRsFjoqaJiEg9deBG6kWeQYkVEL569NpnmpC0Pkr/8BLKGnQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-5/Yk9QxCQCl+sOIB1WelKnVRxTJDSAIxtJLL2/pqL14ZVlbH0fUQUZa/T5/UnQtBNgghR7mfB8ERBKyKPCi7Vw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-create-regexp-features-plugin': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-dEnYD+9BBgld5VBXHnF/DbYGp3fqGMsyxKbtD1mDyIA7AkTSpKXFhCVuj/oQVOoALfBs77DudA0BE4d5mcpmqw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-0MC3ppTB1AMxd8fXjSrbPa7LT9hrImt+/fcj+Pg5YMD7UQyWp/02+JWpdnCymmsXwIx5Z+sYn1bwCn4ZJNvhqQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-vIpJFNM/FjZ4rh1myqIya9jXwrwwgFRHPjT3DkUA9ZLHuzox8jiXkOLvwm1H+PQIP3CqfC++WPKeuDi0Sjdj1g==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-builder-binary-assignment-operator-visitor': 7.22.5
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-X4hhm7FRnPgd4nDA4b/5V280xCx6oL7Oob5+9qVS5C13Zq4bh1qq7LU0GgRU6b5dBWBvhGaXYVB4AcN6+ol6vg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-tujNbZdxdG0/54g/oua8ISToaXTFBf8EnSb5PgQSciIXWOWKX3S4+JR7ZE9ol8FZwf9kxitzkGQ+QWeov/mCiA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/plugin-syntax-flow': 7.22.5(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-3kxQjX1dU9uudwSshyLeEipvrLjBCVthCgeTp6CzE/9JYrlAIaeekVxRpCWsDDfYTfRZRoCeZatCQvwo+wvK8A==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-UIzQNMS0p0HHiQm3oelztj+ECwFnj+ZRV4KnguvlsD2of1whUeM6o7wGNj6oLwcDoAXQ8gEqfgC24D+VdIcevg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-compilation-targets': 7.22.9(@babel/[email protected])
+ '@babel/helper-function-name': 7.22.5
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-DuCRB7fu8MyTLbEQd1ew3R85nx/88yMoqo2uPSjevMj3yoN7CDM8jkgrY0wmVxfJZyJ/B9fE1iq7EQppWQmR5A==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/plugin-syntax-json-strings': 7.8.3(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-fTLj4D79M+mepcw3dgFBTIDYpbcB9Sm0bpm4ppXPaO+U+PKFFyV9MGRvS0gvGw62sd10kT5lRMKXAADb9pWy8g==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-MQQOUW1KL8X0cDWfbwYP+TbVbZm16QmQXJQ+vndPtH/BoO0lOKpVoEDMI7+PskYxH+IiE0tS8xZye0qr1lGzSA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-RZEdkNtzzYCFl9SE9ATaUMTj2hqMb4StarOJLrZRbqqU4HSBE7UlBw9WBWQiDzrJZJdUWiMTVDI6Gv/8DPvfew==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-R+PTfLTcYEmb1+kK7FNkhQ1gP4KgjpSO6HfH9+f8/yfp2Nt3ggBjiVpRwmwTlfqZLafYKJACy36yDXlEmI9HjQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-module-transforms': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-module-transforms': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/helper-simple-access': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-emtEpoaTMsOs6Tzz+nbmcePl6AKVtS1yC4YNAeMun9U8YCsgadPNxnOPQ8GhHFB2qdx+LZu9LgoC0Lthuu05DQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-hoist-variables': 7.22.5
+ '@babel/helper-module-transforms': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/helper-validator-identifier': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-+S6kzefN/E1vkSsKx8kmQuqeQsvCKCd1fraCM7zXm4SFoggI099Tr4G8U81+5gtMdUeMQ4ipdQffbKLX0/7dBQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-module-transforms': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-create-regexp-features-plugin': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-AsF7K0Fx/cNKVyk3a+DW0JLo+Ua598/NxMRvxDnkpCIGFh43+h/v2xyhRUYf6oD8gE4QtL83C7zZVghMjHd+iw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-6CF8g6z1dNYZ/VXok5uYkkBBICHZPiGEl7oDnAx2Mt1hlHVHOSIKWJaXHjQJA5VB43KZnXZDIexMchY4y2PGdA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-NbslED1/6M+sXiwwtcAB/nieypGw02Ejf4KtDeMkCEpP6gWFMX1wI9WKYua+4oBneCCEmulOkRpwywypVZzs/g==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-Kk3lyDmEslH9DnvCDA1s1kkd3YWQITiBOHngOtDL9Pt6BZjzqb6hiOlb8VfjiiQJ2unmegBqZu0rx5RxJb5vmQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/compat-data': 7.22.9
+ '@babel/core': 7.22.9
+ '@babel/helper-compilation-targets': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/[email protected])
+ '@babel/plugin-transform-parameters': 7.22.5(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-klXqyaT9trSjIUrcsYIfETAzmOEZL3cBYqOYLJxBHfMFFggmXOv+NYSX/Jbs9mzMVESw/WycLFPRx8ba/b2Ipw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/helper-replace-supers': 7.22.9(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-pH8orJahy+hzZje5b8e2QIlBWQvGpelS76C63Z+jhZKsmzfNaPQ+LaW6dcJ9bxTpo1mtXbgHwy765Ro3jftmUg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-Vd5HiWml0mDVtcLHIoEU5sw6HOUW/Zk0acLs/SAeuLzkGNOPc9DB4nkUajemhCmTIz3eiaKREZn2hQQqF79YTg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/helper-skip-transparent-expression-wrappers': 7.22.5
+ '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-AVkFUBurORBREOmHRKo06FjHYgjrabpdqRSwq6+C7R5iTCZOsM4QbcB27St0a4U6fffyAOqh3s/qEfybAhfivg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-PPjh4gyrQnGe97JTalgRGMuU4icsZFnWkzicB/fUtzlKUqvsWBKEpPPfr5a2JiyirZkHxnAqkQMO5Z5B2kK3fA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-create-class-features-plugin': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-/9xnaTTJcVoBtSSmrVyhtSvO3kbqS2ODoh2juEU72c3aYonNF0OMGiaz2gjukyKM2wBBYJP38S4JiE0Wfb5VMQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-annotate-as-pure': 7.22.5
+ '@babel/helper-create-class-features-plugin': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-TiOArgddK3mK/x1Qwf5hay2pxI6wCZnvQqrFSqbtg1GLl2JcNMitVH/YnqjP+M31pLUeTfzY1HAXFDnUBV30rQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-qgIg8BcZgd0G/Cz916D5+9kqX0c7nPZyXaP8R2tLNN5tkyIZdG5fEwBrxwplzSnjC1jvQmyMNVwUCZPcbGY7Pg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-RMvQWvpla+xy6MlBpPlrKZCMRs2AGiHOGHY3xRwl0pEeim348dDyxeH4xBsMPbIMhujeq7ihE702eM2Ew0Wo+A==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/plugin-transform-react-jsx': 7.21.5(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-f/Eq+79JEu+KUANFks9UZCcvydOOGMgF7jBrcwjHa5jTZD8JivnhCJYvmlhR/WTXBWonDExPoW0eO/CR4QJirA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-RpAi004QyMNisst/pvSanoRdJ4q+jMCWyk9zdw/CyLB9j8RXEahodR6l2GyttDRyEVWZtbN+TpLiHJ3t34LbsQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-ELdlq61FpoEkHO6gFRpfj0kUgSwQTGoaEU8eMRoS8Dv3v6e7BjEAj5WMtIBRdHUeAioMhKP5HyxNzNnP+heKbA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-annotate-as-pure': 7.22.5
+ '@babel/helper-module-imports': 7.22.5
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/plugin-syntax-jsx': 7.21.4(@babel/[email protected])
+ '@babel/types': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-hs71ToC97k3QWxswh2ElzMFABXHvGiJ01IB1TbYQDGeWRKWz/MPUTh5jGExdHvosYKpnJW5Pm3S4+TA3FyX+GA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-annotate-as-pure': 7.22.5
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-rR7KePOE7gfEtNTh9Qw+iO3Q/e4DEsoQ+hdvM6QUDH7JRJ5qxq5AA52ZzBWbI5i9lfNuvySgOGP8ZN7LAmaiPw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ regenerator-transform: 0.15.1
+ dev: true
+
+ resolution: {integrity: sha512-DTtGKFRQUDm8svigJzZHzb/2xatPc6TzNvAIJ5GqOKDsGFYgAskjRulbR/vGsPKq3OPqtexnz327qYpP57RFyA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-Q17hHxXr2fplrE+5BSC1j1Fo5cOA8YeP8XW3/1paI8MzF/faZGh0MaH1KC4jLAvqLPamQWHB5/B7KqSLY1kuHA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-module-imports': 7.22.5
+ '@babel/helper-plugin-utils': 7.22.5
+ babel-plugin-polyfill-corejs2: 0.3.3(@babel/[email protected])
+ babel-plugin-polyfill-corejs3: 0.5.2(@babel/[email protected])
+ babel-plugin-polyfill-regenerator: 0.3.1(@babel/[email protected])
+ semver: 6.3.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-vM4fq9IXHscXVKzDv5itkO1X52SmdFBFcMIBZ2FRn2nqVYqw6dBexUgMvAjHW+KXpPPViD/Yo3GrDEBaRC0QYA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-5ZzDQIGyvN4w8+dMmpohL6MBo+l2G7tfC/O2Dg7/hjpgeWvUx8FzfeOKxGog9IimPa4YekaQ9PlDqTLOljkcxg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/helper-skip-transparent-expression-wrappers': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-zf7LuNpHG0iEeiyCNwX4j3gDg1jgt1k3ZdXBKbZSoA3BbGQGvMiSvfbZRR3Dr3aeJe3ooWFZxOOG3IRStYp2Bw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-5ciOehRNf+EyUeewo8NkbQiUs4d6ZxiHo6BcBcnFlgiJfu16q0bQUw9Jvo0b0gBKFG1SMhDSjeKXSYuJLeFSMA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-bYkI5lMzL4kPii4HHEEChkD0rkc+nvnlR6+o/qdqR6zrm0Sv/nodmyLhlq2DO0YKLUNd2VePmPRjJXSBh9OIdA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-l4vHuSLUajptpHNEOUDEGsnpl9pfRLsN1XUoDQDD/YBuXTM+v37SHGS+c6n4jdcZy96QtuUuSvZYMLSSsjH8Mw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-create-class-features-plugin': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/plugin-syntax-typescript': 7.20.0(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-biEmVg1IYB/raUO5wT1tgfacCef15Fbzhkx493D3urBI++6hpJ+RFG4SrWMn0NEZLfvilqKf3QDrRVZHo08FYg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-HCCIb+CbJIAE6sXn5CjFQXMwkCClcOfPCzTlilJ8cUatfzwHlWQkbtV0zD338u9dZskwvuOYTuuaMaA8J5EI5A==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-create-regexp-features-plugin': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-028laaOKptN5vHJf9/Arr/HiJekMd41hOEZYvNsrsXqJ7YPYuX2bQxh31fkZzGmq3YqHRJzYFFAVYvKfMPKqyg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-create-regexp-features-plugin': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-lhMfi4FC15j13eKrh3DnYHjpGj6UKQHtNKTbtc1igvAhRy4+kLhV07OpLcsN0VgDEw/MjAvJO4BdMJsHwMhzCg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-create-regexp-features-plugin': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-wNi5H/Emkhll/bqPjsjQorSykrlfY5OWakd6AulLvMEytpKasMVUpVy8RL4qBIBs5Ac6/5i0/Rv0b/Fg6Eag/g==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/compat-data': 7.22.9
+ '@babel/core': 7.22.9
+ '@babel/helper-compilation-targets': 7.22.9(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/helper-validator-option': 7.22.5
+ '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.22.5(@babel/[email protected])
+ '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.22.5(@babel/[email protected])
+ '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/[email protected])
+ '@babel/plugin-syntax-async-generators': 7.8.4(@babel/[email protected])
+ '@babel/plugin-syntax-class-properties': 7.12.13(@babel/[email protected])
+ '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/[email protected])
+ '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/[email protected])
+ '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/[email protected])
+ '@babel/plugin-syntax-import-assertions': 7.22.5(@babel/[email protected])
+ '@babel/plugin-syntax-import-attributes': 7.22.5(@babel/[email protected])
+ '@babel/plugin-syntax-import-meta': 7.10.4(@babel/[email protected])
+ '@babel/plugin-syntax-json-strings': 7.8.3(@babel/[email protected])
+ '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/[email protected])
+ '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/[email protected])
+ '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/[email protected])
+ '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/[email protected])
+ '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/[email protected])
+ '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/[email protected])
+ '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/[email protected])
+ '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/[email protected])
+ '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/[email protected])
+ '@babel/plugin-transform-arrow-functions': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-async-generator-functions': 7.22.7(@babel/[email protected])
+ '@babel/plugin-transform-async-to-generator': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-block-scoped-functions': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-block-scoping': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-class-properties': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-class-static-block': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-classes': 7.22.6(@babel/[email protected])
+ '@babel/plugin-transform-computed-properties': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-destructuring': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-dotall-regex': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-duplicate-keys': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-dynamic-import': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-exponentiation-operator': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-export-namespace-from': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-for-of': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-function-name': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-json-strings': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-literals': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-logical-assignment-operators': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-member-expression-literals': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-modules-amd': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-modules-commonjs': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-modules-systemjs': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-modules-umd': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-named-capturing-groups-regex': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-new-target': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-nullish-coalescing-operator': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-numeric-separator': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-object-rest-spread': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-object-super': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-optional-catch-binding': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-optional-chaining': 7.22.6(@babel/[email protected])
+ '@babel/plugin-transform-parameters': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-private-methods': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-private-property-in-object': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-property-literals': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-regenerator': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-reserved-words': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-shorthand-properties': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-spread': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-sticky-regex': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-template-literals': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-typeof-symbol': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-unicode-escapes': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-unicode-property-regex': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-unicode-regex': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-unicode-sets-regex': 7.22.5(@babel/[email protected])
+ '@babel/preset-modules': 0.1.5(@babel/[email protected])
+ '@babel/types': 7.22.5
+ babel-plugin-polyfill-corejs2: 0.4.5(@babel/[email protected])
+ babel-plugin-polyfill-corejs3: 0.8.3(@babel/[email protected])
+ babel-plugin-polyfill-regenerator: 0.5.2(@babel/[email protected])
+ core-js-compat: 3.31.1
+ semver: 6.3.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-ta2qZ+LSiGCrP5pgcGt8xMnnkXQrq8Sa4Ulhy06BOlF5QbLw9q5hIx7bn5MrsvyTGAfh6kTOo07Q+Pfld/8Y5Q==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/helper-validator-option': 7.22.5
+ '@babel/plugin-transform-flow-strip-types': 7.22.5(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/plugin-proposal-unicode-property-regex': 7.18.6(@babel/[email protected])
+ '@babel/plugin-transform-dotall-regex': 7.22.5(@babel/[email protected])
+ '@babel/types': 7.22.5
+ esutils: 2.0.3
+ dev: true
+
+ resolution: {integrity: sha512-fWpyI8UM/HE6DfPBzD8LnhQ/OcH8AgTaqcqP2nGOXEUV+VKBR5JRN9hCk9ai+zQQ57vtm9oWeXguBCPNUjytgA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/helper-validator-option': 7.22.5
+ '@babel/plugin-transform-react-display-name': 7.16.7(@babel/[email protected])
+ '@babel/plugin-transform-react-jsx': 7.21.5(@babel/[email protected])
+ '@babel/plugin-transform-react-jsx-development': 7.16.7(@babel/[email protected])
+ '@babel/plugin-transform-react-pure-annotations': 7.16.7(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-S1ViF8W2QwAKUGJXxP9NAfNaqGDdEBJKpYkxHf5Yy2C4NPPzXGeR3Lhk7G8xJaaLcFTRfNjVbtbVtm8Gb0mqvg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-plugin-utils': 7.22.5
+ '@babel/helper-validator-option': 7.22.5
+ '@babel/plugin-transform-typescript': 7.18.4(@babel/[email protected])
+ dev: true
+
+ resolution: {integrity: sha512-vV6pm/4CijSQ8Y47RH5SopXzursN35RQINfGJkmOlcpAtGuf94miFvIPhCKGQN7WGIcsgG1BHEX2KVdTYwTwUQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ clone-deep: 4.0.1
+ find-cache-dir: 2.1.0
+ make-dir: 2.1.0
+ pirates: 4.0.5
+ source-map-support: 0.5.21
+ dev: true
+
+ resolution: {integrity: sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==}
+ dev: true
+
+ resolution: {integrity: sha512-l4ddFwrc9rnR+EJsHsh+TJ4A35YqQz/UqcjtlX2ov53hlJYG5CxtQmNZxyajwDVmCxwy++rtvGU5HazCK4W41Q==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ core-js-pure: 3.21.1
+ regenerator-runtime: 0.13.11
+ dev: true
+
+ resolution: {integrity: sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ regenerator-runtime: 0.13.11
+
+ resolution: {integrity: sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ regenerator-runtime: 0.13.11
+
+ resolution: {integrity: sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/code-frame': 7.22.5
+ '@babel/parser': 7.22.7
+ '@babel/types': 7.22.5
+
+ resolution: {integrity: sha512-y6LPR+wpM2I3qJrsheCTwhIinzkETbplIgPBbwvqPKc+uljeA5gP+3nP8irdYt1mjQaDnlIcG+dw8OjAco4GXw==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/code-frame': 7.22.5
+ '@babel/generator': 7.22.9
+ '@babel/helper-environment-visitor': 7.22.5
+ '@babel/helper-function-name': 7.22.5
+ '@babel/helper-hoist-variables': 7.22.5
+ '@babel/helper-split-export-declaration': 7.22.6
+ '@babel/parser': 7.22.7
+ '@babel/types': 7.22.5
+ debug: 4.3.4
+ globals: 11.12.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/helper-string-parser': 7.22.5
+ '@babel/helper-validator-identifier': 7.22.5
+ to-fast-properties: 2.0.0
+
+ resolution: {integrity: sha512-4iri8i1AqYHJE2DstZYkyEprg6Pq6sKx3xn5FpySk9sNhH7qN2LLlHJCfDTZRILNwQNPD7mATWM0TBui7uC1pA==}
+ dev: true
+
+ resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==}
+ dev: true
+
+ /@codemirror/[email protected](@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected]):
+ resolution: {integrity: sha512-Fbwm0V/Wn3BkEJZRhr0hi5BhCo5a7eBL6LYaliPjOSwCyfOpnjXY59HruSxOUNV+1OYer0Tgx1zRNQttjXyDog==}
+ peerDependencies:
+ '@codemirror/language': ^6.0.0
+ '@codemirror/state': ^6.0.0
+ '@codemirror/view': ^6.0.0
+ '@lezer/common': ^1.0.0
+ dependencies:
+ '@codemirror/language': 6.8.0
+ '@codemirror/state': 6.2.1
+ '@codemirror/view': 6.16.0
+ '@lezer/common': 1.0.3
+ dev: false
+
+ /@codemirror/[email protected]:
+ resolution: {integrity: sha512-42lmDqVH0ttfilLShReLXsDfASKLXzfyC36bzwcqzox9PlHulMcsUOfHXNo2X2aFMVNUoQ7j+d4q5bnfseYoOA==}
+ dependencies:
+ '@codemirror/language': 6.8.0
+ '@codemirror/state': 6.2.1
+ '@codemirror/view': 6.16.0
+ '@lezer/common': 1.0.3
+ dev: false
+
+ /@codemirror/[email protected](@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected]):
+ resolution: {integrity: sha512-S9w2Jl74hFlD5nqtUMIaXAq9t5WlM0acCkyuQWUUSvZclk1sV+UfnpFiZzuZSG+hfEaOmxKR5UxY/Uxswn7EhQ==}
+ dependencies:
+ '@codemirror/autocomplete': 6.9.0(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected])
+ '@codemirror/language': 6.8.0
+ '@lezer/python': 1.1.7
+ transitivePeerDependencies:
+ - '@codemirror/state'
+ - '@codemirror/view'
+ - '@lezer/common'
+ dev: false
+
+ /@codemirror/[email protected]:
+ resolution: {integrity: sha512-r1paAyWOZkfY0RaYEZj3Kul+MiQTEbDvYqf8gPGaRvNneHXCmfSaAVFjwRUPlgxS8yflMxw2CTu6uCMp8R8A2g==}
+ dependencies:
+ '@codemirror/state': 6.2.1
+ '@codemirror/view': 6.16.0
+ '@lezer/common': 1.0.3
+ '@lezer/highlight': 1.1.6
+ '@lezer/lr': 1.3.9
+ style-mod: 4.0.0
+ dev: false
+
+ /@codemirror/[email protected]:
+ resolution: {integrity: sha512-6VZ44Ysh/Zn07xrGkdtNfmHCbGSHZzFBdzWi0pbd7chAQ/iUcpLGX99NYRZTa7Ugqg4kEHCqiHhcZnH0gLIgSg==}
+ dependencies:
+ '@codemirror/state': 6.2.1
+ '@codemirror/view': 6.16.0
+ crelt: 1.0.5
+ dev: false
+
+ /@codemirror/[email protected]:
+ resolution: {integrity: sha512-4jupk4JwkeVbrN2pStY74q6OJEYqwosB4koA66nyLeVedadtX9MHI38j2vbYmnfDGurDApP3OZO46MrWalcjiQ==}
+ dependencies:
+ '@codemirror/state': 6.2.1
+ '@codemirror/view': 6.16.0
+ crelt: 1.0.5
+ dev: false
+
+ /@codemirror/[email protected]:
+ resolution: {integrity: sha512-RupHSZ8+OjNT38zU9fKH2sv+Dnlr8Eb8sl4NOnnqz95mCFTZUaiRP8Xv5MeeaG0px2b8Bnfe7YGwCV3nsBhbuw==}
+ dev: false
+
+ /@codemirror/[email protected]:
+ resolution: {integrity: sha512-F+sH0X16j/qFLMAfbciKTxVOwkdAS336b7AXTKOZhy8BR3eH/RelsnLgLFINrpST63mmN2OuwUt0W2ndUgYwUA==}
+ dependencies:
+ '@codemirror/language': 6.8.0
+ '@codemirror/state': 6.2.1
+ '@codemirror/view': 6.16.0
+ '@lezer/highlight': 1.1.6
+ dev: false
+
+ /@codemirror/[email protected]:
+ resolution: {integrity: sha512-1Z2HkvkC3KR/oEZVuW9Ivmp8TWLzGEd8T8TA04TTwPvqogfkHBdYSlflytDOqmkUxM2d1ywTg7X2dU5mC+SXvg==}
+ dependencies:
+ '@codemirror/state': 6.2.1
+ style-mod: 4.0.0
+ w3c-keyname: 2.2.4
+ dev: false
+
+ /@colors/[email protected]:
+ resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==}
+ engines: {node: '>=0.1.90'}
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@csstools/[email protected](@csstools/[email protected]):
+ resolution: {integrity: sha512-xrvsmVUtefWMWQsGgFffqWSK03pZ1vfDki4IVIIUxxDKnGBzqNgv0A7SB1oXtVNEkcVO8xi1ZrTL29HhSu5kGA==}
+ engines: {node: ^14 || ^16 || >=18}
+ peerDependencies:
+ '@csstools/css-tokenizer': ^2.2.0
+ dependencies:
+ '@csstools/css-tokenizer': 2.2.0
+ dev: true
+
+ /@csstools/[email protected]:
+ resolution: {integrity: sha512-wErmsWCbsmig8sQKkM6pFhr/oPha1bHfvxsUY5CYSQxwyhA9Ulrs8EqCgClhg4Tgg2XapVstGqSVcz0xOYizZA==}
+ engines: {node: ^14 || ^16 || >=18}
+ dev: true
+
+ /@csstools/[email protected](@csstools/[email protected])(@csstools/[email protected]):
+ resolution: {integrity: sha512-ATul1u+pic4aVpstgueqxEv4MsObEbszAxfTXpx9LHaeD3LAh+wFqdCteyegWmjk0k5rkSCAvIOaJe9U3DD09w==}
+ engines: {node: ^14 || ^16 || >=18}
+ peerDependencies:
+ '@csstools/css-parser-algorithms': ^2.3.1
+ '@csstools/css-tokenizer': ^2.2.0
+ dependencies:
+ '@csstools/css-parser-algorithms': 2.3.1(@csstools/[email protected])
+ '@csstools/css-tokenizer': 2.2.0
+ dev: true
+
+ resolution: {integrity: sha512-hBI9tfBtuPIi885ZsZ32IMEU/5nlZH/KOVYJCOh7gyMxaVLGmLedYqFN6Ui1LXkI8JlC8IsuC0rF0btcRZKd5g==}
+ engines: {node: ^14 || ^16 || >=18}
+ peerDependencies:
+ postcss-selector-parser: ^6.0.13
+ dependencies:
+ postcss-selector-parser: 6.0.13
+ dev: true
+
+ /@discoveryjs/[email protected]:
+ resolution: {integrity: sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==}
+ engines: {node: '>=10.0.0'}
+ dev: true
+
+ resolution: {integrity: sha512-HXRrwS9YUYQO9lFRc/49uO/VICbM+O+ZRpFDe9Pd1rwVv2PCNkRiTZRdxrDgng/UkvdC3Re9r2vwPpXXrWeFzg==}
+ peerDependencies:
+ react: '>=16.8.0'
+ dependencies:
+ react: 18.2.0
+ tslib: 2.5.0
+ dev: false
+
+ resolution: {integrity: sha512-lYaoP8yHTQSLlZe6Rr9qogouGUz9oRUj4AHhDQGQzq/hqaJRpFo65X+JKsdHf8oUFBzx5A+SJPUvxAwTF2OabA==}
+ peerDependencies:
+ react: '>=16.8.0'
+ react-dom: '>=16.8.0'
+ dependencies:
+ '@dnd-kit/accessibility': 3.0.1([email protected])
+ '@dnd-kit/utilities': 3.2.1([email protected])
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ tslib: 2.5.0
+ dev: false
+
+ resolution: {integrity: sha512-rbxcsg3HhzlcMHVHWDuh9LCjpOVAgqbV78wLGI8tziXY3+qcMQ61qVXIvNKQFuhj75dSfD+o+PYZQ/NUk2A23A==}
+ peerDependencies:
+ '@dnd-kit/core': ^6.0.6
+ react: '>=16.8.0'
+ dependencies:
+ '@dnd-kit/core': 6.0.8([email protected])([email protected])
+ '@dnd-kit/utilities': 3.2.1([email protected])
+ react: 18.2.0
+ tslib: 2.5.0
+ dev: false
+
+ resolution: {integrity: sha512-wDkBHHf9iCi1veM834Gbk1429bd4lHX4RpAwT0y2cHLf246GAvU2sVw/oxWNpPKQNQRQaeGXhAVgrOl1IT+iyA==}
+ peerDependencies:
+ '@dnd-kit/core': ^6.0.7
+ react: '>=16.8.0'
+ dependencies:
+ '@dnd-kit/core': 6.0.8([email protected])([email protected])
+ '@dnd-kit/utilities': 3.2.1([email protected])
+ react: 18.2.0
+ tslib: 2.5.0
+ dev: false
+
+ resolution: {integrity: sha512-OOXqISfvBw/1REtkSK2N3Fi2EQiLMlWUlqnOK/UpOISqBZPWpE6TqL+jcPtMOkE8TqYGiURvRdPSI9hltNUjEA==}
+ peerDependencies:
+ react: '>=16.8.0'
+ dependencies:
+ react: 18.2.0
+ tslib: 2.5.0
+ dev: false
+
+ /@emotion/[email protected]:
+ resolution: {integrity: sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==}
+ dependencies:
+ '@babel/helper-module-imports': 7.21.4
+ '@babel/runtime': 7.22.5
+ '@emotion/hash': 0.9.1
+ '@emotion/memoize': 0.8.1
+ '@emotion/serialize': 1.1.2
+ babel-plugin-macros: 3.1.0
+ convert-source-map: 1.8.0
+ escape-string-regexp: 4.0.0
+ find-root: 1.1.0
+ source-map: 0.5.7
+ stylis: 4.2.0
+ dev: false
+
+ /@emotion/[email protected]:
+ resolution: {integrity: sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==}
+ dependencies:
+ '@emotion/memoize': 0.8.1
+ '@emotion/sheet': 1.2.2
+ '@emotion/utils': 1.2.1
+ '@emotion/weak-memoize': 0.3.1
+ stylis: 4.2.0
+ dev: false
+
+ /@emotion/[email protected]:
+ resolution: {integrity: sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==}
+ dev: false
+
+ /@emotion/[email protected]:
+ resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==}
+ dependencies:
+ '@emotion/memoize': 0.8.1
+ dev: false
+
+ /@emotion/[email protected]:
+ resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==}
+ dev: false
+
+ resolution: {integrity: sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==}
+ peerDependencies:
+ '@types/react': '*'
+ react: '>=16.8.0'
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@emotion/babel-plugin': 11.11.0
+ '@emotion/cache': 11.11.0
+ '@emotion/serialize': 1.1.2
+ '@emotion/use-insertion-effect-with-fallbacks': 1.0.1([email protected])
+ '@emotion/utils': 1.2.1
+ '@emotion/weak-memoize': 0.3.1
+ '@types/react': 18.2.19
+ hoist-non-react-statics: 3.3.2
+ react: 18.2.0
+ dev: false
+
+ /@emotion/[email protected]:
+ resolution: {integrity: sha512-zR6a/fkFP4EAcCMQtLOhIgpprZOwNmCldtpaISpvz348+DP4Mz8ZoKaGGCQpbzepNIUWbq4w6hNZkwDyKoS+HA==}
+ dependencies:
+ '@emotion/hash': 0.9.1
+ '@emotion/memoize': 0.8.1
+ '@emotion/unitless': 0.8.1
+ '@emotion/utils': 1.2.1
+ csstype: 3.1.2
+ dev: false
+
+ /@emotion/[email protected]:
+ resolution: {integrity: sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==}
+ dev: false
+
+ resolution: {integrity: sha512-hM5Nnvu9P3midq5aaXj4I+lnSfNi7Pmd4EWk1fOZ3pxookaQTNew6bp4JaCBYM4HVFZF9g7UjJmsUmC2JlxOng==}
+ peerDependencies:
+ '@emotion/react': ^11.0.0-rc.0
+ '@types/react': '*'
+ react: '>=16.8.0'
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@emotion/babel-plugin': 11.11.0
+ '@emotion/is-prop-valid': 1.2.1
+ '@emotion/react': 11.11.1(@types/[email protected])([email protected])
+ '@emotion/serialize': 1.1.2
+ '@emotion/use-insertion-effect-with-fallbacks': 1.0.1([email protected])
+ '@emotion/utils': 1.2.1
+ '@types/react': 18.2.19
+ react: 18.2.0
+ dev: false
+
+ /@emotion/[email protected]:
+ resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==}
+ dev: false
+
+ resolution: {integrity: sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==}
+ peerDependencies:
+ react: '>=16.8.0'
+ dependencies:
+ react: 18.2.0
+
+ /@emotion/[email protected]:
+ resolution: {integrity: sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==}
+ dev: false
+
+ /@emotion/[email protected]:
+ resolution: {integrity: sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==}
+ dev: false
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-wsCqSPqLz+6Ov+OM4EthU43DyYVVyfn15S4j1bJzylDpc1r1jZFFfJQNfDuT8SlgwuqpmpJXK4uPlHGw6ve7eA==}
+ engines: {node: '>=12'}
+ cpu: [arm64]
+ os: [android]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-gCHjjQmA8L0soklKbLKA6pgsLk1byULuHe94lkZDzcO3/Ta+bbeewJioEn1Fr7kgy9NWNFy/C+MrBwC6I/WCug==}
+ engines: {node: '>=12'}
+ cpu: [arm]
+ os: [android]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-ldsTXolyA3eTQ1//4DS+E15xl0H/3DTRJaRL0/0PgkqDsI0fV/FlOtD+h0u/AUJr+eOTlZv4aC9gvfppo3C4sw==}
+ engines: {node: '>=12'}
+ cpu: [x64]
+ os: [android]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-aBxruWCII+OtluORR/KvisEw0ALuw/qDQWvkoosA+c/ngC/Kwk0lLaZ+B++LLS481/VdydB2u6tYpWxUfnLAIw==}
+ engines: {node: '>=12'}
+ cpu: [arm64]
+ os: [darwin]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-6w4Dbue280+rp3LnkgmriS1icOUZDyPuZo/9VsuMUTns7SYEiOaJ7Ca1cbhu9KVObAWfmdjUl4gwy9TIgiO5eA==}
+ engines: {node: '>=12'}
+ cpu: [x64]
+ os: [darwin]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-x35fCebhe9s979DGKbVAwXUOcTmCIE32AIqB9CB1GralMIvxdnMLAw5CnID17ipEw9/3MvDsusj/cspYt2ZLNQ==}
+ engines: {node: '>=12'}
+ cpu: [arm64]
+ os: [freebsd]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-YM98f+PeNXF3GbxIJlUsj+McUWG1irguBHkszCIwfr3BXtXZsXo0vqybjUDFfu9a8Wr7uUD/YSmHib+EeGAFlg==}
+ engines: {node: '>=12'}
+ cpu: [x64]
+ os: [freebsd]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-XIqhNUxJiuy+zsR77+H5Z2f7s4YRlriSJKtvx99nJuG5ATuJPjmZ9n0ANgnGlPCpXGSReFpgcJ7O3SMtzIFeiQ==}
+ engines: {node: '>=12'}
+ cpu: [arm64]
+ os: [linux]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-b5ABb+5Ha2C9JkeZXV+b+OruR1tJ33ePmv9ZwMeETSEKlmu/WJ45XTTG+l6a2KDsQtJJ66qo/hbSGBtk0XVLHw==}
+ engines: {node: '>=12'}
+ cpu: [arm]
+ os: [linux]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-no+pfEpwnRvIyH+txbBAWtjxPU9grslmTBfsmDndj7bnBmr55rOo/PfQmRfz7Qg9isswt1FP5hBbWb23fRWnow==}
+ engines: {node: '>=12'}
+ cpu: [ia32]
+ os: [linux]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-Zbnczs9ZXjmo0oZSS0zbNlJbcwKXa/fcNhYQjahDs4Xg18UumpXG/lwM2lcSvHS3mTrRyCYZvJbmzYc4laRI1g==}
+ engines: {node: '>=12'}
+ cpu: [loong64]
+ os: [linux]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-YMF7hih1HVR/hQVa/ot4UVffc5ZlrzEb3k2ip0nZr1w6fnYypll9td2qcoMLvd3o8j3y6EbJM3MyIcXIVzXvQQ==}
+ engines: {node: '>=12'}
+ cpu: [mips64el]
+ os: [linux]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-Wkz++LZ29lDwUyTSEnzDaaP5OveOgTU69q9IyIw9WqLRxM4BjTBjz9un4G6TOvehWpf/J3gYVFN96TjGHrbcNQ==}
+ engines: {node: '>=12'}
+ cpu: [ppc64]
+ os: [linux]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-LFMKZ30tk78/mUv1ygvIP+568bwf4oN6reG/uczXnz6SvFn4e2QUFpUpZY9iSJT6Qpgstrhef/nMykIXZtZWGQ==}
+ engines: {node: '>=12'}
+ cpu: [riscv64]
+ os: [linux]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-3ZC0BgyYHYKfZo3AV2/66TD/I9tlSBaW7eWTEIkrQQKfJIifKMMttXl9FrAg+UT0SGYsCRLI35Gwdmm96vlOjg==}
+ engines: {node: '>=12'}
+ cpu: [s390x]
+ os: [linux]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-xu86B3647DihHJHv/wx3NCz2Dg1gjQ8bbf9cVYZzWKY+gsvxYmn/lnVlqDRazObc3UMwoHpUhNYaZset4X8IPA==}
+ engines: {node: '>=12'}
+ cpu: [x64]
+ os: [linux]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-uVAgpimx9Ffw3xowtg/7qQPwHFx94yCje+DoBx+LNm2ePDpQXHrzE+Sb0Si2VBObYz+LcRps15cq+95YM7gkUw==}
+ engines: {node: '>=12'}
+ cpu: [x64]
+ os: [netbsd]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-6OjCQM9wf7z8/MBi6BOWaTL2AS/SZudsZtBziXMtNI8r/U41AxS9x7jn0ATOwVy08OotwkPqGRMkpPR2wcTJXA==}
+ engines: {node: '>=12'}
+ cpu: [x64]
+ os: [openbsd]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-ZoNkruFYJp9d1LbUYCh8awgQDvB9uOMZqlQ+gGEZR7v6C+N6u7vPr86c+Chih8niBR81Q/bHOSKGBK3brJyvkQ==}
+ engines: {node: '>=12'}
+ cpu: [x64]
+ os: [sunos]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-+j4anzQ9hrs+iqO+/wa8UE6TVkKua1pXUb0XWFOx0FiAj6R9INJ+WE//1/Xo6FG1vB5EpH3ko+XcgwiDXTxcdw==}
+ engines: {node: '>=12'}
+ cpu: [arm64]
+ os: [win32]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-5PFPmq3sSKTp9cT9dzvI67WNfRZGvEVctcZa1KGjDDu4n3H8k59Inbk0du1fz0KrAbKKNpJbdFXQMDUz7BG4rQ==}
+ engines: {node: '>=12'}
+ cpu: [ia32]
+ os: [win32]
+ requiresBuild: true
+ optional: true
+
+ /@esbuild/[email protected]:
+ resolution: {integrity: sha512-sCIVrrtcWN5Ua7jYXNG1xD199IalrbfV2+0k/2Zf2OyV2FtnQnMgdzgpRAbi4AWlKJj1jkX+M+fEGPQj6BQB4w==}
+ engines: {node: '>=12'}
+ cpu: [x64]
+ os: [win32]
+ requiresBuild: true
+ optional: true
+
+ /@eslint-community/[email protected]([email protected]):
+ resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ eslint: ^6.0.0 || ^7.0.0 || >=8.0.0
+ dependencies:
+ eslint: 8.46.0
+ eslint-visitor-keys: 3.4.2
+
+ /@eslint-community/[email protected]:
+ resolution: {integrity: sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==}
+ engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
+ dev: true
+
+ /@eslint-community/[email protected]:
+ resolution: {integrity: sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==}
+ engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
+
+ /@eslint/[email protected]:
+ resolution: {integrity: sha512-9t7ZA7NGGK8ckelF0PQCfcxIUzs1Md5rrO6U/c+FIQNanea5UZC0wqKXH4vHBccmu4ZJgZ2idtPeW7+Q2npOEA==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dependencies:
+ ajv: 6.12.6
+ debug: 4.3.4
+ espree: 9.6.1
+ globals: 13.20.0
+ ignore: 5.2.4
+ import-fresh: 3.3.0
+ js-yaml: 4.1.0
+ minimatch: 3.1.2
+ strip-json-comments: 3.1.1
+ transitivePeerDependencies:
+ - supports-color
+
+ /@eslint/[email protected]:
+ resolution: {integrity: sha512-a8TLtmPi8xzPkCbp/OGFUo5yhRkHM2Ko9kOWP4znJr0WAhWyThaw3PnwX4vOTWOAMsV2uRt32PPDcEz63esSaA==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+
+ /@fal-works/[email protected]:
+ resolution: {integrity: sha512-cEee/Z+I12mZcFJshKcCqC8tuX5hG3s+d+9nZ3LabqKF1vKdF41B92pJVCBggjAGORAeOzyyDDKrZwIkLffeOQ==}
+ dev: true
+
+ /@floating-ui/[email protected]:
+ resolution: {integrity: sha512-EvYTiXet5XqweYGClEmpu3BoxmsQ4hkj3QaYA6qEnigCWffTP3vNRwBReTdrwDwo7OoJ3wM8Uoe9Uk4n+d4hfg==}
+
+ /@floating-ui/[email protected]:
+ resolution: {integrity: sha512-sosQxsqgxMNkV3C+3UqTS6LxP7isRLwX8WMepp843Rb3/b0Wz8+MdUkxJksByip3C2WwLugLHN1b4ibn//zKwQ==}
+ dependencies:
+ '@floating-ui/core': 1.2.6
+
+ resolution: {integrity: sha512-Ke0oU3SeuABC2C4OFu2mSAwHIP5WUiV98O9YWoHV4Q5aT6E9k06DV0Khi5uYspR8xmmBk08t8ZDcz3TR3ARkEg==}
+ peerDependencies:
+ react: '>=16.8.0'
+ react-dom: '>=16.8.0'
+ dependencies:
+ '@floating-ui/dom': 1.2.9
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+
+ resolution: {integrity: sha512-skXQHhLxq0Sz2xDwCyv5dygBCtXJe1GmWwxDzfdtl0X6agD6qcyTG8HrZWkjJoy8AkiLARqYvSYJ8z7+Nwmi7w==}
+ peerDependencies:
+ react-hook-form: ^7.0.0
+ dependencies:
+ react-hook-form: 7.45.4([email protected])
+ dev: false
+
+ /@humanwhocodes/[email protected]:
+ resolution: {integrity: sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==}
+ engines: {node: '>=10.10.0'}
+ dependencies:
+ '@humanwhocodes/object-schema': 1.2.1
+ debug: 4.3.4
+ minimatch: 3.1.2
+ transitivePeerDependencies:
+ - supports-color
+
+ /@humanwhocodes/[email protected]:
+ resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==}
+ engines: {node: '>=12.22'}
+
+ /@humanwhocodes/[email protected]:
+ resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==}
+
+ /@isaacs/[email protected]:
+ resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==}
+ engines: {node: '>=12'}
+ dependencies:
+ string-width: 5.1.2
+ string-width-cjs: /[email protected]
+ strip-ansi: 7.1.0
+ strip-ansi-cjs: /[email protected]
+ wrap-ansi: 8.1.0
+ wrap-ansi-cjs: /[email protected]
+
+ /@istanbuljs/[email protected]:
+ resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==}
+ engines: {node: '>=8'}
+ dependencies:
+ camelcase: 5.3.1
+ find-up: 4.1.0
+ get-package-type: 0.1.0
+ js-yaml: 3.14.1
+ resolve-from: 5.0.0
+ dev: true
+
+ /@istanbuljs/[email protected]:
+ resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@sinclair/typebox': 0.27.8
+ dev: true
+
+ resolution: {integrity: sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@babel/core': 7.22.9
+ '@jest/types': 29.6.1
+ '@jridgewell/trace-mapping': 0.3.18
+ babel-plugin-istanbul: 6.1.1
+ chalk: 4.1.2
+ convert-source-map: 2.0.0
+ fast-json-stable-stringify: 2.1.0
+ graceful-fs: 4.2.10
+ jest-haste-map: 29.5.0
+ jest-regex-util: 29.4.3
+ jest-util: 29.6.1
+ micromatch: 4.0.5
+ pirates: 4.0.5
+ slash: 3.0.0
+ write-file-atomic: 4.0.2
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==}
+ engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
+ dependencies:
+ '@types/istanbul-lib-coverage': 2.0.4
+ '@types/istanbul-reports': 3.0.1
+ '@types/node': 17.0.19
+ '@types/yargs': 16.0.5
+ chalk: 4.1.2
+ dev: true
+
+ resolution: {integrity: sha512-tPKQNMPuXgvdOn2/Lg9HNfUvjYVGolt04Hp03f5hAk878uwOLikN+JzeLY0HcVgKgFl9Hs3EIqpu3WX27XNhnw==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/schemas': 29.6.0
+ '@types/istanbul-lib-coverage': 2.0.4
+ '@types/istanbul-reports': 3.0.1
+ '@types/node': 17.0.19
+ '@types/yargs': 17.0.24
+ chalk: 4.1.2
+ dev: true
+
+ resolution: {integrity: sha512-ou4ZJSXMMWHqGS4g8uNRbC5TiTWxAgQZiVucoUrOCWuPrTbkpJbmVyIi9jU72SBry7gQtuMEDp4YR8EEXAg7VQ==}
+ peerDependencies:
+ typescript: '>= 4.3.x'
+ vite: ^3.0.0 || ^4.0.0
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ dependencies:
+ glob: 7.2.0
+ glob-promise: 4.2.2([email protected])
+ magic-string: 0.27.0
+ react-docgen-typescript: 2.2.2([email protected])
+ typescript: 5.1.6
+ vite: 4.4.9(@types/[email protected])([email protected])
+ dev: true
+
+ /@jridgewell/[email protected]:
+ resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==}
+ engines: {node: '>=6.0.0'}
+ dependencies:
+ '@jridgewell/set-array': 1.1.1
+ '@jridgewell/sourcemap-codec': 1.4.15
+ '@jridgewell/trace-mapping': 0.3.18
+
+ /@jridgewell/[email protected]:
+ resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==}
+ engines: {node: '>=6.0.0'}
+
+ /@jridgewell/[email protected]:
+ resolution: {integrity: sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ==}
+ engines: {node: '>=6.0.0'}
+
+ /@jridgewell/[email protected]:
+ resolution: {integrity: sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==}
+ dependencies:
+ '@jridgewell/gen-mapping': 0.3.3
+ '@jridgewell/trace-mapping': 0.3.18
+ dev: false
+
+ /@jridgewell/[email protected]:
+ resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==}
+
+ /@jridgewell/[email protected]:
+ resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==}
+
+ /@jridgewell/[email protected]:
+ resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==}
+ dependencies:
+ '@jridgewell/resolve-uri': 3.1.0
+ '@jridgewell/sourcemap-codec': 1.4.14
+
+ /@juggle/[email protected]:
+ resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==}
+
+ resolution: {integrity: sha512-JH4wAXCgUOcCGNekQPLhVeUtIqjH0yPBs7vvUdSjyQama9618IOKFJwkv2kcqdhF0my8hQEgCTEJU0GIgnahvA==}
+ dev: false
+
+ resolution: {integrity: sha512-cmSJYa2us+r3SePpRCjN5ymCqCPv+zyXmDl0ciWtVaNiORT/MxM7ZgOMQZADD0o51qOaOg24qc/zBViOIwAjJg==}
+ dependencies:
+ '@lezer/common': 1.0.3
+ dev: false
+
+ resolution: {integrity: sha512-XPz6dzuTHlnsbA5M2DZgjflNQ+9Hi5Swhic0RULdp3oOs3rh6bqGZolosVqN/fQIT8uNiepzINJDnS39oweTHQ==}
+ dependencies:
+ '@lezer/common': 1.0.3
+ dev: false
+
+ resolution: {integrity: sha512-RbhKQ9+Y/r/Xv6OcJmETEM5tBFdpdAJRqrgi3akJkWBLCuiAaLP/jKdYzu+ICljaSXPCQeznrv+r9HUEnjq3HQ==}
+ dependencies:
+ '@lezer/highlight': 1.1.6
+ '@lezer/lr': 1.3.9
+ dev: false
+
+ resolution: {integrity: sha512-zQH//gdOmuu7nt2oJR29vFhDv88oGPmVw6BggmrHeMI+xgEkp1B2dX9/bMBSYtK0dyLX/aOmesKS09g222K1/g==}
+ peerDependencies:
+ react: '>=16'
+ dependencies:
+ '@types/mdx': 2.0.5
+ '@types/react': 18.2.19
+ react: 18.2.0
+ dev: true
+
+ resolution: {integrity: sha512-mlN83YSrcFgk7Dm1Mys40DLssI1KdJji2CMKN8eOlBqsTADYzj2+jWzsANsUTFbxDMWPD5e9bfA1RGqBpS3O1g==}
+ engines: {node: '>=14'}
+ dependencies:
+ '@types/set-cookie-parser': 2.4.2
+ set-cookie-parser: 2.5.1
+ dev: true
+
+ resolution: {integrity: sha512-201pBIWehTURb6q8Gheu4Zhvd3Ox1U4BJq5KiOQsYzkWyfiOG4pwcz5hPZIEryztgrf8/sdwABpvY757xMmfrQ==}
+ engines: {node: '>=14'}
+ dependencies:
+ '@open-draft/until': 1.0.3
+ '@types/debug': 4.1.7
+ '@xmldom/xmldom': 0.8.6
+ debug: 4.3.4
+ headers-polyfill: 3.1.2
+ outvariant: 1.4.0
+ strict-event-emitter: 0.2.8
+ web-encoding: 1.1.5
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-vy3TWLQYdGNecTaufR4wDNQFV2WEg6wRPi6BVbx6q1vP3K1mbxIn1+XOqOzfYBXjFHvMx0gZAo2TgWbaqfgvAA==}
+ engines: {node: '>=12.0.0'}
+ peerDependencies:
+ '@types/react': ^17.0.0 || ^18.0.0
+ react: ^17.0.0 || ^18.0.0
+ react-dom: ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@emotion/is-prop-valid': 1.2.1
+ '@mui/types': 7.2.4(@types/[email protected])
+ '@mui/utils': 5.13.6([email protected])
+ '@popperjs/core': 2.11.8
+ '@types/react': 18.2.19
+ clsx: 1.2.1
+ prop-types: 15.8.1
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ react-is: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-yFrMWcrlI0TqRN5jpb6Ma9iI7sGTHpytdzzL33oskFHNQ8UgrtPas33Y1K7sWAMwCrr1qbWDrOHLAQG4tAzuSw==}
+ dev: false
+
+ resolution: {integrity: sha512-/c2ZApeQm2sTYdQXjqEnldaBMBcUEiyu2VRS6bS39ZeNaAcCLBQbYocLR46R+f0S5dgpBzB0T4AsOABPOFYZ5Q==}
+ engines: {node: '>=12.0.0'}
+ peerDependencies:
+ '@emotion/react': ^11.5.0
+ '@emotion/styled': ^11.3.0
+ '@types/react': ^17.0.0 || ^18.0.0
+ react: ^17.0.0 || ^18.0.0
+ react-dom: ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ '@emotion/react':
+ optional: true
+ '@emotion/styled':
+ optional: true
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@emotion/react': 11.11.1(@types/[email protected])([email protected])
+ '@emotion/styled': 11.11.0(@emotion/[email protected])(@types/[email protected])([email protected])
+ '@mui/base': 5.0.0-beta.5(@types/[email protected])([email protected])([email protected])
+ '@mui/core-downloads-tracker': 5.13.4
+ '@mui/system': 5.13.6(@emotion/[email protected])(@emotion/[email protected])(@types/[email protected])([email protected])
+ '@mui/types': 7.2.4(@types/[email protected])
+ '@mui/utils': 5.13.6([email protected])
+ '@types/react': 18.2.19
+ '@types/react-transition-group': 4.4.6
+ clsx: 1.2.1
+ csstype: 3.1.2
+ prop-types: 15.8.1
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ react-is: 18.2.0
+ react-transition-group: 4.4.5([email protected])([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-HW4npLUD9BAkVppOUZHeO1FOKUJWAwbpy0VQoGe3McUYTlck1HezGHQCfBQ5S/Nszi7EViqiimECVl9xi+/WjQ==}
+ engines: {node: '>=12.0.0'}
+ peerDependencies:
+ '@types/react': ^17.0.0 || ^18.0.0
+ react: ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@mui/utils': 5.13.6([email protected])
+ '@types/react': 18.2.19
+ prop-types: 15.8.1
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-VCYCU6xVtXOrIN8lcbuPmoG+u7FYuOERG++fpY74hPpEWkyFQG97F+/XfTQVYzlR2m7nPjnwVUgATcTCMEaMvw==}
+ engines: {node: '>=12.0.0'}
+ peerDependencies:
+ '@emotion/react': ^11.4.1
+ '@emotion/styled': ^11.3.0
+ react: ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ '@emotion/react':
+ optional: true
+ '@emotion/styled':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@emotion/cache': 11.11.0
+ '@emotion/react': 11.11.1(@types/[email protected])([email protected])
+ '@emotion/styled': 11.11.0(@emotion/[email protected])(@types/[email protected])([email protected])
+ csstype: 3.1.2
+ prop-types: 15.8.1
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-G3Xr28uLqU3DyF6r2LQkHGw/ku4P0AHzlKVe7FGXOPl7X1u+hoe2xxj8Vdiq/69II/mh9OP21i38yBWgWb7WgQ==}
+ engines: {node: '>=12.0.0'}
+ peerDependencies:
+ '@emotion/react': ^11.5.0
+ '@emotion/styled': ^11.3.0
+ '@types/react': ^17.0.0 || ^18.0.0
+ react: ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ '@emotion/react':
+ optional: true
+ '@emotion/styled':
+ optional: true
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@emotion/react': 11.11.1(@types/[email protected])([email protected])
+ '@emotion/styled': 11.11.0(@emotion/[email protected])(@types/[email protected])([email protected])
+ '@mui/private-theming': 5.13.1(@types/[email protected])([email protected])
+ '@mui/styled-engine': 5.13.2(@emotion/[email protected])(@emotion/[email protected])([email protected])
+ '@mui/types': 7.2.4(@types/[email protected])
+ '@mui/utils': 5.13.6([email protected])
+ '@types/react': 18.2.19
+ clsx: 1.2.1
+ csstype: 3.1.2
+ prop-types: 15.8.1
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-LBcwa8rN84bKF+f5sDyku42w1NTxaPgPyYKODsh01U1fVstTClbUoSA96oyRBnSNyEiAVjKm6Gwx9vjR+xyqHA==}
+ peerDependencies:
+ '@types/react': '*'
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@types/react': 18.2.19
+ dev: false
+
+ resolution: {integrity: sha512-ggNlxl5NPSbp+kNcQLmSig6WVB0Id+4gOxhx644987v4fsji+CSXc+MFYLocFB/x4oHtzCUlSzbVHlJfP/fXoQ==}
+ engines: {node: '>=12.0.0'}
+ peerDependencies:
+ react: ^17.0.0 || ^18.0.0
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@types/prop-types': 15.7.5
+ '@types/react-is': 18.2.1
+ prop-types: 15.8.1
+ react: 18.2.0
+ react-is: 18.2.0
+ dev: false
+
+ /@ndelangen/[email protected]:
+ resolution: {integrity: sha512-NqGfTZIZpRFef1GoVaShSSRwDC3vde3ThtTeqFdcYd6ipKqnfEVhjK2hUeHjCQUcptyZr2TONqcloFXM+5QBrQ==}
+ dependencies:
+ gunzip-maybe: 1.4.2
+ pump: 3.0.0
+ tar-fs: 2.1.1
+ dev: true
+
+ /@nodelib/[email protected]:
+ resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
+ engines: {node: '>= 8'}
+ dependencies:
+ '@nodelib/fs.stat': 2.0.5
+ run-parallel: 1.2.0
+
+ /@nodelib/[email protected]:
+ resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==}
+ engines: {node: '>= 8'}
+
+ /@nodelib/[email protected]:
+ resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}
+ engines: {node: '>= 8'}
+ dependencies:
+ '@nodelib/fs.scandir': 2.1.5
+ fastq: 1.13.0
+
+ /@open-draft/[email protected]:
+ resolution: {integrity: sha512-Aq58f5HiWdyDlFffbbSjAlv596h/cOnt2DO1w3DOC7OJ5EHs0hd/nycJfiu9RJbT6Yk6F1knnRRXNSpxoIVZ9Q==}
+ dev: true
+
+ resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
+ engines: {node: '>=14'}
+ requiresBuild: true
+ optional: true
+
+ /@playwright/[email protected]:
+ resolution: {integrity: sha512-2rVZeyPRjxfPH6J0oGJqE8YxiM1IBRyM8hyrXYK7eSiAqmbNhxwcLa7dZ7fy9Kj26V7FYia5fh9XJRq4Dqme+g==}
+ engines: {node: '>=16'}
+ hasBin: true
+ dependencies:
+ '@types/node': 17.0.19
+ playwright-core: 1.36.2
+ optionalDependencies:
+ fsevents: 2.3.2
+ dev: true
+
+ /@popperjs/[email protected]:
+ resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==}
+ dev: false
+
+ /@radix-ui/[email protected]:
+ resolution: {integrity: sha512-EhWky2oSIf5y+BDfrAY+Rykrkh7m2/M/bgCVRr3M+Hnr4JOh+mtFZLHUS1j/WzaPw1uvd0vwhK3cbxsR0QnCgw==}
+ dev: false
+
+ /@radix-ui/[email protected]:
+ resolution: {integrity: sha512-T5gIdVO2mmPW3NNhjNgEP3cqMXjXL9UbO0BzWcXfvdBs+BohbQxvd/K5hSVKmn9/lbTdsQVKbUcP5WLCwvUbBg==}
+ dependencies:
+ '@babel/runtime': 7.22.5
+
+ /@radix-ui/[email protected]:
+ resolution: {integrity: sha512-3e7rn8FDMin4CgeL7Z/49smCA3rFYY3Ha2rUQ7HRWFadS5iCRw08ZgVT1LaNTCNqgvrUiyczLflrVrF0SRQtNA==}
+ dependencies:
+ '@babel/runtime': 7.22.5
+ dev: false
+
+ /@radix-ui/[email protected]:
+ resolution: {integrity: sha512-yQ8oGX2GVsEYMWGxcovu1uGWPCxV5BFfeeYxqPmuAzUyLT9qmaMXSAhXpb0WrspIeqYzdJpkh2vHModJPgRIaw==}
+ dependencies:
+ '@babel/runtime': 7.22.5
+
+ resolution: {integrity: sha512-fDG7jcoNKVjSK6yfmuAs0EnPDro0WMXIhMtXdTBWqEioVW206ku+4Lw07e+13lUkFkpoEQ2PdeMIAGpdqEAmDg==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.21.0
+ '@radix-ui/primitive': 1.0.1
+ '@radix-ui/react-collapsible': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-collection': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-direction': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-id': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-jbfBCRlKYlhbitueOAv7z74PXYeIQmWpKwm3jllsdkw7fGWNkxqP3v0nY9WmOzcPqpQuoorNtvViBgL46n5gVg==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.21.0
+ '@radix-ui/primitive': 1.0.1
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-dialog': 1.0.4(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-slot': 1.0.2(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-wSP+pHsB/jQRaL6voubsQ/ZlrGBHHrOjmBnr19hxYgtS0WvAFwZhK2WP/YY5yF9uKECCEEDGxuLxq1NBK51wFA==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+
+ resolution: {integrity: sha512-CBuGQa52aAYnADZVt/KBQzXrwx6TqnlwtcIPGtVt5JkkzQwMOLJjPukimhfKEr4GQNd43C+djUh5Ikopj8pSLg==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.21.0
+ '@radix-ui/primitive': 1.0.1
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-presence': 1.0.1(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-previous': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-size': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-UBmVDkmR6IvDsloHVN+3rtx4Mi5TFvylYXpluuv0f37dtaz3H99bp8No0LGXRigVpl3UAT4l9j6bIchh42S/Gg==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/primitive': 1.0.1
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-id': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-presence': 1.0.1(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-layout-effect': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-3SzW+0PW7yBBoQlT8wNcGtaxaD0XSu0uLUFgrtHY08Acx05TaHaOmVLR73c0j/cqpDy53KBMO7s0dx2wmOIDIA==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-slot': 1.0.2(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+
+ resolution: {integrity: sha512-0KaSv6sx787/hK3eF53iOkiSLwAGlFMx5lotrqD2pTjB18KbybKoEIgkNZTKC60YECDQTKGTRcDBILwZVqVKvA==}
+ peerDependencies:
+ react: ^16.8 || ^17.0 || ^18.0
+ dependencies:
+ '@babel/runtime': 7.22.5
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@types/react': 18.2.19
+ react: 18.2.0
+
+ resolution: {integrity: sha512-1pVM9RfOQ+n/N5PJK33kRSKsr1glNxomxONs5c49MliinBY6Yw2Q995qfBUUo0/Mbg05B/sGA0gkgPI7kmSHBg==}
+ peerDependencies:
+ react: ^16.8 || ^17.0 || ^18.0
+ dependencies:
+ '@babel/runtime': 7.22.5
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@types/react': 18.2.19
+ react: 18.2.0
+
+ resolution: {integrity: sha512-Yn9YU+QlHYLWwV1XfKiqnGVpWYWk6MeBVM6x/bcoyPvxgjQGoeT35482viLPctTMWoMw0PoHgqfSox7Ig+957Q==}
+ peerDependencies:
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/primitive': 1.0.0
+ '@radix-ui/react-compose-refs': 1.0.0([email protected])
+ '@radix-ui/react-context': 1.0.0([email protected])
+ '@radix-ui/react-dismissable-layer': 1.0.0([email protected])([email protected])
+ '@radix-ui/react-focus-guards': 1.0.0([email protected])
+ '@radix-ui/react-focus-scope': 1.0.0([email protected])([email protected])
+ '@radix-ui/react-id': 1.0.0([email protected])
+ '@radix-ui/react-portal': 1.0.0([email protected])([email protected])
+ '@radix-ui/react-presence': 1.0.0([email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.0([email protected])([email protected])
+ '@radix-ui/react-slot': 1.0.0([email protected])
+ '@radix-ui/react-use-controllable-state': 1.0.0([email protected])
+ aria-hidden: 1.1.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ react-remove-scroll: 2.5.4(@types/[email protected])([email protected])
+ transitivePeerDependencies:
+ - '@types/react'
+ dev: false
+
+ resolution: {integrity: sha512-hJtRy/jPULGQZceSAP2Re6/4NpKo8im6V8P2hUqZsdFiSL8l35kYsw3qbRI6Ay5mQd2+wlLqje770eq+RJ3yZg==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.21.0
+ '@radix-ui/primitive': 1.0.1
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-dismissable-layer': 1.0.4(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-focus-guards': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-focus-scope': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-id': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-portal': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-presence': 1.0.1(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-slot': 1.0.2(@types/[email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ aria-hidden: 1.1.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ react-remove-scroll: 2.5.5(@types/[email protected])([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-RXcvnXgyvYvBEOhCBuddKecVkoMiI10Jcm5cTI7abJRAHYfFxeu+FBQs/DvdxSYucxR5mna0dNsL6QFlds5TMA==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@types/react': 18.2.19
+ react: 18.2.0
+
+ resolution: {integrity: sha512-n7kDRfx+LB1zLueRDvZ1Pd0bxdJWDUZNQ/GWoxDn2prnuJKRdxsjulejX/ePkOsLi2tTm6P24mDqlMSgQpsT6g==}
+ peerDependencies:
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/primitive': 1.0.0
+ '@radix-ui/react-compose-refs': 1.0.0([email protected])
+ '@radix-ui/react-primitive': 1.0.0([email protected])([email protected])
+ '@radix-ui/react-use-callback-ref': 1.0.0([email protected])
+ '@radix-ui/react-use-escape-keydown': 1.0.0([email protected])
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-7UpBa/RKMoHJYjie1gkF1DlK8l1fdU/VKDpoS3rCCo8YBJR294GwcEHyxHw72yvphJ7ld0AXEcSLAzY2F/WyCg==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/primitive': 1.0.1
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-escape-keydown': 1.0.3(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+
+ resolution: {integrity: sha512-xdOrZzOTocqqkCkYo8yRPCib5OkTkqN7lqNCdxwPOdE466DOaNl4N8PkUIlsXthQvW5Wwkd+aEmWpfWlBoDPEw==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.21.0
+ '@radix-ui/primitive': 1.0.1
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-id': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-menu': 2.0.5(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-UagjDk4ijOAnGu4WMUPj9ahi7/zJJqNZ9ZAiGPp7waUWJO0O1aWXi/udPphI0IUjvrhBsZJGSN66dR2dsueLWQ==}
+ peerDependencies:
+ react: ^16.8 || ^17.0 || ^18.0
+ dependencies:
+ '@babel/runtime': 7.22.5
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-Rect2dWbQ8waGzhMavsIbmSVCgYxkXLxxR3ZvCX79JOglzdEy4JXMb98lq4hPxUbLr77nP0UOGf4rcMU+s1pUA==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@types/react': 18.2.19
+ react: 18.2.0
+
+ resolution: {integrity: sha512-C4SWtsULLGf/2L4oGeIHlvWQx7Rf+7cX/vKOAD2dXW0A1b5QXwi3wWeaEgW+wn+SEVrraMUk05vLU9fZZz5HbQ==}
+ peerDependencies:
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-compose-refs': 1.0.0([email protected])
+ '@radix-ui/react-primitive': 1.0.0([email protected])([email protected])
+ '@radix-ui/react-use-callback-ref': 1.0.0([email protected])
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-upXdPfqI4islj2CslyfUBNlaJCPybbqRHAi1KER7Isel9Q2AtSJ0zRBZv8mWQiFXD2nyAJ4BhC3yXgZ6kMBSrQ==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+
+ resolution: {integrity: sha512-jQxj/0LKgp+j9BiTXz3O3sgs26RNet2iLWmsPyRz2SIcR4q/4SbazXfnYwbAr+vLYKSfc7qxzyGQA1HLlYiuNw==}
+ peerDependencies:
+ react: ^16.x || ^17.x || ^18.x
+ dependencies:
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-Q6iAB/U7Tq3NTolBBQbHTgclPmGWE3OlktGGqrClPozSw4vkQ1DfQAOtzgRPecKsMdJINE05iaoDUG8tRzCBjw==}
+ peerDependencies:
+ react: ^16.8 || ^17.0 || ^18.0
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-use-layout-effect': 1.0.0([email protected])
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-tI7sT/kqYp8p96yGWY1OAnLHrqDgzHefRBKQ2YAkBS5ja7QLcZ9Z/uY7bEjPUatf8RomoXM8/1sMj1IJaE5UzQ==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-use-layout-effect': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ react: 18.2.0
+
+ resolution: {integrity: sha512-N5ehvlM7qoTLx7nWPodsPYPgMzA5WM8zZChQg8nyFJKnDO5WHdba1vv5/H6IO5LtJMfD2Q3wh1qHFGNtK0w3bQ==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.21.0
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-Gw4f9pwdH+w5w+49k0gLjN0PfRDHvxmAgG16AbyJZ7zhwZ6PBHKtWohvnSwfusfnK3L68dpBREHpVkj8wEM7ZA==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/primitive': 1.0.1
+ '@radix-ui/react-collection': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-direction': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-dismissable-layer': 1.0.4(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-focus-guards': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-focus-scope': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-id': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-popper': 1.1.2(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-portal': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-presence': 1.0.1(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-roving-focus': 1.0.4(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-slot': 1.0.2(@types/[email protected])([email protected])
+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ aria-hidden: 1.1.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ react-remove-scroll: 2.5.5(@types/[email protected])([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-cZ4defGpkZ0qTRtlIBzJLSzL6ht7ofhhW4i1+pkemjV1IKXm0wgCRnee154qlV6r9Ttunmh2TNZhMfV2bavUyA==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.21.0
+ '@radix-ui/primitive': 1.0.1
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-dismissable-layer': 1.0.4(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-focus-guards': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-focus-scope': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-id': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-popper': 1.1.2(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-portal': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-presence': 1.0.1(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-slot': 1.0.2(@types/[email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ aria-hidden: 1.1.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ react-remove-scroll: 2.5.5(@types/[email protected])([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-1CnGGfFi/bbqtJZZ0P/NQY20xdG3E0LALJaLUEoKwPLwl6PPPfbeiCqMVQnhoFRAxjJj4RpBRJzDmUgsex2tSg==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@floating-ui/react-dom': 2.0.0([email protected])([email protected])
+ '@radix-ui/react-arrow': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-layout-effect': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-rect': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-size': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/rect': 1.0.1
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+
+ resolution: {integrity: sha512-a8qyFO/Xb99d8wQdu4o7qnigNjTPG123uADNecz0eX4usnQEj7o+cG4ZX4zkqq98NYekT7UoEQIjxBNWIFuqTA==}
+ peerDependencies:
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-primitive': 1.0.0([email protected])([email protected])
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-xLYZeHrWoPmA5mEKEfZZevoVRK/Q43GfzRXkWV6qawIWWK8t6ifIiLQdd7rmQ4Vk1bmI21XhqF9BN3jWf+phpA==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+
+ resolution: {integrity: sha512-A+6XEvN01NfVWiKu38ybawfHsBjWum42MRPnEuqPsBZ4eV7e/7K321B5VgYMPv3Xx5An6o1/l9ZuDBgmcmWK3w==}
+ peerDependencies:
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-compose-refs': 1.0.0([email protected])
+ '@radix-ui/react-use-layout-effect': 1.0.0([email protected])
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-layout-effect': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-EyXe6mnRlHZ8b6f4ilTDrXmkLShICIuOTTj0GX4w1rp+wSxf3+TD05u1UOITC8VsJ2a9nwHvdXtOXEOl0Cw/zQ==}
+ peerDependencies:
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-slot': 1.0.0([email protected])
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-slot': 1.0.2(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+
+ resolution: {integrity: sha512-x+yELayyefNeKeTx4fjK6j99Fs6c4qKm3aY38G3swQVTN6xMpsrbigC0uHs2L//g8q4qR7qOcww8430jJmi2ag==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.21.0
+ '@radix-ui/primitive': 1.0.1
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-direction': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-presence': 1.0.1(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-roving-focus': 1.0.4(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-previous': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-size': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-2mUg5Mgcu001VkGy+FfzZyzbmuUWzgWkj3rvv4yu+mLw03+mTzbxZHvfcGyFp2b8EkQeMkpRQ5FiA2Vr2O6TeQ==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/primitive': 1.0.1
+ '@radix-ui/react-collection': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-direction': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-id': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-zI7McXr8fNaSrUY9mZe4x/HC0jTLY9fWNhO1oLWYMQGDXuV4UCivIGTxwioSzO0ZCYX9iSLyWmAh/1TOmX3Cnw==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/number': 1.0.1
+ '@radix-ui/primitive': 1.0.1
+ '@radix-ui/react-collection': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-direction': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-dismissable-layer': 1.0.4(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-focus-guards': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-focus-scope': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-id': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-popper': 1.1.2(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-portal': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-slot': 1.0.2(@types/[email protected])([email protected])
+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-layout-effect': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-previous': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-visually-hidden': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ aria-hidden: 1.1.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ react-remove-scroll: 2.5.5(@types/[email protected])([email protected])
+
+ resolution: {integrity: sha512-NKs15MJylfzVsCagVSWKhGGLNR1W9qWs+HtgbmjjVUB3B9+lb3PYoXxVju3kOrpf0VKyVCtZp+iTwVoqpa1Chw==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.21.0
+ '@radix-ui/number': 1.0.1
+ '@radix-ui/primitive': 1.0.1
+ '@radix-ui/react-collection': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-direction': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-layout-effect': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-previous': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-size': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-3mrKauI/tWXo1Ll+gN5dHcxDPdm/Df1ufcDLCecn+pnCIVcdWE7CujXo8QaXOWRJyZyQWWbpB8eFwHzWXlv5mQ==}
+ peerDependencies:
+ react: ^16.8 || ^17.0 || ^18.0
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-compose-refs': 1.0.0([email protected])
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.21.0
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ react: 18.2.0
+
+ resolution: {integrity: sha512-mxm87F88HyHztsI7N+ZUmEoARGkC22YVW5CaC+Byc+HRpuvCrOBPTAnXgf+tZ/7i0Sg/eOePGdMhUKhPaQEqow==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.21.0
+ '@radix-ui/primitive': 1.0.1
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-previous': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-size': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-egZfYY/+wRNCflXNHx+dePvnz9FbmssDTJBtgRfDY7e8SE5oIo3Py2eCB1ckAbh1Q7cQ/6yJZThJ++sgbxibog==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.21.0
+ '@radix-ui/primitive': 1.0.1
+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-direction': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-id': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-presence': 1.0.1(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-roving-focus': 1.0.4(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-wf+fc8DOywrpRK3jlPlWVe+ELYGHdKDaaARJZNuUTWyWYq7+ANCFLp4rTjZ/mcGkJJQ/vZ949Zis9xxEpfq9OA==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.21.0
+ '@radix-ui/primitive': 1.0.1
+ '@radix-ui/react-collection': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-dismissable-layer': 1.0.4(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-portal': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-presence': 1.0.1(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-layout-effect': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-visually-hidden': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-DmNFOiwEc2UDigsYj6clJENma58OelxD24O4IODoZ+3sQc3Zb+L8w1EP+y9laTuKCLAysPw4fD6/v0j4KNV8rg==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.21.0
+ '@radix-ui/primitive': 1.0.1
+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-dismissable-layer': 1.0.4(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-id': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-popper': 1.1.2(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-portal': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-presence': 1.0.1(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-slot': 1.0.2(@types/[email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])
+ '@radix-ui/react-visually-hidden': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-GZtyzoHz95Rhs6S63D2t/eqvdFCm7I+yHMLVQheKM7nBD8mbZIt+ct1jz4536MDnaOGKIxynJ8eHTkVGVVkoTg==}
+ peerDependencies:
+ react: ^16.8 || ^17.0 || ^18.0
+ dependencies:
+ '@babel/runtime': 7.22.5
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@types/react': 18.2.19
+ react: 18.2.0
+
+ resolution: {integrity: sha512-FohDoZvk3mEXh9AWAVyRTYR4Sq7/gavuofglmiXB2g1aKyboUD4YtgWxKj8O5n+Uak52gXQ4wKz5IFST4vtJHg==}
+ peerDependencies:
+ react: ^16.8 || ^17.0 || ^18.0
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-use-callback-ref': 1.0.0([email protected])
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-Svl5GY5FQeN758fWKrjM6Qb7asvXeiZltlT4U2gVfl8Gx5UAv2sMR0LWo8yhsIZh2oQ0eFdZ59aoOOMV7b47VA==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ react: 18.2.0
+
+ resolution: {integrity: sha512-JwfBCUIfhXRxKExgIqGa4CQsiMemo1Xt0W/B4ei3fpzpvPENKpMKQ8mZSB6Acj3ebrAEgi2xiQvcI1PAAodvyg==}
+ peerDependencies:
+ react: ^16.8 || ^17.0 || ^18.0
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-use-callback-ref': 1.0.0([email protected])
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-vyL82j40hcFicA+M4Ex7hVkB9vHgSse1ZWomAqV2Je3RleKGO5iM8KMOEtfoSB0PnIelMd2lATjTGMYqN5ylTg==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ react: 18.2.0
+
+ resolution: {integrity: sha512-6Tpkq+R6LOlmQb1R5NNETLG0B4YP0wc+klfXafpUCj6JGyaUc8il7/kUZ7m59rGbXGczE9Bs+iz2qloqsZBduQ==}
+ peerDependencies:
+ react: ^16.8 || ^17.0 || ^18.0
+ dependencies:
+ '@babel/runtime': 7.22.5
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-v/5RegiJWYdoCvMnITBkNNx6bCj20fiaJnWtRkU18yITptraXjffz5Qbn05uOiQnOvi+dbkznkoaMltz1GnszQ==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@types/react': 18.2.19
+ react: 18.2.0
+
+ resolution: {integrity: sha512-cV5La9DPwiQ7S0gf/0qiD6YgNqM5Fk97Kdrlc5yBcrF3jyEZQwm7vYFqMo4IfeHgJXsRaMvLABFtd0OVEmZhDw==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@types/react': 18.2.19
+ react: 18.2.0
+
+ resolution: {integrity: sha512-Cq5DLuSiuYVKNU8orzJMbl15TXilTnJKUCltMVQg53BQOF1/C5toAaGrowkgksdBQ9H+SRL23g0HDmg9tvmxXw==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/rect': 1.0.1
+ '@types/react': 18.2.19
+ react: 18.2.0
+
+ resolution: {integrity: sha512-ibay+VqrgcaI6veAojjofPATwledXiSmX+C0KrBk/xgpX9rBzPV3OsfwlhQdUOFbh+LKQorLYT+xTXW9V8yd0g==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-use-layout-effect': 1.0.1(@types/[email protected])([email protected])
+ '@types/react': 18.2.19
+ react: 18.2.0
+
+ resolution: {integrity: sha512-D4w41yN5YRKtu464TLnByKzMDG/JlMPHtfZgQAu9v6mNakUqGUI9vUrfQKz8NK41VMm/xbZbh76NUTVtIYqOMA==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@types/react': 18.2.19
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+
+ /@radix-ui/[email protected]:
+ resolution: {integrity: sha512-fyrgCaedtvMg9NK3en0pnOYJdtfwxUcNolezkNPUsoX57X8oQk+NkqcvzHXD2uKNij6GXmWU9NDru2IWjrO4BQ==}
+ dependencies:
+ '@babel/runtime': 7.22.5
+
+ /@rollup/[email protected]:
+ resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==}
+ engines: {node: '>=14.0.0'}
+ peerDependencies:
+ rollup: ^1.20.0||^2.0.0||^3.0.0
+ peerDependenciesMeta:
+ rollup:
+ optional: true
+ dependencies:
+ '@types/estree': 1.0.1
+ estree-walker: 2.0.2
+ picomatch: 2.3.1
+ dev: true
+
+ /@rushstack/[email protected]:
+ resolution: {integrity: sha512-WiBSI6JBIhC6LRIsB2Kwh8DsGTlbBU+mLRxJmAe3LjHTdkDpwIbEOZgoXBbZilk/vlfjK8i6nKRAvIRn1XaIMw==}
+ dev: true
+
+ /@sinclair/[email protected]:
+ resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==}
+ dev: true
+
+ resolution: {integrity: sha512-sWzpRPJOVzAXUOS40zhGygPt49u/ibk247GIxR2zjm/qYcaqxMES55rPfO45A1p6/9pi81rH06vx3rwhVZ+plA==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ react:
+ optional: true
+ react-dom:
+ optional: true
+ dependencies:
+ '@storybook/client-logger': 7.2.3
+ '@storybook/components': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/core-events': 7.2.3
+ '@storybook/global': 5.0.0
+ '@storybook/manager-api': 7.2.3([email protected])([email protected])
+ '@storybook/preview-api': 7.2.3
+ '@storybook/theming': 7.2.3([email protected])([email protected])
+ '@storybook/types': 7.2.3
+ dequal: 2.0.3
+ lodash: 4.17.21
+ polished: 4.2.2
+ prop-types: 15.8.1
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ react-inspector: 6.0.1([email protected])
+ telejson: 7.1.0
+ ts-dedent: 2.2.0
+ uuid: 9.0.0
+ transitivePeerDependencies:
+ - '@types/react'
+ - '@types/react-dom'
+ dev: true
+
+ resolution: {integrity: sha512-9dpjwi5TaDL6wx1gERSylGouX6uoUfZK7ojSAlYRjyqtHdoNrWKgHCyF3xFN68I+p/FLZ4w9GE+MqjSCPRuNbQ==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ react:
+ optional: true
+ react-dom:
+ optional: true
+ dependencies:
+ '@storybook/client-logger': 7.2.3
+ '@storybook/components': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/core-events': 7.2.3
+ '@storybook/global': 5.0.0
+ '@storybook/manager-api': 7.2.3([email protected])([email protected])
+ '@storybook/preview-api': 7.2.3
+ '@storybook/theming': 7.2.3([email protected])([email protected])
+ '@storybook/types': 7.2.3
+ memoizerific: 1.11.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ ts-dedent: 2.2.0
+ transitivePeerDependencies:
+ - '@types/react'
+ - '@types/react-dom'
+ dev: true
+
+ resolution: {integrity: sha512-e0Yro238/MJP+0pV9sZ/M8BWjabX9lesr03dhvYKLAEwKSbrtcPRTszkRYKlcY9GyUxOc2xji8cgEgq0TtJWNg==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ react:
+ optional: true
+ react-dom:
+ optional: true
+ dependencies:
+ '@storybook/blocks': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/client-logger': 7.2.3
+ '@storybook/components': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/core-common': 7.2.3
+ '@storybook/core-events': 7.2.3
+ '@storybook/manager-api': 7.2.3([email protected])([email protected])
+ '@storybook/node-logger': 7.2.3
+ '@storybook/preview-api': 7.2.3
+ '@storybook/theming': 7.2.3([email protected])([email protected])
+ '@storybook/types': 7.2.3
+ lodash: 4.17.21
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ ts-dedent: 2.2.0
+ transitivePeerDependencies:
+ - '@types/react'
+ - '@types/react-dom'
+ - encoding
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-Je0+ykFaKRBfA2PeiWNMTGgtpB/eVwmCs1c8zW4boFrACiHOo/MgTHq0FDJDe3gFI/o73x6XroZ4JDcujjYcDg==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ '@jest/transform': 29.5.0
+ '@mdx-js/react': 2.3.0([email protected])
+ '@storybook/blocks': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/client-logger': 7.2.3
+ '@storybook/components': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/csf-plugin': 7.2.3
+ '@storybook/csf-tools': 7.2.3
+ '@storybook/global': 5.0.0
+ '@storybook/mdx2-csf': 1.1.0
+ '@storybook/node-logger': 7.2.3
+ '@storybook/postinstall': 7.2.3
+ '@storybook/preview-api': 7.2.3
+ '@storybook/react-dom-shim': 7.2.3([email protected])([email protected])
+ '@storybook/theming': 7.2.3([email protected])([email protected])
+ '@storybook/types': 7.2.3
+ fs-extra: 11.1.1
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ remark-external-links: 8.0.0
+ remark-slug: 6.1.0
+ ts-dedent: 2.2.0
+ transitivePeerDependencies:
+ - '@types/react'
+ - '@types/react-dom'
+ - encoding
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-QIw5IgNxNWAOet9qnHCQG+7yKlxVX45gpLL0rUJzN82aEnZ5bDJFZoFCspgwYzDeddPaYEzxsYjVGg8PbTHDpQ==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ '@storybook/addon-actions': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/addon-backgrounds': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/addon-controls': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/addon-docs': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/addon-highlight': 7.2.3
+ '@storybook/addon-measure': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/addon-outline': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/addon-toolbars': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/addon-viewport': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/core-common': 7.2.3
+ '@storybook/manager-api': 7.2.3([email protected])([email protected])
+ '@storybook/node-logger': 7.2.3
+ '@storybook/preview-api': 7.2.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ ts-dedent: 2.2.0
+ transitivePeerDependencies:
+ - '@types/react'
+ - '@types/react-dom'
+ - encoding
+ - supports-color
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-m1Hu/zewF+nk1iJPejZX5MmCsMtCQzlUwO1uVhM4UMXABqdMl+RdqvbC2L+E+auPN3znf8lBDPrSuzscHSraoQ==}
+ dependencies:
+ '@storybook/core-events': 7.2.3
+ '@storybook/global': 5.0.0
+ '@storybook/preview-api': 7.2.3
+ dev: true
+
+ resolution: {integrity: sha512-l4bmhLkH0qy0zrGBkiA1Mh/SCR+hIo7mzmpwybmQITm7gYB1yPunOI+psHnhwdsE+AdTjpotzMKaFmsjeGvRRA==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ react:
+ optional: true
+ react-dom:
+ optional: true
+ dependencies:
+ '@storybook/client-logger': 7.2.3
+ '@storybook/components': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/core-common': 7.2.3
+ '@storybook/core-events': 7.2.3
+ '@storybook/global': 5.0.0
+ '@storybook/instrumenter': 7.2.3
+ '@storybook/manager-api': 7.2.3([email protected])([email protected])
+ '@storybook/preview-api': 7.2.3
+ '@storybook/theming': 7.2.3([email protected])([email protected])
+ '@storybook/types': 7.2.3
+ jest-mock: 27.5.1
+ polished: 4.2.2
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ ts-dedent: 2.2.0
+ transitivePeerDependencies:
+ - '@types/react'
+ - '@types/react-dom'
+ - encoding
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-xu1byYcGTo6rxVlMxmpFqp+FLiI1yQseha2tTKCIX15r+R8woh9FefrJInDkvjZT6hXPgO+Jk0OS6bqJb4AbIA==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ react:
+ optional: true
+ react-dom:
+ optional: true
+ dependencies:
+ '@storybook/client-logger': 7.2.3
+ '@storybook/core-events': 7.2.3
+ '@storybook/csf': 0.1.0
+ '@storybook/global': 5.0.0
+ '@storybook/manager-api': 7.2.3([email protected])([email protected])
+ '@storybook/preview-api': 7.2.3
+ '@storybook/router': 7.2.3([email protected])([email protected])
+ '@storybook/types': 7.2.3
+ prop-types: 15.8.1
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ ts-dedent: 2.2.0
+ dev: true
+
+ resolution: {integrity: sha512-rfQEvyYTTYSwxTfa5pi2Ez6H7S++gC/EJ7zVwEeq3qTH3Am+47t/uJnJqQpimSVXNhHWh5DggozbRAOA+jaAMQ==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ react:
+ optional: true
+ react-dom:
+ optional: true
+ dependencies:
+ '@storybook/client-logger': 7.2.3
+ '@storybook/components': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/core-events': 7.2.3
+ '@storybook/global': 5.0.0
+ '@storybook/manager-api': 7.2.3([email protected])([email protected])
+ '@storybook/preview-api': 7.2.3
+ '@storybook/types': 7.2.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ tiny-invariant: 1.3.1
+ transitivePeerDependencies:
+ - '@types/react'
+ - '@types/react-dom'
+ dev: true
+
+ resolution: {integrity: sha512-FWFVWLo+ruFXq+om3WdEyILyIR42csN9Dl+QqfuuIaDZOseSodJG1eSEM5SPx14KKWgABTsnMXL7cpfemGw9rA==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ react:
+ optional: true
+ react-dom:
+ optional: true
+ dependencies:
+ '@storybook/client-logger': 7.2.3
+ '@storybook/components': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/core-events': 7.2.3
+ '@storybook/global': 5.0.0
+ '@storybook/manager-api': 7.2.3([email protected])([email protected])
+ '@storybook/preview-api': 7.2.3
+ '@storybook/types': 7.2.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ ts-dedent: 2.2.0
+ transitivePeerDependencies:
+ - '@types/react'
+ - '@types/react-dom'
+ dev: true
+
+ resolution: {integrity: sha512-g4e9vLnNlpjR3hHcyC8iCtgqcWQj6IPK+HZ8PdF92O95sa0nus+NG4meahEBwCsZm6CtYV/QMymFtLnp2NvAmg==}
+ hasBin: true
+ peerDependencies:
+ less: ^3.5.0 || ^4.0.0
+ postcss: ^7.0.0 || ^8.0.1
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ webpack: ^5.0.0
+ peerDependenciesMeta:
+ less:
+ optional: true
+ postcss:
+ optional: true
+ react:
+ optional: true
+ react-dom:
+ optional: true
+ webpack:
+ optional: true
+ dependencies:
+ '@babel/template': 7.22.5
+ '@babel/types': 7.22.5
+ '@storybook/api': 7.0.12([email protected])([email protected])
+ '@storybook/components': 7.2.1(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/core-common': 7.2.1
+ '@storybook/core-events': 7.2.1
+ '@storybook/manager-api': 7.2.1([email protected])([email protected])
+ '@storybook/node-logger': 7.2.1
+ '@storybook/preview-api': 7.2.1
+ '@storybook/theming': 7.2.1([email protected])([email protected])
+ '@storybook/types': 7.2.1
+ css-loader: 6.7.4([email protected])
+ less: 4.1.3
+ less-loader: 11.1.0([email protected])([email protected])
+ postcss: 8.4.27
+ postcss-loader: 7.3.0([email protected])([email protected])
+ prettier: 2.8.8
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ resolve-url-loader: 5.0.0
+ sass-loader: 13.2.2([email protected])
+ style-loader: 3.3.3([email protected])
+ webpack: 5.88.0([email protected])
+ transitivePeerDependencies:
+ - '@types/react'
+ - '@types/react-dom'
+ - encoding
+ - fibers
+ - node-sass
+ - sass
+ - sass-embedded
+ - supports-color
+ dev: false
+
+ resolution: {integrity: sha512-IEh5Zwo1yhB2ULKPu+DNb6csA7Jf/JxhCilNjgLTVcCvzQWtxoSadbI0ed9QTOSM/JRr4WJgm+4ZiC+22kXoVw==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ react:
+ optional: true
+ react-dom:
+ optional: true
+ dependencies:
+ '@storybook/client-logger': 7.2.3
+ '@storybook/components': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/manager-api': 7.2.3([email protected])([email protected])
+ '@storybook/preview-api': 7.2.3
+ '@storybook/theming': 7.2.3([email protected])([email protected])
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ transitivePeerDependencies:
+ - '@types/react'
+ - '@types/react-dom'
+ dev: true
+
+ resolution: {integrity: sha512-F9qJIgp7j98Ox/BOQRj/0jIUZ4FlX9rCTynQiHpMI6tRQJyj33pPOclO96/08tUTuuqNSK1zr/XydQIJe+dTPA==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ react:
+ optional: true
+ react-dom:
+ optional: true
+ dependencies:
+ '@storybook/client-logger': 7.2.3
+ '@storybook/components': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/core-events': 7.2.3
+ '@storybook/global': 5.0.0
+ '@storybook/manager-api': 7.2.3([email protected])([email protected])
+ '@storybook/preview-api': 7.2.3
+ '@storybook/theming': 7.2.3([email protected])([email protected])
+ memoizerific: 1.11.3
+ prop-types: 15.8.1
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ transitivePeerDependencies:
+ - '@types/react'
+ - '@types/react-dom'
+ dev: true
+
+ resolution: {integrity: sha512-wki9B7ZXOGwUq/FowDgEnkkX92oNpSg/6ES5Rh19NF3wV0ObLlgXMZ8cZKOLM6G0m/8lkKHGeNBunaLUnX7Yhw==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ react:
+ optional: true
+ react-dom:
+ optional: true
+ dependencies:
+ '@storybook/client-logger': 7.0.12
+ '@storybook/manager-api': 7.0.12([email protected])([email protected])
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-1s1BCWWxuK5gOpWPvSESULItwYtA1yQRjXJHWCDbjuDrm5DK+fQ2Asr4xl4MBzKfczw+7V8nsuEsTwybDS7/3A==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ '@storybook/channels': 7.2.3
+ '@storybook/client-logger': 7.2.3
+ '@storybook/components': 7.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/core-events': 7.2.3
+ '@storybook/csf': 0.1.0
+ '@storybook/docs-tools': 7.2.3
+ '@storybook/global': 5.0.0
+ '@storybook/manager-api': 7.2.3([email protected])([email protected])
+ '@storybook/preview-api': 7.2.3
+ '@storybook/theming': 7.2.3([email protected])([email protected])
+ '@storybook/types': 7.2.3
+ '@types/lodash': 4.14.194
+ color-convert: 2.0.1
+ dequal: 2.0.3
+ lodash: 4.17.21
+ markdown-to-jsx: 7.2.0([email protected])
+ memoizerific: 1.11.3
+ polished: 4.2.2
+ react: 18.2.0
+ react-colorful: 5.6.1([email protected])([email protected])
+ react-dom: 18.2.0([email protected])
+ telejson: 7.1.0
+ tocbot: 4.21.0
+ ts-dedent: 2.2.0
+ util-deprecate: 1.0.2
+ transitivePeerDependencies:
+ - '@types/react'
+ - '@types/react-dom'
+ - encoding
+ - supports-color
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-ywAFjqJ1gHEW6vj52r1syz+PaUc6OLN65IQiWhrhfzYdXdGiIdnWSOQOIh6LSrB6p9/M21/JFtWHCKtaEKXC9w==}
+ dependencies:
+ '@fal-works/esbuild-plugin-global-externals': 2.1.2
+ '@storybook/core-common': 7.2.3
+ '@storybook/manager': 7.2.3
+ '@storybook/node-logger': 7.2.3
+ '@types/ejs': 3.1.2
+ '@types/find-cache-dir': 3.2.1
+ '@yarnpkg/esbuild-plugin-pnp': 3.0.0-rc.15([email protected])
+ browser-assert: 1.2.1
+ ejs: 3.1.9
+ esbuild: 0.18.16
+ esbuild-plugin-alias: 0.2.1
+ express: 4.18.2
+ find-cache-dir: 3.3.2
+ fs-extra: 11.1.1
+ process: 0.11.10
+ util: 0.12.5
+ transitivePeerDependencies:
+ - encoding
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-DmR2rdBJ9ziC3flwHIafAVuLXn72VOXrZPrMycuUO/rfiJE41J685DfvZwpFrKPLNQRLJ3IXBqD6pTZ2cxG79Q==}
+ peerDependencies:
+ '@preact/preset-vite': '*'
+ typescript: '>= 4.3.x'
+ vite: ^3.0.0 || ^4.0.0
+ vite-plugin-glimmerx: '*'
+ peerDependenciesMeta:
+ '@preact/preset-vite':
+ optional: true
+ typescript:
+ optional: true
+ vite-plugin-glimmerx:
+ optional: true
+ dependencies:
+ '@storybook/channels': 7.2.3
+ '@storybook/client-logger': 7.2.3
+ '@storybook/core-common': 7.2.3
+ '@storybook/csf-plugin': 7.2.3
+ '@storybook/mdx2-csf': 1.1.0
+ '@storybook/node-logger': 7.2.3
+ '@storybook/preview': 7.2.3
+ '@storybook/preview-api': 7.2.3
+ '@storybook/types': 7.2.3
+ '@types/find-cache-dir': 3.2.1
+ browser-assert: 1.2.1
+ es-module-lexer: 0.9.3
+ express: 4.18.2
+ find-cache-dir: 3.3.2
+ fs-extra: 11.1.1
+ magic-string: 0.30.1
+ remark-external-links: 8.0.0
+ remark-slug: 6.1.0
+ rollup: 3.28.0
+ typescript: 5.1.6
+ vite: 4.4.9(@types/[email protected])([email protected])
+ transitivePeerDependencies:
+ - encoding
+ - supports-color
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-KDdDmDs8kxAJU+vndTqTNazjLO+XoIPiTRlfP7mk7cgHiQXSjMYy3JSCQ7W0of0Q+9VSl/ve9CNbnGbcQF7rNQ==}
+ dev: false
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-3ZogzjwlFG+oarwnI7TTvWvHVOUtJbjrgZkM5QuLMlxNzIR1XuBY8f01yf4K8+VpdNy9DY+7Q/j6tBThfwYvpA==}
+ dependencies:
+ '@storybook/client-logger': 7.2.1
+ '@storybook/core-events': 7.2.1
+ '@storybook/global': 5.0.0
+ qs: 6.11.2
+ telejson: 7.1.0
+ tiny-invariant: 1.3.1
+ dev: false
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-4RMTTmqpEL44gKClT/IjJAGTWvYmEvNg1jKHXEVP6rgepMyFN7edx4fTbGZV0Vb+5auyazoGOCUBNA6uzHgWbA==}
+ dependencies:
+ '@storybook/client-logger': 7.2.3
+ '@storybook/core-events': 7.2.3
+ '@storybook/global': 5.0.0
+ qs: 6.11.2
+ telejson: 7.1.0
+ tiny-invariant: 1.3.1
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-HG06iQxX7QXmBKgoS76Vm9mx6Y8zA9jJCdx/OqL1KbFs8Kt+n+z+gbqkAHpFs35va8inQ6zZTDx0vOnTakGmjQ==}
+ hasBin: true
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/preset-env': 7.22.9(@babel/[email protected])
+ '@babel/types': 7.22.5
+ '@ndelangen/get-tarball': 3.0.7
+ '@storybook/codemod': 7.2.3
+ '@storybook/core-common': 7.2.3
+ '@storybook/core-server': 7.2.3
+ '@storybook/csf-tools': 7.2.3
+ '@storybook/node-logger': 7.2.3
+ '@storybook/telemetry': 7.2.3
+ '@storybook/types': 7.2.3
+ '@types/semver': 7.3.13
+ '@yarnpkg/fslib': 2.10.3
+ '@yarnpkg/libzip': 2.3.0
+ chalk: 4.1.2
+ commander: 6.2.1
+ cross-spawn: 7.0.3
+ detect-indent: 6.1.0
+ envinfo: 7.8.1
+ execa: 5.1.1
+ express: 4.18.2
+ find-up: 5.0.0
+ fs-extra: 11.1.1
+ get-npm-tarball-url: 2.0.3
+ get-port: 5.1.1
+ giget: 1.1.2
+ globby: 11.1.0
+ jscodeshift: 0.14.0(@babel/[email protected])
+ leven: 3.1.0
+ ora: 5.4.1
+ prettier: 2.8.8
+ prompts: 2.4.2
+ puppeteer-core: 2.1.1
+ read-pkg-up: 7.0.1
+ semver: 7.5.4
+ simple-update-notifier: 2.0.0
+ strip-json-comments: 3.1.1
+ tempy: 1.0.1
+ ts-dedent: 2.2.0
+ util-deprecate: 1.0.2
+ transitivePeerDependencies:
+ - bufferutil
+ - encoding
+ - supports-color
+ - utf-8-validate
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-MQMtIgGEgdixvxnBvZ2m8hhc0DGJWeCpHtxg7oqBLBEBmCYFueTqDZHl4Z6SoCrK0a2YS5X/BIXOcEtP1ulMKw==}
+ dependencies:
+ '@storybook/global': 5.0.0
+ dev: false
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-Lyht/lJg2S65CXRy9rXAZXP/Mgye7jbi/aqQL8z9VRMGChbL+k/3pSZnXTTrD1OVSpCEr4UWA+9bStzT4VjtYA==}
+ dependencies:
+ '@storybook/global': 5.0.0
+ dev: false
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-Z+mEmtv3R3ose0xmlKLKQXCF4/eMGFPafuxIyyWtb9j5/RV3svMhQahH69sAfQ4Q74XB1erE7IowBroFuUwAZw==}
+ dependencies:
+ '@storybook/global': 5.0.0
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-ky6EJU7Wb6AI4qN2dVLKCzuSC5vqxaeQVocFbieNrNesgSuSRqjtJXryKNu1R3UXW/05LDSUb6Qb+Q6NPBZSHg==}
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/preset-env': 7.22.9(@babel/[email protected])
+ '@babel/types': 7.22.5
+ '@storybook/csf': 0.1.0
+ '@storybook/csf-tools': 7.2.3
+ '@storybook/node-logger': 7.2.3
+ '@storybook/types': 7.2.3
+ '@types/cross-spawn': 6.0.2
+ cross-spawn: 7.0.3
+ globby: 11.1.0
+ jscodeshift: 0.14.0(@babel/[email protected])
+ lodash: 4.17.21
+ prettier: 2.8.8
+ recast: 0.23.2
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-7JuMT2yK9FGPu9hFCo38tC3FDyr/hJ3CQwU6dSR6E5rT9E658dq31Xl3y/fM5OMzl8MX8Off7TWiybHSuwYJTA==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ '@radix-ui/react-select': 1.2.2(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/client-logger': 7.2.1
+ '@storybook/csf': 0.1.0
+ '@storybook/global': 5.0.0
+ '@storybook/icons': 1.1.5([email protected])([email protected])
+ '@storybook/theming': 7.2.1([email protected])([email protected])
+ '@storybook/types': 7.2.1
+ memoizerific: 1.11.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ use-resize-observer: 9.1.0([email protected])([email protected])
+ util-deprecate: 1.0.2
+ transitivePeerDependencies:
+ - '@types/react'
+ - '@types/react-dom'
+ dev: false
+
+ resolution: {integrity: sha512-w3c5DXdwbUj/ecyM8y0SqHObRZiDpAs+SxDeUzs9GJBD25qQZoxKhLAcsMk6F+N+2uPBtimwM4l8RJSo0oZOZg==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ '@radix-ui/react-select': 1.2.2(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@storybook/client-logger': 7.2.3
+ '@storybook/csf': 0.1.0
+ '@storybook/global': 5.0.0
+ '@storybook/icons': 1.1.5([email protected])([email protected])
+ '@storybook/theming': 7.2.3([email protected])([email protected])
+ '@storybook/types': 7.2.3
+ memoizerific: 1.11.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ use-resize-observer: 9.1.0([email protected])([email protected])
+ util-deprecate: 1.0.2
+ transitivePeerDependencies:
+ - '@types/react'
+ - '@types/react-dom'
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-7qBhUbDA+Y5P0j8TwK1YlWQglMri+a9Oe9kt3XBaskDjo1WI56F8uM5Zoc9HKNgZXvGYH+XvpDkulU5V52u+6A==}
+ dependencies:
+ '@storybook/client-logger': 7.2.3
+ '@storybook/preview-api': 7.2.3
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-g1MQ04lgL16Ct89tPj6RSw72yd+a+ZJ4ceH3Ev+SmnU8efBLPmr6+G5Bx7+rY1W2c6NdpFgtSidjgOGqQ8gppw==}
+ dependencies:
+ '@storybook/node-logger': 7.2.1
+ '@storybook/types': 7.2.1
+ '@types/find-cache-dir': 3.2.1
+ '@types/node': 16.18.36
+ '@types/node-fetch': 2.6.4
+ '@types/pretty-hrtime': 1.0.1
+ chalk: 4.1.2
+ esbuild: 0.18.16
+ esbuild-register: 3.4.2([email protected])
+ file-system-cache: 2.3.0
+ find-cache-dir: 3.3.2
+ find-up: 5.0.0
+ fs-extra: 11.1.1
+ glob: 10.3.3
+ handlebars: 4.7.7
+ lazy-universal-dotenv: 4.0.0
+ node-fetch: 2.6.7
+ picomatch: 2.3.1
+ pkg-dir: 5.0.0
+ pretty-hrtime: 1.0.3
+ resolve-from: 5.0.0
+ ts-dedent: 2.2.0
+ transitivePeerDependencies:
+ - encoding
+ - supports-color
+ dev: false
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-aBL4MGkn/PT57x00OWmVNwRCsJEb4xYvvYOYq5CGtIBCXAn0yo1p3GT9/Z0jAYT5c3A0nvCIM0ynmgML7fiFAg==}
+ dependencies:
+ '@storybook/node-logger': 7.2.3
+ '@storybook/types': 7.2.3
+ '@types/find-cache-dir': 3.2.1
+ '@types/node': 16.18.36
+ '@types/node-fetch': 2.6.4
+ '@types/pretty-hrtime': 1.0.1
+ chalk: 4.1.2
+ esbuild: 0.18.16
+ esbuild-register: 3.4.2([email protected])
+ file-system-cache: 2.3.0
+ find-cache-dir: 3.3.2
+ find-up: 5.0.0
+ fs-extra: 11.1.1
+ glob: 10.3.3
+ handlebars: 4.7.7
+ lazy-universal-dotenv: 4.0.0
+ node-fetch: 2.6.7
+ picomatch: 2.3.1
+ pkg-dir: 5.0.0
+ pretty-hrtime: 1.0.3
+ resolve-from: 5.0.0
+ ts-dedent: 2.2.0
+ transitivePeerDependencies:
+ - encoding
+ - supports-color
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-VTmb/zjbz3o1bg+bATzLigVXMVDC/S1FP8CqIrz4mkiys52139FGzMandL2Y2AecPZPGss7ZRdfma28HKVYTRg==}
+ dev: false
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-EUXYb3gyQ2EzpDAWkgfoDl1EPabj3OE6+zntsD/gwvzQU85BTocs10ksnRyS55bfrQpYbf+Z+gw2CZboyagLgg==}
+ dev: false
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-WWpdORiEvOl3/71xFghfEwid7ptgm9U6OxoJm8hU9e5xNuj80k2B+t4sv/iVnz872UuI5xXJqamzCqGVTblPlg==}
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-e+PPbP9XWHmJNBRpbDFRn40lv7QiMTA0jhggp9bPgdBUIcRU1qh4yVP/nsWhKMMGBL4aAZUfK0dllWS0rvhV8g==}
+ dependencies:
+ '@aw-web-design/x-default-browser': 1.4.126
+ '@discoveryjs/json-ext': 0.5.7
+ '@storybook/builder-manager': 7.2.3
+ '@storybook/channels': 7.2.3
+ '@storybook/core-common': 7.2.3
+ '@storybook/core-events': 7.2.3
+ '@storybook/csf': 0.1.0
+ '@storybook/csf-tools': 7.2.3
+ '@storybook/docs-mdx': 0.1.0
+ '@storybook/global': 5.0.0
+ '@storybook/manager': 7.2.3
+ '@storybook/node-logger': 7.2.3
+ '@storybook/preview-api': 7.2.3
+ '@storybook/telemetry': 7.2.3
+ '@storybook/types': 7.2.3
+ '@types/detect-port': 1.3.3
+ '@types/node': 16.18.36
+ '@types/pretty-hrtime': 1.0.1
+ '@types/semver': 7.3.13
+ better-opn: 3.0.2
+ chalk: 4.1.2
+ cli-table3: 0.6.3
+ compression: 1.7.4
+ detect-port: 1.5.1
+ express: 4.18.2
+ fs-extra: 11.1.1
+ globby: 11.1.0
+ ip: 2.0.0
+ lodash: 4.17.21
+ open: 8.4.2
+ pretty-hrtime: 1.0.3
+ prompts: 2.4.2
+ read-pkg-up: 7.0.1
+ semver: 7.5.4
+ serve-favicon: 2.5.0
+ telejson: 7.1.0
+ tiny-invariant: 1.3.1
+ ts-dedent: 2.2.0
+ util: 0.12.5
+ util-deprecate: 1.0.2
+ watchpack: 2.4.0
+ ws: 8.13.0
+ transitivePeerDependencies:
+ - bufferutil
+ - encoding
+ - supports-color
+ - utf-8-validate
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-qi2S0oh2I8kJIFwjpA/Cf6ZeKuE2CuxNtI5JdHcTBILLuTmAj0/SEn+IAexsLlhhcXN9rpFcdYD1G1o4SnrMWw==}
+ dependencies:
+ '@storybook/csf-tools': 7.2.3
+ unplugin: 1.4.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-OitxpUBbQgs5EguqHCam0j27j1rpBj7cpFyS4zygc/bNaoxkNk7dRUP0JI9RoUa1a162v6koLx9UZhl9Cbsf1Q==}
+ dependencies:
+ '@babel/generator': 7.22.9
+ '@babel/parser': 7.22.7
+ '@babel/traverse': 7.22.8
+ '@babel/types': 7.22.5
+ '@storybook/csf': 0.1.0
+ '@storybook/types': 7.2.3
+ fs-extra: 11.1.1
+ recast: 0.23.2
+ ts-dedent: 2.2.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-USTLkZze5gkel8MYCujSRBVIrUQ3YPBrLOx7GNk/0wttvVtlzWXAq9eLbQ4p/NicGxP+3T7KPEMVV//g+yubpw==}
+ dependencies:
+ lodash: 4.17.21
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-uk+jMXCZ8t38jSTHk2o5btI+aV2Ksbvl6DoOv3r6VaCM1KZqeuMwtwywIQdflkA8/6q/dKT8z8L+g8hC4GC3VQ==}
+ dependencies:
+ type-fest: 2.19.0
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-JDaBR9lwVY4eSH5W8EGHrhODjygPd6QImRbwjAuJNEnY0Vw4ie3bPkeGfnacB3OBW6u/agqPv2aRlR46JcAQLg==}
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-wKuzKaEUzehAw6Y1aJcAK8iSchLPN9J6hCMjfPSjVhyt9nEbcHKxlc/7BADL0hPL0/yl6eZZcLvWZLA7dmOB2Q==}
+ dependencies:
+ '@storybook/core-common': 7.2.3
+ '@storybook/preview-api': 7.2.3
+ '@storybook/types': 7.2.3
+ '@types/doctrine': 0.0.3
+ doctrine: 3.0.0
+ lodash: 4.17.21
+ transitivePeerDependencies:
+ - encoding
+ - supports-color
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-FcOqPAXACP0I3oJ/ws6/rrPT9WGhu915Cg8D02a9YxLo0DE9zI+a9A5gRGvmQ09fiWPukqI8ZAEoQEdWUKMQdQ==}
+
+ resolution: {integrity: sha512-PWJIaa/NtOu2VSWnj07evF1OI5+6H7ZTAvy0LO38RheW4W8iS+xoYsh2cr/nxLBblfhbw533uJrhdqpxCytxfA==}
+ engines: {node: '>=14.0.0'}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-OimpXBKrwuWu17eSE23c7GLkGRq5PpVyH4EetwQT+nuhsUM+MeOWf1+LnT7FgLkcpH50T46sTeD+bgYZo1/s2Q==}
+ dependencies:
+ '@storybook/channels': 7.2.3
+ '@storybook/client-logger': 7.2.3
+ '@storybook/core-events': 7.2.3
+ '@storybook/global': 5.0.0
+ '@storybook/preview-api': 7.2.3
+ dev: true
+
+ resolution: {integrity: sha512-3QXARtxpc6Xxqf5pviUw2UuhK53+IsINSljeWhAqdQ1Gzbywl67TpibTd7xVN6NKxhUH5Bzo9bIZTAzMZGqaKw==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ '@storybook/channels': 7.0.12
+ '@storybook/client-logger': 7.0.12
+ '@storybook/core-events': 7.0.12
+ '@storybook/csf': 0.1.0
+ '@storybook/global': 5.0.0
+ '@storybook/router': 7.0.12([email protected])([email protected])
+ '@storybook/theming': 7.0.12([email protected])([email protected])
+ '@storybook/types': 7.0.12
+ dequal: 2.0.3
+ lodash: 4.17.21
+ memoizerific: 1.11.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ semver: 7.5.4
+ store2: 2.14.2
+ telejson: 7.1.0
+ ts-dedent: 2.2.0
+ dev: false
+
+ resolution: {integrity: sha512-jRuYTrsNKq+g1u9kbQRvBsRKVITOdiNu9c633MeCH73oBVo8WNnZF/tW/ER86oTnru0H7EmRdgz3v9ft/wS2GQ==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ '@storybook/channels': 7.2.1
+ '@storybook/client-logger': 7.2.1
+ '@storybook/core-events': 7.2.1
+ '@storybook/csf': 0.1.0
+ '@storybook/global': 5.0.0
+ '@storybook/router': 7.2.1([email protected])([email protected])
+ '@storybook/theming': 7.2.1([email protected])([email protected])
+ '@storybook/types': 7.2.1
+ dequal: 2.0.3
+ lodash: 4.17.21
+ memoizerific: 1.11.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ semver: 7.5.4
+ store2: 2.14.2
+ telejson: 7.1.0
+ ts-dedent: 2.2.0
+ dev: false
+
+ resolution: {integrity: sha512-HxeHcJow6BdCtqi7Ew52iwwP+dgSBzxXBSPpIw1uQXWfYlTp9ZHJYTF1IXM7+AmvJ8NWBfplF6N/QzuMs9Ij9A==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ '@storybook/channels': 7.2.3
+ '@storybook/client-logger': 7.2.3
+ '@storybook/core-events': 7.2.3
+ '@storybook/csf': 0.1.0
+ '@storybook/global': 5.0.0
+ '@storybook/router': 7.2.3([email protected])([email protected])
+ '@storybook/theming': 7.2.3([email protected])([email protected])
+ '@storybook/types': 7.2.3
+ dequal: 2.0.3
+ lodash: 4.17.21
+ memoizerific: 1.11.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ semver: 7.5.4
+ store2: 2.14.2
+ telejson: 7.1.0
+ ts-dedent: 2.2.0
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-i8HfB00GU7Mlua2HXjUp5phVdcTlHE9iwLJc217oCWnQ5377J7VW4ADMDYNLN/CzfAwwZZSVLCRc1wRG1KblUQ==}
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-TXJJd5RAKakWx4BtpwvSNdgTDkKM6RkXU8GK34S/LhidQ5Pjz3wcnqb0TxEkfhK/ztbP8nKHqXFwLfa2CYkvQw==}
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-Ywjqi8iAc26RYbZfmpzvzdKbaQZaD1T/IRNfVGReM/jTXnX0VSdsa6P/pfurbyHcQw//D3TSdqRHOMtbp0nIJg==}
+ dev: false
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-7oUDf3kNtUXn04tMscvUVb9joYT11vPN25OAoCoLVP/qvED1EdDmAaNC2MzBzCatzGmto67aGbY5F4gjC+sY1w==}
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-PHjlekGZmkAc/sAOm+KR+FRmv0v9GO1VHSGk+aw6Hj0DPQk7LyGdfpwbsVmGSgohIaJQNA8GUGlUSxU5bFLdPQ==}
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-WKecuOdeh9+og6bPR9KoQf/JCeSRPCcfZv9uNfJzAp3IiTnS3UpfCz+HBZzZJQrisgbd7OulNY400HQUmxY2Ag==}
+ dependencies:
+ '@storybook/channels': 7.2.1
+ '@storybook/client-logger': 7.2.1
+ '@storybook/core-events': 7.2.1
+ '@storybook/csf': 0.1.0
+ '@storybook/global': 5.0.0
+ '@storybook/types': 7.2.1
+ '@types/qs': 6.9.7
+ dequal: 2.0.3
+ lodash: 4.17.21
+ memoizerific: 1.11.3
+ qs: 6.11.2
+ synchronous-promise: 2.0.17
+ ts-dedent: 2.2.0
+ util-deprecate: 1.0.2
+ dev: false
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-B09hkWJUKd5TarkZos0cX75lm64iOYOep7LS/Ew42CfIHlle27VYIknHWnvjWrhiy9TSQ39PlvX1neIL02QqZg==}
+ dependencies:
+ '@storybook/channels': 7.2.3
+ '@storybook/client-logger': 7.2.3
+ '@storybook/core-events': 7.2.3
+ '@storybook/csf': 0.1.0
+ '@storybook/global': 5.0.0
+ '@storybook/types': 7.2.3
+ '@types/qs': 6.9.7
+ dequal: 2.0.3
+ lodash: 4.17.21
+ memoizerific: 1.11.3
+ qs: 6.11.2
+ synchronous-promise: 2.0.17
+ ts-dedent: 2.2.0
+ util-deprecate: 1.0.2
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-ziBwfI4xYG132SC7CqxvveAzjFOgVC17xNBNT56rjq7KlkJRrqfb4yfC1dzLgf0spKWzxGteuA61qeBA83foAg==}
+ dev: true
+
+ resolution: {integrity: sha512-a7pcW0xZWs7uCztvGVXDMTIgYTCgPEnWvmBXgVjk3cE7FF73+C4x8Fozie4QBS2+vQnFvJMPL6Vz1zBsPcJDkg==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: true
+
+ resolution: {integrity: sha512-ERQbMLkdy7uqdcD3viGmtFs34lMjKxRpVQwwWJkB93Jj/zaAfn/xYVU0yoog9/it/Vjb2dcGt4fp1YpuFQYxoA==}
+ engines: {node: '>=16'}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ vite: ^3.0.0 || ^4.0.0
+ dependencies:
+ '@joshwooding/vite-plugin-react-docgen-typescript': 0.2.1([email protected])([email protected])
+ '@rollup/pluginutils': 5.0.2
+ '@storybook/builder-vite': 7.2.3([email protected])([email protected])
+ '@vitejs/plugin-react': 3.1.0([email protected])
+ ast-types: 0.14.2
+ magic-string: 0.30.1
+ react: 18.2.0
+ react-docgen: 6.0.0-alpha.3
+ react-dom: 18.2.0([email protected])
+ vite: 4.4.9(@types/[email protected])([email protected])
+ transitivePeerDependencies:
+ - '@preact/preset-vite'
+ - encoding
+ - rollup
+ - supports-color
+ - typescript
+ - vite-plugin-glimmerx
+ dev: true
+
+ resolution: {integrity: sha512-DM/CaCR0utFSHEu2aMvr28lXAsZUudVvLDfDWmF8vaL7xgr9IHUsHbiDOBRcSd14Rw9Ce5llJaMPX/hAc7NkIQ==}
+ engines: {node: '>=16.0.0'}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ dependencies:
+ '@storybook/client-logger': 7.2.3
+ '@storybook/core-client': 7.2.3
+ '@storybook/docs-tools': 7.2.3
+ '@storybook/global': 5.0.0
+ '@storybook/preview-api': 7.2.3
+ '@storybook/react-dom-shim': 7.2.3([email protected])([email protected])
+ '@storybook/types': 7.2.3
+ '@types/escodegen': 0.0.6
+ '@types/estree': 0.0.51
+ '@types/node': 16.18.36
+ acorn: 7.4.1
+ acorn-jsx: 5.3.2([email protected])
+ acorn-walk: 7.2.0
+ escodegen: 2.0.0
+ html-tags: 3.3.1
+ lodash: 4.17.21
+ prop-types: 15.8.1
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ react-element-to-jsx-string: 15.0.0([email protected])([email protected])
+ ts-dedent: 2.2.0
+ type-fest: 2.19.0
+ typescript: 5.1.6
+ util-deprecate: 1.0.2
+ transitivePeerDependencies:
+ - encoding
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-dOtBiCBGeDem86BCWR7AlTVQjoBk0yw/XZLXS9qcpUfpe+UDjd0Rh21ZdEEMHG1Wfu4d2AhhG5l/JSJ1IE83jQ==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ '@storybook/client-logger': 7.0.12
+ memoizerific: 1.11.3
+ qs: 6.11.2
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-9Cn5boUS+7yhrKlSy1kt7ruNs/znk3555kclBD6+uuhH/dD84feGeiGYE4GUuLmcKrDFtNF185/Gr1huJ556tA==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ '@storybook/client-logger': 7.2.1
+ memoizerific: 1.11.3
+ qs: 6.11.2
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-C9fRwpHFce1MIJkDPjTGlYNBlL3qdXym/5htayUlq849mSrUnZHCDry0pRkv6oUL2bQ8AbTT7wNalNwJDeTAHw==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ '@storybook/client-logger': 7.2.3
+ memoizerific: 1.11.3
+ qs: 6.11.2
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-cqsLkPgwvvW3oZD5DuXFovfDYJPbqxwH1OI2SzF3lLP1NBQS+ufhp1PinfyrWQ2lTSuf9aFroBbr5GwpLHCwsg==}
+ dependencies:
+ '@storybook/client-logger': 7.2.3
+ '@storybook/core-common': 7.2.3
+ '@storybook/csf-tools': 7.2.3
+ chalk: 4.1.2
+ detect-package-manager: 2.0.1
+ fetch-retry: 5.0.6
+ fs-extra: 11.1.1
+ read-pkg-up: 7.0.1
+ transitivePeerDependencies:
+ - encoding
+ - supports-color
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-Ff6jNnrsosmDshgCf0Eb5Cz7IA34p/1Ps5N3Kp3598kfXpBSccSkQQvVFUXC3kIHw/isIXWPqntZuKqnWUz7Gw==}
+ dependencies:
+ '@testing-library/dom': 9.3.0
+ '@testing-library/user-event': 14.4.3(@testing-library/[email protected])
+ ts-dedent: 2.2.0
+ dev: true
+
+ resolution: {integrity: sha512-frBkvH7LF8j23ODaywLK4m4LLscw49oKblkZ+30QZkBAzRf2o3a/QSZW2V1zfBo7ygcXiUJ5bIjh7Y17mMJqbQ==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ '@emotion/use-insertion-effect-with-fallbacks': 1.0.1([email protected])
+ '@storybook/client-logger': 7.0.12
+ '@storybook/global': 5.0.0
+ memoizerific: 1.11.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-cfnNCLvKmzxjmoYKfLl7Q64gSTouLvd23CtvBAOlWcRYnMJ9v4/7A2tK3xQyVRlJYh9OuXiHFLL8AXbN58Hkzw==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ '@emotion/use-insertion-effect-with-fallbacks': 1.0.1([email protected])
+ '@storybook/client-logger': 7.2.1
+ '@storybook/global': 5.0.0
+ memoizerific: 1.11.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-rSvBGAvuN/VdhcHh6LdeQJoIGf8fZuvY+57IYt7Vc04bASyjDl41hMRkjIB1Sbcfj7gF+OrH6G8Fc4PvvT3gyQ==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ '@emotion/use-insertion-effect-with-fallbacks': 1.0.1([email protected])
+ '@storybook/client-logger': 7.2.3
+ '@storybook/global': 5.0.0
+ memoizerific: 1.11.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: true
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-nlvU4MyO2grwPCRQ8alA3AnY1bQxGJ6A4QgJu+1MhtjVenifFlxOQX4H1OiA+YXfjlV096oO5LrxvetJPFAKKQ==}
+ dependencies:
+ '@storybook/channels': 7.0.12
+ '@types/babel__core': 7.20.0
+ '@types/express': 4.17.17
+ file-system-cache: 2.3.0
+ dev: false
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-YwlIY1uyxfJjijbB5x1d1QOKaUUDJnMX8BSb8oGqU4cyT76X/Is4CbGs+vccFsJo0tZu1GfuahYXl0EDT0nnSQ==}
+ dependencies:
+ '@storybook/channels': 7.2.1
+ '@types/babel__core': 7.20.0
+ '@types/express': 4.17.17
+ file-system-cache: 2.3.0
+ dev: false
+
+ /@storybook/[email protected]:
+ resolution: {integrity: sha512-g/82OoTfQ/6moYS9/cLWx5ybn1oOOEhWtsVabsgNS+NHDC2II7o4Gu4xPno2Ql60ThAdB+EQQeLsnSotWsAgCw==}
+ dependencies:
+ '@storybook/channels': 7.2.3
+ '@types/babel__core': 7.20.0
+ '@types/express': 4.17.17
+ file-system-cache: 2.3.0
+ dev: true
+
+ resolution: {integrity: sha512-MmGilibITz68LEje6vJlKzc2gUUSgzvB3wGLSjEORikTNeM7P8jXVxE4A8fgZqDeudJUm9HVWrxCV+pHDSwXhA==}
+ engines: {node: '>=10'}
+ cpu: [arm64]
+ os: [darwin]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ resolution: {integrity: sha512-Xl93MMB3sCWVlYWuQIB+v6EQgzoiuQYK5tNt9lsHoIEVu2zLdkQjae+5FUHZb1VYqCXIiWcULFfVz0R4Sjb7JQ==}
+ engines: {node: '>=10'}
+ cpu: [x64]
+ os: [darwin]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ resolution: {integrity: sha512-nJsp6O7kCtAjTTMcIjVB0g5y1JNiYAa5q630eiwrnaHUusEFoANDdORI3Z9vXeikMkng+6yIv9/V8Rb093xLjQ==}
+ engines: {node: '>=10'}
+ cpu: [arm]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ resolution: {integrity: sha512-XGsV93vpUAopDt5y6vPwbK1Nc/MlL55L77bAZUPIiosWD1cWWPHNtNSpriE6+I+JiMHe0pqtfS/SSTk6ZkFQVw==}
+ engines: {node: '>=10'}
+ cpu: [arm64]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ resolution: {integrity: sha512-ESUmJjSlTTkoBy9dMG49opcNn8BmviqStMhwyeD1G8XRnmRVCZZgoBOKdvCXmJhw8bQXDhZumeaTUB+OFUKVXg==}
+ engines: {node: '>=10'}
+ cpu: [arm64]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ resolution: {integrity: sha512-wnHJkt3ZBrax3SFnUHDcncG6mrSg9ZZjMhQV9Mc3JL1x1s1Gy9rGZCoBNnV/BUZWTemxIBcQbANRSDut/WO+9A==}
+ engines: {node: '>=10'}
+ cpu: [x64]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ resolution: {integrity: sha512-9oRbuTC/VshB66Rgwi3pTq3sPxSTIb8k9L1vJjES+dDMKa29DAjPtWCXG/pyZ00ufpFZgkGEuAHH5uqUcr1JQg==}
+ engines: {node: '>=10'}
+ cpu: [x64]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ resolution: {integrity: sha512-zv14vlF2VRrxS061XkfzGjCYnOrEo5glKJjLK5PwUKysIoVrx/L8nAbFxjkX5cObdlyoqo+ekelyBPAO+4bS0w==}
+ engines: {node: '>=10'}
+ cpu: [arm64]
+ os: [win32]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ resolution: {integrity: sha512-8MC/PZQSsOP2iA/81tAfNRqMWyEqTS/8zKUI67vPuLvpx6NAjRn3E9qBv7iFqH79iqZNzqSMo3awnLrKZyFbcw==}
+ engines: {node: '>=10'}
+ cpu: [ia32]
+ os: [win32]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ resolution: {integrity: sha512-GJSmUJ95HKHZXAxiuPUmrcm/S3ivQvEzXhOZaIqYBIwUsm02vFZkClsV7eIKzWjso1t0+I/8MjrnUNaSWqh1rQ==}
+ engines: {node: '>=10'}
+ cpu: [x64]
+ os: [win32]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ resolution: {integrity: sha512-J58hWY+/G8vOr4J6ZH9hLg0lMSijZtqIIf4HofZezGog/pVX6sJyBJ40dZ1ploFkDIlWTWvJyqtpesBKS73gkQ==}
+ engines: {node: '>=10'}
+ requiresBuild: true
+ peerDependencies:
+ '@swc/helpers': ^0.5.0
+ peerDependenciesMeta:
+ '@swc/helpers':
+ optional: true
+ optionalDependencies:
+ '@swc/core-darwin-arm64': 1.3.62
+ '@swc/core-darwin-x64': 1.3.62
+ '@swc/core-linux-arm-gnueabihf': 1.3.62
+ '@swc/core-linux-arm64-gnu': 1.3.62
+ '@swc/core-linux-arm64-musl': 1.3.62
+ '@swc/core-linux-x64-gnu': 1.3.62
+ '@swc/core-linux-x64-musl': 1.3.62
+ '@swc/core-win32-arm64-msvc': 1.3.62
+ '@swc/core-win32-ia32-msvc': 1.3.62
+ '@swc/core-win32-x64-msvc': 1.3.62
+ dev: true
+
+ resolution: {integrity: sha512-Ng9rdm3JPoSCi6cVZvANsYnF+UoGVRxflMb270tVj0+LjeT/ZtZ9ckxF6oLPLcKesza6VKBqtdF9mQ+vaz24Aw==}
+ engines: {node: '>=12'}
+ peerDependencies:
+ react: '>=16'
+ react-dom: '>=16'
+ dependencies:
+ '@tanstack/table-core': 8.9.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ /@tanstack/[email protected]:
+ resolution: {integrity: sha512-NpHZBoHTfqyJk0m/s/+CSuAiwtebhYK90mDuf5eylTvgViNOujiaOaxNDxJkQQAsVvHWZftUGAx1EfO1rkKtLg==}
+ engines: {node: '>=12'}
+ dev: false
+
+ /@testing-library/[email protected]:
+ resolution: {integrity: sha512-Dffe68pGwI6WlLRYR2I0piIkyole9cSBH5jGQKCGMRpHW5RHCqAUaqc2Kv0tUyd4dU4DLPKhJIjyKOnjv4tuUw==}
+ engines: {node: '>=14'}
+ dependencies:
+ '@babel/code-frame': 7.21.4
+ '@babel/runtime': 7.22.5
+ '@types/aria-query': 5.0.1
+ aria-query: 5.1.3
+ chalk: 4.1.2
+ dom-accessibility-api: 0.5.12
+ lz-string: 1.5.0
+ pretty-format: 27.5.1
+ dev: true
+
+ /@testing-library/[email protected]:
+ resolution: {integrity: sha512-ynmNeT7asXyH3aSVv4vvX4Rb+0qjOhdNHnO/3vuZNqPmhDpV/+rCSGwQ7bLcmU2cJ4dvoheIO85LQj0IbJHEtg==}
+ engines: {node: '>=8', npm: '>=6', yarn: '>=1'}
+ dependencies:
+ '@adobe/css-tools': 4.2.0
+ '@babel/runtime': 7.22.5
+ '@types/testing-library__jest-dom': 5.14.2
+ aria-query: 5.1.3
+ chalk: 3.0.0
+ css.escape: 1.5.1
+ dom-accessibility-api: 0.5.12
+ lodash: 4.17.21
+ redent: 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-S04gSNJbYE30TlIMLTzv6QCTzt9AqIF5y6s6SzVFILNcNvbV/jU96GeiTPillGQo+Ny64M/5PV7klNYYgv5Dfg==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ react: ^18.0.0
+ react-dom: ^18.0.0
+ dependencies:
+ '@babel/runtime': 7.21.0
+ '@testing-library/dom': 9.3.0
+ '@types/react-dom': 18.2.7
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: true
+
+ /@testing-library/[email protected](@testing-library/[email protected]):
+ resolution: {integrity: sha512-kCUc5MEwaEMakkO5x7aoD+DLi02ehmEM2QCGWvNqAS1dV/fAvORWEjnjsEIvml59M7Y5kCkWN6fCCyPOe8OL6Q==}
+ engines: {node: '>=12', npm: '>=6'}
+ peerDependencies:
+ '@testing-library/dom': '>=7.21.4'
+ dependencies:
+ '@testing-library/dom': 9.3.0
+ dev: true
+
+ resolution: {integrity: sha512-eaYwufnvQhlbdeWdqhERdp4yOKp2bILiMOGKIRBFoFpg3ry6L06GcdNFffe15C8T+2F/vUUEtLVpZ9i5f8NUrw==}
+ peerDependencies:
+ '@emotion/react': ^11
+ '@emotion/styled': ^11
+ '@mui/material': ^5
+ react: ^17 || ^18
+ react-dom: ^17 || ^18
+ dependencies:
+ '@emotion/react': 11.11.1(@types/[email protected])([email protected])
+ '@emotion/styled': 11.11.0(@emotion/[email protected])(@types/[email protected])([email protected])
+ '@mui/material': 5.13.6(@emotion/[email protected])(@emotion/[email protected])(@types/[email protected])([email protected])([email protected])
+ clsx: 1.2.1
+ copy-to-clipboard: 3.3.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ zustand: 4.3.8([email protected])
+ transitivePeerDependencies:
+ - immer
+ dev: false
+
+ /@tootallnate/[email protected]:
+ resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==}
+ engines: {node: '>= 10'}
+ dev: true
+
+ /@trysound/[email protected]:
+ resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==}
+ engines: {node: '>=10.13.0'}
+ dev: false
+
+ resolution: {integrity: sha512-XTIieEY+gvJ39ChLcB4If5zHtPxt3Syj5rgZR+e1ctpmK8NjPf0zFqsz4JpLJT0xla9GFDKjy8Cpu331nrmE1Q==}
+ dev: true
+
+ resolution: {integrity: sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ==}
+ dependencies:
+ '@babel/parser': 7.22.7
+ '@babel/types': 7.22.5
+ '@types/babel__generator': 7.6.4
+ '@types/babel__template': 7.4.1
+ '@types/babel__traverse': 7.18.5
+
+ resolution: {integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==}
+ dependencies:
+ '@babel/types': 7.22.5
+
+ resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==}
+ dependencies:
+ '@babel/parser': 7.22.7
+ '@babel/types': 7.22.5
+
+ resolution: {integrity: sha512-enCvTL8m/EHS/zIvJno9nE+ndYPh1/oNFzRYRmtUqJICG2VnCSBzMLW5VN2KCQU91f23tsNKR8v7VJJQMatl7Q==}
+ dependencies:
+ '@babel/types': 7.22.5
+
+ resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==}
+ dependencies:
+ '@types/connect': 3.4.35
+ '@types/node': 17.0.19
+
+ resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==}
+ dependencies:
+ '@types/chai': 4.3.5
+ dev: true
+
+ resolution: {integrity: sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==}
+ dev: true
+
+ resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==}
+ dependencies:
+ '@types/node': 17.0.19
+
+ resolution: {integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==}
+ dev: true
+
+ resolution: {integrity: sha512-KuwNhp3eza+Rhu8IFI5HUXRP0LIhqH5cAjubUvGXXthh4YYBuP2ntwEX+Cz8GJoZUHlKo247wPWOfA9LYEq4cw==}
+ dependencies:
+ '@types/node': 17.0.19
+ dev: true
+
+ resolution: {integrity: sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==}
+ dependencies:
+ '@types/ms': 0.7.31
+ dev: true
+
+ resolution: {integrity: sha512-bV/jQlAJ/nPY3XqSatkGpu+nGzou+uSwrH1cROhn+jBFg47yaNH+blW4C7p9KhopC7QxCv/6M86s37k8dMk0Yg==}
+ dev: true
+
+ resolution: {integrity: sha512-w5jZ0ee+HaPOaX25X2/2oGR/7rgAQSYII7X7pp0m9KgBfMP7uKfMfTvcpl5Dj+eDBbpxKGiqE+flqDr6XTd2RA==}
+ dev: true
+
+ resolution: {integrity: sha512-ZmiaE3wglXVWBM9fyVC17aGPkLo/UgaOjEiI2FXQfyczrCefORPxIe+2dVmnmk3zkVIbizjrlQzmPGhSYGXG5g==}
+ dev: true
+
+ resolution: {integrity: sha512-H90aoynNhhkQP6DRweEjJp5vfUVdIj7tdPLsu7pq89vODD/lcugKfZOsfgwpvM6XUewEp2N5dCg1Uf3Qe55Dcg==}
+ dev: true
+
+ resolution: {integrity: sha512-AjwI4MvWx3HAOaZqYsjKWyEObT9lcVV0Y0V8nXo6cXzN8ZiMxVhf6F3d/UNvXVGKrEzL/Dluc5p+y9GkzlTWig==}
+ dev: true
+
+ resolution: {integrity: sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==}
+ dependencies:
+ '@types/eslint': 8.40.2
+ '@types/estree': 1.0.1
+ dev: false
+
+ resolution: {integrity: sha512-PRVjQ4Eh9z9pmmtaq8nTjZjQwKFk7YIHIud3lRoKRBgUQjgjRmoGxxGEPXQkF+lH7QkHJRNr5F4aBgYCW0lqpQ==}
+ dependencies:
+ '@types/estree': 1.0.1
+ '@types/json-schema': 7.0.9
+ dev: false
+
+ resolution: {integrity: sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==}
+ dev: true
+
+ resolution: {integrity: sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==}
+
+ resolution: {integrity: sha512-wALWQwrgiB2AWTT91CB62b6Yt0sNHpznUXeZEcnPU3DRdlDIz74x8Qg1UUYKSVFi+va5vKOLYRBI1bRKiLLKIg==}
+ dependencies:
+ '@types/node': 17.0.19
+ '@types/qs': 6.9.7
+ '@types/range-parser': 1.2.4
+ '@types/send': 0.17.1
+
+ resolution: {integrity: sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==}
+ dependencies:
+ '@types/body-parser': 1.19.2
+ '@types/express-serve-static-core': 4.17.35
+ '@types/qs': 6.9.7
+ '@types/serve-static': 1.15.1
+
+ resolution: {integrity: sha512-frsJrz2t/CeGifcu/6uRo4b+SzAwT4NYCVPu1GN8IB9XTzrpPkGuV0tmh9mN+/L0PklAlsC3u5Fxt0ju00LXIw==}
+
+ resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==}
+ dependencies:
+ '@types/minimatch': 5.1.2
+ '@types/node': 17.0.19
+ dev: true
+
+ resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==}
+ dependencies:
+ '@types/node': 17.0.19
+ dev: true
+
+ resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==}
+ dev: true
+
+ resolution: {integrity: sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==}
+ dependencies:
+ '@types/istanbul-lib-coverage': 2.0.4
+ dev: true
+
+ resolution: {integrity: sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==}
+ dependencies:
+ '@types/istanbul-lib-report': 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-gHl8XuC1RZ8H2j5sHv/JqsaxXkDDM9iDOgu0Wp8sjs4u/snb2PVehyWXJPr+ORA0RPpgw231mnutWI1+0hgjIQ==}
+ dependencies:
+ jest-diff: 27.5.1
+ pretty-format: 27.5.1
+ dev: true
+
+ resolution: {integrity: sha512-qC4bCqYGy1y/NP7dDVr7KJarn+PbX1nSpwA7JXdu0HxT3QYjO8MJ+cntENtHFVy2dRAyBV23OZ6MxsW1AM1L8g==}
+ dev: true
+
+ resolution: {integrity: sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==}
+
+ resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}
+ dev: true
+
+ resolution: {integrity: sha512-dHsSjSlU/EWEEbeNADr3FtZZOAXPkFPUO457QCnoNqcZQXNqNEu/svQd0Nritvd3wNff4vvC/f4e6xgX3Llt8A==}
+ dev: true
+
+ resolution: {integrity: sha512-r22s9tAS7imvBt2lyHC9B8AGwWnXaYb1tY09oyLkXDs4vArpYJzw09nj8MLx5VfciBPGIb+ZwG0ssYnEPJxn/g==}
+ dev: true
+
+ resolution: {integrity: sha512-76CqzuD6Q7LC+AtbPqrvD9AqsN0k8bsYo2bM2J8pmNldP1aIPAbzUQ7QbobyXL4eLr1wK5x8FZFe8eF/ubRuBg==}
+ dev: true
+
+ resolution: {integrity: sha512-vXOTGVSLR2jMw440moWTC7H19iUyLtP3Z1YTj7cSsubOICinjMxFeb/V57v9QdyyPGbbWolUFSSmSiRSn94tFw==}
+ dev: true
+
+ resolution: {integrity: sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==}
+
+ resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==}
+ dev: true
+
+ resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==}
+ dev: true
+
+ resolution: {integrity: sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==}
+ dev: true
+
+ resolution: {integrity: sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==}
+ dependencies:
+ '@types/node': 17.0.19
+ form-data: 3.0.1
+
+ resolution: {integrity: sha512-8egDX8dE50XyXWH6C6PRCNkTP106DuUrvdrednFouDSmCi7IOvrqr0frznfZaHifHH/3aq/7a7v9N4wdXMqhBQ==}
+
+ resolution: {integrity: sha512-PfeQhvcMR4cPFVuYfBN4ifG7p9c+Dlh3yUZR6k+5yQK7wX3gDgVxBly4/WkBRs9x4dmcy1TVl08SY67wwtEvmA==}
+
+ resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==}
+ dev: true
+
+ resolution: {integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==}
+
+ resolution: {integrity: sha512-VjID5MJb1eGKthz2qUerWT8+R4b9N+CHvGCzg9fn4kWZgaF9AhdYikQio3R7wV8YY1NsQKPaCwKz1Yff+aHNUQ==}
+
+ resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==}
+
+ resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==}
+
+ resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==}
+
+ resolution: {integrity: sha512-GRaAEriuT4zp9N4p1i8BDBYmEyfo+xQ3yHjJU4eiK5NDa1RmUZG+unZABUTK4/Ox/M+GaHwb6Ow8rUITrtjszA==}
+ dependencies:
+ '@types/react': 18.2.19
+
+ resolution: {integrity: sha512-wyUkmaaSZEzFZivD8F2ftSyAfk6L+DfFliVj/mYdOXbVjRcS87fQJLTnhk6dRZPuJjI+9g6RZJO4PNCngUrmyw==}
+ dependencies:
+ '@types/react': 18.2.19
+ dev: false
+
+ resolution: {integrity: sha512-VnCdSxfcm08KjsJVQcfBmhEQAPnLB8G08hAxn39azX1qYBQ/5RVQuoHuKIcfKOdncuaUvEpFKFzEvbtIMsfVew==}
+ dependencies:
+ '@types/react': 18.2.19
+ dev: false
+
+ resolution: {integrity: sha512-e2S8wmY1ePfM517PqCG80CcE48Xs5k0pwJzuDZsfE8IZRRBfOMCF+XqnFxu6mWtyivum1MQm4aco+WIt6Coimw==}
+ dependencies:
+ '@types/prop-types': 15.7.5
+ '@types/scheduler': 0.16.2
+ csstype: 3.1.2
+
+ resolution: {integrity: sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==}
+
+ resolution: {integrity: sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==}
+ dev: true
+
+ resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==}
+ dependencies:
+ '@types/mime': 1.3.2
+ '@types/node': 17.0.19
+
+ resolution: {integrity: sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==}
+ dependencies:
+ '@types/mime': 1.3.2
+ '@types/node': 17.0.19
+
+ resolution: {integrity: sha512-fBZgytwhYAUkj/jC/FAV4RQ5EerRup1YQsXQCh8rZfiHkc4UahC192oH0smGwsXol3cL3A5oETuAHeQHmhXM4w==}
+ dependencies:
+ '@types/node': 17.0.19
+ dev: true
+
+ resolution: {integrity: sha512-vehbtyHUShPxIa9SioxDwCvgxukDMH//icJG90sXQBUm5lJOHLT5kNeU9tnivhnA/TkOFMzGIXN2cTc4hY8/kg==}
+ dependencies:
+ '@types/jest': 27.4.0
+ dev: true
+
+ resolution: {integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==}
+ dev: true
+
+ resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==}
+ dev: true
+
+ resolution: {integrity: sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==}
+ dependencies:
+ '@types/yargs-parser': 21.0.0
+ dev: true
+
+ resolution: {integrity: sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==}
+ dependencies:
+ '@types/yargs-parser': 21.0.0
+ dev: true
+
+ /@typescript-eslint/[email protected](@typescript-eslint/[email protected])([email protected])([email protected]):
+ resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ '@typescript-eslint/parser': ^5.0.0
+ eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ dependencies:
+ '@eslint-community/regexpp': 4.5.1
+ '@typescript-eslint/parser': 5.62.0([email protected])([email protected])
+ '@typescript-eslint/scope-manager': 5.62.0
+ '@typescript-eslint/type-utils': 5.62.0([email protected])([email protected])
+ '@typescript-eslint/utils': 5.62.0([email protected])([email protected])
+ debug: 4.3.4
+ eslint: 8.46.0
+ graphemer: 1.4.0
+ ignore: 5.2.0
+ natural-compare-lite: 1.4.0
+ semver: 7.5.1
+ tsutils: 3.21.0([email protected])
+ typescript: 5.1.6
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-H4fqOVYiH6R15NjtMO2LVBZgzXgzjdPEXYb7x/meg4QbXsptLxdq8YlHK2NZOFKipuInY4sAPY5a6SQ/53s3dw==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
+ dependencies:
+ '@typescript-eslint/utils': 5.29.0([email protected])([email protected])
+ eslint: 8.46.0
+ transitivePeerDependencies:
+ - supports-color
+ - typescript
+ dev: true
+
+ resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ dependencies:
+ '@typescript-eslint/scope-manager': 5.62.0
+ '@typescript-eslint/types': 5.62.0
+ '@typescript-eslint/typescript-estree': 5.62.0([email protected])
+ debug: 4.3.4
+ eslint: 8.46.0
+ typescript: 5.1.6
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ /@typescript-eslint/[email protected]:
+ resolution: {integrity: sha512-etbXUT0FygFi2ihcxDZjz21LtC+Eps9V2xVx09zFoN44RRHPrkMflidGMI+2dUs821zR1tDS6Oc9IXxIjOUZwA==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dependencies:
+ '@typescript-eslint/types': 5.29.0
+ '@typescript-eslint/visitor-keys': 5.29.0
+ dev: true
+
+ /@typescript-eslint/[email protected]:
+ resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dependencies:
+ '@typescript-eslint/types': 5.62.0
+ '@typescript-eslint/visitor-keys': 5.62.0
+ dev: true
+
+ resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ eslint: '*'
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ dependencies:
+ '@typescript-eslint/typescript-estree': 5.62.0([email protected])
+ '@typescript-eslint/utils': 5.62.0([email protected])([email protected])
+ debug: 4.3.4
+ eslint: 8.46.0
+ tsutils: 3.21.0([email protected])
+ typescript: 5.1.6
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ /@typescript-eslint/[email protected]:
+ resolution: {integrity: sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dev: true
+
+ /@typescript-eslint/[email protected]:
+ resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dev: true
+
+ /@typescript-eslint/[email protected]([email protected]):
+ resolution: {integrity: sha512-mQvSUJ/JjGBdvo+1LwC+GY2XmSYjK1nAaVw2emp/E61wEVYEyibRHCqm1I1vEKbXCpUKuW4G7u9ZCaZhJbLoNQ==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ dependencies:
+ '@typescript-eslint/types': 5.29.0
+ '@typescript-eslint/visitor-keys': 5.29.0
+ debug: 4.3.4
+ globby: 11.1.0
+ is-glob: 4.0.3
+ semver: 7.5.4
+ tsutils: 3.21.0([email protected])
+ typescript: 5.1.6
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ /@typescript-eslint/[email protected]([email protected]):
+ resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ dependencies:
+ '@typescript-eslint/types': 5.62.0
+ '@typescript-eslint/visitor-keys': 5.62.0
+ debug: 4.3.4
+ globby: 11.1.0
+ is-glob: 4.0.3
+ semver: 7.5.4
+ tsutils: 3.21.0([email protected])
+ typescript: 5.1.6
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-3Eos6uP1nyLOBayc/VUdKZikV90HahXE5Dx9L5YlSd/7ylQPXhLk1BYb29SDgnBnTp+jmSZUU0QxUiyHgW4p7A==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
+ dependencies:
+ '@types/json-schema': 7.0.9
+ '@typescript-eslint/scope-manager': 5.29.0
+ '@typescript-eslint/types': 5.29.0
+ '@typescript-eslint/typescript-estree': 5.29.0([email protected])
+ eslint: 8.46.0
+ eslint-scope: 5.1.1
+ eslint-utils: 3.0.0([email protected])
+ transitivePeerDependencies:
+ - supports-color
+ - typescript
+ dev: true
+
+ resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
+ dependencies:
+ '@eslint-community/eslint-utils': 4.4.0([email protected])
+ '@types/json-schema': 7.0.9
+ '@types/semver': 7.3.13
+ '@typescript-eslint/scope-manager': 5.62.0
+ '@typescript-eslint/types': 5.62.0
+ '@typescript-eslint/typescript-estree': 5.62.0([email protected])
+ eslint: 8.46.0
+ eslint-scope: 5.1.1
+ semver: 7.5.4
+ transitivePeerDependencies:
+ - supports-color
+ - typescript
+ dev: true
+
+ /@typescript-eslint/[email protected]:
+ resolution: {integrity: sha512-Hpb/mCWsjILvikMQoZIE3voc9wtQcS0A9FUw3h8bhr9UxBdtI/tw1ZDZUOXHXLOVMedKCH5NxyzATwnU78bWCQ==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dependencies:
+ '@typescript-eslint/types': 5.29.0
+ eslint-visitor-keys: 3.4.1
+ dev: true
+
+ /@typescript-eslint/[email protected]:
+ resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dependencies:
+ '@typescript-eslint/types': 5.62.0
+ eslint-visitor-keys: 3.4.1
+ dev: true
+
+ resolution: {integrity: sha512-VJFWY5sfoZerQRvJrh518h3AcQt6f/yTuWn4/TRB+dqmYU0NX1qz7qM5Wfd+gOQqUzQW4gxKqKN3KpE/P3+zrA==}
+ peerDependencies:
+ vite: ^4
+ dependencies:
+ '@swc/core': 1.3.62
+ vite: 4.4.9(@types/[email protected])([email protected])
+ transitivePeerDependencies:
+ - '@swc/helpers'
+ dev: true
+
+ resolution: {integrity: sha512-AfgcRL8ZBhAlc3BFdigClmTUMISmmzHn7sB2h9U1odvc5U/MjWXsAaz18b/WoppUTDBzxOJwo2VdClfUcItu9g==}
+ engines: {node: ^14.18.0 || >=16.0.0}
+ peerDependencies:
+ vite: ^4.1.0-beta.0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/plugin-transform-react-jsx-self': 7.21.0(@babel/[email protected])
+ '@babel/plugin-transform-react-jsx-source': 7.19.6(@babel/[email protected])
+ magic-string: 0.27.0
+ react-refresh: 0.14.0
+ vite: 4.4.9(@types/[email protected])([email protected])
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ /@vitest/[email protected]:
+ resolution: {integrity: sha512-q2CD8+XIsQ+tHwypnoCk8Mnv5e6afLFvinVGCq3/BOT4kQdVQmY6rRfyKkwcg635lbliLPqbunXZr+L1ssUWiQ==}
+ dependencies:
+ '@vitest/spy': 0.34.1
+ '@vitest/utils': 0.34.1
+ chai: 4.3.7
+ dev: true
+
+ /@vitest/[email protected]:
+ resolution: {integrity: sha512-YfQMpYzDsYB7yqgmlxZ06NI4LurHWfrH7Wy3Pvf/z/vwUSgq1zLAb1lWcItCzQG+NVox+VvzlKQrYEXb47645g==}
+ dependencies:
+ '@vitest/utils': 0.34.1
+ p-limit: 4.0.0
+ pathe: 1.1.1
+ dev: true
+
+ /@vitest/[email protected]:
+ resolution: {integrity: sha512-0O9LfLU0114OqdF8lENlrLsnn024Tb1CsS9UwG0YMWY2oGTQfPtkW+B/7ieyv0X9R2Oijhi3caB1xgGgEgclSQ==}
+ dependencies:
+ magic-string: 0.30.1
+ pathe: 1.1.1
+ pretty-format: 29.6.1
+ dev: true
+
+ /@vitest/[email protected]:
+ resolution: {integrity: sha512-UT4WcI3EAPUNO8n6y9QoEqynGGEPmmRxC+cLzneFFXpmacivjHZsNbiKD88KUScv5DCHVDgdBsLD7O7s1enFcQ==}
+ dependencies:
+ tinyspy: 2.1.1
+ dev: true
+
+ /@vitest/[email protected]:
+ resolution: {integrity: sha512-/ql9dsFi4iuEbiNcjNHQWXBum7aL8pyhxvfnD9gNtbjR9fUKAjxhj4AA3yfLXg6gJpMGGecvtF8Au2G9y3q47Q==}
+ dependencies:
+ diff-sequences: 29.4.3
+ loupe: 2.3.6
+ pretty-format: 29.6.1
+ dev: true
+
+ /@webassemblyjs/[email protected]:
+ resolution: {integrity: sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==}
+ dependencies:
+ '@webassemblyjs/helper-numbers': 1.11.6
+ '@webassemblyjs/helper-wasm-bytecode': 1.11.6
+ dev: false
+
+ /@webassemblyjs/[email protected]:
+ resolution: {integrity: sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==}
+ dev: false
+
+ /@webassemblyjs/[email protected]:
+ resolution: {integrity: sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==}
+ dev: false
+
+ /@webassemblyjs/[email protected]:
+ resolution: {integrity: sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==}
+ dev: false
+
+ /@webassemblyjs/[email protected]:
+ resolution: {integrity: sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==}
+ dependencies:
+ '@webassemblyjs/floating-point-hex-parser': 1.11.6
+ '@webassemblyjs/helper-api-error': 1.11.6
+ '@xtuc/long': 4.2.2
+ dev: false
+
+ /@webassemblyjs/[email protected]:
+ resolution: {integrity: sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==}
+ dev: false
+
+ /@webassemblyjs/[email protected]:
+ resolution: {integrity: sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==}
+ dependencies:
+ '@webassemblyjs/ast': 1.11.6
+ '@webassemblyjs/helper-buffer': 1.11.6
+ '@webassemblyjs/helper-wasm-bytecode': 1.11.6
+ '@webassemblyjs/wasm-gen': 1.11.6
+ dev: false
+
+ /@webassemblyjs/[email protected]:
+ resolution: {integrity: sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==}
+ dependencies:
+ '@xtuc/ieee754': 1.2.0
+ dev: false
+
+ /@webassemblyjs/[email protected]:
+ resolution: {integrity: sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==}
+ dependencies:
+ '@xtuc/long': 4.2.2
+ dev: false
+
+ /@webassemblyjs/[email protected]:
+ resolution: {integrity: sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==}
+ dev: false
+
+ /@webassemblyjs/[email protected]:
+ resolution: {integrity: sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==}
+ dependencies:
+ '@webassemblyjs/ast': 1.11.6
+ '@webassemblyjs/helper-buffer': 1.11.6
+ '@webassemblyjs/helper-wasm-bytecode': 1.11.6
+ '@webassemblyjs/helper-wasm-section': 1.11.6
+ '@webassemblyjs/wasm-gen': 1.11.6
+ '@webassemblyjs/wasm-opt': 1.11.6
+ '@webassemblyjs/wasm-parser': 1.11.6
+ '@webassemblyjs/wast-printer': 1.11.6
+ dev: false
+
+ /@webassemblyjs/[email protected]:
+ resolution: {integrity: sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==}
+ dependencies:
+ '@webassemblyjs/ast': 1.11.6
+ '@webassemblyjs/helper-wasm-bytecode': 1.11.6
+ '@webassemblyjs/ieee754': 1.11.6
+ '@webassemblyjs/leb128': 1.11.6
+ '@webassemblyjs/utf8': 1.11.6
+ dev: false
+
+ /@webassemblyjs/[email protected]:
+ resolution: {integrity: sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==}
+ dependencies:
+ '@webassemblyjs/ast': 1.11.6
+ '@webassemblyjs/helper-buffer': 1.11.6
+ '@webassemblyjs/wasm-gen': 1.11.6
+ '@webassemblyjs/wasm-parser': 1.11.6
+ dev: false
+
+ /@webassemblyjs/[email protected]:
+ resolution: {integrity: sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==}
+ dependencies:
+ '@webassemblyjs/ast': 1.11.6
+ '@webassemblyjs/helper-api-error': 1.11.6
+ '@webassemblyjs/helper-wasm-bytecode': 1.11.6
+ '@webassemblyjs/ieee754': 1.11.6
+ '@webassemblyjs/leb128': 1.11.6
+ '@webassemblyjs/utf8': 1.11.6
+ dev: false
+
+ /@webassemblyjs/[email protected]:
+ resolution: {integrity: sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==}
+ dependencies:
+ '@webassemblyjs/ast': 1.11.6
+ '@xtuc/long': 4.2.2
+ dev: false
+
+ /@xmldom/[email protected]:
+ resolution: {integrity: sha512-uRjjusqpoqfmRkTaNuLJ2VohVr67Q5YwDATW3VU7PfzTj6IRaihGrYI7zckGZjxQPBIp63nfvJbM+Yu5ICh0Bg==}
+ engines: {node: '>=10.0.0'}
+ dev: true
+
+ resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==}
+ dev: false
+
+ resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==}
+ dev: false
+
+ resolution: {integrity: sha512-kYzDJO5CA9sy+on/s2aIW0411AklfCi8Ck/4QDivOqsMKpStZA2SsR+X27VTggGwpStWaLrjJcDcdDMowtG8MA==}
+ engines: {node: '>=14.15.0'}
+ peerDependencies:
+ esbuild: '>=0.10.0'
+ dependencies:
+ esbuild: 0.18.16
+ tslib: 2.5.0
+ dev: true
+
+ /@yarnpkg/[email protected]:
+ resolution: {integrity: sha512-41H+Ga78xT9sHvWLlFOZLIhtU6mTGZ20pZ29EiZa97vnxdohJD2AF42rCoAoWfqUz486xY6fhjMH+DYEM9r14A==}
+ engines: {node: '>=12 <14 || 14.2 - 14.9 || >14.10.0'}
+ dependencies:
+ '@yarnpkg/libzip': 2.3.0
+ tslib: 1.14.1
+ dev: true
+
+ /@yarnpkg/[email protected]:
+ resolution: {integrity: sha512-6xm38yGVIa6mKm/DUCF2zFFJhERh/QWp1ufm4cNUvxsONBmfPg8uZ9pZBdOmF6qFGr/HlT6ABBkCSx/dlEtvWg==}
+ engines: {node: '>=12 <14 || 14.2 - 14.9 || >14.10.0'}
+ dependencies:
+ '@types/emscripten': 1.39.6
+ tslib: 1.14.1
+ dev: true
+
+ resolution: {integrity: sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==}
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==}
+ dev: true
+
+ resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==}
+ engines: {node: '>= 0.6'}
+ dependencies:
+ mime-types: 2.1.35
+ negotiator: 0.6.3
+ dev: true
+
+ resolution: {integrity: sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==}
+ peerDependencies:
+ acorn: ^8
+ dependencies:
+ acorn: 8.9.0
+ dev: false
+
+ resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
+ peerDependencies:
+ acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
+ dependencies:
+ acorn: 7.4.1
+ dev: true
+
+ resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
+ peerDependencies:
+ acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
+ dependencies:
+ acorn: 8.9.0
+
+ resolution: {integrity: sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==}
+ engines: {node: '>=0.4.0'}
+ dev: true
+
+ resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==}
+ engines: {node: '>=0.4.0'}
+ dev: true
+
+ resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==}
+ engines: {node: '>=0.4.0'}
+ hasBin: true
+ dev: true
+
+ resolution: {integrity: sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==}
+ engines: {node: '>=0.4.0'}
+ hasBin: true
+
+ resolution: {integrity: sha512-4B/qKCfeE/ODUaAUpSwfzazo5x29WD4r3vXiWsB7I2mSDAihwEqKO+g8GELZUQSSAo5e1XTYh3ZVfLyxBc12nA==}
+ engines: {node: '>= 10.0.0'}
+ dev: true
+
+ resolution: {integrity: sha512-OXwN5b9pCUXNQHJpwwD2qP40byEmSgzj8B4ydSN0uMNYWiFmJ6x6KwUllMmfk8Rwu/HJDFR7U8ubsWBoN0Xp0A==}
+ engines: {node: '>=8.9'}
+ dependencies:
+ loader-utils: 2.0.4
+ regex-parser: 2.2.11
+ dev: false
+
+ resolution: {integrity: sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==}
+ engines: {node: '>= 6.0.0'}
+ dev: true
+
+ resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
+ engines: {node: '>= 6.0.0'}
+ dependencies:
+ debug: 4.3.4
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==}
+ engines: {node: '>=8'}
+ dependencies:
+ clean-stack: 2.2.0
+ indent-string: 4.0.0
+ dev: true
+
+ resolution: {integrity: sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==}
+ peerDependencies:
+ ajv: ^6.9.1
+ dependencies:
+ ajv: 6.12.6
+ dev: false
+
+ resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
+ dependencies:
+ fast-deep-equal: 3.1.3
+ fast-json-stable-stringify: 2.1.0
+ json-schema-traverse: 0.4.1
+ uri-js: 4.4.1
+
+ resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==}
+ dependencies:
+ fast-deep-equal: 3.1.3
+ json-schema-traverse: 1.0.0
+ require-from-string: 2.0.2
+ uri-js: 4.4.1
+ dev: true
+
+ resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==}
+ engines: {node: '>=8'}
+ dependencies:
+ type-fest: 0.21.3
+ dev: true
+
+ resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==}
+ engines: {node: '>=4'}
+ dependencies:
+ color-convert: 1.9.3
+
+ resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
+ engines: {node: '>=8'}
+ dependencies:
+ color-convert: 2.0.1
+
+ resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==}
+ engines: {node: '>=10'}
+ dev: true
+
+ resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==}
+
+ resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==}
+ engines: {node: '>= 8'}
+ dependencies:
+ normalize-path: 3.0.0
+ picomatch: 2.3.1
+
+ resolution: {integrity: sha512-jlpIfsOoNoafl92Sz//64uQHGSyMrD2vYG5d8o2a4qGvyNCvXur7bzIsWtAC/6flI2RYAp3kv8rsfBtaLm7w0g==}
+
+ resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==}
+
+ resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==}
+ dependencies:
+ sprintf-js: 1.0.3
+ dev: true
+
+ resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
+
+ resolution: {integrity: sha512-RhVWFtKH5BiGMycI72q2RAFMLQi8JP9bLuQXgR5a8Znp7P5KOIADSJeyfI8PCVxLEp067B2HbP5JIiI/PXIZeA==}
+ engines: {node: '>=8.5.0'}
+ dependencies:
+ tslib: 1.14.1
+
+ resolution: {integrity: sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA==}
+ engines: {node: '>=6.0'}
+ dependencies:
+ '@babel/runtime': 7.22.5
+ '@babel/runtime-corejs3': 7.18.3
+ dev: true
+
+ resolution: {integrity: sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==}
+ dependencies:
+ deep-equal: 2.2.1
+ dev: true
+
+ resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==}
+ dependencies:
+ call-bind: 1.0.2
+ is-array-buffer: 3.0.2
+ dev: true
+
+ resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==}
+ dev: true
+
+ resolution: {integrity: sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.2.0
+ es-abstract: 1.20.5
+ get-intrinsic: 1.2.1
+ is-string: 1.0.7
+ dev: true
+
+ resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.2.0
+ es-abstract: 1.20.5
+ es-shim-unscopables: 1.0.0
+ dev: true
+
+ resolution: {integrity: sha512-PZC9/8TKAIxcWKdyeb77EzULHPrIX/tIZebLJUQOMR1OwYosT8yggdfWScfTBCDj5utONvOuPQQumYsU2ULbkg==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.2.0
+ es-abstract: 1.20.5
+ es-shim-unscopables: 1.0.0
+ dev: true
+
+ resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ resolution: {integrity: sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==}
+ dependencies:
+ es6-object-assign: 1.1.0
+ is-nan: 1.3.2
+ object-is: 1.1.5
+ util: 0.12.5
+ dev: true
+
+ resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==}
+ dev: true
+
+ resolution: {integrity: sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==}
+ dev: true
+
+ resolution: {integrity: sha512-O0yuUDnZeQDL+ncNGlJ78BiO4jnYI3bvMsD5prT0/nsgijG/LpNBIr63gTjVTNsiGkgQhiyCShTgxt8oXOrklA==}
+ engines: {node: '>=4'}
+ dependencies:
+ tslib: 2.5.0
+ dev: true
+
+ resolution: {integrity: sha512-c27loCv9QkZinsa5ProX751khO9DJl/AcB5c2KNtA6NRvHKS0PgLfcftz72KVq504vB0Gku5s2kUZzDBvQWvHg==}
+ engines: {node: '>=4'}
+ dependencies:
+ tslib: 2.5.0
+ dev: true
+
+ resolution: {integrity: sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==}
+ engines: {node: '>=4'}
+ dependencies:
+ tslib: 2.5.0
+ dev: true
+
+ resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==}
+ dev: true
+
+ resolution: {integrity: sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==}
+ dev: true
+
+ resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
+
+ resolution: {integrity: sha512-7prDjvt9HmqiZ0cl5CRjtS84sEyhsHP2coDkaZKRKVfCDo9s7iw7ChVmar78Gu9pC4SoR/28wFu/G5JJhTnqEg==}
+ engines: {node: '>=4'}
+ dev: false
+
+ resolution: {integrity: sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==}
+ engines: {node: ^10 || ^12 || >=14}
+ hasBin: true
+ peerDependencies:
+ postcss: ^8.1.0
+ dependencies:
+ browserslist: 4.21.5
+ caniuse-lite: 1.0.30001487
+ fraction.js: 4.2.0
+ normalize-range: 0.1.2
+ picocolors: 1.0.0
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ dev: true
+
+ resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==}
+ engines: {node: '>= 0.4'}
+ dev: true
+
+ resolution: {integrity: sha512-LVAaGp/wkkgYJcjmHsoKx4juT1aQvJyPcW09MLCjVTh3V2cc6PnyempiLMNH5iMdfIX/zdbjUx2KDjMLCTdPeA==}
+ engines: {node: '>=12'}
+ dev: true
+
+ resolution: {integrity: sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==}
+ dev: true
+
+ resolution: {integrity: sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ dev: true
+
+ resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==}
+ engines: {node: '>=8'}
+ dependencies:
+ '@babel/helper-plugin-utils': 7.22.5
+ '@istanbuljs/load-nyc-config': 1.1.0
+ '@istanbuljs/schema': 0.1.3
+ istanbul-lib-instrument: 5.2.1
+ test-exclude: 6.0.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==}
+ engines: {node: '>=10', npm: '>=6'}
+ dependencies:
+ '@babel/runtime': 7.22.5
+ cosmiconfig: 7.0.1
+ resolve: 1.22.2
+
+ resolution: {integrity: sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/compat-data': 7.22.9
+ '@babel/core': 7.22.9
+ '@babel/helper-define-polyfill-provider': 0.3.3(@babel/[email protected])
+ semver: 6.3.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-19hwUH5FKl49JEsvyTcoHakh6BE0wgXLLptIyKZ3PijHc/Ci521wygORCUCCred+E/twuqRyAkE02BAWPmsHOg==}
+ peerDependencies:
+ '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0
+ dependencies:
+ '@babel/compat-data': 7.22.9
+ '@babel/core': 7.22.9
+ '@babel/helper-define-polyfill-provider': 0.4.2(@babel/[email protected])
+ semver: 6.3.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-G3uJih0XWiID451fpeFaYGVuxHEjzKTHtc9uGFEjR6hHrvNzeS/PX+LLLcetJcytsB5m4j+K3o/EpXJNb/5IEQ==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-define-polyfill-provider': 0.3.3(@babel/[email protected])
+ core-js-compat: 3.31.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-z41XaniZL26WLrvjy7soabMXrfPWARN25PZoriDEiLMxAp50AUW3t35BGQUMg5xK3UrpVTtagIDklxYa+MhiNA==}
+ peerDependencies:
+ '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-define-polyfill-provider': 0.4.2(@babel/[email protected])
+ core-js-compat: 3.31.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-Y2B06tvgHYt1x0yz17jGkGeeMr5FeKUu+ASJ+N6nB5lQ8Dapfg42i0OVrf8PNGJ3zKL4A23snMi1IRwrqqND7A==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-define-polyfill-provider': 0.3.3(@babel/[email protected])
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-tAlOptU0Xj34V1Y2PNTL4Y0FOJMDB6bZmoW39FeCQIhigGLkqu3Fj6uiXpxIf6Ij274ENdYx64y6Au+ZKlb1IA==}
+ peerDependencies:
+ '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/helper-define-polyfill-provider': 0.4.2(@babel/[email protected])
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-eqj0hVcJUR57/Ug2zE1Yswsw4LhuqqHhD+8v120T1cl3kjg76QwtyBrdIk4WVwK+lAhBJVYCd/v+4nc4y+8JsA==}
+ dev: true
+
+ resolution: {integrity: sha512-b0D9IZ1WhhCWkrTXyFuIIgqGzSkRIH5D5AmB0bXbzYAB1OBAwHcUeyWW2LorutLWF5btNo/N7r/cIdmvvKJlYg==}
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/plugin-proposal-class-properties': 7.18.6(@babel/[email protected])
+ '@babel/plugin-proposal-decorators': 7.18.2(@babel/[email protected])
+ '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/[email protected])
+ '@babel/plugin-proposal-numeric-separator': 7.18.6(@babel/[email protected])
+ '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/[email protected])
+ '@babel/plugin-proposal-private-methods': 7.18.6(@babel/[email protected])
+ '@babel/plugin-proposal-private-property-in-object': 7.21.0(@babel/[email protected])
+ '@babel/plugin-transform-flow-strip-types': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-react-display-name': 7.16.7(@babel/[email protected])
+ '@babel/plugin-transform-runtime': 7.18.5(@babel/[email protected])
+ '@babel/preset-env': 7.22.9(@babel/[email protected])
+ '@babel/preset-react': 7.16.7(@babel/[email protected])
+ '@babel/preset-typescript': 7.17.12(@babel/[email protected])
+ '@babel/runtime': 7.22.5
+ babel-plugin-macros: 3.1.0
+ babel-plugin-transform-react-remove-prop-types: 0.4.24
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
+
+ resolution: {integrity: sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==}
+ dev: true
+
+ resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
+ dev: true
+
+ resolution: {integrity: sha512-aVNobHnJqLiUelTaHat9DZ1qM2w0C0Eym4LPI/3JxOnSokGVdsl1T1kN7TFvsEAD8G47A6VKQ0TVHqbBnYMJlQ==}
+ engines: {node: '>=12.0.0'}
+ dependencies:
+ open: 8.4.2
+ dev: true
+
+ resolution: {integrity: sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==}
+ engines: {node: '>=0.6'}
+ dev: true
+
+ resolution: {integrity: sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==}
+ dev: false
+
+ resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==}
+ dependencies:
+ buffer: 5.7.1
+ inherits: 2.0.4
+ readable-stream: 3.6.0
+ dev: true
+
+ resolution: {integrity: sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==}
+ engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16}
+ dependencies:
+ bytes: 3.1.2
+ content-type: 1.0.5
+ debug: 2.6.9
+ depd: 2.0.0
+ destroy: 1.2.0
+ http-errors: 2.0.0
+ iconv-lite: 0.4.24
+ on-finished: 2.4.1
+ qs: 6.11.0
+ raw-body: 2.5.1
+ type-is: 1.6.18
+ unpipe: 1.0.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==}
+ dev: false
+
+ resolution: {integrity: sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==}
+ engines: {node: '>= 5.10.0'}
+ dependencies:
+ big-integer: 1.6.51
+ dev: true
+
+ resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}
+ dependencies:
+ balanced-match: 1.0.2
+ concat-map: 0.0.1
+
+ resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==}
+ dependencies:
+ balanced-match: 1.0.2
+
+ resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==}
+ engines: {node: '>=8'}
+ dependencies:
+ fill-range: 7.0.1
+
+ resolution: {integrity: sha512-nfulgvOR6S4gt9UKCeGJOuSGBPGiFT6oQ/2UBnvTY/5aQ1PnksW72fhZkM30DzoRRv2WpwZf1vHHEr3mtuXIWQ==}
+ dev: true
+
+ resolution: {integrity: sha512-19OEpq7vWgsH6WkvkBJQDFvJS1uPcbFOQ4v9CU839dO+ZZXUZO6XpE6hNCqvlIIj+4fZvRiJ6DsAQ382GwiyTQ==}
+ dependencies:
+ pako: 0.2.9
+ dev: true
+
+ resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==}
+ engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
+ hasBin: true
+ dependencies:
+ caniuse-lite: 1.0.30001487
+ electron-to-chromium: 1.4.394
+ node-releases: 2.0.10
+ update-browserslist-db: 1.0.11([email protected])
+ dev: true
+
+ resolution: {integrity: sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==}
+ engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
+ hasBin: true
+ dependencies:
+ caniuse-lite: 1.0.30001517
+ electron-to-chromium: 1.4.468
+ node-releases: 2.0.13
+ update-browserslist-db: 1.0.11([email protected])
+
+ resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==}
+ dependencies:
+ node-int64: 0.4.0
+ dev: true
+
+ resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==}
+ dev: true
+
+ resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
+
+ resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==}
+ dependencies:
+ base64-js: 1.5.1
+ ieee754: 1.2.1
+ dev: true
+
+ resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==}
+ engines: {node: '>=6'}
+ dev: true
+
+ resolution: {integrity: sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==}
+ engines: {node: '>= 0.8'}
+ dev: true
+
+ resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==}
+ engines: {node: '>= 0.8'}
+ dev: true
+
+ resolution: {integrity: sha512-/NL4hQTv1gBL6J6ei80zu3IiTrmePDKXKXOTLpHvcIWZTVYQlDhVWjjWvkhICylE8EwwnMVzDZugCvdx0/DIIA==}
+ engines: {node: '>=10.12.0'}
+ hasBin: true
+ dependencies:
+ '@bcoe/v8-coverage': 0.2.3
+ '@istanbuljs/schema': 0.1.3
+ find-up: 5.0.0
+ foreground-child: 2.0.0
+ istanbul-lib-coverage: 3.2.0
+ istanbul-lib-report: 3.0.0
+ istanbul-reports: 3.1.5
+ rimraf: 3.0.2
+ test-exclude: 6.0.0
+ v8-to-istanbul: 9.1.0
+ yargs: 16.2.0
+ yargs-parser: 20.2.9
+ dev: true
+
+ resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==}
+ dependencies:
+ function-bind: 1.1.1
+ get-intrinsic: 1.2.1
+
+ resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==}
+ engines: {node: '>= 6'}
+
+ resolution: {integrity: sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg==}
+ engines: {node: '>=12'}
+ dependencies:
+ camelcase: 6.3.0
+ map-obj: 4.3.0
+ quick-lru: 5.1.1
+ type-fest: 1.4.0
+ dev: true
+
+ resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==}
+ engines: {node: '>=6'}
+ dev: true
+
+ resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==}
+ engines: {node: '>=10'}
+ dev: true
+
+ resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==}
+ dependencies:
+ browserslist: 4.21.9
+ caniuse-lite: 1.0.30001517
+ lodash.memoize: 4.1.2
+ lodash.uniq: 4.5.0
+ dev: false
+
+ resolution: {integrity: sha512-83564Z3yWGqXsh2vaH/mhXfEM0wX+NlBCm1jYHOb97TrTWJEmPTccZgeLTPBUUb0PNVo+oomb7wkimZBIERClA==}
+ dev: true
+
+ resolution: {integrity: sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA==}
+
+ resolution: {integrity: sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==}
+ engines: {node: '>=4'}
+ dependencies:
+ assertion-error: 1.1.0
+ check-error: 1.0.2
+ deep-eql: 4.1.3
+ get-func-name: 2.0.0
+ loupe: 2.3.6
+ pathval: 1.1.1
+ type-detect: 4.0.8
+ dev: true
+
+ resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==}
+ engines: {node: '>=4'}
+ dependencies:
+ ansi-styles: 3.2.1
+ escape-string-regexp: 1.0.5
+ supports-color: 5.5.0
+
+ resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==}
+ engines: {node: '>=8'}
+ dependencies:
+ ansi-styles: 4.3.0
+ supports-color: 7.2.0
+ dev: true
+
+ resolution: {integrity: sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==}
+ engines: {node: '>=10'}
+ dependencies:
+ ansi-styles: 4.3.0
+ supports-color: 7.2.0
+ dev: true
+
+ resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
+ engines: {node: '>=10'}
+ dependencies:
+ ansi-styles: 4.3.0
+ supports-color: 7.2.0
+
+ resolution: {integrity: sha512-Y4kiDb+AM4Ecy58YkuZrrSRJBDQdQ2L+NyS1vHHFtNtUjgutcZfx3yp1dAONI/oPaPmyGfCLx5CxL+zauIMyKQ==}
+ engines: {node: '>=6'}
+ dev: true
+
+ resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==}
+ dev: true
+
+ resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==}
+ dev: true
+
+ resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==}
+ engines: {node: '>= 8.10.0'}
+ dependencies:
+ anymatch: 3.1.3
+ braces: 3.0.2
+ glob-parent: 5.1.2
+ is-binary-path: 2.1.0
+ is-glob: 4.0.3
+ normalize-path: 3.0.0
+ readdirp: 3.6.0
+ optionalDependencies:
+ fsevents: 2.3.2
+
+ resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==}
+ dev: true
+
+ resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==}
+ engines: {node: '>=10'}
+ dev: true
+
+ resolution: {integrity: sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==}
+ engines: {node: '>=6.0'}
+ dev: false
+
+ resolution: {integrity: sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-jFI8IQw4hczaL4ALINxqLEXQbWcNjoSkloa4IaufXCJr6QawJyw7tuRysRsrE8w2p/4gGaxKIt/hX3qz/IbD1A==}
+ dependencies:
+ clsx: 2.0.0
+ dev: false
+
+ resolution: {integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==}
+ engines: {node: '>=4'}
+ dependencies:
+ escape-string-regexp: 1.0.5
+ dev: true
+
+ resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==}
+ engines: {node: '>=6'}
+ dev: true
+
+ resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==}
+ engines: {node: '>=8'}
+ dependencies:
+ restore-cursor: 3.1.0
+ dev: true
+
+ resolution: {integrity: sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw==}
+ engines: {node: '>=6'}
+ dev: true
+
+ resolution: {integrity: sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==}
+ engines: {node: 10.* || >= 12.*}
+ dependencies:
+ string-width: 4.2.3
+ optionalDependencies:
+ '@colors/colors': 1.5.0
+ dev: true
+
+ resolution: {integrity: sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==}
+ engines: {node: '>= 10'}
+ dev: true
+
+ resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==}
+ dependencies:
+ string-width: 4.2.3
+ strip-ansi: 6.0.1
+ wrap-ansi: 7.0.0
+ dev: true
+
+ resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
+ engines: {node: '>=12'}
+ dependencies:
+ string-width: 4.2.3
+ strip-ansi: 6.0.1
+ wrap-ansi: 7.0.0
+ dev: true
+
+ resolution: {integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==}
+ engines: {node: '>=6'}
+ dependencies:
+ is-plain-object: 2.0.4
+ kind-of: 6.0.3
+ shallow-clone: 3.0.1
+ dev: true
+
+ resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==}
+ engines: {node: '>=0.8'}
+ dev: true
+
+ resolution: {integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==}
+ engines: {node: '>=6'}
+ dev: false
+
+ resolution: {integrity: sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==}
+ engines: {node: '>=6'}
+ dev: false
+
+ resolution: {integrity: sha512-JQpKvEOb86SnvMZbYaFKYhvzFntWBeSZdyii0rZPhKJj9uwJBxu4DaVYDrRN7r3mPop56oPhRw+JYWTKs66TYw==}
+ peerDependencies:
+ react: ^18.0.0
+ react-dom: ^18.0.0
+ dependencies:
+ '@radix-ui/react-dialog': 1.0.0(@types/[email protected])([email protected])([email protected])
+ command-score: 0.1.2
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ transitivePeerDependencies:
+ - '@types/react'
+ dev: false
+
+ resolution: {integrity: sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==}
+ dependencies:
+ '@codemirror/autocomplete': 6.9.0(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected])
+ '@codemirror/commands': 6.2.4
+ '@codemirror/language': 6.8.0
+ '@codemirror/lint': 6.4.0
+ '@codemirror/search': 6.5.1
+ '@codemirror/state': 6.2.1
+ '@codemirror/view': 6.16.0
+ transitivePeerDependencies:
+ - '@lezer/common'
+ dev: false
+
+ resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==}
+ dependencies:
+ color-name: 1.1.3
+
+ resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
+ engines: {node: '>=7.0.0'}
+ dependencies:
+ color-name: 1.1.4
+
+ resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==}
+
+ resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
+
+ resolution: {integrity: sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==}
+
+ resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==}
+ dev: true
+
+ resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
+ engines: {node: '>= 0.8'}
+ dependencies:
+ delayed-stream: 1.0.0
+
+ resolution: {integrity: sha512-VtDvQpIJBvBatnONUsPzXYFVKQQAhuf3XTNOAsdBxCNO/QCtUUd8LSgjn0GVarBkCad6aJCZfXgrjYbl/KRr7w==}
+ dev: false
+
+ resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
+
+ resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==}
+ engines: {node: '>= 6'}
+
+ resolution: {integrity: sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==}
+ engines: {node: '>= 6'}
+ dev: true
+
+ resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==}
+ engines: {node: '>= 10'}
+ dev: false
+
+ resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==}
+ engines: {node: '>= 12'}
+ dev: false
+
+ resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==}
+
+ resolution: {integrity: sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==}
+ engines: {node: '>= 0.6'}
+ dependencies:
+ mime-db: 1.52.0
+ dev: true
+
+ resolution: {integrity: sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==}
+ engines: {node: '>= 0.8.0'}
+ dependencies:
+ accepts: 1.3.8
+ bytes: 3.0.0
+ compressible: 2.0.18
+ debug: 2.6.9
+ on-headers: 1.0.2
+ safe-buffer: 5.1.2
+ vary: 1.1.2
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=}
+
+ resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==}
+ engines: {'0': node >= 0.8}
+ dependencies:
+ buffer-from: 1.1.2
+ inherits: 2.0.4
+ readable-stream: 2.3.8
+ typedarray: 0.0.6
+ dev: true
+
+ resolution: {integrity: sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==}
+ dev: true
+
+ resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==}
+ engines: {node: '>= 0.6'}
+ dependencies:
+ safe-buffer: 5.2.1
+ dev: true
+
+ resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==}
+ engines: {node: '>= 0.6'}
+ dev: true
+
+ resolution: {integrity: sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==}
+ dependencies:
+ safe-buffer: 5.1.2
+
+ resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}
+ dev: true
+
+ resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==}
+ dev: true
+
+ resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==}
+ engines: {node: '>= 0.6'}
+ dev: true
+
+ resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==}
+ engines: {node: '>= 0.6'}
+ dev: true
+
+ resolution: {integrity: sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==}
+ dependencies:
+ is-what: 3.14.1
+
+ resolution: {integrity: sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==}
+ dependencies:
+ toggle-selection: 1.0.6
+ dev: false
+
+ resolution: {integrity: sha512-wIDWd2s5/5aJSdpOJHfSibxNODxoGoWOBHt8JSPB41NOE94M7kuTPZCYLOlTtuoXTsBPKobpJ6T+y0SSy5L9SA==}
+ dependencies:
+ browserslist: 4.21.9
+ dev: true
+
+ resolution: {integrity: sha512-12VZfFIu+wyVbBebyHmRTuEE/tZrB4tJToWcwAMcsp3h4+sHR+fMJWbKpYiCRWlhFBq+KNyO8rIV9rTkeVmznQ==}
+ deprecated: core-js-pure@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js-pure.
+ requiresBuild: true
+ dev: true
+
+ resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
+ dev: true
+
+ resolution: {integrity: sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==}
+ engines: {node: '>=10'}
+ dependencies:
+ '@types/parse-json': 4.0.0
+ import-fresh: 3.3.0
+ parse-json: 5.2.0
+ path-type: 4.0.0
+ yaml: 1.10.2
+
+ resolution: {integrity: sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==}
+ engines: {node: '>=14'}
+ dependencies:
+ import-fresh: 3.3.0
+ js-yaml: 4.1.0
+ parse-json: 5.2.0
+ path-type: 4.0.0
+
+ resolution: {integrity: sha512-+BO9wPPi+DWTDcNYhr/W90myha8ptzftZT+LwcmUbbok0rcP/fequmFYCw8NMoH7pkAZQzU78b3kYrlua5a9eA==}
+ dev: false
+
+ resolution: {integrity: sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==}
+ engines: {node: '>=4.8'}
+ dependencies:
+ nice-try: 1.0.5
+ path-key: 2.0.1
+ semver: 5.7.1
+ shebang-command: 1.2.0
+ which: 1.3.1
+ dev: true
+
+ resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==}
+ engines: {node: '>= 8'}
+ dependencies:
+ path-key: 3.1.1
+ shebang-command: 2.0.0
+ which: 2.0.2
+
+ resolution: {integrity: sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-jDfsatwWMWN0MODAFuHszfjphEXfNw9JUAhmY4pLu3TyTU+ohUpsbVtbU+1MZn4a47D9kqh03i4eyOm+74+zew==}
+ engines: {node: ^10 || ^12 || >=14}
+ peerDependencies:
+ postcss: ^8.0.9
+ dependencies:
+ postcss: 8.4.27
+ dev: false
+
+ resolution: {integrity: sha512-d/jBMPyYybkkLVypgtGv12R+pIFw4/f/IHtCTxWpZc8ofTYOPigIgmA6vu5rMHartZC+WuXhBUHfnyNUIQSYrg==}
+ engines: {node: '>=12.22'}
+ dev: true
+
+ resolution: {integrity: sha512-0Y5uHtK5BswfaGJ+jrO+4pPg1msFBc0pwPIE1VqfpmVn6YbDfYfXMj8rfd7nt+4goAhJueO+H/I40VWJfcP1mQ==}
+ engines: {node: '>= 12.13.0'}
+ peerDependencies:
+ webpack: ^5.0.0
+ dependencies:
+ icss-utils: 5.1.0([email protected])
+ postcss: 8.4.27
+ postcss-modules-extract-imports: 3.0.0([email protected])
+ postcss-modules-local-by-default: 4.0.1([email protected])
+ postcss-modules-scope: 3.0.0([email protected])
+ postcss-modules-values: 4.0.0([email protected])
+ postcss-value-parser: 4.2.0
+ semver: 7.5.4
+ webpack: 5.88.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==}
+ dependencies:
+ boolbase: 1.0.0
+ css-what: 6.1.0
+ domhandler: 5.0.3
+ domutils: 3.1.0
+ nth-check: 2.1.1
+ dev: false
+
+ resolution: {integrity: sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==}
+ engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'}
+ dependencies:
+ mdn-data: 2.0.28
+ source-map-js: 1.0.2
+ dev: false
+
+ resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==}
+ engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0}
+ dependencies:
+ mdn-data: 2.0.30
+ source-map-js: 1.0.2
+
+ resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==}
+ engines: {node: '>= 6'}
+ dev: false
+
+ resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==}
+ dev: true
+
+ resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==}
+ engines: {node: '>=4'}
+ hasBin: true
+
+ resolution: {integrity: sha512-7VzyFZ5zEB1+l1nToKyrRkuaJIx0zi/1npjvZfbBwbtNTzhLtlvYraK/7/uqmX2Wb2aQtd983uuGw79jAjLSuQ==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ css-declaration-sorter: 6.4.0([email protected])
+ cssnano-utils: 4.0.0([email protected])
+ postcss: 8.4.27
+ postcss-calc: 9.0.1([email protected])
+ postcss-colormin: 6.0.0([email protected])
+ postcss-convert-values: 6.0.0([email protected])
+ postcss-discard-comments: 6.0.0([email protected])
+ postcss-discard-duplicates: 6.0.0([email protected])
+ postcss-discard-empty: 6.0.0([email protected])
+ postcss-discard-overridden: 6.0.0([email protected])
+ postcss-merge-longhand: 6.0.0([email protected])
+ postcss-merge-rules: 6.0.1([email protected])
+ postcss-minify-font-values: 6.0.0([email protected])
+ postcss-minify-gradients: 6.0.0([email protected])
+ postcss-minify-params: 6.0.0([email protected])
+ postcss-minify-selectors: 6.0.0([email protected])
+ postcss-normalize-charset: 6.0.0([email protected])
+ postcss-normalize-display-values: 6.0.0([email protected])
+ postcss-normalize-positions: 6.0.0([email protected])
+ postcss-normalize-repeat-style: 6.0.0([email protected])
+ postcss-normalize-string: 6.0.0([email protected])
+ postcss-normalize-timing-functions: 6.0.0([email protected])
+ postcss-normalize-unicode: 6.0.0([email protected])
+ postcss-normalize-url: 6.0.0([email protected])
+ postcss-normalize-whitespace: 6.0.0([email protected])
+ postcss-ordered-values: 6.0.0([email protected])
+ postcss-reduce-initial: 6.0.0([email protected])
+ postcss-reduce-transforms: 6.0.0([email protected])
+ postcss-svgo: 6.0.0([email protected])
+ postcss-unique-selectors: 6.0.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-Z39TLP+1E0KUcd7LGyF4qMfu8ZufI0rDzhdyAMsa/8UyNUU8wpS0fhdBxbQbv32r64ea00h4878gommRVg2BHw==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ dev: false
+
+ resolution: {integrity: sha512-fVO1JdJ0LSdIGJq68eIxOqFpIJrZqXUsBt8fkrBcztCQqAjQD51OhZp7tc0ImcbwXD4k7ny84QTV90nZhmqbkg==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ cssnano-preset-default: 6.0.1([email protected])
+ lilconfig: 2.1.0
+ postcss: 8.4.27
+ dev: false
+
+ resolution: {integrity: sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==}
+ engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'}
+ dependencies:
+ css-tree: 2.2.1
+ dev: false
+
+ resolution: {integrity: sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==}
+ engines: {node: '>=14'}
+ dependencies:
+ rrweb-cssom: 0.6.0
+ dev: true
+
+ resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==}
+
+ resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==}
+ dev: true
+
+ resolution: {integrity: sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==}
+ engines: {node: '>=14'}
+ dependencies:
+ abab: 2.0.6
+ whatwg-mimetype: 3.0.0
+ whatwg-url: 12.0.1
+ dev: true
+
+ resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==}
+ engines: {node: '>=0.11'}
+ dependencies:
+ '@babel/runtime': 7.21.0
+ dev: false
+
+ resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==}
+ peerDependencies:
+ supports-color: '*'
+ peerDependenciesMeta:
+ supports-color:
+ optional: true
+ dependencies:
+ ms: 2.0.0
+ dev: true
+
+ resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
+ peerDependencies:
+ supports-color: '*'
+ peerDependenciesMeta:
+ supports-color:
+ optional: true
+ dependencies:
+ ms: 2.1.3
+
+ resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
+ engines: {node: '>=6.0'}
+ peerDependencies:
+ supports-color: '*'
+ peerDependenciesMeta:
+ supports-color:
+ optional: true
+ dependencies:
+ ms: 2.1.2
+
+ resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==}
+ engines: {node: '>=0.10.0'}
+ dependencies:
+ decamelize: 1.2.0
+ map-obj: 1.0.1
+ dev: true
+
+ resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ resolution: {integrity: sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==}
+ engines: {node: '>=10'}
+ dev: true
+
+ resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==}
+ dev: true
+
+ resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==}
+ engines: {node: '>=6'}
+ dependencies:
+ type-detect: 4.0.8
+ dev: true
+
+ resolution: {integrity: sha512-lKdkdV6EOGoVn65XaOsPdH4rMxTZOnmFyuIkMjM1i5HHCbfjC97dawgTAy0deYNfuqUqW+Q5VrVaQYtUpSd6yQ==}
+ dependencies:
+ array-buffer-byte-length: 1.0.0
+ call-bind: 1.0.2
+ es-get-iterator: 1.1.3
+ get-intrinsic: 1.2.1
+ is-arguments: 1.1.1
+ is-array-buffer: 3.0.2
+ is-date-object: 1.0.5
+ is-regex: 1.1.4
+ is-shared-array-buffer: 1.0.2
+ isarray: 2.0.5
+ object-is: 1.1.5
+ object-keys: 1.1.1
+ object.assign: 4.1.4
+ regexp.prototype.flags: 1.5.0
+ side-channel: 1.0.4
+ which-boxed-primitive: 1.0.2
+ which-collection: 1.0.1
+ which-typed-array: 1.1.9
+ dev: true
+
+ resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}
+
+ resolution: {integrity: sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==}
+ engines: {node: '>=12'}
+ dependencies:
+ bplist-parser: 0.2.0
+ untildify: 4.0.0
+ dev: true
+
+ resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==}
+ dependencies:
+ clone: 1.0.4
+ dev: true
+
+ resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ has-property-descriptors: 1.0.0
+ object-keys: 1.1.1
+ dev: true
+
+ resolution: {integrity: sha512-+uO4+qr7msjNNWKYPHqN/3+Dx3NFkmIzayk2L1MyZQlvgZb/J1A0fo410dpKrN2SnqFjt8n4JL8fDJE0wIgjFQ==}
+ dev: true
+
+ resolution: {integrity: sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg==}
+ engines: {node: '>=10'}
+ dependencies:
+ globby: 11.1.0
+ graceful-fs: 4.2.10
+ is-glob: 4.0.3
+ is-path-cwd: 2.2.0
+ is-path-inside: 3.0.3
+ p-map: 4.0.0
+ rimraf: 3.0.2
+ slash: 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
+ engines: {node: '>=0.4.0'}
+
+ resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==}
+ engines: {node: '>= 0.8'}
+ dev: true
+
+ resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==}
+ engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16}
+ dev: true
+
+ resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==}
+
+ resolution: {integrity: sha512-j/lJHyoLlWi6G1LDdLgvUtz60Zo5GEj+sVYtTVXnYLDPuzgC3llMxonXym9zIwhhUII8vjdw0LXxavpLqTbl1A==}
+ engines: {node: '>=12'}
+ dependencies:
+ execa: 5.1.1
+ dev: true
+
+ resolution: {integrity: sha512-aBzdj76lueB6uUst5iAs7+0H/oOjqI5D16XUWxlWMIMROhcM0rfsNVk93zTngq1dDNpoXRr++Sus7ETAExppAQ==}
+ hasBin: true
+ dependencies:
+ address: 1.2.2
+ debug: 4.3.4
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==}
+
+ resolution: {integrity: sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==}
+ engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
+ dev: true
+
+ resolution: {integrity: sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dev: true
+
+ resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}
+ engines: {node: '>=8'}
+ dependencies:
+ path-type: 4.0.0
+ dev: true
+
+ resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
+
+ resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==}
+ engines: {node: '>=0.10.0'}
+ dependencies:
+ esutils: 2.0.3
+ dev: true
+
+ resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==}
+ engines: {node: '>=6.0.0'}
+ dependencies:
+ esutils: 2.0.3
+
+ resolution: {integrity: sha512-gQ2mON6fLWZeM8ubjzL7RtMeHS/g8hb82j4MjHmcQECD7pevWsMlhqwp9BjIRrQvmyJMMyv/XiO1cXzeFlUw4g==}
+ dev: true
+
+ resolution: {integrity: sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==}
+ dependencies:
+ '@babel/runtime': 7.22.5
+ csstype: 3.1.2
+ dev: false
+
+ resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==}
+ dependencies:
+ domelementtype: 2.3.0
+ domhandler: 5.0.3
+ entities: 4.5.0
+ dev: false
+
+ resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==}
+ dev: false
+
+ resolution: {integrity: sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==}
+ engines: {node: '>=12'}
+ dependencies:
+ webidl-conversions: 7.0.0
+ dev: true
+
+ resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==}
+ engines: {node: '>= 4'}
+ dependencies:
+ domelementtype: 2.3.0
+ dev: false
+
+ resolution: {integrity: sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==}
+ dependencies:
+ dom-serializer: 2.0.0
+ domelementtype: 2.3.0
+ domhandler: 5.0.3
+ dev: false
+
+ resolution: {integrity: sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==}
+ dependencies:
+ end-of-stream: 1.4.4
+ inherits: 2.0.4
+ readable-stream: 2.3.8
+ stream-shift: 1.0.1
+ dev: true
+
+ resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
+
+ resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==}
+ dev: true
+
+ resolution: {integrity: sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==}
+ engines: {node: '>=0.10.0'}
+ hasBin: true
+ dependencies:
+ jake: 10.8.7
+ dev: true
+
+ resolution: {integrity: sha512-0IbC2cfr8w5LxTz+nmn2cJTGafsK9iauV2r5A5scfzyovqLrxuLoxOHE5OBobP3oVIggJT+0JfKnw9sm87c8Hw==}
+ dev: true
+
+ resolution: {integrity: sha512-6M1qyhaJOt7rQtNti1lBA0GwclPH+oKCmsra/hkcWs5INLxfXXD/dtdnaKUYQu/pjOBP/8Osoe4mAcNvvzoFag==}
+
+ resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
+
+ resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==}
+
+ resolution: {integrity: sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==}
+ engines: {node: '>= 4'}
+ dev: false
+
+ resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==}
+ engines: {node: '>= 0.8'}
+ dev: true
+
+ resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==}
+ dependencies:
+ once: 1.4.0
+ dev: true
+
+ resolution: {integrity: sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==}
+ engines: {node: '>=10.13.0'}
+ dependencies:
+ graceful-fs: 4.2.10
+ tapable: 2.2.1
+ dev: false
+
+ resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
+ engines: {node: '>=0.12'}
+
+ resolution: {integrity: sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==}
+ engines: {node: '>=4'}
+ hasBin: true
+ dev: true
+
+ resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==}
+ hasBin: true
+ requiresBuild: true
+ dependencies:
+ prr: 1.0.1
+ optional: true
+
+ resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==}
+ dependencies:
+ is-arrayish: 0.2.1
+
+ resolution: {integrity: sha512-7h8MM2EQhsCA7pU/Nv78qOXFpD8Rhqd12gYiSJVkrH9+e8VuA8JlPJK/hQjjlLv6pJvx/z1iRFKzYb0XT/RuAQ==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ es-to-primitive: 1.2.1
+ function-bind: 1.1.1
+ function.prototype.name: 1.1.5
+ get-intrinsic: 1.2.1
+ get-symbol-description: 1.0.0
+ gopd: 1.0.1
+ has: 1.0.3
+ has-property-descriptors: 1.0.0
+ has-symbols: 1.0.3
+ internal-slot: 1.0.5
+ is-callable: 1.2.7
+ is-negative-zero: 2.0.2
+ is-regex: 1.1.4
+ is-shared-array-buffer: 1.0.2
+ is-string: 1.0.7
+ is-weakref: 1.0.2
+ object-inspect: 1.12.2
+ object-keys: 1.1.1
+ object.assign: 4.1.4
+ regexp.prototype.flags: 1.5.0
+ safe-regex-test: 1.0.0
+ string.prototype.trimend: 1.0.6
+ string.prototype.trimstart: 1.0.6
+ unbox-primitive: 1.0.2
+ dev: true
+
+ resolution: {integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==}
+ dependencies:
+ call-bind: 1.0.2
+ get-intrinsic: 1.2.1
+ has-symbols: 1.0.3
+ is-arguments: 1.1.1
+ is-map: 2.0.2
+ is-set: 2.0.2
+ is-string: 1.0.7
+ isarray: 2.0.5
+ stop-iteration-iterator: 1.0.0
+ dev: true
+
+ resolution: {integrity: sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==}
+ dev: true
+
+ resolution: {integrity: sha512-vZK7T0N2CBmBOixhmjdqx2gWVbFZ4DXZ/NyRMZVlJXPa7CyFS+/a4QQsDGDQy9ZfEzxFuNEsMLeQJnKP2p5/JA==}
+ dev: false
+
+ resolution: {integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==}
+ dependencies:
+ has: 1.0.3
+ dev: true
+
+ resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ is-callable: 1.2.7
+ is-date-object: 1.0.5
+ is-symbol: 1.0.4
+ dev: true
+
+ resolution: {integrity: sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw==}
+ dev: true
+
+ resolution: {integrity: sha512-jyfL/pwPqaFXyKnj8lP8iLk6Z0m099uXR45aSN8Av1XD4vhvQutxxPzgA2bTcAwQpa1zCXDcWOlhFgyP3GKqhQ==}
+ dev: true
+
+ resolution: {integrity: sha512-kG/XyTDyz6+YDuyfB9ZoSIOOmgyFCH+xPRtsCa8W85HLRV5Csp+o3jWVbOSHgSLfyLc5DmP+KFDNwty4mEjC+Q==}
+ peerDependencies:
+ esbuild: '>=0.12 <1'
+ dependencies:
+ debug: 4.3.4
+ esbuild: 0.18.16
+ transitivePeerDependencies:
+ - supports-color
+
+ resolution: {integrity: sha512-1xLsOXrDqwdHxyXb/x/SOyg59jpf/SH7YMvU5RNSU7z3TInaASNJWNFJ6iRvLvLETZMasF3d1DdZLg7sgRimRQ==}
+ engines: {node: '>=12'}
+ hasBin: true
+ requiresBuild: true
+ optionalDependencies:
+ '@esbuild/android-arm': 0.18.16
+ '@esbuild/android-arm64': 0.18.16
+ '@esbuild/android-x64': 0.18.16
+ '@esbuild/darwin-arm64': 0.18.16
+ '@esbuild/darwin-x64': 0.18.16
+ '@esbuild/freebsd-arm64': 0.18.16
+ '@esbuild/freebsd-x64': 0.18.16
+ '@esbuild/linux-arm': 0.18.16
+ '@esbuild/linux-arm64': 0.18.16
+ '@esbuild/linux-ia32': 0.18.16
+ '@esbuild/linux-loong64': 0.18.16
+ '@esbuild/linux-mips64el': 0.18.16
+ '@esbuild/linux-ppc64': 0.18.16
+ '@esbuild/linux-riscv64': 0.18.16
+ '@esbuild/linux-s390x': 0.18.16
+ '@esbuild/linux-x64': 0.18.16
+ '@esbuild/netbsd-x64': 0.18.16
+ '@esbuild/openbsd-x64': 0.18.16
+ '@esbuild/sunos-x64': 0.18.16
+ '@esbuild/win32-arm64': 0.18.16
+ '@esbuild/win32-ia32': 0.18.16
+ '@esbuild/win32-x64': 0.18.16
+
+ resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==}
+ dev: true
+
+ resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==}
+ engines: {node: '>=0.8.0'}
+
+ resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==}
+ engines: {node: '>=6.0'}
+ hasBin: true
+ dependencies:
+ esprima: 4.0.1
+ estraverse: 5.3.0
+ esutils: 2.0.3
+ optionator: 0.8.3
+ optionalDependencies:
+ source-map: 0.6.1
+ dev: true
+
+ resolution: {integrity: sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==}
+ hasBin: true
+ peerDependencies:
+ eslint: '>=7.0.0'
+ dependencies:
+ eslint: 8.46.0
+ dev: true
+
+ resolution: {integrity: sha512-K6rNzvkIeHaTd8m/QEh1Zko0KI7BACWkkneSs6s9cKZC/J27X3eZR6Upt1jkmZ/4FK+XUOPPxMEN7+lbUXfSlA==}
+ engines: {node: '>=14.0.0'}
+ peerDependencies:
+ eslint: ^8.0.0
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ dependencies:
+ '@babel/core': 7.21.8
+ '@babel/eslint-parser': 7.18.2(@babel/[email protected])([email protected])
+ '@rushstack/eslint-patch': 1.1.3
+ '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/[email protected])([email protected])([email protected])
+ '@typescript-eslint/parser': 5.62.0([email protected])([email protected])
+ babel-preset-react-app: 10.0.1
+ confusing-browser-globals: 1.0.11
+ eslint: 8.46.0
+ eslint-plugin-flowtype: 8.0.3(@babel/[email protected])(@babel/[email protected])([email protected])
+ eslint-plugin-import: 2.26.0(@typescript-eslint/[email protected])([email protected])
+ eslint-plugin-jest: 25.7.0(@typescript-eslint/[email protected])([email protected])([email protected])
+ eslint-plugin-jsx-a11y: 6.5.1([email protected])
+ eslint-plugin-react: 7.30.0([email protected])
+ eslint-plugin-react-hooks: 4.6.0([email protected])
+ eslint-plugin-testing-library: 5.5.1([email protected])([email protected])
+ typescript: 5.1.6
+ transitivePeerDependencies:
+ - '@babel/plugin-syntax-flow'
+ - '@babel/plugin-transform-react-jsx'
+ - eslint-import-resolver-typescript
+ - eslint-import-resolver-webpack
+ - jest
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==}
+ dependencies:
+ debug: 3.2.7
+ resolve: 1.22.2
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==}
+ engines: {node: '>=4'}
+ peerDependencies:
+ '@typescript-eslint/parser': '*'
+ eslint-import-resolver-node: '*'
+ eslint-import-resolver-typescript: '*'
+ eslint-import-resolver-webpack: '*'
+ peerDependenciesMeta:
+ '@typescript-eslint/parser':
+ optional: true
+ eslint-import-resolver-node:
+ optional: true
+ eslint-import-resolver-typescript:
+ optional: true
+ eslint-import-resolver-webpack:
+ optional: true
+ dependencies:
+ '@typescript-eslint/parser': 5.62.0([email protected])([email protected])
+ debug: 3.2.7
+ eslint-import-resolver-node: 0.3.6
+ find-up: 2.1.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-dX8l6qUL6O+fYPtpNRideCFSpmWOUVx5QcaGLVqe/vlDiBSe4vYljDWDETwnyFzpl7By/WVIu6rcrniCgH9BqQ==}
+ engines: {node: '>=12.0.0'}
+ peerDependencies:
+ '@babel/plugin-syntax-flow': ^7.14.5
+ '@babel/plugin-transform-react-jsx': ^7.14.9
+ eslint: ^8.1.0
+ dependencies:
+ '@babel/plugin-syntax-flow': 7.22.5(@babel/[email protected])
+ '@babel/plugin-transform-react-jsx': 7.21.5(@babel/[email protected])
+ eslint: 8.46.0
+ lodash: 4.17.21
+ string-natural-compare: 3.0.1
+ dev: true
+
+ resolution: {integrity: sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg==}
+ peerDependencies:
+ eslint: '>=7.7.0'
+ dependencies:
+ eslint: 8.46.0
+ dev: false
+
+ resolution: {integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==}
+ engines: {node: '>=4'}
+ peerDependencies:
+ '@typescript-eslint/parser': '*'
+ eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8
+ peerDependenciesMeta:
+ '@typescript-eslint/parser':
+ optional: true
+ dependencies:
+ '@typescript-eslint/parser': 5.62.0([email protected])([email protected])
+ array-includes: 3.1.5
+ array.prototype.flat: 1.3.0
+ debug: 2.6.9
+ doctrine: 2.1.0
+ eslint: 8.46.0
+ eslint-import-resolver-node: 0.3.6
+ eslint-module-utils: 2.7.3(@typescript-eslint/[email protected])([email protected])
+ has: 1.0.3
+ is-core-module: 2.12.0
+ is-glob: 4.0.3
+ minimatch: 3.1.2
+ object.values: 1.1.5
+ resolve: 1.22.2
+ tsconfig-paths: 3.14.1
+ transitivePeerDependencies:
+ - eslint-import-resolver-typescript
+ - eslint-import-resolver-webpack
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-PWLUEXeeF7C9QGKqvdSbzLOiLTx+bno7/HC9eefePfEb257QFHg7ye3dh80AZVkaa/RQsBB1Q/ORQvg2X7F0NQ==}
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
+ peerDependencies:
+ '@typescript-eslint/eslint-plugin': ^4.0.0 || ^5.0.0
+ eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
+ jest: '*'
+ peerDependenciesMeta:
+ '@typescript-eslint/eslint-plugin':
+ optional: true
+ jest:
+ optional: true
+ dependencies:
+ '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/[email protected])([email protected])([email protected])
+ '@typescript-eslint/experimental-utils': 5.29.0([email protected])([email protected])
+ eslint: 8.46.0
+ transitivePeerDependencies:
+ - supports-color
+ - typescript
+ dev: true
+
+ resolution: {integrity: sha512-sVCFKX9fllURnXT2JwLN5Qgo24Ug5NF6dxhkmxsMEUZhXRcGg+X3e1JbJ84YePQKBl5E0ZjAH5Q4rkdcGY99+g==}
+ engines: {node: '>=4.0'}
+ peerDependencies:
+ eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8
+ dependencies:
+ '@babel/runtime': 7.22.5
+ aria-query: 4.2.2
+ array-includes: 3.1.5
+ ast-types-flow: 0.0.7
+ axe-core: 4.4.2
+ axobject-query: 2.2.0
+ damerau-levenshtein: 1.0.8
+ emoji-regex: 9.2.2
+ eslint: 8.46.0
+ has: 1.0.3
+ jsx-ast-utils: 3.3.0
+ language-tags: 1.0.5
+ minimatch: 3.1.2
+ dev: true
+
+ resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==}
+ engines: {node: '>=10'}
+ peerDependencies:
+ eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0
+ dependencies:
+ eslint: 8.46.0
+ dev: true
+
+ resolution: {integrity: sha512-RgwH7hjW48BleKsYyHK5vUAvxtE9SMPDKmcPRQgtRCYaZA0XQPt5FSkrU3nhz5ifzMZcA8opwmRJ2cmOO8tr5A==}
+ engines: {node: '>=4'}
+ peerDependencies:
+ eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8
+ dependencies:
+ array-includes: 3.1.5
+ array.prototype.flatmap: 1.3.0
+ doctrine: 2.1.0
+ eslint: 8.46.0
+ estraverse: 5.3.0
+ jsx-ast-utils: 3.3.0
+ minimatch: 3.1.2
+ object.entries: 1.1.5
+ object.fromentries: 2.0.5
+ object.hasown: 1.1.1
+ object.values: 1.1.5
+ prop-types: 15.8.1
+ resolve: 2.0.0-next.4
+ semver: 6.3.1
+ string.prototype.matchall: 4.0.7
+ dev: true
+
+ resolution: {integrity: sha512-py+DI+upyWdcm2fS+gBHSXME4HiZ6GRlLz+4c8GMXiUi8huIP83RaQeOPccBsu9aKEIZiXAblaxYjIHUnrIpAQ==}
+ peerDependencies:
+ eslint: '>=0.8.0'
+ dependencies:
+ eslint: 8.46.0
+ globals: 13.20.0
+ dev: true
+
+ resolution: {integrity: sha512-smd+CS0WH1jBqUEJ3znGS7DU4ayBE9z6lkQAK2yrSUv1+rq8BT/tiI5C/rKE7rmiqiAfojtNYZRhzo5HrulccQ==}
+ engines: {node: 12.x || 14.x || >= 16}
+ peerDependencies:
+ eslint: '>=6'
+ dependencies:
+ '@storybook/csf': 0.0.1
+ '@typescript-eslint/utils': 5.62.0([email protected])([email protected])
+ eslint: 8.46.0
+ requireindex: 1.2.0
+ ts-dedent: 2.2.0
+ transitivePeerDependencies:
+ - supports-color
+ - typescript
+ dev: true
+
+ resolution: {integrity: sha512-plLEkkbAKBjPxsLj7x4jNapcHAg2ernkQlKKrN2I8NrQwPISZHyCUNvg5Hv3EDqOQReToQb5bnqXYbkijJPE/g==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0, npm: '>=6'}
+ peerDependencies:
+ eslint: ^7.5.0 || ^8.0.0
+ dependencies:
+ '@typescript-eslint/utils': 5.62.0([email protected])([email protected])
+ eslint: 8.46.0
+ transitivePeerDependencies:
+ - supports-color
+ - typescript
+ dev: true
+
+ resolution: {integrity: sha512-ivB3bKk7fDIeWOUmmMm9o3Ax9zbMz1Bsza/R2qm46ufw4T6VBFBaJIR1uN3pCKSmSXm8/9Nri8V+iUut1NhQGA==}
+ engines: {node: '>=16'}
+ peerDependencies:
+ eslint: '>=8.38.0'
+ dependencies:
+ '@babel/helper-validator-identifier': 7.19.1
+ '@eslint-community/eslint-utils': 4.4.0([email protected])
+ ci-info: 3.8.0
+ clean-regexp: 1.0.0
+ eslint: 8.46.0
+ esquery: 1.5.0
+ indent-string: 4.0.0
+ is-builtin-module: 3.2.1
+ jsesc: 3.0.2
+ lodash: 4.17.21
+ pluralize: 8.0.0
+ read-pkg-up: 7.0.1
+ regexp-tree: 0.1.27
+ regjsparser: 0.10.0
+ safe-regex: 2.1.1
+ semver: 7.5.1
+ strip-indent: 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==}
+ engines: {node: '>=8.0.0'}
+ dependencies:
+ esrecurse: 4.3.0
+ estraverse: 4.3.0
+
+ resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dependencies:
+ esrecurse: 4.3.0
+ estraverse: 5.3.0
+
+ resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==}
+ engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0}
+ peerDependencies:
+ eslint: '>=5'
+ dependencies:
+ eslint: 8.46.0
+ eslint-visitor-keys: 2.1.0
+ dev: true
+
+ resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==}
+ engines: {node: '>=10'}
+ dev: true
+
+ resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dev: true
+
+ resolution: {integrity: sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+
+ resolution: {integrity: sha512-cIO74PvbW0qU8e0mIvk5IV3ToWdCq5FYG6gWPHHkx6gNdjlbAYvtfHmlCMXxjcoVaIdwy/IAt3+mDkZkfvb2Dg==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ hasBin: true
+ dependencies:
+ '@eslint-community/eslint-utils': 4.4.0([email protected])
+ '@eslint-community/regexpp': 4.6.2
+ '@eslint/eslintrc': 2.1.1
+ '@eslint/js': 8.46.0
+ '@humanwhocodes/config-array': 0.11.10
+ '@humanwhocodes/module-importer': 1.0.1
+ '@nodelib/fs.walk': 1.2.8
+ ajv: 6.12.6
+ chalk: 4.1.2
+ cross-spawn: 7.0.3
+ debug: 4.3.4
+ doctrine: 3.0.0
+ escape-string-regexp: 4.0.0
+ eslint-scope: 7.2.2
+ eslint-visitor-keys: 3.4.2
+ espree: 9.6.1
+ esquery: 1.5.0
+ esutils: 2.0.3
+ fast-deep-equal: 3.1.3
+ file-entry-cache: 6.0.1
+ find-up: 5.0.0
+ glob-parent: 6.0.2
+ globals: 13.20.0
+ graphemer: 1.4.0
+ ignore: 5.2.4
+ imurmurhash: 0.1.4
+ is-glob: 4.0.3
+ is-path-inside: 3.0.3
+ js-yaml: 4.1.0
+ json-stable-stringify-without-jsonify: 1.0.1
+ levn: 0.4.1
+ lodash.merge: 4.6.2
+ minimatch: 3.1.2
+ natural-compare: 1.4.0
+ optionator: 0.9.3
+ strip-ansi: 6.0.1
+ text-table: 0.2.0
+ transitivePeerDependencies:
+ - supports-color
+
+ resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dependencies:
+ acorn: 8.9.0
+ acorn-jsx: 5.3.2([email protected])
+ eslint-visitor-keys: 3.4.2
+
+ resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}
+ engines: {node: '>=4'}
+ hasBin: true
+ dev: true
+
+ resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==}
+ engines: {node: '>=0.10'}
+ dependencies:
+ estraverse: 5.3.0
+
+ resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==}
+ engines: {node: '>=4.0'}
+ dependencies:
+ estraverse: 5.3.0
+
+ resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==}
+ engines: {node: '>=4.0'}
+
+ resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==}
+ engines: {node: '>=4.0'}
+
+ resolution: {integrity: sha512-YNF+mZ/Wu2FU/gvmzuWtYc8rloubL7wfXCTgouFrnjGVXPA/EeYYA7pupXWrb3Iv1cTBeSSxxJIbK23l4MRNqg==}
+ engines: {node: '>=8.3.0'}
+ dependencies:
+ '@babel/traverse': 7.22.8
+ '@babel/types': 7.22.5
+ c8: 7.13.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}
+ dev: true
+
+ resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==}
+ engines: {node: '>= 0.6'}
+ dev: true
+
+ resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==}
+ engines: {node: '>=0.8.x'}
+
+ resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==}
+ engines: {node: '>=10'}
+ dependencies:
+ cross-spawn: 7.0.3
+ get-stream: 6.0.1
+ human-signals: 2.1.0
+ is-stream: 2.0.1
+ merge-stream: 2.0.0
+ npm-run-path: 4.0.1
+ onetime: 5.1.2
+ signal-exit: 3.0.7
+ strip-final-newline: 2.0.0
+ dev: true
+
+ resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==}
+ engines: {node: '>= 0.10.0'}
+ dependencies:
+ accepts: 1.3.8
+ array-flatten: 1.1.1
+ body-parser: 1.20.1
+ content-disposition: 0.5.4
+ content-type: 1.0.5
+ cookie: 0.5.0
+ cookie-signature: 1.0.6
+ debug: 2.6.9
+ depd: 2.0.0
+ encodeurl: 1.0.2
+ escape-html: 1.0.3
+ etag: 1.8.1
+ finalhandler: 1.2.0
+ fresh: 0.5.2
+ http-errors: 2.0.0
+ merge-descriptors: 1.0.1
+ methods: 1.1.2
+ on-finished: 2.4.1
+ parseurl: 1.3.3
+ path-to-regexp: 0.1.7
+ proxy-addr: 2.0.7
+ qs: 6.11.0
+ range-parser: 1.2.1
+ safe-buffer: 5.2.1
+ send: 0.18.0
+ serve-static: 1.15.0
+ setprototypeof: 1.2.0
+ statuses: 2.0.1
+ type-is: 1.6.18
+ utils-merge: 1.0.1
+ vary: 1.1.2
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==}
+ dev: true
+
+ resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==}
+ engines: {node: '>=4'}
+ dependencies:
+ chardet: 0.7.0
+ iconv-lite: 0.4.24
+ tmp: 0.0.33
+ dev: true
+
+ resolution: {integrity: sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==}
+ hasBin: true
+ dependencies:
+ concat-stream: 1.6.2
+ debug: 2.6.9
+ mkdirp: 0.5.6
+ yauzl: 2.10.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
+
+ resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==}
+ engines: {node: '>=8.6.0'}
+ dependencies:
+ '@nodelib/fs.stat': 2.0.5
+ '@nodelib/fs.walk': 1.2.8
+ glob-parent: 5.1.2
+ merge2: 1.4.1
+ micromatch: 4.0.5
+
+ resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==}
+ engines: {node: '>=8.6.0'}
+ dependencies:
+ '@nodelib/fs.stat': 2.0.5
+ '@nodelib/fs.walk': 1.2.8
+ glob-parent: 5.1.2
+ merge2: 1.4.1
+ micromatch: 4.0.5
+ dev: true
+
+ resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}
+
+ resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
+
+ resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==}
+ engines: {node: '>= 4.9.1'}
+ dev: true
+
+ resolution: {integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==}
+ dependencies:
+ reusify: 1.0.4
+
+ resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==}
+ dependencies:
+ bser: 2.1.1
+ dev: true
+
+ resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==}
+ dependencies:
+ pend: 1.2.0
+ dev: true
+
+ resolution: {integrity: sha512-3yurQZ2hD9VISAhJJP9bpYFNQrHHBXE2JxxjY5aLEcDi46RmAzJE2OC9FAde0yis5ElW0jTTzs0zfg/Cca4XqQ==}
+ dev: true
+
+ resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==}
+ engines: {node: '>=8'}
+ dependencies:
+ escape-string-regexp: 1.0.5
+ dev: true
+
+ resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==}
+ engines: {node: ^10.12.0 || >=12.0.0}
+ dependencies:
+ flat-cache: 3.0.4
+
+ resolution: {integrity: sha512-QlZ5yJC0VxHxQQsQhXvBaC7VRJ2uaxTf+Tfpu4Z/OcVQJVpZO+DGU0rkoVW5ce2SccxugvpBJoMvUs59iILYdw==}
+ engines: {node: '>= 12'}
+ dependencies:
+ tslib: 2.5.0
+ dev: false
+
+ resolution: {integrity: sha512-l4DMNdsIPsVnKrgEXbJwDJsA5mB8rGwHYERMgqQx/xAUtChPJMre1bXBzDEqqVbWv9AIbFezXMxeEkZDSrXUOQ==}
+ dependencies:
+ fs-extra: 11.1.1
+ ramda: 0.29.0
+
+ resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==}
+ dependencies:
+ minimatch: 5.1.6
+ dev: true
+
+ resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==}
+ engines: {node: '>=8'}
+ dependencies:
+ to-regex-range: 5.0.1
+
+ resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==}
+ engines: {node: '>= 0.8'}
+ dependencies:
+ debug: 2.6.9
+ encodeurl: 1.0.2
+ escape-html: 1.0.3
+ on-finished: 2.4.1
+ parseurl: 1.3.3
+ statuses: 2.0.1
+ unpipe: 1.0.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==}
+ engines: {node: '>=6'}
+ dependencies:
+ commondir: 1.0.1
+ make-dir: 2.1.0
+ pkg-dir: 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==}
+ engines: {node: '>=8'}
+ dependencies:
+ commondir: 1.0.1
+ make-dir: 3.1.0
+ pkg-dir: 4.2.0
+
+ resolution: {integrity: sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==}
+ dev: false
+
+ resolution: {integrity: sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==}
+ engines: {node: '>=4'}
+ dependencies:
+ locate-path: 2.0.0
+ dev: true
+
+ resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==}
+ engines: {node: '>=6'}
+ dependencies:
+ locate-path: 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==}
+ engines: {node: '>=8'}
+ dependencies:
+ locate-path: 5.0.0
+ path-exists: 4.0.0
+
+ resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==}
+ engines: {node: '>=10'}
+ dependencies:
+ locate-path: 6.0.0
+ path-exists: 4.0.0
+
+ resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==}
+ engines: {node: ^10.12.0 || >=12.0.0}
+ dependencies:
+ flatted: 3.2.5
+ rimraf: 3.0.2
+
+ resolution: {integrity: sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==}
+
+ resolution: {integrity: sha512-uD7Du+9xC/gGnOyk3kANQmtgWWKANWcKGJ84Wu0NSjTaVING3GqUAsywUPAl3fEYKLVVIcDWiaQ8+R6qzghwmA==}
+ engines: {node: '>=0.4.0'}
+ dev: true
+
+ resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==}
+ dependencies:
+ is-callable: 1.2.7
+ dev: true
+
+ resolution: {integrity: sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==}
+ engines: {node: '>=8.0.0'}
+ dependencies:
+ cross-spawn: 7.0.3
+ signal-exit: 3.0.7
+ dev: true
+
+ resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==}
+ engines: {node: '>=14'}
+ dependencies:
+ cross-spawn: 7.0.3
+ signal-exit: 4.0.2
+
+ resolution: {integrity: sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==}
+ engines: {node: '>= 6'}
+ dependencies:
+ asynckit: 0.4.0
+ combined-stream: 1.0.8
+ mime-types: 2.1.35
+
+ resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==}
+ engines: {node: '>= 6'}
+ dependencies:
+ asynckit: 0.4.0
+ combined-stream: 1.0.8
+ mime-types: 2.1.35
+ dev: true
+
+ resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==}
+ engines: {node: '>= 0.6'}
+ dev: true
+
+ resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==}
+ dev: true
+
+ resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==}
+ engines: {node: '>= 0.6'}
+ dev: true
+
+ resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==}
+ dev: true
+
+ resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==}
+ engines: {node: '>=14.14'}
+ dependencies:
+ graceful-fs: 4.2.10
+ jsonfile: 6.1.0
+ universalify: 2.0.0
+
+ resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==}
+ engines: {node: '>= 8'}
+ dependencies:
+ minipass: 3.3.6
+ dev: true
+
+ resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
+
+ resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
+ engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
+ os: [darwin]
+ requiresBuild: true
+ optional: true
+
+ resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==}
+
+ resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.2.0
+ es-abstract: 1.20.5
+ functions-have-names: 1.2.3
+ dev: true
+
+ resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==}
+ dev: true
+
+ resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}
+ engines: {node: '>=6.9.0'}
+ dev: true
+
+ resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
+ engines: {node: 6.* || 8.* || >= 10.*}
+ dev: true
+
+ resolution: {integrity: sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==}
+ dev: true
+
+ resolution: {integrity: sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==}
+ dependencies:
+ function-bind: 1.1.1
+ has: 1.0.3
+ has-proto: 1.0.1
+ has-symbols: 1.0.3
+
+ resolution: {integrity: sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-R/PW6RqyaBQNWYaSyfrh54/qtcnOp22FHCCiRhSSZj0FP3KQWCsxxt0DzIdVTbwTqe9CtQfvl/FPD4UIPt4pqw==}
+ engines: {node: '>=12.17'}
+ dev: true
+
+ resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==}
+ engines: {node: '>=8.0.0'}
+ dev: true
+
+ resolution: {integrity: sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==}
+ engines: {node: '>=10'}
+ dev: true
+
+ resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ get-intrinsic: 1.2.1
+ dev: true
+
+ resolution: {integrity: sha512-HsLoS07HiQ5oqvObOI+Qb2tyZH4Gj5nYGfF9qQcZNrPw+uEFhdXtgJr01aO2pWadGHucajYDLxxbtQkm97ON2A==}
+ hasBin: true
+ dependencies:
+ colorette: 2.0.20
+ defu: 6.1.2
+ https-proxy-agent: 5.0.1
+ mri: 1.2.0
+ node-fetch-native: 1.1.1
+ pathe: 1.1.1
+ tar: 6.1.15
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-wIh+gKBI9Nshz2o46B0B3f5k/W+WI9ZAv6y5Dn5WJ5SK1t0TnDimB4WE5rmTD05ZAIn8HALCZVmCsvj0w0v0lw==}
+ dev: true
+
+ resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
+ engines: {node: '>= 6'}
+ dependencies:
+ is-glob: 4.0.3
+
+ resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==}
+ engines: {node: '>=10.13.0'}
+ dependencies:
+ is-glob: 4.0.3
+
+ resolution: {integrity: sha512-xcUzJ8NWN5bktoTIX7eOclO1Npxd/dyVqUJxlLIDasT4C7KZyqlPIwkdJ0Ypiy3p2ZKahTjK4M9uC3sNSfNMzw==}
+ engines: {node: '>=12'}
+ peerDependencies:
+ glob: ^7.1.6
+ dependencies:
+ '@types/glob': 7.2.0
+ glob: 7.2.0
+ dev: true
+
+ resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==}
+
+ resolution: {integrity: sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw==}
+ engines: {node: '>=16 || 14 >=14.17'}
+ hasBin: true
+ dependencies:
+ foreground-child: 3.1.1
+ jackspeak: 2.2.1
+ minimatch: 9.0.3
+ minipass: 5.0.0
+ path-scurry: 1.10.1
+
+ resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==}
+ dependencies:
+ fs.realpath: 1.0.0
+ inflight: 1.0.6
+ inherits: 2.0.4
+ minimatch: 3.1.2
+ once: 1.4.0
+ path-is-absolute: 1.0.1
+
+ resolution: {integrity: sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==}
+ dependencies:
+ fs.realpath: 1.0.0
+ inflight: 1.0.6
+ inherits: 2.0.4
+ minimatch: 3.1.2
+ once: 1.4.0
+ path-is-absolute: 1.0.1
+
+ resolution: {integrity: sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==}
+ engines: {node: '>=6'}
+ dependencies:
+ global-prefix: 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==}
+ engines: {node: '>=6'}
+ dependencies:
+ ini: 1.3.8
+ kind-of: 6.0.3
+ which: 1.3.1
+ dev: true
+
+ resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==}
+ engines: {node: '>=4'}
+ dev: true
+
+ resolution: {integrity: sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==}
+ engines: {node: '>=8'}
+ dependencies:
+ type-fest: 0.20.2
+
+ resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
+ engines: {node: '>=10'}
+ dependencies:
+ array-union: 2.1.0
+ dir-glob: 3.0.1
+ fast-glob: 3.3.1
+ ignore: 5.2.4
+ merge2: 1.4.1
+ slash: 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg==}
+ dev: true
+
+ resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==}
+ dev: true
+
+ resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==}
+ dependencies:
+ get-intrinsic: 1.2.1
+ dev: true
+
+ resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==}
+
+ resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==}
+
+ resolution: {integrity: sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==}
+ engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0}
+ dev: true
+
+ resolution: {integrity: sha512-4haO1M4mLO91PW57BMsDFf75UmwoRX0GkdD+Faw+Lr+r/OZrOCS0pIBwOL1xCKQqnQzbNFGgK2V2CpBUPeFNTw==}
+ hasBin: true
+ dependencies:
+ browserify-zlib: 0.1.4
+ is-deflate: 1.0.0
+ is-gzip: 1.0.0
+ peek-stream: 1.1.3
+ pumpify: 1.5.1
+ through2: 2.0.5
+ dev: true
+
+ resolution: {integrity: sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==}
+ engines: {node: '>=0.4.7'}
+ hasBin: true
+ dependencies:
+ minimist: 1.2.6
+ neo-async: 2.6.2
+ source-map: 0.6.1
+ wordwrap: 1.0.0
+ optionalDependencies:
+ uglify-js: 3.17.4
+
+ resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==}
+ engines: {node: '>=6'}
+ dev: true
+
+ resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==}
+ dev: true
+
+ resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==}
+ engines: {node: '>=4'}
+
+ resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==}
+ dependencies:
+ get-intrinsic: 1.2.1
+ dev: true
+
+ resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ has-symbols: 1.0.3
+ dev: true
+
+ resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==}
+ engines: {node: '>= 0.4.0'}
+ dependencies:
+ function-bind: 1.1.1
+
+ resolution: {integrity: sha512-tWCK4biJ6hcLqTviLXVR9DTRfYGQMXEIUj3gwJ2rZ5wO/at3XtkI4g8mCvFdUF9l1KMBNCfmNAdnahm1cgavQA==}
+ dev: true
+
+ resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==}
+ dependencies:
+ react-is: 16.13.1
+ dev: false
+
+ resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==}
+ dev: true
+
+ resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==}
+ engines: {node: '>=10'}
+ dependencies:
+ lru-cache: 6.0.0
+ dev: true
+
+ resolution: {integrity: sha512-983Vyg8NwUE7JkZ6NmOqpCZ+sh1bKv2iYTlUkzlWmA5JD2acKoxd4KVxbMmxX/85mtfdnDmTFoNKcg5DGAvxNQ==}
+ dev: false
+
+ resolution: {integrity: sha512-TUa3wIwi80f5NF8CVWzkopBVqVAtlawUzJoLwVLHns0XSJGynss4jiY0mTWpiDOsuyw+afP+ujjMgRh9CoZcXw==}
+ dependencies:
+ domhandler: 5.0.3
+ htmlparser2: 9.0.0
+ dev: false
+
+ resolution: {integrity: sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==}
+ engines: {node: '>=12'}
+ dependencies:
+ whatwg-encoding: 2.0.0
+ dev: true
+
+ resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==}
+ dev: true
+
+ resolution: {integrity: sha512-gzU55AS+FI6qD7XaKe5BLuLFM2Xw0/LodfMWZlxV9uOHe7LCD5Lukx/EgYuBI3c0kLu0XlgFXnSzO0qUUn3Vrg==}
+ peerDependencies:
+ react: 0.14 || 15 || 16 || 17 || 18
+ dependencies:
+ domhandler: 5.0.3
+ html-dom-parser: 4.0.0
+ react: 18.2.0
+ react-property: 2.0.0
+ style-to-js: 1.1.3
+ dev: false
+
+ resolution: {integrity: sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-uxbSI98wmFT/G4P2zXx4OVx04qWUmyFPrD2/CNepa2Zo3GPNaCaaxElDgwUrwYWkK1nr9fft0Ya8dws8coDLLQ==}
+ dependencies:
+ domelementtype: 2.3.0
+ domhandler: 5.0.3
+ domutils: 3.1.0
+ entities: 4.5.0
+ dev: false
+
+ resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==}
+ engines: {node: '>= 0.8'}
+ dependencies:
+ depd: 2.0.0
+ inherits: 2.0.4
+ setprototypeof: 1.2.0
+ statuses: 2.0.1
+ toidentifier: 1.0.1
+ dev: true
+
+ resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==}
+ engines: {node: '>= 6'}
+ dependencies:
+ '@tootallnate/once': 2.0.0
+ agent-base: 6.0.2
+ debug: 4.3.4
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==}
+ engines: {node: '>= 6.0.0'}
+ dependencies:
+ agent-base: 5.1.1
+ debug: 4.3.4
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==}
+ engines: {node: '>= 6'}
+ dependencies:
+ agent-base: 6.0.2
+ debug: 4.3.4
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==}
+ engines: {node: '>=10.17.0'}
+ dev: true
+
+ resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==}
+ engines: {node: '>=0.10.0'}
+ dependencies:
+ safer-buffer: 2.1.2
+ dev: true
+
+ resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
+ engines: {node: '>=0.10.0'}
+ dependencies:
+ safer-buffer: 2.1.2
+
+ resolution: {integrity: sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==}
+ engines: {node: ^10 || ^12 || >= 14}
+ peerDependencies:
+ postcss: ^8.1.0
+ dependencies:
+ postcss: 8.4.27
+ dev: false
+
+ resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
+ dev: true
+
+ resolution: {integrity: sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==}
+ engines: {node: '>= 4'}
+ dev: true
+
+ resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==}
+ engines: {node: '>= 4'}
+
+ resolution: {integrity: sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==}
+ engines: {node: '>=0.10.0'}
+ hasBin: true
+ requiresBuild: true
+ optional: true
+
+ resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==}
+ engines: {node: '>=6'}
+ dependencies:
+ parent-module: 1.0.1
+ resolve-from: 4.0.0
+
+ resolution: {integrity: sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==}
+ engines: {node: '>=0.8.19'}
+
+ resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==}
+ engines: {node: '>=12'}
+ dev: true
+
+ resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}
+ dependencies:
+ once: 1.4.0
+ wrappy: 1.0.2
+
+ resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
+
+ resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==}
+ dev: true
+
+ resolution: {integrity: sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==}
+ dev: false
+
+ resolution: {integrity: sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==}
+ engines: {node: '>=12.0.0'}
+ dependencies:
+ ansi-escapes: 4.3.2
+ chalk: 4.1.2
+ cli-cursor: 3.1.0
+ cli-width: 3.0.0
+ external-editor: 3.1.0
+ figures: 3.2.0
+ lodash: 4.17.21
+ mute-stream: 0.0.8
+ ora: 5.4.1
+ run-async: 2.4.1
+ rxjs: 7.8.0
+ string-width: 4.2.3
+ strip-ansi: 6.0.1
+ through: 2.3.8
+ wrap-ansi: 7.0.0
+ dev: true
+
+ resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ get-intrinsic: 1.2.1
+ has: 1.0.3
+ side-channel: 1.0.4
+ dev: true
+
+ resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==}
+ dependencies:
+ loose-envify: 1.4.0
+
+ resolution: {integrity: sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==}
+ dev: true
+
+ resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==}
+ engines: {node: '>= 0.10'}
+ dev: true
+
+ resolution: {integrity: sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ has-tostringtag: 1.0.0
+ dev: true
+
+ resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==}
+ dependencies:
+ call-bind: 1.0.2
+ get-intrinsic: 1.2.1
+ is-typed-array: 1.1.10
+ dev: true
+
+ resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==}
+
+ resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==}
+ dependencies:
+ has-bigints: 1.0.2
+ dev: true
+
+ resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}
+ engines: {node: '>=8'}
+ dependencies:
+ binary-extensions: 2.2.0
+
+ resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ has-tostringtag: 1.0.0
+ dev: true
+
+ resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==}
+ engines: {node: '>=6'}
+ dependencies:
+ builtin-modules: 3.3.0
+ dev: true
+
+ resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==}
+ engines: {node: '>= 0.4'}
+ dev: true
+
+ resolution: {integrity: sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==}
+ dependencies:
+ has: 1.0.3
+
+ resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ has-tostringtag: 1.0.0
+ dev: true
+
+ resolution: {integrity: sha512-YDoFpuZWu1VRXlsnlYMzKyVRITXj7Ej/V9gXQ2/pAe7X1J7M/RNOqaIYi6qUn+B7nGyB9pDXrv02dsB58d2ZAQ==}
+ dev: true
+
+ resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==}
+ engines: {node: '>=8'}
+ hasBin: true
+ dev: true
+
+ resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ has-tostringtag: 1.0.0
+ dev: true
+
+ resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
+ engines: {node: '>=0.10.0'}
+ dependencies:
+ is-extglob: 2.1.1
+
+ resolution: {integrity: sha512-rcfALRIb1YewtnksfRIHGcIY93QnK8BIQ/2c9yDYcG/Y6+vRoJuTWBmmSEbyLLYtXm7q35pHOHbZFQBaLrhlWQ==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==}
+ dev: true
+
+ resolution: {integrity: sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.2.0
+ dev: true
+
+ resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==}
+ engines: {node: '>= 0.4'}
+ dev: true
+
+ resolution: {integrity: sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==}
+ dev: true
+
+ resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ has-tostringtag: 1.0.0
+ dev: true
+
+ resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
+ engines: {node: '>=0.12.0'}
+
+ resolution: {integrity: sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==}
+ engines: {node: '>=6'}
+ dev: true
+
+ resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==}
+ engines: {node: '>=0.10.0'}
+ dependencies:
+ isobject: 3.0.1
+ dev: true
+
+ resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==}
+ dev: true
+
+ resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ has-tostringtag: 1.0.0
+ dev: true
+
+ resolution: {integrity: sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==}
+ dev: true
+
+ resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==}
+ dependencies:
+ call-bind: 1.0.2
+ dev: true
+
+ resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ has-tostringtag: 1.0.0
+ dev: true
+
+ resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ has-symbols: 1.0.3
+ dev: true
+
+ resolution: {integrity: sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ available-typed-arrays: 1.0.5
+ call-bind: 1.0.2
+ for-each: 0.3.3
+ gopd: 1.0.1
+ has-tostringtag: 1.0.0
+ dev: true
+
+ resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==}
+ engines: {node: '>=10'}
+ dev: true
+
+ resolution: {integrity: sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==}
+ dev: true
+
+ resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==}
+ dependencies:
+ call-bind: 1.0.2
+ dev: true
+
+ resolution: {integrity: sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==}
+ dependencies:
+ call-bind: 1.0.2
+ get-intrinsic: 1.2.1
+ dev: true
+
+ resolution: {integrity: sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==}
+
+ resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==}
+ engines: {node: '>=8'}
+ dependencies:
+ is-docker: 2.2.1
+ dev: true
+
+ resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==}
+ dev: true
+
+ resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==}
+ dev: true
+
+ resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
+
+ resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==}
+ engines: {node: '>=8'}
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/parser': 7.22.7
+ '@istanbuljs/schema': 0.1.3
+ istanbul-lib-coverage: 3.2.0
+ semver: 6.3.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==}
+ engines: {node: '>=8'}
+ dependencies:
+ istanbul-lib-coverage: 3.2.0
+ make-dir: 3.1.0
+ supports-color: 7.2.0
+ dev: true
+
+ resolution: {integrity: sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==}
+ engines: {node: '>=8'}
+ dependencies:
+ html-escaper: 2.0.2
+ istanbul-lib-report: 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-MXbxovZ/Pm42f6cDIDkl3xpwv1AGwObKwfmjs2nQePiy85tP3fatofl3FC1aBsOtP/6fq5SbtgHwWcMsLP+bDw==}
+ engines: {node: '>=14'}
+ dependencies:
+ '@isaacs/cliui': 8.0.2
+ optionalDependencies:
+ '@pkgjs/parseargs': 0.11.0
+
+ resolution: {integrity: sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==}
+ engines: {node: '>=10'}
+ hasBin: true
+ dependencies:
+ async: 3.2.4
+ chalk: 4.1.2
+ filelist: 1.0.4
+ minimatch: 3.1.2
+ dev: true
+
+ resolution: {integrity: sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw==}
+ engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
+ dependencies:
+ chalk: 4.1.2
+ diff-sequences: 27.5.1
+ jest-get-type: 27.5.1
+ pretty-format: 27.5.1
+ dev: true
+
+ resolution: {integrity: sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==}
+ engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
+ dev: true
+
+ resolution: {integrity: sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/types': 29.6.1
+ '@types/graceful-fs': 4.1.6
+ '@types/node': 17.0.19
+ anymatch: 3.1.3
+ fb-watchman: 2.0.2
+ graceful-fs: 4.2.10
+ jest-regex-util: 29.4.3
+ jest-util: 29.6.1
+ jest-worker: 29.5.0
+ micromatch: 4.0.5
+ walker: 1.0.8
+ optionalDependencies:
+ fsevents: 2.3.2
+ dev: true
+
+ resolution: {integrity: sha512-K4jKbY1d4ENhbrG2zuPWaQBvDly+iZ2yAW+T1fATN78hc0sInwn7wZB8XtlNnvHug5RMwV897Xm4LqmPM4e2Og==}
+ engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
+ dependencies:
+ '@jest/types': 27.5.1
+ '@types/node': 17.0.19
+ dev: true
+
+ resolution: {integrity: sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dev: true
+
+ resolution: {integrity: sha512-NRFCcjc+/uO3ijUVyNOQJluf8PtGCe/W6cix36+M3cTFgiYqFOOW5MgN4JOOcvbUhcKTYVd1CvHz/LWi8d16Mg==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/types': 29.6.1
+ '@types/node': 17.0.19
+ chalk: 4.1.2
+ ci-info: 3.8.0
+ graceful-fs: 4.2.10
+ picomatch: 2.3.1
+ dev: true
+
+ resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==}
+ engines: {node: '>= 10.13.0'}
+ dependencies:
+ '@types/node': 17.0.19
+ merge-stream: 2.0.0
+ supports-color: 8.1.1
+ dev: false
+
+ resolution: {integrity: sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@types/node': 17.0.19
+ jest-util: 29.6.1
+ merge-stream: 2.0.0
+ supports-color: 8.1.1
+ dev: true
+
+ resolution: {integrity: sha512-QAdOptna2NYiSSpv0O/BwoHBSmz4YhpzJHyi+fnMRTXFjp7B8i/YG5Z8IfusxB1ufjcD2Sre1F3R+nX3fvy7gg==}
+ hasBin: true
+
+ resolution: {integrity: sha512-pXhx8/MeRUAHbzayerEUf9NHvP+Ba3q9WAvIMjaSwwuSCKEFhb8UW4XuZPC+Bv4u2ufvlyrxIZ+vy5UJ3f8JsQ==}
+ engines: {node: '>=12.20.0'}
+ peerDependencies:
+ '@types/react': '>=17.0.0'
+ react: '>=17.0.0'
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ react:
+ optional: true
+ dependencies:
+ '@types/react': 18.2.19
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
+
+ resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==}
+ hasBin: true
+ dependencies:
+ argparse: 1.0.10
+ esprima: 4.0.1
+ dev: true
+
+ resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==}
+ hasBin: true
+ dependencies:
+ argparse: 2.0.1
+
+ resolution: {integrity: sha512-7eCC1knD7bLUPuSCwXsMZUH51O8jIcoVyKtI6P0XM0IVzlGjckPy3FIwQlorzbN0Sg79oK+RlohN32Mqf/lrYA==}
+ hasBin: true
+ peerDependencies:
+ '@babel/preset-env': ^7.1.6
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/parser': 7.22.7
+ '@babel/plugin-proposal-class-properties': 7.18.6(@babel/[email protected])
+ '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/[email protected])
+ '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/[email protected])
+ '@babel/plugin-transform-modules-commonjs': 7.22.5(@babel/[email protected])
+ '@babel/preset-env': 7.22.9(@babel/[email protected])
+ '@babel/preset-flow': 7.22.5(@babel/[email protected])
+ '@babel/preset-typescript': 7.17.12(@babel/[email protected])
+ '@babel/register': 7.22.5(@babel/[email protected])
+ babel-core: 7.0.0-bridge.0(@babel/[email protected])
+ chalk: 4.1.2
+ flow-parser: 0.209.0
+ graceful-fs: 4.2.10
+ micromatch: 4.0.5
+ neo-async: 2.6.2
+ node-dir: 0.1.17
+ recast: 0.21.5
+ temp: 0.8.4
+ write-file-atomic: 2.4.3
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-/9AVW7xNbsBv6GfWho4TTNjEo9fe6Zhf9O7s0Fhhr3u+awPwAJMKwAMXnkk5vBxflqLW9hTHX/0cs+P3gW+cQw==}
+ engines: {node: '>=16'}
+ peerDependencies:
+ canvas: ^2.5.0
+ peerDependenciesMeta:
+ canvas:
+ optional: true
+ dependencies:
+ abab: 2.0.6
+ cssstyle: 3.0.0
+ data-urls: 4.0.0
+ decimal.js: 10.4.3
+ domexception: 4.0.0
+ form-data: 4.0.0
+ html-encoding-sniffer: 3.0.0
+ http-proxy-agent: 5.0.0
+ https-proxy-agent: 5.0.1
+ is-potential-custom-element-name: 1.0.1
+ nwsapi: 2.2.4
+ parse5: 7.1.2
+ rrweb-cssom: 0.6.0
+ saxes: 6.0.0
+ symbol-tree: 3.2.4
+ tough-cookie: 4.1.2
+ w3c-xmlserializer: 4.0.0
+ webidl-conversions: 7.0.0
+ whatwg-encoding: 2.0.0
+ whatwg-mimetype: 3.0.0
+ whatwg-url: 12.0.1
+ ws: 8.13.0
+ xml-name-validator: 4.0.0
+ transitivePeerDependencies:
+ - bufferutil
+ - supports-color
+ - utf-8-validate
+ dev: true
+
+ resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==}
+ hasBin: true
+ dev: true
+
+ resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==}
+ engines: {node: '>=4'}
+ hasBin: true
+ dev: true
+
+ resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==}
+ engines: {node: '>=6'}
+ hasBin: true
+ dev: true
+
+ resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==}
+ dev: true
+
+ resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==}
+
+ resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==}
+
+ resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==}
+ dev: true
+
+ resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==}
+
+ resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==}
+ hasBin: true
+ dependencies:
+ minimist: 1.2.6
+ dev: true
+
+ resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==}
+ engines: {node: '>=6'}
+ hasBin: true
+
+ resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==}
+ dev: true
+
+ resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==}
+ dependencies:
+ universalify: 2.0.0
+ optionalDependencies:
+ graceful-fs: 4.2.10
+
+ resolution: {integrity: sha512-XzO9luP6L0xkxwhIJMTJQpZo/eeN60K08jHdexfD569AGxeNug6UketeHXEhROoM8aR7EcUoOQmIhcJQjcuq8Q==}
+ engines: {node: '>=4.0'}
+ dependencies:
+ array-includes: 3.1.5
+ object.assign: 4.1.4
+ dev: true
+
+ resolution: {integrity: sha512-ftuDnJbcbOckGY11OO+zg3OofESlbR5DRl2cmN8HeWeeFIV7wTXvAOx8kEjZjobhA+9wh2fbKeO6cdcA9Mnovg==}
+ hasBin: true
+ dependencies:
+ commander: 8.3.0
+ dev: false
+
+ resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==}
+ engines: {node: '>=6'}
+ dev: true
+
+ resolution: {integrity: sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==}
+ engines: {node: '>= 8'}
+ dev: false
+
+ resolution: {integrity: sha512-uMCj6+hZYDoffuvAJjFAPz56E9uoowFHmTkqRtRq5WyC5Q6Cu/fTZKNQpX/RbzChBYLLl3lo8CjFZBAZXq9qFg==}
+ dev: true
+
+ resolution: {integrity: sha512-L0IqwlIXjilBVVYKFT37X9Ih11Um5NEl9cbJIuU/SwP/zEEAbBPOnEeeuxVMf45ydWQRDQN3Nqc96OgbH1K+Pg==}
+ dev: true
+
+ resolution: {integrity: sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ==}
+ dependencies:
+ language-subtag-registry: 0.3.21
+ dev: true
+
+ resolution: {integrity: sha512-aXpZJRnTkpK6gQ/z4nk+ZBLd/Qdp118cvPruLSIQzQNRhKwEcdXCOzXuF55VDqIiuAaY3UGZ10DJtvZzDcvsxg==}
+ engines: {node: '>=14.0.0'}
+ dependencies:
+ app-root-dir: 1.0.2
+ dotenv: 16.0.3
+ dotenv-expand: 10.0.0
+
+ resolution: {integrity: sha512-C+uDBV7kS7W5fJlUjq5mPBeBVhYpTIm5gB09APT9o3n/ILeaXVsiSFTbZpTJCJwQ/Crczfn3DmfQFwxYusWFug==}
+ engines: {node: '>= 14.15.0'}
+ peerDependencies:
+ less: ^3.5.0 || ^4.0.0
+ webpack: ^5.0.0
+ dependencies:
+ klona: 2.0.6
+ less: 4.1.3
+ webpack: 5.88.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-w16Xk/Ta9Hhyei0Gpz9m7VS8F28nieJaL/VyShID7cYvP6IL5oHeL6p4TXSDJqZE/lNv0oJ2pGVjJsRkfwm5FA==}
+ engines: {node: '>=6'}
+ hasBin: true
+ dependencies:
+ copy-anything: 2.0.6
+ parse-node-version: 1.0.1
+ tslib: 2.5.0
+ optionalDependencies:
+ errno: 0.1.8
+ graceful-fs: 4.2.10
+ image-size: 0.5.5
+ make-dir: 2.1.0
+ mime: 1.6.0
+ needle: 3.2.0
+ source-map: 0.6.1
+ transitivePeerDependencies:
+ - supports-color
+
+ resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==}
+ engines: {node: '>=6'}
+ dev: true
+
+ resolution: {integrity: sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==}
+ engines: {node: '>= 0.8.0'}
+ dependencies:
+ prelude-ls: 1.1.2
+ type-check: 0.3.2
+ dev: true
+
+ resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}
+ engines: {node: '>= 0.8.0'}
+ dependencies:
+ prelude-ls: 1.2.1
+ type-check: 0.4.0
+
+ resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}
+
+ resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==}
+ engines: {node: '>=4'}
+ dependencies:
+ graceful-fs: 4.2.10
+ parse-json: 4.0.0
+ pify: 3.0.0
+ strip-bom: 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==}
+ engines: {node: '>=6.11.5'}
+ dev: false
+
+ resolution: {integrity: sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==}
+ engines: {node: '>=8.9.0'}
+ dependencies:
+ big.js: 5.2.2
+ emojis-list: 3.0.0
+ json5: 2.2.3
+ dev: false
+
+ resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==}
+ engines: {node: '>=14'}
+ dev: true
+
+ resolution: {integrity: sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==}
+ engines: {node: '>=4'}
+ dependencies:
+ p-locate: 2.0.0
+ path-exists: 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==}
+ engines: {node: '>=6'}
+ dependencies:
+ p-locate: 3.0.0
+ path-exists: 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==}
+ engines: {node: '>=8'}
+ dependencies:
+ p-locate: 4.1.0
+
+ resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==}
+ engines: {node: '>=10'}
+ dependencies:
+ p-locate: 5.0.0
+
+ resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==}
+ dev: true
+
+ resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==}
+ dev: false
+
+ resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==}
+
+ resolution: {integrity: sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==}
+ dev: true
+
+ resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==}
+ dev: false
+
+ resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
+
+ resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==}
+ engines: {node: '>=10'}
+ dependencies:
+ chalk: 4.1.2
+ is-unicode-supported: 0.1.0
+ dev: true
+
+ resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==}
+ hasBin: true
+ dependencies:
+ js-tokens: 4.0.0
+
+ resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==}
+ dependencies:
+ get-func-name: 2.0.0
+ dev: true
+
+ resolution: {integrity: sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw==}
+ engines: {node: 14 || >=16.14}
+
+ resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==}
+ dependencies:
+ yallist: 3.1.1
+ dev: true
+
+ resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
+ engines: {node: '>=10'}
+ dependencies:
+ yallist: 4.0.0
+
+ resolution: {integrity: sha512-znyvziBEUQ7CKR31GiU4viomQbJrpDLG5ac+FajwiZIavC3YbPFLkzQx3dCXT4JWJx/pB34EwmtiZ0ElGZX0PA==}
+ peerDependencies:
+ react: ^16.5.1 || ^17.0.0 || ^18.0.0
+ dependencies:
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==}
+ hasBin: true
+ dev: true
+
+ resolution: {integrity: sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==}
+ engines: {node: '>=12'}
+ dependencies:
+ '@jridgewell/sourcemap-codec': 1.4.15
+ dev: true
+
+ resolution: {integrity: sha512-mbVKXPmS0z0G4XqFDCTllmDQ6coZzn94aMlb0o/A4HEHJCKcanlDZwYJgwnkmgD3jyWhUgj9VsPrfd972yPffA==}
+ engines: {node: '>=12'}
+ dependencies:
+ '@jridgewell/sourcemap-codec': 1.4.15
+ dev: true
+
+ resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==}
+ engines: {node: '>=6'}
+ dependencies:
+ pify: 4.0.1
+ semver: 5.7.1
+
+ resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==}
+ engines: {node: '>=8'}
+ dependencies:
+ semver: 6.3.1
+
+ resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==}
+ dependencies:
+ tmpl: 1.0.5
+ dev: true
+
+ resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-0aF7ZmVon1igznGI4VS30yugpduQW3y3GkcgGJOp7d8x8QrizhigUxjI/m2UojsXXto+jLAH3KSz+xOJTiORjg==}
+
+ resolution: {integrity: sha512-3l4/Bigjm4bEqjCR6Xr+d4DtM1X6vvtGsMGSjJYyep8RjjIvcWtrXBS8Wbfe1/P+atKNMccpsraESIaWVplzVg==}
+ engines: {node: '>= 10'}
+ peerDependencies:
+ react: '>= 0.14.0'
+ dependencies:
+ react: 18.2.0
+ dev: true
+
+ resolution: {integrity: sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==}
+ dev: true
+
+ resolution: {integrity: sha512-k8AJ6aNnUkB7IE+5azR9h81O5EQ/cTDXtWdMq9Kk5KcEW/8ritU5CeLg/9HhOC++nALHBlaogJ5jz0Ybk3kPMQ==}
+ dependencies:
+ unist-util-visit: 2.0.3
+ dev: true
+
+ resolution: {integrity: sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==}
+ dev: true
+
+ resolution: {integrity: sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==}
+ dev: false
+
+ resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==}
+
+ resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==}
+ engines: {node: '>= 0.6'}
+ dev: true
+
+ resolution: {integrity: sha512-/EuHYwAPdLtXwAwSZkh/Gutery6pD2KYd44oQLhAvQp/50mpyduZh8Q7PYHXTCJ+wuXxt7oij2LXyIJOOYFPog==}
+ dependencies:
+ map-or-similar: 1.5.0
+
+ resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==}
+ engines: {node: '>= 0.10.0'}
+ dev: true
+
+ resolution: {integrity: sha512-/d+PQ4GKmGvM9Bee/DPa8z3mXs/pkvJE2KEThngVNOqtmljC6K7NMPxtc2JeZYTmpWb9k/TmxjeL18ez3h7vCw==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
+ dependencies:
+ '@types/minimist': 1.2.2
+ camelcase-keys: 7.0.2
+ decamelize: 5.0.1
+ decamelize-keys: 1.1.1
+ hard-rejection: 2.1.0
+ minimist-options: 4.1.0
+ normalize-package-data: 3.0.3
+ read-pkg-up: 8.0.0
+ redent: 4.0.0
+ trim-newlines: 4.1.1
+ type-fest: 1.4.0
+ yargs-parser: 20.2.9
+ dev: true
+
+ resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==}
+ dev: true
+
+ resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==}
+
+ resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
+ engines: {node: '>= 8'}
+
+ resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==}
+ engines: {node: '>= 0.6'}
+ dev: true
+
+ resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==}
+ engines: {node: '>=8.6'}
+ dependencies:
+ braces: 3.0.2
+ picomatch: 2.3.1
+
+ resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
+ engines: {node: '>= 0.6'}
+
+ resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
+ engines: {node: '>= 0.6'}
+ dependencies:
+ mime-db: 1.52.0
+
+ resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==}
+ engines: {node: '>=4'}
+ hasBin: true
+
+ resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==}
+ engines: {node: '>=4.0.0'}
+ hasBin: true
+ dev: true
+
+ resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==}
+ engines: {node: '>=6'}
+ dev: true
+
+ resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==}
+ engines: {node: '>=4'}
+ dev: true
+
+ resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
+ dependencies:
+ brace-expansion: 1.1.11
+
+ resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==}
+ engines: {node: '>=10'}
+ dependencies:
+ brace-expansion: 2.0.1
+ dev: true
+
+ resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==}
+ engines: {node: '>=16 || 14 >=14.17'}
+ dependencies:
+ brace-expansion: 2.0.1
+
+ resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==}
+ engines: {node: '>= 6'}
+ dependencies:
+ arrify: 1.0.1
+ is-plain-obj: 1.1.0
+ kind-of: 6.0.3
+ dev: true
+
+ resolution: {integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==}
+
+ resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==}
+ engines: {node: '>=8'}
+ dependencies:
+ yallist: 4.0.0
+ dev: true
+
+ resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==}
+ engines: {node: '>= 8'}
+ dependencies:
+ minipass: 3.3.6
+ yallist: 4.0.0
+ dev: true
+
+ resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==}
+ dev: true
+
+ resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==}
+ hasBin: true
+ dependencies:
+ minimist: 1.2.6
+ dev: true
+
+ resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==}
+ engines: {node: '>=10'}
+ hasBin: true
+ dev: true
+
+ resolution: {integrity: sha512-ua8PAThnTwpprIaU47EPeZ/bPUVp2QYBbWMphUQpVdBI3Lgqzm5KZQ45Agm3YJedHXaIHl6pBGabaLSUPPSptg==}
+ dependencies:
+ acorn: 8.9.0
+ pathe: 1.1.1
+ pkg-types: 1.0.3
+ ufo: 1.1.2
+ dev: true
+
+ resolution: {integrity: sha512-aw9F9T9G2zpGipLLhSNh6ZpgUyUl4frcVmRN08uE1NWPWg43Wx6+sGPDbQ7E5iFZZDJW5b5bypMeAEHqTbIFag==}
+ engines: {node: '>= 8'}
+ dev: true
+
+ resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==}
+ engines: {node: '>=4'}
+ dev: true
+
+ resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==}
+ dev: true
+
+ resolution: {integrity: sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==}
+ dev: true
+
+ resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
+
+ resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
+
+ resolution: {integrity: sha512-Fqy/TaLKR32x4IkMwudJHJysBzVM/v/lSoMPS9f3QaHLOmb3xHN9YurSUnRt+2eEvNXLjVPij1wMBQtLmTbKsg==}
+ engines: {node: '>=14'}
+ hasBin: true
+ requiresBuild: true
+ peerDependencies:
+ typescript: '>= 4.4.x <= 5.1.x'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ dependencies:
+ '@mswjs/cookies': 0.2.2
+ '@mswjs/interceptors': 0.17.6
+ '@open-draft/until': 1.0.3
+ '@types/cookie': 0.4.1
+ '@types/js-levenshtein': 1.1.1
+ chalk: 4.1.1
+ chokidar: 3.5.3
+ cookie: 0.4.2
+ graphql: 16.6.0
+ headers-polyfill: 3.1.2
+ inquirer: 8.2.5
+ is-node-process: 1.2.0
+ js-levenshtein: 1.1.6
+ node-fetch: 2.6.7
+ outvariant: 1.4.0
+ path-to-regexp: 6.2.1
+ strict-event-emitter: 0.4.6
+ type-fest: 2.19.0
+ typescript: 5.1.6
+ yargs: 17.6.2
+ transitivePeerDependencies:
+ - encoding
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==}
+ dev: true
+
+ resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==}
+ dependencies:
+ any-promise: 1.3.0
+ object-assign: 4.1.1
+ thenify-all: 1.6.0
+
+ resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==}
+ engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
+ hasBin: true
+
+ resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==}
+ dev: true
+
+ resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
+
+ resolution: {integrity: sha512-oUvzXnyLiVyVGoianLijF9O/RecZUf7TkBfimjGrLM4eQhXyeJwM6GeAWccwfQ9aa4gMCZKqhAOuLaMIcQxajQ==}
+ engines: {node: '>= 4.4.x'}
+ hasBin: true
+ requiresBuild: true
+ dependencies:
+ debug: 3.2.7
+ iconv-lite: 0.6.3
+ sax: 1.2.4
+ transitivePeerDependencies:
+ - supports-color
+ optional: true
+
+ resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==}
+ engines: {node: '>= 0.6'}
+ dev: true
+
+ resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==}
+
+ resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==}
+ dev: true
+
+ resolution: {integrity: sha512-tmPX422rYgofd4epzrNoOXiE8XFZYOcCq1vD7MAXCDO+O+zndlA2ztdKKMa+EeuBG5tHETpr4ml4RGgpqDCCAg==}
+ engines: {node: '>= 0.10.5'}
+ dependencies:
+ minimatch: 3.1.2
+ dev: true
+
+ resolution: {integrity: sha512-9VvspTSUp2Sxbl+9vbZTlFGq9lHwE8GDVVekxx6YsNd1YH59sb3Ba8v3Y3cD8PkLNcileGGcA21PFjVl0jzDaw==}
+ dev: true
+
+ resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==}
+ engines: {node: 4.x || >=6.0.0}
+ peerDependencies:
+ encoding: ^0.1.0
+ peerDependenciesMeta:
+ encoding:
+ optional: true
+ dependencies:
+ whatwg-url: 5.0.0
+
+ resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==}
+ dev: true
+
+ resolution: {integrity: sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==}
+ dev: true
+
+ resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==}
+
+ resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==}
+ dependencies:
+ hosted-git-info: 2.8.9
+ resolve: 1.22.2
+ semver: 5.7.1
+ validate-npm-package-license: 3.0.4
+ dev: true
+
+ resolution: {integrity: sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==}
+ engines: {node: '>=10'}
+ dependencies:
+ hosted-git-info: 4.1.0
+ is-core-module: 2.12.0
+ semver: 7.5.4
+ validate-npm-package-license: 3.0.4
+ dev: true
+
+ resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ resolution: {integrity: sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==}
+ engines: {node: '>= 4'}
+ hasBin: true
+ dependencies:
+ ansi-styles: 3.2.1
+ chalk: 2.4.2
+ cross-spawn: 6.0.5
+ memorystream: 0.3.1
+ minimatch: 3.1.2
+ pidtree: 0.3.1
+ read-pkg: 3.0.0
+ shell-quote: 1.7.4
+ string.prototype.padend: 3.1.4
+ dev: true
+
+ resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==}
+ engines: {node: '>=8'}
+ dependencies:
+ path-key: 3.1.1
+ dev: true
+
+ resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==}
+ dependencies:
+ boolbase: 1.0.0
+ dev: false
+
+ resolution: {integrity: sha512-NHj4rzRo0tQdijE9ZqAx6kYDcoRwYwSYzCA8MY3JzfxlrvEU0jhnhJT9BhqhJs7I/dKcrDm6TyulaRqZPIhN5g==}
+ dev: true
+
+ resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==}
+ engines: {node: '>= 6'}
+
+ resolution: {integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==}
+
+ resolution: {integrity: sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.2.0
+ dev: true
+
+ resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==}
+ engines: {node: '>= 0.4'}
+ dev: true
+
+ resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.2.0
+ has-symbols: 1.0.3
+ object-keys: 1.1.1
+ dev: true
+
+ resolution: {integrity: sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.2.0
+ es-abstract: 1.20.5
+ dev: true
+
+ resolution: {integrity: sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.2.0
+ es-abstract: 1.20.5
+ dev: true
+
+ resolution: {integrity: sha512-LYLe4tivNQzq4JdaWW6WO3HMZZJWzkkH8fnI6EebWl0VZth2wL2Lovm74ep2/gZzlaTdV62JZHEqHQ2yVn8Q/A==}
+ dependencies:
+ define-properties: 1.2.0
+ es-abstract: 1.20.5
+ dev: true
+
+ resolution: {integrity: sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.2.0
+ es-abstract: 1.20.5
+ dev: true
+
+ resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==}
+ engines: {node: '>= 0.8'}
+ dependencies:
+ ee-first: 1.1.1
+ dev: true
+
+ resolution: {integrity: sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==}
+ engines: {node: '>= 0.8'}
+ dev: true
+
+ resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
+ dependencies:
+ wrappy: 1.0.2
+
+ resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==}
+ engines: {node: '>=6'}
+ dependencies:
+ mimic-fn: 2.1.0
+ dev: true
+
+ resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==}
+ engines: {node: '>=12'}
+ dependencies:
+ define-lazy-prop: 2.0.0
+ is-docker: 2.2.1
+ is-wsl: 2.2.0
+ dev: true
+
+ resolution: {integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==}
+ engines: {node: '>= 0.8.0'}
+ dependencies:
+ deep-is: 0.1.4
+ fast-levenshtein: 2.0.6
+ levn: 0.3.0
+ prelude-ls: 1.1.2
+ type-check: 0.3.2
+ word-wrap: 1.2.3
+ dev: true
+
+ resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==}
+ engines: {node: '>= 0.8.0'}
+ dependencies:
+ '@aashutoshrathi/word-wrap': 1.2.6
+ deep-is: 0.1.4
+ fast-levenshtein: 2.0.6
+ levn: 0.4.1
+ prelude-ls: 1.2.1
+ type-check: 0.4.0
+
+ resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==}
+ engines: {node: '>=10'}
+ dependencies:
+ bl: 4.1.0
+ chalk: 4.1.2
+ cli-cursor: 3.1.0
+ cli-spinners: 2.7.0
+ is-interactive: 1.0.0
+ is-unicode-supported: 0.1.0
+ log-symbols: 4.1.0
+ strip-ansi: 6.0.1
+ wcwidth: 1.0.1
+ dev: true
+
+ resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ resolution: {integrity: sha512-AlWY719RF02ujitly7Kk/0QlV+pXGFDHrHf9O2OKqyqgBieaPOIeuSkL8sRK6j2WK+/ZAURq2kZsY0d8JapUiw==}
+ dev: true
+
+ resolution: {integrity: sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==}
+ engines: {node: '>=4'}
+ dependencies:
+ p-try: 1.0.0
+ dev: true
+
+ resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}
+ engines: {node: '>=6'}
+ dependencies:
+ p-try: 2.2.0
+
+ resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==}
+ engines: {node: '>=10'}
+ dependencies:
+ yocto-queue: 0.1.0
+
+ resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
+ dependencies:
+ yocto-queue: 1.0.0
+ dev: true
+
+ resolution: {integrity: sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==}
+ engines: {node: '>=4'}
+ dependencies:
+ p-limit: 1.3.0
+ dev: true
+
+ resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==}
+ engines: {node: '>=6'}
+ dependencies:
+ p-limit: 2.3.0
+ dev: true
+
+ resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==}
+ engines: {node: '>=8'}
+ dependencies:
+ p-limit: 2.3.0
+
+ resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==}
+ engines: {node: '>=10'}
+ dependencies:
+ p-limit: 3.1.0
+
+ resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==}
+ engines: {node: '>=10'}
+ dependencies:
+ aggregate-error: 3.1.0
+ dev: true
+
+ resolution: {integrity: sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==}
+ engines: {node: '>=4'}
+ dev: true
+
+ resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==}
+ dev: true
+
+ resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}
+ engines: {node: '>=6'}
+ dependencies:
+ callsites: 3.1.0
+
+ resolution: {integrity: sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==}
+ engines: {node: '>=4'}
+ dependencies:
+ error-ex: 1.3.2
+ json-parse-better-errors: 1.0.2
+ dev: true
+
+ resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==}
+ engines: {node: '>=8'}
+ dependencies:
+ '@babel/code-frame': 7.22.5
+ error-ex: 1.3.2
+ json-parse-even-better-errors: 2.3.1
+ lines-and-columns: 1.2.4
+
+ resolution: {integrity: sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==}
+ engines: {node: '>= 0.10'}
+
+ resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==}
+ dependencies:
+ entities: 4.5.0
+ dev: true
+
+ resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==}
+ engines: {node: '>= 0.8'}
+ dev: true
+
+ resolution: {integrity: sha512-FLJFd+YZseL/eG5E+4UN1pQkh17bH1J/UrFdyCeZIOqXyAx6qT0AX1rotzAHcv2pAckBUR/ZlTkQq16Bq8x+FA==}
+ dependencies:
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==}
+ engines: {node: '>=4'}
+ dev: true
+
+ resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==}
+ engines: {node: '>=4'}
+ dev: true
+
+ resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
+
+ resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==}
+ engines: {node: '>=16 || 14 >=14.17'}
+ dependencies:
+ lru-cache: 10.0.0
+ minipass: 5.0.0
+
+ resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==}
+ dev: true
+
+ resolution: {integrity: sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==}
+ dev: true
+
+ resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==}
+ engines: {node: '>=4'}
+ dependencies:
+ pify: 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==}
+ dev: true
+
+ resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==}
+ dev: true
+
+ resolution: {integrity: sha512-FhJ+YbOSBb9/rIl2ZeE/QHEsWn7PqNYt8ARAY3kIgNGOk13g9FGyIY6JIl/xB/3TFRVoTv5as0l11weORrTekA==}
+ dependencies:
+ buffer-from: 1.1.2
+ duplexify: 3.7.1
+ through2: 2.0.5
+ dev: true
+
+ resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==}
+ dev: true
+
+ resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
+
+ resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
+ engines: {node: '>=8.6'}
+
+ resolution: {integrity: sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==}
+ engines: {node: '>=0.10'}
+ hasBin: true
+ dev: true
+
+ resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==}
+ engines: {node: '>=4'}
+ dev: true
+
+ resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==}
+ engines: {node: '>= 6'}
+
+ resolution: {integrity: sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==}
+ engines: {node: '>=6'}
+ dependencies:
+ find-up: 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==}
+ engines: {node: '>=8'}
+ dependencies:
+ find-up: 4.1.0
+
+ resolution: {integrity: sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==}
+ engines: {node: '>=10'}
+ dependencies:
+ find-up: 5.0.0
+
+ resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==}
+ dependencies:
+ jsonc-parser: 3.2.0
+ mlly: 1.4.0
+ pathe: 1.1.1
+ dev: true
+
+ resolution: {integrity: sha512-sQYZt31dwkqxOrP7xy2ggDfEzUxM1lodjhsQ3NMMv5uGTRDsLxU0e4xf4wwMkF2gplIxf17QMBCodSFgm6bFVQ==}
+ engines: {node: '>=16'}
+ hasBin: true
+ dev: true
+
+ resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==}
+ engines: {node: '>=4'}
+ dev: true
+
+ resolution: {integrity: sha512-Sz2Lkdxz6F2Pgnpi9U5Ng/WdWAUZxmHrNPoVlm3aAemxoy2Qy7LGjQg4uf8qKelDAUW94F4np3iH2YPf2qefcQ==}
+ engines: {node: '>=10'}
+ dependencies:
+ '@babel/runtime': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-TipgjGyzP5QzEhsOZUaIkeO5mKeMFpebWzRogWG/ysonUlnHcq5aJe0jOjpfzUU8PeSaBQnrE8ehR0QA5vs8PQ==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.2
+ dependencies:
+ postcss: 8.4.27
+ postcss-selector-parser: 6.0.13
+ postcss-value-parser: 4.2.0
+ dev: false
+
+ resolution: {integrity: sha512-EuO+bAUmutWoZYgHn2T1dG1pPqHU6L4TjzPlu4t1wZGXQ/fxV16xg2EJmYi0z+6r+MGV1yvpx1BHkUaRrPa2bw==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ browserslist: 4.21.9
+ caniuse-api: 3.0.0
+ colord: 2.9.3
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ dev: false
+
+ resolution: {integrity: sha512-U5D8QhVwqT++ecmy8rnTb+RL9n/B806UVaS3m60lqle4YDFcpbS3ae5bTQIh3wOGUSDHSEtMYLs/38dNG7EYFw==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ browserslist: 4.21.9
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ dev: false
+
+ resolution: {integrity: sha512-p2skSGqzPMZkEQvJsgnkBhCn8gI7NzRH2683EEjrIkoMiwRELx68yoUJ3q3DGSGuQ8Ug9Gsn+OuDr46yfO+eFw==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ dev: false
+
+ resolution: {integrity: sha512-bU1SXIizMLtDW4oSsi5C/xHKbhLlhek/0/yCnoMQany9k3nPBq+Ctsv/9oMmyqbR96HYHxZcHyK2HR5P/mqoGA==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ dev: false
+
+ resolution: {integrity: sha512-b+h1S1VT6dNhpcg+LpyiUrdnEZfICF0my7HAKgJixJLW7BnNmpRH34+uw/etf5AhOlIhIAuXApSzzDzMI9K/gQ==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ dev: false
+
+ resolution: {integrity: sha512-4VELwssYXDFigPYAZ8vL4yX4mUepF/oCBeeIT4OXsJPYOtvJumyz9WflmJWTfDwCUcpDR+z0zvCWBXgTx35SVw==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ dev: false
+
+ resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==}
+ engines: {node: '>=14.0.0'}
+ peerDependencies:
+ postcss: ^8.0.0
+ dependencies:
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ read-cache: 1.0.0
+ resolve: 1.22.2
+
+ resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==}
+ engines: {node: ^12 || ^14 || >= 16}
+ peerDependencies:
+ postcss: ^8.4.21
+ dependencies:
+ camelcase-css: 2.0.1
+ postcss: 8.4.27
+
+ resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==}
+ engines: {node: '>= 14'}
+ peerDependencies:
+ postcss: '>=8.0.9'
+ ts-node: '>=9.0.0'
+ peerDependenciesMeta:
+ postcss:
+ optional: true
+ ts-node:
+ optional: true
+ dependencies:
+ lilconfig: 2.1.0
+ postcss: 8.4.27
+ yaml: 2.2.2
+
+ resolution: {integrity: sha512-qLAFjvR2BFNz1H930P7mj1iuWJFjGey/nVhimfOAAQ1ZyPpcClAxP8+A55Sl8mBvM+K2a9Pjgdj10KpANWrNfw==}
+ engines: {node: '>= 14.15.0'}
+ peerDependencies:
+ postcss: ^7.0.0 || ^8.0.1
+ webpack: ^5.0.0
+ dependencies:
+ cosmiconfig: 8.2.0
+ jiti: 1.18.2
+ klona: 2.0.6
+ postcss: 8.4.27
+ semver: 7.5.4
+ webpack: 5.88.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-4VSfd1lvGkLTLYcxFuISDtWUfFS4zXe0FpF149AyziftPFQIWxjvFSKhA4MIxMe4XM3yTDgQMbSNgzIVxChbIg==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ stylehacks: 6.0.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-a4tlmJIQo9SCjcfiCcCMg/ZCEe0XTkl/xK0XHBs955GWg9xDX3NwP9pwZ78QUOWB8/0XCjZeJn98Dae0zg6AAw==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ browserslist: 4.21.9
+ caniuse-api: 3.0.0
+ cssnano-utils: 4.0.0([email protected])
+ postcss: 8.4.27
+ postcss-selector-parser: 6.0.13
+ dev: false
+
+ resolution: {integrity: sha512-zNRAVtyh5E8ndZEYXA4WS8ZYsAp798HiIQ1V2UF/C/munLp2r1UGHwf1+6JFu7hdEhJFN+W1WJQKBrtjhFgEnA==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ dev: false
+
+ resolution: {integrity: sha512-wO0F6YfVAR+K1xVxF53ueZJza3L+R3E6cp0VwuXJQejnNUH0DjcAFe3JEBeTY1dLwGa0NlDWueCA1VlEfiKgAA==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ colord: 2.9.3
+ cssnano-utils: 4.0.0([email protected])
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ dev: false
+
+ resolution: {integrity: sha512-Fz/wMQDveiS0n5JPcvsMeyNXOIMrwF88n7196puSuQSWSa+/Ofc1gDOSY2xi8+A4PqB5dlYCKk/WfqKqsI+ReQ==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ browserslist: 4.21.9
+ cssnano-utils: 4.0.0([email protected])
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ dev: false
+
+ resolution: {integrity: sha512-ec/q9JNCOC2CRDNnypipGfOhbYPuUkewGwLnbv6omue/PSASbHSU7s6uSQ0tcFRVv731oMIx8k0SP4ZX6be/0g==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ postcss-selector-parser: 6.0.13
+ dev: false
+
+ resolution: {integrity: sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==}
+ engines: {node: ^10 || ^12 || >= 14}
+ peerDependencies:
+ postcss: ^8.1.0
+ dependencies:
+ postcss: 8.4.27
+ dev: false
+
+ resolution: {integrity: sha512-Zr/dB+IlXaEqdoslLHhhqecwj73vc3rDmOpsBNBEVk7P2aqAlz+Ijy0fFbU5Ie9PtreDOIgGa9MsLWakVGl+fA==}
+ engines: {node: ^10 || ^12 || >= 14}
+ peerDependencies:
+ postcss: ^8.1.0
+ dependencies:
+ icss-utils: 5.1.0([email protected])
+ postcss: 8.4.27
+ postcss-selector-parser: 6.0.13
+ postcss-value-parser: 4.2.0
+ dev: false
+
+ resolution: {integrity: sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg==}
+ engines: {node: ^10 || ^12 || >= 14}
+ peerDependencies:
+ postcss: ^8.1.0
+ dependencies:
+ postcss: 8.4.27
+ postcss-selector-parser: 6.0.13
+ dev: false
+
+ resolution: {integrity: sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==}
+ engines: {node: ^10 || ^12 || >= 14}
+ peerDependencies:
+ postcss: ^8.1.0
+ dependencies:
+ icss-utils: 5.1.0([email protected])
+ postcss: 8.4.27
+ dev: false
+
+ resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==}
+ engines: {node: '>=12.0'}
+ peerDependencies:
+ postcss: ^8.2.14
+ dependencies:
+ postcss: 8.4.27
+ postcss-selector-parser: 6.0.13
+
+ resolution: {integrity: sha512-cqundwChbu8yO/gSWkuFDmKrCZ2vJzDAocheT2JTd0sFNA4HMGoKMfbk2B+J0OmO0t5GUkiAkSM5yF2rSLUjgQ==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ dev: false
+
+ resolution: {integrity: sha512-Qyt5kMrvy7dJRO3OjF7zkotGfuYALETZE+4lk66sziWSPzlBEt7FrUshV6VLECkI4EN8Z863O6Nci4NXQGNzYw==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ dev: false
+
+ resolution: {integrity: sha512-mPCzhSV8+30FZyWhxi6UoVRYd3ZBJgTRly4hOkaSifo0H+pjDYcii/aVT4YE6QpOil15a5uiv6ftnY3rm0igPg==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ dev: false
+
+ resolution: {integrity: sha512-50W5JWEBiOOAez2AKBh4kRFm2uhrT3O1Uwdxz7k24aKtbD83vqmcVG7zoIwo6xI2FZ/HDlbrCopXhLeTpQib1A==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ dev: false
+
+ resolution: {integrity: sha512-KWkIB7TrPOiqb8ZZz6homet2KWKJwIlysF5ICPZrXAylGe2hzX/HSf4NTX2rRPJMAtlRsj/yfkrWGavFuB+c0w==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ dev: false
+
+ resolution: {integrity: sha512-tpIXWciXBp5CiFs8sem90IWlw76FV4oi6QEWfQwyeREVwUy39VSeSqjAT7X0Qw650yAimYW5gkl2Gd871N5SQg==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ dev: false
+
+ resolution: {integrity: sha512-ui5crYkb5ubEUDugDc786L/Me+DXp2dLg3fVJbqyAl0VPkAeALyAijF2zOsnZyaS1HyfPuMH0DwyY18VMFVNkg==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ browserslist: 4.21.9
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ dev: false
+
+ resolution: {integrity: sha512-98mvh2QzIPbb02YDIrYvAg4OUzGH7s1ZgHlD3fIdTHLgPLRpv1ZTKJDnSAKr4Rt21ZQFzwhGMXxpXlfrUBKFHw==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ dev: false
+
+ resolution: {integrity: sha512-7cfE1AyLiK0+ZBG6FmLziJzqQCpTQY+8XjMhMAz8WSBSCsCNNUKujgIgjCAmDT3cJ+3zjTXFkoD15ZPsckArVw==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ dev: false
+
+ resolution: {integrity: sha512-K36XzUDpvfG/nWkjs6d1hRBydeIxGpKS2+n+ywlKPzx1nMYDYpoGbcjhj5AwVYJK1qV2/SDoDEnHzlPD6s3nMg==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ cssnano-utils: 4.0.0([email protected])
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ dev: false
+
+ resolution: {integrity: sha512-s2UOnidpVuXu6JiiI5U+fV2jamAw5YNA9Fdi/GRK0zLDLCfXmSGqQtzpUPtfN66RtCbb9fFHoyZdQaxOB3WxVA==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ browserslist: 4.21.9
+ caniuse-api: 3.0.0
+ postcss: 8.4.27
+ dev: false
+
+ resolution: {integrity: sha512-FQ9f6xM1homnuy1wLe9lP1wujzxnwt1EwiigtWwuyf8FsqqXUDUp2Ulxf9A5yjlUOTdCJO6lonYjg1mgqIIi2w==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ dev: false
+
+ resolution: {integrity: sha512-HvExULSwLqHLgUy1rl3ANIqCsvMS0WHss2UOsXhXnQaZ9VCc2oBvIpXrl00IUFT5ZDITME0o6oiXeiHr2SAIfw==}
+ dev: true
+
+ resolution: {integrity: sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==}
+ engines: {node: '>=12.0'}
+ peerDependencies:
+ postcss: ^8.3.3
+ dependencies:
+ postcss: 8.4.27
+ dev: true
+
+ resolution: {integrity: sha512-NdxGCAZdRrwVI1sy59+Wzrh+pMMHxapGnpfenDVlMEXoOcvt4pGE0JLK9YY2F5dLxcFYA/YbVQKhcGU+FtSYQg==}
+ engines: {node: '>=4'}
+ dependencies:
+ cssesc: 3.0.0
+ util-deprecate: 1.0.2
+
+ resolution: {integrity: sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==}
+ engines: {node: '>=4'}
+ dependencies:
+ cssesc: 3.0.0
+ util-deprecate: 1.0.2
+
+ resolution: {integrity: sha512-r9zvj/wGAoAIodn84dR/kFqwhINp5YsJkLoujybWG59grR/IHx+uQ2Zo+IcOwM0jskfYX3R0mo+1Kip1VSNcvw==}
+ engines: {node: ^14 || ^16 || >= 18}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ postcss-value-parser: 4.2.0
+ svgo: 3.0.2
+ dev: false
+
+ resolution: {integrity: sha512-EPQzpZNxOxP7777t73RQpZE5e9TrnCrkvp7AH7a0l89JmZiPnS82y216JowHXwpBCQitfyxrof9TK3rYbi7/Yw==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ postcss: 8.4.27
+ postcss-selector-parser: 6.0.13
+ dev: false
+
+ resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
+
+ resolution: {integrity: sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==}
+ engines: {node: ^10 || ^12 || >=14}
+ dependencies:
+ nanoid: 3.3.6
+ picocolors: 1.0.0
+ source-map-js: 1.0.2
+
+ resolution: {integrity: sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==}
+ engines: {node: '>= 0.8.0'}
+ dev: true
+
+ resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
+ engines: {node: '>= 0.8.0'}
+
+ resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==}
+ engines: {node: '>=10.13.0'}
+ hasBin: true
+
+ resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==}
+ engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
+ dependencies:
+ ansi-regex: 5.0.1
+ ansi-styles: 5.2.0
+ react-is: 17.0.2
+ dev: true
+
+ resolution: {integrity: sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/schemas': 29.6.0
+ ansi-styles: 5.2.0
+ react-is: 18.2.0
+ dev: true
+
+ resolution: {integrity: sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==}
+ engines: {node: '>= 0.8'}
+
+ resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}
+ dev: true
+
+ resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==}
+ engines: {node: '>= 0.6.0'}
+ dev: true
+
+ resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==}
+ engines: {node: '>=0.4.0'}
+ dev: true
+
+ resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==}
+ engines: {node: '>= 6'}
+ dependencies:
+ kleur: 3.0.3
+ sisteransi: 1.0.5
+ dev: true
+
+ resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==}
+ dependencies:
+ loose-envify: 1.4.0
+ object-assign: 4.1.1
+ react-is: 16.13.1
+
+ resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==}
+ engines: {node: '>= 0.10'}
+ dependencies:
+ forwarded: 0.2.0
+ ipaddr.js: 1.9.1
+ dev: true
+
+ resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
+ dev: true
+
+ resolution: {integrity: sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==}
+ requiresBuild: true
+ optional: true
+
+ resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==}
+ dev: true
+
+ resolution: {integrity: sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==}
+ dependencies:
+ end-of-stream: 1.4.4
+ once: 1.4.0
+ dev: true
+
+ resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==}
+ dependencies:
+ end-of-stream: 1.4.4
+ once: 1.4.0
+ dev: true
+
+ resolution: {integrity: sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==}
+ dependencies:
+ duplexify: 3.7.1
+ inherits: 2.0.4
+ pump: 2.0.1
+ dev: true
+
+ resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-n13AWriBMPYxnpbb6bnaY5YoY6rGj8vPLrz6CZF3o0qJNEwlcfJVxBzYZ0NJsQ21UbdJoijPCDrM++SUVEz7+w==}
+ engines: {node: '>=8.16.0'}
+ dependencies:
+ '@types/mime-types': 2.1.1
+ debug: 4.3.4
+ extract-zip: 1.7.0
+ https-proxy-agent: 4.0.0
+ mime: 2.6.0
+ mime-types: 2.1.35
+ progress: 2.0.3
+ proxy-from-env: 1.1.0
+ rimraf: 2.7.1
+ ws: 6.2.2
+ transitivePeerDependencies:
+ - bufferutil
+ - supports-color
+ - utf-8-validate
+ dev: true
+
+ resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==}
+ engines: {node: '>=0.6'}
+ dependencies:
+ side-channel: 1.0.4
+ dev: true
+
+ resolution: {integrity: sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==}
+ engines: {node: '>=0.6'}
+ dependencies:
+ side-channel: 1.0.4
+
+ resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==}
+ dev: true
+
+ resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
+
+ resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==}
+ engines: {node: '>=10'}
+ dev: true
+
+ resolution: {integrity: sha512-BBea6L67bYLtdbOqfp8f58fPMqEwx0doL+pAi8TZyp2YWz8R9G8z9x75CZI8W+ftqhFHCpEX2cRnUUXK130iKA==}
+
+ resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==}
+ dependencies:
+ safe-buffer: 5.2.1
+ dev: false
+
+ resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==}
+ engines: {node: '>= 0.6'}
+ dev: true
+
+ resolution: {integrity: sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==}
+ engines: {node: '>= 0.8'}
+ dependencies:
+ bytes: 3.1.2
+ http-errors: 2.0.0
+ iconv-lite: 0.4.24
+ unpipe: 1.0.0
+ dev: true
+
+ resolution: {integrity: sha512-1exovf0uGTGyq5mXQT0zgQ80uvj2PCwvF8zY1RN9/vbJVSjSo3fsB/4L3ObbF7u70NduSiK4xu4Y6q1MHoUGEw==}
+ peerDependencies:
+ react: '>=16.8.0'
+ react-dom: '>=16.8.0'
+ dependencies:
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: true
+
+ resolution: {integrity: sha512-QIC3uOuyGGbtypbd5QEggsCSqVaPNu8kzUWquZ7JjW9fuWB9yv7WyixKmnaFelTLXFdq7h7zU6n/aBleBqe/dA==}
+ peerDependencies:
+ date-fns: ^2.28.0
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ date-fns: 2.30.0
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-tvg2ZtOpOi6QDwsb3GZhOjDkkX0h8Z2gipvTg6OVMUyoYoURhEiRNePT8NZItTVCDh39JJHnLdfCOkzoLbFnTg==}
+ peerDependencies:
+ typescript: '>= 4.3.x'
+ dependencies:
+ typescript: 5.1.6
+ dev: true
+
+ resolution: {integrity: sha512-DDLvB5EV9As1/zoUsct6Iz2Cupw9FObEGD3DMcIs3EDFIoSKyz8FZtoWj3Wj+oodrU4/NfidN0BL5yrapIcTSA==}
+ engines: {node: '>=12.0.0'}
+ hasBin: true
+ dependencies:
+ '@babel/core': 7.22.9
+ '@babel/generator': 7.22.9
+ ast-types: 0.14.2
+ commander: 2.20.3
+ doctrine: 3.0.0
+ estree-to-babel: 3.2.1
+ neo-async: 2.6.2
+ node-dir: 0.1.17
+ resolve: 1.22.2
+ strip-indent: 3.0.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==}
+ peerDependencies:
+ react: ^18.2.0
+ dependencies:
+ loose-envify: 1.4.0
+ react: 18.2.0
+ scheduler: 0.23.0
+
+ resolution: {integrity: sha512-O3om8I+PkFKbxCukfIR3QAGftYXDZfOE2N1mr/7qebQJHs7U+/RSL/9xomJNpRg9kM5h9soQSdf0Gc7OHF5Fug==}
+ engines: {node: '>= 10.13'}
+ peerDependencies:
+ react: '>= 16.8 || 18.0.0'
+ dependencies:
+ attr-accept: 2.2.2
+ file-selector: 0.6.0
+ prop-types: 15.8.1
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-UDg4lXB6BzlobN60P8fHWVPX3Kyw8ORrTeBtClmIlGdkOOE+GYQSFvmEU5iLLpwp/6v42DINwNcwOhOLfQ//FQ==}
+ peerDependencies:
+ react: ^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1 || ^18.0.0
+ react-dom: ^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1 || ^18.0.0
+ dependencies:
+ '@base2/pretty-print-object': 1.0.1
+ is-plain-object: 5.0.0
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ react-is: 18.1.0
+ dev: true
+
+ resolution: {integrity: sha512-pvVKdi77j2OoPHo+p3rorgE43OjDWiqFkaqkJz8sJKK6uf/u8xtzuaVfj5qJ2JnDLIgF1De3zY5AJDijp+LVPA==}
+ peerDependencies:
+ react: '>=16.13.1'
+ dependencies:
+ '@babel/runtime': 7.21.0
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-HGDV1JOOBPZj10LB3+OZgfDBTn+IeEsNOKiq/cxbQAIbKaiJUe/KV8DBUzsx0Gx/7IG/orWqRRm736JwOfUSWQ==}
+ engines: {node: '>=12.22.0'}
+ peerDependencies:
+ react: ^16.8.0 || ^17 || ^18
+ dependencies:
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-cxKSeFTf7jpSSVddm66sKdolG90qURAX3g1roTeaN6x0YEbtWc8JpmFN9+yIqLNH2uEkYerWLtJZIXRIFuBKrg==}
+ peerDependencies:
+ react: ^16.8.4 || ^17.0.0 || ^18.0.0
+ dependencies:
+ react: 18.2.0
+ dev: true
+
+ resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==}
+
+ resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==}
+ dev: true
+
+ resolution: {integrity: sha512-Fl7FuabXsJnV5Q1qIOQwx/sagGF18kogb4gpfcG4gjLBWO0WDiiz1ko/ExayuxE7InyQkBLkxRFG5oxY6Uu3Kg==}
+ dev: true
+
+ resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==}
+
+ resolution: {integrity: sha512-kzmNjIgU32mO4mmH5+iUyrqlpFQhF8K2k7eZ4fdLSOPFrD1XgEuSBv9LDEgxRXTMBqMd8ppT0x6TIzqE5pdGdw==}
+ dev: false
+
+ resolution: {integrity: sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ resolution: {integrity: sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A==}
+ engines: {node: '>=10'}
+ peerDependencies:
+ '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@types/react': 18.2.19
+ react: 18.2.0
+ react-style-singleton: 2.2.1(@types/[email protected])([email protected])
+ tslib: 2.5.0
+
+ resolution: {integrity: sha512-xGVKJJr0SJGQVirVFAUZ2k1QLyO6m+2fy0l8Qawbp5Jgrv3DeLalrfMNBFSlmz5kriGGzsVBtGVnf4pTKIhhWA==}
+ engines: {node: '>=10'}
+ peerDependencies:
+ '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@types/react': 18.2.19
+ react: 18.2.0
+ react-remove-scroll-bar: 2.3.4(@types/[email protected])([email protected])
+ react-style-singleton: 2.2.1(@types/[email protected])([email protected])
+ tslib: 2.5.0
+ use-callback-ref: 1.3.0(@types/[email protected])([email protected])
+ use-sidecar: 1.1.2(@types/[email protected])([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-ImKhrzJJsyXJfBZ4bzu8Bwpka14c/fQt0k+cyFp/PBhTfyDnU5hjOtM4AG/0AMyy8oKzOTR0lDgJIM7pYXI0kw==}
+ engines: {node: '>=10'}
+ peerDependencies:
+ '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@types/react': 18.2.19
+ react: 18.2.0
+ react-remove-scroll-bar: 2.3.4(@types/[email protected])([email protected])
+ react-style-singleton: 2.2.1(@types/[email protected])([email protected])
+ tslib: 2.5.0
+ use-callback-ref: 1.3.0(@types/[email protected])([email protected])
+ use-sidecar: 1.1.2(@types/[email protected])([email protected])
+
+ resolution: {integrity: sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==}
+ engines: {node: '>=10'}
+ peerDependencies:
+ '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@types/react': 18.2.19
+ get-nonce: 1.0.1
+ invariant: 2.2.4
+ react: 18.2.0
+ tslib: 2.5.0
+
+ resolution: {integrity: sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==}
+ peerDependencies:
+ react: '>=16.6.0'
+ react-dom: '>=16.6.0'
+ dependencies:
+ '@babel/runtime': 7.22.5
+ dom-helpers: 5.2.1
+ loose-envify: 1.4.0
+ prop-types: 15.8.1
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-wNchkFrrlz64QQOJOf5+dFjy+27bJEwtS1SgliRXVsU60wo3pSntNRlwDws2qPHwrAP/wlm5IyQHBlPCya0JIQ==}
+ peerDependencies:
+ react: '>=16.8.0'
+ dependencies:
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==}
+ engines: {node: '>=0.10.0'}
+ dependencies:
+ loose-envify: 1.4.0
+
+ resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==}
+ dependencies:
+ pify: 2.3.0
+
+ resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==}
+ engines: {node: '>=8'}
+ dependencies:
+ find-up: 4.1.0
+ read-pkg: 5.2.0
+ type-fest: 0.8.1
+ dev: true
+
+ resolution: {integrity: sha512-snVCqPczksT0HS2EC+SxUndvSzn6LRCwpfSvLrIfR5BKDQQZMaI6jPRC9dYvYFDRAuFEAnkwww8kBBNE/3VvzQ==}
+ engines: {node: '>=12'}
+ dependencies:
+ find-up: 5.0.0
+ read-pkg: 6.0.0
+ type-fest: 1.4.0
+ dev: true
+
+ resolution: {integrity: sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==}
+ engines: {node: '>=4'}
+ dependencies:
+ load-json-file: 4.0.0
+ normalize-package-data: 2.5.0
+ path-type: 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==}
+ engines: {node: '>=8'}
+ dependencies:
+ '@types/normalize-package-data': 2.4.1
+ normalize-package-data: 2.5.0
+ parse-json: 5.2.0
+ type-fest: 0.6.0
+ dev: true
+
+ resolution: {integrity: sha512-X1Fu3dPuk/8ZLsMhEj5f4wFAF0DWoK7qhGJvgaijocXxBmSToKfbFtqbxMO7bVjNA1dmE5huAzjXj/ey86iw9Q==}
+ engines: {node: '>=12'}
+ dependencies:
+ '@types/normalize-package-data': 2.4.1
+ normalize-package-data: 3.0.3
+ parse-json: 5.2.0
+ type-fest: 1.4.0
+ dev: true
+
+ resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==}
+ dependencies:
+ core-util-is: 1.0.3
+ inherits: 2.0.4
+ isarray: 1.0.0
+ process-nextick-args: 2.0.1
+ safe-buffer: 5.1.2
+ string_decoder: 1.1.1
+ util-deprecate: 1.0.2
+ dev: true
+
+ resolution: {integrity: sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==}
+ engines: {node: '>= 6'}
+ dependencies:
+ inherits: 2.0.4
+ string_decoder: 1.3.0
+ util-deprecate: 1.0.2
+ dev: true
+
+ resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
+ engines: {node: '>=8.10.0'}
+ dependencies:
+ picomatch: 2.3.1
+
+ resolution: {integrity: sha512-hjMmLaUXAm1hIuTqOdeYObMslq/q+Xff6QE3Y2P+uoHAg2nmVlLBps2hzh1UJDdMtDTMXOFewK6ky51JQIeECg==}
+ engines: {node: '>= 4'}
+ dependencies:
+ ast-types: 0.15.2
+ esprima: 4.0.1
+ source-map: 0.6.1
+ tslib: 2.5.0
+ dev: true
+
+ resolution: {integrity: sha512-Qv6cPfVZyMOtPszK6PgW70pUgm7gPlFitAPf0Q69rlOA0zLw2XdDcNmPbVGYicFGT9O8I7TZ/0ryJD+6COvIPw==}
+ engines: {node: '>= 4'}
+ dependencies:
+ assert: 2.0.0
+ ast-types: 0.16.1
+ esprima: 4.0.1
+ source-map: 0.6.1
+ tslib: 2.5.0
+ dev: true
+
+ resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==}
+ engines: {node: '>=8'}
+ dependencies:
+ indent-string: 4.0.0
+ strip-indent: 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag==}
+ engines: {node: '>=12'}
+ dependencies:
+ indent-string: 5.0.0
+ strip-indent: 4.0.0
+ dev: true
+
+ resolution: {integrity: sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ==}
+ engines: {node: '>=4'}
+ dependencies:
+ regenerate: 1.4.2
+ dev: true
+
+ resolution: {integrity: sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==}
+ dev: true
+
+ resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==}
+
+ resolution: {integrity: sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg==}
+ dependencies:
+ '@babel/runtime': 7.22.5
+ dev: true
+
+ resolution: {integrity: sha512-jbD/FT0+9MBU2XAZluI7w2OBs1RBi6p9M83nkoZayQXXU9e8Robt69FcZc7wU4eJD/YFTjn1JdCk3rbMJajz8Q==}
+ dev: false
+
+ resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==}
+ hasBin: true
+ dev: true
+
+ resolution: {integrity: sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.2.0
+ functions-have-names: 1.2.3
+ dev: true
+
+ resolution: {integrity: sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==}
+ engines: {node: '>=4'}
+ dependencies:
+ '@babel/regjsgen': 0.8.0
+ regenerate: 1.4.2
+ regenerate-unicode-properties: 10.1.0
+ regjsparser: 0.9.1
+ unicode-match-property-ecmascript: 2.0.0
+ unicode-match-property-value-ecmascript: 2.1.0
+ dev: true
+
+ resolution: {integrity: sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==}
+ hasBin: true
+ dependencies:
+ jsesc: 0.5.0
+ dev: true
+
+ resolution: {integrity: sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==}
+ hasBin: true
+ dependencies:
+ jsesc: 0.5.0
+ dev: true
+
+ resolution: {integrity: sha512-5vPSX0kHoSsqtdftSHhIYofVINC8qmp0nctkeU9YoJwV3YfiBRiI6cbFRJ0oI/1F9xS+bopXG0m2KS8VFscuKA==}
+ dependencies:
+ extend: 3.0.2
+ is-absolute-url: 3.0.3
+ mdast-util-definitions: 4.0.0
+ space-separated-tokens: 1.1.5
+ unist-util-visit: 2.0.3
+ dev: true
+
+ resolution: {integrity: sha512-oGCxDF9deA8phWvxFuyr3oSJsdyUAxMFbA0mZ7Y1Sas+emILtO+e5WutF9564gDsEN4IXaQXm5pFo6MLH+YmwQ==}
+ dependencies:
+ github-slugger: 1.5.0
+ mdast-util-to-string: 1.1.0
+ unist-util-visit: 2.0.3
+ dev: true
+
+ resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ resolution: {integrity: sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==}
+ engines: {node: '>=0.10.5'}
+ dev: true
+
+ resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==}
+ dev: true
+
+ resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
+ engines: {node: '>=4'}
+
+ resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-uZtduh8/8srhBoMx//5bwqjQ+rfYOUq8zC9NrMUGtjBiGTtFJM42s58/36+hTqeqINcnYe08Nj3LkK9lW4N8Xg==}
+ engines: {node: '>=12'}
+ dependencies:
+ adjust-sourcemap-loader: 4.0.0
+ convert-source-map: 1.8.0
+ loader-utils: 2.0.4
+ postcss: 8.4.27
+ source-map: 0.6.1
+ dev: false
+
+ resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==}
+ hasBin: true
+ dependencies:
+ is-core-module: 2.12.0
+ path-parse: 1.0.7
+ supports-preserve-symlinks-flag: 1.0.0
+
+ resolution: {integrity: sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==}
+ hasBin: true
+ dependencies:
+ is-core-module: 2.12.0
+ path-parse: 1.0.7
+ supports-preserve-symlinks-flag: 1.0.0
+ dev: true
+
+ resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==}
+ engines: {node: '>=8'}
+ dependencies:
+ onetime: 5.1.2
+ signal-exit: 3.0.7
+ dev: true
+
+ resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==}
+ engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==}
+ hasBin: true
+ dependencies:
+ glob: 7.2.0
+ dev: true
+
+ resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==}
+ hasBin: true
+ dependencies:
+ glob: 7.2.0
+ dev: true
+
+ resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==}
+ hasBin: true
+ dependencies:
+ glob: 7.2.0
+
+ resolution: {integrity: sha512-d7zhvo1OUY2SXSM6pfNjgD5+d0Nz87CUp4mt8l/GgVP3oBsPwzNvSzyu1me6BSG9JIgWNTVcafIXBIyM8yQ3yw==}
+ engines: {node: '>=14.18.0', npm: '>=8.0.0'}
+ hasBin: true
+ optionalDependencies:
+ fsevents: 2.3.2
+ dev: true
+
+ resolution: {integrity: sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==}
+ dev: true
+
+ resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==}
+ engines: {node: '>=0.12.0'}
+ dev: true
+
+ resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
+ dependencies:
+ queue-microtask: 1.2.3
+
+ resolution: {integrity: sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==}
+ dependencies:
+ tslib: 2.5.0
+ dev: true
+
+ resolution: {integrity: sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==}
+ dev: true
+
+ resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==}
+
+ resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
+
+ resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==}
+ dependencies:
+ call-bind: 1.0.2
+ get-intrinsic: 1.2.1
+ is-regex: 1.1.4
+ dev: true
+
+ resolution: {integrity: sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==}
+ dependencies:
+ regexp-tree: 0.1.27
+ dev: true
+
+ resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
+
+ resolution: {integrity: sha512-nrIdVAAte3B9icfBiGWvmMhT/D+eCDwnk+yA7VE/76dp/WkHX+i44Q/pfo71NYbwj0Ap+PGsn0ekOuU1WFJ2AA==}
+ engines: {node: '>= 14.15.0'}
+ peerDependencies:
+ fibers: '>= 3.1.0'
+ node-sass: ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0
+ sass: ^1.3.0
+ sass-embedded: '*'
+ webpack: ^5.0.0
+ peerDependenciesMeta:
+ fibers:
+ optional: true
+ node-sass:
+ optional: true
+ sass:
+ optional: true
+ sass-embedded:
+ optional: true
+ dependencies:
+ klona: 2.0.6
+ neo-async: 2.6.2
+ webpack: 5.88.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==}
+ requiresBuild: true
+ optional: true
+
+ resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==}
+ engines: {node: '>=v12.22.7'}
+ dependencies:
+ xmlchars: 2.2.0
+ dev: true
+
+ resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==}
+ dependencies:
+ loose-envify: 1.4.0
+
+ resolution: {integrity: sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==}
+ engines: {node: '>= 10.13.0'}
+ dependencies:
+ '@types/json-schema': 7.0.9
+ ajv: 6.12.6
+ ajv-keywords: 3.5.2([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==}
+ hasBin: true
+
+ resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==}
+ hasBin: true
+
+ resolution: {integrity: sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==}
+ engines: {node: '>=10'}
+ hasBin: true
+ dependencies:
+ lru-cache: 6.0.0
+ dev: true
+
+ resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==}
+ engines: {node: '>=10'}
+ hasBin: true
+ dependencies:
+ lru-cache: 6.0.0
+
+ resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==}
+ engines: {node: '>= 0.8.0'}
+ dependencies:
+ debug: 2.6.9
+ depd: 2.0.0
+ destroy: 1.2.0
+ encodeurl: 1.0.2
+ escape-html: 1.0.3
+ etag: 1.8.1
+ fresh: 0.5.2
+ http-errors: 2.0.0
+ mime: 1.6.0
+ ms: 2.1.3
+ on-finished: 2.4.1
+ range-parser: 1.2.1
+ statuses: 2.0.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==}
+ dependencies:
+ randombytes: 2.1.0
+ dev: false
+
+ resolution: {integrity: sha512-FMW2RvqNr03x+C0WxTyu6sOv21oOjkq5j8tjquWccwa6ScNyGFOGJVpuS1NmTVGBAHS07xnSKotgf2ehQmf9iA==}
+ engines: {node: '>= 0.8.0'}
+ dependencies:
+ etag: 1.8.1
+ fresh: 0.5.2
+ ms: 2.1.1
+ parseurl: 1.3.3
+ safe-buffer: 5.1.1
+ dev: true
+
+ resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==}
+ engines: {node: '>= 0.8.0'}
+ dependencies:
+ encodeurl: 1.0.2
+ escape-html: 1.0.3
+ parseurl: 1.3.3
+ send: 0.18.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-1jeBGaKNGdEq4FgIrORu/N570dwoPYio8lSoYLWmX7sQ//0JY08Xh9o5pBcgmHQ/MbsYp/aZnOe1s1lIsbLprQ==}
+ dev: true
+
+ resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==}
+ dev: true
+
+ resolution: {integrity: sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==}
+ engines: {node: '>=8'}
+ dependencies:
+ kind-of: 6.0.3
+ dev: true
+
+ resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==}
+ engines: {node: '>=0.10.0'}
+ dependencies:
+ shebang-regex: 1.0.0
+ dev: true
+
+ resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
+ engines: {node: '>=8'}
+ dependencies:
+ shebang-regex: 3.0.0
+
+ resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-8o/QEhSSRb1a5i7TFR0iM4G16Z0vYB2OQVs4G3aAFXjn3T6yEx8AZxy1PgDF7I00LZHYA3WxaSYIf5e5sAX8Rw==}
+ dev: true
+
+ resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==}
+ dependencies:
+ call-bind: 1.0.2
+ get-intrinsic: 1.2.1
+ object-inspect: 1.12.2
+
+ resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==}
+ dev: true
+
+ resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
+ dev: true
+
+ resolution: {integrity: sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==}
+ engines: {node: '>=14'}
+
+ resolution: {integrity: sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==}
+ engines: {node: '>=10'}
+ dependencies:
+ semver: 7.5.4
+ dev: true
+
+ resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==}
+ dev: true
+
+ resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==}
+ engines: {node: '>=10'}
+ dependencies:
+ ansi-styles: 4.3.0
+ astral-regex: 2.0.0
+ is-fullwidth-code-point: 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==}
+ dependencies:
+ buffer-from: 1.1.2
+ source-map: 0.6.1
+
+ resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==}
+ engines: {node: '>=0.10.0'}
+ dev: false
+
+ resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA==}
+ dev: true
+
+ resolution: {integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==}
+ dependencies:
+ spdx-expression-parse: 3.0.1
+ spdx-license-ids: 3.0.12
+ dev: true
+
+ resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==}
+ dev: true
+
+ resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==}
+ dependencies:
+ spdx-exceptions: 2.3.0
+ spdx-license-ids: 3.0.12
+ dev: true
+
+ resolution: {integrity: sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==}
+ dev: true
+
+ resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==}
+ dev: true
+
+ resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}
+ dev: true
+
+ resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==}
+ engines: {node: '>= 0.8'}
+ dev: true
+
+ resolution: {integrity: sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==}
+ dev: true
+
+ resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ internal-slot: 1.0.5
+ dev: true
+
+ resolution: {integrity: sha512-siT1RiqlfQnGqgT/YzXVUNsom9S0H1OX+dpdGN1xkyYATo4I6sep5NmsRD/40s3IIOvlCq6akxkqG82urIZW1w==}
+
+ resolution: {integrity: sha512-3tJHa3yUxhchO96I74WUxZIfPu1DZcG7VQByX6tuKqQ3YP6iZv90JPGseBwnTW+/0y/RaM7swf3RMon6Oe/zhA==}
+ hasBin: true
+ dependencies:
+ '@storybook/cli': 7.2.3
+ transitivePeerDependencies:
+ - bufferutil
+ - encoding
+ - supports-color
+ - utf-8-validate
+ dev: true
+
+ resolution: {integrity: sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==}
+ dev: true
+
+ resolution: {integrity: sha512-KDf/ujU8Zud3YaLtMCcTI4xkZlZVIYxTLr+XIULexP+77EEVWixeXroLUXQXiVtH4XH2W7jr/3PT1v3zBuvc3A==}
+ dependencies:
+ events: 3.3.0
+ dev: true
+
+ resolution: {integrity: sha512-12KWeb+wixJohmnwNFerbyiBrAlq5qJLwIt38etRtKtmmHyDSoGlIqFE9wx+4IwG0aDjI7GV8tc8ZccjWZZtTg==}
+ dev: true
+
+ resolution: {integrity: sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==}
+ dev: true
+
+ resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
+ engines: {node: '>=8'}
+ dependencies:
+ emoji-regex: 8.0.0
+ is-fullwidth-code-point: 3.0.0
+ strip-ansi: 6.0.1
+
+ resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==}
+ engines: {node: '>=12'}
+ dependencies:
+ eastasianwidth: 0.2.0
+ emoji-regex: 9.2.2
+ strip-ansi: 7.1.0
+
+ resolution: {integrity: sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg==}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.2.0
+ es-abstract: 1.20.5
+ get-intrinsic: 1.2.1
+ has-symbols: 1.0.3
+ internal-slot: 1.0.5
+ regexp.prototype.flags: 1.5.0
+ side-channel: 1.0.4
+ dev: true
+
+ resolution: {integrity: sha512-67otBXoksdjsnXXRUq+KMVTdlVRZ2af422Y0aTyTjVaoQkGr3mxl2Bc5emi7dOQ3OGVVQQskmLEWwFXwommpNw==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.2.0
+ es-abstract: 1.20.5
+ dev: true
+
+ resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.2.0
+ es-abstract: 1.20.5
+ dev: true
+
+ resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.2.0
+ es-abstract: 1.20.5
+ dev: true
+
+ resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==}
+ dependencies:
+ safe-buffer: 5.1.2
+ dev: true
+
+ resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==}
+ dependencies:
+ safe-buffer: 5.2.1
+ dev: true
+
+ resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
+ engines: {node: '>=8'}
+ dependencies:
+ ansi-regex: 5.0.1
+
+ resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==}
+ engines: {node: '>=12'}
+ dependencies:
+ ansi-regex: 6.0.1
+
+ resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==}
+ engines: {node: '>=4'}
+ dev: true
+
+ resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==}
+ engines: {node: '>=6'}
+ dev: true
+
+ resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==}
+ engines: {node: '>=8'}
+ dependencies:
+ min-indent: 1.0.1
+ dev: true
+
+ resolution: {integrity: sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==}
+ engines: {node: '>=12'}
+ dependencies:
+ min-indent: 1.0.1
+ dev: true
+
+ resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==}
+ dependencies:
+ acorn: 8.9.0
+ dev: true
+
+ resolution: {integrity: sha512-53BiGLXAcll9maCYtZi2RCQZKa8NQQai5C4horqKyRmHj9H7QmcUyucrH+4KW/gBQbXM2AsB0axoEcFZPlfPcw==}
+ engines: {node: '>= 12.13.0'}
+ peerDependencies:
+ webpack: ^5.0.0
+ dependencies:
+ webpack: 5.88.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-OPhtyEjyyN9x3nhPsu76f52yUGXiZcgvsrFVtvTkyGRQJ0XK+GPc6ov1z+lRpbeabka+MYEQxOYRnt5nF30aMw==}
+ dev: false
+
+ resolution: {integrity: sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==}
+ dev: true
+
+ resolution: {integrity: sha512-zKI5gN/zb7LS/Vm0eUwjmjrXWw8IMtyA8aPBJZdYiQTXj4+wQ3IucOLIOnF7zCHxvW8UhIGh/uZh/t9zEHXNTQ==}
+ dependencies:
+ style-to-object: 0.4.1
+ dev: false
+
+ resolution: {integrity: sha512-HFpbb5gr2ypci7Qw+IOhnP2zOU7e77b+rzM+wTzXzfi1PrtBCX0E7Pk4wL4iTLnhzZ+JgEGAhX81ebTg/aYjQw==}
+ dependencies:
+ inline-style-parser: 0.1.1
+ dev: false
+
+ resolution: {integrity: sha512-+UT589qhHPwz6mTlCLSt/vMNTJx8dopeJlZAlBMJPWA3ORqu6wmQY7FBXf+qD+FsqoBJODyqNxOUP3jdntFRdw==}
+ engines: {node: ^14 || ^16 || >=18.0}
+ peerDependencies:
+ postcss: ^8.2.15
+ dependencies:
+ browserslist: 4.21.9
+ postcss: 8.4.27
+ postcss-selector-parser: 6.0.13
+ dev: false
+
+ resolution: {integrity: sha512-EH+yRj6h3GAe/fRiyaoO2F9l9Tgg50AOFhaszyfov9v6ayXJ1IkSHwTxd7lB48FmOeSGDPLjatjO11fJpmarkQ==}
+ engines: {node: ^14.13.1 || >=16.0.0}
+ peerDependencies:
+ stylelint: ^15.10.0
+ dependencies:
+ stylelint: 15.10.2
+ dev: true
+
+ resolution: {integrity: sha512-u0VSZnVyW9VSryBG2LSO+OQTjN7zF9XJaAJRX/4EwkmU0R2jYwmBSN10acqZisDitS0CLiEiGjX7+Hrq8TAhfQ==}
+ engines: {node: ^14.13.1 || >=16.0.0}
+ peerDependencies:
+ stylelint: ^15.10.0
+ dependencies:
+ stylelint: 15.10.2
+ stylelint-config-recommended: 13.0.0([email protected])
+ dev: true
+
+ resolution: {integrity: sha512-UxqSb3hB74g4DTO45QhUHkJMjKKU//lNUAOWyvPBVPZbCknJ5HjOWWZo+UDuhHa9FLeVdHBZXxu43eXkjyIPWg==}
+ engines: {node: ^14.13.1 || >=16.0.0}
+ hasBin: true
+ dependencies:
+ '@csstools/css-parser-algorithms': 2.3.1(@csstools/[email protected])
+ '@csstools/css-tokenizer': 2.2.0
+ '@csstools/media-query-list-parser': 2.1.3(@csstools/[email protected])(@csstools/[email protected])
+ '@csstools/selector-specificity': 3.0.0([email protected])
+ balanced-match: 2.0.0
+ colord: 2.9.3
+ cosmiconfig: 8.2.0
+ css-functions-list: 3.2.0
+ css-tree: 2.3.1
+ debug: 4.3.4
+ fast-glob: 3.3.1
+ fastest-levenshtein: 1.0.16
+ file-entry-cache: 6.0.1
+ global-modules: 2.0.0
+ globby: 11.1.0
+ globjoin: 0.1.4
+ html-tags: 3.3.1
+ ignore: 5.2.4
+ import-lazy: 4.0.0
+ imurmurhash: 0.1.4
+ is-plain-object: 5.0.0
+ known-css-properties: 0.27.0
+ mathml-tag-names: 2.1.3
+ meow: 10.1.5
+ micromatch: 4.0.5
+ normalize-path: 3.0.0
+ picocolors: 1.0.0
+ postcss: 8.4.27
+ postcss-resolve-nested-selector: 0.1.1
+ postcss-safe-parser: 6.0.0([email protected])
+ postcss-selector-parser: 6.0.13
+ postcss-value-parser: 4.2.0
+ resolve-from: 5.0.0
+ string-width: 4.2.3
+ strip-ansi: 6.0.1
+ style-search: 0.1.0
+ supports-hyperlinks: 3.0.0
+ svg-tags: 1.0.0
+ table: 6.8.1
+ write-file-atomic: 5.0.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==}
+ dev: false
+
+ resolution: {integrity: sha512-ydQOU34rpSyj2TGyz4D2p8rbktIOZ8QY9s+DGLvFU1i5pWJE8vkpruCjGCMHsdXwnD7JDcS+noSwM/a7zyNFDQ==}
+ engines: {node: '>=8'}
+ hasBin: true
+ dependencies:
+ '@jridgewell/gen-mapping': 0.3.3
+ commander: 4.1.1
+ glob: 7.1.6
+ lines-and-columns: 1.2.4
+ mz: 2.7.0
+ pirates: 4.0.5
+ ts-interface-checker: 0.1.13
+
+ resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}
+ engines: {node: '>=4'}
+ dependencies:
+ has-flag: 3.0.0
+
+ resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
+ engines: {node: '>=8'}
+ dependencies:
+ has-flag: 4.0.0
+
+ resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==}
+ engines: {node: '>=10'}
+ dependencies:
+ has-flag: 4.0.0
+
+ resolution: {integrity: sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==}
+ engines: {node: '>=14.18'}
+ dependencies:
+ has-flag: 4.0.0
+ supports-color: 7.2.0
+ dev: true
+
+ resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==}
+ dev: true
+
+ resolution: {integrity: sha512-Z706C1U2pb1+JGP48fbazf3KxHrWOsLme6Rv7imFBn5EnuanDW1GPaA/P1/dvObE670JDePC3mnj0k0B7P0jjQ==}
+ engines: {node: '>=14.0.0'}
+ hasBin: true
+ dependencies:
+ '@trysound/sax': 0.2.0
+ commander: 7.2.0
+ css-select: 5.1.0
+ css-tree: 2.3.1
+ csso: 5.0.5
+ picocolors: 1.0.0
+ dev: false
+
+ resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==}
+ dev: true
+
+ resolution: {integrity: sha512-AsS729u2RHUfEra9xJrE39peJcc2stq2+poBXX8bcM08Y6g9j/i/PUzwNQqkaJde7Ntg1TO7bSREbR5sdosQ+g==}
+
+ resolution: {integrity: sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==}
+ engines: {node: '>=10.0.0'}
+ dependencies:
+ ajv: 8.12.0
+ lodash.truncate: 4.4.2
+ slice-ansi: 4.0.0
+ string-width: 4.2.3
+ strip-ansi: 6.0.1
+ dev: true
+
+ resolution: {integrity: sha512-3mFKyCo/MBcgyOTlrY8T7odzZFx+w+qKSMAmdFzRvqBfLlSigU6TZnlFHK0lkMwj9Bj8OYU+9yW9lmGuS0QEnQ==}
+ dev: false
+
+ resolution: {integrity: sha512-4WigSGMvbl3gCCact62ZvOngA+PRqhAn7si3TQ3/ZuPuQZcIEtVap+ENSXbzWhpojKB8CpvnIsrwBu8/RnHtuw==}
+ peerDependencies:
+ tailwindcss: '>=3.0.0 || insiders'
+ dependencies:
+ tailwindcss: 3.3.3
+ dev: false
+
+ resolution: {integrity: sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w==}
+ engines: {node: '>=14.0.0'}
+ hasBin: true
+ dependencies:
+ '@alloc/quick-lru': 5.2.0
+ arg: 5.0.2
+ chokidar: 3.5.3
+ didyoumean: 1.2.2
+ dlv: 1.1.3
+ fast-glob: 3.2.12
+ glob-parent: 6.0.2
+ is-glob: 4.0.3
+ jiti: 1.18.2
+ lilconfig: 2.1.0
+ micromatch: 4.0.5
+ normalize-path: 3.0.0
+ object-hash: 3.0.0
+ picocolors: 1.0.0
+ postcss: 8.4.27
+ postcss-import: 15.1.0([email protected])
+ postcss-js: 4.0.1([email protected])
+ postcss-load-config: 4.0.1([email protected])
+ postcss-nested: 6.0.1([email protected])
+ postcss-selector-parser: 6.0.12
+ resolve: 1.22.2
+ sucrase: 3.32.0
+ transitivePeerDependencies:
+ - ts-node
+
+ resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==}
+ engines: {node: '>=6'}
+ dev: false
+
+ resolution: {integrity: sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==}
+ dependencies:
+ chownr: 1.1.4
+ mkdirp-classic: 0.5.3
+ pump: 3.0.0
+ tar-stream: 2.2.0
+ dev: true
+
+ resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==}
+ engines: {node: '>=6'}
+ dependencies:
+ bl: 4.1.0
+ end-of-stream: 1.4.4
+ fs-constants: 1.0.0
+ inherits: 2.0.4
+ readable-stream: 3.6.0
+ dev: true
+
+ resolution: {integrity: sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==}
+ engines: {node: '>=10'}
+ dependencies:
+ chownr: 2.0.0
+ fs-minipass: 2.1.0
+ minipass: 5.0.0
+ minizlib: 2.1.2
+ mkdirp: 1.0.4
+ yallist: 4.0.0
+ dev: true
+
+ resolution: {integrity: sha512-jFJO4P5gPebZAERPkJsqMAQ0IMA1Hi0AoSfxpnUaV6j6R2SZqlpkbS20U6dEUtA3RUYt2Ak/mTlkQzHH9Rv/hA==}
+ dependencies:
+ memoizerific: 1.11.3
+
+ resolution: {integrity: sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-s0ZZzd0BzYv5tLSptZooSjK8oj6C+c19p7Vqta9+6NPOf7r+fxq0cJe6/oN4LTC79sy5NY8ucOJNgwsKCSbfqg==}
+ engines: {node: '>=6.0.0'}
+ dependencies:
+ rimraf: 2.6.3
+ dev: true
+
+ resolution: {integrity: sha512-biM9brNqxSc04Ee71hzFbryD11nX7VPhQQY32AdDmjFvodsRFz/3ufeoTZ6uYkRFfGo188tENcASNs3vTdsM0w==}
+ engines: {node: '>=10'}
+ dependencies:
+ del: 6.1.1
+ is-stream: 2.0.1
+ temp-dir: 2.0.0
+ type-fest: 0.16.0
+ unique-string: 2.0.0
+ dev: true
+
+ resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==}
+ engines: {node: '>= 10.13.0'}
+ peerDependencies:
+ '@swc/core': '*'
+ esbuild: '*'
+ uglify-js: '*'
+ webpack: ^5.1.0
+ peerDependenciesMeta:
+ '@swc/core':
+ optional: true
+ esbuild:
+ optional: true
+ uglify-js:
+ optional: true
+ dependencies:
+ '@jridgewell/trace-mapping': 0.3.18
+ esbuild: 0.18.16
+ jest-worker: 27.5.1
+ schema-utils: 3.3.0
+ serialize-javascript: 6.0.1
+ terser: 5.18.1
+ webpack: 5.88.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-j1n0Ao919h/Ai5r43VAnfV/7azUYW43GPxK7qSATzrsERfW7+y2QW9Cp9ufnRF5CQUWbnLSo7UJokSWCqg4tsQ==}
+ engines: {node: '>=10'}
+ hasBin: true
+ dependencies:
+ '@jridgewell/source-map': 0.3.3
+ acorn: 8.9.0
+ commander: 2.20.3
+ source-map-support: 0.5.21
+ dev: false
+
+ resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==}
+ engines: {node: '>=8'}
+ dependencies:
+ '@istanbuljs/schema': 0.1.3
+ glob: 7.2.0
+ minimatch: 3.1.2
+ dev: true
+
+ resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
+
+ resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==}
+ engines: {node: '>=0.8'}
+ dependencies:
+ thenify: 3.3.1
+
+ resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==}
+ dependencies:
+ any-promise: 1.3.0
+
+ resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==}
+ dependencies:
+ readable-stream: 2.3.8
+ xtend: 4.0.2
+ dev: true
+
+ resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==}
+ dev: true
+
+ resolution: {integrity: sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==}
+
+ resolution: {integrity: sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==}
+ dev: true
+
+ resolution: {integrity: sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==}
+ engines: {node: '>=14.0.0'}
+ dev: true
+
+ resolution: {integrity: sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w==}
+ engines: {node: '>=14.0.0'}
+ dev: true
+
+ resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==}
+ engines: {node: '>=0.6.0'}
+ dependencies:
+ os-tmpdir: 1.0.2
+ dev: true
+
+ resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==}
+ dev: true
+
+ resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==}
+ engines: {node: '>=4'}
+
+ resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
+ engines: {node: '>=8.0'}
+ dependencies:
+ is-number: 7.0.0
+
+ resolution: {integrity: sha512-vXk8htr8mIl3hc2s2mDkaPTBfqmqZA2o0x7eXbxUibdrpEIPdpM0L9hH/RvEvlgSM+ZTgS34sGipk5+VrLJCLA==}
+ dev: true
+
+ resolution: {integrity: sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==}
+ dev: false
+
+ resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==}
+ engines: {node: '>=0.6'}
+ dev: true
+
+ resolution: {integrity: sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==}
+ engines: {node: '>=6'}
+ dependencies:
+ psl: 1.9.0
+ punycode: 2.3.0
+ universalify: 0.2.0
+ url-parse: 1.5.10
+ dev: true
+
+ resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
+
+ resolution: {integrity: sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==}
+ engines: {node: '>=14'}
+ dependencies:
+ punycode: 2.3.0
+ dev: true
+
+ resolution: {integrity: sha512-jRKj0n0jXWo6kh62nA5TEh3+4igKDXLvzBJcPpiizP7oOolUrYIxmVBG9TOtHYFHoddUk6YvAkGeGoSVTXfQXQ==}
+ engines: {node: '>=12'}
+ dev: true
+
+ resolution: {integrity: sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==}
+ engines: {node: '>=6.10'}
+
+ resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}
+
+ resolution: {integrity: sha512-ZPCkJBKASZBmBUNqGHmRhdhM8pJYDdOXp4nRgj/O0JwUwsMq50lCDRQP/M5GBNAA0elPrq4gAeu4dkaVCuKWww==}
+ engines: {node: ^14.13.1 || ^16 || >=18}
+ hasBin: true
+ peerDependencies:
+ typescript: ^4.3.5 || ^5.0.0
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ dependencies:
+ typescript: 5.1.6
+ dev: true
+
+ resolution: {integrity: sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==}
+ dependencies:
+ '@types/json5': 0.0.29
+ json5: 1.0.2
+ minimist: 1.2.6
+ strip-bom: 3.0.0
+ dev: true
+
+ resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
+
+ resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==}
+
+ resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}
+ engines: {node: '>= 6'}
+ peerDependencies:
+ typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta'
+ dependencies:
+ tslib: 1.14.1
+ typescript: 5.1.6
+ dev: true
+
+ resolution: {integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==}
+ engines: {node: '>= 0.8.0'}
+ dependencies:
+ prelude-ls: 1.1.2
+ dev: true
+
+ resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
+ engines: {node: '>= 0.8.0'}
+ dependencies:
+ prelude-ls: 1.2.1
+
+ resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==}
+ engines: {node: '>=4'}
+ dev: true
+
+ resolution: {integrity: sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==}
+ engines: {node: '>=10'}
+ dev: true
+
+ resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==}
+ engines: {node: '>=10'}
+ dev: true
+
+ resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==}
+ engines: {node: '>=10'}
+ dev: true
+
+ resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==}
+ engines: {node: '>=12.20'}
+
+ resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==}
+ engines: {node: '>= 0.6'}
+ dependencies:
+ media-typer: 0.3.0
+ mime-types: 2.1.35
+ dev: true
+
+ resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==}
+ dev: true
+
+ resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==}
+ engines: {node: '>=14.17'}
+ hasBin: true
+ dev: true
+
+ resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==}
+ dev: true
+
+ resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==}
+ engines: {node: '>=0.8.0'}
+ hasBin: true
+ requiresBuild: true
+ optional: true
+
+ resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==}
+ dependencies:
+ call-bind: 1.0.2
+ has-bigints: 1.0.2
+ has-symbols: 1.0.3
+ which-boxed-primitive: 1.0.2
+ dev: true
+
+ resolution: {integrity: sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==}
+ engines: {node: '>=4'}
+ dev: true
+
+ resolution: {integrity: sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==}
+ engines: {node: '>=4'}
+ dependencies:
+ unicode-canonical-property-names-ecmascript: 2.0.0
+ unicode-property-aliases-ecmascript: 2.1.0
+ dev: true
+
+ resolution: {integrity: sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA==}
+ engines: {node: '>=4'}
+ dev: true
+
+ resolution: {integrity: sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==}
+ engines: {node: '>=4'}
+ dev: true
+
+ resolution: {integrity: sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==}
+ engines: {node: '>=8'}
+ dependencies:
+ crypto-random-string: 2.0.0
+ dev: true
+
+ resolution: {integrity: sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==}
+ dev: true
+
+ resolution: {integrity: sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==}
+ dependencies:
+ '@types/unist': 2.0.6
+ unist-util-is: 4.1.0
+ dev: true
+
+ resolution: {integrity: sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==}
+ dependencies:
+ '@types/unist': 2.0.6
+ unist-util-is: 4.1.0
+ unist-util-visit-parents: 3.1.1
+ dev: true
+
+ resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==}
+ engines: {node: '>= 4.0.0'}
+ dev: true
+
+ resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==}
+ engines: {node: '>= 10.0.0'}
+
+ resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==}
+ engines: {node: '>= 0.8'}
+ dev: true
+
+ resolution: {integrity: sha512-5x4eIEL6WgbzqGtF9UV8VEC/ehKptPXDS6L2b0mv4FRMkJxRtjaJfOWDd6a8+kYbqsjklix7yWP0N3SUepjXcg==}
+ dependencies:
+ acorn: 8.9.0
+ chokidar: 3.5.3
+ webpack-sources: 3.2.3
+ webpack-virtual-modules: 0.5.0
+ dev: true
+
+ resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==}
+ engines: {node: '>=8'}
+ dev: true
+
+ resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==}
+ hasBin: true
+ peerDependencies:
+ browserslist: '>= 4.21.0'
+ dependencies:
+ browserslist: 4.21.5
+ escalade: 3.1.1
+ picocolors: 1.0.0
+ dev: true
+
+ resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==}
+ hasBin: true
+ peerDependencies:
+ browserslist: '>= 4.21.0'
+ dependencies:
+ browserslist: 4.21.9
+ escalade: 3.1.1
+ picocolors: 1.0.0
+
+ resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
+ dependencies:
+ punycode: 2.3.0
+
+ resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==}
+ dependencies:
+ querystringify: 2.2.0
+ requires-port: 1.0.0
+ dev: true
+
+ resolution: {integrity: sha512-3FT9PRuRdbB9HfXhEq35u4oZkvpJ5kuYbpqhCfmiZyReuRgpnhDlbr2ZEnnuS0RrJAPn6l23xjFg9kpDM+Ms7w==}
+ engines: {node: '>=10'}
+ peerDependencies:
+ '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@types/react': 18.2.19
+ react: 18.2.0
+ tslib: 2.5.0
+
+ resolution: {integrity: sha512-R25VqO9Wb3asSD4eqtcxk8sJalvIOYBqS8MNZlpDSQ4l4xMQxC/J7Id9HoTqPq8FwULIn0PVW+OAqF2dyYbjow==}
+ peerDependencies:
+ react: 16.8.0 - 18
+ react-dom: 16.8.0 - 18
+ dependencies:
+ '@juggle/resize-observer': 3.4.0
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+
+ resolution: {integrity: sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw==}
+ engines: {node: '>=10'}
+ peerDependencies:
+ '@types/react': ^16.9.0 || ^17.0.0 || ^18.0.0
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@types/react': 18.2.19
+ detect-node-es: 1.1.0
+ react: 18.2.0
+ tslib: 2.5.0
+
+ resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ react: 18.2.0
+ dev: false
+
+ resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
+
+ resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==}
+ dependencies:
+ inherits: 2.0.4
+ is-arguments: 1.1.1
+ is-generator-function: 1.0.10
+ is-typed-array: 1.1.10
+ which-typed-array: 1.1.9
+ dev: true
+
+ resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==}
+ engines: {node: '>= 0.4.0'}
+ dev: true
+
+ resolution: {integrity: sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==}
+ hasBin: true
+ dev: true
+
+ resolution: {integrity: sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==}
+ engines: {node: '>=10.12.0'}
+ dependencies:
+ '@jridgewell/trace-mapping': 0.3.18
+ '@types/istanbul-lib-coverage': 2.0.4
+ convert-source-map: 1.8.0
+ dev: true
+
+ resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==}
+ dependencies:
+ spdx-correct: 3.1.1
+ spdx-expression-parse: 3.0.1
+ dev: true
+
+ resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==}
+ engines: {node: '>= 0.8'}
+ dev: true
+
+ resolution: {integrity: sha512-odAZAL9xFMuAg8aWd7nSPT+hU8u2r9gU3LRm9QKjxBEF2rRdWpMuqkrkjvyVQEdNFiBctqr2Gg4uJYizm5Le6w==}
+ engines: {node: '>=v14.18.0'}
+ hasBin: true
+ dependencies:
+ cac: 6.7.14
+ debug: 4.3.4
+ mlly: 1.4.0
+ pathe: 1.1.1
+ picocolors: 1.0.0
+ vite: 4.4.9(@types/[email protected])([email protected])
+ transitivePeerDependencies:
+ - '@types/node'
+ - less
+ - lightningcss
+ - sass
+ - stylus
+ - sugarss
+ - supports-color
+ - terser
+ dev: true
+
+ resolution: {integrity: sha512-jGpus0eUy5qbbMVGiTxCL1iB9ZGN6Bd37VGLJU39kTDD6ZfULTTb1bcc5IeTWqWJKiWV5YihCaibeASPiGi8kw==}
+ peerDependencies:
+ vite: '*'
+ peerDependenciesMeta:
+ vite:
+ optional: true
+ dependencies:
+ debug: 4.3.4
+ globrex: 0.1.2
+ tsconfck: 2.1.1([email protected])
+ vite: 4.4.9(@types/[email protected])([email protected])
+ transitivePeerDependencies:
+ - supports-color
+ - typescript
+ dev: true
+
+ resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==}
+ engines: {node: ^14.18.0 || >=16.0.0}
+ hasBin: true
+ peerDependencies:
+ '@types/node': '>= 14'
+ less: '*'
+ lightningcss: ^1.21.0
+ sass: '*'
+ stylus: '*'
+ sugarss: '*'
+ terser: ^5.4.0
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+ less:
+ optional: true
+ lightningcss:
+ optional: true
+ sass:
+ optional: true
+ stylus:
+ optional: true
+ sugarss:
+ optional: true
+ terser:
+ optional: true
+ dependencies:
+ '@types/node': 17.0.19
+ esbuild: 0.18.16
+ less: 4.1.3
+ postcss: 8.4.27
+ rollup: 3.28.0
+ optionalDependencies:
+ fsevents: 2.3.2
+ dev: true
+
+ resolution: {integrity: sha512-G1PzuBEq9A75XSU88yO5G4vPT20UovbC/2osB2KEuV/FisSIIsw7m5y2xMdB7RsAGHAfg2lPmp2qKr3KWliVlQ==}
+ engines: {node: '>=v14.18.0'}
+ hasBin: true
+ peerDependencies:
+ '@edge-runtime/vm': '*'
+ '@vitest/browser': '*'
+ '@vitest/ui': '*'
+ happy-dom: '*'
+ jsdom: '*'
+ playwright: '*'
+ safaridriver: '*'
+ webdriverio: '*'
+ peerDependenciesMeta:
+ '@edge-runtime/vm':
+ optional: true
+ '@vitest/browser':
+ optional: true
+ '@vitest/ui':
+ optional: true
+ happy-dom:
+ optional: true
+ jsdom:
+ optional: true
+ playwright:
+ optional: true
+ safaridriver:
+ optional: true
+ webdriverio:
+ optional: true
+ dependencies:
+ '@types/chai': 4.3.5
+ '@types/chai-subset': 1.3.3
+ '@types/node': 17.0.19
+ '@vitest/expect': 0.34.1
+ '@vitest/runner': 0.34.1
+ '@vitest/snapshot': 0.34.1
+ '@vitest/spy': 0.34.1
+ '@vitest/utils': 0.34.1
+ acorn: 8.9.0
+ acorn-walk: 8.2.0
+ cac: 6.7.14
+ chai: 4.3.7
+ debug: 4.3.4
+ jsdom: 22.1.0
+ local-pkg: 0.4.3
+ magic-string: 0.30.1
+ pathe: 1.1.1
+ picocolors: 1.0.0
+ std-env: 3.3.3
+ strip-literal: 1.0.1
+ tinybench: 2.5.0
+ tinypool: 0.7.0
+ vite: 4.4.9(@types/[email protected])([email protected])
+ vite-node: 0.34.1(@types/[email protected])([email protected])
+ why-is-node-running: 2.2.2
+ transitivePeerDependencies:
+ - less
+ - lightningcss
+ - sass
+ - stylus
+ - sugarss
+ - supports-color
+ - terser
+ dev: true
+
+ resolution: {integrity: sha512-tOhfEwEzFLJzf6d1ZPkYfGj+FWhIpBux9ppoP3rlclw3Z0BZv3N7b7030Z1kYth+6rDuAsXUFr+d0VE6Ed1ikw==}
+ dev: false
+
+ resolution: {integrity: sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==}
+ engines: {node: '>=14'}
+ dependencies:
+ xml-name-validator: 4.0.0
+ dev: true
+
+ resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==}
+ dependencies:
+ makeerror: 1.0.12
+ dev: true
+
+ resolution: {integrity: sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==}
+ engines: {node: '>=10.13.0'}
+ dependencies:
+ glob-to-regexp: 0.4.1
+ graceful-fs: 4.2.10
+
+ resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==}
+ dependencies:
+ defaults: 1.0.4
+ dev: true
+
+ resolution: {integrity: sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA==}
+ dependencies:
+ util: 0.12.5
+ optionalDependencies:
+ '@zxing/text-encoding': 0.9.0
+ dev: true
+
+ resolution: {integrity: sha512-n9fZ5/bG1oeDkyxLWyep0eahrNcPDF6bFqoyispt7xkW0xhDzpUBTgyDKqWDi1twT0MgH4HvvqzpUyh0ZxZV4A==}
+ dev: false
+
+ resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
+
+ resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==}
+ engines: {node: '>=12'}
+ dev: true
+
+ resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==}
+ engines: {node: '>=10.13.0'}
+
+ resolution: {integrity: sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==}
+ dev: true
+
+ resolution: {integrity: sha512-O3jDhG5e44qIBSi/P6KpcCcH7HD+nYIHVBhdWFxcLOcIGN8zGo5nqF3BjyNCxIh4p1vFdNnreZv2h2KkoAw3lw==}
+ engines: {node: '>=10.13.0'}
+ hasBin: true
+ peerDependencies:
+ webpack-cli: '*'
+ peerDependenciesMeta:
+ webpack-cli:
+ optional: true
+ dependencies:
+ '@types/eslint-scope': 3.7.4
+ '@types/estree': 1.0.1
+ '@webassemblyjs/ast': 1.11.6
+ '@webassemblyjs/wasm-edit': 1.11.6
+ '@webassemblyjs/wasm-parser': 1.11.6
+ acorn: 8.9.0
+ acorn-import-assertions: 1.9.0([email protected])
+ browserslist: 4.21.9
+ chrome-trace-event: 1.0.3
+ enhanced-resolve: 5.15.0
+ es-module-lexer: 1.3.0
+ eslint-scope: 5.1.1
+ events: 3.3.0
+ glob-to-regexp: 0.4.1
+ graceful-fs: 4.2.10
+ json-parse-even-better-errors: 2.3.1
+ loader-runner: 4.3.0
+ mime-types: 2.1.35
+ neo-async: 2.6.2
+ schema-utils: 3.3.0
+ tapable: 2.2.1
+ terser-webpack-plugin: 5.3.9([email protected])([email protected])
+ watchpack: 2.4.0
+ webpack-sources: 3.2.3
+ transitivePeerDependencies:
+ - '@swc/core'
+ - esbuild
+ - uglify-js
+ dev: false
+
+ resolution: {integrity: sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==}
+ engines: {node: '>=12'}
+ dependencies:
+ iconv-lite: 0.6.3
+ dev: true
+
+ resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==}
+ engines: {node: '>=12'}
+ dev: true
+
+ resolution: {integrity: sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==}
+ engines: {node: '>=14'}
+ dependencies:
+ tr46: 4.1.1
+ webidl-conversions: 7.0.0
+ dev: true
+
+ resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
+ dependencies:
+ tr46: 0.0.3
+ webidl-conversions: 3.0.1
+
+ resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==}
+ dependencies:
+ is-bigint: 1.0.4
+ is-boolean-object: 1.1.2
+ is-number-object: 1.0.7
+ is-string: 1.0.7
+ is-symbol: 1.0.4
+ dev: true
+
+ resolution: {integrity: sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==}
+ dependencies:
+ is-map: 2.0.2
+ is-set: 2.0.2
+ is-weakmap: 2.0.1
+ is-weakset: 2.0.2
+ dev: true
+
+ resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ available-typed-arrays: 1.0.5
+ call-bind: 1.0.2
+ for-each: 0.3.3
+ gopd: 1.0.1
+ has-tostringtag: 1.0.0
+ is-typed-array: 1.1.10
+ dev: true
+
+ resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==}
+ hasBin: true
+ dependencies:
+ isexe: 2.0.0
+ dev: true
+
+ resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
+ engines: {node: '>= 8'}
+ hasBin: true
+ dependencies:
+ isexe: 2.0.0
+
+ resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==}
+ engines: {node: '>=8'}
+ hasBin: true
+ dependencies:
+ siginfo: 2.0.0
+ stackback: 0.0.2
+ dev: true
+
+ resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==}
+
+ resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
+ engines: {node: '>=10'}
+ dependencies:
+ ansi-styles: 4.3.0
+ string-width: 4.2.3
+ strip-ansi: 6.0.1
+
+ resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==}
+ engines: {node: '>=12'}
+ dependencies:
+ ansi-styles: 6.2.1
+ string-width: 5.1.2
+ strip-ansi: 7.1.0
+
+ resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
+
+ resolution: {integrity: sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==}
+ dependencies:
+ graceful-fs: 4.2.10
+ imurmurhash: 0.1.4
+ signal-exit: 3.0.7
+ dev: true
+
+ resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==}
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
+ dependencies:
+ imurmurhash: 0.1.4
+ signal-exit: 3.0.7
+ dev: true
+
+ resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==}
+ engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
+ dependencies:
+ imurmurhash: 0.1.4
+ signal-exit: 4.0.2
+ dev: true
+
+ resolution: {integrity: sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==}
+ peerDependencies:
+ bufferutil: ^4.0.1
+ utf-8-validate: ^5.0.2
+ peerDependenciesMeta:
+ bufferutil:
+ optional: true
+ utf-8-validate:
+ optional: true
+ dependencies:
+ async-limiter: 1.0.1
+ dev: true
+
+ resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==}
+ engines: {node: '>=10.0.0'}
+ peerDependencies:
+ bufferutil: ^4.0.1
+ utf-8-validate: '>=5.0.2'
+ peerDependenciesMeta:
+ bufferutil:
+ optional: true
+ utf-8-validate:
+ optional: true
+ dev: true
+
+ resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==}
+ engines: {node: '>=12'}
+ dev: true
+
+ resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==}
+ dev: true
+
+ resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
+ engines: {node: '>=0.4'}
+ dev: true
+
+ resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
+ engines: {node: '>=10'}
+ dev: true
+
+ resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==}
+ dev: true
+
+ resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
+
+ resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==}
+ engines: {node: '>= 6'}
+
+ resolution: {integrity: sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA==}
+ engines: {node: '>= 14'}
+
+ resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==}
+ engines: {node: '>=10'}
+ dev: true
+
+ resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
+ engines: {node: '>=12'}
+ dev: true
+
+ resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==}
+ engines: {node: '>=10'}
+ dependencies:
+ cliui: 7.0.4
+ escalade: 3.1.1
+ get-caller-file: 2.0.5
+ require-directory: 2.1.1
+ string-width: 4.2.3
+ y18n: 5.0.8
+ yargs-parser: 20.2.9
+ dev: true
+
+ resolution: {integrity: sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==}
+ engines: {node: '>=12'}
+ dependencies:
+ cliui: 8.0.1
+ escalade: 3.1.1
+ get-caller-file: 2.0.5
+ require-directory: 2.1.1
+ string-width: 4.2.3
+ y18n: 5.0.8
+ yargs-parser: 21.1.1
+ dev: true
+
+ resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==}
+ dependencies:
+ buffer-crc32: 0.2.13
+ fd-slicer: 1.1.0
+ dev: true
+
+ resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==}
+ engines: {node: '>=12.20'}
+ dev: true
+
+ resolution: {integrity: sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==}
+ dev: false
+
+ resolution: {integrity: sha512-4h28KCkHg5ii/wcFFJ5Fp+k1J3gJoasaIbppdgZFO4BPJnsNxL0mQXBSFgOgAdCdBj35aDTPvdAJReTMntFPGg==}
+ engines: {node: '>=12.7.0'}
+ peerDependencies:
+ immer: '>=9.0'
+ react: '>=16.8'
+ peerDependenciesMeta:
+ immer:
+ optional: true
+ react:
+ optional: true
+ dependencies:
+ react: 18.2.0
+ use-sync-external-store: 1.2.0([email protected])
+ dev: false
diff --git a/frontend/postcss.config.js b/frontend/postcss.config.js
new file mode 100644
index 0000000000..04810b5241
--- /dev/null
+++ b/frontend/postcss.config.js
@@ -0,0 +1,7 @@
+module.exports = {
+ plugins: {
+ tailwindcss: {},
+ autoprefixer: {},
+ ...(process.env.NODE_ENV === "production" ? { cssnano: {} } : {}),
+ },
+};
diff --git a/frontend/public/android-chrome-192x192.png b/frontend/public/android-chrome-192x192.png
new file mode 100644
index 0000000000..d220ff1485
Binary files /dev/null and b/frontend/public/android-chrome-192x192.png differ
diff --git a/frontend/public/android-chrome-512x512.png b/frontend/public/android-chrome-512x512.png
new file mode 100644
index 0000000000..16412e54ca
Binary files /dev/null and b/frontend/public/android-chrome-512x512.png differ
diff --git a/frontend/public/apple-touch-icon.png b/frontend/public/apple-touch-icon.png
new file mode 100644
index 0000000000..44a8775102
Binary files /dev/null and b/frontend/public/apple-touch-icon.png differ
diff --git a/frontend/public/favicon-16x16.png b/frontend/public/favicon-16x16.png
new file mode 100644
index 0000000000..81915b7774
Binary files /dev/null and b/frontend/public/favicon-16x16.png differ
diff --git a/frontend/public/favicon-32x32.png b/frontend/public/favicon-32x32.png
new file mode 100644
index 0000000000..6e61dbe756
Binary files /dev/null and b/frontend/public/favicon-32x32.png differ
diff --git a/frontend/public/favicon.ico b/frontend/public/favicon.ico
new file mode 100644
index 0000000000..3c9a6dee09
Binary files /dev/null and b/frontend/public/favicon.ico differ
diff --git a/frontend/public/gradient.png b/frontend/public/gradient.png
new file mode 100644
index 0000000000..53ae593986
Binary files /dev/null and b/frontend/public/gradient.png differ
diff --git a/frontend/public/invalid_kernel_id.html b/frontend/public/invalid_kernel_id.html
new file mode 100644
index 0000000000..1b05f0c0df
--- /dev/null
+++ b/frontend/public/invalid_kernel_id.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <link rel="icon" href="/favicon.ico" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <meta name="theme-color" content="#000000" />
+ <meta name="description" content="Web site created using create-react-app" />
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
+ <link rel="manifest" href="/manifest.json" />
+ <title>kernel not found</title>
+ </head>
+ <body>
+ <div id="root">
+ <p>invalid kernel id</p>
+ </div>
+ </body>
+</html>
diff --git a/frontend/public/manifest.json b/frontend/public/manifest.json
new file mode 100644
index 0000000000..5d7b2b3f06
--- /dev/null
+++ b/frontend/public/manifest.json
@@ -0,0 +1,25 @@
+{
+ "short_name": "Marimo",
+ "name": "A Marimo App",
+ "icons": [
+ {
+ "src": "favicon.svg",
+ "sizes": "64x64 32x32 24x24 16x16",
+ "type": "image/svg"
+ },
+ {
+ "src": "logo192.png",
+ "type": "image/png",
+ "sizes": "192x192"
+ },
+ {
+ "src": "logo512.png",
+ "type": "image/png",
+ "sizes": "512x512"
+ }
+ ],
+ "start_url": ".",
+ "display": "standalone",
+ "theme_color": "#000000",
+ "background_color": "#ffffff"
+}
diff --git a/frontend/public/mockServiceWorker.js b/frontend/public/mockServiceWorker.js
new file mode 100644
index 0000000000..36a9927457
--- /dev/null
+++ b/frontend/public/mockServiceWorker.js
@@ -0,0 +1,303 @@
+/* eslint-disable */
+/* tslint:disable */
+
+/**
+ * Mock Service Worker (1.2.3).
+ * @see https://github.com/mswjs/msw
+ * - Please do NOT modify this file.
+ * - Please do NOT serve this file on production.
+ */
+
+const INTEGRITY_CHECKSUM = '3d6b9f06410d179a7f7404d4bf4c3c70'
+const activeClientIds = new Set()
+
+self.addEventListener('install', function () {
+ self.skipWaiting()
+})
+
+self.addEventListener('activate', function (event) {
+ event.waitUntil(self.clients.claim())
+})
+
+self.addEventListener('message', async function (event) {
+ const clientId = event.source.id
+
+ if (!clientId || !self.clients) {
+ return
+ }
+
+ const client = await self.clients.get(clientId)
+
+ if (!client) {
+ return
+ }
+
+ const allClients = await self.clients.matchAll({
+ type: 'window',
+ })
+
+ switch (event.data) {
+ case 'KEEPALIVE_REQUEST': {
+ sendToClient(client, {
+ type: 'KEEPALIVE_RESPONSE',
+ })
+ break
+ }
+
+ case 'INTEGRITY_CHECK_REQUEST': {
+ sendToClient(client, {
+ type: 'INTEGRITY_CHECK_RESPONSE',
+ payload: INTEGRITY_CHECKSUM,
+ })
+ break
+ }
+
+ case 'MOCK_ACTIVATE': {
+ activeClientIds.add(clientId)
+
+ sendToClient(client, {
+ type: 'MOCKING_ENABLED',
+ payload: true,
+ })
+ break
+ }
+
+ case 'MOCK_DEACTIVATE': {
+ activeClientIds.delete(clientId)
+ break
+ }
+
+ case 'CLIENT_CLOSED': {
+ activeClientIds.delete(clientId)
+
+ const remainingClients = allClients.filter((client) => {
+ return client.id !== clientId
+ })
+
+ // Unregister itself when there are no more clients
+ if (remainingClients.length === 0) {
+ self.registration.unregister()
+ }
+
+ break
+ }
+ }
+})
+
+self.addEventListener('fetch', function (event) {
+ const { request } = event
+ const accept = request.headers.get('accept') || ''
+
+ // Bypass server-sent events.
+ if (accept.includes('text/event-stream')) {
+ return
+ }
+
+ // Bypass navigation requests.
+ if (request.mode === 'navigate') {
+ return
+ }
+
+ // Opening the DevTools triggers the "only-if-cached" request
+ // that cannot be handled by the worker. Bypass such requests.
+ if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
+ return
+ }
+
+ // Bypass all requests when there are no active clients.
+ // Prevents the self-unregistered worked from handling requests
+ // after it's been deleted (still remains active until the next reload).
+ if (activeClientIds.size === 0) {
+ return
+ }
+
+ // Generate unique request ID.
+ const requestId = Math.random().toString(16).slice(2)
+
+ event.respondWith(
+ handleRequest(event, requestId).catch((error) => {
+ if (error.name === 'NetworkError') {
+ console.warn(
+ '[MSW] Successfully emulated a network error for the "%s %s" request.',
+ request.method,
+ request.url,
+ )
+ return
+ }
+
+ // At this point, any exception indicates an issue with the original request/response.
+ console.error(
+ `\
+[MSW] Caught an exception from the "%s %s" request (%s). This is probably not a problem with Mock Service Worker. There is likely an additional logging output above.`,
+ request.method,
+ request.url,
+ `${error.name}: ${error.message}`,
+ )
+ }),
+ )
+})
+
+async function handleRequest(event, requestId) {
+ const client = await resolveMainClient(event)
+ const response = await getResponse(event, client, requestId)
+
+ // Send back the response clone for the "response:*" life-cycle events.
+ // Ensure MSW is active and ready to handle the message, otherwise
+ // this message will pend indefinitely.
+ if (client && activeClientIds.has(client.id)) {
+ ;(async function () {
+ const clonedResponse = response.clone()
+ sendToClient(client, {
+ type: 'RESPONSE',
+ payload: {
+ requestId,
+ type: clonedResponse.type,
+ ok: clonedResponse.ok,
+ status: clonedResponse.status,
+ statusText: clonedResponse.statusText,
+ body:
+ clonedResponse.body === null ? null : await clonedResponse.text(),
+ headers: Object.fromEntries(clonedResponse.headers.entries()),
+ redirected: clonedResponse.redirected,
+ },
+ })
+ })()
+ }
+
+ return response
+}
+
+// Resolve the main client for the given event.
+// Client that issues a request doesn't necessarily equal the client
+// that registered the worker. It's with the latter the worker should
+// communicate with during the response resolving phase.
+async function resolveMainClient(event) {
+ const client = await self.clients.get(event.clientId)
+
+ if (client?.frameType === 'top-level') {
+ return client
+ }
+
+ const allClients = await self.clients.matchAll({
+ type: 'window',
+ })
+
+ return allClients
+ .filter((client) => {
+ // Get only those clients that are currently visible.
+ return client.visibilityState === 'visible'
+ })
+ .find((client) => {
+ // Find the client ID that's recorded in the
+ // set of clients that have registered the worker.
+ return activeClientIds.has(client.id)
+ })
+}
+
+async function getResponse(event, client, requestId) {
+ const { request } = event
+ const clonedRequest = request.clone()
+
+ function passthrough() {
+ // Clone the request because it might've been already used
+ // (i.e. its body has been read and sent to the client).
+ const headers = Object.fromEntries(clonedRequest.headers.entries())
+
+ // Remove MSW-specific request headers so the bypassed requests
+ // comply with the server's CORS preflight check.
+ // Operate with the headers as an object because request "Headers"
+ // are immutable.
+ delete headers['x-msw-bypass']
+
+ return fetch(clonedRequest, { headers })
+ }
+
+ // Bypass mocking when the client is not active.
+ if (!client) {
+ return passthrough()
+ }
+
+ // Bypass initial page load requests (i.e. static assets).
+ // The absence of the immediate/parent client in the map of the active clients
+ // means that MSW hasn't dispatched the "MOCK_ACTIVATE" event yet
+ // and is not ready to handle requests.
+ if (!activeClientIds.has(client.id)) {
+ return passthrough()
+ }
+
+ // Bypass requests with the explicit bypass header.
+ // Such requests can be issued by "ctx.fetch()".
+ if (request.headers.get('x-msw-bypass') === 'true') {
+ return passthrough()
+ }
+
+ // Notify the client that a request has been intercepted.
+ const clientMessage = await sendToClient(client, {
+ type: 'REQUEST',
+ payload: {
+ id: requestId,
+ url: request.url,
+ method: request.method,
+ headers: Object.fromEntries(request.headers.entries()),
+ cache: request.cache,
+ mode: request.mode,
+ credentials: request.credentials,
+ destination: request.destination,
+ integrity: request.integrity,
+ redirect: request.redirect,
+ referrer: request.referrer,
+ referrerPolicy: request.referrerPolicy,
+ body: await request.text(),
+ bodyUsed: request.bodyUsed,
+ keepalive: request.keepalive,
+ },
+ })
+
+ switch (clientMessage.type) {
+ case 'MOCK_RESPONSE': {
+ return respondWithMock(clientMessage.data)
+ }
+
+ case 'MOCK_NOT_FOUND': {
+ return passthrough()
+ }
+
+ case 'NETWORK_ERROR': {
+ const { name, message } = clientMessage.data
+ const networkError = new Error(message)
+ networkError.name = name
+
+ // Rejecting a "respondWith" promise emulates a network error.
+ throw networkError
+ }
+ }
+
+ return passthrough()
+}
+
+function sendToClient(client, message) {
+ return new Promise((resolve, reject) => {
+ const channel = new MessageChannel()
+
+ channel.port1.onmessage = (event) => {
+ if (event.data && event.data.error) {
+ return reject(event.data.error)
+ }
+
+ resolve(event.data)
+ }
+
+ client.postMessage(message, [channel.port2])
+ })
+}
+
+function sleep(timeMs) {
+ return new Promise((resolve) => {
+ setTimeout(resolve, timeMs)
+ })
+}
+
+async function respondWithMock(response) {
+ await sleep(response.delay)
+ return new Response(response.body, response)
+}
diff --git a/frontend/public/noise.png b/frontend/public/noise.png
new file mode 100644
index 0000000000..3e5c1fd93d
Binary files /dev/null and b/frontend/public/noise.png differ
diff --git a/frontend/public/site.webmanifest b/frontend/public/site.webmanifest
new file mode 100644
index 0000000000..fa99de77db
--- /dev/null
+++ b/frontend/public/site.webmanifest
@@ -0,0 +1,19 @@
+{
+ "name": "",
+ "short_name": "",
+ "icons": [
+ {
+ "src": "/android-chrome-192x192.png",
+ "sizes": "192x192",
+ "type": "image/png"
+ },
+ {
+ "src": "/android-chrome-512x512.png",
+ "sizes": "512x512",
+ "type": "image/png"
+ }
+ ],
+ "theme_color": "#ffffff",
+ "background_color": "#ffffff",
+ "display": "standalone"
+}
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
new file mode 100644
index 0000000000..3ae931fec8
--- /dev/null
+++ b/frontend/src/App.tsx
@@ -0,0 +1,429 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import "./css/App.css";
+
+import { HourglassIcon, UnlinkIcon } from "lucide-react";
+import { useCallback, useEffect, useState } from "react";
+
+import {
+ sendInterrupt,
+ sendRename,
+ sendRunMultiple,
+ sendSave,
+ sendShutdown,
+} from "@/core/network/requests";
+
+import { Controls } from "editor/Controls";
+import { DirCompletionInput } from "editor/DirCompletionInput";
+import { FilenameForm } from "editor/FilenameForm";
+import { UUID } from "./utils/uuid";
+import clsx from "clsx";
+import { WebSocketState } from "./core/websocket/types";
+import { useMarimoWebSocket } from "./core/websocket/useMarimoWebSocket";
+import { useCellActions, useCells } from "./core/state/cells";
+import { Disconnected } from "./editor/Disconnected";
+import { derefNotNull } from "./utils/dereference";
+import { UserConfig } from "./core/config";
+import { AppMode, toggleAppMode } from "./core/mode";
+import { useHotkey } from "./hooks/useHotkey";
+import { Tooltip } from "./components/ui/tooltip";
+import { useImperativeModal } from "./components/modal/ImperativeModal";
+import {
+ DialogContent,
+ DialogFooter,
+ DialogTitle,
+} from "./components/ui/dialog";
+import { Label } from "./components/ui/label";
+import { Button } from "./components/ui/button";
+import { useEvent } from "./hooks/useEvent";
+import { Logger } from "./utils/Logger";
+import { useAutoSave } from "./core/saving/useAutoSave";
+import { useWindowEventListener } from "./hooks/useEventListener";
+import { toast } from "./components/ui/use-toast";
+import { SortableCellsProvider } from "./components/sort/SortableCellsProvider";
+import { CellId, HTMLCellId } from "./core/model/ids";
+import { getFilenameFromDOM } from "./core/dom/htmlUtils";
+import { CellArray } from "./editor/renderers/CellArray";
+import { RuntimeState } from "./core/RuntimeState";
+
+interface AppProps {
+ initialMode: AppMode;
+ userConfig: UserConfig;
+}
+
+/**
+ * View state for the app.
+ */
+interface ViewState {
+ /**
+ * The mode of the app: read/edit/present
+ */
+ mode: AppMode;
+ /**
+ * A cell ID to anchor scrolling to when toggling between presenting and
+ * editing views
+ */
+ cellAnchor: CellId | null;
+}
+
+export const App: React.FC<AppProps> = ({ initialMode, userConfig }) => {
+ const cells = useCells();
+ const { setCells } = useCellActions();
+ const [viewState, setViewState] = useState<ViewState>({
+ mode: initialMode,
+ cellAnchor: null,
+ });
+ const [filename, setFilename] = useState(getFilenameFromDOM());
+ const [savedCodes, setSavedCodes] = useState<string[]>([""]);
+ const { openModal, closeModal, openAlert } = useImperativeModal();
+
+ const isEditing = viewState.mode === "edit";
+ const isPresenting = viewState.mode === "present";
+ const isReading = viewState.mode === "read";
+ const isRunning = cells.present.some((cell) => cell.status === "running");
+
+ function alertSaveFailed() {
+ openAlert("Failed to save notebook: not connected to a kernel.");
+ }
+
+ // Initialize RuntimeState event-listeners
+ useEffect(() => {
+ RuntimeState.INSTANCE.start();
+ return () => {
+ RuntimeState.INSTANCE.stop();
+ };
+ }, []);
+
+ const { connStatus } = useMarimoWebSocket({
+ setCells,
+ setInitialCodes: setSavedCodes,
+ sessionId: UUID,
+ });
+
+ const handleFilenameChange = useEvent(
+ (name: string | null): Promise<string | null> => {
+ if (connStatus.state !== WebSocketState.OPEN) {
+ alertSaveFailed();
+ return Promise.resolve(null);
+ }
+
+ return sendRename(name)
+ .then(() => {
+ setFilename(name);
+ return name;
+ })
+ .catch((error) => {
+ openAlert(error.message);
+ return null;
+ });
+ }
+ );
+
+ const codes = cells.present.map((cell) => cell.code);
+ const cellNames = cells.present.map((cell) => cell.name);
+ const needsSave =
+ savedCodes.length !== codes.length ||
+ savedCodes.some((code, index) => codes[index] !== code);
+
+ // Save the notebook with the given filename
+ const saveNotebook = useEvent((filename: string, showToast: boolean) => {
+ // Don't save if we are in read mode
+ if (isReading) {
+ return;
+ }
+
+ // Don't save if we are not connected to a kernel
+ if (connStatus.state !== WebSocketState.OPEN) {
+ alertSaveFailed();
+ return;
+ }
+
+ Logger.log("saving to ", filename);
+ sendSave(codes, cellNames, filename)
+ .then(() => {
+ if (showToast) {
+ toast({ title: "Notebook saved" });
+ }
+ setSavedCodes(codes);
+ })
+ .catch((error) => {
+ openAlert(error.message);
+ });
+ });
+
+ // Save the notebook with the current filename, only if the filename exists
+ const saveIfNotebookIsNamed = useEvent((showToast = false) => {
+ if (filename !== null && connStatus.state === WebSocketState.OPEN) {
+ saveNotebook(filename, showToast);
+ }
+ });
+
+ // Save the notebook with the current filename, or prompt the user to name
+ const saveOrNameNotebook = useEvent(() => {
+ saveIfNotebookIsNamed(true);
+
+ // Filename does not exist and we are connected to a kernel
+ if (filename === null && connStatus.state !== WebSocketState.CLOSED) {
+ openModal(
+ <SaveDialog
+ onClose={closeModal}
+ onSubmitSaveDialog={onSubmitSaveDialog}
+ />
+ );
+ }
+ });
+
+ useAutoSave({
+ // Only run autosave if the file is named
+ onSave: saveIfNotebookIsNamed,
+ // Reset autosave when needsSave or codes have changed
+ needsSave: needsSave,
+ codes: codes,
+ connStatus: connStatus,
+ config: userConfig,
+ });
+
+ useWindowEventListener("beforeunload", (e: BeforeUnloadEvent) => {
+ if (needsSave) {
+ e.preventDefault();
+ return (e.returnValue =
+ "You have unsaved changes. Are you sure you want to quit?");
+ }
+ });
+
+ const onSubmitSaveDialog = (e: React.FormEvent<HTMLFormElement>) => {
+ const value = new FormData(e.currentTarget).get("SaveDialogInput");
+ if (typeof value !== "string") {
+ alert("Filename cannot be empty");
+ return;
+ }
+ if (value.length === 0 || value === ".py") {
+ alert("Filename cannot be empty");
+ return;
+ }
+
+ const pythonFilename = value.endsWith(".py") ? value : `${value}.py`;
+ handleFilenameChange(pythonFilename).then((name) => {
+ if (name !== null) {
+ saveNotebook(name, true);
+ }
+ });
+ };
+
+ const runStaleCells = useEvent(() => {
+ const cellIds: CellId[] = [];
+ const codes: string[] = [];
+ for (const cell of cells.present) {
+ if (cell.edited || cell.interrupted) {
+ cellIds.push(cell.key);
+ codes.push(derefNotNull(cell.ref).editorView.state.doc.toString());
+ derefNotNull(cell.ref).registerRun();
+ }
+ }
+
+ if (cellIds.length > 0) {
+ RuntimeState.INSTANCE.registerRunStart();
+ sendRunMultiple(cellIds, codes);
+ }
+ });
+
+ // Toggle the array's presenting state, and sets a cell to anchor scrolling to
+ const togglePresenting = useCallback(() => {
+ const outputAreas = document.getElementsByClassName("OutputArea");
+ const viewportEnd =
+ window.innerHeight || document.documentElement.clientHeight;
+ let cellAnchor: CellId | null = null;
+
+ // Find the first output area that is visible
+ // eslint-disable-next-line unicorn/prefer-spread
+ for (const elem of Array.from(outputAreas)) {
+ const rect = elem.getBoundingClientRect();
+ if (
+ (rect.top >= 0 && rect.top <= viewportEnd) ||
+ (rect.bottom >= 0 && rect.bottom <= viewportEnd)
+ ) {
+ cellAnchor = HTMLCellId.parse(
+ (elem.parentNode as HTMLElement).id as HTMLCellId
+ );
+ break;
+ }
+ }
+
+ setViewState((prev) => ({
+ mode: toggleAppMode(prev.mode),
+ cellAnchor: cellAnchor,
+ }));
+ requestAnimationFrame(() => {
+ if (cellAnchor === null) {
+ return;
+ }
+ document.getElementById(HTMLCellId.create(cellAnchor))?.scrollIntoView();
+ });
+ }, [setViewState]);
+
+ // HOTKEYS
+ useHotkey("global.runStale", runStaleCells);
+ useHotkey("global.save", saveOrNameNotebook);
+ useHotkey("global.interrupt", sendInterrupt);
+ useHotkey("global.hideCode", () => {
+ if (isReading) {
+ return;
+ }
+ togglePresenting();
+ });
+
+ const getCellsAsJSON = useEvent(() => {
+ return JSON.stringify(
+ {
+ filename: filename,
+ cells: cells.present.map((cell) => {
+ return { name: cell.name, code: cell.code };
+ }),
+ },
+ // no replacer
+ null,
+ // whitespace for indentation
+ 2
+ );
+ });
+
+ const cellsArray = (
+ <CellArray
+ cells={cells}
+ connStatus={connStatus}
+ mode={viewState.mode}
+ userConfig={userConfig}
+ />
+ );
+
+ return (
+ <div
+ id="App"
+ className={clsx(
+ connStatus.state === WebSocketState.CLOSED && "disconnected",
+ "bg-background w-full h-full text-textColor"
+ )}
+ >
+ {connStatus.state === WebSocketState.OPEN && isRunning && <RunningIcon />}
+ {connStatus.state === WebSocketState.CLOSED && <NoiseBackground />}
+ {connStatus.state === WebSocketState.CLOSED && <DisconnectedIcon />}
+ <div id="Header">
+ {isEditing && (
+ <div id="Welcome">
+ <FilenameForm
+ filename={filename}
+ setFilename={handleFilenameChange}
+ />
+ </div>
+ )}
+
+ {connStatus.state === WebSocketState.CLOSED && (
+ <Disconnected reason={connStatus.reason} />
+ )}
+ </div>
+
+ {/* Don't render until we have a single cell */}
+ {cells.present.length > 0 && (
+ <SortableCellsProvider disabled={!isEditing}>
+ {cellsArray}
+ </SortableCellsProvider>
+ )}
+
+ {(isEditing || isPresenting) && (
+ <Controls
+ filename={filename}
+ needsSave={needsSave}
+ onSaveNotebook={saveOrNameNotebook}
+ getCellsAsJSON={getCellsAsJSON}
+ presenting={isPresenting}
+ onTogglePresenting={togglePresenting}
+ onInterrupt={sendInterrupt}
+ onShutdown={sendShutdown}
+ onRun={runStaleCells}
+ closed={connStatus.state === WebSocketState.CLOSED}
+ running={isRunning}
+ needsRun={cells.present.some(
+ (cell) => cell.edited || cell.interrupted
+ )}
+ undoAvailable={cells.history.length > 0}
+ />
+ )}
+ </div>
+ );
+};
+
+const DisconnectedIcon = () => (
+ <Tooltip content="App disconnected">
+ <div className="app-status-indicator">
+ <UnlinkIcon className="closed-app-icon" />
+ </div>
+ </Tooltip>
+);
+
+const RunningIcon = () => (
+ <div
+ className="app-status-indicator"
+ title={"Marimo is busy computing. Hang tight!"}
+ >
+ <HourglassIcon className="running-app-icon" size={30} strokeWidth={1} />
+ </div>
+);
+
+const NoiseBackground = () => (
+ <>
+ <div className="noise" />
+ <div className="disconnected-gradient" />
+ </>
+);
+
+const SaveDialog = (props: {
+ onClose: () => void;
+ onSubmitSaveDialog: (e: React.FormEvent<HTMLFormElement>) => void;
+}) => {
+ const { onClose, onSubmitSaveDialog } = props;
+ const cancelButtonLabel = "Cancel";
+ return (
+ <DialogContent className="w-fit">
+ <form
+ onSubmit={(e) => {
+ e.preventDefault();
+ onSubmitSaveDialog(e);
+ onClose();
+ }}
+ onKeyDown={(e) => {
+ // We don't submit on Enter because the user may
+ // have focused the cancel button ...
+ if (e.key === "Escape") {
+ onClose();
+ } else if (
+ e.key === "Enter" &&
+ document.activeElement?.ariaLabel !== cancelButtonLabel
+ ) {
+ onSubmitSaveDialog(e);
+ onClose();
+ }
+ }}
+ >
+ <DialogTitle className="text-accent mb-6">Save?</DialogTitle>
+ <div className="flex items-center gap-5 mb-6 ml-4 mr-16">
+ <Label className="text-md text-muted-foreground">Save as</Label>
+ <DirCompletionInput
+ name="SaveDialogInput"
+ className="missing-filename"
+ />
+ </div>
+ <DialogFooter>
+ <Button
+ aria-label={cancelButtonLabel}
+ variant="secondary"
+ onClick={onClose}
+ >
+ Cancel
+ </Button>
+ <Button aria-label="Save" variant="default" type="submit">
+ Save
+ </Button>
+ </DialogFooter>
+ </form>
+ </DialogContent>
+ );
+};
diff --git a/frontend/src/MarimoApp.tsx b/frontend/src/MarimoApp.tsx
new file mode 100644
index 0000000000..94391425ef
--- /dev/null
+++ b/frontend/src/MarimoApp.tsx
@@ -0,0 +1,45 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useEffect } from "react";
+import "./css/index.css";
+import { ErrorBoundary } from "./editor/boundary/ErrorBoundary";
+import { initializePlugins } from "./plugins/plugins";
+import { App } from "./App";
+import { AppMode } from "./core/mode";
+import { TooltipProvider } from "./components/ui/tooltip";
+import { Toaster } from "./components/ui/toaster";
+import { ModalProvider } from "./components/modal/ImperativeModal";
+import { DayPickerProvider } from "react-day-picker";
+import { CommandPallette } from "./editor/CommandPallette";
+import { useUserConfig } from "./core/state/user-config";
+
+interface MarimoAppProps {
+ /**
+ * The mode of the Marimo app.
+ */
+ initialMode: AppMode;
+}
+
+/**
+ * The root component of the Marimo app.
+ */
+export const MarimoApp: React.FC<MarimoAppProps> = ({ initialMode }) => {
+ const [userConfig] = useUserConfig();
+
+ useEffect(() => {
+ initializePlugins();
+ }, []);
+
+ return (
+ <ErrorBoundary>
+ <TooltipProvider>
+ <DayPickerProvider initialProps={{}}>
+ <ModalProvider>
+ <App initialMode={initialMode} userConfig={userConfig} />
+ <Toaster />
+ {initialMode !== "read" && <CommandPallette />}
+ </ModalProvider>
+ </DayPickerProvider>
+ </TooltipProvider>
+ </ErrorBoundary>
+ );
+};
diff --git a/frontend/src/components/app-config/app-config-button.tsx b/frontend/src/components/app-config/app-config-button.tsx
new file mode 100644
index 0000000000..3108fa9aeb
--- /dev/null
+++ b/frontend/src/components/app-config/app-config-button.tsx
@@ -0,0 +1,33 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import {
+ Popover,
+ PopoverContent,
+ PopoverTrigger,
+} from "@/components/ui/popover";
+import { Button } from "../../editor/inputs/Inputs";
+import { SettingsIcon } from "lucide-react";
+import { UserConfigForm } from "./user-config-form";
+import { Tooltip } from "../ui/tooltip";
+
+export const AppConfigButton = () => {
+ return (
+ <Popover>
+ <PopoverTrigger asChild={true}>
+ <Button
+ aria-label="Config"
+ shape="circle"
+ size="small"
+ className="h-[27px] w-[27px]"
+ color="hint-green"
+ >
+ <Tooltip content="Settings">
+ <SettingsIcon strokeWidth={1.8} />
+ </Tooltip>
+ </Button>
+ </PopoverTrigger>
+ <PopoverContent className="w-80" align="end" side="bottom">
+ <UserConfigForm />
+ </PopoverContent>
+ </Popover>
+ );
+};
diff --git a/frontend/src/components/app-config/theme-toggle.tsx b/frontend/src/components/app-config/theme-toggle.tsx
new file mode 100644
index 0000000000..cbc279be81
--- /dev/null
+++ b/frontend/src/components/app-config/theme-toggle.tsx
@@ -0,0 +1,26 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useTheme } from "../../theme/useTheme";
+import { Checkbox } from "../ui/checkbox";
+import { FormItem, FormLabel, FormControl } from "../ui/form";
+
+export const ThemeToggle: React.FC = () => {
+ const { theme, setTheme } = useTheme();
+
+ if (process.env.NODE_ENV === "production") {
+ return null;
+ }
+
+ return (
+ <FormItem className="flex flex-row items-start space-x-2 space-y-0 pt-2">
+ <FormControl>
+ <Checkbox
+ checked={theme === "dark"}
+ onCheckedChange={(checked) => {
+ return setTheme(checked === true ? "dark" : "light");
+ }}
+ />
+ </FormControl>
+ <FormLabel className="font-normal">Dark mode</FormLabel>
+ </FormItem>
+ );
+};
diff --git a/frontend/src/components/app-config/user-config-form.tsx b/frontend/src/components/app-config/user-config-form.tsx
new file mode 100644
index 0000000000..0e17846f0f
--- /dev/null
+++ b/frontend/src/components/app-config/user-config-form.tsx
@@ -0,0 +1,112 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { zodResolver } from "@hookform/resolvers/zod";
+import { useForm } from "react-hook-form";
+import {
+ Form,
+ FormControl,
+ FormDescription,
+ FormField,
+ FormItem,
+ FormLabel,
+ FormMessage,
+} from "@/components/ui/form";
+import { UserConfig, UserConfigSchema } from "../../core/config";
+import { Checkbox } from "../ui/checkbox";
+import { Input } from "../ui/input";
+import { toast } from "../ui/use-toast";
+import { saveUserConfig } from "../../core/network/requests";
+import { useUserConfig } from "../../core/state/user-config";
+import { ThemeToggle } from "./theme-toggle";
+
+export const UserConfigForm: React.FC = () => {
+ const [config, setConfig] = useUserConfig();
+
+ // Create form
+ const form = useForm<UserConfig>({
+ resolver: zodResolver(UserConfigSchema),
+ defaultValues: config,
+ });
+
+ const onSubmit = async (values: UserConfig) => {
+ await saveUserConfig({ config: values })
+ .then(() => {
+ setConfig(values);
+ })
+ .catch(() => {
+ toast({ title: "Failed to save" });
+ });
+ };
+
+ return (
+ <Form {...form}>
+ <form onChange={form.handleSubmit(onSubmit)} className="space-y-4">
+ <FormField
+ control={form.control}
+ name="save.autosave"
+ render={({ field }) => (
+ <FormItem className="flex flex-row items-start space-x-2 space-y-0">
+ <FormControl>
+ <Checkbox
+ checked={field.value === "after_delay"}
+ onCheckedChange={(checked) => {
+ return field.onChange(
+ checked === true ? "after_delay" : "off"
+ );
+ }}
+ />
+ </FormControl>
+ <FormLabel className="font-normal">Autosave</FormLabel>
+ </FormItem>
+ )}
+ />
+ <FormField
+ control={form.control}
+ name="save.autosave_delay"
+ render={({ field }) => (
+ <FormItem>
+ <FormLabel>Autosave delay (seconds)</FormLabel>
+ <FormControl>
+ <Input
+ type="number"
+ disabled={form.getValues("save.autosave") !== "after_delay"}
+ {...field}
+ value={field.value / 1000}
+ onChange={(e) =>
+ field.onChange(Number.parseInt(e.target.value) * 1000)
+ }
+ />
+ </FormControl>
+ <FormMessage />
+ </FormItem>
+ )}
+ />
+ <FormField
+ control={form.control}
+ name="completion.activate_on_typing"
+ render={({ field }) => (
+ <div className="flex flex-col space-y-1">
+ <FormItem className="flex flex-row items-start space-x-2 space-y-0">
+ <FormControl>
+ <Checkbox
+ checked={field.value}
+ onCheckedChange={(checked) => {
+ return field.onChange(Boolean(checked));
+ }}
+ />
+ </FormControl>
+ <FormLabel className="font-normal">
+ Trigger autocomplete while typing
+ </FormLabel>
+ </FormItem>
+ <FormDescription>
+ When unchecked, code completion is still available through a
+ hotkey.
+ </FormDescription>
+ </div>
+ )}
+ />
+ </form>
+ <ThemeToggle />
+ </Form>
+ );
+};
diff --git a/frontend/src/components/data-table/column-header.tsx b/frontend/src/components/data-table/column-header.tsx
new file mode 100644
index 0000000000..25cd17a278
--- /dev/null
+++ b/frontend/src/components/data-table/column-header.tsx
@@ -0,0 +1,71 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { Column } from "@tanstack/react-table";
+import { ChevronsUpDown, SortAsc, SortDesc } from "lucide-react";
+
+import { cn } from "@/lib/utils";
+import { Button } from "@/components/ui/button";
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuSeparator,
+ DropdownMenuTrigger,
+} from "@/components/ui/dropdown-menu";
+
+interface DataTableColumnHeaderProps<TData, TValue>
+ extends React.HTMLAttributes<HTMLDivElement> {
+ column: Column<TData, TValue>;
+ title: string;
+}
+
+export const DataTableColumnHeader = <TData, TValue>({
+ column,
+ title,
+ className,
+}: DataTableColumnHeaderProps<TData, TValue>) => {
+ if (!column.getCanSort()) {
+ return <div className={cn(className)}>{title}</div>;
+ }
+
+ return (
+ <div className={cn("flex items-center space-x-2", className)}>
+ <span>{title}</span>
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild={true}>
+ <Button
+ variant="ghost"
+ size="xs"
+ className="ml-3 h-5 data-[state=open]:bg-accent m-0 p-1"
+ >
+ {column.getIsSorted() === "desc" ? (
+ <SortDesc className="h-3 w-3" />
+ ) : column.getIsSorted() === "asc" ? (
+ <SortAsc className="h-3 w-3" />
+ ) : (
+ <ChevronsUpDown className="h-3 w-3" />
+ )}
+ </Button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="start">
+ <DropdownMenuItem onClick={() => column.toggleSorting(false)}>
+ <SortAsc className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
+ Asc
+ </DropdownMenuItem>
+ <DropdownMenuItem onClick={() => column.toggleSorting(true)}>
+ <SortDesc className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
+ Desc
+ </DropdownMenuItem>
+ {column.getIsSorted() && (
+ <>
+ <DropdownMenuSeparator />
+ <DropdownMenuItem onClick={() => column.clearSorting()}>
+ <ChevronsUpDown className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
+ Clear
+ </DropdownMenuItem>
+ </>
+ )}
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </div>
+ );
+};
diff --git a/frontend/src/components/data-table/columns.tsx b/frontend/src/components/data-table/columns.tsx
new file mode 100644
index 0000000000..fcdd86b46e
--- /dev/null
+++ b/frontend/src/components/data-table/columns.tsx
@@ -0,0 +1,118 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { ColumnDef } from "@tanstack/react-table";
+import { DataTableColumnHeader } from "./column-header";
+import { Checkbox } from "../ui/checkbox";
+import { MimeCell } from "./mime-cell";
+
+interface ColumnInfo {
+ key: string;
+ type: "primitive" | "mime";
+}
+
+export function getColumnInfo<T>(items: T[]): ColumnInfo[] {
+ // No items
+ if (items.length === 0) {
+ return [];
+ }
+
+ // Not an object
+ if (typeof items[0] !== "object") {
+ return [];
+ }
+
+ const keys = new Map<string, ColumnInfo>();
+ items.forEach((item) => {
+ if (typeof item !== "object") {
+ return;
+ }
+ // We will be a bit defensive and assume values are not homogenous.
+ // If any is a mimetype, then we will treat it as a mimetype (i.e. not sortable)
+ Object.entries(item as object).forEach(([key, value]) => {
+ const currentValue = keys.get(key);
+ if (!currentValue) {
+ // Set for the first time
+ keys.set(key, {
+ key,
+ type: isPrimitiveOrNullish(value) ? "primitive" : "mime",
+ });
+ }
+ // If we have a value, and it is a primitive, we could possibly upgrade it to a mime
+ if (
+ currentValue &&
+ currentValue.type === "primitive" &&
+ !isPrimitiveOrNullish(value)
+ ) {
+ keys.set(key, {
+ key,
+ type: "mime",
+ });
+ }
+ });
+ });
+
+ return [...keys.values()];
+}
+
+export function generateColumns<T>(
+ items: T[],
+ selection: "single" | "multi" | null
+): Array<ColumnDef<T>> {
+ const columnInfo = getColumnInfo(items);
+ const columns = columnInfo.map(
+ (info): ColumnDef<T> => ({
+ id: info.key,
+ // Use an accessorFn instead of an accessorKey because column names
+ // may have periods in them ...
+ // https://github.com/TanStack/table/issues/1671
+ accessorFn: (row) => {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ return (row as any)[info.key];
+ },
+ header: ({ column }) => {
+ return <DataTableColumnHeader title={info.key} column={column} />;
+ },
+ cell: ({ renderValue, getValue }) => {
+ const value = getValue();
+ if (isPrimitiveOrNullish(value)) {
+ return renderValue();
+ }
+ return <MimeCell value={value} />;
+ },
+ enableSorting: info.type === "primitive",
+ })
+ );
+
+ if (selection === "single" || selection === "multi") {
+ columns.unshift({
+ id: "select",
+ header: ({ table }) =>
+ selection === "multi" ? (
+ <Checkbox
+ checked={table.getIsAllPageRowsSelected()}
+ onCheckedChange={(value) =>
+ table.toggleAllPageRowsSelected(!!value)
+ }
+ aria-label="Select all"
+ />
+ ) : null,
+ cell: ({ row }) => (
+ <Checkbox
+ checked={row.getIsSelected()}
+ onCheckedChange={(value) => row.toggleSelected(!!value)}
+ aria-label="Select row"
+ />
+ ),
+ enableSorting: false,
+ enableHiding: false,
+ });
+ }
+
+ return columns;
+}
+
+function isPrimitiveOrNullish(value: unknown): boolean {
+ if (value == null) {
+ return true;
+ }
+ return typeof value !== "object";
+}
diff --git a/frontend/src/components/data-table/data-table.tsx b/frontend/src/components/data-table/data-table.tsx
new file mode 100644
index 0000000000..88a68df61d
--- /dev/null
+++ b/frontend/src/components/data-table/data-table.tsx
@@ -0,0 +1,112 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import React from "react";
+import {
+ ColumnDef,
+ OnChangeFn,
+ RowSelectionState,
+ SortingState,
+ flexRender,
+ getCoreRowModel,
+ getPaginationRowModel,
+ getSortedRowModel,
+ useReactTable,
+} from "@tanstack/react-table";
+
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
+} from "@/components/ui/table";
+import { DataTablePagination } from "./pagination";
+
+interface DataTableProps<TData, TValue> {
+ columns: Array<ColumnDef<TData, TValue>>;
+ data: TData[];
+ pagination?: boolean;
+ selection?: "single" | "multi" | null;
+ rowSelection?: RowSelectionState;
+ onRowSelectionChange?: OnChangeFn<RowSelectionState>;
+}
+
+export const DataTable = <TData, TValue>({
+ columns,
+ data,
+ rowSelection,
+ pagination = false,
+ onRowSelectionChange,
+}: DataTableProps<TData, TValue>) => {
+ const [sorting, setSorting] = React.useState<SortingState>([]);
+
+ const table = useReactTable({
+ data,
+ columns,
+ getCoreRowModel: getCoreRowModel(),
+ getPaginationRowModel: pagination ? getPaginationRowModel() : undefined,
+ onSortingChange: setSorting,
+ getSortedRowModel: getSortedRowModel(),
+ onRowSelectionChange: onRowSelectionChange,
+ state: {
+ sorting,
+ rowSelection,
+ },
+ });
+
+ return (
+ <div className="flex flex-col space-y-4">
+ <div className="rounded-md border">
+ <Table>
+ <TableHeader>
+ {table.getHeaderGroups().map((headerGroup) => (
+ <TableRow key={headerGroup.id}>
+ {headerGroup.headers.map((header) => {
+ return (
+ <TableHead key={header.id}>
+ {header.isPlaceholder
+ ? null
+ : flexRender(
+ header.column.columnDef.header,
+ header.getContext()
+ )}
+ </TableHead>
+ );
+ })}
+ </TableRow>
+ ))}
+ </TableHeader>
+ <TableBody>
+ {table.getRowModel().rows?.length ? (
+ table.getRowModel().rows.map((row) => (
+ <TableRow
+ key={row.id}
+ data-state={row.getIsSelected() && "selected"}
+ >
+ {row.getVisibleCells().map((cell) => (
+ <TableCell key={cell.id}>
+ {flexRender(
+ cell.column.columnDef.cell,
+ cell.getContext()
+ )}
+ </TableCell>
+ ))}
+ </TableRow>
+ ))
+ ) : (
+ <TableRow>
+ <TableCell
+ colSpan={columns.length}
+ className="h-24 text-center"
+ >
+ No results.
+ </TableCell>
+ </TableRow>
+ )}
+ </TableBody>
+ </Table>
+ </div>
+ {pagination && <DataTablePagination table={table} />}
+ </div>
+ );
+};
diff --git a/frontend/src/components/data-table/mime-cell.tsx b/frontend/src/components/data-table/mime-cell.tsx
new file mode 100644
index 0000000000..77984feb7b
--- /dev/null
+++ b/frontend/src/components/data-table/mime-cell.tsx
@@ -0,0 +1,31 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { cn } from "@/lib/utils";
+import { formatOutput } from "../../editor/Output";
+import { OutputMessage } from "../../core/kernel/messages";
+
+interface MimeCellProps {
+ value: unknown;
+}
+
+export const MimeCell = ({ value }: MimeCellProps) => {
+ if (typeof value !== "object" || value === null) {
+ return null;
+ }
+
+ if (!("mimetype" in value && "data" in value)) {
+ return null;
+ }
+
+ return (
+ <div className={cn("flex items-center space-x-2")}>
+ {formatOutput({
+ message: {
+ channel: "",
+ data: value.data,
+ mimetype: value.mimetype,
+ timestamp: "",
+ } as OutputMessage,
+ })}
+ </div>
+ );
+};
diff --git a/frontend/src/components/data-table/pagination.tsx b/frontend/src/components/data-table/pagination.tsx
new file mode 100644
index 0000000000..041f1fae46
--- /dev/null
+++ b/frontend/src/components/data-table/pagination.tsx
@@ -0,0 +1,69 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { Table } from "@tanstack/react-table";
+import {
+ ChevronLeft,
+ ChevronRight,
+ ChevronsLeft,
+ ChevronsRight,
+} from "lucide-react";
+
+import { Button } from "@/components/ui/button";
+
+interface DataTablePaginationProps<TData> {
+ table: Table<TData>;
+}
+
+export const DataTablePagination = <TData,>({
+ table,
+}: DataTablePaginationProps<TData>) => {
+ return (
+ <div className="flex items-center justify-end px-2">
+ <div className="flex items-center space-x-2">
+ <Button
+ size="xs"
+ variant="outline"
+ className="hidden h-6 w-6 p-0 lg:flex"
+ onClick={() => table.setPageIndex(0)}
+ disabled={!table.getCanPreviousPage()}
+ >
+ <span className="sr-only">Go to first page</span>
+ <ChevronsLeft className="h-4 w-4" />
+ </Button>
+ <Button
+ size="xs"
+ variant="outline"
+ className="h-6 w-6 p-0"
+ onClick={() => table.previousPage()}
+ disabled={!table.getCanPreviousPage()}
+ >
+ <span className="sr-only">Go to previous page</span>
+ <ChevronLeft className="h-4 w-4" />
+ </Button>
+ <div className="flex w-[100px] items-center justify-center text-xs font-medium">
+ Page {table.getState().pagination.pageIndex + 1} of{" "}
+ {table.getPageCount()}
+ </div>
+ <Button
+ size="xs"
+ variant="outline"
+ className="h-6 w-6 p-0"
+ onClick={() => table.nextPage()}
+ disabled={!table.getCanNextPage()}
+ >
+ <span className="sr-only">Go to next page</span>
+ <ChevronRight className="h-4 w-4" />
+ </Button>
+ <Button
+ size="xs"
+ variant="outline"
+ className="hidden h-6 w-6 p-0 lg:flex"
+ onClick={() => table.setPageIndex(table.getPageCount() - 1)}
+ disabled={!table.getCanNextPage()}
+ >
+ <span className="sr-only">Go to last page</span>
+ <ChevronsRight className="h-4 w-4" />
+ </Button>
+ </div>
+ </div>
+ );
+};
diff --git a/frontend/src/components/modal/ImperativeModal.tsx b/frontend/src/components/modal/ImperativeModal.tsx
new file mode 100644
index 0000000000..e789439e1f
--- /dev/null
+++ b/frontend/src/components/modal/ImperativeModal.tsx
@@ -0,0 +1,92 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import React, { PropsWithChildren } from "react";
+import { Dialog } from "../ui/dialog";
+import {
+ AlertDialog,
+ AlertDialogAction,
+ AlertDialogContent,
+ AlertDialogFooter,
+} from "../ui/alert-dialog";
+
+interface ModalContextType {
+ modal: React.ReactNode | null;
+ setModal: (modal: React.ReactNode | null) => void;
+}
+
+const ModalContext = React.createContext<ModalContextType>({
+ modal: null,
+ setModal: () => {
+ return;
+ },
+});
+
+export const ModalProvider: React.FC<PropsWithChildren<{}>> = (props) => {
+ const [modal, setModal] = React.useState<React.ReactNode | null>(null);
+
+ return (
+ <ModalContext.Provider value={{ modal, setModal }}>
+ {modal}
+ {props.children}
+ </ModalContext.Provider>
+ );
+};
+/**
+ * This hook allows you to open and close the modal imperatively.
+ *
+ * @example
+ * ```tsx
+ * const { openModal, closeModal } = useImperativeModal();
+ *
+ * const handleOpenModal = () => {
+ * openModal(<DialogContent>...<Button onClick={closeModal}/>Cancel</DialogContent>);
+ * }
+ * ```
+ */
+export function useImperativeModal() {
+ const context = React.useContext(ModalContext);
+
+ if (context === undefined) {
+ throw new Error("useModal must be used within a ModalProvider");
+ }
+
+ const closeModal = () => {
+ context.setModal(null);
+ };
+
+ return {
+ openModal: (content: React.ReactNode) => {
+ context.setModal(
+ <Dialog
+ open={true}
+ onOpenChange={(open) => {
+ if (!open) {
+ closeModal();
+ }
+ }}
+ >
+ {content}
+ </Dialog>
+ );
+ },
+ openAlert: (content: React.ReactNode) => {
+ context.setModal(
+ <AlertDialog
+ open={true}
+ onOpenChange={(open) => {
+ if (!open) {
+ closeModal();
+ }
+ }}
+ >
+ <AlertDialogContent>
+ {content}
+ <AlertDialogFooter>
+ <AlertDialogAction onClick={closeModal}>Ok</AlertDialogAction>
+ </AlertDialogFooter>
+ </AlertDialogContent>
+ </AlertDialog>
+ );
+ },
+ closeModal: closeModal,
+ };
+}
diff --git a/frontend/src/components/shortcuts/renderShortcut.tsx b/frontend/src/components/shortcuts/renderShortcut.tsx
new file mode 100644
index 0000000000..60b1dd9648
--- /dev/null
+++ b/frontend/src/components/shortcuts/renderShortcut.tsx
@@ -0,0 +1,39 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { HotkeyAction, HOTKEYS } from "@/core/hotkeys/hotkeys";
+import { isPlatformMac } from "@/core/shortcuts/shortcuts";
+import { Kbd } from "../ui/kbd";
+
+export function renderShortcut(shortcut: HotkeyAction) {
+ const hotkey = HOTKEYS.getHotkey(shortcut);
+
+ return (
+ <span className="flex">
+ {hotkey.name}{" "}
+ <span className="flex ml-1 gap-1">
+ {prettyPrintHotkey(hotkey.key).map((key) => (
+ <Kbd key={key}>{key}</Kbd>
+ ))}
+ </span>
+ </span>
+ );
+}
+
+export function prettyPrintHotkey(keyboard: string) {
+ return keyboard.split("-").map((key) => {
+ switch (key.toLowerCase()) {
+ case "cmd":
+ return "⌘";
+ case "meta":
+ return isPlatformMac() ? "⌘" : "ctrl";
+ case "shift":
+ return "shift";
+ case "alt":
+ return isPlatformMac() ? "⌥" : "alt";
+ case "control":
+ case "ctrl":
+ return isPlatformMac() ? "⌃" : "ctrl";
+ default:
+ return key.toLowerCase();
+ }
+ });
+}
diff --git a/frontend/src/components/sort/SortableCellsProvider.tsx b/frontend/src/components/sort/SortableCellsProvider.tsx
new file mode 100644
index 0000000000..3a4c5203dd
--- /dev/null
+++ b/frontend/src/components/sort/SortableCellsProvider.tsx
@@ -0,0 +1,72 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import React from "react";
+import {
+ DndContext,
+ closestCenter,
+ KeyboardSensor,
+ PointerSensor,
+ useSensor,
+ DragEndEvent,
+ useSensors,
+} from "@dnd-kit/core";
+import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
+import {
+ SortableContext,
+ sortableKeyboardCoordinates,
+ verticalListSortingStrategy,
+} from "@dnd-kit/sortable";
+import { useCellActions, useCells } from "../../core/state/cells";
+import { useEvent } from "../../hooks/useEvent";
+import { CellId } from "@/core/model/ids";
+
+interface SortableCellsProviderProps {
+ children: React.ReactNode;
+ disabled?: boolean;
+}
+
+const SortableCellsProviderInternal = ({
+ children,
+ disabled,
+}: SortableCellsProviderProps) => {
+ const cells = useCells();
+ const { dropCellOver } = useCellActions();
+
+ const sensors = useSensors(
+ useSensor(PointerSensor),
+ useSensor(KeyboardSensor, {
+ coordinateGetter: sortableKeyboardCoordinates,
+ })
+ );
+
+ const ids = cells.present.map((item) => item.key.toString());
+
+ const handleDragEnd = useEvent((event: DragEndEvent) => {
+ const { active, over } = event;
+ if (over === null) {
+ return;
+ }
+ if (active.id === over.id) {
+ return;
+ }
+ dropCellOver(active.id as CellId, over.id as CellId);
+ });
+
+ return (
+ <DndContext
+ sensors={sensors}
+ collisionDetection={closestCenter}
+ modifiers={[restrictToVerticalAxis]}
+ onDragEnd={handleDragEnd}
+ >
+ <SortableContext
+ items={ids}
+ disabled={disabled}
+ strategy={verticalListSortingStrategy}
+ >
+ {children}
+ </SortableContext>
+ </DndContext>
+ );
+};
+
+export const SortableCellsProvider = React.memo(SortableCellsProviderInternal);
diff --git a/frontend/src/components/ui/accordion.tsx b/frontend/src/components/ui/accordion.tsx
new file mode 100644
index 0000000000..479d461fc4
--- /dev/null
+++ b/frontend/src/components/ui/accordion.tsx
@@ -0,0 +1,59 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import * as AccordionPrimitive from "@radix-ui/react-accordion";
+import { ChevronDown } from "lucide-react";
+
+import { cn } from "@/lib/utils";
+
+const Accordion = AccordionPrimitive.Root;
+
+const AccordionItem = React.forwardRef<
+ React.ElementRef<typeof AccordionPrimitive.Item>,
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
+>(({ className, ...props }, ref) => (
+ <AccordionPrimitive.Item
+ ref={ref}
+ className={cn("border-b", className)}
+ {...props}
+ />
+));
+AccordionItem.displayName = "AccordionItem";
+
+const AccordionTrigger = React.forwardRef<
+ React.ElementRef<typeof AccordionPrimitive.Trigger>,
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
+>(({ className, children, ...props }, ref) => (
+ <AccordionPrimitive.Header className="flex">
+ <AccordionPrimitive.Trigger
+ ref={ref}
+ className={cn(
+ "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <ChevronDown className="h-4 w-4 transition-transform duration-200" />
+ </AccordionPrimitive.Trigger>
+ </AccordionPrimitive.Header>
+));
+AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
+
+const AccordionContent = React.forwardRef<
+ React.ElementRef<typeof AccordionPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
+>(({ className, children, ...props }, ref) => (
+ <AccordionPrimitive.Content
+ ref={ref}
+ className={cn(
+ "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
+ className
+ )}
+ {...props}
+ >
+ <div className="pb-4 pt-0">{children}</div>
+ </AccordionPrimitive.Content>
+));
+AccordionContent.displayName = AccordionPrimitive.Content.displayName;
+
+export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
diff --git a/frontend/src/components/ui/alert-dialog.tsx b/frontend/src/components/ui/alert-dialog.tsx
new file mode 100644
index 0000000000..d931f06faf
--- /dev/null
+++ b/frontend/src/components/ui/alert-dialog.tsx
@@ -0,0 +1,167 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
+
+import { cn } from "@/lib/utils";
+import { buttonVariants } from "@/components/ui/button";
+
+const AlertDialog = AlertDialogPrimitive.Root;
+
+const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
+
+const AlertDialogPortal = ({
+ className,
+ children,
+ ...props
+}: AlertDialogPrimitive.AlertDialogPortalProps) => (
+ <AlertDialogPrimitive.Portal className={cn(className)} {...props}>
+ <div className="fixed inset-0 z-50 flex items-end justify-center sm:items-start sm:top-[15%]">
+ {children}
+ </div>
+ </AlertDialogPrimitive.Portal>
+);
+AlertDialogPortal.displayName = AlertDialogPrimitive.Portal.displayName;
+
+const AlertDialogOverlay = React.forwardRef<
+ React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
+>(({ className, children, ...props }, ref) => (
+ <AlertDialogPrimitive.Overlay
+ className={cn(
+ "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm transition-opacity animate-in fade-in",
+ className
+ )}
+ {...props}
+ ref={ref}
+ />
+));
+AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
+
+const AlertDialogContent = React.forwardRef<
+ React.ElementRef<typeof AlertDialogPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
+>(({ className, ...props }, ref) => (
+ <AlertDialogPortal>
+ <AlertDialogOverlay />
+ <AlertDialogPrimitive.Content
+ ref={ref}
+ className={cn(
+ "fixed z-50 grid w-full max-w-lg scale-100 gap-4 border bg-background p-6 opacity-100 shadow-sm animate-in fade-in-90 slide-in-from-bottom-10 sm:rounded-lg sm:zoom-in-90 sm:slide-in-from-bottom-0 md:w-full",
+ className
+ )}
+ {...props}
+ />
+ </AlertDialogPortal>
+));
+AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
+
+const AlertDialogHeader = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) => (
+ <div
+ className={cn(
+ "flex flex-col space-y-2 text-center sm:text-left",
+ className
+ )}
+ {...props}
+ />
+);
+AlertDialogHeader.displayName = "AlertDialogHeader";
+
+const AlertDialogFooter = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) => (
+ <div
+ className={cn(
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
+ className
+ )}
+ {...props}
+ />
+);
+AlertDialogFooter.displayName = "AlertDialogFooter";
+
+const AlertDialogTitle = React.forwardRef<
+ React.ElementRef<typeof AlertDialogPrimitive.Title>,
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
+>(({ className, ...props }, ref) => (
+ <AlertDialogPrimitive.Title
+ ref={ref}
+ className={cn("text-lg font-semibold", className)}
+ {...props}
+ />
+));
+AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
+
+const AlertDialogDescription = React.forwardRef<
+ React.ElementRef<typeof AlertDialogPrimitive.Description>,
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
+>(({ className, ...props }, ref) => (
+ <AlertDialogPrimitive.Description
+ ref={ref}
+ className={cn("text-muted-foreground", className)}
+ {...props}
+ />
+));
+AlertDialogDescription.displayName =
+ AlertDialogPrimitive.Description.displayName;
+
+const AlertDialogAction = React.forwardRef<
+ React.ElementRef<typeof AlertDialogPrimitive.Action>,
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
+>(({ className, ...props }, ref) => (
+ <AlertDialogPrimitive.Action
+ ref={ref}
+ className={cn(buttonVariants(), className)}
+ {...props}
+ />
+));
+AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
+
+const AlertDialogDestructiveAction = React.forwardRef<
+ React.ElementRef<typeof AlertDialogPrimitive.Action>,
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
+>(({ className, ...props }, ref) => (
+ <AlertDialogPrimitive.Action
+ ref={ref}
+ className={cn(
+ buttonVariants({
+ variant: "destructive",
+ }),
+ className
+ )}
+ {...props}
+ />
+));
+AlertDialogDestructiveAction.displayName = "AlertDialogDestructiveAction";
+
+const AlertDialogCancel = React.forwardRef<
+ React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
+>(({ className, ...props }, ref) => (
+ <AlertDialogPrimitive.Cancel
+ ref={ref}
+ className={cn(
+ buttonVariants({ variant: "secondary" }),
+ "mt-2 sm:mt-0",
+ className
+ )}
+ {...props}
+ />
+));
+AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
+
+export {
+ AlertDialog,
+ AlertDialogTrigger,
+ AlertDialogContent,
+ AlertDialogHeader,
+ AlertDialogFooter,
+ AlertDialogTitle,
+ AlertDialogDescription,
+ AlertDialogAction,
+ AlertDialogDestructiveAction,
+ AlertDialogCancel,
+};
diff --git a/frontend/src/components/ui/alert.tsx b/frontend/src/components/ui/alert.tsx
new file mode 100644
index 0000000000..bc05c0b851
--- /dev/null
+++ b/frontend/src/components/ui/alert.tsx
@@ -0,0 +1,62 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import { VariantProps, cva } from "class-variance-authority";
+
+import { cn } from "@/lib/utils";
+
+const alertVariants = cva(
+ "relative w-full rounded-lg border p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11",
+ {
+ variants: {
+ variant: {
+ default: "bg-background text-foreground",
+ destructive:
+ "text-destructive border-destructive/50 dark:border-destructive [&>svg]:text-destructive text-destructive",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ }
+);
+
+const Alert = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
+>(({ className, variant, ...props }, ref) => (
+ <div
+ ref={ref}
+ role="alert"
+ className={cn(alertVariants({ variant }), className)}
+ {...props}
+ />
+));
+Alert.displayName = "Alert";
+
+const AlertTitle = React.forwardRef<
+ HTMLParagraphElement,
+ React.HTMLAttributes<HTMLHeadingElement>
+>(({ className, children, ...props }, ref) => (
+ <h5
+ ref={ref}
+ className={cn("mb-1 font-medium leading-none tracking-tight", className)}
+ {...props}
+ >
+ {children}
+ </h5>
+));
+AlertTitle.displayName = "AlertTitle";
+
+const AlertDescription = React.forwardRef<
+ HTMLParagraphElement,
+ React.HTMLAttributes<HTMLParagraphElement>
+>(({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn("text-sm [&_p]:leading-relaxed", className)}
+ {...props}
+ />
+));
+AlertDescription.displayName = "AlertDescription";
+
+export { Alert, AlertTitle, AlertDescription };
diff --git a/frontend/src/components/ui/badge.tsx b/frontend/src/components/ui/badge.tsx
new file mode 100644
index 0000000000..1f7b1e4aae
--- /dev/null
+++ b/frontend/src/components/ui/badge.tsx
@@ -0,0 +1,37 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import { VariantProps, cva } from "class-variance-authority";
+
+import { cn } from "@/lib/utils";
+
+const badgeVariants = cva(
+ "inline-flex items-center border rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
+ {
+ variants: {
+ variant: {
+ default:
+ "bg-primary hover:bg-primary/80 border-transparent text-primary-foreground",
+ secondary:
+ "bg-secondary hover:bg-secondary/80 border-transparent text-secondary-foreground",
+ destructive:
+ "bg-destructive hover:bg-destructive/80 border-transparent text-destructive-foreground",
+ outline: "text-foreground",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ }
+);
+
+export interface BadgeProps
+ extends React.HTMLAttributes<HTMLDivElement>,
+ VariantProps<typeof badgeVariants> {}
+
+const Badge = ({ className, variant, ...props }: BadgeProps) => {
+ return (
+ <div className={cn(badgeVariants({ variant }), className)} {...props} />
+ );
+};
+
+export { Badge, badgeVariants };
diff --git a/frontend/src/components/ui/button.tsx b/frontend/src/components/ui/button.tsx
new file mode 100644
index 0000000000..3974fd777a
--- /dev/null
+++ b/frontend/src/components/ui/button.tsx
@@ -0,0 +1,82 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import { Slot } from "@radix-ui/react-slot";
+import { VariantProps, cva } from "class-variance-authority";
+
+import { cn } from "@/lib/utils";
+
+const activeCommon = "active:shadow-xsSolid";
+
+const buttonVariants = cva(
+ "inline-flex mb-1 items-center justify-center rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background",
+ {
+ variants: {
+ variant: {
+ default: cn(
+ "bg-accent text-accent-foreground hover:bg-accent/90 shadow-smSolid border border-accent",
+ activeCommon
+ ),
+ destructive: cn(
+ "bg-destructive text-destructive-foreground shadow-smSolid",
+ "hover:bg-destructive/90 border border-destructive",
+ activeCommon
+ ),
+ action: cn(
+ "bg-action text-action-foreground shadow-smSolid",
+ "hover:bg-action-hover border border-action",
+ activeCommon
+ ),
+ outline: cn(
+ "border border-slate-500 shadow-smSolid",
+ "hover:bg-accent/90 hover:text-accent-foreground",
+ "hover:border-transparent",
+ activeCommon
+ ),
+ secondary: cn(
+ "bg-secondary text-secondary-foreground hover:bg-secondary/60",
+ "border border-input shadow-smSolid",
+ activeCommon
+ ),
+ ghost: cn(
+ "hover:bg-accent/90 hover:text-accent-foreground hover:shadow-smSolid border border-transparent",
+ activeCommon,
+ "active:text-accent-foreground"
+ ),
+ link: "underline-offset-4 hover:underline text-primary",
+ },
+ size: {
+ default: "h-10 py-2 px-4",
+ sm: "h-9 px-3 rounded-md",
+ xs: "h-7 px-2 rounded-md",
+ lg: "h-11 px-8 rounded-md",
+ icon: "h-6 w-6",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ size: "sm",
+ },
+ }
+);
+
+export interface ButtonProps
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
+ VariantProps<typeof buttonVariants> {
+ asChild?: boolean;
+}
+
+const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
+ const Comp = asChild ? Slot : "button";
+ return (
+ <Comp
+ className={cn(buttonVariants({ variant, size, className }))}
+ ref={ref}
+ {...props}
+ />
+ );
+ }
+);
+Button.displayName = "Button";
+
+export { Button, buttonVariants };
diff --git a/frontend/src/components/ui/calendar.tsx b/frontend/src/components/ui/calendar.tsx
new file mode 100644
index 0000000000..9ce060b12f
--- /dev/null
+++ b/frontend/src/components/ui/calendar.tsx
@@ -0,0 +1,63 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import { ChevronLeft, ChevronRight } from "lucide-react";
+import { DayPicker } from "react-day-picker";
+
+import { cn } from "@/lib/utils";
+import { buttonVariants } from "@/components/ui/button";
+
+export type CalendarProps = React.ComponentProps<typeof DayPicker>;
+
+const Calendar = ({
+ className,
+ classNames,
+ showOutsideDays = true,
+ ...props
+}: CalendarProps) => {
+ return (
+ <DayPicker
+ showOutsideDays={showOutsideDays}
+ className={cn("p-3", className)}
+ classNames={{
+ months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
+ month: "space-y-4",
+ caption: "flex justify-center pt-1 relative items-center",
+ caption_label: "text-sm font-medium",
+ nav: "space-x-1 flex items-center",
+ nav_button: cn(
+ buttonVariants({ variant: "outline" }),
+ "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
+ ),
+ nav_button_previous: "absolute left-1",
+ nav_button_next: "absolute right-1",
+ table: "w-full border-collapse space-y-1",
+ head_row: "flex",
+ head_cell:
+ "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
+ row: "flex w-full mt-2",
+ cell: "text-center text-sm p-0 relative [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
+ day: cn(
+ buttonVariants({ variant: "ghost" }),
+ "h-9 w-9 p-0 font-normal aria-selected:opacity-100"
+ ),
+ day_selected:
+ "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
+ day_today: "bg-accent text-accent-foreground",
+ day_outside: "text-muted-foreground opacity-50",
+ day_disabled: "text-muted-foreground opacity-50",
+ day_range_middle:
+ "aria-selected:bg-accent aria-selected:text-accent-foreground",
+ day_hidden: "invisible",
+ ...classNames,
+ }}
+ components={{
+ IconLeft: ({ ...props }) => <ChevronLeft className="h-4 w-4" />,
+ IconRight: ({ ...props }) => <ChevronRight className="h-4 w-4" />,
+ }}
+ {...props}
+ />
+ );
+};
+Calendar.displayName = "Calendar";
+
+export { Calendar };
diff --git a/frontend/src/components/ui/checkbox.tsx b/frontend/src/components/ui/checkbox.tsx
new file mode 100644
index 0000000000..87cfe0c1c0
--- /dev/null
+++ b/frontend/src/components/ui/checkbox.tsx
@@ -0,0 +1,32 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
+import { Check } from "lucide-react";
+
+import { cn } from "@/lib/utils";
+
+const Checkbox = React.forwardRef<
+ React.ElementRef<typeof CheckboxPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
+>(({ className, ...props }, ref) => (
+ <CheckboxPrimitive.Root
+ ref={ref}
+ className={cn(
+ "peer h-4 w-4 shrink-0 rounded-sm border border-accent ring-offset-background focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-accent data-[state=checked]:text-primary-foreground",
+ className
+ )}
+ {...props}
+ >
+ <CheckboxPrimitive.Indicator
+ // `max-h-[14px] overflow-hidden` are for the checkmark icon to not resize the checkbox
+ className={cn(
+ "flex items-center justify-center text-current max-h-[14px] overflow-hidden"
+ )}
+ >
+ <Check className="h-4 w-4" />
+ </CheckboxPrimitive.Indicator>
+ </CheckboxPrimitive.Root>
+));
+Checkbox.displayName = CheckboxPrimitive.Root.displayName;
+
+export { Checkbox };
diff --git a/frontend/src/components/ui/combobox.tsx b/frontend/src/components/ui/combobox.tsx
new file mode 100644
index 0000000000..d63a29eeaf
--- /dev/null
+++ b/frontend/src/components/ui/combobox.tsx
@@ -0,0 +1,220 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { ChevronDownIcon, Check } from "lucide-react";
+import { createContext, useContext } from "react";
+import { cn } from "../../lib/utils";
+import { useControllableState } from "@radix-ui/react-use-controllable-state";
+import {
+ Command,
+ CommandEmpty,
+ CommandInput,
+ CommandItem,
+ CommandList,
+} from "./command";
+import { Popover, PopoverContent, PopoverTrigger } from "./popover";
+import { Functions } from "../../utils/functions";
+
+interface ComboboxContextValue {
+ isSelected: (value: unknown) => boolean;
+ onSelect: (value: unknown) => void;
+}
+
+export const ComboboxContext = createContext<ComboboxContextValue>({
+ isSelected: () => false,
+ onSelect: Functions.NOOP,
+});
+
+interface ComboboxCommonProps<TValue> {
+ children: React.ReactNode;
+ displayValue?: (item: TValue) => string;
+ placeholder?: string;
+ open?: boolean;
+ defaultOpen?: boolean;
+ onOpenChange?: (open: boolean) => void;
+ inputPlaceholder?: string;
+ search?: string;
+ onSearchChange?: (search: string) => void;
+ emptyState?: React.ReactNode;
+}
+
+type ComboboxFilterProps =
+ | {
+ shouldFilter?: true;
+ filterFn?: React.ComponentProps<typeof Command>["filter"];
+ }
+ | {
+ shouldFilter: false;
+ filterFn?: never;
+ };
+
+type ComboboxValueProps<TValue> =
+ | {
+ multiple?: false;
+ value?: TValue | null;
+ defaultValue?: TValue | null;
+ onValueChange?(value: TValue | null): void;
+ }
+ | {
+ multiple: true;
+ value?: TValue[] | null;
+ defaultValue?: TValue[] | null;
+ onValueChange?(value: TValue[] | null): void;
+ };
+
+export type ComboboxProps<TValue> = ComboboxCommonProps<TValue> &
+ ComboboxValueProps<TValue> &
+ ComboboxFilterProps;
+
+export const Combobox = <TValue,>({
+ children,
+ displayValue,
+ placeholder = "--",
+ value: valueProp,
+ defaultValue,
+ onValueChange,
+ multiple = false,
+ shouldFilter = true,
+ filterFn,
+ open: openProp,
+ defaultOpen,
+ onOpenChange,
+ inputPlaceholder = "Search...",
+ search,
+ onSearchChange,
+ emptyState = "Nothing found.",
+}: ComboboxProps<TValue>) => {
+ const [open = false, setOpen] = useControllableState({
+ prop: openProp,
+ defaultProp: defaultOpen,
+ onChange: onOpenChange,
+ });
+ const [value, setValue] = useControllableState({
+ prop: valueProp,
+ defaultProp: defaultValue,
+ onChange: (state) => {
+ onValueChange?.(state as unknown as TValue & TValue[]);
+ },
+ });
+
+ const isSelected = (selectedValue: unknown) => {
+ if (Array.isArray(value)) {
+ return value.includes(selectedValue as TValue);
+ }
+ return value === selectedValue;
+ };
+
+ const handleSelect = (selectedValue: unknown) => {
+ let newValue: TValue | TValue[] | null = selectedValue as TValue;
+
+ if (multiple) {
+ if (Array.isArray(value)) {
+ if (value.includes(newValue)) {
+ const newArr = value.filter((val) => val !== selectedValue);
+ newValue = newArr.length > 0 ? newArr : null;
+ } else {
+ newValue = [...value, newValue];
+ }
+ } else {
+ newValue = [newValue];
+ }
+ } else if (value === selectedValue) {
+ newValue = null;
+ }
+
+ setValue(newValue);
+ setOpen(false);
+ };
+
+ const renderValue = (): string => {
+ if (value) {
+ if (Array.isArray(value)) {
+ if (value.length === 0) {
+ return placeholder;
+ }
+ if (value.length === 1 && displayValue !== undefined) {
+ return displayValue(value[0]);
+ }
+ return `${value.length} selected`;
+ }
+ if (displayValue !== undefined) {
+ return displayValue(value as unknown as TValue);
+ }
+ return placeholder;
+ }
+ return placeholder;
+ };
+
+ return (
+ <Popover open={open} onOpenChange={setOpen}>
+ <PopoverTrigger asChild={true}>
+ <div
+ className="flex h-6 w-fit mb-1 shadow-xsSolid items-center justify-between rounded-sm border border-input bg-transparent px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground hover:shadow-smSolid focus:outline-none focus:ring-1 focus:ring-ring focus:border-accent focus:shadow-mdSolid disabled:cursor-not-allowed disabled:opacity-50"
+ aria-expanded={open}
+ >
+ {renderValue()} <ChevronDownIcon className="ml-3 w-4 h-4" />
+ </div>
+ </PopoverTrigger>
+ <PopoverContent
+ className="w-full min-w-[var(--radix-popover-trigger-width)] p-0"
+ align="start"
+ >
+ <Command filter={filterFn} shouldFilter={shouldFilter}>
+ <CommandInput
+ placeholder={inputPlaceholder}
+ rootClassName="px-2 h-10"
+ autoFocus={true}
+ value={search}
+ onValueChange={onSearchChange}
+ />
+ <CommandList className="max-h-60">
+ <CommandEmpty>{emptyState}</CommandEmpty>
+ <ComboboxContext.Provider
+ value={{ isSelected, onSelect: handleSelect }}
+ >
+ {children}
+ </ComboboxContext.Provider>
+ </CommandList>
+ </Command>
+ </PopoverContent>
+ </Popover>
+ );
+};
+
+interface ComboboxItemOptions<TValue> {
+ value: TValue;
+}
+
+export interface ComboboxItemProps<TValue>
+ extends ComboboxItemOptions<TValue>,
+ Omit<
+ React.ComponentProps<typeof CommandItem>,
+ keyof ComboboxItemOptions<TValue> | "onSelect" | "role"
+ > {
+ onSelect?(value: TValue): void;
+}
+
+export const ComboboxItem = <
+ TValue = Parameters<typeof Combobox>[0]["value"],
+>({
+ children,
+ className,
+ value,
+ onSelect,
+}: ComboboxItemProps<TValue>) => {
+ const context = useContext(ComboboxContext);
+
+ return (
+ <CommandItem
+ className={cn("pl-6 m-1 py-1", className)}
+ role="option"
+ onSelect={() => {
+ context.onSelect(value);
+ onSelect?.(value);
+ }}
+ >
+ {context.isSelected(value) && (
+ <Check className="absolute left-1 h-4 w-4" />
+ )}
+ {children}
+ </CommandItem>
+ );
+};
diff --git a/frontend/src/components/ui/command.tsx b/frontend/src/components/ui/command.tsx
new file mode 100644
index 0000000000..48271b81b2
--- /dev/null
+++ b/frontend/src/components/ui/command.tsx
@@ -0,0 +1,162 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import { DialogProps } from "@radix-ui/react-dialog";
+import { Command as CommandPrimitive } from "cmdk";
+import { Search } from "lucide-react";
+
+import { cn } from "@/lib/utils";
+import { Dialog, DialogContent } from "@/components/ui/dialog";
+
+const Command = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive
+ ref={ref}
+ className={cn(
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
+ className
+ )}
+ {...props}
+ />
+));
+Command.displayName = CommandPrimitive.displayName;
+
+type CommandDialogProps = DialogProps;
+
+const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
+ return (
+ <Dialog {...props}>
+ <DialogContent
+ className="overflow-hidden p-0 shadow-2xl"
+ usePortal={true}
+ >
+ <Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
+ {children}
+ </Command>
+ </DialogContent>
+ </Dialog>
+ );
+};
+
+const CommandInput = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Input>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> & {
+ rootClassName?: string;
+ }
+>(({ className, rootClassName, ...props }, ref) => (
+ <div
+ className={cn("flex items-center border-b px-3", rootClassName)}
+ cmdk-input-wrapper=""
+ >
+ <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
+ <CommandPrimitive.Input
+ ref={ref}
+ className={cn(
+ "placeholder:text-foreground-muted flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",
+ className
+ )}
+ {...props}
+ />
+ </div>
+));
+
+CommandInput.displayName = CommandPrimitive.Input.displayName;
+
+const CommandList = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.List>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive.List
+ ref={ref}
+ className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
+ {...props}
+ />
+));
+
+CommandList.displayName = CommandPrimitive.List.displayName;
+
+const CommandEmpty = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Empty>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
+>((props, ref) => (
+ <CommandPrimitive.Empty
+ ref={ref}
+ className="py-6 text-center text-sm"
+ {...props}
+ />
+));
+
+CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
+
+const CommandGroup = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Group>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive.Group
+ ref={ref}
+ className={cn(
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
+ className
+ )}
+ {...props}
+ />
+));
+
+CommandGroup.displayName = CommandPrimitive.Group.displayName;
+
+const CommandSeparator = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Separator>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive.Separator
+ ref={ref}
+ className={cn("-mx-1 h-px bg-border", className)}
+ {...props}
+ />
+));
+CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
+
+const CommandItem = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Item>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive.Item
+ ref={ref}
+ className={cn(
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
+ className
+ )}
+ {...props}
+ />
+));
+
+CommandItem.displayName = CommandPrimitive.Item.displayName;
+
+const CommandShortcut = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLSpanElement>) => {
+ return (
+ <span
+ className={cn(
+ "ml-auto text-xs tracking-widest text-muted-foreground",
+ className
+ )}
+ {...props}
+ />
+ );
+};
+CommandShortcut.displayName = "CommandShortcut";
+
+export {
+ Command,
+ CommandDialog,
+ CommandInput,
+ CommandList,
+ CommandEmpty,
+ CommandGroup,
+ CommandItem,
+ CommandShortcut,
+ CommandSeparator,
+};
diff --git a/frontend/src/components/ui/dialog.tsx b/frontend/src/components/ui/dialog.tsx
new file mode 100644
index 0000000000..110347f809
--- /dev/null
+++ b/frontend/src/components/ui/dialog.tsx
@@ -0,0 +1,144 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import * as DialogPrimitive from "@radix-ui/react-dialog";
+import { X } from "lucide-react";
+
+import { cn } from "@/lib/utils";
+
+const Dialog = DialogPrimitive.Root;
+
+const DialogTrigger = DialogPrimitive.Trigger;
+
+const DialogPortal = ({
+ className,
+ children,
+ ...props
+}: DialogPrimitive.DialogPortalProps) => (
+ <DialogPrimitive.Portal {...props}>
+ <div
+ className={cn(
+ "fixed inset-0 z-50 flex items-start justify-center sm:items-start sm:top-[15%]",
+ className
+ )}
+ >
+ {children}
+ </div>
+ </DialogPrimitive.Portal>
+);
+DialogPortal.displayName = DialogPrimitive.Portal.displayName;
+
+const DialogOverlay = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Overlay>,
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
+>(({ className, ...props }, ref) => (
+ <DialogPrimitive.Overlay
+ ref={ref}
+ className={cn(
+ "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm transition-all duration-100 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in",
+ className
+ )}
+ {...props}
+ />
+));
+DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
+
+const DialogContent = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Content>,
+ { usePortal?: boolean } & React.ComponentPropsWithoutRef<
+ typeof DialogPrimitive.Content
+ >
+>(({ className, children, usePortal = true, ...props }, ref) => {
+ const content = (
+ <DialogPrimitive.Content
+ ref={ref}
+ className={cn(
+ "fixed z-50 grid w-full gap-4 rounded-b-lg border bg-background p-6 shadow-sm animate-in data-[state=open]:fade-in-90 data-[state=open]:slide-in-from-bottom-10 sm:max-w-lg sm:rounded-lg sm:zoom-in-90 data-[state=open]:sm:slide-in-from-bottom-0",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
+ <X className="h-4 w-4" />
+ <span className="sr-only">Close</span>
+ </DialogPrimitive.Close>
+ </DialogPrimitive.Content>
+ );
+
+ return usePortal ? (
+ <DialogPortal>
+ <DialogOverlay />
+ {content}
+ </DialogPortal>
+ ) : (
+ content
+ );
+});
+DialogContent.displayName = DialogPrimitive.Content.displayName;
+
+const DialogHeader = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) => (
+ <div
+ className={cn(
+ "flex flex-col space-y-1.5 text-center sm:text-left",
+ className
+ )}
+ {...props}
+ />
+);
+DialogHeader.displayName = "DialogHeader";
+
+const DialogFooter = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) => (
+ <div
+ className={cn(
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
+ className
+ )}
+ {...props}
+ />
+);
+DialogFooter.displayName = "DialogFooter";
+
+const DialogTitle = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Title>,
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
+>(({ className, ...props }, ref) => (
+ <DialogPrimitive.Title
+ ref={ref}
+ className={cn(
+ "text-lg font-semibold leading-none tracking-tight",
+ className
+ )}
+ {...props}
+ />
+));
+DialogTitle.displayName = DialogPrimitive.Title.displayName;
+
+const DialogDescription = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Description>,
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
+>(({ className, ...props }, ref) => (
+ <DialogPrimitive.Description
+ ref={ref}
+ className={cn("text-sm text-muted-foreground", className)}
+ {...props}
+ />
+));
+DialogDescription.displayName = DialogPrimitive.Description.displayName;
+
+export {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogOverlay,
+ DialogPortal,
+ DialogTitle,
+ DialogTrigger,
+};
diff --git a/frontend/src/components/ui/dropdown-menu.tsx b/frontend/src/components/ui/dropdown-menu.tsx
new file mode 100644
index 0000000000..2e1e34769c
--- /dev/null
+++ b/frontend/src/components/ui/dropdown-menu.tsx
@@ -0,0 +1,199 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
+import { Check, ChevronRight, Circle } from "lucide-react";
+
+import { cn } from "@/lib/utils";
+
+const DropdownMenu = DropdownMenuPrimitive.Root;
+
+const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
+
+const DropdownMenuGroup = DropdownMenuPrimitive.Group;
+
+const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
+
+const DropdownMenuSub = DropdownMenuPrimitive.Sub;
+
+const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
+
+const DropdownMenuSubTrigger = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
+ inset?: boolean;
+ }
+>(({ className, inset, children, ...props }, ref) => (
+ <DropdownMenuPrimitive.SubTrigger
+ ref={ref}
+ className={cn(
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
+ inset && "pl-8",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <ChevronRight className="ml-auto h-4 w-4" />
+ </DropdownMenuPrimitive.SubTrigger>
+));
+DropdownMenuSubTrigger.displayName =
+ DropdownMenuPrimitive.SubTrigger.displayName;
+
+const DropdownMenuSubContent = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
+>(({ className, ...props }, ref) => (
+ <DropdownMenuPrimitive.SubContent
+ ref={ref}
+ className={cn(
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",
+ className
+ )}
+ {...props}
+ />
+));
+DropdownMenuSubContent.displayName =
+ DropdownMenuPrimitive.SubContent.displayName;
+
+const DropdownMenuContent = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
+>(({ className, sideOffset = 4, ...props }, ref) => (
+ <DropdownMenuPrimitive.Portal>
+ <DropdownMenuPrimitive.Content
+ ref={ref}
+ sideOffset={sideOffset}
+ className={cn(
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
+ className
+ )}
+ {...props}
+ />
+ </DropdownMenuPrimitive.Portal>
+));
+DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
+
+const DropdownMenuItem = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.Item>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
+ inset?: boolean;
+ }
+>(({ className, inset, ...props }, ref) => (
+ <DropdownMenuPrimitive.Item
+ ref={ref}
+ className={cn(
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
+ inset && "pl-8",
+ className
+ )}
+ {...props}
+ />
+));
+DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
+
+const DropdownMenuCheckboxItem = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
+>(({ className, children, checked, ...props }, ref) => (
+ <DropdownMenuPrimitive.CheckboxItem
+ ref={ref}
+ className={cn(
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
+ className
+ )}
+ checked={checked}
+ {...props}
+ >
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
+ <DropdownMenuPrimitive.ItemIndicator>
+ <Check className="h-4 w-4" />
+ </DropdownMenuPrimitive.ItemIndicator>
+ </span>
+ {children}
+ </DropdownMenuPrimitive.CheckboxItem>
+));
+DropdownMenuCheckboxItem.displayName =
+ DropdownMenuPrimitive.CheckboxItem.displayName;
+
+const DropdownMenuRadioItem = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
+>(({ className, children, ...props }, ref) => (
+ <DropdownMenuPrimitive.RadioItem
+ ref={ref}
+ className={cn(
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
+ className
+ )}
+ {...props}
+ >
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
+ <DropdownMenuPrimitive.ItemIndicator>
+ <Circle className="h-2 w-2 fill-current" />
+ </DropdownMenuPrimitive.ItemIndicator>
+ </span>
+ {children}
+ </DropdownMenuPrimitive.RadioItem>
+));
+DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
+
+const DropdownMenuLabel = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.Label>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
+ inset?: boolean;
+ }
+>(({ className, inset, ...props }, ref) => (
+ <DropdownMenuPrimitive.Label
+ ref={ref}
+ className={cn(
+ "px-2 py-1.5 text-sm font-semibold",
+ inset && "pl-8",
+ className
+ )}
+ {...props}
+ />
+));
+DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
+
+const DropdownMenuSeparator = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
+>(({ className, ...props }, ref) => (
+ <DropdownMenuPrimitive.Separator
+ ref={ref}
+ className={cn("-mx-1 my-1 h-px bg-muted", className)}
+ {...props}
+ />
+));
+DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
+
+const DropdownMenuShortcut = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLSpanElement>) => {
+ return (
+ <span
+ className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
+ {...props}
+ />
+ );
+};
+DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
+
+export {
+ DropdownMenu,
+ DropdownMenuTrigger,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuCheckboxItem,
+ DropdownMenuRadioItem,
+ DropdownMenuLabel,
+ DropdownMenuSeparator,
+ DropdownMenuShortcut,
+ DropdownMenuGroup,
+ DropdownMenuPortal,
+ DropdownMenuSub,
+ DropdownMenuSubContent,
+ DropdownMenuSubTrigger,
+ DropdownMenuRadioGroup,
+};
diff --git a/frontend/src/components/ui/form.tsx b/frontend/src/components/ui/form.tsx
new file mode 100644
index 0000000000..e8178fdce9
--- /dev/null
+++ b/frontend/src/components/ui/form.tsx
@@ -0,0 +1,176 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import * as LabelPrimitive from "@radix-ui/react-label";
+import { Slot } from "@radix-ui/react-slot";
+import {
+ Controller,
+ ControllerProps,
+ FieldPath,
+ FieldValues,
+ FormProvider,
+ useFormContext,
+} from "react-hook-form";
+
+import { cn } from "@/lib/utils";
+import { Label } from "@/components/ui/label";
+
+const Form = FormProvider;
+
+interface FormFieldContextValue<
+ TFieldValues extends FieldValues = FieldValues,
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
+> {
+ name: TName;
+}
+
+const FormFieldContext = React.createContext<FormFieldContextValue>(
+ {} as FormFieldContextValue
+);
+
+const FormField = <
+ TFieldValues extends FieldValues = FieldValues,
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
+>({
+ ...props
+}: ControllerProps<TFieldValues, TName>) => {
+ return (
+ <FormFieldContext.Provider value={{ name: props.name }}>
+ <Controller {...props} />
+ </FormFieldContext.Provider>
+ );
+};
+
+const useFormField = () => {
+ const fieldContext = React.useContext(FormFieldContext);
+ const itemContext = React.useContext(FormItemContext);
+ const { getFieldState, formState } = useFormContext();
+
+ const fieldState = getFieldState(fieldContext.name, formState);
+
+ if (!fieldContext) {
+ throw new Error("useFormField should be used within <FormField>");
+ }
+
+ const { id } = itemContext;
+
+ return {
+ id,
+ name: fieldContext.name,
+ formItemId: `${id}-form-item`,
+ formDescriptionId: `${id}-form-item-description`,
+ formMessageId: `${id}-form-item-message`,
+ ...fieldState,
+ };
+};
+
+interface FormItemContextValue {
+ id: string;
+}
+
+const FormItemContext = React.createContext<FormItemContextValue>(
+ {} as FormItemContextValue
+);
+
+const FormItem = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes<HTMLDivElement>
+>(({ className, ...props }, ref) => {
+ const id = React.useId();
+
+ return (
+ <FormItemContext.Provider value={{ id }}>
+ <div ref={ref} className={cn("space-y-2", className)} {...props} />
+ </FormItemContext.Provider>
+ );
+});
+FormItem.displayName = "FormItem";
+
+const FormLabel = React.forwardRef<
+ React.ElementRef<typeof LabelPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
+>(({ className, ...props }, ref) => {
+ const { error, formItemId } = useFormField();
+
+ return (
+ <Label
+ ref={ref}
+ className={cn(error && "text-destructive", className)}
+ htmlFor={formItemId}
+ {...props}
+ />
+ );
+});
+FormLabel.displayName = "FormLabel";
+
+const FormControl = React.forwardRef<
+ React.ElementRef<typeof Slot>,
+ React.ComponentPropsWithoutRef<typeof Slot>
+>(({ ...props }, ref) => {
+ const { error, formItemId, formDescriptionId, formMessageId } =
+ useFormField();
+
+ return (
+ <Slot
+ ref={ref}
+ id={formItemId}
+ aria-describedby={
+ error ? `${formDescriptionId} ${formMessageId}` : `${formDescriptionId}`
+ }
+ aria-invalid={!!error}
+ {...props}
+ />
+ );
+});
+FormControl.displayName = "FormControl";
+
+const FormDescription = React.forwardRef<
+ HTMLParagraphElement,
+ React.HTMLAttributes<HTMLParagraphElement>
+>(({ className, ...props }, ref) => {
+ const { formDescriptionId } = useFormField();
+
+ return (
+ <p
+ ref={ref}
+ id={formDescriptionId}
+ className={cn("text-xs text-muted-foreground", className)}
+ {...props}
+ />
+ );
+});
+FormDescription.displayName = "FormDescription";
+
+const FormMessage = React.forwardRef<
+ HTMLParagraphElement,
+ React.HTMLAttributes<HTMLParagraphElement>
+>(({ className, children, ...props }, ref) => {
+ const { error, formMessageId } = useFormField();
+ const body = error ? String(error?.message) : children;
+
+ if (!body) {
+ return null;
+ }
+
+ return (
+ <p
+ ref={ref}
+ id={formMessageId}
+ className={cn("text-sm font-medium text-destructive", className)}
+ {...props}
+ >
+ {body}
+ </p>
+ );
+});
+FormMessage.displayName = "FormMessage";
+
+export {
+ useFormField,
+ Form,
+ FormItem,
+ FormLabel,
+ FormControl,
+ FormDescription,
+ FormMessage,
+ FormField,
+};
diff --git a/frontend/src/components/ui/input.tsx b/frontend/src/components/ui/input.tsx
new file mode 100644
index 0000000000..576d035a8b
--- /dev/null
+++ b/frontend/src/components/ui/input.tsx
@@ -0,0 +1,37 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+
+import { cn } from "@/lib/utils";
+
+export type InputProps = React.InputHTMLAttributes<HTMLInputElement> & {
+ icon?: React.ReactNode;
+};
+
+const Input = React.forwardRef<HTMLInputElement, InputProps>(
+ ({ className, type, ...props }, ref) => {
+ const icon = props.icon;
+
+ return (
+ <div className="relative">
+ {icon && (
+ <div className="absolute inset-y-0 left-0 flex items-center pl-[6px] pointer-events-none text-muted-foreground h-6">
+ {icon}
+ </div>
+ )}
+ <input
+ type={type}
+ className={cn(
+ "flex h-6 w-full mb-1 rounded-sm shadow-xsSolid border border-input bg-transparent px-1.5 py-1 text-sm font-code ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground hover:shadow-smSolid focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-accent focus-visible:shadow-mdSolid disabled:cursor-not-allowed disabled:opacity-50",
+ icon && "pl-7",
+ className
+ )}
+ ref={ref}
+ {...props}
+ />
+ </div>
+ );
+ }
+);
+Input.displayName = "Input";
+
+export { Input };
diff --git a/frontend/src/components/ui/kbd.tsx b/frontend/src/components/ui/kbd.tsx
new file mode 100644
index 0000000000..229af38b12
--- /dev/null
+++ b/frontend/src/components/ui/kbd.tsx
@@ -0,0 +1,22 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import clsx from "clsx";
+
+interface Props {
+ className?: string;
+ children: React.ReactNode;
+}
+
+export const Kbd: React.FC<Props> = (props) => {
+ return (
+ <kbd
+ className={clsx(
+ props.className,
+ // text-[0.75rem]: don't want to set line height; want to inherit
+ // whatever line height is used to make sure text is not off-center
+ "rounded-md border bg-muted px-2 text-[0.75rem] font-code"
+ )}
+ >
+ {props.children}
+ </kbd>
+ );
+};
diff --git a/frontend/src/components/ui/label.tsx b/frontend/src/components/ui/label.tsx
new file mode 100644
index 0000000000..b688d56a4a
--- /dev/null
+++ b/frontend/src/components/ui/label.tsx
@@ -0,0 +1,25 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import * as LabelPrimitive from "@radix-ui/react-label";
+import { VariantProps, cva } from "class-variance-authority";
+
+import { cn } from "@/lib/utils";
+
+const labelVariants = cva(
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
+);
+
+const Label = React.forwardRef<
+ React.ElementRef<typeof LabelPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
+ VariantProps<typeof labelVariants>
+>(({ className, ...props }, ref) => (
+ <LabelPrimitive.Root
+ ref={ref}
+ className={cn(labelVariants(), className)}
+ {...props}
+ />
+));
+Label.displayName = LabelPrimitive.Root.displayName;
+
+export { Label };
diff --git a/frontend/src/components/ui/native-select.tsx b/frontend/src/components/ui/native-select.tsx
new file mode 100644
index 0000000000..796db51778
--- /dev/null
+++ b/frontend/src/components/ui/native-select.tsx
@@ -0,0 +1,23 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+
+import { cn } from "@/lib/utils";
+
+const NativeSelect = React.forwardRef<
+ HTMLSelectElement,
+ React.InputHTMLAttributes<HTMLSelectElement>
+>(({ className, children, ...props }, ref) => (
+ <select
+ ref={ref}
+ className={cn(
+ "flex h-6 w-fit mb-1 shadow-xsSolid items-center justify-between rounded-sm border border-input bg-transparent px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground hover:shadow-smSolid focus:outline-none focus:ring-1 focus:ring-ring focus:border-accent focus:shadow-mdSolid disabled:cursor-not-allowed disabled:opacity-50",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ </select>
+));
+NativeSelect.displayName = "NativeSelect";
+
+export { NativeSelect };
diff --git a/frontend/src/components/ui/popover.tsx b/frontend/src/components/ui/popover.tsx
new file mode 100644
index 0000000000..e7410fe885
--- /dev/null
+++ b/frontend/src/components/ui/popover.tsx
@@ -0,0 +1,30 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import * as PopoverPrimitive from "@radix-ui/react-popover";
+
+import { cn } from "@/lib/utils";
+
+const Popover = PopoverPrimitive.Root;
+
+const PopoverTrigger = PopoverPrimitive.Trigger;
+
+const PopoverContent = React.forwardRef<
+ React.ElementRef<typeof PopoverPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
+>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
+ <PopoverPrimitive.Portal>
+ <PopoverPrimitive.Content
+ ref={ref}
+ align={align}
+ sideOffset={sideOffset}
+ className={cn(
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
+ className
+ )}
+ {...props}
+ />
+ </PopoverPrimitive.Portal>
+));
+PopoverContent.displayName = PopoverPrimitive.Content.displayName;
+
+export { Popover, PopoverTrigger, PopoverContent };
diff --git a/frontend/src/components/ui/radio-group.tsx b/frontend/src/components/ui/radio-group.tsx
new file mode 100644
index 0000000000..8a9b8bdf1b
--- /dev/null
+++ b/frontend/src/components/ui/radio-group.tsx
@@ -0,0 +1,43 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
+import { Circle } from "lucide-react";
+
+import { cn } from "@/lib/utils";
+
+const RadioGroup = React.forwardRef<
+ React.ElementRef<typeof RadioGroupPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
+>(({ className, ...props }, ref) => {
+ return (
+ <RadioGroupPrimitive.Root
+ className={cn("grid gap-2", className)}
+ {...props}
+ ref={ref}
+ />
+ );
+});
+RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
+
+const RadioGroupItem = React.forwardRef<
+ React.ElementRef<typeof RadioGroupPrimitive.Item>,
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
+>(({ className, children, ...props }, ref) => {
+ return (
+ <RadioGroupPrimitive.Item
+ ref={ref}
+ className={cn(
+ "h-[16px] w-[16px] transition-shadow data-[state=unchecked]:shadow-xsSolid rounded-full border border-input text-primary ring-offset-background focus:outline-none focus:shadow-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-accent data-[state=checked]:shadow-none",
+ className
+ )}
+ {...props}
+ >
+ <RadioGroupPrimitive.Indicator className="flex items-center justify-center">
+ <Circle className="h-[10px] w-[10px] fill-accent text-current" />
+ </RadioGroupPrimitive.Indicator>
+ </RadioGroupPrimitive.Item>
+ );
+});
+RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
+
+export { RadioGroup, RadioGroupItem };
diff --git a/frontend/src/components/ui/select.tsx b/frontend/src/components/ui/select.tsx
new file mode 100644
index 0000000000..530f3c34a8
--- /dev/null
+++ b/frontend/src/components/ui/select.tsx
@@ -0,0 +1,119 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import * as SelectPrimitive from "@radix-ui/react-select";
+import { Check, ChevronDown } from "lucide-react";
+
+import { cn } from "@/lib/utils";
+
+const Select = SelectPrimitive.Root;
+
+const SelectGroup = SelectPrimitive.Group;
+
+const SelectValue = SelectPrimitive.Value;
+
+const SelectTrigger = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Trigger>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
+>(({ className, children, ...props }, ref) => (
+ <SelectPrimitive.Trigger
+ ref={ref}
+ className={cn(
+ "flex h-7 mb-1 items-center justify-between rounded-md border border-input bg-transparent px-2 py-1 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <SelectPrimitive.Icon asChild={true}>
+ <ChevronDown className="h-4 w-4 opacity-50" />
+ </SelectPrimitive.Icon>
+ </SelectPrimitive.Trigger>
+));
+SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
+
+const SelectContent = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
+>(({ className, children, position = "popper", ...props }, ref) => (
+ <SelectPrimitive.Portal>
+ <SelectPrimitive.Content
+ ref={ref}
+ className={cn(
+ "relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-80",
+ position === "popper" && "translate-y-1",
+ className
+ )}
+ position={position}
+ {...props}
+ >
+ <SelectPrimitive.Viewport
+ className={cn(
+ "p-1",
+ position === "popper" &&
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
+ )}
+ >
+ {children}
+ </SelectPrimitive.Viewport>
+ </SelectPrimitive.Content>
+ </SelectPrimitive.Portal>
+));
+SelectContent.displayName = SelectPrimitive.Content.displayName;
+
+const SelectLabel = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Label>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
+>(({ className, ...props }, ref) => (
+ <SelectPrimitive.Label
+ ref={ref}
+ className={cn("py-1 pl-7 pr-2 text-sm font-semibold", className)}
+ {...props}
+ />
+));
+SelectLabel.displayName = SelectPrimitive.Label.displayName;
+
+const SelectItem = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Item>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
+>(({ className, children, ...props }, ref) => (
+ <SelectPrimitive.Item
+ ref={ref}
+ className={cn(
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-7 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
+ className
+ )}
+ {...props}
+ >
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
+ <SelectPrimitive.ItemIndicator>
+ <Check className="h-3 w-3" />
+ </SelectPrimitive.ItemIndicator>
+ </span>
+
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
+ </SelectPrimitive.Item>
+));
+SelectItem.displayName = SelectPrimitive.Item.displayName;
+
+const SelectSeparator = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Separator>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
+>(({ className, ...props }, ref) => (
+ <SelectPrimitive.Separator
+ ref={ref}
+ className={cn("-mx-1 my-1 h-px bg-muted", className)}
+ {...props}
+ />
+));
+SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
+
+export {
+ Select,
+ SelectGroup,
+ SelectValue,
+ SelectTrigger,
+ SelectContent,
+ SelectLabel,
+ SelectItem,
+ SelectSeparator,
+};
diff --git a/frontend/src/components/ui/skeleton.tsx b/frontend/src/components/ui/skeleton.tsx
new file mode 100644
index 0000000000..2efaacc054
--- /dev/null
+++ b/frontend/src/components/ui/skeleton.tsx
@@ -0,0 +1,16 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { cn } from "@/lib/utils";
+
+const Skeleton = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) => {
+ return (
+ <div
+ className={cn("animate-pulse rounded-md bg-muted", className)}
+ {...props}
+ />
+ );
+};
+
+export { Skeleton };
diff --git a/frontend/src/components/ui/slider.tsx b/frontend/src/components/ui/slider.tsx
new file mode 100644
index 0000000000..3eb565b52a
--- /dev/null
+++ b/frontend/src/components/ui/slider.tsx
@@ -0,0 +1,58 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import * as SliderPrimitive from "@radix-ui/react-slider";
+
+import { cn } from "@/lib/utils";
+import {
+ TooltipContent,
+ TooltipProvider,
+ TooltipRoot,
+ TooltipTrigger,
+} from "./tooltip";
+import { useBoolean } from "../../hooks/useBoolean";
+import { TooltipPortal } from "@radix-ui/react-tooltip";
+
+const Slider = React.forwardRef<
+ React.ElementRef<typeof SliderPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>
+>(({ className, ...props }, ref) => {
+ const [open, openActions] = useBoolean(false);
+
+ return (
+ <SliderPrimitive.Root
+ ref={ref}
+ className={cn(
+ "relative flex w-full touch-none select-none items-center hover:cursor-pointer",
+ className
+ )}
+ {...props}
+ >
+ <SliderPrimitive.Track className="relative h-2 w-full grow overflow-hidden rounded-full bg-slate-200">
+ <SliderPrimitive.Range className="absolute h-full bg-blue-500 dark:bg-blue-800" />
+ </SliderPrimitive.Track>
+ <TooltipProvider>
+ <TooltipRoot delayDuration={0} open={open}>
+ <TooltipTrigger asChild={true}>
+ <SliderPrimitive.Thumb
+ className="block h-4 w-4 rounded-full shadow-xsSolid border border-blue-500 dark:bg-blue-800 bg-white hover:bg-blue-300 focus:bg-blue-300 transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50"
+ onFocus={openActions.setTrue}
+ onBlur={openActions.setFalse}
+ onMouseEnter={openActions.setTrue}
+ onMouseLeave={openActions.setFalse}
+ />
+ </TooltipTrigger>
+ <TooltipPortal>
+ {props.value != null && props.value.length === 1 && (
+ <TooltipContent key={props.value[0]}>
+ {props.value[0]}
+ </TooltipContent>
+ )}
+ </TooltipPortal>
+ </TooltipRoot>
+ </TooltipProvider>
+ </SliderPrimitive.Root>
+ );
+});
+Slider.displayName = SliderPrimitive.Root.displayName;
+
+export { Slider };
diff --git a/frontend/src/components/ui/switch.tsx b/frontend/src/components/ui/switch.tsx
new file mode 100644
index 0000000000..9bd12451ca
--- /dev/null
+++ b/frontend/src/components/ui/switch.tsx
@@ -0,0 +1,28 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import * as SwitchPrimitives from "@radix-ui/react-switch";
+
+import { cn } from "@/lib/utils";
+
+const Switch = React.forwardRef<
+ React.ElementRef<typeof SwitchPrimitives.Root>,
+ React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
+>(({ className, ...props }, ref) => (
+ <SwitchPrimitives.Root
+ className={cn(
+ "peer inline-flex h-[1.5rem] w-[2.75rem] mb-1 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-accent data-[state=unchecked]:bg-input",
+ className
+ )}
+ {...props}
+ ref={ref}
+ >
+ <SwitchPrimitives.Thumb
+ className={cn(
+ "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-xs ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
+ )}
+ />
+ </SwitchPrimitives.Root>
+));
+Switch.displayName = SwitchPrimitives.Root.displayName;
+
+export { Switch };
diff --git a/frontend/src/components/ui/table.tsx b/frontend/src/components/ui/table.tsx
new file mode 100644
index 0000000000..dc3f96bfcb
--- /dev/null
+++ b/frontend/src/components/ui/table.tsx
@@ -0,0 +1,115 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+
+import { cn } from "@/lib/utils";
+
+const Table = React.forwardRef<
+ HTMLTableElement,
+ React.HTMLAttributes<HTMLTableElement>
+>(({ className, ...props }, ref) => (
+ <div className="w-full overflow-auto">
+ <table
+ ref={ref}
+ className={cn("w-full caption-bottom text-sm", className)}
+ {...props}
+ />
+ </div>
+));
+Table.displayName = "Table";
+
+const TableHeader = React.forwardRef<
+ HTMLTableSectionElement,
+ React.HTMLAttributes<HTMLTableSectionElement>
+>(({ className, ...props }, ref) => (
+ <thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
+));
+TableHeader.displayName = "TableHeader";
+
+const TableBody = React.forwardRef<
+ HTMLTableSectionElement,
+ React.HTMLAttributes<HTMLTableSectionElement>
+>(({ className, ...props }, ref) => (
+ <tbody
+ ref={ref}
+ className={cn("[&_tr:last-child]:border-0", className)}
+ {...props}
+ />
+));
+TableBody.displayName = "TableBody";
+
+const TableFooter = React.forwardRef<
+ HTMLTableSectionElement,
+ React.HTMLAttributes<HTMLTableSectionElement>
+>(({ className, ...props }, ref) => (
+ <tfoot
+ ref={ref}
+ className={cn("bg-primary font-medium text-primary-foreground", className)}
+ {...props}
+ />
+));
+TableFooter.displayName = "TableFooter";
+
+const TableRow = React.forwardRef<
+ HTMLTableRowElement,
+ React.HTMLAttributes<HTMLTableRowElement>
+>(({ className, ...props }, ref) => (
+ <tr
+ ref={ref}
+ className={cn(
+ "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
+ className
+ )}
+ {...props}
+ />
+));
+TableRow.displayName = "TableRow";
+
+const TableHead = React.forwardRef<
+ HTMLTableCellElement,
+ React.ThHTMLAttributes<HTMLTableCellElement>
+>(({ className, ...props }, ref) => (
+ <th
+ ref={ref}
+ className={cn(
+ "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
+ className
+ )}
+ {...props}
+ />
+));
+TableHead.displayName = "TableHead";
+
+const TableCell = React.forwardRef<
+ HTMLTableCellElement,
+ React.TdHTMLAttributes<HTMLTableCellElement>
+>(({ className, ...props }, ref) => (
+ <td
+ ref={ref}
+ className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
+ {...props}
+ />
+));
+TableCell.displayName = "TableCell";
+
+const TableCaption = React.forwardRef<
+ HTMLTableCaptionElement,
+ React.HTMLAttributes<HTMLTableCaptionElement>
+>(({ className, ...props }, ref) => (
+ <caption
+ ref={ref}
+ className={cn("mt-4 text-sm text-muted-foreground", className)}
+ {...props}
+ />
+));
+TableCaption.displayName = "TableCaption";
+
+export {
+ Table,
+ TableHeader,
+ TableBody,
+ TableFooter,
+ TableHead,
+ TableRow,
+ TableCell,
+ TableCaption,
+};
diff --git a/frontend/src/components/ui/tabs.tsx b/frontend/src/components/ui/tabs.tsx
new file mode 100644
index 0000000000..6fd5dd8995
--- /dev/null
+++ b/frontend/src/components/ui/tabs.tsx
@@ -0,0 +1,54 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import * as TabsPrimitive from "@radix-ui/react-tabs";
+
+import { cn } from "@/lib/utils";
+
+const Tabs = TabsPrimitive.Root;
+
+const TabsList = React.forwardRef<
+ React.ElementRef<typeof TabsPrimitive.List>,
+ React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
+>(({ className, ...props }, ref) => (
+ <TabsPrimitive.List
+ ref={ref}
+ className={cn(
+ "inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
+ className
+ )}
+ {...props}
+ />
+));
+TabsList.displayName = TabsPrimitive.List.displayName;
+
+const TabsTrigger = React.forwardRef<
+ React.ElementRef<typeof TabsPrimitive.Trigger>,
+ React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
+>(({ className, ...props }, ref) => (
+ <TabsPrimitive.Trigger
+ ref={ref}
+ className={cn(
+ "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
+ className
+ )}
+ {...props}
+ />
+));
+TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
+
+const TabsContent = React.forwardRef<
+ React.ElementRef<typeof TabsPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
+>(({ className, ...props }, ref) => (
+ <TabsPrimitive.Content
+ ref={ref}
+ className={cn(
+ "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
+ className
+ )}
+ {...props}
+ />
+));
+TabsContent.displayName = TabsPrimitive.Content.displayName;
+
+export { Tabs, TabsList, TabsTrigger, TabsContent };
diff --git a/frontend/src/components/ui/textarea.tsx b/frontend/src/components/ui/textarea.tsx
new file mode 100644
index 0000000000..19a49165be
--- /dev/null
+++ b/frontend/src/components/ui/textarea.tsx
@@ -0,0 +1,24 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+
+import { cn } from "@/lib/utils";
+
+export type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;
+
+const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
+ ({ className, ...props }, ref) => {
+ return (
+ <textarea
+ className={cn(
+ "flex h-20 w-full mb-1 rounded-sm shadow-xsSolid border border-input bg-transparent px-3 py-2 text-sm font-code ring-offset-background placeholder:text-muted-foreground hover:shadow-smSolid focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-accent focus-visible:shadow-mdSolid disabled:cursor-not-allowed disabled:opacity-50",
+ className
+ )}
+ ref={ref}
+ {...props}
+ />
+ );
+ }
+);
+Textarea.displayName = "Textarea";
+
+export { Textarea };
diff --git a/frontend/src/components/ui/toast.tsx b/frontend/src/components/ui/toast.tsx
new file mode 100644
index 0000000000..f83f3691dc
--- /dev/null
+++ b/frontend/src/components/ui/toast.tsx
@@ -0,0 +1,128 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import * as ToastPrimitives from "@radix-ui/react-toast";
+import { VariantProps, cva } from "class-variance-authority";
+import { X } from "lucide-react";
+
+import { cn } from "@/lib/utils";
+
+const ToastProvider = ToastPrimitives.Provider;
+
+const ToastViewport = React.forwardRef<
+ React.ElementRef<typeof ToastPrimitives.Viewport>,
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>
+>(({ className, ...props }, ref) => (
+ <ToastPrimitives.Viewport
+ ref={ref}
+ className={cn(
+ "fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
+ className
+ )}
+ {...props}
+ />
+));
+ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
+
+const toastVariants = cva(
+ "data-[swipe=move]:transition-none group relative pointer-events-auto flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full data-[state=closed]:slide-out-to-right-full",
+ {
+ variants: {
+ variant: {
+ default: "bg-background border",
+ destructive:
+ "group destructive border-destructive bg-destructive text-destructive-foreground",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ }
+);
+
+const Toast = React.forwardRef<
+ React.ElementRef<typeof ToastPrimitives.Root>,
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &
+ VariantProps<typeof toastVariants>
+>(({ className, variant, ...props }, ref) => {
+ return (
+ <ToastPrimitives.Root
+ ref={ref}
+ className={cn(toastVariants({ variant }), className)}
+ {...props}
+ />
+ );
+});
+Toast.displayName = ToastPrimitives.Root.displayName;
+
+const ToastAction = React.forwardRef<
+ React.ElementRef<typeof ToastPrimitives.Action>,
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>
+>(({ className, ...props }, ref) => (
+ <ToastPrimitives.Action
+ ref={ref}
+ className={cn(
+ "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-destructive/30 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
+ className
+ )}
+ {...props}
+ />
+));
+ToastAction.displayName = ToastPrimitives.Action.displayName;
+
+const ToastClose = React.forwardRef<
+ React.ElementRef<typeof ToastPrimitives.Close>,
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>
+>(({ className, ...props }, ref) => (
+ <ToastPrimitives.Close
+ ref={ref}
+ className={cn(
+ "absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
+ className
+ )}
+ toast-close=""
+ {...props}
+ >
+ <X className="h-4 w-4" />
+ </ToastPrimitives.Close>
+));
+ToastClose.displayName = ToastPrimitives.Close.displayName;
+
+const ToastTitle = React.forwardRef<
+ React.ElementRef<typeof ToastPrimitives.Title>,
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>
+>(({ className, ...props }, ref) => (
+ <ToastPrimitives.Title
+ ref={ref}
+ className={cn("text-sm font-semibold", className)}
+ {...props}
+ />
+));
+ToastTitle.displayName = ToastPrimitives.Title.displayName;
+
+const ToastDescription = React.forwardRef<
+ React.ElementRef<typeof ToastPrimitives.Description>,
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>
+>(({ className, ...props }, ref) => (
+ <ToastPrimitives.Description
+ ref={ref}
+ className={cn("text-sm opacity-90", className)}
+ {...props}
+ />
+));
+ToastDescription.displayName = ToastPrimitives.Description.displayName;
+
+type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
+
+type ToastActionElement = React.ReactElement<typeof ToastAction>;
+
+export {
+ type ToastProps,
+ type ToastActionElement,
+ ToastProvider,
+ ToastViewport,
+ Toast,
+ ToastTitle,
+ ToastDescription,
+ ToastClose,
+ ToastAction,
+};
diff --git a/frontend/src/components/ui/toaster.tsx b/frontend/src/components/ui/toaster.tsx
new file mode 100644
index 0000000000..c06183db2c
--- /dev/null
+++ b/frontend/src/components/ui/toaster.tsx
@@ -0,0 +1,34 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useToast } from "@/components/ui/use-toast";
+import {
+ Toast,
+ ToastClose,
+ ToastDescription,
+ ToastProvider,
+ ToastTitle,
+ ToastViewport,
+} from "./toast";
+
+export const Toaster = () => {
+ const { toasts } = useToast();
+
+ return (
+ <ToastProvider>
+ {toasts.map(function ({ id, title, description, action, ...props }) {
+ return (
+ <Toast key={id} {...props}>
+ <div className="grid gap-1">
+ {title && <ToastTitle>{title}</ToastTitle>}
+ {description && (
+ <ToastDescription>{description}</ToastDescription>
+ )}
+ </div>
+ {action}
+ <ToastClose />
+ </Toast>
+ );
+ })}
+ <ToastViewport />
+ </ToastProvider>
+ );
+};
diff --git a/frontend/src/components/ui/tooltip.tsx b/frontend/src/components/ui/tooltip.tsx
new file mode 100644
index 0000000000..4e4fee0990
--- /dev/null
+++ b/frontend/src/components/ui/tooltip.tsx
@@ -0,0 +1,54 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+import * as TooltipPrimitive from "@radix-ui/react-tooltip";
+
+import { cn } from "@/lib/utils";
+
+const TooltipProvider = TooltipPrimitive.Provider;
+
+const TooltipRoot = TooltipPrimitive.Root;
+
+const TooltipTrigger = TooltipPrimitive.Trigger;
+
+const TooltipContent = React.forwardRef<
+ React.ElementRef<typeof TooltipPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
+>(({ className, sideOffset = 4, ...props }, ref) => (
+ <TooltipPrimitive.Content
+ ref={ref}
+ sideOffset={sideOffset}
+ className={cn(
+ "z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-xs data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",
+ className
+ )}
+ {...props}
+ />
+));
+TooltipContent.displayName = TooltipPrimitive.Content.displayName;
+
+const Tooltip: React.FC<
+ {
+ content: React.ReactNode;
+ usePortal?: boolean;
+ children: React.ReactNode;
+ } & React.ComponentPropsWithoutRef<typeof TooltipRoot>
+> = ({ content, children, usePortal = true, ...rootProps }) => (
+ <TooltipRoot {...rootProps}>
+ <TooltipTrigger asChild={true}>{children}</TooltipTrigger>
+ {usePortal ? (
+ <TooltipPrimitive.TooltipPortal>
+ <TooltipContent>{content}</TooltipContent>
+ </TooltipPrimitive.TooltipPortal>
+ ) : (
+ <TooltipContent>{content}</TooltipContent>
+ )}
+ </TooltipRoot>
+);
+
+export {
+ Tooltip,
+ TooltipRoot,
+ TooltipTrigger,
+ TooltipContent,
+ TooltipProvider,
+};
diff --git a/frontend/src/components/ui/typography.tsx b/frontend/src/components/ui/typography.tsx
new file mode 100644
index 0000000000..6a81097ee6
--- /dev/null
+++ b/frontend/src/components/ui/typography.tsx
@@ -0,0 +1,211 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+/* eslint-disable jsx-a11y/heading-has-content */
+import * as React from "react";
+import { cn } from "@/lib/utils";
+
+const H1 = React.forwardRef<
+ HTMLHeadingElement,
+ React.ComponentPropsWithoutRef<"h1">
+>(({ className, ...props }, ref) => {
+ return (
+ <h1
+ className={cn(
+ "scroll-m-20 text-4xl font-extrabold tracking-tight text-foreground lg:text-5xl",
+ className
+ )}
+ ref={ref}
+ {...props}
+ />
+ );
+});
+H1.displayName = "H1";
+
+const H2 = React.forwardRef<
+ HTMLHeadingElement,
+ React.ComponentPropsWithoutRef<"h2">
+>(({ className, ...props }, ref) => {
+ return (
+ <h2
+ className={cn(
+ "scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight text-foreground first:mt-0",
+ className
+ )}
+ ref={ref}
+ {...props}
+ />
+ );
+});
+H2.displayName = "H2";
+
+const H3 = React.forwardRef<
+ HTMLHeadingElement,
+ React.ComponentPropsWithoutRef<"h3">
+>(({ className, ...props }, ref) => {
+ return (
+ <h3
+ className={cn(
+ "scroll-m-20 text-2xl font-semibold tracking-tight text-foreground",
+ className
+ )}
+ ref={ref}
+ {...props}
+ />
+ );
+});
+H3.displayName = "H3";
+
+const H4 = React.forwardRef<
+ HTMLHeadingElement,
+ React.ComponentPropsWithoutRef<"h4">
+>(({ className, ...props }, ref) => {
+ return (
+ <h4
+ className={cn(
+ "scroll-m-20 text-xl font-semibold tracking-tight text-foreground",
+ className
+ )}
+ ref={ref}
+ {...props}
+ />
+ );
+});
+H4.displayName = "H4";
+
+const P = React.forwardRef<
+ HTMLParagraphElement,
+ React.ComponentPropsWithoutRef<"p">
+>(({ className, ...props }, ref) => {
+ return (
+ <p
+ className={cn(
+ "leading-7 text-foreground [&:not(:first-child)]:mt-6",
+ className
+ )}
+ ref={ref}
+ {...props}
+ />
+ );
+});
+P.displayName = "P";
+
+const Blockquote = React.forwardRef<
+ HTMLQuoteElement,
+ React.ComponentPropsWithoutRef<"blockquote">
+>(({ className, ...props }, ref) => {
+ return (
+ <blockquote
+ className={cn("mt-6 border-l-2 pl-6 italic text-foreground", className)}
+ ref={ref}
+ {...props}
+ />
+ );
+});
+Blockquote.displayName = "Blockquote";
+
+const List = React.forwardRef<
+ HTMLUListElement,
+ React.ComponentPropsWithoutRef<"ul">
+>(({ className, ...props }, ref) => {
+ return (
+ <ul
+ className={cn(
+ "my-6 ml-6 list-disc text-foreground [&>li]:mt-2",
+ className
+ )}
+ ref={ref}
+ {...props}
+ />
+ );
+});
+List.displayName = "List";
+
+const InlineCode = React.forwardRef<
+ HTMLElement,
+ React.ComponentPropsWithoutRef<"code">
+>(({ className, ...props }, ref) => {
+ return (
+ <code
+ className={cn(
+ "relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold text-foreground",
+ className
+ )}
+ ref={ref}
+ {...props}
+ />
+ );
+});
+InlineCode.displayName = "InlineCode";
+
+const Lead = React.forwardRef<
+ HTMLParagraphElement,
+ React.ComponentPropsWithoutRef<"p">
+>(({ className, ...props }, ref) => {
+ return (
+ <p
+ className={cn("text-xl text-muted-foreground", className)}
+ ref={ref}
+ {...props}
+ />
+ );
+});
+Lead.displayName = "Lead";
+
+const LargeText = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentPropsWithoutRef<"div">
+>(({ className, ...props }, ref) => {
+ return (
+ <div
+ className={cn("text-lg font-semibold text-foreground", className)}
+ ref={ref}
+ {...props}
+ />
+ );
+});
+LargeText.displayName = "LargeText";
+
+const SmallText = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentPropsWithoutRef<"div">
+>(({ className, ...props }, ref) => {
+ return (
+ <div
+ className={cn(
+ "text-sm font-medium leading-none text-foreground",
+ className
+ )}
+ ref={ref}
+ {...props}
+ />
+ );
+});
+SmallText.displayName = "SmallText";
+
+const MutatedText = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentPropsWithoutRef<"div">
+>(({ className, ...props }, ref) => {
+ return (
+ <div
+ className={cn("text-sm text-muted-foreground", className)}
+ ref={ref}
+ {...props}
+ />
+ );
+});
+MutatedText.displayName = "MutatedText";
+
+export {
+ H1,
+ H2,
+ H3,
+ H4,
+ P,
+ Blockquote,
+ List,
+ InlineCode,
+ Lead,
+ LargeText,
+ SmallText,
+ MutatedText,
+};
diff --git a/frontend/src/components/ui/use-toast.ts b/frontend/src/components/ui/use-toast.ts
new file mode 100644
index 0000000000..510b1fa9b0
--- /dev/null
+++ b/frontend/src/components/ui/use-toast.ts
@@ -0,0 +1,187 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import * as React from "react";
+
+import { ToastActionElement, type ToastProps } from "@/components/ui/toast";
+
+const TOAST_LIMIT = 1;
+const TOAST_REMOVE_DELAY = 1_000_000;
+
+type ToasterToast = ToastProps & {
+ id: string;
+ title?: React.ReactNode;
+ description?: React.ReactNode;
+ action?: ToastActionElement;
+};
+
+const actionTypes = {
+ ADD_TOAST: "ADD_TOAST",
+ UPDATE_TOAST: "UPDATE_TOAST",
+ DISMISS_TOAST: "DISMISS_TOAST",
+ REMOVE_TOAST: "REMOVE_TOAST",
+} as const;
+
+let count = 0;
+
+function genId() {
+ count = (count + 1) % Number.MAX_VALUE;
+ return count.toString();
+}
+
+type ActionType = typeof actionTypes;
+
+type Action =
+ | {
+ type: ActionType["ADD_TOAST"];
+ toast: ToasterToast;
+ }
+ | {
+ type: ActionType["UPDATE_TOAST"];
+ toast: Partial<ToasterToast>;
+ }
+ | {
+ type: ActionType["DISMISS_TOAST"];
+ toastId?: ToasterToast["id"];
+ }
+ | {
+ type: ActionType["REMOVE_TOAST"];
+ toastId?: ToasterToast["id"];
+ };
+
+interface State {
+ toasts: ToasterToast[];
+}
+
+const toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();
+
+const addToRemoveQueue = (toastId: string) => {
+ if (toastTimeouts.has(toastId)) {
+ return;
+ }
+
+ const timeout = setTimeout(() => {
+ toastTimeouts.delete(toastId);
+ dispatch({
+ type: "REMOVE_TOAST",
+ toastId: toastId,
+ });
+ }, TOAST_REMOVE_DELAY);
+
+ toastTimeouts.set(toastId, timeout);
+};
+
+export const reducer = (state: State, action: Action): State => {
+ switch (action.type) {
+ case "ADD_TOAST":
+ return {
+ ...state,
+ toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
+ };
+
+ case "UPDATE_TOAST":
+ return {
+ ...state,
+ toasts: state.toasts.map((t) =>
+ t.id === action.toast.id ? { ...t, ...action.toast } : t
+ ),
+ };
+
+ case "DISMISS_TOAST": {
+ const { toastId } = action;
+
+ // ! Side effects ! - This could be extracted into a dismissToast() action,
+ // but I'll keep it here for simplicity
+ if (toastId) {
+ addToRemoveQueue(toastId);
+ } else {
+ state.toasts.forEach((toast) => {
+ addToRemoveQueue(toast.id);
+ });
+ }
+
+ return {
+ ...state,
+ toasts: state.toasts.map((t) =>
+ t.id === toastId || toastId === undefined
+ ? {
+ ...t,
+ open: false,
+ }
+ : t
+ ),
+ };
+ }
+ case "REMOVE_TOAST":
+ if (action.toastId === undefined) {
+ return {
+ ...state,
+ toasts: [],
+ };
+ }
+ return {
+ ...state,
+ toasts: state.toasts.filter((t) => t.id !== action.toastId),
+ };
+ }
+};
+
+const listeners = new Set<(state: State) => void>();
+
+let memoryState: State = { toasts: [] };
+
+function dispatch(action: Action) {
+ memoryState = reducer(memoryState, action);
+ listeners.forEach((listener) => {
+ listener(memoryState);
+ });
+}
+
+type Toast = Omit<ToasterToast, "id">;
+
+function toast({ ...props }: Toast) {
+ const id = genId();
+
+ const update = (props: ToasterToast) =>
+ dispatch({
+ type: "UPDATE_TOAST",
+ toast: { ...props, id },
+ });
+ const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
+
+ dispatch({
+ type: "ADD_TOAST",
+ toast: {
+ ...props,
+ id,
+ open: true,
+ onOpenChange: (open) => {
+ if (!open) {
+ dismiss();
+ }
+ },
+ },
+ });
+
+ return {
+ id: id,
+ dismiss,
+ update,
+ };
+}
+
+function useToast() {
+ const [state, setState] = React.useState<State>(memoryState);
+
+ React.useEffect(() => {
+ listeners.add(setState);
+ return () => {
+ listeners.delete(setState);
+ };
+ }, [state]);
+
+ return {
+ ...state,
+ dismiss: (toastId?: string) => dispatch({ type: "DISMISS_TOAST", toastId }),
+ };
+}
+
+export { useToast, toast };
diff --git a/frontend/src/core/RuntimeState.ts b/frontend/src/core/RuntimeState.ts
new file mode 100644
index 0000000000..7f83e8d238
--- /dev/null
+++ b/frontend/src/core/RuntimeState.ts
@@ -0,0 +1,83 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { sendComponentValues } from "@/core/network/requests";
+import { marimoValueReadyEvent, MarimoValueReadyEventType } from "./dom/events";
+import { UI_ELEMENT_REGISTRY, UIElementRegistry } from "./dom/uiregistry";
+
+/**
+ * Manager to track running cells.
+ */
+export class RuntimeState {
+ /**
+ * Shared instance of RuntimeState since this must be a singleton.
+ */
+ static readonly INSTANCE = new RuntimeState(UI_ELEMENT_REGISTRY);
+
+ // TODO(akshayka): move the running-count state machine to the Python kernel;
+ // keeping track of it in the frontend is very brittle. the kernel can simply
+ // choose to drop queued update requests when newer ones arrive
+ /**
+ * number of cells that are currently running, to implement debouncing
+ * and batching of update requests
+ */
+ private runningCount: number;
+ /**
+ * ObjectIds of UIElements whose values need to be updated in the kernel
+ */
+ private componentsToUpdate: Set<string>;
+
+ private constructor(private uiElementRegistry: UIElementRegistry) {
+ this.runningCount = 0;
+ this.componentsToUpdate = new Set();
+ }
+
+ /**
+ * Start listening for events from UIElements
+ */
+ start() {
+ document.addEventListener(marimoValueReadyEvent, this.handleReadyEvent);
+ }
+
+ /**
+ * Stop listening for events from UIElements
+ */
+ stop() {
+ document.removeEventListener(marimoValueReadyEvent, this.handleReadyEvent);
+ }
+
+ registerRunStart(): void {
+ this.runningCount += 1;
+ }
+
+ registerRunEnd(): void {
+ this.runningCount -= 1;
+ }
+
+ running(): boolean {
+ return this.runningCount > 0;
+ }
+
+ flushUpdates() {
+ if (this.componentsToUpdate.size > 0) {
+ this.registerRunStart();
+ sendComponentValues(
+ Array.from(this.componentsToUpdate.values(), (objectId) => ({
+ objectId: objectId,
+ value: this.uiElementRegistry.lookupValue(objectId),
+ }))
+ );
+ this.componentsToUpdate.clear();
+ }
+ }
+
+ private handleReadyEvent = (e: MarimoValueReadyEventType) => {
+ const objectId = e.detail.objectId;
+ if (!this.uiElementRegistry.has(objectId)) {
+ return;
+ }
+
+ this.componentsToUpdate.add(objectId);
+ if (!this.running()) {
+ this.flushUpdates();
+ }
+ };
+}
diff --git a/frontend/src/core/codemirror/cm.ts b/frontend/src/core/codemirror/cm.ts
new file mode 100644
index 0000000000..e8fb8a76a7
--- /dev/null
+++ b/frontend/src/core/codemirror/cm.ts
@@ -0,0 +1,157 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import {
+ acceptCompletion,
+ autocompletion,
+ closeBrackets,
+ closeBracketsKeymap,
+} from "@codemirror/autocomplete";
+import {
+ history,
+ defaultKeymap,
+ historyKeymap,
+ indentWithTab,
+ indentMore,
+} from "@codemirror/commands";
+import {
+ pythonLanguage,
+ localCompletionSource,
+ globalCompletion,
+} from "@codemirror/lang-python";
+import {
+ bracketMatching,
+ defaultHighlightStyle,
+ foldGutter,
+ foldInside,
+ foldKeymap,
+ foldNodeProp,
+ LanguageSupport,
+ indentOnInput,
+ indentUnit,
+ syntaxHighlighting,
+} from "@codemirror/language";
+import { lintKeymap } from "@codemirror/lint";
+import {
+ drawSelection,
+ dropCursor,
+ highlightActiveLine,
+ highlightActiveLineGutter,
+ highlightSpecialChars,
+ lineNumbers,
+ keymap,
+ rectangularSelection,
+ tooltips,
+ EditorView,
+} from "@codemirror/view";
+import {
+ closeSearchPanel,
+ openSearchPanel,
+ highlightSelectionMatches,
+} from "@codemirror/search";
+import { EditorState, Extension } from "@codemirror/state";
+import { oneDark } from "@codemirror/theme-one-dark";
+
+import { CompletionConfig } from "../config";
+import { Theme } from "../../theme/useTheme";
+import { HOTKEYS } from "@/core/hotkeys/hotkeys";
+import { completer } from "@/core/codemirror/completion/completer";
+
+// Customize python to support folding some additional syntax nodes
+const customizedPython = pythonLanguage.configure({
+ props: [
+ foldNodeProp.add({
+ ParenthesizedExpression: foldInside,
+ // Fold function calls whose arguments are split over multiple lines
+ ArgList: foldInside,
+ }),
+ ],
+});
+
+// Based on codemirror's basicSetup extension
+export const setup = (
+ completionConfig: CompletionConfig,
+ theme: Theme
+): Extension[] => {
+ return [
+ // Whether or not to require keypress to activate autocompletion (default
+ // keymap is Ctrl+Space)
+ autocompletion({
+ activateOnTyping: completionConfig.activate_on_typing,
+ // The Cell component handles the blur event. `closeOnBlur` is too
+ // aggressive and doesn't let the user click into the completion info
+ // element (which contains the docstring/type --- users might want to
+ // copy paste from the docstring). The main issue is that the completion
+ // tooltip is not part of the editable DOM tree:
+ // https://discuss.codemirror.net/t/adding-click-event-listener-to-autocomplete-tooltip-info-panel-is-not-working/4741
+ closeOnBlur: false,
+ override: [completer],
+ }),
+ tooltips({ position: "absolute" }),
+ EditorView.lineWrapping,
+ lineNumbers(),
+ highlightActiveLineGutter(),
+ highlightSpecialChars(),
+ history(),
+ foldGutter(),
+ drawSelection(),
+ dropCursor(),
+ theme === "dark" ? oneDark : [],
+ EditorState.allowMultipleSelections.of(true),
+ indentOnInput(),
+ indentUnit.of(" "),
+ syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
+ bracketMatching(),
+ closeBrackets(),
+ rectangularSelection(),
+ highlightActiveLine(),
+ highlightSelectionMatches(),
+ keymap.of([
+ {
+ key: "Tab",
+ run: (cm) => {
+ return acceptCompletion(cm) || indentMore(cm);
+ },
+ preventDefault: true,
+ },
+ ]),
+ keymap.of([
+ ...closeBracketsKeymap,
+ ...defaultKeymap,
+ ...historyKeymap,
+ ...foldKeymap,
+ ...lintKeymap,
+ indentWithTab,
+ ]),
+ keymap.of([
+ {
+ key: "Escape",
+ preventDefault: true,
+ run: (cm) => {
+ cm.contentDOM.blur();
+ return true;
+ },
+ },
+ ]),
+ keymap.of([
+ {
+ key: HOTKEYS.getHotkey("cell.findAndReplace").key,
+ preventDefault: true,
+ run: openSearchPanel,
+ },
+ ]),
+ keymap.of([
+ {
+ key: "Escape",
+ preventDefault: true,
+ run: closeSearchPanel,
+ scope: "editor search-panel",
+ },
+ ]),
+ new LanguageSupport(customizedPython, [
+ customizedPython.data.of({ autocomplete: localCompletionSource }),
+ customizedPython.data.of({ autocomplete: globalCompletion }),
+ ]),
+ ];
+};
+
+// Use the default keymap for completion
+export { completionKeymap as autocompletionKeymap } from "@codemirror/autocomplete";
diff --git a/frontend/src/core/codemirror/completion/CompletionRequests.ts b/frontend/src/core/codemirror/completion/CompletionRequests.ts
new file mode 100644
index 0000000000..95dbc8595f
--- /dev/null
+++ b/frontend/src/core/codemirror/completion/CompletionRequests.ts
@@ -0,0 +1,69 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { CompletionResult } from "@codemirror/autocomplete";
+
+import { Deferred } from "../../../utils/Deferred";
+import {
+ CompletionOption,
+ CompletionResultMessage,
+} from "../../kernel/messages";
+
+interface Entry {
+ deferred: Deferred<CompletionResult>;
+ pos: number;
+}
+
+function constructCompletionInfoNode(innerHtml?: string): Node | null {
+ if (!innerHtml) {
+ return null;
+ }
+ const container = document.createElement("span");
+ container.style.display = "flex";
+ container.style.flexDirection = "column";
+ container.style.gap = "1rem";
+ container.innerHTML = innerHtml;
+ return container;
+}
+
+class CompletionRequests {
+ // TODO: maybe we store at most one request, evicting old ones
+ private requests = new Map<string, Entry>();
+
+ has(completionId: string): boolean {
+ return this.requests.has(completionId);
+ }
+
+ register(
+ completionId: string,
+ deferred: Deferred<CompletionResult>,
+ pos: number
+ ) {
+ this.requests.set(completionId, { deferred: deferred, pos: pos });
+ // On failures, remove the request and rethrow the error
+ deferred.promise.catch((error) => {
+ this.requests.delete(completionId);
+ throw error;
+ });
+ }
+
+ resolve(msg: CompletionResultMessage) {
+ const entry = this.requests.get(msg.completion_id);
+ if (entry === undefined) {
+ return;
+ }
+
+ entry.deferred.resolve({
+ from: entry.pos - msg.prefix_length,
+ options: msg.options.map((o: CompletionOption) => {
+ return {
+ label: o.name,
+ type: o.type,
+ info: () => constructCompletionInfoNode(o.completion_info),
+ };
+ }),
+ validFor: /^\w*$/,
+ });
+ this.requests.delete(msg.completion_id);
+ }
+}
+
+export const COMPLETION_REQUESTS = new CompletionRequests();
diff --git a/frontend/src/core/codemirror/completion/completer.ts b/frontend/src/core/codemirror/completion/completer.ts
new file mode 100644
index 0000000000..c0aaf2d4cb
--- /dev/null
+++ b/frontend/src/core/codemirror/completion/completer.ts
@@ -0,0 +1,32 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { CompletionContext, CompletionResult } from "@codemirror/autocomplete";
+
+import { Deferred } from "../../../utils/Deferred";
+import { COMPLETION_REQUESTS } from "./CompletionRequests";
+import { sendCodeCompletionRequest } from "../../network/requests";
+import { generateUUID } from "../../../utils/uuid";
+import { Logger } from "../../../utils/Logger";
+import { HTMLCellId } from "@/core/model/ids";
+
+export function completer(context: CompletionContext) {
+ const query = context.state.doc.sliceString(0, context.pos);
+ const element = document.activeElement;
+ let cellId = null;
+ if (element !== null) {
+ const cellContainer = HTMLCellId.findElement(element);
+ if (cellContainer !== null) {
+ cellId = HTMLCellId.parse(cellContainer.id);
+ }
+ }
+
+ if (cellId === null) {
+ Logger.error("Failed to find active cell.");
+ return null;
+ }
+
+ const completionId = generateUUID();
+ const deferred = new Deferred<CompletionResult>();
+ COMPLETION_REQUESTS.register(completionId, deferred, context.pos);
+ sendCodeCompletionRequest(completionId, query, cellId);
+ return deferred.promise;
+}
diff --git a/frontend/src/core/codemirror/extensions.ts b/frontend/src/core/codemirror/extensions.ts
new file mode 100644
index 0000000000..89358f24bc
--- /dev/null
+++ b/frontend/src/core/codemirror/extensions.ts
@@ -0,0 +1,84 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { EditorView, keymap, placeholder } from "@codemirror/view";
+import { CellId } from "../model/ids";
+import { formatEditorViews } from "./format";
+import { smartScrollIntoView } from "../../utils/scroll";
+import { HOTKEYS } from "@/core/hotkeys/hotkeys";
+
+/**
+ * A placeholder that will be shown when the editor is empty and support auto-complete on right arrow.
+ */
+export function smartPlaceholderExtension(text: string) {
+ return [
+ placeholder(text),
+ keymap.of([
+ {
+ key: "ArrowRight",
+ preventDefault: true,
+ run: (cm) => {
+ // if empty, insert the placeholder
+ if (cm.state.doc.length === 0) {
+ cm.dispatch({
+ changes: {
+ from: 0,
+ to: cm.state.doc.length,
+ insert: text,
+ },
+ });
+ // move cursor to end of placeholder
+ cm.dispatch({
+ selection: {
+ anchor: cm.state.doc.length,
+ head: cm.state.doc.length,
+ },
+ });
+ return true;
+ }
+ return false;
+ },
+ },
+ ]),
+ ];
+}
+
+/**
+ * Add a keymap to format the code in the editor.
+ */
+export function formatKeymapExtension(
+ cellId: CellId,
+ updateCellCode: (
+ cellId: CellId,
+ code: string,
+ formattingChange: boolean
+ ) => void
+) {
+ return keymap.of([
+ {
+ key: HOTKEYS.getHotkey("cell.format").key,
+ preventDefault: true,
+ run: (ev) => {
+ formatEditorViews({ [cellId]: ev }, updateCellCode);
+ return true;
+ },
+ },
+ ]);
+}
+
+export function scrollActiveLineIntoView() {
+ return EditorView.updateListener.of((update) => {
+ // A new line was added, scroll the active line into view
+ if (update.heightChanged && update.docChanged) {
+ const activeLines = update.view.dom.getElementsByClassName(
+ "cm-activeLine cm-line"
+ );
+ // Only scroll if there is an active line
+ if (activeLines.length === 1) {
+ const activeLine = activeLines[0] as HTMLElement;
+ smartScrollIntoView(activeLine, {
+ top: 30,
+ bottom: 90,
+ });
+ }
+ }
+ });
+}
diff --git a/frontend/src/core/codemirror/format.ts b/frontend/src/core/codemirror/format.ts
new file mode 100644
index 0000000000..68e7fc14ee
--- /dev/null
+++ b/frontend/src/core/codemirror/format.ts
@@ -0,0 +1,48 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { EditorView } from "codemirror";
+import { CellId } from "../model/ids";
+import { Objects } from "../../utils/objects";
+import { sendFormat } from "../network/requests";
+
+/**
+ * Format the code in the editor views via the marimo server,
+ * and update the editor views with the formatted code.
+ */
+export async function formatEditorViews(
+ views: Record<CellId, EditorView>,
+ updateCellCode: (
+ cellId: CellId,
+ code: string,
+ formattingChange: boolean
+ ) => void
+) {
+ const codes = Objects.mapValues(views, (view) => view.state.doc.toString());
+
+ const formatResponse = await sendFormat(codes);
+
+ for (const [cellId, formattedCode] of Objects.entries(formatResponse)) {
+ const originalCode = codes[cellId];
+ const view = views[cellId];
+
+ if (!view) {
+ continue;
+ }
+
+ // Only update the editor view if the formatted code is different
+ // from the original code
+ if (formattedCode === originalCode) {
+ continue;
+ }
+
+ updateCellCode(cellId, formattedCode, true);
+
+ view.dispatch({
+ changes: {
+ from: 0,
+ // overwrite the entire document
+ to: view.state.doc.length,
+ insert: formattedCode,
+ },
+ });
+ }
+}
diff --git a/frontend/src/core/codemirror/types.ts b/frontend/src/core/codemirror/types.ts
new file mode 100644
index 0000000000..1199f9a38a
--- /dev/null
+++ b/frontend/src/core/codemirror/types.ts
@@ -0,0 +1,5 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+export interface SerializedEditorState {
+ doc: string;
+ [key: string]: unknown;
+}
diff --git a/frontend/src/core/config.ts b/frontend/src/core/config.ts
new file mode 100644
index 0000000000..5aae2cf022
--- /dev/null
+++ b/frontend/src/core/config.ts
@@ -0,0 +1,36 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { z } from "zod";
+import { assertExists } from "../utils/assertExists";
+
+const SaveConfigSchema = z.object({
+ autosave: z.enum(["off", "after_delay"]),
+ autosave_delay: z.number().nonnegative(),
+});
+
+const CompletionConfigSchema = z.object({
+ activate_on_typing: z.boolean(),
+});
+
+export const UserConfigSchema = z.object({
+ completion: CompletionConfigSchema,
+ save: SaveConfigSchema,
+});
+export type UserConfig = z.infer<typeof UserConfigSchema>;
+export type SaveConfig = z.infer<typeof SaveConfigSchema>;
+export type CompletionConfig = z.infer<typeof CompletionConfigSchema>;
+
+export function getAppConfig() {
+ const tag = document.querySelector<HTMLElement>("marimo-config");
+ assertExists(tag, "internal-error: marimo-config tag not found");
+
+ const configData = tag.dataset.config;
+ assertExists(configData, "internal-error: missing config");
+
+ try {
+ return UserConfigSchema.parse(JSON.parse(configData));
+ } catch (error) {
+ throw new Error(
+ `Marimo got an unexpected value in the configuration file: ${error}`
+ );
+ }
+}
diff --git a/frontend/src/core/dom/UIElement.ts b/frontend/src/core/dom/UIElement.ts
new file mode 100644
index 0000000000..1289a38fb4
--- /dev/null
+++ b/frontend/src/core/dom/UIElement.ts
@@ -0,0 +1,184 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { Logger } from "../../utils/Logger";
+import { Functions } from "../../utils/functions";
+import { defineCustomElement } from "./defineCustomElement";
+import { MarimoValueInputEventType, marimoValueInputEvent } from "./events";
+import { UI_ELEMENT_REGISTRY } from "./uiregistry";
+
+export const UI_ELEMENT_TAG_NAME = "MARIMO-UI-ELEMENT";
+
+/**
+ * Lazily initialize the UIElement component.
+ */
+export function initializeUIElement() {
+ /**
+ * UIElement Web Component
+ *
+ * Synchronizes the value of its first child on page and with the kernel.
+ *
+ * @example
+ * Example wrapping a custom web component:
+ * ```
+ * <marimo-ui-element object-id="...">
+ * <my-custom-component data-initial-value="..."/>
+ * </marimo-ui-element>
+ * ```
+ *
+ * @example
+ * Example wrapping raw HTML:
+ * ```
+ * <marimo-ui-element object-id="...">
+ * <div data-initial-value="...">
+ * ...
+ * </div>
+ * </marimo-ui-element>
+ * ```
+ *
+ * @remarks
+ * IDENTIFICATION
+ * UIElements are uniquely identified by their objectId, in the following
+ * sense: UIElements with the same objectId are synchronized to have the same
+ * value. In other words, the set of UIElements on the page can be partitioned
+ * into equivalence classes, where two elements are equivalent if they share
+ * the same objectId.
+ *
+ * Every UIElement is registered with the global UIElementRegistry.
+ *
+ * SYNCHRONIZATION
+ * Using a <marimo-ui-element> tag declares that its first child is a component
+ * whose value should be synchronized. Synchronization happens on two levels:
+ * 1. multiple instances of the same component are synchronized to have the
+ * same value
+ * 2. a change in value on the page is sent to the kernel
+ *
+ * INITIAL VALUE
+ * The first child of <marimo-ui-element> may optionally take a data attribute
+ * called "initial-value" to influence its instantiation. Upon instantiation,
+ * the UIElement component may set this attribute if it already has a value
+ * for the objectId.
+ *
+ * COMMUNICATION
+ * Communication between marimo and the child of a UIElement is facilitated
+ * by two events:
+ * 1. marimoValueInputEvent: the child publishes its value by dispatching
+ * a marimoValueInputEvent, with `detail` set to
+ * `{ value: <the new value> }`;
+ * 2. marimoValueUpdateEvent: the UIElement node broadcasts a
+ * marimoValueUpdateEvent to every element registered under its
+ * objectId when a new value is available; the targets of these
+ * events (i.e., the child node of each UIElement in the equivalence
+ * class of the objectId) are responsible for listening to these
+ * events and updating their value internally.
+ *
+ */
+ class UIElement extends HTMLElement {
+ private initialized = false;
+ private inputListener: (e: MarimoValueInputEventType) => void =
+ Functions.NOOP;
+
+ // This needs to happen in connectedCallback because the element may not be
+ // set at construction time
+ private init() {
+ if (this.initialized) {
+ return;
+ }
+
+ const objectId = this.getAttribute("object-id");
+ this.inputListener = (e: MarimoValueInputEventType) => {
+ // TODO: just fill in the objectId and let the document handle
+ // broadcast? that would still let other elements cancel the event
+ // while also reducing the number of event listeners on the document
+ if (objectId !== null && e.detail.element === this.firstElementChild) {
+ UI_ELEMENT_REGISTRY.broadcastValueUpdate(
+ child as HTMLElement,
+ objectId,
+ e.detail.value
+ );
+ }
+ };
+
+ // A UIElement tracks the value of its first child.
+ const child = this.firstElementChild;
+ if (objectId === null) {
+ Logger.error("[marimo-ui-element] missing object-id attribute");
+ return;
+ } else if (child === null) {
+ Logger.error("[marimo-ui-element] has no child");
+ return;
+ } else if (!(child instanceof HTMLElement)) {
+ Logger.error(
+ "[marimo-ui-element] first child must be instance of HTMLElement"
+ );
+ return;
+ }
+
+ this.initialized = true;
+ }
+
+ connectedCallback() {
+ this.init();
+
+ if (this.initialized) {
+ // It is critical that the element is registered in this method,
+ // and not in the constructor, since it may be disconnected and
+ // reconnected without being re-constructed
+ const objectId = this.getAttribute("object-id") as string;
+ const child = this.firstElementChild as HTMLElement;
+ UI_ELEMENT_REGISTRY.registerInstance(objectId, child);
+
+ // Listen to marimo input events provided by the child element: these
+ // events are signals to this UIElement that our value should change.
+ document.addEventListener(marimoValueInputEvent, this.inputListener);
+ }
+ }
+
+ disconnectedCallback() {
+ if (this.initialized) {
+ // Unregister everything
+ document.removeEventListener(marimoValueInputEvent, this.inputListener);
+ const objectId = this.getAttribute("object-id") as string;
+ UI_ELEMENT_REGISTRY.removeInstance(
+ objectId,
+ this.firstElementChild as HTMLElement
+ );
+ }
+ }
+
+ // We look for changes to the random-id attribute, which is effectively
+ // used like a React key. If the random-id changes, we need to unmount and
+ // remount its child.
+ static get observedAttributes() {
+ return ["random-id"];
+ }
+
+ attributeChangedCallback(
+ name: string,
+ oldValue: string | null,
+ newValue: string | null
+ ) {
+ if (this.initialized) {
+ const hasChanged = oldValue !== newValue;
+ if (name === "random-id" && hasChanged) {
+ // deregister/clean-up this instance
+ this.disconnectedCallback();
+ // remove and re-add its child to force it to re-render; note that
+ // this doesn't reconstruct the UI element, only its child
+ const child = this.firstElementChild;
+ if (child && "rerender" in child) {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ (child as any).rerender();
+ } else {
+ Logger.error(
+ "[marimo-ui-element] first child must have a rerender method"
+ );
+ }
+ // register the element and reset its initial value
+ this.initialized = false;
+ this.connectedCallback();
+ }
+ }
+ }
+ }
+
+ defineCustomElement(UI_ELEMENT_TAG_NAME.toLowerCase(), UIElement);
+}
diff --git a/frontend/src/core/dom/__tests__/htmlUtils.test.ts b/frontend/src/core/dom/__tests__/htmlUtils.test.ts
new file mode 100644
index 0000000000..37e839ba75
--- /dev/null
+++ b/frontend/src/core/dom/__tests__/htmlUtils.test.ts
@@ -0,0 +1,64 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { describe, expect, it } from "vitest";
+import { parseAttrValue, parseInitialValue } from "../htmlUtils";
+
+describe("htmlUtils", () => {
+ it.each([false, { a: 1 }, true, 0, 1, [{ a: 1 }, { b: 2 }], "hello", ""])(
+ "can parse element.dataset.initialValue",
+ (initialValue) => {
+ const div = document.createElement("div");
+ div.dataset.initialValue = JSON.stringify(initialValue);
+ expect(parseInitialValue(div)).toEqual(initialValue);
+ }
+ );
+
+ it("can parse an element with no initialValue", () => {
+ const div = document.createElement("div");
+ expect(parseInitialValue(div)).toEqual({});
+ });
+});
+
+it("can parseAttrValue happy path", () => {
+ expect(parseAttrValue('"hello"')).toEqual("hello");
+ expect(
+ parseAttrValue('[false,{"a":1},true,0,1,[{"a":1},{"b":2}],"hello",""]')
+ ).toEqual([false, { a: 1 }, true, 0, 1, [{ a: 1 }, { b: 2 }], "hello", ""]);
+
+ expect(parseAttrValue("10")).toEqual(10);
+ expect(parseAttrValue("null")).toEqual(null);
+});
+
+it("can parseAttrValue NaN, Infinity, -Infinity", () => {
+ expect(parseAttrValue("NaN")).toEqual(Number.NaN);
+ expect(parseAttrValue('{"A":NaN}')).toEqual({ A: Number.NaN });
+ expect(parseAttrValue("[NaN]")).toEqual([Number.NaN]);
+ expect(parseAttrValue("[-Infinity]")).toEqual([Number.NEGATIVE_INFINITY]);
+ expect(parseAttrValue("[Infinity]")).toEqual([Number.POSITIVE_INFINITY]);
+ expect(parseAttrValue('[NaN,Infinity,-Infinity,{"A": NaN}]')).toEqual([
+ Number.NaN,
+ Number.POSITIVE_INFINITY,
+ Number.NEGATIVE_INFINITY,
+ { A: Number.NaN },
+ ]);
+
+ // Prevent false positives as text
+ expect(parseAttrValue('"NaN"')).toEqual("NaN");
+ expect(parseAttrValue('"Infinity"')).toEqual("Infinity");
+ expect(parseAttrValue('"-Infinity"')).toEqual("-Infinity");
+
+ expect(parseAttrValue('"This is NaN"')).toEqual("This is NaN");
+ expect(parseAttrValue('"To Infinity and Beyond"')).toEqual(
+ "To Infinity and Beyond"
+ );
+ expect(parseAttrValue('"To -Infinity and Beyond"')).toEqual(
+ "To -Infinity and Beyond"
+ );
+});
+
+it("can fail to parseAttrValue", () => {
+ // Fail to parse
+ expect(parseAttrValue("")).toMatchInlineSnapshot("{}");
+ expect(parseAttrValue("undefined")).toMatchInlineSnapshot("{}");
+ expect(parseAttrValue(undefined)).toMatchInlineSnapshot("{}");
+ expect(parseAttrValue("[nan]")).toMatchInlineSnapshot("{}");
+});
diff --git a/frontend/src/core/dom/defineCustomElement.ts b/frontend/src/core/dom/defineCustomElement.ts
new file mode 100644
index 0000000000..3c0b979492
--- /dev/null
+++ b/frontend/src/core/dom/defineCustomElement.ts
@@ -0,0 +1,23 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { Logger } from "../../utils/Logger";
+
+/**
+ * Wrapper for the customElements.define() method to add safety checks.
+ */
+export function defineCustomElement(
+ name: string,
+ clazz: CustomElementConstructor
+) {
+ if (typeof window === "undefined" || !window.customElements) {
+ Logger.warn("Custom elements not supported");
+ return;
+ }
+
+ if (window.customElements.get(name)) {
+ if (import.meta.env.PROD) {
+ Logger.warn(`Custom element ${name} already defined`);
+ }
+ return;
+ }
+ window.customElements.define(name, clazz);
+}
diff --git a/frontend/src/core/dom/events.ts b/frontend/src/core/dom/events.ts
new file mode 100644
index 0000000000..46707a8299
--- /dev/null
+++ b/frontend/src/core/dom/events.ts
@@ -0,0 +1,59 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+export type ValueType = unknown;
+
+export type MarimoValueInputEventType = CustomEvent<{
+ value: ValueType;
+ element: HTMLElement;
+}>;
+export const marimoValueInputEvent = "marimo-value-input";
+
+export type MarimoValueUpdateEventType = CustomEvent<{
+ value: ValueType;
+ element: HTMLElement;
+}>;
+export const marimoValueUpdateEvent = "marimo-value-update";
+
+export type MarimoValueReadyEventType = CustomEvent<{ objectId: string }>;
+export const marimoValueReadyEvent = "marimo-value-ready";
+
+/**
+ * Create a custom event to communicate a change in value
+ *
+ * This function should be used by UI elements to tell marimo that
+ * their value has changed.
+ *
+ * We also pass in the UI element that is triggering the change.
+ * We cannot simply use `e.target` because of "Event Retargeting"
+ * which is a feature of the Shadow DOM, that ensures encapsulation by
+ * re-targeting events that are emitted from within a shadow root to
+ * the shadow root's host element. We do not want to re-target the event
+ * because we want to know which element triggered the event.
+ *
+ * @param value - the new value of the component
+ * @param element - the element that changed
+ */
+export function createInputEvent(
+ value: ValueType,
+ element: HTMLElement
+): MarimoValueInputEventType {
+ return new CustomEvent(marimoValueInputEvent, {
+ bubbles: true, // bubble to tell marimo that a value has changed
+ composed: true,
+ detail: { value: value, element: element },
+ });
+}
+
+// Augment the global namespace to include the custom events
+declare global {
+ interface HTMLElementEventMap {
+ "marimo-value-input": MarimoValueInputEventType;
+ "marimo-value-update": MarimoValueUpdateEventType;
+ "marimo-value-ready": MarimoValueReadyEventType;
+ }
+
+ interface DocumentEventMap {
+ "marimo-value-input": MarimoValueInputEventType;
+ "marimo-value-update": MarimoValueUpdateEventType;
+ "marimo-value-ready": MarimoValueReadyEventType;
+ }
+}
diff --git a/frontend/src/core/dom/htmlUtils.ts b/frontend/src/core/dom/htmlUtils.ts
new file mode 100644
index 0000000000..d0654cea77
--- /dev/null
+++ b/frontend/src/core/dom/htmlUtils.ts
@@ -0,0 +1,71 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { assertExists } from "@/utils/assertExists";
+import { UI_ELEMENT_REGISTRY } from "./uiregistry";
+
+// Random unicode character that is unlikely to be used in the JSON string
+const CHAR = "◐";
+
+/**
+ * Parse an attribute value as JSON.
+ */
+export function parseAttrValue<T>(value: string | undefined): T {
+ try {
+ // This will properly handle NaN, Infinity, and -Infinity
+ // The python json.dumps encoding will serialize to NaN, Infinity, -Infinity which is not valid JSON,
+ // but we don't want to change the python encoding because NaN, Infinity, -Infinity are valuable to know.
+ value = value ?? "";
+ value = value.replaceAll(
+ // This was iterated on with GPT. The confidence lies in the unit tests.
+ /(?<=\s|^|\[|,|:)(NaN|-Infinity|Infinity)(?=(?:[^"'\\]*(\\.|'([^'\\]*\\.)*[^'\\]*'|"([^"\\]*\\.)*[^"\\]*"))*[^"']*$)/g,
+ `"${CHAR}$1${CHAR}"`
+ );
+ return JSON.parse(value, (key, v) => {
+ if (typeof v !== "string") {
+ return v;
+ }
+ if (v === `${CHAR}NaN${CHAR}`) {
+ return Number.NaN;
+ }
+ if (v === `${CHAR}Infinity${CHAR}`) {
+ return Number.POSITIVE_INFINITY;
+ }
+ if (v === `${CHAR}-Infinity${CHAR}`) {
+ return Number.NEGATIVE_INFINITY;
+ }
+ return v;
+ });
+ } catch {
+ return {} as T;
+ }
+}
+
+/**
+ * Parse the initial value.
+ * It will first check if the parent element is a <marimo-ui-element/> with an object-id that
+ * exist in the UI registry.
+ * And otherwise fallback to the data-initial-value attribute.
+ */
+export function parseInitialValue<T>(element: HTMLElement): T {
+ // If parent is a <marimo-ui-element/> and has object-id, use that as the initialize the value
+ const objectId = element.parentElement?.getAttribute("object-id");
+ if (objectId && UI_ELEMENT_REGISTRY.has(objectId)) {
+ return UI_ELEMENT_REGISTRY.lookupValue(objectId) as T;
+ }
+
+ // Otherwise use the data-initial-value attribute
+ return parseAttrValue(element.dataset.initialValue);
+}
+
+/**
+ * Serialize the initial value.
+ */
+export function serializeInitialValue(value: unknown) {
+ return JSON.stringify(value);
+}
+
+export function getFilenameFromDOM() {
+ const filenameTag = document.querySelector("marimo-filename");
+ assertExists(filenameTag, "marimo-filename tag not found");
+ const name = filenameTag.innerHTML;
+ return name.length === 0 ? null : name;
+}
diff --git a/frontend/src/core/dom/uiregistry.ts b/frontend/src/core/dom/uiregistry.ts
new file mode 100644
index 0000000000..b97fec2c4d
--- /dev/null
+++ b/frontend/src/core/dom/uiregistry.ts
@@ -0,0 +1,152 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { repl } from "../../utils/repl";
+import {
+ ValueType,
+ marimoValueUpdateEvent,
+ marimoValueReadyEvent,
+} from "./events";
+import { parseInitialValue } from "./htmlUtils";
+
+interface UIElementEntry {
+ objectId: string;
+ value: ValueType;
+ // elements synchronized by a UIElement (in the DOM, each
+ // <marimo-ui-element>'s first child)
+ elements: Set<HTMLElement>;
+}
+
+/* UIElementRegistry
+ *
+ * Maintains state for each UI element that is rendered in the
+ * DOM (including shadow DOMs), and handles dispatching of events
+ * to UI elements when values are updated.
+ *
+ * Expects object IDs to have the form <cellId>-<suffixId>
+ */
+export class UIElementRegistry {
+ // maps UIElement objectIds to entries.
+ entries: Map<string, UIElementEntry>;
+
+ constructor() {
+ this.entries = new Map();
+ }
+
+ has(objectId: string): boolean {
+ return this.entries.has(objectId);
+ }
+
+ /**
+ * Register an instance of a UIElement
+ *
+ * @param objectId - id of the UIElement
+ * @param instance - the HTMLElement that the UIElement wraps
+ */
+ registerInstance(objectId: string, instance: HTMLElement) {
+ const entry = this.entries.get(objectId);
+ if (entry === undefined) {
+ this.entries.set(objectId, {
+ objectId: objectId,
+ value: parseInitialValue(instance),
+ elements: new Set([instance]),
+ });
+ } else {
+ entry.elements.add(instance);
+ }
+ }
+
+ /**
+ * Remove an instance of a UIElement
+ *
+ * @remarks
+ * Should be called when a UIElement node is removed from the DOM.
+ *
+ * @param objectId - id of the UIElement
+ * @param instance - the HTMLElement to remove
+ *
+ */
+ removeInstance(objectId: string, instance: HTMLElement) {
+ const entry = this.entries.get(objectId);
+ // The UIElement can be removed from the registry before all
+ // instances are removed: UIElement removal is triggered
+ // when the tied Python object goes out of scope, but instance
+ // removal is triggered when the instance is removed from the DOM
+ // (which can happen after Python deconstruction)
+ if (entry !== undefined && entry.elements.has(instance)) {
+ entry.elements.delete(instance);
+ }
+ }
+
+ /**
+ * Remove all UIElements associated with a particular cell from the registry.
+ *
+ * Doesn't destroy or unmount HTML elements, just removes associated state
+ * from the registry.
+ *
+ * @param cellId - stringified cellId
+ */
+ removeElementsByCell(cellId: string) {
+ const objectIds = [...this.entries.keys()].filter((objectId) =>
+ objectId.startsWith(`${cellId}-`)
+ );
+
+ objectIds.forEach((objectId) => {
+ this.entries.delete(objectId);
+ });
+ }
+
+ /**
+ * Get the value of a registered UIElement.
+ *
+ * @param objectId - id of the UIElement
+ * @returns the value for `objectId`, or `null` if the object was not found.
+ */
+ lookupValue(objectId: string): ValueType | null {
+ const entry = this.entries.get(objectId);
+ return entry === undefined ? null : entry.value;
+ }
+
+ /**
+ * Broadcast `value` to instances of the component with id `objectId`
+ *
+ * Additionally, sends a message to alert the app that an object has a new
+ * value that should be sent to the kernel.
+ *
+ * @param initiator - child element that initiated the broadcast
+ * @param objectId - id of the UIElement
+ * @param value - value to broadcast
+ */
+ broadcastValueUpdate(
+ initiator: HTMLElement,
+ objectId: string,
+ value: ValueType
+ ): void {
+ const entry = this.entries.get(objectId);
+ if (entry !== undefined) {
+ entry.value = value;
+ entry.elements.forEach((element) => {
+ if (element !== initiator) {
+ element.dispatchEvent(
+ new CustomEvent(marimoValueUpdateEvent, {
+ bubbles: false, // only the intended target gets the message
+ composed: true,
+ detail: { value: value, element: element },
+ })
+ );
+ }
+ });
+
+ document.dispatchEvent(
+ new CustomEvent(marimoValueReadyEvent, {
+ bubbles: true,
+ composed: true,
+ detail: {
+ objectId: objectId,
+ },
+ })
+ );
+ }
+ }
+}
+
+export const UI_ELEMENT_REGISTRY = new UIElementRegistry();
+repl(UI_ELEMENT_REGISTRY, "UI_ELEMENT_REGISTRY");
diff --git a/frontend/src/core/hotkeys/hotkeys.ts b/frontend/src/core/hotkeys/hotkeys.ts
new file mode 100644
index 0000000000..5061911b54
--- /dev/null
+++ b/frontend/src/core/hotkeys/hotkeys.ts
@@ -0,0 +1,294 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { isPlatformMac } from "@/core/shortcuts/shortcuts";
+import { Objects } from "@/utils/objects";
+
+interface Hotkey {
+ name: string;
+ /**
+ * Grouping for the command palette and keyboard shortcuts page.
+ * If not specified, the command will not be shown in the command palette.
+ */
+ group: HotkeyGroup | undefined;
+ key:
+ | string
+ | {
+ main: string;
+ /** macOS specific override */
+ mac?: string;
+ /** Windows specific override */
+ windows?: string;
+ /** Linux specific override */
+ linux?: string;
+ };
+}
+
+interface ResolvedHotkey {
+ name: string;
+ key: string;
+}
+
+type Platform = "mac" | "windows" | "linux";
+
+export type HotkeyGroup =
+ | "Running Cells"
+ | "Creation and Ordering"
+ | "Navigation"
+ | "Editing"
+ | "Other";
+
+const DEFAULT_HOT_KEY = {
+ // Cell Navigation
+ "cell.focusUp": {
+ name: "Focus up",
+ group: "Navigation",
+ key: "Mod-Shift-9",
+ },
+ "cell.focusDown": {
+ name: "Focus down",
+ group: "Navigation",
+ key: "Mod-Shift-0",
+ },
+
+ // Creation and Ordering
+ "cell.moveUp": {
+ name: "Move up",
+ group: "Creation and Ordering",
+ key: "Mod-Shift-k",
+ },
+ "cell.moveDown": {
+ name: "Move down",
+ group: "Creation and Ordering",
+ key: "Mod-Shift-j",
+ },
+ "cell.createAbove": {
+ name: "Create cell above",
+ group: "Creation and Ordering",
+ key: "Mod-Shift-o",
+ },
+ "cell.createBelow": {
+ name: "Create cell below",
+ group: "Creation and Ordering",
+ key: "Mod-Shift-p",
+ },
+ "cell.sendToTop": {
+ name: "Send to top",
+ group: "Creation and Ordering",
+ key: "Mod-Shift-1",
+ },
+ "cell.sendToBottom": {
+ name: "Send to bottom",
+ group: "Creation and Ordering",
+ key: "Mod-Shift-2",
+ },
+
+ // Running Cells
+ "cell.run": {
+ name: "Run",
+ group: "Running Cells",
+ key: "Mod-Enter",
+ },
+ "cell.runAndNewBelow": {
+ name: "Run and new below",
+ group: "Running Cells",
+ key: "Shift-Enter",
+ },
+ "cell.runAndNewAbove": {
+ name: "Run and new above",
+ group: "Running Cells",
+ key: "Mod-Shift-Enter",
+ },
+
+ // Editing Cells
+ "cell.format": {
+ name: "Format",
+ group: "Editing",
+ key: "Mod-b",
+ },
+ "cell.complete": {
+ name: "Code completion",
+ group: "Editing",
+ key: "Ctrl-Space",
+ },
+ "cell.undo": {
+ name: "Undo",
+ group: "Editing",
+ key: "Mod-z",
+ },
+ "cell.redo": {
+ name: "Redo",
+ group: "Editing",
+ key: {
+ main: "Mod-Shift-z",
+ windows: "Mod-y",
+ },
+ },
+ "cell.findAndReplace": {
+ name: "Find and replace",
+ group: "Editing",
+ key: "Mod-f",
+ },
+ "cell.fold": {
+ name: "Fold",
+ group: "Editing",
+ key: {
+ main: "Mod-Alt-[",
+ windows: "Mod-Shift-[",
+ },
+ },
+ "cell.unfold": {
+ name: "Unfold",
+ group: "Editing",
+ key: {
+ main: "Mod-Alt-]",
+ windows: "Mod-Shift-]",
+ },
+ },
+ "cell.foldAll": {
+ name: "Fold all in cell",
+ group: "Editing",
+ key: "Ctrl-Alt-[",
+ },
+ "cell.unfoldAll": {
+ name: "Unfold all in cell",
+ group: "Editing",
+ key: "Ctrl-Alt-]",
+ },
+ "cell.delete": {
+ name: "Delete empty cell",
+ group: "Editing",
+ key: "Shift-Backspace",
+ },
+
+ // Global Actions
+ "global.hideCode": {
+ name: "Show/Hide code",
+ group: "Other",
+ key: "Mod-.",
+ },
+ "global.foldCode": {
+ name: "Fold all cells",
+ group: "Editing",
+ key: {
+ main: "Ctrl-Cmd-l",
+ windows: "Mod-Shift-l",
+ },
+ },
+ "global.unfoldCode": {
+ name: "Unfold all cells",
+ group: "Editing",
+ key: {
+ main: "Ctrl-Cmd-;",
+ windows: "Mod-Shift-:",
+ },
+ },
+ "global.showHelp": {
+ name: "Keyboard shortcuts",
+ group: "Other",
+ key: "Mod-Shift-h",
+ },
+ "global.save": {
+ name: "Save",
+ group: "Other",
+ key: "Mod-s",
+ },
+ "global.commandPalette": {
+ name: "Command palette",
+ group: "Other",
+ key: "Mod-k",
+ },
+ "global.runStale": {
+ name: "Run all modified cells",
+ group: "Running Cells",
+ key: "Mod-Shift-r",
+ },
+ "global.interrupt": {
+ name: "Stop (interrupt) execution",
+ group: "Running Cells",
+ key: "Mod-i",
+ },
+ "global.formatAll": {
+ name: "Format all",
+ group: "Editing",
+ key: "Mod-Shift-b",
+ },
+
+ // Global Navigation
+ "global.focusTop": {
+ name: "Focus top",
+ group: "Navigation",
+ key: "Mod-Shift-f",
+ },
+ "global.focusBottom": {
+ name: "Focus bottom",
+ group: "Navigation",
+ key: "Mod-Shift-g",
+ },
+} satisfies Record<string, Hotkey>;
+
+export type HotkeyAction = keyof typeof DEFAULT_HOT_KEY;
+
+export interface IHotkeyProvider {
+ getHotkey(action: HotkeyAction): ResolvedHotkey;
+}
+
+export class HotkeyProvider implements IHotkeyProvider {
+ private mod = isPlatformMac() ? "Cmd" : "Ctrl";
+ private platform: Platform = isPlatformMac() ? "mac" : "windows";
+
+ constructor(private hotkeys: Record<HotkeyAction, Hotkey>) {}
+
+ iterate(): HotkeyAction[] {
+ return Objects.keys(this.hotkeys);
+ }
+
+ getHotkey(action: HotkeyAction): ResolvedHotkey {
+ const { name, key } = this.hotkeys[action];
+ if (typeof key === "string") {
+ return {
+ name,
+ key: key.replace("Mod", this.mod),
+ };
+ }
+ const platformKey = key[this.platform] || key.main;
+ return {
+ name,
+ key: platformKey.replace("Mod", this.mod),
+ };
+ }
+
+ getHotkeyDisplay(action: HotkeyAction): string {
+ return this.hotkeys[action].name;
+ }
+
+ getHotkeyGroups(): Record<HotkeyGroup, HotkeyAction[]> {
+ return Objects.groupBy(
+ Objects.entries(this.hotkeys),
+ ([, hotkey]) => hotkey.group,
+ ([action]) => action
+ );
+ }
+}
+
+export class OverridingHotkeyProvider extends HotkeyProvider {
+ constructor(
+ private readonly overrides: Partial<
+ Record<HotkeyAction, string | undefined>
+ >
+ ) {
+ super(DEFAULT_HOT_KEY);
+ }
+
+ override getHotkey(action: HotkeyAction): ResolvedHotkey {
+ const base = super.getHotkey(action);
+ const key = this.overrides[action] || base.key;
+ return {
+ name: base.name,
+ key,
+ };
+ }
+}
+
+export const HOTKEYS = new OverridingHotkeyProvider({
+ // Override default hotkeys here.
+ // This can be from the user's settings.
+});
diff --git a/frontend/src/core/kernel/kernel.ts b/frontend/src/core/kernel/kernel.ts
new file mode 100644
index 0000000000..2c51db0a28
--- /dev/null
+++ b/frontend/src/core/kernel/kernel.ts
@@ -0,0 +1,11 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { Logger } from "../../utils/Logger";
+
+export function getKernelId(): string | null {
+ if (typeof window === "undefined") {
+ Logger.warn("getKernelId() called without window");
+ return null;
+ }
+
+ return new URLSearchParams(window.location.search).get("kernel_id");
+}
diff --git a/frontend/src/core/kernel/messages.tsx b/frontend/src/core/kernel/messages.tsx
new file mode 100644
index 0000000000..618399ddf5
--- /dev/null
+++ b/frontend/src/core/kernel/messages.tsx
@@ -0,0 +1,135 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+
+import { CellId } from "../model/ids";
+
+export type MarimoError =
+ | { type: "syntax"; msg?: string }
+ | { type: "interruption"; msg?: string }
+ | { type: "exception"; msg: string; raising_cell?: number }
+ | { type: "cycle"; edges: Array<[number, number]> }
+ | { type: "multiple-defs"; name: string; cells: number[] }
+ | { type: "delete-nonlocal"; name: string; cells: number[] }
+ | { type: "unknown"; msg?: string };
+
+export type OutputMessage =
+ | {
+ channel: string;
+ mimetype: "application/vnd.marimo+error";
+ data: MarimoError[];
+ timestamp: string;
+ }
+ | {
+ channel: string;
+ mimetype:
+ | "text/plain"
+ | "text/html"
+ | "text/plain"
+ | "image/png"
+ | "image/svg+xml"
+ | "image/tiff"
+ | "image/avif"
+ | "image/bmp"
+ | "image/gif"
+ | "image/jpeg"
+ | "video/mp4"
+ | "video/mpeg";
+ data: string;
+ timestamp: string;
+ }
+ | {
+ channel: string;
+ mimetype: "application/json";
+ data: unknown;
+ timestamp: string;
+ };
+
+/**
+ * Control messages sent from the kernel describing the execution state
+ * and output (including errors) of a cell.
+ */
+export interface CellMessage {
+ /**
+ * The ID of the cell this message is about
+ */
+ cell_id: CellId;
+ /**
+ * The output of the cell, if any
+ */
+ output: OutputMessage | null;
+ /**
+ * The console output of the cell, if any
+ */
+ console: OutputMessage | OutputMessage[] | null;
+ /**
+ * Encodes status transitions. Non-null means a transition happened. Null
+ * means no transition in status.
+ */
+ status: "idle" | "queued" | "running" | null;
+ /**
+ * Timestamp in seconds since epoch, when the message was sent
+ */
+ timestamp: number;
+}
+
+export interface CompletionOption {
+ name: string;
+ type: string;
+ completion_info?: string;
+}
+
+/**
+ * Message sent from the kernel in response to a completion request
+ * from the frontend.
+ */
+export interface CompletionResultMessage {
+ /**
+ * The ID of the completion request
+ */
+ completion_id: string;
+ prefix_length: number;
+ /**
+ * The options for completion
+ */
+ options: CompletionOption[];
+}
+
+/**
+ * Message sent from the frontend to the kernel via the websocket.
+ */
+export type OperationMessage =
+ | {
+ op: "kernel-ready";
+ data: {
+ /**
+ * The cell names
+ */
+ names: string[];
+ /**
+ * The cell codes. Will be empty in Read mode.
+ */
+ codes: string[];
+ };
+ }
+ | {
+ op: "completed-run";
+ }
+ | {
+ op: "interrupted";
+ }
+ | {
+ op: "remove-ui-elements";
+ data: {
+ /**
+ * The ID of the cell whose UI elements should be removed
+ */
+ cell_id: CellId;
+ };
+ }
+ | {
+ op: "completion-result";
+ data: CompletionResultMessage;
+ }
+ | {
+ op: "cell-op";
+ data: CellMessage;
+ };
diff --git a/frontend/src/core/mode.ts b/frontend/src/core/mode.ts
new file mode 100644
index 0000000000..30ae9339be
--- /dev/null
+++ b/frontend/src/core/mode.ts
@@ -0,0 +1,35 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+/**
+ * This is the internal mode.
+ * - `read`: A user is reading the notebook. Cannot switch to edit/present mode.
+ * - `edit`: A user is editing the notebook. Can switch to present mode.
+ * - `present`: A user is presenting the notebook, it looks like read mode but with some editing features. Cannot switch to present mode.
+ */
+export type AppMode = "read" | "edit" | "present";
+
+export function getInitialAppMode(): AppMode {
+ const tag = document.querySelector("marimo-mode");
+ if (tag === null || !(tag instanceof HTMLElement)) {
+ throw new Error("internal-error: marimo-mode tag not found");
+ }
+
+ const mode = tag.dataset.mode;
+ switch (mode) {
+ case "read":
+ return "read";
+ case "edit":
+ return "edit";
+ default:
+ // We can only start in 'read' or 'edit' mode.
+ throw new Error(`internal-error: unknown mode ${mode}`);
+ }
+}
+
+export function toggleAppMode(mode: AppMode): AppMode {
+ // Can't switch to present mode.
+ if (mode === "read") {
+ return "read";
+ }
+
+ return mode === "edit" ? "present" : "edit";
+}
diff --git a/frontend/src/core/model/__tests__/collapseConsoleOutputs.test.ts b/frontend/src/core/model/__tests__/collapseConsoleOutputs.test.ts
new file mode 100644
index 0000000000..849c173b55
--- /dev/null
+++ b/frontend/src/core/model/__tests__/collapseConsoleOutputs.test.ts
@@ -0,0 +1,77 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+
+import { expect, describe, it } from "vitest";
+import { collapseConsoleOutputs } from "../collapseConsoleOutputs";
+import { OutputMessage } from "@/core/kernel/messages";
+
+describe("collapseConsoleOutputs", () => {
+ it("should collapse last two text/plain outputs on the same channel", () => {
+ const consoleOutputs: OutputMessage[] = [
+ { mimetype: "text/plain", channel: "1", data: "Hello ", timestamp: "" },
+ { mimetype: "text/plain", channel: "1", data: "World", timestamp: "" },
+ ];
+ const result = collapseConsoleOutputs(consoleOutputs);
+ expect(result[0].data).toMatchInlineSnapshot('"Hello World"');
+ });
+
+ it("should not collapse outputs on different channels", () => {
+ const consoleOutputs: OutputMessage[] = [
+ { mimetype: "text/plain", channel: "1", data: "Hello ", timestamp: "" },
+ { mimetype: "text/plain", channel: "2", data: "World", timestamp: "" },
+ ];
+ const result = collapseConsoleOutputs(consoleOutputs);
+ expect(result).toEqual(consoleOutputs);
+ });
+
+ it("should not collapse outputs of different mimetypes", () => {
+ const consoleOutputs: OutputMessage[] = [
+ { mimetype: "text/plain", channel: "1", data: "Hello ", timestamp: "" },
+ { mimetype: "text/html", channel: "1", data: "World", timestamp: "" },
+ ];
+ const result = collapseConsoleOutputs(consoleOutputs);
+ expect(result).toEqual(consoleOutputs);
+ });
+
+ it("should handle carriage returns", () => {
+ const consoleOutputs: OutputMessage[] = [
+ {
+ mimetype: "text/plain",
+ channel: "1",
+ data: "Hello\rWorld",
+ timestamp: "",
+ },
+ ];
+ const result = collapseConsoleOutputs(consoleOutputs);
+ expect(result[0].data).toMatchInlineSnapshot('"World"');
+ });
+
+ it("should handle multiple carriage returns", () => {
+ const consoleOutputs: OutputMessage[] = [
+ {
+ mimetype: "text/plain",
+ channel: "1",
+ data: "Hello\rWorld\r!",
+ timestamp: "",
+ },
+ ];
+ const result = collapseConsoleOutputs(consoleOutputs);
+ expect(result[0].data).toMatchInlineSnapshot('"!orld"');
+ });
+
+ it("should handle carriage returns with newlines", () => {
+ const consoleOutputs: OutputMessage[] = [
+ {
+ mimetype: "text/plain",
+ channel: "1",
+ data: "Hello\nWorld\r!",
+ timestamp: "",
+ },
+ ];
+ const result = collapseConsoleOutputs(consoleOutputs);
+ expect(result).toHaveLength(1);
+ expect(result[0].data).toMatchInlineSnapshot(`
+ "Hello
+ !orld"
+ `);
+ });
+});
diff --git a/frontend/src/core/model/__tests__/ids.test.ts b/frontend/src/core/model/__tests__/ids.test.ts
new file mode 100644
index 0000000000..389c491a54
--- /dev/null
+++ b/frontend/src/core/model/__tests__/ids.test.ts
@@ -0,0 +1,41 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+/* eslint-disable @typescript-eslint/no-non-null-assertion */
+import { expect, describe, test } from "vitest";
+import { CellId, HTMLCellId } from "../ids";
+
+describe("CellId", () => {
+ test("create", () => {
+ const cellId = CellId.create();
+ expect(typeof cellId).toBe("string");
+ expect(cellId.length).toBeGreaterThan(0);
+ });
+});
+
+describe("HTMLCellId", () => {
+ test("create", () => {
+ const cellId = CellId.create();
+ const htmlCellId = HTMLCellId.create(cellId);
+ expect(htmlCellId).toBe(`cell-${cellId}`);
+ });
+
+ test("parse", () => {
+ const cellId = CellId.create();
+ const htmlCellId = HTMLCellId.create(cellId);
+ const parsedCellId = HTMLCellId.parse(htmlCellId);
+ expect(parsedCellId).toBe(cellId);
+ });
+
+ test("findElement", () => {
+ document.body.innerHTML = `
+ <div id="not-a-cell"></div>
+ <div id="cell-${CellId.create()}">
+ <div id="inner-div"></div>
+ </div>
+ `;
+ const innerDiv = document.querySelector("#inner-div");
+ expect(innerDiv).toBeDefined();
+ const cell = HTMLCellId.findElement(innerDiv!);
+ expect(cell).toBeDefined();
+ expect(cell!.id.startsWith("cell-")).toBe(true);
+ });
+});
diff --git a/frontend/src/core/model/cells.ts b/frontend/src/core/model/cells.ts
new file mode 100644
index 0000000000..02360a425d
--- /dev/null
+++ b/frontend/src/core/model/cells.ts
@@ -0,0 +1,93 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { createRef } from "react";
+import { OutputMessage } from "../kernel/messages";
+import { SerializedEditorState } from "../codemirror/types";
+import { CellHandle } from "../../editor/Cell";
+import { CellId } from "./ids";
+
+export const DEFAULT_CELL_NAME = "__";
+
+/**
+ * The status of a cell.
+ *
+ * queued: queued by the kernel.
+ * running: currently executing.
+ * idle: not running.
+ */
+export type CellStatus = "queued" | "running" | "idle";
+
+/**
+ * Create a new cell with default state.
+ */
+export function createCell({
+ key,
+ ref = createRef(),
+ name = DEFAULT_CELL_NAME,
+ initialContents = "",
+ code = "",
+ output = null,
+ consoleOutputs = [],
+ status = "idle",
+ edited = false,
+ interrupted = false,
+ errored = false,
+ runElapsedTimeMs = null,
+ runStartTimestamp = null,
+ lastCodeRun = null,
+ serializedEditorState = null,
+}: Partial<CellState> & Pick<CellState, "key">): CellState {
+ return {
+ key: key,
+ ref: ref,
+ name: name,
+ initialContents: initialContents,
+ output: output,
+ code: code,
+ status: status,
+ edited: edited,
+ interrupted: interrupted,
+ errored: errored,
+ runElapsedTimeMs: runElapsedTimeMs,
+ runStartTimestamp: runStartTimestamp,
+ lastCodeRun: lastCodeRun,
+ consoleOutputs: consoleOutputs,
+ serializedEditorState: serializedEditorState,
+ };
+}
+
+export interface CellState {
+ /** unique key */
+ key: CellId;
+ /** user-given name, or default */
+ name: string;
+ /** initial contents of the editor */
+ initialContents: string;
+ /** current contents of the editor */
+ code: string;
+ /** a message encoding the cell's output */
+ output: OutputMessage | null;
+ /** messages encoding the cell's console outputs. */
+ consoleOutputs: OutputMessage[];
+ /** current status of the cell */
+ status: CellStatus;
+ /** whether this cell has been modified since its last run */
+ edited: boolean;
+ /** whether this cell has been interrupted since its last run */
+ interrupted: boolean;
+ /** snapshot of code that was last run */
+ lastCodeRun: string | null;
+ /**
+ * whether marimo encountered an error when trying to register or run
+ * this cell (such as a multiple definition error)
+ */
+ errored: boolean;
+ /** run start time, as seconds since epoch */
+ runStartTimestamp: number | null;
+ /** run elapsed time, in milliseconds */
+ runElapsedTimeMs: number | null;
+ /** serialized state of the underyling editor */
+ serializedEditorState: SerializedEditorState | null;
+
+ /** handle to access the underlying cell */
+ ref: React.RefObject<CellHandle>;
+}
diff --git a/frontend/src/core/model/collapseConsoleOutputs.tsx b/frontend/src/core/model/collapseConsoleOutputs.tsx
new file mode 100644
index 0000000000..6a771688f1
--- /dev/null
+++ b/frontend/src/core/model/collapseConsoleOutputs.tsx
@@ -0,0 +1,57 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { OutputMessage } from "@/core/kernel/messages";
+
+// collapses the last text/plain cells with the preceding one on the same
+// channel (if any), and handles bare carriage returns ("\r")
+export function collapseConsoleOutputs(
+ consoleOutputs: OutputMessage[]
+): OutputMessage[] {
+ // Array.at() not supported in older-but-still-recent versions of Safari
+ let nextOutput = consoleOutputs[consoleOutputs.length - 1];
+ if (nextOutput.mimetype !== "text/plain") {
+ return consoleOutputs;
+ }
+
+ if (
+ consoleOutputs.length >= 2 &&
+ consoleOutputs[consoleOutputs.length - 2].mimetype === "text/plain" &&
+ consoleOutputs[consoleOutputs.length - 2].channel === nextOutput.channel
+ ) {
+ consoleOutputs.pop();
+ consoleOutputs[consoleOutputs.length - 1].data += nextOutput.data;
+ nextOutput = consoleOutputs[consoleOutputs.length - 1];
+ }
+
+ if (nextOutput.mimetype !== "text/plain") {
+ return consoleOutputs;
+ }
+
+ // eslint-disable-next-line no-control-regex
+ const carriagePattern = new RegExp("\r[^\n]", "g");
+ // collapse carriage returns in the final output's data
+ let text = nextOutput.data;
+ let carriageIdx = text.search(carriagePattern);
+ while (carriageIdx > -1) {
+ // find the newline character preceding the carriage return, if any
+ let newlineIdx = -1;
+ for (let i = carriageIdx - 1; i >= 0; i--) {
+ if (text.at(i) === "\n") {
+ newlineIdx = i;
+ break;
+ }
+ }
+ const postCarriageText = text.slice(carriageIdx + 1);
+ const prefix = text.slice(0, newlineIdx + 1);
+ const intermediateText = text.slice(newlineIdx + 1, carriageIdx);
+ text =
+ intermediateText.length <= postCarriageText.length
+ ? prefix + postCarriageText
+ : prefix +
+ postCarriageText +
+ intermediateText.slice(postCarriageText.length);
+ carriageIdx = text.search(carriagePattern);
+ }
+
+ consoleOutputs[consoleOutputs.length - 1].data = text;
+ return consoleOutputs;
+}
diff --git a/frontend/src/core/model/ids.ts b/frontend/src/core/model/ids.ts
new file mode 100644
index 0000000000..18933ec90a
--- /dev/null
+++ b/frontend/src/core/model/ids.ts
@@ -0,0 +1,49 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+/* eslint-disable @typescript-eslint/no-redeclare */
+
+export type TypedNumber<T> = number & { __type__: T };
+export type TypedString<T> = string & { __type__: T };
+
+/**
+ * A typed CellId
+ */
+export type CellId = TypedString<"CellId">;
+let counter = 0;
+export const CellId = {
+ /**
+ * Create a new CellId
+ */
+ create(): CellId {
+ const next = counter++;
+ return next.toString() as CellId;
+ },
+
+ /**
+ * Reset id provider.
+ */
+ reset() {
+ counter = 0;
+ },
+};
+
+/**
+ * The id of an HTML element that represents a cell
+ */
+export type HTMLCellId = `cell-${CellId}`;
+export const HTMLCellId = {
+ /**
+ * Create a new HTMLCellId
+ */
+ create(cellId: CellId): HTMLCellId {
+ return `cell-${cellId}` as HTMLCellId;
+ },
+ parse(htmlCellId: HTMLCellId): CellId {
+ return htmlCellId.slice(5) as CellId;
+ },
+ /**
+ * Get the cell container ancestor of `element`, if any.
+ */
+ findElement(element: Element): (Element & { id: HTMLCellId }) | null {
+ return element.closest('div[id^="cell-"]');
+ },
+};
diff --git a/frontend/src/core/model/scrollCellIntoView.ts b/frontend/src/core/model/scrollCellIntoView.ts
new file mode 100644
index 0000000000..fa7989fd86
--- /dev/null
+++ b/frontend/src/core/model/scrollCellIntoView.ts
@@ -0,0 +1,36 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { Logger } from "../../utils/Logger";
+import { CellState } from "./cells";
+import { HTMLCellId } from "./ids";
+
+export function focusAndScrollCellIntoView(cell: CellState) {
+ if (!cell) {
+ return;
+ }
+
+ cell.ref.current?.editorView.focus();
+ const element = document.getElementById(HTMLCellId.create(cell.key));
+ if (element) {
+ element.scrollIntoView({
+ behavior: "smooth",
+ block: "center",
+ });
+ } else {
+ Logger.warn("scrollCellIntoView: element not found");
+ }
+}
+
+/**
+ * Scroll to bottom and top of page.
+ *
+ * On pages with many cells, scrolling to a cell that is not in the viewport
+ * can have unreliable results (cell may not yet be rendered). Scrolling
+ * manually to the bottom/top is reliable.
+ */
+export function scrollToBottom() {
+ window.scrollTo({ top: document.body.scrollHeight, behavior: "smooth" });
+}
+
+export function scrollToTop() {
+ window.scrollTo({ top: 0, behavior: "smooth" });
+}
diff --git a/frontend/src/core/network/api.ts b/frontend/src/core/network/api.ts
new file mode 100644
index 0000000000..cecf8eb445
--- /dev/null
+++ b/frontend/src/core/network/api.ts
@@ -0,0 +1,45 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { Logger } from "../../utils/Logger";
+import { UUID } from "../../utils/uuid";
+
+export function getXsrfCookie(): string {
+ const r = document.cookie.match("\\b_xsrf=([^;]*)\\b");
+ return r ? r[1] : "";
+}
+
+const BASE_URL = "/api";
+
+/**
+ * Wrapper around fetch that adds XSRF token and session ID to the request and
+ * strong types.
+ */
+export const API = {
+ post<REQ, RESP = null>(url: string, body: REQ): Promise<RESP> {
+ const fullUrl = BASE_URL + url;
+ return fetch(fullUrl, {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ "X-Xsrftoken": getXsrfCookie(),
+ "Marimo-Session-Id": UUID,
+ },
+ body: JSON.stringify(body),
+ })
+ .then((response) => {
+ if (!response.ok) {
+ throw new Error(response.statusText);
+ } else if (
+ response.headers.get("Content-Type")?.startsWith("application/json")
+ ) {
+ return response.json();
+ } else {
+ return null;
+ }
+ })
+ .catch((error) => {
+ // Catch and rethrow
+ Logger.error(`Error requesting ${fullUrl}`, error);
+ throw error;
+ });
+ },
+};
diff --git a/frontend/src/core/network/requests.ts b/frontend/src/core/network/requests.ts
new file mode 100644
index 0000000000..ab3ed88870
--- /dev/null
+++ b/frontend/src/core/network/requests.ts
@@ -0,0 +1,110 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { CellId } from "../model/ids";
+import { API } from "./api";
+import {
+ CodeCompletionRequest,
+ DeleteRequest,
+ FormatResponse,
+ FormatRequest,
+ InstantiateRequest,
+ RenameRequest,
+ RunMultipleRequest,
+ SaveKernelRequest,
+ SendDirectoryAutocompleteRequest,
+ SendDirectoryAutocompleteResponse,
+ SetComponentValuesRequest,
+ SaveUserConfigRequest,
+} from "./types";
+
+interface ValueUpdate {
+ objectId: string;
+ value: unknown;
+}
+
+export function sendComponentValues(valueUpdates: ValueUpdate[]) {
+ const objectIds = [];
+ const values = [];
+ for (const update of valueUpdates) {
+ objectIds.push(update.objectId);
+ values.push(update.value);
+ }
+
+ return API.post<SetComponentValuesRequest>("/kernel/set_ui_element_value/", {
+ objectIds: objectIds,
+ values: values,
+ });
+}
+
+export function sendRename(filename: string | null) {
+ return API.post<RenameRequest>("/kernel/rename/", {
+ filename: filename,
+ });
+}
+
+export function sendSave(codes: string[], names: string[], filename: string) {
+ return API.post<SaveKernelRequest>("/kernel/save/", {
+ codes: codes,
+ names: names,
+ filename: filename,
+ });
+}
+
+export function sendFormat(codes: Record<CellId, string>) {
+ return API.post<FormatRequest, FormatResponse>("/kernel/format/", {
+ codes: codes,
+ }).then((res) => res.codes);
+}
+
+export function sendInterrupt() {
+ return API.post("/kernel/interrupt/", {});
+}
+
+export function sendShutdown() {
+ return API.post("/kernel/shutdown/", {});
+}
+
+export function sendRun(cellId: CellId, code: string) {
+ return sendRunMultiple([cellId], [code]);
+}
+
+export function sendInstantiate(request: InstantiateRequest) {
+ return API.post<InstantiateRequest>("/kernel/instantiate/", request);
+}
+
+export function sendRunMultiple(cellIds: CellId[], codes: string[]) {
+ return API.post<RunMultipleRequest>("/kernel/run/", {
+ cellIds: cellIds,
+ codes: codes,
+ });
+}
+
+export function sendDeleteCell(cellId: CellId) {
+ return API.post<DeleteRequest>("/kernel/delete/", {
+ cellId: cellId,
+ });
+}
+
+export async function sendDirectoryAutocompleteRequest(prefix: string) {
+ return API.post<
+ SendDirectoryAutocompleteRequest,
+ SendDirectoryAutocompleteResponse
+ >("/kernel/directory_autocomplete/", {
+ prefix: prefix,
+ });
+}
+
+export async function sendCodeCompletionRequest(
+ id: string,
+ document: string,
+ cellId: CellId
+) {
+ return API.post<CodeCompletionRequest>("/kernel/code_autocomplete/", {
+ id: id,
+ document: document,
+ cellId: cellId,
+ });
+}
+
+export function saveUserConfig(request: SaveUserConfigRequest) {
+ return API.post<SaveUserConfigRequest>("/kernel/save_user_config/", request);
+}
diff --git a/frontend/src/core/network/types.ts b/frontend/src/core/network/types.ts
new file mode 100644
index 0000000000..49bc3c0cdc
--- /dev/null
+++ b/frontend/src/core/network/types.ts
@@ -0,0 +1,72 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { UserConfig } from "../config";
+import { CellId } from "../model/ids";
+
+export interface DeleteRequest {
+ cellId: CellId;
+}
+
+export interface InstantiateRequest {
+ objectIds: string[];
+ values: unknown[];
+}
+
+export interface FormatRequest {
+ /**
+ * mapping of cell ids to code
+ */
+ codes: Record<CellId, string>;
+}
+
+export interface FormatResponse {
+ /**
+ * mapping of formatted cell ids to code
+ * response keys are a subset of request keys
+ */
+ codes: Record<CellId, string>;
+}
+
+export interface RenameRequest {
+ filename: string | null;
+}
+
+export interface RunRequest {
+ cellId: CellId;
+ code: string;
+}
+
+export interface RunMultipleRequest {
+ cellIds: CellId[];
+ codes: string[];
+}
+
+export interface SaveKernelRequest {
+ filename: string;
+ codes: string[];
+ names: string[];
+}
+
+export interface SendDirectoryAutocompleteRequest {
+ prefix: string;
+}
+
+export interface SendDirectoryAutocompleteResponse {
+ status: "ok";
+ directories: string[];
+ files: string[];
+}
+
+export interface SetComponentValuesRequest {
+ objectIds: string[];
+ values: unknown[];
+}
+
+export interface CodeCompletionRequest {
+ id: string;
+ document: string;
+ cellId: CellId;
+}
+
+export interface SaveUserConfigRequest {
+ config: UserConfig;
+}
diff --git a/frontend/src/core/saving/useAutoSave.ts b/frontend/src/core/saving/useAutoSave.ts
new file mode 100644
index 0000000000..0bdadc92da
--- /dev/null
+++ b/frontend/src/core/saving/useAutoSave.ts
@@ -0,0 +1,36 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useEffect, useRef } from "react";
+import { ConnectionStatus, WebSocketState } from "../websocket/types";
+import { UserConfig } from "../config";
+
+export function useAutoSave(opts: {
+ codes: string[];
+ config: UserConfig;
+ connStatus: ConnectionStatus;
+ needsSave: boolean;
+ onSave: () => void;
+}) {
+ const { codes, config, connStatus, needsSave, onSave } = opts;
+ const autosaveTimeoutId = useRef<NodeJS.Timeout | null>(null);
+
+ useEffect(() => {
+ if (config.save.autosave === "after_delay") {
+ if (autosaveTimeoutId.current !== null) {
+ clearTimeout(autosaveTimeoutId.current);
+ }
+
+ if (needsSave && connStatus.state === WebSocketState.OPEN) {
+ autosaveTimeoutId.current = setTimeout(
+ onSave,
+ config.save.autosave_delay
+ );
+ }
+ }
+
+ return () => {
+ if (autosaveTimeoutId.current !== null) {
+ clearTimeout(autosaveTimeoutId.current);
+ }
+ };
+ }, [codes, config.save, connStatus.state, onSave, needsSave]);
+}
diff --git a/frontend/src/core/shortcuts/shortcuts.ts b/frontend/src/core/shortcuts/shortcuts.ts
new file mode 100644
index 0000000000..bf908b9862
--- /dev/null
+++ b/frontend/src/core/shortcuts/shortcuts.ts
@@ -0,0 +1,54 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+
+import { Logger } from "@/utils/Logger";
+
+/**
+ * Check if the current platform is Mac
+ */
+export function isPlatformMac() {
+ if (typeof window === "undefined") {
+ Logger.warn("isPlatformMac() called without window");
+ return false;
+ }
+
+ // @ts-expect-error typescript does not have types for experimental userAgentData property
+ const platform = window.navigator.userAgentData
+ ? // @ts-expect-error typescript does not have types for experimental userAgentData property
+ window.navigator.userAgentData.platform
+ : window.navigator.platform;
+
+ return /mac/i.test(platform);
+}
+
+export function parseShortcut(shortcut: string): (e: KeyboardEvent) => boolean {
+ const keys = shortcut.split("-");
+ return (e: KeyboardEvent) => {
+ let satisfied = true;
+ for (const character of keys) {
+ switch (character) {
+ case "Ctrl":
+ satisfied &&= e.ctrlKey;
+ break;
+ case "Cmd":
+ satisfied &&= e.metaKey;
+ break;
+ case "Shift":
+ satisfied &&= e.shiftKey;
+ break;
+ case "Space":
+ satisfied &&= e.code === "Space";
+ break;
+ default:
+ satisfied &&= e.key.toLowerCase() === character.toLowerCase();
+ break;
+ }
+ if (!satisfied) {
+ return false;
+ }
+ }
+ if (!keys.includes("Shift")) {
+ satisfied &&= !e.shiftKey;
+ }
+ return satisfied;
+ };
+}
diff --git a/frontend/src/core/state/__tests__/__snapshots__/cells.test.ts.snap b/frontend/src/core/state/__tests__/__snapshots__/cells.test.ts.snap
new file mode 100644
index 0000000000..d07b37b49f
--- /dev/null
+++ b/frontend/src/core/state/__tests__/__snapshots__/cells.test.ts.snap
@@ -0,0 +1,358 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`cell reducer > can run cell and receive cell messages 1`] = `
+{
+ "code": "",
+ "consoleOutputs": [],
+ "edited": false,
+ "errored": false,
+ "initialContents": "",
+ "interrupted": false,
+ "key": "0",
+ "lastCodeRun": null,
+ "name": "__",
+ "output": null,
+ "ref": {
+ "current": null,
+ },
+ "runElapsedTimeMs": null,
+ "runStartTimestamp": null,
+ "serializedEditorState": null,
+ "status": "idle",
+}
+`;
+
+exports[`cell reducer > can run cell and receive cell messages 2`] = `
+{
+ "code": "import marimo as mo",
+ "consoleOutputs": [],
+ "edited": true,
+ "errored": false,
+ "initialContents": "",
+ "interrupted": false,
+ "key": "0",
+ "lastCodeRun": null,
+ "name": "__",
+ "output": null,
+ "ref": {
+ "current": null,
+ },
+ "runElapsedTimeMs": null,
+ "runStartTimestamp": null,
+ "serializedEditorState": null,
+ "status": "idle",
+}
+`;
+
+exports[`cell reducer > can run cell and receive cell messages 3`] = `
+{
+ "code": "import marimo as mo",
+ "consoleOutputs": [],
+ "edited": false,
+ "errored": false,
+ "initialContents": "",
+ "interrupted": false,
+ "key": "0",
+ "lastCodeRun": "import marimo as mo",
+ "name": "__",
+ "output": null,
+ "ref": {
+ "current": null,
+ },
+ "runElapsedTimeMs": null,
+ "runStartTimestamp": null,
+ "serializedEditorState": null,
+ "status": "idle",
+}
+`;
+
+exports[`cell reducer > can run cell and receive cell messages 4`] = `
+{
+ "code": "import marimo as mo",
+ "consoleOutputs": [],
+ "edited": false,
+ "errored": false,
+ "initialContents": "",
+ "interrupted": false,
+ "key": "0",
+ "lastCodeRun": "import marimo as mo",
+ "name": "__",
+ "output": null,
+ "ref": {
+ "current": null,
+ },
+ "runElapsedTimeMs": null,
+ "runStartTimestamp": null,
+ "serializedEditorState": null,
+ "status": "queued",
+}
+`;
+
+exports[`cell reducer > can run cell and receive cell messages 5`] = `
+{
+ "code": "import marimo as mo",
+ "consoleOutputs": [],
+ "edited": false,
+ "errored": false,
+ "initialContents": "",
+ "interrupted": false,
+ "key": "0",
+ "lastCodeRun": "import marimo as mo",
+ "name": "__",
+ "output": null,
+ "ref": {
+ "current": null,
+ },
+ "runElapsedTimeMs": null,
+ "runStartTimestamp": 20,
+ "serializedEditorState": null,
+ "status": "running",
+}
+`;
+
+exports[`cell reducer > can run cell and receive cell messages 6`] = `
+{
+ "code": "import marimo as mo",
+ "consoleOutputs": [
+ {
+ "channel": "console",
+ "data": "hello!",
+ "mimetype": "text/plain",
+ "timestamp": "",
+ },
+ ],
+ "edited": false,
+ "errored": false,
+ "initialContents": "",
+ "interrupted": false,
+ "key": "0",
+ "lastCodeRun": "import marimo as mo",
+ "name": "__",
+ "output": null,
+ "ref": {
+ "current": null,
+ },
+ "runElapsedTimeMs": null,
+ "runStartTimestamp": 20,
+ "serializedEditorState": null,
+ "status": "running",
+}
+`;
+
+exports[`cell reducer > can run cell and receive cell messages 7`] = `
+{
+ "code": "import marimo as mo",
+ "consoleOutputs": [
+ {
+ "channel": "console",
+ "data": "hello!hello!",
+ "mimetype": "text/plain",
+ "timestamp": "",
+ },
+ ],
+ "edited": false,
+ "errored": false,
+ "initialContents": "",
+ "interrupted": false,
+ "key": "0",
+ "lastCodeRun": "import marimo as mo",
+ "name": "__",
+ "output": {
+ "channel": "output",
+ "data": "ok",
+ "mimetype": "text/plain",
+ "timestamp": "",
+ },
+ "ref": {
+ "current": null,
+ },
+ "runElapsedTimeMs": 13000,
+ "runStartTimestamp": null,
+ "serializedEditorState": null,
+ "status": "idle",
+}
+`;
+
+exports[`cell reducer > can run cell and receive cell messages 8`] = `
+{
+ "code": "import marimo as mo
+import numpy",
+ "consoleOutputs": [
+ {
+ "channel": "console",
+ "data": "hello!hello!",
+ "mimetype": "text/plain",
+ "timestamp": "",
+ },
+ ],
+ "edited": true,
+ "errored": false,
+ "initialContents": "",
+ "interrupted": false,
+ "key": "0",
+ "lastCodeRun": "import marimo as mo",
+ "name": "__",
+ "output": {
+ "channel": "output",
+ "data": "ok",
+ "mimetype": "text/plain",
+ "timestamp": "",
+ },
+ "ref": {
+ "current": null,
+ },
+ "runElapsedTimeMs": 13000,
+ "runStartTimestamp": null,
+ "serializedEditorState": null,
+ "status": "idle",
+}
+`;
+
+exports[`cell reducer > can run cell and receive cell messages 9`] = `
+{
+ "code": "import marimo as mo",
+ "consoleOutputs": [
+ {
+ "channel": "console",
+ "data": "hello!hello!",
+ "mimetype": "text/plain",
+ "timestamp": "",
+ },
+ ],
+ "edited": false,
+ "errored": false,
+ "initialContents": "",
+ "interrupted": false,
+ "key": "0",
+ "lastCodeRun": "import marimo as mo",
+ "name": "__",
+ "output": {
+ "channel": "output",
+ "data": "ok",
+ "mimetype": "text/plain",
+ "timestamp": "",
+ },
+ "ref": {
+ "current": null,
+ },
+ "runElapsedTimeMs": 13000,
+ "runStartTimestamp": null,
+ "serializedEditorState": null,
+ "status": "idle",
+}
+`;
+
+exports[`cell reducer > can run cell and receive cell messages 10`] = `
+{
+ "code": "import marimo as mo
+import numpy",
+ "consoleOutputs": [
+ {
+ "channel": "console",
+ "data": "hello!hello!",
+ "mimetype": "text/plain",
+ "timestamp": "",
+ },
+ ],
+ "edited": true,
+ "errored": false,
+ "initialContents": "",
+ "interrupted": false,
+ "key": "0",
+ "lastCodeRun": "import marimo as mo",
+ "name": "__",
+ "output": {
+ "channel": "output",
+ "data": "ok",
+ "mimetype": "text/plain",
+ "timestamp": "",
+ },
+ "ref": {
+ "current": null,
+ },
+ "runElapsedTimeMs": 13000,
+ "runStartTimestamp": null,
+ "serializedEditorState": null,
+ "status": "idle",
+}
+`;
+
+exports[`cell reducer > can run cell and receive cell messages 11`] = `
+{
+ "code": "import marimo as mo
+import numpy",
+ "consoleOutputs": [
+ {
+ "channel": "console",
+ "data": "hello!hello!",
+ "mimetype": "text/plain",
+ "timestamp": "",
+ },
+ ],
+ "edited": false,
+ "errored": true,
+ "initialContents": "",
+ "interrupted": false,
+ "key": "0",
+ "lastCodeRun": "import marimo as mo
+import numpy",
+ "name": "__",
+ "output": {
+ "channel": "marimo-error",
+ "data": [
+ {
+ "msg": "Oh no!",
+ "type": "exception",
+ },
+ ],
+ "mimetype": "application/vnd.marimo+error",
+ "timestamp": "",
+ },
+ "ref": {
+ "current": null,
+ },
+ "runElapsedTimeMs": null,
+ "runStartTimestamp": null,
+ "serializedEditorState": null,
+ "status": "idle",
+}
+`;
+
+exports[`cell reducer > can run cell and receive cell messages 12`] = `
+{
+ "code": "import marimo as mo
+import numpy",
+ "consoleOutputs": [
+ {
+ "channel": "console",
+ "data": "hello!hello!",
+ "mimetype": "text/plain",
+ "timestamp": "",
+ },
+ ],
+ "edited": false,
+ "errored": false,
+ "initialContents": "",
+ "interrupted": true,
+ "key": "0",
+ "lastCodeRun": null,
+ "name": "__",
+ "output": {
+ "channel": "marimo-error",
+ "data": [
+ {
+ "type": "interruption",
+ },
+ ],
+ "mimetype": "application/vnd.marimo+error",
+ "timestamp": "",
+ },
+ "ref": {
+ "current": null,
+ },
+ "runElapsedTimeMs": 11000,
+ "runStartTimestamp": null,
+ "serializedEditorState": null,
+ "status": "idle",
+}
+`;
diff --git a/frontend/src/core/state/__tests__/cells.test.ts b/frontend/src/core/state/__tests__/cells.test.ts
new file mode 100644
index 0000000000..7596f6c718
--- /dev/null
+++ b/frontend/src/core/state/__tests__/cells.test.ts
@@ -0,0 +1,556 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { beforeEach, describe, expect, it } from "vitest";
+import { CellState, createCell } from "../../model/cells";
+import { CellsAndHistory, exportedForTesting } from "../cells";
+import { CellId } from "@/core/model/ids";
+
+const { initialCellState, reducer } = exportedForTesting;
+
+function formatCells(cells: CellState[]) {
+ return `\n${cells
+ .map((cell) => [`key: ${cell.key}`, `code: '${cell.code}'`].join("\n"))
+ .join("\n\n")}`;
+}
+
+describe("cell reducer", () => {
+ let state: CellsAndHistory;
+ let firstCellKey: CellId;
+
+ beforeEach(() => {
+ CellId.reset();
+
+ state = initialCellState();
+ state.present = [createCell({ key: CellId.create() })];
+ firstCellKey = state.present[0].key;
+ });
+
+ it("can add a cell after another cell", () => {
+ state = reducer(state, {
+ type: "CREATE_CELL",
+ cellKey: firstCellKey,
+ before: false,
+ });
+ expect(formatCells(state.present)).toMatchInlineSnapshot(`
+ "
+ key: 0
+ code: ''
+
+ key: 1
+ code: ''"
+ `);
+ });
+
+ it("can add a cell before another cell", () => {
+ state = reducer(state, {
+ type: "CREATE_CELL",
+ cellKey: firstCellKey,
+ before: true,
+ });
+ expect(formatCells(state.present)).toMatchInlineSnapshot(`
+ "
+ key: 1
+ code: ''
+
+ key: 0
+ code: ''"
+ `);
+ });
+
+ it("can delete a cell", () => {
+ state = reducer(state, {
+ type: "CREATE_CELL",
+ cellKey: firstCellKey,
+ before: false,
+ });
+ state = reducer(state, {
+ type: "DELETE_CELL",
+ cellKey: firstCellKey,
+ });
+ expect(formatCells(state.present)).toMatchInlineSnapshot(`
+ "
+ key: 1
+ code: ''"
+ `);
+
+ // undo
+ state = reducer(state, { type: "UNDO_DELETE_CELL" });
+ expect(formatCells(state.present)).toMatchInlineSnapshot(`
+ "
+ key: 2
+ code: ''
+
+ key: 1
+ code: ''"
+ `);
+ });
+
+ it("can update a cell", () => {
+ state = reducer(state, {
+ type: "UPDATE_CELL_CODE",
+ cellKey: firstCellKey,
+ code: "import numpy as np",
+ formattingChange: false,
+ });
+ expect(formatCells(state.present)).toMatchInlineSnapshot(`
+ "
+ key: 0
+ code: 'import numpy as np'"
+ `);
+ });
+
+ it("can move a cell", () => {
+ state = reducer(state, {
+ type: "CREATE_CELL",
+ cellKey: firstCellKey,
+ before: false,
+ });
+ expect(formatCells(state.present)).toMatchInlineSnapshot(`
+ "
+ key: 0
+ code: ''
+
+ key: 1
+ code: ''"
+ `);
+
+ // move first cell to the end
+ state = reducer(state, {
+ type: "MOVE_CELL",
+ cellKey: firstCellKey,
+ before: false,
+ });
+ expect(formatCells(state.present)).toMatchInlineSnapshot(`
+ "
+ key: 1
+ code: ''
+
+ key: 0
+ code: ''"
+ `);
+
+ // move it back
+ state = reducer(state, {
+ type: "MOVE_CELL",
+ cellKey: firstCellKey,
+ before: true,
+ });
+ expect(formatCells(state.present)).toMatchInlineSnapshot(`
+ "
+ key: 0
+ code: ''
+
+ key: 1
+ code: ''"
+ `);
+ });
+
+ it("can drag and drop a cell", () => {
+ state = reducer(state, {
+ type: "CREATE_CELL",
+ cellKey: firstCellKey,
+ before: false,
+ });
+ state = reducer(state, {
+ type: "CREATE_CELL",
+ cellKey: "1" as CellId,
+ before: false,
+ });
+ expect(formatCells(state.present)).toMatchInlineSnapshot(`
+ "
+ key: 0
+ code: ''
+
+ key: 1
+ code: ''
+
+ key: 2
+ code: ''"
+ `);
+
+ // drag first cell to the end
+ state = reducer(state, {
+ type: "DROP_CELL_OVER",
+ cellKey: firstCellKey,
+ overCellKey: "2" as CellId,
+ });
+ expect(formatCells(state.present)).toMatchInlineSnapshot(`
+ "
+ key: 1
+ code: ''
+
+ key: 2
+ code: ''
+
+ key: 0
+ code: ''"
+ `);
+
+ // drag it back to the middle
+ state = reducer(state, {
+ type: "DROP_CELL_OVER",
+ cellKey: firstCellKey,
+ overCellKey: "2" as CellId,
+ });
+ expect(formatCells(state.present)).toMatchInlineSnapshot(`
+ "
+ key: 1
+ code: ''
+
+ key: 0
+ code: ''
+
+ key: 2
+ code: ''"
+ `);
+ });
+
+ it("can run cell and receive cell messages", () => {
+ // HAPPY PATH
+ /////////////////
+ // Initial state
+ let cell = state.present[0];
+ expect(cell.status).toBe("idle");
+ expect(cell.lastCodeRun).toBe(null);
+ expect(cell.edited).toBe(false);
+ expect(cell).toMatchSnapshot(); // snapshot everything as a catch all
+
+ // Update code
+ state = reducer(state, {
+ type: "UPDATE_CELL_CODE",
+ cellKey: firstCellKey,
+ code: "import marimo as mo",
+ formattingChange: false,
+ });
+ cell = state.present[0];
+ expect(cell.status).toBe("idle");
+ expect(cell.lastCodeRun).toBe(null);
+ expect(cell.edited).toBe(true);
+ expect(cell).toMatchSnapshot(); // snapshot everything as a catch all
+
+ // Prepare for run
+ state = reducer(state, {
+ type: "PREPARE_FOR_RUN",
+ cellKey: firstCellKey,
+ });
+ cell = state.present[0];
+ expect(cell.status).toBe("idle");
+ expect(cell.lastCodeRun).toBe("import marimo as mo");
+ expect(cell.edited).toBe(false);
+ expect(cell).toMatchSnapshot(); // snapshot everything as a catch all
+
+ // Receive queued messages
+ state = reducer(state, {
+ type: "HANDLE_CELL_MESSAGE",
+ cellKey: firstCellKey,
+ message: {
+ cell_id: firstCellKey,
+ output: null,
+ console: null,
+ status: "queued",
+ timestamp: new Date(10).getTime(),
+ },
+ });
+ cell = state.present[0];
+ expect(cell.status).toBe("queued");
+ expect(cell.lastCodeRun).toBe("import marimo as mo");
+ expect(cell.edited).toBe(false);
+ expect(cell.runElapsedTimeMs).toBe(null);
+ expect(cell.runStartTimestamp).toBe(null);
+ expect(cell).toMatchSnapshot(); // snapshot everything as a catch all
+
+ // Receive running messages
+ state = reducer(state, {
+ type: "HANDLE_CELL_MESSAGE",
+ cellKey: firstCellKey,
+ message: {
+ cell_id: firstCellKey,
+ output: null,
+ console: null,
+ status: "running",
+ timestamp: new Date(20).getTime(),
+ },
+ });
+ cell = state.present[0];
+ expect(cell.status).toBe("running");
+ expect(cell.lastCodeRun).toBe("import marimo as mo");
+ expect(cell.edited).toBe(false);
+ expect(cell.runElapsedTimeMs).toBe(null);
+ expect(cell.runStartTimestamp).toBe(20);
+ expect(cell).toMatchSnapshot(); // snapshot everything as a catch all
+
+ // Console messags shouldn't transition status
+ state = reducer(state, {
+ type: "HANDLE_CELL_MESSAGE",
+ cellKey: firstCellKey,
+ message: {
+ cell_id: firstCellKey,
+ output: null,
+ console: {
+ channel: "console",
+ mimetype: "text/plain",
+ data: "hello!",
+ timestamp: "",
+ },
+ status: null,
+ timestamp: new Date(22).getTime(),
+ },
+ });
+ cell = state.present[0];
+ expect(cell.status).toBe("running");
+ expect(cell.edited).toBe(false);
+ expect(cell.runElapsedTimeMs).toBe(null);
+ expect(cell.runStartTimestamp).toBe(20);
+ expect(cell).toMatchSnapshot(); // snapshot everything as a catch all
+
+ // Receive output messages
+ state = reducer(state, {
+ type: "HANDLE_CELL_MESSAGE",
+ cellKey: firstCellKey,
+ message: {
+ cell_id: firstCellKey,
+ output: {
+ channel: "output",
+ mimetype: "text/plain",
+ data: "ok",
+ timestamp: "",
+ },
+ console: {
+ channel: "console",
+ mimetype: "text/plain",
+ data: "hello!",
+ timestamp: "",
+ },
+ status: "idle",
+ timestamp: new Date(33).getTime(),
+ },
+ });
+ cell = state.present[0];
+ expect(cell.status).toBe("idle");
+ expect(cell.edited).toBe(false);
+ expect(cell.runElapsedTimeMs).toBe(13_000);
+ expect(cell.runStartTimestamp).toBe(null);
+ expect(cell).toMatchSnapshot(); // snapshot everything as a catch all
+
+ // EDITING BACK AND FORTH
+ /////////////////
+ // Update code again
+ state = reducer(state, {
+ type: "UPDATE_CELL_CODE",
+ cellKey: firstCellKey,
+ code: "import marimo as mo\nimport numpy",
+ formattingChange: false,
+ });
+ cell = state.present[0];
+ expect(cell.status).toBe("idle");
+ expect(cell.edited).toBe(true);
+ expect(cell).toMatchSnapshot(); // snapshot everything as a catch all
+
+ // Update code should be unedited
+ state = reducer(state, {
+ type: "UPDATE_CELL_CODE",
+ cellKey: firstCellKey,
+ code: "import marimo as mo",
+ formattingChange: false,
+ });
+ cell = state.present[0];
+ expect(cell.edited).toBe(false);
+ expect(cell).toMatchSnapshot(); // snapshot everything as a catch all
+
+ // Update code should be edited again
+ state = reducer(state, {
+ type: "UPDATE_CELL_CODE",
+ cellKey: firstCellKey,
+ code: "import marimo as mo\nimport numpy",
+ formattingChange: false,
+ });
+ cell = state.present[0];
+ expect(cell.status).toBe("idle");
+ expect(cell.lastCodeRun).toBe("import marimo as mo");
+ expect(cell.edited).toBe(true);
+ expect(cell).toMatchSnapshot(); // snapshot everything as a catch all
+
+ // ERROR RESPONSE
+ /////////////////
+ // Prepare for run
+ state = reducer(state, {
+ type: "PREPARE_FOR_RUN",
+ cellKey: firstCellKey,
+ });
+ cell = state.present[0];
+ expect(cell.output).not.toBe(null); // keep old output
+ // Queue
+ state = reducer(state, {
+ type: "HANDLE_CELL_MESSAGE",
+ cellKey: firstCellKey,
+ message: {
+ cell_id: firstCellKey,
+ output: null,
+ console: null,
+ status: "queued",
+ timestamp: new Date(40).getTime(),
+ },
+ });
+ cell = state.present[0];
+ expect(cell.output).not.toBe(null); // keep old output
+ // Running
+ state = reducer(state, {
+ type: "HANDLE_CELL_MESSAGE",
+ cellKey: firstCellKey,
+ message: {
+ cell_id: firstCellKey,
+ output: null,
+ console: null,
+ status: "running",
+ timestamp: new Date(50).getTime(),
+ },
+ });
+ cell = state.present[0];
+ expect(cell.output).not.toBe(null); // keep old output
+ // Receive error
+ state = reducer(state, {
+ type: "HANDLE_CELL_MESSAGE",
+ cellKey: firstCellKey,
+ message: {
+ cell_id: firstCellKey,
+ output: {
+ channel: "marimo-error",
+ mimetype: "application/vnd.marimo+error",
+ data: [{ type: "exception", msg: "Oh no!" }],
+ timestamp: "",
+ },
+ console: null,
+ status: "idle",
+ timestamp: new Date(61).getTime(),
+ },
+ });
+ cell = state.present[0];
+ expect(cell.output).not.toBe(null); // keep old output
+ expect(cell.status).toBe("idle");
+ expect(cell.lastCodeRun).toBe("import marimo as mo\nimport numpy");
+ expect(cell.edited).toBe(false);
+ expect(cell.runElapsedTimeMs).toBe(null);
+ expect(cell.runStartTimestamp).toBe(null);
+ expect(cell).toMatchSnapshot(); // snapshot everything as a catch all
+
+ // INTERRUPT RESPONSE
+ /////////////////
+ // Prepare for run
+ state = reducer(state, {
+ type: "PREPARE_FOR_RUN",
+ cellKey: firstCellKey,
+ });
+ cell = state.present[0];
+ expect(cell.output).not.toBe(null); // keep old output
+ // Queue
+ state = reducer(state, {
+ type: "HANDLE_CELL_MESSAGE",
+ cellKey: firstCellKey,
+ message: {
+ cell_id: firstCellKey,
+ output: null,
+ console: null,
+ status: "queued",
+ timestamp: new Date(40).getTime(),
+ },
+ });
+ cell = state.present[0];
+ expect(cell.output).not.toBe(null); // keep old output
+ // Running
+ state = reducer(state, {
+ type: "HANDLE_CELL_MESSAGE",
+ cellKey: firstCellKey,
+ message: {
+ cell_id: firstCellKey,
+ output: null,
+ console: null,
+ status: "running",
+ timestamp: new Date(50).getTime(),
+ },
+ });
+ cell = state.present[0];
+ expect(cell.output).not.toBe(null); // keep old output
+ // Receive error
+ state = reducer(state, {
+ type: "HANDLE_CELL_MESSAGE",
+ cellKey: firstCellKey,
+ message: {
+ cell_id: firstCellKey,
+ output: {
+ channel: "marimo-error",
+ mimetype: "application/vnd.marimo+error",
+ data: [{ type: "interruption" }],
+ timestamp: "",
+ },
+ console: null,
+ status: "idle",
+ timestamp: new Date(61).getTime(),
+ },
+ });
+ cell = state.present[0];
+ expect(cell.status).toBe("idle");
+ expect(cell.lastCodeRun).toBe(null);
+ expect(cell.edited).toBe(false);
+ expect(cell.runElapsedTimeMs).toBe(11_000);
+ expect(cell.runStartTimestamp).toBe(null);
+ expect(cell).toMatchSnapshot(); // snapshot everything as a catch all
+ });
+
+ it("can format code and update cell", () => {
+ const firstCellKey = state.present[0].key;
+ state = reducer(state, {
+ type: "UPDATE_CELL_CODE",
+ cellKey: firstCellKey,
+ code: "import marimo as mo",
+ formattingChange: false,
+ });
+ let cell = state.present[0];
+ expect(cell.status).toBe("idle");
+ expect(cell.lastCodeRun).toBe(null);
+ expect(cell.edited).toBe(true);
+
+ // Run
+ state = reducer(state, {
+ type: "PREPARE_FOR_RUN",
+ cellKey: firstCellKey,
+ });
+ state = reducer(state, {
+ type: "HANDLE_CELL_MESSAGE",
+ cellKey: firstCellKey,
+ message: {
+ cell_id: firstCellKey,
+ output: {
+ channel: "output",
+ mimetype: "text/plain",
+ data: "ok",
+ timestamp: "",
+ },
+ console: {
+ channel: "console",
+ mimetype: "text/plain",
+ data: "hello!",
+ timestamp: "",
+ },
+ status: "idle",
+ timestamp: new Date(33).getTime(),
+ },
+ });
+
+ // Check steady state
+ cell = state.present[0];
+ expect(cell.status).toBe("idle");
+ expect(cell.edited).toBe(false);
+ expect(cell.lastCodeRun).toBe("import marimo as mo");
+
+ // Format code
+ state = reducer(state, {
+ type: "UPDATE_CELL_CODE",
+ cellKey: firstCellKey,
+ code: "import marimo as mo",
+ formattingChange: true,
+ });
+ cell = state.present[0];
+ expect(cell.status).toBe("idle");
+ expect(cell.lastCodeRun).toBe("import marimo as mo");
+ expect(cell.edited).toBe(false);
+ });
+});
diff --git a/frontend/src/core/state/actions.ts b/frontend/src/core/state/actions.ts
new file mode 100644
index 0000000000..a50c64dbdd
--- /dev/null
+++ b/frontend/src/core/state/actions.ts
@@ -0,0 +1,35 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { atom, useAtomValue, useSetAtom } from "jotai";
+import { HotkeyAction } from "@/core/hotkeys/hotkeys";
+
+/**
+ * Map of registered keyboard shortcuts and their callbacks.
+ */
+const registeredActionsAtom = atom<
+ Partial<Record<HotkeyAction, (() => void) | undefined>>
+>({});
+
+/**
+ * Returns the map of registered keyboard shortcuts and their callbacks.
+ */
+export function useRegisteredActions() {
+ return useAtomValue(registeredActionsAtom);
+}
+
+/**
+ * Returns a hook for registering keyboard shortcuts.
+ */
+export function useSetRegisteredAction() {
+ const set = useSetAtom(registeredActionsAtom);
+ return {
+ registerAction: (shortcut: HotkeyAction, callback: () => void) => {
+ set((actions) => ({ ...actions, [shortcut]: callback }));
+ },
+ unregisterAction: (shortcut: HotkeyAction) => {
+ set((actions) => {
+ const { [shortcut]: _, ...rest } = actions;
+ return rest;
+ });
+ },
+ };
+}
diff --git a/frontend/src/core/state/cell.ts b/frontend/src/core/state/cell.ts
new file mode 100644
index 0000000000..907c818d04
--- /dev/null
+++ b/frontend/src/core/state/cell.ts
@@ -0,0 +1,81 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { CellMessage } from "../kernel/messages";
+import { CellState } from "../model/cells";
+import { collapseConsoleOutputs } from "../model/collapseConsoleOutputs";
+
+export function transitionCell(
+ cell: CellState,
+ message: CellMessage
+): CellState {
+ const nextCell = { ...cell };
+
+ // Handle status transition and update output; message.status !== null
+ // implies a status transition
+ switch (message.status) {
+ case "queued":
+ nextCell.interrupted = false;
+ nextCell.errored = false;
+ // We intentionally don't update lastCodeRun, since the kernel queues
+ // whatever code was last registered with it, which might not match
+ // the cell's current code if the user modified it.
+ break;
+ case "running":
+ nextCell.runStartTimestamp = message.timestamp;
+ break;
+ case "idle":
+ nextCell.output = message.output;
+ if (cell.runStartTimestamp) {
+ nextCell.runElapsedTimeMs =
+ (message.timestamp - cell.runStartTimestamp) * 1000;
+ nextCell.runStartTimestamp = null;
+ }
+ break;
+ }
+ nextCell.status = message.status ?? cell.status;
+
+ // Handle errors: marimo includes an error output when a cell is interrupted
+ // or errored
+ if (
+ message.output !== null &&
+ message.output.mimetype === "application/vnd.marimo+error"
+ ) {
+ if (message.output.data.some((error) => error["type"] === "interruption")) {
+ // This cell needs to be re-run, even if its code contents haven't
+ // changed since it was last run. Force the re-run state by clearing
+ // its lastCodeRun
+ nextCell.lastCodeRun = null;
+ nextCell.interrupted = true;
+ } else {
+ nextCell.errored = true;
+ // The cell didn't actually run.
+ nextCell.runElapsedTimeMs = null;
+ }
+ }
+
+ // Coalesce console outputs, which are streamed during execution.
+ let consoleOutputs = cell.consoleOutputs;
+ if (message.console !== null) {
+ // The kernel sends an empty array to clear the console; otherwise,
+ // message.console is an output that needs to be appended to the
+ // existing console outputs.
+ consoleOutputs = Array.isArray(message.console)
+ ? message.console
+ : collapseConsoleOutputs([...cell.consoleOutputs, message.console]);
+ }
+ nextCell.consoleOutputs = consoleOutputs;
+ return nextCell;
+}
+
+// Should be called when a cell's code is registered with the kernel for
+// execution.
+export function prepareCellForExecution(cell: CellState): CellState {
+ const nextCell = { ...cell };
+
+ nextCell.interrupted = false;
+ nextCell.errored = false;
+ nextCell.edited = false;
+ nextCell.runElapsedTimeMs = null;
+ nextCell.lastCodeRun = cell.code.trim();
+
+ return nextCell;
+}
diff --git a/frontend/src/core/state/cells.ts b/frontend/src/core/state/cells.ts
new file mode 100644
index 0000000000..66f6b9f014
--- /dev/null
+++ b/frontend/src/core/state/cells.ts
@@ -0,0 +1,563 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { atom, useAtomValue, useSetAtom } from "jotai";
+import { useMemo } from "react";
+import { CellMessage } from "../kernel/messages";
+import { CellState, createCell } from "../model/cells";
+import {
+ scrollToBottom,
+ scrollToTop,
+ focusAndScrollCellIntoView,
+} from "../model/scrollCellIntoView";
+import { arrayMove } from "@dnd-kit/sortable";
+import { CellId } from "../model/ids";
+import { prepareCellForExecution, transitionCell } from "./cell";
+
+/* The array of cells on the page, together with a history of
+ * deleted cells to implement an "undo delete" action
+ */
+export interface CellsAndHistory {
+ /**
+ * The array of cells on the page
+ */
+ present: CellState[];
+ /**
+ * Tuples of deleted cells, represented by (cell name, serialized editor
+ * config, and insertion index), so that cell deletion can be undone
+ *
+ * (CodeMirror types the serialized config as any.)
+ */
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ history: Array<[string, any, number]>;
+
+ /**
+ * Key of cell to scroll to; typically set by actions that re-order the cell
+ * array. Call the SCROLL_TO_TARGET action to scroll to the specified cell
+ * and clear this field.
+ */
+ scrollKey: CellId | null;
+}
+
+function initialCellState(): CellsAndHistory {
+ return {
+ present: [],
+ history: [],
+ scrollKey: null,
+ };
+}
+
+export type CellAction =
+ | {
+ type: "SET_CELLS";
+ cells: CellState[];
+ }
+ | {
+ type: "CREATE_CELL";
+ cellKey: CellId;
+ before: boolean;
+ }
+ | {
+ type: "MOVE_CELL";
+ cellKey: CellId;
+ before: boolean;
+ }
+ | {
+ type: "DROP_CELL_OVER";
+ cellKey: CellId;
+ overCellKey: CellId;
+ }
+ | {
+ type: "FOCUS_CELL";
+ cellKey: CellId;
+ before: boolean;
+ }
+ | {
+ type: "FOCUS_TOP_CELL";
+ }
+ | {
+ type: "FOCUS_BOTTOM_CELL";
+ }
+ | {
+ type: "SEND_TO_TOP";
+ cellKey: CellId;
+ }
+ | {
+ type: "SEND_TO_BOTTOM";
+ cellKey: CellId;
+ }
+ | {
+ type: "MOVE_TO_NEXT_CELL";
+ cellKey: CellId;
+ before: boolean;
+ }
+ | {
+ type: "DELETE_CELL";
+ cellKey: CellId;
+ }
+ | {
+ type: "SCROLL_TO_TARGET";
+ }
+ | {
+ type: "UNDO_DELETE_CELL";
+ }
+ | {
+ type: "HANDLE_CELL_MESSAGE";
+ cellKey: CellId;
+ message: CellMessage;
+ }
+ | {
+ type: "UPDATE_CELL_CODE";
+ cellKey: CellId;
+ code: string;
+ /**
+ * Whether or not the update is a formatting change,
+ * if so, the 'edited' state will be handled differently.
+ */
+ formattingChange: boolean;
+ }
+ | {
+ type: "PREPARE_FOR_RUN";
+ cellKey: CellId;
+ }
+ | {
+ type: "FOLD_ALL";
+ }
+ | {
+ type: "UNFOLD_ALL";
+ };
+
+function reducer(state: CellsAndHistory, action: CellAction): CellsAndHistory {
+ switch (action.type) {
+ case "CREATE_CELL": {
+ const { cellKey, before } = action;
+ const index = state.present.findIndex((cell) => cell.key === cellKey);
+ const insertionIndex = before ? index : index + 1;
+ const cell = createCell({ key: CellId.create() });
+
+ return {
+ ...state,
+ present: [
+ ...state.present.slice(0, insertionIndex),
+ cell,
+ ...state.present.slice(insertionIndex),
+ ],
+ };
+ }
+ case "MOVE_CELL": {
+ const { cellKey, before } = action;
+ const index = state.present.findIndex((cell) => cell.key === cellKey);
+ const cell = state.present[index];
+ if (before && index === 0) {
+ return {
+ ...state,
+ present: [cell, ...state.present.slice(1)],
+ scrollKey: cellKey,
+ };
+ } else if (!before && index === state.present.length - 1) {
+ return {
+ ...state,
+ present: [...state.present.slice(0, -1), cell],
+ scrollKey: cellKey,
+ };
+ }
+
+ return before
+ ? {
+ ...state,
+ present: [
+ ...state.present.slice(0, index - 1),
+ cell,
+ state.present[index - 1],
+ ...state.present.slice(index + 1),
+ ],
+ scrollKey: cellKey,
+ }
+ : {
+ ...state,
+ present: [
+ ...state.present.slice(0, index),
+ state.present[index + 1],
+ cell,
+ ...state.present.slice(index + 2),
+ ],
+ scrollKey: cellKey,
+ };
+ }
+ case "DROP_CELL_OVER": {
+ const { cellKey, overCellKey } = action;
+ const fromIndex = state.present.findIndex((cell) => cell.key === cellKey);
+ const toIndex = state.present.findIndex(
+ (cell) => cell.key === overCellKey
+ );
+ return {
+ ...state,
+ present: arrayMove(state.present, fromIndex, toIndex),
+ scrollKey: null,
+ };
+ }
+
+ case "FOCUS_CELL": {
+ if (state.present.length === 0) {
+ return state;
+ }
+
+ const { cellKey, before } = action;
+ const index = state.present.findIndex((cell) => cell.key === cellKey);
+ let focusIndex = before ? index - 1 : index + 1;
+ // clamp
+ focusIndex = Math.max(0, Math.min(focusIndex, state.present.length - 1));
+ // can scroll immediately, without setting scrollKey in state, because
+ // CellArray won't need to re-render
+ focusAndScrollCellIntoView(state.present[focusIndex]);
+ return state;
+ }
+ case "FOCUS_TOP_CELL":
+ if (state.present.length === 0) {
+ return state;
+ }
+
+ state.present[0].ref.current?.editorView.focus();
+ scrollToTop();
+ return state;
+
+ case "FOCUS_BOTTOM_CELL":
+ if (state.present.length === 0) {
+ return state;
+ }
+
+ state.present[state.present.length - 1].ref.current?.editorView.focus();
+ scrollToBottom();
+ return state;
+
+ case "SEND_TO_TOP": {
+ if (state.present.length === 0) {
+ return state;
+ }
+
+ const { cellKey } = action;
+ const index = state.present.findIndex((cell) => cell.key === cellKey);
+ return {
+ ...state,
+ present: [
+ state.present[index],
+ ...state.present.slice(0, index),
+ ...state.present.slice(index + 1),
+ ],
+ scrollKey: cellKey,
+ };
+ }
+ case "SEND_TO_BOTTOM": {
+ if (state.present.length === 0) {
+ return state;
+ }
+
+ const { cellKey } = action;
+ const index = state.present.findIndex((cell) => cell.key === cellKey);
+ return {
+ ...state,
+ present: [
+ ...state.present.slice(0, index),
+ ...state.present.slice(index + 1),
+ state.present[index],
+ ],
+ scrollKey: cellKey,
+ };
+ }
+ case "DELETE_CELL": {
+ const cellKey = action.cellKey;
+ if (state.present.length === 1) {
+ return state;
+ }
+
+ const index = state.present.findIndex((cell) => cell.key === cellKey);
+ const focusIndex = index === 0 ? 1 : index - 1;
+ const scrollKey = state.present[focusIndex].key;
+
+ return {
+ present: [
+ ...state.present.slice(0, index),
+ ...state.present.slice(index + 1),
+ ],
+ history: [
+ ...state.history,
+ [
+ state.present[index].name,
+ state.present[index].ref.current?.editorStateJSON(),
+ index,
+ ],
+ ],
+ scrollKey: scrollKey,
+ };
+ }
+ case "UNDO_DELETE_CELL":
+ if (state.history.length === 0) {
+ return state;
+ } else {
+ const mostRecentlyDeleted = state.history[state.history.length - 1];
+
+ const name = mostRecentlyDeleted[0];
+ const serializedEditorState = mostRecentlyDeleted[1] || {
+ doc: "",
+ };
+ const index = mostRecentlyDeleted[2];
+
+ const cells = [
+ ...state.present.slice(0, index),
+ createCell({
+ key: CellId.create(),
+ name,
+ initialContents: serializedEditorState.doc,
+ code: serializedEditorState.doc,
+ edited: serializedEditorState.doc.trim().length > 0,
+ serializedEditorState,
+ }),
+ ...state.present.slice(index),
+ ];
+
+ return {
+ ...state,
+ present: cells,
+ history: state.history.slice(0, -1),
+ };
+ }
+
+ case "UPDATE_CELL_CODE": {
+ const cellToUpdate = state.present.find(
+ (cell) => cell.key === action.cellKey
+ );
+ if (!cellToUpdate) {
+ return state;
+ }
+ if (cellToUpdate.code === action.code) {
+ return state;
+ }
+
+ return {
+ ...state,
+ present: state.present.map((cell) => {
+ if (cell.key === action.cellKey) {
+ return action.formattingChange
+ ? // Formatting-only change means we can re-use the last code run
+ // if it was not previously edited. And we don't change the edited state.
+ {
+ ...cell,
+ code: action.code,
+ lastCodeRun: cell.edited ? cell.lastCodeRun : action.code,
+ }
+ : {
+ ...cell,
+ code: action.code,
+ edited: action.code.trim() !== cell.lastCodeRun,
+ };
+ }
+ return cell;
+ }),
+ };
+ }
+ case "PREPARE_FOR_RUN": {
+ const cellToUpdate = state.present.find(
+ (cell) => cell.key === action.cellKey
+ );
+ if (!cellToUpdate) {
+ return state;
+ }
+ return {
+ ...state,
+ present: state.present.map((cell) => {
+ if (cell.key === action.cellKey) {
+ return prepareCellForExecution(cellToUpdate);
+ }
+ return cell;
+ }),
+ };
+ }
+ case "HANDLE_CELL_MESSAGE": {
+ const { cellKey, message: body } = action;
+ return {
+ ...state,
+ present: state.present.map((cell) => {
+ return cell.key === cellKey ? transitionCell(cell, body) : cell;
+ }),
+ };
+ }
+ case "SET_CELLS":
+ return {
+ ...state,
+ present: action.cells,
+ };
+ /**
+ * Move focus to next cell
+ *
+ * Creates a new cell if the current cell is the last one in the array.
+ *
+ * If needed, scrolls newly created or focused cell into view.
+ *
+ * Replicates Shift+Enter functionality of Jupyter
+ */
+ case "MOVE_TO_NEXT_CELL": {
+ const { cellKey, before } = action;
+ const index = state.present.findIndex((cell) => cell.key === cellKey);
+ const nextCellIndex = before ? index - 1 : index + 1;
+ // Create a new cell at the end; no need to update scrollKey,
+ // because cell will be created with autoScrollIntoView
+ if (nextCellIndex === state.present.length) {
+ const newCell = createCell({
+ key: CellId.create(),
+ });
+ return {
+ ...state,
+ present: [...state.present, newCell],
+ };
+ // Create a new cell at the beginning; again, no need to update
+ // scrollKey
+ } else if (nextCellIndex === -1) {
+ const newCell = createCell({
+ key: CellId.create(),
+ });
+ return {
+ ...state,
+ present: [newCell, ...state.present],
+ };
+ } else {
+ // Just focus, no state change
+ focusAndScrollCellIntoView(state.present[nextCellIndex]);
+ return state;
+ }
+ }
+ case "SCROLL_TO_TARGET": {
+ // Scroll to the specified cell and clear the scroll key.
+ const scrollKey = state.scrollKey;
+ if (scrollKey === null) {
+ return state;
+ } else {
+ const index = state.present.findIndex((cell) => cell.key === scrollKey);
+
+ // Special-case scrolling to the end of the page: bug in Chrome where
+ // browser fails to scrollIntoView an element at the end of a long page
+ if (index === state.present.length - 1) {
+ state.present[
+ state.present.length - 1
+ ].ref.current?.editorView.focus();
+ scrollToBottom();
+ } else {
+ focusAndScrollCellIntoView(state.present[index]);
+ }
+
+ return {
+ ...state,
+ scrollKey: null,
+ };
+ }
+ }
+ case "FOLD_ALL":
+ state.present.forEach((cell) => {
+ cell.ref.current?.foldAll();
+ });
+ return state;
+ case "UNFOLD_ALL":
+ state.present.forEach((cell) => {
+ cell.ref.current?.unfoldAll();
+ });
+ return state;
+ default:
+ return state;
+ }
+}
+
+const cellsAtom = atom<CellsAndHistory>(initialCellState());
+
+export const useCells = () => useAtomValue(cellsAtom);
+
+/**
+ * Use this hook to dispatch cell actions. This hook will not cause a re-render
+ * when cells change.
+ */
+export function useCellActions() {
+ const setState = useSetAtom(cellsAtom);
+
+ return useMemo(() => {
+ const dispatch = (action: CellAction) => {
+ setState((state) => reducer(state, action));
+ };
+
+ return {
+ updateCellCode: (
+ cellKey: CellId,
+ code: string,
+ formattingChange = false
+ ) =>
+ dispatch({
+ type: "UPDATE_CELL_CODE",
+ cellKey,
+ code,
+ formattingChange,
+ }),
+ prepareForRun: (cellKey: CellId) => {
+ dispatch({ type: "PREPARE_FOR_RUN", cellKey });
+ },
+ createNewCell: (cellKey: CellId, before: boolean) => {
+ dispatch({ type: "CREATE_CELL", cellKey, before });
+ },
+ deleteCell: (cellKey: CellId) => {
+ dispatch({ type: "DELETE_CELL", cellKey });
+ },
+ undoDeleteCell: () => {
+ dispatch({ type: "UNDO_DELETE_CELL" });
+ },
+ focusCell: (cellKey: CellId, before: boolean) => {
+ dispatch({ type: "FOCUS_CELL", cellKey, before });
+ },
+ moveCell: (cellKey: CellId, before: boolean) => {
+ dispatch({ type: "MOVE_CELL", cellKey, before });
+ },
+ dropCellOver: (cellKey: CellId, overCellKey: CellId) => {
+ dispatch({ type: "DROP_CELL_OVER", cellKey, overCellKey });
+ },
+ /* Move focus to next cell
+ *
+ * Creates a new cell if the current cell is the last one in the array.
+ *
+ * If needed, scrolls newly created or focused cell into view.
+ *
+ * Replicates Shift+Enter functionality of Jupyter
+ */
+ moveToNextCell: (cellKey: CellId, before: boolean) => {
+ dispatch({ type: "MOVE_TO_NEXT_CELL", cellKey, before });
+ },
+ setCells: (cells: CellState[]) => {
+ dispatch({ type: "SET_CELLS", cells });
+ },
+ handleCellMessage: (cellKey: CellId, message: CellMessage) => {
+ dispatch({ type: "HANDLE_CELL_MESSAGE", cellKey, message });
+ },
+ focusTopCell: () => {
+ dispatch({ type: "FOCUS_TOP_CELL" });
+ },
+ focusBottomCell: () => {
+ dispatch({ type: "FOCUS_BOTTOM_CELL" });
+ },
+ sendToTop: (cellKey: CellId) => {
+ dispatch({ type: "SEND_TO_TOP", cellKey });
+ },
+ sendToBottom: (cellKey: CellId) => {
+ dispatch({ type: "SEND_TO_BOTTOM", cellKey });
+ },
+ scrollToTarget: () => {
+ dispatch({ type: "SCROLL_TO_TARGET" });
+ },
+ foldAll: () => {
+ dispatch({ type: "FOLD_ALL" });
+ },
+ unfoldAll: () => {
+ dispatch({ type: "UNFOLD_ALL" });
+ },
+ };
+ }, [setState]);
+}
+
+/**
+ * This is exported for testing purposes only.
+ */
+export const exportedForTesting = {
+ reducer,
+ initialCellState,
+};
diff --git a/frontend/src/core/state/connection.ts b/frontend/src/core/state/connection.ts
new file mode 100644
index 0000000000..7bb6918cc3
--- /dev/null
+++ b/frontend/src/core/state/connection.ts
@@ -0,0 +1,11 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { atom } from "jotai";
+import { ConnectionStatus, WebSocketState } from "../websocket/types";
+
+/**
+ * Atom for storing the connection status.
+ * Initialized to CONNECTING.
+ */
+export const connectionAtom = atom<ConnectionStatus>({
+ state: WebSocketState.CONNECTING,
+});
diff --git a/frontend/src/core/state/user-config.ts b/frontend/src/core/state/user-config.ts
new file mode 100644
index 0000000000..aaa2cdcdda
--- /dev/null
+++ b/frontend/src/core/state/user-config.ts
@@ -0,0 +1,15 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { atom, useAtom } from "jotai";
+import { UserConfig, getAppConfig } from "../config";
+
+/**
+ * Atom for storing the user config.
+ */
+const userConfigAtom = atom<UserConfig>(getAppConfig());
+
+/**
+ * Returns the user config.
+ */
+export function useUserConfig() {
+ return useAtom(userConfigAtom);
+}
diff --git a/frontend/src/core/websocket/types.ts b/frontend/src/core/websocket/types.ts
new file mode 100644
index 0000000000..301e2c90ca
--- /dev/null
+++ b/frontend/src/core/websocket/types.ts
@@ -0,0 +1,30 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+
+export enum WebSocketState {
+ CONNECTING = 0,
+ OPEN = 1,
+ CLOSING = 2,
+ CLOSED = 3,
+}
+
+export enum WebSocketClosedReason {
+ KERNEL_DISCONNECTED = "KERNEL_DISCONNECTED",
+ ALREADY_RUNNING = "ALREADY_RUNNING",
+ MALFORMED_QUERY = "MALFORMED_QUERY",
+}
+
+export type ConnectionStatus =
+ | {
+ state: WebSocketState.CLOSED;
+ code: WebSocketClosedReason;
+ /**
+ * Human-readable reason for closing the connection.
+ */
+ reason: string;
+ }
+ | {
+ state:
+ | WebSocketState.CONNECTING
+ | WebSocketState.OPEN
+ | WebSocketState.CLOSING;
+ };
diff --git a/frontend/src/core/websocket/useMarimoWebSocket.tsx b/frontend/src/core/websocket/useMarimoWebSocket.tsx
new file mode 100644
index 0000000000..ea35f4a32f
--- /dev/null
+++ b/frontend/src/core/websocket/useMarimoWebSocket.tsx
@@ -0,0 +1,190 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { WebSocketClosedReason, WebSocketState } from "./types";
+import { useAtom } from "jotai";
+import { connectionAtom } from "../state/connection";
+import { useWebSocket } from "@/core/websocket/useWebSocket";
+import { logNever } from "@/utils/assertNever";
+import { useCellActions } from "@/core/state/cells";
+import { RuntimeState } from "@/core/RuntimeState";
+import { COMPLETION_REQUESTS } from "@/core/codemirror/completion/CompletionRequests";
+import { UI_ELEMENT_REGISTRY } from "@/core/dom/uiregistry";
+import { OperationMessage } from "@/core/kernel/messages";
+import { sendInstantiate } from "../network/requests";
+import { CellId } from "../model/ids";
+import { CellState, createCell } from "../model/cells";
+import { useErrorBoundary } from "react-error-boundary";
+
+/**
+ * WebSocket that connects to the Marimo kernel and handles incoming messages.
+ */
+export function useMarimoWebSocket(opts: {
+ sessionId: string;
+ setCells: (cells: CellState[]) => void;
+ setInitialCodes: (codes: string[]) => void;
+}) {
+ const { sessionId, setCells, setInitialCodes } = opts;
+ const { showBoundary } = useErrorBoundary();
+
+ const { handleCellMessage } = useCellActions();
+ const [connStatus, setConnStatus] = useAtom(connectionAtom);
+
+ const ws = useWebSocket({
+ /**
+ * Unique URL for this session.
+ */
+ url: createWsUrl(sessionId),
+
+ /**
+ * Open callback. Set the connection status to open.
+ */
+ onOpen: () => {
+ setConnStatus({ state: WebSocketState.OPEN });
+ },
+
+ /**
+ * Message callback. Handle messages sent by the kernel.
+ */
+ onMessage: (e: MessageEvent<string>) => {
+ const msg: OperationMessage = JSON.parse(e.data);
+ switch (msg.op) {
+ case "kernel-ready": {
+ const { codes, names } = msg.data;
+
+ // TODO(akshayka): Get rid of this once the kernel sends cell IDs in
+ // kernel-ready.
+ CellId.reset();
+
+ // Set the initial codes and cells
+ const cells = codes.map((code, i) =>
+ createCell({
+ key: CellId.create(),
+ code,
+ initialContents: code,
+ name: names[i],
+ })
+ );
+ setCells(cells);
+ setInitialCodes(codes);
+
+ // Auto-instantiate, in future this can be configurable
+ // or include initial values
+ const objectIds: string[] = [];
+ const values: unknown[] = [];
+ // If we already have values for some objects, we should
+ // send them to the kernel. This may happen after re-connecting
+ // to the kernel after the computer wakes from sleep.
+ UI_ELEMENT_REGISTRY.entries.forEach((entry, objectId) => {
+ objectIds.push(objectId);
+ values.push(entry.value);
+ });
+ // Start the run
+ RuntimeState.INSTANCE.registerRunStart();
+ // Send the instantiate message
+ sendInstantiate({ objectIds, values }).catch((error) => {
+ showBoundary(new Error("Failed to instantiate", { cause: error }));
+ });
+ return;
+ }
+ case "completed-run":
+ case "interrupted":
+ if (msg.op === "completed-run") {
+ RuntimeState.INSTANCE.registerRunEnd();
+ }
+
+ if (!RuntimeState.INSTANCE.running()) {
+ RuntimeState.INSTANCE.flushUpdates();
+ }
+ return;
+ case "remove-ui-elements": {
+ // This removes the element from the registry to (1) clean-up
+ // memory and (2) make sure that the old value doesn't get re-used
+ // if the same cell-id is later reused for another element.
+ const { cell_id } = msg.data;
+ UI_ELEMENT_REGISTRY.removeElementsByCell(cell_id);
+ return;
+ }
+ case "completion-result":
+ COMPLETION_REQUESTS.resolve(msg.data);
+ return;
+ case "cell-op": {
+ /* Register a state transition for a cell.
+ *
+ * The cell may have a new output, a new console output,
+ * it may have been queued, it may have started running, or
+ * it may have stopped running. Each of these things
+ * affects how the cell should be rendered.
+ */
+ const body = msg.data;
+ handleCellMessage(body.cell_id, body);
+ return;
+ }
+ default:
+ logNever(msg);
+ }
+ },
+
+ /**
+ * Handle a close event. We may want to reconnect.
+ */
+ onClose: (e) => {
+ switch (e.reason) {
+ case "MARIMO_ALREADY_CONNECTED":
+ setConnStatus({
+ state: WebSocketState.CLOSED,
+ code: WebSocketClosedReason.ALREADY_RUNNING,
+ reason: "another browser tab is already connected to the kernel",
+ });
+ ws.current?.close(); // close to prevent reconnecting
+ return;
+
+ case "MARIMO_WRONG_KERNEL_ID":
+ case "MARIMO_SHUTDOWN":
+ setConnStatus({
+ state: WebSocketState.CLOSED,
+ code: WebSocketClosedReason.KERNEL_DISCONNECTED,
+ reason: "kernel not found",
+ });
+ ws.current?.close(); // close to prevent reconnecting
+ return;
+
+ case "MARIMO_MALFORMED_QUERY":
+ setConnStatus({
+ state: WebSocketState.CLOSED,
+ code: WebSocketClosedReason.MALFORMED_QUERY,
+ reason:
+ "the kernel did not recognize a request; please file a bug with marimo",
+ });
+ return;
+
+ default:
+ // Session should be valid
+ // - browser tab might have been closed or re-opened
+ // - computer might have just woken from sleep
+ //
+ // so try reconnecting.
+ setConnStatus({ state: WebSocketState.CONNECTING });
+ ws.current?.reconnect();
+ }
+ },
+
+ /**
+ * When we encounter an error, we should close the connection.
+ */
+ onError: (e) => {
+ setConnStatus({
+ state: WebSocketState.CLOSED,
+ code: WebSocketClosedReason.KERNEL_DISCONNECTED,
+ reason: "kernel not found",
+ });
+ ws.current?.close();
+ },
+ });
+
+ return { connStatus };
+}
+
+function createWsUrl(sessionId: string): string {
+ const protocol = window.location.protocol === "https:" ? "wss" : "ws";
+
+ return `${protocol}://${window.location.host}/iosocket?session_id=${sessionId}`;
+}
diff --git a/frontend/src/core/websocket/useWebSocket.tsx b/frontend/src/core/websocket/useWebSocket.tsx
new file mode 100644
index 0000000000..14d8fcdbf4
--- /dev/null
+++ b/frontend/src/core/websocket/useWebSocket.tsx
@@ -0,0 +1,52 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useEffect, useRef } from "react";
+import ReconnectingWebSocket from "partysocket/ws";
+
+interface UseWebSocketOptions {
+ url: string;
+ onOpen?: (event: WebSocketEventMap["open"]) => void;
+ onMessage?: (event: WebSocketEventMap["message"]) => void;
+ onClose?: (event: WebSocketEventMap["close"]) => void;
+ onError?: (event: WebSocketEventMap["error"]) => void;
+}
+
+/**
+ * A hook for creating a WebSocket connection with React.
+ *
+ * We use the WebSocket from partysocket, which is a wrapper around the native WebSocket API with reconnect logic.
+ */
+export function useWebSocket(options: UseWebSocketOptions) {
+ const { onOpen, onMessage, onClose, onError, ...rest } = options;
+
+ const wsRef = useRef<ReconnectingWebSocket>();
+
+ useEffect(() => {
+ wsRef.current = new ReconnectingWebSocket(rest.url, undefined, {
+ // We don't want Infinity retries
+ maxRetries: 10,
+ debug: false,
+ });
+
+ const socket = wsRef.current;
+ onOpen && socket.addEventListener("open", onOpen);
+ onClose && socket.addEventListener("close", onClose);
+ onError && socket.addEventListener("error", onError);
+ onMessage && socket.addEventListener("message", onMessage);
+
+ return () => {
+ onOpen && socket.removeEventListener("open", onOpen);
+ onClose && socket.removeEventListener("close", onClose);
+ onError && socket.removeEventListener("error", onError);
+ onMessage && socket.removeEventListener("message", onMessage);
+ };
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+
+ useEffect(() => {
+ const socket = wsRef.current;
+ return () => socket?.close();
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+
+ return wsRef;
+}
diff --git a/frontend/src/css/App.css b/frontend/src/css/App.css
new file mode 100644
index 0000000000..e27214da74
--- /dev/null
+++ b/frontend/src/css/App.css
@@ -0,0 +1,92 @@
+@import url("Header.css");
+@import url("Cell.css");
+@import url("md.css");
+@import url("table.css");
+@import url("CodeMirrorSearchPanel.css");
+
+/* stylelint-disable unit-allowed-list */
+/* On smaller screens, scale everything down so more fits on the page. */
+html {
+ font-size: 90%;
+}
+
+@media screen and (height >= 1000px) {
+ html {
+ font-size: 100%;
+ }
+}
+/* stylelint-enable unit-allowed-list */
+
+:root {
+ --content-width: 740px;
+ --base-shadow: hsl(0deg 0% 85% / 40%);
+ --stale-color: hsl(42deg 56% 44% / 25%);
+ --light-shadow: 2px 2px 0px 0px var(--base-shadow),
+ 0px 0px 2px 0px hsl(0deg 0% 25% / 50%);
+ --light-shadow-stale: 4px 4px 0px 0px var(--stale-color),
+ 0px 0px 4px 0px var(--stale-color);
+ --light-shadow-error: 4px 4px 0px 0px hsl(var(--error) / 80%),
+ 0px 0px 2px 0px hsl(var(--error) / 80%);
+ --medium-shadow: 4px 4px 0px 0px var(--base-shadow),
+ 0px 0px 4px 0px hsl(0deg 0% 60% / 50%);
+ --medium-shadow-stale: 6px 6px 0px 0px var(--stale-color),
+ 0px 0px 4px 0px var(--stale-color);
+ --medium-shadow-error: 6px 6px 0px 0px hsl(var(--error) / 80%),
+ 0px 0px 2px 0px hsl(var(--error) / 80%);
+ --heavy-shadow: 5px 6px 0px 0px var(--base-shadow),
+ 0px 0px 4px 0px hsl(0deg 0% 75% / 50%);
+ --heavy-shadow-stale: 7px 8px 0px 0px var(--stale-color),
+ 0px 0px 4px 0px var(--stale-color);
+ --heavy-shadow-error: 7px 8px 0px 0px hsl(var(--error) / 80%),
+ 0px 0px 2px 0px hsl(var(--error) / 80%);
+ --monospace-font: "Fira Mono";
+ --text-font: "PT Sans", sans-serif;
+}
+
+#App {
+ position: relative;
+ margin: auto;
+ z-index: 1;
+}
+
+.disconnected-gradient {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100vw;
+ height: 100vh;
+
+ /* gradient sits behind noise. */
+ z-index: -2;
+
+ /* Use an image because hard to get consistent result across browsers with
+ * css gradients. */
+ background-image: url("/gradient.png");
+ background-repeat: no-repeat;
+
+ /* Scale gradient with zoom in/out. */
+ background-size: cover;
+}
+
+.noise {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100vw;
+ height: 100vh;
+ z-index: -1;
+ background-image: url("/noise.png");
+ background-repeat: repeat;
+ opacity: 0.5;
+}
+
+#App.disconnected {
+ background: none;
+}
+
+.inactive-button,
+.inactive-button:hover,
+.inactive-button svg {
+ color: var(--gray-7);
+ cursor: default;
+}
diff --git a/frontend/src/css/Cell.css b/frontend/src/css/Cell.css
new file mode 100644
index 0000000000..8b924a3c43
--- /dev/null
+++ b/frontend/src/css/Cell.css
@@ -0,0 +1,527 @@
+.Cell {
+ position: relative;
+ margin-bottom: 21px;
+ border-radius: 10px;
+ max-width: inherit;
+ width: 100%;
+ border: 1px solid transparent;
+ box-shadow: var(--light-shadow);
+
+ @apply bg-background;
+}
+
+.dark .Cell {
+ @apply border-border;
+}
+
+#App.disconnected .Cell {
+ /* Background determined by disconnected gradient/noise. */
+ background-color: transparent;
+}
+
+.Cell:hover {
+ box-shadow: var(--medium-shadow);
+}
+
+.Cell.has-error,
+.Cell.error-outline {
+ outline: 1px solid var(--red-4);
+ box-shadow: var(--light-shadow-error);
+}
+
+.Cell.has-error:hover {
+ box-shadow: var(--medium-shadow-error);
+}
+
+.Cell:not(.published).has-error:focus-within {
+ box-shadow: var(--heavy-shadow-error);
+}
+
+.Cell.error-outline,
+.Cell:not(.published).error-outline:focus-within {
+ box-shadow: 8px 8px 0 0 hsl(var(--error) / 80%);
+ background-color: var(--red-2);
+}
+
+.Cell:focus-visible {
+ /* focus-visible outlines the entire cell body in black, but the cell's
+ * body is an irregular shape because of psuedo-elements that extend
+ * its hit-box / hover area. */
+ outline: none;
+}
+
+.Cell:not(.published):focus-within {
+ border: 1px solid var(--gray-5);
+
+ /* a sharp box shadow with a slight blur to outline the element */
+ box-shadow: var(--heavy-shadow);
+
+ /* a little bit of motion
+ *
+ * Note: we use left/top instead of transform because transform creates a new
+ * stacking context and makes completion tooltip appear below surrounding
+ * cells/outputs. See
+ *
+ * https://stackoverflow.com/questions/20851452/z-index-is-canceled-by-setting-transformrotate,
+ * https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
+ * */
+ left: -1px;
+ top: -1px;
+}
+
+.tray {
+ display: flex;
+ position: relative;
+}
+
+.tray:first-child .cm-editor {
+ border-top-left-radius: 10px;
+ border-top-right-radius: 10px;
+}
+
+.tray:last-child .cm-editor {
+ border-bottom-left-radius: 10px;
+ border-bottom-right-radius: 10px;
+}
+
+.tray::before {
+ /* expand the hover area */
+ content: "";
+ position: absolute;
+ width: 2000px;
+ left: -1000px;
+ height: 100%;
+}
+
+/* -------------------------- Shoulders/Buttons ---------------------------- */
+.Cell .shoulder-left {
+ position: absolute;
+ left: -34px;
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ justify-content: center;
+ height: 100%;
+}
+
+.shoulder-elem-top {
+ margin-bottom: auto;
+}
+
+.shoulder-elem-bottom {
+ vertical-align: bottom;
+}
+
+#App.disconnected .Cell .ShoulderButton {
+ background-color: transparent;
+}
+
+.Cell .shoulder-right {
+ display: inline-flex;
+ flex-direction: column;
+ justify-content: flex-end;
+ height: 100%;
+ position: absolute;
+ right: -98px;
+ width: 80px;
+}
+
+.Cell .shoulder-bottom {
+ position: absolute;
+ bottom: -2px;
+ right: 2px;
+ z-index: 1; /* lie above editor */
+}
+
+/* --------------------------- Status Indicators ---------------------------- */
+.cell-status-icon {
+ margin-top: 4px;
+ margin-left: 3px;
+ margin-bottom: auto;
+}
+
+@keyframes appear {
+ from {
+ visibility: visible;
+ }
+
+ to {
+ visibility: visible;
+ }
+}
+
+.elapsed-time {
+ font-family: var(--monospace-font);
+ font-size: 0.8125rem;
+ color: var(--gray-11);
+}
+
+.elapsed-time.running {
+ animation: appear 1000ms;
+ animation-timing-function: linear;
+ animation-iteration-count: infinite;
+ animation-delay: 50ms;
+}
+
+#App.disconnected .elapsed-time {
+ visibility: hidden;
+}
+
+.cell-status-queued,
+.cell-status-stale {
+ animation: appear 1000ms;
+ animation-timing-function: linear;
+ animation-iteration-count: infinite;
+ animation-delay: 100ms;
+}
+
+.cell-status-queued svg,
+.cell-status-stale svg {
+ color: var(--gray-10);
+ width: 16px;
+ height: 16px;
+}
+
+/* ------------------------ CodeMirror Editor ----------------------------- */
+
+.cm {
+ width: 100%;
+}
+
+.cm-editor {
+ font-size: 0.875rem;
+ border: 1px solid transparent;
+ padding: 3px;
+
+ /* leave some room for UI elements inside the code editor */
+ padding-right: 24px;
+}
+
+/* .Cell is needed to take precedence over codemirror's generated class ... */
+.Cell .cm-editor.cm-focused {
+ outline: 0;
+}
+
+.Cell .cm-editor.cm-focused .cm-activeLineGutter {
+ background: #e2f2ff;
+}
+
+.dark .Cell .cm-editor.cm-focused .cm-activeLineGutter {
+ background: #0e1e25;
+}
+
+.Cell .cm-editor .cm-activeLineGutter {
+ background: transparent;
+}
+
+.Cell .cm-editor.cm-focused .cm-activeLine {
+ background: hsl(210deg 100% 50% / 3%);
+}
+
+.dark .Cell .cm-editor.cm-focused .cm-activeLine {
+ background: hsl(210deg 100% 2% / 75%);
+}
+
+#App.disconnected .Cell .cm-editor.cm-focused .cm-activeLineGutter,
+#App.disconnected .Cell .cm-editor.cm-focused .cm-activeLine {
+ background: transparent;
+}
+
+.Cell .cm-editor .cm-activeLine {
+ background: transparent;
+
+ /* Soften the corners of the active-line highlight. */
+ border-radius: 2px;
+}
+
+.cm .cm-gutters {
+ @apply bg-background;
+
+ /* Style line numbers. */
+ font-size: 0.75rem;
+ color: var(--gray-10);
+}
+
+.dark .cm .cm-gutters {
+ background-color: transparent;
+}
+
+.disconnected .cm .cm-gutters {
+ background-color: transparent !important;
+}
+
+.cm-scroller {
+ overflow: auto;
+}
+
+/* Code completion pop-up. */
+.cm .cm-tooltip {
+ font-family: var(--monospace-font);
+ font-size: 0.875rem;
+ border: none;
+ box-shadow: var(--light-shadow);
+ border-radius: 4px 0 4px 4px;
+
+ @apply bg-popover;
+}
+
+.cm .cm-tooltip-autocomplete ul li[aria-selected] {
+ background: #1177ccb0;
+}
+
+.dark .cm .cm-tooltip-autocomplete ul li[aria-selected] {
+ background: #1177cc80;
+}
+
+/* Code completion pop-up for docstrings, type-hints and completion info. */
+.cm .cm-tooltip.cm-completionInfo {
+ max-height: 800px;
+ overflow: auto;
+
+ /* Respect newlines. */
+ white-space: pre-wrap;
+
+ /* Codemirror generates an inline style for these properties,
+ * so we have to override them with !important. */
+ top: 0 !important;
+
+ /* Completion Info shows up to the right of another menu item. */
+ border-radius: 0 4px 4px;
+ padding: 0.625rem 0.875rem;
+}
+
+.cm .cm-tooltip.cm-completionInfo pre {
+ margin: 0;
+ white-space: pre-wrap;
+}
+
+.cm .cm-completionIcon-function::after {
+ content: "λ";
+}
+
+.cm .cm-completionIcon-class::after {
+ content: "τ";
+}
+
+.cm .cm-completionIcon-module::after {
+ content: "μ";
+}
+
+.cm .cm-completionIcon-statement::after {
+ content: "χ";
+}
+
+.cm .cm-completionIcon-keyword::after {
+ content: "κ";
+}
+
+#App.disconnected .cell-running-icon,
+#App.disconnected .cell-queued-icon {
+ visibility: hidden;
+ animation: none;
+}
+
+/* ------------------------------ Output Areas ------------------------------ */
+
+.OutputArea,
+.ConsoleOutputArea {
+ max-width: inherit;
+ width: 100%;
+
+ /* Prevent floated elements from extending out of the output areas and into
+ * the editor. */
+ clear: both;
+ display: flow-root;
+
+ /* TODO: Find a way to accommodate large elements, ideally in a way that
+ * doesn't break margin collapse. Setting overflow (eg, overflow: auto)
+ * breaks margin collapse. */
+}
+
+/* Only restrain output length in edit mode. */
+.Cell:not(.published) .OutputArea,
+.ConsoleOutputArea {
+ max-height: 600px;
+ overflow: auto;
+}
+
+.marimo-output-stale {
+ opacity: 0.2;
+ transition: opacity 300ms;
+ transition-delay: 200ms;
+}
+
+.OutputArea {
+ padding: 0.5% 4%;
+ border: 1px solid transparent;
+ border-bottom: 1px solid var(--gray-5);
+}
+
+.ConsoleOutputArea {
+ padding: 20px;
+ border-radius: 0 0 8px 8px;
+ border-top: 1px solid var(--gray-5);
+ border-bottom: 1px solid var(--gray-3);
+ border-right: 1px solid var(--gray-3);
+ border-left: 1px solid var(--gray-3);
+ background-color: var(--gray-1);
+}
+
+#App.disconnected .ConsoleOutputArea {
+ /* Background determined by disconnected gradient/noise. */
+ background-color: transparent;
+ border: 1px solid transparent;
+}
+
+/* ------------------------------- Published -------------------------------- */
+
+.Cell.published .OutputArea {
+ /* flow-root interferes with margin collapsing, but appears to be unneeded
+ * when cell outlines are hidden; clear:both is sufficient.
+ *
+ * if developers just use css-grid instead of float, this won't matter.
+ * */
+ display: block;
+ padding-top: 0%;
+ padding-bottom: 0%;
+}
+
+/* We remove all borders and vertical padding to make sure that margins
+ * collapse across cells. Removing the borders will cause a 1px shift/jump,
+ * but nothing can be done about that. */
+.Cell.published:hover {
+ border: none;
+ box-shadow: none;
+}
+
+.Cell.published:focus-within {
+ transform: none;
+}
+
+.Cell:focus-within .cm-editor {
+ box-shadow: none;
+ border: 1px solid transparent;
+ border-radius: 0;
+}
+
+.Cell.published {
+ margin-bottom: 0;
+}
+
+.Cell.published,
+.Cell.published .OutputArea,
+.Cell.published .ConsoleOutputArea {
+ border: none;
+ box-shadow: none;
+}
+
+/* ------------------------------ Needs Run---------------------------------- */
+.Cell.needs-run {
+ box-shadow: var(--light-shadow-stale);
+}
+
+.Cell.needs-run:hover {
+ box-shadow: var(--medium-shadow-stale);
+}
+
+.Cell.needs-run:focus-within {
+ box-shadow: var(--heavy-shadow-stale);
+}
+
+.Cell.needs-run:focus-within .cm-editor {
+ box-shadow: none;
+ border: 1px solid transparent;
+ border-radius: 0;
+}
+
+.Cell.needs-run .OutputArea {
+ border-bottom: 1px solid var(--stale-color);
+}
+
+.Cell.needs-run .RunButton {
+ visibility: visible;
+}
+
+/* ------------------------ Output Formatting ---------------------------- */
+.output,
+.media,
+.stdout,
+.stderr,
+.return,
+.marimo-error {
+ width: 100%;
+}
+
+.output {
+ margin-top: 1rem;
+ margin-bottom: 1rem;
+}
+
+.marimo-error a {
+ color: hsl(var(--link));
+}
+
+.output > * {
+ max-width: 100%;
+}
+
+.stdout,
+.stderr,
+.marimo-error,
+.Cell .cm-content {
+ font-family: var(--monospace-font);
+}
+
+.stdout,
+.stderr {
+ font-size: 0.813rem;
+}
+
+.Cell .cm-content {
+ font-size: 0.875rem;
+}
+
+.marimo-error,
+.stderr {
+ color: hsl(var(--error));
+ font-weight: bold;
+}
+
+.marimo-error {
+ background: #ffc0cb30;
+ padding: 3%;
+ font-size: 0.8125rem;
+ border-radius: 20px;
+ white-space: pre-wrap; /* respect newlines */
+}
+
+.return {
+ display: block;
+}
+
+.text-plain {
+ white-space: pre-wrap; /* respect newlines */
+}
+
+.output.text-plain {
+ font-family: var(--text-font);
+}
+
+.marimo-json-output {
+ padding-top: 2px;
+ padding-bottom: 2px;
+
+ /* content-visiblity is set by material UI;
+ * when set on an element that has overflow auto, causes abrupt jumps when
+ * scrolling in Chrome */
+ content-visibility: unset;
+
+ /* Coarse hack to stop children from overflowing; doesn't seem to affect
+ * margin collapse. */
+ overflow: auto;
+}
+
+.marimo-json-output .data-key-pair:not(:last-child) {
+ margin-top: 0.2rem;
+ margin-bottom: 0.2rem;
+}
diff --git a/frontend/src/css/CodeMirrorSearchPanel.css b/frontend/src/css/CodeMirrorSearchPanel.css
new file mode 100644
index 0000000000..b065737820
--- /dev/null
+++ b/frontend/src/css/CodeMirrorSearchPanel.css
@@ -0,0 +1,67 @@
+.cm-editor .cm-panels.cm-panels-bottom {
+ border: 1px solid hsl(var(--input) / 20%);
+ background-color: hsl(var(--muted));
+ border-radius: 14px;
+ margin-bottom: 0.5rem;
+ width: fit-content;
+ margin-left: auto;
+ margin-right: auto;
+ box-shadow: var(--shadow-lg);
+}
+
+.cm-editor .cm-panel.cm-search {
+ font-family: var(--text-font);
+ padding: 1rem 2rem 1rem 1rem;
+}
+
+.cm-editor .cm-panel.cm-search input[type="checkbox"] {
+ vertical-align: middle;
+}
+
+.cm-editor .cm-panel.cm-search input.cm-textfield {
+ border-radius: 4px;
+ box-shadow: var(--shadow-xs-solid);
+ border: 1px solid transparent;
+ font-size: 0.75rem;
+}
+
+.cm-editor .cm-panel.cm-search input.cm-textfield:hover {
+ box-shadow: var(--shadow-sm-solid);
+}
+
+.cm-editor .cm-panel.cm-search input.cm-textfield:active,
+.cm-editor .cm-panel.cm-search input.cm-textfield:focus,
+.cm-editor .cm-panel.cm-search input.cm-textfield:focus-visible {
+ border: 1px solid hsl(var(--accent));
+ outline: none;
+}
+
+.cm-editor .cm-panel.cm-search label {
+ color: hsl(var(--muted-foreground));
+ font-size: 0.75rem;
+}
+
+.cm-editor .cm-panel.cm-search button:not([name="close"]) {
+ border-radius: calc(var(--radius) - 2px);
+ border-color: hsl(var(--input) / 80%);
+ box-shadow: var(--shadow-xs-solid);
+ background-color: hsl(var(--secondary));
+ background-image: none;
+ font-size: 0.75rem;
+}
+
+.cm-editor .cm-panel.cm-search button:hover:not([name="close"]),
+.cm-editor .cm-panel.cm-search button:active:not([name="close"]),
+.cm-editor .cm-panel.cm-search button:focus:not([name="close"]),
+.cm-editor .cm-panel.cm-search button:focus-visible:not([name="close"]) {
+ background-color: hsl(var(--card));
+}
+
+.cm-editor .cm-panel.cm-search button:active {
+ box-shadow: var(--shadow-xs);
+}
+
+.cm-editor .cm-panel.cm-search [name="close"] {
+ font-size: 1rem;
+ margin-right: 0.25rem;
+}
diff --git a/frontend/src/css/Header.css b/frontend/src/css/Header.css
new file mode 100644
index 0000000000..792db332f8
--- /dev/null
+++ b/frontend/src/css/Header.css
@@ -0,0 +1,173 @@
+#Header {
+ padding-bottom: 10px;
+ padding-top: 60px;
+ margin-bottom: 20px;
+}
+
+#Disconnected {
+ font-family: var(--monospace-font);
+ text-align: center;
+ font-size: 1rem;
+ font-weight: 400;
+ color: var(--red-11);
+}
+
+#Welcome {
+ max-width: var(--content-width);
+ margin: auto;
+ display: grid;
+
+ /* center filename input , with whitespace on either side */
+ grid-template-columns: 1fr auto 1fr;
+}
+
+#Welcome > div:first-child {
+ position: relative;
+ grid-column: 2;
+}
+
+@keyframes running-app-animation {
+ 0% {
+ transform: rotate(0turn);
+ visibility: visible;
+ }
+
+ 50% {
+ transform: rotate(0.5turn);
+ visibility: visible;
+ }
+
+ 100% {
+ transform: rotate(1turn);
+ visibility: visible;
+ }
+}
+
+.running-app-icon {
+ width: 45px;
+ visibility: hidden;
+ animation: running-app-animation 2000ms;
+ animation-timing-function: cubic-bezier(0.61, -0.01, 0.47, 0.99);
+ animation-iteration-count: infinite;
+ animation-delay: 1000ms;
+}
+
+.closed-app-icon {
+ width: 25px;
+ height: 25px;
+ color: var(--red-11);
+}
+
+.app-status-indicator {
+ position: fixed;
+ left: 20px;
+ top: 12px;
+}
+
+.keyboard-shortcut-group {
+ margin-bottom: 40px;
+}
+
+.keyboard-shortcut {
+ /* [shortcut] [auto:whitespace] [description] */
+ grid-template-columns: 1fr auto 1fr;
+ display: grid;
+ margin: 15px 5px;
+ align-items: baseline;
+}
+
+.keyboard-shortcut span {
+ grid-column: 3;
+}
+
+#Filename {
+ text-align: center;
+ margin-bottom: 25px;
+ font-family: var(--monospace-font);
+
+ @apply text-muted-foreground;
+}
+
+.missing-filename {
+ text-align: center;
+ box-shadow: var(--light-shadow-stale);
+}
+
+.missing-filename:hover,
+.missing-filename:focus {
+ box-shadow: var(--medium-shadow-stale);
+}
+
+.missing-filename:focus {
+ border-radius: 4px 4px 0 0;
+}
+
+.filename {
+ text-align: center;
+ box-shadow: none;
+}
+
+.filename:hover,
+.filename:focus {
+ box-shadow: var(--medium-shadow);
+}
+
+.filename:focus {
+ border-radius: 4px 4px 0 0;
+}
+
+#filename-form {
+ display: contents;
+}
+
+#filename-input:focus {
+ min-width: 200px;
+}
+
+.DirCompletionInput {
+ position: relative;
+}
+
+.autocomplete-list {
+ padding: 0;
+ margin-top: 0;
+ border-top-width: 0;
+ border-radius: 0 0 5px 5px;
+ max-height: 200px;
+ overflow-y: auto;
+ text-align: left;
+ list-style: none;
+ z-index: 1;
+ position: absolute;
+ box-shadow: var(--medium-shadow);
+
+ @apply bg-card;
+}
+
+.autocomplete-list li {
+ padding: 3px;
+}
+
+.autocomplete-list li:not(:last-of-type) {
+ border-bottom: 1px dashed var(--gray-9);
+}
+
+.active-suggestion,
+.autocomplete-list li:hover {
+ background-color: var(--grass-4);
+ cursor: pointer;
+}
+
+.active-suggestion {
+ border-left: 2px solid var(--grass-11);
+}
+
+.active-suggestion.file,
+.autocomplete-list li.file:hover {
+ border-left: 2px solid var(--gray-11);
+ background-color: var(--gray-2);
+}
+
+.file {
+ color: var(--gray-10);
+}
diff --git a/frontend/src/css/codehilite.css b/frontend/src/css/codehilite.css
new file mode 100644
index 0000000000..9c8df789cb
--- /dev/null
+++ b/frontend/src/css/codehilite.css
@@ -0,0 +1,361 @@
+/*
+ * xcode pygments style, edited to look like github prettylights
+ *
+ * pygmentize -S xcode -f html -a .codehilite > codehilite.css
+ */
+
+@layer base {
+ :root {
+ --linenos-special: #000;
+ --linenos-special-bg: #ffffc0;
+ --codehilite-hll: #ffc;
+ --codehilite-c: #177500;
+ --codehilite-err: #000;
+ --codehilite-k: #cf222e;
+ --codehilite-l: #1c01ce;
+ --codehilite-n: #000;
+ --codehilite-o: #000;
+ --codehilite-ch: #177500;
+ --codehilite-cm: #177500;
+ --codehilite-cp: #633820;
+ --codehilite-cpf: #177500;
+ --codehilite-c1: #177500;
+ --codehilite-cs: #177500;
+ --codehilite-kc: #a90d91;
+ --codehilite-kd: #a90d91;
+ --codehilite-kn: #a90d91;
+ --codehilite-kp: #a90d91;
+ --codehilite-kr: #a90d91;
+ --codehilite-kt: #cf222e;
+ --codehilite-ld: #1c01ce;
+ --codehilite-m: #0550ae;
+ --codehilite-s: #0a3069;
+ --codehilite-na: #836c28;
+ --codehilite-nb: #cf222e;
+ --codehilite-nc: #8250df;
+ --codehilite-no: #000;
+ --codehilite-nd: #8250df;
+ --codehilite-ni: #000;
+ --codehilite-ne: #000;
+ --codehilite-nf: #8250df;
+ --codehilite-nl: #000;
+ --codehilite-nn: #000;
+ --codehilite-nx: #000;
+ --codehilite-py: #000;
+ --codehilite-nt: #8250df;
+ --codehilite-nv: #000;
+ --codehilite-ow: #000;
+ --codehilite-mb: #1c01ce;
+ --codehilite-mf: #1c01ce;
+ --codehilite-mh: #1c01ce;
+ --codehilite-mi: #1c01ce;
+ --codehilite-mo: #1c01ce;
+ --codehilite-sa: #0a3069;
+ --codehilite-sb: #0a3069;
+ --codehilite-sc: #0a3069;
+ --codehilite-dl: #0a3069;
+ --codehilite-sd: #0a3069;
+ --codehilite-s2: #0a3069;
+ --codehilite-se: #0a3069;
+ --codehilite-sh: #0a3069;
+ --codehilite-si: #0a3069;
+ --codehilite-sx: #0a3069;
+ --codehilite-sr: #0a3069;
+ --codehilite-s1: #0a3069;
+ --codehilite-ss: #0a3069;
+ --codehilite-bp: #5b269a;
+ --codehilite-fm: #000;
+ --codehilite-vc: #000;
+ --codehilite-vg: #000;
+ --codehilite-vi: #000;
+ --codehilite-vm: #000;
+ --codehilite-il: #1c01ce;
+ }
+
+ .dark {
+ --linenos-special: #fff;
+ --linenos-special-bg: #303030;
+ --codehilite-hll: #303030;
+ --codehilite-c: #88ff70;
+ --codehilite-err: #f00;
+ --codehilite-k: #ff5572;
+ --codehilite-l: #7289da;
+ --codehilite-n: #fff;
+ --codehilite-o: #fff;
+ --codehilite-ch: #88ff70;
+ --codehilite-cm: #88ff70;
+ --codehilite-cp: #ffcc80;
+ --codehilite-cpf: #88ff70;
+ --codehilite-c1: #88ff70;
+ --codehilite-cs: #88ff70;
+ --codehilite-kc: #ff80bf;
+ --codehilite-kd: #ff80bf;
+ --codehilite-kn: #ff80bf;
+ --codehilite-kp: #ff80bf;
+ --codehilite-kr: #ff80bf;
+ --codehilite-kt: #ff5572;
+ --codehilite-ld: #7289da;
+ --codehilite-m: #55a8ff;
+ --codehilite-s: #5af;
+ --codehilite-na: #ffcc80;
+ --codehilite-nb: #ff5572;
+ --codehilite-nc: #b39ddb;
+ --codehilite-no: #fff;
+ --codehilite-nd: #b39ddb;
+ --codehilite-ni: #fff;
+ --codehilite-ne: #fff;
+ --codehilite-nf: #b39ddb;
+ --codehilite-nl: #fff;
+ --codehilite-nn: #fff;
+ --codehilite-nx: #fff;
+ --codehilite-py: #fff;
+ --codehilite-nt: #b39ddb;
+ --codehilite-nv: #fff;
+ --codehilite-ow: #fff;
+ --codehilite-mb: #7289da;
+ --codehilite-mf: #7289da;
+ --codehilite-mh: #7289da;
+ --codehilite-mi: #7289da;
+ --codehilite-mo: #7289da;
+ --codehilite-sa: #5af;
+ --codehilite-sb: #5af;
+ --codehilite-sc: #5af;
+ --codehilite-dl: #5af;
+ --codehilite-sd: #5af;
+ --codehilite-s2: #5af;
+ --codehilite-se: #5af;
+ --codehilite-sh: #5af;
+ --codehilite-si: #5af;
+ --codehilite-sx: #5af;
+ --codehilite-sr: #5af;
+ --codehilite-s1: #5af;
+ --codehilite-ss: #5af;
+ --codehilite-bp: #9c4dcc;
+ --codehilite-fm: #fff;
+ --codehilite-vc: #fff;
+ --codehilite-vg: #fff;
+ --codehilite-vi: #fff;
+ --codehilite-vm: #fff;
+ --codehilite-il: #7289da;
+ }
+}
+
+pre {
+ line-height: 125%;
+}
+
+td.linenos .normal {
+ color: inherit;
+ background-color: transparent;
+ padding-left: 5px;
+ padding-right: 5px;
+}
+
+span.linenos {
+ color: inherit;
+ background-color: transparent;
+ padding-left: 5px;
+ padding-right: 5px;
+}
+
+td.linenos .special {
+ color: var(--linenos-special);
+ background-color: var(--linenos-special-bg);
+ padding-left: 5px;
+ padding-right: 5px;
+}
+
+span.linenos.special {
+ color: var(--linenos-special);
+ background-color: var(--linenos-special-bg);
+ padding-left: 5px;
+ padding-right: 5px;
+}
+
+.codehilite .hll {
+ color: var(--codehilite-hll);
+}
+
+.codehilite .c {
+ color: var(--codehilite-c);
+} /* Comment */
+.codehilite .err {
+ color: var(--codehilite-err);
+} /* Error */
+.codehilite .k {
+ color: var(--codehilite-k);
+} /* Keyword */
+.codehilite .l {
+ color: var(--codehilite-l);
+} /* Literal */
+.codehilite .n {
+ color: var(--codehilite-n);
+} /* Name */
+.codehilite .o {
+ color: var(--codehilite-o);
+} /* Operator */
+.codehilite .ch {
+ color: var(--codehilite-ch);
+} /* Comment.Hashbang */
+.codehilite .cm {
+ color: var(--codehilite-cm);
+} /* Comment.Multiline */
+.codehilite .cp {
+ color: var(--codehilite-cp);
+} /* Comment.Preproc */
+.codehilite .cpf {
+ color: var(--codehilite-cpf);
+} /* Comment.PreprocFile */
+.codehilite .c1 {
+ color: var(--codehilite-c1);
+} /* Comment.Single */
+.codehilite .cs {
+ color: var(--codehilite-cs);
+} /* Comment.Special */
+.codehilite .kc {
+ color: var(--codehilite-kc);
+} /* Keyword.Constant */
+.codehilite .kd {
+ color: var(--codehilite-kd);
+} /* Keyword.Declaration */
+.codehilite .kn {
+ color: var(--codehilite-kn);
+} /* Keyword.Namespace */
+.codehilite .kp {
+ color: var(--codehilite-kp);
+} /* Keyword.Pseudo */
+.codehilite .kr {
+ color: var(--codehilite-kr);
+} /* Keyword.Reserved */
+.codehilite .kt {
+ color: var(--codehilite-kt);
+} /* Keyword.Type */
+.codehilite .ld {
+ color: var(--codehilite-ld);
+} /* Literal.Date */
+.codehilite .m {
+ color: var(--codehilite-m);
+} /* Literal.Number */
+.codehilite .s {
+ color: var(--codehilite-s);
+} /* Literal.String */
+.codehilite .na {
+ color: var(--codehilite-na);
+} /* Name.Attribute */
+.codehilite .nb {
+ color: var(--codehilite-nb);
+} /* Name.Builtin */
+.codehilite .nc {
+ color: var(--codehilite-nc);
+} /* Name.Class */
+.codehilite .no {
+ color: var(--codehilite-no);
+} /* Name.Constant */
+.codehilite .nd {
+ color: var(--codehilite-nd);
+} /* Name.Decorator */
+.codehilite .ni {
+ color: var(--codehilite-ni);
+} /* Name.Entity */
+.codehilite .ne {
+ color: var(--codehilite-ne);
+} /* Name.Exception */
+.codehilite .nf {
+ color: var(--codehilite-nf);
+} /* Name.Function */
+.codehilite .nl {
+ color: var(--codehilite-nl);
+} /* Name.Label */
+.codehilite .nn {
+ color: var(--codehilite-nn);
+} /* Name.Namespace */
+.codehilite .nx {
+ color: var(--codehilite-nx);
+} /* Name.Other */
+.codehilite .py {
+ color: var(--codehilite-py);
+} /* Name.Property */
+.codehilite .nt {
+ color: var(--codehilite-nt);
+} /* Name.Tag */
+.codehilite .nv {
+ color: var(--codehilite-nv);
+} /* Name.Variable */
+.codehilite .ow {
+ color: var(--codehilite-ow);
+} /* Operator.Word */
+.codehilite .mb {
+ color: var(--codehilite-mb);
+} /* Literal.Number.Bin */
+.codehilite .mf {
+ color: var(--codehilite-mf);
+} /* Literal.Number.Float */
+.codehilite .mh {
+ color: var(--codehilite-mh);
+} /* Literal.Number.Hex */
+.codehilite .mi {
+ color: var(--codehilite-mi);
+} /* Literal.Number.Integer */
+.codehilite .mo {
+ color: var(--codehilite-mo);
+} /* Literal.Number.Oct */
+.codehilite .sa {
+ color: var(--codehilite-sa);
+} /* Literal.String.Affix */
+.codehilite .sb {
+ color: var(--codehilite-sb);
+} /* Literal.String.Backtick */
+.codehilite .sc {
+ color: var(--codehilite-sc);
+} /* Literal.String.Char */
+.codehilite .dl {
+ color: var(--codehilite-dl);
+} /* Literal.String.Delimiter */
+.codehilite .sd {
+ color: var(--codehilite-sd);
+} /* Literal.String.Doc */
+.codehilite .s2 {
+ color: var(--codehilite-s2);
+} /* Literal.String.Double */
+.codehilite .se {
+ color: var(--codehilite-se);
+} /* Literal.String.Escape */
+.codehilite .sh {
+ color: var(--codehilite-sh);
+} /* Literal.String.Heredoc */
+.codehilite .si {
+ color: var(--codehilite-si);
+} /* Literal.String.Interpol */
+.codehilite .sx {
+ color: var(--codehilite-sx);
+} /* Literal.String.Other */
+.codehilite .sr {
+ color: var(--codehilite-sr);
+} /* Literal.String.Regex */
+.codehilite .s1 {
+ color: var(--codehilite-s1);
+} /* Literal.String.Single */
+.codehilite .ss {
+ color: var(--codehilite-ss);
+} /* Literal.String.Symbol */
+.codehilite .bp {
+ color: var(--codehilite-bp);
+} /* Name.Builtin.Pseudo */
+.codehilite .fm {
+ color: var(--codehilite-fm);
+} /* Name.Function.Magic */
+.codehilite .vc {
+ color: var(--codehilite-vc);
+} /* Name.Variable.Class */
+.codehilite .vg {
+ color: var(--codehilite-vg);
+} /* Name.Variable.Global */
+.codehilite .vi {
+ color: var(--codehilite-vi);
+} /* Name.Variable.Instance */
+.codehilite .vm {
+ color: var(--codehilite-vm);
+} /* Name.Variable.Magic */
+.codehilite .il {
+ color: var(--codehilite-il);
+} /* Literal.Number.Integer.Long */
diff --git a/frontend/src/css/common.css b/frontend/src/css/common.css
new file mode 100644
index 0000000000..b13fc7d005
--- /dev/null
+++ b/frontend/src/css/common.css
@@ -0,0 +1,12 @@
+/* Hover actions */
+.hover-action {
+ display: none !important;
+}
+
+.hover-action:hover {
+ display: inline-flex !important;
+}
+
+.hover-actions-parent:hover .hover-action {
+ display: inline-flex !important;
+}
diff --git a/frontend/src/css/fonts.css b/frontend/src/css/fonts.css
new file mode 100644
index 0000000000..b42b1064f5
--- /dev/null
+++ b/frontend/src/css/fonts.css
@@ -0,0 +1,47 @@
+@font-face {
+ font-family: Lora;
+ font-style: normal;
+ font-weight: 400;
+ font-display: block;
+ src: url("../fonts/Lora/Lora-VariableFont_wght.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "PT Sans";
+ font-style: normal;
+ font-weight: 400;
+ font-display: block;
+ src: url("../fonts/PT_Sans/PTSans-Regular.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "PT Sans";
+ font-style: normal;
+ font-weight: 700;
+ font-display: block;
+ src: url("../fonts/PT_Sans/PTSans-Bold.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "Fira Mono";
+ font-style: normal;
+ font-weight: 400;
+ font-display: block;
+ src: url("../fonts/Fira_Mono/FiraMono-Regular.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "Fira Mono";
+ font-style: normal;
+ font-weight: 500;
+ font-display: block;
+ src: url("../fonts/Fira_Mono/FiraMono-Medium.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "Fira Mono";
+ font-style: normal;
+ font-weight: 700;
+ font-display: block;
+ src: url("../fonts/Fira_Mono/FiraMono-Bold.ttf") format("truetype");
+}
diff --git a/frontend/src/css/globals.css b/frontend/src/css/globals.css
new file mode 100644
index 0000000000..e07edd2b4b
--- /dev/null
+++ b/frontend/src/css/globals.css
@@ -0,0 +1,152 @@
+@import url("@radix-ui/colors/grass.css");
+@import url("@radix-ui/colors/grass-dark.css");
+@import url("@radix-ui/colors/gray.css");
+@import url("@radix-ui/colors/gray-dark.css");
+@import url("@radix-ui/colors/lime.css");
+@import url("@radix-ui/colors/lime-dark.css");
+@import url("@radix-ui/colors/red.css");
+@import url("@radix-ui/colors/red-dark.css");
+@import url("@radix-ui/colors/slate.css");
+@import url("@radix-ui/colors/slate-dark.css");
+@import url("@radix-ui/colors/sage.css");
+@import url("@radix-ui/colors/sage-dark.css");
+@import url("@radix-ui/colors/yellow.css");
+@import url("@radix-ui/colors/yellow-dark.css");
+
+@tailwind base;
+@tailwind components;
+@tailwind utilities;
+
+@layer base {
+ :root {
+ --background: 0 0% 100%;
+ --foreground: 222.2 47.4% 11.2%;
+ --muted: 210 40% 96.1%;
+ --muted-foreground: 215.4 16.3% 46.9%;
+ --popover: 0 0% 100%;
+ --popover-foreground: 222.2 47.4% 11.2%;
+ --card: 0 0% 100%;
+ --card-foreground: 222.2 47.4% 11.2%;
+ --border: 214.3 31.8% 91.4%;
+
+ /* tailwind slate-400 */
+ --input: 0 0% 64%;
+ --primary: 222.2 47.4% 25%;
+ --primary-foreground: 210 40% 98%;
+ --secondary: 210 40% 96.1%;
+ --secondary-foreground: 222.2 47.4% 11.2%;
+
+ /* tailwind blue-500 */
+ --accent: 217 91% 60%;
+
+ /* white */
+ --accent-foreground: 100 100% 100%;
+ --destructive: 0 100% 70%;
+ --destructive-foreground: 210 40% 98%;
+ --error: 0 77% 64%;
+ --error-foreground: 210 40% 98%;
+ --success: 130 100% 70%;
+ --success-foreground: 210 40% 98%;
+ --action: 52 96.8% 82%;
+ --action-hover: 54 100% 86.7%;
+ --action-foreground: 42 100% 29%;
+
+ /* tailwind blue-600 */
+ --link: 221 83% 53%;
+
+ /* tailwind violet-600 */
+ --link-visited: 262 83% 58%;
+ --ring: 215 20.2% 65.1%;
+ --radius: 8px;
+ --base-shadow: hsl(0deg 0% 85% / 40%);
+ --base-shadow-darker: hsl(0deg 0% 50% / 40%);
+
+ /* Fuzzy shadows. */
+ --shadow-xxs: 0px 0px 2px 0px var(--base-shadow-darker);
+ --shadow-xs: 1px 1px 2px 0px var(--base-shadow),
+ 0px 0px 2px 0px hsl(0deg 0% 25% / 5%);
+ --shadow-sm: 2px 2px 2px 0px var(--base-shadow),
+ 0px 0px 2px 0px hsl(0deg 0% 25% / 5%);
+ --shadow-md: 4px 4px 4px 0px var(--base-shadow),
+ 0 0px 4px 0px hsl(0deg 0% 60% / 5%);
+ --shadow-lg: 5px 6px 4px 0px var(--base-shadow),
+ 0 0px 4px 0px hsl(0deg 0% 75% / 5%);
+ --shadow-xl: 8px 9px 4px 0px var(--base-shadow),
+ 0 0px 6px 0px hsl(0deg 0% 85% / 5%);
+ --callout-neutral-border: #a1a1a18f;
+ --callout-neutral-bg: #fff;
+ --callout-alert-border: #a573008f;
+ --callout-alert-bg: #af893105;
+ --callout-warn-border: #a527008f;
+ --callout-warn-bg: #a5270000;
+ --callout-success-border: #94d8ed;
+ --callout-success-bg: #94d8ed1c;
+ }
+
+ .dark {
+ /* sage-2 */
+ --background: 150 7.7% 10.2%;
+ /* sage-12 */
+ --foreground: 155 7% 93%;
+ /* sage-3 */
+ --muted: 151 5.5% 15.2%;
+ /* sage-11 */
+ --muted-foreground: 155 5% 68.3%;
+ /* sage-3 */
+ --popover: 151 5.5% 15.2%;
+ /* sage-11 */
+ --popover-foreground: 155 5% 68.3%;
+ /* sage-3 */
+ --card: 151 5.5% 15.2%;
+ /* sage-11 */
+ --card-foreground: 155 5% 68.3%;
+ /* sage-6 */
+ --border: 153 3.7% 24.2%;
+ /* sage-7 */
+ --input: 154 3.3% 28.7%;
+ /* cyan-3 */
+ --primary: 193 52.6% 14.1%;
+ /* cyan-12 */
+ --primary-foreground: 190 80% 84%;
+ /* sage-12 */
+ --secondary: 155 7% 93%;
+ /* cyan-3 */
+ --secondary-foreground: 193 51.9% 11.9%;
+ /* cyan-7*/
+ --accent: 192 56.6% 26.5%;
+ /* cyan-11 */
+ --accent-foreground: 190 90% 54%;
+
+ --destructive: 0 63% 41%;
+ --destructive-foreground: 155 7% 93%;
+ --success: 130 100% 70%;
+ --success-foreground: 155 7% 93%;
+ --ring: 216 34% 17%;
+ --radius: 8px;
+ --callout-neutral-border: #5f5f5f8f;
+ --callout-neutral-bg: #2f2f2f;
+ --callout-alert-border: #ffaa008f;
+ --callout-alert-bg: #fa03;
+ --callout-warn-border: #ff55008f;
+ --callout-warn-bg: #f503;
+ --callout-success-border: #2ca4b6;
+ --callout-success-bg: #2ca4b633;
+ }
+}
+
+@layer base {
+ * {
+ @apply border-border;
+ }
+
+ body {
+ @apply bg-background text-foreground;
+
+ font-feature-settings: "rlig" 1, "calt" 1;
+ }
+}
+
+button {
+ padding: 0;
+ margin: 0;
+}
diff --git a/frontend/src/css/index.css b/frontend/src/css/index.css
new file mode 100644
index 0000000000..71fb28f54d
--- /dev/null
+++ b/frontend/src/css/index.css
@@ -0,0 +1,32 @@
+@import url("./fonts.css");
+@import url("./common.css");
+@import url("./globals.css");
+@import url("./codehilite.css");
+@import url("./katex.min.css");
+
+html {
+ box-sizing: border-box;
+}
+
+*,
+*::before,
+*::after {
+ box-sizing: inherit;
+}
+
+body {
+ margin: 0;
+ font-family: var(--text-font);
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+body,
+#root {
+ height: 100%;
+ width: 100%;
+}
+
+code {
+ font-family: var(--monospace-font);
+}
diff --git a/frontend/src/css/katex.min.css b/frontend/src/css/katex.min.css
new file mode 100644
index 0000000000..4aa5b9414d
--- /dev/null
+++ b/frontend/src/css/katex.min.css
@@ -0,0 +1,1366 @@
+@font-face {
+ font-family: "KaTeX_AMS";
+ font-style: normal;
+ font-display: block;
+ font-weight: 400;
+ src: url("../fonts/KaTeX/KaTeX_AMS-Regular.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_AMS-Regular.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_AMS-Regular.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_Caligraphic";
+ font-style: normal;
+ font-display: block;
+ font-weight: 700;
+ src: url("../fonts/KaTeX/KaTeX_Caligraphic-Bold.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_Caligraphic-Bold.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_Caligraphic-Bold.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_Caligraphic";
+ font-style: normal;
+ font-display: block;
+ font-weight: 400;
+ src: url("../fonts/KaTeX/KaTeX_Caligraphic-Regular.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_Caligraphic-Regular.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_Caligraphic-Regular.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_Fraktur";
+ font-style: normal;
+ font-display: block;
+ font-weight: 700;
+ src: url("../fonts/KaTeX/KaTeX_Fraktur-Bold.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_Fraktur-Bold.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_Fraktur-Bold.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_Fraktur";
+ font-style: normal;
+ font-display: block;
+ font-weight: 400;
+ src: url("../fonts/KaTeX/KaTeX_Fraktur-Regular.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_Fraktur-Regular.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_Fraktur-Regular.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_Main";
+ font-style: normal;
+ font-display: block;
+ font-weight: 700;
+ src: url("../fonts/KaTeX/KaTeX_Main-Bold.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_Main-Bold.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_Main-Bold.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_Main";
+ font-style: italic;
+ font-weight: 700;
+ src: url("../fonts/KaTeX/KaTeX_Main-BoldItalic.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_Main-BoldItalic.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_Main-BoldItalic.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_Main";
+ font-style: italic;
+ font-weight: 400;
+ src: url("../fonts/KaTeX/KaTeX_Main-Italic.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_Main-Italic.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_Main-Italic.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_Main";
+ font-style: normal;
+ font-display: block;
+ font-weight: 400;
+ src: url("../fonts/KaTeX/KaTeX_Main-Regular.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_Main-Regular.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_Main-Regular.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_Math";
+ font-style: italic;
+ font-weight: 700;
+ src: url("../fonts/KaTeX/KaTeX_Math-BoldItalic.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_Math-BoldItalic.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_Math-BoldItalic.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_Math";
+ font-style: italic;
+ font-weight: 400;
+ src: url("../fonts/KaTeX/KaTeX_Math-Italic.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_Math-Italic.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_Math-Italic.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_SansSerif";
+ font-style: normal;
+ font-display: block;
+ font-weight: 700;
+ src: url("../fonts/KaTeX/KaTeX_SansSerif-Bold.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_SansSerif-Bold.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_SansSerif-Bold.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_SansSerif";
+ font-style: italic;
+ font-weight: 400;
+ src: url("../fonts/KaTeX/KaTeX_SansSerif-Italic.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_SansSerif-Italic.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_SansSerif-Italic.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_SansSerif";
+ font-style: normal;
+ font-display: block;
+ font-weight: 400;
+ src: url("../fonts/KaTeX/KaTeX_SansSerif-Regular.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_SansSerif-Regular.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_SansSerif-Regular.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_Script";
+ font-style: normal;
+ font-display: block;
+ font-weight: 400;
+ src: url("../fonts/KaTeX/KaTeX_Script-Regular.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_Script-Regular.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_Script-Regular.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_Size1";
+ font-style: normal;
+ font-display: block;
+ font-weight: 400;
+ src: url("../fonts/KaTeX/KaTeX_Size1-Regular.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_Size1-Regular.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_Size1-Regular.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_Size2";
+ font-style: normal;
+ font-display: block;
+ font-weight: 400;
+ src: url("../fonts/KaTeX/KaTeX_Size2-Regular.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_Size2-Regular.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_Size2-Regular.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_Size3";
+ font-style: normal;
+ font-display: block;
+ font-weight: 400;
+ src: url("../fonts/KaTeX/KaTeX_Size3-Regular.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_Size3-Regular.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_Size3-Regular.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_Size4";
+ font-style: normal;
+ font-display: block;
+ font-weight: 400;
+ src: url("../fonts/KaTeX/KaTeX_Size4-Regular.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_Size4-Regular.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_Size4-Regular.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "KaTeX_Typewriter";
+ font-style: normal;
+ font-display: block;
+ font-weight: 400;
+ src: url("../fonts/KaTeX/KaTeX_Typewriter-Regular.woff2") format("woff2"),
+ url("../fonts/KaTeX/KaTeX_Typewriter-Regular.woff") format("woff"),
+ url("../fonts/KaTeX/KaTeX_Typewriter-Regular.ttf") format("truetype");
+}
+
+.katex {
+ text-rendering: auto;
+ font: normal 1.21rem "KaTeX_Main", "Times New Roman", serif;
+ line-height: 1.2;
+ text-indent: 0;
+}
+
+.katex * {
+ -ms-high-contrast-adjust: none !important;
+ border-color: currentcolor;
+}
+
+.katex .katex-version::after {
+ content: "0.16.0";
+}
+
+.katex .katex-mathml {
+ clip: rect(1px, 1px, 1px, 1px);
+ border: 0;
+ height: 1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+}
+
+.katex .katex-html > .newline {
+ display: block;
+}
+
+.katex .base {
+ position: relative;
+ white-space: nowrap;
+ width: min-content;
+}
+
+.katex .base,
+.katex .strut {
+ display: inline-block;
+}
+
+.katex .textbf {
+ font-weight: 700;
+}
+
+.katex .textit {
+ font-style: italic;
+}
+
+.katex .textrm {
+ font-family: "KaTeX_Main";
+}
+
+.katex .textsf {
+ font-family: "KaTeX_SansSerif";
+}
+
+.katex .texttt {
+ font-family: "KaTeX_Typewriter";
+}
+
+.katex .mathnormal {
+ font-family: "KaTeX_Math";
+ font-style: italic;
+}
+
+.katex .mathit {
+ font-family: "KaTeX_Main";
+ font-style: italic;
+}
+
+.katex .mathrm {
+ font-style: normal;
+}
+
+.katex .mathbf {
+ font-family: "KaTeX_Main";
+ font-weight: 700;
+}
+
+.katex .boldsymbol {
+ font-family: "KaTeX_Math";
+ font-style: italic;
+ font-weight: 700;
+}
+
+.katex .amsrm,
+.katex .mathbb,
+.katex .textbb {
+ font-family: "KaTeX_AMS";
+}
+
+.katex .mathcal {
+ font-family: "KaTeX_Caligraphic";
+}
+
+.katex .mathfrak,
+.katex .textfrak {
+ font-family: "KaTeX_Fraktur";
+}
+
+.katex .mathtt {
+ font-family: "KaTeX_Typewriter";
+}
+
+.katex .mathscr,
+.katex .textscr {
+ font-family: "KaTeX_Script";
+}
+
+.katex .mathsf,
+.katex .textsf {
+ font-family: "KaTeX_SansSerif";
+}
+
+.katex .mathboldsf,
+.katex .textboldsf {
+ font-family: "KaTeX_SansSerif";
+ font-weight: 700;
+}
+
+.katex .mathitsf,
+.katex .textitsf {
+ font-family: "KaTeX_SansSerif";
+ font-style: italic;
+}
+
+.katex .mainrm {
+ font-family: "KaTeX_Main";
+ font-style: normal;
+}
+
+.katex .vlist-t {
+ border-collapse: collapse;
+ display: inline-table;
+ table-layout: fixed;
+}
+
+.katex .vlist-r {
+ display: table-row;
+}
+
+.katex .vlist {
+ display: table-cell;
+ position: relative;
+ vertical-align: bottom;
+}
+
+.katex .vlist > span {
+ display: block;
+ height: 0;
+ position: relative;
+}
+
+.katex .vlist > span > span {
+ display: inline-block;
+}
+
+.katex .vlist > span > .pstrut {
+ overflow: hidden;
+ width: 0;
+}
+
+.katex .vlist-t2 {
+ margin-right: -2px;
+}
+
+.katex .vlist-s {
+ display: table-cell;
+ /* stylelint-disable-next-line unit-allowed-list */
+ font-size: 1px;
+ min-width: 2px;
+ vertical-align: bottom;
+ width: 2px;
+}
+
+.katex .vbox {
+ align-items: baseline;
+ display: inline-flex;
+ flex-direction: column;
+}
+
+.katex .hbox {
+ width: 100%;
+}
+
+.katex .hbox,
+.katex .thinbox {
+ display: inline-flex;
+ flex-direction: row;
+}
+
+.katex .thinbox {
+ max-width: 0;
+ width: 0;
+}
+
+.katex .msupsub {
+ text-align: left;
+}
+
+.katex .mfrac > span > span {
+ text-align: center;
+}
+
+.katex .mfrac .frac-line {
+ border-bottom-style: solid;
+ display: inline-block;
+ width: 100%;
+}
+
+.katex .hdashline,
+.katex .hline,
+.katex .mfrac .frac-line,
+.katex .overline .overline-line,
+.katex .rule,
+.katex .underline .underline-line {
+ min-height: 1px;
+}
+
+.katex .mspace {
+ display: inline-block;
+}
+
+.katex .clap,
+.katex .llap,
+.katex .rlap {
+ position: relative;
+ width: 0;
+}
+
+.katex .clap > .inner,
+.katex .llap > .inner,
+.katex .rlap > .inner {
+ position: absolute;
+}
+
+.katex .clap > .fix,
+.katex .llap > .fix,
+.katex .rlap > .fix {
+ display: inline-block;
+}
+
+.katex .llap > .inner {
+ right: 0;
+}
+
+.katex .clap > .inner,
+.katex .rlap > .inner {
+ left: 0;
+}
+
+.katex .clap > .inner > span {
+ margin-left: -50%;
+ margin-right: 50%;
+}
+
+.katex .rule {
+ border: 0 solid;
+ display: inline-block;
+ position: relative;
+}
+
+.katex .hline,
+.katex .overline .overline-line,
+.katex .underline .underline-line {
+ border-bottom-style: solid;
+ display: inline-block;
+ width: 100%;
+}
+
+.katex .hdashline {
+ border-bottom-style: dashed;
+ display: inline-block;
+ width: 100%;
+}
+
+.katex .sqrt > .root {
+ margin-left: 0.27777778rem;
+ margin-right: -0.55555556rem;
+}
+
+.katex .fontsize-ensurer.reset-size1.size1,
+.katex .sizing.reset-size1.size1 {
+ font-size: 1rem;
+}
+
+.katex .fontsize-ensurer.reset-size1.size2,
+.katex .sizing.reset-size1.size2 {
+ font-size: 1.2rem;
+}
+
+.katex .fontsize-ensurer.reset-size1.size3,
+.katex .sizing.reset-size1.size3 {
+ font-size: 1.4rem;
+}
+
+.katex .fontsize-ensurer.reset-size1.size4,
+.katex .sizing.reset-size1.size4 {
+ font-size: 1.6rem;
+}
+
+.katex .fontsize-ensurer.reset-size1.size5,
+.katex .sizing.reset-size1.size5 {
+ font-size: 1.8rem;
+}
+
+.katex .fontsize-ensurer.reset-size1.size6,
+.katex .sizing.reset-size1.size6 {
+ font-size: 2rem;
+}
+
+.katex .fontsize-ensurer.reset-size1.size7,
+.katex .sizing.reset-size1.size7 {
+ font-size: 2.4rem;
+}
+
+.katex .fontsize-ensurer.reset-size1.size8,
+.katex .sizing.reset-size1.size8 {
+ font-size: 2.88rem;
+}
+
+.katex .fontsize-ensurer.reset-size1.size9,
+.katex .sizing.reset-size1.size9 {
+ font-size: 3.456rem;
+}
+
+.katex .fontsize-ensurer.reset-size1.size10,
+.katex .sizing.reset-size1.size10 {
+ font-size: 4.148rem;
+}
+
+.katex .fontsize-ensurer.reset-size1.size11,
+.katex .sizing.reset-size1.size11 {
+ font-size: 4.976rem;
+}
+
+.katex .fontsize-ensurer.reset-size2.size1,
+.katex .sizing.reset-size2.size1 {
+ font-size: 0.83333333rem;
+}
+
+.katex .fontsize-ensurer.reset-size2.size2,
+.katex .sizing.reset-size2.size2 {
+ font-size: 1rem;
+}
+
+.katex .fontsize-ensurer.reset-size2.size3,
+.katex .sizing.reset-size2.size3 {
+ font-size: 1.16666667rem;
+}
+
+.katex .fontsize-ensurer.reset-size2.size4,
+.katex .sizing.reset-size2.size4 {
+ font-size: 1.33333333rem;
+}
+
+.katex .fontsize-ensurer.reset-size2.size5,
+.katex .sizing.reset-size2.size5 {
+ font-size: 1.5rem;
+}
+
+.katex .fontsize-ensurer.reset-size2.size6,
+.katex .sizing.reset-size2.size6 {
+ font-size: 1.66666667rem;
+}
+
+.katex .fontsize-ensurer.reset-size2.size7,
+.katex .sizing.reset-size2.size7 {
+ font-size: 2rem;
+}
+
+.katex .fontsize-ensurer.reset-size2.size8,
+.katex .sizing.reset-size2.size8 {
+ font-size: 2.4rem;
+}
+
+.katex .fontsize-ensurer.reset-size2.size9,
+.katex .sizing.reset-size2.size9 {
+ font-size: 2.88rem;
+}
+
+.katex .fontsize-ensurer.reset-size2.size10,
+.katex .sizing.reset-size2.size10 {
+ font-size: 3.45666667rem;
+}
+
+.katex .fontsize-ensurer.reset-size2.size11,
+.katex .sizing.reset-size2.size11 {
+ font-size: 4.14666667rem;
+}
+
+.katex .fontsize-ensurer.reset-size3.size1,
+.katex .sizing.reset-size3.size1 {
+ font-size: 0.71428571rem;
+}
+
+.katex .fontsize-ensurer.reset-size3.size2,
+.katex .sizing.reset-size3.size2 {
+ font-size: 0.85714286rem;
+}
+
+.katex .fontsize-ensurer.reset-size3.size3,
+.katex .sizing.reset-size3.size3 {
+ font-size: 1rem;
+}
+
+.katex .fontsize-ensurer.reset-size3.size4,
+.katex .sizing.reset-size3.size4 {
+ font-size: 1.14285714rem;
+}
+
+.katex .fontsize-ensurer.reset-size3.size5,
+.katex .sizing.reset-size3.size5 {
+ font-size: 1.28571429rem;
+}
+
+.katex .fontsize-ensurer.reset-size3.size6,
+.katex .sizing.reset-size3.size6 {
+ font-size: 1.42857143rem;
+}
+
+.katex .fontsize-ensurer.reset-size3.size7,
+.katex .sizing.reset-size3.size7 {
+ font-size: 1.71428571rem;
+}
+
+.katex .fontsize-ensurer.reset-size3.size8,
+.katex .sizing.reset-size3.size8 {
+ font-size: 2.05714286rem;
+}
+
+.katex .fontsize-ensurer.reset-size3.size9,
+.katex .sizing.reset-size3.size9 {
+ font-size: 2.46857143rem;
+}
+
+.katex .fontsize-ensurer.reset-size3.size10,
+.katex .sizing.reset-size3.size10 {
+ font-size: 2.96285714rem;
+}
+
+.katex .fontsize-ensurer.reset-size3.size11,
+.katex .sizing.reset-size3.size11 {
+ font-size: 3.55428571rem;
+}
+
+.katex .fontsize-ensurer.reset-size4.size1,
+.katex .sizing.reset-size4.size1 {
+ font-size: 0.625rem;
+}
+
+.katex .fontsize-ensurer.reset-size4.size2,
+.katex .sizing.reset-size4.size2 {
+ font-size: 0.75rem;
+}
+
+.katex .fontsize-ensurer.reset-size4.size3,
+.katex .sizing.reset-size4.size3 {
+ font-size: 0.875rem;
+}
+
+.katex .fontsize-ensurer.reset-size4.size4,
+.katex .sizing.reset-size4.size4 {
+ font-size: 1rem;
+}
+
+.katex .fontsize-ensurer.reset-size4.size5,
+.katex .sizing.reset-size4.size5 {
+ font-size: 1.125rem;
+}
+
+.katex .fontsize-ensurer.reset-size4.size6,
+.katex .sizing.reset-size4.size6 {
+ font-size: 1.25rem;
+}
+
+.katex .fontsize-ensurer.reset-size4.size7,
+.katex .sizing.reset-size4.size7 {
+ font-size: 1.5rem;
+}
+
+.katex .fontsize-ensurer.reset-size4.size8,
+.katex .sizing.reset-size4.size8 {
+ font-size: 1.8rem;
+}
+
+.katex .fontsize-ensurer.reset-size4.size9,
+.katex .sizing.reset-size4.size9 {
+ font-size: 2.16rem;
+}
+
+.katex .fontsize-ensurer.reset-size4.size10,
+.katex .sizing.reset-size4.size10 {
+ font-size: 2.5925rem;
+}
+
+.katex .fontsize-ensurer.reset-size4.size11,
+.katex .sizing.reset-size4.size11 {
+ font-size: 3.11rem;
+}
+
+.katex .fontsize-ensurer.reset-size5.size1,
+.katex .sizing.reset-size5.size1 {
+ font-size: 0.55555556rem;
+}
+
+.katex .fontsize-ensurer.reset-size5.size2,
+.katex .sizing.reset-size5.size2 {
+ font-size: 0.66666667rem;
+}
+
+.katex .fontsize-ensurer.reset-size5.size3,
+.katex .sizing.reset-size5.size3 {
+ font-size: 0.77777778rem;
+}
+
+.katex .fontsize-ensurer.reset-size5.size4,
+.katex .sizing.reset-size5.size4 {
+ font-size: 0.88888889rem;
+}
+
+.katex .fontsize-ensurer.reset-size5.size5,
+.katex .sizing.reset-size5.size5 {
+ font-size: 1rem;
+}
+
+.katex .fontsize-ensurer.reset-size5.size6,
+.katex .sizing.reset-size5.size6 {
+ font-size: 1.11111111rem;
+}
+
+.katex .fontsize-ensurer.reset-size5.size7,
+.katex .sizing.reset-size5.size7 {
+ font-size: 1.33333333rem;
+}
+
+.katex .fontsize-ensurer.reset-size5.size8,
+.katex .sizing.reset-size5.size8 {
+ font-size: 1.6rem;
+}
+
+.katex .fontsize-ensurer.reset-size5.size9,
+.katex .sizing.reset-size5.size9 {
+ font-size: 1.92rem;
+}
+
+.katex .fontsize-ensurer.reset-size5.size10,
+.katex .sizing.reset-size5.size10 {
+ font-size: 2.30444444rem;
+}
+
+.katex .fontsize-ensurer.reset-size5.size11,
+.katex .sizing.reset-size5.size11 {
+ font-size: 2.76444444rem;
+}
+
+.katex .fontsize-ensurer.reset-size6.size1,
+.katex .sizing.reset-size6.size1 {
+ font-size: 0.5rem;
+}
+
+.katex .fontsize-ensurer.reset-size6.size2,
+.katex .sizing.reset-size6.size2 {
+ font-size: 0.6rem;
+}
+
+.katex .fontsize-ensurer.reset-size6.size3,
+.katex .sizing.reset-size6.size3 {
+ font-size: 0.7rem;
+}
+
+.katex .fontsize-ensurer.reset-size6.size4,
+.katex .sizing.reset-size6.size4 {
+ font-size: 0.8rem;
+}
+
+.katex .fontsize-ensurer.reset-size6.size5,
+.katex .sizing.reset-size6.size5 {
+ font-size: 0.9rem;
+}
+
+.katex .fontsize-ensurer.reset-size6.size6,
+.katex .sizing.reset-size6.size6 {
+ font-size: 1rem;
+}
+
+.katex .fontsize-ensurer.reset-size6.size7,
+.katex .sizing.reset-size6.size7 {
+ font-size: 1.2rem;
+}
+
+.katex .fontsize-ensurer.reset-size6.size8,
+.katex .sizing.reset-size6.size8 {
+ font-size: 1.44rem;
+}
+
+.katex .fontsize-ensurer.reset-size6.size9,
+.katex .sizing.reset-size6.size9 {
+ font-size: 1.728rem;
+}
+
+.katex .fontsize-ensurer.reset-size6.size10,
+.katex .sizing.reset-size6.size10 {
+ font-size: 2.074rem;
+}
+
+.katex .fontsize-ensurer.reset-size6.size11,
+.katex .sizing.reset-size6.size11 {
+ font-size: 2.488rem;
+}
+
+.katex .fontsize-ensurer.reset-size7.size1,
+.katex .sizing.reset-size7.size1 {
+ font-size: 0.41666667rem;
+}
+
+.katex .fontsize-ensurer.reset-size7.size2,
+.katex .sizing.reset-size7.size2 {
+ font-size: 0.5rem;
+}
+
+.katex .fontsize-ensurer.reset-size7.size3,
+.katex .sizing.reset-size7.size3 {
+ font-size: 0.58333333rem;
+}
+
+.katex .fontsize-ensurer.reset-size7.size4,
+.katex .sizing.reset-size7.size4 {
+ font-size: 0.66666667rem;
+}
+
+.katex .fontsize-ensurer.reset-size7.size5,
+.katex .sizing.reset-size7.size5 {
+ font-size: 0.75rem;
+}
+
+.katex .fontsize-ensurer.reset-size7.size6,
+.katex .sizing.reset-size7.size6 {
+ font-size: 0.83333333rem;
+}
+
+.katex .fontsize-ensurer.reset-size7.size7,
+.katex .sizing.reset-size7.size7 {
+ font-size: 1rem;
+}
+
+.katex .fontsize-ensurer.reset-size7.size8,
+.katex .sizing.reset-size7.size8 {
+ font-size: 1.2rem;
+}
+
+.katex .fontsize-ensurer.reset-size7.size9,
+.katex .sizing.reset-size7.size9 {
+ font-size: 1.44rem;
+}
+
+.katex .fontsize-ensurer.reset-size7.size10,
+.katex .sizing.reset-size7.size10 {
+ font-size: 1.72833333rem;
+}
+
+.katex .fontsize-ensurer.reset-size7.size11,
+.katex .sizing.reset-size7.size11 {
+ font-size: 2.07333333rem;
+}
+
+.katex .fontsize-ensurer.reset-size8.size1,
+.katex .sizing.reset-size8.size1 {
+ font-size: 0.34722222rem;
+}
+
+.katex .fontsize-ensurer.reset-size8.size2,
+.katex .sizing.reset-size8.size2 {
+ font-size: 0.41666667rem;
+}
+
+.katex .fontsize-ensurer.reset-size8.size3,
+.katex .sizing.reset-size8.size3 {
+ font-size: 0.48611111rem;
+}
+
+.katex .fontsize-ensurer.reset-size8.size4,
+.katex .sizing.reset-size8.size4 {
+ font-size: 0.55555556rem;
+}
+
+.katex .fontsize-ensurer.reset-size8.size5,
+.katex .sizing.reset-size8.size5 {
+ font-size: 0.625rem;
+}
+
+.katex .fontsize-ensurer.reset-size8.size6,
+.katex .sizing.reset-size8.size6 {
+ font-size: 0.69444444rem;
+}
+
+.katex .fontsize-ensurer.reset-size8.size7,
+.katex .sizing.reset-size8.size7 {
+ font-size: 0.83333333rem;
+}
+
+.katex .fontsize-ensurer.reset-size8.size8,
+.katex .sizing.reset-size8.size8 {
+ font-size: 1rem;
+}
+
+.katex .fontsize-ensurer.reset-size8.size9,
+.katex .sizing.reset-size8.size9 {
+ font-size: 1.2rem;
+}
+
+.katex .fontsize-ensurer.reset-size8.size10,
+.katex .sizing.reset-size8.size10 {
+ font-size: 1.44027778rem;
+}
+
+.katex .fontsize-ensurer.reset-size8.size11,
+.katex .sizing.reset-size8.size11 {
+ font-size: 1.72777778rem;
+}
+
+.katex .fontsize-ensurer.reset-size9.size1,
+.katex .sizing.reset-size9.size1 {
+ font-size: 0.28935185rem;
+}
+
+.katex .fontsize-ensurer.reset-size9.size2,
+.katex .sizing.reset-size9.size2 {
+ font-size: 0.34722222rem;
+}
+
+.katex .fontsize-ensurer.reset-size9.size3,
+.katex .sizing.reset-size9.size3 {
+ font-size: 0.40509259rem;
+}
+
+.katex .fontsize-ensurer.reset-size9.size4,
+.katex .sizing.reset-size9.size4 {
+ font-size: 0.46296296rem;
+}
+
+.katex .fontsize-ensurer.reset-size9.size5,
+.katex .sizing.reset-size9.size5 {
+ font-size: 0.52083333rem;
+}
+
+.katex .fontsize-ensurer.reset-size9.size6,
+.katex .sizing.reset-size9.size6 {
+ font-size: 0.5787037rem;
+}
+
+.katex .fontsize-ensurer.reset-size9.size7,
+.katex .sizing.reset-size9.size7 {
+ font-size: 0.69444444rem;
+}
+
+.katex .fontsize-ensurer.reset-size9.size8,
+.katex .sizing.reset-size9.size8 {
+ font-size: 0.83333333rem;
+}
+
+.katex .fontsize-ensurer.reset-size9.size9,
+.katex .sizing.reset-size9.size9 {
+ font-size: 1rem;
+}
+
+.katex .fontsize-ensurer.reset-size9.size10,
+.katex .sizing.reset-size9.size10 {
+ font-size: 1.20023148rem;
+}
+
+.katex .fontsize-ensurer.reset-size9.size11,
+.katex .sizing.reset-size9.size11 {
+ font-size: 1.43981481rem;
+}
+
+.katex .fontsize-ensurer.reset-size10.size1,
+.katex .sizing.reset-size10.size1 {
+ font-size: 0.24108004rem;
+}
+
+.katex .fontsize-ensurer.reset-size10.size2,
+.katex .sizing.reset-size10.size2 {
+ font-size: 0.28929605rem;
+}
+
+.katex .fontsize-ensurer.reset-size10.size3,
+.katex .sizing.reset-size10.size3 {
+ font-size: 0.33751205rem;
+}
+
+.katex .fontsize-ensurer.reset-size10.size4,
+.katex .sizing.reset-size10.size4 {
+ font-size: 0.38572806rem;
+}
+
+.katex .fontsize-ensurer.reset-size10.size5,
+.katex .sizing.reset-size10.size5 {
+ font-size: 0.43394407rem;
+}
+
+.katex .fontsize-ensurer.reset-size10.size6,
+.katex .sizing.reset-size10.size6 {
+ font-size: 0.48216008rem;
+}
+
+.katex .fontsize-ensurer.reset-size10.size7,
+.katex .sizing.reset-size10.size7 {
+ font-size: 0.57859209rem;
+}
+
+.katex .fontsize-ensurer.reset-size10.size8,
+.katex .sizing.reset-size10.size8 {
+ font-size: 0.69431051rem;
+}
+
+.katex .fontsize-ensurer.reset-size10.size9,
+.katex .sizing.reset-size10.size9 {
+ font-size: 0.83317261rem;
+}
+
+.katex .fontsize-ensurer.reset-size10.size10,
+.katex .sizing.reset-size10.size10 {
+ font-size: 1rem;
+}
+
+.katex .fontsize-ensurer.reset-size10.size11,
+.katex .sizing.reset-size10.size11 {
+ font-size: 1.19961427rem;
+}
+
+.katex .fontsize-ensurer.reset-size11.size1,
+.katex .sizing.reset-size11.size1 {
+ font-size: 0.20096463rem;
+}
+
+.katex .fontsize-ensurer.reset-size11.size2,
+.katex .sizing.reset-size11.size2 {
+ font-size: 0.24115756rem;
+}
+
+.katex .fontsize-ensurer.reset-size11.size3,
+.katex .sizing.reset-size11.size3 {
+ font-size: 0.28135048rem;
+}
+
+.katex .fontsize-ensurer.reset-size11.size4,
+.katex .sizing.reset-size11.size4 {
+ font-size: 0.32154341rem;
+}
+
+.katex .fontsize-ensurer.reset-size11.size5,
+.katex .sizing.reset-size11.size5 {
+ font-size: 0.36173633rem;
+}
+
+.katex .fontsize-ensurer.reset-size11.size6,
+.katex .sizing.reset-size11.size6 {
+ font-size: 0.40192926rem;
+}
+
+.katex .fontsize-ensurer.reset-size11.size7,
+.katex .sizing.reset-size11.size7 {
+ font-size: 0.48231511rem;
+}
+
+.katex .fontsize-ensurer.reset-size11.size8,
+.katex .sizing.reset-size11.size8 {
+ font-size: 0.57877814rem;
+}
+
+.katex .fontsize-ensurer.reset-size11.size9,
+.katex .sizing.reset-size11.size9 {
+ font-size: 0.69453376rem;
+}
+
+.katex .fontsize-ensurer.reset-size11.size10,
+.katex .sizing.reset-size11.size10 {
+ font-size: 0.83360129rem;
+}
+
+.katex .fontsize-ensurer.reset-size11.size11,
+.katex .sizing.reset-size11.size11 {
+ font-size: 1rem;
+}
+
+.katex .delimsizing.size1 {
+ font-family: "KaTeX_Size1";
+}
+
+.katex .delimsizing.size2 {
+ font-family: "KaTeX_Size2";
+}
+
+.katex .delimsizing.size3 {
+ font-family: "KaTeX_Size3";
+}
+
+.katex .delimsizing.size4 {
+ font-family: "KaTeX_Size4";
+}
+
+.katex .delimsizing.mult .delim-size1 > span {
+ font-family: "KaTeX_Size1";
+}
+
+.katex .delimsizing.mult .delim-size4 > span {
+ font-family: "KaTeX_Size4";
+}
+
+.katex .nulldelimiter {
+ display: inline-block;
+ width: 0.12rem;
+}
+
+.katex .delimcenter,
+.katex .op-symbol {
+ position: relative;
+}
+
+.katex .op-symbol.small-op {
+ font-family: "KaTeX_Size1";
+}
+
+.katex .op-symbol.large-op {
+ font-family: "KaTeX_Size2";
+}
+
+.katex .accent > .vlist-t,
+.katex .op-limits > .vlist-t {
+ text-align: center;
+}
+
+.katex .accent .accent-body {
+ position: relative;
+}
+
+.katex .accent .accent-body:not(.accent-full) {
+ width: 0;
+}
+
+.katex .overlay {
+ display: block;
+}
+
+.katex .mtable .vertical-separator {
+ display: inline-block;
+ min-width: 1px;
+}
+
+.katex .mtable .arraycolsep {
+ display: inline-block;
+}
+
+.katex .mtable .col-align-c > .vlist-t {
+ text-align: center;
+}
+
+.katex .mtable .col-align-l > .vlist-t {
+ text-align: left;
+}
+
+.katex .mtable .col-align-r > .vlist-t {
+ text-align: right;
+}
+
+.katex .svg-align {
+ text-align: left;
+}
+
+.katex svg {
+ fill: currentcolor;
+ stroke: currentcolor;
+ fill-rule: nonzero;
+ fill-opacity: 1;
+ stroke-width: 1;
+ stroke-linecap: butt;
+ stroke-linejoin: miter;
+ stroke-miterlimit: 4;
+ stroke-dasharray: none;
+ stroke-dashoffset: 0;
+ stroke-opacity: 1;
+ display: block;
+ height: inherit;
+ position: absolute;
+ width: 100%;
+}
+
+.katex svg path {
+ stroke: none;
+}
+
+.katex img {
+ border-style: none;
+ max-height: none;
+ max-width: none;
+ min-height: 0;
+ min-width: 0;
+}
+
+.katex .stretchy {
+ display: block;
+ overflow: hidden;
+ position: relative;
+ width: 100%;
+}
+
+.katex .stretchy::after,
+.katex .stretchy::before {
+ content: "";
+}
+
+.katex .hide-tail {
+ overflow: hidden;
+ position: relative;
+ width: 100%;
+}
+
+.katex .halfarrow-left {
+ left: 0;
+ overflow: hidden;
+ position: absolute;
+ width: 50.2%;
+}
+
+.katex .halfarrow-right {
+ overflow: hidden;
+ position: absolute;
+ right: 0;
+ width: 50.2%;
+}
+
+.katex .brace-left {
+ left: 0;
+ overflow: hidden;
+ position: absolute;
+ width: 25.1%;
+}
+
+.katex .brace-center {
+ left: 25%;
+ overflow: hidden;
+ position: absolute;
+ width: 50%;
+}
+
+.katex .brace-right {
+ overflow: hidden;
+ position: absolute;
+ right: 0;
+ width: 25.1%;
+}
+
+.katex .x-arrow-pad {
+ padding: 0 0.5rem;
+}
+
+.katex .cd-arrow-pad {
+ padding: 0 0.55556rem 0 0.27778rem;
+}
+
+.katex .mover,
+.katex .munder,
+.katex .x-arrow {
+ text-align: center;
+}
+
+.katex .boxpad {
+ padding: 0 0.3rem;
+}
+
+.katex .fbox,
+.katex .fcolorbox {
+ border: 0.04rem solid;
+ box-sizing: border-box;
+}
+
+.katex .cancel-pad {
+ padding: 0 0.2rem;
+}
+
+.katex .cancel-lap {
+ margin-left: -0.2rem;
+ margin-right: -0.2rem;
+}
+
+.katex .sout {
+ border-bottom-style: solid;
+ border-bottom-width: 0.08rem;
+}
+
+.katex .angl {
+ border-right: 0.049rem solid;
+ border-top: 0.049rem solid;
+ box-sizing: border-box;
+ margin-right: 0.03889rem;
+}
+
+.katex .anglpad {
+ padding: 0 0.03889rem;
+}
+
+.katex .eqn-num::before {
+ content: "(" counter(katexEqnNo) ")";
+ counter-increment: katexEqnNo;
+}
+
+.katex .mml-eqn-num::before {
+ content: "(" counter(mmlEqnNo) ")";
+ counter-increment: mmlEqnNo;
+}
+
+.katex .mtr-glue {
+ width: 50%;
+}
+
+.katex .cd-vert-arrow {
+ display: inline-block;
+ position: relative;
+}
+
+.katex .cd-label-left {
+ display: inline-block;
+ position: absolute;
+ right: calc(50% + 0.3rem);
+ text-align: left;
+}
+
+.katex .cd-label-right {
+ display: inline-block;
+ left: calc(50% + 0.3rem);
+ position: absolute;
+ text-align: right;
+}
+
+.katex-display {
+ display: block;
+ margin: 1rem 0;
+ text-align: center;
+}
+
+.katex-display > .katex {
+ display: block;
+ text-align: center;
+ white-space: nowrap;
+}
+
+.katex-display > .katex > .katex-html {
+ display: block;
+ position: relative;
+}
+
+.katex-display > .katex > .katex-html > .tag {
+ position: absolute;
+ right: 0;
+}
+
+.katex-display.leqno > .katex > .katex-html > .tag {
+ left: 0;
+ right: auto;
+}
+
+.katex-display.fleqn > .katex {
+ padding-left: 2rem;
+ text-align: left;
+}
+
+body {
+ counter-reset: katexEqnNo mmlEqnNo;
+}
diff --git a/frontend/src/css/md.css b/frontend/src/css/md.css
new file mode 100644
index 0000000000..d307dfb752
--- /dev/null
+++ b/frontend/src/css/md.css
@@ -0,0 +1,157 @@
+.markdown p,
+.markdown .paragraph,
+.markdown ol,
+.markdown ul,
+.markdown span:not(.arithmatex *, code *, .MuiBox-root) {
+ /* the not selector makes sure we don't change katex/LaTeX styles */
+ line-height: 1.5rem;
+ font-family: "PT Sans", sans-serif;
+}
+
+.markdown p:first-child,
+.markdown .paragraph:first-child {
+ margin-block-start: 0;
+}
+
+.markdown p:last-child,
+.markdown .paragraph:last-child {
+ margin-block-end: 0;
+}
+
+.katex {
+ font-size: 1.1rem;
+}
+
+.markdown h1,
+.markdown h2,
+.markdown h3 {
+ font-weight: normal;
+}
+
+.markdown h1 {
+ /* provide by the browser, but removed from 'reset' */
+ display: block;
+ font-size: 2rem;
+ margin-block-start: 0.67rem;
+ margin-block-end: 0.67rem;
+ margin-inline-start: 0;
+ margin-inline-end: 0;
+ text-align: center;
+}
+
+.markdown h2 {
+ /* provide by the browser, but removed from 'reset' */
+ display: block;
+ font-size: 1.5rem;
+ margin-block-start: 0.83rem;
+ margin-block-end: 0.83rem;
+ margin-inline-start: 0;
+ margin-inline-end: 0;
+}
+
+.markdown h3 {
+ /* provide by the browser, but removed from 'reset' */
+ display: block;
+ font-size: 1.17rem;
+ margin-block-start: 1rem;
+ margin-block-end: 1rem;
+ margin-inline-start: 0;
+ margin-inline-end: 0;
+}
+
+.markdown p,
+.markdown .paragraph {
+ /* provide by the browser, but removed from 'reset' */
+ display: block;
+ margin-block-start: 1rem;
+ margin-block-end: 1rem;
+ margin-inline-start: 0;
+ margin-inline-end: 0;
+}
+
+.markdown ul {
+ /* provide by the browser, but removed from 'reset' */
+ display: block;
+ list-style-type: disc;
+ margin-block-start: 1rem;
+ margin-block-end: 1rem;
+ margin-inline-start: 0;
+ margin-inline-end: 0;
+ padding-inline-start: 40px;
+}
+
+.markdown ol {
+ /* provide by the browser, but removed from 'reset' */
+ display: block;
+ list-style-type: decimal;
+ margin-block-start: 1rem;
+ margin-block-end: 1rem;
+ margin-inline-start: 0;
+ margin-inline-end: 0;
+ padding-inline-start: 40px;
+}
+
+.markdown li {
+ /* provided by the browser, but removed from 'reset' */
+ display: list-itrem;
+ text-align: -webkit-match-parent;
+}
+
+.markdown h1,
+.markdown h2,
+.markdown h3,
+.markdown h4,
+.markdown h5,
+.markdown h6 {
+ font-family: Lora, serif;
+}
+
+.markdown pre {
+ /* source code */
+ margin: 30px;
+ line-height: 1.8rem;
+ font-family: var(--monospace-font);
+ overflow: auto;
+ white-space: pre;
+}
+
+.markdown p code,
+.markdown .paragraph code,
+.markdown pre code,
+.markdown li code {
+ font-size: 0.875rem;
+ scroll-margin: ;
+}
+
+.markdown sup,
+.markdown sub {
+ vertical-align: baseline;
+ position: relative;
+ top: -0.4rem;
+}
+
+.markdown sub {
+ top: 0.4rem;
+}
+
+.markdown a {
+ color: hsl(var(--link));
+ cursor: pointer;
+}
+
+.markdown a:hover,
+.markdown a:active {
+ text-decoration: underline;
+}
+
+.markdown a:visited {
+ color: hsl(var(--link-visited));
+}
+
+.mo-label .markdown p,
+.mo-label-block .markdown p,
+.mo-label .markdown .paragraph,
+.mo-label-block .markdown .paragraph {
+ padding: 0;
+ margin: 0;
+}
diff --git a/frontend/src/css/table.css b/frontend/src/css/table.css
new file mode 100644
index 0000000000..63d6740c9a
--- /dev/null
+++ b/frontend/src/css/table.css
@@ -0,0 +1,46 @@
+table.dataframe {
+ border: none;
+ border-collapse: collapse;
+ border-spacing: 0;
+ table-layout: fixed;
+ font-size: 0.9375rem;
+ display: block;
+ max-width: 100%;
+ overflow: auto;
+}
+
+table.dataframe thead {
+ border-bottom: 1px solid;
+ vertical-align: bottom;
+
+ @apply border-foreground;
+}
+
+table.dataframe tbody tr:nth-child(odd) {
+ background: var(--lime-2);
+}
+
+table.dataframe tbody tr:nth-child(even) {
+ background: hsl(var(--card));
+}
+
+table.dataframe tbody tr:hover {
+ background: var(--yellow-5);
+}
+
+table.dataframe tr,
+table.dataframe th,
+table.dataframe td {
+ text-align: right;
+ vertical-align: middle;
+ padding: 0.5rem;
+ line-height: normal;
+ white-space: normal;
+ max-width: none;
+ border: none;
+ font-size: 0.875rem;
+}
+
+table.dataframe th {
+ font-weight: bold;
+}
diff --git a/frontend/src/custom.d.ts b/frontend/src/custom.d.ts
new file mode 100644
index 0000000000..aae3c1b28e
--- /dev/null
+++ b/frontend/src/custom.d.ts
@@ -0,0 +1,5 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+declare module "*.svg" {
+ const content: string | undefined;
+ export default content;
+}
diff --git a/frontend/src/editor/Cell.tsx b/frontend/src/editor/Cell.tsx
new file mode 100644
index 0000000000..661252e2c6
--- /dev/null
+++ b/frontend/src/editor/Cell.tsx
@@ -0,0 +1,626 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { closeCompletion, completionStatus } from "@codemirror/autocomplete";
+import { historyField } from "@codemirror/commands";
+import { foldAll, unfoldAll } from "@codemirror/language";
+import { EditorState, Prec, StateEffect } from "@codemirror/state";
+import { keymap, EditorView, ViewPlugin, ViewUpdate } from "@codemirror/view";
+import {
+ memo,
+ FocusEvent,
+ KeyboardEvent,
+ forwardRef,
+ useCallback,
+ useEffect,
+ useImperativeHandle,
+ useRef,
+ useLayoutEffect,
+} from "react";
+
+import { sendRun } from "@/core/network/requests";
+import { autocompletionKeymap, setup } from "@/core/codemirror/cm";
+
+import { UserConfig } from "../core/config";
+import { CellState } from "../core/model/cells";
+import { useCellActions } from "../core/state/cells";
+import { derefNotNull } from "../utils/dereference";
+import { ConsoleOutputArea, OutputArea } from "./Output";
+import { CreateCellButton } from "./cell/CreateCellButton";
+import { RunButton } from "./cell/RunButton";
+import { DeleteButton } from "./cell/DeleteButton";
+import { CellStatusComponent } from "./cell/CellStatus";
+import clsx from "clsx";
+import { renderShortcut } from "../components/shortcuts/renderShortcut";
+import {
+ formatKeymapExtension,
+ scrollActiveLineIntoView,
+ smartPlaceholderExtension,
+} from "../core/codemirror/extensions";
+import { useCellRenderCount } from "../hooks/useCellRenderCount";
+import { Functions } from "../utils/functions";
+import { Logger } from "../utils/Logger";
+import { SerializedEditorState } from "../core/codemirror/types";
+import { CellDragHandle, SortableCell } from "./SortableCell";
+import { CellId, HTMLCellId } from "../core/model/ids";
+import { Theme } from "../theme/useTheme";
+import { HOTKEYS } from "@/core/hotkeys/hotkeys";
+
+/**
+ * Imperative interface of the cell.
+ */
+export interface CellHandle {
+ /**
+ * The CodeMirror editor view.
+ */
+ editorView: EditorView;
+ /**
+ * Folds all code in the editor.
+ */
+ foldAll: () => boolean;
+ /**
+ * Unfolds all code in the editor.
+ */
+ unfoldAll: () => boolean;
+ /**
+ * Get the serialized editor state.
+ */
+ editorStateJSON: () => Record<string, unknown>;
+ /**
+ * Register the cell to run.
+ */
+ registerRun: () => void;
+}
+
+export interface CellProps
+ extends Pick<
+ CellState,
+ | "consoleOutputs"
+ | "status"
+ | "output"
+ | "initialContents"
+ | "edited"
+ | "errored"
+ | "interrupted"
+ | "runElapsedTimeMs"
+ > {
+ theme: Theme;
+ showPlaceholder: boolean;
+ cellId: CellId;
+ updateCellCode: (
+ cellId: CellId,
+ code: string,
+ formattingChange?: boolean
+ ) => void;
+ prepareCellForRun: (cellId: CellId) => void;
+ registerRunStart: () => void;
+ serializedEditorState: SerializedEditorState | null;
+ editing: boolean;
+ appClosed: boolean;
+ showDeleteButton: boolean;
+ /**
+ * If true, the cell is allowed to be focus on.
+ * This is false when the app is initially loading.
+ */
+ allowFocus: boolean;
+ createNewCell: (cellId: CellId, before: boolean) => void;
+ deleteCell: (cellId: CellId) => void;
+ focusCell: (cellId: CellId, before: boolean) => void;
+ moveCell: (cellId: CellId, before: boolean) => void;
+ moveToNextCell: (cellId: CellId, before: boolean) => void;
+ userConfig: UserConfig;
+}
+
+// TODO(akshayka): a component for displaying/editing the cell's name.
+const CellComponent = (
+ {
+ theme,
+ showPlaceholder,
+ allowFocus,
+ cellId,
+ initialContents,
+ output,
+ consoleOutputs,
+ status,
+ runElapsedTimeMs,
+ edited,
+ interrupted,
+ errored,
+ registerRunStart,
+ serializedEditorState,
+ editing,
+ appClosed,
+ showDeleteButton,
+ updateCellCode,
+ prepareCellForRun,
+ createNewCell,
+ deleteCell,
+ focusCell,
+ moveCell,
+ moveToNextCell,
+ userConfig,
+ }: CellProps,
+ ref: React.ForwardedRef<CellHandle>
+) => {
+ useCellRenderCount().countRender();
+
+ Logger.debug("Rendering Cell", cellId);
+ const cellRef = useRef<HTMLDivElement>(null);
+ const editorView = useRef<EditorView | null>(null);
+ // DOM node where the editorView will be mounted
+ const editorViewParentRef = useRef<HTMLDivElement>(null);
+ const runningOrQueuedRef = useRef<boolean | null>(null);
+
+ const needsRun = edited || interrupted;
+ const loading = status === "running" || status === "queued";
+ const { sendToTop, sendToBottom } = useCellActions();
+
+ // Performs side-effects that must run whenever the cell is run, but doesn't
+ // actually run the cell.
+ //
+ // Returns the code to run.
+ const prepareToRunEffects = useCallback(() => {
+ const code = derefNotNull(editorView).state.doc.toString();
+ closeCompletion(derefNotNull(editorView));
+ prepareCellForRun(cellId);
+ return code;
+ }, [cellId, editorView, prepareCellForRun]);
+
+ // An imperative interface to the code editor
+ useImperativeHandle(
+ ref,
+ () => ({
+ get editorView() {
+ return derefNotNull(editorView);
+ },
+ foldAll() {
+ if (editorView.current !== null) {
+ return foldAll(derefNotNull(editorView));
+ }
+ return false;
+ },
+ unfoldAll() {
+ if (editorView.current !== null) {
+ return unfoldAll(derefNotNull(editorView));
+ }
+ return false;
+ },
+ editorStateJSON: () => {
+ return derefNotNull(editorView).state.toJSON({ history: historyField });
+ },
+ registerRun: prepareToRunEffects,
+ }),
+ [editorView, prepareToRunEffects]
+ );
+
+ // Hack to provide the value of `running` to Code Mirror's EditorView.
+ useEffect(() => {
+ runningOrQueuedRef.current = loading;
+ }, [loading]);
+
+ const onRun = useCallback(() => {
+ if (!runningOrQueuedRef.current) {
+ const code = prepareToRunEffects();
+ registerRunStart();
+ sendRun(cellId, code);
+ }
+ }, [cellId, registerRunStart, prepareToRunEffects]);
+
+ const createBelow = useCallback(
+ () => createNewCell(cellId, /*before=*/ false),
+ [cellId, createNewCell]
+ );
+ const createAbove = useCallback(
+ () => createNewCell(cellId, /*before=*/ true),
+ [cellId, createNewCell]
+ );
+ const moveDown = useCallback(
+ () => moveCell(cellId, /*before=*/ false),
+ [cellId, moveCell]
+ );
+ const moveUp = useCallback(
+ () => moveCell(cellId, /*before=*/ true),
+ [cellId, moveCell]
+ );
+ const focusDown = useCallback(
+ () => focusCell(cellId, /*before=*/ false),
+ [cellId, focusCell]
+ );
+ const focusUp = useCallback(
+ () => focusCell(cellId, /*before=*/ true),
+ [cellId, focusCell]
+ );
+
+ useEffect(() => {
+ const runKeymap = keymap.of([
+ {
+ key: HOTKEYS.getHotkey("cell.run").key,
+ preventDefault: true,
+ run: () => {
+ onRun();
+ return true;
+ },
+ },
+ ]);
+ const runAndNewCellBelowKeymap = keymap.of([
+ {
+ key: HOTKEYS.getHotkey("cell.runAndNewBelow").key,
+ preventDefault: true,
+ run: (ev) => {
+ onRun();
+ ev.contentDOM.blur();
+ moveToNextCell(cellId, /*before=*/ false);
+ return true;
+ },
+ },
+ ]);
+ const runAndNewCellAboveKeymap = keymap.of([
+ {
+ key: HOTKEYS.getHotkey("cell.runAndNewAbove").key,
+ preventDefault: true,
+ run: (ev) => {
+ onRun();
+ ev.contentDOM.blur();
+ moveToNextCell(cellId, /*before=*/ true);
+ return true;
+ },
+ },
+ ]);
+ const deleteCellKeymap = keymap.of([
+ {
+ key: HOTKEYS.getHotkey("cell.delete").key,
+ preventDefault: true,
+ run: (cm) => {
+ // Cannot delete running cells, since we're waiting for their output.
+ // Cannot delete non-empty cells for safety
+ if (!runningOrQueuedRef.current && cm.state.doc.length === 0) {
+ deleteCell(cellId);
+ }
+ // shortcuts.delete (shift-backspace) overlaps with
+ // defaultKeymap's deleteCharBackward (backspace); we don't want
+ // shift-backspace to trigger character deletion, because otherwise
+ // users might accidentally delete their whole notebook if they
+ // absent-mindedly held these keys. That's why we always return true.
+ return true;
+ },
+ },
+ ]);
+ const moveDownKeymap = keymap.of([
+ {
+ key: HOTKEYS.getHotkey("cell.moveDown").key,
+ preventDefault: true,
+ run: () => {
+ moveDown();
+ return true;
+ },
+ },
+ ]);
+ const moveUpKeymap = keymap.of([
+ {
+ key: HOTKEYS.getHotkey("cell.moveUp").key,
+ preventDefault: true,
+ run: () => {
+ moveUp();
+ return true;
+ },
+ },
+ ]);
+ const focusDownKeymap = keymap.of([
+ {
+ key: HOTKEYS.getHotkey("cell.focusDown").key,
+ preventDefault: true,
+ run: () => {
+ focusDown();
+ return true;
+ },
+ },
+ ]);
+ const focusUpKeymap = keymap.of([
+ {
+ key: HOTKEYS.getHotkey("cell.focusUp").key,
+ preventDefault: true,
+ run: () => {
+ focusUp();
+ return true;
+ },
+ },
+ ]);
+ const sendToBottomKeymap = keymap.of([
+ {
+ key: HOTKEYS.getHotkey("cell.sendToBottom").key,
+ preventDefault: true,
+ run: () => {
+ sendToBottom(cellId);
+ return true;
+ },
+ },
+ ]);
+ const sendToTopKeymap = keymap.of([
+ {
+ key: HOTKEYS.getHotkey("cell.sendToTop").key,
+ preventDefault: true,
+ run: () => {
+ sendToTop(cellId);
+ return true;
+ },
+ },
+ ]);
+ const createAboveKeymap = keymap.of([
+ {
+ key: HOTKEYS.getHotkey("cell.createAbove").key,
+ preventDefault: true,
+ run: (ev) => {
+ ev.contentDOM.blur();
+ createAbove();
+ return true;
+ },
+ },
+ ]);
+ const createBelowKeymap = keymap.of([
+ {
+ key: HOTKEYS.getHotkey("cell.createBelow").key,
+ preventDefault: true,
+ run: (ev) => {
+ ev.contentDOM.blur();
+ createBelow();
+ return true;
+ },
+ },
+ ]);
+
+ const onChangePlugin = ViewPlugin.fromClass(
+ class {
+ constructor(private readonly view: EditorView) {}
+ update(update: ViewUpdate) {
+ if (update.docChanged) {
+ const nextCode = this.view.state.doc.toString();
+ updateCellCode(cellId, nextCode);
+ }
+ }
+ }
+ );
+
+ const extensions = [
+ ...setup(userConfig.completion, theme),
+ Prec.highest(runKeymap),
+ Prec.highest(runAndNewCellBelowKeymap),
+ Prec.highest(runAndNewCellAboveKeymap),
+ Prec.highest(deleteCellKeymap),
+ Prec.highest(moveDownKeymap),
+ Prec.highest(moveUpKeymap),
+ Prec.highest(focusDownKeymap),
+ Prec.highest(focusUpKeymap),
+ Prec.highest(sendToBottomKeymap),
+ Prec.highest(sendToTopKeymap),
+ Prec.highest(createAboveKeymap),
+ Prec.highest(createBelowKeymap),
+ Prec.highest(formatKeymapExtension(cellId, updateCellCode)),
+ scrollActiveLineIntoView(),
+ onChangePlugin,
+ showPlaceholder ? smartPlaceholderExtension("import marimo as mo") : [],
+ ];
+
+ // Should focus will be true if its a newly created editor
+ let shouldFocus: boolean;
+ if (serializedEditorState === null) {
+ // If the editor already exists, reconfigure it with the new extensions.
+ // Triggered when, e.g., placeholder changes.
+ if (editorView.current === null) {
+ // Otherwise, create a new editor.
+ editorView.current = new EditorView({
+ state: EditorState.create({
+ doc: initialContents,
+ extensions: extensions,
+ }),
+ });
+ shouldFocus = true;
+ } else {
+ editorView.current.dispatch({
+ effects: [StateEffect.reconfigure.of([extensions])],
+ });
+ shouldFocus = false;
+ }
+ } else {
+ editorView.current = new EditorView({
+ state: EditorState.fromJSON(
+ serializedEditorState,
+ {
+ doc: initialContents,
+ extensions: extensions,
+ },
+ { history: historyField }
+ ),
+ });
+ shouldFocus = true;
+ }
+
+ if (editorView.current !== null && editorViewParentRef.current !== null) {
+ // Always replace the children in case the editor view was re-created.
+ editorViewParentRef.current.replaceChildren(editorView.current.dom);
+ }
+
+ if (shouldFocus && allowFocus) {
+ // Focus and scroll into view; request an animation frame to
+ // avoid a race condition when new editors are created
+ // very rapidly by holding a hotkey
+ requestAnimationFrame(() => {
+ editorView.current?.focus();
+ editorView.current?.dom.scrollIntoView({
+ behavior: "smooth",
+ block: "center",
+ });
+ });
+ }
+
+ // We don't want to re-run this effect when `allowFocus` changes.
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [
+ cellId,
+ userConfig.completion.activate_on_typing,
+ theme,
+ showPlaceholder,
+ initialContents,
+ createAbove,
+ createBelow,
+ deleteCell,
+ focusUp,
+ focusDown,
+ moveUp,
+ moveDown,
+ moveToNextCell,
+ updateCellCode,
+ onRun,
+ serializedEditorState,
+ ]);
+
+ useLayoutEffect(() => {
+ if (editorView.current === null) {
+ return;
+ }
+ if (
+ editing &&
+ editorViewParentRef.current !== null &&
+ editorView.current !== null
+ ) {
+ editorViewParentRef.current.replaceChildren(editorView.current.dom);
+ }
+ }, [editing]);
+
+ // Close completion when focus leaves the cell's subtree.
+ const closeCompletionHandler = useCallback((e: FocusEvent) => {
+ if (
+ cellRef.current !== null &&
+ !cellRef.current.contains(e.relatedTarget) &&
+ editorView.current !== null
+ ) {
+ closeCompletion(editorView.current);
+ }
+ }, []);
+
+ // Clicking on the completion info causes the editor view to lose focus,
+ // because the completion is not a child of the editable editor DOM;
+ // as a workaround, when a completion is active, we refocus the editor
+ // on any keypress.
+ //
+ // See https://discuss.codemirror.net/t/adding-click-event-listener-to-autocomplete-tooltip-info-panel-is-not-working/4741
+ const resumeCompletionHandler = useCallback(
+ (e: KeyboardEvent) => {
+ if (
+ cellRef.current !== document.activeElement ||
+ editorView.current === null ||
+ completionStatus(editorView.current.state) !== "active"
+ ) {
+ return;
+ }
+
+ for (const keymap of autocompletionKeymap) {
+ if (e.key === keymap.key && keymap.run) {
+ keymap.run(editorView.current);
+ // preventDefault/stopPropagation: Don't process the keystrokes as
+ // typing into the editor, e.g., Enter should only select the
+ // completion, not also add a newline.
+ e.preventDefault();
+ e.stopPropagation();
+ break;
+ }
+ }
+ editorView.current.focus();
+ return;
+ },
+ [cellRef, editorView]
+ );
+
+ const outputArea = (
+ <OutputArea
+ output={output}
+ cellId={cellId}
+ stale={(loading || edited) && !interrupted}
+ />
+ );
+
+ const className = clsx("Cell", "hover-actions-parent", {
+ published: !editing,
+ "needs-run": needsRun,
+ "has-error": errored,
+ });
+
+ const HTMLId = HTMLCellId.create(cellId);
+ if (!editing) {
+ return errored || interrupted ? null : (
+ <div tabIndex={-1} id={HTMLId} ref={cellRef} className={className}>
+ {outputArea}
+ </div>
+ );
+ }
+
+ const editor = <div className="cm" ref={editorViewParentRef} />;
+
+ return (
+ <SortableCell
+ tabIndex={-1}
+ id={HTMLId}
+ ref={cellRef}
+ className={className}
+ onBlur={closeCompletionHandler}
+ onKeyDown={resumeCompletionHandler}
+ cellKey={cellId}
+ >
+ {outputArea}
+ <div className="tray">
+ <div className="shoulder-left hover-action">
+ <div className="shoulder-elem-top">
+ <CreateCellButton
+ tooltipContent={renderShortcut("cell.createAbove")}
+ appClosed={appClosed}
+ onClick={appClosed ? undefined : createAbove}
+ />
+ </div>
+ <div className="shoulder-elem-bottom">
+ <CreateCellButton
+ tooltipContent={renderShortcut("cell.createBelow")}
+ appClosed={appClosed}
+ onClick={appClosed ? undefined : createBelow}
+ />
+ </div>
+ </div>
+ {editor}
+ <div className="shoulder-right">
+ <CellStatusComponent
+ status={status}
+ interrupted={interrupted}
+ editing={editing}
+ edited={edited}
+ elapsedTime={runElapsedTimeMs}
+ />
+ <div className="flex align-bottom">
+ <RunButton
+ onClick={appClosed ? Functions.NOOP : onRun}
+ appClosed={appClosed}
+ status={status}
+ needsRun={needsRun}
+ />
+ <CellDragHandle />
+ </div>
+ </div>
+ <div className="shoulder-bottom hover-action">
+ {showDeleteButton ? (
+ <DeleteButton
+ appClosed={appClosed}
+ status={status}
+ onClick={() => {
+ if (!loading && !appClosed) {
+ deleteCell(cellId);
+ }
+ }}
+ />
+ ) : null}
+ </div>
+ </div>
+ <ConsoleOutputArea
+ consoleOutputs={consoleOutputs}
+ cellId={cellId}
+ stale={(status === "queued" || edited) && !interrupted}
+ />
+ </SortableCell>
+ );
+};
+
+export const Cell = memo(forwardRef<CellHandle, CellProps>(CellComponent));
diff --git a/frontend/src/editor/CommandPallette.tsx b/frontend/src/editor/CommandPallette.tsx
new file mode 100644
index 0000000000..33903cb890
--- /dev/null
+++ b/frontend/src/editor/CommandPallette.tsx
@@ -0,0 +1,96 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import React from "react";
+import {
+ CommandDialog,
+ CommandEmpty,
+ CommandGroup,
+ CommandInput,
+ CommandItem,
+ CommandList,
+ CommandSeparator,
+ CommandShortcut,
+} from "@/components/ui/command";
+import { useRegisteredActions } from "../core/state/actions";
+import { useRecentCommands } from "../hooks/useRecentCommands";
+import { Kbd } from "../components/ui/kbd";
+import { prettyPrintHotkey } from "../components/shortcuts/renderShortcut";
+import { HOTKEYS, HotkeyAction } from "@/core/hotkeys/hotkeys";
+
+export const CommandPallette = () => {
+ const [open, setOpen] = React.useState(false);
+ const registeredActions = useRegisteredActions();
+ const { recentCommands, addRecentCommand } = useRecentCommands();
+
+ React.useEffect(() => {
+ const down = (e: KeyboardEvent) => {
+ if (e.key === "k" && (e.metaKey || e.ctrlKey) && !e.shiftKey) {
+ e.preventDefault();
+ setOpen((open) => !open);
+ }
+ };
+ document.addEventListener("keydown", down);
+ return () => document.removeEventListener("keydown", down);
+ }, []);
+
+ const renderShortcutCommandItemIfNotRecent = (shortcut: HotkeyAction) => {
+ const isRecent = recentCommands.includes(shortcut);
+ if (isRecent) {
+ return null;
+ }
+ return renderShortcutCommandItem(shortcut);
+ };
+
+ const renderShortcutCommandItem = (shortcut: HotkeyAction) => {
+ const action = registeredActions[shortcut];
+ if (!action) {
+ return null;
+ }
+ const hotkey = HOTKEYS.getHotkey(shortcut);
+
+ return (
+ <CommandItem
+ onSelect={() => {
+ addRecentCommand(shortcut);
+ // Close first and then run the action, so the dialog doesn't steal focus
+ setOpen(false);
+ requestAnimationFrame(() => {
+ action();
+ });
+ }}
+ key={shortcut}
+ value={hotkey.name}
+ >
+ <span>{hotkey.name}</span>
+ <CommandShortcut>
+ <span className="flex ml-2 gap-1">
+ {prettyPrintHotkey(hotkey.key).map((key) => (
+ <Kbd key={key}>{key}</Kbd>
+ ))}
+ </span>
+ </CommandShortcut>
+ </CommandItem>
+ );
+ };
+
+ return (
+ <CommandDialog open={open} onOpenChange={setOpen}>
+ <CommandInput placeholder="Type to search..." />
+ <CommandList>
+ <CommandEmpty>No results found.</CommandEmpty>
+ {recentCommands.length > 0 && (
+ <CommandGroup heading="Recently Used">
+ {recentCommands.map((shortcut) =>
+ renderShortcutCommandItem(shortcut)
+ )}
+ <CommandSeparator />
+ </CommandGroup>
+ )}
+ <CommandGroup heading="Commands">
+ {HOTKEYS.iterate().map((shortcut) =>
+ renderShortcutCommandItemIfNotRecent(shortcut)
+ )}
+ </CommandGroup>
+ </CommandList>
+ </CommandDialog>
+ );
+};
diff --git a/frontend/src/editor/Controls.styles.ts b/frontend/src/editor/Controls.styles.ts
new file mode 100644
index 0000000000..32e596742b
--- /dev/null
+++ b/frontend/src/editor/Controls.styles.ts
@@ -0,0 +1,9 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+export const topRightControls =
+ "fixed top-3 right-3 m-0 flex items-center space-x-3";
+
+export const bottomRightControls =
+ "fixed bottom-4 right-4 flex items-center space-x-3";
+
+export const bottomLeftControls =
+ "fixed bottom-4 left-4 m-0 flex items-center space-x-3";
diff --git a/frontend/src/editor/Controls.tsx b/frontend/src/editor/Controls.tsx
new file mode 100644
index 0000000000..c97ada96ee
--- /dev/null
+++ b/frontend/src/editor/Controls.tsx
@@ -0,0 +1,200 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import {
+ AppWindowIcon,
+ SaveIcon,
+ EditIcon,
+ PlayIcon,
+ RotateCcwIcon,
+ SquareIcon,
+} from "lucide-react";
+
+import { Button } from "@/editor/inputs/Inputs";
+import { KeyboardShortcuts } from "editor/KeyboardShortcuts";
+import { ShutdownButton } from "editor/ShutdownButton";
+import { RecoveryButton } from "editor/RecoveryButton";
+
+import * as styles from "./Controls.styles";
+import { Tooltip } from "../components/ui/tooltip";
+import { renderShortcut } from "../components/shortcuts/renderShortcut";
+import { useCellActions } from "../core/state/cells";
+import { AppConfigButton } from "../components/app-config/app-config-button";
+import { useState, useEffect } from "react";
+
+interface ControlsProps {
+ filename: string | null;
+ needsSave: boolean;
+ onSaveNotebook: () => void;
+ getCellsAsJSON: () => string;
+ presenting: boolean;
+ onTogglePresenting: () => void;
+ onInterrupt: () => void;
+ onRun: () => void;
+ onShutdown: () => void;
+ closed: boolean;
+ running: boolean;
+ needsRun: boolean;
+ undoAvailable: boolean;
+}
+
+export const Controls = ({
+ filename,
+ needsSave,
+ onSaveNotebook,
+ getCellsAsJSON,
+ presenting,
+ onTogglePresenting,
+ onInterrupt,
+ onRun,
+ onShutdown,
+ closed,
+ running,
+ needsRun,
+ undoAvailable,
+}: ControlsProps): JSX.Element => {
+ const { undoDeleteCell } = useCellActions();
+
+ const handleSaveClick = (e: React.MouseEvent<HTMLButtonElement>) => {
+ e.preventDefault();
+ e.stopPropagation();
+ onSaveNotebook();
+ };
+
+ let undoControl: JSX.Element | null = null;
+ if (!closed && undoAvailable) {
+ undoControl = (
+ <Tooltip content="Undo cell deletion">
+ <Button
+ size="medium"
+ color="hint-green"
+ shape="circle"
+ onClick={undoDeleteCell}
+ >
+ <RotateCcwIcon size={16} strokeWidth={1.5} />
+ </Button>
+ </Tooltip>
+ );
+ }
+
+ return (
+ <>
+ {closed ? null : (
+ <div className={styles.topRightControls}>
+ <AppConfigButton />
+ <ShutdownButton onShutdown={onShutdown} />
+ </div>
+ )}
+
+ <div className={styles.bottomLeftControls}>
+ {closed ? (
+ <RecoveryButton
+ filename={filename}
+ getCellsAsJSON={getCellsAsJSON}
+ needsSave={needsSave}
+ />
+ ) : (
+ <Tooltip content={renderShortcut("global.save")}>
+ <Button
+ id="save-button"
+ shape="rectangle"
+ color={needsSave ? "yellow" : "hint-green"}
+ onClick={handleSaveClick}
+ >
+ <SaveIcon strokeWidth={1.5} />
+ </Button>
+ </Tooltip>
+ )}
+
+ <Tooltip content={renderShortcut("global.hideCode")}>
+ <Button
+ id="preview-button"
+ shape="rectangle"
+ color="white"
+ onClick={onTogglePresenting}
+ >
+ {presenting ? (
+ <EditIcon strokeWidth={1.5} />
+ ) : (
+ <AppWindowIcon strokeWidth={1.5} />
+ )}
+ </Button>
+ </Tooltip>
+
+ <KeyboardShortcuts />
+ </div>
+
+ <div className={styles.bottomRightControls}>
+ {undoControl}
+ {!closed && (
+ <RunControlButton
+ running={running}
+ needsRun={needsRun}
+ onRun={onRun}
+ onInterrupt={onInterrupt}
+ />
+ )}
+ </div>
+ </>
+ );
+};
+
+const RunControlButton = ({
+ running,
+ needsRun,
+ onRun,
+ onInterrupt,
+}: {
+ running: boolean;
+ needsRun: boolean;
+ onRun: () => void;
+ onInterrupt: () => void;
+}) => {
+ // Start a timer when the run starts.
+ // After 200ms, show the interrupt button to avoid flickering.
+ const [hasRunLongEnough, setHasRunLongEnough] = useState(false);
+ useEffect(() => {
+ if (!running) {
+ return;
+ }
+ setHasRunLongEnough(false);
+ const timeout = setTimeout(() => {
+ setHasRunLongEnough(true);
+ }, 200);
+ return () => clearTimeout(timeout);
+ }, [running]);
+
+ if (running && hasRunLongEnough) {
+ return (
+ <Tooltip content={renderShortcut("global.interrupt")}>
+ <Button
+ size="medium"
+ color="yellow"
+ shape="circle"
+ onClick={onInterrupt}
+ >
+ <SquareIcon strokeWidth={1.5} size={16} />
+ </Button>
+ </Tooltip>
+ );
+ } else if (needsRun) {
+ return (
+ <Tooltip content={renderShortcut("global.runStale")}>
+ <Button size="medium" color="yellow" shape="circle" onClick={onRun}>
+ <PlayIcon strokeWidth={1.5} size={16} />
+ </Button>
+ </Tooltip>
+ );
+ }
+
+ return (
+ <Tooltip content="Nothing to run">
+ <Button
+ className={"inactive-button"}
+ color="disabled"
+ size="medium"
+ shape="circle"
+ >
+ <PlayIcon strokeWidth={1.5} size={16} />
+ </Button>
+ </Tooltip>
+ );
+};
diff --git a/frontend/src/editor/DirCompletionInput.tsx b/frontend/src/editor/DirCompletionInput.tsx
new file mode 100644
index 0000000000..9762b3053b
--- /dev/null
+++ b/frontend/src/editor/DirCompletionInput.tsx
@@ -0,0 +1,258 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import {
+ createRef,
+ useEffect,
+ useImperativeHandle,
+ useRef,
+ useState,
+} from "react";
+
+import { sendDirectoryAutocompleteRequest } from "@/core/network/requests";
+import { Input } from "./inputs/Inputs";
+import { Logger } from "../utils/Logger";
+import { Functions } from "../utils/functions";
+import { cn } from "../lib/utils";
+
+function extractBasename(path: string): string {
+ const basename = path.split(/[/\\]/).pop();
+ // split on empty string returns an empty string, so basename should
+ // never be undefined ... satisfy typescript
+ return basename ?? "";
+}
+
+export interface DirCompletionInputHandle {
+ suggestions: string[];
+}
+
+interface DirCompletionInputProps
+ extends React.InputHTMLAttributes<HTMLInputElement> {
+ flexibleWidth?: boolean;
+ resetOnBlur?: boolean;
+ placeholderText?: string;
+ initialValue?: string | null;
+ onFocusCallback?: () => void;
+ onBlurCallback?: () => void;
+ onChangeCallback?: (value: string) => void;
+ handle?: React.RefObject<DirCompletionInputHandle>;
+}
+
+export const DirCompletionInput = ({
+ flexibleWidth = false,
+ resetOnBlur = false,
+ placeholderText = "",
+ initialValue = null,
+ onFocusCallback = Functions.NOOP,
+ onBlurCallback = Functions.NOOP,
+ onChangeCallback = Functions.NOOP,
+ handle = createRef(),
+ ...rest
+}: DirCompletionInputProps): JSX.Element => {
+ // every completion request gets a token; later requests invalidate
+ // previous ones, to avoid races
+ const completionTokenRef = useRef<number>(0);
+ const [value, setValue] = useState(initialValue);
+ const [suggestions, setSuggestions] = useState<string[]>([]);
+ const [activeSuggestion, setActiveSuggestion] = useState<number | null>(null);
+ const [focused, setFocused] = useState<boolean>(false);
+
+ useImperativeHandle(handle, () => ({
+ get suggestions() {
+ return suggestions;
+ },
+ }));
+ const ref = useRef<HTMLInputElement>(null);
+ const activeSuggestionRef = useRef<HTMLLIElement | null>(null);
+
+ useEffect(() => {
+ setValue(initialValue);
+ }, [initialValue]);
+
+ function onFocus(e: React.FocusEvent<HTMLInputElement>) {
+ setFocused(true);
+ onFocusCallback();
+ }
+
+ async function onBlur(e: React.FocusEvent<HTMLInputElement>) {
+ // focus should be removed before value is reset, to avoid a race
+ // condition in which suggestions are fetched when not needed
+ setFocused(false);
+ if (resetOnBlur) {
+ e.preventDefault();
+ setValue(initialValue);
+ }
+ onBlurCallback();
+ }
+
+ async function handleChange(e: React.ChangeEvent<HTMLInputElement>) {
+ setValue(e.target.value);
+ onChangeCallback(e.target.value);
+ }
+
+ useEffect(() => {
+ async function fetchAndSetSuggestions(prefix: string, token: number) {
+ try {
+ const data = await sendDirectoryAutocompleteRequest(prefix);
+ // Only set suggestions if this token has not been invalidated
+ if (token === completionTokenRef.current) {
+ setActiveSuggestion(null);
+ setSuggestions([...data.directories, ...data.files]);
+ }
+ } catch (error) {
+ Logger.error("Failed to autocomplete directory: ", error);
+ }
+ }
+
+ completionTokenRef.current += 1;
+ if (focused && value !== null) {
+ fetchAndSetSuggestions(
+ value === null ? "" : value,
+ completionTokenRef.current
+ );
+ } else {
+ setActiveSuggestion(null);
+ setSuggestions([]);
+ }
+ }, [value, focused]);
+
+ function chooseSuggestion(index: number) {
+ const prefix = value === null ? "" : value;
+ const basename = extractBasename(prefix);
+ const completion = suggestions[index].slice(basename.length);
+ setValue(`${prefix + completion}/`);
+ if (ref.current != null) {
+ ref.current.focus();
+ }
+ }
+
+ function handleSuggestionMouseDown(
+ index: number,
+ e: React.MouseEvent<HTMLLIElement>
+ ) {
+ e.preventDefault();
+ if (e.button === 0 && !suggestions[index].endsWith(".py")) {
+ chooseSuggestion(index);
+ }
+ }
+
+ function onKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {
+ switch (e.key) {
+ case "Down":
+ case "ArrowDown":
+ setActiveSuggestion((i) =>
+ i == null ? 0 : (i + 1) % suggestions.length
+ );
+ e.preventDefault();
+ break;
+ case "Up":
+ case "ArrowUp":
+ setActiveSuggestion((i) =>
+ i === null || i === 0 ? suggestions.length - 1 : i - 1
+ );
+ e.preventDefault();
+ break;
+ case "Enter":
+ case "ArrowRight":
+ if (activeSuggestion === null) {
+ break;
+ }
+ e.preventDefault();
+ e.stopPropagation();
+ if (!suggestions[activeSuggestion].endsWith(".py")) {
+ chooseSuggestion(activeSuggestion);
+ }
+ break;
+ case "Esc":
+ case "Escape":
+ if (ref.current !== null) {
+ ref.current.blur();
+ }
+ e.preventDefault();
+ break;
+ default:
+ break;
+ }
+ }
+
+ useEffect(() => {
+ if (activeSuggestion !== null && activeSuggestionRef.current != null) {
+ const elem = activeSuggestionRef.current;
+ const parent = elem.parentElement;
+ if (parent === null) {
+ Logger.error("Expected elem to have parent; elem:", elem);
+ } else {
+ const scrollOffset = parent.scrollTop;
+ const visibleRange = [scrollOffset, scrollOffset + parent.offsetHeight];
+ if (elem.offsetTop < visibleRange[0]) {
+ activeSuggestionRef.current.scrollIntoView(/* alignToTop = */ true);
+ } else if (elem.offsetTop + elem.offsetHeight > visibleRange[1]) {
+ activeSuggestionRef.current.scrollIntoView(/* alignToTop = */ false);
+ }
+ }
+ }
+ }, [activeSuggestion]);
+
+ const suggestionsList =
+ suggestions.length === 0 || ref.current == null ? null : (
+ <ul
+ className="autocomplete-list"
+ style={{
+ maxWidth: ref.current.offsetWidth,
+ width: ref.current.offsetWidth,
+ }}
+ >
+ {suggestions.map((suggestion, index) => {
+ const isFile = suggestion.endsWith(".py");
+ const icon = isFile ? "📄" : "📁 ";
+ const isActive = activeSuggestion === index;
+ return (
+ <li
+ key={suggestion}
+ className={cn({
+ file: isFile,
+ directory: !isFile,
+ "active-suggestion": isActive,
+ })}
+ onMouseDown={(e) => handleSuggestionMouseDown(index, e)}
+ ref={isActive ? activeSuggestionRef : null}
+ >
+ {icon} {suggestion}
+ </li>
+ );
+ })}
+ </ul>
+ );
+
+ let size: number | undefined;
+ if (flexibleWidth) {
+ size = Math.min(
+ 60,
+ Math.max(placeholderText.length, value === null ? 0 : value.length)
+ );
+ }
+
+ const displayValue =
+ !focused && placeholderText !== ""
+ ? placeholderText
+ : value === null
+ ? ""
+ : value;
+ return (
+ <div className="DirCompletionInput">
+ <Input
+ type="text"
+ spellCheck="false"
+ value={displayValue}
+ style={{ width: "unset" }}
+ autoComplete="off"
+ ref={ref}
+ size={size}
+ onFocus={onFocus}
+ onChange={handleChange}
+ onBlur={onBlur}
+ onKeyDown={onKeyDown}
+ {...rest}
+ />
+ {suggestionsList}
+ </div>
+ );
+};
diff --git a/frontend/src/editor/Disconnected.tsx b/frontend/src/editor/Disconnected.tsx
new file mode 100644
index 0000000000..43b80d38c3
--- /dev/null
+++ b/frontend/src/editor/Disconnected.tsx
@@ -0,0 +1,9 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+
+export const Disconnected = (props: { reason: string }) => {
+ return (
+ <div id="Disconnected">
+ <p>{props.reason}</p>
+ </div>
+ );
+};
diff --git a/frontend/src/editor/FilenameForm.tsx b/frontend/src/editor/FilenameForm.tsx
new file mode 100644
index 0000000000..d413340bb9
--- /dev/null
+++ b/frontend/src/editor/FilenameForm.tsx
@@ -0,0 +1,157 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useRef, useState } from "react";
+import { CheckIcon, XIcon } from "lucide-react";
+
+import { Button } from "@/editor/inputs/Inputs";
+import {
+ DirCompletionInput,
+ DirCompletionInputHandle,
+} from "editor/DirCompletionInput";
+import { useImperativeModal } from "@/components/modal/ImperativeModal";
+import {
+ AlertDialogDescription,
+ AlertDialogHeader,
+ AlertDialogTitle,
+} from "@/components/ui/alert-dialog";
+
+export const FilenameForm = ({
+ filename,
+ setFilename,
+}: {
+ filename: string | null;
+ setFilename: (filename: string | null) => Promise<string | null>;
+}): JSX.Element => {
+ const { openAlert } = useImperativeModal();
+ const placeholderText = filename === null ? "untitled marimo app" : filename;
+ const [showButtons, setShowButtons] = useState(false);
+ const [validName, setValidName] = useState(false);
+ const handle = useRef<DirCompletionInputHandle | null>(null);
+
+ function validateAndSubmitFilenameChange() {
+ const inputEl = document.getElementById(
+ "filename-input"
+ ) as HTMLInputElement | null;
+ if (inputEl === null) {
+ throw new Error("Could not find filename form");
+ }
+ const value = inputEl.value;
+ if (value.length === 0 || value === ".py") {
+ openAlert(
+ <AlertDialogHeader>
+ <AlertDialogTitle className="text-destructive">
+ Oops!
+ </AlertDialogTitle>
+ <AlertDialogDescription>
+ The filename can't be empty. Make sure to enter a non-empty name.
+ </AlertDialogDescription>
+ </AlertDialogHeader>
+ );
+ inputEl.blur();
+ } else if (value.endsWith(".py")) {
+ setFilename(value).then(() => {
+ inputEl.blur();
+ });
+ } else {
+ setFilename(`${value}.py`).then(() => {
+ // wait for setter to resolve before blurring, because blurring
+ // resets the underlying value
+ inputEl.blur();
+ });
+ }
+ }
+
+ function handleSubmit(e: React.FormEvent<HTMLFormElement>) {
+ e.preventDefault();
+ validateAndSubmitFilenameChange();
+ }
+
+ // MouseDown is fired before Blur
+ function handleMouseDown(e: React.MouseEvent<HTMLButtonElement>) {
+ e.preventDefault();
+ validateAndSubmitFilenameChange();
+ }
+
+ function onFocus() {
+ setShowButtons(true);
+ }
+
+ function onBlur() {
+ // TODO(akshayka): if tabbed to button, buttons (and input value)
+ // should remain visible
+ setShowButtons(false);
+ }
+
+ function onChange(value: string) {
+ const completionHandle = handle.current;
+ if (completionHandle === null) {
+ return;
+ }
+
+ const candidate = value.endsWith(".py") ? value : `${value}.py`;
+ if (
+ // name should not be ".py"
+ candidate.length > 3 &&
+ // file should not already exist
+ !completionHandle.suggestions.includes(candidate)
+ ) {
+ setValidName(true);
+ } else {
+ setValidName(false);
+ }
+ }
+
+ const buttonVis = showButtons ? "visible" : "hidden";
+ return (
+ <div id="Filename">
+ <form id="filename-form" onSubmit={handleSubmit}>
+ <div /> {/* empty element as grid spacer */}
+ <div style={{ position: "relative" }}>
+ <DirCompletionInput
+ placeholderText={placeholderText}
+ initialValue={filename}
+ onChangeCallback={onChange}
+ onFocusCallback={onFocus}
+ onBlurCallback={onBlur}
+ resetOnBlur={true}
+ flexibleWidth={true}
+ handle={handle}
+ id="filename-input"
+ className={filename === null ? "missing-filename" : "filename"}
+ />
+ <Button
+ type="submit"
+ color={validName ? "green" : "gray"}
+ onMouseDown={handleMouseDown}
+ style={{
+ marginRight: "0px",
+ padding: "0px",
+ position: "absolute",
+ top: "0.25rem",
+ right: "-44px",
+ width: "30px",
+ height: "30px",
+ visibility: buttonVis,
+ }}
+ >
+ <CheckIcon size={16} strokeWidth={1.5} />
+ </Button>
+ <Button
+ color="gray"
+ style={{
+ marginRight: "0px",
+ padding: "0px",
+ position: "absolute",
+ top: "0.25rem",
+ right: "-86px",
+ width: "30px",
+ height: "30px",
+ visibility: buttonVis,
+ }}
+ >
+ <XIcon size={16} strokeWidth={1.5} />
+ </Button>
+ </div>
+ </form>
+ </div>
+ );
+};
diff --git a/frontend/src/editor/KeyboardShortcuts.tsx b/frontend/src/editor/KeyboardShortcuts.tsx
new file mode 100644
index 0000000000..5593e2fac1
--- /dev/null
+++ b/frontend/src/editor/KeyboardShortcuts.tsx
@@ -0,0 +1,90 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useRef } from "react";
+import { KeyboardIcon } from "lucide-react";
+
+import { Button } from "@/editor/inputs/Inputs";
+import { useHotkey } from "../hooks/useHotkey";
+import { Tooltip } from "../components/ui/tooltip";
+import { Kbd } from "../components/ui/kbd";
+import {
+ Dialog,
+ DialogContent,
+ DialogPortal,
+ DialogOverlay,
+ DialogTrigger,
+ DialogTitle,
+} from "../components/ui/dialog";
+import {
+ prettyPrintHotkey,
+ renderShortcut,
+} from "../components/shortcuts/renderShortcut";
+import { HOTKEYS, HotkeyAction, HotkeyGroup } from "@/core/hotkeys/hotkeys";
+
+export const KeyboardShortcuts = (): JSX.Element => {
+ const ref = useRef<HTMLButtonElement | null>(null);
+
+ useHotkey("global.showHelp", () => {
+ ref.current?.click();
+ });
+
+ const renderItem = (action: HotkeyAction) => {
+ const hotkey = HOTKEYS.getHotkey(action);
+ return (
+ <div className="keyboard-shortcut" key={action}>
+ <div className="flex gap-1">
+ {prettyPrintHotkey(hotkey.key).map((key) => (
+ <Kbd key={key}>{key}</Kbd>
+ ))}
+ </div>
+ <span>{hotkey.name.toLowerCase()}</span>
+ </div>
+ );
+ };
+
+ const groups = HOTKEYS.getHotkeyGroups();
+ const renderGroup = (group: HotkeyGroup) => {
+ const items = groups[group];
+ return (
+ <div className="keyboard-shortcut-group">
+ <h3 className="text-lg font-medium">{group}</h3>
+
+ {items.map((item) => renderItem(item))}
+ </div>
+ );
+ };
+
+ return (
+ <Dialog>
+ <Tooltip content={renderShortcut("global.showHelp")}>
+ <DialogTrigger asChild={true}>
+ <Button ref={ref} shape="rectangle" color="white">
+ <KeyboardIcon className="help-icon" strokeWidth={1.5} />
+ </Button>
+ </DialogTrigger>
+ </Tooltip>
+
+ {/* Manually portal so we can adjust positioning: shortcuts modal is too large to offset from top for some screens. */}
+ <DialogPortal className="sm:items-center sm:top-0">
+ <DialogOverlay />
+ <DialogContent
+ usePortal={false}
+ className="max-h-[90vh] overflow-y-auto min-w-[850px]"
+ >
+ <DialogTitle>Shortcuts</DialogTitle>
+ <div className="flex flex-row gap-3">
+ <div className="w-1/2">
+ {renderGroup("Editing")}
+ {renderGroup("Navigation")}
+ </div>
+
+ <div className="w-1/2">
+ {renderGroup("Running Cells")}
+ {renderGroup("Creation and Ordering")}
+ {renderGroup("Other")}
+ </div>
+ </div>
+ </DialogContent>
+ </DialogPortal>
+ </Dialog>
+ );
+};
diff --git a/frontend/src/editor/Output.tsx b/frontend/src/editor/Output.tsx
new file mode 100644
index 0000000000..26736271fb
--- /dev/null
+++ b/frontend/src/editor/Output.tsx
@@ -0,0 +1,120 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import React, { useMemo } from "react";
+
+import { OutputMessage } from "@/core/kernel/messages";
+
+import { logNever } from "../utils/assertNever";
+import { JsonOutput } from "./output/JsonOutput";
+import { HtmlOutput } from "./output/HtmlOutput";
+import { ImageOutput } from "./output/ImageOutput";
+import { MarimoErrorOutput } from "./output/MarimoErrorOutput";
+import { TextOutput } from "./output/TextOutput";
+import { VideoOutput } from "./output/VideoOutput";
+import { CellId } from "@/core/model/ids";
+
+/**
+ * Renders an output based on an OutputMessage.
+ */
+export function formatOutput({
+ message,
+ parsedJsonData = {},
+}: {
+ message: OutputMessage;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ parsedJsonData?: Record<string, any>;
+}): React.ReactNode {
+ const outputCls: string = message.channel;
+ // TODO(akshayka): audio; pdf; text/csv; excel?; text/css; text/javascript
+ switch (message.mimetype) {
+ case "text/html":
+ return <HtmlOutput className={outputCls} html={message.data} />;
+
+ case "text/plain":
+ return <TextOutput className={outputCls} text={message.data} />;
+
+ case "application/json":
+ // TODO: format is 'auto', but should make configurable once cells can
+ // support config
+ return (
+ <JsonOutput className={outputCls} data={parsedJsonData} format="auto" />
+ );
+ case "image/png":
+ case "image/svg+xml":
+ case "image/tiff":
+ case "image/avif":
+ case "image/bmp":
+ case "image/gif":
+ case "image/jpeg":
+ return <ImageOutput className={outputCls} src={message.data} alt="" />;
+
+ case "video/mp4":
+ case "video/mpeg":
+ return <VideoOutput className={outputCls} src={message.data} />;
+
+ case "application/vnd.marimo+error":
+ return <MarimoErrorOutput errors={message.data} />;
+
+ default:
+ logNever(message);
+ return null;
+ }
+}
+
+export const OutputArea = React.memo(
+ (props: { output: OutputMessage | null; cellId: CellId; stale: boolean }) => {
+ // Memoize parsing the json data
+ const parsedJsonData = useMemo(() => {
+ if (!props.output) {
+ return;
+ }
+
+ const { mimetype, data } = props.output;
+ switch (mimetype) {
+ case "application/json":
+ return typeof data === "string" ? JSON.parse(data) : data;
+ default:
+ return;
+ }
+ }, [props.output]);
+
+ if (props.output === null) {
+ return null;
+ } else if (props.output.channel === "output" && props.output.data === "") {
+ return null;
+ } else {
+ const cls = `OutputArea${props.stale ? " marimo-output-stale" : ""}`;
+ const title = props.stale ? "This output is stale" : undefined;
+ return (
+ <div title={title} className={cls}>
+ {formatOutput({
+ message: props.output,
+ parsedJsonData: parsedJsonData,
+ })}
+ </div>
+ );
+ }
+ }
+);
+OutputArea.displayName = "OutputArea";
+
+export const ConsoleOutputArea = (props: {
+ consoleOutputs: OutputMessage[];
+ cellId: CellId;
+ stale: boolean;
+}): React.ReactNode => {
+ if (props.consoleOutputs.length === 0) {
+ return null;
+ }
+
+ const cls = `ConsoleOutputArea${props.stale ? " marimo-output-stale" : ""}`;
+ const title = props.stale ? "This console output is stale" : undefined;
+ return (
+ <div title={title} className={cls}>
+ {props.consoleOutputs.map((output) =>
+ formatOutput({
+ message: output,
+ })
+ )}
+ </div>
+ );
+};
diff --git a/frontend/src/editor/RecoveryButton.tsx b/frontend/src/editor/RecoveryButton.tsx
new file mode 100644
index 0000000000..034dbd3ea7
--- /dev/null
+++ b/frontend/src/editor/RecoveryButton.tsx
@@ -0,0 +1,124 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { Button as EditorButton } from "@/editor/inputs/Inputs";
+import { Button } from "components/ui/button";
+import { useHotkey } from "../hooks/useHotkey";
+import { SaveIcon } from "lucide-react";
+import { Tooltip } from "../components/ui/tooltip";
+import { renderShortcut } from "../components/shortcuts/renderShortcut";
+import { useImperativeModal } from "../components/modal/ImperativeModal";
+import {
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogTitle,
+} from "../components/ui/dialog";
+
+const RecoveryModal = (props: {
+ proposedName: string;
+ getCellsAsJSON: () => string;
+ closeModal: () => void;
+}): JSX.Element => {
+ const downloadRecoveryFile = () => {
+ const link = document.createElement("a");
+ link.download = `${props.proposedName}.json`;
+ link.href = window.URL.createObjectURL(
+ new Blob([props.getCellsAsJSON()], { type: "text/plain" })
+ );
+ link.click();
+ };
+
+ // NB: we use markdown class to have sane styling for list, paragraph
+ return (
+ <DialogContent className="w-fit">
+ <form
+ onSubmit={(e) => {
+ e.preventDefault();
+ downloadRecoveryFile();
+ props.closeModal();
+ }}
+ onKeyDown={(e) => {
+ if (e.key === "Escape") {
+ props.closeModal();
+ }
+ }}
+ >
+ <DialogTitle className="text-accent mb-6">
+ Download unsaved changes?
+ </DialogTitle>
+ <DialogDescription className="markdown">
+ <p>This app has unsaved changes. To recover:</p>
+
+ <ol>
+ <li style={{ paddingBottom: "10px" }}>
+ Click the "Download" button. This will download a file
+ called&nbsp;
+ <code>{props.proposedName}.json</code>. This file contains your
+ code.
+ </li>
+
+ <li style={{ paddingBottom: "10px" }}>
+ In your terminal, type
+ <code style={{ display: "block", padding: "10px" }}>
+ marimo recover {props.proposedName}.json {">"}{" "}
+ {props.proposedName}.py
+ </code>
+ to overwrite <code>{props.proposedName}.py</code> with the
+ recovered changes.
+ </li>
+ </ol>
+ </DialogDescription>
+ <DialogFooter>
+ <Button
+ aria-label="Cancel"
+ variant="secondary"
+ onClick={props.closeModal}
+ >
+ Cancel
+ </Button>
+ <Button aria-label="Download" variant="default" type="submit">
+ Download
+ </Button>
+ </DialogFooter>
+ </form>
+ </DialogContent>
+ );
+};
+
+export const RecoveryButton = (props: {
+ filename: string | null;
+ needsSave: boolean;
+ getCellsAsJSON: () => string;
+}): JSX.Element => {
+ const { filename, needsSave, getCellsAsJSON } = props;
+ const { openModal, closeModal } = useImperativeModal();
+
+ const proposedName = filename === null ? "app" : filename.slice(0, -3);
+
+ const openRecoveryModal = () => {
+ if (needsSave) {
+ openModal(
+ <RecoveryModal
+ getCellsAsJSON={getCellsAsJSON}
+ proposedName={proposedName}
+ closeModal={closeModal}
+ />
+ );
+ }
+ };
+
+ useHotkey("global.save", openRecoveryModal);
+
+ return (
+ <Tooltip content={renderShortcut("global.save")}>
+ <EditorButton
+ onClick={openRecoveryModal}
+ id="save-button"
+ aria-label="Save"
+ className="rectangle"
+ color={needsSave ? "yellow" : "gray"}
+ >
+ <SaveIcon strokeWidth={1.5} />
+ </EditorButton>
+ </Tooltip>
+ );
+};
diff --git a/frontend/src/editor/ShutdownButton.tsx b/frontend/src/editor/ShutdownButton.tsx
new file mode 100644
index 0000000000..806b355622
--- /dev/null
+++ b/frontend/src/editor/ShutdownButton.tsx
@@ -0,0 +1,62 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { XIcon } from "lucide-react";
+
+import {
+ AlertDialog,
+ AlertDialogCancel,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogDestructiveAction,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogTitle,
+ AlertDialogTrigger,
+} from "../components/ui/alert-dialog";
+import { Button } from "./inputs/Inputs";
+import { Tooltip } from "../components/ui/tooltip";
+
+interface ShutdownButtonProps {
+ onShutdown: (e: React.MouseEvent<HTMLButtonElement>) => void;
+}
+
+export const ShutdownButton = ({
+ onShutdown,
+}: ShutdownButtonProps): JSX.Element => {
+ return (
+ <AlertDialog>
+ <Tooltip content="Shutdown">
+ <AlertDialogTrigger asChild={true}>
+ <Button
+ aria-label="Shutdown"
+ shape="circle"
+ size="small"
+ color="red"
+ className="h-[27px] w-[27px]"
+ >
+ <XIcon strokeWidth={1} />
+ </Button>
+ </AlertDialogTrigger>
+ </Tooltip>
+ <AlertDialogContent>
+ <AlertDialogHeader>
+ <AlertDialogTitle className="text-destructive">
+ Shutdown?
+ </AlertDialogTitle>
+ <AlertDialogDescription>
+ This will terminate the Python kernel. You'll lose all data that's
+ in memory.
+ </AlertDialogDescription>
+ </AlertDialogHeader>
+ <AlertDialogFooter>
+ <AlertDialogCancel>Cancel</AlertDialogCancel>
+ <AlertDialogDestructiveAction
+ onClick={onShutdown}
+ aria-label="Confirm Shutdown"
+ >
+ Shutdown
+ </AlertDialogDestructiveAction>
+ </AlertDialogFooter>
+ </AlertDialogContent>
+ </AlertDialog>
+ );
+};
diff --git a/frontend/src/editor/SortableCell.tsx b/frontend/src/editor/SortableCell.tsx
new file mode 100644
index 0000000000..69b0f3b826
--- /dev/null
+++ b/frontend/src/editor/SortableCell.tsx
@@ -0,0 +1,74 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import React, { memo, useContext } from "react";
+import { mergeRefs } from "../utils/mergeRefs";
+import { useSortable } from "@dnd-kit/sortable";
+import { CSS } from "@dnd-kit/utilities";
+import { GripVerticalIcon } from "lucide-react";
+import { CellId } from "@/core/model/ids";
+
+interface Props extends React.HTMLAttributes<HTMLDivElement> {
+ cellKey: CellId;
+}
+
+/**
+ * Context for drag handle so it can be rendered in a Slot in the cell
+ */
+const DragHandleSlot = React.createContext<React.ReactNode>(null);
+
+export const CellDragHandle: React.FC = memo(() => {
+ // Slot for drag handle
+ return useContext(DragHandleSlot);
+});
+CellDragHandle.displayName = "DragHandle";
+
+const SortableCellInternal = React.forwardRef(
+ ({ cellKey, ...props }: Props, ref: React.Ref<HTMLDivElement>) => {
+ // Sort
+ const {
+ attributes,
+ listeners,
+ setNodeRef,
+ transform,
+ transition,
+ isDragging,
+ } = useSortable({ id: cellKey.toString() });
+
+ const style: React.CSSProperties = {
+ transform: transform
+ ? CSS.Transform.toString({
+ x: transform.x,
+ y: transform.y,
+ scaleX: 1,
+ scaleY: 1,
+ })
+ : undefined,
+ transition,
+ zIndex: isDragging ? 2 : undefined,
+ position: "relative",
+ };
+
+ const mergedRef = mergeRefs<HTMLDivElement>(ref, setNodeRef);
+
+ const dragHandle = (
+ <div
+ {...attributes}
+ {...listeners}
+ data-testid="drag-button"
+ className="py-[1px] mx-2 cursor-grab opacity-50 hover:opacity-100 hover-action"
+ >
+ <GripVerticalIcon strokeWidth={1} size={20} />
+ </div>
+ );
+
+ return (
+ <div tabIndex={-1} ref={mergedRef} {...props} style={style}>
+ <DragHandleSlot.Provider value={dragHandle}>
+ {props.children}
+ </DragHandleSlot.Provider>
+ </div>
+ );
+ }
+);
+SortableCellInternal.displayName = "SortableCell";
+
+export const SortableCell = memo(SortableCellInternal);
diff --git a/frontend/src/editor/boundary/ErrorBoundary.tsx b/frontend/src/editor/boundary/ErrorBoundary.tsx
new file mode 100644
index 0000000000..4da2ec942e
--- /dev/null
+++ b/frontend/src/editor/boundary/ErrorBoundary.tsx
@@ -0,0 +1,30 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { PropsWithChildren } from "react";
+import {
+ ErrorBoundary as ReactErrorBoundary,
+ FallbackProps,
+} from "react-error-boundary";
+import { Button } from "../../components/ui/button";
+
+export const ErrorBoundary: React.FC<PropsWithChildren> = (props) => {
+ return (
+ <ReactErrorBoundary FallbackComponent={FallbackComponent}>
+ {props.children}
+ </ReactErrorBoundary>
+ );
+};
+
+export const container =
+ "w-full h-full flex items-center justify-center flex-col space-y-4";
+
+const FallbackComponent: React.FC<FallbackProps> = (props) => {
+ return (
+ <div className={container}>
+ <h1>Something went wrong</h1>
+ <p>{props.error?.message}</p>
+ <Button onClick={props.resetErrorBoundary} variant="outline">
+ Try again
+ </Button>
+ </div>
+ );
+};
diff --git a/frontend/src/editor/cell/CellStatus.tsx b/frontend/src/editor/cell/CellStatus.tsx
new file mode 100644
index 0000000000..27d2448b1f
--- /dev/null
+++ b/frontend/src/editor/cell/CellStatus.tsx
@@ -0,0 +1,109 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { MoreHorizontalIcon, RefreshCwIcon } from "lucide-react";
+import { Tooltip } from "../../components/ui/tooltip";
+import { CellStatus } from "../../core/model/cells";
+import { useElapsedTime } from "../../hooks/useElapsedTime";
+
+interface Props {
+ editing: boolean;
+ status: CellStatus;
+ edited: boolean;
+ interrupted: boolean;
+ elapsedTime: number | null;
+}
+
+export const CellStatusComponent: React.FC<Props> = ({
+ editing,
+ status,
+ edited,
+ interrupted,
+ elapsedTime,
+}) => {
+ if (!editing) {
+ return null;
+ }
+
+ // Styling: CellStatusIcon visible if queued, running, or needs run.
+ //
+ // running & queued icons get priority over edited/interrupted
+ if (status === "running") {
+ return (
+ <Tooltip content={"This cell is running"} usePortal={false}>
+ <div
+ className={"cell-status-icon elapsed-time running"}
+ data-testid="cell-status"
+ >
+ <CellTimer />
+ </div>
+ </Tooltip>
+ );
+ } else if (status === "queued" && elapsedTime) {
+ // If elapsed time < 16ms (60fps), don't show the elapsed time,
+ // otherwise it will flicker.
+ if (elapsedTime < 16) {
+ return null;
+ }
+ return (
+ <Tooltip content={"This cell is queued to run"} usePortal={false}>
+ <div
+ className="cell-status-icon cell-status-queued"
+ data-testid="cell-status"
+ >
+ <MoreHorizontalIcon strokeWidth={1.5} />
+ </div>
+ </Tooltip>
+ );
+ } else if (edited || interrupted) {
+ const title = interrupted
+ ? "This cell was interrupted when it was last run"
+ : "This cell has been modified since it was last run";
+ return (
+ <Tooltip content={title} usePortal={false}>
+ <div
+ className="cell-status-icon cell-status-stale"
+ data-testid="cell-status"
+ >
+ <RefreshCwIcon strokeWidth={1.5} />
+ </div>
+ </Tooltip>
+ );
+ } else if (elapsedTime !== null) {
+ const elapsedTimeStr = formatElapsedTime(elapsedTime);
+ return (
+ <Tooltip
+ content={`This cell took ${elapsedTimeStr} to run`}
+ usePortal={false}
+ >
+ <div
+ className={"cell-status-icon elapsed-time hover-action"}
+ data-testid="cell-status"
+ >
+ <span>{elapsedTimeStr}</span>
+ </div>
+ </Tooltip>
+ );
+ }
+
+ return null;
+};
+
+function formatElapsedTime(elapsedTime: number | null) {
+ if (elapsedTime === null) {
+ return "";
+ }
+
+ if (elapsedTime > 1000 * 60) {
+ const minutes = (elapsedTime / (1000 * 60)).toFixed(0);
+ const seconds = ((elapsedTime % (1000 * 60)) / 1000).toFixed(0);
+ return `${minutes.toString()}m${seconds.toString()}s`;
+ } else if (elapsedTime > 1000) {
+ return `${(elapsedTime / 1000).toFixed(2).toString()}s`;
+ } else {
+ return `${elapsedTime.toFixed(0).toString()}ms`;
+ }
+}
+
+const CellTimer = () => {
+ const time = useElapsedTime();
+ return <span>{formatElapsedTime(time)}</span>;
+};
diff --git a/frontend/src/editor/cell/CreateCellButton.tsx b/frontend/src/editor/cell/CreateCellButton.tsx
new file mode 100644
index 0000000000..eace93c868
--- /dev/null
+++ b/frontend/src/editor/cell/CreateCellButton.tsx
@@ -0,0 +1,29 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { PlusIcon } from "lucide-react";
+import { Button } from "@/editor/inputs/Inputs";
+import { Tooltip } from "../../components/ui/tooltip";
+
+export const CreateCellButton = ({
+ appClosed,
+ onClick,
+ tooltipContent,
+}: {
+ appClosed: boolean;
+ tooltipContent: React.ReactNode;
+ onClick?: () => void;
+}) => {
+ return (
+ <Tooltip content={tooltipContent} usePortal={false}>
+ <Button
+ onClick={onClick}
+ className={`ShoulderButton ${appClosed ? " inactive-button" : ""}`}
+ shape="circle"
+ size="small"
+ color="hint-green"
+ data-testid="create-cell-button"
+ >
+ <PlusIcon strokeWidth={1.8} />
+ </Button>
+ </Tooltip>
+ );
+};
diff --git a/frontend/src/editor/cell/DeleteButton.tsx b/frontend/src/editor/cell/DeleteButton.tsx
new file mode 100644
index 0000000000..eb63cfbe9e
--- /dev/null
+++ b/frontend/src/editor/cell/DeleteButton.tsx
@@ -0,0 +1,51 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { Trash2Icon } from "lucide-react";
+import { Tooltip } from "../../components/ui/tooltip";
+import { CellStatus } from "../../core/model/cells";
+import { Button } from "../../components/ui/button";
+import { cn } from "../../lib/utils";
+
+export const DeleteButton = (props: {
+ status: CellStatus;
+ appClosed: boolean;
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
+}): JSX.Element => {
+ const { status, appClosed, onClick } = props;
+
+ const loading = status === "running" || status === "queued";
+
+ let tooltipMsg = null;
+ if (appClosed) {
+ tooltipMsg = "App disconnected";
+ } else if (status === "running") {
+ tooltipMsg = "A cell can't be deleted when it's running";
+ } else if (status === "queued") {
+ tooltipMsg = "A cell can't be deleted when it's queued to run";
+ } else {
+ tooltipMsg = "Delete";
+ }
+
+ return (
+ <Tooltip content={tooltipMsg} usePortal={false}>
+ <Button
+ variant="ghost"
+ size="icon"
+ onClick={onClick}
+ data-testid="delete-button"
+ className={cn(
+ "hover:bg-transparent text-destructive/60 hover:text-destructive",
+ {
+ DeleteButton: true,
+ "inactive-button": appClosed || loading,
+ running: loading,
+ }
+ )}
+ style={{
+ boxShadow: "none",
+ }}
+ >
+ <Trash2Icon size={14} />
+ </Button>
+ </Tooltip>
+ );
+};
diff --git a/frontend/src/editor/cell/RunButton.tsx b/frontend/src/editor/cell/RunButton.tsx
new file mode 100644
index 0000000000..2e72118fdb
--- /dev/null
+++ b/frontend/src/editor/cell/RunButton.tsx
@@ -0,0 +1,60 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { PlayIcon } from "lucide-react";
+import { Button } from "@/editor/inputs/Inputs";
+import { Tooltip } from "../../components/ui/tooltip";
+import { renderShortcut } from "../../components/shortcuts/renderShortcut";
+import { cn } from "../../lib/utils";
+import { CellStatus } from "../../core/model/cells";
+
+function computeColor(appClosed: boolean, needsRun: boolean, loading: boolean) {
+ if (appClosed) {
+ return "disabled";
+ } else if (needsRun && !loading) {
+ return "yellow";
+ } else if (loading) {
+ return "disabled";
+ } else {
+ return "hint-green";
+ }
+}
+export const RunButton = (props: {
+ status: CellStatus;
+ needsRun: boolean;
+ appClosed: boolean;
+ onClick?: () => void;
+}): JSX.Element => {
+ const { onClick, appClosed, needsRun, status } = props;
+ const loading = status === "running" || status === "queued";
+ const color = computeColor(appClosed, needsRun, loading);
+
+ let tooltipMsg: React.ReactNode = "";
+ if (appClosed) {
+ tooltipMsg = "App disconnected";
+ } else if (status === "running") {
+ tooltipMsg = "This cell is already running";
+ } else if (status === "queued") {
+ tooltipMsg = "This cell is already queued to run";
+ } else {
+ tooltipMsg = renderShortcut("cell.run");
+ }
+
+ return (
+ <Tooltip content={tooltipMsg} usePortal={false}>
+ <Button
+ className={cn(
+ "RunButton",
+ !needsRun && "hover-action",
+ (appClosed || loading) && "inactive-button",
+ loading && "running"
+ )}
+ onClick={onClick}
+ color={color}
+ shape="circle"
+ size="small"
+ data-testid="run-button"
+ >
+ <PlayIcon strokeWidth={1.8} />
+ </Button>
+ </Tooltip>
+ );
+};
diff --git a/frontend/src/editor/inputs/Inputs.css b/frontend/src/editor/inputs/Inputs.css
new file mode 100644
index 0000000000..4da76e3d5b
--- /dev/null
+++ b/frontend/src/editor/inputs/Inputs.css
@@ -0,0 +1,116 @@
+/* See https://www.radix-ui.com/docs/colors/palette-composition/understanding-the-scale
+ *
+ * We use the above guidelines to inform decisions below, in particular
+ * background and hover colors, but deviate from it when appropriate.
+ * */
+
+.mo-button.gray {
+ background-color: var(--slate-1);
+ color: var(--slate-11);
+ border-color: var(--slate-6);
+}
+
+.mo-button.gray:hover {
+ background-color: var(--slate-3);
+ border-color: var(--slate-8);
+}
+
+.mo-button.gray.selected .mo-button.gray:active {
+ background-color: var(--slate-4);
+ border-color: var(--slate-7);
+}
+
+/* Neutral; relies on border and shadow (defined elsewhere) to provide
+ * sufficient contrast. */
+.mo-button.white {
+ @apply bg-background;
+
+ color: var(--slate-11);
+ border-color: var(--slate-7);
+}
+
+.mo-button.white:hover {
+ background-color: var(--slate-1);
+ border-color: var(--slate-8);
+}
+
+.mo-button.white.selected .mo-button.white:active {
+ background-color: var(--slate-2);
+ border-color: var(--slate-7);
+}
+
+/* Disabled control. */
+.mo-button.disabled {
+ @apply bg-background;
+
+ color: var(--slate-7);
+ border-color: var(--slate-6);
+}
+
+.mo-button.green {
+ background-color: var(--grass-3);
+ color: var(--grass-11);
+ border-color: var(--grass-6);
+}
+
+.mo-button.green:hover {
+ background-color: var(--grass-2);
+ border-color: var(--grass-7);
+}
+
+.mo-button.green.selected .mo-button.green:active {
+ background-color: var(--grass-4);
+ border-color: var(--grass-7);
+}
+
+/* Looks like white, but hovers like green. */
+.mo-button.hint-green {
+ @apply bg-background;
+
+ color: var(--slate-11);
+ border-color: var(--slate-7);
+}
+
+.mo-button.hint-green:hover {
+ background-color: var(--grass-2);
+ color: var(--grass-11);
+ border-color: var(--grass-7);
+}
+
+.mo-button.hint-green.selected .mo-button.hint-green:active {
+ background-color: var(--grass-4);
+ color: var(--slate-11);
+ border-color: var(--grass-7);
+}
+
+.mo-button.red {
+ background-color: var(--red-3);
+ color: var(--red-11);
+ border-color: var(--red-6);
+}
+
+.mo-button.red:hover {
+ background-color: var(--red-4);
+ border-color: var(--red-8);
+}
+
+.mo-button.red.selected .mo-button.red:active {
+ background-color: var(--red-5);
+ border-color: var(--red-7);
+}
+
+.mo-button.yellow {
+ background-color: var(--yellow-3);
+ color: var(--yellow-11);
+ border-color: var(--yellow-6);
+}
+
+.mo-button.yellow:hover {
+ background-color: var(--yellow-4);
+ border-color: var(--yellow-8);
+}
+
+.mo-button.yellow.selected .mo-button.yellow:active {
+ background-color: var(--yellow-5);
+ border-color: var(--yellow-7);
+}
diff --git a/frontend/src/editor/inputs/Inputs.styles.ts b/frontend/src/editor/inputs/Inputs.styles.ts
new file mode 100644
index 0000000000..6fd4555a26
--- /dev/null
+++ b/frontend/src/editor/inputs/Inputs.styles.ts
@@ -0,0 +1,66 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { cva } from "class-variance-authority";
+import "./Inputs.css";
+
+export const button = cva(
+ "flex items-center justify-center m-0 leading-none font-medium border border-foreground/10 shadow-xsSolid shadow-foreground/10 hover:cursor-pointer focus:shadow-md dark:border-border",
+ {
+ variants: {
+ color: {
+ // neutral, but contrasts against background
+ gray: "mo-button gray",
+ // neutral, relying on border and shadow to stand out
+ white: "mo-button white",
+ green: "mo-button green",
+ // for destructive actions
+ red: "mo-button red",
+ // for actions that users should be alerted to
+ yellow: "mo-button yellow",
+ // for actions that will change state but are not destructive
+ "hint-green": "mo-button hint-green",
+ disabled: "mo-button disabled",
+ },
+ shape: {
+ rectangle: "rounded",
+ circle: "rounded-full",
+ },
+ size: {
+ small: "",
+ medium: "",
+ },
+ },
+
+ compoundVariants: [
+ {
+ size: "small",
+ shape: "circle",
+ class: "h-[24px] w-[24px] px-[5.5px] py-[5.5px]",
+ },
+ {
+ size: "medium",
+ shape: "circle",
+ class: "px-2 py-2",
+ },
+ {
+ size: "small",
+ shape: "rectangle",
+ class: "px-2 py-1",
+ },
+ {
+ size: "medium",
+ shape: "rectangle",
+ class: "px-3 py-2",
+ },
+ ],
+
+ defaultVariants: {
+ color: "gray",
+ size: "medium",
+ shape: "rectangle",
+ },
+ }
+);
+
+export const input = cva(
+ "font-mono w-full flex-1 inline-flex items-center justify-center rounded px-2.5 text-foreground/60 h-[36px] hover:shadow-md hover:cursor-pointer focus:shadow-md focus:outline-none text-[hsl(0, 0%, 43.5%)] bg-transparent hover:bg-background focus:bg-background"
+);
diff --git a/frontend/src/editor/inputs/Inputs.tsx b/frontend/src/editor/inputs/Inputs.tsx
new file mode 100644
index 0000000000..bac1fe2dff
--- /dev/null
+++ b/frontend/src/editor/inputs/Inputs.tsx
@@ -0,0 +1,34 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { VariantProps } from "class-variance-authority";
+import * as styles from "./Inputs.styles";
+import React from "react";
+import clsx from "clsx";
+
+type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> &
+ VariantProps<typeof styles.button>;
+
+export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
+ ({ color, shape, size, className, ...props }, ref) => {
+ return (
+ <button
+ ref={ref}
+ className={clsx(styles.button({ color, shape, size }), className)}
+ {...props}
+ >
+ {props.children}
+ </button>
+ );
+ }
+);
+Button.displayName = "Button";
+
+type InputProps = React.HtmlHTMLAttributes<HTMLInputElement>;
+
+export const Input = React.forwardRef<HTMLInputElement, InputProps>(
+ ({ className, ...props }, ref) => {
+ return (
+ <input ref={ref} className={clsx(styles.input(), className)} {...props} />
+ );
+ }
+);
+Input.displayName = "Input";
diff --git a/frontend/src/editor/output/CalloutOutput.styles.ts b/frontend/src/editor/output/CalloutOutput.styles.ts
new file mode 100644
index 0000000000..c875330d1a
--- /dev/null
+++ b/frontend/src/editor/output/CalloutOutput.styles.ts
@@ -0,0 +1,19 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { cva } from "class-variance-authority";
+
+export const calloutStyles = cva(
+ "border rounded-lg p-12 mt-12 mb-12 text-foreground shadow-[4px_4px_0px_0px]",
+ {
+ variants: {
+ kind: {
+ neutral: `bg-calloutNeutralBg border-calloutNeutralBorder shadow-calloutNeutralBorder`,
+ alert: `bg-calloutAlertBg border-calloutAlertBorder shadow-calloutAlertBorder`,
+ warn: `bg-calloutWarnBg border-calloutWarnBorder shadow-calloutWarnBorder`,
+ success: `bg-calloutSuccessBg border-calloutSuccessBorder shadow-calloutSuccessBorder`,
+ },
+ },
+ defaultVariants: {
+ kind: "neutral",
+ },
+ }
+);
diff --git a/frontend/src/editor/output/CalloutOutput.tsx b/frontend/src/editor/output/CalloutOutput.tsx
new file mode 100644
index 0000000000..92989ae1e9
--- /dev/null
+++ b/frontend/src/editor/output/CalloutOutput.tsx
@@ -0,0 +1,18 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { memo } from "react";
+import { HtmlOutput } from "./HtmlOutput";
+import { calloutStyles } from "./CalloutOutput.styles";
+
+interface Props {
+ html: string;
+ kind: "neutral" | "alert" | "warn" | "success";
+}
+
+export const CalloutOutput: React.FC<Props> = memo(({ html, kind }) => {
+ return (
+ <div className={calloutStyles({ kind })}>
+ <HtmlOutput html={html} />
+ </div>
+ );
+});
+CalloutOutput.displayName = "CalloutOutput";
diff --git a/frontend/src/editor/output/EmotionCacheProvider.tsx b/frontend/src/editor/output/EmotionCacheProvider.tsx
new file mode 100644
index 0000000000..83864b481f
--- /dev/null
+++ b/frontend/src/editor/output/EmotionCacheProvider.tsx
@@ -0,0 +1,31 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { PropsWithChildren, useMemo } from "react";
+import createCache from "@emotion/cache";
+import { CacheProvider } from "@emotion/react";
+
+/**
+ * Custom Emotion cache provider that works in shadow roots.
+ * We don't directly use Emotion, but some of our dependencies do (via MUI).
+ */
+export const EmotionCacheProvider: React.FC<
+ PropsWithChildren<{ container: ShadowRoot | null }>
+> = ({ container, children }) => {
+ const cache = useMemo(() => {
+ if (!container) {
+ return createCache({ key: "mo", prepend: true });
+ }
+ let emotionRoot = container.querySelector("style");
+ // Create a new style element if one doesn't exist
+ if (!emotionRoot) {
+ emotionRoot = document.createElement("style");
+ container.append(emotionRoot);
+ }
+ return createCache({
+ key: "mo",
+ prepend: true,
+ container: emotionRoot,
+ });
+ }, [container]);
+
+ return <CacheProvider value={cache}>{children}</CacheProvider>;
+};
diff --git a/frontend/src/editor/output/HtmlOutput.tsx b/frontend/src/editor/output/HtmlOutput.tsx
new file mode 100644
index 0000000000..a931025e6e
--- /dev/null
+++ b/frontend/src/editor/output/HtmlOutput.tsx
@@ -0,0 +1,86 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { memo, useLayoutEffect, useRef } from "react";
+import { lookupScript, updateScriptCache } from "./scripts";
+import { Logger } from "../../utils/Logger";
+import { RenderHTML } from "../../plugins/core/RenderHTML";
+import { cn } from "../../lib/utils";
+
+interface Props {
+ html: string;
+ inline?: boolean;
+ className?: string;
+}
+
+export const HtmlOutput: React.FC<Props> = memo(
+ ({ html, inline = false, className }) => {
+ const nodeRef = useRef<HTMLDivElement>(null);
+
+ useLayoutEffect(() => {
+ if (nodeRef.current === null) {
+ Logger.error("Output is not initialized");
+ return;
+ }
+
+ // Cache script sources and run inline script tags
+ async function runScripts() {
+ const outputNode = nodeRef.current;
+ if (outputNode === null) {
+ return;
+ }
+ // eslint-disable-next-line unicorn/prefer-spread
+ const scriptNodes = Array.from(outputNode.querySelectorAll("script"));
+ for (const scriptNode of scriptNodes) {
+ if (scriptNode.src != null && scriptNode.src !== "") {
+ let cachedScript = lookupScript(scriptNode.src);
+ if (cachedScript === null) {
+ const scriptElement = document.createElement("script");
+ scriptElement.src = scriptNode.src;
+ scriptElement.type = scriptNode.type;
+ cachedScript = { element: scriptElement, loaded: false };
+ updateScriptCache(scriptNode.src, cachedScript);
+ }
+ if (!cachedScript?.loaded) {
+ const scriptElement = cachedScript.element;
+ await new Promise((resolve) => {
+ document.head.append(scriptElement);
+ scriptElement.addEventListener("load", resolve);
+ scriptElement.addEventListener("error", resolve);
+ });
+ cachedScript.loaded = true;
+ }
+ } else {
+ const code = scriptNode.innerText;
+ const fnbody = `"use strict"; return (async () => {${code}})()`;
+ try {
+ // eslint-disable-next-line no-new-func
+ await new Function(fnbody)();
+ } catch (error) {
+ Logger.error("Failed to execute script ", scriptNode);
+ Logger.error(error);
+ }
+ }
+ }
+ }
+
+ if (nodeRef.current === null) {
+ Logger.error("Output is not initialized");
+ return;
+ } else {
+ runScripts();
+ }
+ }, [html, nodeRef]);
+
+ return (
+ <div
+ className={cn(className, {
+ "inline-flex": inline,
+ block: !inline,
+ })}
+ ref={nodeRef}
+ >
+ <RenderHTML html={html} />
+ </div>
+ );
+ }
+);
+HtmlOutput.displayName = "HtmlOutput";
diff --git a/frontend/src/editor/output/ImageOutput.tsx b/frontend/src/editor/output/ImageOutput.tsx
new file mode 100644
index 0000000000..7b1ca917be
--- /dev/null
+++ b/frontend/src/editor/output/ImageOutput.tsx
@@ -0,0 +1,23 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+
+interface Props {
+ src: string;
+ alt?: string;
+ width?: number;
+ height?: number;
+ className?: string;
+}
+
+export const ImageOutput = ({
+ src,
+ alt = "",
+ width,
+ height,
+ className,
+}: Props): JSX.Element => {
+ return (
+ <span className={className}>
+ <img src={src} alt={alt} width={width} height={height} />
+ </span>
+ );
+};
diff --git a/frontend/src/editor/output/JsonOutput.tsx b/frontend/src/editor/output/JsonOutput.tsx
new file mode 100644
index 0000000000..e30571c3bf
--- /dev/null
+++ b/frontend/src/editor/output/JsonOutput.tsx
@@ -0,0 +1,118 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { memo } from "react";
+import { DataType, JsonViewer } from "@textea/json-viewer";
+
+import { HtmlOutput } from "./HtmlOutput";
+import { ImageOutput } from "./ImageOutput";
+import { TextOutput } from "./TextOutput";
+import { VideoOutput } from "./VideoOutput";
+import { logNever } from "../../utils/assertNever";
+import { useTheme } from "../../theme/useTheme";
+
+interface Props {
+ /**
+ * The data to display
+ */
+ data: unknown;
+
+ format?: "auto" | "tree" | "raw";
+
+ /**
+ * A text label for the JSON viewer. If `false`, no label is used.
+ */
+ name?: string | false;
+
+ className?: string;
+}
+
+/**
+ * Output component for JSON data.
+ */
+export const JsonOutput: React.FC<Props> = memo(
+ ({ data, format = "auto", name = false, className }) => {
+ const { theme } = useTheme();
+ if (format === "auto") {
+ format = inferBestFormat(data);
+ }
+
+ switch (format) {
+ case "tree":
+ return (
+ <JsonViewer
+ className={"marimo-json-output"}
+ rootName={name}
+ theme={theme}
+ value={data}
+ style={{
+ backgroundColor: "transparent",
+ }}
+ valueTypes={VALUE_TYPE}
+ // disable array grouping (it's misleading) by using a large value
+ groupArraysAfterLength={1_000_000}
+ // TODO(akshayka): disable clipboard until we have a better
+ // solution: copies raw values, shifts content; can use onCopy prop
+ // to override what is copied to clipboard
+ enableClipboard={false}
+ />
+ );
+ case "raw":
+ return <pre className={className}>{JSON.stringify(data, null, 2)}</pre>;
+ default:
+ logNever(format);
+ return <pre className={className}>{JSON.stringify(data, null, 2)}</pre>;
+ }
+ }
+);
+JsonOutput.displayName = "JsonOutput";
+
+function inferBestFormat(data: unknown): "tree" | "raw" {
+ return typeof data === "object" && data !== null ? "tree" : "raw";
+}
+
+/**
+ * Map from mimetype-prefix to render function.
+ *
+ * Render function takes leaf data as input.
+ */
+const LEAF_RENDERERS = {
+ "image/": (value: string) => <ImageOutput src={value} />,
+ "video/": (value: string) => <VideoOutput src={value} />,
+ "text/html": (value: string) => <HtmlOutput html={value} inline={true} />,
+ "text/plain": (value: string) => <TextOutput text={value} />,
+};
+
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+const VALUE_TYPE: Array<DataType<any>> = Object.entries(LEAF_RENDERERS).map(
+ ([leafType, render]) => ({
+ is: (value) => typeof value === "string" && value.startsWith(leafType),
+ Component: (props) => renderLeaf(props.value, render),
+ })
+);
+
+function leafData(leaf: string): string {
+ const delimIndex = leaf.indexOf(":");
+ if (delimIndex === -1) {
+ throw new Error("Invalid leaf");
+ }
+ return leaf.slice(delimIndex + 1);
+}
+
+/**
+ * Render a leaf.
+ *
+ * Leaf must have the format
+ *
+ * <mimetype>:<data>
+ *
+ * where mimetype cannot contain ":".
+ */
+function renderLeaf(
+ leaf: string,
+ render: (data: string) => JSX.Element
+): JSX.Element {
+ try {
+ return render(leafData(leaf));
+ } catch {
+ return <TextOutput text={`Invalid leaf: {leaf}`} />;
+ }
+}
diff --git a/frontend/src/editor/output/MarimoErrorOutput.tsx b/frontend/src/editor/output/MarimoErrorOutput.tsx
new file mode 100644
index 0000000000..12f4e47617
--- /dev/null
+++ b/frontend/src/editor/output/MarimoErrorOutput.tsx
@@ -0,0 +1,191 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+
+import { cn } from "../../lib/utils";
+import { logNever } from "../../utils/assertNever";
+import { MarimoError } from "../../core/kernel/messages";
+import { Alert } from "../../components/ui/alert";
+import { AlertTitle } from "../../components/ui/alert";
+
+import {
+ Accordion,
+ AccordionContent,
+ AccordionItem,
+ AccordionTrigger,
+} from "@/components/ui/accordion";
+import { Logger } from "../../utils/Logger";
+import { Fragment } from "react";
+
+const Tip = (props: {
+ className?: string;
+ children: React.ReactNode;
+}): JSX.Element => {
+ return (
+ <Accordion type="single" collapsible={true} className={props.className}>
+ <AccordionItem
+ value="item-1"
+ className="text-muted-foreground border-muted-foreground-20"
+ >
+ <AccordionTrigger className="py-2 text-[0.84375rem]">
+ Tip:
+ </AccordionTrigger>
+ <AccordionContent className="text-[0.84375rem]">
+ {props.children}
+ </AccordionContent>
+ </AccordionItem>
+ </Accordion>
+ );
+};
+
+/* Component that adds a link to a cell, for use in a MarimoError. */
+const CellLink = (props: { cellId: number }): JSX.Element => {
+ const cellName = `cell-${props.cellId}`;
+ return (
+ <div
+ className="inline-block cursor-pointer text-blue-500 hover:underline"
+ onClick={(e) => {
+ e.stopPropagation();
+ e.preventDefault();
+ const cell: HTMLElement | null = document.getElementById(cellName);
+ if (cell === null) {
+ Logger.error(`Cell ${cellName} not found on page.`);
+ } else {
+ cell.classList.add("error-outline");
+ cell.scrollIntoView({ behavior: "smooth", block: "center" });
+ setTimeout(() => {
+ cell.classList.remove("error-outline");
+ }, 1000);
+ }
+ }}
+ >
+ {cellName}
+ </div>
+ );
+};
+
+interface Props {
+ errors: MarimoError[];
+ className?: string;
+}
+
+/**
+ * List of errors due to violations of Marimo semantics.
+ */
+export const MarimoErrorOutput = ({
+ errors,
+ className,
+}: Props): JSX.Element => {
+ let runtimeError = false;
+ const liStyle = "my-0.5 ml-8 text-muted-foreground/40";
+ const msgs = errors.map((error, idx) => {
+ switch (error.type) {
+ case "syntax":
+ case "unknown":
+ return <p key={idx}>{error.msg}</p>;
+
+ case "cycle":
+ return (
+ <Fragment key={idx}>
+ <p className="mt-4">{"This cell is in a cycle:"}</p>
+ <ul className="list-disc">
+ {error.edges.map((edge) => (
+ <li className={liStyle} key={`${edge[0]}-${edge[1]}`}>
+ <CellLink cellId={edge[0]} />
+ {" -> "}
+ <CellLink cellId={edge[1]} />
+ </li>
+ ))}
+ </ul>
+ <Tip>Merge these cells into a single cell.</Tip>
+ </Fragment>
+ );
+
+ case "multiple-defs":
+ return (
+ <Fragment key={idx}>
+ <p className="mt-4">
+ {`The variable '${error.name}' was defined by another cell:`}
+ </p>
+ <ul className="list-disc">
+ {error.cells.map((cid) => (
+ <li className={liStyle} key={cid}>
+ <CellLink cellId={cid} />
+ </li>
+ ))}
+ </ul>
+ <Tip>
+ Try merging this cell with the above cells. Alternatively, rename
+ '{error.name}' to '_{error.name}' to make the variable private to
+ this cell.
+ </Tip>
+ </Fragment>
+ );
+
+ case "delete-nonlocal":
+ return (
+ <Fragment key={idx}>
+ <p className="mt-4">
+ {`The variable '${error.name}' can't be deleted because it was defined by another cell ` +
+ `(`}
+ <CellLink cellId={error.cells[0]} />
+ {")"}
+ </p>
+ <Tip>
+ Try refactoring so that you can delete '{error.name}' in the cell
+ that creates it.
+ </Tip>
+ </Fragment>
+ );
+
+ case "interruption":
+ runtimeError = true;
+ return (
+ <p key={idx}>{"This cell was interrupted and needs to be re-run."}</p>
+ );
+
+ case "exception":
+ runtimeError = true;
+ return error.raising_cell == null ? (
+ <Fragment key={idx}>
+ <p>{error.msg}</p>
+ <Tip>See the console area for a traceback.</Tip>
+ </Fragment>
+ ) : (
+ <p key={idx}>
+ {error.msg}
+ <CellLink cellId={error.raising_cell} />
+ <Tip>
+ Fix the error in <CellLink cellId={error.raising_cell} />, or
+ handle the exception in with a try/except block.
+ </Tip>
+ </p>
+ );
+
+ default:
+ logNever(error);
+ return null;
+ }
+ });
+
+ const title = runtimeError ? (
+ <AlertTitle className="font-code font-bold mb-4">Runtime error</AlertTitle>
+ ) : (
+ <AlertTitle className="font-code font-bold mb-4">
+ This cell wasn't run because it has errors
+ </AlertTitle>
+ );
+
+ return (
+ <Alert
+ variant="destructive"
+ className={cn(
+ "border-none font-code text-sm text-[0.84375rem] px-0 text-error [&:has(svg)]:pl-0",
+ className
+ )}
+ >
+ {title}
+ <div>
+ <ul>{msgs}</ul>
+ </div>
+ </Alert>
+ );
+};
diff --git a/frontend/src/editor/output/TextOutput.tsx b/frontend/src/editor/output/TextOutput.tsx
new file mode 100644
index 0000000000..b6011c2098
--- /dev/null
+++ b/frontend/src/editor/output/TextOutput.tsx
@@ -0,0 +1,10 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+
+interface Props {
+ text: string;
+ className?: string;
+}
+
+export const TextOutput = ({ text, className }: Props): JSX.Element => {
+ return <span className={`${className} text-plain`}>{text}</span>;
+};
diff --git a/frontend/src/editor/output/VideoOutput.tsx b/frontend/src/editor/output/VideoOutput.tsx
new file mode 100644
index 0000000000..1fed9791d7
--- /dev/null
+++ b/frontend/src/editor/output/VideoOutput.tsx
@@ -0,0 +1,13 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+
+interface Props {
+ src: string;
+ className?: string;
+}
+
+export const VideoOutput = ({ src, className }: Props): JSX.Element => {
+ return (
+ // eslint-disable-next-line jsx-a11y/iframe-has-title
+ <iframe className={className} src={src} />
+ );
+};
diff --git a/frontend/src/editor/output/scripts.ts b/frontend/src/editor/output/scripts.ts
new file mode 100644
index 0000000000..322ef2cca5
--- /dev/null
+++ b/frontend/src/editor/output/scripts.ts
@@ -0,0 +1,15 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+interface Script {
+ element: HTMLScriptElement;
+ loaded: boolean;
+}
+
+const LOADED_SCRIPTS: Record<string, Script> = {};
+
+export function lookupScript(src: string) {
+ return src in LOADED_SCRIPTS ? LOADED_SCRIPTS[src] : null;
+}
+
+export function updateScriptCache(src: string, value: Script) {
+ LOADED_SCRIPTS[src] = value;
+}
diff --git a/frontend/src/editor/output/types.ts b/frontend/src/editor/output/types.ts
new file mode 100644
index 0000000000..88d84ef9ff
--- /dev/null
+++ b/frontend/src/editor/output/types.ts
@@ -0,0 +1,5 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+export interface OutputElement {
+ new (): HTMLElement;
+ tagName: string;
+}
diff --git a/frontend/src/editor/renderers/CellArray.tsx b/frontend/src/editor/renderers/CellArray.tsx
new file mode 100644
index 0000000000..53afe1057d
--- /dev/null
+++ b/frontend/src/editor/renderers/CellArray.tsx
@@ -0,0 +1,137 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { EditorView } from "codemirror";
+import { useEffect, useState } from "react";
+import { sendDeleteCell } from "@/core/network/requests";
+import { Cell } from "editor/Cell";
+import { RuntimeState } from "../../core/RuntimeState";
+import { ConnectionStatus, WebSocketState } from "../../core/websocket/types";
+import { CellsAndHistory, useCellActions } from "../../core/state/cells";
+import { UserConfig } from "../../core/config";
+import { AppMode } from "../../core/mode";
+import { useHotkey } from "../../hooks/useHotkey";
+import { useEvent } from "../../hooks/useEvent";
+import { CellId } from "../../core/model/ids";
+import { formatEditorViews } from "../../core/codemirror/format";
+import { cn } from "../../lib/utils";
+import { useTheme } from "../../theme/useTheme";
+
+interface CellArrayProps {
+ cells: CellsAndHistory;
+ mode: AppMode;
+ userConfig: UserConfig;
+ connStatus: ConnectionStatus;
+}
+
+// TODO(akshayka): move running cells state machine to kernel
+function registerRunStart() {
+ RuntimeState.INSTANCE.registerRunStart();
+}
+
+export const CellArray: React.FC<CellArrayProps> = ({
+ cells,
+ mode,
+ userConfig,
+ connStatus,
+}) => {
+ const {
+ updateCellCode,
+ prepareForRun,
+ deleteCell,
+ moveCell,
+ moveToNextCell,
+ focusCell,
+ createNewCell,
+ focusBottomCell,
+ focusTopCell,
+ scrollToTarget,
+ foldAll,
+ unfoldAll,
+ } = useCellActions();
+ const { theme } = useTheme();
+
+ // Start the app as invisible and delay proportional to the number of cells,
+ // to avoid most of the flickering when the app is loaded (b/c it is
+ // streamed). Delaying also helps prevent cell editors from stealing focus.
+ const [invisible, setInvisible] = useState(true);
+ useEffect(() => {
+ const delay = Math.max(Math.min((cells.present.length - 1) * 15, 100), 0);
+ const timeout = setTimeout(() => {
+ setInvisible(false);
+ // Focus on the first cell if it's been mounted
+ cells.present[0]?.ref.current?.editorView.focus();
+ }, delay);
+ return () => clearTimeout(timeout);
+ // Delay only when app is first loaded
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+
+ // HOTKEYS
+ useHotkey("global.focusTop", focusTopCell);
+ useHotkey("global.focusBottom", focusBottomCell);
+ useHotkey("global.foldCode", foldAll);
+ useHotkey("global.unfoldCode", unfoldAll);
+ useHotkey("global.formatAll", () => {
+ const views: Record<CellId, EditorView> = {};
+ cells.present.forEach((cell) => {
+ const editorView = cell.ref.current?.editorView;
+ if (editorView) {
+ views[cell.key] = editorView;
+ }
+ });
+ formatEditorViews(views, updateCellCode);
+ });
+
+ const onDeleteCell = useEvent((cellId: CellId) => {
+ sendDeleteCell(cellId);
+ deleteCell(cellId);
+ });
+
+ // Scroll to a cell targeted by a previous action
+ useEffect(() => {
+ if (cells.scrollKey !== null) {
+ scrollToTarget();
+ }
+ }, [cells.present, cells.scrollKey, scrollToTarget]);
+
+ return (
+ <div
+ className={cn(
+ "max-w-contentWidth m-auto pb-12",
+ // Hide the cells for a fake loading effect, to avoid flickering
+ invisible && "invisible"
+ )}
+ >
+ {cells.present.map((cell) => (
+ <Cell
+ key={cell.key.toString()}
+ theme={theme}
+ showPlaceholder={cells.present.length === 1}
+ allowFocus={!invisible}
+ cellId={cell.key}
+ initialContents={cell.initialContents}
+ output={cell.output}
+ consoleOutputs={cell.consoleOutputs}
+ status={cell.status}
+ updateCellCode={updateCellCode}
+ prepareCellForRun={prepareForRun}
+ edited={cell.edited}
+ interrupted={cell.interrupted}
+ errored={cell.errored}
+ runElapsedTimeMs={cell.runElapsedTimeMs}
+ registerRunStart={registerRunStart}
+ serializedEditorState={cell.serializedEditorState}
+ showDeleteButton={cells.present.length > 1}
+ createNewCell={createNewCell}
+ deleteCell={onDeleteCell}
+ focusCell={focusCell}
+ moveToNextCell={moveToNextCell}
+ moveCell={moveCell}
+ editing={mode === "edit"}
+ appClosed={connStatus.state !== WebSocketState.OPEN}
+ ref={cell.ref}
+ userConfig={userConfig}
+ />
+ ))}
+ </div>
+ );
+};
diff --git a/frontend/src/fonts/Fira_Mono/FiraMono-Bold.ttf b/frontend/src/fonts/Fira_Mono/FiraMono-Bold.ttf
new file mode 100644
index 0000000000..23bc30f6c4
Binary files /dev/null and b/frontend/src/fonts/Fira_Mono/FiraMono-Bold.ttf differ
diff --git a/frontend/src/fonts/Fira_Mono/FiraMono-Medium.ttf b/frontend/src/fonts/Fira_Mono/FiraMono-Medium.ttf
new file mode 100644
index 0000000000..793c60df15
Binary files /dev/null and b/frontend/src/fonts/Fira_Mono/FiraMono-Medium.ttf differ
diff --git a/frontend/src/fonts/Fira_Mono/FiraMono-Regular.ttf b/frontend/src/fonts/Fira_Mono/FiraMono-Regular.ttf
new file mode 100644
index 0000000000..67bbd4287d
Binary files /dev/null and b/frontend/src/fonts/Fira_Mono/FiraMono-Regular.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_AMS-Regular.ttf b/frontend/src/fonts/KaTeX/KaTeX_AMS-Regular.ttf
new file mode 100644
index 0000000000..c6f9a5e7c0
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_AMS-Regular.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_AMS-Regular.woff b/frontend/src/fonts/KaTeX/KaTeX_AMS-Regular.woff
new file mode 100644
index 0000000000..b804d7b33a
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_AMS-Regular.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_AMS-Regular.woff2 b/frontend/src/fonts/KaTeX/KaTeX_AMS-Regular.woff2
new file mode 100644
index 0000000000..0acaaff03d
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_AMS-Regular.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Caligraphic-Bold.ttf b/frontend/src/fonts/KaTeX/KaTeX_Caligraphic-Bold.ttf
new file mode 100644
index 0000000000..9ff4a5e044
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Caligraphic-Bold.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Caligraphic-Bold.woff b/frontend/src/fonts/KaTeX/KaTeX_Caligraphic-Bold.woff
new file mode 100644
index 0000000000..9759710d1d
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Caligraphic-Bold.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Caligraphic-Bold.woff2 b/frontend/src/fonts/KaTeX/KaTeX_Caligraphic-Bold.woff2
new file mode 100644
index 0000000000..f390922ece
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Caligraphic-Bold.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Caligraphic-Regular.ttf b/frontend/src/fonts/KaTeX/KaTeX_Caligraphic-Regular.ttf
new file mode 100644
index 0000000000..f522294ff0
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Caligraphic-Regular.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Caligraphic-Regular.woff b/frontend/src/fonts/KaTeX/KaTeX_Caligraphic-Regular.woff
new file mode 100644
index 0000000000..9bdd534fd2
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Caligraphic-Regular.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Caligraphic-Regular.woff2 b/frontend/src/fonts/KaTeX/KaTeX_Caligraphic-Regular.woff2
new file mode 100644
index 0000000000..75344a1f98
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Caligraphic-Regular.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Fraktur-Bold.ttf b/frontend/src/fonts/KaTeX/KaTeX_Fraktur-Bold.ttf
new file mode 100644
index 0000000000..4e98259c3b
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Fraktur-Bold.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Fraktur-Bold.woff b/frontend/src/fonts/KaTeX/KaTeX_Fraktur-Bold.woff
new file mode 100644
index 0000000000..e7730f6627
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Fraktur-Bold.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Fraktur-Bold.woff2 b/frontend/src/fonts/KaTeX/KaTeX_Fraktur-Bold.woff2
new file mode 100644
index 0000000000..395f28beac
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Fraktur-Bold.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Fraktur-Regular.ttf b/frontend/src/fonts/KaTeX/KaTeX_Fraktur-Regular.ttf
new file mode 100644
index 0000000000..b8461b275f
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Fraktur-Regular.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Fraktur-Regular.woff b/frontend/src/fonts/KaTeX/KaTeX_Fraktur-Regular.woff
new file mode 100644
index 0000000000..acab069f90
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Fraktur-Regular.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Fraktur-Regular.woff2 b/frontend/src/fonts/KaTeX/KaTeX_Fraktur-Regular.woff2
new file mode 100644
index 0000000000..735f6948d6
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Fraktur-Regular.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Main-Bold.ttf b/frontend/src/fonts/KaTeX/KaTeX_Main-Bold.ttf
new file mode 100644
index 0000000000..4060e627dc
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Main-Bold.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Main-Bold.woff b/frontend/src/fonts/KaTeX/KaTeX_Main-Bold.woff
new file mode 100644
index 0000000000..f38136ac1c
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Main-Bold.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Main-Bold.woff2 b/frontend/src/fonts/KaTeX/KaTeX_Main-Bold.woff2
new file mode 100644
index 0000000000..ab2ad21da6
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Main-Bold.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Main-BoldItalic.ttf b/frontend/src/fonts/KaTeX/KaTeX_Main-BoldItalic.ttf
new file mode 100644
index 0000000000..dc007977ee
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Main-BoldItalic.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Main-BoldItalic.woff b/frontend/src/fonts/KaTeX/KaTeX_Main-BoldItalic.woff
new file mode 100644
index 0000000000..67807b0bd4
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Main-BoldItalic.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Main-BoldItalic.woff2 b/frontend/src/fonts/KaTeX/KaTeX_Main-BoldItalic.woff2
new file mode 100644
index 0000000000..5931794de4
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Main-BoldItalic.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Main-Italic.ttf b/frontend/src/fonts/KaTeX/KaTeX_Main-Italic.ttf
new file mode 100644
index 0000000000..0e9b0f354a
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Main-Italic.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Main-Italic.woff b/frontend/src/fonts/KaTeX/KaTeX_Main-Italic.woff
new file mode 100644
index 0000000000..6f43b594b6
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Main-Italic.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Main-Italic.woff2 b/frontend/src/fonts/KaTeX/KaTeX_Main-Italic.woff2
new file mode 100644
index 0000000000..b50920e138
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Main-Italic.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Main-Regular.ttf b/frontend/src/fonts/KaTeX/KaTeX_Main-Regular.ttf
new file mode 100644
index 0000000000..dd45e1ed2e
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Main-Regular.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Main-Regular.woff b/frontend/src/fonts/KaTeX/KaTeX_Main-Regular.woff
new file mode 100644
index 0000000000..21f5812968
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Main-Regular.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Main-Regular.woff2 b/frontend/src/fonts/KaTeX/KaTeX_Main-Regular.woff2
new file mode 100644
index 0000000000..eb24a7ba28
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Main-Regular.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Math-BoldItalic.ttf b/frontend/src/fonts/KaTeX/KaTeX_Math-BoldItalic.ttf
new file mode 100644
index 0000000000..728ce7a1e2
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Math-BoldItalic.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Math-BoldItalic.woff b/frontend/src/fonts/KaTeX/KaTeX_Math-BoldItalic.woff
new file mode 100644
index 0000000000..0ae390d74c
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Math-BoldItalic.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Math-BoldItalic.woff2 b/frontend/src/fonts/KaTeX/KaTeX_Math-BoldItalic.woff2
new file mode 100644
index 0000000000..29657023ad
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Math-BoldItalic.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Math-Italic.ttf b/frontend/src/fonts/KaTeX/KaTeX_Math-Italic.ttf
new file mode 100644
index 0000000000..70d559b4e9
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Math-Italic.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Math-Italic.woff b/frontend/src/fonts/KaTeX/KaTeX_Math-Italic.woff
new file mode 100644
index 0000000000..eb5159d4c1
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Math-Italic.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Math-Italic.woff2 b/frontend/src/fonts/KaTeX/KaTeX_Math-Italic.woff2
new file mode 100644
index 0000000000..215c143fd7
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Math-Italic.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Bold.ttf b/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Bold.ttf
new file mode 100644
index 0000000000..2f65a8a3a6
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Bold.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Bold.woff b/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Bold.woff
new file mode 100644
index 0000000000..8d47c02d94
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Bold.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Bold.woff2 b/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Bold.woff2
new file mode 100644
index 0000000000..cfaa3bda59
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Bold.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Italic.ttf b/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Italic.ttf
new file mode 100644
index 0000000000..d5850df98e
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Italic.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Italic.woff b/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Italic.woff
new file mode 100644
index 0000000000..7e02df9636
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Italic.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Italic.woff2 b/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Italic.woff2
new file mode 100644
index 0000000000..349c06dc60
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Italic.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Regular.ttf b/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Regular.ttf
new file mode 100644
index 0000000000..537279f6bd
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Regular.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Regular.woff b/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Regular.woff
new file mode 100644
index 0000000000..31b84829b4
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Regular.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Regular.woff2 b/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Regular.woff2
new file mode 100644
index 0000000000..a90eea85f6
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_SansSerif-Regular.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Script-Regular.ttf b/frontend/src/fonts/KaTeX/KaTeX_Script-Regular.ttf
new file mode 100644
index 0000000000..fd679bf374
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Script-Regular.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Script-Regular.woff b/frontend/src/fonts/KaTeX/KaTeX_Script-Regular.woff
new file mode 100644
index 0000000000..0e7da821ee
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Script-Regular.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Script-Regular.woff2 b/frontend/src/fonts/KaTeX/KaTeX_Script-Regular.woff2
new file mode 100644
index 0000000000..b3048fc115
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Script-Regular.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Size1-Regular.ttf b/frontend/src/fonts/KaTeX/KaTeX_Size1-Regular.ttf
new file mode 100644
index 0000000000..871fd7d19d
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Size1-Regular.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Size1-Regular.woff b/frontend/src/fonts/KaTeX/KaTeX_Size1-Regular.woff
new file mode 100644
index 0000000000..7f292d9118
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Size1-Regular.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Size1-Regular.woff2 b/frontend/src/fonts/KaTeX/KaTeX_Size1-Regular.woff2
new file mode 100644
index 0000000000..c5a8462fbf
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Size1-Regular.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Size2-Regular.ttf b/frontend/src/fonts/KaTeX/KaTeX_Size2-Regular.ttf
new file mode 100644
index 0000000000..7a212caf91
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Size2-Regular.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Size2-Regular.woff b/frontend/src/fonts/KaTeX/KaTeX_Size2-Regular.woff
new file mode 100644
index 0000000000..d241d9be2d
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Size2-Regular.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Size2-Regular.woff2 b/frontend/src/fonts/KaTeX/KaTeX_Size2-Regular.woff2
new file mode 100644
index 0000000000..e1bccfe240
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Size2-Regular.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Size3-Regular.ttf b/frontend/src/fonts/KaTeX/KaTeX_Size3-Regular.ttf
new file mode 100644
index 0000000000..00bff3495f
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Size3-Regular.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Size3-Regular.woff b/frontend/src/fonts/KaTeX/KaTeX_Size3-Regular.woff
new file mode 100644
index 0000000000..e6e9b658dc
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Size3-Regular.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Size3-Regular.woff2 b/frontend/src/fonts/KaTeX/KaTeX_Size3-Regular.woff2
new file mode 100644
index 0000000000..249a286622
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Size3-Regular.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Size4-Regular.ttf b/frontend/src/fonts/KaTeX/KaTeX_Size4-Regular.ttf
new file mode 100644
index 0000000000..74f08921f0
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Size4-Regular.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Size4-Regular.woff b/frontend/src/fonts/KaTeX/KaTeX_Size4-Regular.woff
new file mode 100644
index 0000000000..e1ec545766
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Size4-Regular.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Size4-Regular.woff2 b/frontend/src/fonts/KaTeX/KaTeX_Size4-Regular.woff2
new file mode 100644
index 0000000000..680c130850
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Size4-Regular.woff2 differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Typewriter-Regular.ttf b/frontend/src/fonts/KaTeX/KaTeX_Typewriter-Regular.ttf
new file mode 100644
index 0000000000..c83252c571
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Typewriter-Regular.ttf differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Typewriter-Regular.woff b/frontend/src/fonts/KaTeX/KaTeX_Typewriter-Regular.woff
new file mode 100644
index 0000000000..2432419f28
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Typewriter-Regular.woff differ
diff --git a/frontend/src/fonts/KaTeX/KaTeX_Typewriter-Regular.woff2 b/frontend/src/fonts/KaTeX/KaTeX_Typewriter-Regular.woff2
new file mode 100644
index 0000000000..771f1af705
Binary files /dev/null and b/frontend/src/fonts/KaTeX/KaTeX_Typewriter-Regular.woff2 differ
diff --git a/frontend/src/fonts/Lora/Lora-Italic-VariableFont_wght.ttf b/frontend/src/fonts/Lora/Lora-Italic-VariableFont_wght.ttf
new file mode 100644
index 0000000000..6ae9cf8b93
Binary files /dev/null and b/frontend/src/fonts/Lora/Lora-Italic-VariableFont_wght.ttf differ
diff --git a/frontend/src/fonts/Lora/Lora-VariableFont_wght.ttf b/frontend/src/fonts/Lora/Lora-VariableFont_wght.ttf
new file mode 100644
index 0000000000..72b97d5fe1
Binary files /dev/null and b/frontend/src/fonts/Lora/Lora-VariableFont_wght.ttf differ
diff --git a/frontend/src/fonts/Lora/static/Lora-Bold.ttf b/frontend/src/fonts/Lora/static/Lora-Bold.ttf
new file mode 100644
index 0000000000..cd154bfc6a
Binary files /dev/null and b/frontend/src/fonts/Lora/static/Lora-Bold.ttf differ
diff --git a/frontend/src/fonts/Lora/static/Lora-BoldItalic.ttf b/frontend/src/fonts/Lora/static/Lora-BoldItalic.ttf
new file mode 100644
index 0000000000..9d61f1b773
Binary files /dev/null and b/frontend/src/fonts/Lora/static/Lora-BoldItalic.ttf differ
diff --git a/frontend/src/fonts/Lora/static/Lora-Italic.ttf b/frontend/src/fonts/Lora/static/Lora-Italic.ttf
new file mode 100644
index 0000000000..c037576df0
Binary files /dev/null and b/frontend/src/fonts/Lora/static/Lora-Italic.ttf differ
diff --git a/frontend/src/fonts/Lora/static/Lora-Medium.ttf b/frontend/src/fonts/Lora/static/Lora-Medium.ttf
new file mode 100644
index 0000000000..6d652b59d0
Binary files /dev/null and b/frontend/src/fonts/Lora/static/Lora-Medium.ttf differ
diff --git a/frontend/src/fonts/Lora/static/Lora-MediumItalic.ttf b/frontend/src/fonts/Lora/static/Lora-MediumItalic.ttf
new file mode 100644
index 0000000000..f52f15086f
Binary files /dev/null and b/frontend/src/fonts/Lora/static/Lora-MediumItalic.ttf differ
diff --git a/frontend/src/fonts/Lora/static/Lora-Regular.ttf b/frontend/src/fonts/Lora/static/Lora-Regular.ttf
new file mode 100644
index 0000000000..5306a942f4
Binary files /dev/null and b/frontend/src/fonts/Lora/static/Lora-Regular.ttf differ
diff --git a/frontend/src/fonts/Lora/static/Lora-SemiBold.ttf b/frontend/src/fonts/Lora/static/Lora-SemiBold.ttf
new file mode 100644
index 0000000000..c69d778a7f
Binary files /dev/null and b/frontend/src/fonts/Lora/static/Lora-SemiBold.ttf differ
diff --git a/frontend/src/fonts/Lora/static/Lora-SemiBoldItalic.ttf b/frontend/src/fonts/Lora/static/Lora-SemiBoldItalic.ttf
new file mode 100644
index 0000000000..c3d61ee57f
Binary files /dev/null and b/frontend/src/fonts/Lora/static/Lora-SemiBoldItalic.ttf differ
diff --git a/frontend/src/fonts/PT_Sans/PTSans-Bold.ttf b/frontend/src/fonts/PT_Sans/PTSans-Bold.ttf
new file mode 100644
index 0000000000..f82c3bda50
Binary files /dev/null and b/frontend/src/fonts/PT_Sans/PTSans-Bold.ttf differ
diff --git a/frontend/src/fonts/PT_Sans/PTSans-BoldItalic.ttf b/frontend/src/fonts/PT_Sans/PTSans-BoldItalic.ttf
new file mode 100644
index 0000000000..3e6cf4e324
Binary files /dev/null and b/frontend/src/fonts/PT_Sans/PTSans-BoldItalic.ttf differ
diff --git a/frontend/src/fonts/PT_Sans/PTSans-Italic.ttf b/frontend/src/fonts/PT_Sans/PTSans-Italic.ttf
new file mode 100644
index 0000000000..b06ce61216
Binary files /dev/null and b/frontend/src/fonts/PT_Sans/PTSans-Italic.ttf differ
diff --git a/frontend/src/fonts/PT_Sans/PTSans-Regular.ttf b/frontend/src/fonts/PT_Sans/PTSans-Regular.ttf
new file mode 100644
index 0000000000..adaf6718ab
Binary files /dev/null and b/frontend/src/fonts/PT_Sans/PTSans-Regular.ttf differ
diff --git a/frontend/src/hooks/useBoolean.ts b/frontend/src/hooks/useBoolean.ts
new file mode 100644
index 0000000000..35f8529312
--- /dev/null
+++ b/frontend/src/hooks/useBoolean.ts
@@ -0,0 +1,26 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useCallback, useState } from "react";
+
+type Event = Partial<Pick<React.MouseEvent, "stopPropagation">>;
+
+export function useBoolean(initialState: boolean) {
+ const [state, setState] = useState(initialState);
+
+ return [
+ state,
+ {
+ setTrue: useCallback((evt?: Event) => {
+ evt?.stopPropagation?.();
+ setState(true);
+ }, []),
+ setFalse: useCallback((evt?: Event) => {
+ evt?.stopPropagation?.();
+ setState(false);
+ }, []),
+ toggle: useCallback((evt?: Event) => {
+ evt?.stopPropagation?.();
+ setState((prev) => !prev);
+ }, []),
+ },
+ ] as const;
+}
diff --git a/frontend/src/hooks/useCellRenderCount.ts b/frontend/src/hooks/useCellRenderCount.ts
new file mode 100644
index 0000000000..42f70025fb
--- /dev/null
+++ b/frontend/src/hooks/useCellRenderCount.ts
@@ -0,0 +1,15 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+export function useCellRenderCount() {
+ return {
+ countRender: () => {
+ if (process.env.NODE_ENV !== "test") {
+ return;
+ }
+
+ const currentCount = Number.parseInt(
+ document.body.dataset.cellRenderCount || "0"
+ );
+ document.body.dataset.cellRenderCount = (currentCount + 1).toString();
+ },
+ };
+}
diff --git a/frontend/src/hooks/useElapsedTime.ts b/frontend/src/hooks/useElapsedTime.ts
new file mode 100644
index 0000000000..bf485bd3dc
--- /dev/null
+++ b/frontend/src/hooks/useElapsedTime.ts
@@ -0,0 +1,20 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useEffect, useState } from "react";
+
+/**
+ * Returns the elapsed time since mount.
+ */
+export function useElapsedTime() {
+ const [time, setTime] = useState(0);
+
+ useEffect(() => {
+ const step = 17; // 60 FPS
+ const interval = setInterval(() => {
+ setTime((time) => time + step);
+ }, step);
+
+ return () => clearInterval(interval);
+ });
+
+ return time;
+}
diff --git a/frontend/src/hooks/useEvent.ts b/frontend/src/hooks/useEvent.ts
new file mode 100644
index 0000000000..4cb6a8ce4f
--- /dev/null
+++ b/frontend/src/hooks/useEvent.ts
@@ -0,0 +1,2 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+export { default as useEvent } from "react-use-event-hook";
diff --git a/frontend/src/hooks/useEventListener.ts b/frontend/src/hooks/useEventListener.ts
new file mode 100644
index 0000000000..3d4a70d951
--- /dev/null
+++ b/frontend/src/hooks/useEventListener.ts
@@ -0,0 +1,46 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useRef, useEffect } from "react";
+
+export function useEventListener<K extends keyof DocumentEventMap>(
+ type: K,
+ listener: (ev: DocumentEventMap[K]) => unknown,
+ options?: boolean | AddEventListenerOptions
+): void {
+ const savedListener = useRef(listener);
+
+ useEffect(() => {
+ savedListener.current = listener;
+ }, [listener]);
+
+ useEffect(() => {
+ const eventListener = (event: DocumentEventMap[K]) =>
+ savedListener.current(event);
+ document.addEventListener(type, eventListener, options);
+
+ return () => {
+ document.removeEventListener(type, eventListener, options);
+ };
+ }, [type, options]);
+}
+
+export function useWindowEventListener<K extends keyof WindowEventMap>(
+ type: K,
+ listener: (ev: WindowEventMap[K]) => unknown,
+ options?: boolean | AddEventListenerOptions
+): void {
+ const savedListener = useRef(listener);
+
+ useEffect(() => {
+ savedListener.current = listener;
+ }, [listener]);
+
+ useEffect(() => {
+ const eventListener = (event: WindowEventMap[K]) =>
+ savedListener.current(event);
+ window.addEventListener(type, eventListener, options);
+
+ return () => {
+ window.removeEventListener(type, eventListener, options);
+ };
+ }, [type, options]);
+}
diff --git a/frontend/src/hooks/useHotkey.ts b/frontend/src/hooks/useHotkey.ts
new file mode 100644
index 0000000000..64c5a1a95d
--- /dev/null
+++ b/frontend/src/hooks/useHotkey.ts
@@ -0,0 +1,37 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useEffect } from "react";
+
+import { parseShortcut } from "../core/shortcuts/shortcuts";
+import { useEventListener } from "./useEventListener";
+import { useEvent } from "./useEvent";
+import { useSetRegisteredAction } from "../core/state/actions";
+import { HOTKEYS, HotkeyAction } from "@/core/hotkeys/hotkeys";
+
+/**
+ * Registers a hotkey listener for the given shortcut.
+ *
+ * @param callback The callback to run when the shortcut is pressed. It does not need to be memoized as this hook will always use the latest callback.
+ */
+export function useHotkey(shortcut: HotkeyAction, callback: () => void) {
+ const { registerAction, unregisterAction } = useSetRegisteredAction();
+
+ const memoizeCallback = useEvent(() => callback());
+
+ const listener = useEvent((e: KeyboardEvent) => {
+ const key = HOTKEYS.getHotkey(shortcut).key;
+ if (parseShortcut(key)(e)) {
+ e.preventDefault();
+ callback();
+ }
+ });
+
+ // Register keydown listener
+ useEventListener("keydown", listener);
+
+ // Register with the shortcut registry
+ useEffect(() => {
+ registerAction(shortcut, memoizeCallback);
+ return () => unregisterAction(shortcut);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [memoizeCallback, shortcut]);
+}
diff --git a/frontend/src/hooks/useLocalStorage.ts b/frontend/src/hooks/useLocalStorage.ts
new file mode 100644
index 0000000000..c3a018b910
--- /dev/null
+++ b/frontend/src/hooks/useLocalStorage.ts
@@ -0,0 +1,19 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useState } from "react";
+
+/**
+ * React hook to use localStorage
+ */
+export function useLocalStorage<T>(key: string, defaultValue: T) {
+ const [storedValue, setStoredValue] = useState<T>(() => {
+ const item = window.localStorage.getItem(key);
+ return item ? (JSON.parse(item) as T) : defaultValue;
+ });
+
+ const setValue = (value: T) => {
+ setStoredValue(value);
+ window.localStorage.setItem(key, JSON.stringify(value));
+ };
+
+ return [storedValue, setValue] as const;
+}
diff --git a/frontend/src/hooks/useRecentCommands.ts b/frontend/src/hooks/useRecentCommands.ts
new file mode 100644
index 0000000000..b6b6f1714a
--- /dev/null
+++ b/frontend/src/hooks/useRecentCommands.ts
@@ -0,0 +1,24 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { HotkeyAction } from "@/core/hotkeys/hotkeys";
+import { useLocalStorage } from "./useLocalStorage";
+
+const MAX_RECENT_COMMANDS = 3;
+
+export function useRecentCommands() {
+ const [commands, setCommands] = useLocalStorage<HotkeyAction[]>(
+ "marimo:commands",
+ []
+ );
+
+ return {
+ recentCommands: commands,
+ addRecentCommand: (command: HotkeyAction) => {
+ const uniqueCommands = unique([command, ...commands]);
+ setCommands(uniqueCommands.slice(0, MAX_RECENT_COMMANDS));
+ },
+ };
+}
+
+function unique<T>(xs: T[]): T[] {
+ return [...new Set(xs)];
+}
diff --git a/frontend/src/index.ts b/frontend/src/index.ts
new file mode 100644
index 0000000000..558f34a8dc
--- /dev/null
+++ b/frontend/src/index.ts
@@ -0,0 +1,4 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+export { MarimoApp } from "./MarimoApp";
+// Theme exports
+export { ThemeProvider } from "./theme/ThemeProvider";
diff --git a/frontend/src/lib/utils.ts b/frontend/src/lib/utils.ts
new file mode 100644
index 0000000000..9e88c2fbca
--- /dev/null
+++ b/frontend/src/lib/utils.ts
@@ -0,0 +1,8 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+
+import { ClassValue, clsx } from "clsx";
+import { twMerge } from "tailwind-merge";
+
+export function cn(...inputs: ClassValue[]) {
+ return twMerge(clsx(inputs));
+}
diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx
new file mode 100644
index 0000000000..e4ca92b354
--- /dev/null
+++ b/frontend/src/main.tsx
@@ -0,0 +1,58 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import React from "react";
+import ReactDOM from "react-dom/client";
+import { worker } from "./mocks/browser";
+import { ThemeProvider } from "./theme/ThemeProvider";
+import { ErrorBoundary } from "./editor/boundary/ErrorBoundary";
+import { MarimoApp } from "./MarimoApp";
+import { getInitialAppMode } from "./core/mode";
+import { Logger } from "./utils/Logger";
+import { reportVitals } from "./utils/vitals";
+import { Provider } from "jotai";
+
+/**
+ * Main entry point for the Marimo app.
+ *
+ * Sets up the Marimo app with a theme provider.
+ * This file will optionally start the MSW worker if enabled.
+ */
+
+if (import.meta.env.DEV && import.meta.env.VITE_MSW) {
+ worker.start({
+ onUnhandledRequest(req) {
+ if (req.url.href.startsWith("/kernel")) {
+ Logger.error(
+ `Found an unhandled ${req.method} request to ${req.url.href}`
+ );
+ }
+ },
+ });
+}
+
+// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, ssr-friendly/no-dom-globals-in-module-scope
+const root = ReactDOM.createRoot(document.getElementById("root")!);
+
+try {
+ const initialMode = getInitialAppMode();
+ root.render(
+ <React.StrictMode>
+ <Provider>
+ <ThemeProvider>
+ <MarimoApp initialMode={initialMode} />
+ </ThemeProvider>
+ </Provider>
+ </React.StrictMode>
+ );
+} catch (error) {
+ // Most likely, configuration failed to parse.
+ const Throw = () => {
+ throw error;
+ };
+ root.render(
+ <ErrorBoundary>
+ <Throw />
+ </ErrorBoundary>
+ );
+} finally {
+ reportVitals();
+}
diff --git a/frontend/src/mocks/browser.ts b/frontend/src/mocks/browser.ts
new file mode 100644
index 0000000000..60eff4e384
--- /dev/null
+++ b/frontend/src/mocks/browser.ts
@@ -0,0 +1,12 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { setupWorker } from "msw";
+import { handlers } from "./handlers";
+import { createMockServer } from "./socket";
+
+// Create a mock server for the WebSocket connection.
+if (import.meta.env.DEV && import.meta.env.VITE_MSW) {
+ createMockServer();
+}
+
+// This configures a Service Worker with the given request handlers.
+export const worker = setupWorker(...handlers);
diff --git a/frontend/src/mocks/handlers.ts b/frontend/src/mocks/handlers.ts
new file mode 100644
index 0000000000..b810d2f12b
--- /dev/null
+++ b/frontend/src/mocks/handlers.ts
@@ -0,0 +1,72 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { rest } from "msw";
+import { SaveKernelRequest } from "../core/network/types";
+
+export const handlers = [
+ // Run
+ rest.post("/api/kernel/run/", (req, res, ctx) => {
+ return res(
+ ctx.status(200),
+ ctx.json({
+ status: "ok",
+ })
+ );
+ }),
+
+ // Save
+ rest.post<SaveKernelRequest>("/api/kernel/save/", async (req, res, ctx) => {
+ sessionStorage.setItem(
+ "merimo:msw:save",
+ JSON.stringify(await req.json<SaveKernelRequest>())
+ );
+
+ return res(
+ ctx.status(200),
+ ctx.json({
+ status: "ok",
+ })
+ );
+ }),
+
+ // Instantiate
+ rest.post("/api/kernel/instantiate/", (req, res, ctx) => {
+ return res(
+ ctx.status(200),
+ ctx.json({
+ status: "ok",
+ })
+ );
+ }),
+
+ // Directory autocomplete
+ rest.post("/api/kernel/directory_autocomplete/", (req, res, ctx) => {
+ return res(
+ ctx.status(200),
+ ctx.json({
+ status: "ok",
+ matches: [],
+ files: [],
+ })
+ );
+ }),
+
+ // Rename
+ rest.post("/api/kernel/rename/", (req, res, ctx) => {
+ return res(
+ ctx.status(200),
+ ctx.json({
+ status: "ok",
+ })
+ );
+ }),
+
+ // Delete
+ rest.post("/api/kernel/delete/", (req, res, ctx) => {
+ return res(
+ ctx.status(200),
+ ctx.json({
+ status: "ok",
+ })
+ );
+ }),
+];
diff --git a/frontend/src/mocks/socket.ts b/frontend/src/mocks/socket.ts
new file mode 100644
index 0000000000..4e5c0c6e9e
--- /dev/null
+++ b/frontend/src/mocks/socket.ts
@@ -0,0 +1,21 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { Server } from "mock-socket";
+import { getKernelId } from "../core/kernel/kernel";
+import { UUID } from "../utils/uuid";
+import { Logger } from "../utils/Logger";
+
+export function createMockServer() {
+ const fakeURL = `ws://${
+ window.location.host
+ }/iosocket?kernel_id=${getKernelId()}&uuid=${UUID}`;
+ const mockServer = new Server(fakeURL);
+
+ mockServer.on("connection", (socket) => {
+ socket.on("message", (data) => {
+ Logger.log("[mock] message", data);
+ });
+ socket.on("close", () => {
+ Logger.log("[mock] close");
+ });
+ });
+}
diff --git a/frontend/src/plugins/core/BadPlugin.tsx b/frontend/src/plugins/core/BadPlugin.tsx
new file mode 100644
index 0000000000..2f700b8674
--- /dev/null
+++ b/frontend/src/plugins/core/BadPlugin.tsx
@@ -0,0 +1,36 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { ZodError } from "zod";
+import { Alert } from "../../components/ui/alert";
+import { AlertTitle } from "../../components/ui/alert";
+
+interface Props {
+ error: ZodError | Error;
+}
+
+export const BadPluginData: React.FC<Props> = ({ error }) => {
+ if (error instanceof ZodError) {
+ return (
+ <Alert variant="destructive">
+ <AlertTitle>Bad Data</AlertTitle>
+ <div className="text-md">
+ <ul>
+ {error.issues.map((issue) => {
+ const path = issue.path.join(".");
+ return (
+ <li key={path}>
+ <span className="font-bold">{path}</span>: {issue.message}
+ </li>
+ );
+ })}
+ </ul>
+ </div>
+ </Alert>
+ );
+ }
+
+ return <div>{error.message}</div>;
+};
+
+export function renderError(error: ZodError | Error): JSX.Element {
+ return <BadPluginData error={error} />;
+}
diff --git a/frontend/src/plugins/core/RenderHTML.tsx b/frontend/src/plugins/core/RenderHTML.tsx
new file mode 100644
index 0000000000..42f97c6aed
--- /dev/null
+++ b/frontend/src/plugins/core/RenderHTML.tsx
@@ -0,0 +1,40 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import parse, { Element } from "html-react-parser";
+import React from "react";
+
+interface Props {
+ html: string;
+}
+
+/**
+ * Wrapper for customer dangerouslySetInnerHTML.
+ * We instead render HTML to React elements using html-react-parser as this keeps
+ * React elements in place so React's reconciliation algorithm will update nodes instead of unmounting and remounting.
+ */
+export const RenderHTML: React.FC<Props> = ({ html }) => {
+ return (
+ <>
+ {parse(html, {
+ replace: (domNode) => {
+ // For iframe, we just want to use dangerouslySetInnerHTML so:
+ // 1) we can remount the iframe when the src changes
+ // 2) keep event attributes (onload, etc.) since this library removes them
+ if (
+ domNode instanceof Element &&
+ domNode.attribs &&
+ domNode.name === "iframe"
+ ) {
+ const element = document.createElement("iframe");
+ Object.entries(domNode.attribs).forEach(([key, value]) => {
+ element.setAttribute(key, value as string);
+ });
+ return (
+ <div dangerouslySetInnerHTML={{ __html: element.outerHTML }} />
+ );
+ }
+ return domNode;
+ },
+ })}
+ </>
+ );
+};
diff --git a/frontend/src/plugins/core/componentFactory.tsx b/frontend/src/plugins/core/componentFactory.tsx
new file mode 100644
index 0000000000..4853a771f4
--- /dev/null
+++ b/frontend/src/plugins/core/componentFactory.tsx
@@ -0,0 +1,383 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+/* eslint-disable unicorn/prefer-spread */
+/**
+ * WebComponent Factory for React Components
+ *
+ * Provides a factory for defining a custom web component from a React
+ * component. The factory handles the logic of communicating UI element values
+ * to and from the rest of marimo.
+ */
+import React, {
+ createRef,
+ ReactNode,
+ useCallback,
+ useEffect,
+ useImperativeHandle,
+ useRef,
+ useState,
+} from "react";
+import ReactDOM, { Root } from "react-dom/client";
+
+import {
+ createInputEvent,
+ marimoValueUpdateEvent,
+ MarimoValueUpdateEventType,
+} from "@/core/dom/events";
+import { defineCustomElement } from "../../core/dom/defineCustomElement";
+import { parseAttrValue, parseInitialValue } from "../../core/dom/htmlUtils";
+import { IPlugin } from "../types";
+import { Objects } from "../../utils/objects";
+import { renderError } from "./BadPlugin";
+import { RenderHTML } from "./RenderHTML";
+import { invariant } from "../../utils/invariant";
+import { Logger } from "../../utils/Logger";
+
+export interface PluginSlotHandle {
+ /**
+ * Reset the plugin initial value and data.
+ */
+ reset: () => void;
+
+ /**
+ * Set the plugin's children.
+ */
+ setChildren: (children: ReactNode) => void;
+}
+
+interface PluginSlotProps<T> {
+ hostElement: HTMLElement;
+ plugin: IPlugin<T, unknown>;
+ children?: ReactNode | undefined;
+ getInitialValue: () => T;
+}
+
+/* Handles synchronization of value on behalf of the component */
+function PluginSlotInternal<T>(
+ { hostElement, plugin, children, getInitialValue }: PluginSlotProps<T>,
+ ref: React.Ref<PluginSlotHandle>
+): JSX.Element {
+ const [childNodes, setChildNodes] = useState<ReactNode>(children);
+ const [value, setValue] = useState<T>(getInitialValue());
+
+ const [parseResult, setParseResult] = useState(() => {
+ return plugin.validator.safeParse({
+ // For any string values, unescape/parse them
+ ...Objects.mapValues(hostElement.dataset, (value) =>
+ typeof value === "string" ? parseAttrValue(value) : value
+ ),
+ });
+ });
+
+ useImperativeHandle(ref, () => ({
+ reset: () => {
+ setValue(getInitialValue());
+ setParseResult(
+ plugin.validator.safeParse({
+ // For any string values, unescape/parse them
+ ...Objects.mapValues(hostElement.dataset, (value) =>
+ typeof value === "string" ? parseAttrValue(value) : value
+ ),
+ })
+ );
+ },
+ setChildren: (children) => {
+ setChildNodes(children);
+ },
+ }));
+
+ // When the component's value changes due to an interaction, an input
+ // event should be dispatched; an event should not be dispatched when
+ // the value changes due to an update event broadcast by another component.
+ // TODO: is this still needed ...? might want to dispatch value update
+ // even when value hasn't changed (so python kernel gets triggered ...)
+ const shouldDispatchInput = useRef(false);
+
+ if (shouldDispatchInput.current) {
+ hostElement.dispatchEvent(createInputEvent(value, hostElement));
+ shouldDispatchInput.current = false;
+ }
+
+ useEffect(() => {
+ const handleValue = (e: MarimoValueUpdateEventType) => {
+ if (e.detail.element === hostElement) {
+ setValue(e.detail.value as T);
+ }
+ };
+ // We create a mutation observer to listen for changes to the host element's attributes
+ // and update the plugin's data accordingly
+ const observer = new MutationObserver((mutations) => {
+ const hasAttributeMutation = mutations.some(
+ (mutation) =>
+ mutation.type === "attributes" &&
+ mutation.attributeName?.startsWith("data-")
+ );
+ if (hasAttributeMutation) {
+ setParseResult(
+ plugin.validator.safeParse({
+ // For any string values, unescape/parse them
+ ...Objects.mapValues(hostElement.dataset, (value) =>
+ typeof value === "string" ? parseAttrValue(value) : value
+ ),
+ })
+ );
+ }
+ });
+
+ // Create listeners
+ hostElement.addEventListener(marimoValueUpdateEvent, handleValue);
+ observer.observe(hostElement, {
+ attributes: true, // configure it to listen to attribute changes
+ });
+
+ return () => {
+ // Remove listeners
+ hostElement.removeEventListener(marimoValueUpdateEvent, handleValue);
+ observer.disconnect();
+ };
+ }, [hostElement, plugin.validator]);
+
+ const setValueAndSendInput = useCallback(
+ (value: T | ((prevValue: T) => T)): void => {
+ shouldDispatchInput.current = true;
+ setValue(value);
+ },
+ [setValue, shouldDispatchInput]
+ );
+
+ // If we failed to parse the initial value, render an error
+ if (!parseResult.success) {
+ return renderError(parseResult.error);
+ }
+
+ // Render the plugin
+ return plugin.render({
+ setValue: setValueAndSendInput,
+ value,
+ data: parseResult.data,
+ children: childNodes,
+ host: hostElement,
+ });
+}
+
+const PluginSlot: React.ForwardRefExoticComponent<
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ PluginSlotProps<any> & React.RefAttributes<PluginSlotHandle>
+> = React.forwardRef(PluginSlotInternal);
+
+const styleSheetCache = new Map<string, CSSStyleSheet>();
+
+/**
+ * Register a React component as a custom element
+ *
+ * The custom element is expected to have the attribute
+ * "data-initial-value", containing an initial value for the component.
+ * It may take any other attributes as well. Any attributes that are prefixed
+ * with "data-" will be passed to the component as props.
+ *
+ * We listen on any changes to the children of the element and re-render the
+ * React component when they change. Instead of unmounting the component, we
+ * replace the children via a callback passed to the component.
+ *
+ * We also copy any local stylesheets into the shadow root of the component.
+ * This is necessary because the shadow root is not part of the DOM, so it
+ * cannot access stylesheets from the main document.
+ * We need to wait for the stylesheets to load before rendering the component,
+ * otherwise the component my flash unstyled.
+ *
+ * @param plugin - The plugin to register which contains the component tagName
+ * and the React component to render
+ */
+export function registerReactComponent<T>(plugin: IPlugin<T, unknown>): void {
+ const WebComponent = class extends HTMLElement {
+ private observer: MutationObserver;
+ private root?: Root;
+ private mounted = false;
+ private pluginRef = createRef<PluginSlotHandle>();
+
+ constructor() {
+ super();
+ // Create a shadow root so we can store the React tree on the shadow root, while the original
+ // element's children are still on the DOM
+ this.attachShadow({ mode: "open" });
+ this.copyStyles();
+
+ // This observer is used to detect changes to the children and re-render the component
+ this.observer = new MutationObserver(() => {
+ this.pluginRef.current?.setChildren(this.getChildren());
+ });
+ }
+
+ connectedCallback() {
+ if (!this.mounted) {
+ // Create a React root on the shadow root
+ invariant(this.shadowRoot, "Shadow root should exist");
+ // If we already have a root, unmount it before creating a new one
+ if (this.root) {
+ // This can't happen in disconnectedCallback because we want React to
+ // handle the descendants unmounting.
+ this.root.unmount();
+ }
+ this.root = ReactDOM.createRoot(this.shadowRoot);
+
+ // Render the component for the first time
+ this.mountReactComponent();
+ }
+
+ // Listen for DOM changes
+ this.observer.observe(this, {
+ attributes: true,
+ childList: true,
+ subtree: true,
+ characterData: true,
+ });
+ }
+
+ disconnectedCallback() {
+ this.observer.disconnect();
+ if (this.mounted) {
+ this.mounted = false;
+ }
+ }
+
+ rerender() {
+ this.pluginRef.current?.reset();
+ }
+
+ /**
+ * Get the children of the element as React nodes.
+ * Any text nodes will be wrapped in a <span> element.
+ *
+ * TODO: would be nicer to just do `<RenderHTML html={this.innerHTML} />
+ * but downstream plugins (like Tex) may assume a wrapped element.
+ * We can fix this in future.
+ */
+ private getChildren(): React.ReactNode {
+ return Array.from(this.childNodes)
+ .map((child) => {
+ if (
+ child.nodeType === Node.ELEMENT_NODE &&
+ child instanceof HTMLElement
+ ) {
+ return <RenderHTML html={child.outerHTML} />;
+ } else if (child.nodeType === Node.TEXT_NODE) {
+ return <span>{child.textContent}</span>;
+ } else {
+ return undefined;
+ }
+ })
+ .filter(Boolean);
+ }
+
+ /**
+ * Mount the React component to the shadow root
+ */
+ private async mountReactComponent() {
+ this.mounted = true;
+
+ invariant(this.root, "Root must be defined");
+ this.root.render(
+ <PluginSlot
+ hostElement={this}
+ plugin={plugin}
+ ref={this.pluginRef}
+ getInitialValue={() => {
+ return parseInitialValue(this);
+ }}
+ >
+ {this.getChildren()}
+ </PluginSlot>
+ );
+ }
+
+ /**
+ * Copy stylesheets from the main document to the shadow root
+ */
+ private async copyStyles() {
+ const shadowRoot = this.shadowRoot;
+ invariant(shadowRoot, "Shadow root should exist");
+
+ // If we don't support adopted stylesheets, we need to copy the styles
+ if (!this.isAdoptedStyleSheetsSupported()) {
+ this.copyStylesFallback();
+ return;
+ }
+
+ // Get all stylesheets from the main document
+ const sheets = Array.from(document.styleSheets).filter((sheet) => {
+ // Support for styles with Vite
+ if (
+ sheet.ownerNode instanceof HTMLElement &&
+ sheet.ownerNode.dataset["viteDevId"]
+ ) {
+ return true;
+ }
+ // Only copy stylesheets that point to our domain
+ return sheet.href && sheet.href.startsWith(window.location.origin);
+ });
+ // Create new stylesheets if not already cached
+ for (const sheet of sheets) {
+ const sheetUniqueKey =
+ sheet.href ??
+ (sheet.ownerNode instanceof HTMLElement
+ ? sheet.ownerNode.dataset["viteDevId"]
+ : undefined);
+ if (!sheetUniqueKey) {
+ continue;
+ }
+
+ if (!styleSheetCache.has(sheetUniqueKey)) {
+ // We need to create a new stylesheet because we can't use the same
+ // stylesheet otherwise the browser will throw an error.
+ const newSheet = new CSSStyleSheet();
+ newSheet.replaceSync(
+ Array.from(sheet.cssRules)
+ .map((rule) => {
+ if (rule.cssText.includes("@import")) {
+ // @import rules are not supported in adoptedStyleSheets
+ return "";
+ }
+ return rule.cssText;
+ })
+ .join("\n")
+ );
+ styleSheetCache.set(sheetUniqueKey, newSheet);
+ }
+ }
+ // Add all stylesheets to the shadow root
+ shadowRoot.adoptedStyleSheets = [...styleSheetCache.values()];
+ }
+
+ private copyStylesFallback() {
+ const shadowRoot = this.shadowRoot;
+ invariant(shadowRoot, "Shadow root should exist");
+
+ Logger.warn(
+ "adoptedStyleSheets not supported, copying stylesheets in a less performance way. Please consider upgrading your browser."
+ );
+
+ const styleSheets = Array.from(document.styleSheets).flatMap((sheet) => {
+ // Only copy stylesheets that point to our domain
+ if (!sheet.href || !sheet.href.startsWith(window.location.origin)) {
+ return [];
+ }
+
+ const style = document.createElement("style");
+ style.textContent = Array.from(sheet.cssRules)
+ .map((rule) => rule.cssText)
+ .join("\n");
+ return [style];
+ });
+
+ shadowRoot.append(...styleSheets);
+ }
+
+ private isAdoptedStyleSheetsSupported() {
+ return (
+ "adoptedStyleSheets" in Document.prototype &&
+ "replace" in CSSStyleSheet.prototype
+ );
+ }
+ };
+
+ defineCustomElement(plugin.tagName, WebComponent);
+}
diff --git a/frontend/src/plugins/impl/ButtonPlugin.tsx b/frontend/src/plugins/impl/ButtonPlugin.tsx
new file mode 100644
index 0000000000..f77250c794
--- /dev/null
+++ b/frontend/src/plugins/impl/ButtonPlugin.tsx
@@ -0,0 +1,26 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { z } from "zod";
+
+import { IPlugin, IPluginProps } from "../types";
+import { Button } from "../../components/ui/button";
+import { RenderHTML } from "../core/RenderHTML";
+
+export class ButtonPlugin implements IPlugin<number, { label: string }> {
+ tagName = "marimo-button";
+
+ validator = z.object({ initialValue: z.number(), label: z.string() });
+
+ render(props: IPluginProps<number, { label: string }>): JSX.Element {
+ // value counts number of times button was clicked
+ return (
+ <Button
+ variant="secondary"
+ size="xs"
+ onClick={() => props.setValue((v) => v + 1)}
+ type="submit"
+ >
+ <RenderHTML html={props.data.label} />
+ </Button>
+ );
+ }
+}
diff --git a/frontend/src/plugins/impl/CheckboxPlugin.tsx b/frontend/src/plugins/impl/CheckboxPlugin.tsx
new file mode 100644
index 0000000000..b682682314
--- /dev/null
+++ b/frontend/src/plugins/impl/CheckboxPlugin.tsx
@@ -0,0 +1,53 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useId } from "react";
+import { z } from "zod";
+
+import { IPlugin, IPluginProps } from "../types";
+import * as labelStyles from "./Label.styles";
+import { Checkbox } from "../../components/ui/checkbox";
+import { Label } from "../../components/ui/label";
+import { CheckedState } from "@radix-ui/react-checkbox";
+import { RenderHTML } from "../core/RenderHTML";
+
+export class CheckboxPlugin
+ implements IPlugin<boolean, { label: string | null }>
+{
+ tagName = "marimo-checkbox";
+
+ validator = z.object({
+ initialValue: z.boolean(),
+ label: z.string().nullable(),
+ });
+
+ render(props: IPluginProps<boolean, { label: string | null }>): JSX.Element {
+ return <CheckboxComponent {...props} />;
+ }
+}
+
+const CheckboxComponent = ({
+ value,
+ setValue,
+ data,
+}: IPluginProps<boolean, { label: string | null }>): JSX.Element => {
+ const onClick = (newValue: CheckedState) => {
+ // unsupported state
+ if (newValue === "indeterminate") {
+ return;
+ }
+ setValue(newValue);
+ };
+ const id = useId();
+ const labelElement =
+ data.label === null ? null : (
+ <Label htmlFor={id} className="text-md">
+ <RenderHTML html={data.label} />
+ </Label>
+ );
+
+ return (
+ <div className={`${labelStyles.labelContainer} align-middle`}>
+ <Checkbox checked={value} onCheckedChange={onClick} id={id} />
+ {labelElement}
+ </div>
+ );
+};
diff --git a/frontend/src/plugins/impl/DataTablePlugin.tsx b/frontend/src/plugins/impl/DataTablePlugin.tsx
new file mode 100644
index 0000000000..06fbfc4639
--- /dev/null
+++ b/frontend/src/plugins/impl/DataTablePlugin.tsx
@@ -0,0 +1,100 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useId, useMemo } from "react";
+import { z } from "zod";
+
+import { Label } from "@/components/ui/label";
+import { HtmlOutput } from "@/editor/output/HtmlOutput";
+import { IPlugin, IPluginProps } from "@/plugins/types";
+import { DataTable } from "../../components/data-table/data-table";
+import { generateColumns } from "../../components/data-table/columns";
+
+/**
+ * Arguments for a data table
+ *
+ * @param label - a label of the table
+ * @param data - the data to display
+ */
+interface Data<T> {
+ label: string | null;
+ data: T[];
+ pagination: boolean;
+ selection: "single" | "multi" | null;
+}
+
+// Value is selection, but it is not currently exposed to the user
+type S = Array<string | number>;
+
+export class DataTablePlugin implements IPlugin<S, Data<unknown>> {
+ tagName = "marimo-table";
+
+ validator = z.object({
+ initialValue: z.array(z.number()),
+ label: z.string().nullable(),
+ data: z.array(z.object({}).passthrough()),
+ pagination: z.boolean().default(false),
+ selection: z.enum(["single", "multi"]).nullable().default(null),
+ });
+
+ render(props: IPluginProps<S, Data<unknown>>): JSX.Element {
+ return (
+ <DataTableComponent
+ {...props.data}
+ value={props.value}
+ setValue={props.setValue}
+ />
+ );
+ }
+}
+
+interface DataTableProps extends Data<unknown> {
+ value: S;
+ setValue: (value: S) => void;
+}
+
+const DataTableComponent = ({
+ label,
+ data,
+ pagination,
+ selection,
+ value,
+ setValue,
+}: DataTableProps): JSX.Element => {
+ const id = useId();
+ const labelElement = label && (
+ <Label htmlFor={id} className="pb-3">
+ <HtmlOutput html={label} inline={true} />
+ </Label>
+ );
+
+ const columns = useMemo(
+ () => generateColumns(data, selection),
+ [data, selection]
+ );
+
+ const rowSelection = Object.fromEntries((value || []).map((v) => [v, true]));
+
+ return (
+ <div className="flex flex-col">
+ {labelElement}
+ <DataTable
+ data={data}
+ columns={columns}
+ pagination={pagination}
+ rowSelection={rowSelection}
+ onRowSelectionChange={(updater) => {
+ if (selection === "single") {
+ const nextValue =
+ typeof updater === "function" ? updater({}) : updater;
+ setValue(Object.keys(nextValue).slice(0, 1));
+ }
+
+ if (selection === "multi") {
+ const nextValue =
+ typeof updater === "function" ? updater(rowSelection) : updater;
+ setValue(Object.keys(nextValue));
+ }
+ }}
+ />
+ </div>
+ );
+};
diff --git a/frontend/src/plugins/impl/DatePickerPlugin.tsx b/frontend/src/plugins/impl/DatePickerPlugin.tsx
new file mode 100644
index 0000000000..fd036d4d18
--- /dev/null
+++ b/frontend/src/plugins/impl/DatePickerPlugin.tsx
@@ -0,0 +1,87 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useId, useRef } from "react";
+import { Label } from "../../components/ui/label";
+import { z } from "zod";
+
+import { IPlugin, IPluginProps, Setter } from "../types";
+import { HtmlOutput } from "../../editor/output/HtmlOutput";
+import * as labelStyles from "./Label.styles";
+import { Input } from "../../components/ui/input";
+
+type T = string;
+
+interface Data {
+ label: string | null;
+ start: string;
+ stop: string;
+ step?: string;
+}
+
+export class DatePickerPlugin implements IPlugin<T, Data> {
+ tagName = "marimo-date-picker";
+
+ validator = z.object({
+ initialValue: z.string(),
+ label: z.string().nullable(),
+ start: z.string(),
+ stop: z.string(),
+ step: z.string().optional(),
+ });
+
+ render(props: IPluginProps<T, Data>): JSX.Element {
+ return (
+ <DatePicker
+ {...props.data}
+ value={props.value}
+ setValue={props.setValue}
+ />
+ );
+ }
+}
+
+interface DatePickerProps extends Data {
+ value: T;
+ setValue: Setter<T>;
+}
+
+const DatePicker = (props: DatePickerProps): JSX.Element => {
+ const inputRef = useRef<HTMLInputElement>(null);
+ const handleInput = () => {
+ if (inputRef.current !== null && inputRef.current.valueAsDate !== null) {
+ // basic bounds validation; browser validation is lacking
+ // when the input's value changes due to keyboard events
+ let valueAsDate = inputRef.current.valueAsDate;
+ const minDate = new Date(props.start);
+ valueAsDate = valueAsDate < minDate ? minDate : valueAsDate;
+ const maxDate = new Date(props.stop);
+ valueAsDate = valueAsDate > maxDate ? maxDate : valueAsDate;
+ const isoStr = valueAsDate.toISOString();
+ // isoStr is of the form YYYY-MM-DDTHH...
+ const newValue = isoStr.slice(0, isoStr.indexOf("T"));
+ props.setValue(newValue);
+ }
+ };
+
+ const id = useId();
+ const labelElement =
+ props.label === null ? null : (
+ <Label htmlFor={id}>
+ <HtmlOutput html={props.label} inline={true} />
+ </Label>
+ );
+
+ return (
+ <div className={labelStyles.labelContainer}>
+ {labelElement}
+ <Input
+ ref={inputRef}
+ type="date"
+ min={props.start}
+ max={props.stop}
+ value={props.value}
+ onInput={handleInput}
+ id={id}
+ />
+ </div>
+ );
+};
diff --git a/frontend/src/plugins/impl/DictPlugin.tsx b/frontend/src/plugins/impl/DictPlugin.tsx
new file mode 100644
index 0000000000..df6df638cc
--- /dev/null
+++ b/frontend/src/plugins/impl/DictPlugin.tsx
@@ -0,0 +1,84 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useEffect } from "react";
+import { z } from "zod";
+
+import { UI_ELEMENT_TAG_NAME } from "../../core/dom/UIElement";
+import {
+ marimoValueInputEvent,
+ MarimoValueInputEventType,
+} from "../../core/dom/events";
+import { IPlugin, IPluginProps, Setter } from "../types";
+
+// key => value updates
+type T = Record<string, unknown> | null;
+
+interface Data {
+ label: string | null;
+ // mapping from elementId to key
+ elementIds: Record<string, string>;
+}
+
+export class DictPlugin implements IPlugin<T, Data> {
+ tagName = "marimo-dict";
+
+ validator = z.object({
+ label: z.string().nullable(),
+ elementIds: z.record(z.string(), z.string()),
+ });
+
+ render(props: IPluginProps<T, Data>): JSX.Element {
+ return (
+ <Dict {...props.data} value={props.value} setValue={props.setValue}>
+ {props.children}
+ </Dict>
+ );
+ }
+}
+
+interface DictProps extends Data {
+ value: T;
+ setValue: Setter<T>;
+ children?: React.ReactNode | undefined;
+}
+
+const Dict = ({
+ elementIds,
+ setValue,
+ children,
+}: DictProps): React.ReactNode => {
+ useEffect(() => {
+ // Spy on child input events to update state
+ //
+ // When a child fires an input event, we need to update a dict entry
+ const handleUpdate = (e: MarimoValueInputEventType) => {
+ const target = e.detail.element;
+ if (target === null || !(target instanceof Node)) {
+ return;
+ }
+ const node = target.parentNode;
+ if (node === null || node.nodeName !== UI_ELEMENT_TAG_NAME) {
+ // If something other than a UI element triggered an event, ignore it
+ return;
+ }
+ const id = (node as Element).getAttribute("object-id") as string;
+ const key = elementIds[id];
+ if (key === undefined) {
+ // If the UI element firing the event is not in the dict, ignore it
+ return;
+ }
+
+ // Tell Python to update the dict at the given key with the new value
+ setValue(() => {
+ const updates: Record<string, unknown> = {};
+ updates[key] = e.detail.value;
+ return updates;
+ });
+ };
+ document.addEventListener(marimoValueInputEvent, handleUpdate);
+ return () => {
+ document.removeEventListener(marimoValueInputEvent, handleUpdate);
+ };
+ }, [elementIds, setValue]);
+
+ return children;
+};
diff --git a/frontend/src/plugins/impl/DropdownPlugin.tsx b/frontend/src/plugins/impl/DropdownPlugin.tsx
new file mode 100644
index 0000000000..f8e9288ad1
--- /dev/null
+++ b/frontend/src/plugins/impl/DropdownPlugin.tsx
@@ -0,0 +1,94 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useId } from "react";
+import { Label } from "../../components/ui/label";
+import { z } from "zod";
+
+import { IPlugin, IPluginProps } from "../types";
+import { HtmlOutput } from "../../editor/output/HtmlOutput";
+import * as labelStyles from "./Label.styles";
+import { NativeSelect } from "../../components/ui/native-select";
+
+interface Data {
+ label: string | null;
+ options: string[];
+ allowSelectNone: boolean;
+}
+
+export class DropdownPlugin implements IPlugin<string[], Data> {
+ tagName = "marimo-dropdown";
+
+ validator = z.object({
+ initialValue: z.array(z.string()),
+ label: z.string().nullable(),
+ options: z.array(z.string()),
+ allowSelectNone: z.boolean(),
+ });
+
+ render(props: IPluginProps<string[], Data>): JSX.Element {
+ return (
+ <Dropdown {...props.data} value={props.value} setValue={props.setValue} />
+ );
+ }
+}
+
+type T = string[];
+
+/**
+ * Arguments for a dropdown menu
+ *
+ * @param options - text labels for each dropdown option
+ * @param allowSelectNone - whether to have a null option
+ * @param label - an optional label for the dropdown
+ * @param value - an array of options that is selected by default
+ * @param setValue - selects a radio option
+ */
+interface DropdownProps extends Data {
+ value: T;
+ setValue: (value: T) => void;
+}
+
+const EMPTY_VALUE = "--";
+
+const Dropdown = (props: DropdownProps): JSX.Element => {
+ const { label, options, value, setValue, allowSelectNone } = props;
+
+ const id = useId();
+ const labelElement =
+ label === null ? null : (
+ <Label htmlFor={id}>
+ <HtmlOutput html={label} inline={true} />
+ </Label>
+ );
+
+ const defaultValue = allowSelectNone ? EMPTY_VALUE : options[0];
+ const singleValue = value.length === 0 ? defaultValue : value[0];
+
+ return (
+ <div className={labelStyles.labelContainer}>
+ {labelElement}
+ <NativeSelect
+ onChange={(e) => {
+ const newValue = e.target.value;
+ if (newValue === EMPTY_VALUE) {
+ setValue([]);
+ } else {
+ setValue([newValue]);
+ }
+ }}
+ value={singleValue}
+ id={id}
+ >
+ {allowSelectNone ? (
+ <option value={EMPTY_VALUE} selected={value.length === 0}>
+ --
+ </option>
+ ) : null}
+ {options.map((option) => (
+ <option value={option} selected={value.includes(option)} key={option}>
+ {option}
+ </option>
+ ))}
+ </NativeSelect>
+ </div>
+ );
+};
diff --git a/frontend/src/plugins/impl/FileUploadPlugin.tsx b/frontend/src/plugins/impl/FileUploadPlugin.tsx
new file mode 100644
index 0000000000..32593116de
--- /dev/null
+++ b/frontend/src/plugins/impl/FileUploadPlugin.tsx
@@ -0,0 +1,200 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { z } from "zod";
+import { useDropzone } from "react-dropzone";
+import { Upload } from "lucide-react";
+
+import { cn } from "@/lib/utils";
+import { IPlugin, IPluginProps, Setter } from "../types";
+import { filesToBase64 } from "../../utils/fileToBase64";
+import { buttonVariants } from "../../components/ui/button";
+import { HtmlOutput } from "../../editor/output/HtmlOutput";
+
+type FileUploadType = "button" | "area";
+
+/**
+ * Arguments for a file upload area/button
+ *
+ * @param filetypes - file types to accept (same as HTML input's accept attr)
+ * @param multiple - whether to allow the user to upload multiple files
+ * @param label - a label for the file upload area
+ */
+interface Data {
+ filetypes: string[];
+ multiple: boolean;
+ kind: FileUploadType;
+ label: string | null;
+}
+
+type T = Array<[string, string]>;
+
+export class FileUploadPlugin implements IPlugin<T, Data> {
+ tagName = "marimo-file";
+
+ validator = z.object({
+ filetypes: z.array(z.string()),
+ multiple: z.boolean(),
+ kind: z.enum(["button", "area"]),
+ label: z.string().nullable(),
+ });
+
+ render(props: IPluginProps<T, Data>): JSX.Element {
+ return (
+ <FileUpload
+ label={props.data.label}
+ filetypes={props.data.filetypes}
+ multiple={props.data.multiple}
+ kind={props.data.kind}
+ value={props.value}
+ setValue={props.setValue}
+ />
+ );
+ }
+}
+
+/**
+ * @param value - array of (filename, filecontents) tuples; filecontents should
+ * be b64 encoded.
+ * @param setValue - communicate file upload
+ */
+interface FileUploadProps extends Data {
+ value: T;
+ setValue: Setter<T>;
+}
+
+function groupFileTypesByMIMEType(extensions: string[]) {
+ const filesByMIMEType: Record<string, string[]> = {};
+
+ const appendExt = (mimetype: string, extension: string) => {
+ if (Object.hasOwnProperty.call(filesByMIMEType, mimetype)) {
+ filesByMIMEType[mimetype].push(extension);
+ } else {
+ filesByMIMEType[mimetype] = [extension];
+ }
+ };
+
+ extensions.forEach((extension) => {
+ switch (extension) {
+ case ".png":
+ case ".jpg":
+ case ".jpeg":
+ case ".gif":
+ case ".avif":
+ case ".bmp":
+ case ".ico":
+ case ".svg":
+ case ".tiff":
+ case ".webp":
+ appendExt("image/*", extension);
+ break;
+ case ".avi":
+ case ".mp4":
+ case ".mpeg":
+ case ".ogg":
+ case ".webm":
+ appendExt("video/*", extension);
+ break;
+ case ".pdf":
+ appendExt("application/pdf", extension);
+ break;
+ case ".csv":
+ appendExt("text/csv", extension);
+ break;
+ default:
+ appendExt("text/plain", extension);
+ }
+ });
+
+ return filesByMIMEType;
+}
+
+/* TODO(akshayka): Allow uploading files one-by-one and removing uploaded files
+ * when multiple is `True`*/
+export const FileUpload = (props: FileUploadProps): JSX.Element => {
+ const acceptGroups = groupFileTypesByMIMEType(props.filetypes);
+ const { setValue, kind, multiple, value } = props;
+ const { getRootProps, getInputProps, isFocused, isDragAccept, isDragReject } =
+ useDropzone({
+ accept: acceptGroups,
+ multiple: multiple,
+ onDrop: (acceptedFiles) => {
+ filesToBase64(acceptedFiles).then((value) => {
+ setValue(value);
+ });
+ },
+ });
+
+ if (kind === "button") {
+ // TODO(akshayka): React to a change in `value` due to an update from another
+ // instance of this element. Browsers do not allow scripts to set the `value`
+ // on a file input element.
+ // One way to do this:
+ // - hide the input element with a hidden attribute
+ // - create a button and some text that reflects what has been uploaded;
+ // link button to the hidden input element
+ const label = props.label ?? "<p>Upload</p>";
+ return (
+ <>
+ <button
+ {...getRootProps({})}
+ className={buttonVariants({
+ variant: "secondary",
+ size: "xs",
+ })}
+ >
+ <HtmlOutput html={label} inline={true} />
+ <Upload size={16} className="ml-2" />
+ </button>
+ <input {...getInputProps({})} type="file" />
+ </>
+ );
+ }
+
+ const uploadedFiles = value.map(([fileName, _]) => (
+ <li key={fileName}>{fileName}</li>
+ ));
+
+ const uploaded = uploadedFiles.length > 0;
+ const label =
+ props.label ?? "Drag and drop files here, or click to open file browser";
+ return (
+ <section>
+ <div
+ className={cn(
+ "mt-3 mb-2 h-24 w-full px-16 flex flex-col items-center justify-center ",
+ "border rounded-sm",
+ "text-sm text-muted-foreground",
+ "shadow-smSolid",
+ "hover:bg-muted/60",
+ "hover:cursor-pointer",
+ "active:shadow-xsSolid",
+ "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-accent",
+ !isFocused && "bg-muted border-input/60",
+ isFocused && "bg-muted/60 border-accent/40",
+ isDragAccept && "bg-muted/60 border-accent/40 shadow-xsSolid",
+ isDragReject && "bg-muted/60 border-destructive/60 shadow-xsSolid"
+ )}
+ {...getRootProps()}
+ >
+ <input {...getInputProps()} />
+ {uploaded ? (
+ <span>
+ To re-upload: <HtmlOutput html={label} inline={true} />
+ </span>
+ ) : (
+ <span className="mt-0">
+ <HtmlOutput html={label} inline={true} />
+ </span>
+ )}
+ </div>
+
+ <aside>
+ {uploaded ? (
+ <span className="markdown">
+ <strong>Uploaded files</strong>
+ <ul style={{ margin: 0 }}>{uploadedFiles}</ul>
+ </span>
+ ) : null}
+ </aside>
+ </section>
+ );
+};
diff --git a/frontend/src/plugins/impl/FormPlugin.tsx b/frontend/src/plugins/impl/FormPlugin.tsx
new file mode 100644
index 0000000000..b600766ac0
--- /dev/null
+++ b/frontend/src/plugins/impl/FormPlugin.tsx
@@ -0,0 +1,156 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useEffect, useState } from "react";
+import { z } from "zod";
+
+import { UI_ELEMENT_TAG_NAME } from "../../core/dom/UIElement";
+import {
+ marimoValueInputEvent,
+ MarimoValueInputEventType,
+} from "@/core/dom/events";
+import { HtmlOutput } from "../../editor/output/HtmlOutput";
+import { IPlugin, IPluginProps, Setter } from "../types";
+import { Button } from "../../components/ui/button";
+import { UI_ELEMENT_REGISTRY } from "@/core/dom/uiregistry";
+import { cn } from "../../lib/utils";
+
+type T = unknown;
+
+interface Data {
+ label: string | null;
+ elementId: string;
+}
+
+/** FormPlugin
+ *
+ * Associates a plugin with a submit button. The associated plugin's
+ * value updates are captured by this plugin; when the submit button
+ * is clicked, this plugin assumes the value of the associated plugin.
+ */
+export class FormPlugin implements IPlugin<T, Data> {
+ tagName = "marimo-form";
+
+ validator = z.object({
+ label: z.string().nullable(),
+ elementId: z.string(),
+ });
+
+ render(props: IPluginProps<T, Data>): JSX.Element {
+ return (
+ <Form {...props.data} value={props.value} setValue={props.setValue}>
+ {props.children}
+ </Form>
+ );
+ }
+}
+
+interface SubmitBoxProps<T> {
+ children: React.ReactNode;
+ currentValue: T;
+ newValue: T;
+ setValue: Setter<T>;
+ label: string | null;
+}
+
+const SubmitBox = <T,>({
+ children,
+ currentValue,
+ newValue,
+ setValue,
+ label,
+}: SubmitBoxProps<T>) => {
+ const synchronized = newValue === currentValue;
+ const variant = synchronized ? "secondary" : "action";
+
+ return (
+ <div
+ className={cn("rounded-lg border mt-2 mb-2 shadow-md", {
+ "border-calloutNeutralBorder bg-calloutNeutralBg": synchronized,
+ "border-calloutAlertBorder bg-calloutAlertBg": !synchronized,
+ })}
+ onKeyDown={(evt) => {
+ // Handle enter + ctrl/meta key
+ if (evt.key === "Enter" && (evt.ctrlKey || evt.metaKey)) {
+ evt.preventDefault();
+ evt.stopPropagation();
+ setValue(newValue);
+ }
+ }}
+ >
+ {label === null ? null : (
+ <div className="text-center mt-4">
+ <HtmlOutput html={label} inline={true} />
+ </div>
+ )}
+ <div className="pl-12 pr-12 pt-4">{children}</div>
+ <div className="text-right mt-0.5 font-code p-4">
+ <Button
+ variant={variant}
+ onClick={() => {
+ setValue(newValue);
+ }}
+ type="submit"
+ >
+ Submit
+ </Button>
+ </div>
+ </div>
+ );
+};
+
+interface SubmitProps extends Data {
+ value: T;
+ setValue: Setter<T>;
+ children?: React.ReactNode | undefined;
+}
+
+const Form = ({ elementId, value, setValue, children, label }: SubmitProps) => {
+ // The internal (buffered) value is initialized as the current value of the
+ // wrapped plugin; this buffered value is in contrast to the actual
+ // value of the plugin, which is the value of the wrapped plugin when
+ // the submit button was last clicked/activated.
+ const [internalValue, setInternalValue] = useState<T>(
+ UI_ELEMENT_REGISTRY.lookupValue(elementId)
+ );
+
+ // The Form may be rendered before the child plugin is, so after mount
+ // we lookup the plugin once again.
+ useEffect(() => {
+ setInternalValue(UI_ELEMENT_REGISTRY.lookupValue(elementId));
+ }, [elementId]);
+
+ useEffect(() => {
+ // Spy on when the plugin generates an event (MarimoValueInputEvent)
+ const handleUpdate = (e: MarimoValueInputEventType) => {
+ const target = e.detail.element;
+ if (target === null || !(target instanceof Node)) {
+ return;
+ }
+ const node = target.parentNode;
+
+ // If something other than a UI element triggered an event, ignore it
+ if (node === null || node.nodeName !== UI_ELEMENT_TAG_NAME) {
+ return;
+ }
+
+ const id = (node as Element).getAttribute("object-id") as string;
+ if (id === elementId) {
+ setInternalValue(e.detail.value);
+ }
+ };
+ document.addEventListener(marimoValueInputEvent, handleUpdate);
+ return () => {
+ document.removeEventListener(marimoValueInputEvent, handleUpdate);
+ };
+ }, [elementId, setValue]);
+
+ return (
+ <SubmitBox<T>
+ currentValue={value}
+ newValue={internalValue}
+ setValue={setValue}
+ label={label}
+ >
+ {children}
+ </SubmitBox>
+ );
+};
diff --git a/frontend/src/plugins/impl/Label.styles.ts b/frontend/src/plugins/impl/Label.styles.ts
new file mode 100644
index 0000000000..d3f2cde7e5
--- /dev/null
+++ b/frontend/src/plugins/impl/Label.styles.ts
@@ -0,0 +1,7 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+export const label = "font-medium font-prose";
+
+export const labelContainer =
+ "mo-label inline-flex pt-0 pb-0 pl-0 pr-2 items-center space-x-1.5";
+
+export const labelContainerBlock = "mo-label-block block p-0";
diff --git a/frontend/src/plugins/impl/MultiselectPlugin.tsx b/frontend/src/plugins/impl/MultiselectPlugin.tsx
new file mode 100644
index 0000000000..d7b5da1b70
--- /dev/null
+++ b/frontend/src/plugins/impl/MultiselectPlugin.tsx
@@ -0,0 +1,78 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useId } from "react";
+import { Label } from "../../components/ui/label";
+import { z } from "zod";
+
+import { IPlugin, IPluginProps, Setter } from "../types";
+import { HtmlOutput } from "../../editor/output/HtmlOutput";
+import * as labelStyles from "./Label.styles";
+import { Combobox, ComboboxItem } from "../../components/ui/combobox";
+
+interface Data {
+ label: string | null;
+ options: string[];
+}
+
+type T = string[];
+
+export class MultiselectPlugin implements IPlugin<T, Data> {
+ tagName = "marimo-multiselect";
+
+ validator = z.object({
+ initialValue: z.array(z.string()),
+ label: z.string().nullable(),
+ options: z.array(z.string()),
+ });
+
+ render(props: IPluginProps<string[], Data>): JSX.Element {
+ return (
+ <Multiselect
+ {...props.data}
+ value={props.value}
+ setValue={props.setValue}
+ />
+ );
+ }
+}
+
+/**
+ * Arguments for a multi select
+ *
+ * @param options - text labels for each select option
+ * @param label - an optional label for the select
+ * @param value - an array of options that are selected
+ * @param setValue - set multi select value
+ */
+interface MultiselectProps extends Data {
+ value: T;
+ setValue: Setter<T>;
+}
+
+const Multiselect = (props: MultiselectProps): JSX.Element => {
+ const id = useId();
+ const labelElement =
+ props.label === null ? null : (
+ <Label htmlFor={id}>
+ <HtmlOutput html={props.label} inline={true} />
+ </Label>
+ );
+
+ return (
+ <div className={labelStyles.labelContainer}>
+ {labelElement}
+ <Combobox<string>
+ displayValue={(option) => option}
+ placeholder="Select..."
+ multiple={true}
+ value={props.value}
+ onValueChange={(newValues) => props.setValue(newValues || [])}
+ >
+ {props.options.map((option) => (
+ <ComboboxItem key={option} value={option}>
+ {option}
+ </ComboboxItem>
+ ))}
+ </Combobox>
+ </div>
+ );
+};
diff --git a/frontend/src/plugins/impl/NumberPlugin.tsx b/frontend/src/plugins/impl/NumberPlugin.tsx
new file mode 100644
index 0000000000..b12067e402
--- /dev/null
+++ b/frontend/src/plugins/impl/NumberPlugin.tsx
@@ -0,0 +1,95 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useEffect, useId, useRef } from "react";
+import { Label } from "../../components/ui/label";
+import { z } from "zod";
+
+import { IPlugin, IPluginProps, Setter } from "../types";
+import { HtmlOutput } from "../../editor/output/HtmlOutput";
+import * as labelStyles from "./Label.styles";
+import { Input } from "../../components/ui/input";
+
+type T = number;
+
+interface Data {
+ start: T;
+ stop: T;
+ step?: T;
+ label: string | null;
+}
+
+export class NumberPlugin implements IPlugin<T, Data> {
+ tagName = "marimo-number";
+
+ validator = z.object({
+ initialValue: z.number(),
+ label: z.string().nullable(),
+ start: z.number(),
+ stop: z.number(),
+ step: z.number().optional(),
+ });
+
+ render(props: IPluginProps<T, Data>): JSX.Element {
+ return (
+ <NumberComponent
+ {...props.data}
+ value={props.value}
+ setValue={props.setValue}
+ />
+ );
+ }
+}
+
+interface NumberComponentProps extends Data {
+ value: T;
+ setValue: Setter<T>;
+}
+
+const NumberComponent = (props: NumberComponentProps): JSX.Element => {
+ const inputRef = useRef<HTMLInputElement>(null);
+ const oninput = () => {
+ if (inputRef.current !== null) {
+ props.setValue(inputRef.current.valueAsNumber);
+ }
+ };
+
+ useEffect(() => {
+ // scrolling inside the input causes the value to change, which
+ // is very surprising, so we disable it.
+ if (inputRef.current !== null) {
+ inputRef.current.addEventListener(
+ "wheel",
+ (e) => {
+ if (e.target === inputRef.current) {
+ e.preventDefault();
+ }
+ },
+ { passive: false }
+ );
+ }
+ }, [inputRef]);
+
+ const id = useId();
+ const labelElement =
+ props.label === null ? null : (
+ <Label htmlFor={id}>
+ <HtmlOutput html={props.label} inline={true} />
+ </Label>
+ );
+
+ return (
+ <div className={labelStyles.labelContainer}>
+ {labelElement}
+ <Input
+ className="min-w-[3em]"
+ ref={inputRef}
+ type="number"
+ min={props.start}
+ max={props.stop}
+ step={props.step}
+ value={props.value}
+ onInput={oninput}
+ id={id}
+ />
+ </div>
+ );
+};
diff --git a/frontend/src/plugins/impl/RadioPlugin.tsx b/frontend/src/plugins/impl/RadioPlugin.tsx
new file mode 100644
index 0000000000..187da42894
--- /dev/null
+++ b/frontend/src/plugins/impl/RadioPlugin.tsx
@@ -0,0 +1,82 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import clsx from "clsx";
+import { useId } from "react";
+import { z } from "zod";
+
+import { Label } from "@/components/ui/label";
+import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
+import { HtmlOutput } from "@/editor/output/HtmlOutput";
+import { IPlugin, IPluginProps } from "@/plugins/types";
+
+/**
+ * Arguments for a radio group
+ *
+ * @param label - a label for the group
+ * @param options - text labels for each radio option
+ */
+interface Data {
+ label: string | null;
+ options: string[];
+}
+
+// The value is null when `initialValue` is null
+type S = string | null;
+
+export class RadioPlugin implements IPlugin<S, Data> {
+ tagName = "marimo-radio";
+
+ validator = z.object({
+ initialValue: z.string().nullable(),
+ label: z.string().nullable(),
+ options: z.array(z.string()),
+ });
+
+ render(props: IPluginProps<S, Data>): JSX.Element {
+ return (
+ <Radio {...props.data} value={props.value} setValue={props.setValue} />
+ );
+ }
+}
+
+interface RadioProps extends Data {
+ value: S;
+ setValue: (value: S) => void;
+}
+
+const Radio = (props: RadioProps): JSX.Element => {
+ const id = useId();
+ const labelElement =
+ props.label === null ? null : (
+ <div className="pb-3">
+ <Label htmlFor={id} className="pb-3">
+ <HtmlOutput html={props.label} inline={true} />
+ </Label>
+ </div>
+ );
+
+ return (
+ <div>
+ {labelElement}
+ <RadioGroup
+ value={props.value ?? ""}
+ onValueChange={props.setValue}
+ aria-label="Radio Group"
+ >
+ {props.options.map((option, i) => (
+ <div className="flex items-center space-x-3" key={i}>
+ <RadioGroupItem value={option} id={`${id}-${i.toString()}`} />
+ <Label
+ htmlFor={`${id}-${i.toString()}`}
+ className={clsx(
+ "text-md",
+ option === props.value ? "font-semibold" : ""
+ )}
+ >
+ {option}
+ </Label>
+ </div>
+ ))}
+ </RadioGroup>
+ </div>
+ );
+};
diff --git a/frontend/src/plugins/impl/SliderPlugin.tsx b/frontend/src/plugins/impl/SliderPlugin.tsx
new file mode 100644
index 0000000000..e2cad0ee5f
--- /dev/null
+++ b/frontend/src/plugins/impl/SliderPlugin.tsx
@@ -0,0 +1,78 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useCallback, useId } from "react";
+import { Label } from "../../components/ui/label";
+import { z } from "zod";
+
+import { HtmlOutput } from "../../editor/output/HtmlOutput";
+import { IPlugin, IPluginProps, Setter } from "../types";
+import * as labelStyles from "./Label.styles";
+import { Slider } from "../../components/ui/slider";
+import clsx from "clsx";
+
+type T = number;
+
+interface Data {
+ start: T;
+ stop: T;
+ step?: T;
+ label: string | null;
+}
+
+export class SliderPlugin implements IPlugin<T, Data> {
+ tagName = "marimo-slider";
+
+ validator = z.object({
+ initialValue: z.number(),
+ label: z.string().nullable(),
+ start: z.number(),
+ stop: z.number(),
+ step: z.number().optional(),
+ });
+
+ render(props: IPluginProps<T, Data>): JSX.Element {
+ return (
+ <SliderComponent
+ {...props.data}
+ value={props.value}
+ setValue={props.setValue}
+ />
+ );
+ }
+}
+
+interface SliderProps extends Data {
+ value: T;
+ setValue: Setter<T>;
+}
+
+const SliderComponent = (props: SliderProps): JSX.Element => {
+ const setValue = props.setValue;
+ const onValueChange = useCallback(
+ (values: number[]) => {
+ setValue(values[0]);
+ },
+ [setValue]
+ );
+ const id = useId();
+ const labelElement =
+ props.label === null ? null : (
+ <Label htmlFor={id}>
+ <HtmlOutput html={props.label} inline={true} />
+ </Label>
+ );
+
+ return (
+ <div className={clsx(labelStyles.labelContainer, "mb-2")}>
+ {labelElement}
+ <Slider
+ className={"relative flex items-center select-none w-36"}
+ value={[props.value]}
+ min={props.start}
+ max={props.stop}
+ step={props.step}
+ onValueChange={onValueChange}
+ id={id}
+ />
+ </div>
+ );
+};
diff --git a/frontend/src/plugins/impl/SwitchPlugin.tsx b/frontend/src/plugins/impl/SwitchPlugin.tsx
new file mode 100644
index 0000000000..7c272941b0
--- /dev/null
+++ b/frontend/src/plugins/impl/SwitchPlugin.tsx
@@ -0,0 +1,58 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useId } from "react";
+import { z } from "zod";
+
+import { Switch } from "@/components/ui/switch";
+import { Label } from "@/components/ui/label";
+import { IPlugin, IPluginProps } from "@/plugins/types";
+import * as labelStyles from "@/plugins/impl/Label.styles";
+import { cn } from "@/lib/utils";
+import { RenderHTML } from "../core/RenderHTML";
+
+export class SwitchPlugin
+ implements IPlugin<boolean, { label: string | null }>
+{
+ tagName = "marimo-switch";
+
+ validator = z.object({
+ initialValue: z.boolean(),
+ label: z.string().nullable(),
+ });
+
+ render(props: IPluginProps<boolean, { label: string | null }>): JSX.Element {
+ return <SwitchComponent {...props} />;
+ }
+}
+
+const SwitchComponent = ({
+ value,
+ setValue,
+ data,
+}: IPluginProps<boolean, { label: string | null }>): JSX.Element => {
+ const id = useId();
+ const labelElement =
+ data.label === null ? null : (
+ <Label htmlFor={id} className="text-md">
+ <RenderHTML html={data.label} />
+ </Label>
+ );
+
+ return (
+ <div
+ className={cn(
+ labelStyles.labelContainer,
+ "align-middle",
+ "items-start",
+ "gap-x-2"
+ )}
+ >
+ <Switch
+ checked={value}
+ onCheckedChange={setValue}
+ id={id}
+ className="data-[state=unchecked]:hover:bg-input/80"
+ />
+ {labelElement}
+ </div>
+ );
+};
diff --git a/frontend/src/plugins/impl/TextAreaPlugin.tsx b/frontend/src/plugins/impl/TextAreaPlugin.tsx
new file mode 100644
index 0000000000..7ec7862a53
--- /dev/null
+++ b/frontend/src/plugins/impl/TextAreaPlugin.tsx
@@ -0,0 +1,68 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { Label } from "../../components/ui/label";
+import { z } from "zod";
+import { IPlugin, IPluginProps, Setter } from "../types";
+
+import { HtmlOutput } from "../../editor/output/HtmlOutput";
+import * as labelStyles from "./Label.styles";
+import { Textarea } from "../../components/ui/textarea";
+
+type T = string;
+
+interface Data {
+ placeholder: string;
+ label: string | null;
+}
+
+export class TextAreaPlugin implements IPlugin<T, Data> {
+ tagName = "marimo-text-area";
+
+ validator = z.object({
+ initialValue: z.string(),
+ placeholder: z.string(),
+ label: z.string().nullable(),
+ });
+
+ render(props: IPluginProps<T, Data>): JSX.Element {
+ return (
+ <TextAreaComponent
+ {...props.data}
+ value={props.value}
+ setValue={props.setValue}
+ />
+ );
+ }
+}
+
+interface TextAreaComponentProps extends Data {
+ value: T;
+ setValue: Setter<T>;
+}
+
+const TextAreaComponent = (props: TextAreaComponentProps) => {
+ const labelElement =
+ props.label === null ? null : (
+ <Label className="text-md">
+ <HtmlOutput html={props.label} />
+ </Label>
+ );
+
+ return (
+ <div className={labelStyles.labelContainerBlock}>
+ {labelElement}
+ <Textarea
+ className="mt-3"
+ style={{
+ fontFamily: "var(--monospace-font)",
+ }}
+ rows={5}
+ cols={33}
+ value={props.value}
+ onInput={(event) =>
+ props.setValue((event.target as HTMLInputElement).value)
+ }
+ placeholder={props.placeholder}
+ />
+ </div>
+ );
+};
diff --git a/frontend/src/plugins/impl/TextInputPlugin.tsx b/frontend/src/plugins/impl/TextInputPlugin.tsx
new file mode 100644
index 0000000000..dc7145e4a6
--- /dev/null
+++ b/frontend/src/plugins/impl/TextInputPlugin.tsx
@@ -0,0 +1,102 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { Label } from "../../components/ui/label";
+import { z } from "zod";
+import { IPlugin, IPluginProps, Setter } from "../types";
+
+import { HtmlOutput } from "../../editor/output/HtmlOutput";
+import * as labelStyles from "./Label.styles";
+import { Input } from "../../components/ui/input";
+import { cn } from "../../lib/utils";
+import { AtSignIcon, GlobeIcon, LockIcon } from "lucide-react";
+import { useState } from "react";
+
+type T = string;
+
+type InputType = "text" | "password" | "email" | "url";
+
+interface Data {
+ placeholder: string;
+ label: string | null;
+ kind: InputType;
+}
+
+export class TextInputPlugin implements IPlugin<T, Data> {
+ tagName = "marimo-text";
+
+ validator = z.object({
+ initialValue: z.string(),
+ placeholder: z.string(),
+ label: z.string().nullable(),
+ kind: z.enum(["text", "password", "email", "url"]).default("text"),
+ });
+
+ render(props: IPluginProps<T, Data>): JSX.Element {
+ return (
+ <TextComponent
+ {...props.data}
+ value={props.value}
+ setValue={props.setValue}
+ />
+ );
+ }
+}
+
+interface TextComponentProps extends Data {
+ value: T;
+ setValue: Setter<T>;
+}
+
+const TextComponent = (props: TextComponentProps) => {
+ const [valueOnBlur, setValueOnBlur] = useState(props.value);
+
+ const labelElement =
+ props.label === null ? null : (
+ <Label className={labelStyles.label}>
+ <HtmlOutput html={props.label} inline={true} />
+ </Label>
+ );
+
+ const valueToValidate = valueOnBlur == null ? props.value : valueOnBlur;
+ const isValid = validate(props.kind, valueToValidate);
+
+ const icon: Record<InputType, JSX.Element | null> = {
+ text: null,
+ password: <LockIcon size={16} />,
+ email: <AtSignIcon size={16} />,
+ url: <GlobeIcon size={16} />,
+ };
+
+ return (
+ <div className={labelStyles.labelContainer}>
+ {labelElement}
+ <Input
+ type={props.kind}
+ icon={icon[props.kind]}
+ placeholder={props.placeholder}
+ className={cn({
+ "border-destructive": !isValid,
+ })}
+ value={props.value}
+ onInput={(event) => props.setValue(event.currentTarget.value)}
+ onBlur={(event) => setValueOnBlur(event.currentTarget.value)}
+ />
+ </div>
+ );
+};
+
+function validate(kind: InputType, value: string): boolean {
+ // We don't validate required-ness to empty is valid
+ if (!value) {
+ return true;
+ }
+
+ // We only validate email and url types
+ switch (kind) {
+ case "email":
+ return z.string().email().safeParse(value).success;
+ case "url":
+ return z.string().url().safeParse(value).success;
+ default:
+ return true;
+ }
+}
diff --git a/frontend/src/plugins/layout/AccordionPlugin.tsx b/frontend/src/plugins/layout/AccordionPlugin.tsx
new file mode 100644
index 0000000000..12860f0dc6
--- /dev/null
+++ b/frontend/src/plugins/layout/AccordionPlugin.tsx
@@ -0,0 +1,65 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import React, { PropsWithChildren } from "react";
+
+import {
+ Accordion,
+ AccordionContent,
+ AccordionItem,
+ AccordionTrigger,
+} from "@/components/ui/accordion";
+import { z } from "zod";
+import { IStatelessPlugin, IStatelessPluginProps } from "../stateless-plugin";
+import { RenderHTML } from "../core/RenderHTML";
+
+interface Data {
+ /**
+ * The labels for each item; raw HTML.
+ */
+ labels: string[];
+
+ /**
+ * Whether to allow multiple tabs to be open.
+ */
+ multiple: boolean;
+}
+
+export class AccordionPlugin implements IStatelessPlugin<Data> {
+ tagName = "marimo-accordion";
+
+ validator = z.object({
+ labels: z.array(z.string()),
+ multiple: z.boolean(),
+ });
+
+ render(props: IStatelessPluginProps<Data>): JSX.Element {
+ return (
+ <AccordionComponent {...props.data}>{props.children}</AccordionComponent>
+ );
+ }
+}
+
+const AccordionComponent = ({
+ labels,
+ multiple,
+ children,
+}: PropsWithChildren<Data>): JSX.Element => {
+ const type = multiple ? "multiple" : "single";
+ return (
+ <Accordion type={type} className="text-muted-foreground" collapsible={true}>
+ {React.Children.map(children, (child, index) => {
+ return (
+ <AccordionItem
+ key={index}
+ value={index.toString()}
+ className="border-muted-foreground-20"
+ >
+ <AccordionTrigger className="py-2 text-md">
+ <RenderHTML html={labels[index]} />
+ </AccordionTrigger>
+ <AccordionContent className="text-md">{child}</AccordionContent>
+ </AccordionItem>
+ );
+ })}
+ </Accordion>
+ );
+};
diff --git a/frontend/src/plugins/layout/CalloutPlugin.tsx b/frontend/src/plugins/layout/CalloutPlugin.tsx
new file mode 100644
index 0000000000..ff5ab1e127
--- /dev/null
+++ b/frontend/src/plugins/layout/CalloutPlugin.tsx
@@ -0,0 +1,29 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+
+import { z } from "zod";
+import { IStatelessPlugin, IStatelessPluginProps } from "../stateless-plugin";
+import { CalloutOutput } from "../../editor/output/CalloutOutput";
+
+interface Data {
+ /**
+ * The html to render
+ */
+ html: string;
+ /**
+ * The kind of callout
+ */
+ kind: "neutral" | "alert" | "warn" | "success";
+}
+
+export class CalloutPlugin implements IStatelessPlugin<Data> {
+ tagName = "marimo-callout-output";
+
+ validator = z.object({
+ html: z.string(),
+ kind: z.enum(["neutral", "alert", "warn", "success"]),
+ });
+
+ render({ data }: IStatelessPluginProps<Data>): JSX.Element {
+ return <CalloutOutput html={data.html} kind={data.kind} />;
+ }
+}
diff --git a/frontend/src/plugins/layout/JsonOutputPlugin.tsx b/frontend/src/plugins/layout/JsonOutputPlugin.tsx
new file mode 100644
index 0000000000..ede1fda739
--- /dev/null
+++ b/frontend/src/plugins/layout/JsonOutputPlugin.tsx
@@ -0,0 +1,33 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+
+import { z } from "zod";
+import { JsonOutput } from "../../editor/output/JsonOutput";
+import { IStatelessPlugin, IStatelessPluginProps } from "../stateless-plugin";
+import { EmotionCacheProvider } from "../../editor/output/EmotionCacheProvider";
+
+interface Data {
+ name?: string | null;
+ /**
+ * The JSON data to display
+ */
+ jsonData?: unknown;
+}
+
+export class JsonOutputPlugin implements IStatelessPlugin<Data> {
+ tagName = "marimo-json-output";
+
+ validator = z.object({
+ name: z.string().nullish(),
+ jsonData: z.unknown(),
+ });
+
+ render({ data, host }: IStatelessPluginProps<Data>): JSX.Element {
+ // `false` defaults to no text label
+ const name = data.name === undefined ? false : data.name || "";
+ return (
+ <EmotionCacheProvider container={host.shadowRoot}>
+ <JsonOutput data={data.jsonData} format="auto" name={name} />
+ </EmotionCacheProvider>
+ );
+ }
+}
diff --git a/frontend/src/plugins/layout/TabsPlugin.tsx b/frontend/src/plugins/layout/TabsPlugin.tsx
new file mode 100644
index 0000000000..c639f3a3eb
--- /dev/null
+++ b/frontend/src/plugins/layout/TabsPlugin.tsx
@@ -0,0 +1,51 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import React, { PropsWithChildren } from "react";
+
+import {
+ Tabs,
+ TabsList,
+ TabsTrigger,
+ TabsContent,
+} from "../../components/ui/tabs";
+import { z } from "zod";
+import { IStatelessPlugin, IStatelessPluginProps } from "../stateless-plugin";
+import { RenderHTML } from "../core/RenderHTML";
+
+interface Data {
+ /**
+ * The labels for each tab; raw HTML.
+ */
+ tabs: string[];
+}
+
+export class TabsPlugin implements IStatelessPlugin<Data> {
+ tagName = "marimo-tabs";
+
+ validator = z.object({
+ tabs: z.array(z.string()),
+ });
+
+ render(props: IStatelessPluginProps<Data>): JSX.Element {
+ return <TabComponent {...props.data}>{props.children}</TabComponent>;
+ }
+}
+
+const TabComponent = ({
+ tabs,
+ children,
+}: PropsWithChildren<Data>): JSX.Element => {
+ return (
+ <Tabs defaultValue="0">
+ <TabsList>
+ {tabs.map((tab, index) => (
+ <TabsTrigger key={index} value={index.toString()}>
+ <RenderHTML html={tab} />
+ </TabsTrigger>
+ ))}
+ </TabsList>
+ {React.Children.map(children, (child, index) => {
+ return <TabsContent value={index.toString()}>{child}</TabsContent>;
+ })}
+ </Tabs>
+ );
+};
diff --git a/frontend/src/plugins/layout/TexPlugin.tsx b/frontend/src/plugins/layout/TexPlugin.tsx
new file mode 100644
index 0000000000..81d603a7cc
--- /dev/null
+++ b/frontend/src/plugins/layout/TexPlugin.tsx
@@ -0,0 +1,86 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import React, { PropsWithChildren, useLayoutEffect, useRef } from "react";
+import katex from "katex";
+
+import { z } from "zod";
+import { IStatelessPlugin, IStatelessPluginProps } from "../stateless-plugin";
+
+/**
+ * TexPlugin
+ *
+ * A plugin that renders LaTeX, specialized for how our kernel processes
+ * LaTeX.
+ */
+export class TexPlugin implements IStatelessPlugin<{}> {
+ tagName = "marimo-tex";
+
+ validator = z.object({});
+
+ render(props: IStatelessPluginProps<{}>): JSX.Element {
+ return <TexComponent>{props.children}</TexComponent>;
+ }
+}
+
+function renderLatex(element: HTMLElement) {
+ const tex = element.textContent || element.innerText;
+ if (tex.startsWith("||(||(") && tex.endsWith("||)||)")) {
+ // when $$...$$ is used without newlines before/after the $$.
+ katex.render(tex.slice(6, -6), element, {
+ displayMode: true,
+ throwOnError: false,
+ });
+ } else if (tex.startsWith("||(") && tex.endsWith("||)")) {
+ katex.render(tex.slice(3, -3), element, {
+ displayMode: false,
+ throwOnError: false,
+ });
+ } else if (tex.startsWith("||[") && tex.endsWith("||]")) {
+ katex.render(tex.slice(3, -3), element, {
+ displayMode: true,
+ throwOnError: false,
+ });
+ }
+}
+
+const TexComponent = ({ children }: PropsWithChildren<{}>): JSX.Element => {
+ const ref = useRef<HTMLSpanElement>(null);
+
+ // The arithmatex markdown extension we use in Python produces nested
+ // marimo-tex tags when $$...$$ math is used in a paragraph, with dummy
+ // children that mess with rendering.
+ //
+ // eg., mo.md("hello $$x$$") produces
+ //
+ // <marimo-tex class="arithmatex">||(<marimo-tex class="arithmatex">||(x||)</marimo-tex>||)</marimo-tex>
+ //
+ // while mo.md("$$x$$") produces the expected
+ //
+ // <marimo-tex class="arithmatex">||[x||]</marimo-tex>
+ //
+ // The nesting looks like a bug, or at least it makes rendering the latex
+ // more annoying. So we just get rid of the nesting here, since there
+ // isn't a simple way to do that in Python without bringing in a new
+ // dependency.
+ //
+ // The number of children is always 1 (the LaTeX) or 3 redundant ||(, ||)
+ // delimiters as the first and third child, another marimo-tex tag as the
+ // second. Only try to render latex in the former case.
+
+ // Re-render when the text content changes.
+ useLayoutEffect(() => {
+ if (ref.current?.firstElementChild) {
+ renderLatex(ref.current.firstElementChild as HTMLElement);
+ }
+ }, [ref.current?.textContent]);
+
+ // When we > 1 children, we're in display math mode, so style accordingly.
+ const childrenToRender =
+ React.Children.count(children) > 1 ? (
+ <div className="block my-4 text-center">
+ {React.Children.toArray(children)[1]}
+ </div>
+ ) : (
+ children
+ );
+ return <span ref={ref}>{childrenToRender}</span>;
+};
diff --git a/frontend/src/plugins/plugins.ts b/frontend/src/plugins/plugins.ts
new file mode 100644
index 0000000000..7e9abbc9d2
--- /dev/null
+++ b/frontend/src/plugins/plugins.ts
@@ -0,0 +1,63 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+/* eslint-disable @typescript-eslint/no-explicit-any */
+import { initializeUIElement } from "../core/dom/UIElement";
+import { registerReactComponent } from "./core/componentFactory";
+import { ButtonPlugin } from "./impl/ButtonPlugin";
+import { CheckboxPlugin } from "./impl/CheckboxPlugin";
+import { DatePickerPlugin } from "./impl/DatePickerPlugin";
+import { DictPlugin } from "./impl/DictPlugin";
+import { DropdownPlugin } from "./impl/DropdownPlugin";
+import { FileUploadPlugin } from "./impl/FileUploadPlugin";
+import { FormPlugin } from "./impl/FormPlugin";
+import { MultiselectPlugin } from "./impl/MultiselectPlugin";
+import { NumberPlugin } from "./impl/NumberPlugin";
+import { RadioPlugin } from "./impl/RadioPlugin";
+import { SliderPlugin } from "./impl/SliderPlugin";
+import { SwitchPlugin } from "./impl/SwitchPlugin";
+import { TextInputPlugin } from "./impl/TextInputPlugin";
+import { TextAreaPlugin } from "./impl/TextAreaPlugin";
+import { IPlugin } from "./types";
+import { DataTablePlugin } from "./impl/DataTablePlugin";
+import { IStatelessPlugin } from "./stateless-plugin";
+import { AccordionPlugin } from "./layout/AccordionPlugin";
+import { CalloutPlugin } from "./layout/CalloutPlugin";
+import { JsonOutputPlugin } from "./layout/JsonOutputPlugin";
+import { TabsPlugin } from "./layout/TabsPlugin";
+import { TexPlugin } from "./layout/TexPlugin";
+
+// List of UI plugins
+const UI_PLUGINS: Array<IPlugin<any, unknown>> = [
+ new ButtonPlugin(),
+ new CheckboxPlugin(),
+ new DatePickerPlugin(),
+ new DictPlugin(),
+ new DropdownPlugin(),
+ new FileUploadPlugin(),
+ new FormPlugin(),
+ new MultiselectPlugin(),
+ new NumberPlugin(),
+ new RadioPlugin(),
+ new DataTablePlugin(),
+ new SliderPlugin(),
+ new SwitchPlugin(),
+ new TextInputPlugin(),
+ new TextAreaPlugin(),
+];
+
+// List of output / layout plugins
+const LAYOUT_PLUGINS: Array<IStatelessPlugin<unknown>> = [
+ new AccordionPlugin(),
+ new CalloutPlugin(),
+ new JsonOutputPlugin(),
+ new TabsPlugin(),
+ new TexPlugin(),
+];
+
+export function initializePlugins() {
+ // Initialize UIElement
+ initializeUIElement();
+
+ // Initialize all the plugins.
+ UI_PLUGINS.forEach(registerReactComponent);
+ LAYOUT_PLUGINS.forEach(registerReactComponent);
+}
diff --git a/frontend/src/plugins/stateless-plugin.ts b/frontend/src/plugins/stateless-plugin.ts
new file mode 100644
index 0000000000..e8c121a0a9
--- /dev/null
+++ b/frontend/src/plugins/stateless-plugin.ts
@@ -0,0 +1,26 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { IPlugin } from "./types";
+
+export interface IStatelessPluginProps<D> {
+ /**
+ * Host element.
+ */
+ host: HTMLElement;
+
+ /**
+ * Plugin data.
+ */
+ data: D;
+
+ /**
+ * Children elements.
+ */
+ children?: React.ReactNode | undefined;
+}
+
+export interface IStatelessPlugin<D> extends Omit<IPlugin<never, D>, "render"> {
+ /**
+ * Render the plugin.
+ */
+ render(props: IStatelessPluginProps<D>): JSX.Element;
+}
diff --git a/frontend/src/plugins/types.ts b/frontend/src/plugins/types.ts
new file mode 100644
index 0000000000..ee64225cbb
--- /dev/null
+++ b/frontend/src/plugins/types.ts
@@ -0,0 +1,69 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { ZodType, ZodTypeDef } from "zod";
+
+/**
+ * State setter. Either a value or a function that takes the previous value and
+ * returns the new value.
+ */
+export type Setter<S> = (value: S | ((prev: S) => S)) => void;
+
+/**
+ * Props for a plugin.
+ *
+ * TODO(akshayka): (Maybe) add children elements for composition
+ */
+export interface IPluginProps<S, D> {
+ /**
+ * Host element.
+ */
+ host: HTMLElement;
+ /**
+ * The state of the plugin.
+ */
+ value: S;
+ /**
+ * Set the state of the plugin.
+ */
+ setValue: Setter<S>;
+ /**
+ * Plugin data.
+ */
+ data: D;
+
+ /**
+ * Children elements.
+ */
+ children?: React.ReactNode | undefined;
+}
+
+/**
+ * Map of plugin data to stringified value.
+ */
+export type StringifiedPluginData<D> = {
+ [K in keyof D]: string;
+};
+
+/**
+ * A plugin.
+ * @template S - the type of the state
+ * @template P - the type of the props
+ */
+export interface IPlugin<S, D = Record<string, never>> {
+ /**
+ * The html tag name to render the plugin.
+ */
+ tagName: string;
+
+ /**
+ * Validate the plugin data. Use [zod](https://zod.dev/) to validate the data.
+ *
+ * The data is input as a map of strings, but you can use
+ * `zod.string().transform` to convert the string to the correct type.
+ */
+ validator: ZodType<D, ZodTypeDef, unknown>;
+
+ /**
+ * Render the plugin.
+ */
+ render(props: IPluginProps<S, D>): JSX.Element;
+}
diff --git a/frontend/src/stories/FileUpload.stories.mdx b/frontend/src/stories/FileUpload.stories.mdx
new file mode 100644
index 0000000000..015357765d
--- /dev/null
+++ b/frontend/src/stories/FileUpload.stories.mdx
@@ -0,0 +1,46 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import { FileUpload } from "@/plugins/impl/FileUploadPlugin";
+
+<Meta title="File Upload" component={FileUpload} />
+
+# File Upload Area
+
+## Accept all files
+
+<Story name="Accept any">
+ <FileUpload
+ filetypes={[]}
+ multiple={true}
+ kind="area"
+ label={null}
+ value={[]}
+ setValue={() => null}
+ />
+</Story>
+
+## Accept txt files only
+
+<Story name="Accept .txt only">
+ <FileUpload
+ filetypes={[".txt"]}
+ multiple={true}
+ kind="area"
+ label={null}
+ value={[]}
+ setValue={() => null}
+ />
+</Story>
+
+## Button, ".txt"
+
+<Story name="Accept .txt only, button">
+ <FileUpload
+ filetypes={[".txt"]}
+ multiple={true}
+ kind="button"
+ label={null}
+ value={[]}
+ setValue={() => null}
+ />
+</Story>
diff --git a/frontend/src/stories/accordion.stories.mdx b/frontend/src/stories/accordion.stories.mdx
new file mode 100644
index 0000000000..6a32bc975d
--- /dev/null
+++ b/frontend/src/stories/accordion.stories.mdx
@@ -0,0 +1,92 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import {
+ Accordion,
+ AccordionContent,
+ AccordionItem,
+ AccordionTrigger,
+} from "@/components/ui/accordion";
+
+<Meta title="Accordion" component={Accordion} />
+
+# Accordion
+
+## Tip!
+
+<Story name="Inline">
+ <Accordion type="single" collapsible className="w-fit">
+ <AccordionItem value="item-1" className="border-none">
+ <AccordionTrigger className="data-[state=open]:underline items-center justify-start space-x-1 py-2">
+ Tip
+ </AccordionTrigger>
+ <AccordionContent>
+ Variables prefixed with an underscore are local to a cell.
+ </AccordionContent>
+ </AccordionItem>
+ </Accordion>
+</Story>
+
+## Single item
+
+<Story name="Single item.">
+ <Accordion type="single" collapsible className="w-full">
+ <AccordionItem value="item-1">
+ <AccordionTrigger>Is it accessible?</AccordionTrigger>
+ <AccordionContent>
+ Yes. It adheres to the WAI-ARIA design pattern.
+ </AccordionContent>
+ </AccordionItem>
+ </Accordion>
+</Story>
+
+## Multiple items, single
+
+<Story name="Multiple items, single.">
+ <Accordion type="single" collapsible className="w-full">
+ <AccordionItem value="item-1">
+ <AccordionTrigger>Is it accessible?</AccordionTrigger>
+ <AccordionContent>
+ Yes. It adheres to the WAI-ARIA design pattern.
+ </AccordionContent>
+ </AccordionItem>
+ <AccordionItem value="item-2">
+ <AccordionTrigger>Is it styled?</AccordionTrigger>
+ <AccordionContent>
+ Yes. It comes with default styles that matches the other components'
+ aesthetic.
+ </AccordionContent>
+ </AccordionItem>
+ <AccordionItem value="item-3">
+ <AccordionTrigger>Is it animated?</AccordionTrigger>
+ <AccordionContent>
+ Yes. It's animated by default, but you can disable it if you prefer.
+ </AccordionContent>
+ </AccordionItem>
+ </Accordion>
+</Story>
+
+## Multiple items, multiple
+
+<Story name="Multiple items, multiple.">
+ <Accordion type="multiple" collapsible className="w-full">
+ <AccordionItem value="item-1">
+ <AccordionTrigger>Is it accessible?</AccordionTrigger>
+ <AccordionContent>
+ Yes. It adheres to the WAI-ARIA design pattern.
+ </AccordionContent>
+ </AccordionItem>
+ <AccordionItem value="item-2">
+ <AccordionTrigger>Is it styled?</AccordionTrigger>
+ <AccordionContent>
+ Yes. It comes with default styles that matches the other components'
+ aesthetic.
+ </AccordionContent>
+ </AccordionItem>
+ <AccordionItem value="item-3">
+ <AccordionTrigger>Is it animated?</AccordionTrigger>
+ <AccordionContent>
+ Yes. It's animated by default, but you can disable it if you prefer.
+ </AccordionContent>
+ </AccordionItem>
+ </Accordion>
+</Story>
diff --git a/frontend/src/stories/alert-dialog.stories.mdx b/frontend/src/stories/alert-dialog.stories.mdx
new file mode 100644
index 0000000000..b53fd94d2b
--- /dev/null
+++ b/frontend/src/stories/alert-dialog.stories.mdx
@@ -0,0 +1,38 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import {
+ AlertDialog,
+ AlertDialogAction,
+ AlertDialogCancel,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogTitle,
+ AlertDialogTrigger,
+} from "@/components/ui/alert-dialog";
+
+import { Button } from "@/components/ui/button";
+
+<Meta title="Alert Dialog" component={AlertDialog} />
+
+# Alert Dialog
+
+<AlertDialog>
+ <AlertDialogTrigger asChild>
+ <Button variant="outline">Open</Button>
+ </AlertDialogTrigger>
+ <AlertDialogContent>
+ <AlertDialogHeader>
+ <AlertDialogTitle>Are you sure absolutely sure?</AlertDialogTitle>
+ <AlertDialogDescription>
+ This action cannot be undone. This will permanently delete your notebook
+ and all of its contents.
+ </AlertDialogDescription>
+ </AlertDialogHeader>
+ <AlertDialogFooter>
+ <AlertDialogCancel>Cancel</AlertDialogCancel>
+ <AlertDialogAction>Continue</AlertDialogAction>
+ </AlertDialogFooter>
+ </AlertDialogContent>
+</AlertDialog>
diff --git a/frontend/src/stories/button.stories.mdx b/frontend/src/stories/button.stories.mdx
new file mode 100644
index 0000000000..45a9209a31
--- /dev/null
+++ b/frontend/src/stories/button.stories.mdx
@@ -0,0 +1,60 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import { Button } from "@/components/ui/button";
+import { Mail, Trash2Icon, Loader2 } from "lucide-react";
+
+<Meta title="Button" component={Button} />
+
+# Button
+
+<Story name="Default">
+ <Button>Button</Button>
+</Story>
+
+<Story name="Outline">
+ <Button variant="outline">Button</Button>
+</Story>
+
+<Story name="Destructive">
+ <Button variant="destructive">Button</Button>
+</Story>
+
+<Story name="Action">
+ <Button variant="action">Button</Button>
+</Story>
+
+<Story name="Secondary">
+ <Button variant="secondary">Button</Button>
+</Story>
+
+<Story name="Ghost">
+ <Button variant="ghost">Ghost</Button>
+</Story>
+
+<Story name="Link">
+ <Button variant="link">Link</Button>
+</Story>
+
+<Story name="With Icon">
+ <Button>
+ <Mail className="mr-2" />
+ Button with icon
+ </Button>
+</Story>
+
+<Story name="Loading">
+ <Button disabled>
+ <Loader2 className="mr-2 animate-spin" />
+ Please wait
+ </Button>
+</Story>
+
+<Story name="Trash Icon">
+ <Button
+ variant="ghost"
+ size="icon"
+ className="hover:bg-transparent hover:border-input"
+ >
+ <Trash2Icon size={14} className="text-destructive" />
+ </Button>
+</Story>
diff --git a/frontend/src/stories/callout.stories.mdx b/frontend/src/stories/callout.stories.mdx
new file mode 100644
index 0000000000..000006aad3
--- /dev/null
+++ b/frontend/src/stories/callout.stories.mdx
@@ -0,0 +1,40 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import { CalloutOutput } from "@/editor/output/CalloutOutput";
+import { Mail, Loader2 } from "lucide-react";
+
+<Meta title="CalloutOutput" component={CalloutOutput} />
+
+# CalloutOutput
+
+<Story name="Default">
+ <CalloutOutput html="<p>CalloutOutput with <strong>HTML</strong></p>" />
+</Story>
+
+<Story name="neutral">
+ <CalloutOutput
+ html="<p>CalloutOutput with <strong>HTML</strong></p>"
+ kind="neutral"
+ />
+</Story>
+
+<Story name="alert">
+ <CalloutOutput
+ html="<p>CalloutOutput with <strong>HTML</strong></p>"
+ kind="alert"
+ />
+</Story>
+
+<Story name="warn">
+ <CalloutOutput
+ html="<p>CalloutOutput with <strong>HTML</strong></p>"
+ kind="warn"
+ />
+</Story>
+
+<Story name="success">
+ <CalloutOutput
+ html="<p>CalloutOutput with <strong>HTML</strong></p>"
+ kind="success"
+ />
+</Story>
diff --git a/frontend/src/stories/cell.stories.tsx b/frontend/src/stories/cell.stories.tsx
new file mode 100644
index 0000000000..5055acd4cc
--- /dev/null
+++ b/frontend/src/stories/cell.stories.tsx
@@ -0,0 +1,98 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import type { Meta, StoryObj } from "@storybook/react";
+import { Cell, CellProps } from "../editor/Cell";
+import { TooltipProvider } from "../components/ui/tooltip";
+import { CellId } from "../core/model/ids";
+
+const meta: Meta<typeof Cell> = {
+ component: Cell,
+ args: {},
+};
+
+export default meta;
+type Story = StoryObj<typeof Cell>;
+
+const props: CellProps = {
+ theme: "light",
+ showPlaceholder: false,
+ cellId: "1" as CellId,
+ initialContents: "import marimo as mo",
+ output: null,
+ consoleOutputs: [],
+ status: "idle",
+ edited: false,
+ interrupted: false,
+ errored: false,
+ updateCellCode: console.log,
+ prepareCellForRun: console.log,
+ registerRunStart: console.log,
+ runElapsedTimeMs: 10,
+ serializedEditorState: null,
+ editing: true,
+ appClosed: false,
+ showDeleteButton: true,
+ allowFocus: false,
+ createNewCell: console.log,
+ deleteCell: console.log,
+ focusCell: console.log,
+ moveCell: console.log,
+ moveToNextCell: console.log,
+ userConfig: {
+ completion: {
+ activate_on_typing: true,
+ },
+ save: {
+ autosave: "off",
+ autosave_delay: 1000,
+ },
+ },
+};
+
+export const Primary: Story = {
+ render: () => (
+ <div className="p-20 max-w-4xl">
+ <TooltipProvider>
+ <Cell {...props} />
+ </TooltipProvider>
+ </div>
+ ),
+};
+
+export const WithOutput: Story = {
+ render: () => (
+ <div className="p-20 max-w-4xl">
+ <TooltipProvider>
+ <Cell
+ {...props}
+ runElapsedTimeMs={20}
+ output={{
+ channel: "output",
+ data: "<span class='markdown'><h1>Layout</h1>\n<p><code>marimo</code> provides functions to help you lay out your output, such as\nin rows and columns, accordions, tabs, and callouts. This tutorial\nshows some examples.</p></span>",
+ mimetype: "text/html",
+ timestamp: "1686863788",
+ }}
+ />
+ </TooltipProvider>
+ </div>
+ ),
+};
+
+export const StaleOutput: Story = {
+ render: () => (
+ <div className="p-20 max-w-4xl">
+ <TooltipProvider>
+ <Cell
+ {...props}
+ runElapsedTimeMs={20}
+ edited={true}
+ output={{
+ channel: "output",
+ data: "<span class='markdown'><h1>Layout</h1>\n<p><code>marimo</code> provides functions to help you lay out your output, such as\nin rows and columns, accordions, tabs, and callouts. This tutorial\nshows some examples.</p></span>",
+ mimetype: "text/html",
+ timestamp: "1686863788",
+ }}
+ />
+ </TooltipProvider>
+ </div>
+ ),
+};
diff --git a/frontend/src/stories/checkbox.stories.mdx b/frontend/src/stories/checkbox.stories.mdx
new file mode 100644
index 0000000000..690a40bcc7
--- /dev/null
+++ b/frontend/src/stories/checkbox.stories.mdx
@@ -0,0 +1,36 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import { Checkbox } from "@/components/ui/checkbox";
+
+<Meta title="Checkbox" component={Checkbox} />
+
+# Checkbox
+
+<Story name="With text">
+ <div className="items-top flex space-x-2">
+ <Checkbox id="terms1" />
+ <div className="grid gap-1.5 leading-none">
+ <label
+ htmlFor="terms1"
+ className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
+ >
+ Accept terms and conditions
+ </label>
+ <p className="text-sm text-slate-500 dark:text-slate-400">
+ You agree to our Terms of Service and Privacy Policy.
+ </p>
+ </div>
+ </div>
+</Story>
+
+<Story name="Disabled">
+ <div className="flex items-center space-x-2">
+ <Checkbox id="terms2" disabled />
+ <label
+ htmlFor="terms2"
+ className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
+ >
+ Accept terms and conditions
+ </label>
+ </div>
+</Story>
diff --git a/frontend/src/stories/combobox.stories.tsx b/frontend/src/stories/combobox.stories.tsx
new file mode 100644
index 0000000000..f96f45649e
--- /dev/null
+++ b/frontend/src/stories/combobox.stories.tsx
@@ -0,0 +1,84 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { Combobox, ComboboxItem } from "../components/ui/combobox";
+
+export default {
+ title: "Combobox",
+ component: Combobox,
+};
+
+interface Framework {
+ value: string;
+ label: string;
+}
+
+const frameworks = [
+ {
+ value: "next.js",
+ label: "Next.js",
+ },
+ {
+ value: "sveltekit",
+ label: "SvelteKit",
+ },
+ {
+ value: "nuxt.js",
+ label: "Nuxt.js",
+ },
+ {
+ value: "remix",
+ label: "Remix",
+ },
+ {
+ value: "astro",
+ label: "Astro",
+ },
+] satisfies Framework[];
+
+export const Basic = () => (
+ <div className="w-64 m-10">
+ <Combobox
+ placeholder="Select favorite framework"
+ displayValue={(framework: Framework) => framework.label}
+ >
+ {frameworks.map((framework) => (
+ <ComboboxItem key={framework.value} value={framework}>
+ {framework.label}
+ </ComboboxItem>
+ ))}
+ </Combobox>
+ </div>
+);
+
+export const Multiple = () => (
+ <div className="w-64 m-10">
+ <Combobox
+ placeholder="Select favorite frameworks"
+ displayValue={(framework: Framework) => framework.label}
+ multiple={true}
+ >
+ {frameworks.map((framework) => (
+ <ComboboxItem key={framework.value} value={framework}>
+ {framework.label}
+ </ComboboxItem>
+ ))}
+ </Combobox>
+ </div>
+);
+
+export const WithCustomFilterFn = () => (
+ <div className="w-64 m-10">
+ <Combobox
+ placeholder="Select favorite frameworks"
+ displayValue={(framework: Framework) => framework.label}
+ filterFn={(value, search) =>
+ value.charAt(0) === search.charAt(0) ? 1 : 0
+ }
+ >
+ {frameworks.map((framework) => (
+ <ComboboxItem key={framework.value} value={framework}>
+ {framework.label}
+ </ComboboxItem>
+ ))}
+ </Combobox>
+ </div>
+);
diff --git a/frontend/src/stories/data-table.stories.mdx b/frontend/src/stories/data-table.stories.mdx
new file mode 100644
index 0000000000..145b4743b9
--- /dev/null
+++ b/frontend/src/stories/data-table.stories.mdx
@@ -0,0 +1,49 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import { DataTable } from "@/components/data-table/data-table";
+import { generateColumns } from "@/components/data-table/columns";
+
+<Meta title="DataTable" component={DataTable} />
+
+# Popover
+
+<Story name="Default">
+ <DataTable
+ data={[
+ { first_name: "Michael", last_name: "Scott" },
+ { first_name: "Dwight", last_name: "Schrute" },
+ ]}
+ columns={generateColumns([
+ { first_name: "Michael", last_name: "Scott" },
+ { first_name: "Dwight", last_name: "Schrute" },
+ ])}
+ />
+</Story>
+
+<Story name="Empty 1">
+ <DataTable
+ data={[]}
+ columns={generateColumns([
+ { first_name: "Michael", last_name: "Scott" },
+ { first_name: "Dwight", last_name: "Schrute" },
+ ])}
+ />
+</Story>
+
+<Story name="Empty 2">
+ <DataTable data={[]} columns={[]} />
+</Story>
+
+<Story name="Pagination">
+ <DataTable
+ data={[
+ { first_name: "Michael", last_name: "Scott" },
+ { first_name: "Dwight", last_name: "Schrute" },
+ ]}
+ columns={generateColumns([
+ { first_name: "Michael", last_name: "Scott" },
+ { first_name: "Dwight", last_name: "Schrute" },
+ ])}
+ pagination={true}
+ />
+</Story>
diff --git a/frontend/src/stories/dialog.stories.mdx b/frontend/src/stories/dialog.stories.mdx
new file mode 100644
index 0000000000..e45d1ca452
--- /dev/null
+++ b/frontend/src/stories/dialog.stories.mdx
@@ -0,0 +1,72 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import { Button } from "@/components/ui/button";
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+ DialogTrigger,
+} from "@/components/ui/dialog";
+import { Input } from "@/components/ui/input";
+import { Label } from "@/components/ui/label";
+
+<Meta title="Dialog" component={Dialog} />
+
+# Dialog
+
+<Story name="closed">
+ <Dialog className="w-[620px]">
+ <DialogTrigger asChild>
+ <Button variant="outline">Rename</Button>
+ </DialogTrigger>
+ <DialogContent className="w-[620px] shadow-sm">
+ <DialogHeader>
+ <DialogTitle>Rename notebook</DialogTitle>
+ <DialogDescription>
+ Choose a new name for this notebook.
+ </DialogDescription>
+ </DialogHeader>
+ <div className="grid gap-4 py-4">
+ <div className="grid grid-cols-4 items-center gap-4">
+ <Label htmlFor="name" className="text-right">
+ File name
+ </Label>
+ <Input id="name" value="scratchpad.py" className="col-span-3" />
+ </div>
+ </div>
+ <DialogFooter>
+ <Button type="submit">Save</Button>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
+</Story>
+
+<Story name="open">
+ <Dialog className="w-[620px]" open>
+ <DialogTrigger asChild>
+ <Button variant="outline">Rename</Button>
+ </DialogTrigger>
+ <DialogContent className="w-[620px] shadow-sm">
+ <DialogHeader>
+ <DialogTitle>Rename notebook</DialogTitle>
+ <DialogDescription>
+ Choose a new name for this notebook.
+ </DialogDescription>
+ </DialogHeader>
+ <div className="grid gap-4 py-4">
+ <div className="grid grid-cols-4 items-center gap-4">
+ <Label htmlFor="name" className="text-right">
+ File name
+ </Label>
+ <Input id="name" value="scratchpad.py" className="col-span-3" />
+ </div>
+ </div>
+ <DialogFooter>
+ <Button type="submit">Save</Button>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
+</Story>
diff --git a/frontend/src/stories/dropdown-menu.stories.mdx b/frontend/src/stories/dropdown-menu.stories.mdx
new file mode 100644
index 0000000000..77e2ba825e
--- /dev/null
+++ b/frontend/src/stories/dropdown-menu.stories.mdx
@@ -0,0 +1,124 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import {
+ Cloud,
+ CreditCard,
+ Github,
+ Keyboard,
+ LifeBuoy,
+ LogOut,
+ Mail,
+ MessageSquare,
+ Plus,
+ PlusCircle,
+ Settings,
+ User,
+ UserPlus,
+ Users,
+} from "lucide-react";
+
+import { Button } from "@/components/ui/button";
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuGroup,
+ DropdownMenuItem,
+ DropdownMenuLabel,
+ DropdownMenuPortal,
+ DropdownMenuSeparator,
+ DropdownMenuShortcut,
+ DropdownMenuSub,
+ DropdownMenuSubContent,
+ DropdownMenuSubTrigger,
+ DropdownMenuTrigger,
+} from "@/components/ui/dropdown-menu";
+
+<Meta title="DropdownMenu" component={DropdownMenu} />
+
+# DropdownMenu
+
+<DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <Button variant="outline">Open</Button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent className="w-56">
+ <DropdownMenuLabel>My Account</DropdownMenuLabel>
+ <DropdownMenuSeparator />
+ <DropdownMenuGroup>
+ <DropdownMenuItem>
+ <User className="mr-2 h-4 w-4" />
+ <span>Profile</span>
+ <DropdownMenuShortcut>⇧⌘P</DropdownMenuShortcut>
+ </DropdownMenuItem>
+ <DropdownMenuItem>
+ <CreditCard className="mr-2 h-4 w-4" />
+ <span>Billing</span>
+ <DropdownMenuShortcut>⌘B</DropdownMenuShortcut>
+ </DropdownMenuItem>
+ <DropdownMenuItem>
+ <Settings className="mr-2 h-4 w-4" />
+ <span>Settings</span>
+ <DropdownMenuShortcut>⌘S</DropdownMenuShortcut>
+ </DropdownMenuItem>
+ <DropdownMenuItem>
+ <Keyboard className="mr-2 h-4 w-4" />
+ <span>Keyboard shortcuts</span>
+ <DropdownMenuShortcut>⌘K</DropdownMenuShortcut>
+ </DropdownMenuItem>
+ </DropdownMenuGroup>
+ <DropdownMenuSeparator />
+ <DropdownMenuGroup>
+ <DropdownMenuItem>
+ <Users className="mr-2 h-4 w-4" />
+ <span>Team</span>
+ </DropdownMenuItem>
+ <DropdownMenuSub>
+ <DropdownMenuSubTrigger>
+ <UserPlus className="mr-2 h-4 w-4" />
+ <span>Invite users</span>
+ </DropdownMenuSubTrigger>
+ <DropdownMenuPortal>
+ <DropdownMenuSubContent>
+ <DropdownMenuItem>
+ <Mail className="mr-2 h-4 w-4" />
+ <span>Email</span>
+ </DropdownMenuItem>
+ <DropdownMenuItem>
+ <MessageSquare className="mr-2 h-4 w-4" />
+ <span>Message</span>
+ </DropdownMenuItem>
+ <DropdownMenuSeparator />
+ <DropdownMenuItem>
+ <PlusCircle className="mr-2 h-4 w-4" />
+ <span>More...</span>
+ </DropdownMenuItem>
+ </DropdownMenuSubContent>
+ </DropdownMenuPortal>
+ </DropdownMenuSub>
+ <DropdownMenuItem>
+ <Plus className="mr-2 h-4 w-4" />
+ <span>New Team</span>
+ <DropdownMenuShortcut>⌘+T</DropdownMenuShortcut>
+ </DropdownMenuItem>
+ </DropdownMenuGroup>
+ <DropdownMenuSeparator />
+ <DropdownMenuItem>
+ <Github className="mr-2 h-4 w-4" />
+ <span>GitHub</span>
+ </DropdownMenuItem>
+ <DropdownMenuItem>
+ <LifeBuoy className="mr-2 h-4 w-4" />
+ <span>Support</span>
+ </DropdownMenuItem>
+ <DropdownMenuItem disabled>
+ <Cloud className="mr-2 h-4 w-4" />
+ <span>API</span>
+ </DropdownMenuItem>
+ <DropdownMenuSeparator />
+ <DropdownMenuItem>
+ <LogOut className="mr-2 h-4 w-4" />
+ <span>Log out</span>
+ <DropdownMenuShortcut>⇧⌘Q</DropdownMenuShortcut>
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+</DropdownMenu>
diff --git a/frontend/src/stories/editor-inputs.stories.tsx b/frontend/src/stories/editor-inputs.stories.tsx
new file mode 100644
index 0000000000..2a1ec65480
--- /dev/null
+++ b/frontend/src/stories/editor-inputs.stories.tsx
@@ -0,0 +1,47 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { StoryFn, Meta } from "@storybook/react";
+import { Button, Input } from "../editor/inputs/Inputs";
+import { PlayIcon } from "lucide-react";
+
+export default {
+ title: "Editor Inputs",
+ component: Button,
+} as Meta;
+
+const ButtonTemplate: StoryFn<typeof Button> = (args) => (
+ <div className="m-4">
+ <Button {...args}>
+ <PlayIcon strokeWidth={1.5} size={16} />
+ </Button>
+ </div>
+);
+export const ButtonStory = ButtonTemplate.bind({});
+ButtonStory.argTypes = {
+ color: {
+ type: {
+ name: "enum",
+ value: ["gray", "green", "red", "yellow", "hint-green"],
+ },
+ },
+ size: {
+ type: {
+ name: "enum",
+ value: ["small", "medium"],
+ },
+ },
+ shape: {
+ type: {
+ name: "enum",
+ value: ["circle", "rectangle"],
+ },
+ },
+ onClick: { action: "clicked" },
+};
+
+const InputTemplate: StoryFn<typeof Input> = (args) => (
+ <div className="m-4">
+ <Input {...args} id="filename-input" className="filename" />
+ </div>
+);
+export const InputStory = InputTemplate.bind({});
+InputStory.args = {};
diff --git a/frontend/src/stories/editor.stories.tsx b/frontend/src/stories/editor.stories.tsx
new file mode 100644
index 0000000000..ac211d0459
--- /dev/null
+++ b/frontend/src/stories/editor.stories.tsx
@@ -0,0 +1,72 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import type { Meta, StoryObj } from "@storybook/react";
+import { useEffect, useRef } from "react";
+import { EditorState, Extension } from "@codemirror/state";
+import { EditorView, basicSetup } from "codemirror";
+import { setup } from "../core/codemirror/cm";
+import { python } from "@codemirror/lang-python";
+
+const meta: Meta = {
+ title: "Editor",
+ args: {},
+};
+
+export default meta;
+type Story = StoryObj;
+
+const CONTENT = `
+class Foo:
+ def __init__(self):
+ pass
+
+# Some comment
+
+# some other comment
+def bar():
+ pass
+
+
+def foo():
+ # another comment
+ pass
+`.trim();
+
+const Editor = (opts: { extensions?: Extension[] }): React.ReactNode => {
+ const ref = useRef<HTMLDivElement>(null);
+ useEffect(() => {
+ if (!ref.current) {
+ return;
+ }
+
+ const view = new EditorView({
+ state: EditorState.create({
+ extensions: opts.extensions,
+ doc: CONTENT,
+ }),
+ parent: ref.current,
+ });
+
+ return () => view.destroy();
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [ref.current]);
+
+ return <div className="cm" ref={ref} />;
+};
+
+export const Primary: Story = {
+ render: (args, ctx) => (
+ <div className="Cell m-20 w-[60%] overflow-hidden">
+ <Editor
+ extensions={setup({ activate_on_typing: false }, ctx.globals.theme)}
+ />
+ </div>
+ ),
+};
+
+export const DefaultPython: Story = {
+ render: () => (
+ <div className="m-20 w-[60%] overflow-hidden">
+ <Editor extensions={[basicSetup, python()]} />
+ </div>
+ ),
+};
diff --git a/frontend/src/stories/input.stories.mdx b/frontend/src/stories/input.stories.mdx
new file mode 100644
index 0000000000..860ad194b9
--- /dev/null
+++ b/frontend/src/stories/input.stories.mdx
@@ -0,0 +1,39 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import { Input } from "@/components/ui/input";
+import { Label } from "@/components/ui/label";
+import { Button } from "@/components/ui/button";
+
+<Meta title="Input" component={Input} />
+
+# Input
+
+<Story name="Default">
+ <Input type="email" className="w-1/4" placeholder="Email" />
+</Story>
+
+<Story name="Disabled">
+ <Input disabled type="email" className="w-1/4" placeholder="Email" />
+</Story>
+
+<Story name="With Label">
+ <div className="grid w-full max-w-sm items-center gap-1.5">
+ <Label htmlFor="email">Email</Label>
+ <Input type="email" id="email" placeholder="Email" />
+ </div>
+</Story>
+
+<Story name="With Text">
+ <div className="grid w-full max-w-sm items-center gap-1.5">
+ <Label htmlFor="email-2">Email</Label>
+ <Input type="email" id="email-2" placeholder="Email" />
+ <p className="text-sm text-slate-500">Enter your email address.</p>
+ </div>
+</Story>
+
+<Story name="With Button">
+ <div className="flex w-full max-w-sm items-center space-x-2">
+ <Input type="email" placeholder="Email" />
+ <Button type="submit">Subscribe</Button>
+ </div>
+</Story>
diff --git a/frontend/src/stories/label.stories.mdx b/frontend/src/stories/label.stories.mdx
new file mode 100644
index 0000000000..0cd5c18215
--- /dev/null
+++ b/frontend/src/stories/label.stories.mdx
@@ -0,0 +1,9 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import { Label } from "@/components/ui/label";
+
+<Meta title="Label" component={Label} />
+
+# Label
+
+<Label htmlFor="email">Your email address</Label>
diff --git a/frontend/src/stories/popover.stories.mdx b/frontend/src/stories/popover.stories.mdx
new file mode 100644
index 0000000000..00ca8c4db7
--- /dev/null
+++ b/frontend/src/stories/popover.stories.mdx
@@ -0,0 +1,61 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import { Settings2 } from "lucide-react";
+
+import { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import { Label } from "@/components/ui/label";
+import {
+ Popover,
+ PopoverContent,
+ PopoverTrigger,
+} from "@/components/ui/popover";
+
+<Meta title="Popover" component={Popover} />
+
+# Popover
+
+<Popover>
+ <PopoverTrigger asChild>
+ <Button variant="outline" className="w-10 rounded-full p-0">
+ <Settings2 className="h-4 w-4" />
+ <span className="sr-only">Open popover</span>
+ </Button>
+ </PopoverTrigger>
+ <PopoverContent className="w-80">
+ <div className="grid gap-4">
+ <div className="space-y-2">
+ <h4 className="font-medium leading-none">Dimensions</h4>
+ <p className="text-sm text-slate-500 dark:text-slate-400">
+ Set the dimensions for the cell output.
+ </p>
+ </div>
+ <div className="grid gap-2">
+ <div className="grid grid-cols-3 items-center gap-4">
+ <Label htmlFor="width">Width</Label>
+ <Input id="width" defaultValue="100%" className="col-span-2 h-8" />
+ </div>
+ <div className="grid grid-cols-3 items-center gap-4">
+ <Label htmlFor="maxWidth">Max. width</Label>
+ <Input
+ id="maxWidth"
+ defaultValue="300px"
+ className="col-span-2 h-8"
+ />
+ </div>
+ <div className="grid grid-cols-3 items-center gap-4">
+ <Label htmlFor="height">Height</Label>
+ <Input id="height" defaultValue="25px" className="col-span-2 h-8" />
+ </div>
+ <div className="grid grid-cols-3 items-center gap-4">
+ <Label htmlFor="maxHeight">Max. height</Label>
+ <Input
+ id="maxHeight"
+ defaultValue="none"
+ className="col-span-2 h-8"
+ />
+ </div>
+ </div>
+ </div>
+ </PopoverContent>
+</Popover>
diff --git a/frontend/src/stories/radio-group.stories.mdx b/frontend/src/stories/radio-group.stories.mdx
new file mode 100644
index 0000000000..e2b902bf0d
--- /dev/null
+++ b/frontend/src/stories/radio-group.stories.mdx
@@ -0,0 +1,38 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import { Label } from "@/components/ui/label";
+import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
+
+<Meta title="RadioGroup" component={RadioGroup} />
+
+# RadioGroup
+
+<RadioGroup defaultValue="comfortable">
+ <div className="flex items-center space-x-3">
+ <RadioGroupItem value="default" id="r1" />
+ <Label htmlFor="r1">Default</Label>
+ </div>
+ <div className="flex items-center space-x-3">
+ <RadioGroupItem value="comfortable" id="r2" />
+ <Label htmlFor="r2">Comfortable</Label>
+ </div>
+ <div className="flex items-center space-x-3">
+ <RadioGroupItem value="compact" id="r3" />
+ <Label htmlFor="r3">Compact</Label>
+ </div>
+</RadioGroup>
+
+<RadioGroup defaultValue="comfortable">
+ <div className="flex items-center space-x-3">
+ <RadioGroupItem value="default" id="r1" />
+ <Label htmlFor="r1">a</Label>
+ </div>
+ <div className="flex items-center space-x-3">
+ <RadioGroupItem value="comfortable" id="r2" />
+ <Label htmlFor="r2">b</Label>
+ </div>
+ <div className="flex items-center space-x-3">
+ <RadioGroupItem value="compact" id="r3" />
+ <Label htmlFor="r3">c</Label>
+ </div>
+</RadioGroup>
diff --git a/frontend/src/stories/select-native.stories.mdx b/frontend/src/stories/select-native.stories.mdx
new file mode 100644
index 0000000000..5cc6017386
--- /dev/null
+++ b/frontend/src/stories/select-native.stories.mdx
@@ -0,0 +1,39 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import { NativeSelect } from "@/components/ui/native-select";
+
+<Meta title="NativeSelect" component={NativeSelect} />
+
+# Native Select
+
+{" "}
+
+<Story name="Short Options">
+ <NativeSelect>
+ <option>--</option>
+ <option>a</option>
+ <option>b</option>
+ <option>c</option>
+ <option>d</option>
+ </NativeSelect>
+</Story>
+
+<Story name="One long option">
+ <NativeSelect>
+ <option>--</option>
+ <option>a</option>
+ <option>b</option>
+ <option>c</option>
+ <option>defgh</option>
+ </NativeSelect>
+</Story>
+
+<Story name="One really long option">
+ <NativeSelect>
+ <option>--</option>
+ <option>a</option>
+ <option>b</option>
+ <option>c</option>
+ <option>a really long option this is a really long option</option>
+ </NativeSelect>
+</Story>
diff --git a/frontend/src/stories/select.stories.mdx b/frontend/src/stories/select.stories.mdx
new file mode 100644
index 0000000000..946af84d48
--- /dev/null
+++ b/frontend/src/stories/select.stories.mdx
@@ -0,0 +1,53 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import {
+ Select,
+ SelectContent,
+ SelectGroup,
+ SelectItem,
+ SelectLabel,
+ SelectSeparator,
+ SelectTrigger,
+ SelectValue,
+} from "@/components/ui/select";
+
+<Meta title="Select" component={Select} />
+
+# Select
+
+{" "}
+
+<Select>
+ <SelectTrigger>
+ <SelectValue placeholder="Select a fruit" />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectGroup>
+ <SelectLabel>Fruits</SelectLabel>
+ <SelectItem value="apple">Apple</SelectItem>
+ <SelectItem value="banana">Banana</SelectItem>
+ <SelectItem value="blueberry">Blueberry</SelectItem>
+ <SelectItem value="grapes">Grapes</SelectItem>
+ <SelectItem value="pineapple">Pineapple</SelectItem>
+ </SelectGroup>
+ <SelectSeparator />
+ <SelectGroup>
+ <SelectLabel>Vegetables</SelectLabel>
+ <SelectItem value="aubergine">Aubergine</SelectItem>
+ <SelectItem value="broccoli">Broccoli</SelectItem>
+ <SelectItem value="carrot" disabled>
+ Carrot
+ </SelectItem>
+ <SelectItem value="courgette">Courgette</SelectItem>
+ <SelectItem value="leek">Leek</SelectItem>
+ </SelectGroup>
+ <SelectSeparator />
+ <SelectGroup>
+ <SelectLabel>Meat</SelectLabel>
+ <SelectItem value="beef">Beef</SelectItem>
+ <SelectItem value="chicken">Chicken</SelectItem>
+ <SelectItem value="lamb">Lamb</SelectItem>
+ <SelectItem value="pork">Pork</SelectItem>
+ </SelectGroup>
+ </SelectContent>
+</Select>
diff --git a/frontend/src/stories/slider.stories.mdx b/frontend/src/stories/slider.stories.mdx
new file mode 100644
index 0000000000..ad823d2b7e
--- /dev/null
+++ b/frontend/src/stories/slider.stories.mdx
@@ -0,0 +1,15 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import { Slider } from "@/components/ui/slider";
+
+<Meta title="Slider" component={Slider} />
+
+# Slider
+
+<Story name="With Value">
+ <Slider value={[10]} max={100} step={1} />
+</Story>
+
+<Story name="With Default Value">
+ <Slider defaultValue={[33]} max={100} step={1} />
+</Story>
diff --git a/frontend/src/stories/switch.stories.mdx b/frontend/src/stories/switch.stories.mdx
new file mode 100644
index 0000000000..c7140cf7d4
--- /dev/null
+++ b/frontend/src/stories/switch.stories.mdx
@@ -0,0 +1,13 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import { Label } from "@/components/ui/label";
+import { Switch } from "@/components/ui/switch";
+
+<Meta title="Switch" component={Switch} />
+
+# Switch
+
+<div className="flex items-center align-middle space-x-2">
+ <Switch id="airplane-mode" />
+ <Label htmlFor="airplane-mode">Airplane Mode</Label>
+</div>
diff --git a/frontend/src/stories/tabs.stories.mdx b/frontend/src/stories/tabs.stories.mdx
new file mode 100644
index 0000000000..029cc8ce35
--- /dev/null
+++ b/frontend/src/stories/tabs.stories.mdx
@@ -0,0 +1,49 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import { Label } from "@/components/ui/label";
+import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
+
+<Meta title="Tabs" component={Tabs} />
+
+# Tabs
+
+<Tabs defaultValue="config" className="w-[400px]">
+ <TabsList>
+ <TabsTrigger value="config">Config</TabsTrigger>
+ <TabsTrigger value="variables">Variables</TabsTrigger>
+ </TabsList>
+ <TabsContent value="config">
+ <p className="text-sm text-slate-500 dark:text-slate-400">
+ Change your account settings here.
+ </p>
+ <div className="grid gap-2 py-4">
+ <div className="space-y-1">
+ <Label htmlFor="name">Auto Save Delay</Label>
+ <Input id="name" defaultValue="1000" />
+ </div>
+ <div className="space-y-1">
+ <Label htmlFor="username">Default Filename</Label>
+ <Input id="username" defaultValue="" />
+ </div>
+ </div>
+ <div className="flex">
+ <Button>Save changes</Button>
+ </div>
+ </TabsContent>
+ <TabsContent value="variables">
+ <p className="text-sm text-slate-500 dark:text-slate-400">
+ Change your variables here.
+ </p>
+ <div className="grid gap-2 py-4">
+ <div className="space-y-1">
+ <Label htmlFor="env1">ENV 1</Label>
+ <Input id="env1" />
+ </div>
+ </div>
+ <div className="flex">
+ <Button>Save</Button>
+ </div>
+ </TabsContent>
+</Tabs>
diff --git a/frontend/src/stories/textarea.stories.mdx b/frontend/src/stories/textarea.stories.mdx
new file mode 100644
index 0000000000..3ccaae3a86
--- /dev/null
+++ b/frontend/src/stories/textarea.stories.mdx
@@ -0,0 +1,41 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import { Label } from "@/components/ui/label";
+import { Textarea } from "@/components/ui/textarea";
+import { Button } from "@/components/ui/button";
+
+<Meta title="Textarea" component={Textarea} />
+
+# Textarea
+
+<Story name="Default">
+ <Textarea placeholder="Type your message here." />
+</Story>
+
+<Story name="Disabled">
+ <Textarea placeholder="Type your message here." disabled />
+</Story>
+
+<Story name="With Label">
+ <div className="grid w-full gap-1.5">
+ <Label htmlFor="message">Your message</Label>
+ <Textarea placeholder="Type your message here." id="message" />
+ </div>
+</Story>
+
+<Story name="With Text">
+ <div className="grid w-full gap-1.5">
+ <Label htmlFor="message-2">Your Message</Label>
+ <Textarea placeholder="Type your message here." id="message-2" />
+ <p className="text-sm text-slate-500">
+ Your message will be copied to the support team.
+ </p>
+ </div>
+</Story>
+
+<Story name="With Button">
+ <div className="grid w-full gap-2">
+ <Textarea placeholder="Type your message here." />
+ <Button>Send message</Button>
+ </div>
+</Story>
diff --git a/frontend/src/stories/tooltip.stories.mdx b/frontend/src/stories/tooltip.stories.mdx
new file mode 100644
index 0000000000..0285da8b9f
--- /dev/null
+++ b/frontend/src/stories/tooltip.stories.mdx
@@ -0,0 +1,29 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import { Plus } from "lucide-react";
+
+import { Button } from "@/components/ui/button";
+import {
+ TooltipRoot,
+ TooltipProvider,
+ TooltipContent,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
+
+<Meta title="Tooltip" component={TooltipRoot} />
+
+# Tooltip
+
+<TooltipProvider>
+ <TooltipRoot>
+ <TooltipTrigger asChild>
+ <Button variant="outline" className="rounded-full">
+ <Plus className="h-4 w-4" />
+ <span className="sr-only">Add</span>
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>Add to library</p>
+ </TooltipContent>
+ </TooltipRoot>
+</TooltipProvider>
diff --git a/frontend/src/stories/typography.stories.mdx b/frontend/src/stories/typography.stories.mdx
new file mode 100644
index 0000000000..b4798a3a61
--- /dev/null
+++ b/frontend/src/stories/typography.stories.mdx
@@ -0,0 +1,67 @@
+import { Meta, Story } from "@storybook/addon-docs";
+
+import {
+ H1,
+ H2,
+ H3,
+ H4,
+ P,
+ Blockquote,
+ InlineCode,
+ Lead,
+ LargeText,
+ SmallText,
+ MutatedText,
+} from "@/components/ui/typography";
+
+<Meta title="Typography" />
+
+# Typography
+
+<Story name="H1">
+ <H1>Taxing Laughter: The Joke Tax Chronicles</H1>
+</Story>
+
+<Story name="H2">
+ <H2>Taxing Laughter: The Joke Tax Chronicles</H2>
+</Story>
+
+<Story name="H3">
+ <H3>Taxing Laughter: The Joke Tax Chronicles</H3>
+</Story>
+
+<Story name="H4">
+ <H4>Taxing Laughter: The Joke Tax Chronicles</H4>
+</Story>
+
+<Story name="P">
+ <P>Taxing Laughter: The Joke Tax Chronicles</P>
+</Story>
+
+<Story name="List (UL)">
+ <ul className="my-6 ml-6 list-disc [&>li]:mt-2">
+ <li>1st level of puns: 5 gold coins</li>
+ <li>2nd level of jokes: 10 gold coins</li>
+ <li>3rd level of one-liners : 20 gold coins</li>
+ </ul>
+</Story>
+
+<Story name="Inline Code">
+ <H1>Taxing Laughter: The Joke Tax Chronicles</H1>
+</Story>
+
+<Story name="Lead">
+ <Lead>Taxing Laughter: The Joke Tax Chronicles</Lead>
+</Story>
+
+<Story name="LargeText">
+ <LargeText>Taxing Laughter: The Joke Tax Chronicles</LargeText>
+</Story>
+
+<Story name="SmallText">
+ <SmallText>Taxing Laughter: The Joke Tax Chronicles</SmallText>
+</Story>
+
+<Story name="MutatedText">
+ <MutatedText>Taxing Laughter: The Joke Tax Chronicles</MutatedText>
+</Story>
diff --git a/frontend/src/theme/ThemeProvider.tsx b/frontend/src/theme/ThemeProvider.tsx
new file mode 100644
index 0000000000..98cbed759e
--- /dev/null
+++ b/frontend/src/theme/ThemeProvider.tsx
@@ -0,0 +1,21 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { PropsWithChildren, memo, useLayoutEffect } from "react";
+import { useTheme } from "./useTheme";
+
+/**
+ * Marimo's theme provider.
+ */
+export const ThemeProvider: React.FC<PropsWithChildren> = memo(
+ ({ children }) => {
+ const { theme } = useTheme();
+ useLayoutEffect(() => {
+ document.body.classList.add(theme, `${theme}-theme`);
+ return () => {
+ document.body.classList.remove(theme, `${theme}-theme`);
+ };
+ }, [theme]);
+
+ return children;
+ }
+);
+ThemeProvider.displayName = "ThemeProvider";
diff --git a/frontend/src/theme/useTheme.ts b/frontend/src/theme/useTheme.ts
new file mode 100644
index 0000000000..2ccc1e31db
--- /dev/null
+++ b/frontend/src/theme/useTheme.ts
@@ -0,0 +1,25 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { useAtom } from "jotai";
+import { atomWithStorage } from "jotai/utils";
+
+export type Theme = "light" | "dark";
+
+const themeAtom = atomWithStorage<Theme>("marimo:theme", "light");
+
+/**
+ * React hook to manage the theme of the app.
+ * This is stored in local storage, so it persists between page loads.
+ */
+export function useTheme() {
+ const [theme, setTheme] = useAtom(themeAtom);
+
+ if (process.env.NODE_ENV === "development") {
+ return {
+ theme,
+ setTheme,
+ };
+ }
+
+ // Dark theme is not ready so return light theme.
+ return { theme: "light" as const, setTheme };
+}
diff --git a/frontend/src/utils/Deferred.ts b/frontend/src/utils/Deferred.ts
new file mode 100644
index 0000000000..0b57352bad
--- /dev/null
+++ b/frontend/src/utils/Deferred.ts
@@ -0,0 +1,13 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+export class Deferred<T> {
+ promise: Promise<T>;
+ resolve!: (value: T | PromiseLike<T>) => void;
+ reject!: (reason?: unknown) => void;
+
+ constructor() {
+ this.promise = new Promise<T>((resolve, reject) => {
+ this.reject = reject;
+ this.resolve = resolve;
+ });
+ }
+}
diff --git a/frontend/src/utils/Logger.ts b/frontend/src/utils/Logger.ts
new file mode 100644
index 0000000000..d5165d6574
--- /dev/null
+++ b/frontend/src/utils/Logger.ts
@@ -0,0 +1,25 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+interface ILogger {
+ debug: (typeof console)["debug"];
+ log: (typeof console)["log"];
+ warn: (typeof console)["warn"];
+ error: (typeof console)["error"];
+}
+
+/**
+ * Wrapper around console.log that can be used to disable logging in production or add additional logging.
+ */
+export const Logger: ILogger = {
+ debug: (...args) => {
+ console.debug(...args);
+ },
+ log: (...args) => {
+ console.log(...args);
+ },
+ warn: (...args) => {
+ console.warn(...args);
+ },
+ error: (...args) => {
+ console.error(...args);
+ },
+};
diff --git a/frontend/src/utils/assertExists.ts b/frontend/src/utils/assertExists.ts
new file mode 100644
index 0000000000..4b4c16dcd1
--- /dev/null
+++ b/frontend/src/utils/assertExists.ts
@@ -0,0 +1,12 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+export function assertExists<T>(
+ x: T | null | undefined,
+ message?: string
+): asserts x is T {
+ if (x === undefined || x === null) {
+ if (message) {
+ throw new Error(message);
+ }
+ throw new Error(`Expected value but got ${x}`);
+ }
+}
diff --git a/frontend/src/utils/assertNever.ts b/frontend/src/utils/assertNever.ts
new file mode 100644
index 0000000000..d90f6fd654
--- /dev/null
+++ b/frontend/src/utils/assertNever.ts
@@ -0,0 +1,18 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { Logger } from "./Logger";
+
+/**
+ * Type-safe exhaustiveness check for discriminated unions.
+ */
+export function assertNever(x: never): never {
+ throw new Error(`Unexpected object: ${x}`);
+}
+
+/**
+ * Like assertNever, but logs the unexpected object to the console.
+ * Useful for exhaustiveness checks but without throwing an error.
+ */
+export function logNever(x: never): void {
+ Logger.warn(`Unexpected object: ${JSON.stringify(x)}`);
+ return x;
+}
diff --git a/frontend/src/utils/dereference.ts b/frontend/src/utils/dereference.ts
new file mode 100644
index 0000000000..cfb09dee17
--- /dev/null
+++ b/frontend/src/utils/dereference.ts
@@ -0,0 +1,10 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+
+// Dereferences a ref that should not be null; throws if the value is null
+export function derefNotNull<T>(ref: React.RefObject<T | null>): T {
+ const value = ref.current;
+ if (value === null) {
+ throw new ReferenceError("Attempting to dereference null object.");
+ }
+ return value;
+}
diff --git a/frontend/src/utils/fileToBase64.ts b/frontend/src/utils/fileToBase64.ts
new file mode 100644
index 0000000000..93b0a0fc65
--- /dev/null
+++ b/frontend/src/utils/fileToBase64.ts
@@ -0,0 +1,24 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+function fileToBase64(file: File): Promise<[string, string]> {
+ return new Promise((resolve) => {
+ const reader = new FileReader();
+ reader.readAsDataURL(file);
+ reader.onload = (e) => {
+ if (e.target !== null && e.target.result !== null) {
+ const dataURL = e.target.result as string;
+ // Get contents from a string of the form: data:*/*;base64,contents
+ const b64EncodedContents = dataURL.slice(dataURL.indexOf(",") + 1);
+ resolve([file.name, b64EncodedContents]);
+ }
+ };
+ });
+}
+
+/**
+ * Read contents of files as base64-encoded strings
+ *
+ * Returns a promised array of tuples [file name, file contents].
+ */
+export function filesToBase64(files: File[]): Promise<Array<[string, string]>> {
+ return Promise.all(files.map((file) => fileToBase64(file)));
+}
diff --git a/frontend/src/utils/functions.ts b/frontend/src/utils/functions.ts
new file mode 100644
index 0000000000..620229dea5
--- /dev/null
+++ b/frontend/src/utils/functions.ts
@@ -0,0 +1,6 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+export const Functions = {
+ NOOP: () => {
+ return;
+ },
+};
diff --git a/frontend/src/utils/invariant.ts b/frontend/src/utils/invariant.ts
new file mode 100644
index 0000000000..192a2da3e3
--- /dev/null
+++ b/frontend/src/utils/invariant.ts
@@ -0,0 +1,17 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+export function invariant(
+ condition: boolean,
+ message: string
+): asserts condition;
+export function invariant<T>(
+ condition: T,
+ message: string
+): asserts condition is NonNullable<T>;
+export function invariant(
+ condition: boolean,
+ message: string
+): asserts condition {
+ if (!condition) {
+ throw new Error(message);
+ }
+}
diff --git a/frontend/src/utils/mergeRefs.ts b/frontend/src/utils/mergeRefs.ts
new file mode 100644
index 0000000000..3f53d46cc9
--- /dev/null
+++ b/frontend/src/utils/mergeRefs.ts
@@ -0,0 +1,12 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+export function mergeRefs<T>(...refs: Array<React.Ref<T>>): React.Ref<T> {
+ return (value) => {
+ refs.forEach((ref) => {
+ if (typeof ref === "function") {
+ ref(value);
+ } else if (ref != null) {
+ (ref as React.MutableRefObject<T | null>).current = value;
+ }
+ });
+ };
+}
diff --git a/frontend/src/utils/objects.ts b/frontend/src/utils/objects.ts
new file mode 100644
index 0000000000..164cf1991d
--- /dev/null
+++ b/frontend/src/utils/objects.ts
@@ -0,0 +1,52 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+export const Objects = {
+ mapValues<T, U, K extends string | number>(
+ obj: Record<K, T>,
+ mapper: (value: T) => U
+ ): Record<K, U> {
+ return Objects.fromEntries(
+ Objects.entries(obj).map(([key, value]) => [key, mapper(value)])
+ );
+ },
+ /**
+ * Type-safe Object.fromEntries
+ */
+ fromEntries<K extends string | number, V>(obj: Array<[K, V]>): Record<K, V> {
+ return Object.fromEntries(obj) as Record<K, V>;
+ },
+ /**
+ * Type-safe Object.entries
+ */
+ entries<K extends string | number, V>(obj: Record<K, V>): Array<[K, V]> {
+ return Object.entries(obj) as Array<[K, V]>;
+ },
+ /**
+ * Type-safe Object.keys
+ */
+ keys<K extends string | number>(obj: Record<K, unknown>): K[] {
+ return Object.keys(obj) as K[];
+ },
+ /**
+ * Type-safe groupBy
+ */
+ groupBy<T, K extends string | number, V>(
+ items: T[],
+ toKey: (item: T) => K | undefined,
+ toValue: (item: T) => V
+ ): Record<K, V[]> {
+ const result: Record<K, V[]> = {} as Record<K, V[]>;
+ for (const item of items) {
+ const key = toKey(item);
+ if (key === undefined) {
+ continue;
+ }
+ const value = toValue(item);
+ if (key in result) {
+ result[key].push(value);
+ } else {
+ result[key] = [value];
+ }
+ }
+ return result;
+ },
+};
diff --git a/frontend/src/utils/once.ts b/frontend/src/utils/once.ts
new file mode 100644
index 0000000000..87211d0bc5
--- /dev/null
+++ b/frontend/src/utils/once.ts
@@ -0,0 +1,15 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+export function once<T extends (...args: unknown[]) => unknown>(fn: T): T {
+ let result: ReturnType<T>;
+ let called = false;
+ return function (
+ this: ThisParameterType<T>,
+ ...args: Parameters<T>
+ ): ReturnType<T> {
+ if (!called) {
+ called = true;
+ result = fn.apply(this, args) as ReturnType<T>;
+ }
+ return result;
+ } as T;
+}
diff --git a/frontend/src/utils/repl.ts b/frontend/src/utils/repl.ts
new file mode 100644
index 0000000000..8b6039e5ee
--- /dev/null
+++ b/frontend/src/utils/repl.ts
@@ -0,0 +1,23 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { Logger } from "./Logger";
+
+declare global {
+ interface Window {
+ [key: string]: unknown;
+ }
+}
+
+/**
+ * Safely adds objects to the global scope for debugging.
+ */
+export function repl(item: unknown, name: string) {
+ if (typeof window === "undefined") {
+ return;
+ }
+
+ const fullName = `__marimo__${name}`;
+ if (window[fullName]) {
+ Logger.warn(`Overwriting existing debug object ${fullName}`);
+ }
+ window[fullName] = item;
+}
diff --git a/frontend/src/utils/scroll.ts b/frontend/src/utils/scroll.ts
new file mode 100644
index 0000000000..f2a7c2721f
--- /dev/null
+++ b/frontend/src/utils/scroll.ts
@@ -0,0 +1,31 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+
+/**
+ * Scroll the element into view if it is not fully visible.
+ */
+export function smartScrollIntoView(
+ element: HTMLElement,
+ offset?: { top: number; bottom: number }
+) {
+ const topOffset = offset?.top ?? 0;
+ const bottomOffset = offset?.bottom ?? 0;
+ const rect = element.getBoundingClientRect();
+
+ if (rect.top < topOffset) {
+ // Element is above the viewport, scroll to its top
+ window.scrollBy({
+ top: rect.top - topOffset,
+ behavior: "smooth",
+ });
+ return;
+ } else if (rect.bottom > window.innerHeight - bottomOffset) {
+ // Element is below the viewport, scroll to its bottom
+ window.scrollBy({
+ top: rect.bottom - window.innerHeight + bottomOffset,
+ behavior: "smooth",
+ });
+ return;
+ }
+
+ // If the element is already fully in view, do nothing
+}
diff --git a/frontend/src/utils/staticImplements.ts b/frontend/src/utils/staticImplements.ts
new file mode 100644
index 0000000000..e32f4c52d1
--- /dev/null
+++ b/frontend/src/utils/staticImplements.ts
@@ -0,0 +1,7 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+export function staticImplements<T>() {
+ return <U extends T>(constructor: U) => {
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
+ constructor;
+ };
+}
diff --git a/frontend/src/utils/uuid.ts b/frontend/src/utils/uuid.ts
new file mode 100644
index 0000000000..ca7b9a8235
--- /dev/null
+++ b/frontend/src/utils/uuid.ts
@@ -0,0 +1,13 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+export function generateUUID() {
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(
+ /[xy]/g,
+ function (c) {
+ const r = Math.trunc(Math.random() * 16);
+ const v = c === "x" ? r : (r & 0x3) | 0x8;
+ return v.toString(16);
+ }
+ );
+}
+
+export const UUID = generateUUID();
diff --git a/frontend/src/utils/vitals.ts b/frontend/src/utils/vitals.ts
new file mode 100644
index 0000000000..8eb8faf60b
--- /dev/null
+++ b/frontend/src/utils/vitals.ts
@@ -0,0 +1,22 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { onLCP, onFID, onCLS, Metric } from "web-vitals";
+import { Logger } from "./Logger";
+
+export function reportVitals() {
+ Logger.log("Reporting vitals");
+ const logMetric = (metric: Metric) => {
+ const color =
+ metric.rating === "good"
+ ? "green"
+ : metric.rating === "needs-improvement"
+ ? "orange"
+ : "red";
+ Logger.log(
+ `%c [Metric ${metric.name}] ${metric.value}`,
+ `background:${color}; color:white; padding:2px 0; border-radius:2px`
+ );
+ };
+ onCLS(logMetric);
+ onFID(logMetric);
+ onLCP(logMetric);
+}
diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js
new file mode 100644
index 0000000000..7bc716bfe0
--- /dev/null
+++ b/frontend/tailwind.config.js
@@ -0,0 +1,118 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+/** @type {import('tailwindcss').Config} */
+module.exports = {
+ darkMode: ["class"],
+ content: ["./src/**/*.{ts,tsx,mdx}"],
+ theme: {
+ container: {
+ center: true,
+ padding: "2rem",
+ screens: {
+ "2xl": "1400px",
+ },
+ },
+ boxShadow: {
+ none: "none",
+ // fuzzy shadows
+ xxs: "var(--shadow-xxs)",
+ xs: "var(--shadow-xs)",
+ sm: "var(--shadow-sm)",
+ md: "var(--shadow-md)",
+ lg: "var(--shadow-lg)",
+ xl: "var(--shadow-xl)",
+ // solid shadows
+ xsSolid:
+ "1px 1px 0px 0px var(--tw-shadow-color, var(--base-shadow-darker)), 0px 0px 2px 0px hsl(0deg 0% 25% / 5%)",
+ smSolid:
+ "2px 2px 0px 0px var(--tw-shadow-color, var(--base-shadow-darker)), 0px 0px 2px 0px hsl(0deg 0% 25% / 5%)",
+ mdSolid:
+ "4px 4px 0px 0px var(--tw-shadow-color, var(--base-shadow-darker)), 0 0px 4px 0px hsl(0deg 0% 60% / 5%)",
+ lgSolid:
+ "5px 6px 0px 0px var(--tw-shadow-color, var(--base-shadow-darker)), 0 0px 4px 0px hsl(0deg 0% 75% / 5%)",
+ xlSolid:
+ "8px 9px 0px 0px var(--tw-shadow-color, var(--base-shadow-darker)), 0 0px 6px 0px hsl(0deg 0% 85% / 5%)",
+ },
+ extend: {
+ maxWidth: {
+ contentWidth: "var(--content-width)",
+ },
+ colors: {
+ border: "hsl(var(--border) / <alpha-value>)",
+ input: "hsl(var(--input) / <alpha-value>)",
+ ring: "hsl(var(--ring) / <alpha-value>)",
+ background: "hsl(var(--background) / <alpha-value>)",
+ foreground: "hsl(var(--foreground) / <alpha-value>)",
+ primary: {
+ DEFAULT: "hsl(var(--primary) / <alpha-value>)",
+ foreground: "hsl(var(--primary-foreground) / <alpha-value>)",
+ },
+ secondary: {
+ DEFAULT: "hsl(var(--secondary) / <alpha-value>)",
+ foreground: "hsl(var(--secondary-foreground) / <alpha-value>)",
+ },
+ destructive: {
+ DEFAULT: "hsl(var(--destructive) / <alpha-value>)",
+ foreground: "hsl(var(--destructive-foreground) / <alpha-value>)",
+ },
+ error: {
+ DEFAULT: "hsl(var(--error) / <alpha-value>)",
+ foreground: "hsl(var(--error-foreground) / <alpha-value>)",
+ },
+ muted: {
+ DEFAULT: "hsl(var(--muted) / <alpha-value>)",
+ foreground: "hsl(var(--muted-foreground) / <alpha-value>)",
+ },
+ accent: {
+ DEFAULT: "hsl(var(--accent) / <alpha-value>)",
+ foreground: "hsl(var(--accent-foreground) / <alpha-value>)",
+ },
+ action: {
+ DEFAULT: "hsl(var(--action) / <alpha-value>)",
+ hover: "hsl(var(--action-hover) / <alpha-value>)",
+ foreground: "hsl(var(--action-foreground) / <alpha-value>)",
+ },
+ popover: {
+ DEFAULT: "hsl(var(--popover) / <alpha-value>)",
+ foreground: "hsl(var(--popover-foreground) / <alpha-value>)",
+ },
+ card: {
+ DEFAULT: "hsl(var(--card) / <alpha-value>)",
+ foreground: "hsl(var(--card-foreground) / <alpha-value>)",
+ },
+
+ calloutNeutralBorder: "var(--callout-neutral-border)",
+ calloutNeutralBg: "var(--callout-neutral-bg)",
+ calloutAlertBorder: "var(--callout-alert-border)",
+ calloutAlertBg: "var(--callout-alert-bg)",
+ calloutWarnBorder: "var(--callout-warn-border)",
+ calloutWarnBg: "var(--callout-warn-bg)",
+ calloutSuccessBorder: "var(--callout-success-border)",
+ calloutSuccessBg: "var(--callout-success-bg)",
+ },
+ fontFamily: {
+ prose: "var(--text-font)",
+ code: "var(--monospace-font)",
+ },
+ borderRadius: {
+ lg: "var(--radius)",
+ md: "calc(var(--radius) - 2px)",
+ sm: "calc(var(--radius) - 4px)",
+ },
+ keyframes: {
+ "accordion-down": {
+ from: { height: 0 },
+ to: { height: "var(--radix-accordion-content-height)" },
+ },
+ "accordion-up": {
+ from: { height: "var(--radix-accordion-content-height)" },
+ to: { height: 0 },
+ },
+ },
+ animation: {
+ "accordion-down": "accordion-down 0.2s ease-out",
+ "accordion-up": "accordion-up 0.2s ease-out",
+ },
+ },
+ },
+ plugins: [require("tailwindcss-animate")],
+};
diff --git a/frontend/technology-decisions.md b/frontend/technology-decisions.md
new file mode 100644
index 0000000000..ef7f57e73e
--- /dev/null
+++ b/frontend/technology-decisions.md
@@ -0,0 +1,13 @@
+# Technology Decisions
+
+Quick-hit list of technologies used and why, for the frontend.
+
+- [Vite](https://vitejs.dev/) - Fast dev server, great devX, and a good fit for our needs. Marimo is Javascript heavy so using any SSR framework is not necessary at the moment (although Vite does support SSR frameworks that can be added as plugins).
+- [TailwindCSS](https://tailwindcss.com/) - Utility-first CSS framework. It has a great API for theming to enforce design system consistency. Large community and ecosystem.
+- [Radix UI](https://www.radix-ui.com/) - Unstyled Component Library that's accessible and has a good API.
+- [Radix Colors](https://www.radix-ui.com/colors) - Color palette. It's a great color palette that's accessible and has a good range of colors, supporting light and dark modes.
+- [ESLint](https://eslint.org/) - Linter for Typescript. Pretty much the standard for linting.
+- [Prettier](https://prettier.io/) - Code formatter. Pretty much the standard for formatting.
+- [MSW](https://mswjs.io/) - Mocking library for API calls. Great for testing and development.
+- [Playwright](https://playwright.dev/) - E2E testing library. Great for testing and development. It's faster than Cypress and has a better API.
+- [jotai](https://jotai.org/) - State management library to avoid re-renders. Great for simple state management. It's a lot simpler than Redux and has a better API.
diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json
new file mode 100644
index 0000000000..795ada647c
--- /dev/null
+++ b/frontend/tsconfig.json
@@ -0,0 +1,113 @@
+{
+ "compilerOptions": {
+ /* Visit https://aka.ms/tsconfig to read more about this file */
+
+ /* Projects */
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
+
+ /* Language and Environment */
+ "target": "ES2019" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
+ "lib": [
+ "ES2022",
+ "DOM"
+ ] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
+ "jsx": "react-jsx" /* Specify what JSX code is generated. */,
+ "experimentalDecorators": true /* Enable experimental support for TC39 stage 2 draft decorators. */,
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
+
+ /* Modules */
+ "module": "ESNext" /* Specify what module code is generated. */,
+ "rootDir": "src" /* Specify the root folder within your source files. */,
+ "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
+ "baseUrl": "src" /* Specify the base directory to resolve non-relative module names. */,
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
+ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
+ "types": [
+ "vite/client",
+ "msw"
+ ] /* Specify type package names to be included without being referenced in a source file. */,
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
+ // "resolveJsonModule": true, /* Enable importing .json files. */
+ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
+
+ /* JavaScript Support */
+ "allowJs": true /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */,
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
+
+ /* Emit */
+ // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
+ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
+ "outDir": "build" /* Specify an output folder for all emitted files. */,
+ // "removeComments": true, /* Disable emitting comments. */
+ // "noEmit": true, /* Disable emitting files from a compilation. */
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
+ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
+ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
+ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
+
+ /* Interop Constraints */
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
+ "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
+ "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
+
+ /* Type Checking */
+ "strict": true /* Enable all strict type-checking options. */,
+ "noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied 'any' type. */,
+ "strictNullChecks": true /* When type checking, take into account 'null' and 'undefined'. */,
+ "strictFunctionTypes": true /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */,
+ "strictBindCallApply": true /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */,
+ "strictPropertyInitialization": true /* Check for class properties that are declared but not set in the constructor. */,
+ "noImplicitThis": true /* Enable error reporting when 'this' is given the type 'any'. */,
+ "useUnknownInCatchVariables": true /* Default catch clause variables as 'unknown' instead of 'any'. */,
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
+ "noUnusedLocals": true /* Enable error reporting when local variables aren't read. */,
+ // "noUnusedParameters": true /* Raise an error when a function parameter isn't read. */,
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
+ // "noImplicitReturns": true /* Enable error reporting for codepaths that do not explicitly return in a function. */,
+ "noFallthroughCasesInSwitch": true /* Enable error reporting for fallthrough cases in switch statements. */,
+ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
+ "noImplicitOverride": true /* Ensure overriding members in derived classes are marked with an override modifier. */,
+ // "noPropertyAccessFromIndexSignature": true /* Enforces using indexed accessors for keys declared using an indexed type. */,
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
+
+ /* Completeness */
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */,
+ "paths": {
+ "@/*": ["./*"]
+ }
+ },
+ "include": ["src"]
+}
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts
new file mode 100644
index 0000000000..a17e25fc63
--- /dev/null
+++ b/frontend/vite.config.ts
@@ -0,0 +1,63 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { defineConfig, Plugin } from "vite";
+import react from "@vitejs/plugin-react-swc";
+import tsconfigPaths from "vite-tsconfig-paths";
+
+const htmlDevPlugin = (): Plugin => {
+ return {
+ apply: "serve",
+ name: "html-transform",
+ transformIndexHtml(html) {
+ return html
+ .replace(`{{ filename }}`, `dev-mode`)
+ .replace(`{{ mode }}`, `"edit"`)
+ .replace(
+ `{{ config }}`,
+ JSON.stringify({
+ completion: {
+ activate_on_typing: false,
+ },
+ save: {
+ autosave: "off",
+ autosave_delay: 0,
+ },
+ })
+ )
+ .replace(`{{ title }}`, `dev-mode`);
+ },
+ };
+};
+
+const SERVER_PORT = process.env.SERVER_PORT || 2718;
+
+// https://vitejs.dev/config/
+export default defineConfig({
+ server: {
+ host: "localhost",
+ port: 3000,
+ proxy: {
+ "/api": {
+ target: `http://localhost:${SERVER_PORT}`,
+ changeOrigin: true,
+ },
+ "/iosocket": {
+ target: `ws://localhost:${SERVER_PORT}`,
+ ws: true,
+ changeOrigin: true,
+ headers: {
+ origin: `http://localhost:${SERVER_PORT}`,
+ },
+ },
+ },
+ },
+ resolve: {
+ dedupe: ["react", "react-dom", "@emotion/react", "@emotion/cache"],
+ },
+ plugins: [
+ htmlDevPlugin(),
+ react({
+ tsDecorators: true,
+ }),
+ tsconfigPaths(),
+ ],
+});
diff --git a/frontend/vite.lib.config.ts b/frontend/vite.lib.config.ts
new file mode 100644
index 0000000000..b63ed465a7
--- /dev/null
+++ b/frontend/vite.lib.config.ts
@@ -0,0 +1,25 @@
+import { defineConfig } from "vite";
+import { resolve } from "path";
+import react from "@vitejs/plugin-react-swc";
+import tsconfigPaths from "vite-tsconfig-paths";
+
+// https://vitejs.dev/config/
+/**
+ * Vite config for building the Marimo library.
+ */
+export default defineConfig({
+ build: {
+ lib: {
+ // Could also be a dictionary or array of multiple entry points
+ entry: resolve(__dirname, "src/index.ts"),
+ formats: ["cjs"],
+ fileName: "marimo",
+ },
+ outDir: "lib",
+ rollupOptions: {
+ // Externalize deps that shouldn't be bundled into the library.
+ external: ["react", "react-dom"],
+ },
+ },
+ plugins: [react(), tsconfigPaths()],
+});
diff --git a/frontend/vitest.config.ts b/frontend/vitest.config.ts
new file mode 100644
index 0000000000..a353a0911e
--- /dev/null
+++ b/frontend/vitest.config.ts
@@ -0,0 +1,11 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { defineConfig } from "vitest/config";
+import tsconfigPaths from "vite-tsconfig-paths";
+
+export default defineConfig({
+ test: {
+ environment: "jsdom",
+ include: ["src/**/*.test.ts"],
+ },
+ plugins: [tsconfigPaths()],
+});
diff --git a/marimo/__init__.py b/marimo/__init__.py
new file mode 100644
index 0000000000..983b571cca
--- /dev/null
+++ b/marimo/__init__.py
@@ -0,0 +1,46 @@
+# Copyright 2023 Marimo. All rights reserved.
+"""The marimo library.
+
+marimo is a Python library for making reactive notebooks that double as apps.
+
+marimo is designed to be:
+
+ 1. simple
+ 2. immersive
+ 3. interactive
+ 4. seamless
+ 5. fun
+"""
+
+__all__ = [
+ "App",
+ "accordion",
+ "as_html",
+ "callout",
+ "config",
+ "defs",
+ "doc",
+ "hstack",
+ "Html",
+ "md",
+ "refs",
+ "tabs",
+ "tree",
+ "ui",
+ "vstack",
+]
+__version__ = "0.1.0"
+
+from marimo import config
+from marimo._ast.app import App
+from marimo._output.doc import doc
+from marimo._output.formatting import as_html
+from marimo._output.hypertext import Html
+from marimo._output.md import md
+from marimo._plugins import ui
+from marimo._plugins.stateless.accordion import accordion
+from marimo._plugins.stateless.callout_output import callout
+from marimo._plugins.stateless.flex import hstack, vstack
+from marimo._plugins.stateless.tabs import tabs
+from marimo._plugins.stateless.tree import tree
+from marimo._runtime.runtime import defs, refs
diff --git a/marimo/__main__.py b/marimo/__main__.py
new file mode 100644
index 0000000000..5999ce9287
--- /dev/null
+++ b/marimo/__main__.py
@@ -0,0 +1,5 @@
+# Copyright 2023 Marimo. All rights reserved.
+from marimo._cli.cli import main
+
+if __name__ == "__main__":
+ main(prog_name="marimo")
diff --git a/marimo/_ast/__init__.py b/marimo/_ast/__init__.py
new file mode 100644
index 0000000000..618f22fc54
--- /dev/null
+++ b/marimo/_ast/__init__.py
@@ -0,0 +1 @@
+# Copyright 2023 Marimo. All rights reserved.
diff --git a/marimo/_ast/app.py b/marimo/_ast/app.py
new file mode 100644
index 0000000000..a5404667f7
--- /dev/null
+++ b/marimo/_ast/app.py
@@ -0,0 +1,197 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import builtins
+import itertools
+import textwrap
+from collections.abc import Sequence
+from typing import Any, Optional
+
+from marimo._ast.cell import (
+ CellFunction,
+ CellId_t,
+ cell_factory,
+ cell_func_t,
+ execute_cell,
+)
+from marimo._ast.errors import (
+ CycleError,
+ DeleteNonlocalError,
+ MultipleDefinitionError,
+ UnparsableError,
+)
+from marimo._output.rich_help import mddoc
+from marimo._runtime.dataflow import DirectedGraph, topological_sort
+
+
+@mddoc
+class App:
+ """A marimo app.
+
+ A marimo app is a dataflow graph, with each node computing a Python
+ function.
+
+ This class has no public API, but this may change in the future.
+ """
+
+ def __init__(self) -> None:
+ # cell is unparsable <=> its value in self._cell_functions is None
+ self._cell_functions: dict[CellId_t, Optional[CellFunction]] = {}
+ self._cell_names: dict[CellId_t, str] = {}
+ self._codes: dict[CellId_t, str] = {}
+ self._registration_order: list[CellId_t] = []
+
+ self._cell_id_counter = 0
+ self._unparsable = False
+ self._initialized = False
+
+ def _create_cell_id(
+ self, cell_function: Optional[CellFunction]
+ ) -> CellId_t:
+ del cell_function
+ cell_id = str(self._cell_id_counter)
+ self._registration_order.append(cell_id)
+ self._cell_id_counter += 1
+ return str(cell_id)
+
+ def cell(self, f: cell_func_t) -> CellFunction:
+ cell_function = cell_factory(f)
+ cell_id = self._create_cell_id(cell_function)
+ self._cell_functions[cell_id] = cell_function
+ self._cell_names[cell_id] = f.__name__
+ self._codes[cell_id] = cell_function.cell.code
+ return cell_function
+
+ def _validate_args(self) -> None:
+ """Validate the args of each cell function.
+
+ Args should match cell.refs, excluding builtins that haven't been
+ shadowed by other cells.
+
+ This function must be called after all cells have been parsed, because
+ it's only then that we know the set of unshadowed builtins.
+
+ Raises: ValueError if a cell has an invalid arg set.
+ """
+ defs = set(
+ itertools.chain.from_iterable(
+ f.cell.defs
+ for f in self._cell_functions.values()
+ if f is not None
+ )
+ )
+ unshadowed_builtins = set(builtins.__dict__.keys()).difference(defs)
+ for f in self._cell_functions.values():
+ if f is None:
+ continue
+ expected_args = f.cell.refs - unshadowed_builtins
+ if f.args != expected_args:
+ suggested_sig = (
+ f"def {f.__name__}({', '.join(sorted(expected_args))}):"
+ )
+ raise ValueError(
+ "A cell must take all its refs as args. "
+ "This rule is violated by the following function:\n\n"
+ + textwrap.indent(f.code, prefix=" ")
+ + "\n"
+ f"Fix: Make '{suggested_sig}' this function's signature."
+ )
+
+ def _unparsable_cell(self, code: str, name: Optional[str] = None) -> None:
+ cell_id = self._create_cell_id(None)
+ self._cell_names[cell_id] = name if name is not None else "__"
+ # - code.split("\n")[1:-1] disregards first and last lines, which are
+ # empty
+ # - line[4:] removes leading indent in multiline string
+ # - replace(...) unescapes double quotes
+ # - rstrip() removes an extra newline
+ code = "\n".join(
+ [line[4:].replace('\\"', '"') for line in code.split("\n")[1:-1]]
+ )
+ self._codes[cell_id] = code
+ self._unparsable = True
+
+ def _maybe_initialize(self) -> None:
+ assert not self._unparsable
+ if not self._initialized:
+ # ids of cells to add to the graph, in the order that they
+ # were registered with the app
+ self._cell_ids = [
+ # exclude unparseable cells from graph
+ cid
+ for cid, f in self._cell_functions.items()
+ if f is not None
+ ]
+ self._graph = DirectedGraph()
+ for cell_id in self._cell_ids:
+ cell_function = self._cell_functions[cell_id]
+ assert cell_function is not None
+ self._graph.register_cell(cell_id, cell_function.cell)
+ self._defs = self._graph.definitions.keys()
+
+ # these two helper functions could be written as concise
+ # `any` expressions using assignment expressions, but
+ # that's a silly reason to make Python < 3.8 incompatible
+ # with marimo.
+ def get_multiply_defined() -> Optional[str]:
+ for name, definers in self._graph.definitions.items():
+ if len(definers) > 1:
+ return name
+ return None
+
+ def get_deleted_nonlocal_ref() -> Optional[str]:
+ for cell in self._graph.cells.values():
+ for ref in cell.deleted_refs:
+ if ref in self._graph.definitions:
+ return ref
+ return None
+
+ try:
+ if self._graph.cycles:
+ raise CycleError(
+ "This app can't be run because it has cycles."
+ )
+ name = get_multiply_defined()
+ if name is not None:
+ raise MultipleDefinitionError(
+ "This app can't be run because it has multiple "
+ f"definitions of the name {name}"
+ )
+ ref = get_deleted_nonlocal_ref()
+ if ref is not None:
+ raise DeleteNonlocalError(
+ "This app can't be run because at least one cell "
+ f"deletes one of its refs (the ref's name is {ref})"
+ )
+ self._execution_order = topological_sort(
+ self._graph, self._cell_ids
+ )
+ finally:
+ self._initialized = True
+
+ def run(self) -> tuple[Sequence[Any], dict[str, Any]]:
+ if self._unparsable:
+ raise UnparsableError(
+ "This app can't be run because it has unparsable cells."
+ )
+
+ self._maybe_initialize()
+ glbls: dict[Any, Any] = {}
+ outputs = {
+ cid: execute_cell(cell_function.cell, glbls)
+ for cid in self._execution_order
+ if (cell_function := self._cell_functions[cid]) is not None
+ }
+ # Return
+ # - the outputs, sorted in the order that cells were added to the
+ # graph
+ # - dict of defs -> values
+ return (
+ tuple(
+ outputs[cid]
+ for cid in self._registration_order
+ # exclude unparseable cells
+ if cid in outputs
+ ),
+ {name: glbls[name] for name in self._defs},
+ )
diff --git a/marimo/_ast/cell.py b/marimo/_ast/cell.py
new file mode 100644
index 0000000000..875fc4cac8
--- /dev/null
+++ b/marimo/_ast/cell.py
@@ -0,0 +1,330 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import ast
+import functools
+import inspect
+import io
+import textwrap
+import token as token_types
+from collections.abc import Iterator
+from dataclasses import dataclass
+from tokenize import TokenInfo, tokenize
+from types import CodeType
+from typing import Any, Callable, Optional, Protocol, Set, Tuple, Union, cast
+
+from marimo._ast.visitor import Name, ScopedVisitor, _is_local
+
+CellId_t = str
+
+
+def code_key(code: str) -> int:
+ return hash(code)
+
+
+@dataclass(frozen=True)
+class Cell:
+ key: int
+ code: str
+ mod: ast.Module
+ defs: set[Name]
+ refs: set[Name]
+ deleted_refs: set[Name]
+
+ body: Optional[CodeType]
+ last_expr: Optional[CodeType]
+
+
+cell_func_t = Callable[..., Optional[Tuple[Any, ...]]]
+
+
+class CellFunction(Protocol):
+ cell: Cell
+ # function name
+ __name__: str
+ # function code
+ code: str
+ # arg names of wrapped function
+ args: set[str]
+ __call__: cell_func_t
+
+
+def cell_function(
+ cell: Cell, args: set[str], code: str, f: cell_func_t
+) -> CellFunction:
+ signature = inspect.signature(f)
+
+ n_args = 0
+ defaults = {}
+ for name, value in signature.parameters.items():
+ if value.default != inspect.Parameter.empty:
+ defaults[name] = value.default
+ else:
+ n_args += 1
+
+ parameters = list(signature.parameters.keys())
+ return_names = sorted(cell.defs)
+
+ @functools.wraps(f)
+ def func(*args: Any, **kwargs: Any) -> tuple[Any, ...]:
+ """Wrapper for executing cell using the function's signature.
+
+ Alternative for passing a globals dict
+ """
+ glbls = {}
+ glbls.update(defaults)
+ pos = 0
+ for arg in args:
+ glbls[parameters[pos]] = arg
+ pos += 1
+ if pos < n_args:
+ raise TypeError(
+ f.__name__
+ + f"() missing {n_args - pos} required arguments: "
+ + " and ".join(f"'{p}'" for p in parameters[pos:n_args])
+ )
+
+ for kwarg, value in kwargs.items():
+ if kwarg not in parameters:
+ raise TypeError(
+ f.__name__
+ + "() got an unexpected keyword argument '{kwarg}'"
+ )
+ else:
+ glbls[kwarg] = value
+
+ # we use execute_cell instead of calling `f` directly because
+ # we want to obtain the cell's HTML output, which is the last
+ # expression in the cell body.
+ #
+ # TODO: stash output if mo.collect_outputs() context manager is active
+ # ... or just make cell execution return the output in addition
+ # to the defs, which might be weird because that doesn't
+ # match the function signature
+ _ = execute_cell(cell, glbls)
+ return tuple(glbls[name] for name in return_names)
+
+ cell_func = cast(CellFunction, func)
+ cell_func.cell = cell
+ cell_func.args = args
+ cell_func.code = code
+ return cell_func
+
+
+def parse_cell(
+ code: str, filename: str = "<string>", cell_id: Optional[CellId_t] = None
+) -> Cell:
+ mod = ast.parse(code, mode="exec")
+ if not mod.body:
+ # either empty code or just comments
+ return Cell(
+ key=hash(""),
+ code=code,
+ mod=mod,
+ defs=set(),
+ refs=set(),
+ deleted_refs=set(),
+ body=None,
+ last_expr=None,
+ )
+
+ v = ScopedVisitor("cell_" + str(cell_id) if cell_id is not None else None)
+ v.visit(mod)
+
+ expr: Union[ast.Expression, str]
+ if isinstance(mod.body[-1], ast.Expr):
+ expr = ast.Expression(mod.body.pop().value) # type: ignore
+ else:
+ expr = "None"
+ last_expr = compile(expr, filename, mode="eval")
+ body = compile(mod, filename, mode="exec")
+
+ glbls = {name for name in v.defs if not _is_local(name)}
+ return Cell(
+ # keyed by original (user) code, for cache lookups
+ key=code_key(code),
+ code=code,
+ mod=mod,
+ defs=glbls,
+ refs=v.refs,
+ deleted_refs=v.deleted_refs,
+ body=body,
+ last_expr=last_expr,
+ )
+
+
+def is_ws(char: str) -> bool:
+ return char == " " or char == "\n" or char == "\t"
+
+
+def cell_factory(f: Callable[..., Any]) -> CellFunction:
+ function_code = textwrap.dedent(inspect.getsource(f))
+
+ # tokenize to find the start of the function body, including
+ # comments --- we have to use tokenize because the ast treats the first
+ # line of code as the starting line of the function body, whereas we
+ # want the first indented line after the signature
+ tokens: Iterator[TokenInfo] = tokenize(
+ io.BytesIO(function_code.encode("utf-8")).readline
+ )
+
+ def_node: Optional[TokenInfo] = None
+ for token in tokens:
+ if token.type == token_types.NAME and token.string == "def":
+ def_node = token
+ break
+ assert def_node is not None
+
+ paren_counter: Optional[int] = None
+ for token in tokens:
+ if token.type == token_types.OP and token.string == "(":
+ paren_counter = 1 if paren_counter is None else paren_counter + 1
+ elif token.type == token_types.OP and token.string == ")":
+ assert paren_counter is not None
+ paren_counter -= 1
+
+ if paren_counter == 0:
+ break
+ assert paren_counter == 0
+
+ for token in tokens:
+ if token.type == token_types.OP and token.string == ":":
+ break
+
+ after_colon = next(tokens)
+ start_line: int
+ start_col: int
+ if after_colon.type == token_types.NEWLINE:
+ fn_body_token = next(tokens)
+ start_line = fn_body_token.start[0] - 1
+ start_col = 0
+ elif after_colon.type == token_types.COMMENT:
+ newline_token = next(tokens)
+ assert newline_token.type == token_types.NEWLINE
+ fn_body_token = next(tokens)
+ start_line = fn_body_token.start[0] - 1
+ start_col = 0
+ else:
+ # function body starts on same line as definition, such as in
+ # the following examples:
+ #
+ # def foo(): pass
+ #
+ # def foo(): x = 0; return x
+ #
+ # def foo(): x = """
+ #
+ # """; return x
+ fn_body_token = after_colon
+ start_line = fn_body_token.start[0] - 1
+ start_col = fn_body_token.start[1]
+
+ # it would be difficult to tell if the last return token were in fact the
+ # last statement of the function body, so we use the ast, which lets us
+ # easily find the last statement of the function body;
+ tree = ast.parse(function_code)
+ return_node = (
+ tree.body[0].body[-1] # type: ignore
+ if isinstance(tree.body[0].body[-1], ast.Return) # type: ignore
+ else None
+ )
+
+ end_line, return_offset = (
+ (return_node.lineno - 1, return_node.col_offset)
+ if return_node is not None
+ else (None, None)
+ )
+
+ cell_code: str
+ lines = function_code.split("\n")
+ if start_line == end_line:
+ # remove leading indentation
+ cell_code = textwrap.dedent(lines[start_line][start_col:return_offset])
+ else:
+ first_line = lines[start_line][start_col:]
+ cell_code = textwrap.dedent(
+ "\n".join([first_line] + lines[start_line + 1 : end_line])
+ )
+ if end_line is not None and not lines[end_line].strip().startswith(
+ "return"
+ ):
+ # handle return written on same line as last statement in cell
+ cell_code += "\n" + lines[end_line][:return_offset]
+
+ arg_names = set(p.arg for p in tree.body[0].args.args) # type: ignore
+ ret = cell_function(
+ parse_cell(cell_code), cast(Set[str], arg_names), function_code, f
+ )
+ cell = ret.cell
+
+ # signature validation: we make sure that all defs are returned, and all
+ # refs are taken as inputs, so that the function code is consistent
+ # with its representation as a marimo app.
+ if cell.defs and return_node is None:
+ suggested_return = "return " + ", ".join(sorted(cell.defs))
+ raise ValueError(
+ "The following function is missing a return statement:\n\n"
+ + textwrap.indent(function_code, prefix=" ")
+ + "\n"
+ + f"Fix: Make '{suggested_return}' its last line.\n\n"
+ )
+ elif cell.defs and return_node is not None:
+ if not isinstance(return_node.value, ast.Tuple):
+ raise ValueError(
+ "A cell must return a tuple of defs. "
+ "This rule is violated by the following function:\n\n"
+ + textwrap.indent(function_code, prefix=" ")
+ + "\n"
+ + "Fix: Change the return type to be a tuple."
+ )
+ names = set(elt.id for elt in return_node.value.elts) # type: ignore
+ local_names = tuple(name for name in names if _is_local(name))
+ if local_names:
+ raise ValueError(
+ "Names starting with underscores should not be returned by "
+ "a cell. This rule is violated by the following function:\n\n"
+ + textwrap.indent(function_code, prefix=" ")
+ + "\n"
+ + f"Fix: Remove {local_names} from this function's returns."
+ )
+
+ if names != cell.defs:
+ suggested_return = "return " + ", ".join(sorted(cell.defs))
+ raise ValueError(
+ "A cell must return a tuple of all its "
+ "defs. This rule is violated by the following function:\n\n"
+ + textwrap.indent(function_code, prefix=" ")
+ + "\n"
+ + f"Fix: Make '{suggested_return}' this function's last line."
+ )
+ elif not cell.defs and return_node is not None:
+ if return_node.value is not None:
+ raise ValueError(
+ "The following function shouldn't return anything, since "
+ "it doesn't define any variables:\n\n"
+ + textwrap.indent(function_code, prefix=" ")
+ + "\n"
+ + "Fix: Don't return anything from this function."
+ )
+
+ local_names = tuple(name for name in arg_names if _is_local(name))
+ if local_names:
+ raise ValueError(
+ "Names starting with underscores should not be taken as "
+ "parameters. This rule is violated by the following function:\n\n"
+ + textwrap.indent(function_code, prefix=" ")
+ + "\n"
+ + f"Fix: Remove {local_names} from this function's argument list."
+ )
+
+ # NB: args can't be validated here, because we need to know which builtins
+ # have been shadowed by other cells, if any.
+ return ret
+
+
+def execute_cell(cell: Cell, glbls: dict[Any, Any]) -> Any:
+ if cell.body is None:
+ return None
+ assert cell.last_expr is not None
+ exec(cell.body, glbls)
+ return eval(cell.last_expr, glbls)
diff --git a/marimo/_ast/codegen.py b/marimo/_ast/codegen.py
new file mode 100644
index 0000000000..15dcfce0fa
--- /dev/null
+++ b/marimo/_ast/codegen.py
@@ -0,0 +1,171 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import builtins
+import importlib.util
+import json
+from collections.abc import Sequence
+from typing import Optional, Union
+
+from marimo import __version__
+from marimo._ast.app import App
+from marimo._ast.cell import Cell, parse_cell
+from marimo._ast.visitor import Name
+
+INDENT = " "
+
+
+def indent_text(text: str) -> str:
+ return "\n".join(
+ [INDENT + line if line else line for line in text.split("\n")]
+ )
+
+
+def _multiline_tuple(elems: Sequence[str]) -> str:
+ if elems:
+ return "(" + "\n" + indent_text(",\n".join(elems)) + ",\n)"
+ else:
+ return "()"
+
+
+def to_functiondef(
+ cell: Cell, name: str, unshadowed_builtins: Optional[set[Name]] = None
+) -> str:
+ # unshadowed builtins is the set of builtins that haven't been
+ # overriden (shadowed) by other cells in the app. These names
+ # should not be taken as args by a cell's functiondef (since they are
+ # already in globals)
+ if unshadowed_builtins is None:
+ unshadowed_builtins = set(builtins.__dict__.keys())
+ refs = [ref for ref in sorted(cell.refs) if ref not in unshadowed_builtins]
+ args = ", ".join(refs)
+
+ decorator = "@app.cell"
+ signature = f"def {name}({args}):"
+ if len(INDENT + signature) >= 80:
+ signature = f"def {name}{_multiline_tuple(refs)}:"
+ fndef = decorator + "\n" + signature + "\n"
+ body = indent_text(cell.code)
+ if body:
+ fndef += body + "\n"
+
+ if cell.defs:
+ defs = tuple(name for name in sorted(cell.defs))
+ returns = INDENT + "return "
+ if len(cell.defs) == 1:
+ returns += f"{defs[0]},"
+ else:
+ returns += ", ".join(defs)
+ fndef += (
+ returns
+ if len(INDENT + returns) <= 80
+ else (indent_text("return " + _multiline_tuple(defs)))
+ )
+ else:
+ fndef += INDENT + "return"
+ return fndef
+
+
+def generate_unparseable_cell(code: str, name: Optional[str]) -> str:
+ # escape double quotes to not interfere with string
+ quote_escaped_code = code.replace('"', '\\"')
+ # use r-string to handle backslashes (don't want to write
+ # escape characters, want to actually write backslash characters)
+ code_as_str = f'r"""\n{quote_escaped_code}\n"""'
+ if name is None:
+ return "app._unparsable_cell(\n" + indent_text(code_as_str) + "\n)"
+ else:
+ return (
+ "app._unparsable_cell(\n"
+ + indent_text(code_as_str)
+ + ",\n"
+ + INDENT
+ + f'name="{name}"'
+ + "\n)"
+ )
+
+
+def generate_filecontents(codes: list[str], names: list[str]) -> str:
+ """Translates a sequences of codes (cells) to a Python file"""
+ cell_function_data: list[Union[Cell, str]] = []
+ defs: set[Name] = set()
+
+ for code in codes:
+ try:
+ cell = parse_cell(code)
+ defs |= cell.defs
+ cell_function_data.append(cell)
+ except SyntaxError:
+ cell_function_data.append(code)
+
+ unshadowed_builtins = set(builtins.__dict__.keys()) - defs
+ fndefs: list[str] = []
+ for data, name in zip(cell_function_data, names):
+ if isinstance(data, Cell):
+ fndefs.append(to_functiondef(data, name, unshadowed_builtins))
+ else:
+ fndefs.append(generate_unparseable_cell(data, name))
+
+ filecontents = (
+ "import marimo"
+ + "\n\n"
+ + f'__generated_with = "{__version__}"'
+ + "\n"
+ + "app = marimo.App()"
+ + "\n\n\n"
+ + "\n\n\n".join(fndefs)
+ + "\n\n\n"
+ + 'if __name__ == "__main__":'
+ + "\n"
+ + indent_text("app.run()")
+ )
+
+ return filecontents + "\n"
+
+
+class MarimoFileError(Exception):
+ pass
+
+
+# TODO refactor to return cell_ids as well?
+def get_codes(filename: Optional[str]) -> tuple[list[str], list[str]]:
+ """Get lists of codes and names from a marimo-generated module"""
+ if filename is None:
+ return [""], ["__"]
+
+ with open(filename, "r", encoding="utf-8") as f:
+ contents = f.read().strip()
+
+ if not contents:
+ return [""], ["__"]
+
+ spec = importlib.util.spec_from_file_location("marimo_app", filename)
+ if spec is None:
+ raise RuntimeError("Failed to load module spec")
+ marimo_app = importlib.util.module_from_spec(spec)
+ if spec.loader is None:
+ raise RuntimeError("Failed to load module spec's loader")
+ spec.loader.exec_module(marimo_app)
+ if not hasattr(marimo_app, "app"):
+ raise MarimoFileError(f"{filename} missing attribute `app`.")
+ if not isinstance(marimo_app.app, App):
+ raise MarimoFileError("`app` attribute must be of type `marimo.App`.")
+
+ marimo_app.app._validate_args()
+ return list(marimo_app.app._codes.values()), list(
+ marimo_app.app._cell_names.values()
+ )
+
+
+RECOVERY_CELL_MARKER = "ↁ"
+
+
+def recover(filename: str) -> str:
+ """Generate a module for code recovered from a disconnected frontend"""
+ with open(filename, "r") as f:
+ contents = f.read()
+ cells = json.loads(contents)["cells"]
+ codes, names = tuple(
+ zip(*[(cell["code"], cell["name"]) for cell in cells])
+ )
+ return generate_filecontents(codes, names)
diff --git a/marimo/_ast/errors.py b/marimo/_ast/errors.py
new file mode 100644
index 0000000000..b978589d6a
--- /dev/null
+++ b/marimo/_ast/errors.py
@@ -0,0 +1,15 @@
+# Copyright 2023 Marimo. All rights reserved.
+class CycleError(Exception):
+ pass
+
+
+class MultipleDefinitionError(Exception):
+ pass
+
+
+class DeleteNonlocalError(Exception):
+ pass
+
+
+class UnparsableError(Exception):
+ pass
diff --git a/marimo/_ast/test_app.py b/marimo/_ast/test_app.py
new file mode 100644
index 0000000000..32a52e455f
--- /dev/null
+++ b/marimo/_ast/test_app.py
@@ -0,0 +1,234 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import pytest
+
+from marimo._ast.app import App
+from marimo._ast.errors import (
+ CycleError,
+ DeleteNonlocalError,
+ MultipleDefinitionError,
+ UnparsableError,
+)
+
+
+# don't complain for useless expressions (cell outputs)
+# ruff: noqa: B018
+class TestApp:
+ @staticmethod
+ def test_run() -> None:
+ app = App()
+
+ @app.cell
+ def one() -> tuple[int]:
+ x = 0
+ x
+ return (x,)
+
+ @app.cell
+ def two(x: int, z: int) -> tuple[int]:
+ a = x + z
+ a + 1
+ return (a,)
+
+ @app.cell
+ def __(x: int) -> tuple[int, int]:
+ y = x + 1
+ z = y + 1
+ return y, z
+
+ cell_names = tuple(app._cell_names.values())
+ assert cell_names[0] == "one"
+ assert cell_names[1] == "two"
+ assert cell_names[2] == "__"
+
+ codes = tuple(app._codes.values())
+ assert codes[0] == "x = 0\nx"
+ assert codes[1] == "a = x + z\na + 1"
+ assert codes[2] == "y = x + 1\nz = y + 1"
+
+ outputs, defs = app.run()
+
+ assert outputs[0] == defs["x"]
+ assert outputs[1] == defs["a"] + 1
+ assert outputs[2] is None
+
+ assert defs["x"] == 0
+ assert (defs["y"], defs["z"]) == (1, 2)
+ assert defs["a"] == 2
+
+ @staticmethod
+ def test_cycle() -> None:
+ app = App()
+
+ @app.cell
+ def one(y: int) -> tuple[int]:
+ x = y
+ return (x,)
+
+ @app.cell
+ def two(x: int) -> tuple[int]:
+ y = x
+ return (y,)
+
+ with pytest.raises(CycleError):
+ app.run()
+
+ @staticmethod
+ def test_multiple_definitions() -> None:
+ app = App()
+
+ @app.cell
+ def one() -> tuple[int]:
+ x = 0
+ return (x,)
+
+ @app.cell
+ def two() -> tuple[int]:
+ x = 0
+ return (x,)
+
+ with pytest.raises(MultipleDefinitionError):
+ app.run()
+
+ @staticmethod
+ def test_delete_nonlocal() -> None:
+ app = App()
+
+ @app.cell
+ def one() -> tuple[int]:
+ x = 0
+ return (x,)
+
+ @app.cell
+ def two(x: int) -> None:
+ del x
+ return
+
+ with pytest.raises(DeleteNonlocalError):
+ app.run()
+
+ @staticmethod
+ def test_unparsable_cell() -> None:
+ app = App()
+
+ @app.cell
+ def one() -> tuple[int]:
+ x = 0
+ return (x,)
+
+ app._unparsable_cell("_ _")
+ app._unparsable_cell("_ _", name="foo")
+
+ with pytest.raises(UnparsableError):
+ app.run()
+
+ @staticmethod
+ def test_init_not_rewritten_as_local() -> None:
+ app = App()
+
+ @app.cell
+ def _() -> tuple[int]:
+ class _A:
+ def __init__(self, x: int) -> None:
+ self.x = x
+
+ y = _A(10).x
+ return (y,)
+
+ _, defs = app.run() # type: ignore
+ assert defs == {"y": 10}
+
+ @staticmethod
+ def test_ref_local_var_from_nested_scope() -> None:
+ app = App()
+
+ @app.cell
+ def _() -> tuple[int]:
+ _x = 10
+
+ def _f() -> int:
+ return _x
+
+ y = _f()
+ return (y,)
+
+ _, defs = app.run() # type: ignore
+ assert defs == {"y": 10}
+
+ @staticmethod
+ def test_resolve_var_not_local_from_nested_scope() -> None:
+ app = App()
+
+ @app.cell
+ def _() -> tuple[str]:
+ _x = 10 # noqa: F841
+
+ def _f() -> str:
+ _x = "nested"
+ return _x
+
+ y = _f()
+ return (y,)
+
+ _, defs = app.run() # type: ignore
+ assert defs == {"y": "nested"}
+
+ @staticmethod
+ def test_resolve_make_local_with_global_keywd() -> None:
+ app = App()
+
+ @app.cell
+ def _() -> tuple[str]:
+ def _f() -> str:
+ global _x
+ _x = "nested" # type: ignore
+ return _x # type: ignore
+
+ y = _f()
+ return (y,)
+
+ @app.cell
+ def _() -> None:
+ _x # type: ignore # noqa: F821
+ return
+
+ with pytest.raises(NameError) as e:
+ app.run()
+
+ assert "'_x' is not defined" in str(e.value)
+
+ @staticmethod
+ def test_locals_dont_leak() -> None:
+ app = App()
+
+ @app.cell
+ def _() -> None:
+ _x = 0 # noqa: F841
+ return
+
+ @app.cell
+ def _() -> None:
+ _x # type: ignore
+ return
+
+ with pytest.raises(NameError) as e:
+ app.run()
+
+ assert "'_x' is not defined" in str(e.value)
+
+ @staticmethod
+ def test_dunder_dunder_not_local() -> None:
+ app = App()
+
+ @app.cell
+ def _() -> tuple[int]:
+ __x__ = 0
+ return (__x__,)
+
+ @app.cell
+ def _(__x__: int) -> None:
+ assert __x__ == 0
+ return
+
+ app.run()
diff --git a/marimo/_ast/test_cell.py b/marimo/_ast/test_cell.py
new file mode 100644
index 0000000000..016144b783
--- /dev/null
+++ b/marimo/_ast/test_cell.py
@@ -0,0 +1,145 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import pytest
+
+from marimo._ast.app import App
+from marimo._ast.cell import cell_factory, parse_cell
+
+
+class TestParseCell:
+ @staticmethod
+ def test_parse_simple() -> None:
+ code = "x = 0\nz = y"
+ cell = parse_cell(code)
+ assert cell.key == hash(code)
+ assert cell.code == code
+ assert cell.defs == set(["x", "z"])
+ assert cell.refs == set(["y"])
+
+ @staticmethod
+ def test_local_variables() -> None:
+ code = "_, y = f(x)\ndef _foo():\n _bar = 0\nimport _secret_module"
+ cell = parse_cell(code)
+ assert cell.defs == {"y"}
+ assert cell.refs == {"f", "x"}
+
+ @staticmethod
+ def test_dunder_dunder_excluded() -> None:
+ code = "__ = 10; __name__ = 20"
+ cell = parse_cell(code)
+ assert cell.defs == {"__", "__name__"}
+ assert cell.refs == set()
+
+ @staticmethod
+ def test_local_class() -> None:
+ code = "class _A: pass"
+ cell = parse_cell(code)
+ assert cell.defs == set()
+ assert cell.refs == set()
+
+ @staticmethod
+ def test_alias_underscored_name() -> None:
+ code = "import _m as m"
+ cell = parse_cell(code)
+ assert cell.defs == {"m"}
+ assert cell.refs == set()
+
+ @staticmethod
+ def test_ref_local_var() -> None:
+ code = "x = _y"
+ cell = parse_cell(code)
+ assert cell.defs == {"x"}
+ assert cell.refs == set()
+
+ code = "def f(x= _y): pass"
+ cell = parse_cell(code)
+ assert cell.defs == {"f"}
+ assert cell.refs == set()
+
+
+class TestCellFactory:
+ @staticmethod
+ def test_missing_return() -> None:
+ def f() -> None:
+ x = 10 # noqa: F841
+
+ with pytest.raises(ValueError) as e:
+ cell_factory(f)
+
+ assert "missing a return statement" in str(e.value)
+
+ @staticmethod
+ def test_not_tuple() -> None:
+ def f() -> int:
+ x = 10 # noqa: F841
+ return x
+
+ with pytest.raises(ValueError) as e:
+ cell_factory(f)
+
+ assert "must return a tuple" in str(e.value)
+
+ @staticmethod
+ def test_missing_some_defs() -> None:
+ def f() -> tuple[int]:
+ x = 10
+ y = x # noqa: F841
+ return (x,)
+
+ with pytest.raises(ValueError) as e:
+ cell_factory(f)
+
+ assert "must return a tuple of all its defs" in str(e.value)
+
+ @staticmethod
+ def test_missing_some_refs() -> None:
+ z = 0
+
+ app = App()
+
+ @app.cell
+ def f(y: int) -> tuple[int]:
+ x = y + z
+ return (x,)
+
+ with pytest.raises(ValueError) as e:
+ app._validate_args()
+
+ assert "must take all its refs as args" in str(e.value)
+
+ @staticmethod
+ def test_extra_returns() -> None:
+ def f() -> int:
+ return 1
+
+ with pytest.raises(ValueError) as e:
+ cell_factory(f)
+
+ assert "shouldn't return anything" in str(e.value)
+
+ @staticmethod
+ def return_local_variable() -> None:
+ def f() -> tuple[int]:
+ _x = 0
+ return (_x,)
+
+ with pytest.raises(ValueError) as e:
+ cell_factory(f)
+
+ assert "Names starting with underscores should not be returned" in str(
+ e.value
+ )
+
+ @staticmethod
+ def local_variable_as_arg() -> None:
+ def f(_x: int) -> None:
+ return
+
+ with pytest.raises(ValueError) as e:
+ cell_factory(f)
+
+ assert (
+ "Names starting with underscores should not be taken as "
+ "parameters" in str(e.value)
+ )
diff --git a/marimo/_ast/test_codegen.py b/marimo/_ast/test_codegen.py
new file mode 100644
index 0000000000..ba0f7f19ee
--- /dev/null
+++ b/marimo/_ast/test_codegen.py
@@ -0,0 +1,321 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import json
+import os
+import tempfile
+from inspect import cleandoc
+
+from marimo import __version__
+from marimo._ast import codegen
+from marimo._ast.cell import parse_cell
+
+DIR_PATH = os.path.dirname(os.path.realpath(__file__))
+
+
+def get_expected_filecontents(name: str) -> str:
+ with open(
+ os.path.join(DIR_PATH, f"../_test_utils/codegen_data/{name}.py"), "r"
+ ) as f:
+ contents = f.read()
+ lines = contents.split("\n")
+ break_index = None
+ for i, line in enumerate(lines):
+ if line.startswith("__generated_with"):
+ break_index = i
+ break
+ assert break_index is not None
+ return "\n".join(
+ lines[:break_index]
+ + [f'__generated_with = "{__version__}"']
+ + lines[break_index + 1 :]
+ )
+
+
+def get_filepath(name: str) -> str:
+ return os.path.join(DIR_PATH, f"../_test_utils/codegen_data/{name}.py")
+
+
+class TestGeneration:
+ @staticmethod
+ def test_generate_filecontents() -> None:
+ cell_one = "import numpy as np"
+ cell_two = "x = 0\nxx = 1"
+ cell_three = "y = x + 1"
+ cell_four = "# comment\nz = np.array(x + y)"
+ cell_five = "# just a comment"
+ codes = [cell_one, cell_two, cell_three, cell_four, cell_five]
+ names = ["one", "two", "three", "four", "five"]
+ contents = codegen.generate_filecontents(codes, names)
+ assert contents == get_expected_filecontents(
+ "test_generate_filecontents"
+ )
+
+ @staticmethod
+ def test_generate_filecontents_single_cell() -> None:
+ cell_one = "import numpy as np"
+ codes = [cell_one]
+ names = ["one"]
+ contents = codegen.generate_filecontents(codes, names)
+ assert contents == get_expected_filecontents(
+ "test_generate_filecontents_single_cell"
+ )
+
+ @staticmethod
+ def test_generate_filecontents_with_syntax_error() -> None:
+ cell_one = "import numpy as np"
+ cell_two = "_ error"
+ cell_three = "'all good'"
+ cell_four = '_ another_error\n_ and """another"""\n\n \\t'
+ codes = [cell_one, cell_two, cell_three, cell_four]
+ names = ["one", "two", "__", "__"]
+ contents = codegen.generate_filecontents(codes, names)
+ assert contents == get_expected_filecontents(
+ "test_generate_filecontents_with_syntax_error"
+ )
+
+ @staticmethod
+ def test_generate_unparseable_cell() -> None:
+ code = " error\n\\t"
+ raw = codegen.generate_unparseable_cell(code, None)
+ print(raw)
+ stringified = eval("\n".join(raw.split("\n")[1:5])).split("\n")
+ print(stringified)
+ # first line empty
+ assert not stringified[0]
+ # leading 4 spaces followed by source line
+ assert stringified[1] == " " * 4 + " error"
+ # leading 4 spaces followed by source line
+ assert stringified[2] == " " * 4 + "\\t"
+ # leading 4 spaces followed by nothing
+ assert stringified[3] == " " * 4
+
+ @staticmethod
+ def test_long_line_in_main() -> None:
+ cell_one = "\n".join(
+ [
+ "i_am_a_very_long_name = 0",
+ "i_am_another_very_long_name = 0",
+ "yet_another_very_long_name = 0",
+ ]
+ )
+ cell_two = (
+ "z = i_am_a_very_long_name + "
+ + "i_am_another_very_long_name + "
+ + "yet_another_very_long_name"
+ )
+ contents = codegen.generate_filecontents(
+ [cell_one, cell_two], ["one", "two"]
+ )
+ assert contents == get_expected_filecontents("test_long_line_in_main")
+
+ @staticmethod
+ def test_generate_filecontents_unshadowed_builtin() -> None:
+ cell_one = "type"
+ codes = [cell_one]
+ names = ["one"]
+ contents = codegen.generate_filecontents(codes, names)
+ assert contents == get_expected_filecontents(
+ "test_generate_filecontents_unshadowed_builtin"
+ )
+
+ @staticmethod
+ def test_generate_filecontents_shadowed_builtin() -> None:
+ cell_one = "type = 1"
+ cell_two = "type"
+ codes = [cell_one, cell_two]
+ names = ["one", "two"]
+ contents = codegen.generate_filecontents(codes, names)
+ assert contents == get_expected_filecontents(
+ "test_generate_filecontents_shadowed_builtin"
+ )
+
+
+class TestGetCodes:
+ @staticmethod
+ def test_get_codes() -> None:
+ codes, names = codegen.get_codes(
+ get_filepath("test_generate_filecontents")
+ )
+ assert names == ["one", "two", "three", "four", "five"]
+ assert codes == [
+ "import numpy as np",
+ "x = 0\nxx = 1",
+ "y = x + 1",
+ "# comment\nz = np.array(x + y)",
+ "# just a comment",
+ ]
+
+ @staticmethod
+ def test_get_codes_with_name_error() -> None:
+ # name mo is not defined --- make sure this file is still parseable
+ codes, names = codegen.get_codes(
+ get_filepath("test_get_codes_with_name_error")
+ )
+ assert names == ["one"]
+ assert codes == [
+ "mo",
+ ]
+
+ @staticmethod
+ def test_get_codes_multiline_fndef() -> None:
+ codes, names = codegen.get_codes(
+ get_filepath("test_get_codes_multiline_fndef")
+ )
+ assert names == ["one"]
+ assert codes == [
+ "# comment\nx = 0 + a + b + c + d",
+ ]
+
+ @staticmethod
+ def test_get_codes_messy() -> None:
+ codes, names = codegen.get_codes(get_filepath("test_get_codes_messy"))
+ assert names == ["__"]
+ assert codes == [
+ "# comment\n# another comment\n\n# yet another comment\n"
+ + "x = 0 + a + b + c + d",
+ ]
+
+ @staticmethod
+ def test_get_codes_single_line_fn() -> None:
+ codes, names = codegen.get_codes(
+ get_filepath("test_get_codes_single_line_fn")
+ )
+ assert names == ["one"]
+ assert codes == ["c = a + b; print(c); "]
+
+ @staticmethod
+ def test_get_codes_multiline_string() -> None:
+ codes, names = codegen.get_codes(
+ get_filepath("test_get_codes_multiline_string")
+ )
+ assert names == ["one"]
+ assert codes == ['c = """\n a, b"""; ']
+
+ @staticmethod
+ def test_get_codes_comment_after_sig() -> None:
+ codes, names = codegen.get_codes(
+ get_filepath("test_get_codes_comment_after_sig")
+ )
+ assert names == ["one"]
+ assert codes == ['print("hi")']
+
+ @staticmethod
+ def test_get_codes_empty() -> None:
+ codes, names = codegen.get_codes(get_filepath("test_get_codes_empty"))
+ assert names == ["one", "two"]
+ assert [c.strip() for c in codes] == ["", ""]
+
+ @staticmethod
+ def test_get_codes_syntax_error() -> None:
+ codes, names = codegen.get_codes(
+ get_filepath("test_generate_filecontents_with_syntax_error")
+ )
+ assert names == ["one", "two", "__", "__"]
+ assert codes == [
+ "import numpy as np",
+ "_ error",
+ "'all good'",
+ '_ another_error\n_ and """another"""\n\n \\t',
+ ]
+
+
+class TestApp:
+ @staticmethod
+ def test_run() -> None:
+ import marimo._test_utils.codegen_data.test_main as mod
+
+ outputs, defs = mod.app.run()
+ assert outputs == (None, "z", None)
+ assert defs == {"x": 0, "y": 1, "z": 2, "a": 1}
+
+
+class TestToFunctionDef:
+ def test_tofunctiondef_one_def(self) -> None:
+ code = "x = 0"
+ cell = parse_cell(code)
+ fndef = codegen.to_functiondef(cell, "foo")
+ expected = "\n".join(
+ ["@app.cell", "def foo():", " x = 0", " return x,"]
+ )
+ assert fndef == expected
+
+ def test_tofunctiondef_one_ref(self) -> None:
+ code = "y + 1"
+ cell = parse_cell(code)
+ fndef = codegen.to_functiondef(cell, "foo")
+ expected = "\n".join(
+ ["@app.cell", "def foo(y):", " y + 1", " return"]
+ )
+ assert fndef == expected
+
+ def test_tofunctiondef_empty_cells(self) -> None:
+ code = ""
+ cell = parse_cell(code)
+ fndef = codegen.to_functiondef(cell, "foo")
+ expected = "\n".join(["@app.cell", "def foo():", " return"])
+
+ code = "\n #\n"
+ cell = parse_cell(code)
+ fndef = codegen.to_functiondef(cell, "foo")
+ expected = cleandoc(
+ """
+ @app.cell
+ def foo():
+
+ #
+
+ return
+ """
+ )
+ assert fndef == expected
+
+ def test_tofunctiondef_builtin_not_a_ref(self) -> None:
+ code = "print(y)"
+ cell = parse_cell(code)
+ fndef = codegen.to_functiondef(cell, "foo")
+ expected = "\n".join(
+ ["@app.cell", "def foo(y):", " print(y)", " return"]
+ )
+ assert fndef == expected
+
+ def test_tofunctiondef_refs_and_defs(self) -> None:
+ code = "\n".join(["y = x", "z = x", "z = w + y"])
+ cell = parse_cell(code)
+ fndef = codegen.to_functiondef(cell, "foo")
+ expected = "\n".join(
+ ["@app.cell", "def foo(w, x):"]
+ + [" " + line for line in code.split("\n")]
+ + [" return y, z"]
+ )
+ assert fndef == expected
+
+
+def test_recover() -> None:
+ cells = {
+ "cells": [
+ {"name": "a", "code": '"santa"\n\n"claus"\n\n\n'},
+ {"name": "b", "code": ""},
+ {"name": "c", "code": "\n123"},
+ ]
+ }
+ filecontents = json.dumps(cells)
+ with tempfile.NamedTemporaryFile(mode="w", suffix=".py") as f:
+ f.write(filecontents)
+ f.seek(0)
+ recovered = codegen.recover(f.name)
+
+ codes = [
+ "\n".join(['"santa"', "", '"claus"', "", "", ""]),
+ "",
+ "\n".join(["", "123"]),
+ ]
+ names = ["a", "b", "c"]
+
+ expected = codegen.generate_filecontents(codes, names)
+ assert recovered == expected
+
+
+# TODO(akshayka): more tests for attributes, classdefs, and closures
+# TODO(akshayka): test builtin functions
+# TODO(akshayka): test delete cell
diff --git a/marimo/_ast/test_visitor.py b/marimo/_ast/test_visitor.py
new file mode 100644
index 0000000000..430b374eb2
--- /dev/null
+++ b/marimo/_ast/test_visitor.py
@@ -0,0 +1,513 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import ast
+from inspect import cleandoc
+
+import pytest
+
+from marimo._ast import visitor
+
+
+def test_assign_simple() -> None:
+ expr = "x = 0"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(expr)
+ v.visit(mod)
+ assert v.defs == set(["x"])
+ assert v.refs == set()
+
+
+def test_multiple_assign() -> None:
+ expr = "x = y = 0"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(expr)
+ v.visit(mod)
+ assert v.defs == set(["x", "y"])
+ assert v.refs == set()
+
+
+def test_assign_multiple_statements() -> None:
+ code = "x = 0\n" "y = 0"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(code)
+ v.visit(mod)
+ assert v.defs == set(["x", "y"])
+ assert v.refs == set()
+
+
+def test_assign_attr() -> None:
+ expr = "x.a = 0"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(expr)
+ v.visit(mod)
+ assert v.defs == set()
+ assert v.refs == set(["x"])
+
+
+def test_read_attr() -> None:
+ expr = "x.a"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(expr)
+ v.visit(mod)
+ assert v.defs == set()
+ assert v.refs == set(["x"])
+
+
+def test_read_attr_of_defined_variable() -> None:
+ expr = "x = 0; x.a"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(expr)
+ v.visit(mod)
+ assert v.defs == set(["x"])
+ assert v.refs == set()
+
+
+def test_assign_nested_attr() -> None:
+ expr = "x.a.b = 0"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(expr)
+ v.visit(mod)
+ assert v.defs == set()
+ assert v.refs == set(["x"])
+
+
+def test_read_nested_attr() -> None:
+ expr = "x.a.b"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(expr)
+ v.visit(mod)
+ assert v.defs == set()
+ assert v.refs == set(["x"])
+
+
+def test_assign_same_name() -> None:
+ expr = "x = x"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(expr)
+ v.visit(mod)
+ assert v.defs == set(["x"])
+ assert v.refs == set(["x"])
+
+ expr = "(x := x)"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(expr)
+ v.visit(mod)
+ assert v.defs == set(["x"])
+ assert v.refs == set(["x"])
+
+ expr = "x += x"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(expr)
+ v.visit(mod)
+ assert v.defs == set(["x"])
+ assert v.refs == set(["x"])
+
+ expr = "def f(): x = x; return x"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(expr)
+ v.visit(mod)
+ assert v.defs == set(["f"])
+ assert v.refs == set(["x"])
+
+ expr = "class F(): x = x"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(expr)
+ v.visit(mod)
+ assert v.defs == set(["F"])
+ assert v.refs == set(["x"])
+
+ expr = "{x: x}"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(expr)
+ v.visit(mod)
+ assert v.defs == set()
+ assert v.refs == set(["x"])
+
+
+def test_load_attr() -> None:
+ expr = "x.a"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(expr)
+ v.visit(mod)
+ assert v.defs == set()
+ assert v.refs == set(["x"])
+
+
+def test_structured_assignment() -> None:
+ expr = "(a, (b, c, (d, e)), (f, g), h) = 0"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(expr)
+ v.visit(mod)
+ names = set(["a", "b", "c", "d", "e", "f", "g", "h"])
+ assert v.defs == names
+ assert v.refs == set()
+
+
+def test_starred_assignment() -> None:
+ expr = "a, *b = 0"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(expr)
+ v.visit(mod)
+ assert v.defs == set(["a", "b"])
+ assert v.refs == set()
+
+
+def test_scope_does_not_leak() -> None:
+ code = "\n".join(
+ [
+ "def foo():",
+ " z = 0",
+ "z",
+ ]
+ )
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(code)
+ v.visit(mod)
+ assert v.defs == set(["foo"])
+ assert v.refs == set("z")
+
+
+def test_nested_comprehensions() -> None:
+ code = "\n".join(
+ [
+ "[(i, j) for i in range(10) for j in range(i)]",
+ "{(i, j) for i in range(10) for j in range(i)}",
+ "{i: j for i in range(10) for j in range(i)}",
+ ]
+ )
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(code)
+ v.visit(mod)
+ assert v.defs == set()
+ assert v.refs == set(["range"])
+
+
+def test_walrus_leaks_to_global_in_comprehension() -> None:
+ code = "\n".join(
+ [
+ "[(a := (i, (b := j))) for i in range(10) for j in range(i)]",
+ "{(c := (i, j)) for i in range(10) for j in range(i)}",
+ "{i: (d := j) for i in range(10) for j in range(i)}",
+ ]
+ )
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(code)
+ v.visit(mod)
+ assert v.defs == set(["a", "b", "c", "d"])
+ assert v.refs == set(["range"])
+
+
+def test_nested_walrus_leaks_to_global_in_comprehension() -> None:
+ code = "[[(a := (i, (b := j))) for j in range(i)] for i in range(10)]"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(code)
+ v.visit(mod)
+ assert v.defs == set(["a", "b"])
+ assert v.refs == set(["range"])
+
+
+def test_pep572_walrus_comprehension_examples() -> None:
+ code = "[(x, y, x/y) for x in input_data if (y := f(x)) > 0]"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(code)
+ v.visit(mod)
+ assert v.defs == set(["y"])
+ assert v.refs == set(["input_data", "f"])
+
+ code = "[[y := f(x), x/y] for x in range(5)]"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(code)
+ v.visit(mod)
+ assert v.defs == set(["y"])
+ assert v.refs == set(["f", "range"])
+
+
+def test_walrus_in_comp_in_fn_block_does_not_leak_to_global() -> None:
+ code = "\n".join(
+ ["def f():", " [(x := 0) for i in range(5)]", " y = x + 1"]
+ )
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(code)
+ v.visit(mod)
+ assert v.defs == set(["f"]) # x should _not_ leak to global scope
+ assert v.refs == set(["range"]) # x should leak to f's scope
+
+
+def test_assignments_in_multiple_scopes() -> None:
+ code = "\n".join(
+ [
+ "a = 0",
+ "def foo():",
+ " b = 0",
+ " c = 0",
+ " def bar():",
+ " d = 0",
+ "e = 0",
+ ]
+ )
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(code)
+ v.visit(mod)
+ assert v.defs == set(["a", "e", "foo"])
+ assert v.refs == set()
+
+
+def test_function_with_args() -> None:
+ code = cleandoc(
+ """
+ def foo(a: 'annotation', b=1, c=2, *d, e, f=3, **g):
+ y = a + z
+ return y
+ """
+ )
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(code)
+ v.visit(mod)
+ assert v.defs == set(["foo"])
+ assert v.refs == set("z")
+
+
+def test_function_with_defaults() -> None:
+ code = cleandoc(
+ """
+ def foo(x=y, y=x, z=a):
+ pass
+ """
+ )
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(code)
+ v.visit(mod)
+ assert v.defs == set(["foo"])
+ assert v.refs == set(["x", "y", "a"])
+
+
+def test_async_function_def() -> None:
+ code = cleandoc(
+ """
+ async def foo(a):
+ y = a + z
+
+ x = 0
+ """
+ )
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(code)
+ v.visit(mod)
+ assert v.defs == set(["foo", "x"])
+ assert v.refs == set("z")
+
+
+def test_global_def() -> None:
+ code = cleandoc(
+ """
+ def foo(a):
+ global x
+ x = 0
+ """
+ )
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(code)
+ v.visit(mod)
+ assert v.defs == set(["foo", "x"])
+ assert v.refs == set()
+
+
+def test_global_ref() -> None:
+ code = cleandoc(
+ """
+ def foo(a):
+ global x
+ print(x)
+ """
+ )
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(code)
+ v.visit(mod)
+ assert v.defs == set(["foo"])
+ assert v.refs == set(["x", "print"])
+
+
+def test_nested_local_def_and_global_ref() -> None:
+ code = cleandoc(
+ """
+ def foo(a):
+ global x
+ def bar():
+ x = 10
+ print(x)
+ """
+ )
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(code)
+ v.visit(mod)
+ assert v.defs == set(["foo"])
+ assert v.refs == set(["x", "print"])
+
+
+def test_call_ref() -> None:
+ code = "foo()"
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(code)
+ v.visit(mod)
+ assert v.defs == set()
+ assert v.refs == set(["foo"])
+
+
+def test_call_defined() -> None:
+ # fmt: off
+ code = "\n".join([
+ "def foo():",
+ " pass",
+ "foo()"
+ ])
+ # fmt: on
+ v = visitor.ScopedVisitor()
+ mod = ast.parse(code)
+ v.visit(mod)
+ assert v.defs == set(["foo"])
+ assert v.refs == set()
+
+
+def test_mutation_generates_def() -> None:
+ code = "x += 5"
+ mod = ast.parse(code)
+ v = visitor.ScopedVisitor()
+ v.visit(mod)
+ assert v.defs == set(["x"])
+ assert v.refs == set()
+
+
+def test_captured_variables() -> None:
+ code = cleandoc(
+ """
+ x = 0
+
+ def f():
+ x
+ """
+ )
+ mod = ast.parse(code)
+ v = visitor.ScopedVisitor()
+ v.visit(mod)
+ assert v.defs == set(["f", "x"])
+ assert v.refs == set([])
+
+ code = cleandoc(
+ """
+ def f():
+ x
+
+ x = 0
+ """
+ )
+ mod = ast.parse(code)
+ v = visitor.ScopedVisitor()
+ v.visit(mod)
+ assert v.defs == set(["f", "x"])
+ assert v.refs == set([])
+
+ code = cleandoc(
+ """
+ def f():
+ def g():
+ x
+
+ x = 0
+ """
+ )
+ mod = ast.parse(code)
+ v = visitor.ScopedVisitor()
+ v.visit(mod)
+ assert v.defs == set(["f", "x"])
+ assert v.refs == set([])
+
+ code = cleandoc(
+ """
+ def f():
+ def g():
+ x
+ x = 0
+ """
+ )
+ mod = ast.parse(code)
+ v = visitor.ScopedVisitor()
+ v.visit(mod)
+ assert v.defs == set(["f"])
+ assert v.refs == set([])
+
+ code = cleandoc(
+ """
+ def f():
+ def g():
+ x
+
+ def h():
+ x = 1
+ """
+ )
+ mod = ast.parse(code)
+ v = visitor.ScopedVisitor()
+ v.visit(mod)
+ assert v.defs == set(["f", "h"])
+ assert v.refs == set(["x"])
+
+
[email protected]("sys.version_info < (3, 10)")
+def test_matchas() -> None:
+ code = cleandoc(
+ """
+ match value:
+ case [a]:
+ ...
+ case (b, c):
+ ...
+ case d:
+ ...
+ case e as f:
+ ...
+ """
+ )
+ mod = ast.parse(code)
+ v = visitor.ScopedVisitor()
+ v.visit(mod)
+ assert v.defs == set(["a", "b", "c", "d", "e", "f"])
+ assert v.refs == set(["value"])
+
+
[email protected]("sys.version_info < (3, 10)")
+def test_matchstar() -> None:
+ code = cleandoc(
+ """
+ match value:
+ case [1, 2, *rest]:
+ ...
+ case [*_]:
+ ...
+ """
+ )
+ mod = ast.parse(code)
+ v = visitor.ScopedVisitor()
+ v.visit(mod)
+ assert v.defs == set(["rest"])
+ assert v.refs == set(["value"])
+
+
[email protected]("sys.version_info < (3, 10)")
+def test_matchmapping() -> None:
+ code = cleandoc(
+ """
+ match value:
+ case {1: _, 2: _, **a}:
+ ...
+ case {**b}:
+ ...
+ case {1: _}:
+ ...
+ """
+ )
+ mod = ast.parse(code)
+ v = visitor.ScopedVisitor()
+ v.visit(mod)
+ assert v.defs == set(["a", "b"])
+ assert v.refs == set(["value"])
diff --git a/marimo/_ast/visitor.py b/marimo/_ast/visitor.py
new file mode 100644
index 0000000000..0d420c9f5b
--- /dev/null
+++ b/marimo/_ast/visitor.py
@@ -0,0 +1,332 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import ast
+import sys
+from dataclasses import dataclass, field
+from typing import Optional
+from uuid import uuid4
+
+Name = str
+
+
+def _is_local(name: str) -> bool:
+ return name.startswith("_") and not name.startswith("__")
+
+
+@dataclass
+class Block:
+ """A scope in which names are declared."""
+
+ # Defined names
+ defs: set[Name] = field(default_factory=set)
+ # Names defined with the global keyword
+ global_names: set[Name] = field(default_factory=set)
+ # Comprehensions have special scoping rules
+ is_comprehension: bool = False
+
+
+@dataclass
+class RefData:
+ """Metadata about variables referenced but not defined by a cell"""
+
+ # Whether the ref was deleted
+ deleted: bool
+ # Ancestors of the block in which this ref was used
+ parent_blocks: list[Block]
+
+
+class ScopedVisitor(ast.NodeVisitor):
+ def __init__(self, mangle_prefix: Optional[str] = None) -> None:
+ self.block_stack: list[Block] = [Block()]
+ # Mapping from referenced names to their metadata
+ self._refs: dict[Name, RefData] = {}
+ # Unique prefix used to mangle cell-local variable names
+ self.id = (
+ str(uuid4()).replace("-", "_")
+ if mangle_prefix is None
+ else mangle_prefix
+ )
+
+ @property
+ def refs(self) -> set[Name]:
+ """Names referenced but not defined."""
+ return set(self._refs.keys())
+
+ @property
+ def deleted_refs(self) -> set[Name]:
+ """Referenced names that were deleted with `del`."""
+ return set(name for name in self._refs if self._refs[name].deleted)
+
+ def _if_local_then_mangle(
+ self, name: str, ignore_scope: bool = False
+ ) -> str:
+ """Mangle local variable name declared at top-level scope."""
+ if _is_local(name) and (len(self.block_stack) == 1 or ignore_scope):
+ return f"_{self.id}{name}"
+ else:
+ return name
+
+ def _is_defined(self, identifier: str) -> bool:
+ """Check if `identifier` is defined in any block."""
+ return any(identifier in block.defs for block in self.block_stack)
+
+ def _add_ref(self, name: Name, deleted: bool) -> None:
+ """Register a referenced name."""
+ self._refs[name] = RefData(
+ deleted=deleted,
+ parent_blocks=self.block_stack[:-1],
+ )
+
+ def _remove_ref(self, name: Name) -> None:
+ """Remove a referenced name."""
+ del self._refs[name]
+
+ def _define(self, name: Name) -> None:
+ """Define a name in the current block.
+
+ Names created with the global keyword are added to the top-level
+ (global scope) block.
+ """
+ # If `name` is added to the top-level block, it is also evicted from
+ # any captured refs (if present) --- this handles cases where a name is
+ # encountered and captured before it is declared, such as in
+ #
+ # ```
+ # def f():
+ # print(x)
+ # x = 0
+ # ```
+ block_idx = 0 if name in self.block_stack[-1].global_names else -1
+ self.block_stack[block_idx].defs.add(name)
+ if (
+ name in self._refs
+ and self.block_stack[block_idx] in self._refs[name].parent_blocks
+ ):
+ # `name` was used as a capture, not a reference
+ self._remove_ref(name)
+
+ def _push_block(self, is_comprehension: bool) -> None:
+ """Push a block onto the block stack."""
+ self.block_stack.append(Block(is_comprehension=is_comprehension))
+
+ def _pop_block(self) -> None:
+ """Pop a block from the block stack."""
+ self.block_stack.pop()
+
+ @property
+ def defs(self) -> set[Name]:
+ """Get all global defs."""
+ return self.block_stack[0].defs
+
+ def generic_visit(self, node: ast.AST) -> None:
+ """Visits the children of node and manages the block stack.
+
+ Note: visit calls visit_ClassName, or generic_visit() if the former
+ doesn't exist. That means that _this method should never call
+ visit on `node`_, as this could lead to unbounded recursion.
+ (Calling visit on `node`'s children is fine.) In summary:
+ call super().generic_visit on `node` and `visit()` on node's children.
+ """
+ if isinstance(
+ node,
+ (ast.ClassDef, ast.AsyncFunctionDef, ast.FunctionDef, ast.Lambda),
+ ):
+ # These AST nodes introduce a new scope, but otherwise do not
+ # require special treatment.
+ self._push_block(is_comprehension=False)
+ super().generic_visit(node)
+ self._pop_block()
+ elif isinstance(node, (ast.ListComp, ast.SetComp, ast.GeneratorExp)):
+ # In comprehensions, generators must be visited before elements
+ # because generators define local targets that elements may use.
+ self._push_block(is_comprehension=True)
+ for generator in node.generators:
+ self.visit(generator)
+ self.visit(node.elt)
+ self._pop_block()
+ elif isinstance(node, ast.DictComp):
+ # Special-cased for the same reason that other comprehensions are
+ # special-cased.
+ self._push_block(is_comprehension=True)
+ for generator in node.generators:
+ self.visit(generator)
+ self.visit(node.value)
+ self.visit(node.key)
+ self._pop_block()
+ else:
+ # Other nodes that don't introduce a new scope
+ super().generic_visit(node)
+
+ # ClassDef and FunctionDef nodes don't have ast.Name nodes as children
+ def visit_ClassDef(self, node: ast.ClassDef) -> None:
+ node.name = self._if_local_then_mangle(node.name)
+ self._define(Name(node.name))
+ self.generic_visit(node)
+
+ def visit_AsyncFunctionDef(self, node: ast.AsyncFunctionDef) -> None:
+ node.name = self._if_local_then_mangle(node.name)
+ self._define(node.name)
+ self.generic_visit(node)
+
+ def visit_FunctionDef(self, node: ast.FunctionDef) -> None:
+ node.name = self._if_local_then_mangle(node.name)
+ self._define(node.name)
+ self.generic_visit(node)
+
+ def visit_arg(self, node: ast.arg) -> None:
+ node.arg = self._if_local_then_mangle(node.arg)
+ self._define(node.arg)
+ if node.annotation is not None:
+ self.visit(node.annotation)
+
+ def visit_arguments(self, node: ast.arguments) -> None:
+ # process potential refs before defs, to handle patterns like
+ #
+ # def f(x=x):
+ # ...
+ for v in node.kw_defaults:
+ if v is not None:
+ self.visit(v)
+ for v in node.defaults:
+ if v is not None:
+ self.visit(v)
+
+ for arg in node.posonlyargs:
+ self.visit(arg)
+ for arg in node.args:
+ self.visit(arg)
+ for arg in node.kwonlyargs:
+ self.visit(arg)
+ if node.vararg is not None:
+ self.visit(node.vararg)
+ if node.kwarg is not None:
+ self.visit(node.kwarg)
+
+ def visit_Assign(self, node: ast.Assign) -> None:
+ # Visit the value first, to handle cases like
+ #
+ # class A:
+ # x = x
+ #
+ # Handling value first is required to register `x` as a ref.
+ self.visit(node.value)
+ for target in node.targets:
+ self.visit(target)
+
+ def visit_AugAssign(self, node: ast.AugAssign) -> None:
+ self.visit(node.value)
+ self.visit(node.target)
+
+ def visit_AnnAssign(self, node: ast.AnnAssign) -> None:
+ if node.value is not None:
+ self.visit(node.value)
+ self.visit(node.annotation)
+ self.visit(node.target)
+
+ def visit_NamedExpr(self, node: ast.NamedExpr) -> None:
+ self.visit(node.value)
+ if self.block_stack[-1].is_comprehension and isinstance(
+ node.target, ast.Name
+ ):
+ for block in reversed(self.block_stack):
+ if not block.is_comprehension:
+ node.target.id = self._if_local_then_mangle(
+ node.target.id,
+ ignore_scope=(block == self.block_stack[0]),
+ )
+ block.defs.add(node.target.id)
+ break
+ else:
+ self.generic_visit(node)
+
+ def visit_Name(self, node: ast.Name) -> None:
+ # NB: AugAssign has a Store ctx; this means that mutating a var
+ # will create a def, which we can catch as an error later if
+ # that var was defined by another cell
+ #
+ # NB: Only mangle loaded or deleted names if they are local
+ # and found to be referring to a top-level variable. This prevents
+ # us from mangling references to variables names conforming to local
+ # spec but declared in a nested scope.
+ #
+ # NB: we don't implement visit_Attribute because refs and defs
+ # are not tracked at the attribute level. The default behavior
+ # with our implemented visitors does the right thing (foo.bar[.*]
+ # generates a ref to foo if foo has not been def'd).
+ if isinstance(node.ctx, ast.Store):
+ node.id = self._if_local_then_mangle(node.id)
+ self._define(node.id)
+ elif (
+ isinstance(node.ctx, ast.Load)
+ and not self._is_defined(node.id)
+ and not _is_local(node.id)
+ ):
+ self._add_ref(node.id, deleted=False)
+ elif (
+ isinstance(node.ctx, ast.Del)
+ and not self._is_defined(node.id)
+ and not _is_local(node.id)
+ ):
+ self._add_ref(node.id, deleted=True)
+ elif _is_local(node.id):
+ mangled_name = self._if_local_then_mangle(
+ node.id, ignore_scope=True
+ )
+ for block in reversed(self.block_stack):
+ if block == self.block_stack[0] and mangled_name in block.defs:
+ node.id = mangled_name
+ elif node.id in block.defs:
+ break
+
+ self.generic_visit(node)
+
+ def visit_Global(self, node: ast.Global) -> None:
+ node.names = [
+ self._if_local_then_mangle(name, ignore_scope=True)
+ for name in node.names
+ ]
+ for name in node.names:
+ self.block_stack[-1].global_names.add(name)
+
+ # TODO(akshayka): can we find a way around tracking imports as state
+ # that needs to be tracked?
+ # Import and ImportFrom statements have symbol names in alias nodes
+ def visit_alias(self, node: ast.alias) -> None:
+ if node.asname is None:
+ node.name = self._if_local_then_mangle(node.name)
+ self._define(node.name)
+ else:
+ node.asname = self._if_local_then_mangle(node.asname)
+ self._define(node.asname)
+ self.generic_visit(node)
+
+ if sys.version_info >= (3, 10):
+ # Match statements were introduced in Python 3.10
+ #
+ # Top-level match statements are awkward in marimo --- at parse-time,
+ # we have to register all names in every case/pattern as globals (since
+ # we don't know the value of the match subject), even though only a
+ # subset of the names will be bound at runtime. For this reason, in
+ # marimo, match statements should really only be used in local scopes.
+ def visit_MatchAs(self, node: ast.MatchAs) -> None:
+ if node.name is not None:
+ node.name = self._if_local_then_mangle(node.name)
+ self._define(node.name)
+ if node.pattern is not None:
+ # pattern may contain additional MatchAs statements in it
+ self.visit(node.pattern)
+
+ def visit_MatchMapping(self, node: ast.MatchMapping) -> None:
+ if node.rest is not None:
+ node.rest = self._if_local_then_mangle(node.rest)
+ self._define(node.rest)
+ for key in node.keys:
+ self.visit(key)
+ for pattern in node.patterns:
+ self.visit(pattern)
+
+ def visit_MatchStar(self, node: ast.MatchStar) -> None:
+ if node.name is not None:
+ node.name = self._if_local_then_mangle(node.name)
+ self._define(node.name)
diff --git a/marimo/_cli/__init__.py b/marimo/_cli/__init__.py
new file mode 100644
index 0000000000..618f22fc54
--- /dev/null
+++ b/marimo/_cli/__init__.py
@@ -0,0 +1 @@
+# Copyright 2023 Marimo. All rights reserved.
diff --git a/marimo/_cli/cli.py b/marimo/_cli/cli.py
new file mode 100644
index 0000000000..db4c8daea0
--- /dev/null
+++ b/marimo/_cli/cli.py
@@ -0,0 +1,409 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import asyncio
+import inspect
+import logging
+import os
+import pathlib
+import tempfile
+import urllib.request
+from typing import Any, Literal, Optional
+
+import click
+
+from marimo import __version__, _loggers
+from marimo._ast import codegen
+from marimo._cli import ipynb_to_marimo
+from marimo._server.server import start_server
+from marimo._utils.url import is_url
+
+DEVELOPMENT_MODE = False
+QUIET = False
+
+
+def colorize(string: str, color: Literal["red"]) -> str:
+ if color == "red":
+ color_code = "31"
+ else:
+ raise ValueError("Unrecognized color ", color)
+
+ return f"\033[;{color_code}m{string}\033[0m"
+
+
+def helpful_usage_error(self: Any, file: Any = None) -> None:
+ if file is None:
+ file = click.get_text_stream("stderr")
+ color = None
+ click.echo(
+ colorize("Error", "red") + ": %s\n" % self.format_message(),
+ file=file,
+ color=color,
+ )
+ if self.ctx is not None:
+ color = self.ctx.color
+ click.echo(self.ctx.get_help(), file=file, color=color)
+
+
+click.exceptions.UsageError.show = helpful_usage_error # type: ignore
+
+
+def _key_value_bullets(items: list[tuple[str, str]]) -> str:
+ max_length = max(len(item[0]) for item in items)
+ lines = []
+
+ def _sep(desc: str) -> str:
+ return ":" if desc else ""
+
+ for key, desc in items:
+ # "\b" tells click not to reformat our text
+ lines.append("\b")
+ lines.append(
+ " * "
+ + key
+ + _sep(desc)
+ + " " * (max_length - len(key) + 2)
+ + desc
+ )
+ return "\n".join(lines)
+
+
+main_help_msg = "\n".join(
+ [
+ "\b",
+ "Welcome to marimo!",
+ "\b",
+ "Getting started:",
+ _key_value_bullets(
+ [
+ ("marimo tutorial intro", ""),
+ ]
+ ),
+ "\b",
+ "Example usage:",
+ _key_value_bullets(
+ [
+ (
+ "marimo edit",
+ "create a notebook",
+ ),
+ (
+ "marimo edit app.py",
+ "create or edit a notebook called app.py",
+ ),
+ (
+ "marimo run app.py",
+ "run as a read-only app",
+ ),
+ (
+ "marimo tutorial --help",
+ "list tutorials",
+ ),
+ ]
+ ),
+ ]
+)
+
+
[email protected](help=main_help_msg)
[email protected]_option(version=__version__)
+ "-l",
+ "--log-level",
+ default="WARN",
+ type=click.Choice(
+ ["DEBUG", "INFO", "WARN", "ERROR", "CRITICAL"], case_sensitive=False
+ ),
+ show_default=True,
+ help="Choose logging level.",
+)
+ "-q",
+ "--quiet",
+ is_flag=True,
+ default=False,
+ show_default=True,
+ help="Suppress standard out.",
+)
+ "-d",
+ "--development-mode",
+ is_flag=True,
+ default=False,
+ show_default=True,
+ help="Run in development mode; enables debug logs and server autoreload.",
+)
+def main(log_level: str, quiet: bool, development_mode: bool) -> None:
+ log_level = "DEBUG" if development_mode else log_level
+ _loggers.set_level(log_level)
+
+ global DEVELOPMENT_MODE
+ global QUIET
+ DEVELOPMENT_MODE = development_mode
+ QUIET = quiet
+
+
+edit_help_msg = "\n".join(
+ [
+ "\b",
+ "Edit a new or existing notebook.",
+ _key_value_bullets(
+ [
+ (
+ "marimo edit",
+ "Create a new notebook",
+ ),
+ ("marimo edit app.py", "Create or edit app.py"),
+ ]
+ ),
+ ]
+)
+
+
[email protected](help=edit_help_msg)
+ "-p",
+ "--port",
+ default=None,
+ show_default=True,
+ type=int,
+ help="Port to attach to.",
+)
+ "--headless",
+ is_flag=True,
+ default=False,
+ show_default=True,
+ type=bool,
+ help="Don't launch a browser.",
+)
[email protected]("name", required=False)
+def edit(
+ port: Optional[int],
+ headless: bool,
+ name: Optional[str] = None,
+) -> None:
+ if name is not None:
+ path = pathlib.Path(name)
+ if path.suffix != ".py":
+ raise click.UsageError(
+ "Invalid NAME - %s is not a Python file" % name
+ )
+
+ if os.path.exists(name):
+ if not path.is_file():
+ raise click.UsageError(
+ "Invalid NAME - %s is not a file" % name
+ )
+ # module correctness check - don't start the server
+ # if we can't import the module
+ codegen.get_codes(name)
+ else:
+ # write empty file
+ try:
+ with open(name, "w"):
+ pass
+ except OSError:
+ raise
+
+ asyncio.run(
+ start_server(
+ development_mode=DEVELOPMENT_MODE,
+ quiet=QUIET,
+ port=port,
+ headless=headless,
+ filename=name,
+ run=False,
+ )
+ )
+
+
+ help="""Run as an app in read-only mode.
+
+If NAME is a url, the app will be downloaded to a temporary file.
+
+Example:
+
+ \b
+ * marimo run your_app.py
+"""
+)
+ "-p",
+ "--port",
+ default=None,
+ show_default=True,
+ type=int,
+ help="Port to attach to.",
+)
+ "--headless",
+ is_flag=True,
+ default=False,
+ show_default=True,
+ type=bool,
+ help="Don't launch a browser.",
+)
[email protected]("name", required=True)
+def run(port: Optional[int], headless: bool, name: str) -> None:
+ path = pathlib.Path(name)
+ if path.suffix != ".py":
+ raise click.UsageError("Invalid NAME - %s is not a Python file" % name)
+
+ if is_url(name):
+ d = tempfile.TemporaryDirectory()
+ logging.info("Downloading %s", name)
+ path_to_app = os.path.join(d.name, os.path.basename(name))
+ urllib.request.urlretrieve(url=name, filename=path_to_app)
+ logging.info("App saved to %s", path_to_app)
+ # overwrite name to point to the temporary file
+ name = path_to_app
+ elif not os.path.exists(name):
+ raise click.UsageError("Invalid NAME - %s does not exist" % name)
+ elif not path.is_file():
+ raise click.UsageError("Invalid NAME - %s is not a file" % name)
+
+ # correctness check - don't start the server if we can't import the module
+ codegen.get_codes(name)
+
+ asyncio.run(
+ start_server(
+ development_mode=DEVELOPMENT_MODE,
+ quiet=QUIET,
+ port=port,
+ headless=headless,
+ filename=name,
+ run=True,
+ )
+ )
+
+
[email protected](help="Recover a marimo notebook from JSON.")
[email protected]("name", required=True)
+def recover(name: str) -> None:
+ path = pathlib.Path(name)
+ if not os.path.exists(name):
+ raise click.UsageError("Invalid NAME - %s does not exist" % name)
+
+ if not path.is_file():
+ raise click.UsageError("Invalid NAME - %s is not a file" % name)
+
+ print(codegen.recover(name))
+
+
+ help="""Open a tutorial.
+
+marimo is a powerful library for building interactive experiments
+and dataflow apps. To get the most out of marimo, get started with a few
+tutorials, starting with the intro:
+
+ \b
+ marimo tutorial intro
+
+Recommended sequence:
+
+ \b
+ - intro
+ - dataflow
+ - ui
+ - markdown
+ - plots
+ - layout
+ - fileformat
+"""
+)
+ "-p",
+ "--port",
+ default=None,
+ show_default=True,
+ type=int,
+ help="Port to attach to.",
+)
+ "--headless",
+ is_flag=True,
+ default=False,
+ show_default=True,
+ type=bool,
+ help="Don't launch a browser.",
+)
+ "name",
+ required=True,
+ type=click.Choice(
+ [
+ "intro",
+ "dataflow",
+ "ui",
+ "markdown",
+ "plots",
+ "layout",
+ "fileformat",
+ ]
+ ),
+)
+def tutorial(
+ port: Optional[int],
+ headless: bool,
+ name: Literal[
+ "intro", "dataflow", "ui", "markdown", "plots", "layout", "fileformat"
+ ],
+) -> None:
+ from marimo._tutorials import (
+ dataflow,
+ fileformat,
+ intro,
+ layout,
+ markdown,
+ plots,
+ ui,
+ )
+
+ tutorials = {
+ "intro": intro,
+ "dataflow": dataflow,
+ "ui": ui,
+ "markdown": markdown,
+ "plots": plots,
+ "layout": layout,
+ "fileformat": fileformat,
+ }
+ source = inspect.getsource(tutorials[name])
+ d = tempfile.TemporaryDirectory()
+ fname = os.path.join(d.name, name + ".py")
+ with open(fname, "w", encoding="utf-8") as f:
+ f.write(source)
+
+ asyncio.run(
+ start_server(
+ development_mode=DEVELOPMENT_MODE,
+ quiet=QUIET,
+ port=port,
+ headless=headless,
+ filename=fname,
+ run=False,
+ )
+ )
+
+
[email protected]("ipynb", type=str, required=True)
+def convert(ipynb: str) -> None:
+ """Convert a Jupyter notebook to a marimo notebook.
+
+ Example usage:
+
+ marimo convert your_nb.ipynb > your_app.py
+
+ After conversion, you can open the app in the editor:
+
+ marimo edit your_app.py
+
+ Since marimo is different from traditional notebooks, once in the editor,
+ you may need to fix errors like multiple definition errors or cycle
+ errors.
+ """
+ print(ipynb_to_marimo.convert(ipynb))
diff --git a/marimo/_cli/ipynb_to_marimo.py b/marimo/_cli/ipynb_to_marimo.py
new file mode 100644
index 0000000000..907e53a7f6
--- /dev/null
+++ b/marimo/_cli/ipynb_to_marimo.py
@@ -0,0 +1,36 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import json
+
+from marimo._ast import codegen
+
+
+def convert(ipynb_path: str) -> str:
+ with open(ipynb_path, "r") as f:
+ notebook = json.loads(f.read())
+ sources = []
+ has_markdown = False
+ for cell in notebook["cells"]:
+ source = (
+ cell["source"]
+ if isinstance(cell["source"], str)
+ else "".join(cell["source"])
+ )
+ if cell["cell_type"] == "markdown":
+ has_markdown = True
+ source = source.replace('"""', '\\"\\"\\"')
+ source = "\n".join(
+ [
+ "mo.md(",
+ codegen.indent_text('"""'),
+ codegen.indent_text(source),
+ codegen.indent_text('"""'),
+ ")",
+ ]
+ )
+ sources.append(source)
+ if has_markdown:
+ sources.append("import marimo as mo")
+
+ return codegen.generate_filecontents(sources, ["_" for _ in sources])
diff --git a/marimo/_cli/test_cli.py b/marimo/_cli/test_cli.py
new file mode 100644
index 0000000000..7b8bddfc2f
--- /dev/null
+++ b/marimo/_cli/test_cli.py
@@ -0,0 +1,100 @@
+# Copyright 2023 Marimo. All rights reserved.
+"""
+Crude CLI tests
+
+Requires frontend to be built
+"""
+import os
+import socket
+import subprocess
+import tempfile
+import time
+import urllib.request
+from typing import Optional
+
+from marimo._ast import codegen
+
+
+def _try_fetch(port: int) -> Optional[bytes]:
+ contents = None
+ for _ in range(10):
+ try:
+ contents = urllib.request.urlopen(
+ f"http://localhost:{port}"
+ ).read()
+ break
+ except Exception:
+ time.sleep(0.5)
+ return contents
+
+
+def _check_contents(
+ p: subprocess.Popen, # type: ignore
+ phrase: bytes,
+ contents: Optional[bytes],
+) -> None:
+ try:
+ assert contents is not None
+ assert phrase in contents
+ finally:
+ p.kill()
+
+
+def _get_port() -> int:
+ port = 2718
+ max_tries = 25
+ for _ in range(max_tries):
+ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
+ in_use = s.connect_ex(("localhost", port)) == 0
+ if in_use:
+ port += 1
+ else:
+ return port
+ raise OSError("Could not find an unused port.")
+
+
+def test_cli_help_exit_code() -> None:
+ # smoke test: makes sure CLI starts
+ # helpful for catching issues related to
+ # Python 3.8 compatibility, such as forgetting `from __future__` import
+ # annotations
+ p = subprocess.run(["marimo", "--help"])
+ assert p.returncode == 0
+
+
+def test_cli_edit() -> None:
+ # smoke test: makes sure CLI starts
+ # helpful for catching issues related to
+ # Python 3.8 compatibility, such as forgetting `from __future__` import
+ # annotations
+ port = _get_port()
+ p = subprocess.Popen(["marimo", "edit", "-p", str(port), "--headless"])
+ contents = _try_fetch(port)
+ _check_contents(p, b"marimo-mode data-mode=edit", contents)
+
+
+def test_cli_run() -> None:
+ filecontents = codegen.generate_filecontents(
+ ["import marimo as mo"], ["one"]
+ )
+ d = tempfile.TemporaryDirectory()
+ path = os.path.join(d.name, "run.py")
+ with open(path, "w", encoding="utf-8") as f:
+ f.write(filecontents)
+
+ port = _get_port()
+ p = subprocess.Popen(
+ ["marimo", "run", path, "-p", str(port), "--headless"]
+ )
+ contents = _try_fetch(port)
+ _check_contents(p, b"marimo-mode data-mode=read", contents)
+
+
+def test_cli_tutorial() -> None:
+ port = _get_port()
+ p = subprocess.Popen(
+ ["marimo", "tutorial", "intro", "-p", str(port), "--headless"]
+ )
+ contents = _try_fetch(port)
+ _check_contents(p, b"marimo-mode data-mode=edit", contents)
+ _check_contents(p, b"intro.py", contents)
diff --git a/marimo/_cli/test_ipynb_to_marimo.py b/marimo/_cli/test_ipynb_to_marimo.py
new file mode 100644
index 0000000000..860cb4b957
--- /dev/null
+++ b/marimo/_cli/test_ipynb_to_marimo.py
@@ -0,0 +1,88 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import os
+import tempfile
+import textwrap
+from collections.abc import Sequence
+
+from marimo._ast import codegen
+from marimo._cli.ipynb_to_marimo import convert
+
+DIR_PATH = os.path.dirname(os.path.realpath(__file__))
+
+
+def get_codes(ipynb_name: str) -> tuple[Sequence[str], Sequence[str]]:
+ contents = convert(
+ DIR_PATH + f"/../_test_utils/ipynb_data/{ipynb_name}.ipynb.txt"
+ )
+
+ with tempfile.NamedTemporaryFile(mode="w", suffix=".py") as f:
+ f.write(contents)
+ f.seek(0)
+ return codegen.get_codes(f.name)
+
+
+def test_markdown() -> None:
+ codes, names = get_codes("markdown")
+
+ assert len(codes) == 3
+ assert (
+ codes[0]
+ == textwrap.dedent(
+ """
+ mo.md(
+ \"\"\"
+ # Hello, markdown
+
+ \\"\\"\\"
+ 'hello"
+ '''
+ \\"\\"\\"
+ \"\"\"
+ )
+ """
+ ).strip()
+ )
+ assert (
+ codes[1]
+ == textwrap.dedent(
+ """
+ mo.md(
+ \"\"\"
+ Here is some math
+
+ $x = 0$
+ \"\"\"
+ )
+ """
+ ).strip()
+ )
+ assert codes[2] == "import marimo as mo"
+ assert [name == "_" for name in names]
+
+
+def test_arithmetic() -> None:
+ codes, names = get_codes("arithmetic")
+
+ assert len(codes) == 2
+ assert codes[0] == "x = 0\nx"
+ assert codes[1] == "x + 1"
+ assert names == ["_", "_"]
+
+
+def test_blank() -> None:
+ codes, names = get_codes("blank")
+
+ assert len(codes) == 1
+ assert codes[0] == ""
+ assert names == ["_"]
+
+
+def test_unparsable() -> None:
+ codes, names = get_codes("unparsable")
+
+ assert len(codes) == 2
+ assert codes[0] == "!echo hello, world\n\nx = 0"
+ assert codes[1] == "x"
+ assert names == ["_", "_"]
diff --git a/marimo/_loggers.py b/marimo/_loggers.py
new file mode 100644
index 0000000000..d0949bfbe3
--- /dev/null
+++ b/marimo/_loggers.py
@@ -0,0 +1,78 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import logging
+from typing import Optional
+
+import tornado.log
+
+# Global log level for loggers
+_LOG_LEVEL = logging.WARN
+
+# Tornado has a great log formatter
+_LOG_FORMATTER = tornado.log.LogFormatter()
+
+# Cache of initialized loggers
+_LOGGERS: dict[str, logging.Logger] = {}
+
+
+def set_level(level: str | int = logging.WARN) -> None:
+ global _LOG_LEVEL
+ if isinstance(level, str):
+ level = level.upper()
+ if level == "DEBUG":
+ _LOG_LEVEL = logging.DEBUG
+ elif level == "INFO":
+ _LOG_LEVEL = logging.INFO
+ elif level == "WARN":
+ _LOG_LEVEL = logging.WARN
+ elif level == "ERROR":
+ _LOG_LEVEL = logging.ERROR
+ elif level == "CRITICAL":
+ _LOG_LEVEL = logging.CRITICAL
+ else:
+ raise ValueError("Unrecognized log level %s" % level)
+ elif level not in [
+ logging.DEBUG,
+ logging.INFO,
+ logging.WARN,
+ logging.ERROR,
+ logging.CRITICAL,
+ ]:
+ raise ValueError("Unrecongized log level %s" % level)
+ else:
+ _LOG_LEVEL = level
+
+ for logger in _LOGGERS.values():
+ logger.setLevel(_LOG_LEVEL)
+
+
+def initialize_tornado_loggers(development_mode: bool) -> None:
+ tornado_log_level = logging.DEBUG if development_mode else logging.ERROR
+ for logger_name in (
+ "tornado.access",
+ "tornado.application",
+ "tornado.general",
+ ):
+ get_logger(logger_name, tornado_log_level)
+
+
+def get_logger(name: str, level: Optional[int] = None) -> logging.Logger:
+ if name in _LOGGERS:
+ return _LOGGERS[name]
+
+ logger = logging.getLogger(name)
+ if level is None:
+ logger.setLevel(_LOG_LEVEL)
+ else:
+ logger.setLevel(level)
+ stream_handler = logging.StreamHandler()
+ stream_handler.setFormatter(_LOG_FORMATTER)
+ logger.addHandler(stream_handler)
+ _LOGGERS[name] = logger
+ logger.propagate = False
+ return logger
+
+
+def marimo_logger() -> logging.Logger:
+ return get_logger("marimo")
diff --git a/marimo/_messaging/__init__.py b/marimo/_messaging/__init__.py
new file mode 100644
index 0000000000..618f22fc54
--- /dev/null
+++ b/marimo/_messaging/__init__.py
@@ -0,0 +1 @@
+# Copyright 2023 Marimo. All rights reserved.
diff --git a/marimo/_messaging/cell_output.py b/marimo/_messaging/cell_output.py
new file mode 100644
index 0000000000..10d92863cc
--- /dev/null
+++ b/marimo/_messaging/cell_output.py
@@ -0,0 +1,21 @@
+# Copyright 2023 Marimo. All rights reserved.
+"""Specification of a cell's visual output
+"""
+
+
+from __future__ import annotations
+
+import time
+from dataclasses import dataclass, field
+from typing import Sequence, Union
+
+from marimo._messaging.errors import Error
+
+
+@dataclass
+class CellOutput:
+ # descriptive name about the kind of output: e.g., stdout, stderr, ...
+ channel: str
+ mimetype: str
+ data: Union[str, Sequence[Error]]
+ timestamp: float = field(default_factory=lambda: time.time())
diff --git a/marimo/_messaging/completion_option.py b/marimo/_messaging/completion_option.py
new file mode 100644
index 0000000000..6a6449e4e5
--- /dev/null
+++ b/marimo/_messaging/completion_option.py
@@ -0,0 +1,19 @@
+# Copyright 2023 Marimo. All rights reserved.
+"""Specification of a code completion result
+"""
+
+
+from __future__ import annotations
+
+from dataclasses import dataclass
+from typing import Optional
+
+
+@dataclass
+class CompletionOption:
+ # completed symbol name
+ name: str
+ # type of symbol
+ type: str
+ # docstring, type hint, or other info
+ completion_info: Optional[str]
diff --git a/marimo/_messaging/console_output_worker.py b/marimo/_messaging/console_output_worker.py
new file mode 100644
index 0000000000..6cdaecaf49
--- /dev/null
+++ b/marimo/_messaging/console_output_worker.py
@@ -0,0 +1,110 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import time
+from collections import deque
+from dataclasses import asdict, dataclass
+from threading import Condition
+from typing import TYPE_CHECKING, Literal, Optional
+
+from marimo._ast.cell import CellId_t
+from marimo._messaging.cell_output import CellOutput
+from marimo._messaging.message_types import CellOp
+
+if TYPE_CHECKING:
+ from marimo._messaging.streams import Stream
+
+StreamT = Literal["stdout", "stderr"]
+
+# Flush console outputs every 10ms
+TIMEOUT_S = 0.01
+
+
+@dataclass
+class ConsoleMsg:
+ stream: StreamT
+ cell_id: CellId_t
+ data: str
+
+
+def _write_console_output(
+ stream: Stream, stream_type: StreamT, cell_id: CellId_t, data: str
+) -> None:
+ return stream.write(
+ op=CellOp.name,
+ data=asdict(
+ CellOp(
+ cell_id=cell_id,
+ console=CellOutput(
+ channel=stream_type,
+ mimetype="text/plain",
+ data=data,
+ ),
+ )
+ ),
+ )
+
+
+def _add_output_to_buffer(
+ console_output: ConsoleMsg,
+ outputs_buffered_per_cell: dict[CellId_t, list[ConsoleMsg]],
+) -> None:
+ cell_id = console_output.cell_id
+ buffer = (
+ outputs_buffered_per_cell[cell_id]
+ if cell_id in outputs_buffered_per_cell
+ else None
+ )
+ if buffer and buffer[-1].stream == console_output.stream:
+ buffer[-1].data += console_output.data
+ elif buffer:
+ buffer.append(console_output)
+ else:
+ outputs_buffered_per_cell[cell_id] = [console_output]
+
+
+def buffered_writer(
+ msg_queue: deque[ConsoleMsg],
+ stream: Stream,
+ cv: Condition,
+) -> None:
+ """
+ Writes standard out and standard error to frontend in batches
+
+ Buffers console messages, writing them out in batches. A condition
+ variable is used to synchronize access to `msg_queue`, and to obtain
+ notifications when messages have been added. (A deque + condition variable
+ was noticeably faster than the builtin queue.Queue in testing.)
+ """
+
+ # only have a non-None timeout when there's at least one output buffered
+ timeout: Optional[float] = None
+ outputs_buffered_per_cell: dict[CellId_t, list[ConsoleMsg]] = {}
+ while True:
+ with cv:
+ # We wait for messages until we've timed-out
+ while timeout is None or timeout > 0:
+ time_started_waiting = time.time()
+ # if we have at least one buffered output, wait for a finite
+ # amount of time; otherwise, timeout is None and we wait
+ # until we are notified.
+ cv.wait(timeout=timeout)
+ while msg_queue:
+ _add_output_to_buffer(
+ msg_queue.popleft(), outputs_buffered_per_cell
+ )
+ if outputs_buffered_per_cell and timeout is None:
+ # start the timeout timer
+ timeout = TIMEOUT_S
+ elif timeout is not None:
+ time_waited = time.time() - time_started_waiting
+ timeout -= time_waited
+
+ # the timeout has expired
+ for cell_id, buffer in outputs_buffered_per_cell.items():
+ for output in buffer:
+ _write_console_output(
+ stream, output.stream, cell_id, output.data
+ )
+ outputs_buffered_per_cell = {}
+ timeout = None
diff --git a/marimo/_messaging/errors.py b/marimo/_messaging/errors.py
new file mode 100644
index 0000000000..71c865a0f8
--- /dev/null
+++ b/marimo/_messaging/errors.py
@@ -0,0 +1,64 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from dataclasses import dataclass
+from typing import Optional, Union
+
+from marimo._ast.cell import CellId_t
+from marimo._runtime.dataflow import Edge
+
+
+@dataclass
+class CycleError:
+ edges: tuple[Edge, ...]
+ type: str = "cycle"
+
+
+@dataclass
+class MultipleDefinitionError:
+ name: str
+ cells: tuple[CellId_t, ...]
+ type: str = "multiple-defs"
+
+
+@dataclass
+class DeleteNonlocalError:
+ name: str
+ cells: tuple[CellId_t, ...]
+ type: str = "delete-nonlocal"
+
+
+@dataclass
+class MarimoInterruptionError:
+ type: str = "interruption"
+
+
+@dataclass
+class MarimoExceptionRaisedError:
+ msg: str
+ # None for if raising_cell is the current cell
+ raising_cell: Optional[CellId_t]
+ type: str = "exception"
+
+
+@dataclass
+class MarimoSyntaxError:
+ msg: str
+ type: str = "syntax"
+
+
+@dataclass
+class UnknownError:
+ msg: str
+ type: str = "unknown"
+
+
+Error = Union[
+ CycleError,
+ MultipleDefinitionError,
+ DeleteNonlocalError,
+ MarimoExceptionRaisedError,
+ MarimoInterruptionError,
+ MarimoSyntaxError,
+ UnknownError,
+]
diff --git a/marimo/_messaging/message_types.py b/marimo/_messaging/message_types.py
new file mode 100644
index 0000000000..0350c90d22
--- /dev/null
+++ b/marimo/_messaging/message_types.py
@@ -0,0 +1,84 @@
+# Copyright 2023 Marimo. All rights reserved.
+"""Message Types
+
+Messages that the kernel sends to the frontend.
+"""
+
+from __future__ import annotations
+
+import time
+from dataclasses import asdict, dataclass, field
+from typing import ClassVar, Dict, Literal, Optional, Union, cast
+
+from marimo._ast.cell import CellId_t
+from marimo._messaging.cell_output import CellOutput
+from marimo._messaging.completion_option import CompletionOption
+from marimo._plugins.core.web_component import JSONType
+
+
+# A cell-op's data has three optional fields:
+#
+# output - a CellOutput
+# console - a CellOutput (console message to append), or a list of CellOutputs
+# status - execution status (idle, queued, running)
+#
+# NB: omitting a field means that its value should be unchanged
+#
+# and one required field:
+#
+# cell_id - the cell id
+@dataclass
+class CellOp:
+ name: ClassVar[str] = "cell-op"
+ cell_id: CellId_t
+ output: Optional[CellOutput] = None
+ console: Optional[Union[CellOutput, list[CellOutput]]] = None
+ status: Optional[Literal["idle", "queued", "running"]] = None
+ timestamp: float = field(default_factory=lambda: time.time())
+
+
+@dataclass
+class RemoveUIElements:
+ name: ClassVar[str] = "remove-ui-elements"
+ cell_id: CellId_t
+
+
+@dataclass
+class Interrupted:
+ name: ClassVar[str] = "interrupted"
+
+
+@dataclass
+class CompletedRun:
+ name: ClassVar[str] = "completed-run"
+
+
+@dataclass
+class KernelReady:
+ name: ClassVar[str] = "kernel-ready"
+ codes: tuple[str, ...]
+ names: tuple[str, ...]
+
+
+@dataclass
+class CompletionResult:
+ name: ClassVar[str] = "completion-result"
+ completion_id: str
+ prefix_length: int
+ options: list[CompletionOption]
+
+
+MessageType = Union[
+ CellOp,
+ RemoveUIElements,
+ Interrupted,
+ CompletedRun,
+ KernelReady,
+ CompletionResult,
+]
+
+
+# TODO(akshayka): fix typing once mypy/dataclasses has stricter
+# typing for asdict
+def serialize(message: MessageType) -> dict[str, JSONType]:
+ return cast(Dict[str, JSONType], asdict(message))
diff --git a/marimo/_messaging/messages.py b/marimo/_messaging/messages.py
new file mode 100644
index 0000000000..d4e338191e
--- /dev/null
+++ b/marimo/_messaging/messages.py
@@ -0,0 +1,153 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import sys
+from typing import Any, Optional, Sequence
+
+from marimo._ast.cell import CellId_t
+from marimo._messaging.cell_output import CellOutput
+from marimo._messaging.errors import Error
+from marimo._messaging.message_types import (
+ CellOp,
+ CompletedRun,
+ Interrupted,
+ RemoveUIElements,
+ serialize,
+)
+from marimo._messaging.streams import OUTPUT_MAX_BYTES
+from marimo._output.formatting import get_formatter
+from marimo._runtime.context import get_context
+
+
+def write_output(
+ channel: str, mimetype: str, data: str, cell_id: CellId_t
+) -> None:
+ if (size := sys.getsizeof(data)) > OUTPUT_MAX_BYTES:
+ from marimo._output.md import md
+ from marimo._plugins.stateless.callout_output import callout
+
+ warning = callout(
+ md(
+ f"""
+ <span class="text-error">**Your output is too large**</span>
+
+ Your output is too large for marimo to show. It has a size
+ of {size} bytes. Did you output this object by accident?
+
+ If this limitation is a problem for you, please reach out
+ to us on [Discord](https://discord.gg/JE7nhX6mD8) or
+ [Github](https://github.com/marimo-team/marimo/issues).
+ """
+ ),
+ kind="warn",
+ )
+ mimetype, data = warning._mime_()
+
+ get_context().stream.write(
+ op=CellOp.name,
+ data=serialize(
+ CellOp(
+ cell_id=cell_id,
+ output=CellOutput(
+ channel=channel,
+ mimetype=mimetype,
+ data=data,
+ ),
+ status="idle",
+ )
+ ),
+ )
+
+
+def write_queued(cell_id: CellId_t) -> None:
+ get_context().stream.write(
+ op=CellOp.name,
+ data=serialize(CellOp(cell_id=cell_id, status="queued")),
+ )
+
+
+def write_new_run(cell_id: CellId_t) -> None:
+ get_context().stream.write(
+ op=CellOp.name,
+ data=serialize(CellOp(cell_id=cell_id, console=[], status="running")),
+ )
+
+
+def write_marimo_error(
+ data: Sequence[Error], clear_console: bool, cell_id: CellId_t
+) -> None:
+ console: Optional[list[CellOutput]] = [] if clear_console else None
+ get_context().stream.write(
+ op=CellOp.name,
+ data=serialize(
+ CellOp(
+ cell_id=cell_id,
+ output=CellOutput(
+ channel="marimo-error",
+ mimetype="application/vnd.marimo+error",
+ data=data,
+ ),
+ console=console,
+ status="idle",
+ )
+ ),
+ )
+
+
+def write_interrupted() -> None:
+ get_context().stream.write(op=Interrupted.name, data={})
+
+
+def write_completed_run() -> None:
+ get_context().stream.write(op=CompletedRun.name, data={})
+
+
+def write_remove_ui_elements(cell_id: CellId_t) -> None:
+ get_context().stream.write(
+ op=RemoveUIElements.name,
+ data=serialize(RemoveUIElements(cell_id=cell_id)),
+ )
+
+
+def write_output_to_global_stream(
+ channel: str, mimetype: str, data: str
+) -> None:
+ stream = get_context().stream
+ assert stream.cell_id is not None
+ write_output(channel, mimetype, data, stream.cell_id)
+
+
+def write_to_global_console_stream(
+ channel: str, mimetype: str, data: str
+) -> None:
+ stream = get_context().stream
+ assert stream.cell_id is not None
+ stream.write(
+ op=CellOp.name,
+ data=serialize(
+ CellOp(
+ cell_id=stream.cell_id,
+ console=CellOutput(
+ channel=channel,
+ mimetype=mimetype,
+ data=data,
+ ),
+ )
+ ),
+ )
+
+
+def _show(value: Any, mimetype: Optional[str] = None) -> None:
+ """Shows a value in the current cell's console area
+
+ Uses the media protocol to instantiate a displayable element
+ for `value`.
+ """
+ if (formatter := get_formatter(value)) is not None:
+ mimetype, data = formatter(value)
+ else:
+ mimetype, data = ("text/plain", value)
+
+ write_to_global_console_stream(
+ channel="output", mimetype=mimetype, data=data
+ )
diff --git a/marimo/_messaging/streams.py b/marimo/_messaging/streams.py
new file mode 100644
index 0000000000..333bdf55af
--- /dev/null
+++ b/marimo/_messaging/streams.py
@@ -0,0 +1,232 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import contextlib
+import os
+import sys
+import threading
+from collections import deque
+from multiprocessing.connection import Connection
+from typing import Any, Iterator, Optional
+
+from marimo._ast.cell import CellId_t
+from marimo._messaging.console_output_worker import ConsoleMsg, buffered_writer
+from marimo._runtime.context import get_context
+
+# Byte limits on outputs. Limits exist for two reasons:
+#
+# 1. We use a multiprocessing.Connection object to send outputs from
+# the kernel to the server (the server then sends the output to
+# the frontend via a websocket). The Connection object has a limit
+# of ~32MiB that it can send before it chokes
+# (https://docs.python.org/3/library/multiprocessing.html#multiprocessing.connection.Connection.send).
+#
+# TODO(akshayka): Get around this by breaking up the message sent
+# over the Connection or plumbing the websocket into the kernel.
+#
+# 2. The frontend chokes when we send outputs that are too big, i.e.
+# it freezes and sometimes even crashes. That can lead to lost work.
+#
+# Usually users only output gigantic things accidentally, so refusing
+# to show large outputs should in most cases not bother the user too much.
+# In any case, it's better than breaking the frontend/kernel.
+#
+# Output not shown if larger than OUTPUT_MAX_BYTES=10MB
+OUTPUT_MAX_BYTES = 10_000_000
+
+# Standard stream truncated if larger than STD_STREAM_MAX_BYTES=1MB
+STD_STREAM_MAX_BYTES = 1_000_000
+
+
+class Stream:
+ """A thread-safe wrapper around a pipe."""
+
+ def __init__(self, pipe: Connection, cell_id: Optional[CellId_t] = None):
+ self.pipe = pipe
+ self.cell_id = cell_id
+ # A single stream is shared by the kernel and the code completion
+ # worker. The lock should almost always be uncontended.
+ self.stream_lock = threading.Lock()
+ # Console outputs are buffered
+ self.console_msg_cv = threading.Condition(threading.Lock())
+ self.console_msg_queue: deque[ConsoleMsg] = deque()
+ self.buffered_console_thread = threading.Thread(
+ target=buffered_writer,
+ args=(self.console_msg_queue, self, self.console_msg_cv),
+ )
+ self.buffered_console_thread.start()
+
+ def write(self, op: str, data: dict[Any, Any]) -> None:
+ with self.stream_lock:
+ self.pipe.send((op, data))
+
+
+class Stdout:
+ def __init__(self, stream: Stream):
+ self.stream = stream
+
+ def write(self, data: str) -> None:
+ assert self.stream.cell_id is not None
+ if not isinstance(data, str):
+ raise TypeError(
+ "write() argument must be a str, not %s" % type(data).__name__
+ )
+ if sys.getsizeof(data) > STD_STREAM_MAX_BYTES:
+ sys.stderr.write(
+ "Warning: marimo truncated a very large console output.\n"
+ )
+ data = data[: int(STD_STREAM_MAX_BYTES)] + " ... "
+ self.stream.console_msg_queue.append(
+ ConsoleMsg(stream="stdout", cell_id=self.stream.cell_id, data=data)
+ )
+ with self.stream.console_msg_cv:
+ self.stream.console_msg_cv.notify()
+
+ def flush(self) -> None:
+ # TODO(akshayka): maybe force the buffered writer to write
+ return
+
+ def writable(self) -> bool:
+ return True
+
+ def readable(self) -> bool:
+ return False
+
+ def seekable(self) -> bool:
+ return False
+
+
+class Stderr:
+ def __init__(self, stream: Stream):
+ self.stream = stream
+
+ def write(self, data: str) -> None:
+ assert self.stream.cell_id is not None
+ if not isinstance(data, str):
+ raise TypeError(
+ "write() argument must be a str, not %s" % type(data).__name__
+ )
+ if sys.getsizeof(data) > STD_STREAM_MAX_BYTES:
+ data = (
+ "Warning: marimo truncated a very large console output.\n"
+ + data[: int(STD_STREAM_MAX_BYTES)]
+ + " ... "
+ )
+
+ with self.stream.console_msg_cv:
+ self.stream.console_msg_queue.append(
+ ConsoleMsg(
+ stream="stderr", cell_id=self.stream.cell_id, data=data
+ )
+ )
+ self.stream.console_msg_cv.notify()
+
+ def flush(self) -> None:
+ return
+
+ def writable(self) -> bool:
+ return True
+
+ def readable(self) -> bool:
+ return False
+
+ def seekable(self) -> bool:
+ return False
+
+
+def forward_os_stream(stream_object: Stdout | Stderr, fd: int) -> None:
+ while True:
+ data = os.read(fd, 1024)
+ if not data:
+ break
+ stream_object.write(data.decode())
+
+
+def dup2newfd(fd: int) -> tuple[int, int, int]:
+ """Create a pipe, with `fd` at the write end of it.
+
+ Returns
+ - duplicate (os.dup) of `fd`
+ - read end of pipe
+ - fd (which now points to the file referenced by the write end of the pipe)
+
+ When done with the pipe, the write-end of the pipe should be closed
+ and remapped to point to the saved duplicate. The read end should
+ also be closed, as should the saved duplicate.
+ """
+ # fd_dup keeps a pointer to `fd`'s original location
+ fd_dup = os.dup(fd)
+ # create a pipe, with `fd` as the write end of it
+ read_fd, write_fd = os.pipe()
+ # repurpose fd to point to the write-end of the pipe
+ os.dup2(write_fd, fd)
+ os.close(write_fd)
+ return fd_dup, read_fd, fd
+
+
+# Redirect stdout/stderr, if they have been installed
+def redirect_streams(cell_id: CellId_t) -> Iterator[None]:
+ ctx = get_context()
+ ctx.stream.cell_id = cell_id
+ if ctx.stdout is None or ctx.stderr is None:
+ try:
+ yield
+ finally:
+ ctx.stream.cell_id = None
+ return
+
+ # All six of these file descriptors will need to be closed later
+ stdout_duped, stdout_read_fd, stdout_fd = dup2newfd(sys.stdout.fileno())
+ stderr_duped, stderr_read_fd, stderr_fd = dup2newfd(sys.stderr.fileno())
+
+ # redirecting the standard streams in this way appears to have an overhead
+ # of ~1-2ms; the following alternatives had high variance, with up to 30ms
+ # overhead
+ # - reusing the same two threads instead of creating and destroying on
+ # each call; this requires (slow) synchronization with locks
+ # - using a multiprocessing ThreadPool
+ # - using a concurrent.futures.ThreadPool/ProcessPool
+ stdout_thread = threading.Thread(
+ target=forward_os_stream, args=(ctx.stdout, stdout_read_fd)
+ )
+ stderr_thread = threading.Thread(
+ target=forward_os_stream, args=(ctx.stderr, stderr_read_fd)
+ )
+
+ py_stdout = sys.stdout
+ py_stderr = sys.stderr
+ sys.stdout = ctx.stdout # type: ignore
+ sys.stderr = ctx.stderr # type: ignore
+
+ stdout_thread.start()
+ stderr_thread.start()
+
+ try:
+ yield
+ finally:
+ # Restore the original std file descriptors: point stdout_fd and
+ # stderr_fd to their original locations. Before this call, stdout_fd
+ # and stderr_fd are referring to write ends of pipes. dup2 will
+ # close these fds before reusing them, which ensures that the
+ # forwarding stdout_thread and stderr_threads will terminate.
+ os.dup2(stdout_duped, stdout_fd)
+ os.dup2(stderr_duped, stderr_fd)
+
+ stdout_thread.join()
+ stderr_thread.join()
+
+ # Close these descriptors, since the std file descriptors have been
+ # restored.
+ os.close(stdout_duped)
+ os.close(stderr_duped)
+
+ # Close the read ends of the pipes
+ os.close(stdout_read_fd)
+ os.close(stderr_read_fd)
+
+ # Restore Python stdout/stderr
+ sys.stdout = py_stdout
+ sys.stderr = py_stderr
+
+ ctx.stream.cell_id = None
diff --git a/marimo/_output/__init__.py b/marimo/_output/__init__.py
new file mode 100644
index 0000000000..618f22fc54
--- /dev/null
+++ b/marimo/_output/__init__.py
@@ -0,0 +1 @@
+# Copyright 2023 Marimo. All rights reserved.
diff --git a/marimo/_output/doc.py b/marimo/_output/doc.py
new file mode 100644
index 0000000000..54e149b0fd
--- /dev/null
+++ b/marimo/_output/doc.py
@@ -0,0 +1,34 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from typing import Any, Optional
+
+from marimo._output.hypertext import Html
+from marimo._output.md import md
+from marimo._output.rich_help import mddoc
+
+
+@mddoc
+def doc(obj: Any) -> Optional[Html]:
+ """Get documentation about an object.
+
+ If the object implements the `RichHelp` protocol, the documentation will be
+ rendered as markdown.
+
+ **Args.**
+
+ - `obj`: The object to get documentation about.
+
+ **Returns.**
+
+ - Documentation as an `Html` object if the object implements `RichHelp`;
+ otherwise, documentation is printed to console (and nothing is returned)
+ """
+ if hasattr(obj, "_rich_help_"):
+ msg = obj._rich_help_()
+ return (
+ md(msg) if msg is not None else md("No documentation available.")
+ )
+ else:
+ help(obj)
+ return None
diff --git a/marimo/_output/formatters/__init__.py b/marimo/_output/formatters/__init__.py
new file mode 100644
index 0000000000..618f22fc54
--- /dev/null
+++ b/marimo/_output/formatters/__init__.py
@@ -0,0 +1 @@
+# Copyright 2023 Marimo. All rights reserved.
diff --git a/marimo/_output/formatters/altair_formatters.py b/marimo/_output/formatters/altair_formatters.py
new file mode 100644
index 0000000000..df453e0171
--- /dev/null
+++ b/marimo/_output/formatters/altair_formatters.py
@@ -0,0 +1,36 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from marimo._output.formatters.formatter_factory import FormatterFactory
+from marimo._output.utils import flatten_string
+
+
+class AltairFormatter(FormatterFactory):
+ @staticmethod
+ def package_name() -> str:
+ return "altair"
+
+ def register(self) -> None:
+ import html
+
+ import altair # type:ignore[import]
+
+ from marimo._output import formatting
+
+ @formatting.formatter(altair.TopLevelMixin)
+ def _show_chart(chart: altair.Chart) -> tuple[str, str]:
+ # TODO(akshayka): remove the `onload` hack and handle iframe
+ # resizing entirely in the frontend
+ # `__resizeIframe` is a script defined in the frontend that sets
+ # the height of the iframe to the height of the contained document
+ return (
+ "text/html",
+ (
+ flatten_string(
+ f"<iframe srcdoc='{html.escape(chart.to_html())}'"
+ "frameborder='0' scrolling='auto'"
+ "style='width: 100%'"
+ "onload='__resizeIframe(this)'></iframe>"
+ )
+ ),
+ )
diff --git a/marimo/_output/formatters/formatter_factory.py b/marimo/_output/formatters/formatter_factory.py
new file mode 100644
index 0000000000..c86621fda3
--- /dev/null
+++ b/marimo/_output/formatters/formatter_factory.py
@@ -0,0 +1,28 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import abc
+from typing import Optional
+
+
+# Abstract base class for formatters that are installed at runtime.
+class FormatterFactory(abc.ABC):
+ @staticmethod
+ @abc.abstractmethod
+ def package_name() -> Optional[str]:
+ """Name of third-party package that this formatter is for
+
+ **Important**: should not actually import the package, since that will
+ slow down all imports.
+
+ Return `None` if the formatter isn't for any specific package.
+ """
+ raise NotImplementedError
+
+ @abc.abstractmethod
+ def register(self) -> None:
+ """Registers formatters.
+
+ Formatters can be registered using the formatters.formatter decorator.
+ """
+ raise NotImplementedError
diff --git a/marimo/_output/formatters/formatters.py b/marimo/_output/formatters/formatters.py
new file mode 100644
index 0000000000..6587aa7fe4
--- /dev/null
+++ b/marimo/_output/formatters/formatters.py
@@ -0,0 +1,116 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import sys
+from typing import Any, Callable, Sequence
+
+from marimo._output.formatters.altair_formatters import AltairFormatter
+from marimo._output.formatters.formatter_factory import FormatterFactory
+from marimo._output.formatters.matplotlib_formatters import MatplotlibFormatter
+from marimo._output.formatters.pandas_formatters import PandasFormatter
+from marimo._output.formatters.plotly_formatters import PlotlyFormatter
+from marimo._output.formatters.seaborn_formatters import SeabornFormatter
+from marimo._output.formatters.structures import StructuresFormatter
+
+# Map from formatter factory's package name to formatter, for third-party
+# modules. These formatters will be registered if and when their associated
+# packages are imported.
+THIRD_PARTY_FACTORIES: dict[str, FormatterFactory] = {
+ AltairFormatter.package_name(): AltairFormatter(),
+ MatplotlibFormatter.package_name(): MatplotlibFormatter(),
+ PandasFormatter.package_name(): PandasFormatter(),
+ PlotlyFormatter.package_name(): PlotlyFormatter(),
+ SeabornFormatter.package_name(): SeabornFormatter(),
+}
+
+# Formatters for builtin types and other things that don't require a
+# third-party module import. These formatters' register methods need to be
+# fast: we don't want their registration to noticeably delay program start-up.
+NATIVE_FACTORIES: Sequence[FormatterFactory] = [
+ StructuresFormatter(),
+]
+
+
+def register_formatters() -> None:
+ """Register formatters with marimo.
+
+ marimo comes packaged with rich formatters for a number of third-party
+ libraries. This function hooks into Python's import system to register
+ these formatters with the kernel if and when a supported third-party
+ library is imported into a marimo notebook.
+
+ Hooking into the import system is more complicated than the alternative
+ of checking whether a package is installed (by importing it) and then
+ registering its formatters at kernel start-up. However, because some
+ packages imports take a long time, this alternative would add considerable
+ delay at program start-up, as the kernel would block as it registered
+ all formatters before running the notebook. Hooking into the import
+ system makes formatter registration completely lazy, improving
+ UX at the cost of increased complexity that we have to maintain. In this
+ case, the trade-off is worth it.
+ """
+
+ # We loop over all MetaPathFinders, monkey-patching them to run third-party
+ # formatters whenever a supported third-party package is imported (in
+ # particular, when its module is exec'd). This ensures that formatters are
+ # loaded at the last possible moment: when its package is imported.
+ #
+ # Python's import logic has roughly the following logic:
+ # 1. search for a module; if found, create a "module spec" that knows
+ # how to create and load the module.
+ # 2. use the spec's loader to load the module.
+ #
+ # We monkey-patch the first step to check if a searched-for module
+ # has a registered formatter. If a registered formatter is found,
+ # our patch in turn patches the loader to run the formatter after
+ # the module is exec'd.
+ #
+ # Because Python's import system caches modules, our formatters'
+ # register methods will be called at most once.
+ for finder in sys.meta_path:
+ original_find_spec = finder.find_spec
+
+ # We include `original_find_spec` as a kwarg to force it to be bound
+ # to the new `find_spec` method; this is needed because closures are
+ # late-binding and we're in a for loop ...
+ def find_spec( # type:ignore[no-untyped-def]
+ fullname,
+ path,
+ target,
+ original_find_spec=original_find_spec,
+ ) -> Any:
+ spec = original_find_spec(fullname, path, target)
+ if spec is None:
+ return spec
+
+ if spec.loader is not None and fullname in THIRD_PARTY_FACTORIES:
+ # We're now in the process of importing a module with
+ # an associated formatter factory. We'll hook into its
+ # loader to register the formatters.
+ original_exec_module = spec.loader.exec_module
+ factory = THIRD_PARTY_FACTORIES[fullname]
+
+ # Once again, we use kwargs instead of closing over the
+ # variables `original_exec_module` and `factory` to force
+ # binding.
+ def exec_module(
+ module: Any,
+ original_exec_module: Callable[
+ ..., Any
+ ] = original_exec_module,
+ factory: FormatterFactory = factory,
+ ) -> Any:
+ loader_return_value = original_exec_module(module)
+ factory.register()
+ return loader_return_value
+
+ spec.loader.exec_module = exec_module
+
+ return spec
+
+ finder.find_spec = find_spec # type:ignore[assignment]
+
+ # These factories are for builtins or other things that don't require a
+ # package import. So we can register them at program start-up.
+ for factory in NATIVE_FACTORIES:
+ factory.register()
diff --git a/marimo/_output/formatters/matplotlib_formatters.py b/marimo/_output/formatters/matplotlib_formatters.py
new file mode 100644
index 0000000000..ae1f393b1c
--- /dev/null
+++ b/marimo/_output/formatters/matplotlib_formatters.py
@@ -0,0 +1,52 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from marimo._output.formatters.formatter_factory import FormatterFactory
+
+
+class MatplotlibFormatter(FormatterFactory):
+ @staticmethod
+ def package_name() -> str:
+ return "matplotlib"
+
+ def register(self) -> None:
+ import matplotlib # type: ignore
+
+ from marimo._runtime.context import get_global_context
+
+ get_global_context().set_mpl_installed(True)
+ from marimo._output import mpl # noqa: F401
+
+ matplotlib.use("module://marimo._output.mpl")
+
+ import base64
+ import io
+
+ from matplotlib.artist import Artist # type: ignore
+ from matplotlib.container import BarContainer # type: ignore
+
+ from marimo._output import formatting
+ from marimo._output.utils import build_data_url
+
+ def mime_data_artist(artist: Artist) -> tuple[str, str]:
+ buf = io.BytesIO()
+ artist.figure.savefig(buf, format="png")
+ mimetype = "image/png"
+ plot_bytes = base64.b64encode(buf.getvalue())
+ return (
+ mimetype,
+ build_data_url(mimetype=mimetype, data=plot_bytes),
+ )
+
+ # monkey-patch a _mime_ method, instead of using a formatter, because
+ # we want all subclasses of Artist to inherit this renderer.
+ Artist._mime_ = mime_data_artist
+
+ # use an explicit formatter, no need to try to format subclasses of
+ # BarContainer
+ @formatting.formatter(BarContainer)
+ def _show_bar_container(bc: BarContainer) -> tuple[str, str]:
+ if len(bc.patches) > 0:
+ return mime_data_artist(bc.patches[0].figure)
+ else:
+ return ("text/plain", str(bc))
diff --git a/marimo/_output/formatters/pandas_formatters.py b/marimo/_output/formatters/pandas_formatters.py
new file mode 100644
index 0000000000..707901c0cb
--- /dev/null
+++ b/marimo/_output/formatters/pandas_formatters.py
@@ -0,0 +1,32 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from marimo._output.formatters.formatter_factory import FormatterFactory
+from marimo._output.utils import flatten_string
+
+
+class PandasFormatter(FormatterFactory):
+ @staticmethod
+ def package_name() -> str:
+ return "pandas"
+
+ def register(self) -> None:
+ import pandas as pd # type:ignore[import]
+
+ from marimo._output import formatting
+
+ @formatting.formatter(pd.DataFrame)
+ def _show_dataframe(df: pd.DataFrame) -> tuple[str, str]:
+ # Flatten the HTML to avoid indentation issues when
+ # interpolating into other HTML/Markdown with an f-string
+ return (
+ "text/html",
+ flatten_string(df.to_html()),
+ )
+
+ @formatting.formatter(pd.Series)
+ def _show_series(series: pd.Series) -> tuple[str, str]:
+ return (
+ "text/html",
+ flatten_string(series.to_frame().to_html()),
+ )
diff --git a/marimo/_output/formatters/plotly_formatters.py b/marimo/_output/formatters/plotly_formatters.py
new file mode 100644
index 0000000000..bbb97f9510
--- /dev/null
+++ b/marimo/_output/formatters/plotly_formatters.py
@@ -0,0 +1,37 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from marimo._output.formatters.formatter_factory import FormatterFactory
+from marimo._output.utils import flatten_string
+
+
+class PlotlyFormatter(FormatterFactory):
+ @staticmethod
+ def package_name() -> str:
+ return "plotly"
+
+ def register(self) -> None:
+ import html
+
+ import plotly.graph_objects # type:ignore[import]
+ import plotly.io # type:ignore[import]
+
+ from marimo._output import formatting
+
+ @formatting.formatter(plotly.graph_objects.Figure)
+ def _show_plotly_figure(
+ fig: plotly.graph_objects.Figure,
+ ) -> tuple[str, str]:
+ # Outputting the HTML directly results in a memory leak; we use an
+ # iframe to get around the leak. (See
+ # https://github.com/marimo-team/marimo/issues/417)
+ contents = flatten_string(html.escape(plotly.io.to_html(fig)))
+ return (
+ "text/html",
+ (
+ f"<iframe srcdoc='{contents}'"
+ "frameborder='0' scrolling='auto'"
+ "style='width: 100%'"
+ "onload='__resizeIframe(this)'></iframe>"
+ ),
+ )
diff --git a/marimo/_output/formatters/seaborn_formatters.py b/marimo/_output/formatters/seaborn_formatters.py
new file mode 100644
index 0000000000..0c9d7e9bc3
--- /dev/null
+++ b/marimo/_output/formatters/seaborn_formatters.py
@@ -0,0 +1,47 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from marimo._output.formatters.formatter_factory import FormatterFactory
+
+
+class SeabornFormatter(FormatterFactory):
+ @staticmethod
+ def package_name() -> str:
+ return "seaborn"
+
+ def register(self) -> None:
+ from typing import Any, cast
+
+ import seaborn # type:ignore[import]
+
+ from marimo._output import formatting
+ from marimo._output.mime import MIME
+
+ def _show_ax_or_subplots(grid: Any) -> tuple[str, str]:
+ # Seaborn uses matplotlib under the hood: figures and axes are
+ # instances of matplotlib's Artist class. (We've monkey pathed
+ # `Artist` to implement the MIME protocol.)
+ if hasattr(grid, "figure"):
+ return cast(MIME, grid.figure)._mime_()
+ if hasattr(grid, "ax"):
+ return cast(MIME, grid.ax)._mime_()
+ elif hasattr(grid, "axes"):
+ return cast(MIME, grid.axes.flatten()[0])._mime_()
+ else:
+ return ("text/plain", str(grid))
+
+ @formatting.formatter(seaborn.axisgrid.FacetGrid)
+ def _show_facet_grid(
+ fg: seaborn.axisgrid.FacetGrid,
+ ) -> tuple[str, str]:
+ return _show_ax_or_subplots(fg)
+
+ @formatting.formatter(seaborn.axisgrid.PairGrid)
+ def _show_pair_grid(pg: seaborn.axisgrid.PairGrid) -> tuple[str, str]:
+ return _show_ax_or_subplots(pg)
+
+ @formatting.formatter(seaborn.axisgrid.JointGrid)
+ def _show_joint_grid(
+ jg: seaborn.axisgrid.JointGrid,
+ ) -> tuple[str, str]:
+ return _show_ax_or_subplots(jg)
diff --git a/marimo/_output/formatters/structures.py b/marimo/_output/formatters/structures.py
new file mode 100644
index 0000000000..ce42b987d8
--- /dev/null
+++ b/marimo/_output/formatters/structures.py
@@ -0,0 +1,51 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import json
+from typing import Any, Union
+
+from marimo._output import formatting
+from marimo._output.formatters.formatter_factory import FormatterFactory
+from marimo._utils.flatten import CyclicStructureError, flatten
+
+
+def _leaf_formatter(value: object) -> str:
+ formatter = formatting.get_formatter(value)
+ if formatter is None:
+ try:
+ return f"text/plain:{json.dumps(value)}"
+ except TypeError:
+ return f"text/plain:{value}"
+ return ":".join(formatter(value))
+
+
+def format_structure(
+ t: Union[tuple[Any, ...], list[Any], dict[str, Any]]
+) -> Union[tuple[Any, ...], list[Any], dict[str, Any]]:
+ """Format the leaves of a structure.
+
+ Returns a structure of the same shape as `t` with formatted
+ leaves.
+ """
+ flattened, repacker = flatten(t, json_compat_keys=True)
+ return repacker([_leaf_formatter(v) for v in flattened])
+
+
+class StructuresFormatter(FormatterFactory):
+ @staticmethod
+ def package_name() -> None:
+ return None
+
+ def register(self) -> None:
+ @formatting.formatter(list)
+ @formatting.formatter(tuple)
+ @formatting.formatter(dict)
+ def _format_structure(
+ t: Union[tuple[Any, ...], list[Any], dict[str, Any]]
+ ) -> tuple[str, str]:
+ try:
+ formatted_structure = format_structure(t)
+ except CyclicStructureError:
+ return ("text/plain", str(t))
+
+ return ("application/json", json.dumps(formatted_structure))
diff --git a/marimo/_output/formatting.py b/marimo/_output/formatting.py
new file mode 100644
index 0000000000..f52b9c091f
--- /dev/null
+++ b/marimo/_output/formatting.py
@@ -0,0 +1,173 @@
+# Copyright 2023 Marimo. All rights reserved.
+"""Formatting protocol
+
+This module defines a protocol for implementing objects that can be displayed
+using marimo's media viewer.
+
+To register a formatter for a type, user have two options:
+ 1. Implement a method _mime_ on the class that takes an instance
+ and returns a (mime, data) tuple (i.e., implement the protocol MIME)
+ 2. Register a formatter function that takes a value and returns
+ a (mime, data) tuple.
+
+The function get_formatter(value: T) can be used to obtain a function that
+instantiates a (mime, data) tuple for a value, with registered formatters
+taking precedence over the MIME protocol.
+"""
+
+from __future__ import annotations
+
+import inspect
+import json
+import types
+from html import escape
+from typing import Any, Callable, Optional, Tuple, Type, TypeVar
+
+from marimo import _loggers as loggers
+from marimo._output.hypertext import Html
+from marimo._output.rich_help import mddoc
+from marimo._output.utils import flatten_string
+from marimo._plugins.stateless.json_output import json_output
+
+T = TypeVar("T")
+
+# we use Tuple instead of the builtin tuple for py3.8 compatibility
+Formatter = Callable[[T], Tuple[str, str]]
+FORMATTERS: dict[Type[Any], Formatter[Any]] = {}
+LOGGER = loggers.marimo_logger()
+
+
+def formatter(t: Type[Any]) -> Callable[[Formatter[T]], Formatter[T]]:
+ """Register a formatter function for a type
+
+ Decorator to register a custom formatter for a given type.
+
+ For example, to register a formatter for a class Foo with a string
+ attribute data:
+
+ ```
+ @formatter(Foo)
+ def show_foo(foo: Foo) -> tuple[str, str]:
+ return ("text/html", f"<p>{foo.data}</p>")
+ ```
+ """
+
+ def register_format(f: Formatter[T]) -> Formatter[T]:
+ FORMATTERS[t] = f
+ return f
+
+ return register_format
+
+
+def get_formatter(obj: T) -> Optional[Formatter[T]]:
+ from marimo._runtime.context import get_context
+
+ if not get_context().initialized and not FORMATTERS:
+ from marimo._output.formatters.formatters import register_formatters
+
+ # Install formatters when marimo is being used without
+ # a kernel (eg, in a unit test or when run as a Python script)
+ register_formatters()
+
+ if type(obj) in FORMATTERS:
+ return FORMATTERS[type(obj)]
+ elif any(isinstance(obj, t) for t in FORMATTERS.keys()):
+ # we avoid using the walrus operator (matched_type := t) above
+ # to keep compatibility with Python < 3.8
+ for t in FORMATTERS.keys():
+ if isinstance(obj, t):
+ return FORMATTERS[t]
+ elif hasattr(obj, "_mime_"):
+ method = obj._mime_
+ if inspect.isclass(obj) and not isinstance(method, (types.MethodType)):
+ return None
+ if callable(method):
+
+ def f(obj: T) -> tuple[str, str]:
+ return obj._mime_() # type: ignore
+
+ return f
+ elif hasattr(obj, "_repr_html_"):
+ method = obj._repr_html_
+ if inspect.isclass(obj) and not isinstance(method, (types.MethodType)):
+ return None
+ if callable(method):
+
+ def f(obj: T) -> tuple[str, str]:
+ return ("text/html", obj._repr_html_()) # type: ignore
+
+ return f
+ return None
+
+
+def get_mimetype_and_data(obj: Any) -> tuple[str, str]:
+ f = get_formatter(obj)
+ if f is None:
+ LOGGER.error("Failed to retrieve formatter for %s", obj)
+ return "text/plain", f"Failed to retrieve formatter for {obj}"
+ else:
+ return f(obj)
+
+
+@mddoc
+def as_html(value: object) -> Html:
+ """Convert a value to HTML that can be embedded into markdown
+
+ This function returns an `Html` object representing `value`. Use it to
+ embed values into Markdown or other HTML strings.
+
+ **Example.**
+
+ ```python3
+ import matplotlib.pyplot as plt
+ plt.plot([1, 2])
+ axis = plt.gca()
+ mo.md(
+ f\"\"\"
+ Here is a plot:
+
+ {mo.as_html(axis)}
+ \"\"\"
+ )
+ ```
+
+ **Args.**
+
+ - `value`: An object
+
+ **Returns.**
+
+ - An `Html` object
+ """
+ if isinstance(value, Html):
+ return value
+
+ formatter = get_formatter(value)
+ if formatter is None:
+ return Html(f"<span>{escape(str(value))}</span>")
+
+ mimetype, data = formatter(value)
+ if mimetype == "text/html":
+ # Using `as_html` to embed multiline HTML content
+ # into a multiline markdown string can break Python markdown's
+ # markdown processor (even if it is working "as intended", it's
+ # behavior is not what we want). If the markdown string is
+ # indentend, and the HTML is interpolated with an f-string,
+ # then only the first line of the interpolated HTML will be indented;
+ # this breaks Python markdown. Unfortunately, we can't indiscriminately
+ # flatten the HTML because whitespace matters for some elements,
+ # like pre tags. So for now we leave it to the formatter functions
+ # to choose whether or not to flatten their HTML
+ return Html(data)
+ elif mimetype == "text/plain":
+ # Flatten the HTML text to avoid indentation issues
+ # when interpolating into markdown/a multiline string
+ return Html(flatten_string(f"<span>{escape(data)}</span>"))
+ elif mimetype.startswith("image"):
+ return Html(flatten_string(f'<img src="{data}" alt="" />'))
+ elif mimetype == "application/json":
+ return Html(
+ flatten_string(json_output(json_data=json.loads(data)).text)
+ )
+ else:
+ raise ValueError(f"Unsupported mimetype {mimetype}")
diff --git a/marimo/_output/hypertext.py b/marimo/_output/hypertext.py
new file mode 100644
index 0000000000..c000100ddf
--- /dev/null
+++ b/marimo/_output/hypertext.py
@@ -0,0 +1,184 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Literal, final
+
+from marimo._output.mime import MIME
+from marimo._output.rich_help import mddoc
+
+if TYPE_CHECKING:
+ from marimo._plugins.core.web_component import JSONType
+ from marimo._plugins.ui._core.ui_element import UIElement
+ from marimo._plugins.ui._impl.batch import batch as batch_plugin
+
+
+@mddoc
+class Html(MIME):
+ """A wrapper around HTML text that can be used as an output.
+
+ Output an `Html` object as the last expression of a cell to render it in
+ your app.
+
+ Use f-strings to embed Html objects as text into other HTML or markdown
+ strings. For example:
+
+ ```python3
+ hello_world = Html('<h2>Hello, World</h2>')
+ Html(
+ f'''
+ <h1>Hello, Universe!</h1>
+ {hello_world}
+ '''
+ )
+ ```
+
+ **Attributes.**
+
+ - `text`: a string of HTML
+
+ **Initialization Args.**
+
+ - `text`: a string of HTML
+
+ **Methods.**
+
+ - `batch`: convert this HTML element into a batched UI element
+ - `callout`: wrap this element in a callout
+ - `center`: center this element in the output area
+ - `right`: right-justify this element in the output area
+ """
+
+ _text: str
+
+ def __init__(self, text: str) -> None:
+ self._text = text
+
+ @property
+ def text(self) -> str:
+ """A string of HTML representing this element."""
+ return self._text
+
+ @final
+ def _mime_(self) -> tuple[str, str]:
+ return ("text/html", self.text)
+
+ def __format__(self, spec: str) -> str:
+ """Format `self` as HTML text"""
+ del spec
+ return "".join([line.strip() for line in self.text.split("\n")])
+
+ @mddoc
+ def batch(self, **elements: UIElement[JSONType, object]) -> batch_plugin:
+ """Convert an HTML object with templated text into a UI element.
+
+ This method lets you create custom UI elements that are represented
+ by arbitrary HTML.
+
+ **Example.**
+
+ ```python3
+ user_info = mo.md(
+ '''
+ - What's your name?: {name}
+ - When were you born?: {birthday}
+ '''
+ ).batch(name=mo.ui.text(), birthday=mo.ui.date())
+ ```
+
+ In this example, `user_info` is a UI Element whose output is markdown
+ and whose value is a dict with keys `'name'` and '`birthday`'
+ (and values equal to the values of their corresponding elements).
+
+ **Args.**
+
+ - elements: the UI elements to interpolate into the HTML template.
+ """
+ from marimo._plugins.ui._impl.batch import batch as batch_plugin
+
+ return batch_plugin(html=self, elements=elements)
+
+ @mddoc
+ def center(self) -> Html:
+ """Center an item.
+
+ **Example.**
+
+ ```python3
+ mo.md("# Hello, world").center()
+ ```
+
+ **Returns.**
+
+ An `Html` object.
+ """
+ from marimo._plugins.stateless import flex
+
+ return flex.hstack([self], justify="center")
+
+ @mddoc
+ def right(self) -> Html:
+ """Right-justify.
+
+ **Example.**
+
+ ```python3
+ mo.md("# Hello, world").right()
+ ```
+
+ **Returns.**
+
+ An `Html` object.
+ """
+ from marimo._plugins.stateless import flex
+
+ return flex.hstack([self], justify="end")
+
+ @mddoc
+ def left(self) -> Html:
+ """Left-justify.
+
+ **Example.**
+
+ ```python3
+ mo.md("# Hello, world").left()
+ ```
+
+ **Returns.**
+
+ An `Html` object.
+ """
+ from marimo._plugins.stateless import flex
+
+ return flex.hstack([self], justify="start")
+
+ @mddoc
+ def callout(
+ self, kind: Literal["neutral", "alert", "warn", "success"] = "neutral"
+ ) -> Html:
+ """Create a callout containing this HTML element.
+
+ A callout wraps your HTML element in a raised box, emphasizing its
+ importance. You can style the callout for different situations with the
+ `kind` argument.
+
+ **Examples.**
+
+ ```python3
+ mo.md("Hooray, you did it!").callout(kind="success")
+ ```
+
+ ```python3
+ mo.md("It's dangerous to go alone!").callout(kind="warn")
+ ```
+ """
+
+ from marimo._plugins.stateless.callout_output import (
+ callout as _callout,
+ )
+
+ return _callout(self, kind=kind)
+
+
+def _js(text: str) -> Html:
+ # TODO: interpolation of Python values to javascript
+ return Html("<script>" + text + "</script>")
diff --git a/marimo/_output/md.py b/marimo/_output/md.py
new file mode 100644
index 0000000000..073b66f01b
--- /dev/null
+++ b/marimo/_output/md.py
@@ -0,0 +1,124 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from inspect import cleandoc
+
+import markdown # type: ignore
+
+from marimo._output.hypertext import Html
+from marimo._output.rich_help import mddoc
+
+extension_configs = {
+ "pymdownx.arithmatex": {
+ # Use "generic" mode, no preview, since we don't use MathJax
+ "preview": False,
+ "generic": True,
+ # The default "\\(" causes problems when passing
+ # html-escaped `md` output back into `md`
+ "tex_inline_wrap": ["||(", "||)"],
+ "tex_block_wrap": ["||[", "||]"],
+ # Wrap latex in a custom element
+ "block_tag": "marimo-tex",
+ "inline_tag": "marimo-tex",
+ },
+ "pymdownx.superfences": {
+ "disable_indented_code_blocks": True,
+ "css_class": "codehilite",
+ },
+}
+
+
+def _md(text: str, apply_markdown_class: bool = True) -> Html:
+ # cleandoc uniformly strips leading whitespace; useful for
+ # indented multiline strings
+ text = cleandoc(text)
+ # markdown.markdown appends a newline, hence strip
+ html_text = markdown.markdown(
+ text,
+ extensions=[
+ # Syntax highlighting
+ "codehilite",
+ # LaTeX
+ "pymdownx.arithmatex",
+ # Subscripts and strikethrough
+ "pymdownx.tilde",
+ # Better code blocks
+ "pymdownx.superfences",
+ ],
+ extension_configs=extension_configs,
+ ).strip()
+ # replace <p> tags with <span> as HTML doesn't allow nested <div>s in <p>s
+ html_text = html_text.replace("<p>", "<span class='paragraph'>").replace(
+ "</p>", "</span>"
+ )
+
+ if apply_markdown_class:
+ return Html("<span class='markdown'>" + html_text + "</span>")
+ else:
+ return Html(html_text)
+
+
+@mddoc
+def md(text: str) -> Html:
+ r"""Write markdown
+
+ This function takes a string of markdown as input and returns an Html
+ object. Output the object as the last expression of a cell to render
+ the markdown in your app.
+
+ **Interpolation.**
+
+ You can interpolate Python values into your markdown strings, for example
+ using f-strings. Html objects and UI elements can be directly interpolated.
+ For example:
+
+ ```python3
+ text_input = mo.ui.text()
+ md(f"Enter some text: {text_input}")
+ ```
+
+ For other objects, like plots, use marimo's `as_html` method to embed
+ them in markdown:
+
+ ```python3
+ import matplotlib.pyplot as plt
+ plt.plot([1, 2])
+ axis = plt.gca()
+ md(f"Here's a plot: {mo.as_html(axis)}")
+ ```
+
+ **LaTeX.**
+
+ Enclose LaTeX in single '\$' signs for inline math, and double '\$\$' for
+ display math or square brackets for display math. (Use raw strings,
+ prefixed with an "r", to use single backslashes.) For example:
+
+ ```python3
+ mo.md(
+ r'''
+ The exponential function $f(x) = e^x$ can be represented as
+
+ \[
+ f(x) = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \ldots.
+ \]
+ '''
+ )
+ ```
+ renders:
+
+ The exponential function $f(x) = e^x$ can be represented as
+
+ $$
+ f(x) = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \ldots.
+ $$
+
+
+ **Args**:
+
+ - `text`: a string of markdown
+
+ **Returns**:
+
+ - An `Html` object.
+ """
+ return _md(text)
diff --git a/marimo/_output/mime.py b/marimo/_output/mime.py
new file mode 100644
index 0000000000..9af115d36c
--- /dev/null
+++ b/marimo/_output/mime.py
@@ -0,0 +1,37 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from typing import Protocol
+
+
+class MIME(Protocol):
+ """Protocol for instantiating objects using marimo's media viewer.
+
+ To implement this protocol, a class needs to define
+ just one method, _mime_.
+ """
+
+ # TODO(akshayka): Single source of truth for supported mimetypes. The
+ # documented types below are copied from the frontend
+ def _mime_(self) -> tuple[str, str]:
+ """Return a tuple (mimetype, data)
+
+ Return a mimetype and the string data to instantiate it in marimo's
+ media viewer.
+
+ The supported mimetypes are:
+ application/json
+ application/vnd.marimo+error
+ image/png
+ image/svg+xml
+ image/tiff
+ image/avif
+ image/bmp
+ image/gif
+ image/jpeg
+ video/mp4
+ video/mpeg
+ text/html
+ text/plain
+ """
+ raise NotImplementedError
diff --git a/marimo/_output/mpl.py b/marimo/_output/mpl.py
new file mode 100644
index 0000000000..65387b284a
--- /dev/null
+++ b/marimo/_output/mpl.py
@@ -0,0 +1,55 @@
+# Copyright 2023 Marimo. All rights reserved.
+"""marimo backend for matplotlib
+
+Adapted from
+
+matplotlib/matplotlib/blob/main/lib/matplotlib/backends/backend_template.py
+
+and
+
+https://stackoverflow.com/questions/58153024/matplotlib-how-to-create-original-backend
+"""
+from __future__ import annotations
+
+import base64
+import io
+from typing import Optional
+
+import matplotlib.pyplot as plt # type: ignore
+from matplotlib.backend_bases import FigureManagerBase, Gcf # type: ignore
+from matplotlib.backends.backend_agg import FigureCanvasAgg # type: ignore
+
+from marimo._messaging.messages import write_to_global_console_stream
+from marimo._output.utils import build_data_url
+
+FigureCanvas = FigureCanvasAgg
+
+
+def close_figures() -> None:
+ if Gcf.get_all_fig_managers():
+ plt.close("all")
+
+
+def _internal_show(canvas: FigureCanvasAgg) -> None:
+ buf = io.BytesIO()
+ buf.seek(0)
+ canvas.figure.savefig(buf, format="png")
+ plt.close(canvas.figure)
+ mimetype = "image/png"
+ plot_bytes = base64.b64encode(buf.getvalue())
+ write_to_global_console_stream(
+ data=build_data_url(mimetype=mimetype, data=plot_bytes),
+ channel="media",
+ mimetype=mimetype,
+ )
+
+
+class FigureManager(FigureManagerBase): # type: ignore
+ def show(self) -> None:
+ _internal_show(self.canvas)
+
+
+def show(*, block: Optional[bool] = None) -> None:
+ del block
+ for manager in Gcf.get_all_fig_managers():
+ _internal_show(manager.canvas)
diff --git a/marimo/_output/rich_help.py b/marimo/_output/rich_help.py
new file mode 100644
index 0000000000..69415ae17a
--- /dev/null
+++ b/marimo/_output/rich_help.py
@@ -0,0 +1,111 @@
+# Copyright 2023 Marimo. All rights reserved.
+import inspect
+from typing import Any, Callable, Generic, Optional, Protocol, TypeVar, cast
+
+from typing_extensions import runtime_checkable
+
+from marimo._utils.format_signature import format_signature
+
+_WRAP_WIDTH = 72
+
+
+def _format_parameter(parameter: inspect.Parameter) -> str:
+ annotation = (
+ ""
+ if parameter.annotation == inspect.Parameter.empty
+ else ": " + cast(str, parameter.annotation)
+ )
+ default = (
+ ""
+ if parameter.default == inspect.Parameter.empty
+ else f" = '{str(parameter.default)}'"
+ if isinstance(parameter.default, str)
+ else f" = {str(parameter.default)}"
+ )
+ return parameter.name + annotation + default
+
+
+def _get_signature(obj: Any) -> str:
+ name = cast(str, obj.__name__)
+ try:
+ signature = inspect.signature(obj)
+ except Exception:
+ # classes with fancy metaclasses, like TypedDict, can throw
+ # an exception
+ return name + ": " + str(type(obj))
+
+ parameters = ", ".join(
+ [
+ _format_parameter(parameter)
+ for parameter in signature.parameters.values()
+ ]
+ )
+ if inspect.isclass(obj):
+ signature_text = name + "(" + parameters + ")"
+ return format_signature("class ", signature_text, width=_WRAP_WIDTH)
+ else:
+ return_annotation = (
+ " -> " + signature.return_annotation
+ if (
+ signature.return_annotation != inspect.Signature.empty
+ and signature.return_annotation
+ )
+ else ""
+ ) + ":"
+ signature_text = (
+ name + "(" + parameters + ")" + cast(str, return_annotation)
+ )
+ return format_signature("def ", signature_text, width=_WRAP_WIDTH)
+
+
+def _doc_with_signature(obj: Any) -> str:
+ """Return docstring with its signature prepended."""
+ signature = "```python\n" + _get_signature(obj) + "\n```"
+ return (
+ signature + "\n\n" + inspect.cleandoc(cast(str, obj.__doc__))
+ if obj.__doc__ is not None
+ else signature
+ )
+
+
+T = TypeVar("T", bound=Callable[..., Any])
+
+
+@runtime_checkable
+class RichHelp(Protocol, Generic[T]):
+ """Protocol to provide a class or function docstring formatted as markdown.
+
+ Implement the protocol by implementing a `_rich_help_` static method, which
+ should render a Markdown string documenting the class. For example:
+
+ ```python3
+ class MyClass:
+ \"\"\"**MyClass.**
+
+ A class implementing the `RichHelp` protocol.
+ \"\"\"
+
+ @staticmethod
+ def _rich_help_() -> Optional[str]:
+ return MyClass.__doc__
+ ```
+ """
+
+ @staticmethod
+ def _rich_help_() -> Optional[str]:
+ return _doc_with_signature(RichHelp)
+
+ __call__: T
+
+
+def mddoc(obj: T) -> T:
+ """Adds a `_rich_help_` method to the passed in object.
+
+ Returns `obj`, with modification to implement the `RichHelp` protocol.
+ """
+ rich_help = cast(RichHelp[T], obj)
+ rich_help._rich_help_ = lambda: _doc_with_signature( # type: ignore[method-assign] # noqa: E501
+ obj
+ )
+ # cast back to original type, so type-hinters provide helpful information
+ return cast(T, rich_help)
diff --git a/marimo/_output/utils.py b/marimo/_output/utils.py
new file mode 100644
index 0000000000..0e0484b7f2
--- /dev/null
+++ b/marimo/_output/utils.py
@@ -0,0 +1,11 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+
+def build_data_url(mimetype: str, data: bytes) -> str:
+ str_repr = data.decode("utf-8").replace("\n", "")
+ return f"data:{mimetype};base64,{str_repr}"
+
+
+def flatten_string(text: str) -> str:
+ return "".join([line.strip() for line in text.split("\n")])
diff --git a/marimo/_plugins/core/json_encoder.py b/marimo/_plugins/core/json_encoder.py
new file mode 100644
index 0000000000..209c174257
--- /dev/null
+++ b/marimo/_plugins/core/json_encoder.py
@@ -0,0 +1,15 @@
+# Copyright 2023 Marimo. All rights reserved.
+from json import JSONEncoder
+from typing import Any
+
+
+class WebComponentEncoder(JSONEncoder):
+ """Custom JSON encoder for WebComponents"""
+
+ def default(self, obj: Any) -> Any:
+ # Handle MIME objects
+ if hasattr(obj, "_mime_"):
+ (mimetype, data) = obj._mime_()
+ return {"mimetype": mimetype, "data": data}
+ # Fallthrough to default encoder
+ return JSONEncoder.default(self, obj)
diff --git a/marimo/_plugins/core/test_web_component.py b/marimo/_plugins/core/test_web_component.py
new file mode 100644
index 0000000000..eb77c909bf
--- /dev/null
+++ b/marimo/_plugins/core/test_web_component.py
@@ -0,0 +1,51 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import re
+
+from marimo._output.formatting import as_html
+from marimo._output.md import md
+from marimo._plugins.core.web_component import (
+ build_ui_plugin,
+ parse_initial_value,
+)
+
+
+def test_args_escaped() -> None:
+ initial_value = "'ello&"
+ html = build_ui_plugin(
+ "tag-name", initial_value, label=None, args={"text": "a & b"}
+ )
+
+ # args should be JSON-encoded and escaped
+ match = re.search("data-initial-value='(.*?)'", html)
+ assert match is not None
+ assert match.groups()[0] == "&quot;&#x27;ello&amp;&quot;"
+
+ match = re.search("data-text='(.*?)'", html)
+ assert match is not None
+ assert match.groups()[0] == "&quot;a &amp; b&quot;"
+
+
+def test_initial_value_parse() -> None:
+ initial_value = "'ello"
+ html = build_ui_plugin("tag-name", initial_value, label=None, args={})
+
+ # extracted value should be unescaped
+ assert initial_value == parse_initial_value(html)
+
+
+def test_label_md_compiled() -> None:
+ initial_value = "'ello"
+ html = build_ui_plugin("tag-name", initial_value, label="$x$", args={})
+
+ match = re.search("data-label='(.*?)'", html)
+ assert match is not None
+ # "md"'s latex extension generates spans with class name arithmatex
+ assert "arithmatex" in match.groups()[0]
+
+
+def test_embed_dollar_sign_in_md() -> None:
+ markdown = md(as_html(["$", "$"]).text)
+ # don't parse dollar in data as latex
+ assert "arithmatex" not in markdown.text
diff --git a/marimo/_plugins/core/web_component.py b/marimo/_plugins/core/web_component.py
new file mode 100644
index 0000000000..a51993f097
--- /dev/null
+++ b/marimo/_plugins/core/web_component.py
@@ -0,0 +1,117 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import json
+import re
+from html import escape, unescape
+from typing import Mapping, Optional, Sequence, TypeVar, Union, cast
+
+from typing_extensions import TypeAlias
+
+from marimo._output.md import md
+from marimo._output.mime import MIME
+from marimo._plugins.core.json_encoder import WebComponentEncoder
+
+JSONType: TypeAlias = Union[
+ Mapping[str, "JSONType"],
+ Sequence["JSONType"],
+ str,
+ int,
+ float,
+ bool,
+ MIME, # MIME is a JSONType since we have a custom JSONEncoder for it
+ None,
+]
+
+
+S = TypeVar("S", bound=JSONType)
+
+
+def _build_attr(name: str, value: JSONType) -> str:
+ processed = escape(json.dumps(value, cls=WebComponentEncoder))
+ # manual escapes for things html.escape doesn't escape
+ #
+ # - backslashes, when unescaped can lead to problems
+ # when embedding in markdown
+ # - dollar sign, when unescaped can incorrectly be recognized as
+ # latex delimiter when embedding into markdown
+ processed = processed.replace("\\", "&#92;").replace("$", "&#36;")
+ return f"data-{name}='{processed}'"
+
+
+def build_ui_plugin(
+ component_name: str,
+ initial_value: Optional[JSONType],
+ label: Optional[str],
+ args: dict[str, JSONType],
+ slotted_html: str = "",
+) -> str:
+ """
+ Build HTML for a UI (stateful) plugin.
+
+ Args:
+ ----
+ component_name: tag name of the component
+ initial_value: JSON-serializable initial value of the component
+ label: markdown string that component may use a text label
+ args: mapping from arg names to JSON-serializable value
+ slotted_html: HTML to slot in the component
+
+ Returns:
+ -------
+ HTML text for the component
+ """
+ if "initial-value" in args:
+ raise ValueError("initial-value is a reserved argument.")
+ if "label" in args:
+ raise ValueError("label is a reserved argument.")
+
+ attrs: list[str] = [_build_attr("initial-value", initial_value)]
+ if label is not None and label:
+ attrs.append(_build_attr("label", md(label).text))
+ else:
+ attrs.append(_build_attr("label", None))
+
+ for name, value in args.items():
+ if value is not None:
+ attrs.append(_build_attr(name, value))
+
+ return (
+ f"<{component_name} {' '.join(attrs)}>"
+ f"{slotted_html}"
+ f"</{component_name}>"
+ )
+
+
+def build_stateless_plugin(
+ component_name: str,
+ args: dict[str, JSONType],
+ slotted_html: str = "",
+) -> str:
+ """
+ Build HTML for a stateless plugin.
+
+ Args:
+ ----
+ component_name: tag name of the component
+ args: mapping from arg names to JSON-serializable value
+ slotted_html: HTML to slot in the component
+
+ Returns:
+ -------
+ HTML text for the component
+ """
+ attrs = [_build_attr(name, value) for name, value in args.items()]
+ return (
+ f"<{component_name} {' '.join(attrs)}>"
+ f"{slotted_html}"
+ f"</{component_name}>"
+ )
+
+
+def parse_initial_value(text: str) -> JSONType:
+ """Get initial value from HTML for a UI element."""
+ match = re.search("data-initial-value='(.*?)'", text)
+ if match is None:
+ raise ValueError("Invalid component HTML: ", text)
+ return cast(JSONType, json.loads(unescape(match.groups()[0])))
diff --git a/marimo/_plugins/stateless/__init__.py b/marimo/_plugins/stateless/__init__.py
new file mode 100644
index 0000000000..618f22fc54
--- /dev/null
+++ b/marimo/_plugins/stateless/__init__.py
@@ -0,0 +1 @@
+# Copyright 2023 Marimo. All rights reserved.
diff --git a/marimo/_plugins/stateless/accordion.py b/marimo/_plugins/stateless/accordion.py
new file mode 100644
index 0000000000..8e00e577f2
--- /dev/null
+++ b/marimo/_plugins/stateless/accordion.py
@@ -0,0 +1,49 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from marimo._output.formatting import as_html
+from marimo._output.hypertext import Html
+from marimo._output.md import md
+from marimo._output.rich_help import mddoc
+from marimo._plugins.core.web_component import build_stateless_plugin
+
+
+@mddoc
+def accordion(items: dict[str, object], multiple: bool = False) -> Html:
+ """
+ Accordion of one or more items.
+
+ **Example.**
+
+ ```python3
+ mo.accordion({
+ "Tip": "Use accordions to let users reveal and hide content."
+ })
+ ```
+
+ **Args.**
+
+ - `items`: a dictionary of item names to item content; strings are
+ interpreted as markdown
+ - `multiple`: whether to allow multiple items to be open simultaneously
+
+ **Returns.**
+
+ - An `Html` object.
+ """
+ item_labels = list(md(label).text for label in items.keys())
+ item_content = "".join(
+ [
+ "<div>"
+ + (md(item).text if isinstance(item, str) else as_html(item).text)
+ + "</div>"
+ for item in items.values()
+ ]
+ )
+ return Html(
+ build_stateless_plugin(
+ component_name="marimo-accordion",
+ args={"labels": item_labels, "multiple": multiple},
+ slotted_html=item_content,
+ )
+ )
diff --git a/marimo/_plugins/stateless/callout_output.py b/marimo/_plugins/stateless/callout_output.py
new file mode 100644
index 0000000000..313d54003f
--- /dev/null
+++ b/marimo/_plugins/stateless/callout_output.py
@@ -0,0 +1,33 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from typing import Literal
+
+from marimo._output.formatting import as_html
+from marimo._output.hypertext import Html
+from marimo._output.rich_help import mddoc
+from marimo._plugins.core.web_component import build_stateless_plugin
+
+
+@mddoc
+def callout(
+ value: object,
+ kind: Literal["neutral", "alert", "warn", "success"] = "neutral",
+) -> Html:
+ """Build a callout output.
+
+ **Args.**
+
+ - `value`: A value to render in the callout
+ - `kind`: The kind of callout (affects styling).
+
+ **Returns.**
+
+ - An HTML object.
+ """
+ return Html(
+ build_stateless_plugin(
+ component_name="marimo-callout-output",
+ args={"html": as_html(value).text, "kind": kind},
+ )
+ )
diff --git a/marimo/_plugins/stateless/flex.py b/marimo/_plugins/stateless/flex.py
new file mode 100644
index 0000000000..6873d176ce
--- /dev/null
+++ b/marimo/_plugins/stateless/flex.py
@@ -0,0 +1,190 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from collections.abc import Sequence
+from typing import Literal, Optional
+
+from marimo._output.formatting import as_html
+from marimo._output.hypertext import Html
+from marimo._output.rich_help import mddoc
+
+
+def _flex(
+ items: Sequence[object],
+ direction: Literal["row", "column"],
+ justify: Literal[
+ "start", "center", "end", "space-between", "space-around"
+ ],
+ align: Optional[Literal["start", "end", "center", "stretch"]],
+ wrap: bool,
+ gap: float,
+) -> Html:
+ justify_content_map = {
+ "start": "flex-start",
+ "center": "center",
+ "end": "flex-end",
+ "space-between": "space-between",
+ "space-around": "space-around",
+ None: "space-between",
+ }
+ align_items_map = {
+ "start": "flex-start",
+ "center": "center",
+ "end": "flex-end",
+ "stretch": "stretch",
+ None: "normal",
+ }
+ style = ";".join(
+ [
+ "display: flex",
+ f"flex-direction: {direction}",
+ f"justify-content: {justify_content_map[justify]}",
+ f"align-items: {align_items_map[align]}",
+ f"flex-wrap: {'wrap' if wrap else 'nowrap'}",
+ f"gap: {gap}rem",
+ ]
+ )
+ grid_items = "".join(
+ ["<div>" + as_html(item).text + "</div>" for item in items]
+ )
+ return Html(f"<div style='{style}'>" + grid_items + "</div>")
+
+
+@mddoc
+def vstack(
+ items: Sequence[object],
+ align: Optional[Literal["start", "end", "center", "stretch"]] = None,
+ gap: float = 0.5,
+) -> Html:
+ """Stack items vertically, in a column.
+
+ Combine with `hstack` to build a grid of items.
+
+ **Example.**
+
+ ```python3
+ # Build a column of items
+ mo.vstack([mo.md("..."), mo.ui.text_area()])
+ ```
+
+ ```python3
+ # Build a grid.
+ mo.vstack([
+ mo.hstack([mo.md("..."), mo.ui.text_area()]),
+ mo.hstack([mo.ui.checkbox(), mo.ui.text(), mo.ui.date()])
+ ])
+ ```
+
+ **Args.**
+
+ - `items`: A list of items.
+ - `align`: Align items horizontally: start, end, center, or stretch.
+ - `gap`: Gap between items as a float in rem. 1rem is 16px by default.
+
+ **Returns.**
+
+ - An `Html` object.
+ """
+ return _flex(
+ items,
+ direction="column",
+ justify="start",
+ align=align,
+ wrap=False,
+ gap=gap,
+ )
+
+
+@mddoc
+def hstack(
+ items: Sequence[object],
+ justify: Literal[
+ "start", "center", "end", "space-between", "space-around"
+ ] = "space-between",
+ align: Optional[Literal["start", "end", "center", "stretch"]] = None,
+ wrap: bool = False,
+ gap: float = 0.5,
+) -> Html:
+ """Stack items horizontally, in a row.
+
+ Combine with `vstack` to build a grid.
+
+ **Example.**
+
+ ```python3
+ # Build a row of items
+ mo.hstack([mo.md("..."), mo.ui.text_area()])
+ ```
+
+ ```python3
+ # Build a grid.
+ mo.hstack([
+ mo.vstack([mo.md("..."), mo.ui.text_area()]),
+ mo.vstack([mo.ui.checkbox(), mo.ui.text(), mo.ui.date()])
+ ])
+ ```
+
+ **Args.**
+
+ - `items`: A list of items.
+ - `justify`: Justify items horizontally: start, center, end,
+ space-between, or space-around.
+ - `align`: Align items vertically: start, end, center, or stretch.
+ - `wrap`: Wrap items or not.
+ - `gap`: Gap between items as a float in rem. 1rem is 16px by default.
+
+ **Returns.**
+
+ - An `Html` object.
+ """
+ return _flex(
+ items,
+ direction="row",
+ justify=justify,
+ align=align,
+ wrap=wrap,
+ gap=gap,
+ )
+
+
+# TODO(akshayka): Implement as a stateless plugin in frontend.
+# Unused, but may be nice to keep around in case we want to add `mo.grid`
+def _spaced(
+ items: Sequence[object],
+ justify: Literal["left", "right", "center", "normal"] = "center",
+ items_per_row: Optional[int] = None,
+ column_gap: float = 1,
+ row_gap: float = 1,
+) -> Html:
+ """Space items evenly in row-major order.
+
+ A grid built with this function has a fixed number of items per row.
+ For more flexibility, use `hstack` and `vstack`.
+
+ **Args.**
+
+ - `items`: Items to arrange
+ - `justify`: Justify items normally, left, right, or center.
+ - `items_per_row`: Number of items to place in each row
+ - `column_gap`: Minimum gap in rem between columns
+ - `row_gap`: Minimum gap in rem between rows
+
+ **Returns.**
+
+ - An `Html` object.
+ """
+ items_per_row = len(items) if items_per_row is None else items_per_row
+ style = ";".join(
+ [
+ "display: grid",
+ f"grid-template-columns: repeat({items_per_row}, 1fr)",
+ f"column-gap: {column_gap}rem",
+ f"row-gap: {row_gap}rem",
+ f"justify-items: {justify}",
+ "overflow: auto",
+ ]
+ )
+ grid_items = "".join(
+ ["<div>" + as_html(item).text + "</div>" for item in items]
+ )
+ return Html(f"<div style='{style}'>" + grid_items + "</div>")
diff --git a/marimo/_plugins/stateless/json_output.py b/marimo/_plugins/stateless/json_output.py
new file mode 100644
index 0000000000..4b6c3a9a1e
--- /dev/null
+++ b/marimo/_plugins/stateless/json_output.py
@@ -0,0 +1,29 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from typing import Optional
+
+from marimo._output.hypertext import Html
+from marimo._plugins.core.web_component import JSONType, build_stateless_plugin
+
+
+def json_output(json_data: JSONType, name: Optional[str] = None) -> Html:
+ """Build a json output element.
+
+ Args:
+ -----
+ json_data: JSON-serializable data to display
+ name: optional text label
+
+ Returns:
+ --------
+ A string of HTML for a JSON output element.
+ """
+ return Html(
+ build_stateless_plugin(
+ component_name="marimo-json-output",
+ args={"json-data": json_data, "name": name}
+ if name is not None
+ else {"json-data": json_data},
+ )
+ )
diff --git a/marimo/_plugins/stateless/tabs.py b/marimo/_plugins/stateless/tabs.py
new file mode 100644
index 0000000000..0d2f5519e5
--- /dev/null
+++ b/marimo/_plugins/stateless/tabs.py
@@ -0,0 +1,59 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from marimo._output.formatting import as_html
+from marimo._output.hypertext import Html
+from marimo._output.md import md
+from marimo._output.rich_help import mddoc
+from marimo._plugins.core.web_component import build_stateless_plugin
+
+
+@mddoc
+def tabs(tabs: dict[str, object]) -> Html:
+ """
+ Tabs of UI elements.
+
+ **Examples.**
+
+ ```python
+ tab1 = mo.vstack([
+ "slider": mo.ui.slider(1, 10),
+ "text": mo.ui.text(),
+ "date": mo.ui.date()
+ ]);
+ tab2 = mo.vstack([{
+ "slider": mo.ui.slider(1, 10),
+ "text": mo.ui.text(),
+ "date": mo.ui.date()
+ ]);
+ tabs = mo.ui.tabs({
+ "Tab 1": tab1,
+ "Tab 2": tab2
+ })
+ ```
+
+ **Args.**
+
+ - `tabs`: a dictionary of tab names to tab content; strings are interpreted
+ as markdown
+
+ **Returns.**
+
+ - An `Html` object.
+ """
+ tab_items = "".join(
+ [
+ "<div data-kind='tab'>"
+ + (md(tab).text if isinstance(tab, str) else as_html(tab).text)
+ + "</div>"
+ for tab in tabs.values()
+ ]
+ )
+ tab_labels = list(md(label).text for label in tabs.keys())
+ return Html(
+ build_stateless_plugin(
+ component_name="marimo-tabs",
+ args={"tabs": tab_labels},
+ slotted_html=tab_items,
+ )
+ )
diff --git a/marimo/_plugins/stateless/tree.py b/marimo/_plugins/stateless/tree.py
new file mode 100644
index 0000000000..3b8374b19a
--- /dev/null
+++ b/marimo/_plugins/stateless/tree.py
@@ -0,0 +1,51 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from typing import Any, Optional
+
+from marimo._output.formatters.structures import format_structure
+from marimo._output.hypertext import Html
+from marimo._output.rich_help import mddoc
+from marimo._plugins.core.web_component import JSONType
+from marimo._plugins.stateless import json_output
+from marimo._utils.flatten import CyclicStructureError
+
+
+@mddoc
+def tree(
+ items: list[Any] | tuple[Any] | dict[Any, Any],
+ label: Optional[str] = None,
+) -> Html:
+ """Render a nested structure of lists, tuples, or dicts as a tree.
+
+ **Example.**
+ ```python3
+ mo.tree([
+ "entry",
+ "another entry",
+ {
+ "key": [0, 1, 2]
+ }
+ ], label="A tree.")
+ ```
+ **Args.**
+
+ - `items`: nested structure of lists, tuples, or dicts
+ - `label`: optional text label for the tree
+
+ **Returns.**
+
+ `Html` object
+ """
+ if not isinstance(items, (list, tuple, dict)):
+ raise ValueError(
+ "Argument `items` must be a list, tuple, or dict, "
+ + f"but got: {type(items)}"
+ )
+
+ json_data: JSONType
+ try:
+ json_data = format_structure(items)
+ except CyclicStructureError:
+ json_data = str(items)
+ return json_output.json_output(json_data=json_data, name=label)
diff --git a/marimo/_plugins/ui/__init__.py b/marimo/_plugins/ui/__init__.py
new file mode 100644
index 0000000000..3403799985
--- /dev/null
+++ b/marimo/_plugins/ui/__init__.py
@@ -0,0 +1,46 @@
+# Copyright 2023 Marimo. All rights reserved.
+"""Interactive UI elements.
+
+This module contains a library of interactive UI elements.
+"""
+
+__all__ = [
+ "array",
+ "batch",
+ "button",
+ "checkbox",
+ "date",
+ "dictionary",
+ "dropdown",
+ "file",
+ "form",
+ "multiselect",
+ "number",
+ "radio",
+ "slider",
+ "switch",
+ "table",
+ "text_area",
+ "text",
+]
+
+
+from marimo._plugins.ui._impl.array import array
+from marimo._plugins.ui._impl.batch import batch
+from marimo._plugins.ui._impl.dictionary import dictionary
+from marimo._plugins.ui._impl.input import (
+ button,
+ checkbox,
+ date,
+ dropdown,
+ file,
+ form,
+ multiselect,
+ number,
+ radio,
+ slider,
+ table,
+ text,
+ text_area,
+)
+from marimo._plugins.ui._impl.switch import switch
diff --git a/marimo/_plugins/ui/_core/__init__.py b/marimo/_plugins/ui/_core/__init__.py
new file mode 100644
index 0000000000..618f22fc54
--- /dev/null
+++ b/marimo/_plugins/ui/_core/__init__.py
@@ -0,0 +1 @@
+# Copyright 2023 Marimo. All rights reserved.
diff --git a/marimo/_plugins/ui/_core/ids.py b/marimo/_plugins/ui/_core/ids.py
new file mode 100644
index 0000000000..313d3d0476
--- /dev/null
+++ b/marimo/_plugins/ui/_core/ids.py
@@ -0,0 +1,27 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+
+class NoIDProviderException(Exception):
+ pass
+
+
+class IDProvider:
+ """Provide IDs for UIElements
+
+ Can be used to provide IDs that are stable across sessions.
+ """
+
+ def __init__(self, prefix: str):
+ """Initialize an ID provider
+
+ `prefix` should be unique across cells
+ """
+ self._prefix = prefix
+ self._counter = 0
+
+ def take_id(self) -> str:
+ """Get an ID"""
+ this_id = f"{self._prefix}-{self._counter}"
+ self._counter += 1
+ return this_id
diff --git a/marimo/_plugins/ui/_core/registry.py b/marimo/_plugins/ui/_core/registry.py
new file mode 100644
index 0000000000..3d055d5b0e
--- /dev/null
+++ b/marimo/_plugins/ui/_core/registry.py
@@ -0,0 +1,90 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import weakref
+from typing import Any, Iterable
+
+from marimo import _loggers
+from marimo._ast.cell import CellId_t
+from marimo._plugins.ui._core.ui_element import UIElement
+from marimo._runtime.context import get_context
+
+UIElementId = str
+LOGGER = _loggers.marimo_logger()
+
+
+class UIElementRegistry:
+ def __init__(self) -> None:
+ # mapping from object id to UIElement object that has that id
+ self._objects: dict[UIElementId, weakref.ref[UIElement[Any, Any]]] = {}
+ # mapping from object id to set of names that are bound to it
+ self._bindings: dict[UIElementId, set[str]] = {}
+ # mapping from object id to cell that created it
+ self._constructing_cells: dict[UIElementId, CellId_t] = {}
+
+ def register(
+ self,
+ object_id: UIElementId,
+ ui_element: UIElement[Any, Any],
+ ) -> None:
+ kernel = get_context().kernel
+ self._objects[object_id] = weakref.ref(ui_element)
+ assert kernel.cell_id is not None
+ self._constructing_cells[object_id] = kernel.cell_id
+ if object_id in self._bindings:
+ # If `register` is called on an object_id that is being
+ # reused before `delete` is called, bindings won't have been
+ # cleaned up
+ del self._bindings[object_id]
+
+ def bound_names(self, object_id: UIElementId) -> Iterable[str]:
+ if object_id not in self._bindings:
+ self._register_bindings(object_id)
+ return self._bindings[object_id]
+
+ def _register_bindings(self, object_id: UIElementId) -> None:
+ kernel = get_context().kernel
+ names = set(
+ [
+ name
+ for name in kernel.globals
+ if (
+ isinstance(kernel.globals[name], UIElement)
+ and kernel.globals[name]._id == object_id
+ )
+ ]
+ )
+ self._bindings[object_id] = names
+
+ def delete(self, object_id: UIElementId, python_id: int) -> None:
+ if object_id not in self._objects:
+ return
+
+ registered_python_id = id(self._objects[object_id]())
+ if registered_python_id != python_id:
+ LOGGER.debug(
+ "Python id mismatch when deleting UI element %s", object_id
+ )
+ return
+
+ if self._objects[object_id]:
+ del self._objects[object_id]
+ if object_id in self._bindings:
+ del self._bindings[object_id]
+ if object_id in self._constructing_cells:
+ del self._constructing_cells[object_id]
+
+ def get_object(self, object_id: UIElementId) -> UIElement[Any, Any]:
+ if object_id not in self._objects:
+ raise KeyError(f"UIElement with id {object_id} not found")
+ # UI elements are only updated if a global is bound to it. This ensures
+ # that the UI element update triggers reactivity, but also means that
+ # elements stored as, say, attributes on an object won't be updated.
+ if not self.bound_names(object_id):
+ raise NameError(f"UIElement with id {object_id} has no bindings")
+ obj = self._objects[object_id]()
+ assert obj is not None
+ return obj
+
+ def get_cell(self, object_id: UIElementId) -> CellId_t:
+ return self._constructing_cells[object_id]
diff --git a/marimo/_plugins/ui/_core/ui_element.py b/marimo/_plugins/ui/_core/ui_element.py
new file mode 100644
index 0000000000..0c51cc958f
--- /dev/null
+++ b/marimo/_plugins/ui/_core/ui_element.py
@@ -0,0 +1,250 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import abc
+import copy
+import uuid
+from typing import TYPE_CHECKING, Generic, Optional, TypeVar, cast
+
+from marimo import _loggers
+from marimo._output.hypertext import Html
+from marimo._output.rich_help import mddoc
+from marimo._plugins.core.web_component import JSONType, build_ui_plugin
+from marimo._plugins.ui._core import ids
+from marimo._runtime.context import get_context
+
+if TYPE_CHECKING:
+ from marimo._plugins.ui._impl.input import form as form_plugin
+
+# S: Type of frontend value
+# - the initial value sent to the frontend must be of type S
+# - values received from the frontend must be of type S
+S = TypeVar("S", bound=JSONType)
+
+# T: Type of `UIElement.value`
+# - UIElement's `_convert_value` method is used to convert a frontend
+# value (of type S) to a value of type T
+T = TypeVar("T")
+
+LOGGER = _loggers.marimo_logger()
+
+
+@mddoc
+class UIElement(Html, Generic[S, T], metaclass=abc.ABCMeta):
+ """An HTML element with a value
+
+ A `UIElement` is an HTML element with a value; when the value of the
+ element on the page changes, the value of the UIElement is updated as well.
+
+ This is an abstract class. `UIElement`s are responsible for mapping values
+ sent by the frontend (of type S) to values expected by the Python object
+ (of type T): a subclass can be made concrete by implementing the
+ `_convert_value` method.
+
+ Type Parameters:
+
+ - S: The type of the values sent by the frontend to the kernel; must be
+ JSON-serializable
+ - T: The type of the UIElement's value; can be any type
+
+ **Attributes.**
+
+ - value: The value of the `UIElement`.
+
+ **Methods.**
+
+ - form: create a submittable form this `UIElement`.
+ """
+
+ _value: T
+
+ def __init__(
+ self,
+ component_name: str,
+ initial_value: S,
+ label: Optional[str],
+ args: dict[str, JSONType],
+ slotted_html: str = "",
+ ) -> None:
+ """Initialize a UIElement
+
+ Args:
+ ----
+ component_name: tag name of the custom element
+ initial_value: initial value of the element in the frontend
+ label: markdown string, label of element
+ args: arguments that the element takes
+ slotted_html: any html to slot in the custom element
+ """
+ # arguments stored in signature order for cloning
+ self._args = (component_name, initial_value, label, args, slotted_html)
+ self._initialized = False
+ self._initialize(*self._args)
+ self._initialized = True
+
+ def _initialize(
+ self,
+ component_name: str,
+ initial_value: S,
+ label: Optional[str],
+ args: dict[str, JSONType],
+ slotted_html: str,
+ ) -> None:
+ """Initialize the UIElement
+
+ Split out from __init__ so _clone() typechecks
+ """
+ # Random token
+ #
+ # Every element is annotated with a random token, which by design is
+ # different every time the element is constructed (i.e., every time a
+ # cell runs): this guarantees that re-running a cell that creates a UI
+ # element will trigger a re-render and reset it to its initial value.
+ # We need this to ensure that the element on the page is synchronized
+ # with the element in the kernel.
+ self._random_id = str(uuid.uuid4())
+
+ # Stable ID
+ #
+ # Every element has an ID that is used for two purposes:
+ # - to synchronize multiple instances of the element on the page
+ # - to synchronize elements on the page with elements in the kernel
+ #
+ # IDs are stable across multiple sessions if the set of UI elements
+ # created by each cell is deterministic; this fact is used to
+ # optionally override the element's initial value.
+ try:
+ self._id = get_context().take_id()
+ except ids.NoIDProviderException:
+ self._id = self._random_id
+
+ ctx = get_context()
+ if ctx.initialized:
+ ctx.ui_element_registry.register(self._id, self)
+
+ # an Instantiate request may want us to override the initial value
+ if ctx.initialized:
+ try:
+ # NB: If a cell produces a non-deterministic set of
+ # UI elements, a UI element may be matched with an initial
+ # value that was actually for some other element
+ #
+ # TODO(akshayka): validate the tag-name to make sure that the
+ # value is at least the right type (ie, S)
+ #
+ # TODO(akshayka): parametrize UIElement with an optional
+ # string ID, so users can provide their own IDs to make
+ # sure a mismatch never happens ...
+ initial_value = cast(
+ S, ctx.kernel.get_ui_initial_value(self._id)
+ )
+ except KeyError:
+ # we weren't asked to override the UI element's value
+ pass
+ self._initial_value_frontend = initial_value
+ self._value = self._initial_value = self._convert_value(initial_value)
+
+ self._inner_text = build_ui_plugin(
+ component_name,
+ initial_value,
+ label,
+ args,
+ slotted_html,
+ )
+ self._text = (
+ f"<marimo-ui-element object-id='{self._id}' "
+ + f"random-id='{self._random_id}'>"
+ + self._inner_text
+ + "</marimo-ui-element>"
+ )
+
+ @abc.abstractmethod
+ def _convert_value(self, value: S) -> T:
+ """Converts a value from the frontend to a value for the `UIElement`
+
+ This method must convert `value`, the JSON-decoded value sent by the
+ frontend, to a value of type `T` for the `UIElement`.
+ """
+ pass
+
+ @property
+ def value(self) -> T:
+ """The element's current value."""
+ ctx = get_context()
+ if (
+ ctx.initialized
+ and ctx.kernel.cell_id
+ == ctx.ui_element_registry.get_cell(self._id)
+ ):
+ raise RuntimeError(
+ "Accessing the value of a UIElement in the cell that created "
+ "it is not allowed. Fix: move the value access to another "
+ "cell."
+ )
+ return self._value
+
+ @mddoc
+ def form(self, label: str = "") -> form_plugin[S, T]:
+ """Create a submittable form out of this `UIElement`.
+
+ Use this method to create a form that gates the submission
+ of a `UIElement`s value until a submit button is clicked.
+
+ The value of the `form` is the value of the underlying
+ element the last time the form was submitted.
+
+ **Examples.**
+
+ Convert any `UIElement` into a form:
+
+ ```python
+ prompt = mo.ui.text_area().form()
+ ```
+
+ Combine with `HTML.batch` to create a form made out of multiple
+ `UIElements`:
+
+ ```python
+ form = mo.ui.md(
+ '''
+ **Enter your prompt.**
+
+ {prompt}
+
+ **Choose a random seed.**
+
+ {seed}
+ '''
+ ).batch(
+ prompt=mo.ui.text_area(),
+ seed=mo.ui.number(),
+ ).form()
+ ```
+
+ **Args.**
+
+ - `label`: A text label for the form.
+ """
+ from marimo._plugins.ui._impl.input import form as form_plugin
+
+ return form_plugin(element=self, label=label)
+
+ def _update(self, value: S) -> None:
+ self._value = self._convert_value(value)
+
+ def __del__(self) -> None:
+ ctx = get_context()
+ if ctx.initialized:
+ ctx.ui_element_registry.delete(self._id, id(self))
+
+ def _clone(self) -> UIElement[S, T]:
+ """Clone a UIElement, returning one with a different id
+
+ The clone will not synchronize with the original element.
+
+ Composite UIElement may need to override this method to run
+ their own side-effects.
+ """
+ duplicate = copy.deepcopy(self)
+ duplicate._initialize(*self._args)
+ return duplicate
diff --git a/marimo/_plugins/ui/_impl/__init__.py b/marimo/_plugins/ui/_impl/__init__.py
new file mode 100644
index 0000000000..618f22fc54
--- /dev/null
+++ b/marimo/_plugins/ui/_impl/__init__.py
@@ -0,0 +1 @@
+# Copyright 2023 Marimo. All rights reserved.
diff --git a/marimo/_plugins/ui/_impl/array.py b/marimo/_plugins/ui/_impl/array.py
new file mode 100644
index 0000000000..3dec154ed1
--- /dev/null
+++ b/marimo/_plugins/ui/_impl/array.py
@@ -0,0 +1,99 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from typing import Any, Dict, Final, Sequence
+
+from marimo._output.formatters.structures import format_structure
+from marimo._output.rich_help import mddoc
+from marimo._plugins.core.web_component import JSONType
+from marimo._plugins.stateless.json_output import json_output
+from marimo._plugins.ui._core.ui_element import UIElement
+
+
+# Frontend type is a tuple (index, value update)
+# Python type is a sequence of values, one for each UI element
+@mddoc
+class array(UIElement[Dict[str, JSONType], Sequence[object]]):
+ """
+ An array of UI elements.
+
+ Use an array to
+
+ - create a set of UI elements at runtime
+ - group together logically related UI elements
+ - keep the number of global variables in your program small
+
+ The UI elements in the array are clones of the original elements:
+ interacting with the array will _not_ update the original elements, and
+ vice versa.
+
+ **Examples.**
+
+ A heterogeneous collection of UI elements:
+
+ ```python
+ array = mo.ui.array([mo.ui.slider(1, 10), mo.ui.text(), mo.ui.date()])
+ ```
+
+ ```python
+ # array.value returns a list with the values of the elements
+ array.value
+ ```
+
+ Some number of UI elements, determined at runtime:
+
+ ```python
+ mo.ui.array([mo.ui.slider(1, 10) for _ in range random.randint(4, 8)])
+ ```
+
+ **Attributes.**
+
+ - `value`: a list containing the values of the array's entries
+ - `elements`: a list of the wrapped elements (clones of the originals)
+
+ **Initialization Args.**
+
+ - `elements`: the UI elements to include
+ - `label`: a descriptive name for the array
+ """
+
+ _name: Final[str] = "marimo-dict"
+
+ def __init__(
+ self,
+ elements: Sequence[UIElement[Any, Any]],
+ label: str = "",
+ ) -> None:
+ self._elements = [e._clone() for e in elements]
+ self._label = label
+ slotted_html = json_output(
+ json_data=format_structure(self._elements),
+ name="array" if not label else label,
+ )
+ super().__init__(
+ component_name=array._name,
+ initial_value={
+ str(index): e._initial_value_frontend
+ for index, e in enumerate(self._elements)
+ },
+ label=label,
+ args={
+ "element-ids": {
+ e._id: str(i) for i, e in enumerate(self._elements)
+ },
+ },
+ slotted_html=slotted_html.text,
+ )
+
+ @property
+ def elements(self) -> Sequence[UIElement[JSONType, object]]:
+ return self._elements
+
+ def _convert_value(self, value: dict[str, JSONType]) -> Sequence[object]:
+ if self._initialized:
+ for k, v in value.items():
+ self._elements[int(k)]._update(v)
+ return [e._value for e in self._elements]
+
+ def _clone(self) -> array:
+ return array(elements=self.elements, label=self._label)
diff --git a/marimo/_plugins/ui/_impl/batch.py b/marimo/_plugins/ui/_impl/batch.py
new file mode 100644
index 0000000000..a4c9e325f6
--- /dev/null
+++ b/marimo/_plugins/ui/_impl/batch.py
@@ -0,0 +1,119 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from typing import Any, Dict, Final
+
+from marimo._output.hypertext import Html
+from marimo._output.rich_help import mddoc
+from marimo._plugins.core.web_component import JSONType
+from marimo._plugins.ui._core.ui_element import UIElement
+
+
+# - Frontend type is a dict {label => value update}
+# - Python type is a dict mapping label -> value
+class _batch_base(UIElement[Dict[str, JSONType], Dict[str, object]]):
+ """
+ A batch of named UI elements represented by HTML text.
+ """
+
+ _name: Final[str] = "marimo-dict"
+
+ def __init__(
+ self,
+ html: Html,
+ elements: dict[str, UIElement[JSONType, object]],
+ label: str = "",
+ ) -> None:
+ self._elements = elements
+ super().__init__(
+ component_name=_batch_base._name,
+ initial_value={
+ key: e._initial_value_frontend
+ for key, e in self._elements.items()
+ },
+ label=label,
+ args={
+ "element-ids": {
+ e._id: key for key, e in self._elements.items()
+ },
+ },
+ slotted_html=html.text,
+ )
+
+ @property
+ def elements(self) -> dict[str, UIElement[JSONType, object]]:
+ return self._elements
+
+ def _convert_value(self, value: dict[str, JSONType]) -> dict[str, object]:
+ if self._initialized:
+ for k, v in value.items():
+ self._elements[k]._update(v)
+ return {
+ key: wrapped_element._value
+ for key, wrapped_element in self._elements.items()
+ }
+
+
+@mddoc
+class batch(_batch_base):
+ """
+ Convert an HTML object with templated text into a UI element.
+
+ A `batch` is a UI element that wraps other UI elements, and is
+ represented by custom HTML or markdown. You can create
+ a `batch` by calling the `batch()` method on `Html` objects.
+
+ **Example.**
+
+ ```python3
+ user_info = mo.md(
+ '''
+ - What's your name?: {name}
+ - When were you born?: {birthday}
+ '''
+ ).batch(name=mo.ui.text(), birthday=mo.ui.date())
+ ```
+
+ In this example, `user_info` is a UI Element whose output is markdown
+ and whose value is a dict with keys `'name'` and '`birthday`'
+ (and values equal to the values of their corresponding elements).
+
+ You can also instantiate this class directly:
+
+ ```python3
+ markdown = mo.md(
+ '''
+ - What's your name?: {name}
+ - When were you born?: {birthday}
+ '''
+ )
+ batch = mo.ui.batch(
+ markdown, {"name": mo.ui.text(), "birthday": mo.ui.date()}
+ )
+ ```
+
+ **Attributes.**
+
+ - `value`: a `dict` of the batched elements' values
+ - `elements`: a `dict` of the batched elements (clones of the originals)
+
+ **Initialization Args.**
+
+ - html: a templated `Html` object
+ - elements: the UI elements to interpolate into the HTML template
+ """
+
+ def __init__(
+ self,
+ html: Html,
+ elements: dict[str, UIElement[Any, Any]],
+ ) -> None:
+ self._html = html
+ elements = {key: element._clone() for key, element in elements.items()}
+ super().__init__(
+ html=Html(self._html.text.format(**elements)),
+ elements=elements,
+ )
+
+ def _clone(self) -> batch:
+ return batch(html=self._html, elements=self.elements)
diff --git a/marimo/_plugins/ui/_impl/dictionary.py b/marimo/_plugins/ui/_impl/dictionary.py
new file mode 100644
index 0000000000..cfbe3d7d7a
--- /dev/null
+++ b/marimo/_plugins/ui/_impl/dictionary.py
@@ -0,0 +1,101 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from typing import Any
+
+from marimo._output.formatters.structures import format_structure
+from marimo._output.rich_help import mddoc
+from marimo._plugins.stateless.json_output import json_output
+from marimo._plugins.ui._core.ui_element import UIElement
+from marimo._plugins.ui._impl.batch import _batch_base
+
+
+@mddoc
+class dictionary(_batch_base):
+ """
+ A dictionary of UI elements.
+
+ Use a dictionary to
+ - create a set of UI elements at runtime
+ - group together logically related UI elements
+ - keep the number of global variables in your program small
+
+ The UI elements in the dictionary are clones of the original elements:
+ interacting with the dictionary will _not_ update the original
+ elements, and vice versa.
+
+ **Examples.**
+
+ A heterogeneous collection of UI elements:
+
+ ```python
+ d = mo.ui.dictionary({
+ "slider": mo.ui.slider(1, 10),
+ "text": mo.ui.text(),
+ "date": mo.ui.date()
+ })
+ ```
+
+ ```python
+ # d.value returns a dict with keys "slider", "text", "date"
+ d.value
+ ```
+
+ Some number of UI elements, determined at runtime:
+
+ ```python
+ mo.ui.dictionary({
+ f"option {i}": mo.ui.slider(1, 10)
+ for i in range random.randint(4, 8)
+ })
+ ```
+
+ **Attributes.**
+
+ - `value`: a dict holding the values of the UI elements, keyed by
+ their names.
+ - `elements`: a dict of the wrapped elements (clones of the originals)
+
+ **Initialization Args.**
+
+ - `elements`: a dict mapping names to UI elements to include
+ - `label`: a descriptive name for the dictionary
+ to trigger value updates
+ """
+
+ def __init__(
+ self,
+ elements: dict[str, UIElement[Any, Any]],
+ label: str = "",
+ ) -> None:
+ # Why we clone the wrapped elements:
+ #
+ # We don't have good semantics for embedding the original
+ # elements into the dictionary. Here are some complications
+ # with doing that:
+ #
+ # 1. Interacting with an element in the dict might cause the cell
+ # that created the dict to re-run (if the element were declared
+ # in another cell), causing the dict to be destroyed and recreated
+ # with a new object-id, which in turn will re-initialize the dict
+ # and interrupt all interactivity
+ #
+ # 2. Interacting with the original element in another cell may
+ # again cause the dict to be destroyed/recreated; moreover, the
+ # interaction will not update the value of the dictionary (unless
+ # additional logic were added to the frontend DictPlugin to spy on
+ # marimoValueUpdateEvents of children), and in any case will not
+ # trigger cells that ref the dictionary to run, leading to confusion
+ elements = {key: element._clone() for key, element in elements.items()}
+
+ self._label = label
+ # slot a JSON tree viewer as the contents of this element
+ slotted_html = json_output(
+ json_data=format_structure(elements),
+ name="dictionary" if not label else label,
+ )
+ super().__init__(html=slotted_html, elements=elements, label=label)
+
+ def _clone(self) -> dictionary:
+ """Custom clone method so new dict gets copies of UI elements."""
+ return dictionary(self.elements, self._label)
diff --git a/marimo/_plugins/ui/_impl/input.py b/marimo/_plugins/ui/_impl/input.py
new file mode 100644
index 0000000000..06ac069a1c
--- /dev/null
+++ b/marimo/_plugins/ui/_impl/input.py
@@ -0,0 +1,980 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import base64
+import datetime as dt
+import traceback
+from dataclasses import dataclass
+from typing import (
+ Any,
+ Callable,
+ Final,
+ List,
+ Literal,
+ Optional,
+ Sequence,
+ Tuple,
+ TypeVar,
+ Union,
+ cast,
+)
+
+from marimo import _loggers
+from marimo._output.mime import MIME
+from marimo._output.rich_help import mddoc
+from marimo._plugins.ui._core.ui_element import S as JSONTypeBound
+from marimo._plugins.ui._core.ui_element import UIElement
+
+LOGGER = _loggers.marimo_logger()
+
+Numeric = Union[int, float]
+
+
+@mddoc
+class number(UIElement[Optional[Numeric], Optional[Numeric]]):
+ """
+ A number picker over an interval.
+
+ **Example.**
+
+ ```python
+ number = mo.ui.number(start=1, stop=10, step=2)
+ ```
+
+ **Attributes.**
+
+ - `value`: the value of the number, possibly `None`
+ - `start`: the minimum value of the interval
+ - `stop`: the maximum value of the interval
+ - `step`: the number increment
+
+ **Initialization Args.**
+
+ - `start`: the minimum value of the interval
+ - `stop`: the maximum value of the interval
+ - `step`: the number increment
+ - `value`: default value
+ - `label`: text label for the element
+ """
+
+ _name: Final[str] = "marimo-number"
+
+ def __init__(
+ self,
+ start: float,
+ stop: float,
+ step: Optional[float] = None,
+ value: Optional[float] = None,
+ label: str = "",
+ ) -> None:
+ value = start if value is None else value
+ if stop < start:
+ raise ValueError(
+ f"Invalid bounds: stop value ({stop}) must be greater than "
+ f"start value ({start})"
+ )
+ elif value < start or value > stop:
+ raise ValueError(
+ f"Value out of bounds: The default value ({value}) must be "
+ f"greater than start ({start}) and less than stop ({stop})."
+ )
+
+ # Lower bound
+ self.start = start
+ # Upper bound
+ self.stop = stop
+ # Increment size
+ self.step = step
+ super().__init__(
+ component_name=number._name,
+ initial_value=value,
+ label=label,
+ args={
+ "start": start,
+ "stop": stop,
+ "step": step if step is not None else None,
+ },
+ )
+
+ def _convert_value(self, value: Optional[Numeric]) -> Optional[Numeric]:
+ """Value is `None` if user uses keyboard to delete contents of input"""
+ return value
+
+
+@mddoc
+class slider(UIElement[Numeric, Numeric]):
+ """
+ A numeric slider over an interval.
+
+ **Example.**
+
+ ```python
+ slider = mo.ui.slider(start=1, stop=10, step=2)
+ ```
+
+ **Attributes.**
+
+ - `value`: the current numeric value of the slider
+ - `start`: the minimum value of the interval
+ - `stop`: the maximum value of the interval
+ - `step`: the slider increment
+
+ **Initialization Args.**
+
+ - `start`: the minimum value of the interval
+ - `stop`: the maximum value of the interval
+ - `step`: the slider increment
+ - `value`: default value
+ - `label`: text label for the element
+ """
+
+ _name: Final[str] = "marimo-slider"
+
+ def __init__(
+ self,
+ start: float,
+ stop: float,
+ step: Optional[float] = None,
+ value: Optional[float] = None,
+ label: str = "",
+ ) -> None:
+ self._dtype = (
+ float
+ if any(
+ isinstance(num, float) for num in (start, stop, step, value)
+ )
+ else int
+ )
+ value = start if value is None else value
+
+ if stop < start:
+ raise ValueError(
+ f"Invalid bounds: stop value ({stop}) must be greater than "
+ f"start value ({start})"
+ )
+ elif value < start or value > stop:
+ raise ValueError(
+ f"Value out of bounds: default value ({value}) must be "
+ f"greater than start ({start}) and less than stop ({stop})."
+ )
+
+ # minimum value of interval
+ self.start = start
+ # maximum value of interval
+ self.stop = stop
+ # slider increment
+ self.step = step
+
+ super().__init__(
+ component_name=slider._name,
+ initial_value=value,
+ label=label,
+ args={
+ "start": start,
+ "stop": stop,
+ "step": step if step is not None else None,
+ },
+ )
+
+ def _convert_value(self, value: Numeric) -> Numeric:
+ return cast(Numeric, self._dtype(value))
+
+
+@mddoc
+class checkbox(UIElement[bool, bool]):
+ """
+ A boolean checkbox.
+
+ **Example.**
+
+ ```python
+ checkbox = mo.ui.checkbox()
+ ```
+
+ **Attributes.**
+
+ - `value`: a boolean, `True` if checked
+
+ **Initialization Args.**
+
+ - `value`: default value, True or False
+ - `label`: text label for the element
+ """
+
+ _name: Final[str] = "marimo-checkbox"
+
+ def __init__(self, value: bool = False, label: str = "") -> None:
+ super().__init__(
+ component_name=checkbox._name,
+ initial_value=value,
+ label=label,
+ args={},
+ )
+
+ def _convert_value(self, value: bool) -> bool:
+ return value
+
+
+@mddoc
+class radio(UIElement[Optional[str], Any]):
+ """
+ A radio group.
+
+ **Example.**
+
+ ```python
+ radiogroup = mo.ui.radio(
+ options=['a', 'b', 'c'],
+ value='a',
+ label='choose one'
+ )
+ ```
+
+ ```python
+ radiogroup = mo.ui.radio(
+ options={'one': 1, 'two': 2, 'three': 3},
+ value='one',
+ label='pick a number'
+ )
+ ```
+
+ **Attributes.**
+
+ - `value`: the value of the selected radio option
+ - `options`: a dict mapping option name to option value
+
+ **Initialization Args.**
+
+ - `options`: sequence of text options, or dict mapping option name
+ to option value
+ - `value`: default option name, if None, starts with nothing checked
+ - `label`: optional text label for the element
+ """
+
+ _name: Final[str] = "marimo-radio"
+
+ def __init__(
+ self,
+ options: Sequence[str] | dict[str, Any],
+ value: Optional[str] = None,
+ label: str = "",
+ ) -> None:
+ if not isinstance(options, dict):
+ if len(set(options)) != len(options):
+ raise ValueError("A radio group cannot have repeated options.")
+ options = {option: option for option in options}
+ self.options = options
+ super().__init__(
+ component_name=radio._name,
+ initial_value=value,
+ label=label,
+ args={
+ "options": list(options.keys()),
+ },
+ )
+
+ def _convert_value(self, value: Optional[str]) -> Any:
+ return self.options[value] if value is not None else None
+
+
+@mddoc
+class text(UIElement[str, str]):
+ """
+ A text input.
+
+ **Example.**
+
+ ```python
+ text = mo.ui.text(value="Hello, World!")
+ ```
+
+ **Attributes.**
+
+ - `value`: a string of the input's contents
+
+ **Initialization Args.**
+
+ - `value`: default value of text box
+ - `placeholder`: placeholder text to display when the text area is empty
+ - `kind`: input kind, one of `"text"`, `"password"`, `"email"`, or `"url"`
+ defaults to `"text"`
+ - `label`: text label for the element
+ """
+
+ _name: Final[str] = "marimo-text"
+
+ def __init__(
+ self,
+ value: str = "",
+ placeholder: str = "",
+ kind: Literal["text", "password", "email", "url"] = "text",
+ label: str = "",
+ ) -> None:
+ super().__init__(
+ component_name=text._name,
+ initial_value=value,
+ label=label,
+ args={
+ "placeholder": placeholder,
+ "kind": kind,
+ },
+ )
+
+ def _convert_value(self, value: str) -> str:
+ return value
+
+
+@mddoc
+class text_area(UIElement[str, str]):
+ """
+ A text area that is larger than `ui.text`.
+
+ **Example.**
+
+ ```python
+ text_area = mo.ui.text_area()
+ ```
+
+ **Attributes.**
+
+ - `value`: a string of the text area contents
+
+ **Initialization Args.**
+
+ - `value`: initial value of the text area
+ - `placeholder`: placeholder text to display when the text area is empty
+ - `label`: text label for the element
+ """
+
+ _name: Final[str] = "marimo-text-area"
+
+ def __init__(
+ self,
+ value: str = "",
+ placeholder: str = "",
+ label: str = "",
+ ) -> None:
+ super().__init__(
+ component_name=text_area._name,
+ initial_value=value,
+ label=label,
+ args={
+ "placeholder": placeholder,
+ },
+ )
+
+ def _convert_value(self, value: str) -> str:
+ return value
+
+
+@mddoc
+class dropdown(UIElement[List[str], Any]):
+ """
+ A dropdown menu.
+
+ **Example.**
+
+ ```python
+ dropdown = mo.ui.dropdown(
+ options=['a', 'b', 'c'],
+ value='a',
+ label='choose one'
+ )
+ ```
+
+ ```python
+ dropdown = mo.ui.dropdown(
+ options={'one': 1, 'two': 2, 'three': 3],
+ value='one',
+ label='pick a number'
+ )
+ ```
+
+ **Attributes.**
+
+ - `value`: the selected value, or `None` if no selection
+ - `options`: a dict mapping option name to option value
+
+ **Initialization Args.**
+
+ - `options`: sequence of text options, or dict mapping option name
+ to option value
+ - `value`: default option name
+ - `allow_select_none`: whether to include special option (`"--"`) for a
+ `None` value; when `None`, defaults to `True` when
+ `value` is `None`
+ - `label`: text label for the element
+ """
+
+ _name: Final[str] = "marimo-dropdown"
+
+ def __init__(
+ self,
+ options: Sequence[str] | dict[str, Any],
+ value: Optional[str] = None,
+ allow_select_none: Optional[bool] = None,
+ label: str = "",
+ ) -> None:
+ if not isinstance(options, dict):
+ options = {option: option for option in options}
+
+ if "--" in options:
+ raise ValueError(
+ "The option name '--' is reserved by marimo"
+ "; please use another name."
+ )
+
+ self.options = options
+ initial_value = [value] if value is not None else []
+ if allow_select_none is None:
+ allow_select_none = value is None
+ elif not allow_select_none and value is None:
+ raise ValueError(
+ "when `allow_select_none` is False, a non-None default value "
+ "must be provided."
+ )
+
+ super().__init__(
+ component_name=dropdown._name,
+ initial_value=initial_value,
+ label=label,
+ args={
+ "options": list(self.options.keys()),
+ "allow-select-none": allow_select_none,
+ },
+ )
+
+ def _convert_value(self, value: list[str]) -> Any:
+ if value:
+ assert len(value) == 1
+ return self.options[value[0]]
+ else:
+ return None
+
+
+@mddoc
+class multiselect(UIElement[List[str], List[object]]):
+ """
+ A multiselect input.
+
+ **Example.**
+
+ ```python
+ multiselect = mo.ui.multiselect(
+ options=['a', 'b', 'c'],
+ label='choose some options'
+ )
+ ```
+
+ **Attributes.**
+
+ - `value`: the selected values, or `None` if no selection
+ - `options`: a dict mapping option name to option value
+
+ **Initialization Args.**
+
+ - `options`: sequence of text options, or dict mapping option name
+ to option value
+ - `value`: a list of initially selected options
+ - `label`: text label for the element
+ """
+
+ _name: Final[str] = "marimo-multiselect"
+
+ def __init__(
+ self,
+ options: Sequence[str] | dict[str, Any],
+ value: Optional[Sequence[str]] = None,
+ label: str = "",
+ ) -> None:
+ if not isinstance(options, dict):
+ options = {option: option for option in options}
+
+ self.options = options
+ initial_value = list(value) if value is not None else []
+
+ super().__init__(
+ component_name=multiselect._name,
+ initial_value=initial_value,
+ label=label,
+ args={
+ "options": list(self.options.keys()),
+ },
+ )
+
+ def _convert_value(self, value: list[str]) -> list[object]:
+ return [self.options[v] for v in value]
+
+
+@mddoc
+class table(UIElement[List[str], List[object]]):
+ """
+ A table component.
+
+ **Example.**
+
+ ```python
+ table = mo.ui.table(
+ data=[
+ {'first_name': 'Michael', 'last_name': 'Scott'},
+ {'first_name': 'Dwight', 'last_name': 'Schrute'}
+ ],
+ label='Users'
+ )
+ ```
+
+ ```python
+ # df is a Pandas dataframe
+ table = mo.ui.table(
+ data=df.to_dict('records'),
+ # use pagination when your table has many rows
+ pagination=True,
+ label='Dataset'
+ )
+ ```
+
+ **Attributes.**
+
+ - `value`: the selected values, or `None` if no selection.
+ - `data`: the table data
+
+ **Initialization Args.**
+
+ - `data`: a list of values representing a column, or a list of dicts
+ where each dict represents a row in the table
+ (mapping column names to values). values can be
+ primitives (`str`, `int`, `float`, `bool`, or `None`)
+ or Marimo elements: e.g.
+ `mo.ui.button(...)`, `mo.md(...)`, `mo.as_html(...)`, etc.
+ - `pagination`: whether to paginate; if `False`, all rows will be shown
+ - `selection`: 'single' or 'multi' to enable row selection, or `None` to
+ disable
+ - `label`: text label for the element
+ """
+
+ _name: Final[str] = "marimo-table"
+
+ def __init__(
+ self,
+ data: Sequence[str | int | float | bool | MIME | None]
+ | Sequence[dict[str, str | int | float | bool | MIME | None]],
+ pagination: bool = False,
+ selection: Optional[Literal["single", "multi"]] = "multi",
+ label: str = "",
+ ) -> None:
+ if not isinstance(data, (list, tuple)):
+ raise ValueError("data must be a list or tuple.")
+
+ self._data = data
+ if not isinstance(data[0], dict) and isinstance(
+ data[0], (str, int, float, bool, type(None))
+ ):
+ # we're going to assume that data has the right shape, after
+ # having checked just the first entry
+ data = cast(List[Union[str, int, float, bool, MIME, None]], data)
+ data = [{"value": datum} for datum in data]
+ elif not isinstance(data[0], dict):
+ raise ValueError(
+ "data must be a sequence of JSON-serializable types, or a "
+ "sequence of dicts."
+ )
+
+ super().__init__(
+ component_name=table._name,
+ label=label,
+ initial_value=[],
+ args={
+ "data": data,
+ "pagination": pagination,
+ "selection": selection,
+ },
+ )
+
+ @property
+ def data(
+ self,
+ ) -> Union[
+ Sequence[str | int | float | bool | None],
+ Sequence[dict[str, str | int | float | bool | None]],
+ ]:
+ return self._data
+
+ def _convert_value(self, value: list[str]) -> list[object]:
+ return [self._data[int(v)] for v in value]
+
+
+@mddoc
+class button(UIElement[Any, Any]):
+ """
+ A button with an optional callback and optional value.
+
+ **Example.**
+
+ ```python
+ # a button that when clicked will execute
+ # any cells referencing that button
+ button = mo.ui.button()
+ ```
+
+ ```python
+ # a counter implementation
+ counter_button = mo.ui.button(
+ value=0,
+ on_click=lambda value: value + 1,
+ label='increment'
+ )
+ ```
+
+ **Attributes.**
+
+ - `value`: the value of the button
+
+ **Initialization Args.**
+
+ - `on_click`: a callable called on click that takes the current
+ value of the button and returns a new value
+ - `value`: an initial value for the button
+ - `label`: text label for the element
+ """
+
+ _name: Final[str] = "marimo-button"
+
+ def __init__(
+ self,
+ on_click: Optional[Callable[[Any], Any]] = None,
+ value: Optional[Any] = None,
+ label: str = "click here",
+ ) -> None:
+ self._on_click = (lambda _: value) if on_click is None else on_click
+ self._initial_value = value
+ super().__init__(
+ component_name=button._name,
+ # frontend's value is always a counter
+ initial_value=0,
+ label=label,
+ args={},
+ )
+
+ def _convert_value(self, value: Any) -> Any:
+ if value == 0:
+ # frontend's value == 0 only during initialization; first value
+ # frontend will send is 1
+ return self._initial_value
+ try:
+ return self._on_click(self._value)
+ except Exception:
+ LOGGER.error(
+ "on_click handler for button (%s) raised an Exception:\n %s ",
+ str(self),
+ traceback.format_exc(),
+ )
+ return None
+
+
+@dataclass
+class FileUploadResults:
+ """A file's name and its contents."""
+
+ name: str
+ contents: bytes
+
+
+@mddoc
+class file(UIElement[List[Tuple[str, str]], Sequence[FileUploadResults]]):
+ """
+ A button or drag-and-drop area to upload a file.
+
+ Once a file is uploaded, the UI element's value is a list of
+ `namedtuples (name, contents)`, where `name` is the filename and
+ `contents` is the contents of the file. Alternatively, use the methods
+ `name(index: int = 0)` and `contents(index: int = 0)` to retrieve the
+ name or contents of the file at a specified index.
+
+ Use the `kind` argument to switch between a button and a drop-and-drop
+ area.
+
+ **Examples.**
+
+ Uploading a single file:
+
+ ```python
+ f = mo.ui.file()
+
+ # access the uploaded file's name
+ f.value[0].name
+ # or
+ f.name()
+
+ # access the uploaded file's contents
+ f.value[0].contents
+ # or
+ f.contents()
+ ```
+
+ Uploading multiple files, accepting only .png and .jpg extensions:
+
+ ```python
+ f = mo.ui.file(
+ filetypes=[".png", ".jpg"], multiple=True)
+
+ # access an uploaded file's name
+ f.value[index].name
+ # or
+ f.name(index)
+
+ # access the uploaded file's contents
+ f.value[index].contents
+ # or
+ f.contents(index)
+ ```
+
+ **Attributes.**
+
+ - `value`: a sequence of `FileUploadResults`, which have string `name` and
+ `bytes` `contents` fields
+
+ **Methods.**
+
+ - `name(self, index: int = 0) -> Optional[str]`: Get the name of the
+ uploaded file at `index`.
+ - `contents(self, index: int = 0) -> Optional[bytes]`: Get the contents of
+ the uploaded file at `index`.
+
+ **Initialization Args.**
+
+ - `filetypes`: the file types accepted; for example,
+ `filetypes=[".png", ".jpg"]`. If `None`, all files are accepted.
+ In addition to extensions, you may provide `"audio/*"`, `"video/*"`,
+ or `"image/*"` to accept any audio, video, or image file.
+ - `multiple`: if True, allow the user to upload multiple files
+ - `kind`: `"button"` or `"area"`
+ - `label`: text label for the element
+ """
+
+ _name: Final[str] = "marimo-file"
+
+ def __init__(
+ self,
+ filetypes: Optional[Sequence[str]] = None,
+ multiple: bool = False,
+ kind: Literal["button", "area"] = "button",
+ label: str = "",
+ ) -> None:
+ super().__init__(
+ component_name=file._name,
+ initial_value=[],
+ label=label,
+ args={
+ "filetypes": filetypes if filetypes is not None else [],
+ "multiple": multiple,
+ "kind": kind,
+ },
+ )
+
+ def _convert_value(
+ self, value: list[tuple[str, str]]
+ ) -> Sequence[FileUploadResults]:
+ return tuple(
+ FileUploadResults(name=e[0], contents=base64.b64decode(e[1]))
+ for e in value
+ )
+
+ def name(self, index: int = 0) -> Optional[str]:
+ """Get file name at index."""
+ if not self.value or index >= len(self.value):
+ return None
+ else:
+ return self.value[index].name
+
+ def contents(self, index: int = 0) -> Optional[bytes]:
+ """Get file contents at index."""
+ if not self.value or index >= len(self.value):
+ return None
+ else:
+ return self.value[index].contents
+
+
+@mddoc
+class date(UIElement[str, dt.date]):
+ """
+ A date picker with an optional start and stop date.
+
+ **Example.**
+
+ ```python
+ # initialize the date picker at a given date
+ date = mo.ui.date(value="2022-01-01")
+ ```
+
+ ```python
+ # when value is omitted, date picker initializes with today's date
+ date = mo.ui.date()
+ ```
+
+ ```python
+ # create a date picker with bounds
+ date = mo.ui.date(
+ value="2022-06-01",
+ start="2022-01-01",
+ stop="2022-12-31",
+ )
+ ```
+
+ **Attributes.**
+
+ - `value`: a str (YYYY-MM-DD) or `datetime.date` object of the chosen date
+ - `start`: the start date
+ - `stop`: the stop date
+
+ **Initialization Args.**
+
+ - `start`: minimum date selectable; if None, defaults to 01-01-0001
+ - `stop`: maximum date selectable; if None, defaults to 12-31-9999
+ - `value`: default date
+ - if `None` and `start` and `stop` are `None`, defaults to the
+ current day;
+ - else if `None` and `start` is not `None`, defaults to `start`;
+ - else if `None` and `stop` is not `None`, defaults to `stop`
+ - `label`: text label for the element
+ """
+
+ _name: Final[str] = "marimo-date-picker"
+
+ DATEFORMAT = "%Y-%m-%d"
+
+ def __init__(
+ self,
+ start: Optional[dt.date | str] = None,
+ stop: Optional[dt.date | str] = None,
+ value: Optional[dt.date | str] = None,
+ label: str = "",
+ ) -> None:
+ if isinstance(start, str):
+ start = self._convert_value(start)
+ if isinstance(stop, str):
+ stop = self._convert_value(stop)
+ if isinstance(value, str):
+ value = self._convert_value(value)
+
+ if value is None:
+ if start is None and stop is None:
+ value = dt.date.today()
+ elif start is not None:
+ value = start
+ else:
+ value = stop
+ value = cast(dt.date, value)
+
+ self._start = dt.date(dt.MINYEAR, 1, 1) if start is None else start
+ self._stop = dt.date(dt.MAXYEAR, 12, 31) if stop is None else stop
+
+ if self._stop < self._start:
+ raise ValueError(
+ f"The stop date ({stop}) must be greater than "
+ f"the start date ({start})"
+ )
+ elif value < self._start or value > self._stop:
+ raise ValueError(
+ f"The default value ({value}) must be greater than "
+ f"the start date ({start}) and less than the stop "
+ f"date ({stop})."
+ )
+
+ super().__init__(
+ component_name=date._name,
+ initial_value=value.isoformat(),
+ label=label,
+ args={
+ "start": self._start.isoformat(),
+ "stop": self._stop.isoformat(),
+ },
+ )
+
+ def _convert_value(self, value: str) -> dt.date:
+ return dt.datetime.strptime(value, self.DATEFORMAT).date()
+
+ @property
+ def start(self) -> dt.date:
+ return self._start
+
+ @property
+ def stop(self) -> dt.date:
+ return self._stop
+
+
+T = TypeVar("T")
+
+
+@mddoc
+class form(UIElement[Optional[JSONTypeBound], Optional[T]]):
+ """
+ A submittable form linked to a UIElement.
+
+ Use a `form` to prevent sending UI element values to Python until a button
+ is clicked.
+
+ The value of a `form` is the value of the underlying
+ element the last time the form was submitted.
+
+ **Example.**
+
+ ```python
+ # Create a form with chaining
+ form = mo.ui.slider(1, 100).form()
+ ```
+
+ ```python
+ # Create a form with multiple elements
+ form = mo.md('''
+ **Your form.**
+
+ {name}
+
+ {date}
+ ''').batch(
+ name=mo.ui.text(label='name'),
+ date=mo.ui.date(label='date'),
+ ).form()
+ ```
+
+ ```python
+ # Instantiate a form directly
+ form = mo.ui.form(element=mo.ui.slider(1, 100))
+ ```
+
+ **Attributes.**
+
+ - `value`: the value of the wrapped element when the form's submit button
+ was last clicked
+ - `element`: a copy of the wrapped element
+
+ **Initialization Args.**
+
+ - `element`: the element to wrap
+ - `label`: text label for the form
+ """
+
+ _name: Final[str] = "marimo-form"
+
+ def __init__(
+ self,
+ element: UIElement[JSONTypeBound, T],
+ label: str = "",
+ ) -> None:
+ self.element = element._clone()
+ super().__init__(
+ component_name=form._name,
+ initial_value=None,
+ label=label,
+ args={"element-id": self.element._id},
+ slotted_html=self.element.text,
+ )
+
+ def _convert_value(self, value: Optional[JSONTypeBound]) -> Optional[T]:
+ if value is None:
+ return None
+ self.element._update(value)
+ return self.element.value
+
+ def _clone(self) -> form[JSONTypeBound, T]:
+ return form(element=self.element)
diff --git a/marimo/_plugins/ui/_impl/switch.py b/marimo/_plugins/ui/_impl/switch.py
new file mode 100644
index 0000000000..51d3821418
--- /dev/null
+++ b/marimo/_plugins/ui/_impl/switch.py
@@ -0,0 +1,52 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from typing import Final
+
+from marimo._output.rich_help import mddoc
+from marimo._plugins.ui._core.ui_element import UIElement
+
+
+@mddoc
+class switch(UIElement[bool, bool]):
+ """
+ A boolean switch.
+
+ **Example.**
+
+ ```python
+ switch = mo.ui.switch()
+ ```
+
+ **Attributes.**
+
+ - `value`: A boolean, `True` if checked.
+
+ **Initialization Args.**
+
+ - `value`: default value, True or False
+ - `label`: text label for the element
+ """
+
+ _name: Final[str] = "marimo-switch"
+
+ def __init__(self, value: bool = False, label: str = "") -> None:
+ if not isinstance(value, bool):
+ raise ValueError(
+ "Invalid type: `value` must be a bool, but got %s"
+ % type(value)
+ )
+ if not isinstance(label, str):
+ raise ValueError(
+ "Invalid type: `label` must be a str, but got %s" % type(label)
+ )
+
+ super().__init__(
+ component_name=switch._name,
+ initial_value=value,
+ label=label,
+ args={},
+ )
+
+ def _convert_value(self, value: bool) -> bool:
+ return value
diff --git a/marimo/_plugins/ui/_impl/test_array.py b/marimo/_plugins/ui/_impl/test_array.py
new file mode 100644
index 0000000000..90c1105afc
--- /dev/null
+++ b/marimo/_plugins/ui/_impl/test_array.py
@@ -0,0 +1,45 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from marimo._plugins import ui
+
+
+def test_array() -> None:
+ def func() -> None:
+ pass
+
+ # dropdown defaults to an unserializable value (func)
+ a = ui.dropdown(options={"1": func, "2": 2}, value="1")
+ b = ui.text(value="hello")
+ c = ui.slider(1, 10, value=2)
+
+ array = ui.array([a, b, c])
+ assert array.value == [func, "hello", 2]
+
+ # make sure elements are cloned
+ assert array.elements[0].text != a.text
+ assert array.elements[1].text != b.text
+ assert array.elements[2].text != c.text
+
+ assert array.elements[0]._id != a._id
+ assert array.elements[1]._id != b._id
+ assert array.elements[2]._id != c._id
+
+ array._update({"0": "2"})
+ array._update({"1": "goodbye", "2": 1})
+ assert array.value == [2, "goodbye", 1]
+
+
+def test_nested_array() -> None:
+ inner = ui.array([ui.slider(1, 10), ui.text()])
+ outer = ui.array([inner, ui.text()])
+
+ # make sure elements are cloned
+ assert outer.elements[0].text != inner.text
+ assert outer.elements[0]._inner_text != inner._inner_text
+
+ # updating outer's inner array should not update original inner array
+ outer._update({"0": {"0": 7}})
+ outer._update({"0": {"1": "hello"}})
+ assert outer.value == [[7, "hello"], ""]
+ assert inner.value == [1, ""]
diff --git a/marimo/_plugins/ui/_impl/test_dictionary.py b/marimo/_plugins/ui/_impl/test_dictionary.py
new file mode 100644
index 0000000000..864b046223
--- /dev/null
+++ b/marimo/_plugins/ui/_impl/test_dictionary.py
@@ -0,0 +1,44 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from marimo._plugins import ui
+
+
+def test_dictionary() -> None:
+ def func() -> None:
+ pass
+
+ # dropdown defaults to an unserializable value (func)
+ a = ui.dropdown(options={"1": func, "2": 2}, value="1")
+ b = ui.text(value="hello")
+ c = ui.slider(1, 10, value=2)
+
+ dictionary = ui.dictionary({"a": a, "b": b, "c": c})
+ assert dictionary.value == {"a": func, "b": "hello", "c": 2}
+
+ # make sure elements are cloned
+ assert dictionary.elements["a"].text != a.text
+ assert dictionary.elements["b"].text != b.text
+ assert dictionary.elements["c"].text != c.text
+
+ assert dictionary.elements["a"]._id != a._id
+ assert dictionary.elements["b"]._id != b._id
+ assert dictionary.elements["c"]._id != c._id
+
+ dictionary._update({"a": "2"})
+ dictionary._update({"b": "goodbye", "c": 1})
+ assert dictionary.value == {"a": 2, "b": "goodbye", "c": 1}
+
+
+def test_nested_dict() -> None:
+ inner = ui.dictionary({"slider": ui.slider(1, 10)})
+ outer = ui.dictionary({"inner": inner})
+
+ # make sure elements are cloned
+ assert outer.elements["inner"].text != inner.text
+ assert outer.elements["inner"]._inner_text != inner._inner_text
+
+ # updating outer's inner should not update original inner
+ outer._update({"inner": {"slider": 7}})
+ assert outer.value == {"inner": {"slider": 7}}
+ assert inner.value == {"slider": 1}
diff --git a/marimo/_plugins/ui/_impl/test_input.py b/marimo/_plugins/ui/_impl/test_input.py
new file mode 100644
index 0000000000..39a07fa759
--- /dev/null
+++ b/marimo/_plugins/ui/_impl/test_input.py
@@ -0,0 +1,147 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import pytest
+
+from marimo._plugins import ui
+
+
+def test_number_init() -> None:
+ number = ui.number(1, 10)
+ assert number.start == 1
+ assert number.stop == 10
+ assert number.step is None
+ assert number.value == 1
+
+ number = ui.number(1, 10, value=5)
+ assert number.start == 1
+ assert number.stop == 10
+ assert number.step is None
+ assert number.value == 5
+ number._update(6)
+ assert number.value == 6
+ number._update(6.5)
+ # unlike slider, number should not round because users can type
+ # arbitrary numbers
+ assert number.value == 6.5
+
+
+def test_number_out_of_bounds() -> None:
+ with pytest.raises(ValueError) as e:
+ ui.number(1, 10, value=11)
+
+ assert "out of bounds" in str(e.value)
+
+ with pytest.raises(ValueError) as e:
+ ui.number(1, 10, value=0)
+
+ assert "out of bounds" in str(e.value)
+
+
+def test_number_invalid_bounds() -> None:
+ with pytest.raises(ValueError) as e:
+ ui.number(1, 0)
+
+ assert "Invalid bounds" in str(e.value)
+
+
+def test_slider_init() -> None:
+ slider = ui.slider(1, 10)
+ assert slider.start == 1
+ assert slider.stop == 10
+ assert slider.step is None
+ assert slider.value == 1
+
+ slider = ui.slider(1, 10, value=5)
+ assert slider.start == 1
+ assert slider.stop == 10
+ assert slider.step is None
+ assert slider.value == 5 and isinstance(slider.value, int)
+
+ slider = ui.slider(1, 10, value=5.0)
+ assert slider.value == 5.0 and isinstance(slider.value, float)
+
+ slider._update(6)
+ assert slider.value == 6.0 and isinstance(slider.value, float)
+
+
+def test_slider_invalid_bounds() -> None:
+ with pytest.raises(ValueError) as e:
+ ui.slider(1, 0)
+
+ assert "Invalid bounds" in str(e.value)
+
+
+def test_slider_out_of_bounds() -> None:
+ with pytest.raises(ValueError) as e:
+ ui.slider(1, 10, value=11)
+
+ assert "out of bounds" in str(e.value)
+
+ with pytest.raises(ValueError) as e:
+ ui.slider(1, 10, value=0)
+
+ assert "out of bounds" in str(e.value)
+
+
+def test_text() -> None:
+ assert ui.text().value == ""
+ assert ui.text(value="hello world").value == "hello world"
+
+ text = ui.text()
+ text._update("value")
+ assert text.value == "value"
+
+
+def test_checkbox_init() -> None:
+ assert not ui.checkbox().value
+ assert ui.checkbox(value=True).value
+
+
+def test_radio() -> None:
+ radio = ui.radio(options=["1", "2", "3"], value="1")
+ assert radio.value == "1"
+
+ radio._update("2")
+ assert radio.value == "2"
+
+ radio = ui.radio(options={"1": 1, "2": 2, "3": 3}, value="1")
+ assert radio.value == 1
+
+ radio._update("2")
+ assert radio.value == 2
+
+
+def test_dropdown() -> None:
+ dd = ui.dropdown(options=["1", "2", "3"])
+ assert dd.value is None
+
+ dd._update(["2"])
+ assert dd.value == "2"
+
+ dd = ui.dropdown(options={"1": 1, "2": 2, "3": 3}, value="1")
+ assert dd.value == 1
+
+ dd._update(["2"])
+ assert dd.value == 2
+
+
+def test_button() -> None:
+ assert ui.button().value is None
+ assert ui.button(value=1).value == 1
+
+ # default callback does nothing
+ button = ui.button(value=1)
+ button._update(None)
+ assert button.value == 1
+
+ button = ui.button(on_click=lambda v: v + 1, value=0)
+ assert button.value == 0
+ button._update(None)
+ assert button.value == 1
+ button._update(None)
+ assert button.value == 2
+
+
+# TODO(akshayka): test file
+# TODO(akshayka): test date
diff --git a/marimo/_runtime/__init__.py b/marimo/_runtime/__init__.py
new file mode 100644
index 0000000000..618f22fc54
--- /dev/null
+++ b/marimo/_runtime/__init__.py
@@ -0,0 +1 @@
+# Copyright 2023 Marimo. All rights reserved.
diff --git a/marimo/_runtime/complete.py b/marimo/_runtime/complete.py
new file mode 100644
index 0000000000..3e4f122862
--- /dev/null
+++ b/marimo/_runtime/complete.py
@@ -0,0 +1,235 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import html
+import queue
+from typing import cast
+
+import jedi # type: ignore # noqa: F401
+import jedi.api # type: ignore # noqa: F401
+
+from marimo import _loggers as loggers
+from marimo._messaging.completion_option import CompletionOption
+from marimo._messaging.message_types import CompletionResult, serialize
+from marimo._messaging.streams import Stream
+from marimo._output.md import _md
+from marimo._runtime import dataflow
+from marimo._runtime.requests import CompletionRequest
+from marimo._utils.format_signature import format_signature
+
+LOGGER = loggers.marimo_logger()
+
+
+def _is_dunder_name(name: str) -> bool:
+ return name.startswith("__") and name.endswith("__")
+
+
+def _should_include_name(name: str, prefix: str) -> bool:
+ """Exclude names starting with an underscore, except dunder names."""
+ is_dunder_name = _is_dunder_name(name)
+ if name.startswith("_"):
+ if not is_dunder_name:
+ # Never include names that start with a single underscore
+ return False
+ elif not prefix.startswith("_"):
+ return False
+ else:
+ # Only include dunder names when prefix starts with an underscore
+ return True
+ else:
+ return True
+
+
+def _get_docstring(completion: jedi.api.classes.BaseName) -> str:
+ try:
+ body = cast(str, completion.docstring(raw=True))
+ except Exception:
+ LOGGER.debug("Failed to get docstring for %s", completion.name)
+ return ""
+
+ if completion.type == "function":
+ prefix = "def "
+ elif completion.type == "class":
+ prefix = "class "
+ else:
+ prefix = ""
+
+ try:
+ signature_text = "\n\n".join(
+ [
+ format_signature(prefix, s.to_string())
+ for s in completion.get_signatures()
+ ]
+ )
+ except Exception:
+ LOGGER.debug("Maybe failed getting signature for %s", completion.name)
+ return ""
+
+ if completion.type == "module" and not signature_text:
+ signature_text = "module " + completion.name
+ elif completion.type == "keyword" and not signature_text:
+ signature_text = "keyword " + completion.name
+
+ if signature_text:
+ signature_text = _md(
+ "```python3\n" + signature_text + "\n```",
+ apply_markdown_class=False,
+ ).text
+
+ if body:
+ body = "<pre>" + html.escape(body) + "</pre>"
+
+ if signature_text and body:
+ docstring = signature_text + "\n\n" + body
+ else:
+ docstring = signature_text + body
+
+ if completion.type == "class":
+ # Append the __init__ docstring.
+ definitions = completion.goto()
+ if (
+ definitions
+ and len(definitions) == 1
+ and isinstance(definitions[0], jedi.api.classes.Name)
+ ):
+ name = definitions[0]
+ for subname in name.defined_names():
+ if subname.name.endswith("__init__"):
+ init_docstring = subname.docstring(raw=True)
+ if init_docstring:
+ init_docstring = (
+ "__init__ docstring:\n\n" + init_docstring
+ )
+ if docstring and init_docstring:
+ docstring += "\n\n" + init_docstring
+ else:
+ docstring += init_docstring
+
+ return docstring
+
+
+def _get_type_hint(completion: jedi.api.classes.BaseName) -> str:
+ try:
+ type_hint = cast(str, completion.get_type_hint())
+ except Exception:
+ # sometimes Jedi unexpectedly fails
+ return ""
+
+ if type_hint:
+ return cast(str, completion.name) + ": " + type_hint
+ else:
+ return ""
+
+
+def _get_completion_info(completion: jedi.api.classes.BaseName) -> str:
+ if completion.type != "statement":
+ return _get_docstring(completion)
+ else:
+ return _get_type_hint(completion)
+
+
+def _get_completion_options(
+ completion: jedi.api.classes.BaseName, script: jedi.Script
+) -> CompletionOption:
+ name = completion.name
+ kind = completion.type
+
+ # Choose whether the completion info should be from the name
+ # or the enclosing function's signature, if any
+ symbol_to_lookup = completion
+ if completion.type == "param":
+ # Show the function/class docstring if available
+ signatures = script.get_signatures()
+ if len(signatures) == 1:
+ symbol_to_lookup = signatures[0]
+ completion_info = _get_completion_info(symbol_to_lookup)
+
+ return CompletionOption(
+ name=name, type=kind, completion_info=completion_info
+ )
+
+
+def _write_completion_result(
+ stream: Stream,
+ completion_id: str,
+ prefix_length: int,
+ options: list[CompletionOption],
+) -> None:
+ stream.write(
+ op=CompletionResult.name,
+ data=serialize(
+ CompletionResult(
+ completion_id=completion_id,
+ prefix_length=prefix_length,
+ options=options,
+ )
+ ),
+ )
+
+
+def _write_no_completions(stream: Stream, completion_id: str) -> None:
+ _write_completion_result(stream, completion_id, 0, [])
+
+
+def complete(
+ queue: queue.Queue[CompletionRequest],
+ graph: dataflow.DirectedGraph,
+ stream: Stream,
+) -> None:
+ """Code completion worker"""
+
+ while True:
+ request = queue.get()
+ if not request.document.strip():
+ _write_no_completions(stream, request.completion_id)
+ continue
+
+ with graph.lock:
+ codes = [
+ graph.cells[cid].code
+ for cid in dataflow.topological_sort(
+ graph,
+ set(graph.cells.keys()) - set([request.cell_id]),
+ )
+ ]
+
+ try:
+ script = jedi.Script("\n".join(codes + [request.document]))
+ completions = script.complete()
+ prefix_length = (
+ completions[0].get_completion_prefix_length()
+ if completions
+ else 0
+ )
+
+ # Only complete an empty symbol (prefix length == 0) when we're
+ # using dot notation; this prevents autocomplete from kicking in at
+ # awkward times, such as when parentheses are first opened
+ if (
+ prefix_length == 0
+ and len(request.document) >= 1
+ and request.document[-1] != "."
+ ):
+ completions = []
+
+ # If there are still no completions, then bail.
+ if not completions:
+ _write_no_completions(stream, request.completion_id)
+ continue
+
+ prefix = request.document[-prefix_length:]
+ options = [
+ _get_completion_options(c, script)
+ for c in completions
+ if _should_include_name(c.name, prefix)
+ ]
+ _write_completion_result(
+ stream=stream,
+ completion_id=request.completion_id,
+ prefix_length=prefix_length,
+ options=options,
+ )
+ except Exception as e:
+ # jedi failed to provide completion
+ LOGGER.debug("Completion with jedi failed: ", str(e))
+ _write_no_completions(stream, request.completion_id)
diff --git a/marimo/_runtime/context.py b/marimo/_runtime/context.py
new file mode 100644
index 0000000000..73848662d8
--- /dev/null
+++ b/marimo/_runtime/context.py
@@ -0,0 +1,130 @@
+# Copyright 2023 Marimo. All rights reserved.
+"""Thread-local context for the runtime
+
+Each client gets its own context.
+"""
+
+
+from __future__ import annotations
+
+import threading
+from contextlib import contextmanager
+from typing import TYPE_CHECKING, Iterator, Optional
+
+from marimo._plugins.ui._core.ids import IDProvider, NoIDProviderException
+
+if TYPE_CHECKING:
+ from marimo._messaging.streams import Stderr, Stdout, Stream
+ from marimo._plugins.ui._core.registry import UIElementRegistry
+ from marimo._runtime.runtime import Kernel
+
+
+class GlobalContext:
+ """Context shared by all sessions."""
+
+ def __init__(self) -> None:
+ self._mpl_installed = False
+
+ @property
+ def mpl_installed(self) -> bool:
+ return self._mpl_installed
+
+ def set_mpl_installed(self, mpl_installed: bool) -> None:
+ self._mpl_installed = mpl_installed
+
+
+_GLOBAL_CONTEXT = GlobalContext()
+
+
+def get_global_context() -> GlobalContext:
+ return _GLOBAL_CONTEXT
+
+
+class RuntimeContext(threading.local):
+ """Encapsulates runtime state for a session; thread-local."""
+
+ def __init__(self) -> None:
+ self._kernel: Optional[Kernel] = None
+ self._ui_element_registry: Optional[UIElementRegistry] = None
+ self._stream: Optional[Stream] = None
+ self._stdout: Optional[Stdout] = None
+ self._stderr: Optional[Stderr] = None
+ self._id_provider: Optional[IDProvider] = None
+ self._initialized: bool = False
+
+ def initialize(
+ self,
+ kernel: Kernel,
+ ui_element_registry: UIElementRegistry,
+ stream: Stream,
+ stdout: Optional[Stdout],
+ stderr: Optional[Stderr],
+ ) -> None:
+ self._kernel = kernel
+ self._ui_element_registry = ui_element_registry
+ self._stream = stream
+ self._stdout = stdout
+ self._stderr = stderr
+ self._initialized = True
+
+ @property
+ def kernel(self) -> Kernel:
+ assert self._kernel is not None
+ return self._kernel
+
+ @property
+ def ui_element_registry(self) -> UIElementRegistry:
+ assert self._ui_element_registry is not None
+ return self._ui_element_registry
+
+ @property
+ def stream(self) -> Stream:
+ assert self._stream is not None
+ return self._stream
+
+ @property
+ def stdout(self) -> Optional[Stdout]:
+ return self._stdout
+
+ @property
+ def stderr(self) -> Optional[Stderr]:
+ return self._stderr
+
+ @contextmanager
+ def provide_ui_ids(self, prefix: str) -> Iterator[None]:
+ try:
+ self._id_provider = IDProvider(prefix)
+ yield
+ finally:
+ self._id_provider = None
+
+ def take_id(self) -> str:
+ if self._id_provider is None:
+ raise NoIDProviderException
+ return self._id_provider.take_id()
+
+ @property
+ def initialized(self) -> bool:
+ return self._initialized
+
+
+_RUNTIME_CONTEXT = RuntimeContext()
+
+
+def initialize_context(
+ kernel: Kernel,
+ ui_element_registry: UIElementRegistry,
+ stream: Stream,
+ stdout: Optional[Stdout],
+ stderr: Optional[Stderr],
+) -> None:
+ """Must be called exactly once for each client thread."""
+ if _RUNTIME_CONTEXT._initialized:
+ raise RuntimeError("RuntimeContext was already initialized.")
+ _RUNTIME_CONTEXT.initialize(
+ kernel, ui_element_registry, stream, stdout, stderr
+ )
+
+
+def get_context() -> RuntimeContext:
+ return _RUNTIME_CONTEXT
diff --git a/marimo/_runtime/dataflow.py b/marimo/_runtime/dataflow.py
new file mode 100644
index 0000000000..bb81bc0f4f
--- /dev/null
+++ b/marimo/_runtime/dataflow.py
@@ -0,0 +1,250 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import threading
+from collections.abc import Collection
+from dataclasses import dataclass, field
+from typing import Tuple
+
+from marimo import _loggers
+from marimo._ast.cell import Cell, CellId_t, code_key
+
+Edge = Tuple[CellId_t, CellId_t]
+
+LOGGER = _loggers.marimo_logger()
+
+
+@dataclass(frozen=True)
+class DirectedGraph:
+ # Nodes in the graph
+ cells: dict[CellId_t, Cell] = field(default_factory=dict)
+
+ # Edge (u, v) means v is a child of u, i.e., v has a reference
+ # to something defined in u
+ children: dict[CellId_t, set[CellId_t]] = field(default_factory=dict)
+
+ # Reversed edges (parent pointers) for convenience
+ parents: dict[CellId_t, set[CellId_t]] = field(default_factory=dict)
+
+ # Cells that define the same name
+ #
+ # siblings[cell_id] is a set of cell ids, one for each cell that shares a
+ # definition with cell_id.
+ #
+ # If this dict is non-empty, then the marimo program contains multiply
+ # defined names (and is therefore in an error state)
+ siblings: dict[CellId_t, set[CellId_t]] = field(default_factory=dict)
+
+ # A mapping from defs to the cells that define them
+ definitions: dict[str, set[CellId_t]] = field(default_factory=dict)
+
+ # The set of cycles in the graph
+ cycles: set[tuple[Edge, ...]] = field(default_factory=set)
+
+ # This lock must be acquired during methods that mutate the graph; it's
+ # only needed because a graph is shared between the kernel and the code
+ # completion service. It should almost always be uncontended.
+ lock: threading.Lock = field(default_factory=threading.Lock)
+
+ def is_cell_cached(self, cell_id: CellId_t, code: str) -> bool:
+ """Whether a cell with id `cell_id` and code `code` is in the graph."""
+ return (
+ cell_id in self.cells and code_key(code) == self.cells[cell_id].key
+ )
+
+ def get_referring_cells(self, name: str) -> set[CellId_t]:
+ """Get all cells that have a ref to `name`."""
+ return set([cid for cid in self.cells if name in self.cells[cid].refs])
+
+ def get_path(self, source: CellId_t, dst: CellId_t) -> list[Edge]:
+ """Get a path from `source` to `dst`, if any."""
+ if source == dst:
+ return []
+
+ queue: list[tuple[CellId_t, list[Edge]]] = [(source, [])]
+ found = set()
+ while queue:
+ node, path = queue.pop(0)
+ found.add(node)
+ for cid in self.children[node]:
+ if cid not in found:
+ next_path = path + [(node, cid)]
+ if cid == dst:
+ return next_path
+ queue.append((cid, next_path))
+ return []
+
+ def register_cell(self, cell_id: CellId_t, cell: Cell) -> None:
+ """Add a cell to the graph.
+
+ Mutates the graph, acquiring `self.lock`.
+
+ Requires that `cell_id` is not already in the graph.
+ """
+ with self.lock:
+ assert cell_id not in self.cells
+ self.cells[cell_id] = cell
+ # Children are the set of cells that refer to a name defined in
+ # `cell`
+ children: set[CellId_t] = set()
+ # Cells that define the same name as this one
+ siblings: set[CellId_t] = set()
+ # Parents are the set of cells that define a name referred to by
+ # `cell`
+ parents: set[CellId_t] = set()
+
+ # Populate children, siblings, and parents
+ self.children[cell_id] = children
+ self.siblings[cell_id] = siblings
+ self.parents[cell_id] = parents
+ for name in cell.defs:
+ self.definitions.setdefault(name, set()).add(cell_id)
+ for sibling in self.definitions[name]:
+ if sibling != cell_id:
+ siblings.add(sibling)
+ self.siblings[sibling].add(cell_id)
+
+ # a cell can refer to its own defs, but that doesn't add an
+ # edge to the dependency graph
+ referring_cells = self.get_referring_cells(name) - set(
+ (cell_id,)
+ )
+ # we will add an edge (cell_id, v) for each v in
+ # referring_cells; if there is a path from v to cell_id, then
+ # the new edge will form a cycle
+ for v in referring_cells:
+ path = self.get_path(v, cell_id)
+ if path:
+ self.cycles.add(tuple([(cell_id, v)] + path))
+
+ children.update(referring_cells)
+ for child in referring_cells:
+ self.parents[child].add(cell_id)
+
+ for name in cell.refs:
+ other_ids = (
+ self.definitions[name]
+ if name in self.definitions
+ else set()
+ ) - set((cell_id,))
+ # if other is empty, this means that the user is going to
+ # get a NameError once the cell is run, unless the symbol
+ # is say a builtin
+ for other_id in other_ids:
+ parents.add(other_id)
+ # we are adding an edge (other_id, cell_id). If there
+ # is a path from cell_id to other_id, then the new
+ # edge forms a cycle
+ path = self.get_path(cell_id, other_id)
+ if path:
+ self.cycles.add(tuple([(other_id, cell_id)] + path))
+ self.children[other_id].add(cell_id)
+
+ def delete_cell(self, cell_id: CellId_t) -> set[CellId_t]:
+ """Removes a cell from the graph.
+
+ Mutates the graph, acquiring `self.lock`.
+
+ Returns the ids of the children of the removed cell.
+ """
+ with self.lock:
+ if cell_id not in self.cells:
+ raise ValueError(f"Cell {cell_id} not found")
+
+ # Removing this cell from its defs' definer sets
+ for name in self.cells[cell_id].defs:
+ name_defs = self.definitions[name]
+ name_defs.remove(cell_id)
+ if not name_defs:
+ # No more cells define this name, so we remove it from the
+ # graph
+ del self.definitions[name]
+
+ # Remove cycles that are broken from removing this cell.
+ edges = [(cell_id, child) for child in self.children[cell_id]] + [
+ (parent, cell_id) for parent in self.parents[cell_id]
+ ]
+ for e in edges:
+ broken_cycles = [c for c in self.cycles if e in c]
+ for c in broken_cycles:
+ self.cycles.remove(c)
+
+ # Grab a reference to children before we remove it from our map.
+ children = self.children[cell_id]
+
+ # Purge this cell from the graph.
+ del self.cells[cell_id]
+ del self.children[cell_id]
+ del self.parents[cell_id]
+ del self.siblings[cell_id]
+
+ for elems in self.parents.values():
+ if cell_id in elems:
+ elems.remove(cell_id)
+ for elems in self.children.values():
+ if cell_id in elems:
+ elems.remove(cell_id)
+ for elems in self.siblings.values():
+ if cell_id in elems:
+ elems.remove(cell_id)
+
+ return children
+
+
+def transitive_closure(
+ graph: DirectedGraph, cell_ids: set[CellId_t]
+) -> set[CellId_t]:
+ """Return a set of the passed-in cells and their descendants."""
+ cells = set()
+ queue = list(cell_ids)
+ while queue:
+ cid = queue.pop(0)
+ cells.add(cid)
+ for child_id in graph.children[cid]:
+ if child_id not in cells:
+ queue.append(child_id)
+ return cells
+
+
+def induced_subgraph(
+ graph: DirectedGraph, cell_ids: Collection[CellId_t]
+) -> tuple[dict[CellId_t, set[CellId_t]], dict[CellId_t, set[CellId_t]]]:
+ """Return parents and children for each node in `cell_ids`
+
+ Represents the subgraph induced by `cell_ids`.
+ """
+ parents = {}
+ children = {}
+ for cid in cell_ids:
+ parents[cid] = set(p for p in graph.parents[cid] if p in cell_ids)
+ children[cid] = set(c for c in graph.children[cid] if c in cell_ids)
+ return parents, children
+
+
+def get_cycles(
+ graph: DirectedGraph, cell_ids: Collection[CellId_t]
+) -> list[tuple[Edge, ...]]:
+ """Get all cycles among `cell_ids`."""
+ _, induced_children = induced_subgraph(graph, cell_ids)
+ induced_edges = set(
+ [(u, v) for u in induced_children for v in induced_children[u]]
+ )
+ return [c for c in graph.cycles if all(e in induced_edges for e in c)]
+
+
+def topological_sort(
+ graph: DirectedGraph, cell_ids: Collection[CellId_t]
+) -> list[CellId_t]:
+ """Sort `cell_ids` in a topological order."""
+ parents, children = induced_subgraph(graph, cell_ids)
+ roots = [cid for cid in cell_ids if not parents[cid]]
+ sorted_cell_ids = []
+ while roots:
+ cid = roots.pop(0)
+ sorted_cell_ids.append(cid)
+ for child in children[cid]:
+ parents[child].remove(cid)
+ if not parents[child]:
+ roots.append(child)
+ # TODO make sure parents for each id is empty, otherwise cycle
+ return sorted_cell_ids
diff --git a/marimo/_runtime/requests.py b/marimo/_runtime/requests.py
new file mode 100644
index 0000000000..9ec02faa97
--- /dev/null
+++ b/marimo/_runtime/requests.py
@@ -0,0 +1,66 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from collections.abc import Iterable
+from dataclasses import dataclass
+from typing import Any, Union
+
+from marimo._ast.cell import CellId_t
+
+
+@dataclass
+class ExecutionRequest:
+ cell_id: CellId_t
+ code: str
+
+
+@dataclass
+class ExecuteMultipleRequest:
+ execution_requests: tuple[ExecutionRequest, ...]
+
+
+@dataclass
+class SetUIElementValueRequest:
+ # (object id, value) tuples
+ ids_and_values: Iterable[tuple[str, Any]]
+
+
+@dataclass
+class CreationRequest:
+ execution_requests: tuple[ExecutionRequest, ...]
+ set_ui_element_value_request: SetUIElementValueRequest
+
+
+@dataclass
+class DeleteRequest:
+ cell_id: CellId_t
+
+
+@dataclass
+class StopRequest:
+ pass
+
+
+@dataclass
+class CompletionRequest:
+ completion_id: str
+ document: str
+ cell_id: CellId_t
+
+
+@dataclass
+class ConfigurationRequest:
+ # stringified MarimoConfig
+ config: str
+
+
+Request = Union[
+ ExecutionRequest,
+ ExecuteMultipleRequest,
+ CreationRequest,
+ DeleteRequest,
+ SetUIElementValueRequest,
+ StopRequest,
+ CompletionRequest,
+ ConfigurationRequest,
+]
diff --git a/marimo/_runtime/runtime.py b/marimo/_runtime/runtime.py
new file mode 100644
index 0000000000..b919a23ebf
--- /dev/null
+++ b/marimo/_runtime/runtime.py
@@ -0,0 +1,854 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import builtins
+import contextlib
+import io
+import itertools
+import multiprocessing as mp
+import pprint
+import queue
+import re
+import signal
+import sys
+import threading
+import time
+import traceback
+from collections.abc import Iterable, Sequence
+from queue import Empty as QueueEmpty
+from typing import Any, Iterator, Optional
+
+from marimo import _loggers
+from marimo._ast.cell import CellId_t, execute_cell, parse_cell
+from marimo._messaging.errors import (
+ Error,
+ MarimoExceptionRaisedError,
+ MarimoInterruptionError,
+ MarimoSyntaxError,
+ UnknownError,
+)
+from marimo._messaging.messages import (
+ write_completed_run,
+ write_interrupted,
+ write_marimo_error,
+ write_new_run,
+ write_output,
+ write_queued,
+ write_remove_ui_elements,
+)
+from marimo._messaging.streams import Stderr, Stdout, Stream, redirect_streams
+from marimo._output.formatting import get_formatter
+from marimo._output.rich_help import mddoc
+from marimo._plugins.ui._core.registry import UIElementRegistry
+from marimo._runtime import dataflow
+from marimo._runtime.complete import complete
+from marimo._runtime.context import (
+ get_context,
+ get_global_context,
+ initialize_context,
+)
+from marimo._runtime.requests import (
+ CompletionRequest,
+ ConfigurationRequest,
+ CreationRequest,
+ DeleteRequest,
+ ExecuteMultipleRequest,
+ ExecutionRequest,
+ Request,
+ SetUIElementValueRequest,
+ StopRequest,
+)
+from marimo._runtime.validate_graph import check_for_errors
+from marimo.config._config import configure
+
+LOGGER = _loggers.marimo_logger()
+
+
+class MarimoInterrupt(Exception):
+ pass
+
+
+def cell_filename(cell_id: CellId_t) -> str:
+ return f"<cell-{cell_id}>"
+
+
+def cell_id_from_filename(filename: str) -> Optional[CellId_t]:
+ matches = re.findall(r"<cell-([0-9]+)>", filename)
+ if matches:
+ return str(matches[0])
+ return None
+
+
+@mddoc
+def defs() -> tuple[str, ...]:
+ """Get the definitions of the currently executing cell.
+
+ **Returns**:
+
+ - tuple of the currently executing cell's defs.
+ """
+ ctx = get_context()
+ if ctx.initialized and ctx.kernel.cell_id is not None:
+ return tuple(
+ sorted(
+ defn
+ for defn in ctx.kernel.graph.cells[ctx.kernel.cell_id].defs
+ )
+ )
+ return tuple()
+
+
+@mddoc
+def refs() -> tuple[str, ...]:
+ """Get the references of the currently executing cell.
+
+ **Returns**:
+
+ - tuple of the currently executing cell's refs.
+ """
+ ctx = get_context()
+ # builtins that have not been shadowed by the user
+ unshadowed_builtins = set(builtins.__dict__.keys()).difference(
+ set(ctx.kernel.graph.definitions.keys())
+ )
+ if ctx.initialized and ctx.kernel.cell_id is not None:
+ return tuple(
+ sorted(
+ defn
+ for defn in ctx.kernel.graph.cells[ctx.kernel.cell_id].refs
+ # exclude builtins that have not been shadowed
+ if defn not in unshadowed_builtins
+ )
+ )
+ return tuple()
+
+
+class Kernel:
+ def __init__(self) -> None:
+ self.globals: dict[Any, Any] = {
+ "__name__": "__main__",
+ "__builtins__": globals()["__builtins__"],
+ }
+ self.graph = dataflow.DirectedGraph()
+ self.executing = False
+ self.cell_id: Optional[CellId_t] = None
+ self.ui_initializers: dict[str, Any] = {}
+ self.errors: dict[CellId_t, tuple[Error, ...]] = {}
+
+ self.completion_thread: Optional[threading.Thread] = None
+ self.completion_queue: queue.Queue[CompletionRequest] = queue.Queue()
+
+ # an empty string represents the current directory
+ exec("import sys; sys.path.append('')", self.globals)
+ exec("import marimo as __marimo__", self.globals)
+
+ @contextlib.contextmanager
+ def _execution_ctx(self, cell_id: CellId_t) -> Iterator[None]:
+ self.executing = True
+ self.cell_id = cell_id
+ with get_context().provide_ui_ids(str(cell_id)), redirect_streams(
+ cell_id
+ ):
+ try:
+ yield
+ finally:
+ self.executing = False
+ self.cell_id = None
+
+ def _try_registering_cell(
+ self, cell_id: CellId_t, code: str
+ ) -> Optional[Error]:
+ """Attempt to register a cell with given id and code.
+
+ Precondition: a cell with the supplied id must not already exist in the
+ graph.
+
+ If cell was unable to be registered, returns an Error object.
+ """
+ error: Optional[Error] = None
+ try:
+ cell = parse_cell(code, cell_filename(cell_id), cell_id)
+ except Exception as e:
+ cell = None
+ if isinstance(e, SyntaxError):
+ tmpio = io.StringIO()
+ traceback.print_exc(file=tmpio, limit=0)
+ tmpio.seek(0)
+ syntax_error = tmpio.read().split("\n")
+ # first line has the form File XXX, line XXX
+ syntax_error[0] = syntax_error[0][
+ syntax_error[0].find("line") :
+ ]
+ error = MarimoSyntaxError(msg="\n".join(syntax_error))
+ else:
+ tmpio = io.StringIO()
+ traceback.print_exc(file=tmpio)
+ tmpio.seek(0)
+ error = UnknownError(msg=tmpio.read())
+
+ if cell is not None:
+ self.graph.register_cell(cell_id, cell)
+ LOGGER.debug("registered cell %s", cell_id)
+ LOGGER.debug("parents: %s", self.graph.parents[cell_id])
+ LOGGER.debug("children: %s", self.graph.children[cell_id])
+ return error
+
+ def _maybe_register_cell(
+ self, cell_id: CellId_t, code: str
+ ) -> tuple[set[CellId_t], Optional[Error]]:
+ """Register a cell (given by id, code) if not already registered.
+
+ If a cell with id `cell_id` is already registered but with different
+ code, that cell is deleted from the graph and a new cell with the
+ same id but different code is registered.
+
+ Returns:
+ - a set of ids for cells that were previously children of `cell_id`;
+ only non-empty when `cell-id` was already registered but with
+ different code.
+ - an `Error` if the cell couldn't be registered, `None` otherwise
+ """
+ previous_children = set()
+ error = None
+ if not self.graph.is_cell_cached(cell_id, code):
+ if cell_id in self.graph.cells:
+ LOGGER.debug("Deleting cell %s", cell_id)
+ previous_children = self._delete_cell(cell_id)
+ error = self._try_registering_cell(cell_id, code)
+
+ LOGGER.debug(
+ "graph:\n\tcell id %s\n\tparents %s\n\tchildren %s\n\tsiblings %s",
+ cell_id,
+ self.graph.parents,
+ self.graph.children,
+ self.graph.siblings,
+ )
+ return previous_children, error
+
+ def _delete_names(
+ self, names: Iterable[str], exclude_defs: set[str]
+ ) -> None:
+ """Delete `names` from kernel, except for `exclude_defs`"""
+ for name in names:
+ if name in exclude_defs:
+ continue
+
+ if name in self.globals:
+ del self.globals[name]
+
+ if (
+ "__annotations__" in self.globals
+ and name in self.globals["__annotations__"]
+ ):
+ del self.globals["__annotations__"][name]
+
+ def _invalidate_cell_state(
+ self, cell_id: CellId_t, exclude_defs: Optional[set[str]] = None
+ ) -> None:
+ """Cleanup state associated with this cell.
+
+ Deletes a cell's defs from the kernel state, except for the names in
+ `exclude_defs`, and instructs the frontend to invalidate its UI
+ elements.
+ """
+ defs_to_delete = self.graph.cells[cell_id].defs
+ self._delete_names(
+ defs_to_delete, exclude_defs if exclude_defs is not None else set()
+ )
+ write_remove_ui_elements(cell_id)
+
+ def _delete_cell(self, cell_id: CellId_t) -> set[CellId_t]:
+ """Delete a cell from the kernel and the graph.
+
+ Deletion from the kernel involves removing cell's defs and
+ de-registering its UI Elements.
+
+ Deletion from graph is forwarded to graph object.
+ """
+ if cell_id not in self.errors:
+ self._invalidate_cell_state(cell_id)
+ return self.graph.delete_cell(cell_id)
+ else:
+ # An errored cell can be thought of as a cell that's in the graph
+ # but that has no state in the kernel (because it was never run).
+ # Its defs may overlap with defs of a non-errored cell, so we MUST
+ # NOT delete/cleanup its defs from the kernel.
+ self.graph.delete_cell(cell_id)
+ return set()
+
+ def mutate_graph(
+ self,
+ execution_requests: Sequence[ExecutionRequest],
+ deletion_requests: Sequence[DeleteRequest],
+ ) -> set[CellId_t]:
+ """Add and remove cells to the graph.
+
+ This method adds the cells in `execution_requests` to the kernel's
+ graph (deleting old versions of these cells, if any), and removes the
+ cells in `execution_requests` from the kernel's graph.
+
+ The mutations that this method makes to the graph renders the
+ kernel inconsistent.
+
+ This method does not register errors for cells that were previously
+ valid and are not descendants of any of the newly registered cells.
+ This is important for multiple definition errors, since a user may
+ absent-mindedly redefine an existing name when creating a new cell:
+ such a mistake shouldn't invalidate the program state.
+
+ Returns
+ - set of cells that must be run to return kernel to consistent state
+ """
+ LOGGER.debug("Current set of errors: %s", self.errors)
+ cells_before_mutation = set(self.graph.cells.keys())
+ cells_with_errors_before_mutation = set(self.errors.keys())
+
+ # The set of cells that were successfully registered
+ registered_cell_ids = set()
+
+ # The set of cells that need to be re-run due to cells being
+ # deleted/re-registered.
+ cells_that_were_children_of_mutated_cells = set()
+
+ # Cells that were unable to be added to the graph due to syntax errors
+ syntax_errors: dict[CellId_t, Error] = {}
+
+ # Register and delete cells
+ for er in execution_requests:
+ old_children, error = self._maybe_register_cell(
+ er.cell_id, er.code
+ )
+ cells_that_were_children_of_mutated_cells |= old_children
+ if error is None:
+ registered_cell_ids.add(er.cell_id)
+ else:
+ syntax_errors[er.cell_id] = error
+
+ for dr in deletion_requests:
+ cells_that_were_children_of_mutated_cells |= self._delete_cell(
+ dr.cell_id
+ )
+ cells_in_graph = set(self.graph.cells.keys())
+
+ # Check for semantic errors, like multiple definition errors, cycle
+ # errors, and delete nonlocal errors.
+ semantic_errors = check_for_errors(self.graph)
+ LOGGER.debug("After mutation, syntax errors %s", syntax_errors)
+ LOGGER.debug("Semantic errors %s", semantic_errors)
+
+ # Prune semantic errors: we won't invalidate cells that were previously
+ # valid, except for cells we just tried to register
+ #
+ # We don't want "action at a distance": running
+ # a cell shouldn't invalidate cells that were previously valid
+ # and weren't requested for execution
+ previously_valid_cell_ids = (
+ cells_in_graph
+ # cells successfully registered
+ - registered_cell_ids
+ # cells that already had errors
+ - cells_with_errors_before_mutation
+ )
+
+ # defs that we shouldn't remove from the graph
+ keep_alive_defs: set[str] = set()
+ for cid in list(semantic_errors.keys()):
+ # If a cell was previously valid, don't invalidate it unless
+ # we have to, ie, unless it is a descendant of a just-registered
+ # cell that has an error
+ #
+ # Handles the introduction of a multiple definition error, eg
+ #
+ # cell 1: x = 0
+ # cell 2 (requested for execution): x = 1
+ #
+ # cell 1 won't be invalidated because cell 1 was previously valid
+ # and there's no path from cell 2 to cell 1
+ if cid in previously_valid_cell_ids and not any(
+ self.graph.get_path(other_cid, cid)
+ for other_cid in registered_cell_ids
+ ):
+ del semantic_errors[cid]
+ keep_alive_defs |= self.graph.cells[cid].defs
+
+ all_errors = {**semantic_errors}
+ for cid, error in syntax_errors.items():
+ # No chance of collision because cells with syntax errors are not
+ # in the graph, so can't be in semantic errors
+ assert cid not in all_errors
+ all_errors[cid] = (error,)
+
+ LOGGER.debug(
+ "Final set of errors, after pruning valid cells: %s", all_errors
+ )
+ cells_with_errors_after_mutation = set(all_errors.keys())
+
+ # Construct sets of cells that will need to be re-run.
+
+ # Cells that previously had errors (eg, multiple definition or cycle)
+ # that no longer have errors need to be refreshed.
+ cells_that_no_longer_have_errors = (
+ cells_with_errors_before_mutation
+ - cells_with_errors_after_mutation
+ ) & cells_in_graph
+
+ # Cells that were successfully registered need to be run
+ cells_registered_without_error = (
+ registered_cell_ids - cells_with_errors_after_mutation
+ )
+
+ # Cells that didn't have errors associated with them before the
+ # run request but now have errors; these cells' descendants
+ # will need to be run. Handles the case where a cell was cached (cell's
+ # code didn't change), so its previous children were not added to
+ # cells_that_were_children_of_mutated_cells
+ cells_transitioned_to_error = (
+ cells_with_errors_after_mutation
+ - cells_with_errors_before_mutation
+ ) & cells_before_mutation
+
+ # Invalidate state defined by error-ed cells, with the exception of
+ # names that were defined by valid cells (relevant for multiple
+ # definition errors)
+ for cid in all_errors:
+ if cid not in self.graph.cells:
+ # error is a registration error
+ continue
+ self._invalidate_cell_state(cid, exclude_defs=keep_alive_defs)
+
+ roots = (
+ set(
+ itertools.chain(
+ cells_registered_without_error,
+ cells_that_were_children_of_mutated_cells,
+ cells_transitioned_to_error,
+ cells_that_no_longer_have_errors,
+ )
+ )
+ & cells_in_graph
+ )
+ descendants = (
+ dataflow.transitive_closure(self.graph, roots)
+ # cells with errors can't be run, but are still in the graph
+ # so that they can be transitioned out of error if a future
+ # run request repairs the graph
+ - cells_with_errors_after_mutation
+ )
+
+ self.errors = all_errors
+ for cid in self.errors:
+ write_marimo_error(
+ data=self.errors[cid], clear_console=True, cell_id=cid
+ )
+
+ return descendants
+
+ def _run_cells(self, cell_ids: set[CellId_t]) -> None:
+ LOGGER.debug("preparing to evaluate cells %s", cell_ids)
+ for cid in cell_ids:
+ write_queued(cell_id=cid)
+
+ cells_to_run = dataflow.topological_sort(self.graph, cell_ids)
+ cells_cancelled: dict[CellId_t, set[CellId_t]] = {}
+
+ # I/O
+ #
+ # TODO(akshayka): ignore stdin (always read empty string)
+ # TODO(akshayka): redirect input to frontend (override builtins.input)
+ # or ignore/disallow input, since most users will use a
+ # marimo UI component anyway
+ # TODO(akshayka): when no logger is configured, log output is not
+ # redirected to frontend (it's printed to console),
+ # which is incorrect
+ # TODO(akshayka): pdb support
+ LOGGER.debug("final set of cells to run %s", cells_to_run)
+ interrupted = False
+ while not interrupted and cells_to_run:
+ curr_cell_id = cells_to_run.pop(0)
+ if any(
+ curr_cell_id in cancelled
+ for cancelled in cells_cancelled.values()
+ ):
+ continue
+
+ LOGGER.debug("running cell %s", curr_cell_id)
+ write_new_run(curr_cell_id)
+ curr_cell = self.graph.cells[curr_cell_id]
+
+ # State clean-up: don't leak names, UI elements, ...
+ self._invalidate_cell_state(curr_cell_id)
+
+ return_value = None
+ raised_exception = None
+ with self._execution_ctx(curr_cell_id):
+ try:
+ return_value = execute_cell(curr_cell, self.globals)
+ except Exception as e: # noqa: E722
+ raised_exception = e
+ # all three values are guaranteed to be non-None because an
+ # exception is on the stack:
+ # https://docs.python.org/3/library/sys.html#sys.exc_info
+ exc_type, exc_value, tb = sys.exc_info()
+ # custom traceback formatting strips out marimo internals
+ # and adds source code from cells
+ frames = traceback.extract_tb(tb)
+ error_msg_lines = []
+ found_cell_frame = False
+ for filename, lineno, fn_name, text in frames:
+ filename_cell_id = cell_id_from_filename(filename)
+ in_cell = filename_cell_id is not None
+ if in_cell:
+ found_cell_frame = True
+ if not found_cell_frame:
+ continue
+
+ line = " "
+ if in_cell:
+ # TODO: hyperlink to cell ... should the traceback
+ # be assembled in the frontend?
+ line += f"Cell {filename}, "
+ else:
+ line += f"File {filename}, "
+ line += f"line {lineno}"
+
+ if fn_name != "<module>":
+ line += f", in {fn_name}"
+ error_msg_lines.append(line)
+
+ if filename_cell_id is not None:
+ lines = self.graph.cells[
+ filename_cell_id
+ ].code.split("\n")
+ error_msg_lines.append(
+ " " + lines[lineno - 1].strip()
+ )
+ else:
+ error_msg_lines.append(" " + text.strip())
+
+ error_msg = (
+ "Traceback (most recent call last):\n"
+ + "\n".join(error_msg_lines)
+ + "\n"
+ + exc_type.__name__ # type: ignore
+ + ": "
+ + str(exc_value)
+ )
+ sys.stderr.write(error_msg)
+
+ if raised_exception is None:
+ return_value = "" if return_value is None else return_value
+ if (formatter := get_formatter(return_value)) is not None:
+ try:
+ mimetype, data = formatter(return_value)
+ write_output(
+ channel="output",
+ mimetype=mimetype,
+ data=data,
+ cell_id=curr_cell_id,
+ )
+ except Exception: # noqa: E722
+ with self._execution_ctx(curr_cell_id):
+ sys.stderr.write(traceback.format_exc())
+ write_output(
+ channel="output",
+ mimetype="text/plain",
+ data="",
+ cell_id=curr_cell_id,
+ )
+ else:
+ tmpio = io.StringIO()
+ if isinstance(return_value, str):
+ tmpio.write(return_value)
+ else:
+ try:
+ pprint.pprint(return_value, stream=tmpio)
+ except Exception: # noqa: E722
+ tmpio.write("")
+ with self._execution_ctx(curr_cell_id):
+ sys.stderr.write(traceback.format_exc())
+ tmpio.seek(0)
+ write_output(
+ channel="output",
+ mimetype="text/plain",
+ data=tmpio.read(),
+ cell_id=curr_cell_id,
+ )
+ elif isinstance(raised_exception, MarimoInterrupt):
+ # We don't cleanup the cell: users may want to
+ # access variables/state that was computed before interruption
+ # happened
+ LOGGER.debug("Cell %s was interrupted", curr_cell_id)
+ # don't clear console because this cell was running and
+ # its console outputs are not stale
+ write_marimo_error(
+ data=[MarimoInterruptionError()],
+ clear_console=False,
+ cell_id=curr_cell_id,
+ )
+ interrupted = True
+ else:
+ LOGGER.debug(
+ "Cell %s raised %s",
+ curr_cell_id,
+ type(raised_exception).__name__,
+ )
+ # don't clear console because this cell was running and
+ # its console outputs are not stale
+ write_marimo_error(
+ data=[
+ MarimoExceptionRaisedError(
+ msg="This cell raised an exception: %s%s"
+ % (
+ type(raised_exception).__name__,
+ f"('{str(raised_exception)}')"
+ if str(raised_exception)
+ else "",
+ ),
+ raising_cell=None,
+ )
+ ],
+ clear_console=False,
+ cell_id=curr_cell_id,
+ )
+ cells_cancelled[curr_cell_id] = set(
+ cid
+ for cid in dataflow.transitive_closure(
+ self.graph, set([curr_cell_id])
+ )
+ if cid in cells_to_run
+ )
+
+ if get_global_context().mpl_installed:
+ # ensures that every cell gets a fresh axis.
+ exec("__marimo__._output.mpl.close_figures()", self.globals)
+
+ if cells_to_run:
+ assert interrupted
+ for cid in cells_to_run:
+ # once again, we don't cleanup the cell's definitions, because
+ # the user may want to inspect state that was computed
+ # on a previous run
+ write_marimo_error(
+ data=[MarimoInterruptionError()],
+ # these cells are transitioning from queued to stopped
+ # (interrupted); they didn't get to run, so their consoles
+ # reflect a previous run and should be cleared
+ clear_console=True,
+ cell_id=cid,
+ )
+
+ for raising_cell in cells_cancelled:
+ for cid in cells_cancelled[raising_cell]:
+ # `cid` was not run. Its defs should be deleted.
+ self._invalidate_cell_state(cid)
+ write_marimo_error(
+ data=[
+ MarimoExceptionRaisedError(
+ msg="The following ancestor raised an exception: ",
+ raising_cell=raising_cell,
+ )
+ ],
+ # these cells are transitioning from queued to stopped
+ # (interrupted); they didn't get to run, so their consoles
+ # reflect a previous run and should be cleared
+ clear_console=True,
+ cell_id=cid,
+ )
+
+ LOGGER.debug("Finished run.")
+ write_completed_run()
+
+ def delete(self, request: DeleteRequest) -> None:
+ """Delete a cell from kernel and graph."""
+ cell_id = request.cell_id
+ if cell_id in self.graph.cells:
+ self._run_cells(
+ self.mutate_graph(
+ execution_requests=[], deletion_requests=[request]
+ )
+ )
+
+ def run(self, execution_requests: Sequence[ExecutionRequest]) -> None:
+ self._run_cells(
+ self.mutate_graph(execution_requests, deletion_requests=[])
+ )
+
+ def set_ui_element_value(self, request: SetUIElementValueRequest) -> None:
+ referring_cells = set()
+ for object_id, value in request.ids_and_values:
+ try:
+ component = get_context().ui_element_registry.get_object(
+ object_id
+ )
+ LOGGER.debug(
+ "Setting value on UIElement with id %s, value %s",
+ object_id,
+ value,
+ )
+ except (KeyError, NameError):
+ # KeyError: A UI element may go out of scope if it was not
+ # assigned to a global variable
+ # NameError: UI element might not have bindings
+ LOGGER.debug("Could not find UIElement with id %s", object_id)
+ continue
+
+ component._update(value)
+ bound_names = get_context().ui_element_registry.bound_names(
+ object_id
+ )
+ for name in bound_names:
+ # subtracting self.graph.definitions[name]: never rerun the
+ # cell that created the name
+ referring_cells.update(
+ self.graph.get_referring_cells(name)
+ - self.graph.definitions[name]
+ )
+ self._run_cells(
+ dataflow.transitive_closure(self.graph, referring_cells)
+ )
+
+ def get_ui_initial_value(self, object_id: str) -> Any:
+ """Get an initial value for a UIElement, if any
+
+ Initial values are optionally populated during instantiation
+
+ Args:
+ ----
+ object_id: ID of UIElement
+
+ Returns:
+ -------
+ initial value of UI element, if any
+
+ Raises:
+ ------
+ KeyError if object_id not found
+ """
+ return self.ui_initializers[object_id]
+
+ def reset_ui_initializers(self) -> None:
+ self.ui_initializers = {}
+
+ def complete(self, request: CompletionRequest) -> None:
+ if self.completion_thread is None:
+ self.completion_thread = threading.Thread(
+ target=complete,
+ args=(self.completion_queue, self.graph, get_context().stream),
+ )
+ self.completion_thread.start()
+
+ self.completion_queue.put(request)
+
+ def instantiate(self, request: CreationRequest) -> None:
+ """Instantiate the kernel with cells and UIElement initial values
+
+ During instantiation, UIElements can check for an initial value
+ with `get_initial_value`
+ """
+ if self.graph.cells:
+ del request
+ LOGGER.debug("App already instantiated.")
+ write_completed_run()
+ else:
+ self.reset_ui_initializers()
+ for (
+ object_id,
+ initial_value,
+ ) in request.set_ui_element_value_request.ids_and_values:
+ self.ui_initializers[object_id] = initial_value
+ self.run(request.execution_requests)
+ self.reset_ui_initializers()
+
+
+def launch_kernel(
+ execution_queue: mp.Queue[Request] | queue.Queue[Request],
+ socket_addr: tuple[str, int],
+ is_edit_mode: bool,
+) -> None:
+ LOGGER.debug("Launching kernel")
+
+ n_tries = 0
+ while n_tries < 100:
+ try:
+ pipe = mp.connection.Client(socket_addr)
+ break
+ except Exception:
+ n_tries += 1
+ time.sleep(0.01)
+
+ if n_tries == 100:
+ LOGGER.debug("Failed to connect to socket.")
+ return
+
+ # Create communication channels
+ stream = Stream(pipe)
+ # Console output is hidden in run mode, so no need to redirect
+ # (redirection of console outputs is not thread-safe anyway)
+ stdout = Stdout(stream) if is_edit_mode else None
+ stderr = Stderr(stream) if is_edit_mode else None
+
+ kernel = Kernel()
+ registry = UIElementRegistry()
+ initialize_context(
+ kernel=kernel,
+ ui_element_registry=registry,
+ stream=stream,
+ stdout=stdout,
+ stderr=stderr,
+ )
+
+ if is_edit_mode:
+ from marimo._output.formatters.formatters import register_formatters
+
+ # kernels are processes in edit mode, and each process needs to
+ # install the formatter import hooks
+ register_formatters()
+
+ def interrupt_handler(signum: int, frame: Any) -> None:
+ """Clears the execution queue and tries to interrupt the kernel."""
+ del signum
+ del frame
+
+ LOGGER.debug("interrupt request received")
+ while not execution_queue.empty():
+ try:
+ execution_queue.get_nowait()
+ except QueueEmpty:
+ break
+
+ # TODO(akshayka): if kernel is in `run` but not executing,
+ # it won't be interrupted, which isn't right
+ if kernel.executing:
+ write_interrupted()
+ raise MarimoInterrupt
+
+ signal.signal(signal.SIGINT, interrupt_handler)
+
+ while True:
+ try:
+ request = execution_queue.get()
+ except Exception as e:
+ # triggered on Windows when quit with Ctrl+C
+ LOGGER.debug("kernel queue.get() failed %s", e)
+ return
+ LOGGER.debug("received request %s", request)
+ if isinstance(request, CreationRequest):
+ kernel.instantiate(request)
+ elif isinstance(request, ExecuteMultipleRequest):
+ kernel.run(request.execution_requests)
+ elif isinstance(request, SetUIElementValueRequest):
+ kernel.set_ui_element_value(request)
+ elif isinstance(request, DeleteRequest):
+ kernel.delete(request)
+ elif isinstance(request, CompletionRequest):
+ kernel.complete(request)
+ elif isinstance(request, ConfigurationRequest):
+ # Kernel runs in a separate process than server in edit mode,
+ # and configuration is only allowed in edit mode. As of
+ # writing configuration only controls frontend, so this
+ # isn't actually needed. But it's helpful for debugging.
+ configure(eval(request.config))
+ elif isinstance(request, StopRequest):
+ break
+ else:
+ raise ValueError(f"Unknown request {request}")
diff --git a/marimo/_runtime/test_dataflow.py b/marimo/_runtime/test_dataflow.py
new file mode 100644
index 0000000000..0936641663
--- /dev/null
+++ b/marimo/_runtime/test_dataflow.py
@@ -0,0 +1,87 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from marimo._ast.cell import parse_cell
+from marimo._runtime import dataflow
+
+
+def test_graph_single_node() -> None:
+ code = "x = 0"
+ graph = dataflow.DirectedGraph()
+ cell = parse_cell(code)
+ graph.register_cell("0", cell)
+ assert graph.cells == {"0": cell}
+ assert graph.parents == {"0": set()}
+ assert graph.children == {"0": set()}
+
+
+def test_graph_two_chains() -> None:
+ graph = dataflow.DirectedGraph()
+ code = "x = 0"
+ first_cell = parse_cell(code)
+ graph.register_cell("0", first_cell)
+
+ code = "y = x"
+ second_cell = parse_cell(code)
+ graph.register_cell("1", second_cell)
+
+ code = "z = y\nzz = x"
+ third_cell = parse_cell(code)
+ graph.register_cell("2", third_cell)
+
+ # 0 --> 1 --> 2, 0 --> 2
+ assert graph.cells == {"0": first_cell, "1": second_cell, "2": third_cell}
+ assert graph.parents == {"0": set(), "1": set(["0"]), "2": set(["0", "1"])}
+ assert graph.children == {
+ "0": set(["1", "2"]),
+ "1": set(["2"]),
+ "2": set(),
+ }
+
+
+def test_graph_unconnected() -> None:
+ graph = dataflow.DirectedGraph()
+ code = "x = 0"
+ first_cell = parse_cell(code)
+ graph.register_cell("0", first_cell)
+
+ code = "y = 0"
+ second_cell = parse_cell(code)
+ graph.register_cell("1", second_cell)
+
+ # 0, 1
+ assert graph.cells == {"0": first_cell, "1": second_cell}
+ assert graph.parents == {"0": set(), "1": set()}
+ assert graph.children == {"0": set(), "1": set()}
+
+
+def test_graph_closure() -> None:
+ graph = dataflow.DirectedGraph()
+ code = "x = 0"
+ first_cell = parse_cell(code)
+ graph.register_cell("0", first_cell)
+
+ code = "def foo():\n return x"
+ second_cell = parse_cell(code)
+ graph.register_cell("1", second_cell)
+
+ # 0 --> 1
+ assert graph.cells == {"0": first_cell, "1": second_cell}
+ assert graph.parents == {"0": set(), "1": set(["0"])}
+ assert graph.children == {"0": set(["1"]), "1": set()}
+
+
+def test_graph_redefine() -> None:
+ graph = dataflow.DirectedGraph()
+ code = "x = 0"
+ first_cell = parse_cell(code)
+ graph.register_cell("0", first_cell)
+
+ code = "def foo():\n x = 0\n return x"
+ second_cell = parse_cell(code)
+ graph.register_cell("1", second_cell)
+
+ # 0, 1
+ assert graph.cells == {"0": first_cell, "1": second_cell}
+ assert graph.parents == {"0": set(), "1": set()}
+ assert graph.children == {"0": set(), "1": set()}
diff --git a/marimo/_runtime/test_runtime.py b/marimo/_runtime/test_runtime.py
new file mode 100644
index 0000000000..66d1e70da2
--- /dev/null
+++ b/marimo/_runtime/test_runtime.py
@@ -0,0 +1,309 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from typing import Any, Generator, Sequence
+
+import pytest
+
+from marimo._messaging.errors import (
+ CycleError,
+ DeleteNonlocalError,
+ Error,
+ MultipleDefinitionError,
+)
+from marimo._plugins.ui._core.ids import IDProvider
+from marimo._plugins.ui._core.registry import UIElementRegistry
+from marimo._runtime.context import get_context
+from marimo._runtime.dataflow import Edge
+from marimo._runtime.requests import (
+ CreationRequest,
+ DeleteRequest,
+ ExecutionRequest,
+ SetUIElementValueRequest,
+)
+from marimo._runtime.runtime import Kernel
+
+
+class _MockStream:
+ def write(self, op: str, data: dict[Any, Any]) -> None:
+ del op
+ del data
+ pass
+
+
+# fixture that provides a kernel (and tears it down)
+def k() -> Generator[Kernel, None, None]:
+ k = Kernel()
+ get_context().initialize(
+ kernel=k,
+ ui_element_registry=UIElementRegistry(),
+ stream=_MockStream(), # type: ignore
+ stdout=None,
+ stderr=None,
+ )
+ yield k
+ get_context()._kernel = None
+ get_context()._ui_element_registry = None
+ get_context()._stream = None
+ get_context()._initialized = False
+
+
+def _check_edges(error: Error, expected_edges: Sequence[Edge]) -> None:
+ assert isinstance(error, CycleError)
+ assert len(error.edges) == len(expected_edges)
+ for edge in expected_edges:
+ assert edge in error.edges or (edge[1], edge[0]) in error.edges
+
+
+# Test Basic Reactivity
+def test_triangle(k: Kernel) -> None:
+ # x
+ # x --> y
+ # x, y --> z
+ k.run(
+ [
+ ExecutionRequest("0", "x = 1"),
+ ExecutionRequest("1", "y = x + 1"),
+ ExecutionRequest("2", "z = x + y"),
+ ]
+ )
+ assert k.globals["x"] == 1
+ assert k.globals["y"] == 2
+ assert k.globals["z"] == 3
+
+ k.run([ExecutionRequest("0", "x = 2")])
+ assert k.globals["x"] == 2
+ assert k.globals["y"] == 3
+ assert k.globals["z"] == 5
+
+ k.run([ExecutionRequest("1", "y = 0")])
+ assert k.globals["x"] == 2
+ assert k.globals["y"] == 0
+ assert k.globals["z"] == 2
+
+ k.delete(DeleteRequest("1"))
+ assert k.globals["x"] == 2
+ assert "y" not in k.globals
+ assert "z" not in k.globals
+
+ k.delete(DeleteRequest("0"))
+ assert "x" not in k.globals
+ assert "y" not in k.globals
+ assert "z" not in k.globals
+
+
+def test_set_ui_element_value(k: Kernel) -> None:
+ k.run([ExecutionRequest("0", "import marimo as mo")])
+ k.run([ExecutionRequest("1", "s = mo.ui.slider(0, 10, value=1); s")])
+ k.run([ExecutionRequest("2", "x = s.value + 1")])
+ assert k.globals["x"] == 2
+
+ element_id = k.globals["s"]._id
+ k.set_ui_element_value(SetUIElementValueRequest([(element_id, 5)]))
+ assert k.globals["s"].value == 5
+ assert k.globals["x"] == 6
+
+
+def test_creation_with_ui_element_value(k: Kernel) -> None:
+ id_provider = IDProvider(prefix="1")
+ k.instantiate(
+ CreationRequest(
+ execution_requests=(
+ ExecutionRequest("0", "import marimo as mo"),
+ ExecutionRequest("1", "s = mo.ui.slider(0, 10, value=1)"),
+ ),
+ set_ui_element_value_request=SetUIElementValueRequest(
+ [(id_provider.take_id(), 2)]
+ ),
+ )
+ )
+ assert k.globals["s"].value == 2
+
+
+# Test errors in marimo semantics
+def test_kernel_simultaneous_multiple_definition_error(k: Kernel) -> None:
+ k.run([ExecutionRequest("0", "x=0"), ExecutionRequest("1", "x=1")])
+
+ assert "x" not in k.globals
+ assert set(k.errors.keys()) == {"0", "1"}
+ assert k.errors["0"] == (MultipleDefinitionError("x", ("1",)),)
+ assert k.errors["1"] == (MultipleDefinitionError("x", ("0",)),)
+
+
+def test_kernel_new_multiple_definition_does_not_invalidate(k: Kernel) -> None:
+ k.run([ExecutionRequest("0", "x=0")])
+ assert k.globals["x"] == 0
+ assert not k.errors
+
+ # cell 0 should not be invalidated by the introduction of cell 1
+ k.run([ExecutionRequest("1", "x=0")])
+ assert k.globals["x"] == 0
+ assert set(k.errors.keys()) == {"1"}
+ assert k.errors["1"] == (MultipleDefinitionError("x", ("0",)),)
+
+ # re-running cell 0 should invalidate it
+ k.run([ExecutionRequest("0", "x=0")])
+ assert "x" not in k.globals
+ assert set(k.errors.keys()) == {"0", "1"}
+ assert k.errors["0"] == (MultipleDefinitionError("x", ("1",)),)
+ assert k.errors["1"] == (MultipleDefinitionError("x", ("0",)),)
+
+
+def test_clear_multiple_definition_error(k: Kernel) -> None:
+ k.run([ExecutionRequest("0", "x=0"), ExecutionRequest("1", "x=1")])
+ assert "x" not in k.globals
+ assert set(k.errors.keys()) == {"0", "1"}
+ assert k.errors["0"] == (MultipleDefinitionError("x", ("1",)),)
+ assert k.errors["1"] == (MultipleDefinitionError("x", ("0",)),)
+
+ # Rename second occurrence of x to y; should eliminate error and run both
+ # cells
+ k.run([ExecutionRequest("1", "y=1")])
+ assert k.globals["x"] == 0
+ assert k.globals["y"] == 1
+ assert not k.errors
+
+
+def test_clear_multiple_definition_error_with_delete(k: Kernel) -> None:
+ k.run([ExecutionRequest("0", "x=0"), ExecutionRequest("1", "x=1")])
+ assert "x" not in k.globals
+ assert set(k.errors.keys()) == {"0", "1"}
+ assert k.errors["0"] == (MultipleDefinitionError("x", ("1",)),)
+ assert k.errors["1"] == (MultipleDefinitionError("x", ("0",)),)
+
+ # issue delete request for cell 1 to clear error and run cell 0
+ k.delete(DeleteRequest("1"))
+ assert k.globals["x"] == 0
+ assert not k.errors
+
+
+def test_new_errors_update_old_ones(k: Kernel) -> None:
+ k.run([ExecutionRequest("0", "x=0")])
+ k.run([ExecutionRequest("1", "x, y =1, 2")])
+ assert set(k.errors.keys()) == {"1"}
+ assert k.errors["1"] == (MultipleDefinitionError("x", ("0",)),)
+
+ # errors propagated back to cell 1, even though we are not running it
+ k.run([ExecutionRequest("2", "x, y = 3, 4")])
+ assert set(k.errors.keys()) == {"1", "2"}
+ assert k.errors["1"] == (
+ MultipleDefinitionError("x", ("0", "2")),
+ MultipleDefinitionError("y", ("2",)),
+ )
+ assert k.errors["2"] == (
+ MultipleDefinitionError("x", ("0", "1")),
+ MultipleDefinitionError("y", ("1",)),
+ )
+
+ assert k.globals["x"] == 0
+
+
+def test_cycle_error(k: Kernel) -> None:
+ k.run(
+ [
+ ExecutionRequest("0", "x=y"),
+ ExecutionRequest("1", "y=x"),
+ ExecutionRequest("2", "z = x + 1"),
+ ]
+ )
+ assert "x" not in k.globals
+ assert "y" not in k.globals
+ assert set(k.errors.keys()) == {"0", "1"}
+ assert len(k.errors["0"]) == 1
+ assert len(k.errors["1"]) == 1
+ _check_edges(k.errors["0"][0], [("0", "1"), ("1", "0")])
+ _check_edges(k.errors["1"][0], [("0", "1"), ("1", "0")])
+
+ # break cycle by modifying cell
+ k.run([ExecutionRequest("1", "y=1")])
+ assert k.globals["x"] == 1
+ assert k.globals["y"] == 1
+ assert k.globals["z"] == 2
+ assert not k.errors
+
+
+def test_break_cycle_error_with_delete(k: Kernel) -> None:
+ k.run(
+ [
+ ExecutionRequest("0", "x=y"),
+ ExecutionRequest("1", "y=x"),
+ ]
+ )
+ assert "x" not in k.globals
+ assert "y" not in k.globals
+ assert set(k.errors.keys()) == {"0", "1"}
+ assert len(k.errors["0"]) == 1
+ assert len(k.errors["1"]) == 1
+ _check_edges(k.errors["0"][0], [("0", "1"), ("1", "0")])
+
+ # break cycle by deleting cell
+ k.delete(DeleteRequest("1"))
+ assert not k.errors
+
+
+def test_delete_nonlocal_error(k: Kernel) -> None:
+ k.run(
+ [
+ ExecutionRequest("0", "x=0"),
+ ExecutionRequest("1", "del x; y = 1"),
+ ExecutionRequest("2", "z = y + 1"),
+ ]
+ )
+ assert "y" not in k.globals
+ assert "z" not in k.globals
+ assert set(k.errors.keys()) == {"1"}
+ assert k.errors["1"] == (DeleteNonlocalError("x", ("0",)),)
+
+ # fix cell 1, should run cell 1 and 2
+ k.run([ExecutionRequest("1", "y=1")])
+ assert k.globals["y"] == 1
+ assert k.globals["z"] == 2
+ assert not k.errors
+
+
+def test_defs_with_no_definers_are_removed_from_cell(k: Kernel) -> None:
+ k.run([ExecutionRequest("0", "x=0"), ExecutionRequest("1", "del x")])
+ assert set(k.errors.keys()) == {"1"}
+ assert k.errors["1"] == (DeleteNonlocalError("x", ("0",)),)
+
+ # Delete the cell that defines x. There shouldn't be any more errors
+ # because x no longer exists.
+ k.delete(DeleteRequest("0"))
+ assert not k.errors
+
+ # Add x back in.
+ k.run([ExecutionRequest("2", "x=0")])
+ assert set(k.errors.keys()) == {"1"}
+ assert k.errors["1"] == (DeleteNonlocalError("x", ("2",)),)
+
+ # Repair graph
+ k.run([ExecutionRequest("1", "y = x + 1")])
+ assert not k.errors
+ assert k.globals["y"] == 1
+
+ # Make sure graph is tracking x again and update propagates
+ k.run([ExecutionRequest("2", "x = 1")])
+ assert not k.errors
+ assert k.globals["y"] == 2
+
+
+def test_syntax_error(k: Kernel) -> None:
+ k.run([ExecutionRequest("0", "x=0"), ExecutionRequest("1", "x; y = 1")])
+ assert k.globals["x"] == 0
+ assert k.globals["y"] == 1
+ assert not k.errors
+
+ k.run([ExecutionRequest("0", "x=")])
+ assert "x" not in k.globals
+ assert "y" not in k.globals
+ assert "0" not in k.graph.cells
+ assert "1" in k.graph.cells
+
+ # fix syntax error
+ k.run([ExecutionRequest("0", "x=0")])
+ assert k.globals["x"] == 0
+ assert k.globals["y"] == 1
+ assert "0" in k.graph.cells
+ assert "1" in k.graph.cells
+ assert not k.errors
diff --git a/marimo/_runtime/test_validate_graph.py b/marimo/_runtime/test_validate_graph.py
new file mode 100644
index 0000000000..6a5881a617
--- /dev/null
+++ b/marimo/_runtime/test_validate_graph.py
@@ -0,0 +1,130 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from typing import cast
+
+from marimo._ast.cell import parse_cell
+from marimo._messaging.errors import (
+ CycleError,
+ DeleteNonlocalError,
+ MultipleDefinitionError,
+)
+from marimo._runtime import dataflow
+from marimo._runtime.validate_graph import check_for_errors
+
+
+def test_multiple_definition_error() -> None:
+ graph = dataflow.DirectedGraph()
+ graph.register_cell("0", parse_cell("x = 0"))
+ graph.register_cell("1", parse_cell("x = 1"))
+ errors = check_for_errors(graph)
+ assert set(errors.keys()) == set(["0", "1"])
+ assert errors["0"] == (MultipleDefinitionError(name="x", cells=("1",)),)
+ assert errors["1"] == (MultipleDefinitionError(name="x", cells=("0",)),)
+
+ graph.register_cell("2", parse_cell("x = 1"))
+ errors = check_for_errors(graph)
+ assert set(errors.keys()) == set(["0", "1", "2"])
+ assert errors["0"] == (
+ MultipleDefinitionError(name="x", cells=("1", "2")),
+ )
+ assert errors["1"] == (
+ MultipleDefinitionError(name="x", cells=("0", "2")),
+ )
+ assert errors["2"] == (
+ MultipleDefinitionError(name="x", cells=("0", "1")),
+ )
+
+
+def test_overlapping_multiple_definition_errors() -> None:
+ graph = dataflow.DirectedGraph()
+ graph.register_cell("0", parse_cell("x = 0"))
+ graph.register_cell("1", parse_cell("x, y = 1, 2"))
+ graph.register_cell("2", parse_cell("y, z = 3, 4"))
+ errors = check_for_errors(graph)
+ assert set(errors.keys()) == set(["0", "1", "2"])
+ assert errors["0"] == (MultipleDefinitionError(name="x", cells=("1",)),)
+ assert errors["1"] == (
+ MultipleDefinitionError(name="x", cells=("0",)),
+ MultipleDefinitionError(name="y", cells=("2",)),
+ )
+ assert errors["2"] == (MultipleDefinitionError(name="y", cells=("1",)),)
+
+
+def test_underscore_variables_are_private() -> None:
+ graph = dataflow.DirectedGraph()
+ graph.register_cell("0", parse_cell("_x = 0"))
+ graph.register_cell("1", parse_cell("_x = 1"))
+ errors = check_for_errors(graph)
+ assert not errors
+
+ graph = dataflow.DirectedGraph()
+ graph.register_cell("0", parse_cell("_x = 0"))
+ graph.register_cell("1", parse_cell("del _x"))
+ errors = check_for_errors(graph)
+ assert not errors
+
+
+def test_delete_nonlocal_error() -> None:
+ graph = dataflow.DirectedGraph()
+ graph.register_cell("0", parse_cell("x = 0"))
+ graph.register_cell("1", parse_cell("del x"))
+ errors = check_for_errors(graph)
+ assert set(errors.keys()) == set(["1"])
+ assert errors["1"] == (DeleteNonlocalError(name="x", cells=("0",)),)
+
+
+def test_two_node_cycle() -> None:
+ graph = dataflow.DirectedGraph()
+ graph.register_cell("0", parse_cell("x = y"))
+ graph.register_cell("1", parse_cell("y = x"))
+ errors = check_for_errors(graph)
+ assert set(errors.keys()) == set(["0", "1"])
+ assert errors["0"] == (CycleError(edges=(("0", "1"), ("1", "0"))),)
+ assert errors["1"] == (CycleError(edges=(("0", "1"), ("1", "0"))),)
+
+
+def test_three_node_cycle() -> None:
+ graph = dataflow.DirectedGraph()
+ graph.register_cell("0", parse_cell("x = y"))
+ graph.register_cell("1", parse_cell("y = z"))
+ graph.register_cell("2", parse_cell("z = x"))
+ errors = check_for_errors(graph)
+ assert set(errors.keys()) == set(["0", "1", "2"])
+ for _, t in errors.items():
+ assert len(t) == 1
+ assert isinstance(t[0], CycleError)
+ edges = t[0].edges
+ assert len(edges) == 3
+ assert ("0", "1") in edges or ("1", "0") in edges
+ assert ("1", "2") in edges or ("2", "1") in edges
+ assert ("0", "2") in edges or ("2", "0") in edges
+
+
+def test_cycle_and_multiple_def() -> None:
+ graph = dataflow.DirectedGraph()
+ graph.register_cell("0", parse_cell("x, z = y, 0"))
+ graph.register_cell("1", parse_cell("y, z = x, 0"))
+ errors = check_for_errors(graph)
+ assert set(errors.keys()) == set(["0", "1"])
+ for cell, t in errors.items():
+ assert len(t) == 2
+ assert isinstance(t[0], CycleError) or isinstance(t[1], CycleError)
+ assert isinstance(t[0], MultipleDefinitionError) or isinstance(
+ t[1], MultipleDefinitionError
+ )
+ cycle_error = cast(
+ CycleError, t[0] if isinstance(t[0], CycleError) else t[1]
+ )
+ edges = cycle_error.edges
+ assert len(edges) == 2
+ assert ("0", "1") in edges and ("1", "0") in edges
+
+ multiple_definition_error = cast(
+ MultipleDefinitionError,
+ t[0] if isinstance(t[0], MultipleDefinitionError) else t[1],
+ )
+ assert (
+ multiple_definition_error.name == "z"
+ and multiple_definition_error.cells == (str((int(cell) + 1) % 2),)
+ )
diff --git a/marimo/_runtime/validate_graph.py b/marimo/_runtime/validate_graph.py
new file mode 100644
index 0000000000..4db963d042
--- /dev/null
+++ b/marimo/_runtime/validate_graph.py
@@ -0,0 +1,93 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import itertools
+from collections import defaultdict
+
+from marimo._ast.cell import CellId_t
+from marimo._messaging.errors import (
+ CycleError,
+ DeleteNonlocalError,
+ Error,
+ MultipleDefinitionError,
+)
+from marimo._runtime.dataflow import DirectedGraph
+
+
+def check_for_multiple_definitions(
+ graph: DirectedGraph,
+) -> dict[CellId_t, list[MultipleDefinitionError]]:
+ """Check whether multiple cells define the same global name."""
+ errors = defaultdict(list)
+ defs = sorted(
+ list(set().union(*(cell.defs for _, cell in graph.cells.items())))
+ )
+ for name in defs:
+ defining_cells = graph.definitions[name]
+ if len(defining_cells) > 1:
+ for cid in defining_cells:
+ errors[cid].append(
+ MultipleDefinitionError(
+ name=name,
+ cells=tuple(sorted(defining_cells - set([cid]))),
+ )
+ )
+ return errors
+
+
+def check_for_delete_nonlocal(
+ graph: DirectedGraph,
+) -> dict[CellId_t, list[DeleteNonlocalError]]:
+ """Check whether cells delete their refs."""
+ errors = defaultdict(list)
+ for cid in graph.cells.keys():
+ for name in graph.cells[cid].deleted_refs:
+ if name in graph.definitions:
+ errors[cid].append(
+ DeleteNonlocalError(
+ name=name,
+ cells=tuple(graph.definitions[name]),
+ )
+ )
+ return errors
+
+
+def check_for_cycles(graph: DirectedGraph) -> dict[CellId_t, list[CycleError]]:
+ """Return cycle errors, if any."""
+ errors = defaultdict(list)
+ for cycle in graph.cycles:
+ nodes_in_cycle: set[CellId_t] = set(sum(cycle, ()))
+ for cid in nodes_in_cycle:
+ errors[cid].append(CycleError(edges=cycle))
+ return errors
+
+
+def check_for_errors(
+ graph: DirectedGraph,
+) -> dict[CellId_t, tuple[Error, ...]]:
+ """
+ Check graph for violations of marimo semantics.
+
+ Return a dict of errors in the graph, with an entry for each cell
+ that is involved in an error.
+ """
+ multiple_definition_errors = check_for_multiple_definitions(graph)
+ delete_nonlocal_errors = check_for_delete_nonlocal(graph)
+ cycle_errors = check_for_cycles(graph)
+
+ errors: dict[CellId_t, tuple[Error, ...]] = {}
+ for cid in set(
+ itertools.chain(
+ multiple_definition_errors.keys(),
+ delete_nonlocal_errors.keys(),
+ cycle_errors.keys(),
+ )
+ ):
+ errors[cid] = tuple(
+ itertools.chain(
+ multiple_definition_errors[cid],
+ cycle_errors[cid],
+ delete_nonlocal_errors[cid],
+ )
+ )
+ return errors
diff --git a/marimo/_server/__init__.py b/marimo/_server/__init__.py
new file mode 100644
index 0000000000..618f22fc54
--- /dev/null
+++ b/marimo/_server/__init__.py
@@ -0,0 +1 @@
+# Copyright 2023 Marimo. All rights reserved.
diff --git a/marimo/_server/api/__init__.py b/marimo/_server/api/__init__.py
new file mode 100644
index 0000000000..b0e1bd47c4
--- /dev/null
+++ b/marimo/_server/api/__init__.py
@@ -0,0 +1,28 @@
+# Copyright 2023 Marimo. All rights reserved.
+__all__ = [
+ "CodeCompleteHandler",
+ "DeleteHandler",
+ "DirectoryAutocompleteHandler",
+ "FormatHandler",
+ "InstantiateHandler",
+ "InterruptHandler",
+ "RenameHandler",
+ "RunHandler",
+ "SaveHandler",
+ "SaveUserConfigurationHandler",
+ "SetUIElementValueHandler",
+]
+
+from marimo._server.api.code_complete import CodeCompleteHandler
+from marimo._server.api.delete import DeleteHandler
+from marimo._server.api.directory_autocomplete import (
+ DirectoryAutocompleteHandler,
+)
+from marimo._server.api.format import FormatHandler
+from marimo._server.api.instantiate import InstantiateHandler
+from marimo._server.api.interrupt import InterruptHandler
+from marimo._server.api.rename import RenameHandler
+from marimo._server.api.run import RunHandler
+from marimo._server.api.save import SaveHandler
+from marimo._server.api.save_user_config import SaveUserConfigurationHandler
+from marimo._server.api.set_ui_element_value import SetUIElementValueHandler
diff --git a/marimo/_server/api/code_complete.py b/marimo/_server/api/code_complete.py
new file mode 100644
index 0000000000..8b838f19d9
--- /dev/null
+++ b/marimo/_server/api/code_complete.py
@@ -0,0 +1,33 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from dataclasses import dataclass
+
+import tornado.web
+
+from marimo._ast.cell import CellId_t
+from marimo._runtime import requests
+from marimo._server import sessions
+from marimo._server.api.model import parse_raw
+
+
+@dataclass
+class CodeComplete:
+ id: str
+ document: str
+ cell_id: CellId_t
+
+
+class CodeCompleteHandler(tornado.web.RequestHandler):
+ """Complete a path to subdirectories and Python files."""
+
+ def post(self) -> None:
+ args = parse_raw(self.request.body, CodeComplete)
+ session = sessions.require_session_from_header(self.request.headers)
+ session.queue.put(
+ requests.CompletionRequest(
+ completion_id=args.id,
+ document=args.document,
+ cell_id=args.cell_id,
+ )
+ )
diff --git a/marimo/_server/api/delete.py b/marimo/_server/api/delete.py
new file mode 100644
index 0000000000..01402c07d8
--- /dev/null
+++ b/marimo/_server/api/delete.py
@@ -0,0 +1,28 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from dataclasses import dataclass
+
+import tornado.web
+
+from marimo._ast.cell import CellId_t
+from marimo._runtime import requests
+from marimo._server import sessions
+from marimo._server.api.model import parse_raw
+
+
+@dataclass
+class Delete:
+ cell_id: CellId_t
+
+
+class DeleteHandler(tornado.web.RequestHandler):
+ """Delete a cell with a given id"""
+
+ @sessions.requires_edit
+ def post(self) -> None:
+ session = sessions.require_session_from_header(self.request.headers)
+ args = parse_raw(self.request.body, Delete)
+ cell_id = CellId_t(args.cell_id)
+ request = requests.DeleteRequest(cell_id=cell_id)
+ session.queue.put(request)
diff --git a/marimo/_server/api/directory_autocomplete.py b/marimo/_server/api/directory_autocomplete.py
new file mode 100644
index 0000000000..2ceb26266f
--- /dev/null
+++ b/marimo/_server/api/directory_autocomplete.py
@@ -0,0 +1,44 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import os
+from dataclasses import dataclass
+
+import tornado.web
+
+from marimo._server.api.model import parse_raw
+
+
+@dataclass
+class DirectoryAutocomplete:
+ prefix: str
+
+
+class DirectoryAutocompleteHandler(tornado.web.RequestHandler):
+ """Complete a path to subdirectories and Python files."""
+
+ def post(self) -> None:
+ args = parse_raw(self.request.body, DirectoryAutocomplete)
+ directory = os.path.dirname(args.prefix)
+ if not directory:
+ directory = "."
+
+ try:
+ subdirectories, files = next(os.walk(directory))[1:]
+ except StopIteration:
+ self.write({"directories": [], "files": []})
+ return
+
+ basename = os.path.basename(args.prefix)
+ directories = sorted(
+ [d for d in subdirectories if d.startswith(basename)]
+ )
+ files = sorted(
+ [f for f in files if f.startswith(basename) and f.endswith(".py")]
+ )
+ self.write(
+ {
+ "directories": directories,
+ "files": files,
+ }
+ )
diff --git a/marimo/_server/api/format.py b/marimo/_server/api/format.py
new file mode 100644
index 0000000000..a67fad9d84
--- /dev/null
+++ b/marimo/_server/api/format.py
@@ -0,0 +1,45 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from dataclasses import dataclass
+
+import tornado.web
+
+from marimo import _loggers
+from marimo._ast import cell
+from marimo._server import sessions
+from marimo._server.api.model import parse_raw
+
+LOGGER = _loggers.marimo_logger()
+
+
+@dataclass
+class Format:
+ # map from cell id to code
+ codes: dict[cell.CellId_t, str]
+
+
+class FormatHandler(tornado.web.RequestHandler):
+ """Save an app to disk."""
+
+ @sessions.requires_edit
+ def post(self) -> None:
+ try:
+ import black
+ except ModuleNotFoundError:
+ LOGGER.debug(
+ "To enable code formatting, install black (pip install black)"
+ )
+ return
+
+ args = parse_raw(self.request.body, Format)
+ codes = args.codes
+ formatted_codes: dict[cell.CellId_t, str] = {}
+ for key, code in codes.items():
+ try:
+ mode = black.Mode(line_length=79) # type: ignore
+ formatted = black.format_str(code, mode=mode)
+ formatted_codes[key] = formatted.strip()
+ except Exception:
+ formatted_codes[key] = code
+ self.write({"codes": formatted_codes})
diff --git a/marimo/_server/api/instantiate.py b/marimo/_server/api/instantiate.py
new file mode 100644
index 0000000000..e9f2f04821
--- /dev/null
+++ b/marimo/_server/api/instantiate.py
@@ -0,0 +1,42 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from dataclasses import dataclass
+from typing import Any
+
+import tornado.web
+
+from marimo._runtime import requests
+from marimo._server import sessions
+from marimo._server.api.model import parse_raw
+
+
+@dataclass
+class Instantiate:
+ # unique identifiers for UIElements
+ object_ids: list[str]
+ # initial value of each UIElement
+ values: list[Any]
+
+
+class InstantiateHandler(tornado.web.RequestHandler):
+ """Instantiate an app
+
+ Run all cells, parametrized by values for UI elements, if any.
+ """
+
+ def post(self) -> None:
+ session = sessions.require_session_from_header(self.request.headers)
+ args = parse_raw(self.request.body, Instantiate)
+ mgr = sessions.get_manager()
+ app_data = mgr.app_data()
+ request = requests.CreationRequest(
+ execution_requests=tuple(
+ requests.ExecutionRequest(cid, cell_data.code)
+ for cid, cell_data in app_data.items()
+ ),
+ set_ui_element_value_request=requests.SetUIElementValueRequest(
+ zip(args.object_ids, args.values)
+ ),
+ )
+ session.queue.put(request)
diff --git a/marimo/_server/api/interrupt.py b/marimo/_server/api/interrupt.py
new file mode 100644
index 0000000000..c8314fc2cb
--- /dev/null
+++ b/marimo/_server/api/interrupt.py
@@ -0,0 +1,15 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import tornado.web
+
+from marimo._server import sessions
+
+
+class InterruptHandler(tornado.web.RequestHandler):
+ """Interrupt the kernel's execution."""
+
+ def post(self) -> None:
+ sessions.require_session_from_header(
+ self.request.headers
+ ).try_interrupt()
diff --git a/marimo/_server/api/model.py b/marimo/_server/api/model.py
new file mode 100644
index 0000000000..16d9098d18
--- /dev/null
+++ b/marimo/_server/api/model.py
@@ -0,0 +1,28 @@
+# Copyright 2023 Marimo. All rights reserved.
+import json
+from typing import Type, TypeVar
+
+T = TypeVar("T")
+
+
+def to_snake(string: str) -> str:
+ # basic conversion of javascript camel case to snake
+ # does not handle contiguous caps
+ return "".join(
+ ["_" + i.lower() if i.isupper() else i for i in string]
+ ).lstrip("_")
+
+
+def parse_raw(message: bytes, cls: Type[T]) -> T:
+ """Utility to parse a message as JSON, and instantiate into supplied type.
+
+ Transforms all fields in the parsed JSON from camel case to snake case.
+
+ Args:
+ ----
+ message: the message to parse
+ cls: the type to instantiate
+ """
+ parsed = json.loads(message)
+ transformed = {to_snake(k): v for k, v in parsed.items()}
+ return cls(**transformed)
diff --git a/marimo/_server/api/rename.py b/marimo/_server/api/rename.py
new file mode 100644
index 0000000000..2bbfe22f7d
--- /dev/null
+++ b/marimo/_server/api/rename.py
@@ -0,0 +1,66 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import os
+from dataclasses import dataclass
+
+import tornado.web
+
+from marimo import _loggers
+from marimo._server import sessions
+from marimo._server.api import status
+from marimo._server.api.model import parse_raw
+from marimo._server.utils import canonicalize_filename
+
+LOGGER = _loggers.marimo_logger()
+
+
+@dataclass
+class Rename:
+ filename: str
+
+
+class RenameHandler(tornado.web.RequestHandler):
+ """Rename the current app."""
+
+ @sessions.requires_edit
+ def post(self) -> None:
+ mgr = sessions.get_manager()
+ args = parse_raw(self.request.body, Rename)
+ filename = args.filename
+ LOGGER.debug("Renaming from %s to %s", mgr.filename, filename)
+ if filename is not None:
+ filename = canonicalize_filename(filename)
+
+ if filename == mgr.filename:
+ # no-op
+ pass
+ elif filename is None:
+ mgr.rename(filename)
+ elif os.path.exists(filename):
+ raise tornado.web.HTTPError(
+ status.HTTPStatus.METHOD_NOT_ALLOWED,
+ reason="File {0} already exists".format(filename),
+ )
+ elif mgr.filename is None:
+ try:
+ # create a file named `filename`
+ with open(filename, "w") as _:
+ pass
+ except Exception as err:
+ raise tornado.web.HTTPError(
+ status.HTTPStatus.SERVER_ERROR,
+ reason="Failed to create file {0}".format(filename),
+ ) from err
+ mgr.rename(filename)
+ else:
+ try:
+ os.rename(mgr.filename, filename)
+ except Exception as err:
+ raise tornado.web.HTTPError(
+ status.HTTPStatus.SERVER_ERROR,
+ reason="Failed to rename from {0} to {1}".format(
+ mgr.filename, filename
+ ),
+ ) from err
+ mgr.rename(filename)
diff --git a/marimo/_server/api/run.py b/marimo/_server/api/run.py
new file mode 100644
index 0000000000..4f4eb22f5f
--- /dev/null
+++ b/marimo/_server/api/run.py
@@ -0,0 +1,38 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from dataclasses import dataclass
+
+import tornado.web
+
+from marimo._ast.cell import CellId_t
+from marimo._runtime import requests
+from marimo._server import sessions
+from marimo._server.api.model import parse_raw
+
+
+@dataclass
+class Run:
+ # ids of cells to run
+ cell_ids: list[CellId_t]
+ # code to register/run for each cell
+ codes: list[str]
+
+
+class RunHandler(tornado.web.RequestHandler):
+ """Run multiple cells (and their descendants).
+
+ Only allowed in edit mode.
+ """
+
+ @sessions.requires_edit
+ def post(self) -> None:
+ session = sessions.require_session_from_header(self.request.headers)
+ args = parse_raw(self.request.body, Run)
+ request = requests.ExecuteMultipleRequest(
+ tuple(
+ requests.ExecutionRequest(cid, code)
+ for cid, code in zip(args.cell_ids, args.codes)
+ )
+ )
+ session.queue.put(request)
diff --git a/marimo/_server/api/save.py b/marimo/_server/api/save.py
new file mode 100644
index 0000000000..b4fbb133ed
--- /dev/null
+++ b/marimo/_server/api/save.py
@@ -0,0 +1,61 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import os
+from dataclasses import dataclass
+
+import tornado.web
+
+from marimo import _loggers
+from marimo._ast import codegen
+from marimo._server import sessions
+from marimo._server.api.model import parse_raw
+from marimo._server.api.status import HTTPStatus
+from marimo._server.utils import canonicalize_filename
+
+LOGGER = _loggers.marimo_logger()
+
+
+@dataclass
+class Save:
+ # code for each cell
+ codes: list[str]
+ # name of each cell
+ names: list[str]
+ # path to app
+ filename: str
+
+
+class SaveHandler(tornado.web.RequestHandler):
+ """Save an app to disk."""
+
+ @sessions.requires_edit
+ def post(self) -> None:
+ mgr = sessions.get_manager()
+ args = parse_raw(self.request.body, Save)
+ codes, names, filename = args.codes, args.names, args.filename
+ filename = canonicalize_filename(filename)
+ if mgr.filename is not None and mgr.filename != filename:
+ raise tornado.web.HTTPError(
+ HTTPStatus.METHOD_NOT_ALLOWED,
+ reason="Save handler cannot rename files.",
+ )
+ elif mgr.filename is None and os.path.exists(filename):
+ raise tornado.web.HTTPError(
+ HTTPStatus.METHOD_NOT_ALLOWED,
+ reason="File {0} already exists".format(filename),
+ )
+ else:
+ # try to save the app under the name `filename`
+ contents = codegen.generate_filecontents(codes, names)
+ LOGGER.debug("Saving app to %s", filename)
+ try:
+ with open(filename, "w", encoding="utf-8") as f:
+ f.write(contents)
+ except Exception as e:
+ raise tornado.web.HTTPError(
+ HTTPStatus.SERVER_ERROR,
+ reason="Failed to save file: {0}".format(str(e)),
+ ) from e
+ if mgr.filename is None:
+ mgr.rename(filename)
diff --git a/marimo/_server/api/save_user_config.py b/marimo/_server/api/save_user_config.py
new file mode 100644
index 0000000000..f11429a869
--- /dev/null
+++ b/marimo/_server/api/save_user_config.py
@@ -0,0 +1,84 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import os
+from dataclasses import dataclass
+from typing import Any
+
+import tornado.web
+
+from marimo import _loggers
+from marimo._runtime import requests
+from marimo._server import sessions
+from marimo._server.api.model import parse_raw
+from marimo._server.api.status import HTTPStatus
+from marimo.config._config import MarimoConfig, configure
+from marimo.config._utils import get_config_path
+
+LOGGER = _loggers.marimo_logger()
+
+
+_INDENT = " " * 4
+
+
+def _format_configuration(config: Any, depth: int) -> str:
+ if isinstance(config, dict):
+ key_indent = _INDENT * depth
+ closing_brace_indent = _INDENT * (depth - 1)
+ lines = ["{"]
+ for key in sorted(config.keys()):
+ value = _format_configuration(config[key], depth=depth + 1)
+ lines.append(key_indent + f'"{key}": {value}')
+ lines.append(closing_brace_indent + "},")
+ return "\n".join(lines)
+ elif isinstance(config, str):
+ return f'"{config}",'
+ else:
+ return str(config) + ","
+
+
+@dataclass
+class SaveUserConfiguration:
+ # user configuration
+ config: MarimoConfig
+
+
+class SaveUserConfigurationHandler(tornado.web.RequestHandler):
+ """Save user configuration to disk."""
+
+ @sessions.requires_edit
+ def post(self) -> None:
+ session = sessions.require_session_from_header(self.request.headers)
+ args = parse_raw(self.request.body, SaveUserConfiguration)
+ config_path = get_config_path()
+ config_dir = (
+ os.path.dirname(config_path)
+ if config_path
+ else os.path.expanduser("~")
+ )
+ LOGGER.debug("Saving user configuration to %s", config_dir)
+ config_path = os.path.join(config_dir, "marimo.config.py")
+ file_contents = "\n".join(
+ [
+ "import marimo as mo",
+ "",
+ "mo.config.configure(",
+ f"{_INDENT}config="
+ + _format_configuration(args.config, depth=2),
+ ")",
+ ]
+ )
+
+ try:
+ with open(config_path, "w", encoding="utf-8") as f:
+ f.write(file_contents)
+ except Exception as e:
+ raise tornado.web.HTTPError(
+ HTTPStatus.SERVER_ERROR,
+ reason="Failed to save file: {0}".format(str(e)),
+ ) from e
+
+ # Update the server's view of the config
+ configure(args.config)
+ # Update the kernel's view of the config
+ session.queue.put(requests.ConfigurationRequest(str(args.config)))
diff --git a/marimo/_server/api/set_ui_element_value.py b/marimo/_server/api/set_ui_element_value.py
new file mode 100644
index 0000000000..2c620ccbfc
--- /dev/null
+++ b/marimo/_server/api/set_ui_element_value.py
@@ -0,0 +1,33 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from dataclasses import dataclass
+from typing import Any
+
+import tornado.web
+
+from marimo._runtime import requests
+from marimo._server import sessions
+from marimo._server.api.model import parse_raw
+
+
+@dataclass
+class SetUIElementValue:
+ # ids of UI elements whose values we'll set
+ object_ids: list[str]
+ # value of each UI element; same length as object_ids
+ values: list[Any]
+
+
+class SetUIElementValueHandler(tornado.web.RequestHandler):
+ def post(self) -> None:
+ session = sessions.require_session_from_header(self.request.headers)
+ args = parse_raw(self.request.body, SetUIElementValue)
+ session.queue.put(
+ requests.SetUIElementValueRequest(
+ zip(
+ args.object_ids,
+ args.values,
+ )
+ )
+ )
diff --git a/marimo/_server/api/status.py b/marimo/_server/api/status.py
new file mode 100644
index 0000000000..6b45fe6838
--- /dev/null
+++ b/marimo/_server/api/status.py
@@ -0,0 +1,14 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from enum import IntEnum
+
+
+class HTTPStatus(IntEnum):
+ OK = 200
+ BAD_REQUEST = 400
+ FORBIDDEN = 403
+ NOT_FOUND = 404
+ METHOD_NOT_ALLOWED = 405
+ UNSUPPORTED_MEDIA_TYPE = 415
+ SERVER_ERROR = 500
diff --git a/marimo/_server/server.py b/marimo/_server/server.py
new file mode 100644
index 0000000000..2399f249c9
--- /dev/null
+++ b/marimo/_server/server.py
@@ -0,0 +1,355 @@
+# Copyright 2023 Marimo. All rights reserved.
+"""The marimo server: serves a marimo app.
+
+A marimo server can be created in edit (read-write) or run (read-only) mode.
+When in run mode, an arbitrary number of clients can be connected to the
+server, and each client gets their own Python kernel. When in edit mode, at
+most one client can be connected.
+
+Each server is tied to a single marimo app; once the server has started, it is
+not possible to change the served app.
+"""
+from __future__ import annotations
+
+import asyncio
+import json
+import os
+import secrets
+import signal
+import socket
+import subprocess
+import sys
+import webbrowser
+from shutil import which
+from typing import Any, Optional
+
+import importlib_resources
+import tornado.autoreload
+import tornado.ioloop
+import tornado.web
+import tornado.websocket
+
+from marimo import _loggers
+from marimo._server import api, sessions
+from marimo._server.utils import TAB, print_tabbed
+from marimo.config._config import get_configuration
+from marimo.config._utils import load_config
+
+DEFAULT_PORT = 2718
+UTF8_SUPPORTED = False
+ORIGINAL_SIGINT_HANDLER = signal.getsignal(signal.SIGINT)
+
+try:
+ "🌊🍃".encode(sys.stdout.encoding)
+ UTF8_SUPPORTED = True
+except Exception:
+ pass
+
+
+def _utf8(msg: str) -> str:
+ return msg if UTF8_SUPPORTED else ""
+
+
+def shutdown(with_error: bool = False) -> None:
+ """Shutdown the server."""
+ mgr = sessions.get_manager()
+ if with_error:
+ logger = _loggers.marimo_logger()
+ logger.fatal("marimo shut down with an error.")
+ elif not mgr.quiet:
+ print()
+ print_tabbed(
+ "\033[32mThanks for using marimo!\033[0m %s" % _utf8("🌊🍃")
+ )
+ print()
+ mgr.close_all_sessions()
+ tornado.ioloop.IOLoop.current().stop()
+ if with_error:
+ sys.exit(1)
+ else:
+ sys.exit(0)
+
+
+def interrupt_handler(signum: int, frame: Any) -> None:
+ del signum
+ del frame
+
+ # Restore the original signal handler so re-entering Ctrl+C raises a
+ # keyboard interrupt instead of calling this function again (input is not
+ # re-entrant, so it's not safe to call this function again)
+ signal.signal(signal.SIGINT, ORIGINAL_SIGINT_HANDLER)
+ mgr = sessions.get_manager()
+ if mgr.quiet:
+ shutdown()
+
+ try:
+ response = input(
+ f"\r{TAB}\033[1;32mAre you sure you want to quit?\033[0m "
+ "\033[1m(y/n)\033[0m: "
+ )
+ if response.lower().strip() == "y":
+ shutdown()
+ except (KeyboardInterrupt, EOFError):
+ print()
+ shutdown()
+
+ # Program is still alive: restore the interrupt handler
+ signal.signal(signal.SIGINT, interrupt_handler)
+
+
+class MainHandler(tornado.web.RequestHandler):
+ def get(self) -> None:
+ mgr = sessions.get_manager()
+ # reading the xsrf_token property sets the cookie as a side effect
+ self.xsrf_token # noqa: B018
+ title = (
+ "marimo"
+ if mgr.filename is None
+ # filename is used as title, except basename and suffix are
+ # stripped and underscores are replaced with spaces
+ else os.path.splitext(os.path.basename(mgr.filename))[0].replace(
+ "_", " "
+ )
+ )
+ self.render(
+ "index.html",
+ title=title,
+ filename=mgr.filename if mgr.filename is not None else "",
+ mode="read" if mgr.mode == sessions.SessionMode.RUN else "edit",
+ config=json.dumps(get_configuration()),
+ )
+
+
+class ShutdownHandler(tornado.web.RequestHandler):
+ """Shutdown the server and all sessions."""
+
+ @sessions.requires_edit
+ def post(self) -> None:
+ shutdown()
+
+
+async def start_server(
+ port: Optional[int] = None,
+ headless: bool = False,
+ filename: Optional[str] = None,
+ run: bool = False,
+ development_mode: bool = False,
+ quiet: bool = False,
+) -> None:
+ """Start the server.
+
+ Args:
+ ----
+ port: port on which to listen
+ headless: if False, opens a client connection in user's browser
+ filename: path to marimo app to serve; if None, opens a blank app
+ run: if True, starts the server in run (read-only) mode; if False, runs
+ in edit (read-write) mode.
+ development_mode: if True, enables tornado debug logging and autoreloading
+ """
+ # Initialization
+ logger = _loggers.marimo_logger()
+ _loggers.initialize_tornado_loggers(development_mode)
+ session_mgr = sessions.initialize_manager(
+ filename=filename,
+ mode=(
+ sessions.SessionMode.EDIT if not run else sessions.SessionMode.RUN
+ ),
+ development_mode=development_mode,
+ quiet=quiet,
+ )
+ try:
+ load_config()
+ except Exception as e:
+ logger.fatal("Error parsing the marimo configuration file: ")
+ logger.fatal(type(e).__name__ + ": " + str(e))
+ shutdown(with_error=True)
+
+ signal.signal(signal.SIGINT, interrupt_handler)
+
+ root = os.path.realpath(
+ importlib_resources.files("marimo").joinpath("_static")
+ )
+ static_dir = os.path.join(root, "assets")
+ app = tornado.web.Application(
+ [
+ (r"/", MainHandler),
+ (r"/iosocket", sessions.IOSocketHandler),
+ (
+ r"/api/kernel/shutdown/",
+ ShutdownHandler,
+ ),
+ (
+ r"/api/kernel/instantiate/",
+ api.InstantiateHandler,
+ ),
+ (
+ r"/api/kernel/run/",
+ api.RunHandler,
+ ),
+ (
+ r"/api/kernel/set_ui_element_value/",
+ api.SetUIElementValueHandler,
+ ),
+ (
+ r"/api/kernel/interrupt/",
+ api.InterruptHandler,
+ ),
+ (
+ r"/api/kernel/delete/",
+ api.DeleteHandler,
+ ),
+ (
+ r"/api/kernel/code_autocomplete/",
+ api.CodeCompleteHandler,
+ ),
+ (
+ r"/api/kernel/directory_autocomplete/",
+ api.DirectoryAutocompleteHandler,
+ ),
+ (
+ r"/api/kernel/format/",
+ api.FormatHandler,
+ ),
+ (
+ r"/api/kernel/rename/",
+ api.RenameHandler,
+ ),
+ (
+ r"/api/kernel/save/",
+ api.SaveHandler,
+ ),
+ (
+ r"/api/kernel/save_user_config/",
+ api.SaveUserConfigurationHandler,
+ ),
+ (
+ r"/(favicon\.svg)",
+ tornado.web.StaticFileHandler,
+ {"path": root},
+ ),
+ (
+ r"/(manifest\.json)",
+ tornado.web.StaticFileHandler,
+ {"path": root},
+ ),
+ (
+ r"/(noise\.png)",
+ tornado.web.StaticFileHandler,
+ {"path": root},
+ ),
+ (
+ r"/(gradient\.png)",
+ tornado.web.StaticFileHandler,
+ {"path": root},
+ ),
+ (
+ r"/(logo192\.png)",
+ tornado.web.StaticFileHandler,
+ {"path": root},
+ ),
+ (
+ r"/(logo512\.png)",
+ tornado.web.StaticFileHandler,
+ {"path": root},
+ ),
+ (
+ r"/assets/(.*)",
+ tornado.web.StaticFileHandler,
+ {"path": static_dir},
+ ),
+ ],
+ cookie_secret=secrets.token_hex(),
+ template_path=root,
+ xsrf_cookies=True,
+ # This allows embedding the app in an iframe on another domain
+ xsrf_cookie_kwargs={
+ "samesite": "None",
+ "secure": True,
+ },
+ debug=development_mode,
+ # ping the websocket once a second to prevent intermittent
+ # disconnections
+ websocket_ping_interval=1,
+ # close the websocket if we don't receive a pong after 60 seconds
+ websocket_ping_timeout=60,
+ )
+
+ port_requested_by_user = port is not None
+ if port is None:
+ port = DEFAULT_PORT
+
+ attempts = 0
+ max_attempts = 100 if not port_requested_by_user else 1
+ while attempts < max_attempts:
+ try:
+ app.listen(port)
+ break
+ except (OSError, socket.error):
+ attempts += 1
+ logger.debug("Port %d is in use.", port)
+ if not port_requested_by_user:
+ port += 1
+
+ if attempts >= max_attempts:
+ if port_requested_by_user:
+ raise OSError(
+ 48,
+ f"Port {port} already in use. Try letting marimo pick a port "
+ "for you instead by omitting the port option.",
+ )
+ raise RuntimeError(
+ f"Could not find a free port (tried {max_attempts} ports)."
+ )
+
+ url = f"http://localhost:{port}"
+
+ if not headless:
+ if which("xdg-open") is not None:
+ with open(os.devnull, "w") as devnull:
+ subprocess.Popen(
+ ["xdg-open", url],
+ # don't forward signals: ctrl-c shouldn't kill the browser
+ preexec_fn=os.setpgrp,
+ stdout=devnull,
+ stderr=subprocess.STDOUT,
+ )
+ else:
+ webbrowser.open(url)
+
+ if not session_mgr.quiet:
+ print()
+ if session_mgr.filename is not None and not run:
+ print_tabbed(
+ f"\033[1;32mEdit {os.path.basename(session_mgr.filename)} "
+ "in your browser\033[0m " + _utf8("📝")
+ )
+ elif session_mgr.filename is not None and run:
+ print_tabbed(
+ f"\033[1;32mRunning {os.path.basename(session_mgr.filename)}"
+ "\033[0m " + _utf8("⚡")
+ )
+ else:
+ print_tabbed(
+ "\033[1;32mCreate a new marimo app in your browser\033[0m "
+ + _utf8("🛠")
+ )
+ print()
+ print_tabbed(f"\033[32mURL\033[0m: \033[1m{url}\033[0m")
+ print()
+
+ if development_mode:
+ tornado.autoreload.start()
+ for dirname, _, files in os.walk(str(root)):
+ for f in files:
+ if f.startswith("."):
+ continue
+ tornado.autoreload.watch(os.path.join(dirname, f))
+
+ tornado.autoreload.add_reload_hook(session_mgr.close_all_sessions)
+ shutdown_event = asyncio.Event()
+ await shutdown_event.wait()
+
+
+if __name__ == "__main__":
+ asyncio.run(start_server(port=DEFAULT_PORT, development_mode=True))
diff --git a/marimo/_server/sessions.py b/marimo/_server/sessions.py
new file mode 100644
index 0000000000..795ea780e5
--- /dev/null
+++ b/marimo/_server/sessions.py
@@ -0,0 +1,488 @@
+# Copyright 2023 Marimo. All rights reserved.
+"""Client session management
+
+This module encapsulates session management: each client gets a unique session,
+and each session wraps a Python kernel and a websocket connection through which
+the kernel can send messages to the frontend. Sessions do not share kernels or
+websockets.
+
+In run mode, in which we may have many clients connected to the server, a
+session is closed as soon as its websocket connection is severed. In edit mode,
+in which we have at most one connected client, a session may be kept around
+even if its socket is closed.
+"""
+from __future__ import annotations
+
+import asyncio
+import functools
+import multiprocessing as mp
+import os
+import queue
+import signal
+import sys
+import threading
+from dataclasses import dataclass
+from enum import Enum
+from multiprocessing import connection
+from typing import Any, Callable, Optional
+
+import tornado.httputil
+import tornado.ioloop
+import tornado.web
+import tornado.websocket
+
+from marimo import _loggers
+from marimo._ast import codegen
+from marimo._ast.cell import CellId_t
+from marimo._messaging.message_types import KernelReady, serialize
+from marimo._output.formatters.formatters import register_formatters
+from marimo._runtime import requests, runtime
+from marimo._server.api.status import HTTPStatus
+from marimo._server.utils import print_tabbed
+
+LOGGER = _loggers.marimo_logger()
+SESSION_MANAGER: Optional["SessionManager"] = None
+
+
+class ConnectionState(Enum):
+ OPEN = 0
+ CLOSED = 1
+
+
+class IOSocketHandler(tornado.websocket.WebSocketHandler):
+ """WebSocket that sessions use to send messages to frontends.
+
+ Each new socket gets a unique session. At most one session can exist when
+ in edit mode.
+ """
+
+ status: ConnectionState
+
+ def write_op(self, op: str, data: Any) -> asyncio.Future[None]:
+ """Send a message to the client.
+
+ Args:
+ ----
+ op: name of the operation
+ data: JSON-serializable operation data
+ """
+ try:
+ return self.write_message(
+ {
+ "op": op,
+ "data": data,
+ }
+ )
+ except tornado.websocket.WebSocketClosedError:
+ LOGGER.info(
+ "Failed to send operation to frontend because the socket "
+ f"was closed; op: {op}"
+ )
+
+ async def return_none() -> None:
+ pass
+
+ return asyncio.ensure_future(return_none())
+
+ def write_kernel_ready(self) -> None:
+ """Communicates to the client that the kernel is ready."""
+ mgr = get_manager()
+ codes: tuple[str, ...]
+ names: tuple[str, ...]
+ app_data = mgr.app_data()
+ if mgr.mode == SessionMode.EDIT:
+ codes = tuple(cell_data.code for cell_data in app_data.values())
+ names = tuple(cell_data.name for cell_data in app_data.values())
+ else:
+ # Don't send code to frontend in run mode
+ codes = tuple("" for _ in app_data)
+ names = tuple("" for _ in app_data)
+ self.write_op(
+ op=KernelReady.name,
+ data=serialize(KernelReady(codes=codes, names=names)),
+ )
+
+ def reconnect_session(self, session: "Session") -> None:
+ """Reconnect to an existing session (kernel).
+
+ A websocket can be closed when a user's computer goes to sleep,
+ spurious network issues, etc.
+ """
+ assert session.socket.status == ConnectionState.CLOSED
+ self.status = ConnectionState.OPEN
+ session.socket = self
+
+ def open(self, *args: str, **kwargs: str) -> None:
+ del args
+ del kwargs
+ try:
+ session_id = self.get_query_argument("session_id")
+ if session_id is None:
+ raise tornado.web.MissingArgumentError("session_id is None")
+ except tornado.web.MissingArgumentError:
+ LOGGER.error("Malformed connection URL, missing session_id")
+ self.close(1003, "MARIMO_MALFORMED_QUERY")
+ return
+ self.session_id = session_id
+
+ mgr = get_manager()
+ session = mgr.get_session(session_id)
+ LOGGER.debug(
+ "websocket open request for session with id %s", session_id
+ )
+ LOGGER.debug("existing sessions: %s", mgr.sessions)
+ if mgr.mode == SessionMode.EDIT:
+ if mgr.any_clients_connected():
+ LOGGER.debug(
+ "refusing connection; a frontend is already connected."
+ )
+ self.close(1003, "MARIMO_ALREADY_CONNECTED")
+ elif session is not None:
+ # The session already exists, but it was disconnected.
+ # This can happen in local development when the client
+ # goes to sleep and wakes later. Just replace the session's
+ # socket, but keep its kernel
+ LOGGER.debug("Reconnecting session %s", session_id)
+ self.reconnect_session(session)
+ else:
+ # No clients are connected, and we haven't seen this session id
+ # before. Create a session.
+ #
+ # If the client refreshed their page, there will be one
+ # existing session with a closed socket for a different session
+ # id; that's why we call `close_all_sessions`.
+ mgr.close_all_sessions()
+ mgr.create_session(session_id=session_id, socket_handler=self)
+ self.status = ConnectionState.OPEN
+ self.write_kernel_ready()
+ elif session is not None:
+ LOGGER.debug("Reconnecting session %s", session_id)
+ session.cancel_close()
+ self.reconnect_session(session)
+ else:
+ mgr.create_session(session_id=session_id, socket_handler=self)
+ self.status = ConnectionState.OPEN
+ # Let the frontend know it can instantiate the app.
+ self.write_kernel_ready()
+
+ def on_close(self) -> None:
+ LOGGER.debug("websocket connection for %s closed", self.session_id)
+ self.status = ConnectionState.CLOSED
+ mgr = get_manager()
+ if mgr.mode == SessionMode.RUN:
+ # TODO: keep alive
+ def _close() -> None:
+ if self.status != ConnectionState.OPEN:
+ LOGGER.debug(
+ "Closing session %s (TTL EXPIRED)", self.session_id
+ )
+ mgr.close_session(self.session_id)
+
+ session = mgr.get_session(self.session_id)
+ cancellation_handle = tornado.ioloop.IOLoop.current().call_later(
+ Session.TTL_SECONDS, _close
+ )
+ if session is not None:
+ session.cancel_close_handle = cancellation_handle
+
+
+class Session:
+ """A client session.
+
+ Each session has its own Python kernel, for editing and running the app,
+ and its own websocket, for sending messages to the client.
+ """
+
+ TTL_SECONDS = 120
+
+ def __init__(self, socket_handler: IOSocketHandler) -> None:
+ """Initialize kernel and client connection to it."""
+ mpctx = mp.get_context("spawn")
+ mgr = get_manager()
+ self.socket = socket_handler
+ self.cancel_close_handle: Optional[object] = None
+ self.queue: mp.Queue[requests.Request] | queue.Queue[requests.Request]
+ self.kernel_task: threading.Thread | mp.Process
+ self.read_conn: connection.Connection
+
+ # Need to use a socket for windows compatibility
+ listener = connection.Listener(family="AF_INET")
+ is_edit_mode = mgr.mode == SessionMode.EDIT
+ if is_edit_mode:
+ # We use a process in edit mode so that we can interrupt the app
+ # with a SIGINT; we don't mind the additional memory consumption,
+ # since there's only one client session
+ self.queue = mpctx.Queue()
+ self.kernel_task = mp.Process(
+ target=runtime.launch_kernel,
+ args=(self.queue, listener.address, is_edit_mode),
+ )
+ else:
+ # We use threads in run mode to minimize memory consumption;
+ # launching a process would copy the entire program state,
+ # which (as of writing) is around 150MB
+ self.queue = queue.Queue()
+ loop = tornado.ioloop.IOLoop.current()
+
+ # We can't terminate threads, so we have to wait until they
+ # naturally exit before cleaning up resources
+ def launch_kernel_with_cleanup(*args: Any) -> None:
+ runtime.launch_kernel(*args)
+ loop.remove_handler(self.read_conn.fileno())
+ self.read_conn.close()
+
+ # install formatter import hooks, which will be shared by all
+ # threads (in edit mode, the single kernel process installs
+ # formatters ...)
+ register_formatters()
+
+ # Make threads daemons so killing the server immediately brings
+ # down all client sessions
+ self.kernel_task = threading.Thread(
+ target=launch_kernel_with_cleanup,
+ args=(self.queue, listener.address, is_edit_mode),
+ daemon=True,
+ )
+ self.kernel_task.start()
+ # First thing kernel does is connect to the socket, so it's safe to
+ # call accept
+ self.read_conn = listener.accept()
+
+ def reader(fd: int, events: int) -> None:
+ del fd
+ del events
+ (op, data) = self.read_conn.recv()
+ self.socket.write_op(op=op, data=data)
+
+ tornado.ioloop.IOLoop.current().add_handler(
+ self.read_conn.fileno(),
+ reader,
+ events=(tornado.ioloop.IOLoop.READ),
+ )
+
+ def check_alive() -> None:
+ if not self.kernel_task.is_alive():
+ self.close()
+ print()
+ print_tabbed(
+ "\033[31mThe Python kernel died unexpectedly.\033[0m"
+ )
+ print()
+ sys.exit()
+
+ self.kernel_heartbeat = tornado.ioloop.PeriodicCallback(
+ check_alive, callback_time=1000.0
+ )
+ self.kernel_heartbeat.start()
+
+ def try_interrupt(self) -> None:
+ if (
+ isinstance(self.kernel_task, mp.Process)
+ and self.kernel_task.pid is not None
+ ):
+ LOGGER.debug("Sending SIGINT to kernel")
+ os.kill(self.kernel_task.pid, signal.SIGINT)
+
+ def close(self) -> None:
+ """Close kernel, sockets, and pipes."""
+ if self.kernel_heartbeat.is_running():
+ self.kernel_heartbeat.stop()
+ if isinstance(self.kernel_task, mp.Process):
+ # guaranteed to be a multiprocessing Queue; annoying to assert
+ # this, because mp.Queue appears to be a function
+ self.queue.close() # type: ignore
+ if self.kernel_task.is_alive():
+ self.kernel_task.terminate()
+ tornado.ioloop.IOLoop.current().remove_handler(
+ self.read_conn.fileno()
+ )
+ self.read_conn.close()
+ elif self.kernel_task.is_alive():
+ # kernel thread cleans up read/write conn and IOloop handler on
+ # exit; we don't join the thread because we don't want to block
+ self.queue.put(requests.StopRequest())
+ # 1000 - normal closure
+ self.socket.close(1000, "MARIMO_SHUTDOWN")
+
+ def cancel_close(self) -> None:
+ if self.cancel_close_handle is not None:
+ tornado.ioloop.IOLoop.current().remove_timeout(
+ self.cancel_close_handle
+ )
+
+
+class SessionMode(Enum):
+ # read-write
+ EDIT = 0
+ # read-only
+ RUN = 1
+
+
+@dataclass
+class CellData:
+ code: str
+ name: str
+
+
+class SessionManager:
+ """Mapping from client session IDs to sessions.
+
+ Maintains a mapping from client session IDs to client sessions;
+ there is exactly one session per client.
+
+ The SessionManager also encapsulates state common to all sessions:
+ - the app filename
+ - the app mode (edit or run)
+ """
+
+ def __init__(
+ self,
+ filename: Optional[str],
+ mode: SessionMode,
+ development_mode: bool,
+ quiet: bool,
+ ) -> None:
+ self.filename = filename
+ self.mode = mode
+ self.development_mode = development_mode
+ self.quiet = quiet
+ self.sessions: dict[str, Session] = {}
+
+ def app_data(self) -> dict[CellId_t, CellData]:
+ # TODO(akshayka): remove assumption that cell ids are indices
+ codes, names = codegen.get_codes(self.filename)
+ cell_ids = [CellId_t(i) for i in range(len(codes))]
+ return {
+ cid: CellData(code, name)
+ for cid, code, name in zip(cell_ids, codes, names)
+ }
+
+ def rename(self, filename: Optional[str]) -> None:
+ """Register a change in filename.
+
+ Should be called if an api call renamed the current file on disk.
+ """
+ self.filename = filename
+
+ def create_session(
+ self, session_id: str, socket_handler: IOSocketHandler
+ ) -> Session:
+ """Create a new session
+
+ The `socket_handler` should already be open.
+ """
+ LOGGER.debug("creating new session for id %s", session_id)
+ if session_id not in self.sessions:
+ s = Session(socket_handler=socket_handler)
+ self.sessions[session_id] = s
+ return s
+ else:
+ return self.sessions[session_id]
+
+ def get_session(self, session_id: str) -> Optional[Session]:
+ if session_id in self.sessions:
+ return self.sessions[session_id]
+ return None
+
+ def any_clients_connected(self) -> bool:
+ """Returns True if at least one client has an open socket."""
+ for session in self.sessions.values():
+ if session.socket.status == ConnectionState.OPEN:
+ return True
+ return False
+
+ def close_session(self, session_id: str) -> None:
+ LOGGER.debug("closing session %s", session_id)
+ session = self.get_session(session_id)
+ if session is not None:
+ session.close()
+ del self.sessions[session_id]
+
+ def close_all_sessions(self) -> None:
+ LOGGER.debug("Closing all sessions (sessions: %s)", self.sessions)
+ for session in self.sessions.values():
+ session.close()
+ LOGGER.debug("All sessions closed.")
+ self.sessions = {}
+
+
+def requires_edit(handler: Callable[..., Any]) -> Callable[..., Any]:
+ """Mark a function as requiring edit permissions.
+
+ Raises:
+ ------
+ tornado.web.HTTPError: if session manager is not in edit mode.
+ """
+
+ @functools.wraps(handler)
+ def _throw_if_not_edit(*args: Any, **kwargs: Any) -> Any:
+ if get_manager().mode != SessionMode.EDIT:
+ raise tornado.web.HTTPError(HTTPStatus.FORBIDDEN)
+ else:
+ return handler(*args, **kwargs)
+
+ return _throw_if_not_edit
+
+
+def initialize_manager(
+ filename: Optional[str],
+ mode: SessionMode,
+ development_mode: bool,
+ quiet: bool,
+) -> SessionManager:
+ """Must be called on server start."""
+ global SESSION_MANAGER
+ SESSION_MANAGER = SessionManager(
+ filename=filename,
+ mode=mode,
+ development_mode=development_mode,
+ quiet=quiet,
+ )
+ return SESSION_MANAGER
+
+
+def get_manager() -> SessionManager:
+ """Cannot be called until manager has been initialized."""
+ assert SESSION_MANAGER is not None
+ return SESSION_MANAGER
+
+
+def session_id_from_header(
+ headers: tornado.httputil.HTTPHeaders,
+) -> str:
+ """Extracts session ID from request header.
+
+ All endpoints require a session ID to be in the request header.
+ """
+ session_id = headers.get_list("Marimo-Session-Id")
+ if not session_id:
+ raise RuntimeError(
+ "Invalid headers (Marimo-Session-Id not found\n\n)" + str(headers)
+ )
+ elif len(session_id) > 1:
+ raise RuntimeError(
+ "Invalid headers (> 1 Marimo-Session-Id\n\n)" + str(headers)
+ )
+ return session_id[0]
+
+
+def session_from_header(
+ headers: tornado.httputil.HTTPHeaders,
+) -> Optional[Session]:
+ """Get the Session implied by the request header, if any."""
+ session_id = session_id_from_header(headers)
+ mgr = get_manager()
+ session = mgr.get_session(session_id)
+ if session is None:
+ LOGGER.error("Session with id %s not found", session_id)
+ return session
+
+
+def require_session_from_header(
+ headers: tornado.httputil.HTTPHeaders,
+) -> Session:
+ """Throws an HTTPError if no Session is found."""
+ session = session_from_header(headers)
+ if session is None:
+ raise tornado.web.HTTPError(HTTPStatus.NOT_FOUND, "Session not found.")
+ return session
diff --git a/marimo/_server/utils.py b/marimo/_server/utils.py
new file mode 100644
index 0000000000..b19151f69f
--- /dev/null
+++ b/marimo/_server/utils.py
@@ -0,0 +1,18 @@
+# Copyright 2023 Marimo. All rights reserved.
+import os
+import pathlib
+
+# use spaces instead of a tab to play well with carriage returns;
+# \r\t doesn't appear to overwrite characters at the start of a line,
+# but \r{TAB} does ...
+TAB = " "
+
+
+def print_tabbed(string: str, n_tabs: int = 1) -> None:
+ print(f"{TAB * n_tabs}{string}")
+
+
+def canonicalize_filename(filename: str) -> str:
+ if pathlib.Path(filename).suffix != ".py":
+ filename += ".py"
+ return os.path.expanduser(filename)
diff --git a/marimo/_smoke_tests/errors.py b/marimo/_smoke_tests/errors.py
new file mode 100644
index 0000000000..c8950c5859
--- /dev/null
+++ b/marimo/_smoke_tests/errors.py
@@ -0,0 +1,52 @@
+# Copyright 2023 Marimo. All rights reserved.
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(y):
+ x = y
+ return x,
+
+
+def __(z):
+ y = z
+ return y,
+
+
+def __(x):
+ z = x
+ c = 0
+ return c, z
+
+
+def __(b):
+ a = 0
+ del b
+ c = 0
+ return a, c
+
+
+app._unparsable_cell(
+ r"""
+ a =
+ """,
+ name="__"
+)
+
+
+def __():
+ a = 1
+ b = 0
+ c = 0
+ return a, b, c
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_smoke_tests/layout.py b/marimo/_smoke_tests/layout.py
new file mode 100644
index 0000000000..6f3ed3f25e
--- /dev/null
+++ b/marimo/_smoke_tests/layout.py
@@ -0,0 +1,79 @@
+# Copyright 2023 Marimo. All rights reserved.
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ align = mo.ui.dropdown(
+ label="Align", options=["start", "end", "center", "stretch"]
+ )
+ justify = mo.ui.dropdown(
+ label="Justify",
+ options=["start", "center", "end", "space-between", "space-around"],
+ )
+ gap = mo.ui.number(label="Gap", start=0, stop=100, value=1)
+ size = mo.ui.slider(label="Size", start=60, stop=500)
+ wrap = mo.ui.checkbox(label="Wrap")
+
+ mo.hstack([align, justify, gap, size, wrap], gap=0.25)
+ return align, gap, justify, size, wrap
+
+
+def __(mo):
+ mo.md("# Horizontal Stack: `hstack`")
+ return
+
+
+def __(align, boxes, gap, justify, mo, wrap):
+ mo.hstack(
+ boxes,
+ align=align.value,
+ justify=justify.value,
+ gap=gap.value,
+ wrap=wrap.value,
+ )
+ return
+
+
+def __(mo):
+ mo.md("# Vertical Stack: `vstack`")
+ return
+
+
+def __(align, boxes, gap, mo):
+ mo.vstack(
+ boxes,
+ align=align.value,
+ gap=gap.value,
+ )
+ return
+
+
+def __(mo, size):
+ def create_box(num):
+ box_size = size.value + num * 10
+ return mo.Html(
+ f"<div style='min-width: {box_size}px; min-height: {box_size}px; background-color: orange; text-align: center; line-height: {box_size}px'>{str(num)}</div>"
+ )
+
+
+ boxes = [create_box(i) for i in range(1, 5)]
+ return boxes, create_box
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_smoke_tests/raise_error_on_output.py b/marimo/_smoke_tests/raise_error_on_output.py
new file mode 100644
index 0000000000..82fdf2ae8c
--- /dev/null
+++ b/marimo/_smoke_tests/raise_error_on_output.py
@@ -0,0 +1,29 @@
+# Copyright 2023 Marimo. All rights reserved.
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __():
+ class Mischief:
+ def _mime_(self):
+ raise ValueError("error!")
+ return Mischief,
+
+
+def __(Mischief):
+ mischief = Mischief()
+ return mischief,
+
+
+def __(mischief):
+ mischief
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_smoke_tests/scale.py b/marimo/_smoke_tests/scale.py
new file mode 100644
index 0000000000..e5bfebed4a
--- /dev/null
+++ b/marimo/_smoke_tests/scale.py
@@ -0,0 +1,178 @@
+# Copyright 2023 Marimo. All rights reserved.
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md("# Scale")
+ return
+
+
+def __(mo):
+ s = mo.ui.slider(1, 10)
+ s
+ return s,
+
+
+def __(mo, s):
+ sliders_as_md = mo.md(f"""{s} {s} {s} {s} {s} {s} {s} {s} {s} {s} {s} {s} {s} {s} {s} {s} {s} {s} {s} {s} {s} {s} {s} {s} {s} {s} {s} {s} """)
+
+ sliders_as_tree = (s,) * 10 + (mo.ui.slider(1, 10),) + (s,) * 10
+
+
+ sliders_as_nested_tree = mo.as_html(
+ [
+ mo.as_html([s, s.value]),
+ mo.as_html([s, s.value]),
+ mo.as_html(
+ [
+ mo.as_html([s, s.value]),
+ mo.as_html([s, s.value]),
+ mo.as_html(
+ [
+ mo.as_html([s, s.value]),
+ mo.as_html([s, s.value]),
+ ]
+ ),
+ ]
+ ),
+ ]
+ )
+
+ mo.tabs({
+ "As MD": sliders_as_md,
+ "As Flat Tree": sliders_as_tree,
+ "As Nested Tree": sliders_as_nested_tree,
+ })
+ return sliders_as_md, sliders_as_nested_tree, sliders_as_tree
+
+
+def __(mo):
+ b = mo.ui.button()
+
+ button_as_md = mo.md(
+ f"""{b} {b} {b} {b} {b} {b} {b} {b} {b} {b} {b} {b} {b} {b} {b} {b} {b}"""
+ )
+
+ button_as_tree = (b,) * 10
+
+ mo.tabs(
+ {
+ "As MD": button_as_md,
+ "As Tree": button_as_tree,
+ }
+ )
+ return b, button_as_md, button_as_tree
+
+
+def __(s):
+ [s, s.value]
+ return
+
+
+def __(mo):
+ t = mo.ui.text()
+
+ distinct = mo.ui.array(
+ [
+ mo.ui.text(),
+ mo.ui.text(),
+ mo.ui.array(
+ [
+ mo.ui.text(),
+ mo.ui.text(),
+ mo.ui.array(
+ [
+ mo.ui.text(),
+ mo.ui.text(),
+ mo.ui.array([mo.ui.text(), mo.ui.text()]),
+ ]
+ ),
+ ]
+ ),
+ ]
+ )
+
+ same = mo.ui.array(
+ [
+ t,
+ t,
+ mo.ui.array(
+ [
+ t,
+ t,
+ mo.ui.array(
+ [
+ t,
+ t,
+ mo.ui.array([t, t]),
+ ]
+ ),
+ ]
+ ),
+ ]
+ )
+
+ mo.hstack([same, distinct])
+ return distinct, same, t
+
+
+def __():
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ---
+
+ # h1 Heading
+ ## h2 Heading
+ ### h3 Heading
+ #### h4 Heading
+ ##### h5 Heading
+ ###### h6 Heading
+
+
+ ## Emphasis
+
+ **This is bold text**
+
+ __This is bold text__
+
+ *This is italic text*
+
+ _This is italic text_
+
+ ~~Strikethrough~~
+
+
+ ## Blockquotes
+
+
+ > Blockquotes can also be nested...
+ >> ...by using additional greater-than signs right next to each other...
+ > > > ...or with spaces between arrows.
+ """
+ )
+ return
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_smoke_tests/scripting.py b/marimo/_smoke_tests/scripting.py
new file mode 100644
index 0000000000..dbb5e84eec
--- /dev/null
+++ b/marimo/_smoke_tests/scripting.py
@@ -0,0 +1,27 @@
+# Copyright 2023 Marimo. All rights reserved.
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+def __(mo):
+ mo.md("hello")
+ return
+
+
+def __(mo):
+ mo.html("<script>console.log(document.querySelectorAll('p')[0].textContent)</script>")
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_smoke_tests/third_party/altair.py b/marimo/_smoke_tests/third_party/altair.py
new file mode 100644
index 0000000000..fe490b5e36
--- /dev/null
+++ b/marimo/_smoke_tests/third_party/altair.py
@@ -0,0 +1,86 @@
+# Copyright 2023 Marimo. All rights reserved.
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(data):
+ cars = data.cars()
+ stocks = data.stocks.url
+ source = data.windvectors()
+ return cars, source, stocks
+
+
+def __(alt, source):
+ alt.Chart(source).mark_point(shape="wedge", filled=True).encode(
+ latitude="latitude",
+ longitude="longitude",
+ color=alt.Color(
+ "dir",
+ scale=alt.Scale(domain=[0, 360], scheme="rainbow"),
+ legend=None,
+ ),
+ angle=alt.Angle(
+ "dir", scale=alt.Scale(domain=[0, 360], range=[180, 540])
+ ),
+ size=alt.Size("speed", scale=alt.Scale(rangeMax=500)),
+ ).project("equalEarth")
+ return
+
+
+def __(alt, cars, mo):
+ cars_scatter_plot = (
+ alt.Chart(cars)
+ .mark_circle(size=60)
+ .encode(
+ x="Horsepower",
+ y="Miles_per_Gallon",
+ color="Origin",
+ tooltip=["Name", "Origin", "Horsepower", "Miles_per_Gallon"],
+ )
+ .interactive()
+ )
+
+ mo.md(
+ f"""# hello, world
+
+ {mo.as_html(cars_scatter_plot)}
+
+ that was an altair plot
+ """
+ )
+ return cars_scatter_plot,
+
+
+def __(alt, datum, stocks):
+ base = (
+ alt.Chart(stocks)
+ .encode(x="date:T", y="price:Q", color="symbol:N")
+ .transform_filter(datum.symbol == "GOOG")
+ )
+
+ (base.mark_line() + base.mark_point())
+ return base,
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+def __():
+ import altair as alt
+ from altair.expr import datum
+ from vega_datasets import data
+ return alt, data, datum
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_smoke_tests/third_party/pandas.py b/marimo/_smoke_tests/third_party/pandas.py
new file mode 100644
index 0000000000..f10b19ea52
--- /dev/null
+++ b/marimo/_smoke_tests/third_party/pandas.py
@@ -0,0 +1,31 @@
+# Copyright 2023 Marimo. All rights reserved.
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __(np):
+ import pandas as pd
+
+ df = pd.DataFrame([np.random.randn(20)]*10, columns=np.arange(20))
+ df
+ return df, pd
+
+
+def __(df):
+ # Series
+ df[0]
+ return
+
+
+def __():
+ import numpy as np
+ return np,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_smoke_tests/third_party/plotly.py b/marimo/_smoke_tests/third_party/plotly.py
new file mode 100644
index 0000000000..c268683d7f
--- /dev/null
+++ b/marimo/_smoke_tests/third_party/plotly.py
@@ -0,0 +1,72 @@
+# Copyright 2023 Marimo. All rights reserved.
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __():
+ import plotly.express as px
+
+ px.scatter(x=[0, 1, 2, 3, 4], y=[0, 1, 4, 9, 16])
+ return (px,)
+
+
+def __():
+ import pandas as pd
+ import plotly.graph_objects as go
+
+ df = pd.DataFrame(
+ {
+ "Fruit": [
+ "Apples",
+ "Oranges",
+ "Bananas",
+ "Apples",
+ "Oranges",
+ "Bananas",
+ ],
+ "Contestant": [
+ "Alex",
+ "Alex",
+ "Alex",
+ "Jordan",
+ "Jordan",
+ "Jordan",
+ ],
+ "Number Eaten": [2, 1, 3, 1, 3, 2],
+ }
+ )
+
+ fig = go.Figure()
+ for contestant, group in df.groupby("Contestant"):
+ fig.add_trace(
+ go.Bar(
+ x=group["Fruit"],
+ y=group["Number Eaten"],
+ name=contestant,
+ hovertemplate=(
+ "Contestant=%s<br>Fruit=%%{x}<br>"
+ "Number Eaten=%%{y}<extra></extra>"
+ )
+ % contestant,
+ )
+ )
+ fig.update_layout(legend_title_text="Contestant")
+ fig.update_xaxes(title_text="Fruit")
+ fig.update_yaxes(title_text="Number Eaten")
+
+ fig
+ return contestant, df, fig, go, group, pd
+
+
+def __(fig):
+ fig
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_smoke_tests/third_party/seaborn.py b/marimo/_smoke_tests/third_party/seaborn.py
new file mode 100644
index 0000000000..20d0f681a4
--- /dev/null
+++ b/marimo/_smoke_tests/third_party/seaborn.py
@@ -0,0 +1,49 @@
+# Copyright 2023 Marimo. All rights reserved.
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def __():
+ import seaborn as sns
+
+ penguins = sns.load_dataset("penguins")
+ tips = sns.load_dataset("tips")
+ return penguins, sns, tips
+
+
+def __(penguins, sns):
+ sns.jointplot(
+ data=penguins,
+ x="flipper_length_mm",
+ y="bill_length_mm",
+ hue="species",
+ )
+ return
+
+
+def __(penguins, sns):
+ sns.pairplot(data=penguins, hue="species")
+ return
+
+
+def __(sns, tips):
+ sns.relplot(
+ data=tips,
+ x="total_bill",
+ y="tip",
+ col="time",
+ hue="smoker",
+ style="smoker",
+ size="size",
+ )
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_test_utils/codegen_data/test_generate_filecontents.py b/marimo/_test_utils/codegen_data/test_generate_filecontents.py
new file mode 100644
index 0000000000..ab9ff4a08b
--- /dev/null
+++ b/marimo/_test_utils/codegen_data/test_generate_filecontents.py
@@ -0,0 +1,40 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def one():
+ import numpy as np
+ return np,
+
+
+def two():
+ x = 0
+ xx = 1
+ return x, xx
+
+
+def three(x):
+ y = x + 1
+ return y,
+
+
+def four(np, x, y):
+ # comment
+ z = np.array(x + y)
+ return z,
+
+
+def five():
+ # just a comment
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_test_utils/codegen_data/test_generate_filecontents_shadowed_builtin.py b/marimo/_test_utils/codegen_data/test_generate_filecontents_shadowed_builtin.py
new file mode 100644
index 0000000000..c695f781fd
--- /dev/null
+++ b/marimo/_test_utils/codegen_data/test_generate_filecontents_shadowed_builtin.py
@@ -0,0 +1,20 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def one():
+ type = 1
+ return type,
+
+
+def two(type):
+ type
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_test_utils/codegen_data/test_generate_filecontents_single_cell.py b/marimo/_test_utils/codegen_data/test_generate_filecontents_single_cell.py
new file mode 100644
index 0000000000..ab2ef8bf45
--- /dev/null
+++ b/marimo/_test_utils/codegen_data/test_generate_filecontents_single_cell.py
@@ -0,0 +1,14 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def one():
+ import numpy as np
+ return np,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_test_utils/codegen_data/test_generate_filecontents_unshadowed_builtin.py b/marimo/_test_utils/codegen_data/test_generate_filecontents_unshadowed_builtin.py
new file mode 100644
index 0000000000..72986d475c
--- /dev/null
+++ b/marimo/_test_utils/codegen_data/test_generate_filecontents_unshadowed_builtin.py
@@ -0,0 +1,14 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def one():
+ type
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_test_utils/codegen_data/test_generate_filecontents_with_syntax_error.py b/marimo/_test_utils/codegen_data/test_generate_filecontents_with_syntax_error.py
new file mode 100644
index 0000000000..aff6f1104c
--- /dev/null
+++ b/marimo/_test_utils/codegen_data/test_generate_filecontents_with_syntax_error.py
@@ -0,0 +1,39 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def one():
+ import numpy as np
+ return np,
+
+
+app._unparsable_cell(
+ r"""
+ _ error
+ """,
+ name="two"
+)
+
+
+def __():
+ 'all good'
+ return
+
+
+app._unparsable_cell(
+ r"""
+ _ another_error
+ _ and \"\"\"another\"\"\"
+
+ \t
+ """,
+ name="__"
+)
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_test_utils/codegen_data/test_get_codes_comment_after_sig.py b/marimo/_test_utils/codegen_data/test_get_codes_comment_after_sig.py
new file mode 100644
index 0000000000..afa65bd40c
--- /dev/null
+++ b/marimo/_test_utils/codegen_data/test_get_codes_comment_after_sig.py
@@ -0,0 +1,14 @@
+import marimo
+
+__generated_with = '0.1.0'
+app = marimo.App()
+
+
+def one(): # comment
+ print("hi")
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_test_utils/codegen_data/test_get_codes_empty.py b/marimo/_test_utils/codegen_data/test_get_codes_empty.py
new file mode 100644
index 0000000000..e38dad51d4
--- /dev/null
+++ b/marimo/_test_utils/codegen_data/test_get_codes_empty.py
@@ -0,0 +1,17 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def one(): return
+
+
+def two():
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_test_utils/codegen_data/test_get_codes_messy.py b/marimo/_test_utils/codegen_data/test_get_codes_messy.py
new file mode 100644
index 0000000000..e4b5a170ef
--- /dev/null
+++ b/marimo/_test_utils/codegen_data/test_get_codes_messy.py
@@ -0,0 +1,21 @@
+import marimo
+
+__generated_with = '0.1.0'
+app = marimo.App()
+
+
+def __(a,
+ b, # hello,
+ c, # again
+ d,) -> int:
+ # comment
+ # another comment
+
+ # yet another comment
+ x = 0 + a + b + c + d
+ return x,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_test_utils/codegen_data/test_get_codes_multiline_fndef.py b/marimo/_test_utils/codegen_data/test_get_codes_multiline_fndef.py
new file mode 100644
index 0000000000..5cca0678c9
--- /dev/null
+++ b/marimo/_test_utils/codegen_data/test_get_codes_multiline_fndef.py
@@ -0,0 +1,16 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def one(a,
+ b, c,d) -> int:
+ # comment
+ x = 0 + a + b + c + d
+ return x,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_test_utils/codegen_data/test_get_codes_multiline_string.py b/marimo/_test_utils/codegen_data/test_get_codes_multiline_string.py
new file mode 100644
index 0000000000..b0aae4fea3
--- /dev/null
+++ b/marimo/_test_utils/codegen_data/test_get_codes_multiline_string.py
@@ -0,0 +1,13 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def one(): c = """
+ a, b"""; return c,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_test_utils/codegen_data/test_get_codes_single_line_fn.py b/marimo/_test_utils/codegen_data/test_get_codes_single_line_fn.py
new file mode 100644
index 0000000000..3b88fe13b1
--- /dev/null
+++ b/marimo/_test_utils/codegen_data/test_get_codes_single_line_fn.py
@@ -0,0 +1,12 @@
+import marimo
+
+__generated_with = '0.1.0'
+app = marimo.App()
+
+
+def one(a: int, b: int) -> None: c = a + b; print(c); return c,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_test_utils/codegen_data/test_get_codes_with_name_error.py b/marimo/_test_utils/codegen_data/test_get_codes_with_name_error.py
new file mode 100644
index 0000000000..1f0dd6d06a
--- /dev/null
+++ b/marimo/_test_utils/codegen_data/test_get_codes_with_name_error.py
@@ -0,0 +1,14 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def one(mo):
+ mo
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_test_utils/codegen_data/test_long_line_in_main.py b/marimo/_test_utils/codegen_data/test_long_line_in_main.py
new file mode 100644
index 0000000000..89d36247a4
--- /dev/null
+++ b/marimo/_test_utils/codegen_data/test_long_line_in_main.py
@@ -0,0 +1,30 @@
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def one():
+ i_am_a_very_long_name = 0
+ i_am_another_very_long_name = 0
+ yet_another_very_long_name = 0
+ return (
+ i_am_a_very_long_name,
+ i_am_another_very_long_name,
+ yet_another_very_long_name,
+ )
+
+
+def two(
+ i_am_a_very_long_name,
+ i_am_another_very_long_name,
+ yet_another_very_long_name,
+):
+ z = i_am_a_very_long_name + i_am_another_very_long_name + yet_another_very_long_name
+ return z,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_test_utils/codegen_data/test_main.py b/marimo/_test_utils/codegen_data/test_main.py
new file mode 100644
index 0000000000..ddf3b5835c
--- /dev/null
+++ b/marimo/_test_utils/codegen_data/test_main.py
@@ -0,0 +1,30 @@
+from typing import Any, Tuple
+
+import marimo
+
+__generated_with = "0.1.0"
+app = marimo.App()
+
+
+def one() -> Tuple[Any]:
+ x = 0
+ return x,
+
+
+def two(x: Any) -> Tuple[Any, Any]:
+ y = x + 1
+ z = y + 1
+ 'z'
+ return y, z
+
+
+def three(x: Any, y: Any) -> Tuple[Any]:
+ a = x + y
+ return a,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_test_utils/ipynb_data/arithmetic.ipynb.txt b/marimo/_test_utils/ipynb_data/arithmetic.ipynb.txt
new file mode 100644
index 0000000000..9e3df1bb6b
--- /dev/null
+++ b/marimo/_test_utils/ipynb_data/arithmetic.ipynb.txt
@@ -0,0 +1,68 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "3b960244",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "0"
+ ]
+ },
+ "execution_count": 1,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "x = 0\n",
+ "x"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "85391259",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "1"
+ ]
+ },
+ "execution_count": 2,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "x + 1"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.10.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/marimo/_test_utils/ipynb_data/blank.ipynb.txt b/marimo/_test_utils/ipynb_data/blank.ipynb.txt
new file mode 100644
index 0000000000..10110143cf
--- /dev/null
+++ b/marimo/_test_utils/ipynb_data/blank.ipynb.txt
@@ -0,0 +1,33 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "f1cc6017",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.10.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/marimo/_test_utils/ipynb_data/markdown.ipynb.txt b/marimo/_test_utils/ipynb_data/markdown.ipynb.txt
new file mode 100644
index 0000000000..92b228ae67
--- /dev/null
+++ b/marimo/_test_utils/ipynb_data/markdown.ipynb.txt
@@ -0,0 +1,48 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "364bd4a5",
+ "metadata": {},
+ "source": [
+ "# Hello, markdown\n",
+ "\n",
+ "\"\"\"\n",
+ "'hello\"\n",
+ "'''\n",
+ "\"\"\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5691372e",
+ "metadata": {},
+ "source": [
+ "Here is some math\n",
+ "\n",
+ "$x = 0$"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.10.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/marimo/_test_utils/ipynb_data/unparsable.ipynb.txt b/marimo/_test_utils/ipynb_data/unparsable.ipynb.txt
new file mode 100644
index 0000000000..cc50b4a5d2
--- /dev/null
+++ b/marimo/_test_utils/ipynb_data/unparsable.ipynb.txt
@@ -0,0 +1,55 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "d26f05aa",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "hello, world\r\n"
+ ]
+ }
+ ],
+ "source": [
+ "!echo hello, world\n",
+ "\n",
+ "x = 0"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "0a787632",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "x"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.10.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/marimo/_tutorials/README.md b/marimo/_tutorials/README.md
new file mode 100644
index 0000000000..3405eff9b4
--- /dev/null
+++ b/marimo/_tutorials/README.md
@@ -0,0 +1,5 @@
+# Tutorial
+
+This folder contains tutorials to help you get started with marimo.
+
+Open them with `marimo tutorial` at the command line.
diff --git a/marimo/_tutorials/__init__.py b/marimo/_tutorials/__init__.py
new file mode 100644
index 0000000000..618f22fc54
--- /dev/null
+++ b/marimo/_tutorials/__init__.py
@@ -0,0 +1 @@
+# Copyright 2023 Marimo. All rights reserved.
diff --git a/marimo/_tutorials/dataflow.py b/marimo/_tutorials/dataflow.py
new file mode 100644
index 0000000000..73ed9ed581
--- /dev/null
+++ b/marimo/_tutorials/dataflow.py
@@ -0,0 +1,633 @@
+# Copyright 2023 Marimo. All rights reserved.
+import marimo
+
+__generated_with = "0.0.5"
+app = marimo.App()
+
+
+def __(introduction, mo):
+ mo.md(introduction)
+ return
+
+
+def __(mo, references_and_definitions):
+ mo.md(references_and_definitions)
+ return
+
+
+def __(example, mo):
+ mo.md(example)
+ return
+
+
+def __(mo):
+ mo.accordion(
+ {
+ "Tip: inspecting refs and defs": f"""
+ Use `mo.refs()` and `mo.defs()` to inspect the refs and defs of any
+ given cell. This can help with debugging complex notebooks.
+
+ For example, here are the refs and defs of this cell:
+
+ {mo.as_html({"refs": mo.refs(), "defs": mo.defs()})}
+ """
+ }
+ )
+ return
+
+
+def __(amplitude, mo, period, plot_wave):
+ mo.md(
+ f"""
+ {mo.as_html(plot_wave(amplitude, period))}
+
+ - `refs: {mo.refs()}`
+ - `defs: {mo.defs()}`
+ """
+ )
+ return
+
+
+def __(mo):
+ period = 2 * 3.14159
+
+ mo.md(
+ f"""
+ - `refs: {mo.refs()}`
+ - `defs: {mo.defs()}`
+ """
+ )
+ return period,
+
+
+def __(mo):
+ amplitude = 1
+
+ mo.md(
+ f"""
+ - `refs: {mo.refs()}`
+ - `defs: {mo.defs()}`
+ """
+ )
+ return amplitude,
+
+
+def __(matplotlib_installed, mo, np, numpy_installed, plt):
+ def plot_wave(amplitude, period):
+ if not numpy_installed:
+ return mo.md(
+ "> `Oops! It looks like you don't have `numpy` installed.`"
+ )
+ if not matplotlib_installed:
+ return mo.md(
+ "> `Oops! It looks like you dont' have `matplotlib` installed."
+ )
+ x = np.linspace(0, 2 * np.pi, 256)
+ plt.plot(x, amplitude * np.sin(2 * np.pi / period * x))
+ plt.xlim(0, 2 * np.pi)
+ plt.ylim(-2, 2)
+ plt.xticks(
+ [0, np.pi / 2, np.pi, 3 * np.pi / 2, 2 * np.pi],
+ [0, "$\pi/2$", "$\pi$", "$3\pi/2$", "$2\pi$"],
+ )
+ plt.yticks([-2, -1, 0, 1, 2])
+ plt.gcf().set_size_inches(6.5, 2.4)
+ return plt.gca()
+
+
+ mo.md(
+ f"""
+ - `refs: {mo.refs()}`
+ - `defs: {mo.defs()}`
+ """
+ )
+ return plot_wave,
+
+
+def __(mo):
+ mo.md(
+ """
+ 🌊 **Try it!** In the above cells, try changing the value `period` or
+ `ampltitude`, then click the run button ( ▷ ) to register your changes.
+ See what happens to the sine wave.
+ """
+ )
+ return
+
+
+def __(dataflow_graph, mo):
+ mo.md(dataflow_graph)
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ## Dataflow programming
+
+ marimo's runtime rule has some important consequences that may seem
+ surprising if you are not used to dataflow programming. We list these
+ below.
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ### Execution order is not cell order
+
+ The order in which cells are executed is determined entirely by the
+ dataflow graph. This makes marimo notebooks more reproducible than
+ traditional notebooks. It also lets you place boilerplate, like
+ imports or long markdown strings, at the bottom of the editor.
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ### Global variable names must be unique
+
+ Every global variable can be defined by only one cell. Without this
+ constraint, there would be no way for marimo to know which order to
+ execute cells in.
+
+ If you violate this constraint, marimo provides a helpful
+ error message, like below:
+ """
+ )
+ return
+
+
+def __():
+ planet = "Mars"
+ planet
+ return planet,
+
+
+def __():
+ planet = "Earth"
+ planet
+ return planet,
+
+
+def __(mo):
+ mo.md(
+ """
+ ** 🌊 Try it!** In the previous cell, change the name `planet` to `home`,
+ then run the cell.
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ Because defs must be unique, global variables cannot be modified with
+ operators like `+=` or `-=` in cells other than the one that created
+ them; these operators count as redefinitions of a name.
+
+ **🌊 Try it!** Get rid of the following errors by merging the next two
+ cells into a single cell.
+ """
+ )
+ return
+
+
+def __():
+ count = 0
+ return count,
+
+
+def __():
+ count += 1
+ return count,
+
+
+def __(mo):
+ mo.md(
+ """
+ ### Underscore-prefixed variables are local to cells
+
+ Global variables prefixed with an underscore are "private" to the cells
+ that define them. This means that multiple cells can define the same
+ underscore-prefixed name, and one cell's private variables won't be
+ made available to other cells.
+
+ **Example**.
+ """
+ )
+ return
+
+
+def __():
+ _private_variable, _ = 1, 2
+ _private_variable, _
+ return
+
+
+def __():
+ _private_variable, _ = 3, 4
+ _private_variable, _
+ return
+
+
+def __():
+ # `_private_variable` and `_` are not defined in this cell
+ _private_variable, _
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ### Deleting a cell deletes its variables
+
+ Deleting a cell deletes its global variables and
+ then runs all cells that reference them. This prevents severe bugs that
+ can arise when state has been deleted from the editor but not from the
+ program memory.
+ """
+ )
+ return
+
+
+def __(mo):
+ to_be_deleted = "variable still exists"
+
+ mo.md(
+ """
+ 🌊 **Try it!**
+
+ Delete this cell by clicking the trash bin icon.
+ """
+ )
+ return to_be_deleted,
+
+
+def __(to_be_deleted):
+ to_be_deleted
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ### Cycles are not allowed
+
+ Cycles among cells are not allowed. For example:
+ """
+ )
+ return
+
+
+def __(two):
+ one = two - 1
+ return one,
+
+
+def __(one):
+ two = one + 1
+ return two,
+
+
+def __(mo):
+ mo.md(
+ """
+ ### marimo doesn't track attributes
+
+ marimo only tracks global variables. Writing object attributes does not
+ trigger reactive execution.
+
+ **🌊 Example**. Change the value of `state.number` in the next cell, then
+ run the cell. Notice how the subsequent cell isn't updated.
+ """
+ )
+ return
+
+
+def __(state):
+ state.number = 1
+ return
+
+
+def __(state):
+ state.number
+ return
+
+
+def __():
+ class namespace:
+ pass
+
+ state = namespace()
+ state.number = 0
+ return namespace, state
+
+
+def __(mo):
+ mo.accordion(
+ {
+ "Why not track attributes?": """
+ marimo can't reliably trace attributes
+ to cells that define them. For example, attributes are routinely
+ created or modified by library code.
+ """
+ }
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ### marimo doesn't track mutations
+
+ In Python, it's impossible to know whether code will
+ mutate an object without running it. So: mutations (such as
+ appending to a list) will not trigger reactive execution.
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.accordion({
+ "Tip (advanced): mutable state": (
+ """
+ You can use the fact that marimo does not track attributes or
+ mutations to implement mutable state in marimo. An example of
+ this is shown in the `ui` tutorial.
+ """
+ )
+ })
+ return
+
+
+def __(best_practices, mo):
+ mo.md(best_practices)
+ return
+
+
+def __(mo, tips):
+ mo.accordion(tips)
+ return
+
+
+def __(mo):
+ mo.md(
+ """## What's next?
+
+ Check out the tutorial on interactivity for a tour of UI elements:
+
+ ```
+ marimo tutorial ui
+ ```
+ """
+ )
+ return
+
+
+def __():
+ matplotlib_installed = False
+ numpy_installed = False
+
+ try:
+ import matplotlib.pyplot as plt
+ matplotlib_installed = True
+ except ModuleNotFoundError:
+ pass
+
+ try:
+ import numpy as np
+ numpy_installed = True
+ except ModuleNotFoundError:
+ pass
+ return matplotlib_installed, np, numpy_installed, plt
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+def __():
+ introduction = """
+ # How marimo Apps Run
+
+ Reactive execution is based on a single rule: when a cell is run, all other cells that reference any of the global variables it defines run
+ automatically.
+
+ To provide reactive execution, marimo creates a dataflow graph out of your cells.
+ """
+
+ references_and_definitions = """
+ ## References and definitions
+
+ A marimo notebook is a directed acyclic graph in which nodes represent cells and edges represent data dependencies. marimo creates this graph by analyzing each cell (without running it) to determine its
+
+ - references ("refs*), the global variables it reads but doesn't define;
+ - definitions ("defs"), the global variables it defines.
+
+ There is an edge from one cell to another if the latter cell references any global variables defined by the former cell.
+
+ The rule for reactive execution can be restated in terms of the graph: when
+ a cell is run, its descendants are run automatically.
+ """
+
+ example = """
+ ### Example
+
+ The next four cells plot a sine wave with a given period and amplitude.
+ Each cell is labeled with its refs and defs.
+ """
+
+ dataflow_graph = """
+ Here is the dataflow graph for the cells that make the sine wave plot,
+ plus the cells that import libraries. Each cell is labeled with its defs.
+
+ ```
+ +------+ +-----------+
+ +-----------| {mo} |-----------+ | {np, plt} |
+ | +---+--+ | +----+------+
+ | | | |
+ | | | |
+ v v v v
+ +----------+ +-------------+ +--+----------+
+ | {period} | | {amplitude} | | {plot_wave} |
+ +---+------+ +-----+-------+ +------+------+
+ | | |
+ | v |
+ | +----+ |
+ +------------> | {} | <-------------+
+ +----+
+ ```
+
+ The last cell, which doesn't define anything, produces the plot.
+ """
+
+ best_practices = """
+ ## Best practices
+
+ The constraints marimo puts on your notebooks are all natural consequences of the fact that marimo programs are directed acyclic graphs. As long as you keep this fact in mind, you'll quickly adapt to the marimo way of writing notebooks.
+
+ Ultimately, these constraints will enable you to create powerful notebooks and apps, and they'll encourage you to write clean, reproducible code.
+
+ Follow these tips to stay on the marimo way:
+ """
+ return (
+ best_practices,
+ dataflow_graph,
+ example,
+ introduction,
+ references_and_definitions,
+ )
+
+
+def __():
+ tips = {
+ "Use global variables sparingly": (
+ """
+ Keep the number of global variables in your program small to avoid
+ name collisions across cells. Keep the number of global variables
+ defined by any one cell small to make sure that the units of
+ reactive execution are small.
+ """
+ ),
+ "Use descriptive names": (
+ """
+ Use descriptive variable names, especially for global variables.
+ This will help you minimize name clashes, and will also result in
+ better code.
+ """
+ ),
+ "Use functions": (
+ """
+ Encapsulate logic into functions to avoid polluting the global
+ namespace with temporary or intermediate variables.
+ """
+ ),
+ "Minimize mutations": (
+ """
+ We saw earlier that marimo cannot track object mutations. So try
+ to only mutate an object in the cell that creates it, or create
+ new objects instead of mutating existing ones.
+
+ For example, don't do this:
+
+ ```python3
+ # a cell
+ numbers = [1, 2, 3]
+ ```
+
+ ```python3
+ # another cell
+ numbers.append(4)
+ ```
+
+ Instead, prefer
+
+ ```python3
+ # a cell
+ numbers = [1, 2, 3]
+ numbers.append(4)
+ ```
+
+ or
+
+ ```python3
+ # a cell
+ numbers = [1, 2, 3]
+ ```
+
+ ```python3
+ # another cell
+ more_numbers = numbers + [4]
+ ```
+ """
+ ),
+ "Write idempotent cells": (
+ """
+ Write cells whose outputs and behavior are the same when given
+ the same inputs (refs); such cells are called _idempotent_. This will
+ help you avoid bugs, and let you cache expensive intermediate
+ computations (see the next tip).
+ """
+ ),
+ "Cache intermediate computations with `@functools.cache`": (
+ """
+ Use Python's builtin `functools` library to cache expensive
+ intermediate computations. You can do this if you abstract complex
+ logic into idempotent functions, following earlier tips.
+
+ For example:
+
+ ```python3
+ import functools
+
+ @functools.cache
+ def compute_prediction(problem_parameters):
+ ...
+ ```
+
+ Whenever `compute_predictions` is called with a value of
+ `problem_parameters` it has not seen, it will compute the predictions
+ and store them in a cache. The next time it is called with the same
+ parameters, instead of recomputing the predictions, it will just
+ fetch the previously computed ones from the cache.
+ """
+ ),
+ }
+ return tips,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_tutorials/fileformat.py b/marimo/_tutorials/fileformat.py
new file mode 100644
index 0000000000..c8b0a8ee2e
--- /dev/null
+++ b/marimo/_tutorials/fileformat.py
@@ -0,0 +1,259 @@
+# Copyright 2023 Marimo. All rights reserved.
+import marimo
+
+__generated_with = "0.0.5"
+app = marimo.App()
+
+
+def __(intro, mo):
+ mo.md(intro)
+ return
+
+
+def __(mo):
+ mo.accordion(
+ {
+ "Tip: hide this tutorial's code": (
+ """
+ Click the app window icon in the bottom-left to hide this app's code,
+ or use the "fold code" shortcut to fold all code cells.
+ """
+ )
+ }
+ )
+ return
+
+
+def __(example_program, mo):
+ mo.md(example_program)
+ return
+
+
+def __(file_contents, mo):
+ mo.md(file_contents)
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ## Properties
+
+ marimo's file format was designed to be easy to read and easy
+ to work with, while also serving the needs of the marimo library. You can
+ even edit the generated file's cells directly, using your favorite text
+ editor, and format the file with your favorite code formatter.
+
+ We explain some properties of marimo's file format below.
+ """
+ )
+ return
+
+
+def __(mo, properties):
+ mo.accordion(properties)
+ return
+
+
+def __():
+ intro = """
+ # File Format
+
+ marimo apps are stored as pure Python files.
+
+ These files are:
+
+ - easily versioned with git, producing small diffs
+ - legible for both humans and machines
+ - formattable using your tool of choice
+ - usable as Python scripts, with UI elements taking their default values
+ """
+ return intro,
+
+
+def __(mo):
+ file_contents = f"""
+ For the above example, marimo would generate the following file
+ contents:
+
+ ```python3
+ import marimo
+
+ __generated_with = "{mo.__version__}"
+ app = marimo.App()
+
+ @app.cell
+ def __(text):
+ print(text.value)
+ return
+
+ @app.cell
+ def __(mo):
+ text = mo.ui.text(value="Hello, World!")
+ text
+ return text,
+
+ @app.cell
+ def __():
+ import marimo as mo
+ return mo,
+
+ if __name__ == "__main__":
+ app.run()
+ ```
+
+ As you can see, this is _pure Python_. This is part of the reason why
+ marimo's generated files are **git-friendly**: small changes made using
+ the marimo editor result in small changes to the file that marimo
+ generates.
+ """
+ return file_contents,
+
+
+def __():
+ example_program = """
+ ## Example
+
+ Consider a marimo notebook with the following three cells.
+
+ First cell:
+ ```python3
+ print(text.value)
+ ```
+
+ Second cell:
+ ```python3
+ text = mo.ui.text(value="Hello, World!")
+ text
+ ```
+
+ Third cell:
+ ```python3
+ import marimo as mo
+ ```
+ """
+ return example_program,
+
+
+def __():
+ properties = {
+ "Cells are functions": """
+ In the `dataflow` tutorial, we saw that cells are like functions mapping
+ their refs (the global variables they uses but don't define) to their
+ defs (the global variables they define). The generated code makes this
+ analogy explicit.
+
+ In the generated code, there is a function for each cell. The arguments
+ of the function are the cell's refs , and its returned variables are
+ its defs.
+
+ For example, the code
+
+ ```python3
+ @app.cell
+ def __(mo):
+ text = mo.ui.text(value="Hello, World!")
+ text
+ return text,
+ ```
+
+ says that the cell takes as input a variable called `mo`, and it creates
+ a global variable called `text`.
+
+ In contrast, the code
+
+ ```python3
+ @app.cell
+ def __():
+ import marimo as mo
+ return mo,
+ ```
+
+ says that the cell doesn't depend on any other cells (its argument list
+ is empty), though it does create the variable `mo` which the previous
+ cell requires as input.
+ """,
+ "Cells are stored in presentation order": """
+ Cells are stored in the order that they are arranged in the marimo
+ editor. So if you want to rearrange
+ your cells using your favorite text editor, just rearrange the
+ order that they're defined in the file.
+ """,
+ "Text formatting is preserved": """
+ marimo guarantees that however your source code was
+ formatted in the marimo editor is exactly how it will be stored in
+ the generated code. For example, whitespace, line breaks, and so on are
+ all preserved exactly. This means that you can touch up formatting in
+ your text editor, either manually or using automated formatters like
+ Black, and be confident that your changes will be preserved.
+ """,
+ "Cell functions can have names": """
+ If you want to, you can replace the default names for cell functions
+ with meaningful ones.
+
+ For example, change
+
+ ```python3
+ @app.cell
+ def __(text):
+ print(text.value)
+ return
+ ```
+
+ to
+
+ ```python3
+ @app.cell
+ def echo(text):
+ print(text.value)
+ return
+ ```
+
+ This can make the generated code more readable.
+ """,
+ "No magical tokens": """
+ marimo's generated code is pure Python; no magical syntax.
+ """,
+ "Helpful error messages": """
+ If when editing a cell, you forget to include all a cell's refs in its
+ argument list, or all its defs in its returns, marimo will raise a
+ helpful error message the next time you try to open it in the marimo
+ editor. So don't worry that you'll botch a cell's signature when editing
+ it.
+ """,
+ "The `app` object": """
+ At the top of the generated code, a variable named `app` is created.
+ This object collects the cells into a dataflow graph, using the `cell`
+ decorator.
+ """,
+ "Runnable as a script": """
+ You can run marimo apps as scripts at the command line,
+ using Python. This will execute the cells in a
+ topologically sorted order, just as they would run if you opened the app
+ with `marimo edit`.
+
+ For example: running our example as a script would print `Hello
+ World!` to the console.
+ """,
+ }
+ return properties,
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_tutorials/intro.py b/marimo/_tutorials/intro.py
new file mode 100644
index 0000000000..7489dad21a
--- /dev/null
+++ b/marimo/_tutorials/intro.py
@@ -0,0 +1,454 @@
+# Copyright 2023 Marimo. All rights reserved.
+import marimo
+
+__generated_with = "0.0.6"
+app = marimo.App()
+
+
+def __():
+ import marimo as mo
+
+ mo.md("# Welcome to marimo! 🌊🍃")
+ return mo,
+
+
+def __(mo):
+ slider = mo.ui.slider(1, 22)
+ return slider,
+
+
+def __(mo, slider):
+ mo.md(
+ f"""
+ marimo is a Python library for creating reactive and interactive
+ notebooks and apps.
+
+ Unlike traditional notebooks, marimo notebooks **run
+ automatically** when you modify them or
+ interact with UI elements, like this slider: {slider}.
+
+ {"##" + "🍃" * slider.value}
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.accordion(
+ {
+ "A notebook or an app?": (
+ """
+ Because marimo notebooks react to changes and UI interactions,
+ they can also be thought of as apps: click
+ the app window icon to see an "app view" that
+ hides code.
+
+ Depending on how you use marimo, you can think
+ of marimo programs as notebooks, apps, or both.
+ """
+ )
+ }
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ## 1. Automatic execution
+
+ A marimo notebook is made up of small blocks of Python code called
+ cells.
+
+ marimo reads your cells and models the dependencies among them: whenever
+ a cell that defines a global variable is run, marimo
+ **automatically runs** all cells that reference that variable.
+ """
+ )
+ return
+
+
+def __(changed, mo):
+ (
+ mo.md(
+ f"""
+ **✨ Nice!** The value of `changed` is now {changed}.
+
+ When you updated the value of the variable `changed`, marimo
+ **reacted** by running this cell automatically, because this cell
+ references the global variable `changed`.
+
+ Reactivity ensures that your notebook state is always
+ consistent, which is crucial for doing good science; it's also what
+ enables marimo notebooks to double as tools and apps.
+ """
+ )
+ if changed
+ else mo.md(
+ """
+ **🌊 See it in action.** In the next cell, change the value of the
+ variable `changed` to `True`, then click the run button.
+ """
+ )
+ )
+ return
+
+
+def __():
+ changed = False
+ return changed,
+
+
+def __(mo):
+ mo.accordion(
+ {
+ "Tip: execution order": (
+ """
+ The order of cells on the page has no bearing on
+ the order in which cells are executed: marimo knows that a cell
+ reading a variable must run after the cell that defines it. This
+ frees you to organize your code in the way that makes the most
+ sense for you.
+ """
+ )
+ }
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ **Global names must be unique.** To enable reactivity, marimo imposes a
+ constraint on how names appear in cells: no two cells may define the same
+ variable.
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.accordion(
+ {
+ "Tip: encapsulation": (
+ """
+ By encapsulating logic in functions, classes, or Python modules,
+ you can minimize the number of global variables in your notebook.
+ """
+ )
+ }
+ )
+ return
+
+
+def __(mo):
+ mo.accordion(
+ {
+ "Tip: private variables": (
+ """
+ Variables prefixed with an underscore are "private" to a cell, so
+ they can be defined by multiple cells.
+ """
+ )
+ }
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """## 2. UI elements
+
+ Cells can output interactive UI elements. Interacting with a UI
+ element **automatically triggers notebook execution**: when
+ you interact with a UI element, its value is sent back to Python, and
+ every cell that references that element is re-run.
+
+ marimo provides a library of UI elements to choose from under
+ `marimo.ui`.
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.md("**🌊 Some UI elements.** Try interacting with the below elements.")
+ return
+
+
+def __(mo):
+ icon = mo.ui.dropdown(["🍃", "🌊", "✨"], value="🍃")
+ return icon,
+
+
+def __(icon, mo):
+ repetitions = mo.ui.slider(1, 16, label=f"number of {icon.value}: ")
+ return repetitions,
+
+
+def __(icon, repetitions):
+ icon, repetitions
+ return
+
+
+def __(icon, mo, repetitions):
+ mo.md("# " + icon.value * repetitions.value)
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ## 3. Apps
+
+ marimo notebooks can double as apps. Click the app window icon in the
+ bottom-left to see this notebook in "app view."
+
+ When you're ready to deploy, the `marimo` command-line tool provides a
+ way to serve your app. Of course, you can use marimo just to level-up your
+ notebooking, without ever deploying apps.
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ## 4. marimo is just Python
+
+ marimo cells parse Python (and only Python), and marimo programs are
+ stored as pure Python files — outputs are _not_ included. There's no
+ magical syntax.
+
+ The Python files generated by marimo are:
+
+ - easily versioned with git, yielding minimal diffs
+ - legible for both humans and machines
+ - formattable using your tool of choice,
+ - usable as Python scripts, with UI elements taking their default
+ values, and
+ - importable by other modules (more on that in the future).
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ## 5. The marimo editor
+
+ Here are some tips to help you get started with the marimo editor.
+ """
+ )
+ return
+
+
+def __(mo, tips):
+ mo.accordion(tips)
+ return
+
+
+def __(mo):
+ mo.md(
+ """## 6. The `marimo` command-line tool
+
+ **Using the marimo editor.** Use
+
+ ```
+ marimo edit
+ ```
+
+ in a terminal to create a new marimo program, or
+
+ ```
+ marimo edit app.py
+ ```
+
+ to create/edit a program called `app.py`.
+
+ **Running apps.** Use
+
+ ```
+ marimo run app.py
+ ```
+
+ to start a webserver that serves your app in a read-only mode, with
+ code cells hidden.
+
+ **Convert a Jupyter notebook.** Convert a Jupyter notebook to a marimo
+ notebook using `marimo convert`:
+
+ ```
+ marimo convert your_notebook.ipynb > your_app.py
+ ```
+
+ **Tutorials.** marimo comes packaged with tutorials:
+
+ - `dataflow`: more on marimo's automatic execution
+ - `ui`: how to use UI elements
+ - `markdown`: how to write markdown, with interpolated values and
+ LaTeX
+ - `plots`: how plotting works in marimo
+ - `fileformat`: how marimo's file format works
+
+ Start a tutorial with `marimo tutorial`; for example,
+
+ ```
+ marimo tutorial dataflow
+ ```
+
+ In addition to tutorials, we have examples in our
+ [our Github repo](https://www.github.com/marimo-team/marimo/tree/main/examples).
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.md("## Finally, a fun fact")
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ The name "marimo" is a reference to a type of algae that, under
+ the right conditions, clumps together to form a small sphere
+ called a "marimo moss ball". Made of just strands of algae, these
+ beloved assemblages are greater than the sum of their parts.
+ """
+ )
+ return
+
+
+def __():
+ tips = {
+ "Saving": (
+ """
+ **Saving**
+
+ - _Name_ your app using the box at the top of the screen, or
+ with `Ctrl/Cmd+s`. You can also create a named app at the
+ command line, e.g., `marimo edit app_name.py`.
+
+ - _Save_ by clicking the save icon on the bottom left, or by
+ inputting `Ctrl/Cmd+s`. You can also configure marimo to
+ autosave.
+ """
+ ),
+ "Running": (
+ """
+ 1. _Run a cell_ by clicking the play ( ▷ ) button on the bottom
+ right of a cell, or by inputting `Ctrl/Cmd+Enter`.
+
+ 2. _Run a stale cell_ by clicking the yellow run button to the
+ right of the cell, or by inputting `Ctrl/Cmd+Enter`. A cell is
+ stale when its code has been modified but not run.
+
+ 3. _Run all stale cells_ by clicking the play ( ▷ ) button on
+ the bottom right of the screen, or input `Ctrl/Cmd+Shift+r`.
+ """
+ ),
+ "Console Output": (
+ """
+ Console output (e.g., `print()` statements) is shown below a
+ cell.
+ """
+ ),
+ "Creating, Moving, and Deleting Cells": (
+ """
+ 1. _Create_ a new cell above or below a given one by clicking
+ the plus button to the left of the cell, which appears on
+ mouse hover.
+
+ 2. _Move_ a cell up or down by clicking the arrow buttons to
+ the left.
+
+ 3. _Delete_ a cell by clicking the trash bin icon. Bring it
+ back by clicking the undo button on the bottom right of the
+ screen, or with `Ctrl/Cmd+Shift+z`.
+ """
+ ),
+ "Code Folding": (
+ """
+ You can collapse or fold the code in a cell by clicking the arrow
+ icons in the line number column to the left, or by using keyboard
+ shortcuts.
+
+ Use the command palette (`Ctrl/Cmd+k`) or a keyboard shortcut to
+ quickly fold or unfold all cells.
+ """
+ ),
+ "Code Formatting": (
+ """
+ If you have [black](https://github.com/psf/black) installed, you can format a cell with
+ the keyboard shortcut `Ctrl/Cmd+b`.
+ """
+ ),
+ "Command Palette": (
+ """
+ Use `Ctrl/Cmd+k` to open the command palette.
+ """
+ ),
+ "Keyboard Shortcuts": (
+ """
+ Click the keyboard button on the bottom left of the screen (or
+ input `Ctrl/Cmd+Shift+h`) to view a list of all keyboard
+ shortcuts.
+ """
+ ),
+ "Configuration": (
+ """
+ Configure the editor by creating a file called
+ `marimo.config.py` that includes a call to
+ `marimo.config.configure()`.
+
+ _Example._
+
+ ```python3
+ import marimo as mo
+
+ mo.config.configure(
+ config={{
+ # Autocomplete
+ "completion": {{"activate_on_typing": True}},
+ # Enable autosave
+ "save": {{"autosave": "after_delay", "autosave_delay": 1000}},
+ }}
+ )
+ ```
+ """
+ ),
+ }
+ return tips,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_tutorials/layout.py b/marimo/_tutorials/layout.py
new file mode 100644
index 0000000000..8a31373b03
--- /dev/null
+++ b/marimo/_tutorials/layout.py
@@ -0,0 +1,365 @@
+# Copyright 2023 Marimo. All rights reserved.
+import marimo
+
+__generated_with = "0.0.11"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md(
+ """
+ # Layout
+
+ `marimo` provides functions to help you lay out your output, such as
+ in rows and columns, accordions, tabs, and callouts.
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ## Rows and columns
+
+ Arrange objects into rows and columns with `mo.hstack` and `mo.vstack`.
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.hstack(
+ [mo.ui.text(label="hello"), mo.ui.slider(1, 10, label="slider")],
+ justify="start",
+ )
+ return
+
+
+def __(mo):
+ mo.vstack([mo.ui.text(label="world"), mo.ui.number(1, 10, label="number")])
+ return
+
+
+def __(mo):
+ grid = mo.vstack(
+ [
+ mo.hstack(
+ [mo.ui.text(label="hello"), mo.ui.slider(1, 10, label="slider")],
+ ),
+ mo.hstack(
+ [mo.ui.text(label="world"), mo.ui.number(1, 10, label="number")],
+ ),
+ ],
+ ).center()
+
+ mo.md(
+ f"""
+ Combine `mo.hstack` with `mo.vstack` to make grids:
+
+ {grid}
+
+ You can pass anything to `mo.hstack` to `mo.vstack` (including
+ plots!).
+ """
+ )
+ return grid,
+
+
+def __(mo):
+ mo.md(
+ """
+ **Customization.**
+ The presentation of stacked elements can be customized with some arguments
+ that are best understood by example.
+ """
+ )
+ return
+
+
+def __(mo):
+ justify = mo.ui.dropdown(
+ ["start", "center", "end", "space-between", "space-around"],
+ value="space-between",
+ label="justify",
+ )
+ align = mo.ui.dropdown(
+ ["start", "center", "end", "stretch"], value="center", label="align"
+ )
+ gap = mo.ui.number(start=0, step=0.25, stop=2, value=0.5, label="gap")
+ wrap = mo.ui.checkbox(label="wrap")
+
+ mo.hstack([justify, align, gap, wrap], justify="center")
+ return align, gap, justify, wrap
+
+
+def __(mo):
+ size = mo.ui.slider(label="box size", start=60, stop=500)
+ mo.hstack([size], justify="center")
+ return size,
+
+
+def __(align, boxes, gap, justify, mo, wrap):
+ mo.hstack(
+ boxes,
+ align=align.value,
+ justify=justify.value,
+ gap=gap.value,
+ wrap=wrap.value,
+ )
+ return
+
+
+def __(align, boxes, gap, mo):
+ mo.vstack(
+ boxes,
+ align=align.value,
+ gap=gap.value,
+ )
+ return
+
+
+def __(mo, size):
+ def create_box(num=1):
+ box_size = size.value + num * 10
+ return mo.Html(
+ f"<div style='min-width: {box_size}px; min-height: {box_size}px; background-color: orange; text-align: center; line-height: {box_size}px'>{str(num)}</div>"
+ )
+
+
+ boxes = [create_box(i) for i in range(1, 5)]
+ return boxes, create_box
+
+
+def __(mo):
+ mo.accordion(
+ {
+ "Documentation: `mo.hstack`": mo.doc(mo.hstack),
+ "Documentation: `mo.vstack`": mo.doc(mo.vstack),
+ }
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ **Justifying `Html`.** While you can center or right-justify any object
+ using `mo.hstack`, `Html` objects (returned by most marimo
+ functions, and subclassed by most marimo classes) have a shortcut using
+ via their `center`, `right`, and `left` methods.
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.md("This markdown is left-justified.")
+ return
+
+
+def __(mo):
+ mo.md("This markdown is centered.").center()
+ return
+
+
+def __(mo):
+ mo.md("This markdown is right-justified.").right()
+ return
+
+
+def __(mo):
+ mo.accordion(
+ {
+ "Documentation: `Html.center`": mo.doc(mo.Html.center),
+ "Documentation: `Html.right`": mo.doc(mo.Html.right),
+ "Documentation: `Html.left`": mo.doc(mo.Html.left),
+ }
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ## Accordion
+
+ Create expandable shelves of content using `mo.accordion`:
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.accordion(
+ {"This is an accordion about `mo.accordion`": mo.doc(mo.accordion)}
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ An accordion can contain multiple items:
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.accordion(
+ {
+ "Multiple items": "By default, only one item can be open at a time",
+ "Allow multiple items to be open": (
+ """
+ Use the keyword argument `multiple=True` to allow multiple items
+ to be open at the same time
+ """
+ ),
+ }
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ## Tabs
+
+ Use `mo.tabs` to display multiple objects in a single tabbed output:
+ """
+ )
+ return
+
+
+def __(mo):
+ _settings = mo.vstack(
+ [
+ mo.md("**Edit User**"),
+ mo.ui.text(label="First Name"),
+ mo.ui.text(label="Last Name"),
+ ]
+ )
+
+ _organization = mo.vstack(
+ [
+ mo.md("**Edit Organization**"),
+ mo.ui.text(label="Organization Name"),
+ mo.ui.number(label="Number of employees", start=0, stop=1000),
+ ]
+ )
+
+ mo.tabs(
+ {
+ "🧙‍♀ User": _settings,
+ "🏢 Organization": _organization,
+ }
+ )
+ return
+
+
+def __(mo):
+ mo.accordion({"Documentation: `mo.tabs`": mo.doc(mo.tabs)})
+ return
+
+
+def __(mo):
+ _t = [
+ mo.md("**Hello!**"),
+ mo.md(r"$f(x)$"),
+ {"c": mo.ui.slider(1, 10), "d": (mo.ui.checkbox(), mo.ui.switch())},
+ ]
+
+ mo.md(
+ f"""
+ ## Tree
+
+ Display a nested structure of lists, dictionaries, and tuples with
+ `mo.tree`:
+
+ {mo.tree(_t)}
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.accordion({"Documentation: `mo.tree`": mo.doc(mo.tree)})
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ## Callout
+
+ Turn any markdown or HTML into an emphasized callout with the `callout`
+ method:
+ """
+ )
+ return
+
+
+def __(mo):
+ callout_kind = mo.ui.dropdown(
+ ["neutral", "alert", "warn", "success"], value="neutral"
+ )
+ return callout_kind,
+
+
+def __(callout_kind, mo):
+ mo.md(
+ f"""
+ **This is a callout!**
+
+ You can turn any HTML or markdown into an emphasized callout.
+ You can choose from a variety of different callout kind. This one is:
+ {callout_kind}
+ """
+ ).callout(kind=callout_kind.value)
+ return
+
+
+def __(mo):
+ mo.accordion({"Documentation: `mo.callout`": mo.doc(mo.callout)})
+ return
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_tutorials/markdown.py b/marimo/_tutorials/markdown.py
new file mode 100644
index 0000000000..6b4b02b925
--- /dev/null
+++ b/marimo/_tutorials/markdown.py
@@ -0,0 +1,347 @@
+# Copyright 2023 Marimo. All rights reserved.
+import marimo
+
+__generated_with = "0.0.5"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md(
+ """
+ # Hello, Markdown!
+
+ Use marimo's "`md`" function to embed rich text into your marimo
+ apps. This function compiles Markdown into HTML that marimo
+ can display.
+
+ For example, here's the code that rendered the above title and
+ paragraph:
+
+ ```python3
+ mo.md(
+ '''
+ # Hello, Markdown!
+
+ Use marimo's "`md`" function to embed rich text into your marimo
+ apps. This function compiles your Markdown into HTML that marimo
+ can display.
+ '''
+ )
+ ```
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ r"""
+ ## LaTeX
+ You can embed LaTeX in Markdown.
+
+ For example,
+
+ ```python3
+ mo.md(r'$f : \mathbf{R} \to \mathbf{R}$')
+ ```
+
+ renders $f : \mathbf{R} \to \mathbf{R}$, while
+
+ ```python3
+ mo.md(
+ r'''
+ \[
+ f: \mathbf{R} \to \mathbf{R}
+ \]
+ '''
+ )
+ ```
+
+ renders the display math
+
+ \[
+ f: \mathbf{R} \to \mathbf{R}.
+ \]
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.accordion(
+ {
+ "Tip: `r''` strings": mo.md(
+ "Use `r''` strings to remove the need to escape backslashes"
+ " when writing LaTeX."
+ )
+ }
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ## Interpolating Python values
+
+ You can interpolate Python values into markdown using
+ `f-strings` and marimo's ` as_html` function. This lets you create
+ markdown whose contents depend on data that changes at runtime.
+
+ Here are some examples.
+ """
+ )
+ return
+
+
+def __(
+ matplotlib_installed,
+ missing_matplotlib_msg,
+ missing_numpy_msg,
+ mo,
+ np,
+ numpy_installed,
+ plt,
+):
+ def _sine_plot():
+ if not numpy_installed:
+ return missing_numpy_msg
+ if not matplotlib_installed:
+ return missing_matplotlib_msg
+ _x = np.linspace(start=0, stop=2*np.pi)
+ plt.plot(_x, np.sin(_x))
+ return plt.gca()
+
+ mo.md(
+ f"""
+ ### Plots
+ A matplotlib figure:
+
+ ```python3
+ _x = np.linspace(start=0, stop=2*np.pi)
+ sine_plot = plt.plot(_x, np.sin(_x))
+ mo.md(f"{{mo.as_html(sine_plot)}}")
+ ```
+ yields
+
+ {mo.as_html(_sine_plot())}
+ """
+ )
+ return
+
+
+def __(mo):
+ leaves = mo.ui.slider(1, 32, label="🍃: ")
+
+ mo.md(
+ f"""
+ ### UI elements
+
+ A `marimo.ui` object:
+
+ ```python3
+ leaves = mo.ui.slider(1, 16, label="🍃: ")
+ mo.md(f"{{leaves}}")
+ ```
+
+ yields
+
+ {leaves}
+ """
+ )
+ return leaves,
+
+
+def __(leaves, mo):
+ mo.md(f"Your leaves: {'🍃' * leaves.value}")
+ return
+
+
+def __(mo):
+ mo.accordion(
+ {
+ "Tip: UI elements can format themselves": """
+ marimo objects know how to format themselves, so you can omit the
+ call to `as_html`.
+ """
+ }
+ )
+ return
+
+
+def __(missing_numpy_msg, mo, np, numpy_installed):
+ def make_dataframe():
+ try:
+ import pandas as pd
+ except ModuleNotFoundError:
+ return mo.md(
+ "`Oops! Looks like you don't have pandas installed.`"
+ )
+
+ if not numpy_installed:
+ return missing_numpy_msg
+
+ x = np.linspace(0, 2*np.pi, 10)
+ y = np.sin(x)
+ return pd.DataFrame({'x': x, 'sin(x)': y})
+
+ mo.md(
+ f"""
+ ### Other objects
+
+ Use `mo.as_html` to convert objects to HTML. This function
+ generates rich HTML for many Python types, including:
+
+ - lists, dicts, and tuples,
+ - `pandas` dataframes and series,
+ - `seaborn` figures,
+ - `plotly` figures, and
+ - `altair` figures.
+
+ For example, here's a pandas dataframe:
+
+ {mo.as_html(make_dataframe())}
+ """
+ )
+ return make_dataframe,
+
+
+def __(mo):
+ mo.accordion(
+ {
+ "Tip: outputs are automatically converted to HTML": """
+ `mo.as_html` is only needed when interpolating objects into
+ markdown; the last expression of a cell (its output) is
+ converted to HTML automatically.
+ """
+ }
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ## Putting it all together
+
+ Here's a more interesting example that puts together
+ everything we've learned: rendering markdown with LaTeX that depends on
+ the values of Python objects.
+ """
+ )
+ return
+
+
+def __(math, mo):
+ amplitude = mo.ui.slider(1, 2, step=0.1, label="amplitude: ")
+ period = mo.ui.slider(
+ math.pi/4, 4*math.pi, value=2*math.pi, step=math.pi/8, label="period: ")
+ return amplitude, period
+
+
+def __(
+ matplotlib_installed,
+ missing_matplotlib_msg,
+ missing_numpy_msg,
+ np,
+ numpy_installed,
+ plt,
+):
+ import functools
+
+ @functools.cache
+ def plotsin(amplitude, period):
+ if not numpy_installed:
+ return missing_numpy_msg
+ elif not matplotlib_installed:
+ return missing_matplotlib_msg
+ x = np.linspace(0, 2*np.pi, 256)
+ plt.plot(x, amplitude * np.sin(2*np.pi / period * x))
+ plt.ylim(-2.2, 2.2)
+ return plt.gca()
+ return functools, plotsin
+
+
+def __(amplitude, mo, period):
+ mo.md(f"""
+
+ **A sin curve.**
+
+ - {amplitude}
+ - {period}
+ """)
+ return
+
+
+def __(amplitude, mo, period, plotsin):
+ mo.md(
+ f"""
+
+ You're viewing the graph of
+
+ \[
+ f(x) = {amplitude.value}\sin((2\pi/{period.value:0.2f})x),
+ \]
+
+ with $x$ ranging from $0$ to $2\pi$.
+ {mo.as_html(plotsin(amplitude.value, period.value))}
+ """
+ )
+ return
+
+
+def __(mo):
+ matplotlib_installed = False
+ numpy_installed = False
+ missing_numpy_msg = mo.md(
+ "`Oops! Looks like you don't have numpy installed.`")
+ missing_matplotlib_msg = mo.md(
+ "`Oops! Looks like you don't have matplotlib installed.`")
+
+ try:
+ import matplotlib.pyplot as plt
+ matplotlib_installed = True
+ except ModuleNotFoundError:
+ pass
+
+ try:
+ import numpy as np
+ numpy_installed = True
+ except ModuleNotFoundError:
+ pass
+ return (
+ matplotlib_installed,
+ missing_matplotlib_msg,
+ missing_numpy_msg,
+ np,
+ numpy_installed,
+ plt,
+ )
+
+
+def __():
+ import math
+
+ import marimo as mo
+ return math, mo
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_tutorials/plots.py b/marimo/_tutorials/plots.py
new file mode 100644
index 0000000000..9ca5044dae
--- /dev/null
+++ b/marimo/_tutorials/plots.py
@@ -0,0 +1,292 @@
+# Copyright 2023 Marimo. All rights reserved.
+import marimo
+
+__generated_with = "0.0.5"
+app = marimo.App()
+
+
+def __(check_dependencies):
+ check_dependencies()
+ return
+
+
+def __(mo):
+ mo.md("# Plotting")
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ marimo supports several popular plotting libraries, including matplotlib,
+ plotly, seaborn, and altair.
+
+ This tutorial gives examples using matplotlib; other libraries are
+ used similarly.
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.md("## Matplotlib")
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ To show a plot, include it in the last expression of a cell (just
+ like any other output).
+
+ ```python3
+ # create the plot in the last line of the cell
+ import matplotlib.pyplot as plt
+ plt.plot([1, 2])
+ ```
+ """
+ )
+ return
+
+
+def __(plt):
+ plt.plot([1, 2])
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ```python3
+ # create a plot
+ plt.plot([1, 2])
+ # ... do some work ...
+ # make plt.gca() the last line of the cell
+ plt.gca()
+ ```
+ """
+ )
+ return
+
+
+def __(plt):
+ plt.plot([1, 2])
+ # ... do some work ...
+ # make plt.gca() the last line of the cell
+ plt.gca()
+ return
+
+
+def __(mo, plt_show_explainer):
+ mo.accordion(plt_show_explainer)
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ **A new figure every cell.** Every cell starts with an empty figure for
+ the imperative `pyplot` API.
+ """
+ )
+ return
+
+
+def __(np):
+ x = np.linspace(start=-4, stop=4, num=100, dtype=float)
+ return x,
+
+
+def __(plt, x):
+ plt.plot(x, x)
+ plt.plot(x, x**2)
+ plt.gca()
+ return
+
+
+def __(plt, x):
+ plt.plot(x, x**3)
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ To build a figure over multiple cells, use the object-oriented API and
+ create your own axis:
+ """
+ )
+ return
+
+
+def __(plt, x):
+ _, axis = plt.subplots()
+ axis.plot(x, x)
+ axis.plot(x, x**2)
+ axis
+ return axis,
+
+
+def __(axis, x):
+ axis.plot(x, x**3)
+ axis
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ### Draw plots interactively
+
+ Draw plots interactively by parametrizing them with UI elements.
+ """
+ )
+ return
+
+
+def __(mo):
+ exponent = mo.ui.slider(1, 5, value=1, step=1, label='exponent')
+
+ mo.md(
+ f"""
+ **Visualizing powers.**
+
+ {exponent}
+ """
+ )
+ return exponent,
+
+
+def __(exponent, mo, plt, x):
+ import functools
+
+
+ @functools.cache
+ def _plot(exponent):
+ plt.plot(x, x**exponent)
+ return plt.gca()
+
+
+ _tex = (
+ f"$$f(x) = x^{exponent.value}$$" if exponent.value > 1 else "$$f(x) = x$$"
+ )
+
+ mo.md(
+ f"""
+
+ {_tex}
+
+ {mo.as_html(_plot(exponent.value))}
+ """
+ )
+ return functools,
+
+
+def __(mo):
+ mo.md("## Other libraries")
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ marimo also supports these other plotting libraries:
+
+ - Plotly
+ - Seaborn
+ - Altair
+
+ Just output their figure objects as the last expression of a cell,
+ or embed them in markdown with `mo.as_html`.
+
+ If you would like another library to be integrated into marimo, please
+ get in touch.
+ """
+ )
+ return
+
+
+def __(missing_packages, mo):
+ module_not_found_explainer = mo.md(
+ """
+ ## Oops!
+
+ It looks like you're missing a package that this tutorial
+ requires.
+
+ Close marimo, install **`numpy`** and **`matplotlib`**, then
+ open this tutorial once more.
+
+ If you use `pip`, run
+
+ ```
+ pip install numpy matplotlib
+ ```
+
+ at your command line.
+ """
+ ).callout(kind='warn')
+
+ def check_dependencies():
+ if missing_packages:
+ return module_not_found_explainer
+ return check_dependencies, module_not_found_explainer
+
+
+def __():
+ plt_show_explainer = {
+ "Using `plt.show()`": """
+ You can use `plt.show()` or `figure.show()` to display
+ plots in the console area of a cell. Keep in mind that console
+ outputs are not shown in the app view.
+ """
+ }
+ return plt_show_explainer,
+
+
+def __():
+ try:
+ import matplotlib
+ import matplotlib.pyplot as plt
+ import numpy as np
+ missing_packages = False
+ except ModuleNotFoundError:
+ missing_packages = True
+
+ if not missing_packages:
+ matplotlib.rcParams['figure.figsize'] = (6, 2.4)
+ return matplotlib, missing_packages, np, plt
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_tutorials/ui.py b/marimo/_tutorials/ui.py
new file mode 100644
index 0000000000..3ca3f0a66c
--- /dev/null
+++ b/marimo/_tutorials/ui.py
@@ -0,0 +1,434 @@
+# Copyright 2023 Marimo. All rights reserved.
+import marimo
+
+__generated_with = "0.0.5"
+app = marimo.App()
+
+
+def __(mo):
+ mo.md(
+ """
+ # UI Elements
+
+ One of marimo's most powerful features is its first-class
+ support for interactive user interface (UI) elements: interacting
+ with a UI element will automatically run cells that reference it.
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.md("## `marimo.ui`")
+ return
+
+
+def __(mo):
+ slider = mo.ui.slider(start=1, stop=10, step=1)
+ slider
+
+ mo.md(
+ f"""
+ The `marimo.ui` module has a library of pre-built elements.
+
+ For example, here's a `slider`: {slider}
+ """
+ )
+ return slider,
+
+
+def __(mo, slider):
+ mo.md(f"and here's its value: **{slider.value}**.")
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ### How interactions run cells
+
+ Whenever you interact with a UI element, its value is sent back to
+ Python. When this happens, all cells that reference the global variable
+ bound to the UI element, but don't define it, will run.
+
+ This simple rule lets you use UI elements to
+ drive the exectution of your program, letting you build
+ interactive notebooks and tools for yourselves and others.
+ """
+ )
+ return
+
+
+def __(mo, slider):
+ mo.accordion(
+ {
+ "Tip: assign UI elements to global variables": (
+ """
+ Interacting with a displayed UI element will only
+ trigger reactive execution if the UI element is assigned
+ to a global variable.
+ """
+ ),
+ "Tip: accessing an element's value": (
+ """
+ Every UI element has a value attribute that you can access in
+ Python.
+ """
+ ),
+ "Tip: embed UI elements in markdown": mo.md(
+ f"""
+ You can embed UI elements in markdown using f-strings.
+
+ For example, we can render the slider here: {slider}
+ """
+ ),
+ }
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ### Simple elements
+ """
+ )
+ return
+
+
+def __(basic_ui_elements, mo):
+ mo.md(
+ f"""
+ marimo has a large library of simple UI elements: {basic_ui_elements}
+ """
+ )
+ return
+
+
+def __(basic_ui_elements, construct_element, show_element):
+ selected_element = construct_element(basic_ui_elements.value)
+ show_element(selected_element)
+ return selected_element,
+
+
+def __(selected_element, value):
+ value(selected_element)
+ return
+
+
+def __(basic_ui_elements, documentation):
+ documentation(basic_ui_elements.value)
+ return
+
+
+def __(composite_elements, mo):
+ mo.md(
+ f"""### Composite elements
+
+ Composite elements are advanced elements
+ let you build UI elements out of other UI elements.
+ Use these powerful elements to logically group together related elements,
+ create a dynamic set of UI elements, or reduce the number of global
+ variables in your program.
+
+ Select a composite element: {composite_elements}
+ """
+ )
+ return
+
+
+def __(composite_elements, construct_element, show_element):
+ composite_element = construct_element(composite_elements.value)
+ show_element(composite_element)
+ return composite_element,
+
+
+def __(composite_element, value):
+ value(composite_element)
+ return
+
+
+def __(composite_elements, documentation):
+ documentation(composite_elements.value)
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ## Example: A task list
+
+ The next three cells implement a task list. The task list is
+ built using three basic UI elements:
+
+ - `mo.checkbox` for the task items
+ - `mo.text` for the task entry input
+ - `mo.button` for adding and removing tasks
+
+ and one composite element:
+
+ - `mo.array` for maintaining a list of tasks.
+
+ This is an advanced example. You can get far with marimo without
+ ever having to implement a stateful element like this one.
+ """
+ )
+ return
+
+
+def __(mo):
+ # A text input for entering a task
+ task = mo.ui.text(placeholder="a task ...")
+
+ class TaskListState:
+ """
+ This class holds the state of the task list: the tasks (labels),
+ and whether they've been completed (values).
+ """
+ def __init__(self):
+ # The task labels
+ self.labels = []
+ # Whether each label is checked
+ self.values = []
+
+ def add_task(self):
+ if task.value:
+ # Add the current value of the task input to `self.labels`
+ self.labels.append(task.value)
+ # The task starts as incomplete
+ self.values.append(False)
+ return self
+
+ def clear_tasks(self):
+ # Remove all completed tasks from state
+ self.labels[:] = [
+ label
+ for i, label in enumerate(self.labels)
+ if not self.values[i]
+ ]
+ self.values[:] = [v for v in self.values if not v]
+ return self
+
+ state = TaskListState()
+
+ # Buttons to add and remove tasks; these buttons mutate state when they
+ # are clicked.
+ add_task_button = mo.ui.button(
+ value=state,
+ on_click=lambda state: state.add_task(),
+ label="add task",
+ )
+
+ clear_tasks_button = mo.ui.button(
+ value=state,
+ on_click=lambda state: state.clear_tasks(),
+ label="clear completed tasks",
+ )
+ return TaskListState, add_task_button, clear_tasks_button, state, task
+
+
+def __(add_task_button, clear_tasks_button, mo, state, task):
+ # Construct the task list based on the task list state.
+ #
+ # This cell will re-run and reconstruct the task list with updated state
+ # whenever either of the buttons are clicked, since they include references
+ # to the button elements.
+ task_list = mo.ui.array(
+ [
+ mo.ui.checkbox(value=v, label=l)
+ for v, l in zip(state.values, state.labels)
+ ],
+ label="tasks",
+ )
+
+ (
+ task,
+ add_task_button,
+ clear_tasks_button,
+ task_list if state.values else mo.md("No tasks! 🎉"),
+ )
+ return task_list,
+
+
+def __(state, task_list):
+ # This cell runs whenever a task is checked or unchecked, updating the state
+ state.values[:] = task_list.value
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ ## Appendix
+ The remaining cells are helper data structures and functions.
+ You can look at their code if you're curious how certain parts of this
+ tutorial were implemented.
+ """
+ )
+ return
+
+
+def __(mo):
+ composite_elements = mo.ui.dropdown(
+ options=dict(sorted({
+ 'array': mo.ui.array,
+ 'batch': mo.ui.batch,
+ 'dictionary': mo.ui.dictionary,
+ 'form': mo.ui.form,
+ }.items())),
+ )
+ return composite_elements,
+
+
+def __(mo):
+ basic_ui_elements = mo.ui.dropdown(
+ options=dict(sorted({
+ 'button': mo.ui.button,
+ 'checkbox': mo.ui.checkbox,
+ 'date': mo.ui.date,
+ 'dropdown': mo.ui.dropdown,
+ 'file': mo.ui.file,
+ 'multiselect': mo.ui.multiselect,
+ 'number': mo.ui.number,
+ 'radio': mo.ui.radio,
+ 'slider': mo.ui.slider,
+ 'switch': mo.ui.switch,
+ 'table': mo.ui.table,
+ 'text': mo.ui.text,
+ 'text_area': mo.ui.text_area,
+ }.items())),
+ )
+ return basic_ui_elements,
+
+
+def __(mo):
+ def construct_element(value):
+ if value == mo.ui.array:
+ return mo.ui.array([mo.ui.text(), mo.ui.slider(1, 10), mo.ui.date()])
+ elif value == mo.ui.batch:
+ return mo.md(
+ """
+ - Name: {name}
+ - Date: {date}
+ """
+ ).batch(name=mo.ui.text(), date=mo.ui.date())
+ elif value == mo.ui.button:
+ return mo.ui.button(
+ value=0, label="click me", on_click=lambda value: value + 1
+ )
+ elif value == mo.ui.checkbox:
+ return mo.ui.checkbox(label="check me")
+ elif value == mo.ui.date:
+ return mo.ui.date()
+ elif value == mo.ui.dictionary:
+ return mo.ui.dictionary(
+ {
+ "slider": mo.ui.slider(1, 10),
+ "text": mo.ui.text("type something!"),
+ "array": mo.ui.array(
+ [
+ mo.ui.button(value=0, on_click=lambda v: v + 1)
+ for _ in range(3)
+ ],
+ label="buttons",
+ ),
+ }
+ )
+ elif value == mo.ui.dropdown:
+ return mo.ui.dropdown(["a", "b", "c"])
+ elif value == mo.ui.file:
+ return [mo.ui.file(kind="button"), mo.ui.file(kind="area")]
+ elif value == mo.ui.form:
+ return mo.ui.text_area(placeholder="...").form()
+ elif value == mo.ui.multiselect:
+ return mo.ui.multiselect(["a", "b", "c"])
+ elif value == mo.ui.number:
+ return mo.ui.number(start=1, stop=10, step=0.5)
+ elif value == mo.ui.radio:
+ return mo.ui.radio(["a", "b", "c"], value="a")
+ elif value == mo.ui.slider:
+ return mo.ui.slider(start=1, stop=10, step=0.5)
+ elif value == mo.ui.switch:
+ return mo.ui.switch()
+ elif value == mo.ui.table:
+ return mo.ui.table(
+ data=[
+ {"first_name": "Michael", "last_name": "Scott"},
+ {"first_name": "Dwight", "last_name": "Schrute"},
+ ],
+ label="Employees",
+ )
+ elif value == mo.ui.text:
+ return mo.ui.text()
+ elif value == mo.ui.text_area:
+ return mo.ui.text_area()
+ return None
+ return construct_element,
+
+
+def __(mo):
+ def show_element(element):
+ if element is not None:
+ return mo.hstack([element], "center")
+ return show_element,
+
+
+def __(mo):
+ def value(element):
+ if element is not None:
+ v = (
+ element.value
+ if not isinstance(element, mo.ui.file)
+ else element.name()
+ )
+ return mo.md(
+ f"""
+ The element's current value is {mo.as_html(element.value)}
+ """
+ )
+ return value,
+
+
+def __(mo):
+ def documentation(element):
+ if element is not None:
+ return mo.accordion(
+ {f"Documentation on `mo.ui.{element.__name__}`": mo.doc(element)}
+ )
+ return documentation,
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_utils/__init__.py b/marimo/_utils/__init__.py
new file mode 100644
index 0000000000..618f22fc54
--- /dev/null
+++ b/marimo/_utils/__init__.py
@@ -0,0 +1 @@
+# Copyright 2023 Marimo. All rights reserved.
diff --git a/marimo/_utils/flatten.py b/marimo/_utils/flatten.py
new file mode 100644
index 0000000000..d23db4c5e4
--- /dev/null
+++ b/marimo/_utils/flatten.py
@@ -0,0 +1,213 @@
+# Copyright 2023 Marimo. All rights reserved.
+"""Flatten and repack nested structures of lists, tuples, and dicts
+
+Adapted from https://github.com/ericmjl/pyflatten/tree/master; changed
+to handle generic leaf data types and minimize recursion stack depth.
+
+TODO(akshayka): if this becomes a bottleneck, use a library like dm-tree
+(this implementation wil be slow large structures); as of writing, installation
+of dm-tree on macOS is buggy
+"""
+from __future__ import annotations
+
+import itertools
+from typing import Any, Callable, Dict, List, Tuple, Union
+
+STRUCT_TYPE = Union[Tuple[Any, ...], List[Any], Dict[Any, Any]]
+UNFLATTEN_TYPE = Callable[[List[Any]], Union[STRUCT_TYPE, Any]]
+FLATTEN_RET_TYPE = Tuple[List[Any], UNFLATTEN_TYPE]
+
+
+class CyclicStructureError(Exception):
+ pass
+
+
+def _is_leaf(obj: Any) -> bool:
+ return not isinstance(obj, (list, tuple, dict))
+
+
+def _flatten_sequence(
+ value: list[Any] | tuple[Any, ...], json_compat_keys: bool, seen: set[int]
+) -> FLATTEN_RET_TYPE:
+ """Flatten a sequence of values"""
+ # Algorithm:
+ #
+ # Accumulate a list of flattened pieces and unflattener functions,
+ # one for each chunk of value.
+ #
+ # A chunk is one of the following:
+ # 1 a sequence (possibly empty) of leaves
+ # 2 a nested structure
+ #
+ # Chunks of type 1 are a base case
+ # Chunks of type 2 are recursed on using flatten
+ #
+ # Implementing chunks of type 1 as a base case significantly decreases
+ # the recursion stack depth compared to the reference implementation
+ if not value:
+ # unflattener returns an empty tuple or empty list
+ return [], lambda _: type(value)()
+
+ lengths = []
+ flattened_pieces: list[list[Any]] = []
+ unflatteners: list[UNFLATTEN_TYPE] = []
+ i = 0
+ while i < len(value):
+ if _is_leaf(value[i]):
+ # process a chunk of type 1: a sequence of leaves
+ lengths.append(0)
+ flattened_pieces.append([])
+ while i < len(value) and _is_leaf(value[i]):
+ flattened_pieces[-1].append(value[i])
+ lengths[-1] += 1
+ i += 1
+ unflatteners.append(lambda x: x)
+ # if we haven't exhausted the sequence, then we've hit a value that
+ # is not a leaf
+ if i < len(value):
+ assert not _is_leaf(value[i])
+ flattened, u = _flatten(value[i], json_compat_keys, seen)
+ lengths.append(len(flattened))
+ flattened_pieces.append(flattened)
+
+ # u=u forces Python to bind the unflattener function u
+ # to the lambda; without that (if u were just closed
+ # over) every element of unflatteners would point to the last
+ # u because of Python's late-binding
+ def uprime(v: list[Any], u: UNFLATTEN_TYPE = u) -> STRUCT_TYPE:
+ return [u(v)]
+
+ unflatteners.append(uprime)
+ i += 1
+
+ def unflatten(vector: list[Any]) -> STRUCT_TYPE:
+ unflattened_pieces = []
+ pointer = 0
+ # How unflattening works
+ #
+ # consecutive leaves (e.g., 1, 2) are unflattened as
+ # [leaves ...] ([1, 2])
+ #
+ # non-leaves (e.g., {1: 2}, or [1, 2]) are unflattened as
+ # [[structure]] ([{1: 2}] or [[1, 2]])
+ #
+ # we chain the unflattened pieces together to pack them according to
+ # the structure of value
+ for unflattener, length in zip(unflatteners, lengths):
+ unflattened_pieces.append(
+ unflattener(vector[pointer : pointer + length])
+ )
+ pointer += length
+ if isinstance(value, tuple):
+ return tuple(itertools.chain(*unflattened_pieces))
+ elif isinstance(value, list):
+ return list(itertools.chain(*unflattened_pieces))
+ else:
+ raise ValueError("Invalid type of value ", type(value))
+
+ return (
+ list(itertools.chain(*flattened_pieces)),
+ unflatten,
+ )
+
+
+def _flatten(
+ value: Any, json_compat_keys: bool, seen: set[int]
+) -> FLATTEN_RET_TYPE:
+ # Track ids of structures to make sure that the tree has a finite height,
+ # ie, to make sure that no structure contains itself.
+ value_id = id(value)
+ if isinstance(value, (tuple, list, dict)):
+ if value_id in seen:
+ raise CyclicStructureError("already seen ", value)
+
+ if isinstance(value, (tuple, list)):
+ seen.add(value_id)
+ ret = _flatten_sequence(value, json_compat_keys, seen)
+ seen.remove(value_id)
+ return ret
+ elif isinstance(value, dict):
+ if not value:
+ return [], lambda _: {}
+
+ seen.add(value_id)
+ flattened = []
+ unflatteners = []
+ lengths = []
+ keys = []
+ for k, v in value.items():
+ curr_flattened, curr_unflatten = _flatten(
+ v, json_compat_keys, seen
+ )
+ flattened.append(curr_flattened)
+ unflatteners.append(curr_unflatten)
+ lengths.append(len(curr_flattened))
+ if json_compat_keys and not (
+ isinstance(k, (str, int, float, bool)) or k is None
+ ):
+ keys.append(str(k))
+ else:
+ keys.append(k)
+ seen.remove(value_id)
+
+ def unflatten(vector: list[Any]) -> STRUCT_TYPE:
+ pointer = 0
+ d = {}
+ for key, unflattener, length in zip(keys, unflatteners, lengths):
+ piece = vector[pointer : pointer + length]
+ d[key] = unflattener(piece)
+ pointer += length
+ return d
+
+ return list(itertools.chain(*flattened)), unflatten
+ else:
+ return [value], lambda x: x[0]
+
+
+def flatten(value: Any, json_compat_keys: bool = False) -> FLATTEN_RET_TYPE:
+ """Flatten a nested structure.
+
+ Returns the structure flattened and a repacking function.
+
+ Repacing function expects a flat list of the same length as
+ the flattened structure.
+
+ Usage:
+ value = [1, [2, 3], {"4": [5, 6]}, []]
+ flattened, unflattener = flatten(value)
+ # apply a map or other processing to each value of flattened ...
+ # ...
+ # packed_as_value has same nesting structure as value
+ packed_as_value = unflattener(processed_flattened)
+
+ Args:
+ ----
+ value: nested structure of lists, tuples, and dicts
+ json_compat_keys: if True, unflattener will stringify dict keys when
+ keys are not JSON compatible
+
+ Returns:
+ -------
+ flattened_value, unflattener function
+
+ Raises:
+ ------
+ CyclicStructureError: If the structure has a cyclic nesting pattern,
+ such as a list that contains itself
+ """
+ flattened, u = _flatten(value, json_compat_keys, seen=set())
+
+ def unflatten_with_validation(vector: list[Any]) -> STRUCT_TYPE:
+ if type(vector) != list:
+ raise ValueError(
+ "unflatten function requires a list as input, "
+ + f" but got {type(list)}"
+ )
+ elif len(vector) != len(flattened):
+ raise ValueError(
+ f"Length of unflatten's input must be {len(flattened)}, "
+ + f"but got {len(vector)}"
+ )
+ return u(vector)
+
+ return flattened, unflatten_with_validation
diff --git a/marimo/_utils/format_signature.py b/marimo/_utils/format_signature.py
new file mode 100644
index 0000000000..a87944b5b0
--- /dev/null
+++ b/marimo/_utils/format_signature.py
@@ -0,0 +1,46 @@
+# Copyright 2023 Marimo. All rights reserved.
+import textwrap
+
+
+def format_signature(prefix: str, signature_text: str, width: int = 39) -> str:
+ black_installed = False
+ try:
+ import black
+
+ black_installed = True
+ except ModuleNotFoundError:
+ pass
+
+ if (
+ black_installed
+ and prefix.startswith("class")
+ or prefix.startswith("def")
+ ):
+ # Coarse try-except because we're using internal black APIs;
+ # many other well-established projects use these APIs, which
+ # gives us at least a small amount of confidence in our use.
+ try:
+ mode = black.Mode(line_length=width) # type: ignore[attr-defined]
+ # use "def " instead of class, since Jedi's class "signature" is
+ # not actually valid syntax --- it's the init signature ...
+ formatted = black.format_str(
+ "def " + signature_text + ": ...", mode=mode
+ )
+ # replace "def " with actual prefix
+ formatted = prefix + formatted[4:]
+ # remove ":\n"...\n", which was inserted to make signature have
+ # valid syntax
+ return ("\n".join(formatted.split("\n")[:-2]))[:-1]
+ except Exception:
+ pass
+
+ return "\n ".join(
+ textwrap.wrap(
+ # Make type-annotated arguments one word, so they
+ # aren't broken by the wrapping
+ prefix + signature_text.replace(": ", ":"),
+ width=width,
+ break_long_words=False,
+ )
+ # Re-expand type annotations
+ ).replace(":", ": ")
diff --git a/marimo/_utils/test_flatten.py b/marimo/_utils/test_flatten.py
new file mode 100644
index 0000000000..cedf12f5cd
--- /dev/null
+++ b/marimo/_utils/test_flatten.py
@@ -0,0 +1,191 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+from typing import Any, Dict, List, Tuple
+
+import pytest
+
+from marimo._utils.flatten import CyclicStructureError, flatten
+
+L = List[Any]
+T = Tuple[Any, ...]
+D = Dict[Any, Any]
+
+
+def test_flat_list() -> None:
+ x = [1, 2, 3]
+ v, u = flatten(x)
+ assert v == [1, 2, 3]
+ assert u(v) == x
+ assert u([4, 5, 6]) == [4, 5, 6]
+
+
+def test_flat_tuple() -> None:
+ x = (1, 2, 3)
+ v, u = flatten(x)
+ assert v == [1, 2, 3]
+ assert u(v) == x
+ assert u([4, 5, 6]) == (4, 5, 6)
+
+
+def test_flat_dict() -> None:
+ x = {1: 4, 2: 5, 3: 6}
+ v, u = flatten(x)
+ assert v == [4, 5, 6]
+ assert u(v) == x
+ assert u([7, 8, 9]) == {1: 7, 2: 8, 3: 9}
+
+
+def test_flat_empty_list() -> None:
+ x: L = []
+ v, u = flatten(x)
+ assert v == []
+ assert u(v) == []
+
+
+def test_flat_empty_tuple() -> None:
+ x: T = tuple()
+ v, u = flatten(x)
+ assert v == []
+ assert u(v) == x
+
+
+def test_flat_empty_dict() -> None:
+ x: D = {}
+ v, u = flatten(x)
+ assert v == []
+ assert u(v) == x
+
+
+def test_flat_singleton_list() -> None:
+ x = [1]
+ v, u = flatten(x)
+ assert v == [1]
+ assert u(v) == [1]
+ assert u([2]) == [2]
+
+
+def test_flat_singleton_tuple() -> None:
+ x = (1,)
+ v, u = flatten(x)
+ assert v == [1]
+ assert u(v) == x
+ assert u([2]) == (2,)
+
+
+def test_flat_singleton_dict() -> None:
+ x = {1: 2}
+ v, u = flatten(x)
+ assert v == [2]
+ assert u(v) == x
+ assert u([3]) == {1: 3}
+
+
+def test_nested_list() -> None:
+ x = [0, 1, [], 2, [3, [4, 5]], [6]]
+ v, u = flatten(x)
+ assert v == [0, 1, 2, 3, 4, 5, 6]
+ assert u(v) == x
+ assert u([7, 8, 9, 10, 11, 12, 13]) == [7, 8, [], 9, [10, [11, 12]], [13]]
+
+
+def test_nested_tuple() -> None:
+ x: T = (0, 1, tuple(), 2, (3, (4, 5)), (6,))
+ v, u = flatten(x)
+ assert v == [0, 1, 2, 3, 4, 5, 6]
+ assert u(v) == x
+ assert u([7, 8, 9, 10, 11, 12, 13]) == (
+ 7,
+ 8,
+ tuple(),
+ 9,
+ (10, (11, 12)),
+ (13,),
+ )
+
+
+def test_nested_dict() -> None:
+ x = {
+ "a": 0,
+ "b": 1,
+ "c": dict(),
+ "d": 2,
+ "e": {"f": 3, "g": {"h": 4, "i": 5}},
+ "j": {"k": 6},
+ }
+ v, u = flatten(x)
+ assert v == [0, 1, 2, 3, 4, 5, 6]
+ assert u(v) == x
+ assert u([7, 8, 9, 10, 11, 12, 13]) == {
+ "a": 7,
+ "b": 8,
+ "c": dict(),
+ "d": 9,
+ "e": {"f": 10, "g": {"h": 11, "i": 12}},
+ "j": {"k": 13},
+ }
+
+
+def test_nested_mix() -> None:
+ x = [
+ 0,
+ 1,
+ {"c": []},
+ (2,),
+ {"d": 3, "e": [4, 5]},
+ [6, (7, 8)],
+ ]
+ v, u = flatten(x)
+ assert v == [0, 1, 2, 3, 4, 5, 6, 7, 8]
+ assert u(v) == x
+ assert u([9, 10, 11, 12, 13, 14, 15, 16, 17]) == [
+ 9,
+ 10,
+ {"c": []},
+ (11,),
+ {"d": 12, "e": [13, 14]},
+ [15, (16, 17)],
+ ]
+
+
+def test_nested_mix_repack_objects() -> None:
+ x = [
+ 0,
+ 1,
+ {"c": []},
+ (2,),
+ {"d": 3, "e": [4, 5]},
+ [6, (7, 8)],
+ ]
+ v, u = flatten(x)
+ assert v == [0, 1, 2, 3, 4, 5, 6, 7, 8]
+ assert u(v) == x
+ assert u([[], [], [], [], [], [], [], {}, tuple()]) == [
+ [],
+ [],
+ {"c": []},
+ ([],),
+ {"d": [], "e": [[], []]},
+ [[], ({}, tuple())],
+ ]
+
+
+def test_flatten_cyclic_structure_raises() -> None:
+ x: list[Any] = []
+ x.append(x)
+ # should raise since x contains itself
+ with pytest.raises(CyclicStructureError):
+ flatten(x)
+
+ d: dict[Any, Any] = {}
+ d["key"] = d
+ # should raise since d contains itself
+ with pytest.raises(CyclicStructureError):
+ flatten(d)
+
+
+def test_flatten_repeated_structure_does_not_raise() -> None:
+ x: list[Any] = []
+ y = [x, x, x]
+ # should not raise
+ flatten(y)
diff --git a/marimo/_utils/url.py b/marimo/_utils/url.py
new file mode 100644
index 0000000000..eb70661dde
--- /dev/null
+++ b/marimo/_utils/url.py
@@ -0,0 +1,139 @@
+# Copyright 2023 Marimo. All rights reserved.
+"""Copied from `validators`: https://github.com/python-validators/validators
+
+Don't want to include the entire package as a dependency.
+"""
+from __future__ import annotations
+
+import re
+
+ip_middle_octet = r"(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5]))"
+ip_last_octet = r"(?:\.(?:0|[1-9]\d?|1\d\d|2[0-4]\d|25[0-5]))"
+
+regex = re.compile( # noqa: W605
+ r"^"
+ # protocol identifier
+ r"(?:(?:https?|ftp)://)"
+ # user:pass authentication
+ r"(?:[-a-z\u00a1-\uffff0-9._~%!$&'()*+,;=:]+"
+ r"(?::[-a-z0-9._~%!$&'()*+,;=:]*)?@)?"
+ r"(?:"
+ r"(?P<private_ip>"
+ # IP address exclusion
+ # private & local networks
+ r"(?:(?:10|127)" + ip_middle_octet + r"{2}" + ip_last_octet + r")|"
+ r"(?:(?:169\.254|192\.168)" + ip_middle_octet + ip_last_octet + r")|"
+ r"(?:172\.(?:1[6-9]|2\d|3[0-1])" + ip_middle_octet + ip_last_octet + r"))"
+ r"|"
+ # private & local hosts
+ r"(?P<private_host>" r"(?:localhost))" r"|"
+ # IP address dotted notation octets
+ # excludes loopback network 0.0.0.0
+ # excludes reserved space >= 224.0.0.0
+ # excludes network & broadcast addresses
+ # (first & last IP address of each class)
+ r"(?P<public_ip>"
+ r"(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])"
+ r"" + ip_middle_octet + r"{2}"
+ r"" + ip_last_octet + r")"
+ r"|"
+ # IPv6 RegEx from https://stackoverflow.com/a/17871737
+ r"\[("
+ # 1:2:3:4:5:6:7:8
+ r"([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|"
+ # 1:: 1:2:3:4:5:6:7::
+ r"([0-9a-fA-F]{1,4}:){1,7}:|"
+ # 1::8 1:2:3:4:5:6::8 1:2:3:4:5:6::8
+ r"([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|"
+ # 1::7:8 1:2:3:4:5::7:8 1:2:3:4:5::8
+ r"([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|"
+ # 1::6:7:8 1:2:3:4::6:7:8 1:2:3:4::8
+ r"([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|"
+ # 1::5:6:7:8 1:2:3::5:6:7:8 1:2:3::8
+ r"([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|"
+ # 1::4:5:6:7:8 1:2::4:5:6:7:8 1:2::8
+ r"([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|"
+ # 1::3:4:5:6:7:8 1::3:4:5:6:7:8 1::8
+ r"[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|"
+ # ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::
+ r":((:[0-9a-fA-F]{1,4}){1,7}|:)|"
+ # fe80::7:8%eth0 fe80::7:8%1
+ # (link-local IPv6 addresses with zone index)
+ r"fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|"
+ r"::(ffff(:0{1,4}){0,1}:){0,1}"
+ r"((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}"
+ # ::255.255.255.255 ::ffff:255.255.255.255 ::ffff:0:255.255.255.255
+ # (IPv4-mapped IPv6 addresses and IPv4-translated addresses)
+ r"(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|"
+ r"([0-9a-fA-F]{1,4}:){1,4}:"
+ r"((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}"
+ # 2001:db8:3:4::192.0.2.33 64:ff9b::192.0.2.33
+ # (IPv4-Embedded IPv6 Address)
+ r"(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])" r")\]|"
+ # host name
+ r"(?:(?:(?:xn--[-]{0,2})|[a-z\u00a1-\uffff\U00010000-\U0010ffff0-9]-?)*"
+ r"[a-z\u00a1-\uffff\U00010000-\U0010ffff0-9]+)"
+ # domain name
+ r"(?:\.(?:(?:xn--[-]{0,2})|[a-z\u00a1-\uffff\U00010000-\U0010ffff0-9]-?)*"
+ r"[a-z\u00a1-\uffff\U00010000-\U0010ffff0-9]+)*"
+ # TLD identifier
+ r"(?:\.(?:(?:xn--[-]{0,2}[a-z\u00a1-\uffff\U00010000-\U0010ffff0-9]{2,})|"
+ r"[a-z\u00a1-\uffff\U00010000-\U0010ffff]{2,}))"
+ r")"
+ # port number
+ r"(?::\d{2,5})?"
+ # resource path
+ r"(?:/[-a-z\u00a1-\uffff\U00010000-\U0010ffff0-9._~%!$&'()*+,;=:@/]*)?"
+ # query string
+ r"(?:\?\S*)?"
+ # fragment
+ r"(?:#\S*)?" r"$",
+ re.UNICODE | re.IGNORECASE,
+)
+
+pattern = re.compile(regex)
+
+
+def is_url(value: str, public: bool = False) -> bool:
+ """Return whether or not given value is a valid URL.
+
+ If the value is valid URL this function returns ``True``, otherwise
+ returns ``False``.
+
+ This validator is based on the wonderful `URL validator of dperini`_.
+ .. _URL validator of dperini:
+ https://gist.github.com/dperini/729294
+
+ Examples::
+ >>> url('http://foobar.dk')
+ True
+ >>> url('ftp://foobar.dk')
+ True
+ >>> url('http://10.0.0.1')
+ True
+ >>> url('http://foobar.d')
+ False
+ >>> url('http://10.0.0.1', public=True)
+ False
+
+ .. versionadded:: 0.2
+ .. versionchanged:: 0.10.2
+ Added support for various exotic URLs and fixed various false
+ positives.
+ .. versionchanged:: 0.10.3
+ Added ``public`` parameter.
+ .. versionchanged:: 0.11.0
+ Made the regular expression this function uses case insensitive.
+ .. versionchanged:: 0.11.3
+ Added support for URLs containing localhost
+
+ :param value: URL address string to validate
+ :param public: (default=False) Set True to only allow a public IP address
+ """
+ result = pattern.match(value)
+ if not public:
+ return result is not None
+
+ return result is not None and not any(
+ (result.groupdict().get(key) for key in ("private_ip", "private_host"))
+ )
diff --git a/marimo/config/__init__.py b/marimo/config/__init__.py
new file mode 100644
index 0000000000..97aa6205f3
--- /dev/null
+++ b/marimo/config/__init__.py
@@ -0,0 +1,19 @@
+# Copyright 2023 Marimo. All rights reserved.
+"""Configure the Marimo editor.
+
+This module contains tools used to configure the editor.
+"""
+
+__all__ = [
+ "CompletionConfig",
+ "MarimoConfig",
+ "SaveConfig",
+ "configure",
+]
+
+from marimo.config._config import (
+ CompletionConfig,
+ MarimoConfig,
+ SaveConfig,
+ configure,
+)
diff --git a/marimo/config/_config.py b/marimo/config/_config.py
new file mode 100644
index 0000000000..6acd164588
--- /dev/null
+++ b/marimo/config/_config.py
@@ -0,0 +1,150 @@
+# Copyright 2023 Marimo. All rights reserved.
+from __future__ import annotations
+
+import sys
+from typing import Any, Optional, TypeVar, cast
+
+from typing_extensions import Literal
+
+if sys.version_info < (3, 8):
+ from typing_extensions import TypedDict
+else:
+ from typing import TypedDict
+
+from marimo._output.rich_help import mddoc
+
+
+@mddoc
+class CompletionConfig(TypedDict, total=False):
+ """Configuration for code completion.
+
+ A dict with key/value pairs configuring code completion in the marimo
+ editor.
+
+ **Keys.**
+
+ - `activate_on_typing`: if `False`, completion won't activate
+ until the completion hotkey is entered
+ """
+
+ activate_on_typing: bool
+
+
+@mddoc
+class SaveConfig(TypedDict, total=False):
+ """Configuration for saving.
+
+ **Keys.**
+
+ - `autosave`: one of `"off"` or `"after_delay"`
+ - `delay`: number of milliseconds to wait before autosaving
+ """
+
+ autosave: Literal["off", "after_delay"]
+ autosave_delay: int
+
+
+@mddoc
+class MarimoConfig(TypedDict, total=False):
+ """Configuration for the marimo editor.
+
+ A marimo configuration is a Python `dict`. Configurations
+ can be partially specified, with just a subset of possible keys.
+ Partial configs will be augmented with default options.
+
+ Use with `configure` to configure the editor. See `configure`
+ documentation for details on how to register the configuration.
+
+ **Example.**
+
+ ```python3
+ config: mo.config.MarimoConfig = {
+ "completion": {"activate_on_typing": True},
+ }
+ ```
+
+ **Keys.**
+
+ - `completion`: a `CompletionConfig`
+ - `save`: a `SaveConfig`
+ """
+
+ completion: CompletionConfig
+ save: SaveConfig
+
+
+_DEFAULT_CONFIG: MarimoConfig = {
+ "completion": {"activate_on_typing": True},
+ "save": {"autosave": "off", "autosave_delay": 1000},
+}
+_USER_CONFIG: Optional[MarimoConfig] = None
+
+ConfigType = TypeVar("ConfigType", MarimoConfig, SaveConfig, CompletionConfig)
+
+
+# TODO(akshayka): Type-safety, can't index into TypedDict with nonliteral
+def _merge_key(defaults: Any, override: Any, key: str, path: list[str]) -> Any:
+ if key not in defaults:
+ pathstr = " (" + ".".join(path + [key]) + ")" if path else ""
+ raise TypeError("Invalid setting in MarimoConfig: " + key + pathstr)
+ elif key not in override:
+ return defaults[key]
+ elif not isinstance(defaults[key], dict):
+ return override[key]
+ else:
+ return _merge_configs(defaults[key], override[key], path=path + [key])
+
+
+def _merge_configs(
+ defaults: ConfigType, override: ConfigType, path: list[str]
+) -> ConfigType:
+ return cast(
+ ConfigType,
+ {
+ key: _merge_key(defaults, override, key, path)
+ for key in set(defaults.keys()).union(set(override.keys()))
+ },
+ )
+
+
+@mddoc
+def configure(config: MarimoConfig) -> None:
+ """Configure the marimo editor.
+
+ Place a call to this function in a file named `marimo.config.py`, and
+ marimo will use `config` to configure the editor.
+
+ marimo searches for a config file from the directory in which it was
+ started back to the home directory, using the first file it finds.
+
+ **Example.**
+
+ To have autosave enabled and code completion activate automatically as you
+ type, create a file named `marimo.config.py` in your home directory and
+ paste the following code into it.
+
+ ```python3
+ import marimo as mo
+
+
+ mo.config.configure(
+ config={
+ # Automatically activate completions
+ "completion": {"activate_on_typing": True},
+ # Autosave after a delay of 1000ms
+ "save": {"autosave": "after_delay", "autosave_delay": 1000},
+ }
+ )
+ ```
+
+ **Args.**
+
+ - `config`: A configuration object.
+ """
+ global _USER_CONFIG
+ _USER_CONFIG = _merge_configs(_DEFAULT_CONFIG, config, [])
+
+
+def get_configuration() -> MarimoConfig:
+ """Return the current configuration."""
+ return _USER_CONFIG if _USER_CONFIG is not None else _DEFAULT_CONFIG
diff --git a/marimo/config/_utils.py b/marimo/config/_utils.py
new file mode 100644
index 0000000000..7d718d15c1
--- /dev/null
+++ b/marimo/config/_utils.py
@@ -0,0 +1,102 @@
+# Copyright 2023 Marimo. All rights reserved.
+import importlib.util
+import os
+from typing import Optional
+
+from marimo import _loggers
+from marimo.config._config import MarimoConfig, get_configuration
+
+LOGGER = _loggers.marimo_logger()
+
+
+def _is_parent(parent_path: str, child_path: str) -> bool:
+ # Check if parent is actually a parent of child
+ # paths must be real/absolute paths
+ try:
+ return os.path.commonpath([parent_path]) == os.path.commonpath(
+ [parent_path, child_path]
+ )
+ except Exception:
+ return False
+
+
+def _check_directory_for_file(directory: str, filename: str) -> Optional[str]:
+ config_path = os.path.join(directory, filename)
+ if os.path.isfile(config_path):
+ return config_path
+ return None
+
+
+def get_config_path() -> Optional[str]:
+ """Find path of config file (marimo.config.py).
+
+ Searches from current directory to home, return the first config file
+ found, if Any.
+
+ If current directory isn't contained in home, just searches current
+ directory and home.
+
+ May raise an OSError.
+ """
+ filename = "marimo.config.py"
+
+ # we use os.path.realpath to canonicalize paths, just in case
+ # some these functions don't eliminate symlinks on some platforms
+ current_directory = os.path.realpath(os.getcwd())
+ home_expansion = os.path.expanduser("~")
+ if home_expansion == "~":
+ # path expansion failed
+ return None
+ home_directory = os.path.realpath(home_expansion)
+
+ if not _is_parent(home_directory, current_directory):
+ # Can't search back to home, since current_directory not in
+ # home_directory
+ config_path = _check_directory_for_file(current_directory, filename)
+ if config_path is not None:
+ return config_path
+ else:
+ previous_directory = None
+ # Search up to home; terminate when at home or at a fixed point
+ while (
+ current_directory != home_directory
+ and current_directory != previous_directory
+ ):
+ previous_directory = current_directory
+ config_path = os.path.join(current_directory, filename)
+ if os.path.isfile(config_path):
+ return config_path
+ else:
+ current_directory = os.path.realpath(
+ os.path.dirname(current_directory)
+ )
+
+ config_path = os.path.join(home_directory, filename)
+ if os.path.isfile(config_path):
+ return config_path
+
+ return None
+
+
+def load_config() -> Optional[MarimoConfig]:
+ """Load configuration, taking into account user config file, if any."""
+ try:
+ path = get_config_path()
+ except OSError as e:
+ path = None
+ LOGGER.warn("Encountered error when searching for config: %s", str(e))
+
+ if path is not None:
+ LOGGER.debug("Using config at %s", path)
+ spec = importlib.util.spec_from_file_location("marimo_config", path)
+ if spec is None:
+ raise RuntimeError("Failed to load module spec")
+ marimo_config = importlib.util.module_from_spec(spec)
+ if spec.loader is None:
+ raise RuntimeError("Failed to load module spec's loader")
+ # loaded module should modify global in `config` module by running
+ # `config.configure()`
+ spec.loader.exec_module(marimo_config)
+ else:
+ LOGGER.debug("No config found; loading default settings.")
+ return get_configuration()
diff --git a/marimo/py.typed b/marimo/py.typed
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000000..45e20b9f8a
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,137 @@
+[build-system]
+requires = ["setuptools"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "marimo"
+description = "A library for making reactive notebooks and apps"
+dynamic = ["version"]
+dependencies = [
+ # cli
+ "click>=8.0,<9",
+ # python 3.8 compatibility
+ "importlib_resources>=5.10.2",
+ # code completion
+ "jedi>=0.18.0",
+ # compile markdown to html
+ "markdown>=3.4,<4",
+ # add features to markdown
+ "pymdown-extensions>=9.0,<11",
+ # syntax highlighting of code in markdown
+ "pygments>=2.3,<3",
+ # web server
+ "tornado>=6.1,<7",
+ # python 3.8 compatibility
+ "typing_extensions>=4.4.0",
+]
+readme = "README.md"
+license = { file = "LICENSE" }
+requires-python = ">=3.8"
+classifiers = [
+ "Programming Language :: Python :: 3",
+]
+
+[project.scripts]
+marimo = "marimo._cli.cli:main"
+
+[project.optional-dependencies]
+dev = [
+ "click < 8.1.4", # https://github.com/pallets/click/issues/2558
+ "black~=23.3.0",
+ "build~=0.10.0",
+ "pytest~=7.4.0",
+ "mypy~=1.4.1",
+ "ruff~=0.0.275",
+ # For docs
+ "pypandoc_binary",
+ "autoclasstoc",
+ "sphinx",
+ "sphinx-copybutton",
+ "sphinx-new-tab-link",
+ "myst_parser~=2.0.0",
+ "furo"
+]
+
+[project.urls]
+homepage = "https://github.com/marimo-team/marimo"
+
+[tool.setuptools.dynamic]
+version = { attr = "marimo.__version__" }
+
+[tool.setuptools.packages]
+find = {}
+
+[tool.ruff]
+line-length=79
+exclude = [
+ "marimo/_tutorials",
+ "marimo/_smoke_tests",
+ "marimo/_test_utils/codegen_data",
+ "marimo/_test_utils/_tutorials",
+ "frontend",
+ "docs",
+ "build",
+]
+ignore = []
+select = [
+ # pyflakes
+ "F",
+ # pycodestyle
+ "E",
+ # warning
+ "W",
+ # flake8 builtin-variable-shadowing
+ "A001",
+ # flake8 builtin-argument-shadowing
+ "A002",
+ # flake8-bugbear
+ "B",
+ # future annotations
+ "FA102",
+ # isort
+ "I001",
+ # copyright notice
+ "CPY001",
+]
+
+# Never try to fix `F401` (unused imports).
+unfixable = ["F401"]
+
+[tool.black]
+line-length = 79
+extend-exclude = """
+(
+ ^/examples/*
+ | ^/marimo/_test_utils/codegen_data/*
+ | ^/marimo/_test_utils/ipynb_data/*
+ | ^/marimo/_tutorials/*
+ | ^/marimo/_smoke_tests/*
+)
+"""
+
+[tool.isort]
+profile = "black"
+line_length = 79
+
+[tool.mypy]
+strict = true
+exclude = [
+ 'examples',
+ 'marimo/_test_utils/codegen_data',
+ 'marimo/_test_utils/ipynb_data',
+ 'marimo/_tutorials/',
+ 'marimo/_smoke_tests/',
+]
+
+# tutorials shouldn't be type-checked (should be excluded), but they
+# get included anyway, maybe due to import following; this is coarse but works
+[[tool.mypy.overrides]]
+module= "marimo._tutorials.*"
+ignore_errors = true
+
+[tool.pytest.ini_options]
+minversion = "6.0"
+addopts = "-ra -q -v --ignore marimo/_test_utils/"
+testpaths = [
+ "marimo",
+]
diff --git a/scripts/README.md b/scripts/README.md
new file mode 100644
index 0000000000..c2ff46e959
--- /dev/null
+++ b/scripts/README.md
@@ -0,0 +1 @@
+Development utilities. Should be run from the root directory of the project.
diff --git a/scripts/buildfrontend.sh b/scripts/buildfrontend.sh
new file mode 100755
index 0000000000..735385f44f
--- /dev/null
+++ b/scripts/buildfrontend.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+cd frontend
+if pnpm build; then
+ echo "Removing old static files..."
+ rm -rf ../marimo/_static/
+ echo "Copying new static files..."
+ mkdir -p ../marimo/_static/
+ cp -R dist/* ../marimo/_static/
+ echo "Compilation succeeded.\n"
+else
+ echo "Frontend compilation failed.\n"
+fi
diff --git a/scripts/buildwheel.sh b/scripts/buildwheel.sh
new file mode 100755
index 0000000000..439a4465c8
--- /dev/null
+++ b/scripts/buildwheel.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+python -m build
diff --git a/scripts/pycheck.sh b/scripts/pycheck.sh
new file mode 100755
index 0000000000..3a22906dbd
--- /dev/null
+++ b/scripts/pycheck.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+echo "[check: lint]"
+ruff marimo/
+echo "[check: typecheck]"
+mypy marimo/
diff --git a/scripts/pycopyright.sh b/scripts/pycopyright.sh
new file mode 100755
index 0000000000..d256651274
--- /dev/null
+++ b/scripts/pycopyright.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# Directory to scan
+dir="marimo"
+
+# Counter for updated files
+count=0
+
+# Check if directory exists
+if [[ ! -d "$dir" ]]; then
+ echo "Directory does not exist."
+ exit 1
+fi
+
+# Iterate over each Python file excluding "_test_utils" subdirectory, which
+# contains data files for tests
+while read file
+do
+ # Check if the file does not start with "# Copyright"
+ if ! grep -q '^# Copyright' "$file"; then
+ # Create a temporary file
+ tmp_file=$(mktemp)
+ # Prepend "# Copyright" followed by two new lines to the temporary file
+ echo -e "# Copyright 2023 Marimo. All rights reserved." > "$tmp_file"
+ # Append the original file content to the temporary file
+ cat "$file" >> "$tmp_file"
+ # Replace the original file with the temporary file
+ mv "$tmp_file" "$file"
+ ((count++))
+ fi
+done < <(find "$dir" -name "_test_utils" -prune -o -type f -name "*.py" -print)
+
+if (( count > 0 )); then
+ echo "$(tput bold)added copyright notices to $count files$(tput sgr0)"
+fi
diff --git a/scripts/pyfix.sh b/scripts/pyfix.sh
new file mode 100755
index 0000000000..f2705e8ca7
--- /dev/null
+++ b/scripts/pyfix.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+echo "[fix: copyright]"
+./scripts/pycopyright.sh
+echo "[fix: ruff]"
+ruff marimo/ --fix
+echo "[fix: black]"
+black marimo/
+./scripts/pycheck.sh