@c4a/extract-style 0.7.4 → 0.7.8
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/index.js +6 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -22648,7 +22648,7 @@ function classifySpecifier(importer, specifier, files) {
|
|
|
22648
22648
|
return { resolution: "package-or-load-path", resolved_path: null, specifier };
|
|
22649
22649
|
}
|
|
22650
22650
|
function locator(path2, rule2, qualifiedItemPath) {
|
|
22651
|
-
return { path: path2, line: rule2.source?.start?.line ?? 1, column: rule2.source?.start?.column ?? 1, qualified_item_path: qualifiedItemPath };
|
|
22651
|
+
return { path: path2, line: rule2.source?.start?.line ?? 1, end_line: rule2.source?.end?.line ?? rule2.source?.start?.line ?? 1, column: rule2.source?.start?.column ?? 1, qualified_item_path: qualifiedItemPath };
|
|
22652
22652
|
}
|
|
22653
22653
|
function collectStyleImports(input) {
|
|
22654
22654
|
const imports = [];
|
|
@@ -22713,7 +22713,7 @@ var STATE_PSEUDOS = new Set([
|
|
|
22713
22713
|
var GENERIC_MODULE_NAMES = new Set(["global", "index", "style", "styles", "theme", "themes", "token", "tokens", "variable", "variables"]);
|
|
22714
22714
|
var DYNAMIC_SELECTOR_TOKEN = "c4a_dynamic_";
|
|
22715
22715
|
function locator2(path2, rule2, qualifiedItemPath) {
|
|
22716
|
-
return { path: path2, line: rule2.source?.start?.line ?? 1, column: rule2.source?.start?.column ?? 1, qualified_item_path: qualifiedItemPath };
|
|
22716
|
+
return { path: path2, line: rule2.source?.start?.line ?? 1, end_line: rule2.source?.end?.line ?? rule2.source?.start?.line ?? 1, column: rule2.source?.start?.column ?? 1, qualified_item_path: qualifiedItemPath };
|
|
22717
22717
|
}
|
|
22718
22718
|
function sorted(values) {
|
|
22719
22719
|
return [...values].sort((left, right) => left.localeCompare(right));
|
|
@@ -22923,7 +22923,7 @@ function collectStyleSelectors(input) {
|
|
|
22923
22923
|
// src/styleTokens.ts
|
|
22924
22924
|
var import_postcss_value_parser2 = __toESM(require_lib(), 1);
|
|
22925
22925
|
function locator3(path2, node2, qualifiedItemPath) {
|
|
22926
|
-
return { path: path2, line: node2.source?.start?.line ?? 1, column: node2.source?.start?.column ?? 1, qualified_item_path: qualifiedItemPath };
|
|
22926
|
+
return { path: path2, line: node2.source?.start?.line ?? 1, end_line: node2.source?.end?.line ?? node2.source?.start?.line ?? 1, column: node2.source?.start?.column ?? 1, qualified_item_path: qualifiedItemPath };
|
|
22927
22927
|
}
|
|
22928
22928
|
function firstWord(nodes) {
|
|
22929
22929
|
const node2 = nodes.find((item) => item.type === "word" || item.type === "string");
|
|
@@ -22993,6 +22993,8 @@ function parseRoot(path2, source, syntax) {
|
|
|
22993
22993
|
}
|
|
22994
22994
|
function parseStyleDocument(path2, source, syntax, files) {
|
|
22995
22995
|
const document2 = empty(path2, syntax, "analyzed");
|
|
22996
|
+
document2.lines = source.split(`
|
|
22997
|
+
`).length;
|
|
22996
22998
|
let root2;
|
|
22997
22999
|
try {
|
|
22998
23000
|
root2 = parseRoot(path2, source, syntax);
|
|
@@ -23068,7 +23070,7 @@ function analyzedFacts(document2, invocation, moduleRef) {
|
|
|
23068
23070
|
facts.push(fact2({ invocation, document: document2, moduleRef, locator: locator4, kind, signature, payload }));
|
|
23069
23071
|
};
|
|
23070
23072
|
const root2 = { path: document2.path, line: 1, column: 1, qualified_item_path: "file" };
|
|
23071
|
-
add(root2, "source-file", { catalog: document2.syntax, tier: "lightweight-evidence" }, { path: document2.path, syntax: document2.syntax });
|
|
23073
|
+
add(root2, "source-file", { catalog: document2.syntax, tier: "lightweight-evidence" }, { path: document2.path, syntax: document2.syntax, lines: document2.lines });
|
|
23072
23074
|
for (const item of document2.imports)
|
|
23073
23075
|
add(item.locator, "style-import", { import_ref: item.import_ref, kind: item.kind, specifier_digest: item.specifier_digest, resolution: item.resolution, resolved_path: item.resolved_path }, item);
|
|
23074
23076
|
for (const item of document2.tokens)
|