styless 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/assets/js/jit.js CHANGED
@@ -1,90 +1,9 @@
1
- "use strict";
2
-
3
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
-
5
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
-
7
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
-
9
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
10
-
11
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
12
-
13
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
14
-
15
- (function (window) {
16
- var moonHare = {};
17
- moonHare.variants = {};
18
- moonHare.plugins = {};
19
- moonHare.filters = [];
20
- moonHare.styleEl = window.document.createElement('style');
21
- moonHare.styleEl.id = 'MOONHARE_STYLE_ELEMENT'; // Append <style> element to <head>
22
-
23
- window.document.head.appendChild(moonHare.styleEl); // @copyright - jQuery(https://tldrlegal.com/license/mit-license)
24
- // @reference https://github.com/jquery/jquery/blob/main/src/selector/escapeSelector.js
25
-
26
- moonHare.escapeSelector = function (sel) {
27
- var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
28
-
29
- function fcssescape(ch, asCodePoint) {
30
- if (asCodePoint) {
31
- if (ch === "\0") {
32
- return "\uFFFD";
33
- }
34
-
35
- return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " ";
36
- }
37
-
38
- return "\\" + ch;
39
- }
40
-
41
- return (sel + "").replace(rcssescape, fcssescape);
42
- };
43
-
44
- moonHare.defaultVariant = function (parts) {
45
- if (parts.length === 1) {
46
- Object.keys(this.plugins).forEach(function (pluginName) {
47
- if (parts[0].startsWith(pluginName)) return this.plugins[pluginName].call(this, parts);
48
- }, this);
49
- return ['', ''];
50
- }
51
-
52
- if (parts.length === 2) {
53
- return ['.' + this.escapeSelector(parts.join(':')), "{".concat(parts[0], ": ").concat(parts[1], ";}")];
54
- }
55
-
56
- return ['', ''];
57
- };
58
-
59
- moonHare.addStyles = function (styles) {
60
- this.styleEl.innerHTML = styles;
61
- };
62
-
63
- moonHare.clearStyles = function () {
64
- this.styleEl.innerHTML = '';
65
- };
66
-
67
- moonHare.generateStyles = function () {
68
- var classList = [];
69
-
70
- _toConsumableArray(window.document.querySelectorAll('*')).forEach(function (el) {
71
- return classList = [].concat(_toConsumableArray(classList), _toConsumableArray(el.classList));
72
- });
73
-
74
- var styleSheet = classList.map(function (cls) {
75
- var parts = cls.split(':');
76
- return (this.variants[parts[0]] || this.defaultVariant).call(this, parts);
77
- }, this);
78
- this.filters.forEach(function (filter) {
79
- styleSheet = filter.call(this, styleSheet);
80
- }, this);
81
- return styleSheet.flat().join('');
82
- };
83
-
84
- moonHare.start = function () {
85
- this.addStyles(this.generateStyles());
86
- };
87
-
88
- if (window.document.readyState != 'loading') moonHare.start();else window.document.addEventListener('DOMContentLoaded', function(){moonHare.start()});
89
- window.moonHare = moonHare;
90
- })(window);
1
+ (function(g){var d={u:function(a){a=a||{};for(var c=1;c<arguments.length;c++){var b=arguments[c];if(b)for(var e in b)b.hasOwnProperty(e)&&(a[e]="object"===typeof b[e]?1==b[e]instanceof Array?b[e].slice(0):this.u(a[e],b[e]):b[e])}return a},g:function(a,c){return function(b,e){return this.l(b.slice(1),a+e+c)}},j:function(a){return function(c,b){var e=this.l(c.slice(1),b);e&&(e[1]=e[0]+"{"+e[1]+"}",e[0]=a);return e}},N:function(a,c){return function(b){return a+":"+b.join(c)}}};d.h=d.u({D:"class",B:{s:{O:"640px",
2
+ L:"768px",K:"1024px",P:"1280px",R:"1536px"}},o:"first last odd even visited checked group-hover group-focus focus-within hover focus focus-visible active disabled dark sm md lg xl xxl".split(" "),i:{first:d.g("",":first"),last:d.g("",":last"),odd:d.g("",":nth-child(odd)"),even:d.g("",":nth-child(even)"),visited:d.g("",":visited"),checked:d.g("",":checked"),"group-hover":d.g(".group:hover ",""),"group-focus":d.g(".group:focus ",""),"focus-within":d.g("",":focus-within"),hover:d.g("",":hover"),focus:d.g("",
3
+ ":focus"),"focus-visible":d.g("",":focus-visible"),active:d.g("",":active"),disabled:d.g("",":disabled")},plugins:{object:function(a){return["fill","contain","cover","none","scale"].indexOf(a[0])?"object-fit:"+a.join("-"):"object-position:"+a.join(" ")},overflow:function(a){return"overflow:"+a.join(" ")},"overflow-x":function(a){return"overflow-x:"+a.join(" ")},"overflow-y":function(a){return"overflow-y:"+a.join(" ")},z:function(a){return"z-index:"+a[0]},visible:function(){return"visibility:visible"},
4
+ invisible:function(){return"visibility:hidden"},text:function(a){return(["left","center","right","justify"].indexOf(a[0])?"text-align:":"color:")+a[0]}}},g.I||{});d.cache={};Object.keys(d.h.B.s).forEach(function(a){var c=d.h,b=c.B,e=b.s[a],f=e.replace(parseFloat(e),parseFloat(e)-.1);b=(b=b.s[c.o[c.o.indexOf(a)+1]])?b.replace(parseFloat(b),parseFloat(b)-.1):void 0;c.i[a]||(c.i[a]=d.j("@media(min-width:breakpoint)".replace("breakpoint",e)));c.i["<"+a]||(c.i["<"+a]=d.j("@media(max-width:breakpoint)".replace("breakpoint",
5
+ f)));!c.i["@"+a]&&b&&(c.i["@"+a]=d.j("@media(min-width:breakpoint) and (max-width:next)".replace("breakpoint",e).replace("next",b)))});d.h.i.J="media"===d.h.D?d.j("@media(prefers-color-scheme:dark)"):function(a,c){var b=this.l(a.slice(1),c);b[0]=".dark "+b[0];return b};d.m=document.createElement("style");d.m.id="MOONHARE_STYLE_ELEMENT";d.m.innerHTML=" ";document.head.appendChild(d.m);d.styleSheet=d.m.sheet;d.G=function(a){return(a+"").replace(/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,function(c,
6
+ b){return b?"\x00"===c?"\ufffd":c.slice(0,-1)+"\\"+c.charCodeAt(c.length-1).toString(16)+" ":"\\"+c})};d.F=function(a,c){if(1===a.length){for(var b=a[0].split("-"),e=0;e<b.length;e++)for(var f in this.h.plugins)if(b.slice(0,b.length-e).join("-")===f)return[c,this.h.plugins[f].call(this,b.slice(b.length-e),a[0])];e=a[0].split("[");if(2===e.length&&CSS.supports(e[0].slice(0,-1),e[1].slice(0,-1).replace(/\|/g," ")))return[c,e[0].slice(0,-1)+":"+e[1].slice(0,-1).replace(/\|/g," ")+";"];if(CSS.supports(b.slice(0,
7
+ -1).join("-"),b.slice(-1)[0].replace(/\|/g," ")))return[c,b.slice(0,-1).join("-")+":"+b.slice(-1)[0].replace(/\|/g," ")+";"]}};d.v=function(){[].forEach.call(g.document.querySelectorAll("*"),function(a){[].forEach.call(a.classList,function(c){this.A(c)},this)},this)};d.C=function(a,c,b,e){Object.keys(this.cache).forEach(function(f){var h=f.split(":");b.forEach(function(k,l){this.h.o.indexOf(k)>this.h.o.indexOf(h[l])&&(this.cache[e]=this.cache[f],this.styleSheet.addRule(a,c,this.cache[f]),this.cache[f]+=
8
+ 1)},this)},this);this.styleSheet.addRule(a,c,this.styleSheet.cssRules.length);this.cache[e]=this.styleSheet.cssRules.length};d.l=function(a,c){return(this.h.i[a[0]]||this.F).call(this,a,c)};d.A=function(a){if(!(a in this.cache)){var c=a.split(":"),b=this.l(c,"."+this.G(a));b&&this.C(b[0],b[1],c,a)}};d.H=function(){var a=this;"function"==typeof MutationObserver&&(new MutationObserver(function(c){c.forEach(function(b){[].forEach.call(b.target.classList,function(e){a.A(e)})})})).observe(document.documentElement,
9
+ {attributes:!0,attributeFilter:["class"],subtree:!0,childList:!0})};d.start=function(){var a=this;"loading"!=g.document.readyState?this.v():g.document.addEventListener("DOMContentLoaded",function(){return a.v()})};g.M=d;d.start();d.H()})(window);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: styless
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kavindu Santhusa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-23 00:00:00.000000000 Z
11
+ date: 2021-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -97,6 +97,7 @@ files:
97
97
  - README.md
98
98
  - _includes/head.html
99
99
  - _includes/nav.html
100
+ - _includes/search/algolia.html
100
101
  - _layouts/default.html
101
102
  - _layouts/home.html
102
103
  - _layouts/page.html