12 |
13 |
14 |
29 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All Notable changes to `blender-content-blocks` will be documented in this file.
4 |
5 | ## 2.0.2 - 2017-09-19
6 | - Changed: English labels
7 |
8 | ## 2.0.1 - 2017-09-19
9 | - Updated: compatibility with Redactor II 2.10
10 |
11 | ## 1.1.1 - 2017-08-22
12 | - Fixed: Button clicks weren't always prevented
13 |
14 | ## 1.1.0 - 2017-05-21
15 | - Added: Allow custom types, translated attributes and media collections via `data`
16 | - Fixed: Removed broken hash links
17 |
18 | ## 1.0.5 - 2017-03-28
19 | - Fixed: Look for `types` in `data` in the content block component
20 |
21 | ## 1.0.4 - 2017-03-28
22 | - Fixed: Change `blender-media` dependency to `@spatie/blender-media`
23 |
24 | ## 1.0.3 - 2017-03-28
25 | - Added: Look for `types` in `data` in the editor mixin
26 |
27 | ## 1.0.0 - 2017-01-10
28 | - First release
29 |
--------------------------------------------------------------------------------
/src/components/forms/Redactor.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
10 |
11 |
12 |
13 |
45 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | # The MIT License (MIT)
2 |
3 | Copyright (c) Spatie bvba
4 |
5 | > Permission is hereby granted, free of charge, to any person obtaining a copy
6 | > of this software and associated documentation files (the "Software"), to deal
7 | > in the Software without restriction, including without limitation the rights
8 | > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | > copies of the Software, and to permit persons to whom the Software is
10 | > furnished to do so, subject to the following conditions:
11 | >
12 | > The above copyright notice and this permission notice shall be included in
13 | > all copies or substantial portions of the Software.
14 | >
15 | > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | > THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@spatie/blender-content-blocks",
3 | "version": "2.0.2",
4 | "description": "Blender content blocks component",
5 | "main": "dist/index.js",
6 | "scripts": {
7 | "build": "rm -rf dist && NODE_ENV=production webpack --config webpack.dist.js",
8 | "lint": "eslint src --ext .js --ext .vue --fix; exit 0",
9 | "prepublish": "npm run test; npm run build",
10 | "test": "exit 0"
11 | },
12 | "repository": {
13 | "type": "git",
14 | "url": "https://github.com/spatie-custom/blender-content-blocks.git"
15 | },
16 | "keywords": [
17 | "spatie",
18 | "blender",
19 | "javascript",
20 | "vue"
21 | ],
22 | "author": "Sebastian De Deyne",
23 | "license": "MIT",
24 | "bugs": {
25 | "url": "https://github.com/spatie-custom/blender-content-blocks/issues"
26 | },
27 | "homepage": "https://github.com/spatie-custom/blender-content-blocks",
28 | "dependencies": {
29 | "axios": "^0.15.3",
30 | "babel-core": "^6.18.2",
31 | "dragula": "^3.7.1",
32 | "dragula-constrain": "^1.0.0",
33 | "dropzone": "^4.3.0",
34 | "font-awesome-filetypes": "^1.0.1"
35 | },
36 | "peerDependencies": {
37 | "lodash": "^4.0.0",
38 | "spatie-dom": "^1.0.0",
39 | "vue": "^2.0.0"
40 | },
41 | "devDependencies": {
42 | "babel-loader": "^6.2.5",
43 | "babel-plugin-transform-object-rest-spread": "^6.8.0",
44 | "babel-preset-es2015": "^6.14.0",
45 | "css-loader": "^0.25.0",
46 | "eslint": "^3.0.0",
47 | "eslint-config-spatie": "^1.2.5",
48 | "eslint-plugin-html": "^1.5.3",
49 | "eslint-plugin-vue": "^0.1.1",
50 | "lodash": "^4.0.0",
51 | "spatie-dom": "^1.0.0",
52 | "vue": "^2.0.0",
53 | "vue-loader": "^9.0.3",
54 | "webpack": "2.1.0-beta.25"
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Blender Media
2 |
3 | [](LICENSE.md)
4 | [](https://travis-ci.org/spatie-custom/blender-content-blocks)
5 |
6 | Content blocks component for [Blender](https://github.com/spatie-custom/blender), our CMS.
7 |
8 | ## Support us
9 |
10 | Learn how to create a package like this one, by watching our premium video course:
11 |
12 | [](https://laravelpackage.training)
13 |
14 | We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).
15 |
16 | We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).
17 |
18 | ## Installation
19 |
20 | The `blender-content-blocks` can be installed from npm.
21 |
22 | ```bash
23 | yarn add @spatie/blender-content-blocks
24 | ```
25 |
26 | `blender-content-blocks` also requires you to install `vue@'^2.0.0'`, `lodash@'^4.0.0'`, and `spatie-dom@'^1.0.0'`:
27 |
28 | ```bash
29 | yarn add vue@'^2.0.0' lodash@'^4.0.0' spatie-dom@'^1.0.0'
30 | ```
31 |
32 | ## Usage
33 |
34 | The canonical way to use `blender-content-blocks`, is to mount it on a selector. The `mount` function will replace every element that matches a given selector with a `blender-content-blocks` component. The element should contain props just like you'd pass them with Vue.
35 |
36 | ```js
37 | import { mount } from '@spatie/blender-content-blocks';
38 |
39 | export default function init() {
40 | mount('content-blocks');
41 | }
42 | ```
43 |
44 | ```html
45 |
59 | ```
60 |
61 | ### Custom Fields
62 |
63 | Custom fields can be defined by passing `types`, `translatableAttributes` or `mediaLibraryCollections` to `data`. Here are the default values as a quick reference:
64 |
65 | ```js
66 | {
67 | types: {
68 | imageLeft: 'Afbeelding links',
69 | imageRight: 'Afbeelding rechts',
70 | },
71 | translatableAttributes: {
72 | name: 'text',
73 | text: 'redactor',
74 | },
75 | mediaLibraryCollections: {
76 | image: 'image',
77 | },
78 | }
79 | ```
80 |
81 | ## Contributing
82 |
83 | Since this is an internal project, we don't accept pull requests at this time.
84 |
85 | ## License
86 |
87 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
88 |
89 | Example images provided by [Unsplash](https://unsplash.com).
90 |
--------------------------------------------------------------------------------
/src/components/Editor.vue:
--------------------------------------------------------------------------------
1 |
2 |