@resistdesign/voltra 3.0.0-alpha.42 → 3.0.0-alpha.43

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/app/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export { createEasyLayout, getEasyLayoutTemplateDetails, getPascalCaseAreaName } from '../chunk-B4DHXYKJ.js';
1
+ export { createEasyLayout, getEasyLayoutTemplateDetails, getPascalCaseAreaName } from '../chunk-CMH6L5QQ.js';
2
2
  export { computeTrackPixels } from '../chunk-TJFTWPXQ.js';
3
- export { AutoForm, AutoFormView, Route, RouteContext, RouteContextConsumer, RouteContextProvider, RouteProvider, buildHistoryPath, buildQueryString, buildRoutePath, canUseBrowserHistory, computeAreaBounds, createAutoField, createBrowserRouteAdapter, createFormRenderer, createHistoryBackHandler, createManualRouteAdapter, createMemoryHistory, createNativeRouteAdapter, createRouteAdapterFromHistory, createUniversalAdapter, defaultTranslateValidationErrorCode, getFieldKind, parseHistoryPath, parseTemplate, resolveSuite, useFormEngine, useRouteContext, validateAreas, wrapRouteAdapterWithPathResolver } from '../chunk-FXMKH3RB.js';
3
+ export { AutoForm, AutoFormView, Route, RouteContext, RouteContextConsumer, RouteContextProvider, RouteProvider, buildHistoryPath, buildQueryString, buildRoutePath, canUseBrowserHistory, computeAreaBounds, createAutoField, createBrowserRouteAdapter, createFormRenderer, createHistoryBackHandler, createManualRouteAdapter, createMemoryHistory, createNativeRouteAdapter, createRouteAdapterFromHistory, createUniversalAdapter, defaultTranslateValidationErrorCode, getFieldKind, parseHistoryPath, parseTemplate, resolveSuite, useFormEngine, useRouteContext, validateAreas, wrapRouteAdapterWithPathResolver } from '../chunk-44BMFTKD.js';
4
4
  import '../chunk-7AMEFPPP.js';
5
5
  import '../chunk-YCTVEW2I.js';
6
6
  import { mergeStringPaths, PATH_DELIMITER } from '../chunk-WNFRDIBW.js';
@@ -50,6 +50,15 @@ export type RouteQueryValue = string | number | boolean | null | undefined | Arr
50
50
  * Query string map for route serialization.
51
51
  */
52
52
  export type RouteQuery = Record<string, RouteQueryValue>;
53
+ /**
54
+ * Route path matcher config.
55
+ */
56
+ export type RoutePathConfig = {
57
+ /** Path pattern, using `:` for params. */
58
+ path: string;
59
+ /** Optional exact-match override for this path entry. */
60
+ exact?: boolean;
61
+ };
53
62
  /**
54
63
  * Create a manual adapter for non-DOM runtimes (e.g., React Native).
55
64
  *
@@ -142,7 +151,7 @@ export type RouteProps<ParamsType extends Record<string, any>> = {
142
151
  /**
143
152
  * Route path pattern(s), using `:` for params.
144
153
  */
145
- path?: string | string[];
154
+ path?: string | (string | RoutePathConfig)[];
146
155
  /**
147
156
  * Callback when params update for this route.
148
157
  *
@@ -673,15 +673,24 @@ var RouteMatcher = ({
673
673
  () => currentWindowPath,
674
674
  [currentWindowPath]
675
675
  );
676
- const normalizedPaths = useMemo(
677
- () => Array.isArray(path) ? path : [path],
678
- [path]
679
- );
676
+ const normalizedPaths = useMemo(() => {
677
+ const routePaths = Array.isArray(path) ? path : [path];
678
+ return routePaths.map(
679
+ (routePath) => typeof routePath === "string" ? {
680
+ path: routePath,
681
+ exact
682
+ } : routePath
683
+ );
684
+ }, [path, exact]);
680
685
  const matchedRoute = useMemo(
681
686
  () => {
682
- for (const routePath of normalizedPaths) {
683
- const fullPath = mergeStringPaths(parentPath, routePath);
684
- const newParams = getParamsAndTestPath(targetCurrentPath, fullPath, exact);
687
+ for (const routePathConfig of normalizedPaths) {
688
+ const fullPath = mergeStringPaths(parentPath, routePathConfig.path);
689
+ const newParams = getParamsAndTestPath(
690
+ targetCurrentPath,
691
+ fullPath,
692
+ routePathConfig.exact
693
+ );
685
694
  if (newParams) {
686
695
  return {
687
696
  fullPath,
@@ -691,7 +700,7 @@ var RouteMatcher = ({
691
700
  }
692
701
  return null;
693
702
  },
694
- [targetCurrentPath, parentPath, normalizedPaths, exact]
703
+ [targetCurrentPath, parentPath, normalizedPaths]
695
704
  );
696
705
  const params = useMemo(
697
706
  () => ({
@@ -1,4 +1,4 @@
1
- import { parseTemplate, validateAreas } from './chunk-FXMKH3RB.js';
1
+ import { parseTemplate, validateAreas } from './chunk-44BMFTKD.js';
2
2
 
3
3
  // src/app/utils/EasyLayout.tsx
4
4
  var getPascalCaseAreaName = (area) => {
package/native/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { computeTrackPixels } from '../chunk-TJFTWPXQ.js';
2
- import { createFormRenderer, createHistoryBackHandler, buildHistoryPath, AutoFormView, AutoForm, parseTemplate, validateAreas, computeAreaBounds, parseHistoryPath, createMemoryHistory, Route, buildRoutePath } from '../chunk-FXMKH3RB.js';
2
+ import { createFormRenderer, createHistoryBackHandler, buildHistoryPath, AutoFormView, AutoForm, parseTemplate, validateAreas, computeAreaBounds, parseHistoryPath, createMemoryHistory, Route, buildRoutePath } from '../chunk-44BMFTKD.js';
3
3
  import { ERROR_MESSAGE_CONSTANTS } from '../chunk-YCTVEW2I.js';
4
4
  import { resolveRouteAdapterPath, getPathArray } from '../chunk-WNFRDIBW.js';
5
5
  import '../chunk-I2KLQ2HA.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resistdesign/voltra",
3
- "version": "3.0.0-alpha.42",
3
+ "version": "3.0.0-alpha.43",
4
4
  "description": "With our powers combined!",
5
5
  "homepage": "https://voltra.app",
6
6
  "repository": "git@github.com:resistdesign/voltra.git",
package/web/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createEasyLayout } from '../chunk-B4DHXYKJ.js';
2
- import { createFormRenderer, AutoFormView, AutoForm, createBrowserRouteAdapter, Route } from '../chunk-FXMKH3RB.js';
1
+ import { createEasyLayout } from '../chunk-CMH6L5QQ.js';
2
+ import { createFormRenderer, AutoFormView, AutoForm, createBrowserRouteAdapter, Route } from '../chunk-44BMFTKD.js';
3
3
  import { ERROR_MESSAGE_CONSTANTS } from '../chunk-YCTVEW2I.js';
4
4
  import '../chunk-WNFRDIBW.js';
5
5
  import { __export, __reExport } from '../chunk-I2KLQ2HA.js';