xeerpe 0.0.7 → 0.0.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/dist/animations.css +29 -0
- package/dist/core/builder.d.ts +12 -8
- package/dist/core/builder.d.ts.map +1 -1
- package/dist/generators/animations.d.ts +7 -0
- package/dist/generators/animations.d.ts.map +1 -0
- package/dist/generators/index.d.ts +2 -0
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/models/animation.d.ts +8 -0
- package/dist/models/animation.d.ts.map +1 -0
- package/dist/models/builder.d.ts +2 -1
- package/dist/models/builder.d.ts.map +1 -1
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.d.ts.map +1 -1
- package/package.json +6 -3
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@keyframes xeerpe-pulse {
|
|
2
|
+
0%, 100% {
|
|
3
|
+
opacity: 1;
|
|
4
|
+
}
|
|
5
|
+
50% {
|
|
6
|
+
opacity: 0.7;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@keyframes xeerpe-rotate {
|
|
11
|
+
from {
|
|
12
|
+
transform: rotate(0deg);
|
|
13
|
+
}
|
|
14
|
+
to {
|
|
15
|
+
transform: rotate(360deg);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@keyframes xeerpe-breathe {
|
|
20
|
+
0% {
|
|
21
|
+
background-size: 100% 100%;
|
|
22
|
+
}
|
|
23
|
+
50% {
|
|
24
|
+
background-size: 120% 120%;
|
|
25
|
+
}
|
|
26
|
+
100% {
|
|
27
|
+
background-size: 100% 100%;
|
|
28
|
+
}
|
|
29
|
+
}
|
package/dist/core/builder.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EffectOptions, EffectType, NoiseOptions, VignetteOptions, GrainOptions, BlurOptions, FilterType, FilterOptions, GlowOptions, PatternOptions, PatternType, DotsOptions, GridOptions } from "../models/index.ts";
|
|
1
|
+
import { EffectOptions, EffectType, NoiseOptions, VignetteOptions, GrainOptions, BlurOptions, FilterType, FilterOptions, GlowOptions, PatternOptions, PatternType, DotsOptions, GridOptions, AnimationOptions, AnimationType } from "../models/index.ts";
|
|
2
2
|
import { ConicGradientOptions, GradientOptions, GradientType, LinearGradientOptions, MeshGradientOptions, RadialGradientOptions } from "../models/index.ts";
|
|
3
3
|
export declare class Builder {
|
|
4
4
|
private _layers;
|
|
@@ -10,13 +10,17 @@ export declare class Builder {
|
|
|
10
10
|
effect(type: EffectType, options: EffectOptions): this;
|
|
11
11
|
filter(type: FilterType, options: FilterOptions): this;
|
|
12
12
|
pattern(type: PatternType, options: PatternOptions): this;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
animation(type: AnimationType, options: AnimationOptions): this;
|
|
14
|
+
noise(options?: NoiseOptions): this;
|
|
15
|
+
vignette(options?: VignetteOptions): this;
|
|
16
|
+
grain(options?: GrainOptions): this;
|
|
17
|
+
glow(options?: GlowOptions): this;
|
|
18
|
+
blur(options?: BlurOptions): this;
|
|
19
|
+
dots(options?: DotsOptions): this;
|
|
20
|
+
grid(options?: GridOptions): this;
|
|
21
|
+
pulse(options?: AnimationOptions): this;
|
|
22
|
+
rotate(options?: AnimationOptions): this;
|
|
23
|
+
breathe(options?: AnimationOptions): this;
|
|
20
24
|
toStyle(): Record<string, string>;
|
|
21
25
|
toTextStyle(): any;
|
|
22
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/core/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,aAAa,EACb,UAAU,EACV,YAAY,EACZ,eAAe,EACf,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAC3G,WAAW,
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/core/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,aAAa,EACb,UAAU,EACV,YAAY,EACZ,eAAe,EACf,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAC3G,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAC/C,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,EACH,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,qBAAa,OAAO;IAChB,OAAO,CAAC,OAAO,CAAsB;IAErC,QAAQ,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAM5D,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAIpD,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAIpD,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI;IAIlD,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI;IAIhD,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,GAAG,IAAI;IAMtD,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,GAAG,IAAI;IAMtD,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI;IAMzD,SAAS,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI;IAM/D,KAAK,CAAC,OAAO,GAAE,YAAiB,GAAG,IAAI;IAIvC,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG,IAAI;IAI7C,KAAK,CAAC,OAAO,GAAE,YAAiB,GAAG,IAAI;IAIvC,IAAI,CAAC,OAAO,GAAE,WAAgB,GAAG,IAAI;IAIrC,IAAI,CAAC,OAAO,GAAE,WAAgB,GAAG,IAAI;IAIrC,IAAI,CAAC,OAAO,GAAE,WAAgB,GAAG,IAAI;IAIrC,IAAI,CAAC,OAAO,GAAE,WAAgB,GAAG,IAAI;IAIrC,KAAK,CAAC,OAAO,GAAE,gBAAqB,GAAG,IAAI;IAI3C,MAAM,CAAC,OAAO,GAAE,gBAAqB,GAAG,IAAI;IAI5C,OAAO,CAAC,OAAO,GAAE,gBAAqB,GAAG,IAAI;IAI7C,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IA6CjC,WAAW,IAAI,GAAG;CAWrB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AnimationOptions, AnimationType, BuilderLayer } from "../models/index.ts";
|
|
2
|
+
export declare const generatePulseAnimation: (options: AnimationOptions) => string;
|
|
3
|
+
export declare const generateRotateAnimation: (options: AnimationOptions) => string;
|
|
4
|
+
export declare const generateBreatheAnimation: (options: AnimationOptions) => string;
|
|
5
|
+
export declare const buildAnimationByType: (type: AnimationType, options: AnimationOptions) => string;
|
|
6
|
+
export declare const buildAnimationLayer: (type: AnimationType, options: AnimationOptions) => BuilderLayer;
|
|
7
|
+
//# sourceMappingURL=animations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animations.d.ts","sourceRoot":"","sources":["../../src/generators/animations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAgB,MAAM,oBAAoB,CAAC;AAEhG,eAAO,MAAM,sBAAsB,GAAI,SAAS,gBAAgB,KAAG,MAGlE,CAAA;AAED,eAAO,MAAM,uBAAuB,GAAI,SAAS,gBAAgB,KAAG,MAGnE,CAAA;AAED,eAAO,MAAM,wBAAwB,GAAI,SAAS,gBAAgB,KAAG,MAIpE,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,MAAM,aAAa,EAAE,SAAS,gBAAgB,WAWlF,CAAA;AAID,eAAO,MAAM,mBAAmB,GAAI,MAAM,aAAa,EAAE,SAAS,gBAAgB,KAAG,YAOpF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generators/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generators/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var t={};t.d=(e,r,n)=>{var a=(r,n)=>{for(var a in r)t.o(r,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,[n]:r[a]})};a(r,"get"),a(n,"value")},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};t.r(e),t.d(e,{Builder:()=>E,colors:()=>M});var r=/^-?\d*\.?\d+(%|px|rem|em|vh|vw|vmin|vmax)$/,n=/^calc\(.+\)$/,a=function(t){var e=t.trim();return r.test(e)||n.test(e)},o=/^-?\d*\.?\d+(deg|rad|grad|turn)$/,c=function(t){return o.test(t.trim())},i=["to top","to bottom","to left","to right","to top right","to bottom right","to top left","to bottom left"],u=function(t){if("string"==typeof t)return t;var e=t.color,r=t.position;return r&&a(r)?"".concat(e," ").concat(r):e},l=function(t){var e,r,n=t.angle&&c(t.angle)?t.angle:t.direction&&(e=t.direction,i.includes(e))?t.direction:"135deg",a=(null==(r=t.colors)?void 0:r.length)?t.colors.map(u).join(", "):"".concat(t.from,", ").concat(t.to),o=t.size?" ".concat(t.size):"";return"linear-gradient(".concat(n,", ").concat(a).concat(o,")")},f=function(t){var e,r,n=null===t.shape?"":"".concat(null!=(e=t.shape)?e:"circle"," "),a=t.size?" ".concat(t.size):"",o="at ".concat(null!=(r=t.position)?r:"center"),c=t.colorFromPosition?" ".concat(t.colorFromPosition):"",i=t.colorToPosition?" ".concat(t.colorToPosition):"",u="".concat(t.from).concat(c,", ").concat(t.to).concat(i);return"radial-gradient(".concat(n).concat(a," ").concat(o,", ").concat(u,")")},s=function(t){var e,r,n=t.angle&&c(t.angle)?"from ".concat(t.angle," "):"",a="at ".concat(null!=(e=t.position)?e:"center"),o=(null==(r=t.colors)?void 0:r.length)?t.colors.map(u).join(", "):"".concat(t.from,", ").concat(t.to);return"conic-gradient(".concat(n).concat(a,", ").concat(o,")")},d=function(t,e){switch(t){case"linear":return l(e);case"radial":return f(e);case"conic":return s(e);case"mesh":return e.layers.map(function(t){t.shape=null!=(e=t.shape)?e:null;var e,r=f(t);return"".concat(r)}).join(", ");default:throw Error("Unknown gradient type: ".concat(t))}},p=function(t,e){var r,n,a,o="mesh"===t;return{type:"gradient",properties:(r=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),n.forEach(function(e){var n;n=r[e],e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n})}return t}({},o&&{backgroundImage:d(t,e),backgroundColor:e.background},!o&&{background:d(t,e)}),n=n={backgroundSize:null!=(a=e.backgroundSize)?a:"auto"},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e.push.apply(e,r)}return e})(Object(n)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))}),r)}};function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var b=function(t){var e=t.replace("#",""),r=parseInt(3===e.length?e.split("").map(function(t){return t+t}).join(""):e,16);return{red:r>>16&255,green:r>>8&255,blue:255&r}},g=function(t,e){if(t.startsWith("#")){var r=b(t),n=r.red,a=r.green,o=r.blue;return"rgba(".concat(n,", ").concat(a,", ").concat(o,", ").concat(e,")")}return t.startsWith("rgb(")?t.replace("rgb(","rgba(").replace(")",", ".concat(e,")")):t.startsWith("hsl(")?t.replace("hsl(","hsla(").replace(")",", ".concat(e,")")):t},h=function(t,e,r){return Math.min(r,Math.max(e,t))},y=function(t){var e=t.trim().match(/^(-?\d*\.?\d+)([a-z%]*)$/i);if(!e)throw Error('Invalid CSS length: "'.concat(t,'"'));var r=function(t){if(Array.isArray(t))return t}(e)||function(t){var e,r,n=null==t?null:"u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var a=[],o=!0,c=!1;try{for(n=n.call(t);!(o=(e=n.next()).done)&&(a.push(e.value),3!==a.length);o=!0);}catch(t){c=!0,r=t}finally{try{o||null==n.return||n.return()}finally{if(c)throw r}}return a}}(e)||function(t){if(t){if("string"==typeof t)return v(t,3);var e=Object.prototype.toString.call(t).slice(8,-1);if("Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return v(t,3)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=r[1],a=r[2];return{value:parseFloat(n),unit:a||"px"}},m=function(t){var e=t.opacity,r=t.scale,n=t.type,a=t.octaves,o=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">\n <filter id="n">\n <feTurbulence type="'.concat(void 0===n?"fractalNoise":n,'" baseFrequency="').concat(void 0===r?.65:r,'" numOctaves="').concat(void 0===a?16:a,'" stitchTiles="stitch"/>\n <feColorMatrix type="saturate" values="0"/>\n </filter>\n <rect width="100%" height="100%" filter="url(#n)" opacity="').concat(void 0===e?.25:e,'"/>\n </svg>'));return'url("data:image/svg+xml,'.concat(o,'")')},k=function(t){var e=t.color,r=t.intensity,n=t.spread,a=g(void 0===e?"#000000":e,h(void 0===r?.2:r,0,1)),o=Math.round(100*(void 0===n?.2:n));return"radial-gradient(ellipse at center, transparent ".concat(100-o,"%, ").concat(a," 100%)")},w=function(t){var e=t.intensity,r=t.size,n=void 0===r?"100%":r,a=t.animated,o=h(.08*(void 0===e?1:e),.01,.12),c=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(n,'" height="').concat(n,'" viewBox="0 0 100% 100%">\n <filter id="g" x="0" y="0" width="').concat(n,'" height="').concat(n,'">\n ').concat(void 0!==a&&a?'<feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch">\n <animate attributeName="baseFrequency" values="0.65;0.68;0.63;0.65" dur="2s" repeatCount="indefinite"/>\n </feTurbulence>':'<feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/>','\n <feColorMatrix type="saturate" values="0"/>\n </filter>\n <rect width="').concat(n,'" height="').concat(n,'" filter="url(#g)" opacity="').concat(o,'"/>\n </svg>'));return'url("data:image/svg+xml,'.concat(c,'")')},O=function(t){var e=t.amount,r=t.spread,n=void 0===r?"":r,a=t.x,o=t.y,c=t.color,i=t.type;return"".concat("inner"===(void 0===i?"outer":i)?"inset ":"").concat(void 0===a?"0px":a," ").concat(void 0===o?"0px":o," ").concat(void 0===e?"20px":e).concat(n?" ".concat(n):""," ").concat(void 0===c?"#ffffff":c)},x=function(t,e){switch(t){case"noise":return m(e);case"vignette":return k(e);case"grain":return w(e);case"glow":return O(e);default:throw Error("Unknown gradient type: ".concat(t))}},j=function(t,e){var r;return"glow"===t?{type:"effect",properties:{boxShadow:x(t,e)}}:{type:"effect",properties:{backgroundImage:x(t,e),backgroundSize:null!=(r=e.backgroundSize)?r:"auto"}}},S=function(t){var e,r,n,a=t.amount,o=void 0===a?"20px":a,c=t.type;return"backdrop"===(void 0===c?"backdrop":c)?{properties:(e={backdropFilter:"blur(".concat(o,")")},r="-webkit-backdrop-filter",n="blur(".concat(o,")"),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e)}:{properties:{filter:"blur(".concat(o,")")}}},P=function(t,e){if("blur"===t)return S(e);throw Error("Unknown filter type: ".concat(t))},I=function(t){var e=t.color,r=t.background,n=t.size,a=void 0===n?"20px":n,o=t.spacing,c=t.opacity,i=t.strokeWidth,u=y(null!=o?o:a),l=i?y(i).value:.15*y(a).value,f=g(void 0===e?"#000000":e,void 0===c?.2:c),s=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(u.value).concat(u.unit,'" height="').concat(u.value).concat(u.unit,'" viewBox="0 0 ').concat(u.value," ").concat(u.value,'">\n <rect width="').concat(u.value,'" height="').concat(u.value,'" fill="').concat(void 0===r?"transparent":r,'"/>\n <circle cx="').concat(u.value/2,'" cy="').concat(u.value/2,'" r="').concat(l,'" fill="').concat(f,'"/>\n </svg>'));return'url("data:image/svg+xml,'.concat(s,'")')},C=function(t){var e=t.color,r=t.background,n=t.size,a=t.opacity,o=t.strokeWidth,c=y(void 0===n?"40px":n),i=y(void 0===o?"1px":o).value,u=g(void 0===e?"#000000":e,void 0===a?.1:a),l=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(c.value).concat(c.unit,'" height="').concat(c.value).concat(c.unit,'" viewBox="0 0 ').concat(c.value," ").concat(c.value,'">\n <rect width="').concat(c.value,'" height="').concat(c.value,'" fill="').concat(void 0===r?"transparent":r,'"/>\n <path d="M ').concat(c.value," 0 L 0 0 0 ").concat(c.value,'" fill="none" stroke="').concat(u,'" stroke-width="').concat(i,'"/>\n </svg>'));return'url("data:image/svg+xml,'.concat(l,'")')},z=function(t,e){switch(t){case"dots":return I(e);case"grid":return C(e);default:throw Error("Unknown pattern type: ".concat(t))}},T=function(t,e){var r;return{type:"pattern",properties:{backgroundImage:z(t,e),backgroundSize:null!=(r=e.backgroundSize)?r:"auto"}}};function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function F(t){return function(t){if(Array.isArray(t))return A(t)}(t)||function(t){if("u">typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t){if(t){if("string"==typeof t)return A(t,void 0);var e=Object.prototype.toString.call(t).slice(8,-1);if("Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return A(t,void 0)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var E=function(){var t;function e(){var t,r;if(!(this instanceof e))throw TypeError("Cannot call a class as a function");r=[],(t="_layers")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r}return t=[{key:"gradient",value:function(t,e){var r=p(t,e);return this._layers.push(r),this}},{key:"linearGradient",value:function(t){return this.gradient("linear",t)}},{key:"radialGradient",value:function(t){return this.gradient("radial",t)}},{key:"conicGradient",value:function(t){return this.gradient("conic",t)}},{key:"meshGradient",value:function(t){return this.gradient("mesh",t)}},{key:"effect",value:function(t,e){var r=j(t,e);return this._layers.push(r),this}},{key:"filter",value:function(t,e){var r={type:"filter",properties:P(t,e).properties};return this._layers.push(r),this}},{key:"pattern",value:function(t,e){var r=T(t,e);return this._layers.push(r),this}},{key:"noise",value:function(t){return this.effect("noise",t)}},{key:"vignette",value:function(t){return this.effect("vignette",t)}},{key:"grain",value:function(t){return this.effect("grain",t)}},{key:"glow",value:function(t){return this.effect("glow",t)}},{key:"blur",value:function(t){return this.filter("blur",t)}},{key:"dots",value:function(t){return this.pattern("dots",t)}},{key:"grid",value:function(t){return this.pattern("grid",t)}},{key:"toStyle",value:function(){var t,e,r,n={gradient:[],filter:[],effect:[],pattern:[]};this._layers.forEach(function(t){n[t.type].push(t.properties)});var a={};if(n.gradient.length||n.effect.length||n.pattern){var o,c=F(n.effect).concat(F(n.pattern),F(n.gradient)).flatMap(function(t){return[t.backgroundImage,t.background].filter(Boolean)}),i=F(n.effect).concat(F(n.pattern),F(n.gradient)).map(function(t){return t.backgroundSize}).filter(Boolean),u=n.effect.map(function(t){return t.boxShadow}).filter(Boolean),l=null==(o=n.gradient.find(function(t){return t.backgroundColor}))?void 0:o.backgroundColor;c.length&&(a.backgroundImage=c.join(", ")),i.length&&(a.backgroundSize=i.join(", ")),l&&(a.backgroundColor=l),u&&(a.boxShadow=u.join(", "))}return n.filter.length&&(a.filter=null!=(t=n.filter[0].filter)?t:"",a.backdropFilter=null!=(e=null==(r=n.filter[0])?void 0:r.backdropFilter)?e:""),a}},{key:"toTextStyle",value:function(){var t,e=this.toStyle();return{backgroundImage:null!=(t=e.backgroundImage)?t:e.background,backgroundClip:"text",WebkitBackgroundClip:"text",color:"transparent",WebkitTextFillColor:"transparent"}}}],function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(e.prototype,t),e}(),M={inkwell:"#1a1a2e",obsidian:"#16213e",void:"#0f0f1a",midnightOil:"#1b1f3b",pitch:"#222222",carbon:"#2d2d2d",graphite:"#3d3d3d",flint:"#555555",stone:"#737373",pewter:"#8e8e8e",ash:"#b4b4b0",smoke:"#d0d0cc",bone:"#e8e5dc",chalk:"#f2f0ea",salt:"#faf9f6",parchment:"#f5f0e8",linen:"#eee8d5",cream:"#fdf6e3",absinthe:"#4a7c59",forestFloor:"#2d5a27",malachite:"#3a9e6d",verdigris:"#5f9ea0",celadon:"#ace1af",fern:"#4f7942",chartreuse:"#b5cc18",mantis:"#74c365",viridian:"#40826d",spruce:"#1e4d40",prussian:"#003153",lapis:"#1b4f8c",cobalt:"#0047ab",cerulean:"#007ba7",denim:"#1560bd",glacier:"#80b9d3",powder:"#b0d6e6",steel:"#4682b4",maya:"#73c2fb",delft:"#3640b8",indigoInk:"#220066",wisteria:"#9b7ec8",aubergine:"#614051",amethyst:"#9966cc",mauve:"#e0b0ff",byzantium:"#702963",mulberry:"#c54b8c",plum:"#8e4585",heliotrope:"#df73ff",iris:"#5a4fcf",cinnabar:"#e34234",amaranth:"#e52b50",carmine:"#960018",rouge:"#ab4f62",garnet:"#732e45",crimson:"#dc143c",venetian:"#c80815",blush:"#f4a0a0",tomato:"#ff6347",poppy:"#e35335",amber:"#ffbf00",saffron:"#f4c430",ochre:"#cc7722",goldenrod:"#daa520",harvest:"#da8a2e",copper:"#b87333",terra:"#c2713f",sienna:"#882d17",umber:"#635147",rust:"#b7410e",coral:"#ff7f7f",peach:"#ffb38a",apricot:"#fbceb1",cantaloupe:"#f48054",melon:"#fdbcb4",spearmint:"#a1caa0",sage:"#b2ac88",taupe:"#b5a999",khaki:"#c3b091",dusk:"#8899a6",slate:"#6d8b9c",cadet:"#5f9ea0",eucalyptus:"#5f8575",clay:"#9c6b5a",mushroom:"#9e9388",tealDeep:"#006d77",aquamarine:"#2dc5a2",seafoam:"#93e1d8",jade:"#00a878",turquoise:"#40e0d0",niagara:"#06aed5",tiffany:"#81d8d0",pine:"#01796f",mint:"#98ff98",patina:"#4e8b78",sakura:"#ffb7c5",orchid:"#da70d6",fandango:"#b53389",cerise:"#de3163",magenta:"#ff00ff"};module.exports=e})();
|
|
1
|
+
(()=>{"use strict";var t={};t.d=(e,n,r)=>{var a=(n,r)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,[r]:n[a]})};a(n,"get"),a(r,"value")},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};t.r(e),t.d(e,{Builder:()=>B,colors:()=>W});var n=/^-?\d*\.?\d+(%|px|rem|em|vh|vw|vmin|vmax)$/,r=/^calc\(.+\)$/,a=function(t){var e=t.trim();return n.test(e)||r.test(e)},o=/^-?\d*\.?\d+(deg|rad|grad|turn)$/,i=function(t){return o.test(t.trim())},c=["to top","to bottom","to left","to right","to top right","to bottom right","to top left","to bottom left"],u=function(t){if("string"==typeof t)return t;var e=t.color,n=t.position;return n&&a(n)?"".concat(e," ").concat(n):e},l=function(t){var e,n,r=t.angle&&i(t.angle)?t.angle:t.direction&&(e=t.direction,c.includes(e))?t.direction:"135deg",a=(null==(n=t.colors)?void 0:n.length)?t.colors.map(u).join(", "):"".concat(t.from,", ").concat(t.to),o=t.size?" ".concat(t.size):"";return"linear-gradient(".concat(r,", ").concat(a).concat(o,")")},f=function(t){var e,n,r=null===t.shape?"":"".concat(null!=(e=t.shape)?e:"circle"," "),a=t.size?" ".concat(t.size):"",o="at ".concat(null!=(n=t.position)?n:"center"),i=t.colorFromPosition?" ".concat(t.colorFromPosition):"",c=t.colorToPosition?" ".concat(t.colorToPosition):"",u="".concat(t.from).concat(i,", ").concat(t.to).concat(c);return"radial-gradient(".concat(r).concat(a," ").concat(o,", ").concat(u,")")},s=function(t){var e,n,r=t.angle&&i(t.angle)?"from ".concat(t.angle," "):"",a="at ".concat(null!=(e=t.position)?e:"center"),o=(null==(n=t.colors)?void 0:n.length)?t.colors.map(u).join(", "):"".concat(t.from,", ").concat(t.to);return"conic-gradient(".concat(r).concat(a,", ").concat(o,")")},d=function(t,e){switch(t){case"linear":return l(e);case"radial":return f(e);case"conic":return s(e);case"mesh":return e.layers.map(function(t){t.shape=null!=(e=t.shape)?e:null;var e,n=f(t);return"".concat(n)}).join(", ");default:throw Error("Unknown gradient type: ".concat(t))}},v=function(t,e){var n,r,a,o="mesh"===t;return{type:"gradient",properties:(n=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){var r;r=n[e],e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r})}return t}({},o&&{backgroundImage:d(t,e),backgroundColor:e.background},!o&&{background:d(t,e)}),r=r={backgroundSize:null!=(a=e.backgroundSize)?a:"auto"},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e})(Object(r)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(r,t))}),n)}};function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var g=function(t){var e=t.replace("#",""),n=parseInt(3===e.length?e.split("").map(function(t){return t+t}).join(""):e,16);return{red:n>>16&255,green:n>>8&255,blue:255&n}},h=function(t,e){if(t.startsWith("#")){var n=g(t),r=n.red,a=n.green,o=n.blue;return"rgba(".concat(r,", ").concat(a,", ").concat(o,", ").concat(e,")")}return t.startsWith("rgb(")?t.replace("rgb(","rgba(").replace(")",", ".concat(e,")")):t.startsWith("hsl(")?t.replace("hsl(","hsla(").replace(")",", ".concat(e,")")):t},b=function(t,e,n){return Math.min(n,Math.max(e,t))},y=function(t){var e=t.trim().match(/^(-?\d*\.?\d+)([a-z%]*)$/i);if(!e)throw Error('Invalid CSS length: "'.concat(t,'"'));var n=function(t){if(Array.isArray(t))return t}(e)||function(t){var e,n,r=null==t?null:"u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var a=[],o=!0,i=!1;try{for(r=r.call(t);!(o=(e=r.next()).done)&&(a.push(e.value),3!==a.length);o=!0);}catch(t){i=!0,n=t}finally{try{o||null==r.return||r.return()}finally{if(i)throw n}}return a}}(e)||function(t){if(t){if("string"==typeof t)return p(t,3);var e=Object.prototype.toString.call(t).slice(8,-1);if("Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return p(t,3)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[1],a=n[2];return{value:parseFloat(r),unit:a||"px"}},m=function(t){var e=t.opacity,n=t.scale,r=t.type,a=t.octaves,o=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">\n <filter id="n">\n <feTurbulence type="'.concat(void 0===r?"fractalNoise":r,'" baseFrequency="').concat(void 0===n?.65:n,'" numOctaves="').concat(void 0===a?16:a,'" stitchTiles="stitch"/>\n <feColorMatrix type="saturate" values="0"/>\n </filter>\n <rect width="100%" height="100%" filter="url(#n)" opacity="').concat(void 0===e?.25:e,'"/>\n </svg>'));return'url("data:image/svg+xml,'.concat(o,'")')},k=function(t){var e=t.color,n=t.intensity,r=t.spread,a=h(void 0===e?"#000000":e,b(void 0===n?.2:n,0,1)),o=Math.round(100*(void 0===r?.2:r));return"radial-gradient(ellipse at center, transparent ".concat(100-o,"%, ").concat(a," 100%)")},w=function(t){var e=t.intensity,n=t.size,r=void 0===n?"100%":n,a=t.animated,o=b(.08*(void 0===e?1:e),.01,.12),i=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(r,'" height="').concat(r,'" viewBox="0 0 100% 100%">\n <filter id="g" x="0" y="0" width="').concat(r,'" height="').concat(r,'">\n ').concat(void 0!==a&&a?'<feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch">\n <animate attributeName="baseFrequency" values="0.65;0.68;0.63;0.65" dur="2s" repeatCount="indefinite"/>\n </feTurbulence>':'<feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/>','\n <feColorMatrix type="saturate" values="0"/>\n </filter>\n <rect width="').concat(r,'" height="').concat(r,'" filter="url(#g)" opacity="').concat(o,'"/>\n </svg>'));return'url("data:image/svg+xml,'.concat(i,'")')},x=function(t){var e=t.amount,n=t.spread,r=void 0===n?"":n,a=t.x,o=t.y,i=t.color,c=t.type;return"".concat("inner"===(void 0===c?"outer":c)?"inset ":"").concat(void 0===a?"0px":a," ").concat(void 0===o?"0px":o," ").concat(void 0===e?"20px":e).concat(r?" ".concat(r):""," ").concat(void 0===i?"#ffffff":i)},O=function(t,e){switch(t){case"noise":return m(e);case"vignette":return k(e);case"grain":return w(e);case"glow":return x(e);default:throw Error("Unknown gradient type: ".concat(t))}},j=function(t,e){var n;return"glow"===t?{type:"effect",properties:{boxShadow:O(t,e)}}:{type:"effect",properties:{backgroundImage:O(t,e),backgroundSize:null!=(n=e.backgroundSize)?n:"auto"}}},S=function(t){var e,n,r,a=t.amount,o=void 0===a?"20px":a,i=t.type;return"backdrop"===(void 0===i?"backdrop":i)?{properties:(e={backdropFilter:"blur(".concat(o,")")},n="-webkit-backdrop-filter",r="blur(".concat(o,")"),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e)}:{properties:{filter:"blur(".concat(o,")")}}},P=function(t,e){if("blur"===t)return S(e);throw Error("Unknown filter type: ".concat(t))},C=function(t){var e=t.color,n=t.background,r=t.size,a=void 0===r?"20px":r,o=t.spacing,i=t.opacity,c=t.strokeWidth,u=y(null!=o?o:a),l=c?y(c).value:.15*y(a).value,f=h(void 0===e?"#000000":e,void 0===i?.2:i),s=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(u.value).concat(u.unit,'" height="').concat(u.value).concat(u.unit,'" viewBox="0 0 ').concat(u.value," ").concat(u.value,'">\n <rect width="').concat(u.value,'" height="').concat(u.value,'" fill="').concat(void 0===n?"transparent":n,'"/>\n <circle cx="').concat(u.value/2,'" cy="').concat(u.value/2,'" r="').concat(l,'" fill="').concat(f,'"/>\n </svg>'));return'url("data:image/svg+xml,'.concat(s,'")')},I=function(t){var e=t.color,n=t.background,r=t.size,a=t.opacity,o=t.strokeWidth,i=y(void 0===r?"40px":r),c=y(void 0===o?"1px":o).value,u=h(void 0===e?"#000000":e,void 0===a?.1:a),l=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(i.value).concat(i.unit,'" height="').concat(i.value).concat(i.unit,'" viewBox="0 0 ').concat(i.value," ").concat(i.value,'">\n <rect width="').concat(i.value,'" height="').concat(i.value,'" fill="').concat(void 0===n?"transparent":n,'"/>\n <path d="M ').concat(i.value," 0 L 0 0 0 ").concat(i.value,'" fill="none" stroke="').concat(u,'" stroke-width="').concat(c,'"/>\n </svg>'));return'url("data:image/svg+xml,'.concat(l,'")')},z=function(t,e){switch(t){case"dots":return C(e);case"grid":return I(e);default:throw Error("Unknown pattern type: ".concat(t))}},T=function(t,e){var n;return{type:"pattern",properties:{backgroundImage:z(t,e),backgroundSize:null!=(n=e.backgroundSize)?n:"auto"}}},A=function(t){var e=t.duration,n=t.easing,r=t.direction,a=t.iterationCount;return"xeerpe-pulse ".concat(void 0===e?"4s":e," ").concat(void 0===n?"ease-in-out":n," ").concat(void 0===r?"alternate":r," ").concat(void 0===a?"infinite":a)},E=function(t){var e=t.duration,n=t.easing,r=t.iterationCount;return"xeerpe-rotate ".concat(void 0===e?"12s":e," ").concat(void 0===n?"linear":n," ").concat(void 0===r?"infinite":r,"; transform-origin: center")},F=function(t){var e=t.duration,n=t.easing,r=t.direction,a=t.iterationCount;return"xeerpe-breathe ".concat(void 0===e?"12s":e," ").concat(void 0===n?"ease-in-out":n," ").concat(void 0===r?"alternate":r," ").concat(void 0===a?"infinite":a)},M=function(t,e){switch(t){case"pulse":return A(e);case"rotate":return E(e);case"breathe":return F(e);default:throw Error("Unknown gradient type: ".concat(t))}};function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function _(t){return function(t){if(Array.isArray(t))return U(t)}(t)||function(t){if("u">typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t){if(t){if("string"==typeof t)return U(t,void 0);var e=Object.prototype.toString.call(t).slice(8,-1);if("Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return U(t,void 0)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var B=function(){var t;function e(){var t,n;if(!(this instanceof e))throw TypeError("Cannot call a class as a function");n=[],(t="_layers")in this?Object.defineProperty(this,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):this[t]=n}return t=[{key:"gradient",value:function(t,e){var n=v(t,e);return this._layers.push(n),this}},{key:"linearGradient",value:function(t){return this.gradient("linear",t)}},{key:"radialGradient",value:function(t){return this.gradient("radial",t)}},{key:"conicGradient",value:function(t){return this.gradient("conic",t)}},{key:"meshGradient",value:function(t){return this.gradient("mesh",t)}},{key:"effect",value:function(t,e){var n=j(t,e);return this._layers.push(n),this}},{key:"filter",value:function(t,e){var n={type:"filter",properties:P(t,e).properties};return this._layers.push(n),this}},{key:"pattern",value:function(t,e){var n=T(t,e);return this._layers.push(n),this}},{key:"animation",value:function(t,e){var n={type:"animation",properties:{animation:M(t,e)}};return this._layers.push(n),this}},{key:"noise",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.effect("noise",t)}},{key:"vignette",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.effect("vignette",t)}},{key:"grain",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.effect("grain",t)}},{key:"glow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.effect("glow",t)}},{key:"blur",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.filter("blur",t)}},{key:"dots",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.pattern("dots",t)}},{key:"grid",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.pattern("grid",t)}},{key:"pulse",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.animation("pulse",t)}},{key:"rotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.animation("rotate",t)}},{key:"breathe",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.animation("breathe",t)}},{key:"toStyle",value:function(){var t,e,n,r,a={gradient:[],filter:[],effect:[],pattern:[],animation:[]};this._layers.forEach(function(t){a[t.type].push(t.properties)});var o={};if(a.gradient.length||a.effect.length||a.pattern){var i,c=_(a.effect).concat(_(a.pattern),_(a.gradient)).flatMap(function(t){return[t.backgroundImage,t.background].filter(Boolean)}),u=_(a.effect).concat(_(a.pattern),_(a.gradient)).map(function(t){return t.backgroundSize}).filter(Boolean),l=a.effect.map(function(t){return t.boxShadow}).filter(Boolean),f=null==(i=a.gradient.find(function(t){return t.backgroundColor}))?void 0:i.backgroundColor;c.length&&(o.backgroundImage=c.join(", ")),u.length&&(o.backgroundSize=u.join(", ")),f&&(o.backgroundColor=f),l&&(o.boxShadow=l.join(", "))}return a.filter.length&&(o.filter=null!=(t=a.filter[0].filter)?t:"",o.backdropFilter=null!=(e=null==(n=a.filter[0])?void 0:n.backdropFilter)?e:""),a.animation.length&&(o.animation=null!=(r=a.animation[0].animation)?r:""),o}},{key:"toTextStyle",value:function(){var t,e=this.toStyle();return{backgroundImage:null!=(t=e.backgroundImage)?t:e.background,backgroundClip:"text",WebkitBackgroundClip:"text",color:"transparent",WebkitTextFillColor:"transparent"}}}],function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(e.prototype,t),e}(),W={inkwell:"#1a1a2e",obsidian:"#16213e",void:"#0f0f1a",midnightOil:"#1b1f3b",pitch:"#222222",carbon:"#2d2d2d",graphite:"#3d3d3d",flint:"#555555",stone:"#737373",pewter:"#8e8e8e",ash:"#b4b4b0",smoke:"#d0d0cc",bone:"#e8e5dc",chalk:"#f2f0ea",salt:"#faf9f6",parchment:"#f5f0e8",linen:"#eee8d5",cream:"#fdf6e3",absinthe:"#4a7c59",forestFloor:"#2d5a27",malachite:"#3a9e6d",verdigris:"#5f9ea0",celadon:"#ace1af",fern:"#4f7942",chartreuse:"#b5cc18",mantis:"#74c365",viridian:"#40826d",spruce:"#1e4d40",prussian:"#003153",lapis:"#1b4f8c",cobalt:"#0047ab",cerulean:"#007ba7",denim:"#1560bd",glacier:"#80b9d3",powder:"#b0d6e6",steel:"#4682b4",maya:"#73c2fb",delft:"#3640b8",indigoInk:"#220066",wisteria:"#9b7ec8",aubergine:"#614051",amethyst:"#9966cc",mauve:"#e0b0ff",byzantium:"#702963",mulberry:"#c54b8c",plum:"#8e4585",heliotrope:"#df73ff",iris:"#5a4fcf",cinnabar:"#e34234",amaranth:"#e52b50",carmine:"#960018",rouge:"#ab4f62",garnet:"#732e45",crimson:"#dc143c",venetian:"#c80815",blush:"#f4a0a0",tomato:"#ff6347",poppy:"#e35335",amber:"#ffbf00",saffron:"#f4c430",ochre:"#cc7722",goldenrod:"#daa520",harvest:"#da8a2e",copper:"#b87333",terra:"#c2713f",sienna:"#882d17",umber:"#635147",rust:"#b7410e",coral:"#ff7f7f",peach:"#ffb38a",apricot:"#fbceb1",cantaloupe:"#f48054",melon:"#fdbcb4",spearmint:"#a1caa0",sage:"#b2ac88",taupe:"#b5a999",khaki:"#c3b091",dusk:"#8899a6",slate:"#6d8b9c",cadet:"#5f9ea0",eucalyptus:"#5f8575",clay:"#9c6b5a",mushroom:"#9e9388",tealDeep:"#006d77",aquamarine:"#2dc5a2",seafoam:"#93e1d8",jade:"#00a878",turquoise:"#40e0d0",niagara:"#06aed5",tiffany:"#81d8d0",pine:"#01796f",mint:"#98ff98",patina:"#4e8b78",sakura:"#ffb7c5",orchid:"#da70d6",fandango:"#b53389",cerise:"#de3163",magenta:"#ff00ff"};module.exports=e})();
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t={};t.d=(e,r,n)=>{var a=(r,n)=>{for(var a in r)t.o(r,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,[n]:r[a]})};a(r,"get"),a(n,"value")},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var e={};t.d(e,{M:()=>F,T:()=>E});var r=/^-?\d*\.?\d+(%|px|rem|em|vh|vw|vmin|vmax)$/,n=/^calc\(.+\)$/,a=function(t){var e=t.trim();return r.test(e)||n.test(e)},o=/^-?\d*\.?\d+(deg|rad|grad|turn)$/,c=function(t){return o.test(t.trim())},i=["to top","to bottom","to left","to right","to top right","to bottom right","to top left","to bottom left"],u=function(t){if("string"==typeof t)return t;var e=t.color,r=t.position;return r&&a(r)?"".concat(e," ").concat(r):e},l=function(t){var e,r,n=t.angle&&c(t.angle)?t.angle:t.direction&&(e=t.direction,i.includes(e))?t.direction:"135deg",a=(null==(r=t.colors)?void 0:r.length)?t.colors.map(u).join(", "):"".concat(t.from,", ").concat(t.to),o=t.size?" ".concat(t.size):"";return"linear-gradient(".concat(n,", ").concat(a).concat(o,")")},f=function(t){var e,r,n=null===t.shape?"":"".concat(null!=(e=t.shape)?e:"circle"," "),a=t.size?" ".concat(t.size):"",o="at ".concat(null!=(r=t.position)?r:"center"),c=t.colorFromPosition?" ".concat(t.colorFromPosition):"",i=t.colorToPosition?" ".concat(t.colorToPosition):"",u="".concat(t.from).concat(c,", ").concat(t.to).concat(i);return"radial-gradient(".concat(n).concat(a," ").concat(o,", ").concat(u,")")},s=function(t){var e,r,n=t.angle&&c(t.angle)?"from ".concat(t.angle," "):"",a="at ".concat(null!=(e=t.position)?e:"center"),o=(null==(r=t.colors)?void 0:r.length)?t.colors.map(u).join(", "):"".concat(t.from,", ").concat(t.to);return"conic-gradient(".concat(n).concat(a,", ").concat(o,")")},d=function(t,e){switch(t){case"linear":return l(e);case"radial":return f(e);case"conic":return s(e);case"mesh":return e.layers.map(function(t){t.shape=null!=(e=t.shape)?e:null;var e,r=f(t);return"".concat(r)}).join(", ");default:throw Error("Unknown gradient type: ".concat(t))}},p=function(t,e){var r,n,a,o="mesh"===t;return{type:"gradient",properties:(r=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),n.forEach(function(e){var n;n=r[e],e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n})}return t}({},o&&{backgroundImage:d(t,e),backgroundColor:e.background},!o&&{background:d(t,e)}),n=n={backgroundSize:null!=(a=e.backgroundSize)?a:"auto"},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e.push.apply(e,r)}return e})(Object(n)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))}),r)}};function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var b=function(t){var e=t.replace("#",""),r=parseInt(3===e.length?e.split("").map(function(t){return t+t}).join(""):e,16);return{red:r>>16&255,green:r>>8&255,blue:255&r}},g=function(t,e){if(t.startsWith("#")){var r=b(t),n=r.red,a=r.green,o=r.blue;return"rgba(".concat(n,", ").concat(a,", ").concat(o,", ").concat(e,")")}return t.startsWith("rgb(")?t.replace("rgb(","rgba(").replace(")",", ".concat(e,")")):t.startsWith("hsl(")?t.replace("hsl(","hsla(").replace(")",", ".concat(e,")")):t},h=function(t,e,r){return Math.min(r,Math.max(e,t))},y=function(t){var e=t.trim().match(/^(-?\d*\.?\d+)([a-z%]*)$/i);if(!e)throw Error('Invalid CSS length: "'.concat(t,'"'));var r=function(t){if(Array.isArray(t))return t}(e)||function(t){var e,r,n=null==t?null:"u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var a=[],o=!0,c=!1;try{for(n=n.call(t);!(o=(e=n.next()).done)&&(a.push(e.value),3!==a.length);o=!0);}catch(t){c=!0,r=t}finally{try{o||null==n.return||n.return()}finally{if(c)throw r}}return a}}(e)||function(t){if(t){if("string"==typeof t)return v(t,3);var e=Object.prototype.toString.call(t).slice(8,-1);if("Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return v(t,3)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=r[1],a=r[2];return{value:parseFloat(n),unit:a||"px"}},m=function(t){var e=t.opacity,r=t.scale,n=t.type,a=t.octaves,o=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">\n <filter id="n">\n <feTurbulence type="'.concat(void 0===n?"fractalNoise":n,'" baseFrequency="').concat(void 0===r?.65:r,'" numOctaves="').concat(void 0===a?16:a,'" stitchTiles="stitch"/>\n <feColorMatrix type="saturate" values="0"/>\n </filter>\n <rect width="100%" height="100%" filter="url(#n)" opacity="').concat(void 0===e?.25:e,'"/>\n </svg>'));return'url("data:image/svg+xml,'.concat(o,'")')},k=function(t){var e=t.color,r=t.intensity,n=t.spread,a=g(void 0===e?"#000000":e,h(void 0===r?.2:r,0,1)),o=Math.round(100*(void 0===n?.2:n));return"radial-gradient(ellipse at center, transparent ".concat(100-o,"%, ").concat(a," 100%)")},w=function(t){var e=t.intensity,r=t.size,n=void 0===r?"100%":r,a=t.animated,o=h(.08*(void 0===e?1:e),.01,.12),c=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(n,'" height="').concat(n,'" viewBox="0 0 100% 100%">\n <filter id="g" x="0" y="0" width="').concat(n,'" height="').concat(n,'">\n ').concat(void 0!==a&&a?'<feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch">\n <animate attributeName="baseFrequency" values="0.65;0.68;0.63;0.65" dur="2s" repeatCount="indefinite"/>\n </feTurbulence>':'<feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/>','\n <feColorMatrix type="saturate" values="0"/>\n </filter>\n <rect width="').concat(n,'" height="').concat(n,'" filter="url(#g)" opacity="').concat(o,'"/>\n </svg>'));return'url("data:image/svg+xml,'.concat(c,'")')},x=function(t){var e=t.amount,r=t.spread,n=void 0===r?"":r,a=t.x,o=t.y,c=t.color,i=t.type;return"".concat("inner"===(void 0===i?"outer":i)?"inset ":"").concat(void 0===a?"0px":a," ").concat(void 0===o?"0px":o," ").concat(void 0===e?"20px":e).concat(n?" ".concat(n):""," ").concat(void 0===c?"#ffffff":c)},O=function(t,e){switch(t){case"noise":return m(e);case"vignette":return k(e);case"grain":return w(e);case"glow":return x(e);default:throw Error("Unknown gradient type: ".concat(t))}},j=function(t,e){var r;return"glow"===t?{type:"effect",properties:{boxShadow:O(t,e)}}:{type:"effect",properties:{backgroundImage:O(t,e),backgroundSize:null!=(r=e.backgroundSize)?r:"auto"}}},S=function(t){var e,r,n,a=t.amount,o=void 0===a?"20px":a,c=t.type;return"backdrop"===(void 0===c?"backdrop":c)?{properties:(e={backdropFilter:"blur(".concat(o,")")},r="-webkit-backdrop-filter",n="blur(".concat(o,")"),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e)}:{properties:{filter:"blur(".concat(o,")")}}},I=function(t,e){if("blur"===t)return S(e);throw Error("Unknown filter type: ".concat(t))},P=function(t){var e=t.color,r=t.background,n=t.size,a=void 0===n?"20px":n,o=t.spacing,c=t.opacity,i=t.strokeWidth,u=y(null!=o?o:a),l=i?y(i).value:.15*y(a).value,f=g(void 0===e?"#000000":e,void 0===c?.2:c),s=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(u.value).concat(u.unit,'" height="').concat(u.value).concat(u.unit,'" viewBox="0 0 ').concat(u.value," ").concat(u.value,'">\n <rect width="').concat(u.value,'" height="').concat(u.value,'" fill="').concat(void 0===r?"transparent":r,'"/>\n <circle cx="').concat(u.value/2,'" cy="').concat(u.value/2,'" r="').concat(l,'" fill="').concat(f,'"/>\n </svg>'));return'url("data:image/svg+xml,'.concat(s,'")')},C=function(t){var e=t.color,r=t.background,n=t.size,a=t.opacity,o=t.strokeWidth,c=y(void 0===n?"40px":n),i=y(void 0===o?"1px":o).value,u=g(void 0===e?"#000000":e,void 0===a?.1:a),l=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(c.value).concat(c.unit,'" height="').concat(c.value).concat(c.unit,'" viewBox="0 0 ').concat(c.value," ").concat(c.value,'">\n <rect width="').concat(c.value,'" height="').concat(c.value,'" fill="').concat(void 0===r?"transparent":r,'"/>\n <path d="M ').concat(c.value," 0 L 0 0 0 ").concat(c.value,'" fill="none" stroke="').concat(u,'" stroke-width="').concat(i,'"/>\n </svg>'));return'url("data:image/svg+xml,'.concat(l,'")')},z=function(t,e){switch(t){case"dots":return P(e);case"grid":return C(e);default:throw Error("Unknown pattern type: ".concat(t))}},T=function(t,e){var r;return{type:"pattern",properties:{backgroundImage:z(t,e),backgroundSize:null!=(r=e.backgroundSize)?r:"auto"}}};function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function A(t){return function(t){if(Array.isArray(t))return _(t)}(t)||function(t){if("u">typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t){if(t){if("string"==typeof t)return _(t,void 0);var e=Object.prototype.toString.call(t).slice(8,-1);if("Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return _(t,void 0)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var F=function(){"use strict";var t;function e(){var t,r;if(!(this instanceof e))throw TypeError("Cannot call a class as a function");r=[],(t="_layers")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r}return t=[{key:"gradient",value:function(t,e){var r=p(t,e);return this._layers.push(r),this}},{key:"linearGradient",value:function(t){return this.gradient("linear",t)}},{key:"radialGradient",value:function(t){return this.gradient("radial",t)}},{key:"conicGradient",value:function(t){return this.gradient("conic",t)}},{key:"meshGradient",value:function(t){return this.gradient("mesh",t)}},{key:"effect",value:function(t,e){var r=j(t,e);return this._layers.push(r),this}},{key:"filter",value:function(t,e){var r={type:"filter",properties:I(t,e).properties};return this._layers.push(r),this}},{key:"pattern",value:function(t,e){var r=T(t,e);return this._layers.push(r),this}},{key:"noise",value:function(t){return this.effect("noise",t)}},{key:"vignette",value:function(t){return this.effect("vignette",t)}},{key:"grain",value:function(t){return this.effect("grain",t)}},{key:"glow",value:function(t){return this.effect("glow",t)}},{key:"blur",value:function(t){return this.filter("blur",t)}},{key:"dots",value:function(t){return this.pattern("dots",t)}},{key:"grid",value:function(t){return this.pattern("grid",t)}},{key:"toStyle",value:function(){var t,e,r,n={gradient:[],filter:[],effect:[],pattern:[]};this._layers.forEach(function(t){n[t.type].push(t.properties)});var a={};if(n.gradient.length||n.effect.length||n.pattern){var o,c=A(n.effect).concat(A(n.pattern),A(n.gradient)).flatMap(function(t){return[t.backgroundImage,t.background].filter(Boolean)}),i=A(n.effect).concat(A(n.pattern),A(n.gradient)).map(function(t){return t.backgroundSize}).filter(Boolean),u=n.effect.map(function(t){return t.boxShadow}).filter(Boolean),l=null==(o=n.gradient.find(function(t){return t.backgroundColor}))?void 0:o.backgroundColor;c.length&&(a.backgroundImage=c.join(", ")),i.length&&(a.backgroundSize=i.join(", ")),l&&(a.backgroundColor=l),u&&(a.boxShadow=u.join(", "))}return n.filter.length&&(a.filter=null!=(t=n.filter[0].filter)?t:"",a.backdropFilter=null!=(e=null==(r=n.filter[0])?void 0:r.backdropFilter)?e:""),a}},{key:"toTextStyle",value:function(){var t,e=this.toStyle();return{backgroundImage:null!=(t=e.backgroundImage)?t:e.background,backgroundClip:"text",WebkitBackgroundClip:"text",color:"transparent",WebkitTextFillColor:"transparent"}}}],function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(e.prototype,t),e}(),E={inkwell:"#1a1a2e",obsidian:"#16213e",void:"#0f0f1a",midnightOil:"#1b1f3b",pitch:"#222222",carbon:"#2d2d2d",graphite:"#3d3d3d",flint:"#555555",stone:"#737373",pewter:"#8e8e8e",ash:"#b4b4b0",smoke:"#d0d0cc",bone:"#e8e5dc",chalk:"#f2f0ea",salt:"#faf9f6",parchment:"#f5f0e8",linen:"#eee8d5",cream:"#fdf6e3",absinthe:"#4a7c59",forestFloor:"#2d5a27",malachite:"#3a9e6d",verdigris:"#5f9ea0",celadon:"#ace1af",fern:"#4f7942",chartreuse:"#b5cc18",mantis:"#74c365",viridian:"#40826d",spruce:"#1e4d40",prussian:"#003153",lapis:"#1b4f8c",cobalt:"#0047ab",cerulean:"#007ba7",denim:"#1560bd",glacier:"#80b9d3",powder:"#b0d6e6",steel:"#4682b4",maya:"#73c2fb",delft:"#3640b8",indigoInk:"#220066",wisteria:"#9b7ec8",aubergine:"#614051",amethyst:"#9966cc",mauve:"#e0b0ff",byzantium:"#702963",mulberry:"#c54b8c",plum:"#8e4585",heliotrope:"#df73ff",iris:"#5a4fcf",cinnabar:"#e34234",amaranth:"#e52b50",carmine:"#960018",rouge:"#ab4f62",garnet:"#732e45",crimson:"#dc143c",venetian:"#c80815",blush:"#f4a0a0",tomato:"#ff6347",poppy:"#e35335",amber:"#ffbf00",saffron:"#f4c430",ochre:"#cc7722",goldenrod:"#daa520",harvest:"#da8a2e",copper:"#b87333",terra:"#c2713f",sienna:"#882d17",umber:"#635147",rust:"#b7410e",coral:"#ff7f7f",peach:"#ffb38a",apricot:"#fbceb1",cantaloupe:"#f48054",melon:"#fdbcb4",spearmint:"#a1caa0",sage:"#b2ac88",taupe:"#b5a999",khaki:"#c3b091",dusk:"#8899a6",slate:"#6d8b9c",cadet:"#5f9ea0",eucalyptus:"#5f8575",clay:"#9c6b5a",mushroom:"#9e9388",tealDeep:"#006d77",aquamarine:"#2dc5a2",seafoam:"#93e1d8",jade:"#00a878",turquoise:"#40e0d0",niagara:"#06aed5",tiffany:"#81d8d0",pine:"#01796f",mint:"#98ff98",patina:"#4e8b78",sakura:"#ffb7c5",orchid:"#da70d6",fandango:"#b53389",cerise:"#de3163",magenta:"#ff00ff"},M=e.M,U=e.T;export{M as Builder,U as colors};
|
|
1
|
+
var t={};t.d=(e,n,r)=>{var a=(n,r)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,[r]:n[a]})};a(n,"get"),a(r,"value")},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var e={};t.d(e,{M:()=>B,T:()=>W});var n=/^-?\d*\.?\d+(%|px|rem|em|vh|vw|vmin|vmax)$/,r=/^calc\(.+\)$/,a=function(t){var e=t.trim();return n.test(e)||r.test(e)},o=/^-?\d*\.?\d+(deg|rad|grad|turn)$/,i=function(t){return o.test(t.trim())},c=["to top","to bottom","to left","to right","to top right","to bottom right","to top left","to bottom left"],u=function(t){if("string"==typeof t)return t;var e=t.color,n=t.position;return n&&a(n)?"".concat(e," ").concat(n):e},l=function(t){var e,n,r=t.angle&&i(t.angle)?t.angle:t.direction&&(e=t.direction,c.includes(e))?t.direction:"135deg",a=(null==(n=t.colors)?void 0:n.length)?t.colors.map(u).join(", "):"".concat(t.from,", ").concat(t.to),o=t.size?" ".concat(t.size):"";return"linear-gradient(".concat(r,", ").concat(a).concat(o,")")},s=function(t){var e,n,r=null===t.shape?"":"".concat(null!=(e=t.shape)?e:"circle"," "),a=t.size?" ".concat(t.size):"",o="at ".concat(null!=(n=t.position)?n:"center"),i=t.colorFromPosition?" ".concat(t.colorFromPosition):"",c=t.colorToPosition?" ".concat(t.colorToPosition):"",u="".concat(t.from).concat(i,", ").concat(t.to).concat(c);return"radial-gradient(".concat(r).concat(a," ").concat(o,", ").concat(u,")")},f=function(t){var e,n,r=t.angle&&i(t.angle)?"from ".concat(t.angle," "):"",a="at ".concat(null!=(e=t.position)?e:"center"),o=(null==(n=t.colors)?void 0:n.length)?t.colors.map(u).join(", "):"".concat(t.from,", ").concat(t.to);return"conic-gradient(".concat(r).concat(a,", ").concat(o,")")},d=function(t,e){switch(t){case"linear":return l(e);case"radial":return s(e);case"conic":return f(e);case"mesh":return e.layers.map(function(t){t.shape=null!=(e=t.shape)?e:null;var e,n=s(t);return"".concat(n)}).join(", ");default:throw Error("Unknown gradient type: ".concat(t))}},v=function(t,e){var n,r,a,o="mesh"===t;return{type:"gradient",properties:(n=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){var r;r=n[e],e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r})}return t}({},o&&{backgroundImage:d(t,e),backgroundColor:e.background},!o&&{background:d(t,e)}),r=r={backgroundSize:null!=(a=e.backgroundSize)?a:"auto"},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e})(Object(r)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(r,t))}),n)}};function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var g=function(t){var e=t.replace("#",""),n=parseInt(3===e.length?e.split("").map(function(t){return t+t}).join(""):e,16);return{red:n>>16&255,green:n>>8&255,blue:255&n}},h=function(t,e){if(t.startsWith("#")){var n=g(t),r=n.red,a=n.green,o=n.blue;return"rgba(".concat(r,", ").concat(a,", ").concat(o,", ").concat(e,")")}return t.startsWith("rgb(")?t.replace("rgb(","rgba(").replace(")",", ".concat(e,")")):t.startsWith("hsl(")?t.replace("hsl(","hsla(").replace(")",", ".concat(e,")")):t},b=function(t,e,n){return Math.min(n,Math.max(e,t))},y=function(t){var e=t.trim().match(/^(-?\d*\.?\d+)([a-z%]*)$/i);if(!e)throw Error('Invalid CSS length: "'.concat(t,'"'));var n=function(t){if(Array.isArray(t))return t}(e)||function(t){var e,n,r=null==t?null:"u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var a=[],o=!0,i=!1;try{for(r=r.call(t);!(o=(e=r.next()).done)&&(a.push(e.value),3!==a.length);o=!0);}catch(t){i=!0,n=t}finally{try{o||null==r.return||r.return()}finally{if(i)throw n}}return a}}(e)||function(t){if(t){if("string"==typeof t)return p(t,3);var e=Object.prototype.toString.call(t).slice(8,-1);if("Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return p(t,3)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[1],a=n[2];return{value:parseFloat(r),unit:a||"px"}},m=function(t){var e=t.opacity,n=t.scale,r=t.type,a=t.octaves,o=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">\n <filter id="n">\n <feTurbulence type="'.concat(void 0===r?"fractalNoise":r,'" baseFrequency="').concat(void 0===n?.65:n,'" numOctaves="').concat(void 0===a?16:a,'" stitchTiles="stitch"/>\n <feColorMatrix type="saturate" values="0"/>\n </filter>\n <rect width="100%" height="100%" filter="url(#n)" opacity="').concat(void 0===e?.25:e,'"/>\n </svg>'));return'url("data:image/svg+xml,'.concat(o,'")')},k=function(t){var e=t.color,n=t.intensity,r=t.spread,a=h(void 0===e?"#000000":e,b(void 0===n?.2:n,0,1)),o=Math.round(100*(void 0===r?.2:r));return"radial-gradient(ellipse at center, transparent ".concat(100-o,"%, ").concat(a," 100%)")},w=function(t){var e=t.intensity,n=t.size,r=void 0===n?"100%":n,a=t.animated,o=b(.08*(void 0===e?1:e),.01,.12),i=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(r,'" height="').concat(r,'" viewBox="0 0 100% 100%">\n <filter id="g" x="0" y="0" width="').concat(r,'" height="').concat(r,'">\n ').concat(void 0!==a&&a?'<feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch">\n <animate attributeName="baseFrequency" values="0.65;0.68;0.63;0.65" dur="2s" repeatCount="indefinite"/>\n </feTurbulence>':'<feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/>','\n <feColorMatrix type="saturate" values="0"/>\n </filter>\n <rect width="').concat(r,'" height="').concat(r,'" filter="url(#g)" opacity="').concat(o,'"/>\n </svg>'));return'url("data:image/svg+xml,'.concat(i,'")')},x=function(t){var e=t.amount,n=t.spread,r=void 0===n?"":n,a=t.x,o=t.y,i=t.color,c=t.type;return"".concat("inner"===(void 0===c?"outer":c)?"inset ":"").concat(void 0===a?"0px":a," ").concat(void 0===o?"0px":o," ").concat(void 0===e?"20px":e).concat(r?" ".concat(r):""," ").concat(void 0===i?"#ffffff":i)},O=function(t,e){switch(t){case"noise":return m(e);case"vignette":return k(e);case"grain":return w(e);case"glow":return x(e);default:throw Error("Unknown gradient type: ".concat(t))}},j=function(t,e){var n;return"glow"===t?{type:"effect",properties:{boxShadow:O(t,e)}}:{type:"effect",properties:{backgroundImage:O(t,e),backgroundSize:null!=(n=e.backgroundSize)?n:"auto"}}},S=function(t){var e,n,r,a=t.amount,o=void 0===a?"20px":a,i=t.type;return"backdrop"===(void 0===i?"backdrop":i)?{properties:(e={backdropFilter:"blur(".concat(o,")")},n="-webkit-backdrop-filter",r="blur(".concat(o,")"),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e)}:{properties:{filter:"blur(".concat(o,")")}}},C=function(t,e){if("blur"===t)return S(e);throw Error("Unknown filter type: ".concat(t))},I=function(t){var e=t.color,n=t.background,r=t.size,a=void 0===r?"20px":r,o=t.spacing,i=t.opacity,c=t.strokeWidth,u=y(null!=o?o:a),l=c?y(c).value:.15*y(a).value,s=h(void 0===e?"#000000":e,void 0===i?.2:i),f=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(u.value).concat(u.unit,'" height="').concat(u.value).concat(u.unit,'" viewBox="0 0 ').concat(u.value," ").concat(u.value,'">\n <rect width="').concat(u.value,'" height="').concat(u.value,'" fill="').concat(void 0===n?"transparent":n,'"/>\n <circle cx="').concat(u.value/2,'" cy="').concat(u.value/2,'" r="').concat(l,'" fill="').concat(s,'"/>\n </svg>'));return'url("data:image/svg+xml,'.concat(f,'")')},P=function(t){var e=t.color,n=t.background,r=t.size,a=t.opacity,o=t.strokeWidth,i=y(void 0===r?"40px":r),c=y(void 0===o?"1px":o).value,u=h(void 0===e?"#000000":e,void 0===a?.1:a),l=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(i.value).concat(i.unit,'" height="').concat(i.value).concat(i.unit,'" viewBox="0 0 ').concat(i.value," ").concat(i.value,'">\n <rect width="').concat(i.value,'" height="').concat(i.value,'" fill="').concat(void 0===n?"transparent":n,'"/>\n <path d="M ').concat(i.value," 0 L 0 0 0 ").concat(i.value,'" fill="none" stroke="').concat(u,'" stroke-width="').concat(c,'"/>\n </svg>'));return'url("data:image/svg+xml,'.concat(l,'")')},z=function(t,e){switch(t){case"dots":return I(e);case"grid":return P(e);default:throw Error("Unknown pattern type: ".concat(t))}},_=function(t,e){var n;return{type:"pattern",properties:{backgroundImage:z(t,e),backgroundSize:null!=(n=e.backgroundSize)?n:"auto"}}},T=function(t){var e=t.duration,n=t.easing,r=t.direction,a=t.iterationCount;return"xeerpe-pulse ".concat(void 0===e?"4s":e," ").concat(void 0===n?"ease-in-out":n," ").concat(void 0===r?"alternate":r," ").concat(void 0===a?"infinite":a)},A=function(t){var e=t.duration,n=t.easing,r=t.iterationCount;return"xeerpe-rotate ".concat(void 0===e?"12s":e," ").concat(void 0===n?"linear":n," ").concat(void 0===r?"infinite":r,"; transform-origin: center")},E=function(t){var e=t.duration,n=t.easing,r=t.direction,a=t.iterationCount;return"xeerpe-breathe ".concat(void 0===e?"12s":e," ").concat(void 0===n?"ease-in-out":n," ").concat(void 0===r?"alternate":r," ").concat(void 0===a?"infinite":a)},F=function(t,e){switch(t){case"pulse":return T(e);case"rotate":return A(e);case"breathe":return E(e);default:throw Error("Unknown gradient type: ".concat(t))}};function M(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function U(t){return function(t){if(Array.isArray(t))return M(t)}(t)||function(t){if("u">typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t){if(t){if("string"==typeof t)return M(t,void 0);var e=Object.prototype.toString.call(t).slice(8,-1);if("Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return M(t,void 0)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var B=function(){"use strict";var t;function e(){var t,n;if(!(this instanceof e))throw TypeError("Cannot call a class as a function");n=[],(t="_layers")in this?Object.defineProperty(this,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):this[t]=n}return t=[{key:"gradient",value:function(t,e){var n=v(t,e);return this._layers.push(n),this}},{key:"linearGradient",value:function(t){return this.gradient("linear",t)}},{key:"radialGradient",value:function(t){return this.gradient("radial",t)}},{key:"conicGradient",value:function(t){return this.gradient("conic",t)}},{key:"meshGradient",value:function(t){return this.gradient("mesh",t)}},{key:"effect",value:function(t,e){var n=j(t,e);return this._layers.push(n),this}},{key:"filter",value:function(t,e){var n={type:"filter",properties:C(t,e).properties};return this._layers.push(n),this}},{key:"pattern",value:function(t,e){var n=_(t,e);return this._layers.push(n),this}},{key:"animation",value:function(t,e){var n={type:"animation",properties:{animation:F(t,e)}};return this._layers.push(n),this}},{key:"noise",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.effect("noise",t)}},{key:"vignette",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.effect("vignette",t)}},{key:"grain",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.effect("grain",t)}},{key:"glow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.effect("glow",t)}},{key:"blur",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.filter("blur",t)}},{key:"dots",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.pattern("dots",t)}},{key:"grid",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.pattern("grid",t)}},{key:"pulse",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.animation("pulse",t)}},{key:"rotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.animation("rotate",t)}},{key:"breathe",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.animation("breathe",t)}},{key:"toStyle",value:function(){var t,e,n,r,a={gradient:[],filter:[],effect:[],pattern:[],animation:[]};this._layers.forEach(function(t){a[t.type].push(t.properties)});var o={};if(a.gradient.length||a.effect.length||a.pattern){var i,c=U(a.effect).concat(U(a.pattern),U(a.gradient)).flatMap(function(t){return[t.backgroundImage,t.background].filter(Boolean)}),u=U(a.effect).concat(U(a.pattern),U(a.gradient)).map(function(t){return t.backgroundSize}).filter(Boolean),l=a.effect.map(function(t){return t.boxShadow}).filter(Boolean),s=null==(i=a.gradient.find(function(t){return t.backgroundColor}))?void 0:i.backgroundColor;c.length&&(o.backgroundImage=c.join(", ")),u.length&&(o.backgroundSize=u.join(", ")),s&&(o.backgroundColor=s),l&&(o.boxShadow=l.join(", "))}return a.filter.length&&(o.filter=null!=(t=a.filter[0].filter)?t:"",o.backdropFilter=null!=(e=null==(n=a.filter[0])?void 0:n.backdropFilter)?e:""),a.animation.length&&(o.animation=null!=(r=a.animation[0].animation)?r:""),o}},{key:"toTextStyle",value:function(){var t,e=this.toStyle();return{backgroundImage:null!=(t=e.backgroundImage)?t:e.background,backgroundClip:"text",WebkitBackgroundClip:"text",color:"transparent",WebkitTextFillColor:"transparent"}}}],function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(e.prototype,t),e}(),W={inkwell:"#1a1a2e",obsidian:"#16213e",void:"#0f0f1a",midnightOil:"#1b1f3b",pitch:"#222222",carbon:"#2d2d2d",graphite:"#3d3d3d",flint:"#555555",stone:"#737373",pewter:"#8e8e8e",ash:"#b4b4b0",smoke:"#d0d0cc",bone:"#e8e5dc",chalk:"#f2f0ea",salt:"#faf9f6",parchment:"#f5f0e8",linen:"#eee8d5",cream:"#fdf6e3",absinthe:"#4a7c59",forestFloor:"#2d5a27",malachite:"#3a9e6d",verdigris:"#5f9ea0",celadon:"#ace1af",fern:"#4f7942",chartreuse:"#b5cc18",mantis:"#74c365",viridian:"#40826d",spruce:"#1e4d40",prussian:"#003153",lapis:"#1b4f8c",cobalt:"#0047ab",cerulean:"#007ba7",denim:"#1560bd",glacier:"#80b9d3",powder:"#b0d6e6",steel:"#4682b4",maya:"#73c2fb",delft:"#3640b8",indigoInk:"#220066",wisteria:"#9b7ec8",aubergine:"#614051",amethyst:"#9966cc",mauve:"#e0b0ff",byzantium:"#702963",mulberry:"#c54b8c",plum:"#8e4585",heliotrope:"#df73ff",iris:"#5a4fcf",cinnabar:"#e34234",amaranth:"#e52b50",carmine:"#960018",rouge:"#ab4f62",garnet:"#732e45",crimson:"#dc143c",venetian:"#c80815",blush:"#f4a0a0",tomato:"#ff6347",poppy:"#e35335",amber:"#ffbf00",saffron:"#f4c430",ochre:"#cc7722",goldenrod:"#daa520",harvest:"#da8a2e",copper:"#b87333",terra:"#c2713f",sienna:"#882d17",umber:"#635147",rust:"#b7410e",coral:"#ff7f7f",peach:"#ffb38a",apricot:"#fbceb1",cantaloupe:"#f48054",melon:"#fdbcb4",spearmint:"#a1caa0",sage:"#b2ac88",taupe:"#b5a999",khaki:"#c3b091",dusk:"#8899a6",slate:"#6d8b9c",cadet:"#5f9ea0",eucalyptus:"#5f8575",clay:"#9c6b5a",mushroom:"#9e9388",tealDeep:"#006d77",aquamarine:"#2dc5a2",seafoam:"#93e1d8",jade:"#00a878",turquoise:"#40e0d0",niagara:"#06aed5",tiffany:"#81d8d0",pine:"#01796f",mint:"#98ff98",patina:"#4e8b78",sakura:"#ffb7c5",orchid:"#da70d6",fandango:"#b53389",cerise:"#de3163",magenta:"#ff00ff"},q=e.M,$=e.T;export{q as Builder,$ as colors};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type AnimationType = 'pulse' | 'rotate' | 'breathe';
|
|
2
|
+
export interface AnimationOptions {
|
|
3
|
+
duration?: string;
|
|
4
|
+
easing?: string;
|
|
5
|
+
direction?: 'normal' | 'reverse' | 'alternate' | 'alternate-reverse';
|
|
6
|
+
iterationCount?: number | 'infinite';
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=animation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/models/animation.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAA;AAE1D,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,mBAAmB,CAAA;IACpE,cAAc,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;CACvC"}
|
package/dist/models/builder.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type LayerType = 'gradient' | 'filter' | 'effect' | 'pattern';
|
|
1
|
+
export type LayerType = 'gradient' | 'filter' | 'effect' | 'pattern' | 'animation';
|
|
2
2
|
export interface CSSProperties {
|
|
3
3
|
background?: string;
|
|
4
4
|
backgroundImage?: string;
|
|
@@ -7,6 +7,7 @@ export interface CSSProperties {
|
|
|
7
7
|
filter?: string;
|
|
8
8
|
backdropFilter?: string;
|
|
9
9
|
boxShadow?: string;
|
|
10
|
+
animation?: string;
|
|
10
11
|
}
|
|
11
12
|
export interface BuilderLayer {
|
|
12
13
|
type: LayerType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/models/builder.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/models/builder.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAA;AAElF,MAAM,WAAW,aAAa;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB;AAGD,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,SAAS,CAAA;IACf,UAAU,EAAE,aAAa,CAAA;CAC5B"}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xeerpe",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -15,9 +15,12 @@
|
|
|
15
15
|
"types": "./dist/index.d.cts",
|
|
16
16
|
"default": "./dist/index.cjs"
|
|
17
17
|
}
|
|
18
|
-
}
|
|
18
|
+
},
|
|
19
|
+
"./animations.css": "./dist/animations.css",
|
|
20
|
+
"./package.json": "./package.json"
|
|
19
21
|
},
|
|
20
22
|
"files": ["dist/*"],
|
|
23
|
+
"sideEffects": ["*.css"],
|
|
21
24
|
"keywords": ["xeerpe"],
|
|
22
25
|
"description": "xeerpe",
|
|
23
26
|
"author": "Nicola Centonze",
|
|
@@ -27,7 +30,7 @@
|
|
|
27
30
|
"url": "git@github.com:nicolacentonze/xeerpe.git"
|
|
28
31
|
},
|
|
29
32
|
"scripts": {
|
|
30
|
-
"build": "rm -rf dist && rspack build && tsc --emitDeclarationOnly --outDir dist && cp dist/index.d.ts dist/index.d.cts"
|
|
33
|
+
"build": "rm -rf dist && rspack build && tsc --emitDeclarationOnly --outDir dist && cp dist/index.d.ts dist/index.d.cts && cp src/css/animations.css dist/animations.css"
|
|
31
34
|
},
|
|
32
35
|
"devDependencies": {
|
|
33
36
|
"@rspack/cli": "latest",
|