hyper-dom-expressions 0.41.0-next.2 → 0.41.0-next.20

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.
@@ -43,8 +43,8 @@ function createHyperScript(r) {
43
43
  } else if (d[k].get) dynamic = true;
44
44
  }
45
45
  dynamic ?
46
- r.spread(e, l, e instanceof SVGElement, !!args.length) :
47
- r.assign(e, l, e instanceof SVGElement, !!args.length);
46
+ r.spread(e, l, !!args.length) :
47
+ r.assign(e, l, !!args.length);
48
48
  } else if ("function" === type) {
49
49
  if (!e) {
50
50
  let props,
@@ -89,7 +89,9 @@ function createHyperScript(r) {
89
89
  if (!v) continue;
90
90
  if (!e)
91
91
  e = r.SVGElements.has(v) ?
92
- document.createElementNS("http://www.w3.org/2000/svg", v) :
92
+ document.createElementNS(r.Namespaces.svg, v) :
93
+ r.MathMLElements.has(v) ?
94
+ document.createElementNS(r.Namespaces.mathml, v) :
93
95
  document.createElement(v);else
94
96
  if (v[0] === ".") classes.push(s);else
95
97
  if (v[0] === "#") e.setAttribute("id", s);
@@ -45,8 +45,8 @@ function createHyperScript(r) {
45
45
  } else if (d[k].get) dynamic = true;
46
46
  }
47
47
  dynamic ?
48
- r.spread(e, l, e instanceof SVGElement, !!args.length) :
49
- r.assign(e, l, e instanceof SVGElement, !!args.length);
48
+ r.spread(e, l, !!args.length) :
49
+ r.assign(e, l, !!args.length);
50
50
  } else if ("function" === type) {
51
51
  if (!e) {
52
52
  let props,
@@ -91,7 +91,9 @@ function createHyperScript(r) {
91
91
  if (!v) continue;
92
92
  if (!e)
93
93
  e = r.SVGElements.has(v) ?
94
- document.createElementNS("http://www.w3.org/2000/svg", v) :
94
+ document.createElementNS(r.Namespaces.svg, v) :
95
+ r.MathMLElements.has(v) ?
96
+ document.createElementNS(r.Namespaces.mathml, v) :
95
97
  document.createElement(v);else
96
98
  if (v[0] === ".") classes.push(s);else
97
99
  if (v[0] === "#") e.setAttribute("id", s);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hyper-dom-expressions",
3
3
  "description": "A Fine-Grained Rendering Runtime API using HyperScript",
4
- "version": "0.41.0-next.2",
4
+ "version": "0.41.0-next.20",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -19,7 +19,7 @@
19
19
  "prepare": "pnpm run build"
20
20
  },
21
21
  "devDependencies": {
22
- "dom-expressions": "^0.41.0-next.2"
22
+ "dom-expressions": "^0.41.0-next.20"
23
23
  },
24
- "gitHead": "e187cab1e4a8a7dc3948099a568d03fe3cd081d4"
24
+ "gitHead": "510a28a52c7462bc8f055602756b5805914e9466"
25
25
  }
package/types/index.d.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
2
2
  interface Runtime {
3
3
  insert(parent: MountableElement, accessor: any, marker?: Node | null, init?: any): any;
4
- spread(node: Element, accessor: any, isSVG?: Boolean, skipChildren?: Boolean): void;
5
- assign(node: Element, props: any, isSVG?: Boolean, skipChildren?: Boolean): void;
4
+ spread(node: Element, accessor: any, skipChildren?: Boolean): void;
5
+ assign(node: Element, props: any, skipChildren?: Boolean): void;
6
6
  createComponent(Comp: (props: any) => any, props: any): any;
7
7
  dynamicProperty(props: any, key: string): any;
8
8
  SVGElements: Set<string>;
9
+ MathMLElements: Set<string>;
10
+ Namespaces: Record<string, string>;
9
11
  }
10
12
  type ExpandableNode = Node & {
11
13
  [key: string]: any;