├── .all-contributorsrc
├── .eslintrc.js
├── .github
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── feature_request.md
│ └── other.md
├── PULL_REQUEST_TEMPLATE.md
├── dependabot.yml
├── ranger.yml
└── workflows
│ └── validate.yml
├── .gitignore
├── .npmrc
├── .prettierrc
├── .vercelignore
├── LICENSE
├── README.md
├── SECURITY.md
├── bin
└── deploy.sh
├── components
├── Announcement.js
├── ApiContext.js
├── AuthContext.js
├── BackgroundSelect.js
├── Billing.js
├── Button.js
├── Carbon.js
├── ColorPicker.js
├── ConfirmButton.js
├── CopyMenu.js
├── Dropdown.js
├── Editor.js
├── EditorContainer.js
├── ExportMenu.js
├── FontFace.js
├── FontSelect.js
├── Footer.js
├── Header.js
├── ImagePicker.js
├── Input.js
├── ListSetting.js
├── LoginButton.js
├── MenuButton.js
├── Meta.js
├── Overlay.js
├── Page.js
├── PhotoCredit.js
├── Popout.js
├── Presets.js
├── RandomImage.js
├── ReferralLink.js
├── SelectionEditor.js
├── Settings.js
├── ShareMenu.js
├── Slider.js
├── SnippetToolbar.js
├── Spinner.js
├── ThemeSelect.js
├── Themes
│ ├── GlobalHighlights.js
│ ├── ThemeCreate.js
│ └── index.js
├── Toasts.js
├── Toggle.js
├── Toolbar.js
├── WidthHandler.js
├── WindowControls.js
├── WindowPointer.js
├── hooks.js
├── style
│ ├── Font.js
│ ├── Reset.js
│ └── Typography.js
└── svg
│ ├── Arrows.js
│ ├── Checkmark.js
│ ├── Controls.js
│ ├── Copy.js
│ ├── Language.js
│ ├── Logo.js
│ ├── Remove.js
│ ├── Settings.js
│ ├── Theme.js
│ ├── Watermark.js
│ └── WindowThemes.js
├── cypress
├── config.json
├── integration
│ ├── background-color.spec.js
│ ├── basic.spec.js
│ ├── embed.spec.js
│ ├── gist.spec.js
│ ├── localStorage.spec.js
│ ├── security.spec.js
│ └── visual-testing.spec.js
├── plugins
│ └── index.js
├── support
│ └── index.js
└── util.js
├── docs
├── README.ar.md
├── README.bn.md
├── README.br.pt.md
├── README.cn.zh.md
├── README.de.md
├── README.es.md
├── README.fa.md
├── README.fr.md
├── README.he.md
├── README.hi.md
├── README.in.md
├── README.it.md
├── README.ja.md
├── README.kr.md
├── README.ml.md
├── README.nl.md
├── README.pl.md
├── README.ru.md
├── README.se.md
├── README.ta.md
├── README.tr.md
├── README.tw.zh.md
├── README.ua.md
└── README.uz.md
├── lib
├── api.js
├── client.js
├── constants.js
├── custom
│ ├── autoCloseBrackets.js
│ └── modes
│ │ ├── apache.js
│ │ ├── elixir.js
│ │ ├── graphql.js
│ │ ├── nim.js
│ │ ├── riscv.js
│ │ └── solidity.js
├── dom-to-image.js
├── highlight-languages.js
├── routing.js
└── util.js
├── next.config.js
├── package.json
├── pages
├── [id].js
├── _document.js
├── about.js
├── account.js
├── api
│ ├── image
│ │ └── [id].js
│ └── oembed.js
├── embed
│ ├── [id].js
│ └── index.js
├── index.js
└── snippets.js
├── public
├── favicon.ico
├── manifest.json
├── robots.txt
└── static
│ ├── brand
│ ├── apple-touch-icon.png
│ ├── banner.png
│ ├── desktop.png
│ ├── icon.png
│ ├── logo-banner-transparent.png
│ ├── logo-banner.png
│ ├── logo-square.png
│ └── social-banner.png
│ ├── presets
│ ├── 0.png
│ ├── 1.png
│ ├── 2.png
│ ├── 3.png
│ ├── 4.png
│ ├── 5.png
│ ├── 6.png
│ ├── 7.png
│ ├── 8.png
│ └── 9.png
│ ├── react-crop.css
│ ├── svg
│ ├── github.svg
│ ├── open-source-companies-2.svg
│ ├── open-source-companies.svg
│ ├── person.svg
│ └── snippets.svg
│ └── themes
│ ├── night-owl.min.css
│ ├── nord.min.css
│ ├── one-dark.min.css
│ ├── one-light.min.css
│ ├── synthwave-84.min.css
│ └── verminal.min.css
├── release.js
├── vercel.json
└── yarn.lock
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: { es6: true, jest: true },
3 | extends: ['eslint:recommended', 'plugin:jsx-a11y/recommended', 'next'],
4 | rules: {
5 | 'import/no-unresolved': 'error',
6 | 'no-duplicate-imports': 'error',
7 | 'react/display-name': 'off',
8 | 'react/jsx-no-target-blank': 'error',
9 | 'react/jsx-uses-react': 'error',
10 | 'react/jsx-uses-vars': 'error',
11 | 'jsx-a11y/click-events-have-key-events': 'off',
12 | 'react-hooks/rules-of-hooks': 'error',
13 | 'react-hooks/exhaustive-deps': 'error',
14 | 'no-console': ['error', { allow: ['error'] }],
15 | // TODO re-enable these
16 | '@next/next/no-img-element': 'off',
17 | '@next/next/no-html-link-for-pages': 'off',
18 | '@next/next/link-passhref': 'off',
19 | },
20 | }
21 |
--------------------------------------------------------------------------------
/.github/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | - Using welcoming and inclusive language
12 | - Being respectful of differing viewpoints and experiences
13 | - Gracefully accepting constructive criticism
14 | - Focusing on what is best for the community
15 | - Showing empathy towards other community members
16 |
17 | Examples of unacceptable behavior by participants include:
18 |
19 | - The use of sexualized language or imagery and unwelcome sexual attention or advances
20 | - Trolling, insulting/derogatory comments, and personal or political attacks
21 | - Public or private harassment
22 | - Publishing others' private information, such as a physical or electronic address, without explicit permission
23 | - Other conduct which could reasonably be considered inappropriate in a professional setting
24 |
25 | ## Our Responsibilities
26 |
27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28 |
29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30 |
31 | ## Scope
32 |
33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34 |
35 | ## Enforcement
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at carbon.now.sh@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38 |
39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40 |
41 | ## Attribution
42 |
43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44 |
45 | [homepage]: http://contributor-covenant.org
46 | [version]: http://contributor-covenant.org/version/1/4/
47 |
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | If you have discovered a bug or have a feature suggestion, feel free to create an issue on GitHub. You don't need to be assigned an issue in order to work on it—consider all issues free rein.
4 |
5 | If you'd like to make some changes yourself, see the following:
6 |
7 | 1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
8 | 1. Make sure yarn is globally installed (`npm install -g yarn`)
9 | 1. Run `yarn` to download required packages
10 | 1. Build and start the application: `yarn dev`
11 | 1. Finally, submit a [pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) with your changes!
12 |
13 | This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification, and uses the [@all-contributors](https://allcontributors.org/docs/en/bot/usage) bot to add new contributors.
14 |
15 | Contributions of any kind are welcome!
16 |
17 | ### Adding themes/languages/fonts
18 |
19 | We are not currently accepting new themes, languages, or fonts into Carbon, except for in extenuating circumstances. Instead, we want to continue to provide ways for users to add their own themes and presets. Please feel free to still open an issue or PR for consideration, but know that there is a chance it will get closed without addition.
20 |
21 | ## Stats
22 | 
23 |
24 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: [carbon-app, mfix22] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
2 | open_collective: # carbon-app/contribute
3 | patreon: # Replace with a single Patreon username
4 | ko_fi: # Replace with a single Ko-fi username
5 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
6 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
7 | liberapay: # Replace with a single Liberapay username
8 | issuehunt: # Replace with a single IssueHunt username
9 | otechie: # Replace with a single Otechie username
10 | custom: [] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
11 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help fix something about Carbon
4 | title: ''
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 |
16 | 1. Go to '…'
17 | 2. Click on '…'
18 | 3. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Info (please complete the following information):**
27 |
28 | - OS [e.g. macOS, Linux, Windows, iOS]:
29 | - Browser [e.g. Chrome, Safari, Firefox]:
30 | - Carbon URL [e.g. carbon.now.sh?bg=pink]:
31 |
32 |
33 |
34 | Code snippet
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: enhancement
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/other.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Other
3 | about: Let us know about something else
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the change**
11 | A clear and concise description of your proposal.
12 |
13 | **Screenshots**
14 | If applicable, add screenshots to help explain the issue.
15 |
16 | **Info (please complete the following information):**
17 |
18 | - OS [e.g. macOS, Linux, Windows, iOS]:
19 | - Browser [e.g. Chrome, Safari, Firefox]:
20 |
21 |
22 | Code snippet
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
7 |
8 | - [ ] Integration tests (if applicable)
9 |
10 | Closes #
11 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | # Configuration for npm
4 | - package-ecosystem: 'npm'
5 | directory: '/'
6 | schedule:
7 | interval: 'daily'
8 | allow:
9 | dependency-type: 'development'
10 | # labels:
11 | # - 'dependencies'
12 | # ignore:
13 | # https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-update
14 |
--------------------------------------------------------------------------------
/.github/ranger.yml:
--------------------------------------------------------------------------------
1 | _extends: reporanger/superpowers
2 |
3 | labels:
4 | dependencies: merge
5 | contributor:
6 | action: comment
7 | delay: 0s
8 | message: '@all-contributors add @$AUTHOR for code'
9 | translator:
10 | action: comment
11 | delay: 0s
12 | message: '@all-contributors add @$AUTHOR for translation'
13 | duplicate:
14 | action: close
15 | delay: 2 days
16 | comment: ⚠️ This has been marked to be closed in $DELAY.
17 | 'theme/language':
18 | action: close
19 | delay: 3 days
20 | comment: |
21 | This issue has been marked "$LABEL". As of Carbon `4.0.0`, the Carbon core team is no longer implementing new themes or languages, except for in extenuating circumstances. You can create your own theme in the "Themes" dropdown.
22 |
23 | This issue will remain open for $DELAY for further consideration.
24 |
25 | commits:
26 | - action: label
27 | pattern: 'upgrade dep'
28 | labels:
29 | - maintenance
30 | - action: label
31 | user: 'allcontributors[bot]'
32 | labels:
33 | - 'squash when passing'
34 |
--------------------------------------------------------------------------------
/.github/workflows/validate.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on: [push]
4 |
5 | jobs:
6 | build:
7 | runs-on: ubuntu-latest
8 | steps:
9 | - uses: actions/checkout@v3
10 | - name: Use Node.js
11 | uses: actions/setup-node@v3
12 | - name: npm install, lint, build, and test
13 | run: |
14 | yarn
15 | npm run lint --if-present
16 | npm run build --if-present
17 | npm start & npx wait-on http://localhost:3000 && npm run cy:run -- --config baseUrl=http://localhost:3000
18 | # --record --key 26c0b9eb-40f9-4ca6-b91d-a39f03652011
19 | env:
20 | CI: true
21 | CYPRESS_CI: true
22 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .env*
3 | .next
4 | dist
5 | out
6 | cypress/videos
7 | cypress/screenshots
8 | .idea
9 | .DS_Store
10 | packaged
11 | coverage
12 | public/service-worker.js
13 | private-key.json
14 | .now
15 | .vercel
16 | *.log
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 | registry=https://registry.npmjs.org
3 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true,
3 | "printWidth": 100,
4 | "semi": false,
5 | "arrowParens": "avoid"
6 | }
7 |
--------------------------------------------------------------------------------
/.vercelignore:
--------------------------------------------------------------------------------
1 | .github
2 | LICENSE
3 | README.md
4 | bin
5 | node_modules
6 | cypress
7 | cypress.json
8 | docs
9 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Carbon
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | Please contact us at [carbon.now.sh+security@gmail.com](mailto:carbon.now.sh+security@gmail.com) to privately inform us of any security vulnerability or issue.
4 |
--------------------------------------------------------------------------------
/bin/deploy.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -e
3 |
4 | vercel switch carbon-app
5 |
6 | VERCEL_URL=$(vercel)
7 |
8 | yarn cy:run --config baseUrl="$VERCEL_URL"
9 |
10 | echo "$VERCEL_URL"| tee /dev/tty | pbcopy
11 |
12 | read -p "Deploy to production (y/N)?" -r
13 | echo
14 | if [[ $REPLY =~ ^[Yy]$ ]]
15 | then
16 | vercel alias "$VERCEL_URL" carbon.now.sh
17 | fi
--------------------------------------------------------------------------------
/components/Announcement.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | // Feature flag
4 | const ACTIVE = false
5 |
6 | const key = 'CARBON_CTA_4'
7 |
8 | function Toast() {
9 | const [open, setState] = React.useState(false)
10 |
11 | React.useEffect(() => {
12 | window.localStorage.removeItem('CARBON_CTA_2')
13 | window.localStorage.removeItem('CARBON_CTA_3')
14 | if (!window.localStorage.getItem(key)) {
15 | setState(true)
16 | }
17 | }, [])
18 |
19 | if (process.env.NODE_ENV !== 'production') {
20 | return null
21 | }
22 |
23 | if (!ACTIVE) {
24 | return null
25 | }
26 |
27 | if (!open) {
28 | return null
29 | }
30 |
31 | function close() {
32 | setState(false)
33 | window.localStorage.setItem(key, true)
34 | }
35 |
36 | return (
37 |