fscss 1.1.12 → 1.1.13
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 +2 -3
- package/exec.js +2 -1
- package/index.js +3 -1
- package/lib/functions/all.js +3 -1
- package/lib/functions/procImp.js +1 -1
- package/package.json +23 -23
- package/xfscss.js +2 -1
- package/style.css +0 -9
package/README.md
CHANGED
|
@@ -70,9 +70,9 @@ Or locally to your project:
|
|
|
70
70
|
|
|
71
71
|
`npm install fscss`
|
|
72
72
|
|
|
73
|
-
**CDN**
|
|
73
|
+
**Browser CDN**
|
|
74
74
|
```html
|
|
75
|
-
<script src="https://cdn.jsdelivr.net/npm/fscss@1.1.
|
|
75
|
+
<script src="https://cdn.jsdelivr.net/npm/fscss@1.1.13/exec.min.js" defer></script>
|
|
76
76
|
```
|
|
77
77
|
Usage
|
|
78
78
|
|
|
@@ -99,7 +99,6 @@ Extensible with plugins
|
|
|
99
99
|
---
|
|
100
100
|
|
|
101
101
|
### https://fscss.devtem.org/
|
|
102
|
-
### https://opencollective.com/fscss
|
|
103
102
|
|
|
104
103
|
---
|
|
105
104
|
|
package/exec.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
const DOMFSCSSEng = (async ()=>{var fsTc=document.createElement('script');fsTc.type = 'text/javascript';fsTc.async='true';fsTc.src='https://cdn.jsdelivr.net/gh/Figsh/FSCSS@main/rtF4.js';var sTcZB=document.createElement('script');sTcZB.type = 'text/javascript';sTcZB.async='true';sTcZB.text='fs_cssText = (0);';document.body.appendChild(fsTc);fstylesheet=document.querySelectorAll("[type*='fscss']");for(c=0;c<fstylesheet.length;c++){fetch(fstylesheet[c].href).then(response => response.text()).then(data => {document.body.innerHTML+=`<style>${data}</style>`;}).catch(error => {});}
|
|
2
2
|
var text ='text';var url ='fromUrl';var fromUrl = 'fromUrl';var write = 'text';function inf(host,jsdl){if(typeof jsdl!=='undefined'&&host!=='undefined'){var ht=host.replace(/github/gi, 'gh');var cov=jsdl.replace(/\s*-\>\s*/g, '/').replace(/\n/g, '');var url=`https://cdn.jsdelivr.net/${ht}/${cov}`;var ScrT=document.createElement('script');ScrT.type='text/javascript';ScrT.async='true';ScrT.src=url;document.body.appendChild(ScrT);}}function exec(text,fscss_style_sheet){if(typeof fscss_style_sheet!=='undefined'&&text=='text'){var doc=document;
|
|
3
3
|
const AJWinDocStyleElement = document.createElement("style");
|
|
4
4
|
AJWinDocStyleElement.innerHTML = `${fscss_style_sheet}`;
|
|
@@ -6,4 +6,5 @@ document.head.appendChild(AJWinDocStyleElement);
|
|
|
6
6
|
}else if(typeof fscss_style_sheet!=='undefined'&&text=='fromUrl'){var doc=document;fetch(fscss_style_sheet).then(response =>response.text()).then(data=>{const AJWinDocStyleElement = document.createElement("style");
|
|
7
7
|
AJWinDocStyleElement.innerHTML = `${data}`;
|
|
8
8
|
document.head.appendChild(AJWinDocStyleElement);}).catch(error=>{});}}
|
|
9
|
+
})()
|
|
9
10
|
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
const DOMFSCSSEng = (async ()=>{var fsTc=document.createElement('script');fsTc.type = 'text/javascript';fsTc.async='true';fsTc.src='https://cdn.jsdelivr.net/gh/Figsh/FSCSS@main/rtF4.js';var sTcZB=document.createElement('script');sTcZB.type = 'text/javascript';sTcZB.async='true';sTcZB.text='fs_cssText = (0);';document.body.appendChild(fsTc);fstylesheet=document.querySelectorAll("[type*='fscss']");for(c=0;c<fstylesheet.length;c++){fetch(fstylesheet[c].href).then(response => response.text()).then(data => {document.body.innerHTML+=`<style>${data}</style>`;}).catch(error => {});}
|
|
2
2
|
var text ='text';var url ='fromUrl';var fromUrl = 'fromUrl';var write = 'text';function inf(host,jsdl){if(typeof jsdl!=='undefined'&&host!=='undefined'){var ht=host.replace(/github/gi, 'gh');var cov=jsdl.replace(/\s*-\>\s*/g, '/').replace(/\n/g, '');var url=`https://cdn.jsdelivr.net/${ht}/${cov}`;var ScrT=document.createElement('script');ScrT.type='text/javascript';ScrT.async='true';ScrT.src=url;document.body.appendChild(ScrT);}}function exec(text,fscss_style_sheet){if(typeof fscss_style_sheet!=='undefined'&&text=='text'){var doc=document;
|
|
3
3
|
const AJWinDocStyleElement = document.createElement("style");
|
|
4
4
|
AJWinDocStyleElement.innerHTML = `${fscss_style_sheet}`;
|
|
@@ -6,3 +6,5 @@ document.head.appendChild(AJWinDocStyleElement);
|
|
|
6
6
|
}else if(typeof fscss_style_sheet!=='undefined'&&text=='fromUrl'){var doc=document;fetch(fscss_style_sheet).then(response =>response.text()).then(data=>{const AJWinDocStyleElement = document.createElement("style");
|
|
7
7
|
AJWinDocStyleElement.innerHTML = `${data}`;
|
|
8
8
|
document.head.appendChild(AJWinDocStyleElement);}).catch(error=>{});}}
|
|
9
|
+
})()
|
|
10
|
+
|
package/lib/functions/all.js
CHANGED
|
@@ -22,13 +22,15 @@ function procNum(css){
|
|
|
22
22
|
const regex = /num\((.*?)\)/g;
|
|
23
23
|
function evaluateExpression(expression) {
|
|
24
24
|
try {
|
|
25
|
-
|
|
25
|
+
// function instead
|
|
26
|
+
return new Function(`return ${expression}`)();
|
|
26
27
|
} catch (e) {
|
|
27
28
|
console.error('Invalid expression:', expression);
|
|
28
29
|
return expression;
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
|
|
33
|
+
|
|
32
34
|
const processedCSS = css.replace(regex, (match, expression) => {
|
|
33
35
|
|
|
34
36
|
return evaluateExpression(expression);
|
package/lib/functions/procImp.js
CHANGED
|
@@ -37,7 +37,7 @@ export async function procImp(css, { inputDir }) {
|
|
|
37
37
|
}
|
|
38
38
|
importedContent = fs.readFileSync(absPath, "utf8");
|
|
39
39
|
|
|
40
|
-
//
|
|
40
|
+
// recursive support (nested imports)
|
|
41
41
|
importedContent = await procImp(importedContent, {
|
|
42
42
|
inputDir: path.dirname(absPath),
|
|
43
43
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fscss",
|
|
3
|
-
"version": "1.1.12",
|
|
4
3
|
"description": "Figured Shorthand Cascading Style Sheet",
|
|
4
|
+
"version": "1.1.13",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"fscss": "bin/fscss.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"start": "node index.js",
|
|
12
|
+
"test": "node bin/fscss.js example.fscss example.css"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/Figsh/xfscss.git"
|
|
17
|
+
},
|
|
5
18
|
"keywords": [
|
|
6
19
|
"node",
|
|
7
20
|
"figsh_css",
|
|
@@ -10,34 +23,21 @@
|
|
|
10
23
|
"xfscss",
|
|
11
24
|
"preprocessor"
|
|
12
25
|
],
|
|
13
|
-
"
|
|
26
|
+
"author": "Figsh",
|
|
27
|
+
"license": "MIT",
|
|
14
28
|
"bugs": {
|
|
15
29
|
"url": "https://github.com/Figsh/xfscss/issues"
|
|
16
30
|
},
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
"
|
|
31
|
+
"homepage": "https://github.com/Figsh/xfscss#readme",
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"dotenv": "^16.0.3",
|
|
34
|
+
"express": "^4.18.2"
|
|
20
35
|
},
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"main": "lib/index.js",
|
|
25
|
-
"bin": {
|
|
26
|
-
"fscss": "bin/fscss.js"
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"chai": "^4.3.4",
|
|
38
|
+
"mocha": "^10.0.0"
|
|
27
39
|
},
|
|
28
40
|
"directories": {
|
|
29
41
|
"lib": "lib"
|
|
30
|
-
},
|
|
31
|
-
"scripts": {
|
|
32
|
-
"start": "node index.js",
|
|
33
|
-
"test": "node bin/fscss.js example.fscss example.css"
|
|
34
|
-
},
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"express": "^4.18.2",
|
|
37
|
-
"dotenv": "^16.0.3"
|
|
38
|
-
},
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"mocha": "^10.0.0",
|
|
41
|
-
"chai": "^4.3.4"
|
|
42
42
|
}
|
|
43
43
|
}
|
package/xfscss.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export var text='text';export var url='fromUrl';export var external='fromUrl';export var fromUrl='fromUrl';export var write='text';function inf(host,jsdl){if(typeof jsdl!=='undefined'&&host!=='undefined'){var ht=host.replace(/github/gi, 'gh');var cov=jsdl.replace(/\s*-\>\s*/g, '/').replace(/\n/g, '');var url=`https://cdn.jsdelivr.net/${ht}/${cov}`;var ScrT=document.createElement('script');ScrT.type='text/javascript';ScrT.async='true';ScrT.src=url;document.body.appendChild(ScrT);}}function exec(text,fscss_style_sheet){if(typeof fscss_style_sheet !== 'undefined' && text == 'text'){var doc=document;var SrT = doc.createElement('script');
|
|
2
|
-
SrT.type='text/javascript';SrT.async='true';SrT.src='https://cdn.jsdelivr.net/gh/Figsh/FSCSS@main/rtF4.js';doc.body.appendChild(SrT);doc.body.innerHTML += (`<style>${fscss_style_sheet}</style>`);}else if(typeof fscss_style_sheet!=='undefined'&&text=='fromUrl'){var doc=document;var SrT=doc.createElement('script');SrT.type = 'text/javascript';SrT.async='true';SrT.src= 'https://
|
|
2
|
+
SrT.type='text/javascript';SrT.async='true';SrT.src='https://cdn.jsdelivr.net/gh/Figsh/FSCSS@main/rtF4.js';doc.body.appendChild(SrT);doc.body.innerHTML += (`<style>${fscss_style_sheet}</style>`);}else if(typeof fscss_style_sheet!=='undefined'&&text=='fromUrl'){var doc=document;var SrT=doc.createElement('script');SrT.type = 'text/javascript';SrT.async='true';SrT.src= 'https://cdn.jsdelivr.net/gh/Figsh/FSCSS@main/rtF4.js';doc.body.appendChild(SrT);fetch(fscss_style_sheet).then(response =>response.text()).then(data=>{const AJWinDocStyleElement = document.createElement("style");
|
|
3
3
|
AJWinDocStyleElement.innerHTML = `${data}`;
|
|
4
4
|
document.head.appendChild(AJWinDocStyleElement);}).catch(error=>{});}}export{ inf };export{ exec };
|
|
5
|
+
|
package/style.css
DELETED