diff --git a/.eslintrc.js b/.eslintrc.js index 7021592ea..bcb366a06 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -5,10 +5,13 @@ module.exports = { }, extends: ['plugin:vue/essential', '@vue/standard', 'prettier'], rules: { + 'no-unmodified-loop-condition': process.env.NODE_ENV === 'production' ? 'error' : 'warn', + 'no-unused-vars': process.env.NODE_ENV === 'production' ? 'error' : 'warn', + 'no-unreachable': process.env.NODE_ENV === 'production' ? 'error' : 'warn', // indent indent: ['error', 2, { SwitchCase: 1 }], 'vue/script-indent': [ - 'error', + process.env.NODE_ENV === 'production' ? 'error' : 'warn', 2, { baseIndent: 1, @@ -27,7 +30,7 @@ module.exports = { 'no-console': process.env.NODE_ENV === 'production' ? ['error', { allow: ['error'] }] - : 'off' + : 'warn' }, overrides: [ { @@ -35,7 +38,7 @@ module.exports = { rules: { indent: 'off', 'vue/script-indent': [ - 'error', + process.env.NODE_ENV === 'production' ? 'error' : 'warn', 2, { baseIndent: 1, diff --git a/docs/content/1_documentation/4_form-fields/wysiwyg.md b/docs/content/1_documentation/4_form-fields/wysiwyg.md index 0db85e58a..fc4b97b26 100644 --- a/docs/content/1_documentation/4_form-fields/wysiwyg.md +++ b/docs/content/1_documentation/4_form-fields/wysiwyg.md @@ -8,7 +8,7 @@ ```php Wysiwyg::make() ->name('case_study') - ->toolbarOptions(['list-ordered', 'list-unordered']) + ->toolbarOptions([ [ 'header' => [1, 2, false] ], 'ordered', 'bullet' ]) ->maxLength(200) ->note('Some note') ``` @@ -20,7 +20,6 @@ Wysiwyg::make() 'case_study', 'label' => 'Case study text', - 'toolbarOptions' => ['list-ordered', 'list-unordered'], 'placeholder' => 'Case study text', 'maxlength' => 200, 'note' => 'Hint message', @@ -54,7 +52,7 @@ Wysiwyg::make() @formField('wysiwyg', [ 'name' => 'case_study', 'label' => 'Case study text', - 'toolbarOptions' => [ [ 'header' => [1, 2, false] ], 'list-ordered', 'list-unordered', [ 'indent' => '-1'], [ 'indent' => '+1' ] ], + 'toolbarOptions' => [ [ 'header' => [1, 2, false] ], 'placeholder' => 'Case study text', 'maxlength' => 200, 'editSource' => true, @@ -65,32 +63,29 @@ Wysiwyg::make() :::#tab::: :::#tabs::: -By default, the WYSIWYG field is based on [Quill](https://quilljs.com/). +By default, the WYSIWYG field is based on [Tiptap](https://tiptap.dev/). -You can add all [toolbar options](https://quilljs.com/docs/modules/toolbar/) from Quill with the `toolbarOptions` key. +You can configure the toolbar if needed. -For example, this configuration will render a `wysiwyg` field with almost all features from Quill and Snow theme. +For example, this configuration will render the *default* toolbar. ```blade @php $wysiwygOptions = [ - ['header' => [2, 3, 4, 5, 6, false]], - 'bold', - 'italic', - 'underline', - 'strike', - ["script" => "super"], - ["script" => "sub"], - "blockquote", - "code-block", - ['list' => 'ordered'], - ['list' => 'bullet'], - ['indent' => '-1'], - ['indent' => '+1'], - ["align" => []], - ["direction" => "rtl"], - 'link', - "clean", + ['header' => [2, 3, 4, 5, 6, false]], + 'bold', + 'italic', + 'underline', + 'strike', + 'blockquote', + "code-block", + 'ordered', + 'bullet', + 'hr', + 'code', + 'link', + 'clean', + 'table', ]; @endphp @@ -110,20 +105,20 @@ image module is not integrated with Twill's media library. It outputs the base64 It is not a recommended way of using and storing images, prefer using one or multiple `medias` form fields or blocks fields for flexible content. This will give you greater control over your frontend output. -| Option | Description | Type/values | Default value | -|:---------------|:-------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------|:----------------------------------------| -| name | Name of the field | string | | -| label | Label of the field | string | | -| type | Type of wysiwyg field | quill
tiptap | quill | -| toolbarOptions | Array of options/tools that will be displayed in the editor | [Quill options](https://quilljs.com/docs/modules/toolbar/) | bold
italic
underline
link | -| editSource | Displays a button to view source code | boolean | false | -| hideCounter | Hide the character counter displayed at the bottom | boolean | false | -| limitHeight | Limit the editor height from growing beyond the viewport | boolean | false | -| translated | Defines if the field is translatable | boolean | false | -| maxlength | Max character count of the field | integer | 255 | -| note | Hint message displayed above the field | string | | -| placeholder | Text displayed as a placeholder in the field | string | | -| required | Displays an indicator that this field is required
A backend validation rule is required to prevent users from saving | boolean | false | +| Option | Description | Type/values | Default value | +|:---------------|:-------------------------------------------------------------------------------------------------------------------------|:-----------------|:--------------| +| name | Name of the field | string | | +| label | Label of the field | string | | +| type | Type of wysiwyg field | quill
tiptap | tiptap | +| toolbarOptions | Array of options/tools that will be displayed in the editor | | See above | +| editSource | Displays a button to view source code | boolean | false | +| hideCounter | Hide the character counter displayed at the bottom | boolean | false | +| limitHeight | Limit the editor height from growing beyond the viewport | boolean | false | +| translated | Defines if the field is translatable | boolean | false | +| maxlength | Max character count of the field | integer | 255 | +| note | Hint message displayed above the field | string | | +| placeholder | Text displayed as a placeholder in the field | string | | +| required | Displays an indicator that this field is required
A backend validation rule is required to prevent users from saving | boolean | false | A migration to save a `wysiwyg` field would be: diff --git a/frontend/icons-wysiwyg/wysiwyg_unlink.svg b/frontend/icons-wysiwyg/wysiwyg_unlink.svg new file mode 100644 index 000000000..93143286d --- /dev/null +++ b/frontend/icons-wysiwyg/wysiwyg_unlink.svg @@ -0,0 +1,5 @@ + + Unlink + + diff --git a/frontend/js/components/Checkbox.vue b/frontend/js/components/Checkbox.vue index 59d407ae8..5af1cb7af 100755 --- a/frontend/js/components/Checkbox.vue +++ b/frontend/js/components/Checkbox.vue @@ -1,7 +1,12 @@ @@ -16,7 +21,9 @@ default: '' }, initialValue: { - default: function () { return [] } + default: function () { + return [] + } }, name: { type: String, @@ -59,8 +66,8 @@