├── .all-contributorsrc
├── .eslintignore
├── .eslintrc.json
├── .github
├── ISSUE_TEMPLATE
│ ├── Bug_report.md
│ └── Feature_request.md
├── dependabot.yml
└── workflows
│ ├── release.yml
│ └── test.yml
├── .gitignore
├── .gitpod.yml
├── .husky
└── pre-commit
├── .lintstagedrc
├── .nvmrc
├── .prettierignore
├── .prettierrc
├── .releaserc.json
├── .staartrc
├── .stylelintignore
├── .stylelintrc
├── CNAME
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── assets
├── blog
│ ├── cloudinary.png
│ ├── filestack.png
│ ├── uploadcare.png
│ └── v1-demo.gif
├── icon-dark.png
├── icon-dark.svg
├── icon-ph.svg
├── icon-white.svg
├── logo-dark.svg
├── logo-light.svg
├── screenshots
│ ├── 9gag.png
│ ├── artstation.png
│ ├── blur.png
│ ├── brightness.png
│ ├── camera.png
│ ├── contrast.png
│ ├── crop.png
│ ├── deviantart.png
│ ├── facebook.png
│ ├── filters.png
│ ├── flickr.png
│ ├── flip.png
│ ├── flipboard.png
│ ├── fotki.png
│ ├── giphy.png
│ ├── grayscale.png
│ ├── home-scrolled.png
│ ├── home.png
│ ├── hue-rotate.png
│ ├── instagram.png
│ ├── invert.png
│ ├── linkedin.png
│ ├── local.png
│ ├── pexels.png
│ ├── pinterest.png
│ ├── pixabay.png
│ ├── reddit.png
│ ├── rotate.png
│ ├── saturate.png
│ ├── screenshot.png
│ ├── sepia.png
│ ├── tumblr.png
│ ├── twitter.png
│ ├── twtter.png
│ ├── unsplash.png
│ ├── url.png
│ ├── weheartit.png
│ ├── wip-1.png
│ ├── wip-2.png
│ ├── wip-3.png
│ └── wip-4.png
├── smo.png
└── uppload.sketch
├── content
├── @
│ ├── anand.md
│ └── michael.md
├── a11y.md
├── api.md
├── backends.md
├── blog
│ ├── index.md
│ ├── introducing-uppload-v2.md
│ └── introducing-uppload.md
├── bundle-size.md
├── compare.md
├── compression.md
├── configuration.md
├── effects
│ ├── crop.md
│ ├── filter.md
│ ├── flip.md
│ ├── index.md
│ └── rotate.md
├── examples
│ └── index.md
├── faq.md
├── getting-started.md
├── help
│ ├── index.md
│ └── services
│ │ ├── camera.md
│ │ ├── import-from-web-service
│ │ ├── 9gag.md
│ │ ├── artstation.md
│ │ ├── deviantart.md
│ │ ├── facebook.md
│ │ ├── flickr.md
│ │ ├── flipboard.md
│ │ ├── fotki.md
│ │ ├── index.md
│ │ ├── instagram.md
│ │ ├── linkedin.md
│ │ ├── pinterest.md
│ │ ├── reddit.md
│ │ ├── tumblr.md
│ │ ├── twitter.md
│ │ └── weheartit.md
│ │ ├── local.md
│ │ ├── screenshot.md
│ │ ├── search
│ │ ├── giphy.md
│ │ ├── index.md
│ │ ├── pexels.md
│ │ ├── pixabay.md
│ │ └── unsplash.md
│ │ └── url.md
├── i18n.md
├── index.md
├── listening-to-events.md
├── migrating-from-1x.md
├── multiple-files.md
├── multiple-instances.md
├── services
│ ├── camera.md
│ ├── import-from-web-service.md
│ ├── index.md
│ ├── local.md
│ └── search-for-images.md
├── themes.md
├── treeshaking.md
├── uploaders
│ ├── custom-uploader.md
│ ├── fetch.md
│ ├── firebase.md
│ ├── index.md
│ └── xhr.md
└── wrappers
│ └── index.md
├── demo
├── demo.scss
├── index.ts
└── package.json
├── dts-bundle-generator.config.ts
├── index.html
├── jest.config.ts
├── netlify.toml
├── package-lock.json
├── package.json
├── scripts
├── build-demo.js
├── build-examples.js
├── build-lang.js
└── build-scss.js
├── src
├── browser.ts
├── effect.ts
├── effects
│ ├── crop
│ │ └── index.ts
│ ├── filter
│ │ ├── blur.ts
│ │ ├── brightness.ts
│ │ ├── contrast.ts
│ │ ├── grayscale.ts
│ │ ├── hue-rotate.ts
│ │ ├── invert.ts
│ │ ├── saturate.ts
│ │ └── sepia.ts
│ ├── flip
│ │ └── index.ts
│ ├── preview
│ │ └── index.ts
│ └── rotate
│ │ └── index.ts
├── helpers
│ ├── assets.ts
│ ├── elements.ts
│ ├── files.ts
│ ├── filter.ts
│ ├── http.ts
│ ├── i18n.ts
│ ├── interfaces.ts
│ ├── microlink.ts
│ ├── search.ts
│ └── utils.ts
├── i18n
│ ├── de.ts
│ ├── en.ts
│ ├── es.ts
│ ├── fa.ts
│ ├── fr.ts
│ ├── hi.ts
│ ├── index.ts
│ ├── it.ts
│ ├── nl.ts
│ ├── pt.ts
│ ├── ro.ts
│ ├── ru.ts
│ ├── tr.ts
│ ├── uk.ts
│ └── zh-TW.ts
├── index.ts
├── service.ts
├── services
│ ├── camera.ts
│ ├── local.ts
│ ├── microlink
│ │ ├── 9gag.ts
│ │ ├── artstation.ts
│ │ ├── deviantart.ts
│ │ ├── facebook.ts
│ │ ├── flickr.ts
│ │ ├── flipboard.ts
│ │ ├── fotki.ts
│ │ ├── instagram.ts
│ │ ├── linkedin.ts
│ │ ├── pinterest.ts
│ │ ├── reddit.ts
│ │ ├── screenshot.ts
│ │ ├── tumblr.ts
│ │ ├── twitter.ts
│ │ ├── url.ts
│ │ └── weheartit.ts
│ └── search
│ │ ├── giphy.ts
│ │ ├── pexels.ts
│ │ ├── pixabay.ts
│ │ └── unsplash.ts
├── styles
│ ├── effects.scss
│ ├── input-range.scss
│ ├── mobile.scss
│ ├── modal.scss
│ ├── services.scss
│ ├── services
│ │ └── cropper.scss
│ ├── ui.scss
│ └── uppload.scss
├── themes
│ ├── dark.scss
│ ├── light.scss
│ └── theme.scss
├── uploaders
│ └── xhr.ts
├── uppload.ts
└── vite-env.d.ts
├── tests
├── __mocks__
│ └── tabbable.ts
├── effect.test.ts
├── helpers
│ ├── assets.test.ts
│ ├── elements.test.ts
│ ├── i18n.test.ts
│ ├── microlink.test.ts
│ └── search.test.ts
├── mocks.ts
├── service.test.ts
├── services
│ ├── local.test.ts
│ └── search
│ │ ├── giphy.test.ts
│ │ ├── pexels.test.ts
│ │ ├── pixabay.test.ts
│ │ └── unsplash.test.ts
├── uploaders
│ └── xhr.test.ts
└── uppload.test.ts
├── tsconfig.json
└── vite.config.ts
/.eslintignore:
--------------------------------------------------------------------------------
1 | .history
2 | .husky
3 | .vscode
4 | coverage
5 | dist
6 | node_modules
7 | vite.config.ts
8 | jest.config.ts
9 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "parser": "@typescript-eslint/parser",
4 | "plugins": ["@typescript-eslint", "prettier"],
5 | "extends": [
6 | "eslint:recommended",
7 | "plugin:@typescript-eslint/eslint-recommended",
8 | "plugin:@typescript-eslint/recommended",
9 | "prettier"
10 | ],
11 | "env": {
12 | "browser": true,
13 | "node": true
14 | },
15 | "rules": {
16 | "prettier/prettier": "error"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/Bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | ---
5 |
6 | **Describe the bug**
7 | A clear and concise description of what the bug is. Include whether you're using Uppload version 1.x or 2.x.
8 |
9 | **To Reproduce**
10 | Steps to reproduce the behavior:
11 |
12 | 1. Go to '...'
13 | 2. Click on '....'
14 | 3. Scroll down to '....'
15 | 4. See error
16 |
17 | **Expected behavior**
18 | A clear and concise description of what you expected to happen.
19 |
20 | **Screenshots**
21 | If applicable, add screenshots to help explain your problem.
22 |
23 | **Desktop (please complete the following information):**
24 |
25 | - OS: \[e.g. iOS]
26 | - Browser \[e.g. chrome, safari]
27 | - Version \[e.g. 22]
28 |
29 | **Smartphone (please complete the following information):**
30 |
31 | - Device: \[e.g. iPhone6]
32 | - OS: \[e.g. iOS8.1]
33 | - Browser \[e.g. stock browser, safari]
34 | - Version \[e.g. 22]
35 |
36 | **Additional context**
37 | Add any other context about the problem here.
38 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/Feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | ---
5 |
6 | **Is your feature request related to a problem? Please describe.**
7 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
8 |
9 | **Describe the solution you'd like**
10 | A clear and concise description of what you want to happen.
11 |
12 | **Describe alternatives you've considered**
13 | A clear and concise description of any alternative solutions or features you've considered.
14 |
15 | **Additional context**
16 | Add any other context or screenshots about the feature request here.
17 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: npm
4 | directory: "/"
5 | schedule:
6 | interval: daily
7 | time: "04:00"
8 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release
2 | on:
3 | push:
4 | branches:
5 | - master
6 | jobs:
7 | release:
8 | name: Release
9 | runs-on: ubuntu-latest
10 | steps:
11 | - name: Checkout
12 | uses: actions/checkout@v3
13 | with:
14 | fetch-depth: 0
15 | - name: Setup Node.js
16 | uses: actions/setup-node@v3
17 | with:
18 | node-version: "lts/*"
19 | cache: npm
20 | - name: Install dependencies
21 | run: npm ci
22 | - name: Release
23 | env:
24 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
26 | run: npx semantic-release
27 |
--------------------------------------------------------------------------------
/.github/workflows/test.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 | on:
3 | push:
4 | branches:
5 | - master
6 | pull_request:
7 | branches:
8 | - master
9 | jobs:
10 | test:
11 | runs-on: ubuntu-latest
12 | if: "!contains(github.event.head_commit.message, '[skip ci]')"
13 | steps:
14 | - name: Checkout
15 | uses: actions/checkout@v3
16 | with:
17 | fetch-depth: 0
18 | - name: Setup Node.js
19 | uses: actions/setup-node@v3
20 | with:
21 | node-version: "lts/*"
22 | cache: npm
23 | - name: Install dependencies
24 | run: npm ci
25 | - name: Build
26 | run: npm run build
27 | - name: Run tests
28 | run: npm run test
29 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | public
14 | *.local
15 | coverage
16 |
17 | # Editor directories and files
18 | .vscode/*
19 | .history/*
20 | !.vscode/extensions.json
21 | .idea
22 | .DS_Store
23 | *.suo
24 | *.ntvs*
25 | *.njsproj
26 | *.sln
27 | *.sw?
28 |
29 | # Examples
30 | content/examples/*
31 | !content/examples/index.md
32 | scripts/uppload-examples-master
33 | scripts/master.zip
34 |
--------------------------------------------------------------------------------
/.gitpod.yml:
--------------------------------------------------------------------------------
1 | tasks:
2 | - init: npm install
3 | command: npm run dev
4 | ports:
5 | - port: 1234
6 | onOpen: open-preview
7 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 | . "$(dirname -- "$0")/_/husky.sh"
3 |
4 | npx lint-staged
5 |
--------------------------------------------------------------------------------
/.lintstagedrc:
--------------------------------------------------------------------------------
1 | {
2 | "./**/*.{ts,html,json}": "npm run format:scripts",
3 | "./**/*.{css,scss}": "npm run format:styles"
4 | }
5 |
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | v19.7.0
2 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | .history
2 | .husky
3 | .vscode
4 | coverage
5 | dist
6 | node_modules
7 | vite.config.ts
8 | jest.config.ts
9 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 80,
3 | "tabWidth": 2,
4 | "singleQuote": false,
5 | "trailingComma": "es5",
6 | "arrowParens": "avoid",
7 | "bracketSpacing": true,
8 | "useTabs": false,
9 | "endOfLine": "auto",
10 | "singleAttributePerLine": false,
11 | "bracketSameLine": false,
12 | "jsxBracketSameLine": false,
13 | "jsxSingleQuote": false,
14 | "quoteProps": "as-needed",
15 | "semi": true
16 | }
17 |
--------------------------------------------------------------------------------
/.releaserc.json:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | [
4 | "semantic-release-gitmoji",
5 | {
6 | "releaseRules": {
7 | "patch": {
8 | "include": [":bento:", ":recycle:"]
9 | }
10 | }
11 | }
12 | ],
13 | "@semantic-release/github",
14 | "@semantic-release/npm",
15 | [
16 | "@semantic-release/git",
17 | {
18 | "message": ":bookmark: v${nextRelease.version} [skip ci]\n\nhttps://github.com/elninotech/uppload/releases/tag/${nextRelease.gitTag}"
19 | }
20 | ]
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/.staartrc:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Uppload",
3 | "baseUrl": "https://uppload.js.org",
4 | "themeColor": "#f05d5e",
5 | "textColor": "#1b0000",
6 | "linkColor": "#dc3545",
7 | "googleAnalytics": "UA-15148382-2",
8 | "agastyaApiKey": "uppload",
9 | "algoliaApiKey": "a6a7714b2b52dbd3313ebef7075746d5",
10 | "algoliaIndex": "uppload",
11 | "navbar": [
12 | "[Docs](/)",
13 | "[Getting started](/getting-started)",
14 | "[Blog](/blog)",
15 | "[GitHub](https://github.com/elninotech/uppload)"
16 | ],
17 | "twitterPublisher": "elninoict",
18 | "scripts": ["/uppload-demo.js"],
19 | "stylesheets": ["/uppload-demo.css", "/assets/demo.css"],
20 | "footerNavbar": ["[Hosted by Netlify](https://netlify.com)"],
21 | "fancyLinks": true
22 | }
23 |
--------------------------------------------------------------------------------
/.stylelintignore:
--------------------------------------------------------------------------------
1 | .history
2 | .husky
3 | .vscode
4 | coverage
5 | dist
6 | node_modules
7 | vite.config.ts
8 | jest.config.ts
9 |
--------------------------------------------------------------------------------
/.stylelintrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | "stylelint-config-recommended",
4 | "stylelint-config-sass-guidelines"
5 | ],
6 | "overrides": [
7 | {
8 | "files": ["**/*.scss"],
9 | "customSyntax": "postcss-scss"
10 | }
11 | ],
12 | "rules": {
13 | "function-parentheses-space-inside": null,
14 | "no-descending-specificity": null,
15 | "max-nesting-depth": 2,
16 | "selector-max-id": 1
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/CNAME:
--------------------------------------------------------------------------------
1 | uppload.netlify.com
2 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # 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 info@elnino.tech or on our [contact page](https://www.elnino.tech/samenwerken). 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 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 El Niño BV
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 |
--------------------------------------------------------------------------------
/assets/blog/cloudinary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/blog/cloudinary.png
--------------------------------------------------------------------------------
/assets/blog/filestack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/blog/filestack.png
--------------------------------------------------------------------------------
/assets/blog/uploadcare.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/blog/uploadcare.png
--------------------------------------------------------------------------------
/assets/blog/v1-demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/blog/v1-demo.gif
--------------------------------------------------------------------------------
/assets/icon-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/icon-dark.png
--------------------------------------------------------------------------------
/assets/icon-dark.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/assets/icon-ph.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/assets/icon-white.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/assets/logo-dark.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/assets/logo-light.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/assets/screenshots/9gag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/9gag.png
--------------------------------------------------------------------------------
/assets/screenshots/artstation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/artstation.png
--------------------------------------------------------------------------------
/assets/screenshots/blur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/blur.png
--------------------------------------------------------------------------------
/assets/screenshots/brightness.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/brightness.png
--------------------------------------------------------------------------------
/assets/screenshots/camera.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/camera.png
--------------------------------------------------------------------------------
/assets/screenshots/contrast.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/contrast.png
--------------------------------------------------------------------------------
/assets/screenshots/crop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/crop.png
--------------------------------------------------------------------------------
/assets/screenshots/deviantart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/deviantart.png
--------------------------------------------------------------------------------
/assets/screenshots/facebook.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/facebook.png
--------------------------------------------------------------------------------
/assets/screenshots/filters.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/filters.png
--------------------------------------------------------------------------------
/assets/screenshots/flickr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/flickr.png
--------------------------------------------------------------------------------
/assets/screenshots/flip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/flip.png
--------------------------------------------------------------------------------
/assets/screenshots/flipboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/flipboard.png
--------------------------------------------------------------------------------
/assets/screenshots/fotki.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/fotki.png
--------------------------------------------------------------------------------
/assets/screenshots/giphy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/giphy.png
--------------------------------------------------------------------------------
/assets/screenshots/grayscale.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/grayscale.png
--------------------------------------------------------------------------------
/assets/screenshots/home-scrolled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/home-scrolled.png
--------------------------------------------------------------------------------
/assets/screenshots/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/home.png
--------------------------------------------------------------------------------
/assets/screenshots/hue-rotate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/hue-rotate.png
--------------------------------------------------------------------------------
/assets/screenshots/instagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/instagram.png
--------------------------------------------------------------------------------
/assets/screenshots/invert.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/invert.png
--------------------------------------------------------------------------------
/assets/screenshots/linkedin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/linkedin.png
--------------------------------------------------------------------------------
/assets/screenshots/local.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/local.png
--------------------------------------------------------------------------------
/assets/screenshots/pexels.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/pexels.png
--------------------------------------------------------------------------------
/assets/screenshots/pinterest.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/pinterest.png
--------------------------------------------------------------------------------
/assets/screenshots/pixabay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/pixabay.png
--------------------------------------------------------------------------------
/assets/screenshots/reddit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/reddit.png
--------------------------------------------------------------------------------
/assets/screenshots/rotate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/rotate.png
--------------------------------------------------------------------------------
/assets/screenshots/saturate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/saturate.png
--------------------------------------------------------------------------------
/assets/screenshots/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/screenshot.png
--------------------------------------------------------------------------------
/assets/screenshots/sepia.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/sepia.png
--------------------------------------------------------------------------------
/assets/screenshots/tumblr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/tumblr.png
--------------------------------------------------------------------------------
/assets/screenshots/twitter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/twitter.png
--------------------------------------------------------------------------------
/assets/screenshots/twtter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/twtter.png
--------------------------------------------------------------------------------
/assets/screenshots/unsplash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/unsplash.png
--------------------------------------------------------------------------------
/assets/screenshots/url.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/url.png
--------------------------------------------------------------------------------
/assets/screenshots/weheartit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/weheartit.png
--------------------------------------------------------------------------------
/assets/screenshots/wip-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/wip-1.png
--------------------------------------------------------------------------------
/assets/screenshots/wip-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/wip-2.png
--------------------------------------------------------------------------------
/assets/screenshots/wip-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/wip-3.png
--------------------------------------------------------------------------------
/assets/screenshots/wip-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/screenshots/wip-4.png
--------------------------------------------------------------------------------
/assets/smo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/smo.png
--------------------------------------------------------------------------------
/assets/uppload.sketch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elninotech/uppload/eeb20d1fc693de5bfb75c8459d4dae47a1b67b79/assets/uppload.sketch
--------------------------------------------------------------------------------
/content/@/anand.md:
--------------------------------------------------------------------------------
1 | ---
2 | linkedin: AnandChowdhary
3 | twitter: AnandChowdhary
4 | github: AnandChowdhary
5 | website: https://anandchowdhary.com
6 | ---
7 |
8 | # Anand Chowdhary
9 |
10 | Anand Chowdhary built Uppload as a consultant to El Niño. He is a creative technologist and entrepreneur, and the co-founder and CEO of Oswald Labs, an award-winning accessibility technology company that builds products for people with disabilities.
11 |
12 |
13 |
14 | He is best known for his work on web accessibility and is also an active open-source contributor. As a developer advocate, he has spoken at 20+ events around the world about startups, technology, and design, and is also a consultant to several startups and studios like El Niño, the developers of Uppload. At El Niño, he was a consultant specializing in frontend engineering and accessibility.
15 |
16 | In April 2018, he made the first commit to Uppload ([56bd930](https://github.com/elninotech/uppload/commit/56bd9307a020c692ed1383f0f4731690c00d90c9)), and in September 2019, to Uppload v2 ([073a091](https://github.com/elninotech/uppload/commit/073a0914ef9026036a2e52ce9c6795404ddefcf5)). Since then, he has been actively managing issues and merging pull requests.
17 |
--------------------------------------------------------------------------------
/content/@/michael.md:
--------------------------------------------------------------------------------
1 | ---
2 | linkedin: magroeneveld
3 | website: https://www.elnino.tech
4 | ---
5 |
6 | # Michael Angelo Groeneveld
7 |
8 | Michael Angelo Groeneveld is the founder of El Niño, the Dutch digital development studio that built Uppload. Always looking for challenges in new and existing projects, Michael also co-founded Stichting Apsara, a non-profit to support charity projects in Cambodia.
9 |
--------------------------------------------------------------------------------
/content/a11y.md:
--------------------------------------------------------------------------------
1 | # Accessibility
2 |
3 | Uppload is designed to be highly accessible. It follows the WCAG specification, uses semantic HTML5 tags, and has first-class keyboard navigation support.
4 |
5 | Some accessibility features include:
6 |
7 | - Radio input-based navbars with keyboard navigation
8 | - Trapped focus when modal is open
9 | - Tabbable native buttons on home
10 | - Use "Escape" key to close modal
11 | - Accessibility Tree-hidden decorative SVGs
12 |
--------------------------------------------------------------------------------
/content/api.md:
--------------------------------------------------------------------------------
1 | # API
2 |
3 | Using the Uppload API, you can programatically control functionality. First, initialize your package, like this:
4 |
5 | ```ts
6 | import { Uppload, Local, xhrUploader, en } from "uppload";
7 |
8 | const uploader = new Uppload({
9 | lang: en,
10 | uploader: xhrUploader({
11 | endpoint: "https://example.com/upload",
12 | }),
13 | });
14 | uploader.use(new Local());
15 | ```
16 |
17 | Now, you're ready to use the API.
18 |
19 | ## Widget manipulation
20 |
21 | You can open, close, or toggle the widget like this:
22 |
23 | ```ts
24 | uppload.open();
25 | uppload.close();
26 | uppload.toggle();
27 | ```
28 |
29 | To get the current state (open or closed), the recommended way is using the `modalOpen()` function:
30 |
31 | ```ts
32 | const isOpen = uppload.modalOpen();
33 | // `isOpen` is true or false
34 | ```
35 |
36 | ## Navigation
37 |
38 | To navigate to a specific service, like Local, you can do this:
39 |
40 | ```ts
41 | uppload.navigate("local");
42 | ```
43 |
44 | ## Uploads
45 |
46 | Lastly, you can also upload a file:
47 |
48 | ```ts
49 | const file = new Blob();
50 |
51 | uppload
52 | .upload(file)
53 | .then(url => {
54 | console.log("Uploaded URL", url);
55 | })
56 | .catch(error => {
57 | console.error("ERR", error);
58 | });
59 | ```
60 |
61 | ## Changing settings
62 |
63 | If you've already initialized the plugin using `new Uppload()`, you can update its settings (such as language) using the following:
64 |
65 | ```ts
66 | uppload.updateSettings({
67 | lang: nl
68 | uploader: aDifferentUploader
69 | });
70 | ```
71 |
72 | ## Updating active plugins
73 |
74 | ### Removing a plugin
75 |
76 | If you want to remove a specific plugin (like a service or effect), use the `remove` function:
77 |
78 | ```ts
79 | uppload.remove("instagram");
80 | uppload.remove("crop");
81 | ```
82 |
83 | ### Updating plugins' list:
84 |
85 | The `updatePlugins` function takes a function as the argument; that function takes an array of active plugins as its argument and returns the plugins to keep.
86 |
87 | For example, you can use the `Array.filter()` function to create a list of active plugins:
88 |
89 | ```ts
90 | uppload.updatePlugins(plugins =>
91 | plugins.filter(plugin => {
92 | plugin.name === "instagram";
93 | })
94 | );
95 | ```
96 |
97 | Or, come up with your own logic that returns a list of plugins:
98 |
99 | ```ts
100 | uppload.updatePlugins(plugins => {
101 | const result = plugins.length > 4 ? [] : plugins;
102 | result.push(new Crop(), new Unsplash());
103 | return result;
104 | });
105 | ```
106 |
107 | ### Removing all plugins
108 |
109 | If you want to reset your Uppload instance's plugins by removing all of them, you can return an empty array in `updatePlugins`:
110 |
111 | ```ts
112 | uppload.updatePlugins(plugins => []);
113 | ```
114 |
--------------------------------------------------------------------------------
/content/backends.md:
--------------------------------------------------------------------------------
1 | # Backends
2 |
3 | By default, Uppload works with any file uploading backend because it sends `FormData`. Uppload does **not** provide the server side implementation of handling the files, but the way files are uploaded is identical to simple file upload forms like this:
4 |
5 | ```html
6 |
9 | ```
10 |
11 | Here are some common backend templates to get your started:
12 |
13 | - [Ruby on Rails](http://guides.rubyonrails.org/form_helpers.html#uploading-files)
14 | - [PHP (Basic)](http://www.startutorial.com/articles/view/how-to-build-a-file-upload-form-using-dropzonejs-and-php)
15 | - [Laravel](http://maxoffsky.com/code-blog/howto-ajax-multiple-file-upload-in-laravel/)
16 | - [Symfony 2 and AWS S3](http://www.jesuisundev.fr/upload-drag-drop-via-dropzonejs-symfony2-on-cloud-amazon-s3/)
17 | - [ASP.NET](https://www.codeproject.com/Articles/874215/File-upload-in-ASP-NET-MVC-using-Dropzone-JS-and-H)
18 | - [ServiceStack](http://www.buildclassifieds.com/2016/01/08/uploading-images-servicestack-and-dropzone/)
19 | - [Golang](https://hackernoon.com/how-to-build-a-file-upload-form-using-dropzonejs-and-go-8fb9f258a991)
20 |
--------------------------------------------------------------------------------
/content/blog/index.md:
--------------------------------------------------------------------------------
1 | # Uppload Blog
2 |
--------------------------------------------------------------------------------
/content/bundle-size.md:
--------------------------------------------------------------------------------
1 | # Bundle size
2 |
3 | ## Compared to v1
4 |
5 | _This section is currently in development._
6 |
7 | | Bundle type | Uppload v1 | Uppload v2 |
8 | | --------------- | ---------- | ------------ |
9 | | Lean build | 39.8 kB | some |
10 | | True build | 59.1 kB | some plugins |
11 | | Full build | 134 kB | 137 kB |
12 | | True full build | 154 kB | 137 kB |
13 |
14 | - In Uppload v1, Lean bundle includes no polyfills; in Uppload v2, it includes no plugins
15 | - Uppload v1 included lazy-loaded components, True builds includes them too
16 | - In Uppload v2, True build includes 6 services and 5 effects, the recommended
17 | - True full builds include all polyfills and plugins
18 | - Uppload v1 included CSS styles while v2 requires loading them separately
19 |
--------------------------------------------------------------------------------
/content/compare.md:
--------------------------------------------------------------------------------
1 | # Compare Uppload
2 |
3 | | Feature | Uploadcare | Dropzone.js | Uppy | Uppload |
4 | | --------------------- | ---------- | ----------- | ---- | ------- |
5 | | Responsive | ✅ | ✅ | ✅ | ✅ |
6 | | Drag and drop | ✅ | ✅ | ✅ | ✅ |
7 | | File previews | ✅ | ✅ | ✅ | ✅ |
8 | | Backend-free | ❌ | ✅ | ❌ | ✅ |
9 | | Import from URL | ✅ | ❌ | ✅ | ✅ |
10 | | TypeScript support | ❌ | ✅ | ✅ | ✅ |
11 | | Import from Instagram | ✅ | ❌ | ✅ | ✅ |
12 | | Import from Facebook | ✅ | ❌ | ✅ | ✅ |
13 | | Search on Unsplash | ❌ | ❌ | ❌ | ✅ |
14 | | Search on Pexels | ❌ | ❌ | ❌ | ✅ |
15 | | Built-in crop | ✅ | ❌ | ❌ | ✅ |
16 | | Built-in filters | ❌ | ❌ | ❌ | ✅ |
17 | | Built-in rotate | ❌ | ❌ | ❌ | ✅ |
18 | | Click photo | ✅ | ❌ | ✅ | ✅ |
19 | | Custom i18n | ❌ | ✅ | ✅ | ✅ |
20 | | Custom backends | ❌ | ✅ | ✅ | ✅ |
21 | | jQuery-free | ❌ | ✅ | ✅ | ✅ |
22 | | Custom plugins | ❌ | ❌ | ✅ | ✅ |
23 | | Upload to Firebase | ❌ | ❌ | ✅ | ✅ |
24 | | Free and open-source | ✅ | ✅ | ✅ | ✅ |
25 |
--------------------------------------------------------------------------------
/content/compression.md:
--------------------------------------------------------------------------------
1 | # Image compression
2 |
3 | To save on bandwidth and storage costs, you may want to upload resized and compressed images by default. If this is the case, you can [configure](/configuration) Uppload to do so:
4 |
5 | ```ts
6 | import { Uppload } from "uppload";
7 |
8 | const uploader = new Uppload({
9 | maxSize: [800, 600],
10 | });
11 | ```
12 |
13 | In the above example, images will be resized to a maximum of 800px in width and 600px in height. You can also specify only one of the two constraints using `maxWidth` or `maxHeight`.
14 |
15 | If you want to apply compression, you can specify the `compression` factor (from 0 to 1), and Uppload will apply a lossy compression before uploading the image. This means that even if users upload a PNG, we will convert it to `image/jpeg` and upload it. Alternately, by specifying the `compressionToMime`, you can use WebP instead of JPEG.
16 |
17 | ```ts
18 | const uploader = new Uppload({
19 | compression: 0.8,
20 | compressionToMime: "image/webp",
21 | });
22 | ```
23 |
24 | If you only want specific file types to be compress, for example only JPEG and WEBP images, but not PNGs, you can use the `compressionFromMimes` property:
25 |
26 | ```ts
27 | const uploader = new Uppload({
28 | compression: 0.8,
29 | compressionFromMimes: ["image/jpeg", "image/webp"],
30 | compressionToMime: "image/webp",
31 | });
32 | ```
33 |
34 | If you want to perform your own image compression, perhaps by using an external library, you can specify a function instead:
35 |
36 | ```ts
37 | const uploader = new Uppload({
38 | compressor: (file: Blob) => {
39 | return new Promise((resolve, reject) => {
40 | // Perform your compression here
41 | resolve(file);
42 | });
43 | },
44 | });
45 | ```
46 |
--------------------------------------------------------------------------------
/content/configuration.md:
--------------------------------------------------------------------------------
1 | # Configuration
2 |
3 | In the following example, the `value` property is used in the configuration object to specify the default image value.
4 |
5 | ```ts
6 | import { Uppload } from "uppload";
7 |
8 | const uploader = new Uppload({
9 | value: "https://example.com/image.jpg",
10 | });
11 | ```
12 |
13 | The keys you can use in the configuration object are:
14 |
15 | | Key | Type | Description |
16 | | ---------------------- | ----------- | ---------------------------------------------------------------------------------- |
17 | | `value` | String | Default/current image URL |
18 | | `bind` | _IElements_ | Set value of these elements |
19 | | `call` | _IElements_ | Clicking on these elements should open modal |
20 | | `defaultService` | String | Default service to open widget on |
21 | | `lang` | Object | [Language pack](/i18n) |
22 | | `uploader` | Function | Function to [upload files](/uploaders) |
23 | | `inline` | Boolean | Show widget inline instead of modal |
24 | | `customClass` | String | Adds an additional class to the container |
25 | | `multiple` | Boolean | Allow multiple file uploads [#59](https://github.com/elninotech/uppload/issues/59) |
26 | | `compression` | Number | Compress image with this factor (0-1) |
27 | | `compressionFromMimes` | String[] | Only compress these types of images |
28 | | `compressionToMime` | String | Type of image to return, `image/jpeg` or `image/webp` |
29 | | `maxWidth` | Number | Resize image to maximum width |
30 | | `maxHeight` | Number | Resize image to maximum height |
31 | | `maxSize` | Number[] | Resize image to maximum \[width, height] |
32 | | `compressor` | Function | Function to [compress files](/compression) |
33 |
34 | \*The _IElements_ type can be any of the following:
35 |
36 | - String (e.g., a query selector like `".image"`)
37 | - String[] (e.g., a query selector array like `[".image", ".img"]`)
38 | - Element (e.g., a DOM element like `document.getElementById("img")`)
39 | - Element[] (e.g., a DOM element array like `[document.createElement("div")]`)
40 | - An array consisting Strings and DOM elements
41 |
--------------------------------------------------------------------------------
/content/effects/crop.md:
--------------------------------------------------------------------------------
1 | # Crop
2 |
3 | The Crop effect lets users crop their images before uploading them. Users can also choose which aspect ratio they want to crop by -- free, square, or 16:9.
4 |
5 | ```ts
6 | import { Uppload, Crop } from "uppload";
7 |
8 | const profilePicture = new Uppload();
9 | profilePicture.use(new Crop());
10 | ```
11 |
12 | You can force the aspect ratio. For example, only allow squares (1:1):
13 |
14 | ```ts
15 | profilePicture.use(
16 | new Crop({
17 | aspectRatio: 1,
18 | })
19 | );
20 | ```
21 |
22 | You can also customize the aspect ratio options given to users. By default, the free aspect ratio has the value `NaN`:
23 |
24 | ```ts
25 | profilePicture.use(
26 | new Crop({
27 | aspectRatioOptions: {
28 | free: NaN,
29 | square: 1,
30 | "16:9": 16 / 9,
31 | },
32 | })
33 | );
34 | ```
35 |
36 | If you don't want users to edit the aspect ratio, you can use the `hideAspectRatioSettings` property. This is the default case if you specify an aspect ratio:
37 |
38 | ```ts
39 | profilePicture.use(
40 | new Crop({
41 | hideAspectRatioSettings: true
42 | );
43 | ```
44 |
45 | 
46 |
--------------------------------------------------------------------------------
/content/effects/filter.md:
--------------------------------------------------------------------------------
1 | # Filter effects
2 |
3 | Filter effects use CSS filters on SVG and allow users to drag an input range to add a filter. Available filter effects are:
4 |
5 | | Service name | Class name |
6 | | ------------ | ------------ |
7 | | Blur | `Blur` |
8 | | Brightness | `Brightness` |
9 | | Contrast | `Contrast` |
10 | | Grayscale | `Grayscale` |
11 | | HueRotate | `HueRotate` |
12 | | Invert | `Invert` |
13 | | Saturate | `Saturate` |
14 | | Sepia | `Sepia` |
15 |
16 | In the following example, we're using the Blur effect is used, but all filter effects have the same usage:
17 |
18 | ```ts
19 | import { Uppload, Blur } from "uppload";
20 |
21 | const profilePicture = new Uppload();
22 | profilePicture.use(new Blur());
23 | ```
24 |
25 | ## Development
26 |
27 | All filter effects are inherited from the `UpploadFilterBaseClass` class, and you can create your own filter effects too:
28 |
29 | ```ts
30 | import { UpploadFilterBaseClass } from "uppload";
31 |
32 | class Brightness extends UpploadFilterBaseClass {
33 | name = "brightness";
34 | icon = "your-svg-icon-string";
35 | cssFilter = "brightness";
36 | unit = "%";
37 | value = 0;
38 | min = 0;
39 | max = 100;
40 | }
41 | ```
42 |
43 | In the above example, the CSS filter applied to the SVG will be `filter: brightness(10%)` if the value is `10`.
44 |
45 | 
46 |
--------------------------------------------------------------------------------
/content/effects/flip.md:
--------------------------------------------------------------------------------
1 | # Flip
2 |
3 | The Flip effect lets users flip their images before uploading them. Users can choose to flip vertically or horizontally.
4 |
5 | ```ts
6 | import { Uppload, Flip } from "uppload";
7 |
8 | const profilePicture = new Uppload();
9 | profilePicture.use(new Flip());
10 | ```
11 |
12 | 
13 |
--------------------------------------------------------------------------------
/content/effects/index.md:
--------------------------------------------------------------------------------
1 | # Effects
2 |
3 | Uppload effects let users edit their images before uploading them. Uppload comes with 10+ effects built-in, and you can pick and choose the ones you'd like to keep. This way, your bundle will be lean and no unnecessary code will be loaded.
4 |
--------------------------------------------------------------------------------
/content/effects/rotate.md:
--------------------------------------------------------------------------------
1 | # Rotate
2 |
3 | The Rotate effect lets users rotate their images before uploading them.
4 |
5 | ```ts
6 | import { Uppload, Rotate } from "uppload";
7 |
8 | const profilePicture = new Uppload();
9 | profilePicture.use(new Rotate());
10 | ```
11 |
12 | 
13 |
--------------------------------------------------------------------------------
/content/examples/index.md:
--------------------------------------------------------------------------------
1 | # Examples
2 |
3 | These are some examples to help you get started with Uppload quickly. [elninotech/uppload-examples](https://github.com/elninotech/uppload-examples) is the monorepository containing them:
4 |
--------------------------------------------------------------------------------
/content/faq.md:
--------------------------------------------------------------------------------
1 | # Frequently Asked Questions
2 |
3 | - [Can there be multiple instances of Uppload on a page?](/multiple-instances)
4 | - [How can I migrate from from Uppload v1.x to v2?](/migrating-from-1x)
5 | - [Can I upload multiple files with Uppload](/multiple-files)
6 | - [How does Uppload compare to Uploadcare or Uppy?](/compare)
7 | - [How do I configure a maximum file size?](/services/local)
8 | - [How do I configure which file types are allowed?](/services/local)
9 |
--------------------------------------------------------------------------------
/content/getting-started.md:
--------------------------------------------------------------------------------
1 | # Getting started
2 |
3 | Uppload 2 lets you build a custom Uppload package to make sure you only bundle the code you actually need. To get started, add Uppload to your project:
4 |
5 | ```bash
6 | npm install uppload
7 | ```
8 |
9 | Most commonly, you'd want to add the drag-and-drop and file select service (known as [Local](/services/local)), along with the [XHR Uploader](/uploaders/xhr) which will send an HTTP POST request to your backend.
10 |
11 | Then, you can initialize your plugin with these plugins and your language of choice. In this example, we're also adding the "Import from Instagram" service:
12 |
13 | ```ts
14 | import { Uppload, Local, Instagram, xhrUploader, en } from "uppload";
15 |
16 | const uploader = new Uppload({
17 | lang: en,
18 | uploader: xhrUploader({
19 | endpoint: "https://example.com/upload",
20 | }),
21 | });
22 | uploader.use([new Local(), new Instagram()]);
23 | ```
24 |
25 | You should also include the styles required for Uppload. You can use a bundler like Webpack and import it in Sass, or directly import it your HTML. You need to import `uppload.css` and a [theme](/themes):
26 |
27 | ```scss
28 | @import "uppload/dist/uppload.css";
29 | @import "uppload/dist/themes/light.css";
30 | ```
31 |
32 | Now, let's say you have an HTML webpage like the following. Here, we have a `