@abide/abide 0.110.1 → 0.110.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @abide/abide
2
2
 
3
+ ## 0.110.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 14ee265: an SVG element spelled in camelCase hydrates, the compiler asking for the tag the parser writes inside an <svg> ([`f10c81b`](https://github.com/briancray/abide/commit/f10c81bff3ce0e43762a71e24634a218312c0d93))
8
+
3
9
  ## 0.110.1
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abide/abide",
3
- "version": "0.110.1",
3
+ "version": "0.110.2",
4
4
  "type": "module",
5
5
  "description": "Isomorphic type-safe framework for reactive async interfaces for humans and machines",
6
6
  "license": "MIT",
@@ -81,7 +81,8 @@ export type PlacedNode = {
81
81
  */
82
82
  parent: string
83
83
  /**
84
- * An element's FOLDED tag, for the kind check `elementHere` makes. '' for the other two kinds.
84
+ * An element's tag as the parser writes it, for the kind check `elementHere` makes: folded,
85
+ * then given back SVG's camelCase (`SVG_CASE`). '' for the other two kinds.
85
86
  */
86
87
  tag: string
87
88
  /**
@@ -115,6 +116,51 @@ export type PlacedNode = {
115
116
  children: PlacedNode[]
116
117
  }
117
118
 
119
+ // THE NAMES THE PARSER GIVES BACK SVG'S CASE, folded to the case it writes — the HTML standard's
120
+ // adjustment table for foreign content. None is an HTML element, so one stands under an `<svg>`
121
+ // even where the compiler cannot see it: a component's root does not know where it is invoked.
122
+ const SVG_CASE = new Map<string, string>()
123
+ for (const name of [
124
+ 'altGlyph',
125
+ 'altGlyphDef',
126
+ 'altGlyphItem',
127
+ 'animateColor',
128
+ 'animateMotion',
129
+ 'animateTransform',
130
+ 'clipPath',
131
+ 'feBlend',
132
+ 'feColorMatrix',
133
+ 'feComponentTransfer',
134
+ 'feComposite',
135
+ 'feConvolveMatrix',
136
+ 'feDiffuseLighting',
137
+ 'feDisplacementMap',
138
+ 'feDistantLight',
139
+ 'feDropShadow',
140
+ 'feFlood',
141
+ 'feFuncA',
142
+ 'feFuncB',
143
+ 'feFuncG',
144
+ 'feFuncR',
145
+ 'feGaussianBlur',
146
+ 'feImage',
147
+ 'feMerge',
148
+ 'feMergeNode',
149
+ 'feMorphology',
150
+ 'feOffset',
151
+ 'fePointLight',
152
+ 'feSpecularLighting',
153
+ 'feSpotLight',
154
+ 'feTile',
155
+ 'feTurbulence',
156
+ 'foreignObject',
157
+ 'glyphRef',
158
+ 'linearGradient',
159
+ 'radialGradient',
160
+ 'textPath',
161
+ ])
162
+ SVG_CASE.set(name.toLowerCase(), name)
163
+
118
164
  /** A run of siblings being walked: the region's own root, or the inside of one element. */
119
165
  type Frame = {
120
166
  /**
@@ -202,7 +248,13 @@ export class Cursor {
202
248
  * emitted between its open and close tags and nowhere else. A void element is left at once.
203
249
  */
204
250
  element(node: ElementNode): PlacedNode {
205
- const at = this.record('element', node, node.lowerTag, false, [])
251
+ const at = this.record(
252
+ 'element',
253
+ node,
254
+ SVG_CASE.get(node.lowerTag) ?? node.lowerTag,
255
+ false,
256
+ [],
257
+ )
206
258
  this.frames.push({
207
259
  parent: at.name,
208
260
  within: at,