@camstack/ui-library 1.2.252 → 1.2.253

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,34 @@
1
- import { ConfigField } from '@camstack/types';
1
+ import { ConfigField, SecretFieldView } from '@camstack/types';
2
2
  import { ReactNode } from 'react';
3
- /** How long a revealed value stays on screen. */
4
- export declare const SECRET_REVEAL_MS = 10000;
5
3
  /** Returns the stored value of a ref (audited by the host). */
6
4
  export type SecretRevealFn = (ref: string) => Promise<string>;
5
+ /** How long the System → Secrets page shows a revealed value. */
6
+ export declare const SECRET_REVEAL_MS = 10000;
7
+ /** What an untouched stored secret shows in place of its value. */
8
+ export declare const SECRET_MASK_PLACEHOLDER = "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022";
7
9
  export declare function SecretRevealProvider({ reveal, children, }: {
8
10
  readonly reveal: SecretRevealFn;
9
11
  readonly children: ReactNode;
10
12
  }): import("react").JSX.Element;
11
13
  /** Does this value belong to the keychain rendering (a view, or "not set")? */
12
14
  export declare function isKeychainFieldValue(value: unknown): boolean;
15
+ /**
16
+ * What the operator has done to the field. `untouched` shows nothing and
17
+ * sends nothing; `visible` holds text the operator can see — revealed (then
18
+ * `revealed` is the stored value) or typed.
19
+ */
20
+ export type SecretEntry = {
21
+ readonly kind: 'untouched';
22
+ } | {
23
+ readonly kind: 'visible';
24
+ readonly text: string;
25
+ readonly revealed: string | null;
26
+ };
27
+ /**
28
+ * The value the form sends for an entry. `stored` — something is stored (or
29
+ * already marked for removal) — is what makes an emptied box a CLEAR.
30
+ */
31
+ export declare function secretSubmitValue(entry: SecretEntry, original: SecretFieldView | null, stored: boolean): unknown;
13
32
  export interface SecretFieldProps {
14
33
  readonly field: ConfigField;
15
34
  /** The view (or null) the form was hydrated with, or what the operator has done since. */
@@ -55,7 +55,7 @@ export * from './code-block';
55
55
  export type { TranslationFn } from './config-form-builder';
56
56
  export { ConfigFormBuilder } from './config-form-builder';
57
57
  export type { ProbeState } from './config-form-field';
58
- export { isKeychainFieldValue, SECRET_REVEAL_MS, SecretFieldControl, type SecretFieldProps, type SecretRevealFn, SecretRevealProvider, } from './config-secret-field';
58
+ export { isKeychainFieldValue, SECRET_MASK_PLACEHOLDER, SECRET_REVEAL_MS, type SecretEntry, SecretFieldControl, type SecretFieldProps, secretSubmitValue, type SecretRevealFn, SecretRevealProvider, } from './config-secret-field';
59
59
  export { ConfigFormField, isFieldVisible, NodeMultiSelectField, NodeSelectField, } from './config-form-field';
60
60
  export type { ConfirmActionButtonProps } from './confirm-action-button';
61
61
  export { ConfirmActionButton } from './confirm-action-button';