├── .eslintrc ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ ├── build.yml │ ├── codeql-analysis.yml │ └── pull-request.yml ├── .gitignore ├── .husky ├── .gitignore ├── commit-msg └── pre-push ├── LICENSE ├── README.md ├── assets ├── logo.png └── logo.svg ├── babel.config.js ├── build └── global.ts ├── commitlint.config.js ├── cypress.config.ts ├── cypress ├── assets │ ├── cat.jpg │ └── cat.small.jpg ├── e2e │ ├── crop │ │ └── crop.cy.ts │ ├── draw │ │ └── shapes │ │ │ ├── arrow.cy.ts │ │ │ ├── background.cy.ts │ │ │ ├── circle.cy.ts │ │ │ ├── ellipse.cy.ts │ │ │ ├── line.cy.ts │ │ │ ├── pencil.cy.ts │ │ │ ├── polygon.cy.ts │ │ │ ├── rect.cy.ts │ │ │ └── triangle.cy.ts │ ├── rotation │ │ └── rotation.cy.ts │ └── selection │ │ └── selection.cy.ts ├── fixtures │ └── lib.json ├── plugins │ └── index.js ├── support │ ├── commands.js │ ├── e2e.js │ ├── index.d.ts │ └── utils │ │ ├── draw.ts │ │ ├── get-editor.ts │ │ ├── load-asset.ts │ │ ├── load-image.ts │ │ └── mouse-trigger.ts └── tsconfig.json ├── jest.config.ts ├── jest ├── fixtures │ └── json-exported.json ├── setup.ts └── utils │ ├── create-editor │ └── index.ts │ ├── create-element │ └── index.ts │ └── create-shapes │ └── index.ts ├── package-lock.json ├── package.json ├── rollup.config.js ├── src ├── Background │ └── index.ts ├── Board │ └── index.ts ├── Cropper │ ├── BaseCropper │ │ └── index.ts │ ├── FixedCircularCropper │ │ └── index.ts │ ├── FixedCropper │ │ └── index.ts │ ├── FixedRectangleCropper │ │ └── index.ts │ ├── FlexibleCircularCropper │ │ └── index.ts │ ├── FlexibleCropper │ │ └── index.ts │ ├── FlexibleRectangleCropper │ │ └── index.ts │ └── index.ts ├── Events │ ├── index.test.ts │ └── index.ts ├── Export │ ├── Image │ │ └── index.ts │ ├── Json │ │ └── index.ts │ └── index.ts ├── Filter │ └── index.ts ├── Flip │ └── index.ts ├── History │ ├── index.test.ts │ └── index.ts ├── Import │ └── index.ts ├── Rotation │ └── index.ts ├── Selection │ └── index.ts ├── SnapGrid │ └── index.ts ├── Tag │ └── index.ts ├── constants │ └── index.ts ├── defaultSettings.ts ├── grouping │ ├── Groups │ │ └── index.ts │ └── GroupsManager │ │ └── index.ts ├── index.all.ts ├── index.node.all.ts ├── index.ts ├── shape │ ├── ShapeDrawer │ │ └── index.ts │ ├── ShapeModel │ │ └── index.ts │ ├── drawers │ │ ├── ArrowDrawer │ │ │ └── index.ts │ │ ├── CircleDrawer │ │ │ └── index.ts │ │ ├── EllipseDrawer │ │ │ └── index.ts │ │ ├── ImageDrawer │ │ │ └── index.ts │ │ ├── LabelDrawer │ │ │ └── index.ts │ │ ├── LineDrawer │ │ │ └── index.ts │ │ ├── PencilDrawer │ │ │ └── index.ts │ │ ├── PolygonDrawer │ │ │ └── index.ts │ │ ├── RectDrawer │ │ │ └── index.ts │ │ ├── SvgDrawer │ │ │ └── index.ts │ │ ├── TextDrawer │ │ │ └── index.ts │ │ └── TriangleDrawer │ │ │ └── index.ts │ └── models │ │ ├── ArrowModel │ │ └── index.ts │ │ ├── CircleModel │ │ └── index.ts │ │ ├── EllipseModel │ │ └── index.ts │ │ ├── GroupModel │ │ └── index.ts │ │ ├── ImageModel │ │ └── index.ts │ │ ├── LabelModel │ │ └── index.ts │ │ ├── LineModel │ │ └── index.ts │ │ ├── PolygonModel │ │ └── index.ts │ │ ├── RectModel │ │ └── index.ts │ │ ├── SvgModel │ │ └── index.ts │ │ ├── TextModel │ │ └── index.ts │ │ └── TriangleModel │ │ └── index.ts ├── types │ ├── background.ts │ ├── common.ts │ ├── cropper.ts │ ├── drawing.ts │ ├── events.ts │ ├── export.ts │ ├── filters.ts │ ├── group.ts │ ├── history.ts │ ├── index.ts │ ├── settings.ts │ ├── shapes.ts │ └── snap-grid.ts └── utils │ ├── create-image-from-url │ └── index.ts │ ├── degree-to-radian │ ├── index.test.ts │ └── index.ts │ ├── detect-environment │ └── index.ts │ ├── get-center-point │ ├── index.test.ts │ └── index.ts │ ├── get-points-distance │ ├── index.test.ts │ └── index.ts │ ├── get-rotated-point │ ├── index.test.ts │ └── index.ts │ ├── html-to-text │ ├── index.test.ts │ └── index.ts │ ├── image-to-url │ ├── index.test.ts │ └── index.ts │ ├── merge-settings │ ├── index.test.ts │ └── index.ts │ ├── omit │ ├── index.test.ts │ └── index.ts │ └── rotate-around-center │ ├── index.test.ts │ └── index.ts ├── tests └── integration │ ├── background │ └── index.test.ts │ ├── crop │ └── index.test.ts │ ├── export │ └── index.test.ts │ ├── filter │ └── index.test.ts │ ├── flip │ └── index.test.ts │ ├── grouping │ ├── grouping-core.test.ts │ ├── grouping-flip.test.ts │ ├── grouping-history.test.ts │ └── grouping-rotation.test.ts │ ├── import │ └── index.test.ts │ ├── node-env │ └── index.test.ts │ ├── rotation │ └── index.test.ts │ ├── selection │ └── index.test.ts │ ├── shapes │ ├── image │ │ └── index.test.ts │ ├── label │ │ └── index.test.ts │ └── triangle │ │ └── index.test.ts │ ├── snap-grid │ └── index.test.ts │ └── tag │ └── index.test.ts ├── tsconfig.json └── typedoc.json /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es2020": true 5 | }, 6 | "extends": [ 7 | "prettier", 8 | "plugin:prettier/recommended", 9 | "plugin:import/errors", 10 | "plugin:import/warnings", 11 | "plugin:import/typescript" 12 | ], 13 | "parser": "@typescript-eslint/parser", 14 | "parserOptions": { 15 | "ecmaFeatures": {}, 16 | "ecmaVersion": 11, 17 | "sourceType": "module" 18 | }, 19 | "plugins": [ 20 | "import", 21 | "prettier", 22 | "@typescript-eslint" 23 | ], 24 | "settings": { 25 | "import/resolver": { 26 | "node": { 27 | "import/extensions": [ 28 | ".js", 29 | ".ts", 30 | ".d.ts", 31 | ".json" 32 | ] 33 | }, 34 | "typescript": {} 35 | } 36 | }, 37 | "rules": { 38 | "prettier/prettier": [ 39 | "error", 40 | { 41 | "semi": false, 42 | "singleQuote": true, 43 | "printWidth": 80, 44 | "trailingComma": "none", 45 | "arrowParens": "avoid", 46 | "endOfLine": "auto" 47 | } 48 | ], 49 | "import/prefer-default-export": "off", 50 | "import/extensions": "off", 51 | "import/no-unresolved": [ 52 | 2, 53 | { 54 | "commonjs": true, 55 | "amd": true 56 | } 57 | ], 58 | "no-shadow": "off", 59 | "no-underscore-dangle": "off", 60 | "import/no-extraneous-dependencies": "off", 61 | "no-console": "off", 62 | "func-names": "off", 63 | "import/named": 2, 64 | "import/namespace": 2, 65 | "import/default": 2, 66 | "import/export": 2, 67 | "@typescript-eslint/member-ordering": [ 68 | 2, 69 | {} 70 | ], 71 | "import/order": [ 72 | "error", 73 | { 74 | "newlines-between": "always-and-inside-groups", 75 | "groups": [ 76 | "builtin", 77 | "external", 78 | "internal", 79 | [ 80 | "sibling", 81 | "parent" 82 | ], 83 | "index" 84 | ] 85 | } 86 | ] 87 | }, 88 | "overrides": [ 89 | { 90 | "files": [ 91 | "**/*.ts", 92 | "**/*.tsx" 93 | ], 94 | "rules": { 95 | "no-unused-vars": [ 96 | "off" 97 | ], 98 | "no-undef": [ 99 | "off" 100 | ], 101 | "@typescript-eslint/no-unused-vars": [ 102 | 2, 103 | { 104 | "args": "none" 105 | } 106 | ] 107 | } 108 | }, 109 | { 110 | "files": [ 111 | "**/*.d.ts" 112 | ] 113 | } 114 | ] 115 | } -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: https://revolut.me/raminmo 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: raminious 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **How To Reproduce** 14 | Provide the steps to reproduce the bug. 15 | 16 | **Expected behavior** 17 | A clear and concise description of what you expected to happen. 18 | 19 | **Screenshots** 20 | If applicable, add screenshots or a short video recording to help explain your problem. 21 | 22 | **Additional context** 23 | Add any other context about the problem here. 24 | 25 | **Version** 26 | Specify the version. 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: feature 6 | assignees: raminious 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. 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/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Test/Build/Publish 2 | on: 3 | push: 4 | branches: [ master ] 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | - uses: actions/setup-node@v1 11 | with: 12 | node-version: 18 13 | - run: npm install 14 | - run: npm run typecheck 15 | - run: npm test 16 | - run: npm run build 17 | - run: npm run coverage 18 | - uses: JS-DevTools/npm-publish@v1 19 | with: 20 | token: ${{ secrets.NPM_TOKEN }} 21 | - uses: actions/upload-artifact@v2 22 | with: 23 | name: Pikaso Bundles 24 | path: | 25 | umd 26 | lib 27 | esm 28 | - uses: codacy/codacy-coverage-reporter-action@v1 29 | with: 30 | name: Codacy Coverage Reporter 31 | coverage-reports: coverage/lcov.info 32 | project-token: ${{ secrets.CODACY_TOKEN }} -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | on: 3 | push: 4 | branches: [ master ] 5 | pull_request: 6 | branches: [ master ] 7 | schedule: 8 | - cron: '18 0 * * 3' 9 | jobs: 10 | analyze: 11 | name: Analyze 12 | runs-on: ubuntu-latest 13 | strategy: 14 | fail-fast: false 15 | matrix: 16 | language: [ 'javascript' ] 17 | steps: 18 | - name: Checkout repository 19 | uses: actions/checkout@v2 20 | - name: Initialize CodeQL 21 | uses: github/codeql-action/init@v1 22 | with: 23 | languages: ${{ matrix.language }} 24 | - name: Autobuild 25 | uses: github/codeql-action/autobuild@v1 26 | - name: Perform CodeQL Analysis 27 | uses: github/codeql-action/analyze@v1 28 | -------------------------------------------------------------------------------- /.github/workflows/pull-request.yml: -------------------------------------------------------------------------------- 1 | name: Pull Request 2 | on: 3 | pull_request: 4 | branches: [ master ] 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | - uses: actions/setup-node@v1 11 | with: 12 | node-version: 14 13 | - run: npm install 14 | - run: npm run typecheck 15 | - run: npm test 16 | - run: npm run build -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .cache/ 3 | .nyc_output 4 | coverage/ 5 | dist/* 6 | !dist/index.html 7 | node_modules/ 8 | *.log 9 | lib 10 | cjs 11 | esm 12 | es 13 | umd 14 | cypress/videos 15 | instrumented 16 | coverage 17 | api 18 | 19 | 20 | # OS generated files 21 | .DS_Store 22 | .DS_Store? 23 | ._* 24 | .Spotlight-V100 25 | .Trashes 26 | ehthumbs.db 27 | Thumbs.db 28 | pikaso.min.js 29 | -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname $0)/_/husky.sh" 3 | 4 | npm run commitlint -- --edit $1 -------------------------------------------------------------------------------- /.husky/pre-push: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname $0)/_/husky.sh" 3 | 4 | npm run typecheck && npm test -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Ramin 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 |
Seamless, Fully-typed and Fully-tested HTML5 Canvas Library
8 | Learn more » 9 |