2024-05-28 17:24:06 +03:00
|
|
|
/**
|
|
|
|
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
* SPDX-License-Identifier: CC0-1.0
|
|
|
|
*/
|
|
|
|
|
2019-10-01 13:17:54 +03:00
|
|
|
const path = require('path')
|
|
|
|
const { merge } = require('webpack-merge')
|
2022-08-09 15:53:48 +03:00
|
|
|
const webpackConfig = require('./webpack.config.js')
|
2019-06-16 13:13:17 +03:00
|
|
|
|
2022-09-22 01:30:49 +03:00
|
|
|
module.exports = async () => {
|
|
|
|
const base = await webpackConfig()
|
|
|
|
const newConfig = Object.assign({}, base, {
|
2023-01-08 23:43:28 +03:00
|
|
|
// Necessary, because vue-styleguidist runs an old version of webpack-dev-server
|
|
|
|
devServer: {
|
|
|
|
historyApiFallback: true,
|
|
|
|
noInfo: true,
|
|
|
|
overlay: true,
|
|
|
|
},
|
2022-09-22 01:30:49 +03:00
|
|
|
externals: {},
|
|
|
|
module: {
|
|
|
|
// Ignore eslint
|
|
|
|
rules: base.module.rules.filter(
|
2023-07-12 17:04:55 +03:00
|
|
|
rule => rule.use !== 'eslint-loader',
|
2022-09-22 01:30:49 +03:00
|
|
|
),
|
|
|
|
},
|
|
|
|
})
|
2020-11-18 10:52:18 +03:00
|
|
|
|
2022-09-22 01:30:49 +03:00
|
|
|
return {
|
|
|
|
require: [
|
|
|
|
path.join(__dirname, 'styleguide/global.requires.js'),
|
|
|
|
path.join(__dirname, 'styleguide/assets/icons.css'),
|
|
|
|
path.join(__dirname, 'styleguide/assets/additional.css'),
|
2024-07-15 23:30:17 +03:00
|
|
|
path.join(__dirname, 'styleguide/assets/styleguide.css'),
|
2022-09-22 01:30:49 +03:00
|
|
|
],
|
|
|
|
pagePerSection: true,
|
|
|
|
minimize: true,
|
|
|
|
verbose: false,
|
2020-11-18 10:52:18 +03:00
|
|
|
|
2022-09-22 01:30:49 +03:00
|
|
|
webpackConfig: merge(newConfig, {
|
|
|
|
// https://webpack.js.org/configuration/dev-server/#devserverproxy
|
|
|
|
devServer: {
|
|
|
|
proxy: {
|
|
|
|
// redirect to the guest avatar endpoint
|
|
|
|
'/index.php/avatar': {
|
2023-05-10 13:24:50 +03:00
|
|
|
target: 'https://raw.githubusercontent.com/nextcloud/promo/master/nextcloud-icon.png',
|
2022-09-22 01:30:49 +03:00
|
|
|
changeOrigin: true,
|
|
|
|
ignorePath: true,
|
|
|
|
secure: false,
|
|
|
|
},
|
2021-03-09 20:39:01 +03:00
|
|
|
},
|
|
|
|
},
|
2023-07-12 17:04:55 +03:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
2024-03-01 22:46:58 +03:00
|
|
|
vue$: 'vue/dist/vue.js',
|
2023-07-12 17:04:55 +03:00
|
|
|
},
|
|
|
|
},
|
2022-09-22 01:30:49 +03:00
|
|
|
}),
|
2020-11-18 10:52:18 +03:00
|
|
|
|
2023-05-24 15:51:04 +03:00
|
|
|
exampleMode: 'collapse',
|
|
|
|
usageMode: 'collapse',
|
2020-11-18 10:52:18 +03:00
|
|
|
|
2022-09-22 01:30:49 +03:00
|
|
|
components: 'src/components/*/*.vue',
|
|
|
|
getComponentPathLine(componentPath) {
|
|
|
|
const name = path.basename(componentPath, '.vue')
|
2023-08-02 01:39:56 +03:00
|
|
|
return `import ${name} from '@nextcloud/vue/dist/Components/${name}.js'`
|
2019-08-02 16:35:37 +03:00
|
|
|
},
|
2020-11-18 10:52:18 +03:00
|
|
|
|
2024-08-22 01:14:43 +03:00
|
|
|
compilerConfig: {
|
|
|
|
transforms: { asyncAwait: false },
|
|
|
|
},
|
|
|
|
|
2022-09-22 01:30:49 +03:00
|
|
|
sections: [
|
|
|
|
{
|
|
|
|
name: 'Introduction',
|
|
|
|
content: 'docs/index.md',
|
|
|
|
exampleMode: 'hide',
|
|
|
|
usageMode: 'hide',
|
|
|
|
},
|
2023-06-26 17:30:26 +03:00
|
|
|
{
|
2024-08-06 13:38:35 +03:00
|
|
|
name: 'Versions',
|
2023-06-26 17:30:26 +03:00
|
|
|
sections: [
|
2023-09-08 11:07:22 +03:00
|
|
|
{
|
2024-08-06 13:38:35 +03:00
|
|
|
name: 'next v9.x (Nextcloud 28+ on Vue 3)',
|
2023-09-08 11:07:22 +03:00
|
|
|
href: 'https://next--nextcloud-vue-components.netlify.app',
|
|
|
|
},
|
2024-08-06 13:38:35 +03:00
|
|
|
{
|
|
|
|
name: 'current v8.x (Nextcloud 28+)',
|
|
|
|
href: 'https://nextcloud-vue-components.netlify.app',
|
|
|
|
},
|
2023-06-26 17:30:26 +03:00
|
|
|
{
|
|
|
|
name: 'v7.x (Nextcloud 25 - 27)',
|
|
|
|
href: 'https://stable7--nextcloud-vue-components.netlify.app',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'v6.x (Nextcloud 24 - 25)',
|
|
|
|
href: 'https://stable6--nextcloud-vue-components.netlify.app',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2022-09-22 01:30:49 +03:00
|
|
|
{
|
|
|
|
name: 'Directives',
|
|
|
|
content: 'docs/directives.md',
|
2024-06-04 18:21:45 +03:00
|
|
|
sectionDepth: 1,
|
|
|
|
sections: [
|
|
|
|
{
|
|
|
|
name: 'Focus',
|
|
|
|
content: 'docs/directives/focus.md',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Linkify',
|
|
|
|
content: 'docs/directives/linkify.md',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Tooltip',
|
|
|
|
content: 'docs/directives/tooltip.md',
|
|
|
|
},
|
|
|
|
],
|
2022-09-22 01:30:49 +03:00
|
|
|
},
|
2024-06-04 22:04:59 +03:00
|
|
|
{
|
|
|
|
name: 'Functions',
|
|
|
|
content: 'docs/functions.md',
|
|
|
|
sectionDepth: 1,
|
|
|
|
sections: [
|
|
|
|
{
|
|
|
|
name: 'a11y',
|
|
|
|
content: 'docs/functions/a11y.md',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'emoji',
|
|
|
|
content: 'docs/functions/emoji.md',
|
|
|
|
},
|
2024-06-13 10:22:35 +03:00
|
|
|
{
|
|
|
|
name: 'isDarkTheme',
|
|
|
|
content: 'docs/functions/isDarkTheme.md',
|
|
|
|
},
|
2024-06-04 22:04:59 +03:00
|
|
|
{
|
|
|
|
name: 'usernameToColor',
|
|
|
|
content: 'docs/functions/usernameToColor.md',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'reference',
|
|
|
|
content: 'docs/functions/reference.md',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'registerReference',
|
|
|
|
content: 'docs/functions/registerReference.md',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2024-08-19 18:33:27 +03:00
|
|
|
{
|
|
|
|
name: 'Composables',
|
|
|
|
content: 'docs/composables.md',
|
|
|
|
sectionDepth: 1,
|
|
|
|
sections: [
|
2024-08-19 19:25:22 +03:00
|
|
|
{
|
|
|
|
name: 'useHotKey',
|
|
|
|
content: 'docs/composables/useHotKey.md',
|
2024-06-13 10:25:05 +03:00
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'useIsDarkTheme',
|
|
|
|
content: 'docs/composables/useIsDarkTheme.md',
|
2024-08-19 19:25:22 +03:00
|
|
|
},
|
2024-08-19 18:33:27 +03:00
|
|
|
],
|
|
|
|
},
|
2022-09-22 01:30:49 +03:00
|
|
|
{
|
|
|
|
name: 'Components',
|
|
|
|
content: 'docs/components.md',
|
|
|
|
components: 'src/components/*/*.vue',
|
|
|
|
sectionDepth: 1,
|
|
|
|
ignore: [
|
2022-11-19 02:49:40 +03:00
|
|
|
'src/components/Nc*Field/*.vue',
|
2023-02-19 15:41:36 +03:00
|
|
|
'src/components/Nc*Picker*/*.vue',
|
2022-09-22 01:30:49 +03:00
|
|
|
'src/components/NcAction*/*.vue',
|
|
|
|
'src/components/NcAppContent*/*.vue',
|
|
|
|
'src/components/NcAppNavigation*/*.vue',
|
2022-11-19 02:49:40 +03:00
|
|
|
'src/components/NcAppSettings*/*.vue',
|
2022-09-22 01:30:49 +03:00
|
|
|
'src/components/NcAppSidebar*/*.vue',
|
|
|
|
'src/components/NcBreadcrumb*/*.vue',
|
2023-10-23 22:24:40 +03:00
|
|
|
'src/components/NcCheckboxRadioSwitch/NcCheckboxContent.vue',
|
2024-07-02 12:05:58 +03:00
|
|
|
'src/components/NcCollectionList/!(NcCollectionList).vue',
|
2022-09-22 01:30:49 +03:00
|
|
|
'src/components/NcContent/*.vue',
|
|
|
|
'src/components/NcDashboard*/*.vue',
|
2023-09-20 18:33:58 +03:00
|
|
|
'src/components/NcDialog*/*.vue',
|
2024-09-03 16:44:08 +03:00
|
|
|
'src/components/NcHeader*/*.vue',
|
2022-11-19 02:49:40 +03:00
|
|
|
'src/components/NcListItem*/*.vue',
|
2022-09-22 01:30:49 +03:00
|
|
|
'src/components/NcMultiselect*/*.vue',
|
|
|
|
'src/components/NcRichContenteditable/!(NcRichContenteditable).vue',
|
2023-03-01 15:16:28 +03:00
|
|
|
'src/components/NcRichText*/*.vue',
|
2022-11-19 02:49:40 +03:00
|
|
|
'src/components/NcSelect*/*.vue',
|
2022-09-22 01:30:49 +03:00
|
|
|
'src/components/NcSettings*/*.vue',
|
|
|
|
'src/components/NcUserBubble/NcUserBubbleDiv.vue',
|
2023-09-18 12:55:29 +03:00
|
|
|
'src/components/NcTextArea/*.vue',
|
2024-01-18 00:04:44 +03:00
|
|
|
'src/components/NcPopover/NcPopoverTriggerProvider.vue',
|
2022-09-22 01:30:49 +03:00
|
|
|
],
|
|
|
|
sections: [
|
|
|
|
{
|
|
|
|
name: 'NcActions',
|
|
|
|
components: [
|
|
|
|
// Put Actions component first
|
|
|
|
'src/components/NcActions/*.vue',
|
|
|
|
'src/components/NcAction[A-Z]*/*.vue',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'App containers',
|
|
|
|
components: [
|
|
|
|
'src/components/NcContent/*.vue',
|
|
|
|
],
|
|
|
|
sections: [
|
|
|
|
{
|
|
|
|
name: 'NcAppNavigation',
|
|
|
|
components: [
|
|
|
|
'src/components/NcAppNavigation*/*.vue',
|
|
|
|
],
|
2023-11-29 17:06:16 +03:00
|
|
|
ignore: [
|
|
|
|
'src/components/NcAppNavigationItem/NcAppNavigationIconCollapsible.vue',
|
|
|
|
'src/components/NcAppNavigationItem/NcInputConfirmCancel.vue',
|
|
|
|
],
|
2022-09-22 01:30:49 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'NcAppContent',
|
|
|
|
components: [
|
|
|
|
'src/components/NcAppContent*/*.vue',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'NcAppSidebar',
|
|
|
|
components: [
|
|
|
|
'src/components/NcAppSidebar*/*.vue',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'NcAppSettings',
|
|
|
|
components: [
|
|
|
|
'src/components/NcAppSettings*/*.vue',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'NcBreadcrumbs',
|
|
|
|
components: [
|
|
|
|
'src/components/NcBreadcrumb*/*.vue',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'NcDashboard',
|
|
|
|
components: [
|
|
|
|
'src/components/NcDashboard*/*.vue',
|
|
|
|
],
|
|
|
|
},
|
2023-09-20 18:33:58 +03:00
|
|
|
{
|
|
|
|
name: 'NcDialog',
|
|
|
|
components: [
|
|
|
|
'src/components/NcDialog*/*.vue',
|
|
|
|
],
|
|
|
|
},
|
2022-11-16 11:26:53 +03:00
|
|
|
{
|
|
|
|
name: 'NcFields',
|
|
|
|
components: [
|
|
|
|
'src/components/Nc*Field/*.vue',
|
2023-09-18 12:55:29 +03:00
|
|
|
'src/components/NcTextArea/*.vue',
|
2022-11-16 11:26:53 +03:00
|
|
|
],
|
|
|
|
},
|
2024-09-03 16:44:08 +03:00
|
|
|
{
|
|
|
|
name: 'NcHeader',
|
|
|
|
components: [
|
|
|
|
'src/components/NcHeader*/*.vue',
|
|
|
|
],
|
|
|
|
},
|
2022-09-22 01:30:49 +03:00
|
|
|
{
|
|
|
|
name: 'NcListItems',
|
|
|
|
components: [
|
|
|
|
'src/components/NcListItem*/*.vue',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2022-11-19 02:49:40 +03:00
|
|
|
name: 'NcSelect',
|
|
|
|
components: [
|
|
|
|
'src/components/NcSelect*/*.vue',
|
|
|
|
],
|
|
|
|
},
|
2022-09-22 01:30:49 +03:00
|
|
|
{
|
|
|
|
name: 'NcPickers',
|
|
|
|
components: [
|
2023-02-19 15:41:36 +03:00
|
|
|
'src/components/Nc*Picker*/*.vue',
|
2022-09-22 01:30:49 +03:00
|
|
|
],
|
|
|
|
},
|
2023-03-01 15:16:28 +03:00
|
|
|
{
|
|
|
|
name: 'NcRichText',
|
|
|
|
components: [
|
|
|
|
'src/components/NcRichText/NcRichText.vue',
|
|
|
|
],
|
|
|
|
},
|
2022-09-22 01:30:49 +03:00
|
|
|
{
|
|
|
|
name: 'NcSettings',
|
|
|
|
components: [
|
|
|
|
'src/components/NcSettings*/*.vue',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
2020-11-18 10:52:18 +03:00
|
|
|
|
2022-09-22 01:30:49 +03:00
|
|
|
ribbon: {
|
|
|
|
text: 'Fork me on GitHub',
|
2023-07-28 19:29:53 +03:00
|
|
|
url: 'https://github.com/nextcloud-libraries/nextcloud-vue',
|
2019-08-02 16:35:37 +03:00
|
|
|
},
|
2022-09-22 01:30:49 +03:00
|
|
|
|
|
|
|
// see https://github.com/styleguidist/react-styleguidist/blob/master/src/client/styles/theme.js
|
|
|
|
theme: {
|
|
|
|
maxWidth: '900px',
|
|
|
|
sidebarWidth: 280,
|
|
|
|
spaceFactor: 20,
|
|
|
|
color: {
|
|
|
|
link: '#0082c9',
|
|
|
|
linkHover: '#0082c9',
|
|
|
|
sidebarBackground: '#ffffff',
|
|
|
|
errorBackground: '#e22d44',
|
|
|
|
ribbonBackground: '#0082c9',
|
|
|
|
},
|
|
|
|
fontFamily: {
|
|
|
|
base: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
|
|
|
|
},
|
2020-03-29 16:04:35 +03:00
|
|
|
},
|
2022-09-22 01:30:49 +03:00
|
|
|
}
|
2020-03-29 16:04:35 +03:00
|
|
|
}
|