@vef-framework/core 1.0.63 → 1.0.64

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.
@@ -1,3 +1,304 @@
1
- /*! VefFramework version: 1.0.63, build time: 2025-01-09T12:00:00.540Z, made by Venus. */
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./helpers.cjs");exports.compile=function t(e){let r;const i=new Set,s=function(n,t){return"function"==typeof n?n(t):n},o=[{"&&":(n,t,e)=>s(n,e)&&s(t,e),"||":(n,t,e)=>s(n,e)||s(t,e)},{"===":(n,t,e)=>!(s(n,e)!==s(t,e)),"!==":(n,t,e)=>!(s(n,e)===s(t,e)),"==":(n,t,e)=>!(s(n,e)!=s(t,e)),"!=":(n,t,e)=>!(s(n,e)==s(t,e)),">=":(n,t,e)=>!!(s(n,e)>=s(t,e)),"<=":(n,t,e)=>!!(s(n,e)<=s(t,e)),">":(n,t,e)=>!!(s(n,e)>s(t,e)),"<":(n,t,e)=>!!(s(n,e)<s(t,e))},{"+":(n,t,e)=>s(n,e)+s(t,e),"-":(n,t,e)=>s(n,e)-s(t,e)},{"*":(n,t,e)=>s(n,e)*s(t,e),"/":(n,t,e)=>s(n,e)/s(t,e),"%":(n,t,e)=>s(n,e)%s(t,e)}],l=o.reduce(((n,t)=>n.concat(Object.keys(t))),[]),u=new Set(l.map((n=>n.charAt(0))));function f(n,t,e,r){const i=n.filter((n=>n.startsWith(t)));return!!i.length&&i.find((n=>{if(r.length>=e+n.length){if(r.substring(e,e+n.length)===n)return n}return!1}))}function c(n,t,e=1){let r=e?t.substring(n+1).trim():t.substring(0,n).trim();if(!r.length)return-1;if(!e){const n=r.split("").reverse(),t=n.findIndex((n=>u.has(n)));r=n.slice(t).join("")}const[i]=r;return o.findIndex((n=>!!f(Object.keys(n),i,0,r)))}function g(n,t){let e="";const{length:r}=t;let i=0;for(let s=n;s<r;s++){const n=t.charAt(s);if("("===n)i++;else if(")"===n)i--;else if(0===i&&" "===n)continue;if(0===i&&f(l,n,s,t))return[e,s-1];e+=n}return[e,t.length-1]}function d(n,t=0){const e=o[t],{length:r}=n,i=Object.keys(e);let s,l,u=0,d=!1,h=null,b="",p=null,y="",m="",j="",$=0;const v=(n,t)=>{n?m+=t:b+=t};for(let o=0;o<r;o++)if(l=y,y=n.charAt(o),"'"!==y&&'"'!==y||"\\"===l||!(0===u&&!d||u&&!j))if(d&&(y!==d||"\\"===l)||j&&(y!==j||"\\"===l))v(u,y);else if(d!==y)if(j!==y){if(" "!==y)if("("===y)0===u?$=o:m+=y,u++;else if(")"===y)if(u--,0===u){const e="string"==typeof b&&b.startsWith("$")?b:void 0,r=e&&"."===n.charAt(o+1);let i="";r&&([i,o]=g(o+2,n));const s=h?t:c($,n,0),l=c(o,n);-1===s&&-1===l?(b=a(m,-1,e,i),"string"==typeof b&&(b=m)):h&&(s>=l||-1===l)&&t===s?(p=h.bind(null,a(m,-1,e,i)),h=null,b=""):l>s&&t===l?b=a(m,-1,e,i):b+=`(${m})${r?`.${i}`:""}`,m=""}else m+=y;else{if(0===u&&(s=f(i,y,o,n))){0===o&&console.error(103,[s,n]),o+=s.length-1,o===n.length-1&&console.error(104,[s,n]),h?b&&(p=h.bind(null,a(b,t)),h=e[s].bind(null,p),b=""):p?(h=e[s].bind(null,a(p,t)),p=null):(h=e[s].bind(null,a(b,t)),b="");continue}v(u,y)}}else j=!1,v(u,y);else d=!1,v(u,y);else u?j=y:d=y,v(u,y);return b&&h&&(h=h.bind(null,a(b,t))),h=!h&&p?p:h,!h&&b&&(h=(n,t)=>"function"==typeof n?n(t):n,h=h.bind(null,a(b,t))),h||b||console.error(105,n),h}function a(e,s,l,u){if(l){const i=a(l,o.length);let s,f=!!u&&t(`$${u}`);if("function"==typeof i){const t=n.parseArgs(String(e)).map((n=>a(n,-1)));return e=>{const o=i(e);return"function"!=typeof o?(console.warn(150,l),o):(s=o(...t.map((n=>"function"==typeof n?n(e):n))),f&&(f=f.provide((t=>{const e=r(t);return t.reduce(((t,r)=>{if(r===u||u?.startsWith(`${r}(`)){const e=n.getAt(s,r);t[r]=()=>e}else t[r]=e[r];return t}),{})}))),f?f():s)}}}else if("string"==typeof e){if("true"===e)return!0;if("false"===e)return!1;if("undefined"===e)return;if(n.isQuotedString(e))return n.rmEscapes(e.substring(1,e.length-1));if(!Number.isNaN(+e))return Number(e);if(s<o.length-1)return d(e,s+1);if(e.startsWith("$")){const n=e.substring(1);return i.add(n),function(t){return n in t?t[n]():void 0}}return e}return e}const h=d(e),b=Array.from(i);return Object.assign(h,{provide:function n(t){return r=t,Object.assign(h.bind(null,t(b)),{provide:n})}})};
1
+ /*! VefFramework version: 1.0.64, build time: 2025-01-10T01:26:01.352Z, made by Venus. */
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const helpers = require('./helpers.cjs');
7
+
8
+ function compile(expr) {
9
+ let provideTokens;
10
+ const requirements = /* @__PURE__ */ new Set();
11
+ const x = function expand(operand, tokens) {
12
+ return typeof operand === "function" ? operand(tokens) : operand;
13
+ };
14
+ const operatorRegistry = [
15
+ {
16
+ "&&": (l, r, t) => x(l, t) && x(r, t),
17
+ "||": (l, r, t) => x(l, t) || x(r, t)
18
+ },
19
+ {
20
+ "===": (l, r, t) => !!(x(l, t) === x(r, t)),
21
+ "!==": (l, r, t) => !!(x(l, t) !== x(r, t)),
22
+ // eslint-disable-next-line eqeqeq
23
+ "==": (l, r, t) => !!(x(l, t) == x(r, t)),
24
+ // eslint-disable-next-line eqeqeq
25
+ "!=": (l, r, t) => !!(x(l, t) != x(r, t)),
26
+ ">=": (l, r, t) => !!(x(l, t) >= x(r, t)),
27
+ "<=": (l, r, t) => !!(x(l, t) <= x(r, t)),
28
+ ">": (l, r, t) => !!(x(l, t) > x(r, t)),
29
+ "<": (l, r, t) => !!(x(l, t) < x(r, t))
30
+ },
31
+ {
32
+ "+": (l, r, t) => x(l, t) + x(r, t),
33
+ "-": (l, r, t) => x(l, t) - x(r, t)
34
+ },
35
+ {
36
+ "*": (l, r, t) => x(l, t) * x(r, t),
37
+ "/": (l, r, t) => x(l, t) / x(r, t),
38
+ "%": (l, r, t) => x(l, t) % x(r, t)
39
+ }
40
+ ];
41
+ const operatorSymbols = operatorRegistry.reduce((s, g) => s.concat(Object.keys(g)), []);
42
+ const operatorChars = new Set(operatorSymbols.map((key) => key.charAt(0)));
43
+ function getOp(symbols, char, p, expression) {
44
+ const candidates = symbols.filter((s) => s.startsWith(char));
45
+ if (!candidates.length) {
46
+ return false;
47
+ }
48
+ return candidates.find((symbol) => {
49
+ if (expression.length >= p + symbol.length) {
50
+ const nextChars = expression.substring(p, p + symbol.length);
51
+ if (nextChars === symbol) {
52
+ return symbol;
53
+ }
54
+ }
55
+ return false;
56
+ });
57
+ }
58
+ function getStep(p, expression, direction = 1) {
59
+ let next = direction ? expression.substring(p + 1).trim() : expression.substring(0, p).trim();
60
+ if (!next.length) {
61
+ return -1;
62
+ }
63
+ if (!direction) {
64
+ const reversed = next.split("").reverse();
65
+ const start = reversed.findIndex((char2) => operatorChars.has(char2));
66
+ next = reversed.slice(start).join("");
67
+ }
68
+ const [char] = next;
69
+ return operatorRegistry.findIndex((operators) => {
70
+ const symbols = Object.keys(operators);
71
+ return !!getOp(symbols, char, 0, next);
72
+ });
73
+ }
74
+ function getTail(pos, expression) {
75
+ let tail = "";
76
+ const { length } = expression;
77
+ let depth = 0;
78
+ for (let p = pos; p < length; p++) {
79
+ const char = expression.charAt(p);
80
+ if (char === "(") {
81
+ depth++;
82
+ } else if (char === ")") {
83
+ depth--;
84
+ } else if (depth === 0 && char === " ") {
85
+ continue;
86
+ }
87
+ if (depth === 0 && getOp(operatorSymbols, char, p, expression)) {
88
+ return [tail, p - 1];
89
+ } else {
90
+ tail += char;
91
+ }
92
+ }
93
+ return [tail, expression.length - 1];
94
+ }
95
+ function compileExpr(expression, step = 0) {
96
+ const operators = operatorRegistry[step];
97
+ const { length } = expression;
98
+ const symbols = Object.keys(operators);
99
+ let depth = 0;
100
+ let quote = false;
101
+ let op = null;
102
+ let operand = "";
103
+ let left = null;
104
+ let operation;
105
+ let lastChar;
106
+ let char = "";
107
+ let parenthetical = "";
108
+ let parenQuote = "";
109
+ let startP = 0;
110
+ const addTo = (depth2, char2) => {
111
+ if (depth2) {
112
+ parenthetical += char2;
113
+ } else {
114
+ operand += char2;
115
+ }
116
+ };
117
+ for (let p = 0; p < length; p++) {
118
+ lastChar = char;
119
+ char = expression.charAt(p);
120
+ if ((char === "'" || char === '"') && lastChar !== "\\" && (depth === 0 && !quote || depth && !parenQuote)) {
121
+ if (depth) {
122
+ parenQuote = char;
123
+ } else {
124
+ quote = char;
125
+ }
126
+ addTo(depth, char);
127
+ continue;
128
+ } else if (quote && (char !== quote || lastChar === "\\") || parenQuote && (char !== parenQuote || lastChar === "\\")) {
129
+ addTo(depth, char);
130
+ continue;
131
+ } else if (quote === char) {
132
+ quote = false;
133
+ addTo(depth, char);
134
+ continue;
135
+ } else if (parenQuote === char) {
136
+ parenQuote = false;
137
+ addTo(depth, char);
138
+ continue;
139
+ } else if (char === " ") {
140
+ continue;
141
+ } else if (char === "(") {
142
+ if (depth === 0) {
143
+ startP = p;
144
+ } else {
145
+ parenthetical += char;
146
+ }
147
+ depth++;
148
+ } else if (char === ")") {
149
+ depth--;
150
+ if (depth === 0) {
151
+ const fn = typeof operand === "string" && operand.startsWith("$") ? operand : void 0;
152
+ const hasTail = fn && expression.charAt(p + 1) === ".";
153
+ let tail = "";
154
+ if (hasTail) {
155
+ [tail, p] = getTail(p + 2, expression);
156
+ }
157
+ const lStep = op ? step : getStep(startP, expression, 0);
158
+ const rStep = getStep(p, expression);
159
+ if (lStep === -1 && rStep === -1) {
160
+ operand = evaluate(parenthetical, -1, fn, tail);
161
+ if (typeof operand === "string") {
162
+ operand = parenthetical;
163
+ }
164
+ } else if (op && (lStep >= rStep || rStep === -1) && step === lStep) {
165
+ left = op.bind(null, evaluate(parenthetical, -1, fn, tail));
166
+ op = null;
167
+ operand = "";
168
+ } else if (rStep > lStep && step === rStep) {
169
+ operand = evaluate(parenthetical, -1, fn, tail);
170
+ } else {
171
+ operand += `(${parenthetical})${hasTail ? `.${tail}` : ""}`;
172
+ }
173
+ parenthetical = "";
174
+ } else {
175
+ parenthetical += char;
176
+ }
177
+ } else if (depth === 0 && (operation = getOp(symbols, char, p, expression))) {
178
+ if (p === 0) {
179
+ console.error(103, [operation, expression]);
180
+ }
181
+ p += operation.length - 1;
182
+ if (p === expression.length - 1) {
183
+ console.error(104, [operation, expression]);
184
+ }
185
+ if (!op) {
186
+ if (left) {
187
+ op = operators[operation].bind(null, evaluate(left, step));
188
+ left = null;
189
+ } else {
190
+ op = operators[operation].bind(null, evaluate(operand, step));
191
+ operand = "";
192
+ }
193
+ } else if (operand) {
194
+ left = op.bind(null, evaluate(operand, step));
195
+ op = operators[operation].bind(null, left);
196
+ operand = "";
197
+ }
198
+ continue;
199
+ } else {
200
+ addTo(depth, char);
201
+ }
202
+ }
203
+ if (operand && op) {
204
+ op = op.bind(null, evaluate(operand, step));
205
+ }
206
+ op = !op && left ? left : op;
207
+ if (!op && operand) {
208
+ op = (v, t) => typeof v === "function" ? v(t) : v;
209
+ op = op.bind(null, evaluate(operand, step));
210
+ }
211
+ if (!op && !operand) {
212
+ console.error(105, expression);
213
+ }
214
+ return op;
215
+ }
216
+ function evaluate(operand, step, fnToken, tail) {
217
+ if (fnToken) {
218
+ const fn = evaluate(fnToken, operatorRegistry.length);
219
+ let userFuncReturn;
220
+ let tailCall = tail ? compile(`$${tail}`) : false;
221
+ if (typeof fn === "function") {
222
+ const args = helpers.parseArgs(String(operand)).map(
223
+ (arg) => evaluate(arg, -1)
224
+ );
225
+ return (tokens) => {
226
+ const userFunc = fn(tokens);
227
+ if (typeof userFunc !== "function") {
228
+ console.warn(150, fnToken);
229
+ return userFunc;
230
+ }
231
+ userFuncReturn = userFunc(
232
+ ...args.map(
233
+ (arg) => typeof arg === "function" ? arg(tokens) : arg
234
+ )
235
+ );
236
+ if (tailCall) {
237
+ tailCall = tailCall.provide((subTokens) => {
238
+ const rootTokens = provideTokens(subTokens);
239
+ const t = subTokens.reduce(
240
+ (tokenSet, token) => {
241
+ const isTail = token === tail || tail?.startsWith(`${token}(`);
242
+ if (isTail) {
243
+ const value = helpers.getAt(userFuncReturn, token);
244
+ tokenSet[token] = () => value;
245
+ } else {
246
+ tokenSet[token] = rootTokens[token];
247
+ }
248
+ return tokenSet;
249
+ },
250
+ {}
251
+ );
252
+ return t;
253
+ });
254
+ }
255
+ return tailCall ? tailCall() : userFuncReturn;
256
+ };
257
+ }
258
+ } else if (typeof operand === "string") {
259
+ if (operand === "true") {
260
+ return true;
261
+ }
262
+ if (operand === "false") {
263
+ return false;
264
+ }
265
+ if (operand === "undefined") {
266
+ return void 0;
267
+ }
268
+ if (helpers.isQuotedString(operand)) {
269
+ return helpers.rmEscapes(operand.substring(1, operand.length - 1));
270
+ }
271
+ if (!Number.isNaN(+operand)) {
272
+ return Number(operand);
273
+ }
274
+ if (step < operatorRegistry.length - 1) {
275
+ return compileExpr(operand, step + 1);
276
+ } else {
277
+ if (operand.startsWith("$")) {
278
+ const cleaned = operand.substring(1);
279
+ requirements.add(cleaned);
280
+ return function getToken(tokens) {
281
+ return cleaned in tokens ? tokens[cleaned]() : void 0;
282
+ };
283
+ }
284
+ return operand;
285
+ }
286
+ }
287
+ return operand;
288
+ }
289
+ const compiled = compileExpr(expr);
290
+ const identifiers = Array.from(requirements);
291
+ function provide(callback) {
292
+ provideTokens = callback;
293
+ return Object.assign(
294
+ compiled.bind(null, callback(identifiers)),
295
+ { provide }
296
+ );
297
+ }
298
+ return Object.assign(compiled, {
299
+ provide
300
+ });
301
+ }
302
+
303
+ exports.compile = compile;
3
304
  /*! 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 */
