@vef-framework/shared 1.0.127 → 1.0.129

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.
Files changed (54) hide show
  1. package/cjs/color.cjs +1 -10
  2. package/cjs/constants.cjs +1 -38
  3. package/cjs/context.cjs +1 -35
  4. package/cjs/dom.cjs +1 -22
  5. package/cjs/error.cjs +1 -29
  6. package/cjs/event.cjs +1 -10
  7. package/cjs/expression.cjs +1 -26
  8. package/cjs/function.cjs +1 -15
  9. package/cjs/icons.cjs +1 -135
  10. package/cjs/id.cjs +1 -13
  11. package/cjs/index.cjs +1 -317
  12. package/cjs/json.cjs +1 -17
  13. package/cjs/message.cjs +1 -302
  14. package/cjs/module.cjs +2 -0
  15. package/cjs/path.cjs +1 -39
  16. package/cjs/pinyin.cjs +1 -32
  17. package/cjs/security.cjs +1 -26
  18. package/cjs/store.cjs +1 -103
  19. package/cjs/styles.cjs +1 -54
  20. package/cjs/temporal.cjs +1 -26
  21. package/cjs/theme-variables.cjs +1 -353
  22. package/cjs/types.cjs +0 -2
  23. package/cjs/utils.cjs +1 -322
  24. package/cjs/validation.cjs +1 -188
  25. package/cjs/yaml.cjs +1 -10
  26. package/cjs/zod.cjs +1 -26
  27. package/esm/color.js +1 -8
  28. package/esm/constants.js +1 -30
  29. package/esm/context.js +1 -33
  30. package/esm/dom.js +1 -20
  31. package/esm/error.js +1 -27
  32. package/esm/event.js +1 -8
  33. package/esm/expression.js +1 -22
  34. package/esm/function.js +1 -13
  35. package/esm/icons.js +1 -128
  36. package/esm/id.js +1 -11
  37. package/esm/index.js +1 -31
  38. package/esm/json.js +1 -15
  39. package/esm/message.js +1 -281
  40. package/esm/module.js +2 -0
  41. package/esm/path.js +1 -32
  42. package/esm/pinyin.js +1 -29
  43. package/esm/security.js +1 -23
  44. package/esm/store.js +1 -98
  45. package/esm/styles.js +1 -50
  46. package/esm/temporal.js +1 -22
  47. package/esm/theme-variables.js +1 -351
  48. package/esm/utils.js +1 -110
  49. package/esm/validation.js +1 -150
  50. package/esm/yaml.js +1 -8
  51. package/esm/zod.js +1 -21
  52. package/package.json +1 -1
  53. package/types/index.d.ts +1 -0
  54. package/types/module.d.ts +7 -0
package/esm/error.js CHANGED
@@ -1,28 +1,2 @@
1
1
  "use strict";
