-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #138 - implement transforms to oik/countdown from oik-blocks/co…
…untdown and [bw_countdown]
- Loading branch information
1 parent
d29ac4d
commit a7b3b1a
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* Transformation to oik/countdown of oik-blocks/countdown and [bw_coundtown]. | ||
*/ | ||
const { createBlock | ||
} = wp.blocks; | ||
|
||
const transforms = { | ||
from: [ | ||
{ | ||
type: 'block', | ||
blocks: ['oik-block/countdown'], | ||
transform: function (attributes) { | ||
return createBlock('oik/countdown', attributes ); | ||
}, | ||
}, | ||
{ | ||
type: 'shortcode', | ||
tag: 'bw_countdown', | ||
attributes: { | ||
since: { | ||
type: 'string', | ||
shortcode: ( { named: { since } } ) => { | ||
return since; | ||
}, | ||
}, | ||
until: { | ||
type: 'string', | ||
shortcode: ( { named: { until } } ) => { | ||
return until; | ||
}, | ||
}, | ||
url: { | ||
type: 'string', | ||
shortcode: ( { named: { url } } ) => { | ||
return url; | ||
}, | ||
}, | ||
description: { | ||
type: 'string', | ||
shortcode: ( { named: { description } } ) => { | ||
return description; | ||
}, | ||
}, | ||
expirytext: { | ||
type: 'string', | ||
shortcode: ( { named: { expirytext } } ) => { | ||
return expirytext; | ||
}, | ||
}, | ||
format: { | ||
type: 'string', | ||
shortcode: ( { named: { format } } ) => { | ||
return format; | ||
}, | ||
}, | ||
|
||
}, | ||
}, | ||
] | ||
}; | ||
|
||
export { transforms } ; |