@vue/compat 3.6.0-alpha.3 → 3.6.0-alpha.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.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.6.0-alpha.3
2
+ * @vue/compat v3.6.0-alpha.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -88,6 +88,9 @@ const toHandlerKey = cacheStringFunction(
88
88
  return s;
89
89
  }
90
90
  );
91
+ const getModifierPropName = (name) => {
92
+ return `${name === "modelValue" || name === "model-value" ? "model" : name}Modifiers${name === "model" ? "$" : ""}`;
93
+ };
91
94
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
92
95
  const invokeArrayFns = (fns, ...arg) => {
93
96
  for (let i = 0; i < fns.length; i++) {
@@ -2964,7 +2967,12 @@ function reload(id, newComp) {
2964
2967
  newComp = normalizeClassComponent(newComp);
2965
2968
  updateComponentDef(record.initialDef, newComp);
2966
2969
  const instances = [...record.instances];
2967
- if (newComp.__vapor) {
2970
+ if (newComp.__vapor && !instances.some((i) => i.ceReload)) {
2971
+ for (const instance of instances) {
2972
+ if (instance.root && instance.root.ce && instance !== instance.root) {
2973
+ instance.root.ce._removeChildStyle(instance.type);
2974
+ }
2975
+ }
2968
2976
  for (const instance of instances) {
2969
2977
  instance.hmrReload(newComp);
2970
2978
  }
@@ -7688,7 +7696,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7688
7696
  return vm;
7689
7697
  }
7690
7698
  }
7691
- Vue.version = `2.6.14-compat:${"3.6.0-alpha.3"}`;
7699
+ Vue.version = `2.6.14-compat:${"3.6.0-alpha.4"}`;
7692
7700
  Vue.config = singletonApp.config;
7693
7701
  Vue.use = (plugin, ...options) => {
7694
7702
  if (plugin && isFunction(plugin.install)) {
@@ -10893,7 +10901,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
10893
10901
  return res;
10894
10902
  }
10895
10903
  const getModelModifiers = (props, modelName, getter) => {
10896
- return modelName === "modelValue" || modelName === "model-value" ? getter(props, "modelModifiers") : getter(props, `${modelName}Modifiers`) || getter(props, `${camelize(modelName)}Modifiers`) || getter(props, `${hyphenate(modelName)}Modifiers`);
10904
+ return getter(props, getModifierPropName(modelName)) || getter(props, `${camelize(modelName)}Modifiers`) || getter(props, `${hyphenate(modelName)}Modifiers`);
10897
10905
  };
10898
10906
 
10899
10907
  function emit(instance, event, ...rawArgs) {
@@ -12447,6 +12455,25 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
12447
12455
  simpleSetCurrentInstance(instance);
12448
12456
  }
12449
12457
  };
12458
+ const internalOptions = ["ce", "type"];
12459
+ const useInstanceOption = (key, silent = false) => {
12460
+ const instance = getCurrentGenericInstance();
12461
+ if (!instance) {
12462
+ if (!silent) {
12463
+ warn$1(`useInstanceOption called without an active component instance.`);
12464
+ }
12465
+ return { hasInstance: false, value: void 0 };
12466
+ }
12467
+ if (!internalOptions.includes(key)) {
12468
+ {
12469
+ warn$1(
12470
+ `useInstanceOption only accepts ${internalOptions.map((k) => `'${k}'`).join(", ")} as key, got '${key}'.`
12471
+ );
12472
+ }
12473
+ return { hasInstance: true, value: void 0 };
12474
+ }
12475
+ return { hasInstance: true, value: instance[key] };
12476
+ };
12450
12477
 
12451
12478
  const emptyAppContext = createAppContext();
12452
12479
  let uid = 0;
@@ -13093,7 +13120,7 @@ function isMemoSame(cached, memo) {
13093
13120
  return true;
13094
13121
  }
13095
13122
 
13096
- const version = "3.6.0-alpha.3";
13123
+ const version = "3.6.0-alpha.4";
13097
13124
  const warn = warn$1 ;
13098
13125
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
13099
13126
  const devtools = devtools$1 ;
@@ -13956,12 +13983,9 @@ const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOption
13956
13983
  });
13957
13984
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
13958
13985
  };
