vue-i18n-routing
Advanced tools
Comparing version 0.10.0 to 0.10.1-a872796
@@ -158,3 +158,3 @@ import type { Composer } from '@intlify/vue-i18n-bridge'; | ||
export declare function getComposer(i18n: I18n | VueI18n): Composer; | ||
export declare function getComposer(i18n: I18n | VueI18n | Composer): Composer; | ||
@@ -161,0 +161,0 @@ /** |
@@ -20,3 +20,3 @@ var VueI18nRouting = function(exports, VueRouter3, vueDemi, vueI18nBridge) { | ||
/*! | ||
* shared v9.3.0-beta.8 | ||
* shared v9.3.0-beta.10 | ||
* (c) 2022 kazuya kawaguchi | ||
@@ -336,6 +336,7 @@ * Released under the MIT License. | ||
i18n.install = (vue, ...options) => { | ||
const pluginOptions = isPluginOptions(options[0]) ? options[0] : { inject: true }; | ||
const pluginOptions = isPluginOptions(options[0]) ? assign({}, options[0]) : { inject: true }; | ||
if (pluginOptions.inject == null) { | ||
pluginOptions.inject = true; | ||
} | ||
const orgComposerExtend = pluginOptions.__composerExtend; | ||
pluginOptions.__composerExtend = (c) => { | ||
@@ -346,8 +347,16 @@ const g = getComposer(i18n); | ||
c.baseUrl = vueDemi.computed(() => g.baseUrl.value); | ||
if (isFunction(orgComposerExtend)) { | ||
Reflect.apply(orgComposerExtend, pluginOptions, [c]); | ||
} | ||
}; | ||
if (isVueI18n(i18n.global)) { | ||
const orgVueI18nExtend = pluginOptions.__vueI18nExtend; | ||
pluginOptions.__vueI18nExtend = (vueI18n) => { | ||
extendVueI18n(vueI18n, hooks.onExtendVueI18n); | ||
if (isFunction(orgVueI18nExtend)) { | ||
Reflect.apply(orgVueI18nExtend, pluginOptions, [vueI18n]); | ||
} | ||
}; | ||
} | ||
options[0] = pluginOptions; | ||
Reflect.apply(orgInstall, i18n, [vue, ...options]); | ||
@@ -466,3 +475,3 @@ const composer = getComposer(i18n); | ||
function isPluginOptions(options) { | ||
return isObject(options) && "inject" in options && isBoolean(options.inject); | ||
return isObject(options) && ("inject" in options || "__composerExtend" in options || "__vueI18nExtend" in options) && isBoolean(options.inject); | ||
} | ||
@@ -1110,3 +1119,3 @@ const GlobalOptionsRegistory = makeSymbol("vue-i18n-routing-gor"); | ||
} | ||
const VERSION = "0.10.0"; | ||
const VERSION = "0.10.1"; | ||
exports.DEFAULT_BASE_URL = DEFAULT_BASE_URL; | ||
@@ -1113,0 +1122,0 @@ exports.DEFAULT_DETECTION_DIRECTION = DEFAULT_DETECTION_DIRECTION; |
@@ -23,3 +23,3 @@ "use strict"; | ||
/*! | ||
* shared v9.3.0-beta.8 | ||
* shared v9.3.0-beta.10 | ||
* (c) 2022 kazuya kawaguchi | ||
@@ -339,6 +339,7 @@ * Released under the MIT License. | ||
i18n.install = (vue, ...options) => { | ||
const pluginOptions = isPluginOptions(options[0]) ? options[0] : { inject: true }; | ||
const pluginOptions = isPluginOptions(options[0]) ? assign({}, options[0]) : { inject: true }; | ||
if (pluginOptions.inject == null) { | ||
pluginOptions.inject = true; | ||
} | ||
const orgComposerExtend = pluginOptions.__composerExtend; | ||
pluginOptions.__composerExtend = (c) => { | ||
@@ -349,8 +350,16 @@ const g = getComposer(i18n); | ||
c.baseUrl = vueDemi.computed(() => g.baseUrl.value); | ||
if (isFunction(orgComposerExtend)) { | ||
Reflect.apply(orgComposerExtend, pluginOptions, [c]); | ||
} | ||
}; | ||
if (isVueI18n(i18n.global)) { | ||
const orgVueI18nExtend = pluginOptions.__vueI18nExtend; | ||
pluginOptions.__vueI18nExtend = (vueI18n) => { | ||
extendVueI18n(vueI18n, hooks.onExtendVueI18n); | ||
if (isFunction(orgVueI18nExtend)) { | ||
Reflect.apply(orgVueI18nExtend, pluginOptions, [vueI18n]); | ||
} | ||
}; | ||
} | ||
options[0] = pluginOptions; | ||
Reflect.apply(orgInstall, i18n, [vue, ...options]); | ||
@@ -469,3 +478,3 @@ const composer = getComposer(i18n); | ||
function isPluginOptions(options) { | ||
return isObject(options) && "inject" in options && isBoolean(options.inject); | ||
return isObject(options) && ("inject" in options || "__composerExtend" in options || "__vueI18nExtend" in options) && isBoolean(options.inject); | ||
} | ||
@@ -1113,3 +1122,3 @@ const GlobalOptionsRegistory = makeSymbol("vue-i18n-routing-gor"); | ||
} | ||
const VERSION = "0.10.0"; | ||
const VERSION = "0.10.1"; | ||
exports.DEFAULT_BASE_URL = DEFAULT_BASE_URL; | ||
@@ -1116,0 +1125,0 @@ exports.DEFAULT_DETECTION_DIRECTION = DEFAULT_DETECTION_DIRECTION; |
{ | ||
"name": "vue-i18n-routing", | ||
"description": "The i18n routing with using vue-i18n", | ||
"version": "0.10.0", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"typecheck": "tsc -p . --noEmit", | ||
"switch:2": "vue-demi-switch 2 vue2 && vue-router-switch 3 vue-router3 && vue-i18n-switch 8 vue-i18n-legacy", | ||
"switch:3": "vue-demi-switch 3 && vue-router-switch 4 && vue-i18n-switch 9", | ||
"test": "vitest run", | ||
"test:watch": "vitest", | ||
"test:cover": "vitest --coverage", | ||
"build:docs": "api-docs-gen ./temp/vue-i18n-routing.api.json -c ./docsgen.config.js -o ./ -g noprefix" | ||
}, | ||
"version": "0.10.1-a872796", | ||
"dependencies": { | ||
@@ -41,4 +30,4 @@ "@intlify/shared": "next", | ||
"vue": "^2.6.14 || ^2.7.0 || ^3.2.0", | ||
"vue-i18n": "^8.26.1 || ^9.2.0 || ^9.3.0-beta.8", | ||
"vue-i18n-bridge": "^9.2.0 || ^9.3.0-beta.6", | ||
"vue-i18n": "^8.26.1 || ^9.2.0 || ^9.3.0-beta.10", | ||
"vue-i18n-bridge": "^9.2.0 || ^9.3.0-beta.10", | ||
"vue-router": "^3.5.3 || ^3.6.0 || ^4.0.0", | ||
@@ -121,3 +110,14 @@ "@vue/composition-api": "^1.0.0-rc.1" | ||
}, | ||
"sideEffects": false | ||
} | ||
"sideEffects": false, | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"typecheck": "tsc -p . --noEmit", | ||
"switch:2": "vue-demi-switch 2 vue2 && vue-router-switch 3 vue-router3 && vue-i18n-switch 8 vue-i18n-legacy", | ||
"switch:3": "vue-demi-switch 3 && vue-router-switch 4 && vue-i18n-switch 9", | ||
"test": "vitest run", | ||
"test:watch": "vitest", | ||
"test:cover": "vitest --coverage", | ||
"build:docs": "api-docs-gen ./temp/vue-i18n-routing.api.json -c ./docsgen.config.js -o ./ -g noprefix" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
158039
4261