domma-js 0.56.0 → 0.58.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 (121) hide show
  1. package/README.md +2 -2
  2. package/assets/types/generated/public/assets/flags/africa.d.ts +6 -0
  3. package/assets/types/generated/public/assets/flags/americas.d.ts +6 -0
  4. package/assets/types/generated/public/assets/flags/asia.d.ts +6 -0
  5. package/assets/types/generated/public/assets/flags/europe.d.ts +9 -0
  6. package/assets/types/generated/public/assets/flags/index.d.ts +11 -0
  7. package/assets/types/generated/public/assets/flags/oceania.d.ts +2 -0
  8. package/assets/types/generated/public/assets/icons/buildings.d.ts +6 -0
  9. package/assets/types/generated/public/assets/icons/code.d.ts +2 -0
  10. package/assets/types/generated/public/assets/icons/commerce.d.ts +7 -0
  11. package/assets/types/generated/public/assets/icons/communication.d.ts +7 -0
  12. package/assets/types/generated/public/assets/icons/devices.d.ts +6 -0
  13. package/assets/types/generated/public/assets/icons/emojis.d.ts +6 -0
  14. package/assets/types/generated/public/assets/icons/files.d.ts +7 -0
  15. package/assets/types/generated/public/assets/icons/finance.d.ts +6 -0
  16. package/assets/types/generated/public/assets/icons/forms.d.ts +5 -0
  17. package/assets/types/generated/public/assets/icons/health.d.ts +6 -0
  18. package/assets/types/generated/public/assets/icons/index.d.ts +24 -0
  19. package/assets/types/generated/public/assets/icons/media.d.ts +7 -0
  20. package/assets/types/generated/public/assets/icons/navigation.d.ts +7 -0
  21. package/assets/types/generated/public/assets/icons/seasonal.d.ts +6 -0
  22. package/assets/types/generated/public/assets/icons/social.d.ts +7 -0
  23. package/assets/types/generated/public/assets/icons/sport.d.ts +6 -0
  24. package/assets/types/generated/public/assets/icons/status.d.ts +7 -0
  25. package/assets/types/generated/public/assets/icons/transport.d.ts +7 -0
  26. package/assets/types/generated/public/assets/icons/ui.d.ts +7 -0
  27. package/assets/types/generated/public/assets/icons/weather.d.ts +6 -0
  28. package/assets/types/generated/src/auth.d.ts +424 -0
  29. package/assets/types/generated/src/avatar.d.ts +270 -0
  30. package/assets/types/generated/src/binding-source.d.ts +58 -0
  31. package/assets/types/generated/src/butterfly-drawing.d.ts +2 -0
  32. package/assets/types/generated/src/component-factory.d.ts +150 -0
  33. package/assets/types/generated/src/component.d.ts +162 -0
  34. package/assets/types/generated/src/components/back-to-top.d.ts +150 -0
  35. package/assets/types/generated/src/components/badge.d.ts +208 -0
  36. package/assets/types/generated/src/components/card.d.ts +189 -0
  37. package/assets/types/generated/src/components/command-palette.d.ts +352 -0
  38. package/assets/types/generated/src/components/dropzone.d.ts +342 -0
  39. package/assets/types/generated/src/components/focus-trap.d.ts +238 -0
  40. package/assets/types/generated/src/components/loader.d.ts +133 -0
  41. package/assets/types/generated/src/components/modal.d.ts +339 -0
  42. package/assets/types/generated/src/components/range-slider.d.ts +267 -0
  43. package/assets/types/generated/src/components/shared.d.ts +91 -0
  44. package/assets/types/generated/src/components/split-pane.d.ts +239 -0
  45. package/assets/types/generated/src/components/toast.d.ts +284 -0
  46. package/assets/types/generated/src/components/tooltip.d.ts +200 -0
  47. package/assets/types/generated/src/components/virtual-list.d.ts +340 -0
  48. package/assets/types/generated/src/config.d.ts +193 -0
  49. package/assets/types/generated/src/context-cursor.d.ts +69 -0
  50. package/assets/types/generated/src/context-menu.d.ts +596 -0
  51. package/assets/types/generated/src/dates.d.ts +367 -0
  52. package/assets/types/generated/src/dom.d.ts +1221 -0
  53. package/assets/types/generated/src/effects.d.ts +1281 -0
  54. package/assets/types/generated/src/elements.d.ts +4994 -0
  55. package/assets/types/generated/src/escape.d.ts +5 -0
  56. package/assets/types/generated/src/flags-bundle.d.ts +4 -0
  57. package/assets/types/generated/src/flags.d.ts +338 -0
  58. package/assets/types/generated/src/forms.d.ts +1060 -0
  59. package/assets/types/generated/src/globals.d.ts +45 -0
  60. package/assets/types/generated/src/http.d.ts +131 -0
  61. package/assets/types/generated/src/i18n.d.ts +261 -0
  62. package/assets/types/generated/src/icons.d.ts +213 -0
  63. package/assets/types/generated/src/index.d.ts +249 -0
  64. package/assets/types/generated/src/input-group.d.ts +135 -0
  65. package/assets/types/generated/src/models.d.ts +968 -0
  66. package/assets/types/generated/src/popover.d.ts +413 -0
  67. package/assets/types/generated/src/router.d.ts +344 -0
  68. package/assets/types/generated/src/safe-url.d.ts +10 -0
  69. package/assets/types/generated/src/sanitize.d.ts +97 -0
  70. package/assets/types/generated/src/schema-builder.d.ts +420 -0
  71. package/assets/types/generated/src/skeleton.d.ts +135 -0
  72. package/assets/types/generated/src/smooth-caret.d.ts +61 -0
  73. package/assets/types/generated/src/sortable.d.ts +368 -0
  74. package/assets/types/generated/src/storage.d.ts +93 -0
  75. package/assets/types/generated/src/tables.d.ts +901 -0
  76. package/assets/types/generated/src/theme.d.ts +262 -0
  77. package/assets/types/generated/src/ticker-tape-drawing.d.ts +2 -0
  78. package/assets/types/generated/src/treeview.d.ts +504 -0
  79. package/assets/types/generated/src/utils.d.ts +1667 -0
  80. package/assets/types/generated/src/web-components/base/domma-element.d.ts +134 -0
  81. package/assets/types/generated/src/web-components/index.d.ts +14 -0
  82. package/assets/types/generated/vendor/domma-reactive.d.ts +587 -0
  83. package/assets/types/index.d.ts +104 -226
  84. package/package.json +5 -2
  85. package/public/dist/bundles/domma-complete.css +20 -14
  86. package/public/dist/bundles/domma-data-focused.css +20 -14
  87. package/public/dist/bundles/domma-essentials.css +20 -14
  88. package/public/dist/bundles/domma-full.css +20 -14
  89. package/public/dist/bundles/domma-minimal.css +8 -8
  90. package/public/dist/domma-flags.esm.js +3 -3
  91. package/public/dist/domma-flags.esm.js.map +1 -1
  92. package/public/dist/domma-flags.min.js +3 -3
  93. package/public/dist/domma-flags.min.js.map +1 -1
  94. package/public/dist/domma-syntax.min.js +3 -3
  95. package/public/dist/domma.css +3 -3
  96. package/public/dist/domma.esm.js +5 -5
  97. package/public/dist/domma.esm.js.map +1 -1
  98. package/public/dist/domma.min.js +5 -5
  99. package/public/dist/domma.min.js.map +1 -1
  100. package/public/dist/elements.css +9 -3
  101. package/public/dist/grid.css +3 -3
  102. package/public/dist/syntax.css +3 -3
  103. package/public/dist/themes/domma-themes.css +3 -3
  104. package/templates/kickstart/.claude/snippets.md +1 -1
  105. package/templates/kickstart/CLAUDE.md +1 -1
  106. package/templates/kickstart/frontend/types/domma.d.ts +7 -4
  107. package/templates/kickstart-spa/.claude/snippets.md +1 -1
  108. package/assets/types/config.d.ts +0 -136
  109. package/assets/types/dates.d.ts +0 -209
  110. package/assets/types/dom.d.ts +0 -448
  111. package/assets/types/elements.d.ts +0 -1168
  112. package/assets/types/flags.d.ts +0 -130
  113. package/assets/types/http.d.ts +0 -97
  114. package/assets/types/i18n.d.ts +0 -99
  115. package/assets/types/icons.d.ts +0 -147
  116. package/assets/types/models.d.ts +0 -260
  117. package/assets/types/smooth-caret.d.ts +0 -12
  118. package/assets/types/storage.d.ts +0 -93
  119. package/assets/types/tables.d.ts +0 -327
  120. package/assets/types/theme.d.ts +0 -137
  121. package/assets/types/utils.d.ts +0 -675
