Skip to content

Commit

Permalink
Merge branch 'preview-features' into preview
Browse files Browse the repository at this point in the history
  • Loading branch information
the1812 committed May 9, 2022
2 parents bec8dd1 + 25ee198 commit fda874e
Show file tree
Hide file tree
Showing 19 changed files with 2,888 additions and 2,943 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"type": "tsc -p tsconfig.type-check.json --noEmit"
},
"devDependencies": {
"@babel/core": "^7.9.6",
"@babel/core": "7.17.9",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/preset-env": "^7.9.6",
"@babel/preset-typescript": "^7.9.0",
Expand All @@ -30,12 +30,12 @@
"eslint": "^7.32.0",
"eslint-config-airbnb-base": "^14.1.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-vue": "^7.1.0",
"eslint-plugin-vue": "7.1.0",
"fast-sass-loader": "^2.0.0",
"html-webpack-plugin": "^5.0.0-alpha.7",
"postcss": "^8.1.0",
"postcss-loader": "^4.0.4",
"postcss-preset-env": "^6.7.0",
"postcss-preset-env": "^7.5.0",
"sass": "^1.25.0",
"serve": "^13.0.2",
"style-loader": "^2.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createPopper, Instance as Popper } from '@popperjs/core'
import { VueModule, Executable } from '@/core/common-types'
import { getComponentSettings, addComponentListener } from '@/core/settings'
import { createPopper, Instance as Popper } from '@popperjs/core'

export const CustomNavbarItems = 'customNavbar.items'
export const CustomNavbarRenderedItems = 'customNavbar.renderedItems'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
</VPopup>
</template>
<script lang="ts">
import { SortableEvent } from 'sortablejs'
import {
VPopup,
VIcon,
Expand All @@ -91,7 +92,6 @@ import {
import { addComponentListener } from '@/core/settings'
import { dqa } from '@/core/utils'
import { SortableJSLibrary } from '@/core/runtime-library'
import { SortableEvent } from 'sortablejs'
import { getData } from '@/plugins/data'
import {
CustomNavbarItem,
Expand Down
4 changes: 2 additions & 2 deletions registry/lib/components/style/dark-mode/dark-slice-14.scss
Original file line number Diff line number Diff line change
Expand Up @@ -638,13 +638,13 @@ body:not(.simplify-comment) .panel-area .bb-comment {
}
}
[class*='color-'][class*='-03'] {
@include brightness(6 / 5);
@include brightness(calc(6 / 5));
// > * {
// @include brightness(5 / 6);
// }
}
[class*='color-'][class*='-04'] {
@include brightness(4 / 3);
@include brightness(calc(4 / 3));
// > * {
// @include brightness(3 / 4);
// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,12 @@ export default Vue.extend({
}
}
@function slides($index) {
@return -10 * $index * $index / 9 + 40 * $index / 3 + 24
@return calc(-10 * $index * $index / 9 + 40 * $index / 3 + 24)
}
@for $index from 6 through 12 {
&-item:nth-child(#{$index}) {
@include item-slides-y(#{slides($index)}px);
animation-delay: #{(1 - (slides($index) - 24) / 40) * 0.2}s;
animation-delay: #{calc((1 - (slides($index) - 24) / 40) * 0.2)}s;
}
}
&-item {
Expand Down
2 changes: 1 addition & 1 deletion registry/lib/components/utils/v1-migrate/migrate.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { DocSourceItem } from 'registry/lib/docs'
import { componentsMap } from '@/components/component'
import { installComponent } from '@/components/user-component'
import { monkey } from '@/core/ajax'
Expand All @@ -10,7 +11,6 @@ import { logError } from '@/core/utils/log'
import { getHook } from '@/plugins/hook'
import { installPlugin, pluginsMap } from '@/plugins/plugin'
import { UserStyle } from '@/plugins/style'
import { DocSourceItem } from 'registry/lib/docs'

export const runMigrate = async (v1Settings: any) => {
const toast = Toast.info('下载功能列表中', '导入 v1 设置')
Expand Down
2 changes: 1 addition & 1 deletion registry/lib/plugins/utils/keymap-dark-mode/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PluginMetadata } from '@/plugins/plugin'
import { KeyBindingAction } from 'registry/lib/components/utils/keymap/bindings'
import { PluginMetadata } from '@/plugins/plugin'

export const plugin: PluginMetadata = {
name: 'keymap.actions.darkMode',
Expand Down
2 changes: 1 addition & 1 deletion registry/lib/plugins/utils/keymap-empty-action.ts/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PluginMetadata } from '@/plugins/plugin'
import { KeyBindingAction } from 'registry/lib/components/utils/keymap/bindings'
import { PluginMetadata } from '@/plugins/plugin'

export const plugin: PluginMetadata = {
name: 'keymap.actions.empty',
Expand Down
2 changes: 1 addition & 1 deletion registry/lib/plugins/video/player/speed/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { KeyBindingAction, KeyBindingActionContext } from 'registry/lib/components/utils/keymap/bindings'
import { Toast } from '@/core/toast'
import type { PluginMetadata } from '@/plugins/plugin'
import type { KeyBindingAction, KeyBindingActionContext } from 'registry/lib/components/utils/keymap/bindings'
import { getSpeedContext, SpeedContext } from '../../../../components/video/player/common/speed/context'
import { formatSpeedText } from '../../../../components/video/player/common/speed/utils'
import type { RememberSpeedComponent } from '../../../../components/video/player/remember-speed/component'
Expand Down
2 changes: 1 addition & 1 deletion src/components/description.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { languageNameToCode } from '@/core/utils/i18n'
import marked from 'marked'
import { languageNameToCode } from '@/core/utils/i18n'
import { ComponentMetadata } from './component'
import { getSelectedLanguage } from './i18n/helpers'

Expand Down
2 changes: 1 addition & 1 deletion src/components/launch-bar/LaunchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
</div>
</template>
<script lang="ts">
import Fuse from 'fuse.js'
import {
VIcon,
VLoading,
Expand All @@ -67,7 +68,6 @@ import {
import { registerAndGetData } from '@/plugins/data'
import { select } from '@/core/spin-query'
import { matchUrlPattern } from '@/core/utils'
import Fuse from 'fuse.js'
import ActionItem from './ActionItem.vue'
import {
LaunchBarActionProviders,
Expand Down
2 changes: 1 addition & 1 deletion src/components/launch-bar/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PluginMetadata } from '@/plugins/plugin'
import { KeyBindingAction } from 'registry/lib/components/utils/keymap/bindings'
import { PluginMetadata } from '@/plugins/plugin'

export const plugin: PluginMetadata = {
name: 'launchBar.plugin',
Expand Down
2 changes: 1 addition & 1 deletion src/components/settings-panel/ComponentSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
</template>

<script lang="ts">
import { getComponentSettings } from '@/core/settings'
import marked from 'marked'
import { getComponentSettings } from '@/core/settings'
import SwitchBox from '@/ui/SwitchBox.vue'
import VIcon from '@/ui/icon/VIcon.vue'
import { languageNameToCode } from '@/core/utils/i18n'
Expand Down
11 changes: 6 additions & 5 deletions src/components/settings-panel/SettingsPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,10 @@ export default {
this.selectedComponents = []
this.componentDetailOpen = false
},
selectMultipleComponent({ name }: ComponentMetadata, listSelect = false) {
selectMultipleComponent(component: ComponentMetadata, listSelect = false) {
if (this.selectedComponent && listSelect) {
// handle shift + click
const { name } = component
const { name: selectedComponentName } = this.selectedComponent as ComponentMetadata
const list = this.renderedComponents as ComponentMetadata[]
let startIdx = list.findIndex(c => c.name === selectedComponentName)
Expand All @@ -196,11 +197,11 @@ export default {
return
}
const selectedList = this.selectedComponents as ComponentMetadata[]
const component = selectedList.find(c => c.name === name)
if (component) {
selectedList.push(component)
const selectedComponent = selectedList.find(c => c.name === component.name)
if (selectedComponent) {
deleteValue(selectedList, c => c.name === selectedComponent.name)
} else {
deleteValue(selectedList, c => c.name === component.name)
selectedList.push(component)
}
},
selectComponent(component: ComponentMetadata) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
</VPopup>
</template>
<script lang="ts">
import Fuse from 'fuse.js'
import { DocSourceItem } from 'registry/lib/docs'
import { monkey } from '@/core/ajax'
import { cdnRoots } from '@/core/cdn-types'
import { meta } from '@/core/meta'
Expand All @@ -71,8 +73,6 @@ import {
VLoading,
VEmpty,
} from '@/ui'
import Fuse from 'fuse.js'
import { DocSourceItem } from 'registry/lib/docs'
import RegistryItem from './RegistryItem.vue'
import { registryBranches } from './third-party'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@
</MiniToast>
</template>
<script lang="ts">
import { DocSourceItem } from 'registry/lib/docs'
import { getDescriptionHTML } from '@/components/description'
import { cdnRoots } from '@/core/cdn-types'
import { installFeature } from '@/core/install-feature'
import { visibleInside } from '@/core/observer'
import { getGeneralSettings, settings } from '@/core/settings'
import { logError } from '@/core/utils/log'
import { VIcon, VButton, MiniToast } from '@/ui'
import { DocSourceItem } from 'registry/lib/docs'
const getFeatureUrl = (item: DocSourceItem, branch: string) => {
const cdnRootFn = cdnRoots[getGeneralSettings().cdnRoot]
Expand Down
2 changes: 1 addition & 1 deletion src/components/widget.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TestPattern, Executable } from '@/core/common-types'
import { VueConstructor } from 'vue'
import { TestPattern, Executable } from '@/core/common-types'

/**
* 小组件(v1中称为附加功能), 可在组件中定义, 也可以由插件注入
Expand Down
2 changes: 1 addition & 1 deletion src/ui/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
@mixin round-bar($height) {
box-sizing: border-box;
height: #{$height}px;
border-radius: #{$height / 2}px;
border-radius: #{$height * 0.5}px;
}
@mixin no-scrollbar {
overflow: auto;
Expand Down
Loading

0 comments on commit fda874e

Please sign in to comment.