├── .github └── FUNDING.yml ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── CoCreate.config.js ├── LICENSE ├── README.md ├── demo └── CoCreate-checkout.html ├── docs └── index.html ├── package.json ├── release.config.js └── webpack.config.js /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: CoCreate-app 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # ignore 2 | node_modules 3 | dist 4 | .npmrc 5 | yarn.lock 6 | 7 | logs 8 | *.log 9 | npm-debug.log* 10 | yarn-debug.log* 11 | yarn-error.log* 12 | lerna-debug.log* 13 | .pnpm-debug.log* 14 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to CoCreate-checkout 2 | 3 | This project is work of [many contributors](https://github.com/CoCreate-app/CoCreate-checkout/graphs/contributors). 4 | You're encouraged to submit [pull requests](https://github.com/CoCreate-app/CoCreate-checkout/pulls), 5 | [propose features and discuss issues](https://github.com/CoCreate-app/CoCreate-checkout/issues). 6 | 7 | In the examples below, substitute your Github username for `contributor` in URLs. 8 | 9 | ## Fork the Project 10 | 11 | Fork the [project on Github](https://github.com/CoCreate-app/CoCreate-checkout) and check out your copy. 12 | 13 | ``` 14 | git checkout https://github.com/contributor/CoCreate-checkout.git 15 | cd CoCreate-checkout 16 | git remote add upstream https://github.com/CoCreate-app/CoCreate-checkout.git 17 | ``` 18 | 19 | ## Create a Topic Branch 20 | 21 | Make sure your fork is up-to-date and create a topic branch for your feature or bug fix on dev branch. 22 | 23 | ``` 24 | git checkout dev 25 | git pull upstream dev 26 | git checkout -b my-feature-branch 27 | ``` 28 | 29 | ## Write Tests 30 | 31 | Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build. 32 | 33 | We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix. 34 | 35 | ## Write Code 36 | 37 | Implement your feature or bug fix. 38 | 39 | ## Write Documentation 40 | 41 | Document any external behavior in the [README](README.md). 42 | 43 | ## Commit Changes 44 | 45 | Make sure git knows your name and email address: 46 | 47 | ``` 48 | git config --global user.name "Your Name" 49 | git config --global user.email "contributor@example.com" 50 | ``` 51 | 52 | We use [semantic-release](https://github.com/semantic-release/semantic-release) as process to generate changelog 53 | and to release. Write meaningful commits according to 54 | [Commit Message Formats](https://github.com/semantic-release/semantic-release#commit-message-format) is important. 55 | 56 | ``` 57 | git add ... 58 | git commit -am "commit-type(optional topic): a meaningful message" 59 | ``` 60 | 61 | Here is an example of the release type that should be done based on a [semantic-release](https://github.com/semantic-release/semantic-release): 62 | 63 | | Commit message | Release type | 64 | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- | 65 | | `fix(pencil): stop graphite breaking when too much pressure applied` | Patch Release | 66 | | `feat(pencil): add 'graphiteWidth' option` | ~~Minor~~ Feature Release | 67 | | `perf(pencil): remove graphiteWidth option`

