feat: 插件增加styled作为css解决方案

pull/56/head
moonrailgun 2 years ago
parent cbaa872a29
commit 21f6442634

@ -9,6 +9,8 @@
},
"dependencies": {},
"devDependencies": {
"react": "18.2.0"
"@types/styled-components": "^5.1.26",
"react": "18.2.0",
"styled-components": "^5.3.6"
}
}

@ -1,7 +1,7 @@
const path = require('path');
module.exports = {
externalDeps: ['react'],
externalDeps: ['react', 'styled-components'],
pluginRoot: path.resolve(__dirname, './web'),
outDir: path.resolve(__dirname, '../../public'),
};

@ -9,6 +9,8 @@
},
"dependencies": {},
"devDependencies": {
"react": "18.2.0"
"@types/styled-components": "^5.1.26",
"react": "18.2.0",
"styled-components": "^5.3.6"
}
}

@ -1,7 +1,7 @@
const path = require('path');
module.exports = {
externalDeps: ['react'],
externalDeps: ['react', 'styled-components'],
pluginRoot: path.resolve(__dirname, './web'),
outDir: path.resolve(__dirname, '../../public'),
};

@ -9,6 +9,8 @@
},
"dependencies": {},
"devDependencies": {
"react": "18.2.0"
"@types/styled-components": "^5.1.26",
"react": "18.2.0",
"styled-components": "^5.3.6"
}
}

@ -46,6 +46,7 @@
"react-dom": "18.2.0",
"react-easy-crop": "^3.5.2",
"react-helmet": "^6.1.0",
"react-is": "^18.2.0",
"react-markdown": "6",
"react-mentions": "^4.3.1",
"react-router": "^6.4.0",
@ -57,6 +58,7 @@
"react-virtuoso": "^2.18.0",
"socket.io-client": "^4.1.2",
"source-ref-runtime": "^1.0.7",
"styled-components": "^5.3.6",
"tailchat-design": "workspace:^1.0.0",
"tailchat-shared": "*",
"tailwindcss": "^2.2.4",
@ -88,6 +90,7 @@
"@types/react-transition-group": "^4.4.2",
"@types/react-virtualized": "^9.21.14",
"@types/react-virtualized-auto-sizer": "^1.0.1",
"@types/styled-components": "^5.1.26",
"@types/webpack": "^5.28.0",
"@types/webpack-bundle-analyzer": "^4.4.1",
"@types/webpack-dev-server": "^4.3.1",

@ -42,6 +42,7 @@ export {
openConfirmModal,
openReconfirmModal,
} from '@/components/Modal';
export { Loadable } from '@/components/Loadable';
export { Loading } from '@/components/Loading';
export { SidebarView } from '@/components/SidebarView';
export { GroupPanelSelector } from '@/components/GroupPanelSelector';

