From 7b1da97b25fd29aa839c4cf32542c8f783c086ef Mon Sep 17 00:00:00 2001 From: mlshvdv Date: Wed, 14 Sep 2022 14:47:15 +0300 Subject: [PATCH] feat: add 1.0.0 version --- .babelrc | 11 + .eslintrc | 10 + .github/workflows/npm-publish.yml | 22 + .gitignore | 6 + .npmignore | 7 + .yarnrc.yml | 1 + LICENSE | 21 + README.md | 287 + dev/.tmp/.gitignore | 2 + dev/server.js | 200 + example/assets/demo.css | 190 + example/assets/json-preview.js | 45 + example/index.html | 179 + package.json | 49 + src/index.js | 418 ++ src/index.scss | 198 + src/svg/background.svg | 1 + src/svg/border.svg | 1 + src/svg/button-icon.svg | 3 + src/svg/stretched.svg | 1 + src/svg/toolbox.svg | 1 + src/tunes.js | 120 + src/ui.js | 348 ++ src/uploader.js | 187 + webpack.config.js | 51 + yarn.lock | 8083 +++++++++++++++++++++++++++++ 26 files changed, 10442 insertions(+) create mode 100644 .babelrc create mode 100644 .eslintrc create mode 100644 .github/workflows/npm-publish.yml create mode 100644 .gitignore create mode 100644 .npmignore create mode 100644 .yarnrc.yml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 dev/.tmp/.gitignore create mode 100644 dev/server.js create mode 100644 example/assets/demo.css create mode 100644 example/assets/json-preview.js create mode 100644 example/index.html create mode 100644 package.json create mode 100644 src/index.js create mode 100644 src/index.scss create mode 100644 src/svg/background.svg create mode 100644 src/svg/border.svg create mode 100644 src/svg/button-icon.svg create mode 100644 src/svg/stretched.svg create mode 100644 src/svg/toolbox.svg create mode 100644 src/tunes.js create mode 100644 src/ui.js create mode 100644 src/uploader.js create mode 100644 webpack.config.js create mode 100644 yarn.lock diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..e992492 --- /dev/null +++ b/.babelrc @@ -0,0 +1,11 @@ +{ + "presets": [ + ["@babel/preset-env", { + "modules": "umd", + "useBuiltIns": "entry" + }] + ], + "plugins": [ + "@babel/plugin-transform-runtime" + ] +} diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..b5b67a5 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,10 @@ +{ + "extends": [ + "codex" + ], + "globals": { + "fetch": true, + "ImageConfig": true, + "ImageToolData": true + } +} diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..f0554d8 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,22 @@ +name: Publish package to NPM + +on: + push: + branches: + - master + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + scope: 'mlshvdv' + - run: yarn + - run: yarn build + - run: yarn publish --access=public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2f1b939 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +node_modules/* +npm-debug.log +.idea/ +.DS_Store +dist +.yarn/ diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..6f5da4d --- /dev/null +++ b/.npmignore @@ -0,0 +1,7 @@ +.idea/ +dev/ +src/ +.babelrc +.eslintrc +webpack.config.js +yarn.lock diff --git a/.yarnrc.yml b/.yarnrc.yml new file mode 100644 index 0000000..3186f3f --- /dev/null +++ b/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..aed212d --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 СodeX + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..4f63ebc --- /dev/null +++ b/README.md @@ -0,0 +1,287 @@ +![](https://badgen.net/badge/Editor.js/v2.0/blue) + +# Image List Tool + +Image List Block for the [Editor.js](https://editorjs.io). + +![](https://capella.pics/63a03d04-3816-45b2-87b2-d85e556f0066.jpg) + +## Features + +- Uploading file from the device +- Pasting copied content from the web +- Pasting images by drag-n-drop +- Pasting files and screenshots from Clipboard +- Allows adding a border, and a background +- Allows stretching an image to the container's full-width + +**Notes** + +This Tool requires server-side implementation for the file uploading. See [backend response format](#server-format) for more details. + +This Tool is also capable of uploading & displaying video files using the