|
@@ -707,8 +707,8 @@ function promisify$1(name, fn) {
|
|
|
if (hasCallback(args)) {
|
|
if (hasCallback(args)) {
|
|
|
return wrapperReturnValue(name, invokeApi(name, fn, args, rest));
|
|
return wrapperReturnValue(name, invokeApi(name, fn, args, rest));
|
|
|
}
|
|
}
|
|
|
- return wrapperReturnValue(name, handlePromise(new Promise((resolve, reject) => {
|
|
|
|
|
- invokeApi(name, fn, extend(args, { success: resolve, fail: reject }), rest);
|
|
|
|
|
|
|
+ return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
|
|
|
|
|
+ invokeApi(name, fn, extend(args, { success: resolve2, fail: reject }), rest);
|
|
|
})));
|
|
})));
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
@@ -1000,7 +1000,7 @@ function invokeGetPushCidCallbacks(cid2, errMsg) {
|
|
|
getPushCidCallbacks.length = 0;
|
|
getPushCidCallbacks.length = 0;
|
|
|
}
|
|
}
|
|
|
const API_GET_PUSH_CLIENT_ID = "getPushClientId";
|
|
const API_GET_PUSH_CLIENT_ID = "getPushClientId";
|
|
|
-const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_, { resolve, reject }) => {
|
|
|
|
|
|
|
+const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_, { resolve: resolve2, reject }) => {
|
|
|
Promise.resolve().then(() => {
|
|
Promise.resolve().then(() => {
|
|
|
if (typeof enabled === "undefined") {
|
|
if (typeof enabled === "undefined") {
|
|
|
enabled = false;
|
|
enabled = false;
|
|
@@ -1009,7 +1009,7 @@ const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_, { resolve, re
|
|
|
}
|
|
}
|
|
|
getPushCidCallbacks.push((cid2, errMsg) => {
|
|
getPushCidCallbacks.push((cid2, errMsg) => {
|
|
|
if (cid2) {
|
|
if (cid2) {
|
|
|
- resolve({ cid: cid2 });
|
|
|
|
|
|
|
+ resolve2({ cid: cid2 });
|
|
|
} else {
|
|
} else {
|
|
|
reject(errMsg);
|
|
reject(errMsg);
|
|
|
}
|
|
}
|
|
@@ -1074,9 +1074,9 @@ function promisify(name, api) {
|
|
|
if (isFunction(options.success) || isFunction(options.fail) || isFunction(options.complete)) {
|
|
if (isFunction(options.success) || isFunction(options.fail) || isFunction(options.complete)) {
|
|
|
return wrapperReturnValue(name, invokeApi(name, api, options, rest));
|
|
return wrapperReturnValue(name, invokeApi(name, api, options, rest));
|
|
|
}
|
|
}
|
|
|
- return wrapperReturnValue(name, handlePromise(new Promise((resolve, reject) => {
|
|
|
|
|
|
|
+ return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
|
|
|
invokeApi(name, api, extend({}, options, {
|
|
invokeApi(name, api, extend({}, options, {
|
|
|
- success: resolve,
|
|
|
|
|
|
|
+ success: resolve2,
|
|
|
fail: reject
|
|
fail: reject
|
|
|
}), rest);
|
|
}), rest);
|
|
|
})));
|
|
})));
|
|
@@ -3560,6 +3560,46 @@ function validateDirectiveName(name) {
|
|
|
warn("Do not use built-in directive ids as custom directive id: " + name);
|
|
warn("Do not use built-in directive ids as custom directive id: " + name);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+const COMPONENTS = "components";
|
|
|
|
|
+function resolveComponent(name, maybeSelfReference) {
|
|
|
|
|
+ return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
|
|
|
+}
|
|
|
|
|
+function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
|
|
|
|
|
+ const instance = currentRenderingInstance || currentInstance;
|
|
|
|
|
+ if (instance) {
|
|
|
|
|
+ const Component2 = instance.type;
|
|
|
|
|
+ if (type === COMPONENTS) {
|
|
|
|
|
+ const selfName = getComponentName(
|
|
|
|
|
+ Component2,
|
|
|
|
|
+ false
|
|
|
|
|
+ /* do not include inferred name to avoid breaking existing code */
|
|
|
|
|
+ );
|
|
|
|
|
+ if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
|
|
|
|
|
+ return Component2;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ const res = (
|
|
|
|
|
+ // local registration
|
|
|
|
|
+ // check instance[type] first which is resolved for options API
|
|
|
|
|
+ resolve(instance[type] || Component2[type], name) || // global registration
|
|
|
|
|
+ resolve(instance.appContext[type], name)
|
|
|
|
|
+ );
|
|
|
|
|
+ if (!res && maybeSelfReference) {
|
|
|
|
|
+ return Component2;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (warnMissing && !res) {
|
|
|
|
|
+ const extra = type === COMPONENTS ? `
|
|
|
|
|
+If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
|
|
|
|
|
+ warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
|
|
|
+ }
|
|
|
|
|
+ return res;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ warn(`resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+function resolve(registry, name) {
|
|
|
|
|
+ return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
|
|
|
|
|
+}
|
|
|
const getPublicInstance = (i) => {
|
|
const getPublicInstance = (i) => {
|
|
|
if (!i)
|
|
if (!i)
|
|
|
return null;
|
|
return null;
|
|
@@ -5143,8 +5183,8 @@ function nextTick(instance, fn) {
|
|
|
_resolve(instance.proxy);
|
|
_resolve(instance.proxy);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- return new Promise((resolve) => {
|
|
|
|
|
- _resolve = resolve;
|
|
|
|
|
|
|
+ return new Promise((resolve2) => {
|
|
|
|
|
+ _resolve = resolve2;
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
function clone(src, seen) {
|
|
function clone(src, seen) {
|
|
@@ -5907,11 +5947,16 @@ function vFor(source, renderItem) {
|
|
|
}
|
|
}
|
|
|
return ret;
|
|
return ret;
|
|
|
}
|
|
}
|
|
|
|
|
+function setRef(ref2, id, opts = {}) {
|
|
|
|
|
+ const { $templateRefs } = getCurrentInstance();
|
|
|
|
|
+ $templateRefs.push({ i: id, r: ref2, k: opts.k, f: opts.f });
|
|
|
|
|
+}
|
|
|
const o = (value, key) => vOn(value, key);
|
|
const o = (value, key) => vOn(value, key);
|
|
|
const f = (source, renderItem) => vFor(source, renderItem);
|
|
const f = (source, renderItem) => vFor(source, renderItem);
|
|
|
const e = (target, ...sources) => extend(target, ...sources);
|
|
const e = (target, ...sources) => extend(target, ...sources);
|
|
|
const n = (value) => normalizeClass(value);
|
|
const n = (value) => normalizeClass(value);
|
|
|
const t = (val) => toDisplayString(val);
|
|
const t = (val) => toDisplayString(val);
|
|
|
|
|
+const sr = (ref2, id, opts) => setRef(ref2, id, opts);
|
|
|
function createApp$1(rootComponent, rootProps = null) {
|
|
function createApp$1(rootComponent, rootProps = null) {
|
|
|
rootComponent && (rootComponent.mpType = "app");
|
|
rootComponent && (rootComponent.mpType = "app");
|
|
|
return createVueApp(rootComponent, rootProps).use(plugin);
|
|
return createVueApp(rootComponent, rootProps).use(plugin);
|
|
@@ -6758,5 +6803,7 @@ exports.onLoad = onLoad;
|
|
|
exports.onMounted = onMounted;
|
|
exports.onMounted = onMounted;
|
|
|
exports.onShow = onShow;
|
|
exports.onShow = onShow;
|
|
|
exports.ref = ref;
|
|
exports.ref = ref;
|
|
|
|
|
+exports.resolveComponent = resolveComponent;
|
|
|
|
|
+exports.sr = sr;
|
|
|
exports.t = t;
|
|
exports.t = t;
|
|
|
exports.unref = unref;
|
|
exports.unref = unref;
|