real-time-gradient 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -176,56 +176,69 @@ gradient.triggerEffect({ hue: "gold", duration: 2000 });
176
176
 
177
177
  ```ts
178
178
  // index.d.ts
179
- declare module "real-time-gradient" {
180
- type GradientType = "linear" | "radial";
179
+ export type GradientType = "linear" | "radial";
181
180
 
182
- type HuePreset = "white" | "black" | "gold" | "silver" | string;
183
- // string allows custom hex codes "#RRGGBB"
181
+ export type HuePreset = "white" | "black" | "gold" | "silver" | string;
184
182
 
185
- interface ScheduleEntry {
186
- time: string; // "HH:MM" in 24h format
187
- colors: string[]; // array of CSS color values
188
- type?: GradientType;
189
- direction?: string;
183
+ export interface ScheduleEntry {
184
+ time: string;
185
+ colors: string[];
186
+ }
187
+
188
+ export interface GradientOptions {
189
+ type?: GradientType;
190
+ direction?: string;
191
+ colors?: string[];
192
+ transitionDuration?: number;
193
+ schedule?: ScheduleEntry[];
194
+ textClip?: boolean;
195
+ }
196
+
197
+ export interface EffectOptions {
198
+ applyColors?: string[];
199
+ duration?: number;
200
+ hue?: HuePreset;
201
+ }
202
+
203
+ export class DynamicGradient {
204
+ private container: HTMLElement;
205
+ private options: GradientOptions;
206
+
207
+ constructor(container: string | HTMLElement, options: GradientOptions = {}) {
208
+ this.container =
209
+ typeof container === "string"
210
+ ? (document.querySelector(container) as HTMLElement)
211
+ : container;
212
+
213
+ this.options = options;
214
+ }
215
+
216
+ static init(container: string | HTMLElement, options?: GradientOptions) {
217
+ return new DynamicGradient(container, options);
190
218
  }
191
219
 
192
- interface GradientOptions {
220
+ setGradient(options: {
221
+ colors: string[];
193
222
  type?: GradientType;
194
223
  direction?: string;
195
- colors?: string[];
196
- transitionDuration?: number;
197
- schedule?: ScheduleEntry[];
198
- textClip?: boolean;
224
+ }): void {
225
+ // implementation
199
226
  }
200
227
 
201
- interface EffectOptions {
202
- applyColors?: string[];
203
- duration?: number;
204
- hue?: HuePreset;
228
+ schedule(entries: ScheduleEntry[]): void {
229
+ // implementation
205
230
  }
206
231
 
207
- export class DynamicGradient {
208
- constructor(container: string | HTMLElement, options?: GradientOptions);
209
-
210
- static init(
211
- container: string | HTMLElement,
212
- options?: GradientOptions
213
- ): DynamicGradient;
214
-
215
- setGradient(options: {
216
- colors: string[];
217
- type?: GradientType;
218
- direction?: string;
219
- }): void;
220
-
221
- schedule(entries: ScheduleEntry[]): void;
222
-
223
- triggerEffect(options?: EffectOptions): void;
232
+ triggerEffect(options?: EffectOptions): void {
233
+ // implementation
234
+ }
224
235
 
225
- persistEffect(colors: string[], duration?: number): void;
236
+ persistEffect(colors: string[], duration?: number): void {
237
+ // implementation
238
+ }
226
239
 
227
- stopEffects(): void;
228
- destroy(): void;
240
+ stopEffects(): void {
241
+ // implementation
229
242
  }
230
243
  }
231
244
  ```
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  export type GradientType = "linear" | "radial";
2
- export type HuePreset = "white" | "black" | "gold" | "silver" | string;
3
2
  export interface ScheduleEntry {
4
3
  time: string;
5
4
  colors: string[];
5
+ type?: GradientType;
6
+ direction?: string;
6
7
  }
