editium 1.0.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.
@@ -0,0 +1,41 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ const jsContent = fs.readFileSync(path.join(__dirname, 'editium.js'), 'utf-8');
5
+ const cssContent = fs.readFileSync(path.join(__dirname, 'editium.css'), 'utf-8');
6
+ const fontAwesomeCSS = '@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css");';
7
+
8
+ const bundledContent = `/**
9
+ * Editium - Vanilla JavaScript Rich Text Editor (Bundled Version)
10
+ * Version: 1.0.0 | License: MIT
11
+ * Single file bundle - includes CSS and Font Awesome icons
12
+ */
13
+
14
+ (function() {
15
+ 'use strict';
16
+
17
+ function injectStyles() {
18
+ if (typeof document === 'undefined' || document.getElementById('editium-styles')) return;
19
+
20
+ const styleElement = document.createElement('style');
21
+ styleElement.id = 'editium-styles';
22
+ styleElement.textContent = \`${fontAwesomeCSS}\n\n${cssContent.replace(/`/g, '\\`').replace(/\$/g, '\\$')}\`;
23
+ document.head.appendChild(styleElement);
24
+ }
25
+
26
+ if (document.readyState === 'loading') {
27
+ document.addEventListener('DOMContentLoaded', injectStyles);
28
+ } else {
29
+ injectStyles();
30
+ }
31
+
32
+ ${jsContent.replace(/^\/\*\*[\s\S]*?\*\/\n/, '').replace(/^class Editium/, ' class Editium').replace(/^}/m, ' }').replace(/\n/g, '\n ')}
33
+
34
+ if (typeof module !== 'undefined' && module.exports) module.exports = Editium;
35
+ if (typeof window !== 'undefined') window.Editium = Editium;
36
+
37
+ })();
38
+ `;
39
+
40
+ fs.writeFileSync(path.join(__dirname, 'editium.bundle.js'), bundledContent, 'utf-8');
41
+ console.log('✅ Bundle created: editium.bundle.js');