xeerpe 0.0.6 → 0.0.7
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/core/builder.d.ts +4 -1
- package/dist/core/builder.d.ts.map +1 -1
- package/dist/generators/pattern.d.ts +4 -0
- package/dist/generators/pattern.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/models/builder.d.ts +1 -1
- package/dist/models/builder.d.ts.map +1 -1
- package/dist/models/gradient.d.ts +1 -1
- package/dist/models/gradient.d.ts.map +1 -1
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/pattern.d.ts +21 -0
- package/dist/models/pattern.d.ts.map +1 -0
- package/dist/models/utils.d.ts +4 -0
- package/dist/models/utils.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/core/builder.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EffectOptions, EffectType, NoiseOptions, VignetteOptions, GrainOptions, BlurOptions, FilterType, FilterOptions, GlowOptions } from "../models/index.ts";
|
|
1
|
+
import { EffectOptions, EffectType, NoiseOptions, VignetteOptions, GrainOptions, BlurOptions, FilterType, FilterOptions, GlowOptions, PatternOptions, PatternType, DotsOptions, GridOptions } 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;
|
|
@@ -9,11 +9,14 @@ export declare class Builder {
|
|
|
9
9
|
meshGradient(options: MeshGradientOptions): this;
|
|
10
10
|
effect(type: EffectType, options: EffectOptions): this;
|
|
11
11
|
filter(type: FilterType, options: FilterOptions): this;
|
|
12
|
+
pattern(type: PatternType, options: PatternOptions): this;
|
|
12
13
|
noise(options: NoiseOptions): this;
|
|
13
14
|
vignette(options: VignetteOptions): this;
|
|
14
15
|
grain(options: GrainOptions): this;
|
|
15
16
|
glow(options: GlowOptions): this;
|
|
16
17
|
blur(options: BlurOptions): this;
|
|
18
|
+
dots(options: DotsOptions): this;
|
|
19
|
+
grid(options: GridOptions): this;
|
|
17
20
|
toStyle(): Record<string, string>;
|
|
18
21
|
toTextStyle(): any;
|
|
19
22
|
}
|
|
@@ -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,
|
|
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,EACd,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACH,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACxB,MAAM,oBAAoB,CAAC;AAG5B,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,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAIlC,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAIxC,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAIlC,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAIhC,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAIhC,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAIhC,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAIhC,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAwCjC,WAAW,IAAI,GAAG;CAWrB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BuilderLayer, PatternOptions, PatternType } from "../models/index.ts";
|
|
2
|
+
export declare const buildPatternByType: (type: PatternType, options: PatternOptions) => string;
|
|
3
|
+
export declare const buildPatternLayer: (type: PatternType, options: PatternOptions) => BuilderLayer;
|
|
4
|
+
//# sourceMappingURL=pattern.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../../src/generators/pattern.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EAEZ,cAAc,EAAE,WAAW,EAC9B,MAAM,oBAAoB,CAAC;AAkC5B,eAAO,MAAM,kBAAkB,GAAI,MAAM,WAAW,EAAE,SAAS,cAAc,KAAG,MAS/E,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,MAAM,WAAW,EAAE,SAAS,cAAc,KAAG,YAO9E,CAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={};e.d=(t,r,n)=>{var a=(r,n)=>{for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,[n]:r[a]})};a(r,"get"),a(n,"value")},e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};e.r(t),e.d(t,{Builder:()=>T,colors:()=>C});var r=/^-?\d*\.?\d+(%|px|rem|em|vh|vw|vmin|vmax)$/,n=/^calc\(.+\)$/,a=function(e){var t=e.trim();return r.test(t)||n.test(t)},o=/^-?\d*\.?\d+(deg|rad|grad|turn)$/,c=function(e){return o.test(e.trim())},i=["to top","to bottom","to left","to right","to top right","to bottom right","to top left","to bottom left"],l=function(e){if("string"==typeof e)return e;var t=e.color,r=e.position;return r&&a(r)?"".concat(t," ").concat(r):t},u=function(e){var t,r,n=e.angle&&c(e.angle)?e.angle:e.direction&&(t=e.direction,i.includes(t))?e.direction:"135deg",a=(null==(r=e.colors)?void 0:r.length)?e.colors.map(l).join(", "):"".concat(e.from,", ").concat(e.to),o=e.size?" ".concat(e.size):"";return"linear-gradient(".concat(n,", ").concat(a).concat(o,")")},f=function(e){var t,r,n=null===e.shape?"":"".concat(null!=(t=e.shape)?t:"circle"," "),a=e.size?" ".concat(e.size):"",o="at ".concat(null!=(r=e.position)?r:"center"),c=e.colorFromPosition?" ".concat(e.colorFromPosition):"",i=e.colorToPosition?" ".concat(e.colorToPosition):"",l="".concat(e.from).concat(c,", ").concat(e.to).concat(i);return"radial-gradient(".concat(n).concat(a," ").concat(o,", ").concat(l,")")},s=function(e){var t,r,n=e.angle&&c(e.angle)?"from ".concat(e.angle," "):"",a="at ".concat(null!=(t=e.position)?t:"center"),o=(null==(r=e.colors)?void 0:r.length)?e.colors.map(l).join(", "):"".concat(e.from,", ").concat(e.to);return"conic-gradient(".concat(n).concat(a,", ").concat(o,")")},d=function(e,t){switch(e){case"linear":return u(t);case"radial":return f(t);case"conic":return s(t);case"mesh":return t.layers.map(function(e){e.shape=null!=(t=e.shape)?t:null;var t,r=f(e);return"".concat(r)}).join(", ");default:throw Error("Unknown gradient type: ".concat(e))}},b=function(e,t){var r,n,a,o="mesh"===e;return{type:"gradient",properties:(r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},o&&{backgroundImage:d(e,t),backgroundColor:t.background},!o&&{background:d(e,t)}),n=n={backgroundSize:null!=(a=t.backgroundSize)?a:"auto"},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r)}},p=function(e){var t=e.replace("#",""),r=parseInt(3===t.length?t.split("").map(function(e){return e+e}).join(""):t,16);return{red:r>>16&255,green:r>>8&255,blue:255&r}},g=function(e,t){if(e.startsWith("#")){var r=p(e),n=r.red,a=r.green,o=r.blue;return"rgba(".concat(n,", ").concat(a,", ").concat(o,", ").concat(t,")")}return e.startsWith("rgb(")?e.replace("rgb(","rgba(").replace(")",", ".concat(t,")")):e.startsWith("hsl(")?e.replace("hsl(","hsla(").replace(")",", ".concat(t,")")):e},h=function(e,t,r){return Math.min(r,Math.max(t,e))},v=function(e){var t=e.opacity,r=e.scale,n=e.type,a=e.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===t?.25:t,'"/>\n </svg>'));return'url("data:image/svg+xml,'.concat(o,'")')},y=function(e){var t=e.color,r=e.intensity,n=e.spread,a=g(void 0===t?"#000000":t,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%)")},m=function(e){var t=e.intensity,r=e.size,n=void 0===r?"100%":r,a=e.animated,o=h(.08*(void 0===t?1:t),.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,'")')},k=function(e){var t=e.amount,r=e.spread,n=void 0===r?"":r,a=e.x,o=e.y,c=e.color,i=e.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===t?"20px":t).concat(n?" ".concat(n):""," ").concat(void 0===c?"#ffffff":c)},w=function(e,t){switch(e){case"noise":return v(t);case"vignette":return y(t);case"grain":return m(t);case"glow":return k(t);default:throw Error("Unknown gradient type: ".concat(e))}},O=function(e,t){var r;return"glow"===e?{type:"effect",properties:{boxShadow:w(e,t)}}:{type:"effect",properties:{backgroundImage:w(e,t),backgroundSize:null!=(r=t.backgroundSize)?r:"auto"}}},j=function(e){var t,r,n,a=e.amount,o=void 0===a?"20px":a,c=e.type;return"backdrop"===(void 0===c?"backdrop":c)?{properties:(t={backdropFilter:"blur(".concat(o,")")},r="-webkit-backdrop-filter",n="blur(".concat(o,")"),r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t)}:{properties:{filter:"blur(".concat(o,")")}}},S=function(e,t){if("blur"===e)return j(t);throw Error("Unknown filter type: ".concat(e))};function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function P(e){return function(e){if(Array.isArray(e))return x(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return x(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return x(e,void 0)}}(e)||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 T=function(){var e;function t(){var e,r;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");r=[],(e="_layers")in this?Object.defineProperty(this,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[e]=r}return e=[{key:"gradient",value:function(e,t){var r=b(e,t);return this._layers.push(r),this}},{key:"linearGradient",value:function(e){return this.gradient("linear",e)}},{key:"radialGradient",value:function(e){return this.gradient("radial",e)}},{key:"conicGradient",value:function(e){return this.gradient("conic",e)}},{key:"meshGradient",value:function(e){return this.gradient("mesh",e)}},{key:"effect",value:function(e,t){var r=O(e,t);return this._layers.push(r),this}},{key:"filter",value:function(e,t){var r={type:"filter",properties:S(e,t).properties};return this._layers.push(r),this}},{key:"noise",value:function(e){return this.effect("noise",e)}},{key:"vignette",value:function(e){return this.effect("vignette",e)}},{key:"grain",value:function(e){return this.effect("grain",e)}},{key:"glow",value:function(e){return this.effect("glow",e)}},{key:"blur",value:function(e){return this.filter("blur",e)}},{key:"toStyle",value:function(){var e,t,r,n={gradient:[],filter:[],effect:[]};this._layers.forEach(function(e){n[e.type].push(e.properties)});var a={};if(n.gradient.length||n.effect.length){var o,c=P(n.effect).concat(P(n.gradient)).flatMap(function(e){return[e.backgroundImage,e.background].filter(Boolean)}),i=P(n.effect).concat(P(n.gradient)).map(function(e){return e.backgroundSize}).filter(Boolean),l=n.effect.map(function(e){return e.boxShadow}).filter(Boolean),u=null==(o=n.gradient.find(function(e){return e.backgroundColor}))?void 0:o.backgroundColor;c.length&&(a.backgroundImage=c.join(", ")),i.length&&(a.backgroundSize=i.join(", ")),u&&(a.backgroundColor=u),l&&(a.boxShadow=l.join(", "))}return n.filter.length&&(console.log(n.filter),a.filter=null!=(e=n.filter[0].filter)?e:"",a.backdropFilter=null!=(t=null==(r=n.filter[0])?void 0:r.backdropFilter)?t:""),a}},{key:"toTextStyle",value:function(){var e,t=this.toStyle();return{backgroundImage:null!=(e=t.backgroundImage)?e:t.background,backgroundClip:"text",WebkitBackgroundClip:"text",color:"transparent",WebkitTextFillColor:"transparent"}}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}(),C={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=t})();
|
|
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})();
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={};e.d=(t,r,n)=>{var a=(r,n)=>{for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,[n]:r[a]})};a(r,"get"),a(n,"value")},e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var t={};e.d(t,{M:()=>T,T:()=>_});var r=/^-?\d*\.?\d+(%|px|rem|em|vh|vw|vmin|vmax)$/,n=/^calc\(.+\)$/,a=function(e){var t=e.trim();return r.test(t)||n.test(t)},o=/^-?\d*\.?\d+(deg|rad|grad|turn)$/,c=function(e){return o.test(e.trim())},i=["to top","to bottom","to left","to right","to top right","to bottom right","to top left","to bottom left"],l=function(e){if("string"==typeof e)return e;var t=e.color,r=e.position;return r&&a(r)?"".concat(t," ").concat(r):t},u=function(e){var t,r,n=e.angle&&c(e.angle)?e.angle:e.direction&&(t=e.direction,i.includes(t))?e.direction:"135deg",a=(null==(r=e.colors)?void 0:r.length)?e.colors.map(l).join(", "):"".concat(e.from,", ").concat(e.to),o=e.size?" ".concat(e.size):"";return"linear-gradient(".concat(n,", ").concat(a).concat(o,")")},f=function(e){var t,r,n=null===e.shape?"":"".concat(null!=(t=e.shape)?t:"circle"," "),a=e.size?" ".concat(e.size):"",o="at ".concat(null!=(r=e.position)?r:"center"),c=e.colorFromPosition?" ".concat(e.colorFromPosition):"",i=e.colorToPosition?" ".concat(e.colorToPosition):"",l="".concat(e.from).concat(c,", ").concat(e.to).concat(i);return"radial-gradient(".concat(n).concat(a," ").concat(o,", ").concat(l,")")},s=function(e){var t,r,n=e.angle&&c(e.angle)?"from ".concat(e.angle," "):"",a="at ".concat(null!=(t=e.position)?t:"center"),o=(null==(r=e.colors)?void 0:r.length)?e.colors.map(l).join(", "):"".concat(e.from,", ").concat(e.to);return"conic-gradient(".concat(n).concat(a,", ").concat(o,")")},d=function(e,t){switch(e){case"linear":return u(t);case"radial":return f(t);case"conic":return s(t);case"mesh":return t.layers.map(function(e){e.shape=null!=(t=e.shape)?t:null;var t,r=f(e);return"".concat(r)}).join(", ");default:throw Error("Unknown gradient type: ".concat(e))}},p=function(e,t){var r,n,a,o="mesh"===e;return{type:"gradient",properties:(r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},o&&{backgroundImage:d(e,t),backgroundColor:t.background},!o&&{background:d(e,t)}),n=n={backgroundSize:null!=(a=t.backgroundSize)?a:"auto"},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r)}},b=function(e){var t=e.replace("#",""),r=parseInt(3===t.length?t.split("").map(function(e){return e+e}).join(""):t,16);return{red:r>>16&255,green:r>>8&255,blue:255&r}},g=function(e,t){if(e.startsWith("#")){var r=b(e),n=r.red,a=r.green,o=r.blue;return"rgba(".concat(n,", ").concat(a,", ").concat(o,", ").concat(t,")")}return e.startsWith("rgb(")?e.replace("rgb(","rgba(").replace(")",", ".concat(t,")")):e.startsWith("hsl(")?e.replace("hsl(","hsla(").replace(")",", ".concat(t,")")):e},h=function(e,t,r){return Math.min(r,Math.max(t,e))},v=function(e){var t=e.opacity,r=e.scale,n=e.type,a=e.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===t?.25:t,'"/>\n </svg>'));return'url("data:image/svg+xml,'.concat(o,'")')},y=function(e){var t=e.color,r=e.intensity,n=e.spread,a=g(void 0===t?"#000000":t,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%)")},m=function(e){var t=e.intensity,r=e.size,n=void 0===r?"100%":r,a=e.animated,o=h(.08*(void 0===t?1:t),.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,'")')},k=function(e){var t=e.amount,r=e.spread,n=void 0===r?"":r,a=e.x,o=e.y,c=e.color,i=e.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===t?"20px":t).concat(n?" ".concat(n):""," ").concat(void 0===c?"#ffffff":c)},w=function(e,t){switch(e){case"noise":return v(t);case"vignette":return y(t);case"grain":return m(t);case"glow":return k(t);default:throw Error("Unknown gradient type: ".concat(e))}},O=function(e,t){var r;return"glow"===e?{type:"effect",properties:{boxShadow:w(e,t)}}:{type:"effect",properties:{backgroundImage:w(e,t),backgroundSize:null!=(r=t.backgroundSize)?r:"auto"}}},j=function(e){var t,r,n,a=e.amount,o=void 0===a?"20px":a,c=e.type;return"backdrop"===(void 0===c?"backdrop":c)?{properties:(t={backdropFilter:"blur(".concat(o,")")},r="-webkit-backdrop-filter",n="blur(".concat(o,")"),r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t)}:{properties:{filter:"blur(".concat(o,")")}}},x=function(e,t){if("blur"===e)return j(t);throw Error("Unknown filter type: ".concat(e))};function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function P(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return S(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return S(e,void 0)}}(e)||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 T=function(){"use strict";var e;function t(){var e,r;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");r=[],(e="_layers")in this?Object.defineProperty(this,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[e]=r}return e=[{key:"gradient",value:function(e,t){var r=p(e,t);return this._layers.push(r),this}},{key:"linearGradient",value:function(e){return this.gradient("linear",e)}},{key:"radialGradient",value:function(e){return this.gradient("radial",e)}},{key:"conicGradient",value:function(e){return this.gradient("conic",e)}},{key:"meshGradient",value:function(e){return this.gradient("mesh",e)}},{key:"effect",value:function(e,t){var r=O(e,t);return this._layers.push(r),this}},{key:"filter",value:function(e,t){var r={type:"filter",properties:x(e,t).properties};return this._layers.push(r),this}},{key:"noise",value:function(e){return this.effect("noise",e)}},{key:"vignette",value:function(e){return this.effect("vignette",e)}},{key:"grain",value:function(e){return this.effect("grain",e)}},{key:"glow",value:function(e){return this.effect("glow",e)}},{key:"blur",value:function(e){return this.filter("blur",e)}},{key:"toStyle",value:function(){var e,t,r,n={gradient:[],filter:[],effect:[]};this._layers.forEach(function(e){n[e.type].push(e.properties)});var a={};if(n.gradient.length||n.effect.length){var o,c=P(n.effect).concat(P(n.gradient)).flatMap(function(e){return[e.backgroundImage,e.background].filter(Boolean)}),i=P(n.effect).concat(P(n.gradient)).map(function(e){return e.backgroundSize}).filter(Boolean),l=n.effect.map(function(e){return e.boxShadow}).filter(Boolean),u=null==(o=n.gradient.find(function(e){return e.backgroundColor}))?void 0:o.backgroundColor;c.length&&(a.backgroundImage=c.join(", ")),i.length&&(a.backgroundSize=i.join(", ")),u&&(a.backgroundColor=u),l&&(a.boxShadow=l.join(", "))}return n.filter.length&&(console.log(n.filter),a.filter=null!=(e=n.filter[0].filter)?e:"",a.backdropFilter=null!=(t=null==(r=n.filter[0])?void 0:r.backdropFilter)?t:""),a}},{key:"toTextStyle",value:function(){var e,t=this.toStyle();return{backgroundImage:null!=(e=t.backgroundImage)?e:t.background,backgroundClip:"text",WebkitBackgroundClip:"text",color:"transparent",WebkitTextFillColor:"transparent"}}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}(),_={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"},C=t.M,I=t.T;export{C as Builder,I as colors};
|
|
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};
|
package/dist/models/builder.d.ts
CHANGED
|
@@ -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,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,CAAA;AAEpE,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;CACrB;AAGD,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,SAAS,CAAA;IACf,UAAU,EAAE,aAAa,CAAA;CAC5B"}
|
|
@@ -3,9 +3,9 @@ export type LinearGradientDirection = 'to top' | 'to bottom' | 'to left' | 'to r
|
|
|
3
3
|
export type LinearGradientAngle = `${number}deg` | `${number}rad` | `${number}grad` | `${number}turn`;
|
|
4
4
|
export type RadialGradientShape = 'circle' | 'ellipse' | null;
|
|
5
5
|
export type RadialGradientSize = 'closest-side' | 'closest-corner' | 'farthest-side' | 'farthest-corner' | string;
|
|
6
|
-
export type GradientOptions = LinearGradientOptions | RadialGradientOptions | ConicGradientOptions | MeshGradientOptions;
|
|
7
6
|
export type LinearGradientPositionUnit = `${number}%` | `${number}px` | `${number}rem` | `${number}em` | `${number}vh` | `${number}vw` | `${number}vmin` | `${number}vmax`;
|
|
8
7
|
export type LinearGradientPosition = LinearGradientPositionUnit | `calc(${string})`;
|
|
8
|
+
export type GradientOptions = LinearGradientOptions | RadialGradientOptions | ConicGradientOptions | MeshGradientOptions;
|
|
9
9
|
export type GradientColorStop = string | {
|
|
10
10
|
color: string;
|
|
11
11
|
position?: LinearGradientPosition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gradient.d.ts","sourceRoot":"","sources":["../../src/models/gradient.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;AACjE,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,cAAc,GAAG,iBAAiB,GAAG,aAAa,GAAG,gBAAgB,CAAA;AAC7J,MAAM,MAAM,mBAAmB,GACzB,GAAG,MAAM,KAAK,GACd,GAAG,MAAM,KAAK,GACd,GAAG,MAAM,MAAM,GACf,GAAG,MAAM,MAAM,CAAA;AACrB,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAA;AAC7D,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAAG,gBAAgB,GAAG,eAAe,GAAG,iBAAiB,GAAG,MAAM,CAAA;AACjH,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"gradient.d.ts","sourceRoot":"","sources":["../../src/models/gradient.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;AACjE,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,cAAc,GAAG,iBAAiB,GAAG,aAAa,GAAG,gBAAgB,CAAA;AAC7J,MAAM,MAAM,mBAAmB,GACzB,GAAG,MAAM,KAAK,GACd,GAAG,MAAM,KAAK,GACd,GAAG,MAAM,MAAM,GACf,GAAG,MAAM,MAAM,CAAA;AACrB,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAA;AAC7D,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAAG,gBAAgB,GAAG,eAAe,GAAG,iBAAiB,GAAG,MAAM,CAAA;AACjH,MAAM,MAAM,0BAA0B,GAChC,GAAG,MAAM,GAAG,GACZ,GAAG,MAAM,IAAI,GACb,GAAG,MAAM,KAAK,GACd,GAAG,MAAM,IAAI,GACb,GAAG,MAAM,IAAI,GACb,GAAG,MAAM,IAAI,GACb,GAAG,MAAM,MAAM,GACf,GAAG,MAAM,MAAM,CAAA;AAErB,MAAM,MAAM,sBAAsB,GAC5B,0BAA0B,GAC1B,QAAQ,MAAM,GAAG,CAAA;AAEvB,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAAG,qBAAqB,GAAG,oBAAoB,GAAG,mBAAmB,CAAA;AAExH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,sBAAsB,CAAA;CAAE,CAAA;AAE7F,MAAM,WAAW,YAAY;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,cAAc,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IACvD,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,iBAAiB,CAAC,EAAE,CAAA;IACvC,KAAK,CAAC,EAAE,mBAAmB,CAAA;IAC3B,SAAS,CAAC,EAAE,uBAAuB,CAAA;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IACvD,KAAK,CAAC,EAAE,mBAAmB,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACtD,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,iBAAiB,CAAC,EAAE,CAAA;IACvC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,qBAAqB,EAAE,CAAA;CAClC"}
|
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,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,YAAY,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type PatternType = 'dots' | 'grid';
|
|
2
|
+
export interface PatterBaseOptions {
|
|
3
|
+
color?: string;
|
|
4
|
+
background?: string;
|
|
5
|
+
size?: string;
|
|
6
|
+
opacity?: number;
|
|
7
|
+
strokeWidth?: string;
|
|
8
|
+
backgroundSize?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface DotsOptions extends PatterBaseOptions {
|
|
11
|
+
color?: string;
|
|
12
|
+
background?: string;
|
|
13
|
+
size?: string;
|
|
14
|
+
spacing?: string;
|
|
15
|
+
style?: string;
|
|
16
|
+
opacity?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface GridOptions extends PatterBaseOptions {
|
|
19
|
+
}
|
|
20
|
+
export type PatternOptions = DotsOptions | GridOptions;
|
|
21
|
+
//# sourceMappingURL=pattern.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../../src/models/pattern.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAA;AAEzC,MAAM,WAAW,iBAAiB;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,WAAY,SAAQ,iBAAiB;IAClD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAY,SAAQ,iBAAiB;CAAG;AAEzD,MAAM,MAAM,cAAc,GAAI,WAAW,GAAG,WAAW,CAAA"}
|
package/dist/models/utils.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/models/utils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/models/utils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AACnF,MAAM,MAAM,SAAS,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { RgbColor } from "../models/index.ts";
|
|
1
|
+
import { CSSLength, RgbColor } from "../models/index.ts";
|
|
2
2
|
export declare const hexToRgb: (hex: string) => RgbColor;
|
|
3
3
|
export declare const withAlpha: (color: string, alpha: number) => string;
|
|
4
4
|
export declare const clamp: (value: number, min: number, max: number) => number;
|
|
5
|
+
export declare const parseLength: (input: string) => CSSLength;
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,oBAAoB,CAAC;AAEvD,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,KAAG,QAWtC,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,EAAE,OAAO,MAAM,KAAG,MAYxD,CAAA;AAED,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,MACzB,CAAA;AAGvC,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,KAAG,SAK3C,CAAA"}
|