@xaendar/core 0.7.6 → 0.7.7
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.
- package/dist/xaendar-core.es.d.ts +5 -2
- package/dist/xaendar-core.es.js +10 -1
- package/package.json +3 -3
|
@@ -149,6 +149,9 @@ export declare class Context {
|
|
|
149
149
|
* detach event listeners, and dispose signal effect subscriptions.
|
|
150
150
|
*/
|
|
151
151
|
private _unwatchFns;
|
|
152
|
+
private _namespace;
|
|
153
|
+
get namespace(): 'svg' | undefined;
|
|
154
|
+
set namespace(value: 'svg');
|
|
152
155
|
/**
|
|
153
156
|
* Creates a new scope context.
|
|
154
157
|
*
|
|
@@ -464,7 +467,7 @@ declare type IterationVariablesHandle = {
|
|
|
464
467
|
* @param referenceNode - The node to insert relative to (same semantics
|
|
465
468
|
* as `Node.insertBefore`). If `null`, the node is appended at the end of `parentNode`.
|
|
466
469
|
*/
|
|
467
|
-
export declare function mountNode(node: Node, parentNode:
|
|
470
|
+
export declare function mountNode(node: Node, parentNode: Element, context: Context, referenceNode?: Comment | null): void;
|
|
468
471
|
|
|
469
472
|
/**
|
|
470
473
|
* Represents the output type returned by an `@Event` decorator in a web component.
|
|
@@ -555,7 +558,7 @@ declare type PropertyDecoratorOptionsWithRequired<ActualValue = unknown, Incomin
|
|
|
555
558
|
* @param events - List of event listener descriptors to attach to the element.
|
|
556
559
|
* @returns The newly created HTML element.
|
|
557
560
|
*/
|
|
558
|
-
export declare function _renderElement(parentNode:
|
|
561
|
+
export declare function _renderElement(parentNode: Element, context: Context, anchor: Comment | null, tagName: string, attributes: RenderElementAttribute[], events: RenderElementEvent[]): Element;
|
|
559
562
|
|
|
560
563
|
/**
|
|
561
564
|
* Describes a single HTML attribute to be applied to a rendered DOM element.
|
package/dist/xaendar-core.es.js
CHANGED
|
@@ -60,6 +60,7 @@ function Event(options) {
|
|
|
60
60
|
* @internal
|
|
61
61
|
*/
|
|
62
62
|
var INTERNAL_OBSERVED_ATTRIBUTES = `observedAttributes`;
|
|
63
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
63
64
|
//#endregion
|
|
64
65
|
//#region ../packages/core/src/signals/input/input-instance.symbol.ts
|
|
65
66
|
/**
|
|
@@ -526,6 +527,13 @@ var Context = class {
|
|
|
526
527
|
* detach event listeners, and dispose signal effect subscriptions.
|
|
527
528
|
*/
|
|
528
529
|
_unwatchFns = new Array();
|
|
530
|
+
_namespace;
|
|
531
|
+
get namespace() {
|
|
532
|
+
return this._namespace;
|
|
533
|
+
}
|
|
534
|
+
set namespace(value) {
|
|
535
|
+
this._namespace = value;
|
|
536
|
+
}
|
|
529
537
|
/**
|
|
530
538
|
* Creates a new scope context.
|
|
531
539
|
*
|
|
@@ -935,7 +943,8 @@ function teardown(parentContext, state) {
|
|
|
935
943
|
* @returns The newly created HTML element.
|
|
936
944
|
*/
|
|
937
945
|
function _renderElement(parentNode, context, anchor, tagName, attributes, events) {
|
|
938
|
-
|
|
946
|
+
if (tagName === "svg") context.namespace = "svg";
|
|
947
|
+
const element = context.namespace === "svg" ? document.createElementNS(SVG_NS, tagName) : document.createElement(tagName);
|
|
939
948
|
mountNode(element, parentNode, context, anchor);
|
|
940
949
|
attributes.forEach(({ name, value, literal }) => {
|
|
941
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.
|
|
3
|
+
"version": "0.7.7",
|
|
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.
|
|
20
|
-
"@xaendar/types": "0.7.
|
|
19
|
+
"@xaendar/signals": "0.7.7",
|
|
20
|
+
"@xaendar/types": "0.7.7"
|
|
21
21
|
}
|
|
22
22
|
}
|