@vef-framework/core 1.0.101 → 1.0.103
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/api/api-client.js +1 -544
- package/es/api/api-context.js +1 -95
- package/es/api/index.js +1 -5
- package/es/api/query-client.js +1 -31
- package/es/api/request-client.js +1 -244
- package/es/auth/auth-context.js +1 -36
- package/es/auth/index.js +1 -3
- package/es/expr/compiler.js +1 -300
- package/es/expr/helpers.js +1 -87
- package/es/index.js +1 -9
- package/es/middleware/dispatcher.js +1 -29
- package/lib/api/api-client.cjs +1 -549
- package/lib/api/api-context.cjs +1 -100
- package/lib/api/index.cjs +1 -20
- package/lib/api/query-client.cjs +1 -35
- package/lib/api/request-client.cjs +1 -249
- package/lib/auth/auth-context.cjs +1 -41
- package/lib/auth/index.cjs +1 -12
- package/lib/expr/compiler.cjs +1 -304
- package/lib/expr/helpers.cjs +1 -95
- package/lib/index.cjs +1 -27
- package/lib/middleware/dispatcher.cjs +1 -33
- package/package.json +2 -2
package/es/expr/helpers.js
CHANGED
|
@@ -1,87 +1 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
function has(obj, property) {
|
|
3
|
-
return Object.hasOwn(obj, property);
|
|
4
|
-
}
|
|
5
|
-
function getAt(obj, addr) {
|
|
6
|
-
if (!obj || typeof obj !== "object") {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
const segments = addr.split(".");
|
|
10
|
-
let o = obj;
|
|
11
|
-
for (const i in segments) {
|
|
12
|
-
const segment = segments[i];
|
|
13
|
-
if (has(o, segment)) {
|
|
14
|
-
o = o[segment];
|
|
15
|
-
}
|
|
16
|
-
if (+i === segments.length - 1) {
|
|
17
|
-
return o;
|
|
18
|
-
}
|
|
19
|
-
if (!o || typeof o !== "object") {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
function isQuotedString(str) {
|
|
26
|
-
if (str[0] !== '"' && str[0] !== "'") {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
if (str[0] !== str[str.length - 1]) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
const [quoteType] = str;
|
|
33
|
-
for (let p = 1; p < str.length; p++) {
|
|
34
|
-
if (str[p] === quoteType && (p === 1 || str[p - 1] !== "\\") && p !== str.length - 1) {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
function parseArgs(str) {
|
|
41
|
-
const args = [];
|
|
42
|
-
let arg = "";
|
|
43
|
-
let depth = 0;
|
|
44
|
-
let quote = "";
|
|
45
|
-
let lastChar = "";
|
|
46
|
-
for (let p = 0; p < str.length; p++) {
|
|
47
|
-
const char = str.charAt(p);
|
|
48
|
-
if (char === quote && lastChar !== "\\") {
|
|
49
|
-
quote = "";
|
|
50
|
-
} else if ((char === "'" || char === '"') && !quote && lastChar !== "\\") {
|
|
51
|
-
quote = char;
|
|
52
|
-
} else if (char === "(" && !quote) {
|
|
53
|
-
depth++;
|
|
54
|
-
} else if (char === ")" && !quote) {
|
|
55
|
-
depth--;
|
|
56
|
-
}
|
|
57
|
-
if (char === "," && !quote && depth === 0) {
|
|
58
|
-
args.push(arg);
|
|
59
|
-
arg = "";
|
|
60
|
-
} else if (char !== " " || quote) {
|
|
61
|
-
arg += char;
|
|
62
|
-
}
|
|
63
|
-
lastChar = char;
|
|
64
|
-
}
|
|
65
|
-
if (arg) {
|
|
66
|
-
args.push(arg);
|
|
67
|
-
}
|
|
68
|
-
return args;
|
|
69
|
-
}
|
|
70
|
-
function rmEscapes(str) {
|
|
71
|
-
if (!str.length) {
|
|
72
|
-
return "";
|
|
73
|
-
}
|
|
74
|
-
let clean = "";
|
|
75
|
-
let lastChar = "";
|
|
76
|
-
for (let p = 0; p < str.length; p++) {
|
|
77
|
-
const char = str.charAt(p);
|
|
78
|
-
if (char !== "\\" || lastChar === "\\") {
|
|
79
|
-
clean += char;
|
|
80
|
-
}
|
|
81
|
-
lastChar = char;
|
|
82
|
-
}
|
|
83
|
-
return clean;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export { getAt, has, isQuotedString, parseArgs, rmEscapes };
|
|
87
|
-
/*! 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
|
+
/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:51.390Z, made by Venus. */function has(obj,property){return Object.hasOwn(obj,property)}function getAt(obj,addr){if(!obj||typeof obj!="object")return null;const segments=addr.split(".");let o=obj;for(const i in segments){const segment=segments[i];if(has(o,segment)&&(o=o[segment]),+i===segments.length-1)return o;if(!o||typeof o!="object")return null}return null}function isQuotedString(str){if(str[0]!=='"'&&str[0]!=="'"||str[0]!==str[str.length-1])return!1;const[quoteType]=str;for(let p=1;p<str.length;p++)if(str[p]===quoteType&&(p===1||str[p-1]!=="\\")&&p!==str.length-1)return!1;return!0}function parseArgs(str){const args=[];let arg="",depth=0,quote="",lastChar="";for(let p=0;p<str.length;p++){const char=str.charAt(p);char===quote&&lastChar!=="\\"?quote="":(char==="'"||char==='"')&&!quote&&lastChar!=="\\"?quote=char:char==="("&&!quote?depth++:char===")"&&!quote&&depth--,char===","&&!quote&&depth===0?(args.push(arg),arg=""):(char!==" "||quote)&&(arg+=char),lastChar=char}return arg&&args.push(arg),args}function rmEscapes(str){if(!str.length)return"";let clean="",lastChar="";for(let p=0;p<str.length;p++){const char=str.charAt(p);(char!=="\\"||lastChar==="\\")&&(clean+=char),lastChar=char}return clean}/*! 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 */export{getAt,has,isQuotedString,parseArgs,rmEscapes};
|
package/es/index.js
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import './api/index.js';
|
|
3
|
-
import './auth/index.js';
|
|
4
|
-
export { compile } from './expr/compiler.js';
|
|
5
|
-
export { ApiClient, createApiClient } from './api/api-client.js';
|
|
6
|
-
export { useQueryErrorResetBoundary } from '@tanstack/react-query';
|
|
7
|
-
export { ApiContextProvider, useApiContext } from './api/api-context.js';
|
|
8
|
-
export { AuthContextProvider, useAuthContext } from './auth/auth-context.js';
|
|
9
|
-
/*! 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
|
+
/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:51.390Z, made by Venus. */import"./api/index.js";import"./auth/index.js";import{compile}from"./expr/compiler.js";import{ApiClient,createApiClient}from"./api/api-client.js";import{useQueryErrorResetBoundary}from"@tanstack/react-query";import{ApiContextProvider,useApiContext}from"./api/api-context.js";import{AuthContextProvider,useAuthContext}from"./auth/auth-context.js";/*! 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 */export{ApiClient,ApiContextProvider,AuthContextProvider,compile,createApiClient,useApiContext,useAuthContext,useQueryErrorResetBoundary};
|
|
@@ -1,29 +1 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
function createDispatcher() {
|
|
3
|
-
const middlewares = [];
|
|
4
|
-
let currentIndex = 0;
|
|
5
|
-
const dispatcher = (middleware) => middlewares.push(middleware);
|
|
6
|
-
const dispatch = (payload) => {
|
|
7
|
-
const current = middlewares[currentIndex];
|
|
8
|
-
if (typeof current === "function") {
|
|
9
|
-
return current(payload, (explicitPayload) => {
|
|
10
|
-
currentIndex++;
|
|
11
|
-
return dispatch(explicitPayload);
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
currentIndex = 0;
|
|
15
|
-
return payload;
|
|
16
|
-
};
|
|
17
|
-
dispatcher.dispatch = dispatch;
|
|
18
|
-
dispatcher.unshift = (middleware) => middlewares.unshift(middleware);
|
|
19
|
-
dispatcher.remove = (middleware) => {
|
|
20
|
-
const index = middlewares.indexOf(middleware);
|
|
21
|
-
if (index > -1) {
|
|
22
|
-
middlewares.splice(index, 1);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
return dispatcher;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { createDispatcher as default };
|
|
29
|
-
/*! 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
|
+
/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:51.390Z, made by Venus. */function createDispatcher(){const middlewares=[];let currentIndex=0;const dispatcher=middleware=>middlewares.push(middleware),dispatch=payload=>{const current=middlewares[currentIndex];return typeof current=="function"?current(payload,explicitPayload=>(currentIndex++,dispatch(explicitPayload))):(currentIndex=0,payload)};return dispatcher.dispatch=dispatch,dispatcher.unshift=middleware=>middlewares.unshift(middleware),dispatcher.remove=middleware=>{const index=middlewares.indexOf(middleware);index>-1&&middlewares.splice(index,1)},dispatcher}/*! 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 */export{createDispatcher as default};
|