@lls/vitescripts 2.0.21 → 2.0.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lls/vitescripts",
3
- "version": "2.0.21",
3
+ "version": "2.0.22",
4
4
  "description": "lls vite plugins",
5
5
  "main": "src/index.mjs",
6
6
  "files": [
@@ -63,6 +63,7 @@ const llsCssModuleMacroPlugin = async ({ themeIsFreeMode, themeIsDarkMode, theme
63
63
  const delim = (operator) => ({ type: 'token', value: { type: 'delim', value: operator } })
64
64
  const length = (value, unit) => ({ type: 'length', value: { value, unit } })
65
65
  const func = (name, args) => ({ type: 'function', value: { name, arguments: args } })
66
+ const num = value => ({ type: 'token', value: { type: 'number', value } })
66
67
  return {
67
68
  enforce: 'pre',
68
69
  transform (src, id) {
@@ -100,7 +101,7 @@ const llsCssModuleMacroPlugin = async ({ themeIsFreeMode, themeIsDarkMode, theme
100
101
  }
101
102
  },
102
103
  getFluidSize ({ arguments: [minSize, comma1, maxSize, comma2, iMinViewport, comma3, iMaxViewport] }) {
103
- const minViewport = (typeof (iMinviewport) === 'undefined' || iMinViewport.value?.type === 'comma') ? length(320, 'px') : iMinViewport
104
+ const minViewport = (typeof (iMinViewport) === 'undefined' || iMinViewport.value?.type === 'comma') ? length(320, 'px') : iMinViewport
104
105
  const max = iMinViewport?.value?.type === 'comma' ? comma3 : iMaxViewport
105
106
  const maxViewport = typeof (max) === 'undefined' ? length(1280, 'px') : max
106
107
  return func('min', [
@@ -112,11 +113,7 @@ const llsCssModuleMacroPlugin = async ({ themeIsFreeMode, themeIsDarkMode, theme
112
113
  func('calc', [
113
114
  minSize,
114
115
  delim('+'),
115
- token('parenthesis-block'),
116
- maxSize,
117
- delim('-'),
118
- minSize,
119
- token('close-parenthesis'),
116
+ num(maxSize?.value?.value - minSize?.value?.value),
120
117
  delim('*'),
121
118
  token('parenthesis-block'),
122
119
  token('parenthesis-block'),
@@ -125,11 +122,7 @@ const llsCssModuleMacroPlugin = async ({ themeIsFreeMode, themeIsDarkMode, theme
125
122
  minViewport,
126
123
  token('close-parenthesis'),
127
124
  delim('/'),
128
- token('parenthesis-block'),
129
- maxViewport,
130
- delim('-'),
131
- minViewport,
132
- token('close-parenthesis'),
125
+ num(maxViewport?.value?.value - minViewport?.value.value),
133
126
  token('close-parenthesis')
134
127
  ])
135
128
  ])