`BREAKING CHANGE: The graphiteWidth option has been removed.`
`The default graphite width of 10mm is always used for performance reasons.` | ~~Major~~ Breaking Release | 68 | 69 | 70 | ## Push 71 | 72 | ``` 73 | git push origin my-feature-branch 74 | ``` 75 | 76 | ## Make a Pull Request 77 | 78 | Go to [https://github.com/CoCreate-app/CoCreate-checkout](https://github.com/CoCreate-app/CoCreate-checkout) and select your feature branch. 79 | Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days. 80 | 81 | ## Rebase 82 | 83 | If you've been working on a change for a while, rebase with upstream/dev. 84 | 85 | ``` 86 | git fetch upstream 87 | git rebase upstream/dev 88 | git push origin my-feature-branch -f 89 | ``` 90 | 91 | ## Be Patient 92 | 93 | It's likely that your change will not be merged and that the nitpicky maintainers will ask you to do more, or fix seemingly benign problems. Hang in there! 94 | 95 | ## Thank You 96 | 97 | Please do know that we really appreciate and value your time and work. We love you, really. -------------------------------------------------------------------------------- /CoCreate.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "config": { 3 | "apiKey": "2061acef-0451-4545-f754-60cf8160", 4 | "organization_Id": "5ff747727005da1c272740ab", 5 | "host": "general.cocreate.app" 6 | }, 7 | 8 | "sources": [{ 9 | "entry": "./docs/index.html", 10 | "collection": "files", 11 | "document_id": "6020cd7fb526e5753d0ecb7b", 12 | "key": "src", 13 | "data":{ 14 | "name": "index.html", 15 | "path": "/docs/checkout/index.html", 16 | "domains": [ 17 | "cocreate.app", 18 | "general.cocreate.app" 19 | ], 20 | "directory": "/docs/checkout", 21 | "content-type": "text/html", 22 | "public": "true", 23 | "website_id": "614298c2829b690010a5c031" 24 | } 25 | } 26 | ], 27 | 28 | "extract": { 29 | "directory": "./src/", 30 | "extensions": [ 31 | "js", 32 | "css", 33 | "html" 34 | ], 35 | "ignores": [ 36 | "node_modules", 37 | "vendor", 38 | "bower_components", 39 | "archive" 40 | ] 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 CoCreate LLC 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 | # CoCreate-checkout 2 | 3 | A simple checkout component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API. Take it for a spin in our [playground!](https://cocreate.app/docs/checkout) 4 | 5 | ![GitHub file size in bytes](https://img.shields.io/github/size/CoCreate-app/CoCreate-checkout/dist/CoCreate-checkout.min.js?label=minified%20size&style=for-the-badge) 6 | ![GitHub latest release](https://img.shields.io/github/v/release/CoCreate-app/CoCreate-checkout?style=for-the-badge) 7 | ![GitHub](https://img.shields.io/github/license/CoCreate-app/CoCreate-checkout?style=for-the-badge) 8 | ![GitHub labels](https://img.shields.io/github/labels/CoCreate-app/CoCreate-checkout/help%20wanted?style=for-the-badge) 9 | 10 | ![CoCreate-checkout](https://cdn.cocreate.app/docs/CoCreate-checkout.gif) 11 | 12 | ## [Docs & Demo](https://cocreate.app/docs/checkout) 13 | 14 | For a complete guide and working demo refer to the [doumentation](https://cocreate.app/docs/checkout) 15 | 16 | ## CDN 17 | 18 | ```html 19 | 20 | ``` 21 | 22 | ```html 23 | 24 | ``` 25 | 26 | ## NPM 27 | 28 | ```shell 29 | $ npm install @cocreate/checkout 30 | ``` 31 | 32 | # Table of Contents 33 | 34 | - [Table of Contents](#table-of-contents) 35 | - [Announcements](#announcements) 36 | - [Roadmap](#roadmap) 37 | - [How to Contribute](#how-to-contribute) 38 | - [About](#about) 39 | - [License](#license) 40 | 41 | 42 | 43 | # Announcements 44 | 45 | All updates to this library are documented in our [CHANGELOG](https://github.com/CoCreate-app/CoCreate-checkout/blob/master/CHANGELOG.md) and [releases](https://github.com/CoCreate-app/CoCreate-checkout/releases). You may also subscribe to email for releases and breaking changes. 46 | 47 | 48 | 49 | # Roadmap 50 | 51 | If you are interested in the future direction of this project, please take a look at our open [issues](https://github.com/CoCreate-app/CoCreate-checkout/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-checkout/pulls). We would love to hear your feedback. 52 | 53 | 54 | 55 | # About 56 | 57 | CoCreate-checkout is guided and supported by the CoCreate Developer Experience Team. 58 | 59 | Please Email the Developer Experience Team [here](mailto:develop@cocreate.app) in case of any queries. 60 | 61 | CoCreate-checkout is maintained and funded by CoCreate. The names and logos for CoCreate are trademarks of CoCreate, LLC. 62 | 63 | 64 | 65 | # How to Contribute 66 | 67 | We encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](https://github.com/CoCreate-app/CoCreate-checkout/blob/master/CONTRIBUTING.md) guide for details. 68 | 69 | We want this library to be community-driven, and CoCreate led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/CoCreate-app/CoCreate-checkout/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-checkout/pulls) or merely upvote or comment on existing issues or pull requests. 70 | 71 | We appreciate your continued support, thank you! 72 | 73 | # License 74 | 75 | [The MIT License (MIT)](https://github.com/CoCreate-app/CoCreate-checkout/blob/master/LICENSE) 76 | -------------------------------------------------------------------------------- /demo/CoCreate-checkout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Shopping Cart 4 | 246 | 247 | 248 |