@ -15,6 +15,7 @@ function registerDependencies() {
regDependency('react', () => import('react'));
regDependency('react-router', () => import('react-router'));
regDependency('axios', () => import('axios')); // 用于插件的第三方包使用axios作为依赖的情况下可以减少包体积
regDependency('styled-components', () => import('styled-components')); // 仅用于第三方插件. tailchat本身更多使用 tailwindcss
}
function registerModules() {

@ -16,6 +16,7 @@ declare module '@capital/common' {
/**
*
* @deprecated @capital/component
*/
export const openModal: (
content: React.ReactNode,
@ -39,16 +40,34 @@ declare module '@capital/common' {
}
) => number;
/**
* @deprecated @capital/component
*/
export const closeModal: any;
/**
* @deprecated @capital/component
*/
export const ModalWrapper: any;
/**
* @deprecated @capital/component
*/
export const useModalContext: any;
/**
* @deprecated @capital/component
*/
export const openConfirmModal: any;
/**
* @deprecated @capital/component
*/
export const openReconfirmModal: any;
/**
* @deprecated @capital/component
*/
export const Loadable: any;
export const getGlobalState: any;
@ -218,6 +237,14 @@ declare module '@capital/common' {
required?: string[];
}) => void;
export const pluginGroupPanelBadges: any;
export const regGroupPanelBadge: any;
export const pluginGroupTextPanelExtraMenus: any;
export const regPluginGroupTextPanelExtraMenu: any;
export const useGroupIdContext: () => string;
export const useGroupPanelContext: () => {
@ -305,7 +332,27 @@ declare module '@capital/component' {
export const DefaultFullModalTextAreaEditorRender: any;
export const openModal: any;
export const openModal: (
content: React.ReactNode,
props?: {
/**
*
* @default false
*/
closable?: boolean;
/**
*
*/
maskClosable?: boolean;
/**
* modal
*/
onCloseModal?: () => void;
}
) => number;
export const closeModal: any;
@ -317,6 +364,8 @@ declare module '@capital/component' {
export const openReconfirmModal: any;
export const Loadable: any;
export const Loading: any;
export const SidebarView: any;

@ -289,6 +289,7 @@ importers:
'@types/react-transition-group': ^4.4.2
'@types/react-virtualized': ^9.21.14
'@types/react-virtualized-auto-sizer': ^1.0.1
'@types/styled-components': ^5.1.26
'@types/webpack': ^5.28.0
'@types/webpack-bundle-analyzer': ^4.4.1
'@types/webpack-dev-server': ^4.3.1
@ -334,6 +335,7 @@ importers:
react-dom: 18.2.0
react-easy-crop: ^3.5.2
react-helmet: ^6.1.0
react-is: ^18.2.0
react-markdown: '6'
react-mentions: ^4.3.1
react-router: ^6.4.0
@ -351,6 +353,7 @@ importers:
source-ref-loader: ^1.0.7
source-ref-runtime: ^1.0.7
style-loader: ^3.0.0
styled-components: ^5.3.6
tailchat-design: workspace:^1.0.0
tailchat-plugin-declaration-generator: workspace:^1.0.0
tailchat-shared: '*'
@ -394,6 +397,7 @@ importers:
react-dom: 18.2.0_react@18.2.0
react-easy-crop: 3.5.3_biqbaboplfbrettd7655fr4n2y
react-helmet: 6.1.0_react@18.2.0
react-is: 18.2.0
react-markdown: 6.0.3_w5j4k42lgipnm43s3brx6h3c34
react-mentions: 4.4.7_biqbaboplfbrettd7655fr4n2y
react-router: 6.4.0_react@18.2.0
@ -405,6 +409,7 @@ importers:
react-virtuoso: 2.18.0_biqbaboplfbrettd7655fr4n2y
socket.io-client: 4.5.1
source-ref-runtime: 1.0.7
styled-components: 5.3.6_7i5myeigehqah43i5u7wbekgba
tailchat-design: link:../packages/design
tailchat-shared: link:../shared
tailwindcss: 2.2.19_ywsstkkounrjlah5ti55snp2aq
@ -435,6 +440,7 @@ importers:
'@types/react-transition-group': 4.4.5
'@types/react-virtualized': 9.21.21
'@types/react-virtualized-auto-sizer': 1.0.1
'@types/styled-components': 5.1.26
'@types/webpack': 5.28.0_webpack-cli@4.10.0
'@types/webpack-bundle-analyzer': 4.4.2_webpack-cli@4.10.0
'@types/webpack-dev-server': 4.7.2_77l47gmqkrqiei5z7sbwz5iaj4
@ -878,9 +884,13 @@ importers:
server/plugins/com.msgbyte.topic/web/plugins/com.msgbyte.topic:
specifiers:
'@types/styled-components': ^5.1.26
react: 18.2.0
styled-components: ^5.3.6
devDependencies:
'@types/styled-components': 5.1.26
react: 18.2.0
styled-components: 5.3.6_react@18.2.0
website:
specifiers:
@ -1046,7 +1056,7 @@ packages:
engines: {node: '>=6.0.0'}
dependencies:
'@jridgewell/gen-mapping': 0.1.1
'@jridgewell/trace-mapping': 0.3.9
'@jridgewell/trace-mapping': 0.3.15
/@ant-design/colors/6.0.0:
resolution: {integrity: sha512-qAZRvPzfdWHtfameEGP2Qvuf838NhergR35o+EuVyB5XvSA98xod5r4utvi4TJ3ywmevm290g9nsCG5MryrdWQ==}
@ -2490,6 +2500,23 @@ packages:
transitivePeerDependencies:
- supports-color
/@babel/traverse/7.18.13_supports-color@5.5.0:
resolution: {integrity: sha512-N6kt9X1jRMLPxxxPYWi7tgvJRH/rtoU+dbKAPDM44RFHiMH8igdsaSBgFeskhSl/kLWLDUvIh1RXCrTmg0/zvA==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/code-frame': 7.18.6
'@babel/generator': 7.18.13
'@babel/helper-environment-visitor': 7.18.9
'@babel/helper-function-name': 7.18.9
'@babel/helper-hoist-variables': 7.18.6
'@babel/helper-split-export-declaration': 7.18.6
'@babel/parser': 7.18.13
'@babel/types': 7.18.13
debug: 4.3.4_supports-color@5.5.0
globals: 11.12.0
transitivePeerDependencies:
- supports-color
/@babel/types/7.18.13:
resolution: {integrity: sha512-ePqfTihzW0W6XAU+aMw2ykilisStJfDnsejDCXRchCcMJ4O0+8DhPXf2YUbZ6wjBlsEmZwLK/sPweWtu8hcJYQ==}
engines: {node: '>=6.9.0'}
@ -3595,11 +3622,9 @@ packages:
resolution: {integrity: sha512-3aDpDprjM0AwaxGE09bOPkNxHpBd+kA6jty3RnaEXdweX1DF1U3VQpPYb0g1IStAuK7SVQ1cy+bNBBKp4W3Fjg==}
dependencies:
'@emotion/memoize': 0.8.0
dev: false
/@emotion/memoize/0.8.0:
resolution: {integrity: sha512-G/YwXTkv7Den9mXDO7AhLWkE3q+I92B+VqAE+dYG4NGPaHZGvt3G8Q0p9vmE+sq7rTGphUbAvmQ9YpbfMQGGlA==}
dev: false
/@emotion/react/11.10.4_dyfrgrdbkbkiiub2mj647rnune:
resolution: {integrity: sha512-j0AkMpr6BL8gldJZ6XQsQ8DnS9TxEQu1R+OGmDZiWjBAJtCcbt0tS3I/YffoqHXxH6MjgI7KdMbYKw3MEiU9eA==}
@ -3665,6 +3690,12 @@ packages:
react: 18.2.0
dev: false
/@emotion/stylis/0.8.5:
resolution: {integrity: sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==}
/@emotion/unitless/0.7.5:
resolution: {integrity: sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==}
/@emotion/unitless/0.8.0:
resolution: {integrity: sha512-VINS5vEYAscRl2ZUDiT3uMPlrFQupiKgHz5AA4bCH1miKBg4qtwkim1qPmJj/4WG6TreYMY111rEFsjupcOKHw==}
dev: false
@ -8050,7 +8081,6 @@ packages:
dependencies:
'@types/react': 18.0.20
hoist-non-react-statics: 3.3.2
dev: false
/@types/html-minifier-terser/5.1.2:
resolution: {integrity: sha512-h4lTMgMJctJybDp8CQrxTUiiYmedihHWkjnF/8Pxseu2S6Nlfcy8kwboQ8yejh456rP2yWoEVm1sS/FVsfM48w==}
@ -8457,14 +8487,14 @@ packages:
dependencies:
'@types/prop-types': 15.7.5
'@types/scheduler': 0.16.2
csstype: 3.1.0
csstype: 3.1.1
/@types/react/18.0.20:
resolution: {integrity: sha512-MWul1teSPxujEHVwZl4a5HxQ9vVNsjTchVA+xRqv/VYGCuKGAU6UhfrTdF5aBefwD1BHUD8i/zq+O/vyCm/FrA==}
dependencies:
'@types/prop-types': 15.7.5
'@types/scheduler': 0.16.2
csstype: 3.1.0
csstype: 3.1.1
/@types/reactcss/1.2.6:
resolution: {integrity: sha512-qaIzpCuXNWomGR1Xq8SCFTtF4v8V27Y6f+b9+bzHiv087MylI/nTCqqdChNeWS7tslgROmYB7yeiruWX7WnqNg==}
@ -8531,6 +8561,14 @@ packages:
resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==}
dev: true
/@types/styled-components/5.1.26:
resolution: {integrity: sha512-KuKJ9Z6xb93uJiIyxo/+ksS7yLjS1KzG6iv5i78dhVg/X3u5t1H7juRWqVmodIdz6wGVaIApo1u01kmFRdJHVw==}
dependencies:
'@types/hoist-non-react-statics': 3.3.1
'@types/react': 18.0.20
csstype: 3.1.1
dev: true
/@types/tapable/1.0.8:
resolution: {integrity: sha512-ipixuVrh2OdNmauvtT51o3d8z12p6LtFW9in7U79der/kwejjdNchQC5UMn5u/KxNoM7VHHOs/l8KS8uHxhODQ==}
dev: true
@ -10047,6 +10085,21 @@ packages:
- supports-color
dev: true
/babel-plugin-styled-components/2.0.7_styled-components@5.3.6:
resolution: {integrity: sha512-i7YhvPgVqRKfoQ66toiZ06jPNA3p6ierpfUuEWxNF+fV27Uv5gxBkf8KZLHUCc1nFA9j6+80pYoIpqCeyW3/bA==}
peerDependencies:
styled-components: '>= 2'
dependencies:
'@babel/helper-annotate-as-pure': 7.18.6
'@babel/helper-module-imports': 7.18.6
babel-plugin-syntax-jsx: 6.18.0
lodash: 4.17.21
picomatch: 2.3.1
styled-components: 5.3.6_react@18.2.0
/babel-plugin-syntax-jsx/6.18.0:
resolution: {integrity: sha512-qrPaCSo9c8RHNRHIotaufGbuOBN8rtdC4QrrFFc43vyWCCz7Kl7GL1PGaXtMGQZUXrkCjNEgxDfmAuAabr/rlw==}
/babel-polyfill/6.23.0:
resolution: {integrity: sha512-0l7mVU+LrQ2X/ZTUq63T5i3VyR2aTgcRTFmBcD6djQ/Fek6q1A9t5u0F4jZVYHzp78jwWAzGfLpAY1b4/I3lfg==}
dependencies:
@ -10732,6 +10785,9 @@ packages:
resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==}
engines: {node: '>=10'}
/camelize/1.0.0:
resolution: {integrity: sha512-W2lPwkBkMZwFlPCXhIlYgxu+7gC/NUlCtdK652DAJ1JdgV0sTrvuPFshNPrFa1TY2JOkLhgdeEBplB4ezEa+xg==}
/caniuse-api/3.0.0:
resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==}
dependencies:
@ -11997,6 +12053,10 @@ packages:
type-fest: 0.8.1
dev: false
/css-color-keywords/1.0.0:
resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==}
engines: {node: '>=4'}
/css-color-names/0.0.4:
resolution: {integrity: sha512-zj5D7X1U2h2zsXOAM8EyUREBnnts6H+Jm+d1M2DbiQQcUtnqgQsMrdo8JW9R80YFUmIdBZeMu5wvYM7hcgWP/Q==}
@ -12146,6 +12206,13 @@ packages:
nth-check: 2.1.1
dev: false
/css-to-react-native/3.0.0:
resolution: {integrity: sha512-Ro1yETZA813eoyUp2GDBhG2j+YggidUmzO1/v9eYBKR2EHVEniE2MI/NqpTQ954BMpTPZFsGNPm46qFB9dpaPQ==}
dependencies:
camelize: 1.0.0
css-color-keywords: 1.0.0
postcss-value-parser: 4.2.0
/css-tree/1.0.0-alpha.37:
resolution: {integrity: sha512-DMxWJg0rnz7UgxKT0Q1HU/L9BeJI0M6ksor0OgqOnF+aRCDWg/N2641HmVyU9KVIu0OVVWOb2IpC9A+BJRnejg==}
engines: {node: '>=8.0.0'}
@ -12338,12 +12405,8 @@ packages:
cssom: 0.3.8
dev: true
/csstype/3.1.0:
resolution: {integrity: sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==}
/csstype/3.1.1:
resolution: {integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==}
dev: false
/currently-unhandled/0.4.1:
resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==}
@ -12432,6 +12495,18 @@ packages:
dependencies:
ms: 2.1.2
/debug/4.3.4_supports-color@5.5.0:
resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
engines: {node: '>=6.0'}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
dependencies:
ms: 2.1.2
supports-color: 5.5.0
/debug/4.3.4_supports-color@9.2.2:
resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
engines: {node: '>=6.0'}
@ -15739,7 +15814,6 @@ packages:
resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==}
dependencies:
react-is: 16.13.1
dev: false
/homedir-polyfill/1.0.3:
resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==}
@ -25587,6 +25661,51 @@ packages:
dependencies:
inline-style-parser: 0.1.1
/styled-components/5.3.6_7i5myeigehqah43i5u7wbekgba:
resolution: {integrity: sha512-hGTZquGAaTqhGWldX7hhfzjnIYBZ0IXQXkCYdvF1Sq3DsUaLx6+NTHC5Jj1ooM2F68sBiVz3lvhfwQs/S3l6qg==}
engines: {node: '>=10'}
requiresBuild: true
peerDependencies:
react: '>= 16.8.0'
react-dom: '>= 16.8.0'
react-is: '>= 16.8.0'
dependencies:
'@babel/helper-module-imports': 7.18.6
'@babel/traverse': 7.18.13_supports-color@5.5.0
'@emotion/is-prop-valid': 1.2.0
'@emotion/stylis': 0.8.5
'@emotion/unitless': 0.7.5
babel-plugin-styled-components: 2.0.7_styled-components@5.3.6
css-to-react-native: 3.0.0
hoist-non-react-statics: 3.3.2
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
react-is: 18.2.0
shallowequal: 1.1.0
supports-color: 5.5.0
dev: false
/styled-components/5.3.6_react@18.2.0:
resolution: {integrity: sha512-hGTZquGAaTqhGWldX7hhfzjnIYBZ0IXQXkCYdvF1Sq3DsUaLx6+NTHC5Jj1ooM2F68sBiVz3lvhfwQs/S3l6qg==}
engines: {node: '>=10'}
requiresBuild: true
peerDependencies:
react: '>= 16.8.0'
react-dom: '>= 16.8.0'
react-is: '>= 16.8.0'
dependencies:
'@babel/helper-module-imports': 7.18.6
'@babel/traverse': 7.18.13_supports-color@5.5.0
'@emotion/is-prop-valid': 1.2.0
'@emotion/stylis': 0.8.5
'@emotion/unitless': 0.7.5
babel-plugin-styled-components: 2.0.7_styled-components@5.3.6
css-to-react-native: 3.0.0
hoist-non-react-statics: 3.3.2
react: 18.2.0
shallowequal: 1.1.0
supports-color: 5.5.0
/stylehacks/4.0.3:
resolution: {integrity: sha512-7GlLk9JwlElY4Y6a/rmbH2MhVlTyVmiJd1PfTCqFaIBEGMYNsrO/v3SeGTdhBThLg4Z+NbOk/qFMwCa+J+3p/g==}
engines: {node: '>=6.9.0'}

Loading…
Cancel
Save