@zeus-js/runtime-dom 0.1.0-beta.2 → 0.1.0-beta.4

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,5 +1,5 @@
1
1
  /**
2
- * runtime-dom v0.1.0-beta.2
2
+ * runtime-dom v0.1.0-beta.4
3
3
  * (c) 2026 baicie
4
4
  * Released under the MIT License.
5
5
  **/
@@ -366,7 +366,6 @@ var ZeusRuntimeDOM = (function(exports) {
366
366
  }
367
367
  function isDirty(sub) {
368
368
  for (let link = sub.deps; link; link = link.nextDep) if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) return true;
369
- if (sub._dirty) return true;
370
369
  return false;
371
370
  }
372
371
  /**
@@ -1522,7 +1521,7 @@ var ZeusRuntimeDOM = (function(exports) {
1522
1521
  const ZEUS_CONTEXT_REQUEST = "zeus:context-request";
1523
1522
  /**
1524
1523
  * Creates a transparent DOM element that acts as a context boundary.
1525
- * Native custom elements inside it can use `requestDOMContext` to receive
1524
+ * Native custom elements inside it can use `resolveDOMContext` to receive
1526
1525
  * context values via the DOM event protocol.
1527
1526
  */
1528
1527
  function createDOMContextBoundary(context, value, children) {
@@ -1534,7 +1533,7 @@ var ZeusRuntimeDOM = (function(exports) {
1534
1533
  }
1535
1534
  /**
1536
1535
  * Registers a context value on a DOM target so that any descendant custom
1537
- * element can pick it up via `requestDOMContext`.
1536
+ * element can pick it up via `resolveDOMContext`.
1538
1537
  */
1539
1538
  function provideDOMContext(target, context, value) {
1540
1539
  const handler = (event) => {
@@ -1552,7 +1551,7 @@ var ZeusRuntimeDOM = (function(exports) {
1552
1551
  /**
1553
1552
  * Internal precise DOM context resolver.
1554
1553
  *
1555
- * Unlike requestDOMContext(), this can distinguish:
1554
+ * The result distinguishes:
1556
1555
  * - found: false, value: undefined
1557
1556
  * - found: true, value: undefined
1558
1557
  */
@@ -1581,16 +1580,6 @@ var ZeusRuntimeDOM = (function(exports) {
1581
1580
  value
1582
1581
  };
1583
1582
  }
1584
- /**
1585
- * Public compatibility API.
1586
- *
1587
- * Returns the resolved value if found, otherwise undefined.
1588
- * If you need to distinguish "not found" from "found undefined",
1589
- * use resolveDOMContext().
1590
- */
1591
- function requestDOMContext(host, context) {
1592
- return resolveDOMContext(host, context).value;
1593
- }
1594
1583
  function resolveValue$3(value) {
1595
1584
  return typeof value === "function" ? value() : value !== null && value !== void 0 ? value : null;
1596
1585
  }
@@ -1981,68 +1970,42 @@ var ZeusRuntimeDOM = (function(exports) {
1981
1970
  mountFor$1(parent, marker, each, key, render);
1982
1971
  }
1983
1972
  //#endregion
1984
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/typeof.js
1985
- function _typeof(o) {
1986
- "@babel/helpers - typeof";
1987
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
1988
- return typeof o;
1989
- } : function(o) {
1990
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
1991
- }, _typeof(o);
1992
- }
1993
- //#endregion
1994
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
1995
- function toPrimitive(t, r) {
1996
- if ("object" != _typeof(t) || !t) return t;
1997
- var e = t[Symbol.toPrimitive];
1998
- if (void 0 !== e) {
1999
- var i = e.call(t, r || "default");
2000
- if ("object" != _typeof(i)) return i;
2001
- throw new TypeError("@@toPrimitive must return a primitive value.");
2002
- }
2003
- return ("string" === r ? String : Number)(t);
2004
- }
2005
- //#endregion
2006
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
2007
- function toPropertyKey(t) {
2008
- var i = toPrimitive(t, "string");
2009
- return "symbol" == _typeof(i) ? i : i + "";
2010
- }
2011
- //#endregion
2012
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
2013
- function _defineProperty(e, r, t) {
2014
- return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
2015
- value: t,
2016
- enumerable: !0,
2017
- configurable: !0,
2018
- writable: !0
2019
- }) : e[r] = t, e;
1973
+ //#region packages/core/runtime-dom/src/defineElement.ts
1974
+ const ZEUS_ELEMENT_DEFINITION = Symbol.for("zeus.element.definition");
1975
+ function prop(input, options = {}) {
1976
+ var _options$reflect, _options$default;
1977
+ if (Array.isArray(input)) return {
1978
+ type: String,
1979
+ values: input,
1980
+ attr: options.attr,
1981
+ reflect: options.reflect,
1982
+ default: options.default,
1983
+ serialize: options.serialize,
1984
+ deserialize: options.deserialize
1985
+ };
1986
+ const type = input;
1987
+ return {
1988
+ type,
1989
+ attr: options.attr,
1990
+ reflect: type === Boolean ? (_options$reflect = options.reflect) !== null && _options$reflect !== void 0 ? _options$reflect : true : options.reflect,
1991
+ default: type === Boolean ? (_options$default = options.default) !== null && _options$default !== void 0 ? _options$default : false : options.default,
1992
+ serialize: options.serialize,
1993
+ deserialize: options.deserialize
1994
+ };
2020
1995
  }
2021
- //#endregion
2022
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/objectSpread2.js
2023
- function ownKeys(e, r) {
2024
- var t = Object.keys(e);
2025
- if (Object.getOwnPropertySymbols) {
2026
- var o = Object.getOwnPropertySymbols(e);
2027
- r && (o = o.filter(function(r) {
2028
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
2029
- })), t.push.apply(t, o);
2030
- }
2031
- return t;
2032
- }
2033
- function _objectSpread2(e) {
2034
- for (var r = 1; r < arguments.length; r++) {
2035
- var t = null != arguments[r] ? arguments[r] : {};
2036
- r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
2037
- _defineProperty(e, r, t[r]);
2038
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
2039
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
2040
- });
2041
- }
2042
- return e;
1996
+ function event(input) {
1997
+ if (typeof input === "string") return {
1998
+ __zeusEvent: true,
1999
+ name: input
2000
+ };
2001
+ return {
2002
+ __zeusEvent: true,
2003
+ name: input === null || input === void 0 ? void 0 : input.name,
2004
+ bubbles: input === null || input === void 0 ? void 0 : input.bubbles,
2005
+ composed: input === null || input === void 0 ? void 0 : input.composed,
2006
+ cancelable: input === null || input === void 0 ? void 0 : input.cancelable
2007
+ };
2043
2008
  }
2044
- //#endregion
2045
- //#region packages/core/runtime-dom/src/defineElement.ts
2046
2009
  function createPropStore(defs) {
2047
2010
  const slots = /* @__PURE__ */ new Map();
2048
2011
  const props = {};
@@ -2082,6 +2045,12 @@ var ZeusRuntimeDOM = (function(exports) {
2082
2045
  function defineElement(tagName, options, setup) {
2083
2046
  var _options$props;
2084
2047
  const propDefs = normalizePropDefinitions((_options$props = options.props) !== null && _options$props !== void 0 ? _options$props : {});
2048
+ const definition = {
2049
+ tagName,
2050
+ options,
2051
+ setup,
2052
+ propDefs
2053
+ };
2085
2054
  const observedAttributes = propDefs.filter((def) => def.attr !== false).map((def) => def.attr);
2086
2055
  class ZeusElement extends HTMLElement {
2087
2056
  static get observedAttributes() {
@@ -2096,6 +2065,13 @@ var ZeusRuntimeDOM = (function(exports) {
2096
2065
  this.props = this.propStore.props;
2097
2066
  applyPropDefaults(this.propStore, propDefs);
2098
2067
  definePropAccessors(this, this.propStore, propDefs);
2068
+ if (options.formAssociated) this.internals = attachElementInternals(this);
2069
+ this.setupContext = {
2070
+ host: this,
2071
+ internals: this.internals,
2072
+ emit: createEmitApi(this, options.emits),
2073
+ expose: createExpose(this)
2074
+ };
2099
2075
  }
2100
2076
  connectedCallback() {
2101
2077
  var _options$shadow, _options$consumes;
@@ -2119,17 +2095,10 @@ var ZeusRuntimeDOM = (function(exports) {
2119
2095
  mode,
2120
2096
  lightChildren: this.lightChildren
2121
2097
  };
2122
- const setupContext = {
2123
- host: this,
2124
- emit: (name, detail, eventOptions) => {
2125
- return this.dispatchEvent(new CustomEvent(name, _objectSpread2(_objectSpread2({
2126
- bubbles: true,
2127
- composed: true,
2128
- cancelable: true
2129
- }, eventOptions), {}, { detail })));
2130
- }
2131
- };
2132
- this.dispose = render(() => runWithOwner(owner, () => withHostContext(hostContext, () => setup(this.props, setupContext))), target, { owner });
2098
+ this.dispose = render(() => runWithOwner(owner, () => withHostContext(hostContext, () => {
2099
+ syncFormValue(this.props, this.setupContext, options.form);
2100
+ return setup(this.props, this.setupContext);
2101
+ })), target, { owner });
2133
2102
  mountStyles(target, options.styles);
2134
2103
  }
2135
2104
  disconnectedCallback() {
@@ -2137,6 +2106,22 @@ var ZeusRuntimeDOM = (function(exports) {
2137
2106
  (_this$dispose = this.dispose) === null || _this$dispose === void 0 || _this$dispose.call(this);
2138
2107
  this.dispose = void 0;
2139
2108
  }
2109
+ formAssociatedCallback(form) {
2110
+ var _options$form, _options$form$associa;
2111
+ (_options$form = options.form) === null || _options$form === void 0 || (_options$form$associa = _options$form.associated) === null || _options$form$associa === void 0 || _options$form$associa.call(_options$form, form, this.props, this.setupContext);
2112
+ }
2113
+ formDisabledCallback(disabled) {
2114
+ var _options$form2, _options$form2$disabl;
2115
+ (_options$form2 = options.form) === null || _options$form2 === void 0 || (_options$form2$disabl = _options$form2.disabled) === null || _options$form2$disabl === void 0 || _options$form2$disabl.call(_options$form2, disabled, this.props, this.setupContext);
2116
+ }
2117
+ formResetCallback() {
2118
+ var _options$form3, _options$form3$reset;
2119
+ (_options$form3 = options.form) === null || _options$form3 === void 0 || (_options$form3$reset = _options$form3.reset) === null || _options$form3$reset === void 0 || _options$form3$reset.call(_options$form3, this.props, this.setupContext);
2120
+ }
2121
+ formStateRestoreCallback(state, mode) {
2122
+ var _options$form4, _options$form4$stateR;
2123
+ (_options$form4 = options.form) === null || _options$form4 === void 0 || (_options$form4$stateR = _options$form4.stateRestore) === null || _options$form4$stateR === void 0 || _options$form4$stateR.call(_options$form4, state, mode, this.props, this.setupContext);
2124
+ }
2140
2125
  attributeChangedCallback(name, oldValue, newValue) {
2141
2126
  if (oldValue === newValue || this.reflecting) return;
2142
2127
  const def = propDefs.find((item) => item.attr === name);
@@ -2172,24 +2157,131 @@ var ZeusRuntimeDOM = (function(exports) {
2172
2157
  }
2173
2158
  }
2174
2159
  }
2160
+ ZeusElement.formAssociated = Boolean(options.formAssociated);
2175
2161
  if (!customElements.get(tagName)) customElements.define(tagName, ZeusElement);
2162
+ Object.defineProperty(ZeusElement, ZEUS_ELEMENT_DEFINITION, {
2163
+ value: definition,
2164
+ configurable: false
2165
+ });
2176
2166
  return ZeusElement;
2177
2167
  }
2168
+ function getElementDefinition(ctor) {
2169
+ const definition = ctor[ZEUS_ELEMENT_DEFINITION];
2170
+ if (!definition) throw new Error("[zeus] Element definition metadata not found.");
2171
+ return definition;
2172
+ }
2173
+ function mountElementDefinition(ctor, host, initialValues = /* @__PURE__ */ new Map(), mountState = {}) {
2174
+ var _options$shadow2, _mountState$lightChil, _options$consumes2, _mountState$target, _mountState$internals;
2175
+ const { options, setup, propDefs } = getElementDefinition(ctor);
2176
+ const propStore = createPropStore(propDefs);
2177
+ applyPropDefaults(propStore, propDefs);
2178
+ for (const def of propDefs) {
2179
+ var _mountState$attribute;
2180
+ if (def.attr !== false && ((_mountState$attribute = mountState.attributeProps) === null || _mountState$attribute === void 0 ? void 0 : _mountState$attribute.has(def.key))) {
2181
+ propStore.set(def.key, castAttributeValue(host.getAttribute(def.attr), def));
2182
+ initialValues.set(def.key, propStore.get(def.key));
2183
+ continue;
2184
+ }
2185
+ if (initialValues.has(def.key)) {
2186
+ propStore.set(def.key, initialValues.get(def.key));
2187
+ continue;
2188
+ }
2189
+ /**
2190
+ * Sync real definition defaults (e.g. factory defaults like `default: () => []`)
2191
+ * back to the lazy host value map so that `element.propName` returns the
2192
+ * correct default value rather than undefined.
2193
+ */
2194
+ initialValues.set(def.key, propStore.get(def.key));
2195
+ }
2196
+ for (const def of propDefs) {
2197
+ var _mountState$attribute2;
2198
+ if (def.reflect && def.serialize && !((_mountState$attribute2 = mountState.attributeProps) === null || _mountState$attribute2 === void 0 ? void 0 : _mountState$attribute2.has(def.key))) reflectExternalProp(host, def, propStore.get(def.key), mountState.reflectingAttrs);
2199
+ }
2200
+ const shadow = (_options$shadow2 = options.shadow) !== null && _options$shadow2 !== void 0 ? _options$shadow2 : false;
2201
+ const mode = shadow ? "shadow" : "light";
2202
+ if (mode === "light" && !mountState.capturedLightChildren) {
2203
+ mountState.lightChildren = Array.from(host.childNodes);
2204
+ mountState.capturedLightChildren = true;
2205
+ }
2206
+ const lightChildren = (_mountState$lightChil = mountState.lightChildren) !== null && _mountState$lightChil !== void 0 ? _mountState$lightChil : [];
2207
+ const owner = createOwner();
2208
+ for (const context of (_options$consumes2 = options.consumes) !== null && _options$consumes2 !== void 0 ? _options$consumes2 : []) {
2209
+ const resolved = resolveDOMContext(host, context);
2210
+ if (resolved.found) owner.provides.set(context.id, resolved.value);
2211
+ else if (context.hasDefaultValue) owner.provides.set(context.id, context.defaultValue);
2212
+ }
2213
+ const target = (_mountState$target = mountState.target) !== null && _mountState$target !== void 0 ? _mountState$target : mountState.target = resolveExternalRenderTarget(host, shadow);
2214
+ const hostContext = {
2215
+ host,
2216
+ mode,
2217
+ lightChildren
2218
+ };
2219
+ const setupContext = {
2220
+ host,
2221
+ internals: (_mountState$internals = mountState.internals) !== null && _mountState$internals !== void 0 ? _mountState$internals : options.formAssociated ? attachElementInternals(host) : void 0,
2222
+ emit: createEmitApi(host, options.emits),
2223
+ expose: createExpose(host)
2224
+ };
2225
+ mountState.internals = setupContext.internals;
2226
+ const dispose = render(() => runWithOwner(owner, () => withHostContext(hostContext, () => {
2227
+ syncFormValue(propStore.props, setupContext, options.form);
2228
+ return setup(propStore.props, setupContext);
2229
+ })), target, { owner });
2230
+ mountStyles(target, options.styles);
2231
+ return {
2232
+ propertyChanged(name, _oldValue, newValue) {
2233
+ var _mountState$attribute3;
2234
+ const def = propDefs.find((item) => item.key === name);
2235
+ const fromAttribute = Boolean((def === null || def === void 0 ? void 0 : def.attr) !== false && ((_mountState$attribute3 = mountState.attributeProps) === null || _mountState$attribute3 === void 0 ? void 0 : _mountState$attribute3.has(name)));
2236
+ const value = fromAttribute && def ? castAttributeValue(typeof newValue === "string" ? newValue : null, def) : newValue;
2237
+ propStore.set(name, value);
2238
+ initialValues.set(name, value);
2239
+ if ((def === null || def === void 0 ? void 0 : def.reflect) && !fromAttribute) reflectExternalProp(host, def, value, mountState.reflectingAttrs);
2240
+ },
2241
+ formAssociated(form) {
2242
+ var _options$form5, _options$form5$associ;
2243
+ (_options$form5 = options.form) === null || _options$form5 === void 0 || (_options$form5$associ = _options$form5.associated) === null || _options$form5$associ === void 0 || _options$form5$associ.call(_options$form5, form, propStore.props, setupContext);
2244
+ },
2245
+ formDisabled(disabled) {
2246
+ var _options$form6, _options$form6$disabl;
2247
+ (_options$form6 = options.form) === null || _options$form6 === void 0 || (_options$form6$disabl = _options$form6.disabled) === null || _options$form6$disabl === void 0 || _options$form6$disabl.call(_options$form6, disabled, propStore.props, setupContext);
2248
+ },
2249
+ formReset() {
2250
+ var _options$form7, _options$form7$reset;
2251
+ (_options$form7 = options.form) === null || _options$form7 === void 0 || (_options$form7$reset = _options$form7.reset) === null || _options$form7$reset === void 0 || _options$form7$reset.call(_options$form7, propStore.props, setupContext);
2252
+ },
2253
+ formStateRestore(state, mode) {
2254
+ var _options$form8, _options$form8$stateR;
2255
+ (_options$form8 = options.form) === null || _options$form8 === void 0 || (_options$form8$stateR = _options$form8.stateRestore) === null || _options$form8$stateR === void 0 || _options$form8$stateR.call(_options$form8, state, mode, propStore.props, setupContext);
2256
+ },
2257
+ dispose() {
2258
+ dispose();
2259
+ }
2260
+ };
2261
+ }
2178
2262
  function normalizePropDefinitions(props) {
2179
2263
  return Object.keys(props).map((key) => {
2264
+ const propKey = String(key);
2180
2265
  const input = props[key];
2181
- if (typeof input === "function") return {
2182
- key,
2183
- attr: toKebabCase(key),
2184
- type: input,
2185
- reflect: false
2186
- };
2266
+ if (typeof input === "function") {
2267
+ const type = input;
2268
+ return {
2269
+ key: propKey,
2270
+ attr: isAttributeBackedConstructor(type) ? toKebabCase(propKey) : false,
2271
+ type,
2272
+ reflect: false
2273
+ };
2274
+ }
2275
+ const type = input === null || input === void 0 ? void 0 : input.type;
2276
+ const defaultAttr = isAttributeBackedConstructor(type) ? toKebabCase(propKey) : false;
2187
2277
  return {
2188
- key,
2189
- attr: (input === null || input === void 0 ? void 0 : input.attr) === void 0 ? toKebabCase(key) : input.attr,
2190
- type: input === null || input === void 0 ? void 0 : input.type,
2278
+ key: propKey,
2279
+ attr: (input === null || input === void 0 ? void 0 : input.attr) === void 0 ? defaultAttr : input.attr,
2280
+ type,
2191
2281
  reflect: Boolean(input === null || input === void 0 ? void 0 : input.reflect),
2192
- default: input === null || input === void 0 ? void 0 : input.default
2282
+ default: input === null || input === void 0 ? void 0 : input.default,
2283
+ serialize: input === null || input === void 0 ? void 0 : input.serialize,
2284
+ deserialize: input === null || input === void 0 ? void 0 : input.deserialize
2193
2285
  };
2194
2286
  });
2195
2287
  }
@@ -2225,6 +2317,7 @@ var ZeusRuntimeDOM = (function(exports) {
2225
2317
  }
2226
2318
  }
2227
2319
  function castAttributeValue(value, def) {
2320
+ if (def.deserialize) return def.deserialize(value);
2228
2321
  if (def.type === Boolean) return value !== null;
2229
2322
  if (value === null) return;
2230
2323
  if (def.type === Number) return Number(value);
@@ -2234,10 +2327,17 @@ var ZeusRuntimeDOM = (function(exports) {
2234
2327
  console.warn(`[Zeus custom-element] Failed to parse JSON attribute "${def.attr}".`);
2235
2328
  return def.type === Array ? [] : {};
2236
2329
  }
2330
+ if (def.type === Function) return;
2237
2331
  return value;
2238
2332
  }
2239
2333
  function reflectPropToAttribute(element, def, value) {
2240
2334
  if (def.attr === false) return;
2335
+ if (def.serialize) {
2336
+ const serialized = def.serialize(value);
2337
+ if (serialized == null) element.removeAttribute(def.attr);
2338
+ else element.setAttribute(def.attr, serialized);
2339
+ return;
2340
+ }
2241
2341
  if (def.type === Boolean) {
2242
2342
  if (value) element.setAttribute(def.attr, "");
2243
2343
  else element.removeAttribute(def.attr);
@@ -2251,8 +2351,85 @@ var ZeusRuntimeDOM = (function(exports) {
2251
2351
  element.setAttribute(def.attr, JSON.stringify(value));
2252
2352
  return;
2253
2353
  }
2354
+ if (def.type === Function) return;
2254
2355
  element.setAttribute(def.attr, String(value));
2255
2356
  }
2357
+ function reflectExternalProp(element, def, value, reflectingAttrs) {
2358
+ if (def.attr === false) return;
2359
+ const attrName = def.attr.toLowerCase();
2360
+ reflectingAttrs === null || reflectingAttrs === void 0 || reflectingAttrs.add(attrName);
2361
+ try {
2362
+ reflectPropToAttribute(element, def, value);
2363
+ } finally {
2364
+ reflectingAttrs === null || reflectingAttrs === void 0 || reflectingAttrs.delete(attrName);
2365
+ }
2366
+ }
2367
+ function syncFormValue(props, context, form) {
2368
+ const valueResolver = form === null || form === void 0 ? void 0 : form.value;
2369
+ const stateResolver = form === null || form === void 0 ? void 0 : form.state;
2370
+ if (!context.internals || valueResolver === void 0) return;
2371
+ effect(() => {
2372
+ const value = resolveFormValue(props, valueResolver);
2373
+ const state = stateResolver === void 0 ? void 0 : resolveFormValue(props, stateResolver);
2374
+ context.internals.setFormValue(value, state);
2375
+ });
2376
+ }
2377
+ function resolveFormValue(props, resolver) {
2378
+ if (typeof resolver === "function") {
2379
+ var _resolver;
2380
+ return (_resolver = resolver(props)) !== null && _resolver !== void 0 ? _resolver : null;
2381
+ }
2382
+ const value = props[resolver];
2383
+ return value == null ? null : value;
2384
+ }
2385
+ function attachElementInternals(host) {
2386
+ const attachInternals = host.attachInternals;
2387
+ if (typeof attachInternals !== "function") return;
2388
+ try {
2389
+ return attachInternals.call(host);
2390
+ } catch (error) {
2391
+ console.warn("[Zeus custom-element] Failed to attach ElementInternals.", error);
2392
+ return;
2393
+ }
2394
+ }
2395
+ function createEmitApi(host, emits) {
2396
+ const emit = {};
2397
+ const dispatch = (name, detail, options) => {
2398
+ var _definition$name, _ref, _options$bubbles, _ref2, _options$composed, _ref3, _options$cancelable;
2399
+ const definition = emits === null || emits === void 0 ? void 0 : emits[name];
2400
+ return host.dispatchEvent(new CustomEvent((_definition$name = definition === null || definition === void 0 ? void 0 : definition.name) !== null && _definition$name !== void 0 ? _definition$name : toKebabCase(name), {
2401
+ bubbles: (_ref = (_options$bubbles = options === null || options === void 0 ? void 0 : options.bubbles) !== null && _options$bubbles !== void 0 ? _options$bubbles : definition === null || definition === void 0 ? void 0 : definition.bubbles) !== null && _ref !== void 0 ? _ref : true,
2402
+ composed: (_ref2 = (_options$composed = options === null || options === void 0 ? void 0 : options.composed) !== null && _options$composed !== void 0 ? _options$composed : definition === null || definition === void 0 ? void 0 : definition.composed) !== null && _ref2 !== void 0 ? _ref2 : true,
2403
+ cancelable: (_ref3 = (_options$cancelable = options === null || options === void 0 ? void 0 : options.cancelable) !== null && _options$cancelable !== void 0 ? _options$cancelable : definition === null || definition === void 0 ? void 0 : definition.cancelable) !== null && _ref3 !== void 0 ? _ref3 : false,
2404
+ detail
2405
+ }));
2406
+ };
2407
+ if (emits) for (const key of Object.keys(emits)) Object.defineProperty(emit, key, {
2408
+ configurable: true,
2409
+ enumerable: true,
2410
+ value(detail, options) {
2411
+ return dispatch(key, detail, options);
2412
+ }
2413
+ });
2414
+ return emit;
2415
+ }
2416
+ function createExpose(host) {
2417
+ return (methods) => {
2418
+ for (const key of Object.keys(methods)) Object.defineProperty(host, key, {
2419
+ configurable: true,
2420
+ enumerable: false,
2421
+ value: methods[key]
2422
+ });
2423
+ };
2424
+ }
2425
+ function isAttributeBackedConstructor(type) {
2426
+ return type === String || type === Number || type === Boolean;
2427
+ }
2428
+ function resolveExternalRenderTarget(host, shadow) {
2429
+ var _host$shadowRoot;
2430
+ if (!shadow) return host;
2431
+ return (_host$shadowRoot = host.shadowRoot) !== null && _host$shadowRoot !== void 0 ? _host$shadowRoot : host.attachShadow(typeof shadow === "object" ? shadow : { mode: "open" });
2432
+ }
2256
2433
  function mountStyles(target, styles) {
2257
2434
  if (!styles) return;
2258
2435
  const list = Array.isArray(styles) ? styles : [styles];
@@ -2394,6 +2571,7 @@ var ZeusRuntimeDOM = (function(exports) {
2394
2571
  exports.Show = Show;
2395
2572
  exports.Slot = Slot;
2396
2573
  exports.ZEUS_CONTEXT_REQUEST = ZEUS_CONTEXT_REQUEST;
2574
+ exports.ZEUS_ELEMENT_DEFINITION = ZEUS_ELEMENT_DEFINITION;
2397
2575
  exports.bindAttr = bindAttr;
2398
2576
  exports.bindClass = bindClass;
2399
2577
  exports.bindEvent = bindEvent;
@@ -2411,21 +2589,24 @@ var ZeusRuntimeDOM = (function(exports) {
2411
2589
  exports.createSlot = createSlot;
2412
2590
  exports.defineElement = defineElement;
2413
2591
  exports.delegateEvents = delegateEvents;
2592
+ exports.event = event;
2414
2593
  exports.getCurrentHostContext = getCurrentHostContext;
2415
2594
  exports.getCurrentOwner = getCurrentOwner;
2595
+ exports.getElementDefinition = getElementDefinition;
2416
2596
  exports.inject = inject;
2417
2597
  exports.insert = insert;
2418
2598
  exports.insertTracked = insertTracked;
2419
2599
  exports.marker = marker;
2420
2600
  exports.mountDynamic = mountDynamic;
2601
+ exports.mountElementDefinition = mountElementDefinition;
2421
2602
  exports.mountFor = mountFor;
2422
2603
  exports.mountShow = mountShow;
2423
2604
  exports.normalizeClass = normalizeClass;
2605
+ exports.prop = prop;
2424
2606
  exports.provide = provide;
2425
2607
  exports.provideDOMContext = provideDOMContext;
2426
2608
  exports.removeNodes = removeNodes;
2427
2609
  exports.render = render;
2428
- exports.requestDOMContext = requestDOMContext;
2429
2610
  exports.resolveDOMContext = resolveDOMContext;
2430
2611
  exports.resolveValue = resolveValue;
2431
2612
  exports.runWithOwner = runWithOwner;