domma-js 0.55.0 → 0.57.0

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 (116) hide show
  1. package/assets/types/generated/public/assets/flags/africa.d.ts +6 -0
  2. package/assets/types/generated/public/assets/flags/americas.d.ts +6 -0
  3. package/assets/types/generated/public/assets/flags/asia.d.ts +6 -0
  4. package/assets/types/generated/public/assets/flags/europe.d.ts +9 -0
  5. package/assets/types/generated/public/assets/flags/index.d.ts +11 -0
  6. package/assets/types/generated/public/assets/flags/oceania.d.ts +2 -0
  7. package/assets/types/generated/public/assets/icons/buildings.d.ts +6 -0
  8. package/assets/types/generated/public/assets/icons/code.d.ts +2 -0
  9. package/assets/types/generated/public/assets/icons/commerce.d.ts +7 -0
  10. package/assets/types/generated/public/assets/icons/communication.d.ts +7 -0
  11. package/assets/types/generated/public/assets/icons/devices.d.ts +6 -0
  12. package/assets/types/generated/public/assets/icons/emojis.d.ts +6 -0
  13. package/assets/types/generated/public/assets/icons/files.d.ts +7 -0
  14. package/assets/types/generated/public/assets/icons/finance.d.ts +6 -0
  15. package/assets/types/generated/public/assets/icons/forms.d.ts +5 -0
  16. package/assets/types/generated/public/assets/icons/health.d.ts +6 -0
  17. package/assets/types/generated/public/assets/icons/index.d.ts +24 -0
  18. package/assets/types/generated/public/assets/icons/media.d.ts +7 -0
  19. package/assets/types/generated/public/assets/icons/navigation.d.ts +7 -0
  20. package/assets/types/generated/public/assets/icons/seasonal.d.ts +6 -0
  21. package/assets/types/generated/public/assets/icons/social.d.ts +7 -0
  22. package/assets/types/generated/public/assets/icons/sport.d.ts +6 -0
  23. package/assets/types/generated/public/assets/icons/status.d.ts +7 -0
  24. package/assets/types/generated/public/assets/icons/transport.d.ts +7 -0
  25. package/assets/types/generated/public/assets/icons/ui.d.ts +7 -0
  26. package/assets/types/generated/public/assets/icons/weather.d.ts +6 -0
  27. package/assets/types/generated/src/auth.d.ts +424 -0
  28. package/assets/types/generated/src/avatar.d.ts +270 -0
  29. package/assets/types/generated/src/binding-source.d.ts +58 -0
  30. package/assets/types/generated/src/butterfly-drawing.d.ts +2 -0
  31. package/assets/types/generated/src/component-factory.d.ts +150 -0
  32. package/assets/types/generated/src/component.d.ts +162 -0
  33. package/assets/types/generated/src/components/back-to-top.d.ts +150 -0
  34. package/assets/types/generated/src/components/badge.d.ts +208 -0
  35. package/assets/types/generated/src/components/card.d.ts +189 -0
  36. package/assets/types/generated/src/components/command-palette.d.ts +352 -0
  37. package/assets/types/generated/src/components/dropzone.d.ts +342 -0
  38. package/assets/types/generated/src/components/focus-trap.d.ts +238 -0
  39. package/assets/types/generated/src/components/loader.d.ts +133 -0
  40. package/assets/types/generated/src/components/modal.d.ts +341 -0
  41. package/assets/types/generated/src/components/range-slider.d.ts +267 -0
  42. package/assets/types/generated/src/components/shared.d.ts +91 -0
  43. package/assets/types/generated/src/components/split-pane.d.ts +239 -0
  44. package/assets/types/generated/src/components/toast.d.ts +284 -0
  45. package/assets/types/generated/src/components/tooltip.d.ts +200 -0
  46. package/assets/types/generated/src/components/virtual-list.d.ts +340 -0
  47. package/assets/types/generated/src/config.d.ts +193 -0
  48. package/assets/types/generated/src/context-cursor.d.ts +69 -0
  49. package/assets/types/generated/src/context-menu.d.ts +596 -0
  50. package/assets/types/generated/src/dates.d.ts +367 -0
  51. package/assets/types/generated/src/dom.d.ts +1221 -0
  52. package/assets/types/generated/src/effects.d.ts +1281 -0
  53. package/assets/types/generated/src/elements.d.ts +4996 -0
  54. package/assets/types/generated/src/escape.d.ts +5 -0
  55. package/assets/types/generated/src/flags-bundle.d.ts +4 -0
  56. package/assets/types/generated/src/flags.d.ts +338 -0
  57. package/assets/types/generated/src/forms.d.ts +1060 -0
  58. package/assets/types/generated/src/globals.d.ts +45 -0
  59. package/assets/types/generated/src/http.d.ts +131 -0
  60. package/assets/types/generated/src/i18n.d.ts +261 -0
  61. package/assets/types/generated/src/icons.d.ts +213 -0
  62. package/assets/types/generated/src/index.d.ts +249 -0
  63. package/assets/types/generated/src/input-group.d.ts +135 -0
  64. package/assets/types/generated/src/models.d.ts +968 -0
  65. package/assets/types/generated/src/popover.d.ts +412 -0
  66. package/assets/types/generated/src/router.d.ts +344 -0
  67. package/assets/types/generated/src/safe-url.d.ts +10 -0
  68. package/assets/types/generated/src/sanitize.d.ts +97 -0
  69. package/assets/types/generated/src/schema-builder.d.ts +420 -0
  70. package/assets/types/generated/src/skeleton.d.ts +135 -0
  71. package/assets/types/generated/src/smooth-caret.d.ts +61 -0
  72. package/assets/types/generated/src/sortable.d.ts +369 -0
  73. package/assets/types/generated/src/storage.d.ts +93 -0
  74. package/assets/types/generated/src/tables.d.ts +901 -0
  75. package/assets/types/generated/src/theme.d.ts +277 -0
  76. package/assets/types/generated/src/ticker-tape-drawing.d.ts +2 -0
  77. package/assets/types/generated/src/treeview.d.ts +504 -0
  78. package/assets/types/generated/src/utils.d.ts +1667 -0
  79. package/assets/types/generated/src/web-components/base/domma-element.d.ts +134 -0
  80. package/assets/types/generated/src/web-components/index.d.ts +14 -0
  81. package/assets/types/generated/vendor/domma-reactive.d.ts +587 -0
  82. package/assets/types/index.d.ts +104 -216
  83. package/package.json +5 -2
  84. package/public/dist/bundles/domma-complete.css +1084 -14
  85. package/public/dist/bundles/domma-data-focused.css +1084 -14
  86. package/public/dist/bundles/domma-essentials.css +1084 -14
  87. package/public/dist/bundles/domma-full.css +1084 -14
  88. package/public/dist/bundles/domma-minimal.css +8 -8
  89. package/public/dist/domma-flags.esm.js +3 -3
  90. package/public/dist/domma-flags.esm.js.map +1 -1
  91. package/public/dist/domma-flags.min.js +3 -3
  92. package/public/dist/domma-flags.min.js.map +1 -1
  93. package/public/dist/domma-syntax.min.js +3 -3
  94. package/public/dist/domma.css +3 -3
  95. package/public/dist/domma.esm.js +5 -5
  96. package/public/dist/domma.esm.js.map +1 -1
  97. package/public/dist/domma.min.js +5 -5
  98. package/public/dist/domma.min.js.map +1 -1
  99. package/public/dist/elements.css +1073 -3
  100. package/public/dist/grid.css +3 -3
  101. package/public/dist/syntax.css +3 -3
  102. package/public/dist/themes/domma-themes.css +3 -3
  103. package/templates/kickstart/frontend/types/domma.d.ts +2 -1
  104. package/assets/types/config.d.ts +0 -136
  105. package/assets/types/dates.d.ts +0 -209
  106. package/assets/types/dom.d.ts +0 -448
  107. package/assets/types/elements.d.ts +0 -682
  108. package/assets/types/flags.d.ts +0 -130
  109. package/assets/types/http.d.ts +0 -97
  110. package/assets/types/icons.d.ts +0 -147
  111. package/assets/types/models.d.ts +0 -260
  112. package/assets/types/smooth-caret.d.ts +0 -12
  113. package/assets/types/storage.d.ts +0 -93
  114. package/assets/types/tables.d.ts +0 -327
  115. package/assets/types/theme.d.ts +0 -137
  116. package/assets/types/utils.d.ts +0 -675
