@robot-admin/naive-ui-components 0.11.7 → 0.12.1

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 (185) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +146 -29
  3. package/README_EN.md +146 -29
  4. package/SECURITY.md +1 -0
  5. package/dist/C_ActionBar.cjs +1 -1
  6. package/dist/C_ActionBar.css +53 -53
  7. package/dist/C_ActionBar.d.cts +2 -2
  8. package/dist/C_ActionBar.d.ts +2 -2
  9. package/dist/C_ActionBar.js +1 -1
  10. package/dist/C_ActionBar2.cjs +1 -1
  11. package/dist/C_ActionBar2.js +1 -1
  12. package/dist/C_AntV.css +67 -67
  13. package/dist/C_AntV2.cjs +3 -3
  14. package/dist/C_AntV2.js +3 -3
  15. package/dist/C_AudioPlayer.d.cts +1 -1
  16. package/dist/C_AudioPlayer.d.ts +1 -1
  17. package/dist/C_AvatarGroup.d.cts +1 -1
  18. package/dist/C_AvatarGroup.d.ts +1 -1
  19. package/dist/C_Barcode.d.cts +1 -1
  20. package/dist/C_Barcode.d.ts +1 -1
  21. package/dist/C_Breadcrumb.d.cts +1 -1
  22. package/dist/C_Breadcrumb.d.ts +1 -1
  23. package/dist/C_Captcha.cjs +1 -1
  24. package/dist/C_Captcha.css +193 -51
  25. package/dist/C_Captcha.d.cts +2 -3
  26. package/dist/C_Captcha.d.ts +2 -3
  27. package/dist/C_Captcha.js +1 -1
  28. package/dist/C_Captcha2.cjs +1 -1
  29. package/dist/C_Captcha2.js +1 -1
  30. package/dist/C_Cascade.d.cts +1 -1
  31. package/dist/C_Cascade.d.ts +1 -1
  32. package/dist/C_Chat.d.cts +1 -1
  33. package/dist/C_Chat.d.ts +1 -1
  34. package/dist/C_City.d.cts +1 -1
  35. package/dist/C_City.d.ts +1 -1
  36. package/dist/C_Code.d.cts +1 -1
  37. package/dist/C_Code.d.ts +1 -1
  38. package/dist/C_ContextMenu.d.cts +1 -1
  39. package/dist/C_ContextMenu.d.ts +1 -1
  40. package/dist/C_Date.d.cts +1 -1
  41. package/dist/C_Date.d.ts +1 -1
  42. package/dist/C_Editor.d.cts +1 -1
  43. package/dist/C_Editor.d.ts +1 -1
  44. package/dist/C_FormModal.cjs +1 -0
  45. package/dist/C_FormModal.css +41 -0
  46. package/dist/C_FormModal.d.cts +2 -0
  47. package/dist/C_FormModal.d.ts +3 -0
  48. package/dist/C_FormModal.js +1 -0
  49. package/dist/C_FormModal2.cjs +1 -0
  50. package/dist/C_FormModal2.js +1 -0
  51. package/dist/C_Login.css +210 -127
  52. package/dist/C_Login2.cjs +1 -1
  53. package/dist/C_Login2.js +1 -1
  54. package/dist/C_Map.css +3 -3
  55. package/dist/C_Map2.cjs +1 -1
  56. package/dist/C_Map2.js +1 -1
  57. package/dist/C_Menu.d.cts +1 -1
  58. package/dist/C_Table.base.css +86 -86
  59. package/dist/C_Table.cjs +1 -1
  60. package/dist/C_Table.css +86 -86
  61. package/dist/C_Table.d.ts +4 -3
  62. package/dist/C_Table.js +1 -1
  63. package/dist/C_Tabs.cjs +1 -0
  64. package/dist/C_Tabs.css +1 -0
  65. package/dist/C_Tabs.d.cts +2 -0
  66. package/dist/C_Tabs.d.ts +2 -0
  67. package/dist/C_Tabs.js +1 -0
  68. package/dist/C_TagsView.css +38 -38
  69. package/dist/C_TagsView2.cjs +1 -1
  70. package/dist/C_TagsView2.js +1 -1
  71. package/dist/C_VtableGantt.css +19 -19
  72. package/dist/C_VtableGantt2.cjs +1 -1
  73. package/dist/C_VtableGantt2.js +1 -1
  74. package/dist/constants.d.cts +2 -2
  75. package/dist/constants.d.ts +2 -2
  76. package/dist/constants2.d.cts +2 -2
  77. package/dist/constants2.d.ts +2 -2
  78. package/dist/constants3.d.cts +2 -2
  79. package/dist/constants3.d.ts +2 -2
  80. package/dist/constants4.d.cts +4 -4
  81. package/dist/constants4.d.ts +4 -4
  82. package/dist/constants5.d.cts +2 -2
  83. package/dist/constants5.d.ts +2 -2
  84. package/dist/data.d.cts +108 -0
  85. package/dist/data.d.ts +108 -0
  86. package/dist/data2.cjs +1 -0
  87. package/dist/data2.js +1 -0
  88. package/dist/index.cjs +1 -1
  89. package/dist/index.d.cts +49 -48
  90. package/dist/index.d.ts +51 -49
  91. package/dist/index.js +1 -1
  92. package/dist/index.vue.d.cts +72 -69
  93. package/dist/index.vue.d.ts +72 -69
  94. package/dist/index10.vue.d.cts +80 -39
  95. package/dist/index10.vue.d.ts +68 -77
  96. package/dist/index11.vue.d.cts +68 -77
  97. package/dist/index11.vue.d.ts +53 -68
  98. package/dist/index12.vue.d.cts +53 -68
  99. package/dist/index12.vue.d.ts +52 -58
  100. package/dist/index13.vue.d.cts +52 -58
  101. package/dist/index13.vue.d.ts +3 -3
  102. package/dist/index14.vue.d.cts +3 -3
  103. package/dist/index14.vue.d.ts +5 -5
  104. package/dist/index15.vue.d.cts +5 -5
  105. package/dist/index15.vue.d.ts +2 -2
  106. package/dist/index16.vue.d.cts +2 -2
  107. package/dist/index16.vue.d.ts +14 -11
  108. package/dist/index17.vue.d.cts +14 -11
  109. package/dist/index17.vue.d.ts +4 -4
  110. package/dist/index18.vue.d.cts +4 -4
  111. package/dist/index18.vue.d.ts +3 -3
  112. package/dist/index19.vue.d.cts +2 -2
  113. package/dist/index19.vue.d.ts +2 -2
  114. package/dist/index2.vue.d.cts +70 -65
  115. package/dist/index2.vue.d.ts +70 -65
  116. package/dist/index20.vue.d.cts +1 -1
  117. package/dist/index20.vue.d.ts +1 -1
  118. package/dist/index21.vue.d.cts +2 -2
  119. package/dist/index21.vue.d.ts +2 -2
  120. package/dist/index22.vue.d.cts +1 -1
  121. package/dist/index22.vue.d.ts +1 -1
  122. package/dist/index24.vue.d.cts +2 -2
  123. package/dist/index24.vue.d.ts +2 -2
  124. package/dist/index25.vue.d.cts +1 -1
  125. package/dist/index25.vue.d.ts +1 -1
  126. package/dist/index27.vue.d.cts +2 -2
  127. package/dist/index27.vue.d.ts +2 -2
  128. package/dist/index3.vue.d.cts +30 -80
  129. package/dist/index3.vue.d.ts +30 -80
  130. package/dist/index4.vue.d.cts +130 -30
  131. package/dist/index4.vue.d.ts +22 -30
  132. package/dist/index5.vue.d.cts +18 -126
  133. package/dist/index5.vue.d.ts +22 -19
  134. package/dist/index6.vue.d.cts +22 -19
  135. package/dist/index6.vue.d.ts +117 -22
  136. package/dist/index7.vue.d.cts +117 -22
  137. package/dist/index7.vue.d.ts +17 -110
  138. package/dist/index8.vue.d.cts +17 -110
  139. package/dist/index8.vue.d.ts +37 -24
  140. package/dist/index9.vue.d.cts +37 -24
  141. package/dist/index9.vue.d.ts +80 -39
  142. package/dist/mapUtils.d.cts +4 -4
  143. package/dist/mapUtils.d.ts +4 -4
  144. package/dist/presets.d.cts +96 -0
  145. package/dist/presets.d.ts +96 -0
  146. package/dist/resolver.cjs +1 -1
  147. package/dist/resolver.d.cts +1 -1
  148. package/dist/resolver.d.ts +1 -1
  149. package/dist/resolver.js +1 -1
  150. package/dist/style.css +520 -393
  151. package/dist/useCalendarEvents.d.cts +1 -1
  152. package/dist/useCalendarEvents.d.ts +1 -1
  153. package/dist/useCollapsePanel.d.cts +8 -8
  154. package/dist/useCollapsePanel.d.ts +8 -8
  155. package/dist/useCropperCore.d.cts +9 -9
  156. package/dist/useCropperCore.d.ts +9 -9
  157. package/dist/useDraggableLayout.d.cts +2 -2
  158. package/dist/useDraggableLayout.d.ts +2 -2
  159. package/dist/useEdgeInteraction.d.cts +3 -2
  160. package/dist/useEdgeInteraction.d.ts +3 -2
  161. package/dist/useInfiniteScroll.d.cts +1 -1
  162. package/dist/useInfiniteScroll.d.ts +1 -1
  163. package/dist/useQRCode.d.cts +4 -4
  164. package/dist/useQRCode.d.ts +4 -4
  165. package/dist/useSearchState.d.cts +6 -6
  166. package/dist/useSearchState.d.ts +6 -6
  167. package/dist/useSignatureHistory.d.cts +4 -4
  168. package/dist/useSignatureHistory.d.ts +4 -4
  169. package/dist/useSplitResize.d.cts +6 -6
  170. package/dist/useSplitResize.d.ts +6 -6
  171. package/dist/useTableQuery.cjs +3 -3
  172. package/dist/useTableQuery.d.cts +10 -0
  173. package/dist/useTableQuery.d.ts +10 -0
  174. package/dist/useTableQuery.js +3 -3
  175. package/dist/useTimeSelection.d.cts +5 -5
  176. package/dist/useTimeSelection.d.ts +5 -5
  177. package/dist/useTreeOperations.d.cts +8 -8
  178. package/dist/useTreeOperations.d.ts +8 -8
  179. package/dist/useWorkflowValidation.d.cts +4 -4
  180. package/dist/useWorkflowValidation.d.ts +4 -4
  181. package/dist/verification.d.cts +70 -5
  182. package/dist/verification.d.ts +70 -5
  183. package/package.json +2 -1
  184. package/dist/types.d.ts +0 -58
  185. package/dist/types2.d.cts +0 -58
@@ -1,6 +1,68 @@
1
- import { a as CaptchaSuccessPayload, c as CaptchaVerifier, i as CaptchaProps, r as CaptchaProof } from "./types2.cjs";
1
+ import { i as ComponentLocale, r as ComponentFeedback } from "./config.cjs";
2
2
  import * as vue from "vue";
3
3
 
4
+ //#region src/components/C_Captcha/types.d.ts
5
+ interface CaptchaProof {
6
+ /** Client correlation value only; servers must never trust it as proof. */
7
+ token: string;
8
+ /** Client clock value only; servers must never use it as freshness proof. */
9
+ timestamp: number;
10
+ type: CaptchaProvider;
11
+ }
12
+ /** Built-in challenge renderers. ALTCHA requires application-server verification. */
13
+ type CaptchaProvider = 'puzzle-captcha' | 'altcha';
14
+ interface CaptchaVerificationRequest extends CaptchaProof {
15
+ /** Cancels superseded, reset, unmounted, or timed-out verification. */
16
+ signal: AbortSignal;
17
+ }
18
+ interface CaptchaVerificationResult {
19
+ valid: boolean;
20
+ /** Prefer a short-lived, single-use token issued by the application server. */
21
+ token?: string;
22
+ message?: string;
23
+ }
24
+ type CaptchaVerifier = (request: CaptchaVerificationRequest) => boolean | CaptchaVerificationResult | Promise<boolean | CaptchaVerificationResult>;
25
+ interface CaptchaSuccessPayload extends CaptchaProof {
26
+ verifiedBy: 'local' | 'server';
27
+ }
28
+ interface CaptchaProps {
29
+ /** Challenge renderer. The default puzzle mode remains backward compatible. */
30
+ provider?: CaptchaProvider;
31
+ /** Same-origin endpoint that issues a fresh ALTCHA challenge. */
32
+ challengeUrl?: string;
33
+ triggerText?: string;
34
+ images?: string[];
35
+ disabled?: boolean;
36
+ theme?: 'light' | 'dark';
37
+ /**
38
+ * Application-owned verification adapter. It must validate an independent,
39
+ * server/provider-issued challenge; client token/timestamp are telemetry only.
40
+ */
41
+ verifier?: CaptchaVerifier;
42
+ /** Maximum time for `verifier`, in milliseconds. */
43
+ verificationTimeout?: number;
44
+ /** Fail closed when no server verifier is configured. */
45
+ requireServerVerification?: boolean;
46
+ feedback?: ComponentFeedback;
47
+ locale?: ComponentLocale;
48
+ }
49
+ interface CaptchaEmits {
50
+ (event: 'success', data: CaptchaSuccessPayload): void;
51
+ (event: 'fail', error: string): void;
52
+ (event: 'verify-error', error: unknown): void;
53
+ (event: 'load-error', error: unknown): void;
54
+ (event: 'change', valid: boolean): void;
55
+ (event: 'visible-change', visible: boolean): void;
56
+ (event: 'reset'): void;
57
+ }
58
+ interface CaptchaInstance {
59
+ validate: () => boolean;
60
+ getToken: () => string;
61
+ getVerificationData: () => CaptchaSuccessPayload | null;
62
+ reset: () => void;
63
+ show: () => void;
64
+ }
65
+ //#endregion
4
66
  //#region src/components/C_Captcha/index.vue.d.ts
