grapesjs-component-countdown
Advanced tools
Comparing version 0.1.3 to 1.0.1
{ | ||
"name": "grapesjs-component-countdown", | ||
"version": "0.1.3", | ||
"version": "1.0.1", | ||
"description": "Simple countdown component for the GrapesJS Editor", | ||
"main": "dist/grapesjs-component-countdown.min.js", | ||
"main": "dist/index.js", | ||
"files": [ | ||
"dist/" | ||
], | ||
"scripts": { | ||
"lint": "eslint src", | ||
"build": "npm run v:patch && webpack --env.production", | ||
"v:patch": "npm version --no-git-tag-version patch", | ||
"start": "webpack-dev-server --open --progress --colors" | ||
"build": "grapesjs-cli build", | ||
"start": "grapesjs-cli serve" | ||
}, | ||
@@ -25,23 +26,6 @@ "repository": { | ||
"license": "BSD-3-Clause", | ||
"babel": { | ||
"presets": [ | ||
"env" | ||
], | ||
"plugins": [ | ||
"transform-object-rest-spread" | ||
] | ||
}, | ||
"peerDependencies": { | ||
"grapesjs": "0.x" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.26.0", | ||
"babel-loader": "^7.1.2", | ||
"babel-plugin-transform-object-rest-spread": "^6.26.0", | ||
"babel-preset-env": "^1.6.1", | ||
"html-webpack-plugin": "^2.30.1", | ||
"eslint": "^4.1.1", | ||
"webpack": "^3.8.1", | ||
"webpack-dev-server": "^2.9.4" | ||
"grapesjs": "^0.19.5", | ||
"grapesjs-cli": "^3.0.1" | ||
} | ||
} |
@@ -16,3 +16,3 @@ # GrapesJS Countdown | ||
* Plugin name: `gjs-component-countdown` | ||
* Plugin name: `grapesjs-component-countdown` | ||
* Components: `countdown` | ||
@@ -22,19 +22,20 @@ * Blocks: `countdown` | ||
## Options | ||
* `blocks` Which blocks to add, default: `['countdown']` (all) | ||
* `defaultStyle` Add default style to blocks, default: true | ||
* `startTime` Default start time, eg. '2018-01-25 00:00', default: '' | ||
* `endText` Text to show when the countdown is ended, default: 'EXPIRED' | ||
* `dateInputType` Date input type, eg, 'date', 'datetime-local', default: 'date' | ||
* `countdownClsPfx` Countdown class prefix, default: 'countdown' | ||
* `labelCountdown` Countdown label, default 'Countdown' | ||
* `labelCountdownCategory` Countdown category label, default 'Extra' | ||
* `labelDays` Days label text used in component, default 'days' | ||
* `labelHours` Hours label text used in component, default 'hours' | ||
* `labelMinutes` Minutes label text used in component, default 'minutes' | ||
* `labelSeconds` Seconds label text used in component, default 'seconds' | ||
| Option | Description | Default | | ||
|-|-|- | ||
| `id` | The ID used to create the block and component. | `countdown` | | ||
| `label` | The label used for the block and the component. | `Countdown` | | ||
| `block` | Object to extend the default block, eg. `{ label: 'Countdown', category: 'Extra', ... }`. Pass a falsy value to avoid adding the block. | `{}` | | ||
| `props` | Object to extend the default component properties., eg. `{ name: 'Countdown', droppable: false, ... }`. | `{}` | | ||
| `style` | Custom CSS styles for the component. This will replace the default one. | `''` | | ||
| `styleAdditional` | Additional CSS styles for the component. These will be appended to the default one. | `''` | | ||
| `startTime` | Default start time, eg. `2030-01-25 00:00`. | `''` | | ||
| `endText` | Text to show when the countdown is ended. | `'EXPIRED'` | | ||
| `dateInputType` | Date input type, eg. `date`, `datetime-local` | `'date'` | | ||
| `labelDays` | Days label text used in component. | `'days'` | | ||
| `labelHours` | Hours label text used in component. | `'hours'` | | ||
| `labelMinutes` | Minutes label text used in component. | `'minutes'` | | ||
| `labelSeconds` | Seconds label text used in component. | `'seconds'` | | ||
| `classPrefix` | Countdown component class prefix. | `'countdown'` | | ||
@@ -47,3 +48,8 @@ | ||
* `npm i grapesjs-component-countdown` or `yarn add grapesjs-component-countdown` | ||
* CDN | ||
* `https://unpkg.com/grapesjs-component-countdown` | ||
* NPM | ||
* `npm i grapesjs-component-countdown` | ||
* GIT | ||
* `git clone https://github.com/artf/grapesjs-component-countdown.git` | ||
@@ -54,7 +60,9 @@ | ||
## Usage | ||
Directly in the browser | ||
```html | ||
<link href="path/to/grapes.min.css" rel="stylesheet"/> | ||
<script src="path/to/grapes.min.js"></script> | ||
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet"/> | ||
<script src="https://unpkg.com/grapesjs"></script> | ||
<script src="path/to/grapesjs-component-countdown.min.js"></script> | ||
@@ -67,5 +75,6 @@ | ||
container : '#gjs', | ||
plugins: ['gjs-component-countdown'], | ||
// ... | ||
plugins: ['grapesjs-component-countdown'], | ||
pluginsOpts: { | ||
'gjs-component-countdown': {/* ...options */} | ||
'grapesjs-component-countdown': { /* options */ } | ||
} | ||
@@ -76,6 +85,25 @@ }); | ||
Modern javascript | ||
```js | ||
import grapesjs from 'grapesjs'; | ||
import pluginCountdown from 'grapesjs-component-countdown'; | ||
const editor = grapesjs.init({ | ||
container : '#gjs', | ||
// ... | ||
plugins: [pluginCountdown], | ||
pluginsOpts: { | ||
[pluginCountdown]: { /* options */ } | ||
} | ||
// or | ||
plugins: [ | ||
editor => pluginCountdown(editor, { /* options */ }), | ||
], | ||
}); | ||
``` | ||
## Development | ||
@@ -82,0 +110,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
25446
0
2
1
137
0
6
99
1