hash
stringlengths
40
40
date
stringdate
2018-01-15 01:43:19
2024-04-02 15:49:23
author
stringclasses
18 values
commit_message
stringlengths
10
72
is_merge
bool
1 class
git_diff
stringlengths
132
6.87M
type
stringclasses
11 values
masked_commit_message
stringlengths
4
58
b82cdac58d24d9127062724dbe2eb17d55cf32b1
2019-02-12 19:04:55
CRIMX
chore: only test spec files
false
diff --git a/package.json b/package.json index 755e54a9e..d8277fdaf 100644 --- a/package.json +++ b/package.json @@ -163,7 +163,7 @@ "enzyme-to-json/serializer" ], "testMatch": [ - "<rootDir>/test/specs/**/*.{ts,tsx,js,jsx}" + "<rootDir>/test/specs/**/*.spec.{ts,tsx,js,jsx}" ], "testEnvironment": "node", "testURL": "http://localhost",
chore
only test spec files
4ad4dcf6822de254c4bf7d7a61beff4aea7aee42
2019-05-09 20:40:06
CRIMX
fix(dicts): get correct lang list on consecutive searches
false
diff --git a/src/components/dictionaries/wikipedia/View.tsx b/src/components/dictionaries/wikipedia/View.tsx index 43e2448f3..d5c70a7f8 100644 --- a/src/components/dictionaries/wikipedia/View.tsx +++ b/src/components/dictionaries/wikipedia/View.tsx @@ -5,28 +5,14 @@ import { message } from '@/_helpers/browser-api' import { MsgType, MsgDictEngineMethod } from '@/typings/message' interface WikipediaState { - cloneProps: ViewPorps<WikipediaResult> | null langList: null | LangList } export default class DictWikipedia extends React.PureComponent<ViewPorps<WikipediaResult>, WikipediaState> { state: WikipediaState = { - cloneProps: null, langList: null, } - static getDerivedStateFromProps (props: ViewPorps<WikipediaResult>, state: WikipediaState) { - if (props !== state.cloneProps) { - return { - cloneProps: props, - langList: null, - } - } - return { - cloneProps: props, - } - } - handleEntryClick = (e: React.MouseEvent<HTMLDivElement>) => { if (!e.target['classList']) { return @@ -84,7 +70,7 @@ export default class DictWikipedia extends React.PureComponent<ViewPorps<Wikiped } renderLangSelector () { - if (this.state.langList) { + if (this.state.langList && this.state.langList.length > 0) { return ( <select style={{ width: '100%' }} diff --git a/src/components/dictionaries/wikipedia/engine.ts b/src/components/dictionaries/wikipedia/engine.ts index 5165b41b3..b5e010110 100644 --- a/src/components/dictionaries/wikipedia/engine.ts +++ b/src/components/dictionaries/wikipedia/engine.ts @@ -43,11 +43,16 @@ export const search: SearchFunction<WikipediaSearchResult, WikipediaPayload> = ( text, config, profile, payload ) => { const { lang } = profile.dicts.all.wikipedia.options - const subdomain = getSubdomain(text, lang) + let subdomain = getSubdomain(text, lang) let url = payload.url if (url) { - url = url.replace(/^\//, `https://${subdomain}.m.wikipedia.org/`) + const matchSubdomain = url.match(/([^\/\.]+)\.m\.wikipedia\.org/) + if (matchSubdomain) { + subdomain = matchSubdomain[1] + } else { + url = url.replace(/^\//, `https://${subdomain}.m.wikipedia.org/`) + } } else { const path = lang.startsWith('zh-') ? lang : 'wiki' url = `https://${subdomain}.m.wikipedia.org/${path}/${encodeURIComponent(text)}`
fix
get correct lang list on consecutive searches
a95c29d2a24e913be81c68ca92860ea05cc82686
2021-10-16 22:04:01
crimx
refactor(dicts): request tencent credential
false
diff --git a/src/components/dictionaries/tencent/engine.ts b/src/components/dictionaries/tencent/engine.ts index 688c1547..4cf7fd6a 100644 --- a/src/components/dictionaries/tencent/engine.ts +++ b/src/components/dictionaries/tencent/engine.ts @@ -58,6 +58,23 @@ export const search: SearchFunction< const translatorConfig = secretId && secretKey ? { secretId, secretKey } : undefined + if (!translatorConfig) { + return machineResult( + { + result: { + requireCredential: true, + id: 'tencent', + sl: 'auto', + tl: 'auto', + slInitial: 'hide', + searchText: { paragraphs: [''] }, + trans: { paragraphs: [''] } + } + }, + [] + ) + } + try { const result = await translator.translate(text, sl, tl, translatorConfig) // Tencent needs extra api credits for TTS which does
refactor
request tencent credential
a2c1fda618230913077bac1b16270c0972e4d8ee
2019-02-12 02:15:20
CRIMX
feat(config): add baidu to ctxTrans
false
diff --git a/src/app-config/index.ts b/src/app-config/index.ts index 4607c82ed..43e2a13b0 100644 --- a/src/app-config/index.ts +++ b/src/app-config/index.ts @@ -219,6 +219,7 @@ function _getDefaultConfig () { ctxTrans: { google: true, sogou: true, + baidu: true, } as { [id in DictID]: boolean }, /** start searching when source containing the languages */
feat
add baidu to ctxTrans
d584e313e4cbf6370a8d8c397ce32f4fb9659976
2020-03-26 15:32:23
crimx
fix(panel): hide external divs
false
diff --git a/src/content/content.scss b/src/content/content.scss new file mode 100644 index 000000000..237248436 --- /dev/null +++ b/src/content/content.scss @@ -0,0 +1,10 @@ +.saladict-external, +.saladict-panel { + display: block !important; + width: 0 !important; + height: 0 !important; + margin: 0 !important; + padding: 0 !important; + border: none !important; + outline: none !important; +} diff --git a/src/content/index.tsx b/src/content/index.tsx index 831de79d9..174dff53e 100644 --- a/src/content/index.tsx +++ b/src/content/index.tsx @@ -9,6 +9,8 @@ import createStore from './redux/create' import { I18nextProvider as ProviderI18next } from 'react-i18next' import { i18nLoader } from '@/_helpers/i18n' +import './content.scss' + // Only load on top frame if (window.parent === window && !window.__SALADICT_PANEL_LOADED__) { window.__SALADICT_PANEL_LOADED__ = true
fix
hide external divs
43c5e7bf586d8c4534db0f2bcdab1973adabcbff
2018-02-23 03:32:35
greenkeeperio-bot
chore(package): update lockfile
false
diff --git a/yarn.lock b/yarn.lock index c5447f7f9..f69ad4605 100644 --- a/yarn.lock +++ b/yarn.lock @@ -679,12 +679,12 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" [email protected]: - version "22.4.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-22.4.0.tgz#79479739c87a39327383bb944a0a8a2deb5c9b4d" [email protected]: + version "22.4.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-22.4.1.tgz#ff53ebca45957347f27ff4666a31499fbb4c4ddd" dependencies: babel-plugin-istanbul "^4.1.5" - babel-preset-jest "^22.2.0" + babel-preset-jest "^22.4.1" babel-jest@^22.1.0: version "22.1.0" @@ -725,9 +725,9 @@ babel-plugin-jest-hoist@^22.1.0: version "22.1.0" resolved "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-22.1.0.tgz#c1281dd7887d77a1711dc760468c3b8285dde9ee" -babel-plugin-jest-hoist@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-22.2.0.tgz#bd34f39d652406669713b8c89e23ef25c890b993" +babel-plugin-jest-hoist@^22.4.1: + version "22.4.1" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-22.4.1.tgz#d712fe5da8b6965f3191dacddbefdbdf4fb66d63" babel-plugin-lodash@^3.3.2: version "3.3.2" @@ -1058,11 +1058,11 @@ babel-preset-jest@^22.0.1, babel-preset-jest@^22.1.0: babel-plugin-jest-hoist "^22.1.0" babel-plugin-syntax-object-rest-spread "^6.13.0" -babel-preset-jest@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-22.2.0.tgz#f77b43f06ef4d8547214b2e206cc76a25c3ba0e2" +babel-preset-jest@^22.4.1: + version "22.4.1" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-22.4.1.tgz#efa2e5f5334242a9457a068452d7d09735db172a" dependencies: - babel-plugin-jest-hoist "^22.2.0" + babel-plugin-jest-hoist "^22.4.1" babel-plugin-syntax-object-rest-spread "^6.13.0" babel-preset-react@^6.24.1:
chore
update lockfile
021350768a3f88837147eac6869c500b56e431bf
2019-05-30 19:17:02
CRIMX
refactor: add zdic help locale
false
diff --git a/src/components/dictionaries/zdic/_locales.json b/src/components/dictionaries/zdic/_locales.json index 0e5a6f748..50796d833 100644 --- a/src/components/dictionaries/zdic/_locales.json +++ b/src/components/dictionaries/zdic/_locales.json @@ -10,5 +10,12 @@ "zh_CN": "开启发音", "zh_TW": "啟用發音" } + }, + "helps": { + "audio": { + "en": "Referer modification is required, which may slightly impact performance.", + "zh_CN": "突破外链限制需要改写 Referer,可能会轻微影响性能。", + "zh_TW": "突破外鏈限制需要改寫 Referer,可能會輕微影響效能。" + } } }
refactor
add zdic help locale
b155957e9e880c38ac4cb5569f5cf0eea70c01d5
2018-03-01 11:41:59
greenkeeperio-bot
chore(package): update lockfile
false
diff --git a/yarn.lock b/yarn.lock index fd9535389..06f982465 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3810,9 +3810,9 @@ html-minifier@^3.2.3: relateurl "0.2.x" uglify-js "3.3.x" [email protected]: - version "3.0.0" - resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-3.0.0.tgz#243b1f4e59ea2e389ebd14f8af140206c719f8a0" [email protected]: + version "3.0.1" + resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-3.0.1.tgz#7d7275d4a179f892c62cebe33afd4c765a70a0a2" dependencies: html-minifier "^3.2.3" loader-utils "^0.2.16"
chore
update lockfile
ed6e6aa30f324d5299c47c062e4ac33a72404569
2019-03-27 18:35:21
CRIMX
chore(release): 6.27.7
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index 6067d8ea1..940e14af8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +<a name="6.27.7"></a> +## [6.27.7](https://github.com/crimx/ext-saladict/compare/v6.27.6...v6.27.7) (2019-03-27) + + +### Bug Fixes + +* **panel:** proper update dict styles ([264c731](https://github.com/crimx/ext-saladict/commit/264c731)), closes [#331](https://github.com/crimx/ext-saladict/issues/331) + + + <a name="6.27.6"></a> ## [6.27.6](https://github.com/crimx/ext-saladict/compare/v6.27.5...v6.27.6) (2019-03-27) diff --git a/package.json b/package.json index 08a0c00e4..b5d265bf7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "saladict", - "version": "6.27.6", + "version": "6.27.7", "description": "Chrome extension and Firefox WebExtension, inline translator powered by mutiple online dictionaries", "private": true, "scripts": {
chore
6.27.7
b8e7471d1f9a28d122fada7469fc7ee15d9c5ff4
2018-06-05 22:06:31
CRIMX
chore(release): 6.1.1
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ef907bac..eee318058 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +<a name="6.1.1"></a> +## [6.1.1](https://github.com/crimx/ext-saladict/compare/v6.1.0...v6.1.1) (2018-06-05) + + +### Bug Fixes + +* **panel:** fix right click ([d06be31](https://github.com/crimx/ext-saladict/commit/d06be31)) + + + <a name="6.1.0"></a> # [6.1.0](https://github.com/crimx/ext-saladict/compare/v6.0.0...v6.1.0) (2018-06-05) diff --git a/package.json b/package.json index e99cbe624..5fdfcb788 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "saladict", - "version": "6.1.0", + "version": "6.1.1", "description": "Chrome extension and Firefox WebExtension, inline translator powered by mutiple online dictionaries", "private": true, "scripts": {
chore
6.1.1
7e5d9f65bac2c4e6db27001076a271b2161bb1b4
2018-02-21 01:22:53
greenkeeperio-bot
chore(package): update lockfile
false
diff --git a/yarn.lock b/yarn.lock index d15a45953..6e354366a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3088,9 +3088,9 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" [email protected]: - version "1.1.7" - resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-1.1.7.tgz#0a3ad0fe81695feeed6f2dac324fce500c30f0a0" [email protected]: + version "1.1.8" + resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-1.1.8.tgz#a62592ed732667d7482dc3268c381c7f0c913086" dependencies: loader-utils "^1.0.2" schema-utils "^0.4.5"
chore
update lockfile
b72a4a9288a2615a3c655972a4e78642654e4678
2020-05-01 08:27:38
crimx
chore(release): 7.11.0
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index ca85df3c6..33feab589 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,37 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [7.11.0](https://github.com/crimx/ext-saladict/compare/v7.10.4...v7.11.0) (2020-05-01) + + +### Features + +* **dicts:** add jikipedia ([046b850](https://github.com/crimx/ext-saladict/commit/046b850c83516c43022773bdd2ab6cacbb7696fa)) +* fix buggy axios ([9eb8172](https://github.com/crimx/ext-saladict/commit/9eb817242365961cd940bd5e54547b601678c7ce)) +* **panel:** add sticky folding ([7b2c352](https://github.com/crimx/ext-saladict/commit/7b2c3524b452925d126d6bd15770649a353e2068)), closes [#765](https://github.com/crimx/ext-saladict/issues/765) +* **panel:** remember last standalone window position ([3d25428](https://github.com/crimx/ext-saladict/commit/3d254280e6c2a16a7bd5de99eace55090c04cc88)), closes [#766](https://github.com/crimx/ext-saladict/issues/766) +* **profiles:** add shortcuts for top profiles ([de9ca07](https://github.com/crimx/ext-saladict/commit/de9ca077c23147859ebc648b3202faa5b25bca15)) +* added option qsFocus ([51e59f9](https://github.com/crimx/ext-saladict/commit/51e59f91fb27ed3c942d2f9c4aa88e31f78eef84)), closes [#764](https://github.com/crimx/ext-saladict/issues/764) + + +### Bug Fixes + +* **badge:** remove badge text ([873b1c7](https://github.com/crimx/ext-saladict/commit/873b1c77d3655e4b10dcb389108aabf9c9e31b4c)), closes [#770](https://github.com/crimx/ext-saladict/issues/770) +* **options:** prevent panel being opened accidentally ([a673c9f](https://github.com/crimx/ext-saladict/commit/a673c9f94f46d19121058b0f534a5aaa750d8453)), closes [#769](https://github.com/crimx/ext-saladict/issues/769) +* **panel:** do not update search box text on selection ([b104405](https://github.com/crimx/ext-saladict/commit/b1044050d92ee4fb5a2f4bd594d2bd9ca44eca12)) +* **pdf:** remove 'unsafe-eval' CSP ([eaea459](https://github.com/crimx/ext-saladict/commit/eaea459ae500cf84cea3f65e59c573d6816d222d)) + + +### Build System + +* fix script arguments ([df78f19](https://github.com/crimx/ext-saladict/commit/df78f199b71fd4b018903fd57e00c39928986c1c)) + + +### Tests + +* **background:** remove update check ([1f1b5ff](https://github.com/crimx/ext-saladict/commit/1f1b5ffa7ed8fb99773f645eb20555a00b12bacd)) +* **storybook:** add path pattern ([61a883a](https://github.com/crimx/ext-saladict/commit/61a883a928aaa7c640194592ceb42a650e6d2647)) + ### [7.10.4](https://github.com/crimx/ext-saladict/compare/v7.10.3...v7.10.4) (2020-04-27) ### [7.10.3](https://github.com/crimx/ext-saladict/compare/v7.10.2...v7.10.3) (2020-04-26) diff --git a/package.json b/package.json index e6d65132b..e526ef82f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "saladict", - "version": "7.10.4", + "version": "7.11.0", "description": "Chrome extension and Firefox WebExtension, inline translator powered by mutiple online dictionaries", "private": true, "scripts": {
chore
7.11.0
00a138140afba37af970ab7c63ded32f83cd2d9f
2018-07-26 23:59:53
CRIMX
fix(panel): triple ctrl auto search
false
diff --git a/src/content/redux/modules/dictionaries.ts b/src/content/redux/modules/dictionaries.ts index 2a47baa7f..eb592c8ba 100644 --- a/src/content/redux/modules/dictionaries.ts +++ b/src/content/redux/modules/dictionaries.ts @@ -7,7 +7,7 @@ import { createAppConfigStream } from '@/_helpers/config-manager' import { isContainChinese, isContainEnglish, testerPunct, isContainMinor, testerChinese, testJapanese, testKorean } from '@/_helpers/lang-check' import { MsgType, MsgFetchDictResult } from '@/typings/message' import { StoreState, DispatcherThunk, Dispatcher } from './index' -import { isInNotebook } from './widget' +import { isInNotebook, tripleCtrlPressed } from './widget' const isSaladictOptionsPage = !!window.__SALADICT_OPTIONS_PAGE__ const isSaladictInternalPage = !!window.__SALADICT_INTERNAL_PAGE__ @@ -388,6 +388,8 @@ function listenTrpleCtrl ( const state = getState() if (state.widget.shouldPanelShow) { return } + dispatch(tripleCtrlPressed()) + const { tripleCtrlPreload, tripleCtrlAuto } = state.config const fetchInfo = tripleCtrlPreload === 'selection' diff --git a/src/content/redux/modules/widget.ts b/src/content/redux/modules/widget.ts index 6166f557f..cfaa61f0c 100644 --- a/src/content/redux/modules/widget.ts +++ b/src/content/redux/modules/widget.ts @@ -416,12 +416,6 @@ export function startUpAction (): DispatcherThunk { listenNewSelection(dispatch, getState) listenTempDisable(dispatch, getState) - if (!isSaladictOptionsPage && !isSaladictPopupPage) { - message.self.addListener(MsgType.TripleCtrl, () => { - dispatch(tripleCtrlPressed()) - }) - } - createAppConfigStream().subscribe(config => { dispatch(newConfig(config)) })
fix
triple ctrl auto search
76dc07ba3a2c506deb8415bc83ef629ce8719d18
2018-05-07 22:15:41
CRIMX
feat(background): add search result typing
false
diff --git a/src/typings/server.ts b/src/typings/server.ts new file mode 100644 index 000000000..741aeb4aa --- /dev/null +++ b/src/typings/server.ts @@ -0,0 +1,10 @@ +export interface DictSearchResult<R> { + /** search result */ + result: R + /** auto play sound */ + audio?: { + uk?: string + us?: string + py?: string + } +}
feat
add search result typing
f108f2e1c098512aab690e2ac9a9fc12f4180fea
2018-12-03 21:39:18
CRIMX
fix: inject panel to every page on install
false
diff --git a/src/background/initialization.ts b/src/background/initialization.ts index 317593d5a..9e9b6cd3d 100644 --- a/src/background/initialization.ts +++ b/src/background/initialization.ts @@ -80,6 +80,12 @@ async function onInstalled ({ reason, previousVersion }: { reason: string, previ openURL('https://github.com/crimx/crx-saladict/wiki/Instructions#wiki-content') storage.sync.set({ hasInstructionsShown: true }) } + (await browser.tabs.query({})).forEach(tab => { + if (tab.id) { + browser.tabs.executeScript(tab.id, { file: '/content.js' }).catch(() => {/**/}) + browser.tabs.insertCSS(tab.id, { file: '/content.css' }).catch(() => {/**/}) + } + }) } else if (reason === 'update') { // ignore patch updates if (!previousVersion || previousVersion.replace(/[^.]*$/, '') !== browser.runtime.getManifest().version.replace(/[^.]*$/, '')) {
fix
inject panel to every page on install
f944440d558c749ad174fedeb6fac5b852c3b87d
2020-04-08 22:25:19
crimx
refactor(locales): update locales
false
diff --git a/src/_locales/zh-CN/options.ts b/src/_locales/zh-CN/options.ts index 17de24913..9d7765798 100644 --- a/src/_locales/zh-CN/options.ts +++ b/src/_locales/zh-CN/options.ts @@ -1,6 +1,29 @@ export const locale = { title: '沙拉查词设置', previewPanel: '预览查词面板', + + config: { + active: '启用划词翻译', + active_help: '关闭后「快捷查词」功能依然可用。', + animation: '开启动画过渡', + animation_help: '在低性能设备上关闭过渡动画可减少渲染负担。', + darkMode: '黑暗模式', + langCode: '界面语言', + + opt: { + export: '导出设定', + help: '设定已通过浏览器自动同步,也可以手动导入导出。', + import: '导入设定', + import_error: '导入设定失败', + reset: '重置设定', + reset_confirm: '所有设定将还原到默认值,确定?', + upload_error: '设置保存失败' + } + }, + + shortcuts: '设置快捷键', + unsave_confirm: '修改尚未保存,确定放弃?', + dict: { add: '添加词典', default_height: '词典默认高度', @@ -67,8 +90,6 @@ export const locale = { analytics_help: '提供匿名设备浏览器版本信息。沙拉查词作者会优先支持用户量更多的设备和浏览器。', animation: '开启动画过渡', - animation_help: '在低性能设备上关闭过渡动画可减少渲染负担。', - app_active_help: '关闭后「快捷查词」功能依然可用。', autopron: { accent: '优先口音', accent_uk: '英式', @@ -154,7 +175,7 @@ export const locale = { sel_lang_help: '当选中的文字包含相应的语言时才进行查找。', sel_lang_warning: '注意日语与韩语也包含了汉字。法语、德语和西语也包含了英文。若取消了中文或英语而勾选了其它语言,则只匹配那些语言独有的部分,如日语只匹配假名。', - shortcuts: '设置快捷键', + searchMode: { direct: '直接搜索', direct_help: '直接显示词典面板。',
refactor
update locales
0229cc28124567cbe6a79c71d474c935da094756
2020-07-06 12:43:31
crimx
fix(components): typo
false
diff --git a/src/components/FloatBox/index.tsx b/src/components/FloatBox/index.tsx index fd0729446..0f8d11921 100644 --- a/src/components/FloatBox/index.tsx +++ b/src/components/FloatBox/index.tsx @@ -118,7 +118,7 @@ export const FloatBox: FC<FloatBoxProps> = React.forwardRef( key={item.key} className="floatBox-Item floatBox-Btn" data-key={item.key} - date-value={item.value} + data-value={item.value} onFocus={props.onFocus} onBlur={props.onBlur} onClick={onBtnItemClick}
fix
typo
28bc2972e8c6687cd34915624504f6dac126b943
2018-11-28 16:28:55
CRIMX
chore(release): 6.21.2
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index 429142bb0..e82c512ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +<a name="6.21.2"></a> +## [6.21.2](https://github.com/crimx/ext-saladict/compare/v6.21.1...v6.21.2) (2018-11-28) + + +### Bug Fixes + +* **dicts:** encode sogou ([cd2cbc5](https://github.com/crimx/ext-saladict/commit/cd2cbc5)) + + + <a name="6.21.1"></a> ## [6.21.1](https://github.com/crimx/ext-saladict/compare/v6.21.0...v6.21.1) (2018-11-26) diff --git a/package.json b/package.json index 5a2505d44..4e67b13a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "saladict", - "version": "6.21.1", + "version": "6.21.2", "description": "Chrome extension and Firefox WebExtension, inline translator powered by mutiple online dictionaries", "private": true, "scripts": {
chore
6.21.2
217237e7ee4beaaa768a7e29f5333b6582c41932
2018-05-14 22:03:01
CRIMX
refactor(dicts): refactor dict urban
false
diff --git a/src/app-config.ts b/src/app-config.ts index 7d7912cd8..350cd8f55 100644 --- a/src/app-config.ts +++ b/src/app-config.ts @@ -137,7 +137,7 @@ const allDicts = { chs: true }, options: { - resultnum: 2 + resultnum: 4 } }, vocabulary: { diff --git a/src/components/dictionaries/urban/View.tsx b/src/components/dictionaries/urban/View.tsx new file mode 100644 index 000000000..4e3da2d4b --- /dev/null +++ b/src/components/dictionaries/urban/View.tsx @@ -0,0 +1,53 @@ +import React from 'react' +import Speaker from '@/components/Speaker' +import { UrbanResult } from './engine' + +export default class DictUrban extends React.PureComponent<{ result: UrbanResult }> { + render () { + return ( + <ul className='dictUrban-List'> + {this.props.result.map(def => ( + <li key={def.meaning} className='dictUrban-Item'> + <h2 className='dictUrban-Title'> + {def.title} <Speaker src={def.pron} /> + </h2> + {def.meaning && <p className='dictUrban-Meaning' dangerouslySetInnerHTML={{ __html: def.meaning }} />} + {def.example && <p className='dictUrban-Example' dangerouslySetInnerHTML={{ __html: def.example }} />} + {def.gif && + <figure className='dictUrban-Gif'> + <img src={def.gif.src} alt={def.gif.attr} /> + <figcaption>{def.gif.attr}</figcaption> + </figure> + } + {def.tags && + <ul className='dictUrban-Tags'> + {def.tags.map(tag => ( + <a key={tag} className='dictUrban-TagItem' href={`https://www.urbandictionary.com/tags.php?tag=${tag}`} rel='nofollow'>#{tag} </a> + ))} + </ul> + } + <footer className='dictUrban-Footer'> + {def.contributor && <span className='dictUrban-Contributor'>{def.contributor}</span>} + {def.thumbsUp && + <span className='dictUrban-Thumbs'> + <svg className='dictUrban-IconThumbsUp' xmlns='http://www.w3.org/2000/svg' width='0.9em' height='0.9em' fill='#666' viewBox='0 0 561 561'> + <path d='M0 535.5h102v-306H0v306zM561 255c0-28.05-22.95-51-51-51H349.35l25.5-117.3v-7.65c0-10.2-5.1-20.4-10.2-28.05L336.6 25.5 168.3 193.8c-10.2 7.65-15.3 20.4-15.3 35.7v255c0 28.05 22.95 51 51 51h229.5c20.4 0 38.25-12.75 45.9-30.6l76.5-181.05c2.55-5.1 2.55-12.75 2.55-17.85v-51H561c0 2.55 0 0 0 0z' /> + </svg> + {def.thumbsUp} + </span> + } + {def.thumbsDown && + <span className='dictUrban-Thumbs'> + <svg className='dictUrban-IconThumbsDown' xmlns='http://www.w3.org/2000/svg' width='0.95em' height='0.95em' fill='#666' viewBox='0 0 561 561'> + <path d='M357 25.5H127.5c-20.4 0-38.25 12.75-45.9 30.6L5.1 237.15C2.55 242.25 0 247.35 0 255v51c0 28.05 22.95 51 51 51h160.65l-25.5 117.3v7.65c0 10.2 5.1 20.4 10.2 28.05l28.05 25.5 168.3-168.3c10.2-10.2 15.3-22.95 15.3-35.7v-255c0-28.05-22.95-51-51-51zm102 0v306h102v-306H459z' /> + </svg> + {def.thumbsDown} + </span> + } + </footer> + </li> + ))} + </ul> + ) + } +} diff --git a/src/components/dictionaries/urban/_style.scss b/src/components/dictionaries/urban/_style.scss new file mode 100644 index 000000000..b6dc7e885 --- /dev/null +++ b/src/components/dictionaries/urban/_style.scss @@ -0,0 +1,60 @@ +.dictUrban-Title { + font-size: 1.2em; +} + +.dictUrban-Item { + margin-bottom: 10px; +} + +.dictUrban-Meaning { + margin: 0 0 8px 0; +} + +.dictUrban-Example { + margin: 0 0 8px 0; + padding-left: 5px; + color: #444; + border-left: 1px solid #333; +} + +.dictUrban-Gif { + text-align: center; + + > img { + max-width: 80%; + max-height: 200px; + } +} + +.dictUrban-TagItem { + margin-right: 0.5em; + text-decoration: none; + color: #16a085; +} + +.dictUrban-Footer { + color: #666; +} + +.dictUrban-Contributor { + margin-right: 1em; +} + +.dictUrban-Thumbs { + margin-right: 5px; +} + +.dictUrban-IconThumbsUp { + width: 0.9em; + height: 0.9em; + fill: #666; + margin-right: 2px; +} + +.dictUrban-IconThumbsDown { + width: 0.95em; + height: 0.95em; + fill: #666; + vertical-align: middle; + margin-right: 2px; +} diff --git a/src/components/dictionaries/urban/engine.ts b/src/components/dictionaries/urban/engine.ts index f0c7d568f..1d3856d53 100644 --- a/src/components/dictionaries/urban/engine.ts +++ b/src/components/dictionaries/urban/engine.ts @@ -1,114 +1,131 @@ -import fetchDom from 'src/helpers/fetch-dom' - -/** - * Search text and give back result - * @param {string} text - Search text - * @param {object} config - app config - * @param {object} helpers - helper functions - * @returns {Promise} A promise with the result, which will be passed to view.vue as `result` props - */ -export default function search (text, config, {AUDIO}) { +import { fetchDirtyDOM } from '@/_helpers/fetch-dom' +import DOMPurify from 'dompurify' +import { handleNoResult } from '../helpers' +import { AppConfig } from '@/app-config' +import { DictSearchResult } from '@/typings/server' + +interface UrbanResultItem { + /** keyword */ + title: string + /** pronunciation */ + pron?: string + meaning?: string + example?: string + gif?: { + src: string + attr: string + } + tags?: string[] + /** who write this explanation */ + contributor?: string + /** numbers of thumbs up */ + thumbsUp?: string + /** numbers of thumbs down */ + thumbsDown?: string +} + +export type UrbanResult = UrbanResultItem[] + +type UrbanSearchResult = DictSearchResult<UrbanResult> + +export default function search ( + text: string, + config: AppConfig, +): Promise<UrbanSearchResult> { const options = config.dicts.all.urban.options - return fetchDom('http://www.urbandictionary.com/define.php?term=' + text) + return fetchDirtyDOM('http://www.urbandictionary.com/define.php?term=' + text) .then(doc => handleDom(doc, options)) - .then(result => { - if (config.autopron.en.dict === 'urban') { - setTimeout(() => { - result.some(({pron}) => { - if (pron) { - AUDIO.play(pron) - return true - } - }) - }, 0) - } - return result - }) } -/** -* @typedef {Object} UrbanResult -* @property {string} title - keyword -* @property {string} pron - pronunciation -* @property {string} meaning -* @property {string} example -* @property {string[]} tags -* @property {string} contributor - who write this explanation -* @property {string} thumbsUp - numbers of thumbs up -* @property {string} thumbsDwon - numbers of thumbs down -*/ - -/** - * @async - * @returns {Promise.<UrbanResult[]>} A promise with the result to send back - */ -function handleDom (doc, {resultnum}) { - let result = [] +function handleDom ( + doc: Document, + { resultnum }: { resultnum: number } +): UrbanSearchResult | Promise<UrbanSearchResult> { + let result: UrbanResult = [] + let audio: { us?: string } = {} + let defPanels = Array.from(doc.querySelectorAll('.def-panel')) if (defPanels.length <= 0) { - return Promise.reject('no result') + return handleNoResult() } - defPanels.every($panel => { - if (result.length >= resultnum) { return false } + for (let i = 0; i < defPanels.length && result.length < resultnum; i++) { + const $panel = defPanels[i] - let resultItem = {} + let resultItem: UrbanResultItem = { title: '' } let $title = $panel.querySelector('.word') if ($title) { - resultItem.title = $title.innerText + resultItem.title = $title.textContent || '' } - let $pron = $panel.querySelector('.play-sound') - if ($pron) { - resultItem.pron = JSON.parse($pron.dataset.urls)[0] + if (!resultItem.title) { + continue + } + + let $pron = $panel.querySelector('.play-sound') as HTMLElement + if ($pron && $pron.dataset.urls) { + try { + const pron = JSON.parse($pron.dataset.urls)[0] + if (pron) { + resultItem.pron = pron + audio.us = pron + } + } catch (error) {/* ignore */} } let $meaning = $panel.querySelector('.meaning') if ($meaning) { - resultItem.meaning = $meaning.innerText + resultItem.meaning = DOMPurify.sanitize($meaning.innerHTML) + .replace(/href="\//g, 'href="https://www.urbandictionary.com/') if (/There aren't any definitions for/i.test(resultItem.meaning)) { - return true + continue } } let $example = $panel.querySelector('.example') if ($example) { - resultItem.example = $example.innerText + resultItem.example = DOMPurify.sanitize($example.innerHTML) + .replace(/href="\//g, 'href="https://www.urbandictionary.com/') + } + + let $gif = $panel.querySelector('.gif > img') as HTMLImageElement + if ($gif) { + const $attr = $gif.nextElementSibling + resultItem.gif = { + src: $gif.src, + attr: $attr && $attr.textContent || '' + } } let $tags = Array.from($panel.querySelectorAll('.tags a')) if ($tags && $tags.length > 0) { - resultItem.tags = $tags.map($tag => $tag.innerText.slice(1)) + resultItem.tags = $tags.map($tag => ($tag.textContent || ' ').slice(1)) } let $contributor = $panel.querySelector('.contributor') if ($contributor) { - resultItem.contributor = $contributor.innerText + resultItem.contributor = $contributor.textContent || '' } let $thumbsUp = $panel.querySelector('.thumbs .up .count') if ($thumbsUp) { - resultItem.thumbsUp = $thumbsUp.innerText + resultItem.thumbsUp = $thumbsUp.textContent || '' } let $thumbsDown = $panel.querySelector('.thumbs .down .count') if ($thumbsDown) { - resultItem.thumbsDown = $thumbsDown.innerText + resultItem.thumbsDown = $thumbsDown.textContent || '' } - if (Object.keys(resultItem).length > 0) { - result.push(resultItem) - } - - return true - }) + result.push(resultItem) + } if (result.length > 0) { - return result + return { result, audio } } else { - return Promise.reject('no result') + return handleNoResult() } } diff --git a/src/components/dictionaries/urban/view.vue b/src/components/dictionaries/urban/view.vue deleted file mode 100644 index 0b9c42a30..000000000 --- a/src/components/dictionaries/urban/view.vue +++ /dev/null @@ -1,95 +0,0 @@ -<template> -<section> - <div class="urban-result" v-if="result"> - <div class="urban-item" v-for="def in result"> - <div class="urban-title"> - <strong>{{ def.title }}</strong> - <speaker v-if="def.pron" :src="def.pron"></speaker> - </div> - <div class="meaning" v-if="def.meaning">{{ def.meaning }}</div> - <div class="example" v-if="def.example">{{ def.example }}</div> - <div class="tags" v-if="def.tags"> - <a class="tags-item" v-for="tag in def.tags" :href="`http://www.urbandictionary.com/tags.php?tag=${tag}`">#{{ tag }}</a> - </div> - <footer class="footer"> - <span class="contributor">{{ def.contributor }}</span> - <span class="thumbs" v-if="def.thumbsUp"> - <svg class="icon-thumbs-up" xmlns="http://www.w3.org/2000/svg" width="0.9em" height="0.9em" fill="#666" viewBox="0 0 561 561"> - <path d="M0 535.5h102v-306H0v306zM561 255c0-28.05-22.95-51-51-51H349.35l25.5-117.3v-7.65c0-10.2-5.1-20.4-10.2-28.05L336.6 25.5 168.3 193.8c-10.2 7.65-15.3 20.4-15.3 35.7v255c0 28.05 22.95 51 51 51h229.5c20.4 0 38.25-12.75 45.9-30.6l76.5-181.05c2.55-5.1 2.55-12.75 2.55-17.85v-51H561c0 2.55 0 0 0 0z"/> - </svg> - {{ def.thumbsUp }} - </span> - <span class="thumbs" v-if="def.thumbsDown"> - <svg class="icon-thumbs-down" xmlns="http://www.w3.org/2000/svg" width="0.95em" height="0.95em" fill="#666" viewBox="0 0 561 561"> - <path d="M357 25.5H127.5c-20.4 0-38.25 12.75-45.9 30.6L5.1 237.15C2.55 242.25 0 247.35 0 255v51c0 28.05 22.95 51 51 51h160.65l-25.5 117.3v7.65c0 10.2 5.1 20.4 10.2 28.05l28.05 25.5 168.3-168.3c10.2-10.2 15.3-22.95 15.3-35.7v-255c0-28.05-22.95-51-51-51zm102 0v306h102v-306H459z"/> - </svg> - {{ def.thumbsDown }} - </span> - </footer> - </div> - </div> -</section> -</template> - -<script> -import Speaker from 'src/components/Speaker' - -export default { - name: 'Urban', - props: ['result'], - components: { - Speaker - } -} -</script> - -<style lang="scss" scoped> -.urban-result { - padding: 10px; -} - -.urban-item { - margin-bottom: 10px; -} - -.meaning { - margin-bottom: 5px; -} - -.example { - margin-bottom: 5px; - padding-left: 5px; - border-left: 2px solid #666; -} - -.tags-item { - margin-right: 0.5em; - text-decoration: none; - color: #16a085; -} - -.footer { - color: #666; -} - -.contributor { - margin-right: 1em; -} - -.thumbs { - margin-right: 5px; -} - -.icon-thumbs-up { - width: 0.9em; - height: 0.9em; - fill: #666; -} - -.icon-thumbs-down { - width: 0.95em; - height: 0.95em; - fill: #666; - vertical-align: middle; -} -</style> diff --git a/test/specs/components/dictionaries/urban/engine.spec.ts b/test/specs/components/dictionaries/urban/engine.spec.ts new file mode 100644 index 000000000..66e4d800e --- /dev/null +++ b/test/specs/components/dictionaries/urban/engine.spec.ts @@ -0,0 +1,35 @@ +import search from '@/components/dictionaries/urban/engine' +import { appConfigFactory } from '@/app-config' +import fs from 'fs' +import path from 'path' + +describe('Dict/Urban/engine', () => { + beforeAll(() => { + const response = fs.readFileSync(path.join(__dirname, 'response/test.html'), 'utf8') + window.fetch = jest.fn((url: string) => Promise.resolve({ + text: () => response + })) + }) + + it('should parse result correctly', () => { + return search('any', appConfigFactory()) + .then(searchResult => { + expect(searchResult.audio && typeof searchResult.audio.us).toBe('string') + expect(searchResult.result).toHaveLength(4) + const item = searchResult.result[0] + expect(typeof item.title).toBe('string') + expect(typeof item.pron).toBe('string') + expect(typeof item.meaning).toBe('string') + expect(typeof item.example).toBe('string') + expect(item.gif).toBeUndefined() + expect(Array.isArray(item.tags)).toBeTruthy() + expect((item.tags as any).length).toBeGreaterThan(0) + expect(typeof item.contributor).toBe('string') + expect(typeof item.thumbsUp).toBe('string') + expect(typeof item.thumbsDown).toBe('string') + + expect(typeof (searchResult.result[1].gif as any).src).toBe('string') + expect(typeof (searchResult.result[1].gif as any).attr).toBe('string') + }) + }) +}) diff --git a/test/specs/components/dictionaries/urban/response/test.html b/test/specs/components/dictionaries/urban/response/test.html new file mode 100644 index 000000000..f5a0800f5 --- /dev/null +++ b/test/specs/components/dictionaries/urban/response/test.html @@ -0,0 +1,305 @@ + +<!DOCTYPE html> +<html lang="en-US" prefix="og: http://ogp.me/ns#"><!-- + _|_ _ _ _|. __|_. _ _ _ _ + |_|| |_)(_|| | (_||(_ | |(_)| |(_||\/ + / + + Need help? http://help.urbandictionary.com/ +--> +<head><meta charset="UTF-8"><meta content="width=device-width, initial-scale=1.0, user-scalable = no" name="viewport"><link href="//api.urbandictionary.com" rel="dns-prefetch"><link href="//cdn.jsdelivr.net" rel="dns-prefetch"><link href="//edge.quantserve.com" rel="dns-prefetch"><link href="//fonts.googleapis.com" rel="dns-prefetch"><link href="//fonts.gstatic.com" rel="dns-prefetch"><link href="//googleads.g.doubleclick.net" rel="dns-prefetch"><link href="//pubads.g.doubleclick.net" rel="dns-prefetch"><link href="//pagead2.googlesyndication.com" rel="dns-prefetch"><link href="//partner.googleadservices.com" rel="dns-prefetch"><link href="//pixel.quantserve.com" rel="dns-prefetch"><link href="//platform.twitter.com" rel="dns-prefetch"><link href="//stats.g.doubleclick.net" rel="dns-prefetch"><link href="//tpc.googlesyndication.com" rel="dns-prefetch"><link href="//www.facebook.com" rel="dns-prefetch"><link href="//www.google-analytics.com" rel="dns-prefetch"><link href="//www.googletagservices.com" rel="dns-prefetch"><link href="//www.gstatic.com" rel="dns-prefetch"><meta content="UrbanDict" name="apple-mobile-web-app-title"><meta content="yes" name="apple-mobile-web-app-capable"><link href="https://d2gatte9o95jao.cloudfront.net/assets/apple-touch-startup-image-320x460-51bb2570affdf5bdd11a2ae551ca2b2cac249e5e7392ba81eb96272e8c46a315.png" media="(device-width: 320px)" rel="apple-touch-startup-image"><link href="https://d2gatte9o95jao.cloudfront.net/assets/apple-touch-startup-image-640x920-fadb0dd0cc8db62e46d7d0b5ac3b8a5bd0fea0873641e90f123a9d169d9892f2.png" media="(device-width: 320px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image"><link href="https://d2gatte9o95jao.cloudfront.net/assets/apple-touch-icon-1734beeaa059fbc5587bddb3001a0963670c6de8767afb6c67d88d856b0c0dad.png" rel="apple-touch-icon"><link href="https://www.urbandictionary.com/define.php?term=L.O.V.E." rel="canonical"><link href="https://www.urbandictionary.com/define.php?term=L.O.V.E.&amp;amp=true" rel="amphtml"><title>Urban Dictionary: L.O.V.E.</title><script type="text/javascript">//<![CDATA[ +window.WebFontConfig={google:{families:['Source Sans Pro:400,700','Lora:700']}}; + +(function(){function aa(a,b,c){return a.call.apply(a.bind,arguments)}function ba(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function p(a,b,c){p=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?aa:ba;return p.apply(null,arguments)}var q=Date.now||function(){return+new Date};function ca(a,b){this.a=a;this.m=b||a;this.c=this.m.document}var da=!!window.FontFace;function t(a,b,c,d){b=a.c.createElement(b);if(c)for(var e in c)c.hasOwnProperty(e)&&("style"==e?b.style.cssText=c[e]:b.setAttribute(e,c[e]));d&&b.appendChild(a.c.createTextNode(d));return b}function u(a,b,c){a=a.c.getElementsByTagName(b)[0];a||(a=document.documentElement);a.insertBefore(c,a.lastChild)}function v(a){a.parentNode&&a.parentNode.removeChild(a)} +function w(a,b,c){b=b||[];c=c||[];for(var d=a.className.split(/\s+/),e=0;e<b.length;e+=1){for(var f=!1,g=0;g<d.length;g+=1)if(b[e]===d[g]){f=!0;break}f||d.push(b[e])}b=[];for(e=0;e<d.length;e+=1){f=!1;for(g=0;g<c.length;g+=1)if(d[e]===c[g]){f=!0;break}f||b.push(d[e])}a.className=b.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function y(a,b){for(var c=a.className.split(/\s+/),d=0,e=c.length;d<e;d++)if(c[d]==b)return!0;return!1} +function z(a){if("string"===typeof a.f)return a.f;var b=a.m.location.protocol;"about:"==b&&(b=a.a.location.protocol);return"https:"==b?"https:":"http:"}function ea(a){return a.m.location.hostname||a.a.location.hostname} +function A(a,b,c){function d(){k&&e&&f&&(k(g),k=null)}b=t(a,"link",{rel:"stylesheet",href:b,media:"all"});var e=!1,f=!0,g=null,k=c||null;da?(b.onload=function(){e=!0;d()},b.onerror=function(){e=!0;g=Error("Stylesheet failed to load");d()}):setTimeout(function(){e=!0;d()},0);u(a,"head",b)} +function B(a,b,c,d){var e=a.c.getElementsByTagName("head")[0];if(e){var f=t(a,"script",{src:b}),g=!1;f.onload=f.onreadystatechange=function(){g||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(g=!0,c&&c(null),f.onload=f.onreadystatechange=null,"HEAD"==f.parentNode.tagName&&e.removeChild(f))};e.appendChild(f);setTimeout(function(){g||(g=!0,c&&c(Error("Script load timeout")))},d||5E3);return f}return null};function C(){this.a=0;this.c=null}function D(a){a.a++;return function(){a.a--;E(a)}}function F(a,b){a.c=b;E(a)}function E(a){0==a.a&&a.c&&(a.c(),a.c=null)};function G(a){this.a=a||"-"}G.prototype.c=function(a){for(var b=[],c=0;c<arguments.length;c++)b.push(arguments[c].replace(/[\W_]+/g,"").toLowerCase());return b.join(this.a)};function H(a,b){this.c=a;this.f=4;this.a="n";var c=(b||"n4").match(/^([nio])([1-9])$/i);c&&(this.a=c[1],this.f=parseInt(c[2],10))}function fa(a){return I(a)+" "+(a.f+"00")+" 300px "+J(a.c)}function J(a){var b=[];a=a.split(/,\s*/);for(var c=0;c<a.length;c++){var d=a[c].replace(/['"]/g,"");-1!=d.indexOf(" ")||/^\d/.test(d)?b.push("'"+d+"'"):b.push(d)}return b.join(",")}function K(a){return a.a+a.f}function I(a){var b="normal";"o"===a.a?b="oblique":"i"===a.a&&(b="italic");return b} +function ga(a){var b=4,c="n",d=null;a&&((d=a.match(/(normal|oblique|italic)/i))&&d[1]&&(c=d[1].substr(0,1).toLowerCase()),(d=a.match(/([1-9]00|normal|bold)/i))&&d[1]&&(/bold/i.test(d[1])?b=7:/[1-9]00/.test(d[1])&&(b=parseInt(d[1].substr(0,1),10))));return c+b};function ha(a,b){this.c=a;this.f=a.m.document.documentElement;this.h=b;this.a=new G("-");this.j=!1!==b.events;this.g=!1!==b.classes}function ia(a){a.g&&w(a.f,[a.a.c("wf","loading")]);L(a,"loading")}function M(a){if(a.g){var b=y(a.f,a.a.c("wf","active")),c=[],d=[a.a.c("wf","loading")];b||c.push(a.a.c("wf","inactive"));w(a.f,c,d)}L(a,"inactive")}function L(a,b,c){if(a.j&&a.h[b])if(c)a.h[b](c.c,K(c));else a.h[b]()};function ja(){this.c={}}function ka(a,b,c){var d=[],e;for(e in b)if(b.hasOwnProperty(e)){var f=a.c[e];f&&d.push(f(b[e],c))}return d};function N(a,b){this.c=a;this.f=b;this.a=t(this.c,"span",{"aria-hidden":"true"},this.f)}function O(a){u(a.c,"body",a.a)}function P(a){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+J(a.c)+";"+("font-style:"+I(a)+";font-weight:"+(a.f+"00")+";")};function Q(a,b,c,d,e,f){this.g=a;this.j=b;this.a=d;this.c=c;this.f=e||3E3;this.h=f||void 0}Q.prototype.start=function(){var a=this.c.m.document,b=this,c=q(),d=new Promise(function(d,e){function k(){q()-c>=b.f?e():a.fonts.load(fa(b.a),b.h).then(function(a){1<=a.length?d():setTimeout(k,25)},function(){e()})}k()}),e=new Promise(function(a,d){setTimeout(d,b.f)});Promise.race([e,d]).then(function(){b.g(b.a)},function(){b.j(b.a)})};function R(a,b,c,d,e,f,g){this.v=a;this.B=b;this.c=c;this.a=d;this.s=g||"BESbswy";this.f={};this.w=e||3E3;this.u=f||null;this.o=this.j=this.h=this.g=null;this.g=new N(this.c,this.s);this.h=new N(this.c,this.s);this.j=new N(this.c,this.s);this.o=new N(this.c,this.s);a=new H(this.a.c+",serif",K(this.a));a=P(a);this.g.a.style.cssText=a;a=new H(this.a.c+",sans-serif",K(this.a));a=P(a);this.h.a.style.cssText=a;a=new H("serif",K(this.a));a=P(a);this.j.a.style.cssText=a;a=new H("sans-serif",K(this.a));a= +P(a);this.o.a.style.cssText=a;O(this.g);O(this.h);O(this.j);O(this.o)}var S={D:"serif",C:"sans-serif"},T=null;function U(){if(null===T){var a=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);T=!!a&&(536>parseInt(a[1],10)||536===parseInt(a[1],10)&&11>=parseInt(a[2],10))}return T}R.prototype.start=function(){this.f.serif=this.j.a.offsetWidth;this.f["sans-serif"]=this.o.a.offsetWidth;this.A=q();la(this)}; +function ma(a,b,c){for(var d in S)if(S.hasOwnProperty(d)&&b===a.f[S[d]]&&c===a.f[S[d]])return!0;return!1}function la(a){var b=a.g.a.offsetWidth,c=a.h.a.offsetWidth,d;(d=b===a.f.serif&&c===a.f["sans-serif"])||(d=U()&&ma(a,b,c));d?q()-a.A>=a.w?U()&&ma(a,b,c)&&(null===a.u||a.u.hasOwnProperty(a.a.c))?V(a,a.v):V(a,a.B):na(a):V(a,a.v)}function na(a){setTimeout(p(function(){la(this)},a),50)}function V(a,b){setTimeout(p(function(){v(this.g.a);v(this.h.a);v(this.j.a);v(this.o.a);b(this.a)},a),0)};function W(a,b,c){this.c=a;this.a=b;this.f=0;this.o=this.j=!1;this.s=c}var X=null;W.prototype.g=function(a){var b=this.a;b.g&&w(b.f,[b.a.c("wf",a.c,K(a).toString(),"active")],[b.a.c("wf",a.c,K(a).toString(),"loading"),b.a.c("wf",a.c,K(a).toString(),"inactive")]);L(b,"fontactive",a);this.o=!0;oa(this)}; +W.prototype.h=function(a){var b=this.a;if(b.g){var c=y(b.f,b.a.c("wf",a.c,K(a).toString(),"active")),d=[],e=[b.a.c("wf",a.c,K(a).toString(),"loading")];c||d.push(b.a.c("wf",a.c,K(a).toString(),"inactive"));w(b.f,d,e)}L(b,"fontinactive",a);oa(this)};function oa(a){0==--a.f&&a.j&&(a.o?(a=a.a,a.g&&w(a.f,[a.a.c("wf","active")],[a.a.c("wf","loading"),a.a.c("wf","inactive")]),L(a,"active")):M(a.a))};function pa(a){this.j=a;this.a=new ja;this.h=0;this.f=this.g=!0}pa.prototype.load=function(a){this.c=new ca(this.j,a.context||this.j);this.g=!1!==a.events;this.f=!1!==a.classes;qa(this,new ha(this.c,a),a)}; +function ra(a,b,c,d,e){var f=0==--a.h;(a.f||a.g)&&setTimeout(function(){var a=e||null,k=d||null||{};if(0===c.length&&f)M(b.a);else{b.f+=c.length;f&&(b.j=f);var h,m=[];for(h=0;h<c.length;h++){var l=c[h],n=k[l.c],r=b.a,x=l;r.g&&w(r.f,[r.a.c("wf",x.c,K(x).toString(),"loading")]);L(r,"fontloading",x);r=null;null===X&&(X=window.FontFace?(x=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent))?42<parseInt(x[1],10):!0:!1);X?r=new Q(p(b.g,b),p(b.h,b),b.c,l,b.s,n):r=new R(p(b.g,b),p(b.h,b),b.c,l,b.s,a,n);m.push(r)}for(h=0;h<m.length;h++)m[h].start()}},0)}function qa(a,b,c){var d=[],e=c.timeout;ia(b);var d=ka(a.a,c,a.c),f=new W(a.c,b,e);a.h=d.length;b=0;for(c=d.length;b<c;b++)d[b].load(function(b,d,c){ra(a,f,b,d,c)})};function sa(a,b){this.c=a;this.a=b}function ta(a,b,c){var d=z(a.c);a=(a.a.api||"fast.fonts.net/jsapi").replace(/^.*http(s?):(\/\/)?/,"");return d+"//"+a+"/"+b+".js"+(c?"?v="+c:"")} +sa.prototype.load=function(a){function b(){if(f["__mti_fntLst"+d]){var c=f["__mti_fntLst"+d](),e=[],h;if(c)for(var m=0;m<c.length;m++){var l=c[m].fontfamily;void 0!=c[m].fontStyle&&void 0!=c[m].fontWeight?(h=c[m].fontStyle+c[m].fontWeight,e.push(new H(l,h))):e.push(new H(l))}a(e)}else setTimeout(function(){b()},50)}var c=this,d=c.a.projectId,e=c.a.version;if(d){var f=c.c.m;B(this.c,ta(c,d,e),function(e){e?a([]):(f["__MonotypeConfiguration__"+d]=function(){return c.a},b())}).id="__MonotypeAPIScript__"+d}else a([])};function ua(a,b){this.c=a;this.a=b}ua.prototype.load=function(a){var b,c,d=this.a.urls||[],e=this.a.families||[],f=this.a.testStrings||{},g=new C;b=0;for(c=d.length;b<c;b++)A(this.c,d[b],D(g));var k=[];b=0;for(c=e.length;b<c;b++)if(d=e[b].split(":"),d[1])for(var h=d[1].split(","),m=0;m<h.length;m+=1)k.push(new H(d[0],h[m]));else k.push(new H(d[0]));F(g,function(){a(k,f)})};function va(a,b,c){a?this.c=a:this.c=b+wa;this.a=[];this.f=[];this.g=c||""}var wa="//fonts.googleapis.com/css";function xa(a,b){for(var c=b.length,d=0;d<c;d++){var e=b[d].split(":");3==e.length&&a.f.push(e.pop());var f="";2==e.length&&""!=e[1]&&(f=":");a.a.push(e.join(f))}} +function ya(a){if(0==a.a.length)throw Error("No fonts to load!");if(-1!=a.c.indexOf("kit="))return a.c;for(var b=a.a.length,c=[],d=0;d<b;d++)c.push(a.a[d].replace(/ /g,"+"));b=a.c+"?family="+c.join("%7C");0<a.f.length&&(b+="&subset="+a.f.join(","));0<a.g.length&&(b+="&text="+encodeURIComponent(a.g));return b};function za(a){this.f=a;this.a=[];this.c={}} +var Aa={latin:"BESbswy","latin-ext":"\u00e7\u00f6\u00fc\u011f\u015f",cyrillic:"\u0439\u044f\u0416",greek:"\u03b1\u03b2\u03a3",khmer:"\u1780\u1781\u1782",Hanuman:"\u1780\u1781\u1782"},Ba={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},Ca={i:"i",italic:"i",n:"n",normal:"n"}, +Da=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/; +function Ea(a){for(var b=a.f.length,c=0;c<b;c++){var d=a.f[c].split(":"),e=d[0].replace(/\+/g," "),f=["n4"];if(2<=d.length){var g;var k=d[1];g=[];if(k)for(var k=k.split(","),h=k.length,m=0;m<h;m++){var l;l=k[m];if(l.match(/^[\w-]+$/)){var n=Da.exec(l.toLowerCase());if(null==n)l="";else{l=n[2];l=null==l||""==l?"n":Ca[l];n=n[1];if(null==n||""==n)n="4";else var r=Ba[n],n=r?r:isNaN(n)?"4":n.substr(0,1);l=[l,n].join("")}}else l="";l&&g.push(l)}0<g.length&&(f=g);3==d.length&&(d=d[2],g=[],d=d?d.split(","):g,0<d.length&&(d=Aa[d[0]])&&(a.c[e]=d))}a.c[e]||(d=Aa[e])&&(a.c[e]=d);for(d=0;d<f.length;d+=1)a.a.push(new H(e,f[d]))}};function Fa(a,b){this.c=a;this.a=b}var Ga={Arimo:!0,Cousine:!0,Tinos:!0};Fa.prototype.load=function(a){var b=new C,c=this.c,d=new va(this.a.api,z(c),this.a.text),e=this.a.families;xa(d,e);var f=new za(e);Ea(f);A(c,ya(d),D(b));F(b,function(){a(f.a,f.c,Ga)})};function Ha(a,b){this.c=a;this.a=b}Ha.prototype.load=function(a){var b=this.a.id,c=this.c.m;b?B(this.c,(this.a.api||"https://use.typekit.net")+"/"+b+".js",function(b){if(b)a([]);else if(c.Typekit&&c.Typekit.config&&c.Typekit.config.fn){b=c.Typekit.config.fn;for(var e=[],f=0;f<b.length;f+=2)for(var g=b[f],k=b[f+1],h=0;h<k.length;h++)e.push(new H(g,k[h]));try{c.Typekit.load({events:!1,classes:!1,async:!0})}catch(m){}a(e)}},2E3):a([])};function Ia(a,b){this.c=a;this.f=b;this.a=[]}Ia.prototype.load=function(a){var b=this.f.id,c=this.c.m,d=this;b?(c.__webfontfontdeckmodule__||(c.__webfontfontdeckmodule__={}),c.__webfontfontdeckmodule__[b]=function(b,c){for(var g=0,k=c.fonts.length;g<k;++g){var h=c.fonts[g];d.a.push(new H(h.name,ga("font-weight:"+h.weight+";font-style:"+h.style)))}a(d.a)},B(this.c,z(this.c)+(this.f.api||"//f.fontdeck.com/s/css/js/")+ea(this.c)+"/"+b+".js",function(b){b&&a([])})):a([])};var Y=new pa(window);Y.a.c.custom=function(a,b){return new ua(b,a)};Y.a.c.fontdeck=function(a,b){return new Ia(b,a)};Y.a.c.monotype=function(a,b){return new sa(b,a)};Y.a.c.typekit=function(a,b){return new Ha(b,a)};Y.a.c.google=function(a,b){return new Fa(b,a)};var Z={load:p(Y.load,Y)};"function"===typeof define&&define.amd?define(function(){return Z}):"undefined"!==typeof module&&module.exports?module.exports=Z:(window.WebFont=Z,window.WebFontConfig&&Y.load(window.WebFontConfig));}()); +//]]></script><link href="https://d2gatte9o95jao.cloudfront.net/assets/application-885e6397718edbe5f2769960806d690b02bb5a16b983eb82ac298c15fefb3414.css" rel="stylesheet" type="text/css"><script data-apikey="2de5893a4bae38e73c259607e6935cbb" type="text/javascript">!function(a,b){function c(a,b){try{if("function"!=typeof a)return a;if(!a.bugsnag){var c=e();a.bugsnag=function(d){if(b&&b.eventHandler&&(u=d),v=c,!y){var e=a.apply(this,arguments);return v=null,e}try{return a.apply(this,arguments)}catch(f){throw l("autoNotify",!0)&&(x.notifyException(f,null,null,"error"),s()),f}finally{v=null}},a.bugsnag.bugsnag=a.bugsnag}return a.bugsnag}catch(d){return a}}function d(){C=!1}function e(){var a=document.currentScript||v;if(!a&&C){var b=document.scripts||document.getElementsByTagName("script");a=b[b.length-1]}return a}function f(a){var b=e();b&&(a.script={src:b.src,content:l("inlineScript",!0)?b.innerHTML:""})}function g(b){var c=l("disableLog"),d=a.console;void 0===d||void 0===d.log||c||d.log("[Bugsnag] "+b)}function h(b,c,d){var e=l("maxDepth",B);if(d>=e)return encodeURIComponent(c)+"=[RECURSIVE]";d=d+1||1;try{if(a.Node&&b instanceof a.Node)return encodeURIComponent(c)+"="+encodeURIComponent(r(b));var f=[];for(var g in b)if(b.hasOwnProperty(g)&&null!=g&&null!=b[g]){var i=c?c+"["+g+"]":g,j=b[g];f.push("object"==typeof j?h(j,i,d):encodeURIComponent(i)+"="+encodeURIComponent(j))}return f.join("&")}catch(k){return encodeURIComponent(c)+"="+encodeURIComponent(""+k)}}function i(a,b,c){if(null==b)return a;if(c>=l("maxDepth",B))return"[RECURSIVE]";a=a||{};for(var d in b)if(b.hasOwnProperty(d))try{a[d]=b[d].constructor===Object?i(a[d],b[d],c+1||1):b[d]}catch(e){a[d]=b[d]}return a}function j(a,b){a+="?"+h(b)+"&ct=img&cb="+(new Date).getTime();var c=l("notifyHandler");if("xhr"===c){var d=new XMLHttpRequest;d.open("GET",a,!0),d.send()}else{var e=new Image;e.src=a}}function k(a){var b={},c=/^data\-([\w\-]+)$/;if(a)for(var d=a.attributes,e=0;e<d.length;e++){var f=d[e];if(c.test(f.nodeName)){var g=f.nodeName.match(c)[1];b[g]=f.value||f.nodeValue}}return b}function l(a,b){D=D||k(K);var c=void 0!==x[a]?x[a]:D[a.toLowerCase()];return"false"===c&&(c=!1),void 0!==c?c:b}function m(a){return a&&a.match(E)?!0:(g("Invalid API key '"+a+"'"),!1)}function n(b,c){var d=l("apiKey");if(m(d)&&A){A-=1;var e=l("releaseStage","production"),f=l("notifyReleaseStages");if(f){for(var h=!1,k=0;k<f.length;k++)if(e===f[k]){h=!0;break}if(!h)return}var n=[b.name,b.message,b.stacktrace].join("|");if(n!==w){w=n,u&&(c=c||{},c["Last Event"]=q(u));var o={notifierVersion:I,apiKey:d,projectRoot:l("projectRoot")||a.location.protocol+"//"+a.location.host,context:l("context")||a.location.pathname,userId:l("userId"),user:l("user"),metaData:i(i({},l("metaData")),c),releaseStage:e,appVersion:l("appVersion"),url:a.location.href,userAgent:navigator.userAgent,language:navigator.language||navigator.userLanguage,severity:b.severity,name:b.name,message:b.message,stacktrace:b.stacktrace,file:b.file,lineNumber:b.lineNumber,columnNumber:b.columnNumber,payloadVersion:"2"},p=x.beforeNotify;if("function"==typeof p){var r=p(o,o.metaData);if(r===!1)return}return 0===o.lineNumber&&/Script error\.?/.test(o.message)?g("Ignoring cross-domain script error. See https://bugsnag.com/docs/notifiers/js/cors"):void j(l("endpoint")||H,o)}}}function o(){var a,b,c=10,d="[anonymous]";try{throw new Error("")}catch(e){a="<generated>\n",b=p(e)}if(!b){a="<generated-ie>\n";var f=[];try{for(var h=arguments.callee.caller.caller;h&&f.length<c;){var i=F.test(h.toString())?RegExp.$1||d:d;f.push(i),h=h.caller}}catch(j){g(j)}b=f.join("\n")}return a+b}function p(a){return a.stack||a.backtrace||a.stacktrace}function q(a){var b={millisecondsAgo:new Date-a.timeStamp,type:a.type,which:a.which,target:r(a.target)};return b}function r(a){if(a){var b=a.attributes;if(b){for(var c="<"+a.nodeName.toLowerCase(),d=0;d<b.length;d++)b[d].value&&"null"!==b[d].value.toString()&&(c+=" "+b[d].name+'="'+b[d].value+'"');return c+">"}return a.nodeName}}function s(){z+=1,a.setTimeout(function(){z-=1})}function t(a,b,c){var d=a[b],e=c(d);a[b]=e}var u,v,w,x={},y=!0,z=0,A=10,B=5;x.noConflict=function(){return a.Bugsnag=b,"undefined"==typeof b&&delete a.Bugsnag,x},x.refresh=function(){A=10},x.notifyException=function(a,b,c,d){a&&(b&&"string"!=typeof b&&(c=b,b=void 0),c||(c={}),f(c),n({name:b||a.name,message:a.message||a.description,stacktrace:p(a)||o(),file:a.fileName||a.sourceURL,lineNumber:a.lineNumber||a.line,columnNumber:a.columnNumber?a.columnNumber+1:void 0,severity:d||"warning"},c))},x.notify=function(b,c,d,e){n({name:b,message:c,stacktrace:o(),file:a.location.toString(),lineNumber:1,severity:e||"warning"},d)};var C="complete"!==document.readyState;document.addEventListener?(document.addEventListener("DOMContentLoaded",d,!0),a.addEventListener("load",d,!0)):a.attachEvent("onload",d);var D,E=/^[0-9a-f]{32}$/i,F=/function\s*([\w\-$]+)?\s*\(/i,G="https://notify.bugsnag.com/",H=G+"js",I="2.5.0",J=document.getElementsByTagName("script"),K=J[J.length-1];if(a.atob){if(a.ErrorEvent)try{0===new a.ErrorEvent("test").colno&&(y=!1)}catch(L){}}else y=!1;if(l("autoNotify",!0)){t(a,"onerror",function(b){return function(c,d,e,g,h){var i=l("autoNotify",!0),j={};!g&&a.event&&(g=a.event.errorCharacter),f(j),v=null,i&&!z&&n({name:h&&h.name||"window.onerror",message:c,file:d,lineNumber:e,columnNumber:g,stacktrace:h&&p(h)||o(),severity:"error"},j),b&&b(c,d,e,g,h)}});var M=function(a){return function(b,d){if("function"==typeof b){b=c(b);var e=Array.prototype.slice.call(arguments,2);return a(function(){b.apply(this,e)},d)}return a(b,d)}};t(a,"setTimeout",M),t(a,"setInterval",M),a.requestAnimationFrame&&t(a,"requestAnimationFrame",function(a){return function(b){return a(c(b))}}),a.setImmediate&&t(a,"setImmediate",function(a){return function(){var b=Array.prototype.slice.call(arguments);return b[0]=c(b[0]),a.apply(this,b)}}),"EventTarget Window Node ApplicationCache AudioTrackList ChannelMergerNode CryptoOperation EventSource FileReader HTMLUnknownElement IDBDatabase IDBRequest IDBTransaction KeyOperation MediaController MessagePort ModalWindow Notification SVGElementInstance Screen TextTrack TextTrackCue TextTrackList WebSocket WebSocketWorker Worker XMLHttpRequest XMLHttpRequestEventTarget XMLHttpRequestUpload".replace(/\w+/g,function(b){var d=a[b]&&a[b].prototype;d&&d.hasOwnProperty&&d.hasOwnProperty("addEventListener")&&(t(d,"addEventListener",function(a){return function(b,d,e,f){try{d&&d.handleEvent&&(d.handleEvent=c(d.handleEvent,{eventHandler:!0}))}catch(h){g(h)}return a.call(this,b,c(d,{eventHandler:!0}),e,f)}}),t(d,"removeEventListener",function(a){return function(b,d,e,f){return a.call(this,b,d,e,f),a.call(this,b,c(d),e,f)}}))})}a.Bugsnag=x,"function"==typeof define&&define.amd?define([],function(){return x}):"object"==typeof module&&"object"==typeof module.exports&&(module.exports=x)}(window,window.Bugsnag); +</script><script type="text/javascript">//<![CDATA[ +/*! LAB.js (LABjs :: Loading And Blocking JavaScript) + v2.0.3 (c) Kyle Simpson + MIT License +*/ +(function(o){var K=o.$LAB,y="UseLocalXHR",z="AlwaysPreserveOrder",u="AllowDuplicates",A="CacheBust",B="BasePath",C=/^[^?#]*\//.exec(location.href)[0],D=/^\w+\:\/\/\/?[^\/]+/.exec(C)[0],i=document.head||document.getElementsByTagName("head"),L=(o.opera&&Object.prototype.toString.call(o.opera)=="[object Opera]")||("MozAppearance"in document.documentElement.style),q=document.createElement("script"),E=typeof q.preload=="boolean",r=E||(q.readyState&&q.readyState=="uninitialized"),F=!r&&q.async===true,M=!r&&!F&&!L;function G(a){return Object.prototype.toString.call(a)=="[object Function]"}function H(a){return Object.prototype.toString.call(a)=="[object Array]"}function N(a,c){var b=/^\w+\:\/\//;if(/^\/\/\/?/.test(a)){a=location.protocol+a}else if(!b.test(a)&&a.charAt(0)!="/"){a=(c||"")+a}return b.test(a)?a:((a.charAt(0)=="/"?D:C)+a)}function s(a,c){for(var b in a){if(a.hasOwnProperty(b)){c[b]=a[b]}}return c}function O(a){var c=false;for(var b=0;b<a.scripts.length;b++){if(a.scripts[b].ready&&a.scripts[b].exec_trigger){c=true;a.scripts[b].exec_trigger();a.scripts[b].exec_trigger=null}}return c}function t(a,c,b,d){a.onload=a.onreadystatechange=function(){if((a.readyState&&a.readyState!="complete"&&a.readyState!="loaded")||c[b])return;a.onload=a.onreadystatechange=null;d()}}function I(a){a.ready=a.finished=true;for(var c=0;c<a.finished_listeners.length;c++){a.finished_listeners[c]()}a.ready_listeners=[];a.finished_listeners=[]}function P(d,f,e,g,h){setTimeout(function(){var a,c=f.real_src,b;if("item"in i){if(!i[0]){setTimeout(arguments.callee,25);return}i=i[0]}a=document.createElement("script");if(f.type)a.type=f.type;if(f.charset)a.charset=f.charset;if(h){if(r){e.elem=a;if(E){a.preload=true;a.onpreload=g}else{a.onreadystatechange=function(){if(a.readyState=="loaded")g()}}a.src=c}else if(h&&c.indexOf(D)==0&&d[y]){b=new XMLHttpRequest();b.onreadystatechange=function(){if(b.readyState==4){b.onreadystatechange=function(){};e.text=b.responseText+"\n//@ sourceURL="+c;g()}};b.open("GET",c);b.send()}else{a.type="text/cache-script";t(a,e,"ready",function(){i.removeChild(a);g()});a.src=c;i.insertBefore(a,i.firstChild)}}else if(F){a.async=false;t(a,e,"finished",g);a.src=c;i.insertBefore(a,i.firstChild)}else{t(a,e,"finished",g);a.src=c;i.insertBefore(a,i.firstChild)}},0)}function J(){var l={},Q=r||M,n=[],p={},m;l[y]=true;l[z]=false;l[u]=false;l[A]=false;l[B]="";function R(a,c,b){var d;function f(){if(d!=null){d=null;I(b)}}if(p[c.src].finished)return;if(!a[u])p[c.src].finished=true;d=b.elem||document.createElement("script");if(c.type)d.type=c.type;if(c.charset)d.charset=c.charset;t(d,b,"finished",f);if(b.elem){b.elem=null}else if(b.text){d.onload=d.onreadystatechange=null;d.text=b.text}else{d.src=c.real_src}i.insertBefore(d,i.firstChild);if(b.text){f()}}function S(c,b,d,f){var e,g,h=function(){b.ready_cb(b,function(){R(c,b,e)})},j=function(){b.finished_cb(b,d)};b.src=N(b.src,c[B]);b.real_src=b.src+(c[A]?((/\?.*$/.test(b.src)?"&_":"?_")+~~(Math.random()*1E9)+"="):"");if(!p[b.src])p[b.src]={items:[],finished:false};g=p[b.src].items;if(c[u]||g.length==0){e=g[g.length]={ready:false,finished:false,ready_listeners:[h],finished_listeners:[j]};P(c,b,e,((f)?function(){e.ready=true;for(var a=0;a<e.ready_listeners.length;a++){e.ready_listeners[a]()}e.ready_listeners=[]}:function(){I(e)}),f)}else{e=g[0];if(e.finished){j()}else{e.finished_listeners.push(j)}}}function v(){var e,g=s(l,{}),h=[],j=0,w=false,k;function T(a,c){a.ready=true;a.exec_trigger=c;x()}function U(a,c){a.ready=a.finished=true;a.exec_trigger=null;for(var b=0;b<c.scripts.length;b++){if(!c.scripts[b].finished)return}c.finished=true;x()}function x(){while(j<h.length){if(G(h[j])){try{h[j++]()}catch(err){}continue}else if(!h[j].finished){if(O(h[j]))continue;break}j++}if(j==h.length){w=false;k=false}}function V(){if(!k||!k.scripts){h.push(k={scripts:[],finished:true})}}e={script:function(){for(var f=0;f<arguments.length;f++){(function(a,c){var b;if(!H(a)){c=[a]}for(var d=0;d<c.length;d++){V();a=c[d];if(G(a))a=a();if(!a)continue;if(H(a)){b=[].slice.call(a);b.unshift(d,1);[].splice.apply(c,b);d--;continue}if(typeof a=="string")a={src:a};a=s(a,{ready:false,ready_cb:T,finished:false,finished_cb:U});k.finished=false;k.scripts.push(a);S(g,a,k,(Q&&w));w=true;if(g[z])e.wait()}})(arguments[f],arguments[f])}return e},wait:function(){if(arguments.length>0){for(var a=0;a<arguments.length;a++){h.push(arguments[a])}k=h[h.length-1]}else k=false;x();return e}};return{script:e.script,wait:e.wait,setOptions:function(a){s(a,g);return e}}}m={setGlobalDefaults:function(a){s(a,l);return m},setOptions:function(){return v().setOptions.apply(null,arguments)},script:function(){return v().script.apply(null,arguments)},wait:function(){return v().wait.apply(null,arguments)},queueScript:function(){n[n.length]={type:"script",args:[].slice.call(arguments)};return m},queueWait:function(){n[n.length]={type:"wait",args:[].slice.call(arguments)};return m},runQueue:function(){var a=m,c=n.length,b=c,d;for(;--b>=0;){d=n.shift();a=a[d.type].apply(null,d.args)}return a},noConflict:function(){o.$LAB=K;return m},sandbox:function(){return J()}};return m}o.$LAB=J();(function(a,c,b){if(document.readyState==null&&document[a]){document.readyState="loading";document[a](c,b=function(){document.removeEventListener(c,b,false);document.readyState="complete"},false)}})("addEventListener","DOMContentLoaded")})(this); +//]]></script><script type="text/javascript">//<![CDATA[ +(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); + +ga('create', 'UA-31805-1', 'auto', { + userId: (document.cookie.match(/user_id=(\\d+)/) || [])[1], + sampleRate: 2 +}); +ga('set', 'dimension1', window.location.protocol); +ga('set', 'dimension2', 'spark'); +ga('send', 'pageview'); + +//]]></script><script type="text/javascript">//<![CDATA[ +;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[]; +p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments) +};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1; +n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","https://cdn.jsdelivr.net/snowplow/2.6.2/sp.js","snowplow")); + +function linksFilter(element) { + var currentLocation = location.protocol + "//" + location.host; + + if ((element.href.indexOf(currentLocation) === -1) && + (element.href.indexOf("/") !== 0) && + (element.href.indexOf("javascript:") !== 0)) { + return true; + } + + return false; +} + +function crossDomainLinker(element) { + return element.href.indexOf("urbandictionary.store") >= 0; +} + +snowplow('newTracker', 'cf', 'click.udimg.com', { + forceSecureTracker: true, + crossDomainLinker: crossDomainLinker +}); +snowplow('setUserIdFromCookie', 'user_id'); +snowplow('enableFormTracking', {forms: {blacklist: ['snowplow-ignore']}, fields: {blacklist: ['authenticity_token']}}); +snowplow('enableLinkClickTracking', {filter: linksFilter}, true, null); +snowplow('trackPageView', null, [{"stack": "spark"}]); +//]]></script><script type="text/javascript">//<![CDATA[ +window.Page = {}; Page.globals = {"api_key":"ab71d33b15d36506acf1e379b0ed07ee","api_path":"//api.urbandictionary.com/v0","locale":"en-US"}; +//]]></script><script type="text/javascript">//<![CDATA[ +var _qevents = _qevents || []; +(function() { + var elem = document.createElement('script'); + elem.src = (document.location.protocol == "https:" ? "https://secure" : "http://edge") + ".quantserve.com/quant.js"; + elem.async = true; + elem.type = "text/javascript"; + var scpt = document.getElementsByTagName('script')[0]; + scpt.parentNode.insertBefore(elem, scpt); +})(); + +//]]></script><script async="true" onerror="ddgBackfill()" src="https://d2gatte9o95jao.cloudfront.net/assets/prebid-738d00422a85be400a53b77f28bd5c6bbb401e6e1e05c9a318b8ac0419fa1a04.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[ +window.getParameterByName=function(c,a){a||(a=window.location.href);c=c.replace(/[\[\]]/g,"\\$\x26");var e=(new RegExp("[?\x26]"+c+"(\x3d([^\x26#]*)|\x26|#|$)")).exec(a);return e?e[2]?decodeURIComponent(e[2].replace(/\+/g," ")):"":null};var cookies=function(c,a){function e(b,a){b=b||{};for(var d in a)void 0===b[d]&&(b[d]=a[d]);return b}function g(b){var a=b;return a instanceof Date||(a=new Date,a.setTime(a.getTime()+1E3*b)),a.toUTCString()}if(e(cookies,{expires:31536E3,path:"/",secure:"https:"===window.location.protocol,nulltoremove:!0,autojson:!0,autoencode:!0,encode:function(b){return encodeURIComponent(b)},decode:function(b){return decodeURIComponent(b)},error:function(b,a,d){throw Error(b);},fallback:!1}),a=e(a,cookies),"string"== +typeof c){var b=document.cookie.split(/;\s*/).map(a.autoencode?a.decode:function(b){return b}).map(function(b){return b.split("\x3d")}).reduce(function(b,a){return b[a[0]]=a.splice(1).join("\x3d"),b},{})[c];if(!a.autojson)return b;var d;try{d=JSON.parse(b)}catch(k){d=b}return"undefined"==typeof d&&a.fallback&&(d=a.fallback(c,a)),d}for(b in c){d=c[b];var h="undefined"==typeof d||a.nulltoremove&&null===d,f=a.autojson?JSON.stringify(d):d,f=a.autoencode?a.encode(f):f;h&&(f="");f=a.encode(b)+"\x3d"+f+ +(a.expires?";expires\x3d"+g(h?-1E4:a.expires):"")+";path\x3d"+a.path+(a.domain?";domain\x3d"+a.domain:"")+(a.secure?";secure":"");a.test&&a.test(f);document.cookie=f;f=cookies(a.encode(b))||"";d&&!h&&0<a.expires&&JSON.stringify(f)!==JSON.stringify(d)&&(navigator.cookieEnabled?a.fallback?a.fallback(c,a):a.error("Cookie too large at "+d.length+" characters"):a.error("Cookies not enabled"))}return cookies}; +!function(c){"object"==typeof exports&&"object"==typeof module?module.exports=cookies:"function"==typeof define&&define.amd?define("cookies",[],cookies):"object"==typeof exports?exports.cookies=cookies:c.cookies=cookies}(this);function isMobile(c){return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(c)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(c.substr(0, +4))};function ddgBackfill(){var c=!1,a=!1,e=function(b){if(c||!b)return a;var d=/Chrome\/([0-9]+)/i.exec(b),g=/Edge/i.exec(b);if(d&&!g)return a=55<parseInt(d[1],10),c=!0,a;if(d=/Version\/([0-9]+).*Safari\/[0-9]+/i.exec(b))return a=6<parseInt(d[1],10),c=!0,a;if(b=/Firefox\/([0-9]+)/i.exec(b))return a=56<parseInt(b[1],10),c=!0,a;c=!0;return a},g=function(b,a,g,c){document.body.clientWidth<c||!e(navigator&&navigator.userAgent)||!(b=document.getElementById(b))||(a=a[Math.floor(Math.random()*a.length)],b.innerHTML= +'\x3cdiv\x3e\x3ca href\x3d"https://duckduckgo.com/ad_redirect/'+a+"/install?"+Math.ceil(1E7*Math.random())+'" target\x3d"_blank"\x3e'+('\x3cimg src\x3d"https://duckduckgo.com/public/'+a+".jpg?"+Math.ceil(1E7*Math.random())+'" style\x3d"border: 0;" height\x3d"'+g+'"\x3e')+"\x3c/a\x3e\x3c/div\x3e")};window.onload=function(){try{g("UD_ROS_728x90_ATF_Flex",["a","c","d"],90,728),g("UD_ROS_300x600_ATF_Flex",["e","i","j"],600,1025),g("Define_300x250_1",["k","l","m"],250,728),g("Define_300x250_2",["n","o", +"p"],250,728),g("Define_300x250_3",["q","r","s"],250,728)}catch(b){}}};(function(){var c=[[[0,0],[[300,250]]]];window.slotDetails={BSA:{adUnitPath:"/1031683/UD_BSA_Native_1x2",slotSize:[1,2]},Define_300x250_1:{adUnitPath:"/1031683/UD_ROS_300x250_ATF_Flex",slotSize:[[144,256],"fluid",[300,250],[256,256],[336,280],[192,256],[256,192],[256,144]]},Define_300x250_2:{adUnitPath:"/1031683/UD_ROS_300x250_BTF_1",sizeMapping:c,slotSize:[[300,250]]},Define_300x250_3:{adUnitPath:"/1031683/UD_ROS_300x250_BTF_2",sizeMapping:c,slotSize:[[300,250]]},UD_ROS_728x90_ATF_Flex:{adUnitPath:"/1031683/UD_ROS_728x90_ATF_Flex", +sizeMapping:[[[970,0],[[970,90],[728,90],[468,60]]],[[728,0],[[728,90],[468,60]]],[[640,0],[[468,60]]],[[0,0],[]]],slotSize:[[468,60],[728,90],[970,90]]},UD_ROS_300x600_ATF_Flex:{adUnitPath:"/1031683/UD_ROS_300x600_ATF_Flex",sizeMapping:[[[1024,0],[[300,600],[160,600],[300,250]]],[[0,0],[]]],slotSize:[[300,600],[160,600],[300,250]]}};window.prebidAdUnits=function(a){return[{code:"UD_ROS_728x90_ATF_Flex",sizes:[[970,90],[728,90]],bids:[{bidder:"rubicon",params:{accountId:"6317",siteId:"126350",zoneId:"598142"}}, +{bidder:"appnexus",params:{placementId:"10929438"}},{bidder:"indexExchange",params:{id:"1",siteID:191164}},{bidder:"districtmDMX",params:{id:154087}},{bidder:"aol",params:{network:"11156.1",placement:4624894}},{bidder:"brealtime",params:{placementId:12441250}},{bidder:"brealtime",params:{placementId:12441251}},{bidder:"pubmatic",params:{publisherId:"156796",adSlot:"1371981@728x90"}},{bidder:"pubmatic",params:{publisherId:"156796",adSlot:"1373987@970x90"}}]},{code:"UD_ROS_300x600_ATF_Flex",sizes:[[300, +600],[160,600],[300,250]],bids:[{bidder:"rubicon",params:{accountId:"6317",siteId:"126350",zoneId:"598142"}},{bidder:"appnexus",params:{placementId:"10929439"}},{bidder:"indexExchange",params:{id:"2",siteID:191165}},{bidder:"districtmDMX",params:{id:154088}},{bidder:"aol",params:{placement:4624895,network:"11156.1"}},{bidder:"brealtime",params:{placementId:12441244}},{bidder:"brealtime",params:{placementId:12441248}},{bidder:"brealtime",params:{placementId:12441247}},{bidder:"consumable",params:{placement:"4798859", +cid:"3944",cadj:"1.5",unit:"cnsmbl-audio-300x250-slider"}},{bidder:"pubmatic",params:{publisherId:"156796",adSlot:"1373989@160x600"}},{bidder:"pubmatic",params:{publisherId:"156796",adSlot:"1373990@300x250"}},{bidder:"pubmatic",params:{publisherId:"156796",adSlot:"1371982@300x600"}}]},{code:"Define_300x250_1",sizes:[[300,250]],bids:[{bidder:"audienceNetwork",params:{placementId:"865443720288578_865881733578110"}},{bidder:"rubicon",params:{accountId:"6317",siteId:"126350",zoneId:"598142"}},{bidder:"appnexus", +params:{placementId:"10929440"}},{bidder:"indexExchange",params:{id:"3",siteID:191166}},{bidder:"districtmDMX",params:{id:154088}},{bidder:"aol",params:{placement:a?4777300:4624896,network:"11156.1"}},{bidder:"brealtime",params:{placementId:12441247}},{bidder:"brealtime",params:{placementId:12441249}},{bidder:"rhythmone",params:{placementId:74121}},{bidder:"consumable",params:{placement:"4798859",cid:"3944",cadj:"1.5",unit:"cnsmbl-audio-300x250-slider"}},{bidder:"pubmatic",params:{publisherId:"156796", +adSlot:"1371983@300x250"}}]},{code:"Define_300x250_2",sizes:[[300,250]],bids:[{bidder:"audienceNetwork",params:{placementId:"865443720288578_866574040175546"}},{bidder:"rubicon",params:{accountId:"6317",siteId:"126350",zoneId:"598142"}},{bidder:"appnexus",params:{placementId:"10929440"}},{bidder:"indexExchange",params:{id:"4",siteID:198549}},{bidder:"districtmDMX",params:{id:154088}},{bidder:"aol",params:{placement:a?4777302:4624896,network:"11156.1"}},{bidder:"brealtime",params:{placementId:12441247}}, +{bidder:"brealtime",params:{placementId:12441249}},{bidder:"consumable",params:{placement:"4798859",cid:"3944",cadj:"1.5",unit:"cnsmbl-audio-300x250-slider"}},{bidder:"pubmatic",params:{publisherId:"156796",adSlot:"1371979@300x250"}}]},{code:"Define_300x250_3",sizes:[[300,250]],bids:[{bidder:"rubicon",params:{accountId:"6317",siteId:"126350",zoneId:"598142"}},{bidder:"appnexus",params:{placementId:"10929440"}},{bidder:"indexExchange",params:{id:"5",siteID:198550}},{bidder:"districtmDMX",params:{id:154088}}, +{bidder:"aol",params:{placement:a?4777301:4624896,network:"11156.1"}},{bidder:"sonobi",params:{placement_id:"4a84db4181cabf2ac023"}},{bidder:"brealtime",params:{placementId:12441247}},{bidder:"brealtime",params:{placementId:12441249}},{bidder:"consumable",params:{placement:"4798859",cid:"3944",cadj:"1.5",unit:"cnsmbl-audio-300x250-slider"}},{bidder:"pubmatic",params:{publisherId:"156796",adSlot:"1371980@300x250"}}]}]}})();(function(){function c(a,b){for(var d=[],c=0;c<a.length;c++)("indexExchange"!==a[c].bidder||"indexExchange"===a[c].bidder&&b)&&d.push(a[c]);return d}function a(a,b,d){for(var h=[],f=0;f<b.length;f++)for(var k=0;k<a.length;k++){var e=b[f];e.code===a[k]&&h.push({code:e.code,sizes:e.sizes,bids:c(e.bids,d)})}return h}function e(a){a.pbjs.adserverRequestSent||(a.pbjs.adserverRequestSent=!0,a.googletag.cmd.push(function(){a.pbjs.que.push(function(){a.pbjs.setTargetingForGPTAsync();a.googletag.pubads().refresh()})}))} +window.dfpDefineSlot=function(a,b){b=b||window;var d=slotDetails[a],c=b.googletag.defineSlot(d.adUnitPath,d.slotSize,a);c.addService(b.googletag.pubads());d.sizeMapping&&("function"===typeof d.sizeMapping?c.defineSizeMapping(d.sizeMapping.call(b.googletag.sizeMapping()).build()):c.defineSizeMapping(d.sizeMapping));c.setCollapseEmptyDiv(!0);return c};window.dfpTry=function(a,b){b=b||window;b.googletag.cmd.push(function(){try{a()}catch(b){console&&console.error&&console.error(b),window.Bugsnag&&Bugsnag.notifyException(b)}})}; +window.dfpInit=function(c,b){var d=c.slots,h=c.sfgFlag,f=c.sieFlag;b=b||window;b.googletag=b.googletag||{};b.googletag.cmd=b.googletag.cmd||[];b.pbjs=b.pbjs||{};b.pbjs.que=b.pbjs.que||[];b.googletag.cmd.push(function(){b.googletag.pubads().disableInitialLoad()});b.pbjs.que.push(function(){b.pbjs.setPriceGranularity("dense");b.pbjs.setBidderSequence("random");b.pbjs.addAdUnits(a(d,prebidAdUnits(isMobile(b.navigator.userAgent)),f));b.pbjs.requestBids({bidsBackHandler:function(a){e(b)}})});setTimeout(function(){e(b)}, +isMobile(b.navigator.userAgent)?2200:1200);dfpTry(function(){b.adSlots={};for(var a=0;a<d.length;a++)b.adSlots[d[a]]=dfpDefineSlot(d[a],b);b.googletag.pubads().setTargeting("sfg_flag",String(h));b.googletag.pubads().setTargeting("pb_update","dense");b.googletag.pubads().setTargeting("protocol",b.location.protocol.replace(/:$/,""));(a=getParameterByName("test",b.location.href))&&b.googletag.pubads().setTargeting("test",a);b.googletag.pubads().enableSingleRequest();b.googletag.enableServices()},b)}})(); +//]]></script><script type="text/javascript">dfpInit({"slots":["BSA","UD_ROS_728x90_ATF_Flex","UD_ROS_300x600_ATF_Flex","Define_300x250_1","Define_300x250_2","Define_300x250_3"],"sfgFlag":true,"sieFlag":true})</script><script type="text/javascript">//<![CDATA[ +var googletag = googletag || {}; +googletag.cmd = googletag.cmd || []; +(function() { + var gads = document.createElement('script'); + gads.async = true; + gads.type = 'text/javascript'; + var useSSL = 'https:' == document.location.protocol; + gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js'; + var node = document.getElementsByTagName('script')[0]; + node.parentNode.insertBefore(gads, node); +})(); + +//]]></script><meta content="tTfJYA/1z33+pDLZl6+c3nJlskqmdg6OMrlffIADlfE=" name="verify-v1"><link href="http://feeds.urbandictionary.com/UrbanWordOfTheDay" title="Urban Word of the Day"><link href="/favicon.ico" rel="shortcut icon"><link href="/favicon.ico" rel="icon"><link href="/osd.xml" rel="search" title="Urban Dictionary Search" type="application/opensearchdescription+xml"><meta content="169142139769391" property="fb:app_id"><meta content="verb: The act of caring and giving to someone else...having someone&apos;s best interest and wellbeing as a priority in your life. To truly L.O.V.E. is a very selfless act." name="Description" property="og:description" /><meta content="verb: The act of caring and giving to someone else...having someone&apos;s best interest and wellbeing as a priority in your life. To truly L.O.V.E. is a very selfless act." name="twitter:description" /><meta content="Urban Dictionary: L.O.V.E." name="twitter:title" /><meta content="Urban Dictionary: L.O.V.E." property="og:title" /><meta content="@urbandictionary" name="twitter:site"><meta content="Urban Dictionary" property="og:site_name"></head><body class="generated"><div id="ud-root"><div id="urban-top-bar"><div class="row"><nav class="top-bar" data-options="mobile_show_parent_link: false" data-topbar="" role="navigation"><ul class="title-area"><li class="name"><a href="/" id="logo" style="display: block; width: 150px; height: 52px; background-size: contain; background-repeat: no-repeat; background-image: url(&apos;https://d2gatte9o95jao.cloudfront.net/assets/logo-1b439b7fa6572b659fbef161d8946372f472ef8e7169db1e47d21c91b410b918.svg&apos;); z-index: 1; position: relative"></a></li><li class="toggle-topbar"><a href="#"><span class="ud_menu"><i class="svgicon svgicon-ud_menu"><svg viewBox="0 0 20 17" xmlns="http://www.w3.org/2000/svg"><rect width="20" height="3" rx="2"/><rect y="7" width="20" height="3" rx="2"/><rect y="14" width="20" height="3" rx="2"/></svg></i></span><span class="ud_x"><i class="svgicon svgicon-ud_x"><svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8.142 5.704L3.022.584c-.674-.674-1.277-.186-1.95.487-.674.674-1.162 1.277-.489 1.95l5.12 5.121-5.12 5.12c-.673.674-.185 1.278.488 1.951s1.277 1.161 1.95.488l5.121-5.12 5.12 5.12c.674.673 1.278.186 1.951-.488.674-.673 1.161-1.277.488-1.95l-5.12-5.12 5.12-5.121c.673-.674.185-1.278-.488-1.95-.673-.674-1.277-1.162-1.95-.489l-5.12 5.12z"/></svg></i></span></a></li></ul><section class="top-bar-section"><ul class="left" id="main_nav"><li class="has-dropdown"><a href="javascript:void(0)">Browse</a><ul class="dropdown alphabet-dropdown" id="browse_nav"><li><a href="/popular.php?character=A">A</a></li><li><a href="/popular.php?character=B">B</a></li><li><a href="/popular.php?character=C">C</a></li><li><a href="/popular.php?character=D">D</a></li><li><a href="/popular.php?character=E">E</a></li><li><a href="/popular.php?character=F">F</a></li><li><a href="/popular.php?character=G">G</a></li><li><a href="/popular.php?character=H">H</a></li><li><a href="/popular.php?character=I">I</a></li><li><a href="/popular.php?character=J">J</a></li><li><a href="/popular.php?character=K">K</a></li><li><a href="/popular.php?character=L">L</a></li><li><a href="/popular.php?character=M">M</a></li><li><a href="/popular.php?character=N">N</a></li><li><a href="/popular.php?character=O">O</a></li><li><a href="/popular.php?character=P">P</a></li><li><a href="/popular.php?character=Q">Q</a></li><li><a href="/popular.php?character=R">R</a></li><li><a href="/popular.php?character=S">S</a></li><li><a href="/popular.php?character=T">T</a></li><li><a href="/popular.php?character=U">U</a></li><li><a href="/popular.php?character=V">V</a></li><li><a href="/popular.php?character=W">W</a></li><li><a href="/popular.php?character=X">X</a></li><li><a href="/popular.php?character=Y">Y</a></li><li><a href="/popular.php?character=Z">Z</a></li><li><a href="/browse.php?character=*">#</a></li><li><a href="/yesterday.php">new</a></li></ul></li><li><a href="/vote.php">Vote</a></li><li><a href="https://urbandictionary.store/" id="store-link">Store</a></li></ul><ul class="right"><li class="has-dropdown show-for-medium-up"><a href="javascript:void(0)">Cart</a><ul class="dropdown cart-dropdown"><li class="cart-component"></li></ul></li></ul></section></nav></div><div class="row"><div class="columns search-and-actions"><div class="main-search"><form action="/search.php" class="snowplow-ignore" id="search_form" method="POST"><input aria-label="Search for a word" autocapitalize="off" autocomplete="off" autocorrect="off" class="autocomplete form-control" id="term" name="term" placeholder="Type any word..." tabindex="1" type="text"></form></div><div class="main-actions"><a class="circle-button" href="/add.php"><i class="svgicon svgicon-add202"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M42.939 19.742H28.505V5.319c0-2.283-1.842-4.134-4.125-4.134s-4.124 1.851-4.124 4.135v14.432H5.814a4.137 4.137 0 0 0-4.138 4.135 4.145 4.145 0 0 0 1.207 2.934 4.122 4.122 0 0 0 2.92 1.222h14.453v14.411a4.11 4.11 0 0 0 1.201 2.923 4.11 4.11 0 0 0 2.919 1.211 4.13 4.13 0 0 0 4.129-4.134V28.042h14.434c2.283 0 4.134-1.867 4.133-4.15 0-2.282-1.851-4.15-4.133-4.15z"/></svg></i></a><a class="circle-button" href="/random.php" onclick="document.location = &quot;/random.php?page=&quot; + Math.ceil(Math.random() * 1000); return false"><i class="svgicon svgicon-ud_shuffle"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M26.9 22.6h-1.2c-2.4 0-4.2-1.2-5.9-3-.2.2-.3.4-.5.7-.8 1-1.6 2-2.4 3.1 2.3 2.2 5.1 3.9 8.9 3.9H27v4.1l7.1-6.1-7.1-6.1v3.4zM9.2 14.4c.3-.3.5-.7.8-1.1l2.1-2.7C9.9 8.5 7.2 7 3.6 7H0v4.8h3.6c2.2-.1 4 1 5.6 2.6zm16.5-3h1.2v3.4L34 8.7l-7.1-6.1v4.1h-1.2c-6.3 0-9.8 4.6-12.9 8.7-2.8 3.7-5.2 6.9-9.2 6.9H0V27h3.6c6.3 0 9.8-4.6 12.9-8.7 2.8-3.7 5.2-6.9 9.2-6.9z"/></svg></i></a><a class="circle-button account-button" href="/users.php"><i class="svgicon svgicon-user58"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M31.941 36.688c-7.102 0-12.856-6.898-12.856-15.401 0-8.502 5.754-14.804 12.856-14.804 7.103 0 12.862 6.302 12.862 14.804 0 8.503-5.759 15.401-12.862 15.401zm-19.998 20.82s-2.727.18-3.928-1.475c-.649-.894-.197-2.706.247-3.717l1.087-2.477s3.006-6.723 6.428-10.619c2.102-2.389 4.602-1.845 6.219-1.068.996.478 2.122 1.871 2.945 2.609 1.134 1.017 3.136 2.173 6.409 2.238h2.008c3.271-.065 5.273-1.221 6.406-2.238.822-.738 1.917-2.174 2.904-2.668 1.484-.743 3.743-1.2 5.79 1.127 3.423 3.896 6.134 10.741 6.134 10.741l1.114 2.429c.461 1.004.933 2.807.302 3.713-1.126 1.62-3.654 1.405-3.654 1.405H11.943z"/></svg></i></a></div></div></div></div><div class="show-for-medium-up" id="dark_top"><div data-ad-slot="UD_ROS_728x90_ATF_Flex" id="UD_ROS_728x90_ATF_Flex" style="text-align: center"><script type="text/javascript">dfpTry(function() { googletag.display('UD_ROS_728x90_ATF_Flex')})</script></div></div><div id="outer"><div class="three-columns"><div class="row"><div class="small-12 large-8 columns"><div id="content"><div class="def-panel" data-defid="6813250"><div class="row"><div class="small-6 columns"><div class="ribbon">Top definition</div></div><div class="small-6 columns share"><a class="social-interaction addthis_button_twitter" data-action="share" data-network="twitter" data-target="6813250" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F6813250&amp;title=Urban+Dictionary%3A+L.O.V.E.&amp;s=twitter" target="_blank"><i class="svgicon svgicon-ud_twitter"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M7.3 8c5.4 2.8 9.9 2.6 9.9 2.6s-1.7-6.2 3.6-8.9 9 1.9 9 1.9.9-.3 1.6-.5c.7-.3 1.7-.7 1.7-.7l-1.6 3 2.5-.3s-.3.5-1.3 1.4l-1.4 1.4s.4 7.4-3.4 13.1c-3.8 5.7-8.7 9.1-15.9 9.9C4.9 31.6.2 28.6.2 28.6s3.1-.2 5.1-1 4.9-2.8 4.9-2.8-4.1-1.3-5.5-2.7c-1.5-1.4-1.8-2.3-1.8-2.3l4-.1s-4.2-2.3-5.4-4.1S0 12.1 0 12.1l3.1 1.3S.5 9.8.2 7s.5-4.3.5-4.3S1.9 5.2 7.3 8z"/></svg></i></a><a class="social-interaction addthis_button_facebook" data-action="share" data-network="facebook" data-target="6813250" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F6813250&amp;title=Urban+Dictionary%3A+L.O.V.E.&amp;s=facebook" target="_blank"><i class="svgicon svgicon-ud_facebook"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M19.4 0c-1 0-2 .1-3.2.6-2.3 1-3.5 3.3-3.5 6.9V11H9.4v6h3.3v17h6.7V17h4.5l.6-5.9h-5.2V8.4c0-.8.1-1.4.3-1.8.3-.5.9-.8 1.8-.8h3V0h-5z"/></svg></i></a><a class="social-interaction addthis_button_more" data-action="share" data-network="share" data-target="6813250" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F6813250&amp;title=Urban+Dictionary%3A+L.O.V.E." target="_blank"><i class="svgicon svgicon-ud_share"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M27.1 12c-1.3 0-2.5.5-3.4 1.4l-11.9-7c.2-.3.2-.9.2-1.2.1-3-2.1-5.2-5-5.2S2 2.2 2 5.1s2.2 5.1 5 5.1c1.3 0 2.5-.5 3.4-1.4l11.9 7c-.2.3-.2.9-.2 1.2 0 .3 0 .9.2 1.2l-11.9 7.2c-.8-.9-2-1.4-3.4-1.4-2.7 0-4.9 2.2-4.9 5s2.2 5 4.9 5 4.9-2.2 4.9-5c0-.3 0-.7-.2-1.2l11.9-7.2c.8.9 2 1.4 3.4 1.4 2.8 0 5-2.2 5-5.1S30 12 27.1 12z"/></svg></i></a></div></div><div class="def-header"><a class="word" href="/define.php?term=L.O.V.E." name="6813250">L.O.V.E.</a> <a class="play-sound" data-urls="[&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE35b9334712938460043b73afc02df506&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE18e01dc887fd7e29b97134335b145c9c&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/REd7889c2477ebacf99893efc4d995a80e&quot;,&quot;http://wav.urbandictionary.com/love-25255.wav&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE235f4129401e5722ce5ee64bd3462a3f&quot;,&quot;http://wav.urbandictionary.com/love-27104.wav&quot;]"><i class="svgicon svgicon-ud_speaker"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M20.8.3v4c5.5 1.7 9.4 6.6 9.4 12.7s-4 11-9.4 12.7v4C28.3 31.9 34 25.1 34 17S28.3 2 20.8.3zM25.5 17c0-3.4-1.9-6.2-4.7-7.6v15.1c2.8-1.3 4.7-4.1 4.7-7.5zM0 11.3v11.3h7.6L17 32V1.8l-9.4 9.4H0z"/></svg></i></a><span class="category right hide unknown"><a href="/category.php?category=unknown"><span style="border-radius: 8px; text-align: center; width: 90px; padding: 2px 6px; color: white;">unknown</span></a></span></div><div class="meaning"><a class="autolink" href="/define.php?term=verb">verb</a>: The act of <a class="autolink" href="/define.php?term=caring">caring</a> and <a class="autolink" href="/define.php?term=giving">giving</a> to someone else...having someone&apos;s best interest and wellbeing as a priority in your life. To truly L.O.V.E. is a very selfless act.</div><div class="example"><a class="autolink" href="/define.php?term=Michael%20Jackson">Michael Jackson</a> was a loving humaitarian and wanted to <a class="autolink" href="/define.php?term=make">make</a> <a class="autolink" href="/define.php?term=the%20world">the world</a> a better place for all. He was the embodiment of L.O.V.E.</div><div class="tags"><a href="/tags.php?tag=michael%20jackson">#michael jackson</a><a href="/tags.php?tag=noble">#noble</a><a href="/tags.php?tag=humanitarian">#humanitarian</a><a href="/tags.php?tag=selfless">#selfless</a><a href="/tags.php?tag=love">#love</a><a href="/tags.php?tag=altruistic">#altruistic</a><a href="/tags.php?tag=philanthropic">#philanthropic</a><a href="/tags.php?tag=self-sacrificing">#self-sacrificing</a><a href="/tags.php?tag=caring">#caring</a><a href="/tags.php?tag=charitable">#charitable</a></div><div class="contributor">by <a href="/author.php?author=PY%20Love%20and%20Peace">PY Love and Peace</a> November 02, 2012</div><div class="def-footer"><div class="row"><div class="columns"><div class="left thumbs"><div class="thumbs"><a class="up"><i class="svgicon svgicon-ud_upvote"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M34 15.3c0-1.9-1.4-3.4-3.1-3.4h-9.7l1.5-7.8v-.5c0-.7-.3-1.4-.6-1.9L20.4 0 10.2 11.2c-.6.5-.9 1.4-.9 2.4v17c0 1.9 1.4 3.4 3.1 3.4h13.9c1.2 0 2.3-.8 2.8-2l4.6-12.1c.2-.3.2-.9.2-1.2v-3.4h.1c0 .2 0 0 0 0zM0 34h6.2V13.6H0V34z"/></svg></i><span class="count">1366</span></a><a class="down"><i class="svgicon svgicon-ud_downvote"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M27.8 0v20.4H34V0h-6.2zm-6.2 0H7.7C6.5 0 5.4.9 4.9 2L.3 14.1c-.1.3-.3.7-.3 1.2v3.4c0 1.9 1.4 3.4 3.1 3.4h9.7l-1.5 7.8v.5c0 .7.3 1.4.6 1.9l1.7 1.7 10.2-11.2c.6-.7.9-1.5.9-2.4v-17c0-1.9-1.4-3.4-3.1-3.4z"/></svg></i><span class="count">160</span></a></div></div><div class="right text-right"><div class="hide dotdotdot-tooltip"><a class="circle-link" href="/remove.form.php?reconsider%5Bdefid_to_remove%5D=6813250"><i class="svgicon svgicon-flag-black-rectangular-tool-symbol-on-a-pole"><svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + width="496.825px" height="496.825px" viewBox="0 0 496.825 496.825" style="enable-background:new 0 0 496.825 496.825;" + xml:space="preserve"> +<g> + <path d="M248.413,18.7c-95.625-42.075-153,0-153,0v124.312v353.812h19.125V219.513c24.862-9.562,70.763-17.212,133.875,9.562 + c95.625,42.075,153,0,153,0V18.7C401.413,18.7,344.038,60.775,248.413,18.7z"/> +</g> +</svg> +</i></a><a class="circle-link" href="/sound.new.php?defid=6813250" id="record-6813250"><i class="svgicon svgicon-ud_record"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M22.2 2.7C22.2 1.6 21 0 17 0s-5.2 1.6-5.2 2.7v7.2h10.3V2.7M17 20.4c4 0 5.2-1.6 5.2-2.7v-5.4H11.8v5.4c0 1.1 1.2 2.7 5.2 2.7zm10.3-8.1h-1c-.4 0-.7.3-.7.7v4.7c0 2.3-1.8 6.1-8.6 6.1S8.4 20 8.4 17.7V13c0-.4-.3-.7-.7-.7h-1c-.4 0-.7.3-.7.7v4.7c0 3.8 2.8 7.9 9.3 8.4v4.5h-4.5c-.4 0-.7.3-.7.7v2c0 .4.3.7.7.7h12.4c.4 0 .7-.3.7-.7v-2c0-.4-.3-.7-.7-.7h-4.5v-4.5c6.5-.6 9.3-4.6 9.3-8.4V13c0-.4-.3-.7-.7-.7z"/></svg></i></a><a class="circle-link" href="/video.new.php?defid=6813250" id="video-6813250"><i class="svgicon svgicon-ud_video"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M13.2 22.6V11.4l8.7 5.6-8.7 5.6zM34 7.6V5.3c0-.8-.6-1.5-1.4-1.5H1.4C.7 3.8 0 4.5 0 5.3v2.3h3.5v3.8H0v3.8h3.5V19H0v3.8h3.5v3.8H0v2.3c0 .8.6 1.5 1.4 1.5h31.2c.8 0 1.4-.7 1.4-1.5v-2.3h-3.5v-3.8H34V19h-3.5v-3.8H34v-3.8h-3.5V7.6H34z"/></svg></i></a></div><a class="dotdotdot circle-link"><i class="svgicon svgicon-ud_more"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M17 11.8c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2zm13 0c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2zm-26 0c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2z"/></svg></i></a></div></div></div></div><a class="mug-ad" href="https://urbandictionary.store/products/mug?defid=6813250&amp;utm_campaign=onpage&amp;utm_source=define&amp;utm_medium=web"><div class="new-mug-ad mug-ad-03e"><div class="tone"><div class="image"><img alt="Get the mug" height="91" src="https://d2gatte9o95jao.cloudfront.net/assets/mug-ad-02@2x-5e65e4fe0daf91156b197594c58445606b861fc9317ca6c02fad7b75dfb58e22.png" width="125" /></div><div class="text">Get a <span>L.O.V.E.</span> mug for your boyfriend José.</div></div></div></a></div><div data-ad-slot="BSA" id="BSA" style="text-align: center"><script type="text/javascript">dfpTry(function() { googletag.display('BSA')})</script></div><div class="def-panel" data-defid="11458390"><div class="row"><div class="small-6 columns"><div class="ribbon">2</div></div><div class="small-6 columns share"><a class="social-interaction addthis_button_twitter" data-action="share" data-network="twitter" data-target="11458390" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F11458390&amp;title=Urban+Dictionary%3A+love&amp;s=twitter" target="_blank"><i class="svgicon svgicon-ud_twitter"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M7.3 8c5.4 2.8 9.9 2.6 9.9 2.6s-1.7-6.2 3.6-8.9 9 1.9 9 1.9.9-.3 1.6-.5c.7-.3 1.7-.7 1.7-.7l-1.6 3 2.5-.3s-.3.5-1.3 1.4l-1.4 1.4s.4 7.4-3.4 13.1c-3.8 5.7-8.7 9.1-15.9 9.9C4.9 31.6.2 28.6.2 28.6s3.1-.2 5.1-1 4.9-2.8 4.9-2.8-4.1-1.3-5.5-2.7c-1.5-1.4-1.8-2.3-1.8-2.3l4-.1s-4.2-2.3-5.4-4.1S0 12.1 0 12.1l3.1 1.3S.5 9.8.2 7s.5-4.3.5-4.3S1.9 5.2 7.3 8z"/></svg></i></a><a class="social-interaction addthis_button_facebook" data-action="share" data-network="facebook" data-target="11458390" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F11458390&amp;title=Urban+Dictionary%3A+love&amp;s=facebook" target="_blank"><i class="svgicon svgicon-ud_facebook"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M19.4 0c-1 0-2 .1-3.2.6-2.3 1-3.5 3.3-3.5 6.9V11H9.4v6h3.3v17h6.7V17h4.5l.6-5.9h-5.2V8.4c0-.8.1-1.4.3-1.8.3-.5.9-.8 1.8-.8h3V0h-5z"/></svg></i></a><a class="social-interaction addthis_button_more" data-action="share" data-network="share" data-target="11458390" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F11458390&amp;title=Urban+Dictionary%3A+love" target="_blank"><i class="svgicon svgicon-ud_share"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M27.1 12c-1.3 0-2.5.5-3.4 1.4l-11.9-7c.2-.3.2-.9.2-1.2.1-3-2.1-5.2-5-5.2S2 2.2 2 5.1s2.2 5.1 5 5.1c1.3 0 2.5-.5 3.4-1.4l11.9 7c-.2.3-.2.9-.2 1.2 0 .3 0 .9.2 1.2l-11.9 7.2c-.8-.9-2-1.4-3.4-1.4-2.7 0-4.9 2.2-4.9 5s2.2 5 4.9 5 4.9-2.2 4.9-5c0-.3 0-.7-.2-1.2l11.9-7.2c.8.9 2 1.4 3.4 1.4 2.8 0 5-2.2 5-5.1S30 12 27.1 12z"/></svg></i></a></div></div><div class="def-header"><a class="word" href="/define.php?term=love" name="11458390">love</a> <a class="play-sound" data-urls="[&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE35b9334712938460043b73afc02df506&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE18e01dc887fd7e29b97134335b145c9c&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/REd7889c2477ebacf99893efc4d995a80e&quot;,&quot;http://wav.urbandictionary.com/love-25255.wav&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE235f4129401e5722ce5ee64bd3462a3f&quot;,&quot;http://wav.urbandictionary.com/love-27104.wav&quot;]"><i class="svgicon svgicon-ud_speaker"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M20.8.3v4c5.5 1.7 9.4 6.6 9.4 12.7s-4 11-9.4 12.7v4C28.3 31.9 34 25.1 34 17S28.3 2 20.8.3zM25.5 17c0-3.4-1.9-6.2-4.7-7.6v15.1c2.8-1.3 4.7-4.1 4.7-7.5zM0 11.3v11.3h7.6L17 32V1.8l-9.4 9.4H0z"/></svg></i></a><span class="category right hide unknown"><a href="/category.php?category=unknown"><span style="border-radius: 8px; text-align: center; width: 90px; padding: 2px 6px; color: white;">unknown</span></a></span></div><div class="meaning">What is love. <a class="autolink" href="/define.php?term=Baby">Baby</a> don&apos;t <a class="autolink" href="/define.php?term=hurt">hurt</a> me.</div><div class="example"><a class="autolink" href="/define.php?term=Love">Love</a></div><div class="gif"><img height="200" src="https://media3.giphy.com/media/YvvmLB59iCXew/giphy.gif" width="356"><div class="gif-attribution">via <a href="https://giphy.com/gifs/YvvmLB59iCXew">giphy</a></div></div><div class="contributor">by <a href="/author.php?author=Rainbow_Creeper3">Rainbow_Creeper3</a> April 20, 2017</div><div class="def-footer"><div class="row"><div class="columns"><div class="left thumbs"><div class="thumbs"><a class="up"><i class="svgicon svgicon-ud_upvote"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M34 15.3c0-1.9-1.4-3.4-3.1-3.4h-9.7l1.5-7.8v-.5c0-.7-.3-1.4-.6-1.9L20.4 0 10.2 11.2c-.6.5-.9 1.4-.9 2.4v17c0 1.9 1.4 3.4 3.1 3.4h13.9c1.2 0 2.3-.8 2.8-2l4.6-12.1c.2-.3.2-.9.2-1.2v-3.4h.1c0 .2 0 0 0 0zM0 34h6.2V13.6H0V34z"/></svg></i><span class="count">640</span></a><a class="down"><i class="svgicon svgicon-ud_downvote"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M27.8 0v20.4H34V0h-6.2zm-6.2 0H7.7C6.5 0 5.4.9 4.9 2L.3 14.1c-.1.3-.3.7-.3 1.2v3.4c0 1.9 1.4 3.4 3.1 3.4h9.7l-1.5 7.8v.5c0 .7.3 1.4.6 1.9l1.7 1.7 10.2-11.2c.6-.7.9-1.5.9-2.4v-17c0-1.9-1.4-3.4-3.1-3.4z"/></svg></i><span class="count">70</span></a></div></div><div class="right text-right"><div class="hide dotdotdot-tooltip"><a class="circle-link" href="/remove.form.php?reconsider%5Bdefid_to_remove%5D=11458390"><i class="svgicon svgicon-flag-black-rectangular-tool-symbol-on-a-pole"><svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + width="496.825px" height="496.825px" viewBox="0 0 496.825 496.825" style="enable-background:new 0 0 496.825 496.825;" + xml:space="preserve"> +<g> + <path d="M248.413,18.7c-95.625-42.075-153,0-153,0v124.312v353.812h19.125V219.513c24.862-9.562,70.763-17.212,133.875,9.562 + c95.625,42.075,153,0,153,0V18.7C401.413,18.7,344.038,60.775,248.413,18.7z"/> +</g> +</svg> +</i></a><a class="circle-link" href="/sound.new.php?defid=11458390" id="record-11458390"><i class="svgicon svgicon-ud_record"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M22.2 2.7C22.2 1.6 21 0 17 0s-5.2 1.6-5.2 2.7v7.2h10.3V2.7M17 20.4c4 0 5.2-1.6 5.2-2.7v-5.4H11.8v5.4c0 1.1 1.2 2.7 5.2 2.7zm10.3-8.1h-1c-.4 0-.7.3-.7.7v4.7c0 2.3-1.8 6.1-8.6 6.1S8.4 20 8.4 17.7V13c0-.4-.3-.7-.7-.7h-1c-.4 0-.7.3-.7.7v4.7c0 3.8 2.8 7.9 9.3 8.4v4.5h-4.5c-.4 0-.7.3-.7.7v2c0 .4.3.7.7.7h12.4c.4 0 .7-.3.7-.7v-2c0-.4-.3-.7-.7-.7h-4.5v-4.5c6.5-.6 9.3-4.6 9.3-8.4V13c0-.4-.3-.7-.7-.7z"/></svg></i></a><a class="circle-link" href="/video.new.php?defid=11458390" id="video-11458390"><i class="svgicon svgicon-ud_video"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M13.2 22.6V11.4l8.7 5.6-8.7 5.6zM34 7.6V5.3c0-.8-.6-1.5-1.4-1.5H1.4C.7 3.8 0 4.5 0 5.3v2.3h3.5v3.8H0v3.8h3.5V19H0v3.8h3.5v3.8H0v2.3c0 .8.6 1.5 1.4 1.5h31.2c.8 0 1.4-.7 1.4-1.5v-2.3h-3.5v-3.8H34V19h-3.5v-3.8H34v-3.8h-3.5V7.6H34z"/></svg></i></a></div><a class="dotdotdot circle-link"><i class="svgicon svgicon-ud_more"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M17 11.8c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2zm13 0c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2zm-26 0c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2z"/></svg></i></a></div></div></div></div><a class="mug-ad" href="https://urbandictionary.store/products/mug?defid=11458390&amp;utm_campaign=onpage&amp;utm_source=define&amp;utm_medium=web"><div class="new-mug-ad mug-ad-03a"><div class="tone"><div class="image"><img alt="Get the mug" height="91" src="https://d2gatte9o95jao.cloudfront.net/assets/mug-ad-02@2x-5e65e4fe0daf91156b197594c58445606b861fc9317ca6c02fad7b75dfb58e22.png" width="125" /></div><div class="text">Get a <span>love</span> mug for your daughter-in-law Beatrix.</div></div></div></a></div><div class="da-panel"><div data-ad-slot="Define_300x250_1" id="Define_300x250_1" style="text-align: center"><script type="text/javascript">dfpTry(function() { googletag.display('Define_300x250_1')})</script></div></div><div class="panel domains" id="columnist-2"><div class="text">buy the domain for your art site</div><ul class="no-bullet alphabetical"><li style="text-align: center"><a href="https://namecheap.pxf.io/c/1208915/386170/5618?u=https%3A%2F%2Fwww.namecheap.com%2Fdomains%2Fregistration%2Fresults.aspx%3Fdomain%3Dlove.space" style="padding: 5px 30px">love.space</a></li></ul> +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 463 463"><g fill="none" stroke="#9F5ED8" stroke-width="2"><path d="M216 439c-6 0-8-94-3-209s13-209 20-209"/><path d="M184 436c-30-6-37-103-14-217s65-200 95-194"/><path d="M149 425c-49-19-56-122-14-229S251 16 300 35"/><path d="M109 405c-59-39-56-150 8-246S280 16 340 55"/><path d="M65 366c-55-65-28-178 60-253s204-83 259-18"/><path d="M26 297C-4 209 61 108 171 71s222 4 252 92"/><path d="M17 205C28 111 130 46 245 60s199 102 187 196"/><path d="M45 122c46-76 164-90 263-31s142 170 96 247"/><path d="M89 71c60-51 169-21 244 67s87 201 27 252"/><path d="M131 43c56-28 143 34 194 137s49 210-7 238"/><path d="M168 29c40-12 98 70 129 181s24 211-16 222"/><path d="M201 22c18-2 43 90 56 205s9 209-9 211m9-1c-21 3-44 3-65 0m138-26a233 233 0 0 1-211 0"/><path d="M370 380c-47 47-151 62-232 35-24-9-45-20-59-35"/><path d="M399 346c-37 55-145 83-241 62-50-11-89-33-108-62"/><path d="M418 309c-25 62-132 100-239 85-74-9-131-43-148-85"/><path d="M430 270c-13 65-115 112-228 105-96-6-172-50-183-105"/><path d="M434 230c0 67-94 120-209 120S15 297 15 230"/><path d="M430 190c13 65-69 124-183 131S32 282 19 217c-2-9-2-18 0-27"/><path d="M418 151c25 62-41 123-148 137S56 265 31 203c-7-17-7-35 0-52"/><path d="M399 114c37 55-12 117-108 138s-204-6-241-61a65 65 0 0 1 0-77"/><path d="M370 80c48 46 21 106-59 133s-185 12-232-34c-32-31-32-69 0-99"/><path d="M330 49c58 34 57 88-2 121s-152 32-209-2c-57-33-57-85 0-119"/><path d="M257 23c66 11 104 50 86 87s-86 60-151 49-104-49-86-86c11-24 44-43 86-50"/><path d="M320 77c0 31-43 55-95 55s-95-24-95-55 42-54 95-54 95 24 95 54z"/><path d="M289 67c0 21-29 37-64 37s-65-16-65-37 29-37 65-37 64 17 64 37z"/><path d="M257 61c0 10-14 19-32 19s-33-9-33-19 14-19 33-19 32 8 32 19z"/><path d="M434 230a209 209 0 1 1-419 0 209 209 0 0 1 419 0z"/></g></svg></div><div class="def-panel" data-defid="4851263"><div class="row"><div class="small-6 columns"><div class="ribbon">3</div></div><div class="small-6 columns share"><a class="social-interaction addthis_button_twitter" data-action="share" data-network="twitter" data-target="4851263" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F4851263&amp;title=Urban+Dictionary%3A+Love&amp;s=twitter" target="_blank"><i class="svgicon svgicon-ud_twitter"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M7.3 8c5.4 2.8 9.9 2.6 9.9 2.6s-1.7-6.2 3.6-8.9 9 1.9 9 1.9.9-.3 1.6-.5c.7-.3 1.7-.7 1.7-.7l-1.6 3 2.5-.3s-.3.5-1.3 1.4l-1.4 1.4s.4 7.4-3.4 13.1c-3.8 5.7-8.7 9.1-15.9 9.9C4.9 31.6.2 28.6.2 28.6s3.1-.2 5.1-1 4.9-2.8 4.9-2.8-4.1-1.3-5.5-2.7c-1.5-1.4-1.8-2.3-1.8-2.3l4-.1s-4.2-2.3-5.4-4.1S0 12.1 0 12.1l3.1 1.3S.5 9.8.2 7s.5-4.3.5-4.3S1.9 5.2 7.3 8z"/></svg></i></a><a class="social-interaction addthis_button_facebook" data-action="share" data-network="facebook" data-target="4851263" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F4851263&amp;title=Urban+Dictionary%3A+Love&amp;s=facebook" target="_blank"><i class="svgicon svgicon-ud_facebook"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M19.4 0c-1 0-2 .1-3.2.6-2.3 1-3.5 3.3-3.5 6.9V11H9.4v6h3.3v17h6.7V17h4.5l.6-5.9h-5.2V8.4c0-.8.1-1.4.3-1.8.3-.5.9-.8 1.8-.8h3V0h-5z"/></svg></i></a><a class="social-interaction addthis_button_more" data-action="share" data-network="share" data-target="4851263" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F4851263&amp;title=Urban+Dictionary%3A+Love" target="_blank"><i class="svgicon svgicon-ud_share"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M27.1 12c-1.3 0-2.5.5-3.4 1.4l-11.9-7c.2-.3.2-.9.2-1.2.1-3-2.1-5.2-5-5.2S2 2.2 2 5.1s2.2 5.1 5 5.1c1.3 0 2.5-.5 3.4-1.4l11.9 7c-.2.3-.2.9-.2 1.2 0 .3 0 .9.2 1.2l-11.9 7.2c-.8-.9-2-1.4-3.4-1.4-2.7 0-4.9 2.2-4.9 5s2.2 5 4.9 5 4.9-2.2 4.9-5c0-.3 0-.7-.2-1.2l11.9-7.2c.8.9 2 1.4 3.4 1.4 2.8 0 5-2.2 5-5.1S30 12 27.1 12z"/></svg></i></a></div></div><div class="def-header"><a class="word" href="/define.php?term=Love" name="4851263">Love</a> <a class="play-sound" data-urls="[&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE35b9334712938460043b73afc02df506&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE18e01dc887fd7e29b97134335b145c9c&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/REd7889c2477ebacf99893efc4d995a80e&quot;,&quot;http://wav.urbandictionary.com/love-25255.wav&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE235f4129401e5722ce5ee64bd3462a3f&quot;,&quot;http://wav.urbandictionary.com/love-27104.wav&quot;]"><i class="svgicon svgicon-ud_speaker"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M20.8.3v4c5.5 1.7 9.4 6.6 9.4 12.7s-4 11-9.4 12.7v4C28.3 31.9 34 25.1 34 17S28.3 2 20.8.3zM25.5 17c0-3.4-1.9-6.2-4.7-7.6v15.1c2.8-1.3 4.7-4.1 4.7-7.5zM0 11.3v11.3h7.6L17 32V1.8l-9.4 9.4H0z"/></svg></i></a><span class="category right hide unknown"><a href="/category.php?category=unknown"><span style="border-radius: 8px; text-align: center; width: 90px; padding: 2px 6px; color: white;">unknown</span></a></span></div><div class="meaning">A <a class="autolink" href="/define.php?term=misunderstanding">misunderstanding</a> between <a class="autolink" href="/define.php?term=two">two</a> <a class="autolink" href="/define.php?term=fools">fools</a>.</div><div class="example"><a class="autolink" href="/define.php?term=Gotta%20love">Gotta love</a> <a class="autolink" href="/define.php?term=Oscar%20Wilde">Oscar Wilde</a></div><div class="tags"><a href="/tags.php?tag=love">#love</a><a href="/tags.php?tag=fool">#fool</a><a href="/tags.php?tag=hate">#hate</a><a href="/tags.php?tag=fish">#fish</a><a href="/tags.php?tag=tree">#tree</a></div><div class="contributor">by <a href="/author.php?author=averywiseman">averywiseman</a> April 01, 2010</div><div class="def-footer"><div class="row"><div class="columns"><div class="left thumbs"><div class="thumbs"><a class="up"><i class="svgicon svgicon-ud_upvote"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M34 15.3c0-1.9-1.4-3.4-3.1-3.4h-9.7l1.5-7.8v-.5c0-.7-.3-1.4-.6-1.9L20.4 0 10.2 11.2c-.6.5-.9 1.4-.9 2.4v17c0 1.9 1.4 3.4 3.1 3.4h13.9c1.2 0 2.3-.8 2.8-2l4.6-12.1c.2-.3.2-.9.2-1.2v-3.4h.1c0 .2 0 0 0 0zM0 34h6.2V13.6H0V34z"/></svg></i><span class="count">663</span></a><a class="down"><i class="svgicon svgicon-ud_downvote"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M27.8 0v20.4H34V0h-6.2zm-6.2 0H7.7C6.5 0 5.4.9 4.9 2L.3 14.1c-.1.3-.3.7-.3 1.2v3.4c0 1.9 1.4 3.4 3.1 3.4h9.7l-1.5 7.8v.5c0 .7.3 1.4.6 1.9l1.7 1.7 10.2-11.2c.6-.7.9-1.5.9-2.4v-17c0-1.9-1.4-3.4-3.1-3.4z"/></svg></i><span class="count">97</span></a></div></div><div class="right text-right"><div class="hide dotdotdot-tooltip"><a class="circle-link" href="/remove.form.php?reconsider%5Bdefid_to_remove%5D=4851263"><i class="svgicon svgicon-flag-black-rectangular-tool-symbol-on-a-pole"><svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + width="496.825px" height="496.825px" viewBox="0 0 496.825 496.825" style="enable-background:new 0 0 496.825 496.825;" + xml:space="preserve"> +<g> + <path d="M248.413,18.7c-95.625-42.075-153,0-153,0v124.312v353.812h19.125V219.513c24.862-9.562,70.763-17.212,133.875,9.562 + c95.625,42.075,153,0,153,0V18.7C401.413,18.7,344.038,60.775,248.413,18.7z"/> +</g> +</svg> +</i></a><a class="circle-link" href="/sound.new.php?defid=4851263" id="record-4851263"><i class="svgicon svgicon-ud_record"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M22.2 2.7C22.2 1.6 21 0 17 0s-5.2 1.6-5.2 2.7v7.2h10.3V2.7M17 20.4c4 0 5.2-1.6 5.2-2.7v-5.4H11.8v5.4c0 1.1 1.2 2.7 5.2 2.7zm10.3-8.1h-1c-.4 0-.7.3-.7.7v4.7c0 2.3-1.8 6.1-8.6 6.1S8.4 20 8.4 17.7V13c0-.4-.3-.7-.7-.7h-1c-.4 0-.7.3-.7.7v4.7c0 3.8 2.8 7.9 9.3 8.4v4.5h-4.5c-.4 0-.7.3-.7.7v2c0 .4.3.7.7.7h12.4c.4 0 .7-.3.7-.7v-2c0-.4-.3-.7-.7-.7h-4.5v-4.5c6.5-.6 9.3-4.6 9.3-8.4V13c0-.4-.3-.7-.7-.7z"/></svg></i></a><a class="circle-link" href="/video.new.php?defid=4851263" id="video-4851263"><i class="svgicon svgicon-ud_video"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M13.2 22.6V11.4l8.7 5.6-8.7 5.6zM34 7.6V5.3c0-.8-.6-1.5-1.4-1.5H1.4C.7 3.8 0 4.5 0 5.3v2.3h3.5v3.8H0v3.8h3.5V19H0v3.8h3.5v3.8H0v2.3c0 .8.6 1.5 1.4 1.5h31.2c.8 0 1.4-.7 1.4-1.5v-2.3h-3.5v-3.8H34V19h-3.5v-3.8H34v-3.8h-3.5V7.6H34z"/></svg></i></a></div><a class="dotdotdot circle-link"><i class="svgicon svgicon-ud_more"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M17 11.8c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2zm13 0c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2zm-26 0c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2z"/></svg></i></a></div></div></div></div><a class="mug-ad" href="https://urbandictionary.store/products/mug?defid=4851263&amp;utm_campaign=onpage&amp;utm_source=define&amp;utm_medium=web"><div class="new-mug-ad mug-ad-03e"><div class="tone"><div class="image"><img alt="Get the mug" height="91" src="https://d2gatte9o95jao.cloudfront.net/assets/mug-ad-02@2x-5e65e4fe0daf91156b197594c58445606b861fc9317ca6c02fad7b75dfb58e22.png" width="125" /></div><div class="text">Get a <span>Love</span> mug for your mom Sarah.</div></div></div></a></div><div class="def-panel" data-defid="3084732"><div class="row"><div class="small-6 columns"><div class="ribbon">4</div></div><div class="small-6 columns share"><a class="social-interaction addthis_button_twitter" data-action="share" data-network="twitter" data-target="3084732" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F3084732&amp;title=Urban+Dictionary%3A+Love.&amp;s=twitter" target="_blank"><i class="svgicon svgicon-ud_twitter"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M7.3 8c5.4 2.8 9.9 2.6 9.9 2.6s-1.7-6.2 3.6-8.9 9 1.9 9 1.9.9-.3 1.6-.5c.7-.3 1.7-.7 1.7-.7l-1.6 3 2.5-.3s-.3.5-1.3 1.4l-1.4 1.4s.4 7.4-3.4 13.1c-3.8 5.7-8.7 9.1-15.9 9.9C4.9 31.6.2 28.6.2 28.6s3.1-.2 5.1-1 4.9-2.8 4.9-2.8-4.1-1.3-5.5-2.7c-1.5-1.4-1.8-2.3-1.8-2.3l4-.1s-4.2-2.3-5.4-4.1S0 12.1 0 12.1l3.1 1.3S.5 9.8.2 7s.5-4.3.5-4.3S1.9 5.2 7.3 8z"/></svg></i></a><a class="social-interaction addthis_button_facebook" data-action="share" data-network="facebook" data-target="3084732" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F3084732&amp;title=Urban+Dictionary%3A+Love.&amp;s=facebook" target="_blank"><i class="svgicon svgicon-ud_facebook"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M19.4 0c-1 0-2 .1-3.2.6-2.3 1-3.5 3.3-3.5 6.9V11H9.4v6h3.3v17h6.7V17h4.5l.6-5.9h-5.2V8.4c0-.8.1-1.4.3-1.8.3-.5.9-.8 1.8-.8h3V0h-5z"/></svg></i></a><a class="social-interaction addthis_button_more" data-action="share" data-network="share" data-target="3084732" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F3084732&amp;title=Urban+Dictionary%3A+Love." target="_blank"><i class="svgicon svgicon-ud_share"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M27.1 12c-1.3 0-2.5.5-3.4 1.4l-11.9-7c.2-.3.2-.9.2-1.2.1-3-2.1-5.2-5-5.2S2 2.2 2 5.1s2.2 5.1 5 5.1c1.3 0 2.5-.5 3.4-1.4l11.9 7c-.2.3-.2.9-.2 1.2 0 .3 0 .9.2 1.2l-11.9 7.2c-.8-.9-2-1.4-3.4-1.4-2.7 0-4.9 2.2-4.9 5s2.2 5 4.9 5 4.9-2.2 4.9-5c0-.3 0-.7-.2-1.2l11.9-7.2c.8.9 2 1.4 3.4 1.4 2.8 0 5-2.2 5-5.1S30 12 27.1 12z"/></svg></i></a></div></div><div class="def-header"><a class="word" href="/define.php?term=Love." name="3084732">Love.</a> <a class="play-sound" data-urls="[&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE35b9334712938460043b73afc02df506&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE18e01dc887fd7e29b97134335b145c9c&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/REd7889c2477ebacf99893efc4d995a80e&quot;,&quot;http://wav.urbandictionary.com/love-25255.wav&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE235f4129401e5722ce5ee64bd3462a3f&quot;,&quot;http://wav.urbandictionary.com/love-27104.wav&quot;]"><i class="svgicon svgicon-ud_speaker"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M20.8.3v4c5.5 1.7 9.4 6.6 9.4 12.7s-4 11-9.4 12.7v4C28.3 31.9 34 25.1 34 17S28.3 2 20.8.3zM25.5 17c0-3.4-1.9-6.2-4.7-7.6v15.1c2.8-1.3 4.7-4.1 4.7-7.5zM0 11.3v11.3h7.6L17 32V1.8l-9.4 9.4H0z"/></svg></i></a><span class="category right hide unknown"><a href="/category.php?category=unknown"><span style="border-radius: 8px; text-align: center; width: 90px; padding: 2px 6px; color: white;">unknown</span></a></span></div><div class="meaning">Its when, you cant <a class="autolink" href="/define.php?term=stop">stop</a> thinking about someone. &amp; there always on your mind constantly. They are all you ever think of, and all you want in your life. You want to be with them forever. Being in there arms makes you the happiest person alive. <a class="autolink" href="/define.php?term=Just">Just</a> kissing them makes your <a class="autolink" href="/define.php?term=heart%20melt">heart melt</a> inside. &amp; when your with them, you never want them to leave. Being in there arms, <a class="autolink" href="/define.php?term=even">even</a> <a class="autolink" href="/define.php?term=just">just</a> looking at them brings the bigest smile to your face. +<br/>Thats when you know you love someone.</div><div class="example">When someone says somthing <a class="autolink" href="/define.php?term=cute">cute</a>. &amp; you gets tears in your eyes. <a class="autolink" href="/define.php?term=just">just</a> for a second. thats when you know your in <a class="autolink" href="/define.php?term=love">love</a>.</div><div class="tags"><a href="/tags.php?tag=love">#love</a><a href="/tags.php?tag=lust">#lust</a><a href="/tags.php?tag=smile">#smile</a><a href="/tags.php?tag=happy">#happy</a><a href="/tags.php?tag=kissing">#kissing</a></div><div class="contributor">by <a href="/author.php?author=Amber%20Briggs">Amber Briggs</a> May 14, 2008</div><div class="def-footer"><div class="row"><div class="columns"><div class="left thumbs"><div class="thumbs"><a class="up"><i class="svgicon svgicon-ud_upvote"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M34 15.3c0-1.9-1.4-3.4-3.1-3.4h-9.7l1.5-7.8v-.5c0-.7-.3-1.4-.6-1.9L20.4 0 10.2 11.2c-.6.5-.9 1.4-.9 2.4v17c0 1.9 1.4 3.4 3.1 3.4h13.9c1.2 0 2.3-.8 2.8-2l4.6-12.1c.2-.3.2-.9.2-1.2v-3.4h.1c0 .2 0 0 0 0zM0 34h6.2V13.6H0V34z"/></svg></i><span class="count">213</span></a><a class="down"><i class="svgicon svgicon-ud_downvote"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M27.8 0v20.4H34V0h-6.2zm-6.2 0H7.7C6.5 0 5.4.9 4.9 2L.3 14.1c-.1.3-.3.7-.3 1.2v3.4c0 1.9 1.4 3.4 3.1 3.4h9.7l-1.5 7.8v.5c0 .7.3 1.4.6 1.9l1.7 1.7 10.2-11.2c.6-.7.9-1.5.9-2.4v-17c0-1.9-1.4-3.4-3.1-3.4z"/></svg></i><span class="count">26</span></a></div></div><div class="right text-right"><div class="hide dotdotdot-tooltip"><a class="circle-link" href="/remove.form.php?reconsider%5Bdefid_to_remove%5D=3084732"><i class="svgicon svgicon-flag-black-rectangular-tool-symbol-on-a-pole"><svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + width="496.825px" height="496.825px" viewBox="0 0 496.825 496.825" style="enable-background:new 0 0 496.825 496.825;" + xml:space="preserve"> +<g> + <path d="M248.413,18.7c-95.625-42.075-153,0-153,0v124.312v353.812h19.125V219.513c24.862-9.562,70.763-17.212,133.875,9.562 + c95.625,42.075,153,0,153,0V18.7C401.413,18.7,344.038,60.775,248.413,18.7z"/> +</g> +</svg> +</i></a><a class="circle-link" href="/sound.new.php?defid=3084732" id="record-3084732"><i class="svgicon svgicon-ud_record"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M22.2 2.7C22.2 1.6 21 0 17 0s-5.2 1.6-5.2 2.7v7.2h10.3V2.7M17 20.4c4 0 5.2-1.6 5.2-2.7v-5.4H11.8v5.4c0 1.1 1.2 2.7 5.2 2.7zm10.3-8.1h-1c-.4 0-.7.3-.7.7v4.7c0 2.3-1.8 6.1-8.6 6.1S8.4 20 8.4 17.7V13c0-.4-.3-.7-.7-.7h-1c-.4 0-.7.3-.7.7v4.7c0 3.8 2.8 7.9 9.3 8.4v4.5h-4.5c-.4 0-.7.3-.7.7v2c0 .4.3.7.7.7h12.4c.4 0 .7-.3.7-.7v-2c0-.4-.3-.7-.7-.7h-4.5v-4.5c6.5-.6 9.3-4.6 9.3-8.4V13c0-.4-.3-.7-.7-.7z"/></svg></i></a><a class="circle-link" href="/video.new.php?defid=3084732" id="video-3084732"><i class="svgicon svgicon-ud_video"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M13.2 22.6V11.4l8.7 5.6-8.7 5.6zM34 7.6V5.3c0-.8-.6-1.5-1.4-1.5H1.4C.7 3.8 0 4.5 0 5.3v2.3h3.5v3.8H0v3.8h3.5V19H0v3.8h3.5v3.8H0v2.3c0 .8.6 1.5 1.4 1.5h31.2c.8 0 1.4-.7 1.4-1.5v-2.3h-3.5v-3.8H34V19h-3.5v-3.8H34v-3.8h-3.5V7.6H34z"/></svg></i></a></div><a class="dotdotdot circle-link"><i class="svgicon svgicon-ud_more"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M17 11.8c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2zm13 0c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2zm-26 0c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2z"/></svg></i></a></div></div></div></div><a class="mug-ad" href="https://urbandictionary.store/products/mug?defid=3084732&amp;utm_campaign=onpage&amp;utm_source=define&amp;utm_medium=web"><div class="new-mug-ad mug-ad-03e"><div class="tone"><div class="image"><img alt="Get the mug" height="91" src="https://d2gatte9o95jao.cloudfront.net/assets/mug-ad-02@2x-5e65e4fe0daf91156b197594c58445606b861fc9317ca6c02fad7b75dfb58e22.png" width="125" /></div><div class="text">Get a <span>Love.</span> mug for your girlfriend Zora.</div></div></div></a></div><div class="da-panel"><div data-ad-slot="Define_300x250_2" id="Define_300x250_2" style="text-align: center"><script type="text/javascript">dfpTry(function() { googletag.display('Define_300x250_2')})</script></div></div><div class="def-panel" data-defid="1089043"><div class="row"><div class="small-6 columns"><div class="ribbon">5</div></div><div class="small-6 columns share"><a class="social-interaction addthis_button_twitter" data-action="share" data-network="twitter" data-target="1089043" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F1089043&amp;title=Urban+Dictionary%3A+love&amp;s=twitter" target="_blank"><i class="svgicon svgicon-ud_twitter"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M7.3 8c5.4 2.8 9.9 2.6 9.9 2.6s-1.7-6.2 3.6-8.9 9 1.9 9 1.9.9-.3 1.6-.5c.7-.3 1.7-.7 1.7-.7l-1.6 3 2.5-.3s-.3.5-1.3 1.4l-1.4 1.4s.4 7.4-3.4 13.1c-3.8 5.7-8.7 9.1-15.9 9.9C4.9 31.6.2 28.6.2 28.6s3.1-.2 5.1-1 4.9-2.8 4.9-2.8-4.1-1.3-5.5-2.7c-1.5-1.4-1.8-2.3-1.8-2.3l4-.1s-4.2-2.3-5.4-4.1S0 12.1 0 12.1l3.1 1.3S.5 9.8.2 7s.5-4.3.5-4.3S1.9 5.2 7.3 8z"/></svg></i></a><a class="social-interaction addthis_button_facebook" data-action="share" data-network="facebook" data-target="1089043" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F1089043&amp;title=Urban+Dictionary%3A+love&amp;s=facebook" target="_blank"><i class="svgicon svgicon-ud_facebook"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M19.4 0c-1 0-2 .1-3.2.6-2.3 1-3.5 3.3-3.5 6.9V11H9.4v6h3.3v17h6.7V17h4.5l.6-5.9h-5.2V8.4c0-.8.1-1.4.3-1.8.3-.5.9-.8 1.8-.8h3V0h-5z"/></svg></i></a><a class="social-interaction addthis_button_more" data-action="share" data-network="share" data-target="1089043" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F1089043&amp;title=Urban+Dictionary%3A+love" target="_blank"><i class="svgicon svgicon-ud_share"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M27.1 12c-1.3 0-2.5.5-3.4 1.4l-11.9-7c.2-.3.2-.9.2-1.2.1-3-2.1-5.2-5-5.2S2 2.2 2 5.1s2.2 5.1 5 5.1c1.3 0 2.5-.5 3.4-1.4l11.9 7c-.2.3-.2.9-.2 1.2 0 .3 0 .9.2 1.2l-11.9 7.2c-.8-.9-2-1.4-3.4-1.4-2.7 0-4.9 2.2-4.9 5s2.2 5 4.9 5 4.9-2.2 4.9-5c0-.3 0-.7-.2-1.2l11.9-7.2c.8.9 2 1.4 3.4 1.4 2.8 0 5-2.2 5-5.1S30 12 27.1 12z"/></svg></i></a></div></div><div class="def-header"><a class="word" href="/define.php?term=love" name="1089043">love</a> <a class="play-sound" data-urls="[&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE35b9334712938460043b73afc02df506&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE18e01dc887fd7e29b97134335b145c9c&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/REd7889c2477ebacf99893efc4d995a80e&quot;,&quot;http://wav.urbandictionary.com/love-25255.wav&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE235f4129401e5722ce5ee64bd3462a3f&quot;,&quot;http://wav.urbandictionary.com/love-27104.wav&quot;]"><i class="svgicon svgicon-ud_speaker"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M20.8.3v4c5.5 1.7 9.4 6.6 9.4 12.7s-4 11-9.4 12.7v4C28.3 31.9 34 25.1 34 17S28.3 2 20.8.3zM25.5 17c0-3.4-1.9-6.2-4.7-7.6v15.1c2.8-1.3 4.7-4.1 4.7-7.5zM0 11.3v11.3h7.6L17 32V1.8l-9.4 9.4H0z"/></svg></i></a><span class="category right hide unknown"><a href="/category.php?category=unknown"><span style="border-radius: 8px; text-align: center; width: 90px; padding: 2px 6px; color: white;">unknown</span></a></span></div><div class="meaning">The most spectacular,indescribable, deep euphoric feeling for someone. +<br/> +<br/><a class="autolink" href="/define.php?term=Love">Love</a> is an incredibly powerful word. When you&apos;re <a class="autolink" href="/define.php?term=in%20love">in love</a>, you <a class="autolink" href="/define.php?term=always">always</a> want to be together, and when you&apos;re not, you&apos;re thinking about being together because you need that person and without them your life is incomplete. +<br/> +<br/>This <a class="autolink" href="/define.php?term=love">love</a> is unconditional <a class="autolink" href="/define.php?term=affection">affection</a> with no limits or conditions: completely loving someone. It&apos;s when you trust the other with your life and when you would do anything for each other. When you love someone you want nothing more than for them to be truly <a class="autolink" href="/define.php?term=happy">happy</a> no matter what it takes because that&apos;s how much you care about them and because their needs come before your own. You hide nothing of yourself and can tell the other anything because <a class="autolink" href="/define.php?term=you%20know">you know</a> they accept you <a class="autolink" href="/define.php?term=just">just</a> the way you are and vice versa. +<br/> +<br/>It&apos;s when they&apos;re the last <a class="autolink" href="/define.php?term=thing">thing</a> you think about before you go to <a class="autolink" href="/define.php?term=sleep">sleep</a> and when they&apos;re the first thing you think of when you wake up, the feeling that warms your heart and leaves you overcome by a feeling of serenity. Love involves wanting to show your affection and/or devotion to each other. It&apos;s the smile on your face you get when you&apos;re thinking about them and miss them. +<br/> +<br/>Love can <a class="autolink" href="/define.php?term=make">make</a> you do anything and sacrifice for what <a class="autolink" href="/define.php?term=will">will</a> be better in the end. Love is intense,and passionate. Everything seems brighter, happier and more wonderful when you&apos;re in love. If you find it, don&apos;t let it go.</div><div class="example">One word frees us of all the <a class="autolink" href="/define.php?term=weight">weight</a> and <a class="autolink" href="/define.php?term=pain">pain</a> <a class="autolink" href="/define.php?term=of%20life">of life</a>: +<br/> +<br/>That word is love. +<br/> +<br/>-Sophocles</div><div class="contributor">by <a href="/author.php?author=j0813">j0813</a> February 27, 2005</div><div class="def-footer"><div class="row"><div class="columns"><div class="left thumbs"><div class="thumbs"><a class="up"><i class="svgicon svgicon-ud_upvote"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M34 15.3c0-1.9-1.4-3.4-3.1-3.4h-9.7l1.5-7.8v-.5c0-.7-.3-1.4-.6-1.9L20.4 0 10.2 11.2c-.6.5-.9 1.4-.9 2.4v17c0 1.9 1.4 3.4 3.1 3.4h13.9c1.2 0 2.3-.8 2.8-2l4.6-12.1c.2-.3.2-.9.2-1.2v-3.4h.1c0 .2 0 0 0 0zM0 34h6.2V13.6H0V34z"/></svg></i><span class="count">59392</span></a><a class="down"><i class="svgicon svgicon-ud_downvote"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M27.8 0v20.4H34V0h-6.2zm-6.2 0H7.7C6.5 0 5.4.9 4.9 2L.3 14.1c-.1.3-.3.7-.3 1.2v3.4c0 1.9 1.4 3.4 3.1 3.4h9.7l-1.5 7.8v.5c0 .7.3 1.4.6 1.9l1.7 1.7 10.2-11.2c.6-.7.9-1.5.9-2.4v-17c0-1.9-1.4-3.4-3.1-3.4z"/></svg></i><span class="count">14066</span></a></div></div><div class="right text-right"><div class="hide dotdotdot-tooltip"><a class="circle-link" href="/remove.form.php?reconsider%5Bdefid_to_remove%5D=1089043"><i class="svgicon svgicon-flag-black-rectangular-tool-symbol-on-a-pole"><svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + width="496.825px" height="496.825px" viewBox="0 0 496.825 496.825" style="enable-background:new 0 0 496.825 496.825;" + xml:space="preserve"> +<g> + <path d="M248.413,18.7c-95.625-42.075-153,0-153,0v124.312v353.812h19.125V219.513c24.862-9.562,70.763-17.212,133.875,9.562 + c95.625,42.075,153,0,153,0V18.7C401.413,18.7,344.038,60.775,248.413,18.7z"/> +</g> +</svg> +</i></a><a class="circle-link" href="/sound.new.php?defid=1089043" id="record-1089043"><i class="svgicon svgicon-ud_record"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M22.2 2.7C22.2 1.6 21 0 17 0s-5.2 1.6-5.2 2.7v7.2h10.3V2.7M17 20.4c4 0 5.2-1.6 5.2-2.7v-5.4H11.8v5.4c0 1.1 1.2 2.7 5.2 2.7zm10.3-8.1h-1c-.4 0-.7.3-.7.7v4.7c0 2.3-1.8 6.1-8.6 6.1S8.4 20 8.4 17.7V13c0-.4-.3-.7-.7-.7h-1c-.4 0-.7.3-.7.7v4.7c0 3.8 2.8 7.9 9.3 8.4v4.5h-4.5c-.4 0-.7.3-.7.7v2c0 .4.3.7.7.7h12.4c.4 0 .7-.3.7-.7v-2c0-.4-.3-.7-.7-.7h-4.5v-4.5c6.5-.6 9.3-4.6 9.3-8.4V13c0-.4-.3-.7-.7-.7z"/></svg></i></a><a class="circle-link" href="/video.new.php?defid=1089043" id="video-1089043"><i class="svgicon svgicon-ud_video"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M13.2 22.6V11.4l8.7 5.6-8.7 5.6zM34 7.6V5.3c0-.8-.6-1.5-1.4-1.5H1.4C.7 3.8 0 4.5 0 5.3v2.3h3.5v3.8H0v3.8h3.5V19H0v3.8h3.5v3.8H0v2.3c0 .8.6 1.5 1.4 1.5h31.2c.8 0 1.4-.7 1.4-1.5v-2.3h-3.5v-3.8H34V19h-3.5v-3.8H34v-3.8h-3.5V7.6H34z"/></svg></i></a></div><a class="dotdotdot circle-link"><i class="svgicon svgicon-ud_more"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M17 11.8c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2zm13 0c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2zm-26 0c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2z"/></svg></i></a></div></div></div></div><a class="mug-ad" href="https://urbandictionary.store/products/mug?defid=1089043&amp;utm_campaign=onpage&amp;utm_source=define&amp;utm_medium=web"><div class="new-mug-ad mug-ad-03d"><div class="tone"><div class="image"><img alt="Get the mug" height="91" src="https://d2gatte9o95jao.cloudfront.net/assets/mug-ad-02@2x-5e65e4fe0daf91156b197594c58445606b861fc9317ca6c02fad7b75dfb58e22.png" width="125" /></div><div class="text">Get a <span>love</span> mug for your buddy Manley.</div></div></div></a></div><div class="def-panel" data-defid="88382"><div class="row"><div class="small-6 columns"><div class="ribbon">6</div></div><div class="small-6 columns share"><a class="social-interaction addthis_button_twitter" data-action="share" data-network="twitter" data-target="88382" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F88382&amp;title=Urban+Dictionary%3A+love&amp;s=twitter" target="_blank"><i class="svgicon svgicon-ud_twitter"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M7.3 8c5.4 2.8 9.9 2.6 9.9 2.6s-1.7-6.2 3.6-8.9 9 1.9 9 1.9.9-.3 1.6-.5c.7-.3 1.7-.7 1.7-.7l-1.6 3 2.5-.3s-.3.5-1.3 1.4l-1.4 1.4s.4 7.4-3.4 13.1c-3.8 5.7-8.7 9.1-15.9 9.9C4.9 31.6.2 28.6.2 28.6s3.1-.2 5.1-1 4.9-2.8 4.9-2.8-4.1-1.3-5.5-2.7c-1.5-1.4-1.8-2.3-1.8-2.3l4-.1s-4.2-2.3-5.4-4.1S0 12.1 0 12.1l3.1 1.3S.5 9.8.2 7s.5-4.3.5-4.3S1.9 5.2 7.3 8z"/></svg></i></a><a class="social-interaction addthis_button_facebook" data-action="share" data-network="facebook" data-target="88382" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F88382&amp;title=Urban+Dictionary%3A+love&amp;s=facebook" target="_blank"><i class="svgicon svgicon-ud_facebook"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M19.4 0c-1 0-2 .1-3.2.6-2.3 1-3.5 3.3-3.5 6.9V11H9.4v6h3.3v17h6.7V17h4.5l.6-5.9h-5.2V8.4c0-.8.1-1.4.3-1.8.3-.5.9-.8 1.8-.8h3V0h-5z"/></svg></i></a><a class="social-interaction addthis_button_more" data-action="share" data-network="share" data-target="88382" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F88382&amp;title=Urban+Dictionary%3A+love" target="_blank"><i class="svgicon svgicon-ud_share"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M27.1 12c-1.3 0-2.5.5-3.4 1.4l-11.9-7c.2-.3.2-.9.2-1.2.1-3-2.1-5.2-5-5.2S2 2.2 2 5.1s2.2 5.1 5 5.1c1.3 0 2.5-.5 3.4-1.4l11.9 7c-.2.3-.2.9-.2 1.2 0 .3 0 .9.2 1.2l-11.9 7.2c-.8-.9-2-1.4-3.4-1.4-2.7 0-4.9 2.2-4.9 5s2.2 5 4.9 5 4.9-2.2 4.9-5c0-.3 0-.7-.2-1.2l11.9-7.2c.8.9 2 1.4 3.4 1.4 2.8 0 5-2.2 5-5.1S30 12 27.1 12z"/></svg></i></a></div></div><div class="def-header"><a class="word" href="/define.php?term=love" name="88382">love</a> <a class="play-sound" data-urls="[&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE35b9334712938460043b73afc02df506&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE18e01dc887fd7e29b97134335b145c9c&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/REd7889c2477ebacf99893efc4d995a80e&quot;,&quot;http://wav.urbandictionary.com/love-25255.wav&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE235f4129401e5722ce5ee64bd3462a3f&quot;,&quot;http://wav.urbandictionary.com/love-27104.wav&quot;]"><i class="svgicon svgicon-ud_speaker"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M20.8.3v4c5.5 1.7 9.4 6.6 9.4 12.7s-4 11-9.4 12.7v4C28.3 31.9 34 25.1 34 17S28.3 2 20.8.3zM25.5 17c0-3.4-1.9-6.2-4.7-7.6v15.1c2.8-1.3 4.7-4.1 4.7-7.5zM0 11.3v11.3h7.6L17 32V1.8l-9.4 9.4H0z"/></svg></i></a><span class="category right hide unknown"><a href="/category.php?category=unknown"><span style="border-radius: 8px; text-align: center; width: 90px; padding: 2px 6px; color: white;">unknown</span></a></span></div><div class="meaning">nature&apos;s <a class="autolink" href="/define.php?term=way">way</a> of <a class="autolink" href="/define.php?term=tricking">tricking</a> <a class="autolink" href="/define.php?term=people">people</a> into reproducing</div><div class="example"></div><div class="contributor">by <a href="/author.php?author=Anonymous">Anonymous</a> April 07, 2003</div><div class="def-footer"><div class="row"><div class="columns"><div class="left thumbs"><div class="thumbs"><a class="up"><i class="svgicon svgicon-ud_upvote"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M34 15.3c0-1.9-1.4-3.4-3.1-3.4h-9.7l1.5-7.8v-.5c0-.7-.3-1.4-.6-1.9L20.4 0 10.2 11.2c-.6.5-.9 1.4-.9 2.4v17c0 1.9 1.4 3.4 3.1 3.4h13.9c1.2 0 2.3-.8 2.8-2l4.6-12.1c.2-.3.2-.9.2-1.2v-3.4h.1c0 .2 0 0 0 0zM0 34h6.2V13.6H0V34z"/></svg></i><span class="count">106490</span></a><a class="down"><i class="svgicon svgicon-ud_downvote"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M27.8 0v20.4H34V0h-6.2zm-6.2 0H7.7C6.5 0 5.4.9 4.9 2L.3 14.1c-.1.3-.3.7-.3 1.2v3.4c0 1.9 1.4 3.4 3.1 3.4h9.7l-1.5 7.8v.5c0 .7.3 1.4.6 1.9l1.7 1.7 10.2-11.2c.6-.7.9-1.5.9-2.4v-17c0-1.9-1.4-3.4-3.1-3.4z"/></svg></i><span class="count">25378</span></a></div></div><div class="right text-right"><div class="hide dotdotdot-tooltip"><a class="circle-link" href="/remove.form.php?reconsider%5Bdefid_to_remove%5D=88382"><i class="svgicon svgicon-flag-black-rectangular-tool-symbol-on-a-pole"><svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + width="496.825px" height="496.825px" viewBox="0 0 496.825 496.825" style="enable-background:new 0 0 496.825 496.825;" + xml:space="preserve"> +<g> + <path d="M248.413,18.7c-95.625-42.075-153,0-153,0v124.312v353.812h19.125V219.513c24.862-9.562,70.763-17.212,133.875,9.562 + c95.625,42.075,153,0,153,0V18.7C401.413,18.7,344.038,60.775,248.413,18.7z"/> +</g> +</svg> +</i></a><a class="circle-link" href="/sound.new.php?defid=88382" id="record-88382"><i class="svgicon svgicon-ud_record"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M22.2 2.7C22.2 1.6 21 0 17 0s-5.2 1.6-5.2 2.7v7.2h10.3V2.7M17 20.4c4 0 5.2-1.6 5.2-2.7v-5.4H11.8v5.4c0 1.1 1.2 2.7 5.2 2.7zm10.3-8.1h-1c-.4 0-.7.3-.7.7v4.7c0 2.3-1.8 6.1-8.6 6.1S8.4 20 8.4 17.7V13c0-.4-.3-.7-.7-.7h-1c-.4 0-.7.3-.7.7v4.7c0 3.8 2.8 7.9 9.3 8.4v4.5h-4.5c-.4 0-.7.3-.7.7v2c0 .4.3.7.7.7h12.4c.4 0 .7-.3.7-.7v-2c0-.4-.3-.7-.7-.7h-4.5v-4.5c6.5-.6 9.3-4.6 9.3-8.4V13c0-.4-.3-.7-.7-.7z"/></svg></i></a><a class="circle-link" href="/video.new.php?defid=88382" id="video-88382"><i class="svgicon svgicon-ud_video"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M13.2 22.6V11.4l8.7 5.6-8.7 5.6zM34 7.6V5.3c0-.8-.6-1.5-1.4-1.5H1.4C.7 3.8 0 4.5 0 5.3v2.3h3.5v3.8H0v3.8h3.5V19H0v3.8h3.5v3.8H0v2.3c0 .8.6 1.5 1.4 1.5h31.2c.8 0 1.4-.7 1.4-1.5v-2.3h-3.5v-3.8H34V19h-3.5v-3.8H34v-3.8h-3.5V7.6H34z"/></svg></i></a></div><a class="dotdotdot circle-link"><i class="svgicon svgicon-ud_more"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M17 11.8c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2zm13 0c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2zm-26 0c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2z"/></svg></i></a></div></div></div></div><a class="mug-ad" href="https://urbandictionary.store/products/mug?defid=88382&amp;utm_campaign=onpage&amp;utm_source=define&amp;utm_medium=web"><div class="new-mug-ad mug-ad-03d"><div class="tone"><div class="image"><img alt="Get the mug" height="91" src="https://d2gatte9o95jao.cloudfront.net/assets/mug-ad-02@2x-5e65e4fe0daf91156b197594c58445606b861fc9317ca6c02fad7b75dfb58e22.png" width="125" /></div><div class="text">Get a <span>love</span> mug for your dad Trump.</div></div></div></a></div><div class="da-panel"><div data-ad-slot="Define_300x250_3" id="Define_300x250_3" style="text-align: center"><script type="text/javascript">dfpTry(function() { googletag.display('Define_300x250_3')})</script></div></div><div class="def-panel" data-defid="2342263"><div class="row"><div class="small-6 columns"><div class="ribbon">7</div></div><div class="small-6 columns share"><a class="social-interaction addthis_button_twitter" data-action="share" data-network="twitter" data-target="2342263" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F2342263&amp;title=Urban+Dictionary%3A+love&amp;s=twitter" target="_blank"><i class="svgicon svgicon-ud_twitter"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M7.3 8c5.4 2.8 9.9 2.6 9.9 2.6s-1.7-6.2 3.6-8.9 9 1.9 9 1.9.9-.3 1.6-.5c.7-.3 1.7-.7 1.7-.7l-1.6 3 2.5-.3s-.3.5-1.3 1.4l-1.4 1.4s.4 7.4-3.4 13.1c-3.8 5.7-8.7 9.1-15.9 9.9C4.9 31.6.2 28.6.2 28.6s3.1-.2 5.1-1 4.9-2.8 4.9-2.8-4.1-1.3-5.5-2.7c-1.5-1.4-1.8-2.3-1.8-2.3l4-.1s-4.2-2.3-5.4-4.1S0 12.1 0 12.1l3.1 1.3S.5 9.8.2 7s.5-4.3.5-4.3S1.9 5.2 7.3 8z"/></svg></i></a><a class="social-interaction addthis_button_facebook" data-action="share" data-network="facebook" data-target="2342263" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F2342263&amp;title=Urban+Dictionary%3A+love&amp;s=facebook" target="_blank"><i class="svgicon svgicon-ud_facebook"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M19.4 0c-1 0-2 .1-3.2.6-2.3 1-3.5 3.3-3.5 6.9V11H9.4v6h3.3v17h6.7V17h4.5l.6-5.9h-5.2V8.4c0-.8.1-1.4.3-1.8.3-.5.9-.8 1.8-.8h3V0h-5z"/></svg></i></a><a class="social-interaction addthis_button_more" data-action="share" data-network="share" data-target="2342263" href="https://www.addthis.com/bookmark.php?v=300&amp;winname=addthis&amp;pub=ra-50dc926d011f6845&amp;source=tbx-300&amp;lng=en-US&amp;url=http%3A%2F%2Flove.urbanup.com%2F2342263&amp;title=Urban+Dictionary%3A+love" target="_blank"><i class="svgicon svgicon-ud_share"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M27.1 12c-1.3 0-2.5.5-3.4 1.4l-11.9-7c.2-.3.2-.9.2-1.2.1-3-2.1-5.2-5-5.2S2 2.2 2 5.1s2.2 5.1 5 5.1c1.3 0 2.5-.5 3.4-1.4l11.9 7c-.2.3-.2.9-.2 1.2 0 .3 0 .9.2 1.2l-11.9 7.2c-.8-.9-2-1.4-3.4-1.4-2.7 0-4.9 2.2-4.9 5s2.2 5 4.9 5 4.9-2.2 4.9-5c0-.3 0-.7-.2-1.2l11.9-7.2c.8.9 2 1.4 3.4 1.4 2.8 0 5-2.2 5-5.1S30 12 27.1 12z"/></svg></i></a></div></div><div class="def-header"><a class="word" href="/define.php?term=love" name="2342263">love</a> <a class="play-sound" data-urls="[&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE35b9334712938460043b73afc02df506&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE18e01dc887fd7e29b97134335b145c9c&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/REd7889c2477ebacf99893efc4d995a80e&quot;,&quot;http://wav.urbandictionary.com/love-25255.wav&quot;,&quot;http://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE235f4129401e5722ce5ee64bd3462a3f&quot;,&quot;http://wav.urbandictionary.com/love-27104.wav&quot;]"><i class="svgicon svgicon-ud_speaker"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M20.8.3v4c5.5 1.7 9.4 6.6 9.4 12.7s-4 11-9.4 12.7v4C28.3 31.9 34 25.1 34 17S28.3 2 20.8.3zM25.5 17c0-3.4-1.9-6.2-4.7-7.6v15.1c2.8-1.3 4.7-4.1 4.7-7.5zM0 11.3v11.3h7.6L17 32V1.8l-9.4 9.4H0z"/></svg></i></a><span class="category right hide unknown"><a href="/category.php?category=unknown"><span style="border-radius: 8px; text-align: center; width: 90px; padding: 2px 6px; color: white;">unknown</span></a></span></div><div class="meaning">Everyday... +<br/> +<br/>- I <a class="autolink" href="/define.php?term=think">think</a> of her in the clouds. +<br/>- I stay awake <a class="autolink" href="/define.php?term=long">long</a> nights seeing her in the ceiling. +<br/>- I write her name on my tests. +<br/>- I <a class="autolink" href="/define.php?term=always">always</a> think of her reaction <a class="autolink" href="/define.php?term=may">may</a> be before i decide. +<br/>- I smile when I think of her. +<br/>- I feel my pulse rise as I sense her. +<br/>- I feel complete when she talks to me... +<br/> +<br/>- I stare aimlessly at you. +<br/>- <a class="autolink" href="/define.php?term=I%20see%20you">I see you</a> embrace someone other than me. +<br/>- I smile and <a class="autolink" href="/define.php?term=wave">wave</a> <a class="autolink" href="/define.php?term=back">back</a> at you. +<br/>- I feel my heart shattered and torn. +<br/>- I have a huge grin when I feel like I should cry. +<br/>- I say &quot;Everything&apos;s all right!&quot; when you question why. +<br/>- I cry because but I don&apos;t know why... +<br/> +<br/>- I think to myself, &quot;She <a class="autolink" href="/define.php?term=will">will</a> never love me.&quot; +<br/>- I say to myself, &quot;She won&apos;t love me as <a class="autolink" href="/define.php?term=much">much</a> as him.&quot; +<br/>- I convince myself, &quot;She is more important than myself.&quot; +<br/>- I force myself, &quot;She will never love me.&quot; +<br/> +<br/>So I keep quiet... +<br/> +<br/>All because I love you, is that a crime?</div><div class="example"><a class="autolink" href="/define.php?term=Goddammit">Goddammit</a>, <a class="autolink" href="/define.php?term=I%20love%20her">I love her</a>....</div><div class="tags"><a href="/tags.php?tag=passion">#passion</a><a href="/tags.php?tag=crush">#crush</a><a href="/tags.php?tag=true%20love">#true love</a><a href="/tags.php?tag=obsession">#obsession</a><a href="/tags.php?tag=pain">#pain</a></div><div class="gif"><img height="200" src="https://media3.giphy.com/media/YvvmLB59iCXew/giphy.gif" width="356"><div class="gif-attribution">via <a href="https://giphy.com/gifs/YvvmLB59iCXew">giphy</a></div></div><div class="contributor">by <a href="/author.php?author=cloudwatcher">cloudwatcher</a> April 02, 2007</div><div class="def-footer"><div class="row"><div class="columns"><div class="left thumbs"><div class="thumbs"><a class="up"><i class="svgicon svgicon-ud_upvote"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M34 15.3c0-1.9-1.4-3.4-3.1-3.4h-9.7l1.5-7.8v-.5c0-.7-.3-1.4-.6-1.9L20.4 0 10.2 11.2c-.6.5-.9 1.4-.9 2.4v17c0 1.9 1.4 3.4 3.1 3.4h13.9c1.2 0 2.3-.8 2.8-2l4.6-12.1c.2-.3.2-.9.2-1.2v-3.4h.1c0 .2 0 0 0 0zM0 34h6.2V13.6H0V34z"/></svg></i><span class="count">1308</span></a><a class="down"><i class="svgicon svgicon-ud_downvote"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M27.8 0v20.4H34V0h-6.2zm-6.2 0H7.7C6.5 0 5.4.9 4.9 2L.3 14.1c-.1.3-.3.7-.3 1.2v3.4c0 1.9 1.4 3.4 3.1 3.4h9.7l-1.5 7.8v.5c0 .7.3 1.4.6 1.9l1.7 1.7 10.2-11.2c.6-.7.9-1.5.9-2.4v-17c0-1.9-1.4-3.4-3.1-3.4z"/></svg></i><span class="count">323</span></a></div></div><div class="right text-right"><div class="hide dotdotdot-tooltip"><a class="circle-link" href="/remove.form.php?reconsider%5Bdefid_to_remove%5D=2342263"><i class="svgicon svgicon-flag-black-rectangular-tool-symbol-on-a-pole"><svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + width="496.825px" height="496.825px" viewBox="0 0 496.825 496.825" style="enable-background:new 0 0 496.825 496.825;" + xml:space="preserve"> +<g> + <path d="M248.413,18.7c-95.625-42.075-153,0-153,0v124.312v353.812h19.125V219.513c24.862-9.562,70.763-17.212,133.875,9.562 + c95.625,42.075,153,0,153,0V18.7C401.413,18.7,344.038,60.775,248.413,18.7z"/> +</g> +</svg> +</i></a><a class="circle-link" href="/sound.new.php?defid=2342263" id="record-2342263"><i class="svgicon svgicon-ud_record"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M22.2 2.7C22.2 1.6 21 0 17 0s-5.2 1.6-5.2 2.7v7.2h10.3V2.7M17 20.4c4 0 5.2-1.6 5.2-2.7v-5.4H11.8v5.4c0 1.1 1.2 2.7 5.2 2.7zm10.3-8.1h-1c-.4 0-.7.3-.7.7v4.7c0 2.3-1.8 6.1-8.6 6.1S8.4 20 8.4 17.7V13c0-.4-.3-.7-.7-.7h-1c-.4 0-.7.3-.7.7v4.7c0 3.8 2.8 7.9 9.3 8.4v4.5h-4.5c-.4 0-.7.3-.7.7v2c0 .4.3.7.7.7h12.4c.4 0 .7-.3.7-.7v-2c0-.4-.3-.7-.7-.7h-4.5v-4.5c6.5-.6 9.3-4.6 9.3-8.4V13c0-.4-.3-.7-.7-.7z"/></svg></i></a><a class="circle-link" href="/video.new.php?defid=2342263" id="video-2342263"><i class="svgicon svgicon-ud_video"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M13.2 22.6V11.4l8.7 5.6-8.7 5.6zM34 7.6V5.3c0-.8-.6-1.5-1.4-1.5H1.4C.7 3.8 0 4.5 0 5.3v2.3h3.5v3.8H0v3.8h3.5V19H0v3.8h3.5v3.8H0v2.3c0 .8.6 1.5 1.4 1.5h31.2c.8 0 1.4-.7 1.4-1.5v-2.3h-3.5v-3.8H34V19h-3.5v-3.8H34v-3.8h-3.5V7.6H34z"/></svg></i></a></div><a class="dotdotdot circle-link"><i class="svgicon svgicon-ud_more"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M17 11.8c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2zm13 0c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2zm-26 0c-2.2 0-4 1.9-4 4.2s1.8 4.2 4 4.2 4-1.9 4-4.2-1.8-4.2-4-4.2z"/></svg></i></a></div></div></div></div><a class="mug-ad" href="https://urbandictionary.store/products/mug?defid=2342263&amp;utm_campaign=onpage&amp;utm_source=define&amp;utm_medium=web"><div class="new-mug-ad mug-ad-03e"><div class="tone"><div class="image"><img alt="Get the mug" height="91" src="https://d2gatte9o95jao.cloudfront.net/assets/mug-ad-02@2x-5e65e4fe0daf91156b197594c58445606b861fc9317ca6c02fad7b75dfb58e22.png" width="125" /></div><div class="text">Get a <span>love</span> mug for your mother-in-law Helena.</div></div></div></a></div><div class="panel categories-panel" id="columnist"><h4><span class="underline">Categories</span></h4><ul class="no-bullet alphabetical"><li><a class="category-link" href="/category.php?category=work">📈 Work</a></li><li><a class="category-link" href="/category.php?category=drugs">🚬 Drugs</a></li><li><a class="category-link" href="/category.php?category=sex">🍆 Sex</a></li><li><a class="category-link" href="/category.php?category=music">🎧 Music</a></li><li><a class="category-link" href="/category.php?category=college">🎓 College</a></li><li><a class="category-link" href="/category.php?category=food">🍰 Food</a></li><li><a class="category-link" href="/category.php?category=sports">⚽️ Sports</a></li><li><a class="category-link" href="/category.php?category=name">🙋🏽 Name</a></li><li><a class="category-link" href="/category.php?category=internet">💬 Internet</a></li><li><a class="category-link" href="/category.php?category=religion">🙏 Religion</a></li></ul></div><div class="pagination-centered"><ul class="pagination"><li class="current"><a href="#">1</a></li><li><a href="/define.php?term=L.O.V.E.&amp;page=2">2</a></li><li><a href="/define.php?term=L.O.V.E.&amp;page=3">3</a></li><li><a href="/define.php?term=L.O.V.E.&amp;page=4">4</a></li><li><a href="/define.php?term=L.O.V.E.&amp;page=5">5</a></li><li class="unavailable"><span>...</span></li><li><a href="/define.php?term=L.O.V.E.&amp;page=2" rel="next">Next ›</a></li><li><a href="/define.php?term=L.O.V.E.&amp;page=211">Last »</a></li></ul></div></div><div class="hide-for-large-up"><div class="copyright">&copy; 1999-2018 Urban Dictionary &reg;<br><a href="http://ads.urbandictionary.com/">advertise</a>&nbsp;<a href="http://about.urbandictionary.com/tos">terms of service</a><br><a href="http://about.urbandictionary.com/privacy">privacy</a>&nbsp;<a href="http://about.urbandictionary.com/dmca">dmca</a>&nbsp;<a href="/remove.php">remove</a><br><a href="http://help.urbandictionary.com/">help</a>&nbsp;<a href="https://discordapp.com/invite/EdU3jpt">chat</a></div></div></div><div class="large-4 columns show-for-large-up"><div id="right_panels"><div class="dfp-panel panel-margin"><div data-ad-slot="UD_ROS_300x600_ATF_Flex" id="UD_ROS_300x600_ATF_Flex" style="text-align: center"><script type="text/javascript">dfpTry(function() { googletag.display('UD_ROS_300x600_ATF_Flex')})</script></div></div><div class="panel"><h4><div class="underline">Activity</div></h4><div class="monthly-activity" data-monthly-activity="[[&quot;x&quot;,&quot;2012-07-01&quot;,&quot;2012-08-01&quot;,&quot;2012-09-01&quot;,&quot;2012-10-01&quot;,&quot;2012-11-01&quot;,&quot;2012-12-01&quot;,&quot;2013-01-01&quot;,&quot;2013-02-01&quot;,&quot;2013-03-01&quot;,&quot;2013-04-01&quot;,&quot;2013-05-01&quot;,&quot;2013-06-01&quot;,&quot;2013-07-01&quot;,&quot;2013-08-01&quot;,&quot;2013-09-01&quot;,&quot;2013-10-01&quot;,&quot;2013-11-01&quot;,&quot;2013-12-01&quot;,&quot;2014-01-01&quot;,&quot;2014-02-01&quot;,&quot;2014-03-01&quot;,&quot;2014-04-01&quot;,&quot;2014-05-01&quot;,&quot;2014-06-01&quot;,&quot;2014-07-01&quot;,&quot;2014-08-01&quot;,&quot;2014-09-01&quot;,&quot;2014-10-01&quot;,&quot;2014-11-01&quot;,&quot;2014-12-01&quot;,&quot;2015-01-01&quot;,&quot;2015-02-01&quot;,&quot;2015-03-01&quot;,&quot;2015-04-01&quot;,&quot;2015-05-01&quot;,&quot;2015-06-01&quot;,&quot;2015-07-01&quot;,&quot;2015-08-01&quot;,&quot;2015-09-01&quot;,&quot;2015-10-01&quot;,&quot;2015-11-01&quot;,&quot;2015-12-01&quot;,&quot;2016-01-01&quot;,&quot;2016-02-01&quot;,&quot;2016-03-01&quot;,&quot;2016-04-01&quot;,&quot;2016-05-01&quot;,&quot;2016-06-01&quot;,&quot;2016-07-01&quot;,&quot;2016-08-01&quot;,&quot;2016-09-01&quot;,&quot;2016-10-01&quot;,&quot;2016-11-01&quot;,&quot;2016-12-01&quot;,&quot;2017-01-01&quot;,&quot;2017-02-01&quot;,&quot;2017-03-01&quot;,&quot;2017-04-01&quot;,&quot;2017-05-01&quot;,&quot;2017-06-01&quot;,&quot;2017-07-01&quot;,&quot;2017-08-01&quot;,&quot;2017-09-01&quot;,&quot;2017-10-01&quot;,&quot;2017-11-01&quot;,&quot;2017-12-01&quot;,&quot;2018-01-01&quot;,&quot;2018-02-01&quot;,&quot;2018-03-01&quot;,&quot;2018-04-01&quot;,&quot;2018-05-01&quot;],[&quot;Activity&quot;,6.3032366E-4,8.763808E-4,0.0010686421,0.0011811021,0.0013520726,0.0013836635,0.0016246133,0.0018945977,0.0017000866,0.0017046698,0.0013633558,0.0013539825,0.0012795654,0.0011828619,0.0012710217,0.0012775203,0.0013953596,0.0014878807,0.0014549413,0.0013291206,0.0013074907,0.0012822137,0.0013810319,0.0012546419,0.0011961088,0.0011320409,0.0011817378,6.403167E-4,0.0011788765,0.0012952714,0.0016082687,0.0012960958,0.0013069933,0.0011894811,0.0012153356,0.0013599881,0.0012205269,0.0011974755,0.0012337585,0.0012044017,0.0011682799,0.0011098905,0.0012986789,0.0012115111,0.0013475082,0.001059067,0.0011255377,8.912563E-4,7.460961E-4,6.792668E-4,5.64864E-4,5.823348E-4,5.8023277E-4,7.345219E-4,6.425308E-4,5.892519E-4,5.1029434E-4,6.512282E-4,7.761193E-4,1.11487556E-4,0.0010403113,0.0011259462,0.0012100965,0.0014901907,0.001560235,8.144933E-4,0.0014711878,0.0018634595,0.0010667988,0.0010137131,8.556834E-4]]" height="200" id="chart"></div></div><div class="panel"><h4><div class="underline">Alphabetical list</div></h4><ul class="no-bullet alphabetical"><li><a class="alphabetical-link" href="/define.php?term=lovaria">lovaria</a></li><li><a class="alphabetical-link" href="/define.php?term=lovark">lovark</a></li><li><a class="alphabetical-link" href="/define.php?term=lovaron">lovaron</a></li><li><a class="alphabetical-link" href="/define.php?term=lovaries">lovaries</a></li><li><a class="alphabetical-link" href="/define.php?term=Lovate">Lovate</a></li><li><a class="alphabetical-link" href="/define.php?term=lovater">lovater</a></li><li><a class="alphabetical-link" href="/define.php?term=Lovatic">Lovatic</a></li><li><a class="alphabetical-link" href="/define.php?term=lovation">lovation</a></li><li><a class="alphabetical-link" href="/define.php?term=Lovato">Lovato</a></li><li><a class="alphabetical-link" href="/define.php?term=Lovatoist">Lovatoist</a></li><li><a class="alphabetical-link" href="/define.php?term=Lovatorgasm">Lovatorgasm</a></li><li><a class="alphabetical-link" href="/define.php?term=Lovatt">Lovatt</a></li><li><a class="alphabetical-link" href="/define.php?term=lovatuated">lovatuated</a></li><li><a class="alphabetical-link" href="/define.php?term=lovbe">lovbe</a></li><li><a class="alphabetical-link" href="/define.php?term=lovchuvers">lovchuvers</a></li><li><a class="alphabetical-link" href="/define.php?term=L.O.V.E.">L.O.V.E.</a></li><li><a class="alphabetical-link" href="/define.php?term=Love%20%26%20Paine">Love &amp; Paine</a></li><li><a class="alphabetical-link" href="/define.php?term=LOVE*_*">LOVE*_*</a></li><li><a class="alphabetical-link" href="/define.php?term=Love%2C%20Amore">Love, Amore</a></li><li><a class="alphabetical-link" href="/define.php?term=love%2C%20angel%2C%20music%2C%20baby">love, angel, music, baby</a></li><li><a class="alphabetical-link" href="/define.php?term=love%2C%20lust%2C%20other">love, lust, other</a></li><li><a class="alphabetical-link" href="/define.php?term=love%2C%20peace%20and%20hairgrease">love, peace and hairgrease</a></li><li><a class="alphabetical-link" href="/define.php?term=love%2C%20peace%20and%20understanding">love, peace and understanding</a></li><li><a class="alphabetical-link" href="/define.php?term=love%2Fd">love/d</a></li><li><a class="alphabetical-link" href="/define.php?term=love%2Fhate">love/hate</a></li><li><a class="alphabetical-link" href="/define.php?term=love%2Fhate%20realtionship">love/hate realtionship</a></li><li><a class="alphabetical-link" href="/define.php?term=Love%2FHate%20relationship">Love/Hate relationship</a></li><li><a class="alphabetical-link" href="/define.php?term=love4art">love4art</a></li><li><a class="alphabetical-link" href="/define.php?term=Love%3D%20fuck%20this%20shit">Love= fuck this shit</a></li><li><a class="alphabetical-link" href="/define.php?term=loveaBale">loveaBale</a></li></ul></div><div class="copyright">&copy; 1999-2018 Urban Dictionary &reg;<br><a href="http://ads.urbandictionary.com/">advertise</a>&nbsp;<a href="http://about.urbandictionary.com/tos">terms of service</a><br><a href="http://about.urbandictionary.com/privacy">privacy</a>&nbsp;<a href="http://about.urbandictionary.com/dmca">dmca</a>&nbsp;<a href="/remove.php">remove</a><br><a href="http://help.urbandictionary.com/">help</a>&nbsp;<a href="https://discordapp.com/invite/EdU3jpt">chat</a></div></div></div></div></div></div></div><div id="prebid-debug"></div><script src="//cdn.jsdelivr.net/g/[email protected],[email protected],[email protected],[email protected],[email protected],[email protected](js/standalone/selectize.min.js),[email protected],[email protected]" type="text/javascript"></script><script src="https://d2gatte9o95jao.cloudfront.net/assets/application-80aa0f160fca53a1e58bdd5db96b32e8dc603a07a29352ccf1bca36c4d03f929.js" type="text/javascript"></script><script src="//twemoji.maxcdn.com/2/twemoji.min.js" type="text/javascript"></script><script async="true" defer="true" src="//d1tcio87buo4yy.cloudfront.net/sixpack.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[ +function getParameterByName(name, url) { + if (!url) url = window.location.href; + name = name.replace(/[\[\]]/g, "\\$&"); + var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), + results = regex.exec(url); + if (!results) return null; + if (!results[2]) return ''; + return decodeURIComponent(results[2].replace(/\+/g, " ")); +} + +var param = getParameterByName("test", window.location.href); +if (param) { + var elements = document.getElementsByTagName('a'); + for (var i = 0; i < elements.length; i++) { + var href = elements[i].getAttribute('href'); + if (href && (href.indexOf('/define.php') > -1 || href.indexOf('/category.php') > -1)) { + if (href.indexOf('?') > -1) { + elements[i].setAttribute('href', href + '&test=' + encodeURIComponent(param)); + } else { + elements[i].setAttribute('href', href + '?test=' + encodeURIComponent(param)); + } + } + } + + var elements = document.getElementsByClassName(param); + for (var i = 0; i < elements.length; i++) { + elements[i].classList.remove('hide'); + } +} + +//]]></script><script type="text/javascript">//<![CDATA[ +var chart = document.getElementById('chart'); + +if (chart) { + var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; + c3.generate({ + size: { + height: 200 + }, + padding: { + left: 10, + right: 10 + }, + data: { + x: 'x', + columns: JSON.parse(chart.getAttribute('data-monthly-activity')), + type: 'bar' + }, + tooltip: { + contents: function (data, defaultTitleFormat, defaultValueFormat, color) { + return "<table class=\"c3-tooltip\"><tr><td>" + months[data[0].x.getMonth()] + " " + data[0].x.getFullYear() + "</td></tr></table>"; + } + }, + grid: { + x: { + show: false + } + }, + axis: { + x: { + type: 'timeseries', + tick: { + count: 2, + show: false, + format: "%Y", + outer: false + } + }, + y: { + show: false + } + }, + legend: { + show: false + }, + bar: { + width: 1 + } + }); +} +//]]></script><script type="text/javascript"> +_qevents.push( { qacct:"p-77H27_lnOeCCI"} ); +</script> +<noscript> +<div style="display: none;"> +<img src="https://pixel.quantserve.com/pixel/p-77H27_lnOeCCI.gif" height="1" width="1" alt="Quantcast"/> +</div> +</noscript> +</body></html>
refactor
refactor dict urban
a1c7efd24f824c9ee0be11ae115d75dd74f20e50
2018-06-07 16:53:37
CRIMX
fix(content): animation toggle on word editor
false
diff --git a/src/content/components/WordEditorPortal/index.tsx b/src/content/components/WordEditorPortal/index.tsx index 7d2cb5215..313d1b430 100644 --- a/src/content/components/WordEditorPortal/index.tsx +++ b/src/content/components/WordEditorPortal/index.tsx @@ -2,7 +2,6 @@ import React from 'react' import ReactDOM from 'react-dom' import PortalFrame from '@/components/PortalFrame' import WordEditor, { WordEditorProps } from '../WordEditor' -import { SelectionInfo } from '@/_helpers/selection' import { getWordsByText } from '@/_helpers/record-manager' import { Omit } from '@/typings/helpers' import CSSTransition from 'react-transition-group/CSSTransition' @@ -99,6 +98,8 @@ export default class WordEditorPortal extends React.Component<WordEditorPortalPr timeout={500} mountOnEnter={true} unmountOnExit={true} + enter={isAnimation} + exit={isAnimation} onExited={this.unmountEL} > {this.renderEditor}
fix
animation toggle on word editor
e15fbddbf54503d78cdf21a545392370686a31a0
2018-12-03 16:59:35
CRIMX
perf(dicts): only load necessary styles
false
diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index d1d4238e0..9f596fdfc 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -61,6 +61,14 @@ const entries = fs.readdirSync(paths.appSrc) const entriesWithHTML = entries.map(({name, dirPath}) => ({name, dirPath, template: path.join(dirPath, 'index.html')})) .filter(({template}) => fs.existsSync(template)) + +// add dictionary styles +const dictStyleEntries = {} +fs.readdirSync(path.join(paths.appSrc, 'components/dictionaries')).forEach(name => { + if (name === 'helpers.ts') { return } + dictStyleEntries[`dicts/${name}`] = path.join(paths.appSrc, 'components/dictionaries', name, '_style.scss') +}) + // This is the production configuration. // It compiles slowly and is focused on producing a fast and minimal bundle. // The development configuration is different and lives in a separate file. @@ -73,11 +81,13 @@ module.exports = { // In production, we only want to load the polyfills and the app code. entry: entries.reduce((result, {name, dirPath}) => { const names = fs.readdirSync(dirPath) - const indexFile = names.find(name => /index\.((t|j)sx?)$/.test(name)) + const indexFile = names.find(name => /index\.(ts|tsx|js|jsx|css|scss)$/.test(name)) if (!indexFile) { throw new Error(`Missing entry file for ${dirPath}`) } - result[name] = [require.resolve('./polyfills'), path.join(dirPath, indexFile)] + result[name] = indexFile.endsWith('css') + ? path.join(dirPath, indexFile) + : [require.resolve('./polyfills'), path.join(dirPath, indexFile)] return result - }, {}), + }, dictStyleEntries), output: { // The build folder. path: paths.appBuild, diff --git a/scripts/build.js b/scripts/build.js index 7774d4e40..34917bd56 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -169,7 +169,11 @@ function generateByBrowser () { filter: file => !/[\\\/]+\./.test(file), }), // project files - ...files.map(file => fs.copy(file.path, path.join(dest, file.name))) + ...files.map(file => fs.copy(file.path, path.join(dest, file.name), { + dereference: true, + // remove js files for css only chunks + filter: file => !/[\\\/]+(panel(-internal)?|dicts[\\\/]+[^\\\/]+)\.js(\.map)?$/.test(file) + })) ]) })).then(() => Promise.all(files.map(file => // clean up files diff --git a/src/components/dictionaries/google/_style.scss b/src/components/dictionaries/google/_style.scss new file mode 100644 index 000000000..e0611a68e --- /dev/null +++ b/src/components/dictionaries/google/_style.scss @@ -0,0 +1 @@ +@import '../../MachineTrans/_style'; diff --git a/src/components/dictionaries/liangan/_style.scss b/src/components/dictionaries/liangan/_style.scss new file mode 100644 index 000000000..d1ca9fc3e --- /dev/null +++ b/src/components/dictionaries/liangan/_style.scss @@ -0,0 +1 @@ +@import '../guoyu/_style'; diff --git a/src/components/dictionaries/sogou/_style.scss b/src/components/dictionaries/sogou/_style.scss new file mode 100644 index 000000000..e0611a68e --- /dev/null +++ b/src/components/dictionaries/sogou/_style.scss @@ -0,0 +1 @@ +@import '../../MachineTrans/_style'; diff --git a/src/content/components/DictPanel/index.tsx b/src/content/components/DictPanel/index.tsx index 3610ee894..96f544841 100644 --- a/src/content/components/DictPanel/index.tsx +++ b/src/content/components/DictPanel/index.tsx @@ -259,6 +259,9 @@ export class DictPanel extends React.Component<DictPanelProps & { t: Translation }) })} </div> + {dictionaries.active.map(id => + <link key={id} rel='stylesheet' href={browser.runtime.getURL(`/dicts/${id}.css`)} /> + )} </div> ) } diff --git a/src/panel-internal/panel-internal.scss b/src/panel-internal/index.scss similarity index 91% rename from src/panel-internal/panel-internal.scss rename to src/panel-internal/index.scss index d74f429c1..075b776a6 100644 --- a/src/panel-internal/panel-internal.scss +++ b/src/panel-internal/index.scss @@ -23,4 +23,4 @@ h5, .h5, h6, .h6 { font-size: 0.83em; } -@import '../panel/panel'; +@import '../panel/index' diff --git a/src/panel-internal/index.ts b/src/panel-internal/index.ts deleted file mode 100644 index dac84d7fd..000000000 --- a/src/panel-internal/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import './panel-internal.scss' - -const req = require['context']('@/components/dictionaries', true, /\.scss$/) -req.keys().forEach(req) diff --git a/src/panel/panel.scss b/src/panel/index.scss similarity index 93% rename from src/panel/panel.scss rename to src/panel/index.scss index 085c35d7f..4c049e461 100644 --- a/src/panel/panel.scss +++ b/src/panel/index.scss @@ -17,5 +17,4 @@ @import '../content/components/MenuBar/style'; @import '../content/components/DictItem/style'; -@import '../components/MachineTrans/style'; @import '../components/Speaker/style'; diff --git a/src/panel/index.ts b/src/panel/index.ts deleted file mode 100644 index b9b71e82d..000000000 --- a/src/panel/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import './panel.scss' - -const req = require['context']('@/components/dictionaries', true, /\.scss$/) -req.keys().forEach(req)
perf
only load necessary styles
a07519ddb66010f283493d811c2cb89a6a001e55
2018-04-16 17:36:11
CRIMX
feat(content): add content script entry
false
diff --git a/src/content/index.tsx b/src/content/index.tsx new file mode 100644 index 000000000..5ca5820cc --- /dev/null +++ b/src/content/index.tsx @@ -0,0 +1,17 @@ +import React from 'react' +import ReactDOM from 'react-dom' +import { Provider } from 'react-redux' +import SaladBowlContainer from './containers/SaladBowlContainer' +import createStore from './redux/create' + +import './content.scss' + +const store = createStore() + +const App = () => ( + <Provider store={store}> + <SaladBowlContainer /> + </Provider> +) + +ReactDOM.render(<App />, document.createElement('div'))
feat
add content script entry
ff92a03b7736467f1000315e5d40382a0e206628
2020-07-28 10:57:05
crimx
refactor(sync-services): add webdav proxy warning
false
diff --git a/src/background/sync-manager/services/webdav/_locales/en.ts b/src/background/sync-manager/services/webdav/_locales/en.ts index 3bc3d8e56..6df5464b9 100644 --- a/src/background/sync-manager/services/webdav/_locales/en.ts +++ b/src/background/sync-manager/services/webdav/_locales/en.ts @@ -4,7 +4,8 @@ export const locale: typeof _locale = { title: 'WebDAV Word Syncing', error: { dir: 'Incorrect "Saladict" directory on server.', - download: 'Download failed. Unable to connect WebDAV Server.', + download: + 'Download failed. Unable to connect WebDAV Server. If browser proxy is enabled please adjust rules to bypass WebDAV server.', internal: 'Unable to save settings.', missing: 'Missing "Saladict" directory on server.', mkcol: diff --git a/src/background/sync-manager/services/webdav/_locales/zh-CN.ts b/src/background/sync-manager/services/webdav/_locales/zh-CN.ts index 4db0d90e2..310950f13 100644 --- a/src/background/sync-manager/services/webdav/_locales/zh-CN.ts +++ b/src/background/sync-manager/services/webdav/_locales/zh-CN.ts @@ -2,7 +2,8 @@ export const locale = { title: 'WebDAV 单词同步', error: { dir: '服务器上“Saladict”目录格式不正确,请检查。', - download: '下载失败。无法访问 WebDAV 服务器。', + download: + '下载失败。无法访问 WebDAV 服务器。如启用了浏览器代理请调整规则,不要代理 WebDAV 服务器。', internal: '无法保存。', missing: '服务器上缺少“Saladict”目录。', mkcol: '无法在服务器创建“Saladict”目录。请手动在服务器上创建。', diff --git a/src/background/sync-manager/services/webdav/_locales/zh-TW.ts b/src/background/sync-manager/services/webdav/_locales/zh-TW.ts index 70b6cb5f2..27692c39e 100644 --- a/src/background/sync-manager/services/webdav/_locales/zh-TW.ts +++ b/src/background/sync-manager/services/webdav/_locales/zh-TW.ts @@ -4,7 +4,8 @@ export const locale: typeof _locale = { title: 'WebDAV 單字同步', error: { dir: '伺服器上“Saladict”目錄格式不正確,請檢查。', - download: '下載失敗。無法訪問 WebDAV 伺服器。', + download: + '下載失敗。無法訪問 WebDAV 伺服器。如啟用了瀏覽器代理請調整規則,不要代理 WebDAV 伺服器。', internal: '無法儲存。', missing: '伺服器上缺少“Saladict”目錄。', mkcol: '無法在伺服器建立“Saladict”目錄。請手動在伺服器上建立。',
refactor
add webdav proxy warning
2ff9fa23cf4c9de25f1f8e78b150b4436a0bba9c
2018-10-10 22:07:07
CRIMX
feat(panel): add quick search standalone panel
false
diff --git a/src/_helpers/injectSaladictInternal.ts b/src/_helpers/injectSaladictInternal.ts index b79b4018e..a78188f99 100644 --- a/src/_helpers/injectSaladictInternal.ts +++ b/src/_helpers/injectSaladictInternal.ts @@ -17,8 +17,10 @@ export function injectSaladictInternal (noInjectContentCSS?: boolean) { document.body.appendChild($scriptSelection) document.body.appendChild($scriptContent) - if (!noInjectContentCSS) { - document.head.appendChild($styleContent) + if (document.head) { + if (!noInjectContentCSS) { + document.head.appendChild($styleContent) + } + document.head.appendChild($stylePanel) } - document.head.appendChild($stylePanel) } diff --git a/src/app-config/index.ts b/src/app-config/index.ts index c685c086d..6edd4f665 100644 --- a/src/app-config/index.ts +++ b/src/app-config/index.ts @@ -154,6 +154,15 @@ export interface AppConfigMutable { /** where should the dict appears */ tripleCtrlLocation: TCDirection + /** should panel be in a standalone window */ + tripleCtrlStandalone: boolean + + /** standalone panel height */ + tripleCtrlHeight: number + + /** should standalone panel response to page selection */ + tripleCtrlPageSel: boolean + /** browser action preload source */ baPreload: PreloadSource @@ -282,6 +291,10 @@ export function appConfigFactory (id?: string): AppConfig { tripleCtrlLocation: TCDirection.center, + tripleCtrlStandalone: true, + tripleCtrlHeight: 600, + tripleCtrlPageSel: true, + baPreload: 'clipboard' as PreloadSource, baAuto: false, diff --git a/src/app-config/merge-config.ts b/src/app-config/merge-config.ts index d793b5415..1ce4bbd33 100644 --- a/src/app-config/merge-config.ts +++ b/src/app-config/merge-config.ts @@ -61,6 +61,9 @@ export function mergeConfig (oldConfig: AppConfig, baseConfig?: AppConfig): AppC merge('tripleCtrlPreload', val => val === '' || val === 'clipboard' || val === 'selection') mergeBoolean('tripleCtrlAuto') merge('tripleCtrlLocation', val => val >= 0 && val <= 8) + mergeBoolean('tripleCtrlStandalone') + mergeNumber('tripleCtrlHeight') + mergeBoolean('tripleCtrlPageSel') merge('baPreload', val => val === '' || val === 'clipboard' || val === 'selection') mergeBoolean('baAuto') diff --git a/src/background/server.ts b/src/background/server.ts index 211420a6a..0b196ec62 100644 --- a/src/background/server.ts +++ b/src/background/server.ts @@ -2,7 +2,7 @@ import { message, openURL } from '@/_helpers/browser-api' import { play } from './audio-manager' import { isInNotebook, saveWord, deleteWords, getWordsByText, getWords } from './database' import { chsToChz } from '@/_helpers/chs-to-chz' -import { appConfigFactory, AppConfig } from '@/app-config' +import { appConfigFactory, AppConfig, TCDirection } from '@/app-config' import { createActiveConfigStream } from '@/_helpers/config-manager' import { DictSearchResult } from '@/typings/server' import { timeout, timer } from '@/_helpers/promise-more' @@ -17,14 +17,18 @@ import { MsgDeleteWords, MsgGetWordsByText, MsgGetWords, + MsgQueryQSPanelResponse, + MsgQSPanelIDChanged, } from '@/typings/message' let config = appConfigFactory() - createActiveConfigStream().subscribe(newConfig => config = newConfig) message.self.initServer() +/** is a standalone panel running */ +let qsPanelID: number | false = false + // background script as transfer station message.addListener((data, sender: browser.runtime.MessageSender) => { switch (data.type) { @@ -39,6 +43,11 @@ message.addListener((data, sender: browser.runtime.MessageSender) => { case MsgType.RequestCSS: return injectCSS(sender) + case MsgType.QueryQSPanel: + return Promise.resolve(qsPanelID !== false) as Promise<MsgQueryQSPanelResponse> + case MsgType.OpenQSPanel: + return openQSPanel() + case MsgType.IsInNotebook: return isInNotebook(data as MsgIsInNotebook) case MsgType.SaveWord: @@ -63,6 +72,89 @@ message.addListener((data, sender: browser.runtime.MessageSender) => { } }) +browser.windows.onRemoved.addListener(async winID => { + if (winID === qsPanelID) { + qsPanelID = false + ;(await browser.tabs.query({})).forEach(tab => { + if (tab.id && tab.windowId !== winID) { + message.send<MsgQSPanelIDChanged>(tab.id, { + type: MsgType.QSPanelIDChanged, + flag: qsPanelID !== false, + }) + } + }) + } +}) + +async function openQSPanel (): Promise<void> { + if (qsPanelID !== false) { + await browser.windows.update(qsPanelID, { focused: true }) + } else { + const { tripleCtrlLocation, panelWidth, tripleCtrlHeight } = config + let left = 10 + let top = 30 + switch (tripleCtrlLocation) { + case TCDirection.center: + left = (screen.width - panelWidth) / 2 + top = (screen.height - tripleCtrlHeight) / 2 + break + case TCDirection.top: + left = (screen.width - panelWidth) / 2 + top = 30 + break + case TCDirection.right: + left = screen.width - panelWidth - 30 + top = (screen.height - tripleCtrlHeight) / 2 + break + case TCDirection.bottom: + left = (screen.width - panelWidth) / 2 + top = screen.height - 10 + break + case TCDirection.left: + left = 10 + top = (screen.height - tripleCtrlHeight) / 2 + break + case TCDirection.topLeft: + left = 10 + top = 30 + break + case TCDirection.topRight: + left = screen.width - panelWidth - 30 + top = 30 + break + case TCDirection.bottomLeft: + left = 10 + top = screen.height - 10 + break + case TCDirection.bottomRight: + left = screen.width - panelWidth - 30 + top = screen.height - 10 + break + } + + const qsPanelWin = await browser.windows.create({ + type: 'popup', + url: browser.runtime.getURL('quick-search.html'), + width: config.panelWidth, + height: config.tripleCtrlHeight, + left: Math.round(left), + top: Math.round(top), + }) + + if (qsPanelWin.id) { + qsPanelID = qsPanelWin.id + ;(await browser.tabs.query({})).forEach(tab => { + if (tab.id && tab.windowId !== qsPanelID) { + message.send<MsgQSPanelIDChanged>(tab.id, { + type: MsgType.QSPanelIDChanged, + flag: qsPanelID !== false, + }) + } + }) + } + } +} + function createTab (data: MsgOpenUrl): Promise<void> { return openURL( data.placeholder diff --git a/src/content/components/DictPanelPortal/index.tsx b/src/content/components/DictPanelPortal/index.tsx index 858b75983..1c41d44d5 100644 --- a/src/content/components/DictPanelPortal/index.tsx +++ b/src/content/components/DictPanelPortal/index.tsx @@ -8,6 +8,9 @@ import PortalFrame from '@/components/PortalFrame' const isSaladictInternalPage = !!window.__SALADICT_INTERNAL_PAGE__ const isSaladictPopupPage = !!window.__SALADICT_POPUP_PAGE__ const isSaladictOptionsPage = !!window.__SALADICT_OPTIONS_PAGE__ +const isSaladictQuickSearchPage = !!window.__SALADICT_QUICK_SEARCH_PAGE__ + +const isStandalonePage = isSaladictPopupPage || isSaladictQuickSearchPage export type DictPanelPortalDispatchers = Omit< DictPanelDispatchers, @@ -42,7 +45,7 @@ interface DictPanelState { export default class DictPanelPortal extends React.Component<DictPanelPortalProps, DictPanelState> { isMount = false - root = isSaladictPopupPage + root = isStandalonePage ? document.getElementById('frame-root') as HTMLDivElement : document.body el = document.createElement('div') @@ -87,7 +90,7 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp mountEL = () => { // body could be replaced by other scripts - if (!isSaladictPopupPage) { this.root = document.body } + if (!isStandalonePage) { this.root = document.body } this.root.appendChild(this.el) this.isMount = true } @@ -95,7 +98,7 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp unmountEL = () => { this.frame = null // body could be replaced by other scripts - if (!isSaladictPopupPage) { this.root = document.body } + if (!isStandalonePage) { this.root = document.body } this.root.removeChild(this.el) this.isMount = false } @@ -201,10 +204,8 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp style.setProperty('left', `${x}px`, 'important') style.setProperty('top', `${y}px`, 'important') - if (!isSaladictPopupPage) { - style.setProperty('width', width + 'px', 'important') - style.setProperty('height', height + 'px', 'important') - } + style.setProperty('width', width + 'px', 'important') + style.setProperty('height', height + 'px', 'important') } handlePanelEntered = (node: HTMLElement) => { @@ -214,16 +215,14 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp style.setProperty('left', `${x}px`, 'important') style.setProperty('top', `${y}px`, 'important') - if (!isSaladictPopupPage) { - style.setProperty('width', width + 'px', 'important') - style.setProperty('height', height + 'px', 'important') - } + style.setProperty('width', width + 'px', 'important') + style.setProperty('height', height + 'px', 'important') } frameDidMount (iframe: HTMLIFrameElement) { if (process.env.NODE_ENV === 'production') { const doc = iframe.contentDocument - if (doc && !doc.head.innerHTML.includes('panel.css')) { + if (doc && doc.head && !doc.head.innerHTML.includes('panel.css')) { const $link = doc.createElement('link') $link.type = 'text/css' $link.rel = 'stylesheet' @@ -234,15 +233,13 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp } componentDidUpdate () { - if (this.frame) { + if (this.frame && !isStandalonePage) { const { x, y, width, height } = this.props.panelRect const style = this.frame.style style.setProperty('left', `${x}px`, 'important') style.setProperty('top', `${y}px`, 'important') - if (!isSaladictPopupPage) { - style.setProperty('width', width + 'px', 'important') - style.setProperty('height', height + 'px', 'important') - } + style.setProperty('width', width + 'px', 'important') + style.setProperty('height', height + 'px', 'important') } } @@ -301,7 +298,7 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp this.mountEL() } - const shouldAnimate = isAnimation && !isSaladictPopupPage + const shouldAnimate = isAnimation && !isStandalonePage return ReactDOM.createPortal( <div @@ -318,8 +315,8 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp timeout={500} mountOnEnter={true} unmountOnExit={true} - appear={isSaladictOptionsPage || isSaladictPopupPage} - onEnter={shouldAnimate ? this.handlePanelEnter : this.handlePanelEntered} + appear={isSaladictOptionsPage || isStandalonePage} + onEnter={shouldAnimate ? this.handlePanelEnter : undefined} onEntered={shouldAnimate ? this.handlePanelEntered : undefined} onExited={this.unmountEL} > diff --git a/src/content/components/MenuBar/index.tsx b/src/content/components/MenuBar/index.tsx index 1f720ed01..661d9b55b 100644 --- a/src/content/components/MenuBar/index.tsx +++ b/src/content/components/MenuBar/index.tsx @@ -8,6 +8,8 @@ import CSSTransition from 'react-transition-group/CSSTransition' const isSaladictOptionsPage = !!window.__SALADICT_OPTIONS_PAGE__ const isSaladictPopupPage = !!window.__SALADICT_POPUP_PAGE__ +const isSaladictQuickSearchPage = !!window.__SALADICT_QUICK_SEARCH_PAGE__ +const isStandalonePage = isSaladictPopupPage || isSaladictQuickSearchPage export interface MenuBarDispatchers { readonly handleDragAreaMouseDown: (e: React.MouseEvent<HTMLDivElement>) => any @@ -112,16 +114,18 @@ export default class MenuBar extends React.PureComponent<MenuBarProps, MenuBarSt handleIconSettingsKeyUp = (e: React.KeyboardEvent<HTMLButtonElement>) => { if (e.key === 'ArrowDown') { - // event object is pooled + // React event object is pooled const doc = e.currentTarget.ownerDocument - this.setState({ isShowProfilePanel: true }, () => { - const firstProfile = doc.getElementById( - this.props.configProfiles[0].id - ) - if (firstProfile) { - firstProfile.focus() - } - }) + if (doc) { + this.setState({ isShowProfilePanel: true }, () => { + const firstProfile = doc.getElementById( + this.props.configProfiles[0].id + ) + if (firstProfile) { + firstProfile.focus() + } + }) + } } } @@ -164,11 +168,14 @@ export default class MenuBar extends React.PureComponent<MenuBarProps, MenuBarSt const { configProfiles } = this.props const curID = configProfiles.findIndex(({ id }) => id === e.currentTarget.id) const nextID = ((configProfiles.length + curID) + offset) % configProfiles.length - const nextProfile = e.currentTarget.ownerDocument.getElementById( - configProfiles[nextID].id - ) - if (nextProfile) { - nextProfile.focus() + const doc = e.currentTarget.ownerDocument + if (doc) { + const nextProfile = doc.getElementById( + configProfiles[nextID].id + ) + if (nextProfile) { + nextProfile.focus() + } } } @@ -223,7 +230,7 @@ export default class MenuBar extends React.PureComponent<MenuBarProps, MenuBarSt componentDidMount () { if (!this.props.isShowMtaBox && - (isSaladictPopupPage || this.props.isTripleCtrl || this.props.activeDicts.length <= 0) && + (isStandalonePage || this.props.isTripleCtrl || this.props.activeDicts.length <= 0) && this.inputRef.current ) { this.inputRef.current.focus() @@ -234,7 +241,7 @@ export default class MenuBar extends React.PureComponent<MenuBarProps, MenuBarSt componentDidUpdate (prevProps: MenuBarProps) { if (prevProps.searchBoxText === this.props.searchBoxText && !this.props.isShowMtaBox && - (isSaladictPopupPage || this.props.isTripleCtrl || this.props.activeDicts.length <= 0) && + (isStandalonePage || this.props.isTripleCtrl || this.props.activeDicts.length <= 0) && this.inputRef.current ) { this.inputRef.current.focus() @@ -411,7 +418,7 @@ export default class MenuBar extends React.PureComponent<MenuBarProps, MenuBarSt <button className='panel-MenuBar_Btn' onClick={this.handleIconPinClick} - disabled={isSaladictOptionsPage || isSaladictPopupPage} + disabled={isSaladictOptionsPage || isStandalonePage} > <svg className='panel-MenuBar_Icon' @@ -424,7 +431,7 @@ export default class MenuBar extends React.PureComponent<MenuBarProps, MenuBarSt <button className='panel-MenuBar_Btn' onClick={this.handleIconCloseClick} - disabled={isSaladictOptionsPage || isSaladictPopupPage} + disabled={isSaladictOptionsPage || isStandalonePage} > <svg className='panel-MenuBar_Icon' diff --git a/src/content/redux/modules/dictionaries.ts b/src/content/redux/modules/dictionaries.ts index 46c861f1c..cc86aeef2 100644 --- a/src/content/redux/modules/dictionaries.ts +++ b/src/content/redux/modules/dictionaries.ts @@ -1,18 +1,20 @@ import { message } from '@/_helpers/browser-api' -import { DictID, appConfigFactory, AppConfig } from '@/app-config' +import { DictID, appConfigFactory, AppConfig, PreloadSource } from '@/app-config' import isEqual from 'lodash/isEqual' import { saveWord } from '@/_helpers/record-manager' import { getDefaultSelectionInfo, SelectionInfo, isSameSelection } from '@/_helpers/selection' import { isContainChinese, isContainEnglish, testerPunct, isContainMinor, testerChinese, testJapanese, testKorean } from '@/_helpers/lang-check' -import { MsgType, MsgFetchDictResult } from '@/typings/message' -import { StoreState, DispatcherThunk, Dispatcher } from './index' -import { isInNotebook, tripleCtrlPressed, searchBoxUpdate } from './widget' +import { MsgType, MsgFetchDictResult, MsgQSPanelSearchText } from '@/typings/message' +import { StoreState, DispatcherThunk } from './index' +import { isInNotebook, searchBoxUpdate } from './widget' const isSaladictOptionsPage = !!window.__SALADICT_OPTIONS_PAGE__ const isSaladictInternalPage = !!window.__SALADICT_INTERNAL_PAGE__ const isSaladictPopupPage = !!window.__SALADICT_POPUP_PAGE__ +const isSaladictQuickSearchPage = !!window.__SALADICT_QUICK_SEARCH_PAGE__ -const isNoSearchHistoryPage = isSaladictInternalPage && !isSaladictPopupPage +const isStandalonePage = isSaladictPopupPage || isSaladictQuickSearchPage +const isNoSearchHistoryPage = isSaladictInternalPage && !isStandalonePage /*-----------------------------------------------*\ Action Type @@ -259,12 +261,14 @@ export function addSearchHistory ( export function startUpAction (): DispatcherThunk { return (dispatch, getState) => { - if (!isSaladictPopupPage && !isSaladictOptionsPage) { - listenTrpleCtrl(dispatch, getState) - } - if (isSaladictPopupPage) { - popupPageInit(dispatch, getState) + const { baPreload, baAuto } = getState().config + dispatch(summonedPanelInit(baPreload, baAuto, true)) + } else if (isSaladictQuickSearchPage) { + /** From other tabs */ + message.addListener<MsgQSPanelSearchText>(MsgType.QSPanelSearchText, ({ info }) => { + dispatch(searchText({ info })) + }) } } } @@ -368,61 +372,32 @@ export function searchText ( } } -function listenTrpleCtrl ( - dispatch: Dispatcher, - getState: () => StoreState, -) { - message.self.addListener(MsgType.TripleCtrl, () => { - const state = getState() - if (state.widget.shouldPanelShow) { return } - - dispatch(tripleCtrlPressed()) - - const { tripleCtrlPreload, tripleCtrlAuto } = state.config - - const fetchInfo = tripleCtrlPreload === 'selection' - ? Promise.resolve({ ...state.selection.selectionInfo }) - : tripleCtrlPreload === 'clipboard' - ? message.send({ type: MsgType.GetClipboard }) - .then(text => getDefaultSelectionInfo({ text, title: 'From Clipboard' })) - : Promise.resolve(getDefaultSelectionInfo()) +export function summonedPanelInit ( + preload: PreloadSource, + autoSearch: boolean, + isStandalone: boolean, +): DispatcherThunk { + return (dispatch, getState) => { + if (!preload) { return } - fetchInfo.then(info => { - if (tripleCtrlAuto && info.text) { - dispatch(searchText({ info })) - } else { - dispatch(restoreDicts()) - dispatch(searchBoxUpdate({ text: info.text, index: 0 })) - } - }) - }) -} + const state = getState() -function popupPageInit ( - dispatch: Dispatcher, - getState: () => StoreState, -) { - const state = getState() - const { - baAuto, - baPreload, - } = state.config - - if (baPreload) { - const fetchInfo = baPreload === 'selection' - ? browser.tabs.query({ active: true, currentWindow: true }) - .then(tabs => { - if (tabs.length > 0 && tabs[0].id != null) { - return message.send(tabs[0].id as number, { type: MsgType.PreloadSelection }) - } - return null - }) + const fetchInfo = preload === 'selection' + ? isStandalone + ? browser.tabs.query({ active: true, currentWindow: true }) + .then(tabs => { + if (tabs.length > 0 && tabs[0].id != null) { + return message.send(tabs[0].id as number, { type: MsgType.PreloadSelection }) + } + return null + }) + : Promise.resolve({ ...state.selection.selectionInfo }) : message.send({ type: MsgType.GetClipboard }) .then(text => getDefaultSelectionInfo({ text, title: 'From Clipboard' })) fetchInfo.then(info => { if (info) { - if (baAuto && info.text) { + if (autoSearch && info.text) { dispatch(searchText({ info })) } else { dispatch(restoreDicts()) diff --git a/src/content/redux/modules/widget.ts b/src/content/redux/modules/widget.ts index 049490c9d..ff383d69a 100644 --- a/src/content/redux/modules/widget.ts +++ b/src/content/redux/modules/widget.ts @@ -3,15 +3,27 @@ import { StoreState, DispatcherThunk, Dispatcher } from './index' import appConfigFactory, { TCDirection, DictID } from '@/app-config' import { message, storage } from '@/_helpers/browser-api' import { createConfigIDListStream } from '@/_helpers/config-manager' -import { MsgType, MsgTempDisabledState, MsgEditWord, MsgOpenUrl, MsgFetchDictResult } from '@/typings/message' -import { searchText, restoreDicts } from '@/content/redux/modules/dictionaries' +import { searchText, restoreDicts, summonedPanelInit } from '@/content/redux/modules/dictionaries' import { SelectionInfo, getDefaultSelectionInfo } from '@/_helpers/selection' import { Mutable } from '@/typings/helpers' import { reflect } from '@/_helpers/promise-more' import { MachineTranslateResult } from '@/components/dictionaries/helpers' +import { + MsgType, + MsgTempDisabledState, + MsgEditWord, + MsgOpenUrl, + MsgFetchDictResult, + MsgQSPanelIDChanged, + MsgQueryQSPanel, + MsgQueryQSPanelResponse, + MsgQSPanelSearchText, +} from '@/typings/message' const isSaladictOptionsPage = !!window.__SALADICT_OPTIONS_PAGE__ const isSaladictPopupPage = !!window.__SALADICT_POPUP_PAGE__ +const isSaladictQuickSearchPage = !!window.__SALADICT_QUICK_SEARCH_PAGE__ +const isStandalonePage = isSaladictPopupPage || isSaladictQuickSearchPage const panelHeaderHeight = 30 + 12 // menu bar + multiline search box button @@ -33,6 +45,7 @@ export const enum ActionType { PANEL_CORDS = 'widget/PANEL_CORDS', CONFIG_PROFILE_lIST = 'widget/CONFIG_PROFILE_lIST', SEARCH_BOX_UPDATE = 'dicts/SEARCH_BOX_UPDATE', + QS_PANEL_TABID_CHANGED = 'dicts/QS_PANEL_TABID_CHANGED', } /*-----------------------------------------------*\ @@ -56,6 +69,7 @@ interface WidgetPayload { text: string index: number } + [ActionType.QS_PANEL_TABID_CHANGED]: boolean } /*-----------------------------------------------*\ @@ -69,6 +83,8 @@ export type WidgetState = { readonly isFav: boolean /** is called by triple ctrl */ readonly isTripleCtrl: boolean + /** is a standalone panel running */ + readonly isQSPanel: boolean readonly shouldBowlShow: boolean readonly shouldPanelShow: boolean readonly panelRect: { @@ -102,9 +118,10 @@ export const initState: WidgetState = { isTempDisabled: false, isPinned: isSaladictOptionsPage, isFav: false, - isTripleCtrl: false, + isTripleCtrl: isSaladictQuickSearchPage, + isQSPanel: false, shouldBowlShow: false, - shouldPanelShow: isSaladictPopupPage || isSaladictOptionsPage, + shouldPanelShow: isStandalonePage || isSaladictOptionsPage, panelRect: { x: isSaladictOptionsPage ? window.innerWidth - _initConfig.panelWidth - 30 @@ -112,12 +129,8 @@ export const initState: WidgetState = { y: isSaladictOptionsPage ? window.innerHeight * (1 - _initConfig.panelMaxHeightRatio) / 2 : 0, - width: isSaladictPopupPage - ? Math.min(750, _initConfig.panelWidth) - : _initConfig.panelWidth, - height: isSaladictPopupPage - ? 400 - : panelHeaderHeight + width: _initConfig.panelWidth, + height: panelHeaderHeight, }, bowlRect: { x: 0, @@ -393,6 +406,27 @@ export const reducer: WidgetReducer = { } } }, + [ActionType.QS_PANEL_TABID_CHANGED] (state, flag) { + if (state.widget.isQSPanel === flag) { + return state + } + + const widget = { + ...state.widget, + isQSPanel: flag, + } + + // hide panel on otehr pages + if (flag && state.config.tripleCtrlPageSel) { + widget.shouldBowlShow = false + widget.shouldPanelShow = false + } + + return { + ...state, + widget, + } + }, } export default reducer @@ -458,6 +492,10 @@ export function searchBoxUpdate (payload: WidgetPayload[ActionType.SEARCH_BOX_UP return ({ type: ActionType.SEARCH_BOX_UPDATE, payload }) } +export function QSPanelIDChanged (payload: WidgetPayload[ActionType.QS_PANEL_TABID_CHANGED]): Action<ActionType.QS_PANEL_TABID_CHANGED> { + return ({ type: ActionType.QS_PANEL_TABID_CHANGED, payload }) +} + /*-----------------------------------------------*\ Side Effects \*-----------------------------------------------*/ @@ -468,6 +506,13 @@ export function startUpAction (): DispatcherThunk { return (dispatch, getState) => { listenTempDisable(dispatch, getState) + if (isSaladictQuickSearchPage) { + const { config } = getState() + dispatch(summonedPanelInit(config.tripleCtrlPreload, config.tripleCtrlAuto, true)) + } else if (!isSaladictPopupPage && !isSaladictOptionsPage) { + listenTrpleCtrl(dispatch, getState) + } + createConfigIDListStream().subscribe(async idlist => { const profiles: Array<{ id: string, name: string }> = [] for (let i = 0; i < idlist.length; i++) { @@ -486,6 +531,15 @@ export function startUpAction (): DispatcherThunk { dispatch(updateConfigProfiles(profiles)) }) + if (!isSaladictQuickSearchPage) { + message.send<MsgQueryQSPanel, MsgQueryQSPanelResponse>({ type: MsgType.QueryQSPanel }) + .then(flag => dispatch(QSPanelIDChanged((flag)))) + + message.addListener<MsgQSPanelIDChanged>(MsgType.QSPanelIDChanged, ({ flag }) => { + dispatch(QSPanelIDChanged((flag))) + }) + } + // close panel and word editor on esc message.self.addListener(MsgType.EscapeKey, () => { dispatch(closePanel()) @@ -543,7 +597,7 @@ export function requestFavWord (): DispatcherThunk { const { config, dictionaries, widget } = getState() const word = { ...dictionaries.searchHistory[0], date: Date.now() } if (config.editOnFav) { - if (isSaladictPopupPage) { + if (isStandalonePage) { // Not enough space to open word editor on popup page try { message.send<MsgOpenUrl>({ @@ -630,7 +684,7 @@ export function addToNotebook (info: SelectionInfo | recordManager.Word): Dispat export function updateItemHeight (id: DictID | '_mtabox', height: number): DispatcherThunk { return (dispatch, getState) => { - if (isSaladictPopupPage) { + if (isStandalonePage) { return } @@ -655,12 +709,13 @@ export function updateItemHeight (id: DictID | '_mtabox', height: number): Dispa export function newSelection (): DispatcherThunk { return (dispatch, getState) => { - const state = getState() - const { selectionInfo, dbClick, ctrlKey, instant, mouseX, mouseY, self } = state.selection + const { widget, selection, config } = getState() + + const { selectionInfo, dbClick, ctrlKey, instant, mouseX, mouseY, self } = selection if (self) { // inside dict panel - const { direct, double, ctrl } = state.config.panelMode + const { direct, double, ctrl } = config.panelMode const { text, context } = selectionInfo if (text && ( instant || @@ -681,17 +736,26 @@ export function newSelection (): DispatcherThunk { return } - if (isSaladictPopupPage || isSaladictOptionsPage) { return } + // standalone panel takes control + if (!widget.isQSPanel && config.tripleCtrlPageSel) { + message.send<MsgQSPanelSearchText>({ + type: MsgType.QSPanelSearchText, + info: selection.selectionInfo, + }) + return + } - const isActive = state.config.active && !state.widget.isTempDisabled + if (isStandalonePage || isSaladictOptionsPage) { return } - const { direct, ctrl, double, icon } = state.config.mode + const isActive = config.active && !widget.isTempDisabled + + const { direct, ctrl, double, icon } = config.mode const { isPinned, shouldPanelShow: lastShouldPanelShow, panelRect: lastPanelRect, bowlRect: lastBowlRect, - } = state.widget + } = widget const shouldPanelShow = Boolean( isPinned || @@ -702,7 +766,7 @@ export function newSelection (): DispatcherThunk { (ctrl && ctrlKey) || instant )) || - isSaladictPopupPage + isStandalonePage ) const shouldBowlShow = Boolean( @@ -714,7 +778,7 @@ export function newSelection (): DispatcherThunk { !(double && dbClick) && !(ctrl && ctrlKey) && !instant && - !isSaladictPopupPage + !isStandalonePage ) const bowlRect = shouldBowlShow @@ -734,14 +798,14 @@ export function newSelection (): DispatcherThunk { mouseX, mouseY, lastPanelRect.width, - isSaladictPopupPage ? 400 : panelHeaderHeight, + panelHeaderHeight, ) } dispatch(newSelectionAction(newWidgetPartial)) // should search text? - const { pinMode } = state.config + const { pinMode } = config if (shouldPanelShow && selectionInfo.text && ( !isPinned || pinMode.direct || @@ -762,6 +826,23 @@ export function newSelection (): DispatcherThunk { Helpers \*-----------------------------------------------*/ +function listenTrpleCtrl ( + dispatch: Dispatcher, + getState: () => StoreState, +) { + message.self.addListener(MsgType.TripleCtrl, () => { + const { config, widget } = getState() + if (widget.shouldPanelShow || !widget.isQSPanel) { return } + + if (config.tripleCtrlStandalone) { + message.send({ type: MsgType.OpenQSPanel }) + } else { + dispatch(tripleCtrlPressed()) + dispatch(summonedPanelInit(config.tripleCtrlPreload, config.tripleCtrlAuto, false)) + } + }) +} + /** From popup page */ function listenTempDisable ( dispatch: Dispatcher, @@ -788,12 +869,12 @@ function _restoreWidget (widget: WidgetState['widget']): Mutable<WidgetState['wi return { ...widget, isPinned: isSaladictOptionsPage, - isTripleCtrl: false, - shouldPanelShow: isSaladictPopupPage || isSaladictOptionsPage, + isTripleCtrl: isSaladictQuickSearchPage, + shouldPanelShow: isStandalonePage || isSaladictOptionsPage, shouldBowlShow: false, panelRect: { ...widget.panelRect, - height: isSaladictPopupPage ? 400 : panelHeaderHeight, + height: panelHeaderHeight, }, } } @@ -825,12 +906,13 @@ function _getPanelRectFromEvent ( width: number, height: number, ): WidgetState['widget']['panelRect'] { - if (isSaladictPopupPage) { + if (isStandalonePage) { + // these values are ignored anyway return { x: 0, y: 0, - width: Math.min(width, 750), - height: 400, + width, + height, } } diff --git a/src/quick-search/index.html b/src/quick-search/index.html new file mode 100644 index 000000000..a0efd2495 --- /dev/null +++ b/src/quick-search/index.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html> + <head> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <meta charset="utf-8"> + <title>Saladict</title> + <script src="./static/browser-polyfill.min.js"></script> + </head> + <body> + <div id="frame-root"></div> + <!-- built files will be auto injected --> + </body> +</html> diff --git a/src/quick-search/index.ts b/src/quick-search/index.ts new file mode 100644 index 000000000..c9eee5e6a --- /dev/null +++ b/src/quick-search/index.ts @@ -0,0 +1,7 @@ +import { injectSaladictInternal } from '@/_helpers/injectSaladictInternal' + +import './quick-search.scss' + +window.__SALADICT_INTERNAL_PAGE__ = true +window.__SALADICT_QUICK_SEARCH_PAGE__ = true +injectSaladictInternal(true) // inject panel AFTER flags are set diff --git a/src/quick-search/quick-search.scss b/src/quick-search/quick-search.scss new file mode 100644 index 000000000..0496e4f19 --- /dev/null +++ b/src/quick-search/quick-search.scss @@ -0,0 +1,16 @@ +html, +body, +#frame-root, +.saladict-DIV, +.saladict-DictPanel { + position: static; + height: 100%; + margin: 0; + padding: 0; + // hide white spaces + font-size: 0; +} + +#frame-root { + overflow: hidden; +} diff --git a/src/typings/global.d.ts b/src/typings/global.d.ts index 359771f36..f287553b6 100644 --- a/src/typings/global.d.ts +++ b/src/typings/global.d.ts @@ -10,6 +10,7 @@ interface Window { __SALADICT_INTERNAL_PAGE__?: boolean __SALADICT_OPTIONS_PAGE__?: boolean __SALADICT_POPUP_PAGE__?: boolean + __SALADICT_QUICK_SEARCH_PAGE__?: boolean // Options page __SALADICT_LAST_SEARCH__?: string diff --git a/src/typings/message.ts b/src/typings/message.ts index c196df49c..d45177a32 100644 --- a/src/typings/message.ts +++ b/src/typings/message.ts @@ -12,6 +12,16 @@ export const enum MsgType { /** is dict panel pinned? */ IsPinned, + /** is a standalone panel running? */ + QSPanelIDChanged, + + /** query background for standalone panel appearance */ + QueryQSPanel, + + OpenQSPanel, + + QSPanelSearchText, + /** Mouse down, selection maybe empty */ Selection, @@ -178,6 +188,22 @@ export interface MsgIsPinned { isPinned: boolean } +export interface MsgQSPanelIDChanged { + type: MsgType.QSPanelIDChanged + flag: boolean +} + +export interface MsgQueryQSPanel { + type: MsgType.QueryQSPanel +} + +export interface MsgQSPanelSearchText { + type: MsgType.QSPanelSearchText + info: SelectionInfo +} + +export type MsgQueryQSPanelResponse = boolean + export interface MsgQueryPanelState { type: MsgType.QueryPanelState, /** object path, default returns the whole state */
feat
add quick search standalone panel
ebdd7debb9b5e0f85333fad8eee7eac9ca69e595
2020-05-24 15:44:38
crimx
refactor(dicts): update select styles
false
diff --git a/src/components/dictionaries/cobuild/View.tsx b/src/components/dictionaries/cobuild/View.tsx index ae17d860c..193548c2c 100644 --- a/src/components/dictionaries/cobuild/View.tsx +++ b/src/components/dictionaries/cobuild/View.tsx @@ -58,11 +58,7 @@ function renderCol(result: COBUILDColResult) { return ( <div className="dictCOBUILD-ColEntry"> {result.sections.length > 0 && ( - <select - style={{ width: '100%', marginBottom: '0.5em' }} - value={iSec} - onChange={e => setiSec(e.currentTarget.value)} - > + <select value={iSec} onChange={e => setiSec(e.currentTarget.value)}> {result.sections.map((section, i) => ( <option key={section.id} value={i}> {section.type} diff --git a/src/components/dictionaries/hjdict/View.tsx b/src/components/dictionaries/hjdict/View.tsx index a5a303885..4bf6ec862 100644 --- a/src/components/dictionaries/hjdict/View.tsx +++ b/src/components/dictionaries/hjdict/View.tsx @@ -51,7 +51,6 @@ function LangSelect(props: ViewPorps<HjdictResult>) { return ( <select - style={{ width: '100%' }} value={langCode} onChange={e => props.searchText({ diff --git a/src/components/dictionaries/jukuu/View.tsx b/src/components/dictionaries/jukuu/View.tsx index 3e9a81dd2..5eb43320e 100644 --- a/src/components/dictionaries/jukuu/View.tsx +++ b/src/components/dictionaries/jukuu/View.tsx @@ -9,7 +9,6 @@ export const DictJukuu: FC<ViewPorps<JukuuResult>> = props => { return ( <> <select - style={{ width: '100%' }} onChange={e => { if (e.target.value) { searchText<JukuuPayload>({ diff --git a/src/components/dictionaries/macmillan/View.tsx b/src/components/dictionaries/macmillan/View.tsx index 5180c043d..b2233332c 100644 --- a/src/components/dictionaries/macmillan/View.tsx +++ b/src/components/dictionaries/macmillan/View.tsx @@ -30,7 +30,6 @@ function renderSelect( ) { return result.relatedEntries.length > 0 ? ( <select - style={{ width: '100%' }} value={''} onChange={e => { if (e.currentTarget.value) { @@ -57,7 +56,6 @@ function renderLex(result: MacmillanResultLex, select: ReactNode) { return ( <section onClick={onEntryClick}> {select} - <h1 className="dictMacmillan-Title">{result.title}</h1> <header className="dictMacmillan-Header"> {result.ratting! > 0 && <StarRates rate={result.ratting} />} <span className="dictMacmillan-Header_Info"> diff --git a/src/components/dictionaries/naver/View.tsx b/src/components/dictionaries/naver/View.tsx index 337c74c9a..60d6bc6cf 100644 --- a/src/components/dictionaries/naver/View.tsx +++ b/src/components/dictionaries/naver/View.tsx @@ -5,7 +5,6 @@ import { ViewPorps } from '@/components/dictionaries/helpers' export const DictNaver: FC<ViewPorps<NaverResult>> = props => ( <> <select - style={{ width: '100%' }} onChange={e => props.searchText({ id: 'naver', diff --git a/src/components/dictionaries/renren/View.tsx b/src/components/dictionaries/renren/View.tsx index 38596cd5a..a3160d8a0 100644 --- a/src/components/dictionaries/renren/View.tsx +++ b/src/components/dictionaries/renren/View.tsx @@ -75,7 +75,6 @@ export const DictRenren: FC<ViewPorps<RenrenResult>> = ({ result }) => { return ( <> <select - className="dictRenren-Selector" onChange={e => setSlide(Number(e.currentTarget.value) || 0)} value={slide} > diff --git a/src/components/dictionaries/renren/_style.shadow.scss b/src/components/dictionaries/renren/_style.shadow.scss index dba222487..cbb1910f8 100644 --- a/src/components/dictionaries/renren/_style.shadow.scss +++ b/src/components/dictionaries/renren/_style.shadow.scss @@ -1,7 +1,3 @@ -.dictRenren-Selector { - width: 100%; -} - .dictRenren-Slide { overflow: hidden; position: relative; diff --git a/src/components/dictionaries/wikipedia/View.tsx b/src/components/dictionaries/wikipedia/View.tsx index b8a20ad6a..bc6e667b9 100644 --- a/src/components/dictionaries/wikipedia/View.tsx +++ b/src/components/dictionaries/wikipedia/View.tsx @@ -34,11 +34,7 @@ export const DictWikipedia: FC<ViewPorps<WikipediaResult>> = ({ let langSelector: ReactNode = null if (langList && langList.length > 0) { langSelector = ( - <select - className="dictWikipedia-LangSelector" - onChange={handleSelectChanged} - defaultValue={''} - > + <select onChange={handleSelectChanged} defaultValue={''}> <option key="" value=""> {t('chooseLang')} </option> diff --git a/src/components/dictionaries/wikipedia/_style.shadow.scss b/src/components/dictionaries/wikipedia/_style.shadow.scss index e9167a34c..b8436fd23 100644 --- a/src/components/dictionaries/wikipedia/_style.shadow.scss +++ b/src/components/dictionaries/wikipedia/_style.shadow.scss @@ -1,9 +1,5 @@ @import '@/_sass_global/_reset.scss'; -.dictWikipedia-LangSelector { - width: 100%; -} - .dictWikipedia-LangSelectorBtn { margin: 0.2em 0 1em; padding: 0.1em 0.2em; diff --git a/src/content/components/DictItem/DictItemContent.shadow.scss b/src/content/components/DictItem/DictItemContent.shadow.scss index 6eb2dd8c9..ddb6595de 100644 --- a/src/content/components/DictItem/DictItemContent.shadow.scss +++ b/src/content/components/DictItem/DictItemContent.shadow.scss @@ -7,4 +7,45 @@ -webkit-font-smoothing: antialiased; text-rendering: optimizelegibility; font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Hiragino Sans GB W3", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif; + + select { + display: block; + box-sizing: border-box; + width: 100%; + margin: 0 0 0.5em 0; + padding: .6em 1.4em .5em .8em; + border-radius: .5em; + font-size: var(--panel-font-size); + font-weight: 700; + line-height: 1.3; + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; + -moz-appearance: none; + border: 1px solid rgba(133, 133, 133, 0.28); + box-shadow: 0 1px 0 1px rgba(0,0,0,.04); + color: var(--color-font-grey); + background-color: transparent; + background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%235caf9e%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'); + background-repeat: no-repeat, repeat; + background-position: right .7em top 50%, 0 0; + background-size: .65em auto, 100%; + + &::-ms-expand { + display: none; + } + + &:hover { + border-color: rgba(133, 133, 133, 0.48); + } + + &:focus { + border-color: rgba(59, 153, 252, .7);; + outline: none; + } + + option { + font-weight: normal; + } + } }
refactor
update select styles
db30b437ccd89d082955cf1a32766fcc0dab40d3
2018-10-11 21:09:56
CRIMX
chore(release): 6.17.0
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index 6303f5c80..080a727b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,28 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +<a name="6.17.0"></a> +# [6.17.0](https://github.com/crimx/ext-saladict/compare/v6.16.1...v6.17.0) (2018-10-11) + + +### Bug Fixes + +* **background:** fix typing ([8cc0760](https://github.com/crimx/ext-saladict/commit/8cc0760)) +* **dicts:** update google tk ([c36d15d](https://github.com/crimx/ext-saladict/commit/c36d15d)), closes [#212](https://github.com/crimx/ext-saladict/issues/212) +* **locales:** typo ([4934e7c](https://github.com/crimx/ext-saladict/commit/4934e7c)) +* **panel:** only load on top frame ([c9a8bf7](https://github.com/crimx/ext-saladict/commit/c9a8bf7)), closes [#214](https://github.com/crimx/ext-saladict/issues/214) +* **panel:** prevent context menu on right click ([dd2b5ce](https://github.com/crimx/ext-saladict/commit/dd2b5ce)) +* **selection:** input and textarea selection on Firefox ([dfa95f7](https://github.com/crimx/ext-saladict/commit/dfa95f7)) + + +### Features + +* **command:** add command for quick search panel ([dc34810](https://github.com/crimx/ext-saladict/commit/dc34810)) +* **menu:** add google cn page translate ([f549fdc](https://github.com/crimx/ext-saladict/commit/f549fdc)) +* **panel:** add quick search standalone panel ([2ff9fa2](https://github.com/crimx/ext-saladict/commit/2ff9fa2)) + + + <a name="6.16.1"></a> ## [6.16.1](https://github.com/crimx/ext-saladict/compare/v6.16.0...v6.16.1) (2018-10-02) diff --git a/package.json b/package.json index ff7f7711d..8a5a6cef8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "saladict", - "version": "6.16.1", + "version": "6.17.0", "description": "Chrome extension and Firefox WebExtension, inline translator powered by mutiple online dictionaries", "private": true, "scripts": {
chore
6.17.0
007aed09300211b4bba1d7211c1b1727ec8b638e
2018-05-06 16:26:25
CRIMX
refactor(options): finish up options page
false
diff --git a/src/options/OptDicts.vue b/src/options/OptDicts.vue index 1b8504fa9..da1f24328 100644 --- a/src/options/OptDicts.vue +++ b/src/options/OptDicts.vue @@ -116,7 +116,7 @@ export default { const dictsPanelInfo = {} Object.keys(appConfigFactory().dicts.all).forEach(id => { dictsPanelInfo[id] = { - favicon: browser.runtime.getURL(`assets/dicts/${id}.png`), + favicon: require('@/components/dictionaries/' + id + '/favicon.png'), height: 0 } }) diff --git a/src/options/Options.vue b/src/options/Options.vue index 3e9fc59e4..3393f918e 100644 --- a/src/options/Options.vue +++ b/src/options/Options.vue @@ -79,6 +79,7 @@ import OptContextMenu from './OptContextMenu' export default { name: 'options', store: ['config', 'newVersionAvailable'], + props: ['searchText'], data () { return { text: 'salad', @@ -98,23 +99,6 @@ export default { }, 400) } }, - searchText () { - clearTimeout(this.searchTextTimeout) - this.searchTextTimeout = setTimeout(() => { - message.self.send({ - type: 'SEARCH_TEXT', - selectionInfo: { - text: this.text, - context: '', - title: document.title, - url: document.URL, - favicon: browser.runtime.getURL('assets/icon-16.png'), - trans: '', - note: '' - } - }) - }, 2000) - }, handleReset () { this.$refs.alert.$emit('show', { title: this.$t('opt:reset_modal_title'), @@ -148,16 +132,12 @@ export default { this.isShowConfigUpdated = false }, 1500) }) + .then(() => { + clearTimeout(this.__searchTextTimeout) + this.__searchTextTimeout = setTimeout(() => this.searchText(), 2000) + }) } }, - 'config.dicts': { - deep: true, - handler () { this.searchText() } - }, - 'config.autopron': { - deep: true, - handler () { this.searchText() } - } }, computed: { panelHeight () { @@ -190,17 +170,8 @@ export default { SocialMedia, AlertModal }, - beforeCreate () { - message.self.addListener('PANEL_READY', (data, sender, sendResponse) => { - sendResponse({noSearchHistory: true}) - }) - }, mounted () { - // monitor search text - message.self.addListener('FETCH_DICT_RESULT', (data, sender) => { - this.text = data.text - }) - setTimeout(() => this.searchText(), 0) + setTimeout(() => this.searchText(), 1000) } } </script> diff --git a/src/options/index.ts b/src/options/index.ts index 65177789e..ada408fdf 100644 --- a/src/options/index.ts +++ b/src/options/index.ts @@ -1,10 +1,11 @@ import Vue from 'vue' import VueI18Next from '@panter/vue-i18next' import VueStash from 'vue-stash' -import App from './Options' -import { storage } from '../_helpers/browser-api' -import checkUpdate from '../_helpers/check-update' -import { appConfigFactory } from '../app-config' +import App from './Options.vue' +import { message, storage } from '@/_helpers/browser-api' +import checkUpdate from '@/_helpers/check-update' +import { getDefaultSelectionInfo } from '@/_helpers/selection' +import { appConfigFactory, AppConfigMutable } from '@/app-config' import i18next from 'i18next' import i18nLoader from '@/_helpers/i18n' @@ -12,6 +13,13 @@ import commonLocles from '@/_locales/common' import dictsLocles from '@/_locales/dicts' import optionsLocles from '@/_locales/options' import contextLocles from '@/_locales/context' +import { MsgType, MsgSelection } from '@/typings/message' + +window['__SALADICT_INTERNAL_PAGE__'] = true +window['__SALADICT_OPTIONS_PAGE__'] = true +window['__SALADICT_LAST_SEARCH__'] = 'salad' + +injectPanel() Vue.use(VueStash) Vue.use(VueI18Next) @@ -25,21 +33,24 @@ const i18n = new VueI18Next(i18nLoader({ ctx: contextLocles, }, 'common')) -console.log('sddddddffffff') - storage.sync.get('config') .then(({ config }) => { - console.log('x') const store = { - config: config || appConfigFactory(), + config: (config || appConfigFactory()) as AppConfigMutable, unlock: false, newVersionAvailable: false } + // tslint:disable new Vue({ el: '#app', i18n, - render: h => h(App), + render (h) { + return h(App, { + // @ts-ignore + props: { searchText: this.searchText } + }) + }, data: { store }, created () { storage.sync.addListener('config', changes => { @@ -50,16 +61,46 @@ storage.sync.get('config') } }) - storage.sync.get('unlock', ({ unlock }) => { - this.store.unlock = Boolean(unlock) - storage.sync.addListener('unlock', changes => { - this.store.unlock = changes.unlock.newValue + storage.sync.get('unlock') + .then(({ unlock }) => { + this.store.unlock = Boolean(unlock) + storage.sync.addListener('unlock', changes => { + this.store.unlock = changes.unlock.newValue + }) }) - }) checkUpdate().then(({ isAvailable }) => { this.store.newVersionAvailable = isAvailable }) + }, + methods: { + searchText () { + if (window.innerWidth > 1024) { + message.self.send<MsgSelection>({ + type: MsgType.Selection, + selectionInfo: getDefaultSelectionInfo({ + text: window['__SALADICT_LAST_SEARCH__'] + }), + mouseX: window.innerWidth - this.store.config.panelWidth - 110, + mouseY: window.innerHeight * (1 - this.store.config.panelMaxHeightRatio) / 2 + 50, + dbClick: false, + ctrlKey: false, + }) + } + } } }) }) + +function injectPanel () { + const $script = document.createElement('script') + $script.src = './content.js' + $script.type = 'text/javascript' + + const $style = document.createElement('link') + $style.href = './content.css' + $style.rel = 'stylesheet' + + document.body.appendChild($script) + document.body.appendChild($style) +}
refactor
finish up options page
d611ec6d5ef1b8c292f3f7be075453dbbff0a1b1
2019-08-04 16:28:51
crimx
refactor(dicts): jukuu
false
diff --git a/src/components/dictionaries/jukuu/View.tsx b/src/components/dictionaries/jukuu/View.tsx index d2bf9f0d9..3e9a81dd2 100644 --- a/src/components/dictionaries/jukuu/View.tsx +++ b/src/components/dictionaries/jukuu/View.tsx @@ -1,41 +1,47 @@ -import React from 'react' +import React, { FC } from 'react' import { JukuuResult, JukuuPayload, JukuuLang } from './engine' import { ViewPorps } from '@/components/dictionaries/helpers' +import { useTranslate } from '@/_helpers/i18n' -export default class DictJukuu extends React.PureComponent<ViewPorps<JukuuResult>> { - handleSelectChanged = (e: React.ChangeEvent<HTMLSelectElement>) => { - if (e.target.value) { - this.props.searchText<JukuuPayload>({ - id: 'jukuu', - payload: { - lang: e.target.value as JukuuLang - }, - }) - } - } - - render () { - const { result, t } = this.props - return ( - <> - <select - style={{ width: '100%' }} - onChange={this.handleSelectChanged} - > - <option value='zheng' selected={result.lang === 'zheng'}>{t('dict:jukuu_lang-zheng')}</option> - <option value='engjp' selected={result.lang === 'engjp'}>{t('dict:jukuu_lang-engjp')}</option> - <option value='zhjp' selected={result.lang === 'zhjp'}>{t('dict:jukuu_lang-zhjp')}</option> - </select> - <ul className='dictJukuu-Sens'> - {result.sens.map((sen, i) => ( - <li key={i} className='dictJukuu-Sen'> - <p dangerouslySetInnerHTML={{ __html: sen.trans }} /> - <p className='dictJukuu-Ori'>{sen.original}</p> - <p className='dictJukuu-Src'>{sen.src}</p> - </li> - ))} - </ul> - </> - ) - } +export const DictJukuu: FC<ViewPorps<JukuuResult>> = props => { + const { result, searchText } = props + const { t } = useTranslate('dicts') + return ( + <> + <select + style={{ width: '100%' }} + onChange={e => { + if (e.target.value) { + searchText<JukuuPayload>({ + id: 'jukuu', + payload: { + lang: e.target.value as JukuuLang + } + }) + } + }} + > + <option value="zheng" selected={result.lang === 'zheng'}> + {t('jukuu.options.lang-zheng')} + </option> + <option value="engjp" selected={result.lang === 'engjp'}> + {t('jukuu.options.lang-engjp')} + </option> + <option value="zhjp" selected={result.lang === 'zhjp'}> + {t('jukuu.options.lang-zhjp')} + </option> + </select> + <ul className="dictJukuu-Sens"> + {result.sens.map((sen, i) => ( + <li key={i} className="dictJukuu-Sen"> + <p dangerouslySetInnerHTML={{ __html: sen.trans }} /> + <p className="dictJukuu-Ori">{sen.original}</p> + <p className="dictJukuu-Src">{sen.src}</p> + </li> + ))} + </ul> + </> + ) } + +export default DictJukuu diff --git a/src/components/dictionaries/jukuu/_style.scss b/src/components/dictionaries/jukuu/_style.shadow.scss similarity index 76% rename from src/components/dictionaries/jukuu/_style.scss rename to src/components/dictionaries/jukuu/_style.shadow.scss index 74f459adb..e14053aa0 100644 --- a/src/components/dictionaries/jukuu/_style.scss +++ b/src/components/dictionaries/jukuu/_style.shadow.scss @@ -1,3 +1,6 @@ +@import '@/_sass_global/_reset.scss'; +@import '@/components/Speaker/Speaker.scss'; + .dictJukuu-Sens { padding-left: 20px; diff --git a/src/components/dictionaries/jukuu/engine.ts b/src/components/dictionaries/jukuu/engine.ts index 3a9479bf7..848daae87 100644 --- a/src/components/dictionaries/jukuu/engine.ts +++ b/src/components/dictionaries/jukuu/engine.ts @@ -2,18 +2,18 @@ import { fetchDirtyDOM } from '@/_helpers/fetch-dom' import { HTMLString, getText, - getInnerHTMLBuilder, + getInnerHTML, handleNoResult, handleNetWorkError, SearchFunction, GetSrcPageFunction, removeChildren, + DictSearchResult } from '../helpers' -import { DictSearchResult } from '@/typings/server' export type JukuuLang = 'engjp' | 'zhjp' | 'zheng' -function getUrl (text: string, lang: JukuuLang) { +function getUrl(text: string, lang: JukuuLang) { text = encodeURIComponent(text.replace(/\s+/g, '+')) switch (lang) { @@ -31,8 +31,6 @@ export const getSrcPage: GetSrcPageFunction = (text, config, profile) => { return getUrl(text, profile.dicts.all.jukuu.options.lang) } -const getInnerHTML = getInnerHTMLBuilder('http://www.jukuu.com') - interface JukuuTransItem { trans: HTMLString original: string @@ -50,22 +48,22 @@ export interface JukuuPayload { type JukuuSearchResult = DictSearchResult<JukuuResult> -export const search: SearchFunction<JukuuSearchResult, JukuuPayload> = ( - text, config, profile, payload +export const search: SearchFunction<JukuuResult, JukuuPayload> = ( + text, + config, + profile, + payload ) => { const lang = payload.lang || profile.dicts.all.jukuu.options.lang return fetchDirtyDOM(getUrl(text, lang)) .catch(handleNetWorkError) .then(handleDOM) - .then(sens => sens.length > 0 - ? { result: { lang, sens } } - : handleNoResult() + .then(sens => + sens.length > 0 ? { result: { lang, sens } } : handleNoResult() ) } -function handleDOM ( - doc: Document, -): JukuuTransItem[] { +function handleDOM(doc: Document): JukuuTransItem[] { return [...doc.querySelectorAll('tr.e')] .map($e => { const $trans = $e.lastElementChild @@ -82,11 +80,12 @@ function handleDOM ( const $src = $original.nextElementSibling return { - trans: getInnerHTML($trans), + trans: getInnerHTML('http://www.jukuu.com', $trans), original: getText($original), - src: $src && $src.classList.contains('s') - ? getText($src).replace(/^[\s-]*/, '') - : '' + src: + $src && $src.classList.contains('s') + ? getText($src).replace(/^[\s-]*/, '') + : '' } }) .filter((item): item is JukuuTransItem => Boolean(item && item.trans)) diff --git a/test/specs/components/dictionaries/jukuu/requests.mock.ts b/test/specs/components/dictionaries/jukuu/requests.mock.ts new file mode 100644 index 000000000..5833dadc7 --- /dev/null +++ b/test/specs/components/dictionaries/jukuu/requests.mock.ts @@ -0,0 +1,15 @@ +import { MockRequest } from '@/components/dictionaries/helpers' + +export const mockSearchTexts = ['love'] + +export const mockRequest: MockRequest = mock => { + mock + .onGet(/jukuu/) + .reply( + 200, + new DOMParser().parseFromString( + require(`raw-loader!./response/love.html`).default, + 'text/html' + ) + ) +}
refactor
jukuu
efc00ce7933433c3872bb5c2c18db4aea22fa283
2018-09-16 17:34:00
CRIMX
chore(release): 6.15.0
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index 22b463375..96ee1fec3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,24 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +<a name="6.15.0"></a> +# [6.15.0](https://github.com/crimx/ext-saladict/compare/v6.14.0...v6.15.0) (2018-09-16) + + +### Bug Fixes + +* **panel:** fix line breaking in English ([4b76760](https://github.com/crimx/ext-saladict/commit/4b76760)) +* **panel:** fix profile panel shows on hover ([4b96472](https://github.com/crimx/ext-saladict/commit/4b96472)) +* **popup:** fix body width ([5212b6a](https://github.com/crimx/ext-saladict/commit/5212b6a)) + + +### Features + +* **dicts:** add lang selection for machine translations ([739e5ea](https://github.com/crimx/ext-saladict/commit/739e5ea)) +* **panel:** enable searchText on dict result ([85ec153](https://github.com/crimx/ext-saladict/commit/85ec153)) + + + <a name="6.14.0"></a> # [6.14.0](https://github.com/crimx/ext-saladict/compare/v6.13.4...v6.14.0) (2018-09-11) diff --git a/package.json b/package.json index 407d05886..e7d6cd177 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "saladict", - "version": "6.14.0", + "version": "6.15.0", "description": "Chrome extension and Firefox WebExtension, inline translator powered by mutiple online dictionaries", "private": true, "scripts": {
chore
6.15.0
9f8a64d0cc48d0cbaf75fc2ee7f2ff5af44ae8f6
2018-07-08 00:37:39
CRIMX
refactor(components): update helpers
false
diff --git a/src/components/dictionaries/helpers.ts b/src/components/dictionaries/helpers.ts index 465dabefa..5f91616c5 100644 --- a/src/components/dictionaries/helpers.ts +++ b/src/components/dictionaries/helpers.ts @@ -21,7 +21,7 @@ export function getInnerHTMLThunk (host?: string) { if (!child) { return '' } const content = DOMPurify.sanitize(child['innerHTML'] || '') return host - ? content.replace(/href="\//g, 'href="' + host) + ? content.replace(/href="\/[^/]/g, 'href="' + host) : content } } @@ -40,6 +40,13 @@ export function getOuterHTMLThunk (host?: string) { } } +export function decodeHEX (text: string): string { + return text.replace( + /\\x([0-9A-Fa-f]{2})/g, + (m, p1) => String.fromCharCode(parseInt(p1, 16)), + ) +} + export function removeChild (parent: ParentNode, selector: string) { const child = parent.querySelector(selector) if (child) { child.remove() }
refactor
update helpers
26ab3c1806e3cb79778a2f1c3f51982d046d62f5
2018-05-22 08:35:09
CRIMX
chore(gitattributes): add linguist vendored
false
diff --git a/.gitattributes b/.gitattributes index b188ec313..08410e65a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,6 @@ *.min.js binary /public/** binary + +# For Github language details +/test/**/response/*.html linguist-vendored +/public/** linguist-vendored
chore
add linguist vendored
281f0b4056d7998fbf6dc99d8befa4fb39059f60
2018-04-21 10:57:04
CRIMX
refactor(content): type safe redux
false
diff --git a/src/content/redux/modules/config.ts b/src/content/redux/modules/config.ts index 6726acfa8..b54ee9f74 100644 --- a/src/content/redux/modules/config.ts +++ b/src/content/redux/modules/config.ts @@ -28,14 +28,22 @@ export default function reducer (state = appConfigFactory(), action): ConfigStat Action Creators \*-----------------------------------------------*/ +type Action = { type: Actions, payload?: any } + /** When app config is updated */ -export const newConfig = config => ({ type: Actions.NEW_CONFIG, payload: config }) +export function newConfig (config): Action { + return { type: Actions.NEW_CONFIG, payload: config } +} /*-----------------------------------------------*\ Side Effects \*-----------------------------------------------*/ -export function listenConfig () { +type Dispatcher = ( + dispatch: (action: Action) => any, +) => any + +export function listenConfig (): Dispatcher { return dispatch => { addAppConfigListener(({ config }) => dispatch(newConfig(config))) } diff --git a/src/content/redux/modules/dictionaries.ts b/src/content/redux/modules/dictionaries.ts index f4387f36d..5cce262da 100644 --- a/src/content/redux/modules/dictionaries.ts +++ b/src/content/redux/modules/dictionaries.ts @@ -6,7 +6,7 @@ import { Actions as ConfigActions } from './config' \*-----------------------------------------------*/ export const enum Actions { - UPDATE_HEIGHT = 'dicts/UPDATE_HEIGHT' + UPDATE_HEIGHT = 'dicts/UPDATE_HEIGHT', } /*-----------------------------------------------*\ @@ -49,10 +49,10 @@ export default function reducer (state = initState, action): DictionariesState { } return newState }, {}) - case Actions.UPDATE_HEIGHT: - const newState = {...state} - newState[action.payload.id].height = action.payload.height - return newState + case Actions.UPDATE_HEIGHT: { + const { id, height } = action.payload + return { ...state, [id]: { ...state[id], height } } + } default: return state } @@ -62,7 +62,9 @@ export default function reducer (state = initState, action): DictionariesState { Action Creators \*-----------------------------------------------*/ -export function newItemHeight (payload: { id: DictID, height: number }) { +type Action = { type: Actions, payload?: any } + +export function newItemHeight (payload: { id: DictID, height: number }): Action { return ({ type: Actions.UPDATE_HEIGHT, payload }) } diff --git a/src/content/redux/modules/selection.ts b/src/content/redux/modules/selection.ts index a665a7f43..31ad0da5f 100644 --- a/src/content/redux/modules/selection.ts +++ b/src/content/redux/modules/selection.ts @@ -45,14 +45,22 @@ export default function reducer (state = initState, action): SelectionState { Action Creators \*-----------------------------------------------*/ +type Action = { type: Actions, payload?: any } + /** When new selection is made */ -export const newSelection = selection => ({ type: Actions.NEW_SELECTION, payload: selection }) +export function newSelection (selection): Action { + return { type: Actions.NEW_SELECTION, payload: selection } +} /*-----------------------------------------------*\ Side Effects \*-----------------------------------------------*/ -export function listenSelection () { +type Dispatcher = ( + dispatch: (action: Action) => any, +) => any + +export function listenSelection (): Dispatcher { return dispatch => { message.self.addListener(MsgType.Selection, message => dispatch(newSelection(message))) } diff --git a/src/content/redux/modules/widget.ts b/src/content/redux/modules/widget.ts new file mode 100644 index 000000000..f9abdb66f --- /dev/null +++ b/src/content/redux/modules/widget.ts @@ -0,0 +1,84 @@ +import * as recordManager from '@/_helpers/record-manager' +import { SelectionInfo } from '@/_helpers/selection' +import { StoreState } from './index' + +/*-----------------------------------------------*\ + Actions +\*-----------------------------------------------*/ + +export const enum Actions { + PIN = 'widget/PIN', + FAV_WORD = 'dicts/FAV_WORD', +} + +/*-----------------------------------------------*\ + State +\*-----------------------------------------------*/ + +export type WidgetState = { + isPinned: boolean + isFav: boolean +} + +const initState: WidgetState = { + isPinned: false, + isFav: false +} + +export default function reducer (state = initState, action): WidgetState { + switch (action.type) { + case Actions.PIN: + return { ...state, isPinned: !state.isPinned } + case Actions.FAV_WORD: + return state.isFav === action.payload + ? state + : { ...state, isFav: action.payload } + default: + return state + } +} + +/*-----------------------------------------------*\ + Action Creators +\*-----------------------------------------------*/ + +type Action = { type: Actions, payload?: any } + +export function pinPanel (): Action { + return { type: Actions.PIN } +} + +export function favWord (payload: boolean): Action { + return ({ type: Actions.FAV_WORD, payload }) +} + +/*-----------------------------------------------*\ + Side Effects +\*-----------------------------------------------*/ + +type Dispatcher = ( + dispatch: (action: Action) => any, + getState: () => StoreState, +) => any + +export function addToNotebook (): Dispatcher { + return (dispatch, getState) => { + return recordManager.addToNotebook(getState().selection.selectionInfo) + .then(() => dispatch(favWord(true))) + } +} + +export function removeFromNotebook (): Dispatcher { + return (dispatch, getState) => { + return recordManager.removeFromNotebook(getState().selection.selectionInfo) + .then(() => dispatch(favWord(false))) + } +} + +/** Fire when panel is loaded */ +export function updateFaveInfo (): Dispatcher { + return (dispatch, getState) => { + return recordManager.isInNotebook(getState().selection.selectionInfo) + .then(flag => dispatch(favWord(flag))) + } +}
refactor
type safe redux
510924c185236c829da29b5ef57d5433efd0ebc6
2020-04-29 11:32:47
crimx
refactor: improve antd table
false
diff --git a/src/components/AntdRoot/_style.scss b/src/components/AntdRoot/_style.scss index 44bb52271..db3bbe3df 100644 --- a/src/components/AntdRoot/_style.scss +++ b/src/components/AntdRoot/_style.scss @@ -37,3 +37,13 @@ html { opacity: 1; } } + +// Fix incorrect antd pagination arrow position on Firefox +@-moz-document url-prefix() { + .ant-pagination-item-link > .anticon { + height: 100%; + display: flex; + justify-content: center; + align-items: center; + } +} diff --git a/src/components/WordPage/_style.scss b/src/components/WordPage/_style.scss index cd22fdbe2..7883fc502 100644 --- a/src/components/WordPage/_style.scss +++ b/src/components/WordPage/_style.scss @@ -1,11 +1,19 @@ body { overflow-y: scroll; + // Firefox table will always overflow + overflow-x: hidden; } textarea { resize: none; } +.ant-pagination { + float: none !important; + display: flex; + justify-content: center; +} + .wordpage-Container { max-width: 1920px; margin: 0 auto; diff --git a/src/components/WordPage/index.tsx b/src/components/WordPage/index.tsx index 24399b156..95c6e300f 100644 --- a/src/components/WordPage/index.tsx +++ b/src/components/WordPage/index.tsx @@ -46,6 +46,9 @@ export const WordPage: FC<WordPageProps> = props => { const [tableInfo, setTableInfo] = useState<TableInfo>(() => ({ dataSource: [], pagination: { + showSizeChanger: true, + showQuickJumper: true, + hideOnSinglePage: true, current: 1, pageSize: ITEMS_PER_PAGE, defaultPageSize: ITEMS_PER_PAGE,
refactor
improve antd table
2f0ce199ebaf3f0b844eda9a52fd8eb5308a2539
2020-04-04 19:33:27
crimx
refactor(wordpage): rewrite will cleaner architecture
false
diff --git a/src/components/WordPage/App.tsx b/src/components/WordPage/App.tsx deleted file mode 100644 index ab2e84dd3..000000000 --- a/src/components/WordPage/App.tsx +++ /dev/null @@ -1,515 +0,0 @@ -import React from 'react' -import { withTranslation, WithTranslation } from 'react-i18next' -import { - Layout, - Table, - Tooltip, - Button, - Dropdown, - Icon, - Menu, - Modal, - Input -} from 'antd' -import { - PaginationConfig, - TableRowSelection, - ColumnProps -} from 'antd/lib/table/interface' -import { ClickParam as MenuClickParam } from 'antd/lib/menu' - -import ExportModal from './ExportModal' - -import './_style.scss' - -import { DBArea, Word, getWords, deleteWords } from '@/_helpers/record-manager' -import { message } from '@/_helpers/browser-api' - -import { Observable, Subject } from 'rxjs' -import { - mergeMap, - audit, - mapTo, - share, - startWith, - debounceTime -} from 'rxjs/operators' - -const { Header, Content } = Layout - -const ITEMS_PER_PAGE = 100 - -export interface WordPageMainProps { - area: DBArea - locale: string -} - -export interface WordPageMainState { - searchText: string - words: Word[] - pagination: PaginationConfig - rowSelection: TableRowSelection<Word> - selectedRows: Word[] - loading: boolean - exportModalTitle: '' | 'all' | 'selected' | 'page' - exportModalWords: Word[] -} - -type WordPageMainInnerProps = WordPageMainProps & WithTranslation - -interface FetchDataConfig { - itemsPerPage?: number - pageNum?: number - filters: { [field: string]: string[] | undefined } - sortField?: string - sortOrder?: 'ascend' | 'descend' | false - searchText: string -} - -export class WordPageMain extends React.Component< - WordPageMainInnerProps, - WordPageMainState -> { - readonly tableColumns: ColumnProps<Word>[] - readonly emptyRow = [] - readonly contentRef = React.createRef<any>() - readonly fetchData$$: Subject<FetchDataConfig> - - lastFetchDataConfig: FetchDataConfig = { - searchText: '', - itemsPerPage: ITEMS_PER_PAGE, - pageNum: 1, - filters: {} - } - - constructor(props: WordPageMainInnerProps) { - super(props) - const { t, area } = props - - // eslint-disable-next-line prefer-const - let signal$: Observable<boolean> - this.fetchData$$ = new Subject<FetchDataConfig>() - const fetchData$$ = this.fetchData$$.pipe( - debounceTime(200), - // ignore values while fetchData is running - // if source emits any value during fetchData, - // retrieve the latest after fetchData is completed - audit(() => signal$), - mergeMap(config => this.fetchData(config)), - share() - ) - signal$ = fetchData$$.pipe( - mapTo(true), // last fetchData is completed - startWith(true as boolean) - ) - fetchData$$.subscribe() - - const colSelectionWidth = 48 - const colDateWidth = 150 - const colEditWidth = 80 - const fixedWidth = colSelectionWidth + colDateWidth + colEditWidth - const colTextWidth = `calc((100vw - ${fixedWidth}px) / 7)` - const restWidth = `calc((100vw - ${fixedWidth}px) * 2 / 7)` - - this.state = { - searchText: '', - words: [], - selectedRows: [], - pagination: { - current: 1, - pageSize: ITEMS_PER_PAGE, - defaultPageSize: ITEMS_PER_PAGE, - total: 0 - }, - rowSelection: { - selectedRowKeys: [], - columnWidth: colSelectionWidth, - onChange: this.handleSelectionChange - }, - loading: false, - exportModalTitle: '', - exportModalWords: [] - } - - this.tableColumns = [ - { - title: t('column.word'), - dataIndex: 'text', - key: 'text', - width: colTextWidth, - align: 'center', - sorter: true, - filters: [ - { text: t('filterWord.chs'), value: 'ch' }, - { text: t('filterWord.eng'), value: 'en' }, - { text: t('filterWord.word'), value: 'word' }, - { text: t('filterWord.phrase'), value: 'phra' } - ] - }, - { - title: t('column.source'), - dataIndex: 'context', - key: 'context', - width: restWidth, - align: 'center', - render: this.renderSource - }, - { - title: t('column.trans'), - dataIndex: 'trans', - key: 'trans', - width: restWidth, - render: (_, record) => this.renderText(record.trans) - }, - { - title: t('column.note'), - dataIndex: 'note', - key: 'note', - width: restWidth, - render: (_, record) => this.renderText(record.note) - }, - { - title: t('column.date'), - dataIndex: 'date', - key: 'date', - width: colDateWidth, - align: 'center', - sorter: true, - render: this.renderDate - }, - { - title: t(`column.${area === 'notebook' ? 'edit' : 'add'}`), - key: 'edit', - align: 'center', - render: this.renderEdit - } - ] - } - - fetchData = (config?: FetchDataConfig): Promise<void> => { - config = config || this.lastFetchDataConfig - this.lastFetchDataConfig = config - - this.setState({ loading: true }) - - return getWords(this.props.area, config).then(({ total, words }) => - this.setState({ - words, - loading: false, - pagination: { - ...this.state.pagination, - total - }, - selectedRows: [] - }) - ) - } - - handleTableChange = (pagination, filters, sorter) => { - window.scrollTo(0, 0) - - this.setState({ - pagination: { - ...this.state.pagination, - current: pagination.current || 1 - } - }) - - this.fetchData$$.next({ - itemsPerPage: (pagination && pagination.pageSize) || ITEMS_PER_PAGE, - pageNum: (pagination && pagination.current) || 1, - filters: filters, - sortField: sorter && sorter.field, - sortOrder: sorter && sorter.order, - searchText: this.state.searchText - }) - } - - handleSearchTextChange = (e: React.ChangeEvent<HTMLInputElement>) => { - const searchText = e.currentTarget.value - this.setState({ searchText }) - this.fetchData$$.next({ - ...this.lastFetchDataConfig, - searchText - }) - } - - handleSelectionChange = ( - selectedRowKeys: string[] | number[], - selectedRows - ) => { - this.setState({ - rowSelection: { - ...this.state.rowSelection, - selectedRowKeys - }, - selectedRows - }) - } - - handleBtnExportClick = ({ key }: MenuClickParam) => { - if (key === 'all') { - const config = { - ...this.lastFetchDataConfig, - itemsPerPage: undefined, - pageNum: undefined - } - getWords(this.props.area, config).then(({ total, words }) => { - if (process.env.NODE_ENV !== 'production') { - console.assert(words.length === total, 'get all words') - } - this.setState({ - exportModalTitle: key, - exportModalWords: words - }) - }) - } else if (key === 'selected') { - this.setState({ - exportModalTitle: key, - exportModalWords: this.state.selectedRows - }) - } else if (key === 'page') { - this.setState({ - exportModalTitle: key, - exportModalWords: this.state.words - }) - } else { - this.setState({ exportModalTitle: '' }) - } - } - - handleExportModalCancel = () => { - this.setState({ exportModalTitle: '' }) - } - - handleBtnDeleteClick = ({ key }: MenuClickParam) => { - if (key) { - const { t, area } = this.props - - Modal.confirm({ - title: t('delete'), - content: t(`delete.${key}`) + t('delete.confirm'), - okType: 'danger', - onOk: () => { - const keys = - key === 'selected' - ? (this.state.rowSelection.selectedRowKeys as number[]) - : key === 'page' - ? this.state.words.map(({ date }) => date) - : undefined - deleteWords(area, keys).then(() => this.fetchData$$.next()) - } - }) - } - } - - componentDidMount() { - this.fetchData$$.next() - - message.addListener('WORD_SAVED', () => { - this.fetchData$$.next() - }) - - // From popup page - const searchURL = new URL(document.URL) - const wordString = searchURL.searchParams.get('word') - if (wordString) { - try { - const word = JSON.parse(decodeURIComponent(wordString)) as Word - setTimeout(() => { - message.self.send({ - type: 'UPDATE_WORD_EDITOR_WORD', - payload: { word, translateCtx: true } - }) - }, 1000) - } catch (err) { - console.warn(err) - } - } - - const wordText = searchURL.searchParams.get('text') - if (wordText) { - const text = decodeURIComponent(wordText) - this.fetchData({ - ...this.lastFetchDataConfig, - filters: { - word: [text] - } - }) - this.setState({ searchText: text }) - } - } - - renderEdit = (_, record: Word): React.ReactNode => { - const { t, area } = this.props - return ( - <Button - key={record.date} - size="small" - onClick={() => { - const word = { - ...record, - // give it a new date if it's from history - date: area === 'notebook' ? record.date : Date.now() - } - // wait till selection ends - setTimeout(() => { - message.self.send({ - type: 'UPDATE_WORD_EDITOR_WORD', - payload: { word } - }) - }, 500) - }} - > - {t(`column.${area === 'notebook' ? 'edit' : 'add'}`)} - </Button> - ) - } - - renderText = (text?: string): React.ReactNode => { - if (!text) { - return '' - } - return text.split('\n').map((line, i) => <div key={i}>{line}</div>) - } - - renderSource = (_, record: Word): React.ReactNode => { - return ( - <React.Fragment key={record.date}> - {record.context && ( - <p className="wordpage-Record_Context">{record.context}</p> - )} - {record.title && ( - <p className="wordpage-Source_Footer"> - {record.favicon && ( - <img className="wordpage-Record_Favicon" src={record.favicon} /> - )} - <span className="wordpage-Record_Title">{record.title}</span> - </p> - )} - </React.Fragment> - ) - } - - renderDate = (datenum: number): React.ReactNode => { - const date = new Date(datenum) - const locale = this.props.locale - - return ( - <Tooltip - key={datenum} - placement="topRight" - title={date.toLocaleString(locale)} - > - {date.toLocaleDateString(locale)} - </Tooltip> - ) - } - - render() { - const { t, area } = this.props - - const { - searchText, - words, - selectedRows, - pagination, - rowSelection, - loading, - exportModalTitle, - exportModalWords - } = this.state - - return ( - <> - <Layout className="wordpage-Container"> - <Header className="wordpage-Header"> - <div className="wordpage-Title"> - <h1 className="wordpage-Title_head"> - {t(`title.${area}`)}{' '} - <small className="wordpage-Title_small"> - ({t('localonly')}) - </small> - </h1> - <div style={{ whiteSpace: 'nowrap' }}> - {(pagination.total as number) > 0 && ( - <span className="wordpage-Wordcount"> - {t(`wordCount.total`, { count: pagination.total })} - </span> - )} - {selectedRows.length > 0 && ( - <span className="wordpage-Wordcount"> - {t(`wordCount.selected`, { count: selectedRows.length })} - </span> - )} - </div> - </div> - <div style={{ marginLeft: 'auto', whiteSpace: 'nowrap' }}> - <Input - style={{ width: '15em' }} - placeholder="Search" - onChange={this.handleSearchTextChange} - value={searchText} - /> - <Dropdown - overlay={ - <Menu onClick={this.handleBtnExportClick}> - {selectedRows.length > 0 && ( - <Menu.Item key="selected"> - {t('export.selected')} - </Menu.Item> - )} - <Menu.Item key="page">{t('export.page')}</Menu.Item> - <Menu.Item key="all">{t('export.all')}</Menu.Item> - </Menu> - } - > - <Button style={{ marginLeft: 8 }}> - {t('export.title')} <Icon type="down" /> - </Button> - </Dropdown> - <Dropdown - overlay={ - <Menu onClick={this.handleBtnDeleteClick}> - {selectedRows.length > 0 && ( - <Menu.Item key="selected"> - {t('delete.selected')} - </Menu.Item> - )} - <Menu.Item key="page">{t('delete.page')}</Menu.Item> - <Menu.Item key="all">{t('delete.all')}</Menu.Item> - </Menu> - } - > - <Button type="danger" style={{ marginLeft: 8 }}> - {t('delete.title')} <Icon type="down" /> - </Button> - </Dropdown> - </div> - </Header> - <Content ref={this.contentRef} className="wordpage-Content"> - <Table - dataSource={words} - columns={this.tableColumns} - pagination={pagination} - rowSelection={rowSelection} - onChange={this.handleTableChange} - rowKey="date" - bordered={true} - loading={loading} - showHeader={true} - /> - </Content> - </Layout> - <ExportModal - locale={this.props.locale} - title={exportModalTitle} - rawWords={exportModalWords} - onCancel={this.handleExportModalCancel} - /> - </> - ) - } -} - -export default withTranslation()(WordPageMain) diff --git a/src/components/WordPage/ExportModal.tsx b/src/components/WordPage/ExportModal.tsx deleted file mode 100644 index 7c1efdda1..000000000 --- a/src/components/WordPage/ExportModal.tsx +++ /dev/null @@ -1,338 +0,0 @@ -import React from 'react' -import { withTranslation, WithTranslation } from 'react-i18next' -import { Layout, Modal, Table, Select, Switch } from 'antd' -import { ColumnProps } from 'antd/lib/table/interface' -import { Word, newWord } from '@/_helpers/record-manager' -import { storage } from '@/_helpers/browser-api' -import escapeHTML from 'lodash/escape' - -const { Content, Sider } = Layout - -export interface ExportModalProps { - locale: string - title: 'all' | 'selected' | 'page' | '' - rawWords: Word[] - onCancel: (e: React.MouseEvent<any>) => any -} - -type ExportModalInnerProps = ExportModalProps & WithTranslation - -interface ExportModalState { - lineBreak: '' | 'n' | 'p' | 'br' | 'space' - template: string - escape: boolean -} - -interface TemplateData { - plcholderL: string - contentL: string - plcholderR: string - contentR: string -} - -const keywordMatchStr = `%(${Object.keys(newWord()).join('|')})%` - -export class ExportModalBody extends React.Component< - ExportModalInnerProps, - ExportModalState -> { - readonly tplTableData: TemplateData[] - readonly tplTableCols: ColumnProps<TemplateData>[] - proccessedText = '' - - constructor(props) { - super(props) - const { t } = props - - this.state = { - template: '', - lineBreak: '', - escape: false - } - - this.tplTableData = [ - { - plcholderL: '%text%', - contentL: t('common:note.word'), - plcholderR: '%title%', - contentR: t('common:note.srcTitle') - }, - { - plcholderL: '%context%', - contentL: t('common:note.context'), - plcholderR: '%url%', - contentR: t('common:note.srcLink') - }, - { - plcholderL: '%note%', - contentL: t('common:note.note'), - plcholderR: '%favicon%', - contentR: t('common:note.srcFavicon') - }, - { - plcholderL: '%trans%', - contentL: t('common:note.trans'), - plcholderR: '%date%', - contentR: t('common:note.date') - } - ] - - this.tplTableCols = [ - { - title: t('export.placeholder'), - dataIndex: 'plcholderL', - key: 'plcholderL', - width: '25%', - align: 'center' - }, - { - title: t('export.gencontent'), - dataIndex: 'contentL', - key: 'contentL', - width: '25%', - align: 'center' - }, - { - title: t('export.placeholder'), - dataIndex: 'plcholderR', - key: 'plcholderR', - width: '25%', - align: 'center' - }, - { - title: t('export.gencontent'), - dataIndex: 'contentR', - key: 'contentR', - width: '25%', - align: 'center' - } - ] - } - - exportWords = () => { - browser.runtime.getPlatformInfo().then(({ os }) => { - const content = - os === 'win' - ? this.proccessedText.replace(/\r\n|\n/g, '\r\n') - : this.proccessedText - const file = new Blob([content], { type: 'text/plain;charset=utf-8' }) - const a = document.createElement('a') - a.style.display = 'none' - a.href = URL.createObjectURL(file) - a.download = `saladict-words-${Date.now()}.txt` - // firefox - a.target = '_blank' - document.body.appendChild(a) - - a.click() - }) - } - - handleTemplateChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => { - const template = e.currentTarget.value - this.setState({ template }) - storage.sync.set({ wordpageTemplate: template }) - } - - handleLinebreakChange = (value: ExportModalState['lineBreak']) => { - const escape = value === 'br' || value === 'p' ? true : this.state.escape - this.setState({ lineBreak: value, escape }) - storage.sync.set({ wordpageLineBreak: value }) - storage.local.set({ wordpageHTMLEscape: escape }) - } - - handleHTMLEscapeChange = (checked: boolean) => { - this.setState({ escape: checked }) - storage.local.set({ wordpageHTMLEscape: checked }) - } - - processWords = (): string => { - return this.props.rawWords - .map(word => - this.state.template.replace( - new RegExp(keywordMatchStr, 'g'), - (match, k) => { - switch (k) { - case 'date': - return new Date(word.date).toLocaleDateString(this.props.locale) - case 'trans': - case 'note': - case 'context': { - const text: string = this.state.escape - ? escapeHTML(word[k] || '') - : word[k] || '' - switch (this.state.lineBreak) { - case 'n': - return text.replace(/\n|\r\n/g, '\\n') - case 'br': - return text.replace(/\n|\r\n/g, '<br>') - case 'p': - return text - .split(/\n|\r\n/) - .map(line => `<p>${line}</p>`) - .join('') - case 'space': - return text.replace(/\n|\r\n/g, ' ') - default: - return text - } - } - default: - return word[k] || '' - } - } - ) - ) - .join('\n') - } - - componentDidMount() { - const { t } = this.props - - storage.sync - .get<{ - wordpageTemplate: string - wordpageLineBreak: ExportModalState['lineBreak'] - }>(['wordpageTemplate', 'wordpageLineBreak']) - .then(({ wordpageTemplate, wordpageLineBreak }) => { - const template = - wordpageTemplate || - `${t('common:note.word')}: %text%\n%trans%\n${t( - 'common:note.context' - )}: %context%\n` - this.setState({ - template, - lineBreak: wordpageLineBreak || '' - }) - }) - - storage.local - .get<{ - wordpageHTMLEscape: boolean - }>('wordpageHTMLEscape') - .then(({ wordpageHTMLEscape }) => { - if (wordpageHTMLEscape != null) { - this.setState({ escape: wordpageHTMLEscape }) - } - }) - } - - render() { - const { t } = this.props - - const { template } = this.state - - this.proccessedText = this.processWords() - - return ( - <Layout style={{ height: '70vh', maxHeight: 1000 }}> - <Content - style={{ - display: 'flex', - flexDirection: 'column', - background: '#fff' - }} - > - <p className="export-Description"> - {t('export.description')} - <a - href="https://saladict.crimx.com/anki.html" - target="_blank" - rel="nofollow noopener noreferrer" - > - {t('export.explain')} - </a> - </p> - <Table - dataSource={this.tplTableData} - columns={this.tplTableCols} - rowKey="plcholderL" - pagination={false} - size="small" - bordered={true} - style={{ marginBottom: '1em' }} - /> - <div - style={{ - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', - marginBottom: '1em' - }} - > - <Select - value={this.state.lineBreak} - style={{ width: 210 }} - onChange={this.handleLinebreakChange} - > - <Select.Option value=""> - {t('export.linebreak.default')} - </Select.Option> - <Select.Option value="n">{t('export.linebreak.n')}</Select.Option> - <Select.Option value="br"> - {t('export.linebreak.br')} - </Select.Option> - <Select.Option value="p">{t('export.linebreak.p')}</Select.Option> - <Select.Option value="space"> - {t('export.linebreak.space')} - </Select.Option> - </Select> - <Switch - title={t('export.htmlescape.title')} - checked={this.state.escape} - onChange={this.handleHTMLEscapeChange} - checkedChildren={t('export.htmlescape.text')} - unCheckedChildren={t('export.htmlescape.text')} - /> - </div> - <textarea - style={{ flex: 1, width: '100%' }} - value={template} - onChange={this.handleTemplateChange} - /> - </Content> - <Sider width="50%" style={{ paddingLeft: 24, background: '#fff' }}> - <textarea - style={{ width: '100%', height: '100%' }} - readOnly={true} - value={this.proccessedText} - /> - </Sider> - </Layout> - ) - } -} - -export class ExportModal extends React.PureComponent< - ExportModalInnerProps, - ExportModalState -> { - bodyRef = React.createRef<ExportModalBody>() - - exportWords = () => { - if (this.bodyRef.current) { - this.bodyRef.current.exportWords() - } - } - - render() { - const { t, title, onCancel } = this.props - - return ( - <Modal - title={title ? t(`export.${title}`) : ' '} - visible={!!title} - destroyOnClose={true} - onOk={this.exportWords} - onCancel={onCancel} - okText={t('common:export')} - style={{ width: '90vw', maxWidth: 1200, top: 24 }} - width="90vw" - > - <ExportModalBody ref={this.bodyRef} {...this.props} /> - </Modal> - ) - } -} - -export default withTranslation()(ExportModal) diff --git a/src/components/WordPage/ExportModal/Linebreak.tsx b/src/components/WordPage/ExportModal/Linebreak.tsx new file mode 100644 index 000000000..27160f11b --- /dev/null +++ b/src/components/WordPage/ExportModal/Linebreak.tsx @@ -0,0 +1,23 @@ +import React, { FC } from 'react' +import { Select } from 'antd' +import { TFunction } from 'i18next' + +export type LineBreakOption = '' | 'n' | 'p' | 'br' | 'space' + +export interface LineBreakProps { + t: TFunction + value: LineBreakOption + onChange: (value: LineBreakOption) => void +} + +export const LineBreak: FC<LineBreakProps> = ({ t, value, onChange }) => ( + <Select value={value} style={{ width: 210 }} onChange={onChange}> + <Select.Option value="">{t('export.linebreak.default')}</Select.Option> + <Select.Option value="n">{t('export.linebreak.n')}</Select.Option> + <Select.Option value="br">{t('export.linebreak.br')}</Select.Option> + <Select.Option value="p">{t('export.linebreak.p')}</Select.Option> + <Select.Option value="space">{t('export.linebreak.space')}</Select.Option> + </Select> +) + +export const LineBreakMemo = React.memo(LineBreak) diff --git a/src/components/WordPage/ExportModal/PlaceholderTable.tsx b/src/components/WordPage/ExportModal/PlaceholderTable.tsx new file mode 100644 index 000000000..0102091e4 --- /dev/null +++ b/src/components/WordPage/ExportModal/PlaceholderTable.tsx @@ -0,0 +1,75 @@ +import React, { FC } from 'react' +import { Table } from 'antd' +import { TFunction } from 'i18next' + +export interface PlaceholderTableProps { + t: TFunction +} + +export const PlaceholderTable: FC<PlaceholderTableProps> = ({ t }) => ( + <Table + rowKey="plcholderL" + pagination={false} + size="small" + bordered={true} + style={{ marginBottom: '1em' }} + dataSource={[ + { + plcholderL: '%text%', + contentL: t('common:note.word'), + plcholderR: '%title%', + contentR: t('common:note.srcTitle') + }, + { + plcholderL: '%context%', + contentL: t('common:note.context'), + plcholderR: '%url%', + contentR: t('common:note.srcLink') + }, + { + plcholderL: '%note%', + contentL: t('common:note.note'), + plcholderR: '%favicon%', + contentR: t('common:note.srcFavicon') + }, + { + plcholderL: '%trans%', + contentL: t('common:note.trans'), + plcholderR: '%date%', + contentR: t('common:note.date') + } + ]} + columns={[ + { + title: t('export.placeholder'), + dataIndex: 'plcholderL', + key: 'plcholderL', + width: '25%', + align: 'center' + }, + { + title: t('export.gencontent'), + dataIndex: 'contentL', + key: 'contentL', + width: '25%', + align: 'center' + }, + { + title: t('export.placeholder'), + dataIndex: 'plcholderR', + key: 'plcholderR', + width: '25%', + align: 'center' + }, + { + title: t('export.gencontent'), + dataIndex: 'contentR', + key: 'contentR', + width: '25%', + align: 'center' + } + ]} + /> +) + +export const PlaceholderTableMemo = React.memo(PlaceholderTable) diff --git a/src/components/WordPage/ExportModal/index.tsx b/src/components/WordPage/ExportModal/index.tsx new file mode 100644 index 000000000..0d220d910 --- /dev/null +++ b/src/components/WordPage/ExportModal/index.tsx @@ -0,0 +1,193 @@ +import React, { FC, useState, useEffect, useContext } from 'react' +import { Modal, Layout, Switch } from 'antd' +import escapeHTML from 'lodash/escape' +import { Word, newWord } from '@/_helpers/record-manager' +import { useTranslate, I18nContext } from '@/_helpers/i18n' +import { storage } from '@/_helpers/browser-api' +import { LineBreakMemo, LineBreakOption } from './Linebreak' +import { PlaceholderTableMemo } from './PlaceholderTable' + +const keywordMatchStr = `%(${Object.keys(newWord()).join('|')})%` + +export type ExportModalTitle = 'all' | 'selected' | 'page' | '' + +export interface ExportModalProps { + title: ExportModalTitle + rawWords: Word[] + onCancel: (e: React.MouseEvent<any>) => any +} + +export const ExportModal: FC<ExportModalProps> = props => { + const lang = useContext(I18nContext) + const { t } = useTranslate(['wordpage', 'common']) + const [template, setTemplate] = useState('%text%\n%trans%\n%context%\n') + const [lineBreak, setLineBreak] = useState<LineBreakOption>('') + const [escape, setEscape] = useState(false) + + const [output, setOutput] = useState('') + + useEffect(() => { + setOutput( + props.rawWords + .map(word => + template.replace(new RegExp(keywordMatchStr, 'g'), (match, k) => { + switch (k) { + case 'date': + return new Date(word.date).toLocaleDateString(lang) + case 'trans': + case 'note': + case 'context': { + const text: string = escape + ? escapeHTML(word[k] || '') + : word[k] || '' + switch (lineBreak) { + case 'n': + return text.replace(/\n|\r\n/g, '\\n') + case 'br': + return text.replace(/\n|\r\n/g, '<br>') + case 'p': + return text + .split(/\n|\r\n/) + .map(line => `<p>${line}</p>`) + .join('') + case 'space': + return text.replace(/\n|\r\n/g, ' ') + default: + return text + } + } + default: + return word[k] || '' + } + }) + ) + .join('\n') + ) + }, [props.rawWords, lang, template, lineBreak, escape]) + + useEffect(() => { + storage.sync + .get<{ + wordpageTemplate: string + wordpageLineBreak: LineBreakOption + }>(['wordpageTemplate', 'wordpageLineBreak']) + .then(({ wordpageTemplate, wordpageLineBreak }) => { + if (wordpageTemplate != null) { + setTemplate(wordpageTemplate) + } + if (wordpageLineBreak != null) { + setLineBreak(wordpageLineBreak) + } + }) + + storage.local + .get<{ + wordpageHTMLEscape: boolean + }>('wordpageHTMLEscape') + .then(({ wordpageHTMLEscape }) => { + if (wordpageHTMLEscape != null) { + setEscape(wordpageHTMLEscape) + } + }) + }, []) + + const exportWords = () => { + browser.runtime.getPlatformInfo().then(({ os }) => { + const content = os === 'win' ? output.replace(/\r\n|\n/g, '\r\n') : output + const file = new Blob([content], { type: 'text/plain;charset=utf-8' }) + const a = document.createElement('a') + a.style.display = 'none' + a.href = URL.createObjectURL(file) + a.download = `saladict-words-${Date.now()}.txt` + // firefox + a.target = '_blank' + document.body.appendChild(a) + + a.click() + }) + } + + return ( + <Modal + title={props.title ? t(`export.${props.title}`) : ' '} + visible={!!props.title} + destroyOnClose={true} + onOk={exportWords} + onCancel={props.onCancel} + okText={t('common:export')} + style={{ width: '90vw', maxWidth: 1200, top: 24 }} + width="90vw" + > + <Layout style={{ height: '70vh', maxHeight: 1000 }}> + <Layout.Content + style={{ + display: 'flex', + flexDirection: 'column', + background: '#fff' + }} + > + <p className="export-Description"> + {t('export.description')} + <a + href="https://saladict.crimx.com/anki.html" + target="_blank" + rel="nofollow noopener noreferrer" + > + {t('export.explain')} + </a> + </p> + <PlaceholderTableMemo t={t} /> + <div + style={{ + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + marginBottom: '1em' + }} + > + <LineBreakMemo + t={t} + value={lineBreak} + onChange={value => { + setLineBreak(value) + storage.sync.set({ wordpageLineBreak: value }) + if (value === 'br' || value === 'p') { + setEscape(true) + storage.local.set({ wordpageHTMLEscape: true }) + } + }} + /> + <Switch + title={t('export.htmlescape.title')} + checked={escape} + onChange={checked => { + setEscape(checked) + storage.local.set({ wordpageHTMLEscape: checked }) + }} + checkedChildren={t('export.htmlescape.text')} + unCheckedChildren={t('export.htmlescape.text')} + /> + </div> + <textarea + style={{ flex: 1, width: '100%' }} + value={template} + onChange={({ currentTarget: { value } }) => { + setTemplate(value) + storage.sync.set({ wordpageTemplate: value }) + }} + /> + </Layout.Content> + <Layout.Sider + width="50%" + style={{ paddingLeft: 24, background: '#fff' }} + > + <textarea + style={{ width: '100%', height: '100%' }} + readOnly={true} + value={output} + /> + </Layout.Sider> + </Layout> + </Modal> + ) +} diff --git a/src/components/WordPage/Header.tsx b/src/components/WordPage/Header.tsx index c7fcba967..02ce7c51e 100644 --- a/src/components/WordPage/Header.tsx +++ b/src/components/WordPage/Header.tsx @@ -1,5 +1,6 @@ import React, { FC } from 'react' import { Layout, Input, Dropdown, Menu, Button, Modal } from 'antd' +import { ClickParam } from 'antd/lib/menu' import { DownOutlined } from '@ant-design/icons' import { DBArea } from '@/_helpers/record-manager' import { useTranslate } from '@/_helpers/i18n' @@ -10,7 +11,7 @@ export interface WordPageProps { totalCount: number selectedCount: number onSearchTextChanged: (text: string) => void - onExport: () => void + onExport: (param: ClickParam) => void onDelete: (key: string) => void } diff --git a/src/components/WordPage/index.tsx b/src/components/WordPage/index.tsx index 590bd7b8c..a2f6f57f3 100644 --- a/src/components/WordPage/index.tsx +++ b/src/components/WordPage/index.tsx @@ -1,11 +1,12 @@ import React, { FC, useState } from 'react' import { Layout } from 'antd' import { from } from 'rxjs' -import { scan, switchMap, startWith, debounceTime } from 'rxjs/operators' -import { useObservableCallback, useSubscription } from 'observable-hooks' +import { switchMap, startWith, debounceTime } from 'rxjs/operators' +import { useObservable, useSubscription } from 'observable-hooks' import { DBArea, getWords, Word, deleteWords } from '@/_helpers/record-manager' import { Header } from './Header' import { WordTableProps, colSelectionWidth, WordTable } from './WordTable' +import { ExportModal, ExportModalTitle } from './ExportModal' import './_style.scss' @@ -38,6 +39,7 @@ export interface WordPageProps { export const WordPage: FC<WordPageProps> = props => { const [searchText, setSearchText] = useState('') + const [selectedRows, setSelectedRows] = useState<Word[]>([]) const [tableInfo, setTableInfo] = useState<TableInfo>(() => ({ dataSource: [], pagination: { @@ -51,37 +53,47 @@ export const WordPage: FC<WordPageProps> = props => { columnWidth: colSelectionWidth, onChange: (selectedRowKeys, selectedRows) => { setTableInfo(lastInfo => ({ + ...lastInfo, rowSelection: { ...lastInfo.rowSelection, selectedRowKeys - }, - selectedRows + } })) + setSelectedRows(selectedRows) } }, loading: false })) - const [fetchWords, fetchWords$] = useObservableCallback< + const [exportModalTitle, setExportModalTitle] = useState<ExportModalTitle>('') + const [exportModalWords, setExportModalWords] = useState<Word[]>([]) + + const [fetchWordsConfig, setFetchWordsConfig] = useState( + initialFetchWordsConfig + ) + const fetchWords = (config: Partial<FetchWordsConfig>) => + setFetchWordsConfig(lastConfig => ({ + ...lastConfig, + ...config + })) + + const fetchWords$ = useObservable< { total: number; words: Word[] } | null, - Partial<FetchWordsConfig> - >(config$ => - config$.pipe( - scan( - (lastConfig, config) => ({ ...lastConfig, ...config }), - initialFetchWordsConfig - ), - debounceTime(200), - switchMap(config => - from( - getWords(props.area, config).catch(e => { - console.error(e) - return { total: 0, words: [] } - }) - ).pipe(startWith(null)) + [FetchWordsConfig] + >( + inputs$ => + inputs$.pipe( + debounceTime(200), + switchMap(([config]) => + from( + getWords(props.area, config).catch(e => { + console.error(e) + return { total: 0, words: [] } + }) + ).pipe(startWith(null)) + ) ), - startWith(null) - ) + [fetchWordsConfig] ) useSubscription(fetchWords$, response => { @@ -98,6 +110,7 @@ export const WordPage: FC<WordPageProps> = props => { } : { loading: true }) })) + setSelectedRows([]) }) return ( @@ -105,13 +118,34 @@ export const WordPage: FC<WordPageProps> = props => { <Header area={props.area} searchText={searchText} - totalCount={10} - selectedCount={12} + totalCount={(tableInfo.pagination && tableInfo.pagination.total) || 0} + selectedCount={selectedRows.length} onSearchTextChanged={text => { setSearchText(text) fetchWords({ searchText: text }) }} - onExport={() => {}} + onExport={async ({ key }) => { + if (key === 'all') { + const { total, words } = await getWords(props.area, { + ...fetchWordsConfig, + itemsPerPage: undefined, + pageNum: undefined + }) + if (process.env.NODE_ENV !== 'production') { + console.assert(words.length === total, 'get all words') + } + setExportModalTitle(key) + setExportModalWords(words) + } else if (key === 'selected') { + setExportModalTitle(key) + setExportModalWords(selectedRows) + } else if (key === 'page') { + setExportModalTitle(key) + setExportModalWords(tableInfo.dataSource || []) + } else { + setExportModalTitle('') + } + }} onDelete={key => { const keys = key === 'selected' @@ -132,6 +166,7 @@ export const WordPage: FC<WordPageProps> = props => { window.scrollTo(0, 0) setTableInfo(lastInfo => ({ + ...lastInfo, pagination: { ...lastInfo.pagination, current: pagination.current || 1 @@ -151,6 +186,13 @@ export const WordPage: FC<WordPageProps> = props => { }} /> </Layout.Content> + <ExportModal + title={exportModalTitle} + rawWords={exportModalWords} + onCancel={() => { + setExportModalTitle('') + }} + /> </Layout> ) } diff --git a/src/history/index.tsx b/src/history/index.tsx index eccbdc059..da7a645bf 100644 --- a/src/history/index.tsx +++ b/src/history/index.tsx @@ -1,11 +1,18 @@ import './env' import '@/selection' +import React from 'react' import ReactDOM from 'react-dom' -import { getLocaledWordPage } from '@/components/WordPage' +import { WordPage } from '@/components/WordPage' +import { AntdRoot } from '@/_helpers/antd' -document.title = 'Saladict History' - -getLocaledWordPage('history').then(wordPage => { - ReactDOM.render(wordPage, document.getElementById('root')) -}) +ReactDOM.render( + <AntdRoot + path="/wordpage/history" + titleKey="title.history" + titleNS="wordpage" + > + <WordPage area="history" /> + </AntdRoot>, + document.getElementById('root') +) diff --git a/src/notebook/index.tsx b/src/notebook/index.tsx index 340a0b167..4d41a96ce 100644 --- a/src/notebook/index.tsx +++ b/src/notebook/index.tsx @@ -1,11 +1,18 @@ import './env' import '@/selection' +import React from 'react' import ReactDOM from 'react-dom' -import { getLocaledWordPage } from '@/components/WordPage' +import { WordPage } from '@/components/WordPage' +import { AntdRoot } from '@/_helpers/antd' -document.title = 'Saladict Notebook' - -getLocaledWordPage('notebook').then(wordPage => { - ReactDOM.render(wordPage, document.getElementById('root')) -}) +ReactDOM.render( + <AntdRoot + path="/wordpage/notebook" + titleKey="title.notebook" + titleNS="wordpage" + > + <WordPage area="notebook" /> + </AntdRoot>, + document.getElementById('root') +)
refactor
rewrite will cleaner architecture
a5c566cee95c19917852e2f3caccbe4920f3722f
2019-09-20 12:24:16
crimx
test: update browser api specs
false
diff --git a/test/specs/_helpers/browser-api.spec.ts b/test/specs/_helpers/browser-api.spec.ts index 49ee48f5c..bad68b70f 100644 --- a/test/specs/_helpers/browser-api.spec.ts +++ b/test/specs/_helpers/browser-api.spec.ts @@ -1,7 +1,7 @@ import { message, storage, openURL } from '@/_helpers/browser-api' -import { AppConfig } from '@/app-config' import { take } from 'rxjs/operators' -import { MsgType } from '@/typings/message' +import { browser } from '../../helper' +import { Message } from '@/typings/message' describe('Browser API Wapper', () => { beforeEach(() => { @@ -37,7 +37,9 @@ describe('Browser API Wapper', () => { expect(browser.storage[area].set.calledWith(key)).toBeTruthy() }) describe(`storage.${area}.addListener`, () => { - const changes = { key: { newValue: 'new value', oldValue: 'old value' } } + const changes = { + key: { newValue: 'new value', oldValue: 'old value' } + } const otherArea = storageArea.find(x => x !== area) it('with cb', () => { @@ -71,8 +73,9 @@ describe('Browser API Wapper', () => { }) }) describe(`storage.${area}.removeListener`, () => { - const changes = { key: { newValue: 'new value', oldValue: 'old value' } } - const otherArea = storageArea.find(x => x !== area) + const changes = { + key: { newValue: 'new value', oldValue: 'old value' } + } it('with cb remove addListener with cb', () => { const cb = jest.fn() @@ -81,14 +84,18 @@ describe('Browser API Wapper', () => { // won't affect cb storage[area].removeListener('key', cb) - expect(browser.storage.onChanged.removeListener.calledOnce).toBeTruthy() + expect( + browser.storage.onChanged.removeListener.calledOnce + ).toBeTruthy() browser.storage.onChanged.dispatch(changes, area) expect(cb).toHaveBeenCalledTimes(++cbCall) expect(cb).toBeCalledWith(changes, area) storage[area].removeListener(cb) - expect(browser.storage.onChanged.removeListener.calledTwice).toBeTruthy() + expect( + browser.storage.onChanged.removeListener.calledTwice + ).toBeTruthy() browser.storage.onChanged.dispatch(changes, area) expect(cb).toHaveBeenCalledTimes(cbCall) @@ -107,7 +114,9 @@ describe('Browser API Wapper', () => { expect(cb).toBeCalledWith(changes, area) storage[area].removeListener(cb) - expect(browser.storage.onChanged.removeListener.calledOnce).toBeTruthy() + expect( + browser.storage.onChanged.removeListener.calledOnce + ).toBeTruthy() browser.storage.onChanged.dispatch(changes, area) expect(cb).toHaveBeenCalledTimes(cbCall) @@ -123,14 +132,18 @@ describe('Browser API Wapper', () => { // won't affect key + cb storage[area].removeListener('badkey', cb) - expect(browser.storage.onChanged.removeListener.calledOnce).toBeTruthy() + expect( + browser.storage.onChanged.removeListener.calledOnce + ).toBeTruthy() browser.storage.onChanged.dispatch(changes, area) expect(cb).toHaveBeenCalledTimes(++cbCall) expect(cb).toBeCalledWith(changes, area) storage[area].removeListener('key', cb) - expect(browser.storage.onChanged.removeListener.calledTwice).toBeTruthy() + expect( + browser.storage.onChanged.removeListener.calledTwice + ).toBeTruthy() browser.storage.onChanged.dispatch(changes, area) expect(cb).toHaveBeenCalledTimes(cbCall) @@ -140,14 +153,17 @@ describe('Browser API Wapper', () => { }) }) describe(`storage.${area}.createStream`, () => { - const changes = { key: { newValue: 'new value', oldValue: 'old value' } } + const changes = { + key: { newValue: 'new value', oldValue: 'old value' } + } const otherArea = storageArea.find(x => x !== area) it('with key', () => { const nextStub = jest.fn() const errorStub = jest.fn() const completeStub = jest.fn() - storage[area].createStream<typeof changes.key>('key') + storage[area] + .createStream<typeof changes.key>('key') .pipe(take(1)) .subscribe(nextStub, errorStub, completeStub) expect(browser.storage.onChanged.addListener.calledOnce).toBeTruthy() @@ -199,7 +215,9 @@ describe('Browser API Wapper', () => { expect(browser.storage.onChanged.addListener.calledOnce).toBeTruthy() expect(cb).toHaveBeenCalledTimes(cbCall) - const changes = { key: { newValue: 'new value', oldValue: 'old value' } } + const changes = { + key: { newValue: 'new value', oldValue: 'old value' } + } const otherChanges = { otherKey: 'other value' } storageArea.forEach(area => { browser.storage.onChanged.dispatch(changes, area) @@ -259,7 +277,9 @@ describe('Browser API Wapper', () => { }) storage.removeListener('key', cb) - expect(browser.storage.onChanged.removeListener.calledTwice).toBeTruthy() + expect( + browser.storage.onChanged.removeListener.calledTwice + ).toBeTruthy() storageArea.forEach(area => { browser.storage.onChanged.dispatch(changes, area) @@ -270,14 +290,19 @@ describe('Browser API Wapper', () => { }) }) describe(`storage.createStream`, () => { - const changes1 = { key1: { newValue: 'new value', oldValue: 'old value' } } - const changes2 = { key2: { newValue: 'new value', oldValue: 'old value' } } + const changes1 = { + key1: { newValue: 'new value', oldValue: 'old value' } + } + const changes2 = { + key2: { newValue: 'new value', oldValue: 'old value' } + } it('with key', () => { const nextStub = jest.fn() const errorStub = jest.fn() const completeStub = jest.fn() - storage.createStream<typeof changes2.key2>('key2') + storage + .createStream<typeof changes2.key2>('key2') .pipe(take(1)) .subscribe(nextStub, errorStub, completeStub) expect(browser.storage.onChanged.addListener.calledOnce).toBeTruthy() @@ -302,7 +327,7 @@ describe('Browser API Wapper', () => { describe('Message', () => { it('message.send', () => { const tabId = 1 - const msg = { type: 1 } + const msg: Message = { type: 'OPEN_QS_PANEL' } message.send(msg) expect(browser.runtime.sendMessage.calledWith(msg)).toBeTruthy() @@ -323,16 +348,16 @@ describe('Browser API Wapper', () => { let cb1Call = 0 let cb2Call = 0 message.addListener(cb1) - message.addListener(1, cb2) + message.addListener('OPEN_QS_PANEL', cb2) expect(browser.runtime.onMessage.addListener.calledTwice).toBeTruthy() expect(cb1).toHaveBeenCalledTimes(cb1Call) expect(cb2).toHaveBeenCalledTimes(cb2Call) - browser.runtime.onMessage.dispatch({ type: 2 }) + browser.runtime.onMessage.dispatch({ type: 'CLOSE_QS_PANEL' }) expect(cb1).toHaveBeenCalledTimes(++cb1Call) expect(cb2).toHaveBeenCalledTimes(cb2Call) - browser.runtime.onMessage.dispatch({ type: 1 }) + browser.runtime.onMessage.dispatch({ type: 'OPEN_QS_PANEL' }) expect(cb1).toHaveBeenCalledTimes(++cb1Call) expect(cb2).toHaveBeenCalledTimes(++cb2Call) }) @@ -341,23 +366,23 @@ describe('Browser API Wapper', () => { const cb2 = jest.fn() let cb1Call = 0 let cb2Call = 0 - message.addListener(1, cb1) - message.addListener(2, cb2) - browser.runtime.onMessage.dispatch({ type: 1 }) + message.addListener('OPEN_QS_PANEL', cb1) + message.addListener('CLOSE_QS_PANEL', cb2) + browser.runtime.onMessage.dispatch({ type: 'OPEN_QS_PANEL' }) expect(cb1).toHaveBeenCalledTimes(++cb1Call) expect(cb2).toHaveBeenCalledTimes(cb2Call) - message.removeListener(-1, cb1) + message.removeListener('QUERY_QS_PANEL', cb1) message.removeListener(cb2) expect(browser.runtime.onMessage.removeListener.calledTwice).toBeTruthy() - browser.runtime.onMessage.dispatch({ type: 1 }) - browser.runtime.onMessage.dispatch({ type: 2 }) + browser.runtime.onMessage.dispatch({ type: 'OPEN_QS_PANEL' }) + browser.runtime.onMessage.dispatch({ type: 'CLOSE_QS_PANEL' }) expect(cb1).toHaveBeenCalledTimes(++cb1Call) expect(cb2).toHaveBeenCalledTimes(cb2Call) - message.removeListener(1, cb1) - browser.runtime.onMessage.dispatch({ type: 1 }) + message.removeListener('OPEN_QS_PANEL', cb1) + browser.runtime.onMessage.dispatch({ type: 'OPEN_QS_PANEL' }) expect(cb1).toHaveBeenCalledTimes(cb1Call) }) describe('message.createStream', () => { @@ -365,7 +390,8 @@ describe('Browser API Wapper', () => { const nextStub = jest.fn() const errorStub = jest.fn() const completeStub = jest.fn() - message.createStream() + message + .createStream() .pipe(take(2)) .subscribe(nextStub, errorStub, completeStub) expect(browser.runtime.onMessage.addListener.calledOnce).toBeTruthy() @@ -390,7 +416,8 @@ describe('Browser API Wapper', () => { const nextStub = jest.fn() const errorStub = jest.fn() const completeStub = jest.fn() - message.createStream(1) + message + .createStream('OPEN_QS_PANEL') .pipe(take(1)) .subscribe(nextStub, errorStub, completeStub) expect(browser.runtime.onMessage.addListener.calledOnce).toBeTruthy() @@ -398,58 +425,59 @@ describe('Browser API Wapper', () => { expect(errorStub).toHaveBeenCalledTimes(0) expect(completeStub).toHaveBeenCalledTimes(0) - browser.runtime.onMessage.dispatch({ type: 2 }) + browser.runtime.onMessage.dispatch({ type: 'CLOSE_QS_PANEL' }) expect(nextStub).toHaveBeenCalledTimes(0) expect(errorStub).toHaveBeenCalledTimes(0) expect(completeStub).toHaveBeenCalledTimes(0) - browser.runtime.onMessage.dispatch({ type: 1 }) + browser.runtime.onMessage.dispatch({ type: 'OPEN_QS_PANEL' }) expect(nextStub).toHaveBeenCalledTimes(1) expect(errorStub).toHaveBeenCalledTimes(0) expect(completeStub).toHaveBeenCalledTimes(1) - expect(nextStub).toBeCalledWith({ type: 1 }) + expect(nextStub).toBeCalledWith({ type: 'OPEN_QS_PANEL' }) }) }) it('message.self.initClient', () => { - browser.runtime.sendMessage - .withArgs({ type: MsgType.__PageInfo__ }) - .returns(Promise.resolve({ + browser.runtime.sendMessage.withArgs({ type: 'PAGE_INFO' }).returns( + Promise.resolve({ pageId: 'pageId', faviconURL: 'faviconURL', pageTitle: 'pageTitle', - pageURL: 'pageURL', - })) - return message.self.initClient() - .then(() => { - expect(browser.runtime.sendMessage.calledWith({ type: MsgType.__PageInfo__ })).toBeTruthy() - expect(window.pageId).toBe('pageId') - expect(window.faviconURL).toBe('faviconURL') - expect(window.pageTitle).toBe('pageTitle') - expect(window.pageURL).toBe('pageURL') + pageURL: 'pageURL' }) + ) + return message.self.initClient().then(() => { + expect( + browser.runtime.sendMessage.calledWith({ type: 'PAGE_INFO' }) + ).toBeTruthy() + expect(window.pageId).toBe('pageId') + expect(window.faviconURL).toBe('faviconURL') + expect(window.pageTitle).toBe('pageTitle') + expect(window.pageURL).toBe('pageURL') + }) }) describe('message.self.initServer', () => { const tab = { id: 1, favIconUrl: 'https://example.com/favIconUrl', url: 'https://example.com/url', - title: 'title', + title: 'title' } it('From tab', done => { message.self.initServer() expect(browser.runtime.onMessage.addListener.calledOnce).toBeTruthy() - const sendResponse = jest.fn() - browser.runtime.onMessage['_listeners'][0]({ type: MsgType.__PageInfo__ }, { tab }) + browser.runtime.onMessage['_listeners'] + [0]({ type: 'PAGE_INFO' }, { tab }) .then(response => { - expect(response).toEqual(({ + expect(response).toEqual({ pageId: tab.id, faviconURL: tab.favIconUrl, pageTitle: tab.title, - pageURL: tab.url, - })) + pageURL: tab.url + }) done() }) }) @@ -459,11 +487,12 @@ describe('Browser API Wapper', () => { expect(browser.runtime.onMessage.addListener.calledOnce).toBeTruthy() const sendResponse = jest.fn() - browser.runtime.onMessage['_listeners'][0]({ type: MsgType.__PageInfo__ }, {}, sendResponse) - .then(response => { - expect(response).toHaveProperty('pageId', 'popup') - done() - }) + browser.runtime.onMessage['_listeners'] + [0]({ type: 'PAGE_INFO' }, {}, sendResponse) + .then(response => { + expect(response).toHaveProperty('pageId', 'popup') + done() + }) }) it('Self page message transmission', () => { @@ -471,24 +500,36 @@ describe('Browser API Wapper', () => { expect(browser.runtime.onMessage.addListener.calledOnce).toBeTruthy() browser.runtime.onMessage.dispatch({ type: '[[1]]', __pageId__: 1 }, {}) - expect(browser.runtime.sendMessage.calledWith({ type: 1, __pageId__: 1 })).toBeTruthy() + expect( + browser.runtime.sendMessage.calledWith({ type: '1', __pageId__: 1 }) + ).toBeTruthy() browser.runtime.sendMessage.resetHistory() - browser.runtime.onMessage.dispatch({ type: '[[1]]', __pageId__: 1 }, { tab }) - expect(browser.tabs.sendMessage.calledWith(tab.id, { type: 1, __pageId__: 1 })).toBeTruthy() + browser.runtime.onMessage.dispatch( + { type: '[[1]]', __pageId__: 1 }, + { tab } + ) + expect( + browser.tabs.sendMessage.calledWith(tab.id, { + type: '1', + __pageId__: 1 + }) + ).toBeTruthy() }) }) it('message.self.send', () => { window.pageId = 1 message.self.send({ - type: 1, - prop: 'value', + type: 'QUERY_PANEL_STATE', + payload: 'value' }) - expect(browser.runtime.sendMessage.calledWith({ - type: '[[1]]', - __pageId__: window.pageId, - prop: 'value', - })).toBeTruthy() + expect( + browser.runtime.sendMessage.calledWith({ + type: '[[QUERY_PANEL_STATE]]', + __pageId__: window.pageId, + payload: 'value' + }) + ).toBeTruthy() }) it('message.self.addListener', () => { window.pageId = 1 @@ -510,7 +551,10 @@ describe('Browser API Wapper', () => { expect(cb1).toHaveBeenCalledTimes(cb1Call) expect(cb2).toHaveBeenCalledTimes(++cb2Call) - browser.runtime.onMessage.dispatch({ type: 1, __pageId__: window.pageId + 2 }) + browser.runtime.onMessage.dispatch({ + type: 1, + __pageId__: window.pageId + 2 + }) expect(cb1).toHaveBeenCalledTimes(cb1Call) expect(cb2).toHaveBeenCalledTimes(cb2Call) }) @@ -534,7 +578,8 @@ describe('Browser API Wapper', () => { const nextStub = jest.fn() const errorStub = jest.fn() const completeStub = jest.fn() - message.self.createStream() + message.self + .createStream() .pipe(take(2)) .subscribe(nextStub, errorStub, completeStub) expect(browser.runtime.onMessage.addListener.calledOnce).toBeTruthy() @@ -542,13 +587,19 @@ describe('Browser API Wapper', () => { expect(errorStub).toHaveBeenCalledTimes(0) expect(completeStub).toHaveBeenCalledTimes(0) - browser.runtime.onMessage.dispatch({ type: 1, __pageId__: window.pageId }) + browser.runtime.onMessage.dispatch({ + type: 1, + __pageId__: window.pageId + }) expect(nextStub).toHaveBeenCalledTimes(1) expect(errorStub).toHaveBeenCalledTimes(0) expect(completeStub).toHaveBeenCalledTimes(0) expect(nextStub).toBeCalledWith({ type: 1, __pageId__: window.pageId }) - browser.runtime.onMessage.dispatch({ type: 2, __pageId__: window.pageId }) + browser.runtime.onMessage.dispatch({ + type: 2, + __pageId__: window.pageId + }) expect(nextStub).toHaveBeenCalledTimes(2) expect(errorStub).toHaveBeenCalledTimes(0) expect(completeStub).toHaveBeenCalledTimes(1) @@ -560,7 +611,8 @@ describe('Browser API Wapper', () => { const nextStub = jest.fn() const errorStub = jest.fn() const completeStub = jest.fn() - message.self.createStream(1) + message.self + .createStream('OPEN_QS_PANEL') .pipe(take(1)) .subscribe(nextStub, errorStub, completeStub) expect(browser.runtime.onMessage.addListener.calledOnce).toBeTruthy() @@ -568,16 +620,25 @@ describe('Browser API Wapper', () => { expect(errorStub).toHaveBeenCalledTimes(0) expect(completeStub).toHaveBeenCalledTimes(0) - browser.runtime.onMessage.dispatch({ type: 2, __pageId__: window.pageId }) + browser.runtime.onMessage.dispatch({ + type: 'CLOSE_QS_PANEL', + __pageId__: window.pageId + }) expect(nextStub).toHaveBeenCalledTimes(0) expect(errorStub).toHaveBeenCalledTimes(0) expect(completeStub).toHaveBeenCalledTimes(0) - browser.runtime.onMessage.dispatch({ type: 1, __pageId__: window.pageId }) + browser.runtime.onMessage.dispatch({ + type: 'OPEN_QS_PANEL', + __pageId__: window.pageId + }) expect(nextStub).toHaveBeenCalledTimes(1) expect(errorStub).toHaveBeenCalledTimes(0) expect(completeStub).toHaveBeenCalledTimes(1) - expect(nextStub.mock.calls[0][0]).toEqual({ type: 1, __pageId__: window.pageId }) + expect(nextStub.mock.calls[0][0]).toEqual({ + type: 'OPEN_QS_PANEL', + __pageId__: window.pageId + }) }) }) }) @@ -585,36 +646,37 @@ describe('Browser API Wapper', () => { const url = 'https://example.com' it('Existing tab', () => { - browser.tabs.query.returns(Promise.resolve( - [{ - windowId: 10, - index: 1 - }] - )) - return openURL(url) - .then(() => { - expect(browser.tabs.query.calledWith({ url })).toBeTruthy() - expect(browser.tabs.highlight.calledWith({ tabs: 1, windowId: 10 })).toBeTruthy() - expect(browser.tabs.create.notCalled).toBeTruthy() - }) + browser.tabs.query.returns( + Promise.resolve([ + { + windowId: 10, + index: 1 + } + ]) + ) + return openURL(url).then(() => { + expect(browser.tabs.query.calledWith({ url })).toBeTruthy() + expect( + browser.tabs.highlight.calledWith({ tabs: 1, windowId: 10 }) + ).toBeTruthy() + expect(browser.tabs.create.notCalled).toBeTruthy() + }) }) it('New tab', () => { browser.tabs.query.returns(Promise.resolve([])) - return openURL(url) - .then(() => { - expect(browser.tabs.query.calledWith({ url })).toBeTruthy() - expect(browser.tabs.highlight.notCalled).toBeTruthy() - expect(browser.tabs.create.calledWith({ url })).toBeTruthy() - }) + return openURL(url).then(() => { + expect(browser.tabs.query.calledWith({ url })).toBeTruthy() + expect(browser.tabs.highlight.notCalled).toBeTruthy() + expect(browser.tabs.create.calledWith({ url })).toBeTruthy() + }) }) it('Concat extension base url', () => { browser.tabs.query.returns(Promise.resolve([])) browser.runtime.getURL.returns('test') - return openURL(url, true) - .then(() => { - expect(browser.runtime.getURL.calledWith(url)).toBeTruthy() - expect(browser.tabs.create.calledWith({ url: 'test' })).toBeTruthy() - }) + return openURL(url, true).then(() => { + expect(browser.runtime.getURL.calledWith(url)).toBeTruthy() + expect(browser.tabs.create.calledWith({ url: 'test' })).toBeTruthy() + }) }) }) })
test
update browser api specs
5277346489548394ed6e307591fd930e9e3ac484
2018-07-07 19:06:51
CRIMX
test(background): remove preload selection
false
diff --git a/test/specs/background/server.spec.ts b/test/specs/background/server.spec.ts index e40d2a347..6e2531e38 100644 --- a/test/specs/background/server.spec.ts +++ b/test/specs/background/server.spec.ts @@ -1,6 +1,5 @@ import { appConfigFactory, AppConfig } from '@/app-config' import * as browserWrap from '@/_helpers/browser-api' -import sinon from 'sinon' import { MsgType } from '@/typings/message' jest.mock('@/background/database') @@ -126,24 +125,4 @@ describe('Server', () => { expect(bingSearch).toHaveBeenCalledWith('test', config) }) }) - - it('Preload Selection', done => { - const resolveStub = jest.fn() - const rejectStub = jest.fn() - const queryStub = jest.fn(() => Promise.resolve([{ id: 100 }])) - browser.tabs.query.callsFake(queryStub) - browser.tabs.sendMessage.callsFake(() => Promise.resolve('test')) - browser.runtime.onMessage.dispatch({ type: MsgType.PreloadSelection }) - browser.runtime.onMessage['_listeners'].forEach(f => - f({ type: MsgType.PreloadSelection }) - .then(resolveStub, rejectStub) - ) - setTimeout(() => { - expect(resolveStub).toHaveBeenCalledTimes(1) - expect(resolveStub).toHaveBeenCalledWith('test') - expect(rejectStub).toHaveBeenCalledTimes(0) - expect(browser.tabs.sendMessage.calledWith(100, { type: MsgType.__PreloadSelection__ })).toBeTruthy() - done() - }, 0) - }) })
test
remove preload selection
b3c88a5aa61856522fcb183206b7e2956486bee1
2019-09-02 15:42:58
crimx
fix(panel): firefox detect height change
false
diff --git a/package.json b/package.json index 5f9b6a737..0cd0ffed3 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "react-i18next": "^10.11.4", "react-number-editor": "^4.0.3", "react-redux": "^7.1.0", - "react-resize-detector": "^4.2.0", + "react-resize-reporter": "^1.0.0", "react-shadow": "^17.1.1", "react-textarea-autosize": "^7.1.0", "react-transition-group": "^4.2.1", diff --git a/src/content/components/DictItem/DictItem.tsx b/src/content/components/DictItem/DictItem.tsx index b0c3b7bb8..f505415fe 100644 --- a/src/content/components/DictItem/DictItem.tsx +++ b/src/content/components/DictItem/DictItem.tsx @@ -1,10 +1,10 @@ -import React, { ComponentType, FC, useState, useEffect, useRef } from 'react' +import React, { ComponentType, FC, useState, useEffect } from 'react' import { message } from '@/_helpers/browser-api' import { newWord } from '@/_helpers/record-manager' import { ViewPorps } from '@/components/dictionaries/helpers' import { DictItemHead, DictItemHeadProps } from './DictItemHead' import { DictItemBody, DictItemBodyProps } from './DictItemBody' -import ReactResizeDetector from 'react-resize-detector' +import { ResizeReporter } from 'react-resize-reporter/object' export interface DictItemProps extends DictItemBodyProps { /** default height when search result is received */ @@ -20,10 +20,7 @@ export const DictItem: FC<DictItemProps> = props => { 'COLLAPSE' ) /** Rendered height */ - const [offsetHeight, _setOffsetHeight] = useState(10) - const setOffsetHeight = useRef((width: number, height: number) => - _setOffsetHeight(height) - ) + const [offsetHeight, setOffsetHeight] = useState(10) const visibleHeight = Math.max( 10, @@ -59,10 +56,7 @@ export const DictItem: FC<DictItemProps> = props => { onClick={searchLinkText} > <article className="dictItem-BodyMesure"> - <ReactResizeDetector - handleHeight - onResize={setOffsetHeight.current} - /> + <ResizeReporter reportInit onHeightChanged={setOffsetHeight} /> {props.dictComp ? ( props.searchStatus === 'FINISH' && props.searchResult && diff --git a/src/content/components/DictPanel/DictPanel.tsx b/src/content/components/DictPanel/DictPanel.tsx index 9b47d7edd..d301ca5d1 100644 --- a/src/content/components/DictPanel/DictPanel.tsx +++ b/src/content/components/DictPanel/DictPanel.tsx @@ -1,6 +1,6 @@ import React, { FC, ReactNode, useEffect, useRef, useState } from 'react' import { useUpdateEffect } from 'react-use' -import ReactResizeDetector from 'react-resize-detector' +import { ResizeReporter } from 'react-resize-reporter/scroll' import { SALADICT_PANEL } from '@/_helpers/saladict' export interface DictPanelProps { @@ -111,11 +111,10 @@ export const DictPanel: FC<DictPanelProps> = props => { '--panel-max-height': props.maxHeight + 'px' }} > - <ReactResizeDetector - handleHeight - refreshMode="debounce" - refreshRate={100} - onResize={setHeightRef.current} + <ResizeReporter + reportInit + debounce={100} + onSizeChanged={setHeightRef.current} /> <div className="dictPanel-Head">{props.menuBar}</div> <div className="dictPanel-Body"> diff --git a/src/content/components/MenuBar/FloatBox.tsx b/src/content/components/MenuBar/FloatBox.tsx index e21f293b4..5c678f521 100644 --- a/src/content/components/MenuBar/FloatBox.tsx +++ b/src/content/components/MenuBar/FloatBox.tsx @@ -1,5 +1,5 @@ import React, { FC, Ref, useState, useCallback } from 'react' -import ReactResizeDetector from 'react-resize-detector' +import { ResizeReporter } from 'react-resize-reporter/scroll' interface FloatBoxPropsBase { /** Box container */ @@ -61,11 +61,8 @@ export const FloatBox: FC<FloatBoxProps> = React.forwardRef( onMouseOut={props.onMouseOut} > <div className="menuBar-FloatBoxMeasure"> - <ReactResizeDetector - handleWidth - handleHeight - onResize={updateHeight} - /> + <ResizeReporter reportInit onSizeChanged={updateHeight} /> + {props.isLoading ? ( <div className="lds-ellipsis"> <div></div> diff --git a/yarn.lock b/yarn.lock index 7d4147c4b..2eb3d704d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10718,7 +10718,7 @@ react-redux@^7.1.0: prop-types "^15.7.2" react-is "^16.9.0" -react-resize-detector@^4.0.5, react-resize-detector@^4.2.0: +react-resize-detector@^4.0.5: version "4.2.0" resolved "https://registry.yarnpkg.com/react-resize-detector/-/react-resize-detector-4.2.0.tgz#b87aee6b37c9e8a52daca8736b3230cf6a2a8647" integrity sha512-AtOaNIxs0ydua7tEoglXR3902/EdlIj9PXDu1Zj0ug2VAUnkSQjguLGzaG/N6CXLOhJSccTsUCZxjLayQ1mE9Q== @@ -10729,6 +10729,11 @@ react-resize-detector@^4.0.5, react-resize-detector@^4.2.0: raf-schd "^4.0.0" resize-observer-polyfill "^1.5.1" +react-resize-reporter@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/react-resize-reporter/-/react-resize-reporter-1.0.0.tgz#d572a66eea1e8bc22c7ce86d6a184557729601e4" + integrity sha512-/Qx3zH/0IXVxHY8FCsKgxOq2hCjPRFolD6PAqiWvkwFlmIwVlB8RQbcXq2gQOnpO8fm1fODLKnoOnb9l2fDsag== + react-select@^2.2.0: version "2.4.4" resolved "https://registry.yarnpkg.com/react-select/-/react-select-2.4.4.tgz#ba72468ef1060c7d46fbb862b0748f96491f1f73"
fix
firefox detect height change
fe07a29f27fcced61ecef6ae95705acc81878789
2019-05-28 22:07:25
CRIMX
refactor: clear edge cases
false
diff --git a/src/_helpers/browser-api.ts b/src/_helpers/browser-api.ts index bcec24cdc..93fdc3faa 100644 --- a/src/_helpers/browser-api.ts +++ b/src/_helpers/browser-api.ts @@ -291,9 +291,9 @@ function messageSend (...args): Promise<any> { }) } -function messageSendSelf<T extends Message, U = any> (message: T): Promise<U> { +async function messageSendSelf<T extends Message, U = any> (message: T): Promise<U> { if (window.pageId === undefined) { - return initClient().then(() => messageSendSelf(message)) + await initClient() } return browser.runtime.sendMessage(Object.assign({}, message, { __pageId__: window.pageId, @@ -310,6 +310,9 @@ function messageSendSelf<T extends Message, U = any> (message: T): Promise<U> { function messageAddListener<T extends Message = Message> (messageType: Message['type'], cb: onMessageEvent<T>): void function messageAddListener<T extends Message = Message> (cb: onMessageEvent<T>): void function messageAddListener (this: MessageThis, ...args): void { + if (window.pageId === undefined) { + initClient() + } const allListeners = this.__self__ ? messageSelfListeners : messageListeners const messageType = args.length === 1 ? undefined : args[0] const cb = args.length === 1 ? args[0] : args[1] @@ -323,7 +326,7 @@ function messageAddListener (this: MessageThis, ...args): void { listener = ( (message, sender) => { if (message && (this.__self__ ? window.pageId === message.__pageId__ : !message.__pageId__)) { - if (!messageType || message.type === messageType) { + if (messageType == null || message.type === messageType) { return cb(message, sender) } } @@ -407,21 +410,19 @@ function initServer (): void { browser.runtime.onMessage.addListener((message, sender) => { if (!message) { return } - switch (message.type) { - case MsgType.__PageInfo__: - return Promise.resolve(_getPageInfo(sender)) - default: - break + if (message.type === MsgType.__PageInfo__) { + return Promise.resolve(_getPageInfo(sender)) } const selfMsg = selfMsgTester.exec(message.type) if (selfMsg) { - message.type = Number(selfMsg[1]) as MsgType - if (sender.tab && sender.tab.id) { - return messageSend(sender.tab.id, message) + const msgType = Number(selfMsg[1]) + message.type = isNaN(msgType) ? selfMsg[1] : msgType as MsgType + const tabId = sender.tab && sender.tab.id || message.__pageId__ + if (tabId) { + return messageSend(tabId, message) } else { - // has to be a tab - // return messageSend(message) + return messageSend(message) } } })
refactor
clear edge cases
b6532cdc8e35572a9250571dd7b3a6cbc2d3e574
2018-05-28 03:15:06
CRIMX
fix(dicts): fix lang code
false
diff --git a/src/components/dictionaries/google/engine.ts b/src/components/dictionaries/google/engine.ts index ce19a80db..e9d80ad1e 100644 --- a/src/components/dictionaries/google/engine.ts +++ b/src/components/dictionaries/google/engine.ts @@ -11,7 +11,7 @@ export default function search ( text: string, config: AppConfig, ): Promise<GoogleSearchResult> { - const chCode = config.langCode === 'zh_TW' ? 'zh-TW' : 'zh-CN' + const chCode = config.langCode === 'zh-TW' ? 'zh-TW' : 'zh-CN' let sl = 'auto' let tl = chCode if (isContainChinese(text)) {
fix
fix lang code
41c59a09c5b8d3c3c853ab9ff2cf9b25fcc09ab8
2020-04-01 21:59:38
crimx
refactor: load locales on-demand
false
diff --git a/src/_helpers/i18n.ts b/src/_helpers/i18n.ts index 48307b609..2d5d811c5 100644 --- a/src/_helpers/i18n.ts +++ b/src/_helpers/i18n.ts @@ -1,8 +1,9 @@ -import { useMemo } from 'react' +import React, { useState, useEffect, FC, useContext } from 'react' import mapValues from 'lodash/mapValues' import i18n from 'i18next' import { initReactI18next } from 'react-i18next' import { createConfigStream } from '@/_helpers/config-manager' +import { useUpdateEffect } from 'react-use' export type LangCode = 'zh-CN' | 'zh-TW' | 'en' export type Namespace = @@ -41,18 +42,31 @@ export interface DictLocales { } } -export function i18nLoader() { - i18n +export async function i18nLoader() { + await i18n .use({ type: 'backend', init: () => {}, create: () => {}, - read: (lang: LangCode, ns: Namespace, cb: Function) => { - if (ns === 'dicts') { - cb(null, extractDictLocales(lang)) - return + read: async (lang: LangCode, ns: Namespace, cb: Function) => { + try { + if (ns === 'dicts') { + const dictLocals = extractDictLocales(lang) + cb(null, dictLocals) + return dictLocals + } + + const { locale } = await import( + /* webpackInclude: /_locales\/[^/]+\/[^/]+\.ts$/ */ + /* webpackChunkName: "locales/[request]" */ + /* webpackMode: "lazy" */ + `@/_locales/${lang}/${ns}.ts` + ) + cb(null, locale) + return locale + } catch (err) { + cb(err) } - cb(null, require(`@/_locales/${lang}/${ns}.ts`).locale) } }) .use(initReactI18next as any) @@ -70,8 +84,6 @@ export function i18nLoader() { ns: 'common', defaultNS: 'common', - initImmediate: false, // sync init - interpolation: { escapeValue: false // not needed for react as it escapes by default } @@ -86,21 +98,86 @@ export function i18nLoader() { return i18n } +const defaultT: i18n.TFunction = () => '' + +export const I18nContext = React.createContext('') + +export const I18nContextProvider: FC = ({ children }) => { + const [lang, setLang] = useState(i18n.language) + + useEffect(() => { + const setLangCallback = () => { + setLang(i18n.language) + } + i18n.on('initialized', setLangCallback) + i18n.on('languageChanged', setLangCallback) + + return () => { + i18n.off('initialized', setLangCallback) + i18n.off('languageChanged', setLangCallback) + } + }, []) + + return React.createElement(I18nContext.Provider, { value: lang }, children) +} + /** * Tailored for this project. * The official `useTranslation` is too heavy. - * @param namespaces Should be fixed. + * @param namespaces MUST be fixed. */ export function useTranslate(namespaces?: Namespace | Namespace[]) { - return { - t: useMemo(() => { - if (namespaces) { - i18n.loadNamespaces(namespaces) - } - return i18n.getFixedT(i18n.language, namespaces) - }, [i18n.language]), - i18n - } + const lang = useContext(I18nContext) + + const [result, setResult] = useState(() => { + if (!lang) { + return { t: defaultT, i18n } + } + + if (!namespaces) { + return { t: i18n.t, i18n } + } + + if ( + Array.isArray(namespaces) + ? namespaces.every(ns => i18n.hasResourceBundle(lang, ns)) + : i18n.hasResourceBundle(lang, namespaces) + ) { + return { t: i18n.getFixedT(lang, namespaces), i18n } + } + + return { t: defaultT, i18n } + }) + + useEffect(() => { + let isEffectRunning = true + + if ( + namespaces && + (Array.isArray(namespaces) + ? namespaces.some(ns => !i18n.hasResourceBundle(lang, ns)) + : !i18n.hasResourceBundle(lang, namespaces)) + ) { + i18n.loadNamespaces(namespaces).then(() => { + if (isEffectRunning) { + setResult({ t: i18n.getFixedT(lang, namespaces), i18n }) + } + }) + } + + return () => { + isEffectRunning = false + } + }, []) + + useUpdateEffect(() => { + setResult({ + t: namespaces ? i18n.getFixedT(lang, namespaces) : i18n.t, + i18n + }) + }, [lang]) + + return result } function extractDictLocales(lang: LangCode) { diff --git a/src/background/context-menus.ts b/src/background/context-menus.ts index b924ff6cc..f441b301a 100644 --- a/src/background/context-menus.ts +++ b/src/background/context-menus.ts @@ -28,8 +28,32 @@ type ContextMenusClickInfo = Pick< > export class ContextMenus { - static getInstance() { - return ContextMenus.instance || (ContextMenus.instance = new ContextMenus()) + static async getInstance() { + if (!ContextMenus.instance) { + const instance = new ContextMenus() + ContextMenus.instance = instance + + const i18nManager = await I18nManager.getInstance() + + const contextMenusChanged$ = createConfigStream().pipe( + distinctUntilChanged( + (config1, config2) => + config1 && + config2 && + isEqual( + config1.contextMenus.selected, + config2.contextMenus.selected + ) + ), + filter(config => !!config) + ) + + combineLatest(contextMenusChanged$, i18nManager.getFixedT$$('menus')) + .pipe(concatMap(instance.setContextMenus)) + .subscribe() + } + + return ContextMenus.instance } static init = ContextMenus.getInstance @@ -55,14 +79,14 @@ export class ContextMenus { throw new Error() } }) - .catch(() => { + .catch(async () => { // error msg browser.notifications.create({ type: 'basic', eventTime: Date.now() + 4000, iconUrl: browser.runtime.getURL(`assets/icon-128.png`), title: 'Saladict', - message: I18nManager.getInstance().i18n.t( + message: (await I18nManager.getInstance()).i18n.t( 'menus:notification_youdao_err' ) }) @@ -184,26 +208,8 @@ export class ContextMenus { private static instance: ContextMenus - private i18nManager: I18nManager - // singleton private constructor() { - this.i18nManager = I18nManager.getInstance() - - const contextMenusChanged$ = createConfigStream().pipe( - distinctUntilChanged( - (config1, config2) => - config1 && - config2 && - isEqual(config1.contextMenus.selected, config2.contextMenus.selected) - ), - filter(config => !!config) - ) - - combineLatest(contextMenusChanged$, this.i18nManager.getFixedT$$('menus')) - .pipe(concatMap(this.setContextMenus)) - .subscribe() - browser.contextMenus.onClicked.addListener(payload => this.handleContextMenusClick(payload) ) diff --git a/src/background/i18n-manager.ts b/src/background/i18n-manager.ts index 7692afc48..75be1d91f 100644 --- a/src/background/i18n-manager.ts +++ b/src/background/i18n-manager.ts @@ -6,17 +6,24 @@ import { map } from 'rxjs/operators' export class I18nManager { private static instance: I18nManager - static getInstance() { - return I18nManager.instance || (I18nManager.instance = new I18nManager()) + static async getInstance() { + if (!I18nManager.instance) { + const instance = new I18nManager() + I18nManager.instance = instance + + instance.i18n = await i18nLoader() + instance.i18n$$.next(instance.i18n) + } + return I18nManager.instance } - readonly i18n: i18next.i18n + i18n: i18next.i18n readonly i18n$$: BehaviorSubject<i18next.i18n> // singleton private constructor() { - this.i18n = i18nLoader() + this.i18n = i18next this.i18n$$ = new BehaviorSubject(this.i18n) diff --git a/src/components/WordPage/index.tsx b/src/components/WordPage/index.tsx index 0410a1ddf..b0ecc3ae7 100644 --- a/src/components/WordPage/index.tsx +++ b/src/components/WordPage/index.tsx @@ -9,8 +9,9 @@ import SaladBowlContainer from '@/content/components/SaladBowl/SaladBowl.contain import DictPanelContainer from '@/content/components/DictPanel/DictPanel.container' import WordEditorContainer from '@/content/components/WordEditor/WordEditor.container' +import i18next from 'i18next' import { I18nextProvider as ProviderI18next } from 'react-i18next' -import { i18nLoader } from '@/_helpers/i18n' +import { i18nLoader, I18nContextProvider } from '@/_helpers/i18n' import { ConfigProvider as ProviderAntdConfig } from 'antd' import zh_CN from 'antd/lib/locale-provider/zh_CN' @@ -21,10 +22,6 @@ import { DBArea } from '@/_helpers/record-manager' import { createConfigStream } from '@/_helpers/config-manager' import { reportGA } from '@/_helpers/analytics' -const i18n = i18nLoader() -i18n.loadNamespaces(['common', 'wordpage', 'content']) -i18n.setDefaultNamespace('wordpage') - const reduxStore = createStore() const antdLocales = { @@ -52,17 +49,31 @@ export const WordPage: FC<WordPageProps> = props => { }, []) return ( - <ProviderI18next i18n={i18n}> - <ProviderAntdConfig locale={antdLocales[locale]}> - <App area={props.area} locale={locale} /> - </ProviderAntdConfig> + <I18nContextProvider> + <ProviderI18next i18n={i18next}> + <ProviderAntdConfig locale={antdLocales[locale]}> + <App area={props.area} locale={locale} /> + </ProviderAntdConfig> + </ProviderI18next> <ProviderRedux store={reduxStore}> <SaladBowlContainer /> <DictPanelContainer /> <WordEditorContainer /> </ProviderRedux> - </ProviderI18next> + </I18nContextProvider> ) } export default WordPage + +export async function getLocaledWordPage(area: DBArea) { + const i18n = await i18nLoader() + i18n.loadNamespaces(['common', 'wordpage', 'content']) + i18n.setDefaultNamespace('wordpage') + + return ( + <I18nContextProvider> + <WordPage area={area} /> + </I18nContextProvider> + ) +} diff --git a/src/content/index.tsx b/src/content/index.tsx index 831de79d9..8abb56ecd 100644 --- a/src/content/index.tsx +++ b/src/content/index.tsx @@ -6,20 +6,26 @@ import DictPanelContainer from './components/DictPanel/DictPanel.container' import WordEditorContainer from './components/WordEditor/WordEditor.container' import createStore from './redux/create' -import { I18nextProvider as ProviderI18next } from 'react-i18next' -import { i18nLoader } from '@/_helpers/i18n' +import { i18nLoader, I18nContextProvider } from '@/_helpers/i18n' // Only load on top frame if (window.parent === window && !window.__SALADICT_PANEL_LOADED__) { window.__SALADICT_PANEL_LOADED__ = true + main() +} + +async function main() { + const store = createStore() + await i18nLoader() + const App = () => ( - <ProviderRedux store={createStore()}> - <ProviderI18next i18n={i18nLoader()}> + <ProviderRedux store={store}> + <I18nContextProvider> <SaladBowlContainer /> <DictPanelContainer /> <WordEditorContainer /> - </ProviderI18next> + </I18nContextProvider> </ProviderRedux> ) diff --git a/src/history/index.tsx b/src/history/index.tsx index a89d0a298..eccbdc059 100644 --- a/src/history/index.tsx +++ b/src/history/index.tsx @@ -1,10 +1,11 @@ import './env' import '@/selection' -import React from 'react' import ReactDOM from 'react-dom' -import WordPage from '@/components/WordPage' +import { getLocaledWordPage } from '@/components/WordPage' document.title = 'Saladict History' -ReactDOM.render(<WordPage area="history" />, document.getElementById('root')) +getLocaledWordPage('history').then(wordPage => { + ReactDOM.render(wordPage, document.getElementById('root')) +}) diff --git a/src/notebook/index.tsx b/src/notebook/index.tsx index 943ff7d17..340a0b167 100644 --- a/src/notebook/index.tsx +++ b/src/notebook/index.tsx @@ -1,10 +1,11 @@ import './env' import '@/selection' -import React from 'react' import ReactDOM from 'react-dom' -import WordPage from '@/components/WordPage' +import { getLocaledWordPage } from '@/components/WordPage' document.title = 'Saladict Notebook' -ReactDOM.render(<WordPage area="notebook" />, document.getElementById('root')) +getLocaledWordPage('notebook').then(wordPage => { + ReactDOM.render(wordPage, document.getElementById('root')) +}) diff --git a/src/options/index.tsx b/src/options/index.tsx index 8ea1127f1..0185b786c 100644 --- a/src/options/index.tsx +++ b/src/options/index.tsx @@ -30,7 +30,7 @@ import DictPanelContainer from '@/content/components/DictPanel/DictPanel.contain import WordEditorContainer from '@/content/components/WordEditor/WordEditor.container' import { I18nextProvider as ProviderI18next } from 'react-i18next' -import { i18nLoader } from '@/_helpers/i18n' +import { i18nLoader, I18nContextProvider } from '@/_helpers/i18n' import { ConfigProvider as ProviderAntdConfig, message } from 'antd' import zh_CN from 'antd/lib/locale-provider/zh_CN' @@ -40,121 +40,127 @@ import en_US from 'antd/lib/locale-provider/en_US' import './_style.scss' import { newWord } from '@/_helpers/record-manager' -const i18n = i18nLoader() -i18n.loadNamespaces(['common', 'options', 'dicts', 'menus', 'langcode']) -i18n.setDefaultNamespace('options') +main() -const antdLocales = { - 'zh-CN': zh_CN, - 'zh-TW': zh_TW, - en: en_US -} - -export interface OptionsProps {} +async function main() { + const i18n = await i18nLoader() + i18n.loadNamespaces(['common', 'options', 'dicts', 'menus', 'langcode']) + i18n.setDefaultNamespace('options') -export interface OptionsState { - config: AppConfig - profile: Profile - profileIDList: ProfileIDList - rawProfileName: string -} + const antdLocales = { + 'zh-CN': zh_CN, + 'zh-TW': zh_TW, + en: en_US + } -export class Options extends React.Component<OptionsProps, OptionsState> { - reduxStore = createStore() + interface OptionsProps {} - state: OptionsState = { - config: getDefaultConfig(), - profile: getDefaultProfile(), - profileIDList: [], - rawProfileName: '' + interface OptionsState { + config: AppConfig + profile: Profile + profileIDList: ProfileIDList + rawProfileName: string } - getActiveProfileName = ( - activeID: string, - profileIDList = this.state.profileIDList - ): string => { - const activeProfileID = profileIDList.find(({ id }) => id === activeID) - return activeProfileID ? activeProfileID.name : '' - } + class Options extends React.Component<OptionsProps, OptionsState> { + reduxStore = createStore() + + state: OptionsState = { + config: getDefaultConfig(), + profile: getDefaultProfile(), + profileIDList: [], + rawProfileName: '' + } + + getActiveProfileName = ( + activeID: string, + profileIDList = this.state.profileIDList + ): string => { + const activeProfileID = profileIDList.find(({ id }) => id === activeID) + return activeProfileID ? activeProfileID.name : '' + } + + componentDidMount() { + Promise.all([getConfig(), getActiveProfile(), getProfileIDList()]).then( + async ([config, profile, profileIDList]) => { + this.setState({ + config, + profile, + profileIDList, + rawProfileName: this.getActiveProfileName(profile.id, profileIDList) + }) + + if (process.env.NODE_ENV !== 'development') { + if (window.innerWidth > 1024) { + await timer(500) + + browserMessage.self.send({ + type: 'SELECTION', + payload: { + word: newWord({ text: await getWordOfTheDay() }), + self: true, // selection inside dict panel is always avaliable + instant: true, + mouseX: window.innerWidth - config.panelWidth - 50, + mouseY: 80, + dbClick: true, + shiftKey: true, + ctrlKey: true, + metaKey: true, + force: true + } + }) + } + } + } + ) - componentDidMount() { - Promise.all([getConfig(), getActiveProfile(), getProfileIDList()]).then( - async ([config, profile, profileIDList]) => { + addConfigListener(({ newConfig }) => { + this.setState({ config: newConfig }) + message.destroy() + message.success(i18n.t('msg_updated')) + }) + + addActiveProfileListener(({ newProfile }) => { this.setState({ - config, - profile, - profileIDList, - rawProfileName: this.getActiveProfileName(profile.id, profileIDList) + profile: newProfile, + rawProfileName: this.getActiveProfileName(newProfile.id) }) + message.destroy() + message.success(i18n.t('msg_updated')) + }) - if (process.env.NODE_ENV !== 'development') { - if (window.innerWidth > 1024) { - await timer(500) - - browserMessage.self.send({ - type: 'SELECTION', - payload: { - word: newWord({ text: await getWordOfTheDay() }), - self: true, // selection inside dict panel is always avaliable - instant: true, - mouseX: window.innerWidth - config.panelWidth - 50, - mouseY: 80, - dbClick: true, - shiftKey: true, - ctrlKey: true, - metaKey: true, - force: true - } - }) - } - } - } - ) - - addConfigListener(({ newConfig }) => { - this.setState({ config: newConfig }) - message.destroy() - message.success(i18n.t('msg_updated')) - }) - - addActiveProfileListener(({ newProfile }) => { - this.setState({ - profile: newProfile, - rawProfileName: this.getActiveProfileName(newProfile.id) + addProfileIDListListener(({ newValue }) => { + this.setState({ profileIDList: newValue }) + message.destroy() + message.success(i18n.t('msg_updated')) }) - message.destroy() - message.success(i18n.t('msg_updated')) - }) - - addProfileIDListListener(({ newValue }) => { - this.setState({ profileIDList: newValue }) - message.destroy() - message.success(i18n.t('msg_updated')) - }) + } + + render() { + const isShowPanel = + window.innerWidth > 1024 && + !new URL(document.URL).searchParams.get('nopanel') + + return ( + <ProviderI18next i18n={i18n}> + <I18nContextProvider> + <ProviderAntdConfig + locale={antdLocales[this.state.config.langCode] || zh_CN} + > + <App {...this.state} /> + </ProviderAntdConfig> + {isShowPanel && ( + <ProviderRedux store={this.reduxStore}> + <SaladBowlContainer /> + <DictPanelContainer /> + <WordEditorContainer /> + </ProviderRedux> + )} + </I18nContextProvider> + </ProviderI18next> + ) + } } - render() { - const isShowPanel = - window.innerWidth > 1024 && - !new URL(document.URL).searchParams.get('nopanel') - - return ( - <ProviderI18next i18n={i18n}> - <ProviderAntdConfig - locale={antdLocales[this.state.config.langCode] || zh_CN} - > - <App {...this.state} /> - </ProviderAntdConfig> - {isShowPanel && ( - <ProviderRedux store={this.reduxStore}> - <SaladBowlContainer /> - <DictPanelContainer /> - <WordEditorContainer /> - </ProviderRedux> - )} - </ProviderI18next> - ) - } + ReactDOM.render(<Options />, document.getElementById('root')) } - -ReactDOM.render(<Options />, document.getElementById('root')) diff --git a/src/popup/index.tsx b/src/popup/index.tsx index 3e611076f..6a1a0f48d 100644 --- a/src/popup/index.tsx +++ b/src/popup/index.tsx @@ -14,8 +14,7 @@ import { Message } from '@/typings/message' import { Provider as ProviderRedux } from 'react-redux' import createStore from '@/content/redux/create' -import { I18nextProvider as ProviderI18next } from 'react-i18next' -import { i18nLoader } from '@/_helpers/i18n' +import { i18nLoader, I18nContextProvider } from '@/_helpers/i18n' import Popup from './Popup' import Notebook from './Notebook' @@ -43,16 +42,21 @@ getConfig().then(config => { } }) -function showPanel(config: AppConfig) { +async function showPanel(config: AppConfig) { if (config.analytics) { reportGA('/popup') } + const store = createStore() + await i18nLoader() + ReactDOM.render( - <ProviderRedux store={createStore()}> - <ProviderI18next i18n={i18nLoader()}> - <Popup config={config} /> - </ProviderI18next> + <ProviderRedux store={store}> + <I18nContextProvider> + <I18nContextProvider> + <Popup config={config} /> + </I18nContextProvider> + </I18nContextProvider> </ProviderRedux>, document.getElementById('root') ) @@ -84,10 +88,12 @@ async function addNotebook() { hasError = true } + await i18nLoader() + ReactDOM.render( - <ProviderI18next i18n={i18nLoader()}> + <I18nContextProvider> <Notebook word={word} hasError={hasError} /> - </ProviderI18next>, + </I18nContextProvider>, document.getElementById('root') ) diff --git a/src/quick-search/index.tsx b/src/quick-search/index.tsx index e7f888f3d..fc634f78c 100644 --- a/src/quick-search/index.tsx +++ b/src/quick-search/index.tsx @@ -8,8 +8,7 @@ import { message } from '@/_helpers/browser-api' import { Provider as ProviderRedux } from 'react-redux' import createStore from '@/content/redux/create' -import { I18nextProvider as ProviderI18next } from 'react-i18next' -import { i18nLoader } from '@/_helpers/i18n' +import { i18nLoader, I18nContextProvider } from '@/_helpers/i18n' import { DictPanelStandaloneContainer } from '@/content/components/DictPanel/DictPanelStandalone.container' @@ -17,15 +16,22 @@ import './quick-search.scss' document.title = 'Saladict Dict Panel' -ReactDOM.render( - <ProviderRedux store={createStore()}> - <ProviderI18next i18n={i18nLoader()}> - <DictPanelStandaloneContainer width="100vw" height="100vh" /> - </ProviderI18next> - </ProviderRedux>, - document.getElementById('root') -) - -window.addEventListener('unload', () => { - message.send({ type: 'CLOSE_QS_PANEL' }) -}) +main() + +async function main() { + const store = createStore() + await i18nLoader() + + ReactDOM.render( + <ProviderRedux store={store}> + <I18nContextProvider> + <DictPanelStandaloneContainer width="100vw" height="100vh" /> + </I18nContextProvider> + </ProviderRedux>, + document.getElementById('root') + ) + + window.addEventListener('unload', () => { + message.send({ type: 'CLOSE_QS_PANEL' }) + }) +} diff --git a/src/word-editor/index.tsx b/src/word-editor/index.tsx index 9a97a3ac9..651e24ce3 100644 --- a/src/word-editor/index.tsx +++ b/src/word-editor/index.tsx @@ -6,8 +6,7 @@ import ReactDOM from 'react-dom' import { Provider as ProviderRedux } from 'react-redux' import createStore from '@/content/redux/create' -import { I18nextProvider as ProviderI18next } from 'react-i18next' -import { i18nLoader } from '@/_helpers/i18n' +import { i18nLoader, I18nContextProvider } from '@/_helpers/i18n' import { WordEditorStandaloneContainer } from '@/content/components/WordEditor/WordEditorStandalone.container' @@ -15,28 +14,32 @@ import './word-editor.scss' document.title = 'Saladict Word Editor' -const store = createStore() -const i18n = i18nLoader() +main() -const searchParams = new URL(document.URL).searchParams +async function main() { + const store = createStore() + await i18nLoader() -const wordString = searchParams.get('word') -if (wordString) { - try { - const word = JSON.parse(decodeURIComponent(wordString)) - if (word) { - store.dispatch({ type: 'WORD_EDITOR_STATUS', payload: { word } }) + const searchParams = new URL(document.URL).searchParams + + const wordString = searchParams.get('word') + if (wordString) { + try { + const word = JSON.parse(decodeURIComponent(wordString)) + if (word) { + store.dispatch({ type: 'WORD_EDITOR_STATUS', payload: { word } }) + } + } catch (e) { + console.warn(e) } - } catch (e) { - console.warn(e) } -} -ReactDOM.render( - <ProviderRedux store={store}> - <ProviderI18next i18n={i18n}> - <WordEditorStandaloneContainer /> - </ProviderI18next> - </ProviderRedux>, - document.getElementById('root') -) + ReactDOM.render( + <ProviderRedux store={store}> + <I18nContextProvider> + <WordEditorStandaloneContainer /> + </I18nContextProvider> + </ProviderRedux>, + document.getElementById('root') + ) +}
refactor
load locales on-demand
226be86dd325e291b2eb6c6242b547496f66b6cb
2018-07-18 22:56:39
CRIMX
feat(selection): support selection on internal pages
false
diff --git a/src/_helpers/injectSaladictInternal.ts b/src/_helpers/injectSaladictInternal.ts new file mode 100644 index 000000000..b79b4018e --- /dev/null +++ b/src/_helpers/injectSaladictInternal.ts @@ -0,0 +1,24 @@ +export function injectSaladictInternal (noInjectContentCSS?: boolean) { + const $scriptSelection = document.createElement('script') + $scriptSelection.src = './selection.js' + $scriptSelection.type = 'text/javascript' + + const $scriptContent = document.createElement('script') + $scriptContent.src = './content.js' + $scriptContent.type = 'text/javascript' + + const $styleContent = document.createElement('link') + $styleContent.href = './content.css' + $styleContent.rel = 'stylesheet' + + const $stylePanel = document.createElement('link') + $stylePanel.href = './panel-internal.css' + $stylePanel.rel = 'stylesheet' + + document.body.appendChild($scriptSelection) + document.body.appendChild($scriptContent) + if (!noInjectContentCSS) { + document.head.appendChild($styleContent) + } + document.head.appendChild($stylePanel) +} diff --git a/src/_helpers/promise-more.ts b/src/_helpers/promise-more.ts index e0f3ab387..bb0717500 100644 --- a/src/_helpers/promise-more.ts +++ b/src/_helpers/promise-more.ts @@ -1,7 +1,7 @@ /** * Like Promise.all but always resolves. */ -export function reflect (iterable: ArrayLike<any>): Promise<any[]> { +export function reflect<T> (iterable: ArrayLike<T | PromiseLike<T>>): Promise<T[]> { const arr = Array.isArray(iterable) ? iterable : Array.from(iterable) return Promise.all(arr.map(p => Promise.resolve(p).catch(() => null))) } @@ -9,7 +9,7 @@ export function reflect (iterable: ArrayLike<any>): Promise<any[]> { /** * Like Promise.all but only rejects when all are failed. */ -export function any (iterable: ArrayLike<any>): Promise<any[]> { +export function any<T> (iterable: ArrayLike<T | PromiseLike<T>>): Promise<T[]> { const arr = Array.isArray(iterable) ? iterable : Array.from(iterable) let rejectCount = 0 @@ -34,15 +34,15 @@ export function any (iterable: ArrayLike<any>): Promise<any[]> { * Returns the first resolved value as soon as it is resolved. * Fails when all are failed. */ -export function first (iterable: ArrayLike<any>): Promise<any> { +export function first<T extends any> (iterable: ArrayLike<T | PromiseLike<T>>): Promise<T> { const arr = Array.isArray(iterable) ? iterable : Array.from(iterable) let rejectCount = 0 return new Promise((resolve, reject) => - arr.map((p, i) => { + arr.forEach(p => { Promise.resolve(p) .then(resolve) - .catch(e => { + .catch(() => { if (++rejectCount === arr.length) { reject(new Error('All rejected')) } diff --git a/src/_locales/options/messages.json b/src/_locales/options/messages.json index 976e4920b..6b40a157b 100644 --- a/src/_locales/options/messages.json +++ b/src/_locales/options/messages.json @@ -390,9 +390,9 @@ "zh_TW": "添加生字" }, "panelmode_description": { - "en": "Inside dict panel. See 'Search Mode' above. <p class=\"hl\">Note that it won't affect the dict panel on this page.</p>", - "zh_CN": "查词面板内部的查词模式。参见上方“查词模式”。<p class=\"hl\">注意在本页面的查词面板上没有效果。</p>", - "zh_TW": "字典視窗內部的查字模式。參見上方「查字模式」。<p class=\"hl\">注意在本窗口的字典視窗介面中沒有效果。</p>" + "en": "Inside dict panel. See 'Search Mode' above.", + "zh_CN": "查词面板内部的查词模式。参见上方“查词模式”。", + "zh_TW": "字典視窗內部的查字模式。參見上方「查字模式」。" }, "panelmode_title": { "en": "Panel Mode", diff --git a/src/content/components/DictPanel/_style.scss b/src/content/components/DictPanel/_style.scss index 735f5c38c..ae2a99792 100644 --- a/src/content/components/DictPanel/_style.scss +++ b/src/content/components/DictPanel/_style.scss @@ -1,3 +1,28 @@ +.panel-FrameBody { + height: 100vh; + margin: 0; + padding: 0; +} + +.panel-Root { + box-sizing: border-box; + display: flex; + flex-direction: column; + overflow: hidden; + height: 100%; + margin: 0; + padding: 0; + background-color: #fff; + font-size: 14px; + font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Hiragino Sans GB W3", "Microsoft YaHei UI", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + + *, *:before, *:after { + box-sizing: inherit; + } +} + .panel-DictContainer { flex: 1; overflow-x: hidden; diff --git a/src/content/components/DictPanel/index.tsx b/src/content/components/DictPanel/index.tsx index 4c5cd80b6..baabf9e78 100644 --- a/src/content/components/DictPanel/index.tsx +++ b/src/content/components/DictPanel/index.tsx @@ -27,6 +27,7 @@ type ChildrenProps = > export interface DictPanelProps extends ChildrenProps { + readonly isAnimation: boolean readonly dictionaries: DictionariesState['dictionaries'] readonly allDictsConfig: DictConfigs readonly langCode: AppConfig['langCode'] @@ -36,6 +37,7 @@ export interface DictPanelProps extends ChildrenProps { export default class DictPanel extends React.Component<DictPanelProps> { render () { const { + isAnimation, isFav, isPinned, langCode, @@ -63,7 +65,7 @@ export default class DictPanel extends React.Component<DictPanelProps> { } = dictionaries return ( - <> + <div className={`panel-Root${isAnimation ? ' isAnimate' : ''}`}> {React.createElement(MenuBar, { isFav, isPinned, @@ -98,7 +100,7 @@ export default class DictPanel extends React.Component<DictPanelProps> { }) })} </div> - </> + </div> ) } } diff --git a/src/content/components/DictPanelPortal/index.tsx b/src/content/components/DictPanelPortal/index.tsx index 5101084fe..983215a16 100644 --- a/src/content/components/DictPanelPortal/index.tsx +++ b/src/content/components/DictPanelPortal/index.tsx @@ -5,6 +5,7 @@ import DictPanel, { DictPanelDispatchers, DictPanelProps } from '../DictPanel' import { Omit } from '@/typings/helpers' import PortalFrame from '@/components/PortalFrame' +const isSaladictInternalPage = !!window.__SALADICT_INTERNAL_PAGE__ const isSaladictPopupPage = !!window.__SALADICT_POPUP_PAGE__ const isSaladictOptionsPage = !!window.__SALADICT_OPTIONS_PAGE__ @@ -116,9 +117,16 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp handleDragStart = (clientX, clientY) => { const activeElement = document.activeElement as any if (activeElement) { activeElement.blur() } - // e is from iframe, so there is offset - this.lastMouseX = clientX + this.props.panelRect.x - this.lastMouseY = clientY + this.props.panelRect.y + + if (isSaladictInternalPage) { + this.lastMouseX = clientX + this.lastMouseY = clientY + } else { + // e is from iframe, so there is offset + this.lastMouseX = clientX + this.props.panelRect.x + this.lastMouseY = clientY + this.props.panelRect.y + } + this.setState({ isDragging: true }) window.addEventListener('mousemove', this.handleWindowMouseMove, { capture: true }) window.addEventListener('touchmove', this.handleWindowTouchMove, { capture: true }) @@ -246,21 +254,30 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp + (isDragging ? ' isDragging' : '') return ( - <PortalFrame - className={frameClassName} - bodyClassName={isAnimation ? 'isAnimate' : undefined} - name='saladict-dictpanel' - frameBorder='0' - head={this.frameHead} - frameDidMount={this.frameDidMount} - > - <DictPanel - {...this.props} - panelWidth={this.props.panelRect.width} - handleDragAreaMouseDown={this.handleDragAreaMouseDown} - handleDragAreaTouchStart={this.handleDragAreaTouchStart} - /> - </PortalFrame> + isSaladictInternalPage + ? <div className={'panel-StyleRoot ' + frameClassName}> + <DictPanel + {...this.props} + panelWidth={this.props.panelRect.width} + handleDragAreaMouseDown={this.handleDragAreaMouseDown} + handleDragAreaTouchStart={this.handleDragAreaTouchStart} + /> + </div> + : <PortalFrame + className={frameClassName} + bodyClassName='panel-FrameBody' + name='saladict-dictpanel' + frameBorder='0' + head={this.frameHead} + frameDidMount={this.frameDidMount} + > + <DictPanel + {...this.props} + panelWidth={this.props.panelRect.width} + handleDragAreaMouseDown={this.handleDragAreaMouseDown} + handleDragAreaTouchStart={this.handleDragAreaTouchStart} + /> + </PortalFrame> ) } @@ -283,8 +300,8 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp return ReactDOM.createPortal( <div className='saladict-DIV' - onMouseMoveCapture={isDragging ? this.handleFrameMouseMove : undefined} - onTouchMoveCapture={isDragging ? this.handleFrameTouchMove : undefined} + onMouseMoveCapture={!isSaladictInternalPage && isDragging ? this.handleFrameMouseMove : undefined} + onTouchMoveCapture={!isSaladictInternalPage && isDragging ? this.handleFrameTouchMove : undefined} onMouseUpCapture={isDragging ? this.handleDragEnd : undefined} onTouchEndCapture={isDragging ? this.handleDragEnd : undefined} onKeyUp={this.handleFrameKeyUp} diff --git a/src/content/redux/modules/dictionaries.ts b/src/content/redux/modules/dictionaries.ts index 4b12dfa2d..88a4c730f 100644 --- a/src/content/redux/modules/dictionaries.ts +++ b/src/content/redux/modules/dictionaries.ts @@ -13,6 +13,8 @@ const isSaladictOptionsPage = !!window.__SALADICT_OPTIONS_PAGE__ const isSaladictInternalPage = !!window.__SALADICT_INTERNAL_PAGE__ const isSaladictPopupPage = !!window.__SALADICT_POPUP_PAGE__ +const isNoSearchHistoryPage = isSaladictInternalPage && !isSaladictPopupPage + let _searchDelayTimeout: any = null /*-----------------------------------------------*\ @@ -338,7 +340,7 @@ export function searchText (arg?: { id?: DictID, info?: SelectionInfo }): Dispat } }) - if (!isSaladictInternalPage && + if (!isNoSearchHistoryPage && state.config.searhHistory && (!browser.extension.inIncognitoContext || state.config.searhHistoryInco) && !isSameSelection(state.config.searhHistory[0], info) diff --git a/src/history/index.tsx b/src/history/index.tsx index cfa7cf7f9..5b15ac069 100644 --- a/src/history/index.tsx +++ b/src/history/index.tsx @@ -1,19 +1,11 @@ import React from 'react' import ReactDOM from 'react-dom' import WordPage from '@/components/WordPage' +import { injectSaladictInternal } from '@/_helpers/injectSaladictInternal' window.__SALADICT_INTERNAL_PAGE__ = true // inject panel first(but after global flags) to listen to page event -const $scriptSelection = document.createElement('script') -$scriptSelection.src = './selection.js' -$scriptSelection.type = 'text/javascript' - -const $scriptContent = document.createElement('script') -$scriptContent.src = './content.js' -$scriptContent.type = 'text/javascript' - -document.body.appendChild($scriptSelection) -document.body.appendChild($scriptContent) +injectSaladictInternal() ReactDOM.render(<WordPage area='history' />, document.getElementById('root')) diff --git a/src/notebook/index.tsx b/src/notebook/index.tsx index ca197ee14..79a6b9b7c 100644 --- a/src/notebook/index.tsx +++ b/src/notebook/index.tsx @@ -1,19 +1,11 @@ import React from 'react' import ReactDOM from 'react-dom' import WordPage from '@/components/WordPage' +import { injectSaladictInternal } from '@/_helpers/injectSaladictInternal' window.__SALADICT_INTERNAL_PAGE__ = true // inject panel first(but after global flags) to listen to page event -const $scriptSelection = document.createElement('script') -$scriptSelection.src = './selection.js' -$scriptSelection.type = 'text/javascript' - -const $scriptContent = document.createElement('script') -$scriptContent.src = './content.js' -$scriptContent.type = 'text/javascript' - -document.body.appendChild($scriptSelection) -document.body.appendChild($scriptContent) +injectSaladictInternal() ReactDOM.render(<WordPage area='notebook' />, document.getElementById('root')) diff --git a/src/options/index.ts b/src/options/index.ts index 08a530296..5c46d7117 100644 --- a/src/options/index.ts +++ b/src/options/index.ts @@ -6,6 +6,7 @@ import { message, storage } from '@/_helpers/browser-api' import checkUpdate from '@/_helpers/check-update' import { getDefaultSelectionInfo } from '@/_helpers/selection' import { appConfigFactory, AppConfigMutable } from '@/app-config' +import { injectSaladictInternal } from '@/_helpers/injectSaladictInternal' import i18nLoader from '@/_helpers/i18n' import commonLocles from '@/_locales/common' @@ -18,7 +19,7 @@ window.__SALADICT_INTERNAL_PAGE__ = true window.__SALADICT_OPTIONS_PAGE__ = true window.__SALADICT_LAST_SEARCH__ = '' -injectPanel() +injectSaladictInternal() Vue.use(VueStash) Vue.use(VueI18Next) @@ -79,16 +80,3 @@ storage.sync.get('config') }, }) }) - -function injectPanel () { - const $script = document.createElement('script') - $script.src = './content.js' - $script.type = 'text/javascript' - - const $style = document.createElement('link') - $style.href = './content.css' - $style.rel = 'stylesheet' - - document.body.appendChild($script) - document.body.appendChild($style) -} diff --git a/src/panel-internal/index.ts b/src/panel-internal/index.ts new file mode 100644 index 000000000..dac84d7fd --- /dev/null +++ b/src/panel-internal/index.ts @@ -0,0 +1,4 @@ +import './panel-internal.scss' + +const req = require['context']('@/components/dictionaries', true, /\.scss$/) +req.keys().forEach(req) diff --git a/src/panel-internal/panel-internal.scss b/src/panel-internal/panel-internal.scss new file mode 100644 index 000000000..7ed69a956 --- /dev/null +++ b/src/panel-internal/panel-internal.scss @@ -0,0 +1,28 @@ +.panel-StyleRoot { + h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { + font-weight: 700; + line-height: 1.6; + } + + h1 { + font-size: 2em; + } + + h2 { + font-size: 1.5em; + } + + h3 { + font-size: 1.17em; + } + + h4 { + font-size: 1em; + } + + h5 { + font-size: 0.83em; + } + + @import '../panel/panel'; +} diff --git a/src/panel/panel.scss b/src/panel/panel.scss index 3aea408e9..4c049e461 100644 --- a/src/panel/panel.scss +++ b/src/panel/panel.scss @@ -10,32 +10,6 @@ \*-----------------------------------------------*/ @import '../_sass_global/reset'; -/*-----------------------------------------------*\ - Base -\*-----------------------------------------------*/ -html { - height: 100%; - box-sizing: border-box; -} - -*, *:before, *:after { - box-sizing: inherit; -} - -body { - display: flex; - flex-direction: column; - overflow: hidden; - height: 100%; - margin: 0; - padding: 0; - background-color: #fff; - font-size: 14px; - font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Hiragino Sans GB W3", "Microsoft YaHei UI", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; - -webkit-font-smoothing: antialiased; - text-rendering: optimizeLegibility; -} - /*-----------------------------------------------*\ Components \*-----------------------------------------------*/ @@ -43,4 +17,4 @@ body { @import '../content/components/MenuBar/style'; @import '../content/components/DictItem/style'; -@import '../components/Speaker/style' +@import '../components/Speaker/style'; diff --git a/src/popup/index.ts b/src/popup/index.ts index 75e42f9e6..a8d4c7e99 100644 --- a/src/popup/index.ts +++ b/src/popup/index.ts @@ -4,11 +4,11 @@ import VueQriously from 'vue-qriously' import VueI18Next from '@panter/vue-i18next' import i18nLoader from '@/_helpers/i18n' import popupLocles from '@/_locales/popup' +import { injectSaladictInternal } from '@/_helpers/injectSaladictInternal' -// keep search history -// window.__SALADICT_INTERNAL_PAGE__ = true +window.__SALADICT_INTERNAL_PAGE__ = true window.__SALADICT_POPUP_PAGE__ = true -injectPanel() // inject panel AFTER flags are set +injectSaladictInternal(true) // inject panel AFTER flags are set Vue.use(VueQriously) Vue.use(VueI18Next) @@ -23,11 +23,3 @@ new Vue({ // eslint-disable-line no-new i18n, render: h => h(App), }) - -function injectPanel () { - const $script = document.createElement('script') - $script.src = './content.js' - $script.type = 'text/javascript' - - document.body.appendChild($script) -} diff --git a/src/selection/index.ts b/src/selection/index.ts index 9056591a7..25eccca12 100644 --- a/src/selection/index.ts +++ b/src/selection/index.ts @@ -28,7 +28,10 @@ import { startWith } from 'rxjs/operators/startWith' import { pluck } from 'rxjs/operators/pluck' import { combineLatest } from 'rxjs/observable/combineLatest' -const isDictPanel = window.name === 'saladict-dictpanel' +const isSaladictInternalPage = !!window.__SALADICT_INTERNAL_PAGE__ +const isSaladictOptionsPage = !!window.__SALADICT_OPTIONS_PAGE__ +const isSaladictPopupPage = !!window.__SALADICT_POPUP_PAGE__ +const isNoSelectionPage = isSaladictOptionsPage || isSaladictPopupPage let config = appConfigFactory() createAppConfigStream().subscribe(newConfig => config = newConfig) @@ -57,7 +60,9 @@ message.addListener(msg => { mouseX: clientX, mouseY: clientY, instant: true, - self: isDictPanel, + self: isSaladictInternalPage + ? isInPanelOnInternalPage(lastMousedownEvent) + : window.name === 'saladict-dictpanel', selectionInfo: selection.getSelectionInfo({ text }), }) } @@ -84,7 +89,7 @@ window.addEventListener('message', ({ data, source }: { data: PostMsgSelection, sendMessage(msg) }) -if (!window.name.startsWith('saladict-')) { +if (!window.name.startsWith('saladict-') && !isSaladictOptionsPage) { /** * Pressing ctrl/command key more than three times within 500ms * trigers TripleCtrl @@ -169,8 +174,16 @@ isKeyPressed(isEscapeKey).subscribe(flag => { let lastText: string let lastContext: string validMouseup$$.subscribe(event => { + if (isNoSelectionPage && !isInPanelOnInternalPage(lastMousedownEvent)) { + return + } + + const isDictPanel = isSaladictInternalPage + ? isInPanelOnInternalPage(lastMousedownEvent) + : window.name === 'saladict-dictpanel' + if (config.noTypeField && isTypeField(lastMousedownEvent)) { - sendEmptyMessage() + sendEmptyMessage(isDictPanel) return } @@ -209,7 +222,7 @@ validMouseup$$.subscribe(event => { }) } else { lastContext = '' - sendEmptyMessage() + sendEmptyMessage(isDictPanel) } // always update text lastText = text @@ -225,14 +238,15 @@ combineLatest( startWith(false), ), ).pipe( - map(([config, isPinned]) => { - const { instant } = config[isDictPanel ? 'panelMode' : isPinned ? 'pinMode' : 'mode'] + map(([config, isPinned]): ['' | AppConfig['mode']['instant']['key'], number] => { + const { instant } = config[ + (isNoSelectionPage || window.name === 'saladict-dictpanel') + ? 'panelMode' + : isPinned ? 'pinMode' : 'mode' + ] return [ instant.enable ? instant.key : '', instant.delay - ] as [ - '' | AppConfig['mode']['instant']['key'] | AppConfig['pinMode']['instant']['key'] | AppConfig['panelMode']['instant']['key'], - number ] }), distinctUntilChanged((oldVal, newVal) => oldVal[0] === newVal[0] && oldVal[1] === newVal[1]), @@ -271,7 +285,7 @@ combineLatest( mouseX: event.clientX, mouseY: event.clientY, instant: true, - self: isDictPanel, + self: isSaladictInternalPage ? isInPanelOnInternalPage(event) : window.name === 'saladict-dictpanel', selectionInfo: selection.getSelectionInfo({ text, context }), }) } @@ -311,7 +325,7 @@ function sendMessage ( } } -function sendEmptyMessage () { +function sendEmptyMessage (isDictPanel: boolean) { // empty message const msg: MsgSelection = { type: MsgType.Selection, @@ -376,6 +390,23 @@ function isTypeField (event: MouseEvent | TouchEvent | null): boolean { return false } +/** + * Is inside dict panel on a Saladict internal page + */ +function isInPanelOnInternalPage (event: MouseEvent | TouchEvent | null): boolean { + if (event && event.target) { + const target = event.target + if (target['classList']) { + for (let el = target as Element | null; el; el = el.parentElement) { + if (el.classList.contains('saladict-DictPanel')) { + return true + } + } + } + } + return false +} + /** * Select the word under the cursor position */
feat
support selection on internal pages
8b420e1014c4b124584b13927816479009941fba
2020-04-23 16:49:26
crimx
refactor(panel): remove lodash deps
false
diff --git a/src/background/initialization.ts b/src/background/initialization.ts index bc1764fed..728662136 100644 --- a/src/background/initialization.ts +++ b/src/background/initialization.ts @@ -45,9 +45,8 @@ function onCommand(command: string) { return } message - .send<'QUERY_PANEL_STATE', boolean>(tabs[0].id, { - type: 'QUERY_PANEL_STATE', - payload: 'widget.isPinned' + .send<'QUERY_PIN_STATE', boolean>(tabs[0].id, { + type: 'QUERY_PIN_STATE' }) .then(isPinned => { const config = window.appConfig diff --git a/src/content/redux/create.ts b/src/content/redux/create.ts index 53c4c28ce..4d097ee8e 100644 --- a/src/content/redux/create.ts +++ b/src/content/redux/create.ts @@ -8,8 +8,6 @@ import { createEpicMiddleware } from 'redux-observable' import { Observable } from 'rxjs' import { map, distinctUntilChanged } from 'rxjs/operators' -import get from 'lodash/get' - import { message } from '@/_helpers/browser-api' import { getConfig } from '@/_helpers/config-manager' import { getActiveProfile } from '@/_helpers/profile-manager' @@ -58,15 +56,11 @@ export const createStore = () => { }) }) - message.addListener('QUERY_PANEL_STATE', queryStoreState) - message.self.addListener('QUERY_PANEL_STATE', queryStoreState) + message.addListener('QUERY_PIN_STATE', queryStoreState) + message.self.addListener('QUERY_PIN_STATE', queryStoreState) - function queryStoreState({ payload: path }: { payload?: string }) { - return Promise.resolve( - path && typeof path === 'string' - ? get(store.getState(), path) - : store.getState() - ) + async function queryStoreState() { + return store.getState().isPinned } return store diff --git a/src/popup/Popup.tsx b/src/popup/Popup.tsx index 9e45ae94d..b572cea53 100644 --- a/src/popup/Popup.tsx +++ b/src/popup/Popup.tsx @@ -52,9 +52,8 @@ export const Popup: FC<PopupProps> = props => { }) message - .send<'QUERY_PANEL_STATE', boolean>(tabs[0].id, { - type: 'QUERY_PANEL_STATE', - payload: 'widget.isPinned' + .send<'QUERY_PIN_STATE', boolean>(tabs[0].id, { + type: 'QUERY_PIN_STATE' }) .then(isPinned => { setInsCapMode(isPinned ? 'pinMode' : 'mode') diff --git a/src/typings/message.ts b/src/typings/message.ts index 60e6c50d0..c59cb1304 100644 --- a/src/typings/message.ts +++ b/src/typings/message.ts @@ -197,11 +197,9 @@ export type MessageConfig = MessageConfigType<{ payload: boolean } - /** Other pages or frames query for panel state */ - QUERY_PANEL_STATE: { - /** object path, default returns the whole state */ - payload?: string - response?: any + /** From other pages or frames query for active panel pin state */ + QUERY_PIN_STATE: { + response: boolean } /** request searching */
refactor
remove lodash deps
c78d2d7ae41dc08d1c7a8a3900613392825c3527
2020-04-26 11:44:18
crimx
fix(dicts): cnki should respect options
false
diff --git a/src/components/dictionaries/cnki/engine.ts b/src/components/dictionaries/cnki/engine.ts index 0f3af8bf5..153830516 100644 --- a/src/components/dictionaries/cnki/engine.ts +++ b/src/components/dictionaries/cnki/engine.ts @@ -67,8 +67,8 @@ function handleDOM( const result: CNKIResult = { dict: [], - senbi: extractSens($entries, 'img[src="images/word.jpg"]', 'showjd_'), - seneng: extractSens($entries, 'img[src="images/dian_ywlj.gif"]', 'showlj_') + senbi: [], + seneng: [] } if (options.dict) { @@ -93,6 +93,21 @@ function handleDOM( } } + if (options.senbi) { + result.senbi = extractSens( + $entries, + 'img[src="images/word.jpg"]', + 'showjd_' + ) + } + + if (options.seneng) { + result.seneng = extractSens( + $entries, + 'img[src="images/dian_ywlj.gif"]', + 'showlj_' + ) + } // if (options.digests) { // const $digests = $entries.find($e => Boolean($e.querySelector('img[src="images/04.gif"]'))) // if ($digests) {
fix
cnki should respect options
c18f548657af74dd3b868fce80d90772a5710271
2020-01-23 11:22:29
crimx
refactor(options): add update check option
false
diff --git a/src/_locales/en/options.ts b/src/_locales/en/options.ts index 65c00fc1b..b6449a6c9 100644 --- a/src/_locales/en/options.ts +++ b/src/_locales/en/options.ts @@ -188,6 +188,8 @@ export const locale: typeof _locale = { syncWebdav: 'WebDAV Sync Service', touch_mode: 'Touch Mode', touch_mode_help: 'Enable touch related selection', + update_check: 'Check Update', + update_check_help: 'Automatically check update from Github', waveform: 'Waveform Control', waveform_help: 'Display a button at the bottom of the Dict Panel for expanding the Waveform Control Panel. Audio files can still be played if turned off.' diff --git a/src/_locales/zh-CN/options.ts b/src/_locales/zh-CN/options.ts index f2846621e..4774a754d 100644 --- a/src/_locales/zh-CN/options.ts +++ b/src/_locales/zh-CN/options.ts @@ -178,6 +178,8 @@ export const locale = { syncWebdav: '添加 WebDAV 同步', touch_mode: '触摸模式', touch_mode_help: '支持触摸相关选词', + update_check: '检查更新', + update_check_help: '自动检查 Github 更新', waveform: '波形控制按钮', waveform_help: '在词典面板下方显示音频控制面板展开按钮。关闭依然可以播放音频。' diff --git a/src/_locales/zh-TW/options.ts b/src/_locales/zh-TW/options.ts index cd8eec83b..0fc6e852e 100644 --- a/src/_locales/zh-TW/options.ts +++ b/src/_locales/zh-TW/options.ts @@ -180,6 +180,8 @@ export const locale: typeof _locale = { syncWebdav: '新增 WebDAV 同步', touch_mode: '觸控模式', touch_mode_help: '支援觸控相關選字', + update_check: '檢查更新', + update_check_help: '自動檢查 Github 更新', waveform: '波形控制', waveform_help: '在字典介面下方顯示音訊控制面板展開按鈕。關閉依然可以播放音訊。' diff --git a/src/app-config/index.ts b/src/app-config/index.ts index 8e9767b47..17ce4f417 100644 --- a/src/app-config/index.ts +++ b/src/app-config/index.ts @@ -52,6 +52,9 @@ function _getDefaultConfig() { /** enable Google analytics */ analytics: true, + /** enable update check */ + updateCheck: true, + /** disable selection on type fields, like input and textarea */ noTypeField: false, diff --git a/src/background/initialization.ts b/src/background/initialization.ts index b31bc6fb9..cca1f43b2 100644 --- a/src/background/initialization.ts +++ b/src/background/initialization.ts @@ -7,6 +7,7 @@ import { initProfiles } from '@/_helpers/profile-manager' import { injectDictPanel } from '@/_helpers/injectSaladictInternal' import { ContextMenus } from './context-menus' import { BackgroundServer } from './server' +import { openPDF } from './pdf-sniffer' import './types' interface UpdateData { @@ -81,7 +82,7 @@ function onCommand(command: string) { ContextMenus.openYoudao() break case 'open-pdf': - ContextMenus.openPDF() + openPDF() break case 'search-clipboard': BackgroundServer.getInstance().searchClipboard() @@ -116,7 +117,7 @@ async function onInstalled({ } } else if (reason === 'update') { let data: UpdateData | undefined - if (!process.env.DEV_BUILD) { + if (!process.env.DEV_BUILD && window.appConfig.updateCheck) { try { const response = await fetch( 'https://api.github.com/repos/crimx/ext-saladict/releases/latest' diff --git a/src/options/components/options/Privacy/index.tsx b/src/options/components/options/Privacy/index.tsx index 0b6c9ad44..5f1103a9b 100644 --- a/src/options/components/options/Privacy/index.tsx +++ b/src/options/components/options/Privacy/index.tsx @@ -12,6 +12,16 @@ export class Privacy extends React.Component<Props & FormComponentProps> { return ( <Form> + <Form.Item + {...formItemLayout} + label={t('opt.update_check')} + help={t('opt.update_check_help')} + > + {getFieldDecorator('config#updateCheck', { + initialValue: config.updateCheck, + valuePropName: 'checked' + })(<Switch />)} + </Form.Item> <Form.Item {...formItemLayout} label={t('opt.analytics')}
refactor
add update check option
edd001268ac2307bb319f220c14c4fa8907c113a
2018-07-04 09:19:54
CRIMX
feat(selection): support Monaco editor
false
diff --git a/src/_locales/options/messages.json b/src/_locales/options/messages.json index 274271ea5..5b79d1a95 100644 --- a/src/_locales/options/messages.json +++ b/src/_locales/options/messages.json @@ -375,9 +375,9 @@ "zh_TW": "右上彈框" }, "preference_description": { - "en": "Switch off animation transitions to reduce runtime cost. If selection making in editable regions is banned, the extension will identify Input Boxes, TextAreas and other common text editors like CodeMirror and ACE.", - "zh_CN": "关闭过渡动画可减少资源消耗。关闭可编辑区域划词后,本扩展会自动识别输入框以及常见编辑器,如 CodeMirror 和 ACE 。", - "zh_TW": "關閉轉換動畫可減少資源消耗。關閉可編輯區域鼠標滑字后,本程式會自動識別輸入框以及常見編輯器,如 CodeMirror 和 ACE 。" + "en": "Switch off animation transitions to reduce runtime cost. If selection making in editable regions is banned, the extension will identify Input Boxes, TextAreas and other common text editors like CodeMirror, ACE and Monaco.", + "zh_CN": "关闭过渡动画可减少资源消耗。关闭可编辑区域划词后,本扩展会自动识别输入框以及常见编辑器,如 CodeMirror、ACE 和 Monaco。", + "zh_TW": "關閉轉換動畫可減少資源消耗。關閉可編輯區域鼠標滑字后,本程式會自動識別輸入框以及常見編輯器,如 CodeMirror、ACE 和 Monaco。" }, "preference_title": { "en": "Preference", diff --git a/src/selection/index.ts b/src/selection/index.ts index 5ba4941db..9f96e5529 100644 --- a/src/selection/index.ts +++ b/src/selection/index.ts @@ -339,8 +339,8 @@ function isTypeField (traget: EventTarget | null): boolean { return true } - const editorTester = /CodeMirror|ace_editor/ - // Popular code editors CodeMirror and ACE + const editorTester = /CodeMirror|ace_editor|monaco-editor/ + // Popular code editors CodeMirror, ACE and Monaco for (let el = traget as Element | null; el; el = el.parentElement) { // With CodeMirror the `pre.CodeMirror-line` somehow got detached when the event // triggerd. So el will never reach the root `.CodeMirror`.
feat
support Monaco editor
ec7421d02522cc2c4624da9ba48c4cd619280597
2019-06-08 09:14:52
CRIMX
fix(selection): context extraction
false
diff --git a/src/_helpers/selection.ts b/src/_helpers/selection.ts index 9f58c2f49..44d9cde9c 100644 --- a/src/_helpers/selection.ts +++ b/src/_helpers/selection.ts @@ -14,7 +14,7 @@ export function hasSelection (win = window): boolean { } export function getSelectionText (win = window): string { - const selection = win.getSelection().toString().trim() + const selection = (win.getSelection() || '').toString().trim() if (selection) { return selection } @@ -34,6 +34,8 @@ export function getSelectionText (win = window): string { /** Returns the sentence containing the selection text */ export function getSelectionSentence (win = window): string { const selection = win.getSelection() + if (!selection) { return '' } + const selectedText = selection.toString() if (!selectedText.trim()) { return '' } @@ -103,85 +105,86 @@ function cleanText (text: string): string { return text.replace(/\s+/g, ' ').trim() } -function extractSentenceHead (anchorNode: Node, anchorOffset: number): string { - if (anchorNode.nodeType === Node.TEXT_NODE) { - let leadingText = anchorNode.textContent || '' - if (leadingText) { - leadingText = leadingText.slice(0, anchorOffset) - } +function extractSentenceHead (anchorNode: Node | null, anchorOffset: number): string { + if (!anchorNode || anchorNode.nodeType !== Node.TEXT_NODE) { + return '' + } - // prev siblings - for (let node = anchorNode.previousSibling; node; node = node.previousSibling) { - if (node.nodeType === Node.TEXT_NODE) { - leadingText = (node.textContent || '') + leadingText - } else if (node.nodeType === Node.ELEMENT_NODE) { - leadingText = (node as HTMLElement).innerText + leadingText - } - } + let leadingText = anchorNode.textContent || '' + if (leadingText) { + leadingText = leadingText.slice(0, anchorOffset) + } - // parent prev siblings - for ( - let element = anchorNode.parentElement; - element && INLINE_TAGS.has(element.tagName.toLowerCase()) && element !== document.body; - element = element.parentElement - ) { - for (let el = element.previousElementSibling; el; el = el.previousElementSibling) { - leadingText = (el as HTMLElement).innerText + leadingText - } + // prev siblings + for (let node = anchorNode.previousSibling; node; node = node.previousSibling) { + leadingText = getTextFromNode(node) + leadingText + } + + // parent prev siblings + for ( + let element = anchorNode.parentElement; + element && INLINE_TAGS.has(element.tagName.toLowerCase()) && element !== document.body; + element = element.parentElement + ) { + for (let node = element.previousSibling; node; node = node.previousSibling) { + leadingText = getTextFromNode(node) + leadingText } + } - const puncTester = /[.?!。?!…]/ - /** meaningful char after dot "." */ - const charTester = /[^\s.?!。?!…]/ - - for (let i = leadingText.length - 1; i >= 0; i--) { - const c = leadingText[i] - if (puncTester.test(c)) { - if (c === '.' && charTester.test(leadingText[i + 1])) { - // a.b is allowed - continue - } - return leadingText.slice(i + 1) + const puncTester = /[.?!。?!…]/ + /** meaningful char after dot "." */ + const charTester = /[^\s.?!。?!…]/ + + for (let i = leadingText.length - 1; i >= 0; i--) { + const c = leadingText[i] + if (puncTester.test(c)) { + if (c === '.' && charTester.test(leadingText[i + 1])) { + // a.b is allowed + continue } + return leadingText.slice(i + 1) } - - return leadingText } - return '' + return leadingText } -function extractSentenceTail (focusNode: Node, focusOffset: number): string { - if (focusNode.nodeType === Node.TEXT_NODE) { - let tailingText = focusNode.textContent || '' - if (tailingText) { - tailingText = tailingText.slice(focusOffset) - } +function extractSentenceTail (focusNode: Node | null, focusOffset: number): string { + if (!focusNode || focusNode.nodeType !== Node.TEXT_NODE) { + return '' + } - // next siblings - for (let node = focusNode.nextSibling; node; node = node.nextSibling) { - if (node.nodeType === Node.TEXT_NODE) { - tailingText += node.textContent - } else if (node.nodeType === Node.ELEMENT_NODE) { - tailingText += (node as HTMLElement).innerText - } - } + let tailingText = focusNode.textContent || '' + if (tailingText) { + tailingText = tailingText.slice(focusOffset) + } - // parent next siblings - for ( - let element = focusNode.parentElement; - element && INLINE_TAGS.has(element.tagName.toLowerCase()) && element !== document.body; - element = element.parentElement - ) { - for (let el = element.nextElementSibling; el; el = el.nextElementSibling) { - tailingText += (el as HTMLElement).innerText - } - } + // next siblings + for (let node = focusNode.nextSibling; node; node = node.nextSibling) { + tailingText += getTextFromNode(node) + } - // match tail for "..." - const sentenceTailTester = /^((\.(?![\s.?!。?!…]))|[^.?!。?!…])*([.?!。?!…]){0,3}/ - return (tailingText.match(sentenceTailTester) || [''])[0] + // parent next siblings + for ( + let element = focusNode.parentElement; + element && INLINE_TAGS.has(element.tagName.toLowerCase()) && element !== document.body; + element = element.parentElement + ) { + for (let node = element.nextSibling; node; node = node.nextSibling) { + tailingText += getTextFromNode(node) + } } + // match tail for "..." + const sentenceTailTester = /^((\.(?![\s.?!。?!…]))|[^.?!。?!…])*([.?!。?!…]){0,3}/ + return (tailingText.match(sentenceTailTester) || [''])[0] +} + +function getTextFromNode (node: Node): string { + if (node.nodeType === Node.TEXT_NODE) { + return (node.textContent || '') + } else if (node.nodeType === Node.ELEMENT_NODE) { + return (node as HTMLElement).innerText + } return '' }
fix
context extraction
625f46a70c77ece6ff1739852c629519dde04102
2019-09-15 17:41:39
crimx
refactor: add history
false
diff --git a/src/content/redux/modules/epics/searchStart.epic.ts b/src/content/redux/modules/epics/searchStart.epic.ts index 451f740e2..faae8b1f4 100644 --- a/src/content/redux/modules/epics/searchStart.epic.ts +++ b/src/content/redux/modules/epics/searchStart.epic.ts @@ -10,9 +10,13 @@ import { import { merge, from, empty } from 'rxjs' import { StoreAction } from '../' import { Epic, ofType } from '../../utils/operators' -import { isInNotebook } from '@/_helpers/record-manager' +import { isInNotebook, saveWord } from '@/_helpers/record-manager' import { message } from '@/_helpers/browser-api' -import { isPDFPage } from '@/_helpers/saladict' +import { + isPDFPage, + isInternalPage, + isStandalonePage +} from '@/_helpers/saladict' import { DictID } from '@/app-config' import { MachineTranslateResult } from '@/components/dictionaries/helpers' @@ -28,6 +32,17 @@ export const searchStartEpic: Epic = (action$, state$) => } = state$.value const word = searchHistory[historyIndex] + if ( + config.searhHistory && + (!isInternalPage() || isStandalonePage()) && + (!browser.extension.inIncognitoContext || config.searhHistoryInco) && + (historyIndex <= 0 || + searchHistory[historyIndex - 1].text !== word.text || + searchHistory[historyIndex - 1].context !== word.context) + ) { + saveWord('history', word) + } + const toStart = new Set<DictID>() for (const d of renderedDicts) { if (d.searchStatus === 'SEARCHING') {
refactor
add history
72f6abedd67855613d9f07f5bd6ddd6719cc9e06
2018-05-28 15:14:46
CRIMX
fix(database): ignore case
false
diff --git a/src/background/database.ts b/src/background/database.ts index db8bdc374..b0f886fee 100644 --- a/src/background/database.ts +++ b/src/background/database.ts @@ -56,7 +56,7 @@ export const db = new SaladictDB() export function isInNotebook ({ info }: MsgIsInNotebook) { return db.notebook .where('text') - .equals(info.text) + .equalsIgnoreCase(info.text) .count() .then(count => count > 0) } @@ -77,7 +77,7 @@ export function deleteWords ({ area, dates }: MsgDeleteWords) { export function getWordsByText ({ area, text }: MsgGetWordsByText) { return db[area] .where('text') - .equals(text) + .equalsIgnoreCase(text) .toArray() }
fix
ignore case
2a6dd8e8a1491ebe710e1062315843e1971132ed
2019-01-20 17:09:54
CRIMX
refactor(options): collect configs and profiles
false
diff --git a/src/options/components/options/helpers.ts b/src/options/components/options/helpers.ts index 3a0cbc691..94cad962e 100644 --- a/src/options/components/options/helpers.ts +++ b/src/options/components/options/helpers.ts @@ -1,14 +1,20 @@ -import set from 'lodash/set' -import { updateActiveConfig } from '@/_helpers/config-manager' +import { updateConfig } from '@/_helpers/config-manager' import { Props } from './typings' +import { updateProfile } from '@/_helpers/profile-manager' + +import set from 'lodash/set' +import get from 'lodash/get' export const formItemLayout = { labelCol: { span: 5 }, wrapperCol: { span: 8 }, } -export function updateConfig ( - { config }: Props, fields: { [index: string]: any } +let updateConfigTimeout: any = null +let updateProfileTimeout: any = null + +export function updateConfigOrProfile ( + props: Props, fields: { [index: string]: any } ): void { if (!fields) { return } @@ -20,10 +26,39 @@ export function updateConfig ( return } + const key = (path.match(/^(config|profile)#/) || ['', ''])[1] + if (!key) { + if (process.env.DEV_BUILD) { + console.error('invalid field', fields) + } + return + } + if (process.env.DEV_BUILD) { console.log(path, fields[path]) + const err = {} + if (get(props, path.replace(/#/g, '.'), err) === err) { + console.error('field not exist', fields) + } } - set(config, path, fields[path]) - updateActiveConfig(config) + // antd form will swallow '.' path, use '#' instead + set(props, path.replace(/#/g, '.'), fields[path]) + + switch (key) { + case 'config': + clearTimeout(updateConfigTimeout) + updateConfigTimeout = setTimeout(() => { + updateConfig(props.config) + }, 2000) + break + case 'profile': + clearTimeout(updateProfileTimeout) + updateProfileTimeout = setTimeout(() => { + updateProfile(props.profile) + }, 2000) + break + default: + break + } }
refactor
collect configs and profiles
56e054db328b2a9193f33f04e804d59be49f0687
2019-09-04 17:02:40
crimx
refactor(storybook): update panel props
false
diff --git a/src/content/components/DictPanel/DictPanel.stories.tsx b/src/content/components/DictPanel/DictPanel.stories.tsx index 3aaeeee94..fcaa30d51 100644 --- a/src/content/components/DictPanel/DictPanel.stories.tsx +++ b/src/content/components/DictPanel/DictPanel.stories.tsx @@ -113,8 +113,11 @@ function useDictPanelProps(): DictPanelProps { }, {}) return { - x: number('x', (window.innerWidth - 450) / 2), - y: number('y', 10), + coord: { + x: number('x', (window.innerWidth - 450) / 2), + y: number('y', 10) + }, + takeCoordSnapshot: boolean('Take Coord Snapshot', false), width: number('Width', 450), maxHeight: number('Max Height', window.innerHeight - 40), minHeight: number('Min Height', 50),
refactor
update panel props
157a929206754479033e072ed06ac3036b99fc16
2018-05-14 21:45:58
CRIMX
perf(helpers): use DOMParser which is 6 time faster
false
diff --git a/src/_helpers/fetch-dom.ts b/src/_helpers/fetch-dom.ts index 437c94451..4cf94f247 100644 --- a/src/_helpers/fetch-dom.ts +++ b/src/_helpers/fetch-dom.ts @@ -1,14 +1,12 @@ import DOMPurify from 'dompurify' -export function fetchDOM (input?: string | Request, init?: RequestInit): Promise<Document> { +export function fetchDOM (input?: string | Request, init?: RequestInit): Promise<DocumentFragment> { return fetch(input, init) .then(r => r.text()) - .then(text => new DOMParser().parseFromString( - DOMPurify.sanitize(text), - 'text/html', - )) + .then(text => DOMPurify.sanitize(text, { RETURN_DOM_FRAGMENT: true })) } +/** about 6 time faster as it typically takes less than 5ms to parse a DOM */ export function fetchDirtyDOM (input?: string | Request, init?: RequestInit): Promise<Document> { return fetch(input, init) .then(r => r.text()) diff --git a/src/components/dictionaries/cobuild/engine.ts b/src/components/dictionaries/cobuild/engine.ts index f0bf10330..b2f50f0ef 100644 --- a/src/components/dictionaries/cobuild/engine.ts +++ b/src/components/dictionaries/cobuild/engine.ts @@ -1,4 +1,5 @@ -import { fetchDOM } from '@/_helpers/fetch-dom' +import { fetchDirtyDOM } from '@/_helpers/fetch-dom' +import DOMPurify from 'dompurify' import { handleNoResult } from '../helpers' import { AppConfig, DictConfigs } from '@/app-config' import { DictSearchResult } from '@/typings/server' @@ -20,10 +21,10 @@ export default function search ( text: string, config: AppConfig ): Promise<COBUILDSearchResult> { - return fetchDOM('https://www.iciba.com/' + text) + return fetchDirtyDOM('https://www.iciba.com/' + text) .then(doc => handleDom(doc, config.dicts.all.cobuild.options)) .catch(() => { - return fetchDOM('http://www.iciba.com/' + text) + return fetchDirtyDOM('http://www.iciba.com/' + text) .then(doc => handleDom(doc, config.dicts.all.cobuild.options)) }) } @@ -75,7 +76,7 @@ function handleDom ( if ($article) { result.defs = Array.from($article.querySelectorAll('.prep-order')) .slice(0, options.sentence) - .map(d => d.outerHTML) + .map(d => DOMPurify.sanitize(d.outerHTML)) } if (result.title && result.defs && result.defs.length > 0) { diff --git a/src/components/dictionaries/etymonline/engine.ts b/src/components/dictionaries/etymonline/engine.ts index 5cc043f41..7605645e7 100644 --- a/src/components/dictionaries/etymonline/engine.ts +++ b/src/components/dictionaries/etymonline/engine.ts @@ -1,4 +1,5 @@ -import { fetchDOM } from '@/_helpers/fetch-dom' +import { fetchDirtyDOM } from '@/_helpers/fetch-dom' +import DOMPurify from 'dompurify' import { handleNoResult } from '../helpers' import { AppConfig } from '@/app-config' import { DictSearchResult } from '@/typings/server' @@ -20,7 +21,7 @@ export default function search ( const options = config.dicts.all.etymonline.options // http to bypass the referer checking - return fetchDOM('http://www.etymonline.com/search?q=' + text) + return fetchDirtyDOM('http://www.etymonline.com/search?q=' + text) .then(doc => handleDom(doc, options)) } @@ -49,7 +50,7 @@ function handleDom ( let word = ($cf.textContent || '').trim() $cf.outerHTML = `<a href="https://www.etymonline.com/word/${word}" target="_blank">${word}</a>` }) - def = $def.outerHTML + def = DOMPurify.sanitize($def.outerHTML) } if (title && def) {
perf
use DOMParser which is 6 time faster
5ed955f27abedd79a23d736478146cefef12a52e
2019-09-29 17:30:01
crimx
docs: update contibuting guide
false
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 35d59116d..9abd92072 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,11 +16,9 @@ Clone the repo and run `yarn install`. ## UI Tweaking -Run `yarn start --main=[entry id]` to view a certain entry with WDS in a fake WebExtension environment. +Run `yarn storybook` to view all the components. -Entry ids are generally directory names in `src`. - -`index.[html/js(x)/ts(x)` in `[entry id]/__fake__` has higher priority. +Run `yarn start --wextentry [entry id]` to view a certain entry with WDS in a fake WebExtension environment. ## Testing @@ -28,13 +26,10 @@ Run `yarn test` to run Jest. Supports all the Jest [options](https://jestjs.io/d ## Building -Run `yarn devbuild` to start a quick build without compression. - Run `yarn build` to start a full build. Toggle: -- `--notypecheck`: Skip TypeScript full check. - `--analyze`: Show detailed Webpack bundle analyzer. ## Releasing @@ -48,20 +43,20 @@ Run `yarn zip` to pack zibballs to `./dist/`. ## How to add a dictionary 1. Create a directory at [`src/components/dictionaries/`](./src/components/dictionaries/), with the name of the dict ID. - 1. Use any existing dictionary as guidance, e.g. [Bing](./src/components/dictionaries/bing). Copy files to the new directory. - 1. Replace the favicon with a new LOGO. - 1. Edit `config.ts` to change default options. See the `DictItem` type and explanation for more details. Register the dictionary in [app config](./src/app-config/dicts.ts) so that TypeScript generates the correct typings. Dict ID **MUST** follow alphabetical order. - 1. Update `_locales.json` with the new dictionary name. Add locales for options, if any. - 1. `engine.ts` **MUST** export at least two functions: - 1. `getSrcPage` function which is responsible for generating source page url base on search text and app config. Source page url is opened when user clicks the dictionary title. - 1. `search` function which is responsible for fetching, parsing and returning dictionary results. See the typings for more detail. - - Extracting information from a webpage **MUST** use helper functions in [../helpers.ts](./components/dictionaries/helpers.ts) for data cleansing. - - If the dictionary supports pronunciation: - 1. Register the ID at [`config.autopron`](https://github.com/crimx/ext-saladict/blob/a88cfed84129418b65914351ca14b86d7b1b758b/src/app-config/index.ts#L202-L223). - 1. Include an [`audio`](https://github.com/crimx/ext-saladict/blob/a88cfed84129418b65914351ca14b86d7b1b758b/src/typings/server.ts#L5-L9) field in the object which search engine returns. + 1. Use any existing dictionary as guidance, e.g. [Bing](./src/components/dictionaries/bing). Copy files to the new directory. + 1. Replace the favicon with a new LOGO. + 1. Edit `config.ts` to change default options. See the `DictItem` type and explanation for more details. Register the dictionary in [app config](./src/app-config/dicts.ts) so that TypeScript generates the correct typings. Dict ID **MUST** follow alphabetical order. + 1. Update `_locales.json` with the new dictionary name. Add locales for options, if any. + 1. `engine.ts` **MUST** export at least two functions: + 1. `getSrcPage` function which is responsible for generating source page url base on search text and app config. Source page url is opened when user clicks the dictionary title. + 1. `search` function which is responsible for fetching, parsing and returning dictionary results. See the typings for more detail. + - Extracting information from a webpage **MUST** use helper functions in [../helpers.ts](./components/dictionaries/helpers.ts) for data cleansing. + - If the dictionary supports pronunciation: + 1. Register the ID at [`config.autopron`](https://github.com/crimx/ext-saladict/blob/a88cfed84129418b65914351ca14b86d7b1b758b/src/app-config/index.ts#L202-L223). + 1. Include an [`audio`](https://github.com/crimx/ext-saladict/blob/a88cfed84129418b65914351ca14b86d7b1b758b/src/typings/server.ts#L5-L9) field in the object which search engine returns. 1. Other exported functions can be called from `View.tsx` via `DictEngineMethod` message channel, see `src/typings/message` for typing details (also don't use the native `sendMessage` function, import `{ message }` from `'@/_helpers/browser-api'`). - 1. Search result will ultimately be passed to a React PureComponent in `View.tsx`, which **SHOULD** be a dumb component that renders the result accordingly. - 1. Scope the styles in `_style.scss` following [ECSS](http://ecss.io/chapter5.html#anatomy-of-the-ecss-naming-convention)-ish naming convention. + 1. Search result will ultimately be passed to a React PureComponent in `View.tsx`, which **SHOULD** be a dumb component that renders the result accordingly. + 1. Scope the styles in `_style.scss` following [ECSS](http://ecss.io/chapter5.html#anatomy-of-the-ecss-naming-convention)-ish naming convention. Add Testing @@ -70,9 +65,8 @@ Add Testing Develop the dictionary UI live -1. Intercept ajax calls in [`config/fake-env/fake-ajax.js`](./config/fake-env/fake-ajax.js). Use the testing response samples. -1. Edit [`src/components/__fake__/index.tsx`](./src/components/__fake__/index.tsx). -1. Run `yarn start --main=components`. +1. Edit `test/specs/components/dictionaries/[dictID]/request.mock.ts`. +1. Run `yarn storybook`. ## Code Style
docs
update contibuting guide
7a57e1c0f7ec502720209ef4203308d609c85e6f
2021-05-23 11:24:08
crimx
refactor(dict-panel): let mta box support command key on mac
false
diff --git a/src/content/components/MtaBox/MtaBox.tsx b/src/content/components/MtaBox/MtaBox.tsx index 75bd9cee..3a59a08e 100644 --- a/src/content/components/MtaBox/MtaBox.tsx +++ b/src/content/components/MtaBox/MtaBox.tsx @@ -85,7 +85,7 @@ export const MtaBox: FC<MtaBoxProps> = props => { // prevent page shortkeys e.nativeEvent.stopPropagation() - if (e.key === 'Enter' && e.ctrlKey) { + if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) { props.searchText(props.text) }
refactor
let mta box support command key on mac
2fed50f3d8f5987b1a0604b51af159e43124d0f7
2019-09-06 10:08:03
crimx
refactor(panel): init editor word separately
false
diff --git a/src/content/components/WordEditor/WordEditor.container.tsx b/src/content/components/WordEditor/WordEditor.container.tsx index 19abe73a7..5198c2427 100644 --- a/src/content/components/WordEditor/WordEditor.container.tsx +++ b/src/content/components/WordEditor/WordEditor.container.tsx @@ -12,14 +12,14 @@ const mapStateToProps = ( withAnimation: state.config.animation, width: window.innerWidth - state.config.panelWidth - 100, ctxTrans: state.config.ctxTrans, - word: state.selection.word + word: state.wordEditorWord }) const mapDispatchToProps = ( dispatch: Dispatch<StoreAction> ): Pick<WordEditorPortalProps, Dispatchers> => ({ onClose: () => { - dispatch({ type: 'WORD_EDITOR_STATUS', payload: false }) + dispatch({ type: 'WORD_EDITOR_STATUS', payload: null }) } }) diff --git a/src/content/redux/modules/action-catalog.ts b/src/content/redux/modules/action-catalog.ts index 321eb16e9..073f9e5de 100644 --- a/src/content/redux/modules/action-catalog.ts +++ b/src/content/redux/modules/action-catalog.ts @@ -106,6 +106,6 @@ export type ActionCatalog = { \* ------------------------------------------------ */ WORD_EDITOR_STATUS: { - payload: boolean + payload: Word | null } } diff --git a/src/content/redux/modules/epics/index.ts b/src/content/redux/modules/epics/index.ts index 160573ef1..5a0ecb4a3 100644 --- a/src/content/redux/modules/epics/index.ts +++ b/src/content/redux/modules/epics/index.ts @@ -32,7 +32,7 @@ export const epics = combineEpics<StoreAction, StoreAction, StoreState>( if (state$.value.config.editOnFav) { return of({ type: 'WORD_EDITOR_STATUS', - payload: true + payload: state$.value.selection.word } as const) } diff --git a/src/content/redux/modules/init.ts b/src/content/redux/modules/init.ts index 5688fb3fd..66ea1b23c 100644 --- a/src/content/redux/modules/init.ts +++ b/src/content/redux/modules/init.ts @@ -92,6 +92,11 @@ export const init: Init<StoreActionCatalog, StoreState> = ( } } return Promise.resolve() + + case 'UPDATE_WORD_EDITOR_WORD': + dispatch({ type: 'WORD_EDITOR_STATUS', payload: msg.payload }) + dispatch({ type: 'SEARCH_START', payload: { word: msg.payload } }) + return Promise.resolve() } }) diff --git a/src/content/redux/modules/reducer/index.ts b/src/content/redux/modules/reducer/index.ts index cb43b881d..c1e6fa172 100644 --- a/src/content/redux/modules/reducer/index.ts +++ b/src/content/redux/modules/reducer/index.ts @@ -187,6 +187,7 @@ export const reducer = createReducer< ? { ...state, isShowWordEditor: true, + wordEditorWord: payload, dictPanelCoord: { x: 50, y: window.innerHeight * 0.2 diff --git a/src/content/redux/modules/state.ts b/src/content/redux/modules/state.ts index a2744f372..4e2af56b7 100644 --- a/src/content/redux/modules/state.ts +++ b/src/content/redux/modules/state.ts @@ -30,6 +30,7 @@ export const initState = () => ({ /** is a standalone quick search panel running */ withQSPanel: false, isShowWordEditor: false, + wordEditorWord: newWord(), isShowBowl: false, isShowDictPanel: isStandalonePage() || isOptionsPage(), isExpandMtaBox: false, diff --git a/src/typings/message.ts b/src/typings/message.ts index 9b8bddbfb..007afe446 100644 --- a/src/typings/message.ts +++ b/src/typings/message.ts @@ -244,6 +244,14 @@ export type MessageConfig = { payload: boolean } + /* ------------------------------------------------ *\ + Word Editor + \* ------------------------------------------------ */ + + UPDATE_WORD_EDITOR_WORD: { + payload: Word + } + /* ------------------------------------------------ *\ Sync services \* ------------------------------------------------ */
refactor
init editor word separately
5437aa899255e3531f8db763276831061a4b681e
2018-01-30 05:05:02
greenkeeper[bot]
chore(package): update dotenv to version 5.0.0
false
diff --git a/package.json b/package.json index 31cdd313b..3628ca22d 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "copy-webpack-plugin": "^4.3.1", "css-loader": "0.28.9", "cz-conventional-changelog": "^2.1.0", - "dotenv": "4.0.0", + "dotenv": "5.0.0", "extract-text-webpack-plugin": "3.0.2", "file-loader": "1.1.6", "fork-ts-checker-webpack-plugin": "^0.3.0",
chore
update dotenv to version 5.0.0
e2613fcd889477cba6d2d61d40f95ab380d7e658
2018-04-29 19:03:19
CRIMX
fix(content): fix long press ctrl
false
diff --git a/src/selection/index.ts b/src/selection/index.ts index 9d41d17ce..ff450a1f1 100644 --- a/src/selection/index.ts +++ b/src/selection/index.ts @@ -6,7 +6,7 @@ import * as selection from '@/_helpers/selection' import { MsgType, PostMsgType, PostMsgSelection, MsgSelection } from '@/typings/message' import { Observable, fromEvent, timer, merge, of, asyncScheduler } from 'rxjs' -import { map, mapTo, scan, filter, take, switchMap, buffer, debounceTime, observeOn, share } from 'rxjs/operators' +import { map, mapTo, scan, filter, take, switchMap, buffer, debounceTime, observeOn, share, distinctUntilChanged } from 'rxjs/operators' message.addListener(MsgType.__PreloadSelection__, (data, sender) => { return Promise.resolve(selection.getSelectionInfo()) @@ -42,6 +42,8 @@ const isCtrlPressed$: Observable<boolean> = merge( mapTo(false)(fromEvent(window, 'keyup', { capture: true })), mapTo(false)(fromEvent(window, 'blur', { capture: true })), of(false) +).pipe( + distinctUntilChanged() ) const validCtrlPressed$$ = isCtrlPressed$.pipe(
fix
fix long press ctrl
54ffd9de66e69235156b10aa263c012e24bd3e7f
2020-07-12 20:37:04
crimx
chore(release): 7.14.5
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bebf0e08..db6a46089 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [7.14.5](https://github.com/crimx/ext-saladict/compare/v7.14.4...v7.14.5) (2020-07-12) + + +### Bug Fixes + +* **panel:** set missing initial config ([791cb57](https://github.com/crimx/ext-saladict/commit/791cb57cbd40264b255da03576693af3a15daf24)) + ### [7.14.4](https://github.com/crimx/ext-saladict/compare/v7.14.3...v7.14.4) (2020-07-12) diff --git a/package.json b/package.json index ecc92c748..e0c20dcbe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "saladict", - "version": "7.14.4", + "version": "7.14.5", "description": "Chrome extension and Firefox WebExtension, inline translator powered by mutiple online dictionaries", "private": true, "scripts": {
chore
7.14.5
a0e5e87267fe704f891339692c3bd17a35fb1429
2020-09-17 11:24:57
crimx
chore(dicts): update tencent auth url
false
diff --git a/src/components/dictionaries/tencent/auth.ts b/src/components/dictionaries/tencent/auth.ts index feaa57989..07883dc8a 100644 --- a/src/components/dictionaries/tencent/auth.ts +++ b/src/components/dictionaries/tencent/auth.ts @@ -3,4 +3,4 @@ export const auth = { secretKey: '' } -export const url = 'https://cloud.tencent.com/product/tmt' +export const url = 'https://curl.qcloud.com/imsowZzT'
chore
update tencent auth url
c92a7d0bf1c8fbac6eb6d97c1ce432204609eef2
2018-06-17 16:01:59
CRIMX
feat(content): add query panel state
false
diff --git a/src/content/redux/create.ts b/src/content/redux/create.ts index 03ff1e41a..2b4c64402 100644 --- a/src/content/redux/create.ts +++ b/src/content/redux/create.ts @@ -8,7 +8,13 @@ import { startUpAction as widgetStartUp } from './modules/widget' import { startUpAction as dictionariesStartUp } from './modules/dictionaries' import { message } from '@/_helpers/browser-api' -import { MsgType, MsgIsPinned } from '@/typings/message' +import { MsgType, MsgIsPinned, MsgQueryPanelState } from '@/typings/message' + +import { Observable } from 'rxjs/Observable' +import { map } from 'rxjs/operators/map' +import { distinctUntilChanged } from 'rxjs/operators/distinctUntilChanged' + +import get from 'lodash/get' export default () => { const composeEnhancers = window['__REDUX_DEVTOOLS_EXTENSION_COMPOSE__'] || compose @@ -24,14 +30,29 @@ export default () => { store.dispatch<any>(dictionariesStartUp()) // sync state - store.subscribe(() => { - const state = store.getState() + const storeState$ = new Observable<StoreState>(observer => { + store.subscribe(() => observer.next(store.getState())) + }) + storeState$.pipe( + map(state => state.widget.isPinned), + distinctUntilChanged() + ).subscribe(isPinned => { message.self.send<MsgIsPinned>({ type: MsgType.IsPinned, - isPinned: state.widget.isPinned, + isPinned, }) }) + message.addListener<MsgQueryPanelState>(MsgType.QueryPanelState, queryStoreState) + message.self.addListener<MsgQueryPanelState>(MsgType.QueryPanelState, queryStoreState) + + function queryStoreState ({ path }: MsgQueryPanelState) { + return Promise.resolve(path && typeof path === 'string' + ? get(store.getState(), path) + : store.getState() + ) + } + return store } diff --git a/src/typings/message.ts b/src/typings/message.ts index f171582c4..9159ace1e 100644 --- a/src/typings/message.ts +++ b/src/typings/message.ts @@ -50,6 +50,9 @@ export const enum MsgType { /** Word page */ EditWord, + /** Query panel state */ + QueryPanelState, + /** * Background proxy sends back underlyingly */ @@ -167,3 +170,9 @@ export interface MsgIsPinned { type: MsgType.IsPinned isPinned: boolean } + +export interface MsgQueryPanelState { + type: MsgType.QueryPanelState, + /** object path, default returns the whole state */ + path?: string +}
feat
add query panel state
346dbacc800232223419c570d6a9ede856f91cac
2019-09-09 22:38:18
crimx
build: new pack script
false
diff --git a/package.json b/package.json index 9810c5528..6ac4820ed 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "build": "webpack --mode production", "devbuild": "webpack --mode development", "type-check": "tsc --noEmit", - "zip": "node scripts/pack.js", + "zip": "yarn neutrino-webextension-zip", "test": "node scripts/test.js --env=jsdom", "commit": "git-cz", "release": "standard-version", diff --git a/scripts/pack.js b/scripts/pack.js deleted file mode 100644 index 7be53f38b..000000000 --- a/scripts/pack.js +++ /dev/null @@ -1,70 +0,0 @@ -const fs = require('fs') -const path = require('path') -const archiver = require('archiver') - -pack('chrome') -pack('firefox') -packSource() - -function pack (browser) { - return new Promise((resolve, reject) => { - var output = fs.createWriteStream(path.join(__dirname, `../dist/${browser}.zip`)) - var archive = archiver('zip', {}) - - output.on('close', resolve) - - archive.on('warning', function(err) { - if (err.code === 'ENOENT') { - console.warn(err) - } else { - reject(err) - } - }) - - archive.on('error', reject) - - archive.pipe(output) - - archive.glob(`**/*`, { - cwd: path.join(__dirname, '../dist', browser), - ignore: `**/*.map` - }) - - archive.finalize() - }) -} - -function packSource () { - return new Promise((resolve, reject) => { - var output = fs.createWriteStream(path.join(__dirname, `../dist/source.zip`)) - var archive = archiver('zip', {}) - - output.on('close', resolve) - - archive.on('warning', function(err) { - if (err.code === 'ENOENT') { - console.warn(err) - } else { - reject(err) - } - }) - - archive.on('error', reject) - - archive.pipe(output) - - fs.readdirSync(path.join(__dirname, `..`)) - .filter(name => !/^(\.github|dist|node_modules|\.git)$/.test(name)) - .forEach(name => { - const filePath = path.join(__dirname, `../`, name) - const stats = fs.lstatSync(filePath) - if (stats.isDirectory()) { - archive.directory(filePath, name) - } else if (stats.isFile()) { - archive.file(filePath, { name }) - } - }) - - archive.finalize() - }) -}
build
new pack script
75460919421efa29c299855bc88794173c0d8d8b
2018-09-11 09:27:13
CRIMX
docs: update docs
false
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 53dd8bd17..7412be58a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,6 +49,8 @@ Toggle: ## How to add a dictionary +Check out [style-extractor.js](./scripts/style-extractor.js) and [helpers.ts](./components/dictionaries/helpers.ts) for useful tools to extract information from a webpage. + 1. Register the dictionary in [app config](./src/app-config/dicts.ts) so that TypeScript generates the correct typings. Dict ID should follow alphabetical order. 1. Create a directory at [`src/components/dictionaries/`](./src/components/dictionaries/), with the name of the dict ID. 1. Use [Bing](./src/components/dictionaries/bing) as guidance. Copy the files to the new directory. diff --git a/README.md b/README.md index d4f318940..ba7e9ad13 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Saladict 6 is a complete rewrite in React Typescript for both Chrome & Firefox. [CHANGELOG.md](./CHANGELOG.md) -## How can I contribute? +## How can I contribute / build from source? [CONTRIBUTING.md](./CONTRIBUTING.md)
docs
update docs
126cda81206fceb4a2fb07726332fe8704e8d4f0
2018-02-27 04:10:04
greenkeeper[bot]
chore(package): update dotenv to version 5.0.1
false
diff --git a/package.json b/package.json index ed7d8ffed..5c131fe94 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "copy-webpack-plugin": "^4.3.1", "css-loader": "0.28.10", "cz-conventional-changelog": "^2.1.0", - "dotenv": "5.0.0", + "dotenv": "5.0.1", "extract-text-webpack-plugin": "3.0.2", "file-loader": "1.1.9", "fork-ts-checker-webpack-plugin": "^0.4.0",
chore
update dotenv to version 5.0.1
372535d2bf3dd4c60e2b46db702ae73f70b0a5ba
2019-07-31 21:13:08
crimx
chore: update packages
false
diff --git a/package.json b/package.json index cb47a1da2..52a0d7fd7 100644 --- a/package.json +++ b/package.json @@ -40,12 +40,14 @@ } }, "dependencies": { + "@types/dompurify": "^0.0.33", "@types/i18next": "^12.1.0", "@types/lodash": "^4.14.136", "@types/react": "^16.8.23", "@types/react-dom": "^16.8.4", - "@types/react-i18next": "^8.1.0", "@types/react-transition-group": "^2.9.2", + "axios": "^0.19.0", + "dompurify": "^1.0.11", "i18next": "^17.0.6", "lodash": "^4.17.14", "normalize-scss": "^7.0.1", @@ -79,6 +81,7 @@ "@typescript-eslint/eslint-plugin": "^1.11.0", "@typescript-eslint/parser": "^1.11.0", "autoprefixer": "^9.6.1", + "axios-mock-adapter": "^1.17.0", "babel-plugin-react-docgen-typescript": "^1.2.0", "clean-css-loader": "^2.0.0", "commitizen": "^3.1.1", @@ -99,6 +102,7 @@ "node-sass": "^4.12.0", "postcss-loader": "^3.0.0", "prettier": "^1.18.2", + "raw-loader": "^3.1.0", "sass-loader": "^7.1.0", "standard-version": "^6.0.1", "to-string-loader": "^1.1.5", diff --git a/yarn.lock b/yarn.lock index 7b5e11418..421e249a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,13 +2,20 @@ # yarn lockfile v1 -"@babel/[email protected]", "@babel/code-frame@^7.0.0": +"@babel/[email protected]": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== dependencies: "@babel/highlight" "^7.0.0" +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" + integrity sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw== + dependencies: + "@babel/highlight" "^7.0.0" + "@babel/[email protected]": version "7.4.3" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.4.3.tgz#198d6d3af4567be3989550d97e068de94503074f" @@ -30,33 +37,33 @@ source-map "^0.5.0" "@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.4.3", "@babel/core@^7.4.5": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.5.0.tgz#6ed6a2881ad48a732c5433096d96d1b0ee5eb734" - integrity sha512-6Isr4X98pwXqHvtigw71CKgmhL1etZjPs5A67jL/w0TkLM9eqmFR40YrnJvEc1WnMZFsskjsmid8bHZyxKEAnw== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.5.0" - "@babel/helpers" "^7.5.0" - "@babel/parser" "^7.5.0" + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.5.5.tgz#17b2686ef0d6bc58f963dddd68ab669755582c30" + integrity sha512-i4qoSr2KTtce0DmkuuQBV4AuQgGPUcPXMr9L5MyYAtk06z068lQ10a4O009fe5OB/DfNV+h+qqT7ddNV8UnRjg== + dependencies: + "@babel/code-frame" "^7.5.5" + "@babel/generator" "^7.5.5" + "@babel/helpers" "^7.5.5" + "@babel/parser" "^7.5.5" "@babel/template" "^7.4.4" - "@babel/traverse" "^7.5.0" - "@babel/types" "^7.5.0" + "@babel/traverse" "^7.5.5" + "@babel/types" "^7.5.5" convert-source-map "^1.1.0" debug "^4.1.0" json5 "^2.1.0" - lodash "^4.17.11" + lodash "^4.17.13" resolve "^1.3.2" semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.4.0", "@babel/generator@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.5.0.tgz#f20e4b7a91750ee8b63656073d843d2a736dca4a" - integrity sha512-1TTVrt7J9rcG5PMjvO7VEG3FrEoEJNHxumRq66GemPmzboLWtIjjcJgk8rokuAS7IiRSpgVSu5Vb9lc99iJkOA== +"@babel/generator@^7.4.0", "@babel/generator@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.5.5.tgz#873a7f936a3c89491b43536d12245b626664e3cf" + integrity sha512-ETI/4vyTSxTzGnU2c49XHv2zhExkv9JHLTwDAFz85kmcwuShvYG2H08FwgIguQf4JC75CBnXAUM5PqeF4fj0nQ== dependencies: - "@babel/types" "^7.5.0" + "@babel/types" "^7.5.5" jsesc "^2.5.1" - lodash "^4.17.11" + lodash "^4.17.13" source-map "^0.5.0" trim-right "^1.0.1" @@ -92,26 +99,26 @@ "@babel/traverse" "^7.4.4" "@babel/types" "^7.4.4" -"@babel/helper-create-class-features-plugin@^7.4.0", "@babel/helper-create-class-features-plugin@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.5.0.tgz#02edb97f512d44ba23b3227f1bf2ed43454edac5" - integrity sha512-EAoMc3hE5vE5LNhMqDOwB1usHvmRjCDAnH8CD4PVkX9/Yr3W/tcz8xE8QvdZxfsFBDICwZnF2UTHIqslRpvxmA== +"@babel/helper-create-class-features-plugin@^7.4.0", "@babel/helper-create-class-features-plugin@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.5.5.tgz#401f302c8ddbc0edd36f7c6b2887d8fa1122e5a4" + integrity sha512-ZsxkyYiRA7Bg+ZTRpPvB6AbOFKTFFK4LrvTet8lInm0V468MWCaSYJE+I7v2z2r8KNLtYiV+K5kTCnR7dvyZjg== dependencies: "@babel/helper-function-name" "^7.1.0" - "@babel/helper-member-expression-to-functions" "^7.0.0" + "@babel/helper-member-expression-to-functions" "^7.5.5" "@babel/helper-optimise-call-expression" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.4.4" + "@babel/helper-replace-supers" "^7.5.5" "@babel/helper-split-export-declaration" "^7.4.4" -"@babel/helper-define-map@^7.4.0", "@babel/helper-define-map@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.4.4.tgz#6969d1f570b46bdc900d1eba8e5d59c48ba2c12a" - integrity sha512-IX3Ln8gLhZpSuqHJSnTNBWGDE9kdkTEWl21A/K7PQ00tseBwbqCHTvNLHSBd9M0R5rER4h5Rsvj9vw0R5SieBg== +"@babel/helper-define-map@^7.4.0", "@babel/helper-define-map@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.5.5.tgz#3dec32c2046f37e09b28c93eb0b103fd2a25d369" + integrity sha512-fTfxx7i0B5NJqvUOBBGREnrqbTxRh7zinBANpZXAVDlsZxYdclDp467G1sQ8VZYMnAURY3RpBUAgOYT9GfzHBg== dependencies: "@babel/helper-function-name" "^7.1.0" - "@babel/types" "^7.4.4" - lodash "^4.17.11" + "@babel/types" "^7.5.5" + lodash "^4.17.13" "@babel/helper-explode-assignable-expression@^7.1.0": version "7.1.0" @@ -144,12 +151,12 @@ dependencies: "@babel/types" "^7.4.4" -"@babel/helper-member-expression-to-functions@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0.tgz#8cd14b0a0df7ff00f009e7d7a436945f47c7a16f" - integrity sha512-avo+lm/QmZlv27Zsi0xEor2fKcqWG56D5ae9dzklpIaY7cQMK5N8VSpaNVPPagiqmy7LrEjK1IWdGMOqPu5csg== +"@babel/helper-member-expression-to-functions@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.5.5.tgz#1fb5b8ec4453a93c439ee9fe3aeea4a84b76b590" + integrity sha512-5qZ3D1uMclSNqYcXqiHoA0meVdv+xUEex9em2fqMnrk/scphGlGgg66zjMrPJESPwrFJ6sbfFQYUSa0Mz7FabA== dependencies: - "@babel/types" "^7.0.0" + "@babel/types" "^7.5.5" "@babel/helper-module-imports@^7.0.0": version "7.0.0" @@ -159,16 +166,16 @@ "@babel/types" "^7.0.0" "@babel/helper-module-transforms@^7.1.0", "@babel/helper-module-transforms@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.4.4.tgz#96115ea42a2f139e619e98ed46df6019b94414b8" - integrity sha512-3Z1yp8TVQf+B4ynN7WoHPKS8EkdTbgAEy0nU0rs/1Kw4pDgmvYH3rz3aI11KgxKCba2cn7N+tqzV1mY2HMN96w== + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.5.5.tgz#f84ff8a09038dcbca1fd4355661a500937165b4a" + integrity sha512-jBeCvETKuJqeiaCdyaheF40aXnnU1+wkSiUs/IQg3tB85up1LyL8x77ClY8qJpuRJUcXQo+ZtdNESmZl4j56Pw== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-simple-access" "^7.1.0" "@babel/helper-split-export-declaration" "^7.4.4" "@babel/template" "^7.4.4" - "@babel/types" "^7.4.4" - lodash "^4.17.11" + "@babel/types" "^7.5.5" + lodash "^4.17.13" "@babel/helper-optimise-call-expression@^7.0.0": version "7.0.0" @@ -183,11 +190,11 @@ integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA== "@babel/helper-regex@^7.0.0", "@babel/helper-regex@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.4.4.tgz#a47e02bc91fb259d2e6727c2a30013e3ac13c4a2" - integrity sha512-Y5nuB/kESmR3tKjU8Nkn1wMGEx1tjJX076HBMeL3XLQCu6vA/YRzuTW0bbb+qRnXvQGn+d6Rx953yffl8vEy7Q== + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.5.5.tgz#0aa6824f7100a2e0e89c1527c23936c152cab351" + integrity sha512-CkCYQLkfkiugbRDO8eZn6lRuR8kzZoGXCg3149iTk5se7g6qykSpy3+hELSwquhu+TgHn8nkLiBwHvNX8Hofcw== dependencies: - lodash "^4.17.11" + lodash "^4.17.13" "@babel/helper-remap-async-to-generator@^7.1.0": version "7.1.0" @@ -200,15 +207,15 @@ "@babel/traverse" "^7.1.0" "@babel/types" "^7.0.0" -"@babel/helper-replace-supers@^7.1.0", "@babel/helper-replace-supers@^7.4.0", "@babel/helper-replace-supers@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.4.4.tgz#aee41783ebe4f2d3ab3ae775e1cc6f1a90cefa27" - integrity sha512-04xGEnd+s01nY1l15EuMS1rfKktNF+1CkKmHoErDppjAAZL+IUBZpzT748x262HF7fibaQPhbvWUl5HeSt1EXg== +"@babel/helper-replace-supers@^7.4.0", "@babel/helper-replace-supers@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.5.5.tgz#f84ce43df031222d2bad068d2626cb5799c34bc2" + integrity sha512-XvRFWrNnlsow2u7jXDuH4jDDctkxbS7gXssrP4q2nUD606ukXHRvydj346wmNg+zAgpFx4MWf4+usfC93bElJg== dependencies: - "@babel/helper-member-expression-to-functions" "^7.0.0" + "@babel/helper-member-expression-to-functions" "^7.5.5" "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/traverse" "^7.4.4" - "@babel/types" "^7.4.4" + "@babel/traverse" "^7.5.5" + "@babel/types" "^7.5.5" "@babel/helper-simple-access@^7.1.0": version "7.1.0" @@ -235,23 +242,14 @@ "@babel/traverse" "^7.1.0" "@babel/types" "^7.2.0" -"@babel/helpers@^7.4.3": - version "7.5.1" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.5.1.tgz#65407c741a56ddd59dd86346cd112da3de912db3" - integrity sha512-rVOTDv8sH8kNI72Unenusxw6u+1vEepZgLxeV+jHkhsQlYhzVhzL1EpfoWT7Ub3zpWSv2WV03V853dqsnyoQzA== - dependencies: - "@babel/template" "^7.4.4" - "@babel/traverse" "^7.5.0" - "@babel/types" "^7.5.0" - -"@babel/helpers@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.5.0.tgz#7f0c17666e7ed8355ed6eff643dde12fb681ddb4" - integrity sha512-EgCUEa8cNwuMrwo87l2d7i2oShi8m2Q58H7h3t4TWtqATZalJYFwfL9DulRe02f3KdqM9xmMCw3v/7Ll+EiaWg== +"@babel/helpers@^7.4.3", "@babel/helpers@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.5.5.tgz#63908d2a73942229d1e6685bc2a0e730dde3b75e" + integrity sha512-nRq2BUhxZFnfEn/ciJuhklHvFOqjJUD5wpx+1bxUF2axL9C+v4DE/dmp5sT2dKnpOs4orZWzpAZqlCy8QqE/7g== dependencies: "@babel/template" "^7.4.4" - "@babel/traverse" "^7.5.0" - "@babel/types" "^7.5.0" + "@babel/traverse" "^7.5.5" + "@babel/types" "^7.5.5" "@babel/highlight@^7.0.0": version "7.5.0" @@ -262,10 +260,10 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.5.0.tgz#3e0713dff89ad6ae37faec3b29dcfc5c979770b7" - integrity sha512-I5nW8AhGpOXGCCNYGc+p7ExQIBxRFnS2fd/d862bNOKvmoEPjYPcfIjsfdy0ujagYOIYPczKgD9l3FsgTkAzKA== +"@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.5.5.tgz#02f077ac8817d3df4a832ef59de67565e71cca4b" + integrity sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g== "@babel/plugin-proposal-async-generator-functions@^7.2.0": version "7.2.0" @@ -285,11 +283,11 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-proposal-class-properties@^7.3.3", "@babel/plugin-proposal-class-properties@^7.4.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.5.0.tgz#5bc6a0537d286fcb4fd4e89975adbca334987007" - integrity sha512-9L/JfPCT+kShiiTTzcnBJ8cOwdKVmlC1RcCf9F0F9tERVrM4iWtWnXtjWCRqNm2la2BxO1MPArWNsU9zsSJWSQ== + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.5.5.tgz#a974cfae1e37c3110e71f3c6a2e48b8e71958cd4" + integrity sha512-AF79FsnWFxjlaosgdi421vmYG6/jg79bVD0dpD44QdgobzHKuLZ6S3vl8la9qIeSwGi8i1fS0O1mfuDAAdo1/A== dependencies: - "@babel/helper-create-class-features-plugin" "^7.5.0" + "@babel/helper-create-class-features-plugin" "^7.5.5" "@babel/helper-plugin-utils" "^7.0.0" "@babel/[email protected]": @@ -325,18 +323,10 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-object-rest-spread" "^7.2.0" -"@babel/plugin-proposal-object-rest-spread@^7.3.2", "@babel/plugin-proposal-object-rest-spread@^7.4.3": - version "7.5.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.5.1.tgz#5788ab097c63135e4236548b4f112bfce09dd394" - integrity sha512-PVGXx5LYHcT7L4MdoE+rM5uq68IKlvU9lljVQ4OXY6aUEnGvezcGbM4VNY57Ug+3R2Zg/nYHlEdiWoIBoRA0mw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-object-rest-spread" "^7.2.0" - -"@babel/plugin-proposal-object-rest-spread@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.5.0.tgz#4838ce3cbc9a84dd00bce7a17e9e9c36119f83a0" - integrity sha512-G1qy5EdcO3vYhbxlXjRSR2SXB8GsxYv9hoRKT1Jdn3qy/NUnFqUUnqymKZ00Pbj+3FXNh06B+BUZzecrp3sxNw== +"@babel/plugin-proposal-object-rest-spread@^7.3.2", "@babel/plugin-proposal-object-rest-spread@^7.4.3", "@babel/plugin-proposal-object-rest-spread@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.5.5.tgz#61939744f71ba76a3ae46b5eea18a54c16d22e58" + integrity sha512-F2DxJJSQ7f64FyTVl5cw/9MWn6naXGdk3Q3UhDbFEEHv+EilCPoeRD3Zh/Utx1CJz4uyKlQ4uH+bJPbEhMV7Zw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-object-rest-spread" "^7.2.0" @@ -444,13 +434,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-block-scoping@^7.4.0", "@babel/plugin-transform-block-scoping@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.4.4.tgz#c13279fabf6b916661531841a23c4b7dae29646d" - integrity sha512-jkTUyWZcTrwxu5DD4rWz6rDB5Cjdmgz6z7M7RLXOJyCUkFBawssDGcGh8M/0FTSB87avyJI1HsTwUXp9nKA1PA== +"@babel/plugin-transform-block-scoping@^7.4.0", "@babel/plugin-transform-block-scoping@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.5.5.tgz#a35f395e5402822f10d2119f6f8e045e3639a2ce" + integrity sha512-82A3CLRRdYubkG85lKwhZB0WZoHxLGsJdux/cOVaJCJpvYFl1LVzAIFyRsa7CvXqW8rBM4Zf3Bfn8PHt5DP0Sg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - lodash "^4.17.11" + lodash "^4.17.13" "@babel/[email protected]": version "7.4.3" @@ -466,17 +456,17 @@ "@babel/helper-split-export-declaration" "^7.4.0" globals "^11.1.0" -"@babel/plugin-transform-classes@^7.4.3", "@babel/plugin-transform-classes@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.4.4.tgz#0ce4094cdafd709721076d3b9c38ad31ca715eb6" - integrity sha512-/e44eFLImEGIpL9qPxSRat13I5QNRgBLu2hOQJCF7VLy/otSM/sypV1+XaIw5+502RX/+6YaSAPmldk+nhHDPw== +"@babel/plugin-transform-classes@^7.4.3", "@babel/plugin-transform-classes@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.5.5.tgz#d094299d9bd680a14a2a0edae38305ad60fb4de9" + integrity sha512-U2htCNK/6e9K7jGyJ++1p5XRU+LJjrwtoiVn9SzRlDT2KubcZ11OOwy3s24TjHxPgxNwonCYP7U2K51uVYCMDg== dependencies: "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-define-map" "^7.4.4" + "@babel/helper-define-map" "^7.5.5" "@babel/helper-function-name" "^7.1.0" "@babel/helper-optimise-call-expression" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.4.4" + "@babel/helper-replace-supers" "^7.5.5" "@babel/helper-split-export-declaration" "^7.4.4" globals "^11.1.0" @@ -620,13 +610,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-object-super@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.2.0.tgz#b35d4c10f56bab5d650047dad0f1d8e8814b6598" - integrity sha512-VMyhPYZISFZAqAPVkiYb7dUe2AsVi2/wCT5+wZdsNO31FojQJa9ns40hzZ6U9f50Jlq4w6qwzdBB2uwqZ00ebg== +"@babel/plugin-transform-object-super@^7.2.0", "@babel/plugin-transform-object-super@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.5.5.tgz#c70021df834073c65eb613b8679cc4a381d1a9f9" + integrity sha512-un1zJQAhSosGFBduPgN/YFNvWVpRuHKU7IHBglLoLZsGmruJPOo6pbInneflUdmq7YvSVqhpPs5zdBvLnteltQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.1.0" + "@babel/helper-replace-supers" "^7.5.5" "@babel/plugin-transform-parameters@^7.4.3", "@babel/plugin-transform-parameters@^7.4.4": version "7.4.4" @@ -754,11 +744,11 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-typescript@^7.3.2": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.5.0.tgz#a0855287eec87fe83c11e8dad67d431d343b53b1" - integrity sha512-z3T4P70XJFUAHzLtEsmJ37BGVDj+55/KX8W8TBSBF0qk0KLazw8xlwVcRHacxNPgprzTdI4QWW+2eS6bTkQbCA== + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.5.5.tgz#6d862766f09b2da1cb1f7d505fe2aedab6b7d4b8" + integrity sha512-pehKf4m640myZu5B2ZviLaiBlxMCjSZ1qTEO459AXKX5GnPueyulJeCqZFs1nz/Ya2dDzXQ1NxZ/kKNWyD4h6w== dependencies: - "@babel/helper-create-class-features-plugin" "^7.5.0" + "@babel/helper-create-class-features-plugin" "^7.5.5" "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-typescript" "^7.2.0" @@ -826,16 +816,16 @@ semver "^5.5.0" "@babel/preset-env@^7.4.3", "@babel/preset-env@^7.4.5": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.5.0.tgz#1122a751e864850b4dbce38bd9b4497840ee6f01" - integrity sha512-/5oQ7cYg+6sH9Dt9yx5IiylnLPiUdyMHl5y+K0mKVNiW2wJ7FpU5bg8jKcT8PcCbxdYzfv6OuC63jLEtMuRSmQ== + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.5.5.tgz#bc470b53acaa48df4b8db24a570d6da1fef53c9a" + integrity sha512-GMZQka/+INwsMz1A5UEql8tG015h5j/qjptpKY2gJ7giy8ohzU710YciJB5rcKsWGWHiW3RUnHib0E5/m3Tp3A== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-proposal-async-generator-functions" "^7.2.0" "@babel/plugin-proposal-dynamic-import" "^7.5.0" "@babel/plugin-proposal-json-strings" "^7.2.0" - "@babel/plugin-proposal-object-rest-spread" "^7.5.0" + "@babel/plugin-proposal-object-rest-spread" "^7.5.5" "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" "@babel/plugin-syntax-async-generators" "^7.2.0" @@ -846,8 +836,8 @@ "@babel/plugin-transform-arrow-functions" "^7.2.0" "@babel/plugin-transform-async-to-generator" "^7.5.0" "@babel/plugin-transform-block-scoped-functions" "^7.2.0" - "@babel/plugin-transform-block-scoping" "^7.4.4" - "@babel/plugin-transform-classes" "^7.4.4" + "@babel/plugin-transform-block-scoping" "^7.5.5" + "@babel/plugin-transform-classes" "^7.5.5" "@babel/plugin-transform-computed-properties" "^7.2.0" "@babel/plugin-transform-destructuring" "^7.5.0" "@babel/plugin-transform-dotall-regex" "^7.4.4" @@ -863,7 +853,7 @@ "@babel/plugin-transform-modules-umd" "^7.2.0" "@babel/plugin-transform-named-capturing-groups-regex" "^7.4.5" "@babel/plugin-transform-new-target" "^7.4.4" - "@babel/plugin-transform-object-super" "^7.2.0" + "@babel/plugin-transform-object-super" "^7.5.5" "@babel/plugin-transform-parameters" "^7.4.4" "@babel/plugin-transform-property-literals" "^7.2.0" "@babel/plugin-transform-regenerator" "^7.4.5" @@ -874,7 +864,7 @@ "@babel/plugin-transform-template-literals" "^7.4.4" "@babel/plugin-transform-typeof-symbol" "^7.2.0" "@babel/plugin-transform-unicode-regex" "^7.4.4" - "@babel/types" "^7.5.0" + "@babel/types" "^7.5.5" browserslist "^4.6.0" core-js-compat "^3.1.1" invariant "^2.2.2" @@ -922,17 +912,10 @@ dependencies: regenerator-runtime "^0.13.2" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.4.2", "@babel/runtime@^7.4.3", "@babel/runtime@^7.4.5": - version "7.5.1" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.5.1.tgz#51b56e216e87103ab3f7d6040b464c538e242888" - integrity sha512-g+hmPKs16iewFSmW57NkH9xpPkuYD1RV3UE2BCkXx9j+nhhRb9hsiSxPmEa67j35IecTQdn4iyMtHMbt5VoREg== - dependencies: - regenerator-runtime "^0.13.2" - -"@babel/runtime@^7.3.1": - version "7.5.4" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.5.4.tgz#cb7d1ad7c6d65676e66b47186577930465b5271b" - integrity sha512-Na84uwyImZZc3FKf4aUF1tysApzwf3p2yuFBIyBfbzT5glzKTdvYI4KVW4kcgjrzoGUjC7w3YyCHcJKaRxsr2Q== +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.2", "@babel/runtime@^7.4.3", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.0": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.5.5.tgz#74fba56d35efbeca444091c7850ccd494fd2f132" + integrity sha512-28QvEGyQyNkB0/m2B4FU7IEZGK2NUrcMtT6BZEFALTguLk+AUT6ofsHtPk5QyjAdUkpMJ+/Em+quwz4HOt30AQ== dependencies: regenerator-runtime "^0.13.2" @@ -945,28 +928,28 @@ "@babel/parser" "^7.4.4" "@babel/types" "^7.4.4" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4", "@babel/traverse@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.5.0.tgz#4216d6586854ef5c3c4592dab56ec7eb78485485" - integrity sha512-SnA9aLbyOCcnnbQEGwdfBggnc142h/rbqqsXcaATj2hZcegCl903pUD/lfpsNBlBSuWow/YDfRyJuWi2EPR5cg== +"@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4", "@babel/traverse@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.5.5.tgz#f664f8f368ed32988cd648da9f72d5ca70f165bb" + integrity sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ== dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.5.0" + "@babel/code-frame" "^7.5.5" + "@babel/generator" "^7.5.5" "@babel/helper-function-name" "^7.1.0" "@babel/helper-split-export-declaration" "^7.4.4" - "@babel/parser" "^7.5.0" - "@babel/types" "^7.5.0" + "@babel/parser" "^7.5.5" + "@babel/types" "^7.5.5" debug "^4.1.0" globals "^11.1.0" - lodash "^4.17.11" + lodash "^4.17.13" -"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.5.0.tgz#e47d43840c2e7f9105bc4d3a2c371b4d0c7832ab" - integrity sha512-UFpDVqRABKsW01bvw7/wSUe56uy6RXM5+VJibVVAybDGxEW25jdwiFJEf7ASvSaC7sN7rbE/l3cLp2izav+CtQ== +"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.5.5.tgz#97b9f728e182785909aa4ab56264f090a028d18a" + integrity sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw== dependencies: esutils "^2.0.2" - lodash "^4.17.11" + lodash "^4.17.13" to-fast-properties "^2.0.0" "@cnakazawa/watch@^1.0.3": @@ -978,134 +961,134 @@ minimist "^1.2.0" "@commitlint/cli@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-8.0.0.tgz#1be7aa14fecbcf71317a8187fbb5210760d4ca61" - integrity sha512-wFu+g9v73I2rMRTv27ItIbcrhWqge0ZpUNUIJ9fw8TF7XpmhaUFvGqa2kU6st1F0TyEOrq5ZMzwI8kQZNVLuXg== + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-8.1.0.tgz#a3d4236c0ac961d7026a53d728b179c696d6a045" + integrity sha512-83K5C2nIAgoZlzMegf0/MEBjX+ampUyc/u79RxgX9ZYjzos+RQtNyO7I43dztVxPXSwAnX9XRgoOfkGWA4nbig== dependencies: - "@commitlint/format" "^8.0.0" - "@commitlint/lint" "^8.0.0" - "@commitlint/load" "^8.0.0" - "@commitlint/read" "^8.0.0" + "@commitlint/format" "^8.1.0" + "@commitlint/lint" "^8.1.0" + "@commitlint/load" "^8.1.0" + "@commitlint/read" "^8.1.0" babel-polyfill "6.26.0" chalk "2.3.1" get-stdin "7.0.0" - lodash "4.17.11" + lodash "4.17.14" meow "5.0.0" resolve-from "5.0.0" resolve-global "1.0.0" "@commitlint/config-conventional@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-8.0.0.tgz#f45349cab9dcfc08a30fbcf2b6317506e17bc8e6" - integrity sha512-umg1irroowOV+x8oZPBw8woCogZO5MFKUYQq+fRZvhowoSwDHXYILP3ETcdHUgvytw/K/a8Xvu7iCypK6oZQ+g== + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-8.1.0.tgz#ba61fbf0ad4df52da2b5ee3034470371a2cbf039" + integrity sha512-/JY+FNBnrT91qzDVIoV1Buiigvj7Le7ezFw+oRqu0nYREX03k7xnaG/7t7rUSvm7hM6dnLSOlaUsevjgMI9AEw== -"@commitlint/ensure@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@commitlint/ensure/-/ensure-8.0.0.tgz#67a3e72755a0dfa5f4216efd05238f62ff132110" - integrity sha512-rhBO79L9vXeb26JU+14cxZQq46KyyVqlo31C33VIe7oJndUtWrDhZTvMjJeB1pdXh4EU4XWdMo+yzBmuypFgig== +"@commitlint/ensure@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/ensure/-/ensure-8.1.0.tgz#6c669f85c3005ed15c8141d83cf5312c43001613" + integrity sha512-dBU4CcjN0vJSDNOeSpaHNgQ1ra444u4USvI6PTaHVAS4aeDpZ5Cds1rxkZNsocu48WNycUu0jP84+zjcw2pPLQ== dependencies: - lodash "4.17.11" + lodash "4.17.14" -"@commitlint/execute-rule@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-8.0.0.tgz#df2a9893f162fc561ca4e95a34bd782469dd7f8b" - integrity sha512-E/A2xHqx3syclXAFl8vJY2o/+xtL9axrqbFFF42Bzke+Eflf0mOJviPxDodu2xP0wXMRQ9UokAi/reK9dMtA/A== - dependencies: - babel-runtime "6.26.0" +"@commitlint/execute-rule@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-8.1.0.tgz#e8386bd0836b3dcdd41ebb9d5904bbeb447e4715" + integrity sha512-+vpH3RFuO6ypuCqhP2rSqTjFTQ7ClzXtUvXphpROv9v9+7zH4L+Ex+wZLVkL8Xj2cxefSLn/5Kcqa9XyJTn3kg== -"@commitlint/format@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@commitlint/format/-/format-8.0.0.tgz#f7c858d9057e1da6856be211ad049c5b9a66185b" - integrity sha512-dFxKGLp1T4obi7+YZ2NcSAebJA/dBQwnerRJGz0hWtsO6pheJRe+qC50+GCb2fYGWUc5lIWawaRts0m7RkFGUw== +"@commitlint/format@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/format/-/format-8.1.0.tgz#c3f3ca78bb74cbc1cce1368c0974b0cb8f31b98e" + integrity sha512-D0cmabUTQIKdABgt08d9JAvO9+lMRAmkcsZx8TMScY502R67HCw77JhzRDcw1RmqX5rN8JO6ZjDHO92Pbwlt+Q== dependencies: chalk "^2.0.1" -"@commitlint/is-ignored@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@commitlint/is-ignored/-/is-ignored-8.0.0.tgz#eba06c9a6227288574f544a1705583d965f0ed65" - integrity sha512-geWr/NXGMrZ3qc3exDM+S1qV+nMDxp1LwN3rLpEN2gXTwW3rIXq49RQQUkn0n3BHcpqJJ9EBhjqFoMU1TYx7Ng== +"@commitlint/is-ignored@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/is-ignored/-/is-ignored-8.1.0.tgz#c0583fa3c641b2d4898be1443e70e9c467429de2" + integrity sha512-HUSxx6kuLbqrQ8jb5QRzo+yR+CIXgA9HNcIcZ1qWrb+O9GOixt3mlW8li1IcfIgfODlaWoxIz0jYCxR08IoQLg== dependencies: - semver "6.0.0" + "@types/semver" "^6.0.1" + semver "6.1.1" -"@commitlint/lint@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@commitlint/lint/-/lint-8.0.0.tgz#3defb3b1a900ba966c64a51b497bf1fcff5fc9f2" - integrity sha512-5nKiJpBDR2iei+fre4+6M7FUrSX1cIMoxXKdrnb1GMOXkw9CsZSF5OvdrX08zHAFmOAeDaohoCV+XN/UN/vWYg== +"@commitlint/lint@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/lint/-/lint-8.1.0.tgz#ad10f4885c06f14c71de11dcd6bf2ca54a395141" + integrity sha512-WYjbUgtqvnlVH3S3XPZMAa+N7KO0yQ+GuUG20Qra+EtER6SRYawykmEs4wAyrmY8VcFXUnKgSlIQUsqmGKwNZQ== dependencies: - "@commitlint/is-ignored" "^8.0.0" - "@commitlint/parse" "^8.0.0" - "@commitlint/rules" "^8.0.0" + "@commitlint/is-ignored" "^8.1.0" + "@commitlint/parse" "^8.1.0" + "@commitlint/rules" "^8.1.0" babel-runtime "^6.23.0" - lodash "4.17.11" + lodash "4.17.14" -"@commitlint/load@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-8.0.0.tgz#5eacfb96635e9aeac8f1a0674491f29483348872" - integrity sha512-JXC3YjO7hN7Rv2Z/SaYz+oIvShsQWLL7gnOCe8+YgI1EusBqjV4mPI0HnBXVe9volfdxbl+Af/GoQZs2dvyOFA== +"@commitlint/load@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-8.1.0.tgz#63b72ae5bb9152b8fa5b17c5428053032a9a49c8" + integrity sha512-ra02Dvmd7Gp1+uFLzTY3yGOpHjPzl5T9wYg/xrtPJNiOWXvQ0Mw7THw+ucd1M5iLUWjvdavv2N87YDRc428wHg== dependencies: - "@commitlint/execute-rule" "^8.0.0" - "@commitlint/resolve-extends" "^8.0.0" + "@commitlint/execute-rule" "^8.1.0" + "@commitlint/resolve-extends" "^8.1.0" babel-runtime "^6.23.0" + chalk "2.4.2" cosmiconfig "^5.2.0" - lodash "4.17.11" + lodash "4.17.14" resolve-from "^5.0.0" -"@commitlint/message@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@commitlint/message/-/message-8.0.0.tgz#bbb02fb78490808e36157d675acc544fafd7942b" - integrity sha512-2oGUV8630nzsj17t6akq3mFguzWePADO069IwKJi+CN5L0YRBQj9zGRCB0P+zvh4EngjqMnuMwhEhaBEM8TTzA== +"@commitlint/message@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/message/-/message-8.1.0.tgz#8fb8046ddaa7e5c846a79da7cdbd15cf1a7770ae" + integrity sha512-AjHq022G8jQQ/3YrBOjwVBD4xF75hvC3vcvFoBIb7cC8vad1QWq+1w+aks0KlEK5IW+/+7ORZXIH+oyW7h3+8A== -"@commitlint/parse@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@commitlint/parse/-/parse-8.0.0.tgz#4b5fa19ab8bdb2c6452b7dbdf1d7adf52386ae60" - integrity sha512-6CyweJrBkI+Jqx7qkpYgVx2muBMoUZAZHWhUTgqHIDDmI+3d4UPZ2plGS2G0969KkHCgjtlwnwTjWqA9HLMwPA== +"@commitlint/parse@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/parse/-/parse-8.1.0.tgz#833243c6d848e7a7e775a283b38697166ed2fd22" + integrity sha512-n4fEbZ5kdK5HChvne7Mj8rGGkKMfA4H11IuWiWmmMzgmZTNb/B04LPrzdUm4lm3f10XzM2JMM7PLXqofQJOGvA== dependencies: conventional-changelog-angular "^1.3.3" conventional-commits-parser "^2.1.0" lodash "^4.17.11" -"@commitlint/read@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@commitlint/read/-/read-8.0.0.tgz#5149fcb2550a07e7eb6a9f50b88df742780fa1e8" - integrity sha512-IhNMiKPqkB5yxphe/FiOKgX2uCysbR8fGK6KOXON3uJaVND0dctxnfdv+vY9gDv2CtjIXgNFO+v6FLnqMfIvwA== +"@commitlint/read@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/read/-/read-8.1.0.tgz#effe07c965ba1735a5f7f8b7b19ac4d98c887507" + integrity sha512-PKsGMQFEr2sX/+orI71b82iyi8xFqb7F4cTvsLxzB5x6/QutxPVM3rg+tEVdi6rBKIDuqRIp2puDZQuREZs3vg== dependencies: - "@commitlint/top-level" "^8.0.0" + "@commitlint/top-level" "^8.1.0" "@marionebl/sander" "^0.6.0" babel-runtime "^6.23.0" git-raw-commits "^1.3.0" -"@commitlint/resolve-extends@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-8.0.0.tgz#dc606cecb0f392d57905cfd690d8f736ad26eec2" - integrity sha512-SPkH+dXMCpYboVwpIhtOhpg1xYdE7L77fuHmEJWveXSmgfi0GosFm4aJ7Cer9DjNjW+KbD0TUfzZU0TrYUESjQ== +"@commitlint/resolve-extends@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-8.1.0.tgz#ed67f2ee484160ac8e0078bae52f172625157472" + integrity sha512-r/y+CeKW72Oa9BUctS1+I/MFCDiI3lfhwfQ65Tpfn6eZ4CuBYKzrCRi++GTHeAFKE3y8q1epJq5Rl/1GBejtBw== dependencies: - babel-runtime "6.26.0" + "@types/node" "^12.0.2" import-fresh "^3.0.0" - lodash "4.17.11" + lodash "4.17.14" resolve-from "^5.0.0" resolve-global "^1.0.0" -"@commitlint/rules@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@commitlint/rules/-/rules-8.0.0.tgz#26ef50fedb5a88a2ad2af43677e5bb7c32fb5f14" - integrity sha512-s9BehZQP5uAc/V4lMaUxwxFabVZTw5fZ18Ase1e5tbMKVIwq/7E00Ny1czN7xSFXfgffukWznsexpfFXYpbVsg== +"@commitlint/rules@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/rules/-/rules-8.1.0.tgz#009c64a8a23feb4647e5a25057997be62a272c8a" + integrity sha512-hlM8VfNjsOkbvMteFyqn0c3akiUjqG09Iid28MBLrXl/d+8BR3eTzwJ4wMta4oz/iqGyrIywvg1FpHrV977MPA== dependencies: - "@commitlint/ensure" "^8.0.0" - "@commitlint/message" "^8.0.0" - "@commitlint/to-lines" "^8.0.0" + "@commitlint/ensure" "^8.1.0" + "@commitlint/message" "^8.1.0" + "@commitlint/to-lines" "^8.1.0" babel-runtime "^6.23.0" -"@commitlint/to-lines@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@commitlint/to-lines/-/to-lines-8.0.0.tgz#9f7d7938404bdbb345c23c8665293e051c4dc243" - integrity sha512-qqgNeyj+NJ1Xffwv6hGsipKlVFj30NmfPup751MS/me0GV8IBd//njTjiqHvf/3sKm/OcGn4Re4D7YXwTcC2RA== +"@commitlint/to-lines@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/to-lines/-/to-lines-8.1.0.tgz#5bf2597f46acacec4b1b3dba832ac8934798b22a" + integrity sha512-Lh4OH1bInI8GME/7FggS0/XkIMEJdTObMbXRyPRGaPcWH5S7zpB6y+b4qjzBHXAbEv2O46QAAMjZ+ywPQCpmYQ== -"@commitlint/top-level@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@commitlint/top-level/-/top-level-8.0.0.tgz#3d998ba1e13be939f4227202eebae7f1dbb472a9" - integrity sha512-If9hwfISHV8HXGKeXUKsUvOo4DuISWiU/VC2qHsKpeHSREAxkWESmQzzwYvOtyBjMiOTfAXfzgth18g36Fz2ow== +"@commitlint/top-level@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/top-level/-/top-level-8.1.0.tgz#f1950de73a1f76ef5c9e753a6b77402e0755d677" + integrity sha512-EvQuofuA/+0l1w9pkG/PRyIwACmZdIh9qxyax7w7mR8qqmSHscqf2jARIylh1TOx0uI9egO8MuPLiwC1RwyREA== dependencies: - find-up "^2.1.0" + find-up "^4.0.0" "@emotion/babel-utils@^0.6.4": version "0.6.10" @@ -1598,15 +1581,15 @@ integrity sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ== "@storybook/addon-actions@^5.1.9": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-5.1.9.tgz#a515b62b109cb886ccd75ef2f5b12f8c27b43dd3" - integrity sha512-h/csHPotBESyEUYlML3yyF2jUlDChB+u3TUNC3Ztzh/x7HzLqy88SL0INSIdY0dCBGx4TK5Gh+rMI7z28Hfdyw== - dependencies: - "@storybook/addons" "5.1.9" - "@storybook/api" "5.1.9" - "@storybook/components" "5.1.9" - "@storybook/core-events" "5.1.9" - "@storybook/theming" "5.1.9" + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-5.1.10.tgz#8ed4272a6afc68f4a30372da2eeff414f0fe6ecd" + integrity sha512-njl2AHBGi27NvisOB8LFnWH/3RcyJT/CW7tl1cvV2j5FH2oBjq5MsjxKyJIcKwC677k1Wr8G8fw/zSEHrPpmgA== + dependencies: + "@storybook/addons" "5.1.10" + "@storybook/api" "5.1.10" + "@storybook/components" "5.1.10" + "@storybook/core-events" "5.1.10" + "@storybook/theming" "5.1.10" core-js "^3.0.1" fast-deep-equal "^2.0.1" global "^4.3.2" @@ -1618,45 +1601,41 @@ uuid "^3.3.2" "@storybook/addon-backgrounds@^5.1.9": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/addon-backgrounds/-/addon-backgrounds-5.1.9.tgz#bb02aaaf9246624b06630a40f008cf81496b5199" - integrity sha512-3UmDt+WJApHx3YaY0N7XU/r/LaQ/X10ORP6AX0gpIlHqU1h1OeHXjIsFHewk+x/6wRCkAe3Zf3ue9M4/X9hs3A== - dependencies: - "@storybook/addons" "5.1.9" - "@storybook/api" "5.1.9" - "@storybook/client-logger" "5.1.9" - "@storybook/components" "5.1.9" - "@storybook/core-events" "5.1.9" - "@storybook/theming" "5.1.9" + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/addon-backgrounds/-/addon-backgrounds-5.1.10.tgz#b0c61036466aff9f464168a5910da36848352ce5" + integrity sha512-qCpD/45Uo+2IEWiko7xI4ig+MhJI66XIBR2nWfa2YCkkNokByAWWJucHJRsXyVCHcNNTDwxhgz0M1wuSzSDFwg== + dependencies: + "@storybook/addons" "5.1.10" + "@storybook/api" "5.1.10" + "@storybook/client-logger" "5.1.10" + "@storybook/components" "5.1.10" + "@storybook/core-events" "5.1.10" + "@storybook/theming" "5.1.10" core-js "^3.0.1" memoizerific "^1.11.3" react "^16.8.3" util-deprecate "^1.0.2" "@storybook/addon-contexts@^5.1.9": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/addon-contexts/-/addon-contexts-5.1.9.tgz#fe8336f62dbd2aa181c529198c9156139c4bf8a8" - integrity sha512-aoCDV1ZQV36TTBLvjx8Lx0vStOlpwSLVFwRZ5rsHafpeB439FvneriKWCh1IfVvVsJqS95Qmykt8+eHOeCB6jQ== - dependencies: - "@storybook/addons" "5.1.9" - "@storybook/api" "5.1.9" - "@storybook/components" "5.1.9" - "@storybook/core-events" "5.1.9" + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/addon-contexts/-/addon-contexts-5.1.10.tgz#852813d03d11eebf8abee50f8ddec25d00378c2b" + integrity sha512-zbsaQme7Zf0EtUCmb7v9J0hLybs73GItY1DgIre8d7SPclaw8P+le+VL++mMt1M7pw1Hc3yVWuyH2ZmEIQ2RbA== + dependencies: + "@storybook/addons" "5.1.10" + "@storybook/api" "5.1.10" + "@storybook/components" "5.1.10" + "@storybook/core-events" "5.1.10" core-js "^3.0.1" - optionalDependencies: - preact "*" - react "*" - vue "*" "@storybook/addon-info@^5.1.9": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/addon-info/-/addon-info-5.1.9.tgz#324066b02c7b76bd459d44ad3e6fe5640b7a8781" - integrity sha512-KWGhW8kv/VUj4OnWyOmZx/Kq7CzSLGMIXFI6UQY9f6j6QiyShSaOKXgbNIhynjiYHq0hEnfbgUvws2DC9dDFuw== - dependencies: - "@storybook/addons" "5.1.9" - "@storybook/client-logger" "5.1.9" - "@storybook/components" "5.1.9" - "@storybook/theming" "5.1.9" + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/addon-info/-/addon-info-5.1.10.tgz#11b4f8b286d1990748f2e2b6ba248624a0a876c4" + integrity sha512-+o92LNVGWQJ7oToMdQdaKBHYwfhvn2IRTNT0mZ0Lo1oCmpw0D+4sguYnxiqVrX5Y2zt0VMd9bepkc7zAl3t8VQ== + dependencies: + "@storybook/addons" "5.1.10" + "@storybook/client-logger" "5.1.10" + "@storybook/components" "5.1.10" + "@storybook/theming" "5.1.10" core-js "^3.0.1" global "^4.3.2" marksy "^7.0.0" @@ -1670,15 +1649,15 @@ util-deprecate "^1.0.2" "@storybook/addon-knobs@^5.1.9": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/addon-knobs/-/addon-knobs-5.1.9.tgz#74db07fd644b41e63274f8754fbfb18f43d4cf01" - integrity sha512-7/bICMYtR9CaTqfZX1kT2pBOTLZo3HxeslyQKWWsWlNElV33Ym2d0PPL5eS36eFxG/ZOp6lQWIFhunNnlmP5xg== - dependencies: - "@storybook/addons" "5.1.9" - "@storybook/client-api" "5.1.9" - "@storybook/components" "5.1.9" - "@storybook/core-events" "5.1.9" - "@storybook/theming" "5.1.9" + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/addon-knobs/-/addon-knobs-5.1.10.tgz#f5d9f21090e28046169a0aa0418de59bd92c21fd" + integrity sha512-j5wXBIPGQxK+guFDAi8xNBdUnyQglhDplVoC9SswkSMarqtWq02TT+OLN2VSBgpvzHmhLUW3autjJGfmwP4ltQ== + dependencies: + "@storybook/addons" "5.1.10" + "@storybook/client-api" "5.1.10" + "@storybook/components" "5.1.10" + "@storybook/core-events" "5.1.10" + "@storybook/theming" "5.1.10" copy-to-clipboard "^3.0.8" core-js "^3.0.1" escape-html "^1.0.3" @@ -1691,28 +1670,28 @@ react-lifecycles-compat "^3.0.4" react-select "^2.2.0" -"@storybook/[email protected]": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-5.1.9.tgz#ecf218d08508b97ca5e6e0f1ed361081385bd3ff" - integrity sha512-1bavbcS/NiE65DwyKj8c0DmWmz9VekOinB+has2Pqt2bOffZoZwVnbmepcz9hH3GUyvp5fQBYbxTEmTDvF2lLA== +"@storybook/[email protected]": + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-5.1.10.tgz#2d8d8ca20b6d9b4652744f5fc00ead483f705435" + integrity sha512-M9b2PCp9RZxDC6wL7vVt2SCKCGXrrEAOsdpMvU569yB1zoUPEiiqElVDwb91O2eAGPnmd2yjImp90kOpKUW0EA== dependencies: - "@storybook/api" "5.1.9" - "@storybook/channels" "5.1.9" - "@storybook/client-logger" "5.1.9" + "@storybook/api" "5.1.10" + "@storybook/channels" "5.1.10" + "@storybook/client-logger" "5.1.10" core-js "^3.0.1" global "^4.3.2" util-deprecate "^1.0.2" -"@storybook/[email protected]": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/api/-/api-5.1.9.tgz#eec5b2f775392ce0803930104c6ce14fa4931e8b" - integrity sha512-d1HhpOkW+706/WJ9lP5nCqOrp/icvbm0o+6jFFOGJ35AW5O9D8vDBxzvgMEO45jjN4I+rtbcNHQCxshSbPvP9w== +"@storybook/[email protected]": + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/api/-/api-5.1.10.tgz#5eeb5d9a7c268e5c89bd40c9a80293a7c72343b8" + integrity sha512-YeZe/71zLMmgT95IMAEZOc9AwL6Y23mWvkZMwFbkokxS9+bU/qmVlQ0B9c3JBzO3OSs7sXaRqyP1o3QkQgVsiw== dependencies: - "@storybook/channels" "5.1.9" - "@storybook/client-logger" "5.1.9" - "@storybook/core-events" "5.1.9" - "@storybook/router" "5.1.9" - "@storybook/theming" "5.1.9" + "@storybook/channels" "5.1.10" + "@storybook/client-logger" "5.1.10" + "@storybook/core-events" "5.1.10" + "@storybook/router" "5.1.10" + "@storybook/theming" "5.1.10" core-js "^3.0.1" fast-deep-equal "^2.0.1" global "^4.3.2" @@ -1726,33 +1705,33 @@ telejson "^2.2.1" util-deprecate "^1.0.2" -"@storybook/[email protected]": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-5.1.9.tgz#bd710ca74d7998a234c6b1f38009020d7c34bbc0" - integrity sha512-H71PsnDKW81eflOS48Lv9yK4O8AcoqXL6ohsWvLdrHWIBsH4zpjOIhdWHtmAaT3hyfMy+l49DQ+uCHLECEt55g== +"@storybook/[email protected]": + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-5.1.10.tgz#e0a58461d56ef20a87d8bc4df1067e7afc76950e" + integrity sha512-kQZIwltN2cWDXluhCfdModFDK1LHV9ZhNQ1b/uD9vn1c65rQ9u7r4lRajCfS0X1dmAWqz48cBcEurAubNgmswg== dependencies: - "@storybook/channels" "5.1.9" - "@storybook/client-logger" "5.1.9" + "@storybook/channels" "5.1.10" + "@storybook/client-logger" "5.1.10" core-js "^3.0.1" global "^4.3.2" telejson "^2.2.1" -"@storybook/[email protected]": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-5.1.9.tgz#003cfca0b9f1ba6cf47ce68304aedd71bdb55e74" - integrity sha512-R6i7859FsXgY9XFFErVe7gS37wGYpQEEWsO1LzUW7YptGuFTUa8yLgKkNkgfy7Zs61Xm+GiBq8PvS/CWxjotPw== +"@storybook/[email protected]": + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-5.1.10.tgz#04fd35c05032c675f7816ea1ca873c1a0415c6d9" + integrity sha512-w7n/bV1BLu51KI1eLc75lN9H1ssBc3PZMXk88GkMiKyBVRzPlJA5ixnzH86qwYGReE0dhRpsgHXZ5XmoKaVmPA== dependencies: core-js "^3.0.1" -"@storybook/[email protected]": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-5.1.9.tgz#b598efe4ab07bffaeb4cb9e30ed9c21add739df1" - integrity sha512-J5HDtOS7x5YRpF/CMiHdxywV5NIh1i/03Xh2RhG15lmPy87VStIGpLzhF71uCRPLEJinYelcjuXRNAJgRzUOlg== +"@storybook/[email protected]": + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-5.1.10.tgz#a10f028f2d33d044e5c3b3daea5d8375323e6a66" + integrity sha512-v2PqiNUhwDlVDLYL94f6LFjdYMToTpuwWh9aeqzt/4PAJUnIcA+2P8+qXiYdJTqQy/u7P72HFMlc9Ru4tl3QFg== dependencies: - "@storybook/addons" "5.1.9" - "@storybook/client-logger" "5.1.9" - "@storybook/core-events" "5.1.9" - "@storybook/router" "5.1.9" + "@storybook/addons" "5.1.10" + "@storybook/client-logger" "5.1.10" + "@storybook/core-events" "5.1.10" + "@storybook/router" "5.1.10" common-tags "^1.8.0" core-js "^3.0.1" eventemitter3 "^3.1.0" @@ -1762,20 +1741,20 @@ memoizerific "^1.11.3" qs "^6.6.0" -"@storybook/[email protected]": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-5.1.9.tgz#87e2f7578416269adeccd407584010bc353f14d3" - integrity sha512-1+Otcn0EFgWNviDPNCR5LtUViADlboz9fmpZc7UY7bgaY5FVNIUO01E4T43tO7fduiRZoEvdltwTuQRm260Vjw== +"@storybook/[email protected]": + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-5.1.10.tgz#f83a8717924dd222e0a6df82ae74701f27e0bb35" + integrity sha512-vB1NoFWRTgcERwodhbgoDwI00eqU8++nXI7GhMS1CY8haZaSp3gyKfHRWyfH+M+YjQuGBRUcvIk4gK6OtSrDOw== dependencies: core-js "^3.0.1" -"@storybook/[email protected]": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/components/-/components-5.1.9.tgz#2a5258780fff07172d103287759946dbb4b13e2d" - integrity sha512-F4xcRlifSAfqkuFWtCKRvQDahXyfWBWV2Wa+kYy4YGwEfm3kKtIHVlgdgARL22g9BdYpRFEOJ+42juOu5YvIeQ== +"@storybook/[email protected]": + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/components/-/components-5.1.10.tgz#4b6436f0b5bb2483fb231bee263d173a9ed7d241" + integrity sha512-QUQeeQp1xNWiL4VlxFAea0kqn2zvBfmfPlUddOFO9lBhT6pVy0xYPjXjbTVWjVcYzZpyUNWw5GplqrR5jhlaCA== dependencies: - "@storybook/client-logger" "5.1.9" - "@storybook/theming" "5.1.9" + "@storybook/client-logger" "5.1.10" + "@storybook/theming" "5.1.10" core-js "^3.0.1" global "^4.3.2" markdown-to-jsx "^6.9.1" @@ -1793,32 +1772,32 @@ recompose "^0.30.0" simplebar-react "^1.0.0-alpha.6" -"@storybook/[email protected]": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-5.1.9.tgz#441a6297e2ccfa743e15d1db1f4ac445b91f40d8" - integrity sha512-jHe2uyoLj9i6fntHtOj5azfGdLOb75LF0e1xXE8U2SX7Zp3uwbLAcfJ+dPStdc/q+f/wBiip3tH1dIjaNuUiMw== +"@storybook/[email protected]": + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-5.1.10.tgz#5aed88c572036b6bd6dfff28976ee96e6e175d7a" + integrity sha512-Lvu/rNcgS+XCkQKSGdNpUSWjpFF9AOSHPXsvkwHbRwJYdMDn3FznlXfDUiubOWtsziXHB6vl3wkKDlH+ckb32Q== dependencies: core-js "^3.0.1" -"@storybook/[email protected]": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/core/-/core-5.1.9.tgz#8b30507676531fd41ac333b7c71b1c0db6b8da35" - integrity sha512-P3aavCnl3Cl3WMXVERjQqnqV1Z8tN0tyOTqqiGb1fMxITSE8uZNvp33Dl0K3jr1PBl9trW+2t7eHH4h0sguLlQ== +"@storybook/[email protected]": + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/core/-/core-5.1.10.tgz#53d23d07716aa2721e1572d44a7f05967d7da39e" + integrity sha512-zkNjufOFrLpFpmr73F/gaJh0W0vWqXIo5zrKvQt1LqmMeCU/v8MstHi4XidlK43UpeogfaXl5tjNCQDO/bd0Dw== dependencies: "@babel/plugin-proposal-class-properties" "^7.3.3" "@babel/plugin-proposal-object-rest-spread" "^7.3.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.1.9" - "@storybook/channel-postmessage" "5.1.9" - "@storybook/client-api" "5.1.9" - "@storybook/client-logger" "5.1.9" - "@storybook/core-events" "5.1.9" - "@storybook/node-logger" "5.1.9" - "@storybook/router" "5.1.9" - "@storybook/theming" "5.1.9" - "@storybook/ui" "5.1.9" + "@storybook/addons" "5.1.10" + "@storybook/channel-postmessage" "5.1.10" + "@storybook/client-api" "5.1.10" + "@storybook/client-logger" "5.1.10" + "@storybook/core-events" "5.1.10" + "@storybook/node-logger" "5.1.10" + "@storybook/router" "5.1.10" + "@storybook/theming" "5.1.10" + "@storybook/ui" "5.1.10" airbnb-js-shims "^1 || ^2" autoprefixer "^9.4.9" babel-plugin-add-react-displayname "^0.0.5" @@ -1872,10 +1851,10 @@ webpack-dev-middleware "^3.7.0" webpack-hot-middleware "^2.25.0" -"@storybook/[email protected]": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-5.1.9.tgz#4aacf0096811fde1639fc9d1d2d521f7220dd4be" - integrity sha512-rcSuI5n53hDMHW83gl5TR0Yn885/i2XY0AzX1DsbTeGOl3x5LhrCSZsZWetKGcx7zsO4n7o5mQszLuN1JlyE8A== +"@storybook/[email protected]": + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-5.1.10.tgz#92c80b46177687cd8fda1f93a055c22711984154" + integrity sha512-Z4UKh7QBOboQhUF5S/dKOx3OWWCNZGwYu8HZa/O+P68+XnQDhuZCYwqWG49xFhZd0Jb0W9gdUL2mWJw5POG9PA== dependencies: chalk "^2.4.2" core-js "^3.0.1" @@ -1884,15 +1863,15 @@ regenerator-runtime "^0.12.1" "@storybook/react@^5.1.9": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/react/-/react-5.1.9.tgz#4052f4b88e91d5a823bb9cbb61104c530fcfb1a1" - integrity sha512-Byykpsttf6p2jv3LvqFtntEYfbUZSNTts0TjcZHNsHoUGmT7/M1PyqTeB7JUcYUNwSgdACY8FbowCrwZwDJDWQ== + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/react/-/react-5.1.10.tgz#a5cf2b7d086e121c969d34100fb03fcfdc74cbed" + integrity sha512-wWy9l83KgbP8P2A8AbkwExEAdA0iznb4jEnCGzP1hAv8Q5LmL3MLPb1dIZqhWrg+E2m3tZei+7A7qu2Q8/cLLw== dependencies: "@babel/plugin-transform-react-constant-elements" "^7.2.0" "@babel/preset-flow" "^7.0.0" "@babel/preset-react" "^7.0.0" - "@storybook/core" "5.1.9" - "@storybook/node-logger" "5.1.9" + "@storybook/core" "5.1.10" + "@storybook/node-logger" "5.1.10" "@svgr/webpack" "^4.0.3" babel-plugin-add-react-displayname "^0.0.5" babel-plugin-named-asset-import "^0.3.1" @@ -1909,10 +1888,10 @@ semver "^6.0.0" webpack "^4.33.0" -"@storybook/[email protected]": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/router/-/router-5.1.9.tgz#8cd97bea4f2acf8ec5f6694d06fb0633dde33417" - integrity sha512-eAmeerE/OTIwCV7WBnb1BPINVN1GTSMsUXLNWpqSISuyWJ+NZAJlObFkvXoc57QSQlv0cvXlm1FMkmRt8ku1Hw== +"@storybook/[email protected]": + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/router/-/router-5.1.10.tgz#d3cffd3f1105eb665882f389746ccabbb98c3c16" + integrity sha512-BdG6/essPZFHCP2ewCG0gYFQfmuuTSHXAB5fd/rwxLSYj1IzNznC5OxkvnSaTr4rgoxxaW/z1hbN1NuA0ivlFA== dependencies: "@reach/router" "^1.2.1" core-js "^3.0.1" @@ -1920,14 +1899,14 @@ memoizerific "^1.11.3" qs "^6.6.0" -"@storybook/[email protected]": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-5.1.9.tgz#c425f5867fae0db79e01112853b1808332a5f1a2" - integrity sha512-4jIFJwTWVf9tsv27noLoFHlKC2Jl9DHV3q+rxGPU8bTNbufCu4oby82SboO5GAKuS3eu1cxL1YY9pYad9WxfHg== +"@storybook/[email protected]": + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-5.1.10.tgz#f9bd519cdf9cccf730656e3f5fd56a339dd07c9f" + integrity sha512-5cN1lmdVUwAR8U3T49Lfb8JW5RBvxBSPGZpUmbLGz1zi0tWBJgYXoGtw4RbTBjV9kCQOXkHGH12AsdDxHh931w== dependencies: "@emotion/core" "^10.0.9" "@emotion/styled" "^10.0.7" - "@storybook/client-logger" "5.1.9" + "@storybook/client-logger" "5.1.10" common-tags "^1.8.0" core-js "^3.0.1" deep-object-diff "^1.1.0" @@ -1938,19 +1917,19 @@ prop-types "^15.7.2" resolve-from "^5.0.0" -"@storybook/[email protected]": - version "5.1.9" - resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-5.1.9.tgz#406667469e6dbdf320086647d8d80776bb051a51" - integrity sha512-guzKv4VYM+06BzMXeO3QqlX0IwUHyeS6lwdPCL8Oy2V4Gi2IYHHiD6Hr1NgnBO18j9luxE38f4Ii7gEIzXMFbQ== - dependencies: - "@storybook/addons" "5.1.9" - "@storybook/api" "5.1.9" - "@storybook/channels" "5.1.9" - "@storybook/client-logger" "5.1.9" - "@storybook/components" "5.1.9" - "@storybook/core-events" "5.1.9" - "@storybook/router" "5.1.9" - "@storybook/theming" "5.1.9" +"@storybook/[email protected]": + version "5.1.10" + resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-5.1.10.tgz#4262b1b09efa43d125d694452ae879b89071edd1" + integrity sha512-ezkoVtzoKh93z2wzkqVIqyrIzTkj8tizgAkoPa7mUAbLCxu6LErHITODQoyEiJWI4Epy3yU9GYXFWwT71hdwsA== + dependencies: + "@storybook/addons" "5.1.10" + "@storybook/api" "5.1.10" + "@storybook/channels" "5.1.10" + "@storybook/client-logger" "5.1.10" + "@storybook/components" "5.1.10" + "@storybook/core-events" "5.1.10" + "@storybook/router" "5.1.10" + "@storybook/theming" "5.1.10" copy-to-clipboard "^3.0.8" core-js "^3.0.1" core-js-pure "^3.0.1" @@ -2032,33 +2011,31 @@ "@svgr/babel-plugin-transform-react-native-svg" "^4.2.0" "@svgr/babel-plugin-transform-svg-component" "^4.2.0" -"@svgr/core@^4.3.1": - version "4.3.1" - resolved "https://registry.yarnpkg.com/@svgr/core/-/core-4.3.1.tgz#58c44d0ccc3fe41718c50433758b549dabd4d197" - integrity sha512-TXFcvzp6QjxKP5Oy7qoQY08w/nAix9TMOc4jSi3wjIJBBMUqypVwQJFMxtHrViGMQGmFdaN1y2diQrhvA+xNNQ== +"@svgr/core@^4.3.2": + version "4.3.2" + resolved "https://registry.yarnpkg.com/@svgr/core/-/core-4.3.2.tgz#939c89be670ad79b762f4c063f213f0e02535f2e" + integrity sha512-N+tP5CLFd1hP9RpO83QJPZY3NL8AtrdqNbuhRgBkjE/49RnMrrRsFm1wY8pueUfAGvzn6tSXUq29o6ah8RuR5w== dependencies: - "@svgr/plugin-jsx" "^4.3.1" + "@svgr/plugin-jsx" "^4.3.2" camelcase "^5.3.1" cosmiconfig "^5.2.1" -"@svgr/hast-util-to-babel-ast@^4.3.1": - version "4.3.1" - resolved "https://registry.yarnpkg.com/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-4.3.1.tgz#b3ea5b2228b50ff335a5d3cf3855f4b1f9fbc70e" - integrity sha512-MZbRccEpsro70mE6mhiv5QUXjBwHGDQZ7XrVcrDs44inaNvYUtIcheX0d9eColcnNgJmsfU3tEFfoGRnJ9E5pA== +"@svgr/hast-util-to-babel-ast@^4.3.2": + version "4.3.2" + resolved "https://registry.yarnpkg.com/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-4.3.2.tgz#1d5a082f7b929ef8f1f578950238f630e14532b8" + integrity sha512-JioXclZGhFIDL3ddn4Kiq8qEqYM2PyDKV0aYno8+IXTLuYt6TOgHUbUAAFvqtb0Xn37NwP0BTHglejFoYr8RZg== dependencies: "@babel/types" "^7.4.4" -"@svgr/plugin-jsx@^4.3.1": - version "4.3.1" - resolved "https://registry.yarnpkg.com/@svgr/plugin-jsx/-/plugin-jsx-4.3.1.tgz#5b7f849213d1411886e1cec9b6c287faec69143e" - integrity sha512-v9sgsn/VpDM9G1U0ZDCair7ZmYqNrVC5LiSyIQli03DAm34bYLM12xVOOrl3dg8NGNY1k4C3A6YgBL3VKjA6Og== +"@svgr/plugin-jsx@^4.3.2": + version "4.3.2" + resolved "https://registry.yarnpkg.com/@svgr/plugin-jsx/-/plugin-jsx-4.3.2.tgz#ce9ddafc8cdd74da884c9f7af014afcf37f93d3c" + integrity sha512-+1GW32RvmNmCsOkMoclA/TppNjHPLMnNZG3/Ecscxawp051XJ2MkO09Hn11VcotdC2EPrDfT8pELGRo+kbZ1Eg== dependencies: "@babel/core" "^7.4.5" "@svgr/babel-preset" "^4.3.1" - "@svgr/hast-util-to-babel-ast" "^4.3.1" - rehype-parse "^6.0.0" - unified "^7.1.0" - vfile "^4.0.1" + "@svgr/hast-util-to-babel-ast" "^4.3.2" + svg-parser "^2.0.0" "@svgr/plugin-svgo@^4.3.1": version "4.3.1" @@ -2070,16 +2047,16 @@ svgo "^1.2.2" "@svgr/webpack@^4.0.3": - version "4.3.1" - resolved "https://registry.yarnpkg.com/@svgr/webpack/-/webpack-4.3.1.tgz#cf6214853935cab8ba817b825e2483aa36c6b2e0" - integrity sha512-yU7AB+VKayqLQZl+MrxI6kpuqzXDLJr8JdYvSONBwQ5VMT31PYXofenS+1n8XuCSnY9p8IAJQ0qeLTYIieMKVQ== + version "4.3.2" + resolved "https://registry.yarnpkg.com/@svgr/webpack/-/webpack-4.3.2.tgz#319d4471c8f3d5c3af35059274834d9b5b8fb956" + integrity sha512-F3VE5OvyOWBEd2bF7BdtFRyI6E9it3mN7teDw0JQTlVtc4HZEYiiLSl+Uf9Uub6IYHVGc+qIrxxDyeedkQru2w== dependencies: "@babel/core" "^7.4.5" "@babel/plugin-transform-react-constant-elements" "^7.0.0" "@babel/preset-env" "^7.4.5" "@babel/preset-react" "^7.0.0" - "@svgr/core" "^4.3.1" - "@svgr/plugin-jsx" "^4.3.1" + "@svgr/core" "^4.3.2" + "@svgr/plugin-jsx" "^4.3.2" "@svgr/plugin-svgo" "^4.3.1" loader-utils "^1.2.3" @@ -2116,6 +2093,11 @@ dependencies: "@babel/types" "^7.3.0" +"@types/dompurify@^0.0.33": + version "0.0.33" + resolved "https://registry.yarnpkg.com/@types/dompurify/-/dompurify-0.0.33.tgz#bec490ba5a5b4b31679fb9e5a70e4d2f405516bd" + integrity sha512-lUN9iC6b4txeaEef2PW7zIdhEKAp0Sw9bymOcXXZ7BaepB0nsDJYcLIrFfgpIkRSoZWBJ8IcYunB2hAXuHL1NA== + "@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" @@ -2160,6 +2142,11 @@ "@types/istanbul-lib-coverage" "*" "@types/istanbul-lib-report" "*" +"@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" + integrity sha512-Il2DtDVRGDcqjDtE+rF8iqg1CArehSK84HZJCT7AMITlyXRBpuPhqGLDQMowraqqu1coEaimg4ZOqggt6L6L+A== + "@types/lodash@^4.14.136": version "4.14.136" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.136.tgz#413e85089046b865d960c9ff1d400e04c31ab60f" @@ -2170,10 +2157,10 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== -"@types/node@*": - version "12.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.12.tgz#cc791b402360db1eaf7176479072f91ee6c6c7ca" - integrity sha512-Uy0PN4R5vgBUXFoJrKryf5aTk3kJ8Rv3PdlHjl6UaX+Cqp1QE0yPQ68MPXGrZOfG7gZVNDIJZYyot0B9ubXUrQ== +"@types/node@*", "@types/node@^12.0.2": + version "12.6.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.6.8.tgz#e469b4bf9d1c9832aee4907ba8a051494357c12c" + integrity sha512-aX+gFgA5GHcDi89KG5keey2zf0WfZk/HAQotEamsK2kbey+8yGKcson0hbK8E+v0NArlCJQCqMP161YhV6ZXLg== "@types/normalize-package-data@^2.4.0": version "2.4.0" @@ -2191,19 +2178,12 @@ integrity sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw== "@types/react-dom@^16.8.4": - version "16.8.4" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.8.4.tgz#7fb7ba368857c7aa0f4e4511c4710ca2c5a12a88" - integrity sha512-eIRpEW73DCzPIMaNBDP5pPIpK1KXyZwNgfxiVagb5iGiz6da+9A5hslSX6GAQKdO7SayVCS/Fr2kjqprgAvkfA== + version "16.8.5" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.8.5.tgz#3e3f4d99199391a7fb40aa3a155c8dd99b899cbd" + integrity sha512-idCEjROZ2cqh29+trmTmZhsBAUNQuYrF92JHKzZ5+aiFM1mlSk3bb23CK7HhYuOY75Apgap5y2jTyHzaM2AJGA== dependencies: "@types/react" "*" -"@types/react-i18next@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@types/react-i18next/-/react-i18next-8.1.0.tgz#5faacbfe7dc0f24729c1df6914610bfe861a50de" - integrity sha512-d4xhcjX5b3roNMObRNMfb1HinHQlQLPo8xlDj60dnHeeAw2bBymR2cy/l1giJpHzo/ZFgSvgVUvIWr4kCrenCg== - dependencies: - react-i18next "*" - "@types/react-transition-group@^2.9.2": version "2.9.2" resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-2.9.2.tgz#c48cf2a11977c8b4ff539a1c91d259eaa627028d" @@ -2219,15 +2199,20 @@ "@types/prop-types" "*" csstype "^2.2.0" +"@types/semver@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-6.0.1.tgz#a984b405c702fa5a7ec6abc56b37f2ba35ef5af6" + integrity sha512-ffCdcrEE5h8DqVxinQjo+2d1q+FV5z7iNtPofw3JsrltSoSVlOGaW0rY8XxtO9XukdTn8TaCGWmk2VFGhI70mg== + "@types/stack-utils@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== "@types/storybook__addon-knobs@^5.0.2": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@types/storybook__addon-knobs/-/storybook__addon-knobs-5.0.2.tgz#ca5f888e378bb1130438436dd5f5608a00f247d8" - integrity sha512-n42A7tpnE7LUDe72rmbHsT//JafHBFk7W1szW7QwJxNpUjD4NvgmRqc8qLo/YtC5vS2Lk5TNPlp5Au70XqbdWw== + version "5.0.3" + resolved "https://registry.yarnpkg.com/@types/storybook__addon-knobs/-/storybook__addon-knobs-5.0.3.tgz#a6366877d7b21f9fa2cc9eb23650304388393350" + integrity sha512-NnSOu4ajk4kL1e1eRe9zzyspIghgFu8B9ELyrAl1jF/nJE26YK2oDTi7qr+k/+X33rNaYFo6e7+lsEqeI3MLXg== dependencies: "@types/react" "*" "@types/storybook__react" "*" @@ -2240,32 +2225,10 @@ "@types/react" "*" "@types/webpack-env" "*" -"@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e" - integrity sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ== - -"@types/vfile-message@*": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/vfile-message/-/vfile-message-1.0.1.tgz#e1e9895cc6b36c462d4244e64e6d0b6eaf65355a" - integrity sha512-mlGER3Aqmq7bqR1tTTIVHq8KSAFFRyGbrxuM8C/H82g6k7r2fS+IMEkIu3D7JHzG10NvPdR8DNx0jr0pwpp4dA== - dependencies: - "@types/node" "*" - "@types/unist" "*" - -"@types/vfile@^3.0.0": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@types/vfile/-/vfile-3.0.2.tgz#19c18cd232df11ce6fa6ad80259bc86c366b09b9" - integrity sha512-b3nLFGaGkJ9rzOcuXRfHkZMdjsawuDD0ENL9fzTophtBg8FJHSGbH7daXkEpcwy3v7Xol3pAvsmlYyFhR4pqJw== - dependencies: - "@types/node" "*" - "@types/unist" "*" - "@types/vfile-message" "*" - "@types/webpack-env@*": - version "1.13.9" - resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.13.9.tgz#a67287861c928ebf4159a908d1fb1a2a34d4097a" - integrity sha512-p8zp5xqkly3g4cCmo2mKOHI9+Z/kObmDj0BmjbDDJQlgDTiEGTbm17MEwTAusV6XceCy+bNw9q/ZHXHyKo3zkg== + version "1.14.0" + resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.14.0.tgz#8edfc5f8e6eae20eeed3ca0d02974ed4ee5e4efc" + integrity sha512-Fv+0gYJzE/czLoRKq+gnXWr4yBpPM3tO3C8pDLFwqVKlMICQUq5OsxwwFZYDaVr7+L6mgNDp16iOcJHEz3J5RQ== "@types/yargs@^12.0.2", "@types/yargs@^12.0.9": version "12.0.12" @@ -2273,38 +2236,39 @@ integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw== "@typescript-eslint/eslint-plugin@^1.11.0": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.11.0.tgz#870f752c520db04db6d3668af7479026a6f2fb9a" - integrity sha512-mXv9ccCou89C8/4avKHuPB2WkSZyY/XcTQUXd5LFZAcLw1I3mWYVjUu6eS9Ja0QkP/ClolbcW9tb3Ov/pMdcqw== + version "1.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.13.0.tgz#22fed9b16ddfeb402fd7bcde56307820f6ebc49f" + integrity sha512-WQHCozMnuNADiqMtsNzp96FNox5sOVpU8Xt4meaT4em8lOG1SrOv92/mUbEHQVh90sldKSfcOc/I0FOb/14G1g== dependencies: - "@typescript-eslint/experimental-utils" "1.11.0" + "@typescript-eslint/experimental-utils" "1.13.0" eslint-utils "^1.3.1" functional-red-black-tree "^1.0.1" regexpp "^2.0.1" tsutils "^3.7.0" -"@typescript-eslint/[email protected]": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-1.11.0.tgz#594abe47091cbeabac1d6f9cfed06d0ad99eb7e3" - integrity sha512-7LbfaqF6B8oa8cp/315zxKk8FFzosRzzhF8Kn/ZRsRsnpm7Qcu25cR/9RnAQo5utZ2KIWVgaALr+ZmcbG47ruw== +"@typescript-eslint/[email protected]": + version "1.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-1.13.0.tgz#b08c60d780c0067de2fb44b04b432f540138301e" + integrity sha512-zmpS6SyqG4ZF64ffaJ6uah6tWWWgZ8m+c54XXgwFtUv0jNz8aJAVx8chMCvnk7yl6xwn8d+d96+tWp7fXzTuDg== dependencies: - "@typescript-eslint/typescript-estree" "1.11.0" + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "1.13.0" eslint-scope "^4.0.0" "@typescript-eslint/parser@^1.11.0": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.11.0.tgz#2f6d4f7e64eeb1e7c25b422f8df14d0c9e508e36" - integrity sha512-5xBExyXaxVyczrZvbRKEXvaTUFFq7gIM9BynXukXZE0zF3IQP/FxF4mPmmh3gJ9egafZFqByCpPTFm3dk4SY7Q== + version "1.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.13.0.tgz#61ac7811ea52791c47dc9fd4dd4a184fae9ac355" + integrity sha512-ITMBs52PCPgLb2nGPoeT4iU3HdQZHcPaZVw+7CsFagRJHUhyeTgorEwHXhFf3e7Evzi8oujKNpHc8TONth8AdQ== dependencies: "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "1.11.0" - "@typescript-eslint/typescript-estree" "1.11.0" + "@typescript-eslint/experimental-utils" "1.13.0" + "@typescript-eslint/typescript-estree" "1.13.0" eslint-visitor-keys "^1.0.0" -"@typescript-eslint/[email protected]": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.11.0.tgz#b7b5782aab22e4b3b6d84633652c9f41e62d37d5" - integrity sha512-fquUHF5tAx1sM2OeRCC7wVxFd1iMELWMGCzOSmJ3pLzArj9+kRixdlC4d5MncuzXpjEqc6045p3KwM0o/3FuUA== +"@typescript-eslint/[email protected]": + version "1.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.13.0.tgz#8140f17d0f60c03619798f1d628b8434913dc32e" + integrity sha512-b5rCmd2e6DCC6tCTN9GSUAuxdYwCM/k/2wdjHGrIRGPSJotWMCe/dGpi66u42bhuh8q3QBzqM4TMA1GUUCJvdw== dependencies: lodash.unescape "4.0.1" semver "5.5.0" @@ -2491,11 +2455,6 @@ accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: mime-types "~2.1.24" negotiator "0.6.2" -acorn-dynamic-import@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz#482210140582a36b83c3e342e1cfebcaa9240948" - integrity sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw== - acorn-globals@^4.1.0: version "4.3.2" resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.2.tgz#4e2c2313a597fd589720395f6354b41cd5ec8006" @@ -2519,10 +2478,10 @@ 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.5, acorn@^6.0.7: - version "6.2.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.2.0.tgz#67f0da2fc339d6cfb5d6fb244fd449f33cd8bbe3" - integrity sha512-8oe72N3WPMjA+2zVG71Ia0nXZ8DpQH+QyyHO+p06jT8eg8FGG3FbcUIi8KziHlAfheJQZeoqbvq1mQSQHXKYLw== +acorn@^6.0.1, acorn@^6.0.7, acorn@^6.2.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.2.1.tgz#3ed8422d6dec09e6121cc7a843ca86a330a86b51" + integrity sha512-JD0xT5FCRDNyjDda3Lrg/IxFscp9q4tiYtxE1/nOzlKCk7hIRuYjhq1kCNkbPjMRMZuFq20HNQn1I9k8Oj0E+Q== [email protected]: version "1.0.3" @@ -2563,14 +2522,14 @@ ajv-errors@^1.0.0: integrity sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ== ajv-keywords@^3.1.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.0.tgz#4b831e7b531415a7cc518cd404e73f6193c6349d" - integrity sha512-aUjdRFISbuFOl0EIZc+9e4FfZp0bDZgAdOOf30bJmw8VM9v84SHyVyxDfbWxpGYbdZD/9XoKxfHVNmxPkhwyGw== + version "3.4.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.1.tgz#ef916e271c64ac12171fd8384eaae6b2345854da" + integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ== -ajv@^6.1.0, ajv@^6.10.0, ajv@^6.5.5, ajv@^6.9.1: - version "6.10.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" - integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== +ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.5: + version "6.10.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" + integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== dependencies: fast-deep-equal "^2.0.1" fast-json-stable-stringify "^2.0.0" @@ -2649,36 +2608,34 @@ aproba@^1.0.3, aproba@^1.1.1: resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== -archiver-utils@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/archiver-utils/-/archiver-utils-2.0.0.tgz#5639818a8b5d89d0ffc51b72c39283cf4fea14a1" - integrity sha512-JRBgcVvDX4Mwu2RBF8bBaHcQCSxab7afsxAPYDQ5W+19quIPP5CfKE7Ql+UHs9wYvwsaNR8oDuhtf5iqrKmzww== +archiver-utils@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/archiver-utils/-/archiver-utils-2.1.0.tgz#e8a460e94b693c3e3da182a098ca6285ba9249e2" + integrity sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw== dependencies: - glob "^7.0.0" - graceful-fs "^4.1.0" + glob "^7.1.4" + graceful-fs "^4.2.0" lazystream "^1.0.0" - lodash.assign "^4.2.0" lodash.defaults "^4.2.0" lodash.difference "^4.5.0" lodash.flatten "^4.4.0" lodash.isplainobject "^4.0.6" - lodash.toarray "^4.4.0" lodash.union "^4.6.0" normalize-path "^3.0.0" readable-stream "^2.0.0" archiver@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/archiver/-/archiver-3.0.0.tgz#50b2628cf032adcbf35d35d111b5324db95bfb69" - integrity sha512-5QeR6Xc5hSA9X1rbQfcuQ6VZuUXOaEdB65Dhmk9duuRJHYif/ZyJfuyJqsQrj34PFjU5emv5/MmfgA8un06onw== + version "3.0.3" + resolved "https://registry.yarnpkg.com/archiver/-/archiver-3.0.3.tgz#7487be5172650619eb5e3a473032a348a3412cdc" + integrity sha512-d0W7NUyXoLklozHHfvWnHoHS3dvQk8eB22pv5tBwcu1jEO5eZY8W+gHytkAaJ0R8fU2TnNThrWYxjvFlKvRxpw== dependencies: - archiver-utils "^2.0.0" - async "^2.0.0" + archiver-utils "^2.1.0" + async "^2.6.3" buffer-crc32 "^0.2.1" - glob "^7.0.0" - readable-stream "^2.0.0" - tar-stream "^1.5.0" - zip-stream "^2.0.1" + glob "^7.1.4" + readable-stream "^3.4.0" + tar-stream "^2.1.0" + zip-stream "^2.1.0" are-we-there-yet@~1.1.2: version "1.1.5" @@ -2887,12 +2844,12 @@ async@^1.5.2: resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= -async@^2.0.0, async@^2.1.4: - version "2.6.2" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" - integrity sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg== +async@^2.1.4, async@^2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" + integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== dependencies: - lodash "^4.17.11" + lodash "^4.17.14" asynckit@^0.4.0: version "0.4.0" @@ -2927,6 +2884,21 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== +axios-mock-adapter@^1.17.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/axios-mock-adapter/-/axios-mock-adapter-1.17.0.tgz#0dbee43c606d4aaba5a43d88d96d6661a7cc3c04" + integrity sha512-q3efmwJUOO4g+wsLNSk9Ps1UlJoF3fQ3FSEe4uEEhkRtu7SoiAVPj8R3Hc/WP55MBTVFzaDP9QkdJhdVhP8A1Q== + dependencies: + deep-equal "^1.0.1" + +axios@^0.19.0: + version "0.19.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.0.tgz#8e09bff3d9122e133f7b8101c8fbdd00ed3d2ab8" + integrity sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ== + dependencies: + follow-redirects "1.5.10" + is-buffer "^2.0.2" + babel-code-frame@^6.22.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -3056,10 +3028,11 @@ babel-plugin-emotion@^9.2.11: touch "^2.0.1" babel-plugin-istanbul@^5.1.0: - version "5.1.4" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz#841d16b9a58eeb407a0ddce622ba02fe87a752ba" - integrity sha512-dySz4VJMH+dpndj0wjJ8JPs/7i1TdSPb1nRrn56/92pKOF9VKC1FMFJmMXjzlGGusnCAqujP6PBCiKq0sVA+YQ== + version "5.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz#df4ade83d897a92df069c4d9a25cf2671293c854" + integrity sha512-5LphC0USA8t4i1zCtjbbNb6jJj/9+X6P37Qfirc/70EQ34xKlMW+a1RHGwxGI+SwWpNwZ27HqvzAobeqaXwiZw== dependencies: + "@babel/helper-plugin-utils" "^7.0.0" find-up "^3.0.0" istanbul-lib-instrument "^3.3.0" test-exclude "^5.2.3" @@ -3323,7 +3296,7 @@ babel-preset-react-app@^9.0.0: babel-plugin-macros "2.5.1" babel-plugin-transform-react-remove-prop-types "0.4.24" [email protected], babel-runtime@^6.18.0, babel-runtime@^6.23.0, babel-runtime@^6.26.0: +babel-runtime@^6.18.0, babel-runtime@^6.23.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= @@ -3336,11 +3309,6 @@ babel-standalone@^6.26.0: resolved "https://registry.yarnpkg.com/babel-standalone/-/babel-standalone-6.26.0.tgz#15fb3d35f2c456695815ebf1ed96fe7f015b6886" integrity sha1-Ffs9NfLEVmlYFevx7Zb+fwFbaIY= -bail@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.4.tgz#7181b66d508aa3055d3f6c13f0a0c720641dde9b" - integrity sha512-S8vuDB4w6YpRhICUDET3guPlQpaJl7od94tpZ0Fvnyp+MKW/HyDTcRDck+29C9g+d/qQHnddRH3+94kZdrW0Ww== - balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" @@ -3391,13 +3359,12 @@ binary-extensions@^1.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== -bl@^1.0.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c" - integrity sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA== +bl@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-3.0.0.tgz#3611ec00579fd18561754360b21e9f784500ff88" + integrity sha512-EUAyP5UHU5hxF8BPT0LKW8gjYLhq1DQIcneOX/pL/m2Alo+OYDQAJlHq+yseMP50Os2nHXOSic6Ss3vSQeyf4A== dependencies: - readable-stream "^2.3.5" - safe-buffer "^5.1.1" + readable-stream "^3.0.1" block-stream@*: version "0.0.9" @@ -3580,13 +3547,13 @@ [email protected]: node-releases "^1.1.13" browserslist@^4.5.2, browserslist@^4.6.0, browserslist@^4.6.2, browserslist@^4.6.3: - version "4.6.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.6.3.tgz#0530cbc6ab0c1f3fc8c819c72377ba55cf647f05" - integrity sha512-CNBqTCq22RKM8wKJNowcqihHJ4SkI8CGeK7KOR9tPboXUuS5Zk5lQgzzTbs4oxD8x+6HUshZUa2OyNI9lR93bQ== + version "4.6.6" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.6.6.tgz#6e4bf467cde520bc9dbdf3747dafa03531cec453" + integrity sha512-D2Nk3W9JL9Fp/gIcWei8LrERCS+eXu9AM5cfXA8WEZ84lFks+ARnZ0q/R69m2SV3Wjma83QDDPxsNKXUwdIsyA== dependencies: - caniuse-lite "^1.0.30000975" - electron-to-chromium "^1.3.164" - node-releases "^1.1.23" + caniuse-lite "^1.0.30000984" + electron-to-chromium "^1.3.191" + node-releases "^1.1.25" bser@^2.0.0: version "2.1.0" @@ -3595,29 +3562,11 @@ bser@^2.0.0: dependencies: node-int64 "^0.4.0" -buffer-alloc-unsafe@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" - integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== - -buffer-alloc@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" - integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== - dependencies: - buffer-alloc-unsafe "^1.1.0" - buffer-fill "^1.0.0" - -buffer-crc32@^0.2.1: +buffer-crc32@^0.2.1, buffer-crc32@^0.2.13: version "0.2.13" resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= -buffer-fill@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" - integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= - buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" @@ -3665,7 +3614,7 @@ [email protected]: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== -cacache@^11.3.2: +cacache@^11.3.3: version "11.3.3" resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.3.3.tgz#8bd29df8c6a718a6ebd2d010da4d7972ae3bbadc" integrity sha512-p8WcneCytvzPxhDvYp31PD039vi77I12W+/KfR9S8AZbaiARFBCpsPJS+9uhWfeBfeAtW7o/4vt3MUqLkbY6nA== @@ -3685,6 +3634,27 @@ cacache@^11.3.2: unique-filename "^1.1.1" y18n "^4.0.0" +cacache@^12.0.2: + version "12.0.2" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-12.0.2.tgz#8db03205e36089a3df6954c66ce92541441ac46c" + integrity sha512-ifKgxH2CKhJEg6tNdAwziu6Q33EvuG26tYcda6PT3WKisZcYDXsnEdnRv67Po3yCzFfaSoMjGZzJyD2c3DT1dg== + dependencies: + bluebird "^3.5.5" + chownr "^1.1.1" + figgy-pudding "^3.5.1" + glob "^7.1.4" + graceful-fs "^4.1.15" + infer-owner "^1.0.3" + lru-cache "^5.1.1" + mississippi "^3.0.0" + mkdirp "^0.5.1" + move-concurrently "^1.0.1" + promise-inflight "^1.0.1" + rimraf "^2.6.3" + ssri "^6.0.1" + unique-filename "^1.1.1" + y18n "^4.0.0" + cache-base@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" @@ -3734,7 +3704,7 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== [email protected]: [email protected], camel-case@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" integrity sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M= @@ -3784,15 +3754,10 @@ can-use-dom@^0.1.0: resolved "https://registry.yarnpkg.com/can-use-dom/-/can-use-dom-0.1.0.tgz#22cc4a34a0abc43950f42c6411024a3f6366b45a" integrity sha1-IsxKNKCrxDlQ9CxkEQJKP2NmtFo= -caniuse-lite@^1.0.30000955, caniuse-lite@^1.0.30000980: - version "1.0.30000980" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000980.tgz#0df53e4354b3111f83ac15b0bd4c71fe92994231" - integrity sha512-as0PRtWHaX3gl2gpC7qA7bX88lr+qLacMMXm1QKLLQtBCwT/Ljbgrv5EXKMNBoeEX6yFZ4vIsBb4Nh+PEwW2Rw== - -caniuse-lite@^1.0.30000975: - version "1.0.30000979" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000979.tgz#92f16d00186a6cf20d6c5711bb6e042a3d667029" - integrity sha512-gcu45yfq3B7Y+WB05fOMfr0EiSlq+1u+m6rPHyJli/Wy3PVQNGaU7VA4bZE5qw+AU2UVOBR/N5g1bzADUqdvFw== +caniuse-lite@^1.0.30000955, caniuse-lite@^1.0.30000980, caniuse-lite@^1.0.30000984: + version "1.0.30000988" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000988.tgz#742f35ec1b8b75b9628d705d7652eea1fef983db" + integrity sha512-lPj3T8poYrRc/bniW5SQPND3GRtSrQdUM/R4mCYTbZxyi3jQiggLvZH4+BYUuX0t4TXjU+vMM7KFDQg+rSzZUQ== capture-exit@^2.0.0: version "2.0.0" @@ -3811,11 +3776,6 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -ccount@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.4.tgz#9cf2de494ca84060a2a8d2854edd6dfb0445f386" - integrity sha512-fpZ81yYfzentuieinmGnphk0pLkOTMm6MZdVqwd77ROvhko6iujLNGrHH5E7utq3ygWklwfmwuG+A7P+NpqT6w== - [email protected]: version "2.3.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796" @@ -4096,7 +4056,7 @@ [email protected]: resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== -commander@^2.19.0, commander@~2.20.0: +commander@^2.19.0, commander@^2.20.0, commander@~2.20.0: version "2.20.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== @@ -4107,9 +4067,9 @@ commander@~2.19.0: integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== commitizen@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/commitizen/-/commitizen-3.1.1.tgz#0135c8c68df52ce348d718f79b23eb03b8713918" - integrity sha512-n5pnG8sNM5a3dS3Kkh3rYr+hFdPWZlqV6pfz6KGLmWV/gsIiTqAwhTgFKkcF/paKUpfIMp0x4YZlD0xLBNTW9g== + version "3.1.2" + resolved "https://registry.yarnpkg.com/commitizen/-/commitizen-3.1.2.tgz#29ddd8b39396923e9058a0e4840cbeef144290be" + integrity sha512-eD0uTUsogu8ksFjFFYq75LLfXeLXsCIa27TPfOqvBI+tCx1Pp5QfKqC9oC+qTpSz3nTn9/+7TL5mE/wurB22JQ== dependencies: cachedir "2.1.0" cz-conventional-changelog "2.1.0" @@ -4121,7 +4081,7 @@ commitizen@^3.1.1: glob "7.1.3" inquirer "6.2.0" is-utf8 "^0.2.1" - lodash "4.17.11" + lodash "4.17.14" minimist "1.2.0" shelljs "0.7.6" strip-bom "3.0.0" @@ -4150,15 +4110,15 @@ component-emitter@^1.2.1: resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== -compress-commons@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/compress-commons/-/compress-commons-1.2.2.tgz#524a9f10903f3a813389b0225d27c48bb751890f" - integrity sha1-UkqfEJA/OoEzibAiXSfEi7dRiQ8= +compress-commons@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/compress-commons/-/compress-commons-2.0.0.tgz#c555107ef865eef0ba8a31fe56ec79f813ed3e65" + integrity sha512-gnETNngrfsAoLBENM8M0DoiCDJkHwz3OfIg4mBtqKDcRgE4oXNwHxHxgHvwKKlrcD7eZ7BVTy4l8t9xVF7q3FQ== dependencies: - buffer-crc32 "^0.2.1" + buffer-crc32 "^0.2.13" crc32-stream "^2.0.0" - normalize-path "^2.0.0" - readable-stream "^2.0.0" + normalize-path "^3.0.0" + readable-stream "^2.3.6" compressible@~2.0.16: version "2.0.17" @@ -4288,17 +4248,17 @@ conventional-changelog-conventionalcommits@^3.0.2: q "^1.5.1" conventional-changelog-core@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-3.2.2.tgz#de41e6b4a71011a18bcee58e744f6f8f0e7c29c0" - integrity sha512-cssjAKajxaOX5LNAJLB+UOcoWjAIBvXtDMedv/58G+YEmAXMNfC16mmPl0JDOuVJVfIqM0nqQiZ8UCm8IXbE0g== + version "3.2.3" + resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-3.2.3.tgz#b31410856f431c847086a7dcb4d2ca184a7d88fb" + integrity sha512-LMMX1JlxPIq/Ez5aYAYS5CpuwbOk6QFp8O4HLAcZxe3vxoCtABkhfjetk8IYdRB9CDQGwJFLR3Dr55Za6XKgUQ== dependencies: - conventional-changelog-writer "^4.0.5" - conventional-commits-parser "^3.0.2" + conventional-changelog-writer "^4.0.6" + conventional-commits-parser "^3.0.3" dateformat "^3.0.0" get-pkg-repo "^1.0.0" git-raw-commits "2.0.0" git-remote-origin-url "^2.0.0" - git-semver-tags "^2.0.2" + git-semver-tags "^2.0.3" lodash "^4.2.1" normalize-package-data "^2.3.5" q "^1.5.1" @@ -4343,19 +4303,19 @@ conventional-changelog-jshint@^2.0.1: q "^1.5.1" conventional-changelog-preset-loader@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.1.1.tgz#65bb600547c56d5627d23135154bcd9a907668c4" - integrity sha512-K4avzGMLm5Xw0Ek/6eE3vdOXkqnpf9ydb68XYmCc16cJ99XMMbc2oaNMuPwAsxVK6CC1yA4/I90EhmWNj0Q6HA== + version "2.2.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.2.0.tgz#571e2b3d7b53d65587bea9eedf6e37faa5db4fcc" + integrity sha512-zXB+5vF7D5Y3Cb/rJfSyCCvFphCVmF8mFqOdncX3BmjZwAtGAPfYrBcT225udilCKvBbHgyzgxqz2GWDB5xShQ== -conventional-changelog-writer@^4.0.5: - version "4.0.6" - resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.6.tgz#24db578ac8e7c89a409ef9bba12cf3c095990148" - integrity sha512-ou/sbrplJMM6KQpR5rKFYNVQYesFjN7WpNGdudQSWNi6X+RgyFUcSv871YBYkrUYV9EX8ijMohYVzn9RUb+4ag== +conventional-changelog-writer@^4.0.6: + version "4.0.7" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.7.tgz#e4b7d9cbea902394ad671f67108a71fa90c7095f" + integrity sha512-p/wzs9eYaxhFbrmX/mCJNwJuvvHR+j4Fd0SQa2xyAhYed6KBiZ780LvoqUUvsayP4R1DtC27czalGUhKV2oabw== dependencies: compare-func "^1.3.1" conventional-commits-filter "^2.0.2" dateformat "^3.0.0" - handlebars "^4.1.0" + handlebars "^4.1.2" json-stringify-safe "^5.0.1" lodash "^4.2.1" meow "^4.0.0" @@ -4406,7 +4366,7 @@ conventional-commits-parser@^2.1.0: through2 "^2.0.0" trim-off-newlines "^1.0.0" -conventional-commits-parser@^3.0.2: +conventional-commits-parser@^3.0.2, conventional-commits-parser@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.0.3.tgz#c3f972fd4e056aa8b9b4f5f3d0e540da18bf396d" integrity sha512-KaA/2EeUkO4bKjinNfGUyqPTX/6w9JGshuQRik4r/wJz7rUw3+D3fDG6sZSEqJvKILzKXFQuFkpPLclcsAuZcg== @@ -4475,11 +4435,11 @@ copy-to-clipboard@^3.0.8: toggle-selection "^1.0.6" copy-webpack-plugin@^5.0.2: - version "5.0.3" - resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-5.0.3.tgz#2179e3c8fd69f13afe74da338896f1f01a875b5c" - integrity sha512-PlZRs9CUMnAVylZq+vg2Juew662jWtwOXOqH4lbQD9ZFhRG9R7tVStOgHt21CBGVq7k5yIJaz8TXDLSjV+Lj8Q== + version "5.0.4" + resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-5.0.4.tgz#c78126f604e24f194c6ec2f43a64e232b5d43655" + integrity sha512-YBuYGpSzoCHSSDGyHy6VJ7SHojKp6WHT4D7ItcQFNAYx2hrwkMe56e97xfVR0/ovDuMTrMffXUiltvQljtAGeg== dependencies: - cacache "^11.3.2" + cacache "^11.3.3" find-cache-dir "^2.1.0" glob-parent "^3.1.0" globby "^7.1.1" @@ -4527,12 +4487,12 @@ [email protected], core-util-is@~1.0.0: integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= corejs-upgrade-webpack-plugin@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/corejs-upgrade-webpack-plugin/-/corejs-upgrade-webpack-plugin-2.1.0.tgz#6afa44672486353ae639c297548c0686b64fb325" - integrity sha512-gc+S4t8VT9YFSgOPrhZlD6kDoGZtUq71QwXxS2neGNPhli0veKhbzzilODIpy73TjXGUrCHCpevK8vBnzUPuhw== + version "2.2.0" + resolved "https://registry.yarnpkg.com/corejs-upgrade-webpack-plugin/-/corejs-upgrade-webpack-plugin-2.2.0.tgz#503293bf1fdcb104918eb40d0294e4776ad6923a" + integrity sha512-J0QMp9GNoiw91Kj/dkIQFZeiCXgXoja/Wlht1SPybxerBWh4NCmb0pOgCv61lrlQZETwvVVfAFAA3IqoEO9aqQ== dependencies: resolve-from "^5.0.0" - webpack "^4.33.0" + webpack "^4.38.0" cosmiconfig@^5.0.0, cosmiconfig@^5.2.0, cosmiconfig@^5.2.1: version "5.2.1" @@ -4706,14 +4666,6 @@ css-select@^2.0.0: domutils "^1.7.0" nth-check "^1.0.2" [email protected]: - version "1.0.0-alpha.28" - resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.28.tgz#8e8968190d886c9477bc8d61e96f61af3f7ffa7f" - integrity sha512-joNNW1gCp3qFFzj4St6zk+Wh/NBv0vM5YbEreZk0SD4S23S+1xBKb6cLDg2uj4P4k/GUMlIm6cKIDqIG+vdt0w== - dependencies: - mdn-data "~1.1.0" - source-map "^0.5.3" - [email protected]: version "1.0.0-alpha.29" resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.29.tgz#3fa9d4ef3142cbd1c301e7664c1f352bd82f5a39" @@ -4722,10 +4674,13 @@ [email protected]: mdn-data "~1.1.0" source-map "^0.5.3" -css-url-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/css-url-regex/-/css-url-regex-1.1.0.tgz#83834230cc9f74c457de59eebd1543feeb83b7ec" - integrity sha1-g4NCMMyfdMRX3lnuvRVD/uuDt+w= [email protected]: + version "1.0.0-alpha.33" + resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.33.tgz#970e20e5a91f7a378ddd0fc58d0b6c8d4f3be93e" + integrity sha512-SPt57bh5nQnpsTBsx/IXbO14sRc9xXu5MtMAVuo0BaQQmyf0NupNPPSoMaqiAF5tDFafYsTkfeH4Q/HCKXkg4w== + dependencies: + mdn-data "2.0.4" + source-map "^0.5.3" [email protected], css-what@^2.1.2: version "2.1.3" @@ -4744,22 +4699,22 @@ csso@^3.5.1: dependencies: css-tree "1.0.0-alpha.29" -"cssom@>= 0.3.2 < 0.4.0", cssom@~0.3.6: [email protected], "cssom@>= 0.3.2 < 0.4.0": version "0.3.8" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== cssstyle@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.3.0.tgz#c36c466f7037fd30f03baa271b65f0f17b50585c" - integrity sha512-wXsoRfsRfsLVNaVzoKdqvEmK/5PFaEXNspVT22Ots6K/cnJdpoDKuQFw+qlMiXnmaif1OgeC466X1zISgAOcGg== + version "1.4.0" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.4.0.tgz#9d31328229d3c565c61e586b02041a28fccdccf1" + integrity sha512-GBrLZYZ4X4x6/QEoBnIrqb8B/f5l4+8me2dkom/j1Gtbxy0kBv6OGzKuAsGM75bkGwGAFkt56Iwg28S3XTZgSA== dependencies: - cssom "~0.3.6" + cssom "0.3.x" csstype@^2.2.0, csstype@^2.5.2, csstype@^2.5.7: - version "2.6.5" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.5.tgz#1cd1dff742ebf4d7c991470ae71e12bb6751e034" - integrity sha512-JsTaiksRsel5n7XwqPAfB0l3TFKdpjW/kgAELf9vrb5adGA7UCPLajKK5s3nFrcFm3Rkyp/Qkgl73ENc1UY3cA== + version "2.6.6" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.6.tgz#c34f8226a94bbb10c32cc0d714afdf942291fc41" + integrity sha512-RpFbQGUE74iyPgvr46U9t1xoQBM8T4BL8SxrN66Le2xYAPSaDJJKeztV3awugusb3g3G9iL8StmkBBXhcbbXhg== currently-unhandled@^0.4.1: version "0.4.1" @@ -4824,6 +4779,13 @@ [email protected], debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8, debug@^2.6. dependencies: ms "2.0.0" +debug@=3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + dependencies: + ms "2.0.0" + debug@^3.2.5, debug@^3.2.6: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" @@ -5164,6 +5126,11 @@ domhandler@^2.3.0: dependencies: domelementtype "1" +dompurify@^1.0.11: + version "1.0.11" + resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-1.0.11.tgz#fe0f4a40d147f7cebbe31a50a1357539cfc1eb4d" + integrity sha512-XywCTXZtc/qCX3iprD1pIklRVk/uhl8BKpkTxr+ZyMVUzSUg7wkQXRBp/euJ5J5moa1QvfpvaPQVP71z1O59dQ== + [email protected]: version "1.5.1" resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" @@ -5257,15 +5224,10 @@ ejs@^2.6.1: resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.6.2.tgz#3a32c63d1cd16d11266cd4703b14fec4e74ab4f6" integrity sha512-PcW2a0tyTuPHz3tWyYqtK6r1fZ3gp+3Sop8Ph+ZYN81Ob5rwmbHEzaqs10N3BEsaGTkh/ooniXK+WwszGlc2+Q== -electron-to-chromium@^1.3.122: - version "1.3.188" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.188.tgz#e28e1afe4bb229989e280bfd3b395c7ec03c8b7a" - integrity sha512-tEQcughYIMj8WDMc59EGEtNxdGgwal/oLLTDw+NEqJRJwGflQvH3aiyiexrWeZOETP4/ko78PVr6gwNhdozvuQ== - -electron-to-chromium@^1.3.164: - version "1.3.187" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.187.tgz#fea64435f370892c0f27aded1bbdcb6f235c592b" - integrity sha512-XCEygaK7Fs35/RwS+67YbBWs/ydG+oUFPuy1wv558jC3Opd2DHwRyRqrCmhxpmPmCSVlZujYX4TOmOXuMz2GZA== +electron-to-chromium@^1.3.122, electron-to-chromium@^1.3.191: + version "1.3.207" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.207.tgz#b19ce94d61187d72411ebb83dfe287366a785102" + integrity sha512-RIgAnfqbjZNECBLjslfy4cIYvcPl3GAXmnENrcoo0TZ8fGkyEEAealAbO7MoevW4xYUPe+e68cWAj6eP0DmMHw== elliptic@^6.0.0: version "6.5.0" @@ -5319,7 +5281,7 @@ encoding@^0.1.11: dependencies: iconv-lite "~0.4.13" -end-of-stream@^1.0.0, end-of-stream@^1.1.0: +end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== @@ -5436,9 +5398,9 @@ eslint-import-resolver-node@^0.3.2: resolve "^1.5.0" eslint-module-utils@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.4.0.tgz#8b93499e9b00eab80ccb6614e69f03678e84e09a" - integrity sha512-14tltLm38Eu3zS+mt0KvILC3q8jyIAH518MlG+HO0p+yK885Lb1UHTY/UgR91eOyGdmxAPb+OLoW4znqIT6Ndw== + version "2.4.1" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.4.1.tgz#7b4675875bf96b0dbf1b21977456e5bb1f5e018c" + integrity sha512-H6DOj+ejw7Tesdgbfs4jeS4YMFrT8uI8xwd1gtQqXssaR0EQ26L+2O/w6wkYFy2MymON0fTwHmXBvvfLNZVZEw== dependencies: debug "^2.6.8" pkg-dir "^2.0.0" @@ -5452,9 +5414,9 @@ eslint-plugin-es@^1.4.0: regexpp "^2.0.1" eslint-plugin-import@^2.18.0: - version "2.18.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.18.0.tgz#7a5ba8d32622fb35eb9c8db195c2090bd18a3678" - integrity sha512-PZpAEC4gj/6DEMMoU2Df01C5c50r7zdGIN52Yfi7CvvWaYssG7Jt5R9nFG5gmqodxNOz9vQS87xk6Izdtpdrig== + version "2.18.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.18.2.tgz#02f1180b90b077b33d447a17a2326ceb400aceb6" + integrity sha512-5ohpsHAiUBRNaBWAF08izwUGlbrJoJJ+W9/TBwsGoR1MnlgfwMIKrFeSjWbt6moabiXW9xNvtFz+97KHRfI4HQ== dependencies: array-includes "^3.0.3" contains-path "^0.1.0" @@ -5463,8 +5425,8 @@ eslint-plugin-import@^2.18.0: eslint-import-resolver-node "^0.3.2" eslint-module-utils "^2.4.0" has "^1.0.3" - lodash "^4.17.11" minimatch "^3.0.4" + object.values "^1.1.0" read-pkg-up "^2.0.0" resolve "^1.11.0" @@ -5498,9 +5460,9 @@ eslint-plugin-react-hooks@^1.6.0: integrity sha512-wHhmGJyVuijnYIJXZJHDUF2WM+rJYTjulUTqF9k61d3BTk8etydz+M4dXUVH7M76ZRS85rqBTCx0Es/lLsrjnA== eslint-plugin-react@^7.12.4, eslint-plugin-react@^7.14.2: - version "7.14.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.14.2.tgz#94c193cc77a899ac0ecbb2766fbef88685b7ecc1" - integrity sha512-jZdnKe3ip7FQOdjxks9XPN0pjUKZYq48OggNMd16Sk+8VXx6JOvXmlElxROCgp7tiUsTsze3jd78s/9AFJP2mA== + version "7.14.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.14.3.tgz#911030dd7e98ba49e1b2208599571846a66bdf13" + integrity sha512-EzdyyBWC4Uz2hPYBiEJrKCUi2Fn+BJ9B/pJQcjw5X+x/H2Nm59S4MJIvL4O5NEE0+WbnQwEBxWY03oUk+Bc3FA== dependencies: array-includes "^3.0.3" doctrine "^2.1.0" @@ -5517,7 +5479,7 @@ eslint-plugin-standard@^4.0.0: resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-4.0.0.tgz#f845b45109c99cd90e77796940a344546c8f6b5c" integrity sha512-OwxJkR6TQiYMmt1EsNRMe5qG3GsbjlcOhbGUBY4LtavF9DsLaTcoR+j2Tdjqi23oUwKNUqX7qcn5fPStafMdlA== -eslint-scope@^4.0.0, eslint-scope@^4.0.3: +eslint-scope@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== @@ -5525,10 +5487,20 @@ eslint-scope@^4.0.0, eslint-scope@^4.0.3: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-scope@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9" + integrity sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + eslint-utils@^1.3.0, eslint-utils@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" - integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q== + version "1.4.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.0.tgz#e2c3c8dba768425f897cf0f9e51fe2e241485d4c" + integrity sha512-7ehnzPaP5IIEh1r1tkjuIrxqhNkzUJa9z3R92tLJdZIVdWaczEhr3EbhGtsMrVxi1KeR8qA7Off6SWc5WNQqyQ== + dependencies: + eslint-visitor-keys "^1.0.0" eslint-visitor-keys@^1.0.0: version "1.0.0" @@ -5536,9 +5508,9 @@ eslint-visitor-keys@^1.0.0: integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== eslint@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.0.1.tgz#4a32181d72cb999d6f54151df7d337131f81cda7" - integrity sha512-DyQRaMmORQ+JsWShYsSg4OPTjY56u1nCjAmICrE8vLWqyLKxhFXOthwMj1SA8xwfrv0CofLNVnqbfyhwCkaO0w== + version "6.1.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.1.0.tgz#06438a4a278b1d84fb107d24eaaa35471986e646" + integrity sha512-QhrbdRD7ofuV09IuE2ySWBz0FyXCq0rriLTZXZqaWSI79CVtHVRdkFuFTViiqzZhkCgfOh9USpriuGN2gIpZDQ== dependencies: "@babel/code-frame" "^7.0.0" ajv "^6.10.0" @@ -5546,7 +5518,7 @@ eslint@^6.0.1: cross-spawn "^6.0.5" debug "^4.0.1" doctrine "^3.0.0" - eslint-scope "^4.0.3" + eslint-scope "^5.0.0" eslint-utils "^1.3.1" eslint-visitor-keys "^1.0.0" espree "^6.0.0" @@ -5554,28 +5526,29 @@ eslint@^6.0.1: esutils "^2.0.2" file-entry-cache "^5.0.1" functional-red-black-tree "^1.0.1" - glob-parent "^3.1.0" + glob-parent "^5.0.0" globals "^11.7.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^6.2.2" + inquirer "^6.4.1" is-glob "^4.0.0" js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" - lodash "^4.17.11" + lodash "^4.17.14" minimatch "^3.0.4" mkdirp "^0.5.1" natural-compare "^1.4.0" optionator "^0.8.2" progress "^2.0.0" regexpp "^2.0.1" - semver "^5.5.1" - strip-ansi "^4.0.0" - strip-json-comments "^2.0.1" + semver "^6.1.2" + strip-ansi "^5.2.0" + strip-json-comments "^3.0.1" table "^5.2.3" text-table "^0.2.0" + v8-compile-cache "^2.0.3" espree@^6.0.0: version "6.0.0" @@ -5616,9 +5589,9 @@ estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= esutils@^2.0.0, esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== etag@~1.8.1: version "1.8.1" @@ -5769,15 +5742,15 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@^3.0.0, extend@~3.0.2: +extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== external-editor@^3.0.0, external-editor@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" - integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== + version "3.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" + integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== dependencies: chardet "^0.7.0" iconv-lite "^0.4.24" @@ -5830,9 +5803,9 @@ fast-glob@^2.0.2: micromatch "^3.1.10" fast-glob@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.0.3.tgz#084221f4225d51553bccd5ff4afc17aafa869412" - integrity sha512-scDJbDhN+6S4ELXzzN96Fqm5y1CMRn+Io3C4Go+n/gUKP+LW26Wma6IxLSsX2eAMBUOFmyHKDBrUSuoHsycQ5A== + version "3.0.4" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.0.4.tgz#d484a41005cb6faeb399b951fd1bd70ddaebb602" + integrity sha512-wkIbV6qg37xTJwqSsdnIphL1e+LaGz4AIQqr00mIubMaEhv1/HEmJ0uuCGZRNRUkZZmOB5mJKO0ZUTVq+SxMQg== dependencies: "@nodelib/fs.stat" "^2.0.1" "@nodelib/fs.walk" "^1.2.1" @@ -6080,6 +6053,13 @@ focus-lock@^0.6.3: resolved "https://registry.yarnpkg.com/focus-lock/-/focus-lock-0.6.5.tgz#f6eb37832a9b1b205406175f5277396a28c0fce1" integrity sha512-i/mVBOoa9o+tl+u9owOJUF8k8L85odZNIsctB+JAK2HFT8jckiBwmk+3uydlm6FN8czgnkIwQtBv6yyAbrzXjw== [email protected]: + version "1.5.10" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a" + integrity sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ== + dependencies: + debug "=3.1.0" + follow-redirects@^1.0.0: version "1.7.0" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.7.0.tgz#489ebc198dc0e7f64167bd23b03c4c19b5784c76" @@ -6256,19 +6236,25 @@ function-bind@^1.0.2, function-bind@^1.1.1: integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== function.prototype.name@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.0.tgz#8bd763cc0af860a859cc5d49384d74b932cd2327" - integrity sha512-Bs0VRrTz4ghD8pTmbJQD1mZ8A/mN0ur/jGz+A6FBxPDUPkm1tNfF6bhTYPA7i7aF4lZJVr+OXTNNrnnIl58Wfg== + version "1.1.1" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.1.tgz#6d252350803085abc2ad423d4fe3be2f9cbda392" + integrity sha512-e1NzkiJuw6xqVH7YSdiW/qDHebcmMhPNe6w+4ZYYEg0VA+LaLzx37RimbPLuonHhYGFGPx1ME2nSi74JiaCr/Q== dependencies: - define-properties "^1.1.2" + define-properties "^1.1.3" function-bind "^1.1.1" - is-callable "^1.1.3" + functions-have-names "^1.1.1" + is-callable "^1.1.4" 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" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= +functions-have-names@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.1.1.tgz#79d35927f07b8e7103d819fed475b64ccf7225ea" + integrity sha512-U0kNHUoxwPNPWOJaMG7Z00d4a/qZVrFtzWJRaK8V9goaVOCXBSQSJpt3MYGNtkScKEBKovxLjnNdC9MlXwo5Pw== + fuse.js@^3.4.4: version "3.4.5" resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-3.4.5.tgz#8954fb43f9729bd5dbcb8c08f251db552595a7a6" @@ -6305,10 +6291,10 @@ get-caller-file@^2.0.1: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-own-enumerable-property-symbols@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-2.0.1.tgz#5c4ad87f2834c4b9b4e84549dc1e0650fb38c24b" - integrity sha512-TtY/sbOemiMKPRUDDanGCSgBYe7Mf0vbRsWnBZ+9yghpZ1MvcpSpuZFjHdEeY/LZjZy0vdLjS77L6HosisFiug== +get-own-enumerable-property-symbols@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.0.tgz#b877b49a5c16aefac3655f2ed2ea5b684df8d203" + integrity sha512-CIJYJC4GGF06TakLg8z4GQKvDsx9EMspVxOYih7LerEL/WosUnFIww45CGfxfeKHqlg3twgUrYRT1O3WQqjGCg== get-pkg-repo@^1.0.0: version "1.4.0" @@ -6390,7 +6376,7 @@ git-remote-origin-url@^2.0.0: gitconfiglocal "^1.0.0" pify "^2.3.0" [email protected], git-semver-tags@^2.0.2: [email protected]: version "2.0.2" resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-2.0.2.tgz#f506ec07caade191ac0c8d5a21bdb8131b4934e3" integrity sha512-34lMF7Yo1xEmsK2EkbArdoU79umpvm0MfzaDkSNYSJqtM5QLAVTPWgpiXSVI5o/O9EvZPSrP4Zvnec/CqhSd5w== @@ -6398,6 +6384,14 @@ [email protected], git-semver-tags@^2.0.2: meow "^4.0.0" semver "^5.5.0" +git-semver-tags@^2.0.2, git-semver-tags@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-2.0.3.tgz#48988a718acf593800f99622a952a77c405bfa34" + integrity sha512-tj4FD4ww2RX2ae//jSrXZzrocla9db5h0V7ikPl1P/WwoZar9epdUhwR7XHXSgc+ZkNq72BEEerqQuicoEQfzA== + dependencies: + meow "^4.0.0" + semver "^6.0.0" + gitconfiglocal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz#41d045f3851a5ea88f03f24ca1c6178114464b9b" @@ -6580,7 +6574,7 @@ good-listener@^1.2.2: dependencies: delegate "^3.1.2" -graceful-fs@^4.1.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0: +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.0.tgz#8d8fdc73977cb04104721cb53666c1ca64cd328b" integrity sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg== @@ -6608,7 +6602,7 @@ handle-thing@^2.0.0: resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.0.tgz#0e039695ff50c93fc288557d696f3c1dc6776754" integrity sha512-d4sze1JNC454Wdo2fkuyzCr6aHcbL6PGGuFAz0Li/NcOm1tCHGnWDRmJP85dh9IhQErTc2svWFEX5xHIOo//kQ== -handlebars@^4.1.0, handlebars@^4.1.2: +handlebars@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== @@ -6708,17 +6702,6 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" -hast-util-from-parse5@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/hast-util-from-parse5/-/hast-util-from-parse5-5.0.1.tgz#7da8841d707dcf7be73715f7f3b14e021c4e469a" - integrity sha512-UfPzdl6fbxGAxqGYNThRUhRlDYY7sXu6XU9nQeX4fFZtV+IHbyEJtd+DUuwOqNV4z3K05E/1rIkoVr/JHmeWWA== - dependencies: - ccount "^1.0.3" - hastscript "^5.0.0" - property-information "^5.0.0" - web-namespaces "^1.1.2" - xtend "^4.0.1" - hast-util-parse-selector@^2.2.0: version "2.2.2" resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-2.2.2.tgz#66aabccb252c47d94975f50a281446955160380b" @@ -6734,7 +6717,7 @@ hastscript@^5.0.0: property-information "^5.0.1" space-separated-tokens "^1.0.0" [email protected], he@^1.1.1: [email protected], he@^1.1.1, he@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== @@ -6823,6 +6806,19 @@ html-minifier@^3.5.20, html-minifier@^3.5.8: relateurl "0.2.x" uglify-js "3.4.x" +html-minifier@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-4.0.0.tgz#cca9aad8bce1175e02e17a8c33e46d8988889f56" + integrity sha512-aoGxanpFPLg7MkIl/DDFYtb0iWz7jMFGqFhvEDZga6/4QTjneiD8I/NXL1x5aaoCp7FSIT6h/OhykDdPsbtMig== + dependencies: + camel-case "^3.0.0" + clean-css "^4.2.1" + commander "^2.19.0" + he "^1.2.0" + param-case "^2.1.1" + relateurl "^0.2.7" + uglify-js "^3.5.1" + [email protected]: version "2.0.1" resolved "https://registry.yarnpkg.com/html-parse-stringify2/-/html-parse-stringify2-2.0.1.tgz#dc5670b7292ca158b7bc916c9a6735ac8872834a" @@ -6830,7 +6826,7 @@ [email protected]: dependencies: void-elements "^2.0.1" [email protected], html-webpack-plugin@^4.0.0-beta.2: [email protected]: version "4.0.0-beta.5" resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-4.0.0-beta.5.tgz#2c53083c1151bfec20479b1f8aaf0039e77b5513" integrity sha512-y5l4lGxOW3pz3xBTFdfB9rnnrWRPVxlAhX6nrBYIcW+2k2zC3mSp/3DxlWVCMBfnO6UAnoF8OcFn0IMy6kaKAQ== @@ -6842,6 +6838,18 @@ [email protected], html-webpack-plugin@^4.0.0-beta.2: tapable "^1.1.0" util.promisify "1.0.0" +html-webpack-plugin@^4.0.0-beta.2: + version "4.0.0-beta.8" + resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-4.0.0-beta.8.tgz#d9a8d4322d8cf310f1568f6f4f585a80df0ad378" + integrity sha512-n5S2hJi3/vioRvEDswZP2WFgZU8TUqFoYIrkg5dt+xDC4TigQEhIcl4Y81Qs2La/EqKWuJZP8+ikbHGVmzQ4Mg== + dependencies: + html-minifier "^4.0.0" + loader-utils "^1.2.3" + lodash "^4.17.11" + pretty-error "^2.1.1" + tapable "^1.1.3" + util.promisify "1.0.0" + htmlparser2@^3.3.0: version "3.10.1" resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" @@ -6929,16 +6937,17 @@ https-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= -humps@^2.0.0: +humps@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/humps/-/humps-2.0.1.tgz#dd02ea6081bd0568dc5d073184463957ba9ef9aa" integrity sha1-3QLqYIG9BWjcXQcxhEY5V7qe+ao= husky@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/husky/-/husky-3.0.0.tgz#de63821a7049dc412b1afd753c259e2f6e227562" - integrity sha512-lKMEn7bRK+7f5eWPNGclDVciYNQt0GIkAQmhKl+uHP1qFzoN0h92kmH9HZ8PCwyVA2EQPD8KHf0FYWqnTxau+Q== + version "3.0.2" + resolved "https://registry.yarnpkg.com/husky/-/husky-3.0.2.tgz#e78fd2ae16edca59fc88e56aeb8d70acdcc1c082" + integrity sha512-WXCtaME2x0o4PJlKY4ap8BzLA+D0zlvefqAvLCPriOOu+x0dpO5uc5tlB7CY6/0SE2EESmoZsj4jW5D09KrJoA== dependencies: + chalk "^2.4.2" cosmiconfig "^5.2.1" execa "^1.0.0" get-stdin "^7.0.0" @@ -6951,9 +6960,9 @@ husky@^3.0.0: slash "^3.0.0" i18next@^17.0.6: - version "17.0.6" - resolved "https://registry.yarnpkg.com/i18next/-/i18next-17.0.6.tgz#01079cc2bcef408139ea8ce24d18ac0d512fbe85" - integrity sha512-bdNhzhcM6RG5m82RypVguCrAQNie/ycxW0Q5C6K9UDWD5hqApZfdJFbj4Ikz9jxIR+Ja1eg0yCQLhlCT+opwIg== + version "17.0.7" + resolved "https://registry.yarnpkg.com/i18next/-/i18next-17.0.7.tgz#aae8591634b109c0ecec755b46c6414b0d743e07" + integrity sha512-fQn+gcyDaHb3qXIeahjCnGMsCeHaKveSORclang55stBjOL13oK7ZYxXVz1AaFV6p3SzOSu/KW+tgZcUuDdf6Q== dependencies: "@babel/runtime" "^7.3.1" @@ -7078,6 +7087,11 @@ indexes-of@^1.0.1: resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" integrity sha1-8w9xbI4r00bHtn0985FVZqfAVgc= +infer-owner@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" + integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A== + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -7144,10 +7158,10 @@ [email protected]: strip-ansi "^5.0.0" through "^2.3.6" -inquirer@^6.2.0, inquirer@^6.2.2: - version "6.4.1" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.4.1.tgz#7bd9e5ab0567cd23b41b0180b68e0cfa82fc3c0b" - integrity sha512-/Jw+qPZx4EDYsaT6uz7F4GJRNFMRdKNeUZw3ZnKV8lyuUgz/YWRCSUAJMZSVhSq4Ec0R2oYnyi6b3d4JXcL5Nw== +inquirer@^6.2.0, inquirer@^6.4.1: + version "6.5.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.0.tgz#2303317efc9a4ea7ec2e2df6f86569b734accf42" + integrity sha512-scfHejeG/lVZSpvCXpsB4j/wQNPM5JC8kiElOI0OUTwmc1RTpXr4H32/HOlQHcZiYl2z2VElwuCVDRG8vFmbnA== dependencies: ansi-escapes "^3.2.0" chalk "^2.4.2" @@ -7155,7 +7169,7 @@ inquirer@^6.2.0, inquirer@^6.2.2: cli-width "^2.0.0" external-editor "^3.0.3" figures "^2.0.0" - lodash "^4.17.11" + lodash "^4.17.12" mute-stream "0.0.7" run-async "^2.2.0" rxjs "^6.4.0" @@ -7203,11 +7217,16 @@ ip@^1.1.0, ip@^1.1.5: resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= [email protected], ipaddr.js@^1.9.0: [email protected]: version "1.9.0" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.0.tgz#37df74e430a0e47550fe54a2defe30d8acd95f65" integrity sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA== +ipaddr.js@^1.9.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== + is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" @@ -7252,12 +7271,12 @@ is-buffer@^1.0.2, is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-buffer@^2.0.0: +is-buffer@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725" integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw== -is-callable@^1.1.3, is-callable@^1.1.4: +is-callable@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== @@ -7412,9 +7431,9 @@ is-object@^1.0.1: integrity sha1-iVJojF7C/9awPsyF52ngKQMINHA= is-path-cwd@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-2.1.0.tgz#2e0c7e463ff5b7a0eb60852d851a6809347a124c" - integrity sha512-Sc5j3/YnM8tDeyCsVeKlm/0p95075DyLmDEIkSgQ7mXkrOX+uTCtmQFm0CYzVyJwcCCmO3k8qfJt17SxQwB5Zw== + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-2.2.0.tgz#67d43b82664a7b5191fd9119127eb300048a9fdb" + integrity sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ== is-path-in-cwd@^2.0.0: version "2.1.0" @@ -7435,20 +7454,20 @@ is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= [email protected], is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-plain-object@^3.0.0: [email protected], is-plain-object@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-3.0.0.tgz#47bfc5da1b5d50d64110806c199359482e75a928" integrity sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg== dependencies: isobject "^4.0.0" +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" @@ -8199,11 +8218,11 @@ lazy-cache@^1.0.3: integrity sha1-odePw6UEdMuAhF07O24dpJpEbo4= lazy-universal-dotenv@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lazy-universal-dotenv/-/lazy-universal-dotenv-3.0.0.tgz#e71f07f89d8de6bbf491478e4503df3c96729b8d" - integrity sha512-Mbf5AeGOs74lE5BdQXHFJ7Rt383jxnWKNfW2EWL0Pibnhea5JRStRIiUpdTenyMxCGuCjlMpYQhhay1XZBSSQA== + version "3.0.1" + resolved "https://registry.yarnpkg.com/lazy-universal-dotenv/-/lazy-universal-dotenv-3.0.1.tgz#a6c8938414bca426ab8c9463940da451a911db38" + integrity sha512-prXSYk799h3GY3iOWnC6ZigYzMPjxN2svgjJ9shk7oMadSNX3wXy0B6F32PMJv7qtMnrIbUxoEHzbutvxR2LBQ== dependencies: - "@babel/runtime" "^7.0.0" + "@babel/runtime" "^7.5.0" app-root-dir "^1.0.2" core-js "^3.0.4" dotenv "^8.0.0" @@ -8248,6 +8267,11 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +lines-and-columns@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" + integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= + load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" @@ -8327,20 +8351,15 @@ locate-path@^5.0.0: p-locate "^4.1.0" lodash-es@^4.17.11: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.11.tgz#145ab4a7ac5c5e52a3531fb4f310255a152b4be0" - integrity sha512-DHb1ub+rMjjrxqlB3H56/6MXtm1lSksDp2rA2cNWjG8mlDUYFhUj3Di2Zn5IwSU87xLv8tNIQ7sSwE/YOX/D/Q== + version "4.17.15" + resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.15.tgz#21bd96839354412f23d7a10340e5eac6ee455d78" + integrity sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ== -lodash._reinterpolate@~3.0.0: +lodash._reinterpolate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= -lodash.assign@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" - integrity sha1-DZnzzNem0mHRm9rrkkUAXShYCOc= - lodash.clonedeep@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" @@ -8407,30 +8426,25 @@ lodash.tail@^4.1.1: integrity sha1-0jM6NtnncXyK0vfKyv7HwytERmQ= lodash.template@^4.0.2: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0" - integrity sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A= + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" + integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A== dependencies: - lodash._reinterpolate "~3.0.0" + lodash._reinterpolate "^3.0.0" lodash.templatesettings "^4.0.0" lodash.templatesettings@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316" - integrity sha1-K01OlbpEDZFf8IvImeRVNmZxMxY= + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz#e481310f049d3cf6d47e912ad09313b154f0fb33" + integrity sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ== dependencies: - lodash._reinterpolate "~3.0.0" + lodash._reinterpolate "^3.0.0" lodash.throttle@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4" integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ= -lodash.toarray@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.toarray/-/lodash.toarray-4.4.0.tgz#24c4bfcd6b2fba38bfd0594db1179d8e9b656561" - integrity sha1-JMS/zWsvuji/0FlNsRedjptlZWE= - [email protected]: version "4.0.1" resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" @@ -8441,16 +8455,16 @@ lodash.union@^4.6.0: resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88" integrity sha1-SLtQiECfFvGCFmZkHETdGqrjzYg= [email protected], lodash@^4.0.0, lodash@^4.0.1, lodash@^4.16.3, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.2.1, lodash@~4.17.10: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== - -lodash@^4.17.14: [email protected]: version "4.17.14" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== +lodash@^4.0.0, lodash@^4.0.1, lodash@^4.16.3, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.2.1, lodash@~4.17.10: + version "4.17.15" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" + integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + loglevel@^1.6.3: version "1.6.3" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.3.tgz#77f2eb64be55a404c9fd04ad16d57c1d6d6b1280" @@ -8611,6 +8625,11 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" [email protected]: + version "2.0.4" + resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b" + integrity sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA== + mdn-data@~1.1.0: version "1.1.4" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-1.1.4.tgz#50b5d4ffc4575276573c4eedb8780812a8419f01" @@ -8631,9 +8650,9 @@ mem@^4.0.0: p-is-promise "^2.0.0" memoize-one@^5.0.0: - version "5.0.4" - resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.0.4.tgz#005928aced5c43d890a4dfab18ca908b0ec92cbc" - integrity sha512-P0z5IeAH6qHHGkJIXWw0xC2HNEgkx/9uWWBQw64FJj3/ol14VYdfVGWWr0fXfjhhv3TKVIqUq65os6O4GUNksA== + version "5.0.5" + resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.0.5.tgz#8cd3809555723a07684afafcd6f756072ac75d7e" + integrity sha512-ey6EpYv0tEaIbM/nTDOpHciXUvd+ackQrJgEzBwemhZZIWZjcyodqEcrmqDy2BKRTM3a65kKBV4WtLXJDt26SQ== memoizerific@^1.11.3: version "1.11.3" @@ -8718,9 +8737,9 @@ merge-stream@^1.0.1: readable-stream "^2.0.1" merge2@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" - integrity sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA== + version "1.2.4" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.4.tgz#c9269589e6885a60cf80605d9522d4b67ca646e3" + integrity sha512-FYE8xI+6pjFOhokZu0We3S5NKCirLbCzSh2Usf3qEyr4X8U+0jNg9P8RZ4qz+V2UoECLVwSyzU3LxXBaLGtD3A== merge@^1.2.1: version "1.2.1" @@ -9181,10 +9200,10 @@ node-pre-gyp@^0.12.0: semver "^5.3.0" tar "^4" -node-releases@^1.1.13, node-releases@^1.1.23: - version "1.1.25" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.25.tgz#0c2d7dbc7fed30fbe02a9ee3007b8c90bf0133d3" - integrity sha512-fI5BXuk83lKEoZDdH3gRhtsNgh05/wZacuXkgbiYkceE7+QIMXOg98n9ZV7mz27B+kFHnqHcUpscZZlGRSmTpQ== +node-releases@^1.1.13, node-releases@^1.1.25: + version "1.1.26" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.26.tgz#f30563edc5c7dc20cf524cc8652ffa7be0762937" + integrity sha512-fZPsuhhUHMTlfkhDLGtfY80DSJTjOcx+qD1j5pqPkuhUHVS7xHZIg9EE4DHK8O3f0zTxXHX5VIkDG8pu98/wfQ== dependencies: semver "^5.3.0" @@ -9243,7 +9262,7 @@ normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package- semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -normalize-path@^2.0.0, normalize-path@^2.1.1: +normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= @@ -9660,7 +9679,7 @@ parallel-transform@^1.1.0: inherits "^2.0.3" readable-stream "^2.1.5" [email protected]: [email protected], param-case@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.1.tgz#df94fd8cf6531ecf75e6bef9a0858fbc72be2247" integrity sha1-35T9jPZTHs915r75oIWPvHK+Ikc= @@ -9718,6 +9737,16 @@ parse-json@^4.0.0: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" +parse-json@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.0.0.tgz#73e5114c986d143efa3712d4ea24db9a4266f60f" + integrity sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + lines-and-columns "^1.1.6" + parse-passwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" @@ -9728,11 +9757,6 @@ [email protected]: resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== -parse5@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.0.tgz#c59341c9723f414c452975564c7c00a68d58acd2" - integrity sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ== - parseurl@~1.3.2, parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" @@ -9945,9 +9969,9 @@ popper.js@^1.14.4, popper.js@^1.14.7: integrity sha512-w010cY1oCUmI+9KwwlWki+r5jxKfTFDVoadl7MSrIujHU5MJ5OR6HTDj6Xo8aoR/QsA56x8jKjA59qGH4ELtrA== portfinder@^1.0.20: - version "1.0.20" - resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.20.tgz#bea68632e54b2e13ab7b0c4775e9b41bf270e44a" - integrity sha512-Yxe4mTyDzTd59PZJY4ojZR8F+E5e97iq2ZOHPz3HDgSvYC5siNad2tLooQ5y5QHyQhc3xVqvyk/eNA3wuoa7Sw== + version "1.0.21" + resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.21.tgz#60e1397b95ac170749db70034ece306b9a27e324" + integrity sha512-ESabpDCzmBS3ekHbmpAIiESq3udRsCBGiBZLsC+HgBKv2ezb0R4oG+7RnYEVZ/ZCfhel5Tx3UzdNWA0Lox2QCA== dependencies: async "^1.5.2" debug "^2.2.0" @@ -10043,11 +10067,6 @@ postcss@^7.0.0, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.5, postcss@^7.0.6 source-map "^0.6.1" supports-color "^6.1.0" -preact@*: - version "8.4.2" - resolved "https://registry.yarnpkg.com/preact/-/preact-8.4.2.tgz#1263b974a17d1ea80b66590e41ef786ced5d6a23" - integrity sha512-TsINETWiisfB6RTk0wh3/mvxbGRvx+ljeBccZ4Z6MPFKgu/KFGyf2Bmw3Z/jlXhL5JlNKY6QAbA9PVyzIy9//A== - prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" @@ -10098,10 +10117,10 @@ pretty-hrtime@^1.0.3: resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= -prismjs@^1.8.4, prismjs@~1.16.0: - version "1.16.0" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.16.0.tgz#406eb2c8aacb0f5f0f1167930cb83835d10a4308" - integrity sha512-OA4MKxjFZHSvZcisLGe14THYsug/nF6O1f0pAJc0KN0wTyAcLqmsbE+lTGKSpyh+9pEW57+k6pg2AfYR+coyHA== +prismjs@^1.8.4, prismjs@~1.17.0: + version "1.17.1" + resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.17.1.tgz#e669fcbd4cdd873c35102881c33b14d0d68519be" + integrity sha512-PrEDJAFdUGbOP6xK/UsfkC5ghJsPJviKgnQOoxaDbBjwc8op68Quupwt1DeAFoG8GImPhiKXAvvsH7wDSLsu1Q== optionalDependencies: clipboard "^2.0.0" @@ -10172,10 +10191,10 @@ [email protected], prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0, object-assign "^4.1.1" react-is "^16.8.1" -property-information@^5.0.0, property-information@^5.0.1: - version "5.1.0" - resolved "https://registry.yarnpkg.com/property-information/-/property-information-5.1.0.tgz#e4755eee5319f03f7f6f5a9bc1a6a7fea6609e2c" - integrity sha512-tODH6R3+SwTkAQckSp2S9xyYX8dEKYkeXw+4TmJzTxnNzd6mQPu1OD4f9zPrvw/Rm4wpPgI+Zp63mNSGNzUgHg== +property-information@^5.0.1: + version "5.2.2" + resolved "https://registry.yarnpkg.com/property-information/-/property-information-5.2.2.tgz#20555eafd2296278a682e5a51d5123e7878ecc30" + integrity sha512-N2moasZmjn2mjVGIWpaqz5qnz6QyeQSGgGvMtl81gA9cPTWa6wpesRSe/quNnOjUHpvSH1oZx0pdz0EEckLFnA== dependencies: xtend "^4.0.1" @@ -10307,9 +10326,9 @@ quick-lru@^1.0.0: integrity sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g= raf-schd@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/raf-schd/-/raf-schd-4.0.1.tgz#e72f29a96de260dead719f34c29e56fdc1c1473e" - integrity sha512-/QTXV4+Tf81CmJgTZac47N63ZzKmaVe+1cQX/grCFeLrs4Mcc6oq+KJfbF3tFjeS1NF91lmTvgmwYjk02UTo9A== + version "4.0.2" + resolved "https://registry.yarnpkg.com/raf-schd/-/raf-schd-4.0.2.tgz#bd44c708188f2e84c810bf55fcea9231bcaed8a0" + integrity sha512-VhlMZmGy6A6hrkJWHLNTGl5gtgMUm+xfGza6wbwnE914yeQ5Ybm18vgM734RZhMgfw4tacUrWseGZlpUrrakEQ== raf@^3.4.0: version "3.4.1" @@ -10361,6 +10380,14 @@ raw-loader@^2.0.0: loader-utils "^1.1.0" schema-utils "^1.0.0" +raw-loader@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-3.1.0.tgz#5e9d399a5a222cc0de18f42c3bc5e49677532b3f" + integrity sha512-lzUVMuJ06HF4rYveaz9Tv0WRlUMxJ0Y1hgSkkgg+50iEdaI0TthyEDe08KIHb0XsF6rn8WYTqPCaGTZg3sX+qA== + dependencies: + loader-utils "^1.1.0" + schema-utils "^2.0.1" + rc@^1.2.7: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" @@ -10389,9 +10416,9 @@ react-animate-height@^2.0.15: prop-types "^15.6.1" react-clientside-effect@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/react-clientside-effect/-/react-clientside-effect-1.2.1.tgz#feb81abe9531061d4987941c15a00f2b3d0b6071" - integrity sha512-foSwZatJak6r+F4OqJ8a+MOWcBi3jwa7/RPdJIDZI1Ck0dn/FJZkkFu7YK+SiZxsCZIrotolxHSobcnBHgIjfw== + version "1.2.2" + resolved "https://registry.yarnpkg.com/react-clientside-effect/-/react-clientside-effect-1.2.2.tgz#6212fb0e07b204e714581dd51992603d1accc837" + integrity sha512-nRmoyxeok5PBO6ytPvSjKp9xwXg9xagoTK1mMjwnQxqM9Hd7MNPl+LS1bOSOe+CV2+4fnEquc7H/S8QD3q697A== dependencies: "@babel/runtime" "^7.0.0" @@ -10475,12 +10502,12 @@ react-draggable@^3.1.1: prop-types "^15.6.0" react-element-to-jsx-string@^14.0.2: - version "14.0.2" - resolved "https://registry.yarnpkg.com/react-element-to-jsx-string/-/react-element-to-jsx-string-14.0.2.tgz#586d248bb2416855aa6ac3881e18726832c146d2" - integrity sha512-eYcPUg3FJisgAb8q3sSdce8F/xMZD/iFEjMZYnkE3b7gPi5OamGr2Hst/1pE72mzn7//dfYPXb+UqPK2xdSGsg== + version "14.0.3" + resolved "https://registry.yarnpkg.com/react-element-to-jsx-string/-/react-element-to-jsx-string-14.0.3.tgz#64f50fdbf6ba154d6439da3d7307f79069b94d58" + integrity sha512-ziZAm7OwEfFtyhCmQiFNI87KFu+G9EP8qVW4XtDHdKNqqprYifLzqXkzHqC1vnVsPhyp2znoPm0bJHAf1mUBZA== dependencies: - is-plain-object "2.0.4" - stringify-object "3.2.2" + is-plain-object "3.0.0" + stringify-object "3.3.0" react-error-overlay@^5.1.6: version "5.1.6" @@ -10514,18 +10541,17 @@ react-helmet-async@^1.0.2: shallowequal "1.1.0" react-hot-loader@^4: - version "4.12.3" - resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.12.3.tgz#0972255cd110a00860902e82bb2b789a262cfe01" - integrity sha512-XBhxogFOxEh8L4Ykdk2mp704Xc/eoy+bwadEYMvmBhjAz3wg+DfMpINMkA+kLTRDinqwjssDfA9DhUJznRjvuA== + version "4.12.10" + resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.12.10.tgz#b3457c0f733423c4827c6d2672e50c9f8bedaf6b" + integrity sha512-dX+ZUigxQijWLsKPnxc0khuCt2sYiZ1W59LgSBMOLeGSG3+HkknrTlnJu6BCNdhYxbEQkGvBsr7zXlNWYUIhAQ== dependencies: fast-levenshtein "^2.0.6" global "^4.3.0" hoist-non-react-statics "^3.3.0" loader-utils "^1.1.0" - lodash "^4.17.11" prop-types "^15.6.1" react-lifecycles-compat "^3.0.4" - shallowequal "^1.0.2" + shallowequal "^1.1.0" source-map "^0.7.3" [email protected]: @@ -10535,7 +10561,7 @@ [email protected]: dependencies: prop-types "^15.6.1" -react-i18next@*, react-i18next@^10.11.4: +react-i18next@^10.11.4: version "10.11.4" resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-10.11.4.tgz#9277a609ee640fac353087a91935ee9a9eb65f40" integrity sha512-/CWXaf3a5BLNeVnBGxzWOIZLQgSNEc2LWHX4ZaJb7ww0xgY0S5K9HRAMzJIHeHGe7jfpSraprD66VDblWb4ZXA== @@ -10614,11 +10640,11 @@ react-select@^2.2.0: react-transition-group "^2.2.1" react-shadow@^17.1.1: - version "17.1.1" - resolved "https://registry.yarnpkg.com/react-shadow/-/react-shadow-17.1.1.tgz#948ae0e810fd20f5b65ffe2327a78e30f29b0982" - integrity sha512-UjzfVxwtVozqXIhMgg6Wi5P3jhyRmF2raebyyVRq1pS1832zTiYi98m31pV0MJGRL0x9kA55Jr/eYU+SAKQXRQ== + version "17.1.2" + resolved "https://registry.yarnpkg.com/react-shadow/-/react-shadow-17.1.2.tgz#36e4dc3fdad7e97ecfbc328afd5e61c5d5e95610" + integrity sha512-MORJx0GNmEIYFWdqKfB0jDqtWuM9buyMX/cTAISEZGRjvGl0zfrAme2amC5nqoSwzpRRcbVxU4y2pBIvte6+5Q== dependencies: - humps "^2.0.0" + humps "^2.0.1" react-syntax-highlighter@^8.0.1: version "8.1.0" @@ -10659,7 +10685,7 @@ react-transition-group@^4.2.1: loose-envify "^1.4.0" prop-types "^15.6.2" -react@*, react@^16, react@^16.8.3: +react@^16, react@^16.8.3: version "16.8.6" resolved "https://registry.yarnpkg.com/react/-/react-16.8.6.tgz#ad6c3a9614fd3a4e9ef51117f54d888da01f2bbe" integrity sha512-pC0uMkhLaHm11ZSJULfOBqV4tIZkx87ZLvbbQYunNixAAvjnC+snJCg0XQXn9VIsttVsbZP/H/ewzgsd5fxKXw== @@ -10736,16 +10762,16 @@ read-pkg@^3.0.0: path-type "^3.0.0" read-pkg@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.1.1.tgz#5cf234dde7a405c90c88a519ab73c467e9cb83f5" - integrity sha512-dFcTLQi6BZ+aFUaICg7er+/usEoqFdQxiEBsEMNGoipenihtxxtdrQuBXvyANCEI8VuUIVYFgeHGx9sLLvim4w== + version "5.2.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" + integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== dependencies: "@types/normalize-package-data" "^2.4.0" normalize-package-data "^2.5.0" - parse-json "^4.0.0" - type-fest "^0.4.1" + parse-json "^5.0.0" + type-fest "^0.6.0" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== @@ -10758,7 +10784,7 @@ read-pkg@^5.1.1: string_decoder "~1.1.1" util-deprecate "~1.0.1" -"readable-stream@2 || 3", readable-stream@^3.0.2, readable-stream@^3.0.6, readable-stream@^3.1.1: +"readable-stream@2 || 3", readable-stream@^3.0.1, readable-stream@^3.0.2, readable-stream@^3.0.6, readable-stream@^3.1.1, readable-stream@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ== @@ -10856,13 +10882,13 @@ redent@^2.0.0: strip-indent "^2.0.0" refractor@^2.4.1: - version "2.9.0" - resolved "https://registry.yarnpkg.com/refractor/-/refractor-2.9.0.tgz#0a381aadb51513e4e6ec1ed410b5104dd65e2489" - integrity sha512-lCnCYvXpqd8hC7ksuvo516rz5q4NwzBbq0X5qjH5pxRfcQKiQxKZ8JctrSQmrR/7pcV2TRrs9TT+Whmq/wtluQ== + version "2.10.0" + resolved "https://registry.yarnpkg.com/refractor/-/refractor-2.10.0.tgz#4cc7efc0028a87924a9b31d82d129dec831a287b" + integrity sha512-maW2ClIkm9IYruuFYGTqKzj+m31heq92wlheW4h7bOstP+gf8bocmMec+j7ljLcaB1CAID85LMB3moye31jH1g== dependencies: hastscript "^5.0.0" parse-entities "^1.1.2" - prismjs "~1.16.0" + prismjs "~1.17.0" regenerate-unicode-properties@^8.0.2: version "8.1.0" @@ -10892,14 +10918,14 @@ regenerator-runtime@^0.12.0, regenerator-runtime@^0.12.1: integrity sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg== regenerator-runtime@^0.13.2: - version "0.13.2" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz#32e59c9a6fb9b1a4aff09b4930ca2d4477343447" - integrity sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA== + version "0.13.3" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz#7cf6a77d8f5c6f60eb73c5fc1955b2ceb01e6bf5" + integrity sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw== regenerator-transform@^0.14.0: - version "0.14.0" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.0.tgz#2ca9aaf7a2c239dd32e4761218425b8c7a86ecaf" - integrity sha512-rtOelq4Cawlbmq9xuMR5gdFmv7ku/sFoB7sRiywx7aq53bc52b4j6zvH7Te1Vt/X2YveDKnCGUbioieU7FEL3w== + version "0.14.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.1.tgz#3b2fce4e1ab7732c08f665dfdb314749c7ddd2fb" + integrity sha512-flVuee02C3FKRISbxhXl9mGzdbWUVHubl1SMaknjxkFB1/iqpJhArQUvRxOOPEc/9tAiX0BaQ28FJH10E4isSQ== dependencies: private "^0.1.6" @@ -10912,9 +10938,9 @@ regex-not@^1.0.0, regex-not@^1.0.2: safe-regex "^1.1.0" regexp-tree@^0.1.6: - version "0.1.10" - resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.10.tgz#d837816a039c7af8a8d64d7a7c3cf6a1d93450bc" - integrity sha512-K1qVSbcedffwuIslMwpe6vGlj+ZXRnGkvjAtFHfDZZZuEdA/h0dxljAPu9vhUo6Rrx2U2AwJ+nSQ6hK+lrP5MQ== + version "0.1.11" + resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.11.tgz#c9c7f00fcf722e0a56c7390983a7a63dd6c272f3" + integrity sha512-7/l/DgapVVDzZobwMCCgMlqiqyLFJ0cduo/j+3BcDJIB+yJdsYCfKuI3l/04NV+H/rfNRdPIDbXNZHM9XvQatg== regexp.prototype.flags@^1.2.0: version "1.2.0" @@ -10952,16 +10978,7 @@ regjsparser@^0.6.0: dependencies: jsesc "~0.5.0" -rehype-parse@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/rehype-parse/-/rehype-parse-6.0.1.tgz#a5401d7f4144d5e17cbb69be11f05a2a7ba87e27" - integrity sha512-FrGSbOzcGxIvWty1qHjKTvHT4WBTt7C6JLs65EkvFPa7ZKraSmsoDDj6al1eBxaXS1t/kiGdPYazUe58Mgflgw== - dependencies: - hast-util-from-parse5 "^5.0.0" - parse5 "^5.0.0" - xtend "^4.0.1" - [email protected]: [email protected], relateurl@^0.2.7: version "0.2.7" resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk= @@ -10999,11 +11016,6 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" [email protected]: - version "1.0.0" - resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" - integrity sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs= - [email protected]: version "1.1.2" resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.2.tgz#339f6aababcafdb31c799ff158700336301d3346" @@ -11209,11 +11221,16 @@ [email protected]: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" integrity sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg== [email protected], safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: [email protected], safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== +safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2: + version "5.2.0" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" + integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== + safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" @@ -11290,6 +11307,14 @@ schema-utils@^1.0.0: ajv-errors "^1.0.0" ajv-keywords "^3.1.0" +schema-utils@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.0.1.tgz#1eec2e059556af841b7f3a83b61af13d7a3f9196" + integrity sha512-HJFKJ4JixDpRur06QHwi8uu2kZbng318ahWEKgBjc0ZklcE4FDvmm2wghb448q0IRaABxIESt8vqPFvwgMB80A== + dependencies: + ajv "^6.1.0" + ajv-keywords "^3.1.0" + scss-tokenizer@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz#8eb06db9a9723333824d3f5530641149847ce5d1" @@ -11335,10 +11360,15 @@ [email protected]: resolved "https://registry.yarnpkg.com/semver/-/semver-6.0.0.tgz#05e359ee571e5ad7ed641a6eec1e547ba52dea65" integrity sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ== -semver@^6.0.0, semver@^6.1.0, semver@^6.1.1: - version "6.2.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.2.0.tgz#4d813d9590aaf8a9192693d6c85b9344de5901db" - integrity sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A== [email protected]: + version "6.1.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.1.1.tgz#53f53da9b30b2103cd4f15eab3a18ecbcb210c9b" + integrity sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ== + +semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== semver@~5.3.0: version "5.3.0" @@ -11465,7 +11495,7 @@ shallow-equal@^1.1.0: resolved "https://registry.yarnpkg.com/shallow-equal/-/shallow-equal-1.2.0.tgz#fd828d2029ff4e19569db7e19e535e94e2d1f5cc" integrity sha512-Z21pVxR4cXsfwpMKMhCEIO1PCi5sp7KEp+CmOpBQ+E8GpHwKOw2sEzk7sgblM3d/j4z4gakoWEoPcjK0VJQogA== [email protected], shallowequal@^1.0.2: [email protected], shallowequal@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8" integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ== @@ -11693,10 +11723,10 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.5.6, source-map-support@~0.5.10: - version "0.5.12" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" - integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ== +source-map-support@^0.5.6, source-map-support@~0.5.12: + version "0.5.13" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" + integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -11755,9 +11785,9 @@ spdx-expression-parse@^3.0.0: spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz#75ecd1a88de8c184ef015eafb51b5b48bfd11bb1" - integrity sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA== + version "3.0.5" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654" + integrity sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q== spdy-transport@^3.0.0: version "3.0.0" @@ -11772,9 +11802,9 @@ spdy-transport@^3.0.0: wbuf "^1.7.3" spdy@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/spdy/-/spdy-4.0.0.tgz#81f222b5a743a329aa12cea6a390e60e9b613c52" - integrity sha512-ot0oEGT/PGUpzf/6uk4AWLqkq+irlqHXkrdbk51oWONh3bxQmBuljxPNl66zlRRcIJStWq0QkLUCPOPjgjvU0Q== + version "4.0.1" + resolved "https://registry.yarnpkg.com/spdy/-/spdy-4.0.1.tgz#6f12ed1c5db7ea4f24ebb8b89ba58c87c08257f2" + integrity sha512-HeZS3PBdMA+sZSu0qwpCxl3DeALD5ASx8pAX0jZdKXSpPWbQ6SYGnlg3BBmYLx5LtiZrmkAZfErCm2oECBcioA== dependencies: debug "^4.1.0" handle-thing "^2.0.0" @@ -11886,9 +11916,9 @@ stealthy-require@^1.1.1: integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= store2@^2.7.1: - version "2.7.1" - resolved "https://registry.yarnpkg.com/store2/-/store2-2.7.1.tgz#22070b7dc04748a792fc6912a58ab99d3a21d788" - integrity sha512-zzzP5ZY6QWumnAFV6kBRbS44pUMcpZBNER5DWUe1HETlaKXqLcCQxbNu6IHaKr1pUsjuhUGBdOy8sWKmMkL6pQ== + version "2.8.0" + resolved "https://registry.yarnpkg.com/store2/-/store2-2.8.0.tgz#032d5dcbd185a5d74049d67a1765ff1e75faa04b" + integrity sha512-FBJpcOEZQLZBIGL4Yp7W5RgZ0ejaURmcfUjIpyOb64BpI8z/iJXw7zd/NTBeq304dVMxuWVDZEUUCGn7llaVrA== stream-browserify@^2.0.1: version "2.0.2" @@ -12004,12 +12034,12 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" [email protected]: - version "3.2.2" - resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.2.2.tgz#9853052e5a88fb605a44cd27445aa257ad7ffbcd" - integrity sha512-O696NF21oLiDy8PhpWu8AEqoZHw++QW6mUv0UvKZe8gWSdSvMXkiLufK7OmnP27Dro4GU5kb9U7JIO0mBuCRQg== [email protected]: + version "3.3.0" + resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" + integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== dependencies: - get-own-enumerable-property-symbols "^2.0.1" + get-own-enumerable-property-symbols "^3.0.0" is-obj "^1.0.1" is-regexp "^1.0.0" @@ -12068,11 +12098,16 @@ strip-indent@^2.0.0: resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= [email protected], strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: [email protected], strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= +strip-json-comments@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7" + integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw== + style-loader@^0.23.1: version "0.23.1" resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.23.1.tgz#cb9154606f3e771ab6c4ab637026a1049174d925" @@ -12110,17 +12145,21 @@ supports-color@^5.1.0, supports-color@^5.2.0, supports-color@^5.3.0, supports-co dependencies: has-flag "^3.0.0" +svg-parser@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/svg-parser/-/svg-parser-2.0.2.tgz#d134cc396fa2681dc64f518330784e98bd801ec8" + integrity sha512-1gtApepKFweigFZj3sGO8KT8LvVZK8io146EzXrpVuWCDAbISz/yMucco3hWTkpZNoPabM+dnMOpy6Swue68Zg== + svgo@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/svgo/-/svgo-1.2.2.tgz#0253d34eccf2aed4ad4f283e11ee75198f9d7316" - integrity sha512-rAfulcwp2D9jjdGu+0CuqlrAUin6bBWrpoqXWwKDZZZJfXcUXQSxLJOFJCQCSA0x0pP2U0TxSlJu2ROq5Bq6qA== + version "1.3.0" + resolved "https://registry.yarnpkg.com/svgo/-/svgo-1.3.0.tgz#bae51ba95ded9a33a36b7c46ce9c359ae9154313" + integrity sha512-MLfUA6O+qauLDbym+mMZgtXCGRfIxyQoeH6IKVcFslyODEe/ElJNwr0FohQ3xG4C6HK6bk3KYPPXwHVJk3V5NQ== dependencies: chalk "^2.4.1" coa "^2.0.2" css-select "^2.0.0" css-select-base-adapter "^0.1.1" - css-tree "1.0.0-alpha.28" - css-url-regex "^1.1.0" + css-tree "1.0.0-alpha.33" csso "^3.5.1" js-yaml "^3.13.1" mkdirp "~0.5.1" @@ -12148,32 +12187,30 @@ symbol.prototype.description@^1.0.0: has-symbols "^1.0.0" table@^5.2.3: - version "5.4.1" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.1.tgz#0691ae2ebe8259858efb63e550b6d5f9300171e8" - integrity sha512-E6CK1/pZe2N75rGZQotFOdmzWQ1AILtgYbMAbAjvms0S1l5IDB47zG3nCnFGB/w+7nB3vKofbLXCH7HPBo864w== + version "5.4.4" + resolved "https://registry.yarnpkg.com/table/-/table-5.4.4.tgz#6e0f88fdae3692793d1077fd172a4667afe986a6" + integrity sha512-IIfEAUx5QlODLblLrGTTLJA7Tk0iLSGBvgY8essPRVNGHAzThujww1YqHLs6h3HfTg55h++RzLHH5Xw/rfv+mg== dependencies: - ajv "^6.9.1" - lodash "^4.17.11" + ajv "^6.10.2" + lodash "^4.17.14" slice-ansi "^2.1.0" string-width "^3.0.0" -tapable@^1.0.0, tapable@^1.1.0: +tapable@^1.0.0, tapable@^1.1.0, tapable@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== -tar-stream@^1.5.0: - version "1.6.2" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555" - integrity sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A== +tar-stream@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.1.0.tgz#d1aaa3661f05b38b5acc9b7020efdca5179a2cc3" + integrity sha512-+DAn4Nb4+gz6WZigRzKEZl1QuJVOLtAwwF+WUxy1fJ6X63CaGaUAxJRD2KEn1OMfcbCjySTYpNC6WmfQoIEOdw== dependencies: - bl "^1.0.0" - buffer-alloc "^1.2.0" - end-of-stream "^1.0.0" + bl "^3.0.0" + end-of-stream "^1.4.1" fs-constants "^1.0.0" - readable-stream "^2.3.0" - to-buffer "^1.1.1" - xtend "^4.0.0" + inherits "^2.0.3" + readable-stream "^3.1.1" tar@^2.0.0: version "2.2.2" @@ -12198,16 +12235,16 @@ tar@^4: yallist "^3.0.3" telejson@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/telejson/-/telejson-2.2.1.tgz#d9ee7e7eba0c81d9378257342fde7142a03787e2" - integrity sha512-JtFAnITek+Z9t+uQjVl4Fxur9Z3Bi3flytBLc3KZVXmMUHLXdtAxiP0g8IBkHvKn1kQIYZC57IG0jjGH1s64HQ== + version "2.2.2" + resolved "https://registry.yarnpkg.com/telejson/-/telejson-2.2.2.tgz#d61d721d21849a6e4070d547aab302a9bd22c720" + integrity sha512-YyNwnKY0ilabOwYgC/J754En1xOe5PBIUIw+C9e0+5HjVVcnQE5/gdu2yET2pmSbp5bxIDqYNjvndj2PUkIiYA== dependencies: global "^4.3.2" is-function "^1.0.1" is-regex "^1.0.4" is-symbol "^1.0.2" isobject "^3.0.1" - lodash.get "^4.4.2" + lodash "^4.17.11" memoizerific "^1.11.3" term-size@^1.2.0: @@ -12218,29 +12255,28 @@ term-size@^1.2.0: execa "^0.7.0" terser-webpack-plugin@^1.1.0, terser-webpack-plugin@^1.2.4: - version "1.3.0" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.3.0.tgz#69aa22426299f4b5b3775cbed8cb2c5d419aa1d4" - integrity sha512-W2YWmxPjjkUcOWa4pBEv4OP4er1aeQJlSo2UhtCFQCuRXEHjOFscO8VyWHj9JLlA0RzQb8Y2/Ta78XZvT54uGg== + 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 "^11.3.2" - find-cache-dir "^2.0.0" + cacache "^12.0.2" + find-cache-dir "^2.1.0" is-wsl "^1.1.0" - loader-utils "^1.2.3" schema-utils "^1.0.0" serialize-javascript "^1.7.0" source-map "^0.6.1" - terser "^4.0.0" - webpack-sources "^1.3.0" + terser "^4.1.2" + webpack-sources "^1.4.0" worker-farm "^1.7.0" -terser@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/terser/-/terser-4.0.2.tgz#580cea06c4932f46a48ed13804c93bc93c275968" - integrity sha512-IWLuJqTvx97KP3uTYkFVn93cXO+EtlzJu8TdJylq+H0VBDlPMIfQA9MBS5Vc5t3xTEUG1q0hIfHMpAP2R+gWTw== +terser@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.1.2.tgz#b2656c8a506f7ce805a3f300a2ff48db022fa391" + integrity sha512-jvNoEQSPXJdssFwqPSgWjsOrb+ELoE+ILpHPKXC83tIxOlh2U75F1KuB2luLD/3a6/7K3Vw5pDn+hvu0C4AzSw== dependencies: - commander "^2.19.0" + commander "^2.20.0" source-map "~0.6.1" - source-map-support "~0.5.10" + source-map-support "~0.5.12" test-exclude@^5.2.3: version "5.2.3" @@ -12331,11 +12367,6 @@ to-arraybuffer@^1.0.0: resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= -to-buffer@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" - integrity sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg== - to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" @@ -12440,11 +12471,6 @@ trim-right@^1.0.1: resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= -trough@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.4.tgz#3b52b1f13924f460c3fbfd0df69b587dbcbc762e" - integrity sha512-tdzBRDGWcI1OpPVmChbdSKhvSVurznZ8X36AYURAcl+0o2ldlCY2XPzyXNNxwJwwyIU+rIglTCG4kxtNKBQH7Q== - "true-case-path@^1.0.2": version "1.0.3" resolved "https://registry.yarnpkg.com/true-case-path/-/true-case-path-1.0.3.tgz#f813b5a8c86b40da59606722b144e3225799f47d" @@ -12463,9 +12489,9 @@ tslib@^1.8.1, tslib@^1.9.0: integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== tsutils@^3.7.0: - version "3.14.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.14.0.tgz#bf8d5a7bae5369331fa0f2b0a5a10bd7f7396c77" - integrity sha512-SmzGbB0l+8I0QwsPgjooFRaRvHLBLNYM8SeQ0k6rtNDru5sCGeLJcZdwilNndN+GysuFjF5EIYgN8GfFG6UeUw== + version "3.14.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.14.1.tgz#f1d2b93d2a0876481f2f1f98c25ba42bbd7ee860" + integrity sha512-kiuZzD1uUA5DxGj/uxbde+ymp6VVdAxdzOIlAFbYKrPyla8/uiJ9JLBm1QsPhOm4Muj0/+cWEDP99yoCUcSl6Q== dependencies: tslib "^1.8.1" @@ -12503,10 +12529,10 @@ type-fest@^0.3.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.3.1.tgz#63d00d204e059474fe5e1b7c011112bbd1dc29e1" integrity sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ== -type-fest@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.4.1.tgz#8bdf77743385d8a4f13ba95f610f5ccd68c728f8" - integrity sha512-IwzA/LSfD2vC1/YDYMv/zHP4rDF1usCwllsDpbolT3D4fUepIO7f9K70jjmUewU/LmGUKJcwcVtDCpnKk4BPMw== +type-fest@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" + integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== type-is@~1.6.17, type-is@~1.6.18: version "1.6.18" @@ -12527,9 +12553,9 @@ typedarray@^0.0.6: integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= typescript@^3.5.2: - version "3.5.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.2.tgz#a09e1dc69bc9551cadf17dba10ee42cf55e5d56c" - integrity sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA== + version "3.5.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977" + integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g== ua-parser-js@^0.7.18: version "0.7.20" @@ -12544,7 +12570,7 @@ [email protected]: commander "~2.19.0" source-map "~0.6.1" -uglify-js@^3.1.4: +uglify-js@^3.1.4, uglify-js@^3.5.1: version "3.6.0" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.6.0.tgz#704681345c53a8b2079fb6cec294b05ead242ff5" integrity sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg== @@ -12575,20 +12601,6 @@ unicode-property-aliases-ecmascript@^1.0.4: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz#a9cc6cc7ce63a0a3023fc99e341b94431d405a57" integrity sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw== -unified@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/unified/-/unified-7.1.0.tgz#5032f1c1ee3364bd09da12e27fdd4a7553c7be13" - integrity sha512-lbk82UOIGuCEsZhPj8rNAkXSDXd6p0QLzIuSsCdxrqnqU56St4eyOB+AlXsVgVeRmetPTYydIuvFfpDIed8mqw== - dependencies: - "@types/unist" "^2.0.0" - "@types/vfile" "^3.0.0" - bail "^1.0.0" - extend "^3.0.0" - is-plain-obj "^1.1.0" - trough "^1.0.0" - vfile "^3.0.0" - x-is-string "^0.1.0" - union-value@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" @@ -12618,18 +12630,6 @@ unique-slug@^2.0.0: dependencies: imurmurhash "^0.1.4" -unist-util-stringify-position@^1.0.0, unist-util-stringify-position@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz#3f37fcf351279dcbca7480ab5889bb8a832ee1c6" - integrity sha512-pNCVrk64LZv1kElr0N1wPiHEUoXNVFERp+mlTg/s9R5Lwg87f9bM/3sQB99w+N9D/qnM9ar3+AKDBwo/gm/iQQ== - -unist-util-stringify-position@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-2.0.1.tgz#de2a2bc8d3febfa606652673a91455b6a36fb9f3" - integrity sha512-Zqlf6+FRI39Bah8Q6ZnNGrEHUhwJOkHde2MHVk96lLyftfJJckaPslKgzhVcviXj8KcE9UJM9F+a4JEiBUTYgA== - dependencies: - "@types/unist" "^2.0.2" - universalify@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" @@ -12752,7 +12752,7 @@ uuid@^3.0.1, uuid@^3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== [email protected]: [email protected], v8-compile-cache@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz#00f7494d2ae2b688cfe2899df6ed2c54bef91dbe" integrity sha512-CNmdbwQMBjwr9Gsmohvm0pbL954tJrNzf6gWL3K+QMQf00PF7ERGrEiLgjuU3mKreLC2MeGhUsNV9ybTbLgd3w== @@ -12779,42 +12779,6 @@ [email protected]: core-util-is "1.0.2" extsprintf "^1.2.0" -vfile-message@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-1.1.1.tgz#5833ae078a1dfa2d96e9647886cd32993ab313e1" - integrity sha512-1WmsopSGhWt5laNir+633LszXvZ+Z/lxveBf6yhGsqnQIhlhzooZae7zV6YVM1Sdkw68dtAW3ow0pOdPANugvA== - dependencies: - unist-util-stringify-position "^1.1.1" - -vfile-message@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-2.0.1.tgz#951881861c22fc1eb39f873c0b93e336a64e8f6d" - integrity sha512-KtasSV+uVU7RWhUn4Lw+wW1Zl/nW8JWx7JCPps10Y9JRRIDeDXf8wfBLoOSsJLyo27DqMyAi54C6Jf/d6Kr2Bw== - dependencies: - "@types/unist" "^2.0.2" - unist-util-stringify-position "^2.0.0" - -vfile@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/vfile/-/vfile-3.0.1.tgz#47331d2abe3282424f4a4bb6acd20a44c4121803" - integrity sha512-y7Y3gH9BsUSdD4KzHsuMaCzRjglXN0W2EcMf0gpvu6+SbsGhMje7xDc8AEoeXy6mIwCKMI6BkjMsRjzQbhMEjQ== - dependencies: - is-buffer "^2.0.0" - replace-ext "1.0.0" - unist-util-stringify-position "^1.0.0" - vfile-message "^1.0.0" - -vfile@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/vfile/-/vfile-4.0.1.tgz#fc3d43a1c71916034216bf65926d5ee3c64ed60c" - integrity sha512-lRHFCuC4SQBFr7Uq91oJDJxlnftoTLQ7eKIpMdubhYcVMho4781a8MWXLy3qZrZ0/STD1kRiKc0cQOHm4OkPeA== - dependencies: - "@types/unist" "^2.0.0" - is-buffer "^2.0.0" - replace-ext "1.0.0" - unist-util-stringify-position "^2.0.0" - vfile-message "^2.0.0" - vm-browserify@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.0.tgz#bd76d6a23323e2ca8ffa12028dc04559c75f9019" @@ -12825,11 +12789,6 @@ void-elements@^2.0.1: resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= -vue@*: - version "2.6.10" - resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.10.tgz#a72b1a42a4d82a721ea438d1b6bf55e66195c637" - integrity sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ== - w3c-hr-time@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" @@ -12879,11 +12838,6 @@ web-ext-types@^3.2.1: resolved "https://registry.yarnpkg.com/web-ext-types/-/web-ext-types-3.2.1.tgz#3edc0e3c2e8fe121d7d7e4ca0b7ee0c883cea832" integrity sha512-oQZYDU3W8X867h8Jmt3129kRVKklz70db40Y6OzoTTuzOJpF/dB2KULJUf0txVPyUUXuyzV8GmT3nVvRHoG+Ew== -web-namespaces@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.3.tgz#9bbf5c99ff0908d2da031f1d732492a96571a83f" - integrity sha512-r8sAtNmgR0WKOKOxzuSgk09JsHlpKlB+uHi937qypOu3PZ17UxPrierFKDye/uNHjNTTEshu5PId8rojIPj/tA== - webextension-polyfill@latest: version "0.4.0" resolved "https://registry.yarnpkg.com/webextension-polyfill/-/webextension-polyfill-0.4.0.tgz#9cc5a60f0f2bf907a6b349fdd7e61701f54956f9" @@ -12911,9 +12865,9 @@ webpack-chain@^6.0.0: javascript-stringify "^2.0.0" webpack-cli@^3: - version "3.3.5" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-3.3.5.tgz#f4d1238a66a2843d9cebf189835ea22142e72767" - integrity sha512-w0j/s42c5UhchwTmV/45MLQnTVwRoaUTu9fM5LuyOd/8lFoCNCELDogFoecx5NzRUndO0yD/gF2b02XKMnmAWQ== + version "3.3.6" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-3.3.6.tgz#2c8c399a2642133f8d736a359007a052e060032c" + integrity sha512-0vEa83M7kJtxK/jUhlpZ27WHIOndz5mghWL2O53kiDoA9DIxSKnfqB92LoqEn77cT4f3H2cZm1BMEat/6AZz3A== dependencies: chalk "2.4.2" cross-spawn "6.0.5" @@ -12992,25 +12946,24 @@ webpack-log@^2.0.0: ansi-colors "^3.0.0" uuid "^3.3.2" -webpack-sources@^1.1.0, webpack-sources@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.3.0.tgz#2a28dcb9f1f45fe960d8f1493252b5ee6530fa85" - integrity sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA== +webpack-sources@^1.1.0, webpack-sources@^1.3.0, webpack-sources@^1.4.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.1.tgz#b91b2c5b1c4e890ff50d1d35b7fa3657040da1da" + integrity sha512-XSz38193PTo/1csJabKaV4b53uRVotlMgqJXm3s3eje0Bu6gQTxYDqpD38CmQfDBA+gN+QqaGjasuC8I/7eW3Q== dependencies: source-list-map "^2.0.0" source-map "~0.6.1" -webpack@^4, webpack@^4.33.0: - version "4.35.2" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.35.2.tgz#5c8b8a66602cbbd6ec65c6e6747914a61c1449b1" - integrity sha512-TZAmorNymV4q66gAM/h90cEjG+N3627Q2MnkSgKlX/z3DlNVKUtqy57lz1WmZU2+FUZwzM+qm7cGaO95PyrX5A== +webpack@^4, webpack@^4.33.0, webpack@^4.38.0: + version "4.38.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.38.0.tgz#6d77108404b08883c78f4e7e45a43c4e5c47c931" + integrity sha512-lbuFsVOq8PZY+1Ytz/mYOvYOo+d4IJ31hHk/7iyoeWtwN33V+5HYotSH+UIb9tq914ey0Hot7z6HugD+je3sWw== 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.0.5" - acorn-dynamic-import "^4.0.0" + acorn "^6.2.0" ajv "^6.1.0" ajv-keywords "^3.1.0" chrome-trace-event "^1.0.0" @@ -13184,20 +13137,15 @@ ws@^5.2.0: dependencies: async-limiter "~1.0.0" -x-is-string@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82" - integrity sha1-R0tQhlrzpJqcRlfwWs0UVFj3fYI= - xml-name-validator@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68= + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== y18n@^3.2.1: version "3.2.1" @@ -13320,11 +13268,11 @@ yargs@^7.0.0: y18n "^3.2.1" yargs-parser "^5.0.0" -zip-stream@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/zip-stream/-/zip-stream-2.0.1.tgz#48a062488afe91dda42f823700fae589753ccd34" - integrity sha512-c+eUhhkDpaK87G/py74wvWLtz2kzMPNCCkUApkun50ssE0oQliIQzWpTnwjB+MTKVIf2tGzIgHyqW/Y+W77ecQ== +zip-stream@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/zip-stream/-/zip-stream-2.1.0.tgz#4f94246b64341536b86318bd556654278812b726" + integrity sha512-F/xoLqlQShgvn1BzHQCNiYIoo2R93GQIMH+tA6JC3ckMDkme4bnhEEXSferZcG5ea/6bZNx3GqSUHqT8TUO6uQ== dependencies: - archiver-utils "^2.0.0" - compress-commons "^1.2.0" - readable-stream "^2.0.0" + archiver-utils "^2.1.0" + compress-commons "^2.0.0" + readable-stream "^3.4.0"
chore
update packages
9c02a1f0f2f3efec2b88be39f569ce9842c821d4
2019-05-11 17:02:48
CRIMX
test: update browser api
false
diff --git a/test/specs/_helpers/browser-api.spec.ts b/test/specs/_helpers/browser-api.spec.ts index d2e8e5b35..0457dc91e 100644 --- a/test/specs/_helpers/browser-api.spec.ts +++ b/test/specs/_helpers/browser-api.spec.ts @@ -471,7 +471,7 @@ describe('Browser API Wapper', () => { expect(browser.runtime.onMessage.addListener.calledOnce).toBeTruthy() browser.runtime.onMessage.dispatch({ type: '[[1]]', __pageId__: 1 }, {}) - expect(browser.runtime.sendMessage.calledWith({ type: 1, __pageId__: 1 })).toBeTruthy() + expect(browser.runtime.sendMessage.calledWith({ type: 1, __pageId__: 1 })).toBeFalsy() browser.runtime.onMessage.dispatch({ type: '[[1]]', __pageId__: 1 }, { tab }) expect(browser.tabs.sendMessage.calledWith(tab.id, { type: 1, __pageId__: 1 })).toBeTruthy()
test
update browser api
d164efb35d3cb0cb4c80cd6e52729e453b5b946a
2019-01-22 00:30:30
CRIMX
fix: fix config typing
false
diff --git a/src/app-config/dicts.ts b/src/app-config/dicts.ts index c1a0fa96e..3309713e0 100644 --- a/src/app-config/dicts.ts +++ b/src/app-config/dicts.ts @@ -62,7 +62,7 @@ export function getALlDicts () { related: true, sentence: 4 } - } as DictItem, + }, cambridge: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -93,7 +93,7 @@ export function getALlDicts () { chs: false, minor: false, }, - } as DictItem, + }, cobuild: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -131,7 +131,7 @@ export function getALlDicts () { options: { sentence: 4 } - } as DictItem, + }, etymonline: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -170,7 +170,7 @@ export function getALlDicts () { resultnum: 4, chart: true, } - } as DictItem, + }, eudic: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -208,7 +208,7 @@ export function getALlDicts () { options: { resultnum: 10 } - } as DictItem, + }, google: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -252,7 +252,7 @@ export function getALlDicts () { options_sel: { tl: ['default', 'zh-CN', 'zh-TW', 'en'], }, - } as DictItem, + }, googledict: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -290,7 +290,7 @@ export function getALlDicts () { options: { enresult: true } - } as DictItem, + }, guoyu: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -321,7 +321,7 @@ export function getALlDicts () { chs: true, minor: false, } - } as DictItem, + }, hjdict: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -371,7 +371,7 @@ export function getALlDicts () { aas: ['fr', 'de'], eas: ['fr', 'es'], }, - } as DictItem, + }, liangan: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -402,7 +402,7 @@ export function getALlDicts () { chs: true, minor: false, } - } as DictItem, + }, longman: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -446,7 +446,7 @@ export function getALlDicts () { bussinessFirst: true, related: true, } - } as DictItem, + }, macmillan: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -484,7 +484,7 @@ export function getALlDicts () { options: { related: true, } - } as DictItem, + }, oald: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -522,7 +522,7 @@ export function getALlDicts () { options: { related: true, }, - } as DictItem, + }, sogou: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -565,7 +565,7 @@ export function getALlDicts () { options_sel: { tl: ['default', 'zh-CHS', 'zh-CHT', 'en'], }, - } as DictItem, + }, urban: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -603,7 +603,7 @@ export function getALlDicts () { options: { resultnum: 4 } - } as DictItem, + }, vocabulary: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -634,7 +634,7 @@ export function getALlDicts () { chs: false, minor: false, } - } as DictItem, + }, weblio: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -665,7 +665,7 @@ export function getALlDicts () { chs: true, minor: true, }, - } as DictItem, + }, websterlearner: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -707,7 +707,7 @@ export function getALlDicts () { arts: true, related: true, }, - } as DictItem, + }, wikipedia: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -748,7 +748,7 @@ export function getALlDicts () { options_sel: { lang: ['auto', 'zh', 'zh-cn', 'zh-tw', 'zh-hk', 'en', 'ja', 'fr', 'de'], }, - } as DictItem, + }, youdao: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -791,7 +791,7 @@ export function getALlDicts () { translation: true, related: true, } - } as DictItem, + }, zdic: { /** * Supported language: en, zh-CN, zh-TW, ja, kor, fr, de, es @@ -822,7 +822,14 @@ export function getALlDicts () { chs: true, minor: false, } - } as DictItem, + }, } + + // This is simply for type checking. The returned types are useful. + // tslint:disable-next-line: no-unused-expression + allDicts as { + [index: string]: DictItem + } + return allDicts } diff --git a/src/options/components/options/Dictionaries/EditDictModal.tsx b/src/options/components/options/Dictionaries/EditDictModal.tsx index d397f01d8..233756736 100644 --- a/src/options/components/options/Dictionaries/EditDictModal.tsx +++ b/src/options/components/options/Dictionaries/EditDictModal.tsx @@ -2,9 +2,10 @@ import React from 'react' import { DictID } from '@/app-config' import { Props } from '../typings' import { updateConfigOrProfile, formItemModalLayout } from '../helpers' +import { DictItem } from '@/app-config/dicts' import { FormComponentProps } from 'antd/lib/form' -import { Form, Modal, InputNumber, Select, Switch, Checkbox } from 'antd' +import { Form, Modal, InputNumber, Select, Switch, Checkbox, Radio } from 'antd' const { Option } = Select @@ -14,6 +15,79 @@ export type EditDictModalProps = Props & FormComponentProps & { } export class EditDictModal extends React.Component<EditDictModalProps> { + renderMoreOptions = (dictID: DictID) => { + const { t, profile } = this.props + const { getFieldDecorator } = this.props.form + const dict = profile.dicts.all[dictID] as DictItem + const { options } = dict + if (!options) { return } + + const optionPath = `profile#dicts#all#${dictID}#options#` + + return ( + <> + <p>{t('dict_more_options')}</p> + {Object.keys(options).map(optKey => { + // can be number | boolean | string(select) + const value = options[optKey] + switch (typeof value) { + case 'number': + return ( + <Form.Item + {...formItemModalLayout} + key={optKey} + label={t(`dict:${dictID}_${optKey}`)} + >{ + getFieldDecorator(optionPath + optKey, { + initialValue: value, + rules: [{ type: 'number' }], + })( + <InputNumber formatter={v => `${v} ${t(`dict:${dictID}_${optKey}_unit`)}`} /> + ) + }</Form.Item> + ) + case 'boolean': + return ( + <Form.Item + {...formItemModalLayout} + key={optKey} + label={t(`dict:${dictID}_${optKey}`)} + >{ + getFieldDecorator(optionPath + optKey, { + initialValue: value, + valuePropName: 'checked', + })( + <Switch /> + ) + }</Form.Item> + ) + case 'string': + return ( + <Form.Item + {...formItemModalLayout} + key={optKey} + label={t(`dict:${dictID}_${optKey}`)} + style={{ marginBottom: 0 }} + >{ + getFieldDecorator(optionPath + optKey, { + initialValue: value, + })( + <Radio.Group> + {dict.options_sel![optKey].map(option => ( + <Radio value={option} key={option}>{ + t(`dict:${dictID}_${optKey}-${option}`) + }</Radio> + ))} + </Radio.Group> + ) + }</Form.Item> + ) + } + })} + </> + ) + } + render () { const { onClose, dictID, t, profile } = this.props const { getFieldDecorator } = this.props.form @@ -93,67 +167,7 @@ export class EditDictModal extends React.Component<EditDictModalProps> { <InputNumber formatter={v => `${v} px`} /> ) }</Form.Item> - {allDict[dictID].options && - <> - <p>{t('dict_more_options')}</p> - {Object.keys(allDict[dictID].options!).map(optKey => { - // can be number | boolean | string(select) - const value = allDict[dictID].options![optKey] - switch (typeof value) { - case 'number': - return ( - <Form.Item - {...formItemModalLayout} - key={optKey} - label={t(`dict:${dictID}_${optKey}`)} - >{ - getFieldDecorator(`${dictPath}#options#${optKey}`, { - initialValue: value, - rules: [{ type: 'number' }], - })( - <InputNumber formatter={v => `${v} ${t(`dict:${dictID}_${optKey}_unit`)}`} /> - ) - }</Form.Item> - ) - case 'boolean': - return ( - <Form.Item - {...formItemModalLayout} - key={optKey} - label={t(`dict:${dictID}_${optKey}`)} - >{ - getFieldDecorator(`${dictPath}#options#${optKey}`, { - initialValue: value, - valuePropName: 'checked', - })( - <Switch /> - ) - }</Form.Item> - ) - case 'string': - return ( - <Form.Item - {...formItemModalLayout} - key={optKey} - label={t(`dict:${dictID}_${optKey}`)} - >{ - getFieldDecorator(`${dictPath}#options#${optKey}`, { - initialValue: value, - })( - <Select> - {allDict[dictID].options_sel![optKey].map(option => ( - <Option value={option} key={option}>{ - t(`dict:${dictID}_${optKey}-${option}`) - }</Option> - ))} - </Select> - ) - }</Form.Item> - ) - } - })} - </> - } + {this.renderMoreOptions(dictID)} </Form> } </Modal>
fix
fix config typing
a0d215a7ff045df7cb4a5eedf33bcd4ecc433847
2018-04-25 21:02:59
CRIMX
feat(content): sync panel height with dict item height
false
diff --git a/src/content/components/DictItem/index.tsx b/src/content/components/DictItem/index.tsx index 9e06358ef..46f940b23 100644 --- a/src/content/components/DictItem/index.tsx +++ b/src/content/components/DictItem/index.tsx @@ -37,7 +37,9 @@ export class DictItem extends React.PureComponent<DictItemProps & { t: Translati state = { copySearchStatus: null, + /** real height of the body */ offsetHeight: 10, + /** final height, takes unfold and mask into account */ visibleHeight: 10, isUnfold: false, } @@ -87,7 +89,7 @@ export class DictItem extends React.PureComponent<DictItemProps & { t: Translati } if (this.state.isUnfold) { - this.setState({ isUnfold: false }) + this.setState({ isUnfold: false, visibleHeight: 10 }) } else { if (this.props.searchResult) { const update = this.calcBodyHeight(true) @@ -120,6 +122,11 @@ export class DictItem extends React.PureComponent<DictItemProps & { t: Translati const update = this.calcBodyHeight() if (update) { this.setState(update as any) } } + + this.props.updateItemHeight({ + id: this.props.id, + height: this.state.visibleHeight + 20, + }) } render () { @@ -139,15 +146,6 @@ export class DictItem extends React.PureComponent<DictItemProps & { t: Translati isUnfold, } = this.state - const displayHeight = isUnfold ? visibleHeight : 10 - - // plus header - const itemHeight = displayHeight + 20 - if (itemHeight !== this.prevItemHeight) { - this.prevItemHeight = itemHeight - updateItemHeight({ id, height: itemHeight }) - } - return ( <section className='panel-DictItem'> <header className='panel-DictItem_Header' onClick={this.toggleFolding}> @@ -170,7 +168,7 @@ export class DictItem extends React.PureComponent<DictItemProps & { t: Translati </svg> </button> </header> - <Spring from={this.initStyle} to={{ height: displayHeight, opacity: isUnfold ? 1 : 0 }}> + <Spring from={this.initStyle} to={{ height: visibleHeight, opacity: isUnfold ? 1 : 0 }}> {({ height, opacity }) => ( <div className='panel-DictItem_Body' key={id} diff --git a/src/content/components/DictPanelPortal/index.tsx b/src/content/components/DictPanelPortal/index.tsx index e9dc25edb..150ad1bad 100644 --- a/src/content/components/DictPanelPortal/index.tsx +++ b/src/content/components/DictPanelPortal/index.tsx @@ -7,6 +7,7 @@ import { WidgetState } from '../../redux/modules/widget' import { SelectionInfo } from '@/_helpers/selection' import { SelectionState } from '@/content/redux/modules/selection' import { Omit } from '@/typings/helpers' +import { DictID } from '@/app-config' export type DictPanelPortalDispatchers = Omit< DictPanelDispatchers, @@ -25,8 +26,11 @@ export interface DictPanelPortalProps extends DictPanelPortalDispatchers { } type DictPanelState= { - /** copy current props to compare with the next props */ - readonly propsSelection: SelectionState | null + /** hack to reduce the overhead ceremony introduced by gDSFP */ + readonly mutableArea: { + propsSelection: SelectionState | null + dictHeights: { [k in DictID]?: number } + } readonly isNewSelection: boolean readonly x: number @@ -42,7 +46,10 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp initStyle = { x: 0, y: 0, height: 30, width: 400, opacity: 0 } state = { - propsSelection: null, + mutableArea: { + propsSelection: null, + dictHeights: {}, + }, isNewSelection: false, x: 0, @@ -55,15 +62,18 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp prevState: DictPanelState ): Partial<DictPanelState> | null { const newSelection = nextProps.selection - if (newSelection !== prevState.propsSelection) { + const mutableArea = prevState.mutableArea + if (newSelection !== mutableArea.propsSelection) { + mutableArea.propsSelection = newSelection // only re-calculate position when new selection is made - const newState = { propsSelection: newSelection, isNewSelection: true } + const newState = { isNewSelection: true } if (newSelection.selectionInfo.text && !nextProps.isPinned) { // restore height const panelWidth = nextProps.config.panelWidth const panelHeight = 30 + nextProps.config.dicts.selected.length * 30 newState['height'] = panelHeight + mutableArea.dictHeights = {} // icon position 10px panel position // +-------+ +------------------------+ @@ -126,16 +136,25 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp if (this.frame) { const iframeStyle = this.frame.style iframeStyle.setProperty('width', width + 'px', 'important') - iframeStyle.setProperty('hegiht', height + 'px', 'important') + iframeStyle.setProperty('height', height + 'px', 'important') iframeStyle.setProperty('transform', `translate3d(${x}px, ${y}px, 0)`, 'important') iframeStyle.setProperty('opacity', opacity, 'important') } return null } + updateItemHeight = ({ id, height }: { id: DictID, height: number }) => { + const dictHeights = this.state.mutableArea.dictHeights + if (dictHeights[id] !== height) { + dictHeights[id] = height + const newHeight = 30 + this.props.config.dicts.selected + .reduce((sum, id) => sum + (dictHeights[id] || 30), 0) + this.setState({ height: newHeight }) + } + } + render () { /** @todo */ - const updateItemHeight = () => console.log('updateItemHeight') const updateDragArea = () => console.log('updateDragArea') const { selection, config, isPinned, isMouseOnBowl } = this.props @@ -165,7 +184,7 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp ? <DictPanel {...this.props} shouldShow={shouldShow} - updateItemHeight={updateItemHeight} + updateItemHeight={this.updateItemHeight} updateDragArea={updateDragArea} frameDidMount={this.frameDidMount} frameWillUnmount={this.frameWillUnmount}
feat
sync panel height with dict item height
6e0f1ee188728caede77d2eaf1a683079f97e301
2018-05-26 10:41:25
CRIMX
feat(dicts): add webster learners dict
false
diff --git a/config/fake-env/fake-ajax.js b/config/fake-env/fake-ajax.js index 27ede7e81..89ea7977f 100644 --- a/config/fake-env/fake-ajax.js +++ b/config/fake-env/fake-ajax.js @@ -187,6 +187,33 @@ const fakeFetchData = [ text: () => require('raw-loader!../../test/specs/components/dictionaries/youdao/response/translation.html') }, }, + { + test: { + method: /.*/, + url: /learnersdictionary\.com.*house$/, + }, + response: { + text: () => require('raw-loader!../../test/specs/components/dictionaries/learnersdict/response/house.html') + }, + }, + { + test: { + method: /.*/, + url: /learnersdictionary\.com.*door$/, + }, + response: { + text: () => require('raw-loader!../../test/specs/components/dictionaries/learnersdict/response/door.html') + }, + }, + { + test: { + method: /.*/, + url: /learnersdictionary\.com.*jumblish$/, + }, + response: { + text: () => require('raw-loader!../../test/specs/components/dictionaries/learnersdict/response/jumblish.html') + }, + }, ] /*-----------------------------------------------*\ diff --git a/src/app-config/dicts.ts b/src/app-config/dicts.ts index bac28c771..025f24404 100644 --- a/src/app-config/dicts.ts +++ b/src/app-config/dicts.ts @@ -196,6 +196,43 @@ export function getALlDicts () { chs: true } }, + learnersdict: { + /** + * Full content page to jump to when user clicks the title. + * %s will be replaced with the current word. + * %z will be replaced with the traditional Chinese version of the current word + */ + page: 'http://www.learnersdictionary.com/definition/%s', + /** + * If set to true, the dict start searching automatically. + * Otherwise it'll only start seaching when user clicks the unfold button. + * Default MUST be true and let user decide. + */ + defaultUnfold: true, + /** + * This is the default height when the dict first renders the result. + * If the content height is greater than the preferred height, + * the preferred height is used and a mask with a view-more button is shown. + * Otherwise the content height is used. + */ + preferredHeight: 265, + /** + * Only start searching if the selection contains the language. + * Better set default to true and let user decide. + */ + selectionLang: { + eng: true, + chs: true + }, + /** Optional dict custom options. Can only be boolean or number. */ + options: { + defs: true, + phrase: true, + derived: true, + arts: true, + related: true, + }, + }, liangan: { /** * Full content page to jump to when user clicks the title. @@ -253,6 +290,7 @@ export function getALlDicts () { eng: true, chs: true }, + /** Optional dict custom options. Can only be boolean or number. */ options: { wordfams: false, collocations: true, @@ -291,6 +329,7 @@ export function getALlDicts () { eng: true, chs: true }, + /** Optional dict custom options. Can only be boolean or number. */ options: { related: true, } @@ -385,6 +424,7 @@ export function getALlDicts () { eng: true, chs: true }, + /** Optional dict custom options. Can only be boolean or number. */ options: { basic: true, collins: true, diff --git a/src/components/dictionaries/learnersdict/View.tsx b/src/components/dictionaries/learnersdict/View.tsx new file mode 100644 index 000000000..1cd34af6f --- /dev/null +++ b/src/components/dictionaries/learnersdict/View.tsx @@ -0,0 +1,58 @@ +import React from 'react' +import Speaker from '@/components/Speaker' +import { LearnersDictResult, LearnersDictResultLex, LearnersDictResultRelated } from './engine' + +export default class DictLearnersDict extends React.PureComponent<{ result: LearnersDictResult }> { + renderLex (result: LearnersDictResultLex) { + return result.items.map(entry => ( + <section key={entry.title} className='dictLearnersDict-Entry'> + <header className='dictLearnersDict-Header'> + <span className='hw_d hw_0' dangerouslySetInnerHTML={{ __html: entry.title }} /> + <Speaker src={entry.pron} /> + </header> + {entry.infs && + <div className='dictLearnersDict-Header'> + <span className='hw_infs_d' dangerouslySetInnerHTML={{ __html: entry.infs }} /> + <Speaker src={entry.infsPron} /> + </div> + } + {entry.labels && + <div className='labels' dangerouslySetInnerHTML={{ __html: entry.labels }} /> + } + {entry.senses && + <div className='sblocks' dangerouslySetInnerHTML={{ __html: entry.senses }} /> + } + {entry.arts && entry.arts.length > 0 && entry.arts.map(src => ( + <img key={src} src={src} /> + ))} + {entry.phrases && + <div className='dros' dangerouslySetInnerHTML={{ __html: entry.phrases }} /> + } + {entry.derived && + <div className='uros' dangerouslySetInnerHTML={{ __html: entry.derived }} /> + } + </section> + )) + } + + renderRelated (result: LearnersDictResultRelated) { + return ( + <> + <p>Did you mean:</p> + <ul className='dictLearnersDict-Related' dangerouslySetInnerHTML={{ __html: result.list }} /> + </> + ) + } + + render () { + const { result } = this.props + switch (result.type) { + case 'lex': + return this.renderLex(result) + case 'related': + return this.renderRelated(result) + default: + return null + } + } +} diff --git a/src/components/dictionaries/learnersdict/_locales.json b/src/components/dictionaries/learnersdict/_locales.json new file mode 100644 index 000000000..1a49d70d7 --- /dev/null +++ b/src/components/dictionaries/learnersdict/_locales.json @@ -0,0 +1,34 @@ +{ + "name": { + "en": "Merriam-Webster's Learner's Dictionary", + "zh_CN": "韦氏学习词典", + "zh_TW": "韋氏學習字典" + }, + "options": { + "defs": { + "en": "Show definitions", + "zh_CN": "显示释义", + "zh_TW": "顯示解釋" + }, + "phrase": { + "en": "Show phrases", + "zh_CN": "显示词组", + "zh_TW": "顯示片語" + }, + "derived": { + "en": "Show derived words", + "zh_CN": "显示派生词", + "zh_TW": "顯示衍生字" + }, + "arts": { + "en": "Show pictures", + "zh_CN": "显示图片释义", + "zh_TW": "顯示圖片解釋" + }, + "related": { + "en": "Show related results", + "zh_CN": "失败时显示备选", + "zh_TW": "失敗時顯示備選" + } + } +} diff --git a/src/components/dictionaries/learnersdict/_style.scss b/src/components/dictionaries/learnersdict/_style.scss new file mode 100644 index 000000000..e00662bf9 --- /dev/null +++ b/src/components/dictionaries/learnersdict/_style.scss @@ -0,0 +1,601 @@ +.dictLearnersDict-Entry { + /*utils*/ + .smark { + font-size: 117%; + font-weight: bold; + padding-left: 1px; + } + + .boxy { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + } + + .comma { + margin: 0; + padding: 0; + font-weight: normal; + color: #000; + font-style: normal; + } + + .semicolon { + margin: 0; + padding: 0; + font-weight: normal; + color: #000; + font-style: normal; + } + + .bc { + font-weight: bold; + } + + + /*mw markup overrides*/ + .mw_spm_aq { + color: #000; + margin: 0; + padding: 0; + padding: 0; + border: none; + } + + /*Dotted line*/ + .dline { + background: #ffffff url(data:image/gif;base64,R0lGODlhAwAOAJEAALKysv///////wAAACH5BAEHAAIALAAAAAADAA4AAAIGlI+poN0FADs=) repeat-x left center; + margin-bottom: 1.3em; + } + + .dline span { + background-color: #fff; + color: #3692A4; + line-height: 1.1; + font-weight: bold; + display: inline-block; + margin: 0; + padding-right: 0.8em; + } + + + /*WOD only*/ + .wod_img_tit { + color: #757575; + font-style: italic; + margin-bottom: 15px; + } + + .wod_img_act { + padding: 0; + line-height: 0; + } + + /*non-HW prons*/ + .pron_w { + color: #717274; + font-weight: normal; + font-size: 109%; + } + + .pron_i { + color: #D40218; + font-size: 140%; + } + + .pron_i:hover { + color: #FF0000; + text-decoration: none; + } + + /*non-HW variations*/ + .v_label { + font-style: italic; + color: #757575; + } + + .v_text { + font-weight: bold; + } + + /*non-HW inflections*/ + .i_label { + font-style: italic; + color: #757575; + } + + .i_text { + font-weight: bold; + } + + & > .labels > .lb { + font-style: italic; + } + + & > .labels > .gram > .gram_internal { + color: #757575; + } + + & > .labels > .sl { + font-style: italic; + } + + + /*view: phrasal verbs*/ + .pva { + font-weight: bold; + } + + /*view: synonym paragraphs*/ + .synpar { + border: 1px solid #ccc; + padding: 4px 10px 6px 10px; + margin-bottom: 1em; + } + + .synpar > .synpar_part { + margin-bottom: 10px; + } + + .synpar > .synpar_part:last-child { + margin-bottom: 0; + } + + .synpar > .synpar_part > .synpar_w { + font-variant: small-caps; + font-size: 1.1em; + line-height: 1; + } + + .synpar > .synpar_part > *:last-child { + margin-bottom: 0; + } + + /*view: supplementary notes*/ + .snotes { + margin-bottom: 1em; + overflow: hidden; + } + + .snotes > *{ + margin-bottom: 0.8em; + } + + .snotes > *:last-child { + margin-bottom: 0; + } + + .snotes > .snote_text > .snote_link { + font-variant: small-caps; + font-size: 1.1em; + line-height: 1; + } + + .snotes > .snote_text > .snote_link sup { + font-size: 50%; + } + + + /*view: supplementary noteboxes*/ + .snotebox { + border: 1px solid #ccc; + padding: 0.8em; + margin-bottom: 1em; + overflow: hidden; + } + + .snotebox > .snotebox_text { + text-align: justify; + } + + .snotebox > .snotebox_text > .snote_link { + font-variant: small-caps; + font-size: 1.1em; + line-height: 1; + } + + .snotebox > .snotebox_text > .snote_link sup { + font-size: 50%; + } + + /*view: sense blocks*/ + .sblocks { + margin-bottom: 1em; + } + + .sblocks .sense { + margin-bottom: 0.5em; + } + + .sblocks > .sblock { + width: 100%; + margin: 6px 0px 0px 0px; + } + + .sblocks > .sblock > .sblock_c { + margin-bottom: 10px; + } + + .sblocks > .sblock > .sblock_c:last-child { + margin-bottom: 0; + } + + .sblocks > .sblock > .sblock_c > .sn_block_num { + float: left; + font-weight: bold; + } + + .sblocks > .sblock > .sblock_c > .scnt > .sblock_labels > .slb { + font-style: italic; + } + + .sblocks > .sblock > .sblock_c > .scnt > .sblock_labels > .ssla { + font-style: italic; + } + + .sblocks > .sblock > .sblock_c > .scnt > .sblock_labels > .sgram > .sgram_internal { + color: #757575; + } + + .sblocks > .sblock > .sblock_c > .scnt > .sblock_labels > .bnote { + font-weight: bold; + font-style: italic; + } + + .sblocks > .sblock > .sblock_c > .scnt { + margin-bottom: 10px; + overflow: auto; + } + + .sblocks > .sblock > .sblock_c > .scnt:last-child { + margin-bottom: 0; + } + + .sblocks > .sblock > .sblock_c > .scnt > .sense > *:last-child { + margin-bottom: 0; + padding-bottom: 0; + } + + .sblocks > .sblock > .sblock_c > .scnt > .sense > .sn_letter { + font-weight: bold; + float: left; + } + + .sblocks > .sblock > .sblock_c > .scnt > .sense > .sd { + font-style: italic; + } + + .sblocks > .sblock > .sblock_c > .scnt > .sense > .bnote { + font-weight: bold; + font-style: italic; + color: #000; + } + + .sblocks > .sblock > .sblock_c > .scnt > .sense > .slb { + font-style: italic; + } + + .sblocks > .sblock > .sblock_c > .scnt > .sense > .sgram > .sgram_internal { + color: #757575; + } + + .sblocks > .sblock > .sblock_c > .scnt > .sense > .ssla { + font-style: italic; + } + + .sblocks > .sblock > .sblock_c > .scnt > .sense > .def_text { + margin-bottom: 6px; + } + + .sblocks > .sblock > .sblock_c > .scnt > .sense > .def_text > .bc { + font-weight: bold; + } + + .sblocks > .sblock > .sblock_c > .scnt > .sense > .def_labels { + margin-top: 10px; + padding-left: 14px; + } + + .sblocks > .sblock > .sblock_c > .scnt > .sense > .def_labels > .wsgram > .wsgram_internal { + color: #757575; + } + + .sblocks > .sblock > .sblock_c > .scnt > .sense > .def_labels > .sl { + font-style: italic; + } + + /*view: verbal illustration*/ + .vis_w { + margin-bottom: 0.3em; + } + + .vis_w > .vis { + padding-left: 1.2em; + } + + .vis_w > .vis > .vi { + padding: 0.08em 0; + list-style-type: square; + color: #5FB68C; + } + + .vis_w > .vis > .vi > .vi_content { + color: #505050; + margin-left: -2px; + line-height: 1.3; + } + + .vis_w > .vis > .vi:first-child { + padding-top: 0; + } + + .vis_w > .vis > .vi:last-child { + padding-bottom: 0; + } + + .vis_w > .vi_more { + display: none; + } + + /*view: dros*/ + & > .dros { + margin-bottom: 1em; + } + + & > .dros > .dro { + margin-bottom: 0.8em; + padding-left: 0.8em; + } + + & > .dros > .dro:last-child { + margin-bottom: 0; + } + + & > .dros > .dro > .dro_line { + margin-left: -0.8em; + } + + & > .dros > .dro > .dro_line > *{ + vertical-align: middle + } + + & > .dros > .dro > .dro_line > .dre { + display: inline; + font-weight: bold; + padding: 0; + margin: 0; + font-size: inherit; + } + + & > .dros > .dro > .dro_line > .gram > .gram_internal { + color: #757575; + } + + & > .dros > .dro > .dro_line > .sl { + font-style: italic; + } + + & > .dros > .dro > .dro_line > .rsl { + font-style: italic; + } + + & > .dros > .dro > .dxs { + margin-top: 0.6em; + display: block; + } + + /*view: uros*/ + & > .uros { + margin-bottom: 1em; + } + + & > .uros > .uro { + margin-bottom: 0.8em; + padding-left: 0.8em; + } + + & > .uros > .uro:last-child { + margin-bottom: 0; + } + + & > .uros > .uro > .uro_line { + margin-left: -0.8em; + } + + & > .uros > .uro > .uro_line > *{ + vertical-align: middle + } + + & > .uros > .uro > .uro_line > .ure { + display: inline; + font-weight: bold; + padding: 0; + margin: 0; + font-size: inherit; + margin-right: 0.5em + } + + & > .uros > .uro > .uro_line > .gram > .gram_internal { + color: #757575; + } + + & > .uros > .uro > .uro_line > .lb { + font-style: italic; + } + + & > .uros > .uro > .uro_line > .sl { + font-style: italic; + } + + & > .uros > .uro > .uro_line > .fl { + color: #717274; + font-style: italic; + font-weight: bold; + } + + & > .uros > .uro > .uro_def { + margin: 0.5em 0 0 0; + } + + & > .uros > .uro > .uro_def:first-child { + margin-top: 0; + } + + & > .uros > .uro > .uro_def > *:first-child { + margin-top: 0; + } + + + /*view: inline synonyms*/ + .isyns > .bc { + font-weight: bold; + } + + .isyns > .isyn_link { + font-variant: small-caps; + font-size: 1.1em; + line-height: 1; + } + + .isyns > .isyn_link sup { + font-size: 50%; + } + + /*view: cognate cross entries*/ + & > .cxs { + margin-top: 1.2em; + margin-bottom: 1.2em; + } + + & > .cxs .cx_link { + font-variant: small-caps; + font-size: 1.1em; + line-height: 1; + } + + & > .cxs .cx_link sup { + font-size: 50%; + } + + & > .cxs .cl { + font-style: italic; + } + + + /*view: directional cross entries*/ + .dxs.dxs_nl { + margin-bottom: 1em; + } + + .dxs .dx .dx_link { + font-variant: small-caps; + font-size: 1.1em; + line-height: 1; + } + + .dxs .dx .dx_link sup { + font-size: 50%; + } + + .dxs .dx .dx_span { + font-variant: small-caps; + font-size: 1.1em; + line-height: 1; + } + + .dxs .dx .dx_span sup { + font-size: 50%; + } + + .dxs .dx .dx_ab { + font-style: italic; + } + + .dxs .dx .dx_tag { + font-style: italic; + } + + + /*view: cas*/ + .cas { + margin-top: 14px; + } + + .cas > .ca_prefix { + font-style: italic; + } + + .cas > .ca_text { + font-style: italic; + } + + + /*view: usage paragraphs*/ + .usage_par { + padding: 0.3em 0.7em; + border: 1px solid #ccc; + margin-bottom: 1em; + } + + .usage_par > .usage_par_h { + font-weight: bold; + } + + .usage_par > .ud_text { + text-align: justify; + } + + .usage_par > *{ + margin-bottom: 0.5em; + } + + .usage_par > *:last-child { + margin-bottom: 0; + } + + + /*view: synref*/ + .synref_h1 { + font-weight: bold; + } + + .synref_link { + font-variant: small-caps; + font-size: 1.1em; + line-height: 1; + } + + .synref_link sup { + font-size: 50%; + } + + + /*view: usageref*/ + .usageref_block > .usageref_h1 { + font-weight: bold; + } + + .usageref_block > .usageref_link { + font-variant: small-caps; + font-size: 1.1em; + line-height: 1; + } + + .usageref_block > .usageref_link sup { + font-size: 50%; + } +} + +.dictLearnersDict-Header { + .hw_txt { + font-size: 1.5em; + font-weight: bold; + } +} + +.dictLearnersDict-Related { + a { + margin-left: 2em; + color: #16a085; + } +} diff --git a/src/components/dictionaries/learnersdict/engine.ts b/src/components/dictionaries/learnersdict/engine.ts new file mode 100644 index 000000000..ae511311b --- /dev/null +++ b/src/components/dictionaries/learnersdict/engine.ts @@ -0,0 +1,138 @@ +import { fetchDirtyDOM } from '@/_helpers/fetch-dom' +import { reflect } from '@/_helpers/promise-more' +import { HTMLString, getInnerHTMLThunk, handleNoResult } from '../helpers' +import { AppConfig, DictConfigs } from '@/app-config' +import { DictSearchResult } from '@/typings/server' + +const getInnerHTML = getInnerHTMLThunk('http://www.learnersdictionary.com/') + +interface LearnersDictResultItem { + title: HTMLString + pron?: string + + infs?: HTMLString + infsPron?: string + + labels?: HTMLString + senses?: HTMLString + phrases?: HTMLString + derived?: HTMLString + arts?: string[] +} + +export interface LearnersDictResultLex { + type: 'lex' + items: LearnersDictResultItem[] +} + +export interface LearnersDictResultRelated { + type: 'related' + list: string +} + +export type LearnersDictResult = LearnersDictResultLex | LearnersDictResultRelated + +type LearnersDictSearchResult = DictSearchResult<LearnersDictResult> +type LearnersDictSearchResultLex = DictSearchResult<LearnersDictResultLex> + +export default function search ( + text: string, + config: AppConfig, +): Promise<LearnersDictSearchResult> { + const options = config.dicts.all.learnersdict.options + + return fetchDirtyDOM('http://www.learnersdictionary.com/definition/' + text.replace(/[^A-Za-z0-9]+/g, '-')) + .then(doc => checkResult(doc, options)) +} + +function checkResult ( + doc: Document, + options: DictConfigs['learnersdict']['options'], +): LearnersDictSearchResult | Promise<LearnersDictSearchResult> { + const $alternative = doc.querySelector<HTMLAnchorElement>('[id^="spelling"] .links') + if (!$alternative) { + return handleDOM(doc, options) + } else if (options.related) { + return { + result: { + type: 'related', + list: getInnerHTML($alternative) + } + } + } + return handleNoResult() +} + +function handleDOM ( + doc: Document, + options: DictConfigs['learnersdict']['options'], +): LearnersDictSearchResultLex | Promise<LearnersDictSearchResultLex> { + doc.querySelectorAll('.d_hidden').forEach(el => el.remove()) + + const result: LearnersDictResultLex = { + type: 'lex', + items: [] + } + const audio: { us?: string } = {} + + doc.querySelectorAll('.entry').forEach($entry => { + const entry: LearnersDictResultItem = { + title: '' + } + + const $headword = $entry.querySelector('.hw_d') + if (!$headword) { return } + const $pron = $headword.querySelector<HTMLAnchorElement>('.play_pron') + if ($pron) { + const path = ($pron.dataset.lang || '').replace('_', '/') + const dir = $pron.dataset.dir || '' + const file = $pron.dataset.file || '' + entry.pron = `http://media.merriam-webster.com/audio/prons/${path}/mp3/${dir}/${file}.mp3` + audio.us = entry.pron + $pron.remove() + } + entry.title = getInnerHTML($headword) + + const $headwordInfs = $entry.querySelector('.hw_infs_d') + if ($headwordInfs) { + const $pron = $headwordInfs.querySelector<HTMLAnchorElement>('.play_pron') + if ($pron) { + const path = ($pron.dataset.lang || '').replace('_', '/') + const dir = $pron.dataset.dir || '' + const file = $pron.dataset.file || '' + entry.infsPron = `http://media.merriam-webster.com/audio/prons/${path}/mp3/${dir}/${file}.mp3` + $pron.remove() + } + entry.infs = getInnerHTML($headwordInfs) + } + + entry.labels = getInnerHTML($entry, '.labels') + + if (options.defs) { + entry.senses = getInnerHTML($entry, '.sblocks') + } + + if (options.phrase) { + entry.phrases = getInnerHTML($entry, '.dros') + } + + if (options.derived) { + entry.derived = getInnerHTML($entry, '.uros') + } + + if (options.arts) { + entry.arts = Array.from($entry.querySelectorAll<HTMLImageElement>('.arts img')) + .map($img => $img.src) + } + + if (entry.senses || entry.phrases || entry.derived || (entry.arts && entry.arts.length > 0)) { + result.items.push(entry) + } + }) + + if (result.items.length > 0) { + return { result, audio } + } + + return handleNoResult() +} diff --git a/src/components/dictionaries/learnersdict/favicon.png b/src/components/dictionaries/learnersdict/favicon.png new file mode 100644 index 000000000..e366f29b0 Binary files /dev/null and b/src/components/dictionaries/learnersdict/favicon.png differ diff --git a/test/specs/components/dictionaries/learnersdict/engine.spec.ts b/test/specs/components/dictionaries/learnersdict/engine.spec.ts new file mode 100644 index 000000000..12b625827 --- /dev/null +++ b/test/specs/components/dictionaries/learnersdict/engine.spec.ts @@ -0,0 +1,95 @@ +import search, { LearnersDictResultLex, LearnersDictResultRelated } from '@/components/dictionaries/learnersdict/engine' +import { appConfigFactory, AppConfigMutable } from '@/app-config' +import fs from 'fs' +import path from 'path' + +describe('Dict/LearnersDict/engine', () => { + beforeAll(() => { + const response = { + house: fs.readFileSync(path.join(__dirname, 'response/house.html'), 'utf8'), + door: fs.readFileSync(path.join(__dirname, 'response/door.html'), 'utf8'), + jumblish: fs.readFileSync(path.join(__dirname, 'response/jumblish.html'), 'utf8'), + } + + window.fetch = jest.fn((url: string) => { + const key = Object.keys(response).find(keyword => url.endsWith(keyword)) + if (key) { + return Promise.resolve({ + text: () => response[key] + }) + } + return Promise.reject(new Error(`Missing Response file for ${url}`)) + }) + }) + + it('should parse lex result correctly', () => { + return search('house', appConfigFactory()) + .then(searchResult => { + expect(searchResult.audio && typeof searchResult.audio.us).toBe('string') + + const result = searchResult.result as LearnersDictResultLex + expect(result.type).toBe('lex') + expect(result.items).toHaveLength(2) + + expect(typeof result.items[0].title).toBe('string') + expect(result.items[0].title).toBeTruthy() + + expect(typeof result.items[0].pron).toBe('string') + expect(result.items[0].pron).toBeTruthy() + + expect(typeof result.items[0].infs).toBe('string') + expect(result.items[0].infs).toBeTruthy() + + expect(typeof result.items[0].infsPron).toBe('string') + expect(result.items[0].infsPron).toBeTruthy() + + expect(result.items[0].labels).toBeFalsy() + + expect(typeof result.items[0].senses).toBe('string') + expect(result.items[0].senses).toBeTruthy() + + expect(result.items[0].arts).toHaveLength(1) + + expect(typeof result.items[0].phrases).toBe('string') + expect(result.items[0].phrases).toBeTruthy() + + expect(typeof result.items[0].derived).toBe('string') + expect(result.items[0].derived).toBeTruthy() + + // 2 + expect(typeof result.items[1].title).toBe('string') + expect(result.items[1].title).toBeTruthy() + + expect(typeof result.items[1].pron).toBe('string') + expect(result.items[1].pron).toBeTruthy() + + expect(typeof result.items[1].infs).toBe('string') + expect(result.items[1].infs).toBeTruthy() + + expect(result.items[1].infsPron).toBeFalsy() + + expect(typeof result.items[1].labels).toBe('string') + expect(result.items[1].labels).toBeTruthy() + + expect(typeof result.items[1].senses).toBe('string') + expect(result.items[1].senses).toBeTruthy() + + expect(result.items[1].arts).toHaveLength(0) + + expect(result.items[1].phrases).toBeFalsy() + + expect(result.items[1].derived).toBeFalsy() + }) + }) + + it('should parse related result correctly', () => { + return search('jumblish', appConfigFactory()) + .then(searchResult => { + expect(searchResult.audio).toBeUndefined() + + const result = searchResult.result as LearnersDictResultRelated + expect(result.type).toBe('related') + expect(typeof result.list).toBe('string') + }) + }) +}) diff --git a/test/specs/components/dictionaries/learnersdict/response/door.html b/test/specs/components/dictionaries/learnersdict/response/door.html new file mode 100644 index 000000000..62e18ecde --- /dev/null +++ b/test/specs/components/dictionaries/learnersdict/response/door.html @@ -0,0 +1,3726 @@ + +<!DOCTYPE html> +<html lang="en_US"> + <head> + <!--SEO-related tags: title, keywords, description--> + <title>Door - Definition for English-Language Learners from Merriam-Webster&#039;s Learner&#039;s Dictionary</title> + <meta name="description" content="Definition&#x20;of&#x20;door&#x20;written&#x20;for&#x20;English&#x20;Language&#x20;Learners&#x20;from&#x20;the&#x20;Merriam-Webster&#x20;Learner&#x27;s&#x20;Dictionary&#x20;with&#x20;audio&#x20;pronunciations,&#x20;usage&#x20;examples,&#x20;and&#x20;count&#x2F;noncount&#x20;noun&#x20;labels."> + <meta name="keywords" content="door,&#x20;definition,&#x20;define,&#x20;meaning,&#x20;Learning&#x20;English,&#x20;simple&#x20;English,&#x20;second&#x20;language,&#x20;learner&#x27;s&#x20;dictionary,&#x20;websters,&#x20;Merriam-Webster"> + + <!--Static meta tags --> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="robots" content="noodp, noydir"> + <meta property="fb:app_id" content="177288989106908"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + + + <script type="text/javascript" data-type="googletags"> + var googletag = googletag || {}; + googletag.cmd = googletag.cmd || []; + </script> + + <!--Opensearch link--> + <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="M-W Learner's Dictionary" /> + + + <!-- FAVICON --> + <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"> + <link rel="icon" href="/favicon.ico" type="image/x-icon"> + + <!-- VENDOR CSS --> + <link href="/vendor/normalize.2.1.2/normalize.min.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + <link href="/vendor/font-awesome-4.0.3/css/font-awesome.min.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + <link href="/vendor/amodal_1.6.5/amodal.min.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + <link href="/vendor/jquery-ui-1.10.3.custom/css/smoothness/jquery-ui-1.10.3.custom.min.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + + <!-- SHARED CSS --> + <link href="/css/shared/mw_style.0001.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + <link href="/css/shared/utils.0002.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + <link href="/css/shared/reusable.0001.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + <link href="/css/shared/resets.0001.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + + <link rel="stylesheet" href="/css/shared/gdpr.css"> + + <!-- TEMPLATE CSS (both mobile + desktop)--> + <link href="/css/main_template.0017.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + + <script type="text/javascript"> + (function(){ var wrapperLib = document.createElement('script'); wrapperLib.async = true; wrapperLib.type = 'text/javascript'; var useSSL = 'https:' == document.location.protocol; wrapperLib.src = (useSSL ? 'https:' : 'http:') + '//js-sec.indexww.com/ht/p/183900-278584765944481.js'; var node = document.getElementsByTagName('script')[0]; node.parentNode.insertBefore(wrapperLib, node); } + )(); + </script> + + <!--MODERNIZR--> + <script src="/vendor/modernizr.2.7.1/modernizr.custom.95871.js"></script> + + <!--JS config--> + <script type="text/javascript"> + window.mwdata = {}; + window.mwdata.assetsDomain1 = 'http://www.merriam-webster.com/assets'; + window.mwdata.assetsDomain2 = 'http://www.merriam-webster.com/assets'; + window.mwdata.env = 'production'; + window.mwdata.ads = {"ad_slot_top":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_Dictionary\/DICT","id":"div-gpt-ad-781001946814165391-1","defSizes":[[728,90]],"targeting":[["POS",["TOP"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[728,90]]}]}},"ad_slot_left":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_Dictionary\/DICT","id":"div-gpt-ad-781001946814165391-2","defSizes":[[160,600]],"targeting":[["POS",["TOP"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[160,600]]}]}},"ad_slot_right_top":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_Dictionary\/DICT","id":"div-gpt-ad-781001946814165391-3","defSizes":[[300,250]],"targeting":[["POS",["TOP"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[300,250]]}]}},"ad_slot_right_bottom":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_Dictionary\/DICT","id":"div-gpt-ad-781001946814165391-4","defSizes":[[300,250]],"targeting":[["POS",["BOT"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[300,250]]}]}},"ad_slot_bottom":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_Dictionary\/DICT","id":"div-gpt-ad-781001946814165391-5","defSizes":[[728,90]],"targeting":[["POS",["BOT"]]],"sizeMappings":[{"screen":[0,0],"ads":[[320,50]]},{"screen":[768,100],"ads":[[728,90]]}]}}}; + window.mwdata.ads2 = {"ad_slot_top":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_REFRESH","id":"div-gpt-ad-152893562297167022-1","defSizes":[[728,90]],"targeting":[["POS",["TOP"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[728,90]]}]}},"ad_slot_left":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_REFRESH","id":"div-gpt-ad-152893562297167022-2","defSizes":[[160,600]],"targeting":[["POS",["TOP"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[160,600]]}]}},"ad_slot_right_top":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_REFRESH","id":"div-gpt-ad-152893562297167022-3","defSizes":[[300,250]],"targeting":[["POS",["TOP"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[300,250]]}]}},"ad_slot_right_bottom":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_REFRESH","id":"div-gpt-ad-152893562297167022-4","defSizes":[[300,250]],"targeting":[["POS",["BOT"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[300,250]]}]}},"ad_slot_bottom":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_REFRESH","id":"div-gpt-ad-152893562297167022-5","defSizes":[[728,90]],"targeting":[["POS",["BOT"]]],"sizeMappings":[{"screen":[0,0],"ads":[[320,50]]},{"screen":[768,100],"ads":[[728,90]]}]}}}; + window.mwdata.gatReady = false; + window.mwdata.gatQueue = []; + window.mwdata.tagsPrepped = []; + window.mwdata.gTagReady = false; + window.mwdata.dfpSvcUp = false; + window.mwdata.adsBlacklist = []; + window.mwdata.adsWhitelist = null; + </script> + <script> + // Willy: Need to move all this to AD Library + // get the browser's current window dimensions + function getWindowDimensions() { + var width = window.innerWidth || + document.documentElement.clientWidth || + document.body.clientWidth; + var height = window.innerHeight || + document.documentElement.clientHeight || + document.body.clientHeight; + return [width, height]; + } + + // given a size mapping like: [[[1000, 600], [[300, 250], [300,600]]],[[0,0], [[300,250]]]] + // return the valid size mapping as an array like: [[300,250]] when the screen dimensions + // are less than 1000 width and 600 height + function parseSizeMappings(sizeMappings) { + try{ + // get current window dimensions + var sd = getWindowDimensions(); + + // filter mappings that are valid by confirming that the current screen dimensions + // are both greater than or equal to the breakpoint [x, y] minimums specified in the first position in the mapping + var validMappings = sizeMappings.filter(function(m) {return m[0][0] <= sd[0] && m[0][1] <= sd[1]}); + + // return the leftmost mapping's sizes or an empty array + return validMappings.length > 0 ? validMappings[0][1] : []; + } catch (e) { + console.log('error parsing sizeMappings:'); + console.log(sizeMappings); + console.log(e); + // fallback to last size mapping supplied + return sizeMappings[ sizeMappings.length -1 ][1]; + } + } + + function updateADPOSNaming() { + var i,j,adPos, adSize; + var setPOSName = function(adData) { + if (Array.isArray(adData.sizeMap) && adData.sizeMap.length > 0) { + adSize = adData.sizeMap[0].toString().replace(",",""); + for (i = 0; i < adData.targeting.length; i++) { + if (adData.targeting[i][0].toUpperCase() === "POS") { + adPos = "L" + adSize + adData.targeting[i][1]; + adData.targeting[i][1] = [adPos]; + break; + } + } + } + } + for (i in window.mwdata.ads) { + setPOSName(window.mwdata.ads[i].data); + } + if (typeof(window.mwdata.ads2) === "object" && !Array.isArray(window.mwdata.ads2)) { + for (j in window.mwdata.ads2) { + setPOSName(window.mwdata.ads2[j].data); + } + } + } + + function createSizeMapping() { + try { + var sizeMap, sizeMap2, adData, adData2; + for (var i in window.mwdata.ads) { + adData = window.mwdata.ads[i].data; + sizeMap = []; + if (typeof(adData.sizeMappings) !== "undefined" && adData.sizeMappings.length > 0) { + adData.sizeMappings.reverse().forEach(function(adSize) { + sizeMap.push([adSize.screen,adSize.ads]); + }); + window.mwdata.ads[i].data.sizeMap = parseSizeMappings(sizeMap); + if (window.mwdata.ads[i].data.sizeMap.length === 0) { + window.mwdata.ads[i].data.sizeMap = adData.defSizes; + } + } + } + if (typeof(window.mwdata.ads2) === "object" && !Array.isArray(window.mwdata.ads2)) { + for (var j in window.mwdata.ads2) { + adData2 = window.mwdata.ads2[j].data; + sizeMap2 = []; + if (typeof(adData2.sizeMappings) !== "undefined" && adData2.sizeMappings.length > 0) { + adData2.sizeMappings.reverse().forEach(function(adSize) { + sizeMap2.push([adSize.screen,adSize.ads]); + }); + window.mwdata.ads2[j].data.sizeMap = parseSizeMappings(sizeMap2); + if (window.mwdata.ads2[j].data.sizeMap.length === 0) { + window.mwdata.ads2[j].data.sizeMap = adData2.defSizes; + } + } + } + } + + } catch (e) { + for (var i in window.mwdata.ads) { + window.mwdata.ads[i].data.sizeMap = window.mwdata.ads[i].data.defSizes; + } + for (var i in window.mwdata.ads) { + window.mwdata.ads2[i].data.sizeMap = window.mwdata.ads2[i].data.defSizes; + } + } + } + createSizeMapping(); + updateADPOSNaming(); + </script> + <!-- JS --> + <script type="text/javascript"> + googletag.cmd.push(function() { + if (typeof window.headertag === 'undefined' || window.headertag.apiReady !== true) { + window.headertag = googletag; + } + }); + </script> + <!-- async GPT TAG --> + <script async src="https://www.googletagservices.com/tag/js/gpt.js"></script> + + <script src="/vendor/requirejs.2.1.6/require.min.js"></script> + <script type="text/javascript"> + //The reason I use js for path construction here - Google reports crawl errors + var vnd = '/vendor/'; + var fwdsl = '/'; + requirejs.config({ + + enforceDefine: false, + paths: { + //Our modules + 'auth_messages': '/js/lib/assign_errors.0002', + 'adProcessor': '/js/lib/adProcessor.0001', + 'ads2Refresher': '/js/lib/ads2Refresher.0001', + 'uniqueId': '/js/lib/uniqueId.0001', + 'dynScript': '/js/lib/dynScript.0001', + + 'main': '/js/components/main.0001', + 'facebookApi': '/js/components/facebookApi.0001', + 'search': '/js/components/search.0001', + 'subscribeOverlay': '/js/lib/subscribeOverlay', + 'GDPR': '/js/lib/gdpr', + //Vendor modules + "jquery": vnd + 'jquery.1.10.2' + fwdsl + 'jquery.min', + "jquery.jqueryui": vnd + 'jquery-ui-1.10.3.custom' + fwdsl + 'js' + fwdsl + 'jquery-ui-1.10.3.custom.min', + "underscore": vnd + 'lodash_1.2.1' + fwdsl + 'lodash.min', + "jquery.event_drag": vnd + 'amodal_1.6.5' + fwdsl + 'jquery.event.drag.min', + "jquery.amodal": vnd + 'amodal_1.6.5' + fwdsl + 'amodal.min', + "jquery.blockui": vnd + 'blockui_2.6.1' + fwdsl + 'jquery.blockUI', + "bowser": vnd + 'bowser.0.3.1' + fwdsl + 'bowser.min', + "jquery.cookie": vnd + 'jquery_cookie_1.4.0' + fwdsl + 'jquery.cookie', + 'matchMedia': '/vendor/match-media/matchMedia', + + //non-AMDs + "twitter": '//platform.twitter.com/widgets', + "jquery.cycle2": vnd + 'cycle2' + fwdsl + 'jquery.cycle2.20130909.min', + "jquery.rrssb": vnd + 'rrssb.1.6.0' + fwdsl + 'js' + fwdsl + 'rrssb.min' + }, + shim: { + "jquery.cycle2": ['jquery'], + "jquery.event_drag": ['jquery'], + "jquery.amodal": ['jquery.event_drag'], + "jquery.jqueryui": ['jquery'], + "jquery.rrssb": ['jquery'] + } + }); + </script> + + + <script> + //JC: instantiating adProcessor + require(['adProcessor'], function(adProcessor) { + //JC: Initiating ad libraries (google slot lib, ) & initializing slots + adProcessor.prepareAdLibraries(); + + //JC: by default we use a black-list, white-list is only being used if provided (rare cases) + if (window.mwdata.adsWhitelist !== null) { + adProcessor.prepareOnlyTheseAdSlots(window.mwdata.adsWhitelist); + } else { + adProcessor.prepareAllAdSlotsExcept(window.mwdata.adsBlacklist); + } + }); + + //JC: lotami tracking + require(['dynScript'], function(dynScript) { + dynScript.load('//tags.crwdcntrl.net/c/6936/cc.js?ns=_cc6936', {id: 'LOTCC_6936'}, function() { + _cc6936.bcp(); + }); + }); + + //JC: Google analitics + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + ga('create', 'UA-296234-17', 'learnersdictionary.com'); + ga('send', 'pageview'); + </script> + </head> + <body class="arial_font"> + + <!--Facebook Api--> + <script>require(['facebookApi']);</script> + + <!--Wrapper--> + <div id="wrap_full"> + <div id="wrap_c"> + + <!--Central left--> + <div id="wrap_cl" class="ld_xs_hidden noprint"> + <div id = "brit_logo_container"> + <a href="http://www.britannica.com/" target="_blank"><img id="brit_logo" src="/images/logos/d_brit.0001.jpg" alt="An Encylopedia Britannica Company" /></a> + </div> + <div id = "logo"> + <a href="/"><img src="/images/logos/d_logo.0001.gif" alt="Learner's Dictionary Logo" /></a> + </div> + + + <div class="abl abl-m0-t160-d160 ld_xs_hidden"> + <div class="ad_slot_left" id="ad_slot_left"> + <script>require(['adProcessor'], function(ap) {ap.renderDfp('ad_slot_left');});</script> + </div> + </div> + </div> + + <!--Central right--> + <div id="wrap_cr"> + + <!--Mobile top--> + <div class="mobile_top noprint box_sizing ld_xs_visible ld_lg_hidden"> + + <div class="toppest"> + <!--Globe logo--> + <img src = "/images/logos/m_logo_h.0001.png" class = "globe_logo box_sizing"> + + <!--Main title--> + <div class = "main_title"> + <a class="tt" href="/">Learner's Dictionary</a> + <a class="tb" href="/">mobile search</a> + </div> + </div> + + <!--Search form + menu--> + <div class="ld_searchc_m_plusb_w box_sizing"> + <div class="ld_searchc_m_plusb box_sizing"> + + <!--Mobile menu: dropdown--> + <ul class="m_menu_ul box_sizing"> + <li class="home"> + <img src="/images/m_menu/ld_menu_icon_home_teal.png" /> + <a href="/">Home</a> + </li> + <li class="qa"> + <img src="/images/m_menu/ld_menu_icon_qa_teal.png" /> + <a href="/qa/post/latest">Ask the Editor</a> + </li> + <li class="wod"> + <img src="/images/m_menu/ld_menu_icon_cal_teal.png" /> + <a href="/word-of-the-day">Word of the Day</a> + </li> + <li class="quizzes ld_xs_hidden"> + <img src="/images/m_menu/ld_menu_icon_vocabquiz_teal.png" /> + <a href="/quizzes">Quizzes</a> + </li> + <li class="words_3000"> + <img src="/images/m_menu/ld_menu_icon_3k_teal.png" /> + <a href="/3000-words">Core Vocabulary</a> + </li> + <li class="saved"> + <img src="/images/m_menu/ld_menu_icon_star_teal.png" /> + <a href="/saved-words">My Saved Words</a> + </li> + <li class="login"> + <img src="/images/m_menu/ld_menu_icon_signout_teal.png" /> + <a href="/auth/login">Login</a> + </li> + </ul> + + <!--Mobile menu: search form--> + <div id = "ld_searchc_m" class="box_sizing"> + <div class="frm box_sizing"> + + <!--Mobile menu: menu button--> + <a href="#" class="m_menu_btn box_sizing"> + <i class="fa fa-bars"></i> + <div class="prick"></div> + </a> + + <!--Mobile menu: search container--> + <div class="ld_search_inp_c box_sizing"> + <input autocapitalize="off" type="text" name="ld_search_inp" class="box_sizing ld_search_inp_c ld_search_inp" maxlength="200" rows=1 data-placeholder="Search Learner's Dictionary..." value="door" /> + </div> + + <!--Mobile menu: search icon--> + <i class="fa fa-search fa-flip-horizontal search_btn box_sizing"></i> + + <!--Mobile menu: clear icon--> + <span class="clear_btn">&#215;</span> + + <!--Mobile menu: autocomplete holder--> + <div class="autocomplete_holder_m box_sizing"></div> + </div> + </div> + </div> + </div> + </div> + + + <!--Central right: top--> + <div id="wrap_cr_t" class="ld_xs_hidden noprint box_sizing"> + <div class="abl abl-m0-t728-d728 ld_xs_hidden"> + <div class="ad_slot_top" id="ad_slot_top"> + <script>require(['adProcessor'], function(ap) {ap.renderDfp('ad_slot_top');});</script> + </div> + </div> + </div> + + <!--Central right: bottom--> + <div id="wrap_cr_b" class="box_sizing"> + + <!--Central right: bottom: left column--> + <div id="wrap_cr_bl" class="box_sizing"> + + <!--Desktop top--> + <div class="desktop_top box_sizing ld_xs_hidden ld_lg_visible noprint"> + + <!--Top menu--> + <div class="section-links noprint"> + <ul> + <li class="ask_the_editor_link"> + <a class="nmlink" href="/qa/post/latest">Ask the Editor</a> + </li> + <li class="word_of_the_day_link"> + <a class="nmlink" href="/word-of-the-day">Word of the Day</a> + </li> + <li class="quizzes_link"> + <a class="nmlink" href="/quizzes">Quizzes</a> + </li> + <li class="words_3000_link"> + <a class="nmlink" href="/3000-words">Core Vocabulary</a> + </li> + <li class="most_popular_words_link"> + <a class="nmlink" href="/most-popular-words">Most Popular</a> + </li> + <li class="favorites_link"> + <a class="nmlink" href="/saved-words">My Saved Words</a> + </li> + <li class="login_link"> + <a href="/auth/login?redirect=%2Fsaved-words" class="login_btn">Log in</a> + </li> + </ul> + </div> + + <!--Main title--> + <div id = "main_title" class="georgia_font noprint"> + <a href="/">Learner's Dictionary</a> + </div> + + <!--Search form--> + <div id = "ld_searchc_d" class="box_sizing noprint"> + <div class="frm box_sizing"> + <input type="text" name="ld_search_inp" class="ld_search_inp box_sizing" maxlength="200" rows=1 data-placeholder="Search for definitions in simple English..." value="door" /> + <div class="autocomplete_holder_d"></div> + </div> + <button class="search_btn"></button> + </div> + </div> + + <!--Actual content --> + <!--CSS--> +<link href="/css/entries/all.0007.css" type="text/css" rel="Stylesheet" charset="utf-8" /> +<link href="/css/entries/definition.0025.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + +<!--HTML--> +<h1 id="ld_entries_v2_mainh" class="georgia_font box_sizing ld_xs_hidden"> + door</h1> + + <div id="ld_entries_v2_others_block" class="ld_xs_hidden box_sizing"> + <div class = "o_count"> + 24 ENTRIES FOUND: + </div> + <ul class="o_list verdana_font"> + <li> + <!--direct match--> + <!--no homograph--> + <a href="/definition/door" class="selected"><!-- + -->door<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + + </li> + <li> + <!--indirect match--> + <a href="/definition/door–to–door" class=""><!-- + -->door–to–door<!-- + --><!-- + --><span> (adjective)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/door prize" class=""><!-- + -->door prize<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/back door" class=""><!-- + -->back door<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/closed–door" class=""><!-- + -->closed–door<!-- + --><!-- + --><span> (adjective)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/Dutch door" class=""><!-- + -->Dutch door<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/French door" class=""><!-- + -->French door<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/next door" class=""><!-- + -->next door<!-- + --><!-- + --><span> (adverb)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/next–door" class=""><!-- + -->next–door<!-- + --><!-- + --><span> (adjective)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/open–door" class=""><!-- + -->open–door<!-- + --><!-- + --><span> (adjective)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/out of doors" class=""><!-- + -->out of doors<!-- + --><!-- + --><span> (adverb)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/revolving door" class=""><!-- + -->revolving door<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/sliding door" class=""><!-- + -->sliding door<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/stage door" class=""><!-- + -->stage door<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/storm door" class=""><!-- + -->storm door<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/swinging door" class=""><!-- + -->swinging door<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/close" class=""><!-- + -->close<!-- + --><!-- + --><span> (verb)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/closed" class=""><!-- + -->closed<!-- + --><!-- + --><span> (adjective)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/darken" class=""><!-- + -->darken<!-- + --><!-- + --><span> (verb)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/death" class=""><!-- + -->death<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/foot" class=""><!-- + -->foot<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/open" class=""><!-- + -->open<!-- + --><!-- + --><span> (verb)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/show" class=""><!-- + -->show<!-- + --><!-- + --><span> (verb)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/wolf" class=""><!-- + -->wolf<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + </ul> + </div> + +<div id="ld_entries_v2_all"> + + <!--Save favorites button--> + <span class="save_faves faved_-" data-is_faved="-" data-remove_me="Saved" data-save_me="Save"> + <a href="#" class="txt"><!-- + -->Save<!-- + --></a> + <div class="save_faves_star"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></div> + </span> + + <!--HTML--> +<div class="entry entry_v2 boxy"> + + <!--Setting some placeholders--> + + <!--headword: desktop--> + <!--headword: desktop view--> +<div class = "hw_d hw_0 boxy m_hidden"> + <!--headword text--> + <span class = "hw_txt gfont"> + <sup class="homograph"></sup> + door </span> + + <!--label: hsl--> + + <!--hprons--> + + + <span class = "hpron_word ifont">/<span class="smark">ˈ</span>doɚ/</span> + + + <a href = "#" class="fa fa-volume-up hpron_icon play_pron" data-word="door" data-dir="d" data-file="door0001" data-pron="ˈdoɚ" data-lang="en_us"></a> + + <!--label: fl--> + <span class="fl">noun</span> + </div> + +<!--BOTTOM headword thingies (variations)--> + +<!--BOTTOM headword thingies (inflections)--> + <div class = "hw_infs_d m_hidden"> + <!--label: i_label--> + <span class = "i_label">plural</span> + +<!--inflection--> + <span class = "i_text">doors</span> + +<!--prons--> + </div> + + <!--headword: mobile--> + <!--headword: mobile view--> +<div class = "hw_m hw_0 boxy d_hidden"> + + <!--h_m: hw line--> + <div class = "hw_line"> + <!--headword text--> + <span class = "hw_txt"> + <sup class="homograph"></sup> + door </span> + + <!--label: hsl--> + + <!--audio icons--> + <a href = "#" class="fa fa-volume-up hpron_icon play_pron" data-word="door" data-dir="d" data-file="door0001" data-pron="ˈdoɚ" data-lang="en_us"></a> + </div> + + <!--h_m: text prons--> + <div class = "text_prons"> + + <span class = "hpron_word ifont">/<span class="smark">ˈ</span>doɚ/</span> + + </div> + + <!--label: fl--> + <div class="fl">noun</div> + </div> + +<!--BOTTOM headword thingies (variations)--> + +<!--BOTTOM headword thingies (inflections)--> + <div class = "hw_infs_m d_hidden"> + <!--label: i_label--> + <span class = "i_label">plural</span> + +<!--inflection--> + <span class = "i_text">doors</span> + +<!--prons--> + </div> + + <!--Definition header--> + <div class="dline m_hidden"> + <span class="vfont">Learner&#039;s definition of DOOR</span> + </div> + + <!--cxs--> + + <!--dxs--> + + <!--snote|snotebox--> + + <!--entire entry labels--> + <div class = "labels"> + <!--lb--> + + <!--label: gram--> + <span class = "gram">[<span class = "gram_internal">count</span>]</span> + + <!--label: sl--> + </div> + + <!--sense blocks--> + <div class = "sblocks"> + <div class = "sblock sblock_entry"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">1&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + <strong class="sn_letter">a&nbsp;</strong> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">a movable piece of wood, glass, or metal that swings or slides open and shut so that people can enter or leave a room, building, vehicle, etc.</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">open/shut/slam/lock/bolt the <em class="mw_spm_it">door</em></div> + </li> <li class = "vi"> + <div class="vi_content">I heard a knock on/at the <em class="mw_spm_it">door</em>.</div> + </li> <li class = "vi"> + <div class="vi_content">the bedroom/bathroom/cellar <em class="mw_spm_it">door</em></div> + </li> <li class = "vi collapsible"> + <div class="vi_content">The car has four <em class="mw_spm_it">doors</em>. = It&#039;s a four-<em class="mw_spm_it">door</em> car.</div> + </li> <li class = "vi collapsible"> + <div class="vi_content">Leave the package at the front/back/side <em class="mw_spm_it">door</em>. [=the door at the front/back/side of the house, building, etc.]</div> + </li> <li class = "vi collapsible"> + <div class="vi_content">Can you <span class="mw_spm_phrase">answer the door</span>? [=open the door to see who is knocking on the door or ringing the doorbell]</div> + </li> <li class = "vi collapsible"> + <div class="vi_content">Is somebody <span class="mw_spm_phrase">at the door</span>? [=knocking on the door or ringing the doorbell]</div> + </li> <li class = "vi collapsible"> + <div class="vi_content">Let me open the <em class="mw_spm_it">door</em> for you. = (<em class="mw_spm_it">US</em>) Let me <span class="mw_spm_phrase">get the door</span> for you.</div> + </li> <li class = "vi collapsible"> + <div class="vi_content">(<em class="mw_spm_it">US</em>) Can you <em class="mw_spm_it">get the door</em>? [=can you open or close the door for me?] My hands are full.</div> + </li> <li class = "vi collapsible"> + <div class="vi_content">an <span class="mw_spm_phrase">exterior/outside door</span> [=a door that can be used to enter or leave a building]</div> + </li> <li class = "vi collapsible"> + <div class="vi_content">an <span class="mw_spm_phrase">interior door</span> [=a door inside a building; a door that connects rooms]</div> + </li> <li class = "vi collapsible"> + <div class="vi_content">a <span class="mw_spm_phrase">garage door</span> [=a large door that covers the opening through which a car enters and leaves a garage]</div> + </li> <li class = "vi collapsible"> + <div class="vi_content">turn/pull the <span class="mw_spm_phrase">door handle</span></div> + </li> <li class = "vi collapsible"> + <div class="vi_content">a large brass <span class="mw_spm_phrase">door knocker</span> [=<em class="mw_spm_it">knocker</em>]</div> + </li> </ul> + <div class = "vi_more"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + + <span class = "dxs dxs_nonl"> + &#8212; + <span class = "dx"> + see also <a href ='/definition/back door' class='dx_link'>back door</a>, <a href ='/definition/dutch door' class='dx_link'>dutch door</a>, <a href ='/definition/french door' class='dx_link'>french door</a>, <a href ='/definition/revolving door' class='dx_link'>revolving door</a>, <a href ='/definition/storm door' class='dx_link'>storm door</a>, <a href ='/definition/trapdoor' class='dx_link'>trapdoor</a> </span> + </span> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + <!--uds--> + </div> <div class="sense"> + <!--sense letter--> + <strong class="sn_letter">b&nbsp;</strong> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">a part of an object (such as piece of furniture or an appliance) that swings or slides open and shut</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">the cupboard/closet/refrigerator/oven <em class="mw_spm_it">door</em></div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> <div class = "sblock sblock_entry"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">2&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">the opening for a door</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">the entrance to a room or building</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + <span class = "isyns"> + <a href = '/definition/doorway' class = 'isyn_link'>doorway</a> </span> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">Please don&#039;t block the <em class="mw_spm_it">door</em>.</div> + </li> <li class = "vi"> + <div class="vi_content">I peeked through the open <em class="mw_spm_it">door</em>.</div> + </li> <li class = "vi"> + <div class="vi_content">He stood at/before the <em class="mw_spm_it">door</em>.</div> + </li> <li class = "vi collapsible"> + <div class="vi_content">He greeted his guests as they <span class="mw_spm_phrase">came in/through the door</span>. = He greeted his guests <span class="mw_spm_phrase">at the door</span>.</div> + </li> <li class = "vi collapsible"> + <div class="vi_content">She <span class="mw_spm_phrase">walked out the door</span> [=<em class="mw_spm_it">left</em>] without saying goodbye.</div> + </li> <li class = "vi collapsible"> + <div class="vi_content">standing (just/right) <span class="mw_spm_phrase">inside/outside the door</span> [=inside/outside the room, building, etc., near the door]</div> + </li> </ul> + <div class = "vi_more"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> <div class = "sblock sblock_entry"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">3&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">a house, building, apartment, office, etc.</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + <!--un_text--> + &#8212; <span class = "un_text">used with an adverb to indicate where something is in relation to something else</span> + +<!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">She lives in a house two <span class="mw_spm_phrase">doors down/up</span> from me. [=there is one house between our houses]</div> + </li> <li class = "vi"> + <div class="vi_content">The library is a <span class="mw_spm_phrase">few doors down</span> from the bank. [=there are several buildings between the library and the bank]</div> + </li> <li class = "vi"> + <div class="vi_content">We grew up <span class="mw_spm_phrase">two doors apart</span>. [=with one house/apartment between our houses/apartments]</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + <span class = "snote"> + + <!--snote text--> + <div class = "both_text"> + ◊ If you do something <span class="mw_spm_phrase">(from) door to door</span>, you do it at each of the houses, apartments, or buildings in an area. </div> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">Girl Scouts are selling cookies <em class="mw_spm_it">door to door</em>. = Girl Scouts are <span class="mw_spm_phrase">going door to door</span> selling cookies.</div> + </li> <li class = "vi"> + <div class="vi_content">She <em class="mw_spm_it">went (from) door to door</em> looking for her cat.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + </span> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + + <span class = "dxs dxs_nonl"> + &#8212; + <span class = "dx"> + see also <a href ='/definition/door-to-door' class='dx_link'>door-to-door</a>, <a href ='/definition/next door' class='dx_link'>next door</a> </span> + </span> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + <!--uds--> + </div> </div> + </div> +</div> <div class = "sblock sblock_entry"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">4&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + <!--un_text--> + &#8212; <span class = "un_text">used especially with <em class="mw_spm_it">open</em> or <em class="mw_spm_it">unlock</em> to describe an opportunity or possibility</span> + +<!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">The grant will <em class="mw_spm_it">open</em> new <em class="mw_spm_it">doors</em> for our town. [=will give our town new opportunities]</div> + </li> <li class = "vi"> + <div class="vi_content">The discovery may <em class="mw_spm_it">unlock</em> the <em class="mw_spm_it">door</em> to a cure for the disease.</div> + </li> <li class = "vi"> + <div class="vi_content">The <em class="mw_spm_it">door</em> is <em class="mw_spm_it">open</em> (to you) if you want a better job.</div> + </li> <li class = "vi collapsible"> + <div class="vi_content">A good education can <em class="mw_spm_it">open/unlock</em> the <em class="mw_spm_it">door</em> of success. [=can make success possible]</div> + </li> <li class = "vi collapsible"> + <div class="vi_content">The patent on the product has expired, which <span class="mw_spm_phrase">leaves the door open for</span> [=makes it possible for] other companies to make it.</div> + </li> </ul> + <div class = "vi_more"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + + <span class = "dxs dxs_nonl"> + &#8212; + <span class = "dx"> + see also <a href ='/definition/out of doors' class='dx_link'>out of doors</a> </span> + </span> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + <!--uds--> + </div> </div> + </div> +</div> </div> + + <!--snote|snotebox--> + + <!--dros--> + <div class = "dros"> + <div class ="dro" data-id="2267"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">at death&#039;s door</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + + <span class = "dxs dxs_nonl"> + &#8212; + <span class = "dx"> + see <a href ='/definition/death' class='dx_link'>death</a> </span> + </span> + + <!--snote|snotebox--> + + <!--sense blocks--> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="2268"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">behind closed doors</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + + <span class = "dxs dxs_nonl"> + &#8212; + <span class = "dx"> + see <a href ='/definition/closed' class='dx_link'>closed</a> </span> + </span> + + <!--snote|snotebox--> + + <!--sense blocks--> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="2269"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">close the door on</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + <!--snote|snotebox--> + + <!--sense blocks--> + <div class = "sblocks"> + <div class = "sblock sblock_dro"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">to no longer think about, consider, or accept (something)</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">I&#039;d like to <em class="mw_spm_it">close the door on</em> that chapter in my life.</div> + </li> <li class = "vi"> + <div class="vi_content">The former senator says she hasn&#039;t <em class="mw_spm_it">closed the door on</em> politics.</div> + </li> <li class = "vi"> + <div class="vi_content">Don&#039;t <em class="mw_spm_it">close the door on</em> your options.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> </div> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="2270"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">close your doors</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + <!--snote|snotebox--> + + <!--sense blocks--> + <div class = "sblocks"> + <div class = "sblock sblock_dro"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">1&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">to not allow someone to enter</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">The country has <em class="mw_spm_it">closed its doors</em> to immigrants.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> <div class = "sblock sblock_dro"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">2&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + <span class = "ssla">of a business or organization</span> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">to close permanently</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">to stop operating</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">The museum may be forced to <em class="mw_spm_it">close its doors</em>.</div> + </li> <li class = "vi"> + <div class="vi_content">The store <em class="mw_spm_it">closed its doors</em> (for the last time) last fall.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> </div> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="2271"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">darken someone&#039;s door/doors</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + + <span class = "dxs dxs_nonl"> + &#8212; + <span class = "dx"> + see <a href ='/definition/darken' class='dx_link'>darken</a> </span> + </span> + + <!--snote|snotebox--> + + <!--sense blocks--> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="2272"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">get your foot in the door</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + + <span class = "dxs dxs_nonl"> + &#8212; + <span class = "dx"> + see <a href = '/definition/foot[1]' class='dx_link'><sup>1</sup>foot</a> </span> + </span> + + <!--snote|snotebox--> + + <!--sense blocks--> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="2273"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">keep the wolf from the door</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + + <span class = "dxs dxs_nonl"> + &#8212; + <span class = "dx"> + see <a href = '/definition/wolf[1]' class='dx_link'><sup>1</sup>wolf</a> </span> + </span> + + <!--snote|snotebox--> + + <!--sense blocks--> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="2274"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">lay the blame for (something) at someone&#039;s door</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + <!--snote|snotebox--> + + <!--sense blocks--> + <div class = "sblocks"> + <div class = "sblock sblock_dro"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">to blame someone for (something)</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">They <em class="mw_spm_it">laid the blame for</em> the book&#039;s failure <em class="mw_spm_it">at my door</em>.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> </div> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="2275"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">open doors for</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + + <span class = "dxs dxs_nonl"> + &#8212; + <span class = "dx"> + see <a href = '/definition/open[2]' class='dx_link'><sup>2</sup>open</a> </span> + </span> + + <!--snote|snotebox--> + + <!--sense blocks--> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="2276"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">open the door</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + + <span class = "dxs dxs_nonl"> + &#8212; + <span class = "dx"> + see <a href = '/definition/open[2]' class='dx_link'><sup>2</sup>open</a> </span> + </span> + + <!--snote|snotebox--> + + <!--sense blocks--> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="2277"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">open your doors</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + <!--snote|snotebox--> + + <!--sense blocks--> + <div class = "sblocks"> + <div class = "sblock sblock_dro"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">1&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">to allow someone to enter</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">The country has <em class="mw_spm_it">opened its doors</em> to immigrants.</div> + </li> <li class = "vi"> + <div class="vi_content">local churches that <em class="mw_spm_it">open their doors</em> to the homeless in the winter months [=that let homeless people stay there]</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> <div class = "sblock sblock_dro"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">2&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + <span class = "ssla">of a business or organization</span> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">to open for business</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">to begin operating</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">The new store will be <em class="mw_spm_it">opening its doors</em> next month.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> </div> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="2278"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">show (someone) the door</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + <!--snote|snotebox--> + + <!--sense blocks--> + <div class = "sblocks"> + <div class = "sblock sblock_dro"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">to tell or force (someone) to leave</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">We don&#039;t tolerate bad behavior. If you cause trouble, we&#039;ll <em class="mw_spm_it">show you the door</em>.</div> + </li> <li class = "vi"> + <div class="vi_content">If the coach doesn&#039;t win this year, they&#039;ll <em class="mw_spm_it">show him the door</em>. [=they&#039;ll fire him]</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> </div> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="2279"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">show/see (someone) to the door</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + <!--snote|snotebox--> + + <!--sense blocks--> + <div class = "sblocks"> + <div class = "sblock sblock_dro"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">to go to the door with (someone who is leaving)</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">My secretary will <em class="mw_spm_it">show you to the door</em>. [=<em class="mw_spm_it">show you out</em>]</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> </div> + + <!--snote|snotebox--> + </div> </div> + + <!--dxs--> + + <!--uros--> + <div class = "uros"> + <div class ="uro"> + + <div class="uro_line"> + <!--ure--> + <h2 class = "ure" >&#8212; doorless</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--prons--> + + <!--variations--> + + + <!--label: fl--> + <span class = "fl">adjective</span> + + <!--lb--> + + <!--inflections--> + + <!--label: sl--> + + <!--label: gram--> + </div> + + <!--uro definitions--> + <div class = "uro_def"> + <div class = "uro_def"> + + <!--wsgram--> + + <!--directional cross references--> + + <!--usage note--> + + <!--snote|snotebox--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">a <em class="mw_spm_it">doorless</em> cubicle</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + </div> </div> + </div> </div> + + <!--synonym paragraphs --> + + <!--arts--> + <div class = "arts"> + <div class = "art boxy"><img src='http://www.merriam-webster.com/assets/ld/images/legacy_print_images/door_rev.gif' class='boxy' /></div> + </div> + </div> + <!--Comments and questions header--> + <div class="comments_h_initial_d ld_xs_hidden margin_top_1_3_em margin_bottom_1_3_em"><span class="verdana_font"><i class="fa fa-comments-o"></i> Comments & Questions</span></div> + <div class="comments_h_initial_m ld_lg_hidden"><i class="fa fa-comments-o"></i> Comments & Questions</div> + <div class = "comments"> + <div class = "comments_intro"> + What made you want to look up <span class="mw_spm_it">door</span>? + Include any comments and questions you have about this word. + </div> + <div class = "comments_d"> + <div id="disqus_thread"></div> + <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> + </div> + </div> +</div> + +<!--JAVASCRIPT--> +<script type="text/javascript"> + var disqusEntryId = 'disqus_identifier_ld_v2_door_az'; + var saveMe = false; + var bestMatch = {"dict_type":"az","hw_text_no_syllables":"door","eidNH":"door","eid":"door","uid":"door_az","isv2":false,"hw_homograph":null,"fl":"noun","search_type":"hw","search_value":"door"}; + require(['search'], function(search) { + search.init(disqusEntryId, saveMe, bestMatch); + }); +</script> </div> + + <!--Central right: bottom: right column--> + <div id="wrap_cr_br" class="box_sizing ld_xs_hidden noprint"> + + <div class="abl abl-m0-t300-d300 ld_xs_hidden"> + <div class="ad_slot_right_top" id="ad_slot_right_top"> + <script>require(['adProcessor'], function(ap) {ap.renderDfp('ad_slot_right_top');});</script> + </div> + </div> + + <div id = "wrap_rbr_c" class="box_sizing"> + <!-- CSS --> +<link href="/css/qa/siderail.0001.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + +<!-- HTML --> +<div id="qa_siderail"> + + <!--header--> + <div class="area_header verdana_font margin_bottom_10"> + ASK THE EDITOR + </div> + + <!--content--> + <table class="cont"> + <tr> + <td class="qa_content_l"> + <a href="/qa/When-to-Capitalize-Nouns" title=""> + <img src="http://www.merriam-webster.com/assets/ld/old_authors/50903/100x100e.jpeg" alt="" /> + </a> + </td> + <td class="qa_content_r"> + <div class="question"> + <a class="arial_font" href="/qa/When-to-Capitalize-Nouns" title="Question text">What types of nouns are always capitalised?</a> + </div> + + <div class="find_answer"> + <a href="/qa/When-to-Capitalize-Nouns" class="helvetica_font">See the answer &#187;</a> + </div> + </td> + </tr> + </table> +</div> <!-- CSS --> +<link href="/css/quizzes/siderail.0001.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + +<!-- HTML --> +<div id="quizzes_r"> + + <!--header--> + <div class="area_header verdana_font margin_bottom_10"> + LEARNER'S QUIZZES + </div> + + <!--content--> + <div class="main_content"> + <div class="feature_quiz"> + <div class="quiz_icon"> + <a href="/quiz/vocabulary-start"><img src="/images/quizzes/vocabulary-quiz-70x55.gif" alt="Vocabulary Quiz Icon" /></a> + </div> + <div class="quiz_content"> + <div class="title georgia_font"> + <a href="/quiz/vocabulary-start">Vocabulary Quiz</a> + </div> + <div class="descr"> + <a href="/quiz/vocabulary-start">Test your word power</a> + </div> + <div class="passthru_url"> + <a href="/quiz/vocabulary-start">Take the Quiz &raquo;</a> + </div> + </div> + </div> + + <div class="athletics-dots margin_top_4 margin_bottom_8"></div> + + <div class="feature_quiz"> + <div class="quiz_icon"> + <a href="/quiz/name-that-thing-pick"><img src="/images/quizzes/name-that-thing-70x55.gif" alt="Name That Thing Icon" /></a> + </div> + <div class="quiz_content"> + <div class="title georgia_font"> + <a href="/quiz/name-that-thing-pick">Name That Thing</a> + </div> + <div class="descr"> + <a href="/quiz/name-that-thing-pick">Take our visual quiz</a> + </div> + <div class="passthru_url"> + <a href="/quiz/name-that-thing-pick">Test Your Knowledge &raquo;</a> + </div> + </div> + </div> + </div> +</div> <!-- CSS --> +<link href="/css/wod/siderail.0001.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + +<!-- HTML --> +<div id="wod_siderail"> + + <!--header--> + <div class="area_header verdana_font margin_bottom_10"> + LEARNER'S WORD OF THE DAY + </div> + + <!--content--> + <table class="cont"> + <tr> + <td class="qa_content_l"> + <a href="/word-of-the-day" title=""> + <img src="http://assets.merriam-webster.com/ld/word_of_the_day/images/3583/thumb.jpg" alt="Primarily&#x20;Illustration" /> + </a> + </td> + <td class="qa_content_r"> + <div class="word georgia_font"> + <a href="/word-of-the-day" title="primarily"> + primarily </a> + </div> + + <div class="blurb"> + <a href="/word-of-the-day" title="&#x7B;bc&#x7D;&#x20;used&#x20;to&#x20;indicate&#x20;the&#x20;main&#x20;purpose&#x20;of&#x20;something,&#x20;reason&#x20;for&#x20;something,&#x20;etc."><strong class="mw_spm_bc">:</strong> used to indicate the main purpose of something, reason for something, etc.</a> + </div> + + <div class="learn_more"> + <a href="/word-of-the-day" class="helvetica_font">Learn More &#187;</a> + </div> + </td> + </tr> + </table> +</div> + +<!-- JAVASCRIPT --> +<script type="text/javascript"> + require(['underscore', 'jquery'], function(_) { + }); +</script> </div> + + <div class="abl abl-m0-t300-d300 ld_xs_hidden"> + <div class="ad_slot_right_bottom" id="ad_slot_right_bottom"> + <script>require(['adProcessor'], function(ap) {ap.renderDfp('ad_slot_right_bottom');});</script> + </div> + </div> + </div> + + <!--Central right: bottom: clearing column floats--> + <div style = "clear:both;"></div> + </div> + </div> + + <!--Central: clearing column floats--> + <div style = "clear:both;"></div> + + <!--Footer:--> + <div id="wrap_cf" class="box_sizing noprint"> + <div id="footer" class="box_sizing"> + <div class="offerings_top ld_xs_hidden"> + <div class="offer1 ind_offer"> + <div class="featTitle"> + The Merriam-Webster <br> Unabridged Dictionary + </div> + + <div class="featImage_1"> + <a href="https://unabridged.merriam-webster.com/subscriber/register?refc=SIGNUP_LEARNERS" > + <img src="/images/promos/unabridged-promo.gif" alt="Merriam-Webster Unabridged Book Cover" /> + </a> + </div> + + <div class="featDescr"> + Online access to a <br> legendary resource <br> <a href="https://unabridged.merriam-webster.com/subscriber/login">Log In</a> or <a href="https://unabridged.merriam-webster.com/subscriber/register?refc=SIGNUP_LEARNERS">Sign Up&nbsp;»</a> + </div> + </div> + + <div class="offer2 ind_offer"> + <div class="featTitle"> + Learning Spanish? + <br>We can help + </div> + + <div class="featImage_2"> + <a href="http://www.learnersdictionary.com/"> + <img src="/images/logos/sc_logo_0004.gif" alt="Learner's Dictionary Book Cover" /> + </a> + </div> + + <div class="featDescr"> + Visit our free site designed <br> especially for learners and <br> teachers of Spanish <br> <a href="http://www.spanishcentral.com/">SpanishCentral.com&nbsp;»</a> + </div> + </div> + + <div class="offer3 ind_offer"> + <div class="featImage_3"> + <a href="http://www.merriam-webster.com/dictionary-apps/android-ipad-iphone-windows.htm"> + <img src="/images/promos/iphone-app-woman-with-cell.jpg" alt="Woman With Cell Phone" /> + </a> + </div> + + <div class="featTitle"> + Our Dictionary, <br> On Your Devices + </div> + + <div class="featDescr"> + Merriam-Webster, <br> <em>With Voice Search</em> <br> <a href="http://www.merriam-webster.com/dictionary-apps/android-ipad-iphone-windows.htm">Get the Free Apps! »</a> + </div> + </div> + + <div class="offer4 ind_offer"> + <div class="featTitle"> + Merriam-Webster's <br> Visual Dictionaries + </div> + + <div class="featImage_4"> + <a href="http://www.merriam-webster.com/shop/products/books/visual-dictionary-second-edition.htm"> + <img src="/images/promos/visual-dictionary-promo.gif" border="0" alt="Visual Dictionary Book Cover" /> + </a> + </div> + + <div class="featDescr"> + The new edition of the <br> remarkable reference <br> features 8,000 <br> illustrations. <br> <a href="http://www.merriam-webster.com/shop/products/books/visual-dictionary-second-edition.htm">Learn More »</a> + </div> + </div> + </div> + + <!--Footer: ad area--> + <div class="ad_holder"> + <div class="abl abl-m320-t728-d728"> + <div class="ad_slot_bottom" id="ad_slot_bottom"> + <script>require(['adProcessor'], function(ap) {ap.renderDfp('ad_slot_bottom');});</script> + </div> + </div> + </div> + + <!--The rest of the footer--> + <div class="offerings_bottom ld_xs_hidden"> + <div class="offer5 ind_offer"> + <div class="featTitle"> + Join Us + </div> + + <div class="twitter"> + <div class="twLogo"> + <a href="https://twitter.com/MWforLearners"><img src="/images/social/twitter-logo.png"></a> + </div> + <div class="twDescr"> + <a href="https://twitter.com/MWforLearners">Learner's Dictionary<br>on Twitter&nbsp;»</a> + </div> + </div> + + <div class="facebook"> + <div class="fbLogo"> + <a href="https://www.facebook.com/learnersdictionary"><img src="/images/social/facebook-logo.png"></a> + </div> + <div class="fbDescr"> + <a href="https://www.facebook.com/learnersdictionary">Learner's Dictionary<br>on Facebook&nbsp;»</a> + </div> + </div> + </div> + + <div class="offer6 ind_offer"> + <div class="featTitle"> + Bookstore: Digital and Print + </div> + <div class="bookstoreDescr"> + Merriam-Webster references for Mobile, Kindle, print, and more. <a href="http://www.merriam-webster.com/shop/index.htm">See all&nbsp;»</a> + </div> + </div> + + <div class="offer7 ind_offer"> + <div class="featTitle"> + Other Merriam-Webster Dictionaries + </div> + + <div class="dictURLs_1"> + <a href="http://unabridged.merriam-webster.com">Webster's Unabridged Dictionary&nbsp;»</a> + <a href="http://arabic.britannicaenglish.com/en">Britannica English - Arabic Translation&nbsp;»</a> + <a href="http://www.nglish.com/spanish">Nglish - Spanish-English Translation&nbsp;»</a> + </div> + <div class="dictURLs_2"> + <a href="http://www.spanishcentral.com/">Spanish Central&nbsp;»</a> + <a href="http://visual.merriam-webster.com/">Visual Dictionary&nbsp;»</a> + <a href="http://www.wordcentral.com/">WordCentral for Kids&nbsp;»</a> + </div> + </div> + <div style="clear:left;"></div> + </div> + + + <!--Footer: some other things--> + <div class="footer_b ld_xs_hidden"> + <div class="browse-dictionary"> + <a href="/browse/learners/a">Browse the Learner's Dictionary</a> + </div> + <div class="major-links"> + <ol> + <li><a href="/">Home</a></li> + <li><a href="/help/ipa">Pronunciation Symbols</a></li> + <li><a href="/help/all">Help</a></li> + <li><a href="http://www.merriam-webster.com/info/index.htm" target="_blank">About Us</a></li> + <li><a href="http://www.merriam-webster.com/dictionary-apps/android-ipad-iphone-windows.htm">Mobile Apps</a></li> + <li><a href="/shop/all">Shop</a></li> + <li><a href="http://www.dictionaryapi.com/" target="_blank">Dictionary API</a></li> + </ol> + </div> + <div class="minor-links"> + <ol> + <li><a href="/privacy-policy">Privacy Policy</a></li> + <li><a href="/terms-of-use">Terms Of Use</a></li> + <li><a href="/about-our-ads">About Our Ads</a></li> + <li><a href="/help/contact">Contact Us</a></li> + </ol> + </div> + <div class="copyright"> + <a href="/terms-of-use#copyright">© 2018 Merriam-Webster, Incorporated</a> + </div> + </div> + </div> + </div> + </div> + </div> + + <!-- JAVASCRIPT --> + <script type="text/javascript"> + var focusIn = true; + var focusInHome = false; + require(['main'], function(main) { + main.init(focusIn, focusInHome); + }); + </script> + + <!-- Subscribe WOD Overlay --> + <link rel="stylesheet" href="/css/shared/subscribe-overlay.css"> + <div id="subscribe-overlay"></div> + <script> + require(['subscribeOverlay'], function(subscribeOverlay) { + window.setTimeout(function() { + subscribeOverlay.init(); + },6000); + }); + </script> + + <!-- GDPR --> + <script> + require(['GDPR'], function(GDPR) { + GDPR.init(); + }); + </script> + </body> +</html> diff --git a/test/specs/components/dictionaries/learnersdict/response/house.html b/test/specs/components/dictionaries/learnersdict/response/house.html new file mode 100644 index 000000000..cabd64238 --- /dev/null +++ b/test/specs/components/dictionaries/learnersdict/response/house.html @@ -0,0 +1,5645 @@ + +<!DOCTYPE html> +<html lang="en_US"> + <head> + <!--SEO-related tags: title, keywords, description--> + <title>House - Definition for English-Language Learners from Merriam-Webster&#039;s Learner&#039;s Dictionary</title> + <meta name="description" content="Definition&#x20;of&#x20;house&#x20;written&#x20;for&#x20;English&#x20;Language&#x20;Learners&#x20;from&#x20;the&#x20;Merriam-Webster&#x20;Learner&#x27;s&#x20;Dictionary&#x20;with&#x20;audio&#x20;pronunciations,&#x20;usage&#x20;examples,&#x20;and&#x20;count&#x2F;noncount&#x20;noun&#x20;labels."> + <meta name="keywords" content="house,&#x20;definition,&#x20;define,&#x20;meaning,&#x20;Learning&#x20;English,&#x20;simple&#x20;English,&#x20;second&#x20;language,&#x20;learner&#x27;s&#x20;dictionary,&#x20;websters,&#x20;Merriam-Webster"> + + <!--Static meta tags --> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="robots" content="noodp, noydir"> + <meta property="fb:app_id" content="177288989106908"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + + + <script type="text/javascript" data-type="googletags"> + var googletag = googletag || {}; + googletag.cmd = googletag.cmd || []; + </script> + + <!--Opensearch link--> + <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="M-W Learner's Dictionary" /> + + + <!-- FAVICON --> + <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"> + <link rel="icon" href="/favicon.ico" type="image/x-icon"> + + <!-- VENDOR CSS --> + <link href="/vendor/normalize.2.1.2/normalize.min.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + <link href="/vendor/font-awesome-4.0.3/css/font-awesome.min.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + <link href="/vendor/amodal_1.6.5/amodal.min.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + <link href="/vendor/jquery-ui-1.10.3.custom/css/smoothness/jquery-ui-1.10.3.custom.min.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + + <!-- SHARED CSS --> + <link href="/css/shared/mw_style.0001.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + <link href="/css/shared/utils.0002.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + <link href="/css/shared/reusable.0001.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + <link href="/css/shared/resets.0001.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + + <link rel="stylesheet" href="/css/shared/gdpr.css"> + + <!-- TEMPLATE CSS (both mobile + desktop)--> + <link href="/css/main_template.0017.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + + <script type="text/javascript"> + (function(){ var wrapperLib = document.createElement('script'); wrapperLib.async = true; wrapperLib.type = 'text/javascript'; var useSSL = 'https:' == document.location.protocol; wrapperLib.src = (useSSL ? 'https:' : 'http:') + '//js-sec.indexww.com/ht/p/183900-278584765944481.js'; var node = document.getElementsByTagName('script')[0]; node.parentNode.insertBefore(wrapperLib, node); } + )(); + </script> + + <!--MODERNIZR--> + <script src="/vendor/modernizr.2.7.1/modernizr.custom.95871.js"></script> + + <!--JS config--> + <script type="text/javascript"> + window.mwdata = {}; + window.mwdata.assetsDomain1 = 'http://www.merriam-webster.com/assets'; + window.mwdata.assetsDomain2 = 'http://www.merriam-webster.com/assets'; + window.mwdata.env = 'production'; + window.mwdata.ads = {"ad_slot_top":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_Dictionary\/DICT","id":"div-gpt-ad-781001946814165391-1","defSizes":[[728,90]],"targeting":[["POS",["TOP"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[728,90]]}]}},"ad_slot_left":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_Dictionary\/DICT","id":"div-gpt-ad-781001946814165391-2","defSizes":[[160,600]],"targeting":[["POS",["TOP"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[160,600]]}]}},"ad_slot_right_top":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_Dictionary\/DICT","id":"div-gpt-ad-781001946814165391-3","defSizes":[[300,250]],"targeting":[["POS",["TOP"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[300,250]]}]}},"ad_slot_right_bottom":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_Dictionary\/DICT","id":"div-gpt-ad-781001946814165391-4","defSizes":[[300,250]],"targeting":[["POS",["BOT"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[300,250]]}]}},"ad_slot_bottom":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_Dictionary\/DICT","id":"div-gpt-ad-781001946814165391-5","defSizes":[[728,90]],"targeting":[["POS",["BOT"]]],"sizeMappings":[{"screen":[0,0],"ads":[[320,50]]},{"screen":[768,100],"ads":[[728,90]]}]}}}; + window.mwdata.ads2 = {"ad_slot_top":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_REFRESH","id":"div-gpt-ad-152893562297167022-1","defSizes":[[728,90]],"targeting":[["POS",["TOP"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[728,90]]}]}},"ad_slot_left":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_REFRESH","id":"div-gpt-ad-152893562297167022-2","defSizes":[[160,600]],"targeting":[["POS",["TOP"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[160,600]]}]}},"ad_slot_right_top":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_REFRESH","id":"div-gpt-ad-152893562297167022-3","defSizes":[[300,250]],"targeting":[["POS",["TOP"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[300,250]]}]}},"ad_slot_right_bottom":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_REFRESH","id":"div-gpt-ad-152893562297167022-4","defSizes":[[300,250]],"targeting":[["POS",["BOT"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[300,250]]}]}},"ad_slot_bottom":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_REFRESH","id":"div-gpt-ad-152893562297167022-5","defSizes":[[728,90]],"targeting":[["POS",["BOT"]]],"sizeMappings":[{"screen":[0,0],"ads":[[320,50]]},{"screen":[768,100],"ads":[[728,90]]}]}}}; + window.mwdata.gatReady = false; + window.mwdata.gatQueue = []; + window.mwdata.tagsPrepped = []; + window.mwdata.gTagReady = false; + window.mwdata.dfpSvcUp = false; + window.mwdata.adsBlacklist = []; + window.mwdata.adsWhitelist = null; + </script> + <script> + // Willy: Need to move all this to AD Library + // get the browser's current window dimensions + function getWindowDimensions() { + var width = window.innerWidth || + document.documentElement.clientWidth || + document.body.clientWidth; + var height = window.innerHeight || + document.documentElement.clientHeight || + document.body.clientHeight; + return [width, height]; + } + + // given a size mapping like: [[[1000, 600], [[300, 250], [300,600]]],[[0,0], [[300,250]]]] + // return the valid size mapping as an array like: [[300,250]] when the screen dimensions + // are less than 1000 width and 600 height + function parseSizeMappings(sizeMappings) { + try{ + // get current window dimensions + var sd = getWindowDimensions(); + + // filter mappings that are valid by confirming that the current screen dimensions + // are both greater than or equal to the breakpoint [x, y] minimums specified in the first position in the mapping + var validMappings = sizeMappings.filter(function(m) {return m[0][0] <= sd[0] && m[0][1] <= sd[1]}); + + // return the leftmost mapping's sizes or an empty array + return validMappings.length > 0 ? validMappings[0][1] : []; + } catch (e) { + console.log('error parsing sizeMappings:'); + console.log(sizeMappings); + console.log(e); + // fallback to last size mapping supplied + return sizeMappings[ sizeMappings.length -1 ][1]; + } + } + + function updateADPOSNaming() { + var i,j,adPos, adSize; + var setPOSName = function(adData) { + if (Array.isArray(adData.sizeMap) && adData.sizeMap.length > 0) { + adSize = adData.sizeMap[0].toString().replace(",",""); + for (i = 0; i < adData.targeting.length; i++) { + if (adData.targeting[i][0].toUpperCase() === "POS") { + adPos = "L" + adSize + adData.targeting[i][1]; + adData.targeting[i][1] = [adPos]; + break; + } + } + } + } + for (i in window.mwdata.ads) { + setPOSName(window.mwdata.ads[i].data); + } + if (typeof(window.mwdata.ads2) === "object" && !Array.isArray(window.mwdata.ads2)) { + for (j in window.mwdata.ads2) { + setPOSName(window.mwdata.ads2[j].data); + } + } + } + + function createSizeMapping() { + try { + var sizeMap, sizeMap2, adData, adData2; + for (var i in window.mwdata.ads) { + adData = window.mwdata.ads[i].data; + sizeMap = []; + if (typeof(adData.sizeMappings) !== "undefined" && adData.sizeMappings.length > 0) { + adData.sizeMappings.reverse().forEach(function(adSize) { + sizeMap.push([adSize.screen,adSize.ads]); + }); + window.mwdata.ads[i].data.sizeMap = parseSizeMappings(sizeMap); + if (window.mwdata.ads[i].data.sizeMap.length === 0) { + window.mwdata.ads[i].data.sizeMap = adData.defSizes; + } + } + } + if (typeof(window.mwdata.ads2) === "object" && !Array.isArray(window.mwdata.ads2)) { + for (var j in window.mwdata.ads2) { + adData2 = window.mwdata.ads2[j].data; + sizeMap2 = []; + if (typeof(adData2.sizeMappings) !== "undefined" && adData2.sizeMappings.length > 0) { + adData2.sizeMappings.reverse().forEach(function(adSize) { + sizeMap2.push([adSize.screen,adSize.ads]); + }); + window.mwdata.ads2[j].data.sizeMap = parseSizeMappings(sizeMap2); + if (window.mwdata.ads2[j].data.sizeMap.length === 0) { + window.mwdata.ads2[j].data.sizeMap = adData2.defSizes; + } + } + } + } + + } catch (e) { + for (var i in window.mwdata.ads) { + window.mwdata.ads[i].data.sizeMap = window.mwdata.ads[i].data.defSizes; + } + for (var i in window.mwdata.ads) { + window.mwdata.ads2[i].data.sizeMap = window.mwdata.ads2[i].data.defSizes; + } + } + } + createSizeMapping(); + updateADPOSNaming(); + </script> + <!-- JS --> + <script type="text/javascript"> + googletag.cmd.push(function() { + if (typeof window.headertag === 'undefined' || window.headertag.apiReady !== true) { + window.headertag = googletag; + } + }); + </script> + <!-- async GPT TAG --> + <script async src="https://www.googletagservices.com/tag/js/gpt.js"></script> + + <script src="/vendor/requirejs.2.1.6/require.min.js"></script> + <script type="text/javascript"> + //The reason I use js for path construction here - Google reports crawl errors + var vnd = '/vendor/'; + var fwdsl = '/'; + requirejs.config({ + + enforceDefine: false, + paths: { + //Our modules + 'auth_messages': '/js/lib/assign_errors.0002', + 'adProcessor': '/js/lib/adProcessor.0001', + 'ads2Refresher': '/js/lib/ads2Refresher.0001', + 'uniqueId': '/js/lib/uniqueId.0001', + 'dynScript': '/js/lib/dynScript.0001', + + 'main': '/js/components/main.0001', + 'facebookApi': '/js/components/facebookApi.0001', + 'search': '/js/components/search.0001', + 'subscribeOverlay': '/js/lib/subscribeOverlay', + 'GDPR': '/js/lib/gdpr', + //Vendor modules + "jquery": vnd + 'jquery.1.10.2' + fwdsl + 'jquery.min', + "jquery.jqueryui": vnd + 'jquery-ui-1.10.3.custom' + fwdsl + 'js' + fwdsl + 'jquery-ui-1.10.3.custom.min', + "underscore": vnd + 'lodash_1.2.1' + fwdsl + 'lodash.min', + "jquery.event_drag": vnd + 'amodal_1.6.5' + fwdsl + 'jquery.event.drag.min', + "jquery.amodal": vnd + 'amodal_1.6.5' + fwdsl + 'amodal.min', + "jquery.blockui": vnd + 'blockui_2.6.1' + fwdsl + 'jquery.blockUI', + "bowser": vnd + 'bowser.0.3.1' + fwdsl + 'bowser.min', + "jquery.cookie": vnd + 'jquery_cookie_1.4.0' + fwdsl + 'jquery.cookie', + 'matchMedia': '/vendor/match-media/matchMedia', + + //non-AMDs + "twitter": '//platform.twitter.com/widgets', + "jquery.cycle2": vnd + 'cycle2' + fwdsl + 'jquery.cycle2.20130909.min', + "jquery.rrssb": vnd + 'rrssb.1.6.0' + fwdsl + 'js' + fwdsl + 'rrssb.min' + }, + shim: { + "jquery.cycle2": ['jquery'], + "jquery.event_drag": ['jquery'], + "jquery.amodal": ['jquery.event_drag'], + "jquery.jqueryui": ['jquery'], + "jquery.rrssb": ['jquery'] + } + }); + </script> + + + <script> + //JC: instantiating adProcessor + require(['adProcessor'], function(adProcessor) { + //JC: Initiating ad libraries (google slot lib, ) & initializing slots + adProcessor.prepareAdLibraries(); + + //JC: by default we use a black-list, white-list is only being used if provided (rare cases) + if (window.mwdata.adsWhitelist !== null) { + adProcessor.prepareOnlyTheseAdSlots(window.mwdata.adsWhitelist); + } else { + adProcessor.prepareAllAdSlotsExcept(window.mwdata.adsBlacklist); + } + }); + + //JC: lotami tracking + require(['dynScript'], function(dynScript) { + dynScript.load('//tags.crwdcntrl.net/c/6936/cc.js?ns=_cc6936', {id: 'LOTCC_6936'}, function() { + _cc6936.bcp(); + }); + }); + + //JC: Google analitics + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + ga('create', 'UA-296234-17', 'learnersdictionary.com'); + ga('send', 'pageview'); + </script> + </head> + <body class="arial_font"> + + <!--Facebook Api--> + <script>require(['facebookApi']);</script> + + <!--Wrapper--> + <div id="wrap_full"> + <div id="wrap_c"> + + <!--Central left--> + <div id="wrap_cl" class="ld_xs_hidden noprint"> + <div id = "brit_logo_container"> + <a href="http://www.britannica.com/" target="_blank"><img id="brit_logo" src="/images/logos/d_brit.0001.jpg" alt="An Encylopedia Britannica Company" /></a> + </div> + <div id = "logo"> + <a href="/"><img src="/images/logos/d_logo.0001.gif" alt="Learner's Dictionary Logo" /></a> + </div> + + + <div class="abl abl-m0-t160-d160 ld_xs_hidden"> + <div class="ad_slot_left" id="ad_slot_left"> + <script>require(['adProcessor'], function(ap) {ap.renderDfp('ad_slot_left');});</script> + </div> + </div> + </div> + + <!--Central right--> + <div id="wrap_cr"> + + <!--Mobile top--> + <div class="mobile_top noprint box_sizing ld_xs_visible ld_lg_hidden"> + + <div class="toppest"> + <!--Globe logo--> + <img src = "/images/logos/m_logo_h.0001.png" class = "globe_logo box_sizing"> + + <!--Main title--> + <div class = "main_title"> + <a class="tt" href="/">Learner's Dictionary</a> + <a class="tb" href="/">mobile search</a> + </div> + </div> + + <!--Search form + menu--> + <div class="ld_searchc_m_plusb_w box_sizing"> + <div class="ld_searchc_m_plusb box_sizing"> + + <!--Mobile menu: dropdown--> + <ul class="m_menu_ul box_sizing"> + <li class="home"> + <img src="/images/m_menu/ld_menu_icon_home_teal.png" /> + <a href="/">Home</a> + </li> + <li class="qa"> + <img src="/images/m_menu/ld_menu_icon_qa_teal.png" /> + <a href="/qa/post/latest">Ask the Editor</a> + </li> + <li class="wod"> + <img src="/images/m_menu/ld_menu_icon_cal_teal.png" /> + <a href="/word-of-the-day">Word of the Day</a> + </li> + <li class="quizzes ld_xs_hidden"> + <img src="/images/m_menu/ld_menu_icon_vocabquiz_teal.png" /> + <a href="/quizzes">Quizzes</a> + </li> + <li class="words_3000"> + <img src="/images/m_menu/ld_menu_icon_3k_teal.png" /> + <a href="/3000-words">Core Vocabulary</a> + </li> + <li class="saved"> + <img src="/images/m_menu/ld_menu_icon_star_teal.png" /> + <a href="/saved-words">My Saved Words</a> + </li> + <li class="login"> + <img src="/images/m_menu/ld_menu_icon_signout_teal.png" /> + <a href="/auth/login">Login</a> + </li> + </ul> + + <!--Mobile menu: search form--> + <div id = "ld_searchc_m" class="box_sizing"> + <div class="frm box_sizing"> + + <!--Mobile menu: menu button--> + <a href="#" class="m_menu_btn box_sizing"> + <i class="fa fa-bars"></i> + <div class="prick"></div> + </a> + + <!--Mobile menu: search container--> + <div class="ld_search_inp_c box_sizing"> + <input autocapitalize="off" type="text" name="ld_search_inp" class="box_sizing ld_search_inp_c ld_search_inp" maxlength="200" rows=1 data-placeholder="Search Learner's Dictionary..." value="house" /> + </div> + + <!--Mobile menu: search icon--> + <i class="fa fa-search fa-flip-horizontal search_btn box_sizing"></i> + + <!--Mobile menu: clear icon--> + <span class="clear_btn">&#215;</span> + + <!--Mobile menu: autocomplete holder--> + <div class="autocomplete_holder_m box_sizing"></div> + </div> + </div> + </div> + </div> + </div> + + + <!--Central right: top--> + <div id="wrap_cr_t" class="ld_xs_hidden noprint box_sizing"> + <div class="abl abl-m0-t728-d728 ld_xs_hidden"> + <div class="ad_slot_top" id="ad_slot_top"> + <script>require(['adProcessor'], function(ap) {ap.renderDfp('ad_slot_top');});</script> + </div> + </div> + </div> + + <!--Central right: bottom--> + <div id="wrap_cr_b" class="box_sizing"> + + <!--Central right: bottom: left column--> + <div id="wrap_cr_bl" class="box_sizing"> + + <!--Desktop top--> + <div class="desktop_top box_sizing ld_xs_hidden ld_lg_visible noprint"> + + <!--Top menu--> + <div class="section-links noprint"> + <ul> + <li class="ask_the_editor_link"> + <a class="nmlink" href="/qa/post/latest">Ask the Editor</a> + </li> + <li class="word_of_the_day_link"> + <a class="nmlink" href="/word-of-the-day">Word of the Day</a> + </li> + <li class="quizzes_link"> + <a class="nmlink" href="/quizzes">Quizzes</a> + </li> + <li class="words_3000_link"> + <a class="nmlink" href="/3000-words">Core Vocabulary</a> + </li> + <li class="most_popular_words_link"> + <a class="nmlink" href="/most-popular-words">Most Popular</a> + </li> + <li class="favorites_link"> + <a class="nmlink" href="/saved-words">My Saved Words</a> + </li> + <li class="login_link"> + <a href="/auth/login?redirect=%2Fsaved-words" class="login_btn">Log in</a> + </li> + </ul> + </div> + + <!--Main title--> + <div id = "main_title" class="georgia_font noprint"> + <a href="/">Learner's Dictionary</a> + </div> + + <!--Search form--> + <div id = "ld_searchc_d" class="box_sizing noprint"> + <div class="frm box_sizing"> + <input type="text" name="ld_search_inp" class="ld_search_inp box_sizing" maxlength="200" rows=1 data-placeholder="Search for definitions in simple English..." value="house" /> + <div class="autocomplete_holder_d"></div> + </div> + <button class="search_btn"></button> + </div> + </div> + + <!--Actual content --> + <!--CSS--> +<link href="/css/entries/all.0007.css" type="text/css" rel="Stylesheet" charset="utf-8" /> +<link href="/css/entries/definition.0025.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + +<!--HTML--> +<h1 id="ld_entries_v2_mainh" class="georgia_font box_sizing ld_xs_hidden"> + house</h1> + + <div id="ld_entries_v2_others_block" class="ld_xs_hidden box_sizing"> + <div class = "o_count"> + 54 ENTRIES FOUND: + </div> + <ul class="o_list verdana_font"> + <li> + <!--direct match--> + <!--no homograph--> + <a href="/definition/house" class="selected"><!-- + -->house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + + </li> + <li> + <!--direct match--> + <!--jumplink--> + <a href="#ld_entry_v2_jumplink_house_2" class="ld_entry_v2_jumplink"><!-- + -->house<!-- + --><!-- + --><span> (verb)</span><!-- + --><!-- + --></a> + + </li> + <li> + <!--indirect match--> + <a href="/definition/house–proud" class=""><!-- + -->house–proud<!-- + --><!-- + --><span> (adjective)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/house–sit" class=""><!-- + -->house–sit<!-- + --><!-- + --><span> (verb)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/house–to–house" class=""><!-- + -->house–to–house<!-- + --><!-- + --><span> (adjective)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/house–train" class=""><!-- + -->house–train<!-- + --><!-- + --><span> (verb)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/house–trained" class=""><!-- + -->house–trained<!-- + --><!-- + --><span> (adjective)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/house arrest" class=""><!-- + -->house arrest<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/house call" class=""><!-- + -->house call<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/house cat" class=""><!-- + -->house cat<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/house music" class=""><!-- + -->house music<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/house of cards" class=""><!-- + -->house of cards<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/House of Commons" class=""><!-- + -->House of Commons<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/House of Lords" class=""><!-- + -->House of Lords<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/House of Representatives" class=""><!-- + -->House of Representatives<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/house party" class=""><!-- + -->house party<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/art house" class=""><!-- + -->art house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/big house" class=""><!-- + -->big house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/chop house" class=""><!-- + -->chop house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/country house" class=""><!-- + -->country house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/crack house" class=""><!-- + -->crack house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/doll's house" class=""><!-- + -->doll's house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/doss–house" class=""><!-- + -->doss–house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/field house" class=""><!-- + -->field house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/full house" class=""><!-- + -->full house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/fun house" class=""><!-- + -->fun house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/halfway house" class=""><!-- + -->halfway house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/in–house" class=""><!-- + -->in–house<!-- + --><!-- + --><span> (adjective)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/lady of the house" class=""><!-- + -->lady of the house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/lodging house" class=""><!-- + -->lodging house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/man of the house" class=""><!-- + -->man of the house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/open house" class=""><!-- + -->open house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/opera house" class=""><!-- + -->opera house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/public house" class=""><!-- + -->public house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/ranch house" class=""><!-- + -->ranch house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/rooming house" class=""><!-- + -->rooming house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/row house" class=""><!-- + -->row house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/safe house" class=""><!-- + -->safe house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/settlement house" class=""><!-- + -->settlement house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/station house" class=""><!-- + -->station house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/steak house" class=""><!-- + -->steak house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/terraced house" class=""><!-- + -->terraced house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/town house" class=""><!-- + -->town house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/tract house" class=""><!-- + -->tract house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/treasure house" class=""><!-- + -->treasure house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/tree house" class=""><!-- + -->tree house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/Wendy house" class=""><!-- + -->Wendy house<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/White House" class=""><!-- + -->White House<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/clean" class=""><!-- + -->clean<!-- + --><!-- + --><span> (verb)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/fire" class=""><!-- + -->fire<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/glass" class=""><!-- + -->glass<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/keep" class=""><!-- + -->keep<!-- + --><!-- + --><span> (verb)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/order" class=""><!-- + -->order<!-- + --><!-- + --><span> (noun)</span><!-- + --><!-- + --></a> + </li> + <li> + <!--indirect match--> + <a href="/definition/set" class=""><!-- + -->set<!-- + --><!-- + --><span> (verb)</span><!-- + --><!-- + --></a> + </li> + </ul> + </div> + +<div id="ld_entries_v2_all"> + + <!--Save favorites button--> + <span class="save_faves faved_-" data-is_faved="-" data-remove_me="Saved" data-save_me="Save"> + <a href="#" class="txt"><!-- + -->Save<!-- + --></a> + <div class="save_faves_star"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></div> + </span> + + <!--HTML--> +<div class="entry entry_v2 boxy"> + + <!--Setting some placeholders--> + + <!--headword: desktop--> + <!--headword: desktop view--> +<div class = "hw_d hw_0 boxy m_hidden"> + <!--headword text--> + <span class = "hw_txt gfont"> + <sup class="homograph">1</sup> + house </span> + + <!--label: hsl--> + + <!--hprons--> + + + <span class = "hpron_word ifont">/<span class="smark">ˈ</span>haʊs/</span> + + + <a href = "#" class="fa fa-volume-up hpron_icon play_pron" data-word="house" data-dir="h" data-file="house001" data-pron="ˈhaʊs" data-lang="en_us"></a> + + <!--label: fl--> + <span class="fl">noun</span> + </div> + +<!--BOTTOM headword thingies (variations)--> + +<!--BOTTOM headword thingies (inflections)--> + <div class = "hw_infs_d m_hidden"> + <!--label: i_label--> + <span class = "i_label">plural</span> + +<!--inflection--> + <span class = "i_text">houses</span> + +<!--prons--> + <span class = "pron_w ifont">/<span class="smark">ˈ</span>haʊzəz/</span> + <a href = "#" class="fa fa-volume-up pron_i play_pron" data-word="hous&#x2A;es" data-dir="h" data-file="house002" data-pron="ˈhaʊzəz" data-lang="en_us"></a> </div> + + <!--headword: mobile--> + <!--headword: mobile view--> +<div class = "hw_m hw_0 boxy d_hidden"> + + <!--h_m: hw line--> + <div class = "hw_line"> + <!--headword text--> + <span class = "hw_txt"> + <sup class="homograph">1</sup> + house </span> + + <!--label: hsl--> + + <!--audio icons--> + <a href = "#" class="fa fa-volume-up hpron_icon play_pron" data-word="house" data-dir="h" data-file="house001" data-pron="ˈhaʊs" data-lang="en_us"></a> + </div> + + <!--h_m: text prons--> + <div class = "text_prons"> + + <span class = "hpron_word ifont">/<span class="smark">ˈ</span>haʊs/</span> + + </div> + + <!--label: fl--> + <div class="fl">noun</div> + </div> + +<!--BOTTOM headword thingies (variations)--> + +<!--BOTTOM headword thingies (inflections)--> + <div class = "hw_infs_m d_hidden"> + <!--label: i_label--> + <span class = "i_label">plural</span> + +<!--inflection--> + <span class = "i_text">houses</span> + +<!--prons--> + <span class = "pron_w ifont">/<span class="smark">ˈ</span>haʊzəz/</span> + <a href = "#" class="fa fa-volume-up pron_i play_pron" data-word="hous&#x2A;es" data-dir="h" data-file="house002" data-pron="ˈhaʊzəz" data-lang="en_us"></a> </div> + + <!--Definition header--> + <div class="dline m_hidden"> + <span class="vfont">Learner&#039;s definition of HOUSE</span> + </div> + + <!--cxs--> + + <!--dxs--> + + <!--snote|snotebox--> + + <!--entire entry labels--> + + <!--sense blocks--> + <div class = "sblocks"> + <div class = "sblock sblock_entry"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">1&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + <strong class="sn_letter">a&nbsp;</strong> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + <span class = "sgram">[<span class = "sgram_internal">count</span>]</span> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">a building in which a family lives</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">Would you like to come to my <em class="mw_spm_it">house</em> for dinner?</div> + </li> <li class = "vi"> + <div class="vi_content">a two-family <em class="mw_spm_it">house</em></div> + </li> <li class = "vi"> + <div class="vi_content">I spent the weekend just puttering around the <em class="mw_spm_it">house</em>.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + <!--un_text--> + &#8212; <span class = "un_text">often used before another noun</span> + +<!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content"><em class="mw_spm_it">house</em> pets/plants</div> + </li> <li class = "vi"> + <div class="vi_content">a <em class="mw_spm_it">house</em> guest</div> + </li> <li class = "vi"> + <div class="vi_content"><em class="mw_spm_it">house</em> parties</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + <!--uds--> + </div> <div class="sense"> + <!--sense letter--> + <strong class="sn_letter">b&nbsp;</strong> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + <span class = "sgram">[<span class = "sgram_internal">singular</span>]</span> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">the people who live in a house</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">He made enough noise to wake the whole <em class="mw_spm_it">house</em>.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> <div class = "sblock sblock_entry"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">2&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + <span class="sgram">[<span class="sgram_internal">count</span>]</span> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + <strong class="sn_letter">a&nbsp;</strong> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">a structure or shelter in which animals are kept</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + + <span class = "dxs dxs_nonl"> + &#8212; + <span class = "dx"> + see also <a href ='/definition/birdhouse' class='dx_link'>birdhouse</a>, <a href ='/definition/doghouse' class='dx_link'>doghouse</a>, <a href ='/definition/henhouse' class='dx_link'>henhouse</a> </span> + </span> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + <!--uds--> + </div> <div class="sense"> + <!--sense letter--> + <strong class="sn_letter">b&nbsp;</strong> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">a building in which something is stored</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">a carriage <em class="mw_spm_it">house</em></div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + + <span class = "dxs dxs_nonl"> + &#8212; + <span class = "dx"> + see also <a href ='/definition/boathouse' class='dx_link'>boathouse</a>, <a href ='/definition/warehouse' class='dx_link'>warehouse</a> </span> + </span> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + <!--uds--> + </div> </div> + </div> +</div> <div class = "sblock sblock_entry"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">3&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + <span class = "sgram">[<span class = "sgram_internal">count</span>]</span> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">a building where students or members of a religious group live</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">a fraternity <em class="mw_spm_it">house</em></div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> <div class = "sblock sblock_entry"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">4&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + <strong class="sn_letter">a&nbsp;</strong> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + <span class = "sgram">[<span class = "sgram_internal">count</span>]</span> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">a group of people who meet to discuss and make the laws of a country</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">The bill has been approved by both <em class="mw_spm_it">houses</em> of Congress.</div> + </li> <li class = "vi"> + <div class="vi_content">The two <em class="mw_spm_it">houses</em> of the U.S. Congress are the Senate [=the upper house] and the House of Representatives. [=the lower house]</div> + </li> <li class = "vi"> + <div class="vi_content">The two <em class="mw_spm_it">houses</em> of the British Parliament are the House of Lords [=the upper house] and the House of Commons. [=the lower house]</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> <div class="sense"> + <!--sense letter--> + <strong class="sn_letter">b&nbsp;</strong> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + <span class="bnote">the House</span> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + <span class = "isyns"> + <a href = '/definition/house of representatives' class = 'isyn_link'>house of representatives</a> </span> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">They hope to win enough seats in the election to regain control of <em class="mw_spm_it">the House</em>.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + + <span class = "dxs dxs_nonl"> + &#8212; + <span class = "dx"> + see also <a href ='/definition/house of commons' class='dx_link'>house of commons</a>, <a href ='/definition/house of lords' class='dx_link'>house of lords</a> </span> + </span> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + <!--uds--> + </div> </div> + </div> +</div> <div class = "sblock sblock_entry"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">5&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + <span class="sgram">[<span class="sgram_internal">count</span>]</span> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + <strong class="sn_letter">a&nbsp;</strong> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">a specified kind of business</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">a publishing <em class="mw_spm_it">house</em></div> + </li> <li class = "vi"> + <div class="vi_content">fashion <em class="mw_spm_it">houses</em></div> + </li> <li class = "vi"> + <div class="vi_content">an investment banking <em class="mw_spm_it">house</em></div> + </li> <li class = "vi"> + <div class="vi_content">a brokerage <em class="mw_spm_it">house</em></div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> <div class="sense"> + <!--sense letter--> + <strong class="sn_letter">b&nbsp;</strong> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">a place or building where a specified kind of activity or entertainment occurs</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">an auction <em class="mw_spm_it">house</em></div> + </li> <li class = "vi"> + <div class="vi_content">a <span class="mw_spm_phrase">house of God/worship</span> [=a place, such as a church, where people go for religious services]</div> + </li> <li class = "vi"> + <div class="vi_content">(<em class="mw_spm_it">US</em>) a <span class="mw_spm_phrase">movie house</span> [=a cinema, (<em class="mw_spm_it">US</em>) a movie theater]</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">a place where an illegal activity occurs</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">a gambling <em class="mw_spm_it">house</em></div> + </li> <li class = "vi"> + <div class="vi_content">a <em class="mw_spm_it">house</em> of prostitution</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + + <span class = "dxs dxs_nonl"> + &#8212; + <span class = "dx"> + see also <a href ='/definition/opera house' class='dx_link'>opera house</a> </span> + </span> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + <!--uds--> + </div> <div class="sense"> + <!--sense letter--> + <strong class="sn_letter">c&nbsp;</strong> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">a particular kind of restaurant</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">We had dinner at the local fish <em class="mw_spm_it">house</em>.</div> + </li> <li class = "vi"> + <div class="vi_content">a seafood <em class="mw_spm_it">house</em></div> + </li> <li class = "vi"> + <div class="vi_content">Oyster stew is a <span class="mw_spm_phrase">specialty of the house</span>. [=a special dish that is featured in a restaurant]</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + <span class = "snote"> + + <!--snote text--> + <div class = "both_text"> + ◊ A <span class="mw_spm_phrase">house wine</span> is a basic wine that is always available in a restaurant. A <span class="mw_spm_phrase">house salad</span> and a <span class="mw_spm_phrase">house (salad) dressing</span> are the regular salad and dressing in a U.S. restaurant. </div> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">Would you like the <em class="mw_spm_it">house salad</em> or a spinach salad?</div> + </li> <li class = "vi"> + <div class="vi_content">The <em class="mw_spm_it">house dressing</em> is a creamy vinaigrette.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + </span> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + + <span class = "dxs dxs_nonl"> + &#8212; + <span class = "dx"> + see also <a href ='/definition/coffeehouse' class='dx_link'>coffeehouse</a>, <a href ='/definition/steak house' class='dx_link'>steak house</a> </span> + </span> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + <!--uds--> + </div> </div> + </div> +</div> <div class = "sblock sblock_entry"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">6&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + <span class = "sgram">[<span class = "sgram_internal">count</span>]</span> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">the audience in a theater or concert hall</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">They had a full/packed <em class="mw_spm_it">house</em> on opening night.</div> + </li> <li class = "vi"> + <div class="vi_content">When the movie ended, <span class="mw_spm_phrase">there wasn&#039;t a dry eye in the house</span>. [=everyone had tears in their eyes]</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + <span class = "snote"> + + <!--snote text--> + <div class = "both_text"> + ◊ To <span class="mw_spm_phrase">bring down the house</span> or to <span class="mw_spm_phrase">bring the house down</span> is to get great approval and applause or laughter from an audience. </div> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">His performance <em class="mw_spm_it">brought down the house</em> night after night.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + </span> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + <!--uds--> + </div> </div> + </div> +</div> <div class = "sblock sblock_entry"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">7&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + <span class="bnote">House</span> + + <!--slb--> + + <!--label: sgram--> + <span class = "sgram">[<span class = "sgram_internal">count</span>]</span> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">a royal or noble family including ancestors and all the people who are related to them</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">the <em class="mw_spm_it">House</em> of Tudor</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> <div class = "sblock sblock_entry"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">8&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + <span class = "sgram">[<span class = "sgram_internal">noncount</span>]</span> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">a type of electronic dance music with a heavy, regular beat</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + <div class = "cas"> + &#8212; <span class="cas_h">called also</span> + <span class="ca_text">house music</span> </div> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + <!--uds--> + </div> </div> + </div> +</div> </div> + + <!--snote|snotebox--> + + <!--dros--> + <div class = "dros"> + <div class ="dro" data-id="4349"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">clean house</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + <span class = "sl">US</span> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + <!--snote|snotebox--> + + <!--sense blocks--> + <div class = "sblocks"> + <div class = "sblock sblock_dro"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">1&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">to clean the floors, furniture, etc., inside a house</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">He <em class="mw_spm_it">cleans house</em> on Tuesdays.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> <div class = "sblock sblock_dro"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">2&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">to make important basic changes in an organization, business, etc., in order to correct problems</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">After the corruption was revealed, the police chief decided it was time to <em class="mw_spm_it">clean house</em>.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> </div> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="4350"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">(from) house to house</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + <!--snote|snotebox--> + + <!--sense blocks--> + <div class = "sblocks"> + <div class = "sblock sblock_dro"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + <span class = "snote"> + + <!--snote text--> + <div class = "both_text"> + ◊ If you go <em class="mw_spm_it">(from) house to house</em>, you go to each house or apartment in an area and do or ask for something. </div> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">Volunteers went <em class="mw_spm_it">from house to house</em> asking for donations.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + </span> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + + <span class = "dxs dxs_nonl"> + &#8212; + <span class = "dx"> + see also <a href ='/definition/house-to-house' class='dx_link'>house-to-house</a> </span> + </span> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + <!--uds--> + </div> </div> + </div> +</div> </div> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="4351"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">house in order</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + <!--snote|snotebox--> + + <!--sense blocks--> + <div class = "sblocks"> + <div class = "sblock sblock_dro"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + <span class = "snote"> + + <!--snote text--> + <div class = "both_text"> + ◊ To put/get/set (etc.) your <em class="mw_spm_it">house in order</em> is to improve or correct the way you do things. </div> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">We should <em class="mw_spm_it">get our</em> (own) <em class="mw_spm_it">house in order</em> before we criticize others for their mistakes.</div> + </li> <li class = "vi"> + <div class="vi_content">The company needs to <em class="mw_spm_it">get its financial house in order</em>. [=to correct its financial problems]</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + </span> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + <!--uds--> + </div> </div> + </div> +</div> </div> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="4352"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">keep house</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + <!--snote|snotebox--> + + <!--sense blocks--> + <div class = "sblocks"> + <div class = "sblock sblock_dro"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">to do the work that is needed to take care of a house</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">When I started living on my own I had no idea how to cook or <em class="mw_spm_it">keep house</em>.</div> + </li> <li class = "vi"> + <div class="vi_content">You need someone to <em class="mw_spm_it">keep house</em> for you.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + + <span class = "dxs dxs_nonl"> + &#8212; + <span class = "dx"> + see also <a href ='/definition/housekeeper' class='dx_link'>housekeeper</a>, <a href ='/definition/housekeeping' class='dx_link'>housekeeping</a> </span> + </span> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + <!--uds--> + </div> </div> + </div> +</div> </div> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="4353"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">like a house on fire</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + <span class = "sl">informal</span> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + <!--snote|snotebox--> + + <!--sense blocks--> + <div class = "sblocks"> + <div class = "sblock sblock_dro"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">extremely well</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">Those two got on/along <em class="mw_spm_it">like a house on fire</em>. [=they liked each other very much]</div> + </li> <li class = "vi"> + <div class="vi_content">(<em class="mw_spm_it">US</em>) The business started out <em class="mw_spm_it">like a house on fire</em>. [=the business started very successfully]</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> </div> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="4354"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">on the house</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + <!--snote|snotebox--> + + <!--sense blocks--> + <div class = "sblocks"> + <div class = "sblock sblock_dro"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">without charge</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + <span class = "isyns"> + <a href = '/definition/free' class = 'isyn_link'>free</a> </span> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">The drinks are <em class="mw_spm_it">on the house</em>.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> </div> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="4355"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">people who live in glass houses shouldn&#039;t throw stones</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + + <span class = "dxs dxs_nonl"> + &#8212; + <span class = "dx"> + see <a href = '/definition/glass[1]' class='dx_link'><sup>1</sup>glass</a> </span> + </span> + + <!--snote|snotebox--> + + <!--sense blocks--> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="4356"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">play house</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + <!--snote|snotebox--> + + <!--sense blocks--> + <div class = "sblocks"> + <div class = "sblock sblock_dro"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + <span class = "snote"> + + <!--snote text--> + <div class = "both_text"> + ◊ When children <em class="mw_spm_it">play house</em> they pretend that they are adults and that they are doing the things that adults do in a house, such as cooking and serving food. </div> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">She always loved <em class="mw_spm_it">playing house</em> with her little sister.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + </span> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + <!--uds--> + </div> </div> + </div> +</div> </div> + + <!--snote|snotebox--> + </div> <div class ="dro" data-id="4357"> + + <div class="dro_line"> + <!--dre--> + <h2 class ="dre">set up house</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--phrasal verbs--> + + <!--label: gram--> + + <!--label: def_gram--> + + <!--label: def_sl--> + + <!--prons--> + + <!--variations--> + </div> + + <!--dxs--> + + <!--snote|snotebox--> + + <!--sense blocks--> + <div class = "sblocks"> + <div class = "sblock sblock_dro"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">to become settled in a house where you are going to live</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">They moved to California and <em class="mw_spm_it">set up house</em> in a suburb of Los Angeles.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> </div> + + <!--snote|snotebox--> + </div> </div> + + <!--dxs--> + + <!--uros--> + <div class = "uros"> + <div class ="uro"> + + <div class="uro_line"> + <!--ure--> + <h2 class = "ure" >&#8212; houseful</h2> + + <!--label: rsl (Madeline says must be after bold term)--> + + <!--prons--> + <span class = "pron_w ifont">/<span class="smark">ˈ</span>haʊsˌfʊl/</span> + <a href = "#" class="fa fa-volume-up pron_i play_pron" data-word="house&#x2A;ful" data-dir="h" data-file="house003" data-pron="ˈhaʊsˌfʊl" data-lang="en_us"></a> + <!--variations--> + + + <!--label: fl--> + <span class = "fl">noun<span class="comma">,</span></span> + + <!--lb--> + + <!--inflections--> + <!--label: i_label--> + <span class = "i_label">plural</span> + +<!--inflection--> + <span class = "i_text">housefuls</span> + +<!--prons--> + + <!--label: sl--> + + <!--label: gram--> + <span class = "gram">[<span class = "gram_internal">count</span>]</span> + </div> + + <!--uro definitions--> + <div class = "uro_def"> + <div class = "uro_def"> + + <!--wsgram--> + + <!--directional cross references--> + + <!--usage note--> + + <!--snote|snotebox--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">a <em class="mw_spm_it">houseful</em> of guests</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + </div> </div> + </div> </div> + + <!--synonym paragraphs --> + + <!--arts--> + <div class = "arts"> + <div class = "art boxy"><img src='http://www.merriam-webster.com/assets/ld/images/legacy_print_images/house_rev.gif' class='boxy' /></div> + </div> + </div> <!--HTML--> +<div class="entry entry_v2 boxy" id = 'ld_entry_v2_jumplink_house_2'> + + <!--Setting some placeholders--> + + <!--headword: desktop--> + <!--headword: desktop view--> +<div class = "hw_d hw_1 boxy m_hidden"> + <!--headword text--> + <span class = "hw_txt gfont"> + <sup class="homograph">2</sup> + house </span> + + <!--label: hsl--> + + <!--hprons--> + + + <span class = "hpron_word ifont">/<span class="smark">ˈ</span>haʊz/</span> + + + <a href = "#" class="fa fa-volume-up hpron_icon play_pron" data-word="house" data-dir="h" data-file="house005" data-pron="ˈhaʊz" data-lang="en_us"></a> + + <!--label: fl--> + <span class="fl">verb</span> + </div> + +<!--BOTTOM headword thingies (variations)--> + +<!--BOTTOM headword thingies (inflections)--> + <div class = "hw_infs_d m_hidden"> + <!--label: i_label--> + +<!--inflection--> + <span class = "i_text">houses<span class="semicolon">;</span></span> + +<!--prons--> + <!--label: i_label--> + +<!--inflection--> + <span class = "i_text">housed<span class="semicolon">;</span></span> + +<!--prons--> + <!--label: i_label--> + +<!--inflection--> + <span class = "i_text">housing</span> + +<!--prons--> + </div> + + <!--headword: mobile--> + <!--headword: mobile view--> +<div class = "hw_m hw_1 boxy d_hidden"> + + <!--h_m: hw line--> + <div class = "hw_line"> + <!--headword text--> + <span class = "hw_txt"> + <sup class="homograph">2</sup> + house </span> + + <!--label: hsl--> + + <!--audio icons--> + <a href = "#" class="fa fa-volume-up hpron_icon play_pron" data-word="house" data-dir="h" data-file="house005" data-pron="ˈhaʊz" data-lang="en_us"></a> + </div> + + <!--h_m: text prons--> + <div class = "text_prons"> + + <span class = "hpron_word ifont">/<span class="smark">ˈ</span>haʊz/</span> + + </div> + + <!--label: fl--> + <div class="fl">verb</div> + </div> + +<!--BOTTOM headword thingies (variations)--> + +<!--BOTTOM headword thingies (inflections)--> + <div class = "hw_infs_m d_hidden"> + <!--label: i_label--> + +<!--inflection--> + <span class = "i_text">houses<span class="semicolon">;</span></span> + +<!--prons--> + <!--label: i_label--> + +<!--inflection--> + <span class = "i_text">housed<span class="semicolon">;</span></span> + +<!--prons--> + <!--label: i_label--> + +<!--inflection--> + <span class = "i_text">housing</span> + +<!--prons--> + </div> + + <!--Definition header--> + <div class="dline m_hidden"> + <span class="vfont">Learner&#039;s definition of HOUSE</span> + </div> + + <!--cxs--> + + <!--dxs--> + + <!--snote|snotebox--> + + <!--entire entry labels--> + <div class = "labels"> + <!--lb--> + + <!--label: gram--> + <span class = "gram">[<span class = "gram_internal">+ object</span>]</span> + + <!--label: sl--> + </div> + + <!--sense blocks--> + <div class = "sblocks"> + <div class = "sblock sblock_entry"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">1&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">to provide shelter or a living space for (someone)</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">More prisons are needed to <em class="mw_spm_it">house</em> the growing number of inmates.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + <!--un_text--> + &#8212; <span class = "un_text">often used as <em class="mw_spm_it">(be) housed</em></span> + +<!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">The soldiers <em class="mw_spm_it">were housed</em> in poorly heated huts.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + <!--uds--> + </div> </div> + </div> +</div> <div class = "sblock sblock_entry"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">2&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">to be a shelter for (something)</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">to store or contain (something)</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">The museum <em class="mw_spm_it">houses</em> an impressive collection of jewels.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + <!--un_text--> + &#8212; <span class = "un_text">often used as <em class="mw_spm_it">(be) housed</em></span> + +<!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">The paintings <em class="mw_spm_it">are</em> now <em class="mw_spm_it">housed</em> in the National Gallery.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + <!--uds--> + </div> </div> + </div> +</div> <div class = "sblock sblock_entry"> + + <!--actual sense block content--> + <div class="sblock_c"> + + <!--sense block number (if any)--> + <strong class="sn_block_num">3&nbsp;</strong> + + <!--senses--> + <div class = "scnt"> + + <!--sense block labels (if any)--> + <div class = "sblock_labels"> + + <!--prons--> + + <!--bnote--> + + <!--slb--> + + <!--phrasal verbs--> + + <!--sgram--> + + <!--ssla--> + + <!--variations--> + + <!--inflections--> + </div> + + <div class="sense"> + <!--sense letter--> + + <!--sense labels--> + + <!--phrasal verbs--> + + <!--sd--> + + <!--bnote--> + + <!--slb--> + + <!--label: sgram--> + + <!--label: ssla--> + + <!--variations--> + + <!--inflections--> + + <!--definition sequence--> + <!--definition labels--> + + + <!--bc mark--> + <span class="bc">:</span> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + <span class="def_text">to surround or enclose (something) in order to protect it</span> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + + + <!--bc mark--> + + <!--inline synonyms--> + + <!--definition_text--> + + <!--usage note--> + + <!--snote--> + + <!--called also--> + + <!--directional cross references--> + + <!--link to a page with synonym paragraph--> + + <!--link to a page with usage discussion--> + + <!--verbal illustrations--> + <div class = "vis_w"> + <ul class = "vis collapsed"> + <li class = "vi"> + <div class="vi_content">The carpenter built casing to <em class="mw_spm_it">house</em> the hot water pipes.</div> + </li> </ul> + <div class = "vi_more d_hidden"> + <a href="#"> + <span class="d_p">[+] more examples</span> + <span class="d_m">[-] hide examples</span> + <span class="m_p">[+] Example sentences</span> + <span class="m_m">[-] Hide examples</span> + </a> + </div> + </div> + + <!--uds--> + </div> </div> + </div> +</div> </div> + + <!--snote|snotebox--> + + <!--dros--> + + <!--dxs--> + + <!--uros--> + + <!--synonym paragraphs --> + + <!--arts--> + </div> + <!--Comments and questions header--> + <div class="comments_h_initial_d ld_xs_hidden margin_top_1_3_em margin_bottom_1_3_em"><span class="verdana_font"><i class="fa fa-comments-o"></i> Comments & Questions</span></div> + <div class="comments_h_initial_m ld_lg_hidden"><i class="fa fa-comments-o"></i> Comments & Questions</div> + <div class = "comments"> + <div class = "comments_intro"> + What made you want to look up <span class="mw_spm_it">house</span>? + Include any comments and questions you have about this word. + </div> + <div class = "comments_d"> + <div id="disqus_thread"></div> + <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> + </div> + </div> +</div> + +<!--JAVASCRIPT--> +<script type="text/javascript"> + var disqusEntryId = 'disqus_identifier_ld_v2_house\x5B1\x5D_az'; + var saveMe = false; + var bestMatch = {"dict_type":"az","hw_text_no_syllables":"house","eidNH":"house","eid":"house[1]","uid":"house[1]_az","isv2":false,"hw_homograph":"1","fl":"noun","search_type":"hw","search_value":"house"}; + require(['search'], function(search) { + search.init(disqusEntryId, saveMe, bestMatch); + }); +</script> </div> + + <!--Central right: bottom: right column--> + <div id="wrap_cr_br" class="box_sizing ld_xs_hidden noprint"> + + <div class="abl abl-m0-t300-d300 ld_xs_hidden"> + <div class="ad_slot_right_top" id="ad_slot_right_top"> + <script>require(['adProcessor'], function(ap) {ap.renderDfp('ad_slot_right_top');});</script> + </div> + </div> + + <div id = "wrap_rbr_c" class="box_sizing"> + <!-- CSS --> +<link href="/css/qa/siderail.0001.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + +<!-- HTML --> +<div id="qa_siderail"> + + <!--header--> + <div class="area_header verdana_font margin_bottom_10"> + ASK THE EDITOR + </div> + + <!--content--> + <table class="cont"> + <tr> + <td class="qa_content_l"> + <a href="/qa/When-to-Capitalize-Nouns" title=""> + <img src="http://www.merriam-webster.com/assets/ld/old_authors/50903/100x100e.jpeg" alt="" /> + </a> + </td> + <td class="qa_content_r"> + <div class="question"> + <a class="arial_font" href="/qa/When-to-Capitalize-Nouns" title="Question text">What types of nouns are always capitalised?</a> + </div> + + <div class="find_answer"> + <a href="/qa/When-to-Capitalize-Nouns" class="helvetica_font">See the answer &#187;</a> + </div> + </td> + </tr> + </table> +</div> <!-- CSS --> +<link href="/css/quizzes/siderail.0001.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + +<!-- HTML --> +<div id="quizzes_r"> + + <!--header--> + <div class="area_header verdana_font margin_bottom_10"> + LEARNER'S QUIZZES + </div> + + <!--content--> + <div class="main_content"> + <div class="feature_quiz"> + <div class="quiz_icon"> + <a href="/quiz/vocabulary-start"><img src="/images/quizzes/vocabulary-quiz-70x55.gif" alt="Vocabulary Quiz Icon" /></a> + </div> + <div class="quiz_content"> + <div class="title georgia_font"> + <a href="/quiz/vocabulary-start">Vocabulary Quiz</a> + </div> + <div class="descr"> + <a href="/quiz/vocabulary-start">Test your word power</a> + </div> + <div class="passthru_url"> + <a href="/quiz/vocabulary-start">Take the Quiz &raquo;</a> + </div> + </div> + </div> + + <div class="athletics-dots margin_top_4 margin_bottom_8"></div> + + <div class="feature_quiz"> + <div class="quiz_icon"> + <a href="/quiz/name-that-thing-pick"><img src="/images/quizzes/name-that-thing-70x55.gif" alt="Name That Thing Icon" /></a> + </div> + <div class="quiz_content"> + <div class="title georgia_font"> + <a href="/quiz/name-that-thing-pick">Name That Thing</a> + </div> + <div class="descr"> + <a href="/quiz/name-that-thing-pick">Take our visual quiz</a> + </div> + <div class="passthru_url"> + <a href="/quiz/name-that-thing-pick">Test Your Knowledge &raquo;</a> + </div> + </div> + </div> + </div> +</div> <!-- CSS --> +<link href="/css/wod/siderail.0001.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + +<!-- HTML --> +<div id="wod_siderail"> + + <!--header--> + <div class="area_header verdana_font margin_bottom_10"> + LEARNER'S WORD OF THE DAY + </div> + + <!--content--> + <table class="cont"> + <tr> + <td class="qa_content_l"> + <a href="/word-of-the-day" title=""> + <img src="http://assets.merriam-webster.com/ld/word_of_the_day/images/3583/thumb.jpg" alt="Primarily&#x20;Illustration" /> + </a> + </td> + <td class="qa_content_r"> + <div class="word georgia_font"> + <a href="/word-of-the-day" title="primarily"> + primarily </a> + </div> + + <div class="blurb"> + <a href="/word-of-the-day" title="&#x7B;bc&#x7D;&#x20;used&#x20;to&#x20;indicate&#x20;the&#x20;main&#x20;purpose&#x20;of&#x20;something,&#x20;reason&#x20;for&#x20;something,&#x20;etc."><strong class="mw_spm_bc">:</strong> used to indicate the main purpose of something, reason for something, etc.</a> + </div> + + <div class="learn_more"> + <a href="/word-of-the-day" class="helvetica_font">Learn More &#187;</a> + </div> + </td> + </tr> + </table> +</div> + +<!-- JAVASCRIPT --> +<script type="text/javascript"> + require(['underscore', 'jquery'], function(_) { + }); +</script> </div> + + <div class="abl abl-m0-t300-d300 ld_xs_hidden"> + <div class="ad_slot_right_bottom" id="ad_slot_right_bottom"> + <script>require(['adProcessor'], function(ap) {ap.renderDfp('ad_slot_right_bottom');});</script> + </div> + </div> + </div> + + <!--Central right: bottom: clearing column floats--> + <div style = "clear:both;"></div> + </div> + </div> + + <!--Central: clearing column floats--> + <div style = "clear:both;"></div> + + <!--Footer:--> + <div id="wrap_cf" class="box_sizing noprint"> + <div id="footer" class="box_sizing"> + <div class="offerings_top ld_xs_hidden"> + <div class="offer1 ind_offer"> + <div class="featTitle"> + The Merriam-Webster <br> Unabridged Dictionary + </div> + + <div class="featImage_1"> + <a href="https://unabridged.merriam-webster.com/subscriber/register?refc=SIGNUP_LEARNERS" > + <img src="/images/promos/unabridged-promo.gif" alt="Merriam-Webster Unabridged Book Cover" /> + </a> + </div> + + <div class="featDescr"> + Online access to a <br> legendary resource <br> <a href="https://unabridged.merriam-webster.com/subscriber/login">Log In</a> or <a href="https://unabridged.merriam-webster.com/subscriber/register?refc=SIGNUP_LEARNERS">Sign Up&nbsp;»</a> + </div> + </div> + + <div class="offer2 ind_offer"> + <div class="featTitle"> + Learning Spanish? + <br>We can help + </div> + + <div class="featImage_2"> + <a href="http://www.learnersdictionary.com/"> + <img src="/images/logos/sc_logo_0004.gif" alt="Learner's Dictionary Book Cover" /> + </a> + </div> + + <div class="featDescr"> + Visit our free site designed <br> especially for learners and <br> teachers of Spanish <br> <a href="http://www.spanishcentral.com/">SpanishCentral.com&nbsp;»</a> + </div> + </div> + + <div class="offer3 ind_offer"> + <div class="featImage_3"> + <a href="http://www.merriam-webster.com/dictionary-apps/android-ipad-iphone-windows.htm"> + <img src="/images/promos/iphone-app-woman-with-cell.jpg" alt="Woman With Cell Phone" /> + </a> + </div> + + <div class="featTitle"> + Our Dictionary, <br> On Your Devices + </div> + + <div class="featDescr"> + Merriam-Webster, <br> <em>With Voice Search</em> <br> <a href="http://www.merriam-webster.com/dictionary-apps/android-ipad-iphone-windows.htm">Get the Free Apps! »</a> + </div> + </div> + + <div class="offer4 ind_offer"> + <div class="featTitle"> + Merriam-Webster's <br> Visual Dictionaries + </div> + + <div class="featImage_4"> + <a href="http://www.merriam-webster.com/shop/products/books/visual-dictionary-second-edition.htm"> + <img src="/images/promos/visual-dictionary-promo.gif" border="0" alt="Visual Dictionary Book Cover" /> + </a> + </div> + + <div class="featDescr"> + The new edition of the <br> remarkable reference <br> features 8,000 <br> illustrations. <br> <a href="http://www.merriam-webster.com/shop/products/books/visual-dictionary-second-edition.htm">Learn More »</a> + </div> + </div> + </div> + + <!--Footer: ad area--> + <div class="ad_holder"> + <div class="abl abl-m320-t728-d728"> + <div class="ad_slot_bottom" id="ad_slot_bottom"> + <script>require(['adProcessor'], function(ap) {ap.renderDfp('ad_slot_bottom');});</script> + </div> + </div> + </div> + + <!--The rest of the footer--> + <div class="offerings_bottom ld_xs_hidden"> + <div class="offer5 ind_offer"> + <div class="featTitle"> + Join Us + </div> + + <div class="twitter"> + <div class="twLogo"> + <a href="https://twitter.com/MWforLearners"><img src="/images/social/twitter-logo.png"></a> + </div> + <div class="twDescr"> + <a href="https://twitter.com/MWforLearners">Learner's Dictionary<br>on Twitter&nbsp;»</a> + </div> + </div> + + <div class="facebook"> + <div class="fbLogo"> + <a href="https://www.facebook.com/learnersdictionary"><img src="/images/social/facebook-logo.png"></a> + </div> + <div class="fbDescr"> + <a href="https://www.facebook.com/learnersdictionary">Learner's Dictionary<br>on Facebook&nbsp;»</a> + </div> + </div> + </div> + + <div class="offer6 ind_offer"> + <div class="featTitle"> + Bookstore: Digital and Print + </div> + <div class="bookstoreDescr"> + Merriam-Webster references for Mobile, Kindle, print, and more. <a href="http://www.merriam-webster.com/shop/index.htm">See all&nbsp;»</a> + </div> + </div> + + <div class="offer7 ind_offer"> + <div class="featTitle"> + Other Merriam-Webster Dictionaries + </div> + + <div class="dictURLs_1"> + <a href="http://unabridged.merriam-webster.com">Webster's Unabridged Dictionary&nbsp;»</a> + <a href="http://arabic.britannicaenglish.com/en">Britannica English - Arabic Translation&nbsp;»</a> + <a href="http://www.nglish.com/spanish">Nglish - Spanish-English Translation&nbsp;»</a> + </div> + <div class="dictURLs_2"> + <a href="http://www.spanishcentral.com/">Spanish Central&nbsp;»</a> + <a href="http://visual.merriam-webster.com/">Visual Dictionary&nbsp;»</a> + <a href="http://www.wordcentral.com/">WordCentral for Kids&nbsp;»</a> + </div> + </div> + <div style="clear:left;"></div> + </div> + + + <!--Footer: some other things--> + <div class="footer_b ld_xs_hidden"> + <div class="browse-dictionary"> + <a href="/browse/learners/a">Browse the Learner's Dictionary</a> + </div> + <div class="major-links"> + <ol> + <li><a href="/">Home</a></li> + <li><a href="/help/ipa">Pronunciation Symbols</a></li> + <li><a href="/help/all">Help</a></li> + <li><a href="http://www.merriam-webster.com/info/index.htm" target="_blank">About Us</a></li> + <li><a href="http://www.merriam-webster.com/dictionary-apps/android-ipad-iphone-windows.htm">Mobile Apps</a></li> + <li><a href="/shop/all">Shop</a></li> + <li><a href="http://www.dictionaryapi.com/" target="_blank">Dictionary API</a></li> + </ol> + </div> + <div class="minor-links"> + <ol> + <li><a href="/privacy-policy">Privacy Policy</a></li> + <li><a href="/terms-of-use">Terms Of Use</a></li> + <li><a href="/about-our-ads">About Our Ads</a></li> + <li><a href="/help/contact">Contact Us</a></li> + </ol> + </div> + <div class="copyright"> + <a href="/terms-of-use#copyright">© 2018 Merriam-Webster, Incorporated</a> + </div> + </div> + </div> + </div> + </div> + </div> + + <!-- JAVASCRIPT --> + <script type="text/javascript"> + var focusIn = true; + var focusInHome = false; + require(['main'], function(main) { + main.init(focusIn, focusInHome); + }); + </script> + + <!-- Subscribe WOD Overlay --> + <link rel="stylesheet" href="/css/shared/subscribe-overlay.css"> + <div id="subscribe-overlay"></div> + <script> + require(['subscribeOverlay'], function(subscribeOverlay) { + window.setTimeout(function() { + subscribeOverlay.init(); + },6000); + }); + </script> + + <!-- GDPR --> + <script> + require(['GDPR'], function(GDPR) { + GDPR.init(); + }); + </script> + </body> +</html> diff --git a/test/specs/components/dictionaries/learnersdict/response/jumblish.html b/test/specs/components/dictionaries/learnersdict/response/jumblish.html new file mode 100644 index 000000000..7f7d85385 --- /dev/null +++ b/test/specs/components/dictionaries/learnersdict/response/jumblish.html @@ -0,0 +1,741 @@ + +<!DOCTYPE html> +<html lang="en_US"> + <head> + <!--SEO-related tags: title, keywords, description--> + <title>jumblish - Definition for English-Language Learners from Merriam-Webster&#039;s Learner&#039;s Dictionary</title> + <meta name="description" content="Definition&#x20;of&#x20;jumblish&#x20;written&#x20;for&#x20;English&#x20;Language&#x20;Learners&#x20;from&#x20;the&#x20;Merriam-Webster&#x20;Learner&#x27;s&#x20;Dictionary&#x20;with&#x20;audio&#x20;pronunciations,&#x20;usage&#x20;examples,&#x20;and&#x20;count&#x2F;noncount&#x20;noun&#x20;labels."> + <meta name="keywords" content="jumblish,&#x20;definition,&#x20;define,&#x20;meaning,&#x20;Learning&#x20;English,&#x20;simple&#x20;English,&#x20;second&#x20;language,&#x20;learner&#x27;s&#x20;dictionary,&#x20;websters,&#x20;Merriam-Webster"> + + <!--Static meta tags --> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="robots" content="noodp, noydir"> + <meta property="fb:app_id" content="177288989106908"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + + + <script type="text/javascript" data-type="googletags"> + var googletag = googletag || {}; + googletag.cmd = googletag.cmd || []; + </script> + + <!--Opensearch link--> + <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="M-W Learner's Dictionary" /> + + + <!-- FAVICON --> + <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"> + <link rel="icon" href="/favicon.ico" type="image/x-icon"> + + <!-- VENDOR CSS --> + <link href="/vendor/normalize.2.1.2/normalize.min.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + <link href="/vendor/font-awesome-4.0.3/css/font-awesome.min.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + <link href="/vendor/amodal_1.6.5/amodal.min.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + <link href="/vendor/jquery-ui-1.10.3.custom/css/smoothness/jquery-ui-1.10.3.custom.min.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + + <!-- SHARED CSS --> + <link href="/css/shared/mw_style.0001.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + <link href="/css/shared/utils.0002.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + <link href="/css/shared/reusable.0001.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + <link href="/css/shared/resets.0001.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + + <link rel="stylesheet" href="/css/shared/gdpr.css"> + + <!-- TEMPLATE CSS (both mobile + desktop)--> + <link href="/css/main_template.0017.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + + <script type="text/javascript"> + (function(){ var wrapperLib = document.createElement('script'); wrapperLib.async = true; wrapperLib.type = 'text/javascript'; var useSSL = 'https:' == document.location.protocol; wrapperLib.src = (useSSL ? 'https:' : 'http:') + '//js-sec.indexww.com/ht/p/183900-278584765944481.js'; var node = document.getElementsByTagName('script')[0]; node.parentNode.insertBefore(wrapperLib, node); } + )(); + </script> + + <!--MODERNIZR--> + <script src="/vendor/modernizr.2.7.1/modernizr.custom.95871.js"></script> + + <!--JS config--> + <script type="text/javascript"> + window.mwdata = {}; + window.mwdata.assetsDomain1 = 'http://www.merriam-webster.com/assets'; + window.mwdata.assetsDomain2 = 'http://www.merriam-webster.com/assets'; + window.mwdata.env = 'production'; + window.mwdata.ads = {"ad_slot_top":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_Dictionary\/DICT","id":"div-gpt-ad-781001946814165391-1","defSizes":[[728,90]],"targeting":[["POS",["TOP"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[728,90]]}]}},"ad_slot_left":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_Dictionary\/DICT","id":"div-gpt-ad-781001946814165391-2","defSizes":[[160,600]],"targeting":[["POS",["TOP"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[160,600]]}]}},"ad_slot_right_top":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_Dictionary\/DICT","id":"div-gpt-ad-781001946814165391-3","defSizes":[[300,250]],"targeting":[["POS",["TOP"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[300,250]]}]}},"ad_slot_right_bottom":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_Dictionary\/DICT","id":"div-gpt-ad-781001946814165391-4","defSizes":[[300,250]],"targeting":[["POS",["BOT"]]],"sizeMappings":[{"screen":[0,0],"ads":[]},{"screen":[768,100],"ads":[[300,250]]}]}},"ad_slot_bottom":{"type":"google_dfp","data":{"slot":"\/15510053\/Learners_Dictionary\/DICT","id":"div-gpt-ad-781001946814165391-5","defSizes":[[728,90]],"targeting":[["POS",["BOT"]]],"sizeMappings":[{"screen":[0,0],"ads":[[320,50]]},{"screen":[768,100],"ads":[[728,90]]}]}}}; + window.mwdata.ads2 = []; + window.mwdata.gatReady = false; + window.mwdata.gatQueue = []; + window.mwdata.tagsPrepped = []; + window.mwdata.gTagReady = false; + window.mwdata.dfpSvcUp = false; + window.mwdata.adsBlacklist = []; + window.mwdata.adsWhitelist = null; + </script> + <script> + // Willy: Need to move all this to AD Library + // get the browser's current window dimensions + function getWindowDimensions() { + var width = window.innerWidth || + document.documentElement.clientWidth || + document.body.clientWidth; + var height = window.innerHeight || + document.documentElement.clientHeight || + document.body.clientHeight; + return [width, height]; + } + + // given a size mapping like: [[[1000, 600], [[300, 250], [300,600]]],[[0,0], [[300,250]]]] + // return the valid size mapping as an array like: [[300,250]] when the screen dimensions + // are less than 1000 width and 600 height + function parseSizeMappings(sizeMappings) { + try{ + // get current window dimensions + var sd = getWindowDimensions(); + + // filter mappings that are valid by confirming that the current screen dimensions + // are both greater than or equal to the breakpoint [x, y] minimums specified in the first position in the mapping + var validMappings = sizeMappings.filter(function(m) {return m[0][0] <= sd[0] && m[0][1] <= sd[1]}); + + // return the leftmost mapping's sizes or an empty array + return validMappings.length > 0 ? validMappings[0][1] : []; + } catch (e) { + console.log('error parsing sizeMappings:'); + console.log(sizeMappings); + console.log(e); + // fallback to last size mapping supplied + return sizeMappings[ sizeMappings.length -1 ][1]; + } + } + + function updateADPOSNaming() { + var i,j,adPos, adSize; + var setPOSName = function(adData) { + if (Array.isArray(adData.sizeMap) && adData.sizeMap.length > 0) { + adSize = adData.sizeMap[0].toString().replace(",",""); + for (i = 0; i < adData.targeting.length; i++) { + if (adData.targeting[i][0].toUpperCase() === "POS") { + adPos = "L" + adSize + adData.targeting[i][1]; + adData.targeting[i][1] = [adPos]; + break; + } + } + } + } + for (i in window.mwdata.ads) { + setPOSName(window.mwdata.ads[i].data); + } + if (typeof(window.mwdata.ads2) === "object" && !Array.isArray(window.mwdata.ads2)) { + for (j in window.mwdata.ads2) { + setPOSName(window.mwdata.ads2[j].data); + } + } + } + + function createSizeMapping() { + try { + var sizeMap, sizeMap2, adData, adData2; + for (var i in window.mwdata.ads) { + adData = window.mwdata.ads[i].data; + sizeMap = []; + if (typeof(adData.sizeMappings) !== "undefined" && adData.sizeMappings.length > 0) { + adData.sizeMappings.reverse().forEach(function(adSize) { + sizeMap.push([adSize.screen,adSize.ads]); + }); + window.mwdata.ads[i].data.sizeMap = parseSizeMappings(sizeMap); + if (window.mwdata.ads[i].data.sizeMap.length === 0) { + window.mwdata.ads[i].data.sizeMap = adData.defSizes; + } + } + } + if (typeof(window.mwdata.ads2) === "object" && !Array.isArray(window.mwdata.ads2)) { + for (var j in window.mwdata.ads2) { + adData2 = window.mwdata.ads2[j].data; + sizeMap2 = []; + if (typeof(adData2.sizeMappings) !== "undefined" && adData2.sizeMappings.length > 0) { + adData2.sizeMappings.reverse().forEach(function(adSize) { + sizeMap2.push([adSize.screen,adSize.ads]); + }); + window.mwdata.ads2[j].data.sizeMap = parseSizeMappings(sizeMap2); + if (window.mwdata.ads2[j].data.sizeMap.length === 0) { + window.mwdata.ads2[j].data.sizeMap = adData2.defSizes; + } + } + } + } + + } catch (e) { + for (var i in window.mwdata.ads) { + window.mwdata.ads[i].data.sizeMap = window.mwdata.ads[i].data.defSizes; + } + for (var i in window.mwdata.ads) { + window.mwdata.ads2[i].data.sizeMap = window.mwdata.ads2[i].data.defSizes; + } + } + } + createSizeMapping(); + updateADPOSNaming(); + </script> + <!-- JS --> + <script type="text/javascript"> + googletag.cmd.push(function() { + if (typeof window.headertag === 'undefined' || window.headertag.apiReady !== true) { + window.headertag = googletag; + } + }); + </script> + <!-- async GPT TAG --> + <script async src="https://www.googletagservices.com/tag/js/gpt.js"></script> + + <script src="/vendor/requirejs.2.1.6/require.min.js"></script> + <script type="text/javascript"> + //The reason I use js for path construction here - Google reports crawl errors + var vnd = '/vendor/'; + var fwdsl = '/'; + requirejs.config({ + + enforceDefine: false, + paths: { + //Our modules + 'auth_messages': '/js/lib/assign_errors.0002', + 'adProcessor': '/js/lib/adProcessor.0001', + 'ads2Refresher': '/js/lib/ads2Refresher.0001', + 'uniqueId': '/js/lib/uniqueId.0001', + 'dynScript': '/js/lib/dynScript.0001', + + 'main': '/js/components/main.0001', + 'facebookApi': '/js/components/facebookApi.0001', + 'search': '/js/components/search.0001', + 'subscribeOverlay': '/js/lib/subscribeOverlay', + 'GDPR': '/js/lib/gdpr', + //Vendor modules + "jquery": vnd + 'jquery.1.10.2' + fwdsl + 'jquery.min', + "jquery.jqueryui": vnd + 'jquery-ui-1.10.3.custom' + fwdsl + 'js' + fwdsl + 'jquery-ui-1.10.3.custom.min', + "underscore": vnd + 'lodash_1.2.1' + fwdsl + 'lodash.min', + "jquery.event_drag": vnd + 'amodal_1.6.5' + fwdsl + 'jquery.event.drag.min', + "jquery.amodal": vnd + 'amodal_1.6.5' + fwdsl + 'amodal.min', + "jquery.blockui": vnd + 'blockui_2.6.1' + fwdsl + 'jquery.blockUI', + "bowser": vnd + 'bowser.0.3.1' + fwdsl + 'bowser.min', + "jquery.cookie": vnd + 'jquery_cookie_1.4.0' + fwdsl + 'jquery.cookie', + 'matchMedia': '/vendor/match-media/matchMedia', + + //non-AMDs + "twitter": '//platform.twitter.com/widgets', + "jquery.cycle2": vnd + 'cycle2' + fwdsl + 'jquery.cycle2.20130909.min', + "jquery.rrssb": vnd + 'rrssb.1.6.0' + fwdsl + 'js' + fwdsl + 'rrssb.min' + }, + shim: { + "jquery.cycle2": ['jquery'], + "jquery.event_drag": ['jquery'], + "jquery.amodal": ['jquery.event_drag'], + "jquery.jqueryui": ['jquery'], + "jquery.rrssb": ['jquery'] + } + }); + </script> + + + <script> + //JC: instantiating adProcessor + require(['adProcessor'], function(adProcessor) { + //JC: Initiating ad libraries (google slot lib, ) & initializing slots + adProcessor.prepareAdLibraries(); + + //JC: by default we use a black-list, white-list is only being used if provided (rare cases) + if (window.mwdata.adsWhitelist !== null) { + adProcessor.prepareOnlyTheseAdSlots(window.mwdata.adsWhitelist); + } else { + adProcessor.prepareAllAdSlotsExcept(window.mwdata.adsBlacklist); + } + }); + + //JC: lotami tracking + require(['dynScript'], function(dynScript) { + dynScript.load('//tags.crwdcntrl.net/c/6936/cc.js?ns=_cc6936', {id: 'LOTCC_6936'}, function() { + _cc6936.bcp(); + }); + }); + + //JC: Google analitics + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + ga('create', 'UA-296234-17', 'learnersdictionary.com'); + ga('send', 'pageview'); + </script> + </head> + <body class="arial_font"> + + <!--Facebook Api--> + <script>require(['facebookApi']);</script> + + <!--Wrapper--> + <div id="wrap_full"> + <div id="wrap_c"> + + <!--Central left--> + <div id="wrap_cl" class="ld_xs_hidden noprint"> + <div id = "brit_logo_container"> + <a href="http://www.britannica.com/" target="_blank"><img id="brit_logo" src="/images/logos/d_brit.0001.jpg" alt="An Encylopedia Britannica Company" /></a> + </div> + <div id = "logo"> + <a href="/"><img src="/images/logos/d_logo.0001.gif" alt="Learner's Dictionary Logo" /></a> + </div> + + + <div class="abl abl-m0-t160-d160 ld_xs_hidden"> + <div class="ad_slot_left" id="ad_slot_left"> + <script>require(['adProcessor'], function(ap) {ap.renderDfp('ad_slot_left');});</script> + </div> + </div> + </div> + + <!--Central right--> + <div id="wrap_cr"> + + <!--Mobile top--> + <div class="mobile_top noprint box_sizing ld_xs_visible ld_lg_hidden"> + + <div class="toppest"> + <!--Globe logo--> + <img src = "/images/logos/m_logo_h.0001.png" class = "globe_logo box_sizing"> + + <!--Main title--> + <div class = "main_title"> + <a class="tt" href="/">Learner's Dictionary</a> + <a class="tb" href="/">mobile search</a> + </div> + </div> + + <!--Search form + menu--> + <div class="ld_searchc_m_plusb_w box_sizing"> + <div class="ld_searchc_m_plusb box_sizing"> + + <!--Mobile menu: dropdown--> + <ul class="m_menu_ul box_sizing"> + <li class="home"> + <img src="/images/m_menu/ld_menu_icon_home_teal.png" /> + <a href="/">Home</a> + </li> + <li class="qa"> + <img src="/images/m_menu/ld_menu_icon_qa_teal.png" /> + <a href="/qa/post/latest">Ask the Editor</a> + </li> + <li class="wod"> + <img src="/images/m_menu/ld_menu_icon_cal_teal.png" /> + <a href="/word-of-the-day">Word of the Day</a> + </li> + <li class="quizzes ld_xs_hidden"> + <img src="/images/m_menu/ld_menu_icon_vocabquiz_teal.png" /> + <a href="/quizzes">Quizzes</a> + </li> + <li class="words_3000"> + <img src="/images/m_menu/ld_menu_icon_3k_teal.png" /> + <a href="/3000-words">Core Vocabulary</a> + </li> + <li class="saved"> + <img src="/images/m_menu/ld_menu_icon_star_teal.png" /> + <a href="/saved-words">My Saved Words</a> + </li> + <li class="login"> + <img src="/images/m_menu/ld_menu_icon_signout_teal.png" /> + <a href="/auth/login">Login</a> + </li> + </ul> + + <!--Mobile menu: search form--> + <div id = "ld_searchc_m" class="box_sizing"> + <div class="frm box_sizing"> + + <!--Mobile menu: menu button--> + <a href="#" class="m_menu_btn box_sizing"> + <i class="fa fa-bars"></i> + <div class="prick"></div> + </a> + + <!--Mobile menu: search container--> + <div class="ld_search_inp_c box_sizing"> + <input autocapitalize="off" type="text" name="ld_search_inp" class="box_sizing ld_search_inp_c ld_search_inp" maxlength="200" rows=1 data-placeholder="Search Learner's Dictionary..." value="jumblish" /> + </div> + + <!--Mobile menu: search icon--> + <i class="fa fa-search fa-flip-horizontal search_btn box_sizing"></i> + + <!--Mobile menu: clear icon--> + <span class="clear_btn">&#215;</span> + + <!--Mobile menu: autocomplete holder--> + <div class="autocomplete_holder_m box_sizing"></div> + </div> + </div> + </div> + </div> + </div> + + + <!--Central right: top--> + <div id="wrap_cr_t" class="ld_xs_hidden noprint box_sizing"> + <div class="abl abl-m0-t728-d728 ld_xs_hidden"> + <div class="ad_slot_top" id="ad_slot_top"> + <script>require(['adProcessor'], function(ap) {ap.renderDfp('ad_slot_top');});</script> + </div> + </div> + </div> + + <!--Central right: bottom--> + <div id="wrap_cr_b" class="box_sizing"> + + <!--Central right: bottom: left column--> + <div id="wrap_cr_bl" class="box_sizing"> + + <!--Desktop top--> + <div class="desktop_top box_sizing ld_xs_hidden ld_lg_visible noprint"> + + <!--Top menu--> + <div class="section-links noprint"> + <ul> + <li class="ask_the_editor_link"> + <a class="nmlink" href="/qa/post/latest">Ask the Editor</a> + </li> + <li class="word_of_the_day_link"> + <a class="nmlink" href="/word-of-the-day">Word of the Day</a> + </li> + <li class="quizzes_link"> + <a class="nmlink" href="/quizzes">Quizzes</a> + </li> + <li class="words_3000_link"> + <a class="nmlink" href="/3000-words">Core Vocabulary</a> + </li> + <li class="most_popular_words_link"> + <a class="nmlink" href="/most-popular-words">Most Popular</a> + </li> + <li class="favorites_link"> + <a class="nmlink" href="/saved-words">My Saved Words</a> + </li> + <li class="login_link"> + <a href="/auth/login?redirect=%2Fsaved-words" class="login_btn">Log in</a> + </li> + </ul> + </div> + + <!--Main title--> + <div id = "main_title" class="georgia_font noprint"> + <a href="/">Learner's Dictionary</a> + </div> + + <!--Search form--> + <div id = "ld_searchc_d" class="box_sizing noprint"> + <div class="frm box_sizing"> + <input type="text" name="ld_search_inp" class="ld_search_inp box_sizing" maxlength="200" rows=1 data-placeholder="Search for definitions in simple English..." value="jumblish" /> + <div class="autocomplete_holder_d"></div> + </div> + <button class="search_btn"></button> + </div> + </div> + + <!--Actual content --> + <!--CSS--> +<link href="/css/entries/spelling.0001.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + +<!--Browse: universal title--> +<div class = "universal_large_title georgia_font"> + Spelling Suggestions +</div> +<div class="thin_dots"></div> + +<div id="spelling_c"> + <div class="title"> + The word you have entered is not in the dictionary. Click on a spelling suggestion below or try your search again. + </div> + <ul class="links"> + <li> + <a href="/definition/jumble&#x20;sale">jumble sale</a> + </li> + <li> + <a href="/definition/jumbled">jumbled</a> + </li> + <li> + <a href="/definition/jumpsuit">jumpsuit</a> + </li> + <li> + <a href="/definition/jump&#x20;shot">jump shot</a> + </li> + <li> + <a href="/definition/tumbler">tumbler</a> + </li> + <li> + <a href="/definition/gambling">gambling</a> + </li> + <li> + <a href="/definition/demolish">demolish</a> + </li> + </ul> +</div> + +<!--JAVASCRIPT--> +<script type="text/javascript"> + require(['underscore', 'jquery'], function(_) { + + }); +</script> </div> + + <!--Central right: bottom: right column--> + <div id="wrap_cr_br" class="box_sizing ld_xs_hidden noprint"> + + <div class="abl abl-m0-t300-d300 ld_xs_hidden"> + <div class="ad_slot_right_top" id="ad_slot_right_top"> + <script>require(['adProcessor'], function(ap) {ap.renderDfp('ad_slot_right_top');});</script> + </div> + </div> + + <div id = "wrap_rbr_c" class="box_sizing"> + <!-- CSS --> +<link href="/css/quizzes/siderail.0001.css" type="text/css" rel="Stylesheet" charset="utf-8" /> + +<!-- HTML --> +<div id="quizzes_r"> + + <!--header--> + <div class="area_header verdana_font margin_bottom_10"> + LEARNER'S QUIZZES + </div> + + <!--content--> + <div class="main_content"> + <div class="feature_quiz"> + <div class="quiz_icon"> + <a href="/quiz/vocabulary-start"><img src="/images/quizzes/vocabulary-quiz-70x55.gif" alt="Vocabulary Quiz Icon" /></a> + </div> + <div class="quiz_content"> + <div class="title georgia_font"> + <a href="/quiz/vocabulary-start">Vocabulary Quiz</a> + </div> + <div class="descr"> + <a href="/quiz/vocabulary-start">Test your word power</a> + </div> + <div class="passthru_url"> + <a href="/quiz/vocabulary-start">Take the Quiz &raquo;</a> + </div> + </div> + </div> + + <div class="athletics-dots margin_top_4 margin_bottom_8"></div> + + <div class="feature_quiz"> + <div class="quiz_icon"> + <a href="/quiz/name-that-thing-pick"><img src="/images/quizzes/name-that-thing-70x55.gif" alt="Name That Thing Icon" /></a> + </div> + <div class="quiz_content"> + <div class="title georgia_font"> + <a href="/quiz/name-that-thing-pick">Name That Thing</a> + </div> + <div class="descr"> + <a href="/quiz/name-that-thing-pick">Take our visual quiz</a> + </div> + <div class="passthru_url"> + <a href="/quiz/name-that-thing-pick">Test Your Knowledge &raquo;</a> + </div> + </div> + </div> + </div> +</div> </div> + + <div class="abl abl-m0-t300-d300 ld_xs_hidden"> + <div class="ad_slot_right_bottom" id="ad_slot_right_bottom"> + <script>require(['adProcessor'], function(ap) {ap.renderDfp('ad_slot_right_bottom');});</script> + </div> + </div> + </div> + + <!--Central right: bottom: clearing column floats--> + <div style = "clear:both;"></div> + </div> + </div> + + <!--Central: clearing column floats--> + <div style = "clear:both;"></div> + + <!--Footer:--> + <div id="wrap_cf" class="box_sizing noprint"> + <div id="footer" class="box_sizing"> + <div class="offerings_top ld_xs_hidden"> + <div class="offer1 ind_offer"> + <div class="featTitle"> + The Merriam-Webster <br> Unabridged Dictionary + </div> + + <div class="featImage_1"> + <a href="https://unabridged.merriam-webster.com/subscriber/register?refc=SIGNUP_LEARNERS" > + <img src="/images/promos/unabridged-promo.gif" alt="Merriam-Webster Unabridged Book Cover" /> + </a> + </div> + + <div class="featDescr"> + Online access to a <br> legendary resource <br> <a href="https://unabridged.merriam-webster.com/subscriber/login">Log In</a> or <a href="https://unabridged.merriam-webster.com/subscriber/register?refc=SIGNUP_LEARNERS">Sign Up&nbsp;»</a> + </div> + </div> + + <div class="offer2 ind_offer"> + <div class="featTitle"> + Learning Spanish? + <br>We can help + </div> + + <div class="featImage_2"> + <a href="http://www.learnersdictionary.com/"> + <img src="/images/logos/sc_logo_0004.gif" alt="Learner's Dictionary Book Cover" /> + </a> + </div> + + <div class="featDescr"> + Visit our free site designed <br> especially for learners and <br> teachers of Spanish <br> <a href="http://www.spanishcentral.com/">SpanishCentral.com&nbsp;»</a> + </div> + </div> + + <div class="offer3 ind_offer"> + <div class="featImage_3"> + <a href="http://www.merriam-webster.com/dictionary-apps/android-ipad-iphone-windows.htm"> + <img src="/images/promos/iphone-app-woman-with-cell.jpg" alt="Woman With Cell Phone" /> + </a> + </div> + + <div class="featTitle"> + Our Dictionary, <br> On Your Devices + </div> + + <div class="featDescr"> + Merriam-Webster, <br> <em>With Voice Search</em> <br> <a href="http://www.merriam-webster.com/dictionary-apps/android-ipad-iphone-windows.htm">Get the Free Apps! »</a> + </div> + </div> + + <div class="offer4 ind_offer"> + <div class="featTitle"> + Merriam-Webster's <br> Visual Dictionaries + </div> + + <div class="featImage_4"> + <a href="http://www.merriam-webster.com/shop/products/books/visual-dictionary-second-edition.htm"> + <img src="/images/promos/visual-dictionary-promo.gif" border="0" alt="Visual Dictionary Book Cover" /> + </a> + </div> + + <div class="featDescr"> + The new edition of the <br> remarkable reference <br> features 8,000 <br> illustrations. <br> <a href="http://www.merriam-webster.com/shop/products/books/visual-dictionary-second-edition.htm">Learn More »</a> + </div> + </div> + </div> + + <!--Footer: ad area--> + <div class="ad_holder"> + <div class="abl abl-m320-t728-d728"> + <div class="ad_slot_bottom" id="ad_slot_bottom"> + <script>require(['adProcessor'], function(ap) {ap.renderDfp('ad_slot_bottom');});</script> + </div> + </div> + </div> + + <!--The rest of the footer--> + <div class="offerings_bottom ld_xs_hidden"> + <div class="offer5 ind_offer"> + <div class="featTitle"> + Join Us + </div> + + <div class="twitter"> + <div class="twLogo"> + <a href="https://twitter.com/MWforLearners"><img src="/images/social/twitter-logo.png"></a> + </div> + <div class="twDescr"> + <a href="https://twitter.com/MWforLearners">Learner's Dictionary<br>on Twitter&nbsp;»</a> + </div> + </div> + + <div class="facebook"> + <div class="fbLogo"> + <a href="https://www.facebook.com/learnersdictionary"><img src="/images/social/facebook-logo.png"></a> + </div> + <div class="fbDescr"> + <a href="https://www.facebook.com/learnersdictionary">Learner's Dictionary<br>on Facebook&nbsp;»</a> + </div> + </div> + </div> + + <div class="offer6 ind_offer"> + <div class="featTitle"> + Bookstore: Digital and Print + </div> + <div class="bookstoreDescr"> + Merriam-Webster references for Mobile, Kindle, print, and more. <a href="http://www.merriam-webster.com/shop/index.htm">See all&nbsp;»</a> + </div> + </div> + + <div class="offer7 ind_offer"> + <div class="featTitle"> + Other Merriam-Webster Dictionaries + </div> + + <div class="dictURLs_1"> + <a href="http://unabridged.merriam-webster.com">Webster's Unabridged Dictionary&nbsp;»</a> + <a href="http://arabic.britannicaenglish.com/en">Britannica English - Arabic Translation&nbsp;»</a> + <a href="http://www.nglish.com/spanish">Nglish - Spanish-English Translation&nbsp;»</a> + </div> + <div class="dictURLs_2"> + <a href="http://www.spanishcentral.com/">Spanish Central&nbsp;»</a> + <a href="http://visual.merriam-webster.com/">Visual Dictionary&nbsp;»</a> + <a href="http://www.wordcentral.com/">WordCentral for Kids&nbsp;»</a> + </div> + </div> + <div style="clear:left;"></div> + </div> + + + <!--Footer: some other things--> + <div class="footer_b ld_xs_hidden"> + <div class="browse-dictionary"> + <a href="/browse/learners/a">Browse the Learner's Dictionary</a> + </div> + <div class="major-links"> + <ol> + <li><a href="/">Home</a></li> + <li><a href="/help/ipa">Pronunciation Symbols</a></li> + <li><a href="/help/all">Help</a></li> + <li><a href="http://www.merriam-webster.com/info/index.htm" target="_blank">About Us</a></li> + <li><a href="http://www.merriam-webster.com/dictionary-apps/android-ipad-iphone-windows.htm">Mobile Apps</a></li> + <li><a href="/shop/all">Shop</a></li> + <li><a href="http://www.dictionaryapi.com/" target="_blank">Dictionary API</a></li> + </ol> + </div> + <div class="minor-links"> + <ol> + <li><a href="/privacy-policy">Privacy Policy</a></li> + <li><a href="/terms-of-use">Terms Of Use</a></li> + <li><a href="/about-our-ads">About Our Ads</a></li> + <li><a href="/help/contact">Contact Us</a></li> + </ol> + </div> + <div class="copyright"> + <a href="/terms-of-use#copyright">© 2018 Merriam-Webster, Incorporated</a> + </div> + </div> + </div> + </div> + </div> + </div> + + <!-- JAVASCRIPT --> + <script type="text/javascript"> + var focusIn = true; + var focusInHome = false; + require(['main'], function(main) { + main.init(focusIn, focusInHome); + }); + </script> + + + <!-- GDPR --> + <script> + require(['GDPR'], function(GDPR) { + GDPR.init(); + }); + </script> + </body> +</html>
feat
add webster learners dict
8b5255cf21afece54e26364cdd2ef9c915674d08
2020-04-20 09:44:26
crimx
refactor: increase local tests timeout
false
diff --git a/.neutrinorc.js b/.neutrinorc.js index dbf30e05b..011c15fa0 100644 --- a/.neutrinorc.js +++ b/.neutrinorc.js @@ -316,7 +316,8 @@ module.exports = { '\\.(mjs|jsx|js|ts|tsx)$': require.resolve( '@neutrinojs/jest/src/transformer' ) - } + }, + testTimeout: 20000 }), wext({ polyfill: true
refactor
increase local tests timeout
50548e54209e308b724eb525a500a78de19ec2a2
2018-04-15 17:19:53
CRIMX
test(package): add enzyme
false
diff --git a/config/jest/setupTests.js b/config/jest/setupTests.js new file mode 100644 index 000000000..3bf6370df --- /dev/null +++ b/config/jest/setupTests.js @@ -0,0 +1,12 @@ +import browser from 'sinon-chrome/extensions' +import Enzyme from 'enzyme' +import Adapter from 'enzyme-adapter-react-16' +import raf from 'raf' + +window.browser = browser + +Enzyme.configure({ adapter: new Adapter() }) + +// In tests, polyfill requestAnimationFrame since jsdom doesn't provide it yet. +// We don't polyfill it in the browser--this is user's responsibility. +raf.polyfill(global) diff --git a/config/polyfills.js b/config/polyfills.js index 7e1a2db26..a93005a3d 100644 --- a/config/polyfills.js +++ b/config/polyfills.js @@ -1,10 +1,5 @@ 'use strict' -if (process.env.NODE_ENV === 'test') { - window.browser = require('sinon-chrome/extensions') - // In tests, polyfill requestAnimationFrame since jsdom doesn't provide it yet. - // We don't polyfill it in the browser--this is user's responsibility. - require('raf').polyfill(global) -} else { +if (process.env.NODE_ENV !== 'test') { window.browser = require('webextension-polyfill') } diff --git a/package.json b/package.json index d1de9a09c..3266fa89d 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "dependencies": { "@types/lodash": "^4.14.98", "@types/node": "^9.3.0", - "@types/react": "^16.0.34", + "@types/react": "^16.3.10", "@types/react-dom": "^16.0.3", "@types/react-motion": "^0.0.25", "bootstrap-sass": "^3.3.7", @@ -61,6 +61,7 @@ "devDependencies": { "@commitlint/cli": "^6.0.2", "@commitlint/config-conventional": "^6.0.2", + "@types/enzyme": "^3.1.9", "@types/jest": "^22.0.1", "@types/sinon-chrome": "^2.2.0", "autoprefixer": "8.1.0", @@ -79,6 +80,8 @@ "css-loader": "0.28.10", "cz-conventional-changelog": "^2.1.0", "dotenv": "5.0.1", + "enzyme": "^3.3.0", + "enzyme-adapter-react-16": "^1.1.1", "extract-text-webpack-plugin": "3.0.2", "file-loader": "1.1.11", "fork-ts-checker-webpack-plugin": "^0.4.0", @@ -131,6 +134,7 @@ "setupFiles": [ "<rootDir>/config/polyfills.js" ], + "setupTestFrameworkScriptFile": "<rootDir>/config/jest/setupTests.js", "testMatch": [ "<rootDir>/test/specs/**/*.{ts,tsx,js,jsx}", "<rootDir>/src/**/__tests__/**/*.{ts,tsx,js,jsx}", diff --git a/yarn.lock b/yarn.lock index 5d0fc9fbb..f29b75c64 100644 --- a/yarn.lock +++ b/yarn.lock @@ -152,12 +152,23 @@ dependencies: samsam "1.3.0" +"@types/cheerio@*": + version "0.22.7" + resolved "https://registry.npmjs.org/@types/cheerio/-/cheerio-0.22.7.tgz#4a92eafedfb2b9f4437d3a4410006d81114c66ce" + "@types/chrome@*": version "0.0.60" resolved "https://registry.npmjs.org/@types/chrome/-/chrome-0.0.60.tgz#058eed1587b7aec3b83d4be905c8758ea145ba84" dependencies: "@types/filesystem" "*" +"@types/enzyme@^3.1.9": + version "3.1.9" + resolved "https://registry.npmjs.org/@types/enzyme/-/enzyme-3.1.9.tgz#fbd97f3beb7cad76fc9c6f04c97d77f4834522ef" + dependencies: + "@types/cheerio" "*" + "@types/react" "*" + "@types/filesystem@*": version "0.0.28" resolved "https://registry.npmjs.org/@types/filesystem/-/filesystem-0.0.28.tgz#3fd7735830f2c7413cb5ac45780bc45904697b0e" @@ -193,10 +204,16 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^16.0.34": +"@types/react@*": version "16.0.40" resolved "https://registry.npmjs.org/@types/react/-/react-16.0.40.tgz#caabc2296886f40b67f6fc80f0f3464476461df9" +"@types/react@^16.3.10": + version "16.3.10" + resolved "https://registry.npmjs.org/@types/react/-/react-16.3.10.tgz#2f25eef83f7c7f6c51cea4c02660f727c75d3b33" + dependencies: + csstype "^2.2.0" + "@types/sinon-chrome@^2.2.0": version "2.2.0" resolved "https://registry.npmjs.org/@types/sinon-chrome/-/sinon-chrome-2.2.0.tgz#272b569deabc8116532368014ea14a55dd1d184e" @@ -1583,6 +1600,17 @@ chardet@^0.4.0: version "0.4.2" resolved "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" +cheerio@^1.0.0-rc.2: + version "1.0.0-rc.2" + resolved "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.2.tgz#4b9f53a81b27e4d5dac31c0ffd0cfa03cc6830db" + dependencies: + css-select "~1.2.0" + dom-serializer "~0.1.0" + entities "~1.1.1" + htmlparser2 "^3.9.1" + lodash "^4.15.0" + parse5 "^3.0.1" + chokidar@^1.6.0, chokidar@^1.7.0: version "1.7.0" resolved "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" @@ -1762,6 +1790,10 @@ colormin@^1.0.5: css-color-names "0.0.4" has "^1.0.1" [email protected]: + version "0.5.1" + resolved "https://registry.npmjs.org/colors/-/colors-0.5.1.tgz#7d0023eaeb154e8ee9fce75dcb923d0ed1667774" + colors@^1.1.2: version "1.2.1" resolved "https://registry.npmjs.org/colors/-/colors-1.2.1.tgz#f4a3d302976aaf042356ba1ade3b1a2c62d9d794" @@ -2232,7 +2264,7 @@ [email protected]: postcss-value-parser "^3.3.0" source-list-map "^2.0.0" -css-select@^1.1.0: +css-select@^1.1.0, css-select@~1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" dependencies: @@ -2320,6 +2352,10 @@ [email protected], "cssom@>= 0.3.2 < 0.4.0": dependencies: cssom "0.3.x" +csstype@^2.2.0: + version "2.2.0" + resolved "https://registry.npmjs.org/csstype/-/csstype-2.2.0.tgz#1656ef97553ac53b77090844a2531c6660ebd902" + currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" @@ -2558,6 +2594,10 @@ dir-glob@^2.0.0: arrify "^1.0.1" path-type "^3.0.0" [email protected]: + version "1.0.0" + resolved "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a" + dns-equal@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" @@ -2588,7 +2628,7 @@ dom-converter@~0.1: dependencies: utila "~0.3" -dom-serializer@0: +dom-serializer@0, dom-serializer@~0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" dependencies: @@ -2599,7 +2639,7 @@ domain-browser@^1.1.1: version "1.2.0" resolved "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" -domelementtype@1: +domelementtype@1, domelementtype@^1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2" @@ -2619,6 +2659,12 @@ [email protected]: dependencies: domelementtype "1" +domhandler@^2.3.0: + version "2.4.1" + resolved "https://registry.npmjs.org/domhandler/-/domhandler-2.4.1.tgz#892e47000a99be55bbf3774ffea0561d8879c259" + dependencies: + domelementtype "1" + [email protected]: version "1.1.6" resolved "https://registry.npmjs.org/domutils/-/domutils-1.1.6.tgz#bddc3de099b9a2efacc51c623f28f416ecc57485" @@ -2632,6 +2678,13 @@ [email protected]: dom-serializer "0" domelementtype "1" +domutils@^1.5.1: + version "1.7.0" + resolved "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" + dependencies: + dom-serializer "0" + domelementtype "1" + dot-prop@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-3.0.0.tgz#1b708af094a49c9a0e7dbcad790aba539dac1177" @@ -2727,10 +2780,51 @@ enhanced-resolve@^3.0.0, enhanced-resolve@^3.4.0: object-assign "^4.0.1" tapable "^0.2.7" -entities@~1.1.1: +entities@^1.1.1, entities@~1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" +enzyme-adapter-react-16@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.1.1.tgz#a8f4278b47e082fbca14f5bfb1ee50ee650717b4" + dependencies: + enzyme-adapter-utils "^1.3.0" + lodash "^4.17.4" + object.assign "^4.0.4" + object.values "^1.0.4" + prop-types "^15.6.0" + react-reconciler "^0.7.0" + react-test-renderer "^16.0.0-0" + +enzyme-adapter-utils@^1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/enzyme-adapter-utils/-/enzyme-adapter-utils-1.3.0.tgz#d6c85756826c257a8544d362cc7a67e97ea698c7" + dependencies: + lodash "^4.17.4" + object.assign "^4.0.4" + prop-types "^15.6.0" + +enzyme@^3.3.0: + version "3.3.0" + resolved "https://registry.npmjs.org/enzyme/-/enzyme-3.3.0.tgz#0971abd167f2d4bf3f5bd508229e1c4b6dc50479" + dependencies: + cheerio "^1.0.0-rc.2" + function.prototype.name "^1.0.3" + has "^1.0.1" + is-boolean-object "^1.0.0" + is-callable "^1.1.3" + is-number-object "^1.0.3" + is-string "^1.0.4" + is-subset "^0.1.1" + lodash "^4.17.4" + object-inspect "^1.5.0" + object-is "^1.0.1" + object.assign "^4.1.0" + object.entries "^1.0.4" + object.values "^1.0.4" + raf "^3.4.0" + rst-selector-parser "^2.2.3" + errno@^0.1.3, errno@~0.1.7: version "0.1.7" resolved "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" @@ -2753,6 +2847,16 @@ es-abstract@^1.5.1, es-abstract@^1.7.0: is-callable "^1.1.3" is-regex "^1.0.4" +es-abstract@^1.6.1: + version "1.11.0" + resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.11.0.tgz#cce87d518f0496893b1a30cd8461835535480681" + dependencies: + es-to-primitive "^1.1.1" + function-bind "^1.1.1" + has "^1.0.1" + is-callable "^1.1.3" + is-regex "^1.0.4" + es-to-primitive@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" @@ -3419,10 +3523,18 @@ fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: mkdirp ">=0.5 0" rimraf "2" -function-bind@^1.0.2, function-bind@^1.1.1: +function-bind@^1.0.2, function-bind@^1.1.0, function-bind@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" +function.prototype.name@^1.0.3: + version "1.1.0" + resolved "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.0.tgz#8bd763cc0af860a859cc5d49384d74b932cd2327" + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + is-callable "^1.1.3" + gauge@~2.7.3: version "2.7.4" resolved "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -3740,6 +3852,10 @@ has-flag@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" +has-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" + has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -3918,6 +4034,17 @@ html2canvas@^1.0.0-alpha.9: dependencies: css-line-break "1.0.1" +htmlparser2@^3.9.1: + version "3.9.2" + resolved "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.9.2.tgz#1bdf87acca0f3f9e53fa4fcceb0f4b4cbb00b338" + dependencies: + domelementtype "^1.3.0" + domhandler "^2.3.0" + domutils "^1.5.1" + entities "^1.1.1" + inherits "^2.0.1" + readable-stream "^2.0.2" + htmlparser2@~3.3.0: version "3.3.0" resolved "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.3.0.tgz#cc70d05a59f6542e43f0e685c982e14c924a9efe" @@ -4162,6 +4289,10 @@ is-binary-path@^1.0.0: dependencies: binary-extensions "^1.0.0" +is-boolean-object@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.0.0.tgz#98f8b28030684219a95f375cfbd88ce3405dff93" + is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" @@ -4298,6 +4429,10 @@ is-my-json-valid@^2.12.4: jsonpointer "^4.0.0" xtend "^4.0.0" +is-number-object@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.3.tgz#f265ab89a9f445034ef6aff15a8f00b00f551799" + is-number@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" @@ -4380,6 +4515,10 @@ is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" +is-string@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/is-string/-/is-string-1.0.4.tgz#cc3a9b69857d621e963725a24caeec873b826e64" + is-subset@^0.1.1: version "0.1.1" resolved "https://registry.npmjs.org/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" @@ -5078,6 +5217,10 @@ lodash.endswith@^4.2.1: version "4.2.1" resolved "https://registry.npmjs.org/lodash.endswith/-/lodash.endswith-4.2.1.tgz#fed59ac1738ed3e236edd7064ec456448b37bc09" +lodash.flattendeep@^4.4.0: + version "4.4.0" + resolved "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" + lodash.get@^4.4.2: version "4.4.2" resolved "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" @@ -5167,7 +5310,7 @@ [email protected]: version "4.17.2" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.2.tgz#34a3055babe04ce42467b607d700072c7ff6bf42" [email protected], lodash@^4.0.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.16.3, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@~4.17.4: [email protected], lodash@^4.0.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.16.3, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@~4.17.4: version "4.17.5" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" @@ -5538,6 +5681,15 @@ [email protected]: dependencies: xml-char-classes "^1.0.0" +nearley@^2.7.10: + version "2.13.0" + resolved "https://registry.npmjs.org/nearley/-/nearley-2.13.0.tgz#6e7b0f4e68bfc3e74c99eaef2eda39e513143439" + dependencies: + nomnom "~1.6.2" + railroad-diagrams "^1.0.0" + randexp "0.4.6" + semver "^5.4.1" + [email protected]: version "0.6.1" resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" @@ -5679,6 +5831,13 @@ node-sass@^4.7.2: stdout-stream "^1.4.0" "true-case-path" "^1.0.2" +nomnom@~1.6.2: + version "1.6.2" + resolved "https://registry.npmjs.org/nomnom/-/nomnom-1.6.2.tgz#84a66a260174408fc5b77a18f888eccc44fb6971" + dependencies: + colors "0.5.x" + underscore "~1.4.4" + "nopt@2 || 3", nopt@~3.0.1: version "3.0.6" resolved "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" @@ -5781,7 +5940,15 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-keys@^1.0.8: +object-inspect@^1.5.0: + version "1.5.0" + resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.5.0.tgz#9d876c11e40f485c79215670281b767488f9bfe3" + +object-is@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/object-is/-/object-is-1.0.1.tgz#0aa60ec9989a0b3ed795cf4d06f62cf1ad6539b6" + +object-keys@^1.0.11, object-keys@^1.0.8: version "1.0.11" resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" @@ -5791,6 +5958,24 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" +object.assign@^4.0.4, object.assign@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + +object.entries@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/object.entries/-/object.entries-1.0.4.tgz#1bf9a4dd2288f5b33f3a993d257661f05d161a5f" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.6.1" + function-bind "^1.1.0" + has "^1.0.1" + object.getownpropertydescriptors@^2.0.3: version "2.0.3" resolved "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" @@ -5811,6 +5996,15 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" +object.values@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/object.values/-/object.values-1.0.4.tgz#e524da09b4f66ff05df457546ec72ac99f13069a" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.6.1" + function-bind "^1.1.0" + has "^1.0.1" + obuf@^1.0.0, obuf@^1.1.1: version "1.1.2" resolved "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" @@ -6000,7 +6194,7 @@ [email protected]: version "4.0.0" resolved "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" -parse5@^3.0.3: +parse5@^3.0.1, parse5@^3.0.3: version "3.0.3" resolved "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c" dependencies: @@ -6592,12 +6786,23 @@ quick-lru@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" [email protected], raf@^3.1.0: [email protected], raf@^3.1.0, raf@^3.4.0: version "3.4.0" resolved "https://registry.npmjs.org/raf/-/raf-3.4.0.tgz#a28876881b4bc2ca9117d4138163ddb80f781575" dependencies: performance-now "^2.1.0" +railroad-diagrams@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz#eb7e6267548ddedfb899c1b90e57374559cddb7e" + [email protected]: + version "0.4.6" + resolved "https://registry.npmjs.org/randexp/-/randexp-0.4.6.tgz#e986ad5e5e31dae13ddd6f7b3019aa7c87f60ca3" + dependencies: + discontinuous-range "1.0.0" + ret "~0.1.10" + randomatic@^1.1.3: version "1.1.7" resolved "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" @@ -6676,6 +6881,10 @@ react-error-overlay@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-4.0.0.tgz#d198408a85b4070937a98667f500c832f86bd5d4" +react-is@^16.3.1: + version "16.3.1" + resolved "https://registry.npmjs.org/react-is/-/react-is-16.3.1.tgz#ee66e6d8283224a83b3030e110056798488359ba" + react-motion@^0.5.2: version "0.5.2" resolved "https://registry.npmjs.org/react-motion/-/react-motion-0.5.2.tgz#0dd3a69e411316567927917c6626551ba0607316" @@ -6684,6 +6893,15 @@ react-motion@^0.5.2: prop-types "^15.5.8" raf "^3.1.0" +react-reconciler@^0.7.0: + version "0.7.0" + resolved "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.7.0.tgz#9614894103e5f138deeeb5eabaf3ee80eb1d026d" + dependencies: + fbjs "^0.8.16" + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.0" + react-redux@^5.0.7: version "5.0.7" resolved "https://registry.npmjs.org/react-redux/-/react-redux-5.0.7.tgz#0dc1076d9afb4670f993ffaef44b8f8c1155a4c8" @@ -6695,6 +6913,15 @@ react-redux@^5.0.7: loose-envify "^1.1.0" prop-types "^15.6.0" +react-test-renderer@^16.0.0-0: + version "16.3.1" + resolved "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-16.3.1.tgz#d9257936d8535bd40f57f3d5a84e7b0452fb17f2" + dependencies: + fbjs "^0.8.16" + object-assign "^4.1.1" + prop-types "^15.6.0" + react-is "^16.3.1" + react@^16.3.1: version "16.3.1" resolved "https://registry.npmjs.org/react/-/react-16.3.1.tgz#4a2da433d471251c69b6033ada30e2ed1202cfd8" @@ -7142,6 +7369,13 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^2.0.0" inherits "^2.0.1" +rst-selector-parser@^2.2.3: + version "2.2.3" + resolved "https://registry.npmjs.org/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz#81b230ea2fcc6066c89e3472de794285d9b03d91" + dependencies: + lodash.flattendeep "^4.4.0" + nearley "^2.7.10" + run-async@^2.2.0: version "2.3.0" resolved "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" @@ -8244,6 +8478,10 @@ uid-number@^0.0.6: version "0.0.6" resolved "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" +underscore@~1.4.4: + version "1.4.4" + resolved "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz#61a6a32010622afa07963bf325203cf12239d604" + union-value@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4"
test
add enzyme
73aaffa56364e5e5397b30e00feec022eec068c1
2018-05-24 13:19:40
CRIMX
fix(sass): add global
false
diff --git a/src/_sass_global/_reset.scss b/src/_sass_global/_reset.scss index 108675b64..07854ae28 100644 --- a/src/_sass_global/_reset.scss +++ b/src/_sass_global/_reset.scss @@ -9,6 +9,10 @@ h1, h2, h3, h4, ul, li, button { padding: 0; } +p { + margin: 0.5em 0; +} + ul li { list-style-type: none; }
fix
add global
750bec697cebb0cfd588221808cef5f46a6fcab4
2019-08-27 23:16:38
crimx
refactor(selection): detect panel
false
diff --git a/src/_helpers/saladict.ts b/src/_helpers/saladict.ts index e8c472625..23560c43a 100644 --- a/src/_helpers/saladict.ts +++ b/src/_helpers/saladict.ts @@ -15,3 +15,43 @@ export const isStandalonePage = () => isPopupPage() || isQuickSearchPage() /** do not record search history on these pages */ export const isNoSearchHistoryPage = () => isInternalPage() && !isStandalonePage() + +export const SALADICT_EXTERNAL = 'saladict-external' + +export const SALADICT_PANEL = 'saladict-panel' + +/** + * Is element in a Saladict external element + */ +export function isInSaladictExternal( + element: Element | EventTarget | null +): boolean { + if (!element || !element['classList']) { + return false + } + + for (let el: Element | null = element as Element; el; el = el.parentElement) { + if (el.classList.contains(SALADICT_EXTERNAL)) { + return true + } + } + + return false +} + +/** + * Is element in Saladict Dict Panel + */ +export function isInDictPanel(element: Element | EventTarget | null): boolean { + if (!element || !element['classList']) { + return false + } + + for (let el: Element | null = element as Element; el; el = el.parentElement) { + if (el.classList.contains(SALADICT_PANEL)) { + return true + } + } + + return false +} diff --git a/src/components/ShadowPortal/index.tsx b/src/components/ShadowPortal/index.tsx index abb76b480..20c5cc0d4 100644 --- a/src/components/ShadowPortal/index.tsx +++ b/src/components/ShadowPortal/index.tsx @@ -4,6 +4,7 @@ import CSSTransition, { CSSTransitionProps } from 'react-transition-group/CSSTransition' import root from 'react-shadow' +import { SALADICT_EXTERNAL } from '@/_helpers/saladict' export const defaultTimeout = { enter: 400, exit: 100, appear: 400 } @@ -14,6 +15,7 @@ export interface ShadowPortalProps extends Partial<CSSTransitionProps> { id: string /** Static content before the children */ head?: ReactNode + shadowRootClassName?: string } /** @@ -22,7 +24,14 @@ export interface ShadowPortalProps extends Partial<CSSTransitionProps> { * Remove the element from DOM when the Component unmounts. */ export const ShadowPortal = (props: ShadowPortalProps) => { - const { id, head, onEnter, onExited, ...restProps } = props + const { + id, + head, + shadowRootClassName, + onEnter, + onExited, + ...restProps + } = props const $root = useMemo(() => { let $root = document.getElementById(id) @@ -45,7 +54,12 @@ export const ShadowPortal = (props: ShadowPortalProps) => { ) return ReactDOM.createPortal( - <root.div> + <root.div + className={ + SALADICT_EXTERNAL + + (shadowRootClassName ? ` ${shadowRootClassName}` : '') + } + > {head} <CSSTransition classNames={defaultClassNames} diff --git a/src/content/components/DictPanel/DictPanel.portal.tsx b/src/content/components/DictPanel/DictPanel.portal.tsx index f371155b6..a1f63ea67 100644 --- a/src/content/components/DictPanel/DictPanel.portal.tsx +++ b/src/content/components/DictPanel/DictPanel.portal.tsx @@ -1,6 +1,7 @@ import React, { FC } from 'react' import { ShadowPortal, defaultTimeout } from '@/components/ShadowPortal' import { DictPanel, DictPanelProps } from './DictPanel' +import { SALADICT_PANEL } from '@/_helpers/saladict' export interface DictPanelPortalProps extends DictPanelProps { show: boolean @@ -13,6 +14,7 @@ export const DictPanelPortal: FC<DictPanelPortalProps> = props => { <ShadowPortal id="saladict-dictpanel-root" head={<style>{require('./DictPanel.shadow.scss').toString()}</style>} + shadowRootClassName={SALADICT_PANEL} in={show} timeout={withAnimation ? defaultTimeout : 0} > diff --git a/src/content/components/DictPanel/DictPanel.tsx b/src/content/components/DictPanel/DictPanel.tsx index 9acd002ee..e36093fcf 100644 --- a/src/content/components/DictPanel/DictPanel.tsx +++ b/src/content/components/DictPanel/DictPanel.tsx @@ -1,5 +1,6 @@ import React, { FC, ReactNode, useState, useEffect } from 'react' import ResizeReporter from 'react-resize-reporter' +import { SALADICT_EXTERNAL, SALADICT_PANEL } from '@/_helpers/saladict' export interface DictPanelProps { x: number @@ -28,12 +29,15 @@ export const DictPanel: FC<DictPanelProps> = props => { }, [props.x, props.y]) useEffect(() => { - setCord(reconcile(props.width, height, cord.x, cord.y)) + setCord(cord => reconcile(props.width, height, cord.x, cord.y)) }, [props.width, height]) return ( <div - className={`dictPanel-Root${props.withAnimation ? ' isAnimate' : ''}`} + className={ + `dictPanel-Root ${SALADICT_EXTERNAL} ${SALADICT_PANEL}` + + (props.withAnimation ? ' isAnimate' : '') + } style={{ left: cord.x, top: cord.y, diff --git a/src/content/components/SaladBowl/SaladBowl.tsx b/src/content/components/SaladBowl/SaladBowl.tsx index 449bcc1ba..72417e197 100644 --- a/src/content/components/SaladBowl/SaladBowl.tsx +++ b/src/content/components/SaladBowl/SaladBowl.tsx @@ -4,6 +4,7 @@ import { useObservableCallback } from 'observable-hooks' import { hover } from '@/_helpers/observables' +import { SALADICT_EXTERNAL } from '@/_helpers/saladict' export interface SaladBowlProps { /** Viewport based coordinate. */ @@ -57,7 +58,7 @@ export const SaladBowl: FC<SaladBowlProps> = props => { <div role="img" className={ - 'saladbowl' + + `saladbowl ${SALADICT_EXTERNAL}` + (props.withAnimation ? ' isAnimate' : '') + (props.enableHover ? ' enableHover' : '') } diff --git a/src/content/components/WaveformBox/WaveformBox.tsx b/src/content/components/WaveformBox/WaveformBox.tsx index 02156c4c1..93d0850a0 100644 --- a/src/content/components/WaveformBox/WaveformBox.tsx +++ b/src/content/components/WaveformBox/WaveformBox.tsx @@ -1,11 +1,14 @@ import React, { useState } from 'react' import CSSTransition from 'react-transition-group/CSSTransition' +import { SALADICT_EXTERNAL } from '@/_helpers/saladict' export const WaveformBox = () => { const [expand, setExpand] = useState(false) return ( - <div className={`waveformBox${expand ? ' isExpand' : ''}`}> + <div + className={`waveformBox ${SALADICT_EXTERNAL}${expand ? ' isExpand' : ''}`} + > <button className="waveformBox-DrawerBtn" onClick={() => setExpand(!expand)} diff --git a/src/content/components/WordEditor/WordEditor.tsx b/src/content/components/WordEditor/WordEditor.tsx index 7961a4da8..0d26cc2b5 100644 --- a/src/content/components/WordEditor/WordEditor.tsx +++ b/src/content/components/WordEditor/WordEditor.tsx @@ -1,5 +1,6 @@ import React, { FC } from 'react' import { WordEditorPanel, WordEditorPanelProps } from './WordEditorPanel' +import { SALADICT_EXTERNAL } from '@/_helpers/saladict' export interface WordEditorProps extends WordEditorPanelProps { dictPanelWidth: number @@ -8,7 +9,7 @@ export interface WordEditorProps extends WordEditorPanelProps { export const WordEditor: FC<WordEditorProps> = props => { const { dictPanelWidth, ...restProps } = props return ( - <div className="wordEditor-Container"> + <div className={`wordEditor-Container ${SALADICT_EXTERNAL}`}> <div className="wordEditor-PanelContainer" style={{ width: window.innerWidth - dictPanelWidth - 40 }} diff --git a/src/selection/helper.ts b/src/selection/helper.ts index e96fde417..9519c148c 100644 --- a/src/selection/helper.ts +++ b/src/selection/helper.ts @@ -37,7 +37,7 @@ export function whenKeyPressed( // common editors const editorTester = /CodeMirror|ace_editor|monaco-editor/ -export function isTypeField(event: MouseEvent | TouchEvent | null): boolean { +export function isTypeField(event: MouseEvent | Touch | null): boolean { if (event && event.target) { const target = event.target as Element if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA') { diff --git a/src/selection/index.ts b/src/selection/index.ts index 4bf4cc452..f152398c6 100644 --- a/src/selection/index.ts +++ b/src/selection/index.ts @@ -45,11 +45,9 @@ message if (event) { const text = getText() if (text) { - const { clientX, clientY } = - event instanceof MouseEvent ? event : event.changedTouches[0] sendMessage({ - mouseX: clientX, - mouseY: clientY, + mouseX: event.clientX, + mouseY: event.clientY, instant: true, self: isInDictPanel(event.target), word: newWord({ text, context: getSentence() }), diff --git a/src/selection/mouse-events.ts b/src/selection/mouse-events.ts index b123461cb..a0bb43422 100644 --- a/src/selection/mouse-events.ts +++ b/src/selection/mouse-events.ts @@ -23,7 +23,9 @@ import { isBlacklisted } from './helper' export function createMousedownStream() { return merge( fromEvent<MouseEvent>(window, 'mousedown', { capture: true }), - fromEvent<TouchEvent>(window, 'touchstart', { capture: true }), + fromEvent<TouchEvent>(window, 'touchstart', { capture: true }).pipe( + map(e => e.changedTouches[0]) + ), of(null) ).pipe( // returns the last mousedown immediately when subscribe @@ -38,7 +40,10 @@ export function createMousedownStream() { * 2. Event target is not a Saladict exposed element. * 3. Site url is not blacked. */ -export function createValidMouseupStream(config$: Observable<AppConfig>) { +export function createValidMouseupStream( + config$: Observable<AppConfig>, + mousedown$: Observable<MouseEvent | Touch | null> +) { return merge( fromEvent<MouseEvent>(window, 'mouseup', { capture: true }).pipe( filter(e => e.button === 0) @@ -47,9 +52,10 @@ export function createValidMouseupStream(config$: Observable<AppConfig>) { map(e => e.changedTouches[0]) ) ).pipe( - withLatestFrom(config$), - filter(([event, config]) => { - if (isInSaladictExternal(event.target)) { + withLatestFrom(config$, mousedown$), + filter(([, config, mousedown]) => { + // check mousedown target instead of mouseup + if (mousedown && isInSaladictExternal(mousedown.target)) { return false } if (isBlacklisted(config)) { diff --git a/src/selection/select-text.ts b/src/selection/select-text.ts index 7e46d430c..f821ca76d 100644 --- a/src/selection/select-text.ts +++ b/src/selection/select-text.ts @@ -12,18 +12,18 @@ import { checkSupportedLangs } from '@/_helpers/lang-check' export function createSelectTextStream( config$: Observable<AppConfig>, - lastMousedown$: Observable<MouseEvent | TouchEvent | null> + lastMousedown$: Observable<MouseEvent | Touch | null> ) { if (isStandalonePage()) { return empty() } - const validMouseup$$ = createValidMouseupStream(config$) + const validMouseup$$ = createValidMouseupStream(config$, lastMousedown$) const clickPeriodCount$ = createClickPeriodCountStream(validMouseup$$) return validMouseup$$.pipe( - withLatestFrom(lastMousedown$, clickPeriodCount$), - mergeMap(([[mouseup, config], mousedown, clickCount]) => { + withLatestFrom(clickPeriodCount$), + mergeMap(([[mouseup, config, mousedown], clickCount]) => { const self = isInDictPanel(mousedown && mousedown.target) if (config.noTypeField && isTypeField(mousedown)) { diff --git a/yarn.lock b/yarn.lock index 1718ba801..1e361f203 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12962,9 +12962,9 @@ webextension-polyfill@latest: integrity sha512-oreMp+EoAo1pzRMigx4jB5jInIpx6NTCySPSjGyLLee/dCIPiRqowCEfbFP8o20wz9SOtNwSsfkaJ9D/tRgpag== webextensions-emulator@^1.1.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/webextensions-emulator/-/webextensions-emulator-1.2.2.tgz#3b1f8d2f7d5b23ff4642aa7a008e3a2ec1dad8d7" - integrity sha512-3Ir3lTmCZX4j8ztpr+b4nKeOIn/N5tUiCEsSB3luK8MWFrps06sqpXuu3EXubmyInLqcizh1SbJ536SyU1nRdQ== + version "1.2.3" + resolved "https://registry.yarnpkg.com/webextensions-emulator/-/webextensions-emulator-1.2.3.tgz#e327a18f9fc225d7756256da3245797e59309ef3" + integrity sha512-tDji5Qh4CwHtnl5E5jiTaIQIDomorebTPi11b2Dy9g8SKfXDfeVdcYQar9+IsVPAJJzsUoRn+0YwsMwfTnH2nw== dependencies: lodash "^4.17.11" sinon-chrome "^2.3.2"
refactor
detect panel
d98c16cdfca16a5f2c0df4a7ed78e75b4441c8cd
2020-05-30 13:21:30
crimx
test(sync-services): update webdav to new architecture
false
diff --git a/test/specs/background/sync-manager/services/webdav.spec.ts b/test/specs/background/sync-manager/services/webdav.spec.ts index be33c9c6d..319073188 100644 --- a/test/specs/background/sync-manager/services/webdav.spec.ts +++ b/test/specs/background/sync-manager/services/webdav.spec.ts @@ -108,6 +108,7 @@ describe('Sync service WebDAV', () => { it('upload: should success', async () => { const config: SyncConfig = { + enable: true, url: 'https://example.com/dav/', user: 'user', passwd: 'passwd', @@ -122,8 +123,7 @@ describe('Sync service WebDAV', () => { const words = [getWord(), getWord({ text: 'word' })] helpers.getNotebook.mockImplementationOnce(() => Promise.resolve(words)) - const service = new Service() - service.config = config + const service = new Service(config) await service.add({ force: true }) @@ -139,6 +139,7 @@ describe('Sync service WebDAV', () => { describe('download', () => { it('should save file on first download', async () => { const config: SyncConfig = { + enable: true, url: 'https://example.com/dav/', user: 'user', passwd: 'passwd', @@ -169,12 +170,11 @@ describe('Sync service WebDAV', () => { mockFetch(config, fetchInit) - const service = new Service() - service.config = config + const service = new Service(config) await service.download({}) - expect(helpers.setNotebook).lastCalledWith(words, true) + expect(helpers.setNotebook).lastCalledWith(words) expect(helpers.setMeta).lastCalledWith('webdav', { timestamp, etag }) expect(fetchInit.download).toHaveBeenCalledTimes(1) expect(fetchInit.download).lastCalledWith(...fetchArgs.download(config)) @@ -182,6 +182,7 @@ describe('Sync service WebDAV', () => { it('should save file if etag changed', async () => { const config: SyncConfig = { + enable: true, url: 'https://example.com/dav/', user: 'user', passwd: 'passwd', @@ -213,13 +214,12 @@ describe('Sync service WebDAV', () => { mockFetch(config, fetchInit) - const service = new Service() - service.config = config + const service = new Service(config) service.meta = { etag: etagOrigin } await service.download({}) - expect(helpers.setNotebook).lastCalledWith(words, true) + expect(helpers.setNotebook).lastCalledWith(words) expect(helpers.setMeta).lastCalledWith('webdav', { timestamp, etag }) expect(fetchInit.download).toHaveBeenCalledTimes(1) expect(fetchInit.download).lastCalledWith( @@ -232,6 +232,7 @@ describe('Sync service WebDAV', () => { it('should do nothing if 304 (same etag)', async () => { const config: SyncConfig = { + enable: true, url: 'https://example.com/dav/', user: 'user', passwd: 'passwd', @@ -254,8 +255,7 @@ describe('Sync service WebDAV', () => { mockFetch(config, fetchInit) - const service = new Service() - service.config = config + const service = new Service(config) service.meta = { etag } await service.download({}) @@ -273,6 +273,7 @@ describe('Sync service WebDAV', () => { it('should do nothing if etags are different but timestamps are identical', async () => { const config: SyncConfig = { + enable: true, url: 'https://example.com/dav/', user: 'user', passwd: 'passwd', @@ -305,8 +306,7 @@ describe('Sync service WebDAV', () => { mockFetch(config, fetchInit) - const service = new Service() - service.config = config + const service = new Service(config) service.meta = { etag: etagOrigin, timestamp: file.timestamp @@ -327,6 +327,7 @@ describe('Sync service WebDAV', () => { it('should do nothing if etags are different but timestamps are identical', async () => { const config: SyncConfig = { + enable: true, url: 'https://example.com/dav/', user: 'user', passwd: 'passwd', @@ -359,8 +360,7 @@ describe('Sync service WebDAV', () => { mockFetch(config, fetchInit) - const service = new Service() - service.config = config + const service = new Service(config) service.meta = { etag: etagOrigin, timestamp: file.timestamp @@ -381,6 +381,7 @@ describe('Sync service WebDAV', () => { it('should do nothing if words are corrupted', async () => { const config: SyncConfig = { + enable: true, url: 'https://example.com/dav/', user: 'user', passwd: 'passwd', @@ -407,13 +408,12 @@ describe('Sync service WebDAV', () => { mockFetch(config, fetchInit) - const service = new Service() - service.config = config + const service = new Service(config) try { await service.download({}) } catch (e) { - expect(e).toBe('format') + expect(e.message).toBe('format') } expect(helpers.setNotebook).toHaveBeenCalledTimes(0) @@ -424,6 +424,7 @@ describe('Sync service WebDAV', () => { it('should do nothing if network failed', async () => { const config: SyncConfig = { + enable: true, url: 'https://example.com/dav/', user: 'user', passwd: 'passwd', @@ -441,13 +442,12 @@ describe('Sync service WebDAV', () => { mockFetch(config, fetchInit) - const service = new Service() - service.config = config + const service = new Service(config) try { await service.download({}) } catch (e) { - expect(e).toBe('network') + expect(e.message).toBe('network') } expect(helpers.setNotebook).toHaveBeenCalledTimes(0) @@ -460,6 +460,7 @@ describe('Sync service WebDAV', () => { describe('initServer', () => { it('should create dir and upload files on first init', async () => { const config: SyncConfig = { + enable: true, url: 'https://example.com/dav/', user: 'user', passwd: 'passwd', @@ -495,11 +496,10 @@ describe('Sync service WebDAV', () => { mockFetch(config, fetchInit) - const service = new Service() - service.config = config + const service = new Service(config) service.download = jest.fn(() => Promise.resolve()) - await service.init(config) + await service.init() expect(service.download).toHaveBeenCalledTimes(0) expect(fetchInit.checkServer).toHaveBeenCalledTimes(1) @@ -516,6 +516,7 @@ describe('Sync service WebDAV', () => { it('should do nothing if local files are older', async () => { const config: SyncConfig = { + enable: true, url: 'https://example.com/dav/', user: 'user', passwd: 'passwd', @@ -559,11 +560,10 @@ describe('Sync service WebDAV', () => { ) mockFetch(config, fetchInit) - const service = new Service() - service.config = config + const service = new Service(config) service.download = jest.fn(() => Promise.resolve()) - await service.init(config) + await service.init() expect(service.download).toHaveBeenCalledTimes(0) expect(fetchInit.checkServer).toHaveBeenCalledTimes(1) @@ -580,6 +580,7 @@ describe('Sync service WebDAV', () => { it('should reject with "network" if netword errored', async () => { const config: SyncConfig = { + enable: true, url: 'https://example.com/dav/', user: 'user', passwd: 'passwd', @@ -595,14 +596,13 @@ describe('Sync service WebDAV', () => { mockFetch(config, fetchInit) - const service = new Service() - service.config = config + const service = new Service(config) service.download = jest.fn(() => Promise.resolve()) try { - await service.init(config) + await service.init() } catch (e) { - expect(e).toBe('network') + expect(e.message).toBe('network') } expect(service.download).toHaveBeenCalledTimes(0) @@ -620,6 +620,7 @@ describe('Sync service WebDAV', () => { it('should reject with "mkcol" if cannot create dir', async () => { const config: SyncConfig = { + enable: true, url: 'https://example.com/dav/', user: 'user', passwd: 'passwd', @@ -635,14 +636,13 @@ describe('Sync service WebDAV', () => { mockFetch(config, fetchInit) - const service = new Service() - service.config = config + const service = new Service(config) service.download = jest.fn(() => Promise.resolve()) try { - await service.init(config) + await service.init() } catch (e) { - expect(e).toBe('mkcol') + expect(e.message).toBe('mkcol') } expect(service.download).toHaveBeenCalledTimes(0) @@ -661,6 +661,7 @@ describe('Sync service WebDAV', () => { // @upstream JSDOM missing namespace selector support // it('should reject with "exist" if local has a newer file', async () => { // const config: SyncConfig = { + // enable: true, // url: 'https://example.com/dav/', // user: 'user', // passwd: 'passwd',
test
update webdav to new architecture
170fe721b21acf4778f64cec6d13246d8a586a5c
2019-09-30 09:24:11
crimx
fix(popup): correct popup width
false
diff --git a/src/content/components/DictPanel/DictPanelStandalone.scss b/src/content/components/DictPanel/DictPanelStandalone.scss index b7eb55cff..81fbd219f 100644 --- a/src/content/components/DictPanel/DictPanelStandalone.scss +++ b/src/content/components/DictPanel/DictPanelStandalone.scss @@ -11,6 +11,6 @@ box-shadow: rgba(0, 0, 0, 0.8) 0px 5px 20px -12px; &.isAnimate { - transition: height 0.4s, width 0.4s; + transition: height 0.4s; } } diff --git a/src/popup/Popup.tsx b/src/popup/Popup.tsx index 327c1d046..9e45ae94d 100644 --- a/src/popup/Popup.tsx +++ b/src/popup/Popup.tsx @@ -69,7 +69,7 @@ export const Popup: FC<PopupProps> = props => { return ( <div className={`popup-root${config.darkMode ? ' dark-mode' : ''}`}> <DictPanelStandaloneContainer - width="450px" + width="100vw" height={dictPanelHeight + 'px'} /> <div diff --git a/src/popup/_style.scss b/src/popup/_style.scss index 905097861..df90246aa 100644 --- a/src/popup/_style.scss +++ b/src/popup/_style.scss @@ -28,7 +28,7 @@ body { overflow: hidden; display: flex; flex-direction: column-reverse; - width: 450px; + width: 100vw; height: 550px; font-size: 14px; }
fix
correct popup width
20a942a07db2d7c70352edd77409192b5713c392
2018-11-01 13:49:40
CRIMX
feat: add shift for instant search
false
diff --git a/src/app-config/index.ts b/src/app-config/index.ts index 6f253e827..f773cf0cb 100644 --- a/src/app-config/index.ts +++ b/src/app-config/index.ts @@ -103,7 +103,7 @@ export interface AppConfigMutable { /** cursor instant capture */ instant: { enable: boolean - key: 'direct' | 'ctrl' | 'alt' + key: 'direct' | 'ctrl' | 'alt' | 'shift' delay: number } }, @@ -123,7 +123,7 @@ export interface AppConfigMutable { /** cursor instant capture */ instant: { enable: boolean - key: 'direct' | 'ctrl' | 'alt' + key: 'direct' | 'ctrl' | 'alt' | 'shift' delay: number } }, @@ -143,7 +143,7 @@ export interface AppConfigMutable { /** cursor instant capture */ instant: { enable: boolean - key: 'direct' | 'ctrl' | 'alt' + key: 'direct' | 'ctrl' | 'alt' | 'shift' delay: number } }, @@ -163,7 +163,7 @@ export interface AppConfigMutable { /** cursor instant capture */ instant: { enable: boolean - key: 'direct' | 'ctrl' | 'alt' + key: 'direct' | 'ctrl' | 'alt' | 'shift' delay: number } }, diff --git a/src/app-config/merge-config.ts b/src/app-config/merge-config.ts index f30cfd7b1..f272d2207 100644 --- a/src/app-config/merge-config.ts +++ b/src/app-config/merge-config.ts @@ -49,7 +49,7 @@ export function mergeConfig (oldConfig: AppConfig, baseConfig?: AppConfig): AppC mergeBoolean('mode.holding.ctrl') mergeBoolean('mode.holding.meta') mergeBoolean('mode.instant.enable') - merge('mode.instant.key', val => val === 'direct' || val === 'ctrl' || val === 'alt') + merge('mode.instant.key', val => /^(direct|ctrl|alt|shift)$/.test(val)) mergeNumber('mode.instant.delay') mergeBoolean('pinMode.direct') @@ -58,7 +58,7 @@ export function mergeConfig (oldConfig: AppConfig, baseConfig?: AppConfig): AppC mergeBoolean('pinMode.holding.ctrl') mergeBoolean('pinMode.holding.meta') mergeBoolean('pinMode.instant.enable') - merge('pinMode.instant.key', val => val === 'direct' || val === 'ctrl' || val === 'alt') + merge('pinMode.instant.key', val => /^(direct|ctrl|alt|shift)$/.test(val)) mergeNumber('pinMode.instant.delay') mergeBoolean('panelMode.direct') @@ -67,7 +67,7 @@ export function mergeConfig (oldConfig: AppConfig, baseConfig?: AppConfig): AppC mergeBoolean('panelMode.holding.ctrl') mergeBoolean('panelMode.holding.meta') mergeBoolean('panelMode.instant.enable') - merge('panelMode.instant.key', val => val === 'direct' || val === 'ctrl' || val === 'alt') + merge('panelMode.instant.key', val => /^(direct|ctrl|alt|shift)$/.test(val)) mergeNumber('panelMode.instant.delay') mergeBoolean('qsPanelMode.direct') @@ -76,7 +76,7 @@ export function mergeConfig (oldConfig: AppConfig, baseConfig?: AppConfig): AppC mergeBoolean('qsPanelMode.holding.ctrl') mergeBoolean('qsPanelMode.holding.meta') mergeBoolean('qsPanelMode.instant.enable') - merge('qsPanelMode.instant.key', val => val === 'direct' || val === 'ctrl' || val === 'alt') + merge('qsPanelMode.instant.key', val => /^(direct|ctrl|alt|shift)$/.test(val)) mergeNumber('qsPanelMode.instant.delay') mergeNumber('doubleClickDelay') diff --git a/src/options/OptMode.vue b/src/options/OptMode.vue index 0d4b5f2cc..fde459f49 100644 --- a/src/options/OptMode.vue +++ b/src/options/OptMode.vue @@ -44,6 +44,7 @@ <select class="form-control" v-model="mode.instant.key"> <option value="alt">{{ $t('opt:mode_instant_alt') }}</option> <option value="ctrl">{{ $t('opt:mode_instant_ctrl') }}</option> + <option value="shift">Shift</option> <option value="direct">{{ $t('opt:mode_instant_direct') }}</option> </select> </label> diff --git a/src/options/OptPanelMode.vue b/src/options/OptPanelMode.vue index d8b220e54..c77f348f7 100644 --- a/src/options/OptPanelMode.vue +++ b/src/options/OptPanelMode.vue @@ -41,6 +41,7 @@ <select class="form-control" v-model="panelMode.instant.key"> <option value="alt">{{ $t('opt:mode_instant_alt') }}</option> <option value="ctrl">{{ $t('opt:mode_instant_ctrl') }}</option> + <option value="shift">Shift</option> <option value="direct">{{ $t('opt:mode_instant_direct') }}</option> </select> </label> diff --git a/src/options/OptPinMode.vue b/src/options/OptPinMode.vue index 67d2f759c..c0c656b6e 100644 --- a/src/options/OptPinMode.vue +++ b/src/options/OptPinMode.vue @@ -41,6 +41,7 @@ <select class="form-control" v-model="pinMode.instant.key"> <option value="alt">{{ $t('opt:mode_instant_alt') }}</option> <option value="ctrl">{{ $t('opt:mode_instant_ctrl') }}</option> + <option value="shift">Shift</option> <option value="direct">{{ $t('opt:mode_instant_direct') }}</option> </select> </label> diff --git a/src/options/OptTripleCtrl.vue b/src/options/OptTripleCtrl.vue index b4c1d4a46..f2fea35d4 100644 --- a/src/options/OptTripleCtrl.vue +++ b/src/options/OptTripleCtrl.vue @@ -78,6 +78,7 @@ <select class="form-control" v-model="qsPanelMode.instant.key"> <option value="alt">{{ $t('opt:mode_instant_alt') }}</option> <option value="ctrl">{{ $t('opt:mode_instant_ctrl') }}</option> + <option value="shift">Shift</option> <option value="direct">{{ $t('opt:mode_instant_direct') }}</option> </select> </label> diff --git a/src/selection/index.ts b/src/selection/index.ts index 72e9d6fd2..3e2f2e1e4 100644 --- a/src/selection/index.ts +++ b/src/selection/index.ts @@ -263,6 +263,7 @@ combineLatest( fromEvent<MouseEvent>(window, 'mousemove', { capture: true }).pipe(map(e => { if ((instant === 'direct' && !(e.ctrlKey || e.metaKey || e.altKey)) || (instant === 'alt' && e.altKey) || + (instant === 'shift' && e.shiftKey) || (instant === 'ctrl' && (e.ctrlKey || e.metaKey)) ) { // harmless side effects
feat
add shift for instant search
62f65d3dac0c412e63b88af03a40634bd345a32a
2019-07-10 12:17:29
CRIMX
refactor: min stroy height
false
diff --git a/.storybook/preview-head.html b/.storybook/preview-head.html index 4e0a83640..a37c4572d 100644 --- a/.storybook/preview-head.html +++ b/.storybook/preview-head.html @@ -1,5 +1,5 @@ <style> #story-root { - min-height: 30px; + min-height: 100px; } </style>
refactor
min stroy height
7c5fb5e6be6381b822785cfe6b21742a250c2432
2019-08-18 07:23:47
crimx
fix: correctly made payload and meta optional
false
diff --git a/src/content/redux/utils/types.ts b/src/content/redux/utils/types.ts index 94ebf54da..3fd3ba3bc 100644 --- a/src/content/redux/utils/types.ts +++ b/src/content/redux/utils/types.ts @@ -3,7 +3,7 @@ import { Dispatch } from 'redux' /** Default action catalog */ export interface ActionCatalog { [type: string]: { - payload: any + payload?: any meta?: any } } @@ -14,16 +14,15 @@ export type Action< C extends ActionCatalog, T extends keyof C = keyof C > = T extends any // 'extends' hack to generate union - ? Readonly<{ - type: T - payload: 'payload' extends keyof C[T] - ? C[T][Extract<'payload', keyof C[T]>] - : undefined - error?: boolean - meta?: 'meta' extends keyof C[T] - ? C[T][Extract<'meta', keyof C[T]>] - : undefined - }> + ? Readonly< + // prettier-ignore + { + type: T + error?: boolean + } & + ('payload' extends keyof C[T] ? Pick<C[T], 'payload'> : { payload?: undefined }) & + ('meta' extends keyof C[T] ? Pick<C[T], 'meta'> : { meta?: undefined }) + > : never export type ActionHandler<
fix
correctly made payload and meta optional
39bacf934a28d7311bfc5e31f55c58b59c926269
2019-05-31 08:58:52
CRIMX
fix: same origin iframe
false
diff --git a/src/components/PortalFrame.tsx b/src/components/PortalFrame.tsx index a817b1bb8..a60251679 100644 --- a/src/components/PortalFrame.tsx +++ b/src/components/PortalFrame.tsx @@ -220,6 +220,7 @@ export default class PortalFrame extends React.PureComponent<PortalFrameProps, P ref={this._setRef} name={name || 'React Portal Frame'} srcDoc={`<!DOCTYPE html><html><head>${head || ''}</head></html>`} + sandbox='allow-same-origin allow-scripts' > {root && ReactDOM.createPortal( diff --git a/src/content/components/DictPanel/index.tsx b/src/content/components/DictPanel/index.tsx index 89a200254..e5bdb940f 100644 --- a/src/content/components/DictPanel/index.tsx +++ b/src/content/components/DictPanel/index.tsx @@ -297,8 +297,12 @@ export class DictPanel extends React.Component<DictPanelProps & { t: Translation </svg> </button> <div className='panel-AudioBox' style={{ height: audioBoxShow ? 165 : 0 }}> - {shouldLoadAudioBox - ? <iframe className='panel-AudioBoxFrame' src={browser.runtime.getURL('/audio-control.html')} frameBorder='0' /> + {shouldLoadAudioBox // x-frame-options: SAMEORIGIN + ? <iframe + className='panel-AudioBoxFrame' + src={browser.runtime.getURL('/audio-control.html')} + sandbox='allow-same-origin allow-scripts' + /> : null } </div>
fix
same origin iframe
650606597c4527f097973b0e83954cfca9444297
2018-05-12 16:58:35
CRIMX
refactor(popup): rename popup entry
false
diff --git a/src/popup/main.js b/src/popup/index.js similarity index 100% rename from src/popup/main.js rename to src/popup/index.js
refactor
rename popup entry
70060ace6a22b2b58f3ed778fd3c05cbd2276448
2019-09-30 12:36:50
crimx
chore(release): 7.0.2
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index 02820ccdd..eeb163803 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,61 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [7.0.2](https://github.com/crimx/ext-saladict/compare/v7.0.0...v7.0.2) (2019-09-30) + + +### Bug Fixes + +* **config:** number merging ([cb53388](https://github.com/crimx/ext-saladict/commit/cb53388)) +* **config:** update quick search location ([70bd9be](https://github.com/crimx/ext-saladict/commit/70bd9be)), closes [#479](https://github.com/crimx/ext-saladict/issues/479) +* **dicts:** include cambridge dphrase block ([29f7b3c](https://github.com/crimx/ext-saladict/commit/29f7b3c)), closes [#480](https://github.com/crimx/ext-saladict/issues/480) +* **pdf:** inject panel on firefox close [#477](https://github.com/crimx/ext-saladict/issues/477) ([a7ac72b](https://github.com/crimx/ext-saladict/commit/a7ac72b)) +* **popup:** correct popup width ([170fe72](https://github.com/crimx/ext-saladict/commit/170fe72)), closes [#481](https://github.com/crimx/ext-saladict/issues/481) +* **sync:** update mkcol authorzation close [#475](https://github.com/crimx/ext-saladict/issues/475) ([2e433e5](https://github.com/crimx/ext-saladict/commit/2e433e5)) + + + +### [6.33.7](https://github.com/crimx/ext-saladict/compare/v6.33.6...v6.33.7) (2019-09-13) + + + +### [6.33.6](https://github.com/crimx/ext-saladict/compare/v6.33.5...v6.33.6) (2019-09-12) + + +### Bug Fixes + +* fit the outdated typings ([f019572](https://github.com/crimx/ext-saladict/commit/f019572)) +* update dicts ([4492cd0](https://github.com/crimx/ext-saladict/commit/4492cd0)) + + + +### [6.33.5](https://github.com/crimx/ext-saladict/compare/v6.33.4...v6.33.5) (2019-08-11) + + +### Bug Fixes + +* change the checksums of panel.css ([e2ed394](https://github.com/crimx/ext-saladict/commit/e2ed394)) + + + +### [6.33.4](https://github.com/crimx/ext-saladict/compare/v6.33.3...v6.33.4) (2019-08-09) + + +### Bug Fixes + +* **manifest:** fix chrome 67 bug ([bca3b56](https://github.com/crimx/ext-saladict/commit/bca3b56)) + + + +### [6.33.3](https://github.com/crimx/ext-saladict/compare/v6.33.2...v6.33.3) (2019-08-08) + + +### Bug Fixes + +* **manifest:** remvoe update url ([f83a485](https://github.com/crimx/ext-saladict/commit/f83a485)) + + + ### [7.0.1](https://github.com/crimx/ext-saladict/compare/v7.0.0...v7.0.1) (2019-09-30) diff --git a/package.json b/package.json index e8559862c..333e9220a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "saladict", - "version": "7.0.1", + "version": "7.0.2", "description": "Chrome extension and Firefox WebExtension, inline translator powered by mutiple online dictionaries", "private": true, "scripts": {
chore
7.0.2
29c31741b6c337a07e607f1bace20ce42b7bb091
2019-07-12 16:16:41
CRIMX
refactor: zh-TW locales
false
diff --git a/src/_locales/zh-TW/common.ts b/src/_locales/zh-TW/common.ts new file mode 100644 index 000000000..ec28593b6 --- /dev/null +++ b/src/_locales/zh-TW/common.ts @@ -0,0 +1,68 @@ +import { locale as _locale } from '../zh-CN/common' + +export const locale: typeof _locale = { + add: '新增', + delete: '删除', + save: '保存', + cancel: '取消', + + edit: '編輯', + sort: '排序', + rename: '重新命名', + + confirm: '確認', + changes_confirm: '變更未儲存。確定關閉?', + delete_confirm: '確定完全刪除該條目?', + + max: '最大', + min: '最小', + + name: '名稱', + none: '無', + + enable: '開啟', + enabled: '已開啟', + disabled: '已關閉', + + blacklist: '黑名單', + whitelist: '白名單', + + lang: { + chinese: '漢字', + chs: '漢字', + deutsch: '德文', + eng: '英文', + english: '英文', + french: '法文', + japanese: '日文', + korean: '韓文', + minor: '其它語言', + others: '其它字元', + spanish: '西班牙文' + }, + + unit: { + mins: '分鐘', + ms: '毫秒', + word: '个' + }, + + note: { + word: '單字', + trans: '翻譯', + note: '筆記', + context: '上下文', + date: '日期', + srcTitle: '來源標題', + srcLink: '來源連結', + srcFavicon: '來源圖示' + }, + + profile: { + daily: '日常模式', + sentence: '句庫模式', + default: '預設模式', + scholar: '學術模式', + translation: '翻譯模式' + } +} diff --git a/src/_locales/zh-TW/content.ts b/src/_locales/zh-TW/content.ts new file mode 100644 index 000000000..8002e2cc2 --- /dev/null +++ b/src/_locales/zh-TW/content.ts @@ -0,0 +1,34 @@ +import { locale as _locale } from '../zh-CN/content' + +export const locale: typeof _locale = { + chooseLang: '-選擇其它語言-', + fetchLangList: '取得全部語言清單', + transContext: '重新翻譯', + neverShow: '不再彈出', + fromSaladict: '来自沙拉查詞介面', + tip: { + historyBack: '上一個查單字記錄', + historyNext: '下一個查單字記錄', + searchText: '查單字', + openSettings: '開啟設定', + addToNotebook: '儲存到單字本,右鍵開啟單字本', + openNotebook: '開啟單字本', + openHistory: '開啟查單字記錄', + shareImg: '以圖片方式分享查單字結果', + pinPanel: '釘選字典視窗', + closePanel: '關閉字典視窗' + }, + wordEditor: { + title: '儲存到單字本', + wordCardsTitle: '單字本其它記錄', + deleteConfirm: '從單字本中移除?', + closeConfirm: '記錄尚未儲存,確定關閉?' + }, + machineTrans: { + switch: '變更語言', + sl: '來源語言', + tl: '目標語言', + auto: '偵測語言', + stext: '原文' + } +} diff --git a/src/_locales/zh-TW/langcode.ts b/src/_locales/zh-TW/langcode.ts new file mode 100644 index 000000000..02c0daa66 --- /dev/null +++ b/src/_locales/zh-TW/langcode.ts @@ -0,0 +1,142 @@ +import { locale as _locale } from '../zh-CN/langcode' + +export const locale: typeof _locale = { + af: '南非荷蘭語', + am: '阿姆哈拉語', + ar: '阿拉伯語', + ara: '阿拉伯語', + az: '亞塞拜然語', + be: '白俄羅斯語', + bg: '保加利亞語', + bn: '孟加拉語', + bs: '波斯尼亞語', + 'bs-Latn': '波斯尼亞語', + bul: '保加利亞語', + ca: '加泰隆尼亞語', + ceb: '宿霧語', + cht: '中文(繁體)', + co: '科西嘉語', + cs: '捷克語', + cy: '威爾士語', + da: '丹麥語', + dan: '丹麥語', + de: '德語', + el: '希臘語', + en: '英語', + eo: '世界語', + es: '西班牙語', + est: '愛沙尼亞語', + et: '愛沙尼亞語', + eu: '巴斯克語', + fa: '波斯語', + fi: '芬蘭語', + fil: '菲律賓語', + fin: '芬蘭語', + fj: '斐濟語', + fr: '法語', + fra: '法語', + fy: '弗里斯蘭語', + ga: '愛爾蘭語', + gd: '蘇格蘭蓋爾語', + gl: '加利西亞語', + gu: '古吉拉特語', + ha: '豪薩語', + haw: '夏威夷語', + he: '希伯來語', + hi: '印地語', + hmn: '苗語', + hr: '克羅埃西亞語', + ht: '海地克里奧爾語', + hu: '匈牙利語', + hy: '亞美尼亞語', + id: '印度尼西亞語', + ig: '伊博語', + is: '冰島語', + it: '義大利語', + iw: '希伯來語', + ja: '日語', + jp: '日語', + jw: '爪哇語', + ka: '喬治亞語', + kk: '哈薩克語', + km: '高棉語', + kn: '康納達語', + ko: '韓語', + kor: '韓語', + kr: '韓語', + ku: '庫德語', + ky: '柯爾克孜語', + la: '拉丁語', + lb: '盧森堡語', + lo: '寮語', + lt: '立陶宛語', + lv: '拉脫維亞語', + mg: '馬拉加斯語', + mi: '毛利語', + mk: '馬其頓語', + ml: '馬拉雅拉姆語', + mn: '蒙古語', + mr: '馬拉地語', + ms: '馬來語', + mt: '馬爾他語', + mww: '白苗文', + my: '緬甸語', + ne: '尼泊爾語', + nl: '荷蘭語', + no: '挪威語', + ny: '尼揚賈語(齊切瓦語)', + otq: '克雷塔羅奧托米語', + pa: '旁遮普語', + pl: '波蘭語', + ps: '普什圖語', + pt: '葡萄牙語(葡萄牙、巴西)', + pt_BR: '巴西語', + ro: '羅馬尼亞語', + rom: '羅馬尼亞語', + ru: '俄語', + sd: '信德語', + si: '僧伽羅語', + sk: '斯洛伐克語', + sl: '斯洛維尼亞語', + slo: '斯洛維尼亞語', + sm: '薩摩亞語', + sn: '修納語', + so: '索馬利亞語', + spa: '西班牙語', + sq: '阿爾巴尼亞語', + sr: '塞爾維亞語', + 'sr-Cyrl': '塞爾維亞語(西里爾文)', + 'sr-Latn': '塞爾維亞語(拉丁文)', + st: '塞索托語', + su: '巽他語', + sv: '瑞典語', + sw: '斯瓦希里語', + swe: '瑞典語', + ta: '泰米爾語', + te: '泰盧固語', + tg: '塔吉克語', + th: '泰語', + tl: '他加祿語(菲律賓語)', + tlh: '克林貢語', + 'tlh-Qaak': '克林貢語(piqaD)', + to: '湯加語', + tr: '土耳其語', + ty: '大溪地語', + uk: '烏克蘭語', + ur: '烏爾都語', + uz: '烏茲別克語', + vi: '越南語', + vie: '越南語', + wyw: '文言文', + xh: '班圖語', + yi: '意第緒語', + yo: '約魯巴語', + yua: '猶加敦馬雅語', + yue: '粵語(繁體)', + zh: '中文(簡體)', + 'zh-CHS': '中文(簡體)', + 'zh-CHT': '中文(繁體)', + 'zh-CN': '中文(簡體)', + 'zh-TW': '中文(繁體)', + zu: '祖魯語' +} diff --git a/src/_locales/zh-TW/menus.ts b/src/_locales/zh-TW/menus.ts new file mode 100644 index 000000000..6f0a7cab7 --- /dev/null +++ b/src/_locales/zh-TW/menus.ts @@ -0,0 +1,35 @@ +import { locale as _locale } from '../zh-CN/menus' + +export const locale: typeof _locale = { + baidu_page_translate: '百度網頁翻譯', + baidu_search: '百度搜尋', + bing_dict: 'Bing 字典', + bing_search: 'Bing 搜尋', + cambridge: '劍橋字典', + dictcn: '海詞字典', + etymonline: '培根字根', + google_cn_page_translate: 'Google cn 網頁翻譯', + google_page_translate: 'Google 網頁翻譯', + google_search: 'Google 搜尋', + google_translate: 'Google 翻譯', + guoyu: '國語字典', + history_title: '查單字歷史記錄', + iciba: '金山詞霸', + liangan: '兩岸字典', + longman_business: '朗文商務', + manual_title: '詳細使用說明', + merriam_webster: '韋氏字典', + microsoft_page_translate: '微軟網頁翻譯', + notebook_title: '生字本', + notification_youdao_err: + '有道網頁翻譯2.0 下載後無回應,\n可能是套件無權造訪該網站,\n如果下載成功後,請忽略本訊息。', + oxford: '牛津字典', + page_translations: '網頁翻譯', + saladict: '沙拉查詞', + sogou: '搜狗翻譯', + sogou_page_translate: '搜狗網頁翻譯', + view_as_pdf: '在 PDF 閱讀器中開啟', + youdao: '有道字典', + youdao_page_translate: '有道網頁翻譯', + youglish: 'YouGlish' +} diff --git a/src/_locales/zh-TW/options.ts b/src/_locales/zh-TW/options.ts new file mode 100644 index 000000000..247ba6f65 --- /dev/null +++ b/src/_locales/zh-TW/options.ts @@ -0,0 +1,254 @@ +import { locale as _locale } from '../zh-CN/options' + +export const locale: typeof _locale = { + title: 'Saladict 設定', + dict: { + add: '新增字典', + default_height: '字典預設高度', + default_height_help: + '字典初次出現的最大高度。超出此高度的內容將被隱藏並顯示下箭頭。', + default_unfold: '自動展開', + default_unfold_help: + '關閉後此字典將不會自動搜尋,除非點選「展開」箭頭。適合一些需要時再深入瞭解的字典,以加快初次查字典速度。', + lang: { + de: '德', + en: '英', + es: '西', + fr: '法', + ja: '日', + kor: '韓', + zhs: '简', + zht: '繁' + }, + + more_options: '更多設定', + sel_lang: '選詞語言', + sel_lang_help: '當選中的文字包含相對應的語言時才顯示這個字典。', + sel_word_count: '選詞字數', + sel_word_count_help: '當選中文字的字數符合條件時才顯示該詞典。' + }, + + headInfo: { + acknowledgement: { + title: '特別鳴謝', + naver: '協助新增 Naver 韓國語字典', + shanbay: '編寫扇貝詞典模組', + trans_tw: '提供部分繁體中文翻譯', + weblio: '協助新增 Weblio 辭書' + }, + contact_author: '聯絡作者', + donate: '隨喜捐贈', + instructions: '使用說明', + report_issue: '軟體使用疑問和建言' + }, + + match_pattern_description: + '網址支援比對模式(<a href="https://developer.mozilla.org/zh-CN/Add-ons/WebExtensions/Match_patterns#範例" target="_blank">例子</a>)。留空儲存即可清除。', + msg_update_error: '設定更新失敗', + msg_updated: '設定已更新', + nav: { + BlackWhiteList: '黑白名單', + ContextMenus: '右鍵選單', + Dictionaries: '字典設定', + DictPanel: '字典介面', + General: '基本選項', + ImportExport: '匯入匯出', + Notebook: '單字管理', + PDF: 'PDF 設定', + Popup: '右上彈出式視窗', + Profiles: '情景模式', + QuickSearch: '迅速查字', + SearchModes: '查字習慣' + }, + + opt: { + active: '啟用滑鼠選字翻譯', + analytics: '使用者體驗改進計劃', + analytics_help: '啟用 Google Analytics 服務協助開發者改進 Saladict', + animation: '啟用轉換動畫', + animation_help: '在低效能裝置上關閉過渡動畫可減少渲染負擔。', + app_active_help: '關閉後「迅速查字」功能依然可用。', + autopron: { + accent: '優先口音', + accent_uk: '英式', + accent_us: '美式', + cn: '中文自動發音', + en: '英文自動發音', + machine: '機器自動發音', + machine_src: '機器發音部分', + machine_src_help: '機器翻譯字典需要在下方新增並啟用才會自動發音。', + machine_src_search: '朗讀原文', + machine_src_trans: '朗讀翻譯' + }, + browserAction: { + open: '點選網址列旁圖示', + openDictPanel: '開啟字典介面', + openFav: '新增選詞到生字本', + openHelp: + '點選網址列旁 Saladict 圖示時發生的操作。沿用了「右鍵選單」的條目,可以前往該設定頁面增加或編輯。', + openOptions: '進入 Saladict 設定' + }, + bowl_hover: '滑鼠查字', + bowl_hover_help: '滑鼠暫留在沙拉圖示上開啟字典介面,否則需要點選。', + config: { + export: '匯出設定', + help: '設定已通過瀏覽器自動同步,也可以手動匯入匯出。', + import: '匯入設定', + import_error: '匯入設定失敗', + reset: '重設設定', + reset_confirm: '所有設定將還原至預設值,確定?' + }, + context_description: + '有道網頁翻譯已經多年沒有更新,我做了些維護,將其內建到 Saladict 並支援 https 網頁,其它網頁翻譯擴充套件可以安裝 Google 翻譯和彩雲小譯。', + context_menus_add_rules: '連結中的 %s 會被取代為選詞。', + ctx_trans: '上下文翻譯引擎', + ctx_trans_help: '單字加入生字本前會自動翻譯上下文。', + dictPanel: { + custom_css: '自訂查字介面樣式', + custom_css_help: + '為查字介面自訂 CSS 。請使用 .saladict-DictPanel 作為根。', + font_size: '字典內容字型大小', + height_ratio: '字典介面最高占螢幕高度比例', + width: '查字典介面寬度' + }, + dict_selected: '已選字典', + double_click_delay: '滑鼠按兩下間隔', + edit_on_fav: '紅心單字時彈出編輯介面', + edit_on_fav_help: + '關閉後,點選紅心生詞將自動新增到生詞本,上下文翻譯亦會自動獲取。', + history: '記錄查字歷史', + history_help: '查字典記錄可能會泄漏您的瀏覽痕跡。', + history_inco: '在無痕模式中記錄', + language: '介面語言', + mta: '自動展開多行搜尋框', + mta_always: '保持展開', + mta_never: '永遠不展開', + mta_once: '展開一次', + mta_popup: '只在右上彈框展開', + no_type_field: '不在輸入框滑鼠滑字', + no_type_field_help: + '開啟後,本程式會自動識別輸入框以及常見編輯器,如 CodeMirror、ACE 和 Monaco。', + pdf_blackwhitelist_help: '黑名單相符的 PDF 連結將不會跳至 Saladict 開啟。', + pdf_sniff: '使用本應用程式瀏覽 PDF', + pdf_sniff_help: + '開啟後所有 PDF 連結將自動跳至本套件開啟(包括本機,如果在套件管理頁面勾選了允許)。', + profile_change: '此選項會因「情景模式」而改變。', + quick_search: '啟用快速鍵', + search_suggests: '輸入時顯示候選', + sel_blackwhitelist: '選詞黑白名單', + sel_blackwhitelist_help: '黑名單相符的頁面 Saladict 將不會響應滑鼠劃詞。', + sel_lang: '選詞語言', + sel_lang_help: '當選取的文字包含相對應的語言時,才進行尋找。', + sel_lang_warning: + '注意日語與韓語也包含了漢字。法語、德語和西語也包含了英文。若取消了中文或英語而勾選了其它語言,則只翻譯那些語言獨有的部分,如日語只翻譯假名。', + shortcuts: '設定快速鍵', + searchMode: { + direct: '直接搜尋', + direct_help: '直接顯示字典視窗介面。', + double: '滑鼠按兩下', + double_help: '滑鼠按兩下所選擇的句子或單字後,會直接顯示字典視窗介面。', + holding: '按住按键', + holding_help: + '在放開滑鼠之前,需按住選擇的按鍵才顯示字典視窗介面(Meta 鍵為 Mac 上的「⌘ Command」鍵以及其它鍵盤的「⊞ Windows」鍵)。', + icon: '顯示圖示', + iconHelp: + '在滑鼠附近顯示一個圖示,滑鼠移動到圖示後,會顯示出字典的視窗介面。', + instant: '滑鼠懸浮取詞', + instantDelay: '取詞等待', + instantDirect: '直接取詞', + instantHelp: + '自動選取滑鼠附近的單字,自動選取滑鼠附近的單詞,因技術限制,懸浮取詞通過自動選擇滑鼠附近單字實現,不設定按鍵直接取詞可能導致滑鼠無法選字,建議配合快速鍵開啟關閉。', + instantKey: '按鍵', + mode: '普通選詞', + panelMode: '字典視窗介面內部選詞', + pinMode: '字典視窗介面釘住后選詞', + qsPanelMode: '滑鼠選字' + }, + syncShanbay: '新增扇貝生詞本同步', + syncWebdav: '新增 WebDAV 同步', + waveform: '波形控制', + waveform_help: + '顯示音訊波形控制面板。關閉依然可以播放音訊,并減少效能消耗。' + }, + + quickSearch: { + height: '視窗高度', + help: + '連續按三次<kbd>⌘ Command</kbd>(Mac)或者<kbd>Ctrl</kbd>(其它鍵盤)(或設定瀏覽器快速鍵),將會彈出字典視窗介面。', + loc: '出現位置', + page_sel: '響應滑字', + page_sel_help: '對網頁滑鼠滑字作出反應。', + sidebar: '類側邊欄', + sidebar_help: '並排顯示視窗以達到類似側邊欄的配置。', + standalone: '獨立視窗', + standalone_help: + '顯示為獨立的視窗(需配合 <a href="https://getquicker.net/Sharedaction?code=42abae81-ed41-4f16-269a-08d668af12c8" target="_blank">Quicker</a> 響應瀏覽器以外的滑鼠選字)。', + locations: [ + '居中', + '上方', + '右方', + '下方', + '左方', + '左上', + '右上', + '左下', + '右下' + ] + }, + + preload: { + title: '預先下載', + auto: '自動查字', + auto_help: '字典介面出現時自動搜尋預先載入內容。', + clipboard: '剪貼簿', + help: '字典介面出現時預先載入內容到搜尋框。', + selection: '滑鼠選字' + }, + + profiles: { + add_name: '新增情景模式名稱', + delete_confirm: '「{{name}}」將被刪除,確認?', + edit_name: '變更情景模式名稱', + help: + '一些選項(帶有 <span style="color:#f5222d">*</span>)會隨著情景模式變化。滑鼠懸浮在字典介面的選單圖示上可快速切換,或者焦點選中選單圖示然後按<kbd>↓</kbd>。' + }, + + sync: { + description: '資料同步設定。', + start: '同步已在背景開始', + success: '同步成功', + failed: '同步失敗', + close_confirm: '設定未儲存,關閉?', + delete_confirm: '清空同步設定?', + error_url: '不正確的超連結格式。', + shanbay: { + title: '扇貝生詞本同步', + description: + '使用登入了 shanbay.com 的帳號同步。單向同步到扇貝生詞本(只從沙拉查詞到扇貝),只同步新增單詞(刪除不同步),只同步單詞本身(上下文等均沒有同步)。生詞需要存在扇貝單詞庫才能被新增。', + login: '將開啟扇貝官網,請登入再回來重新開啟。', + sync_all: '上傳現有的所有生字', + sync_all_confirm: + '生詞本存在較多單詞,將分批上傳。注意上傳太多有可能會導致封號,且不可恢復,確定繼續?', + sync_last: '上傳最近的一個生字' + }, + + webdav: { + checking: '連線中...', + duration: '同步頻率', + duration_help: + '新增生字後會馬上上傳,資料會在上傳前保證同步,所以如果不需要多個瀏覽器即時檢視更新,可將更新檢查週期調大些以減少資源佔用及避免伺服器拒絕回應。', + err_exist: '伺服器上 Saladict 目錄下的檔案將被替換。先下載合併到本機?', + err_mkcol: '無法在伺服器建立“Saladict”目錄。請手動在伺服器上建立。', + err_network: '連線伺服器失敗。', + err_parse: '伺服器返回 XML 格式不正確。', + err_unauthorized: '帳戶或密碼不正確。', + err_unknown: '不詳錯誤 「{{error}}」。', + explain: + '應用設定(包括本設定)已通過瀏覽器自動同步。生詞本可通過本設定實現 WebDAV 同步。<a href="http://help.jianguoyun.com/?p=2064" target="_blank">參考堅果雲設定</a>。', + passwd: '密碼', + title: 'WebDAV 同步', + url: '伺服器位址', + user: '帳戶' + } + } +} diff --git a/src/_locales/zh-TW/popup.ts b/src/_locales/zh-TW/popup.ts new file mode 100644 index 000000000..0840e9a68 --- /dev/null +++ b/src/_locales/zh-TW/popup.ts @@ -0,0 +1,13 @@ +import { locale as _locale } from '../zh-CN/popup' + +export const locale: typeof _locale = { + app_active_title: '啟用滑鼠選字', + app_temp_active_title: '對目前頁面暫時關閉滑鼠選字', + instant_capture_pinned: '(釘選)', + instant_capture_title: '啟用滑鼠懸浮取詞', + notebook_added: '已新增', + notebook_empty: '目前頁面沒有發現選詞', + notebook_error: '無法新增選詞到生字本', + page_no_response: '頁面無回應', + qrcode_title: '目前頁面二維條碼' +} diff --git a/src/_locales/zh-TW/wordpage.ts b/src/_locales/zh-TW/wordpage.ts new file mode 100644 index 000000000..3db6b6dd1 --- /dev/null +++ b/src/_locales/zh-TW/wordpage.ts @@ -0,0 +1,51 @@ +import { locale as _locale } from '../zh-CN/wordpage' + +export const locale: typeof _locale = { + title: { + history: 'Saladict 查單字紀錄(僅本機儲存)', + notebook: 'Saladict 生字本(僅本機儲存)' + }, + + column: { + add: '新增', + date: '日期', + edit: '編輯', + note: '筆記', + source: '來源', + trans: '翻譯', + word: '單字' + }, + + delete: { + title: '刪除單字', + all: '刪除所有單字', + confirm: ',確認?', + page: '刪除本頁單字', + selected: '刪除選取單字' + }, + + export: { + title: '匯出文字', + all: '匯出所有單字', + description: '編寫產生的範本,描述每條記錄產生的樣子:', + explain: '如何配合 ANKI 等工具', + gencontent: '代表的內容', + page: '輸出本頁單字', + placeholder: '預留位置', + selected: '輸出選中單字' + }, + + filterWord: { + chs: '中文', + eng: '英文', + word: '單字', + phrase: '片語和句子' + }, + + wordCount: { + selected: '已選中 {{count}} 個單字', + selected_plural: '已選中 {{count}} 個單字', + total: '共有 {{count}} 個單字', + total_plural: '共有 {{count}} 個單字' + } +}
refactor
zh-TW locales
b2ee0c3d1ada63468da8661e3e5814a761ed23fb
2020-07-05 18:49:43
crimx
refactor(components): let float box support select
false
diff --git a/package.json b/package.json index c5ee09847..8da220328 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "react-hot-loader": "^4", "react-number-editor": "^4.0.3", "react-redux": "^7.1.0", - "react-resize-reporter": "^1.0.0", + "react-resize-reporter": "^1.0.1", "react-retux": "^0.1.0", "react-shadow": "17.1.x", "react-sortable-hoc": "^1.10.1", diff --git a/src/components/FloatBox/FloatBox.scss b/src/components/FloatBox/FloatBox.scss index 72d9979c9..2a6dd9d70 100644 --- a/src/components/FloatBox/FloatBox.scss +++ b/src/components/FloatBox/FloatBox.scss @@ -1,31 +1,81 @@ .floatBox-Container { position: relative; overflow: hidden; - padding: 10px; + box-sizing: border-box; word-break: keep-all; white-space: nowrap; border-radius: 10px; background: #fff; box-shadow: 0px 4px 31px -8px rgba(0, 0, 0, 0.8); -} - -@-moz-document url-prefix() { - .floatBox-Container { - box-shadow: 0px 4px 20px -8px rgba(0, 0, 0, 0.8); - } + font-size: var(--panel-font-size); } .floatBox-Measure { position: absolute; - top: 10; - left: 10; + top: 0; + left: 0; + width: max-content; // for including <select> width max-width: calc(var(--panel-width) * 0.7); + padding: 10px; } -// .floatBox { -// max-height: calc(var(--panel-max-height) * 0.75); -// overflow: hidden; -// } +.floatBox-Item { + display: block; + width: 100%; + overflow: hidden; + padding: 5px 10px; + font-size: 1em; + text-overflow: ellipsis; + text-align: initial; + outline: none; + border: none; + border-radius: 3px; + color: var(--color-font); + background-color: transparent; + cursor: pointer; + + &:hover, + &:focus { + background-color: rgba(215, 214, 214, 0.25); + } + + &::-moz-focus-inner { + border: 0; + } + + &:first-child { + border-top-left-radius: 8px; + border-top-right-radius: 8px; + } + + &:last-child { + border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; + } +} + +.floatBox-Select { + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; + box-sizing: border-box; + margin: 0; + padding-right: 1.5em !important; + background-color: transparent; + background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%231abc9c%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'); + background-repeat: no-repeat, repeat; + background-position: right .5em top 50%, 0 0; + background-size: .65em auto, 100%; + + &::-ms-expand { + display: none; + } + + option { + font-size: 1em; + font-weight: normal; + } +} .floatBox-Btn { display: block; @@ -51,12 +101,12 @@ border: 0; } - &:first-of-type { + &:first-child { border-top-left-radius: 8px; border-top-right-radius: 8px; } - &:last-of-type { + &:last-child { border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; } @@ -69,39 +119,37 @@ .floatBox-compact { &.floatBox-Container { - padding: 5px 6px; + font-size: 12px; border-radius: 7px; box-shadow: 0px 1px 15px -7px rgba(0, 0, 0, 0.8); } - .floatBox-Btn { + .floatBox-Measure { + padding: 5px 6px; + } + + .floatBox-Item { padding: 3px 7px; border-radius: 2px; - &:first-of-type { + &:first-child { border-top-left-radius: 5px; border-top-right-radius: 5px; } - &:last-of-type { + &:last-child { border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; } } } -@-moz-document url-prefix() { - .floatBox-compact.floatBox-Container { - box-shadow: 0px 1px 13px -7px rgba(0, 0, 0, 0.8); - } -} - .darkMode { .floatBox-Container { background: #2d3338; } - .floatBox-Btn { + .floatBox-Item { border: 1px solid transparent; border-radius: 5px; @@ -119,6 +167,16 @@ } } +@-moz-document url-prefix() { + .floatBox-Container { + box-shadow: 0px 4px 20px -8px rgba(0, 0, 0, 0.8); + + &.floatBox-compact { + box-shadow: 0px 1px 13px -7px rgba(0, 0, 0, 0.8); + } + } +} + // modify from https://loading.io/css/ .lds-ellipsis { display: block; diff --git a/src/components/FloatBox/FloatBox.stories.tsx b/src/components/FloatBox/FloatBox.stories.tsx index aa46aee2d..070f397d4 100644 --- a/src/components/FloatBox/FloatBox.stories.tsx +++ b/src/components/FloatBox/FloatBox.stories.tsx @@ -33,14 +33,26 @@ storiesOf('Content Scripts|Components', module) return ( <FloatBox list={ - boolean('Loading', true) + boolean('Loading', false) ? undefined - : Array(faker.random.number(10)) - .fill(0) - .map(() => { - const word = faker.hacker.noun() - return { key: word, content: word } - }) + : uniqueWordList(15).map(word => { + return faker.random.boolean() + ? { + key: word, + value: word, + label: word + } + : { + key: word, + value: word, + options: [ + { value: word, label: word }, + ...uniqueWordList(15).map(word => { + return { value: word, label: word } + }) + ] + } + }) } compact={boolean('Compact', true)} onSelect={action('onSelect')} @@ -55,3 +67,13 @@ storiesOf('Content Scripts|Components', module) /> ) }) + +function uniqueWordList(max: number): string[] { + return [ + ...new Set( + Array(faker.random.number(max)) + .fill(0) + .map(() => faker.random.word()) + ) + ] +} diff --git a/src/components/FloatBox/index.tsx b/src/components/FloatBox/index.tsx index cc887da0e..0e4558146 100644 --- a/src/components/FloatBox/index.tsx +++ b/src/components/FloatBox/index.tsx @@ -2,18 +2,36 @@ import React, { FC, Ref, useState, useCallback } from 'react' import { ResizeReporter } from 'react-resize-reporter/scroll' import classnames from 'classnames' +export type FloatBoxItem = + | { + // <button> + key: string + value: string + label: string + options?: undefined + } + | { + // <select> + key: string + value: string + options: Array<{ + value: string + label: string + }> + } + export interface FloatBoxProps { - list?: Array<{ key: string; content: React.ReactNode }> + list?: FloatBoxItem[] /** compact layout */ compact?: boolean /** Box container */ ref?: Ref<HTMLDivElement> /** When a item is selected */ - onSelect?: (key: string) => any + onSelect?: (key: string, value: string) => any /** When a item is focused */ - onFocus?: (e: React.FocusEvent<HTMLButtonElement>) => any + onFocus?: (e: React.FocusEvent<HTMLButtonElement | HTMLSelectElement>) => any /** When a item is blur */ - onBlur?: (e: React.FocusEvent<HTMLButtonElement>) => any + onBlur?: (e: React.FocusEvent<HTMLButtonElement | HTMLSelectElement>) => any /** When mouse over on panel */ onMouseOver?: (e: React.MouseEvent<HTMLDivElement>) => any /** When mouse out on panel */ @@ -40,7 +58,7 @@ export const FloatBox: FC<FloatBoxProps> = React.forwardRef( _setWidth(newWidth) _setHeight(newHeight) if (props.onHeightChanged && newHeight !== height) { - props.onHeightChanged(newHeight + 20) // plus paddings + props.onHeightChanged(newHeight) } }, [props.onHeightChanged] @@ -67,59 +85,94 @@ export const FloatBox: FC<FloatBoxProps> = React.forwardRef( </div> ) : ( <div key="box" ref={containerRef} className="floatBox"> - {props.list.map(item => ( - <button - key={item.key} - className="floatBox-Btn" - onFocus={props.onFocus} - onBlur={props.onBlur} - onClick={e => - props.onSelect && - props.onSelect(e.currentTarget.dataset.key!) - } - onKeyDown={e => { - if (e.key === 'ArrowDown') { - e.preventDefault() - e.stopPropagation() - const $nextLi = e.currentTarget.nextSibling - if ($nextLi) { - ;($nextLi as HTMLButtonElement).focus() - } else if (props.onArrowDownLast) { - props.onArrowDownLast( - e.currentTarget.parentElement as HTMLDivElement - ) - } - } else if (e.key === 'ArrowUp') { - e.preventDefault() - e.stopPropagation() - const $prevLi = e.currentTarget.previousSibling - if ($prevLi) { - ;($prevLi as HTMLButtonElement).focus() - } else if (props.onArrowUpFirst) { - props.onArrowUpFirst( - e.currentTarget.parentElement as HTMLDivElement - ) - } - } else if (e.key === 'Escape') { - // prevent the dict panel being closed - e.preventDefault() - e.stopPropagation() - if (props.onClose) { - props.onClose( - e.currentTarget.parentElement as HTMLDivElement - ) - } - } - }} - data-key={item.key} - > - {item.content} - </button> - ))} + {props.list.map(renderBoxItem)} </div> )} </div> </div> ) + + function renderBoxItem(item: FloatBoxItem) { + if (item.options) { + return ( + <select + key={item.key} + className="floatBox-Item floatBox-Select" + data-key={item.key} + defaultValue={item.value} + onFocus={props.onFocus} + onBlur={props.onBlur} + onChange={onSelectItemChange} + > + {item.options.map(opt => ( + <option key={opt.value} value={opt.value}> + {opt.label} + </option> + ))} + </select> + ) + } + + return ( + <button + key={item.key} + className="floatBox-Item floatBox-Btn" + data-key={item.key} + date-value={item.value} + onFocus={props.onFocus} + onBlur={props.onBlur} + onClick={onBtnItemClick} + onKeyDown={onBtnItemKeyDown} + > + {item.label} + </button> + ) + } + + function onSelectItemChange(e: React.ChangeEvent<HTMLSelectElement>) { + if (props.onSelect) { + const { + dataset: { key }, + value + } = e.currentTarget + props.onSelect(key!, value) + } + } + + function onBtnItemClick(e: React.MouseEvent<HTMLButtonElement>) { + if (props.onSelect) { + const { key, value } = e.currentTarget.dataset + props.onSelect(key!, value!) + } + } + + function onBtnItemKeyDown(e: React.KeyboardEvent<HTMLButtonElement>) { + if (e.key === 'ArrowDown') { + e.preventDefault() + e.stopPropagation() + const $nextLi = e.currentTarget.nextSibling + if ($nextLi) { + ;($nextLi as HTMLButtonElement).focus() + } else if (props.onArrowDownLast) { + props.onArrowDownLast(e.currentTarget.parentElement as HTMLDivElement) + } + } else if (e.key === 'ArrowUp') { + e.preventDefault() + e.stopPropagation() + const $prevLi = e.currentTarget.previousSibling + if ($prevLi) { + ;($prevLi as HTMLButtonElement).focus() + } else if (props.onArrowUpFirst) { + props.onArrowUpFirst(e.currentTarget.parentElement as HTMLDivElement) + } + } else if (e.key === 'Escape') { + // prevent the dict panel being closed + e.preventDefault() + e.stopPropagation() + if (props.onClose) { + props.onClose(e.currentTarget.parentElement as HTMLDivElement) + } + } + } } ) diff --git a/src/components/HoverBox/index.tsx b/src/components/HoverBox/index.tsx index 144e926a0..1b2cb3d61 100644 --- a/src/components/HoverBox/index.tsx +++ b/src/components/HoverBox/index.tsx @@ -8,9 +8,11 @@ import { } from 'observable-hooks' import { merge } from 'rxjs' import { hover, hoverWithDelay, focusBlur } from '@/_helpers/observables' -import { FloatBox } from '../FloatBox' +import { FloatBox, FloatBoxItem } from '../FloatBox' import { createPortal } from 'react-dom' +export type HoverBoxItem = FloatBoxItem + /** * Accept a optional root element via Context which * will be the parent element of the float boxes. @@ -23,12 +25,12 @@ export const HoverBoxContext = React.createContext< export interface HoverBoxProps { Button: React.ComponentType<React.ComponentProps<'button'>> - items: Array<{ key: string; content: React.ReactNode }> + items: HoverBoxItem[] /** Compact float box */ compact?: boolean top?: number left?: number - onSelect?: (key: string) => void + onSelect?: (key: string, value: string) => void /** return false to prevent showing float box */ onBtnClick?: () => boolean onHeightChanged?: (height: number) => void @@ -89,9 +91,9 @@ export const HoverBox: FC<HoverBoxProps> = props => { e.stopPropagation() if (isShowBox) { if (boxRef.current) { - const firstBtn = boxRef.current.querySelector('button') + const firstBtn = boxRef.current.firstElementChild if (firstBtn) { - firstBtn.focus() + ;(firstBtn as HTMLButtonElement | HTMLSelectElement).focus() } } } else { @@ -103,9 +105,9 @@ export const HoverBox: FC<HoverBoxProps> = props => { if (!e.shiftKey && isShowBox && boxRef.current) { e.preventDefault() e.stopPropagation() - const firstBtn = boxRef.current.querySelector('button') + const firstBtn = boxRef.current.firstElementChild if (firstBtn) { - firstBtn.focus() + ;(firstBtn as HTMLButtonElement | HTMLSelectElement).focus() } } break diff --git a/yarn.lock b/yarn.lock index 2265323dc..9ed8fe261 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12308,10 +12308,10 @@ react-resize-detector@^4.0.5: raf-schd "^4.0.2" resize-observer-polyfill "^1.5.1" -react-resize-reporter@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/react-resize-reporter/-/react-resize-reporter-1.0.0.tgz#d572a66eea1e8bc22c7ce86d6a184557729601e4" - integrity sha512-/Qx3zH/0IXVxHY8FCsKgxOq2hCjPRFolD6PAqiWvkwFlmIwVlB8RQbcXq2gQOnpO8fm1fODLKnoOnb9l2fDsag== +react-resize-reporter@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/react-resize-reporter/-/react-resize-reporter-1.0.1.tgz#58ee60bd49eccaa48ce945c62bea29c3b2e7d038" + integrity sha512-5TStFJqzS2GE9Q4I80P7GS7b2A8BDXhtkFqP0iO9ta98qAZZZWt2mfQYUy4vduyoiiy/niftVawyEIZB7MJPUA== react-retux@^0.1.0: version "0.1.0"
refactor
let float box support select
59f29640d57cf8b284deb304e35dbfd939f319bf
2018-06-08 06:18:19
CRIMX
refactor(config): increase selection max length
false
diff --git a/src/app-config/dicts.ts b/src/app-config/dicts.ts index f18e3a765..0743229cb 100644 --- a/src/app-config/dicts.ts +++ b/src/app-config/dicts.ts @@ -238,7 +238,7 @@ export function getALlDicts () { /** Word count to start searching */ selectionWC: { min: 1, - max: 100, + max: 999999, }, /** Only start searching if the selection contains the language. */ selectionLang: { @@ -605,7 +605,7 @@ export function getALlDicts () { /** Word count to start searching */ selectionWC: { min: 1, - max: 100, + max: 999999, }, /** Only start searching if the selection contains the language. */ selectionLang: {
refactor
increase selection max length
07587e26ee8815cf81b1bb7e3d537ae5e6c54251
2019-09-19 01:19:12
crimx
test(storybook): update stories
false
diff --git a/src/components/Speaker/Speaker.stories.tsx b/src/components/Speaker/Speaker.stories.tsx index 64c55a701..45e14a031 100644 --- a/src/components/Speaker/Speaker.stories.tsx +++ b/src/components/Speaker/Speaker.stories.tsx @@ -60,7 +60,9 @@ storiesOf('Content Scripts|Components', module) const node = getStaticSpeaker(textNode) return ( - <StaticSpeakerContainer> + <StaticSpeakerContainer + onPlayStart={async src => action('On Play Start')(src)} + > <div dangerouslySetInnerHTML={{ __html: ` diff --git a/src/components/dictionaries/dictionaries.stories.tsx b/src/components/dictionaries/dictionaries.stories.tsx index da228aa8d..1a8edef8b 100644 --- a/src/components/dictionaries/dictionaries.stories.tsx +++ b/src/components/dictionaries/dictionaries.stories.tsx @@ -168,6 +168,7 @@ function Dict(props: { dictID={props.dictID} fontSize={props.fontSize} withAnimation={props.withAnimation} + panelCSS={''} preferredHeight={number('Preferred Height', 256)} searchStatus={status} searchResult={result} diff --git a/src/content/components/DictItem/DictItem.stories.tsx b/src/content/components/DictItem/DictItem.stories.tsx index 2e2025724..43f37e8e8 100644 --- a/src/content/components/DictItem/DictItem.stories.tsx +++ b/src/content/components/DictItem/DictItem.stories.tsx @@ -32,6 +32,7 @@ storiesOf('Content Scripts|Dict Panel', module) dictID="baidu" fontSize={fontSize} withAnimation={withAnimation} + panelCSS={''} preferredHeight={number('Preferred Height', 256)} searchStatus={select( 'Search Status', @@ -51,6 +52,7 @@ storiesOf('Content Scripts|Dict Panel', module) searchText={action('Search Text')} openDictSrcPage={action('Open Dict Source Page')} onHeightChanged={action('Height Changed')} + onSpeakerPlay={async src => action('Speaker Play')(src)} /> ) }) diff --git a/src/content/components/DictList/DictList.stories.tsx b/src/content/components/DictList/DictList.stories.tsx index 2c3b83de3..42dfa8aaa 100644 --- a/src/content/components/DictList/DictList.stories.tsx +++ b/src/content/components/DictList/DictList.stories.tsx @@ -41,6 +41,7 @@ storiesOf('Content Scripts|Dict Panel', module) <DictList fontSize={number('Font Size', 13)} withAnimation={boolean('Enable Animation', true)} + panelCSS={''} dicts={[...Array(faker.random.number({ min: 3, max: 10 }))].map(() => ({ ...faker.random.arrayElement(dicts), searchStatus: faker.random.arrayElement(searchStatus), @@ -54,6 +55,7 @@ storiesOf('Content Scripts|Dict Panel', module) searchText={action('Search Text')} openDictSrcPage={action('Open Dict Source Page')} onHeightChanged={action('Height Changed')} + onSpeakerPlay={async src => action('Speaker Play')(src)} /> )) diff --git a/src/content/components/MenuBar/Profiles.stories.tsx b/src/content/components/MenuBar/Profiles.stories.tsx index 98821e0a5..ea257dc64 100755 --- a/src/content/components/MenuBar/Profiles.stories.tsx +++ b/src/content/components/MenuBar/Profiles.stories.tsx @@ -46,6 +46,7 @@ storiesOf('Content Scripts|Dict Panel/Menubar', module) profiles[0].id )} onHeightChanged={action('Height Changed')} + onProfileChanged={action('Profile Changed')} /> ) }) diff --git a/src/content/components/MtaBox/MtaBox.stories.tsx b/src/content/components/MtaBox/MtaBox.stories.tsx index f0855428f..b72749289 100644 --- a/src/content/components/MtaBox/MtaBox.stories.tsx +++ b/src/content/components/MtaBox/MtaBox.stories.tsx @@ -3,7 +3,7 @@ import { storiesOf } from '@storybook/react' import { action } from '@storybook/addon-actions' import { jsxDecorator } from 'storybook-addon-jsx' import { withPropsTable } from 'storybook-addon-react-docgen' -import { withKnobs, number, boolean } from '@storybook/addon-knobs' +import { withKnobs, number } from '@storybook/addon-knobs' import { withSaladictPanel } from '@/_helpers/storybook' import faker from 'faker' import { MtaBox } from './MtaBox' @@ -43,6 +43,7 @@ storiesOf('Content Scripts|Dict Panel', module) action('Drawer Toggle')() setExpand(!expand) }} + onHeightChanged={action('Height Changed')} /> ) }) diff --git a/src/content/components/WaveformBox/WaveformBox.stories.tsx b/src/content/components/WaveformBox/WaveformBox.stories.tsx index 3f468c7d9..34db0aa95 100644 --- a/src/content/components/WaveformBox/WaveformBox.stories.tsx +++ b/src/content/components/WaveformBox/WaveformBox.stories.tsx @@ -2,7 +2,7 @@ import React from 'react' import { storiesOf } from '@storybook/react' import { jsxDecorator } from 'storybook-addon-jsx' import { withPropsTable } from 'storybook-addon-react-docgen' -import { withKnobs } from '@storybook/addon-knobs' +import { withKnobs, boolean } from '@storybook/addon-knobs' import { withSaladictPanel } from '@/_helpers/storybook' import { WaveformBox } from './WaveformBox' import { action } from '@storybook/addon-actions' @@ -34,5 +34,10 @@ storiesOf('Content Scripts|Dict Panel', module) }) ) .add('WaveformBox', () => ( - <WaveformBox onHeightChanged={action('Height Changed')} /> + <WaveformBox + darkMode={boolean('Dark Mode', false)} + isExpand={boolean('Expand', true)} + toggleExpand={action('Toggle Expand')} + onHeightChanged={action('Height Changed')} + /> ))
test
update stories
b2c735da229dd95bffbf98b8e65faa658755aff9
2018-04-28 00:10:03
CRIMX
test(content): update test
false
diff --git a/test/specs/components/content/MenuBar.spec.tsx b/test/specs/components/content/MenuBar.spec.tsx index c23d0125e..c4279c5d8 100644 --- a/test/specs/components/content/MenuBar.spec.tsx +++ b/test/specs/components/content/MenuBar.spec.tsx @@ -2,6 +2,8 @@ import React from 'react' import { shallow } from 'enzyme' import { MenuBar } from '@/content/components/MenuBar' +import { getDefaultSelectionInfo } from '@/_helpers/selection' +import { MsgType, MsgSelection } from '@/typings/message' describe('Component/content/MenuBar', () => { it('should render correctly', () => { @@ -10,7 +12,16 @@ describe('Component/content/MenuBar', () => { t: x => x, isFav: false, isPinned: false, - updateDragArea: noop, + selection: { + type: MsgType.Selection, + selectionInfo: getDefaultSelectionInfo(), + mouseX: 0, + mouseY: 0, + dbClick: false, + ctrlKey: false, + } as MsgSelection, + searchHistory: [], + handleDragStart: noop, searchText: noop, addToNotebook: noop, removeFromNotebook: noop, @@ -27,7 +38,16 @@ describe('Component/content/MenuBar', () => { t: x => x, isFav: true, isPinned: true, - updateDragArea: noop, + selection: { + type: MsgType.Selection, + selectionInfo: getDefaultSelectionInfo(), + mouseX: 0, + mouseY: 0, + dbClick: false, + ctrlKey: false, + } as MsgSelection, + searchHistory: [], + handleDragStart: noop, searchText: noop, addToNotebook: noop, removeFromNotebook: noop, diff --git a/test/specs/components/content/__snapshots__/MenuBar.spec.tsx.snap b/test/specs/components/content/__snapshots__/MenuBar.spec.tsx.snap index 226358f0b..faa8a28c0 100644 --- a/test/specs/components/content/__snapshots__/MenuBar.spec.tsx.snap +++ b/test/specs/components/content/__snapshots__/MenuBar.spec.tsx.snap @@ -4,126 +4,196 @@ exports[`Component/content/MenuBar should render correctly 1`] = ` <header className="panel-MenuBar" > + <button + className="panel-MenuBar_Btn" + disabled={true} + onClick={[Function]} + > + <svg + className="panel-MenuBar_Icon" + height="30" + viewBox="0 0 32 32" + width="30" + xmlns="http://www.w3.org/2000/svg" + > + <title> + tipSearchHistoryBack + </title> + <path + d="M 5.191 15.999 L 19.643 1.548 C 19.998 1.192 19.998 0.622 19.643 0.267 C 19.288 -0.089 18.718 -0.089 18.362 0.267 L 3.267 15.362 C 2.911 15.718 2.911 16.288 3.267 16.643 L 18.362 31.732 C 18.537 31.906 18.771 32 18.999 32 C 19.227 32 19.462 31.913 19.636 31.732 C 19.992 31.377 19.992 30.807 19.636 30.451 L 5.191 15.999 Z" + /> + </svg> + </button> + <button + className="panel-MenuBar_Btn" + disabled={true} + onClick={[Function]} + > + <svg + className="panel-MenuBar_Icon" + height="30" + viewBox="0 0 32 32" + width="30" + xmlns="http://www.w3.org/2000/svg" + > + <title> + tipSearchHistoryNext + </title> + <path + d="M 26.643 15.362 L 11.547 0.267 C 11.192 -0.089 10.622 -0.089 10.267 0.267 C 9.911 0.622 9.911 1.192 10.267 1.547 L 24.718 15.999 L 10.267 30.451 C 9.911 30.806 9.911 31.376 10.267 31.732 C 10.441 31.906 10.676 32 10.904 32 C 11.132 32 11.366 31.913 11.541 31.732 L 26.636 16.636 C 26.992 16.288 26.992 15.711 26.643 15.362 Z" + /> + </svg> + </button> <input className="panel-MenuBar_SearchBox" - onInput={[Function]} + onChange={[Function]} onKeyUp={[Function]} type="text" + value="" /> - <svg - className="panel-MenuBar_IconSearch" - height="30" - onClick={[Function]} - viewBox="0 0 52.966 52.966" - width="30" - xmlns="http://www.w3.org/2000/svg" - > - <title> - tipSearchText - </title> - <path - d="M51.704 51.273L36.844 35.82c3.79-3.8 6.14-9.04 6.14-14.82 0-11.58-9.42-21-21-21s-21 9.42-21 21 9.42 21 21 21c5.082 0 9.747-1.817 13.383-4.832l14.895 15.49c.196.206.458.308.72.308.25 0 .5-.093.694-.28.398-.382.41-1.015.028-1.413zM21.984 40c-10.478 0-19-8.523-19-19s8.522-19 19-19 19 8.523 19 19-8.525 19-19 19z" - /> - </svg> + <button + className="panel-MenuBar_Btn" + onClick={[Function]} + > + <svg + className="panel-MenuBar_Icon" + height="30" + viewBox="0 0 52.966 52.966" + width="30" + xmlns="http://www.w3.org/2000/svg" + > + <title> + tipSearchText + </title> + <path + d="M51.704 51.273L36.844 35.82c3.79-3.8 6.14-9.04 6.14-14.82 0-11.58-9.42-21-21-21s-21 9.42-21 21 9.42 21 21 21c5.082 0 9.747-1.817 13.383-4.832l14.895 15.49c.196.206.458.308.72.308.25 0 .5-.093.694-.28.398-.382.41-1.015.028-1.413zM21.984 40c-10.478 0-19-8.523-19-19s8.522-19 19-19 19 8.523 19 19-8.525 19-19 19z" + /> + </svg> + </button> <div className="panel-MenuBar_DragArea" + onMouseDown={[Function]} /> - <svg - className="panel-MenuBar_IconSettings" - height="30" - onClick={[Function]} - viewBox="0 0 612 612" - width="30" - xmlns="http://www.w3.org/2000/svg" - > - <title> - tipOpenSettings - </title> - <path - d="M0 97.92v24.48h612V97.92H0zm0 220.32h612v-24.48H0v24.48zm0 195.84h612V489.6H0v24.48z" - /> - </svg> - <svg - className="panel-MenuBar_IconFav " - height="30" - onClick={[Function]} - viewBox="0 0 32 32" - width="30" - xmlns="http://www.w3.org/2000/svg" - > - <title> - tipAddToNotebook - </title> - <path - d="M23.6 2c-3.363 0-6.258 2.736-7.599 5.594-1.342-2.858-4.237-5.594-7.601-5.594-4.637 0-8.4 3.764-8.4 8.401 0 9.433 9.516 11.906 16.001 21.232 6.13-9.268 15.999-12.1 15.999-21.232 0-4.637-3.763-8.401-8.4-8.401z" - /> - </svg> - <svg - className="panel-MenuBar_IconHistory" - height="30" - onClick={[Function]} - viewBox="0 0 64 64" - width="30" - xmlns="http://www.w3.org/2000/svg" - > - <title> - tipOpenHistory - </title> - <path - d="M34.688 3.315c-15.887 0-28.812 12.924-28.81 28.73-.012.25-.157 4.434 1.034 8.94l-3.88-2.262c-.965-.56-2.193-.235-2.76.727-.557.96-.233 2.195.728 2.755l9.095 5.302c.02.01.038.013.056.022.1.05.2.09.31.12.07.02.14.05.21.07.09.02.176.02.265.03.06.003.124.022.186.022.036 0 .07-.01.105-.015.034 0 .063.007.097.004.05-.003.097-.024.146-.032.097-.017.19-.038.28-.068.08-.028.157-.06.23-.095.086-.04.165-.085.24-.137.074-.046.14-.096.206-.15.07-.06.135-.125.198-.195.06-.067.11-.135.16-.207.026-.04.062-.07.086-.11.017-.03.017-.067.032-.1.03-.053.07-.1.096-.16l3.62-8.96c.417-1.03-.08-2.205-1.112-2.622-1.033-.413-2.207.083-2.624 1.115l-1.86 4.6c-1.24-4.145-1.1-8.406-1.093-8.523C9.92 18.455 21.04 7.34 34.7 7.34c13.663 0 24.78 11.116 24.78 24.78S48.357 56.9 34.694 56.9c-1.114 0-2.016.902-2.016 2.015s.9 2.02 2.012 2.02c15.89 0 28.81-12.925 28.81-28.81 0-15.89-12.923-28.814-28.81-28.814z" - /> - <path - d="M33.916 36.002c.203.084.417.114.634.13.045.002.09.026.134.026.236 0 .465-.054.684-.134.06-.022.118-.054.177-.083.167-.08.32-.18.463-.3.03-.023.072-.033.103-.07L48.7 22.98c.788-.79.788-2.064 0-2.852-.787-.788-2.062-.788-2.85 0l-11.633 11.63-10.44-4.37c-1.032-.432-2.208.052-2.64 1.08-.43 1.027.056 2.208 1.08 2.638L33.907 36c.002 0 .006 0 .01.002z" - /> - </svg> - <svg - className="panel-MenuBar_IconShare" - height="30" - onClick={[Function]} - viewBox="0 0 58.999 58.999" - width="30" - xmlns="http://www.w3.org/2000/svg" - > - <title> - tipShareImg - </title> - <path - d="M19.48 12.02c.255 0 .51-.1.706-.294L28.5 3.413V39c0 .552.446 1 1 1s1-.448 1-1V3.412l8.27 8.272c.392.39 1.024.39 1.415 0s.39-1.023 0-1.414L30.207.294C30.115.2 30.004.127 29.88.076c-.244-.1-.52-.1-.764 0-.123.05-.234.125-.326.217l-10.018 10.02c-.39.39-.39 1.022 0 1.413.195.196.45.293.707.293z" - /> - <path - d="M36.5 16c-.554 0-1 .446-1 1s.446 1 1 1h13v39h-40V18h13c.552 0 1-.448 1-1s-.448-1-1-1h-15v43h44V16h-15z" - /> - </svg> - <svg - className="panel-MenuBar_IconPin " - height="30" - onClick={[Function]} - viewBox="0 0 53.011 53.011" - width="30" - xmlns="http://www.w3.org/2000/svg" - > - <title> - tipPinPanel - </title> - <path - d="M52.963 21.297c-.068-.33-.297-.603-.61-.727-8.573-3.416-16.172-.665-18.36.288L19.113 8.2C19.634 3.632 17.17.508 17.06.372c-.18-.22-.442-.356-.725-.372-.282-.006-.56.09-.76.292L.32 15.546c-.202.2-.308.48-.29.765.015.285.152.55.375.727 2.775 2.202 6.35 2.167 7.726 2.055l12.722 14.953c-.868 2.23-3.52 10.27-.307 18.337.124.313.397.54.727.61.067.013.135.02.202.02.263 0 .518-.104.707-.293l14.57-14.57 13.57 13.57c.196.194.452.292.708.292s.512-.098.707-.293c.39-.392.39-1.024 0-1.415l-13.57-13.57 14.527-14.528c.237-.238.34-.58.27-.91zm-17.65 15.458L21.89 50.18c-2.437-8.005.993-15.827 1.03-15.91.158-.352.1-.764-.15-1.058L9.31 17.39c-.19-.225-.473-.352-.764-.352-.05 0-.103.004-.154.013-.036.007-3.173.473-5.794-.954l13.5-13.5c.604 1.156 1.39 3.26.964 5.848-.058.346.07.697.338.924l15.785 13.43c.31.262.748.31 1.105.128.077-.04 7.378-3.695 15.87-1.017L35.313 36.754z" - /> - </svg> - <svg - className="panel-MenuBar_IconClose" - height="30" - onClick={[Function]} - viewBox="0 0 31.112 31.112" - width="30" - xmlns="http://www.w3.org/2000/svg" - > - <title> - tipClosePanel - </title> - <path - d="M31.112 1.414L29.698 0 15.556 14.142 1.414 0 0 1.414l14.142 14.142L0 29.698l1.414 1.414L15.556 16.97l14.142 14.142 1.414-1.414L16.97 15.556" - /> - </svg> + <button + className="panel-MenuBar_Btn" + onClick={[Function]} + > + <svg + className="panel-MenuBar_Icon" + height="30" + viewBox="0 0 612 612" + width="30" + xmlns="http://www.w3.org/2000/svg" + > + <title> + tipOpenSettings + </title> + <path + d="M0 97.92v24.48h612V97.92H0zm0 220.32h612v-24.48H0v24.48zm0 195.84h612V489.6H0v24.48z" + /> + </svg> + </button> + <button + className="panel-MenuBar_Btn" + onClick={[Function]} + > + <svg + className="panel-MenuBar_Icon-fav " + height="30" + viewBox="0 0 32 32" + width="30" + xmlns="http://www.w3.org/2000/svg" + > + <title> + tipAddToNotebook + </title> + <path + d="M23.6 2c-3.363 0-6.258 2.736-7.599 5.594-1.342-2.858-4.237-5.594-7.601-5.594-4.637 0-8.4 3.764-8.4 8.401 0 9.433 9.516 11.906 16.001 21.232 6.13-9.268 15.999-12.1 15.999-21.232 0-4.637-3.763-8.401-8.4-8.401z" + /> + </svg> + </button> + <button + className="panel-MenuBar_Btn" + onClick={[Function]} + > + <svg + className="panel-MenuBar_Icon-history" + height="30" + viewBox="0 0 64 64" + width="30" + xmlns="http://www.w3.org/2000/svg" + > + <title> + tipOpenHistory + </title> + <path + d="M34.688 3.315c-15.887 0-28.812 12.924-28.81 28.73-.012.25-.157 4.434 1.034 8.94l-3.88-2.262c-.965-.56-2.193-.235-2.76.727-.557.96-.233 2.195.728 2.755l9.095 5.302c.02.01.038.013.056.022.1.05.2.09.31.12.07.02.14.05.21.07.09.02.176.02.265.03.06.003.124.022.186.022.036 0 .07-.01.105-.015.034 0 .063.007.097.004.05-.003.097-.024.146-.032.097-.017.19-.038.28-.068.08-.028.157-.06.23-.095.086-.04.165-.085.24-.137.074-.046.14-.096.206-.15.07-.06.135-.125.198-.195.06-.067.11-.135.16-.207.026-.04.062-.07.086-.11.017-.03.017-.067.032-.1.03-.053.07-.1.096-.16l3.62-8.96c.417-1.03-.08-2.205-1.112-2.622-1.033-.413-2.207.083-2.624 1.115l-1.86 4.6c-1.24-4.145-1.1-8.406-1.093-8.523C9.92 18.455 21.04 7.34 34.7 7.34c13.663 0 24.78 11.116 24.78 24.78S48.357 56.9 34.694 56.9c-1.114 0-2.016.902-2.016 2.015s.9 2.02 2.012 2.02c15.89 0 28.81-12.925 28.81-28.81 0-15.89-12.923-28.814-28.81-28.814z" + /> + <path + d="M33.916 36.002c.203.084.417.114.634.13.045.002.09.026.134.026.236 0 .465-.054.684-.134.06-.022.118-.054.177-.083.167-.08.32-.18.463-.3.03-.023.072-.033.103-.07L48.7 22.98c.788-.79.788-2.064 0-2.852-.787-.788-2.062-.788-2.85 0l-11.633 11.63-10.44-4.37c-1.032-.432-2.208.052-2.64 1.08-.43 1.027.056 2.208 1.08 2.638L33.907 36c.002 0 .006 0 .01.002z" + /> + </svg> + </button> + <button + className="panel-MenuBar_Btn" + onClick={[Function]} + > + <svg + className="panel-MenuBar_Icon" + height="30" + viewBox="0 0 58.999 58.999" + width="30" + xmlns="http://www.w3.org/2000/svg" + > + <title> + tipShareImg + </title> + <path + d="M19.48 12.02c.255 0 .51-.1.706-.294L28.5 3.413V39c0 .552.446 1 1 1s1-.448 1-1V3.412l8.27 8.272c.392.39 1.024.39 1.415 0s.39-1.023 0-1.414L30.207.294C30.115.2 30.004.127 29.88.076c-.244-.1-.52-.1-.764 0-.123.05-.234.125-.326.217l-10.018 10.02c-.39.39-.39 1.022 0 1.413.195.196.45.293.707.293z" + /> + <path + d="M36.5 16c-.554 0-1 .446-1 1s.446 1 1 1h13v39h-40V18h13c.552 0 1-.448 1-1s-.448-1-1-1h-15v43h44V16h-15z" + /> + </svg> + </button> + <button + className="panel-MenuBar_Btn" + onClick={[Function]} + > + <svg + className="panel-MenuBar_Icon-pin " + height="30" + viewBox="0 0 53.011 53.011" + width="30" + xmlns="http://www.w3.org/2000/svg" + > + <title> + tipPinPanel + </title> + <path + d="M52.963 21.297c-.068-.33-.297-.603-.61-.727-8.573-3.416-16.172-.665-18.36.288L19.113 8.2C19.634 3.632 17.17.508 17.06.372c-.18-.22-.442-.356-.725-.372-.282-.006-.56.09-.76.292L.32 15.546c-.202.2-.308.48-.29.765.015.285.152.55.375.727 2.775 2.202 6.35 2.167 7.726 2.055l12.722 14.953c-.868 2.23-3.52 10.27-.307 18.337.124.313.397.54.727.61.067.013.135.02.202.02.263 0 .518-.104.707-.293l14.57-14.57 13.57 13.57c.196.194.452.292.708.292s.512-.098.707-.293c.39-.392.39-1.024 0-1.415l-13.57-13.57 14.527-14.528c.237-.238.34-.58.27-.91zm-17.65 15.458L21.89 50.18c-2.437-8.005.993-15.827 1.03-15.91.158-.352.1-.764-.15-1.058L9.31 17.39c-.19-.225-.473-.352-.764-.352-.05 0-.103.004-.154.013-.036.007-3.173.473-5.794-.954l13.5-13.5c.604 1.156 1.39 3.26.964 5.848-.058.346.07.697.338.924l15.785 13.43c.31.262.748.31 1.105.128.077-.04 7.378-3.695 15.87-1.017L35.313 36.754z" + /> + </svg> + </button> + <button + className="panel-MenuBar_Btn" + onClick={[Function]} + > + <svg + className="panel-MenuBar_Icon-close" + height="30" + viewBox="0 0 31.112 31.112" + width="30" + xmlns="http://www.w3.org/2000/svg" + > + <title> + tipClosePanel + </title> + <path + d="M31.112 1.414L29.698 0 15.556 14.142 1.414 0 0 1.414l14.142 14.142L0 29.698l1.414 1.414L15.556 16.97l14.142 14.142 1.414-1.414L16.97 15.556" + /> + </svg> + </button> </header> `; @@ -131,125 +201,195 @@ exports[`Component/content/MenuBar should render correctly with fav and pin 1`] <header className="panel-MenuBar" > + <button + className="panel-MenuBar_Btn" + disabled={true} + onClick={[Function]} + > + <svg + className="panel-MenuBar_Icon" + height="30" + viewBox="0 0 32 32" + width="30" + xmlns="http://www.w3.org/2000/svg" + > + <title> + tipSearchHistoryBack + </title> + <path + d="M 5.191 15.999 L 19.643 1.548 C 19.998 1.192 19.998 0.622 19.643 0.267 C 19.288 -0.089 18.718 -0.089 18.362 0.267 L 3.267 15.362 C 2.911 15.718 2.911 16.288 3.267 16.643 L 18.362 31.732 C 18.537 31.906 18.771 32 18.999 32 C 19.227 32 19.462 31.913 19.636 31.732 C 19.992 31.377 19.992 30.807 19.636 30.451 L 5.191 15.999 Z" + /> + </svg> + </button> + <button + className="panel-MenuBar_Btn" + disabled={true} + onClick={[Function]} + > + <svg + className="panel-MenuBar_Icon" + height="30" + viewBox="0 0 32 32" + width="30" + xmlns="http://www.w3.org/2000/svg" + > + <title> + tipSearchHistoryNext + </title> + <path + d="M 26.643 15.362 L 11.547 0.267 C 11.192 -0.089 10.622 -0.089 10.267 0.267 C 9.911 0.622 9.911 1.192 10.267 1.547 L 24.718 15.999 L 10.267 30.451 C 9.911 30.806 9.911 31.376 10.267 31.732 C 10.441 31.906 10.676 32 10.904 32 C 11.132 32 11.366 31.913 11.541 31.732 L 26.636 16.636 C 26.992 16.288 26.992 15.711 26.643 15.362 Z" + /> + </svg> + </button> <input className="panel-MenuBar_SearchBox" - onInput={[Function]} + onChange={[Function]} onKeyUp={[Function]} type="text" + value="" /> - <svg - className="panel-MenuBar_IconSearch" - height="30" - onClick={[Function]} - viewBox="0 0 52.966 52.966" - width="30" - xmlns="http://www.w3.org/2000/svg" - > - <title> - tipSearchText - </title> - <path - d="M51.704 51.273L36.844 35.82c3.79-3.8 6.14-9.04 6.14-14.82 0-11.58-9.42-21-21-21s-21 9.42-21 21 9.42 21 21 21c5.082 0 9.747-1.817 13.383-4.832l14.895 15.49c.196.206.458.308.72.308.25 0 .5-.093.694-.28.398-.382.41-1.015.028-1.413zM21.984 40c-10.478 0-19-8.523-19-19s8.522-19 19-19 19 8.523 19 19-8.525 19-19 19z" - /> - </svg> + <button + className="panel-MenuBar_Btn" + onClick={[Function]} + > + <svg + className="panel-MenuBar_Icon" + height="30" + viewBox="0 0 52.966 52.966" + width="30" + xmlns="http://www.w3.org/2000/svg" + > + <title> + tipSearchText + </title> + <path + d="M51.704 51.273L36.844 35.82c3.79-3.8 6.14-9.04 6.14-14.82 0-11.58-9.42-21-21-21s-21 9.42-21 21 9.42 21 21 21c5.082 0 9.747-1.817 13.383-4.832l14.895 15.49c.196.206.458.308.72.308.25 0 .5-.093.694-.28.398-.382.41-1.015.028-1.413zM21.984 40c-10.478 0-19-8.523-19-19s8.522-19 19-19 19 8.523 19 19-8.525 19-19 19z" + /> + </svg> + </button> <div className="panel-MenuBar_DragArea" + onMouseDown={[Function]} /> - <svg - className="panel-MenuBar_IconSettings" - height="30" - onClick={[Function]} - viewBox="0 0 612 612" - width="30" - xmlns="http://www.w3.org/2000/svg" - > - <title> - tipOpenSettings - </title> - <path - d="M0 97.92v24.48h612V97.92H0zm0 220.32h612v-24.48H0v24.48zm0 195.84h612V489.6H0v24.48z" - /> - </svg> - <svg - className="panel-MenuBar_IconFav isActive" - height="30" - onClick={[Function]} - viewBox="0 0 32 32" - width="30" - xmlns="http://www.w3.org/2000/svg" - > - <title> - tipAddToNotebook - </title> - <path - d="M23.6 2c-3.363 0-6.258 2.736-7.599 5.594-1.342-2.858-4.237-5.594-7.601-5.594-4.637 0-8.4 3.764-8.4 8.401 0 9.433 9.516 11.906 16.001 21.232 6.13-9.268 15.999-12.1 15.999-21.232 0-4.637-3.763-8.401-8.4-8.401z" - /> - </svg> - <svg - className="panel-MenuBar_IconHistory" - height="30" - onClick={[Function]} - viewBox="0 0 64 64" - width="30" - xmlns="http://www.w3.org/2000/svg" - > - <title> - tipOpenHistory - </title> - <path - d="M34.688 3.315c-15.887 0-28.812 12.924-28.81 28.73-.012.25-.157 4.434 1.034 8.94l-3.88-2.262c-.965-.56-2.193-.235-2.76.727-.557.96-.233 2.195.728 2.755l9.095 5.302c.02.01.038.013.056.022.1.05.2.09.31.12.07.02.14.05.21.07.09.02.176.02.265.03.06.003.124.022.186.022.036 0 .07-.01.105-.015.034 0 .063.007.097.004.05-.003.097-.024.146-.032.097-.017.19-.038.28-.068.08-.028.157-.06.23-.095.086-.04.165-.085.24-.137.074-.046.14-.096.206-.15.07-.06.135-.125.198-.195.06-.067.11-.135.16-.207.026-.04.062-.07.086-.11.017-.03.017-.067.032-.1.03-.053.07-.1.096-.16l3.62-8.96c.417-1.03-.08-2.205-1.112-2.622-1.033-.413-2.207.083-2.624 1.115l-1.86 4.6c-1.24-4.145-1.1-8.406-1.093-8.523C9.92 18.455 21.04 7.34 34.7 7.34c13.663 0 24.78 11.116 24.78 24.78S48.357 56.9 34.694 56.9c-1.114 0-2.016.902-2.016 2.015s.9 2.02 2.012 2.02c15.89 0 28.81-12.925 28.81-28.81 0-15.89-12.923-28.814-28.81-28.814z" - /> - <path - d="M33.916 36.002c.203.084.417.114.634.13.045.002.09.026.134.026.236 0 .465-.054.684-.134.06-.022.118-.054.177-.083.167-.08.32-.18.463-.3.03-.023.072-.033.103-.07L48.7 22.98c.788-.79.788-2.064 0-2.852-.787-.788-2.062-.788-2.85 0l-11.633 11.63-10.44-4.37c-1.032-.432-2.208.052-2.64 1.08-.43 1.027.056 2.208 1.08 2.638L33.907 36c.002 0 .006 0 .01.002z" - /> - </svg> - <svg - className="panel-MenuBar_IconShare" - height="30" - onClick={[Function]} - viewBox="0 0 58.999 58.999" - width="30" - xmlns="http://www.w3.org/2000/svg" - > - <title> - tipShareImg - </title> - <path - d="M19.48 12.02c.255 0 .51-.1.706-.294L28.5 3.413V39c0 .552.446 1 1 1s1-.448 1-1V3.412l8.27 8.272c.392.39 1.024.39 1.415 0s.39-1.023 0-1.414L30.207.294C30.115.2 30.004.127 29.88.076c-.244-.1-.52-.1-.764 0-.123.05-.234.125-.326.217l-10.018 10.02c-.39.39-.39 1.022 0 1.413.195.196.45.293.707.293z" - /> - <path - d="M36.5 16c-.554 0-1 .446-1 1s.446 1 1 1h13v39h-40V18h13c.552 0 1-.448 1-1s-.448-1-1-1h-15v43h44V16h-15z" - /> - </svg> - <svg - className="panel-MenuBar_IconPin isActive" - height="30" - onClick={[Function]} - viewBox="0 0 53.011 53.011" - width="30" - xmlns="http://www.w3.org/2000/svg" - > - <title> - tipPinPanel - </title> - <path - d="M52.963 21.297c-.068-.33-.297-.603-.61-.727-8.573-3.416-16.172-.665-18.36.288L19.113 8.2C19.634 3.632 17.17.508 17.06.372c-.18-.22-.442-.356-.725-.372-.282-.006-.56.09-.76.292L.32 15.546c-.202.2-.308.48-.29.765.015.285.152.55.375.727 2.775 2.202 6.35 2.167 7.726 2.055l12.722 14.953c-.868 2.23-3.52 10.27-.307 18.337.124.313.397.54.727.61.067.013.135.02.202.02.263 0 .518-.104.707-.293l14.57-14.57 13.57 13.57c.196.194.452.292.708.292s.512-.098.707-.293c.39-.392.39-1.024 0-1.415l-13.57-13.57 14.527-14.528c.237-.238.34-.58.27-.91zm-17.65 15.458L21.89 50.18c-2.437-8.005.993-15.827 1.03-15.91.158-.352.1-.764-.15-1.058L9.31 17.39c-.19-.225-.473-.352-.764-.352-.05 0-.103.004-.154.013-.036.007-3.173.473-5.794-.954l13.5-13.5c.604 1.156 1.39 3.26.964 5.848-.058.346.07.697.338.924l15.785 13.43c.31.262.748.31 1.105.128.077-.04 7.378-3.695 15.87-1.017L35.313 36.754z" - /> - </svg> - <svg - className="panel-MenuBar_IconClose" - height="30" - onClick={[Function]} - viewBox="0 0 31.112 31.112" - width="30" - xmlns="http://www.w3.org/2000/svg" - > - <title> - tipClosePanel - </title> - <path - d="M31.112 1.414L29.698 0 15.556 14.142 1.414 0 0 1.414l14.142 14.142L0 29.698l1.414 1.414L15.556 16.97l14.142 14.142 1.414-1.414L16.97 15.556" - /> - </svg> + <button + className="panel-MenuBar_Btn" + onClick={[Function]} + > + <svg + className="panel-MenuBar_Icon" + height="30" + viewBox="0 0 612 612" + width="30" + xmlns="http://www.w3.org/2000/svg" + > + <title> + tipOpenSettings + </title> + <path + d="M0 97.92v24.48h612V97.92H0zm0 220.32h612v-24.48H0v24.48zm0 195.84h612V489.6H0v24.48z" + /> + </svg> + </button> + <button + className="panel-MenuBar_Btn" + onClick={[Function]} + > + <svg + className="panel-MenuBar_Icon-fav isActive" + height="30" + viewBox="0 0 32 32" + width="30" + xmlns="http://www.w3.org/2000/svg" + > + <title> + tipAddToNotebook + </title> + <path + d="M23.6 2c-3.363 0-6.258 2.736-7.599 5.594-1.342-2.858-4.237-5.594-7.601-5.594-4.637 0-8.4 3.764-8.4 8.401 0 9.433 9.516 11.906 16.001 21.232 6.13-9.268 15.999-12.1 15.999-21.232 0-4.637-3.763-8.401-8.4-8.401z" + /> + </svg> + </button> + <button + className="panel-MenuBar_Btn" + onClick={[Function]} + > + <svg + className="panel-MenuBar_Icon-history" + height="30" + viewBox="0 0 64 64" + width="30" + xmlns="http://www.w3.org/2000/svg" + > + <title> + tipOpenHistory + </title> + <path + d="M34.688 3.315c-15.887 0-28.812 12.924-28.81 28.73-.012.25-.157 4.434 1.034 8.94l-3.88-2.262c-.965-.56-2.193-.235-2.76.727-.557.96-.233 2.195.728 2.755l9.095 5.302c.02.01.038.013.056.022.1.05.2.09.31.12.07.02.14.05.21.07.09.02.176.02.265.03.06.003.124.022.186.022.036 0 .07-.01.105-.015.034 0 .063.007.097.004.05-.003.097-.024.146-.032.097-.017.19-.038.28-.068.08-.028.157-.06.23-.095.086-.04.165-.085.24-.137.074-.046.14-.096.206-.15.07-.06.135-.125.198-.195.06-.067.11-.135.16-.207.026-.04.062-.07.086-.11.017-.03.017-.067.032-.1.03-.053.07-.1.096-.16l3.62-8.96c.417-1.03-.08-2.205-1.112-2.622-1.033-.413-2.207.083-2.624 1.115l-1.86 4.6c-1.24-4.145-1.1-8.406-1.093-8.523C9.92 18.455 21.04 7.34 34.7 7.34c13.663 0 24.78 11.116 24.78 24.78S48.357 56.9 34.694 56.9c-1.114 0-2.016.902-2.016 2.015s.9 2.02 2.012 2.02c15.89 0 28.81-12.925 28.81-28.81 0-15.89-12.923-28.814-28.81-28.814z" + /> + <path + d="M33.916 36.002c.203.084.417.114.634.13.045.002.09.026.134.026.236 0 .465-.054.684-.134.06-.022.118-.054.177-.083.167-.08.32-.18.463-.3.03-.023.072-.033.103-.07L48.7 22.98c.788-.79.788-2.064 0-2.852-.787-.788-2.062-.788-2.85 0l-11.633 11.63-10.44-4.37c-1.032-.432-2.208.052-2.64 1.08-.43 1.027.056 2.208 1.08 2.638L33.907 36c.002 0 .006 0 .01.002z" + /> + </svg> + </button> + <button + className="panel-MenuBar_Btn" + onClick={[Function]} + > + <svg + className="panel-MenuBar_Icon" + height="30" + viewBox="0 0 58.999 58.999" + width="30" + xmlns="http://www.w3.org/2000/svg" + > + <title> + tipShareImg + </title> + <path + d="M19.48 12.02c.255 0 .51-.1.706-.294L28.5 3.413V39c0 .552.446 1 1 1s1-.448 1-1V3.412l8.27 8.272c.392.39 1.024.39 1.415 0s.39-1.023 0-1.414L30.207.294C30.115.2 30.004.127 29.88.076c-.244-.1-.52-.1-.764 0-.123.05-.234.125-.326.217l-10.018 10.02c-.39.39-.39 1.022 0 1.413.195.196.45.293.707.293z" + /> + <path + d="M36.5 16c-.554 0-1 .446-1 1s.446 1 1 1h13v39h-40V18h13c.552 0 1-.448 1-1s-.448-1-1-1h-15v43h44V16h-15z" + /> + </svg> + </button> + <button + className="panel-MenuBar_Btn" + onClick={[Function]} + > + <svg + className="panel-MenuBar_Icon-pin isActive" + height="30" + viewBox="0 0 53.011 53.011" + width="30" + xmlns="http://www.w3.org/2000/svg" + > + <title> + tipPinPanel + </title> + <path + d="M52.963 21.297c-.068-.33-.297-.603-.61-.727-8.573-3.416-16.172-.665-18.36.288L19.113 8.2C19.634 3.632 17.17.508 17.06.372c-.18-.22-.442-.356-.725-.372-.282-.006-.56.09-.76.292L.32 15.546c-.202.2-.308.48-.29.765.015.285.152.55.375.727 2.775 2.202 6.35 2.167 7.726 2.055l12.722 14.953c-.868 2.23-3.52 10.27-.307 18.337.124.313.397.54.727.61.067.013.135.02.202.02.263 0 .518-.104.707-.293l14.57-14.57 13.57 13.57c.196.194.452.292.708.292s.512-.098.707-.293c.39-.392.39-1.024 0-1.415l-13.57-13.57 14.527-14.528c.237-.238.34-.58.27-.91zm-17.65 15.458L21.89 50.18c-2.437-8.005.993-15.827 1.03-15.91.158-.352.1-.764-.15-1.058L9.31 17.39c-.19-.225-.473-.352-.764-.352-.05 0-.103.004-.154.013-.036.007-3.173.473-5.794-.954l13.5-13.5c.604 1.156 1.39 3.26.964 5.848-.058.346.07.697.338.924l15.785 13.43c.31.262.748.31 1.105.128.077-.04 7.378-3.695 15.87-1.017L35.313 36.754z" + /> + </svg> + </button> + <button + className="panel-MenuBar_Btn" + onClick={[Function]} + > + <svg + className="panel-MenuBar_Icon-close" + height="30" + viewBox="0 0 31.112 31.112" + width="30" + xmlns="http://www.w3.org/2000/svg" + > + <title> + tipClosePanel + </title> + <path + d="M31.112 1.414L29.698 0 15.556 14.142 1.414 0 0 1.414l14.142 14.142L0 29.698l1.414 1.414L15.556 16.97l14.142 14.142 1.414-1.414L16.97 15.556" + /> + </svg> + </button> </header> `;
test
update test
8196a6d53ba41fb2983f6b1bff9b66adce8971ac
2019-12-11 22:53:40
crimx
fix: dual screen windows management
false
diff --git a/src/background/server.ts b/src/background/server.ts index 830beccc5..bef300609 100644 --- a/src/background/server.ts +++ b/src/background/server.ts @@ -22,7 +22,7 @@ import { getWords } from './database' import { AudioManager } from './audio-manager' -import { MainWindowsManager, QsPanelManager } from './windows-manager' +import { QsPanelManager } from './windows-manager' import './types' /** @@ -40,13 +40,10 @@ export class BackgroundServer { static init = BackgroundServer.getInstance - private mainWindowsManager: MainWindowsManager - private qsPanelManager: QsPanelManager // singleton private constructor() { - this.mainWindowsManager = new MainWindowsManager() this.qsPanelManager = new QsPanelManager() message.addListener((msg, sender: browser.runtime.MessageSender) => { @@ -72,9 +69,9 @@ export class BackgroundServer { case 'OPEN_QS_PANEL': return this.openQSPanel() case 'CLOSE_QS_PANEL': - return this.closeQSPanel() + return this.qsPanelManager.destroy() case 'QS_SWITCH_SIDEBAR': - return this.switchSidebar() + return this.qsPanelManager.toggleSidebar() case 'IS_IN_NOTEBOOK': return isInNotebook(msg.payload) @@ -110,7 +107,6 @@ export class BackgroundServer { browser.windows.onRemoved.addListener(async winId => { if (this.qsPanelManager.isQsPanel(winId)) { this.qsPanelManager.destroy() - this.mainWindowsManager.destroySnapshot() ;(await browser.tabs.query({})).forEach(tab => { if (tab.id && tab.windowId !== winId) { message.send(tab.id, { @@ -128,16 +124,7 @@ export class BackgroundServer { this.qsPanelManager.focus() return } - - await this.mainWindowsManager.takeSnapshot() - await this.qsPanelManager.create() - - if (await this.qsPanelManager.hasCreated()) { - if (window.appConfig.tripleCtrlSidebar) { - await this.mainWindowsManager.makeRoomForSidebar() - } - } } async searchClipboard(): Promise<void> { @@ -155,26 +142,6 @@ export class BackgroundServer { }) } - async closeQSPanel(): Promise<void> { - await this.mainWindowsManager.restoreSnapshot() - this.mainWindowsManager.destroySnapshot() - } - - async switchSidebar(): Promise<void> { - if (!(await this.qsPanelManager.hasCreated())) { - return - } - - if (await this.qsPanelManager.isSidebar()) { - await this.qsPanelManager.restoreSnapshot() - await this.mainWindowsManager.restoreSnapshot() - } else { - await this.qsPanelManager.takeSnapshot() - await this.qsPanelManager.moveToSidebar() - await this.mainWindowsManager.makeRoomForSidebar() - } - } - async openSrcPage({ id, text diff --git a/src/background/windows-manager.ts b/src/background/windows-manager.ts index 2c7a3e41d..c34fdf8d5 100644 --- a/src/background/windows-manager.ts +++ b/src/background/windows-manager.ts @@ -7,6 +7,9 @@ interface WinRect { top: number } +const safeUpdateWindow: typeof browser.windows.update = (...args) => + browser.windows.update(...args).catch(console.warn as (m: any) => undefined) + /** * Manipulate main window */ @@ -14,55 +17,79 @@ export class MainWindowsManager { /** Main window snapshot */ private snapshot: browser.windows.Window | null = null - async takeSnapshot(): Promise<void> { - this.snapshot = await browser.windows.getLastFocused() + async takeSnapshot(): Promise<browser.windows.Window | null> { + try { + return (this.snapshot = await browser.windows.getLastFocused({ + windowTypes: ['normal'] + })) + } catch (e) { + console.warn(e) + } + + return (this.snapshot = null) } destroySnapshot(): void { this.snapshot = null } - async makeRoomForSidebar(): Promise<void> { - if (!this.snapshot || this.snapshot.id == null) { + async makeRoomForSidebar( + sidebarSnapshot: browser.windows.Window | null + ): Promise<void> { + const mainWin = this.snapshot + + if (!mainWin || mainWin.id == null) { return } - await browser.windows.update(this.snapshot.id, { - state: 'normal', - top: 0, - // fix a chrome bug by moving 1 extra pixal then to 0 - left: - window.appConfig.tripleCtrlSidebar === 'right' - ? 1 - : window.appConfig.panelWidth, - width: window.screen.availWidth - window.appConfig.panelWidth, - height: window.screen.availHeight - }) + const sidebarWidth = + (sidebarSnapshot && sidebarSnapshot.width) || window.appConfig.panelWidth + + const updateInfo = + mainWin.top != null && + mainWin.left != null && + mainWin.width != null && + mainWin.height != null + ? { + state: 'normal' as 'normal', + top: mainWin.top, + left: + window.appConfig.tripleCtrlSidebar === 'right' + ? mainWin.left + : mainWin.left + sidebarWidth, + width: mainWin.width - sidebarWidth, + height: mainWin.height + } + : { + state: 'normal' as 'normal', + top: 0, + left: + window.appConfig.tripleCtrlSidebar === 'right' ? 0 : sidebarWidth, + width: window.screen.availWidth - sidebarWidth, + height: window.screen.availHeight + } - // fix a chrome bug by moving 1 extra pixal then to 0 if (window.appConfig.tripleCtrlSidebar === 'right') { - await browser.windows.update(this.snapshot.id, { - state: 'normal', - top: 0, - left: 0, - width: window.screen.availWidth - window.appConfig.panelWidth, - height: window.screen.availHeight + // fix a chrome bug by moving 1 extra pixal then to 0 + await safeUpdateWindow(mainWin.id, { + ...updateInfo, + left: updateInfo.left + 1 }) } + + await safeUpdateWindow(mainWin.id, updateInfo) } async restoreSnapshot(): Promise<void> { - if (!this.snapshot || this.snapshot.id == null) { - return + if (this.snapshot && this.snapshot.id != null) { + await safeUpdateWindow(this.snapshot.id, { + state: this.snapshot.state, + top: this.snapshot.top, + left: this.snapshot.left, + width: this.snapshot.width, + height: this.snapshot.height + }) } - - await browser.windows.update(this.snapshot.id, { - state: this.snapshot.state, - top: this.snapshot.top, - left: this.snapshot.left, - width: this.snapshot.width, - height: this.snapshot.height - }) } } @@ -72,8 +99,12 @@ export class MainWindowsManager { export class QsPanelManager { private qsPanelId: number | null = null private snapshot: browser.windows.Window | null = null + private isSidebar: boolean = false + private mainWindowsManager = new MainWindowsManager() async create(): Promise<void> { + this.isSidebar = false + let wordString = '' if (window.appConfig.tripleCtrlPreload === 'selection') { const tab = (await browser.tabs.query({ @@ -94,7 +125,7 @@ export class QsPanelManager { const qsPanelWin = await browser.windows.create({ ...(window.appConfig.tripleCtrlSidebar - ? this.getSidebarRect() + ? await this.getSidebarRect() : this.getDefaultRect()), type: 'popup', url: browser.runtime.getURL( @@ -104,6 +135,12 @@ export class QsPanelManager { if (qsPanelWin && qsPanelWin.id) { this.qsPanelId = qsPanelWin.id + + if (window.appConfig.tripleCtrlSidebar) { + this.isSidebar = true + await this.mainWindowsManager.makeRoomForSidebar(qsPanelWin) + } + // notify all tabs ;(await browser.tabs.query({})).forEach(tab => { if (tab.id && tab.windowId !== this.qsPanelId) { @@ -123,9 +160,12 @@ export class QsPanelManager { return browser.windows.get(this.qsPanelId).catch(() => null) } - destroy(): void { + async destroy(): Promise<void> { this.qsPanelId = null + this.isSidebar = false this.destroySnapshot() + await this.mainWindowsManager.restoreSnapshot() + this.mainWindowsManager.destroySnapshot() } isQsPanel(winId?: number): boolean { @@ -142,7 +182,7 @@ export class QsPanelManager { async focus(): Promise<void> { if (this.qsPanelId != null) { - await browser.windows.update(this.qsPanelId, { focused: true }) + await safeUpdateWindow(this.qsPanelId, { focused: true }) const [tab] = await browser.tabs.query({ windowId: this.qsPanelId }) if (tab && tab.id) { await message.send(tab.id, { type: 'QS_PANEL_FOCUSED' }) @@ -152,7 +192,9 @@ export class QsPanelManager { async takeSnapshot(): Promise<void> { if (this.qsPanelId != null) { - this.snapshot = await browser.windows.get(this.qsPanelId) + this.snapshot = await browser.windows + .get(this.qsPanelId) + .catch(() => null) } } @@ -161,9 +203,10 @@ export class QsPanelManager { } async restoreSnapshot(): Promise<void> { + // restore main window first so that it will be at the bottom + await this.mainWindowsManager.restoreSnapshot() if (this.snapshot != null && this.snapshot.id != null) { - await browser.windows.update(this.snapshot.id, { - focused: true, + await safeUpdateWindow(this.snapshot.id, { state: this.snapshot.state, top: this.snapshot.top, left: this.snapshot.left, @@ -171,44 +214,34 @@ export class QsPanelManager { height: this.snapshot.height }) } else if (this.qsPanelId != null) { - await browser.windows.update(this.qsPanelId, { - state: 'normal', + await safeUpdateWindow(this.qsPanelId, { focused: true, ...this.getDefaultRect() }) } + this.destroySnapshot() } async moveToSidebar(): Promise<void> { if (this.qsPanelId != null) { - await browser.windows.update(this.qsPanelId, { - state: 'normal', - focused: true, - ...this.getSidebarRect() - }) + await this.takeSnapshot() + await safeUpdateWindow(this.qsPanelId, await this.getSidebarRect()) + await this.mainWindowsManager.makeRoomForSidebar(this.snapshot) } } - /** - * Rough matching win rect - */ - async isSidebar(): Promise<boolean> { - if (this.qsPanelId == null) { - return false + async toggleSidebar(): Promise<void> { + if (!(await this.hasCreated())) { + return } - const win = await this.getWin() - - if (!win) { - return false + if (this.isSidebar) { + await this.restoreSnapshot() + } else { + await this.moveToSidebar() } - // Reverse comparing in case undefined - return !( - Math.abs(win.top!) > 50 || // include menu bar height - (Math.abs(win.left!) > 5 && - Math.abs(win.left! + win.width! - window.screen.availWidth) > 5) - ) + this.isSidebar = !this.isSidebar } getDefaultRect(): WinRect { @@ -266,15 +299,32 @@ export class QsPanelManager { } } - getSidebarRect(): WinRect { - return { - top: 0, - left: - window.appConfig.tripleCtrlSidebar === 'right' - ? window.screen.availWidth - window.appConfig.panelWidth - : 0, - width: window.appConfig.panelWidth, - height: window.screen.availHeight - } + async getSidebarRect(): Promise<WinRect> { + const panelWidth = + (this.snapshot && this.snapshot.width) || window.appConfig.panelWidth + const mainWin = await this.mainWindowsManager.takeSnapshot() + return mainWin && + mainWin.top != null && + mainWin.left != null && + mainWin.width != null && + mainWin.height != null + ? { + top: mainWin.top, + left: + window.appConfig.tripleCtrlSidebar === 'right' + ? Math.max(mainWin.width - panelWidth, panelWidth) + : mainWin.left, + width: panelWidth, + height: mainWin.height + } + : { + top: 0, + left: + window.appConfig.tripleCtrlSidebar === 'right' + ? window.screen.availWidth - panelWidth + : 0, + width: panelWidth, + height: window.screen.availHeight + } } }
fix
dual screen windows management
b0a70e5fea74ebe5e0e1f9835b6fae74c534b049
2018-09-06 09:47:34
CRIMX
refactor(content): remove translation beta
false
diff --git a/src/_locales/content/messages.json b/src/_locales/content/messages.json index e59d8b25f..61053f07c 100644 --- a/src/_locales/content/messages.json +++ b/src/_locales/content/messages.json @@ -89,11 +89,6 @@ "zh_TW": "翻譯", "en": "Translation" }, - "wordEditorNoteTransExplain": { - "zh_CN": "(Beta 测试版)", - "zh_TW": "(Beta 測試版)", - "en": "(Beta)" - }, "wordEditorNoteNote": { "zh_CN": "笔记", "zh_TW": "筆記", diff --git a/src/content/components/WordEditor/index.tsx b/src/content/components/WordEditor/index.tsx index b3397b16a..06b3c78da 100644 --- a/src/content/components/WordEditor/index.tsx +++ b/src/content/components/WordEditor/index.tsx @@ -132,7 +132,6 @@ export class WordEditor extends React.PureComponent<WordEditorProps & { t: Trans /> <label htmlFor='wordEditor-Note_Trans'> {t('wordEditorNoteTrans')} - <a href='https://github.com/crimx/ext-saladict/issues/190' target='_blank'> {t('wordEditorNoteTransExplain')}</a> </label> <textarea rows={5} name='trans'
refactor
remove translation beta
a77357577bca1406dabf9d71a7b888ba045fedd7
2019-12-20 16:41:53
crimx
docs: update contributing guide
false
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9abd92072..9516f5dc7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,9 +54,9 @@ Run `yarn zip` to pack zibballs to `./dist/`. - If the dictionary supports pronunciation: 1. Register the ID at [`config.autopron`](https://github.com/crimx/ext-saladict/blob/a88cfed84129418b65914351ca14b86d7b1b758b/src/app-config/index.ts#L202-L223). 1. Include an [`audio`](https://github.com/crimx/ext-saladict/blob/a88cfed84129418b65914351ca14b86d7b1b758b/src/typings/server.ts#L5-L9) field in the object which search engine returns. - 1. Other exported functions can be called from `View.tsx` via `DictEngineMethod` message channel, see `src/typings/message` for typing details (also don't use the native `sendMessage` function, import `{ message }` from `'@/_helpers/browser-api'`). + 1. Other exported functions can be called from `View.tsx` via `'DICT_ENGINE_METHOD'` message channel. See `src/typings/message` for typing details and search `DICT_ENGINE_METHOD` project-wise for examples. Messages **MUST** be sent via `message` from `'@/_helpers/browser-api'` instead of the native `sendMessage` function. 1. Search result will ultimately be passed to a React PureComponent in `View.tsx`, which **SHOULD** be a dumb component that renders the result accordingly. - 1. Scope the styles in `_style.scss` following [ECSS](http://ecss.io/chapter5.html#anatomy-of-the-ecss-naming-convention)-ish naming convention. + 1. Selectors in `_style.scss` **SHOULD** follow [ECSS](http://ecss.io/chapter5.html#anatomy-of-the-ecss-naming-convention)-ish naming convention. Add Testing @@ -72,7 +72,7 @@ Develop the dictionary UI live This project follows the TypeScript variation of [Standard](https://standardjs.com) JavaScript code style. -If you are using IDEs like VSCode, make sure TSLint related plugins are installed. Or you can just run [building command](#building) to perform a TypeScript full check. +If you are using IDEs like VSCode, make sure *eslint* and *prettier* plugins are installed. Or you can just run [building command](#building) to perform a TypeScript full check. ## Commit Style
docs
update contributing guide
9f0c6b6e39d5ce6483871c4d4f5302e9a508a651
2018-07-26 09:47:08
CRIMX
fix(selection): better ctrl detection
false
diff --git a/src/selection/index.ts b/src/selection/index.ts index 270311c85..4d7870cca 100644 --- a/src/selection/index.ts +++ b/src/selection/index.ts @@ -94,13 +94,13 @@ if (!window.name.startsWith('saladict-') && !isSaladictOptionsPage) { * Pressing ctrl/command key more than three times within 500ms * trigers TripleCtrl */ - const validCtrlPressed$$ = isKeyPressed(isCtrlKey).pipe( - filter(Boolean), - share(), - ) + const ctrlPressed$$ = share<true>()(isKeyPressed(isCtrlKey)) - validCtrlPressed$$.pipe( - buffer(debounceTime(500)(validCtrlPressed$$)), + ctrlPressed$$.pipe( + buffer(merge( + debounceTime(500)(ctrlPressed$$), // collect after 0.5s + isKeyPressed(e => !isCtrlKey(e)), // other key pressed + )), filter(group => group.length >= 3), ).subscribe(() => { message.self.send({ type: MsgType.TripleCtrl }) @@ -167,11 +167,7 @@ merge( /** * Escape key pressed */ -isKeyPressed(isEscapeKey).subscribe(flag => { - if (flag) { - message.self.send({ type: MsgType.EscapeKey }) - } -}) +isKeyPressed(isEscapeKey).subscribe(() => message.self.send({ type: MsgType.EscapeKey })) let lastText: string let lastContext: string @@ -360,14 +356,15 @@ function isEscapeKey (evt: KeyboardEvent): boolean { return evt.key === 'Escape' } -function isKeyPressed (keySelectior: (e: KeyboardEvent) => boolean): Observable<boolean> { - return distinctUntilChanged<boolean>()( - merge( - map(keySelectior)(fromEvent<KeyboardEvent>(window, 'keydown', { capture: true })), - mapTo(false)(fromEvent(window, 'keyup', { capture: true })), - mapTo(false)(fromEvent(window, 'blur', { capture: true })), - of(false) - ) +function isKeyPressed (keySelectior: (e: KeyboardEvent) => boolean): Observable<true> { + return merge( + map(keySelectior)(fromEvent<KeyboardEvent>(window, 'keydown', { capture: true })), + mapTo(false)(fromEvent(window, 'keyup', { capture: true })), + mapTo(false)(fromEvent(window, 'blur', { capture: true })), + of(false), + ).pipe( + distinctUntilChanged(), // ignore long press + filter((x): x is true => x), ) }
fix
better ctrl detection
9e292afbc040ed57147f8bd9c92fc8866e1e194f
2018-08-31 06:13:45
CRIMX
style: remove unused
false
diff --git a/src/_helpers/config-manager.ts b/src/_helpers/config-manager.ts index 2762dd79e..ec0802061 100644 --- a/src/_helpers/config-manager.ts +++ b/src/_helpers/config-manager.ts @@ -6,7 +6,7 @@ * the "active config". This is for backward compatibility. */ -import { AppConfig, appConfigFactory } from '@/app-config' +import { AppConfig } from '@/app-config' import { defaultModesFactory } from '@/app-config/default-modes' import { storage } from './browser-api' // import { Observable, from, concat } from 'rxjs' diff --git a/src/options/index.ts b/src/options/index.ts index 7b1140362..50cc1f760 100644 --- a/src/options/index.ts +++ b/src/options/index.ts @@ -14,7 +14,7 @@ import optionsLocles from '@/_locales/options' import contextLocles from '@/_locales/context' import profileLocles from '@/_locales/config-modes' import { MsgType, MsgSelection } from '@/typings/message' -import { getActiveConfigID, getConfigIDList, initConfig } from '@/_helpers/config-manager' +import { getActiveConfigID, getConfigIDList } from '@/_helpers/config-manager' window.__SALADICT_INTERNAL_PAGE__ = true window.__SALADICT_OPTIONS_PAGE__ = true
style
remove unused
95cb83c2d82daf4a0c4b5b52e5550eef88c6d29d
2019-08-05 10:48:35
crimx
refactor(dicts): sogou
false
diff --git a/package.json b/package.json index 67beb800a..e483febe1 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "dompurify": "^1.0.11", "i18next": "^17.0.6", "lodash": "^4.17.14", + "md5": "^2.2.1", "normalize-scss": "^7.0.1", "observable-hooks": "^1.0.2", "pako": "^1.0.10", diff --git a/src/components/dictionaries/sogou/View.tsx b/src/components/dictionaries/sogou/View.tsx index 2b1ee2205..65d76d1c7 100644 --- a/src/components/dictionaries/sogou/View.tsx +++ b/src/components/dictionaries/sogou/View.tsx @@ -1,3 +1 @@ -import MachineTrans from '@/components/MachineTrans' - -export default MachineTrans +export { MachineTrans as default } from '@/components/MachineTrans/MachineTrans' diff --git a/src/components/dictionaries/sogou/_style.scss b/src/components/dictionaries/sogou/_style.scss deleted file mode 100644 index e0611a68e..000000000 --- a/src/components/dictionaries/sogou/_style.scss +++ /dev/null @@ -1 +0,0 @@ -@import '../../MachineTrans/_style'; diff --git a/src/components/dictionaries/sogou/_style.shadow.scss b/src/components/dictionaries/sogou/_style.shadow.scss new file mode 100644 index 000000000..8af955479 --- /dev/null +++ b/src/components/dictionaries/sogou/_style.shadow.scss @@ -0,0 +1 @@ +@import '@/components/MachineTrans/MachineTrans.scss'; diff --git a/src/components/dictionaries/sogou/engine.ts b/src/components/dictionaries/sogou/engine.ts index 625418eb5..fd763d62a 100644 --- a/src/components/dictionaries/sogou/engine.ts +++ b/src/components/dictionaries/sogou/engine.ts @@ -4,20 +4,27 @@ import { MachineTranslateResult, SearchFunction, GetSrcPageFunction, + DictSearchResult } from '../helpers' -import { DictSearchResult } from '@/typings/server' -import { isContainChinese, isContainJapanese, isContainKorean } from '@/_helpers/lang-check' +import { + isContainChinese, + isContainJapanese, + isContainKorean +} from '@/_helpers/lang-check' import { storage } from '@/_helpers/browser-api' import md5 from 'md5' +import axios from 'axios' +import { fetchPlainText } from '@/_helpers/fetch-dom' export const getSrcPage: GetSrcPageFunction = (text, config, profile) => { - const lang = profile.dicts.all.sogou.options.tl === 'default' - ? config.langCode === 'zh-CN' - ? 'zh-CHS' - : config.langCode === 'zh-TW' + const lang = + profile.dicts.all.sogou.options.tl === 'default' + ? config.langCode === 'zh-CN' + ? 'zh-CHS' + : config.langCode === 'zh-TW' ? 'zh-CHT' : 'en' - : profile.dicts.all.sogou.options.tl + : profile.dicts.all.sogou.options.tl return `https://fanyi.sogou.com/#auto/${lang}/${text}` } @@ -33,6 +40,7 @@ export type SogouResult = MachineTranslateResult<'sogou'> type SogouSearchResult = DictSearchResult<SogouResult> +// prettier-ignore const langcodes: ReadonlyArray<string> = [ 'zh-CHS', 'zh-CHT', 'en', 'af', 'ar', 'bg', 'bn', 'bs-Latn', 'ca', 'cs', 'cy', 'da', 'de', 'el', 'es', 'et', @@ -42,76 +50,112 @@ const langcodes: ReadonlyArray<string> = [ 'uk', 'ur', 'vi', 'yua', 'yue', ] -export const search: SearchFunction<SogouSearchResult, MachineTranslatePayload> = async ( - text, config, profile, payload -) => { +export const search: SearchFunction< + SogouResult, + MachineTranslatePayload +> = async (text, config, profile, payload) => { const options = profile.dicts.all.sogou.options const sl: string = payload.sl || 'auto' - const tl: string = payload.tl || ( - options.tl === 'default' + const tl: string = + payload.tl || + (options.tl === 'default' ? config.langCode === 'en' ? 'en' - : !isContainChinese(text) || isContainJapanese(text) || isContainKorean(text) - ? config.langCode === 'zh-TW' ? 'zh-CHT' : 'zh-CHS' - : 'en' - : options.tl - ) + : !isContainChinese(text) || + isContainJapanese(text) || + isContainKorean(text) + ? config.langCode === 'zh-TW' + ? 'zh-CHT' + : 'zh-CHS' + : 'en' + : options.tl) if (payload.isPDF && !options.pdfNewline) { text = text.replace(/\n+/g, ' ') } - return fetch('https://fanyi.sogou.com/reventondc/translate', { - method: 'POST', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - 'X-Requested-With': 'XMLHttpRequest', - }, - body: `from=${sl}&to=${tl}&text=${encodeURIComponent(text).replace(/%20/g, '+')}&uuid=${getUUID()}&s=${md5('' + sl + tl + text + await getSogouToken())}&client=pc&fr=browser_pc&useDetect=on&useDetectResult=on&needQc=1&oxford=on&isReturnSugg=on` - }) - .then(r => r.json()) - .then(json => handleJSON(json, sl, tl)) - // return empty result so that user can still toggle language - .catch((): SogouSearchResult => ({ - result: { - id: 'sogou', - sl, tl, langcodes, - searchText: { text: '' }, - trans: { text: '' } - } - })) + return ( + axios + .post('https://fanyi.sogou.com/reventondc/translate', { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'X-Requested-With': 'XMLHttpRequest' + }, + data: new URLSearchParams({ + from: sl, + to: tl, + text: encodeURIComponent(text).replace(/%20/g, '+'), + uuid: getUUID(), + s: md5('' + sl + tl + text + (await getSogouToken())), + client: 'pc', + fr: 'browser_pc', + useDetect: 'on', + useDetectResult: 'on', + needQc: '1', + oxford: 'on', + isReturnSugg: 'on' + }) + }) + .then(({ data: { data } }) => handleJSON(data, sl, tl)) + // return empty result so that user can still toggle language + .catch( + (): SogouSearchResult => ({ + result: { + id: 'sogou', + sl, + tl, + langcodes, + searchText: { text: '' }, + trans: { text: '' } + } + }) + ) + ) } -function handleJSON (json: any, sl: string, tl: string): SogouSearchResult | Promise<SogouSearchResult> { - const tr = json.translate as undefined | { - errorCode: string // "0" - from: string - to: string - text: string - dit: string - } +function handleJSON( + json: any, + sl: string, + tl: string +): SogouSearchResult | Promise<SogouSearchResult> { + const tr = json.translate as + | undefined + | { + errorCode: string // "0" + from: string + to: string + text: string + dit: string + } if (!tr || tr.errorCode !== '0') { return handleNoResult() } - const transAudio = tr.to === 'zh-CHT' - ? `https://fanyi.sogou.com/reventondc/microsoftGetSpeakFile?text=${encodeURIComponent(tr.dit)}&spokenDialect=zh-CHT&from=translateweb` - : `https://fanyi.sogou.com/reventondc/synthesis?text=${encodeURIComponent(tr.dit)}&speed=1&lang=${tr.to}&from=translateweb` + const trdit = encodeURIComponent(tr.dit) + const trtext = encodeURIComponent(tr.text) + + const transAudio = + tr.to === 'zh-CHT' + ? `https://fanyi.sogou.com/reventondc/microsoftGetSpeakFile?text=${trdit}&spokenDialect=zh-CHT&from=translateweb` + : `https://fanyi.sogou.com/reventondc/synthesis?text=${trdit}&speed=1&lang=${tr.to}&from=translateweb` return { result: { id: 'sogou', - sl, tl, langcodes, + sl, + tl, + langcodes, trans: { text: tr.dit, audio: transAudio }, searchText: { text: tr.text, - audio: tr.from === 'zh-CHT' - ? `https://fanyi.sogou.com/reventondc/microsoftGetSpeakFile?text=${encodeURIComponent(tr.text)}&spokenDialect=zh-CHT&from=translateweb` - : `https://fanyi.sogou.com/reventondc/synthesis?text=${encodeURIComponent(tr.text)}&speed=1&lang=${tr.from}&from=translateweb` + audio: + tr.from === 'zh-CHT' + ? `https://fanyi.sogou.com/reventondc/microsoftGetSpeakFile?text=${trtext}&spokenDialect=zh-CHT&from=translateweb` + : `https://fanyi.sogou.com/reventondc/synthesis?text=${trtext}&speed=1&lang=${tr.from}&from=translateweb` } }, audio: { @@ -120,7 +164,7 @@ function handleJSON (json: any, sl: string, tl: string): SogouSearchResult | Pro } } -function getUUID () { +function getUUID() { let uuid = '' for (let i = 0; i < 32; i++) { if (i === 8 || i === 12 || i === 16 || i === 20) { @@ -132,23 +176,27 @@ function getUUID () { return uuid } -async function getSogouToken (): Promise<string> { - let { dict_sogou } = await storage.local.get<{'dict_sogou': SogouStorage}>('dict_sogou') - if (!dict_sogou || (Date.now() - dict_sogou.tokenDate > 5 * 60000)) { +async function getSogouToken(): Promise<string> { + let { dict_sogou } = await storage.local.get<{ dict_sogou: SogouStorage }>( + 'dict_sogou' + ) + if (!dict_sogou || Date.now() - dict_sogou.tokenDate > 5 * 60000) { let token = '72da1dc662daf182c4f7671ec884074b' try { - const homepage = await fetch('https://fanyi.sogou.com').then(r => r.text()) + const homepage = await fetchPlainText('https://fanyi.sogou.com') const appjsMatcher = /dlweb\.sogoucdn\.com\/translate\/pc\/static\/js\/app\.\S+\.js/ const appjsPath = (homepage.match(appjsMatcher) || [''])[0] if (appjsPath) { - const appjs = await fetch('https://' + appjsPath).then(r => r.text()) + const appjs = await fetchPlainText('https://' + appjsPath) const matchRes = appjs.match(/"(\w{32})"/) if (matchRes) { token = matchRes[1] } } - } catch (e) {/* nothing */} + } catch (e) { + /* nothing */ + } dict_sogou = { token, tokenDate: Date.now() diff --git a/test/specs/components/dictionaries/sogou/requests.mock.ts b/test/specs/components/dictionaries/sogou/requests.mock.ts new file mode 100644 index 000000000..61bf494dd --- /dev/null +++ b/test/specs/components/dictionaries/sogou/requests.mock.ts @@ -0,0 +1,20 @@ +import { MockRequest } from '@/components/dictionaries/helpers' + +export const mockSearchTexts = ['I love you'] + +export const mockRequest: MockRequest = mock => { + mock + .onGet(/js\/app/) + .reply( + 200, + `var y=d(""+a+c+n+"8954e2993f18dd83fd05e79bd6dd040e"),b={"from":a,"to":c,"text":n,"useDetect":"on","useDetectResult":"on","needQc":0,"uuid":f,"oxford":"on","isReturnSugg":"off","isStroke":"on","fr":"selection","s":y}` + ) + mock + .onGet('https://fanyi.sogou.com') + .reply( + 200, + `<script type=text/javascript src=//dlweb.sogoucdn.com/translate/pc/static/js/app.20daabb6.js></script>` + ) + + mock.onPost(/sogou/).reply(200, require('./response/i-love-you.json')) +} diff --git a/test/specs/components/dictionaries/sogou/response/i-love-you.json b/test/specs/components/dictionaries/sogou/response/i-love-you.json new file mode 100644 index 000000000..54729ca5e --- /dev/null +++ b/test/specs/components/dictionaries/sogou/response/i-love-you.json @@ -0,0 +1,530 @@ +{ + "data": { + "keywords": [ + { + "value": "爱;热爱;所爱之人;零分;零;爱情;恋爱;喜爱;爱好;性爱;爱恋;爱慕;喜欢", + "key": "love" + } + ], + "detect": { + "zly": "zly", + "detect": "en", + "errorCode": "0", + "language": "英语", + "id": "0cafae67-df75-43f8-a23e-951391d36c9a", + "text": "I love you" + }, + "translate": { + "qc_type": "1", + "zly": "zly", + "errorCode": "0", + "index": "content0", + "from": "en", + "source": "sogou", + "text": "I love you", + "to": "zh-CHS", + "id": "0cafae67-df75-43f8-a23e-951391d36c9a", + "dit": "我爱你", + "orig_text": "I love you", + "md5": "" + }, + "common_dict": { + "dict": [ + { + "precisely": false, + "dict_name": "oxford_buchong", + "content": [ + { + "value": [ + { + "first_interpretation": "我爱你", + "phonetic": [ + { "filename": "", "text": "ʌɪ lʌv juː", "type": "uk" } + ], + "usual": [ + { "pos": "", "values": ["我爱你;我爱您;我爱你们"] } + ], + "levelList": [], + "keyword_score": -1, + "word": "i love you", + "exchange_info": {} + } + ], + "key": "i love you" + } + ] + } + ] + }, + "bilingual": { + "code": 0, + "data": { + "list": [ + { + "summary": { + "source": "I love you no lie no exaggeration without a trace without any lies.", + "type": 0, + "url": "www.weixinrensheng.com", + "target": "我爱你没撒谎没夸张没有一丝虚假不带任何谎言。" + }, + "forward": [], + "title_length": 13, + "title": "<em>I</em> <em>love</em> <em>you</em> no lie no exaggeration without a trace without any lies.", + "type": 0, + "url": "http://bisentence_enzh.sogou.com/41b05ba85c7ab3dee8142bf384814785", + "content": "", + "expire-time": 2524579200, + "build-time": 1525622400, + "pagerank": 1, + "strict": 1, + "page_status": "normal", + "key": ["bisentence_enzh"] + }, + { + "summary": { + "source": "If so, I think you'd better speak \"I love you\" to her directly.", + "type": 0, + "url": "imsci.cn", + "target": "如果是这样的话,我认为你最好说“我爱你”,但她的直接。" + }, + "forward": [], + "title_length": 13, + "title": "If so, I think you'd better speak \"<em>I</em> <em>love</em> <em>you</em>\" to her directly.", + "type": 0, + "url": "http://bisentence_enzh.sogou.com/a1bb7145f023ee4a1100ceb765f694d2", + "content": "", + "expire-time": 2524579200, + "build-time": 1525622400, + "pagerank": 1, + "strict": 1, + "page_status": "normal", + "key": ["bisentence_enzh"] + }, + { + "summary": { + "source": "Dear Creator, I love you; I pray for a contact - with you;", + "type": 0, + "url": "blog.sina.com.cn", + "target": "亲爱的创造者,我爱你,我请求接触。" + }, + "forward": [], + "title_length": 13, + "title": "Dear Creator, <em>I</em> <em>love</em> <em>you</em>; I pray for a contact - with you;", + "type": 0, + "url": "http://bisentence_enzh.sogou.com/aa7aa0309fdfc9cad36aea5461f93d25", + "content": "", + "expire-time": 2524579200, + "build-time": 1525622400, + "pagerank": 1, + "strict": 1, + "page_status": "normal", + "key": ["bisentence_enzh"] + }, + { + "summary": { + "source": "A person walking down the street, suddenly remind of lonely I love you.", + "type": 0, + "url": "www.qqzf.cn", + "target": "羀一个人走在寂寞的街,忽然想起我爱你。" + }, + "forward": [], + "title_length": 13, + "title": "A person walking down the street, suddenly remind of lonely <em>I</em> <em>love</em> <em>you</em>.", + "type": 0, + "url": "http://bisentence_enzh.sogou.com/c9f1be86faca535be5c1c1e563f475f1", + "content": "", + "expire-time": 2524579200, + "build-time": 1525622400, + "pagerank": 1, + "strict": 1, + "page_status": "normal", + "key": ["bisentence_enzh"] + }, + { + "summary": { + "source": "The inverted bathtub full of water out?So, so, yes, I love you …", + "type": 0, + "url": "blog.sina.com.cn", + "target": "整个浴缸的水全部倒的出吗?可以,所以,是的,我爱你…" + }, + "forward": [], + "title_length": 13, + "title": "The inverted bathtub full of water out?So, so, yes, <em>I</em> <em>love</em> <em>you</em> …", + "type": 0, + "url": "http://bisentence_enzh.sogou.com/da0405b42a6f39a09d20fd62c6a53379", + "content": "", + "expire-time": 2524579200, + "build-time": 1525622400, + "pagerank": 1, + "strict": 1, + "page_status": "normal", + "key": ["bisentence_enzh"] + }, + { + "summary": { + "source": "\"I'm great. Just wanted to say I love you. \" he said gently.", + "type": 0, + "url": "www.hnjobw.com", + "target": "“我很好,只是想对你说我爱你。”他温柔地说。" + }, + "forward": [], + "title_length": 13, + "title": "\"I'm great. Just wanted to say <em>I</em> <em>love</em> <em>you</em>. \" he said gently.", + "type": 0, + "url": "http://bisentence_enzh.sogou.com/3a694b10226a67e146150df57956dcc1", + "content": "", + "expire-time": 2524579200, + "build-time": 1525622400, + "pagerank": 1, + "strict": 1, + "page_status": "normal", + "key": ["bisentence_enzh"] + }, + { + "summary": { + "source": "Guys, come on. I love you both. I got a plane to catch.", + "type": 0, + "url": "blog.sina.com.cn", + "target": "亲爱的,快点,我爱你们,但我们还要赶飞机。" + }, + "forward": [], + "title_length": 13, + "title": "Guys, come on. <em>I</em> <em>love</em> <em>you</em> both. I got a plane to catch.", + "type": 0, + "url": "http://bisentence_enzh.sogou.com/414afc1eab76b28197a800d86869e0a4", + "content": "", + "expire-time": 2524579200, + "build-time": 1525622400, + "pagerank": 1, + "strict": 1, + "page_status": "normal", + "key": ["bisentence_enzh"] + }, + { + "summary": { + "source": "Laogong, I love you so much, I miss you, can't sleep. . .", + "type": 0, + "url": "blog.sina.com.cn", + "target": "老公,我好爱你,我很想你,睡不着。" + }, + "forward": [], + "title_length": 13, + "title": "Laogong, <em>I</em> <em>love</em> <em>you</em> so much, I miss you, can't sleep. . .", + "type": 0, + "url": "http://bisentence_enzh.sogou.com/b737d795f7f9ea8f7cb90d1a3150ca55", + "content": "", + "expire-time": 2524579200, + "build-time": 1525622400, + "pagerank": 1, + "strict": 1, + "page_status": "normal", + "key": ["bisentence_enzh"] + }, + { + "summary": { + "source": "I send this Valen tine’s card to remind you that I love you.", + "type": 0, + "url": "gb.cri.cn", + "target": "我送上这张卡片,为的是要提醒你,我爱你。" + }, + "forward": [], + "title_length": 13, + "title": "I send this Valen tine’s card to remind you that <em>I</em> <em>love</em> <em>you</em>.", + "type": 0, + "url": "http://bisentence_enzh.sogou.com/8d23de551490454375f89a37f7e5a944", + "content": "", + "expire-time": 2524579200, + "build-time": 1525622400, + "pagerank": 1, + "strict": 1, + "page_status": "normal", + "key": ["bisentence_enzh"] + }, + { + "summary": { + "source": "No amount of sweet words, a word I love you covers the love.", + "type": 0, + "url": "www.qqzhi.com", + "target": "再多的甜言蜜语,一句我爱你涵盖了爱情。" + }, + "forward": [], + "title_length": 13, + "title": "No amount of sweet words, a word <em>I</em> <em>love</em> <em>you</em> covers the love.", + "type": 0, + "url": "http://bisentence_enzh.sogou.com/1c1dfc55e0df53bf31d8acc8649efaa3", + "content": "", + "expire-time": 2524579200, + "build-time": 1525622400, + "pagerank": 1, + "strict": 1, + "page_status": "normal", + "key": ["bisentence_enzh"] + } + ] + } + }, + "keyword_dict": [ + { + "dict": [ + { + "precisely": true, + "dict_name": "oxford", + "content": [ + { + "value": [ + { + "usual": [ + { + "pos": "n.", + "values": [ + "爱;热爱;所爱之人;零分;零;爱情;恋爱;喜爱;爱好;性爱" + ] + }, + { "pos": "v.", "values": ["爱恋;爱慕;喜欢;爱好"] } + ], + "is_show_for_vr": 1, + "levelList": ["高中", "四级", "考研"], + "origin": [ + "Old English <Italic>lufu</Italic>, of Germanic origin; from an Indo-European root shared by Sanskrit <Italic>lubhyati</Italic> ‘desires', Latin <Italic>libet</Italic> ‘it is pleasing', <Italic>libido</Italic> ‘desire', also by <Bold>LEAVE</Bold><Superscript>2</Superscript> and <Bold>LIEF</Bold>." + ], + "keyword_score": 769, + "content": [ + { + "item": { + "core": [ + { + "index": "<Bold>1</Bold>", + "detail": { + "en": "[mass noun]an intense feeling of deep affection", + "zh": "爱,热爱" + }, + "branch": [ + { + "detail": { + "en": "a deep romantic or sexual attachment to someone", + "zh": "爱情,恋爱,性爱" + }, + "example": [ + { + "en": "<Italic>it was love at first sight</Italic>", + "zh": "这是一见钟情" + }, + { + "en": "<Italic>they were both </Italic><Bold>in love with</Bold><Italic> her</Italic>", + "zh": "他们两个人都爱上了她" + }, + { + "en": "<Italic>we were slowly </Italic><Bold>falling in love</Bold>.", + "zh": "我们慢慢地坠入爱河。" + } + ] + }, + { + "detail": { + "en": "(<Bold>Love</Bold>)a personified figure of love, often represented as Cupid", + "zh": "爱神(常用丘比特的人性化雕像代表)。" + } + }, + { + "detail": { + "en": "a great interest and pleasure in something", + "zh": "爱好;喜爱" + }, + "example": [ + { + "en": "<Italic>his </Italic><Bold>love for</Bold><Italic> football</Italic>", + "zh": "他对足球的热爱" + }, + { + "en": "<Italic>we share </Italic><Bold>a love of</Bold><Italic> music.</Italic>", + "zh": " 我们都爱好音乐。" + } + ] + }, + { + "detail": { + "en": "affectionate greetings conveyed to someone on one's behalf", + "zh": "[用 以向别人表达亲密问候]  爱你的。" + } + }, + { + "detail": { + "en": "a formula for ending an affectionate letter", + "zh": "[用于致亲人或至交的信件结尾套语] 爱你(们)的" + }, + "example": [ + { + "en": "<Italic>take care, lots of love, Judy</Italic>.", + "zh": "保重,爱你(们)的,朱迪。" + } + ] + } + ], + "example": [ + { + "en": "<Italic>babies fill parents with intense feelings of love</Italic>", + "zh": "父母对婴儿充满了爱意" + }, + { + "en": "<Italic>their </Italic><Bold>love for</Bold><Italic> their country.</Italic>", + "zh": " 他们对祖国的热爱。" + } + ] + }, + { + "index": "<Bold>2</Bold>", + "detail": { + "en": "a person or thing that one loves", + "zh": "所爱之人(或物)" + }, + "branch": [ + { + "detail": { + "en": "<Italic>Brit. informal</Italic> a friendly form of address", + "zh": "〈英, 非正式〉 [一 种表示友好的称呼] 亲爱的" + }, + "example": [ + { + "en": "<Italic>it's all right, love</Italic>.", + "zh": "没关系,亲爱的。" + } + ] + }, + { + "detail": { + "en": "(<Bold>a love</Bold>)<Italic>informal</Italic> used to express affectionate approval for someone", + "zh": "〈非正式〉 (用于表示对某人的亲切好感)宝贝" + }, + "example": [ + { + "en": "<Italic>don't fret, there's a love</Italic>.", + "zh": "别发愁,宝贝。" + } + ] + } + ], + "example": [ + { + "en": "<Italic>she was </Italic><Bold>the love of his life</Bold><Italic> </Italic>", + "zh": "她是他一生之所爱" + }, + { + "en": "<Italic>their two great loves are tobacco and whisky.</Italic>", + "zh": " 他们的两大爱好是烟草和威士忌。" + } + ] + }, + { + "index": "<Bold>3</Bold>", + "detail": { + "en": "[mass noun](in tennis, squash, and some other sports)a score of zero; nil", + "zh": "(网球、软式墙网球和其他运动)零分;零" + }, + "example": [ + { + "en": "<Italic>love fifteen</Italic>", + "zh": "0比15" + }, + { + "en": "<Italic>he was down two sets to love.</Italic>", + "zh": "他以两盘皆输而败北。[ORIGIN: apparently from the phrase <Italic>play for love</Italic> (i.e. the love of the game, not for money); folk etymology has connected the word with French <Italic>l'oeuf</Italic> ‘egg' from the resemblance in shape between an egg and a zero] ." + } + ] + } + ], + "pos": "n.", + "posCoreInfoList": [] + } + }, + { + "item": { + "core": [ + { + "index": "<Bold>1</Bold>", + "detail": { + "en": "feel a deep romantic or sexual attachment to (someone)", + "zh": "爱恋(某人),爱慕" + }, + "branch": [ + { + "detail": { + "en": "like very much; find pleasure in", + "zh": "喜欢;爱好" + }, + "example": [ + { + "en": "<Italic>I'd love a cup of tea, thanks</Italic>", + "zh": "我想要一杯茶,谢谢" + }, + { + "en": "<Italic>I just love dancing</Italic>", + "zh": "我就是喜欢跳舞" + }, + { + "en": "[as adj., in combination-<Bold>loving</Bold>]<Italic>a fun-loving girl.</Italic>", + "zh": " 一个喜欢找乐子的女孩。" + } + ] + } + ], + "example": [ + { + "en": "<Italic>do you love me?</Italic>", + "zh": "你爱我吗?" + } + ] + } + ], + "pos": "v.", + "posCoreInfoList": ["[with obj.]"] + } + } + ], + "derivatives": [ + "<Bold>loveless</Bold> <Italic>adjective</Italic>, <Bold>lovelessly</Bold> <Italic>adverb</Italic>, <Bold>lovelessness</Bold> <Italic>noun, </Italic><Bold>loveworthy</Bold> <Italic>adjective</Italic>." + ], + "first_interpretation": "爱", + "phonetic": [ + { + "filename": "//dlweb.sogoucdn.com/phonetic/loveDELIMITER_gb_1.mp3", + "text": "lʌv", + "type": "uk" + }, + { + "filename": "//dlweb.sogoucdn.com/phonetic/loveDELIMITER_us_1.mp3", + "text": "ləv", + "type": "usa" + } + ], + "phonetic_add": [], + "rarelyWordDict": { + "rarelyWordList": [], + "isHaveRarelyWord": 0 + }, + "phrases": [ + "<Bold>for love</Bold> for pleasure not profit 出于喜爱 <Italic>he played </Italic><Bold>for the love of</Bold> <Italic>the game.</Italic> 他参加比赛就是因为喜欢它。<Bold>for the love of God</Bold> used to express annoyance, surprise, or urgent pleading 看在上帝的份上(用于表示恼怒、惊讶或急切的请求) <Italic>for the love of God, get me out of here </Italic>看在上帝的分上,让我离开这里!<Bold>for the love of Mike</Bold> <Italic>Brit. informal</Italic> used to accompany an exasperated request or to express dismay 〈英,非正式〉 看在上帝的分上,务请(与强烈的请求一起使用,或用以表达沮丧)。<Bold>love me, love my dog</Bold> <Italic>proverb</Italic> if you love someone, you must accept everything about them, even their faults or weaknesses 〈谚〉 爱屋及乌。<Bold>make love</Bold> <Bold>1</Bold> have sexual intercourse 做爱。<Bold>2</Bold> (<Bold>make love to</Bold>) <Italic>dated</Italic> pay amorous attention to (someone)〈旧〉 (向某人)示爱。<Bold>not for love or money</Bold> <Italic>informal</Italic> not for any inducement or in any circumstances〈非正式〉 不管如何劝诱都不;在任何情况之下都不,决不 <Italic>they'll not return for love or money.</Italic> 他们无论如何是不会回来了。<Bold>there's no</Bold> (或<Bold>little</Bold>,<Bold>not much) love lost between</Bold> there is mutual dislike between (two or more people mentioned)…之间没有好感,互相厌恶。" + ], + "no_show_char_list": [], + "word": "<Bold>love</Bold>", + "exchange_info": { + "word_done": ["loved"], + "word_pl": ["loves"], + "word_third": ["loves"], + "word_ing": ["loving"], + "word_past": ["loved"] + } + } + ], + "key": "love" + } + ] + } + ], + "word": "love" + } + ] + }, + "zly": "zly", + "info": "success", + "status": 0 +} diff --git a/yarn.lock b/yarn.lock index 0ed2875ce..d4379e80a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3841,6 +3841,11 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== +charenc@~0.0.1: + version "0.0.2" + resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" + integrity sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc= + chokidar@^2.0.2, chokidar@^2.0.4, chokidar@^2.1.6: version "2.1.6" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.6.tgz#b6cad653a929e244ce8a834244164d241fa954c5" @@ -4626,6 +4631,11 @@ cross-spawn@^5.0.1: shebang-command "^1.2.0" which "^1.2.9" +crypt@~0.0.1: + version "0.0.2" + resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" + integrity sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs= + crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -7339,7 +7349,7 @@ is-binary-path@^1.0.0: dependencies: binary-extensions "^1.0.0" -is-buffer@^1.0.2, is-buffer@^1.1.5: +is-buffer@^1.0.2, is-buffer@^1.1.5, is-buffer@~1.1.1: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== @@ -8710,6 +8720,15 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" +md5@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/md5/-/md5-2.2.1.tgz#53ab38d5fe3c8891ba465329ea23fac0540126f9" + integrity sha1-U6s41f48iJG6RlMp6iP6wFQBJvk= + dependencies: + charenc "~0.0.1" + crypt "~0.0.1" + is-buffer "~1.1.1" + [email protected]: version "2.0.4" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b"
refactor
sogou
bae472d4933bee1d964dda0dc796cb30e249fdd3
2019-05-24 20:55:03
CRIMX
test: log error
false
diff --git a/test/specs/components/dictionaries/helpers.ts b/test/specs/components/dictionaries/helpers.ts index 8171abcd4..b95d6ea70 100644 --- a/test/specs/components/dictionaries/helpers.ts +++ b/test/specs/components/dictionaries/helpers.ts @@ -11,5 +11,6 @@ export async function retry (executor: () => Promise<any>, retryTimes = 1) { await timer(1000) } } + console.error(error) return Promise.reject(error) }
test
log error
d701b561ad053f36fd0dce0926e3d1760fdb8bd2
2019-01-21 23:08:49
CRIMX
refactor(options): add layout for modal
false
diff --git a/src/options/components/options/helpers.ts b/src/options/components/options/helpers.ts index 7d0c4eb87..4a45536d3 100644 --- a/src/options/components/options/helpers.ts +++ b/src/options/components/options/helpers.ts @@ -5,14 +5,19 @@ import { updateProfile } from '@/_helpers/profile-manager' import set from 'lodash/set' import get from 'lodash/get' -export const formItemLayout = { +interface FormItemLayout { + readonly labelCol: { readonly span: number } + readonly wrapperCol: { readonly span: number } +} + +export const formItemLayout: FormItemLayout = { labelCol: { span: 5 }, wrapperCol: { span: 8 }, } -export const formItemInlineStyle = { - display: 'inline-block', - margin: 0, +export const formItemModalLayout: FormItemLayout = { + labelCol: { span: 6 }, + wrapperCol: { span: 17 }, } let updateConfigTimeout: any = null @@ -40,9 +45,10 @@ export function updateConfigOrProfile ( } if (process.env.DEV_BUILD) { - console.log(path, fields[path]) + const p = path.replace(/#/g, '.') + console.log(p, fields[path]) const err = {} - if (get(props, path.replace(/#/g, '.'), err) === err) { + if (get(props, p, err) === err) { console.error('field not exist', fields) } }
refactor
add layout for modal
1e648caac7ae44746b8b3a347599bcf91c21c2b7
2020-03-26 15:16:53
crimx
docs: add issue hunt
false
diff --git a/README.md b/README.md index 49d25fa2f..187399041 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ [![Standard - JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg?maxAge=2592000)](https://standardjs.com/) [![License](https://img.shields.io/github/license/crimx/ext-saladict.svg?colorB=44cc11?maxAge=2592000)](https://github.com/crimx/ext-saladict/blob/dev/LICENSE) +[![Let's fund issues in this repository](https://issuehunt.io/static/embed/issuehunt-button-v1.svg)](https://issuehunt.io/r/crimx/ext-saladict) + Chrome/Firefox WebExtension. Feature-rich inline translator with PDF support. [【中文】](https://www.crimx.com/ext-saladict/)Chrome/Firefox 浏览器插件,网页划词翻译。
docs
add issue hunt
401f45788cc5a042250144aeff615765187c4881
2018-10-30 16:40:47
CRIMX
refactor(sync): update background server
false
diff --git a/src/background/server.ts b/src/background/server.ts index 509918677..c9523aa2f 100644 --- a/src/background/server.ts +++ b/src/background/server.ts @@ -5,7 +5,7 @@ import { timeout, timer } from '@/_helpers/promise-more' import { createActiveConfigStream } from '@/_helpers/config-manager' import { DictSearchResult } from '@/typings/server' import { SearchErrorType, SearchFunction } from '@/components/dictionaries/helpers' -import { initSyncService } from './sync-manager' +import { syncServiceInit, syncServiceDownload, syncServiceUpload } from './sync-manager' import { isInNotebook, saveWord, deleteWords, getWordsByText, getWords } from './database' import { play } from './audio-manager' import { @@ -74,7 +74,11 @@ message.addListener((data, sender: browser.runtime.MessageSender) => { return getWords(data as MsgGetWords) case MsgType.SyncServiceInit: - return initSyncService((data as MsgSyncServiceInit).config) + return syncServiceInit((data as MsgSyncServiceInit).config) + case MsgType.SyncServiceDownload: + return syncServiceDownload() + case MsgType.SyncServiceUpload: + return syncServiceUpload() case 'youdao_translate_ajax' as any: return youdaoTranslateAjax(data.request) diff --git a/src/background/sync-manager/index.ts b/src/background/sync-manager/index.ts index 015e9c784..e634548fa 100644 --- a/src/background/sync-manager/index.ts +++ b/src/background/sync-manager/index.ts @@ -8,13 +8,13 @@ import * as service from './services/webdav' import { createSyncConfigStream, getMeta, setMeta, setNotebook, getNotebook, NotebookFile, getSyncConfig } from './helpers' /** Init on new server */ -export function initSyncService (config: any): Promise<void> { +export function syncServiceInit (config: any): Promise<void> { return service.initServer(config) } export function startSyncServiceInterval () { // Moniter sync configs and start interval - createSyncConfigStream().pipe( + return createSyncConfigStream().pipe( switchMap(configs => { if (!configs || !configs[service.serviceID]) { if (process.env.DEV_BUILD) { @@ -37,7 +37,7 @@ export function startSyncServiceInterval () { ) } -export async function upload () { +export async function syncServiceUpload () { const config = await getSyncConfig<service.SyncConfig>(service.serviceID) if (!config) { if (process.env.DEV_BUILD) { @@ -46,7 +46,7 @@ export async function upload () { return } - await downlaod(config) + await download(config) const words = await getNotebook() if (!words || words.length <= 0) { return } @@ -77,7 +77,18 @@ export async function upload () { ) } -async function downlaod (config) { +export async function syncServiceDownload (): Promise<void> { + const config = await getSyncConfig<service.SyncConfig>(service.serviceID) + if (!config) { + if (process.env.DEV_BUILD) { + console.warn('Download notebook failed. No Config.') + } + return + } + await download(config) +} + +async function download (config) { const meta = await getMeta<service.Meta>(service.serviceID) const response = await service.dlChanged(config, meta || {}) if (!response) { return } diff --git a/src/typings/message.ts b/src/typings/message.ts index 96dbe786c..47ad4bfc8 100644 --- a/src/typings/message.ts +++ b/src/typings/message.ts @@ -67,6 +67,8 @@ export const enum MsgType { EmitSelection, SyncServiceInit, + SyncServiceDownload, + SyncServiceUpload, /** * Background proxy sends back underlyingly
refactor
update background server
2304fc19dcccbedc9b62c2bafbc19c7ca780d7e0
2019-08-05 18:38:00
crimx
refactor: getText accepts null node
false
diff --git a/src/components/dictionaries/helpers.ts b/src/components/dictionaries/helpers.ts index 334efb164..d8648a617 100644 --- a/src/components/dictionaries/helpers.ts +++ b/src/components/dictionaries/helpers.ts @@ -92,19 +92,23 @@ export interface MachineTranslateResult<ID extends DictID> { * Get the textContent of a node or its child. */ export function getText( - parent: ParentNode, + parent: ParentNode | null, selector?: string, toChz?: boolean ): string export function getText( - parent: ParentNode, + parent: ParentNode | null, toChz?: boolean, selector?: string ): string export function getText( - parent: ParentNode, + parent: ParentNode | null, ...args: [string?, boolean?] | [boolean?, string?] ): string { + if (!parent) { + return '' + } + let selector = '' let toChz = false for (let i = args.length - 1; i >= 0; i--) {
refactor
getText accepts null node
c6aca15885ed47cddd1d7ce82fa0500ac7c214e5
2018-06-01 15:54:35
CRIMX
fix(selection): always update last selection text
false
diff --git a/src/selection/index.ts b/src/selection/index.ts index 10b661a04..c46478745 100644 --- a/src/selection/index.ts +++ b/src/selection/index.ts @@ -12,8 +12,8 @@ import { fromEvent } from 'rxjs/observable/fromEvent' import { timer } from 'rxjs/observable/timer' import { merge } from 'rxjs/observable/merge' import { of } from 'rxjs/observable/of' -import { async as asyncScheduler } from 'rxjs/scheduler/async' import { map } from 'rxjs/operators/map' +import { delay } from 'rxjs/operators/delay' import { mapTo } from 'rxjs/operators/mapTo' import { scan } from 'rxjs/operators/scan' import { filter } from 'rxjs/operators/filter' @@ -21,7 +21,6 @@ import { take } from 'rxjs/operators/take' import { switchMap } from 'rxjs/operators/switchMap' import { buffer } from 'rxjs/operators/buffer' import { debounceTime } from 'rxjs/operators/debounceTime' -import { observeOn } from 'rxjs/operators/observeOn' import { share } from 'rxjs/operators/share' import { distinctUntilChanged } from 'rxjs/operators/distinctUntilChanged' @@ -94,7 +93,7 @@ const validMouseup$$ = merge( // if user click on a selected text, // getSelection would reture the text before the highlight disappears // delay to wait for selection get cleared - observeOn(asyncScheduler), + delay(10), share(), ) @@ -144,7 +143,6 @@ validMouseup$$.subscribe(({ clientX, clientY }) => { // Ignore it so that the panel won't follow. return } - lastText = text lastContext = context sendMessage( @@ -163,8 +161,11 @@ validMouseup$$.subscribe(({ clientX, clientY }) => { }, ) } else { + lastContext = '' sendEmptyMessage() } + // always update text + lastText = text }) function sendMessage (
fix
always update last selection text
cb42e7cad4c9550d28a48c78d83342ca750df6aa
2019-08-24 17:19:42
crimx
build: rename jsonp function
false
diff --git a/.neutrinorc.js b/.neutrinorc.js index d876f00ff..e17f8caab 100644 --- a/.neutrinorc.js +++ b/.neutrinorc.js @@ -114,6 +114,9 @@ module.exports = { neutrino => { /* eslint-disable indent */ + // avoid collision + neutrino.config.output.jsonpFunction('saladictJSONP') + // transform *.shadow.(css|scss) to string // this will be injected into shadow-dom style tag // prettier-ignore
build
rename jsonp function
d44798bbf440e36accf901fa2cc089a2e2330722
2018-05-10 18:09:17
CRIMX
refactor(components): refactor star rates
false
diff --git a/src/components/StarRates.vue b/src/components/StarRates.vue deleted file mode 100644 index ae06ad90b..000000000 --- a/src/components/StarRates.vue +++ /dev/null @@ -1,42 +0,0 @@ -<template> - <div :class="className"> - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 426.67 426.67" - v-for="i in 5" - :width="width" - :style="{'margin-right': i === 5 ? '' : gutter + 'px'}" - > - <path :fill="i <= rate ? '#FAC917' : '#d1d8de'" d="M213.33 10.44l65.92 133.58 147.42 21.42L320 269.4l25.17 146.83-131.84-69.32-131.85 69.34 25.2-146.82L0 165.45l147.4-21.42"/> - </svg> - </div> -</template> - -<script> -export default { - name: 'StarRates', - props: { - className: { - type: String, - default: 'star-rates', - required: false - }, - rate: { - type: Number, - default: 1, - required: false, - validator (value) { - return value >= 0 && value <= 5 - } - }, - width: { - type: Number, - default: 20, - required: false - }, - gutter: { - type: Number, - default: 5, - required: false - } - } -} -</script> diff --git a/src/components/StarRates/index.tsx b/src/components/StarRates/index.tsx new file mode 100644 index 000000000..c14e79665 --- /dev/null +++ b/src/components/StarRates/index.tsx @@ -0,0 +1,31 @@ +import React from 'react' + +export interface StarRatesProps { + className?: string + rate?: number + width?: number + gutter?: number +} + +export default class StarRates extends React.PureComponent<StarRatesProps> { + render () { + const className = this.props.className || 'widget-StarRates' + const rate = Number(this.props.rate) % 6 || 0 + const width = Number(this.props.width) || 20 + const gutter = Number(this.props.gutter) || 5 + + return ( + <div className={className}> + {Array.from(Array(5)).map((_, i) => ( + <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 426.67 426.67' + key={i} + width={width} + style={{ marginRight: i === 4 ? '' : gutter }} + > + <path fill={i < rate ? '#FAC917' : '#d1d8de'} d='M213.33 10.44l65.92 133.58 147.42 21.42L320 269.4l25.17 146.83-131.84-69.32-131.85 69.34 25.2-146.82L0 165.45l147.4-21.42' /> + </svg> + ))} + </div> + ) + } +}
refactor
refactor star rates
556862cc051896a46a450c0434ad807618aecbe1
2019-12-22 15:08:16
crimx
refactor(dicts): remove share button
false
diff --git a/src/components/dictionaries/cobuild/_style.shadow.scss b/src/components/dictionaries/cobuild/_style.shadow.scss index ce1b99205..73c75ba97 100644 --- a/src/components/dictionaries/cobuild/_style.shadow.scss +++ b/src/components/dictionaries/cobuild/_style.shadow.scss @@ -3353,3 +3353,8 @@ margin: 0 1px; } } + +.share-overlay, +.share-button { + display: none !important; +}
refactor
remove share button
0b51e6bb0026d363f728cde758e299219580c791
2020-08-06 20:51:39
crimx
fix(word-editor): correct container dimension
false
diff --git a/src/content/components/WordEditor/WordEditorPanel.scss b/src/content/components/WordEditor/WordEditorPanel.scss index 23e73df4b..3f9fabaf7 100644 --- a/src/content/components/WordEditor/WordEditorPanel.scss +++ b/src/content/components/WordEditor/WordEditorPanel.scss @@ -5,9 +5,8 @@ z-index: $global-zindex-dicteditor; top: 0; left: 0; - right: 0; - bottom: 0; - margin: auto; + width: 100vw; + height: 100vh; display: flex; align-items: center; text-align: initial;
fix
correct container dimension