@jsb188/app 1.0.0 → 1.0.1

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.
@@ -0,0 +1,20 @@
1
+
2
+ // Local storage
3
+
4
+ export const STORAGE_KEYS = {
5
+ // Authentication
6
+ AUTH_TOKEN: 'AT', // There's no ":", so this is used as-is
7
+ LAST_VERSION: 'LV:', // ":" at end means it's a prefix
8
+ CURRENT_USER_ID: 'CU:',
9
+
10
+ // Settings
11
+ LIGHT_MODE: 'LM:',
12
+ } as Record<string, string>;
13
+
14
+ // Support e-mails
15
+
16
+ export const SUPPORT_EMAILS = {
17
+ default: 'hi@kajiwoto.ai',
18
+ big_planet: 'hi@kajiwoto.ai',
19
+ cosmic: 'hi@kajiwoto.ai',
20
+ } as Record<string, string>;
package/i18n/app.ts CHANGED
@@ -1,20 +1,13 @@
1
1
  export default {
2
2
  en: {
3
3
 
4
- // General
5
- follow_on_x: 'Follow us on X',
6
- x_acc: 'X account',
7
- on_x_label: 'Big Planet on X',
8
-
9
4
  // Site meta
10
- name: 'Big Planet',
11
- description: 'Meet new people, chat with friends or chat with AI!',
12
- copyright_text: 'Big Planet. All rights reserved.',
5
+ copyright_text: 'All rights reserved.',
13
6
  privacy: 'Privacy Policy',
14
7
  tos: 'Terms of Service',
15
8
 
16
9
  // All routes
17
- route_: 'Big Planet | %{text}',
10
+ route_: 'App | %{text}',
18
11
  route_auth: 'Log in or sign up',
19
12
 
20
13
  // @home screen
@@ -70,8 +63,7 @@ export default {
70
63
  change_status: 'Change status',
71
64
 
72
65
  // External link popup
73
- leaving_bp: 'Leaving Big Planet',
74
- leaving_bp_desc: 'You are about to visit an external website. Are you sure you want to continue?',
66
+ leaving_app_desc: 'You are about to visit an external website. Are you sure you want to continue?',
75
67
  link_yes: 'Yes, take me away',
76
68
 
77
69
  // Notifications/Alerts
package/i18n/auth.ts CHANGED
@@ -7,8 +7,15 @@ export default {
7
7
  continue_with_discord: 'Continue with Discord',
8
8
  continue_with_apple: 'Continue with Apple',
9
9
  login_opts: 'Continue with e-mail, ID, or @username',
10
+ resend_verification_email: 'Send verification e-mail', // This is for title of <ModalHeader /> in <AuthSwitch />
11
+ reset_password: 'Reset password',
12
+ forgot_password_: 'Forgot password or username?',
10
13
  signup_email: 'Sign up using e-mail',
11
- login_using_other: 'Log in using other methods',
14
+ signup_using_other: 'Sign up using other methods',
15
+ change_password: 'Change password',
16
+ you_are_verified_: 'You are verified!',
17
+ account_is_verified: 'Thank you for verifying your account with e-mail address: %{emailAddress}',
18
+ continue_to_login: 'Continue to log in',
12
19
 
13
20
  // Auth
14
21
  username_not_found: 'No one was found with that username.',
@@ -16,6 +23,15 @@ export default {
16
23
  hello_: 'Hello %{name}!',
17
24
  you_are_logged_in: 'You are logged in.',
18
25
  password_changed_msg: 'Your password has been changed.',
26
+ request_reset_password_instr: 'Enter your e-mail address and we will send you instructions to reset your password.',
27
+ resend_verification_instr: 'Enter your e-mail address for your account and we will send you a new verification e-mail.',
28
+ reset_password_instr: 'Choose a new password for your account with the e-mail address: %{emailAddress}',
29
+ _send_new_verification: 'to send a new verification e-mail.',
30
+
31
+ // Reset password (requested)
32
+ reset_password_requested_1: 'Please check your e-mail at ',
33
+ reset_password_requested_2: ' for instructions to reset your password.',
34
+ if_need_more_help: 'If you need more help, please contact us at ',
19
35
 
20
36
  // Sign up
21
37
  sign_up: 'Sign up',
@@ -23,6 +39,7 @@ export default {
23
39
  sign_up_notice_1: 'By selecting "Agree and continue", I agree to the ',
24
40
  sign_up_notice_2: ' and acknowledge the ',
25
41
  account_created: 'Account created',
42
+ email_sent: 'E-mail sent',
26
43
  check_email_1: 'Please check your e-mail at ',
27
44
  check_email_2: ' to verify your account.',
28
45
  check_email_3: 'Click "continue" to log in as ',
package/i18n/error.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export default {
2
2
  en: {
3
3
  error: 'Error',
4
+ invalid: 'Invalid',
4
5
  network_error_title: 'Network error',
5
6
  unknown_error: 'An unknown error occured.',
6
7
  network_error: 'Failed to connect to server. Please try again in a moment.',
@@ -9,6 +10,9 @@ export default {
9
10
  not_allowed: 'Not allowed',
10
11
  not_allowed_perms: 'You do not have permission to do that.',
11
12
  login_changed: 'Login changed',
13
+ link_expired: 'Link expired',
14
+ link_expired_msg: 'This link expired. Please try again by requesting another link.',
15
+ invalid_link_msg: 'This link is invalid. Please try again by requesting another link.',
12
16
 
13
17
  // 1x
14
18
  '10000_title': 'App updated!',
@@ -35,14 +39,14 @@ export default {
35
39
  20003: 'Please use "Continue with Google" to log in. (%{value})',
36
40
  '20004_title': 'Continue with Apple',
37
41
  20004: 'Please use "Continue with Apple" to log in. (%{value})',
38
- 20005: 'A matching user was not found with that username. (@%{value})',
39
- 20006: 'A matching user was not found with that e-mail. (%{value})',
40
- 20007: 'A matching user was not found with that ID. (%{value})',
42
+ 20005: 'Could not find user with that username (@%{value})',
43
+ 20006: 'Could not find user with that e-mail. (%{value})',
44
+ 20007: 'Could not find user with that ID. (%{value})',
41
45
  20008: 'Your password is incorrect. You have %{value} try(s) remaining.',
42
46
  20009: 'Please wait 10 minutes before trying to log in again.',
43
- 20010: '"%{value}" is an invalid user ID.',
44
- 20011: 'Your token expired, please try again.',
45
- 20012: 'Your token is invalid, please try again.',
47
+ 20010: 'Could not find user.',
48
+ 20011: 'Your token expired, please request a new link.',
49
+ 20012: 'Your token is invalid, please request a new link.',
46
50
  20013: 'User already exists with that e-mail address. (%{value})',
47
51
  20014: 'User already exists with that username. (%{value})',
48
52
  20015: "Sorry, we couldn't find that user in our database.",
@@ -79,6 +83,8 @@ export default {
79
83
  20045: 'Your password is incorrect.',
80
84
  20046: 'Your new password must be different from your current password.',
81
85
  20047: 'You must enter a valid password.',
86
+ 20048: 'This action is forbidden because you deleted your account.',
87
+ 20049: 'You must activate your account before you can use the app.',
82
88
 
83
89
  '29999_title': 'Not ready',
84
90
  29999: 'AI chat is not ready right now.',
@@ -101,6 +107,7 @@ export default {
101
107
  30022: 'Your CVC number is incorrect.',
102
108
  30023: 'Your card expiration date is incorrect.',
103
109
  30024: 'Stripe customer and payment method was mismatched.',
110
+ 30025: 'Sorry, e-mail server is experiencing an outage. Please try again in a moment.',
104
111
 
105
112
  // Form errors
106
113
 
package/i18n/form.ts CHANGED
@@ -55,6 +55,7 @@ export default {
55
55
  thank_you: 'Thank you',
56
56
  click_here: 'Click here',
57
57
  success: 'Success',
58
+ success_: 'Success!',
58
59
 
59
60
  // Day periods
60
61
  greet_MORNING: 'Good morning, %{name}.',
package/i18n/user.ts CHANGED
@@ -14,7 +14,7 @@ export default {
14
14
  email_ph: 'e.g., jane_doe@email.com',
15
15
  password: 'Password',
16
16
  password_ph: 'Enter your password',
17
- passwordRepeat: 'Password (confirmation)',
17
+ passwordRepeat: 'Password (please repeat)',
18
18
  search_ph: 'Search @ or ID',
19
19
  no_one_found_: 'No one found: "%{query}"',
20
20
  from_friends_list: 'From your friends list',
@@ -27,6 +27,8 @@ export default {
27
27
  profile: 'Profile',
28
28
  profile_desc: 'Change how your profile looks to others.',
29
29
  personas: 'Personas',
30
+ show_password: 'Show password',
31
+ hide_password: 'Hide password',
30
32
  change_password: 'Change password',
31
33
  change_password_desc: 'Change your account\'s login password.',
32
34
  // personas_desc: 'Manage your roleplay personas. Persona for the chat (your name and photo) can be changed by clicking your photo next to the chat textarea.',
@@ -42,6 +44,7 @@ export default {
42
44
  // Change password
43
45
  currentPassword: 'Current password',
44
46
  newPassword: 'New password',
47
+ newPasswordRepeat: 'New password (repeat)',
45
48
 
46
49
  // Log out
47
50
  logout: 'Log out',
package/main.ts CHANGED
@@ -7,15 +7,37 @@ import error from './i18n/error';
7
7
  import form from './i18n/form';
8
8
  import user from './i18n/user';
9
9
 
10
+ /**
11
+ * Extend i18n with app specific texts
12
+ */
13
+
10
14
  export function configI18n(texts: Record<string, any>) {
11
- i18n.extend({
12
- app: app.en,
13
- auth: auth.en,
14
- billing: billing.en,
15
- datetime: datetime.en,
16
- error: error.en,
17
- form: form.en,
18
- user: user.en,
19
- ...texts
20
- });
15
+
16
+ // Locale support for later
17
+ const locale = 'en';
18
+
19
+ const extendedObj = {
20
+ app: app[locale],
21
+ auth: auth[locale],
22
+ billing: billing[locale],
23
+ datetime: datetime[locale],
24
+ error: error[locale],
25
+ form: form[locale],
26
+ user: user[locale],
27
+ } as Record<string, any>;
28
+
29
+ for (const key in texts) {
30
+ const obj = texts[key][locale];
31
+
32
+ if (extendedObj[key]) {
33
+ extendedObj[key] = {
34
+ ...extendedObj[key],
35
+ ...obj
36
+ };
37
+ } else {
38
+ extendedObj[key] = obj;
39
+ }
40
+ }
41
+
42
+ i18n.extend(extendedObj);
21
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsb188/app",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Contains all the basic requirements for all @jsb188 apps.",
5
5
  "license": "ISC",
6
6
  "author": "jsb188",
@@ -10,6 +10,7 @@
10
10
  "exports": {
11
11
  ".": "./main.ts",
12
12
  "./i18n": "./i18n/index.ts",
13
+ "./constants/app": "./constants/app.ts",
13
14
  "./constants/billing": "./constants/billing.ts",
14
15
  "./constants/emoji": "./constants/emoji.ts",
15
16
  "./constants/user": "./constants/user.ts",
package/types/form.d.ts CHANGED
@@ -44,6 +44,9 @@ interface FormGroupType {
44
44
  }
45
45
 
46
46
  export interface FormItemIfaceObj extends FormItemSchemaObj {
47
+ name: string;
48
+ hidden?: boolean | ((dataForSchema: any) => boolean);
49
+ locked?: boolean | ((dataForSchema: any) => boolean);
47
50
  formValues: any;
48
51
  setFormValues: (values: any) => void;
49
52
  onInput?: (e: React.FormEvent, name: string) => void;