@sigx/runtime-dom 0.1.7 → 0.1.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../src/Portal.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAa,UAAU,EAA0C,MAAM,oBAAoB,CAAC;AAInG;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CACpB,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,IAAI,EACV,MAAM,GAAE,IAAI,GAAG,IAAW,GAC3B,IAAI,CAQN;AAuBD,KAAK,WAAW,GAAG,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,UAAU,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAExF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,sEA2EG,CAAC"}
1
+ {"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../src/Portal.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAa,UAAU,EAAwB,MAAM,oBAAoB,CAAC;AAKjF;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CACpB,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,IAAI,EACV,MAAM,GAAE,IAAI,GAAG,IAAW,GAC3B,IAAI,CAQN;AAuBD,KAAK,WAAW,GAAG,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,UAAU,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAExF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,sEA2EG,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import './jsx';
2
2
  import './types';
3
3
  import './directives/show-jsx-types';
4
- import { RendererOptions } from '@sigx/runtime-core';
5
- import { type DirectiveDefinition } from '@sigx/runtime-core';
4
+ import type { RendererOptions } from '@sigx/runtime-core/internals';
5
+ import { type DirectiveDefinition, type JSXElement } from '@sigx/runtime-core';
6
6
  import type { AppContext } from '@sigx/runtime-core';
7
7
  /**
8
8
  * A directive definition narrowed to DOM elements.
@@ -61,24 +61,9 @@ declare const nodeOps: RendererOptions<Node, Element>;
61
61
  * render(<App />, document.getElementById('app')!);
62
62
  * ```
63
63
  */
64
- export declare const render: (element: any, container: Element | string, appContext?: any) => void;
65
- export declare const patch: import("@sigx/runtime-core").RendererPatchFn<Node, Element>, mount: import("@sigx/runtime-core").RendererMountFn<Node, Element>, unmount: import("@sigx/runtime-core").RendererUnmountFn<Node, Element>, mountComponent: import("@sigx/runtime-core").RendererMountComponentFn<Node, Element>;
64
+ export declare const render: (element: JSXElement, container: Element | string, appContext?: AppContext) => void;
65
+ export declare const patch: import("@sigx/runtime-core/internals").RendererPatchFn<Node, Element>, mount: import("@sigx/runtime-core/internals").RendererMountFn<Node, Element>, unmount: import("@sigx/runtime-core/internals").RendererUnmountFn<Node, Element>, mountComponent: import("@sigx/runtime-core/internals").RendererMountComponentFn<Node, Element>;
66
66
  export { patchProp, patchDirective, onElementMounted, nodeOps };
67
- /**
68
- * Mount function for DOM environments.
69
- * Use this with defineApp().mount() to render to the DOM.
70
- *
71
- * @example
72
- * ```tsx
73
- * import { defineApp } from '@sigx/runtime-core';
74
- * import { domMount } from '@sigx/runtime-dom';
75
- *
76
- * const app = defineApp(<App />);
77
- * app.use(routerPlugin)
78
- * .mount(document.getElementById('app')!, domMount);
79
- * ```
80
- */
81
- export declare const domMount: (component: any, container: HTMLElement | Element | ShadowRoot | string, appContext?: any) => (() => void);
82
67
  export { Portal, supportsMoveBefore, moveNode } from './Portal.js';
83
68
  export { show } from './directives/show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Ac,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,GAAG,IAAI,CAoEtH;AAED;;;;GAIG;AACH,iBAAS,gBAAgB,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,CAS3C;AA+ID,iBAAS,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,OAAO,QAgL5F;AAED,QAAA,MAAM,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,OAAO,CAoD3C,CAAC;AAIF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,MAAM,GAAI,SAAS,UAAU,EAAE,WAAW,OAAO,GAAG,MAAM,EAAE,aAAa,UAAU,KAAG,IAUlG,CAAC;AAGF,eAAO,MAAQ,KAAK,yEAAE,KAAK,yEAAE,OAAO,2EAAE,cAAc,gFAAa,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;AAoBhE,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGnE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -1,372 +1,2 @@
1
- import { Fragment, component as component$1, createRenderer, defineDirective, isDirective, jsx, normalizeSubTree, setDefaultMount, setPlatformModelProcessor } from "@sigx/runtime-core";
2
- import { effect } from "@sigx/reactivity";
3
- function supportsMoveBefore() {
4
- return typeof Node !== "undefined" && "moveBefore" in Node.prototype;
5
- }
6
- function moveNode(parent, node, anchor = null) {
7
- if (supportsMoveBefore()) parent.moveBefore(node, anchor);
8
- else parent.insertBefore(node, anchor);
9
- }
10
- function resolveTarget(target) {
11
- if (target === void 0) return document.body;
12
- if (typeof target === "string") {
13
- const resolved = document.querySelector(target);
14
- if (!resolved) {
15
- console.warn(`Portal: Target "${target}" not found, falling back to document.body`);
16
- return document.body;
17
- }
18
- return resolved;
19
- }
20
- return target;
21
- }
22
- const Portal = component$1(({ props, slots, onMounted, onUnmounted }) => {
23
- let portalContainer = null;
24
- let mountedVNode = null;
25
- let cleanupEffect = null;
26
- onMounted(() => {
27
- if (props.disabled) return;
28
- const targetContainer = resolveTarget(props.to);
29
- portalContainer = document.createElement("div");
30
- portalContainer.setAttribute("data-sigx-portal", "");
31
- moveNode(targetContainer, portalContainer);
32
- cleanupEffect = effect(() => {
33
- const children = slots.default();
34
- if (!portalContainer) return;
35
- const vnode = normalizeSubTree(children);
36
- if (mountedVNode) patch(mountedVNode, vnode, portalContainer);
37
- else mount(vnode, portalContainer);
38
- mountedVNode = vnode;
39
- });
40
- });
41
- onUnmounted(() => {
42
- if (cleanupEffect) {
43
- cleanupEffect();
44
- cleanupEffect = null;
45
- }
46
- if (mountedVNode && portalContainer) {
47
- unmount(mountedVNode, portalContainer);
48
- mountedVNode = null;
49
- }
50
- if (portalContainer && portalContainer.parentNode) portalContainer.parentNode.removeChild(portalContainer);
51
- portalContainer = null;
52
- });
53
- return () => {
54
- if (props.disabled) return jsx(Fragment, { children: slots.default() });
55
- return null;
56
- };
57
- }, { name: "Portal" });
58
- var ORIGINAL_DISPLAY = Symbol("sigx.show.originalDisplay");
59
- const show = defineDirective({
60
- mounted(el, { value }) {
61
- const showEl = el;
62
- const saved = showEl.style.display === "none" ? "" : showEl.style.display;
63
- showEl[ORIGINAL_DISPLAY] = saved;
64
- showEl.style.display = value ? saved : "none";
65
- },
66
- updated(el, { value, oldValue }) {
67
- if (value !== oldValue) {
68
- const showEl = el;
69
- showEl.style.display = value ? showEl[ORIGINAL_DISPLAY] ?? "" : "none";
70
- }
71
- },
72
- unmounted(el) {
73
- const showEl = el;
74
- const original = showEl[ORIGINAL_DISPLAY];
75
- if (original !== void 0) showEl.style.display = original;
76
- }
77
- });
78
- var builtInDirectives = /* @__PURE__ */ new Map();
79
- function registerBuiltInDirective(name, def) {
80
- builtInDirectives.set(name, def);
81
- }
82
- function resolveBuiltInDirective(name) {
83
- return builtInDirectives.get(name);
84
- }
85
- var DIRECTIVE_STATE = Symbol.for("sigx.directives");
86
- function getDirectiveMap(el) {
87
- let map = el[DIRECTIVE_STATE];
88
- if (!map) {
89
- map = /* @__PURE__ */ new Map();
90
- el[DIRECTIVE_STATE] = map;
91
- }
92
- return map;
93
- }
94
- function patchDirective(el, name, prevValue, nextValue, appContext) {
95
- const dirMap = getDirectiveMap(el);
96
- if (nextValue == null) {
97
- dirMap.delete(name);
98
- return;
99
- }
100
- let def;
101
- let value;
102
- if (isDirective(nextValue)) {
103
- def = nextValue;
104
- value = void 0;
105
- } else if (Array.isArray(nextValue) && nextValue.length >= 1 && isDirective(nextValue[0])) {
106
- def = nextValue[0];
107
- value = nextValue[1];
108
- } else {
109
- const builtIn = builtInDirectives.get(name);
110
- if (builtIn) {
111
- def = builtIn;
112
- value = nextValue;
113
- } else {
114
- const custom = appContext?.directives.get(name);
115
- if (custom) {
116
- def = custom;
117
- value = nextValue;
118
- } else {
119
- console.warn(`[sigx] Directive "use:${name}" could not be resolved. Make sure to register it via app.directive('${name}', definition) or pass a directive definition directly.`);
120
- return;
121
- }
122
- }
123
- }
124
- const existing = dirMap.get(name);
125
- if (!existing) {
126
- const state = {
127
- def,
128
- value
129
- };
130
- dirMap.set(name, state);
131
- if (def.created) def.created(el, { value });
132
- } else {
133
- const oldValue = existing.value;
134
- existing.def = def;
135
- existing.value = value;
136
- if (def.updated && value !== oldValue) def.updated(el, {
137
- value,
138
- oldValue
139
- });
140
- }
141
- }
142
- function onElementMounted(el) {
143
- const map = el[DIRECTIVE_STATE];
144
- if (!map) return;
145
- for (const [, state] of map) if (state.def.mounted) state.def.mounted(el, { value: state.value });
146
- }
147
- function onElementUnmounted(el) {
148
- const map = el[DIRECTIVE_STATE];
149
- if (!map) return;
150
- for (const [, state] of map) {
151
- if (state.def.unmounted) state.def.unmounted(el, { value: state.value });
152
- if (state.cleanup) state.cleanup();
153
- }
154
- map.clear();
155
- delete el[DIRECTIVE_STATE];
156
- }
157
- var svgNS = "http://www.w3.org/2000/svg";
158
- setPlatformModelProcessor((type, props, [stateObj, key], originalProps) => {
159
- const setValue = (v) => {
160
- const updateHandler = stateObj[`onUpdate:${key}`];
161
- if (typeof updateHandler === "function") updateHandler(v);
162
- else stateObj[key] = v;
163
- };
164
- if (type === "input" && originalProps.type === "checkbox") {
165
- const val = stateObj[key];
166
- if (Array.isArray(val)) {
167
- props.checked = val.includes(originalProps.value);
168
- const existingHandler = props["onUpdate:modelValue"];
169
- props["onUpdate:modelValue"] = (checked) => {
170
- const currentVal = originalProps.value;
171
- const currentArr = stateObj[key];
172
- if (checked) {
173
- if (!currentArr.includes(currentVal)) setValue([...currentArr, currentVal]);
174
- } else setValue(currentArr.filter((i) => i !== currentVal));
175
- if (existingHandler) existingHandler(checked);
176
- };
177
- } else {
178
- props.checked = val;
179
- const existingHandler = props["onUpdate:modelValue"];
180
- props["onUpdate:modelValue"] = (v) => {
181
- setValue(v);
182
- if (existingHandler) existingHandler(v);
183
- };
184
- }
185
- return true;
186
- }
187
- if (type === "input" && originalProps.type === "radio") {
188
- props.checked = stateObj[key] === originalProps.value;
189
- const existingHandler = props["onUpdate:modelValue"];
190
- props["onUpdate:modelValue"] = (checked) => {
191
- if (checked) setValue(originalProps.value);
192
- if (existingHandler) existingHandler(checked);
193
- };
194
- return true;
195
- }
196
- if (type === "input") {
197
- props.value = stateObj[key] ?? "";
198
- const existingHandler = props["onUpdate:modelValue"];
199
- props["onUpdate:modelValue"] = (v) => {
200
- setValue(v);
201
- if (existingHandler) existingHandler(v);
202
- };
203
- return true;
204
- }
205
- if (type === "textarea") {
206
- props.value = stateObj[key] ?? "";
207
- const existingHandler = props["onUpdate:modelValue"];
208
- props["onUpdate:modelValue"] = (v) => {
209
- setValue(v);
210
- if (existingHandler) existingHandler(v);
211
- };
212
- return true;
213
- }
214
- if (type === "select") {
215
- props.value = stateObj[key] ?? "";
216
- const existingHandler = props["onUpdate:modelValue"];
217
- props["onUpdate:modelValue"] = (v) => {
218
- setValue(v);
219
- if (existingHandler) existingHandler(v);
220
- };
221
- return true;
222
- }
223
- return false;
224
- });
225
- function patchProp(dom, key, prevValue, nextValue, isSVG) {
226
- if (!dom) return;
227
- const tagName = dom.tagName.toLowerCase();
228
- const isSvgElement = isSVG ?? dom instanceof SVGElement;
229
- const oldValue = prevValue;
230
- const newValue = nextValue;
231
- if (key === "children" || key === "key" || key === "ref") return;
232
- if (key === "style") {
233
- const el = dom;
234
- if (typeof newValue === "object" && newValue !== null) {
235
- const styleObj = newValue;
236
- for (const styleKey in styleObj) if (styleKey.startsWith("--")) el.style.setProperty(styleKey, String(styleObj[styleKey]));
237
- else el.style[styleKey] = styleObj[styleKey];
238
- } else el.style.cssText = String(newValue);
239
- } else if (key.startsWith("on")) {
240
- if (key === "onUpdate:modelValue" && (tagName === "input" || tagName === "textarea" || tagName === "select")) {
241
- const el = dom;
242
- if (oldValue) {
243
- const wrapper = oldValue.__sigx_model_handler;
244
- if (wrapper) {
245
- el.removeEventListener("input", wrapper);
246
- el.removeEventListener("change", wrapper);
247
- }
248
- }
249
- if (newValue) {
250
- const handler = (e) => {
251
- const target = e.target;
252
- let val;
253
- if (target.type === "checkbox" || target.type === "radio") val = target.checked;
254
- else if (target.type === "number") val = target.valueAsNumber;
255
- else if (tagName === "select" && dom.multiple) val = Array.from(dom.selectedOptions).map((o) => o.value);
256
- else val = target.value;
257
- newValue(val);
258
- };
259
- newValue.__sigx_model_handler = handler;
260
- const inputType = dom.type;
261
- if (tagName === "select" || tagName === "input" && (inputType === "checkbox" || inputType === "radio")) el.addEventListener("change", handler);
262
- else el.addEventListener("input", handler);
263
- }
264
- return;
265
- }
266
- const eventName = key.slice(2).toLowerCase();
267
- const handlersKey = "__sigx_event_handlers";
268
- let handlers = dom[handlersKey];
269
- if (!handlers) {
270
- handlers = /* @__PURE__ */ new Map();
271
- dom[handlersKey] = handlers;
272
- }
273
- const oldHandler = handlers.get(eventName);
274
- if (oldHandler) {
275
- dom.removeEventListener(eventName, oldHandler);
276
- handlers.delete(eventName);
277
- }
278
- if (newValue) {
279
- const handler = (e) => {
280
- if (e instanceof CustomEvent) newValue(e.detail);
281
- else newValue(e);
282
- };
283
- handlers.set(eventName, handler);
284
- dom.addEventListener(eventName, handler);
285
- }
286
- } else if (key === "className") dom.setAttribute("class", String(newValue));
287
- else if (key.startsWith(".")) {
288
- const propName = key.slice(1);
289
- dom[propName] = newValue;
290
- } else if (key.startsWith("prop:")) {
291
- const propName = key.slice(5);
292
- dom[propName] = newValue;
293
- } else if (isSvgElement) if (key === "innerHTML" || key === "textContent") dom[key] = newValue ?? "";
294
- else if (key.startsWith("xlink:")) {
295
- const xlinkNS = "http://www.w3.org/1999/xlink";
296
- if (newValue == null) dom.removeAttributeNS(xlinkNS, key.slice(6));
297
- else dom.setAttributeNS(xlinkNS, key, String(newValue));
298
- } else if (newValue === true) dom.setAttribute(key, "");
299
- else if (newValue === false || newValue == null) dom.removeAttribute(key);
300
- else dom.setAttribute(key, String(newValue));
301
- else if ((tagName === "input" || tagName === "textarea" || tagName === "select") && (key === "value" || key === "checked")) {
302
- if (tagName === "select" && key === "value") {
303
- queueMicrotask(() => {
304
- dom.value = String(newValue ?? "");
305
- });
306
- return;
307
- }
308
- if (key === "checked" && tagName === "input") dom.checked = Boolean(newValue);
309
- else if (key === "value") dom.value = String(newValue ?? "");
310
- } else if (key in dom) if (newValue == null) {
311
- if (dom.hasAttribute?.(key)) dom.removeAttribute(key);
312
- } else try {
313
- dom[key] = newValue;
314
- } catch (e) {
315
- dom.setAttribute(key, String(newValue));
316
- }
317
- else if (tagName.includes("-") && !key.includes("-")) dom[key] = newValue;
318
- else if (newValue === true) dom.setAttribute(key, "");
319
- else if (newValue === false || newValue == null) dom.removeAttribute(key);
320
- else dom.setAttribute(key, String(newValue));
321
- }
322
- var nodeOps = {
323
- insert: (child, parent, anchor) => {
324
- parent.insertBefore(child, anchor || null);
325
- },
326
- remove: (child) => {
327
- const parent = child.parentNode;
328
- if (parent) parent.removeChild(child);
329
- },
330
- createElement: (tag, isSVG, isCustomizedBuiltIn) => {
331
- if (isSVG) return document.createElementNS(svgNS, tag);
332
- const is = isCustomizedBuiltIn ? { is: isCustomizedBuiltIn } : void 0;
333
- return document.createElement(tag, is);
334
- },
335
- createText: (text) => document.createTextNode(text),
336
- createComment: (text) => document.createComment(text),
337
- setText: (node, text) => {
338
- node.nodeValue = text;
339
- },
340
- setElementText: (el, text) => {
341
- el.textContent = text;
342
- },
343
- parentNode: (node) => node.parentNode,
344
- nextSibling: (node) => node.nextSibling,
345
- querySelector: (selector) => document.querySelector(selector),
346
- setScopeId: (el, id) => el.setAttribute(id, ""),
347
- cloneNode: (node) => node.cloneNode(true),
348
- patchProp,
349
- patchDirective,
350
- onElementMounted,
351
- onElementUnmounted
352
- };
353
- var renderer = createRenderer(nodeOps);
354
- const render = (element, container, appContext) => {
355
- const target = typeof container === "string" ? document.querySelector(container) : container;
356
- if (!target) throw new Error(`Render target "${container}" not found.`);
357
- return renderer.render(element, target, appContext);
358
- };
359
- const { patch, mount, unmount, mountComponent } = renderer;
360
- const domMount = (component, container, appContext) => {
361
- const target = typeof container === "string" ? document.querySelector(container) : container;
362
- if (!target) throw new Error(`Mount target "${container}" not found.`);
363
- render(component, target, appContext);
364
- return () => {
365
- render(null, target);
366
- };
367
- };
368
- setDefaultMount(domMount);
369
- registerBuiltInDirective("show", show);
370
- export { Portal, domMount, mount, mountComponent, moveNode, nodeOps, onElementMounted, patch, patchDirective, patchProp, registerBuiltInDirective, render, resolveBuiltInDirective, show, supportsMoveBefore, unmount };
371
-
372
- //# sourceMappingURL=index.js.map
1
+ import { a as patch, c as registerBuiltInDirective, d as unmount, f as show, h as supportsMoveBefore, i as onElementMounted, l as render, m as moveNode, n as mountComponent, o as patchDirective, p as Portal, r as nodeOps, s as patchProp, t as mount, u as resolveBuiltInDirective } from "./src-DblUVEtM.js";
2
+ export { Portal, mount, mountComponent, moveNode, nodeOps, onElementMounted, patch, patchDirective, patchProp, registerBuiltInDirective, render, resolveBuiltInDirective, show, supportsMoveBefore, unmount };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @sigx/runtime-dom internal APIs
3
+ *
4
+ * ⚠️ These are low-level DOM renderer primitives for SSR hydration and
5
+ * framework extensions. They are NOT part of the public API and may change
6
+ * without notice.
7
+ *
8
+ * @internal
9
+ */
10
+ export { patch, mount, unmount, mountComponent, patchProp, patchDirective, onElementMounted, nodeOps } from './index.js';
11
+ export { registerBuiltInDirective, resolveBuiltInDirective } from './index.js';
12
+ //# sourceMappingURL=internals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internals.d.ts","sourceRoot":"","sources":["../src/internals.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGzH,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { a as patch, c as registerBuiltInDirective, d as unmount, i as onElementMounted, n as mountComponent, o as patchDirective, r as nodeOps, s as patchProp, t as mount, u as resolveBuiltInDirective } from "./src-DblUVEtM.js";
2
+ export { mount, mountComponent, nodeOps, onElementMounted, patch, patchDirective, patchProp, registerBuiltInDirective, resolveBuiltInDirective, unmount };
package/dist/jsx.d.ts CHANGED
@@ -94,6 +94,34 @@ interface CSSProperties {
94
94
  userSelect?: 'auto' | 'none' | 'text' | 'all';
95
95
  objectFit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
96
96
  objectPosition?: string;
97
+ aspectRatio?: CSSNumericProperty;
98
+ placeItems?: string;
99
+ placeContent?: string;
100
+ placeSelf?: string;
101
+ inset?: CSSNumericProperty;
102
+ insetBlock?: CSSNumericProperty;
103
+ insetInline?: CSSNumericProperty;
104
+ containerType?: 'normal' | 'size' | 'inline-size';
105
+ containerName?: string;
106
+ contain?: string;
107
+ contentVisibility?: 'visible' | 'hidden' | 'auto';
108
+ backdropFilter?: string;
109
+ clipPath?: string;
110
+ filter?: string;
111
+ maskImage?: string;
112
+ maskSize?: string;
113
+ maskPosition?: string;
114
+ maskRepeat?: string;
115
+ overscrollBehavior?: string;
116
+ scrollSnapType?: string;
117
+ scrollSnapAlign?: string;
118
+ scrollBehavior?: 'auto' | 'smooth';
119
+ scrollMargin?: CSSNumericProperty;
120
+ scrollPadding?: CSSNumericProperty;
121
+ textDecorationThickness?: CSSNumericProperty;
122
+ textUnderlineOffset?: CSSNumericProperty;
123
+ accentColor?: string;
124
+ colorScheme?: string;
97
125
  [key: string]: CSSNumericProperty | undefined;
98
126
  }
99
127
  declare global {
@@ -243,6 +271,35 @@ declare global {
243
271
  tspan: SVGAttributes<SVGTSpanElement>;
244
272
  textPath: SVGAttributes<SVGTextPathElement>;
245
273
  symbol: SVGAttributes<SVGSymbolElement>;
274
+ feBlend: SVGAttributes<SVGFEBlendElement>;
275
+ feColorMatrix: SVGAttributes<SVGFEColorMatrixElement>;
276
+ feComponentTransfer: SVGAttributes<SVGFEComponentTransferElement>;
277
+ feComposite: SVGAttributes<SVGFECompositeElement>;
278
+ feConvolveMatrix: SVGAttributes<SVGFEConvolveMatrixElement>;
279
+ feDiffuseLighting: SVGAttributes<SVGFEDiffuseLightingElement>;
280
+ feDisplacementMap: SVGAttributes<SVGFEDisplacementMapElement>;
281
+ feDistantLight: SVGAttributes<SVGFEDistantLightElement>;
282
+ feDropShadow: SVGAttributes<SVGFEDropShadowElement>;
283
+ feFlood: SVGAttributes<SVGFEFloodElement>;
284
+ feFuncA: SVGAttributes<SVGFEFuncAElement>;
285
+ feFuncB: SVGAttributes<SVGFEFuncBElement>;
286
+ feFuncG: SVGAttributes<SVGFEFuncGElement>;
287
+ feFuncR: SVGAttributes<SVGFEFuncRElement>;
288
+ feGaussianBlur: SVGAttributes<SVGFEGaussianBlurElement>;
289
+ feImage: SVGAttributes<SVGFEImageElement>;
290
+ feMerge: SVGAttributes<SVGFEMergeElement>;
291
+ feMergeNode: SVGAttributes<SVGFEMergeNodeElement>;
292
+ feMorphology: SVGAttributes<SVGFEMorphologyElement>;
293
+ feOffset: SVGAttributes<SVGFEOffsetElement>;
294
+ fePointLight: SVGAttributes<SVGFEPointLightElement>;
295
+ feSpecularLighting: SVGAttributes<SVGFESpecularLightingElement>;
296
+ feSpotLight: SVGAttributes<SVGFESpotLightElement>;
297
+ feTile: SVGAttributes<SVGFETileElement>;
298
+ feTurbulence: SVGAttributes<SVGFETurbulenceElement>;
299
+ animate: SVGAttributes<SVGAnimateElement>;
300
+ animateMotion: SVGAttributes<SVGAnimateMotionElement>;
301
+ animateTransform: SVGAttributes<SVGAnimateTransformElement>;
302
+ metadata: SVGAttributes<SVGMetadataElement>;
246
303
  }
247
304
  /**
248
305
  * Extension point for directive `use:*` props with IntelliSense.
@@ -413,7 +470,7 @@ declare global {
413
470
  onDurationChange?: (event: Event) => void;
414
471
  onEmptied?: (event: Event) => void;
415
472
  onEnded?: (event: Event) => void;
416
- onError?: (event: Event | string) => void;
473
+ onError?: (event: Event) => void;
417
474
  onFocus?: (event: FocusEvent) => void;
418
475
  onInput?: (event: InputEvent) => void;
419
476
  onInvalid?: (event: Event) => void;