@@ -1,3 +1,95 @@
1
- /*! VefFramework version: 1.0.63, build time: 2025-01-09T12:00:00.540Z, made by Venus. */
2
- "use strict";function t(t,e){return Object.hasOwn(t,e)}Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports.getAt=function(e,n){if(!e||"object"!=typeof e)return null;const r=n.split(".");let o=e;for(const e in r){const n=r[e];if(t(o,n)&&(o=o[n]),+e==r.length-1)return o;if(!o||"object"!=typeof o)return null}return null},exports.has=t,exports.isQuotedString=function(t){if('"'!==t[0]&&"'"!==t[0])return!1;if(t[0]!==t[t.length-1])return!1;const[e]=t;for(let n=1;n<t.length;n++)if(t[n]===e&&(1===n||"\\"!==t[n-1])&&n!==t.length-1)return!1;return!0},exports.parseArgs=function(t){const e=[];let n="",r=0,o="",u="";for(let s=0;s<t.length;s++){const l=t.charAt(s);l===o&&"\\"!==u?o="":"'"!==l&&'"'!==l||o||"\\"===u?"("!==l||o?")"!==l||o||r--:r++:o=l,","!==l||o||0!==r?(" "!==l||o)&&(n+=l):(e.push(n),n=""),u=l}return n&&e.push(n),e},exports.rmEscapes=function(t){if(!t.length)return"";let e="",n="";for(let r=0;r<t.length;r++){const o=t.charAt(r);"\\"===o&&"\\"!==n||(e+=o),n=o}return e};
1
+ /*! VefFramework version: 1.0.64, build time: 2025-01-10T01:26:01.352Z, made by Venus. */
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ function has(obj, property) {
7
+ return Object.hasOwn(obj, property);
8
+ }
9
+ function getAt(obj, addr) {
10
+ if (!obj || typeof obj !== "object") {
11
+ return null;
12
+ }
13
+ const segments = addr.split(".");
14
+ let o = obj;
15
+ for (const i in segments) {
16
+ const segment = segments[i];
17
+ if (has(o, segment)) {
18
+ o = o[segment];
19
+ }
20
+ if (+i === segments.length - 1) {
21
+ return o;
22
+ }
23
+ if (!o || typeof o !== "object") {
24
+ return null;
25
+ }
26
+ }
27
+ return null;
28
+ }
29
+ function isQuotedString(str) {
30
+ if (str[0] !== '"' && str[0] !== "'") {
31
+ return false;
32
+ }
33
+ if (str[0] !== str[str.length - 1]) {
34
+ return false;
35
+ }
36
+ const [quoteType] = str;
37
+ for (let p = 1; p < str.length; p++) {
38
+ if (str[p] === quoteType && (p === 1 || str[p - 1] !== "\\") && p !== str.length - 1) {
39
+ return false;
40
+ }
41
+ }
42
+ return true;
43
+ }
44
+ function parseArgs(str) {
45
+ const args = [];
46
+ let arg = "";
47
+ let depth = 0;
48
+ let quote = "";
49
+ let lastChar = "";
50
+ for (let p = 0; p < str.length; p++) {
51
+ const char = str.charAt(p);
52
+ if (char === quote && lastChar !== "\\") {
53
+ quote = "";
54
+ } else if ((char === "'" || char === '"') && !quote && lastChar !== "\\") {
55
+ quote = char;
56
+ } else if (char === "(" && !quote) {
57
+ depth++;
58
+ } else if (char === ")" && !quote) {
59
+ depth--;
60
+ }
61
+ if (char === "," && !quote && depth === 0) {
62
+ args.push(arg);
63
+ arg = "";
64
+ } else if (char !== " " || quote) {
65
+ arg += char;
66
+ }
67
+ lastChar = char;
68
+ }
69
+ if (arg) {
70
+ args.push(arg);
71
+ }
72
+ return args;
73
+ }
74
+ function rmEscapes(str) {
75
+ if (!str.length) {
76
+ return "";
77
+ }
78
+ let clean = "";
79
+ let lastChar = "";
80
+ for (let p = 0; p < str.length; p++) {
81
+ const char = str.charAt(p);
82
+ if (char !== "\\" || lastChar === "\\") {
83
+ clean += char;
84
+ }
85
+ lastChar = char;
86
+ }
87
+ return clean;
88
+ }
89
+
90
+ exports.getAt = getAt;
91
+ exports.has = has;
92
+ exports.isQuotedString = isQuotedString;
93
+ exports.parseArgs = parseArgs;
94
+ exports.rmEscapes = rmEscapes;
3
95
  /*! 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/lib/index.cjs CHANGED
@@ -1,3 +1,27 @@
1
- /*! VefFramework version: 1.0.63, build time: 2025-01-09T12:00:00.540Z, made by Venus. */
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./api/index.cjs"),require("./auth/index.cjs");const e=require("./expr/compiler.cjs"),t=require("./api/api-client.cjs"),r=require("@tanstack/react-query"),i=require("./api/api-context.cjs"),o=require("./auth/auth-context.cjs");exports.compile=e.compile,exports.ApiClient=t.ApiClient,exports.createApiClient=t.createApiClient,Object.defineProperty(exports,"useQueryErrorResetBoundary",{enumerable:!0,get:()=>r.useQueryErrorResetBoundary}),exports.ApiContextProvider=i.ApiContextProvider,exports.useApiContext=i.useApiContext,exports.AuthContextProvider=o.AuthContextProvider,exports.useAuthContext=o.useAuthContext;
1
+ /*! VefFramework version: 1.0.64, build time: 2025-01-10T01:26:01.352Z, made by Venus. */
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ require('./api/index.cjs');
7
+ require('./auth/index.cjs');
8
+ const compiler = require('./expr/compiler.cjs');
9
+ const apiClient = require('./api/api-client.cjs');
10
+ const reactQuery = require('@tanstack/react-query');
11
+ const apiContext = require('./api/api-context.cjs');
12
+ const authContext = require('./auth/auth-context.cjs');
13
+
14
+
15
+
16
+ exports.compile = compiler.compile;
17
+ exports.ApiClient = apiClient.ApiClient;
18
+ exports.createApiClient = apiClient.createApiClient;
19
+ Object.defineProperty(exports, "useQueryErrorResetBoundary", {
20
+ enumerable: true,
21
+ get: () => reactQuery.useQueryErrorResetBoundary
22
+ });
23
+ exports.ApiContextProvider = apiContext.ApiContextProvider;
24
+ exports.useApiContext = apiContext.useApiContext;
25
+ exports.AuthContextProvider = authContext.AuthContextProvider;
26
+ exports.useAuthContext = authContext.useAuthContext;
3
27
  /*! 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 */