13959
- class VueElement extends BaseClass {
13960
- constructor(_def, _props = {}, _createApp = createApp) {
13986
+ class VueElementBase extends BaseClass {
13987
+ constructor(def, props = {}, createAppFn) {
13961
13988
  super();
13962
- this._def = _def;
13963
- this._props = _props;
13964
- this._createApp = _createApp;
13965
13989
  this._isVueCE = true;
13966
13990
  /**
13967
13991
  * @internal
@@ -13971,28 +13995,23 @@ class VueElement extends BaseClass {
13971
13995
  * @internal
13972
13996
  */
13973
13997
  this._app = null;
13974
- /**
13975
- * @internal
13976
- */
13977
- this._nonce = this._def.nonce;
13978
13998
  this._connected = false;
13979
13999
  this._resolved = false;
13980
- this._patching = false;
13981
- this._dirty = false;
13982
14000
  this._numberProps = null;
13983
14001
  this._styleChildren = /* @__PURE__ */ new WeakSet();
14002
+ this._patching = false;
14003
+ this._dirty = false;
13984
14004
  this._ob = null;
13985
- if (this.shadowRoot && _createApp !== createApp) {
14005
+ this._def = def;
14006
+ this._props = props;
14007
+ this._createApp = createAppFn;
14008
+ this._nonce = def.nonce;
14009
+ if (this._needsHydration()) {
13986
14010
  this._root = this.shadowRoot;
13987
14011
  } else {
13988
- if (this.shadowRoot) {
13989
- warn(
13990
- `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
13991
- );
13992
- }
13993
- if (_def.shadowRoot !== false) {
14012
+ if (def.shadowRoot !== false) {
13994
14013
  this.attachShadow(
13995
- extend({}, _def.shadowRootOptions, {
14014
+ extend({}, def.shadowRootOptions, {
13996
14015
  mode: "open"
13997
14016
  })
13998
14017
  );
@@ -14010,14 +14029,14 @@ class VueElement extends BaseClass {
14010
14029
  this._connected = true;
14011
14030
  let parent = this;
14012
14031
  while (parent = parent && (parent.parentNode || parent.host)) {
14013
- if (parent instanceof VueElement) {
14032
+ if (parent instanceof VueElementBase) {
14014
14033
  this._parent = parent;
14015
14034
  break;
14016
14035
  }
14017
14036
  }
14018
14037
  if (!this._instance) {
14019
14038
  if (this._resolved) {
14020
- this._mount(this._def);
14039
+ this._mountComponent(this._def);
14021
14040
  } else {
14022
14041
  if (parent && parent._pendingResolve) {
14023
14042
  this._pendingResolve = parent._pendingResolve.then(() => {
@@ -14030,20 +14049,6 @@ class VueElement extends BaseClass {
14030
14049
  }
14031
14050
  }
14032
14051
  }
14033
- _setParent(parent = this._parent) {
14034
- if (parent) {
14035
- this._instance.parent = parent._instance;
14036
- this._inheritParentContext(parent);
14037
- }
14038
- }
14039
- _inheritParentContext(parent = this._parent) {
14040
- if (parent && this._app) {
14041
- Object.setPrototypeOf(
14042
- this._app._context.provides,
14043
- parent._instance.provides
14044
- );
14045
- }
14046
- }
14047
14052
  disconnectedCallback() {
14048
14053
  this._connected = false;
14049
14054
  nextTick(() => {
@@ -14052,9 +14057,7 @@ class VueElement extends BaseClass {
14052
14057
  this._ob.disconnect();
14053
14058
  this._ob = null;
14054
14059
  }
14055
- this._app && this._app.unmount();
14056
- if (this._instance) this._instance.ce = void 0;
14057
- this._app = this._instance = null;
14060
+ this._unmount();
14058
14061
  if (this._teleportTargets) {
14059
14062
  this._teleportTargets.clear();
14060
14063
  this._teleportTargets = void 0;
@@ -14062,6 +14065,20 @@ class VueElement extends BaseClass {
14062
14065
  }
14063
14066
  });
14064
14067
  }
14068
+ _setParent(parent = this._parent) {
14069
+ if (parent && this._instance) {
14070
+ this._instance.parent = parent._instance;
14071
+ this._inheritParentContext(parent);
14072
+ }
14073
+ }
14074
+ _inheritParentContext(parent = this._parent) {
14075
+ if (parent && this._app) {
14076
+ Object.setPrototypeOf(
14077
+ this._app._context.provides,
14078
+ parent._instance.provides
14079
+ );
14080
+ }
14081
+ }
14065
14082
  _processMutations(mutations) {
14066
14083
  for (const m of mutations) {
14067
14084
  this._setAttr(m.attributeName);
@@ -14079,7 +14096,7 @@ class VueElement extends BaseClass {
14079
14096
  }
14080
14097
  this._ob = new MutationObserver(this._processMutations.bind(this));
14081
14098
  this._ob.observe(this, { attributes: true });
14082
- const resolve = (def, isAsync = false) => {
14099
+ const resolve = (def) => {
14083
14100
  this._resolved = true;
14084
14101
  this._pendingResolve = void 0;
14085
14102
  const { props, styles } = def;
@@ -14104,29 +14121,25 @@ class VueElement extends BaseClass {
14104
14121
  "Custom element style injection is not supported when using shadowRoot: false"
14105
14122
  );
14106
14123
  }
14107
- this._mount(def);
14124
+ this._mountComponent(def);
14108
14125
  };
14109
14126
  const asyncDef = this._def.__asyncLoader;
14110
14127
  if (asyncDef) {
14128
+ const { configureApp } = this._def;
14111
14129
  this._pendingResolve = asyncDef().then((def) => {
14112
- def.configureApp = this._def.configureApp;
14113
- resolve(this._def = def, true);
14130
+ def.configureApp = configureApp;
14131
+ this._def = def;
14132
+ resolve(def);
14114
14133
  });
14115
14134
  } else {
14116
14135
  resolve(this._def);
14117
14136
  }
14118
14137
  }
14119
- _mount(def) {
14120
- if (!def.name) {
14121
- def.name = "VueElement";
14122
- }
14123
- this._app = this._createApp(def);
14124
- this._inheritParentContext();
14125
- if (def.configureApp) {
14126
- def.configureApp(this._app);
14127
- }
14128
- this._app._ceVNode = this._createVNode();
14129
- this._app.mount(this._root);
14138
+ _mountComponent(def) {
14139
+ this._mount(def);
14140
+ this._processExposed();
14141
+ }
14142
+ _processExposed() {
14130
14143
  const exposed = this._instance && this._instance.exposed;
14131
14144
  if (!exposed) return;
14132
14145
  for (const key in exposed) {
@@ -14140,6 +14153,38 @@ class VueElement extends BaseClass {
14140
14153
  }
14141
14154
  }
14142
14155
  }
14156
+ _processInstance() {
14157
+ this._instance.ce = this;
14158
+ this._instance.isCE = true;
14159
+ {
14160
+ this._instance.ceReload = (newStyles) => {
14161
+ if (this._styles) {
14162
+ this._styles.forEach((s) => this._root.removeChild(s));
14163
+ this._styles.length = 0;
14164
+ }
14165
+ this._applyStyles(newStyles);
14166
+ if (!this._instance.vapor) {
14167
+ this._instance = null;
14168
+ }
14169
+ this._update();
14170
+ };
14171
+ }
14172
+ const dispatch = (event, args) => {
14173
+ this.dispatchEvent(
14174
+ new CustomEvent(
14175
+ event,
14176
+ isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args }
14177
+ )
14178
+ );
14179
+ };
14180
+ this._instance.emit = (event, ...args) => {
14181
+ dispatch(event, args);
14182
+ if (hyphenate(event) !== event) {
14183
+ dispatch(hyphenate(event), args);
14184
+ }
14185
+ };
14186
+ this._setParent();
14187
+ }
14143
14188
  _resolveProps(def) {
14144
14189
  const { props } = def;
14145
14190
  const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
@@ -14185,7 +14230,7 @@ class VueElement extends BaseClass {
14185
14230
  delete this._props[key];
14186
14231
  } else {
14187
14232
  this._props[key] = val;
14188
- if (key === "key" && this._app) {
14233
+ if (key === "key" && this._app && this._app._ceVNode) {
14189
14234
  this._app._ceVNode.key = val;
14190
14235
  }
14191
14236
  }
@@ -14209,52 +14254,6 @@ class VueElement extends BaseClass {
14209
14254
  }
14210
14255
  }
14211
14256
  }
14212
- _update() {
14213
- const vnode = this._createVNode();
14214
- if (this._app) vnode.appContext = this._app._context;
14215
- render(vnode, this._root);
14216
- }
14217
- _createVNode() {
14218
- const baseProps = {};
14219
- if (!this.shadowRoot) {
14220
- baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
14221
- }
14222
- const vnode = createVNode(this._def, extend(baseProps, this._props));
14223
- if (!this._instance) {
14224
- vnode.ce = (instance) => {
14225
- this._instance = instance;
14226
- instance.ce = this;
14227
- instance.isCE = true;
14228
- {
14229
- instance.ceReload = (newStyles) => {
14230
- if (this._styles) {
14231
- this._styles.forEach((s) => this._root.removeChild(s));
14232
- this._styles.length = 0;
14233
- }
14234
- this._applyStyles(newStyles);
14235
- this._instance = null;
14236
- this._update();
14237
- };
14238
- }
14239
- const dispatch = (event, args) => {
14240
- this.dispatchEvent(
14241
- new CustomEvent(
14242
- event,
14243
- isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args }
14244
- )
14245
- );
14246
- };
14247
- instance.emit = (event, ...args) => {
14248
- dispatch(event, args);
14249
- if (hyphenate(event) !== event) {
14250
- dispatch(hyphenate(event), args);
14251
- }
14252
- };
14253
- this._setParent();
14254
- };
14255
- }
14256
- return vnode;
14257
- }
14258
14257
  _applyStyles(styles, owner) {
14259
14258
  if (!styles) return;
14260
14259
  if (owner) {
@@ -14303,11 +14302,13 @@ class VueElement extends BaseClass {
14303
14302
  _renderSlots() {
14304
14303
  const outlets = this._getSlots();
14305
14304
  const scopeId = this._instance.type.__scopeId;
14305
+ const slotReplacements = /* @__PURE__ */ new Map();
14306
14306
  for (let i = 0; i < outlets.length; i++) {
14307
14307
  const o = outlets[i];
14308
14308
  const slotName = o.getAttribute("name") || "default";
14309
14309
  const content = this._slots[slotName];
14310
14310
  const parent = o.parentNode;
14311
+ const replacementNodes = [];
14311
14312
  if (content) {
14312
14313
  for (const n of content) {
14313
14314
  if (scopeId && n.nodeType === 1) {
@@ -14320,12 +14321,19 @@ class VueElement extends BaseClass {
14320
14321
  }
14321
14322
  }
14322
14323
  parent.insertBefore(n, o);
14324
+ replacementNodes.push(n);
14323
14325
  }
14324
14326
  } else {
14325
- while (o.firstChild) parent.insertBefore(o.firstChild, o);
14327
+ while (o.firstChild) {
14328
+ const child = o.firstChild;
14329
+ parent.insertBefore(child, o);
14330
+ replacementNodes.push(child);
14331
+ }
14326
14332
  }
14327
14333
  parent.removeChild(o);
14334
+ slotReplacements.set(o, replacementNodes);
14328
14335
  }
14336
+ this._updateSlotNodes(slotReplacements);
14329
14337
  }
14330
14338
  /**
14331
14339
  * @internal
@@ -14382,13 +14390,76 @@ class VueElement extends BaseClass {
14382
14390
  }
14383
14391
  }
14384
14392
  }
14393
+ class VueElement extends VueElementBase {
14394
+ constructor(def, props = {}, createAppFn = createApp) {
14395
+ super(def, props, createAppFn);
14396
+ }
14397
+ _needsHydration() {
14398
+ if (this.shadowRoot && this._createApp !== createApp) {
14399
+ return true;
14400
+ } else {
14401
+ if (this.shadowRoot) {
14402
+ warn(
14403
+ `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
14404
+ );
14405
+ }
14406
+ }
14407
+ return false;
14408
+ }
14409
+ _mount(def) {
14410
+ if (!def.name) {
14411
+ def.name = "VueElement";
14412
+ }
14413
+ this._app = this._createApp(def);
14414
+ this._inheritParentContext();
14415
+ if (def.configureApp) {
14416
+ def.configureApp(this._app);
14417
+ }
14418
+ this._app._ceVNode = this._createVNode();
14419
+ this._app.mount(this._root);
14420
+ }
14421
+ _update() {
14422
+ if (!this._app) return;
14423
+ const vnode = this._createVNode();
14424
+ vnode.appContext = this._app._context;
14425
+ render(vnode, this._root);
14426
+ }
14427
+ _unmount() {
14428
+ if (this._app) {
14429
+ this._app.unmount();
14430
+ }
14431
+ if (this._instance && this._instance.ce) {
14432
+ this._instance.ce = void 0;
14433
+ }
14434
+ this._app = this._instance = null;
14435
+ }
14436
+ /**
14437
+ * Only called when shadowRoot is false
14438
+ */
14439
+ _updateSlotNodes(replacements) {
14440
+ }
14441
+ _createVNode() {
14442
+ const baseProps = {};
14443
+ if (!this.shadowRoot) {
14444
+ baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
14445
+ }
14446
+ const vnode = createVNode(this._def, extend(baseProps, this._props));
14447
+ if (!this._instance) {
14448
+ vnode.ce = (instance) => {
14449
+ this._instance = instance;
14450
+ this._processInstance();
14451
+ };
14452
+ }
14453
+ return vnode;
14454
+ }
14455
+ }
14385
14456
  function useHost(caller) {
14386
- const instance = getCurrentInstance();
14387
- const el = instance && instance.ce;
14457
+ const { hasInstance, value } = useInstanceOption("ce", true);
14458
+ const el = value;
14388
14459
  if (el) {
14389
14460
  return el;
14390
14461
  } else {
14391
- if (!instance) {
14462
+ if (!hasInstance) {
14392
14463
  warn(
14393
14464
  `${caller || "useHost"} called without an active component instance.`
14394
14465
  );
@@ -14407,12 +14478,12 @@ function useShadowRoot() {
14407
14478
 
14408
14479
  function useCssModule(name = "$style") {
14409
14480
  {
14410
- const instance = getCurrentInstance();
14411
- if (!instance) {
14481
+ const { hasInstance, value: type } = useInstanceOption("type", true);
14482
+ if (!hasInstance) {
14412
14483
  warn(`useCssModule must be called inside setup()`);
14413
14484
  return EMPTY_OBJ;
14414
14485
  }
14415
- const modules = instance.type.__cssModules;
14486
+ const modules = type.__cssModules;
14416
14487
  if (!modules) {
14417
14488
  warn(`Current instance does not have CSS modules injected.`);
14418
14489
  return EMPTY_OBJ;
@@ -15147,6 +15218,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
15147
15218
  TransitionGroup: TransitionGroup,
15148
15219
  TriggerOpTypes: TriggerOpTypes,
15149
15220
  VueElement: VueElement,
15221
+ VueElementBase: VueElementBase,
15150
15222
  assertNumber: assertNumber,
15151
15223
  callWithAsyncErrorHandling: callWithAsyncErrorHandling,
15152
15224
  callWithErrorHandling: callWithErrorHandling,
@@ -15211,6 +15283,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
15211
15283
  mergeModels: mergeModels,
15212
15284
  mergeProps: mergeProps,
15213
15285
  nextTick: nextTick,
15286
+ nodeOps: nodeOps,
15214
15287
  normalizeClass: normalizeClass,
15215
15288
  normalizeProps: normalizeProps,
15216
15289
  normalizeStyle: normalizeStyle,
@@ -15229,6 +15302,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
15229
15302
  onUpdated: onUpdated,
15230
15303
  onWatcherCleanup: onWatcherCleanup,
15231
15304
  openBlock: openBlock,
15305
+ patchProp: patchProp,
15232
15306
  popScopeId: popScopeId,
15233
15307
  provide: provide,
15234
15308
  proxyRefs: proxyRefs,
@@ -15270,6 +15344,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
15270
15344
  useCssVars: useCssVars,
15271
15345
  useHost: useHost,
15272
15346
  useId: useId,
15347
+ useInstanceOption: useInstanceOption,
15273
15348
  useModel: useModel,
15274
15349
  useSSRContext: useSSRContext,
15275
15350
  useShadowRoot: useShadowRoot,
@@ -19586,17 +19661,14 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
19586
19661
  knownIds
19587
19662
  );
19588
19663
  const children = [];
19589
- const isTSNode = TS_NODE_TYPES.includes(ast.type);
19590
19664
  ids.sort((a, b) => a.start - b.start);
19591
19665
  ids.forEach((id, i) => {
19592
19666
  const start = id.start - 1;
19593
19667
  const end = id.end - 1;
19594
19668
  const last = ids[i - 1];
19595
- if (!(isTSNode && i === 0)) {
19596
- const leadingText = rawExp.slice(last ? last.end - 1 : 0, start);
19597
- if (leadingText.length || id.prefix) {
19598
- children.push(leadingText + (id.prefix || ``));
19599
- }
19669
+ const leadingText = rawExp.slice(last ? last.end - 1 : 0, start);
19670
+ if (leadingText.length || id.prefix) {
19671
+ children.push(leadingText + (id.prefix || ``));
19600
19672
  }
19601
19673
  const source = rawExp.slice(start, end);
19602
19674
  children.push(
@@ -19611,7 +19683,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
19611
19683
  id.isConstant ? 3 : 0
19612
19684
  )
19613
19685
  );
19614
- if (i === ids.length - 1 && end < rawExp.length && !isTSNode) {
19686
+ if (i === ids.length - 1 && end < rawExp.length) {
19615
19687
  children.push(rawExp.slice(end));
19616
19688
  }
19617
19689
  });
@@ -21414,7 +21486,7 @@ const transformModel$1 = (dir, node, context) => {
21414
21486
  }
21415
21487
  if (dir.modifiers.length && node.tagType === 1) {
21416
21488
  const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
21417
- const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
21489
+ const modifiersKey = arg ? isStaticExp(arg) ? getModifierPropName(arg.content) : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
21418
21490
  props.push(
21419
21491
  createObjectProperty(
21420
21492
  modifiersKey,
@@ -21756,7 +21828,7 @@ const parserOptions = {
21756
21828
  let ns = parent ? parent.ns : rootNamespace;
21757
21829
  if (parent && ns === 2) {
21758
21830
  if (parent.tag === "annotation-xml") {
21759
- if (tag === "svg") {
21831
+ if (isSVGTag(tag)) {
21760
21832
  return 1;
21761
21833
  }
21762
21834
  if (parent.props.some(
@@ -21773,10 +21845,10 @@ const parserOptions = {
21773
21845
  }
21774
21846
  }
21775
21847
  if (ns === 0) {
21776
- if (tag === "svg") {
21848
+ if (isSVGTag(tag)) {
21777
21849
  return 1;
21778
21850
  }
21779
- if (tag === "math") {
21851
+ if (isMathMLTag(tag)) {
21780
21852
  return 2;
21781
21853
  }
21782
21854
  }