@vef-framework/shared 1.0.99 → 1.0.100

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/es/message.js CHANGED
@@ -1,282 +1,3 @@
1
- /*! VefFramework version: 1.0.99, build time: 2025-03-07T13:41:55.370Z, made by Venus. */
2
- import Icon from '@ant-design/icons';
3
- import { Modal, message, notification } from 'antd';
4
- import { createElement } from 'react';
5
- import { IconCheck, IconTickCircle, IconInfoCircle, IconAlertTriangle, IconAlertCircle } from './icons.js';
6
- import './lib.js';
7
- import { isFunction } from 'radashi';
8
-
9
- const {
10
- confirm,
11
- info,
12
- success,
13
- warning,
14
- error
15
- } = Modal;
16
- const checkIcon = createElement(Icon, {
17
- component: IconCheck
18
- });
19
- const successIcon = createElement(Icon, {
20
- component: IconTickCircle
21
- });
22
- const infoIcon = createElement(Icon, {
23
- component: IconInfoCircle
24
- });
25
- const warningIcon = createElement(Icon, {
26
- component: IconAlertTriangle
27
- });
28
- const errorIcon = createElement(Icon, {
29
- component: IconAlertCircle
30
- });
31
- const notificationSuccessIcon = createElement(Icon, {
32
- className: "vef-notification-notice-icon vef-notification-notice-icon-success",
33
- component: IconTickCircle
34
- });
35
- const notificationInfoIcon = createElement(Icon, {
36
- className: "vef-notification-notice-icon vef-notification-notice-icon-info",
37
- component: IconInfoCircle
38
- });
39
- const notificationWarningIcon = createElement(Icon, {
40
- className: "vef-notification-notice-icon vef-notification-notice-icon-warning",
41
- component: IconAlertTriangle
42
- });
43
- const notificationErrorIcon = createElement(Icon, {
44
- className: "vef-notification-notice-icon vef-notification-notice-icon-error",
45
- component: IconAlertCircle
46
- });
47
- function showSuccessMessage(content) {
48
- message.open({
49
- type: "success",
50
- content,
51
- duration: 2,
52
- icon: successIcon
53
- });
54
- }
55
- function showInfoMessage(content) {
56
- message.open({
57
- type: "info",
58
- content,
59
- duration: 3,
60
- icon: infoIcon
61
- });
62
- }
63
- function showWarningMessage(content) {
64
- message.open({
65
- type: "warning",
66
- content,
67
- duration: 3,
68
- icon: warningIcon
69
- });
70
- }
71
- function showErrorMessage(content) {
72
- message.open({
73
- type: "error",
74
- content,
75
- duration: 4,
76
- icon: errorIcon
77
- });
78
- }
79
- function showLoadingMessage(content) {
80
- const close = message.open({
81
- type: "loading",
82
- content,
83
- duration: 0
84
- });
85
- return () => close();
86
- }
87
- const defaultMessageTitle = "\u63D0\u793A";
88
- function showSuccessNotification(titleOrContent, content, buttons) {
89
- const argsLength = arguments.length;
90
- if (argsLength < 1) {
91
- throw new Error("showSuccessNotification requires at least one argument");
92
- }
93
- const titleToUse = argsLength > 1 ? titleOrContent : defaultMessageTitle;
94
- const contentToUse = argsLength > 1 ? content : titleOrContent;
95
- const buttonsToUse = argsLength === 3 ? buttons : void 0;
96
- notification.open({
97
- type: "success",
98
- message: titleToUse,
99
- description: contentToUse,
100
- duration: 4,
101
- closable: true,
102
- btn: buttonsToUse,
103
- icon: notificationSuccessIcon
104
- });
105
- }
106
- function showInfoNotification(titleOrContent, content, buttons) {
107
- const argsLength = arguments.length;
108
- if (argsLength < 1) {
109
- throw new Error("showInfoNotification requires at least one argument");
110
- }
111
- const titleToUse = argsLength > 1 ? titleOrContent : defaultMessageTitle;
112
- const contentToUse = argsLength > 1 ? content : titleOrContent;
113
- const buttonsToUse = argsLength === 3 ? buttons : void 0;
114
- notification.open({
115
- type: "info",
116
- message: titleToUse,
117
- description: contentToUse,
118
- duration: 5,
119
- closable: true,
120
- btn: buttonsToUse,
121
- icon: notificationInfoIcon
122
- });
123
- }
124
- function showWarningNotification(titleOrContent, content, buttons) {
125
- const argsLength = arguments.length;
126
- if (argsLength < 1) {
127
- throw new Error("showWarningNotification requires at least one argument");
128
- }
129
- const titleToUse = argsLength > 1 ? titleOrContent : defaultMessageTitle;
130
- const contentToUse = argsLength > 1 ? content : titleOrContent;
131
- const buttonsToUse = argsLength === 3 ? buttons : void 0;
132
- notification.open({
133
- type: "warning",
134
- message: titleToUse,
135
- description: contentToUse,
136
- duration: 6,
137
- closable: true,
138
- btn: buttonsToUse,
139
- icon: notificationWarningIcon
140
- });
141
- }
142
- function showErrorNotification(titleOrContent, content, buttons) {
143
- const argsLength = arguments.length;
144
- if (argsLength < 1) {
145
- throw new Error("showErrorNotification requires at least one argument");
146
- }
147
- const titleToUse = argsLength > 1 ? titleOrContent : defaultMessageTitle;
148
- const contentToUse = argsLength > 1 ? content : titleOrContent;
149
- const buttonsToUse = argsLength === 3 ? buttons : void 0;
150
- notification.open({
151
- type: "error",
152
- message: titleToUse,
153
- description: contentToUse,
154
- duration: 10,
155
- closable: true,
156
- btn: buttonsToUse,
157
- icon: notificationErrorIcon
158
- });
159
- }
160
- const cancelButtonProps = {
161
- color: "default",
162
- variant: "text"
163
- };
164
- const okButtonProps = {
165
- icon: checkIcon
166
- };
167
- function showConfirmation(title, content, onOk, options) {
168
- const argsLength = arguments.length;
169
- if (argsLength < 2) {
170
- throw new Error("showConfirmation requires at least two arguments");
171
- }
172
- const titleToUse = argsLength > 2 ? title : "\u63D0\u793A";
173
- const contentToUse = argsLength === 2 ? title : content;
174
- const onOkToUse = argsLength === 2 ? content : onOk;
175
- const {
176
- okText,
177
- cancelText,
178
- onCancel,
179
- onAfterOpen,
180
- onAfterClose
181
- } = options ?? {};
182
- const { destroy } = confirm({
183
- title: titleToUse,
184
- content: contentToUse,
185
- cancelButtonProps,
186
- okButtonProps,
187
- centered: true,
188
- onOk: onOkToUse,
189
- okText,
190
- cancelText,
191
- onCancel,
192
- afterOpenChange: isFunction(onAfterOpen) || isFunction(onAfterClose) ? (open) => {
193
- if (open) {
194
- onAfterOpen?.();
195
- } else {
196
- onAfterClose?.();
197
- }
198
- } : void 0
199
- });
200
- return destroy;
201
- }
202
- const alertFnMap = {
203
- success,
204
- info,
205
- warning,
206
- error
207
- };
208
- const alertIconMap = {
209
- success: successIcon,
210
- info: infoIcon,
211
- warning: warningIcon,
212
- error: errorIcon
213
- };
214
- const defaultOkText = "\u{1F44D}\u{1F3FB} \u597D\u7684\uFF0C\u77E5\u9053\u4E86";
215
- function showAlert(type, content, title = defaultMessageTitle, onOk, options) {
216
- const {
217
- okText = defaultOkText,
218
- onCancel,
219
- onAfterOpen,
220
- onAfterClose
221
- } = options ?? {};
222
- const { destroy } = alertFnMap[type]({
223
- title,
224
- content,
225
- icon: alertIconMap[type],
226
- centered: true,
227
- onOk,
228
- okText,
229
- onCancel,
230
- afterOpenChange: isFunction(onAfterOpen) || isFunction(onAfterClose) ? (open) => {
231
- if (open) {
232
- onAfterOpen?.();
233
- } else {
234
- onAfterClose?.();
235
- }
236
- } : void 0
237
- });
238
- return destroy;
239
- }
240
- function showSuccessAlert(title, content, onOk, options) {
241
- const argsLength = arguments.length;
242
- if (argsLength < 1) {
243
- throw new Error("showSuccessAlert requires at least one argument");
244
- }
245
- const titleToUse = argsLength === 1 || isFunction(content) ? void 0 : title;
246
- const contentToUse = argsLength === 1 || isFunction(content) ? title : content;
247
- const onOkToUse = argsLength === 2 || isFunction(content) ? content : onOk;
248
- return showAlert("success", contentToUse, titleToUse, onOkToUse, options);
249
- }
250
- function showInfoAlert(title, content, onOk, options) {
251
- const argsLength = arguments.length;
252
- if (argsLength < 1) {
253
- throw new Error("showInfoAlert requires at least one argument");
254
- }
255
- const titleToUse = argsLength === 1 || isFunction(content) ? void 0 : title;
256
- const contentToUse = argsLength === 1 || isFunction(content) ? title : content;
257
- const onOkToUse = argsLength === 2 || isFunction(content) ? content : onOk;
258
- return showAlert("info", contentToUse, titleToUse, onOkToUse, options);
259
- }
260
- function showWarningAlert(title, content, onOk, options) {
261
- const argsLength = arguments.length;
262
- if (argsLength < 1) {
263
- throw new Error("showWarningAlert requires at least one argument");
264
- }
265
- const titleToUse = argsLength === 1 || isFunction(content) ? void 0 : title;
266
- const contentToUse = argsLength === 1 || isFunction(content) ? title : content;
267
- const onOkToUse = argsLength === 2 || isFunction(content) ? content : onOk;
268
- return showAlert("warning", contentToUse, titleToUse, onOkToUse, options);
269
- }
270
- function showErrorAlert(title, content, onOk, options) {
271
- const argsLength = arguments.length;
272
- if (argsLength < 1) {
273
- throw new Error("showErrorAlert requires at least one argument");
274
- }
275
- const titleToUse = argsLength === 1 || isFunction(content) ? void 0 : title;
276
- const contentToUse = argsLength === 1 || isFunction(content) ? title : content;
277
- const onOkToUse = argsLength === 2 || isFunction(content) ? content : onOk;
278
- return showAlert("error", contentToUse, titleToUse, onOkToUse, options);
279
- }
280
-
281
- export { checkIcon, defaultMessageTitle, errorIcon, infoIcon, showConfirmation, showErrorAlert, showErrorMessage, showErrorNotification, showInfoAlert, showInfoMessage, showInfoNotification, showLoadingMessage, showSuccessAlert, showSuccessMessage, showSuccessNotification, showWarningAlert, showWarningMessage, showWarningNotification, successIcon, warningIcon };
1
+ /*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:51.660Z, made by Venus. */
2
+ import o from"@ant-design/icons";import{Modal as n,message as t,notification as e}from"antd";import{createElement as r}from"react";import{IconCheck as i,IconTickCircle as s,IconInfoCircle as c,IconAlertTriangle as a,IconAlertCircle as f}from"./icons.js";import"./lib.js";import{isFunction as w}from"radashi";const{confirm:u,info:h,success:l,warning:g,error:p}=n,m=r(o,{component:i}),d=r(o,{component:s}),A=r(o,{component:c}),v=r(o,{component:a}),E=r(o,{component:f}),N=r(o,{className:"vef-notification-notice-icon vef-notification-notice-icon-success",component:s}),y=r(o,{className:"vef-notification-notice-icon vef-notification-notice-icon-info",component:c}),C=r(o,{className:"vef-notification-notice-icon vef-notification-notice-icon-warning",component:a}),M=r(o,{className:"vef-notification-notice-icon vef-notification-notice-icon-error",component:f});function showSuccessMessage(o){t.open({type:"success",content:o,duration:2,icon:d})}function showInfoMessage(o){t.open({type:"info",content:o,duration:3,icon:A})}function showWarningMessage(o){t.open({type:"warning",content:o,duration:3,icon:v})}function showErrorMessage(o){t.open({type:"error",content:o,duration:4,icon:E})}function showLoadingMessage(o){const n=t.open({type:"loading",content:o,duration:0});return()=>n()}const b="提示";function showSuccessNotification(o,n,t){const r=arguments.length;if(r<1)throw new Error("showSuccessNotification requires at least one argument");const i=r>1?o:b,s=r>1?n:o,c=3===r?t:void 0;e.open({type:"success",message:i,description:s,duration:4,closable:!0,btn:c,icon:N})}function showInfoNotification(o,n,t){const r=arguments.length;if(r<1)throw new Error("showInfoNotification requires at least one argument");const i=r>1?o:b,s=r>1?n:o,c=3===r?t:void 0;e.open({type:"info",message:i,description:s,duration:5,closable:!0,btn:c,icon:y})}function showWarningNotification(o,n,t){const r=arguments.length;if(r<1)throw new Error("showWarningNotification requires at least one argument");const i=r>1?o:b,s=r>1?n:o,c=3===r?t:void 0;e.open({type:"warning",message:i,description:s,duration:6,closable:!0,btn:c,icon:C})}function showErrorNotification(o,n,t){const r=arguments.length;if(r<1)throw new Error("showErrorNotification requires at least one argument");const i=r>1?o:b,s=r>1?n:o,c=3===r?t:void 0;e.open({type:"error",message:i,description:s,duration:10,closable:!0,btn:c,icon:M})}const q={color:"default",variant:"text"},x={icon:m};function showConfirmation(o,n,t,e){const r=arguments.length;if(r<2)throw new Error("showConfirmation requires at least two arguments");const i=r>2?o:"提示",s=2===r?o:n,c=2===r?n:t,{okText:a,cancelText:f,onCancel:h,onAfterOpen:l,onAfterClose:g}=e??{},{destroy:p}=u({title:i,content:s,cancelButtonProps:q,okButtonProps:x,centered:!0,onOk:c,okText:a,cancelText:f,onCancel:h,afterOpenChange:w(l)||w(g)?o=>{o?l?.():g?.()}:void 0});return p}const I={success:l,info:h,warning:g,error:p},S={success:d,info:A,warning:v,error:E},W="👍🏻 好的,知道了";function showAlert(o,n,t=b,e,r){const{okText:i=W,onCancel:s,onAfterOpen:c,onAfterClose:a}=r??{},{destroy:f}=I[o]({title:t,content:n,icon:S[o],centered:!0,onOk:e,okText:i,onCancel:s,afterOpenChange:w(c)||w(a)?o=>{o?c?.():a?.()}:void 0});return f}function showSuccessAlert(o,n,t,e){const r=arguments.length;if(r<1)throw new Error("showSuccessAlert requires at least one argument");const i=1===r||w(n)?void 0:o;return showAlert("success",1===r||w(n)?o:n,i,2===r||w(n)?n:t,e)}function showInfoAlert(o,n,t,e){const r=arguments.length;if(r<1)throw new Error("showInfoAlert requires at least one argument");const i=1===r||w(n)?void 0:o;return showAlert("info",1===r||w(n)?o:n,i,2===r||w(n)?n:t,e)}function showWarningAlert(o,n,t,e){const r=arguments.length;if(r<1)throw new Error("showWarningAlert requires at least one argument");const i=1===r||w(n)?void 0:o;return showAlert("warning",1===r||w(n)?o:n,i,2===r||w(n)?n:t,e)}function showErrorAlert(o,n,t,e){const r=arguments.length;if(r<1)throw new Error("showErrorAlert requires at least one argument");const i=1===r||w(n)?void 0:o;return showAlert("error",1===r||w(n)?o:n,i,2===r||w(n)?n:t,e)}export{m as checkIcon,b as defaultMessageTitle,E as errorIcon,A as infoIcon,showConfirmation,showErrorAlert,showErrorMessage,showErrorNotification,showInfoAlert,showInfoMessage,showInfoNotification,showLoadingMessage,showSuccessAlert,showSuccessMessage,showSuccessNotification,showWarningAlert,showWarningMessage,showWarningNotification,d as successIcon,v as warningIcon};
282
3
  /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
