@modern-js/plugin-tailwindcss 0.0.0-next-20240724062730 → 0.0.0-next-20240724064042
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.
|
@@ -41,7 +41,7 @@ const useDesignTokens = () => (0, import_react.useContext)(DesignTokenContext);
|
|
|
41
41
|
const designTokenPlugin = (options = {}) => ({
|
|
42
42
|
name: "@modern-js/plugin-design-token",
|
|
43
43
|
setup: () => ({
|
|
44
|
-
|
|
44
|
+
hoc({ App, config }, next) {
|
|
45
45
|
const DesignTokenAppWrapper = (props) => {
|
|
46
46
|
const { token = {}, useStyledComponentsThemeProvider = false, useDesignTokenContext = false } = options;
|
|
47
47
|
if (useStyledComponentsThemeProvider && useDesignTokenContext) {
|
|
@@ -76,7 +76,10 @@ const designTokenPlugin = (options = {}) => ({
|
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
|
-
return
|
|
79
|
+
return next({
|
|
80
|
+
App: DesignTokenAppWrapper,
|
|
81
|
+
config
|
|
82
|
+
});
|
|
80
83
|
}
|
|
81
84
|
})
|
|
82
85
|
});
|
|
@@ -11,7 +11,8 @@ var designTokenPlugin = function() {
|
|
|
11
11
|
name: "@modern-js/plugin-design-token",
|
|
12
12
|
setup: function() {
|
|
13
13
|
return {
|
|
14
|
-
|
|
14
|
+
hoc: function hoc(param, next) {
|
|
15
|
+
var App = param.App, config = param.config;
|
|
15
16
|
var DesignTokenAppWrapper = function(props) {
|
|
16
17
|
var _options_token = options.token, token = _options_token === void 0 ? {} : _options_token, _options_useStyledComponentsThemeProvider = options.useStyledComponentsThemeProvider, useStyledComponentsThemeProvider = _options_useStyledComponentsThemeProvider === void 0 ? false : _options_useStyledComponentsThemeProvider, _options_useDesignTokenContext = options.useDesignTokenContext, useDesignTokenContext = _options_useDesignTokenContext === void 0 ? false : _options_useDesignTokenContext;
|
|
17
18
|
if (useStyledComponentsThemeProvider && useDesignTokenContext) {
|
|
@@ -38,7 +39,10 @@ var designTokenPlugin = function() {
|
|
|
38
39
|
return /* @__PURE__ */ _jsx(App, _object_spread({}, props));
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
|
-
return
|
|
42
|
+
return next({
|
|
43
|
+
App: DesignTokenAppWrapper,
|
|
44
|
+
config
|
|
45
|
+
});
|
|
42
46
|
}
|
|
43
47
|
};
|
|
44
48
|
}
|
|
@@ -5,7 +5,7 @@ const useDesignTokens = () => useContext(DesignTokenContext);
|
|
|
5
5
|
const designTokenPlugin = (options = {}) => ({
|
|
6
6
|
name: "@modern-js/plugin-design-token",
|
|
7
7
|
setup: () => ({
|
|
8
|
-
|
|
8
|
+
hoc({ App, config }, next) {
|
|
9
9
|
const DesignTokenAppWrapper = (props) => {
|
|
10
10
|
const { token = {}, useStyledComponentsThemeProvider = false, useDesignTokenContext = false } = options;
|
|
11
11
|
if (useStyledComponentsThemeProvider && useDesignTokenContext) {
|
|
@@ -40,7 +40,10 @@ const designTokenPlugin = (options = {}) => ({
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
return
|
|
43
|
+
return next({
|
|
44
|
+
App: DesignTokenAppWrapper,
|
|
45
|
+
config
|
|
46
|
+
});
|
|
44
47
|
}
|
|
45
48
|
})
|
|
46
49
|
});
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "0.0.0-next-
|
|
18
|
+
"version": "0.0.0-next-20240724064042",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"babel-plugin-macros": "3.1.0",
|
|
51
51
|
"@swc/helpers": "0.5.3",
|
|
52
|
-
"@modern-js/
|
|
53
|
-
"@modern-js/
|
|
52
|
+
"@modern-js/utils": "0.0.0-next-20240724064042",
|
|
53
|
+
"@modern-js/node-bundle-require": "0.0.0-next-20240724064042"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/jest": "^29",
|
|
@@ -60,17 +60,17 @@
|
|
|
60
60
|
"jest": "^29",
|
|
61
61
|
"react": "^18",
|
|
62
62
|
"postcss": "^8.4.35",
|
|
63
|
-
"@modern-js/
|
|
64
|
-
"@modern-js/module-tools": "0.0.0-next-
|
|
65
|
-
"@modern-js/
|
|
66
|
-
"@
|
|
67
|
-
"@modern-js/
|
|
68
|
-
"@
|
|
69
|
-
"@scripts/jest-config": "0.0.0-next-
|
|
63
|
+
"@modern-js/runtime": "0.0.0-next-20240724064042",
|
|
64
|
+
"@modern-js/module-tools": "0.0.0-next-20240724064042",
|
|
65
|
+
"@modern-js/core": "0.0.0-next-20240724064042",
|
|
66
|
+
"@modern-js/types": "0.0.0-next-20240724064042",
|
|
67
|
+
"@modern-js/app-tools": "0.0.0-next-20240724064042",
|
|
68
|
+
"@scripts/build": "0.0.0-next-20240724064042",
|
|
69
|
+
"@scripts/jest-config": "0.0.0-next-20240724064042"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"tailwindcss": ">= 2.0.0 || >= 3.0.0",
|
|
73
|
-
"@modern-js/runtime": "0.0.0-next-
|
|
73
|
+
"@modern-js/runtime": "0.0.0-next-20240724064042"
|
|
74
74
|
},
|
|
75
75
|
"peerDependenciesMeta": {
|
|
76
76
|
"@modern-js/runtime": {
|