@@ -1,233 +1,121 @@
1
1
  /**
2
2
  * Domma - Dynamic Object Manipulation & Modeling API
3
- * TypeScript Declaration File
3
+ * TypeScript declarations.
4
4
  *
5
- * A lightweight, zero-dependency JavaScript framework combining
6
- * jQuery-style DOM manipulation, Lodash utilities, and modern UI components.
5
+ * Everything under ./generated/ is written by `npm run build:types` from the JSDoc in src/ -
6
+ * edit the JSDoc there, never the output (`npm run check:types` fails when the two differ).
7
+ *
8
+ * This file is the only hand-written part. It holds what JSDoc cannot say:
9
+ * 1. `Domma` itself. tsc emits the Domma function with the statics src/index.js assigns, but
10
+ * `noConflict` is attached inside installGlobals() and `flags` / `FL` by the domma-flags
11
+ * bundle, so neither is on it. `DommaStatic` (a @typedef in src/index.js) adds them; the
12
+ * default and named `Domma` exports are re-declared with that type here.
13
+ * 2. Globals: `declare global` for the aliases installGlobals() puts on window (and `FL`,
14
+ * which domma-flags adds), and `Window.DommaOptions`.
15
+ * 3. Which modules' types are public: the `export type *` list below.
16
+ * 4. `$('.x')[0]`: the DommaCollection constructor assigns `this[i]`, and a JS class cannot
17
+ * declare an index signature in JSDoc, so it is added by augmentation.
7
18
  */
