-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Hello,
I'm overriding the CKEditor field, following this documentation, where they mention the use of several particular kind of scripts:
<script type="importmap">
{
"imports": {
"ckeditor5": "../../assets/vendor/ckeditor5.js",
"ckeditor5/": "../../assets/vendor/"
}
}
</script>
<script type="module">
import {
ClassicEditor,
Essentials,
Paragraph,
Bold,
Italic,
Font
} from 'ckeditor5';
ClassicEditor
.create( document.querySelector( '#editor' ), {
licenseKey: '<YOUR_LICENSE_KEY>', // Or 'GPL'.
plugins: [ Essentials, Paragraph, Bold, Italic, Font ],
toolbar: [
'undo', 'redo', '|', 'bold', 'italic', '|',
'fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor'
]
} )
.then( editor => {
window.editor = editor;
} )
.catch( error => {
console.error( error );
} );
</script>In addition, I have a script with the bpFieldInitCKEditorElement function:
<script>
async function bpFieldInitCKEditorElement(element) {
// …
}
</script>If I wrap this portion of code with @bassetBlock directive, it'll remove the type attribute:
@bassetBlock('backpack/pro/fields/ckeditor-import-map.js')
<script type="importmap">
{
"imports": {
"ckeditor5": "{{ asset('vendor/ckeditor5/ckeditor5.js') }}",
"ckeditor5/": "{{ asset('vendor/ckeditor5/') }}/"
}
}
</script>
@endBassetBlockwill result into:
<script src="/back/storage/basset/backpack/pro/fields/ckeditor-import-map-9dc70859.js" ></script>Is there a way to do this?
Thank you!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels