@xaendar/core 0.7.7 → 0.7.8

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.
@@ -157,7 +157,7 @@ export declare class Context {
157
157
  *
158
158
  * @param _root - Web component reference used to resolve property and method bindings.
159
159
  */
160
- constructor(_root: BaseWebComponent, _parent: Context);
160
+ constructor(_root: BaseWebComponent, _parent: Context | undefined, namespace: 'svg' | undefined);
161
161
  /**
162
162
  * Registers a new identifier name in this scope.
163
163
  *
@@ -539,9 +539,10 @@ var Context = class {
539
539
  *
540
540
  * @param _root - Web component reference used to resolve property and method bindings.
541
541
  */
542
- constructor(_root, _parent) {
542
+ constructor(_root, _parent, namespace) {
543
543
  this._root = _root;
544
544
  this._parent = _parent;
545
+ this._namespace = this._parent?.namespace ?? namespace;
545
546
  }
546
547
  /**
547
548
  * Registers a new identifier name in this scope.
@@ -943,8 +944,7 @@ function teardown(parentContext, state) {
943
944
  * @returns The newly created HTML element.
944
945
  */
945
946
  function _renderElement(parentNode, context, anchor, tagName, attributes, events) {
946
- if (tagName === "svg") context.namespace = "svg";
947
- const element = context.namespace === "svg" ? document.createElementNS(SVG_NS, tagName) : document.createElement(tagName);
947
+ const element = context.namespace === "svg" || tagName === "svg" ? document.createElementNS(SVG_NS, tagName) : document.createElement(tagName);
948
948
  mountNode(element, parentNode, context, anchor);
949
949
  attributes.forEach(({ name, value, literal }) => {
950
950
  literal ? element.setAttribute(name, String(value())) : context.listen(effect(() => element.setAttribute(name, String(value()))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaendar/core",
3
- "version": "0.7.7",
3
+ "version": "0.7.8",
4
4
  "description": "A library containing core utils such as webcomponent base classes and theming support",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -16,7 +16,7 @@
16
16
  }
17
17
  },
18
18
  "dependencies": {
19
- "@xaendar/signals": "0.7.7",
20
- "@xaendar/types": "0.7.7"
19
+ "@xaendar/signals": "0.7.8",
20
+ "@xaendar/types": "0.7.8"
21
21
  }
22
22
  }