@magmamath/frontend-config 1.0.22-rc.1 → 1.0.22-rc.2

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/index.d.mts CHANGED
@@ -88,6 +88,7 @@ declare enum LoginSource {
88
88
  MY_LOGIN = 9
89
89
  }
90
90
  declare enum SSO {
91
+ APPLE = "APPLE",
91
92
  GOOGLE = "GOOGLE",
92
93
  MICROSOFT = "MICROSOFT",
93
94
  CLEVER = "CLEVER",
@@ -189,14 +190,16 @@ type AuthWebVarsPreset = {
189
190
  };
190
191
  };
191
192
 
192
- type SSOConfig<T extends SSOVariant> = Readonly<{
193
+ type SSOConfigStatic = Readonly<{
193
194
  name: string;
194
195
  icon: ComponentType<IconProps>;
195
196
  type: SSO;
196
197
  loginSource: LoginSource;
197
- getUrl: (envs: AuthWebVars<T>) => string;
198
198
  ownUrl?: boolean;
199
199
  }>;
200
+ type SSOConfig<T extends SSOVariant> = SSOConfigStatic & {
201
+ getUrl: (envs: AuthWebVars<T>) => string;
202
+ };
200
203
 
201
204
  type StudentsWebCommon = {
202
205
  GOOGLE_API_KEY: string;
@@ -457,6 +460,27 @@ type WebAdminLocaleConfig = {
457
460
  apiRegion: ApiRegion;
458
461
  };
459
462
 
463
+ type MobileLocaleConfig = {
464
+ path: string;
465
+ shortCode: string;
466
+ icon: ComponentType<IconProps>;
467
+ sources: {
468
+ signUp: {
469
+ list: SSOConfigStatic[];
470
+ };
471
+ signIn: {
472
+ withOnboarding: boolean;
473
+ largeQRCode: boolean;
474
+ mediumQRCode: boolean;
475
+ list: SSOConfigStatic[];
476
+ };
477
+ };
478
+ isPrimaryRegion: boolean;
479
+ regionGroup: string;
480
+ navigatorLanguages: string[];
481
+ locale: Locale;
482
+ };
483
+
460
484
  type CommonLocaleConfig = Readonly<{
461
485
  name: string;
462
486
  languageName: string;
@@ -481,7 +505,7 @@ type LocalePreset = {
481
505
  [key in Locale]: WebAdminLocaleConfig;
482
506
  };
483
507
  [Platform.MOBILE]: {
484
- [key in Locale]: AuthWebLocaleConfig<SSOByLocale[key]>;
508
+ [key in Locale]: MobileLocaleConfig;
485
509
  };
486
510
  };
487
511
  type LocaleConfig<P extends Platform, L extends Locale> = LocalePreset[P][L];
@@ -524,4 +548,4 @@ declare class AppConfigManager<P extends Platform, L extends Locale> {
524
548
  };
525
549
  }
526
550
 
527
- export { ApiRegion, AppConfigManager, type AuthWebBaseVars, type AuthWebVars, type AuthWebVarsPreset, DateFormat, DateLocale, type DistrictCommon, type DistrictDashboardVars, type DistrictWebVarsPreset, type EnvPreset, Environment, type EnvironmentVars, Locale, LoginSource, MatrixMode, type MobileBaseVars, type MobileCommon, type MobileVars, type MobileVarsPreset, Platform, PlatformBuildTarget, SSO, type SSOByLocale, type SSOConfig, type SSOVariant, type SSO_DE, type SSO_SE, type SSO_UK, type SSO_US, Source, type StudentsWebCommon, type StudentsWebVars, type StudentsWebVarsPreset, type TeachersWebCommon, type TeachersWebVars, type TeachersWebVarsPreset, buildTargetToEnvironment };
551
+ export { ApiRegion, AppConfigManager, type AuthWebBaseVars, type AuthWebVars, type AuthWebVarsPreset, DateFormat, DateLocale, type DistrictCommon, type DistrictDashboardVars, type DistrictWebVarsPreset, type EnvPreset, Environment, type EnvironmentVars, Locale, LoginSource, MatrixMode, type MobileBaseVars, type MobileCommon, type MobileVars, type MobileVarsPreset, Platform, PlatformBuildTarget, SSO, type SSOByLocale, type SSOConfig, type SSOConfigStatic, type SSOVariant, type SSO_DE, type SSO_SE, type SSO_UK, type SSO_US, Source, type StudentsWebCommon, type StudentsWebVars, type StudentsWebVarsPreset, type TeachersWebCommon, type TeachersWebVars, type TeachersWebVarsPreset, buildTargetToEnvironment };
package/dist/index.d.ts CHANGED
@@ -88,6 +88,7 @@ declare enum LoginSource {
88
88
  MY_LOGIN = 9
89
89
  }
90
90
  declare enum SSO {
91
+ APPLE = "APPLE",
91
92
  GOOGLE = "GOOGLE",
92
93
  MICROSOFT = "MICROSOFT",
93
94
  CLEVER = "CLEVER",
@@ -189,14 +190,16 @@ type AuthWebVarsPreset = {
189
190
  };
190
191
  };
191
192
 
192
- type SSOConfig<T extends SSOVariant> = Readonly<{
193
+ type SSOConfigStatic = Readonly<{
193
194
  name: string;
194
195
  icon: ComponentType<IconProps>;
195
196
  type: SSO;
196
197
  loginSource: LoginSource;
197
- getUrl: (envs: AuthWebVars<T>) => string;
198
198
  ownUrl?: boolean;
199
199
  }>;
200
+ type SSOConfig<T extends SSOVariant> = SSOConfigStatic & {
201
+ getUrl: (envs: AuthWebVars<T>) => string;
202
+ };
200
203
 
201
204
  type StudentsWebCommon = {
202
205
  GOOGLE_API_KEY: string;
@@ -457,6 +460,27 @@ type WebAdminLocaleConfig = {
457
460
  apiRegion: ApiRegion;
458
461
  };
459
462
 
463
+ type MobileLocaleConfig = {
464
+ path: string;
465
+ shortCode: string;
466
+ icon: ComponentType<IconProps>;
467
+ sources: {
468
+ signUp: {
469
+ list: SSOConfigStatic[];
470
+ };
471
+ signIn: {
472
+ withOnboarding: boolean;
473
+ largeQRCode: boolean;
474
+ mediumQRCode: boolean;
475
+ list: SSOConfigStatic[];
476
+ };
477
+ };
478
+ isPrimaryRegion: boolean;
479
+ regionGroup: string;
480
+ navigatorLanguages: string[];
481
+ locale: Locale;
482
+ };
483
+
460
484
  type CommonLocaleConfig = Readonly<{
461
485
  name: string;
462
486
  languageName: string;
@@ -481,7 +505,7 @@ type LocalePreset = {
481
505
  [key in Locale]: WebAdminLocaleConfig;
482
506
  };
483
507
  [Platform.MOBILE]: {
484
- [key in Locale]: AuthWebLocaleConfig<SSOByLocale[key]>;
508
+ [key in Locale]: MobileLocaleConfig;
485
509
  };
486
510
  };
487
511
  type LocaleConfig<P extends Platform, L extends Locale> = LocalePreset[P][L];
@@ -524,4 +548,4 @@ declare class AppConfigManager<P extends Platform, L extends Locale> {
524
548
  };
525
549
  }
526
550
 
527
- export { ApiRegion, AppConfigManager, type AuthWebBaseVars, type AuthWebVars, type AuthWebVarsPreset, DateFormat, DateLocale, type DistrictCommon, type DistrictDashboardVars, type DistrictWebVarsPreset, type EnvPreset, Environment, type EnvironmentVars, Locale, LoginSource, MatrixMode, type MobileBaseVars, type MobileCommon, type MobileVars, type MobileVarsPreset, Platform, PlatformBuildTarget, SSO, type SSOByLocale, type SSOConfig, type SSOVariant, type SSO_DE, type SSO_SE, type SSO_UK, type SSO_US, Source, type StudentsWebCommon, type StudentsWebVars, type StudentsWebVarsPreset, type TeachersWebCommon, type TeachersWebVars, type TeachersWebVarsPreset, buildTargetToEnvironment };
551
+ export { ApiRegion, AppConfigManager, type AuthWebBaseVars, type AuthWebVars, type AuthWebVarsPreset, DateFormat, DateLocale, type DistrictCommon, type DistrictDashboardVars, type DistrictWebVarsPreset, type EnvPreset, Environment, type EnvironmentVars, Locale, LoginSource, MatrixMode, type MobileBaseVars, type MobileCommon, type MobileVars, type MobileVarsPreset, Platform, PlatformBuildTarget, SSO, type SSOByLocale, type SSOConfig, type SSOConfigStatic, type SSOVariant, type SSO_DE, type SSO_SE, type SSO_UK, type SSO_US, Source, type StudentsWebCommon, type StudentsWebVars, type StudentsWebVarsPreset, type TeachersWebCommon, type TeachersWebVars, type TeachersWebVarsPreset, buildTargetToEnvironment };
package/dist/index.js CHANGED
@@ -103,6 +103,7 @@ var LoginSource = /* @__PURE__ */ ((LoginSource2) => {
103
103
  return LoginSource2;
104
104
  })(LoginSource || {});
105
105
  var SSO = /* @__PURE__ */ ((SSO2) => {
106
+ SSO2["APPLE"] = "APPLE";
106
107
  SSO2["GOOGLE"] = "GOOGLE";
107
108
  SSO2["MICROSOFT"] = "MICROSOFT";
108
109
  SSO2["CLEVER"] = "CLEVER";
@@ -2868,6 +2869,195 @@ var LOCALE_WEB_ADMIN_DE = {
2868
2869
  regionGroup: "de",
2869
2870
  apiRegion: "MAIN" /* MAIN */
2870
2871
  };
2872
+ var AppleIcon = ({ size = 38 }) => /* @__PURE__ */ jsxRuntime.jsxs(Svg__default.default, { viewBox: "0 0 88 108", fill: "none", xmlns: "http://www.w3.org/2000/svg", width: size, height: size, children: [
2873
+ /* @__PURE__ */ jsxRuntime.jsx(Svg.G, { clipPath: "url(#clip0_5168_15698)", children: /* @__PURE__ */ jsxRuntime.jsx(
2874
+ Svg.Path,
2875
+ {
2876
+ d: "M84.778 36.976c-.62.482-11.578 6.656-11.578 20.384 0 15.879 13.943 21.496 14.36 21.635-.064.343-2.215 7.694-7.351 15.183-4.58 6.592-9.362 13.172-16.639 13.172-7.276 0-9.148-4.226-17.547-4.226-8.186 0-11.096 4.365-17.752 4.365-6.655 0-11.299-6.099-16.638-13.589C5.448 85.105.45 71.441.45 58.473c0-20.801 13.525-31.833 26.836-31.833 7.072 0 12.968 4.644 17.409 4.644 4.226 0 10.817-4.922 18.864-4.922 3.05 0 14.006.278 21.218 10.614zM59.74 17.556c3.328-3.949 5.682-9.427 5.682-14.905 0-.76-.065-1.53-.204-2.151-5.414.203-11.855 3.606-15.74 8.11-3.049 3.467-5.895 8.946-5.895 14.5 0 .834.139 1.668.203 1.936.343.064.899.139 1.455.139 4.858 0 10.968-3.253 14.499-7.63z",
2877
+ fill: "#000"
2878
+ }
2879
+ ) }),
2880
+ /* @__PURE__ */ jsxRuntime.jsx(Svg.Defs, { children: /* @__PURE__ */ jsxRuntime.jsx(Svg.ClipPath, { id: "clip0_5168_15698", children: /* @__PURE__ */ jsxRuntime.jsx(Svg.Path, { fill: "#fff", transform: "translate(.451 .5)", d: "M0 0H87.098V107H0z" }) }) })
2881
+ ] });
2882
+
2883
+ // src/configs/sso/mobile/sso.apple.ts
2884
+ var SSO_APPLE_CONFIG = {
2885
+ name: "Apple",
2886
+ type: "APPLE" /* APPLE */,
2887
+ loginSource: 7 /* APPLE */,
2888
+ icon: AppleIcon
2889
+ };
2890
+
2891
+ // src/configs/locale/mobile/us/locale.us.ts
2892
+ var LOCALE_MOBILE_US = {
2893
+ path: "/",
2894
+ shortCode: "en",
2895
+ icon: USFlagIcon,
2896
+ sources: {
2897
+ signIn: {
2898
+ withOnboarding: true,
2899
+ largeQRCode: false,
2900
+ mediumQRCode: false,
2901
+ list: [
2902
+ SSO_GOOGLE_CONFIG,
2903
+ SSO_APPLE_CONFIG,
2904
+ SSO_MICROSOFT_CONFIG,
2905
+ SSO_CLASSLINK_CONFIG,
2906
+ SSO_CLEVER_CONFIG,
2907
+ SSO_SCHOOLOGY_CONFIG,
2908
+ SSO_CANVAS_CONFIG,
2909
+ SSO_QR_CODE_CONFIG
2910
+ ]
2911
+ },
2912
+ signUp: {
2913
+ list: [SSO_GOOGLE_CONFIG, SSO_APPLE_CONFIG, SSO_MICROSOFT_CONFIG]
2914
+ }
2915
+ },
2916
+ isPrimaryRegion: true,
2917
+ regionGroup: "us",
2918
+ navigatorLanguages: ["en-SE" /* US */, "en", "es-US"],
2919
+ locale: "en-SE" /* US */
2920
+ };
2921
+
2922
+ // src/configs/locale/mobile/se/locale.se.ts
2923
+ var LOCALE_MOBILE_SE = {
2924
+ path: "/",
2925
+ shortCode: "sv",
2926
+ icon: SwedenFlagIcon,
2927
+ sources: {
2928
+ signIn: {
2929
+ withOnboarding: false,
2930
+ largeQRCode: false,
2931
+ mediumQRCode: false,
2932
+ list: [
2933
+ SSO_GOOGLE_CONFIG,
2934
+ SSO_APPLE_CONFIG,
2935
+ SSO_MICROSOFT_CONFIG,
2936
+ SSO_SKOLON_CONFIG,
2937
+ SSO_SKOLFEDERATION_CONFIG,
2938
+ SSO_QR_CODE_CONFIG
2939
+ ]
2940
+ },
2941
+ signUp: {
2942
+ list: [SSO_GOOGLE_CONFIG, SSO_APPLE_CONFIG, SSO_MICROSOFT_CONFIG]
2943
+ }
2944
+ },
2945
+ isPrimaryRegion: true,
2946
+ regionGroup: "se",
2947
+ navigatorLanguages: ["sv-SE" /* SE */, "sv"],
2948
+ locale: "sv-SE" /* SE */
2949
+ };
2950
+
2951
+ // src/configs/locale/mobile/gb/locale.gb.ts
2952
+ var LOCALE_MOBILE_GB = {
2953
+ path: "/uk",
2954
+ shortCode: "gb",
2955
+ icon: UKFlagIcon,
2956
+ sources: {
2957
+ signIn: {
2958
+ withOnboarding: false,
2959
+ largeQRCode: true,
2960
+ mediumQRCode: false,
2961
+ list: [
2962
+ SSO_GOOGLE_CONFIG,
2963
+ SSO_APPLE_CONFIG,
2964
+ SSO_MICROSOFT_CONFIG,
2965
+ SSO_WONDE_CONFIG,
2966
+ SSO_SKOLON_CONFIG,
2967
+ SSO_QR_CODE_CONFIG
2968
+ ]
2969
+ },
2970
+ signUp: {
2971
+ list: [SSO_GOOGLE_CONFIG, SSO_APPLE_CONFIG, SSO_MICROSOFT_CONFIG, SSO_WONDE_CONFIG]
2972
+ }
2973
+ },
2974
+ isPrimaryRegion: true,
2975
+ regionGroup: "uk",
2976
+ navigatorLanguages: ["en-GB" /* GB */, "en-IE", "gd"],
2977
+ locale: "en-GB" /* GB */
2978
+ };
2979
+
2980
+ // src/configs/locale/mobile/ca/locale.ca.ts
2981
+ var LOCALE_MOBILE_CA = {
2982
+ path: "/ca",
2983
+ shortCode: "ca",
2984
+ icon: CanadaFlagIcon,
2985
+ sources: {
2986
+ signIn: {
2987
+ withOnboarding: true,
2988
+ largeQRCode: false,
2989
+ mediumQRCode: false,
2990
+ list: [
2991
+ SSO_GOOGLE_CONFIG,
2992
+ SSO_APPLE_CONFIG,
2993
+ SSO_MICROSOFT_CONFIG,
2994
+ SSO_CLASSLINK_CONFIG,
2995
+ SSO_CLEVER_CONFIG,
2996
+ SSO_SCHOOLOGY_CONFIG,
2997
+ SSO_CANVAS_CONFIG,
2998
+ SSO_QR_CODE_CONFIG
2999
+ ]
3000
+ },
3001
+ signUp: {
3002
+ list: [SSO_GOOGLE_CONFIG, SSO_APPLE_CONFIG, SSO_MICROSOFT_CONFIG]
3003
+ }
3004
+ },
3005
+ isPrimaryRegion: true,
3006
+ regionGroup: "ca",
3007
+ navigatorLanguages: ["en-CA" /* CA */, "fr-CA"],
3008
+ locale: "en-CA" /* CA */
3009
+ };
3010
+
3011
+ // src/configs/locale/mobile/sct/locale.sct.ts
3012
+ var LOCALE_MOBILE_SCT = {
3013
+ path: "/uk",
3014
+ shortCode: "gb",
3015
+ icon: UKFlagIcon,
3016
+ sources: {
3017
+ signIn: {
3018
+ withOnboarding: false,
3019
+ largeQRCode: true,
3020
+ mediumQRCode: false,
3021
+ list: [
3022
+ SSO_GOOGLE_CONFIG,
3023
+ SSO_APPLE_CONFIG,
3024
+ SSO_MICROSOFT_CONFIG,
3025
+ SSO_WONDE_CONFIG,
3026
+ SSO_SKOLON_CONFIG,
3027
+ SSO_QR_CODE_CONFIG
3028
+ ]
3029
+ },
3030
+ signUp: {
3031
+ list: [SSO_GOOGLE_CONFIG, SSO_APPLE_CONFIG, SSO_MICROSOFT_CONFIG, SSO_WONDE_CONFIG]
3032
+ }
3033
+ },
3034
+ isPrimaryRegion: true,
3035
+ regionGroup: "uk",
3036
+ navigatorLanguages: ["en-GB" /* GB */, "en-IE", "gd"],
3037
+ locale: "en-GB" /* GB */
3038
+ };
3039
+
3040
+ // src/configs/locale/mobile/de/locale.de.ts
3041
+ var LOCALE_MOBILE_DE = {
3042
+ path: "/de",
3043
+ shortCode: "de",
3044
+ icon: GermanFlagIcon,
3045
+ sources: {
3046
+ signIn: {
3047
+ withOnboarding: false,
3048
+ largeQRCode: false,
3049
+ mediumQRCode: true,
3050
+ list: [SSO_GOOGLE_CONFIG, SSO_APPLE_CONFIG, SSO_MICROSOFT_CONFIG, SSO_QR_CODE_CONFIG]
3051
+ },
3052
+ signUp: {
3053
+ list: [SSO_GOOGLE_CONFIG, SSO_APPLE_CONFIG, SSO_MICROSOFT_CONFIG]
3054
+ }
3055
+ },
3056
+ isPrimaryRegion: true,
3057
+ regionGroup: "de",
3058
+ navigatorLanguages: ["de-DE" /* DE */, "de"],
3059
+ locale: "de-DE" /* DE */
3060
+ };
2871
3061
 
2872
3062
  // src/configs/locale/locale.preset.ts
2873
3063
  var LOCALE_PRESET = {
@@ -2912,12 +3102,12 @@ var LOCALE_PRESET = {
2912
3102
  ["de-DE" /* DE */]: LOCALE_WEB_ADMIN_DE
2913
3103
  },
2914
3104
  ["MOBILE" /* MOBILE */]: {
2915
- ["en-SE" /* US */]: LOCALE_AUTHWEB_US,
2916
- ["sv-SE" /* SE */]: LOCALE_AUTHWEB_SE,
2917
- ["en-GB" /* GB */]: LOCALE_AUTHWEB_GB,
2918
- ["en-CA" /* CA */]: LOCALE_AUTHWEB_CA,
2919
- ["en-SCT" /* SCT */]: LOCALE_AUTHWEB_SCT,
2920
- ["de-DE" /* DE */]: LOCALE_AUTHWEB_DE
3105
+ ["en-SE" /* US */]: LOCALE_MOBILE_US,
3106
+ ["sv-SE" /* SE */]: LOCALE_MOBILE_SE,
3107
+ ["en-GB" /* GB */]: LOCALE_MOBILE_GB,
3108
+ ["en-CA" /* CA */]: LOCALE_MOBILE_CA,
3109
+ ["en-SCT" /* SCT */]: LOCALE_MOBILE_SCT,
3110
+ ["de-DE" /* DE */]: LOCALE_MOBILE_DE
2921
3111
  }
2922
3112
  };
2923
3113