19
+ import type {DommaStatic} from './generated/src/index.js';
20
+ import type {DommaLoadOptions} from './generated/src/globals.js';
21
+ import type {Flags} from './generated/src/flags.js';
8
22
 
9
- // Re-export all module types
10
- export * from './dom';
11
- export * from './utils';
12
- export * from './dates';
13
- export * from './models';
14
- export * from './config';
15
- export * from './elements';
16
- export * from './tables';
17
- export * from './storage';
18
- export * from './http';
19
- export * from './theme';
20
- export * from './icons';
21
- export * from './flags';
22
- export * from './smooth-caret';
23
-
24
- // Import types for the main Domma object
25
- import {DommaCollection} from './dom';
26
- import {Utils, utils} from './utils';
27
- import {Dates, dates, DommaDate} from './dates';
28
- import {Model, models, Models} from './models';
29
- import {SelectorConfig, SetupConfig} from './config';
30
- import {Elements, elements} from './elements';
31
- import {Tables, tables} from './tables';
32
- import {Storage, storage} from './storage';
33
- import {Http, http} from './http';
34
- import {Theme, theme} from './theme';
35
- import {Icons, icons} from './icons';
36
- import {Flags} from './flags';
37
- import {SmoothCaret} from './smooth-caret';
38
-
39
- // ============================================
40
- // Main Domma Interface
41
- // ============================================
42
-
43
- export interface DommaStatic {
44
- /**
45
- * Create a DommaCollection from a selector, element, or collection
46
- * @param selector - CSS selector, element, NodeList, or array of elements
47
- * @param context - Optional context element or document
48
- * @returns DommaCollection instance
49
- */
50
- (selector: string | HTMLElement | NodeList | HTMLCollection | HTMLElement[] | DommaCollection, context?: Document | HTMLElement): DommaCollection;
51
-
52
- /**
53
- * Execute callback when DOM is ready
54
- * @param callback - Function to execute when DOM is ready
55
- */
56
- (callback: () => void): void;
57
-
58
- /** Utility functions (Lodash-compatible) */
59
- utils: Utils;
60
-
61
- /** Date manipulation (Moment.js-style) */
62
- dates: Dates;
63
-
64
- /** Reactive models & pub/sub */
65
- models: Models;
66
-
67
- /** UI components */
68
- elements: Elements;
69
-
70
- /** Smooth caret enhancement for editable text controls. */
71
- smoothCaret: SmoothCaret;
72
-
73
- /** DataTable functionality */
74
- tables: Tables;
75
-
76
- /** localStorage wrapper */
77
- storage: Storage;
78
-
79
- /** HTTP client */
80
- http: Http;
81
-
82
- /** Theme system */
83
- theme: Theme;
84
-
85
- /** Icon library */
86
- icons: Icons;
87
-
88
- /** Nation flags (opt-in module - present when domma-flags is loaded) */
89
- flags?: Flags;
90
-
91
- /** Alias for {@link DommaStatic.flags} (opt-in module) */
92
- FL?: Flags;
93
-
94
- // ============================================
95
- // ConfigEngine Methods ($.setup, $.config, etc.)
96
- // ============================================
97
-
98
- /**
99
- * Process configuration for selectors
100
- * @param config - Configuration object keyed by selector
101
- */
102
- setup(config: SetupConfig): void;
103
-
104
- /**
105
- * Update configuration for a selector
106
- * @param selector - CSS selector
107
- * @param changes - Changes to merge into existing config
108
- * @returns The merged configuration
109
- */
110
- update(selector: string, changes: Partial<SelectorConfig>): SelectorConfig;
111
-
112
- /**
113
- * Retrieve configuration for a selector or all selectors
114
- * @param selector - Optional selector to get config for
115
- * @returns Configuration object or null if not found
116
- */
117
- config(): Record<string, SelectorConfig>;
118
-
119
- config(selector: string): SelectorConfig | null;
23
+ type Exports = typeof import('./generated/src/index.js');
120
24
 
121
- /**
122
- * Reset/destroy configuration for a selector or all selectors
123
- * @param selector - Optional selector to reset
124
- */
125
- reset(selector?: string): void;
25
+ // The runtime exports of the ES module ($, _, M, D, S, A, F, H, E, I, T, R, B, components, smoothCaret,
26
+ // i18n) and the types declared in src/index.js. `Domma` is re-declared below.
27
+ export * from './generated/src/index.js';
126
28
 
127
- // ============================================
128
- // Static Utilities
129
- // ============================================
130
-
131
- /** Check if value is a DommaCollection */
132
- isDomma(value: any): value is DommaCollection;
133
-
134
- /** Domma version string */
135
- version: string;
136
-
137
- /**
138
- * Give `$` and `_` back to whatever owned them before Domma loaded (jQuery, Lodash).
139
- * With `deep`, give back every short alias (`window.Domma` stays).
140
- * @returns Domma, so `const dm = Domma.noConflict()` keeps a handle
141
- */
142
- noConflict(deep?: boolean): DommaStatic;
29
+ declare const Domma: DommaStatic;
30
+ export default Domma;
31
+ export {Domma};
32
+
33
+ // Types (and `typeof` handles) of every public module. Type-only: the ES module's runtime exports are
34
+ // the ones above, so `import {utils} from 'domma-js'` is refused rather than undefined at runtime.
35
+ export type * from './generated/src/dom.js';
36
+ export type * from './generated/src/utils.js';
37
+ export type * from './generated/src/dates.js';
38
+ export type * from './generated/src/models.js';
39
+ export type * from './generated/src/config.js';
40
+ export type * from './generated/src/elements.js';
41
+ export type * from './generated/src/tables.js';
42
+ export type * from './generated/src/storage.js';
43
+ export type * from './generated/src/http.js';
44
+ export type * from './generated/src/theme.js';
45
+ export type * from './generated/src/icons.js';
46
+ export type * from './generated/src/flags.js';
47
+ export type * from './generated/src/smooth-caret.js';
48
+ export type * from './generated/src/i18n.js';
49
+ export type * from './generated/src/globals.js';
50
+ export type * from './generated/src/router.js';
51
+ export type * from './generated/src/auth.js';
52
+ export type * from './generated/src/forms.js';
53
+ export type * from './generated/src/effects.js';
54
+ export type * from './generated/src/component-factory.js';
55
+ export type * from './generated/src/web-components/base/domma-element.js';
56
+ export type * from './generated/src/component.js';
57
+ export type * from './generated/src/popover.js';
58
+ export type * from './generated/src/context-menu.js';
59
+ export type * from './generated/src/sortable.js';
60
+ export type * from './generated/src/skeleton.js';
61
+ export type * from './generated/src/avatar.js';
62
+ export type * from './generated/src/input-group.js';
63
+ export type * from './generated/src/treeview.js';
64
+ export type * from './generated/src/components/card.js';
65
+ export type * from './generated/src/components/modal.js';
66
+ export type * from './generated/src/components/tooltip.js';
67
+ export type * from './generated/src/components/badge.js';
68
+ export type * from './generated/src/components/loader.js';
69
+ export type * from './generated/src/components/back-to-top.js';
70
+ export type * from './generated/src/components/toast.js';
71
+ export type * from './generated/src/components/focus-trap.js';
72
+ export type * from './generated/src/components/command-palette.js';
73
+ export type * from './generated/src/components/split-pane.js';
74
+ export type * from './generated/src/components/virtual-list.js';
75
+ export type * from './generated/src/components/dropzone.js';
76
+ export type * from './generated/src/components/range-slider.js';
77
+
78
+ declare module './generated/src/dom.js' {
79
+ interface DommaCollection {
80
+ /** The elements by position - `$('.x')[0]` is `$('.x').get(0)` */
81
+ [index: number]: HTMLElement;
82
+ }
143
83
  }
144
84
 
145
- // ============================================
146
- // Global Declarations
147
- // ============================================
148
-
149
85
  declare global {
150
- /**
151
- * Domma - Main entry point
152
- * jQuery-compatible DOM selection and manipulation
153
- */
86
+ /** Domma - jQuery-style selection plus every module (`Domma.utils`, `Domma.elements`, ...) */
154
87
  const Domma: DommaStatic;
155
-
156
- /**
157
- * $ - Alias for Domma
158
- * jQuery-compatible selector function
159
- */
88
+ /** Alias for Domma */
160
89
  const $: DommaStatic;
90
+ /** Utilities (Lodash-style) - `Domma.utils` */
91
+ const _: Exports['_'];
92
+ /** Reactive models and pub/sub - `Domma.models` */
93
+ const M: Exports['M'];
94
+ /** Dates (Moment-style) - `Domma.dates` */
95
+ const D: Exports['D'];
96
+ /** localStorage wrapper - `Domma.storage` */
97
+ const S: Exports['S'];
98
+ /** Auth helpers - `Domma.auth` */
99
+ const A: Exports['A'];
100
+ /** Forms - `Domma.forms` */
101
+ const F: Exports['F'];
102
+ /** HTTP client - `Domma.http` */
103
+ const H: Exports['H'];
104
+ /** UI components - `Domma.elements` */
105
+ const E: Exports['E'];
106
+ /** Icons - `Domma.icons` */
107
+ const I: Exports['I'];
108
+ /** Tables - `Domma.tables` */
109
+ const T: Exports['T'];
110
+ /** Hash router - `Domma.router` */
111
+ const R: Exports['R'];
112
+ /** Blueprint composition - `B.extend`, `B.pick`, `B.omit` */
113
+ const B: Exports['B'];
114
+ /** Nation flags - only once the opt-in domma-flags bundle is loaded */
115
+ const FL: Flags;
161
116
 
162
- /**
163
- * _ - Alias for Domma.utils
164
- * Lodash-compatible utility functions
165
- */
166
- const _: Utils;
167
-
168
- /**
169
- * M - Alias for Domma.models
170
- * Reactive models and pub/sub events
171
- */
172
- const M: Models;
173
-
174
- /**
175
- * D - Alias for Domma.dates
176
- * Moment.js-style date manipulation
177
- */
178
- const D: Dates;
179
-
180
- /**
181
- * S - Alias for Domma.storage
182
- * localStorage wrapper
183
- */
184
- const S: Storage;
185
- }
186
-
187
- // ============================================
188
- // Default Export
189
- // ============================================
190
-
191
- declare const Domma: DommaStatic;
192
- export default Domma;
193
-
194
- // Named exports for ES modules - exactly what src/index.js exports
195
- declare const $: DommaStatic;
196
- declare const _: Utils;
197
- declare const M: Models;
198
- declare const D: Dates;
199
- declare const S: Storage;
200
- declare const H: Http;
201
- declare const E: Elements;
202
- declare const I: Icons;
203
- declare const T: Tables;
204
- declare const smoothCaret: SmoothCaret;
205
- // Not typed yet: auth, forms, router, blueprint helpers, web-component registry
206
- declare const A: any;
207
- declare const F: any;
208
- declare const R: any;
209
- declare const B: any;
210
- declare const components: any;
211
-
212
- export {Domma, $, _, M, D, S, A, F, H, E, I, T, R, B, components, smoothCaret};
213
- export type {DommaCollection, DommaDate, Model};
214
-
215
- /** Options read from `window.DommaOptions` when Domma loads - set it before the script tag. */
216
- export interface DommaLoadOptions {
217
- /** true (default): every alias; 'safe': only aliases nobody else owns; false: window.Domma only */
218
- globals?: boolean | 'safe';
219
- /** false: never add the `dm-cloaked` class */
220
- cloak?: boolean;
221
- /** false: don't initialise the theme engine automatically */
222
- theme?: boolean;
223
- /** false: no console warning when DOMPurify is missing */
224
- purifyWarning?: boolean;
225
- /** false: no deprecation warnings */
226
- deprecationWarnings?: boolean;
227
- }
228
-
229
- declare global {
230
117
  interface Window {
118
+ /** Options read when Domma loads - set before the script tag. */
231
119
  DommaOptions?: DommaLoadOptions;
232
120
  }
233
121
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "domma-js",
3
- "version": "0.55.0",
3
+ "version": "0.57.0",
4
4
  "description": "Dynamic Object Manipulation & Modeling API - A complete front-end toolkit.",
5
5
  "main": "public/dist/domma.min.js",
6
6
  "module": "public/dist/domma.esm.js",
@@ -69,8 +69,10 @@
69
69
  "serve:3096": "node bin/domma-cli.js serve --port 3096",
70
70
  "dev": "NODE_ENV=development npm run generate:bundles && rollup -c && node scripts/build-info.js && npm run build:metadata && npm run copy:themes && npm run copy:celebrate && npm run generate:themes && npm run build:css && npm run build:miniapps && live-server public --port=3001 --open=/index.html",
71
71
  "dev:watch": "NODE_ENV=development npm run generate:bundles && rollup -c && node scripts/build-info.js && npm run build:metadata && npm run copy:themes && npm run copy:celebrate && npm run generate:themes && npm run build:css && npm run build:miniapps && npm run watch:miniapps",
72
- "build": "npm run generate:bundles && rollup -c && node scripts/build-info.js && npm run build:metadata && npm run copy:themes && npm run copy:celebrate && npm run generate:themes && npm run build:css && npm run build:css-bundles && npm run build:archives && npm run build:kickstart-files && npm run build:miniapps",
72
+ "build": "npm run generate:bundles && rollup -c && node scripts/build-info.js && npm run build:metadata && npm run copy:themes && npm run copy:celebrate && npm run generate:themes && npm run build:css && npm run build:css-bundles && npm run build:archives && npm run build:kickstart-files && npm run build:miniapps && npm run build:types",
73
73
  "build:js": "rollup -c",
74
+ "build:types": "node scripts/build-types.mjs",
75
+ "check:types": "node scripts/check-types.mjs",
74
76
  "build:css": "node scripts/build-css.js",
75
77
  "validate:classes": "node scripts/validate-classes.js",
76
78
  "validate:theme": "node scripts/validate-theme-contrast.js",
@@ -123,6 +125,7 @@
123
125
  "live-server": "^1.2.0",
124
126
  "puppeteer": "^24.34.0",
125
127
  "rollup": "^4.28.0",
128
+ "typescript": "5.6.3",
126
129
  "vitest": "^4.0.16"
127
130
  },
128
131
  "dependencies": {}