@willphan1712000/frontend 1.7.1 → 1.8.0
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 +293 -40
- package/dist/index.d.mts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +128 -125
- package/dist/index.mjs +89 -81
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,70 +1,323 @@
|
|
|
1
|
-
<img style="width: 15%" src="./will.png">
|
|
1
|
+
<img style="width: 15%" src="./will.png" alt="Will frontend package logo">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# `@willphan1712000/frontend`
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- DropdownSelect, type Options
|
|
7
|
-
- RangeSlider
|
|
8
|
-
- OptionSlider, type SliderOptions
|
|
9
|
-
- ColorPickerSlider
|
|
10
|
-
- MultiSelect
|
|
11
|
-
- Button
|
|
12
|
-
- Avatar
|
|
5
|
+
Reusable React UI components and frontend utilities packaged for application development.
|
|
13
6
|
|
|
14
|
-
##
|
|
15
|
-
- Canvas
|
|
16
|
-
- ImageUtilities
|
|
17
|
-
- tools
|
|
18
|
-
- handleAsync
|
|
19
|
-
- textPreprocessing
|
|
20
|
-
- Auth
|
|
21
|
-
- Math
|
|
7
|
+
## What this package includes
|
|
22
8
|
|
|
23
|
-
|
|
9
|
+
### Components
|
|
10
|
+
- `DropdownSelect`
|
|
11
|
+
- `MultiSelect`
|
|
12
|
+
- `RangeSlider`
|
|
13
|
+
- `OptionSlider`
|
|
14
|
+
- `ColorPickerSlider`
|
|
15
|
+
- `Button`
|
|
16
|
+
- `ModernButton`
|
|
17
|
+
- `Avatar`
|
|
18
|
+
- `InputGoogle`
|
|
19
|
+
- `TextArea`
|
|
20
|
+
- `InputFile`
|
|
21
|
+
- `UploadImage`
|
|
22
|
+
- `Image`
|
|
23
|
+
- `ImageEditor`
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
### Utilities
|
|
26
|
+
- `Canvas`
|
|
27
|
+
- `ImageUtilities`
|
|
28
|
+
- `Transform`
|
|
29
|
+
- `tools`
|
|
30
|
+
- `LinearAlgebra`
|
|
31
|
+
|
|
32
|
+
### Auth helpers
|
|
33
|
+
- `useSession`
|
|
34
|
+
- `SessionProvider`
|
|
35
|
+
- `useAuthClient`
|
|
36
|
+
- `AuthInterface`
|
|
37
|
+
- `StorageInterface`
|
|
26
38
|
|
|
27
39
|
## Installation
|
|
28
40
|
|
|
29
|
-
|
|
41
|
+
This package is intended for React applications.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install @willphan1712000/frontend
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Make sure your app already has React and React DOM installed:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm install react react-dom
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Quick start
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import { useState } from 'react';
|
|
57
|
+
import {
|
|
58
|
+
DropdownSelect,
|
|
59
|
+
RangeSlider,
|
|
60
|
+
Button,
|
|
61
|
+
type Options,
|
|
62
|
+
} from '@willphan1712000/frontend';
|
|
63
|
+
|
|
64
|
+
const options: Options = [
|
|
65
|
+
{ label: 'Low', value: 'low' },
|
|
66
|
+
{ label: 'Medium', value: 'medium' },
|
|
67
|
+
{ label: 'High', value: 'high' },
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
export default function Example() {
|
|
71
|
+
const [priority, setPriority] = useState('medium');
|
|
72
|
+
const [amount, setAmount] = useState('50');
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<div>
|
|
76
|
+
<DropdownSelect
|
|
77
|
+
options={options}
|
|
78
|
+
value={priority}
|
|
79
|
+
onChange={setPriority}
|
|
80
|
+
/>
|
|
81
|
+
|
|
82
|
+
<RangeSlider
|
|
83
|
+
value={amount}
|
|
84
|
+
onChange={setAmount}
|
|
85
|
+
min="0"
|
|
86
|
+
max="100"
|
|
87
|
+
width="240"
|
|
88
|
+
/>
|
|
89
|
+
|
|
90
|
+
<Button
|
|
91
|
+
buttonType="gradient"
|
|
92
|
+
content="Submit"
|
|
93
|
+
type="button"
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Core component usage
|
|
101
|
+
|
|
102
|
+
### `DropdownSelect`
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
import { DropdownSelect, type Options } from '@willphan1712000/frontend';
|
|
30
106
|
|
|
31
|
-
|
|
107
|
+
const options: Options = [
|
|
108
|
+
{ label: 'Apple', value: 'apple' },
|
|
109
|
+
{ label: 'Orange', value: 'orange' },
|
|
110
|
+
];
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Props:
|
|
114
|
+
- `options: { label: string; value: string }[]`
|
|
115
|
+
- `value: string`
|
|
116
|
+
- `onChange: (value: string) => void`
|
|
117
|
+
|
|
118
|
+
### `MultiSelect`
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
import { useState } from 'react';
|
|
122
|
+
import { MultiSelect } from '@willphan1712000/frontend';
|
|
123
|
+
|
|
124
|
+
const options = [
|
|
125
|
+
{ label: 'React', value: 'react' },
|
|
126
|
+
{ label: 'TypeScript', value: 'typescript' },
|
|
127
|
+
];
|
|
32
128
|
|
|
33
|
-
|
|
34
|
-
npm i @willphan1712000/frontend
|
|
129
|
+
const [values, setValues] = useState<string[]>([]);
|
|
35
130
|
```
|
|
36
131
|
|
|
37
|
-
|
|
132
|
+
Props:
|
|
133
|
+
- `options: { label: string; value: string }[]`
|
|
134
|
+
- `value: string[]`
|
|
135
|
+
- `onChange: React.Dispatch<React.SetStateAction<string[]>>`
|
|
136
|
+
- `width?: string`
|
|
137
|
+
|
|
138
|
+
### `RangeSlider`
|
|
139
|
+
|
|
140
|
+
Props:
|
|
141
|
+
- `value: string`
|
|
142
|
+
- `onChange: (value: string) => void`
|
|
143
|
+
- `min?: string`
|
|
144
|
+
- `max?: string`
|
|
145
|
+
- `color?: string`
|
|
146
|
+
- `width?: string`
|
|
147
|
+
|
|
148
|
+
### `OptionSlider`
|
|
149
|
+
|
|
150
|
+
The package exports `SliderOptions` for this component.
|
|
38
151
|
|
|
39
|
-
|
|
152
|
+
Props:
|
|
153
|
+
- `value: string`
|
|
154
|
+
- `onChange: (value: string) => void`
|
|
155
|
+
- `options: { label: ReactNode; value: string }[]`
|
|
156
|
+
- `width?: string`
|
|
157
|
+
- `color?: string`
|
|
40
158
|
|
|
41
|
-
|
|
159
|
+
### `ColorPickerSlider`
|
|
42
160
|
|
|
43
|
-
|
|
161
|
+
Props:
|
|
162
|
+
- `value: string`
|
|
163
|
+
- `onChange: (value: string) => void`
|
|
164
|
+
- `width?: string`
|
|
44
165
|
|
|
45
|
-
|
|
166
|
+
### `Button`
|
|
46
167
|
|
|
47
|
-
|
|
168
|
+
Supports:
|
|
169
|
+
- `buttonType="normal"`
|
|
170
|
+
- `buttonType="solid"`
|
|
171
|
+
- `buttonType="gradient"`
|
|
172
|
+
|
|
173
|
+
Additional styling props:
|
|
174
|
+
- `content?: string`
|
|
175
|
+
- `main?: string`
|
|
176
|
+
- `text?: string`
|
|
177
|
+
- `first?: string`
|
|
178
|
+
- `second?: string`
|
|
179
|
+
- `isLoading?: boolean`
|
|
180
|
+
|
|
181
|
+
Also accepts normal button props such as `onClick`, `type`, `disabled`, and `style`.
|
|
182
|
+
|
|
183
|
+
### `Avatar`
|
|
184
|
+
|
|
185
|
+
`Avatar` combines image upload, preview, edit, and remove flows.
|
|
186
|
+
|
|
187
|
+
```tsx
|
|
188
|
+
import { useState } from 'react';
|
|
189
|
+
import { Avatar } from '@willphan1712000/frontend';
|
|
190
|
+
|
|
191
|
+
const [src, setSrc] = useState<string | undefined>(undefined);
|
|
192
|
+
|
|
193
|
+
<Avatar
|
|
194
|
+
src={src}
|
|
195
|
+
setValue={setSrc}
|
|
196
|
+
options={{ defaultImage: '/images/default-avatar.png' }}
|
|
197
|
+
/>;
|
|
198
|
+
```
|
|
48
199
|
|
|
49
|
-
|
|
200
|
+
Props:
|
|
201
|
+
- `src?: string`
|
|
202
|
+
- `setValue: (src?: string) => void`
|
|
203
|
+
- `options?: { defaultImage?: string }`
|
|
50
204
|
|
|
51
|
-
|
|
205
|
+
## Auth usage
|
|
52
206
|
|
|
53
|
-
|
|
207
|
+
The auth helpers are designed around an auth client object that implements `AuthInterface`.
|
|
208
|
+
|
|
209
|
+
```tsx
|
|
210
|
+
import {
|
|
211
|
+
SessionProvider,
|
|
212
|
+
useAuthClient,
|
|
213
|
+
type AuthInterface,
|
|
214
|
+
} from '@willphan1712000/frontend';
|
|
215
|
+
|
|
216
|
+
class AuthClient implements AuthInterface {
|
|
217
|
+
getSignInUrl() {
|
|
218
|
+
return '/signin';
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
async signin() {}
|
|
222
|
+
|
|
223
|
+
async validate() {
|
|
224
|
+
return {
|
|
225
|
+
username: 'will',
|
|
226
|
+
email: 'will@example.com',
|
|
227
|
+
role: 'admin',
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
async signout() {}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const authClient = new AuthClient();
|
|
235
|
+
|
|
236
|
+
function AppProviders({ children }: { children: React.ReactNode }) {
|
|
237
|
+
const session = useAuthClient(authClient);
|
|
238
|
+
|
|
239
|
+
return (
|
|
240
|
+
<SessionProvider value={session}>
|
|
241
|
+
{children}
|
|
242
|
+
</SessionProvider>
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
`useAuthClient` returns:
|
|
248
|
+
- `isLoading`
|
|
249
|
+
- `session`
|
|
250
|
+
- `auth`
|
|
251
|
+
|
|
252
|
+
## Exported utilities
|
|
253
|
+
|
|
254
|
+
```ts
|
|
255
|
+
import {
|
|
256
|
+
Canvas,
|
|
257
|
+
ImageUtilities,
|
|
258
|
+
Transform,
|
|
259
|
+
tools,
|
|
260
|
+
LinearAlgebra,
|
|
261
|
+
} from '@willphan1712000/frontend';
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Included helpers:
|
|
265
|
+
- `tools.handleAsync(...)`
|
|
266
|
+
- `tools.textPreprocessing(...)`
|
|
267
|
+
|
|
268
|
+
## Development
|
|
269
|
+
|
|
270
|
+
Install dependencies:
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
npm install
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Build the package:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
npm run build
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Run in watch mode during development:
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
npm run dev
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## Local package testing with `npm link`
|
|
289
|
+
|
|
290
|
+
Inside this package:
|
|
291
|
+
|
|
292
|
+
```bash
|
|
54
293
|
npm link
|
|
55
294
|
```
|
|
56
295
|
|
|
57
|
-
|
|
296
|
+
Inside the app where you want to test it:
|
|
58
297
|
|
|
59
|
-
```
|
|
298
|
+
```bash
|
|
60
299
|
npm link @willphan1712000/frontend
|
|
61
300
|
```
|
|
62
301
|
|
|
63
|
-
|
|
64
|
-
> if you encounter the problem "3. You might have more than one copy of React in the same app?"
|
|
65
|
-
> it means your application has loaded two different React instances. This breaks React Hooks, which rely on a single, shared state.
|
|
66
|
-
> Run this to connect to react in your testing project
|
|
302
|
+
If React reports multiple copies loaded, link the consumer app's React instance:
|
|
67
303
|
|
|
68
|
-
```
|
|
304
|
+
```bash
|
|
69
305
|
npm link <path_to_your_testing_project>/node_modules/react
|
|
70
306
|
```
|
|
307
|
+
|
|
308
|
+
## Notes
|
|
309
|
+
|
|
310
|
+
- The package is built with `tsup`.
|
|
311
|
+
- It ships CommonJS, ESM, and TypeScript declaration files.
|
|
312
|
+
- Source code is written in TypeScript and React.
|
|
313
|
+
|
|
314
|
+
## Contributing
|
|
315
|
+
|
|
316
|
+
If you find a bug or want to improve the package, open an issue or submit a pull request.
|
|
317
|
+
|
|
318
|
+
Portfolio:
|
|
319
|
+
- [will-five.vercel.app](https://will-five.vercel.app/w)
|
|
320
|
+
|
|
321
|
+
Contact:
|
|
322
|
+
- [Facebook](https://www.facebook.com/phanthanhnha123200/)
|
|
323
|
+
- [Instagram](https://www.instagram.com/phanthanhnha_0117/)
|
package/dist/index.d.mts
CHANGED
|
@@ -540,9 +540,20 @@ declare function handleAsync<DataType>(data: Promise<DataType>): Promise<HandleA
|
|
|
540
540
|
*/
|
|
541
541
|
declare function textProcessing(text: string): string;
|
|
542
542
|
|
|
543
|
+
/**
|
|
544
|
+
* Function creates and returns a unique UUID and store it in local storage
|
|
545
|
+
* @params key name
|
|
546
|
+
* @returns UUID
|
|
547
|
+
*
|
|
548
|
+
* @example
|
|
549
|
+
* const deviceId = getOrCreateUUID("deviceId")
|
|
550
|
+
*/
|
|
551
|
+
declare function getOrCreateUUID(key: string): string;
|
|
552
|
+
|
|
543
553
|
declare const tools: {
|
|
544
554
|
handleAsync: typeof handleAsync;
|
|
545
555
|
textProcessing: typeof textProcessing;
|
|
556
|
+
getOrCreateUUID: typeof getOrCreateUUID;
|
|
546
557
|
};
|
|
547
558
|
|
|
548
559
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -540,9 +540,20 @@ declare function handleAsync<DataType>(data: Promise<DataType>): Promise<HandleA
|
|
|
540
540
|
*/
|
|
541
541
|
declare function textProcessing(text: string): string;
|
|
542
542
|
|
|
543
|
+
/**
|
|
544
|
+
* Function creates and returns a unique UUID and store it in local storage
|
|
545
|
+
* @params key name
|
|
546
|
+
* @returns UUID
|
|
547
|
+
*
|
|
548
|
+
* @example
|
|
549
|
+
* const deviceId = getOrCreateUUID("deviceId")
|
|
550
|
+
*/
|
|
551
|
+
declare function getOrCreateUUID(key: string): string;
|
|
552
|
+
|
|
543
553
|
declare const tools: {
|
|
544
554
|
handleAsync: typeof handleAsync;
|
|
545
555
|
textProcessing: typeof textProcessing;
|
|
556
|
+
getOrCreateUUID: typeof getOrCreateUUID;
|
|
546
557
|
};
|
|
547
558
|
|
|
548
559
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1115,9 +1115,10 @@ var MultiSelect = ({ options, value, onChange, width = "200" }) => {
|
|
|
1115
1115
|
var MultiSelect_default = MultiSelect;
|
|
1116
1116
|
|
|
1117
1117
|
// src/components/Buttons/Button.tsx
|
|
1118
|
-
var
|
|
1118
|
+
var import_react10 = require("react");
|
|
1119
1119
|
|
|
1120
1120
|
// src/components/Buttons/gradient/Gradient.tsx
|
|
1121
|
+
var import_react9 = require("react");
|
|
1121
1122
|
var import_framer_motion = require("framer-motion");
|
|
1122
1123
|
|
|
1123
1124
|
// src/components/Buttons/gradient/styles.ts
|
|
@@ -1127,7 +1128,7 @@ var styles6 = (first, second) => {
|
|
|
1127
1128
|
container: {
|
|
1128
1129
|
position: "relative",
|
|
1129
1130
|
borderRadius,
|
|
1130
|
-
padding: "
|
|
1131
|
+
padding: "1px"
|
|
1131
1132
|
},
|
|
1132
1133
|
btn: {
|
|
1133
1134
|
position: "relative",
|
|
@@ -1138,9 +1139,10 @@ var styles6 = (first, second) => {
|
|
|
1138
1139
|
padding: "2px",
|
|
1139
1140
|
borderRadius,
|
|
1140
1141
|
backgroundColor: `${first}`,
|
|
1141
|
-
backgroundImage: `linear-gradient(
|
|
1142
|
+
backgroundImage: `linear-gradient(${120}deg, ${first} 0%, ${second} 100%)`,
|
|
1142
1143
|
border: "none",
|
|
1143
|
-
cursor: "pointer"
|
|
1144
|
+
cursor: "pointer",
|
|
1145
|
+
width: "100%"
|
|
1144
1146
|
},
|
|
1145
1147
|
btnAfter: {
|
|
1146
1148
|
position: "absolute",
|
|
@@ -1151,8 +1153,13 @@ var styles6 = (first, second) => {
|
|
|
1151
1153
|
content: '""',
|
|
1152
1154
|
zIndex: 0,
|
|
1153
1155
|
backgroundColor: `${first}`,
|
|
1154
|
-
backgroundImage: `linear-gradient(
|
|
1155
|
-
filter: "blur(
|
|
1156
|
+
backgroundImage: `linear-gradient(${120}deg, ${first} 0%, ${second} 100%)`,
|
|
1157
|
+
filter: "blur(8px)",
|
|
1158
|
+
borderRadius
|
|
1159
|
+
},
|
|
1160
|
+
labelWrapper: {
|
|
1161
|
+
position: "relative",
|
|
1162
|
+
width: "100%"
|
|
1156
1163
|
},
|
|
1157
1164
|
label: {
|
|
1158
1165
|
backgroundColor: "#111723",
|
|
@@ -1186,16 +1193,6 @@ var styles6 = (first, second) => {
|
|
|
1186
1193
|
position: "relative",
|
|
1187
1194
|
zIndex: 1,
|
|
1188
1195
|
margin: 0
|
|
1189
|
-
},
|
|
1190
|
-
neon: {
|
|
1191
|
-
content: '""',
|
|
1192
|
-
background: "conic-gradient(transparent 270deg, green, transparent)",
|
|
1193
|
-
position: "absolute",
|
|
1194
|
-
top: "50%",
|
|
1195
|
-
left: "50%",
|
|
1196
|
-
transform: "translate(-50%, -50%)",
|
|
1197
|
-
aspectRatio: 1,
|
|
1198
|
-
width: "100%"
|
|
1199
1196
|
}
|
|
1200
1197
|
};
|
|
1201
1198
|
return styles12;
|
|
@@ -1207,54 +1204,43 @@ var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
|
1207
1204
|
var Gradient = () => {
|
|
1208
1205
|
const data = useButtonContext();
|
|
1209
1206
|
const styles12 = styles_default6(data.first, data.second);
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
"div",
|
|
1221
|
-
{
|
|
1222
|
-
style: __spreadProps(__spreadValues({}, styles12.label), {
|
|
1223
|
-
backgroundColor: data.main
|
|
1224
|
-
}),
|
|
1225
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1226
|
-
"p",
|
|
1227
|
-
{
|
|
1228
|
-
style: __spreadProps(__spreadValues({}, styles12.p), {
|
|
1229
|
-
color: `${data.text}`
|
|
1230
|
-
}),
|
|
1231
|
-
children: [
|
|
1232
|
-
data.children,
|
|
1233
|
-
" ",
|
|
1234
|
-
data.content
|
|
1235
|
-
]
|
|
1236
|
-
}
|
|
1237
|
-
)
|
|
1238
|
-
}
|
|
1239
|
-
),
|
|
1240
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: styles12.labelAfter })
|
|
1241
|
-
] }) })),
|
|
1242
|
-
!data.isLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: styles12.btnAfter }),
|
|
1243
|
-
data.isLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1244
|
-
import_framer_motion.motion.div,
|
|
1245
|
-
{
|
|
1246
|
-
style: styles12.btnAfter,
|
|
1247
|
-
animate: { rotate: 360 },
|
|
1248
|
-
transition: {
|
|
1249
|
-
ease: "linear",
|
|
1250
|
-
repeat: Infinity,
|
|
1251
|
-
duration: 3
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
)
|
|
1255
|
-
]
|
|
1207
|
+
const angle = (0, import_framer_motion.useMotionValue)(10);
|
|
1208
|
+
const background2 = import_framer_motion.useMotionTemplate`conic-gradient(from ${angle}deg, #00000000 60%, ${data.first}, ${data.second})`;
|
|
1209
|
+
(0, import_react9.useEffect)(() => {
|
|
1210
|
+
if (data.isLoading) {
|
|
1211
|
+
const controls = (0, import_framer_motion.animate)(angle, angle.get() + 360, {
|
|
1212
|
+
repeat: Infinity,
|
|
1213
|
+
duration: 2,
|
|
1214
|
+
ease: "linear"
|
|
1215
|
+
});
|
|
1216
|
+
return controls.stop;
|
|
1256
1217
|
}
|
|
1257
|
-
);
|
|
1218
|
+
}, [data.isLoading, angle]);
|
|
1219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: styles12.container, children: [
|
|
1220
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", __spreadProps(__spreadValues({ style: styles12.btn }, data.props), { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: styles12.labelWrapper, children: [
|
|
1221
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: styles12.labelBefore }),
|
|
1222
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1223
|
+
"div",
|
|
1224
|
+
{
|
|
1225
|
+
style: __spreadProps(__spreadValues({}, styles12.label), { backgroundColor: data.main }),
|
|
1226
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { style: __spreadProps(__spreadValues({}, styles12.p), { color: `${data.text}` }), children: [
|
|
1227
|
+
data.children,
|
|
1228
|
+
" ",
|
|
1229
|
+
data.content
|
|
1230
|
+
] })
|
|
1231
|
+
}
|
|
1232
|
+
),
|
|
1233
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: styles12.labelAfter })
|
|
1234
|
+
] }) })),
|
|
1235
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1236
|
+
import_framer_motion.motion.div,
|
|
1237
|
+
{
|
|
1238
|
+
style: __spreadProps(__spreadValues({}, styles12.btnAfter), {
|
|
1239
|
+
background: background2
|
|
1240
|
+
})
|
|
1241
|
+
}
|
|
1242
|
+
)
|
|
1243
|
+
] });
|
|
1258
1244
|
};
|
|
1259
1245
|
var Gradient_default = Gradient;
|
|
1260
1246
|
|
|
@@ -1367,9 +1353,9 @@ var Solid_default = Solid;
|
|
|
1367
1353
|
|
|
1368
1354
|
// src/components/Buttons/Button.tsx
|
|
1369
1355
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1370
|
-
var ButtonContext = (0,
|
|
1356
|
+
var ButtonContext = (0, import_react10.createContext)(void 0);
|
|
1371
1357
|
function useButtonContext() {
|
|
1372
|
-
const data = (0,
|
|
1358
|
+
const data = (0, import_react10.useContext)(ButtonContext);
|
|
1373
1359
|
if (data === void 0) {
|
|
1374
1360
|
throw new Error("Select Context is undefined");
|
|
1375
1361
|
}
|
|
@@ -1440,7 +1426,7 @@ var Button = (_a) => {
|
|
|
1440
1426
|
var Button_default = Button;
|
|
1441
1427
|
|
|
1442
1428
|
// src/components/Buttons/modern/Modern.tsx
|
|
1443
|
-
var
|
|
1429
|
+
var import_react11 = require("react");
|
|
1444
1430
|
|
|
1445
1431
|
// src/components/Buttons/modern/styles.ts
|
|
1446
1432
|
var styles8 = (first) => {
|
|
@@ -1458,7 +1444,8 @@ var styles8 = (first) => {
|
|
|
1458
1444
|
color: first,
|
|
1459
1445
|
backgroundColor: `color-mix(in srgb, ${first} 20%, transparent)`,
|
|
1460
1446
|
fontSize: "15px",
|
|
1461
|
-
transition: "all .1s linear"
|
|
1447
|
+
transition: "all .1s linear",
|
|
1448
|
+
whiteSpace: "nowrap"
|
|
1462
1449
|
}
|
|
1463
1450
|
};
|
|
1464
1451
|
return styles12;
|
|
@@ -1481,7 +1468,7 @@ var Modern = (_a) => {
|
|
|
1481
1468
|
"hover",
|
|
1482
1469
|
"shadow"
|
|
1483
1470
|
]);
|
|
1484
|
-
const [isHover, setHover] = (0,
|
|
1471
|
+
const [isHover, setHover] = (0, import_react11.useState)(false);
|
|
1485
1472
|
const handleEnter = () => {
|
|
1486
1473
|
if (!hover) return;
|
|
1487
1474
|
setHover(true);
|
|
@@ -1566,17 +1553,17 @@ var styles9 = {
|
|
|
1566
1553
|
var styles_default9 = styles9;
|
|
1567
1554
|
|
|
1568
1555
|
// src/components/Avatar/Avatar.tsx
|
|
1569
|
-
var
|
|
1556
|
+
var import_react12 = require("react");
|
|
1570
1557
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1571
1558
|
var Avatar = ({ src, setValue, options }) => {
|
|
1572
|
-
const [isOpen, setOpen] = (0,
|
|
1573
|
-
const [isNew, setNew] = (0,
|
|
1574
|
-
const defaultImage = (0,
|
|
1575
|
-
const initialImage = (0,
|
|
1576
|
-
const uploadImageRef = (0,
|
|
1559
|
+
const [isOpen, setOpen] = (0, import_react12.useState)(false);
|
|
1560
|
+
const [isNew, setNew] = (0, import_react12.useState)(false);
|
|
1561
|
+
const defaultImage = (0, import_react12.useRef)(void 0);
|
|
1562
|
+
const initialImage = (0, import_react12.useRef)(void 0);
|
|
1563
|
+
const uploadImageRef = (0, import_react12.useRef)(null);
|
|
1577
1564
|
const isAbleToEdit = initialImage.current ? src !== defaultImage.current && src !== initialImage.current : false;
|
|
1578
1565
|
const isAbleToRemove = initialImage.current ? src !== defaultImage.current : false;
|
|
1579
|
-
(0,
|
|
1566
|
+
(0, import_react12.useEffect)(() => {
|
|
1580
1567
|
(function setSrc() {
|
|
1581
1568
|
return __async(this, null, function* () {
|
|
1582
1569
|
var _a, _b;
|
|
@@ -1657,7 +1644,7 @@ var Avatar = ({ src, setValue, options }) => {
|
|
|
1657
1644
|
var Avatar_default = Avatar;
|
|
1658
1645
|
|
|
1659
1646
|
// src/components/Input/InputGoogle/InputGoogle.tsx
|
|
1660
|
-
var
|
|
1647
|
+
var import_react13 = require("react");
|
|
1661
1648
|
|
|
1662
1649
|
// src/components/Input/InputGoogle/InputGoogle.styles.ts
|
|
1663
1650
|
var others2 = {
|
|
@@ -1669,7 +1656,7 @@ var others2 = {
|
|
|
1669
1656
|
borderFocus: "#0957d0",
|
|
1670
1657
|
textRelease: "#000",
|
|
1671
1658
|
textFocus: "#0957d0",
|
|
1672
|
-
border: "solid
|
|
1659
|
+
border: "solid 1px"
|
|
1673
1660
|
};
|
|
1674
1661
|
var styles10 = {
|
|
1675
1662
|
input: {
|
|
@@ -1713,9 +1700,9 @@ var InputGoogle = (_a) => {
|
|
|
1713
1700
|
"label",
|
|
1714
1701
|
"options"
|
|
1715
1702
|
]);
|
|
1716
|
-
const [isFocus, setFocus] = (0,
|
|
1717
|
-
const spanRef = (0,
|
|
1718
|
-
const inputRef = (0,
|
|
1703
|
+
const [isFocus, setFocus] = (0, import_react13.useState)(false);
|
|
1704
|
+
const spanRef = (0, import_react13.useRef)(null);
|
|
1705
|
+
const inputRef = (0, import_react13.useRef)(null);
|
|
1719
1706
|
function transitionOnFocus() {
|
|
1720
1707
|
setFocus(true);
|
|
1721
1708
|
if (spanRef.current) {
|
|
@@ -1737,7 +1724,7 @@ var InputGoogle = (_a) => {
|
|
|
1737
1724
|
}
|
|
1738
1725
|
const inputBorder = isFocus ? `${others2.border} ${options ? options.focusColor : others2.borderFocus}` : `${others2.border} ${others2.borderRelease}`;
|
|
1739
1726
|
const labelTextColor = isFocus ? `${options ? options.focusColor : others2.textFocus}` : `${others2.textRelease}`;
|
|
1740
|
-
(0,
|
|
1727
|
+
(0, import_react13.useEffect)(() => {
|
|
1741
1728
|
transitionOnFocus();
|
|
1742
1729
|
transitionOffFocus();
|
|
1743
1730
|
}, []);
|
|
@@ -1774,7 +1761,7 @@ var InputGoogle = (_a) => {
|
|
|
1774
1761
|
var InputGoogle_default = InputGoogle;
|
|
1775
1762
|
|
|
1776
1763
|
// src/components/Input/TextArea/TextArea.tsx
|
|
1777
|
-
var
|
|
1764
|
+
var import_react14 = require("react");
|
|
1778
1765
|
|
|
1779
1766
|
// src/components/Input/TextArea/TextArea.styles.ts
|
|
1780
1767
|
var labelHeight = 20;
|
|
@@ -1787,7 +1774,7 @@ var others3 = {
|
|
|
1787
1774
|
borderFocus: "#0957d0",
|
|
1788
1775
|
textRelease: "#000",
|
|
1789
1776
|
textFocus: "#0957d0",
|
|
1790
|
-
border: "solid
|
|
1777
|
+
border: "solid 1px"
|
|
1791
1778
|
};
|
|
1792
1779
|
var styles11 = {
|
|
1793
1780
|
input: {
|
|
@@ -1834,9 +1821,9 @@ var TextArea = (_a) => {
|
|
|
1834
1821
|
"label",
|
|
1835
1822
|
"options"
|
|
1836
1823
|
]);
|
|
1837
|
-
const [isFocus, setFocus] = (0,
|
|
1838
|
-
const spanRef = (0,
|
|
1839
|
-
const inputRef = (0,
|
|
1824
|
+
const [isFocus, setFocus] = (0, import_react14.useState)(false);
|
|
1825
|
+
const spanRef = (0, import_react14.useRef)(null);
|
|
1826
|
+
const inputRef = (0, import_react14.useRef)(null);
|
|
1840
1827
|
function transitionOnFocus() {
|
|
1841
1828
|
setFocus(true);
|
|
1842
1829
|
if (spanRef.current) {
|
|
@@ -1858,7 +1845,7 @@ var TextArea = (_a) => {
|
|
|
1858
1845
|
}
|
|
1859
1846
|
const inputBorder = isFocus ? `${others3.border} ${options ? options.focusColor : others3.borderFocus}` : `${others3.border} ${others3.borderRelease}`;
|
|
1860
1847
|
const labelTextColor = isFocus ? `${options ? options.focusColor : others3.textFocus}` : `${others3.textRelease}`;
|
|
1861
|
-
(0,
|
|
1848
|
+
(0, import_react14.useEffect)(() => {
|
|
1862
1849
|
transitionOnFocus();
|
|
1863
1850
|
transitionOffFocus();
|
|
1864
1851
|
}, []);
|
|
@@ -1894,7 +1881,7 @@ var TextArea = (_a) => {
|
|
|
1894
1881
|
var TextArea_default = TextArea;
|
|
1895
1882
|
|
|
1896
1883
|
// src/components/Input/InputFile.tsx
|
|
1897
|
-
var
|
|
1884
|
+
var import_react15 = require("react");
|
|
1898
1885
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1899
1886
|
var InputFile = (_a) => {
|
|
1900
1887
|
var _b = _a, {
|
|
@@ -1909,7 +1896,7 @@ var InputFile = (_a) => {
|
|
|
1909
1896
|
"onCancel",
|
|
1910
1897
|
"acceptType"
|
|
1911
1898
|
]);
|
|
1912
|
-
const [key, setKey] = (0,
|
|
1899
|
+
const [key, setKey] = (0, import_react15.useState)(Date.now());
|
|
1913
1900
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1914
1901
|
"input",
|
|
1915
1902
|
__spreadValues({
|
|
@@ -1978,7 +1965,7 @@ var Image = (_a) => {
|
|
|
1978
1965
|
var Image_default = Image;
|
|
1979
1966
|
|
|
1980
1967
|
// src/components/Image/ImageEditor/ImageEditor.tsx
|
|
1981
|
-
var
|
|
1968
|
+
var import_react19 = require("react");
|
|
1982
1969
|
|
|
1983
1970
|
// src/components/Image/ImageEditor/ImageEditor.styles.ts
|
|
1984
1971
|
var imageEditorStyles = {
|
|
@@ -2397,13 +2384,13 @@ var WTouchEvent = class {
|
|
|
2397
2384
|
};
|
|
2398
2385
|
|
|
2399
2386
|
// src/components/Image/ImageEditor/MainElements/MainElements.tsx
|
|
2400
|
-
var
|
|
2387
|
+
var import_react18 = require("react");
|
|
2401
2388
|
|
|
2402
2389
|
// src/components/Image/ImageEditor/context.ts
|
|
2403
|
-
var
|
|
2404
|
-
var MyContext3 = (0,
|
|
2390
|
+
var import_react16 = require("react");
|
|
2391
|
+
var MyContext3 = (0, import_react16.createContext)(void 0);
|
|
2405
2392
|
function useMyContext3() {
|
|
2406
|
-
const data = (0,
|
|
2393
|
+
const data = (0, import_react16.useContext)(MyContext3);
|
|
2407
2394
|
if (data === void 0) throw new Error("Context is undefined");
|
|
2408
2395
|
return data;
|
|
2409
2396
|
}
|
|
@@ -2534,11 +2521,11 @@ var MainElementStyles = {
|
|
|
2534
2521
|
var MainElements_styles_default = MainElementStyles;
|
|
2535
2522
|
|
|
2536
2523
|
// src/components/Image/ImageEditor/MainElements/Rotate.tsx
|
|
2537
|
-
var
|
|
2524
|
+
var import_react17 = require("react");
|
|
2538
2525
|
var import_fa62 = require("react-icons/fa6");
|
|
2539
2526
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2540
2527
|
var Rotate = () => {
|
|
2541
|
-
const [rotate, setRotate] = (0,
|
|
2528
|
+
const [rotate, setRotate] = (0, import_react17.useState)(false);
|
|
2542
2529
|
const { transformOperation: transformOperation2, refs } = useMyContext3();
|
|
2543
2530
|
const mouseEvent = new WMouseEvent(transformOperation2);
|
|
2544
2531
|
const touchEvent = new WTouchEvent(transformOperation2);
|
|
@@ -2546,7 +2533,7 @@ var Rotate = () => {
|
|
|
2546
2533
|
const handleBackground = (value) => {
|
|
2547
2534
|
return value ? MainElements_styles_default.buttonBackgroundDown : MainElements_styles_default.buttonBackground;
|
|
2548
2535
|
};
|
|
2549
|
-
(0,
|
|
2536
|
+
(0, import_react17.useEffect)(() => {
|
|
2550
2537
|
const controller = new AbortController();
|
|
2551
2538
|
const handler = () => {
|
|
2552
2539
|
setRotate(false);
|
|
@@ -2649,16 +2636,16 @@ var MainElements = () => {
|
|
|
2649
2636
|
} = useMyContext3();
|
|
2650
2637
|
const mouseEvent = new WMouseEvent(transformOperation2);
|
|
2651
2638
|
const touchEvent = new WTouchEvent(transformOperation2);
|
|
2652
|
-
const [topLeft, settopLeft] = (0,
|
|
2653
|
-
const [topRight, settopRight] = (0,
|
|
2654
|
-
const [bottomLeft, setbottomLeft] = (0,
|
|
2655
|
-
const [bottomRight, setbottomRight] = (0,
|
|
2656
|
-
const [reRender, triggierReRender] = (0,
|
|
2639
|
+
const [topLeft, settopLeft] = (0, import_react18.useState)(false);
|
|
2640
|
+
const [topRight, settopRight] = (0, import_react18.useState)(false);
|
|
2641
|
+
const [bottomLeft, setbottomLeft] = (0, import_react18.useState)(false);
|
|
2642
|
+
const [bottomRight, setbottomRight] = (0, import_react18.useState)(false);
|
|
2643
|
+
const [reRender, triggierReRender] = (0, import_react18.useState)(false);
|
|
2657
2644
|
const { angle, width, height } = transformOperation2.getDimension();
|
|
2658
2645
|
const handleBackground = (value) => {
|
|
2659
2646
|
return value ? MainElements_styles_default.buttonBackgroundDown : MainElements_styles_default.buttonBackground;
|
|
2660
2647
|
};
|
|
2661
|
-
(0,
|
|
2648
|
+
(0, import_react18.useEffect)(() => {
|
|
2662
2649
|
const controller = new AbortController();
|
|
2663
2650
|
const handler = () => {
|
|
2664
2651
|
settopLeft(false);
|
|
@@ -2945,21 +2932,21 @@ var ImageEditor = ({
|
|
|
2945
2932
|
},
|
|
2946
2933
|
isNew = false
|
|
2947
2934
|
}) => {
|
|
2948
|
-
const container = (0,
|
|
2949
|
-
const frame = (0,
|
|
2950
|
-
const img = (0,
|
|
2951
|
-
const controller = (0,
|
|
2952
|
-
const topLeft = (0,
|
|
2953
|
-
const topRight = (0,
|
|
2954
|
-
const bottomLeft = (0,
|
|
2955
|
-
const bottomRight = (0,
|
|
2956
|
-
const rotate = (0,
|
|
2957
|
-
const rotateBottom = (0,
|
|
2958
|
-
const [transform, setTransform] = (0,
|
|
2935
|
+
const container = (0, import_react19.useRef)(null);
|
|
2936
|
+
const frame = (0, import_react19.useRef)(null);
|
|
2937
|
+
const img = (0, import_react19.useRef)(null);
|
|
2938
|
+
const controller = (0, import_react19.useRef)(null);
|
|
2939
|
+
const topLeft = (0, import_react19.useRef)(null);
|
|
2940
|
+
const topRight = (0, import_react19.useRef)(null);
|
|
2941
|
+
const bottomLeft = (0, import_react19.useRef)(null);
|
|
2942
|
+
const bottomRight = (0, import_react19.useRef)(null);
|
|
2943
|
+
const rotate = (0, import_react19.useRef)(null);
|
|
2944
|
+
const rotateBottom = (0, import_react19.useRef)(null);
|
|
2945
|
+
const [transform, setTransform] = (0, import_react19.useState)(
|
|
2959
2946
|
void 0
|
|
2960
2947
|
);
|
|
2961
|
-
const transformState = (0,
|
|
2962
|
-
const originalSrc = (0,
|
|
2948
|
+
const transformState = (0, import_react19.useRef)(void 0);
|
|
2949
|
+
const originalSrc = (0, import_react19.useMemo)(() => {
|
|
2963
2950
|
transformState.current = void 0;
|
|
2964
2951
|
return src;
|
|
2965
2952
|
}, [isNew]);
|
|
@@ -3018,7 +3005,7 @@ var ImageEditor = ({
|
|
|
3018
3005
|
function handleWindowScroll(isOpen2) {
|
|
3019
3006
|
document.body.style.overflow = isOpen2 ? "hidden" : "auto";
|
|
3020
3007
|
}
|
|
3021
|
-
(0,
|
|
3008
|
+
(0, import_react19.useEffect)(() => {
|
|
3022
3009
|
isOpen ? createTransform() : setTransform(void 0);
|
|
3023
3010
|
handleWindowScroll(isOpen);
|
|
3024
3011
|
return () => {
|
|
@@ -3544,20 +3531,36 @@ function textProcessing(text) {
|
|
|
3544
3531
|
return newWords.join(" ");
|
|
3545
3532
|
}
|
|
3546
3533
|
|
|
3534
|
+
// src/utilities/tools/UUID.ts
|
|
3535
|
+
function getOrCreateUUID(key) {
|
|
3536
|
+
const STORAGE_KEY = key;
|
|
3537
|
+
let deviceId = localStorage.getItem(STORAGE_KEY);
|
|
3538
|
+
if (!deviceId) {
|
|
3539
|
+
if (window.crypto && window.crypto.randomUUID) {
|
|
3540
|
+
deviceId = window.crypto.randomUUID();
|
|
3541
|
+
} else {
|
|
3542
|
+
deviceId = "id-" + Math.random().toString(36).substring(2, 15) + Date.now().toString(36);
|
|
3543
|
+
}
|
|
3544
|
+
localStorage.setItem(STORAGE_KEY, deviceId);
|
|
3545
|
+
}
|
|
3546
|
+
return deviceId;
|
|
3547
|
+
}
|
|
3548
|
+
|
|
3547
3549
|
// src/utilities/tools/tools.ts
|
|
3548
3550
|
var tools = {
|
|
3549
3551
|
handleAsync: handleAsync_default,
|
|
3550
|
-
textProcessing
|
|
3552
|
+
textProcessing,
|
|
3553
|
+
getOrCreateUUID
|
|
3551
3554
|
};
|
|
3552
3555
|
var tools_default = tools;
|
|
3553
3556
|
|
|
3554
3557
|
// src/auth/react/context.tsx
|
|
3555
|
-
var
|
|
3556
|
-
var SessionContext = (0,
|
|
3558
|
+
var import_react20 = require("react");
|
|
3559
|
+
var SessionContext = (0, import_react20.createContext)(
|
|
3557
3560
|
void 0
|
|
3558
3561
|
);
|
|
3559
3562
|
function useSession() {
|
|
3560
|
-
const data = (0,
|
|
3563
|
+
const data = (0, import_react20.useContext)(SessionContext);
|
|
3561
3564
|
if (data === void 0) throw new Error("Session context is undefined");
|
|
3562
3565
|
return data;
|
|
3563
3566
|
}
|
|
@@ -3573,11 +3576,11 @@ var SessionProvider = ({
|
|
|
3573
3576
|
var SessionProvider_default = SessionProvider;
|
|
3574
3577
|
|
|
3575
3578
|
// src/auth/react/useAuthClient.ts
|
|
3576
|
-
var
|
|
3579
|
+
var import_react21 = require("react");
|
|
3577
3580
|
var useAuthClient = (auth) => {
|
|
3578
|
-
const [isLoading, setLoading] = (0,
|
|
3579
|
-
const sessionRef = (0,
|
|
3580
|
-
(0,
|
|
3581
|
+
const [isLoading, setLoading] = (0, import_react21.useState)(false);
|
|
3582
|
+
const sessionRef = (0, import_react21.useRef)(void 0);
|
|
3583
|
+
(0, import_react21.useEffect)(() => {
|
|
3581
3584
|
let is = true;
|
|
3582
3585
|
const getSession = () => __async(null, null, function* () {
|
|
3583
3586
|
setLoading(true);
|
package/dist/index.mjs
CHANGED
|
@@ -1074,7 +1074,13 @@ var MultiSelect_default = MultiSelect;
|
|
|
1074
1074
|
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
1075
1075
|
|
|
1076
1076
|
// src/components/Buttons/gradient/Gradient.tsx
|
|
1077
|
-
import {
|
|
1077
|
+
import { useEffect as useEffect7 } from "react";
|
|
1078
|
+
import {
|
|
1079
|
+
motion,
|
|
1080
|
+
useMotionValue,
|
|
1081
|
+
useMotionTemplate,
|
|
1082
|
+
animate
|
|
1083
|
+
} from "framer-motion";
|
|
1078
1084
|
|
|
1079
1085
|
// src/components/Buttons/gradient/styles.ts
|
|
1080
1086
|
var borderRadius = "20px";
|
|
@@ -1083,7 +1089,7 @@ var styles6 = (first, second) => {
|
|
|
1083
1089
|
container: {
|
|
1084
1090
|
position: "relative",
|
|
1085
1091
|
borderRadius,
|
|
1086
|
-
padding: "
|
|
1092
|
+
padding: "1px"
|
|
1087
1093
|
},
|
|
1088
1094
|
btn: {
|
|
1089
1095
|
position: "relative",
|
|
@@ -1094,9 +1100,10 @@ var styles6 = (first, second) => {
|
|
|
1094
1100
|
padding: "2px",
|
|
1095
1101
|
borderRadius,
|
|
1096
1102
|
backgroundColor: `${first}`,
|
|
1097
|
-
backgroundImage: `linear-gradient(
|
|
1103
|
+
backgroundImage: `linear-gradient(${120}deg, ${first} 0%, ${second} 100%)`,
|
|
1098
1104
|
border: "none",
|
|
1099
|
-
cursor: "pointer"
|
|
1105
|
+
cursor: "pointer",
|
|
1106
|
+
width: "100%"
|
|
1100
1107
|
},
|
|
1101
1108
|
btnAfter: {
|
|
1102
1109
|
position: "absolute",
|
|
@@ -1107,8 +1114,13 @@ var styles6 = (first, second) => {
|
|
|
1107
1114
|
content: '""',
|
|
1108
1115
|
zIndex: 0,
|
|
1109
1116
|
backgroundColor: `${first}`,
|
|
1110
|
-
backgroundImage: `linear-gradient(
|
|
1111
|
-
filter: "blur(
|
|
1117
|
+
backgroundImage: `linear-gradient(${120}deg, ${first} 0%, ${second} 100%)`,
|
|
1118
|
+
filter: "blur(8px)",
|
|
1119
|
+
borderRadius
|
|
1120
|
+
},
|
|
1121
|
+
labelWrapper: {
|
|
1122
|
+
position: "relative",
|
|
1123
|
+
width: "100%"
|
|
1112
1124
|
},
|
|
1113
1125
|
label: {
|
|
1114
1126
|
backgroundColor: "#111723",
|
|
@@ -1142,16 +1154,6 @@ var styles6 = (first, second) => {
|
|
|
1142
1154
|
position: "relative",
|
|
1143
1155
|
zIndex: 1,
|
|
1144
1156
|
margin: 0
|
|
1145
|
-
},
|
|
1146
|
-
neon: {
|
|
1147
|
-
content: '""',
|
|
1148
|
-
background: "conic-gradient(transparent 270deg, green, transparent)",
|
|
1149
|
-
position: "absolute",
|
|
1150
|
-
top: "50%",
|
|
1151
|
-
left: "50%",
|
|
1152
|
-
transform: "translate(-50%, -50%)",
|
|
1153
|
-
aspectRatio: 1,
|
|
1154
|
-
width: "100%"
|
|
1155
1157
|
}
|
|
1156
1158
|
};
|
|
1157
1159
|
return styles12;
|
|
@@ -1163,54 +1165,43 @@ import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
|
1163
1165
|
var Gradient = () => {
|
|
1164
1166
|
const data = useButtonContext();
|
|
1165
1167
|
const styles12 = styles_default6(data.first, data.second);
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
"div",
|
|
1177
|
-
{
|
|
1178
|
-
style: __spreadProps(__spreadValues({}, styles12.label), {
|
|
1179
|
-
backgroundColor: data.main
|
|
1180
|
-
}),
|
|
1181
|
-
children: /* @__PURE__ */ jsxs8(
|
|
1182
|
-
"p",
|
|
1183
|
-
{
|
|
1184
|
-
style: __spreadProps(__spreadValues({}, styles12.p), {
|
|
1185
|
-
color: `${data.text}`
|
|
1186
|
-
}),
|
|
1187
|
-
children: [
|
|
1188
|
-
data.children,
|
|
1189
|
-
" ",
|
|
1190
|
-
data.content
|
|
1191
|
-
]
|
|
1192
|
-
}
|
|
1193
|
-
)
|
|
1194
|
-
}
|
|
1195
|
-
),
|
|
1196
|
-
/* @__PURE__ */ jsx10("div", { style: styles12.labelAfter })
|
|
1197
|
-
] }) })),
|
|
1198
|
-
!data.isLoading && /* @__PURE__ */ jsx10("div", { style: styles12.btnAfter }),
|
|
1199
|
-
data.isLoading && /* @__PURE__ */ jsx10(
|
|
1200
|
-
motion.div,
|
|
1201
|
-
{
|
|
1202
|
-
style: styles12.btnAfter,
|
|
1203
|
-
animate: { rotate: 360 },
|
|
1204
|
-
transition: {
|
|
1205
|
-
ease: "linear",
|
|
1206
|
-
repeat: Infinity,
|
|
1207
|
-
duration: 3
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
)
|
|
1211
|
-
]
|
|
1168
|
+
const angle = useMotionValue(10);
|
|
1169
|
+
const background2 = useMotionTemplate`conic-gradient(from ${angle}deg, #00000000 60%, ${data.first}, ${data.second})`;
|
|
1170
|
+
useEffect7(() => {
|
|
1171
|
+
if (data.isLoading) {
|
|
1172
|
+
const controls = animate(angle, angle.get() + 360, {
|
|
1173
|
+
repeat: Infinity,
|
|
1174
|
+
duration: 2,
|
|
1175
|
+
ease: "linear"
|
|
1176
|
+
});
|
|
1177
|
+
return controls.stop;
|
|
1212
1178
|
}
|
|
1213
|
-
);
|
|
1179
|
+
}, [data.isLoading, angle]);
|
|
1180
|
+
return /* @__PURE__ */ jsxs8("div", { style: styles12.container, children: [
|
|
1181
|
+
/* @__PURE__ */ jsx10("button", __spreadProps(__spreadValues({ style: styles12.btn }, data.props), { children: /* @__PURE__ */ jsxs8("div", { style: styles12.labelWrapper, children: [
|
|
1182
|
+
/* @__PURE__ */ jsx10("div", { style: styles12.labelBefore }),
|
|
1183
|
+
/* @__PURE__ */ jsx10(
|
|
1184
|
+
"div",
|
|
1185
|
+
{
|
|
1186
|
+
style: __spreadProps(__spreadValues({}, styles12.label), { backgroundColor: data.main }),
|
|
1187
|
+
children: /* @__PURE__ */ jsxs8("p", { style: __spreadProps(__spreadValues({}, styles12.p), { color: `${data.text}` }), children: [
|
|
1188
|
+
data.children,
|
|
1189
|
+
" ",
|
|
1190
|
+
data.content
|
|
1191
|
+
] })
|
|
1192
|
+
}
|
|
1193
|
+
),
|
|
1194
|
+
/* @__PURE__ */ jsx10("div", { style: styles12.labelAfter })
|
|
1195
|
+
] }) })),
|
|
1196
|
+
/* @__PURE__ */ jsx10(
|
|
1197
|
+
motion.div,
|
|
1198
|
+
{
|
|
1199
|
+
style: __spreadProps(__spreadValues({}, styles12.btnAfter), {
|
|
1200
|
+
background: background2
|
|
1201
|
+
})
|
|
1202
|
+
}
|
|
1203
|
+
)
|
|
1204
|
+
] });
|
|
1214
1205
|
};
|
|
1215
1206
|
var Gradient_default = Gradient;
|
|
1216
1207
|
|
|
@@ -1414,7 +1405,8 @@ var styles8 = (first) => {
|
|
|
1414
1405
|
color: first,
|
|
1415
1406
|
backgroundColor: `color-mix(in srgb, ${first} 20%, transparent)`,
|
|
1416
1407
|
fontSize: "15px",
|
|
1417
|
-
transition: "all .1s linear"
|
|
1408
|
+
transition: "all .1s linear",
|
|
1409
|
+
whiteSpace: "nowrap"
|
|
1418
1410
|
}
|
|
1419
1411
|
};
|
|
1420
1412
|
return styles12;
|
|
@@ -1522,7 +1514,7 @@ var styles9 = {
|
|
|
1522
1514
|
var styles_default9 = styles9;
|
|
1523
1515
|
|
|
1524
1516
|
// src/components/Avatar/Avatar.tsx
|
|
1525
|
-
import { useEffect as
|
|
1517
|
+
import { useEffect as useEffect8, useRef as useRef7, useState as useState8 } from "react";
|
|
1526
1518
|
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1527
1519
|
var Avatar = ({ src, setValue, options }) => {
|
|
1528
1520
|
const [isOpen, setOpen] = useState8(false);
|
|
@@ -1532,7 +1524,7 @@ var Avatar = ({ src, setValue, options }) => {
|
|
|
1532
1524
|
const uploadImageRef = useRef7(null);
|
|
1533
1525
|
const isAbleToEdit = initialImage.current ? src !== defaultImage.current && src !== initialImage.current : false;
|
|
1534
1526
|
const isAbleToRemove = initialImage.current ? src !== defaultImage.current : false;
|
|
1535
|
-
|
|
1527
|
+
useEffect8(() => {
|
|
1536
1528
|
(function setSrc() {
|
|
1537
1529
|
return __async(this, null, function* () {
|
|
1538
1530
|
var _a, _b;
|
|
@@ -1613,7 +1605,7 @@ var Avatar = ({ src, setValue, options }) => {
|
|
|
1613
1605
|
var Avatar_default = Avatar;
|
|
1614
1606
|
|
|
1615
1607
|
// src/components/Input/InputGoogle/InputGoogle.tsx
|
|
1616
|
-
import { useEffect as
|
|
1608
|
+
import { useEffect as useEffect9, useRef as useRef8, useState as useState9 } from "react";
|
|
1617
1609
|
|
|
1618
1610
|
// src/components/Input/InputGoogle/InputGoogle.styles.ts
|
|
1619
1611
|
var others2 = {
|
|
@@ -1625,7 +1617,7 @@ var others2 = {
|
|
|
1625
1617
|
borderFocus: "#0957d0",
|
|
1626
1618
|
textRelease: "#000",
|
|
1627
1619
|
textFocus: "#0957d0",
|
|
1628
|
-
border: "solid
|
|
1620
|
+
border: "solid 1px"
|
|
1629
1621
|
};
|
|
1630
1622
|
var styles10 = {
|
|
1631
1623
|
input: {
|
|
@@ -1693,7 +1685,7 @@ var InputGoogle = (_a) => {
|
|
|
1693
1685
|
}
|
|
1694
1686
|
const inputBorder = isFocus ? `${others2.border} ${options ? options.focusColor : others2.borderFocus}` : `${others2.border} ${others2.borderRelease}`;
|
|
1695
1687
|
const labelTextColor = isFocus ? `${options ? options.focusColor : others2.textFocus}` : `${others2.textRelease}`;
|
|
1696
|
-
|
|
1688
|
+
useEffect9(() => {
|
|
1697
1689
|
transitionOnFocus();
|
|
1698
1690
|
transitionOffFocus();
|
|
1699
1691
|
}, []);
|
|
@@ -1730,7 +1722,7 @@ var InputGoogle = (_a) => {
|
|
|
1730
1722
|
var InputGoogle_default = InputGoogle;
|
|
1731
1723
|
|
|
1732
1724
|
// src/components/Input/TextArea/TextArea.tsx
|
|
1733
|
-
import { useEffect as
|
|
1725
|
+
import { useEffect as useEffect10, useRef as useRef9, useState as useState10 } from "react";
|
|
1734
1726
|
|
|
1735
1727
|
// src/components/Input/TextArea/TextArea.styles.ts
|
|
1736
1728
|
var labelHeight = 20;
|
|
@@ -1743,7 +1735,7 @@ var others3 = {
|
|
|
1743
1735
|
borderFocus: "#0957d0",
|
|
1744
1736
|
textRelease: "#000",
|
|
1745
1737
|
textFocus: "#0957d0",
|
|
1746
|
-
border: "solid
|
|
1738
|
+
border: "solid 1px"
|
|
1747
1739
|
};
|
|
1748
1740
|
var styles11 = {
|
|
1749
1741
|
input: {
|
|
@@ -1814,7 +1806,7 @@ var TextArea = (_a) => {
|
|
|
1814
1806
|
}
|
|
1815
1807
|
const inputBorder = isFocus ? `${others3.border} ${options ? options.focusColor : others3.borderFocus}` : `${others3.border} ${others3.borderRelease}`;
|
|
1816
1808
|
const labelTextColor = isFocus ? `${options ? options.focusColor : others3.textFocus}` : `${others3.textRelease}`;
|
|
1817
|
-
|
|
1809
|
+
useEffect10(() => {
|
|
1818
1810
|
transitionOnFocus();
|
|
1819
1811
|
transitionOffFocus();
|
|
1820
1812
|
}, []);
|
|
@@ -1934,7 +1926,7 @@ var Image = (_a) => {
|
|
|
1934
1926
|
var Image_default = Image;
|
|
1935
1927
|
|
|
1936
1928
|
// src/components/Image/ImageEditor/ImageEditor.tsx
|
|
1937
|
-
import { useEffect as
|
|
1929
|
+
import { useEffect as useEffect13, useMemo, useRef as useRef10, useState as useState14 } from "react";
|
|
1938
1930
|
|
|
1939
1931
|
// src/components/Image/ImageEditor/ImageEditor.styles.ts
|
|
1940
1932
|
var imageEditorStyles = {
|
|
@@ -2353,7 +2345,7 @@ var WTouchEvent = class {
|
|
|
2353
2345
|
};
|
|
2354
2346
|
|
|
2355
2347
|
// src/components/Image/ImageEditor/MainElements/MainElements.tsx
|
|
2356
|
-
import { useEffect as
|
|
2348
|
+
import { useEffect as useEffect12, useState as useState13 } from "react";
|
|
2357
2349
|
|
|
2358
2350
|
// src/components/Image/ImageEditor/context.ts
|
|
2359
2351
|
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
@@ -2490,7 +2482,7 @@ var MainElementStyles = {
|
|
|
2490
2482
|
var MainElements_styles_default = MainElementStyles;
|
|
2491
2483
|
|
|
2492
2484
|
// src/components/Image/ImageEditor/MainElements/Rotate.tsx
|
|
2493
|
-
import { useEffect as
|
|
2485
|
+
import { useEffect as useEffect11, useState as useState12 } from "react";
|
|
2494
2486
|
import { FaArrowRotateLeft } from "react-icons/fa6";
|
|
2495
2487
|
import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2496
2488
|
var Rotate = () => {
|
|
@@ -2502,7 +2494,7 @@ var Rotate = () => {
|
|
|
2502
2494
|
const handleBackground = (value) => {
|
|
2503
2495
|
return value ? MainElements_styles_default.buttonBackgroundDown : MainElements_styles_default.buttonBackground;
|
|
2504
2496
|
};
|
|
2505
|
-
|
|
2497
|
+
useEffect11(() => {
|
|
2506
2498
|
const controller = new AbortController();
|
|
2507
2499
|
const handler = () => {
|
|
2508
2500
|
setRotate(false);
|
|
@@ -2614,7 +2606,7 @@ var MainElements = () => {
|
|
|
2614
2606
|
const handleBackground = (value) => {
|
|
2615
2607
|
return value ? MainElements_styles_default.buttonBackgroundDown : MainElements_styles_default.buttonBackground;
|
|
2616
2608
|
};
|
|
2617
|
-
|
|
2609
|
+
useEffect12(() => {
|
|
2618
2610
|
const controller = new AbortController();
|
|
2619
2611
|
const handler = () => {
|
|
2620
2612
|
settopLeft(false);
|
|
@@ -2974,7 +2966,7 @@ var ImageEditor = ({
|
|
|
2974
2966
|
function handleWindowScroll(isOpen2) {
|
|
2975
2967
|
document.body.style.overflow = isOpen2 ? "hidden" : "auto";
|
|
2976
2968
|
}
|
|
2977
|
-
|
|
2969
|
+
useEffect13(() => {
|
|
2978
2970
|
isOpen ? createTransform() : setTransform(void 0);
|
|
2979
2971
|
handleWindowScroll(isOpen);
|
|
2980
2972
|
return () => {
|
|
@@ -3500,10 +3492,26 @@ function textProcessing(text) {
|
|
|
3500
3492
|
return newWords.join(" ");
|
|
3501
3493
|
}
|
|
3502
3494
|
|
|
3495
|
+
// src/utilities/tools/UUID.ts
|
|
3496
|
+
function getOrCreateUUID(key) {
|
|
3497
|
+
const STORAGE_KEY = key;
|
|
3498
|
+
let deviceId = localStorage.getItem(STORAGE_KEY);
|
|
3499
|
+
if (!deviceId) {
|
|
3500
|
+
if (window.crypto && window.crypto.randomUUID) {
|
|
3501
|
+
deviceId = window.crypto.randomUUID();
|
|
3502
|
+
} else {
|
|
3503
|
+
deviceId = "id-" + Math.random().toString(36).substring(2, 15) + Date.now().toString(36);
|
|
3504
|
+
}
|
|
3505
|
+
localStorage.setItem(STORAGE_KEY, deviceId);
|
|
3506
|
+
}
|
|
3507
|
+
return deviceId;
|
|
3508
|
+
}
|
|
3509
|
+
|
|
3503
3510
|
// src/utilities/tools/tools.ts
|
|
3504
3511
|
var tools = {
|
|
3505
3512
|
handleAsync: handleAsync_default,
|
|
3506
|
-
textProcessing
|
|
3513
|
+
textProcessing,
|
|
3514
|
+
getOrCreateUUID
|
|
3507
3515
|
};
|
|
3508
3516
|
var tools_default = tools;
|
|
3509
3517
|
|
|
@@ -3529,11 +3537,11 @@ var SessionProvider = ({
|
|
|
3529
3537
|
var SessionProvider_default = SessionProvider;
|
|
3530
3538
|
|
|
3531
3539
|
// src/auth/react/useAuthClient.ts
|
|
3532
|
-
import { useEffect as
|
|
3540
|
+
import { useEffect as useEffect14, useRef as useRef11, useState as useState15 } from "react";
|
|
3533
3541
|
var useAuthClient = (auth) => {
|
|
3534
3542
|
const [isLoading, setLoading] = useState15(false);
|
|
3535
3543
|
const sessionRef = useRef11(void 0);
|
|
3536
|
-
|
|
3544
|
+
useEffect14(() => {
|
|
3537
3545
|
let is = true;
|
|
3538
3546
|
const getSession = () => __async(null, null, function* () {
|
|
3539
3547
|
setLoading(true);
|