This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
v3.0.0-rc
Migrating to v3.0.0
- We removed
react
,react-dom
,moment
andlodash
(and jquery) from gutenberg-js package, but it still needs those libraries to run, so don't forget to include them in your editor page.
<!-- Example: -->
<script src="https://unpkg.com/[email protected]/umd/react.production.min.js"></script>
<script src="https://unpkg.com/[email protected]/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/[email protected]/min/moment.min.js"></script>
<script src="https://unpkg.com/[email protected]/lodash.min.js"></script>
<script>window.lodash = _.noConflict();</script>
- Also, we only have 2 style files:
style.css
andblock-library/style.css
. The editor needs both, but front end only need blocks style (block-library/style.css
).
// Gutenberg JS Style
import '@frontkom/gutenberg-js/build/css/block-library/style.css';
// import '@frontkom/gutenberg-js/build/css/components/style.css';
// import '@frontkom/gutenberg-js/build/css/nux/style.css';
// import '@frontkom/gutenberg-js/build/css/editor/style.css';
// import '@frontkom/gutenberg-js/build/css/block-library/theme.css';
// import '@frontkom/gutenberg-js/build/css/block-library/edit-blocks.css';
import '@frontkom/gutenberg-js/build/css/style.css';
- The index request ('/') now is 'wp/v2/themes'.
// response
[{
theme_supports: {
formats: ['standard', 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'audio'],
'post-thumbanials': true,
'responsive-embeds': false,
},
}]
- The editor
settings
object requires a new property:
const settings = {
...
postLock: {
isLocked: false,
},
...
};
gutenberg-overrides
Added
-
packages/edit-post overrides
-
addQueryArgs
to 'Manage All Reusable Blocks' link (ToolsMoreMenuGroup) -
addQueryArgs
to 'Manage All Reusable Blocks' link (Inserter Menu) -
OPEN_GENERAL_SIDEBAR
andCLOSE_GENERAL_SIDEBAR
effects
Changed
-
MediaUpload component and implement the Media Library with existing images
-
'cover-image' to 'cover'
Removed
-
BlockListBlock override
-
insertDefaultBlock
action override -
mediaUpload override