From 2139f82cced16df422d0b437bfb1abef96630abf Mon Sep 17 00:00:00 2001 From: Jack Works Date: Fri, 21 Feb 2020 13:56:00 +0800 Subject: [PATCH 01/70] chore: bump version to 1.10.8 --- package.json | 2 +- src/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7723f312f1b2..6394d091050e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "maskbook", - "version": "1.10.7", + "version": "1.10.8", "private": true, "license": "AGPL-3.0-or-later", "scripts": { diff --git a/src/manifest.json b/src/manifest.json index f05f23aebf8e..59f7dc2634b5 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "$schema": "http://json.schemastore.org/chrome-manifest", "name": "Maskbook", - "version": "1.10.7", + "version": "1.10.8", "manifest_version": 2, "web_accessible_resources": ["*.css", "*.js", "*.jpg", "*.png"], "permissions": ["storage", "downloads", "webNavigation", "activeTab"], From 73a357ea51aeca990ca994258950ce2a8cf79372 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Mon, 24 Feb 2020 10:24:18 +0800 Subject: [PATCH 02/70] feat: restore select recipients in normal mode --- .../SelectRecipients/SelectRecipients.tsx | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/components/shared/SelectRecipients/SelectRecipients.tsx b/src/components/shared/SelectRecipients/SelectRecipients.tsx index 5bc2fcdf3cae..d3fa44861a0c 100644 --- a/src/components/shared/SelectRecipients/SelectRecipients.tsx +++ b/src/components/shared/SelectRecipients/SelectRecipients.tsx @@ -12,8 +12,6 @@ import { useI18N } from '../../../utils/i18n-next-ui' import { difference } from 'lodash-es' import { useCurrentIdentity } from '../../DataSource/useActivatedUI' import { useStylesExtends } from '../../custom-ui-helper' -import { useValueRef } from '../../../utils/hooks/useValueRef' -import { debugModeSetting } from '../../shared-settings/settings' const useStyles = makeStyles({ root: { @@ -42,7 +40,6 @@ export function SelectRecipientsUI( const { t } = useI18N() const classes = useStylesExtends(useStyles(), props) const { items, selected, onSetSelected, children } = props - const isDebugging = useValueRef(debugModeSetting) const currentIdentity = useCurrentIdentity() const groupItems = items.filter(x => isGroup(x)) as Group[] const profileItems = items.filter( @@ -74,22 +71,19 @@ export function SelectRecipientsUI( {...props.GroupInChipProps} /> ))} - {isDebugging ? ( - , - disabled: props.disabled || profileItems.length === 0, - onClick() { - setOpen(true) - }, - }} - /> - ) : null} {children} - + , + disabled: props.disabled || profileItems.length === 0, + onClick() { + setOpen(true) + }, + }} + /> Date: Mon, 24 Feb 2020 14:59:04 +0800 Subject: [PATCH 03/70] fix: syntax errors in i18n msg --- src/_locales/en/messages.json | 56 +++++++++++++++++------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index da3773b7365a..3d1d7bf5a5fa 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -2,7 +2,7 @@ "add_persona": "Add Persona", "add_to_key_store_failed_text": "{{error}}\nThis public key won't be saved.", "add_to_key_store_failed_title": "Maskbook public key NOT verified ❌", - "add_to_key_store_success": "Maskbook public key added to keystore ✔", + "add_to_key_store_success": "Maskbook public key added to the Keystore ✔", "add_to_key_store_verifying": "Maskbook public key found, verifying...", "adding": "Adding...", "additional_post_box__encrypted_failed": "Please paste the following text into the post box.", @@ -10,10 +10,10 @@ "additional_post_box__placeholder_w_name": "Hey {{user}}, what's your mind? Encrypt with Maskbook", "additional_post_box__placeholder_wo_name": "What's your mind? Encrypt with Maskbook", "additional_post_box__post_button": "📫 Post it!", - "additional_post_box__steganography_post_failed": "Please upload downloaded image into the post box.", + "additional_post_box__steganography_post_failed": "Please upload the downloaded image into the post box.", "additional_post_box__steganography_post_pre": "This post is shared with my friends. You may install Maskbook to decrypt the content from the image. ([I:b]) {{random}}", "advanced": "Advanced...", - "automation_pasted_into_bio_box": "[Maskbook] We have helped you append the public key to bio, confirm by publish it!", + "automation_pasted_into_bio_box": "[Maskbook] We have helped you append the public key to your bio, confirm by publishing it!", "automation_request_click_edit_bio_button": "Please click the “Edit bio” button or the pencil on the bio box.", "automation_request_paste_into_bio_box": "Please copy your public key into the bio box and publish it.", "automation_request_paste_into_post_box": "Please copy your public key and publish it to your timeline!", @@ -33,7 +33,7 @@ "connecting": "Connecting...", "copy": "Copy", "create": "Create", - "create_persona": "Create Persona", + "create_persona": "Create a Persona", "dashboard": "Dashboard", "dashboard_add_new_persona": "Add New Persona", "dashboard_advanced_restoration": "Advanced Restoration Options", @@ -55,8 +55,8 @@ "dashboard_create_persona_hint": "Create a new persona.", "dashboard_database_import_successful_hint": "Your database has been restored. Existing data will be merged.", "dashboard_delete_persona": "Delete", - "dashboard_delete_persona_confirm_hint": "Do you really want to delete persona {{name}}? This operation cannot be reverted.", - "dashboard_disconnect_profile_hint": "Do you really want to disconnect {{profile}} on {{network}} from persona {{persona}}? This operation cannot be reverted.", + "dashboard_delete_persona_confirm_hint": "Do you want to delete persona {{name}}? This operation cannot be reverted.", + "dashboard_disconnect_profile_hint": "Do you want to disconnect {{profile}} on {{network}} from persona {{persona}}? This operation cannot be reverted.", "dashboard_download": "Download as File", "dashboard_export_keystore": "Export Backup Keystore", "dashboard_hide_qr": "Hide QR Code", @@ -87,7 +87,7 @@ "dashboard_persona_created": "Persona Created", "dashboard_persona_import_dialog_hint": "You can import a persona backup with either way below.", "dashboard_ready_to_import": "Ready to Import...", - "dashboard_ready_to_import_hint": "Maskbook needs access to certain websites, before you can import this backup.", + "dashboard_ready_to_import_hint": "Maskbook needs access to certain websites before you can import this backup.", "dashboard_restoration_successful": "Restoration Successful", "dashboard_restoration_successful_hint": "Restored from a backup at {{time}}", "dashboard_restore_database_hint": "Choose a backup file to restore your database.", @@ -103,7 +103,7 @@ "database_group_following_name": "Followed by {{owner}}", "database_group_friends_default_name": "Friends", "debug": "Debug", - "decrypted_postbox_add_recipients": "View / add recipients", + "decrypted_postbox_add_recipients": "View/add recipients", "decrypted_postbox_decrypting": "Maskbook decrypting...", "decrypted_postbox_decrypting_finding_person_key": "Maskbook is looking for the public key of the author...", "decrypted_postbox_decrypting_finding_post_key": "Maskbook is retrieving the post key to decrypt this post...", @@ -124,7 +124,7 @@ "immersive_setup_connect_as_unknown": "Connect as who?", "immersive_setup_connect_profile": "Yes, I'm sure", "immersive_setup_help_dont_know_what_is_username": "But I don't know what my username is!", - "immersive_setup_no_bio_got": "Maskbook have some problems when setting up! Please report this to Maskbook developer! Our Telegram group: https://t.me/maskbook_group", + "immersive_setup_no_bio_got": "Maskbook have some problems when setting up! Please report this to the Maskbook developer! Our Telegram group: https://t.me/maskbook_group", "immersive_setup_paste_into_bio": "[Optional] Paste this key to your bio", "immersive_setup_paste_into_bio_auto": "Add it for me", "immersive_setup_paste_into_bio_failed": "Failed... Please add it to your bio manually", @@ -144,10 +144,10 @@ "options_index_privacy": "Privacy policy", "options_index_setup": "Setup your account", "options_mobile_export_generating": "Generating QR Code...", - "options_mobile_export_subtitle": "DO NOT save or share it to others!", + "options_mobile_export_subtitle": "DO NOT save or share it with others!", "payload_bad": "This post seemed to be corrupted. Maskbook cannot decrypt it.", "payload_incomplete": "This post is not complete, you need to view the full post.", - "payload_not_found": "Doesn't find payload", + "payload_not_found": "Doesn't find the payload", "payload_throw_in_alpha41": "Support for Alpha41 is dropped. Tell your friends to upgrade Maskbook!", "person_or_group_in_chip": "{{name}} ({{count}} in the group)", "person_or_group_in_list_0": "This is an empty group", @@ -178,15 +178,15 @@ "select_file_hint": "Or drop a file here...", "select_none": "Select None", "select_specific_friends_dialog__button": "Done", - "select_specific_friends_dialog__dismiss_aria": "Dismiss the select recipients dialog", + "select_specific_friends_dialog__dismiss_aria": "Dismiss the select recipients' dialog", "select_specific_friends_dialog__title": "Select Specific Friends", "service_decryption_failed": "Decryption failed.", "service_have_no_own_key_yet": "You have no private key yet", - "service_invalid_backup_file": "This does not seems like a backup of Maskbook.", + "service_invalid_backup_file": "This does not seem like a backup of Maskbook.", "service_key_parse_failed": "Key parse failed", "service_not_setup_yet": "You have not set up Maskbook yet!", "service_not_share_target": "Maskbook does not find the key used to decrypt this post. Maybe this post is not intended to share with you?", - "service_others_key_not_found": "Public key of {{name}} can not be found!", + "service_others_key_not_found": "The public key of {{name}} cannot be found!", "service_publish_post_aes_key_failed": "Publish AES key failed!", "service_self_key_decryption_failed": "Decryption failed. Maybe you selected a wrong identity or imported a key that was not used to encrypt this post.", "service_unknown_payload": "Unknown post version, maybe you should update Maskbook?", @@ -195,11 +195,11 @@ "set_up": "Set up", "settings": "Settings", "settings_disable_new_background_tab": "Disable open hidden tabs in the background", - "settings_disable_new_background_tab_desc": "This is an deprecated behavior of Maskbook. If you find that you can not decrypt some old posts, deselect this.", + "settings_disable_new_background_tab_desc": "This is a deprecated behavior of Maskbook. If you find that you cannot decrypt some old posts, deselect this.", "settings_enable_debug": "Enable debug mode", - "settings_enable_debug_desc": "Enable this will display additional information on the Maskbook UI to help debugging", - "settings_image_based_payload": "Enable image based mode", - "settings_image_based_payload_desc": "Publishing post with image based payload instead of text payload", + "settings_enable_debug_desc": "Enable this will display additional information on the Maskbook UI to help to debug", + "settings_image_based_payload": "Enable image-based mode", + "settings_image_based_payload_desc": "Publishing post with image-based payload instead of text payload", "settings_language": "Language", "setup_failure": "Setup Failure", "setup_successful": "Setup Successful", @@ -216,27 +216,27 @@ "version": "Version", "welcome_0_close_button": "I'll do it later", "welcome_0_restore_key": "I want to restore my backup", - "welcome_1a1_didntfind": "Didn't find your account?", - "welcome_1a1_title": "Setup which account?", + "welcome_1a1_didntfind": "Didn't you find your account?", + "welcome_1a1_title": "To set up which account?", "welcome_1a1b_connect": "Connect", "welcome_1a1b_danger": "Censored network", "welcome_1a1b_switch": "Use existing accounts", "welcome_1a1b_title": "Maskbook supports these social networks", - "welcome_1a2_description": "Then only people you select with Maskbook can see the posted content.", + "welcome_1a2_description": "Then, only friends you select with Maskbook can see the posted content.", "welcome_1a2_done_button": "Nice!", - "welcome_1a2_imgalt": "Screenshot of how to encrypt message with Maskbook", + "welcome_1a2_imgalt": "Screenshot of how to encrypt a message with Maskbook", "welcome_1a2_title": "Encrypt message in a Maskbook postbox", "welcome_1a3_description1": "Our extension is asking you to download your key as a file.", "welcome_1a3_description2": "Back it up often.", "welcome_1a3_done_button": "Got it!", "welcome_1a3_title": "Keep your backups carefully", - "welcome_1a3a_connect_subtitle": "will use same crypto key", + "welcome_1a3a_connect_subtitle": "will use the same CryptoKey", "welcome_1a3a_connect_title": "Connect other accounts", "welcome_1a3a_generate_new_key": "Generate", - "welcome_1a3a_generate_new_key_password_help": "Please remember the key, or your key will not be able to restore again.", + "welcome_1a3a_generate_new_key_password_help": "Please remember the key, or your key will not be able to restore.", "welcome_1a3a_generate_new_key_password_label": "Password for the new key", "welcome_1a3a_generate_new_key_result": "The mnemonic word", - "welcome_1a3a_generate_new_key_result_help": "Mnemonic word is used to restore the key. Make sure you keep it safely.", + "welcome_1a3a_generate_new_key_result_help": "Mnemonic word is used to restore the key. Make sure you keep it safe.", "welcome_1a3a_generate_new_key_subtitle": "please save it carefully", "welcome_1a3a_generate_new_key_title": "Create a new keypair", "welcome_1a3a_recover_input_password": "Password", @@ -257,7 +257,7 @@ "welcome_1a4_type_auto_subtitle2": "This allows your friends to verify the connection between your social network account and your keypair.", "welcome_1a4_type_auto_switch": "Prefer doing it manually?", "welcome_1a4_type_manual_goto": "Copy & Go to Profile", - "welcome_1a4_type_manual_subtitle1": "Add this to bio, or post on timeline, before your first encrypted post.", + "welcome_1a4_type_manual_subtitle1": "Add this to your bio, or post on your timeline, before your first encrypted post.", "welcome_1a4_type_manual_subtitle2": "This allows your friends to verify the connection between your social network account and your keypair.", "welcome_1a4_type_manual_switch": "Prefer automating the steps?", "welcome_1b_confirm": "Restore the backup", @@ -266,7 +266,7 @@ "welcome_1b_hint_identity": "This backup file contains the following accounts:", "welcome_1b_hint_network": "And Maskbook is going to request permissions for these sites:", "welcome_1b_no_file_selected": "Select your exported key backup", - "welcome_1b_qr_error_1": "There is an error occur during the scanning.", + "welcome_1b_qr_error_1": "There is an error that occurs during scanning.", "welcome_1b_qr_error_2": "You may try other ways to restore your account.", "welcome_1b_qr_rescan": "Rescan", "welcome_1b_tabs_backup": "Select the backup file", @@ -275,4 +275,4 @@ "welcome_1b_title": "Restore your keypair", "welcome_2_greeting": "You can use Maskbook now!", "welcome_2_title": "You're done!" -} \ No newline at end of file +} From ae149567b009d0078b5097be745865ceb630fd3c Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Thu, 20 Feb 2020 19:59:37 +0800 Subject: [PATCH 04/70] test: add test for image --- src/utils/__tests__/image.ts | 104 +++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 src/utils/__tests__/image.ts diff --git a/src/utils/__tests__/image.ts b/src/utils/__tests__/image.ts new file mode 100644 index 000000000000..dcf8e3074059 --- /dev/null +++ b/src/utils/__tests__/image.ts @@ -0,0 +1,104 @@ +import { getDimension } from '../image' + +function n2ab(num: number, bytes: 1 | 2 | 4) { + const ab = new ArrayBuffer(bytes) + const dv = new DataView(ab) + switch (bytes) { + case 1: + dv.setUint8(0, num) + break + case 2: + dv.setUint16(0, num, false) + break + case 4: + dv.setUint32(0, num, false) // big-endian + break + } + return new Uint8Array(ab) +} + +function createJPEGBuffer(width: number, height: number) { + return new Uint8Array([ + // SOI + 0xff, + 0xd8, + + // APP0 + 0xff, + 0xe0, + ...n2ab(16, 2), // length + 'J'.charCodeAt(0), + 'F'.charCodeAt(0), + 'I'.charCodeAt(0), + 'F'.charCodeAt(0), + 0, + 1, // major version + 0, // minor version + 0, // units for x/y densities + ...n2ab(1, 2), // x-density + ...n2ab(1, 2), // y-density + 0, // thumbnail width + 0, // thumbnail height + + // SOF0 baseline DCT + 0xff, + 0xc0, + ...n2ab(11, 2), // length + 0x08, // data precision + ...n2ab(width, 2), + ...n2ab(height, 2), + 1, // number of components + 0, // component id + 0, // sampling factors + 0, // quantization table number + + // EOI + 0xff, + 0xd9, + ]) +} + +function createPNGBuffer(width: number, height: number) { + return new Uint8Array([ + 0x89, + 'P'.charCodeAt(0), + 'N'.charCodeAt(0), + 'G'.charCodeAt(0), + 0x0d, + 0x0a, + 0x1a, + 0x0a, + + // IHDR chunk + ...n2ab(13, 4), // chunk size 13 bytes + 'I'.charCodeAt(0), + 'H'.charCodeAt(0), + 'D'.charCodeAt(0), + 'R'.charCodeAt(0), + ...n2ab(width, 4), + ...n2ab(height, 4), + 0, // depth + 0, // color type + 0, // compression method + 0, // filter method + 0, // interlace method + ]) +} + +test('Get dimension of JPEG buffer', () => { + const { width, height } = getDimension(createJPEGBuffer(10, 10)) + expect(width).toBe(10) + expect(height).toBe(10) +}) + +test('Get dimension of PNG buffer', () => { + const { width, height } = getDimension(createPNGBuffer(10, 10)) + expect(width).toBe(10) + expect(height).toBe(10) +}) + +test('Get dimension of unknown buffer', () => { + const { width, height } = getDimension(new Uint8Array()) + expect(width).toBe(0) + expect(height).toBe(0) +}) From 5344812e5ea74944bdc95b8bd36a3857be4492d5 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Thu, 20 Feb 2020 21:53:24 +0800 Subject: [PATCH 05/70] test: add test for browser.storage --- src/utils/__tests__/browser.storage.ts | 16 ++++++++++++++++ src/utils/browser.storage.ts | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 src/utils/__tests__/browser.storage.ts diff --git a/src/utils/__tests__/browser.storage.ts b/src/utils/__tests__/browser.storage.ts new file mode 100644 index 000000000000..1b1072917c40 --- /dev/null +++ b/src/utils/__tests__/browser.storage.ts @@ -0,0 +1,16 @@ +import { getStorage, setStorage } from '../browser.storage' + +test('get and set storage', async () => { + const before = await getStorage('network_id') + expect(before.forceDisplayWelcome).toBeUndefined() + expect(before.userIgnoredWelcome).toBeUndefined() + + await setStorage('network_id', { + forceDisplayWelcome: true, + userIgnoredWelcome: true, + }) + + const after = await getStorage('network_id') + expect(after.forceDisplayWelcome).toBeTruthy() + expect(after.userIgnoredWelcome).toBeTruthy() +}) diff --git a/src/utils/browser.storage.ts b/src/utils/browser.storage.ts index 5657b484c8e3..d43288ac0c39 100644 --- a/src/utils/browser.storage.ts +++ b/src/utils/browser.storage.ts @@ -7,12 +7,12 @@ interface Storage { export async function getStorage(network: string): Promise> { if (typeof browser === 'undefined' || !browser.storage) return {} const storage = await browser.storage.local.get(network) - return (storage || {})[network] as Partial + return ((storage ?? {})[network] ?? {}) as Partial } export async function setStorage(network: string, item: Partial) { if (typeof browser === 'undefined' || !browser.storage) return const storage = await getStorage(network) - return browser.storage.local.set({ + browser.storage.local.set({ [network]: merge(storage, item), }) } From a45cb20fbb8dd9a11ae0ee4626b236b438164b22 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Thu, 20 Feb 2020 22:09:11 +0800 Subject: [PATCH 06/70] chore: add package jest-webextension-mock --- package.json | 1 + yarn.lock | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/package.json b/package.json index 6394d091050e..2c2c4ea34d28 100644 --- a/package.json +++ b/package.json @@ -131,6 +131,7 @@ "jest-environment-jsdom-fourteen": "^1.0.1", "jest-esm-transformer": "^1.0.0", "jest-junit": "^10.0.0", + "jest-webextension-mock": "^3.5.0", "lint-staged": "^10.0.7", "npm-run-all": "^4.1.5", "prettier": "^1.19.1", diff --git a/yarn.lock b/yarn.lock index 14a39f0e4f0c..83a09190589a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11623,6 +11623,11 @@ jest-watcher@^25.1.0: jest-util "^25.1.0" string-length "^3.1.0" +jest-webextension-mock@^3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/jest-webextension-mock/-/jest-webextension-mock-3.5.0.tgz#a9c8c3d7efd1d2a3639f4f1b0a01904e47983e6f" + integrity sha512-qjLFb6vBGDoDaGZjA/A6sDg8D750eVxNb2s3zgD/kwveZGc09PuLmWtMxOD0YSZUTd0xnqBdl8J6rTWijCCpNQ== + jest-worker@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.9.0.tgz#5dbfdb5b2d322e98567898238a9697bcce67b3e5" From 3b4bf07ea0dc20064e90b4b6845f3fdc40dff07a Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Thu, 20 Feb 2020 22:09:30 +0800 Subject: [PATCH 07/70] chore: update jest setup file with webext mock --- jest.config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index be43ca485d6e..1530034efbf3 100644 --- a/jest.config.js +++ b/jest.config.js @@ -8,7 +8,11 @@ module.exports = { }, }, globalSetup: path.join(__dirname, './scripts/jest-global-setup'), - setupFiles: [require.resolve('fake-indexeddb/auto'), path.join(__dirname, './scripts/jest-setup.js')], + setupFiles: [ + require.resolve('jest-webextension-mock'), + require.resolve('fake-indexeddb/auto'), + path.join(__dirname, './scripts/jest-setup.js'), + ], // skip packages other than 'ts-results' and 'async-call-rpc' transformIgnorePatterns: ['node_modules((?!(ts-results|async-call-rpc)).)*$'], transform: { From dff4ade8944222d7e025f89ddcfab341b3bf5a71 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Fri, 21 Feb 2020 12:55:58 +0800 Subject: [PATCH 08/70] test: add test for memoize promise --- src/utils/__tests__/memoizePromise.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/utils/__tests__/memoizePromise.ts diff --git a/src/utils/__tests__/memoizePromise.ts b/src/utils/__tests__/memoizePromise.ts new file mode 100644 index 000000000000..6e9c6d19faa4 --- /dev/null +++ b/src/utils/__tests__/memoizePromise.ts @@ -0,0 +1,15 @@ +import uuid from 'uuid/v4' +import { memoizePromise } from '../memoize' + +test('memorize promise with default resolver', async () => { + const getUUID = async () => uuid() + const getUUIDCached = memoizePromise(getUUID, undefined) + expect(await getUUIDCached()).toEqual(await getUUIDCached()) +}) + +test('memorize promise with customized resolver', async () => { + const getUUID = async (key1: string, key2?: string) => uuid() + const getUUIDCached = memoizePromise(getUUID, (key1: string, key2?: string) => key1 + key2) + expect(await getUUIDCached('key1')).toEqual(await getUUIDCached('key1')) + expect(await getUUIDCached('key1')).not.toEqual(await getUUIDCached('key1', 'key2')) +}) From ddcb8fd914dfe555151575b2478b97a2d8a1c3aa Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Fri, 21 Feb 2020 15:26:30 +0800 Subject: [PATCH 09/70] test: add test for dispatch custom events --- src/utils/__tests__/dispatchCustomEvents.ts | 34 +++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/utils/__tests__/dispatchCustomEvents.ts diff --git a/src/utils/__tests__/dispatchCustomEvents.ts b/src/utils/__tests__/dispatchCustomEvents.ts new file mode 100644 index 000000000000..d7dc53f14e8a --- /dev/null +++ b/src/utils/__tests__/dispatchCustomEvents.ts @@ -0,0 +1,34 @@ +import { CustomEventId } from '../constants' +import { dispatchCustomEvents, pasteImageToActiveElements } from '../utils' + +test('dispatch input event', () => { + const dispatchEventSpy = spyOn(document, 'dispatchEvent') + dispatchCustomEvents('input', 'value') + expect(dispatchEventSpy).toHaveBeenCalled() + + const event: CustomEvent = dispatchEventSpy.calls.first().args[0] + expect(event.type).toEqual(CustomEventId) + expect(event.detail).toEqual(JSON.stringify(['input', ['value']])) +}) + +test('dispatch paste image event', () => { + const dispatchEventSpy = spyOn(document, 'dispatchEvent') + const payload: { type: 'image'; value: number[] } = { type: 'image', value: [] } + dispatchCustomEvents('paste', payload) + expect(dispatchEventSpy).toHaveBeenCalled() + + const event: CustomEvent = dispatchEventSpy.calls.first().args[0] + expect(event.type).toEqual(CustomEventId) + expect(event.detail).toEqual(JSON.stringify(['paste', [payload]])) +}) + +test('dispatch paste image event with bytes', () => { + const dispatchEventSpy = spyOn(document, 'dispatchEvent') + const bytes = new Uint8Array([]) + pasteImageToActiveElements(bytes) + expect(dispatchEventSpy).toHaveBeenCalled() + + const event: CustomEvent = dispatchEventSpy.calls.first().args[0] + expect(event.type).toEqual(CustomEventId) + expect(event.detail).toEqual(JSON.stringify(['paste', [{ type: 'image', value: Array.from(bytes) }]])) +}) From 1c6cda1bfd3dcc9fafa2c0b11be57f6dc489bf1b Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Fri, 21 Feb 2020 16:40:54 +0800 Subject: [PATCH 10/70] test: add test for select element contents --- public/firefoxFix.js | 9 ++++++- scripts/jest-setup.js | 25 ++++++++++++++++++++ src/utils/__tests__/selectElementContents.ts | 9 +++++++ src/utils/utils.ts | 3 ++- 4 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 src/utils/__tests__/selectElementContents.ts diff --git a/public/firefoxFix.js b/public/firefoxFix.js index 4a98ff1be25a..0809758c79df 100644 --- a/public/firefoxFix.js +++ b/public/firefoxFix.js @@ -9,7 +9,14 @@ * * If any API is complaining "this does not implements Window", add it here. */ - const brokenAPI = ['requestAnimationFrame', 'setTimeout', 'clearTimeout', 'matchMedia', 'getComputedStyle'] + const brokenAPI = [ + 'requestAnimationFrame', + 'setTimeout', + 'clearTimeout', + 'matchMedia', + 'getComputedStyle', + 'getSelection', + ] const webAPIs = Object.getOwnPropertyDescriptors(window) Reflect.deleteProperty(webAPIs, 'window') diff --git a/scripts/jest-setup.js b/scripts/jest-setup.js index 173cceccb331..f5fd45ef2899 100644 --- a/scripts/jest-setup.js +++ b/scripts/jest-setup.js @@ -22,3 +22,28 @@ require('webcrypto-liner/build/webcrypto-liner.shim') /* global TextEncoder, TextDecoder */ Object.assign(globalThis, require('@sinonjs/text-encoding/index')) + +// can not find a handy createRange and getSelection polyfill for jest +// remove these polyfill if we find one in the future +document.createRange = () => { + return { + endContainer: null, + selectNodeContents(element) { + this.endContainer = element + } + } +} +globalThis.getSelection = () => { + return { + _ranges: [], + rangeCount: 0, + removeAllRanges() { }, + addRange(range) { + this._ranges.push(range) + this.rangeCount = this._ranges.length + }, + getRangeAt(index) { + return this._ranges[index] + } + } +} diff --git a/src/utils/__tests__/selectElementContents.ts b/src/utils/__tests__/selectElementContents.ts new file mode 100644 index 000000000000..5a66962a0677 --- /dev/null +++ b/src/utils/__tests__/selectElementContents.ts @@ -0,0 +1,9 @@ +import { selectElementContents } from '../utils' + +test('select element contents', () => { + const div = document.createElement('div') + const selection = selectElementContents(div) + + expect(selection.rangeCount).toEqual(1) + expect(selection.getRangeAt(0).endContainer).toBe(div) +}) diff --git a/src/utils/utils.ts b/src/utils/utils.ts index f59323a79915..910b0c49ba6f 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -57,9 +57,10 @@ Object.assign(globalThis, { dispatchCustomEvents }) export function selectElementContents(el: Node) { const range = document.createRange() range.selectNodeContents(el) - const sel = window.getSelection()! + const sel = globalThis.getSelection()! sel.removeAllRanges() sel.addRange(range) + return sel } export const nop = (...args: unknown[]) => {} From 15c89a9ac800fd71ac750802f9158450f7742976 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Fri, 21 Feb 2020 17:52:25 +0800 Subject: [PATCH 11/70] test: add test for dom --- .../facebook.com/Worker/fetchPostContent.ts | 5 +- src/utils/__tests__/dom.ts | 54 +++++++++++++++++++ src/utils/dom.ts | 2 + src/utils/utils.ts | 2 - 4 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 src/utils/__tests__/dom.ts diff --git a/src/social-network-provider/facebook.com/Worker/fetchPostContent.ts b/src/social-network-provider/facebook.com/Worker/fetchPostContent.ts index b3b1cc278601..b8ce1369a666 100644 --- a/src/social-network-provider/facebook.com/Worker/fetchPostContent.ts +++ b/src/social-network-provider/facebook.com/Worker/fetchPostContent.ts @@ -2,10 +2,9 @@ import { ProfileIdentifier, PostIdentifier } from '../../../database/type' import { parseFacebookStaticHTML } from '../parse-html' import { getPostUrlAtFacebook } from '../parse-username' import tasks from '../../../extension/content-script/tasks' -import { isDocument, timeout } from '../../../utils/utils' -import { facebookWorkerSelf } from '../worker-provider' -import { isNil } from 'lodash-es' +import { timeout } from '../../../utils/utils' import { getActiveTabFacebook } from '../../../utils/tabs' +import { isDocument } from '../../../utils/dom' // ? We now always run fetch request from an active tab. // ? If failed, we will fallback to open a new tab to do this. diff --git a/src/utils/__tests__/dom.ts b/src/utils/__tests__/dom.ts new file mode 100644 index 000000000000..6e5c89007027 --- /dev/null +++ b/src/utils/__tests__/dom.ts @@ -0,0 +1,54 @@ +import { untilDomLoaded, untilDocumentReady, isDocument, nthChild, untilElementAvailable } from '../dom' +import { LiveSelector } from '@holoflows/kit' + +test('is document', () => { + expect(isDocument(document)).toBeTruthy() + expect(isDocument(document.body)).toBeFalsy() +}) + +test('until element available', async () => { + document.body.innerHTML = '' + const ls = new LiveSelector().querySelector('body span') + await untilElementAvailable(ls, 500) + document.body.innerHTML = '' // restore +}) + +test('until element available throw error in case of element absent', () => { + const ls = new LiveSelector().querySelector('body span') + expect(untilElementAvailable(ls, 500)).rejects.toThrow() +}) + +test('until dom loaded', async () => { + jest.spyOn(document, 'readyState', 'get').mockReturnValue('loading') + setTimeout(() => { + jest.spyOn(document, 'readyState', 'get').mockReturnValue('complete') + document.dispatchEvent(new Event('readystatechange')) + }, 0) + await untilDomLoaded() +}) + +test('until document ready', async () => { + jest.spyOn(document, 'readyState', 'get').mockReturnValue('loading') + setTimeout(() => { + jest.spyOn(document, 'readyState', 'get').mockReturnValue('complete') + document.dispatchEvent(new Event('readystatechange')) + }, 0) + await untilDocumentReady() +}) + +test('nth child', () => { + const tree = new DOMParser().parseFromString( + ` +
+
+
+ +
+
+ `, + 'text/html', + ).body.children[0] as HTMLDivElement + + expect(nthChild(tree, 0, 0)).toBeUndefined() + expect(nthChild(tree, 1, 0)?.nodeName).toEqual('SPAN') +}) diff --git a/src/utils/dom.ts b/src/utils/dom.ts index ca1653b12808..53bbc94bac74 100644 --- a/src/utils/dom.ts +++ b/src/utils/dom.ts @@ -1,6 +1,8 @@ import { IntervalWatcher, LiveSelector } from '@holoflows/kit' import { isUndefined } from 'lodash-es' +export const isDocument = (node: Node): node is Document => node.nodeType === Node.DOCUMENT_NODE + export const untilElementAvailable = async (ls: LiveSelector, timeout = 5000) => { const w = new IntervalWatcher(ls) return new Promise((resolve, reject) => { diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 910b0c49ba6f..28d9723eabe7 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -117,8 +117,6 @@ export const regexMatchAll = (str: string, regexp: RegExp, index: number = 1) => return sto } -export const isDocument = (node: Node): node is Document => node.nodeType === Node.DOCUMENT_NODE - /** * batch run string.replace * @param source the source string to replace From c2ff8514580d3ad368bbda25c72bd405876a5a95 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Fri, 21 Feb 2020 18:10:00 +0800 Subject: [PATCH 12/70] test: add test for assert --- src/utils/__tests__/assert.ts | 13 +++++++++++++ src/utils/assert.ts | 15 --------------- 2 files changed, 13 insertions(+), 15 deletions(-) create mode 100644 src/utils/__tests__/assert.ts diff --git a/src/utils/__tests__/assert.ts b/src/utils/__tests__/assert.ts new file mode 100644 index 000000000000..0d1840b96da4 --- /dev/null +++ b/src/utils/__tests__/assert.ts @@ -0,0 +1,13 @@ +import { notNullable } from '../assert' +import { AssertionError } from 'assert' + +const assertErrorMessage = '__assert_error_message__' +const assertError = new AssertionError({ + message: assertErrorMessage, +}) + +test('not nullable', () => { + expect(() => notNullable(0, assertErrorMessage)).not.toThrow() + expect(() => notNullable(null, assertErrorMessage)).toThrow(assertError) + expect(() => notNullable(undefined, assertErrorMessage)).toThrow(assertError) +}) diff --git a/src/utils/assert.ts b/src/utils/assert.ts index 667f156130d0..5e429b642115 100644 --- a/src/utils/assert.ts +++ b/src/utils/assert.ts @@ -1,20 +1,5 @@ import { notStrictEqual as notEqual, strictEqual as equal } from 'assert' -export class WithStateAssert { - private count = 0 - - /** - * Call this method in methods that should be only run once. - * If more than once then it could cause memory leak. - */ - public shouldOnlyRunOnce(msg: string = 'Potential memory leak detected') { - this.count += 1 - if (this.count > 1) { - console.warn(msg) - } - } -} - const notInclude = (val: unknown, things: unknown[], message: string) => { things.forEach(value => { notEqual(val, value, message) From f8e8857f6253af9d4ed20bfc91c1a7e7e37d100d Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Fri, 21 Feb 2020 21:30:27 +0800 Subject: [PATCH 13/70] test: add test for ios-rpc --- jest.config.js | 1 + scripts/jest-setup.js | 14 +++++++-- src/utils/__tests__/iOS-RPC.ts | 56 ++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 src/utils/__tests__/iOS-RPC.ts diff --git a/jest.config.js b/jest.config.js index 1530034efbf3..677ad4c8b94f 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,4 +1,5 @@ const path = require('path') + module.exports = { preset: 'ts-jest', testEnvironment: 'jest-environment-jsdom-fourteen', diff --git a/scripts/jest-setup.js b/scripts/jest-setup.js index f5fd45ef2899..afd4f230aa9e 100644 --- a/scripts/jest-setup.js +++ b/scripts/jest-setup.js @@ -23,6 +23,7 @@ require('webcrypto-liner/build/webcrypto-liner.shim') /* global TextEncoder, TextDecoder */ Object.assign(globalThis, require('@sinonjs/text-encoding/index')) +// TODO: // can not find a handy createRange and getSelection polyfill for jest // remove these polyfill if we find one in the future document.createRange = () => { @@ -30,20 +31,27 @@ document.createRange = () => { endContainer: null, selectNodeContents(element) { this.endContainer = element - } + }, } } globalThis.getSelection = () => { return { _ranges: [], rangeCount: 0, - removeAllRanges() { }, + removeAllRanges() {}, addRange(range) { this._ranges.push(range) this.rangeCount = this._ranges.length }, getRangeAt(index) { return this._ranges[index] - } + }, } } + +// webkit rpc handler +globalThis.webkit = globalThis.webkit || {} +globalThis.webkit.messageHandlers = globalThis.webkit.messageHandlers || {} +globalThis.webkit.messageHandlers.maskbookjsonrpc = { + postMessage(data) {}, +} diff --git a/src/utils/__tests__/iOS-RPC.ts b/src/utils/__tests__/iOS-RPC.ts new file mode 100644 index 000000000000..71402e4bcf37 --- /dev/null +++ b/src/utils/__tests__/iOS-RPC.ts @@ -0,0 +1,56 @@ +import { iOSHost } from '../iOS-RPC' + +const JSON_RPC_KEY = 'maskbookjsonrpc' + +// async-call-rpc use Math.random generate rpc id +beforeAll(() => { + ;(Math as any)._random = Math.random +}) + +afterAll(() => { + Math.random = (Math as any)._random + delete (Math as any)._random +}) + +function hijackRandomId() { + const num = Math.random() + const id = num.toString(36).slice(2) + + Math.random = () => num + return id +} + +function delayResponse(id: string, result: unknown, delay = 500) { + setTimeout(() => { + document.dispatchEvent( + new CustomEvent(JSON_RPC_KEY, { + detail: { + id, + result, + jsonrpc: '2.0', + }, + }), + ) + }, delay) +} + +test('scan QR code', async () => { + const id = hijackRandomId() + delayResponse(id, 'text') + await expect(iOSHost.scanQRCode()).resolves.toEqual('text') +}) + +test('log', async () => { + // @ts-ignore + const postMessageSpy = spyOn(globalThis.webkit.messageHandlers[JSON_RPC_KEY], 'postMessage') + const id = hijackRandomId() + + delayResponse(id, undefined) + await expect(iOSHost.log(1, 2, 3)).resolves.toBeUndefined() + expect(postMessageSpy).toHaveBeenCalled() + + const data = postMessageSpy.calls.first().args[0] + expect(data.id).toEqual(id) + expect(data.method).toEqual('log') + expect(data.params).toEqual([1, 2, 3]) +}) From fcd6e651093671033c38e96e2d0a08af70bc8a74 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Mon, 24 Feb 2020 12:47:04 +0800 Subject: [PATCH 14/70] fix: wait for set done --- src/utils/browser.storage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/browser.storage.ts b/src/utils/browser.storage.ts index d43288ac0c39..8eaaf52e2355 100644 --- a/src/utils/browser.storage.ts +++ b/src/utils/browser.storage.ts @@ -12,7 +12,7 @@ export async function getStorage(network: string): Promise> { export async function setStorage(network: string, item: Partial) { if (typeof browser === 'undefined' || !browser.storage) return const storage = await getStorage(network) - browser.storage.local.set({ + return browser.storage.local.set({ [network]: merge(storage, item), }) } From e8795866de7d0015406da66d2194bdb7236c7a97 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2020 11:24:35 +0000 Subject: [PATCH 15/70] chore(deps): bump i18next from 19.1.0 to 19.3.1 Bumps [i18next](https://github.com/i18next/i18next) from 19.1.0 to 19.3.1. - [Release notes](https://github.com/i18next/i18next/releases) - [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/i18next/compare/v19.1.0...v19.3.1) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2c2c4ea34d28..00da7ffcdbb2 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "elliptic": "^6.4.1", "gun": "0.2020.116", "husky": "^4.2.3", - "i18next": "^19.1.0", + "i18next": "^19.3.1", "idb": "^5.0.1", "json-stable-stringify": "^1.0.1", "jsonwebtoken": "^8.5.1", diff --git a/yarn.lock b/yarn.lock index 83a09190589a..18fcc8a45fe5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10159,10 +10159,10 @@ hyphenate-style-name@^1.0.3: resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.3.tgz#097bb7fa0b8f1a9cf0bd5c734cf95899981a9b48" integrity sha512-EcuixamT82oplpoJ2XU4pDtKGWQ7b00CD9f1ug9IaQ3p1bkHMiKCZ9ut9QDI6qsa6cpUuB+A/I+zLtdNK4n2DQ== -i18next@^19.1.0: - version "19.1.0" - resolved "https://registry.yarnpkg.com/i18next/-/i18next-19.1.0.tgz#fe1a1da3d208872946307c7d2d115da45d46159f" - integrity sha512-ISbmukX4L6Dz0QoH9+EW1AnBw7j+NRLoMu9uLPMaNSSTP9Eie9/oUL0dOyWX15baB3gYOpkHJpGZRHOqcnl0ew== +i18next@^19.3.1: + version "19.3.1" + resolved "https://registry.yarnpkg.com/i18next/-/i18next-19.3.1.tgz#b8e1adb1e3297f240af98382724967f9895096e3" + integrity sha512-fSd67ADNfVtffECirge69OBChESzdJgXMVa8cmnR96mHn+rB2lTmNE5bqwPz32aufAKOV1LHwOTAepG+P9QbjA== dependencies: "@babel/runtime" "^7.3.1" From a626a67f34f840e2805425611f0b1024f59a4844 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2020 11:25:39 +0000 Subject: [PATCH 16/70] chore(deps-dev): bump ts-jest from 25.2.0 to 25.2.1 Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 25.2.0 to 25.2.1. - [Release notes](https://github.com/kulshekhar/ts-jest/releases) - [Changelog](https://github.com/kulshekhar/ts-jest/blob/master/CHANGELOG.md) - [Commits](https://github.com/kulshekhar/ts-jest/compare/v25.2.0...25.2.1) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 00da7ffcdbb2..fc0da14e6b1d 100644 --- a/package.json +++ b/package.json @@ -142,7 +142,7 @@ "storybook-addon-i18n": "^5.1.13", "storybook-addon-material-ui": "^0.9.0-alpha.21", "terser-webpack-plugin": "^2.3.4", - "ts-jest": "^25.2.0", + "ts-jest": "^25.2.1", "ts-loader": "^6.2.1", "ts-morph": "^6.0.3", "ts-node": "^8.6.2", diff --git a/yarn.lock b/yarn.lock index 18fcc8a45fe5..c0880b080ef9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18131,10 +18131,10 @@ ts-generator@^0.0.8: resolve "^1.8.1" ts-essentials "^1.0.0" -ts-jest@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-25.2.0.tgz#dfd87c2b71ef4867f5a0a44f40cb9c67e02991ac" - integrity sha512-VaRdb0da46eorLfuHEFf0G3d+jeREcV+Wb/SvW71S4y9Oe8SHWU+m1WY/3RaMknrBsnvmVH0/rRjT8dkgeffNQ== +ts-jest@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-25.2.1.tgz#49bf05da26a8b7fbfbc36b4ae2fcdc2fef35c85d" + integrity sha512-TnntkEEjuXq/Gxpw7xToarmHbAafgCaAzOpnajnFC6jI7oo1trMzAHA04eWpc3MhV6+yvhE8uUBAmN+teRJh0A== dependencies: bs-logger "0.x" buffer-from "1.x" @@ -18145,7 +18145,7 @@ ts-jest@^25.2.0: mkdirp "0.x" resolve "1.x" semver "^5.5" - yargs-parser "10.x" + yargs-parser "^16.1.0" ts-lib-utils@^2.2.0: version "2.2.0" @@ -20165,7 +20165,7 @@ yaml@^1.7.2: dependencies: "@babel/runtime" "^7.6.3" -yargs-parser@10.x, yargs-parser@^10.0.0: +yargs-parser@^10.0.0: version "10.1.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" integrity sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ== From c825e3cadac63251e05c23a724ed1ba6e25d73ed Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2020 11:26:48 +0000 Subject: [PATCH 17/70] chore(deps-dev): bump @typescript-eslint/eslint-plugin Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.19.2 to 2.20.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.20.0/packages/eslint-plugin) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 32 +++++++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index fc0da14e6b1d..eb2d33c8f7c5 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "@storybook/react": "^5.3.12", "@trust/webcrypto": "^0.9.2", "@types/jest": "^25.1.2", - "@typescript-eslint/eslint-plugin": "^2.19.2", + "@typescript-eslint/eslint-plugin": "^2.20.0", "@typescript-eslint/parser": "^2.19.2", "asmcrypto.js": "^2.3.2", "awesome-typescript-loader": "^5.2.1", diff --git a/yarn.lock b/yarn.lock index c0880b080ef9..8f79b23b8167 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3746,12 +3746,12 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^2.19.2": - version "2.19.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.19.2.tgz#e279aaae5d5c1f2547b4cff99204e1250bc7a058" - integrity sha512-HX2qOq2GOV04HNrmKnTpSIpHjfl7iwdXe3u/Nvt+/cpmdvzYvY0NHSiTkYN257jHnq4OM/yo+OsFgati+7LqJA== +"@typescript-eslint/eslint-plugin@^2.20.0": + version "2.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.20.0.tgz#a522d0e1e4898f7c9c6a8e1ed3579b60867693fa" + integrity sha512-cimIdVDV3MakiGJqMXw51Xci6oEDEoPkvh8ggJe2IIzcc0fYqAxOXN6Vbeanahz6dLZq64W+40iUEc9g32FLDQ== dependencies: - "@typescript-eslint/experimental-utils" "2.19.2" + "@typescript-eslint/experimental-utils" "2.20.0" eslint-utils "^1.4.3" functional-red-black-tree "^1.0.1" regexpp "^3.0.0" @@ -3766,6 +3766,15 @@ "@typescript-eslint/typescript-estree" "2.19.2" eslint-scope "^5.0.0" +"@typescript-eslint/experimental-utils@2.20.0": + version "2.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.20.0.tgz#3b6fa5a6b8885f126d5a4280e0d44f0f41e73e32" + integrity sha512-fEBy9xYrwG9hfBLFEwGW2lKwDRTmYzH3DwTmYbT+SMycmxAoPl0eGretnBFj/s+NfYBG63w/5c3lsvqqz5mYag== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "2.20.0" + eslint-scope "^5.0.0" + "@typescript-eslint/parser@^2.19.2": version "2.19.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.19.2.tgz#21f42c0694846367e7d6a907feb08ab2f89c0879" @@ -3789,6 +3798,19 @@ semver "^6.3.0" tsutils "^3.17.1" +"@typescript-eslint/typescript-estree@2.20.0": + version "2.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.20.0.tgz#90a0f5598826b35b966ca83483b1a621b1a4d0c9" + integrity sha512-WlFk8QtI8pPaE7JGQGxU7nGcnk1ccKAJkhbVookv94ZcAef3m6oCE/jEDL6dGte3JcD7reKrA0o55XhBRiVT3A== + dependencies: + debug "^4.1.1" + eslint-visitor-keys "^1.1.0" + glob "^7.1.6" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^6.3.0" + tsutils "^3.17.1" + "@unimodules/core@*": version "5.0.0" resolved "https://registry.yarnpkg.com/@unimodules/core/-/core-5.0.0.tgz#e1e3ca3f91f3d27dbc93c6eebc03a40c711da755" From 7dd77dda6740d0ba23c3254000dfdd2695f62ec7 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2020 11:26:53 +0000 Subject: [PATCH 18/70] chore(deps-dev): bump @storybook/react from 5.3.12 to 5.3.13 Bumps [@storybook/react](https://github.com/storybookjs/storybook/tree/HEAD/app/react) from 5.3.12 to 5.3.13. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v5.3.13/app/react) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 140 ++++++++++++++++----------------------------------- 2 files changed, 44 insertions(+), 98 deletions(-) diff --git a/package.json b/package.json index eb2d33c8f7c5..0a3a38998a8f 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "@storybook/addon-viewport": "^5.3.13", "@storybook/addons": "^5.3.12", "@storybook/preset-typescript": "^1.2.0", - "@storybook/react": "^5.3.12", + "@storybook/react": "^5.3.13", "@trust/webcrypto": "^0.9.2", "@types/jest": "^25.1.2", "@typescript-eslint/eslint-plugin": "^2.20.0", diff --git a/yarn.lock b/yarn.lock index 8f79b23b8167..237838d38d38 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2947,26 +2947,26 @@ dependencies: core-js "^3.0.1" -"@storybook/core@5.3.12": - version "5.3.12" - resolved "https://registry.yarnpkg.com/@storybook/core/-/core-5.3.12.tgz#972cec3c7ee3e78a628a017c0b72bb6a52d9146d" - integrity sha512-oqffKLyMEVREeOC8O1RVO+xn68zk4wZkjWN9KbhbMoP3zdxM1gdvpsemdVE1C008mZfe1A/KBwuuEmcn9EBTNw== +"@storybook/core@5.3.13": + version "5.3.13" + resolved "https://registry.yarnpkg.com/@storybook/core/-/core-5.3.13.tgz#a6653befc867aa46bb53b43c1f4b8c51a9aa5845" + integrity sha512-HS//95j14XOb9ChYJBDHyZKAqFD2WsUh1q7sMMynSpKgHJjyfYI12rwxH5vDIrJ7CLBQbrMWrgOITjB9/cLJKA== dependencies: "@babel/plugin-proposal-class-properties" "^7.7.0" "@babel/plugin-proposal-object-rest-spread" "^7.6.2" "@babel/plugin-syntax-dynamic-import" "^7.2.0" "@babel/plugin-transform-react-constant-elements" "^7.2.0" "@babel/preset-env" "^7.4.5" - "@storybook/addons" "5.3.12" - "@storybook/channel-postmessage" "5.3.12" - "@storybook/client-api" "5.3.12" - "@storybook/client-logger" "5.3.12" - "@storybook/core-events" "5.3.12" + "@storybook/addons" "5.3.13" + "@storybook/channel-postmessage" "5.3.13" + "@storybook/client-api" "5.3.13" + "@storybook/client-logger" "5.3.13" + "@storybook/core-events" "5.3.13" "@storybook/csf" "0.0.1" - "@storybook/node-logger" "5.3.12" - "@storybook/router" "5.3.12" - "@storybook/theming" "5.3.12" - "@storybook/ui" "5.3.12" + "@storybook/node-logger" "5.3.13" + "@storybook/router" "5.3.13" + "@storybook/theming" "5.3.13" + "@storybook/ui" "5.3.13" airbnb-js-shims "^2.2.1" ansi-to-html "^0.6.11" autoprefixer "^9.7.2" @@ -3033,10 +3033,10 @@ dependencies: lodash "^4.17.15" -"@storybook/node-logger@5.3.12": - version "5.3.12" - resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-5.3.12.tgz#df25b725583cb5aa799b6c5b8103a8ea0921d3ba" - integrity sha512-ytIqS1Lx+gWFBNxwWOK7F63702YYsoU90UFQNUMC44lC1L7tOI9BQXtGIWTvmXJYns+O5pHHOVKkHLT9EGX2OA== +"@storybook/node-logger@5.3.13": + version "5.3.13" + resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-5.3.13.tgz#f41c611c3b200add8d85777f19970bdabaa94634" + integrity sha512-ZpuyKALHq/ZyynXnsW254JaULWZLPBFw007tkJhE5z/CLy059cIVovQhX/8Ivt3FG3qwWmcqQ0ISHFi0dJpqnA== dependencies: "@types/npmlog" "^4.1.2" chalk "^3.0.0" @@ -3057,17 +3057,17 @@ resolved "https://registry.yarnpkg.com/@storybook/preset-typescript/-/preset-typescript-1.2.0.tgz#f4b32f7d8ded507cea662372a6730902d02b504c" integrity sha512-GQKTgMkhOyi+UC6kHTnVKCDwIO5qO0WsT1VzCOnbmShSKez/e6/GXs+/zyw3C56KU6gQHQpV10CJizFJozJWDw== -"@storybook/react@^5.3.12": - version "5.3.12" - resolved "https://registry.yarnpkg.com/@storybook/react/-/react-5.3.12.tgz#efe4ec2f66c8299a2f54157d5cb77ca657404e12" - integrity sha512-eMbnzXizx0rp3UEnxZlySBI/z1Z/ursw0u2bFr2N9okzOio3yLSoDeMuB6BzZxDLkSgfQAw2qHtJa0eddjxoRQ== +"@storybook/react@^5.3.13": + version "5.3.13" + resolved "https://registry.yarnpkg.com/@storybook/react/-/react-5.3.13.tgz#b2daa820ffce6cd07d52e89d9ac823b9f5562637" + integrity sha512-McBwRjGbe6vgjSqdcDtVxKyjGhRGBaN6JLsRr/Bi49KM/sw9SpXuoYxCQVQjK5jMpUV+1UeEpS/5j7HNeVc6YA== dependencies: "@babel/plugin-transform-react-constant-elements" "^7.6.3" "@babel/preset-flow" "^7.0.0" "@babel/preset-react" "^7.0.0" - "@storybook/addons" "5.3.12" - "@storybook/core" "5.3.12" - "@storybook/node-logger" "5.3.12" + "@storybook/addons" "5.3.13" + "@storybook/core" "5.3.13" + "@storybook/node-logger" "5.3.13" "@svgr/webpack" "^4.0.3" "@types/webpack-env" "^1.15.0" babel-plugin-add-react-displayname "^0.0.5" @@ -3076,7 +3076,7 @@ core-js "^3.0.1" global "^4.3.2" lodash "^4.17.15" - mini-css-extract-plugin "^0.9.0" + mini-css-extract-plugin "^0.7.0" prop-types "^15.7.2" react-dev-utils "^9.0.0" regenerator-runtime "^0.13.3" @@ -3195,20 +3195,20 @@ resolve-from "^5.0.0" ts-dedent "^1.1.0" -"@storybook/ui@5.3.12": - version "5.3.12" - resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-5.3.12.tgz#c66f6a1302d2ff80a8b94402d95648d1b28066f8" - integrity sha512-dVYJJkwjfGkz3u0lnfawnT6hqBRnANVlKEYirKYZyQ/RouCN3naNh9Sagrpg7hJHYib4Ny6J/pyaNdfdieDS+w== +"@storybook/ui@5.3.13": + version "5.3.13" + resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-5.3.13.tgz#c829bc1cbcd0995e4888056a9f43fbf8a7c22ee4" + integrity sha512-pEXWFPF097OjvbgwvMjLsjLsDViu6yBMmUcL+nd3jvtxyxkuzv5X+2J14N8Nz0veJysbp+5+5A8kKGTO+spZfA== dependencies: "@emotion/core" "^10.0.20" - "@storybook/addons" "5.3.12" - "@storybook/api" "5.3.12" - "@storybook/channels" "5.3.12" - "@storybook/client-logger" "5.3.12" - "@storybook/components" "5.3.12" - "@storybook/core-events" "5.3.12" - "@storybook/router" "5.3.12" - "@storybook/theming" "5.3.12" + "@storybook/addons" "5.3.13" + "@storybook/api" "5.3.13" + "@storybook/channels" "5.3.13" + "@storybook/client-logger" "5.3.13" + "@storybook/components" "5.3.13" + "@storybook/core-events" "5.3.13" + "@storybook/router" "5.3.13" + "@storybook/theming" "5.3.13" copy-to-clipboard "^3.0.8" core-js "^3.0.1" core-js-pure "^3.0.1" @@ -6613,7 +6613,7 @@ core-js-pure@^3.0.1: resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.2.1.tgz#879a23699cff46175bfd2d09158b5c50645a3c45" integrity sha512-+qpvnYrsi/JDeQTArB7NnNc2VoMYLE1YSkziCDHgjexC2KH7OFiGhLUd3urxfyWmNjSwSW7NYXPWHMhuIJx9Ow== -core-js@3.6.4: +core-js@3.6.4, core-js@^3.0.1, core-js@^3.0.4, core-js@^3.1.4: version "3.6.4" resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.4.tgz#440a83536b458114b9cb2ac1580ba377dc470647" integrity sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw== @@ -6628,11 +6628,6 @@ core-js@^2.4.0, core-js@^2.5.0, core-js@^2.5.3, core-js@^2.6.5: resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c" integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg== -core-js@^3.0.1, core-js@^3.0.4, core-js@^3.1.4: - version "3.6.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.0.tgz#2b854e451de1967d1e29896025cdc13a2518d9ea" - integrity sha512-AHPTNKzyB+YwgDWoSOCaid9PUSEF6781vsfiK8qUz62zRR448/XgK2NtCbpiUGizbep8Lrpt0Du19PpGGZvw3Q== - core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -13016,10 +13011,10 @@ mini-create-react-context@^0.3.0: gud "^1.0.0" tiny-warning "^1.0.2" -mini-css-extract-plugin@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz#47f2cf07aa165ab35733b1fc97d4c46c0564339e" - integrity sha512-lp3GeY7ygcgAmVIcRPBVhIkf8Us7FZjA+ILpal44qLdSu11wmjKQ3d9k15lfD7pO4esu9eUIAW7qiYIBppv40A== +mini-css-extract-plugin@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.7.0.tgz#5ba8290fbb4179a43dd27cca444ba150bee743a0" + integrity sha512-RQIw6+7utTYn8DBGsf/LpRgZCJMpZt+kuawJ/fju0KiOL6nAaTBNmCJwS7HtwSCXfS47gCkmtBFS7HdsquhdxQ== dependencies: loader-utils "^1.1.0" normalize-url "1.9.1" @@ -16523,11 +16518,6 @@ send@0.17.1: range-parser "~1.2.1" statuses "~1.5.0" -serialize-javascript@^1.7.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.9.1.tgz#cfc200aef77b600c47da9bb8149c943e798c2fdb" - integrity sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A== - serialize-javascript@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61" @@ -17719,21 +17709,6 @@ terminal-link@^2.0.0: ansi-escapes "^4.2.1" supports-hyperlinks "^2.0.0" -terser-webpack-plugin@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.1.tgz#61b18e40eaee5be97e771cdbb10ed1280888c2b4" - integrity sha512-ZXmmfiwtCLfz8WKZyYUuuHf3dMYEjg8NrjHMb0JqHVHVOSkzp3cW2/XG1fP3tRhqEqSzMwzzRQGtAPbs4Cncxg== - dependencies: - cacache "^12.0.2" - find-cache-dir "^2.1.0" - is-wsl "^1.1.0" - schema-utils "^1.0.0" - serialize-javascript "^1.7.0" - source-map "^0.6.1" - terser "^4.1.2" - webpack-sources "^1.4.0" - worker-farm "^1.7.0" - terser-webpack-plugin@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz#5ecaf2dbdc5fb99745fd06791f46fc9ddb1c9a7c" @@ -19720,36 +19695,7 @@ webpack-virtual-modules@^0.2.0: dependencies: inquirer "^7.0.0" -webpack@^4.33.0, webpack@^4.38.0: - version "4.41.2" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.41.2.tgz#c34ec76daa3a8468c9b61a50336d8e3303dce74e" - integrity sha512-Zhw69edTGfbz9/8JJoyRQ/pq8FYUoY0diOXqW0T6yhgdhCv6wr0hra5DwwWexNRns2Z2+gsnrNcbe9hbGBgk/A== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/helper-module-context" "1.8.5" - "@webassemblyjs/wasm-edit" "1.8.5" - "@webassemblyjs/wasm-parser" "1.8.5" - acorn "^6.2.1" - ajv "^6.10.2" - ajv-keywords "^3.4.1" - chrome-trace-event "^1.0.2" - enhanced-resolve "^4.1.0" - eslint-scope "^4.0.3" - json-parse-better-errors "^1.0.2" - loader-runner "^2.4.0" - loader-utils "^1.2.3" - memory-fs "^0.4.1" - micromatch "^3.1.10" - mkdirp "^0.5.1" - neo-async "^2.6.1" - node-libs-browser "^2.2.1" - schema-utils "^1.0.0" - tapable "^1.1.3" - terser-webpack-plugin "^1.4.1" - watchpack "^1.6.0" - webpack-sources "^1.4.1" - -webpack@^4.41.6: +webpack@^4.33.0, webpack@^4.38.0, webpack@^4.41.6: version "4.41.6" resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.41.6.tgz#12f2f804bf6542ef166755050d4afbc8f66ba7e1" integrity sha512-yxXfV0Zv9WMGRD+QexkZzmGIh54bsvEs+9aRWxnN8erLWEOehAKUTeNBoUbA6HPEZPlRo7KDi2ZcNveoZgK9MA== From cbaa845e31962344aa5b4836ad7cdec58d626881 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2020 11:27:26 +0000 Subject: [PATCH 19/70] chore(deps-dev): bump @storybook/addon-docs from 5.3.12 to 5.3.13 Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 5.3.12 to 5.3.13. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v5.3.13/addons/docs) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 113 ++++++++++++--------------------------------------- 2 files changed, 28 insertions(+), 87 deletions(-) diff --git a/package.json b/package.json index 0a3a38998a8f..7bd09c6ce5e3 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "@commitlint/config-conventional": "^8.3.4", "@sinonjs/text-encoding": "^0.7.1", "@storybook/addon-actions": "^5.3.13", - "@storybook/addon-docs": "^5.3.12", + "@storybook/addon-docs": "^5.3.13", "@storybook/addon-info": "^5.3.12", "@storybook/addon-knobs": "^5.3.12", "@storybook/addon-links": "^5.3.12", diff --git a/yarn.lock b/yarn.lock index 237838d38d38..6fbb925b5298 100644 --- a/yarn.lock +++ b/yarn.lock @@ -88,7 +88,7 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.4.0", "@babel/generator@^7.8.0", "@babel/generator@^7.8.4": +"@babel/generator@^7.4.0", "@babel/generator@^7.8.0", "@babel/generator@^7.8.3", "@babel/generator@^7.8.4": version "7.8.4" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.8.4.tgz#35bbc74486956fe4251829f9f6c48330e8d0985e" integrity sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA== @@ -98,16 +98,6 @@ lodash "^4.17.13" source-map "^0.5.0" -"@babel/generator@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.8.3.tgz#0e22c005b0a94c1c74eafe19ef78ce53a4d45c03" - integrity sha512-WjoPk8hRpDRqqzRpvaR8/gDUPkrnOOeuT2m8cNICJtZH6mwaCo3v0OKMI7Y6SM1pBtyijnLtAL0HDi41pf41ug== - dependencies: - "@babel/types" "^7.8.3" - jsesc "^2.5.1" - lodash "^4.17.13" - source-map "^0.5.0" - "@babel/helper-annotate-as-pure@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" @@ -138,14 +128,6 @@ "@babel/helper-explode-assignable-expression" "^7.8.3" "@babel/types" "^7.8.3" -"@babel/helper-builder-react-jsx@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.7.4.tgz#da188d247508b65375b2c30cf59de187be6b0c66" - integrity sha512-kvbfHJNN9dg4rkEM4xn1s8d1/h6TYNvajy9L1wx4qLn9HFg0IkTsQi4rfBe92nxrPUFcMsHoMV+8rU7MJb3fCA== - dependencies: - "@babel/types" "^7.7.4" - esutils "^2.0.0" - "@babel/helper-builder-react-jsx@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.8.3.tgz#dee98d7d79cc1f003d80b76fe01c7f8945665ff6" @@ -565,12 +547,7 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.3.tgz#790874091d2001c9be6ec426c2eed47bc7679081" - integrity sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ== - -"@babel/parser@^7.1.6", "@babel/parser@^7.4.2", "@babel/parser@^7.4.3", "@babel/parser@^7.6.0", "@babel/parser@^7.7.5", "@babel/parser@^7.8.0", "@babel/parser@^7.8.4": +"@babel/parser@^7.1.0", "@babel/parser@^7.1.6", "@babel/parser@^7.4.2", "@babel/parser@^7.4.3", "@babel/parser@^7.6.0", "@babel/parser@^7.7.5", "@babel/parser@^7.8.0", "@babel/parser@^7.8.3", "@babel/parser@^7.8.4": version "7.8.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.4.tgz#d1dbe64691d60358a974295fa53da074dd2ce8e8" integrity sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw== @@ -1280,7 +1257,7 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-jsx" "^7.7.4" -"@babel/plugin-transform-react-jsx@^7.3.0": +"@babel/plugin-transform-react-jsx@^7.3.0", "@babel/plugin-transform-react-jsx@^7.7.4": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.8.3.tgz#4220349c0390fdefa505365f68c103562ab2fc4a" integrity sha512-r0h+mUiyL595ikykci+fbwm9YzmuOrUBi0b+FDIKmi3fPQyFokWVEMJnRWHJPPQEjyFJyna9WZC6Viv6UHSv1g== @@ -1289,15 +1266,6 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-jsx" "^7.8.3" -"@babel/plugin-transform-react-jsx@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.7.4.tgz#d91205717fae4e2f84d020cd3057ec02a10f11da" - integrity sha512-LixU4BS95ZTEAZdPaIuyg/k8FiiqN9laQ0dMHB4MlpydHY53uQdWCUrwjLr5o6ilS6fAgZey4Q14XBjl5tL6xw== - dependencies: - "@babel/helper-builder-react-jsx" "^7.7.4" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-jsx" "^7.7.4" - "@babel/plugin-transform-regenerator@^7.4.5": version "7.4.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.5.tgz#629dc82512c55cee01341fb27bdfcb210354680f" @@ -2489,10 +2457,10 @@ react-inspector "^4.0.0" uuid "^3.3.2" -"@storybook/addon-docs@^5.3.12": - version "5.3.12" - resolved "https://registry.yarnpkg.com/@storybook/addon-docs/-/addon-docs-5.3.12.tgz#dc3c222d856f4d92de2feb6ac513680739aac15d" - integrity sha512-igAV/mOgk8B3rptB/mT5hS37PLjFJCZkYclydCVAg70z5mm1DT0AvUQtntwSNzzB/rPB/ajtghtE4nxTfCBLkw== +"@storybook/addon-docs@^5.3.13": + version "5.3.13" + resolved "https://registry.yarnpkg.com/@storybook/addon-docs/-/addon-docs-5.3.13.tgz#6d54d5b074d0678822a80b592e99aea62a58b59f" + integrity sha512-M4U+DqvP8XTQvymrmMQdBwxrJQ2jVthPLbeWTwz09Jsz+YIcY+Itkpv3jxDlRTkq3Qe+Dr6FfZnGW9jz8D6d2Q== dependencies: "@babel/generator" "^7.4.0" "@babel/parser" "^7.4.2" @@ -2502,14 +2470,14 @@ "@mdx-js/loader" "^1.5.1" "@mdx-js/mdx" "^1.5.1" "@mdx-js/react" "^1.5.1" - "@storybook/addons" "5.3.12" - "@storybook/api" "5.3.12" - "@storybook/components" "5.3.12" - "@storybook/core-events" "5.3.12" + "@storybook/addons" "5.3.13" + "@storybook/api" "5.3.13" + "@storybook/components" "5.3.13" + "@storybook/core-events" "5.3.13" "@storybook/csf" "0.0.1" - "@storybook/postinstall" "5.3.12" - "@storybook/source-loader" "5.3.12" - "@storybook/theming" "5.3.12" + "@storybook/postinstall" "5.3.13" + "@storybook/source-loader" "5.3.13" + "@storybook/theming" "5.3.13" acorn "^7.1.0" acorn-jsx "^5.1.0" acorn-walk "^7.0.0" @@ -3045,10 +3013,10 @@ pretty-hrtime "^1.0.3" regenerator-runtime "^0.13.3" -"@storybook/postinstall@5.3.12": - version "5.3.12" - resolved "https://registry.yarnpkg.com/@storybook/postinstall/-/postinstall-5.3.12.tgz#78361c634bc3bdaaef9974dcc9b29ceb0aadd8ff" - integrity sha512-PYBnPL9pYdMfpbtq8Nxrx0e24Gt4jcsyZ1P5s4vCJ/a9jZCxL8C6MZ7/a8qIDcvp3hukbMw1Yr6baDQM1efx1g== +"@storybook/postinstall@5.3.13": + version "5.3.13" + resolved "https://registry.yarnpkg.com/@storybook/postinstall/-/postinstall-5.3.13.tgz#4841aec958741aeee820ccab32891c87b462d081" + integrity sha512-JKPEywK+x4vF8GW2/KoeAIMaNlTkuBBgWwO9DdT5d99TMxxSeJmdQkaAwOaCZeWxBs8z3eC4VIkRHksw0sBSkw== dependencies: core-js "^3.0.1" @@ -3125,13 +3093,13 @@ qs "^6.6.0" util-deprecate "^1.0.2" -"@storybook/source-loader@5.3.12": - version "5.3.12" - resolved "https://registry.yarnpkg.com/@storybook/source-loader/-/source-loader-5.3.12.tgz#b3ed2fc62ff38b66fcb831a9c1003cb71c41dae6" - integrity sha512-+l85iXo1qp0Yvw792uSqizzgPzdksILYMzDnXiqiLU4oPKb8GMcwGHC6RwLsUqGA0ZA/Smls8mvbdCEXjRRlnw== +"@storybook/source-loader@5.3.13": + version "5.3.13" + resolved "https://registry.yarnpkg.com/@storybook/source-loader/-/source-loader-5.3.13.tgz#9ab1bf674652f6d54c26acf873b69a3743e08248" + integrity sha512-veRpTmbG3Mej8EgqB2sludfOWPGv4mfzxTCHIt6Lo3K54b8Hv5ffPkYlaj0o8yJL6hvwfbSuKVjsN0M6n/+eyA== dependencies: - "@storybook/addons" "5.3.12" - "@storybook/client-logger" "5.3.12" + "@storybook/addons" "5.3.13" + "@storybook/client-logger" "5.3.13" "@storybook/csf" "0.0.1" core-js "^3.0.1" estraverse "^4.2.0" @@ -4083,12 +4051,7 @@ acorn-jsx@^3.0.0: dependencies: acorn "^3.0.4" -acorn-jsx@^5.0.0: - version "5.0.2" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.2.tgz#84b68ea44b373c4f8686023a551f61a21b7c4a4f" - integrity sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw== - -acorn-jsx@^5.1.0: +acorn-jsx@^5.0.0, acorn-jsx@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.1.0.tgz#294adb71b57398b0680015f0a38c563ee1db5384" integrity sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw== @@ -4118,12 +4081,7 @@ acorn@^5.5.0, acorn@^5.5.3: resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== -acorn@^6.0.1, acorn@^6.0.7, acorn@^6.2.1: - version "6.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.3.0.tgz#0087509119ffa4fc0a0041d1e93a417e68cb856e" - integrity sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA== - -acorn@^6.0.4: +acorn@^6.0.1, acorn@^6.0.4, acorn@^6.0.7, acorn@^6.2.1: version "6.4.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.0.tgz#b659d2ffbafa24baf5db1cdbb2c94a983ecd2784" integrity sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw== @@ -7953,7 +7911,7 @@ escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1 resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -escodegen@^1.11.0, escodegen@^1.11.1, escodegen@^1.12.0: +escodegen@^1.11.0, escodegen@^1.11.1, escodegen@^1.12.0, escodegen@^1.9.1: version "1.14.1" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.1.tgz#ba01d0c8278b5e95a9a45350142026659027a457" integrity sha512-Bmt7NcRySdIfNPfU2ZoXDrrXsG9ZjvDxcAlMfDUgRBjLOWTuIACXPBFJH7Z+cLb40JeQco5toikyc9t9P8E9SQ== @@ -7965,18 +7923,6 @@ escodegen@^1.11.0, escodegen@^1.11.1, escodegen@^1.12.0: optionalDependencies: source-map "~0.6.1" -escodegen@^1.9.1: - version "1.12.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.12.0.tgz#f763daf840af172bb3a2b6dd7219c0e17f7ff541" - integrity sha512-TuA+EhsanGcme5T3R0L80u4t8CpbXQjegRmf7+FPTJrtCTErXFeelblRgHQa1FofEzqYYJmJ/OqjTwREp9qgmg== - dependencies: - esprima "^3.1.3" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - escope@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" @@ -8237,11 +8183,6 @@ esprima@4.0.1, esprima@^4.0.0, esprima@^4.0.1, esprima@~4.0.0: resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esprima@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= - esquery@^1.0.0, esquery@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" From ec1277a66d780d3032c8940b5b2eab97ae295219 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2020 11:27:48 +0000 Subject: [PATCH 20/70] chore(deps): bump @types/node from 13.7.1 to 13.7.4 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 13.7.1 to 13.7.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 7bd09c6ce5e3..fd186bb09ab6 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "@types/json-stable-stringify": "^1.0.32", "@types/jsonwebtoken": "^8.3.7", "@types/lodash-es": "^4.17.3", - "@types/node": "^13.7.1", + "@types/node": "^13.7.4", "@types/qrcode": "^1.3.3", "@types/react": "^16.9.19", "@types/react-dom": "^16.9.5", diff --git a/yarn.lock b/yarn.lock index 6fbb925b5298..d4bf7bbb8718 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3529,10 +3529,10 @@ dependencies: "@types/node" "*" -"@types/node@*", "@types/node@^13.7.1": - version "13.7.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-13.7.1.tgz#238eb34a66431b71d2aaddeaa7db166f25971a0d" - integrity sha512-Zq8gcQGmn4txQEJeiXo/KiLpon8TzAl0kmKH4zdWctPj05nWwp1ClMdAVEloqrQKfaC48PNLdgN/aVaLqUrluA== +"@types/node@*", "@types/node@^13.7.4": + version "13.7.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-13.7.4.tgz#76c3cb3a12909510f52e5dc04a6298cdf9504ffd" + integrity sha512-oVeL12C6gQS/GAExndigSaLxTrKpQPxewx9bOcwfvJiJge4rr7wNaph4J+ns5hrmIV2as5qxqN8YKthn9qh0jw== "@types/node@11.11.6": version "11.11.6" From 77d86a68e71b664ca46929ca21b3940e98132136 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2020 11:28:17 +0000 Subject: [PATCH 21/70] chore(deps): bump typeson-registry from 1.0.0-alpha.34 to 1.0.0-alpha.35 Bumps [typeson-registry](https://github.com/dfahlander/typeson-registry) from 1.0.0-alpha.34 to 1.0.0-alpha.35. - [Release notes](https://github.com/dfahlander/typeson-registry/releases) - [Changelog](https://github.com/dfahlander/typeson-registry/blob/master/CHANGES.md) - [Commits](https://github.com/dfahlander/typeson-registry/compare/v1.0.0-alpha.34...v1.0.0-alpha.35) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 24 +++++------------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index fd186bb09ab6..586981696870 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "tiny-secp256k1": "^1.1.2", "ts-results": "^2.0.1", "typeson": "^5.18.2", - "typeson-registry": "^1.0.0-alpha.34", + "typeson-registry": "^1.0.0-alpha.35", "use-subscription": "^1.3.0", "uuid": "^3.4.0", "wallet.ts": "^0.2.8", diff --git a/yarn.lock b/yarn.lock index d4bf7bbb8718..3d4321dd21a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18258,30 +18258,16 @@ typescript@^3.7.5, typescript@~3.7.2: resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae" integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw== -typeson-registry@^1.0.0-alpha.20: - version "1.0.0-alpha.33" - resolved "https://registry.yarnpkg.com/typeson-registry/-/typeson-registry-1.0.0-alpha.33.tgz#4742511d81a04e1ba9c0f5a71a0f4278beaa4949" - integrity sha512-q0jMkVizN10rzPtPcwkUC+pAOlA4iq4tl/GJ0iHDuMCnK3HxaN26bR/SczedswPBt0Pd+c0GjXZDDK+Cn2pgwg== - dependencies: - base64-arraybuffer-es6 "0.5.0" - typeson "5.18.1" - whatwg-url "7.1.0" - -typeson-registry@^1.0.0-alpha.34: - version "1.0.0-alpha.34" - resolved "https://registry.yarnpkg.com/typeson-registry/-/typeson-registry-1.0.0-alpha.34.tgz#1651a87c428fadadc17a453a7de10a9bac7a4930" - integrity sha512-2U0R5eFGJPaqha8HBAICJv6rW2x/cAVHizURHbcAo61Mpd47s+MDn67Ktxoyl9jWgsqCAibZsrldG8v/2ZuCaw== +typeson-registry@^1.0.0-alpha.20, typeson-registry@^1.0.0-alpha.35: + version "1.0.0-alpha.35" + resolved "https://registry.yarnpkg.com/typeson-registry/-/typeson-registry-1.0.0-alpha.35.tgz#b86abfe440e6ee69102eebb0e8c5a916dd182ff9" + integrity sha512-a/NffrpFswBTyU6w2d6vjk62K1TZ45H64af9AfRbn7LXqNEfL+h+gw3OV2IaG+enfwqgLB5WmbkrNBaQuc/97A== dependencies: base64-arraybuffer-es6 "0.5.0" typeson "5.18.2" whatwg-url "7.1.0" -typeson@5.18.1, typeson@^5.8.2: - version "5.18.1" - resolved "https://registry.yarnpkg.com/typeson/-/typeson-5.18.1.tgz#fafa2dfd6ef26448ff635a3c97dd39a4bd3cf742" - integrity sha512-4cVDwf4tT+9hpeQk22/ioQJXL8lN3AYlzJfJLBpB0MDPG7CGpbvxR0HBkQ6qp9T72/yzryP6k2HSVdxd3jF5qg== - -typeson@5.18.2, typeson@^5.18.2: +typeson@5.18.2, typeson@^5.18.2, typeson@^5.8.2: version "5.18.2" resolved "https://registry.yarnpkg.com/typeson/-/typeson-5.18.2.tgz#0d217fc0e11184a66aa7ca0076d9aa7707eb7bc2" integrity sha512-Vetd+OGX05P4qHyHiSLdHZ5Z5GuQDrHHwSdjkqho9NSCYVSLSfRMjklD/unpHH8tXBR9Z/R05rwJSuMpMFrdsw== From fe01811d27161c3f66849f75cc2f341a7985cb94 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2020 11:25:09 +0000 Subject: [PATCH 22/70] chore(deps-dev): bump fork-ts-checker-webpack-plugin from 4.0.3 to 4.0.4 Bumps [fork-ts-checker-webpack-plugin](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin) from 4.0.3 to 4.0.4. - [Release notes](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/releases) - [Changelog](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/compare/v4.0.3...v4.0.4) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 586981696870..81fb833d58c1 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,7 @@ "esm": "^3.2.25", "fake-indexeddb": "^3.0.0", "fork-ts-checker-notifier-webpack-plugin": "^2.0.0", - "fork-ts-checker-webpack-plugin": "^4.0.3", + "fork-ts-checker-webpack-plugin": "^4.0.4", "html-webpack-plugin": "^4.0.0-beta.11", "jest": "^25.1.0", "jest-environment-jsdom-fourteen": "^1.0.1", diff --git a/yarn.lock b/yarn.lock index 3d4321dd21a7..da94e002f998 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9030,10 +9030,10 @@ fork-ts-checker-webpack-plugin@1.5.0: tapable "^1.0.0" worker-rpc "^0.1.0" -fork-ts-checker-webpack-plugin@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-4.0.3.tgz#958f4e4ec3e7fd9d4ad5a50a4442abce77dca19a" - integrity sha512-5hGeMYKg817Hp6rvdc2EOS/T/Cq0JW9LLJDZtVUPlNIojIuP7YbOAdrHEk4Irw1097YQUr56kWIiYhqNPzfNzQ== +fork-ts-checker-webpack-plugin@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-4.0.4.tgz#ba1be68d63dcf509f6d1b08fb8e19efb6d7e8a96" + integrity sha512-6IEqHH6s+tv5sho5d3dn7dfcnbjKHwfqL74kRfpAP2e8MCHuMh5ixtYrbdfPO4Zat3S5gwULOoVArjK3HMwNdA== dependencies: babel-code-frame "^6.22.0" chalk "^2.4.1" From ac5bea9d53e8602abe7800df8ad82b9de054f103 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2020 11:24:10 +0000 Subject: [PATCH 23/70] chore(deps): bump @material-ui/core from 4.9.2 to 4.9.4 Bumps [@material-ui/core](https://github.com/mui-org/material-ui/tree/HEAD/packages/material-ui) from 4.9.2 to 4.9.4. - [Release notes](https://github.com/mui-org/material-ui/releases) - [Changelog](https://github.com/mui-org/material-ui/blob/master/CHANGELOG.md) - [Commits](https://github.com/mui-org/material-ui/commits/v4.9.4/packages/material-ui) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 30 +++++++++--------------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 81fb833d58c1..46be05c50b53 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ }, "dependencies": { "@holoflows/kit": "https://github.com/DimensionDev/holoflows-kit", - "@material-ui/core": "4.9.2", + "@material-ui/core": "4.9.4", "@material-ui/icons": "4.9.1", "@material-ui/lab": "^4.0.0-alpha.39", "@nice-labs/git-flow-init": "^1.0.1", diff --git a/yarn.lock b/yarn.lock index da94e002f998..10dacd9bafe1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2206,21 +2206,19 @@ mkdirp "^0.5.1" rimraf "^2.5.2" -"@material-ui/core@4.9.2": - version "4.9.2" - resolved "https://registry.yarnpkg.com/@material-ui/core/-/core-4.9.2.tgz#23c9a697af15d8daf56ffad1955b24209ef48106" - integrity sha512-fSf/yBuE5GR7dA+FiQAAGY7HrCN/8RaYApi9tx3IKMiJIJkRCHk+E2lktgJZ+QRsaqCACLo2lwhU2CW5aeO0UQ== +"@material-ui/core@4.9.4": + version "4.9.4" + resolved "https://registry.yarnpkg.com/@material-ui/core/-/core-4.9.4.tgz#796515b12845dc6ea7e21872888cfc4c0c1c1efe" + integrity sha512-1wqm3jBC8mGpVHu0wVOYBX7LUzkPsWxkkTtKSn0Hz66T6TDJkke72mkSIL7akNdjnxy+bRc2Vi6NiJ4YutkDcw== dependencies: "@babel/runtime" "^7.4.4" "@material-ui/styles" "^4.9.0" - "@material-ui/system" "^4.9.1" + "@material-ui/system" "^4.9.3" "@material-ui/types" "^5.0.0" "@material-ui/utils" "^4.7.1" "@types/react-transition-group" "^4.2.0" clsx "^1.0.2" - convert-css-length "^2.0.1" hoist-non-react-statics "^3.3.2" - normalize-scroll-left "^0.2.0" popper.js "^1.14.1" prop-types "^15.7.2" react-is "^16.8.0" @@ -2266,10 +2264,10 @@ jss-plugin-vendor-prefixer "^10.0.3" prop-types "^15.7.2" -"@material-ui/system@^4.9.1": - version "4.9.1" - resolved "https://registry.yarnpkg.com/@material-ui/system/-/system-4.9.1.tgz#beb6595e1b164317340bdc5a629a6798fc35f82d" - integrity sha512-CLrJK2aKNWNwruGVTRf+rLz96P4jmozpY2UaCE6hBTa1oGsQ396YXOQQABQ4c0igawmdyf5iQb0zs9j5zsAf1w== +"@material-ui/system@^4.9.3": + version "4.9.3" + resolved "https://registry.yarnpkg.com/@material-ui/system/-/system-4.9.3.tgz#ee48990d7941237fdaf21b7b399981d614bb0875" + integrity sha512-DBGsTKYrLlFpHG8BUp0X6ZpvaOzef+GhSwn/8DwVTXUdHitphaPQoL9xucrI8X9MTBo//El+7nylko7lo7eJIw== dependencies: "@babel/runtime" "^7.4.4" "@material-ui/utils" "^4.7.1" @@ -6481,11 +6479,6 @@ conventional-commits-parser@^3.0.0: through2 "^3.0.0" trim-off-newlines "^1.0.0" -convert-css-length@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/convert-css-length/-/convert-css-length-2.0.1.tgz#90a76bde5bfd24d72881a5b45d02249b2c1d257c" - integrity sha512-iGpbcvhLPRKUbBc0Quxx7w/bV14AC3ItuBEGMahA5WTYqB8lq9jH0kTXFheCBASsYnqeMFZhiTruNxr1N59Axg== - convert-source-map@^1.4.0, convert-source-map@^1.5.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" @@ -13484,11 +13477,6 @@ normalize-range@^0.1.2: resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" integrity sha1-LRDAa9/TEuqXd2laTShDlFa3WUI= -normalize-scroll-left@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/normalize-scroll-left/-/normalize-scroll-left-0.2.0.tgz#9445d74275f303cc661e113329aefa492f58114c" - integrity sha512-t5oCENZJl8TGusJKoCJm7+asaSsPuNmK6+iEjrZ5TyBj2f02brCRsd4c83hwtu+e5d4LCSBZ0uoDlMjBo+A8yA== - normalize-url@1.9.1: version "1.9.1" resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-1.9.1.tgz#2cc0d66b31ea23036458436e3620d85954c66c3c" From 61a6e884e0d8e64a9ae96ba8627ba035359a0e53 Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Tue, 25 Feb 2020 14:32:25 +0800 Subject: [PATCH 24/70] Done review for the first 60 lines --- src/_locales/en/messages.json | 46 +++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 3d1d7bf5a5fa..bc72db701dd5 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -1,62 +1,62 @@ { - "add_persona": "Add Persona", - "add_to_key_store_failed_text": "{{error}}\nThis public key won't be saved.", - "add_to_key_store_failed_title": "Maskbook public key NOT verified ❌", - "add_to_key_store_success": "Maskbook public key added to the Keystore ✔", - "add_to_key_store_verifying": "Maskbook public key found, verifying...", + "add_persona": "Add a persona", + "add_to_key_store_failed_text": "{{error}}\nThis public key won't be saved in Maskbook.", + "add_to_key_store_failed_title": "[Maskbook] The public key is NOT verified ❌", + "add_to_key_store_success": "[Maskbook] The public key has been added to the Keystore ✔", + "add_to_key_store_verifying": "[Maskbook] The public key has been found, verifying...", "adding": "Adding...", "additional_post_box__encrypted_failed": "Please paste the following text into the post box.", "additional_post_box__encrypted_post_pre": "Decrypt this post with #Maskbook ! {{encrypted}}", - "additional_post_box__placeholder_w_name": "Hey {{user}}, what's your mind? Encrypt with Maskbook", - "additional_post_box__placeholder_wo_name": "What's your mind? Encrypt with Maskbook", + "additional_post_box__placeholder_w_name": "Hey {{user}}, what's on your mind? Encrypt itwith Maskbook.", + "additional_post_box__placeholder_wo_name": "What's on your mind? Encrypt it with Maskbook.", "additional_post_box__post_button": "📫 Post it!", "additional_post_box__steganography_post_failed": "Please upload the downloaded image into the post box.", "additional_post_box__steganography_post_pre": "This post is shared with my friends. You may install Maskbook to decrypt the content from the image. ([I:b]) {{random}}", "advanced": "Advanced...", - "automation_pasted_into_bio_box": "[Maskbook] We have helped you append the public key to your bio, confirm by publishing it!", + "automation_pasted_into_bio_box": "[Maskbook] We helped you append the public key to your bio. Please review and publish it!", "automation_request_click_edit_bio_button": "Please click the “Edit bio” button or the pencil on the bio box.", "automation_request_paste_into_bio_box": "Please copy your public key into the bio box and publish it.", "automation_request_paste_into_post_box": "Please copy your public key and publish it to your timeline!", "back": "Back", "backup": "Backup", - "backup_persona": "Backup Persona", - "banner_empty_username": "If not filled automatically, you may fill it.", + "backup_persona": "Backup your persona.", + "banner_empty_username": "If not filled automatically, you may enter it yourself.", "banner_get_started": "Setup Maskbook", "banner_invalid_username": "This does not seem like a valid username.", - "banner_preparing_setup": "Maskbook needs to set up your account.", + "banner_preparing_setup": "You need to setup your Maskbook account.", "banner_title": "Welcome to Maskbook", "cancel": "Cancel", "comment_box__paste_failed": "Please paste it into the comment box.", - "comment_box__placeholder": "Write an encrypted comment...", + "comment_box__placeholder": "Add an encrypted comment...", "connect": "Connect", - "connect_profile": "Connect Profile", + "connect_profile": "Connect your profile", "connecting": "Connecting...", "copy": "Copy", "create": "Create", - "create_persona": "Create a Persona", + "create_persona": "Create a persona", "dashboard": "Dashboard", - "dashboard_add_new_persona": "Add New Persona", + "dashboard_add_new_persona": "Add a new persona", "dashboard_advanced_restoration": "Advanced Restoration Options", "dashboard_attach_profile_step1": "Step 1: Copy the public key below", "dashboard_attach_profile_step2": "Step 2: Paste it into your profile biography", - "dashboard_attach_profile_step2_hint": "Hand-by-hand guides will show up after you move to the webpage.", + "dashboard_attach_profile_step2_hint": "Hand-by-hand guides will show up after you redirect to the webpage.", "dashboard_attach_profile_step3": "Step 3: Test and finish", "dashboard_attach_profile_step3_hint": "Come back here and finish the procedure. Test if your setup is successful.", - "dashboard_backup_database_hint": "Create a database backup file. Do it frequently.", - "dashboard_backup_persona_hint": "You can backup the persona with either way below.", - "dashboard_backup_persona_mnemonic_hint": "Keep the 12 words above carefully in a safe place. You will need them to restore the private key of this persona.", + "dashboard_backup_database_hint": "Create a database backup file. Do it regularly.", + "dashboard_backup_persona_hint": "You can backup your persona in the following options.", + "dashboard_backup_persona_mnemonic_hint": "Keep the 12 mnemonic words above carefully in a safe place. You will need them to restore the private key of this persona.", "dashboard_backup_persona_qr_hint": "Keep the QR code carefully in a safe place. You will need them to restore the private key of this persona.", "dashboard_backup_persona_text_hint": "Keep the text above carefully in a safe place. You will need them to restore the private key of this persona.", "dashboard_bio_test_failed": "The profile bio should include {{bio}}. Please make sure you updated the profile bio of @{{name}} successfully.", - "dashboard_bio_test_succeeful": "You have successfully connected @{{profile}} on {{domain}} to persona {{persona}}.", - "dashboard_connect_profile_for": "Connect Profile for {{persona}}", + "dashboard_bio_test_succeeful": "You have successfully connected your persona {{persona}} to @{{profile}} on {{domain}}.", + "dashboard_connect_profile_for": "Connect {{persona}} to your profile", "dashboard_connected": "Connected", "dashboard_create_backup": "Backup", "dashboard_create_persona_hint": "Create a new persona.", "dashboard_database_import_successful_hint": "Your database has been restored. Existing data will be merged.", "dashboard_delete_persona": "Delete", - "dashboard_delete_persona_confirm_hint": "Do you want to delete persona {{name}}? This operation cannot be reverted.", - "dashboard_disconnect_profile_hint": "Do you want to disconnect {{profile}} on {{network}} from persona {{persona}}? This operation cannot be reverted.", + "dashboard_delete_persona_confirm_hint": "Do you want to delete the persona {{name}}? This operation cannot be reverted.", + "dashboard_disconnect_profile_hint": "Do you want to disconnect {{profile}} on {{network}} from the persona {{persona}}? This operation cannot be reverted.", "dashboard_download": "Download as File", "dashboard_export_keystore": "Export Backup Keystore", "dashboard_hide_qr": "Hide QR Code", From fc6f9f95ee91e3d9e5f2f0869844e769b2008d8c Mon Sep 17 00:00:00 2001 From: Jack Works Date: Mon, 24 Feb 2020 14:59:04 +0800 Subject: [PATCH 25/70] fix: syntax errors in i18n msg --- src/_locales/en/messages.json | 56 +++++++++++++++++------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index da3773b7365a..3d1d7bf5a5fa 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -2,7 +2,7 @@ "add_persona": "Add Persona", "add_to_key_store_failed_text": "{{error}}\nThis public key won't be saved.", "add_to_key_store_failed_title": "Maskbook public key NOT verified ❌", - "add_to_key_store_success": "Maskbook public key added to keystore ✔", + "add_to_key_store_success": "Maskbook public key added to the Keystore ✔", "add_to_key_store_verifying": "Maskbook public key found, verifying...", "adding": "Adding...", "additional_post_box__encrypted_failed": "Please paste the following text into the post box.", @@ -10,10 +10,10 @@ "additional_post_box__placeholder_w_name": "Hey {{user}}, what's your mind? Encrypt with Maskbook", "additional_post_box__placeholder_wo_name": "What's your mind? Encrypt with Maskbook", "additional_post_box__post_button": "📫 Post it!", - "additional_post_box__steganography_post_failed": "Please upload downloaded image into the post box.", + "additional_post_box__steganography_post_failed": "Please upload the downloaded image into the post box.", "additional_post_box__steganography_post_pre": "This post is shared with my friends. You may install Maskbook to decrypt the content from the image. ([I:b]) {{random}}", "advanced": "Advanced...", - "automation_pasted_into_bio_box": "[Maskbook] We have helped you append the public key to bio, confirm by publish it!", + "automation_pasted_into_bio_box": "[Maskbook] We have helped you append the public key to your bio, confirm by publishing it!", "automation_request_click_edit_bio_button": "Please click the “Edit bio” button or the pencil on the bio box.", "automation_request_paste_into_bio_box": "Please copy your public key into the bio box and publish it.", "automation_request_paste_into_post_box": "Please copy your public key and publish it to your timeline!", @@ -33,7 +33,7 @@ "connecting": "Connecting...", "copy": "Copy", "create": "Create", - "create_persona": "Create Persona", + "create_persona": "Create a Persona", "dashboard": "Dashboard", "dashboard_add_new_persona": "Add New Persona", "dashboard_advanced_restoration": "Advanced Restoration Options", @@ -55,8 +55,8 @@ "dashboard_create_persona_hint": "Create a new persona.", "dashboard_database_import_successful_hint": "Your database has been restored. Existing data will be merged.", "dashboard_delete_persona": "Delete", - "dashboard_delete_persona_confirm_hint": "Do you really want to delete persona {{name}}? This operation cannot be reverted.", - "dashboard_disconnect_profile_hint": "Do you really want to disconnect {{profile}} on {{network}} from persona {{persona}}? This operation cannot be reverted.", + "dashboard_delete_persona_confirm_hint": "Do you want to delete persona {{name}}? This operation cannot be reverted.", + "dashboard_disconnect_profile_hint": "Do you want to disconnect {{profile}} on {{network}} from persona {{persona}}? This operation cannot be reverted.", "dashboard_download": "Download as File", "dashboard_export_keystore": "Export Backup Keystore", "dashboard_hide_qr": "Hide QR Code", @@ -87,7 +87,7 @@ "dashboard_persona_created": "Persona Created", "dashboard_persona_import_dialog_hint": "You can import a persona backup with either way below.", "dashboard_ready_to_import": "Ready to Import...", - "dashboard_ready_to_import_hint": "Maskbook needs access to certain websites, before you can import this backup.", + "dashboard_ready_to_import_hint": "Maskbook needs access to certain websites before you can import this backup.", "dashboard_restoration_successful": "Restoration Successful", "dashboard_restoration_successful_hint": "Restored from a backup at {{time}}", "dashboard_restore_database_hint": "Choose a backup file to restore your database.", @@ -103,7 +103,7 @@ "database_group_following_name": "Followed by {{owner}}", "database_group_friends_default_name": "Friends", "debug": "Debug", - "decrypted_postbox_add_recipients": "View / add recipients", + "decrypted_postbox_add_recipients": "View/add recipients", "decrypted_postbox_decrypting": "Maskbook decrypting...", "decrypted_postbox_decrypting_finding_person_key": "Maskbook is looking for the public key of the author...", "decrypted_postbox_decrypting_finding_post_key": "Maskbook is retrieving the post key to decrypt this post...", @@ -124,7 +124,7 @@ "immersive_setup_connect_as_unknown": "Connect as who?", "immersive_setup_connect_profile": "Yes, I'm sure", "immersive_setup_help_dont_know_what_is_username": "But I don't know what my username is!", - "immersive_setup_no_bio_got": "Maskbook have some problems when setting up! Please report this to Maskbook developer! Our Telegram group: https://t.me/maskbook_group", + "immersive_setup_no_bio_got": "Maskbook have some problems when setting up! Please report this to the Maskbook developer! Our Telegram group: https://t.me/maskbook_group", "immersive_setup_paste_into_bio": "[Optional] Paste this key to your bio", "immersive_setup_paste_into_bio_auto": "Add it for me", "immersive_setup_paste_into_bio_failed": "Failed... Please add it to your bio manually", @@ -144,10 +144,10 @@ "options_index_privacy": "Privacy policy", "options_index_setup": "Setup your account", "options_mobile_export_generating": "Generating QR Code...", - "options_mobile_export_subtitle": "DO NOT save or share it to others!", + "options_mobile_export_subtitle": "DO NOT save or share it with others!", "payload_bad": "This post seemed to be corrupted. Maskbook cannot decrypt it.", "payload_incomplete": "This post is not complete, you need to view the full post.", - "payload_not_found": "Doesn't find payload", + "payload_not_found": "Doesn't find the payload", "payload_throw_in_alpha41": "Support for Alpha41 is dropped. Tell your friends to upgrade Maskbook!", "person_or_group_in_chip": "{{name}} ({{count}} in the group)", "person_or_group_in_list_0": "This is an empty group", @@ -178,15 +178,15 @@ "select_file_hint": "Or drop a file here...", "select_none": "Select None", "select_specific_friends_dialog__button": "Done", - "select_specific_friends_dialog__dismiss_aria": "Dismiss the select recipients dialog", + "select_specific_friends_dialog__dismiss_aria": "Dismiss the select recipients' dialog", "select_specific_friends_dialog__title": "Select Specific Friends", "service_decryption_failed": "Decryption failed.", "service_have_no_own_key_yet": "You have no private key yet", - "service_invalid_backup_file": "This does not seems like a backup of Maskbook.", + "service_invalid_backup_file": "This does not seem like a backup of Maskbook.", "service_key_parse_failed": "Key parse failed", "service_not_setup_yet": "You have not set up Maskbook yet!", "service_not_share_target": "Maskbook does not find the key used to decrypt this post. Maybe this post is not intended to share with you?", - "service_others_key_not_found": "Public key of {{name}} can not be found!", + "service_others_key_not_found": "The public key of {{name}} cannot be found!", "service_publish_post_aes_key_failed": "Publish AES key failed!", "service_self_key_decryption_failed": "Decryption failed. Maybe you selected a wrong identity or imported a key that was not used to encrypt this post.", "service_unknown_payload": "Unknown post version, maybe you should update Maskbook?", @@ -195,11 +195,11 @@ "set_up": "Set up", "settings": "Settings", "settings_disable_new_background_tab": "Disable open hidden tabs in the background", - "settings_disable_new_background_tab_desc": "This is an deprecated behavior of Maskbook. If you find that you can not decrypt some old posts, deselect this.", + "settings_disable_new_background_tab_desc": "This is a deprecated behavior of Maskbook. If you find that you cannot decrypt some old posts, deselect this.", "settings_enable_debug": "Enable debug mode", - "settings_enable_debug_desc": "Enable this will display additional information on the Maskbook UI to help debugging", - "settings_image_based_payload": "Enable image based mode", - "settings_image_based_payload_desc": "Publishing post with image based payload instead of text payload", + "settings_enable_debug_desc": "Enable this will display additional information on the Maskbook UI to help to debug", + "settings_image_based_payload": "Enable image-based mode", + "settings_image_based_payload_desc": "Publishing post with image-based payload instead of text payload", "settings_language": "Language", "setup_failure": "Setup Failure", "setup_successful": "Setup Successful", @@ -216,27 +216,27 @@ "version": "Version", "welcome_0_close_button": "I'll do it later", "welcome_0_restore_key": "I want to restore my backup", - "welcome_1a1_didntfind": "Didn't find your account?", - "welcome_1a1_title": "Setup which account?", + "welcome_1a1_didntfind": "Didn't you find your account?", + "welcome_1a1_title": "To set up which account?", "welcome_1a1b_connect": "Connect", "welcome_1a1b_danger": "Censored network", "welcome_1a1b_switch": "Use existing accounts", "welcome_1a1b_title": "Maskbook supports these social networks", - "welcome_1a2_description": "Then only people you select with Maskbook can see the posted content.", + "welcome_1a2_description": "Then, only friends you select with Maskbook can see the posted content.", "welcome_1a2_done_button": "Nice!", - "welcome_1a2_imgalt": "Screenshot of how to encrypt message with Maskbook", + "welcome_1a2_imgalt": "Screenshot of how to encrypt a message with Maskbook", "welcome_1a2_title": "Encrypt message in a Maskbook postbox", "welcome_1a3_description1": "Our extension is asking you to download your key as a file.", "welcome_1a3_description2": "Back it up often.", "welcome_1a3_done_button": "Got it!", "welcome_1a3_title": "Keep your backups carefully", - "welcome_1a3a_connect_subtitle": "will use same crypto key", + "welcome_1a3a_connect_subtitle": "will use the same CryptoKey", "welcome_1a3a_connect_title": "Connect other accounts", "welcome_1a3a_generate_new_key": "Generate", - "welcome_1a3a_generate_new_key_password_help": "Please remember the key, or your key will not be able to restore again.", + "welcome_1a3a_generate_new_key_password_help": "Please remember the key, or your key will not be able to restore.", "welcome_1a3a_generate_new_key_password_label": "Password for the new key", "welcome_1a3a_generate_new_key_result": "The mnemonic word", - "welcome_1a3a_generate_new_key_result_help": "Mnemonic word is used to restore the key. Make sure you keep it safely.", + "welcome_1a3a_generate_new_key_result_help": "Mnemonic word is used to restore the key. Make sure you keep it safe.", "welcome_1a3a_generate_new_key_subtitle": "please save it carefully", "welcome_1a3a_generate_new_key_title": "Create a new keypair", "welcome_1a3a_recover_input_password": "Password", @@ -257,7 +257,7 @@ "welcome_1a4_type_auto_subtitle2": "This allows your friends to verify the connection between your social network account and your keypair.", "welcome_1a4_type_auto_switch": "Prefer doing it manually?", "welcome_1a4_type_manual_goto": "Copy & Go to Profile", - "welcome_1a4_type_manual_subtitle1": "Add this to bio, or post on timeline, before your first encrypted post.", + "welcome_1a4_type_manual_subtitle1": "Add this to your bio, or post on your timeline, before your first encrypted post.", "welcome_1a4_type_manual_subtitle2": "This allows your friends to verify the connection between your social network account and your keypair.", "welcome_1a4_type_manual_switch": "Prefer automating the steps?", "welcome_1b_confirm": "Restore the backup", @@ -266,7 +266,7 @@ "welcome_1b_hint_identity": "This backup file contains the following accounts:", "welcome_1b_hint_network": "And Maskbook is going to request permissions for these sites:", "welcome_1b_no_file_selected": "Select your exported key backup", - "welcome_1b_qr_error_1": "There is an error occur during the scanning.", + "welcome_1b_qr_error_1": "There is an error that occurs during scanning.", "welcome_1b_qr_error_2": "You may try other ways to restore your account.", "welcome_1b_qr_rescan": "Rescan", "welcome_1b_tabs_backup": "Select the backup file", @@ -275,4 +275,4 @@ "welcome_1b_title": "Restore your keypair", "welcome_2_greeting": "You can use Maskbook now!", "welcome_2_title": "You're done!" -} \ No newline at end of file +} From e9cb53869a037b9e236de97fe65f0483ee1eae9c Mon Sep 17 00:00:00 2001 From: Jack Works Date: Mon, 24 Feb 2020 15:46:56 +0800 Subject: [PATCH 26/70] chore: make meta on post dialog optional --- .../InjectedComponents/PostDialog.tsx | 15 ++++++------ .../twitter.com/ui/injectPostDialog.tsx | 23 ++++--------------- 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/src/components/InjectedComponents/PostDialog.tsx b/src/components/InjectedComponents/PostDialog.tsx index 81a274f49401..32ff1e76ec0c 100644 --- a/src/components/InjectedComponents/PostDialog.tsx +++ b/src/components/InjectedComponents/PostDialog.tsx @@ -249,7 +249,7 @@ export interface PostDialogProps extends Partial { identities?: Profile[] onRequestPost?: (target: (Profile | Group)[], content: TypedMessage) => void onRequestReset?: () => void - typedMessageMetadata: ReadonlyMap + typedMessageMetadata?: ReadonlyMap } export function PostDialog(props: PostDialogProps) { const { t, i18n } = useI18N() @@ -257,14 +257,15 @@ export function PostDialog(props: PostDialogProps) { const onlyMyself = props.onlyMyself ?? onlyMyselfLocal const [shareToEveryoneLocal, setShareToEveryone] = useState(false) const shareToEveryone = props.shareToEveryone ?? shareToEveryoneLocal + const typedMessageMetadata = or(props.typedMessageMetadata, useValueRef(getActivatedUI().typedMessageMetadata)) const isSteganography = useValueRef(steganographyModeSetting) //#region TypedMessage - const [postBoxContent, setPostBoxContent] = useState(makeTypedMessage('', props.typedMessageMetadata)) + const [postBoxContent, setPostBoxContent] = useState(makeTypedMessage('', typedMessageMetadata)) useEffect(() => { - if (props.typedMessageMetadata !== postBoxContent.meta) - setPostBoxContent({ ...postBoxContent, meta: props.typedMessageMetadata }) - }, [props.typedMessageMetadata, postBoxContent]) + if (typedMessageMetadata !== postBoxContent.meta) + setPostBoxContent({ ...postBoxContent, meta: typedMessageMetadata }) + }, [typedMessageMetadata, postBoxContent]) //#endregion //#region Share target const people = useFriendsList() @@ -288,7 +289,7 @@ export function PostDialog(props: PostDialogProps) { !!shareToEveryone, ) const activeUI = getActivatedUI() - const metadata = readTypedMessageMetadata(props.typedMessageMetadata, 'com.maskbook.red_packet:1') + const metadata = readTypedMessageMetadata(typedMessageMetadata, 'com.maskbook.red_packet:1') if (isSteganography) { const isEth = metadata.ok && metadata.val.token_type === RedPacketTokenType.eth const isDai = @@ -330,7 +331,7 @@ export function PostDialog(props: PostDialogProps) { // there is nothing to write if it shared with public if (!shareToEveryone) Services.Crypto.publishPostAESKey(token) }, - [currentIdentity, i18n.language, isSteganography, props.typedMessageMetadata, shareToEveryone, t], + [currentIdentity, i18n.language, isSteganography, typedMessageMetadata, shareToEveryone, t], ), ) const onRequestReset = or( diff --git a/src/social-network-provider/twitter.com/ui/injectPostDialog.tsx b/src/social-network-provider/twitter.com/ui/injectPostDialog.tsx index 93740ba75c2f..2cb75c162eb2 100644 --- a/src/social-network-provider/twitter.com/ui/injectPostDialog.tsx +++ b/src/social-network-provider/twitter.com/ui/injectPostDialog.tsx @@ -34,16 +34,11 @@ const useStyles = makeStyles((theme: Theme) => ({ export function injectPostDialogAtTwitter() { if (location.hostname.indexOf(twitterUrl.hostIdentifier) === -1) return - const meta = instanceOfTwitterUI.typedMessageMetadata - renderPostDialogTo('popup', postEditorInPopupSelector(), meta) - renderPostDialogTo('timeline', rootSelector(), meta) + renderPostDialogTo('popup', postEditorInPopupSelector()) + renderPostDialogTo('timeline', rootSelector()) } -function renderPostDialogTo( - reason: 'timeline' | 'popup', - ls: LiveSelector, - typedMessageMetadata: ValueRef>, -) { +function renderPostDialogTo(reason: 'timeline' | 'popup', ls: LiveSelector) { const watcher = new MutationObserverWatcher(ls) .setDOMProxyOption({ afterShadowRootInit: { mode: 'closed' }, @@ -53,20 +48,12 @@ function renderPostDialogTo( subtree: true, }) - renderInShadowRoot( - , - watcher.firstDOMProxy.afterShadow, - ) + renderInShadowRoot(, watcher.firstDOMProxy.afterShadow) } -function PostDialogAtTwitter(props: { - reason: 'timeline' | 'popup' - typedMessageMetadata: ValueRef> -}) { - const meta: ReadonlyMap = useValueRef(props.typedMessageMetadata) +function PostDialogAtTwitter(props: { reason: 'timeline' | 'popup' }) { return ( Date: Mon, 24 Feb 2020 16:35:33 +0800 Subject: [PATCH 27/70] chore: adjust post dialog hint --- .../InjectedComponents/PostDialogHint.tsx | 21 ++++++++++++------- .../twitter.com/ui/custom.ts | 9 ++++++-- .../twitter.com/ui/injectPostDialogHint.tsx | 8 ++----- src/stories/Injections.tsx | 18 +++++++++++++++- 4 files changed, 40 insertions(+), 16 deletions(-) diff --git a/src/components/InjectedComponents/PostDialogHint.tsx b/src/components/InjectedComponents/PostDialogHint.tsx index 86c10f69d1f1..d6c45207878b 100644 --- a/src/components/InjectedComponents/PostDialogHint.tsx +++ b/src/components/InjectedComponents/PostDialogHint.tsx @@ -1,31 +1,38 @@ import * as React from 'react' -import { Box, Card, Typography, Button } from '@material-ui/core' +import { Card, Typography, Button } from '@material-ui/core' import { useI18N } from '../../utils/i18n-next-ui' import { makeStyles } from '@material-ui/core/styles' import { useStylesExtends, or } from '../custom-ui-helper' import { useMyIdentities } from '../DataSource/useActivatedUI' import { Profile } from '../../database' import { ChooseIdentity, ChooseIdentityProps } from '../shared/ChooseIdentity' -import { getActivatedUI } from '../../social-network/ui' -import { useAsync } from '../../utils/components/AsyncComponent' import { BannerProps } from '../Welcomes/Banner' import { NotSetupYetPrompt } from '../shared/NotSetupYetPrompt' import useConnectingStatus from '../../utils/hooks/useConnectingStatus' -const useStyles = makeStyles({ +const useStyles = makeStyles(theme => ({ content: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '16px 12px', + [`@media (max-width: ${theme.breakpoints.width('sm')}px)`]: { + flexDirection: 'column', + }, }, button: { whiteSpace: 'nowrap', }, -}) + title: { + fontSize: 15, + fontWeight: 'bold', + [`@media (max-width: ${theme.breakpoints.width('sm')}px)`]: { + marginBottom: theme.spacing(0.75), + }, + }, +})) -export interface PostDialogHintUIProps - extends withClasses | 'root' | 'title' | 'button'> { +export interface PostDialogHintUIProps extends withClasses | 'root'> { onHintButtonClicked: () => void } export const PostDialogHintUI = React.memo(function PostDialogHintUI(props: PostDialogHintUIProps) { diff --git a/src/social-network-provider/twitter.com/ui/custom.ts b/src/social-network-provider/twitter.com/ui/custom.ts index fb9ebdea4780..e80b658788ce 100644 --- a/src/social-network-provider/twitter.com/ui/custom.ts +++ b/src/social-network-provider/twitter.com/ui/custom.ts @@ -1,10 +1,11 @@ import { useState, useEffect } from 'react' import { ValueRef, MutationObserverWatcher } from '@holoflows/kit' -import { Theme, createMuiTheme } from '@material-ui/core' +import { Theme, createMuiTheme, ThemeProvider } from '@material-ui/core' import { MaskbookDarkTheme, MaskbookLightTheme } from '../../../utils/theme' import { SocialNetworkUICustomUI } from '../../../social-network/ui' import { useValueRef } from '../../../utils/hooks/useValueRef' import { composeAnchorSelector } from '../utils/selector' +import React from 'react' type RGB = [number, number, number] @@ -31,7 +32,7 @@ export function startWatchThemeColor() { subtree: true, }) } -export function useTheme() { +function useTheme() { const [theme, setTheme] = useState(MaskbookLightTheme) const primaryColor = useValueRef(primaryColorRef) const backgroundColor = useValueRef(backgroundColorRef) @@ -64,6 +65,10 @@ export function useTheme() { return theme } +export function TwitterThemeProvider(props: Required>) { + return React.createElement(ThemeProvider, { theme: useTheme(), children: props.children }) +} + function isDark([r, g, b]: RGB) { return r < 68 && g < 68 && b < 68 } diff --git a/src/social-network-provider/twitter.com/ui/injectPostDialogHint.tsx b/src/social-network-provider/twitter.com/ui/injectPostDialogHint.tsx index 9bd6adf4bd08..c627067bafba 100644 --- a/src/social-network-provider/twitter.com/ui/injectPostDialogHint.tsx +++ b/src/social-network-provider/twitter.com/ui/injectPostDialogHint.tsx @@ -30,7 +30,7 @@ function renderPostDialogHintTo(ls: LiveSelector) { renderInShadowRoot(, watcher.firstDOMProxy.afterShadow) } -const useStyles = makeStyles((theme: Theme) => ({ +export const useTwitterThemedPostDialogHint = makeStyles((theme: Theme) => ({ root: { borderTopLeftRadius: 0, borderTopRightRadius: 0, @@ -51,15 +51,11 @@ const useStyles = makeStyles((theme: Theme) => ({ }, }, }, - title: { - fontSize: 15, - fontWeight: 'bold', - }, })) function PostDialogHintAtTwitter() { const classes = { - ...useStyles(), + ...useTwitterThemedPostDialogHint(), ...useTwitterButton(), } const onHintButtonClicked = useCallback( diff --git a/src/stories/Injections.tsx b/src/stories/Injections.tsx index 6e7e643b1a1b..05987f5e45a6 100644 --- a/src/stories/Injections.tsx +++ b/src/stories/Injections.tsx @@ -33,6 +33,9 @@ import { DefaultTypedMessageUnknownRenderer, } from '../components/InjectedComponents/TypedMessageRenderer' import { WithFigma } from 'storybook-addon-figma' +import { useTwitterThemedPostDialogHint } from '../social-network-provider/twitter.com/ui/injectPostDialogHint' +import { useTwitterButton } from '../social-network-provider/twitter.com/utils/theme' +import { TwitterThemeProvider } from '../social-network-provider/twitter.com/ui/custom' storiesOf('Injections', module) .add('PersonOrGroupInChip', () => ( @@ -197,7 +200,20 @@ storiesOf('Injections', module) } }) .add('Post Dialog Hint', () => { - return + return ( + <> + Vanilla: + + Twitter flavor: + + + + + ) + function TwitterFlavorPostDialogHint() { + const style = { ...useTwitterThemedPostDialogHint(), ...useTwitterButton() } + return + } }) function FakePost(props: React.PropsWithChildren<{ title: string }>) { From 005f39750827c3befc24384599e0f76ea90d1625 Mon Sep 17 00:00:00 2001 From: Jack Works Date: Mon, 24 Feb 2020 17:59:27 +0800 Subject: [PATCH 28/70] feat: replace additionalpostbox on fb to composition --- src/_locales/en/messages.json | 2 +- src/_locales/zh/messages.json | 4 ++-- .../InjectedComponents/PostDialog.tsx | 21 ++++++++----------- .../facebook.com/UI/injectPostBox.tsx | 15 +++++++++++-- src/stories/Injections.tsx | 2 +- 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 3d1d7bf5a5fa..579bc109d29b 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -163,7 +163,7 @@ "post_dialog__select_recipients_title": "Select Recipients", "post_dialog__select_specific_friends_title": "Specific Friends ({{selected}} selected)", "post_dialog__title": "Maskbook: Compose", - "post_modal_hint__button": "🔒Compose encrypted post🔒", + "post_modal_hint__button": "🔒 Compose encrypted post 🔒", "post_modal_hint__title": "Looking for Maskbook?", "privacy_policy": "Privacy Policy", "proceed": "Proceed", diff --git a/src/_locales/zh/messages.json b/src/_locales/zh/messages.json index b6e1ae5964bf..dbdd94d050e1 100644 --- a/src/_locales/zh/messages.json +++ b/src/_locales/zh/messages.json @@ -163,7 +163,7 @@ "post_dialog__select_recipients_title": "選擇收件人", "post_dialog__select_specific_friends_title": "選擇好友 (已選 {{selected}})", "post_dialog__title": "Maskbook: 編輯", - "post_modal_hint__button": "🔒編輯加密訊息🔒", + "post_modal_hint__button": "🔒 編輯加密訊息 🔒", "post_modal_hint__title": "在找 Maskbook 嗎?", "privacy_policy": "隱私政策", "proceed": "繼續", @@ -275,4 +275,4 @@ "welcome_1b_title": "導入備份檔案", "welcome_2_greeting": "你現在可以使用 Maskbook 了!", "welcome_2_title": "完畢!" -} \ No newline at end of file +} diff --git a/src/components/InjectedComponents/PostDialog.tsx b/src/components/InjectedComponents/PostDialog.tsx index 32ff1e76ec0c..571db5956e46 100644 --- a/src/components/InjectedComponents/PostDialog.tsx +++ b/src/components/InjectedComponents/PostDialog.tsx @@ -244,7 +244,8 @@ export function PostDialogUI(props: PostDialogUIProps) { ) } -export interface PostDialogProps extends Partial { +export interface PostDialogProps extends Omit, 'open'> { + open?: [boolean, (next: boolean) => void] reason?: 'timeline' | 'popup' identities?: Profile[] onRequestPost?: (target: (Profile | Group)[], content: TypedMessage) => void @@ -258,6 +259,7 @@ export function PostDialog(props: PostDialogProps) { const [shareToEveryoneLocal, setShareToEveryone] = useState(false) const shareToEveryone = props.shareToEveryone ?? shareToEveryoneLocal const typedMessageMetadata = or(props.typedMessageMetadata, useValueRef(getActivatedUI().typedMessageMetadata)) + const [open, setOpen] = or(props.open, useState(false)) as NonNullable const isSteganography = useValueRef(steganographyModeSetting) //#region TypedMessage @@ -343,7 +345,7 @@ export function PostDialog(props: PostDialogProps) { setPostBoxContent(makeTypedMessage('')) setCurrentShareTarget([]) getActivatedUI().typedMessageMetadata.value = new Map() - }, []), + }, [setOpen]), ) const onFinishButtonClicked = useCallback(() => { onRequestPost(onlyMyself ? [currentIdentity!] : currentShareTarget, postBoxContent) @@ -351,22 +353,17 @@ export function PostDialog(props: PostDialogProps) { }, [currentIdentity, currentShareTarget, onRequestPost, onRequestReset, onlyMyself, postBoxContent]) const onCloseButtonClicked = useCallback(() => { setOpen(false) - }, []) + }, [setOpen]) //#endregion //#region My Identity const identities = useMyIdentities() - const [open, setOpen] = useState(false) useEffect(() => { - const onChange = ({ reason, open }: CompositionEvent) => { + return MessageCenter.on('compositionUpdated', ({ reason, open }: CompositionEvent) => { if (reason === props.reason && identities.length > 0) { setOpen(open) } - } - MessageCenter.on('compositionUpdated', onChange) - return () => { - MessageCenter.off('compositionUpdated', onChange) - } - }, [identities.length, props.reason]) + }) + }, [identities.length, props.reason, setOpen]) const onOnlyMyselfChanged = or( props.onOnlyMyselfChanged, @@ -395,7 +392,6 @@ export function PostDialog(props: PostDialogProps) { return ( ) diff --git a/src/social-network-provider/facebook.com/UI/injectPostBox.tsx b/src/social-network-provider/facebook.com/UI/injectPostBox.tsx index 667d55fb7407..ed238af567bd 100644 --- a/src/social-network-provider/facebook.com/UI/injectPostBox.tsx +++ b/src/social-network-provider/facebook.com/UI/injectPostBox.tsx @@ -1,8 +1,9 @@ import React from 'react' import { LiveSelector, MutationObserverWatcher } from '@holoflows/kit' import { renderInShadowRoot } from '../../../utils/jss/renderInShadowRoot' -import { AdditionalPostBox } from '../../../components/InjectedComponents/AdditionalPostBox' +import { PostDialog } from '../../../components/InjectedComponents/PostDialog' import { isMobileFacebook } from '../isMobile' +import { PostDialogHint } from '../../../components/InjectedComponents/PostDialogHint' let composeBox: LiveSelector if (isMobileFacebook) { @@ -20,5 +21,15 @@ export function injectPostBoxFacebook() { childList: true, subtree: true, }) - renderInShadowRoot(, watcher.firstDOMProxy.afterShadow) + renderInShadowRoot(, watcher.firstDOMProxy.afterShadow) +} +function UI() { + const [open, setOpen] = React.useState(false) + const toOpen = () => setOpen(true) + return ( + <> + + + + ) } diff --git a/src/stories/Injections.tsx b/src/stories/Injections.tsx index 05987f5e45a6..7ebdd83e56a3 100644 --- a/src/stories/Injections.tsx +++ b/src/stories/Injections.tsx @@ -192,7 +192,7 @@ storiesOf('Injections', module) const meta = decoder(text('Metadata', '{}')) return ( - + void 0]} typedMessageMetadata={meta} /> ) } catch (e) { From b14298cbd1e17f2dd1dbd322e56c8ba8ea96305e Mon Sep 17 00:00:00 2001 From: Jack Works Date: Tue, 25 Feb 2020 14:02:57 +0800 Subject: [PATCH 29/70] chore: remove old additional post box --- src/_locales/en/messages.json | 3 - src/_locales/zh/messages.json | 3 - .../InjectedComponents/AdditionalPostBox.tsx | 211 ------------------ src/stories/Injections.tsx | 2 - 4 files changed, 219 deletions(-) delete mode 100644 src/components/InjectedComponents/AdditionalPostBox.tsx diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 579bc109d29b..aa3365072880 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -7,9 +7,6 @@ "adding": "Adding...", "additional_post_box__encrypted_failed": "Please paste the following text into the post box.", "additional_post_box__encrypted_post_pre": "Decrypt this post with #Maskbook ! {{encrypted}}", - "additional_post_box__placeholder_w_name": "Hey {{user}}, what's your mind? Encrypt with Maskbook", - "additional_post_box__placeholder_wo_name": "What's your mind? Encrypt with Maskbook", - "additional_post_box__post_button": "📫 Post it!", "additional_post_box__steganography_post_failed": "Please upload the downloaded image into the post box.", "additional_post_box__steganography_post_pre": "This post is shared with my friends. You may install Maskbook to decrypt the content from the image. ([I:b]) {{random}}", "advanced": "Advanced...", diff --git a/src/_locales/zh/messages.json b/src/_locales/zh/messages.json index dbdd94d050e1..5578dd72fe4a 100644 --- a/src/_locales/zh/messages.json +++ b/src/_locales/zh/messages.json @@ -7,9 +7,6 @@ "adding": "添加中……", "additional_post_box__encrypted_failed": "請將以下内容拷貝至發佈框。", "additional_post_box__encrypted_post_pre": "來 #Maskbook 解密這個訊息! {{encrypted}}", - "additional_post_box__placeholder_w_name": "Hey {{user}}, 有何所思?用 Maskbook 加密分享。", - "additional_post_box__placeholder_wo_name": "有何所思?用 Maskbook 加密分享。", - "additional_post_box__post_button": "現在發佈!", "additional_post_box__steganography_post_failed": "請將已下載的圖片上载至發佈框。", "additional_post_box__steganography_post_pre": "此圖片僅分享給我的好友。請安裝 Maskbook 以解讀圖片。 ([I:b]) {{random}}", "advanced": "高級...", diff --git a/src/components/InjectedComponents/AdditionalPostBox.tsx b/src/components/InjectedComponents/AdditionalPostBox.tsx deleted file mode 100644 index db22fe3deba6..000000000000 --- a/src/components/InjectedComponents/AdditionalPostBox.tsx +++ /dev/null @@ -1,211 +0,0 @@ -import * as React from 'react' -import { useCallback, useRef, useState } from 'react' -import { SelectPeopleAndGroupsUI, SelectPeopleAndGroupsUIProps } from '../shared/SelectPeopleAndGroups' -import { useCapturedInput } from '../../utils/hooks/useCapturedEvents' -import { Avatar } from '../../utils/components/Avatar' -import Services from '../../extension/service' -import { useI18N } from '../../utils/i18n-next-ui' -import { makeStyles } from '@material-ui/styles' -import { Box, Button, Card, CardHeader, Divider, InputBase, Paper, Typography } from '@material-ui/core' -import { Group, Profile } from '../../database' -import { NotSetupYetPrompt } from '../shared/NotSetupYetPrompt' -import { useCurrentIdentity, useFriendsList, useMyIdentities, useCurrentGroupsList } from '../DataSource/useActivatedUI' -import { getActivatedUI } from '../../social-network/ui' -import { ChooseIdentity, ChooseIdentityProps } from '../shared/ChooseIdentity' -import { useAsync } from '../../utils/components/AsyncComponent' -import { useStylesExtends, or } from '../custom-ui-helper' -import { steganographyModeSetting } from '../shared-settings/settings' -import { useValueRef } from '../../utils/hooks/useValueRef' -import { BannerProps } from '../Welcomes/Banner' -import useConnectingStatus from '../../utils/hooks/useConnectingStatus' -import { makeTypedMessage } from '../../extension/background-script/CryptoServices/utils' - -const useStyles = makeStyles({ - header: { padding: '8px 12px 0' }, - inputArea: { borderRadius: 0, display: 'flex' }, - avatar: { margin: '12px 0 0 12px' }, - MUIInputRoot: { - minHeight: 108, - flexDirection: 'column', - padding: 12, - boxSizing: 'border-box', - }, - MUIInputInput: { - minHeight: '3em', - }, - postButton: { padding: 6, borderTopLeftRadius: 0, borderTopRightRadius: 0, flex: 1, wordBreak: 'break-all' }, -}) - -export interface AdditionalPostBoxUIProps - extends withClasses> { - availableShareTarget: Array - currentShareTarget: Array - onShareTargetChanged: SelectPeopleAndGroupsUIProps['onSetSelected'] - currentIdentity: Profile | null - postBoxPlaceholder: string - postBoxText: string - postButtonDisabled: boolean - onPostTextChange: (nextString: string) => void - onPostButtonClicked: () => void - SelectPeopleAndGroupsProps?: Partial - ChooseIdentityProps?: Partial -} - -/** - * This is the pure UI version of AdditionalPostBox. - */ -export const AdditionalPostBoxUI = React.memo(function AdditionalPostBoxUI(props: AdditionalPostBoxUIProps) { - const classes = useStylesExtends(useStyles(), props) - const [, inputRef] = useCapturedInput(props.onPostTextChange) - const { t } = useI18N() - - return ( - - Maskbook} - /> - - {props.currentIdentity && } - - - - - - - - - - - - ) -}) - -export interface AdditionalPostBoxProps extends Partial { - identities?: Profile[] - onRequestPost?: (target: (Profile | Group)[], text: string) => void - onRequestReset?: () => void - NotSetupYetPromptProps?: Partial -} - -/** - * This is AdditionalPostBox with default props. - */ -export function AdditionalPostBox(props: AdditionalPostBoxProps) { - const { t } = useI18N() - const people = useFriendsList() - const groups = useCurrentGroupsList() - const availableShareTarget = or( - props.availableShareTarget, - React.useMemo(() => [...groups, ...people], [people, groups]), - ) - const identities = or(props.identities, useMyIdentities()) - const currentIdentity = or(props.currentIdentity, useCurrentIdentity()) - const isSteganography = useValueRef(steganographyModeSetting) - - const onRequestPost = or( - props.onRequestPost, - useCallback( - async (target: (Profile | Group)[], text: string) => { - const [encrypted, token] = await Services.Crypto.encryptTo( - makeTypedMessage(text), - target.map(x => x.identifier), - currentIdentity!.identifier, - // Note: AdditionalPostBox is deprecated. Will switch to new UI. No need to support. - false, - ) - const activeUI = getActivatedUI() - if (isSteganography) { - activeUI.taskPasteIntoPostBox( - t('additional_post_box__steganography_post_pre', { random: Date.now() }), - { - warningText: t('additional_post_box__encrypted_failed'), - shouldOpenPostDialog: false, - }, - ) - activeUI.taskUploadToPostBox(encrypted, { - warningText: t('additional_post_box__steganography_post_failed'), - }) - } else { - activeUI.taskPasteIntoPostBox(t('additional_post_box__encrypted_post_pre', { encrypted }), { - warningText: t('additional_post_box__encrypted_failed'), - shouldOpenPostDialog: false, - }) - } - Services.Crypto.publishPostAESKey(token) - }, - [currentIdentity, isSteganography, t], - ), - ) - const onRequestReset = or( - props.onRequestReset, - useCallback(() => { - setPostText('') - onShareTargetChanged([]) - }, []), - ) - - const [postText, setPostText] = useState('') - const [currentShareTarget, onShareTargetChanged] = useState(availableShareTarget) - - const connecting = useConnectingStatus() - - if (connecting) return null - - if (identities.length === 0) { - return - } - - const withName = t('additional_post_box__placeholder_w_name', { - user: currentIdentity ? currentIdentity.nickname : '', - }) - const woName = t('additional_post_box__placeholder_wo_name') - - const ui = ( - { - onRequestPost(currentShareTarget, postText) - onRequestReset() - }} - postButtonDisabled={!(currentShareTarget.length && postText)} - {...props} - /> - ) - - if (identities.length > 1) - return ( - <> - - {ui} - - ) - return ui -} diff --git a/src/stories/Injections.tsx b/src/stories/Injections.tsx index 7ebdd83e56a3..52ab913661eb 100644 --- a/src/stories/Injections.tsx +++ b/src/stories/Injections.tsx @@ -2,7 +2,6 @@ import React from 'react' import { storiesOf } from '@storybook/react' import { text, boolean, select } from '@storybook/addon-knobs' import { action } from '@storybook/addon-actions' -import { AdditionalPostBox } from '../components/InjectedComponents/AdditionalPostBox' import { AdditionalContent } from '../components/InjectedComponents/AdditionalPostContent' import { DecryptPostSuccess, @@ -52,7 +51,6 @@ storiesOf('Injections', module) ))} )) - .add('AdditionalPostBox', () => ) .add('Additional Post Content', () => ( <> From aa98664f97aaeb736e9d66e43cabe0acce58ad51 Mon Sep 17 00:00:00 2001 From: Jack Works Date: Tue, 25 Feb 2020 14:17:17 +0800 Subject: [PATCH 30/70] chore: add group owner in the ui --- src/_locales/en/messages.json | 2 +- src/_locales/zh/messages.json | 2 +- .../shared/SelectPeopleAndGroups/resolveSpecialGroupName.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index aa3365072880..c820cbfba5b3 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -98,7 +98,7 @@ "database": "Database", "database_group_followers_name": "Followers of {{owner}}", "database_group_following_name": "Followed by {{owner}}", - "database_group_friends_default_name": "Friends", + "database_group_friends_default_name": "Friends of {{owner}}", "debug": "Debug", "decrypted_postbox_add_recipients": "View/add recipients", "decrypted_postbox_decrypting": "Maskbook decrypting...", diff --git a/src/_locales/zh/messages.json b/src/_locales/zh/messages.json index 5578dd72fe4a..3b8bbf49f354 100644 --- a/src/_locales/zh/messages.json +++ b/src/_locales/zh/messages.json @@ -98,7 +98,7 @@ "database": "數據庫", "database_group_followers_name": "{{owner}} 的關注者", "database_group_following_name": "{{owner}} 關注的人", - "database_group_friends_default_name": "互粉好友", + "database_group_friends_default_name": "{{owner}} 的好友", "debug": "調試", "decrypted_postbox_add_recipients": "查看或添加收件人", "decrypted_postbox_decrypting": "Maskbook 正在解密…", diff --git a/src/components/shared/SelectPeopleAndGroups/resolveSpecialGroupName.ts b/src/components/shared/SelectPeopleAndGroups/resolveSpecialGroupName.ts index b92dd24ee3d8..b0dd2e605398 100644 --- a/src/components/shared/SelectPeopleAndGroups/resolveSpecialGroupName.ts +++ b/src/components/shared/SelectPeopleAndGroups/resolveSpecialGroupName.ts @@ -13,7 +13,7 @@ function resolveSpecialGroupName(t: I18NFunction, group: Group, knownPeople: Pro const data = { owner } switch (group.groupName) { case PreDefinedVirtualGroupNames.friends: - return t('database_group_friends_default_name') + return t('database_group_friends_default_name', data) case PreDefinedVirtualGroupNames.followers: return t('database_group_followers_name', data) case PreDefinedVirtualGroupNames.following: From 1ed2a29ac44e4dfccee9f14f67a2438685e71a71 Mon Sep 17 00:00:00 2001 From: Jack Works Date: Tue, 25 Feb 2020 14:23:03 +0800 Subject: [PATCH 31/70] fix: prefer persona name in resolve group name --- .../shared/SelectPeopleAndGroups/resolveSpecialGroupName.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/shared/SelectPeopleAndGroups/resolveSpecialGroupName.ts b/src/components/shared/SelectPeopleAndGroups/resolveSpecialGroupName.ts index b0dd2e605398..7c5c1fd9394a 100644 --- a/src/components/shared/SelectPeopleAndGroups/resolveSpecialGroupName.ts +++ b/src/components/shared/SelectPeopleAndGroups/resolveSpecialGroupName.ts @@ -7,8 +7,8 @@ import { useI18N, I18NFunction } from '../../../utils/i18n-next-ui' function resolveSpecialGroupName(t: I18NFunction, group: Group, knownPeople: Profile[]): string { let owner: string = group.identifier.virtualGroupOwner || 'Unknown' - for (const person of knownPeople.filter(x => x.identifier.equals(group.identifier.ownerIdentifier))) { - owner = person.nickname || owner + for (const profile of knownPeople.filter(x => x.identifier.equals(group.identifier.ownerIdentifier))) { + owner = profile.linkedPersona?.nickname || profile.nickname || owner } const data = { owner } switch (group.groupName) { From 05f770052601d8ceae651ac4abd2b0b205db70fb Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Tue, 25 Feb 2020 14:50:39 +0800 Subject: [PATCH 32/70] fix: wrong selected count in facebook --- src/components/InjectedComponents/PostDialog.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/InjectedComponents/PostDialog.tsx b/src/components/InjectedComponents/PostDialog.tsx index 571db5956e46..a606cb9d07ad 100644 --- a/src/components/InjectedComponents/PostDialog.tsx +++ b/src/components/InjectedComponents/PostDialog.tsx @@ -277,7 +277,8 @@ export function PostDialog(props: PostDialogProps) { useMemo(() => [...groups, ...people], [people, groups]), ) const currentIdentity = or(props.currentIdentity, useCurrentIdentity()) - const [currentShareTarget, setCurrentShareTarget] = useState(availableShareTarget) + const [currentShareTarget, setCurrentShareTarget] = useState<(Profile | Group)[]>(() => []) + //#endregion //#region callbacks const onRequestPost = or( From f47fa5975834bfa81b81b6a08661ee390b91f8f6 Mon Sep 17 00:00:00 2001 From: Neruthes 0x5200DF38 Date: Wed, 26 Feb 2020 03:48:24 +0000 Subject: [PATCH 33/70] Update issue templates Now using ISO week day for date notation. --- .github/ISSUE_TEMPLATE/bug.md | 6 +++--- .github/ISSUE_TEMPLATE/demand.md | 6 +++--- .github/ISSUE_TEMPLATE/task.md | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index e58aef2a4811..a195f18c5a27 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -1,9 +1,9 @@ --- name: Bug -about: "Report a bug" +about: Report a bug title: "[Bug] " -labels: 'Type: Bug' -assignees: neruthes, jack-works +labels: '' +assignees: Jack-Works, neruthes --- diff --git a/.github/ISSUE_TEMPLATE/demand.md b/.github/ISSUE_TEMPLATE/demand.md index 48abfdddcbb0..6fffdf65f0ed 100644 --- a/.github/ISSUE_TEMPLATE/demand.md +++ b/.github/ISSUE_TEMPLATE/demand.md @@ -1,6 +1,6 @@ --- name: Demand -about: "PRD for new demand" +about: PRD for new demand title: "[Demand] " labels: 'Demand: Draft' assignees: neruthes @@ -13,9 +13,9 @@ Field | Value --- | --- Previous Stage | ... Figma Link | [figma.com/...](___) -Expected UX prototype due | YYYY-MM-DD +Expected UX prototype due | 2020-W??-5 Actual UX prototype release | - -Expected engineering due | YYYY-MM-DD +Expected engineering due | 2020-W??-5 Corresponding Pull Request | - Completion Version | - diff --git a/.github/ISSUE_TEMPLATE/task.md b/.github/ISSUE_TEMPLATE/task.md index 3e491ef3418f..2394b503605d 100644 --- a/.github/ISSUE_TEMPLATE/task.md +++ b/.github/ISSUE_TEMPLATE/task.md @@ -1,9 +1,9 @@ --- name: Task -about: "Non-coding task" +about: Non-coding task title: "[Task] " -labels: 'Non-Coding Task' -assignees: +labels: Non-Coding Task +assignees: '' --- @@ -12,7 +12,7 @@ assignees: Field | Value --- | --- Parent Task/Demand | /* Issue Number*/ -Expected Delivery Date | YYYY-MM-DD +Expected Delivery Date | 2020-W??-5 ## Content From c17288b445c634b59f6497e993c1901e00a3da5c Mon Sep 17 00:00:00 2001 From: Neruthes 0x5200DF38 Date: Wed, 26 Feb 2020 04:56:11 +0000 Subject: [PATCH 34/70] Using "Figma_Link_Here____" instead --- .github/ISSUE_TEMPLATE/demand.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/demand.md b/.github/ISSUE_TEMPLATE/demand.md index 6fffdf65f0ed..7487db0a16d6 100644 --- a/.github/ISSUE_TEMPLATE/demand.md +++ b/.github/ISSUE_TEMPLATE/demand.md @@ -12,7 +12,7 @@ assignees: neruthes Field | Value --- | --- Previous Stage | ... -Figma Link | [figma.com/...](___) +Figma Link | Figma_Link_Here____ Expected UX prototype due | 2020-W??-5 Actual UX prototype release | - Expected engineering due | 2020-W??-5 From 1ca13f10b394470f2496f899b84bad03b80a5022 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Mon, 24 Feb 2020 16:44:46 +0800 Subject: [PATCH 35/70] chore: add react-hooks-testing-library - peer: react-test-renderer --- package.json | 2 ++ yarn.lock | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 46be05c50b53..bf7698b68a6e 100644 --- a/package.json +++ b/package.json @@ -108,6 +108,7 @@ "@storybook/addons": "^5.3.12", "@storybook/preset-typescript": "^1.2.0", "@storybook/react": "^5.3.13", + "@testing-library/react-hooks": "^3.2.1", "@trust/webcrypto": "^0.9.2", "@types/jest": "^25.1.2", "@typescript-eslint/eslint-plugin": "^2.20.0", @@ -138,6 +139,7 @@ "puppeteer-core": "^2.1.1", "react-devtools": "^4.4.0", "react-docgen-typescript-loader": "^3.6.0", + "react-test-renderer": "^16.12.0", "storybook-addon-figma": "^0.1.0", "storybook-addon-i18n": "^5.1.13", "storybook-addon-material-ui": "^0.9.0-alpha.21", diff --git a/yarn.lock b/yarn.lock index 10dacd9bafe1..f3b955e38059 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1581,7 +1581,7 @@ dependencies: regenerator-runtime "^0.13.2" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.3.1", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.0", "@babel/runtime@^7.4.2", "@babel/runtime@^7.4.4", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.3.1", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.0", "@babel/runtime@^7.4.2", "@babel/runtime@^7.4.4", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6": version "7.8.4" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.8.4.tgz#d79f5a2040f7caa24d53e563aad49cbc05581308" integrity sha512-neAp3zt80trRVBI1x0azq6c57aNBqYZH8KhMm3TaB7wEI5Q4A2SHfBHE8w9gOhI/lrqxtEbXZgQIrHP+wvSGwQ== @@ -3311,6 +3311,14 @@ dependencies: defer-to-connect "^1.0.1" +"@testing-library/react-hooks@^3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@testing-library/react-hooks/-/react-hooks-3.2.1.tgz#19b6caa048ef15faa69d439c469033873ea01294" + integrity sha512-1OB6Ksvlk6BCJA1xpj8/WWz0XVd1qRcgqdaFAq+xeC6l61Ucj0P6QpA5u+Db/x9gU4DCX8ziR5b66Mlfg0M2RA== + dependencies: + "@babel/runtime" "^7.5.4" + "@types/testing-library__react-hooks" "^3.0.0" + "@trust/keyto@^0.3.4": version "0.3.7" resolved "https://registry.yarnpkg.com/@trust/keyto/-/keyto-0.3.7.tgz#e251264e302a7a6be64a3e208dacb2ef6268c946" @@ -3625,6 +3633,13 @@ dependencies: "@types/react" "*" +"@types/react-test-renderer@*": + version "16.9.2" + resolved "https://registry.yarnpkg.com/@types/react-test-renderer/-/react-test-renderer-16.9.2.tgz#e1c408831e8183e5ad748fdece02214a7c2ab6c5" + integrity sha512-4eJr1JFLIAlWhzDkBCkhrOIWOvOxcCAfQh+jiKg7l/nNZcCIL2MHl2dZhogIFKyHzedVWHaVP1Yydq/Ruu4agw== + dependencies: + "@types/react" "*" + "@types/react-textarea-autosize@^4.3.3": version "4.3.4" resolved "https://registry.yarnpkg.com/@types/react-textarea-autosize/-/react-textarea-autosize-4.3.4.tgz#9a93f751c91ad5e86387bce75e3b7e11ed195813" @@ -3666,6 +3681,14 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== +"@types/testing-library__react-hooks@^3.0.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@types/testing-library__react-hooks/-/testing-library__react-hooks-3.2.0.tgz#52f3a109bef06080e3b1e3ae7ea1c014ce859897" + integrity sha512-dE8iMTuR5lzB+MqnxlzORlXzXyCL0EKfzH0w/lau20OpkHD37EaWjZDz0iNG8b71iEtxT4XKGmSKAGVEqk46mw== + dependencies: + "@types/react" "*" + "@types/react-test-renderer" "*" + "@types/tiny-secp256k1@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@types/tiny-secp256k1/-/tiny-secp256k1-1.0.0.tgz#0c8fde0dfd320c9d089907e37805d67a346ad991" @@ -15399,6 +15422,16 @@ react-syntax-highlighter@^8.0.1: prismjs "^1.8.4" refractor "^2.4.1" +react-test-renderer@^16.12.0: + version "16.12.0" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.12.0.tgz#11417ffda579306d4e841a794d32140f3da1b43f" + integrity sha512-Vj/teSqt2oayaWxkbhQ6gKis+t5JrknXfPVo+aIJ8QwYAqMPH77uptOdrlphyxl8eQI/rtkOYg86i/UWkpFu0w== + dependencies: + object-assign "^4.1.1" + prop-types "^15.6.2" + react-is "^16.8.6" + scheduler "^0.18.0" + react-textarea-autosize@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/react-textarea-autosize/-/react-textarea-autosize-7.1.0.tgz#3132cb77e65d94417558d37c0bfe415a5afd3445" From 4e1db36050a6cab4c40217bcde3271e1024c56e7 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Mon, 24 Feb 2020 18:10:28 +0800 Subject: [PATCH 36/70] chore: add enzyme --- package.json | 4 + yarn.lock | 293 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 293 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index bf7698b68a6e..1eb1d5a276b1 100644 --- a/package.json +++ b/package.json @@ -110,6 +110,8 @@ "@storybook/react": "^5.3.13", "@testing-library/react-hooks": "^3.2.1", "@trust/webcrypto": "^0.9.2", + "@types/enzyme": "^3.10.5", + "@types/enzyme-adapter-react-16": "^1.0.6", "@types/jest": "^25.1.2", "@typescript-eslint/eslint-plugin": "^2.20.0", "@typescript-eslint/parser": "^2.19.2", @@ -118,6 +120,8 @@ "babel-loader": "^8.0.6", "chrome-launcher": "^0.12.0", "copy-webpack-plugin": "^5.1.1", + "enzyme": "^3.11.0", + "enzyme-adapter-react-16": "^1.15.2", "eslint": "^6.7.2", "eslint-config-prettier": "^6.10.0", "eslint-plugin-import": "^2.20.1", diff --git a/yarn.lock b/yarn.lock index f3b955e38059..e8a5de72ad5a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3417,6 +3417,13 @@ dependencies: "@types/node" "*" +"@types/cheerio@*": + version "0.22.16" + resolved "https://registry.yarnpkg.com/@types/cheerio/-/cheerio-0.22.16.tgz#c748a97b8a6f781b04bbda4a552e11b35bcc77e4" + integrity sha512-bSbnU/D4yzFdzLpp3+rcDj0aQQMIRUBNJU7azPxdqMpnexjUSvGJyDuOBQBHeOZh1mMKgsJm6Dy+LLh80Ew4tQ== + dependencies: + "@types/node" "*" + "@types/classnames@^2.2.7": version "2.2.9" resolved "https://registry.yarnpkg.com/@types/classnames/-/classnames-2.2.9.tgz#d868b6febb02666330410fe7f58f3c4b8258be7b" @@ -3427,6 +3434,21 @@ resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== +"@types/enzyme-adapter-react-16@^1.0.6": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@types/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.0.6.tgz#8aca7ae2fd6c7137d869b6616e696d21bb8b0cec" + integrity sha512-VonDkZ15jzqDWL8mPFIQnnLtjwebuL9YnDkqeCDYnB4IVgwUm0mwKkqhrxLL6mb05xm7qqa3IE95m8CZE9imCg== + dependencies: + "@types/enzyme" "*" + +"@types/enzyme@*", "@types/enzyme@^3.10.5": + version "3.10.5" + resolved "https://registry.yarnpkg.com/@types/enzyme/-/enzyme-3.10.5.tgz#fe7eeba3550369eed20e7fb565bfb74eec44f1f0" + integrity sha512-R+phe509UuUYy9Tk0YlSbipRpfVtIzb/9BHn5pTEtjJTF5LXvUjrIQcZvNyANNEyFrd2YGs196PniNT1fgvOQA== + dependencies: + "@types/cheerio" "*" + "@types/react" "*" + "@types/eslint-visitor-keys@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" @@ -4235,6 +4257,22 @@ airbnb-js-shims@^2.2.1: string.prototype.padstart "^3.0.0" symbol.prototype.description "^1.0.0" +airbnb-prop-types@^2.15.0: + version "2.15.0" + resolved "https://registry.yarnpkg.com/airbnb-prop-types/-/airbnb-prop-types-2.15.0.tgz#5287820043af1eb469f5b0af0d6f70da6c52aaef" + integrity sha512-jUh2/hfKsRjNFC4XONQrxo/n/3GG4Tn6Hl0WlFQN5PY9OMC9loSCoAYKnZsWaP8wEfd5xcrPloK0Zg6iS1xwVA== + dependencies: + array.prototype.find "^2.1.0" + function.prototype.name "^1.1.1" + has "^1.0.3" + is-regex "^1.0.4" + object-is "^1.0.1" + object.assign "^4.1.0" + object.entries "^1.1.0" + prop-types "^15.7.2" + prop-types-exact "^1.2.0" + react-is "^16.9.0" + ajv-errors@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" @@ -4499,6 +4537,11 @@ array-equal@^1.0.0: resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= +array-filter@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83" + integrity sha1-uveeYubvTCpMC4MSMtr/7CUfnYM= + array-filter@~0.0.0: version "0.0.1" resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" @@ -4564,6 +4607,14 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= +array.prototype.find@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.1.0.tgz#630f2eaf70a39e608ac3573e45cf8ccd0ede9ad7" + integrity sha512-Wn41+K1yuO5p7wRZDl7890c3xvv5UBrfVXTVIe28rSQb6LS0fZMDrQB6PAcxQFRFy6vJTLDc3A2+3CjQdzVKRg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.13.0" + array.prototype.flat@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.1.tgz#812db8f02cad24d3fab65dd67eabe3b8903494a4" @@ -4573,6 +4624,14 @@ array.prototype.flat@^1.2.1: es-abstract "^1.10.0" function-bind "^1.1.1" +array.prototype.flat@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz#0de82b426b0318dbfdb940089e38b043d37f6c7b" + integrity sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + array.prototype.flatmap@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.1.tgz#3103cd4826ef90019c9b0a4839b2535fa6faf4e9" @@ -5915,7 +5974,7 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -cheerio@1.0.0-rc.3: +cheerio@1.0.0-rc.3, cheerio@^1.0.0-rc.3: version "1.0.0-rc.3" resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.3.tgz#094636d425b2e9c0f4eb91a46c05630c9a1a8bf6" integrity sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA== @@ -7308,6 +7367,11 @@ dir-glob@^2.0.0: dependencies: path-type "^3.0.0" +discontinuous-range@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/discontinuous-range/-/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a" + integrity sha1-44Mx8IRLukm5qctxx3FYWqsbxlo= + dispensary@0.49.0: version "0.49.0" resolved "https://registry.yarnpkg.com/dispensary/-/dispensary-0.49.0.tgz#0ea2c62f1d7353b6e9a27f5dac08b0bad586b74f" @@ -7760,6 +7824,69 @@ env-paths@^1.0.0: resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-1.0.0.tgz#4168133b42bb05c38a35b1ae4397c8298ab369e0" integrity sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA= +enzyme-adapter-react-16@^1.15.2: + version "1.15.2" + resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.15.2.tgz#b16db2f0ea424d58a808f9df86ab6212895a4501" + integrity sha512-SkvDrb8xU3lSxID8Qic9rB8pvevDbLybxPK6D/vW7PrT0s2Cl/zJYuXvsd1EBTz0q4o3iqG3FJhpYz3nUNpM2Q== + dependencies: + enzyme-adapter-utils "^1.13.0" + enzyme-shallow-equal "^1.0.1" + has "^1.0.3" + object.assign "^4.1.0" + object.values "^1.1.1" + prop-types "^15.7.2" + react-is "^16.12.0" + react-test-renderer "^16.0.0-0" + semver "^5.7.0" + +enzyme-adapter-utils@^1.13.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.13.0.tgz#01c885dde2114b4690bf741f8dc94cee3060eb78" + integrity sha512-YuEtfQp76Lj5TG1NvtP2eGJnFKogk/zT70fyYHXK2j3v6CtuHqc8YmgH/vaiBfL8K1SgVVbQXtTcgQZFwzTVyQ== + dependencies: + airbnb-prop-types "^2.15.0" + function.prototype.name "^1.1.2" + object.assign "^4.1.0" + object.fromentries "^2.0.2" + prop-types "^15.7.2" + semver "^5.7.1" + +enzyme-shallow-equal@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/enzyme-shallow-equal/-/enzyme-shallow-equal-1.0.1.tgz#7afe03db3801c9b76de8440694096412a8d9d49e" + integrity sha512-hGA3i1so8OrYOZSM9whlkNmVHOicJpsjgTzC+wn2JMJXhq1oO4kA4bJ5MsfzSIcC71aLDKzJ6gZpIxrqt3QTAQ== + dependencies: + has "^1.0.3" + object-is "^1.0.2" + +enzyme@^3.11.0: + version "3.11.0" + resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.11.0.tgz#71d680c580fe9349f6f5ac6c775bc3e6b7a79c28" + integrity sha512-Dw8/Gs4vRjxY6/6i9wU0V+utmQO9kvh9XLnz3LIudviOnVYDEe2ec+0k+NQoMamn1VrjKgCUOWj5jG/5M5M0Qw== + dependencies: + array.prototype.flat "^1.2.3" + cheerio "^1.0.0-rc.3" + enzyme-shallow-equal "^1.0.1" + function.prototype.name "^1.1.2" + has "^1.0.3" + html-element-map "^1.2.0" + is-boolean-object "^1.0.1" + is-callable "^1.1.5" + is-number-object "^1.0.4" + is-regex "^1.0.5" + is-string "^1.0.5" + is-subset "^0.1.1" + lodash.escape "^4.0.1" + lodash.isequal "^4.5.0" + object-inspect "^1.7.0" + object-is "^1.0.2" + object.assign "^4.1.0" + object.entries "^1.1.1" + object.values "^1.1.1" + raf "^3.4.1" + rst-selector-parser "^2.2.3" + string.prototype.trim "^1.2.1" + errno@^0.1.3, errno@~0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" @@ -9198,6 +9325,15 @@ function.prototype.name@^1.1.0: functions-have-names "^1.1.1" is-callable "^1.1.4" +function.prototype.name@^1.1.1, function.prototype.name@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.2.tgz#5cdf79d7c05db401591dfde83e3b70c5123e9a45" + integrity sha512-C8A+LlHBJjB2AdcRPorc5JvJ5VUoWlXdEHLOJdCI7kjHEtGTpHQUiqMvCIKUwIsGwZX2jZJy761AXsn356bJQg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + functions-have-names "^1.2.0" + functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" @@ -9208,6 +9344,11 @@ functions-have-names@^1.1.1: resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.1.1.tgz#79d35927f07b8e7103d819fed475b64ccf7225ea" integrity sha512-U0kNHUoxwPNPWOJaMG7Z00d4a/qZVrFtzWJRaK8V9goaVOCXBSQSJpt3MYGNtkScKEBKovxLjnNdC9MlXwo5Pw== +functions-have-names@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.1.tgz#a981ac397fa0c9964551402cdc5533d7a4d52f91" + integrity sha512-j48B/ZI7VKs3sgeI2cZp7WXWmZXu7Iq5pl5/vptV5N2mq+DGFuS/ulaDjtaoLpYzuD6u8UgrUKHfgo7fDTSiBA== + fuse.js@^3.4.6: version "3.4.6" resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-3.4.6.tgz#545c3411fed88bf2e27c457cab6e73e7af697a45" @@ -9918,6 +10059,13 @@ hpack.js@^2.1.6: readable-stream "^2.0.1" wbuf "^1.1.0" +html-element-map@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/html-element-map/-/html-element-map-1.2.0.tgz#dfbb09efe882806af63d990cf6db37993f099f22" + integrity sha512-0uXq8HsuG1v2TmQ8QkIhzbrqeskE4kn52Q18QJ9iAA/SnHoEKXWiUxHQtclRsCFWEUD2So34X+0+pZZu862nnw== + dependencies: + array-filter "^1.0.0" + html-encoding-sniffer@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" @@ -10518,6 +10666,11 @@ is-binary-path@^1.0.0: dependencies: binary-extensions "^1.0.0" +is-boolean-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.0.1.tgz#10edc0900dd127697a92f6f9807c7617d68ac48e" + integrity sha512-TqZuVwa/sppcrhUCAYkGBk7w0yxfQQnxq28fjkO53tnK9FQXmdwz2JS5+GjsWQ6RByES1K40nI+yDic5c9/aAQ== + is-buffer@^1.0.2, is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" @@ -10764,6 +10917,11 @@ is-npm@^4.0.0: resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-4.0.0.tgz#c90dd8380696df87a7a6d823c20d0b12bbe3c84d" integrity sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig== +is-number-object@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.4.tgz#36ac95e741cf18b283fc1ddf5e83da798e3ec197" + integrity sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw== + is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" @@ -10924,6 +11082,16 @@ is-stream@^2.0.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== +is-string@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" + integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== + +is-subset@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" + integrity sha1-ilkRfZMt4d4A8kX83TnOQ/HpOaY= + is-symbol@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" @@ -12382,6 +12550,16 @@ lodash.debounce@^4.0.8: resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= +lodash.escape@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-4.0.1.tgz#c9044690c21e04294beaa517712fded1fa88de98" + integrity sha1-yQRGkMIeBClL6qUXcS/e0fqI3pg= + +lodash.flattendeep@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" + integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= + lodash.includes@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" @@ -12392,6 +12570,11 @@ lodash.isboolean@^3.0.3: resolved "https://registry.yarnpkg.com/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz#6c2e171db2a257cd96802fd43b01b20d5f5870f6" integrity sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY= +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= + lodash.isinteger@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343" @@ -13130,6 +13313,11 @@ moment@^2.10.6, moment@^2.18.1: resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b" integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg== +moo@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/moo/-/moo-0.5.1.tgz#7aae7f384b9b09f620b6abf6f74ebbcd1b65dbc4" + integrity sha512-I1mnb5xn4fO80BH9BLcF0yLypy2UKl+Cb01Fu0hJRkJjlCRtxZMWkTdAtDd5ZqCOxtCkhmRwyI57vWT+1iZ67w== + move-concurrently@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" @@ -13268,6 +13456,17 @@ ncp@~2.0.0: resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3" integrity sha1-GVoh1sRuNh0vsSgbo4uR6d9727M= +nearley@^2.7.10: + version "2.19.1" + resolved "https://registry.yarnpkg.com/nearley/-/nearley-2.19.1.tgz#4af4006e16645ff800e9f993c3af039857d9dbdc" + integrity sha512-xq47GIUGXxU9vQg7g/y1o1xuKnkO7ev4nRWqftmQrLkfnE/FjRqDaGOUakM8XHPn/6pW3bGjU2wgoJyId90rqg== + dependencies: + commander "^2.19.0" + moo "^0.5.0" + railroad-diagrams "^1.0.0" + randexp "0.4.6" + semver "^5.4.1" + needle@^2.2.1: version "2.4.0" resolved "https://registry.yarnpkg.com/needle/-/needle-2.4.0.tgz#6833e74975c444642590e15a750288c5f939b57c" @@ -13659,6 +13858,11 @@ object-is@^1.0.1: resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.1.tgz#0aa60ec9989a0b3ed795cf4d06f62cf1ad6539b6" integrity sha1-CqYOyZiaCz7Xlc9NBvYs8a1lObY= +object-is@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.2.tgz#6b80eb84fe451498f65007982f035a5b445edec4" + integrity sha512-Epah+btZd5wrrfjkJZq1AOB9O6OxUQto45hzFd7lXGrpHPGE0W1k+426yrZV+k6NJOzLNNW/nVsmZdIWsAqoOQ== + object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" @@ -13696,6 +13900,16 @@ object.entries@^1.1.0: function-bind "^1.1.1" has "^1.0.3" +object.entries@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.1.tgz#ee1cf04153de02bb093fec33683900f57ce5399b" + integrity sha512-ilqR7BgdyZetJutmDPfXCDffGa0/Yzl2ivVNpbx/g4UeWrCdRnFDUBrKJGLhGieRHDATnyZXWBeCb29k9CJysQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + function-bind "^1.1.1" + has "^1.0.3" + "object.fromentries@^2.0.0 || ^1.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab" @@ -13706,6 +13920,16 @@ object.entries@^1.1.0: function-bind "^1.1.1" has "^1.0.1" +object.fromentries@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.2.tgz#4a09c9b9bb3843dd0f89acdb517a794d4f355ac9" + integrity sha512-r3ZiBH7MQppDJVLx6fhD618GKNG40CZYH9wgwdhKxBDDbQgjeWGGd4AtkZad84d291YxvWe7bJGuE65Anh0dxQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + function-bind "^1.1.1" + has "^1.0.3" + object.getownpropertydescriptors@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" @@ -13731,6 +13955,16 @@ object.values@^1.1.0: function-bind "^1.1.1" has "^1.0.3" +object.values@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.1.tgz#68a99ecde356b7e9295a3c5e0ce31dc8c953de5e" + integrity sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + function-bind "^1.1.1" + has "^1.0.3" + oboe@2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.4.tgz#20c88cdb0c15371bb04119257d4fdd34b0aa49f6" @@ -14688,6 +14922,15 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.3" +prop-types-exact@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/prop-types-exact/-/prop-types-exact-1.2.0.tgz#825d6be46094663848237e3925a98c6e944e9869" + integrity sha512-K+Tk3Kd9V0odiXFP9fwDHUYRyvK3Nun3GVyPapSIs5OBkITAm15W0CPFD/YKTkMUAbc0b9CUwRQp2ybiBIq+eA== + dependencies: + has "^1.0.3" + object.assign "^4.1.0" + reflect.ownkeys "^0.2.0" + prop-types@15.7.2, prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" @@ -15024,6 +15267,18 @@ quick-lru@^1.0.0: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" integrity sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g= +raf@^3.4.1: + version "3.4.1" + resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39" + integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA== + dependencies: + performance-now "^2.1.0" + +railroad-diagrams@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz#eb7e6267548ddedfb899c1b90e57374559cddb7e" + integrity sha1-635iZ1SN3t+4mcG5Dlc3RVnN234= + ramda@^0.21.0: version "0.21.0" resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.21.0.tgz#a001abedb3ff61077d4ff1d577d44de77e8d0a35" @@ -15034,6 +15289,14 @@ ramda@^0.26.1: resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.26.1.tgz#8d41351eb8111c55353617fc3bbffad8e4d35d06" integrity sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ== +randexp@0.4.6: + version "0.4.6" + resolved "https://registry.yarnpkg.com/randexp/-/randexp-0.4.6.tgz#e986ad5e5e31dae13ddd6f7b3019aa7c87f60ca3" + integrity sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ== + dependencies: + discontinuous-range "1.0.0" + ret "~0.1.10" + randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -15310,7 +15573,7 @@ react-inspector@^4.0.0: prop-types "^15.6.1" storybook-chromatic "^2.2.2" -react-is@^16.12.0, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.0, react-is@^16.8.1, react-is@^16.8.3, react-is@^16.8.4, react-is@^16.8.6: +react-is@^16.12.0, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.0, react-is@^16.8.1, react-is@^16.8.3, react-is@^16.8.4, react-is@^16.8.6, react-is@^16.9.0: version "16.12.0" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c" integrity sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q== @@ -15422,7 +15685,7 @@ react-syntax-highlighter@^8.0.1: prismjs "^1.8.4" refractor "^2.4.1" -react-test-renderer@^16.12.0: +react-test-renderer@^16.0.0-0, react-test-renderer@^16.12.0: version "16.12.0" resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.12.0.tgz#11417ffda579306d4e841a794d32140f3da1b43f" integrity sha512-Vj/teSqt2oayaWxkbhQ6gKis+t5JrknXfPVo+aIJ8QwYAqMPH77uptOdrlphyxl8eQI/rtkOYg86i/UWkpFu0w== @@ -15691,6 +15954,11 @@ redent@^2.0.0: indent-string "^3.0.0" strip-indent "^2.0.0" +reflect.ownkeys@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460" + integrity sha1-dJrO7H8/34tj+SegSAnpDFwLNGA= + refractor@^2.4.1: version "2.10.0" resolved "https://registry.yarnpkg.com/refractor/-/refractor-2.10.0.tgz#4cc7efc0028a87924a9b31d82d129dec831a287b" @@ -16214,6 +16482,14 @@ rlp@^2.2.3: dependencies: bn.js "^4.11.1" +rst-selector-parser@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz#81b230ea2fcc6066c89e3472de794285d9b03d91" + integrity sha1-gbIw6i/MYGbInjRy3nlChdmwPZE= + dependencies: + lodash.flattendeep "^4.4.0" + nearley "^2.7.10" + rsvp@^4.8.4: version "4.8.5" resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" @@ -16436,7 +16712,7 @@ semver-regex@^2.0.0: resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-2.0.0.tgz#a93c2c5844539a770233379107b38c7b4ac9d338" integrity sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw== -"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0: +"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -17251,6 +17527,15 @@ string.prototype.padstart@^3.0.0: es-abstract "^1.4.3" function-bind "^1.0.2" +string.prototype.trim@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.1.tgz#141233dff32c82bfad80684d7e5f0869ee0fb782" + integrity sha512-MjGFEeqixw47dAMFMtgUro/I0+wNqZB5GKXGt1fFr24u3TzDXCPu7J9Buppzoe3r/LqkSDLDDJzE15RGWDGAVw== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + function-bind "^1.1.1" + string.prototype.trimleft@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.0.0.tgz#68b6aa8e162c6a80e76e3a8a0c2e747186e271ff" From 5038db0834ac9a86ef1bfb67475812a08c5ea497 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Tue, 25 Feb 2020 16:18:58 +0800 Subject: [PATCH 37/70] test: add test for use captured events --- .../__tests__/hooks/useCaptureEvents.tsx | 72 +++++++++++++++++++ src/utils/hooks/useCapturedEvents.ts | 38 +++++----- 2 files changed, 89 insertions(+), 21 deletions(-) create mode 100644 src/utils/__tests__/hooks/useCaptureEvents.tsx diff --git a/src/utils/__tests__/hooks/useCaptureEvents.tsx b/src/utils/__tests__/hooks/useCaptureEvents.tsx new file mode 100644 index 000000000000..8ce7d6c77e13 --- /dev/null +++ b/src/utils/__tests__/hooks/useCaptureEvents.tsx @@ -0,0 +1,72 @@ +import { configure, mount } from 'enzyme' +import Adapter from 'enzyme-adapter-react-16' + +configure({ adapter: new Adapter() }) + +import React, { createRef, RefObject } from 'react' +import { renderHook } from '@testing-library/react-hooks' +import { useCapturedInput, captureEevnts } from '../../hooks/useCapturedEvents' + +let containerRef: RefObject +let inputRef: RefObject + +beforeEach(() => { + containerRef = createRef() + inputRef = createRef() + mount( +
+ +
, + ) +}) + +test('invoke callback with input value', () => { + const inputSpy = jasmine.createSpy() + renderHook(() => useCapturedInput(inputSpy, [], inputRef)) + + inputRef.current!.dispatchEvent(new CustomEvent('input', { bubbles: true })) + expect(inputSpy.calls.argsFor(0)).toStrictEqual(['']) + + inputRef.current!.value = 'test' + inputRef.current!.dispatchEvent(new CustomEvent('input', { bubbles: true })) + expect(inputSpy.calls.argsFor(1)).toStrictEqual(['test']) +}) + +for (const name of captureEevnts) { + test(`bypass event: ${name}`, () => { + const containerSpy = jasmine.createSpy() + + containerRef.current!.addEventListener(name, containerSpy) + inputRef.current!.dispatchEvent(new CustomEvent(name, { bubbles: true })) + expect(containerSpy.calls.count()).toBe(1) + + containerRef.current!.removeEventListener(name, containerSpy) // restore + }) + test(`capture event: ${name}`, () => { + const containerSpy = jasmine.createSpy() + renderHook(() => useCapturedInput(() => {}, [], inputRef)) + + containerRef.current!.addEventListener(name, containerSpy) + inputRef.current!.dispatchEvent(new CustomEvent(name, { bubbles: true })) + expect(containerSpy.calls.count()).toBe(0) + + containerRef.current!.removeEventListener(name, containerSpy) // restore + }) + test(`remove listener: ${name}`, () => { + const containerSpy = jasmine.createSpy() + + containerRef.current!.addEventListener(name, containerSpy) + inputRef.current!.dispatchEvent(new CustomEvent(name, { bubbles: true })) + expect(containerSpy.calls.count()).toBe(1) + + const hook = renderHook(() => useCapturedInput(() => {}, [], inputRef)) + inputRef.current!.dispatchEvent(new CustomEvent(name, { bubbles: true })) + expect(containerSpy.calls.count()).toBe(1) + + hook.unmount() + inputRef.current!.dispatchEvent(new CustomEvent(name, { bubbles: true })) + expect(containerSpy.calls.count()).toBe(2) + + containerRef.current!.removeEventListener(name, containerSpy) // restore + }) +} diff --git a/src/utils/hooks/useCapturedEvents.ts b/src/utils/hooks/useCapturedEvents.ts index f2a22161ec02..09e5a952aa1d 100644 --- a/src/utils/hooks/useCapturedEvents.ts +++ b/src/utils/hooks/useCapturedEvents.ts @@ -3,6 +3,22 @@ import { useEffect, useCallback } from 'react' import { or } from '../../components/custom-ui-helper' import React from 'react' +export const captureEevnts: (keyof HTMLElementEventMap)[] = [ + 'paste', + 'keydown', + 'keypress', + 'keyup', + 'input', + 'drag', + 'dragend', + 'dragenter', + 'dragexit', + 'dragleave', + 'dragover', + 'dragstart', + 'change', +] + /** * ! Call this hook inside Shadow Root! */ @@ -34,26 +50,6 @@ export function useCapturedInput( } } useEffect(binder(['input'], use), [ref.current].concat(deps)) - useEffect( - binder( - [ - 'paste', - 'keydown', - 'keypress', - 'keyup', - 'input', - 'drag', - 'dragend', - 'dragenter', - 'dragexit', - 'dragleave', - 'dragover', - 'dragstart', - 'change', - ], - stop, - ), - [ref.current].concat(deps), - ) + useEffect(binder(captureEevnts, stop), [ref.current].concat(deps)) return [binder, ref] as const } From 47a192f3888215bbad1b94e5579c838784e70746 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Tue, 25 Feb 2020 17:37:45 +0800 Subject: [PATCH 38/70] test: add test use query params --- src/utils/__tests__/hooks/useQueryParams.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/utils/__tests__/hooks/useQueryParams.tsx diff --git a/src/utils/__tests__/hooks/useQueryParams.tsx b/src/utils/__tests__/hooks/useQueryParams.tsx new file mode 100644 index 000000000000..7abfdc98ae11 --- /dev/null +++ b/src/utils/__tests__/hooks/useQueryParams.tsx @@ -0,0 +1,18 @@ +import React from 'react' +import { BrowserRouter, HashRouter } from 'react-router-dom' +import { renderHook } from '@testing-library/react-hooks' +import useQueryParams from '../../hooks/useQueryParams' + +function BrwoserRouterWrapper({ children }: { children?: React.ReactNode }) { + return {children} +} +test.only('browser router', () => { + history.replaceState({}, 'test', '/test') + expect(renderHook(() => useQueryParams([]), { wrapper: BrwoserRouterWrapper }).result.current).toEqual({}) + + history.replaceState({}, 'test', '/test?a=a&b=1') + expect(renderHook(() => useQueryParams(['a', 'b']), { wrapper: BrwoserRouterWrapper }).result.current).toEqual({ + a: 'a', + b: '1', + }) +}) From 422de16bfa01de8278d4ba8d0531044a5a1439af Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Tue, 25 Feb 2020 20:03:59 +0800 Subject: [PATCH 39/70] test: add test for use interval --- src/utils/__tests__/hooks/useInterval.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/utils/__tests__/hooks/useInterval.ts diff --git a/src/utils/__tests__/hooks/useInterval.ts b/src/utils/__tests__/hooks/useInterval.ts new file mode 100644 index 000000000000..cb05d6b07cc6 --- /dev/null +++ b/src/utils/__tests__/hooks/useInterval.ts @@ -0,0 +1,14 @@ +import { renderHook } from '@testing-library/react-hooks' +import { useInterval } from '../../hooks/useInterval' + +function wait(delay: number) { + return new Promise(resolve => setTimeout(resolve, delay)) +} + +test('set timer', async () => { + const callbackSpy = jasmine.createSpy() + + renderHook(() => useInterval(callbackSpy, 100)) + await wait(500) + expect(callbackSpy).toHaveBeenCalled() +}) From 20112ed0a3cbe2c86888e10c54190d4dff078f67 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Tue, 25 Feb 2020 20:04:34 +0800 Subject: [PATCH 40/70] test: add test for use drag and drop --- src/utils/__tests__/hooks/useDragAndDrop.tsx | 59 ++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/utils/__tests__/hooks/useDragAndDrop.tsx diff --git a/src/utils/__tests__/hooks/useDragAndDrop.tsx b/src/utils/__tests__/hooks/useDragAndDrop.tsx new file mode 100644 index 000000000000..1be274a7ed2a --- /dev/null +++ b/src/utils/__tests__/hooks/useDragAndDrop.tsx @@ -0,0 +1,59 @@ +import React from 'react' +import { renderHook, act } from '@testing-library/react-hooks' +import { useDragAndDrop } from '../../hooks/useDragAndDrop' + +function createDragEvent(name?: string) { + return ({ + preventDefault() {}, + dataTransfer: { + files: { + item() { + return { + name, + } + }, + }, + }, + } as any) as React.DragEvent +} + +test('drag enter', () => { + const { result } = renderHook(() => useDragAndDrop()) + expect(result.current.dragStatus).toEqual(undefined) + act(() => result.current.dragEvents.onDragEnterCapture(createDragEvent())) + expect(result.current.dragStatus).toEqual('drag-enter') +}) + +test('drag over', () => { + const { result } = renderHook(() => useDragAndDrop()) + expect(result.current.dragStatus).toEqual(undefined) + act(() => result.current.dragEvents.onDragEnterCapture(createDragEvent())) + expect(result.current.dragStatus).toEqual('drag-enter') +}) + +test('drag leave', () => { + const { result } = renderHook(() => useDragAndDrop()) + expect(result.current.dragStatus).toEqual(undefined) + act(() => result.current.dragEvents.onDragLeaveCapture(createDragEvent())) + expect(result.current.dragStatus).toEqual(undefined) +}) + +test('drag drop', () => { + const callbackSpy = jasmine.createSpy() + const { result } = renderHook(() => useDragAndDrop(callbackSpy)) + expect(result.current.dragStatus).toEqual(undefined) + act(() => result.current.dragEvents.onDropCapture(createDragEvent('test'))) + expect(result.current.dragStatus).toEqual('selected') + expect(callbackSpy).toHaveBeenCalled() + expect(callbackSpy.calls.argsFor(0)).toStrictEqual([{ name: 'test' }]) +}) + +test('file receiver', () => { + const callbackSpy = jasmine.createSpy() + const { result } = renderHook(() => useDragAndDrop(callbackSpy)) + expect(result.current.dragStatus).toEqual(undefined) + act(() => result.current.fileReceiver(createDragEvent('test'))) + expect(result.current.dragStatus).toEqual('selected') + expect(callbackSpy).toHaveBeenCalled() + expect(callbackSpy.calls.argsFor(0)).toStrictEqual([{ name: 'test' }]) +}) From fd90f9785c6b6f3982bafff39c7d691d34478752 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Wed, 26 Feb 2020 13:42:19 +0800 Subject: [PATCH 41/70] test: add test for use request camera --- src/utils/__tests__/hooks/useRequestCamera.ts | 120 ++++++++++++++++++ src/utils/hooks/useRequestCamera.ts | 21 +-- 2 files changed, 126 insertions(+), 15 deletions(-) create mode 100644 src/utils/__tests__/hooks/useRequestCamera.ts diff --git a/src/utils/__tests__/hooks/useRequestCamera.ts b/src/utils/__tests__/hooks/useRequestCamera.ts new file mode 100644 index 000000000000..8fbbb4d2f091 --- /dev/null +++ b/src/utils/__tests__/hooks/useRequestCamera.ts @@ -0,0 +1,120 @@ +import { renderHook } from '@testing-library/react-hooks' +import { useRequestCamera, checkPermissionApiUsability, getBackVideoDeviceId } from '../../hooks/useRequestCamera' + +const q = ['query', 'request', 'revoke'] + +function redefineApi(type: typeof q[number], attributes: PropertyDescriptor) { + Object.defineProperty(navigator.permissions, type, attributes) +} + +beforeEach(() => { + Object.defineProperty(navigator, 'permissions', { + value: {}, + writable: true, + }) + Object.defineProperty(navigator, 'mediaDevices', { + value: { + enumerateDevices() { + return [ + { + kind: 'videoinput', + label: 'back', + deviceId: 'back', + }, + ] + }, + }, + writable: true, + }) +}) + +afterEach(() => { + Object.defineProperty(navigator, 'permissions', {}) + Object.defineProperty(navigator, 'mediaDevices', {}) +}) + +test('check permission api usability', () => { + redefineApi('query', { value() {} }) + expect(checkPermissionApiUsability('query')).toBeTruthy() + expect(checkPermissionApiUsability('request')).toBeFalsy() + expect(checkPermissionApiUsability()).toStrictEqual({ + query: true, + request: false, + revoke: false, + }) +}) + +test('get back video device id', async () => { + expect(await getBackVideoDeviceId()).toEqual('back') +}) + +test('request camera permission without permissions api', () => { + expect(renderHook(() => useRequestCamera(true)).result.current).toEqual('granted') +}) + +for (const api of q) { + if (api === 'revoke') { + continue + } + test(`invoke ${api} permission api succeeded`, async () => { + redefineApi(api, { + value() { + return Promise.resolve({ + state: 'granted', + }) + }, + }) + + const hook = renderHook(() => useRequestCamera(true)) + expect(hook.result.current).toEqual('prompt') + await hook.waitForNextUpdate() + expect(hook.result.current).toEqual('granted') + }) + + test(`invoke ${api} permission api failed`, async () => { + redefineApi(api, { + value() { + return Promise.reject(new Error('denied')) + }, + }) + + const hook = renderHook(() => useRequestCamera(true)) + expect(hook.result.current).toEqual('prompt') + await hook.waitForNextUpdate() + expect(hook.result.current).toEqual('granted') + }) +} + +test('permission api not available', async () => { + const hook = renderHook(() => useRequestCamera(true)) + expect(hook.result.current).toEqual('granted') +}) + +test('remove onchange listener', async () => { + const onChangeSpy = jasmine.createSpy() + redefineApi('query', { + value() { + return Promise.resolve( + new Proxy( + { + state: 'granted', + onchange: null, + }, + { + set(target, key, value) { + onChangeSpy(value) + return Reflect.set(target, key, value, target) + }, + }, + ), + ) + }, + }) + + const hook = renderHook(() => useRequestCamera(true)) + await hook.waitForNextUpdate() + hook.unmount() + + expect(typeof onChangeSpy.calls.argsFor(0)[0]).toEqual('function') + expect(onChangeSpy.calls.argsFor(1)).toEqual([null]) +}) diff --git a/src/utils/hooks/useRequestCamera.ts b/src/utils/hooks/useRequestCamera.ts index 1ca6765a1d92..f1954363b062 100644 --- a/src/utils/hooks/useRequestCamera.ts +++ b/src/utils/hooks/useRequestCamera.ts @@ -1,6 +1,5 @@ /** This file is published under MIT License */ import { useEffect, useState } from 'react' -import { useAsync } from '../components/AsyncComponent' import { hasIn } from 'lodash-es' const q = ['query', 'request', 'revoke'] @@ -38,21 +37,10 @@ export function useRequestCamera(needRequest: boolean) { // but rise an error if specific permission name dose not supported updatePermission('granted') }) - } else { - updatePermission('granted') - } - return () => { - if (permissionStatus) permissionStatus.onchange = null - } - }, [needRequest, permission]) - useAsync(async () => { - if (!needRequest || permission !== 'prompt') { - return - } - if (checkPermissionApiUsability('request')) { + } else if (checkPermissionApiUsability('request')) { navigator.permissions .request({ name: 'camera' }) - .then((p: PermissionStatus) => { + .then(p => { updatePermission(p.state) }) .catch(() => { @@ -61,7 +49,10 @@ export function useRequestCamera(needRequest: boolean) { } else { updatePermission('granted') } - }, [permission, needRequest]) + return () => { + if (permissionStatus) permissionStatus.onchange = null + } + }, [needRequest, permission]) return permission } From bdbc10675332297940a7f896ba48c767f77aef1f Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Wed, 26 Feb 2020 15:59:42 +0800 Subject: [PATCH 42/70] test: add test for use async --- src/components/DebugModeUI/PostHashDialog.tsx | 2 +- .../InjectedComponents/PersonKnown.tsx | 2 +- .../InjectedComponents/PostInspector.tsx | 2 +- src/components/shared/qrcode.tsx | 2 +- .../options-page/DashboardDialogs/Persona.tsx | 2 +- .../DashboardInitSteps/Step2S.tsx | 2 +- src/utils/__tests__/hooks/useAsync.ts | 44 ++++++++++++++++++ src/utils/components/AsyncComponent.tsx | 25 ---------- src/utils/hooks/useAsync.ts | 46 +++++++++++++++++++ 9 files changed, 96 insertions(+), 31 deletions(-) create mode 100644 src/utils/__tests__/hooks/useAsync.ts create mode 100644 src/utils/hooks/useAsync.ts diff --git a/src/components/DebugModeUI/PostHashDialog.tsx b/src/components/DebugModeUI/PostHashDialog.tsx index 9f97c252e7d9..f9306111a1b0 100644 --- a/src/components/DebugModeUI/PostHashDialog.tsx +++ b/src/components/DebugModeUI/PostHashDialog.tsx @@ -10,12 +10,12 @@ import { blue } from '@material-ui/core/colors' import { useFriendsList } from '../DataSource/useActivatedUI' import { Avatar } from '../../utils/components/Avatar' import { Profile } from '../../database' -import { useAsync } from '../../utils/components/AsyncComponent' import Services from '../../extension/service' import { PostIVIdentifier } from '../../database/type' import { deconstructPayload } from '../../utils/type-transform/Payload' import { DialogContentText, DialogContent } from '@material-ui/core' import ShadowRootDialog from '../../utils/jss/ShadowRootDialog' +import { useAsync } from '../../utils/hooks/useAsync' const useStyles = makeStyles({ avatar: { diff --git a/src/components/InjectedComponents/PersonKnown.tsx b/src/components/InjectedComponents/PersonKnown.tsx index 4ae5c7a3b12b..8a1635ae732a 100644 --- a/src/components/InjectedComponents/PersonKnown.tsx +++ b/src/components/InjectedComponents/PersonKnown.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { AdditionalContent, AdditionalContentProps } from './AdditionalPostContent' import { useI18N } from '../../utils/i18n-next-ui' -import AsyncComponent, { useAsync } from '../../utils/components/AsyncComponent' +import AsyncComponent from '../../utils/components/AsyncComponent' import { ProfileIdentifier } from '../../database/type' import Services from '../../extension/service' import { ValueRef } from '@holoflows/kit/es' diff --git a/src/components/InjectedComponents/PostInspector.tsx b/src/components/InjectedComponents/PostInspector.tsx index 93bee2dee449..273d9d701558 100644 --- a/src/components/InjectedComponents/PostInspector.tsx +++ b/src/components/InjectedComponents/PostInspector.tsx @@ -1,7 +1,6 @@ import React, { useState } from 'react' import { DecryptPost, DecryptPostProps } from './DecryptedPost' import { AddToKeyStore, AddToKeyStoreProps } from './AddToKeyStore' -import { useAsync } from '../../utils/components/AsyncComponent' import { deconstructPayload } from '../../utils/type-transform/Payload' import Services from '../../extension/service' import { ProfileIdentifier, PostIdentifier } from '../../database/type' @@ -12,6 +11,7 @@ import { useValueRef } from '../../utils/hooks/useValueRef' import { debugModeSetting } from '../shared-settings/settings' import { DebugList } from '../DebugModeUI/DebugList' import { TypedMessage } from '../../extension/background-script/CryptoServices/utils' +import { useAsync } from '../../utils/hooks/useAsync' export interface PostInspectorProps { onDecrypted(post: TypedMessage): void diff --git a/src/components/shared/qrcode.tsx b/src/components/shared/qrcode.tsx index b0033e214745..4dcbb5030326 100644 --- a/src/components/shared/qrcode.tsx +++ b/src/components/shared/qrcode.tsx @@ -1,8 +1,8 @@ import React from 'react' import qr from 'qrcode' import { useRef, useEffect } from 'react' -import { useAsync } from '../../utils/components/AsyncComponent' import { iOSHost } from '../../utils/iOS-RPC' +import { useAsync } from '../../utils/hooks/useAsync' const cache = new Proxy(sessionStorage, { get(t, p: 'get' | 'set') { diff --git a/src/extension/options-page/DashboardDialogs/Persona.tsx b/src/extension/options-page/DashboardDialogs/Persona.tsx index e728f792dc41..9086d4f6db83 100644 --- a/src/extension/options-page/DashboardDialogs/Persona.tsx +++ b/src/extension/options-page/DashboardDialogs/Persona.tsx @@ -10,7 +10,6 @@ import { ECKeyIdentifier, Identifier } from '../../../database/type' import Services from '../../service' import { Persona } from '../../../database' import useQueryParams from '../../../utils/hooks/useQueryParams' -import { useAsync } from '../../../utils/components/AsyncComponent' import ProfileBox from '../DashboardComponents/ProfileBox' import { useColorProvider } from '../../../utils/theme' import { useI18N } from '../../../utils/i18n-next-ui' @@ -26,6 +25,7 @@ import { decodeArrayBuffer, } from '../../../utils/type-transform/String-ArrayBuffer' import { selectElementContents } from '../../../utils/utils' +import { useAsync } from '../../../utils/hooks/useAsync' export function PersonaCreateDialog() { const { t } = useI18N() diff --git a/src/extension/options-page/DashboardInitSteps/Step2S.tsx b/src/extension/options-page/DashboardInitSteps/Step2S.tsx index 8924de26b5cb..1b0d0b954a1d 100644 --- a/src/extension/options-page/DashboardInitSteps/Step2S.tsx +++ b/src/extension/options-page/DashboardInitSteps/Step2S.tsx @@ -8,10 +8,10 @@ import useQueryParams from '../../../utils/hooks/useQueryParams' import Services from '../../service' import { ECKeyIdentifier, Identifier } from '../../../database/type' import { Persona } from '../../../database' -import { useAsync } from '../../../utils/components/AsyncComponent' import ProfileBox from '../DashboardComponents/ProfileBox' import { useMyPersonas } from '../../../components/DataSource/useActivatedUI' import { InitStep } from '../InitStep' +import { useAsync } from '../../../utils/hooks/useAsync' export default function InitStep2S() { const { t } = useI18N() diff --git a/src/utils/__tests__/hooks/useAsync.ts b/src/utils/__tests__/hooks/useAsync.ts new file mode 100644 index 000000000000..41ff55fc62d3 --- /dev/null +++ b/src/utils/__tests__/hooks/useAsync.ts @@ -0,0 +1,44 @@ +import { renderHook } from '@testing-library/react-hooks' +import { useAsync } from '../../hooks/useAsync' + +function wait(delay: number) { + return new Promise(resolve => setTimeout(resolve, delay)) +} + +test('fast fullfill', async () => { + const thenable = renderHook(() => useAsync(() => Promise.resolve(0), [])).result.current + expect(await thenable).toBe(0) +}) + +test('fast reject', async () => { + const thenable = renderHook(() => useAsync(() => Promise.reject(new Error('reject')), [])).result.current + try { + await thenable + } catch (e) { + expect(e).toEqual(new Error('reject')) + } +}) + +test('slow fulfill', async () => { + const thenable = renderHook(() => + useAsync(async () => { + await wait(100) + return 0 + }, []), + ).result.current + expect(await thenable).toBe(0) +}) + +test('slow reject', async () => { + const thenable = renderHook(() => + useAsync(async () => { + await wait(100) + throw new Error('reject') + }, []), + ).result.current + try { + await thenable + } catch (e) { + expect(e).toEqual(new Error('reject')) + } +}) diff --git a/src/utils/components/AsyncComponent.tsx b/src/utils/components/AsyncComponent.tsx index 593aa116e073..2cbef63ab293 100644 --- a/src/utils/components/AsyncComponent.tsx +++ b/src/utils/components/AsyncComponent.tsx @@ -51,28 +51,3 @@ export default function AsyncComponent(props: { ) } - -/** React hook for not-cancelable async calculation */ -export function useAsync(fn: () => PromiseLike, dep: ReadonlyArray): PromiseLike { - let res: Parameters[0]>[0] = () => {}, - rej: Parameters[0]>[1] = () => {} - React.useEffect(() => { - let unmounted = false - fn().then( - x => unmounted || res(x), - err => unmounted || rej(err), - ) - return () => { - unmounted = true - } - // eslint-disable-next-line - }, dep) - return { - then(f, r) { - return new Promise((resolve, reject) => { - res = (val: any) => (f ? resolve(f(val)) : resolve(val)) - rej = (err: any) => (r ? resolve(r(err)) : reject(err)) - }) - }, - } -} diff --git a/src/utils/hooks/useAsync.ts b/src/utils/hooks/useAsync.ts new file mode 100644 index 000000000000..493bde51c140 --- /dev/null +++ b/src/utils/hooks/useAsync.ts @@ -0,0 +1,46 @@ +import { useEffect, useRef, MutableRefObject } from 'react' + +const UNSET = Symbol('UNSET') + +/** React hook for not-cancelable async calculation */ +export function useAsync(fn: () => PromiseLike, dep: ReadonlyArray): PromiseLike { + let res: Parameters[0]>[0] = () => {} + let rej: Parameters[0]>[1] = () => {} + const resResult: MutableRefObject = useRef(UNSET) + const rejResult: MutableRefObject = useRef(UNSET) + useEffect(() => { + let unmounted = false + fn().then( + x => { + if (!unmounted) { + resResult.current = x + res(x) + } + }, + err => { + if (!unmounted) { + rejResult.current = err + rej(err) + } + }, + ) + return () => { + unmounted = true + } + // eslint-disable-next-line + }, dep) + return { + then(f, r) { + if (resResult.current !== UNSET) { + return Promise.resolve(f ? f(resResult.current) : resResult.current) + } + if (rejResult.current !== UNSET) { + return r ? Promise.resolve(r(rejResult.current)) : Promise.reject(rejResult.current) + } + return new Promise((resolve, reject) => { + res = (val: any) => (f ? resolve(f(val)) : resolve(val)) + rej = (err: any) => (r ? resolve(r(err)) : reject(err)) + }) + }, + } +} From f59c81382c805c9d9c54bad2d58b66bb51b3fa18 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Wed, 26 Feb 2020 16:31:52 +0800 Subject: [PATCH 43/70] test: add test for use value ref --- src/utils/__tests__/hooks/useValueRef.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/utils/__tests__/hooks/useValueRef.ts diff --git a/src/utils/__tests__/hooks/useValueRef.ts b/src/utils/__tests__/hooks/useValueRef.ts new file mode 100644 index 000000000000..cece8b4c0922 --- /dev/null +++ b/src/utils/__tests__/hooks/useValueRef.ts @@ -0,0 +1,14 @@ +import { ValueRef } from '@holoflows/kit/es' +import { renderHook, act } from '@testing-library/react-hooks' +import { useValueRef } from '../../hooks/useValueRef' + +test('update ref', async () => { + const valueRef = new ValueRef(0) + const hook = renderHook(() => useValueRef(valueRef)) + + expect(hook.result.current).toEqual(0) + act(() => { + valueRef.value = 1 + }) + expect(hook.result.current).toEqual(1) +}) From d731009902a53ea6389f78e8f490fc9dc65abb83 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Wed, 26 Feb 2020 16:35:17 +0800 Subject: [PATCH 44/70] test: add test for use connecting status --- src/utils/__tests__/hooks/useConnectingStatus.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/utils/__tests__/hooks/useConnectingStatus.ts diff --git a/src/utils/__tests__/hooks/useConnectingStatus.ts b/src/utils/__tests__/hooks/useConnectingStatus.ts new file mode 100644 index 000000000000..e28233ad0fd6 --- /dev/null +++ b/src/utils/__tests__/hooks/useConnectingStatus.ts @@ -0,0 +1,7 @@ +import { renderHook } from '@testing-library/react-hooks' +import useConnectingStatus from '../../hooks/useConnectingStatus' + +test('connecting status', () => { + const hook = renderHook(() => useConnectingStatus()) + expect(hook.result.current).toBeFalsy() +}) From d625e7585bd3f8f0a8f1ecb64bfe98eec8af603e Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Wed, 26 Feb 2020 17:27:07 +0800 Subject: [PATCH 45/70] test: add test for use qr code scan --- .../__tests__/hooks/useCaptureEvents.tsx | 6 +- src/utils/__tests__/hooks/useQRCodeScan.tsx | 97 +++++++++++++++++++ src/utils/__tests__/hooks/useRequestCamera.ts | 21 +--- src/utils/hooks/useQRCodeScan.tsx | 15 ++- src/utils/hooks/useRequestCamera.ts | 12 --- 5 files changed, 113 insertions(+), 38 deletions(-) create mode 100644 src/utils/__tests__/hooks/useQRCodeScan.tsx diff --git a/src/utils/__tests__/hooks/useCaptureEvents.tsx b/src/utils/__tests__/hooks/useCaptureEvents.tsx index 8ce7d6c77e13..a209267acb12 100644 --- a/src/utils/__tests__/hooks/useCaptureEvents.tsx +++ b/src/utils/__tests__/hooks/useCaptureEvents.tsx @@ -7,12 +7,10 @@ import React, { createRef, RefObject } from 'react' import { renderHook } from '@testing-library/react-hooks' import { useCapturedInput, captureEevnts } from '../../hooks/useCapturedEvents' -let containerRef: RefObject -let inputRef: RefObject +const containerRef: RefObject = createRef() +const inputRef: RefObject = createRef() beforeEach(() => { - containerRef = createRef() - inputRef = createRef() mount(
diff --git a/src/utils/__tests__/hooks/useQRCodeScan.tsx b/src/utils/__tests__/hooks/useQRCodeScan.tsx new file mode 100644 index 000000000000..24c12e8e39fc --- /dev/null +++ b/src/utils/__tests__/hooks/useQRCodeScan.tsx @@ -0,0 +1,97 @@ +import { configure, mount } from 'enzyme' +import Adapter from 'enzyme-adapter-react-16' + +configure({ adapter: new Adapter() }) + +import React, { createRef, RefObject } from 'react' +import { renderHook } from '@testing-library/react-hooks' +import { useQRCodeScan, getBackVideoDeviceId } from '../../hooks/useQRCodeScan' + +function wait(delay: number) { + return new Promise(resolve => setTimeout(resolve, delay)) +} + +const videoRef: RefObject = createRef() + +beforeAll(() => { + window.HTMLMediaElement.prototype.play = () => Promise.resolve() + window.HTMLMediaElement.prototype.pause = () => {} +}) + +afterAll(() => { + delete window.HTMLMediaElement.prototype.play + delete window.HTMLMediaElement.prototype.pause +}) + +beforeEach(() => { + Object.defineProperty(navigator, 'mediaDevices', { + value: { + getUserMedia() { + return { + getTracks() { + return [{ stop() {} }] + }, + } + }, + enumerateDevices() { + return [ + { + kind: 'videoinput', + label: 'back', + deviceId: 'back', + }, + ] + }, + }, + writable: true, + }) + mount( +
+
, + ) +}) + +afterEach(() => { + Object.defineProperty(navigator, 'mediaDevices', {}) +}) + +test('get back video device id', async () => { + expect(await getBackVideoDeviceId()).toEqual('back') +}) + +test('scan succeeded', async () => { + class BarcodeDetector { + detect() { + return 'test' + } + } + // @ts-ignore + window.BarcodeDetector = BarcodeDetector + + const onResultSpy = jasmine.createSpy() + const hook = renderHook(() => useQRCodeScan(videoRef, true, onResultSpy, () => {})) + + await hook.waitForNextUpdate() + expect(onResultSpy.calls.count()).toBe(0) + await wait(200) + expect(onResultSpy.calls.count() > 0).toBeTruthy() +}) + +test('scan failed', async () => { + class BarcodeDetector { + detect() { + throw new Error('error') + } + } + // @ts-ignore + window.BarcodeDetector = BarcodeDetector + + const onErrorSpy = jasmine.createSpy() + const hook = renderHook(() => useQRCodeScan(videoRef, true, () => {}, onErrorSpy)) + + await hook.waitForNextUpdate() + expect(onErrorSpy.calls.count()).toBe(0) + await wait(1200) + expect(onErrorSpy.calls.count() > 0).toBeTruthy() +}) diff --git a/src/utils/__tests__/hooks/useRequestCamera.ts b/src/utils/__tests__/hooks/useRequestCamera.ts index 8fbbb4d2f091..509edc193ce5 100644 --- a/src/utils/__tests__/hooks/useRequestCamera.ts +++ b/src/utils/__tests__/hooks/useRequestCamera.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks' -import { useRequestCamera, checkPermissionApiUsability, getBackVideoDeviceId } from '../../hooks/useRequestCamera' +import { useRequestCamera, checkPermissionApiUsability } from '../../hooks/useRequestCamera' const q = ['query', 'request', 'revoke'] @@ -12,25 +12,10 @@ beforeEach(() => { value: {}, writable: true, }) - Object.defineProperty(navigator, 'mediaDevices', { - value: { - enumerateDevices() { - return [ - { - kind: 'videoinput', - label: 'back', - deviceId: 'back', - }, - ] - }, - }, - writable: true, - }) }) afterEach(() => { Object.defineProperty(navigator, 'permissions', {}) - Object.defineProperty(navigator, 'mediaDevices', {}) }) test('check permission api usability', () => { @@ -44,10 +29,6 @@ test('check permission api usability', () => { }) }) -test('get back video device id', async () => { - expect(await getBackVideoDeviceId()).toEqual('back') -}) - test('request camera permission without permissions api', () => { expect(renderHook(() => useRequestCamera(true)).result.current).toEqual('granted') }) diff --git a/src/utils/hooks/useQRCodeScan.tsx b/src/utils/hooks/useQRCodeScan.tsx index 0586eae05c56..d76fa46e44af 100644 --- a/src/utils/hooks/useQRCodeScan.tsx +++ b/src/utils/hooks/useQRCodeScan.tsx @@ -1,10 +1,22 @@ /// /** This file is published under MIT License */ import { useRef, useEffect, useState } from 'react' -import { useRequestCamera, getBackVideoDeviceId } from './useRequestCamera' +import { useRequestCamera } from './useRequestCamera' import { useInterval } from './useInterval' import '../../components/QRScanner/ShapeDetectionPolyfill' +export async function getBackVideoDeviceId() { + const devices = (await navigator.mediaDevices.enumerateDevices()).filter(devices => devices.kind === 'videoinput') + const back = devices.find( + device => + (device.label.toLowerCase().search('back') !== -1 || device.label.toLowerCase().search('rear') !== -1) && + device.label.toLowerCase().search('front') === -1, + ) + if (back) return back.deviceId + if (devices[0]) return devices[0].deviceId + return null +} + export function useQRCodeScan( video: React.MutableRefObject, isScanning: boolean, @@ -70,7 +82,6 @@ export function useQRCodeScan( if (result) onResult(result.rawValue) } catch (e) { errorTimes.current += 1 - console.error(e) } finally { lastScanning.current = false } diff --git a/src/utils/hooks/useRequestCamera.ts b/src/utils/hooks/useRequestCamera.ts index f1954363b062..b85aea53b837 100644 --- a/src/utils/hooks/useRequestCamera.ts +++ b/src/utils/hooks/useRequestCamera.ts @@ -55,15 +55,3 @@ export function useRequestCamera(needRequest: boolean) { }, [needRequest, permission]) return permission } - -export async function getBackVideoDeviceId() { - const devices = (await navigator.mediaDevices.enumerateDevices()).filter(devices => devices.kind === 'videoinput') - const back = devices.find( - device => - (device.label.toLowerCase().search('back') !== -1 || device.label.toLowerCase().search('rear') !== -1) && - device.label.toLowerCase().search('front') === -1, - ) - if (back) return back.deviceId - if (devices[0]) return devices[0].deviceId - return null -} From 744984ce7d8364894756a75d7035f56ecb9d3570 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Wed, 26 Feb 2020 17:42:58 +0800 Subject: [PATCH 46/70] refactor: remove wait use sleep instead --- jest.config.js | 6 +++--- src/utils/__tests__/hooks/useAsync.ts | 9 +++------ src/utils/__tests__/hooks/useInterval.ts | 7 ++----- src/utils/__tests__/hooks/useQRCodeScan.tsx | 9 +++------ 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/jest.config.js b/jest.config.js index 677ad4c8b94f..24ff4fd091ed 100644 --- a/jest.config.js +++ b/jest.config.js @@ -14,13 +14,13 @@ module.exports = { require.resolve('fake-indexeddb/auto'), path.join(__dirname, './scripts/jest-setup.js'), ], - // skip packages other than 'ts-results' and 'async-call-rpc' - transformIgnorePatterns: ['node_modules((?!(ts-results|async-call-rpc)).)*$'], + // skip packages other than 'ts-results', 'async-call-rpc' and 'holoflows/kit' + transformIgnorePatterns: ['node_modules((?!(ts-results|async-call-rpc|@holoflows\\/kit)).)*$'], transform: { '[/\\\\]node_modules[/\\\\].+\\.m?js$': 'jest-esm-transformer', }, moduleNameMapper: { - '^@holoflows/kit.+$': require.resolve('@holoflows/kit/umd/index.js'), + '^@holoflows/kit.+(? setTimeout(resolve, delay)) -} +import { sleep } from '../../utils' test('fast fullfill', async () => { const thenable = renderHook(() => useAsync(() => Promise.resolve(0), [])).result.current @@ -22,7 +19,7 @@ test('fast reject', async () => { test('slow fulfill', async () => { const thenable = renderHook(() => useAsync(async () => { - await wait(100) + await sleep(100) return 0 }, []), ).result.current @@ -32,7 +29,7 @@ test('slow fulfill', async () => { test('slow reject', async () => { const thenable = renderHook(() => useAsync(async () => { - await wait(100) + await sleep(100) throw new Error('reject') }, []), ).result.current diff --git a/src/utils/__tests__/hooks/useInterval.ts b/src/utils/__tests__/hooks/useInterval.ts index cb05d6b07cc6..ea7fa49548cd 100644 --- a/src/utils/__tests__/hooks/useInterval.ts +++ b/src/utils/__tests__/hooks/useInterval.ts @@ -1,14 +1,11 @@ import { renderHook } from '@testing-library/react-hooks' import { useInterval } from '../../hooks/useInterval' - -function wait(delay: number) { - return new Promise(resolve => setTimeout(resolve, delay)) -} +import { sleep } from '../../utils' test('set timer', async () => { const callbackSpy = jasmine.createSpy() renderHook(() => useInterval(callbackSpy, 100)) - await wait(500) + await sleep(500) expect(callbackSpy).toHaveBeenCalled() }) diff --git a/src/utils/__tests__/hooks/useQRCodeScan.tsx b/src/utils/__tests__/hooks/useQRCodeScan.tsx index 24c12e8e39fc..7de8833d7ea0 100644 --- a/src/utils/__tests__/hooks/useQRCodeScan.tsx +++ b/src/utils/__tests__/hooks/useQRCodeScan.tsx @@ -6,10 +6,7 @@ configure({ adapter: new Adapter() }) import React, { createRef, RefObject } from 'react' import { renderHook } from '@testing-library/react-hooks' import { useQRCodeScan, getBackVideoDeviceId } from '../../hooks/useQRCodeScan' - -function wait(delay: number) { - return new Promise(resolve => setTimeout(resolve, delay)) -} +import { sleep } from '../../utils' const videoRef: RefObject = createRef() @@ -74,7 +71,7 @@ test('scan succeeded', async () => { await hook.waitForNextUpdate() expect(onResultSpy.calls.count()).toBe(0) - await wait(200) + await sleep(200) expect(onResultSpy.calls.count() > 0).toBeTruthy() }) @@ -92,6 +89,6 @@ test('scan failed', async () => { await hook.waitForNextUpdate() expect(onErrorSpy.calls.count()).toBe(0) - await wait(1200) + await sleep(1200) expect(onErrorSpy.calls.count() > 0).toBeTruthy() }) From f06ce4415817b2cd64f208894842a59902336e51 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Wed, 26 Feb 2020 19:08:34 +0800 Subject: [PATCH 47/70] chore: remove use connecting status --- src/components/InjectedComponents/PostDialogHint.tsx | 6 ++++-- src/components/shared-settings/createSettings.tsx | 4 ++-- src/utils/__tests__/hooks/useConnectingStatus.ts | 7 ------- src/utils/hooks/useConnectingStatus.ts | 8 -------- 4 files changed, 6 insertions(+), 19 deletions(-) delete mode 100644 src/utils/__tests__/hooks/useConnectingStatus.ts delete mode 100644 src/utils/hooks/useConnectingStatus.ts diff --git a/src/components/InjectedComponents/PostDialogHint.tsx b/src/components/InjectedComponents/PostDialogHint.tsx index d6c45207878b..02c67cc355db 100644 --- a/src/components/InjectedComponents/PostDialogHint.tsx +++ b/src/components/InjectedComponents/PostDialogHint.tsx @@ -8,7 +8,9 @@ import { Profile } from '../../database' import { ChooseIdentity, ChooseIdentityProps } from '../shared/ChooseIdentity' import { BannerProps } from '../Welcomes/Banner' import { NotSetupYetPrompt } from '../shared/NotSetupYetPrompt' -import useConnectingStatus from '../../utils/hooks/useConnectingStatus' +import { useValueRef } from '../../utils/hooks/useValueRef' +import { currentImmersiveSetupStatus } from '../shared-settings/settings' +import { getActivatedUI } from '../../social-network/ui' const useStyles = makeStyles(theme => ({ content: { @@ -65,7 +67,7 @@ export function PostDialogHint(props: PostDialogHintProps) { const identities = or(props.identities, useMyIdentities()) const ui = {}} {...props} /> - const connecting = useConnectingStatus() + const connecting = useValueRef(currentImmersiveSetupStatus[getActivatedUI().networkIdentifier]) if (connecting) return null diff --git a/src/components/shared-settings/createSettings.tsx b/src/components/shared-settings/createSettings.tsx index 79c6615ee579..465c4bc667c2 100644 --- a/src/components/shared-settings/createSettings.tsx +++ b/src/components/shared-settings/createSettings.tsx @@ -17,7 +17,7 @@ function createInternalSettings( const instanceKey = `${storage}+${key}` update(instanceKey) settings.addListener(async newVal => { - const stored = ((await browser.storage.local.get())[storage] as object) || {} + const stored = ((await browser.storage.local.get(null))[storage] as object) || {} await browser.storage.local.set({ [storage]: { ...stored, [key]: newVal }, }) @@ -27,7 +27,7 @@ function createInternalSettings( async function update(receivedKey: string) { if (receivedKey !== instanceKey) return if (typeof browser === 'object') { - const value = await browser.storage.local.get() + const value = await browser.storage.local.get(null) const stored = value[storage] if (typeof stored === 'object' && stored !== null && key in (stored as any)) { settings.value = Reflect.get(stored, key) diff --git a/src/utils/__tests__/hooks/useConnectingStatus.ts b/src/utils/__tests__/hooks/useConnectingStatus.ts deleted file mode 100644 index e28233ad0fd6..000000000000 --- a/src/utils/__tests__/hooks/useConnectingStatus.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { renderHook } from '@testing-library/react-hooks' -import useConnectingStatus from '../../hooks/useConnectingStatus' - -test('connecting status', () => { - const hook = renderHook(() => useConnectingStatus()) - expect(hook.result.current).toBeFalsy() -}) diff --git a/src/utils/hooks/useConnectingStatus.ts b/src/utils/hooks/useConnectingStatus.ts deleted file mode 100644 index b266a7172c4d..000000000000 --- a/src/utils/hooks/useConnectingStatus.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { useValueRef } from './useValueRef' -import { currentImmersiveSetupStatus } from '../../components/shared-settings/settings' -import { getActivatedUI } from '../../social-network/ui' - -export default function useConnectingStatus() { - const setupStatus = useValueRef(currentImmersiveSetupStatus[getActivatedUI().networkIdentifier]) - return !!setupStatus -} From 1dc2a575254bb78a8584c096f5fa347bdbe28acc Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Tue, 25 Feb 2020 14:32:25 +0800 Subject: [PATCH 48/70] Done review for the first 60 lines --- src/_locales/en/messages.json | 45 +++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index c820cbfba5b3..6a5efc4b4def 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -1,59 +1,62 @@ { - "add_persona": "Add Persona", - "add_to_key_store_failed_text": "{{error}}\nThis public key won't be saved.", - "add_to_key_store_failed_title": "Maskbook public key NOT verified ❌", - "add_to_key_store_success": "Maskbook public key added to the Keystore ✔", - "add_to_key_store_verifying": "Maskbook public key found, verifying...", + "add_persona": "Add a persona", + "add_to_key_store_failed_text": "{{error}}\nThis public key won't be saved in Maskbook.", + "add_to_key_store_failed_title": "[Maskbook] The public key is NOT verified ❌", + "add_to_key_store_success": "[Maskbook] The public key has been added to the Keystore ✔", + "add_to_key_store_verifying": "[Maskbook] The public key has been found, verifying...", "adding": "Adding...", "additional_post_box__encrypted_failed": "Please paste the following text into the post box.", "additional_post_box__encrypted_post_pre": "Decrypt this post with #Maskbook ! {{encrypted}}", + "additional_post_box__placeholder_w_name": "Hey {{user}}, what's on your mind? Encrypt it with Maskbook.", + "additional_post_box__placeholder_wo_name": "What's on your mind? Encrypt it with Maskbook.", + "additional_post_box__post_button": "📫 Post it!", "additional_post_box__steganography_post_failed": "Please upload the downloaded image into the post box.", "additional_post_box__steganography_post_pre": "This post is shared with my friends. You may install Maskbook to decrypt the content from the image. ([I:b]) {{random}}", "advanced": "Advanced...", - "automation_pasted_into_bio_box": "[Maskbook] We have helped you append the public key to your bio, confirm by publishing it!", + "automation_pasted_into_bio_box": "[Maskbook] We helped you append the public key to your bio. Please review and publish it!", "automation_request_click_edit_bio_button": "Please click the “Edit bio” button or the pencil on the bio box.", "automation_request_paste_into_bio_box": "Please copy your public key into the bio box and publish it.", "automation_request_paste_into_post_box": "Please copy your public key and publish it to your timeline!", "back": "Back", "backup": "Backup", - "backup_persona": "Backup Persona", - "banner_empty_username": "If not filled automatically, you may fill it.", + "backup_persona": "Backup your persona.", + "banner_empty_username": "If not filled automatically, you may enter it yourself.", "banner_get_started": "Setup Maskbook", "banner_invalid_username": "This does not seem like a valid username.", - "banner_preparing_setup": "Maskbook needs to set up your account.", + "banner_preparing_setup": "You need to setup your Maskbook account.", "banner_title": "Welcome to Maskbook", "cancel": "Cancel", "comment_box__paste_failed": "Please paste it into the comment box.", - "comment_box__placeholder": "Write an encrypted comment...", + "comment_box__placeholder": "Add an encrypted comment...", "connect": "Connect", - "connect_profile": "Connect Profile", + "connect_profile": "Connect your profile", "connecting": "Connecting...", "copy": "Copy", "create": "Create", - "create_persona": "Create a Persona", + "create_persona": "Create a persona", "dashboard": "Dashboard", - "dashboard_add_new_persona": "Add New Persona", + "dashboard_add_new_persona": "Add a new persona", "dashboard_advanced_restoration": "Advanced Restoration Options", "dashboard_attach_profile_step1": "Step 1: Copy the public key below", "dashboard_attach_profile_step2": "Step 2: Paste it into your profile biography", - "dashboard_attach_profile_step2_hint": "Hand-by-hand guides will show up after you move to the webpage.", + "dashboard_attach_profile_step2_hint": "Hand-by-hand guides will show up after you redirect to the webpage.", "dashboard_attach_profile_step3": "Step 3: Test and finish", "dashboard_attach_profile_step3_hint": "Come back here and finish the procedure. Test if your setup is successful.", - "dashboard_backup_database_hint": "Create a database backup file. Do it frequently.", - "dashboard_backup_persona_hint": "You can backup the persona with either way below.", - "dashboard_backup_persona_mnemonic_hint": "Keep the 12 words above carefully in a safe place. You will need them to restore the private key of this persona.", + "dashboard_backup_database_hint": "Create a database backup file. Do it regularly.", + "dashboard_backup_persona_hint": "You can backup your persona in the following options.", + "dashboard_backup_persona_mnemonic_hint": "Keep the 12 mnemonic words above carefully in a safe place. You will need them to restore the private key of this persona.", "dashboard_backup_persona_qr_hint": "Keep the QR code carefully in a safe place. You will need them to restore the private key of this persona.", "dashboard_backup_persona_text_hint": "Keep the text above carefully in a safe place. You will need them to restore the private key of this persona.", "dashboard_bio_test_failed": "The profile bio should include {{bio}}. Please make sure you updated the profile bio of @{{name}} successfully.", - "dashboard_bio_test_succeeful": "You have successfully connected @{{profile}} on {{domain}} to persona {{persona}}.", - "dashboard_connect_profile_for": "Connect Profile for {{persona}}", + "dashboard_bio_test_succeeful": "You have successfully connected your persona {{persona}} to @{{profile}} on {{domain}}.", + "dashboard_connect_profile_for": "Connect {{persona}} to your profile", "dashboard_connected": "Connected", "dashboard_create_backup": "Backup", "dashboard_create_persona_hint": "Create a new persona.", "dashboard_database_import_successful_hint": "Your database has been restored. Existing data will be merged.", "dashboard_delete_persona": "Delete", - "dashboard_delete_persona_confirm_hint": "Do you want to delete persona {{name}}? This operation cannot be reverted.", - "dashboard_disconnect_profile_hint": "Do you want to disconnect {{profile}} on {{network}} from persona {{persona}}? This operation cannot be reverted.", + "dashboard_delete_persona_confirm_hint": "Do you want to delete the persona {{name}}? This operation cannot be reverted.", + "dashboard_disconnect_profile_hint": "Do you want to disconnect {{profile}} on {{network}} from the persona {{persona}}? This operation cannot be reverted.", "dashboard_download": "Download as File", "dashboard_export_keystore": "Export Backup Keystore", "dashboard_hide_qr": "Hide QR Code", From 282ba03078eaee0db00b2cf99bb2825cee882df0 Mon Sep 17 00:00:00 2001 From: Jack Works Date: Thu, 27 Feb 2020 14:37:29 +0800 Subject: [PATCH 49/70] chore: i18n follow review --- src/_locales/en/messages.json | 67 +++-------------------------------- src/_locales/zh/messages.json | 61 +------------------------------ 2 files changed, 5 insertions(+), 123 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 6a5efc4b4def..7cd9a3413fe7 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -147,7 +147,7 @@ "options_mobile_export_subtitle": "DO NOT save or share it with others!", "payload_bad": "This post seemed to be corrupted. Maskbook cannot decrypt it.", "payload_incomplete": "This post is not complete, you need to view the full post.", - "payload_not_found": "Doesn't find the payload", + "payload_not_found": "Cannot find the payload", "payload_throw_in_alpha41": "Support for Alpha41 is dropped. Tell your friends to upgrade Maskbook!", "person_or_group_in_chip": "{{name}} ({{count}} in the group)", "person_or_group_in_list_0": "This is an empty group", @@ -195,9 +195,9 @@ "set_up": "Set up", "settings": "Settings", "settings_disable_new_background_tab": "Disable open hidden tabs in the background", - "settings_disable_new_background_tab_desc": "This is a deprecated behavior of Maskbook. If you find that you cannot decrypt some old posts, deselect this.", + "settings_disable_new_background_tab_desc": "Deprecated behavior. Enable if you need to decrypt ancient posts (created before Jan 2020).", "settings_enable_debug": "Enable debug mode", - "settings_enable_debug_desc": "Enable this will display additional information on the Maskbook UI to help to debug", + "settings_enable_debug_desc": "See additional information for debugging.", "settings_image_based_payload": "Enable image-based mode", "settings_image_based_payload_desc": "Publishing post with image-based payload instead of text payload", "settings_language": "Language", @@ -214,65 +214,6 @@ "unknown_persona": "Unknown Persona", "username": "Username", "version": "Version", - "welcome_0_close_button": "I'll do it later", - "welcome_0_restore_key": "I want to restore my backup", - "welcome_1a1_didntfind": "Didn't you find your account?", - "welcome_1a1_title": "To set up which account?", - "welcome_1a1b_connect": "Connect", - "welcome_1a1b_danger": "Censored network", - "welcome_1a1b_switch": "Use existing accounts", - "welcome_1a1b_title": "Maskbook supports these social networks", - "welcome_1a2_description": "Then, only friends you select with Maskbook can see the posted content.", - "welcome_1a2_done_button": "Nice!", - "welcome_1a2_imgalt": "Screenshot of how to encrypt a message with Maskbook", - "welcome_1a2_title": "Encrypt message in a Maskbook postbox", - "welcome_1a3_description1": "Our extension is asking you to download your key as a file.", - "welcome_1a3_description2": "Back it up often.", - "welcome_1a3_done_button": "Got it!", - "welcome_1a3_title": "Keep your backups carefully", - "welcome_1a3a_connect_subtitle": "will use the same CryptoKey", - "welcome_1a3a_connect_title": "Connect other accounts", - "welcome_1a3a_generate_new_key": "Generate", - "welcome_1a3a_generate_new_key_password_help": "Please remember the key, or your key will not be able to restore.", - "welcome_1a3a_generate_new_key_password_label": "Password for the new key", - "welcome_1a3a_generate_new_key_result": "The mnemonic word", - "welcome_1a3a_generate_new_key_result_help": "Mnemonic word is used to restore the key. Make sure you keep it safe.", - "welcome_1a3a_generate_new_key_subtitle": "please save it carefully", - "welcome_1a3a_generate_new_key_title": "Create a new keypair", - "welcome_1a3a_recover_input_password": "Password", - "welcome_1a3a_recover_input_word": "The mnemonic word", - "welcome_1a3a_recover_subtitle": "A 12 words list you backup before", - "welcome_1a3a_recover_title": "Restore by mnemonic word", - "welcome_1a3a_title": "Which crypto key do you want for this account?", - "welcome_1a4_auto_post_description1": "We appreciate your valor!", - "welcome_1a4_auto_post_description2": "Editable after posting.", - "welcome_1a4_auto_post_title": "Create a verification post", - "welcome_1a4_auto_profile_description1": "Easy and lightweight.", - "welcome_1a4_auto_profile_description2": "Never disturb anyone.", - "welcome_1a4_auto_profile_title": "Add public key to profile", - "welcome_1a4_auto_radio_aria": "Choose how to verify your account", - "welcome_1a4_disabled": "Sorry, only one automatic verification method is available.", - "welcome_1a4_title": "Verify Account Ownership", - "welcome_1a4_type_auto_subtitle1": "Avoid any confusion before your first encrypted post.", - "welcome_1a4_type_auto_subtitle2": "This allows your friends to verify the connection between your social network account and your keypair.", - "welcome_1a4_type_auto_switch": "Prefer doing it manually?", - "welcome_1a4_type_manual_goto": "Copy & Go to Profile", - "welcome_1a4_type_manual_subtitle1": "Add this to your bio, or post on your timeline, before your first encrypted post.", - "welcome_1a4_type_manual_subtitle2": "This allows your friends to verify the connection between your social network account and your keypair.", - "welcome_1a4_type_manual_switch": "Prefer automating the steps?", - "welcome_1b_confirm": "Restore the backup", "welcome_1b_dragging": "Drag your key backup into this dialog", - "welcome_1b_file_selected": "Selected exported key backup: {{filename}}", - "welcome_1b_hint_identity": "This backup file contains the following accounts:", - "welcome_1b_hint_network": "And Maskbook is going to request permissions for these sites:", - "welcome_1b_no_file_selected": "Select your exported key backup", - "welcome_1b_qr_error_1": "There is an error that occurs during scanning.", - "welcome_1b_qr_error_2": "You may try other ways to restore your account.", - "welcome_1b_qr_rescan": "Rescan", - "welcome_1b_tabs_backup": "Select the backup file", - "welcome_1b_tabs_qr": "Scan the QR Code", - "welcome_1b_tabs_text": "Paste the content of the backup file by yourself", - "welcome_1b_title": "Restore your keypair", - "welcome_2_greeting": "You can use Maskbook now!", - "welcome_2_title": "You're done!" + "welcome_1b_file_selected": "Selected exported key backup: {{filename}}" } diff --git a/src/_locales/zh/messages.json b/src/_locales/zh/messages.json index 3b8bbf49f354..ab32f23af6f8 100644 --- a/src/_locales/zh/messages.json +++ b/src/_locales/zh/messages.json @@ -211,65 +211,6 @@ "unknown_persona": "未知角色", "username": "用戶名", "version": "版本", - "welcome_0_close_button": "我想以後再做", - "welcome_0_restore_key": "導入備份檔案", - "welcome_1a1_didntfind": "沒有找到你的賬戶?", - "welcome_1a1_title": "你希望為哪個賬戶設定 Maskbook?", - "welcome_1a1b_connect": "連結", - "welcome_1a1b_danger": "受審查的站點", - "welcome_1a1b_switch": "連接現有的賬戶", - "welcome_1a1b_title": "Maskbook 可以在這些社交網絡上使用", - "welcome_1a2_description": "這樣,只有你選中的好友才能解密這條訊息", - "welcome_1a2_done_button": "棒耶!", - "welcome_1a2_imgalt": "關於如何使用 Maskbook 加密的截圖", - "welcome_1a2_title": "使用 Maskbook 的輸入框來加密", - "welcome_1a3_description1": "稍後會有一個保存提示,請妥善保管備份檔案。", - "welcome_1a3_description2": "記得經常創建新備份!", - "welcome_1a3_done_button": "瞭解!", - "welcome_1a3_title": "請妥善保管備份檔案", - "welcome_1a3a_connect_subtitle": "這會使用相同的密鑰", - "welcome_1a3a_connect_title": "關聯其他賬戶", - "welcome_1a3a_generate_new_key": "創建新密鑰", - "welcome_1a3a_generate_new_key_password_help": "請牢記密碼,否則只憑藉助記詞是無法恢復密鑰的", - "welcome_1a3a_generate_new_key_password_label": "新密鑰的密碼", - "welcome_1a3a_generate_new_key_result": "請抄寫助記詞", - "welcome_1a3a_generate_new_key_result_help": "助記詞用於恢復密鑰,確定保管好后按“確認”", - "welcome_1a3a_generate_new_key_subtitle": "請妥善保管", - "welcome_1a3a_generate_new_key_title": "創建新的密鑰", - "welcome_1a3a_recover_input_password": "密碼", - "welcome_1a3a_recover_input_word": "助記詞", - "welcome_1a3a_recover_subtitle": "輸入以前記錄的助記詞", - "welcome_1a3a_recover_title": "用助記詞恢復", - "welcome_1a3a_title": "你希望這個賬戶使用什麽密鑰?", - "welcome_1a4_auto_post_description1": "我們感謝你的支持", - "welcome_1a4_auto_post_description2": "你可以調整文本措辭", - "welcome_1a4_auto_post_title": "發佈一個聲明訊息", - "welcome_1a4_auto_profile_description1": "簡潔高效", - "welcome_1a4_auto_profile_description2": "不會打擾到任何人", - "welcome_1a4_auto_profile_title": "添加公鑰到個人簡介", - "welcome_1a4_auto_radio_aria": "選擇賬號歸屬權驗證手段", - "welcome_1a4_disabled": "由於技術問題,暫時只有一種驗證方式可用。", - "welcome_1a4_title": "驗證賬號歸屬權", - "welcome_1a4_type_auto_subtitle1": "避免好友感到迷惑", - "welcome_1a4_type_auto_subtitle2": "這使得你的好友能夠驗證你的社交網路賬號與你的 Maskbook 公鑰都屬於你。", - "welcome_1a4_type_auto_switch": "更願意手動操作?", - "welcome_1a4_type_manual_goto": "拷貝並跳轉到個人簡介", - "welcome_1a4_type_manual_subtitle1": "將這串文本添加到個人簡介或分享到時間線,在發佈第一條加密訊息之前。", - "welcome_1a4_type_manual_subtitle2": "這使得你的好友能夠驗證你的社交網路賬號與你的 Maskbook 公鑰都屬於你。", - "welcome_1a4_type_manual_switch": "更願意讓 Maskbook 代勞?", - "welcome_1b_confirm": "恢復備份", "welcome_1b_dragging": "將備份檔案拖拽到此處", - "welcome_1b_file_selected": "已選取備份檔案:{{filename}}", - "welcome_1b_hint_identity": "備份文件中包含了以下身份:", - "welcome_1b_hint_network": "爲此,Maskbook 將要請求以下網站的權限:", - "welcome_1b_no_file_selected": "選取備份檔案", - "welcome_1b_qr_error_1": "掃描過程中出現錯誤", - "welcome_1b_qr_error_2": "你或許可以試試其他方式來恢復賬號設定。", - "welcome_1b_qr_rescan": "重試", - "welcome_1b_tabs_backup": "選擇備份檔案", - "welcome_1b_tabs_qr": "掃描 QR 碼", - "welcome_1b_tabs_text": "手動貼入備份檔案的内容", - "welcome_1b_title": "導入備份檔案", - "welcome_2_greeting": "你現在可以使用 Maskbook 了!", - "welcome_2_title": "完畢!" + "welcome_1b_file_selected": "已選取備份檔案:{{filename}}" } From d9a870503e6a72fd7f6dc3f95d1946d7fc162a14 Mon Sep 17 00:00:00 2001 From: Jack Works Date: Thu, 27 Feb 2020 14:43:08 +0800 Subject: [PATCH 50/70] chore: remove unused i18n string --- src/_locales/en/messages.json | 2 -- src/_locales/zh/messages.json | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 7cd9a3413fe7..ddfada050a50 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -20,9 +20,7 @@ "back": "Back", "backup": "Backup", "backup_persona": "Backup your persona.", - "banner_empty_username": "If not filled automatically, you may enter it yourself.", "banner_get_started": "Setup Maskbook", - "banner_invalid_username": "This does not seem like a valid username.", "banner_preparing_setup": "You need to setup your Maskbook account.", "banner_title": "Welcome to Maskbook", "cancel": "Cancel", diff --git a/src/_locales/zh/messages.json b/src/_locales/zh/messages.json index ab32f23af6f8..2cc4f1f018a0 100644 --- a/src/_locales/zh/messages.json +++ b/src/_locales/zh/messages.json @@ -17,9 +17,7 @@ "back": "返回", "backup": "備份", "backup_persona": "備份角色", - "banner_empty_username": "如果自動探測用戶名沒有成功,請手動在此輸入", "banner_get_started": "設定 Maskbook", - "banner_invalid_username": "這看起來不像正確的用戶名", "banner_preparing_setup": "Maskbook 需要設定你的賬號。", "banner_title": "歡迎使用 Maskbook", "cancel": "取消", From aaeb9e49f3af4e640504d4389a6f09c1c8bf6f85 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Thu, 27 Feb 2020 16:11:29 +0800 Subject: [PATCH 51/70] chore: add react-use --- package.json | 1 + yarn.lock | 184 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 184 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 1eb1d5a276b1..4f28a0600208 100644 --- a/package.json +++ b/package.json @@ -81,6 +81,7 @@ "react-dom": "^16.12.0", "react-i18next": "^11.3.2", "react-router-dom": "^5.0.0", + "react-use": "^13.26.3", "react-window": "^1.8.5", "tiny-secp256k1": "^1.1.2", "ts-results": "^2.0.1", diff --git a/yarn.lock b/yarn.lock index e8a5de72ad5a..7320e922cb4e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3511,6 +3511,11 @@ jest-diff "^25.1.0" pretty-format "^25.1.0" +"@types/js-cookie@2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@types/js-cookie/-/js-cookie-2.2.5.tgz#38dfaacae8623b37cc0b0d27398e574e3fc28b1e" + integrity sha512-cpmwBRcHJmmZx0OGU7aPVwGWGbs4iKwVYchk9iuMtxNCA2zorwdaTz4GkLgs2WGxiRZRFKnV1k6tRUHX7tBMxg== + "@types/json-schema@^7.0.3": version "7.0.3" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.3.tgz#bdfd69d61e464dcc81b25159c270d75a73c1a636" @@ -4023,6 +4028,11 @@ text-table "^0.2.0" webpack-log "^1.1.2" +"@xobotyi/scrollbar-width@1.9.3": + version "1.9.3" + resolved "https://registry.yarnpkg.com/@xobotyi/scrollbar-width/-/scrollbar-width-1.9.3.tgz#76a82f3a3452967cf05509e472c6e154804ba07d" + integrity sha512-15JdCA3BjDktOdJ9xRdxkZcd2ZiHHbb3ycSPtC9JCjwkHzvrPr3n8uZoNw9CYF6UhkIMnW85d+P9mi3eXaKcFg== + "@xtuc/ieee754@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" @@ -5418,6 +5428,11 @@ boolbase@^1.0.0, boolbase@~1.0.0: resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= +bowser@^1.7.3: + version "1.9.4" + resolved "https://registry.yarnpkg.com/bowser/-/bowser-1.9.4.tgz#890c58a2813a9d3243704334fa81b96a5c150c9a" + integrity sha512-9IdMmj2KjigRq6oWhmwv1W36pDuA4STQZ8q6YO9um+x07xgYNCD3Oou+WP/3L1HNz7iqythGet3/p4wvc8AAwQ== + boxen@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" @@ -6607,6 +6622,13 @@ copy-to-clipboard@^3.0.8: dependencies: toggle-selection "^1.0.6" +copy-to-clipboard@^3.2.0: + version "3.3.1" + resolved "https://registry.yarnpkg.com/copy-to-clipboard/-/copy-to-clipboard-3.3.1.tgz#115aa1a9998ffab6196f93076ad6da3b913662ae" + integrity sha512-i13qo6kIHTTpCm8/Wup+0b1mVWETvu2kIMzKoK8FpkLkFxlt0znUAHcMzox+T8sPlqtZXq3CulEjQHsYiGFJUw== + dependencies: + toggle-selection "^1.0.6" + copy-webpack-plugin@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-5.1.1.tgz#5481a03dea1123d88a988c6ff8b78247214f0b88" @@ -6828,6 +6850,14 @@ crypto-random-string@^2.0.0: resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== +css-in-js-utils@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/css-in-js-utils/-/css-in-js-utils-2.0.1.tgz#3b472b398787291b47cfe3e44fecfdd9e914ba99" + integrity sha512-PJF0SpJT+WdbVVt0AOYp9C8GnuruRlL/UFW7932nLWmFLQTaWEzTBQEx7/hn4BuV+WON75iAViSUJLiU3PKbpA== + dependencies: + hyphenate-style-name "^1.0.2" + isobject "^3.0.1" + css-loader@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-3.2.0.tgz#bb570d89c194f763627fcf1f80059c6832d009b2" @@ -6887,6 +6917,14 @@ css-tree@1.0.0-alpha.33: mdn-data "2.0.4" source-map "^0.5.3" +css-tree@^1.0.0-alpha.28: + version "1.0.0-alpha.39" + resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.39.tgz#2bff3ffe1bb3f776cf7eefd91ee5cba77a149eeb" + integrity sha512-7UvkEYgBAHRG9Nt980lYxjsTrCyHFN53ky3wVsDkiMdVqylqRt+Zc+jm5qw7/qyOvN2dHSYtX0e4MbCCExSvnA== + dependencies: + mdn-data "2.0.6" + source-map "^0.6.1" + css-vendor@^2.0.7: version "2.0.7" resolved "https://registry.yarnpkg.com/css-vendor/-/css-vendor-2.0.7.tgz#4e6d53d953c187981576d6a542acc9fb57174bda" @@ -6941,6 +6979,11 @@ csstype@^2.2.0, csstype@^2.5.2, csstype@^2.5.7, csstype@^2.6.5, csstype@^2.6.6: resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.8.tgz#0fb6fc2417ffd2816a418c9336da74d7f07db431" integrity sha512-msVS9qTuMT5zwAGCVm4mxfrZ18BNc6Csd0oJAtiFMZ1FAx1CCvy2+5MDmYoix63LM/6NDbNtodCiGYGmFgO0dA== +csstype@^2.5.5: + version "2.6.9" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.9.tgz#05141d0cd557a56b8891394c1911c40c8a98d098" + integrity sha512-xz39Sb4+OaTsULgUERcCk+TJj8ylkL4aSVDQiX/ksxbELSqwkgt4d4RD7fovIdgJGSuNYqwZEiVjYY5l0ask+Q== + currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" @@ -7901,6 +7944,13 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +error-stack-parser@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/error-stack-parser/-/error-stack-parser-2.0.6.tgz#5a99a707bd7a4c58a797902d48d82803ede6aad8" + integrity sha512-d51brTeqC+BHlwF0BhPtcYgF5nlzf9ZZ0ZIUQNZpc9ZB9qw5IJ2diTrBY9jlCJkTLITYPjmiX6OWCwH+fuyNgQ== + dependencies: + stackframe "^1.1.1" + es-abstract@^1.10.0, es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.13.0, es-abstract@^1.4.3, es-abstract@^1.5.1, es-abstract@^1.7.0: version "1.14.1" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.14.1.tgz#6e8d84b445ec9c610781e74a6d52cc31aac5b4ca" @@ -8714,6 +8764,11 @@ fast-deep-equal@^2.0.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= +fast-deep-equal@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" + integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== + fast-diff@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" @@ -8779,6 +8834,16 @@ fast-safe-stringify@^2.0.7: resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz#124aa885899261f68aedb42a7c080de9da608743" integrity sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA== +fast-shallow-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-shallow-equal/-/fast-shallow-equal-1.0.0.tgz#d4dcaf6472440dcefa6f88b98e3251e27f25628b" + integrity sha512-HPtaa38cPgWvaCFmRNhlc6NG7pv6NUHqjPgVAkWGoB9mQMwYB27/K0CvOM5Czy+qpT3e8XJ6Q4aPAnzpNpzNaw== + +fastest-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/fastest-stable-stringify/-/fastest-stable-stringify-1.0.1.tgz#9122d406d4c9d98bea644a6b6853d5874b87b028" + integrity sha1-kSLUBtTJ2YvqZEpraFPVh0uHsCg= + fastq@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.6.0.tgz#4ec8a38f4ac25f21492673adb7eae9cfef47d1c2" @@ -10276,7 +10341,7 @@ husky@^4.2.3: slash "^3.0.0" which-pm-runs "^1.0.0" -hyphenate-style-name@^1.0.3: +hyphenate-style-name@^1.0.2, hyphenate-style-name@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.3.tgz#097bb7fa0b8f1a9cf0bd5c734cf95899981a9b48" integrity sha512-EcuixamT82oplpoJ2XU4pDtKGWQ7b00CD9f1ug9IaQ3p1bkHMiKCZ9ut9QDI6qsa6cpUuB+A/I+zLtdNK4n2DQ== @@ -10457,6 +10522,14 @@ inline-style-parser@0.1.1: resolved "https://registry.yarnpkg.com/inline-style-parser/-/inline-style-parser-0.1.1.tgz#ec8a3b429274e9c0a1f1c4ffa9453a7fef72cea1" integrity sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q== +inline-style-prefixer@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/inline-style-prefixer/-/inline-style-prefixer-4.0.2.tgz#d390957d26f281255fe101da863158ac6eb60911" + integrity sha512-N8nVhwfYga9MiV9jWlwfdj1UDIaZlBFu4cJSJkIr7tZX7sHpHhGR5su1qdpW+7KPL8ISTvCIkcaFi/JdBknvPg== + dependencies: + bowser "^1.7.3" + css-in-js-utils "^2.0.0" + inquirer@6.5.0: version "6.5.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.0.tgz#2303317efc9a4ea7ec2e2df6f86569b734accf42" @@ -11811,6 +11884,11 @@ js-beautify@^1.8.9: mkdirp "~0.5.1" nopt "~4.0.1" +js-cookie@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8" + integrity sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ== + js-levenshtein@^1.1.3: version "1.1.6" resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d" @@ -12923,6 +13001,11 @@ mdn-data@2.0.4: resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b" integrity sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA== +mdn-data@2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.6.tgz#852dc60fcaa5daa2e8cf6c9189c440ed3e042978" + integrity sha512-rQvjv71olwNHgiTbfPZFkJtjNMciWgswYeciZhtvWLO8bmX3TnhyA62I6sTWOyZssWHJJjY6/KiWwqQsWWsqOA== + mdn-data@~1.1.0: version "1.1.4" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-1.1.4.tgz#50b5d4ffc4575276573c4eedb8780812a8419f01" @@ -13419,6 +13502,20 @@ nan@^2.12.1, nan@^2.13.2, nan@^2.14.0, nan@^2.2.1: resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== +nano-css@^5.2.1: + version "5.3.0" + resolved "https://registry.yarnpkg.com/nano-css/-/nano-css-5.3.0.tgz#9d3cd29788d48b6a07f52aa4aec7cf4da427b6b5" + integrity sha512-uM/9NGK9/E9/sTpbIZ/bQ9xOLOIHZwrrb/CRlbDHBU/GFS7Gshl24v/WJhwsVViWkpOXUmiZ66XO7fSB4Wd92Q== + dependencies: + css-tree "^1.0.0-alpha.28" + csstype "^2.5.5" + fastest-stable-stringify "^1.0.1" + inline-style-prefixer "^4.0.0" + rtl-css-js "^1.9.0" + sourcemap-codec "^1.4.1" + stacktrace-js "^2.0.0" + stylis "3.5.0" + nano-json-stream-parser@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" @@ -15723,6 +15820,25 @@ react-transition-group@^4.3.0: loose-envify "^1.4.0" prop-types "^15.6.2" +react-use@^13.26.3: + version "13.26.3" + resolved "https://registry.yarnpkg.com/react-use/-/react-use-13.26.3.tgz#d278bb0f8c995c3684a15de2026fbb51bd04df02" + integrity sha512-81I+p1F7LFxdkGM3qiLjF9NUi2mTupvaiN76IAWL5JMY7BHTGSk6PFdzByqJrxnTJ/RBrbIVttmqvYKHOz/9Tw== + dependencies: + "@types/js-cookie" "2.2.5" + "@xobotyi/scrollbar-width" "1.9.3" + copy-to-clipboard "^3.2.0" + fast-deep-equal "^3.1.1" + fast-shallow-equal "^1.0.0" + js-cookie "^2.2.1" + nano-css "^5.2.1" + resize-observer-polyfill "^1.5.1" + screenfull "^5.0.0" + set-harmonic-interval "^1.0.1" + throttle-debounce "^2.1.0" + ts-easing "^0.2.0" + tslib "^1.10.0" + react-window@^1.8.5: version "1.8.5" resolved "https://registry.yarnpkg.com/react-window/-/react-window-1.8.5.tgz#a56b39307e79979721021f5d06a67742ecca52d1" @@ -16495,6 +16611,13 @@ rsvp@^4.8.4: resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== +rtl-css-js@^1.9.0: + version "1.14.0" + resolved "https://registry.yarnpkg.com/rtl-css-js/-/rtl-css-js-1.14.0.tgz#daa4f192a92509e292a0519f4b255e6e3c076b7d" + integrity sha512-Dl5xDTeN3e7scU1cWX8c9b6/Nqz3u/HgR4gePc1kWXYiQWVQbKCEyK6+Hxve9LbcJ5EieHy1J9nJCN3grTtGwg== + dependencies: + "@babel/runtime" "^7.1.2" + run-async@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" @@ -16640,6 +16763,11 @@ schema-utils@^2.6.1, schema-utils@^2.6.4: ajv "^6.10.2" ajv-keywords "^3.4.1" +screenfull@^5.0.0: + version "5.0.2" + resolved "https://registry.yarnpkg.com/screenfull/-/screenfull-5.0.2.tgz#b9acdcf1ec676a948674df5cd0ff66b902b0bed7" + integrity sha512-cCF2b+L/mnEiORLN5xSAz6H3t18i2oHh9BA8+CQlAh5DRw2+NFAGQJOSYbcGw8B2k04g/lVvFcfZ83b3ysH5UQ== + scrypt-js@2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.3.tgz#bb0040be03043da9a012a2cea9fc9f852cfc87d4" @@ -16811,6 +16939,11 @@ set-blocking@^2.0.0, set-blocking@~2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= +set-harmonic-interval@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/set-harmonic-interval/-/set-harmonic-interval-1.0.1.tgz#e1773705539cdfb80ce1c3d99e7f298bb3995249" + integrity sha512-AhICkFV84tBP1aWqPwLZqFvAwqEoVA9kxNMniGEUvzOlm4vLmOFLiTT3UZ6bziJTy4bOVpzWGTfSCbmaayGx8g== + set-value@^2.0.0, set-value@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" @@ -17142,6 +17275,11 @@ source-map-url@^0.4.0: resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= +source-map@0.5.6: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + integrity sha1-dc449SvwczxafwwRjYEzSiu19BI= + source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -17157,6 +17295,11 @@ source-map@^0.7.3: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== +sourcemap-codec@^1.4.1: + version "1.4.8" + resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" + integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== + space-separated-tokens@^1.0.0: version "1.1.4" resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.4.tgz#27910835ae00d0adfcdbd0ad7e611fb9544351fa" @@ -17295,11 +17438,40 @@ stable@^0.1.8: resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf" integrity sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w== +stack-generator@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/stack-generator/-/stack-generator-2.0.5.tgz#fb00e5b4ee97de603e0773ea78ce944d81596c36" + integrity sha512-/t1ebrbHkrLrDuNMdeAcsvynWgoH/i4o8EGGfX7dEYDoTXOYVAkEpFdtshlvabzc6JlJ8Kf9YdFEoz7JkzGN9Q== + dependencies: + stackframe "^1.1.1" + stack-utils@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== +stackframe@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-1.1.1.tgz#ffef0a3318b1b60c3b58564989aca5660729ec71" + integrity sha512-0PlYhdKh6AfFxRyK/v+6/k+/mMfyiEBbTM5L94D0ZytQnJ166wuwoTYLHFWGbs2dpA8Rgq763KGWmN1EQEYHRQ== + +stacktrace-gps@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/stacktrace-gps/-/stacktrace-gps-3.0.4.tgz#7688dc2fc09ffb3a13165ebe0dbcaf41bcf0c69a" + integrity sha512-qIr8x41yZVSldqdqe6jciXEaSCKw1U8XTXpjDuy0ki/apyTn/r3w9hDAAQOhZdxvsC93H+WwwEu5cq5VemzYeg== + dependencies: + source-map "0.5.6" + stackframe "^1.1.1" + +stacktrace-js@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/stacktrace-js/-/stacktrace-js-2.0.2.tgz#4ca93ea9f494752d55709a081d400fdaebee897b" + integrity sha512-Je5vBeY4S1r/RnLydLl0TBTi3F2qdfWmYsGvtfZgEI+SCprPppaIhQf5nGcal4gI4cGpCV/duLcAzT1np6sQqg== + dependencies: + error-stack-parser "^2.0.6" + stack-generator "^2.0.5" + stacktrace-gps "^3.0.4" + state-toggle@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.3.tgz#e123b16a88e143139b09c6852221bc9815917dfe" @@ -17736,6 +17908,11 @@ style-to-object@^0.2.1: dependencies: inline-style-parser "0.1.1" +stylis@3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/stylis/-/stylis-3.5.0.tgz#016fa239663d77f868fef5b67cf201c4b7c701e1" + integrity sha512-pP7yXN6dwMzAR29Q0mBrabPCe0/mNO1MSr93bhay+hcZondvMMTpeGyd8nbhYJdyperNT2DRxONQuUGcJr5iPw== + sumchecker@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/sumchecker/-/sumchecker-2.0.2.tgz#0f42c10e5d05da5d42eea3e56c3399a37d6c5b3e" @@ -18355,6 +18532,11 @@ ts-dedent@^1.1.0: resolved "https://registry.yarnpkg.com/ts-dedent/-/ts-dedent-1.1.0.tgz#67983940793183dc7c7f820acb66ba02cdc33c6e" integrity sha512-CVCvDwMBWZKjDxpN3mU/Dx1v3k+sJgE8nrhXcC9vRopRfoa7vVzilNvHEAUi5jQnmFHpnxDx5jZdI1TpG8ny2g== +ts-easing@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/ts-easing/-/ts-easing-0.2.0.tgz#c8a8a35025105566588d87dbda05dd7fbfa5a4ec" + integrity sha512-Z86EW+fFFh/IFB1fqQ3/+7Zpf9t2ebOAxNI/V6Wo7r5gqiqtxmgTlQ1qbqQcjLKYeSHPTsEmvlJUDg/EuL0uHQ== + ts-essentials@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-1.0.4.tgz#ce3b5dade5f5d97cf69889c11bf7d2da8555b15a" From 74c43bfe31ffdbb81281ac34c15d67f998bfdba1 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Thu, 27 Feb 2020 16:11:49 +0800 Subject: [PATCH 52/70] refactor: use async from react-use --- src/components/DebugModeUI/PostHashDialog.tsx | 10 ++-- .../InjectedComponents/PostInspector.tsx | 13 +++--- src/components/shared/qrcode.tsx | 13 ++++-- .../options-page/DashboardDialogs/Persona.tsx | 11 +++-- .../DashboardInitSteps/Step2S.tsx | 9 ++-- src/utils/__tests__/hooks/useAsync.ts | 41 ----------------- src/utils/hooks/useAsync.ts | 46 ------------------- 7 files changed, 34 insertions(+), 109 deletions(-) delete mode 100644 src/utils/__tests__/hooks/useAsync.ts delete mode 100644 src/utils/hooks/useAsync.ts diff --git a/src/components/DebugModeUI/PostHashDialog.tsx b/src/components/DebugModeUI/PostHashDialog.tsx index f9306111a1b0..dd0946705eef 100644 --- a/src/components/DebugModeUI/PostHashDialog.tsx +++ b/src/components/DebugModeUI/PostHashDialog.tsx @@ -1,4 +1,5 @@ import React, { useState } from 'react' +import { useAsync } from 'react-use' import { makeStyles } from '@material-ui/core/styles' import Button from '@material-ui/core/Button' import List from '@material-ui/core/List' @@ -15,7 +16,6 @@ import { PostIVIdentifier } from '../../database/type' import { deconstructPayload } from '../../utils/type-transform/Payload' import { DialogContentText, DialogContent } from '@material-ui/core' import ShadowRootDialog from '../../utils/jss/ShadowRootDialog' -import { useAsync } from '../../utils/hooks/useAsync' const useStyles = makeStyles({ avatar: { @@ -88,11 +88,11 @@ export function DebugModeUI_PostHashDialog(props: { post: string; network: strin const payload = deconstructPayload(props.post, null) const [hashMap, setHashMap] = useState<[string, string, string][]>([]) const friends = useFriendsList() - useAsync(() => { - if (!payload) return Promise.resolve([]) + useAsync(async () => { + if (!payload) return const ivID = new PostIVIdentifier(props.network, payload.iv) - return Services.Crypto.debugShowAllPossibleHashForPost(ivID, payload.version) - }, [props.post]).then(setHashMap) + setHashMap(await Services.Crypto.debugShowAllPossibleHashForPost(ivID, payload.version)) + }, [props.post]) return ( <> // Get the file! - *
- */ -export function useDragAndDrop(onChangeOuter?: (file: File) => void) { - const [status, setStatus] = React.useState(undefined) - const fileRef = React.useRef() - const onChange = React.useCallback( - (event: React.ChangeEvent | React.DragEvent) => { - const files = ( - (event as React.DragEvent).dataTransfer || (event as React.ChangeEvent).currentTarget - ).files - if (!files) return - const file = files.item(0) - if (!file) return - fileRef.current = file - if (onChangeOuter) onChangeOuter(file) - setStatus('selected') - }, - [onChangeOuter], - ) - const onEnter = React.useCallback((e: React.DragEvent) => { - e.preventDefault() - setStatus('drag-enter') - }, []) - const onLeave = React.useCallback((e: React.DragEvent) => { - setStatus(undefined) - }, []) - const onCapture = React.useCallback( - (e: React.DragEvent) => { - e.preventDefault() - onChange(e) - setTimeout(onLeave, 200) - }, - [onChange, onLeave], - ) - return { - dragEvents: { - onDragEnterCapture: onEnter, - onDragLeaveCapture: onLeave, - onDropCapture: onCapture, - onDragOverCapture: onEnter, - }, - fileReceiver: onChange, - fileRef: fileRef, - dragStatus: status, - } -} From 5c249751894d4a63fdfc9f1ff57029564b7b75fe Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Fri, 28 Feb 2020 11:36:28 +0800 Subject: [PATCH 55/70] refactor: remove set state in use async --- src/components/DebugModeUI/PostHashDialog.tsx | 7 +++---- src/components/InjectedComponents/PostInspector.tsx | 11 +++++------ src/components/shared/qrcode.tsx | 2 +- .../options-page/DashboardDialogs/Persona.tsx | 8 +++----- .../options-page/DashboardInitSteps/Step2S.tsx | 9 ++++----- 5 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/components/DebugModeUI/PostHashDialog.tsx b/src/components/DebugModeUI/PostHashDialog.tsx index dd0946705eef..3aa52e4b58e0 100644 --- a/src/components/DebugModeUI/PostHashDialog.tsx +++ b/src/components/DebugModeUI/PostHashDialog.tsx @@ -86,12 +86,11 @@ function SimpleDialog(props: SimpleDialogProps) { export function DebugModeUI_PostHashDialog(props: { post: string; network: string }) { const [open, setOpen] = React.useState(false) const payload = deconstructPayload(props.post, null) - const [hashMap, setHashMap] = useState<[string, string, string][]>([]) const friends = useFriendsList() - useAsync(async () => { - if (!payload) return + const { value: hashMap = [] } = useAsync(async () => { + if (!payload) return [] const ivID = new PostIVIdentifier(props.network, payload.iv) - setHashMap(await Services.Crypto.debugShowAllPossibleHashForPost(ivID, payload.version)) + return Services.Crypto.debugShowAllPossibleHashForPost(ivID, payload.version) }, [props.post]) return ( <> diff --git a/src/components/InjectedComponents/PostInspector.tsx b/src/components/InjectedComponents/PostInspector.tsx index 0fd91fa7e576..ebd98ae43e3c 100644 --- a/src/components/InjectedComponents/PostInspector.tsx +++ b/src/components/InjectedComponents/PostInspector.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react' +import React, { useState, useEffect } from 'react' import { useAsync } from 'react-use' import { DecryptPost, DecryptPostProps } from './DecryptedPost' import { AddToKeyStore, AddToKeyStoreProps } from './AddToKeyStore' @@ -37,13 +37,12 @@ export function PostInspector(props: PostInspectorProps) { provePost: decodeAsPublicKey, } - useAsync(async () => { - if (!whoAmI) return - if (!whoAmI.identifier.equals(postBy)) return - if (!type.encryptedPost) return + const { value: sharedListOfPost } = useAsync(async () => { + if (!whoAmI || !whoAmI.identifier.equals(postBy) || !type.encryptedPost) return [] const { iv, version } = type.encryptedPost - setAlreadySelectedPreviously(await Services.Crypto.getSharedListOfPost(version, iv, postBy)) + return Services.Crypto.getSharedListOfPost(version, iv, postBy) }, [post, postBy, whoAmI]) + useEffect(() => setAlreadySelectedPreviously(sharedListOfPost ?? []), [sharedListOfPost]) if (postBy.isUnknown) return null diff --git a/src/components/shared/qrcode.tsx b/src/components/shared/qrcode.tsx index 7b6505d6be5d..5c5bdecafff9 100644 --- a/src/components/shared/qrcode.tsx +++ b/src/components/shared/qrcode.tsx @@ -45,6 +45,6 @@ export function WKWebkitQRScanner(props: { onScan(val: string): void; onQuit(): } catch (e) { props.onQuit() } - }, []) + }) return null } diff --git a/src/extension/options-page/DashboardDialogs/Persona.tsx b/src/extension/options-page/DashboardDialogs/Persona.tsx index 1aa0387525ce..1a07f0308f1e 100644 --- a/src/extension/options-page/DashboardDialogs/Persona.tsx +++ b/src/extension/options-page/DashboardDialogs/Persona.tsx @@ -81,13 +81,11 @@ export function PersonaCreateDialog() { export function PersonaCreatedDialog() { const { t } = useI18N() const { identifier } = useQueryParams(['identifier']) - const [persona, setPersona] = useState(null) - useAsync(async () => { + const { value: persona = null } = useAsync(async () => { if (identifier) { - setPersona( - await Services.Identity.queryPersona(Identifier.fromString(identifier, ECKeyIdentifier).unwrap()), - ) + return Services.Identity.queryPersona(Identifier.fromString(identifier, ECKeyIdentifier).unwrap()) } + return null }, [identifier]) return ( (null) - useAsync(async () => { + + const { value: persona = null } = useAsync(async () => { if (identifier) { - setPersona( - await Services.Identity.queryPersona(Identifier.fromString(identifier, ECKeyIdentifier).unwrap()), - ) + return Services.Identity.queryPersona(Identifier.fromString(identifier, ECKeyIdentifier).unwrap()) } + return null }, [identifier, personas]) const actions = ( From 6251db8fe36478b073492e22199b820d0f6b2d89 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Fri, 28 Feb 2020 12:00:58 +0800 Subject: [PATCH 56/70] refactor: build params --- .../options-page/DashboardInitSteps/Step1R.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/extension/options-page/DashboardInitSteps/Step1R.tsx b/src/extension/options-page/DashboardInitSteps/Step1R.tsx index 703ddb34e4f8..4d27b15e8d1c 100644 --- a/src/extension/options-page/DashboardInitSteps/Step1R.tsx +++ b/src/extension/options-page/DashboardInitSteps/Step1R.tsx @@ -95,12 +95,17 @@ export default function InitStep1R() { if (!json) throw new Error('UpgradeBackupJSONFile failed') setJson(json) const permissions = await extraPermissions(json.grantedHostPermissions) - if (!permissions) + if (!permissions) { + const restoreParams = new URLSearchParams() + restoreParams.append('personas', String(json.personas?.length ?? '')) + restoreParams.append('profiles', String(json.profiles?.length ?? '')) + restoreParams.append('posts', String(json.posts?.length ?? '')) + restoreParams.append('contacts', String(json.userGroups?.length ?? '')) + restoreParams.append('date', String(json._meta_?.createdAt ?? '')) return await Services.Welcome.restoreBackup(json).then(() => - history.push( - `${InitStep.Restore2}?personas=${json.personas?.length}&profiles=${json.profiles?.length}&posts=${json.posts?.length}&contacts=${json.userGroups?.length}&date=${json._meta_?.createdAt}`, - ), + history.push(`${InitStep.Restore2}?${restoreParams.toString()}`), ) + } setRequiredPermissions(permissions) setRestoreState('success') } catch (e) { From dc3c68acf5ffe17349163ab888f0698fd6939514 Mon Sep 17 00:00:00 2001 From: Jack Works Date: Fri, 28 Feb 2020 19:37:25 +0800 Subject: [PATCH 57/70] fix: comment selector on fb close #811 --- .../facebook.com/UI/collectPosts.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/social-network-provider/facebook.com/UI/collectPosts.tsx b/src/social-network-provider/facebook.com/UI/collectPosts.tsx index 71d15bf3b704..67ad361ae4c4 100644 --- a/src/social-network-provider/facebook.com/UI/collectPosts.tsx +++ b/src/social-network-provider/facebook.com/UI/collectPosts.tsx @@ -19,11 +19,7 @@ export function collectPostsFacebook(this: SocialNetworkUI) { .closest('.userContentWrapper, [data-store]') // ? inject after comments - const commentSelectorPC = root - .clone() - .querySelectorAll('[role=article]') - .querySelectorAll('a+span') - .closest(2) + const commentSelectorPC = root.clone().querySelectorAll('[data-testid="UFI2Comment/body"]') const commentSelectorMobile = root .clone() .map(x => x.parentElement) From a2ac8d4097a9a8b5118fd04621ef47327005e78e Mon Sep 17 00:00:00 2001 From: Jack Works Date: Fri, 28 Feb 2020 20:09:03 +0800 Subject: [PATCH 58/70] Update collectPosts.tsx --- src/social-network-provider/facebook.com/UI/collectPosts.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/social-network-provider/facebook.com/UI/collectPosts.tsx b/src/social-network-provider/facebook.com/UI/collectPosts.tsx index 67ad361ae4c4..da6f4d9a0fe0 100644 --- a/src/social-network-provider/facebook.com/UI/collectPosts.tsx +++ b/src/social-network-provider/facebook.com/UI/collectPosts.tsx @@ -19,7 +19,7 @@ export function collectPostsFacebook(this: SocialNetworkUI) { .closest('.userContentWrapper, [data-store]') // ? inject after comments - const commentSelectorPC = root.clone().querySelectorAll('[data-testid="UFI2Comment/body"]') + const commentSelectorPC = root.clone().querySelectorAll('[data-testid="UFI2Comment/body"]') const commentSelectorMobile = root .clone() .map(x => x.parentElement) From 2fd7709486b22c3e6773308e074f9ef58dfef723 Mon Sep 17 00:00:00 2001 From: Septs Date: Mon, 2 Mar 2020 15:25:21 +0800 Subject: [PATCH 59/70] feat: add build-info to background page --- package.json | 1 + src/background-service.ts | 12 ++++++++++++ webpack.config.js | 13 +++++++++++-- yarn.lock | 5 +++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4f28a0600208..94e1047a3c28 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "@material-ui/icons": "4.9.1", "@material-ui/lab": "^4.0.0-alpha.39", "@nice-labs/git-flow-init": "^1.0.1", + "@nice-labs/git-rev": "^3.3.1", "@types/bip39": "^3.0.0", "@types/classnames": "^2.2.7", "@types/gun": "^0.9.2", diff --git a/src/background-service.ts b/src/background-service.ts index 5cb9a93191e9..3e570806acab 100644 --- a/src/background-service.ts +++ b/src/background-service.ts @@ -101,6 +101,18 @@ function IgnoreError(arg: unknown): (reason: Error) => void { } } +console.log('Build info', { + NODE_ENV: process.env.NODE_ENV, + VERSION: process.env.VERSION, + TAG_NAME: process.env.TAG_NAME, + COMMIT_HASH: process.env.COMMIT_HASH, + COMMIT_DATE: process.env.COMMIT_DATE, + BUILD_DATE: process.env.BUILD_DATE, + REMOTE_URL: process.env.REMOTE_URL, + BRANCH_NAME: process.env.BRANCH_NAME, + DIRTY_FLAG: process.env.DIRTY_FLAG, +}) + // Friendly to debug Object.assign(window, { definedSocialNetworkWorkers, diff --git a/webpack.config.js b/webpack.config.js index b97e11ae1e45..b372031073e9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,6 +5,7 @@ const fs = require('fs') const WebpackNotifierPlugin = require('webpack-notifier') const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin') const ForkTsCheckerNotifierWebpackPlugin = require('fork-ts-checker-notifier-webpack-plugin') +const git = require('@nice-labs/git-rev').default const src = file => path.join(__dirname, file) /** @@ -85,8 +86,16 @@ module.exports = (argvEnv, argv) => { rules: [{ parser: { requireEnsure: false } }, addTSLoader()], }, plugins: [ - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify(env), + new webpack.EnvironmentPlugin({ + NODE_ENV: env, + VERSION: git.describe('--dirty'), + TAG_NAME: git.tag({ markDirty: true }), + COMMIT_HASH: git.commitHash(), + COMMIT_DATE: git.commitDate().toISOString(), + BUILD_DATE: new Date().toISOString(), + REMOTE_URL: git.remoteURL(), + BRANCH_NAME: git.branchName(), + DIRTY_FLAG: String(git.isDirty()), }), // The following plugins are from react-dev-utils. let me know if any one need it. // WatchMissingNodeModulesPlugin diff --git a/yarn.lock b/yarn.lock index 7320e922cb4e..e0deb7856697 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2347,6 +2347,11 @@ schema-utils "^2.6.4" yargs "^15.1.0" +"@nice-labs/git-rev@^3.3.1": + version "3.3.1" + resolved "https://registry.yarnpkg.com/@nice-labs/git-rev/-/git-rev-3.3.1.tgz#a5ed8a8a1f7ed10fcbc36a66bc94685a10c68d26" + integrity sha512-hJ3nJi34sTZNKxLHNdaKWSMxgAi9uWQmkmr96eZk0c7hqGJSYPuVF0JariRDgdkT6mIXXrVBw8PIz9Enbxw9eg== + "@nodelib/fs.scandir@2.1.3": version "2.1.3" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b" From bfab2ae754426e2bce6d6124e1b6a5c5a3698c1c Mon Sep 17 00:00:00 2001 From: Septs Date: Mon, 2 Mar 2020 15:48:37 +0800 Subject: [PATCH 60/70] chore: ignore firefox output build-date --- src/background-service.ts | 3 ++- webpack.config.js | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/background-service.ts b/src/background-service.ts index 3e570806acab..fd62e49510c7 100644 --- a/src/background-service.ts +++ b/src/background-service.ts @@ -110,7 +110,8 @@ console.log('Build info', { BUILD_DATE: process.env.BUILD_DATE, REMOTE_URL: process.env.REMOTE_URL, BRANCH_NAME: process.env.BRANCH_NAME, - DIRTY_FLAG: process.env.DIRTY_FLAG, + DIRTY: process.env.DIRTY, + TAG_DIRTY: process.env.TAG_DIRTY, }) // Friendly to debug diff --git a/webpack.config.js b/webpack.config.js index b372031073e9..e5717c8448a9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -89,13 +89,14 @@ module.exports = (argvEnv, argv) => { new webpack.EnvironmentPlugin({ NODE_ENV: env, VERSION: git.describe('--dirty'), - TAG_NAME: git.tag({ markDirty: true }), + TAG_NAME: git.tag(), COMMIT_HASH: git.commitHash(), COMMIT_DATE: git.commitDate().toISOString(), - BUILD_DATE: new Date().toISOString(), + BUILD_DATE: target.Firefox ? null : new Date().toISOString(), REMOTE_URL: git.remoteURL(), BRANCH_NAME: git.branchName(), - DIRTY_FLAG: String(git.isDirty()), + DIRTY: git.isDirty(), + TAG_DIRTY: git.isTagDirty(), }), // The following plugins are from react-dev-utils. let me know if any one need it. // WatchMissingNodeModulesPlugin From 698121a3159ea67c588b2614667dd815f5d42928 Mon Sep 17 00:00:00 2001 From: Septs Date: Mon, 2 Mar 2020 16:13:46 +0800 Subject: [PATCH 61/70] chore: move link definition to i18n file --- src/_locales/en/messages.json | 4 ++++ src/_locales/zh/messages.json | 4 ++++ .../DashboardComponents/FooterLine.tsx | 15 ++++++++------- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index c820cbfba5b3..eb1e47794057 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -72,6 +72,7 @@ "dashboard_item_deleted": "Deleted.", "dashboard_item_done": "Done.", "dashboard_mobile_test": "Join Tests for Mobile", + "dashboard_mobile_test_link": "https://maskbook.com/download-links/#mobile", "dashboard_my_personas": "My Personas", "dashboard_new_persona_created": "New persona \"{{name}}\" has been created. Connect a profile now! ([I:b])", "dashboard_new_user": "New User", @@ -92,6 +93,7 @@ "dashboard_returning_user_hint": "Import database backup.", "dashboard_show_qr": "Show QR Code", "dashboard_source_code": "Source Code", + "dashboard_source_code_link": "https://github.com/DimensionDev/Maskbook", "dashboard_unknown_network": "Unknown", "dashboard_username_on": "Username on {{network}}", "dashboard_welcome_to_maskbook": "Welcome to Maskbook", @@ -163,6 +165,7 @@ "post_modal_hint__button": "🔒 Compose encrypted post 🔒", "post_modal_hint__title": "Looking for Maskbook?", "privacy_policy": "Privacy Policy", + "privacy_policy_link": "https://maskbook.com/privacy-policy/", "proceed": "Proceed", "public_key": "Public Key", "rename": "Rename", @@ -211,6 +214,7 @@ "unknown_persona": "Unknown Persona", "username": "Username", "version": "Version", + "version_link": "https://github.com/DimensionDev/Maskbook/releases", "welcome_0_close_button": "I'll do it later", "welcome_0_restore_key": "I want to restore my backup", "welcome_1a1_didntfind": "Didn't you find your account?", diff --git a/src/_locales/zh/messages.json b/src/_locales/zh/messages.json index 3b8bbf49f354..6a2c7aafbe3a 100644 --- a/src/_locales/zh/messages.json +++ b/src/_locales/zh/messages.json @@ -72,6 +72,7 @@ "dashboard_item_deleted": "好了。", "dashboard_item_done": "好了。", "dashboard_mobile_test": "加入移動端測試", + "dashboard_mobile_test_link": "https://maskbook.com/download-links/#mobile", "dashboard_my_personas": "我的角色", "dashboard_new_persona_created": "新角色 «{{name}}» 已創建。 立即連接個人資料!([I:b])", "dashboard_new_user": "新用戶", @@ -92,6 +93,7 @@ "dashboard_returning_user_hint": "導入數據庫備份。", "dashboard_show_qr": "顯示二維碼", "dashboard_source_code": "程式源代碼", + "dashboard_source_code_link": "https://github.com/DimensionDev/Maskbook", "dashboard_unknown_network": "不支援", "dashboard_username_on": "{{network}} 上的用戶名", "dashboard_welcome_to_maskbook": "歡迎使用 Maskbook", @@ -163,6 +165,7 @@ "post_modal_hint__button": "🔒 編輯加密訊息 🔒", "post_modal_hint__title": "在找 Maskbook 嗎?", "privacy_policy": "隱私政策", + "privacy_policy_link": "https://maskbook.com/privacy-policy/", "proceed": "繼續", "public_key": "公鑰", "rename": "改名", @@ -211,6 +214,7 @@ "unknown_persona": "未知角色", "username": "用戶名", "version": "版本", + "version_link": "https://github.com/DimensionDev/Maskbook/releases", "welcome_0_close_button": "我想以後再做", "welcome_0_restore_key": "導入備份檔案", "welcome_1a1_didntfind": "沒有找到你的賬戶?", diff --git a/src/extension/options-page/DashboardComponents/FooterLine.tsx b/src/extension/options-page/DashboardComponents/FooterLine.tsx index dd69657ea0f0..429712f100db 100644 --- a/src/extension/options-page/DashboardComponents/FooterLine.tsx +++ b/src/extension/options-page/DashboardComponents/FooterLine.tsx @@ -23,13 +23,13 @@ const useStyles = makeStyles((theme: Theme) => }), ) -const FooterLink = function(props: React.PropsWithChildren<{ href: string } | { to: string }>) { +const FooterLink = function(props: React.PropsWithChildren<{ href: string; title?: string } | { to: string }>) { const classes = useStyles() return ( @@ -41,15 +41,16 @@ const FooterLink = function(props: React.PropsWithChildren<{ href: string } | { export default function FooterLine() { const { t } = useI18N() const classes = useStyles() + const { version } = globalThis?.browser.runtime.getManifest() return ( Maskbook.com - - {t('version')} {globalThis?.browser.runtime.getManifest().version} + + {t('version')} {version} - {t('dashboard_mobile_test')} - {t('dashboard_source_code')} - {t('privacy_policy')} + {t('dashboard_mobile_test')} + {t('dashboard_source_code')} + {t('privacy_policy')} ) } From 19a33dd7914d9b68f7528e22b0524b4ad5d118a2 Mon Sep 17 00:00:00 2001 From: Septs Date: Mon, 2 Mar 2020 16:30:37 +0800 Subject: [PATCH 62/70] chore: add internal version to releases link hashtag --- src/_locales/en/messages.json | 2 +- src/_locales/zh/messages.json | 2 +- src/extension/options-page/DashboardComponents/FooterLine.tsx | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index eb1e47794057..b1697df146fc 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -214,7 +214,7 @@ "unknown_persona": "Unknown Persona", "username": "Username", "version": "Version", - "version_link": "https://github.com/DimensionDev/Maskbook/releases", + "version_link": "https://github.com/DimensionDev/Maskbook/releases#{{tag}}", "welcome_0_close_button": "I'll do it later", "welcome_0_restore_key": "I want to restore my backup", "welcome_1a1_didntfind": "Didn't you find your account?", diff --git a/src/_locales/zh/messages.json b/src/_locales/zh/messages.json index 6a2c7aafbe3a..cd05bd60b043 100644 --- a/src/_locales/zh/messages.json +++ b/src/_locales/zh/messages.json @@ -214,7 +214,7 @@ "unknown_persona": "未知角色", "username": "用戶名", "version": "版本", - "version_link": "https://github.com/DimensionDev/Maskbook/releases", + "version_link": "https://github.com/DimensionDev/Maskbook/releases#{{tag}}", "welcome_0_close_button": "我想以後再做", "welcome_0_restore_key": "導入備份檔案", "welcome_1a1_didntfind": "沒有找到你的賬戶?", diff --git a/src/extension/options-page/DashboardComponents/FooterLine.tsx b/src/extension/options-page/DashboardComponents/FooterLine.tsx index 429712f100db..9955ac682f62 100644 --- a/src/extension/options-page/DashboardComponents/FooterLine.tsx +++ b/src/extension/options-page/DashboardComponents/FooterLine.tsx @@ -42,10 +42,11 @@ export default function FooterLine() { const { t } = useI18N() const classes = useStyles() const { version } = globalThis?.browser.runtime.getManifest() + const versionLink = t('version_link', { tag: process.env.VERSION }) return ( Maskbook.com - + {t('version')} {version} {t('dashboard_mobile_test')} From f5ffb8d1e3b418bbaf8d81696691e06194ca3888 Mon Sep 17 00:00:00 2001 From: Jack Works Date: Mon, 24 Feb 2020 14:59:04 +0800 Subject: [PATCH 63/70] fix: syntax errors in i18n msg --- src/_locales/en/messages.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index c820cbfba5b3..f321ec755049 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -7,6 +7,9 @@ "adding": "Adding...", "additional_post_box__encrypted_failed": "Please paste the following text into the post box.", "additional_post_box__encrypted_post_pre": "Decrypt this post with #Maskbook ! {{encrypted}}", + "additional_post_box__placeholder_w_name": "Hey {{user}}, what's your mind? Encrypt with Maskbook", + "additional_post_box__placeholder_wo_name": "What's your mind? Encrypt with Maskbook", + "additional_post_box__post_button": "📫 Post it!", "additional_post_box__steganography_post_failed": "Please upload the downloaded image into the post box.", "additional_post_box__steganography_post_pre": "This post is shared with my friends. You may install Maskbook to decrypt the content from the image. ([I:b]) {{random}}", "advanced": "Advanced...", From 663902c96eb3e607bfc9665b1b750051a7865ea4 Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Tue, 25 Feb 2020 14:32:25 +0800 Subject: [PATCH 64/70] Done review for the first 60 lines --- src/_locales/en/messages.json | 46 +++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index f321ec755049..ce62dc93d240 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -1,62 +1,62 @@ { - "add_persona": "Add Persona", - "add_to_key_store_failed_text": "{{error}}\nThis public key won't be saved.", - "add_to_key_store_failed_title": "Maskbook public key NOT verified ❌", - "add_to_key_store_success": "Maskbook public key added to the Keystore ✔", - "add_to_key_store_verifying": "Maskbook public key found, verifying...", + "add_persona": "Add a persona", + "add_to_key_store_failed_text": "{{error}}\nThis public key won't be saved in Maskbook.", + "add_to_key_store_failed_title": "[Maskbook] The public key is NOT verified ❌", + "add_to_key_store_success": "[Maskbook] The public key has been added to the Keystore ✔", + "add_to_key_store_verifying": "[Maskbook] The public key has been found, verifying...", "adding": "Adding...", "additional_post_box__encrypted_failed": "Please paste the following text into the post box.", "additional_post_box__encrypted_post_pre": "Decrypt this post with #Maskbook ! {{encrypted}}", - "additional_post_box__placeholder_w_name": "Hey {{user}}, what's your mind? Encrypt with Maskbook", - "additional_post_box__placeholder_wo_name": "What's your mind? Encrypt with Maskbook", + "additional_post_box__placeholder_w_name": "Hey {{user}}, what's on your mind? Encrypt itwith Maskbook.", + "additional_post_box__placeholder_wo_name": "What's on your mind? Encrypt it with Maskbook.", "additional_post_box__post_button": "📫 Post it!", "additional_post_box__steganography_post_failed": "Please upload the downloaded image into the post box.", "additional_post_box__steganography_post_pre": "This post is shared with my friends. You may install Maskbook to decrypt the content from the image. ([I:b]) {{random}}", "advanced": "Advanced...", - "automation_pasted_into_bio_box": "[Maskbook] We have helped you append the public key to your bio, confirm by publishing it!", + "automation_pasted_into_bio_box": "[Maskbook] We helped you append the public key to your bio. Please review and publish it!", "automation_request_click_edit_bio_button": "Please click the “Edit bio” button or the pencil on the bio box.", "automation_request_paste_into_bio_box": "Please copy your public key into the bio box and publish it.", "automation_request_paste_into_post_box": "Please copy your public key and publish it to your timeline!", "back": "Back", "backup": "Backup", - "backup_persona": "Backup Persona", - "banner_empty_username": "If not filled automatically, you may fill it.", + "backup_persona": "Backup your persona.", + "banner_empty_username": "If not filled automatically, you may enter it yourself.", "banner_get_started": "Setup Maskbook", "banner_invalid_username": "This does not seem like a valid username.", - "banner_preparing_setup": "Maskbook needs to set up your account.", + "banner_preparing_setup": "You need to setup your Maskbook account.", "banner_title": "Welcome to Maskbook", "cancel": "Cancel", "comment_box__paste_failed": "Please paste it into the comment box.", - "comment_box__placeholder": "Write an encrypted comment...", + "comment_box__placeholder": "Add an encrypted comment...", "connect": "Connect", - "connect_profile": "Connect Profile", + "connect_profile": "Connect your profile", "connecting": "Connecting...", "copy": "Copy", "create": "Create", - "create_persona": "Create a Persona", + "create_persona": "Create a persona", "dashboard": "Dashboard", - "dashboard_add_new_persona": "Add New Persona", + "dashboard_add_new_persona": "Add a new persona", "dashboard_advanced_restoration": "Advanced Restoration Options", "dashboard_attach_profile_step1": "Step 1: Copy the public key below", "dashboard_attach_profile_step2": "Step 2: Paste it into your profile biography", - "dashboard_attach_profile_step2_hint": "Hand-by-hand guides will show up after you move to the webpage.", + "dashboard_attach_profile_step2_hint": "Hand-by-hand guides will show up after you redirect to the webpage.", "dashboard_attach_profile_step3": "Step 3: Test and finish", "dashboard_attach_profile_step3_hint": "Come back here and finish the procedure. Test if your setup is successful.", - "dashboard_backup_database_hint": "Create a database backup file. Do it frequently.", - "dashboard_backup_persona_hint": "You can backup the persona with either way below.", - "dashboard_backup_persona_mnemonic_hint": "Keep the 12 words above carefully in a safe place. You will need them to restore the private key of this persona.", + "dashboard_backup_database_hint": "Create a database backup file. Do it regularly.", + "dashboard_backup_persona_hint": "You can backup your persona in the following options.", + "dashboard_backup_persona_mnemonic_hint": "Keep the 12 mnemonic words above carefully in a safe place. You will need them to restore the private key of this persona.", "dashboard_backup_persona_qr_hint": "Keep the QR code carefully in a safe place. You will need them to restore the private key of this persona.", "dashboard_backup_persona_text_hint": "Keep the text above carefully in a safe place. You will need them to restore the private key of this persona.", "dashboard_bio_test_failed": "The profile bio should include {{bio}}. Please make sure you updated the profile bio of @{{name}} successfully.", - "dashboard_bio_test_succeeful": "You have successfully connected @{{profile}} on {{domain}} to persona {{persona}}.", - "dashboard_connect_profile_for": "Connect Profile for {{persona}}", + "dashboard_bio_test_succeeful": "You have successfully connected your persona {{persona}} to @{{profile}} on {{domain}}.", + "dashboard_connect_profile_for": "Connect {{persona}} to your profile", "dashboard_connected": "Connected", "dashboard_create_backup": "Backup", "dashboard_create_persona_hint": "Create a new persona.", "dashboard_database_import_successful_hint": "Your database has been restored. Existing data will be merged.", "dashboard_delete_persona": "Delete", - "dashboard_delete_persona_confirm_hint": "Do you want to delete persona {{name}}? This operation cannot be reverted.", - "dashboard_disconnect_profile_hint": "Do you want to disconnect {{profile}} on {{network}} from persona {{persona}}? This operation cannot be reverted.", + "dashboard_delete_persona_confirm_hint": "Do you want to delete the persona {{name}}? This operation cannot be reverted.", + "dashboard_disconnect_profile_hint": "Do you want to disconnect {{profile}} on {{network}} from the persona {{persona}}? This operation cannot be reverted.", "dashboard_download": "Download as File", "dashboard_export_keystore": "Export Backup Keystore", "dashboard_hide_qr": "Hide QR Code", From 1163a5de1a408dcb69f77ec44584610385ca6476 Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Tue, 25 Feb 2020 14:32:25 +0800 Subject: [PATCH 65/70] Done review for the first 60 lines --- src/_locales/en/messages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index ce62dc93d240..6a5efc4b4def 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -7,7 +7,7 @@ "adding": "Adding...", "additional_post_box__encrypted_failed": "Please paste the following text into the post box.", "additional_post_box__encrypted_post_pre": "Decrypt this post with #Maskbook ! {{encrypted}}", - "additional_post_box__placeholder_w_name": "Hey {{user}}, what's on your mind? Encrypt itwith Maskbook.", + "additional_post_box__placeholder_w_name": "Hey {{user}}, what's on your mind? Encrypt it with Maskbook.", "additional_post_box__placeholder_wo_name": "What's on your mind? Encrypt it with Maskbook.", "additional_post_box__post_button": "📫 Post it!", "additional_post_box__steganography_post_failed": "Please upload the downloaded image into the post box.", From 05b445d3e409ebbbc4c97928f3d7c22307b5720f Mon Sep 17 00:00:00 2001 From: Jack Works Date: Thu, 27 Feb 2020 14:37:29 +0800 Subject: [PATCH 66/70] chore: i18n follow review --- src/_locales/en/messages.json | 67 +++-------------------------------- src/_locales/zh/messages.json | 61 +------------------------------ 2 files changed, 5 insertions(+), 123 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 6a5efc4b4def..7cd9a3413fe7 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -147,7 +147,7 @@ "options_mobile_export_subtitle": "DO NOT save or share it with others!", "payload_bad": "This post seemed to be corrupted. Maskbook cannot decrypt it.", "payload_incomplete": "This post is not complete, you need to view the full post.", - "payload_not_found": "Doesn't find the payload", + "payload_not_found": "Cannot find the payload", "payload_throw_in_alpha41": "Support for Alpha41 is dropped. Tell your friends to upgrade Maskbook!", "person_or_group_in_chip": "{{name}} ({{count}} in the group)", "person_or_group_in_list_0": "This is an empty group", @@ -195,9 +195,9 @@ "set_up": "Set up", "settings": "Settings", "settings_disable_new_background_tab": "Disable open hidden tabs in the background", - "settings_disable_new_background_tab_desc": "This is a deprecated behavior of Maskbook. If you find that you cannot decrypt some old posts, deselect this.", + "settings_disable_new_background_tab_desc": "Deprecated behavior. Enable if you need to decrypt ancient posts (created before Jan 2020).", "settings_enable_debug": "Enable debug mode", - "settings_enable_debug_desc": "Enable this will display additional information on the Maskbook UI to help to debug", + "settings_enable_debug_desc": "See additional information for debugging.", "settings_image_based_payload": "Enable image-based mode", "settings_image_based_payload_desc": "Publishing post with image-based payload instead of text payload", "settings_language": "Language", @@ -214,65 +214,6 @@ "unknown_persona": "Unknown Persona", "username": "Username", "version": "Version", - "welcome_0_close_button": "I'll do it later", - "welcome_0_restore_key": "I want to restore my backup", - "welcome_1a1_didntfind": "Didn't you find your account?", - "welcome_1a1_title": "To set up which account?", - "welcome_1a1b_connect": "Connect", - "welcome_1a1b_danger": "Censored network", - "welcome_1a1b_switch": "Use existing accounts", - "welcome_1a1b_title": "Maskbook supports these social networks", - "welcome_1a2_description": "Then, only friends you select with Maskbook can see the posted content.", - "welcome_1a2_done_button": "Nice!", - "welcome_1a2_imgalt": "Screenshot of how to encrypt a message with Maskbook", - "welcome_1a2_title": "Encrypt message in a Maskbook postbox", - "welcome_1a3_description1": "Our extension is asking you to download your key as a file.", - "welcome_1a3_description2": "Back it up often.", - "welcome_1a3_done_button": "Got it!", - "welcome_1a3_title": "Keep your backups carefully", - "welcome_1a3a_connect_subtitle": "will use the same CryptoKey", - "welcome_1a3a_connect_title": "Connect other accounts", - "welcome_1a3a_generate_new_key": "Generate", - "welcome_1a3a_generate_new_key_password_help": "Please remember the key, or your key will not be able to restore.", - "welcome_1a3a_generate_new_key_password_label": "Password for the new key", - "welcome_1a3a_generate_new_key_result": "The mnemonic word", - "welcome_1a3a_generate_new_key_result_help": "Mnemonic word is used to restore the key. Make sure you keep it safe.", - "welcome_1a3a_generate_new_key_subtitle": "please save it carefully", - "welcome_1a3a_generate_new_key_title": "Create a new keypair", - "welcome_1a3a_recover_input_password": "Password", - "welcome_1a3a_recover_input_word": "The mnemonic word", - "welcome_1a3a_recover_subtitle": "A 12 words list you backup before", - "welcome_1a3a_recover_title": "Restore by mnemonic word", - "welcome_1a3a_title": "Which crypto key do you want for this account?", - "welcome_1a4_auto_post_description1": "We appreciate your valor!", - "welcome_1a4_auto_post_description2": "Editable after posting.", - "welcome_1a4_auto_post_title": "Create a verification post", - "welcome_1a4_auto_profile_description1": "Easy and lightweight.", - "welcome_1a4_auto_profile_description2": "Never disturb anyone.", - "welcome_1a4_auto_profile_title": "Add public key to profile", - "welcome_1a4_auto_radio_aria": "Choose how to verify your account", - "welcome_1a4_disabled": "Sorry, only one automatic verification method is available.", - "welcome_1a4_title": "Verify Account Ownership", - "welcome_1a4_type_auto_subtitle1": "Avoid any confusion before your first encrypted post.", - "welcome_1a4_type_auto_subtitle2": "This allows your friends to verify the connection between your social network account and your keypair.", - "welcome_1a4_type_auto_switch": "Prefer doing it manually?", - "welcome_1a4_type_manual_goto": "Copy & Go to Profile", - "welcome_1a4_type_manual_subtitle1": "Add this to your bio, or post on your timeline, before your first encrypted post.", - "welcome_1a4_type_manual_subtitle2": "This allows your friends to verify the connection between your social network account and your keypair.", - "welcome_1a4_type_manual_switch": "Prefer automating the steps?", - "welcome_1b_confirm": "Restore the backup", "welcome_1b_dragging": "Drag your key backup into this dialog", - "welcome_1b_file_selected": "Selected exported key backup: {{filename}}", - "welcome_1b_hint_identity": "This backup file contains the following accounts:", - "welcome_1b_hint_network": "And Maskbook is going to request permissions for these sites:", - "welcome_1b_no_file_selected": "Select your exported key backup", - "welcome_1b_qr_error_1": "There is an error that occurs during scanning.", - "welcome_1b_qr_error_2": "You may try other ways to restore your account.", - "welcome_1b_qr_rescan": "Rescan", - "welcome_1b_tabs_backup": "Select the backup file", - "welcome_1b_tabs_qr": "Scan the QR Code", - "welcome_1b_tabs_text": "Paste the content of the backup file by yourself", - "welcome_1b_title": "Restore your keypair", - "welcome_2_greeting": "You can use Maskbook now!", - "welcome_2_title": "You're done!" + "welcome_1b_file_selected": "Selected exported key backup: {{filename}}" } diff --git a/src/_locales/zh/messages.json b/src/_locales/zh/messages.json index 3b8bbf49f354..ab32f23af6f8 100644 --- a/src/_locales/zh/messages.json +++ b/src/_locales/zh/messages.json @@ -211,65 +211,6 @@ "unknown_persona": "未知角色", "username": "用戶名", "version": "版本", - "welcome_0_close_button": "我想以後再做", - "welcome_0_restore_key": "導入備份檔案", - "welcome_1a1_didntfind": "沒有找到你的賬戶?", - "welcome_1a1_title": "你希望為哪個賬戶設定 Maskbook?", - "welcome_1a1b_connect": "連結", - "welcome_1a1b_danger": "受審查的站點", - "welcome_1a1b_switch": "連接現有的賬戶", - "welcome_1a1b_title": "Maskbook 可以在這些社交網絡上使用", - "welcome_1a2_description": "這樣,只有你選中的好友才能解密這條訊息", - "welcome_1a2_done_button": "棒耶!", - "welcome_1a2_imgalt": "關於如何使用 Maskbook 加密的截圖", - "welcome_1a2_title": "使用 Maskbook 的輸入框來加密", - "welcome_1a3_description1": "稍後會有一個保存提示,請妥善保管備份檔案。", - "welcome_1a3_description2": "記得經常創建新備份!", - "welcome_1a3_done_button": "瞭解!", - "welcome_1a3_title": "請妥善保管備份檔案", - "welcome_1a3a_connect_subtitle": "這會使用相同的密鑰", - "welcome_1a3a_connect_title": "關聯其他賬戶", - "welcome_1a3a_generate_new_key": "創建新密鑰", - "welcome_1a3a_generate_new_key_password_help": "請牢記密碼,否則只憑藉助記詞是無法恢復密鑰的", - "welcome_1a3a_generate_new_key_password_label": "新密鑰的密碼", - "welcome_1a3a_generate_new_key_result": "請抄寫助記詞", - "welcome_1a3a_generate_new_key_result_help": "助記詞用於恢復密鑰,確定保管好后按“確認”", - "welcome_1a3a_generate_new_key_subtitle": "請妥善保管", - "welcome_1a3a_generate_new_key_title": "創建新的密鑰", - "welcome_1a3a_recover_input_password": "密碼", - "welcome_1a3a_recover_input_word": "助記詞", - "welcome_1a3a_recover_subtitle": "輸入以前記錄的助記詞", - "welcome_1a3a_recover_title": "用助記詞恢復", - "welcome_1a3a_title": "你希望這個賬戶使用什麽密鑰?", - "welcome_1a4_auto_post_description1": "我們感謝你的支持", - "welcome_1a4_auto_post_description2": "你可以調整文本措辭", - "welcome_1a4_auto_post_title": "發佈一個聲明訊息", - "welcome_1a4_auto_profile_description1": "簡潔高效", - "welcome_1a4_auto_profile_description2": "不會打擾到任何人", - "welcome_1a4_auto_profile_title": "添加公鑰到個人簡介", - "welcome_1a4_auto_radio_aria": "選擇賬號歸屬權驗證手段", - "welcome_1a4_disabled": "由於技術問題,暫時只有一種驗證方式可用。", - "welcome_1a4_title": "驗證賬號歸屬權", - "welcome_1a4_type_auto_subtitle1": "避免好友感到迷惑", - "welcome_1a4_type_auto_subtitle2": "這使得你的好友能夠驗證你的社交網路賬號與你的 Maskbook 公鑰都屬於你。", - "welcome_1a4_type_auto_switch": "更願意手動操作?", - "welcome_1a4_type_manual_goto": "拷貝並跳轉到個人簡介", - "welcome_1a4_type_manual_subtitle1": "將這串文本添加到個人簡介或分享到時間線,在發佈第一條加密訊息之前。", - "welcome_1a4_type_manual_subtitle2": "這使得你的好友能夠驗證你的社交網路賬號與你的 Maskbook 公鑰都屬於你。", - "welcome_1a4_type_manual_switch": "更願意讓 Maskbook 代勞?", - "welcome_1b_confirm": "恢復備份", "welcome_1b_dragging": "將備份檔案拖拽到此處", - "welcome_1b_file_selected": "已選取備份檔案:{{filename}}", - "welcome_1b_hint_identity": "備份文件中包含了以下身份:", - "welcome_1b_hint_network": "爲此,Maskbook 將要請求以下網站的權限:", - "welcome_1b_no_file_selected": "選取備份檔案", - "welcome_1b_qr_error_1": "掃描過程中出現錯誤", - "welcome_1b_qr_error_2": "你或許可以試試其他方式來恢復賬號設定。", - "welcome_1b_qr_rescan": "重試", - "welcome_1b_tabs_backup": "選擇備份檔案", - "welcome_1b_tabs_qr": "掃描 QR 碼", - "welcome_1b_tabs_text": "手動貼入備份檔案的内容", - "welcome_1b_title": "導入備份檔案", - "welcome_2_greeting": "你現在可以使用 Maskbook 了!", - "welcome_2_title": "完畢!" + "welcome_1b_file_selected": "已選取備份檔案:{{filename}}" } From 43396110ebe5cad5c8a040b1f47991e39cc813ac Mon Sep 17 00:00:00 2001 From: Jack Works Date: Thu, 27 Feb 2020 14:43:08 +0800 Subject: [PATCH 67/70] chore: remove unused i18n string --- src/_locales/en/messages.json | 2 -- src/_locales/zh/messages.json | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 7cd9a3413fe7..ddfada050a50 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -20,9 +20,7 @@ "back": "Back", "backup": "Backup", "backup_persona": "Backup your persona.", - "banner_empty_username": "If not filled automatically, you may enter it yourself.", "banner_get_started": "Setup Maskbook", - "banner_invalid_username": "This does not seem like a valid username.", "banner_preparing_setup": "You need to setup your Maskbook account.", "banner_title": "Welcome to Maskbook", "cancel": "Cancel", diff --git a/src/_locales/zh/messages.json b/src/_locales/zh/messages.json index ab32f23af6f8..2cc4f1f018a0 100644 --- a/src/_locales/zh/messages.json +++ b/src/_locales/zh/messages.json @@ -17,9 +17,7 @@ "back": "返回", "backup": "備份", "backup_persona": "備份角色", - "banner_empty_username": "如果自動探測用戶名沒有成功,請手動在此輸入", "banner_get_started": "設定 Maskbook", - "banner_invalid_username": "這看起來不像正確的用戶名", "banner_preparing_setup": "Maskbook 需要設定你的賬號。", "banner_title": "歡迎使用 Maskbook", "cancel": "取消", From d0b6b687a51d7a58302f83400d74fd40c3c99843 Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Mon, 2 Mar 2020 19:13:16 +0800 Subject: [PATCH 68/70] Removed unresolved code junks --- src/_locales/en/messages.json | 3 --- src/_locales/zh/messages.json | 51 ----------------------------------- 2 files changed, 54 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 9ae536bb5810..292fcfafdae5 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -7,9 +7,6 @@ "adding": "Adding...", "additional_post_box__encrypted_failed": "Please paste the following text into the post box.", "additional_post_box__encrypted_post_pre": "Decrypt this post with #Maskbook ! {{encrypted}}", - "additional_post_box__placeholder_w_name": "Hey {{user}}, what's on your mind? Encrypt it with Maskbook.", - "additional_post_box__placeholder_wo_name": "What's on your mind? Encrypt it with Maskbook.", - "additional_post_box__post_button": "📫 Post it!", "additional_post_box__steganography_post_failed": "Please upload the downloaded image into the post box.", "additional_post_box__steganography_post_pre": "This post is shared with my friends. You may install Maskbook to decrypt the content from the image. ([I:b]) {{random}}", "advanced": "Advanced...", diff --git a/src/_locales/zh/messages.json b/src/_locales/zh/messages.json index b9acaab7b3f6..9e060a821445 100644 --- a/src/_locales/zh/messages.json +++ b/src/_locales/zh/messages.json @@ -212,57 +212,6 @@ "unknown_persona": "未知角色", "username": "用戶名", "version": "版本", -<<<<<<< HEAD - "version_link": "https://github.com/DimensionDev/Maskbook/releases#{{tag}}", - "welcome_0_close_button": "我想以後再做", - "welcome_0_restore_key": "導入備份檔案", - "welcome_1a1_didntfind": "沒有找到你的賬戶?", - "welcome_1a1_title": "你希望為哪個賬戶設定 Maskbook?", - "welcome_1a1b_connect": "連結", - "welcome_1a1b_danger": "受審查的站點", - "welcome_1a1b_switch": "連接現有的賬戶", - "welcome_1a1b_title": "Maskbook 可以在這些社交網絡上使用", - "welcome_1a2_description": "這樣,只有你選中的好友才能解密這條訊息", - "welcome_1a2_done_button": "棒耶!", - "welcome_1a2_imgalt": "關於如何使用 Maskbook 加密的截圖", - "welcome_1a2_title": "使用 Maskbook 的輸入框來加密", - "welcome_1a3_description1": "稍後會有一個保存提示,請妥善保管備份檔案。", - "welcome_1a3_description2": "記得經常創建新備份!", - "welcome_1a3_done_button": "瞭解!", - "welcome_1a3_title": "請妥善保管備份檔案", - "welcome_1a3a_connect_subtitle": "這會使用相同的密鑰", - "welcome_1a3a_connect_title": "關聯其他賬戶", - "welcome_1a3a_generate_new_key": "創建新密鑰", - "welcome_1a3a_generate_new_key_password_help": "請牢記密碼,否則只憑藉助記詞是無法恢復密鑰的", - "welcome_1a3a_generate_new_key_password_label": "新密鑰的密碼", - "welcome_1a3a_generate_new_key_result": "請抄寫助記詞", - "welcome_1a3a_generate_new_key_result_help": "助記詞用於恢復密鑰,確定保管好后按“確認”", - "welcome_1a3a_generate_new_key_subtitle": "請妥善保管", - "welcome_1a3a_generate_new_key_title": "創建新的密鑰", - "welcome_1a3a_recover_input_password": "密碼", - "welcome_1a3a_recover_input_word": "助記詞", - "welcome_1a3a_recover_subtitle": "輸入以前記錄的助記詞", - "welcome_1a3a_recover_title": "用助記詞恢復", - "welcome_1a3a_title": "你希望這個賬戶使用什麽密鑰?", - "welcome_1a4_auto_post_description1": "我們感謝你的支持", - "welcome_1a4_auto_post_description2": "你可以調整文本措辭", - "welcome_1a4_auto_post_title": "發佈一個聲明訊息", - "welcome_1a4_auto_profile_description1": "簡潔高效", - "welcome_1a4_auto_profile_description2": "不會打擾到任何人", - "welcome_1a4_auto_profile_title": "添加公鑰到個人簡介", - "welcome_1a4_auto_radio_aria": "選擇賬號歸屬權驗證手段", - "welcome_1a4_disabled": "由於技術問題,暫時只有一種驗證方式可用。", - "welcome_1a4_title": "驗證賬號歸屬權", - "welcome_1a4_type_auto_subtitle1": "避免好友感到迷惑", - "welcome_1a4_type_auto_subtitle2": "這使得你的好友能夠驗證你的社交網路賬號與你的 Maskbook 公鑰都屬於你。", - "welcome_1a4_type_auto_switch": "更願意手動操作?", - "welcome_1a4_type_manual_goto": "拷貝並跳轉到個人簡介", - "welcome_1a4_type_manual_subtitle1": "將這串文本添加到個人簡介或分享到時間線,在發佈第一條加密訊息之前。", - "welcome_1a4_type_manual_subtitle2": "這使得你的好友能夠驗證你的社交網路賬號與你的 Maskbook 公鑰都屬於你。", - "welcome_1a4_type_manual_switch": "更願意讓 Maskbook 代勞?", - "welcome_1b_confirm": "恢復備份", -======= ->>>>>>> master "welcome_1b_dragging": "將備份檔案拖拽到此處", "welcome_1b_file_selected": "已選取備份檔案:{{filename}}" } From eef2ba41222159565ed545f42babe80d9317cd81 Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Mon, 2 Mar 2020 19:26:56 +0800 Subject: [PATCH 69/70] Added version link back --- src/_locales/en/messages.json | 1 + src/_locales/zh/messages.json | 1 + 2 files changed, 2 insertions(+) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 292fcfafdae5..56e9406ea60f 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -212,6 +212,7 @@ "unknown_persona": "Unknown Persona", "username": "Username", "version": "Version", + "version_link": "https://github.com/DimensionDev/Maskbook/releases#{{tag}}", "welcome_1b_dragging": "Drag your key backup into this dialog", "welcome_1b_file_selected": "Selected exported key backup: {{filename}}" } diff --git a/src/_locales/zh/messages.json b/src/_locales/zh/messages.json index 9e060a821445..8f47c47a519d 100644 --- a/src/_locales/zh/messages.json +++ b/src/_locales/zh/messages.json @@ -212,6 +212,7 @@ "unknown_persona": "未知角色", "username": "用戶名", "version": "版本", + "version_link": "https://github.com/DimensionDev/Maskbook/releases#{{tag}}", "welcome_1b_dragging": "將備份檔案拖拽到此處", "welcome_1b_file_selected": "已選取備份檔案:{{filename}}" } From d606218f16c31e75aaf9cdb23b98a2d9fa9ea35c Mon Sep 17 00:00:00 2001 From: Jack Works Date: Mon, 2 Mar 2020 22:38:19 +0800 Subject: [PATCH 70/70] chore: bump version to 1.10.9 --- package.json | 2 +- src/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 94e1047a3c28..8d3ce8e831b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "maskbook", - "version": "1.10.8", + "version": "1.10.9", "private": true, "license": "AGPL-3.0-or-later", "scripts": { diff --git a/src/manifest.json b/src/manifest.json index 59f7dc2634b5..33a080d0b28f 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "$schema": "http://json.schemastore.org/chrome-manifest", "name": "Maskbook", - "version": "1.10.8", + "version": "1.10.9", "manifest_version": 2, "web_accessible_resources": ["*.css", "*.js", "*.jpg", "*.png"], "permissions": ["storage", "downloads", "webNavigation", "activeTab"],