@pubinfo/config 2.0.0-beta.5 → 2.0.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eslint/index.d.ts +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +3 -4
- package/dist/stylelint.d.ts +1 -1
- package/dist/themes/index.d.mts +1 -5
- package/dist/themes/index.d.ts +1 -5
- package/dist/themes/index.mjs +626 -3
- package/dist/{unocss.d.ts → unocss/index.d.ts} +1 -1
- package/dist/unocss/index.mjs +99 -0
- package/package.json +8 -14
- package/dist/eslint/index.cjs +0 -8
- package/dist/eslint/index.d.cts +0 -6
- package/dist/index.cjs +0 -21
- package/dist/index.d.cts +0 -6
- package/dist/shared/config.BDKVPKTO.mjs +0 -635
- package/dist/shared/config.CSqBb4YU.d.cts +0 -5
- package/dist/shared/config.YMrrkzU5.cjs +0 -641
- package/dist/shared/config.wdnazHMp.cjs +0 -147
- package/dist/stylelint.cjs +0 -139
- package/dist/stylelint.d.cts +0 -106
- package/dist/themes/index.cjs +0 -13
- package/dist/themes/index.d.cts +0 -33
- package/dist/unocss.cjs +0 -59
- package/dist/unocss.d.cts +0 -5
- package/dist/unocss.mjs +0 -57
- /package/dist/{unocss.d.mts → unocss/index.d.mts} +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { definePreset as definePreset$1, transformerDirectives, presetUno, presetAttributify, presetTypography, presetIcons } from 'unocss';
|
|
2
|
+
import { definePreset, entriesToCss, toArray } from '@unocss/core';
|
|
3
|
+
import { themes } from '../themes/index.mjs';
|
|
4
|
+
|
|
5
|
+
const suffix = [["", " *", "::before", "::after"], ["::backdrop"]];
|
|
6
|
+
function createCssVar(key, themeName) {
|
|
7
|
+
function createSuffixScheme(preSuffix, suffixMap = suffix) {
|
|
8
|
+
return suffixMap.reduce((acc, suffix2) => acc.concat(suffix2.map((s) => `${preSuffix}${s}`).join(",")), []);
|
|
9
|
+
}
|
|
10
|
+
const map = {
|
|
11
|
+
light(key2) {
|
|
12
|
+
const preSuffix = `[data-theme="${key2}"]`;
|
|
13
|
+
return createSuffixScheme(preSuffix);
|
|
14
|
+
},
|
|
15
|
+
dark(key2) {
|
|
16
|
+
const preSuffix = `html.dark [data-theme="${key2}"]`;
|
|
17
|
+
return createSuffixScheme(preSuffix);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
return map[key](themeName);
|
|
21
|
+
}
|
|
22
|
+
function normalizePreflights() {
|
|
23
|
+
return {
|
|
24
|
+
getCSS: () => {
|
|
25
|
+
const injectionCss = [];
|
|
26
|
+
Object.keys(themes).forEach((key) => {
|
|
27
|
+
delete themes[key].label;
|
|
28
|
+
const css = entriesToCss(Object.entries(themes[key]));
|
|
29
|
+
const themeColorScheme = themes[key]["color-scheme"];
|
|
30
|
+
const roots = toArray(
|
|
31
|
+
createCssVar(themeColorScheme, key)
|
|
32
|
+
);
|
|
33
|
+
injectionCss.push(roots.map((root) => `${root}{${css}}`).join(""));
|
|
34
|
+
});
|
|
35
|
+
return injectionCss.join("");
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const presetThemes = definePreset(() => {
|
|
40
|
+
return {
|
|
41
|
+
name: "@wsys/preset-themes",
|
|
42
|
+
preflights: [
|
|
43
|
+
normalizePreflights()
|
|
44
|
+
]
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const index = definePreset$1(() => {
|
|
49
|
+
return {
|
|
50
|
+
name: "preset-pubinfo",
|
|
51
|
+
presets: [
|
|
52
|
+
presetThemes(),
|
|
53
|
+
presetUno(),
|
|
54
|
+
presetAttributify(),
|
|
55
|
+
presetTypography(),
|
|
56
|
+
presetIcons({
|
|
57
|
+
extraProperties: {
|
|
58
|
+
"display": "inline-block",
|
|
59
|
+
"vertical-align": "middle"
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
],
|
|
63
|
+
transformers: [
|
|
64
|
+
transformerDirectives()
|
|
65
|
+
],
|
|
66
|
+
shortcuts: [
|
|
67
|
+
{
|
|
68
|
+
"flex-center": "flex justify-center items-center",
|
|
69
|
+
"flex-col-center": "flex flex-col justify-center items-center"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
theme: {
|
|
73
|
+
colors: {
|
|
74
|
+
"ui-primary": "rgb(var(--ui-primary))",
|
|
75
|
+
"ui-text": "rgb(var(--ui-text))"
|
|
76
|
+
},
|
|
77
|
+
breakpoints: {
|
|
78
|
+
"sm": "768px",
|
|
79
|
+
"smd": "1024px",
|
|
80
|
+
"md": "1366px",
|
|
81
|
+
"lg": "1440px",
|
|
82
|
+
"xl": "1600px",
|
|
83
|
+
"2xl": "1920px"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
// TOFIX 此文件中该配置不生效
|
|
87
|
+
content: {
|
|
88
|
+
pipeline: {
|
|
89
|
+
include: [
|
|
90
|
+
/\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/,
|
|
91
|
+
"src/routes/**/*.ts"
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// configDeps: themesPath,
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
export { index as default };
|
package/package.json
CHANGED
|
@@ -1,35 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pubinfo/config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.7",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
-
"
|
|
9
|
-
"require": "./dist/index.cjs"
|
|
8
|
+
"default": "./dist/index.mjs"
|
|
10
9
|
},
|
|
11
10
|
"./eslint": {
|
|
12
11
|
"types": "./dist/eslint/index.d.ts",
|
|
13
|
-
"
|
|
14
|
-
"require": "./dist/eslint/index.cjs"
|
|
12
|
+
"default": "./dist/eslint/index.mjs"
|
|
15
13
|
},
|
|
16
14
|
"./themes": {
|
|
17
15
|
"types": "./dist/themes/index.d.ts",
|
|
18
|
-
"
|
|
19
|
-
"require": "./dist/themes/index.cjs"
|
|
16
|
+
"default": "./dist/themes/index.mjs"
|
|
20
17
|
},
|
|
21
18
|
"./stylelint": {
|
|
22
19
|
"types": "./dist/stylelint.d.ts",
|
|
23
|
-
"
|
|
24
|
-
"require": "./dist/stylelint.cjs"
|
|
20
|
+
"default": "./dist/stylelint.mjs"
|
|
25
21
|
},
|
|
26
22
|
"./unocss": {
|
|
27
|
-
"types": "./dist/unocss.d.ts",
|
|
28
|
-
"
|
|
29
|
-
"require": "./dist/unocss.cjs"
|
|
23
|
+
"types": "./dist/unocss/index.d.ts",
|
|
24
|
+
"default": "./dist/unocss/index.mjs"
|
|
30
25
|
}
|
|
31
26
|
},
|
|
32
|
-
"main": "./dist/index.
|
|
27
|
+
"main": "./dist/index.mjs",
|
|
33
28
|
"module": "./dist/index.mjs",
|
|
34
29
|
"types": "./dist/index.d.ts",
|
|
35
30
|
"files": [
|
|
@@ -44,7 +39,6 @@
|
|
|
44
39
|
"@antfu/eslint-config": "^3.16.0",
|
|
45
40
|
"@stylistic/stylelint-plugin": "^2.1.3",
|
|
46
41
|
"@unocss/core": "^65.5.0",
|
|
47
|
-
"@unocss/preset-mini": "^65.5.0",
|
|
48
42
|
"postcss-html": "^1.8.0",
|
|
49
43
|
"postcss-preset-env": "^10.1.5",
|
|
50
44
|
"stylelint-config-recess-order": "^5.1.1",
|
package/dist/eslint/index.cjs
DELETED
package/dist/eslint/index.d.cts
DELETED
package/dist/index.cjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const factory = require('./shared/config.wdnazHMp.cjs');
|
|
4
|
-
const stylelint = require('./stylelint.cjs');
|
|
5
|
-
const presetThemes = require('./shared/config.YMrrkzU5.cjs');
|
|
6
|
-
const unocss = require('./unocss.cjs');
|
|
7
|
-
require('@antfu/eslint-config');
|
|
8
|
-
require('@unocss/core');
|
|
9
|
-
require('@unocss/preset-mini/utils');
|
|
10
|
-
require('unocss');
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
exports.eslint = factory.pubinfo;
|
|
15
|
-
exports.stylelint = stylelint;
|
|
16
|
-
exports.customColorKey = presetThemes.customColorKey;
|
|
17
|
-
exports.defineTheme = presetThemes.defineTheme;
|
|
18
|
-
exports.mergeTheme = presetThemes.mergeTheme;
|
|
19
|
-
exports.presetThemes = presetThemes.presetThemes;
|
|
20
|
-
exports.themes = presetThemes.themes;
|
|
21
|
-
exports.presetPubinfo = unocss;
|
package/dist/index.d.cts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { p as eslint } from './shared/config.CSqBb4YU.cjs';
|
|
2
|
-
export { default as stylelint } from './stylelint.cjs';
|
|
3
|
-
export { colorScheme, cssVarKey, customColorKey, defineTheme, globalTheme, mergeTheme, presetThemes, themeOptions, themes } from './themes/index.cjs';
|
|
4
|
-
export { default as presetPubinfo } from './unocss.cjs';
|
|
5
|
-
import '@antfu/eslint-config';
|
|
6
|
-
import 'unocss';
|