@resistdesign/voltra 3.0.0-alpha.40 → 3.0.0-alpha.42
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 +2 -2
- package/app/utils/Route.d.ts +2 -2
- package/{chunk-2MOLWZMQ.js → chunk-B4DHXYKJ.js} +1 -1
- package/{chunk-DT6WWJUI.js → chunk-FXMKH3RB.js} +23 -11
- package/iac/packs/gateway.d.ts +1 -1
- package/iac/packs/index.js +80 -28
- package/native/index.js +1 -1
- package/package.json +1 -1
- package/web/index.js +2 -2
package/app/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { createEasyLayout, getEasyLayoutTemplateDetails, getPascalCaseAreaName } from '../chunk-
|
|
1
|
+
export { createEasyLayout, getEasyLayoutTemplateDetails, getPascalCaseAreaName } from '../chunk-B4DHXYKJ.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-
|
|
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';
|
|
4
4
|
import '../chunk-7AMEFPPP.js';
|
|
5
5
|
import '../chunk-YCTVEW2I.js';
|
|
6
6
|
import { mergeStringPaths, PATH_DELIMITER } from '../chunk-WNFRDIBW.js';
|
package/app/utils/Route.d.ts
CHANGED
|
@@ -140,9 +140,9 @@ export declare const RouteProvider: ({ adapter, initialPath, children, }: RouteP
|
|
|
140
140
|
*/
|
|
141
141
|
export type RouteProps<ParamsType extends Record<string, any>> = {
|
|
142
142
|
/**
|
|
143
|
-
* Route path pattern, using `:` for params.
|
|
143
|
+
* Route path pattern(s), using `:` for params.
|
|
144
144
|
*/
|
|
145
|
-
path?: string;
|
|
145
|
+
path?: string | string[];
|
|
146
146
|
/**
|
|
147
147
|
* Callback when params update for this route.
|
|
148
148
|
*
|
|
@@ -673,37 +673,49 @@ var RouteMatcher = ({
|
|
|
673
673
|
() => currentWindowPath,
|
|
674
674
|
[currentWindowPath]
|
|
675
675
|
);
|
|
676
|
-
const
|
|
677
|
-
() =>
|
|
678
|
-
[
|
|
676
|
+
const normalizedPaths = useMemo(
|
|
677
|
+
() => Array.isArray(path) ? path : [path],
|
|
678
|
+
[path]
|
|
679
679
|
);
|
|
680
|
-
const
|
|
681
|
-
() =>
|
|
682
|
-
|
|
680
|
+
const matchedRoute = useMemo(
|
|
681
|
+
() => {
|
|
682
|
+
for (const routePath of normalizedPaths) {
|
|
683
|
+
const fullPath = mergeStringPaths(parentPath, routePath);
|
|
684
|
+
const newParams = getParamsAndTestPath(targetCurrentPath, fullPath, exact);
|
|
685
|
+
if (newParams) {
|
|
686
|
+
return {
|
|
687
|
+
fullPath,
|
|
688
|
+
newParams
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
return null;
|
|
693
|
+
},
|
|
694
|
+
[targetCurrentPath, parentPath, normalizedPaths, exact]
|
|
683
695
|
);
|
|
684
696
|
const params = useMemo(
|
|
685
697
|
() => ({
|
|
686
698
|
...parentParams,
|
|
687
|
-
...newParams ? newParams : {}
|
|
699
|
+
...matchedRoute?.newParams ? matchedRoute.newParams : {}
|
|
688
700
|
}),
|
|
689
|
-
[parentParams,
|
|
701
|
+
[parentParams, matchedRoute]
|
|
690
702
|
);
|
|
691
703
|
const newRouteContext = useMemo(
|
|
692
704
|
() => ({
|
|
693
705
|
currentWindowPath: targetCurrentPath,
|
|
694
|
-
parentPath: fullPath,
|
|
706
|
+
parentPath: matchedRoute?.fullPath ?? parentPath,
|
|
695
707
|
params,
|
|
696
708
|
isTopLevel: false,
|
|
697
709
|
adapter
|
|
698
710
|
}),
|
|
699
|
-
[targetCurrentPath,
|
|
711
|
+
[targetCurrentPath, matchedRoute, parentPath, params, adapter]
|
|
700
712
|
);
|
|
701
713
|
useEffect(() => {
|
|
702
714
|
if (onParamsChange) {
|
|
703
715
|
onParamsChange(params);
|
|
704
716
|
}
|
|
705
717
|
}, [params, onParamsChange]);
|
|
706
|
-
return newParams ? /* @__PURE__ */ jsx(RouteContextProvider, { value: newRouteContext, children }) : null;
|
|
718
|
+
return matchedRoute?.newParams ? /* @__PURE__ */ jsx(RouteContextProvider, { value: newRouteContext, children }) : null;
|
|
707
719
|
};
|
|
708
720
|
var RouteRootProvider = ({
|
|
709
721
|
children,
|
package/iac/packs/gateway.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ export type AddGatewayConfig = {
|
|
|
63
63
|
*/
|
|
64
64
|
authorizer?: AddGatewayAuthorizerConfig | boolean;
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
66
|
+
* Optional manual suffix appended after the deterministic deployment hash.
|
|
67
67
|
*/
|
|
68
68
|
deploymentSuffix?: string;
|
|
69
69
|
};
|
package/iac/packs/index.js
CHANGED
|
@@ -950,6 +950,31 @@ var addSecureFileStorage = createResourcePack(
|
|
|
950
950
|
);
|
|
951
951
|
|
|
952
952
|
// src/iac/packs/gateway.ts
|
|
953
|
+
var canonicalizeHashableValue = (value) => {
|
|
954
|
+
if (Array.isArray(value)) {
|
|
955
|
+
return value.map((item) => canonicalizeHashableValue(item));
|
|
956
|
+
}
|
|
957
|
+
if (value && typeof value === "object") {
|
|
958
|
+
const output = {};
|
|
959
|
+
Object.keys(value).sort().forEach((key) => {
|
|
960
|
+
output[key] = canonicalizeHashableValue(
|
|
961
|
+
value[key]
|
|
962
|
+
);
|
|
963
|
+
});
|
|
964
|
+
return output;
|
|
965
|
+
}
|
|
966
|
+
return value;
|
|
967
|
+
};
|
|
968
|
+
var getDeterministicHash = (value) => {
|
|
969
|
+
const canonical = JSON.stringify(canonicalizeHashableValue(value));
|
|
970
|
+
let hash = 2166136261;
|
|
971
|
+
for (let i = 0; i < canonical.length; i += 1) {
|
|
972
|
+
hash ^= canonical.charCodeAt(i);
|
|
973
|
+
hash = Math.imul(hash, 16777619);
|
|
974
|
+
hash >>>= 0;
|
|
975
|
+
}
|
|
976
|
+
return hash.toString(16).toUpperCase().padStart(8, "0");
|
|
977
|
+
};
|
|
953
978
|
var DEFAULT_AUTH_TYPE = "COGNITO_USER_POOLS";
|
|
954
979
|
var addGateway = createResourcePack(
|
|
955
980
|
({
|
|
@@ -974,6 +999,27 @@ var addGateway = createResourcePack(
|
|
|
974
999
|
providerARNs,
|
|
975
1000
|
identitySource = "method.request.header.Authorization"
|
|
976
1001
|
} = !!authorizer && typeof authorizer === "object" ? authorizer : {};
|
|
1002
|
+
const cloudFunctionIntegration = {
|
|
1003
|
+
Type: "AWS_PROXY",
|
|
1004
|
+
IntegrationHttpMethod: "POST",
|
|
1005
|
+
Uri: cloudFunctionUri
|
|
1006
|
+
};
|
|
1007
|
+
const gatewayResponseParameters = {
|
|
1008
|
+
"gatewayresponse.header.Access-Control-Allow-Origin": "method.request.header.origin",
|
|
1009
|
+
"gatewayresponse.header.Access-Control-Allow-Credentials": "'true'",
|
|
1010
|
+
"gatewayresponse.header.Access-Control-Allow-Headers": "'*'"
|
|
1011
|
+
};
|
|
1012
|
+
const cloudFunctionPermissionSourceArn = {
|
|
1013
|
+
"Fn::Sub": [
|
|
1014
|
+
"arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/*/*",
|
|
1015
|
+
{
|
|
1016
|
+
__Stage__: stageName,
|
|
1017
|
+
__ApiId__: {
|
|
1018
|
+
Ref: id
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
]
|
|
1022
|
+
};
|
|
977
1023
|
const authorizerId = `${id}CustomAuthorizer`;
|
|
978
1024
|
const authProps = !!authorizer ? {
|
|
979
1025
|
AuthorizationScopes: authScopes,
|
|
@@ -984,7 +1030,33 @@ var addGateway = createResourcePack(
|
|
|
984
1030
|
} : {
|
|
985
1031
|
AuthorizationType: "NONE"
|
|
986
1032
|
};
|
|
987
|
-
const
|
|
1033
|
+
const gatewayDeploymentFingerprint = {
|
|
1034
|
+
restApiEndpointTypes: ["EDGE"],
|
|
1035
|
+
proxyPathPart: "{proxy+}",
|
|
1036
|
+
anyMethod: {
|
|
1037
|
+
...authProps,
|
|
1038
|
+
HttpMethod: "ANY",
|
|
1039
|
+
Integration: cloudFunctionIntegration
|
|
1040
|
+
},
|
|
1041
|
+
optionsMethod: {
|
|
1042
|
+
AuthorizationType: "NONE",
|
|
1043
|
+
HttpMethod: "OPTIONS",
|
|
1044
|
+
Integration: cloudFunctionIntegration
|
|
1045
|
+
},
|
|
1046
|
+
gatewayResponseDefault4XX: {
|
|
1047
|
+
ResponseParameters: gatewayResponseParameters,
|
|
1048
|
+
ResponseType: "DEFAULT_4XX"
|
|
1049
|
+
},
|
|
1050
|
+
stageName,
|
|
1051
|
+
cloudFunctionPermissionSourceArn,
|
|
1052
|
+
authorizer: !!authorizer ? {
|
|
1053
|
+
IdentitySource: identitySource,
|
|
1054
|
+
ProviderARNs: providerARNs,
|
|
1055
|
+
Type: "COGNITO_USER_POOLS"
|
|
1056
|
+
} : null
|
|
1057
|
+
};
|
|
1058
|
+
const deploymentHash = getDeterministicHash(gatewayDeploymentFingerprint);
|
|
1059
|
+
const fullDeploymentId = `${id}GatewayRESTAPIDeployment${deploymentHash}${deploymentSuffix}`;
|
|
988
1060
|
return new SimpleCFT().patch({
|
|
989
1061
|
Resources: {
|
|
990
1062
|
// REST API
|
|
@@ -1025,9 +1097,7 @@ var addGateway = createResourcePack(
|
|
|
1025
1097
|
Ref: id
|
|
1026
1098
|
},
|
|
1027
1099
|
Integration: {
|
|
1028
|
-
|
|
1029
|
-
IntegrationHttpMethod: "POST",
|
|
1030
|
-
Uri: cloudFunctionUri
|
|
1100
|
+
...cloudFunctionIntegration
|
|
1031
1101
|
}
|
|
1032
1102
|
}
|
|
1033
1103
|
},
|
|
@@ -1044,9 +1114,7 @@ var addGateway = createResourcePack(
|
|
|
1044
1114
|
Ref: id
|
|
1045
1115
|
},
|
|
1046
1116
|
Integration: {
|
|
1047
|
-
|
|
1048
|
-
IntegrationHttpMethod: "POST",
|
|
1049
|
-
Uri: cloudFunctionUri
|
|
1117
|
+
...cloudFunctionIntegration
|
|
1050
1118
|
}
|
|
1051
1119
|
}
|
|
1052
1120
|
}
|
|
@@ -1067,9 +1135,7 @@ var addGateway = createResourcePack(
|
|
|
1067
1135
|
Ref: id
|
|
1068
1136
|
},
|
|
1069
1137
|
Integration: {
|
|
1070
|
-
|
|
1071
|
-
IntegrationHttpMethod: "POST",
|
|
1072
|
-
Uri: cloudFunctionUri
|
|
1138
|
+
...cloudFunctionIntegration
|
|
1073
1139
|
}
|
|
1074
1140
|
}
|
|
1075
1141
|
},
|
|
@@ -1086,21 +1152,15 @@ var addGateway = createResourcePack(
|
|
|
1086
1152
|
Ref: id
|
|
1087
1153
|
},
|
|
1088
1154
|
Integration: {
|
|
1089
|
-
|
|
1090
|
-
IntegrationHttpMethod: "POST",
|
|
1091
|
-
Uri: cloudFunctionUri
|
|
1155
|
+
...cloudFunctionIntegration
|
|
1092
1156
|
}
|
|
1093
1157
|
}
|
|
1094
1158
|
},
|
|
1095
1159
|
[`${id}GatewayResponseDefault4XX`]: {
|
|
1096
1160
|
Type: "AWS::ApiGateway::GatewayResponse",
|
|
1097
1161
|
Properties: {
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
"gatewayresponse.header.Access-Control-Allow-Origin": "method.request.header.origin",
|
|
1101
|
-
"gatewayresponse.header.Access-Control-Allow-Credentials": "'true'",
|
|
1102
|
-
"gatewayresponse.header.Access-Control-Allow-Headers": "'*'"
|
|
1103
|
-
},
|
|
1162
|
+
// Not authorized, so just allow the current origin by mapping it into the header.
|
|
1163
|
+
ResponseParameters: gatewayResponseParameters,
|
|
1104
1164
|
ResponseType: "DEFAULT_4XX",
|
|
1105
1165
|
RestApiId: {
|
|
1106
1166
|
Ref: id
|
|
@@ -1256,15 +1316,7 @@ var addGateway = createResourcePack(
|
|
|
1256
1316
|
"Fn::GetAtt": [cloudFunctionId, "Arn"]
|
|
1257
1317
|
},
|
|
1258
1318
|
SourceArn: {
|
|
1259
|
-
|
|
1260
|
-
"arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/*/*",
|
|
1261
|
-
{
|
|
1262
|
-
__Stage__: stageName,
|
|
1263
|
-
__ApiId__: {
|
|
1264
|
-
Ref: id
|
|
1265
|
-
}
|
|
1266
|
-
}
|
|
1267
|
-
]
|
|
1319
|
+
...cloudFunctionPermissionSourceArn
|
|
1268
1320
|
}
|
|
1269
1321
|
}
|
|
1270
1322
|
}
|
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-
|
|
2
|
+
import { createFormRenderer, createHistoryBackHandler, buildHistoryPath, AutoFormView, AutoForm, parseTemplate, validateAreas, computeAreaBounds, parseHistoryPath, createMemoryHistory, Route, buildRoutePath } from '../chunk-FXMKH3RB.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
package/web/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createEasyLayout } from '../chunk-
|
|
2
|
-
import { createFormRenderer, AutoFormView, AutoForm, createBrowserRouteAdapter, Route } from '../chunk-
|
|
1
|
+
import { createEasyLayout } from '../chunk-B4DHXYKJ.js';
|
|
2
|
+
import { createFormRenderer, AutoFormView, AutoForm, createBrowserRouteAdapter, Route } from '../chunk-FXMKH3RB.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';
|