package/es/path.js CHANGED
@@ -1,33 +1,3 @@
1
- /*! VefFramework version: 1.0.99, build time: 2025-03-07T13:41:55.370Z, made by Venus. */
2
- import path from 'path-browserify';
3
-
4
- const {
5
- basename,
6
- dirname,
7
- extname,
8
- isAbsolute,
9
- join,
10
- normalize
11
- } = path;
12
- function extractBaseName(path2, keepExt = true) {
13
- const ext = keepExt ? void 0 : extname(path2);
14
- return basename(path2, ext);
15
- }
16
- function extractExtName(path2) {
17
- return extname(path2);
18
- }
19
- function extractDirName(path2) {
20
- return dirname(path2);
21
- }
22
- function joinPaths(...paths) {
23
- return join(...paths);
24
- }
25
- function isAbsolutePath(path2) {
26
- return isAbsolute(path2);
27
- }
28
- function normalizePath(path2) {
29
- return normalize(path2);
30
- }
31
-
32
- export { extractBaseName, extractDirName, extractExtName, isAbsolutePath, joinPaths, normalizePath };
1
+ /*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:51.660Z, made by Venus. */
2
+ import t from"path-browserify";const{basename:e,dirname:n,extname:r,isAbsolute:a,join:o,normalize:i}=t;function extractBaseName(t,n=!0){const a=n?void 0:r(t);return e(t,a)}function extractExtName(t){return r(t)}function extractDirName(t){return n(t)}function joinPaths(...t){return o(...t)}function isAbsolutePath(t){return a(t)}function normalizePath(t){return i(t)}export{extractBaseName,extractDirName,extractExtName,isAbsolutePath,joinPaths,normalizePath};
33
3
  /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
