@fluxfiles/ckeditor4 0.1.1 → 0.2.1

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/README.md CHANGED
@@ -15,11 +15,12 @@ or copy the plugin folder into your CKEditor `plugins/` directory:
15
15
  ```
16
16
  ckeditor/plugins/fluxfiles/
17
17
  ├── plugin.js
18
- ├── icons/
19
- │ └── fluxfiles.png
20
18
  └── README.md
21
19
  ```
22
20
 
21
+ The toolbar icon is an inline SVG (no separate image file) — the same folder
22
+ glyph the TinyMCE plugin uses.
23
+
23
24
  2. Load the FluxFiles SDK (`fluxfiles.js`) on the page.
24
25
 
25
26
  3. Enable the plugin:
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "@fluxfiles/ckeditor4",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "description": "CKEditor 4 plugin for FluxFiles",
5
5
  "license": "MIT",
6
6
  "main": "plugin.js",
7
7
  "files": [
8
8
  "plugin.js",
9
- "icons",
10
9
  "README.md"
11
10
  ],
12
11
  "scripts": { "test": "vitest run" },
package/plugin.js CHANGED
@@ -19,10 +19,15 @@
19
19
  (function () {
20
20
  'use strict';
21
21
 
22
- CKEDITOR.plugins.add('fluxfiles', {
23
- icons: 'fluxfiles',
24
- hidpi: true,
22
+ // Shared toolbar glyph — the same folder icon TinyMCE registers, kept inline
23
+ // (no separate image file) so both editor plugins stay visually in sync.
24
+ // currentColor doesn't resolve inside an <img>, so use an explicit gray.
25
+ var ICON_SVG = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none">'
26
+ + '<path d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" '
27
+ + 'stroke="#575757" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>';
28
+ var ICON_URI = 'data:image/svg+xml,' + encodeURIComponent(ICON_SVG);
25
29
 
30
+ CKEDITOR.plugins.add('fluxfiles', {
26
31
  init: function (editor) {
27
32
  var cfg = editor.config.fluxfiles || {};
28
33
 
@@ -39,6 +44,8 @@
39
44
  disk: cfg.disk || 'local',
40
45
  mode: 'picker',
41
46
  multiple: !!cfg.multiple,
47
+ maxUploadMb: cfg.maxUploadMb || null,
48
+ maxFiles: cfg.maxFiles || null,
42
49
  locale: cfg.locale || null,
43
50
  onSelect: function (payload) {
44
51
  var files = Array.isArray(payload) ? payload : (payload && payload.files ? payload.files : [payload]);
@@ -65,7 +72,7 @@
65
72
  label: 'FluxFiles',
66
73
  command: 'openFluxFiles',
67
74
  toolbar: 'insert',
68
- icon: this.path + 'icons/fluxfiles.png'
75
+ icon: ICON_URI
69
76
  });
70
77
  }
71
78
  });
Binary file