2
- "use strict";
3
- var __defProp = Object.defineProperty;
4
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
- class VefError extends Error {
7
- /**
8
- * Constructs a new VefError.
9
- *
10
- * @param code - The code of the error.
11
- * @param message - The message of the error.
12
- */
13
- constructor(code, message) {
14
- super(message);
15
- /**
16
- * The code of the error.
17
- */
18
- __publicField(this, "code");
19
- Object.defineProperty(this, "code", {
20
- value: code,
21
- writable: false,
22
- configurable: false,
23
- enumerable: true
24
- });
25
- }
26
- }
27
-
28
- export { VefError };
2
+ var a=Object.defineProperty,o=(r,e,t)=>e in r?a(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,s=(r,e,t)=>o(r,typeof e!="symbol"?e+"":e,t);class c extends Error{constructor(e,t){super(t),s(this,"code"),Object.defineProperty(this,"code",{value:e,writable:!1,configurable:!1,enumerable:!0})}}export{c as VefError};
package/esm/event.js CHANGED
@@ -1,9 +1,2 @@
1
1
  "use strict";
2
- import mitt from 'mitt';
3
-
4
- "use strict";
5
- function createEventEmitter() {
6
- return mitt();
7
- }
8
-
9
- export { createEventEmitter };
2
+ import t from"mitt";function r(){return t()}export{r as createEventEmitter};
package/esm/expression.js CHANGED
@@ -1,23 +1,2 @@
1
1
  "use strict";
2
- import './utils.js';
3
- import { isObject, isString, isFunction } from 'radashi';
4
-
5
- "use strict";
6
- const dynamicFnCache = /* @__PURE__ */ new WeakMap();
7
- function isExpression(value) {
8
- return isObject(value) && "expression" in value && isString(value.expression);
9
- }
10
- function isFunctionOrExpression(value) {
11
- return isFunction(value) || isExpression(value);
12
- }
13
- function compileDynamicFn(key, ...args) {
14
- const fn = dynamicFnCache.get(key);
15
- if (fn) {
16
- return fn;
17
- }
18
- const newFn = new Function(...args);
19
- dynamicFnCache.set(key, newFn);
20
- return newFn;
21
- }
22
-
23
- export { compileDynamicFn, isExpression, isFunctionOrExpression };
2
+ import"./utils.js";import{isObject as o,isString as c,isFunction as u}from"radashi";const e=new WeakMap;function s(n){return o(n)&&"expression"in n&&c(n.expression)}function p(n){return u(n)||s(n)}function f(n,...r){const i=e.get(n);if(i)return i;const t=new Function(...r);return e.set(n,t),t}export{f as compileDynamicFn,s as isExpression,p as isFunctionOrExpression};
package/esm/function.js CHANGED
@@ -1,14 +1,2 @@
1
1
  "use strict";
2
- "use strict";
3
- function mergeFns(...fns) {
4
- const fn = (...args) => {
5
- for (const fn2 of fns) {
6
- if (fn2) {
7
- fn2(...args);
8
- }
9
- }
10
- };
11
- return fn;
12
- }
13
-
14
- export { mergeFns };
2
+ function e(...r){return(...t)=>{for(const n of r)n&&n(...t)}}export{e as mergeFns};
package/esm/icons.js CHANGED
@@ -1,129 +1,2 @@
1
1
  "use strict";
2
- import { jsx } from '@emotion/react/jsx-runtime';
3
-
4
- "use strict";
5
- function IconTick(props) {
6
- return /* @__PURE__ */ jsx(
7
- "svg",
8
- {
9
- "aria-hidden": true,
10
- fill: "none",
11
- focusable: false,
12
- viewBox: "0 0 24 24",
13
- xmlns: "http://www.w3.org/2000/svg",
14
- ...props,
15
- children: /* @__PURE__ */ jsx(
16
- "path",
17
- {
18
- clipRule: "evenodd",
19
- d: "M21.35 4.27c.68.47.86 1.4.38 2.08l-10 14.5a1.5 1.5 0 0 1-2.33.17l-6.5-7a1.5 1.5 0 0 1 2.2-2.04l5.23 5.63 8.94-12.96a1.5 1.5 0 0 1 2.08-.38Z",
20
- fill: "currentColor",
21
- fillRule: "evenodd"
22
- }
23
- )
24
- }
25
- );
26
- }
27
- function IconTickCircle(props) {
28
- return /* @__PURE__ */ jsx(
29
- "svg",
30
- {
31
- "aria-hidden": true,
32
- fill: "none",
33
- focusable: false,
34
- viewBox: "0 0 24 24",
35
- xmlns: "http://www.w3.org/2000/svg",
36
- ...props,
37
- children: /* @__PURE__ */ jsx(
38
- "path",
39
- {
40
- clipRule: "evenodd",
41
- d: "M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm5.88-13.18-6.2 7.6a1.5 1.5 0 0 1-2.37 0l-3.5-4a1.5 1.5 0 1 1 2.37-1.84l2.3 2.46L15.5 8a1.5 1.5 0 1 1 2.38 1.82Z",
42
- fill: "currentColor",
43
- fillRule: "evenodd"
44
- }
45
- )
46
- }
47
- );
48
- }
49
- function IconInfoCircle(props) {
50
- return /* @__PURE__ */ jsx(
51
- "svg",
52
- {
53
- "aria-hidden": true,
54
- fill: "none",
55
- focusable: false,
56
- viewBox: "0 0 24 24",
57
- xmlns: "http://www.w3.org/2000/svg",
58
- ...props,
59
- children: /* @__PURE__ */ jsx(
60
- "path",
61
- {
62
- clipRule: "evenodd",
63
- d: "M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm2-16a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-5 3.75c0-.41.34-.75.75-.75h2.75a1 1 0 0 1 1 1v5.5h.75a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5h.75v-5h-.75a.75.75 0 0 1-.75-.75Z",
64
- fill: "currentColor",
65
- fillRule: "evenodd"
66
- }
67
- )
68
- }
69
- );
70
- }
71
- function IconAlertCircle(props) {
72
- return /* @__PURE__ */ jsx(
73
- "svg",
74
- {
75
- "aria-hidden": true,
76
- fill: "none",
77
- focusable: false,
78
- viewBox: "0 0 24 24",
79
- xmlns: "http://www.w3.org/2000/svg",
80
- ...props,
81
- children: /* @__PURE__ */ jsx(
82
- "path",
83
- {
84
- clipRule: "evenodd",
85
- d: "M23 12a11 11 0 1 1-22 0 11 11 0 0 1 22 0Zm-9.5 5.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0ZM12 5a1.9 1.9 0 0 0-1.89 2l.3 5.5a1.59 1.59 0 0 0 3.17 0l.3-5.5c.07-1.09-.8-2-1.88-2Z",
86
- fill: "currentColor",
87
- fillRule: "evenodd"
88
- }
89
- )
90
- }
91
- );
92
- }
93
- function IconAlertTriangle(props) {
94
- return /* @__PURE__ */ jsx(
95
- "svg",
96
- {
97
- "aria-hidden": true,
98
- fill: "none",
99
- focusable: false,
100
- viewBox: "0 0 24 24",
101
- xmlns: "http://www.w3.org/2000/svg",
102
- ...props,
103
- children: /* @__PURE__ */ jsx(
104
- "path",
105
- {
106
- clipRule: "evenodd",
107
- d: "m10.23 2.4-8.7 16.67A2 2 0 0 0 3.3 22h17.4a2 2 0 0 0 1.77-2.93L13.77 2.4a2 2 0 0 0-3.54 0ZM13.14 14a1.15 1.15 0 0 1-2.28 0l-.58-4.03a1.73 1.73 0 1 1 3.44 0l-.58 4.03Zm.36 4.49a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z",
108
- fill: "currentColor",
109
- fillRule: "evenodd"
110
- }
111
- )
112
- }
113
- );
114
- }
115
- function IconCheck(props) {
116
- return /* @__PURE__ */ jsx(
117
- "svg",
118
- {
119
- "aria-hidden": true,
120
- focusable: false,
121
- viewBox: "0 0 24 24",
122
- xmlns: "http://www.w3.org/2000/svg",
123
- ...props,
124
- children: /* @__PURE__ */ jsx("path", { d: "M20 6L9 17l-5-5", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2 })
125
- }
126
- );
127
- }
128
-
129
- export { IconAlertCircle, IconAlertTriangle, IconCheck, IconInfoCircle, IconTick, IconTickCircle };
2
+ import{jsx as e}from"@emotion/react/jsx-runtime";function n(l){return e("svg",{"aria-hidden":!0,fill:"none",focusable:!1,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...l,children:e("path",{clipRule:"evenodd",d:"M21.35 4.27c.68.47.86 1.4.38 2.08l-10 14.5a1.5 1.5 0 0 1-2.33.17l-6.5-7a1.5 1.5 0 0 1 2.2-2.04l5.23 5.63 8.94-12.96a1.5 1.5 0 0 1 2.08-.38Z",fill:"currentColor",fillRule:"evenodd"})})}function o(l){return e("svg",{"aria-hidden":!0,fill:"none",focusable:!1,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...l,children:e("path",{clipRule:"evenodd",d:"M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm5.88-13.18-6.2 7.6a1.5 1.5 0 0 1-2.37 0l-3.5-4a1.5 1.5 0 1 1 2.37-1.84l2.3 2.46L15.5 8a1.5 1.5 0 1 1 2.38 1.82Z",fill:"currentColor",fillRule:"evenodd"})})}function r(l){return e("svg",{"aria-hidden":!0,fill:"none",focusable:!1,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...l,children:e("path",{clipRule:"evenodd",d:"M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm2-16a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-5 3.75c0-.41.34-.75.75-.75h2.75a1 1 0 0 1 1 1v5.5h.75a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5h.75v-5h-.75a.75.75 0 0 1-.75-.75Z",fill:"currentColor",fillRule:"evenodd"})})}function i(l){return e("svg",{"aria-hidden":!0,fill:"none",focusable:!1,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...l,children:e("path",{clipRule:"evenodd",d:"M23 12a11 11 0 1 1-22 0 11 11 0 0 1 22 0Zm-9.5 5.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0ZM12 5a1.9 1.9 0 0 0-1.89 2l.3 5.5a1.59 1.59 0 0 0 3.17 0l.3-5.5c.07-1.09-.8-2-1.88-2Z",fill:"currentColor",fillRule:"evenodd"})})}function a(l){return e("svg",{"aria-hidden":!0,fill:"none",focusable:!1,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...l,children:e("path",{clipRule:"evenodd",d:"m10.23 2.4-8.7 16.67A2 2 0 0 0 3.3 22h17.4a2 2 0 0 0 1.77-2.93L13.77 2.4a2 2 0 0 0-3.54 0ZM13.14 14a1.15 1.15 0 0 1-2.28 0l-.58-4.03a1.73 1.73 0 1 1 3.44 0l-.58 4.03Zm.36 4.49a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z",fill:"currentColor",fillRule:"evenodd"})})}function d(l){return e("svg",{"aria-hidden":!0,focusable:!1,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...l,children:e("path",{d:"M20 6L9 17l-5-5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2})})}export{i as IconAlertCircle,a as IconAlertTriangle,d as IconCheck,r as IconInfoCircle,n as IconTick,o as IconTickCircle};
package/esm/id.js CHANGED
@@ -1,12 +1,2 @@
1
1
  "use strict";
2
- import { customAlphabet } from 'nanoid';
3
-
4
- "use strict";
5
- const alphabets = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
6
- const length = 18;
7
- const nanoId = customAlphabet(alphabets, length);
8
- function generateId() {
9
- return nanoId();
10
- }
11
-
12
- export { generateId };
2
+ import{customAlphabet as t}from"nanoid";const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",o=18,r=t(e,o);function n(){return r()}export{n as generateId};
package/esm/index.js CHANGED
@@ -1,32 +1,2 @@
1
1
  "use strict";
2
- export { isValidColor } from './color.js';
3
- export { auditFormScene, colorTypes, creationFormScene, defaultColorTypes, presetFormScenes, semanticColorTypes, updateFormScene } from './constants.js';
4
- export { createSelectableContext } from './context.js';
5
- export { getElementHeight } from './dom.js';
6
- export { VefError } from './error.js';
7
- export { createEventEmitter } from './event.js';
8
- export { compileDynamicFn, isExpression, isFunctionOrExpression } from './expression.js';
9
- export { mergeFns } from './function.js';
10
- export { IconAlertCircle, IconAlertTriangle, IconCheck, IconInfoCircle, IconTick, IconTickCircle } from './icons.js';
11
- export { generateId } from './id.js';
12
- export { isJsonSchemaValid } from './json.js';
13
- export { checkIcon, defaultMessageTitle, errorIcon, infoIcon, showConfirmation, showErrorAlert, showErrorMessage, showErrorNotification, showInfoAlert, showInfoMessage, showInfoNotification, showLoadingMessage, showSuccessAlert, showSuccessMessage, showSuccessNotification, showWarningAlert, showWarningMessage, showWarningNotification, successIcon, warningIcon } from './message.js';
14
- export { extractBaseName, extractDirName, extractExtName, isAbsolutePath, joinPaths, normalizePath } from './path.js';
15
- export { parsePinyin, parsePinyinFirstLetter } from './pinyin.js';
16
- export { decryptRsa, encryptRsa } from './security.js';
17
- export { createComponentStore, createStore, createUnboundStore, useUnboundStore } from './store.js';
18
- export { bmq, breakpoints, styles } from './styles.js';
19
- export { getNowDate, getNowDateString, getTodayString } from './temporal.js';
20
- export { themeVariables } from './theme-variables.js';
21
- import './types.js';
22
- export { buildRouteParentMenusMappings, constantCase, difference, getStringLength, invokeMaybeAsyncFn, isAsyncFunction, isInternalFunction } from './utils.js';
23
- import * as validation from './validation.js';
24
- export { validation as validator };
25
- export { loadYaml } from './yaml.js';
26
- export { initZod } from './zod.js';
27
- export { assign, camel as camelCase, capitalize, clone, cloneDeep, cluster, dash as dashCase, debounce, get, isArray, isBoolean, isDate, isEmpty, isError, isFloat, isFunction, isInt, isIntString, isMap, isNullish, isNumber, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isUndefined, isWeakMap, isWeakSet, max, memo as memoize, min, noop, omit, once, pascal as pascalCase, pick, set, similarity, snake as snakeCase, sum, template, throttle, toFloat, toInt, trim, unique } from 'radashi';
28
- export { default as isDeepEqual } from 'react-fast-compare';
29
- export { shallow as isShallowEqual } from 'zustand/shallow';
30
- export { z } from 'zod';
31
-
32
- "use strict";
2
+ import{isValidColor as s}from"./color.js";import{auditFormScene as a,colorTypes as n,creationFormScene as c,defaultColorTypes as m,presetFormScenes as l,semanticColorTypes as p,updateFormScene as f}from"./constants.js";import{createSelectableContext as u}from"./context.js";import{getElementHeight as h}from"./dom.js";import{VefError as S}from"./error.js";import{createEventEmitter as I}from"./event.js";import{compileDynamicFn as C,isExpression as E,isFunctionOrExpression as b}from"./expression.js";import{mergeFns as M}from"./function.js";import{IconAlertCircle as N,IconAlertTriangle as A,IconCheck as P,IconInfoCircle as T,IconTick as D,IconTickCircle as v}from"./icons.js";import{generateId as q}from"./id.js";import{isJsonSchemaValid as R}from"./json.js";import{checkIcon as j,defaultMessageTitle as L,errorIcon as O,infoIcon as U,showConfirmation as B,showErrorAlert as H,showErrorMessage as J,showErrorNotification as Y,showInfoAlert as Z,showInfoMessage as G,showInfoNotification as K,showLoadingMessage as Q,showSuccessAlert as X,showSuccessMessage as _,showSuccessNotification as $,showWarningAlert as ee,showWarningMessage as oe,showWarningNotification as re,successIcon as te,warningIcon as se}from"./message.js";import{unwrapModule as ae}from"./module.js";import{extractBaseName as ce,extractDirName as me,extractExtName as le,isAbsolutePath as pe,joinPaths as fe,normalizePath as xe}from"./path.js";import{parsePinyin as ge,parsePinyinFirstLetter as he}from"./pinyin.js";import{decryptRsa as Se,encryptRsa as we}from"./security.js";import{createComponentStore as ye,createStore as Ce,createUnboundStore as Ee,useUnboundStore as be}from"./store.js";import{bmq as Me,breakpoints as ke,styles as Ne}from"./styles.js";import{getNowDate as Pe,getNowDateString as Te,getTodayString as De}from"./temporal.js";import{themeVariables as We}from"./theme-variables.js";import"./types.js";import{buildRouteParentMenusMappings as ze,constantCase as Re,difference as Ve,getStringLength as je,invokeMaybeAsyncFn as Le,isAsyncFunction as Oe,isInternalFunction as Ue}from"./utils.js";import*as e from"./validation.js";import{loadYaml as He}from"./yaml.js";import{initZod as Ye}from"./zod.js";import{assign as Ge,camel as Ke,capitalize as Qe,clone as Xe,cloneDeep as _e,cluster as $e,dash as eo,debounce as oo,get as ro,isArray as to,isBoolean as so,isDate as io,isEmpty as ao,isError as no,isFloat as co,isFunction as mo,isInt as lo,isIntString as po,isMap as fo,isNullish as xo,isNumber as uo,isObject as go,isPlainObject as ho,isPrimitive as So,isPromise as wo,isRegExp as Io,isSet as yo,isString as Co,isSymbol as Eo,isUndefined as bo,isWeakMap as Fo,isWeakSet as Mo,max as ko,memo as No,min as Ao,noop as Po,omit as To,once as Do,pascal as vo,pick as Wo,set as qo,similarity as zo,snake as Ro,sum as Vo,template as jo,throttle as Lo,toFloat as Oo,toInt as Uo,trim as Bo,unique as Ho}from"radashi";import{default as Yo}from"react-fast-compare";import{shallow as Go}from"zustand/shallow";import{z as Qo}from"zod";export{N as IconAlertCircle,A as IconAlertTriangle,P as IconCheck,T as IconInfoCircle,D as IconTick,v as IconTickCircle,S as VefError,Ge as assign,a as auditFormScene,Me as bmq,ke as breakpoints,ze as buildRouteParentMenusMappings,Ke as camelCase,Qe as capitalize,j as checkIcon,Xe as clone,_e as cloneDeep,$e as cluster,n as colorTypes,C as compileDynamicFn,Re as constantCase,ye as createComponentStore,I as createEventEmitter,u as createSelectableContext,Ce as createStore,Ee as createUnboundStore,c as creationFormScene,eo as dashCase,oo as debounce,Se as decryptRsa,m as defaultColorTypes,L as defaultMessageTitle,Ve as difference,we as encryptRsa,O as errorIcon,ce as extractBaseName,me as extractDirName,le as extractExtName,q as generateId,ro as get,h as getElementHeight,Pe as getNowDate,Te as getNowDateString,je as getStringLength,De as getTodayString,U as infoIcon,Ye as initZod,Le as invokeMaybeAsyncFn,pe as isAbsolutePath,to as isArray,Oe as isAsyncFunction,so as isBoolean,io as isDate,Yo as isDeepEqual,ao as isEmpty,no as isError,E as isExpression,co as isFloat,mo as isFunction,b as isFunctionOrExpression,lo as isInt,po as isIntString,Ue as isInternalFunction,R as isJsonSchemaValid,fo as isMap,xo as isNullish,uo as isNumber,go as isObject,ho as isPlainObject,So as isPrimitive,wo as isPromise,Io as isRegExp,yo as isSet,Go as isShallowEqual,Co as isString,Eo as isSymbol,bo as isUndefined,s as isValidColor,Fo as isWeakMap,Mo as isWeakSet,fe as joinPaths,He as loadYaml,ko as max,No as memoize,M as mergeFns,Ao as min,Po as noop,xe as normalizePath,To as omit,Do as once,ge as parsePinyin,he as parsePinyinFirstLetter,vo as pascalCase,Wo as pick,l as presetFormScenes,p as semanticColorTypes,qo as set,B as showConfirmation,H as showErrorAlert,J as showErrorMessage,Y as showErrorNotification,Z as showInfoAlert,G as showInfoMessage,K as showInfoNotification,Q as showLoadingMessage,X as showSuccessAlert,_ as showSuccessMessage,$ as showSuccessNotification,ee as showWarningAlert,oe as showWarningMessage,re as showWarningNotification,zo as similarity,Ro as snakeCase,Ne as styles,te as successIcon,Vo as sum,jo as template,We as themeVariables,Lo as throttle,Oo as toFloat,Uo as toInt,Bo as trim,Ho as unique,ae as unwrapModule,f as updateFormScene,be as useUnboundStore,e as validator,se as warningIcon,Qo as z};
package/esm/json.js CHANGED
@@ -1,16 +1,2 @@
1
1
  "use strict";
2
- import Ajv from 'ajv';
3
- import addFormats from 'ajv-formats';
4
-
5
- "use strict";
6
- const ajv = new Ajv({
7
- allErrors: true,
8
- verbose: true,
9
- useDefaults: true
10
- });
11
- addFormats(ajv);
12
- function isJsonSchemaValid(schema) {
13
- return ajv.validateSchema(JSON.parse(schema));
14
- }
15
-
16
- export { isJsonSchemaValid };
2
+ import o from"ajv";import s from"ajv-formats";const r=new o({allErrors:!0,verbose:!0,useDefaults:!0});s(r);function t(e){return r.validateSchema(JSON.parse(e))}export{t as isJsonSchemaValid};
package/esm/message.js CHANGED
@@ -1,282 +1,2 @@
1
1
  "use strict";
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 './utils.js';
7
- import { isFunction } from 'radashi';
8
-
9
- "use strict";
10
- const {
11
- confirm,
12
- info,
13
- success,
14
- warning,
15
- error
16
- } = Modal;
17
- const checkIcon = createElement(Icon, {
18
- component: IconCheck
19
- });
20
- const successIcon = createElement(Icon, {
21
- component: IconTickCircle
22
- });
23
- const infoIcon = createElement(Icon, {
24
- component: IconInfoCircle
25
- });
26
- const warningIcon = createElement(Icon, {
27
- component: IconAlertTriangle
28
- });
29
- const errorIcon = createElement(Icon, {
30
- component: IconAlertCircle
31
- });
32
- const notificationSuccessIcon = createElement(Icon, {
33
- className: "vef-notification-notice-icon vef-notification-notice-icon-success",
34
- component: IconTickCircle
35
- });
36
- const notificationInfoIcon = createElement(Icon, {
37
- className: "vef-notification-notice-icon vef-notification-notice-icon-info",
38
- component: IconInfoCircle
39
- });
40
- const notificationWarningIcon = createElement(Icon, {
41
- className: "vef-notification-notice-icon vef-notification-notice-icon-warning",
42
- component: IconAlertTriangle
43
- });
44
- const notificationErrorIcon = createElement(Icon, {
45
- className: "vef-notification-notice-icon vef-notification-notice-icon-error",
46
- component: IconAlertCircle
47
- });
48
- function showSuccessMessage(content) {
49
- message.open({
50
- type: "success",
51
- content,
52
- duration: 2,
53
- icon: successIcon
54
- });
55
- }
56
- function showInfoMessage(content) {
57
- message.open({
58
- type: "info",
59
- content,
60
- duration: 3,
61
- icon: infoIcon
62
- });
63
- }
64
- function showWarningMessage(content) {
65
- message.open({
66
- type: "warning",
67
- content,
68
- duration: 3,
69
- icon: warningIcon
70
- });
71
- }
72
- function showErrorMessage(content) {
73
- message.open({
74
- type: "error",
75
- content,
76
- duration: 4,
77
- icon: errorIcon
78
- });
79
- }
80
- function showLoadingMessage(content) {
81
- const close = message.open({
82
- type: "loading",
83
- content,
84
- duration: 0
85
- });
86
- return () => close();
87
- }
88
- const defaultMessageTitle = "提示";
89
- function showSuccessNotification(titleOrContent, content, buttons) {
90
- const argsLength = arguments.length;
91
- if (argsLength < 1) {
92
- throw new Error("showSuccessNotification requires at least one argument");
93
- }
94
- const titleToUse = argsLength > 1 ? titleOrContent : defaultMessageTitle;
95
- const contentToUse = argsLength > 1 ? content : titleOrContent;
96
- const buttonsToUse = argsLength === 3 ? buttons : void 0;
97
- notification.open({
98
- type: "success",
99
- message: titleToUse,
100
- description: contentToUse,
101
- duration: 4,
102
- closable: true,
103
- btn: buttonsToUse,
104
- icon: notificationSuccessIcon
105
- });
106
- }
107
- function showInfoNotification(titleOrContent, content, buttons) {
108
- const argsLength = arguments.length;
109
- if (argsLength < 1) {
110
- throw new Error("showInfoNotification requires at least one argument");
111
- }
112
- const titleToUse = argsLength > 1 ? titleOrContent : defaultMessageTitle;
113
- const contentToUse = argsLength > 1 ? content : titleOrContent;
114
- const buttonsToUse = argsLength === 3 ? buttons : void 0;
115
- notification.open({
116
- type: "info",
117
- message: titleToUse,
118
- description: contentToUse,
119
- duration: 5,
120
- closable: true,
121
- btn: buttonsToUse,
122
- icon: notificationInfoIcon
123
- });
124
- }
125
- function showWarningNotification(titleOrContent, content, buttons) {
126
- const argsLength = arguments.length;
127
- if (argsLength < 1) {
128
- throw new Error("showWarningNotification requires at least one argument");
129
- }
130
- const titleToUse = argsLength > 1 ? titleOrContent : defaultMessageTitle;
131
- const contentToUse = argsLength > 1 ? content : titleOrContent;
132
- const buttonsToUse = argsLength === 3 ? buttons : void 0;
133
- notification.open({
134
- type: "warning",
135
- message: titleToUse,
136
- description: contentToUse,
137
- duration: 6,
138
- closable: true,
139
- btn: buttonsToUse,
140
- icon: notificationWarningIcon
141
- });
142
- }
143
- function showErrorNotification(titleOrContent, content, buttons) {
144
- const argsLength = arguments.length;
145
- if (argsLength < 1) {
146
- throw new Error("showErrorNotification requires at least one argument");
147
- }
148
- const titleToUse = argsLength > 1 ? titleOrContent : defaultMessageTitle;
149
- const contentToUse = argsLength > 1 ? content : titleOrContent;
150
- const buttonsToUse = argsLength === 3 ? buttons : void 0;
151
- notification.open({
152
- type: "error",
153
- message: titleToUse,
154
- description: contentToUse,
155
- duration: 10,
156
- closable: true,
157
- btn: buttonsToUse,
158
- icon: notificationErrorIcon
159
- });
160
- }
161
- const cancelButtonProps = {
162
- color: "default",
163
- variant: "text"
164
- };
165
- const okButtonProps = {
166
- icon: checkIcon
167
- };
168
- function showConfirmation(title, content, onOk, options) {
169
- const argsLength = arguments.length;
170
- if (argsLength < 2) {
171
- throw new Error("showConfirmation requires at least two arguments");
172
- }
173
- const titleToUse = argsLength > 2 ? title : "提示";
174
- const contentToUse = argsLength === 2 ? title : content;
175
- const onOkToUse = argsLength === 2 ? content : onOk;
176
- const {
177
- okText,
178
- cancelText,
179
- onCancel,
180
- onAfterOpen,
181
- onAfterClose
182
- } = options ?? {};
183
- const { destroy } = confirm({
184
- title: titleToUse,
185
- content: contentToUse,
186
- cancelButtonProps,
187
- okButtonProps,
188
- centered: true,
189
- onOk: onOkToUse,
190
- okText,
191
- cancelText,
192
- onCancel,
193
- afterOpenChange: isFunction(onAfterOpen) || isFunction(onAfterClose) ? (open) => {
194
- if (open) {
195
- onAfterOpen?.();
196
- } else {
197
- onAfterClose?.();
198
- }
199
- } : void 0
200
- });
201
- return destroy;
202
- }
203
- const alertFnMap = {
204
- success,
205
- info,
206
- warning,
207
- error
208
- };
209
- const alertIconMap = {
210
- success: successIcon,
211
- info: infoIcon,
212
- warning: warningIcon,
213
- error: errorIcon
214
- };
215
- const defaultOkText = "👍🏻 好的,知道了";
216
- function showAlert(type, content, title = defaultMessageTitle, onOk, options) {
217
- const {
218
- okText = defaultOkText,
219
- onCancel,
220
- onAfterOpen,
221
- onAfterClose
222
- } = options ?? {};
223
- const { destroy } = alertFnMap[type]({
224
- title,
225
- content,
226
- icon: alertIconMap[type],
227
- centered: true,
228
- onOk,
229
- okText,
230
- onCancel,
231
- afterOpenChange: isFunction(onAfterOpen) || isFunction(onAfterClose) ? (open) => {
232
- if (open) {
233
- onAfterOpen?.();
234
- } else {
235
- onAfterClose?.();
236
- }
237
- } : void 0
238
- });
239
- return destroy;
240
- }
241
- function showSuccessAlert(title, content, onOk, options) {
242
- const argsLength = arguments.length;
243
- if (argsLength < 1) {
244
- throw new Error("showSuccessAlert requires at least one argument");
245
- }
246
- const titleToUse = argsLength === 1 || isFunction(content) ? void 0 : title;
247
- const contentToUse = argsLength === 1 || isFunction(content) ? title : content;
248
- const onOkToUse = argsLength === 2 || isFunction(content) ? content : onOk;
249
- return showAlert("success", contentToUse, titleToUse, onOkToUse, options);
250
- }
251
- function showInfoAlert(title, content, onOk, options) {
252
- const argsLength = arguments.length;
253
- if (argsLength < 1) {
254
- throw new Error("showInfoAlert requires at least one argument");
255
- }
256
- const titleToUse = argsLength === 1 || isFunction(content) ? void 0 : title;
257
- const contentToUse = argsLength === 1 || isFunction(content) ? title : content;
258
- const onOkToUse = argsLength === 2 || isFunction(content) ? content : onOk;
259
- return showAlert("info", contentToUse, titleToUse, onOkToUse, options);
260
- }
261
- function showWarningAlert(title, content, onOk, options) {
262
- const argsLength = arguments.length;
263
- if (argsLength < 1) {
264
- throw new Error("showWarningAlert requires at least one argument");
265
- }
266
- const titleToUse = argsLength === 1 || isFunction(content) ? void 0 : title;
267
- const contentToUse = argsLength === 1 || isFunction(content) ? title : content;
268
- const onOkToUse = argsLength === 2 || isFunction(content) ? content : onOk;
269
- return showAlert("warning", contentToUse, titleToUse, onOkToUse, options);
270
- }
271
- function showErrorAlert(title, content, onOk, options) {
272
- const argsLength = arguments.length;
273
- if (argsLength < 1) {
274
- throw new Error("showErrorAlert requires at least one argument");
275
- }
276
- const titleToUse = argsLength === 1 || isFunction(content) ? void 0 : title;
277
- const contentToUse = argsLength === 1 || isFunction(content) ? title : content;
278
- const onOkToUse = argsLength === 2 || isFunction(content) ? content : onOk;
279
- return showAlert("error", contentToUse, titleToUse, onOkToUse, options);
280
- }
281
-
282
- export { checkIcon, defaultMessageTitle, errorIcon, infoIcon, showConfirmation, showErrorAlert, showErrorMessage, showErrorNotification, showInfoAlert, showInfoMessage, showInfoNotification, showLoadingMessage, showSuccessAlert, showSuccessMessage, showSuccessNotification, showWarningAlert, showWarningMessage, showWarningNotification, successIcon, warningIcon };
2
+ import f from"@ant-design/icons";import{Modal as O,message as g,notification as w}from"antd";import{createElement as u}from"react";import{IconCheck as S,IconTickCircle as k,IconInfoCircle as y,IconAlertTriangle as q,IconAlertCircle as T}from"./icons.js";import"./utils.js";import{isFunction as s}from"radashi";const{confirm:W,info:B,success:F,warning:L,error:P}=O,b=u(f,{component:S}),v=u(f,{component:k}),I=u(f,{component:y}),E=u(f,{component:q}),C=u(f,{component:T}),R=u(f,{className:"vef-notification-notice-icon vef-notification-notice-icon-success",component:k}),H=u(f,{className:"vef-notification-notice-icon vef-notification-notice-icon-info",component:y}),U=u(f,{className:"vef-notification-notice-icon vef-notification-notice-icon-warning",component:q}),j=u(f,{className:"vef-notification-notice-icon vef-notification-notice-icon-error",component:T});function z(n){g.open({type:"success",content:n,duration:2,icon:v})}function D(n){g.open({type:"info",content:n,duration:3,icon:I})}function G(n){g.open({type:"warning",content:n,duration:3,icon:E})}function J(n){g.open({type:"error",content:n,duration:4,icon:C})}function K(n){const o=g.open({type:"loading",content:n,duration:0});return()=>o()}const l="提示";function Q(n,o,r){const e=arguments.length;if(e<1)throw new Error("showSuccessNotification requires at least one argument");const t=e>1?n:l,i=e>1?o:n,c=e===3?r:void 0;w.open({type:"success",message:t,description:i,duration:4,closable:!0,btn:c,icon:R})}function V(n,o,r){const e=arguments.length;if(e<1)throw new Error("showInfoNotification requires at least one argument");const t=e>1?n:l,i=e>1?o:n,c=e===3?r:void 0;w.open({type:"info",message:t,description:i,duration:5,closable:!0,btn:c,icon:H})}function X(n,o,r){const e=arguments.length;if(e<1)throw new Error("showWarningNotification requires at least one argument");const t=e>1?n:l,i=e>1?o:n,c=e===3?r:void 0;w.open({type:"warning",message:t,description:i,duration:6,closable:!0,btn:c,icon:U})}function Y(n,o,r){const e=arguments.length;if(e<1)throw new Error("showErrorNotification requires at least one argument");const t=e>1?n:l,i=e>1?o:n,c=e===3?r:void 0;w.open({type:"error",message:t,description:i,duration:10,closable:!0,btn:c,icon:j})}const Z={color:"default",variant:"text"},_={icon:b};function $(n,o,r,e){const t=arguments.length;if(t<2)throw new Error("showConfirmation requires at least two arguments");const i=t>2?n:"提示",c=t===2?n:o,a=t===2?o:r,{okText:m,cancelText:p,onCancel:d,onAfterOpen:A,onAfterClose:N}=e??{},{destroy:x}=W({title:i,content:c,cancelButtonProps:Z,okButtonProps:_,centered:!0,onOk:a,okText:m,cancelText:p,onCancel:d,afterOpenChange:s(A)||s(N)?M=>{M?A?.():N?.()}:void 0});return x}const nn={success:F,info:B,warning:L,error:P},on={success:v,info:I,warning:E,error:C},tn="👍🏻 好的,知道了";function h(n,o,r=l,e,t){const{okText:i=tn,onCancel:c,onAfterOpen:a,onAfterClose:m}=t??{},{destroy:p}=nn[n]({title:r,content:o,icon:on[n],centered:!0,onOk:e,okText:i,onCancel:c,afterOpenChange:s(a)||s(m)?d=>{d?a?.():m?.()}:void 0});return p}function en(n,o,r,e){const t=arguments.length;if(t<1)throw new Error("showSuccessAlert requires at least one argument");const i=t===1||s(o)?void 0:n,c=t===1||s(o)?n:o,a=t===2||s(o)?o:r;return h("success",c,i,a,e)}function rn(n,o,r,e){const t=arguments.length;if(t<1)throw new Error("showInfoAlert requires at least one argument");const i=t===1||s(o)?void 0:n,c=t===1||s(o)?n:o,a=t===2||s(o)?o:r;return h("info",c,i,a,e)}function cn(n,o,r,e){const t=arguments.length;if(t<1)throw new Error("showWarningAlert requires at least one argument");const i=t===1||s(o)?void 0:n,c=t===1||s(o)?n:o,a=t===2||s(o)?o:r;return h("warning",c,i,a,e)}function sn(n,o,r,e){const t=arguments.length;if(t<1)throw new Error("showErrorAlert requires at least one argument");const i=t===1||s(o)?void 0:n,c=t===1||s(o)?n:o,a=t===2||s(o)?o:r;return h("error",c,i,a,e)}export{b as checkIcon,l as defaultMessageTitle,C as errorIcon,I as infoIcon,$ as showConfirmation,sn as showErrorAlert,J as showErrorMessage,Y as showErrorNotification,rn as showInfoAlert,D as showInfoMessage,V as showInfoNotification,K as showLoadingMessage,en as showSuccessAlert,z as showSuccessMessage,Q as showSuccessNotification,cn as showWarningAlert,G as showWarningMessage,X as showWarningNotification,v as successIcon,E as warningIcon};
package/esm/module.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ const u="__esModule",n="default";function e(t){return Reflect.has(t,u)?e(Reflect.get(t,n)):t}export{e as unwrapModule};
package/esm/path.js CHANGED
@@ -1,33 +1,2 @@
1
1
  "use strict";
2
- import path from 'path-browserify';
3
-
4
- "use strict";
5
- const {
6
- basename,
7
- dirname,
8
- extname,
9
- isAbsolute,
10
- join,
11
- normalize
12
- } = path;
13
- function extractBaseName(path2, keepExt = true) {
14
- const ext = keepExt ? void 0 : extname(path2);
15
- return basename(path2, ext);
16
- }
17
- function extractExtName(path2) {
18
- return extname(path2);
19
- }
20
- function extractDirName(path2) {
21
- return dirname(path2);
22
- }
23
- function joinPaths(...paths) {
24
- return join(...paths);
25
- }
26
- function isAbsolutePath(path2) {
27
- return isAbsolute(path2);
28
- }
29
- function normalizePath(path2) {
30
- return normalize(path2);
31
- }
32
-
33
- export { extractBaseName, extractDirName, extractExtName, isAbsolutePath, joinPaths, normalizePath };
2
+ import o from"path-browserify";const{basename:i,dirname:a,extname:n,isAbsolute:u,join:c,normalize:s}=o;function m(t,e=!0){const r=e?void 0:n(t);return i(t,r)}function f(t){return n(t)}function x(t){return a(t)}function l(...t){return c(...t)}function b(t){return u(t)}function h(t){return s(t)}export{m as extractBaseName,x as extractDirName,f as extractExtName,b as isAbsolutePath,l as joinPaths,h as normalizePath};
package/esm/pinyin.js CHANGED
@@ -1,30 +1,2 @@
1
1
  "use strict";
2
- import { pinyin } from 'pinyin-pro';
3
-
4
- "use strict";
5
- function parsePinyin(text) {
6
- return pinyin(
7
- text,
8
- {
9
- pattern: "pinyin",
10
- toneType: "none",
11
- type: "array",
12
- mode: "normal",
13
- nonZh: "consecutive"
14
- }
15
- );
16
- }
17
- function parsePinyinFirstLetter(text) {
18
- return pinyin(
19
- text,
20
- {
21
- pattern: "first",
22
- toneType: "none",
23
- type: "array",
24
- mode: "normal",
25
- nonZh: "consecutive"
26
- }
27
- );
28
- }
29
-
30
- export { parsePinyin, parsePinyinFirstLetter };
2
+ import{pinyin as e}from"pinyin-pro";function t(n){return e(n,{pattern:"pinyin",toneType:"none",type:"array",mode:"normal",nonZh:"consecutive"})}function r(n){return e(n,{pattern:"first",toneType:"none",type:"array",mode:"normal",nonZh:"consecutive"})}export{t as parsePinyin,r as parsePinyinFirstLetter};