@xenosystem/blocks 0.13.13 → 0.13.15
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/{chunk-6XVFYPVH.js → chunk-PI5WOATA.js} +0 -1
- package/dist/data/index.d.ts +104 -19
- package/dist/data/index.js +315 -216
- package/dist/edit/index.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/ops/index.js +1 -1
- package/dist/time/index.js +1 -1
- package/dist/trust/index.d.ts +119 -17
- package/dist/trust/index.js +334 -198
- package/package.json +3 -3
package/dist/edit/index.js
CHANGED
package/dist/icons/index.js
CHANGED
package/dist/ops/index.js
CHANGED
package/dist/time/index.js
CHANGED
package/dist/trust/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PanelModule, PanelManifest } from '@xenosystem/block-sdk';
|
|
1
|
+
import { PanelModule, PanelManifest, BlockDeclaration } from '@xenosystem/block-sdk';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -750,31 +750,133 @@ declare const CONSENT_PANEL_ID = "xeno.core.consent";
|
|
|
750
750
|
declare const consentManifest: PanelManifest;
|
|
751
751
|
|
|
752
752
|
/**
|
|
753
|
-
* The Consent panel
|
|
753
|
+
* The Consent panel AS A DECLARATION — the seventeenth declared block: one elicitation at a time,
|
|
754
|
+
* a PERMISSION (scopes + how long) or a QUESTION (options and/or a typed answer), never in bulk.
|
|
755
|
+
*
|
|
756
|
+
* Everything drawn is data: the header (risk and kind badges, the subject, the waiting count), the
|
|
757
|
+
* request (title, detail, its facts as `KeyValue`s), the permission's scope rows with a `Toggle`
|
|
758
|
+
* each and the duration control, or the question's option rows and the answer field with its
|
|
759
|
+
* length counter, Deny / Allow or Cancel / Submit, the status bar with the expiry. Every rule the
|
|
760
|
+
* code view carried survives: a question has no "deny" — refusing is a CANCELLATION, and the two
|
|
761
|
+
* are different outcomes for the host; no auto-focus on Allow, so a stray Enter grants nothing;
|
|
762
|
+
* the button's `disabled` is the SAME predicate `submit()` enforces. No runtime-bound unit.
|
|
763
|
+
*/
|
|
764
|
+
|
|
765
|
+
type Tone = 'neutral' | 'warning' | 'error';
|
|
766
|
+
interface ConsentViewFact {
|
|
767
|
+
key: string;
|
|
768
|
+
value: string;
|
|
769
|
+
}
|
|
770
|
+
interface ConsentViewScope {
|
|
771
|
+
id: string;
|
|
772
|
+
label: string;
|
|
773
|
+
detail?: string;
|
|
774
|
+
risk?: string;
|
|
775
|
+
riskTone: Tone;
|
|
776
|
+
granted: boolean;
|
|
777
|
+
grantable: boolean;
|
|
778
|
+
toggleLabel: string;
|
|
779
|
+
selected: boolean;
|
|
780
|
+
}
|
|
781
|
+
interface ConsentViewOption {
|
|
782
|
+
id: string;
|
|
783
|
+
label: string;
|
|
784
|
+
detail?: string;
|
|
785
|
+
risk?: string;
|
|
786
|
+
riskTone: Tone;
|
|
787
|
+
toggleLabel: string;
|
|
788
|
+
selected: boolean;
|
|
789
|
+
}
|
|
790
|
+
interface ConsentViewModel {
|
|
791
|
+
idle: boolean;
|
|
792
|
+
emptyHint: string;
|
|
793
|
+
active: boolean;
|
|
794
|
+
riskLabel: string;
|
|
795
|
+
riskTone: Tone;
|
|
796
|
+
kindLabel: string;
|
|
797
|
+
subject?: string;
|
|
798
|
+
waiting?: string;
|
|
799
|
+
title: string;
|
|
800
|
+
detail?: string;
|
|
801
|
+
facts: ConsentViewFact[];
|
|
802
|
+
permission: boolean;
|
|
803
|
+
scopes: ConsentViewScope[];
|
|
804
|
+
durations: {
|
|
805
|
+
value: string;
|
|
806
|
+
label: string;
|
|
807
|
+
}[];
|
|
808
|
+
duration: string;
|
|
809
|
+
unrememberable: boolean;
|
|
810
|
+
allowDisabled: boolean;
|
|
811
|
+
question: boolean;
|
|
812
|
+
hasOptions: boolean;
|
|
813
|
+
options: ConsentViewOption[];
|
|
814
|
+
wantsText: boolean;
|
|
815
|
+
textLabel?: string;
|
|
816
|
+
multiline: boolean;
|
|
817
|
+
placeholder: string;
|
|
818
|
+
draft: string;
|
|
819
|
+
hasCounter: boolean;
|
|
820
|
+
counter: string;
|
|
821
|
+
overLimit: boolean;
|
|
822
|
+
submitLabel: string;
|
|
823
|
+
submitDisabled: boolean;
|
|
824
|
+
pendingLabel: string;
|
|
825
|
+
expiryLabel?: string;
|
|
826
|
+
}
|
|
827
|
+
type ConsentUiIntent = {
|
|
828
|
+
kind: 'scope';
|
|
829
|
+
id: string;
|
|
830
|
+
on: boolean;
|
|
831
|
+
} | {
|
|
832
|
+
kind: 'duration';
|
|
833
|
+
duration: XenoConsentDuration;
|
|
834
|
+
} | {
|
|
835
|
+
kind: 'option';
|
|
836
|
+
id: string;
|
|
837
|
+
on: boolean;
|
|
838
|
+
} | {
|
|
839
|
+
kind: 'text';
|
|
840
|
+
value: string;
|
|
841
|
+
} | {
|
|
842
|
+
kind: 'allow';
|
|
843
|
+
} | {
|
|
844
|
+
kind: 'deny';
|
|
845
|
+
} | {
|
|
846
|
+
kind: 'submit';
|
|
847
|
+
} | {
|
|
848
|
+
kind: 'dismiss';
|
|
849
|
+
};
|
|
850
|
+
interface ConsentViewOptions {
|
|
851
|
+
showQueueCount?: boolean;
|
|
852
|
+
emptyHint?: string;
|
|
853
|
+
}
|
|
854
|
+
/** Derive the view from the live controller — the runtime calls this on every draw. */
|
|
855
|
+
declare function consentViewState(c: ConsentController, options?: ConsentViewOptions): ConsentViewModel;
|
|
856
|
+
declare function applyConsentUi(c: ConsentController, intent: ConsentUiIntent): void;
|
|
857
|
+
declare const consentViewManifest: PanelManifest;
|
|
858
|
+
declare const BEHAVIOURS: {
|
|
859
|
+
'trust/consentPanelView': (inputs: Record<string, unknown>) => ConsentViewModel;
|
|
860
|
+
};
|
|
861
|
+
declare const CONSENT_RUNTIME_UNITS: readonly [];
|
|
862
|
+
declare const CONSENT_DECLARATION: BlockDeclaration;
|
|
863
|
+
|
|
864
|
+
/**
|
|
865
|
+
* The Consent panel view — the CODE VIEW of `CONSENT_DECLARATION`, drawing the same
|
|
866
|
+
* `ConsentViewModel` byte-identical (the equivalence suite holds the two together). No runtime-bound
|
|
867
|
+
* unit; every intent goes through `applyConsentUi`.
|
|
754
868
|
*
|
|
755
869
|
* Composes `@xenosystem/components/chrome`; the host must ensure `@xenosystem/workbench/primitives.css` is
|
|
756
870
|
* present.
|
|
757
871
|
*
|
|
758
|
-
* Two deliberate absences: **no "Allow all"** (bulk approval is how consent fatigue becomes a
|
|
759
|
-
* security hole) and **no auto-focus on Allow** (a stray Enter must not grant anything).
|
|
760
|
-
*
|
|
761
|
-
* 🔴 **A third absence, added with the question kinds: nothing here submits on its own.** The
|
|
762
|
-
* question forms carry no auto-submit, no debounce-then-send, and no Enter-to-answer on the
|
|
763
|
-
* single-line field. The emitted answer is always the product of a click the user made, which is
|
|
764
|
-
* the view's half of the controller's *"no value without a user action"* invariant — the guard
|
|
765
|
-
* lives in `submit()`, but a view that fired it on a keystroke would satisfy the guard while
|
|
766
|
-
* defeating the point.
|
|
767
|
-
*
|
|
768
872
|
* @module
|
|
769
873
|
*/
|
|
770
874
|
|
|
771
875
|
/** Props for {@link ConsentPanelView}. */
|
|
772
|
-
interface ConsentPanelViewProps {
|
|
876
|
+
interface ConsentPanelViewProps extends ConsentViewOptions {
|
|
773
877
|
controller: ConsentController;
|
|
774
|
-
showQueueCount?: boolean;
|
|
775
|
-
emptyHint?: string;
|
|
776
878
|
}
|
|
777
879
|
/** The Consent panel view. */
|
|
778
|
-
declare function ConsentPanelView({ controller, showQueueCount, emptyHint
|
|
880
|
+
declare function ConsentPanelView({ controller, showQueueCount, emptyHint }: ConsentPanelViewProps): ReactNode;
|
|
779
881
|
|
|
780
|
-
export { CONSENT_PANEL_ID, ConsentController, type ConsentControllerOptions, type ConsentHostBridge, type ConsentPanelState, ConsentPanelView, type ConsentPanelViewProps, type ConsentRenderContext, type ConsentViewState, type CreateConsentPanelOptions, ELICITATION_RESULT_SCHEMA, ELICITATION_SCHEMA, type XenoChoiceAnswer, type XenoChoiceElicitation, type XenoConsentDecision, type XenoConsentDuration, type XenoConsentKind, type XenoConsentRequest, type XenoConsentRisk, type XenoConsentScope, type XenoElicitation, type XenoElicitationAnswer, type XenoElicitationAsk, type XenoElicitationBase, type XenoElicitationCancelled, type XenoElicitationOption, type XenoElicitationResult, type XenoPathAnswer, type XenoPathElicitation, type XenoQuestionElicitation, type XenoTextAnswer, type XenoTextElicitation, allowedDurations, autoCancel, autoDeny, consentManifest, consentPanel, createConsentPanel, effectiveRisk, elicitationAsk, elicitationOptions, findOption, isConsentRequest, isElicitation, isElicitationAnswer, isElicitationCancelled, isExpired, isPermissionElicitation, maxTextLength, selectableScopes };
|
|
882
|
+
export { BEHAVIOURS as CONSENT_BEHAVIOURS, CONSENT_DECLARATION, CONSENT_PANEL_ID, CONSENT_RUNTIME_UNITS, ConsentController, type ConsentControllerOptions, type ConsentHostBridge, type ConsentPanelState, ConsentPanelView, type ConsentPanelViewProps, type ConsentRenderContext, type ConsentUiIntent, type ConsentViewFact, type ConsentViewModel, type ConsentViewOption, type ConsentViewOptions, type ConsentViewScope, type ConsentViewState, type CreateConsentPanelOptions, ELICITATION_RESULT_SCHEMA, ELICITATION_SCHEMA, type XenoChoiceAnswer, type XenoChoiceElicitation, type XenoConsentDecision, type XenoConsentDuration, type XenoConsentKind, type XenoConsentRequest, type XenoConsentRisk, type XenoConsentScope, type XenoElicitation, type XenoElicitationAnswer, type XenoElicitationAsk, type XenoElicitationBase, type XenoElicitationCancelled, type XenoElicitationOption, type XenoElicitationResult, type XenoPathAnswer, type XenoPathElicitation, type XenoQuestionElicitation, type XenoTextAnswer, type XenoTextElicitation, allowedDurations, applyConsentUi, autoCancel, autoDeny, consentManifest, consentPanel, consentViewManifest, consentViewState, createConsentPanel, effectiveRisk, elicitationAsk, elicitationOptions, findOption, isConsentRequest, isElicitation, isElicitationAnswer, isElicitationCancelled, isExpired, isPermissionElicitation, maxTextLength, selectableScopes };
|