package/es/pinyin.js CHANGED
@@ -1,30 +1,3 @@
1
- /*! VefFramework version: 1.0.99, build time: 2025-03-07T13:41:55.370Z, made by Venus. */
2
- import { pinyin } from 'pinyin-pro';
3
-
4
- function parsePinyin(text) {
5
- return pinyin(
6
- text,
7
- {
8
- pattern: "pinyin",
9
- toneType: "none",
10
- type: "array",
11
- mode: "normal",
12
- nonZh: "consecutive"
13
- }
14
- );
15
- }
16
- function parsePinyinFirstLetter(text) {
17
- return pinyin(
18
- text,
19
- {
20
- pattern: "first",
21
- toneType: "none",
22
- type: "array",
23
- mode: "normal",
24
- nonZh: "consecutive"
25
- }
26
- );
27
- }
28
-
29
- export { parsePinyin, parsePinyinFirstLetter };
1
+ /*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:51.660Z, made by Venus. */
2
+ import{pinyin as n}from"pinyin-pro";function parsePinyin(e){return n(e,{pattern:"pinyin",toneType:"none",type:"array",mode:"normal",nonZh:"consecutive"})}function parsePinyinFirstLetter(e){return n(e,{pattern:"first",toneType:"none",type:"array",mode:"normal",nonZh:"consecutive"})}export{parsePinyin,parsePinyinFirstLetter};
30
3
  /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
