Updated
This commit is contained in:
49
index.js
49
index.js
@@ -1,21 +1,56 @@
|
||||
// index.js
|
||||
import './src/sigpro.js';
|
||||
// import './src/sigpro.js';
|
||||
import { $, $$, Render, Watch, Tag, If, For, Router, Mount } from './src/sigpro.js';
|
||||
import * as Components from './src/components/index.js';
|
||||
import * as Utils from './src/core/utils.js';
|
||||
import { tt } from './src/core/i18n.js';
|
||||
|
||||
export * from './src/components/index.js';
|
||||
export * from './src/core/utils.js';
|
||||
export { tt };
|
||||
export { $, $$, Render, Watch, Tag, If, For, Router, Mount, tt };
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
// const CoreAPI = { $, $$, Render, Watch, Tag, If, For, Router, Mount } = SigPro;
|
||||
|
||||
// Object.entries(CoreAPI).forEach(([name, fn]) => {
|
||||
// Object.defineProperty(window, name, {
|
||||
// value: fn,
|
||||
// writable: false,
|
||||
// configurable: false,
|
||||
// enumerable: true
|
||||
// });
|
||||
// });
|
||||
|
||||
Object.entries(Components).forEach(([name, component]) => {
|
||||
window[name] = component;
|
||||
Object.defineProperty(window, name, {
|
||||
value: component,
|
||||
writable: false,
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
});
|
||||
});
|
||||
|
||||
window.Utils = Utils;
|
||||
window.tt = tt;
|
||||
window.SigProUI = { ...Components, Utils, tt };
|
||||
Object.entries(Utils).forEach(([name, fn]) => {
|
||||
Object.defineProperty(window, name, {
|
||||
value: fn,
|
||||
writable: false,
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
});
|
||||
});
|
||||
|
||||
Object.defineProperty(window, 'tt', {
|
||||
value: tt,
|
||||
writable: false,
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
});
|
||||
|
||||
Object.defineProperty(window, 'SigProUI', {
|
||||
value: { ...Components, Utils, tt },
|
||||
writable: false,
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
});
|
||||
|
||||
console.log("🎨 SigProUI ready");
|
||||
}
|
||||
Reference in New Issue
Block a user