Shopping Cart

249 | 250 |
251 |
252 | 253 | 254 | 255 | 256 | 257 | 258 |
259 |
260 |
261 | 262 |
263 |
264 |
Dingo Dog Bones
265 |

The best dog bones of all time. Holy crap. Your dog will be begging for these things! I got curious once and ate one myself. I'm a fan.

266 |
267 |
12.99
268 |
269 | 270 |
271 | 272 |
273 | 274 |
275 |
25.98
276 |
277 |
278 |
279 | 280 |
281 |
282 |
Nutro™ Adult Lamb and Rice Dog Food
283 |

Who doesn't like lamb and rice? We've all hit the halal cart at 3am while quasi-blackout after a night of binge drinking in Manhattan. Now it's your dog's turn!

284 |
285 |
45.99
286 |
287 | 288 |
289 |
290 | 291 |
292 |
45.99
293 |
294 |
295 |
296 | 297 |
71.97
298 |
299 |
300 | 301 |
3.60
302 |
303 |
304 | 305 |
15.00
306 |
307 |
308 | 309 |
90.57
310 |
311 |
312 | 313 |
314 | 315 | 394 | 395 | 396 | 397 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | CoCreate-checkout Documentation | CoCreateJS 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
32 |
33 |
34 |

CoCreate-checkout

35 |
36 |
37 | 38 | 39 | 40 | 41 | 42 |
43 |
44 |

A simple HTML5, CSS and pure javascript component. Easy configuration using data-attributes and highly styleable. 45 |

46 |
47 | 48 |

Install

49 |
npm install cocreate-checkout
50 |

Or you can use cdn link:

51 |
https://cdn.cocreate.app/CoCreate-checkout.min.js
52 | 53 |

Usage

54 |
55 |

This is checkout reference

56 | 57 |
58 |
 59 |                                 <div></div>
 60 |                             
61 |
62 |

This is checkout reference

63 |

This is checkout reference

64 |
65 |

Attributes

66 |
    67 |
  • 68 |

    checkout string optional

    69 |

    checkout-attribute

    70 |
  • 71 |
  • 72 |

    checkout string optional

    73 |

    checkout-attribute

    74 |
  • 75 |
76 |
77 | 78 |
79 | 80 |

Demo

