bejamas 0.3.3 → 0.4.1
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/README.md +20 -1
- package/dist/{generate-mdx-_F9W0nYJ.js → generate-mdx-Ce7A9Uxe.js} +14 -8
- package/dist/generate-mdx-Ce7A9Uxe.js.map +1 -0
- package/dist/index.js +1020 -49
- package/dist/index.js.map +1 -1
- package/dist/{utils-B0HWwl6F.js → utils-CyYWo_qS.js} +222 -73
- package/dist/utils-CyYWo_qS.js.map +1 -0
- package/package.json +3 -2
- package/dist/generate-mdx-_F9W0nYJ.js.map +0 -1
- package/dist/utils-B0HWwl6F.js.map +0 -1
|
@@ -1690,6 +1690,15 @@ const STYLES = [
|
|
|
1690
1690
|
|
|
1691
1691
|
//#endregion
|
|
1692
1692
|
//#region ../create-config/src/preset.ts
|
|
1693
|
+
const PRESET_STYLES = [
|
|
1694
|
+
"nova",
|
|
1695
|
+
"vega",
|
|
1696
|
+
"maia",
|
|
1697
|
+
"lyra",
|
|
1698
|
+
"mira",
|
|
1699
|
+
"luma",
|
|
1700
|
+
"juno"
|
|
1701
|
+
];
|
|
1693
1702
|
const SHARED_PRESET_STYLES = [
|
|
1694
1703
|
"nova",
|
|
1695
1704
|
"vega",
|
|
@@ -3284,6 +3293,7 @@ var require_tokenize = /* @__PURE__ */ __commonJS({ "../../node_modules/postcss/
|
|
|
3284
3293
|
let pos = 0;
|
|
3285
3294
|
let buffer = [];
|
|
3286
3295
|
let returned = [];
|
|
3296
|
+
let lastBadParen = -1;
|
|
3287
3297
|
function position() {
|
|
3288
3298
|
return pos;
|
|
3289
3299
|
}
|
|
@@ -3352,15 +3362,22 @@ var require_tokenize = /* @__PURE__ */ __commonJS({ "../../node_modules/postcss/
|
|
|
3352
3362
|
next
|
|
3353
3363
|
];
|
|
3354
3364
|
pos = next;
|
|
3355
|
-
} else
|
|
3365
|
+
} else if (pos <= lastBadParen) currentToken = [
|
|
3366
|
+
"(",
|
|
3367
|
+
"(",
|
|
3368
|
+
pos
|
|
3369
|
+
];
|
|
3370
|
+
else {
|
|
3356
3371
|
next = css.indexOf(")", pos + 1);
|
|
3357
3372
|
content = css.slice(pos, next + 1);
|
|
3358
|
-
if (next === -1 || RE_BAD_BRACKET.test(content))
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3373
|
+
if (next === -1 || RE_BAD_BRACKET.test(content)) {
|
|
3374
|
+
lastBadParen = next === -1 ? length : next;
|
|
3375
|
+
currentToken = [
|
|
3376
|
+
"(",
|
|
3377
|
+
"(",
|
|
3378
|
+
pos
|
|
3379
|
+
];
|
|
3380
|
+
} else {
|
|
3364
3381
|
currentToken = [
|
|
3365
3382
|
"brackets",
|
|
3366
3383
|
content,
|
|
@@ -3607,6 +3624,13 @@ var require_css_syntax_error = /* @__PURE__ */ __commonJS({ "../../node_modules/
|
|
|
3607
3624
|
//#endregion
|
|
3608
3625
|
//#region ../../node_modules/postcss/lib/stringifier.js
|
|
3609
3626
|
var require_stringifier = /* @__PURE__ */ __commonJS({ "../../node_modules/postcss/lib/stringifier.js": ((exports, module) => {
|
|
3627
|
+
const STYLE_TAG = /(<)(\/?style\b)/gi;
|
|
3628
|
+
const COMMENT_OPEN = /(<)(!--)/g;
|
|
3629
|
+
function escapeHTMLInCSS(str) {
|
|
3630
|
+
if (typeof str !== "string") return str;
|
|
3631
|
+
if (!str.includes("<")) return str;
|
|
3632
|
+
return str.replace(STYLE_TAG, "\\3c $2").replace(COMMENT_OPEN, "\\3c $2");
|
|
3633
|
+
}
|
|
3610
3634
|
const DEFAULT_RAW = {
|
|
3611
3635
|
after: "\n",
|
|
3612
3636
|
beforeClose: "\n",
|
|
@@ -3629,14 +3653,15 @@ var require_stringifier = /* @__PURE__ */ __commonJS({ "../../node_modules/postc
|
|
|
3629
3653
|
this.builder = builder;
|
|
3630
3654
|
}
|
|
3631
3655
|
atrule(node, semicolon) {
|
|
3656
|
+
let raws = node.raws;
|
|
3632
3657
|
let name = "@" + node.name;
|
|
3633
3658
|
let params = node.params ? this.rawValue(node, "params") : "";
|
|
3634
|
-
if (typeof
|
|
3659
|
+
if (typeof raws.afterName !== "undefined") name += raws.afterName;
|
|
3635
3660
|
else if (params) name += " ";
|
|
3636
3661
|
if (node.nodes) this.block(node, name + params);
|
|
3637
3662
|
else {
|
|
3638
|
-
let end = (
|
|
3639
|
-
this.builder(name + params + end, node);
|
|
3663
|
+
let end = (raws.between || "") + (semicolon ? ";" : "");
|
|
3664
|
+
this.builder(escapeHTMLInCSS(name + params + end), node);
|
|
3640
3665
|
}
|
|
3641
3666
|
}
|
|
3642
3667
|
beforeAfter(node, detect) {
|
|
@@ -3659,40 +3684,43 @@ var require_stringifier = /* @__PURE__ */ __commonJS({ "../../node_modules/postc
|
|
|
3659
3684
|
}
|
|
3660
3685
|
block(node, start) {
|
|
3661
3686
|
let between = this.raw(node, "between", "beforeOpen");
|
|
3662
|
-
this.builder(start + between + "{", node, "start");
|
|
3687
|
+
this.builder(escapeHTMLInCSS(start + between) + "{", node, "start");
|
|
3663
3688
|
let after;
|
|
3664
3689
|
if (node.nodes && node.nodes.length) {
|
|
3665
3690
|
this.body(node);
|
|
3666
3691
|
after = this.raw(node, "after");
|
|
3667
3692
|
} else after = this.raw(node, "after", "emptyBody");
|
|
3668
|
-
if (after) this.builder(after);
|
|
3693
|
+
if (after) this.builder(escapeHTMLInCSS(after));
|
|
3669
3694
|
this.builder("}", node, "end");
|
|
3670
3695
|
}
|
|
3671
3696
|
body(node) {
|
|
3672
|
-
let
|
|
3697
|
+
let nodes = node.nodes;
|
|
3698
|
+
let last = nodes.length - 1;
|
|
3673
3699
|
while (last > 0) {
|
|
3674
|
-
if (
|
|
3700
|
+
if (nodes[last].type !== "comment") break;
|
|
3675
3701
|
last -= 1;
|
|
3676
3702
|
}
|
|
3677
3703
|
let semicolon = this.raw(node, "semicolon");
|
|
3678
|
-
|
|
3679
|
-
|
|
3704
|
+
let isDocument = node.type === "document";
|
|
3705
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
3706
|
+
let child = nodes[i];
|
|
3680
3707
|
let before = this.raw(child, "before");
|
|
3681
|
-
if (before) this.builder(before);
|
|
3708
|
+
if (before) this.builder(isDocument ? before : escapeHTMLInCSS(before));
|
|
3682
3709
|
this.stringify(child, last !== i || semicolon);
|
|
3683
3710
|
}
|
|
3684
3711
|
}
|
|
3685
3712
|
comment(node) {
|
|
3686
3713
|
let left = this.raw(node, "left", "commentLeft");
|
|
3687
3714
|
let right = this.raw(node, "right", "commentRight");
|
|
3688
|
-
this.builder("/*" + left + node.text + right + "*/", node);
|
|
3715
|
+
this.builder(escapeHTMLInCSS("/*" + left + node.text + right + "*/"), node);
|
|
3689
3716
|
}
|
|
3690
3717
|
decl(node, semicolon) {
|
|
3718
|
+
let raws = node.raws;
|
|
3691
3719
|
let between = this.raw(node, "between", "colon");
|
|
3692
3720
|
let string = node.prop + between + this.rawValue(node, "value");
|
|
3693
|
-
if (node.important) string +=
|
|
3721
|
+
if (node.important) string += raws.important || " !important";
|
|
3694
3722
|
if (semicolon) string += ";";
|
|
3695
|
-
this.builder(string, node);
|
|
3723
|
+
this.builder(escapeHTMLInCSS(string), node);
|
|
3696
3724
|
}
|
|
3697
3725
|
document(node) {
|
|
3698
3726
|
this.body(node);
|
|
@@ -3711,8 +3739,8 @@ var require_stringifier = /* @__PURE__ */ __commonJS({ "../../node_modules/postc
|
|
|
3711
3739
|
}
|
|
3712
3740
|
if (!parent) return DEFAULT_RAW[detect];
|
|
3713
3741
|
let root$1 = node.root();
|
|
3714
|
-
|
|
3715
|
-
if (typeof
|
|
3742
|
+
let cache = root$1.rawCache || (root$1.rawCache = {});
|
|
3743
|
+
if (typeof cache[detect] !== "undefined") return cache[detect];
|
|
3716
3744
|
if (detect === "before" || detect === "after") return this.beforeAfter(node, detect);
|
|
3717
3745
|
else {
|
|
3718
3746
|
let method = "raw" + capitalize(detect);
|
|
@@ -3723,7 +3751,7 @@ var require_stringifier = /* @__PURE__ */ __commonJS({ "../../node_modules/postc
|
|
|
3723
3751
|
});
|
|
3724
3752
|
}
|
|
3725
3753
|
if (typeof value === "undefined") value = DEFAULT_RAW[detect];
|
|
3726
|
-
|
|
3754
|
+
cache[detect] = value;
|
|
3727
3755
|
return value;
|
|
3728
3756
|
}
|
|
3729
3757
|
rawBeforeClose(root$1) {
|
|
@@ -3844,11 +3872,15 @@ var require_stringifier = /* @__PURE__ */ __commonJS({ "../../node_modules/postc
|
|
|
3844
3872
|
}
|
|
3845
3873
|
root(node) {
|
|
3846
3874
|
this.body(node);
|
|
3847
|
-
if (node.raws.after)
|
|
3875
|
+
if (node.raws.after) {
|
|
3876
|
+
let after = node.raws.after;
|
|
3877
|
+
let isDocument = node.parent && node.parent.type === "document";
|
|
3878
|
+
this.builder(isDocument ? after : escapeHTMLInCSS(after));
|
|
3879
|
+
}
|
|
3848
3880
|
}
|
|
3849
3881
|
rule(node) {
|
|
3850
3882
|
this.block(node, this.rawValue(node, "selector"));
|
|
3851
|
-
if (node.raws.ownSemicolon) this.builder(node.raws.ownSemicolon, node, "end");
|
|
3883
|
+
if (node.raws.ownSemicolon) this.builder(escapeHTMLInCSS(node.raws.ownSemicolon), node, "end");
|
|
3852
3884
|
}
|
|
3853
3885
|
stringify(node, semicolon) {
|
|
3854
3886
|
/* c8 ignore start */
|
|
@@ -3933,7 +3965,7 @@ var require_node = /* @__PURE__ */ __commonJS({ "../../node_modules/postcss/lib/
|
|
|
3933
3965
|
this[my$2] = true;
|
|
3934
3966
|
for (let name in defaults) if (name === "nodes") {
|
|
3935
3967
|
this.nodes = [];
|
|
3936
|
-
for (let node of defaults[name]) if (typeof node.clone === "function") this.append(node.clone());
|
|
3968
|
+
for (let node of defaults[name]) if (typeof node.clone === "function" && node.parent) this.append(node.clone());
|
|
3937
3969
|
else this.append(node);
|
|
3938
3970
|
} else this[name] = defaults[name];
|
|
3939
3971
|
}
|
|
@@ -4022,10 +4054,14 @@ var require_node = /* @__PURE__ */ __commonJS({ "../../node_modules/postcss/lib/
|
|
|
4022
4054
|
return this.parent.nodes[index + 1];
|
|
4023
4055
|
}
|
|
4024
4056
|
positionBy(opts = {}) {
|
|
4025
|
-
let
|
|
4057
|
+
let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
|
|
4058
|
+
let pos = {
|
|
4059
|
+
column: this.source.start.column,
|
|
4060
|
+
line: this.source.start.line,
|
|
4061
|
+
offset: sourceOffset(inputString, this.source.start)
|
|
4062
|
+
};
|
|
4026
4063
|
if (opts.index) pos = this.positionInside(opts.index);
|
|
4027
4064
|
else if (opts.word) {
|
|
4028
|
-
let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
|
|
4029
4065
|
let index = inputString.slice(sourceOffset(inputString, this.source.start), sourceOffset(inputString, this.source.end)).indexOf(opts.word);
|
|
4030
4066
|
if (index !== -1) pos = this.positionInside(index);
|
|
4031
4067
|
}
|
|
@@ -4080,14 +4116,14 @@ var require_node = /* @__PURE__ */ __commonJS({ "../../node_modules/postcss/lib/
|
|
|
4080
4116
|
line: opts.start.line,
|
|
4081
4117
|
offset: sourceOffset(inputString, opts.start)
|
|
4082
4118
|
};
|
|
4083
|
-
else if (opts.index) start = this.positionInside(opts.index);
|
|
4119
|
+
else if (typeof opts.index === "number") start = this.positionInside(opts.index);
|
|
4084
4120
|
if (opts.end) end = {
|
|
4085
4121
|
column: opts.end.column,
|
|
4086
4122
|
line: opts.end.line,
|
|
4087
4123
|
offset: sourceOffset(inputString, opts.end)
|
|
4088
4124
|
};
|
|
4089
4125
|
else if (typeof opts.endIndex === "number") end = this.positionInside(opts.endIndex);
|
|
4090
|
-
else if (opts.index) end = this.positionInside(opts.index + 1);
|
|
4126
|
+
else if (typeof opts.index === "number") end = this.positionInside(opts.index + 1);
|
|
4091
4127
|
}
|
|
4092
4128
|
if (end.line < start.line || end.line === start.line && end.column <= start.column) end = {
|
|
4093
4129
|
column: start.column + 1,
|
|
@@ -6708,6 +6744,7 @@ var require_previous_map = /* @__PURE__ */ __commonJS({ "../../node_modules/post
|
|
|
6708
6744
|
var PreviousMap$2 = class {
|
|
6709
6745
|
constructor(css, opts) {
|
|
6710
6746
|
if (opts.map === false) return;
|
|
6747
|
+
if (opts.unsafeMap) this.unsafeMap = true;
|
|
6711
6748
|
this.loadAnnotation(css);
|
|
6712
6749
|
this.inline = this.startWith(this.annotation, "data:");
|
|
6713
6750
|
let prev = opts.map ? opts.map.prev : void 0;
|
|
@@ -6717,7 +6754,7 @@ var require_previous_map = /* @__PURE__ */ __commonJS({ "../../node_modules/post
|
|
|
6717
6754
|
if (text) this.text = text;
|
|
6718
6755
|
}
|
|
6719
6756
|
consumer() {
|
|
6720
|
-
if (!this.consumerCache) this.consumerCache = new SourceMapConsumer$2(this.text);
|
|
6757
|
+
if (!this.consumerCache) this.consumerCache = new SourceMapConsumer$2(this.json || this.text);
|
|
6721
6758
|
return this.consumerCache;
|
|
6722
6759
|
}
|
|
6723
6760
|
decodeInline(text) {
|
|
@@ -6727,7 +6764,8 @@ var require_previous_map = /* @__PURE__ */ __commonJS({ "../../node_modules/post
|
|
|
6727
6764
|
if (uriMatch) return decodeURIComponent(text.substr(uriMatch[0].length));
|
|
6728
6765
|
let baseUriMatch = text.match(baseCharsetUri) || text.match(baseUri);
|
|
6729
6766
|
if (baseUriMatch) return fromBase64(text.substr(baseUriMatch[0].length));
|
|
6730
|
-
let encoding = text.
|
|
6767
|
+
let encoding = text.slice(22);
|
|
6768
|
+
encoding = encoding.slice(0, encoding.indexOf(","));
|
|
6731
6769
|
throw new Error("Unsupported source map encoding " + encoding);
|
|
6732
6770
|
}
|
|
6733
6771
|
getAnnotationURL(sourceMapString) {
|
|
@@ -6744,7 +6782,11 @@ var require_previous_map = /* @__PURE__ */ __commonJS({ "../../node_modules/post
|
|
|
6744
6782
|
let end = css.indexOf("*/", start);
|
|
6745
6783
|
if (start > -1 && end > -1) this.annotation = this.getAnnotationURL(css.substring(start, end));
|
|
6746
6784
|
}
|
|
6747
|
-
loadFile(path$2) {
|
|
6785
|
+
loadFile(path$2, cssFile, trusted) {
|
|
6786
|
+
/* c8 ignore next 5 */
|
|
6787
|
+
if (!trusted && !this.unsafeMap) {
|
|
6788
|
+
if (!/\.map$/i.test(path$2)) return;
|
|
6789
|
+
}
|
|
6748
6790
|
this.root = dirname$2(path$2);
|
|
6749
6791
|
if (existsSync$2(path$2)) {
|
|
6750
6792
|
this.mapFile = path$2;
|
|
@@ -6757,7 +6799,7 @@ var require_previous_map = /* @__PURE__ */ __commonJS({ "../../node_modules/post
|
|
|
6757
6799
|
else if (typeof prev === "function") {
|
|
6758
6800
|
let prevPath = prev(file);
|
|
6759
6801
|
if (prevPath) {
|
|
6760
|
-
let map = this.loadFile(prevPath);
|
|
6802
|
+
let map = this.loadFile(prevPath, file, true);
|
|
6761
6803
|
if (!map) throw new Error("Unable to load previous source map: " + prevPath.toString());
|
|
6762
6804
|
return map;
|
|
6763
6805
|
}
|
|
@@ -6769,7 +6811,14 @@ var require_previous_map = /* @__PURE__ */ __commonJS({ "../../node_modules/post
|
|
|
6769
6811
|
else if (this.annotation) {
|
|
6770
6812
|
let map = this.annotation;
|
|
6771
6813
|
if (file) map = join$2(dirname$2(file), map);
|
|
6772
|
-
|
|
6814
|
+
let unknown = this.loadFile(map, file, false);
|
|
6815
|
+
if (unknown) try {
|
|
6816
|
+
/* c8 ignore next 4 */
|
|
6817
|
+
this.json = JSON.parse(unknown.replace(/^\)]}'[^\n]*\n/, ""));
|
|
6818
|
+
} catch {
|
|
6819
|
+
return;
|
|
6820
|
+
}
|
|
6821
|
+
return unknown;
|
|
6773
6822
|
}
|
|
6774
6823
|
}
|
|
6775
6824
|
startWith(string, start) {
|
|
@@ -6930,21 +6979,21 @@ var require_input = /* @__PURE__ */ __commonJS({ "../../node_modules/postcss/lib
|
|
|
6930
6979
|
if (!this.map) return false;
|
|
6931
6980
|
let consumer = this.map.consumer();
|
|
6932
6981
|
let from = consumer.originalPositionFor({
|
|
6933
|
-
column,
|
|
6982
|
+
column: column - 1,
|
|
6934
6983
|
line
|
|
6935
6984
|
});
|
|
6936
6985
|
if (!from.source) return false;
|
|
6937
6986
|
let to;
|
|
6938
6987
|
if (typeof endLine === "number") to = consumer.originalPositionFor({
|
|
6939
|
-
column: endColumn,
|
|
6988
|
+
column: endColumn - 1,
|
|
6940
6989
|
line: endLine
|
|
6941
6990
|
});
|
|
6942
6991
|
let fromUrl;
|
|
6943
6992
|
if (isAbsolute$1(from.source)) fromUrl = pathToFileURL$1(from.source);
|
|
6944
6993
|
else fromUrl = new URL(from.source, this.map.consumer().sourceRoot || pathToFileURL$1(this.map.mapFile));
|
|
6945
6994
|
let result = {
|
|
6946
|
-
column: from.column,
|
|
6947
|
-
endColumn: to && to.column,
|
|
6995
|
+
column: from.column + 1,
|
|
6996
|
+
endColumn: to && to.column + 1,
|
|
6948
6997
|
endLine: to && to.line,
|
|
6949
6998
|
line: from.line,
|
|
6950
6999
|
url: fromUrl.toString()
|
|
@@ -7119,18 +7168,28 @@ var require_fromJSON = /* @__PURE__ */ __commonJS({ "../../node_modules/postcss/
|
|
|
7119
7168
|
inputs.push(inputHydrated);
|
|
7120
7169
|
}
|
|
7121
7170
|
}
|
|
7122
|
-
|
|
7171
|
+
let nodes;
|
|
7172
|
+
if (defaults.nodes) {
|
|
7173
|
+
nodes = json.nodes.map((n) => fromJSON$2(n, inputs));
|
|
7174
|
+
delete defaults.nodes;
|
|
7175
|
+
}
|
|
7123
7176
|
if (defaults.source) {
|
|
7124
7177
|
let { inputId,...source } = defaults.source;
|
|
7125
7178
|
defaults.source = source;
|
|
7126
7179
|
if (inputId != null) defaults.source.input = inputs[inputId];
|
|
7127
7180
|
}
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
else if (defaults.type === "
|
|
7131
|
-
else if (defaults.type === "
|
|
7132
|
-
else if (defaults.type === "
|
|
7181
|
+
let node;
|
|
7182
|
+
if (defaults.type === "root") node = new Root$5(defaults);
|
|
7183
|
+
else if (defaults.type === "decl") node = new Declaration$3(defaults);
|
|
7184
|
+
else if (defaults.type === "rule") node = new Rule$3(defaults);
|
|
7185
|
+
else if (defaults.type === "comment") node = new Comment$3(defaults);
|
|
7186
|
+
else if (defaults.type === "atrule") node = new AtRule$3(defaults);
|
|
7133
7187
|
else throw new Error("Unknown node type: " + json.type);
|
|
7188
|
+
if (nodes) {
|
|
7189
|
+
node.nodes = nodes;
|
|
7190
|
+
for (let child of nodes) child.parent = node;
|
|
7191
|
+
}
|
|
7192
|
+
return node;
|
|
7134
7193
|
}
|
|
7135
7194
|
module.exports = fromJSON$2;
|
|
7136
7195
|
fromJSON$2.default = fromJSON$2;
|
|
@@ -7425,6 +7484,11 @@ var require_parser = /* @__PURE__ */ __commonJS({ "../../node_modules/postcss/li
|
|
|
7425
7484
|
if (pos) return pos;
|
|
7426
7485
|
}
|
|
7427
7486
|
}
|
|
7487
|
+
function tokensToString(tokens, from, to) {
|
|
7488
|
+
let result = "";
|
|
7489
|
+
for (let i = from; i < to; i++) result += tokens[i][1];
|
|
7490
|
+
return result;
|
|
7491
|
+
}
|
|
7428
7492
|
var Parser$1 = class {
|
|
7429
7493
|
constructor(input) {
|
|
7430
7494
|
this.input = input;
|
|
@@ -7566,40 +7630,41 @@ var require_parser = /* @__PURE__ */ __commonJS({ "../../node_modules/postcss/li
|
|
|
7566
7630
|
}
|
|
7567
7631
|
node.source.end = this.getPosition(last[3] || last[2] || findLastWithPosition(tokens));
|
|
7568
7632
|
node.source.end.offset++;
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
node.
|
|
7575
|
-
|
|
7576
|
-
|
|
7633
|
+
let start = 0;
|
|
7634
|
+
while (tokens[start][0] !== "word") {
|
|
7635
|
+
if (start === tokens.length - 1) this.unknownWord([tokens[start]]);
|
|
7636
|
+
start++;
|
|
7637
|
+
}
|
|
7638
|
+
node.raws.before += tokensToString(tokens, 0, start);
|
|
7639
|
+
node.source.start = this.getPosition(tokens[start][2]);
|
|
7640
|
+
let propStart = start;
|
|
7641
|
+
while (start < tokens.length) {
|
|
7642
|
+
let type = tokens[start][0];
|
|
7577
7643
|
if (type === ":" || type === "space" || type === "comment") break;
|
|
7578
|
-
|
|
7644
|
+
start++;
|
|
7579
7645
|
}
|
|
7580
|
-
node.
|
|
7646
|
+
node.prop = tokensToString(tokens, propStart, start);
|
|
7647
|
+
let betweenStart = start;
|
|
7581
7648
|
let token;
|
|
7582
|
-
while (tokens.length) {
|
|
7583
|
-
token = tokens
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
} else {
|
|
7588
|
-
if (token[0] === "word" && /\w/.test(token[1])) this.unknownWord([token]);
|
|
7589
|
-
node.raws.between += token[1];
|
|
7590
|
-
}
|
|
7649
|
+
while (start < tokens.length) {
|
|
7650
|
+
token = tokens[start];
|
|
7651
|
+
start++;
|
|
7652
|
+
if (token[0] === ":") break;
|
|
7653
|
+
if (token[0] === "word" && /\w/.test(token[1])) this.unknownWord([token]);
|
|
7591
7654
|
}
|
|
7655
|
+
node.raws.between = tokensToString(tokens, betweenStart, start);
|
|
7592
7656
|
if (node.prop[0] === "_" || node.prop[0] === "*") {
|
|
7593
7657
|
node.raws.before += node.prop[0];
|
|
7594
7658
|
node.prop = node.prop.slice(1);
|
|
7595
7659
|
}
|
|
7596
|
-
let
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
next = tokens[0][0];
|
|
7660
|
+
let firstSpacesStart = start;
|
|
7661
|
+
while (start < tokens.length) {
|
|
7662
|
+
let next = tokens[start][0];
|
|
7600
7663
|
if (next !== "space" && next !== "comment") break;
|
|
7601
|
-
|
|
7664
|
+
start++;
|
|
7602
7665
|
}
|
|
7666
|
+
let firstSpaces = tokens.slice(firstSpacesStart, start);
|
|
7667
|
+
tokens = tokens.slice(start);
|
|
7603
7668
|
this.precheckMissedSemicolon(tokens);
|
|
7604
7669
|
for (let i = tokens.length - 1; i >= 0; i--) {
|
|
7605
7670
|
token = tokens[i];
|
|
@@ -8250,6 +8315,15 @@ var require_lazy_result = /* @__PURE__ */ __commonJS({ "../../node_modules/postc
|
|
|
8250
8315
|
if (opts.syntax) str = opts.syntax.stringify;
|
|
8251
8316
|
if (opts.stringifier) str = opts.stringifier;
|
|
8252
8317
|
if (str.stringify) str = str.stringify;
|
|
8318
|
+
let rootSource = this.result.root.source;
|
|
8319
|
+
if (opts.map === void 0 && !(rootSource && rootSource.input && rootSource.input.map)) {
|
|
8320
|
+
let result = "";
|
|
8321
|
+
str(this.result.root, (i) => {
|
|
8322
|
+
result += i;
|
|
8323
|
+
});
|
|
8324
|
+
this.result.css = result;
|
|
8325
|
+
return this.result;
|
|
8326
|
+
}
|
|
8253
8327
|
let data = new MapGenerator$1(str, this.result.root, this.result.opts).generate();
|
|
8254
8328
|
this.result.css = data[0];
|
|
8255
8329
|
this.result.map = data[1];
|
|
@@ -8379,7 +8453,7 @@ var require_lazy_result = /* @__PURE__ */ __commonJS({ "../../node_modules/postc
|
|
|
8379
8453
|
var require_no_work_result = /* @__PURE__ */ __commonJS({ "../../node_modules/postcss/lib/no-work-result.js": ((exports, module) => {
|
|
8380
8454
|
let MapGenerator = require_map_generator();
|
|
8381
8455
|
let parse$2 = require_parse();
|
|
8382
|
-
|
|
8456
|
+
let Result$2 = require_result();
|
|
8383
8457
|
let stringify$2 = require_stringify();
|
|
8384
8458
|
let warnOnce = require_warn_once();
|
|
8385
8459
|
var NoWorkResult$1 = class {
|
|
@@ -8483,7 +8557,7 @@ var require_processor = /* @__PURE__ */ __commonJS({ "../../node_modules/postcss
|
|
|
8483
8557
|
let Root$2 = require_root();
|
|
8484
8558
|
var Processor$2 = class {
|
|
8485
8559
|
constructor(plugins = []) {
|
|
8486
|
-
this.version = "8.5.
|
|
8560
|
+
this.version = "8.5.16";
|
|
8487
8561
|
this.plugins = this.normalize(plugins);
|
|
8488
8562
|
}
|
|
8489
8563
|
normalize(plugins) {
|
|
@@ -8930,9 +9004,84 @@ const logger = {
|
|
|
8930
9004
|
}
|
|
8931
9005
|
};
|
|
8932
9006
|
|
|
9007
|
+
//#endregion
|
|
9008
|
+
//#region src/utils/get-package-info.ts
|
|
9009
|
+
function getPackageInfo(cwd = "", shouldThrow = true) {
|
|
9010
|
+
const packageJsonPath = path$1.join(cwd, "package.json");
|
|
9011
|
+
return fs.readJSONSync(packageJsonPath, { throws: shouldThrow });
|
|
9012
|
+
}
|
|
9013
|
+
|
|
8933
9014
|
//#endregion
|
|
8934
9015
|
//#region src/utils/get-project-info.ts
|
|
9016
|
+
const PROJECT_SHARED_IGNORE = [
|
|
9017
|
+
"**/node_modules/**",
|
|
9018
|
+
".astro",
|
|
9019
|
+
"public",
|
|
9020
|
+
"dist",
|
|
9021
|
+
"build"
|
|
9022
|
+
];
|
|
8935
9023
|
const TS_CONFIG_SCHEMA = z.object({ compilerOptions: z.object({ paths: z.record(z.string(), z.string().or(z.array(z.string()))) }) });
|
|
9024
|
+
async function getProjectInfo(cwd) {
|
|
9025
|
+
const [configFiles, tailwindConfigFile, tailwindCssFile, tailwindVersion, aliasPrefix, packageJson] = await Promise.all([
|
|
9026
|
+
fg.glob("**/{next,vite,astro,app}.config.*|gatsby-config.*|composer.json|react-router.config.*", {
|
|
9027
|
+
cwd,
|
|
9028
|
+
deep: 3,
|
|
9029
|
+
ignore: PROJECT_SHARED_IGNORE
|
|
9030
|
+
}),
|
|
9031
|
+
getTailwindConfigFile(cwd),
|
|
9032
|
+
getTailwindCssFile(cwd),
|
|
9033
|
+
getTailwindVersion(cwd),
|
|
9034
|
+
getTsConfigAliasPrefix(cwd),
|
|
9035
|
+
getPackageInfo(cwd, false)
|
|
9036
|
+
]);
|
|
9037
|
+
const type = {
|
|
9038
|
+
isAstro: false,
|
|
9039
|
+
tailwindConfigFile,
|
|
9040
|
+
tailwindCssFile,
|
|
9041
|
+
tailwindVersion,
|
|
9042
|
+
aliasPrefix
|
|
9043
|
+
};
|
|
9044
|
+
if (configFiles.find((file) => file.startsWith("astro.config."))?.length) {
|
|
9045
|
+
type.isAstro = true;
|
|
9046
|
+
return type;
|
|
9047
|
+
}
|
|
9048
|
+
return type;
|
|
9049
|
+
}
|
|
9050
|
+
async function getTailwindVersion(cwd) {
|
|
9051
|
+
const [packageInfo, config] = await Promise.all([getPackageInfo(cwd, false), getConfig(cwd)]);
|
|
9052
|
+
if (config?.tailwind?.config === "") return "v4";
|
|
9053
|
+
if (!packageInfo?.dependencies?.tailwindcss && !packageInfo?.devDependencies?.tailwindcss) return null;
|
|
9054
|
+
if (/^(?:\^|~)?3(?:\.\d+)*(?:-.*)?$/.test(packageInfo?.dependencies?.tailwindcss || packageInfo?.devDependencies?.tailwindcss || "")) return "v3";
|
|
9055
|
+
return "v4";
|
|
9056
|
+
}
|
|
9057
|
+
async function getTailwindCssFile(cwd) {
|
|
9058
|
+
const [files, tailwindVersion] = await Promise.all([fg.glob(["**/*.css", "**/*.scss"], {
|
|
9059
|
+
cwd,
|
|
9060
|
+
deep: 5,
|
|
9061
|
+
ignore: PROJECT_SHARED_IGNORE
|
|
9062
|
+
}), getTailwindVersion(cwd)]);
|
|
9063
|
+
if (!files.length) return null;
|
|
9064
|
+
for (const file of files) {
|
|
9065
|
+
const contents = await fs.readFile(path$1.resolve(cwd, file), "utf8");
|
|
9066
|
+
if (contents.includes(`@import "tailwindcss"`) || contents.includes(`@import 'tailwindcss'`) || contents.includes(`@tailwind base`)) return file;
|
|
9067
|
+
}
|
|
9068
|
+
return null;
|
|
9069
|
+
}
|
|
9070
|
+
async function getTailwindConfigFile(cwd) {
|
|
9071
|
+
const files = await fg.glob("tailwind.config.*", {
|
|
9072
|
+
cwd,
|
|
9073
|
+
deep: 3,
|
|
9074
|
+
ignore: PROJECT_SHARED_IGNORE
|
|
9075
|
+
});
|
|
9076
|
+
if (!files.length) return null;
|
|
9077
|
+
return files[0];
|
|
9078
|
+
}
|
|
9079
|
+
async function getTsConfigAliasPrefix(cwd) {
|
|
9080
|
+
const tsConfig = await loadConfig(cwd);
|
|
9081
|
+
if (tsConfig?.resultType === "failed" || !Object.entries(tsConfig?.paths).length) return null;
|
|
9082
|
+
for (const [alias, paths] of Object.entries(tsConfig.paths)) if (paths.includes("./*") || paths.includes("./src/*") || paths.includes("./app/*") || paths.includes("./resources/js/*")) return alias.replace(/\/\*$/, "") ?? null;
|
|
9083
|
+
return Object.keys(tsConfig?.paths)?.[0].replace(/\/\*$/, "") ?? null;
|
|
9084
|
+
}
|
|
8936
9085
|
|
|
8937
9086
|
//#endregion
|
|
8938
9087
|
//#region src/utils/resolve-import.ts
|
|
@@ -9316,5 +9465,5 @@ function createSourceFileFromFrontmatter(frontmatterCode) {
|
|
|
9316
9465
|
}
|
|
9317
9466
|
|
|
9318
9467
|
//#endregion
|
|
9319
|
-
export {
|
|
9320
|
-
//# sourceMappingURL=utils-
|
|
9468
|
+
export { PRESET_RADII as $, getSemanticIconNameFromLucideExport as A, getHeadingFontValue as B, BASE_COLORS as C, buildRegistryTheme as D, ICON_LIBRARIES as E, designSystemConfigSchema as F, DEFAULT_PRESET_CONFIG as G, getStyleDefaultRadius as H, getDocumentDirection as I, PRESET_FONTS as J, PRESET_BASE_COLORS as K, getDocumentLanguage as L, renderSemanticIconSvgWithAttributeString as M, DEFAULT_DESIGN_SYSTEM_CONFIG as N, ICON_LIBRARY_COLLECTIONS as O, RTL_LANGUAGE_VALUES as P, PRESET_MENU_COLORS as Q, getFontPackageName as R, BEJAMAS_COMPONENTS_SCHEMA_URL as S, resolveRegistryUrl as T, getStyleId as U, getRadiusValue as V, normalizeDesignSystemConfig as W, PRESET_ICON_LIBRARIES as X, PRESET_FONT_HEADINGS as Y, PRESET_MENU_ACCENTS as Z, getConfig as _, extractComponentTagsFromMDX as a, isPresetCode as at, logger as b, extractPropsFromDeclaredProps as c, parseJsDocMetadata as d, PRESET_STYLES as et, resolveOutDir as f, spinner as g, toIdentifier as h, discoverExamples as i, encodePreset as it, getSemanticIconNameFromLucidePath as j, SEMANTIC_ICON_NAMES as k, normalizeBlockMDX as l, slugify as m, createSourceFileFromFrontmatter as n, V1_CHART_COLOR_MAP as nt, extractFrontmatter as o, fonts as ot, resolveUiRoot as p, PRESET_CHART_COLORS as q, detectHasImportTopLevel as r, decodePreset as rt, extractPropsFromAstroProps as s, __require as st, RESERVED_COMPONENTS as t, PRESET_THEMES as tt, normalizeUsageMDX as u, getWorkspaceConfig as v, buildUiUrl as w, highlighter as x, getProjectInfo as y, getFontValue as z };
|
|
9469
|
+
//# sourceMappingURL=utils-CyYWo_qS.js.map
|