@kya-os/consent 0.1.47 → 0.1.49
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 +1 -0
- package/dist/bundle/inline.d.ts.map +1 -1
- package/dist/bundle/inline.js +5 -4
- package/dist/bundle/inline.js.map +1 -1
- package/dist/bundle/shell.d.ts +4 -0
- package/dist/bundle/shell.d.ts.map +1 -1
- package/dist/bundle/shell.js +7 -3
- package/dist/bundle/shell.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/bundle/shell.js +7 -3
- package/dist/cjs/bundle/shell.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 +116 -42
- 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/consent-revocation-notice.js +14 -6
- package/dist/cjs/components/consent-revocation-notice.js.map +1 -1
- package/dist/cjs/components/mcp-consent.js +153 -37
- 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/copy/tokens.js +2 -0
- package/dist/cjs/copy/tokens.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/api.schemas.js +1 -0
- package/dist/cjs/schemas/api.schemas.js.map +1 -1
- 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 +19 -5
- package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
- package/dist/components/consent-capabilities-screen.js +116 -42
- 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/consent-revocation-notice.d.ts +2 -1
- package/dist/components/consent-revocation-notice.d.ts.map +1 -1
- package/dist/components/consent-revocation-notice.js +14 -6
- package/dist/components/consent-revocation-notice.js.map +1 -1
- package/dist/components/mcp-consent.d.ts +11 -0
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +153 -37
- package/dist/components/mcp-consent.js.map +1 -1
- package/dist/consent.js +358 -63
- package/dist/consent.min.js +271 -163
- 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/copy/tokens.d.ts +2 -0
- package/dist/copy/tokens.d.ts.map +1 -1
- package/dist/copy/tokens.js +2 -0
- package/dist/copy/tokens.js.map +1 -1
- package/dist/mcp-app/index.d.ts +1 -0
- package/dist/mcp-app/index.js +1 -0
- package/dist/mcp-app/inline.d.ts +1 -0
- package/dist/mcp-app/inline.d.ts.map +1 -1
- package/dist/mcp-app/inline.js +3 -2
- package/dist/mcp-app/inline.js.map +1 -1
- package/dist/mcp-app/types.d.ts +1 -0
- package/dist/mcp-app/types.js +1 -0
- 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 +93 -68
- package/dist/schemas/api.schemas.d.ts.map +1 -1
- package/dist/schemas/api.schemas.js +1 -0
- package/dist/schemas/api.schemas.js.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/api.types.d.ts +2 -0
- package/dist/types/api.types.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 +8 -6
|
@@ -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,i1gRAAi1gR,CAAC;AAEx3gR;;GAEG;AACU,QAAA,mBAAmB,GAAW,MAAM,CAAC;AAElD;;GAEG;AACU,QAAA,mBAAmB,GAAW,kBAAkB,CAAC;AAE9D;;;;;;;;;;;GAWG;AACU,QAAA,mBAAmB,GAAW,8BAA8B,CAAC"}
|
package/dist/cjs/bundle/shell.js
CHANGED
|
@@ -46,10 +46,10 @@ const inline_js_1 = require("./inline.js");
|
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
48
|
function generateConsentShell(options) {
|
|
49
|
-
const { config, tool, scopes, agentDid, sessionId, projectId, serverUrl, oauthIdentity, bundlePath = inline_js_1.CONSENT_BUNDLE_PATH, pageTitle = "Permission Request", nonce, authMode, agentName, provider, csrfToken, credentialProviderType, credentialProvider, userDid, // CRITICAL: Bypasses KV consistency issues
|
|
49
|
+
const { config, tool, scopes, agentDid, sessionId, anchorSid, projectId, serverUrl, oauthIdentity, bundlePath = inline_js_1.CONSENT_BUNDLE_PATH, pageTitle = "Permission Request", nonce, authMode, agentName, provider, csrfToken, credentialProviderType, credentialProvider, userDid, // CRITICAL: Bypasses KV consistency issues
|
|
50
50
|
credentialUserEmail, // User email from credential provider
|
|
51
51
|
credentialProviderUserId, // Provider's user ID (e.g., customer ID)
|
|
52
|
-
oauthUrl, // Pre-built OAuth authorization URL
|
|
52
|
+
nativeScopeSelection, oauthUrl, // Pre-built OAuth authorization URL
|
|
53
53
|
authorizationType, // Dynamic authorization type from tool protection
|
|
54
54
|
oauthProviderType, // OAuth provider type from prior OAuth auth step
|
|
55
55
|
oauthProviderName, // OAuth provider name (e.g., 'custom', 'github')
|
|
@@ -209,6 +209,7 @@ function generateConsentShell(options) {
|
|
|
209
209
|
scopes='${(0, escape_js_1.escapeAttr)(scopesJson)}'
|
|
210
210
|
agent-did="${(0, escape_js_1.escapeAttr)(agentDid)}"
|
|
211
211
|
session-id="${(0, escape_js_1.escapeAttr)(sessionId)}"
|
|
212
|
+
${anchorSid ? `anchor-sid="${(0, escape_js_1.escapeAttr)(anchorSid)}"` : ""}
|
|
212
213
|
project-id="${(0, escape_js_1.escapeAttr)(projectId)}"
|
|
213
214
|
server-url="${(0, escape_js_1.escapeAttr)(serverUrl)}"
|
|
214
215
|
${oauthJson ? `oauth-identity='${(0, escape_js_1.escapeAttr)(oauthJson)}'` : ""}
|
|
@@ -221,6 +222,7 @@ function generateConsentShell(options) {
|
|
|
221
222
|
${userDid ? `user-did="${(0, escape_js_1.escapeAttr)(userDid)}"` : ""}
|
|
222
223
|
${credentialUserEmail ? `credential-user-email="${(0, escape_js_1.escapeAttr)(credentialUserEmail)}"` : ""}
|
|
223
224
|
${credentialProviderUserId ? `credential-provider-user-id="${(0, escape_js_1.escapeAttr)(credentialProviderUserId)}"` : ""}
|
|
225
|
+
${nativeScopeSelection ? "native-scope-selection" : ""}
|
|
224
226
|
${oauthUrl ? `oauth-url="${(0, escape_js_1.escapeAttr)(oauthUrl)}"` : ""}
|
|
225
227
|
${authorizationType ? `authorization-type="${(0, escape_js_1.escapeAttr)(authorizationType)}"` : ""}
|
|
226
228
|
${oauthProviderType ? `oauth-provider-type="${(0, escape_js_1.escapeAttr)(oauthProviderType)}"` : ""}
|
|
@@ -261,6 +263,7 @@ function generateConsentShell(options) {
|
|
|
261
263
|
<input type="hidden" name="scopes" value="${(0, escape_js_1.escapeAttr)(scopesJson)}">
|
|
262
264
|
<input type="hidden" name="agent_did" value="${(0, escape_js_1.escapeAttr)(agentDid)}">
|
|
263
265
|
<input type="hidden" name="session_id" value="${(0, escape_js_1.escapeAttr)(sessionId)}">
|
|
266
|
+
${anchorSid ? `<input type="hidden" name="sid" value="${(0, escape_js_1.escapeAttr)(anchorSid)}">` : ""}
|
|
264
267
|
<input type="hidden" name="project_id" value="${(0, escape_js_1.escapeAttr)(projectId)}">
|
|
265
268
|
<input type="hidden" name="auth_mode" value="consent-only">
|
|
266
269
|
<input type="hidden" name="provider_type" value="none">
|
|
@@ -286,7 +289,7 @@ function generateConsentShell(options) {
|
|
|
286
289
|
* @param bundleSource - The bundled consent.js source code
|
|
287
290
|
*/
|
|
288
291
|
function generateInlineConsentShell(options, bundleSource) {
|
|
289
|
-
const { config, tool, scopes, agentDid, sessionId, projectId, serverUrl, oauthIdentity, pageTitle = "Permission Request", nonce, } = options;
|
|
292
|
+
const { config, tool, scopes, agentDid, sessionId, anchorSid, projectId, serverUrl, oauthIdentity, pageTitle = "Permission Request", nonce, } = options;
|
|
290
293
|
const configJson = JSON.stringify(config);
|
|
291
294
|
const scopesJson = JSON.stringify(scopes);
|
|
292
295
|
const oauthJson = oauthIdentity ? JSON.stringify(oauthIdentity) : null;
|
|
@@ -320,6 +323,7 @@ ${bundleSource}
|
|
|
320
323
|
scopes='${(0, escape_js_1.escapeAttr)(scopesJson)}'
|
|
321
324
|
agent-did="${(0, escape_js_1.escapeAttr)(agentDid)}"
|
|
322
325
|
session-id="${(0, escape_js_1.escapeAttr)(sessionId)}"
|
|
326
|
+
${anchorSid ? `anchor-sid="${(0, escape_js_1.escapeAttr)(anchorSid)}"` : ""}
|
|
323
327
|
project-id="${(0, escape_js_1.escapeAttr)(projectId)}"
|
|
324
328
|
server-url="${(0, escape_js_1.escapeAttr)(serverUrl)}"
|
|
325
329
|
${oauthJson ? `oauth-identity='${(0, escape_js_1.escapeAttr)(oauthJson)}'` : ""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../../src/bundle/shell.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;
|
|
1
|
+
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../../src/bundle/shell.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AA2JH,oDA4PC;AAgBD,gEA2DC;AAheD,qDAA+D;AAC/D,2CAAkD;AA8HlD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,SAAgB,oBAAoB,CAAC,OAA4B;IAC/D,MAAM,EACJ,MAAM,EACN,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,aAAa,EACb,UAAU,GAAG,+BAAmB,EAChC,SAAS,GAAG,oBAAoB,EAChC,KAAK,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,SAAS,EACT,sBAAsB,EACtB,kBAAkB,EAClB,OAAO,EAAE,2CAA2C;IACpD,mBAAmB,EAAE,sCAAsC;IAC3D,wBAAwB,EAAE,yCAAyC;IACnE,oBAAoB,EACpB,QAAQ,EAAE,oCAAoC;IAC9C,iBAAiB,EAAE,kDAAkD;IACrE,iBAAiB,EAAE,iDAAiD;IACpE,iBAAiB,EAAE,iDAAiD;IACpE,YAAY,EAAE,yDAAyD;IACvE,aAAa,EAAE,+BAA+B;IAC9C,YAAY,EAAE,kCAAkC;IAChD,OAAO,EAAE,iCAAiC;IAC1C,YAAY,EAAE,6BAA6B;IAC3C,cAAc,EAAE,oCAAoC;IACpD,cAAc,EAAE,4CAA4C;IAC5D,aAAa,EAAE,oCAAoC;IACnD,YAAY,EAAE,uD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E,CAAC;IAE/D,OAAO;;;;;WAKE,IAAA,sBAAU,EAAC,SAAS,CAAC;yBACP,SAAS;EAChC,YAAY;;UAEJ,SAAS;;;;;;;;;;;;;;;cAeL,IAAA,sBAAU,EAAC,UAAU,CAAC;YACxB,IAAA,sBAAU,EAAC,IAAI,CAAC;cACd,IAAA,sBAAU,EAAC,UAAU,CAAC;iBACnB,IAAA,sBAAU,EAAC,QAAQ,CAAC;kBACnB,IAAA,sBAAU,EAAC,SAAS,CAAC;MACjC,SAAS,CAAC,CAAC,CAAC,eAAe,IAAA,sBAAU,EAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;kBAC5C,IAAA,sBAAU,EAAC,SAAS,CAAC;kBACrB,IAAA,sBAAU,EAAC,SAAS,CAAC;MACjC,SAAS,CAAC,CAAC,CAAC,mBAAmB,IAAA,sBAAU,EAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;;;QAG1D,CAAC;AACT,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":";AAA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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,CACb,mEAAmE,GAAG,IAAI,CAC3E,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IAEH,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CACb,mCAAmC,UAAU,CAAC,EAAE,+BAA+B,CAChF,CAAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,0BAA0B,CACxC,MAAoB,EACpB,OAA6B,EAC7B,KAAsC;IAEtC,MAAM,MAAM,GAAG,IAAA,uCAAe,EAAC,KAAK,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAiB,E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AA;;;;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;QAC7B,aAAQ,GAAG,KAAK,CAAC;QACjB,YAAO,GAAG,KAAK,CAAC;QACU,gBAAW,GAAG,EAAE,CAAC;QACjB,gBAAW,GAAG,EAAE,CAAC;IAqG1E,CAAC;IA/CS,SAAS;QACf,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO;QAC1C,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CACpE,CAAC;IACJ,CAAC;IAEO,QAAQ;QACd,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO;QACzB,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,cAAc,EAAE,EAAE,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,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");
|
|
@@ -44,9 +45,15 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
44
45
|
this.headlineVerb = "use";
|
|
45
46
|
this.revocationPath = "Account → Connected Agents";
|
|
46
47
|
this.inactivityDays = 90;
|
|
48
|
+
this.fixedExpiry = false;
|
|
47
49
|
this.theme = "light";
|
|
48
50
|
this.howItWorksUrl = "";
|
|
49
51
|
this.loading = false;
|
|
52
|
+
/** Blocks approval while allowing the human to decline. */
|
|
53
|
+
this.disabled = false;
|
|
54
|
+
this.description = "";
|
|
55
|
+
this.submitLabel = "";
|
|
56
|
+
this.cancelLabel = "";
|
|
50
57
|
/**
|
|
51
58
|
* Seed every capability as selected. The credential path grants a fixed,
|
|
52
59
|
* all-or-nothing scope set, so every capability starts checked — the rows
|
|
@@ -77,6 +84,8 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
77
84
|
* reach this screen the same way it reaches the other consent screens.
|
|
78
85
|
*/
|
|
79
86
|
this.serverLogoUrl = "";
|
|
87
|
+
/** Fixed grants require every disclosed capability to remain selected. */
|
|
88
|
+
this.requireAll = false;
|
|
80
89
|
this.selected = new Set();
|
|
81
90
|
/**
|
|
82
91
|
* Last capability set this component seeded `selected` from, per
|
|
@@ -85,7 +94,17 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
85
94
|
*/
|
|
86
95
|
this.seedKey = "";
|
|
87
96
|
this.onCapabilityToggle = (event) => {
|
|
97
|
+
if (this.loading || this.disabled || !(event instanceof CustomEvent))
|
|
98
|
+
return;
|
|
88
99
|
const detail = event.detail;
|
|
100
|
+
if (!detail ||
|
|
101
|
+
typeof detail !== "object" ||
|
|
102
|
+
!("id" in detail) ||
|
|
103
|
+
typeof detail.id !== "string" ||
|
|
104
|
+
!("checked" in detail) ||
|
|
105
|
+
typeof detail.checked !== "boolean" ||
|
|
106
|
+
!this.capabilities.some((capability) => capability.id === detail.id))
|
|
107
|
+
return;
|
|
89
108
|
const next = new Set(this.selected);
|
|
90
109
|
if (detail.checked)
|
|
91
110
|
next.add(detail.id);
|
|
@@ -94,12 +113,13 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
94
113
|
this.selected = next;
|
|
95
114
|
};
|
|
96
115
|
this.onAllow = () => {
|
|
97
|
-
if (this.loading)
|
|
116
|
+
if (this.loading || this.approvalDisabled)
|
|
98
117
|
return;
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
118
|
+
const selectedCapabilities = this.capabilities.filter((c) => this.selected.has(c.id));
|
|
119
|
+
if (selectedCapabilities.length === 0)
|
|
120
|
+
return;
|
|
121
|
+
const selectedIds = selectedCapabilities.map((c) => c.id);
|
|
122
|
+
const selectedScopes = Array.from(new Set(selectedCapabilities.flatMap((c) => c.scopes)));
|
|
103
123
|
const detail = {
|
|
104
124
|
selectedCapabilityIds: selectedIds,
|
|
105
125
|
selectedScopes,
|
|
@@ -111,6 +131,8 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
111
131
|
}));
|
|
112
132
|
};
|
|
113
133
|
this.onDeny = () => {
|
|
134
|
+
if (this.loading)
|
|
135
|
+
return;
|
|
114
136
|
this.dispatchEvent(new CustomEvent("capabilities-deny", { bubbles: true, composed: true }));
|
|
115
137
|
};
|
|
116
138
|
}
|
|
@@ -141,15 +163,25 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
141
163
|
hostStyle() {
|
|
142
164
|
return `:host { ${(0, theme_js_1.themeToCssVariables)((0, theme_js_1.getConsentTheme)(this.theme))} }`;
|
|
143
165
|
}
|
|
166
|
+
get approvalDisabled() {
|
|
167
|
+
return (this.disabled ||
|
|
168
|
+
this.allowDisabled ||
|
|
169
|
+
this.selected.size === 0 ||
|
|
170
|
+
(this.requireAll &&
|
|
171
|
+
this.capabilities.some((capability) => !this.selected.has(capability.id))));
|
|
172
|
+
}
|
|
144
173
|
compileCapabilityCedar(capability) {
|
|
174
|
+
const cedar = capability.cedar?.trim() || "";
|
|
175
|
+
if (!cedar)
|
|
176
|
+
return "";
|
|
145
177
|
if (!this.cedarContext) {
|
|
146
|
-
return
|
|
178
|
+
return cedar;
|
|
147
179
|
}
|
|
148
180
|
try {
|
|
149
|
-
return (0, compile_js_1.compileSingleCapability)(capability, this.cedarContext);
|
|
181
|
+
return (0, compile_js_1.compileSingleCapability)({ ...capability, cedar }, this.cedarContext);
|
|
150
182
|
}
|
|
151
183
|
catch {
|
|
152
|
-
return
|
|
184
|
+
return cedar;
|
|
153
185
|
}
|
|
154
186
|
}
|
|
155
187
|
renderHeadline() {
|
|
@@ -162,14 +194,19 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
162
194
|
});
|
|
163
195
|
const escaped = escapeHtml(raw);
|
|
164
196
|
const withSerifEntities = escaped
|
|
165
|
-
.replace("@@AGENT@@", `<em>${
|
|
166
|
-
.replace("@@ORG@@", `<em>${
|
|
167
|
-
return (0, lit_1.html) `<h1
|
|
197
|
+
.replace("@@AGENT@@", `<em>${escapeHtml(agentName)}</em>`)
|
|
198
|
+
.replace("@@ORG@@", `<em>${escapeHtml(this.orgName || "this site")}</em>`);
|
|
199
|
+
return (0, lit_1.html) `<h1
|
|
200
|
+
class="headline"
|
|
201
|
+
part="headline"
|
|
202
|
+
.innerHTML=${withSerifEntities}
|
|
203
|
+
></h1>`;
|
|
168
204
|
}
|
|
169
205
|
render() {
|
|
170
206
|
const tokens = tokens_js_1.CONSENT_COPY_TOKENS;
|
|
171
207
|
const agentName = this.agentMetadata?.name || "this agent";
|
|
172
|
-
const subhead =
|
|
208
|
+
const subhead = this.description ||
|
|
209
|
+
(0, tokens_js_1.formatToken)(tokens.subhead.template, { Agent: agentName });
|
|
173
210
|
const sectionHeader = (0, tokens_js_1.formatToken)(tokens.section.capabilitiesHeader, {
|
|
174
211
|
Agent: agentName.toUpperCase(),
|
|
175
212
|
});
|
|
@@ -178,6 +215,7 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
178
215
|
${this.hostStyle()}
|
|
179
216
|
</style>
|
|
180
217
|
<consent-connector-header
|
|
218
|
+
part="connector"
|
|
181
219
|
clientName="${this.agentMetadata?.name || ""}"
|
|
182
220
|
clientDid="${this.agentMetadata?.did || ""}"
|
|
183
221
|
client-logo-url="${this.agentMetadata?.logoUrl || ""}"
|
|
@@ -187,11 +225,15 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
187
225
|
logo-dev-token="${this.logoDevToken}"
|
|
188
226
|
></consent-connector-header>
|
|
189
227
|
<div class="card" part="card">
|
|
190
|
-
<span class="eyebrow"
|
|
228
|
+
<span class="eyebrow" part="eyebrow"
|
|
229
|
+
>${tokens.eyebrow.permissionRequest}</span
|
|
230
|
+
>
|
|
191
231
|
${this.renderHeadline()}
|
|
192
|
-
<p class="subhead">${subhead}</p>
|
|
232
|
+
<p class="subhead" part="subhead">${subhead}</p>
|
|
233
|
+
<slot name="identity"></slot>
|
|
193
234
|
${this.agentMetadata
|
|
194
235
|
? (0, lit_1.html) `<consent-agent-header
|
|
236
|
+
part="agent"
|
|
195
237
|
agentName="${this.agentMetadata.name}"
|
|
196
238
|
vendor="${this.agentMetadata.vendor || ""}"
|
|
197
239
|
surfaceLabel="${this.agentMetadata.surfaceLabel || ""}"
|
|
@@ -200,7 +242,8 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
200
242
|
connectedAt="${this.agentMetadata.connectedAt || ""}"
|
|
201
243
|
></consent-agent-header>`
|
|
202
244
|
: lit_1.nothing}
|
|
203
|
-
<
|
|
245
|
+
<slot name="agent-key"></slot>
|
|
246
|
+
<div part="permissions">
|
|
204
247
|
<div class="section-header">
|
|
205
248
|
<span>${sectionHeader}</span>
|
|
206
249
|
<span class="hint">${tokens.section.tapToToggle}</span>
|
|
@@ -214,52 +257,66 @@ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends lit_1.Li
|
|
|
214
257
|
icon="${capability.icon}"
|
|
215
258
|
riskLevel="${capability.riskLevel}"
|
|
216
259
|
?checked=${this.selected.has(capability.id)}
|
|
260
|
+
?disabled=${this.loading || this.disabled}
|
|
261
|
+
.scopes=${capability.scopes}
|
|
217
262
|
compiled-cedar="${this.compileCapabilityCedar(capability)}"
|
|
218
263
|
></consent-capability-card>
|
|
219
264
|
`)}
|
|
220
265
|
</div>
|
|
221
266
|
</div>
|
|
222
267
|
<slot name="auth"></slot>
|
|
223
|
-
<
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
268
|
+
<slot name="details"></slot>
|
|
269
|
+
<slot name="notice"
|
|
270
|
+
><consent-revocation-notice
|
|
271
|
+
revocationPath="${this.revocationPath}"
|
|
272
|
+
orgName="${this.orgName || "this site"}"
|
|
273
|
+
inactivityDays=${this.inactivityDays}
|
|
274
|
+
?fixed-expiry=${this.fixedExpiry}
|
|
275
|
+
></consent-revocation-notice
|
|
276
|
+
></slot>
|
|
228
277
|
<consent-action-bar
|
|
278
|
+
part="actions"
|
|
229
279
|
agentName="${agentName}"
|
|
230
280
|
theme="${this.theme}"
|
|
231
281
|
?loading=${this.loading}
|
|
232
|
-
?disabled=${this.
|
|
282
|
+
?disabled=${this.approvalDisabled}
|
|
283
|
+
submit-label=${this.submitLabel}
|
|
284
|
+
cancel-label=${this.cancelLabel}
|
|
285
|
+
exportparts="submit, cancel"
|
|
233
286
|
@consent-allow=${this.onAllow}
|
|
234
287
|
@consent-deny=${this.onDeny}
|
|
235
288
|
></consent-action-bar>
|
|
236
|
-
<
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
289
|
+
<slot name="footer"
|
|
290
|
+
><consent-footer
|
|
291
|
+
theme="${this.theme}"
|
|
292
|
+
howItWorksUrl="${this.howItWorksUrl}"
|
|
293
|
+
></consent-footer
|
|
294
|
+
></slot>
|
|
240
295
|
</div>
|
|
241
296
|
`;
|
|
242
297
|
}
|
|
243
298
|
};
|
|
244
299
|
exports.ConsentCapabilitiesScreen = ConsentCapabilitiesScreen;
|
|
300
|
+
ConsentCapabilitiesScreen.features = capabilities_js_1.CONSENT_CAPABILITIES_FEATURES;
|
|
245
301
|
ConsentCapabilitiesScreen.styles = (0, lit_1.css) `
|
|
246
302
|
:host {
|
|
247
303
|
display: block;
|
|
248
304
|
box-sizing: border-box;
|
|
249
305
|
width: 100%;
|
|
250
|
-
max-width: 560px;
|
|
306
|
+
max-width: var(--cs-screen-max-width, 560px);
|
|
251
307
|
margin: 0 auto;
|
|
252
308
|
}
|
|
253
309
|
|
|
254
310
|
.card {
|
|
311
|
+
min-width: 0;
|
|
255
312
|
background: var(--cs-surface-card);
|
|
256
313
|
border: 1px solid var(--cs-surface-border);
|
|
257
314
|
border-radius: 22px;
|
|
258
315
|
box-shadow: var(--cs-card-shadow);
|
|
259
|
-
padding: 28px 28px 22px;
|
|
316
|
+
padding: var(--cs-card-padding, 28px 28px 22px);
|
|
260
317
|
display: flex;
|
|
261
318
|
flex-direction: column;
|
|
262
|
-
gap: 22px;
|
|
319
|
+
gap: var(--cs-card-gap, 22px);
|
|
263
320
|
color: var(--cs-text-primary);
|
|
264
321
|
}
|
|
265
322
|
|
|
@@ -273,11 +330,12 @@ ConsentCapabilitiesScreen.styles = (0, lit_1.css) `
|
|
|
273
330
|
|
|
274
331
|
.headline {
|
|
275
332
|
font-family: "Times New Roman", Georgia, serif;
|
|
276
|
-
font-size: 30px;
|
|
333
|
+
font-size: var(--cs-headline-font-size, clamp(24px, 5vw, 30px));
|
|
277
334
|
line-height: 1.18;
|
|
278
335
|
letter-spacing: -0.01em;
|
|
279
336
|
color: var(--cs-text-primary);
|
|
280
337
|
margin: 0;
|
|
338
|
+
overflow-wrap: anywhere;
|
|
281
339
|
}
|
|
282
340
|
|
|
283
341
|
.headline em {
|
|
@@ -285,7 +343,7 @@ ConsentCapabilitiesScreen.styles = (0, lit_1.css) `
|
|
|
285
343
|
}
|
|
286
344
|
|
|
287
345
|
.subhead {
|
|
288
|
-
font-size: 14.5px;
|
|
346
|
+
font-size: var(--cs-subhead-font-size, 14.5px);
|
|
289
347
|
color: var(--cs-text-secondary);
|
|
290
348
|
line-height: 1.55;
|
|
291
349
|
margin: 0;
|
|
@@ -300,6 +358,8 @@ ConsentCapabilitiesScreen.styles = (0, lit_1.css) `
|
|
|
300
358
|
font-weight: 600;
|
|
301
359
|
color: var(--cs-text-tertiary);
|
|
302
360
|
text-transform: uppercase;
|
|
361
|
+
gap: 12px;
|
|
362
|
+
flex-wrap: wrap;
|
|
303
363
|
}
|
|
304
364
|
|
|
305
365
|
.section-header .hint {
|
|
@@ -313,6 +373,12 @@ ConsentCapabilitiesScreen.styles = (0, lit_1.css) `
|
|
|
313
373
|
display: flex;
|
|
314
374
|
flex-direction: column;
|
|
315
375
|
}
|
|
376
|
+
|
|
377
|
+
@media (max-width: 480px) {
|
|
378
|
+
.card {
|
|
379
|
+
padding: var(--cs-card-padding-mobile, 20px 18px);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
316
382
|
`;
|
|
317
383
|
__decorate([
|
|
318
384
|
(0, decorators_js_1.property)({ type: Array })
|
|
@@ -335,6 +401,9 @@ __decorate([
|
|
|
335
401
|
__decorate([
|
|
336
402
|
(0, decorators_js_1.property)({ type: Number })
|
|
337
403
|
], ConsentCapabilitiesScreen.prototype, "inactivityDays", void 0);
|
|
404
|
+
__decorate([
|
|
405
|
+
(0, decorators_js_1.property)({ type: Boolean, attribute: "fixed-expiry" })
|
|
406
|
+
], ConsentCapabilitiesScreen.prototype, "fixedExpiry", void 0);
|
|
338
407
|
__decorate([
|
|
339
408
|
(0, decorators_js_1.property)({ type: String })
|
|
340
409
|
], ConsentCapabilitiesScreen.prototype, "theme", void 0);
|
|
@@ -344,6 +413,18 @@ __decorate([
|
|
|
344
413
|
__decorate([
|
|
345
414
|
(0, decorators_js_1.property)({ type: Boolean })
|
|
346
415
|
], ConsentCapabilitiesScreen.prototype, "loading", void 0);
|
|
416
|
+
__decorate([
|
|
417
|
+
(0, decorators_js_1.property)({ type: Boolean })
|
|
418
|
+
], ConsentCapabilitiesScreen.prototype, "disabled", void 0);
|
|
419
|
+
__decorate([
|
|
420
|
+
(0, decorators_js_1.property)({ type: String })
|
|
421
|
+
], ConsentCapabilitiesScreen.prototype, "description", void 0);
|
|
422
|
+
__decorate([
|
|
423
|
+
(0, decorators_js_1.property)({ type: String, attribute: "submit-label" })
|
|
424
|
+
], ConsentCapabilitiesScreen.prototype, "submitLabel", void 0);
|
|
425
|
+
__decorate([
|
|
426
|
+
(0, decorators_js_1.property)({ type: String, attribute: "cancel-label" })
|
|
427
|
+
], ConsentCapabilitiesScreen.prototype, "cancelLabel", void 0);
|
|
347
428
|
__decorate([
|
|
348
429
|
(0, decorators_js_1.property)({ type: Boolean, reflect: true, attribute: "all-selected" })
|
|
349
430
|
], ConsentCapabilitiesScreen.prototype, "allSelected", void 0);
|
|
@@ -359,6 +440,9 @@ __decorate([
|
|
|
359
440
|
__decorate([
|
|
360
441
|
(0, decorators_js_1.property)({ type: String, attribute: "server-logo-url" })
|
|
361
442
|
], ConsentCapabilitiesScreen.prototype, "serverLogoUrl", void 0);
|
|
443
|
+
__decorate([
|
|
444
|
+
(0, decorators_js_1.property)({ type: Boolean, attribute: "require-all" })
|
|
445
|
+
], ConsentCapabilitiesScreen.prototype, "requireAll", void 0);
|
|
362
446
|
__decorate([
|
|
363
447
|
(0, decorators_js_1.state)()
|
|
364
448
|
], ConsentCapabilitiesScreen.prototype, "selected", void 0);
|
|
@@ -373,14 +457,4 @@ function escapeHtml(value) {
|
|
|
373
457
|
.replace(/"/g, """)
|
|
374
458
|
.replace(/'/g, "'");
|
|
375
459
|
}
|
|
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
460
|
//# sourceMappingURL=consent-capabilities-screen.js.map
|