@vue/runtime-dom
Advanced tools
Comparing version 3.4.0-alpha.4 to 3.4.0-beta.1
@@ -9,2 +9,3 @@ 'use strict'; | ||
const svgNS = "http://www.w3.org/2000/svg"; | ||
const mathmlNS = "http://www.w3.org/1998/Math/MathML"; | ||
const doc = typeof document !== "undefined" ? document : null; | ||
@@ -22,4 +23,4 @@ const templateContainer = doc && /* @__PURE__ */ doc.createElement("template"); | ||
}, | ||
createElement: (tag, isSVG, is, props) => { | ||
const el = isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag, is ? { is } : void 0); | ||
createElement: (tag, namespace, is, props) => { | ||
const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0); | ||
if (tag === "select" && props && props.multiple != null) { | ||
@@ -48,3 +49,3 @@ el.setAttribute("multiple", props.multiple); | ||
// As long as the user only uses trusted templates, this is safe. | ||
insertStaticContent(content, parent, anchor, isSVG, start, end) { | ||
insertStaticContent(content, parent, anchor, namespace, start, end) { | ||
const before = anchor ? anchor.previousSibling : parent.lastChild; | ||
@@ -58,5 +59,5 @@ if (start && (start === end || start.nextSibling)) { | ||
} else { | ||
templateContainer.innerHTML = isSVG ? `<svg>${content}</svg>` : content; | ||
templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content; | ||
const template = templateContainer.content; | ||
if (isSVG) { | ||
if (namespace === "svg" || namespace === "mathml") { | ||
const wrapper = template.firstChild; | ||
@@ -628,3 +629,4 @@ while (wrapper.firstChild) { | ||
key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123; | ||
const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => { | ||
const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => { | ||
const isSVG = namespace === "svg"; | ||
if (key === "class") { | ||
@@ -681,3 +683,5 @@ patchClass(el, nextValue, isSVG); | ||
const tag = el.tagName; | ||
return !(tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE"); | ||
if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") { | ||
return false; | ||
} | ||
} | ||
@@ -1407,3 +1411,3 @@ if (isNativeOn(key) && shared.isString(value)) { | ||
container.innerHTML = ""; | ||
const proxy = mount(container, false, container instanceof SVGElement); | ||
const proxy = mount(container, false, resolveRootNamespace(container)); | ||
if (container instanceof Element) { | ||
@@ -1427,3 +1431,3 @@ container.removeAttribute("v-cloak"); | ||
if (container) { | ||
return mount(container, true, container instanceof SVGElement); | ||
return mount(container, true, resolveRootNamespace(container)); | ||
} | ||
@@ -1433,5 +1437,13 @@ }; | ||
}; | ||
function resolveRootNamespace(container) { | ||
if (container instanceof SVGElement) { | ||
return "svg"; | ||
} | ||
if (typeof MathMLElement === "function" && container instanceof MathMLElement) { | ||
return "mathml"; | ||
} | ||
} | ||
function injectNativeTagCheck(app) { | ||
Object.defineProperty(app.config, "isNativeTag", { | ||
value: (tag) => shared.isHTMLTag(tag) || shared.isSVGTag(tag), | ||
value: (tag) => shared.isHTMLTag(tag) || shared.isSVGTag(tag) || shared.isMathMLTag(tag), | ||
writable: false | ||
@@ -1438,0 +1450,0 @@ }); |
@@ -9,2 +9,3 @@ 'use strict'; | ||
const svgNS = "http://www.w3.org/2000/svg"; | ||
const mathmlNS = "http://www.w3.org/1998/Math/MathML"; | ||
const doc = typeof document !== "undefined" ? document : null; | ||
@@ -22,4 +23,4 @@ const templateContainer = doc && /* @__PURE__ */ doc.createElement("template"); | ||
}, | ||
createElement: (tag, isSVG, is, props) => { | ||
const el = isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag, is ? { is } : void 0); | ||
createElement: (tag, namespace, is, props) => { | ||
const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0); | ||
if (tag === "select" && props && props.multiple != null) { | ||
@@ -48,3 +49,3 @@ el.setAttribute("multiple", props.multiple); | ||
// As long as the user only uses trusted templates, this is safe. | ||
insertStaticContent(content, parent, anchor, isSVG, start, end) { | ||
insertStaticContent(content, parent, anchor, namespace, start, end) { | ||
const before = anchor ? anchor.previousSibling : parent.lastChild; | ||
@@ -58,5 +59,5 @@ if (start && (start === end || start.nextSibling)) { | ||
} else { | ||
templateContainer.innerHTML = isSVG ? `<svg>${content}</svg>` : content; | ||
templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content; | ||
const template = templateContainer.content; | ||
if (isSVG) { | ||
if (namespace === "svg" || namespace === "mathml") { | ||
const wrapper = template.firstChild; | ||
@@ -611,3 +612,4 @@ while (wrapper.firstChild) { | ||
key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123; | ||
const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => { | ||
const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => { | ||
const isSVG = namespace === "svg"; | ||
if (key === "class") { | ||
@@ -664,3 +666,5 @@ patchClass(el, nextValue, isSVG); | ||
const tag = el.tagName; | ||
return !(tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE"); | ||
if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") { | ||
return false; | ||
} | ||
} | ||
@@ -1359,3 +1363,3 @@ if (isNativeOn(key) && shared.isString(value)) { | ||
container.innerHTML = ""; | ||
const proxy = mount(container, false, container instanceof SVGElement); | ||
const proxy = mount(container, false, resolveRootNamespace(container)); | ||
if (container instanceof Element) { | ||
@@ -1375,3 +1379,3 @@ container.removeAttribute("v-cloak"); | ||
if (container) { | ||
return mount(container, true, container instanceof SVGElement); | ||
return mount(container, true, resolveRootNamespace(container)); | ||
} | ||
@@ -1381,2 +1385,10 @@ }; | ||
}; | ||
function resolveRootNamespace(container) { | ||
if (container instanceof SVGElement) { | ||
return "svg"; | ||
} | ||
if (typeof MathMLElement === "function" && container instanceof MathMLElement) { | ||
return "mathml"; | ||
} | ||
} | ||
function normalizeContainer(container) { | ||
@@ -1383,0 +1395,0 @@ if (shared.isString(container)) { |
@@ -134,3 +134,3 @@ import { SetupContext, RenderFunction, ComputedOptions, MethodOptions, ComponentOptionsMixin, EmitsOptions, ComponentInjectOptions, SlotsType, ComponentOptionsWithoutProps, ComponentOptionsWithArrayProps, ComponentPropsOptions, ComponentOptionsWithObjectProps, ExtractPropTypes, DefineComponent, RootHydrateFunction, ConcreteComponent, BaseTransitionProps, FunctionalComponent, ObjectDirective, VNodeRef, RootRenderFunction, CreateAppFunction } from '@vue/runtime-core'; | ||
type Numberish = number | string; | ||
interface AriaAttributes { | ||
export interface AriaAttributes { | ||
/** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */ | ||
@@ -1016,2 +1016,3 @@ 'aria-activedescendant'?: string; | ||
xmlns?: string; | ||
xmlnsXlink?: string; | ||
y1?: Numberish; | ||
@@ -1018,0 +1019,0 @@ y2?: Numberish; |
import { h, BaseTransition, BaseTransitionPropsValidators, assertNumber, warn, camelize, callWithAsyncErrorHandling, defineComponent, nextTick, createVNode, getCurrentInstance, watchPostEffect, onMounted, onUnmounted, Fragment, Static, useTransitionState, onUpdated, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, isRuntimeOnly, createRenderer, createHydrationRenderer } from '@vue/runtime-core'; | ||
export * from '@vue/runtime-core'; | ||
import { extend, isObject, toNumber, isArray, isString, hyphenate, capitalize, isSpecialBooleanAttr, includeBooleanAttr, isOn, isModelListener, isFunction, camelize as camelize$1, EMPTY_OBJ, looseToNumber, looseIndexOf, isSet, looseEqual, invokeArrayFns, isHTMLTag, isSVGTag } from '@vue/shared'; | ||
import { extend, isObject, toNumber, isArray, isString, hyphenate, capitalize, isSpecialBooleanAttr, includeBooleanAttr, isOn, isModelListener, isFunction, camelize as camelize$1, EMPTY_OBJ, looseToNumber, looseIndexOf, isSet, looseEqual, invokeArrayFns, isHTMLTag, isSVGTag, isMathMLTag } from '@vue/shared'; | ||
const svgNS = "http://www.w3.org/2000/svg"; | ||
const mathmlNS = "http://www.w3.org/1998/Math/MathML"; | ||
const doc = typeof document !== "undefined" ? document : null; | ||
@@ -18,4 +19,4 @@ const templateContainer = doc && /* @__PURE__ */ doc.createElement("template"); | ||
}, | ||
createElement: (tag, isSVG, is, props) => { | ||
const el = isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag, is ? { is } : void 0); | ||
createElement: (tag, namespace, is, props) => { | ||
const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0); | ||
if (tag === "select" && props && props.multiple != null) { | ||
@@ -44,3 +45,3 @@ el.setAttribute("multiple", props.multiple); | ||
// As long as the user only uses trusted templates, this is safe. | ||
insertStaticContent(content, parent, anchor, isSVG, start, end) { | ||
insertStaticContent(content, parent, anchor, namespace, start, end) { | ||
const before = anchor ? anchor.previousSibling : parent.lastChild; | ||
@@ -54,5 +55,5 @@ if (start && (start === end || start.nextSibling)) { | ||
} else { | ||
templateContainer.innerHTML = isSVG ? `<svg>${content}</svg>` : content; | ||
templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content; | ||
const template = templateContainer.content; | ||
if (isSVG) { | ||
if (namespace === "svg" || namespace === "mathml") { | ||
const wrapper = template.firstChild; | ||
@@ -624,3 +625,4 @@ while (wrapper.firstChild) { | ||
key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123; | ||
const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => { | ||
const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => { | ||
const isSVG = namespace === "svg"; | ||
if (key === "class") { | ||
@@ -677,3 +679,5 @@ patchClass(el, nextValue, isSVG); | ||
const tag = el.tagName; | ||
return !(tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE"); | ||
if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") { | ||
return false; | ||
} | ||
} | ||
@@ -1458,3 +1462,3 @@ if (isNativeOn(key) && isString(value)) { | ||
container.innerHTML = ""; | ||
const proxy = mount(container, false, container instanceof SVGElement); | ||
const proxy = mount(container, false, resolveRootNamespace(container)); | ||
if (container instanceof Element) { | ||
@@ -1478,3 +1482,3 @@ container.removeAttribute("v-cloak"); | ||
if (container) { | ||
return mount(container, true, container instanceof SVGElement); | ||
return mount(container, true, resolveRootNamespace(container)); | ||
} | ||
@@ -1484,5 +1488,13 @@ }; | ||
}; | ||
function resolveRootNamespace(container) { | ||
if (container instanceof SVGElement) { | ||
return "svg"; | ||
} | ||
if (typeof MathMLElement === "function" && container instanceof MathMLElement) { | ||
return "mathml"; | ||
} | ||
} | ||
function injectNativeTagCheck(app) { | ||
Object.defineProperty(app.config, "isNativeTag", { | ||
value: (tag) => isHTMLTag(tag) || isSVGTag(tag), | ||
value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag), | ||
writable: false | ||
@@ -1489,0 +1501,0 @@ }); |
{ | ||
"name": "@vue/runtime-dom", | ||
"version": "3.4.0-alpha.4", | ||
"version": "3.4.0-beta.1", | ||
"description": "@vue/runtime-dom", | ||
@@ -38,6 +38,6 @@ "main": "index.js", | ||
"dependencies": { | ||
"csstype": "^3.1.2", | ||
"@vue/shared": "3.4.0-alpha.4", | ||
"@vue/runtime-core": "3.4.0-alpha.4" | ||
"csstype": "^3.1.3", | ||
"@vue/runtime-core": "3.4.0-beta.1", | ||
"@vue/shared": "3.4.0-beta.1" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1028099
28220
+ Added@vue/reactivity@3.4.0-beta.1(transitive)
+ Added@vue/runtime-core@3.4.0-beta.1(transitive)
+ Added@vue/shared@3.4.0-beta.1(transitive)
- Removed@vue/reactivity@3.4.0-alpha.4(transitive)
- Removed@vue/runtime-core@3.4.0-alpha.4(transitive)
- Removed@vue/shared@3.4.0-alpha.4(transitive)
Updated@vue/shared@3.4.0-beta.1
Updatedcsstype@^3.1.3