package/es/security.js CHANGED
@@ -1,24 +1,3 @@
1
- /*! VefFramework version: 1.0.99, build time: 2025-03-07T13:41:55.370Z, made by Venus. */
2
- import JSEncrypt from 'jsencrypt';
3
-
4
- function encryptRsa(value, publicKey) {
5
- const rsa = new JSEncrypt();
6
- rsa.setPublicKey(publicKey);
7
- const encrypted = rsa.encrypt(value);
8
- if (!encrypted) {
9
- throw new Error(`Failed to encrypt value [${value}] using RSA`);
10
- }
11
- return encrypted;
12
- }
13
- function decryptRsa(value, privateKey) {
14
- const rsa = new JSEncrypt();
15
- rsa.setPrivateKey(privateKey);
16
- const decrypted = rsa.decrypt(value);
17
- if (!decrypted) {
18
- throw new Error(`Failed to decrypt value [${value}] using RSA`);
19
- }
20
- return decrypted;
21
- }
22
-
23
- export { decryptRsa, encryptRsa };
1
+ /*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:51.660Z, made by Venus. */
2
+ import t from"jsencrypt";function encryptRsa(e,r){const n=new t;n.setPublicKey(r);const c=n.encrypt(e);if(!c)throw new Error(`Failed to encrypt value [${e}] using RSA`);return c}function decryptRsa(e,r){const n=new t;n.setPrivateKey(r);const c=n.decrypt(e);if(!c)throw new Error(`Failed to decrypt value [${e}] using RSA`);return c}export{decryptRsa,encryptRsa};
24
3
  /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