@@ -0,0 +1,193 @@
1
+ export namespace configEngine {
2
+ let _configs: Map<any, any>;
3
+ let _components: Map<any, any>;
4
+ let _eventHandlers: Map<any, any>;
5
+ let _initCallbacks: any[];
6
+ let _domReady: boolean;
7
+ let _autoWrap: boolean;
8
+ /**
9
+ * Process initial configuration
10
+ * @param {SetupConfig & {$init?: () => void}} config - Configuration object keyed by selector
11
+ * (`$init` runs once, first)
12
+ * @param {{autoWrap?: boolean}} [options] - Processing options
13
+ * @param {boolean} [options.autoWrap=true] - Automatically wrap in DOMContentLoaded
14
+ */
15
+ function process(config: SetupConfig & {
16
+ $init?: () => void;
17
+ }, options?: {
18
+ autoWrap?: boolean;
19
+ }): void;
20
+ /**
21
+ * Internal config processing (after DOM ready check)
22
+ * @private
23
+ */
24
+ function _processConfig(config: any): void;
25
+ /**
26
+ * Update configuration for a selector
27
+ * @param {string} selector - CSS selector
28
+ * @param {Partial<SelectorConfig>} changes - Changes to merge into existing config
29
+ * @returns {SelectorConfig} The merged configuration
30
+ */
31
+ function update(selector: string, changes: Partial<SelectorConfig>): SelectorConfig;
32
+ /**
33
+ * Retrieve the configuration of every selector
34
+ * @overload
35
+ * @returns {Record<string, SelectorConfig>}
36
+ */
37
+ function config(): Record<string, SelectorConfig>;
38
+ /**
39
+ * Retrieve configuration for a selector
40
+ * @overload
41
+ * @param {string} selector - Selector to get config for
42
+ * @returns {SelectorConfig | null} Configuration object or null if not found
43
+ */
44
+ function config(selector: string): SelectorConfig | null;
45
+ /**
46
+ * Retrieve the live component instance created for a selector.
47
+ *
48
+ * $.setup() keeps instances internally, so page code has no other way to
49
+ * reach them - calling a component's methods (modal.open(), tabs.show(),
50
+ * timer.start()) requires this accessor.
51
+ *
52
+ * @overload
53
+ * @returns {Map<string, any>} Every instance, by selector
54
+ */
55
+ function getComponent(): Map<string, any>;
56
+ /**
57
+ * @overload
58
+ * @param {string} selector - Selector the component was configured under
59
+ * @returns {any} The instance, or null
60
+ */
61
+ function getComponent(selector: string): any;
62
+ /**
63
+ * Reset/destroy configuration for a selector or all selectors
64
+ * @param {string} [selector] - Optional selector to reset
65
+ */
66
+ function reset(selector?: string): void;
67
+ /**
68
+ * Initialise a component
69
+ * @param {string} selector - CSS selector
70
+ * @param {ComponentType} componentType - Component type name
71
+ * @param {Record<string, any>} options - Component options
72
+ * @returns {any} Component instance
73
+ */
74
+ function initComponent(selector: string, componentType: ComponentType, options: Record<string, any>): any;
75
+ /**
76
+ * Apply properties to DOM elements
77
+ * @param {import('./dom.js').DommaCollection} domElements - Domma collection
78
+ * @param {InitialProperties} properties - Properties to apply
79
+ */
80
+ function applyProperties(domElements: import("./dom.js").DommaCollection, properties: InitialProperties): void;
81
+ /**
82
+ * Bind events to elements
83
+ * @param {string} selector - CSS selector
84
+ * @param {Record<string, EventActions>} events - Event handlers object
85
+ * @param {boolean} [track=false] - Whether to track handlers for later removal
86
+ */
87
+ function bindEvents(selector: string, events: Record<string, EventActions>, track?: boolean): void;
88
+ /**
89
+ * Unbind all tracked events for a selector
90
+ * @param {string} selector - CSS selector
91
+ */
92
+ function unbindEvents(selector: string): void;
93
+ /**
94
+ * Update events for a selector (replaces existing handlers for same events)
95
+ * @param {string} selector - CSS selector
96
+ * @param {Record<string, EventActions>} newEvents - New event handlers
97
+ */
98
+ function updateEvents(selector: string, newEvents: Record<string, EventActions>): void;
99
+ /**
100
+ * Execute actions for an event
101
+ * @param {Event} event - DOM event
102
+ * @param {EventActions} actions - Actions to execute
103
+ */
104
+ function executeActions(event: Event, actions: EventActions): void;
105
+ /**
106
+ * Register a callback to run when DOM is ready
107
+ * @param {() => void} callback - Function to execute when DOM is ready
108
+ * @returns {void}
109
+ */
110
+ function ready(callback: () => void): void;
111
+ }
112
+ /**
113
+ * A component `$.setup()` can create for a selector - the keys of the map in `initComponent()`.
114
+ */
115
+ export type ComponentType = "card" | "modal" | "tabs" | "accordion" | "tooltip" | "carousel" | "dropdown" | "contextMenu" | "sortable" | "skeleton" | "avatar" | "avatarGroup" | "inputGroup" | "popover" | "badge" | "numberBadge" | "listGroup" | "cookieConsent" | "backToTop" | "buttonGroup" | "loader" | "breadcrumbs" | "navbar" | "sidebar" | "footer" | "notification" | "timer" | "alarm" | "autocomplete" | "pillbox" | "signature" | "form" | "breathe" | "pulse" | "scribe";
116
+ /**
117
+ * Properties applied to the matched elements once (`initial`) - each is the collection method of the same name.
118
+ */
119
+ export type InitialProperties = {
120
+ css?: Record<string, string | number>;
121
+ text?: string;
122
+ html?: string;
123
+ addClass?: string;
124
+ removeClass?: string;
125
+ toggleClass?: string;
126
+ /**
127
+ * Attribute name -> value
128
+ */
129
+ attr?: Record<string, string>;
130
+ };
131
+ /**
132
+ * A declarative event action: applied to `target` (a selector) or else to the element the event fired on.
133
+ */
134
+ export type EventAction = {
135
+ /**
136
+ * Selector of the elements to change (default: the event target)
137
+ */
138
+ target?: string;
139
+ css?: Record<string, string | number>;
140
+ text?: string;
141
+ html?: string;
142
+ addClass?: string;
143
+ removeClass?: string;
144
+ toggleClass?: string;
145
+ /**
146
+ * Written to the console
147
+ */
148
+ log?: string;
149
+ };
150
+ /**
151
+ * An event handler in a setup config. `this` is the event target.
152
+ */
153
+ export type ConfigEventHandler = (this: EventTarget, event: Event, $el: import("./dom.js").DommaCollection) => void;
154
+ /**
155
+ * What an event runs: a handler, an action, or a list of either (run in order).
156
+ */
157
+ export type EventActions = ConfigEventHandler | EventAction | Array<ConfigEventHandler | EventAction>;
158
+ /**
159
+ * The configuration for one selector.
160
+ */
161
+ export type SelectorConfig = {
162
+ /**
163
+ * Component to create on the selector
164
+ */
165
+ component?: ComponentType;
166
+ /**
167
+ * Options for that component (`schema` and `data` for `form`)
168
+ */
169
+ options?: Record<string, any>;
170
+ /**
171
+ * Applied to the matched elements once
172
+ */
173
+ initial?: InitialProperties;
174
+ /**
175
+ * Event name -> what it runs
176
+ */
177
+ events?: Record<string, EventActions>;
178
+ /**
179
+ * Called first with the matched elements
180
+ */
181
+ init?: (this: import("./dom.js").DommaCollection, $el: import("./dom.js").DommaCollection) => void;
182
+ };
183
+ /**
184
+ * Configuration keyed by selector.
185
+ */
186
+ export type SetupConfig = {
187
+ [selector: string]: SelectorConfig;
188
+ };
189
+ /**
190
+ * The declarative configuration engine behind `$.setup()`, `$.update()`, `$.config()`, `$.getComponent()` and
191
+ * `$.reset()`.
192
+ */
193
+ export type ConfigEngine = typeof configEngine;
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Read the arrow and halo colours from the live theme.
3
+ * @param {Document} [doc]
4
+ * @returns {{fill: string, halo: string}}
5
+ */
6
+ export function resolveCursorColours(doc?: Document): {
7
+ fill: string;
8
+ halo: string;
9
+ };
10
+ /**
11
+ * The cursor as an SVG string.
12
+ *
13
+ * Chrome ignores an SVG cursor with no natural size, so width and height are
14
+ * explicit on the root and the geometry lives in a fixed viewBox.
15
+ *
16
+ * @param {Object} [options]
17
+ * @param {number} [options.size=26]
18
+ * @param {string} [options.fill] arrow body
19
+ * @param {string} [options.halo] outline and glyph backing
20
+ * @returns {string}
21
+ */
22
+ export function cursorSvg({ size, fill, halo }?: {
23
+ size?: number;
24
+ fill?: string;
25
+ halo?: string;
26
+ }): string;
27
+ /**
28
+ * The full CSS `cursor` value, keyword fallback included.
29
+ *
30
+ * The fallback is not optional decoration: the spec requires a keyword at the
31
+ * end of the list, and `context-menu` is the one that means this, so both
32
+ * options ship in a single declaration and the keyword covers anything that
33
+ * refuses the image.
34
+ *
35
+ * @param {Object} [options] see cursorSvg
36
+ * @returns {string}
37
+ */
38
+ export function cursorValue(options?: any): string;
39
+ /**
40
+ * Add or replace one menu's cursor rule.
41
+ *
42
+ * @param {string|number} id unique per instance
43
+ * @param {string} selector the CSS selector the rule applies to
44
+ * @param {Object} spec
45
+ * @param {'glyph'|'keyword'|'custom'} spec.kind
46
+ * @param {number} [spec.size] glyph only
47
+ * @param {string} [spec.value] custom only, used verbatim
48
+ */
49
+ export function setCursorRule(id: string | number, selector: string, spec: {
50
+ kind: "glyph" | "keyword" | "custom";
51
+ size?: number;
52
+ value?: string;
53
+ }): void;
54
+ /** Drop one menu's rule. Called from ContextMenu#destroy. */
55
+ export function clearCursorRule(id: any): void;
56
+ /** Test seam: forget every rule and detach the theme listener. */
57
+ export function _resetCursorRules(): void;
58
+ /** The size that read best in testing. Browsers cap cursors at 128px and
59
+ * recommend 32; past about 30 it stops reading as a pointer. */
60
+ export const DEFAULT_CURSOR_SIZE: 26;
61
+ declare namespace _default {
62
+ export { cursorSvg };
63
+ export { cursorValue };
64
+ export { resolveCursorColours };
65
+ export { setCursorRule };
66
+ export { clearCursorRule };
67
+ export { DEFAULT_CURSOR_SIZE };
68
+ }
69
+ export default _default;