@kya-os/consent 0.1.47 → 0.1.48
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/README.md +89 -0
- package/dist/bundle/index.d.ts +2 -0
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +1 -0
- package/dist/bundle/index.js.map +1 -1
- package/dist/bundle/inline.d.ts.map +1 -1
- package/dist/bundle/inline.js +4 -4
- package/dist/bundle/inline.js.map +1 -1
- package/dist/capabilities/registry.d.ts.map +1 -1
- package/dist/capabilities/registry.js +5 -1
- package/dist/capabilities/registry.js.map +1 -1
- package/dist/cedar/compile.d.ts +67 -2
- package/dist/cedar/compile.d.ts.map +1 -1
- package/dist/cedar/compile.js +34 -5
- package/dist/cedar/compile.js.map +1 -1
- package/dist/cedar/index.d.ts +1 -0
- package/dist/cedar/index.d.ts.map +1 -1
- package/dist/cedar/index.js.map +1 -1
- package/dist/cjs/bundle/index.js +3 -1
- package/dist/cjs/bundle/index.js.map +1 -1
- package/dist/cjs/bundle/inline.js +4 -4
- package/dist/cjs/bundle/inline.js.map +1 -1
- package/dist/cjs/capabilities/registry.js +5 -1
- package/dist/cjs/capabilities/registry.js.map +1 -1
- package/dist/cjs/cedar/compile.js +34 -5
- package/dist/cjs/cedar/compile.js.map +1 -1
- package/dist/cjs/cedar/index.js.map +1 -1
- package/dist/cjs/components/consent-action-bar.js +16 -5
- package/dist/cjs/components/consent-action-bar.js.map +1 -1
- package/dist/cjs/components/consent-capabilities-screen.js +92 -37
- package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
- package/dist/cjs/components/consent-capability-card.js +35 -4
- package/dist/cjs/components/consent-capability-card.js.map +1 -1
- package/dist/cjs/components/mcp-consent.js +37 -27
- package/dist/cjs/components/mcp-consent.js.map +1 -1
- package/dist/cjs/constants/capabilities.js +10 -0
- package/dist/cjs/constants/capabilities.js.map +1 -0
- package/dist/cjs/constants/index.js +3 -1
- package/dist/cjs/constants/index.js.map +1 -1
- package/dist/cjs/mcp-app/inline.js +2 -2
- package/dist/cjs/mcp-app/inline.js.map +1 -1
- package/dist/cjs/resolution/credential-capabilities.js.map +1 -1
- package/dist/cjs/resolution/selected-capabilities.js +73 -0
- package/dist/cjs/resolution/selected-capabilities.js.map +1 -0
- package/dist/cjs/schemas/capabilities.schemas.js +14 -2
- package/dist/cjs/schemas/capabilities.schemas.js.map +1 -1
- package/dist/cjs/types/capabilities.types.js +55 -0
- package/dist/cjs/types/capabilities.types.js.map +1 -1
- package/dist/components/consent-action-bar.d.ts +2 -0
- package/dist/components/consent-action-bar.d.ts.map +1 -1
- package/dist/components/consent-action-bar.js +16 -5
- package/dist/components/consent-action-bar.js.map +1 -1
- package/dist/components/consent-capabilities-screen.d.ts +18 -5
- package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
- package/dist/components/consent-capabilities-screen.js +92 -37
- package/dist/components/consent-capabilities-screen.js.map +1 -1
- package/dist/components/consent-capability-card.d.ts +2 -0
- package/dist/components/consent-capability-card.d.ts.map +1 -1
- package/dist/components/consent-capability-card.js +35 -4
- package/dist/components/consent-capability-card.js.map +1 -1
- package/dist/components/mcp-consent.d.ts +3 -0
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +37 -27
- package/dist/components/mcp-consent.js.map +1 -1
- package/dist/consent.js +221 -46
- package/dist/consent.min.js +193 -146
- package/dist/constants/capabilities.d.ts +7 -0
- package/dist/constants/capabilities.d.ts.map +1 -0
- package/dist/constants/capabilities.js +7 -0
- package/dist/constants/capabilities.js.map +1 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/mcp-app/inline.d.ts.map +1 -1
- package/dist/mcp-app/inline.js +2 -2
- package/dist/mcp-app/inline.js.map +1 -1
- package/dist/resolution/credential-capabilities.d.ts +2 -2
- package/dist/resolution/credential-capabilities.d.ts.map +1 -1
- package/dist/resolution/credential-capabilities.js.map +1 -1
- package/dist/resolution/selected-capabilities.d.ts +26 -0
- package/dist/resolution/selected-capabilities.d.ts.map +1 -0
- package/dist/resolution/selected-capabilities.js +69 -0
- package/dist/resolution/selected-capabilities.js.map +1 -0
- package/dist/schemas/api.schemas.d.ts +88 -68
- package/dist/schemas/api.schemas.d.ts.map +1 -1
- package/dist/schemas/branding.schemas.d.ts +2 -2
- package/dist/schemas/capabilities.schemas.d.ts +58 -12
- package/dist/schemas/capabilities.schemas.d.ts.map +1 -1
- package/dist/schemas/capabilities.schemas.js +14 -2
- package/dist/schemas/capabilities.schemas.js.map +1 -1
- package/dist/schemas/config.schemas.d.ts +140 -100
- package/dist/schemas/config.schemas.d.ts.map +1 -1
- package/dist/types/capabilities.types.d.ts +69 -0
- package/dist/types/capabilities.types.d.ts.map +1 -1
- package/dist/types/capabilities.types.js +53 -1
- package/dist/types/capabilities.types.js.map +1 -1
- package/package.json +6 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline.js","sourceRoot":"","sources":["../../../src/bundle/inline.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH;;;GAGG;AACU,QAAA,cAAc,GAAW,
|
|
1
|
+
{"version":3,"file":"inline.js","sourceRoot":"","sources":["../../../src/bundle/inline.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH;;;GAGG;AACU,QAAA,cAAc,GAAW,u/6QAAu/6Q,CAAC;AAE9h7Q;;GAEG;AACU,QAAA,mBAAmB,GAAW,MAAM,CAAC;AAElD;;GAEG;AACU,QAAA,mBAAmB,GAAW,kBAAkB,CAAC;AAE9D;;;;;;;;;;;GAWG;AACU,QAAA,mBAAmB,GAAW,8BAA8B,CAAC"}
|
|
@@ -72,7 +72,11 @@ exports.DEFAULT_CAPABILITIES = {
|
|
|
72
72
|
description: "Pay with cards already on your account. The agent never sees the card numbers.",
|
|
73
73
|
icon: "card",
|
|
74
74
|
riskLevel: "high",
|
|
75
|
-
|
|
75
|
+
// First-Contact Scope Cap (design doc section 3, rule 1): high/critical
|
|
76
|
+
// capabilities can never ship pre-checked. hardwareworld's demo now
|
|
77
|
+
// requires one extra click to grant saved-payment use; see the PR
|
|
78
|
+
// description for the reasoning.
|
|
79
|
+
defaultOn: false,
|
|
76
80
|
cedar: [
|
|
77
81
|
"permit (",
|
|
78
82
|
' principal == Agent::"{{agent_did}}",',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/capabilities/registry.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/capabilities/registry.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AA0HH,oEAyCC;AA/JD;;;;GAIG;AACU,QAAA,oBAAoB,GAA+B;IAC9D,aAAa,EAAE;QACb,EAAE,EAAE,aAAa;QACjB,KAAK,EAAE,kCAAkC;QACzC,WAAW,EACT,oEAAoE;QACtE,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,KAAK;QAChB,SAAS,EAAE,IAAI;QACf,KAAK,EAAE;YACL,UAAU;YACV,wCAAwC;YACxC,eAAe;YACf,qCAAqC;YACrC,iCAAiC;YACjC,mCAAmC;YACnC,iCAAiC;YACjC,MAAM;YACN,4CAA4C;YAC5C,IAAI;SACL,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,MAAM,EAAE;YACN,sBAAsB;YACtB,kBAAkB;YAClB,oBAAoB;YACpB,mBAAmB;SACpB;QACD,QAAQ,EAAE,QAAQ;KACnB;IACD,UAAU,EAAE;QACV,EAAE,EAAE,UAAU;QACd,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EACT,mEAAmE;QACrE,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,IAAI;QACf,KAAK,EAAE;YACL,UAAU;YACV,wCAAw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AC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAE9C,KAAK,MAAM,KAAK,IAAI,eAAe,EAAE,CAAC;QACpC,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;GAGG;AACH,SAAS,sBAAsB,CAAC,KAAa;IAC3C,MAAM,KAAK,GAAG,KAAK;SAChB,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;SACvB,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IAC5C,OAAO;QACL,EAAE,EAAE,WAAW,KAAK,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE;QAChE,KAAK;QACL,WAAW,EAAE,8BAA8B,KAAK,SAAS;QACzD,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE;YACL,UAAU;YACV,wCAAwC;YACxC,wBAAwB,KAAK,IAAI;YACjC,6CAA6C;YAC7C,IAAI;SACL,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,MAAM,EAAE,CAAC,KAAK,CAAC;KAChB,CAAC;AACJ,CAAC"}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.compileSingleCapability = compileSingleCapability;
|
|
16
16
|
exports.compileCapabilitiesToCedar = compileCapabilitiesToCedar;
|
|
17
|
+
const capabilities_types_js_1 = require("../types/capabilities.types.js");
|
|
17
18
|
const PLACEHOLDER_PATTERN = /\{\{\s*(agent_did|user_did|org|deployment)\s*\}\}/g;
|
|
18
19
|
/**
|
|
19
20
|
* Compile a single capability's Cedar fragment by binding placeholders to the
|
|
@@ -41,12 +42,40 @@ function compileSingleCapability(capability, context) {
|
|
|
41
42
|
* a delegation VC. Each capability's fragment is bound and concatenated with
|
|
42
43
|
* a comment header that records the capability id and label, so reviewers can
|
|
43
44
|
* map a `permit (...)` block back to the row the user clicked.
|
|
45
|
+
*
|
|
46
|
+
* First-Contact Scope Cap (design doc section 3, rules 2 + 3): a `high` or
|
|
47
|
+
* `critical` grant is withheld, never compiled, whenever the requesting
|
|
48
|
+
* agent is capped at probe (no verified Entity Card, or no established
|
|
49
|
+
* relationship). The caller must pass the agent's relationship context on
|
|
50
|
+
* every call, so a different renderer cannot compile the full grant set
|
|
51
|
+
* without deciding what the agent is entitled to. `agent` may be `undefined`:
|
|
52
|
+
* real stored configs carry no agent metadata at all, and that counts as
|
|
53
|
+
* unverified too, so it fails closed rather than throwing. Withheld grants
|
|
54
|
+
* are dropped rather than throwing so the rest of the (probe-eligible)
|
|
55
|
+
* policy still compiles, but they are always returned to the caller, never
|
|
56
|
+
* lost silently — from *this call*. That guarantee ends at the return value:
|
|
57
|
+
* nothing withheld, or the fact that a cap was applied at all, is recorded
|
|
58
|
+
* on the compiled Cedar or on the delegation VC it feeds, so re-deriving or
|
|
59
|
+
* attenuating a credential downstream without calling this function again
|
|
60
|
+
* (with fresh `RelationshipContext`) will not rediscover the cap. See the
|
|
61
|
+
* "Known limitation" note on `CompileCapabilitiesResult`.
|
|
44
62
|
*/
|
|
45
|
-
function compileCapabilitiesToCedar(grants, context) {
|
|
46
|
-
|
|
47
|
-
|
|
63
|
+
function compileCapabilitiesToCedar(grants, context, agent) {
|
|
64
|
+
const capped = (0, capabilities_types_js_1.isCappedAtProbe)(agent);
|
|
65
|
+
const eligible = [];
|
|
66
|
+
const withheld = [];
|
|
67
|
+
for (const grant of grants) {
|
|
68
|
+
if (capped && !(0, capabilities_types_js_1.isProbeEligible)(grant.riskLevel)) {
|
|
69
|
+
withheld.push(grant);
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
eligible.push(grant);
|
|
73
|
+
}
|
|
74
|
+
const grantedScopes = Array.from(new Set(eligible.flatMap((grant) => grant.scopes)));
|
|
75
|
+
if (eligible.length === 0) {
|
|
76
|
+
return { cedar: "", grantedScopes, withheld };
|
|
48
77
|
}
|
|
49
|
-
const blocks =
|
|
78
|
+
const blocks = eligible.map((grant) => {
|
|
50
79
|
const compiled = compileSingleCapability(grant, context);
|
|
51
80
|
return [
|
|
52
81
|
`// capability: ${grant.id} — ${grant.label}`,
|
|
@@ -54,6 +83,6 @@ function compileCapabilitiesToCedar(grants, context) {
|
|
|
54
83
|
compiled.trim(),
|
|
55
84
|
].join("\n");
|
|
56
85
|
});
|
|
57
|
-
return blocks.join("\n\n");
|
|
86
|
+
return { cedar: blocks.join("\n\n"), grantedScopes, withheld };
|
|
58
87
|
}
|
|
59
88
|
//# sourceMappingURL=compile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../../../src/cedar/compile.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;
|
|
1
|
+
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../../../src/cedar/compile.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;AAsEH,0DAqBC;AAyBD,gEAiCC;AAnJD,0EAAkF;AAOlF,MAAM,mBAAmB,GAAG,oDAAoD,CAAC;AAqDjF;;;;;;;GAOG;AACH,SAAgB,uBAAuB,CACrC,UAAsB,EACtB,OAA6B;IAE7B,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC,EAAE,GAAW,EAAE,EAAE;QAChF,MAAM,KAAK,GAAG,OAAO,CAAC,GAAiC,CAAC,CAAC;QACzD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK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O,CAAC,CAAC;QACzD,OAAO;YACL,kBAAkB,KAAK,CAAC,EAAE,MAAM,KAAK,CAAC,KAAK,EAAE;YAC7C,YAAY,KAAK,CAAC,SAAS,iBAAiB,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;YACrE,QAAQ,CAAC,IAAI,EAAE;SAChB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC;AACjE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cedar/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,2CAGsB;AAFpB,qHAAA,uBAAuB,OAAA;AACvB,wHAAA,0BAA0B,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cedar/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,2CAGsB;AAFpB,qHAAA,uBAAuB,OAAA;AACvB,wHAAA,0BAA0B,OAAA;AAG5B,2CAAoD;AAA3C,kHAAA,oBAAoB,OAAA"}
|
|
@@ -29,6 +29,8 @@ let ConsentActionBar = class ConsentActionBar extends lit_1.LitElement {
|
|
|
29
29
|
this.theme = "light";
|
|
30
30
|
this.disabled = false;
|
|
31
31
|
this.loading = false;
|
|
32
|
+
this.submitLabel = "";
|
|
33
|
+
this.cancelLabel = "";
|
|
32
34
|
}
|
|
33
35
|
emitAllow() {
|
|
34
36
|
if (this.disabled || this.loading)
|
|
@@ -41,17 +43,18 @@ let ConsentActionBar = class ConsentActionBar extends lit_1.LitElement {
|
|
|
41
43
|
this.dispatchEvent(new CustomEvent("consent-deny", { bubbles: true, composed: true }));
|
|
42
44
|
}
|
|
43
45
|
render() {
|
|
44
|
-
const allowLabel = this.theme === "dark"
|
|
46
|
+
const allowLabel = this.submitLabel || (this.theme === "dark"
|
|
45
47
|
? tokens_js_1.CONSENT_COPY_TOKENS.actions.allowAccess
|
|
46
48
|
: `${(0, tokens_js_1.formatToken)(tokens_js_1.CONSENT_COPY_TOKENS.actions.allowAgentTemplate, {
|
|
47
49
|
Agent: this.agentName || "this agent",
|
|
48
|
-
})}
|
|
49
|
-
const denyLabel = this.theme === "dark"
|
|
50
|
+
})} →`);
|
|
51
|
+
const denyLabel = this.cancelLabel || (this.theme === "dark"
|
|
50
52
|
? tokens_js_1.CONSENT_COPY_TOKENS.actions.deny
|
|
51
|
-
: tokens_js_1.CONSENT_COPY_TOKENS.actions.notNow;
|
|
53
|
+
: tokens_js_1.CONSENT_COPY_TOKENS.actions.notNow);
|
|
52
54
|
return (0, lit_1.html) `
|
|
53
55
|
<button
|
|
54
56
|
class="primary"
|
|
57
|
+
part="submit"
|
|
55
58
|
type="button"
|
|
56
59
|
?disabled=${this.disabled || this.loading}
|
|
57
60
|
@click=${this.emitAllow}
|
|
@@ -60,6 +63,7 @@ let ConsentActionBar = class ConsentActionBar extends lit_1.LitElement {
|
|
|
60
63
|
</button>
|
|
61
64
|
<button
|
|
62
65
|
class="secondary"
|
|
66
|
+
part="cancel"
|
|
63
67
|
type="button"
|
|
64
68
|
?disabled=${this.loading}
|
|
65
69
|
@click=${this.emitDeny}
|
|
@@ -82,7 +86,7 @@ ConsentActionBar.styles = (0, lit_1.css) `
|
|
|
82
86
|
width: 100%;
|
|
83
87
|
padding: 14px 18px;
|
|
84
88
|
border-radius: 999px;
|
|
85
|
-
font-size: 15px;
|
|
89
|
+
font-size: var(--cs-action-font-size, 15px);
|
|
86
90
|
font-weight: 500;
|
|
87
91
|
font-family: inherit;
|
|
88
92
|
cursor: pointer;
|
|
@@ -101,6 +105,7 @@ ConsentActionBar.styles = (0, lit_1.css) `
|
|
|
101
105
|
}
|
|
102
106
|
|
|
103
107
|
.primary {
|
|
108
|
+
min-height: var(--cs-action-min-height, 0px);
|
|
104
109
|
background: var(--cs-surface-accent, #0F172A);
|
|
105
110
|
color: var(--cs-surface-accent-text, #FFFFFF);
|
|
106
111
|
}
|
|
@@ -132,6 +137,12 @@ __decorate([
|
|
|
132
137
|
__decorate([
|
|
133
138
|
(0, decorators_js_1.property)({ type: Boolean })
|
|
134
139
|
], ConsentActionBar.prototype, "loading", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
(0, decorators_js_1.property)({ type: String, attribute: "submit-label" })
|
|
142
|
+
], ConsentActionBar.prototype, "submitLabel", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
(0, decorators_js_1.property)({ type: String, attribute: "cancel-label" })
|
|
145
|
+
], ConsentActionBar.prototype, "cancelLabel", void 0);
|
|
135
146
|
exports.ConsentActionBar = ConsentActionBar = __decorate([
|
|
136
147
|
(0, decorators_js_1.customElement)("consent-action-bar")
|
|
137
148
|
], ConsentActionBar);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-action-bar.js","sourceRoot":"","sources":["../../../src/components/consent-action-bar.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;;;;;AAEH,6BAA4C;AAC5C,qDAA4D;AAE5D,iDAAqE;AAI9D,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,gBAAU;IAAzC;;QACuB,cAAS,GAAG,EAAE,CAAC;QACf,UAAK,GAAiB,OAAO,CAAC;QAC7B,aAAQ,GAAG,KAAK,CAAC;QACjB,YAAO,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"consent-action-bar.js","sourceRoot":"","sources":["../../../src/components/consent-action-bar.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;;;;;AAEH,6BAA4C;AAC5C,qDAA4D;AAE5D,iDAAqE;AAI9D,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,gBAAU;IAAzC;;QACuB,cAAS,GAAG,EAAE,CAAC;QACf,UAAK,GAAiB,OAAO,CAAC;Q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AAI,CAAC,QAAQ;;UAEpB,SAAS;;KAEd,CAAC;IACJ,CAAC;;AA1GU,4CAAgB;AAQX,uBAAM,GAAG,IAAA,SAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkD3B,AAlDqB,CAkDpB;AAzD0B;IAA3B,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAgB;AACf;IAA3B,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAA+B;AAC7B;IAA5B,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDAAkB;AACjB;IAA5B,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDAAiB;AACU;IAAtD,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;qDAAkB;AACjB;IAAtD,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;qDAAkB;2BAN7D,gBAAgB;IAD5B,IAAA,6BAAa,EAAC,oBAAoB,CAAC;GACvB,gBAAgB,CA2G5B"}
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* permissions list otherwise.
|
|
10
10
|
*
|
|
11
11
|
* This component is purely presentational. It accepts the resolved data
|
|
12
|
-
* (capabilities, agent metadata, copy values) and emits `
|
|
13
|
-
* `
|
|
12
|
+
* (capabilities, agent metadata, copy values) and emits `capabilities-allow` /
|
|
13
|
+
* `capabilities-deny` events so the parent can submit the form / close the
|
|
14
14
|
* window. Selection state for the checkboxes is owned here to keep the
|
|
15
15
|
* parent simple.
|
|
16
16
|
*
|
|
@@ -30,6 +30,7 @@ const tokens_js_1 = require("../copy/tokens.js");
|
|
|
30
30
|
const theme_js_1 = require("../styles/theme.js");
|
|
31
31
|
const compile_js_1 = require("../cedar/compile.js");
|
|
32
32
|
const credential_capabilities_js_1 = require("../resolution/credential-capabilities.js");
|
|
33
|
+
const capabilities_js_1 = require("../constants/capabilities.js");
|
|
33
34
|
require("./consent-agent-header.js");
|
|
34
35
|
require("./consent-capability-card.js");
|
|
35
36
|
require("./consent-action-bar.js");
|
|
@@ -47,6 +48,11 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
47
48
|
this.theme = "light";
|
|
48
49
|
this.howItWorksUrl = "";
|
|
49
50
|
this.loading = false;
|
|
51
|
+
/** Blocks approval while allowing the human to decline. */
|
|
52
|
+
this.disabled = false;
|
|
53
|
+
this.description = "";
|
|
54
|
+
this.submitLabel = "";
|
|
55
|
+
this.cancelLabel = "";
|
|
50
56
|
/**
|
|
51
57
|
* Seed every capability as selected. The credential path grants a fixed,
|
|
52
58
|
* all-or-nothing scope set, so every capability starts checked — the rows
|
|
@@ -77,6 +83,8 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
77
83
|
* reach this screen the same way it reaches the other consent screens.
|
|
78
84
|
*/
|
|
79
85
|
this.serverLogoUrl = "";
|
|
86
|
+
/** Fixed grants require every disclosed capability to remain selected. */
|
|
87
|
+
this.requireAll = false;
|
|
80
88
|
this.selected = new Set();
|
|
81
89
|
/**
|
|
82
90
|
* Last capability set this component seeded `selected` from, per
|
|
@@ -85,7 +93,14 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
85
93
|
*/
|
|
86
94
|
this.seedKey = "";
|
|
87
95
|
this.onCapabilityToggle = (event) => {
|
|
96
|
+
if (this.loading || this.disabled || !(event instanceof CustomEvent))
|
|
97
|
+
return;
|
|
88
98
|
const detail = event.detail;
|
|
99
|
+
if (!detail || typeof detail !== "object" ||
|
|
100
|
+
!("id" in detail) || typeof detail.id !== "string" ||
|
|
101
|
+
!("checked" in detail) || typeof detail.checked !== "boolean" ||
|
|
102
|
+
!this.capabilities.some((capability) => capability.id === detail.id))
|
|
103
|
+
return;
|
|
89
104
|
const next = new Set(this.selected);
|
|
90
105
|
if (detail.checked)
|
|
91
106
|
next.add(detail.id);
|
|
@@ -94,12 +109,13 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
94
109
|
this.selected = next;
|
|
95
110
|
};
|
|
96
111
|
this.onAllow = () => {
|
|
97
|
-
if (this.loading)
|
|
112
|
+
if (this.loading || this.approvalDisabled)
|
|
98
113
|
return;
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
114
|
+
const selectedCapabilities = this.capabilities.filter((c) => this.selected.has(c.id));
|
|
115
|
+
if (selectedCapabilities.length === 0)
|
|
116
|
+
return;
|
|
117
|
+
const selectedIds = selectedCapabilities.map((c) => c.id);
|
|
118
|
+
const selectedScopes = Array.from(new Set(selectedCapabilities.flatMap((c) => c.scopes)));
|
|
103
119
|
const detail = {
|
|
104
120
|
selectedCapabilityIds: selectedIds,
|
|
105
121
|
selectedScopes,
|
|
@@ -111,6 +127,8 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
111
127
|
}));
|
|
112
128
|
};
|
|
113
129
|
this.onDeny = () => {
|
|
130
|
+
if (this.loading)
|
|
131
|
+
return;
|
|
114
132
|
this.dispatchEvent(new CustomEvent("capabilities-deny", { bubbles: true, composed: true }));
|
|
115
133
|
};
|
|
116
134
|
}
|
|
@@ -141,15 +159,22 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
141
159
|
hostStyle() {
|
|
142
160
|
return `:host { ${(0, theme_js_1.themeToCssVariables)((0, theme_js_1.getConsentTheme)(this.theme))} }`;
|
|
143
161
|
}
|
|
162
|
+
get approvalDisabled() {
|
|
163
|
+
return this.disabled || this.allowDisabled || this.selected.size === 0 ||
|
|
164
|
+
(this.requireAll && this.capabilities.some((capability) => !this.selected.has(capability.id)));
|
|
165
|
+
}
|
|
144
166
|
compileCapabilityCedar(capability) {
|
|
167
|
+
const cedar = capability.cedar?.trim() || "";
|
|
168
|
+
if (!cedar)
|
|
169
|
+
return "";
|
|
145
170
|
if (!this.cedarContext) {
|
|
146
|
-
return
|
|
171
|
+
return cedar;
|
|
147
172
|
}
|
|
148
173
|
try {
|
|
149
|
-
return (0, compile_js_1.compileSingleCapability)(capability, this.cedarContext);
|
|
174
|
+
return (0, compile_js_1.compileSingleCapability)({ ...capability, cedar }, this.cedarContext);
|
|
150
175
|
}
|
|
151
176
|
catch {
|
|
152
|
-
return
|
|
177
|
+
return cedar;
|
|
153
178
|
}
|
|
154
179
|
}
|
|
155
180
|
renderHeadline() {
|
|
@@ -162,14 +187,18 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
162
187
|
});
|
|
163
188
|
const escaped = escapeHtml(raw);
|
|
164
189
|
const withSerifEntities = escaped
|
|
165
|
-
.replace("@@AGENT@@", `<em>${
|
|
166
|
-
.replace("@@ORG@@", `<em>${
|
|
167
|
-
return (0, lit_1.html) `<h1
|
|
190
|
+
.replace("@@AGENT@@", `<em>${escapeHtml(agentName)}</em>`)
|
|
191
|
+
.replace("@@ORG@@", `<em>${escapeHtml(this.orgName || "this site")}</em>`);
|
|
192
|
+
return (0, lit_1.html) `<h1
|
|
193
|
+
class="headline"
|
|
194
|
+
part="headline"
|
|
195
|
+
.innerHTML=${withSerifEntities}
|
|
196
|
+
></h1>`;
|
|
168
197
|
}
|
|
169
198
|
render() {
|
|
170
199
|
const tokens = tokens_js_1.CONSENT_COPY_TOKENS;
|
|
171
200
|
const agentName = this.agentMetadata?.name || "this agent";
|
|
172
|
-
const subhead = (0, tokens_js_1.formatToken)(tokens.subhead.template, { Agent: agentName });
|
|
201
|
+
const subhead = this.description || (0, tokens_js_1.formatToken)(tokens.subhead.template, { Agent: agentName });
|
|
173
202
|
const sectionHeader = (0, tokens_js_1.formatToken)(tokens.section.capabilitiesHeader, {
|
|
174
203
|
Agent: agentName.toUpperCase(),
|
|
175
204
|
});
|
|
@@ -178,6 +207,7 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
178
207
|
${this.hostStyle()}
|
|
179
208
|
</style>
|
|
180
209
|
<consent-connector-header
|
|
210
|
+
part="connector"
|
|
181
211
|
clientName="${this.agentMetadata?.name || ""}"
|
|
182
212
|
clientDid="${this.agentMetadata?.did || ""}"
|
|
183
213
|
client-logo-url="${this.agentMetadata?.logoUrl || ""}"
|
|
@@ -187,11 +217,13 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
187
217
|
logo-dev-token="${this.logoDevToken}"
|
|
188
218
|
></consent-connector-header>
|
|
189
219
|
<div class="card" part="card">
|
|
190
|
-
<span class="eyebrow">${tokens.eyebrow.permissionRequest}</span>
|
|
220
|
+
<span class="eyebrow" part="eyebrow">${tokens.eyebrow.permissionRequest}</span>
|
|
191
221
|
${this.renderHeadline()}
|
|
192
|
-
<p class="subhead">${subhead}</p>
|
|
222
|
+
<p class="subhead" part="subhead">${subhead}</p>
|
|
223
|
+
<slot name="identity"></slot>
|
|
193
224
|
${this.agentMetadata
|
|
194
225
|
? (0, lit_1.html) `<consent-agent-header
|
|
226
|
+
part="agent"
|
|
195
227
|
agentName="${this.agentMetadata.name}"
|
|
196
228
|
vendor="${this.agentMetadata.vendor || ""}"
|
|
197
229
|
surfaceLabel="${this.agentMetadata.surfaceLabel || ""}"
|
|
@@ -200,7 +232,7 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
200
232
|
connectedAt="${this.agentMetadata.connectedAt || ""}"
|
|
201
233
|
></consent-agent-header>`
|
|
202
234
|
: lit_1.nothing}
|
|
203
|
-
<div>
|
|
235
|
+
<div part="permissions">
|
|
204
236
|
<div class="section-header">
|
|
205
237
|
<span>${sectionHeader}</span>
|
|
206
238
|
<span class="hint">${tokens.section.tapToToggle}</span>
|
|
@@ -214,52 +246,61 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
214
246
|
icon="${capability.icon}"
|
|
215
247
|
riskLevel="${capability.riskLevel}"
|
|
216
248
|
?checked=${this.selected.has(capability.id)}
|
|
249
|
+
?disabled=${this.loading || this.disabled}
|
|
250
|
+
.scopes=${capability.scopes}
|
|
217
251
|
compiled-cedar="${this.compileCapabilityCedar(capability)}"
|
|
218
252
|
></consent-capability-card>
|
|
219
253
|
`)}
|
|
220
254
|
</div>
|
|
221
255
|
</div>
|
|
222
256
|
<slot name="auth"></slot>
|
|
223
|
-
<
|
|
257
|
+
<slot name="details"></slot>
|
|
258
|
+
<slot name="notice"><consent-revocation-notice
|
|
224
259
|
revocationPath="${this.revocationPath}"
|
|
225
260
|
orgName="${this.orgName || "this site"}"
|
|
226
261
|
inactivityDays=${this.inactivityDays}
|
|
227
|
-
></consent-revocation-notice>
|
|
262
|
+
></consent-revocation-notice></slot>
|
|
228
263
|
<consent-action-bar
|
|
264
|
+
part="actions"
|
|
229
265
|
agentName="${agentName}"
|
|
230
266
|
theme="${this.theme}"
|
|
231
267
|
?loading=${this.loading}
|
|
232
|
-
?disabled=${this.
|
|
268
|
+
?disabled=${this.approvalDisabled}
|
|
269
|
+
submit-label=${this.submitLabel}
|
|
270
|
+
cancel-label=${this.cancelLabel}
|
|
271
|
+
exportparts="submit, cancel"
|
|
233
272
|
@consent-allow=${this.onAllow}
|
|
234
273
|
@consent-deny=${this.onDeny}
|
|
235
274
|
></consent-action-bar>
|
|
236
|
-
<consent-footer
|
|
275
|
+
<slot name="footer"><consent-footer
|
|
237
276
|
theme="${this.theme}"
|
|
238
277
|
howItWorksUrl="${this.howItWorksUrl}"
|
|
239
|
-
></consent-footer>
|
|
278
|
+
></consent-footer></slot>
|
|
240
279
|
</div>
|
|
241
280
|
`;
|
|
242
281
|
}
|
|
243
282
|
};
|
|
244
283
|
exports.ConsentCapabilitiesScreen = ConsentCapabilitiesScreen;
|
|
284
|
+
ConsentCapabilitiesScreen.features = capabilities_js_1.CONSENT_CAPABILITIES_FEATURES;
|
|
245
285
|
ConsentCapabilitiesScreen.styles = (0, lit_1.css) `
|
|
246
286
|
:host {
|
|
247
287
|
display: block;
|
|
248
288
|
box-sizing: border-box;
|
|
249
289
|
width: 100%;
|
|
250
|
-
max-width: 560px;
|
|
290
|
+
max-width: var(--cs-screen-max-width, 560px);
|
|
251
291
|
margin: 0 auto;
|
|
252
292
|
}
|
|
253
293
|
|
|
254
294
|
.card {
|
|
295
|
+
min-width: 0;
|
|
255
296
|
background: var(--cs-surface-card);
|
|
256
297
|
border: 1px solid var(--cs-surface-border);
|
|
257
298
|
border-radius: 22px;
|
|
258
299
|
box-shadow: var(--cs-card-shadow);
|
|
259
|
-
padding: 28px 28px 22px;
|
|
300
|
+
padding: var(--cs-card-padding, 28px 28px 22px);
|
|
260
301
|
display: flex;
|
|
261
302
|
flex-direction: column;
|
|
262
|
-
gap: 22px;
|
|
303
|
+
gap: var(--cs-card-gap, 22px);
|
|
263
304
|
color: var(--cs-text-primary);
|
|
264
305
|
}
|
|
265
306
|
|
|
@@ -273,11 +314,12 @@ ConsentCapabilitiesScreen.styles = (0, lit_1.css) `
|
|
|
273
314
|
|
|
274
315
|
.headline {
|
|
275
316
|
font-family: "Times New Roman", Georgia, serif;
|
|
276
|
-
font-size: 30px;
|
|
317
|
+
font-size: var(--cs-headline-font-size, clamp(24px, 5vw, 30px));
|
|
277
318
|
line-height: 1.18;
|
|
278
319
|
letter-spacing: -0.01em;
|
|
279
320
|
color: var(--cs-text-primary);
|
|
280
321
|
margin: 0;
|
|
322
|
+
overflow-wrap: anywhere;
|
|
281
323
|
}
|
|
282
324
|
|
|
283
325
|
.headline em {
|
|
@@ -285,7 +327,7 @@ ConsentCapabilitiesScreen.styles = (0, lit_1.css) `
|
|
|
285
327
|
}
|
|
286
328
|
|
|
287
329
|
.subhead {
|
|
288
|
-
font-size: 14.5px;
|
|
330
|
+
font-size: var(--cs-subhead-font-size, 14.5px);
|
|
289
331
|
color: var(--cs-text-secondary);
|
|
290
332
|
line-height: 1.55;
|
|
291
333
|
margin: 0;
|
|
@@ -300,6 +342,8 @@ ConsentCapabilitiesScreen.styles = (0, lit_1.css) `
|
|
|
300
342
|
font-weight: 600;
|
|
301
343
|
color: var(--cs-text-tertiary);
|
|
302
344
|
text-transform: uppercase;
|
|
345
|
+
gap: 12px;
|
|
346
|
+
flex-wrap: wrap;
|
|
303
347
|
}
|
|
304
348
|
|
|
305
349
|
.section-header .hint {
|
|
@@ -313,6 +357,12 @@ ConsentCapabilitiesScreen.styles = (0, lit_1.css) `
|
|
|
313
357
|
display: flex;
|
|
314
358
|
flex-direction: column;
|
|
315
359
|
}
|
|
360
|
+
|
|
361
|
+
@media (max-width: 480px) {
|
|
362
|
+
.card {
|
|
363
|
+
padding: var(--cs-card-padding-mobile, 20px 18px);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
316
366
|
`;
|
|
317
367
|
__decorate([
|
|
318
368
|
(0, decorators_js_1.property)({ type: Array })
|
|
@@ -344,6 +394,18 @@ __decorate([
|
|
|
344
394
|
__decorate([
|
|
345
395
|
(0, decorators_js_1.property)({ type: Boolean })
|
|
346
396
|
], ConsentCapabilitiesScreen.prototype, "loading", void 0);
|
|
397
|
+
__decorate([
|
|
398
|
+
(0, decorators_js_1.property)({ type: Boolean })
|
|
399
|
+
], ConsentCapabilitiesScreen.prototype, "disabled", void 0);
|
|
400
|
+
__decorate([
|
|
401
|
+
(0, decorators_js_1.property)({ type: String })
|
|
402
|
+
], ConsentCapabilitiesScreen.prototype, "description", void 0);
|
|
403
|
+
__decorate([
|
|
404
|
+
(0, decorators_js_1.property)({ type: String, attribute: "submit-label" })
|
|
405
|
+
], ConsentCapabilitiesScreen.prototype, "submitLabel", void 0);
|
|
406
|
+
__decorate([
|
|
407
|
+
(0, decorators_js_1.property)({ type: String, attribute: "cancel-label" })
|
|
408
|
+
], ConsentCapabilitiesScreen.prototype, "cancelLabel", void 0);
|
|
347
409
|
__decorate([
|
|
348
410
|
(0, decorators_js_1.property)({ type: Boolean, reflect: true, attribute: "all-selected" })
|
|
349
411
|
], ConsentCapabilitiesScreen.prototype, "allSelected", void 0);
|
|
@@ -359,6 +421,9 @@ __decorate([
|
|
|
359
421
|
__decorate([
|
|
360
422
|
(0, decorators_js_1.property)({ type: String, attribute: "server-logo-url" })
|
|
361
423
|
], ConsentCapabilitiesScreen.prototype, "serverLogoUrl", void 0);
|
|
424
|
+
__decorate([
|
|
425
|
+
(0, decorators_js_1.property)({ type: Boolean, attribute: "require-all" })
|
|
426
|
+
], ConsentCapabilitiesScreen.prototype, "requireAll", void 0);
|
|
362
427
|
__decorate([
|
|
363
428
|
(0, decorators_js_1.state)()
|
|
364
429
|
], ConsentCapabilitiesScreen.prototype, "selected", void 0);
|
|
@@ -373,14 +438,4 @@ function escapeHtml(value) {
|
|
|
373
438
|
.replace(/"/g, """)
|
|
374
439
|
.replace(/'/g, "'");
|
|
375
440
|
}
|
|
376
|
-
/**
|
|
377
|
-
* Escape an entity name for HTML AND replace any internal whitespace with
|
|
378
|
-
* non-breaking spaces. Used inside the serif italic spans of the headline so
|
|
379
|
-
* multi-word brand names ("Hardware World", "Bank of Acme") wrap as a single
|
|
380
|
-
* unit instead of splitting across lines. Applied to any operator-set entity
|
|
381
|
-
* name, so the rule scales to any deployment without per-brand tweaking.
|
|
382
|
-
*/
|
|
383
|
-
function nbspEscape(value) {
|
|
384
|
-
return escapeHtml(value).replace(/\s+/g, " ");
|
|
385
|
-
}
|
|
386
441
|
//# sourceMappingURL=consent-capabilities-screen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-capabilities-screen.js","sourceRoot":"","sources":["../../../src/components/consent-capabilities-screen.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;AAEH,6BAAqD;AACrD,qDAAmE;AAEnE,iDAAqE;AACrE,iDAA0E;AAO1E,oDAA8D;AAC9D,yFAGkD;AAClD,qCAAmC;AACnC,wCAAsC;AACtC,mCAAiC;AACjC,+BAA6B;AAC7B,0CAAwC;AACxC,yCAAuC;
|
|
1
|
+
{"version":3,"file":"consent-capabilities-screen.js","sourceRoot":"","sources":["../../../src/components/consent-capabilities-screen.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;AAEH,6BAAqD;AACrD,qDAAmE;AAEnE,iDAAqE;AACrE,iDAA0E;AAO1E,oDAA8D;AAC9D,yFAGkD;AAClD,kEAA6E;AAC7E,qCAAmC;AACnC,wCAAsC;AACtC,mCAAiC;AACjC,+BAA6B;AAC7B,0CAAwC;AACxC,yCAAuC;AAYhC,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,gBAAU;IAAlD;;QAGsB,iBAAY,GAA6B,EAAE,CAAC;QAG3C,YAAO,GAAG,EAAE,CAAC;QACb,iBAAY,GAAG,KAAK,CAAC;QACrB,mBAAc,GAAG,4BAA4B,CAAC;QAC9C,mBAAc,GAAG,EAAE,CAAC;QACpB,UAAK,GAAiB,OAAO,CAAC;QACC,kBAAa,GAAG,EAAE,CAAC;QACjD,YAAO,GAAG,KAAK,CAAC;QAC7C,2DAA2D;QAC9B,aAAQ,GAAG,KAAK,CAAC;QAClB,gBAAW,GAAG,EAAE,CAAC;QACU,gBAAW,GAAG,EAAE,CAAC;QACjB,gBAAW,GAAG,EAAE,CAAC;QAExE;;;;WAIG;QAEH,gBAAW,GAAG,KAAK,CAAC;QAEpB;;;;WAIG;QACuD,kBAAa,GACrE,KAAK,CAAC;QAER;;;;WAIG;QACqD,iBAAY,GAAG,EAAE,CAAC;QAE1E;;;;WAIG;QACsD,iBAAY,GAAG,EAAE,CAAC;QAE3E;;;;WAIG;QACuD,kBAAa,GAAG,EAAE,CAAC;QAE7E,0EAA0E;QACnB,eAAU,GAAG,KAAK,CAAC;QAEzD,aAA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I,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -32,10 +32,14 @@ let ConsentCapabilityCard = class ConsentCapabilityCard extends lit_1.LitElement
|
|
|
32
32
|
this.icon = "neutral";
|
|
33
33
|
this.riskLevel = "low";
|
|
34
34
|
this.checked = false;
|
|
35
|
+
this.disabled = false;
|
|
36
|
+
this.scopes = [];
|
|
35
37
|
this.compiledCedar = "";
|
|
36
38
|
this.policyOpen = false;
|
|
37
39
|
}
|
|
38
40
|
toggleChecked() {
|
|
41
|
+
if (this.disabled)
|
|
42
|
+
return;
|
|
39
43
|
this.checked = !this.checked;
|
|
40
44
|
const detail = {
|
|
41
45
|
id: this.capabilityId,
|
|
@@ -119,10 +123,11 @@ let ConsentCapabilityCard = class ConsentCapabilityCard extends lit_1.LitElement
|
|
|
119
123
|
class="row"
|
|
120
124
|
part="row"
|
|
121
125
|
role="button"
|
|
122
|
-
tabindex
|
|
126
|
+
tabindex=${this.disabled ? "-1" : "0"}
|
|
127
|
+
aria-disabled=${String(this.disabled)}
|
|
123
128
|
@click=${this.onRowClick}
|
|
124
129
|
@keydown=${(e) => {
|
|
125
|
-
if (e.key === " " || e.key === "Enter") {
|
|
130
|
+
if (e.target === e.currentTarget && (e.key === " " || e.key === "Enter")) {
|
|
126
131
|
e.preventDefault();
|
|
127
132
|
this.toggleChecked();
|
|
128
133
|
}
|
|
@@ -134,6 +139,7 @@ let ConsentCapabilityCard = class ConsentCapabilityCard extends lit_1.LitElement
|
|
|
134
139
|
role="checkbox"
|
|
135
140
|
aria-checked="${String(this.checked)}"
|
|
136
141
|
aria-label="${this.label}"
|
|
142
|
+
?disabled=${this.disabled}
|
|
137
143
|
@click=${(e) => {
|
|
138
144
|
e.stopPropagation();
|
|
139
145
|
this.toggleChecked();
|
|
@@ -154,14 +160,17 @@ let ConsentCapabilityCard = class ConsentCapabilityCard extends lit_1.LitElement
|
|
|
154
160
|
? (0, lit_1.html) `<span class="risk-chip">${tokens.higherRiskChip}</span>`
|
|
155
161
|
: lit_1.nothing}
|
|
156
162
|
</div>
|
|
157
|
-
|
|
163
|
+
${this.scopes.length > 0
|
|
164
|
+
? (0, lit_1.html) `<ul class="scopes" aria-label="Scopes">${this.scopes.map((scope) => (0, lit_1.html) `<li><code part="scope">${scope}</code></li>`)}</ul>`
|
|
165
|
+
: lit_1.nothing}
|
|
166
|
+
${this.compiledCedar.trim() ? (0, lit_1.html) `<button
|
|
158
167
|
class="policy-toggle"
|
|
159
168
|
type="button"
|
|
160
169
|
@click=${this.togglePolicy}
|
|
161
170
|
aria-expanded="${String(this.policyOpen)}"
|
|
162
171
|
>
|
|
163
172
|
${tokens.viewPolicyLink}
|
|
164
|
-
</button
|
|
173
|
+
</button>` : lit_1.nothing}
|
|
165
174
|
${this.renderPolicy()}
|
|
166
175
|
</div>
|
|
167
176
|
</div>
|
|
@@ -197,6 +206,22 @@ ConsentCapabilityCard.styles = (0, lit_1.css) `
|
|
|
197
206
|
background: var(--cs-row-hover-bg, rgba(15, 23, 42, 0.025));
|
|
198
207
|
}
|
|
199
208
|
|
|
209
|
+
.row[aria-disabled="true"], .checkbox:disabled {
|
|
210
|
+
cursor: not-allowed;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.scopes {
|
|
214
|
+
display: flex;
|
|
215
|
+
flex-direction: column;
|
|
216
|
+
gap: 4px;
|
|
217
|
+
margin: 0;
|
|
218
|
+
padding: 0;
|
|
219
|
+
list-style: none;
|
|
220
|
+
font-size: var(--cs-scope-font-size, 11.5px);
|
|
221
|
+
color: var(--cs-text-secondary, #334155);
|
|
222
|
+
overflow-wrap: anywhere;
|
|
223
|
+
}
|
|
224
|
+
|
|
200
225
|
.checkbox {
|
|
201
226
|
width: 22px;
|
|
202
227
|
height: 22px;
|
|
@@ -352,6 +377,12 @@ __decorate([
|
|
|
352
377
|
__decorate([
|
|
353
378
|
(0, decorators_js_1.property)({ type: Boolean, reflect: true })
|
|
354
379
|
], ConsentCapabilityCard.prototype, "checked", void 0);
|
|
380
|
+
__decorate([
|
|
381
|
+
(0, decorators_js_1.property)({ type: Boolean, reflect: true })
|
|
382
|
+
], ConsentCapabilityCard.prototype, "disabled", void 0);
|
|
383
|
+
__decorate([
|
|
384
|
+
(0, decorators_js_1.property)({ type: Array })
|
|
385
|
+
], ConsentCapabilityCard.prototype, "scopes", void 0);
|
|
355
386
|
__decorate([
|
|
356
387
|
(0, decorators_js_1.property)({ type: String, attribute: "compiled-cedar" })
|
|
357
388
|
], ConsentCapabilityCard.prototype, "compiledCedar", void 0);
|