Merge branch 'preview-features' into preview

This commit is contained in:
the1812 2022-05-09 23:17:44 +08:00
commit fda874ed3c
19 changed files with 2827 additions and 2882 deletions

View File

@ -12,7 +12,7 @@
"type": "tsc -p tsconfig.type-check.json --noEmit" "type": "tsc -p tsconfig.type-check.json --noEmit"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.9.6", "@babel/core": "7.17.9",
"@babel/plugin-proposal-class-properties": "^7.8.3", "@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/preset-env": "^7.9.6", "@babel/preset-env": "^7.9.6",
"@babel/preset-typescript": "^7.9.0", "@babel/preset-typescript": "^7.9.0",
@ -30,12 +30,12 @@
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-config-airbnb-base": "^14.1.0", "eslint-config-airbnb-base": "^14.1.0",
"eslint-plugin-import": "^2.20.1", "eslint-plugin-import": "^2.20.1",
"eslint-plugin-vue": "^7.1.0", "eslint-plugin-vue": "7.1.0",
"fast-sass-loader": "^2.0.0", "fast-sass-loader": "^2.0.0",
"html-webpack-plugin": "^5.0.0-alpha.7", "html-webpack-plugin": "^5.0.0-alpha.7",
"postcss": "^8.1.0", "postcss": "^8.1.0",
"postcss-loader": "^4.0.4", "postcss-loader": "^4.0.4",
"postcss-preset-env": "^6.7.0", "postcss-preset-env": "^7.5.0",
"sass": "^1.25.0", "sass": "^1.25.0",
"serve": "^13.0.2", "serve": "^13.0.2",
"style-loader": "^2.0.0", "style-loader": "^2.0.0",

View File

@ -1,6 +1,6 @@
import { createPopper, Instance as Popper } from '@popperjs/core'
import { VueModule, Executable } from '@/core/common-types' import { VueModule, Executable } from '@/core/common-types'
import { getComponentSettings, addComponentListener } from '@/core/settings' import { getComponentSettings, addComponentListener } from '@/core/settings'
import { createPopper, Instance as Popper } from '@popperjs/core'
export const CustomNavbarItems = 'customNavbar.items' export const CustomNavbarItems = 'customNavbar.items'
export const CustomNavbarRenderedItems = 'customNavbar.renderedItems' export const CustomNavbarRenderedItems = 'customNavbar.renderedItems'

View File