@@ -1,3 +1,33 @@
1
- /*! VefFramework version: 1.0.63, build time: 2025-01-09T12:00:00.540Z, made by Venus. */
2
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default=function(){const e=[];let t=0;const n=t=>e.push(t),o=n=>{const s=e[t];return"function"==typeof s?s(n,(e=>(t++,o(e)))):(t=0,n)};return n.dispatch=o,n.unshift=t=>e.unshift(t),n.remove=t=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},n};
1
+ /*! VefFramework version: 1.0.64, build time: 2025-01-10T01:26:01.352Z, made by Venus. */
2
+ 'use strict';
3
+
4
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
5
+
6
+ function createDispatcher() {
7
+ const middlewares = [];
8
+ let currentIndex = 0;
9
+ const dispatcher = (middleware) => middlewares.push(middleware);
10
+ const dispatch = (payload) => {
11
+ const current = middlewares[currentIndex];
12
+ if (typeof current === "function") {
13
+ return current(payload, (explicitPayload) => {
14
+ currentIndex++;
15
+ return dispatch(explicitPayload);
16
+ });
17
+ }
18
+ currentIndex = 0;
19
+ return payload;
20
+ };
21
+ dispatcher.dispatch = dispatch;
22
+ dispatcher.unshift = (middleware) => middlewares.unshift(middleware);
23
+ dispatcher.remove = (middleware) => {
24
+ const index = middlewares.indexOf(middleware);
25
+ if (index > -1) {
26
+ middlewares.splice(index, 1);
27
+ }
28
+ };
29
+ return dispatcher;
30
+ }
31
+
32
+ exports.default = createDispatcher;
3
33
  /*! 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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vef-framework/core",
3
3
  "type": "module",
4
- "version": "1.0.63",
4
+ "version": "1.0.64",
5
5
  "private": false,
6
6
  "packageManager": "pnpm@9.15.0",
7
7
  "description": "The core of the VEF framework",
@@ -36,7 +36,7 @@
36
36
  "use-sync-external-store": "^1.4.0",
37
37
  "@tanstack/react-query": "5.62.16",
38
38
  "@tanstack/react-router": "1.95.1",
39
- "@vef-framework/shared": "1.0.63",
39
+ "@vef-framework/shared": "1.0.64",
40
40
  "axios": "1.7.9",
41
41
  "qs": "6.13.1"
42
42
  },