Socket
Socket
Sign inDemoInstall

grapesjs-component-countdown

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grapesjs-component-countdown - npm Package Compare versions

Comparing version 0.1.3 to 1.0.1

dist/index.d.ts

34

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc