@flamingo-stack/openframe-frontend-core 0.0.203 → 0.0.204-snapshot.20260523020255
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/chunk-27APPAJN.cjs +24 -0
- package/dist/chunk-27APPAJN.cjs.map +1 -0
- package/dist/{chunk-XGL5FKIK.js → chunk-D6BNDYZK.js} +114 -4
- package/dist/chunk-D6BNDYZK.js.map +1 -0
- package/dist/chunk-MJNXIEV2.js +24 -0
- package/dist/chunk-MJNXIEV2.js.map +1 -0
- package/dist/{chunk-25LVV26X.cjs → chunk-NLXY4QZE.cjs} +114 -4
- package/dist/chunk-NLXY4QZE.cjs.map +1 -0
- package/dist/{chunk-E6Q6UGDK.js → chunk-OFCRX24Y.js} +383 -569
- package/dist/chunk-OFCRX24Y.js.map +1 -0
- package/dist/{chunk-3YH2M76N.cjs → chunk-RDXOQWBY.cjs} +556 -742
- package/dist/chunk-RDXOQWBY.cjs.map +1 -0
- package/dist/components/announcement-bar.d.ts.map +1 -1
- package/dist/components/features/index.cjs +4 -3
- package/dist/components/features/index.cjs.map +1 -1
- package/dist/components/features/index.js +3 -2
- package/dist/components/index.cjs +4 -3
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +3 -2
- package/dist/components/navigation/index.cjs +4 -3
- package/dist/components/navigation/index.cjs.map +1 -1
- package/dist/components/navigation/index.js +3 -2
- package/dist/components/navigation/navigation-sidebar.d.ts.map +1 -1
- package/dist/components/shared/product-release/product-release-card-skeleton.d.ts +1 -1
- package/dist/components/shared/product-release/product-release-card-skeleton.d.ts.map +1 -1
- package/dist/components/shared/product-release/product-release-card.d.ts +19 -12
- package/dist/components/shared/product-release/product-release-card.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +4 -3
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.js +3 -2
- package/dist/contexts/endpoints-runtime-context.d.ts +28 -0
- package/dist/contexts/endpoints-runtime-context.d.ts.map +1 -0
- package/dist/contexts/index.cjs +13 -0
- package/dist/contexts/index.cjs.map +1 -0
- package/dist/contexts/index.d.ts +24 -0
- package/dist/contexts/index.d.ts.map +1 -0
- package/dist/contexts/index.js +13 -0
- package/dist/contexts/index.js.map +1 -0
- package/dist/hooks/index.cjs +5 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +4 -1
- package/dist/hooks/use-access-code-integration.d.ts +48 -0
- package/dist/hooks/use-access-code-integration.d.ts.map +1 -0
- package/dist/hooks/use-contact-submission.d.ts.map +1 -1
- package/dist/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -6
- package/dist/utils/access-code-client.d.ts +21 -37
- package/dist/utils/access-code-client.d.ts.map +1 -1
- package/dist/utils/index.cjs +10 -51
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js +11 -47
- package/dist/utils/index.js.map +1 -1
- package/package.json +7 -1
- package/src/components/announcement-bar.tsx +25 -3
- package/src/components/navigation/navigation-sidebar.tsx +3 -1
- package/src/components/shared/product-release/product-release-card-skeleton.tsx +66 -70
- package/src/components/shared/product-release/product-release-card.tsx +194 -242
- package/src/contexts/endpoints-runtime-context.tsx +68 -0
- package/src/contexts/index.ts +29 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/use-access-code-integration.ts +107 -0
- package/src/hooks/use-contact-submission.ts +6 -2
- package/src/utils/access-code-client.ts +32 -75
- package/dist/chunk-25LVV26X.cjs.map +0 -1
- package/dist/chunk-3YH2M76N.cjs.map +0 -1
- package/dist/chunk-E6Q6UGDK.js.map +0 -1
- package/dist/chunk-XGL5FKIK.js.map +0 -1
package/dist/utils/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
-
import
|
|
4
|
+
import 'react';
|
|
5
5
|
import { Globe, Twitter, Video, Send, MessageCircle, Github, PenSquare, FileText } from 'lucide-react';
|
|
6
6
|
import { isValidPhoneNumber, parsePhoneNumber, getCountryCallingCode, getCountries } from 'libphonenumber-js';
|
|
7
7
|
|
|
@@ -860,9 +860,11 @@ var OS_PLATFORMS = [
|
|
|
860
860
|
{ id: "darwin", name: "MacOS", icon: MacOSIcon }
|
|
861
861
|
];
|
|
862
862
|
var DEFAULT_OS_PLATFORM = "windows";
|
|
863
|
-
|
|
863
|
+
|
|
864
|
+
// src/utils/access-code-client.ts
|
|
865
|
+
async function validateAccessCode(email, code, endpoints) {
|
|
864
866
|
try {
|
|
865
|
-
const response = await fetch(
|
|
867
|
+
const response = await fetch(endpoints.validateUrl, {
|
|
866
868
|
method: "POST",
|
|
867
869
|
headers: {
|
|
868
870
|
"Content-Type": "application/json"
|
|
@@ -881,9 +883,9 @@ async function validateAccessCode(email, code) {
|
|
|
881
883
|
};
|
|
882
884
|
}
|
|
883
885
|
}
|
|
884
|
-
async function consumeAccessCode(email, code) {
|
|
886
|
+
async function consumeAccessCode(email, code, endpoints) {
|
|
885
887
|
try {
|
|
886
|
-
const response = await fetch(
|
|
888
|
+
const response = await fetch(endpoints.consumeUrl, {
|
|
887
889
|
method: "POST",
|
|
888
890
|
headers: {
|
|
889
891
|
"Content-Type": "application/json"
|
|
@@ -903,56 +905,18 @@ async function consumeAccessCode(email, code) {
|
|
|
903
905
|
};
|
|
904
906
|
}
|
|
905
907
|
}
|
|
906
|
-
async function validateAndConsumeAccessCode(email, code) {
|
|
907
|
-
const validation = await validateAccessCode(email, code);
|
|
908
|
+
async function validateAndConsumeAccessCode(email, code, endpoints) {
|
|
909
|
+
const validation = await validateAccessCode(email, code, endpoints);
|
|
908
910
|
if (!validation.valid) {
|
|
909
911
|
return validation;
|
|
910
912
|
}
|
|
911
|
-
const consumption = await consumeAccessCode(email, code);
|
|
913
|
+
const consumption = await consumeAccessCode(email, code, endpoints);
|
|
912
914
|
return {
|
|
913
915
|
...validation,
|
|
914
916
|
consumed: consumption.consumed,
|
|
915
917
|
message: consumption.consumed ? `Access granted for ${validation.cohort_name}` : consumption.message || validation.message
|
|
916
918
|
};
|
|
917
919
|
}
|
|
918
|
-
function useAccessCodeIntegration() {
|
|
919
|
-
const [isValidating, setIsValidating] = React2.useState(false);
|
|
920
|
-
const [isConsuming, setIsConsuming] = React2.useState(false);
|
|
921
|
-
const validate = async (email, code) => {
|
|
922
|
-
setIsValidating(true);
|
|
923
|
-
try {
|
|
924
|
-
return await validateAccessCode(email, code);
|
|
925
|
-
} finally {
|
|
926
|
-
setIsValidating(false);
|
|
927
|
-
}
|
|
928
|
-
};
|
|
929
|
-
const consume = async (email, code) => {
|
|
930
|
-
setIsConsuming(true);
|
|
931
|
-
try {
|
|
932
|
-
return await consumeAccessCode(email, code);
|
|
933
|
-
} finally {
|
|
934
|
-
setIsConsuming(false);
|
|
935
|
-
}
|
|
936
|
-
};
|
|
937
|
-
const validateAndConsume = async (email, code) => {
|
|
938
|
-
setIsValidating(true);
|
|
939
|
-
setIsConsuming(true);
|
|
940
|
-
try {
|
|
941
|
-
return await validateAndConsumeAccessCode(email, code);
|
|
942
|
-
} finally {
|
|
943
|
-
setIsValidating(false);
|
|
944
|
-
setIsConsuming(false);
|
|
945
|
-
}
|
|
946
|
-
};
|
|
947
|
-
return {
|
|
948
|
-
validate,
|
|
949
|
-
consume,
|
|
950
|
-
validateAndConsume,
|
|
951
|
-
isValidating,
|
|
952
|
-
isConsuming,
|
|
953
|
-
isProcessing: isValidating || isConsuming
|
|
954
|
-
};
|
|
955
|
-
}
|
|
956
920
|
|
|
957
921
|
// src/utils/validation-utils.ts
|
|
958
922
|
function isValidEmailDomain(domain) {
|
|
@@ -1661,6 +1625,6 @@ function isGenericWebsiteDomain(website) {
|
|
|
1661
1625
|
return isGenericDomain(normalizeDomain(website));
|
|
1662
1626
|
}
|
|
1663
1627
|
|
|
1664
|
-
export { DEFAULT_OS_PLATFORM, GENERIC_EMAIL_DOMAINS, OS_PLATFORMS, PLAY_ICON_PATH, cleanEmailDomain, cn, consumeAccessCode, deepClone, delay, extractDomainFromEmail, formatBytes, formatDate, formatNumber, formatPhoneE164, formatPrice, formatRelativeTime, formatReleaseDate, generateRandomString, getAllPlatformBaseDomains, getBaseUrl, getConfidenceBgClass, getConfidenceBorderClass, getConfidenceColorClass, getConfidenceLabel, getConfidenceLevel, getConfidenceTextClass, getCountryByCode, getCountryPhoneData, getCurrentPlatform, getDefaultColorForPlatform, getDefaultIconForPlatform, getDynamicIcon, getOSIcon, getOSLabel, getOSPlatformId, getOSTypeDefinition, getPlatformAccentColor, getPlatformColor, getPlatformDescription, getPlatformDisplayName, getPlatformIcon, getPlatformIconComponent, getPlatformIconComponent as getPlatformLogo, getPlatformProductionUrl, getPlatformSlogan, getShellIcon, getShellLabel, getSlackCommunityJoinUrl, getSmallPlatformIcon, getToolLabel, getToolTypeAliases, hasGenericEmailDomain, isGenericDomain, isGenericWebsiteDomain, isOSPlatform, isValidEmailDomain, isValidToolType, normalizeDomain, normalizeOSType, normalizeToolType, normalizeToolTypeWithFallback, platformColors, platformDescriptions, platformDisplayNames, platformHexColors, platformIconNames, platformIcons, platformSlogans, toToolLabel, transformPlatformConfigsToOptions, truncateString,
|
|
1628
|
+
export { DEFAULT_OS_PLATFORM, GENERIC_EMAIL_DOMAINS, OS_PLATFORMS, PLAY_ICON_PATH, cleanEmailDomain, cn, consumeAccessCode, deepClone, delay, extractDomainFromEmail, formatBytes, formatDate, formatNumber, formatPhoneE164, formatPrice, formatRelativeTime, formatReleaseDate, generateRandomString, getAllPlatformBaseDomains, getBaseUrl, getConfidenceBgClass, getConfidenceBorderClass, getConfidenceColorClass, getConfidenceLabel, getConfidenceLevel, getConfidenceTextClass, getCountryByCode, getCountryPhoneData, getCurrentPlatform, getDefaultColorForPlatform, getDefaultIconForPlatform, getDynamicIcon, getOSIcon, getOSLabel, getOSPlatformId, getOSTypeDefinition, getPlatformAccentColor, getPlatformColor, getPlatformDescription, getPlatformDisplayName, getPlatformIcon, getPlatformIconComponent, getPlatformIconComponent as getPlatformLogo, getPlatformProductionUrl, getPlatformSlogan, getShellIcon, getShellLabel, getSlackCommunityJoinUrl, getSmallPlatformIcon, getToolLabel, getToolTypeAliases, hasGenericEmailDomain, isGenericDomain, isGenericWebsiteDomain, isOSPlatform, isValidEmailDomain, isValidToolType, normalizeDomain, normalizeOSType, normalizeToolType, normalizeToolTypeWithFallback, platformColors, platformDescriptions, platformDisplayNames, platformHexColors, platformIconNames, platformIcons, platformSlogans, toToolLabel, transformPlatformConfigsToOptions, truncateString, validateAccessCode, validateAndConsumeAccessCode, validateEmailDomain, validateEmailDomainList, validatePhoneNumber };
|
|
1665
1629
|
//# sourceMappingURL=index.js.map
|
|
1666
1630
|
//# sourceMappingURL=index.js.map
|