5
67
  declare const __VLS_export: vue.DefineComponent<CaptchaProps, {
6
68
  validate: () => boolean;
@@ -9,27 +71,30 @@ declare const __VLS_export: vue.DefineComponent<CaptchaProps, {
9
71
  verifiedBy: "local" | "server";
10
72
  token: string;
11
73
  timestamp: number;
12
- type: "puzzle-captcha";
74
+ type: CaptchaProvider;
13
75
  } | null;
14
76
  reset: () => void;
15
77
  show: () => void;
16
78
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
17
79
  change: (valid: boolean) => any;
18
- reset: () => any;
19
80
  success: (data: CaptchaSuccessPayload) => any;
81
+ reset: () => any;
20
82
  fail: (error: string) => any;
21
83
  "verify-error": (error: unknown) => any;
22
84
  "load-error": (error: unknown) => any;
85
+ "visible-change": (visible: boolean) => any;
23
86
  }, string, vue.PublicProps, Readonly<CaptchaProps> & Readonly<{
24
87
  onChange?: ((valid: boolean) => any) | undefined;
25
- onReset?: (() => any) | undefined;
26
88
  onSuccess?: ((data: CaptchaSuccessPayload) => any) | undefined;
89
+ onReset?: (() => any) | undefined;
27
90
  onFail?: ((error: string) => any) | undefined;
28
91
  "onVerify-error"?: ((error: unknown) => any) | undefined;
29
92
  "onLoad-error"?: ((error: unknown) => any) | undefined;
93
+ "onVisible-change"?: ((visible: boolean) => any) | undefined;
30
94
  }>, {
31
95
  theme: "light" | "dark";
32
96
  disabled: boolean;
97
+ provider: CaptchaProvider;
33
98
  images: string[];
34
99
  verificationTimeout: number;
35
100
  requireServerVerification: boolean;
@@ -55,4 +120,4 @@ interface VerifyCaptchaProofOptions {
55
120
  /** Normalize local/server verification with cancellation and a hard timeout. */
56
121
  declare function verifyCaptchaProof(proof: CaptchaProof, options?: VerifyCaptchaProofOptions): Promise<CaptchaSuccessPayload>;
57
122
  //#endregion
58
- export { _default as i, createCaptchaProof as n, verifyCaptchaProof as r, CaptchaVerificationError as t };
123
+ export { CaptchaEmits as a, CaptchaProps as c, CaptchaVerificationRequest as d, CaptchaVerificationResult as f, _default as i, CaptchaProvider as l, createCaptchaProof as n, CaptchaInstance as o, CaptchaVerifier as p, verifyCaptchaProof as r, CaptchaProof as s, CaptchaVerificationError as t, CaptchaSuccessPayload as u };
@@ -1,6 +1,68 @@
1
- import { a as CaptchaSuccessPayload, c as CaptchaVerifier, i as CaptchaProps, r as CaptchaProof } from "./types.js";
1
+ import { i as ComponentLocale, r as ComponentFeedback } from "./config.js";
2
2
  import * as vue from "vue";
3
3
 
4
+ //#region src/components/C_Captcha/types.d.ts
5
+ interface CaptchaProof {
6
+ /** Client correlation value only; servers must never trust it as proof. */
7
+ token: string;
8
+ /** Client clock value only; servers must never use it as freshness proof. */
9
+ timestamp: number;
10
+ type: CaptchaProvider;
11
+ }
12
+ /** Built-in challenge renderers. ALTCHA requires application-server verification. */
13
+ type CaptchaProvider = 'puzzle-captcha' | 'altcha';
14
+ interface CaptchaVerificationRequest extends CaptchaProof {
15
+ /** Cancels superseded, reset, unmounted, or timed-out verification. */
16
+ signal: AbortSignal;
17
+ }
18
+ interface CaptchaVerificationResult {
19
+ valid: boolean;
20
+ /** Prefer a short-lived, single-use token issued by the application server. */
21
+ token?: string;
22
+ message?: string;
23
+ }
24
+ type CaptchaVerifier = (request: CaptchaVerificationRequest) => boolean | CaptchaVerificationResult | Promise<boolean | CaptchaVerificationResult>;
25
+ interface CaptchaSuccessPayload extends CaptchaProof {
26
+ verifiedBy: 'local' | 'server';
27
+ }
28
+ interface CaptchaProps {
29
+ /** Challenge renderer. The default puzzle mode remains backward compatible. */
30
+ provider?: CaptchaProvider;
31
+ /** Same-origin endpoint that issues a fresh ALTCHA challenge. */
32
+ challengeUrl?: string;
33
+ triggerText?: string;
34
+ images?: string[];
35
+ disabled?: boolean;
36
+ theme?: 'light' | 'dark';
37
+ /**
38
+ * Application-owned verification adapter. It must validate an independent,
39
+ * server/provider-issued challenge; client token/timestamp are telemetry only.
40
+ */
41
+ verifier?: CaptchaVerifier;
42
+ /** Maximum time for `verifier`, in milliseconds. */
43
+ verificationTimeout?: number;
44
+ /** Fail closed when no server verifier is configured. */
45
+ requireServerVerification?: boolean;
46
+ feedback?: ComponentFeedback;
47
+ locale?: ComponentLocale;
48
+ }
49
+ interface CaptchaEmits {
50
+ (event: 'success', data: CaptchaSuccessPayload): void;
51
+ (event: 'fail', error: string): void;
52
+ (event: 'verify-error', error: unknown): void;
53
+ (event: 'load-error', error: unknown): void;
54
+ (event: 'change', valid: boolean): void;
55
+ (event: 'visible-change', visible: boolean): void;
56
+ (event: 'reset'): void;
57
+ }
58
+ interface CaptchaInstance {
59
+ validate: () => boolean;
60
+ getToken: () => string;
61
+ getVerificationData: () => CaptchaSuccessPayload | null;
62
+ reset: () => void;
63
+ show: () => void;
64
+ }
65
+ //#endregion
4
66
  //#region src/components/C_Captcha/index.vue.d.ts
5
67
  declare const __VLS_export: vue.DefineComponent<CaptchaProps, {
6
68
  validate: () => boolean;
@@ -9,27 +71,30 @@ declare const __VLS_export: vue.DefineComponent<CaptchaProps, {
9
71
  verifiedBy: "local" | "server";
10
72
  token: string;
11
73
  timestamp: number;
12
- type: "puzzle-captcha";
74
+ type: CaptchaProvider;
13
75
  } | null;
14
76
  reset: () => void;
15
77
  show: () => void;
16
78
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
17
79
  change: (valid: boolean) => any;
18
- reset: () => any;
19
80
  success: (data: CaptchaSuccessPayload) => any;
81
+ reset: () => any;
20
82
  fail: (error: string) => any;
21
83
  "verify-error": (error: unknown) => any;
22
84
  "load-error": (error: unknown) => any;
85
+ "visible-change": (visible: boolean) => any;
23
86
  }, string, vue.PublicProps, Readonly<CaptchaProps> & Readonly<{
24
87
  onChange?: ((valid: boolean) => any) | undefined;
25
- onReset?: (() => any) | undefined;
26
88
  onSuccess?: ((data: CaptchaSuccessPayload) => any) | undefined;
89
+ onReset?: (() => any) | undefined;
27
90
  onFail?: ((error: string) => any) | undefined;
28
91
  "onVerify-error"?: ((error: unknown) => any) | undefined;
29
92
  "onLoad-error"?: ((error: unknown) => any) | undefined;
93
+ "onVisible-change"?: ((visible: boolean) => any) | undefined;
30
94
  }>, {
31
95
  theme: "light" | "dark";
32
96
  disabled: boolean;
97
+ provider: CaptchaProvider;
33
98
  images: string[];
34
99
  verificationTimeout: number;
35
100
  requireServerVerification: boolean;
@@ -55,4 +120,4 @@ interface VerifyCaptchaProofOptions {
55
120
  /** Normalize local/server verification with cancellation and a hard timeout. */
56
121
  declare function verifyCaptchaProof(proof: CaptchaProof, options?: VerifyCaptchaProofOptions): Promise<CaptchaSuccessPayload>;
57
122
  //#endregion
58
- export { _default as i, createCaptchaProof as n, verifyCaptchaProof as r, CaptchaVerificationError as t };
123
+ export { CaptchaEmits as a, CaptchaProps as c, CaptchaVerificationRequest as d, CaptchaVerificationResult as f, _default as i, CaptchaProvider as l, createCaptchaProof as n, CaptchaInstance as o, CaptchaVerifier as p, verifyCaptchaProof as r, CaptchaProof as s, CaptchaVerificationError as t, CaptchaSuccessPayload as u };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.11.7",
6
+ "version": "0.12.1",
7
7
  "description": "基于 Naive UI 的 Vue 3 组件库",
8
8
  "packageManager": "bun@1.3.14",
9
9
  "engines": {
@@ -125,6 +125,7 @@
125
125
  "@vue-flow/core": "^1.48.2",
126
126
  "@wangeditor-next/editor": "6.2.0",
127
127
  "@wangeditor-next/editor-for-vue": "6.2.0",
128
+ "altcha": "3.2.2",
128
129
  "dompurify": "^3.4.14",
129
130
  "driver.js": "^1.8.0",
130
131
  "highlight.js": "^11.12.0",
package/dist/types.d.ts DELETED
@@ -1,58 +0,0 @@
1
- import { i as ComponentLocale, r as ComponentFeedback } from "./config.js";
2
-
3
- //#region src/components/C_Captcha/types.d.ts
4
- interface CaptchaProof {
5
- /** Client correlation value only; servers must never trust it as proof. */
6
- token: string;
7
- /** Client clock value only; servers must never use it as freshness proof. */
8
- timestamp: number;
9
- type: 'puzzle-captcha';
10
- }
11
- interface CaptchaVerificationRequest extends CaptchaProof {
12
- /** Cancels superseded, reset, unmounted, or timed-out verification. */
13
- signal: AbortSignal;
14
- }
15
- interface CaptchaVerificationResult {
16
- valid: boolean;
17
- /** Prefer a short-lived, single-use token issued by the application server. */
18
- token?: string;
19
- message?: string;
20
- }
21
- type CaptchaVerifier = (request: CaptchaVerificationRequest) => boolean | CaptchaVerificationResult | Promise<boolean | CaptchaVerificationResult>;
22
- interface CaptchaSuccessPayload extends CaptchaProof {
23
- verifiedBy: 'local' | 'server';
24
- }
25
- interface CaptchaProps {
26
- triggerText?: string;
27
- images?: string[];
28
- disabled?: boolean;
29
- theme?: 'light' | 'dark';
30
- /**
31
- * Application-owned verification adapter. It must validate an independent,
32
- * server/provider-issued challenge; client token/timestamp are telemetry only.
33
- */
34
- verifier?: CaptchaVerifier;
35
- /** Maximum time for `verifier`, in milliseconds. */
36
- verificationTimeout?: number;
37
- /** Fail closed when no server verifier is configured. */
38
- requireServerVerification?: boolean;
39
- feedback?: ComponentFeedback;
40
- locale?: ComponentLocale;
41
- }
42
- interface CaptchaEmits {
43
- (event: 'success', data: CaptchaSuccessPayload): void;
44
- (event: 'fail', error: string): void;
45
- (event: 'verify-error', error: unknown): void;
46
- (event: 'load-error', error: unknown): void;
47
- (event: 'change', valid: boolean): void;
48
- (event: 'reset'): void;
49
- }
50
- interface CaptchaInstance {
51
- validate: () => boolean;
52
- getToken: () => string;
53
- getVerificationData: () => CaptchaSuccessPayload | null;
54
- reset: () => void;
55
- show: () => void;
56
- }
57
- //#endregion
58
- export { CaptchaSuccessPayload as a, CaptchaVerifier as c, CaptchaProps as i, CaptchaInstance as n, CaptchaVerificationRequest as o, CaptchaProof as r, CaptchaVerificationResult as s, CaptchaEmits as t };
package/dist/types2.d.cts DELETED
@@ -1,58 +0,0 @@
1
- import { i as ComponentLocale, r as ComponentFeedback } from "./config.cjs";
2
-
3
- //#region src/components/C_Captcha/types.d.ts
4
- interface CaptchaProof {
5
- /** Client correlation value only; servers must never trust it as proof. */
6
- token: string;
7
- /** Client clock value only; servers must never use it as freshness proof. */
8
- timestamp: number;
9
- type: 'puzzle-captcha';
10
- }
11
- interface CaptchaVerificationRequest extends CaptchaProof {
12
- /** Cancels superseded, reset, unmounted, or timed-out verification. */
13
- signal: AbortSignal;
14
- }
15
- interface CaptchaVerificationResult {
16
- valid: boolean;
17
- /** Prefer a short-lived, single-use token issued by the application server. */
18
- token?: string;
19
- message?: string;
20
- }
21
- type CaptchaVerifier = (request: CaptchaVerificationRequest) => boolean | CaptchaVerificationResult | Promise<boolean | CaptchaVerificationResult>;
22
- interface CaptchaSuccessPayload extends CaptchaProof {
23
- verifiedBy: 'local' | 'server';
24
- }
25
- interface CaptchaProps {
26
- triggerText?: string;
27
- images?: string[];
28
- disabled?: boolean;
29
- theme?: 'light' | 'dark';
30
- /**
31
- * Application-owned verification adapter. It must validate an independent,
32
- * server/provider-issued challenge; client token/timestamp are telemetry only.
33
- */
34
- verifier?: CaptchaVerifier;
35
- /** Maximum time for `verifier`, in milliseconds. */
36
- verificationTimeout?: number;
37
- /** Fail closed when no server verifier is configured. */
38
- requireServerVerification?: boolean;
39
- feedback?: ComponentFeedback;
40
- locale?: ComponentLocale;
41
- }
42
- interface CaptchaEmits {
43
- (event: 'success', data: CaptchaSuccessPayload): void;
44
- (event: 'fail', error: string): void;
45
- (event: 'verify-error', error: unknown): void;
46
- (event: 'load-error', error: unknown): void;
47
- (event: 'change', valid: boolean): void;
48
- (event: 'reset'): void;
49
- }
50
- interface CaptchaInstance {
51
- validate: () => boolean;
52
- getToken: () => string;
53
- getVerificationData: () => CaptchaSuccessPayload | null;
54
- reset: () => void;
55
- show: () => void;
56
- }
57
- //#endregion
58
- export { CaptchaSuccessPayload as a, CaptchaVerifier as c, CaptchaProps as i, CaptchaInstance as n, CaptchaVerificationRequest as o, CaptchaProof as r, CaptchaVerificationResult as s, CaptchaEmits as t };