@bamboocss/parser 1.48.5 → 1.49.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/dist/index.cjs CHANGED
@@ -1172,6 +1172,17 @@ const combineResult = (unboxed) => {
1172
1172
  ...unboxed.spreadConditions
1173
1173
  ];
1174
1174
  };
1175
+ /** The exact binding token accounting visits for a token call. */
1176
+ const tokenCalleeRange = (call) => {
1177
+ if (!ts_morph.Node.isCallExpression(call)) return void 0;
1178
+ let current = call.getExpression();
1179
+ while (ts_morph.Node.isPropertyAccessExpression(current)) current = current.getExpression();
1180
+ if (!ts_morph.Node.isIdentifier(current)) return void 0;
1181
+ return {
1182
+ start: current.getStart(),
1183
+ end: current.getEnd()
1184
+ };
1185
+ };
1175
1186
  const defaultEnv = { preset: "ECMA" };
1176
1187
  /**
1177
1188
  * `fallback()` is generated into `styled-system/css`, so evaluating a call to it would mean
@@ -1307,7 +1318,8 @@ function createParser(context) {
1307
1318
  if (query.kind === "call-expression") parserResult.setToken({
1308
1319
  name: "token.value",
1309
1320
  box: query.box.value[0] ?? _bamboocss_extractor.box.fallback(query.box),
1310
- data: combineResult((0, _bamboocss_extractor.unbox)(query.box.value[0]))
1321
+ data: combineResult((0, _bamboocss_extractor.unbox)(query.box.value[0])),
1322
+ tokenCalleeRange: tokenCalleeRange(query.box.getNode())
1311
1323
  }, "tokenValue");
1312
1324
  });
1313
1325
  return;
@@ -1330,7 +1342,8 @@ function createParser(context) {
1330
1342
  if (query.kind === "call-expression") parserResult.setToken({
1331
1343
  name,
1332
1344
  box: query.box.value[0] ?? _bamboocss_extractor.box.fallback(query.box),
1333
- data: combineResult((0, _bamboocss_extractor.unbox)(query.box.value[0]))
1345
+ data: combineResult((0, _bamboocss_extractor.unbox)(query.box.value[0])),
1346
+ tokenCalleeRange: tokenCalleeRange(query.box.getNode())
1334
1347
  });
1335
1348
  });
1336
1349
  }).when(file.isValidPattern, (name) => {
package/dist/index.mjs CHANGED
@@ -1171,6 +1171,17 @@ const combineResult = (unboxed) => {
1171
1171
  ...unboxed.spreadConditions
1172
1172
  ];
1173
1173
  };
1174
+ /** The exact binding token accounting visits for a token call. */
1175
+ const tokenCalleeRange = (call) => {
1176
+ if (!Node.isCallExpression(call)) return void 0;
1177
+ let current = call.getExpression();
1178
+ while (Node.isPropertyAccessExpression(current)) current = current.getExpression();
1179
+ if (!Node.isIdentifier(current)) return void 0;
1180
+ return {
1181
+ start: current.getStart(),
1182
+ end: current.getEnd()
1183
+ };
1184
+ };
1174
1185
  const defaultEnv = { preset: "ECMA" };
1175
1186
  /**
1176
1187
  * `fallback()` is generated into `styled-system/css`, so evaluating a call to it would mean
@@ -1306,7 +1317,8 @@ function createParser(context) {
1306
1317
  if (query.kind === "call-expression") parserResult.setToken({
1307
1318
  name: "token.value",
1308
1319
  box: query.box.value[0] ?? box.fallback(query.box),
1309
- data: combineResult(unbox(query.box.value[0]))
1320
+ data: combineResult(unbox(query.box.value[0])),
1321
+ tokenCalleeRange: tokenCalleeRange(query.box.getNode())
1310
1322
  }, "tokenValue");
1311
1323
  });
1312
1324
  return;
@@ -1329,7 +1341,8 @@ function createParser(context) {
1329
1341
  if (query.kind === "call-expression") parserResult.setToken({
1330
1342
  name,
1331
1343
  box: query.box.value[0] ?? box.fallback(query.box),
1332
- data: combineResult(unbox(query.box.value[0]))
1344
+ data: combineResult(unbox(query.box.value[0])),
1345
+ tokenCalleeRange: tokenCalleeRange(query.box.getNode())
1333
1346
  });
1334
1347
  });
1335
1348
  }).when(file.isValidPattern, (name) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamboocss/parser",
3
- "version": "1.48.5",
3
+ "version": "1.49.0",
4
4
  "description": "The static parser for bamboo css",
5
5
  "homepage": "https://bamboocss.com",
6
6
  "license": "MIT",
@@ -34,18 +34,18 @@
34
34
  "dependencies": {
35
35
  "ts-morph": "28.0.0",
36
36
  "ts-pattern": "5.9.0",
37
- "@bamboocss/config": "^1.48.5",
38
- "@bamboocss/core": "^1.48.5",
39
- "@bamboocss/extractor": "1.48.5",
40
- "@bamboocss/logger": "1.48.5",
41
- "@bamboocss/shared": "1.48.5",
42
- "@bamboocss/types": "1.48.5"
37
+ "@bamboocss/config": "^1.49.0",
38
+ "@bamboocss/core": "^1.49.0",
39
+ "@bamboocss/extractor": "1.49.0",
40
+ "@bamboocss/logger": "1.49.0",
41
+ "@bamboocss/shared": "1.49.0",
42
+ "@bamboocss/types": "1.49.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@typescript/api": "npm:typescript@7.1.0-dev.20260819.1",
46
- "@bamboocss/generator": "1.48.5",
47
- "@bamboocss/plugin-svelte": "1.48.5",
48
- "@bamboocss/plugin-vue": "1.48.5"
46
+ "@bamboocss/generator": "1.49.0",
47
+ "@bamboocss/plugin-svelte": "1.49.0",
48
+ "@bamboocss/plugin-vue": "1.49.0"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "tsdown src/index.ts --format=esm,cjs --dts",