package/es/store.js CHANGED
@@ -1,100 +1,3 @@
1
- /*! VefFramework version: 1.0.99, build time: 2025-03-07T13:41:55.370Z, made by Venus. */
2
- import { createContext, useState, useRef, useEffect, createElement, useContext } from 'react';
3
- import { createJSONStorage, persist, subscribeWithSelector } from 'zustand/middleware';
4
- import { createWithEqualityFn, useStoreWithEqualityFn } from 'zustand/traditional';
5
- import { createStore as createStore$1 } from 'zustand/vanilla';
6
- import './lib.js';
7
- import { constantCase } from './utils.js';
8
- import { isNullish } from 'radashi';
9
- import { shallow } from 'zustand/shallow';
10
-
11
- function createStorageProxy(storage) {
12
- const delegate = createJSONStorage(() => storage === "local" ? localStorage : sessionStorage);
13
- return {
14
- getItem: delegate.getItem,
15
- setItem(name, value) {
16
- if (isNullish(value.state)) {
17
- return;
18
- }
19
- delegate.setItem(name, value);
20
- },
21
- removeItem: delegate.removeItem
22
- };
23
- }
24
- function createStore(stateCreator, persistenceOptions) {
25
- const name = persistenceOptions?.name ?? "UNKNOWN";
26
- const storage = persistenceOptions?.storage ?? "local";
27
- const selector = persistenceOptions ? persistenceOptions.selector : () => null;
28
- const storageInstance = createStorageProxy(storage);
29
- return createWithEqualityFn(
30
- persist(
31
- subscribeWithSelector(stateCreator),
32
- {
33
- name: `__VEF_STORE__${constantCase(name)}__`,
34
- storage: storageInstance,
35
- version: 1,
36
- partialize: selector
37
- }
38
- ),
39
- shallow
40
- );
41
- }
42
- function createUnboundStore(stateCreator) {
43
- return createStore$1(
44
- subscribeWithSelector(stateCreator)
45
- );
46
- }
47
- function useUnboundStore(store, selector, equalityFn) {
48
- return useStoreWithEqualityFn(
49
- store,
50
- selector,
51
- equalityFn ?? shallow
52
- );
53
- }
54
- function createComponentStore(name, getStateCreator) {
55
- const StoreContext = createContext(null);
56
- const StoreProvider = ({ initialState, children }) => {
57
- const [store] = useState(() => {
58
- const creator = getStateCreator(initialState);
59
- return createUnboundStore(creator);
60
- });
61
- const isMounted = useRef(false);
62
- useEffect(() => () => {
63
- isMounted.current = false;
64
- }, []);
65
- useEffect(() => {
66
- if (!isMounted.current) {
67
- isMounted.current = true;
68
- }
69
- if (initialState) {
70
- store.setState({
71
- ...initialState
72
- });
73
- }
74
- }, [initialState, store]);
75
- return createElement(
76
- StoreContext.Provider,
77
- { value: store },
78
- children
79
- );
80
- };
81
- const useStoreApi = () => {
82
- const store = useContext(StoreContext);
83
- if (!store) {
84
- throw new Error(`${name}Store can be used only inside ${name}StoreProvider`);
85
- }
86
- return store;
87
- };
88
- const useStore = (selector) => useUnboundStore(
89
- useStoreApi(),
90
- selector
91
- );
92
- return {
93
- StoreProvider,
94
- useStore,
95
- useStoreApi
96
- };
97
- }
98
-
99
- export { createComponentStore, createStore, createUnboundStore, useUnboundStore };
1
+ /*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:51.660Z, made by Venus. */
2
+ import{createContext as e,useState as t,useRef as r,useEffect as o,createElement as n,useContext as a}from"react";import{createJSONStorage as i,persist as u,subscribeWithSelector as s}from"zustand/middleware";import{createWithEqualityFn as c,useStoreWithEqualityFn as m}from"zustand/traditional";import{createStore as l}from"zustand/vanilla";import"./lib.js";import{constantCase as S}from"./utils.js";import{isNullish as d}from"radashi";import{shallow as f}from"zustand/shallow";function createStore(e,t){const r=t?.name??"UNKNOWN",o=t?.storage??"local",n=t?t.selector:()=>null,a=function createStorageProxy(e){const t=i((()=>"local"===e?localStorage:sessionStorage));return{getItem:t.getItem,setItem(e,r){d(r.state)||t.setItem(e,r)},removeItem:t.removeItem}}(o);return c(u(s(e),{name:`__VEF_STORE__${S(r)}__`,storage:a,version:1,partialize:n}),f)}function createUnboundStore(e){return l(s(e))}function useUnboundStore(e,t,r){return m(e,t,r??f)}function createComponentStore(i,u){const s=e(null),useStoreApi=()=>{const e=a(s);if(!e)throw new Error(`${i}Store can be used only inside ${i}StoreProvider`);return e};return{StoreProvider:({initialState:e,children:a})=>{const[i]=t((()=>createUnboundStore(u(e)))),c=r(!1);return o((()=>()=>{c.current=!1}),[]),o((()=>{c.current||(c.current=!0),e&&i.setState({...e})}),[e,i]),n(s.Provider,{value:i},a)},useStore:e=>useUnboundStore(useStoreApi(),e),useStoreApi:useStoreApi}}export{createComponentStore,createStore,createUnboundStore,useUnboundStore};
100
3
  /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
