vue-i18n-routing
Advanced tools
Comparing version 1.1.4 to 1.2.0-0cdadba
@@ -7,2 +7,3 @@ import type { Composer } from '@intlify/vue-i18n-bridge'; | ||
import type { Locale } from '@intlify/vue-i18n-bridge'; | ||
import type { Locale as Locale_2 } from 'vue-i18n'; | ||
import { Location as Location_2 } from '@intlify/vue-router-bridge'; | ||
@@ -152,2 +153,4 @@ import { RawLocation } from '@intlify/vue-router-bridge'; | ||
declare type DynamicParamsInterceptor = () => Ref<Record<Locale_2, unknown>>; | ||
export declare type ExtendComposerHook = (compser: Composer) => void; | ||
@@ -292,2 +295,3 @@ | ||
localeCodes?: string[]; | ||
dynamicParamsInterceptor?: DynamicParamsInterceptor; | ||
}; | ||
@@ -616,2 +620,4 @@ | ||
export declare type MetaDynamicParamsInterceptor = (route: Route | RouteLocationNormalizedLoaded, key: Required<I18nRoutingOptions>['dynamicRouteParamsKey']) => Record<Locale, unknown>; | ||
/** | ||
@@ -618,0 +624,0 @@ * Route path prefix judgment logic in {@link resolveRoute} function |
@@ -657,3 +657,4 @@ var VueI18nRouting = function(exports, VueRouter3, vueDemi, vueI18nBridge) { | ||
switchLocalePathIntercepter: proxy.switchLocalePathIntercepter || options.switchLocalePathIntercepter || switchLocalePathIntercepter, | ||
dynamicRouteParamsKey: proxy.dynamicRouteParamsKey || options.dynamicRouteParamsKey || dynamicRouteParamsKey | ||
dynamicRouteParamsKey: proxy.dynamicRouteParamsKey || options.dynamicRouteParamsKey || dynamicRouteParamsKey, | ||
dynamicParamsInterceptor: options.dynamicParamsInterceptor || void 0 | ||
}; | ||
@@ -828,2 +829,3 @@ } | ||
function switchLocalePath(locale) { | ||
var _a, _b; | ||
const route = this.route; | ||
@@ -834,6 +836,11 @@ const name = getRouteBaseName.call(this, route); | ||
} | ||
const { switchLocalePathIntercepter, dynamicRouteParamsKey } = getI18nRoutingOptions(this.router, this); | ||
const { switchLocalePathIntercepter, dynamicRouteParamsKey, dynamicParamsInterceptor } = getI18nRoutingOptions( | ||
this.router, | ||
this | ||
); | ||
const routeValue = vueDemi.isVue3 ? route : vueDemi.isRef(route) ? route.value : route; | ||
const routeCopy = routeToObject(routeValue); | ||
const langSwitchParamsIntercepted = (_b = (_a = dynamicParamsInterceptor == null ? void 0 : dynamicParamsInterceptor()) == null ? void 0 : _a.value) == null ? void 0 : _b[locale]; | ||
const langSwitchParams = getLocalizableMetaFromDynamicParams(route, dynamicRouteParamsKey)[locale] || {}; | ||
const resolvedParams = langSwitchParamsIntercepted ?? langSwitchParams ?? {}; | ||
const _baseRoute = { | ||
@@ -843,3 +850,3 @@ name, | ||
...routeCopy.params, | ||
...langSwitchParams | ||
...resolvedParams | ||
} | ||
@@ -1201,3 +1208,3 @@ }; | ||
} | ||
const VERSION = "1.1.4"; | ||
const VERSION = "1.2.0"; | ||
exports.DEFAULT_BASE_URL = DEFAULT_BASE_URL; | ||
@@ -1204,0 +1211,0 @@ exports.DEFAULT_DETECTION_DIRECTION = DEFAULT_DETECTION_DIRECTION; |
@@ -660,3 +660,4 @@ "use strict"; | ||
switchLocalePathIntercepter: proxy.switchLocalePathIntercepter || options.switchLocalePathIntercepter || switchLocalePathIntercepter, | ||
dynamicRouteParamsKey: proxy.dynamicRouteParamsKey || options.dynamicRouteParamsKey || dynamicRouteParamsKey | ||
dynamicRouteParamsKey: proxy.dynamicRouteParamsKey || options.dynamicRouteParamsKey || dynamicRouteParamsKey, | ||
dynamicParamsInterceptor: options.dynamicParamsInterceptor || void 0 | ||
}; | ||
@@ -831,2 +832,3 @@ } | ||
function switchLocalePath(locale) { | ||
var _a, _b; | ||
const route = this.route; | ||
@@ -837,6 +839,11 @@ const name = getRouteBaseName.call(this, route); | ||
} | ||
const { switchLocalePathIntercepter, dynamicRouteParamsKey } = getI18nRoutingOptions(this.router, this); | ||
const { switchLocalePathIntercepter, dynamicRouteParamsKey, dynamicParamsInterceptor } = getI18nRoutingOptions( | ||
this.router, | ||
this | ||
); | ||
const routeValue = vueDemi.isVue3 ? route : vueDemi.isRef(route) ? route.value : route; | ||
const routeCopy = routeToObject(routeValue); | ||
const langSwitchParamsIntercepted = (_b = (_a = dynamicParamsInterceptor == null ? void 0 : dynamicParamsInterceptor()) == null ? void 0 : _a.value) == null ? void 0 : _b[locale]; | ||
const langSwitchParams = getLocalizableMetaFromDynamicParams(route, dynamicRouteParamsKey)[locale] || {}; | ||
const resolvedParams = langSwitchParamsIntercepted ?? langSwitchParams ?? {}; | ||
const _baseRoute = { | ||
@@ -846,3 +853,3 @@ name, | ||
...routeCopy.params, | ||
...langSwitchParams | ||
...resolvedParams | ||
} | ||
@@ -1204,3 +1211,3 @@ }; | ||
} | ||
const VERSION = "1.1.4"; | ||
const VERSION = "1.2.0"; | ||
exports.DEFAULT_BASE_URL = DEFAULT_BASE_URL; | ||
@@ -1207,0 +1214,0 @@ exports.DEFAULT_DETECTION_DIRECTION = DEFAULT_DETECTION_DIRECTION; |
{ | ||
"name": "vue-i18n-routing", | ||
"description": "The i18n routing with using vue-i18n", | ||
"version": "1.1.4", | ||
"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": "1.2.0-0cdadba", | ||
"dependencies": { | ||
"@intlify/shared": "^9.4.1", | ||
"@intlify/vue-i18n-bridge": "^1.0.1", | ||
"@intlify/vue-router-bridge": "^1.0.1", | ||
"@intlify/vue-i18n-bridge": "^1.1.0", | ||
"@intlify/vue-router-bridge": "^1.1.0", | ||
"ufo": "^1.2.0", | ||
"vue-demi": "^0.14.5" | ||
"vue-demi": ">=0.13.5 < 1.0.0" | ||
}, | ||
@@ -40,7 +29,7 @@ "devDependencies": { | ||
"peerDependencies": { | ||
"@vue/composition-api": "^1.0.0-rc.1", | ||
"vue": "^2.6.14 || ^2.7.0 || ^3.2.0", | ||
"vue-i18n": "^8.26.1 || >=9.2.0", | ||
"vue-i18n-bridge": ">=9.2.0", | ||
"vue-router": "^3.5.3 || ^3.6.0 || ^4.0.0", | ||
"@vue/composition-api": "^1.0.0-rc.1" | ||
"vue-router": "^3.5.3 || ^3.6.0 || ^4.0.0" | ||
}, | ||
@@ -121,3 +110,14 @@ "peerDependenciesMeta": { | ||
}, | ||
"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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
172396
12
4760
1
+ Addedpostcss@8.5.0(transitive)
- Removedpostcss@8.5.1(transitive)
Updatedvue-demi@>=0.13.5 < 1.0.0