@spring-systems/core 0.8.6 → 0.8.9
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/dist/adapters/index.js +1 -56
- package/dist/auth/index.js +1 -19
- package/dist/chunk-3OMNT22N.js +1 -0
- package/dist/chunk-4KRUU6MS.js +1 -0
- package/dist/chunk-6J2VFOKL.js +1 -0
- package/dist/chunk-7P4BJDQR.js +1 -0
- package/dist/chunk-AMXSATFF.js +1 -0
- package/dist/chunk-BMIRKMVX.js +1 -0
- package/dist/chunk-EVDFSWPU.js +1 -0
- package/dist/chunk-F3VXVDPQ.js +1 -0
- package/dist/chunk-GSQE2NEY.js +1 -0
- package/dist/chunk-HUASNNWD.js +1 -0
- package/dist/chunk-ICKHSEIX.js +1 -0
- package/dist/chunk-JRHMAY5G.js +1 -0
- package/dist/chunk-MNLYYTGZ.js +7 -0
- package/dist/chunk-OOVZTF74.js +1 -0
- package/dist/chunk-PNDXLNCU.js +1 -0
- package/dist/chunk-R3XYEEGR.js +1 -0
- package/dist/chunk-RKLYBW3O.js +1 -0
- package/dist/chunk-RVQHSQYF.js +3 -0
- package/dist/chunk-UT6X6RQM.js +1 -0
- package/dist/chunk-Y6DB43IE.js +3 -0
- package/dist/chunk-YMSSF2ZU.js +1 -0
- package/dist/config/index.js +1 -109
- package/dist/devtools/index.js +1 -67
- package/dist/errors/index.js +1 -21
- package/dist/events/index.js +1 -12
- package/dist/i18n/index.js +1 -7
- package/dist/index.js +1 -42
- package/dist/instance/index.js +1 -37
- package/dist/logger/index.js +1 -27
- package/dist/middleware/index.js +1 -23
- package/dist/plugins/index.js +1 -16
- package/dist/testing/index.js +1 -171
- package/dist/types/index.js +1 -72
- package/dist/utils/index.d.ts +43 -1
- package/dist/utils/index.js +1 -772
- package/dist/validation/index.js +1 -147
- package/package.json +1 -1
- package/dist/adapters/index.js.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/chunk-2PJWFA5S.js +0 -393
- package/dist/chunk-2PJWFA5S.js.map +0 -1
- package/dist/chunk-EFUBAQCV.js +0 -94
- package/dist/chunk-EFUBAQCV.js.map +0 -1
- package/dist/chunk-F2SIMWZ5.js +0 -173
- package/dist/chunk-F2SIMWZ5.js.map +0 -1
- package/dist/chunk-F7WUQJH7.js +0 -399
- package/dist/chunk-F7WUQJH7.js.map +0 -1
- package/dist/chunk-GON7Q32Q.js +0 -176
- package/dist/chunk-GON7Q32Q.js.map +0 -1
- package/dist/chunk-GXU75LQX.js +0 -182
- package/dist/chunk-GXU75LQX.js.map +0 -1
- package/dist/chunk-HFELOXDQ.js +0 -110
- package/dist/chunk-HFELOXDQ.js.map +0 -1
- package/dist/chunk-KX32MU3I.js +0 -190
- package/dist/chunk-KX32MU3I.js.map +0 -1
- package/dist/chunk-MEWPYTWC.js +0 -284
- package/dist/chunk-MEWPYTWC.js.map +0 -1
- package/dist/chunk-N2L4TUC4.js +0 -34
- package/dist/chunk-N2L4TUC4.js.map +0 -1
- package/dist/chunk-NQQIVCLX.js +0 -47
- package/dist/chunk-NQQIVCLX.js.map +0 -1
- package/dist/chunk-OSSX443T.js +0 -146
- package/dist/chunk-OSSX443T.js.map +0 -1
- package/dist/chunk-PT4DIYUK.js +0 -78
- package/dist/chunk-PT4DIYUK.js.map +0 -1
- package/dist/chunk-QAVWXARR.js +0 -51
- package/dist/chunk-QAVWXARR.js.map +0 -1
- package/dist/chunk-RRWKDFAB.js +0 -143
- package/dist/chunk-RRWKDFAB.js.map +0 -1
- package/dist/chunk-RUCXSQEY.js +0 -42
- package/dist/chunk-RUCXSQEY.js.map +0 -1
- package/dist/chunk-S6RPCN5H.js +0 -64
- package/dist/chunk-S6RPCN5H.js.map +0 -1
- package/dist/chunk-S7MKRNMI.js +0 -153
- package/dist/chunk-S7MKRNMI.js.map +0 -1
- package/dist/chunk-SQB4F3EF.js +0 -55
- package/dist/chunk-SQB4F3EF.js.map +0 -1
- package/dist/chunk-UDT2RPX2.js +0 -43
- package/dist/chunk-UDT2RPX2.js.map +0 -1
- package/dist/chunk-VRMVN2UM.js +0 -17
- package/dist/chunk-VRMVN2UM.js.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/devtools/index.js.map +0 -1
- package/dist/errors/index.js.map +0 -1
- package/dist/events/index.js.map +0 -1
- package/dist/i18n/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/instance/index.js.map +0 -1
- package/dist/logger/index.js.map +0 -1
- package/dist/middleware/index.js.map +0 -1
- package/dist/plugins/index.js.map +0 -1
- package/dist/testing/index.js.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/validation/index.js.map +0 -1
package/dist/middleware/index.js
CHANGED
|
@@ -1,23 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createAuditMiddleware
|
|
3
|
-
} from "../chunk-SQB4F3EF.js";
|
|
4
|
-
import {
|
|
5
|
-
clearAllMiddleware,
|
|
6
|
-
composeMiddleware,
|
|
7
|
-
getMiddlewareRunner,
|
|
8
|
-
getRegisteredMiddlewareSlots,
|
|
9
|
-
registerMiddleware
|
|
10
|
-
} from "../chunk-MEWPYTWC.js";
|
|
11
|
-
import "../chunk-RUCXSQEY.js";
|
|
12
|
-
import "../chunk-KX32MU3I.js";
|
|
13
|
-
import "../chunk-EFUBAQCV.js";
|
|
14
|
-
import "../chunk-PT4DIYUK.js";
|
|
15
|
-
export {
|
|
16
|
-
clearAllMiddleware,
|
|
17
|
-
composeMiddleware,
|
|
18
|
-
createAuditMiddleware,
|
|
19
|
-
getMiddlewareRunner,
|
|
20
|
-
getRegisteredMiddlewareSlots,
|
|
21
|
-
registerMiddleware
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import{a as f}from"../chunk-F3VXVDPQ.js";import{a,b,c,d,e}from"../chunk-3OMNT22N.js";import"../chunk-YMSSF2ZU.js";import"../chunk-EVDFSWPU.js";import"../chunk-JRHMAY5G.js";import"../chunk-OOVZTF74.js";export{e as clearAllMiddleware,a as composeMiddleware,f as createAuditMiddleware,c as getMiddlewareRunner,d as getRegisteredMiddlewareSlots,b as registerMiddleware};
|
package/dist/plugins/index.js
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
applyPlugins,
|
|
3
|
-
disposePlugins,
|
|
4
|
-
getLoadedPlugins
|
|
5
|
-
} from "../chunk-GXU75LQX.js";
|
|
6
|
-
import "../chunk-S7MKRNMI.js";
|
|
7
|
-
import "../chunk-RUCXSQEY.js";
|
|
8
|
-
import "../chunk-KX32MU3I.js";
|
|
9
|
-
import "../chunk-EFUBAQCV.js";
|
|
10
|
-
import "../chunk-PT4DIYUK.js";
|
|
11
|
-
export {
|
|
12
|
-
applyPlugins,
|
|
13
|
-
disposePlugins,
|
|
14
|
-
getLoadedPlugins
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import{a as n,b as e,c as i}from"../chunk-6J2VFOKL.js";import"../chunk-UT6X6RQM.js";import"../chunk-YMSSF2ZU.js";import"../chunk-EVDFSWPU.js";import"../chunk-JRHMAY5G.js";import"../chunk-OOVZTF74.js";export{n as applyPlugins,e as disposePlugins,i as getLoadedPlugins};
|
package/dist/testing/index.js
CHANGED
|
@@ -1,171 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createSpringInstance
|
|
3
|
-
} from "../chunk-F2SIMWZ5.js";
|
|
4
|
-
import {
|
|
5
|
-
applyPlugins,
|
|
6
|
-
disposePlugins
|
|
7
|
-
} from "../chunk-GXU75LQX.js";
|
|
8
|
-
import {
|
|
9
|
-
eventBus
|
|
10
|
-
} from "../chunk-OSSX443T.js";
|
|
11
|
-
import {
|
|
12
|
-
clearAllMiddleware
|
|
13
|
-
} from "../chunk-MEWPYTWC.js";
|
|
14
|
-
import {
|
|
15
|
-
clearRuntimeEnvKeys
|
|
16
|
-
} from "../chunk-UDT2RPX2.js";
|
|
17
|
-
import {
|
|
18
|
-
clearCapabilities
|
|
19
|
-
} from "../chunk-S7MKRNMI.js";
|
|
20
|
-
import {
|
|
21
|
-
clearFrameworkConfig
|
|
22
|
-
} from "../chunk-F7WUQJH7.js";
|
|
23
|
-
import {
|
|
24
|
-
clearValidators
|
|
25
|
-
} from "../chunk-RRWKDFAB.js";
|
|
26
|
-
import "../chunk-QAVWXARR.js";
|
|
27
|
-
import {
|
|
28
|
-
clearAuthState
|
|
29
|
-
} from "../chunk-HFELOXDQ.js";
|
|
30
|
-
import {
|
|
31
|
-
clearHttpAdapter,
|
|
32
|
-
clearLicenseAdapter,
|
|
33
|
-
clearNotificationAdapter
|
|
34
|
-
} from "../chunk-GON7Q32Q.js";
|
|
35
|
-
import {
|
|
36
|
-
clearTelemetryAdapter
|
|
37
|
-
} from "../chunk-S6RPCN5H.js";
|
|
38
|
-
import {
|
|
39
|
-
clearContentAdapter
|
|
40
|
-
} from "../chunk-NQQIVCLX.js";
|
|
41
|
-
import "../chunk-N2L4TUC4.js";
|
|
42
|
-
import "../chunk-RUCXSQEY.js";
|
|
43
|
-
import {
|
|
44
|
-
clearLogAdapter,
|
|
45
|
-
resetLogLevel
|
|
46
|
-
} from "../chunk-KX32MU3I.js";
|
|
47
|
-
import {
|
|
48
|
-
clearSpringInstance,
|
|
49
|
-
setSpringInstance
|
|
50
|
-
} from "../chunk-EFUBAQCV.js";
|
|
51
|
-
import "../chunk-PT4DIYUK.js";
|
|
52
|
-
|
|
53
|
-
// src/testing/test-utils.ts
|
|
54
|
-
function createTestInstance(options = {}) {
|
|
55
|
-
const instance = createSpringInstance(options.config);
|
|
56
|
-
if (options.contentAdapter) {
|
|
57
|
-
instance.core.contentAdapter = options.contentAdapter;
|
|
58
|
-
}
|
|
59
|
-
if (options.notificationAdapter) {
|
|
60
|
-
instance.core.notificationAdapter = options.notificationAdapter;
|
|
61
|
-
}
|
|
62
|
-
if (options.logAdapter) {
|
|
63
|
-
instance.core.logAdapter = options.logAdapter;
|
|
64
|
-
}
|
|
65
|
-
if (options.setGlobal !== false) {
|
|
66
|
-
setSpringInstance(instance);
|
|
67
|
-
}
|
|
68
|
-
if (options.plugins && options.plugins.length > 0) {
|
|
69
|
-
applyPlugins(instance, options.plugins);
|
|
70
|
-
}
|
|
71
|
-
const originalDispose = instance.dispose.bind(instance);
|
|
72
|
-
instance.dispose = () => {
|
|
73
|
-
disposePlugins(instance);
|
|
74
|
-
originalDispose();
|
|
75
|
-
if (options.setGlobal !== false) {
|
|
76
|
-
clearSpringInstance();
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
return instance;
|
|
80
|
-
}
|
|
81
|
-
var mockAdapters = {
|
|
82
|
-
/** Content adapter that returns the key itself (identity) */
|
|
83
|
-
content: () => ({
|
|
84
|
-
getRes: (key) => key
|
|
85
|
-
}),
|
|
86
|
-
/** Content adapter that returns a custom mapping */
|
|
87
|
-
contentWithMessages: (messages) => ({
|
|
88
|
-
getRes: (key) => messages[key] ?? `[${key}]`
|
|
89
|
-
}),
|
|
90
|
-
/** Notification adapter that collects all notifications for assertions */
|
|
91
|
-
notificationCollector: () => {
|
|
92
|
-
const calls = [];
|
|
93
|
-
return {
|
|
94
|
-
adapter: {
|
|
95
|
-
error: (msg) => calls.push({ type: "error", msg }),
|
|
96
|
-
success: (msg) => calls.push({ type: "success", msg }),
|
|
97
|
-
warning: (msg) => calls.push({ type: "warning", msg }),
|
|
98
|
-
info: (msg) => calls.push({ type: "info", msg })
|
|
99
|
-
},
|
|
100
|
-
calls,
|
|
101
|
-
clear: () => {
|
|
102
|
-
calls.length = 0;
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
},
|
|
106
|
-
/** Log adapter that collects all log entries for assertions */
|
|
107
|
-
logCollector: () => {
|
|
108
|
-
const errors = [];
|
|
109
|
-
const warnings = [];
|
|
110
|
-
const securityEvents = [];
|
|
111
|
-
return {
|
|
112
|
-
adapter: {
|
|
113
|
-
onError: (ctx, err) => errors.push({ context: ctx, error: err }),
|
|
114
|
-
onWarn: (ctx, msg) => warnings.push({ context: ctx, message: msg }),
|
|
115
|
-
onSecurityEvent: (evt, data) => securityEvents.push({ event: evt, data })
|
|
116
|
-
},
|
|
117
|
-
errors,
|
|
118
|
-
warnings,
|
|
119
|
-
securityEvents
|
|
120
|
-
};
|
|
121
|
-
},
|
|
122
|
-
/** Silent no-op adapters (suppress all output) */
|
|
123
|
-
silent: {
|
|
124
|
-
content: { getRes: (key) => key },
|
|
125
|
-
notification: {
|
|
126
|
-
error: (_msg) => {
|
|
127
|
-
},
|
|
128
|
-
success: (_msg) => {
|
|
129
|
-
},
|
|
130
|
-
warning: (_msg) => {
|
|
131
|
-
},
|
|
132
|
-
info: (_msg) => {
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
log: {}
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
function castTo(value) {
|
|
139
|
-
return value;
|
|
140
|
-
}
|
|
141
|
-
function assertDefined(val, msg) {
|
|
142
|
-
if (val === void 0 || val === null) {
|
|
143
|
-
throw new Error(msg ?? "Expected value to be defined, but got " + String(val));
|
|
144
|
-
}
|
|
145
|
-
return val;
|
|
146
|
-
}
|
|
147
|
-
function resetCoreRuntimeState() {
|
|
148
|
-
eventBus.clearAll();
|
|
149
|
-
clearAllMiddleware();
|
|
150
|
-
clearValidators();
|
|
151
|
-
clearCapabilities();
|
|
152
|
-
clearFrameworkConfig();
|
|
153
|
-
clearRuntimeEnvKeys();
|
|
154
|
-
clearAuthState();
|
|
155
|
-
clearContentAdapter();
|
|
156
|
-
clearNotificationAdapter();
|
|
157
|
-
clearHttpAdapter();
|
|
158
|
-
clearLicenseAdapter();
|
|
159
|
-
clearTelemetryAdapter();
|
|
160
|
-
clearLogAdapter();
|
|
161
|
-
resetLogLevel();
|
|
162
|
-
clearSpringInstance();
|
|
163
|
-
}
|
|
164
|
-
export {
|
|
165
|
-
assertDefined,
|
|
166
|
-
castTo,
|
|
167
|
-
createTestInstance,
|
|
168
|
-
mockAdapters,
|
|
169
|
-
resetCoreRuntimeState
|
|
170
|
-
};
|
|
171
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import{a as x}from"../chunk-Y6DB43IE.js";import{a as S,b as T}from"../chunk-6J2VFOKL.js";import{a as d}from"../chunk-RKLYBW3O.js";import{e as u}from"../chunk-3OMNT22N.js";import{d as f}from"../chunk-PNDXLNCU.js";import{f as p}from"../chunk-UT6X6RQM.js";import{f as g}from"../chunk-RVQHSQYF.js";import{d as A}from"../chunk-AMXSATFF.js";import"../chunk-ICKHSEIX.js";import{e as y}from"../chunk-4KRUU6MS.js";import{c as I,f as w,l as C}from"../chunk-BMIRKMVX.js";import{c as l}from"../chunk-R3XYEEGR.js";import{c as m}from"../chunk-7P4BJDQR.js";import"../chunk-HUASNNWD.js";import"../chunk-YMSSF2ZU.js";import{f as a,g as c}from"../chunk-EVDFSWPU.js";import{e as o,h as s}from"../chunk-JRHMAY5G.js";import"../chunk-OOVZTF74.js";function h(t={}){let e=x(t.config);t.contentAdapter&&(e.core.contentAdapter=t.contentAdapter),t.notificationAdapter&&(e.core.notificationAdapter=t.notificationAdapter),t.logAdapter&&(e.core.logAdapter=t.logAdapter),t.setGlobal!==!1&&o(e),t.plugins&&t.plugins.length>0&&S(e,t.plugins);let i=e.dispose.bind(e);return e.dispose=()=>{T(e),i(),t.setGlobal!==!1&&s()},e}var L={content:()=>({getRes:t=>t}),contentWithMessages:t=>({getRes:e=>t[e]??`[${e}]`}),notificationCollector:()=>{let t=[];return{adapter:{error:e=>t.push({type:"error",msg:e}),success:e=>t.push({type:"success",msg:e}),warning:e=>t.push({type:"warning",msg:e}),info:e=>t.push({type:"info",msg:e})},calls:t,clear:()=>{t.length=0}}},logCollector:()=>{let t=[],e=[],i=[];return{adapter:{onError:(n,r)=>t.push({context:n,error:r}),onWarn:(n,r)=>e.push({context:n,message:r}),onSecurityEvent:(n,r)=>i.push({event:n,data:r})},errors:t,warnings:e,securityEvents:i}},silent:{content:{getRes:t=>t},notification:{error:t=>{},success:t=>{},warning:t=>{},info:t=>{}},log:{}}};function k(t){return t}function b(t,e){if(t==null)throw new Error(e??"Expected value to be defined, but got "+String(t));return t}function v(){d.clearAll(),u(),A(),p(),g(),f(),y(),m(),C(),I(),w(),l(),a(),c(),s()}export{b as assertDefined,k as castTo,h as createTestInstance,L as mockAdapters,v as resetCoreRuntimeState};
|
package/dist/types/index.js
CHANGED
|
@@ -1,72 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getField,
|
|
3
|
-
getIdentifiableId,
|
|
4
|
-
getStoreValue,
|
|
5
|
-
getSubState,
|
|
6
|
-
isFormFieldRuntime,
|
|
7
|
-
storeBoundary,
|
|
8
|
-
toFormDataValue
|
|
9
|
-
} from "../chunk-QAVWXARR.js";
|
|
10
|
-
|
|
11
|
-
// src/types/branded.ts
|
|
12
|
-
function toGuid(value) {
|
|
13
|
-
return value;
|
|
14
|
-
}
|
|
15
|
-
function toIdPublic(value) {
|
|
16
|
-
return value;
|
|
17
|
-
}
|
|
18
|
-
function toResourceKey(value) {
|
|
19
|
-
return value;
|
|
20
|
-
}
|
|
21
|
-
function toApiRoute(value) {
|
|
22
|
-
return value;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// src/types/grid-types.ts
|
|
26
|
-
function isFilterNode(val) {
|
|
27
|
-
if (typeof val !== "object" || val === null || Array.isArray(val)) return false;
|
|
28
|
-
return "logic" in val && "filters" in val || "field" in val && "operator" in val;
|
|
29
|
-
}
|
|
30
|
-
function isCombinedSettingData(val) {
|
|
31
|
-
if (typeof val !== "object" || val === null || Array.isArray(val)) return false;
|
|
32
|
-
return "user_filter" in val || "layout" in val;
|
|
33
|
-
}
|
|
34
|
-
function isPermission(val) {
|
|
35
|
-
if (typeof val !== "object" || val === null || Array.isArray(val)) return false;
|
|
36
|
-
const obj = val;
|
|
37
|
-
return typeof obj.read === "boolean" && typeof obj.list === "boolean" && typeof obj.delete === "boolean" && typeof obj.insert === "boolean" && typeof obj.update === "boolean";
|
|
38
|
-
}
|
|
39
|
-
function isColumnLayout(val) {
|
|
40
|
-
if (typeof val !== "object" || val === null || Array.isArray(val)) return false;
|
|
41
|
-
const obj = val;
|
|
42
|
-
return typeof obj.key === "string" && typeof obj.order === "number" && typeof obj.show === "boolean";
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// src/types/list-types.ts
|
|
46
|
-
var FormatType = {
|
|
47
|
-
Badge: 1,
|
|
48
|
-
Color: 2,
|
|
49
|
-
Background: 3,
|
|
50
|
-
RowBackground: 4,
|
|
51
|
-
Icon: 5,
|
|
52
|
-
Detail: 6
|
|
53
|
-
};
|
|
54
|
-
export {
|
|
55
|
-
FormatType,
|
|
56
|
-
getField,
|
|
57
|
-
getIdentifiableId,
|
|
58
|
-
getStoreValue,
|
|
59
|
-
getSubState,
|
|
60
|
-
isColumnLayout,
|
|
61
|
-
isCombinedSettingData,
|
|
62
|
-
isFilterNode,
|
|
63
|
-
isFormFieldRuntime,
|
|
64
|
-
isPermission,
|
|
65
|
-
storeBoundary,
|
|
66
|
-
toApiRoute,
|
|
67
|
-
toFormDataValue,
|
|
68
|
-
toGuid,
|
|
69
|
-
toIdPublic,
|
|
70
|
-
toResourceKey
|
|
71
|
-
};
|
|
72
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import{a as o,b as r,c as n,d as i,e as a,f as s,g as u}from"../chunk-ICKHSEIX.js";function p(e){return e}function l(e){return e}function d(e){return e}function y(e){return e}function c(e){return typeof e!="object"||e===null||Array.isArray(e)?!1:"logic"in e&&"filters"in e||"field"in e&&"operator"in e}function m(e){return typeof e!="object"||e===null||Array.isArray(e)?!1:"user_filter"in e||"layout"in e}function g(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e;return typeof t.read=="boolean"&&typeof t.list=="boolean"&&typeof t.delete=="boolean"&&typeof t.insert=="boolean"&&typeof t.update=="boolean"}function b(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e;return typeof t.key=="string"&&typeof t.order=="number"&&typeof t.show=="boolean"}var _={Badge:1,Color:2,Background:3,RowBackground:4,Icon:5,Detail:6};export{_ as FormatType,a as getField,o as getIdentifiableId,u as getStoreValue,s as getSubState,b as isColumnLayout,m as isCombinedSettingData,c as isFilterNode,i as isFormFieldRuntime,g as isPermission,r as storeBoundary,y as toApiRoute,n as toFormDataValue,p as toGuid,l as toIdPublic,d as toResourceKey};
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -13,6 +13,47 @@ declare function getBrightness(r: number, g: number, b: number): number;
|
|
|
13
13
|
declare function hexToRgb(hex: string): [number, number, number];
|
|
14
14
|
declare function rgbToHex(rgb: string): string;
|
|
15
15
|
declare function getContrastYIQ(hex: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Background → text contrast pairs for automatic text color derivation.
|
|
18
|
+
*
|
|
19
|
+
* Only includes the sidebar menu — the one component where projects routinely
|
|
20
|
+
* override the background independently of `--spring-color-primary`.
|
|
21
|
+
*
|
|
22
|
+
* List headers and buttons are intentionally excluded: their text colors are
|
|
23
|
+
* derived from the CSS variable chain (`text-secondary` / `text-on-accent`)
|
|
24
|
+
* which already produces correct results for both light and dark modes.
|
|
25
|
+
* Auto-deriving them would override intentional design choices (e.g. white
|
|
26
|
+
* text on a medium-toned gold that the YIQ formula classifies as "light").
|
|
27
|
+
*/
|
|
28
|
+
declare const CONTRAST_PAIRS: ReadonlyArray<{
|
|
29
|
+
bg: string;
|
|
30
|
+
text: string;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Resolve a CSS custom property to a hex color value.
|
|
34
|
+
* Uses a probe element to force the browser to resolve `var()` chains
|
|
35
|
+
* and named colors (e.g. "white") to computed `rgb()` values.
|
|
36
|
+
*
|
|
37
|
+
* @returns Hex color string (e.g. "#2563eb") or null if unresolvable.
|
|
38
|
+
*/
|
|
39
|
+
declare function resolveColorVar(cssVar: string, root?: HTMLElement): string | null;
|
|
40
|
+
/**
|
|
41
|
+
* Auto-derive text colors from background colors using YIQ contrast.
|
|
42
|
+
*
|
|
43
|
+
* For each pair: resolves the computed background color, determines if it is
|
|
44
|
+
* light or dark, and sets the text variable to `--spring-color-text` (for
|
|
45
|
+
* light backgrounds) or `#ffffff` (for dark backgrounds).
|
|
46
|
+
*
|
|
47
|
+
* Called automatically by the theme store after dark mode init and on
|
|
48
|
+
* theme changes. Projects can also call it after runtime CSS variable changes.
|
|
49
|
+
*
|
|
50
|
+
* @param pairs — Override default pairs. Defaults to {@link CONTRAST_PAIRS}.
|
|
51
|
+
* @param root — Override root element. Defaults to `document.documentElement`.
|
|
52
|
+
*/
|
|
53
|
+
declare function applyContrastColors(pairs?: ReadonlyArray<{
|
|
54
|
+
bg: string;
|
|
55
|
+
text: string;
|
|
56
|
+
}>, root?: HTMLElement): void;
|
|
16
57
|
|
|
17
58
|
declare function isValueNotEmpty(value: string | number | boolean | null | undefined | FormDataValue[]): boolean;
|
|
18
59
|
/** Returns a deep copy of an object, removing unwanted references. */
|
|
@@ -72,6 +113,7 @@ declare const dateManager: {
|
|
|
72
113
|
/**
|
|
73
114
|
* Runtime deprecation warnings for the SPRING framework.
|
|
74
115
|
* Warns once per session per deprecation to avoid console spam.
|
|
116
|
+
* Silent in production — warnings are only shown in development mode.
|
|
75
117
|
* @module deprecation
|
|
76
118
|
*/
|
|
77
119
|
declare function springDeprecate(name: string, alternative: string, removeVersion?: string): void;
|
|
@@ -139,4 +181,4 @@ declare function removeNode<T extends BaseTreeNode>(nodes: T[], id: string, chil
|
|
|
139
181
|
declare function addNode<T extends BaseTreeNode>(nodes: T[], parentId: string | null, newNode: T, childrenField?: string): T[];
|
|
140
182
|
declare function findParentId<T extends BaseTreeNode>(nodes: T[], id: string, childrenField?: string, parentId?: string | null): string | null;
|
|
141
183
|
|
|
142
|
-
export { type BaseTreeNode, type ValueType, __DEV__, addNode, clearDeprecationWarnings, dateManager, deepCopy, deepEqual, deepMerge, devAssert, devThrow, devWarn, findNode, findParentId, generateGUID, getAllIds, getBrightness, getChildren, getContrastYIQ, getFilterFieldType, getValueByPath, getValueType, hexToRgb, isValueNotEmpty, normalizeString, normalizeSystemFilter, onKeyActivate, parseFilter, parseJSONSafely, prefersReducedMotion, removeNode, rgbToHex, sanitizeContent, sanitizeEditorContent, setColumnBodyType, setDateLocale, setDefaultStructure, springDeprecate, toNumber, truncateString, updateNode };
|
|
184
|
+
export { type BaseTreeNode, CONTRAST_PAIRS, type ValueType, __DEV__, addNode, applyContrastColors, clearDeprecationWarnings, dateManager, deepCopy, deepEqual, deepMerge, devAssert, devThrow, devWarn, findNode, findParentId, generateGUID, getAllIds, getBrightness, getChildren, getContrastYIQ, getFilterFieldType, getValueByPath, getValueType, hexToRgb, isValueNotEmpty, normalizeString, normalizeSystemFilter, onKeyActivate, parseFilter, parseJSONSafely, prefersReducedMotion, removeNode, resolveColorVar, rgbToHex, sanitizeContent, sanitizeEditorContent, setColumnBodyType, setDateLocale, setDefaultStructure, springDeprecate, toNumber, truncateString, updateNode };
|