@ -82,6 +82,7 @@
</VPopup> </VPopup>
</template> </template>
<script lang="ts"> <script lang="ts">
import { SortableEvent } from 'sortablejs'
import { import {
VPopup, VPopup,
VIcon, VIcon,
@ -91,7 +92,6 @@ import {
import { addComponentListener } from '@/core/settings' import { addComponentListener } from '@/core/settings'
import { dqa } from '@/core/utils' import { dqa } from '@/core/utils'
import { SortableJSLibrary } from '@/core/runtime-library' import { SortableJSLibrary } from '@/core/runtime-library'
import { SortableEvent } from 'sortablejs'
import { getData } from '@/plugins/data' import { getData } from '@/plugins/data'
import { import {
CustomNavbarItem, CustomNavbarItem,

View File

@ -638,13 +638,13 @@ body:not(.simplify-comment) .panel-area .bb-comment {
} }
} }
[class*='color-'][class*='-03'] { [class*='color-'][class*='-03'] {
@include brightness(6 / 5); @include brightness(calc(6 / 5));
// > * { // > * {
// @include brightness(5 / 6); // @include brightness(5 / 6);
// } // }
} }
[class*='color-'][class*='-04'] { [class*='color-'][class*='-04'] {
@include brightness(4 / 3); @include brightness(calc(4 / 3));
// > * { // > * {
// @include brightness(3 / 4); // @include brightness(3 / 4);
// } // }

View File

@ -331,12 +331,12 @@ export default Vue.extend({
} }
} }
@function slides($index) { @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 { @for $index from 6 through 12 {
&-item:nth-child(#{$index}) { &-item:nth-child(#{$index}) {
@include item-slides-y(#{slides($index)}px); @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 { &-item {

View File

@ -1,3 +1,4 @@
import { DocSourceItem } from 'registry/lib/docs'
import { componentsMap } from '@/components/component' import { componentsMap } from '@/components/component'
import { installComponent } from '@/components/user-component' import { installComponent } from '@/components/user-component'
import { monkey } from '@/core/ajax' import { monkey } from '@/core/ajax'
@ -10,7 +11,6 @@ import { logError } from '@/core/utils/log'
import { getHook } from '@/plugins/hook' import { getHook } from '@/plugins/hook'
import { installPlugin, pluginsMap } from '@/plugins/plugin' import { installPlugin, pluginsMap } from '@/plugins/plugin'
import { UserStyle } from '@/plugins/style' import { UserStyle } from '@/plugins/style'
import { DocSourceItem } from 'registry/lib/docs'
export const runMigrate = async (v1Settings: any) => { export const runMigrate = async (v1Settings: any) => {
const toast = Toast.info('下载功能列表中', '导入 v1 设置') const toast = Toast.info('下载功能列表中', '导入 v1 设置')

View File

@ -1,5 +1,5 @@
import { PluginMetadata } from '@/plugins/plugin'
import { KeyBindingAction } from 'registry/lib/components/utils/keymap/bindings' import { KeyBindingAction } from 'registry/lib/components/utils/keymap/bindings'
import { PluginMetadata } from '@/plugins/plugin'
export const plugin: PluginMetadata = { export const plugin: PluginMetadata = {
name: 'keymap.actions.darkMode', name: 'keymap.actions.darkMode',

View File

@ -1,5 +1,5 @@
import { PluginMetadata } from '@/plugins/plugin'
import { KeyBindingAction } from 'registry/lib/components/utils/keymap/bindings' import { KeyBindingAction } from 'registry/lib/components/utils/keymap/bindings'
import { PluginMetadata } from '@/plugins/plugin'
export const plugin: PluginMetadata = { export const plugin: PluginMetadata = {
name: 'keymap.actions.empty', name: 'keymap.actions.empty',

View File

@ -1,6 +1,6 @@
import type { KeyBindingAction, KeyBindingActionContext } from 'registry/lib/components/utils/keymap/bindings'
import { Toast } from '@/core/toast' import { Toast } from '@/core/toast'
import type { PluginMetadata } from '@/plugins/plugin' 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 { getSpeedContext, SpeedContext } from '../../../../components/video/player/common/speed/context'
import { formatSpeedText } from '../../../../components/video/player/common/speed/utils' import { formatSpeedText } from '../../../../components/video/player/common/speed/utils'
import type { RememberSpeedComponent } from '../../../../components/video/player/remember-speed/component' import type { RememberSpeedComponent } from '../../../../components/video/player/remember-speed/component'

View File

@ -1,5 +1,5 @@
import { languageNameToCode } from '@/core/utils/i18n'
import marked from 'marked' import marked from 'marked'
import { languageNameToCode } from '@/core/utils/i18n'
import { ComponentMetadata } from './component' import { ComponentMetadata } from './component'
import { getSelectedLanguage } from './i18n/helpers' import { getSelectedLanguage } from './i18n/helpers'

View File

@ -59,6 +59,7 @@
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import Fuse from 'fuse.js'
import { import {
VIcon, VIcon,
VLoading, VLoading,
@ -67,7 +68,6 @@ import {
import { registerAndGetData } from '@/plugins/data' import { registerAndGetData } from '@/plugins/data'
import { select } from '@/core/spin-query' import { select } from '@/core/spin-query'
import { matchUrlPattern } from '@/core/utils' import { matchUrlPattern } from '@/core/utils'
import Fuse from 'fuse.js'
import ActionItem from './ActionItem.vue' import ActionItem from './ActionItem.vue'
import { import {
LaunchBarActionProviders, LaunchBarActionProviders,

View File

@ -1,5 +1,5 @@
import { PluginMetadata } from '@/plugins/plugin'
import { KeyBindingAction } from 'registry/lib/components/utils/keymap/bindings' import { KeyBindingAction } from 'registry/lib/components/utils/keymap/bindings'
import { PluginMetadata } from '@/plugins/plugin'
export const plugin: PluginMetadata = { export const plugin: PluginMetadata = {
name: 'launchBar.plugin', name: 'launchBar.plugin',

View File

@ -17,8 +17,8 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { getComponentSettings } from '@/core/settings'
import marked from 'marked' import marked from 'marked'
import { getComponentSettings } from '@/core/settings'
import SwitchBox from '@/ui/SwitchBox.vue' import SwitchBox from '@/ui/SwitchBox.vue'
import VIcon from '@/ui/icon/VIcon.vue' import VIcon from '@/ui/icon/VIcon.vue'
import { languageNameToCode } from '@/core/utils/i18n' import { languageNameToCode } from '@/core/utils/i18n'

View File

@ -181,9 +181,10 @@ export default {
this.selectedComponents = [] this.selectedComponents = []
this.componentDetailOpen = false this.componentDetailOpen = false
}, },
selectMultipleComponent({ name }: ComponentMetadata, listSelect = false) { selectMultipleComponent(component: ComponentMetadata, listSelect = false) {
if (this.selectedComponent && listSelect) { if (this.selectedComponent && listSelect) {
// handle shift + click // handle shift + click
const { name } = component
const { name: selectedComponentName } = this.selectedComponent as ComponentMetadata const { name: selectedComponentName } = this.selectedComponent as ComponentMetadata
const list = this.renderedComponents as ComponentMetadata[] const list = this.renderedComponents as ComponentMetadata[]
let startIdx = list.findIndex(c => c.name === selectedComponentName) let startIdx = list.findIndex(c => c.name === selectedComponentName)
@ -196,11 +197,11 @@ export default {
return return
} }
const selectedList = this.selectedComponents as ComponentMetadata[] const selectedList = this.selectedComponents as ComponentMetadata[]
const component = selectedList.find(c => c.name === name) const selectedComponent = selectedList.find(c => c.name === component.name)
if (component) { if (selectedComponent) {
selectedList.push(component) deleteValue(selectedList, c => c.name === selectedComponent.name)
} else { } else {
deleteValue(selectedList, c => c.name === component.name) selectedList.push(component)
} }
}, },
selectComponent(component: ComponentMetadata) { selectComponent(component: ComponentMetadata) {

View File

@ -58,6 +58,8 @@
</VPopup> </VPopup>
</template> </template>
<script lang="ts"> <script lang="ts">
import Fuse from 'fuse.js'
import { DocSourceItem } from 'registry/lib/docs'
import { monkey } from '@/core/ajax' import { monkey } from '@/core/ajax'
import { cdnRoots } from '@/core/cdn-types' import { cdnRoots } from '@/core/cdn-types'
import { meta } from '@/core/meta' import { meta } from '@/core/meta'
@ -71,8 +73,6 @@ import {
VLoading, VLoading,
VEmpty, VEmpty,
} from '@/ui' } from '@/ui'
import Fuse from 'fuse.js'
import { DocSourceItem } from 'registry/lib/docs'
import RegistryItem from './RegistryItem.vue' import RegistryItem from './RegistryItem.vue'
import { registryBranches } from './third-party' import { registryBranches } from './third-party'

View File

@ -45,6 +45,7 @@
</MiniToast> </MiniToast>
</template> </template>
<script lang="ts"> <script lang="ts">
import { DocSourceItem } from 'registry/lib/docs'
import { getDescriptionHTML } from '@/components/description' import { getDescriptionHTML } from '@/components/description'
import { cdnRoots } from '@/core/cdn-types' import { cdnRoots } from '@/core/cdn-types'
import { installFeature } from '@/core/install-feature' import { installFeature } from '@/core/install-feature'
@ -52,7 +53,6 @@ import { visibleInside } from '@/core/observer'
import { getGeneralSettings, settings } from '@/core/settings' import { getGeneralSettings, settings } from '@/core/settings'
import { logError } from '@/core/utils/log' import { logError } from '@/core/utils/log'
import { VIcon, VButton, MiniToast } from '@/ui' import { VIcon, VButton, MiniToast } from '@/ui'
import { DocSourceItem } from 'registry/lib/docs'
const getFeatureUrl = (item: DocSourceItem, branch: string) => { const getFeatureUrl = (item: DocSourceItem, branch: string) => {
const cdnRootFn = cdnRoots[getGeneralSettings().cdnRoot] const cdnRootFn = cdnRoots[getGeneralSettings().cdnRoot]

View File

@ -1,5 +1,5 @@
import { TestPattern, Executable } from '@/core/common-types'
import { VueConstructor } from 'vue' import { VueConstructor } from 'vue'
import { TestPattern, Executable } from '@/core/common-types'
/** /**
* (v1中称为附加功能), , * (v1中称为附加功能), ,

View File

@ -30,7 +30,7 @@
@mixin round-bar($height) { @mixin round-bar($height) {
box-sizing: border-box; box-sizing: border-box;
height: #{$height}px; height: #{$height}px;
border-radius: #{$height / 2}px; border-radius: #{$height * 0.5}px;
} }
@mixin no-scrollbar { @mixin no-scrollbar {
overflow: auto; overflow: auto;

5654
yarn.lock

File diff suppressed because it is too large Load Diff