81 |
82 |
83 |
84 | 85 | 86 | 87 | 98 | 99 | 100 | 101 |
102 | 103 |
104 | 105 |
106 | 107 |
108 |
114 |
115 |
116 |
117 | 118 |
119 | 120 |
121 | 122 |
123 |
124 |
125 | 126 |
127 |
128 | 129 |
130 |
131 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@cocreate/checkout", 3 | "version": "1.0.0", 4 | "description": "A simple checkout component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.", 5 | "keywords": [ 6 | "checkout", 7 | "cocreate", 8 | "low-code-framework", 9 | "no-code-framework", 10 | "cocreatejs", 11 | "cocreatejs-component", 12 | "cocreate-framework", 13 | "no-code", 14 | "low-code", 15 | "collaborative-framework", 16 | "realtime", 17 | "realtime-framework", 18 | "collaboration", 19 | "shared-editing", 20 | "html5-framework", 21 | "javascript-framework" 22 | ], 23 | "publishConfig": { "access": "public" }, 24 | "scripts": { 25 | "start": "npx webpack --config webpack.config.js", 26 | "build": "NODE_ENV=production npx webpack --config webpack.config.js", 27 | "dev": "npx webpack --config webpack.config.js --watch", 28 | "docs": "node ./node_modules/@cocreate/docs/src/index.js" 29 | }, 30 | "repository": { 31 | "type": "git", 32 | "url": "git+https://github.com/CoCreate-app/CoCreate-checkout.git" 33 | }, 34 | "author": "CoCreate LLC", 35 | "license": "MIT", 36 | "bugs": { "url": "https://github.com/CoCreate-app/CoCreate-checkout/issues" }, 37 | "homepage": "https://cocreate.app/docs/checkout", 38 | "funding": { 39 | "type": "GitHub Sponsors ❤", 40 | "url": "https://github.com/sponsors/CoCreate-app" 41 | }, 42 | "main": "./src/index.js", 43 | "devDependencies": { 44 | "@babel/core": "^7.9.6", 45 | "@babel/preset-env": "^7.9.6", 46 | "babel-loader": "^8.1.0", 47 | "clean-webpack-plugin": "^3.0.0", 48 | "html-webpack-plugin": "^4.5.0", 49 | "uglifyjs-webpack-plugin": "^2.2.0", 50 | "webpack": "^5.24.4", 51 | "webpack-cli": "^4.5.0", 52 | "webpack-log": "^3.0.1", 53 | "file-loader": "^6.2.0", 54 | "style-loader": "^2.0.0", 55 | "terser-webpack-plugin": "^5.1.1" 56 | }, 57 | "dependencies": { "@cocreate/docs": "^1.0.3" } 58 | } 59 | -------------------------------------------------------------------------------- /release.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | dryRun: false, 3 | branches: ["master"], 4 | plugins: [ 5 | "@semantic-release/commit-analyzer", 6 | "@semantic-release/release-notes-generator", 7 | [ 8 | "@semantic-release/changelog", 9 | { 10 | changelogFile: "CHANGELOG.md", 11 | }, 12 | ], 13 | "@semantic-release/npm", 14 | "@semantic-release/github", 15 | [ 16 | "@semantic-release/git", 17 | { 18 | assets: ["CHANGELOG.md", "package.json"], 19 | }, 20 | ], 21 | ], 22 | }; -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require("path") 2 | const TerserPlugin = require("terser-webpack-plugin") 3 | const MiniCssExtractPlugin = require("mini-css-extract-plugin") 4 | let isProduction = process.env.NODE_ENV === "production" 5 | const { CleanWebpackPlugin } = require("clean-webpack-plugin") 6 | 7 | module.exports = { 8 | entry: { 9 | "CoCreate-checkout": "./src/CoCreate-checkout.js", 10 | }, 11 | output: { 12 | path: path.resolve(__dirname, "dist"), 13 | filename: isProduction ? "[name].min.js" : "[name].js", 14 | libraryTarget: "umd", 15 | libraryExport: "default", 16 | library: ["CoCreate", "checkout"], 17 | globalObject: "this", 18 | // publicPath: 'https://server.cocreate.app/CoCreateJS/dist/' 19 | }, 20 | 21 | plugins: [ 22 | new CleanWebpackPlugin(), 23 | new MiniCssExtractPlugin({ 24 | filename: "[name].css", 25 | }), 26 | ], 27 | // Default mode for Webpack is production. 28 | // Depending on mode Webpack will apply different things 29 | // on final bundle. For now we don't need production's JavaScript 30 | // minifying and other thing so let's set mode to development 31 | mode: isProduction ? "production" : "development", 32 | module: { 33 | rules: [ 34 | { 35 | test: /.js$/, 36 | exclude: /(node_modules)/, 37 | use: { 38 | loader: "babel-loader", 39 | options: { 40 | plugins: ["@babel/plugin-transform-modules-commonjs"], 41 | }, 42 | }, 43 | }, 44 | { 45 | test: /.css$/i, 46 | use: [ 47 | { loader: "style-loader", options: { injectType: "linkTag" } }, 48 | "file-loader", 49 | ], 50 | }, 51 | ], 52 | }, 53 | 54 | // add source map 55 | ...(isProduction ? {} : { devtool: "eval-source-map" }), 56 | 57 | optimization: { 58 | minimize: true, 59 | minimizer: [ 60 | new TerserPlugin({ 61 | extractComments: true, 62 | // cache: true, 63 | parallel: true, 64 | // sourceMap: true, // Must be set to true if using source-maps in production 65 | terserOptions: { 66 | // https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions 67 | // extractComments: 'all', 68 | compress: { 69 | drop_console: true, 70 | }, 71 | }, 72 | }), 73 | ], 74 | splitChunks: { 75 | chunks: "all", 76 | minSize: 200, 77 | // maxSize: 99999, 78 | //minChunks: 1, 79 | 80 | cacheGroups: { 81 | defaultVendors: false, 82 | }, 83 | }, 84 | }, 85 | } 86 | --------------------------------------------------------------------------------