@fluxfiles/ckeditor4 0.2.1 → 0.2.2

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
@@ -14,12 +14,14 @@ or copy the plugin folder into your CKEditor `plugins/` directory:
14
14
 
15
15
  ```
16
16
  ckeditor/plugins/fluxfiles/
17
- ├── plugin.js
17
+ ├── plugin.js # readable source
18
+ ├── plugin.min.js # minified (~1.3 KB) — use in production
18
19
  └── README.md
19
20
  ```
20
21
 
21
- The toolbar icon is an inline SVG (no separate image file) — the same folder
22
- glyph the TinyMCE plugin uses.
22
+ A minified `plugin.min.js` ships alongside the source (CDN `unpkg`/`jsdelivr`
23
+ resolve to it); regenerate with `npm run build` (esbuild). The toolbar icon is an
24
+ inline SVG (no separate image file) — the same folder glyph the TinyMCE plugin uses.
23
25
 
24
26
  2. Load the FluxFiles SDK (`fluxfiles.js`) on the page.
25
27
 
package/package.json CHANGED
@@ -1,15 +1,21 @@
1
1
  {
2
2
  "name": "@fluxfiles/ckeditor4",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "CKEditor 4 plugin for FluxFiles",
5
5
  "license": "MIT",
6
6
  "main": "plugin.js",
7
+ "unpkg": "plugin.min.js",
8
+ "jsdelivr": "plugin.min.js",
7
9
  "files": [
8
10
  "plugin.js",
11
+ "plugin.min.js",
9
12
  "README.md"
10
13
  ],
11
- "scripts": { "test": "vitest run" },
12
- "devDependencies": { "jsdom": "^25.0.1", "vitest": "^2.1.8" },
14
+ "scripts": {
15
+ "build": "esbuild plugin.js --minify --legal-comments=none --outfile=plugin.min.js",
16
+ "test": "vitest run"
17
+ },
18
+ "devDependencies": { "esbuild": "^0.28.0", "jsdom": "^25.0.1", "vitest": "^2.1.8" },
13
19
  "publishConfig": { "access": "public" },
14
20
  "author": "thai-pc",
15
21
  "homepage": "https://github.com/thai-pc/fluxfiles#ckeditor-4",
package/plugin.min.js ADDED
@@ -0,0 +1 @@
1
+ (function(){"use strict";var r='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none"><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" stroke="#575757" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',u="data:image/svg+xml,"+encodeURIComponent(r);CKEDITOR.plugins.add("fluxfiles",{init:function(n){var e=n.config.fluxfiles||{};n.addCommand("openFluxFiles",{exec:function(){if(typeof FluxFiles>"u"){console.error("[FluxFiles] SDK (fluxfiles.js) is not loaded.");return}FluxFiles.open({endpoint:e.endpoint||"",token:e.token||"",disk:e.disk||"local",mode:"picker",multiple:!!e.multiple,maxUploadMb:e.maxUploadMb||null,maxFiles:e.maxFiles||null,locale:e.locale||null,onSelect:function(l){for(var s=Array.isArray(l)?l:l&&l.files?l.files:[l],t=0;t<s.length;t++){var o=s[t];if(o){var a=o.url||"",i=o.basename||o.name||o.path||"";/\.(jpe?g|png|gif|webp|svg|bmp|ico)$/i.test(i)?n.insertHtml('<img src="'+CKEDITOR.tools.htmlEncode(a)+'" alt="'+CKEDITOR.tools.htmlEncode(i)+'" />'):n.insertHtml('<a href="'+CKEDITOR.tools.htmlEncode(a)+'">'+CKEDITOR.tools.htmlEncode(i)+"</a>")}}}})}}),n.ui.addButton("FluxFiles",{label:"FluxFiles",command:"openFluxFiles",toolbar:"insert",icon:u})}})})();