@resistdesign/voltra 3.0.0-alpha.3 → 3.0.0-alpha.30
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/README.md +330 -7
- package/api/DBX/DBXAsserts.d.ts +95 -0
- package/api/DBX/DBXRequest.d.ts +5 -0
- package/api/DBX/DBXRuntime.d.ts +5 -0
- package/api/DBX/DBXScenarioConfig.d.ts +9 -0
- package/api/DBX/DBXSeed.d.ts +124 -0
- package/api/DBX/DBXTypes.d.ts +176 -0
- package/api/DBX/index.d.ts +8 -0
- package/api/DataAccessControl.d.ts +220 -0
- package/api/Indexing/API.d.ts +224 -0
- package/api/Indexing/Cursor.d.ts +101 -0
- package/api/Indexing/Handler/Config.d.ts +39 -0
- package/api/Indexing/Handler.d.ts +166 -0
- package/api/Indexing/Trace.d.ts +54 -0
- package/api/Indexing/Types.d.ts +204 -0
- package/api/Indexing/ddb/AwsSdkV3Adapter.d.ts +8 -0
- package/api/Indexing/ddb/Types.d.ts +169 -0
- package/api/Indexing/docId.d.ts +27 -0
- package/api/Indexing/exact/ExactDdb.d.ts +58 -0
- package/api/Indexing/exact/ExactIndex.d.ts +90 -0
- package/api/Indexing/exact/ExactS3.d.ts +41 -0
- package/api/Indexing/fieldQualification.d.ts +12 -0
- package/api/Indexing/fulltext/FullTextDdbBackend.d.ts +210 -0
- package/api/Indexing/fulltext/FullTextMemoryBackend.d.ts +93 -0
- package/api/Indexing/fulltext/Schema.d.ts +164 -0
- package/api/Indexing/hashUniversal.d.ts +13 -0
- package/api/Indexing/index.d.ts +45 -0
- package/api/Indexing/lossy/LossyDdb.d.ts +43 -0
- package/api/Indexing/lossy/LossyIndex.d.ts +72 -0
- package/api/Indexing/lossy/LossyS3.d.ts +40 -0
- package/api/Indexing/rel/Cursor.d.ts +25 -0
- package/api/Indexing/rel/Handlers.d.ts +143 -0
- package/api/Indexing/rel/RelationalDdb.d.ts +169 -0
- package/api/Indexing/rel/RelationalInMemoryBackend.d.ts +38 -0
- package/api/Indexing/rel/Types.d.ts +69 -0
- package/api/Indexing/structured/Cursor.d.ts +26 -0
- package/api/Indexing/structured/Handlers.d.ts +128 -0
- package/api/Indexing/structured/SearchStructured.d.ts +44 -0
- package/api/Indexing/structured/StructuredDdb.d.ts +166 -0
- package/api/Indexing/structured/StructuredDdbBackend.d.ts +109 -0
- package/api/Indexing/structured/StructuredInMemoryBackend.d.ts +34 -0
- package/api/Indexing/structured/StructuredInMemoryIndex.d.ts +58 -0
- package/api/Indexing/structured/StructuredStringLike.d.ts +25 -0
- package/api/Indexing/structured/StructuredWriter.d.ts +61 -0
- package/api/Indexing/structured/Types.d.ts +126 -0
- package/api/Indexing/structured/index.d.ts +9 -0
- package/api/Indexing/tokenize.d.ts +31 -0
- package/api/ORM/DACUtils.d.ts +270 -0
- package/api/ORM/ListItemUtils.d.ts +40 -0
- package/api/ORM/ORMRouteMap.d.ts +55 -0
- package/api/ORM/TypeInfoORMService.d.ts +555 -0
- package/api/ORM/drivers/DynamoDBDataItemDBDriver/ConfigTypes.d.ts +229 -0
- package/api/ORM/drivers/DynamoDBDataItemDBDriver.d.ts +89 -0
- package/api/ORM/drivers/InMemoryDataItemDBDriver/ConfigTypes.d.ts +4 -0
- package/api/ORM/drivers/InMemoryDataItemDBDriver.d.ts +55 -0
- package/api/ORM/drivers/InMemoryFileItemDBDriver/ConfigTypes.d.ts +13 -0
- package/api/ORM/drivers/InMemoryFileItemDBDriver.d.ts +98 -0
- package/api/ORM/drivers/InMemoryItemRelationshipDBDriver.d.ts +16 -0
- package/api/ORM/drivers/IndexingRelationshipDriver.d.ts +123 -0
- package/api/ORM/drivers/S3FileItemDBDriver/ConfigTypes.d.ts +322 -0
- package/api/ORM/drivers/S3FileItemDBDriver/S3FileDriver.d.ts +118 -0
- package/{src/api → api}/ORM/drivers/S3FileItemDBDriver.d.ts +27 -0
- package/api/ORM/drivers/common/SupportedTypeInfoORMDBDrivers.d.ts +36 -0
- package/{src/api → api}/ORM/drivers/common/Types.d.ts +120 -0
- package/api/ORM/drivers/common/index.d.ts +12 -0
- package/api/ORM/drivers/index.d.ts +22 -0
- package/api/ORM/index.d.ts +33 -0
- package/api/ORM/indexing/criteriaToStructuredWhere.d.ts +17 -0
- package/api/Router/AWS.d.ts +80 -0
- package/api/Router/Auth.d.ts +14 -0
- package/api/Router/CORS.d.ts +66 -0
- package/api/Router/Types.d.ts +138 -0
- package/api/Router/index.d.ts +89 -0
- package/api/index.d.ts +72 -0
- package/api/index.js +8827 -0
- package/app/forms/Engine.d.ts +20 -0
- package/app/forms/UI.d.ts +73 -0
- package/app/forms/core/createAutoField.d.ts +35 -0
- package/app/forms/core/createFormRenderer.d.ts +24 -0
- package/app/forms/core/getFieldKind.d.ts +14 -0
- package/app/forms/core/index.d.ts +16 -0
- package/app/forms/core/mergeSuites.d.ts +22 -0
- package/app/forms/core/resolveSuite.d.ts +14 -0
- package/app/forms/core/types.d.ts +169 -0
- package/app/forms/index.d.ts +15 -0
- package/app/forms/types.d.ts +156 -0
- package/app/helpers/styled.d.ts +3 -0
- package/app/index.d.ts +102 -0
- package/app/index.js +560 -0
- package/{src/app → app}/utils/ApplicationState.d.ts +115 -0
- package/{src/app → app}/utils/ApplicationStateLoader.d.ts +40 -0
- package/app/utils/Controller.d.ts +10 -0
- package/app/utils/Debug.d.ts +14 -0
- package/app/utils/EasyLayout.d.ts +89 -0
- package/app/utils/History.d.ts +165 -0
- package/app/utils/Route.d.ts +158 -0
- package/app/utils/RouteHistory.d.ts +26 -0
- package/app/utils/Service.d.ts +45 -0
- package/app/utils/TypeInfoORMAPIUtils.d.ts +94 -0
- package/app/utils/TypeInfoORMClient.d.ts +103 -0
- package/app/utils/UniversalRouteAdapter.d.ts +73 -0
- package/app/utils/easy-layout/computeAreaBounds.d.ts +5 -0
- package/app/utils/easy-layout/computeTracks.d.ts +16 -0
- package/app/utils/easy-layout/index.d.ts +5 -0
- package/app/utils/easy-layout/parseTemplate.d.ts +12 -0
- package/app/utils/easy-layout/types.d.ts +52 -0
- package/app/utils/easy-layout/validateAreas.d.ts +5 -0
- package/app/utils/index.d.ts +39 -0
- package/{src/common/TypeParsing → build}/TypeMapping.d.ts +8 -0
- package/build/TypeParsing.d.ts +10 -0
- package/build/index.d.ts +15 -0
- package/build/index.js +569 -0
- package/chunk-ATO2455Q.js +258 -0
- package/chunk-FQMZMCXU.js +71 -0
- package/chunk-G5CLUK4Y.js +621 -0
- package/chunk-GYWRAW3Y.js +78 -0
- package/chunk-HVY7POTD.js +22 -0
- package/chunk-I2KLQ2HA.js +19 -0
- package/chunk-IWRHGGGH.js +10 -0
- package/chunk-LGM75I6P.js +353 -0
- package/chunk-MUCSL3UR.js +1 -0
- package/chunk-WELZGQDJ.js +456 -0
- package/common/CommandLine/collectRequiredEnvironmentVariables.d.ts +9 -0
- package/common/CommandLine/index.d.ts +6 -0
- package/common/HelperTypes.d.ts +9 -0
- package/common/IdGeneration/getSimpleId.d.ts +8 -0
- package/{src/common → common}/ItemRelationshipInfoTypes.d.ts +19 -1
- package/common/ItemRelationships/ItemRelationshipValidation.d.ts +21 -0
- package/common/ItemRelationships/index.d.ts +6 -0
- package/common/Logging/Utils.d.ts +19 -0
- package/common/Routing.d.ts +67 -0
- package/common/SearchTypes.d.ts +248 -0
- package/common/SearchUtils.d.ts +55 -0
- package/{src/common → common}/SearchValidation.d.ts +10 -0
- package/{src/common → common}/StringTransformers.d.ts +11 -0
- package/common/Testing/CLI.d.ts +6 -0
- package/common/Testing/CLI.js +432 -0
- package/{src/common → common}/Testing/Types.d.ts +103 -4
- package/{src/common → common}/Testing/Utils.d.ts +65 -1
- package/common/Testing/index.d.ts +8 -0
- package/common/TypeInfoDataItemUtils.d.ts +39 -0
- package/common/TypeInfoORM/Types.d.ts +342 -0
- package/common/TypeInfoORM/index.d.ts +11 -0
- package/common/TypeParsing/Constants.d.ts +4 -0
- package/{src/common → common}/TypeParsing/ParsingUtils/Constants.d.ts +3 -0
- package/{src/common → common}/TypeParsing/ParsingUtils/checkType.d.ts +6 -0
- package/{src/common → common}/TypeParsing/ParsingUtils/checkUnionType.d.ts +6 -0
- package/common/TypeParsing/ParsingUtils/extractCommentTags.d.ts +8 -0
- package/common/TypeParsing/ParsingUtils/extractLiteralValues.d.ts +12 -0
- package/common/TypeParsing/ParsingUtils/extractTypeDetails.d.ts +14 -0
- package/common/TypeParsing/ParsingUtils/getPrimaryFieldForTypeInfo.d.ts +18 -0
- package/common/TypeParsing/ParsingUtils/getTypeInfo.d.ts +9 -0
- package/{src/common → common}/TypeParsing/ParsingUtils/getTypeInfoField.d.ts +6 -0
- package/common/TypeParsing/ParsingUtils/getTypeInfoFromAliasType.d.ts +11 -0
- package/common/TypeParsing/ParsingUtils/getTypeInfoFromFieldFilter.d.ts +12 -0
- package/common/TypeParsing/ParsingUtils/getTypeInfoFromTypeAlias.d.ts +11 -0
- package/common/TypeParsing/ParsingUtils/getTypeKeyword.d.ts +9 -0
- package/common/TypeParsing/ParsingUtils/getUnionOrIntersectionTypeInfo.d.ts +11 -0
- package/common/TypeParsing/ParsingUtils/getUnionOrLiteralStringValues.d.ts +8 -0
- package/{src/common → common}/TypeParsing/TypeInfo.d.ts +61 -1
- package/{src/common → common}/TypeParsing/Utils.d.ts +26 -0
- package/{src/common → common}/TypeParsing/Validation.d.ts +105 -0
- package/common/TypeParsing/index.d.ts +8 -0
- package/common/index.d.ts +50 -0
- package/common/index.js +36 -0
- package/{src/iac → iac}/SimpleCFT.d.ts +46 -2
- package/iac/index.d.ts +40 -0
- package/iac/index.js +2 -0
- package/iac/packs/auth/user-management.d.ts +82 -0
- package/iac/packs/auth.d.ts +88 -0
- package/iac/packs/build/utils.d.ts +289 -0
- package/iac/packs/build.d.ts +92 -0
- package/iac/packs/cdn.d.ts +33 -0
- package/iac/packs/cloud-function.d.ts +67 -0
- package/{src/iac → iac}/packs/database.d.ts +4 -1
- package/{src/iac → iac}/packs/dns.d.ts +22 -1
- package/iac/packs/file-storage.d.ts +46 -0
- package/iac/packs/gateway.d.ts +79 -0
- package/iac/packs/index.d.ts +60 -0
- package/iac/packs/index.js +1370 -0
- package/iac/packs/repo.d.ts +28 -0
- package/iac/packs/ssl-certificate.d.ts +28 -0
- package/{src/iac → iac}/types/Constants.d.ts +15 -0
- package/iac/types/Renderers.d.ts +96 -0
- package/iac/types/Types.d.ts +131 -0
- package/iac/types/Utils.d.ts +9 -0
- package/{src/iac → iac}/utils/index.d.ts +56 -5
- package/iac/utils/patch-utils.d.ts +66 -0
- package/iac-packs/index.d.ts +6 -0
- package/native/forms/UI.d.ts +67 -0
- package/native/forms/createNativeFormRenderer.d.ts +21 -0
- package/native/forms/index.d.ts +9 -0
- package/native/forms/primitives/index.d.ts +38 -0
- package/native/forms/suite.d.ts +15 -0
- package/native/index.d.ts +19 -0
- package/native/index.js +717 -0
- package/native/testing/react-native.d.ts +28 -0
- package/native/utils/EasyLayout.d.ts +88 -0
- package/native/utils/History.d.ts +102 -0
- package/native/utils/Route.d.ts +83 -0
- package/native/utils/index.d.ts +9 -0
- package/package.json +76 -44
- package/web/forms/UI.d.ts +68 -0
- package/web/forms/createWebFormRenderer.d.ts +21 -0
- package/web/forms/index.d.ts +9 -0
- package/web/forms/primitives/index.d.ts +21 -0
- package/web/forms/suite.d.ts +15 -0
- package/web/index.d.ts +15 -0
- package/web/index.js +547 -0
- package/web/utils/EasyLayout.d.ts +47 -0
- package/web/utils/Route.d.ts +14 -0
- package/web/utils/index.d.ts +6 -0
- package/src/api/DataAccessControl.d.ts +0 -85
- package/src/api/DataAccessControl.js +0 -159
- package/src/api/ORM/DACUtils.d.ts +0 -60
- package/src/api/ORM/DACUtils.js +0 -197
- package/src/api/ORM/ListItemUtils.d.ts +0 -7
- package/src/api/ORM/ListItemUtils.js +0 -22
- package/src/api/ORM/ORMRouteMap.d.ts +0 -19
- package/src/api/ORM/ORMRouteMap.js +0 -82
- package/src/api/ORM/TypeInfoORMService.d.ts +0 -103
- package/src/api/ORM/TypeInfoORMService.js +0 -581
- package/src/api/ORM/drivers/DynamoDBDataItemDBDriver/ConfigTypes.d.ts +0 -63
- package/src/api/ORM/drivers/DynamoDBDataItemDBDriver/ConfigTypes.js +0 -2
- package/src/api/ORM/drivers/DynamoDBDataItemDBDriver.d.ts +0 -36
- package/src/api/ORM/drivers/DynamoDBDataItemDBDriver.js +0 -282
- package/src/api/ORM/drivers/S3FileItemDBDriver/ConfigTypes.d.ts +0 -90
- package/src/api/ORM/drivers/S3FileItemDBDriver/ConfigTypes.js +0 -2
- package/src/api/ORM/drivers/S3FileItemDBDriver/S3FileDriver.d.ts +0 -45
- package/src/api/ORM/drivers/S3FileItemDBDriver/S3FileDriver.js +0 -127
- package/src/api/ORM/drivers/S3FileItemDBDriver.js +0 -182
- package/src/api/ORM/drivers/common/SupportedTypeInfoORMDBDrivers.d.ts +0 -12
- package/src/api/ORM/drivers/common/SupportedTypeInfoORMDBDrivers.js +0 -20
- package/src/api/ORM/drivers/common/Types.js +0 -14
- package/src/api/ORM/drivers/common/index.d.ts +0 -2
- package/src/api/ORM/drivers/common/index.js +0 -18
- package/src/api/ORM/drivers/index.d.ts +0 -3
- package/src/api/ORM/drivers/index.js +0 -19
- package/src/api/ORM/index.d.ts +0 -4
- package/src/api/ORM/index.js +0 -43
- package/src/api/Router/AWS.d.ts +0 -26
- package/src/api/Router/AWS.js +0 -76
- package/src/api/Router/Auth.d.ts +0 -2
- package/src/api/Router/Auth.js +0 -9
- package/src/api/Router/CORS.d.ts +0 -6
- package/src/api/Router/CORS.js +0 -27
- package/src/api/Router/Types.d.ts +0 -71
- package/src/api/Router/Types.js +0 -2
- package/src/api/Router/index.d.ts +0 -18
- package/src/api/Router/index.js +0 -145
- package/src/api/index.d.ts +0 -3
- package/src/api/index.js +0 -39
- package/src/app/index.d.ts +0 -1
- package/src/app/index.js +0 -37
- package/src/app/utils/ApplicationState.js +0 -86
- package/src/app/utils/ApplicationStateLoader.js +0 -57
- package/src/app/utils/Controller.d.ts +0 -4
- package/src/app/utils/Controller.js +0 -47
- package/src/app/utils/Debug.d.ts +0 -4
- package/src/app/utils/Debug.js +0 -30
- package/src/app/utils/EasyLayout.d.ts +0 -49
- package/src/app/utils/EasyLayout.js +0 -122
- package/src/app/utils/Route.d.ts +0 -28
- package/src/app/utils/Route.js +0 -102
- package/src/app/utils/Service.d.ts +0 -12
- package/src/app/utils/Service.js +0 -34
- package/src/app/utils/TypeInfoORMAPIUtils.d.ts +0 -20
- package/src/app/utils/TypeInfoORMAPIUtils.js +0 -62
- package/src/app/utils/TypeInfoORMClient.d.ts +0 -24
- package/src/app/utils/TypeInfoORMClient.js +0 -69
- package/src/app/utils/index.d.ts +0 -8
- package/src/app/utils/index.js +0 -24
- package/src/common/CommandLine/collectRequiredEnvironmentVariables.d.ts +0 -1
- package/src/common/CommandLine/collectRequiredEnvironmentVariables.js +0 -16
- package/src/common/HelperTypes.d.ts +0 -3
- package/src/common/HelperTypes.js +0 -2
- package/src/common/IdGeneration/getSimpleId.d.ts +0 -4
- package/src/common/IdGeneration/getSimpleId.js +0 -16
- package/src/common/IdGeneration/index.js +0 -17
- package/src/common/ItemRelationshipInfoTypes.js +0 -20
- package/src/common/ItemRelationships/ItemRelationshipValidation.d.ts +0 -10
- package/src/common/ItemRelationships/ItemRelationshipValidation.js +0 -43
- package/src/common/ItemRelationships/index.d.ts +0 -1
- package/src/common/ItemRelationships/index.js +0 -17
- package/src/common/Logging/Utils.d.ts +0 -10
- package/src/common/Logging/Utils.js +0 -33
- package/src/common/Logging/index.js +0 -17
- package/src/common/Routing.d.ts +0 -25
- package/src/common/Routing.js +0 -102
- package/src/common/SearchTypes.d.ts +0 -98
- package/src/common/SearchTypes.js +0 -39
- package/src/common/SearchUtils.d.ts +0 -22
- package/src/common/SearchUtils.js +0 -134
- package/src/common/SearchValidation.js +0 -90
- package/src/common/Storyboarding/Types.d.ts +0 -25
- package/src/common/Storyboarding/Types.js +0 -2
- package/src/common/StringTransformers.js +0 -36
- package/src/common/Testing/CLI.d.ts +0 -2
- package/src/common/Testing/CLI.js +0 -56
- package/src/common/Testing/Types.js +0 -19
- package/src/common/Testing/Utils.js +0 -334
- package/src/common/Testing/index.d.ts +0 -2
- package/src/common/Testing/index.js +0 -18
- package/src/common/TypeInfoDataItemUtils.d.ts +0 -10
- package/src/common/TypeInfoDataItemUtils.js +0 -55
- package/src/common/TypeInfoORM/Types.d.ts +0 -76
- package/src/common/TypeInfoORM/Types.js +0 -55
- package/src/common/TypeInfoORM/index.d.ts +0 -1
- package/src/common/TypeInfoORM/index.js +0 -17
- package/src/common/TypeParsing/Constants.d.ts +0 -1
- package/src/common/TypeParsing/Constants.js +0 -4
- package/src/common/TypeParsing/ParsingUtils/Constants.js +0 -8
- package/src/common/TypeParsing/ParsingUtils/checkType.js +0 -46
- package/src/common/TypeParsing/ParsingUtils/checkUnionType.js +0 -15
- package/src/common/TypeParsing/ParsingUtils/extractCommentTags.d.ts +0 -2
- package/src/common/TypeParsing/ParsingUtils/extractCommentTags.js +0 -105
- package/src/common/TypeParsing/ParsingUtils/extractLiteralValues.d.ts +0 -6
- package/src/common/TypeParsing/ParsingUtils/extractLiteralValues.js +0 -42
- package/src/common/TypeParsing/ParsingUtils/extractTypeDetails.d.ts +0 -8
- package/src/common/TypeParsing/ParsingUtils/extractTypeDetails.js +0 -14
- package/src/common/TypeParsing/ParsingUtils/getPrimaryFieldForTypeInfo.d.ts +0 -5
- package/src/common/TypeParsing/ParsingUtils/getPrimaryFieldForTypeInfo.js +0 -27
- package/src/common/TypeParsing/ParsingUtils/getTypeInfo.d.ts +0 -3
- package/src/common/TypeParsing/ParsingUtils/getTypeInfo.js +0 -27
- package/src/common/TypeParsing/ParsingUtils/getTypeInfoField.js +0 -44
- package/src/common/TypeParsing/ParsingUtils/getTypeInfoFromAliasType.d.ts +0 -4
- package/src/common/TypeParsing/ParsingUtils/getTypeInfoFromAliasType.js +0 -28
- package/src/common/TypeParsing/ParsingUtils/getTypeInfoFromFieldFilter.d.ts +0 -4
- package/src/common/TypeParsing/ParsingUtils/getTypeInfoFromFieldFilter.js +0 -105
- package/src/common/TypeParsing/ParsingUtils/getTypeInfoFromTypeAlias.d.ts +0 -4
- package/src/common/TypeParsing/ParsingUtils/getTypeInfoFromTypeAlias.js +0 -20
- package/src/common/TypeParsing/ParsingUtils/getTypeKeyword.d.ts +0 -3
- package/src/common/TypeParsing/ParsingUtils/getTypeKeyword.js +0 -17
- package/src/common/TypeParsing/ParsingUtils/getUnionOrIntersectionTypeInfo.d.ts +0 -4
- package/src/common/TypeParsing/ParsingUtils/getUnionOrIntersectionTypeInfo.js +0 -49
- package/src/common/TypeParsing/ParsingUtils/getUnionOrLiteralStringValues.d.ts +0 -2
- package/src/common/TypeParsing/ParsingUtils/getUnionOrLiteralStringValues.js +0 -24
- package/src/common/TypeParsing/TypeInfo.js +0 -13
- package/src/common/TypeParsing/TypeMapping.js +0 -32
- package/src/common/TypeParsing/TypeParsing.d.ts +0 -5
- package/src/common/TypeParsing/TypeParsing.js +0 -39
- package/src/common/TypeParsing/Utils.js +0 -94
- package/src/common/TypeParsing/Validation.js +0 -340
- package/src/common/TypeParsing/index.d.ts +0 -5
- package/src/common/TypeParsing/index.js +0 -44
- package/src/common/index.d.ts +0 -11
- package/src/common/index.js +0 -47
- package/src/iac/SimpleCFT.js +0 -82
- package/src/iac/index.d.ts +0 -9
- package/src/iac/index.js +0 -48
- package/src/iac/packs/auth/user-management.d.ts +0 -14
- package/src/iac/packs/auth/user-management.js +0 -302
- package/src/iac/packs/auth.d.ts +0 -19
- package/src/iac/packs/auth.js +0 -47
- package/src/iac/packs/build/utils.d.ts +0 -100
- package/src/iac/packs/build/utils.js +0 -23
- package/src/iac/packs/build.d.ts +0 -29
- package/src/iac/packs/build.js +0 -217
- package/src/iac/packs/cdn.d.ts +0 -12
- package/src/iac/packs/cdn.js +0 -126
- package/src/iac/packs/cloud-function.d.ts +0 -17
- package/src/iac/packs/cloud-function.js +0 -69
- package/src/iac/packs/database.js +0 -27
- package/src/iac/packs/dns.js +0 -26
- package/src/iac/packs/file-storage.d.ts +0 -14
- package/src/iac/packs/file-storage.js +0 -71
- package/src/iac/packs/gateway.d.ts +0 -27
- package/src/iac/packs/gateway.js +0 -342
- package/src/iac/packs/index.d.ts +0 -11
- package/src/iac/packs/index.js +0 -27
- package/src/iac/packs/repo.d.ts +0 -10
- package/src/iac/packs/repo.js +0 -34
- package/src/iac/packs/ssl-certificate.d.ts +0 -10
- package/src/iac/packs/ssl-certificate.js +0 -36
- package/src/iac/types/CloudFormationResourceSpecification.d.ts +0 -2
- package/src/iac/types/Constants.js +0 -20
- package/src/iac/types/IaCTypes.js +0 -14
- package/src/iac/types/Renderers.d.ts +0 -12
- package/src/iac/types/Renderers.js +0 -112
- package/src/iac/types/Types.d.ts +0 -37
- package/src/iac/types/Types.js +0 -2
- package/src/iac/types/Utils.d.ts +0 -2
- package/src/iac/types/Utils.js +0 -60
- package/src/iac/types/generate.js +0 -31
- package/src/iac/utils/index.js +0 -105
- package/src/iac/utils/patch-utils.d.ts +0 -15
- package/src/iac/utils/patch-utils.js +0 -62
- package/src/index.d.ts +0 -178
- package/src/index.js +0 -214
- /package/{src/common → common}/IdGeneration/index.d.ts +0 -0
- /package/{src/common → common}/Logging/index.d.ts +0 -0
- /package/{src/iac → iac}/types/IaCTypes.d.ts +0 -0
- /package/{src/iac → iac}/types/generate.d.ts +0 -0
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
import { getPathString, mergeStringPaths, getParamsAndTestPath, resolvePath } from './chunk-GYWRAW3Y.js';
|
|
2
|
+
import { createContext, useContext, useState, useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// src/app/utils/easy-layout/computeTracks.ts
|
|
6
|
+
var computeTrackPixels = ({
|
|
7
|
+
tracks,
|
|
8
|
+
totalPx,
|
|
9
|
+
gapPx = 0,
|
|
10
|
+
paddingPx = 0
|
|
11
|
+
}) => {
|
|
12
|
+
if (!tracks.length) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
const gapsPx = Math.max(0, tracks.length - 1) * Math.max(0, gapPx);
|
|
16
|
+
const usablePx = Math.max(0, totalPx - Math.max(0, paddingPx) * 2 - gapsPx);
|
|
17
|
+
let fixedPx = 0;
|
|
18
|
+
let frTotal = 0;
|
|
19
|
+
for (const track of tracks) {
|
|
20
|
+
if (track.kind === "px") {
|
|
21
|
+
fixedPx += track.value;
|
|
22
|
+
} else if (track.kind === "pct") {
|
|
23
|
+
fixedPx += usablePx * track.value / 100;
|
|
24
|
+
} else {
|
|
25
|
+
frTotal += track.value;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const remainderPx = Math.max(0, usablePx - fixedPx);
|
|
29
|
+
return tracks.map((track) => {
|
|
30
|
+
if (track.kind === "px") {
|
|
31
|
+
return track.value;
|
|
32
|
+
}
|
|
33
|
+
if (track.kind === "pct") {
|
|
34
|
+
return usablePx * track.value / 100;
|
|
35
|
+
}
|
|
36
|
+
if (frTotal <= 0) {
|
|
37
|
+
return 0;
|
|
38
|
+
}
|
|
39
|
+
return remainderPx * track.value / frTotal;
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// src/app/utils/History.ts
|
|
44
|
+
var createHistoryBackHandler = (history) => {
|
|
45
|
+
return {
|
|
46
|
+
/**
|
|
47
|
+
* @returns True when back navigation was handled by history.
|
|
48
|
+
*/
|
|
49
|
+
handle: () => {
|
|
50
|
+
if (history.index > 0) {
|
|
51
|
+
history.back();
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
var ensurePrefix = (value, prefix) => value ? value.startsWith(prefix) ? value : `${prefix}${value}` : "";
|
|
59
|
+
var parseHistoryPath = (inputPath) => {
|
|
60
|
+
const raw = String(inputPath ?? "").trim();
|
|
61
|
+
if (!raw) {
|
|
62
|
+
return { path: "/" };
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
const absoluteUrl = new URL(raw);
|
|
66
|
+
return {
|
|
67
|
+
path: absoluteUrl.pathname || "/",
|
|
68
|
+
...absoluteUrl.search ? { search: absoluteUrl.search } : {},
|
|
69
|
+
...absoluteUrl.hash ? { hash: absoluteUrl.hash } : {}
|
|
70
|
+
};
|
|
71
|
+
} catch (error) {
|
|
72
|
+
let target = raw;
|
|
73
|
+
let hash = "";
|
|
74
|
+
let search = "";
|
|
75
|
+
const hashIndex = target.indexOf("#");
|
|
76
|
+
if (hashIndex >= 0) {
|
|
77
|
+
hash = target.slice(hashIndex);
|
|
78
|
+
target = target.slice(0, hashIndex);
|
|
79
|
+
}
|
|
80
|
+
const searchIndex = target.indexOf("?");
|
|
81
|
+
if (searchIndex >= 0) {
|
|
82
|
+
search = target.slice(searchIndex);
|
|
83
|
+
target = target.slice(0, searchIndex);
|
|
84
|
+
}
|
|
85
|
+
const path = target ? target.startsWith("/") ? target : `/${target}` : "/";
|
|
86
|
+
return {
|
|
87
|
+
path,
|
|
88
|
+
...search && search !== "?" ? { search } : {},
|
|
89
|
+
...hash && hash !== "#" ? { hash } : {}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
var buildHistoryPath = ({
|
|
94
|
+
path,
|
|
95
|
+
search,
|
|
96
|
+
hash
|
|
97
|
+
}) => {
|
|
98
|
+
const normalizedPath = path ? path.startsWith("/") ? path : `/${path}` : "/";
|
|
99
|
+
const normalizedSearch = search ? ensurePrefix(search, "?") : "";
|
|
100
|
+
const normalizedHash = hash ? ensurePrefix(hash, "#") : "";
|
|
101
|
+
return `${normalizedPath}${normalizedSearch}${normalizedHash}`;
|
|
102
|
+
};
|
|
103
|
+
var getHistoryLocation = (inputPath, state, getNextKey, currentLocation, replaceSearch = false) => {
|
|
104
|
+
const parsed = parseHistoryPath(inputPath);
|
|
105
|
+
const nextSearch = typeof parsed.search === "undefined" ? replaceSearch ? void 0 : currentLocation?.search : parsed.search;
|
|
106
|
+
return {
|
|
107
|
+
path: parsed.path,
|
|
108
|
+
...typeof nextSearch !== "undefined" ? { search: nextSearch } : {},
|
|
109
|
+
...parsed.hash ? { hash: parsed.hash } : {},
|
|
110
|
+
...typeof state !== "undefined" ? { state } : {},
|
|
111
|
+
key: getNextKey()
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
var createMemoryHistory = (initialPath = "/") => {
|
|
115
|
+
let keyCounter = 0;
|
|
116
|
+
const getNextKey = () => `h${keyCounter++}`;
|
|
117
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
118
|
+
const entries = [
|
|
119
|
+
{
|
|
120
|
+
location: getHistoryLocation(
|
|
121
|
+
initialPath,
|
|
122
|
+
void 0,
|
|
123
|
+
getNextKey,
|
|
124
|
+
void 0,
|
|
125
|
+
true
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
];
|
|
129
|
+
let currentIndex = 0;
|
|
130
|
+
const getCurrentLocation = () => entries[currentIndex].location;
|
|
131
|
+
const notify = () => {
|
|
132
|
+
const location = getCurrentLocation();
|
|
133
|
+
listeners.forEach((listener) => listener(location));
|
|
134
|
+
};
|
|
135
|
+
const push = (path, opts) => {
|
|
136
|
+
const location = getHistoryLocation(
|
|
137
|
+
path,
|
|
138
|
+
opts?.state,
|
|
139
|
+
getNextKey,
|
|
140
|
+
getCurrentLocation(),
|
|
141
|
+
opts?.replaceSearch === true
|
|
142
|
+
);
|
|
143
|
+
if (currentIndex < entries.length - 1) {
|
|
144
|
+
entries.splice(currentIndex + 1);
|
|
145
|
+
}
|
|
146
|
+
entries.push({ location });
|
|
147
|
+
currentIndex = entries.length - 1;
|
|
148
|
+
notify();
|
|
149
|
+
};
|
|
150
|
+
const replace = (path, opts) => {
|
|
151
|
+
const location = getHistoryLocation(
|
|
152
|
+
path,
|
|
153
|
+
opts?.state,
|
|
154
|
+
getNextKey,
|
|
155
|
+
getCurrentLocation(),
|
|
156
|
+
opts?.replaceSearch === true
|
|
157
|
+
);
|
|
158
|
+
entries[currentIndex] = { location };
|
|
159
|
+
notify();
|
|
160
|
+
};
|
|
161
|
+
const go = (delta) => {
|
|
162
|
+
if (!Number.isFinite(delta)) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
const targetIndex = Math.max(
|
|
166
|
+
0,
|
|
167
|
+
Math.min(entries.length - 1, currentIndex + Math.trunc(delta))
|
|
168
|
+
);
|
|
169
|
+
if (targetIndex === currentIndex) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
currentIndex = targetIndex;
|
|
173
|
+
notify();
|
|
174
|
+
};
|
|
175
|
+
return {
|
|
176
|
+
get location() {
|
|
177
|
+
return getCurrentLocation();
|
|
178
|
+
},
|
|
179
|
+
get length() {
|
|
180
|
+
return entries.length;
|
|
181
|
+
},
|
|
182
|
+
get index() {
|
|
183
|
+
return currentIndex;
|
|
184
|
+
},
|
|
185
|
+
push,
|
|
186
|
+
replace,
|
|
187
|
+
go,
|
|
188
|
+
back: () => go(-1),
|
|
189
|
+
forward: () => go(1),
|
|
190
|
+
listen: (listener) => {
|
|
191
|
+
listeners.add(listener);
|
|
192
|
+
return () => listeners.delete(listener);
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
// src/app/utils/RouteHistory.ts
|
|
198
|
+
var createRouteAdapterFromHistory = (history) => {
|
|
199
|
+
return {
|
|
200
|
+
getPath: () => history.location.path,
|
|
201
|
+
subscribe: (listener) => {
|
|
202
|
+
return history.listen((location) => {
|
|
203
|
+
listener(location.path);
|
|
204
|
+
});
|
|
205
|
+
},
|
|
206
|
+
push: (path) => {
|
|
207
|
+
history.push(path, { replaceSearch: true });
|
|
208
|
+
},
|
|
209
|
+
replace: (path) => {
|
|
210
|
+
history.replace(path, { replaceSearch: true });
|
|
211
|
+
},
|
|
212
|
+
back: history.back,
|
|
213
|
+
canGoBack: () => history.index > 0
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
// src/app/utils/UniversalRouteAdapter.ts
|
|
218
|
+
var getWindow = () => {
|
|
219
|
+
if (typeof globalThis === "undefined") {
|
|
220
|
+
return void 0;
|
|
221
|
+
}
|
|
222
|
+
if ("window" in globalThis) {
|
|
223
|
+
return globalThis.window;
|
|
224
|
+
}
|
|
225
|
+
return void 0;
|
|
226
|
+
};
|
|
227
|
+
var canUseBrowserHistory = () => {
|
|
228
|
+
const WINDOW = getWindow();
|
|
229
|
+
return Boolean(
|
|
230
|
+
WINDOW && WINDOW.location && WINDOW.history && typeof WINDOW.history.pushState === "function"
|
|
231
|
+
);
|
|
232
|
+
};
|
|
233
|
+
var createBrowserRouteAdapter = () => {
|
|
234
|
+
const WINDOW = getWindow();
|
|
235
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
236
|
+
const notify = () => {
|
|
237
|
+
const path = WINDOW?.location?.pathname ?? "";
|
|
238
|
+
listeners.forEach((listener) => listener(path));
|
|
239
|
+
};
|
|
240
|
+
const handleHistoryEvent = () => {
|
|
241
|
+
notify();
|
|
242
|
+
};
|
|
243
|
+
return {
|
|
244
|
+
getPath: () => WINDOW?.location?.pathname ?? "",
|
|
245
|
+
subscribe: (listener) => {
|
|
246
|
+
listeners.add(listener);
|
|
247
|
+
if (WINDOW) {
|
|
248
|
+
WINDOW.addEventListener("popstate", handleHistoryEvent);
|
|
249
|
+
WINDOW.addEventListener("statechanged", handleHistoryEvent);
|
|
250
|
+
}
|
|
251
|
+
return () => {
|
|
252
|
+
listeners.delete(listener);
|
|
253
|
+
if (WINDOW) {
|
|
254
|
+
WINDOW.removeEventListener("popstate", handleHistoryEvent);
|
|
255
|
+
WINDOW.removeEventListener("statechanged", handleHistoryEvent);
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
},
|
|
259
|
+
push: (path, title = "") => {
|
|
260
|
+
if (!WINDOW?.history) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
const targetPath = parseHistoryPath(path).path;
|
|
264
|
+
if (targetPath === (WINDOW.location?.pathname ?? "")) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
WINDOW.history.pushState({}, title, path);
|
|
268
|
+
notify();
|
|
269
|
+
},
|
|
270
|
+
replace: (path, title = "") => {
|
|
271
|
+
if (!WINDOW?.history?.replaceState) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
const targetPath = parseHistoryPath(path).path;
|
|
275
|
+
if (targetPath === (WINDOW.location?.pathname ?? "")) {
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
WINDOW.history.replaceState({}, title, path);
|
|
279
|
+
notify();
|
|
280
|
+
},
|
|
281
|
+
back: () => WINDOW?.history?.back(),
|
|
282
|
+
canGoBack: () => (WINDOW?.history?.length ?? 0) > 1
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
var createNativeRouteAdapter = (initialPath = "/", ingress) => {
|
|
286
|
+
const mapURLToPath = ingress?.mapURLToPath ?? ((url) => buildHistoryPath(parseHistoryPath(url)));
|
|
287
|
+
const onIncomingURL = ingress?.onIncomingURL ?? "replace";
|
|
288
|
+
const history = createMemoryHistory(initialPath);
|
|
289
|
+
const adapter = createRouteAdapterFromHistory(history);
|
|
290
|
+
let stopIngress;
|
|
291
|
+
let ingressStarted = false;
|
|
292
|
+
let subscribers = 0;
|
|
293
|
+
const applyPath = (path, mode) => {
|
|
294
|
+
const normalizedPath = parseHistoryPath(path).path;
|
|
295
|
+
if (!normalizedPath || normalizedPath === history.location.path) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
if (mode === "push") {
|
|
299
|
+
history.push(normalizedPath, { replaceSearch: true });
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
history.replace(normalizedPath, { replaceSearch: true });
|
|
303
|
+
};
|
|
304
|
+
const startIngress = async () => {
|
|
305
|
+
if (ingressStarted || !ingress) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
ingressStarted = true;
|
|
309
|
+
const startKey = history.location.key;
|
|
310
|
+
const startIndex = history.index;
|
|
311
|
+
if (ingress.subscribe) {
|
|
312
|
+
stopIngress = ingress.subscribe((url) => {
|
|
313
|
+
const nextPath = mapURLToPath(url);
|
|
314
|
+
if (!nextPath) {
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
applyPath(nextPath, onIncomingURL);
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
const initialURL = await ingress.getInitialURL?.();
|
|
321
|
+
const userNavigated = history.location.key !== startKey || history.index !== startIndex;
|
|
322
|
+
if (!userNavigated && initialURL) {
|
|
323
|
+
const nextPath = mapURLToPath(initialURL);
|
|
324
|
+
if (nextPath) {
|
|
325
|
+
applyPath(nextPath, "replace");
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
return {
|
|
330
|
+
...adapter,
|
|
331
|
+
push: (path, title) => {
|
|
332
|
+
if (parseHistoryPath(path).path === history.location.path) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
adapter.push?.(path, title);
|
|
336
|
+
},
|
|
337
|
+
replace: (path, title) => {
|
|
338
|
+
if (parseHistoryPath(path).path === history.location.path) {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
adapter.replace?.(path, title);
|
|
342
|
+
},
|
|
343
|
+
subscribe: (listener) => {
|
|
344
|
+
subscribers += 1;
|
|
345
|
+
if (subscribers === 1) {
|
|
346
|
+
void startIngress();
|
|
347
|
+
}
|
|
348
|
+
const unlisten = adapter.subscribe(listener);
|
|
349
|
+
return () => {
|
|
350
|
+
unlisten();
|
|
351
|
+
subscribers = Math.max(0, subscribers - 1);
|
|
352
|
+
if (subscribers === 0) {
|
|
353
|
+
stopIngress?.();
|
|
354
|
+
stopIngress = void 0;
|
|
355
|
+
ingressStarted = false;
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
},
|
|
359
|
+
back: adapter.back,
|
|
360
|
+
canGoBack: adapter.canGoBack
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
var createUniversalAdapter = (options = {}) => {
|
|
364
|
+
const { strategy = "auto", initialPath = "/", ingress } = options;
|
|
365
|
+
if (strategy === "web") {
|
|
366
|
+
return createBrowserRouteAdapter();
|
|
367
|
+
}
|
|
368
|
+
if (strategy === "native") {
|
|
369
|
+
return createNativeRouteAdapter(initialPath, ingress);
|
|
370
|
+
}
|
|
371
|
+
return canUseBrowserHistory() ? createBrowserRouteAdapter() : createNativeRouteAdapter(initialPath, ingress);
|
|
372
|
+
};
|
|
373
|
+
var createManualRouteAdapter = (initialPath = "/") => {
|
|
374
|
+
let currentPath = initialPath;
|
|
375
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
376
|
+
const updatePath = (nextPath) => {
|
|
377
|
+
currentPath = nextPath;
|
|
378
|
+
listeners.forEach((listener) => listener(nextPath));
|
|
379
|
+
};
|
|
380
|
+
const adapter = {
|
|
381
|
+
getPath: () => currentPath,
|
|
382
|
+
subscribe: (listener) => {
|
|
383
|
+
listeners.add(listener);
|
|
384
|
+
return () => {
|
|
385
|
+
listeners.delete(listener);
|
|
386
|
+
};
|
|
387
|
+
},
|
|
388
|
+
push: (path) => updatePath(path),
|
|
389
|
+
replace: (path) => updatePath(path)
|
|
390
|
+
};
|
|
391
|
+
return {
|
|
392
|
+
adapter,
|
|
393
|
+
updatePath
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
var isDevelopmentMode = () => {
|
|
397
|
+
const env = globalThis?.process?.env?.NODE_ENV;
|
|
398
|
+
return env !== "production";
|
|
399
|
+
};
|
|
400
|
+
var buildQueryString = (query = {}) => {
|
|
401
|
+
const parts = [];
|
|
402
|
+
for (const [key, rawValue] of Object.entries(query)) {
|
|
403
|
+
if (rawValue === void 0) {
|
|
404
|
+
continue;
|
|
405
|
+
}
|
|
406
|
+
const values = Array.isArray(rawValue) ? rawValue : [rawValue];
|
|
407
|
+
for (const value of values) {
|
|
408
|
+
if (value === void 0) {
|
|
409
|
+
continue;
|
|
410
|
+
}
|
|
411
|
+
const encodedKey = encodeURIComponent(key);
|
|
412
|
+
const encodedValue = value === null ? "" : encodeURIComponent(String(value));
|
|
413
|
+
parts.push(`${encodedKey}=${encodedValue}`);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
return parts.join("&");
|
|
417
|
+
};
|
|
418
|
+
var buildRoutePath = (segments, query) => {
|
|
419
|
+
const normalizedSegments = segments.map((segment) => String(segment));
|
|
420
|
+
const basePath = "/" + getPathString(normalizedSegments, "/", true, false, true);
|
|
421
|
+
const queryString = query ? buildQueryString(query) : "";
|
|
422
|
+
return queryString ? `${basePath}?${queryString}` : basePath;
|
|
423
|
+
};
|
|
424
|
+
var RouteContext = createContext({
|
|
425
|
+
currentWindowPath: "",
|
|
426
|
+
parentPath: "",
|
|
427
|
+
params: {},
|
|
428
|
+
isTopLevel: true
|
|
429
|
+
});
|
|
430
|
+
var {
|
|
431
|
+
/**
|
|
432
|
+
* @ignore
|
|
433
|
+
*/
|
|
434
|
+
Provider: RouteContextProvider,
|
|
435
|
+
/**
|
|
436
|
+
* @ignore
|
|
437
|
+
*/
|
|
438
|
+
Consumer: RouteContextConsumer
|
|
439
|
+
} = RouteContext;
|
|
440
|
+
var useRouteContext = () => useContext(RouteContext);
|
|
441
|
+
var getWindow2 = () => {
|
|
442
|
+
if (typeof globalThis === "undefined") {
|
|
443
|
+
return void 0;
|
|
444
|
+
}
|
|
445
|
+
if ("window" in globalThis) {
|
|
446
|
+
return globalThis.window;
|
|
447
|
+
}
|
|
448
|
+
return void 0;
|
|
449
|
+
};
|
|
450
|
+
var useBrowserLinkInterceptor = (adapter) => {
|
|
451
|
+
useEffect(() => {
|
|
452
|
+
const WINDOW = getWindow2();
|
|
453
|
+
if (!WINDOW || !adapter?.push) {
|
|
454
|
+
return void 0;
|
|
455
|
+
}
|
|
456
|
+
const handleAnchorClick = (event) => {
|
|
457
|
+
let target = event.target;
|
|
458
|
+
while (target && target.nodeName !== "A") {
|
|
459
|
+
target = target.parentNode;
|
|
460
|
+
}
|
|
461
|
+
if (!target || target.nodeName !== "A") {
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
const anchor = target;
|
|
465
|
+
const href = anchor.getAttribute("href");
|
|
466
|
+
const title = anchor.getAttribute("title") ?? "";
|
|
467
|
+
if (!href) {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
try {
|
|
471
|
+
new URL(href);
|
|
472
|
+
return;
|
|
473
|
+
} catch (error) {
|
|
474
|
+
const nextPath = resolvePath(WINDOW.location?.pathname ?? "", href);
|
|
475
|
+
event.preventDefault();
|
|
476
|
+
adapter.push?.(nextPath, title);
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
WINDOW.document?.addEventListener("click", handleAnchorClick);
|
|
480
|
+
return () => {
|
|
481
|
+
WINDOW.document?.removeEventListener("click", handleAnchorClick);
|
|
482
|
+
};
|
|
483
|
+
}, [adapter]);
|
|
484
|
+
};
|
|
485
|
+
var RouteProvider = ({
|
|
486
|
+
adapter,
|
|
487
|
+
initialPath,
|
|
488
|
+
children
|
|
489
|
+
}) => {
|
|
490
|
+
const [currentPath, setCurrentPath] = useState(
|
|
491
|
+
initialPath ?? adapter.getPath()
|
|
492
|
+
);
|
|
493
|
+
useEffect(() => {
|
|
494
|
+
return adapter.subscribe((nextPath) => {
|
|
495
|
+
setCurrentPath(nextPath);
|
|
496
|
+
});
|
|
497
|
+
}, [adapter]);
|
|
498
|
+
const contextValue = useMemo(
|
|
499
|
+
() => ({
|
|
500
|
+
currentWindowPath: currentPath,
|
|
501
|
+
parentPath: "",
|
|
502
|
+
params: {},
|
|
503
|
+
isTopLevel: true,
|
|
504
|
+
adapter
|
|
505
|
+
}),
|
|
506
|
+
[currentPath, adapter]
|
|
507
|
+
);
|
|
508
|
+
return /* @__PURE__ */ jsx(RouteContextProvider, { value: contextValue, children });
|
|
509
|
+
};
|
|
510
|
+
var RouteMatcher = ({
|
|
511
|
+
/**
|
|
512
|
+
* Use `:` as the first character to denote a parameter in the path.
|
|
513
|
+
*/
|
|
514
|
+
path,
|
|
515
|
+
onParamsChange,
|
|
516
|
+
exact = false,
|
|
517
|
+
children
|
|
518
|
+
}) => {
|
|
519
|
+
const {
|
|
520
|
+
currentWindowPath = "",
|
|
521
|
+
parentPath = "",
|
|
522
|
+
params: parentParams = {},
|
|
523
|
+
adapter
|
|
524
|
+
} = useRouteContext();
|
|
525
|
+
const targetCurrentPath = useMemo(
|
|
526
|
+
() => currentWindowPath,
|
|
527
|
+
[currentWindowPath]
|
|
528
|
+
);
|
|
529
|
+
const fullPath = useMemo(
|
|
530
|
+
() => mergeStringPaths(parentPath, path),
|
|
531
|
+
[parentPath, path]
|
|
532
|
+
);
|
|
533
|
+
const newParams = useMemo(
|
|
534
|
+
() => getParamsAndTestPath(targetCurrentPath, fullPath, exact),
|
|
535
|
+
[targetCurrentPath, fullPath, exact]
|
|
536
|
+
);
|
|
537
|
+
const params = useMemo(
|
|
538
|
+
() => ({
|
|
539
|
+
...parentParams,
|
|
540
|
+
...newParams ? newParams : {}
|
|
541
|
+
}),
|
|
542
|
+
[parentParams, newParams]
|
|
543
|
+
);
|
|
544
|
+
const newRouteContext = useMemo(
|
|
545
|
+
() => ({
|
|
546
|
+
currentWindowPath: targetCurrentPath,
|
|
547
|
+
parentPath: fullPath,
|
|
548
|
+
params,
|
|
549
|
+
isTopLevel: false,
|
|
550
|
+
adapter
|
|
551
|
+
}),
|
|
552
|
+
[targetCurrentPath, fullPath, params, adapter]
|
|
553
|
+
);
|
|
554
|
+
useEffect(() => {
|
|
555
|
+
if (onParamsChange) {
|
|
556
|
+
onParamsChange(params);
|
|
557
|
+
}
|
|
558
|
+
}, [params, onParamsChange]);
|
|
559
|
+
return newParams ? /* @__PURE__ */ jsx(RouteContextProvider, { value: newRouteContext, children }) : null;
|
|
560
|
+
};
|
|
561
|
+
var RouteRootProvider = ({
|
|
562
|
+
children,
|
|
563
|
+
adapter,
|
|
564
|
+
initialPath,
|
|
565
|
+
ingress,
|
|
566
|
+
runtimeIntegration
|
|
567
|
+
}) => {
|
|
568
|
+
const routeContext = useRouteContext();
|
|
569
|
+
const autoAdapterRef = useRef(null);
|
|
570
|
+
if (typeof routeContext.adapter !== "undefined" && isDevelopmentMode()) {
|
|
571
|
+
throw new Error(
|
|
572
|
+
"Route provider mode is root-only. Nested Route requires a path."
|
|
573
|
+
);
|
|
574
|
+
}
|
|
575
|
+
if (!autoAdapterRef.current) {
|
|
576
|
+
autoAdapterRef.current = adapter ?? createUniversalAdapter({ initialPath, ingress });
|
|
577
|
+
}
|
|
578
|
+
useBrowserLinkInterceptor(autoAdapterRef.current);
|
|
579
|
+
useEffect(() => {
|
|
580
|
+
if (!runtimeIntegration || !autoAdapterRef.current) {
|
|
581
|
+
return void 0;
|
|
582
|
+
}
|
|
583
|
+
return runtimeIntegration.setup(autoAdapterRef.current);
|
|
584
|
+
}, [runtimeIntegration]);
|
|
585
|
+
return /* @__PURE__ */ jsx(RouteProvider, { adapter: autoAdapterRef.current, initialPath, children });
|
|
586
|
+
};
|
|
587
|
+
var Route = (props) => {
|
|
588
|
+
const hasMatcherProps = typeof props.path !== "undefined" || typeof props.exact !== "undefined" || typeof props.onParamsChange !== "undefined";
|
|
589
|
+
const hasProviderProps = typeof props.initialPath !== "undefined" || typeof props.adapter !== "undefined" || typeof props.ingress !== "undefined" || typeof props.runtimeIntegration !== "undefined";
|
|
590
|
+
if (hasMatcherProps) {
|
|
591
|
+
if (hasProviderProps && isDevelopmentMode()) {
|
|
592
|
+
throw new Error(
|
|
593
|
+
"Route matcher mode does not support provider props. Remove initialPath/adapter/ingress/runtimeIntegration or use a root Route without path."
|
|
594
|
+
);
|
|
595
|
+
}
|
|
596
|
+
return /* @__PURE__ */ jsx(
|
|
597
|
+
RouteMatcher,
|
|
598
|
+
{
|
|
599
|
+
path: props.path ?? "",
|
|
600
|
+
onParamsChange: props.onParamsChange,
|
|
601
|
+
exact: props.exact,
|
|
602
|
+
children: props.children
|
|
603
|
+
}
|
|
604
|
+
);
|
|
605
|
+
}
|
|
606
|
+
if (typeof props.path === "undefined") {
|
|
607
|
+
return /* @__PURE__ */ jsx(
|
|
608
|
+
RouteRootProvider,
|
|
609
|
+
{
|
|
610
|
+
adapter: props.adapter,
|
|
611
|
+
initialPath: props.initialPath,
|
|
612
|
+
ingress: props.ingress,
|
|
613
|
+
runtimeIntegration: props.runtimeIntegration,
|
|
614
|
+
children: props.children
|
|
615
|
+
}
|
|
616
|
+
);
|
|
617
|
+
}
|
|
618
|
+
return null;
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
export { Route, RouteContext, RouteContextConsumer, RouteContextProvider, RouteProvider, buildHistoryPath, buildQueryString, buildRoutePath, canUseBrowserHistory, computeTrackPixels, createBrowserRouteAdapter, createHistoryBackHandler, createManualRouteAdapter, createMemoryHistory, createNativeRouteAdapter, createRouteAdapterFromHistory, createUniversalAdapter, parseHistoryPath, useRouteContext };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// src/common/Routing.ts
|
|
2
|
+
var PATH_DELIMITER = "/";
|
|
3
|
+
var getPotentialJSONValue = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
return JSON.parse(value);
|
|
6
|
+
} catch (error) {
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var getPathArray = (path, delimiter = PATH_DELIMITER, filterEmptyOutput = false, filterEmptyInput = true, useJson = true, uriDecodeParts = true) => path.split(delimiter).filter(filterEmptyInput ? (p) => p !== "" : () => true).map(uriDecodeParts ? decodeURIComponent : (x) => x).map(useJson ? getPotentialJSONValue : (p) => p).filter(filterEmptyOutput ? (p) => p ?? false : () => true);
|
|
11
|
+
var getPathString = (parts = [], delimiter = PATH_DELIMITER, filterEmptyInput = false, useJson = true, uriEncodeParts = false) => parts.filter(filterEmptyInput ? (p) => p ?? false : () => true).map(useJson ? (p) => JSON.stringify(p) : (x) => x).map(uriEncodeParts ? encodeURIComponent : (x) => x).join(delimiter);
|
|
12
|
+
var mergeStringPaths = (path1, path2, delimiter = PATH_DELIMITER, filterEmptyOutput = false, filterEmptyInput = true, useJson = true, uriEncodeParts = false) => getPathString(
|
|
13
|
+
[
|
|
14
|
+
...getPathArray(
|
|
15
|
+
path1,
|
|
16
|
+
delimiter,
|
|
17
|
+
filterEmptyOutput,
|
|
18
|
+
filterEmptyInput,
|
|
19
|
+
useJson,
|
|
20
|
+
uriEncodeParts
|
|
21
|
+
),
|
|
22
|
+
...getPathArray(
|
|
23
|
+
path2,
|
|
24
|
+
delimiter,
|
|
25
|
+
filterEmptyOutput,
|
|
26
|
+
filterEmptyInput,
|
|
27
|
+
useJson,
|
|
28
|
+
uriEncodeParts
|
|
29
|
+
)
|
|
30
|
+
],
|
|
31
|
+
delimiter,
|
|
32
|
+
filterEmptyInput,
|
|
33
|
+
useJson,
|
|
34
|
+
uriEncodeParts
|
|
35
|
+
);
|
|
36
|
+
var resolvePath = (currentPath, newPath) => {
|
|
37
|
+
const newSegments = getPathArray(newPath, PATH_DELIMITER, true);
|
|
38
|
+
let currentSegments = getPathArray(currentPath, PATH_DELIMITER, true);
|
|
39
|
+
if (newPath.startsWith("/")) {
|
|
40
|
+
currentSegments = [];
|
|
41
|
+
}
|
|
42
|
+
newSegments.forEach((segment) => {
|
|
43
|
+
if (segment === "..") {
|
|
44
|
+
if (currentSegments.length > 0) {
|
|
45
|
+
currentSegments.pop();
|
|
46
|
+
}
|
|
47
|
+
} else if (segment !== ".") {
|
|
48
|
+
currentSegments.push(segment);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return "/" + currentSegments.join("/");
|
|
52
|
+
};
|
|
53
|
+
var getParamsAndTestPath = (path, testPath, exact = false) => {
|
|
54
|
+
const pathList = getPathArray(path);
|
|
55
|
+
const testPathList = getPathArray(testPath);
|
|
56
|
+
if (exact && pathList.length !== testPathList.length) {
|
|
57
|
+
return false;
|
|
58
|
+
} else {
|
|
59
|
+
let params = {};
|
|
60
|
+
if (pathList.length >= testPathList.length) {
|
|
61
|
+
for (let i = 0; i < testPathList.length; i++) {
|
|
62
|
+
const testPathPart = testPathList[i];
|
|
63
|
+
const pathPart = pathList[i];
|
|
64
|
+
if (testPathPart.startsWith(":")) {
|
|
65
|
+
const paramName = testPathPart.slice(1);
|
|
66
|
+
params[paramName] = pathPart;
|
|
67
|
+
} else if (pathPart !== testPathPart) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
return params;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export { PATH_DELIMITER, getParamsAndTestPath, getPathArray, getPathString, getPotentialJSONValue, mergeStringPaths, resolvePath };
|