@kupola/kupola 1.2.0 → 1.3.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.
Files changed (97) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +330 -286
  3. package/adapters/axios.d.ts +34 -0
  4. package/adapters/axios.js +122 -0
  5. package/adapters/navios-http.d.ts +110 -0
  6. package/adapters/navios-http.js +151 -0
  7. package/dist/css/accessibility.css +119 -0
  8. package/dist/css/animations.css +224 -0
  9. package/dist/css/brand-themes.css +300 -0
  10. package/dist/css/colors_and_type.css +441 -0
  11. package/dist/css/components-ext.css +4165 -0
  12. package/dist/css/components.css +1483 -0
  13. package/dist/css/responsive.css +697 -0
  14. package/dist/css/scaffold.css +145 -0
  15. package/dist/css/states.css +316 -0
  16. package/dist/css/theme-dark.css +296 -0
  17. package/dist/css/theme-light.css +296 -0
  18. package/dist/css/utilities.css +171 -0
  19. package/dist/kupola.cjs.js +219 -161
  20. package/dist/kupola.cjs.js.map +1 -1
  21. package/dist/kupola.esm.js +6643 -5709
  22. package/dist/kupola.esm.js.map +1 -1
  23. package/dist/kupola.umd.js +219 -161
  24. package/dist/kupola.umd.js.map +1 -1
  25. package/dist/plugins/vite-plugin-kupola.js +120 -0
  26. package/dist/types/kupola.d.ts +421 -323
  27. package/js/calendar.js +334 -25
  28. package/js/carousel.js +182 -48
  29. package/js/collapse.js +148 -34
  30. package/js/color-picker.js +416 -108
  31. package/js/component.js +8 -19
  32. package/js/countdown.js +9 -8
  33. package/js/data-bind.js +73 -16
  34. package/js/datepicker.js +488 -110
  35. package/js/depends.js +710 -0
  36. package/js/dialog.js +4 -2
  37. package/js/drawer.js +172 -8
  38. package/js/dropdown.js +272 -17
  39. package/js/dynamic-tags.js +156 -40
  40. package/js/fileupload.js +9 -8
  41. package/js/form.js +280 -254
  42. package/js/global-events.js +281 -188
  43. package/js/heatmap.js +10 -7
  44. package/js/i18n.js +18 -10
  45. package/js/icons.js +141 -161
  46. package/js/image-preview.js +146 -2
  47. package/js/initializer.js +113 -71
  48. package/js/kupola-core.js +123 -45
  49. package/js/kupola-lifecycle.js +13 -11
  50. package/js/message.js +8 -1
  51. package/js/modal.js +207 -59
  52. package/js/notification.js +8 -1
  53. package/js/numberinput.js +9 -8
  54. package/js/pagination.js +263 -0
  55. package/js/registry.js +29 -12
  56. package/js/select.js +482 -27
  57. package/js/slide-captcha.js +11 -2
  58. package/js/slider.js +442 -25
  59. package/js/statcard.js +9 -7
  60. package/js/table.js +1210 -0
  61. package/js/tag.js +268 -14
  62. package/js/theme.js +14 -43
  63. package/js/timepicker.js +335 -66
  64. package/js/tooltip.js +317 -86
  65. package/js/utils.js +6 -2
  66. package/js/validation.js +6 -2
  67. package/js/virtual-list.js +11 -7
  68. package/js/web-components.js +288 -0
  69. package/package.json +77 -67
  70. package/plugins/vite-plugin-kupola.js +120 -0
  71. package/types/kupola.d.ts +421 -323
  72. package/CHANGELOG.md +0 -130
  73. package/INTEGRATION.md +0 -440
  74. package/PROJECT_SUMMARY.md +0 -312
  75. package/SKILL.md +0 -572
  76. package/dist/utils/utils/Kupola.cs +0 -77
  77. package/dist/utils/utils/Kupola.java +0 -104
  78. package/dist/utils/utils/kupola.go +0 -120
  79. package/dist/utils/utils/kupola.js +0 -63
  80. package/dist/utils/utils/kupola.py +0 -1392
  81. package/dist/utils/utils/kupola.rb +0 -69
  82. package/js/composition-api.js +0 -458
  83. package/js/error-handler.js +0 -181
  84. package/js/http.js +0 -419
  85. package/js/kupola-devtools.js +0 -598
  86. package/js/performance.js +0 -250
  87. package/js/router.js +0 -396
  88. package/js/security.js +0 -189
  89. package/js/test-utils.js +0 -251
  90. package/templates/base.html +0 -30
  91. package/templates/base_dashboard.html +0 -99
  92. package/utils/Kupola.cs +0 -77
  93. package/utils/Kupola.java +0 -104
  94. package/utils/kupola.go +0 -120
  95. package/utils/kupola.js +0 -63
  96. package/utils/kupola.py +0 -1392
  97. package/utils/kupola.rb +0 -69