7
8
  export interface GradientOptions {
8
9
  type?: GradientType;
@@ -15,20 +16,10 @@ export interface GradientOptions {
15
16
  export interface EffectOptions {
16
17
  applyColors?: string[];
17
18
  duration?: number;
18
- hue?: HuePreset;
19
- }
20
- export declare class DynamicGradient {
21
- private container;
22
- private options;
23
- constructor(container: string | HTMLElement, options?: GradientOptions);
24
- static init(container: string | HTMLElement, options?: GradientOptions): DynamicGradient;
25
- setGradient(options: {
26
- colors: string[];
27
- type?: GradientType;
28
- direction?: string;
29
- }): void;
30
- schedule(entries: ScheduleEntry[]): void;
31
- triggerEffect(options?: EffectOptions): void;
32
- persistEffect(colors: string[], duration?: number): void;
33
- stopEffects(): void;
19
+ hue?: "white" | "black" | "gold" | "silver" | string;
20
+ loop?: boolean;
34
21
  }
22
+ export declare const DynamicGradient: {
23
+ new (container: string | HTMLElement, options?: GradientOptions): any;
24
+ init(container: string | HTMLElement, options?: GradientOptions): any;
25
+ };
package/dist/index.es.js CHANGED
@@ -1,21 +1,225 @@
1
- class s {
2
- constructor(t, e = {}) {
3
- this.container = typeof t == "string" ? document.querySelector(t) : t, this.options = e;
1
+ function c(n, e = "linear", t = "to right") {
2
+ return e === "linear" ? `linear-gradient(${t}, ${n.join(",")})` : `radial-gradient(circle, ${n.join(",")})`;
3
+ }
4
+ function f(n, e, t) {
5
+ const i = document.createElement("div");
6
+ return Object.assign(i.style, {
7
+ position: "absolute",
8
+ top: 0,
9
+ left: 0,
10
+ width: "100%",
11
+ height: "100%",
12
+ pointerEvents: "none",
13
+ zIndex: 0,
14
+ background: e,
15
+ opacity: "0",
16
+ transition: `opacity ${t}ms ease-in-out`
17
+ }), n.appendChild(i), i;
18
+ }
19
+ function v(n, e, t) {
20
+ const i = document.createElement("span");
21
+ i.textContent = n.textContent, Object.assign(i.style, {
22
+ position: "absolute",
23
+ top: 0,
24
+ left: 0,
25
+ width: "100%",
26
+ height: "100%",
27
+ display: "inline-block",
28
+ background: e,
29
+ WebkitBackgroundClip: "text",
30
+ backgroundClip: "text",
31
+ WebkitTextFillColor: "transparent",
32
+ color: "transparent",
33
+ pointerEvents: "none",
34
+ opacity: "0",
35
+ transition: `opacity ${t}ms ease-in-out`,
36
+ zIndex: 20
37
+ });
38
+ const s = n.parentNode;
39
+ return getComputedStyle(s).position === "static" && (s.style.position = "relative"), s.appendChild(i), requestAnimationFrame(() => {
40
+ i.style.opacity = "1";
41
+ }), i;
42
+ }
43
+ function b(n, e) {
44
+ if (n.__dgTextFx && n.__dgTextFx.duration !== e) {
45
+ const { a: o, b: a } = n.__dgTextFx;
46
+ return o.style.transition = a.style.transition = `opacity ${e}ms ease-in-out`, n.__dgTextFx.duration = e, n.__dgTextFx;
4
47
  }
5
- static init(t, e) {
6
- return new s(t, e);
48
+ if (n.__dgTextFx) return n.__dgTextFx;
49
+ const t = n.parentNode;
50
+ getComputedStyle(t).position === "static" && (t.style.position = "relative");
51
+ const i = (o) => {
52
+ const a = document.createElement("span");
53
+ return a.textContent = n.textContent, Object.assign(a.style, {
54
+ position: "absolute",
55
+ top: 0,
56
+ left: 0,
57
+ width: "100%",
58
+ height: "100%",
59
+ display: "inline-block",
60
+ WebkitBackgroundClip: "text",
61
+ backgroundClip: "text",
62
+ WebkitTextFillColor: "transparent",
63
+ color: "transparent",
64
+ pointerEvents: "none",
65
+ opacity: "0",
66
+ willChange: "opacity",
67
+ zIndex: o,
68
+ transition: `opacity ${e}ms ease-in-out`
69
+ }), t.appendChild(a), a;
70
+ }, s = i(20), r = i(21);
71
+ return n.__dgTextFx = { a: s, b: r, visible: null, duration: e }, n.__dgTextFx;
72
+ }
73
+ function k() {
74
+ const n = /* @__PURE__ */ new Date();
75
+ return `${String(n.getHours()).padStart(2, "0")}:${String(
76
+ n.getMinutes()
77
+ ).padStart(2, "0")}`;
78
+ }
79
+ function C(n, e) {
80
+ if (!n.length) return null;
81
+ let t = n[0];
82
+ for (let i = 0; i < n.length; i++)
83
+ e >= n[i].time && (t = n[i]);
84
+ return e < n[0].time && (t = n[n.length - 1]), t;
85
+ }
86
+ const p = {
87
+ white: "#ffffff",
88
+ black: "#000000",
89
+ gold: "#ffe864ff",
90
+ silver: "#d4d4d4ff"
91
+ };
92
+ let I = class g {
93
+ constructor(e, t = {}) {
94
+ if (this.container = typeof e == "string" ? document.querySelector(e) : e, !this.container)
95
+ throw new Error("DynamicGradient: container not found.");
96
+ this.type = t.type || "linear", this.direction = t.direction || "to right", this.colors = t.colors || ["#1e3c72", "#2a5298"], this.transitionDuration = t.transitionDuration ?? 1500, this.textClip = t.textClip || !1, this.scheduleData = t.schedule || [], this.currentInterval = null, this.lastAppliedKey = null, this.container.style.position = this.container.style.position || "relative", this.applyGradient(this.colors, this.type, this.direction, !1), this.scheduleData.length > 0 && this.schedule(this.scheduleData);
7
97
  }
8
- setGradient(t) {
98
+ /** Apply gradient with optional transition */
99
+ applyGradient(e = this.colors, t = this.type, i = this.direction, s = !0) {
100
+ const r = c(e, t, i), o = this.container.style.background;
101
+ r !== o && (this.textClip ? (v(
102
+ this.container,
103
+ r,
104
+ this.transitionDuration
105
+ ), this.container.style.fontWeight = "inherit") : s ? (this.transitionOverlay && this.transitionOverlay.remove(), this.transitionOverlay = f(
106
+ this.container,
107
+ r,
108
+ this.transitionDuration
109
+ ), requestAnimationFrame(() => {
110
+ this.transitionOverlay.style.opacity = "1";
111
+ }), setTimeout(() => {
112
+ this.container.style.background = r, this.transitionOverlay.remove(), this.transitionOverlay = null;
113
+ }, this.transitionDuration)) : this.container.style.background = r, this.colors = e, this.type = t, this.direction = i);
9
114
  }
10
- schedule(t) {
115
+ /** Allow toggling text-clip dynamically */
116
+ setTextClip(e = !0) {
117
+ this.textClip = e, this.applyGradient(this.colors, this.type, this.direction, !1);
11
118
  }
12
- triggerEffect(t) {
119
+ /** Trigger a temporary animated effect */
120
+ triggerEffect({
121
+ applyColors: e = null,
122
+ duration: t = this.transitionDuration,
123
+ loop: i = !0,
124
+ hue: s = "white"
125
+ } = {}) {
126
+ let r;
127
+ p[s] ? r = p[s] : /^#([0-9A-F]{3}){1,2}$/i.test(s) ? r = s : r = "#ffffff";
128
+ const o = e ? c(e, this.type, this.direction) : c([...this.colors, r], this.type, this.direction);
129
+ if (this.textClip) {
130
+ const y = b(this.container, t), d = () => {
131
+ const { a: h, b: m, visible: x } = y, l = x === "a" ? m : h, T = e ? c(e, this.type, this.direction) : c(
132
+ [...this.colors, p[s] || r],
133
+ this.type,
134
+ this.direction
135
+ );
136
+ l.style.background = T, l.style.backgroundClip = "text", l.style.transition = `opacity ${t}ms ease-in-out`, l.style.opacity = "0", requestAnimationFrame(() => {
137
+ requestAnimationFrame(() => {
138
+ l.style.opacity = "1";
139
+ });
140
+ }), setTimeout(() => {
141
+ l.style.opacity = "0";
142
+ }, t), y.visible = l === h ? "a" : "b", i ? (this.effectLoopTimeout && clearTimeout(this.effectLoopTimeout), this.effectLoopTimeout = setTimeout(d, t * 2)) : setTimeout(() => {
143
+ this.applyGradient(
144
+ e || this.colors,
145
+ this.type,
146
+ this.direction,
147
+ !1
148
+ ), h.style.opacity = "0", m.style.opacity = "0";
149
+ }, t * 2);
150
+ };
151
+ d();
152
+ return;
153
+ }
154
+ this.effectOverlay || (this.effectOverlay = f(
155
+ this.container,
156
+ o,
157
+ t
158
+ ));
159
+ const a = this.effectOverlay, u = () => {
160
+ a.style.background = o, a.style.opacity = "1", setTimeout(() => {
161
+ a.style.opacity = "0";
162
+ }, t);
163
+ };
164
+ this.effectRunning || (this.effectRunning = !0, u(), i ? (this.effectLoopInterval && clearInterval(this.effectLoopInterval), this.effectLoopInterval = setInterval(u, t * 2)) : setTimeout(() => {
165
+ a.remove(), this.effectOverlay = null;
166
+ }, t * 2));
13
167
  }
14
- persistEffect(t, e) {
168
+ persistEffect(e = this.colors, t = this.transitionDuration) {
169
+ const i = c(
170
+ e,
171
+ this.type,
172
+ this.direction
173
+ );
174
+ if (this.textClip) {
175
+ const s = v(
176
+ this.container,
177
+ i,
178
+ t
179
+ );
180
+ requestAnimationFrame(() => {
181
+ s.style.opacity = "1";
182
+ }), setTimeout(() => {
183
+ this.applyGradient(e, this.type, this.direction, !1);
184
+ }, t);
185
+ } else {
186
+ const s = f(this.container, i, t);
187
+ requestAnimationFrame(() => {
188
+ s.style.opacity = "1";
189
+ }), setTimeout(() => {
190
+ this.applyGradient(e, this.type, this.direction, !1), s.remove();
191
+ }, t);
192
+ }
15
193
  }
16
194
  stopEffects() {
195
+ this.effectLoopInterval && (clearInterval(this.effectLoopInterval), this.effectLoopInterval = null), this.effectLoopTimeout && (clearTimeout(this.effectLoopTimeout), this.effectLoopTimeout = null), this.effectRunning = !1;
17
196
  }
18
- }
197
+ // ✅ added: cleanup method to prevent leaks
198
+ destroy() {
199
+ this.stopEffects(), this.currentInterval && (clearInterval(this.currentInterval), this.currentInterval = null), this.transitionOverlay && (this.transitionOverlay.remove(), this.transitionOverlay = null), this.effectOverlay && (this.effectOverlay.remove(), this.effectOverlay = null);
200
+ }
201
+ setGradient({ colors: e, type: t, direction: i }) {
202
+ const s = e || this.colors, r = t || this.type, o = i || this.direction;
203
+ s.join(",") === this.colors.join(",") && r === this.type && o === this.direction || this.applyGradient(s, r, o, !0);
204
+ }
205
+ schedule(e = []) {
206
+ this.scheduleData = e.map((t) => ({
207
+ ...t,
208
+ time: t.time.padStart(5, "0")
209
+ })).sort((t, i) => t.time.localeCompare(i.time)), this.currentInterval && clearInterval(this.currentInterval), this.checkSchedule(), this.currentInterval = setInterval(() => this.checkSchedule(), 60 * 1e3);
210
+ }
211
+ checkSchedule() {
212
+ const e = k(), t = C(this.scheduleData, e);
213
+ if (t) {
214
+ const i = `${t.time}-${t.colors.join(",")}`;
215
+ i !== this.lastAppliedKey && (this.setGradient(t), this.lastAppliedKey = i);
216
+ }
217
+ }
218
+ static init(e, t) {
219
+ return new g(e, t);
220
+ }
221
+ };
222
+ const O = I;
19
223
  export {
20
- s as DynamicGradient
224
+ O as DynamicGradient
21
225
  };
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(i,t){typeof exports=="object"&&typeof module<"u"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):(i=typeof globalThis<"u"?globalThis:i||self,t(i.RealTimeGradient={}))})(this,function(i){"use strict";class t{constructor(e,n={}){this.container=typeof e=="string"?document.querySelector(e):e,this.options=n}static init(e,n){return new t(e,n)}setGradient(e){}schedule(e){}triggerEffect(e){}persistEffect(e,n){}stopEffects(){}}i.DynamicGradient=t,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
1
+ (function(h,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(h=typeof globalThis<"u"?globalThis:h||self,l(h.RealTimeGradient={}))})(this,function(h){"use strict";function l(n,e="linear",t="to right"){return e==="linear"?`linear-gradient(${t}, ${n.join(",")})`:`radial-gradient(circle, ${n.join(",")})`}function f(n,e,t){const i=document.createElement("div");return Object.assign(i.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:0,background:e,opacity:"0",transition:`opacity ${t}ms ease-in-out`}),n.appendChild(i),i}function y(n,e,t){const i=document.createElement("span");i.textContent=n.textContent,Object.assign(i.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"inline-block",background:e,WebkitBackgroundClip:"text",backgroundClip:"text",WebkitTextFillColor:"transparent",color:"transparent",pointerEvents:"none",opacity:"0",transition:`opacity ${t}ms ease-in-out`,zIndex:20});const s=n.parentNode;return getComputedStyle(s).position==="static"&&(s.style.position="relative"),s.appendChild(i),requestAnimationFrame(()=>{i.style.opacity="1"}),i}function T(n,e){if(n.__dgTextFx&&n.__dgTextFx.duration!==e){const{a:o,b:a}=n.__dgTextFx;return o.style.transition=a.style.transition=`opacity ${e}ms ease-in-out`,n.__dgTextFx.duration=e,n.__dgTextFx}if(n.__dgTextFx)return n.__dgTextFx;const t=n.parentNode;getComputedStyle(t).position==="static"&&(t.style.position="relative");const i=o=>{const a=document.createElement("span");return a.textContent=n.textContent,Object.assign(a.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"inline-block",WebkitBackgroundClip:"text",backgroundClip:"text",WebkitTextFillColor:"transparent",color:"transparent",pointerEvents:"none",opacity:"0",willChange:"opacity",zIndex:o,transition:`opacity ${e}ms ease-in-out`}),t.appendChild(a),a},s=i(20),r=i(21);return n.__dgTextFx={a:s,b:r,visible:null,duration:e},n.__dgTextFx}function b(){const n=new Date;return`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}`}function k(n,e){if(!n.length)return null;let t=n[0];for(let i=0;i<n.length;i++)e>=n[i].time&&(t=n[i]);return e<n[0].time&&(t=n[n.length-1]),t}const u={white:"#ffffff",black:"#000000",gold:"#ffe864ff",silver:"#d4d4d4ff"},C=class x{constructor(e,t={}){if(this.container=typeof e=="string"?document.querySelector(e):e,!this.container)throw new Error("DynamicGradient: container not found.");this.type=t.type||"linear",this.direction=t.direction||"to right",this.colors=t.colors||["#1e3c72","#2a5298"],this.transitionDuration=t.transitionDuration??1500,this.textClip=t.textClip||!1,this.scheduleData=t.schedule||[],this.currentInterval=null,this.lastAppliedKey=null,this.container.style.position=this.container.style.position||"relative",this.applyGradient(this.colors,this.type,this.direction,!1),this.scheduleData.length>0&&this.schedule(this.scheduleData)}applyGradient(e=this.colors,t=this.type,i=this.direction,s=!0){const r=l(e,t,i),o=this.container.style.background;r!==o&&(this.textClip?(y(this.container,r,this.transitionDuration),this.container.style.fontWeight="inherit"):s?(this.transitionOverlay&&this.transitionOverlay.remove(),this.transitionOverlay=f(this.container,r,this.transitionDuration),requestAnimationFrame(()=>{this.transitionOverlay.style.opacity="1"}),setTimeout(()=>{this.container.style.background=r,this.transitionOverlay.remove(),this.transitionOverlay=null},this.transitionDuration)):this.container.style.background=r,this.colors=e,this.type=t,this.direction=i)}setTextClip(e=!0){this.textClip=e,this.applyGradient(this.colors,this.type,this.direction,!1)}triggerEffect({applyColors:e=null,duration:t=this.transitionDuration,loop:i=!0,hue:s="white"}={}){let r;u[s]?r=u[s]:/^#([0-9A-F]{3}){1,2}$/i.test(s)?r=s:r="#ffffff";const o=e?l(e,this.type,this.direction):l([...this.colors,r],this.type,this.direction);if(this.textClip){const m=T(this.container,t),v=()=>{const{a:p,b:g,visible:O}=m,c=O==="a"?g:p,I=e?l(e,this.type,this.direction):l([...this.colors,u[s]||r],this.type,this.direction);c.style.background=I,c.style.backgroundClip="text",c.style.transition=`opacity ${t}ms ease-in-out`,c.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{c.style.opacity="1"})}),setTimeout(()=>{c.style.opacity="0"},t),m.visible=c===p?"a":"b",i?(this.effectLoopTimeout&&clearTimeout(this.effectLoopTimeout),this.effectLoopTimeout=setTimeout(v,t*2)):setTimeout(()=>{this.applyGradient(e||this.colors,this.type,this.direction,!1),p.style.opacity="0",g.style.opacity="0"},t*2)};v();return}this.effectOverlay||(this.effectOverlay=f(this.container,o,t));const a=this.effectOverlay,d=()=>{a.style.background=o,a.style.opacity="1",setTimeout(()=>{a.style.opacity="0"},t)};this.effectRunning||(this.effectRunning=!0,d(),i?(this.effectLoopInterval&&clearInterval(this.effectLoopInterval),this.effectLoopInterval=setInterval(d,t*2)):setTimeout(()=>{a.remove(),this.effectOverlay=null},t*2))}persistEffect(e=this.colors,t=this.transitionDuration){const i=l(e,this.type,this.direction);if(this.textClip){const s=y(this.container,i,t);requestAnimationFrame(()=>{s.style.opacity="1"}),setTimeout(()=>{this.applyGradient(e,this.type,this.direction,!1)},t)}else{const s=f(this.container,i,t);requestAnimationFrame(()=>{s.style.opacity="1"}),setTimeout(()=>{this.applyGradient(e,this.type,this.direction,!1),s.remove()},t)}}stopEffects(){this.effectLoopInterval&&(clearInterval(this.effectLoopInterval),this.effectLoopInterval=null),this.effectLoopTimeout&&(clearTimeout(this.effectLoopTimeout),this.effectLoopTimeout=null),this.effectRunning=!1}destroy(){this.stopEffects(),this.currentInterval&&(clearInterval(this.currentInterval),this.currentInterval=null),this.transitionOverlay&&(this.transitionOverlay.remove(),this.transitionOverlay=null),this.effectOverlay&&(this.effectOverlay.remove(),this.effectOverlay=null)}setGradient({colors:e,type:t,direction:i}){const s=e||this.colors,r=t||this.type,o=i||this.direction;s.join(",")===this.colors.join(",")&&r===this.type&&o===this.direction||this.applyGradient(s,r,o,!0)}schedule(e=[]){this.scheduleData=e.map(t=>({...t,time:t.time.padStart(5,"0")})).sort((t,i)=>t.time.localeCompare(i.time)),this.currentInterval&&clearInterval(this.currentInterval),this.checkSchedule(),this.currentInterval=setInterval(()=>this.checkSchedule(),60*1e3)}checkSchedule(){const e=b(),t=k(this.scheduleData,e);if(t){const i=`${t.time}-${t.colors.join(",")}`;i!==this.lastAppliedKey&&(this.setGradient(t),this.lastAppliedKey=i)}}static init(e,t){return new x(e,t)}};h.DynamicGradient=C,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,10 +1,17 @@
1
1
  {
2
2
  "name": "real-time-gradient",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "A Dynamic Gradient background library.",
5
5
  "main": "dist/index.umd.js",
6
6
  "module": "dist/index.es.js",
7
7
  "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.es.js",
11
+ "require": "./dist/index.umd.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
8
15
  "scripts": {
9
16
  "build": "vite build"
10
17
  },