frayerjj-frontend 0.1.46 → 0.1.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frayerjj-frontend",
3
- "version": "0.1.46",
3
+ "version": "0.1.48",
4
4
  "description": "My base frontend for various projects",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -14,7 +14,8 @@
14
14
  "author": "Joshua Frayer",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@ckeditor/ckeditor5-build-classic": "^44.3.0",
17
+ "@ckeditor/ckeditor5-editor-classic": "^44.3.0",
18
+ "@ckeditor/ckeditor5-editor-inline": "^44.3.0",
18
19
  "@popperjs/core": "^2.11.8",
19
20
  "bootstrap": "^5.3.3"
20
21
  }
package/src/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
1
2
  import { ajax } from './ajax';
2
3
  import { init } from './init';
3
4
  import { loading } from './loading';
@@ -5,5 +6,19 @@ import { message } from './message';
5
6
  import { modal } from './modal';
6
7
  import { session } from './session';
7
8
  import { validate } from './validate';
9
+ import ClassicEditorBase from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
10
+ import InlineEditorBase from '@ckeditor/ckeditor5-editor-inline/src/inlineeditor';
8
11
 
9
- export { ajax, init, loading, message, modal, session, validate };
12
+ class ClassicEditor extends ClassicEditorBase {}
13
+ class InlineEditor extends InlineEditorBase {}
14
+
15
+ const plugins = [];
16
+ const config = {};
17
+
18
+ ClassicEditor.builtinPlugins = plugins;
19
+ ClassicEditor.defaultConfig = config;
20
+
21
+ InlineEditor.builtinPlugins = plugins;
22
+ InlineEditor.defaultConfig = config;
23
+
24
+ export { ClassicEditor, InlineEditor, ajax, init, loading, message, modal, session, validate };
package/src/init.js CHANGED
@@ -6,43 +6,11 @@ import { validate } from './validate';
6
6
  import { loading } from './loading';
7
7
  import { ajax } from './ajax';
8
8
  import { session } from './session';
9
- import { ckeupload } from './ckeupload';
10
-
11
- const initCKEditor = async () => {
12
- try {
13
- // Try to load CKEditor dynamically
14
- const { ClassicEditor } = await import('@ckeditor/ckeditor5-build-classic');
15
- window.ClassicEditor = ClassicEditor;
16
- console.log('ClassicEditor:', window.ClassicEditor); // Debugging log
17
-
18
- // Initialize your upload adapter or other CKEditor-related code
19
- ckeupload.init();
20
- } catch (error) {
21
- console.error('Failed to load CKEditor dynamically:', error);
22
-
23
- // Fallback to CDN
24
- if (typeof window.ClassicEditor === 'undefined') {
25
- console.warn('Falling back to CKEditor CDN.');
26
- const script = document.createElement('script');
27
- script.src = 'https://cdn.ckeditor.com/ckeditor5/40.0.0/classic/ckeditor.js';
28
- script.onload = () => {
29
- console.log('CKEditor loaded from CDN.');
30
- ckeupload.init();
31
- };
32
- script.onerror = () => {
33
- console.error('Failed to load CKEditor from CDN.');
34
- };
35
- document.head.appendChild(script);
36
- }
37
- }
38
- };
39
9
 
40
10
  export const init = () => {
41
11
 
42
12
  window.bootstrap = bootstrap;
43
13
  window.createPopper = createPopper;
44
- window.ClassicEditor = ClassicEditor;
45
- window.ckeupload = ckeupload;
46
14
  window.message = message;
47
15
  window.modal = modal;
48
16
  window.ajax = ajax;
@@ -56,7 +24,6 @@ export const init = () => {
56
24
  message.verbose('Page Loaded, Initializing');
57
25
  validate.init();
58
26
  modal.ajax.init();
59
- initCKEditor();
60
27
 
61
28
  // Updates the id in the form action inside a modal. Used for delete confirm and edit modals.
62
29
  document.querySelectorAll('.modal-uuid-update').forEach(el => {