@evanschleret/formforgeclient 1.2.3 → 1.2.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/module.json
CHANGED
|
@@ -121,11 +121,10 @@ export function useFormForgeClient(config = {}) {
|
|
|
121
121
|
const nuxtApp = useNuxtApp();
|
|
122
122
|
const route = useRoute();
|
|
123
123
|
const injectedClient = nuxtApp.$formforge;
|
|
124
|
+
const baseConfig = injectedClient?.config ?? useRuntimeConfig().public.formforge;
|
|
124
125
|
if (injectedClient !== void 0 && !hasConfigOverrides(config)) {
|
|
125
126
|
return injectedClient;
|
|
126
127
|
}
|
|
127
|
-
const runtimeConfig = useRuntimeConfig();
|
|
128
|
-
const runtimePublicConfig = runtimeConfig.public.formforge;
|
|
129
128
|
const routeParamsResolver = () => {
|
|
130
129
|
const appRouteQuery = nuxtApp._route?.value?.query;
|
|
131
130
|
const appRouteParams = nuxtApp._route?.value?.params;
|
|
@@ -144,14 +143,13 @@ export function useFormForgeClient(config = {}) {
|
|
|
144
143
|
}
|
|
145
144
|
);
|
|
146
145
|
const resolvedPath = composableRoutePath || appRoutePath;
|
|
147
|
-
const resolvedBaseURL = config.baseURL ??
|
|
148
|
-
const resolvedScopedRoutes = config.scopedRoutes ??
|
|
146
|
+
const resolvedBaseURL = config.baseURL ?? baseConfig?.baseURL;
|
|
147
|
+
const resolvedScopedRoutes = config.scopedRoutes ?? baseConfig?.scopedRoutes;
|
|
149
148
|
const inferredFromBaseURL = inferParamsFromPath(resolvedBaseURL, resolvedPath);
|
|
150
149
|
const withBaseURLValues = withInferredMissingValues(mergedRouteValues, inferredFromBaseURL);
|
|
151
150
|
const inferredFromScopes = inferScopeSourcesFromPath(resolvedScopedRoutes, resolvedPath);
|
|
152
151
|
return withInferredMissingValues(withBaseURLValues, inferredFromScopes);
|
|
153
152
|
};
|
|
154
|
-
const baseConfig = runtimePublicConfig;
|
|
155
153
|
const mergedConfig = {
|
|
156
154
|
...baseConfig,
|
|
157
155
|
...config
|