@@ -0,0 +1,120 @@
1
+ /**
2
+ * @kupola/vite-plugin - Vite plugin for Kupola development
3
+ *
4
+ * Features:
5
+ * - Auto-import useDeps/useQuery when detected in code
6
+ * - Auto-inject Kupola CSS
7
+ * - Dev-time dependency graph visualization
8
+ * - Transform helper for @depends-like syntax
9
+ */
10
+
11
+ import { readFileSync } from 'fs';
12
+ import { resolve } from 'path';
13
+
14
+ /**
15
+ * @param {Object} options
16
+ * @param {boolean} [options.autoCSS=true] - Auto inject Kupola CSS
17
+ * @param {boolean} [options.autoImport=true] - Auto import useDeps/useQuery
18
+ * @param {boolean} [options.devTools=true] - Enable dev tools in dev mode
19
+ * @param {string} [options.cssPath] - Custom CSS path
20
+ */
21
+ export function kupola(options = {}) {
22
+ const {
23
+ autoCSS = true,
24
+ autoImport = true,
25
+ devTools = true,
26
+ cssPath = null
27
+ } = options;
28
+
29
+ let isDev = false;
30
+ let kupolaRoot = null;
31
+
32
+ return {
33
+ name: 'kupola',
34
+ enforce: 'pre',
35
+
36
+ configResolved(config) {
37
+ isDev = config.command === 'serve';
38
+ kupolaRoot = config.root;
39
+ },
40
+
41
+ // Auto-import useDeps/useQuery
42
+ transform(code, id) {
43
+ if (!autoImport) return null;
44
+ if (!id.endsWith('.js') && !id.endsWith('.ts') && !id.endsWith('.vue') && !id.endsWith('.jsx') && !id.endsWith('.tsx')) {
45
+ return null;
46
+ }
47
+
48
+ // Skip node_modules
49
+ if (id.includes('node_modules')) return null;
50
+
51
+ let transformed = code;
52
+ let hasChanges = false;
53
+
54
+ // Detect useDeps usage without import
55
+ if (code.includes('useDeps(') && !code.includes("from '@kupola/kupola'") && !code.includes("from 'kupola'") && !code.includes('from "../js/depends.js"') && !code.includes('from "./js/depends.js"')) {
56
+ const importStatement = `import { useDeps } from '@kupola/kupola';\n`;
57
+ transformed = importStatement + transformed;
58
+ hasChanges = true;
59
+ }
60
+
61
+ // Detect useQuery usage without import
62
+ if (code.includes('useQuery(') && !code.includes("from '@kupola/kupola'") && !code.includes("from 'kupola'") && !code.includes('from "../js/depends.js"') && !code.includes('from "./js/depends.js"')) {
63
+ if (!transformed.includes("import { useQuery }")) {
64
+ const importStatement = `import { useQuery } from '@kupola/kupola';\n`;
65
+ transformed = importStatement + transformed;
66
+ hasChanges = true;
67
+ }
68
+ }
69
+
70
+ if (hasChanges) {
71
+ return {
72
+ code: transformed,
73
+ map: null
74
+ };
75
+ }
76
+
77
+ return null;
78
+ },
79
+
80
+ // Inject CSS in dev mode
81
+ transformIndexHtml(html) {
82
+ if (!autoCSS) return html;
83
+
84
+ const cssLink = cssPath || '/css/kupola.css';
85
+ if (!html.includes(cssLink)) {
86
+ return html.replace(
87
+ '</head>',
88
+ ` <link rel="stylesheet" href="${cssLink}">\n</head>`
89
+ );
90
+ }
91
+ return html;
92
+ },
93
+
94
+ // Dev tools integration
95
+ configureServer(server) {
96
+ if (!devTools || !isDev) return;
97
+
98
+ // Add middleware for dependency graph API
99
+ server.middlewares.use('/__kupola-deps', (req, res) => {
100
+ res.setHeader('Content-Type', 'application/json');
101
+ res.end(JSON.stringify({
102
+ status: 'ok',
103
+ version: '1.2.1',
104
+ features: ['useDeps', 'useQuery', 'Scheduler', 'CacheManager']
105
+ }));
106
+ });
107
+ },
108
+
109
+ // Handle hot update for depends files
110
+ handleHotUpdate(ctx) {
111
+ const { file, modules } = ctx;
112
+ if (file.includes('depends.js')) {
113
+ // Force full reload when core depends files change
114
+ return [];
115
+ }
116
+ }
117
+ };
118
+ }
119
+
120
+ export default kupola;