@bamboocss/shared 1.11.1 → 1.11.3
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/astish.cjs +19 -0
- package/dist/astish.d.cts +4 -0
- package/dist/astish.d.mts +4 -0
- package/dist/astish.mjs +17 -20
- package/dist/index.cjs +1357 -0
- package/dist/index.d.cts +284 -0
- package/dist/index.d.mts +284 -0
- package/dist/index.mjs +724 -898
- package/dist/normalize-html.cjs +17 -0
- package/dist/normalize-html.d.cts +9 -0
- package/dist/normalize-html.d.mts +9 -0
- package/dist/normalize-html.mjs +11 -7
- package/dist/shared.cjs +304 -0
- package/dist/shared.d.cts +102 -0
- package/dist/shared.d.mts +102 -0
- package/dist/shared.mjs +240 -283
- package/package.json +9 -9
- package/dist/astish.js +0 -46
- package/dist/index.js +0 -1557
- package/dist/normalize-html.js +0 -37
- package/dist/shared.js +0 -373
package/dist/astish.cjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/astish.ts
|
|
3
|
+
const newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
|
|
4
|
+
const ruleClean = /\/\*[^]*?\*\/| +/g;
|
|
5
|
+
const ruleNewline = /\n+/g;
|
|
6
|
+
const empty = " ";
|
|
7
|
+
const astish = (val, tree = [{}]) => {
|
|
8
|
+
if (!val) return tree[0];
|
|
9
|
+
let block, left;
|
|
10
|
+
while (block = newRule.exec(val.replace(ruleClean, ""))) if (block[4]) tree.shift();
|
|
11
|
+
else if (block[3]) {
|
|
12
|
+
left = block[3].replace(ruleNewline, empty).trim();
|
|
13
|
+
if (!left.includes("&") && !left.startsWith("@")) left = "& " + left;
|
|
14
|
+
tree.unshift(tree[0][left] = tree[0][left] || {});
|
|
15
|
+
} else tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
|
|
16
|
+
return tree[0];
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.astish = astish;
|
package/dist/astish.mjs
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
return tree[0];
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
astish
|
|
1
|
+
//#region src/astish.ts
|
|
2
|
+
const newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
|
|
3
|
+
const ruleClean = /\/\*[^]*?\*\/| +/g;
|
|
4
|
+
const ruleNewline = /\n+/g;
|
|
5
|
+
const empty = " ";
|
|
6
|
+
const astish = (val, tree = [{}]) => {
|
|
7
|
+
if (!val) return tree[0];
|
|
8
|
+
let block, left;
|
|
9
|
+
while (block = newRule.exec(val.replace(ruleClean, ""))) if (block[4]) tree.shift();
|
|
10
|
+
else if (block[3]) {
|
|
11
|
+
left = block[3].replace(ruleNewline, empty).trim();
|
|
12
|
+
if (!left.includes("&") && !left.startsWith("@")) left = "& " + left;
|
|
13
|
+
tree.unshift(tree[0][left] = tree[0][left] || {});
|
|
14
|
+
} else tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
|
|
15
|
+
return tree[0];
|
|
21
16
|
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { astish };
|