Skip to content

Commit 6e5ec78

Browse files
Add missing JS files from gem build & add notes on MediaUploader
1 parent 2275dba commit 6e5ec78

5 files changed

Lines changed: 18 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/).
1414
### Fixed
1515
-
1616

17-
## v0.1.0 - 2021-03-16
17+
## v0.1.2 - 2021-03-16
1818

1919
### Added
2020
- Initial release

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
block_editor (0.1.0)
4+
block_editor (0.1.2)
55
rails (~> 6.0)
66
webpacker (~> 5.1)
77

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ end
5050
```
5151
* Boom! You have a Block Editor linked to your model
5252

53+
Note: If the error `Webpacker::Manifest::MissingEntryError` appears you need to run the following command to precompile the BlockEditor assets;
54+
```
55+
rails block_editor:webpacker:compile
56+
```
57+
5358
### Strong Parameters
5459
Remember to permit the block list attributes if you're using Strong Parameters (you should be), i.e;
5560
```
@@ -80,6 +85,15 @@ The below files should be overridden within your application in order to style y
8085
* `app/assets/stylesheets/block_editor/frontend/blocks.scss` - Any styles that should be displayed within the frontend and backend
8186
* `app/assets/stylesheets/block_editor/backend/blocks.scss` - Any styles that should _only_ be displayed within the block editor itself, i.e when creating or editing the blocks
8287

88+
### MediaUploader & Images
89+
There is no built in MediaUploader or media gallery, it is up to the host application to implement this.
90+
91+
When the media uploader is requested the Block Editor checks if `window.MediaUploader` is defined. If it is defined the block editor will call `window.MediaUploader.open(callback)`, otherwise it will randomly select an image from [Unsplash](https://unsplash.com)
92+
93+
When an image is successfully uploaded or selected the MediaUploader instance should call the callback which was passed into the `open` function;
94+
```
95+
callback({url: imageUrl})
96+
```
8397

8498
### Turbolinks
8599
Currently Block Editor is not compatible with Turbolinks as history is only being reset on full page loads. To disable Turbolinks per page add the following in your layout view file within your `<HEAD>`;;

block_editor.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
1414
spec.metadata["source_code_uri"] = "https://github.com/yamasolutions/block-editor"
1515
spec.metadata["changelog_uri"] = "https://github.com/yamasolutions/block-editor/blob/master/CHANGELOG.md"
1616

17-
spec.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
17+
spec.files = Dir["{app,bin,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md", "package.json", "yarn.lock", "postcss.config.js"]
1818

1919
spec.add_dependency "rails", "~> 6.0"
2020
spec.add_dependency 'webpacker', '~> 5.1'

lib/block_editor/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module BlockEditor
2-
VERSION = '0.1.0'
2+
VERSION = '0.1.2'
33
end

0 commit comments

Comments
 (0)