@netcentric/eddys-video
Advanced tools
Comparing version 1.0.16 to 1.0.17
{ | ||
"name": "@netcentric/eddys-video", | ||
"version": "1.0.16", | ||
"version": "1.0.17", | ||
"description": "<Package description>", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
@@ -23,6 +23,9 @@ # Netcentric Block Collection | ||
### There Are 2 ways to use a block from the Block Collection | ||
### JS file: There Are 2 ways to use a block from the Block Collection | ||
#### Option 1 - Use an already existing block with no possibility to extend the js or use a custom block developed using a js class Not extending the js class | ||
#### Option 1 | ||
Use an already existing block with no possibility to extend the js or use a custom block developed using a js class Not extending the js class | ||
You need to import the defaultDecorate function form the `libs/blocks` block you want to use. | ||
And export the async function decorate to get your code executed when the block is in place. | ||
```javascript | ||
@@ -37,4 +40,9 @@ import defaultDecorate from '/libs/blocks/<original-block-name>/<original-block-name>.js'; | ||
#### Option 2 - Use a custom block developed using a js class extending the js class | ||
#### Option 2 | ||
Use a custom block developed using a js class extending the js class | ||
You need to import the defaultDecorate and the OriginalBlockName (the class with the block functionality) form the `libs/blocks` block you want to use. | ||
And export the async function decorate to get your code executed when the block is in place. | ||
If we are extending the class we need to pass the extended class as a param in the defaultDecorate function | ||
```javascript | ||
@@ -51,6 +59,16 @@ import { defaultDecorate, OriginalBlockName } from '/libs/blocks/<original-block-name>/<original-block-name>.js'; | ||
export default async function decorate(block) { | ||
// Custom decoration can be done here | ||
await defaultDecorate(block, BlockName); // Note that you need to pass the extended class to the defaultDeaorate | ||
} | ||
``` | ||
### CSS file: | ||
You need to import the CSS file form the `libs/blocks` block you want to use. | ||
And then you can add as much extra CSS you want. | ||
```css | ||
@import "/libs/blocks/<original-block-name>/<original-block-name>.css"; | ||
/* you can add custom css here */ | ||
``` | ||
### Issue template | ||
@@ -57,0 +75,0 @@ - .github/ISSUE_TEMPLATE.md |
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
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
21925
108