app-tutor-ai-consumer 1.36.0 → 1.37.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [1.37.0](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.36.0...v1.37.0) (2025-11-10)
2
+
3
+ ### Features
4
+
5
+ - add postcss prefix ([d008da3](https://github.com/Hotmart-Org/app-tutor-ai-consumer/commit/d008da3e5d587d134d5faff4b96159f7ee685b7f))
6
+ - adding app prefix ([b093214](https://github.com/Hotmart-Org/app-tutor-ai-consumer/commit/b0932143ab524321fe477ba8b32bd3050476916f))
7
+
1
8
  # [1.36.0](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.35.1...v1.36.0) (2025-11-07)
2
9
 
3
10
  ### Features
@@ -115,8 +115,14 @@ module.exports = async function (env) {
115
115
  {
116
116
  loader: 'postcss-loader',
117
117
  options: {
118
- postcssOptions: {
119
- config: path.resolve(paths.ROOT, 'postcss.config.js')
118
+ postcssOptions: (loaderContext) => {
119
+ const config = require(path.resolve(paths.ROOT, 'postcss.config.js'))
120
+ return typeof config === 'function'
121
+ ? config({
122
+ file: loaderContext.resourcePath,
123
+ resourcePath: loaderContext.resourcePath
124
+ })
125
+ : config
120
126
  }
121
127
  }
122
128
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "app-tutor-ai-consumer",
3
- "version": "1.36.0",
3
+ "version": "1.37.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "dev": "rspack serve --env=development --config config/rspack/rspack.config.js",
@@ -119,6 +119,7 @@
119
119
  "immer": "~10.1.1",
120
120
  "jotai": "~2.12.5",
121
121
  "linkify-it": "~5.0.0",
122
+ "postcss-prefix-selector": "^2.1.1",
122
123
  "prism-react-renderer": "~2.4.1",
123
124
  "react": "~19.1.0",
124
125
  "react-dom": "~19.1.0",
package/postcss.config.js CHANGED
@@ -1,3 +1,40 @@
1
- module.exports = {
1
+ const prefixer = require('postcss-prefix-selector')
2
+
3
+ const postcssConfigWithPrefix = {
4
+ plugins: [
5
+ require('postcss-import'),
6
+ require('tailwindcss'),
7
+ require('autoprefixer'),
8
+ prefixer({
9
+ prefix: '#app-tutor-ai-consumer',
10
+ transform: (prefix, selector, prefixedSelector) => {
11
+ if (
12
+ selector.startsWith(':root') ||
13
+ selector.startsWith('html') ||
14
+ selector.startsWith('body')
15
+ ) {
16
+ return selector
17
+ }
18
+
19
+ if (selector.startsWith('#app-tutor-ai-consumer')) {
20
+ return selector
21
+ }
22
+
23
+ return prefixedSelector
24
+ }
25
+ })
26
+ ]
27
+ }
28
+
29
+ const postcssConfigWithoutPrefix = {
2
30
  plugins: [require('postcss-import'), require('tailwindcss'), require('autoprefixer')]
3
31
  }
32
+
33
+ module.exports = (ctx) => {
34
+ const filePath = ctx?.file || ctx?.resourcePath || ''
35
+ if (filePath.includes('.module.css')) {
36
+ return postcssConfigWithoutPrefix
37
+ }
38
+
39
+ return postcssConfigWithPrefix
40
+ }