package/es/styles.js CHANGED
@@ -1,51 +1,3 @@
1
- /*! VefFramework version: 1.0.99, build time: 2025-03-07T13:41:55.370Z, made by Venus. */
2
- import { css } from '@emotion/react';
3
-
4
- const breakpointWidths = {
5
- xs: 0,
6
- sm: 576,
7
- md: 768,
8
- lg: 992,
9
- xl: 1200,
10
- xxl: 1400
11
- };
12
- const breakpoints = [
13
- "xs",
14
- "sm",
15
- "md",
16
- "lg",
17
- "xl",
18
- "xxl"
19
- ];
20
- const bmq = Object.keys(breakpointWidths).reduce(
21
- (acc, label) => {
22
- acc[label] = `@media (min-width: ${breakpointWidths[label]}px)`;
23
- return acc;
24
- },
25
- {}
26
- );
27
- const styles = {
28
- // Flex center style
29
- flexCenter: css({
30
- display: "flex",
31
- justifyContent: "center",
32
- alignItems: "center"
33
- }),
34
- // Full height style
35
- fullHeight: css({
36
- height: "100%"
37
- }),
38
- // Full width style
39
- fullWidth: css({
40
- width: "100%"
41
- }),
42
- // Scrollbar style
43
- scrollbar: css({
44
- scrollbarWidth: "thin",
45
- scrollbarColor: "rgba(0, 0, 0, 0.3) transparent",
46
- scrollbarGutter: "stable"
47
- })
48
- };
49
-
50
- export { bmq, breakpoints, styles };
1
+ /*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:51.660Z, made by Venus. */
2
+ import{css as t}from"@emotion/react";const l={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},e=["xs","sm","md","lg","xl","xxl"],r=Object.keys(l).reduce(((t,e)=>(t[e]=`@media (min-width: ${l[e]}px)`,t)),{}),s={flexCenter:t({display:"flex",justifyContent:"center",alignItems:"center"}),fullHeight:t({height:"100%"}),fullWidth:t({width:"100%"}),scrollbar:t({scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.3) transparent",scrollbarGutter:"stable"})};export{r as bmq,e as breakpoints,s as styles};
51
3
  /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
package/es/temporal.js CHANGED
@@ -1,23 +1,3 @@
1
- /*! VefFramework version: 1.0.99, build time: 2025-03-07T13:41:55.370Z, made by Venus. */
2
- import { tz } from '@date-fns/tz';
3
- import { format } from 'date-fns';
4
- import { zhCN } from 'date-fns/locale';
5
-
6
- function getNowDate() {
7
- return /* @__PURE__ */ new Date();
8
- }
9
- function getNowDateString() {
10
- return format(getNowDate(), "yyyy-MM-dd", {
11
- locale: zhCN,
12
- in: tz("Asia/Shanghai")
13
- });
14
- }
15
- function getTodayString() {
16
- return format(getNowDate(), "PPPPpp", {
17
- locale: zhCN,
18
- in: tz("Asia/Shanghai")
19
- });
20
- }
21
-
22
- export { getNowDate, getNowDateString, getTodayString };
1
+ /*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:51.660Z, made by Venus. */
2
+ import{tz as t}from"@date-fns/tz";import{format as e}from"date-fns";import{zhCN as a}from"date-fns/locale";function getNowDate(){return new Date}function getNowDateString(){return e(getNowDate(),"yyyy-MM-dd",{locale:a,in:t("Asia/Shanghai")})}function getTodayString(){return e(getNowDate(),"PPPPpp",{locale:a,in:t("Asia/Shanghai")})}export{getNowDate,getNowDateString,getTodayString};
23
3
  /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */