masoneffect 1.0.30 → 2.0.1

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.
Files changed (196) hide show
  1. package/README.md +320 -231
  2. package/dist/core/count/index.d.ts +52 -0
  3. package/dist/core/count/index.d.ts.map +1 -0
  4. package/dist/core/index.d.ts +15 -97
  5. package/dist/core/index.d.ts.map +1 -1
  6. package/dist/core/textToParticle/index.d.ts +103 -0
  7. package/dist/core/textToParticle/index.d.ts.map +1 -0
  8. package/dist/count/core/count/index.d.ts +52 -0
  9. package/dist/count/core/count/index.d.ts.map +1 -0
  10. package/dist/count/core/index.d.ts +18 -0
  11. package/dist/count/core/index.d.ts.map +1 -0
  12. package/dist/count/core/textToParticle/index.d.ts +103 -0
  13. package/dist/count/core/textToParticle/index.d.ts.map +1 -0
  14. package/dist/count/index.cjs +1 -0
  15. package/dist/count/index.d.ts +16 -0
  16. package/dist/count/index.d.ts.map +1 -0
  17. package/dist/count/index.mjs +1 -0
  18. package/dist/count/index.umd.d.ts +7 -0
  19. package/dist/count/index.umd.d.ts.map +1 -0
  20. package/dist/count/react/MasonEffect.d.ts +32 -0
  21. package/dist/count/react/MasonEffect.d.ts.map +1 -0
  22. package/dist/count/react/count/Count.d.ts +19 -0
  23. package/dist/count/react/count/Count.d.ts.map +1 -0
  24. package/dist/count/react/count/index.d.ts +5 -0
  25. package/dist/count/react/count/index.d.ts.map +1 -0
  26. package/dist/count/react/index.d.ts +12 -0
  27. package/dist/count/react/index.d.ts.map +1 -0
  28. package/dist/count/react/textToParticle/TextToParticle.d.ts +15 -0
  29. package/dist/count/react/textToParticle/TextToParticle.d.ts.map +1 -0
  30. package/dist/count/react/textToParticle/index.d.ts +4 -0
  31. package/dist/count/react/textToParticle/index.d.ts.map +1 -0
  32. package/dist/count/svelte/count/index.d.ts +2 -0
  33. package/dist/count/svelte/count/index.d.ts.map +1 -0
  34. package/dist/count/svelte/index.d.ts +8 -0
  35. package/dist/count/svelte/index.d.ts.map +1 -0
  36. package/dist/count/svelte/textToParticle/index.d.ts +2 -0
  37. package/dist/count/svelte/textToParticle/index.d.ts.map +1 -0
  38. package/dist/count/vue/count/index.d.ts +2 -0
  39. package/dist/count/vue/count/index.d.ts.map +1 -0
  40. package/dist/count/vue/index.d.ts +8 -0
  41. package/dist/count/vue/index.d.ts.map +1 -0
  42. package/dist/count/vue/textToParticle/index.d.ts +2 -0
  43. package/dist/count/vue/textToParticle/index.d.ts.map +1 -0
  44. package/dist/index.cjs +1 -1
  45. package/dist/index.d.ts +12 -4
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.mjs +1 -1
  48. package/dist/index.umd.min.js +1 -1
  49. package/dist/react/core/count/index.d.ts +51 -0
  50. package/dist/react/core/index.d.ts +15 -97
  51. package/dist/react/core/textToParticle/index.d.ts +102 -0
  52. package/dist/react/count/Count.d.ts +19 -0
  53. package/dist/react/count/Count.d.ts.map +1 -0
  54. package/dist/react/count/core/count/index.d.ts +52 -0
  55. package/dist/react/count/core/count/index.d.ts.map +1 -0
  56. package/dist/react/count/core/index.d.ts +18 -0
  57. package/dist/react/count/core/index.d.ts.map +1 -0
  58. package/dist/react/count/core/textToParticle/index.d.ts +103 -0
  59. package/dist/react/count/core/textToParticle/index.d.ts.map +1 -0
  60. package/dist/react/count/index.cjs +1 -0
  61. package/dist/react/count/index.d.ts +16 -0
  62. package/dist/react/count/index.d.ts.map +1 -0
  63. package/dist/react/count/index.mjs +1 -0
  64. package/dist/react/count/index.umd.d.ts +7 -0
  65. package/dist/react/count/index.umd.d.ts.map +1 -0
  66. package/dist/react/count/react/MasonEffect.d.ts +32 -0
  67. package/dist/react/count/react/MasonEffect.d.ts.map +1 -0
  68. package/dist/react/count/react/count/Count.d.ts +19 -0
  69. package/dist/react/count/react/count/Count.d.ts.map +1 -0
  70. package/dist/react/count/react/count/index.d.ts +5 -0
  71. package/dist/react/count/react/count/index.d.ts.map +1 -0
  72. package/dist/react/count/react/index.d.ts +12 -0
  73. package/dist/react/count/react/index.d.ts.map +1 -0
  74. package/dist/react/count/react/textToParticle/TextToParticle.d.ts +15 -0
  75. package/dist/react/count/react/textToParticle/TextToParticle.d.ts.map +1 -0
  76. package/dist/react/count/react/textToParticle/index.d.ts +4 -0
  77. package/dist/react/count/react/textToParticle/index.d.ts.map +1 -0
  78. package/dist/react/count/svelte/count/index.d.ts +2 -0
  79. package/dist/react/count/svelte/count/index.d.ts.map +1 -0
  80. package/dist/react/count/svelte/index.d.ts +8 -0
  81. package/dist/react/count/svelte/index.d.ts.map +1 -0
  82. package/dist/react/count/svelte/textToParticle/index.d.ts +2 -0
  83. package/dist/react/count/svelte/textToParticle/index.d.ts.map +1 -0
  84. package/dist/react/count/vue/count/index.d.ts +2 -0
  85. package/dist/react/count/vue/count/index.d.ts.map +1 -0
  86. package/dist/react/count/vue/index.d.ts +8 -0
  87. package/dist/react/count/vue/index.d.ts.map +1 -0
  88. package/dist/react/count/vue/textToParticle/index.d.ts +2 -0
  89. package/dist/react/count/vue/textToParticle/index.d.ts.map +1 -0
  90. package/dist/react/index.cjs +12 -2
  91. package/dist/react/index.d.ts.map +1 -1
  92. package/dist/react/index.mjs +2 -1
  93. package/dist/react/react/count/Count.d.ts +18 -0
  94. package/dist/react/react/count/index.d.ts +4 -0
  95. package/dist/react/react/index.d.ts +11 -2
  96. package/dist/react/react/textToParticle/TextToParticle.d.ts +14 -0
  97. package/dist/react/react/textToParticle/index.d.ts +3 -0
  98. package/dist/react/svelte/count/index.d.ts +1 -0
  99. package/dist/react/svelte/index.d.ts +5 -3
  100. package/dist/react/svelte/textToParticle/index.d.ts +1 -0
  101. package/dist/react/textToParticle/TextToParticle.d.ts +15 -0
  102. package/dist/react/textToParticle/TextToParticle.d.ts.map +1 -0
  103. package/dist/react/textToParticle/core/count/index.d.ts +52 -0
  104. package/dist/react/textToParticle/core/count/index.d.ts.map +1 -0
  105. package/dist/react/textToParticle/core/index.d.ts +18 -0
  106. package/dist/react/textToParticle/core/index.d.ts.map +1 -0
  107. package/dist/react/textToParticle/core/textToParticle/index.d.ts +103 -0
  108. package/dist/react/textToParticle/core/textToParticle/index.d.ts.map +1 -0
  109. package/dist/react/textToParticle/index.cjs +1 -0
  110. package/dist/react/textToParticle/index.d.ts +16 -0
  111. package/dist/react/textToParticle/index.d.ts.map +1 -0
  112. package/dist/react/textToParticle/index.mjs +1 -0
  113. package/dist/react/textToParticle/index.umd.d.ts +7 -0
  114. package/dist/react/textToParticle/index.umd.d.ts.map +1 -0
  115. package/dist/react/textToParticle/react/MasonEffect.d.ts +32 -0
  116. package/dist/react/textToParticle/react/MasonEffect.d.ts.map +1 -0
  117. package/dist/react/textToParticle/react/count/Count.d.ts +19 -0
  118. package/dist/react/textToParticle/react/count/Count.d.ts.map +1 -0
  119. package/dist/react/textToParticle/react/count/index.d.ts +5 -0
  120. package/dist/react/textToParticle/react/count/index.d.ts.map +1 -0
  121. package/dist/react/textToParticle/react/index.d.ts +12 -0
  122. package/dist/react/textToParticle/react/index.d.ts.map +1 -0
  123. package/dist/react/textToParticle/react/textToParticle/TextToParticle.d.ts +15 -0
  124. package/dist/react/textToParticle/react/textToParticle/TextToParticle.d.ts.map +1 -0
  125. package/dist/react/textToParticle/react/textToParticle/index.d.ts +4 -0
  126. package/dist/react/textToParticle/react/textToParticle/index.d.ts.map +1 -0
  127. package/dist/react/textToParticle/svelte/count/index.d.ts +2 -0
  128. package/dist/react/textToParticle/svelte/count/index.d.ts.map +1 -0
  129. package/dist/react/textToParticle/svelte/index.d.ts +8 -0
  130. package/dist/react/textToParticle/svelte/index.d.ts.map +1 -0
  131. package/dist/react/textToParticle/svelte/textToParticle/index.d.ts +2 -0
  132. package/dist/react/textToParticle/svelte/textToParticle/index.d.ts.map +1 -0
  133. package/dist/react/textToParticle/vue/count/index.d.ts +2 -0
  134. package/dist/react/textToParticle/vue/count/index.d.ts.map +1 -0
  135. package/dist/react/textToParticle/vue/index.d.ts +8 -0
  136. package/dist/react/textToParticle/vue/index.d.ts.map +1 -0
  137. package/dist/react/textToParticle/vue/textToParticle/index.d.ts +2 -0
  138. package/dist/react/textToParticle/vue/textToParticle/index.d.ts.map +1 -0
  139. package/dist/react/vue/count/index.d.ts +1 -0
  140. package/dist/react/vue/index.d.ts +5 -3
  141. package/dist/react/vue/textToParticle/index.d.ts +1 -0
  142. package/dist/svelte/count/index.cjs +1 -0
  143. package/dist/svelte/count/index.d.ts +163 -0
  144. package/dist/svelte/count/index.mjs +659 -0
  145. package/dist/svelte/index.cjs +1 -1
  146. package/dist/svelte/index.d.ts +88 -29
  147. package/dist/svelte/index.mjs +402 -8
  148. package/dist/svelte/textToParticle/index.cjs +1 -0
  149. package/dist/svelte/textToParticle/index.d.ts +163 -0
  150. package/dist/svelte/textToParticle/index.mjs +924 -0
  151. package/dist/textToParticle/core/count/index.d.ts +52 -0
  152. package/dist/textToParticle/core/count/index.d.ts.map +1 -0
  153. package/dist/textToParticle/core/index.d.ts +18 -0
  154. package/dist/textToParticle/core/index.d.ts.map +1 -0
  155. package/dist/textToParticle/core/textToParticle/index.d.ts +103 -0
  156. package/dist/textToParticle/core/textToParticle/index.d.ts.map +1 -0
  157. package/dist/textToParticle/index.cjs +1 -0
  158. package/dist/textToParticle/index.d.ts +16 -0
  159. package/dist/textToParticle/index.d.ts.map +1 -0
  160. package/dist/textToParticle/index.mjs +1 -0
  161. package/dist/textToParticle/index.umd.d.ts +7 -0
  162. package/dist/textToParticle/index.umd.d.ts.map +1 -0
  163. package/dist/textToParticle/react/MasonEffect.d.ts +32 -0
  164. package/dist/textToParticle/react/MasonEffect.d.ts.map +1 -0
  165. package/dist/textToParticle/react/count/Count.d.ts +19 -0
  166. package/dist/textToParticle/react/count/Count.d.ts.map +1 -0
  167. package/dist/textToParticle/react/count/index.d.ts +5 -0
  168. package/dist/textToParticle/react/count/index.d.ts.map +1 -0
  169. package/dist/textToParticle/react/index.d.ts +12 -0
  170. package/dist/textToParticle/react/index.d.ts.map +1 -0
  171. package/dist/textToParticle/react/textToParticle/TextToParticle.d.ts +15 -0
  172. package/dist/textToParticle/react/textToParticle/TextToParticle.d.ts.map +1 -0
  173. package/dist/textToParticle/react/textToParticle/index.d.ts +4 -0
  174. package/dist/textToParticle/react/textToParticle/index.d.ts.map +1 -0
  175. package/dist/textToParticle/svelte/count/index.d.ts +2 -0
  176. package/dist/textToParticle/svelte/count/index.d.ts.map +1 -0
  177. package/dist/textToParticle/svelte/index.d.ts +8 -0
  178. package/dist/textToParticle/svelte/index.d.ts.map +1 -0
  179. package/dist/textToParticle/svelte/textToParticle/index.d.ts +2 -0
  180. package/dist/textToParticle/svelte/textToParticle/index.d.ts.map +1 -0
  181. package/dist/textToParticle/vue/count/index.d.ts +2 -0
  182. package/dist/textToParticle/vue/count/index.d.ts.map +1 -0
  183. package/dist/textToParticle/vue/index.d.ts +8 -0
  184. package/dist/textToParticle/vue/index.d.ts.map +1 -0
  185. package/dist/textToParticle/vue/textToParticle/index.d.ts +2 -0
  186. package/dist/textToParticle/vue/textToParticle/index.d.ts.map +1 -0
  187. package/dist/vue/count/index.cjs +1 -0
  188. package/dist/vue/count/index.d.ts +163 -0
  189. package/dist/vue/count/index.mjs +286 -0
  190. package/dist/vue/index.cjs +1 -1
  191. package/dist/vue/index.d.ts +88 -29
  192. package/dist/vue/index.mjs +291 -6
  193. package/dist/vue/textToParticle/index.cjs +1 -0
  194. package/dist/vue/textToParticle/index.d.ts +163 -0
  195. package/dist/vue/textToParticle/index.mjs +554 -0
  196. package/package.json +54 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,cAAc,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAC7F,YAAY,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGjF,OAAO,EAAE,KAAK,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAClE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAAE,cAAc,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC1E,YAAY,EAAE,qBAAqB,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAG7F,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * TextToParticle - 텍스트를 파티클로 변환하는 효과
3
+ * 바닐라 JS 코어 클래스
4
+ *
5
+ * 사용법:
6
+ * import { TextToParticle } from 'masoneffect/textToParticle';
7
+ */
8
+ export interface TextToParticleOptions {
9
+ text?: string;
10
+ densityStep?: number;
11
+ maxParticles?: number;
12
+ pointSize?: number;
13
+ ease?: number;
14
+ repelRadius?: number;
15
+ repelStrength?: number;
16
+ particleColor?: string;
17
+ fontFamily?: string;
18
+ fontSize?: number | null;
19
+ width?: number | null;
20
+ height?: number | null;
21
+ devicePixelRatio?: number | null;
22
+ debounceDelay?: number;
23
+ onReady?: (instance: TextToParticle) => void;
24
+ onUpdate?: (instance: TextToParticle) => void;
25
+ }
26
+ export interface Particle {
27
+ x: number;
28
+ y: number;
29
+ vx: number;
30
+ vy: number;
31
+ tx: number;
32
+ ty: number;
33
+ initialX?: number;
34
+ initialY?: number;
35
+ j: number;
36
+ }
37
+ export declare class TextToParticle {
38
+ container: HTMLElement;
39
+ config: Required<Omit<TextToParticleOptions, 'onReady' | 'onUpdate' | 'debounceDelay'>> & {
40
+ onReady: TextToParticleOptions['onReady'];
41
+ onUpdate: TextToParticleOptions['onUpdate'];
42
+ };
43
+ canvas: HTMLCanvasElement;
44
+ ctx: CanvasRenderingContext2D;
45
+ offCanvas: HTMLCanvasElement;
46
+ offCtx: CanvasRenderingContext2D;
47
+ W: number;
48
+ H: number;
49
+ DPR: number;
50
+ particles: Particle[];
51
+ mouse: {
52
+ x: number;
53
+ y: number;
54
+ down: boolean;
55
+ };
56
+ animationId: number | null;
57
+ isRunning: boolean;
58
+ isVisible: boolean;
59
+ intersectionObserver: IntersectionObserver | null;
60
+ debounceDelay: number;
61
+ _debouncedMorph: (textOrOptions?: string | Partial<TextToParticleOptions> | null) => void;
62
+ _debouncedUpdateConfig: (newConfig: Partial<TextToParticleOptions>) => void;
63
+ constructor(container: HTMLElement | string, options?: TextToParticleOptions);
64
+ init(): void;
65
+ setupIntersectionObserver(): void;
66
+ resize(): void;
67
+ /**
68
+ * 텍스트가 영역 안에 들어가는지 확인하는 헬퍼 함수 (줄바꿈 지원)
69
+ * @param fontSize 확인할 폰트 크기
70
+ * @param text 텍스트 (\n으로 줄바꿈 구분)
71
+ * @param maxWidth 최대 너비
72
+ * @param maxHeight 최대 높이
73
+ * @returns { width: number, height: number, fits: boolean }
74
+ */
75
+ private measureTextFit;
76
+ /**
77
+ * 이진 검색을 사용하여 적절한 폰트 크기를 찾는 최적화된 함수
78
+ * 반복 횟수를 O(log n)으로 줄여 성능 개선 (최대 15회 반복, 기존 최대 100회에서 대폭 감소)
79
+ */
80
+ private findOptimalFontSize;
81
+ buildTargets(): void;
82
+ makeParticle(): Particle;
83
+ initParticles(): void;
84
+ scatter(): void;
85
+ morph(textOrOptions?: string | Partial<TextToParticleOptions> | null): void;
86
+ _morphInternal(textOrOptions?: string | Partial<TextToParticleOptions> | null): void;
87
+ update(): void;
88
+ animate(): void;
89
+ start(): void;
90
+ stop(): void;
91
+ setupEventListeners(): void;
92
+ removeEventListeners(): void;
93
+ handleResize(): void;
94
+ handleMouseMove(e: MouseEvent): void;
95
+ handleMouseLeave(): void;
96
+ handleMouseDown(): void;
97
+ handleMouseUp(): void;
98
+ updateConfig(newConfig: Partial<TextToParticleOptions>): void;
99
+ _updateConfigInternal(newConfig: Partial<TextToParticleOptions>): void;
100
+ destroy(): void;
101
+ }
102
+ export default TextToParticle;
103
+ //# sourceMapping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I,QAAQ;IAiBxB,aAAa,IAAI,IAAI;IAcrB,OAAO,IAAI,IAAI;IAiBf,KAAK,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,GAAG,IAAI,GAAG,IAAI;IAM3E,cAAc,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,GAAG,IAAI,GAAG,IAAI;IAuBpF,MAAM,IAAI,IAAI;IAgDd,OAAO,IAAI,IAAI;IAMf,KAAK,IAAI,IAAI;IAMb,IAAI,IAAI,IAAI;IAQZ,mBAAmB,IAAI,IAAI;IAQ3B,oBAAoB,IAAI,IAAI;IAQ5B,YAAY,IAAI,IAAI;IAIpB,eAAe,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAMpC,gBAAgB,IAAI,IAAI;IAIxB,eAAe,IAAI,IAAI;IAIvB,aAAa,IAAI,IAAI;IAKrB,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,IAAI;IAK7D,qBAAqB,CAAC,SAAS,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,IAAI;IAQtE,OAAO,IAAI,IAAI;CAWhB;AAGD,eAAe,cAAc,CAAC"}
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"t",{value:!0});var t=require("react");const s={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:(4-2*t)*t-1,easeOutCubic:t=>--t*t*t+1};class i{constructor(t,i){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");this.config={targetValue:i.targetValue,duration:i.duration??2e3,startValue:i.startValue??0,enabled:i.enabled??!0,easing:i.easing??s.linear,threshold:i.threshold??.2,rootMargin:i.rootMargin??"0px 0px -100px 0px",triggerOnce:i.triggerOnce??!1,onUpdate:i.onUpdate||null,onComplete:i.onComplete||null},this.currentValue=this.config.startValue,this.startTime=null,this.animationFrameId=null,this.intersectionObserver=null,this.isRunning=!1,this.hasTriggered=!1,this.init()}init(){this.updateDisplay(this.config.startValue),this.setupIntersectionObserver()}setupIntersectionObserver(){"undefined"!=typeof window&&void 0!==window.IntersectionObserver?(this.intersectionObserver=new IntersectionObserver(t=>{for(const s of t)if(s.target===this.container)if(s.isIntersecting)!this.hasTriggered&&this.config.enabled&&(this.hasTriggered=!0,this.start()),this.config.triggerOnce&&this.intersectionObserver?.unobserve(this.container);else if(!this.config.triggerOnce){const t=s.boundingClientRect,i=window.innerHeight,e=window.innerWidth;(t.bottom<=0||t.top>=i||t.right<=0||t.left>=e)&&this.isRunning&&this.reset()}},{threshold:this.config.threshold,rootMargin:this.config.rootMargin}),this.intersectionObserver.observe(this.container)):this.config.enabled&&this.start()}start(){if(this.isRunning)return;if(!this.config.enabled)return;this.isRunning=!0,this.startTime=null,this.currentValue=this.config.startValue,this.updateDisplay(this.currentValue);const t=s=>{null===this.startTime&&(this.startTime=s);const i=s-this.startTime,e=Math.min(i/this.config.duration,1),n=this.config.easing(e);this.currentValue=Math.floor(this.config.startValue+(this.config.targetValue-this.config.startValue)*n),this.updateDisplay(this.currentValue),this.config.onUpdate&&this.config.onUpdate(this.currentValue),e<1?this.animationFrameId=requestAnimationFrame(t):(this.currentValue=this.config.targetValue,this.updateDisplay(this.currentValue),this.isRunning=!1,this.config.onComplete&&this.config.onComplete())};this.animationFrameId=requestAnimationFrame(t)}stop(){this.isRunning=!1,null!==this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}reset(){this.stop(),this.currentValue=this.config.startValue,this.updateDisplay(this.currentValue),this.hasTriggered=!1,this.startTime=null}updateDisplay(t){this.container.textContent=this.formatNumber(t)}formatNumber(t){return Math.floor(t).toLocaleString()}updateConfig(t){const s=this.isRunning;this.stop(),this.config={...this.config,...t,onUpdate:void 0!==t.onUpdate?t.onUpdate:this.config.onUpdate,onComplete:void 0!==t.onComplete?t.onComplete:this.config.onComplete},void 0!==t.targetValue?(this.reset(),s&&this.config.enabled&&this.start()):s&&this.config.enabled&&this.start()}getValue(){return this.currentValue}destroy(){this.stop(),this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null)}}const e=t.forwardRef((s,e)=>{const n=t.useRef(null),h=t.useRef(null);return t.useEffect(()=>{if(!n.current)return;if(h.current)return;const{className:t,style:e,targetValue:o,duration:r,startValue:a,enabled:l,easing:u,threshold:d,rootMargin:c,triggerOnce:g,onUpdate:p,onComplete:f}=s,m={targetValue:o,duration:r,startValue:a,enabled:l,easing:u,threshold:d,rootMargin:c,triggerOnce:g,onUpdate:p,onComplete:f};return h.current=new i(n.current,m),()=>{h.current&&(h.current.destroy(),h.current=null)}},[]),t.useEffect(()=>{if(!h.current)return;const{targetValue:t,duration:i,startValue:e,enabled:n,easing:o,threshold:r,rootMargin:a,triggerOnce:l,onUpdate:u,onComplete:d}=s;h.current.updateConfig({targetValue:t,duration:i,startValue:e,enabled:n,easing:o,threshold:r,rootMargin:a,triggerOnce:l,onUpdate:u,onComplete:d})},[s.targetValue,s.duration,s.startValue,s.enabled,s.easing,s.threshold,s.rootMargin,s.triggerOnce,s.onUpdate,s.onComplete]),t.useImperativeHandle(e,()=>({start:()=>{h.current?h.current.start():console.warn("Count: 인스턴스가 아직 초기화되지 않았습니다.")},stop:()=>{h.current?h.current.stop():console.warn("Count: 인스턴스가 아직 초기화되지 않았습니다.")},reset:()=>{h.current?h.current.reset():console.warn("Count: 인스턴스가 아직 초기화되지 않았습니다.")},getValue:()=>h.current?h.current.getValue():(console.warn("Count: 인스턴스가 아직 초기화되지 않았습니다."),0),updateConfig:t=>{h.current?h.current.updateConfig(t):console.warn("Count: 인스턴스가 아직 초기화되지 않았습니다.")},destroy:()=>{h.current&&(h.current.destroy(),h.current=null)}})),t.createElement("div",{ref:n,className:s.className,style:s.style})});e.displayName="Count",exports.default=e,exports.easingFunctions=s;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * MasonEffect - 메인 엔트리 포인트
3
+ *
4
+ * 주의: tree-shaking을 위해 각 이펙트를 직접 import하는 것을 권장합니다:
5
+ * - import { TextToParticle } from 'masoneffect/textToParticle'
6
+ * - import { Count } from 'masoneffect/count'
7
+ *
8
+ * 이 파일은 하위 호환성을 위해 제공됩니다.
9
+ */
10
+ export { TextToParticle, MasonEffect } from './core/index.js';
11
+ export type { TextToParticleOptions, MasonEffectOptions, Particle } from './core/index.js';
12
+ export { Count } from './core/index.js';
13
+ export type { CountOptions } from './core/index.js';
14
+ export { easingFunctions } from './core/index.js';
15
+ export { default } from './core/index.js';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9D,YAAY,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3F,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1 @@
1
+ import t,{useRef as s,useEffect as i}from"react";const e={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:(4-2*t)*t-1,easeOutCubic:t=>--t*t*t+1};class n{constructor(t,s){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");this.config={targetValue:s.targetValue,duration:s.duration??2e3,startValue:s.startValue??0,enabled:s.enabled??!0,easing:s.easing??e.linear,threshold:s.threshold??.2,rootMargin:s.rootMargin??"0px 0px -100px 0px",triggerOnce:s.triggerOnce??!1,onUpdate:s.onUpdate||null,onComplete:s.onComplete||null},this.currentValue=this.config.startValue,this.startTime=null,this.animationFrameId=null,this.intersectionObserver=null,this.isRunning=!1,this.hasTriggered=!1,this.init()}init(){this.updateDisplay(this.config.startValue),this.setupIntersectionObserver()}setupIntersectionObserver(){"undefined"!=typeof window&&void 0!==window.IntersectionObserver?(this.intersectionObserver=new IntersectionObserver(t=>{for(const s of t)if(s.target===this.container)if(s.isIntersecting)!this.hasTriggered&&this.config.enabled&&(this.hasTriggered=!0,this.start()),this.config.triggerOnce&&this.intersectionObserver?.unobserve(this.container);else if(!this.config.triggerOnce){const t=s.boundingClientRect,i=window.innerHeight,e=window.innerWidth;(t.bottom<=0||t.top>=i||t.right<=0||t.left>=e)&&this.isRunning&&this.reset()}},{threshold:this.config.threshold,rootMargin:this.config.rootMargin}),this.intersectionObserver.observe(this.container)):this.config.enabled&&this.start()}start(){if(this.isRunning)return;if(!this.config.enabled)return;this.isRunning=!0,this.startTime=null,this.currentValue=this.config.startValue,this.updateDisplay(this.currentValue);const t=s=>{null===this.startTime&&(this.startTime=s);const i=s-this.startTime,e=Math.min(i/this.config.duration,1),n=this.config.easing(e);this.currentValue=Math.floor(this.config.startValue+(this.config.targetValue-this.config.startValue)*n),this.updateDisplay(this.currentValue),this.config.onUpdate&&this.config.onUpdate(this.currentValue),e<1?this.animationFrameId=requestAnimationFrame(t):(this.currentValue=this.config.targetValue,this.updateDisplay(this.currentValue),this.isRunning=!1,this.config.onComplete&&this.config.onComplete())};this.animationFrameId=requestAnimationFrame(t)}stop(){this.isRunning=!1,null!==this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}reset(){this.stop(),this.currentValue=this.config.startValue,this.updateDisplay(this.currentValue),this.hasTriggered=!1,this.startTime=null}updateDisplay(t){this.container.textContent=this.formatNumber(t)}formatNumber(t){return Math.floor(t).toLocaleString()}updateConfig(t){const s=this.isRunning;this.stop(),this.config={...this.config,...t,onUpdate:void 0!==t.onUpdate?t.onUpdate:this.config.onUpdate,onComplete:void 0!==t.onComplete?t.onComplete:this.config.onComplete},void 0!==t.targetValue?(this.reset(),s&&this.config.enabled&&this.start()):s&&this.config.enabled&&this.start()}getValue(){return this.currentValue}destroy(){this.stop(),this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null)}}const h=t.forwardRef((e,h)=>{const o=s(null),r=s(null);return i(()=>{if(!o.current)return;if(r.current)return;const{className:t,style:s,targetValue:i,duration:h,startValue:a,enabled:l,easing:u,threshold:d,rootMargin:c,triggerOnce:g,onUpdate:p,onComplete:f}=e,m={targetValue:i,duration:h,startValue:a,enabled:l,easing:u,threshold:d,rootMargin:c,triggerOnce:g,onUpdate:p,onComplete:f};return r.current=new n(o.current,m),()=>{r.current&&(r.current.destroy(),r.current=null)}},[]),i(()=>{if(!r.current)return;const{targetValue:t,duration:s,startValue:i,enabled:n,easing:h,threshold:o,rootMargin:a,triggerOnce:l,onUpdate:u,onComplete:d}=e;r.current.updateConfig({targetValue:t,duration:s,startValue:i,enabled:n,easing:h,threshold:o,rootMargin:a,triggerOnce:l,onUpdate:u,onComplete:d})},[e.targetValue,e.duration,e.startValue,e.enabled,e.easing,e.threshold,e.rootMargin,e.triggerOnce,e.onUpdate,e.onComplete]),t.useImperativeHandle(h,()=>({start:()=>{r.current?r.current.start():console.warn("Count: 인스턴스가 아직 초기화되지 않았습니다.")},stop:()=>{r.current?r.current.stop():console.warn("Count: 인스턴스가 아직 초기화되지 않았습니다.")},reset:()=>{r.current?r.current.reset():console.warn("Count: 인스턴스가 아직 초기화되지 않았습니다.")},getValue:()=>r.current?r.current.getValue():(console.warn("Count: 인스턴스가 아직 초기화되지 않았습니다."),0),updateConfig:t=>{r.current?r.current.updateConfig(t):console.warn("Count: 인스턴스가 아직 초기화되지 않았습니다.")},destroy:()=>{r.current&&(r.current.destroy(),r.current=null)}})),t.createElement("div",{ref:o,className:e.className,style:e.style})});h.displayName="Count";export{h as default,e as easingFunctions};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * MasonEffect - UMD 전용 엔트리 포인트
3
+ * CDN 사용 시: new MasonEffect()로 직접 사용 가능
4
+ */
5
+ import MasonEffect from './core/index.js';
6
+ export default MasonEffect;
7
+ //# sourceMappingURL=index.umd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.umd.d.ts","sourceRoot":"","sources":["../../../src/index.umd.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAG1C,eAAe,WAAW,CAAC"}
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import { MasonEffect } from '../core/index.js';
3
+ export interface MasonEffectOptions {
4
+ text?: string;
5
+ densityStep?: number;
6
+ maxParticles?: number;
7
+ pointSize?: number;
8
+ ease?: number;
9
+ repelRadius?: number;
10
+ repelStrength?: number;
11
+ particleColor?: string;
12
+ fontFamily?: string;
13
+ fontSize?: number | null;
14
+ width?: number | null;
15
+ height?: number | null;
16
+ devicePixelRatio?: number | null;
17
+ onReady?: (instance: MasonEffect) => void;
18
+ onUpdate?: (instance: MasonEffect) => void;
19
+ }
20
+ export interface MasonEffectRef {
21
+ morph: (textOrOptions?: string | Partial<MasonEffectOptions>) => void;
22
+ scatter: () => void;
23
+ updateConfig: (config: Partial<MasonEffectOptions>) => void;
24
+ destroy: () => void;
25
+ }
26
+ interface MasonEffectProps extends MasonEffectOptions {
27
+ className?: string;
28
+ style?: React.CSSProperties;
29
+ }
30
+ declare const MasonEffectComponent: React.ForwardRefExoticComponent<MasonEffectProps & React.RefAttributes<MasonEffectRef>>;
31
+ export default MasonEffectComponent;
32
+ //# sourceMappingURL=MasonEffect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MasonEffect.d.ts","sourceRoot":"","sources":["../../../../src/react/MasonEffect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;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';
3
+ export interface CountRef {
4
+ start: () => void;
5
+ stop: () => void;
6
+ reset: () => void;
7
+ getValue: () => number;
8
+ updateConfig: (config: Partial<CountOptions>) => void;
9
+ destroy: () => void;
10
+ }
11
+ interface CountProps extends Omit<CountOptions, 'onUpdate' | 'onComplete'> {
12
+ className?: string;
13
+ style?: React.CSSProperties;
14
+ onUpdate?: (value: number) => void;
15
+ onComplete?: () => void;
16
+ }
17
+ declare const CountComponent: React.ForwardRefExoticComponent<CountProps & React.RefAttributes<CountRef>>;
18
+ export default CountComponent;
19
+ //# sourceMappingURL=Count.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Count.d.ts","sourceRoot":"","sources":["../../../../../src/react/count/Count.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACtD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,UAAW,SAAQ,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,YAAY,CAAC;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,cAAc,6EAiJnB,CAAC;AAIF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { default } from './Count';
2
+ export type { CountRef } from './Count';
3
+ export type { CountOptions } from '../../core/count/index.js';
4
+ export { easingFunctions } from '../../core/count/index.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/react/count/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,YAAY,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * MasonEffect React - 모든 React 컴포넌트를 export하는 메인 파일
3
+ */
4
+ export { default as TextToParticle } from './textToParticle/index.js';
5
+ export type { TextToParticleRef, TextToParticleOptions } from './textToParticle/index.js';
6
+ export { default as Count } from './count/index.js';
7
+ export type { CountRef, CountOptions } from './count/index.js';
8
+ export { easingFunctions } from './count/index.js';
9
+ export { default as MasonEffect } from './textToParticle/index.js';
10
+ export type { TextToParticleRef as MasonEffectRef, TextToParticleOptions as MasonEffectOptions } from './textToParticle/index.js';
11
+ export { default } from './textToParticle/index.js';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,2BAA2B,CAAC;AACtE,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAG1F,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACnE,YAAY,EAAE,iBAAiB,IAAI,cAAc,EAAE,qBAAqB,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAGlI,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import type { TextToParticleOptions } from '../../core/index.js';
3
+ export interface TextToParticleRef {
4
+ morph: (textOrOptions?: string | Partial<TextToParticleOptions>) => void;
5
+ scatter: () => void;
6
+ updateConfig: (config: Partial<TextToParticleOptions>) => void;
7
+ destroy: () => void;
8
+ }
9
+ interface TextToParticleProps extends TextToParticleOptions {
10
+ className?: string;
11
+ style?: React.CSSProperties;
12
+ }
13
+ declare const TextToParticleComponent: React.ForwardRefExoticComponent<TextToParticleProps & React.RefAttributes<TextToParticleRef>>;
14
+ export default TextToParticleComponent;
15
+ //# sourceMappingURL=TextToParticle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextToParticle.d.ts","sourceRoot":"","sources":["../../../../../src/react/textToParticle/TextToParticle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IACzE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IAC/D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,mBAAoB,SAAQ,qBAAqB;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,QAAA,MAAM,uBAAuB,+FAkN5B,CAAC;AAIF,eAAe,uBAAuB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { default } from './TextToParticle';
2
+ export type { TextToParticleRef } from './TextToParticle';
3
+ export type { TextToParticleOptions } from '../../core/textToParticle/index.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/react/textToParticle/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,YAAY,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './Count.svelte';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/svelte/count/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * MasonEffect Svelte - 모든 Svelte 컴포넌트를 export하는 메인 파일
3
+ */
4
+ export { default as TextToParticle } from './textToParticle/index.js';
5
+ export { default as Count } from './count/index.js';
6
+ export { default as MasonEffect } from './textToParticle/index.js';
7
+ export { default } from './textToParticle/index.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/svelte/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGtE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGpD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGnE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './TextToParticle.svelte';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/svelte/textToParticle/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './Count.vue';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/vue/count/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * MasonEffect Vue - 모든 Vue 컴포넌트를 export하는 메인 파일
3
+ */
4
+ export { default as TextToParticle } from './textToParticle/index.js';
5
+ export { default as Count } from './count/index.js';
6
+ export { default as MasonEffect } from './textToParticle/index.js';
7
+ export { default } from './textToParticle/index.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/vue/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGtE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGpD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGnE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './TextToParticle.vue';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/vue/textToParticle/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC"}
@@ -1,7 +1,17 @@
1
1
  'use strict';
2
2
 
3
- var MasonEffect = require('./MasonEffect');
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var index_js = require('./textToParticle/index.js');
6
+ var index_js$1 = require('./count/index.js');
5
7
 
6
8
 
7
- module.exports = MasonEffect;
9
+
10
+ exports.MasonEffect = index_js;
11
+ exports.TextToParticle = index_js;
12
+ exports.default = index_js;
13
+ exports.Count = index_js$1;
14
+ Object.defineProperty(exports, "easingFunctions", {
15
+ enumerable: true,
16
+ get: function () { return index_js$1.easingFunctions; }
17
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAG1C,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,YAAY,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAIpE,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,2BAA2B,CAAC;AACtE,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAG1F,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACnE,YAAY,EAAE,iBAAiB,IAAI,cAAc,EAAE,qBAAqB,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAGlI,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1 +1,2 @@
1
- export { default } from './MasonEffect.mjs';
1
+ export { default as MasonEffect, default as TextToParticle, default } from './textToParticle/index.js';
2
+ export { default as Count, easingFunctions } from './count/index.js';
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import type { CountOptions } from '../../core/count/index.js';
3
+ export interface CountRef {
4
+ start: () => void;
5
+ stop: () => void;
6
+ reset: () => void;
7
+ getValue: () => number;
8
+ updateConfig: (config: Partial<CountOptions>) => void;
9
+ destroy: () => void;
10
+ }
11
+ interface CountProps extends Omit<CountOptions, 'onUpdate' | 'onComplete'> {
12
+ className?: string;
13
+ style?: React.CSSProperties;
14
+ onUpdate?: (value: number) => void;
15
+ onComplete?: () => void;
16
+ }
17
+ declare const CountComponent: React.ForwardRefExoticComponent<CountProps & React.RefAttributes<CountRef>>;
18
+ export default CountComponent;
@@ -0,0 +1,4 @@
1
+ export { default } from './Count';
2
+ export type { CountRef } from './Count';
3
+ export type { CountOptions } from '../../core/count/index.js';
4
+ export { easingFunctions } from '../../core/count/index.js';
@@ -1,2 +1,11 @@
1
- export { default } from './MasonEffect';
2
- export type { MasonEffectRef, MasonEffectOptions } from './MasonEffect';
1
+ /**
2
+ * MasonEffect React - 모든 React 컴포넌트를 export하는 메인 파일
3
+ */
4
+ export { default as TextToParticle } from './textToParticle/index.js';
5
+ export type { TextToParticleRef, TextToParticleOptions } from './textToParticle/index.js';
6
+ export { default as Count } from './count/index.js';
7
+ export type { CountRef, CountOptions } from './count/index.js';
8
+ export { easingFunctions } from './count/index.js';
9
+ export { default as MasonEffect } from './textToParticle/index.js';
10
+ export type { TextToParticleRef as MasonEffectRef, TextToParticleOptions as MasonEffectOptions } from './textToParticle/index.js';
11
+ export { default } from './textToParticle/index.js';
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import type { TextToParticleOptions } from '../../core/index.js';
3
+ export interface TextToParticleRef {
4
+ morph: (textOrOptions?: string | Partial<TextToParticleOptions>) => void;
5
+ scatter: () => void;
6
+ updateConfig: (config: Partial<TextToParticleOptions>) => void;
7
+ destroy: () => void;
8
+ }
9
+ interface TextToParticleProps extends TextToParticleOptions {
10
+ className?: string;
11
+ style?: React.CSSProperties;
12
+ }
13
+ declare const TextToParticleComponent: React.ForwardRefExoticComponent<TextToParticleProps & React.RefAttributes<TextToParticleRef>>;
14
+ export default TextToParticleComponent;
@@ -0,0 +1,3 @@
1
+ export { default } from './TextToParticle';
2
+ export type { TextToParticleRef } from './TextToParticle';
3
+ export type { TextToParticleOptions } from '../../core/textToParticle/index.js';
@@ -0,0 +1 @@
1
+ export { default } from './Count.svelte';
@@ -1,5 +1,7 @@
1
1
  /**
2
- * Svelte component entry point
3
- * Exports the compiled Svelte component
2
+ * MasonEffect Svelte - 모든 Svelte 컴포넌트를 export하는 메인 파일
4
3
  */
5
- export { default } from './MasonEffect.svelte';
4
+ export { default as TextToParticle } from './textToParticle/index.js';
5
+ export { default as Count } from './count/index.js';
6
+ export { default as MasonEffect } from './textToParticle/index.js';
7
+ export { default } from './textToParticle/index.js';
@@ -0,0 +1 @@
1
+ export { default } from './TextToParticle.svelte';
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import type { TextToParticleOptions } from '../../core/index.js';
3
+ export interface TextToParticleRef {
4
+ morph: (textOrOptions?: string | Partial<TextToParticleOptions>) => void;
5
+ scatter: () => void;
6
+ updateConfig: (config: Partial<TextToParticleOptions>) => void;
7
+ destroy: () => void;
8
+ }
9
+ interface TextToParticleProps extends TextToParticleOptions {
10
+ className?: string;
11
+ style?: React.CSSProperties;
12
+ }
13
+ declare const TextToParticleComponent: React.ForwardRefExoticComponent<TextToParticleProps & React.RefAttributes<TextToParticleRef>>;
14
+ export default TextToParticleComponent;
15
+ //# sourceMappingURL=TextToParticle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextToParticle.d.ts","sourceRoot":"","sources":["../../../src/react/textToParticle/TextToParticle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IACzE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IAC/D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,mBAAoB,SAAQ,qBAAqB;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,QAAA,MAAM,uBAAuB,+FAkN5B,CAAC;AAIF,eAAe,uBAAuB,CAAC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Count - 숫자 카운팅 애니메이션 효과
3
+ * 바닐라 JS 코어 클래스
4
+ *
5
+ * 사용법:
6
+ * import { Count } from 'masoneffect/count';
7
+ */
8
+ export interface CountOptions {
9
+ targetValue: number;
10
+ duration?: number;
11
+ startValue?: number;
12
+ enabled?: boolean;
13
+ easing?: (t: number) => number;
14
+ threshold?: number;
15
+ rootMargin?: string;
16
+ triggerOnce?: boolean;
17
+ onUpdate?: (value: number) => void;
18
+ onComplete?: () => void;
19
+ }
20
+ export declare const easingFunctions: {
21
+ linear: (t: number) => number;
22
+ easeInQuad: (t: number) => number;
23
+ easeOutQuad: (t: number) => number;
24
+ easeInOutQuad: (t: number) => number;
25
+ easeOutCubic: (t: number) => number;
26
+ };
27
+ export declare class Count {
28
+ container: HTMLElement;
29
+ config: Required<Omit<CountOptions, 'onUpdate' | 'onComplete'>> & {
30
+ onUpdate: CountOptions['onUpdate'];
31
+ onComplete: CountOptions['onComplete'];
32
+ };
33
+ currentValue: number;
34
+ startTime: number | null;
35
+ animationFrameId: number | null;
36
+ intersectionObserver: IntersectionObserver | null;
37
+ isRunning: boolean;
38
+ hasTriggered: boolean;
39
+ constructor(container: HTMLElement | string, options: CountOptions);
40
+ init(): void;
41
+ setupIntersectionObserver(): void;
42
+ start(): void;
43
+ stop(): void;
44
+ reset(): void;
45
+ updateDisplay(value: number): void;
46
+ formatNumber(value: number): string;
47
+ updateConfig(newConfig: Partial<CountOptions>): void;
48
+ getValue(): number;
49
+ destroy(): void;
50
+ }
51
+ export default Count;
52
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/count/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAGD,eAAO,MAAM,eAAe;gBACd,MAAM;oBACF,MAAM;qBACL,MAAM;uBACJ,MAAM;sBACP,MAAM;CACzB,CAAC;AAEF,qBAAa,KAAK;IAChB,SAAS,EAAE,WAAW,CAAC;IACvB,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,YAAY,CAAC,CAAC,GAAG;QAChE,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;QACnC,UAAU,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;KACxC,CAAC;IACF,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,oBAAoB,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAClD,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;gBAEV,SAAS,EAAE,WAAW,GAAG,MAAM,EAAE,OAAO,EAAE,YAAY;IAoClE,IAAI,IAAI,IAAI;IAQZ,yBAAyB,IAAI,IAAI;IAsDjC,KAAK,IAAI,IAAI;IA6Cb,IAAI,IAAI,IAAI;IAQZ,KAAK,IAAI,IAAI;IAQb,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKlC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAMnC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI;IA0BpD,QAAQ,IAAI,MAAM;IAKlB,OAAO,IAAI,IAAI;CAOhB;AAGD,eAAe,KAAK,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * MasonEffect Core - 모든 이펙트를 export하는 메인 파일
3
+ *
4
+ * 주의: tree-shaking을 위해 각 이펙트를 직접 import하는 것을 권장합니다:
5
+ * - import { TextToParticle } from 'masoneffect/textToParticle'
6
+ * - import { Count } from 'masoneffect/count'
7
+ *
8
+ * 이 파일은 하위 호환성을 위해 제공됩니다.
9
+ */
10
+ export { TextToParticle, default as TextToParticleDefault } from './textToParticle/index.js';
11
+ export type { TextToParticleOptions, Particle } from './textToParticle/index.js';
12
+ export { Count, default as CountDefault } from './count/index.js';
13
+ export type { CountOptions } from './count/index.js';
14
+ export { easingFunctions } from './count/index.js';
15
+ export { TextToParticle as MasonEffect } from './textToParticle/index.js';
16
+ export type { TextToParticleOptions as MasonEffectOptions } from './textToParticle/index.js';
17
+ export { default } from './textToParticle/index.js';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,cAAc,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAC7F,YAAY,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGjF,OAAO,EAAE,KAAK,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAClE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAAE,cAAc,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC1E,YAAY,EAAE,qBAAqB,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAG7F,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC"}