Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Append support to use within Nova Repeater #30

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/vendor
/node_modules
package-lock.json
auth.json
composer.phar
composer.lock
phpunit.xml
Expand Down
2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions dist/js/field.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/

/*!
* vuex v4.1.0
* (c) 2022 Evan You
* @license MIT
*/

/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
3 changes: 2 additions & 1 deletion dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"/js/field.js": "/js/field.js"
"/js/field.js": "/js/field.js",
"/css/field.css": "/css/field.css"
}
2 changes: 1 addition & 1 deletion nova.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class NovaExtension {
...(webpackConfig.resolve.alias || {}),
'laravel-nova': path.join(
__dirname,
'../../vendor/laravel/nova/resources/js/mixins/packages.js'
'vendor/laravel/nova/resources/js/mixins/packages.js'
),
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production",
"nova:install": "npm --prefix='../../vendor/laravel/nova' ci",
"nova:install": "npm --prefix='vendor/laravel/nova' ci",
"lint": "eslint --ext .vue resources/js/components",
"lint:fix": "eslint --fix --ext .vue resources/js/components"
},
Expand Down
2 changes: 1 addition & 1 deletion resources/css/field.css
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/* Nova Field CSS */
/* Nova Field CSS */
10 changes: 9 additions & 1 deletion resources/js/components/FormField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
:show-help-text="showHelpText">
<template #field>
<editor
:id="currentField.attribute"
:id="fieldId"
v-model="value"
:api-key="currentField.options.apiKey"
:cloud-channel="currentField.options.cloudChannel ?? 6"
Expand All @@ -21,6 +21,7 @@
<script>
import { DependentFormField, HandlesValidationErrors } from 'laravel-nova'
import Editor from '@tinymce/tinymce-vue'
import {uuid} from "@tinymce/tinymce-vue/lib/es2015/main/ts/Utils";

export default {
mixins: [DependentFormField, HandlesValidationErrors],
Expand All @@ -36,7 +37,14 @@ export default {
this.setEditorTheme()
},

computed: {
fieldId () {
return this.field.attribute + '-' + uuid('nova-4-tinymce')
}
},

methods: {
uuid,
setupProtectContent () {
if (this.field.options.init.protect) {
this.field.options.init.protect = this.field.options.init.protect.map((regex) => {
Expand Down
2 changes: 2 additions & 0 deletions webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ let mix = require('laravel-mix')
let path = require('path')

require('./nova.mix')
mix.disableNotifications()

mix
.setPublicPath('dist')
.css('resources/css/field.css', 'css')
.js('resources/js/field.js', 'js')
.vue({ version: 3 })
.nova('murdercode/nova4-tinymce-editor')