@kya-os/consent 0.1.38 → 0.1.41
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/bundle/index.d.ts +14 -0
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +14 -0
- package/dist/bundle/index.js.map +1 -1
- package/dist/bundle/inline.d.ts.map +1 -1
- package/dist/bundle/inline.js +2 -2
- package/dist/bundle/inline.js.map +1 -1
- package/dist/bundle/shell.d.ts +23 -0
- package/dist/bundle/shell.d.ts.map +1 -1
- package/dist/bundle/shell.js +25 -1
- package/dist/bundle/shell.js.map +1 -1
- package/dist/capabilities/index.d.ts +7 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +7 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/registry.d.ts +29 -0
- package/dist/capabilities/registry.d.ts.map +1 -0
- package/dist/capabilities/registry.js +178 -0
- package/dist/capabilities/registry.js.map +1 -0
- package/dist/cedar/compile.d.ts +30 -0
- package/dist/cedar/compile.d.ts.map +1 -0
- package/dist/cedar/compile.js +55 -0
- package/dist/cedar/compile.js.map +1 -0
- package/dist/cedar/explain.d.ts +22 -0
- package/dist/cedar/explain.d.ts.map +1 -0
- package/dist/cedar/explain.js +72 -0
- package/dist/cedar/explain.js.map +1 -0
- package/dist/cedar/index.d.ts +8 -0
- package/dist/cedar/index.d.ts.map +1 -0
- package/dist/cedar/index.js +8 -0
- package/dist/cedar/index.js.map +1 -0
- package/dist/cjs/bundle/index.js +22 -1
- package/dist/cjs/bundle/index.js.map +1 -1
- package/dist/cjs/bundle/inline.js +2 -2
- package/dist/cjs/bundle/inline.js.map +1 -1
- package/dist/cjs/bundle/shell.js +25 -1
- package/dist/cjs/bundle/shell.js.map +1 -1
- package/dist/cjs/capabilities/index.js +12 -0
- package/dist/cjs/capabilities/index.js.map +1 -0
- package/dist/cjs/capabilities/registry.js +182 -0
- package/dist/cjs/capabilities/registry.js.map +1 -0
- package/dist/cjs/cedar/compile.js +59 -0
- package/dist/cjs/cedar/compile.js.map +1 -0
- package/dist/cjs/cedar/explain.js +75 -0
- package/dist/cjs/cedar/explain.js.map +1 -0
- package/dist/cjs/cedar/index.js +14 -0
- package/dist/cjs/cedar/index.js.map +1 -0
- package/dist/cjs/components/consent-action-bar.js +138 -0
- package/dist/cjs/components/consent-action-bar.js.map +1 -0
- package/dist/cjs/components/consent-agent-header.js +205 -0
- package/dist/cjs/components/consent-agent-header.js.map +1 -0
- package/dist/cjs/components/consent-capabilities-screen.js +346 -0
- package/dist/cjs/components/consent-capabilities-screen.js.map +1 -0
- package/dist/cjs/components/consent-capability-card.js +399 -0
- package/dist/cjs/components/consent-capability-card.js.map +1 -0
- package/dist/cjs/components/consent-connector-header.js +247 -0
- package/dist/cjs/components/consent-connector-header.js.map +1 -0
- package/dist/cjs/components/consent-footer.js +99 -0
- package/dist/cjs/components/consent-footer.js.map +1 -0
- package/dist/cjs/components/consent-revocation-notice.js +101 -0
- package/dist/cjs/components/consent-revocation-notice.js.map +1 -0
- package/dist/cjs/components/index.js +16 -1
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/mcp-consent.js +193 -7
- package/dist/cjs/components/mcp-consent.js.map +1 -1
- package/dist/cjs/copy/index.js +12 -0
- package/dist/cjs/copy/index.js.map +1 -0
- package/dist/cjs/copy/tokens.js +101 -0
- package/dist/cjs/copy/tokens.js.map +1 -0
- package/dist/cjs/index.js +8 -0
- package/dist/cjs/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/popup/index.js +15 -0
- package/dist/cjs/popup/index.js.map +1 -0
- package/dist/cjs/popup/launcher.js +77 -0
- package/dist/cjs/popup/launcher.js.map +1 -0
- package/dist/cjs/schemas/capabilities.schemas.js +129 -0
- package/dist/cjs/schemas/capabilities.schemas.js.map +1 -0
- package/dist/cjs/schemas/config.schemas.js +18 -0
- package/dist/cjs/schemas/config.schemas.js.map +1 -1
- package/dist/cjs/schemas/index.js +1 -0
- package/dist/cjs/schemas/index.js.map +1 -1
- package/dist/cjs/styles/index.js +1 -0
- package/dist/cjs/styles/index.js.map +1 -1
- package/dist/cjs/styles/theme.js +86 -0
- package/dist/cjs/styles/theme.js.map +1 -0
- package/dist/cjs/types/capabilities.types.js +12 -0
- package/dist/cjs/types/capabilities.types.js.map +1 -0
- package/dist/cjs/types/index.js +1 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/components/consent-action-bar.d.ts +30 -0
- package/dist/components/consent-action-bar.d.ts.map +1 -0
- package/dist/components/consent-action-bar.js +135 -0
- package/dist/components/consent-action-bar.js.map +1 -0
- package/dist/components/consent-agent-header.d.ts +31 -0
- package/dist/components/consent-agent-header.d.ts.map +1 -0
- package/dist/components/consent-agent-header.js +202 -0
- package/dist/components/consent-agent-header.js.map +1 -0
- package/dist/components/consent-capabilities-screen.d.ts +75 -0
- package/dist/components/consent-capabilities-screen.d.ts.map +1 -0
- package/dist/components/consent-capabilities-screen.js +343 -0
- package/dist/components/consent-capabilities-screen.js.map +1 -0
- package/dist/components/consent-capability-card.d.ts +52 -0
- package/dist/components/consent-capability-card.d.ts.map +1 -0
- package/dist/components/consent-capability-card.js +396 -0
- package/dist/components/consent-capability-card.js.map +1 -0
- package/dist/components/consent-connector-header.d.ts +64 -0
- package/dist/components/consent-connector-header.d.ts.map +1 -0
- package/dist/components/consent-connector-header.js +244 -0
- package/dist/components/consent-connector-header.js.map +1 -0
- package/dist/components/consent-footer.d.ts +22 -0
- package/dist/components/consent-footer.d.ts.map +1 -0
- package/dist/components/consent-footer.js +96 -0
- package/dist/components/consent-footer.js.map +1 -0
- package/dist/components/consent-revocation-notice.d.ts +22 -0
- package/dist/components/consent-revocation-notice.d.ts.map +1 -0
- package/dist/components/consent-revocation-notice.js +98 -0
- package/dist/components/consent-revocation-notice.js.map +1 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +8 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/mcp-consent.d.ts +41 -0
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +193 -7
- package/dist/components/mcp-consent.js.map +1 -1
- package/dist/consent.js +1642 -7
- package/dist/consent.min.js +888 -119
- package/dist/copy/index.d.ts +8 -0
- package/dist/copy/index.d.ts.map +1 -0
- package/dist/copy/index.js +7 -0
- package/dist/copy/index.js.map +1 -0
- package/dist/copy/tokens.d.ts +93 -0
- package/dist/copy/tokens.d.ts.map +1 -0
- package/dist/copy/tokens.js +97 -0
- package/dist/copy/tokens.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/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/popup/index.d.ts +8 -0
- package/dist/popup/index.d.ts.map +1 -0
- package/dist/popup/index.js +7 -0
- package/dist/popup/index.js.map +1 -0
- package/dist/popup/launcher.d.ts +81 -0
- package/dist/popup/launcher.d.ts.map +1 -0
- package/dist/popup/launcher.js +71 -0
- package/dist/popup/launcher.js.map +1 -0
- package/dist/schemas/api.schemas.d.ts +366 -162
- package/dist/schemas/api.schemas.d.ts.map +1 -1
- package/dist/schemas/capabilities.schemas.d.ts +186 -0
- package/dist/schemas/capabilities.schemas.d.ts.map +1 -0
- package/dist/schemas/capabilities.schemas.js +123 -0
- package/dist/schemas/capabilities.schemas.js.map +1 -0
- package/dist/schemas/config.schemas.d.ts +480 -184
- package/dist/schemas/config.schemas.d.ts.map +1 -1
- package/dist/schemas/config.schemas.js +18 -0
- package/dist/schemas/config.schemas.js.map +1 -1
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/modes.schemas.d.ts +6 -6
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/index.d.ts.map +1 -1
- package/dist/styles/index.js +1 -0
- package/dist/styles/index.js.map +1 -1
- package/dist/styles/theme.d.ts +72 -0
- package/dist/styles/theme.d.ts.map +1 -0
- package/dist/styles/theme.js +81 -0
- package/dist/styles/theme.js.map +1 -0
- package/dist/types/capabilities.types.d.ts +126 -0
- package/dist/types/capabilities.types.d.ts.map +1 -0
- package/dist/types/capabilities.types.js +11 -0
- package/dist/types/capabilities.types.js.map +1 -0
- package/dist/types/config.types.d.ts +33 -0
- package/dist/types/config.types.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Consent Capability Card
|
|
4
|
+
*
|
|
5
|
+
* Renders a single capability row in the new humanized consent layout.
|
|
6
|
+
* Shows: square checkbox + icon tile + bold label inline with description +
|
|
7
|
+
* optional amber HIGHER RISK chip + small "View policy" disclosure.
|
|
8
|
+
*
|
|
9
|
+
* Emits a `capability-toggle` CustomEvent with `{ id, checked }` whenever the
|
|
10
|
+
* checkbox state changes; the parent (`<mcp-consent>`) tracks selection.
|
|
11
|
+
*
|
|
12
|
+
* @module components/consent-capability-card
|
|
13
|
+
*/
|
|
14
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
15
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.ConsentCapabilityCard = void 0;
|
|
22
|
+
const lit_1 = require("lit");
|
|
23
|
+
const decorators_js_1 = require("lit/decorators.js");
|
|
24
|
+
const tokens_js_1 = require("../copy/tokens.js");
|
|
25
|
+
const explain_js_1 = require("../cedar/explain.js");
|
|
26
|
+
let ConsentCapabilityCard = class ConsentCapabilityCard extends lit_1.LitElement {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
this.capabilityId = "";
|
|
30
|
+
this.label = "";
|
|
31
|
+
this.description = "";
|
|
32
|
+
this.icon = "neutral";
|
|
33
|
+
this.riskLevel = "low";
|
|
34
|
+
this.checked = false;
|
|
35
|
+
this.compiledCedar = "";
|
|
36
|
+
this.policyOpen = false;
|
|
37
|
+
}
|
|
38
|
+
toggleChecked() {
|
|
39
|
+
this.checked = !this.checked;
|
|
40
|
+
const detail = {
|
|
41
|
+
id: this.capabilityId,
|
|
42
|
+
checked: this.checked,
|
|
43
|
+
};
|
|
44
|
+
this.dispatchEvent(new CustomEvent("capability-toggle", {
|
|
45
|
+
detail,
|
|
46
|
+
bubbles: true,
|
|
47
|
+
composed: true,
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Row-level click handler. Makes the entire row a click target for
|
|
52
|
+
* toggling the checkbox — a UX nicety that matches Plaid/Apple-style
|
|
53
|
+
* consent rows. Skips when the user clicks the per-row "View policy"
|
|
54
|
+
* button, the policy disclosure, or any link inside the description, so
|
|
55
|
+
* those interactive children retain their own behavior.
|
|
56
|
+
*/
|
|
57
|
+
onRowClick(event) {
|
|
58
|
+
const target = event.target;
|
|
59
|
+
if (!target)
|
|
60
|
+
return;
|
|
61
|
+
// Walk the composed path to detect interactive children we shouldn't
|
|
62
|
+
// hijack — the policy toggle/disclosure or any anchor.
|
|
63
|
+
const path = event.composedPath?.() || [];
|
|
64
|
+
for (const node of path) {
|
|
65
|
+
if (!(node instanceof HTMLElement))
|
|
66
|
+
continue;
|
|
67
|
+
if (node === this)
|
|
68
|
+
break;
|
|
69
|
+
if (node.classList?.contains("policy-toggle") ||
|
|
70
|
+
node.classList?.contains("policy-disclosure") ||
|
|
71
|
+
node.tagName === "A" ||
|
|
72
|
+
node.tagName === "BUTTON") {
|
|
73
|
+
// Already-handled child (incl. our own checkbox button — its own
|
|
74
|
+
// @click toggles, no double-fire from row click).
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
this.toggleChecked();
|
|
79
|
+
}
|
|
80
|
+
togglePolicy(event) {
|
|
81
|
+
// Stop the row click from also toggling the checkbox when the user
|
|
82
|
+
// clicked specifically on "View policy".
|
|
83
|
+
event?.stopPropagation();
|
|
84
|
+
this.policyOpen = !this.policyOpen;
|
|
85
|
+
}
|
|
86
|
+
isHigherRisk() {
|
|
87
|
+
return this.riskLevel === "high" || this.riskLevel === "critical";
|
|
88
|
+
}
|
|
89
|
+
renderIcon() {
|
|
90
|
+
return iconSvgFor(this.icon);
|
|
91
|
+
}
|
|
92
|
+
renderPolicy() {
|
|
93
|
+
if (!this.policyOpen)
|
|
94
|
+
return lit_1.nothing;
|
|
95
|
+
if (!this.compiledCedar)
|
|
96
|
+
return lit_1.nothing;
|
|
97
|
+
const explanation = (0, explain_js_1.explainCedarFragment)(this.compiledCedar);
|
|
98
|
+
const tokens = tokens_js_1.CONSENT_COPY_TOKENS.capabilityRow;
|
|
99
|
+
return (0, lit_1.html) `
|
|
100
|
+
<div class="policy-disclosure" part="policy">
|
|
101
|
+
<h4>${tokens.glossTitle}</h4>
|
|
102
|
+
<ul>
|
|
103
|
+
${explanation.actions.length === 0
|
|
104
|
+
? (0, lit_1.html) `<li>—</li>`
|
|
105
|
+
: explanation.actions.map((action) => (0, lit_1.html) `<li><code>${action}</code></li>`)}
|
|
106
|
+
</ul>
|
|
107
|
+
${explanation.resource
|
|
108
|
+
? (0, lit_1.html) `<p>
|
|
109
|
+
On <code>${explanation.resource}</code>
|
|
110
|
+
</p>`
|
|
111
|
+
: (0, lit_1.html) `<p>On ${tokens.glossUnknownResource}</p>`}
|
|
112
|
+
<h4>${tokens.rawPolicyTitle}</h4>
|
|
113
|
+
<pre><code>${this.compiledCedar}</code></pre>
|
|
114
|
+
</div>
|
|
115
|
+
`;
|
|
116
|
+
}
|
|
117
|
+
render() {
|
|
118
|
+
const tokens = tokens_js_1.CONSENT_COPY_TOKENS.capabilityRow;
|
|
119
|
+
return (0, lit_1.html) `
|
|
120
|
+
<div
|
|
121
|
+
class="row"
|
|
122
|
+
part="row"
|
|
123
|
+
role="button"
|
|
124
|
+
tabindex="0"
|
|
125
|
+
@click=${this.onRowClick}
|
|
126
|
+
@keydown=${(e) => {
|
|
127
|
+
if (e.key === " " || e.key === "Enter") {
|
|
128
|
+
e.preventDefault();
|
|
129
|
+
this.toggleChecked();
|
|
130
|
+
}
|
|
131
|
+
}}
|
|
132
|
+
>
|
|
133
|
+
<button
|
|
134
|
+
class="checkbox"
|
|
135
|
+
part="checkbox"
|
|
136
|
+
role="checkbox"
|
|
137
|
+
aria-checked="${String(this.checked)}"
|
|
138
|
+
aria-label="${this.label}"
|
|
139
|
+
@click=${(e) => {
|
|
140
|
+
e.stopPropagation();
|
|
141
|
+
this.toggleChecked();
|
|
142
|
+
}}
|
|
143
|
+
type="button"
|
|
144
|
+
tabindex="-1"
|
|
145
|
+
>
|
|
146
|
+
${this.checked ? (0, lit_1.html) `<span class="check-mark">✓</span>` : lit_1.nothing}
|
|
147
|
+
</button>
|
|
148
|
+
<div class="icon-tile" aria-hidden="true">${this.renderIcon()}</div>
|
|
149
|
+
<div class="body">
|
|
150
|
+
<div class="row-label">
|
|
151
|
+
<span><strong>${this.label}</strong> <span class="description">${this.description}</span></span>
|
|
152
|
+
${this.isHigherRisk()
|
|
153
|
+
? (0, lit_1.html) `<span class="risk-chip">${tokens.higherRiskChip}</span>`
|
|
154
|
+
: lit_1.nothing}
|
|
155
|
+
</div>
|
|
156
|
+
<button
|
|
157
|
+
class="policy-toggle"
|
|
158
|
+
type="button"
|
|
159
|
+
@click=${this.togglePolicy}
|
|
160
|
+
aria-expanded="${String(this.policyOpen)}"
|
|
161
|
+
>
|
|
162
|
+
${tokens.viewPolicyLink}
|
|
163
|
+
</button>
|
|
164
|
+
${this.renderPolicy()}
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
`;
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
exports.ConsentCapabilityCard = ConsentCapabilityCard;
|
|
171
|
+
ConsentCapabilityCard.styles = (0, lit_1.css) `
|
|
172
|
+
:host {
|
|
173
|
+
display: block;
|
|
174
|
+
border-bottom: 1px solid var(--cs-surface-border, rgba(15, 23, 42, 0.08));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
:host(:last-of-type) {
|
|
178
|
+
border-bottom: none;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.row {
|
|
182
|
+
display: grid;
|
|
183
|
+
grid-template-columns: 22px 36px 1fr;
|
|
184
|
+
gap: 14px;
|
|
185
|
+
padding: 16px 0;
|
|
186
|
+
align-items: flex-start;
|
|
187
|
+
cursor: pointer;
|
|
188
|
+
transition: background 0.12s ease;
|
|
189
|
+
margin: 0 -10px;
|
|
190
|
+
padding-left: 10px;
|
|
191
|
+
padding-right: 10px;
|
|
192
|
+
border-radius: 8px;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.row:hover {
|
|
196
|
+
background: var(--cs-row-hover-bg, rgba(15, 23, 42, 0.025));
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.checkbox {
|
|
200
|
+
width: 22px;
|
|
201
|
+
height: 22px;
|
|
202
|
+
border-radius: 6px;
|
|
203
|
+
border: 1.5px solid var(--cs-text-secondary, #334155);
|
|
204
|
+
background: transparent;
|
|
205
|
+
cursor: pointer;
|
|
206
|
+
display: flex;
|
|
207
|
+
align-items: center;
|
|
208
|
+
justify-content: center;
|
|
209
|
+
padding: 0;
|
|
210
|
+
transition: background 0.12s ease, border-color 0.12s ease;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.checkbox[aria-checked="true"] {
|
|
214
|
+
background: var(--cs-surface-accent, #0F172A);
|
|
215
|
+
border-color: var(--cs-surface-accent, #0F172A);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.checkbox:focus-visible {
|
|
219
|
+
outline: 2px solid var(--cs-focus-ring, #0F172A);
|
|
220
|
+
outline-offset: 2px;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.check-mark {
|
|
224
|
+
color: var(--cs-surface-accent-text, #fff);
|
|
225
|
+
font-size: 14px;
|
|
226
|
+
line-height: 1;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.icon-tile {
|
|
230
|
+
width: 36px;
|
|
231
|
+
height: 36px;
|
|
232
|
+
border-radius: 10px;
|
|
233
|
+
background: var(--cs-surface-inset, #F1ECE2);
|
|
234
|
+
display: flex;
|
|
235
|
+
align-items: center;
|
|
236
|
+
justify-content: center;
|
|
237
|
+
color: var(--cs-text-secondary, #334155);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.icon-tile svg {
|
|
241
|
+
width: 18px;
|
|
242
|
+
height: 18px;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.body {
|
|
246
|
+
display: flex;
|
|
247
|
+
flex-direction: column;
|
|
248
|
+
gap: 6px;
|
|
249
|
+
min-width: 0;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.row-label {
|
|
253
|
+
display: flex;
|
|
254
|
+
align-items: center;
|
|
255
|
+
gap: 10px;
|
|
256
|
+
flex-wrap: wrap;
|
|
257
|
+
font-size: 14.5px;
|
|
258
|
+
color: var(--cs-text-primary, #0F172A);
|
|
259
|
+
line-height: 1.45;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.row-label strong {
|
|
263
|
+
font-weight: 600;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.description {
|
|
267
|
+
color: var(--cs-text-secondary, #334155);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.risk-chip {
|
|
271
|
+
display: inline-flex;
|
|
272
|
+
padding: 2px 8px;
|
|
273
|
+
border-radius: 999px;
|
|
274
|
+
font-size: 10.5px;
|
|
275
|
+
font-weight: 700;
|
|
276
|
+
letter-spacing: 0.06em;
|
|
277
|
+
background: var(--cs-chip-risk-bg, #FCE7B6);
|
|
278
|
+
color: var(--cs-chip-risk-text, #7A4F00);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.policy-toggle {
|
|
282
|
+
align-self: flex-start;
|
|
283
|
+
background: none;
|
|
284
|
+
border: none;
|
|
285
|
+
padding: 0;
|
|
286
|
+
font-size: 12px;
|
|
287
|
+
font-weight: 500;
|
|
288
|
+
color: var(--cs-text-tertiary, #64748B);
|
|
289
|
+
text-decoration: underline;
|
|
290
|
+
text-underline-offset: 2px;
|
|
291
|
+
cursor: pointer;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.policy-toggle:focus-visible {
|
|
295
|
+
outline: 2px solid var(--cs-focus-ring, #0F172A);
|
|
296
|
+
outline-offset: 2px;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.policy-disclosure {
|
|
300
|
+
margin-top: 8px;
|
|
301
|
+
border-radius: 10px;
|
|
302
|
+
background: var(--cs-surface-inset, #F1ECE2);
|
|
303
|
+
padding: 10px 12px;
|
|
304
|
+
font-size: 12px;
|
|
305
|
+
color: var(--cs-text-secondary, #334155);
|
|
306
|
+
display: flex;
|
|
307
|
+
flex-direction: column;
|
|
308
|
+
gap: 8px;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.policy-disclosure h4 {
|
|
312
|
+
margin: 0;
|
|
313
|
+
font-size: 11px;
|
|
314
|
+
letter-spacing: 0.08em;
|
|
315
|
+
text-transform: uppercase;
|
|
316
|
+
color: var(--cs-text-tertiary, #64748B);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.policy-disclosure pre {
|
|
320
|
+
margin: 0;
|
|
321
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
322
|
+
font-size: 11.5px;
|
|
323
|
+
line-height: 1.5;
|
|
324
|
+
white-space: pre-wrap;
|
|
325
|
+
word-break: break-word;
|
|
326
|
+
color: var(--cs-text-primary, #0F172A);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.policy-disclosure ul {
|
|
330
|
+
margin: 0;
|
|
331
|
+
padding-left: 18px;
|
|
332
|
+
}
|
|
333
|
+
`;
|
|
334
|
+
__decorate([
|
|
335
|
+
(0, decorators_js_1.property)({ type: String })
|
|
336
|
+
], ConsentCapabilityCard.prototype, "capabilityId", void 0);
|
|
337
|
+
__decorate([
|
|
338
|
+
(0, decorators_js_1.property)({ type: String })
|
|
339
|
+
], ConsentCapabilityCard.prototype, "label", void 0);
|
|
340
|
+
__decorate([
|
|
341
|
+
(0, decorators_js_1.property)({ type: String })
|
|
342
|
+
], ConsentCapabilityCard.prototype, "description", void 0);
|
|
343
|
+
__decorate([
|
|
344
|
+
(0, decorators_js_1.property)({ type: String })
|
|
345
|
+
], ConsentCapabilityCard.prototype, "icon", void 0);
|
|
346
|
+
__decorate([
|
|
347
|
+
(0, decorators_js_1.property)({ type: String })
|
|
348
|
+
], ConsentCapabilityCard.prototype, "riskLevel", void 0);
|
|
349
|
+
__decorate([
|
|
350
|
+
(0, decorators_js_1.property)({ type: Boolean, reflect: true })
|
|
351
|
+
], ConsentCapabilityCard.prototype, "checked", void 0);
|
|
352
|
+
__decorate([
|
|
353
|
+
(0, decorators_js_1.property)({ type: String, attribute: "compiled-cedar" })
|
|
354
|
+
], ConsentCapabilityCard.prototype, "compiledCedar", void 0);
|
|
355
|
+
__decorate([
|
|
356
|
+
(0, decorators_js_1.state)()
|
|
357
|
+
], ConsentCapabilityCard.prototype, "policyOpen", void 0);
|
|
358
|
+
exports.ConsentCapabilityCard = ConsentCapabilityCard = __decorate([
|
|
359
|
+
(0, decorators_js_1.customElement)("consent-capability-card")
|
|
360
|
+
], ConsentCapabilityCard);
|
|
361
|
+
/**
|
|
362
|
+
* Inline SVG icons for the recognized capability icons. Kept inline to avoid
|
|
363
|
+
* an asset-loading hop in shadow DOM.
|
|
364
|
+
*/
|
|
365
|
+
function iconSvgFor(icon) {
|
|
366
|
+
switch (icon) {
|
|
367
|
+
case "search":
|
|
368
|
+
return (0, lit_1.html) `<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="9" r="5.25"/><path d="m13.25 13.25 3.5 3.5"/></svg>`;
|
|
369
|
+
case "cart":
|
|
370
|
+
return (0, lit_1.html) `<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M3 3h2l1.4 9.4a1.5 1.5 0 0 0 1.5 1.3h7.6a1.5 1.5 0 0 0 1.5-1.2L18 6H6"/><circle cx="9" cy="17" r="1.2"/><circle cx="15" cy="17" r="1.2"/></svg>`;
|
|
371
|
+
case "card":
|
|
372
|
+
return (0, lit_1.html) `<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><rect x="2.5" y="4.5" width="15" height="11" rx="2"/><path d="M2.5 9h15"/><path d="M5.5 13h3"/></svg>`;
|
|
373
|
+
case "pin":
|
|
374
|
+
return (0, lit_1.html) `<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M10 17s-5.5-5-5.5-9a5.5 5.5 0 1 1 11 0c0 4-5.5 9-5.5 9z"/><circle cx="10" cy="8" r="2"/></svg>`;
|
|
375
|
+
case "pin-new":
|
|
376
|
+
return (0, lit_1.html) `<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M10 17s-5.5-5-5.5-9a5.5 5.5 0 1 1 11 0c0 4-5.5 9-5.5 9z"/><path d="M10 6v4"/><path d="M8 8h4"/></svg>`;
|
|
377
|
+
case "shield":
|
|
378
|
+
return (0, lit_1.html) `<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M10 2.5 4 5v5.5C4 14 6.5 16.5 10 17.5c3.5-1 6-3.5 6-7V5z"/></svg>`;
|
|
379
|
+
case "key":
|
|
380
|
+
return (0, lit_1.html) `<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><circle cx="7" cy="13" r="3.25"/><path d="m9.5 11 6.5-6.5"/><path d="m13.5 7 2 2"/></svg>`;
|
|
381
|
+
case "tools":
|
|
382
|
+
return (0, lit_1.html) `<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="m4 4 6 6"/><path d="m10 4 6 6"/><path d="m4 16 12-12"/></svg>`;
|
|
383
|
+
case "user":
|
|
384
|
+
return (0, lit_1.html) `<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="7" r="3"/><path d="M3 17a7 7 0 0 1 14 0"/></svg>`;
|
|
385
|
+
case "calendar":
|
|
386
|
+
return (0, lit_1.html) `<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="14" height="13" rx="2"/><path d="M3 8h14"/><path d="M7 2v4M13 2v4"/></svg>`;
|
|
387
|
+
case "lock":
|
|
388
|
+
return (0, lit_1.html) `<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="9" width="12" height="8" rx="2"/><path d="M7 9V6a3 3 0 0 1 6 0v3"/></svg>`;
|
|
389
|
+
case "eye":
|
|
390
|
+
return (0, lit_1.html) `<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M2 10s3-6 8-6 8 6 8 6-3 6-8 6-8-6-8-6z"/><circle cx="10" cy="10" r="2.25"/></svg>`;
|
|
391
|
+
case "send":
|
|
392
|
+
return (0, lit_1.html) `<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="m17 3-7 7-2 7-3-9z"/></svg>`;
|
|
393
|
+
case "package":
|
|
394
|
+
return (0, lit_1.html) `<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="m10 2 7 4v8l-7 4-7-4V6z"/><path d="m3 6 7 4 7-4"/><path d="M10 18V10"/></svg>`;
|
|
395
|
+
default:
|
|
396
|
+
return (0, lit_1.html) `<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="5"/></svg>`;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
//# sourceMappingURL=consent-capability-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consent-capability-card.js","sourceRoot":"","sources":["../../../src/components/consent-capability-card.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;;;;;AAEH,6BAAqD;AACrD,qDAAmE;AAEnE,iDAAwD;AACxD,oDAA2D;AAYpD,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,gBAAU;IAA9C;;QACuB,iBAAY,GAAG,EAAE,CAAC;QAClB,UAAK,GAAG,EAAE,CAAC;QACX,gBAAW,GAAG,EAAE,CAAC;QACjB,SAAI,GAAmB,SAAS,CAAC;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N,KAAK,UAAU;YACb,OAAO,IAAA,UAAI,EAAA,kOAAkO,CAAC;QAChP,KAAK,MAAM;YACT,OAAO,IAAA,UAAI,EAAA,uNAAuN,CAAC;QACrO,KAAK,KAAK;YACR,OAAO,IAAA,UAAI,EAAA,yNAAyN,CAAC;QACvO,KAAK,MAAM;YACT,OAAO,IAAA,UAAI,EAAA,mKAAmK,CAAC;QACjL,KAAK,SAAS;YACZ,OAAO,IAAA,UAAI,EAAA,qNAAqN,CAAC;QACnO;YACE,OAAO,IAAA,UAAI,EAAA,oKAAoK,CAAC;IACpL,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Consent Connector Header
|
|
4
|
+
*
|
|
5
|
+
* Top-of-page visual matching Peter's mockup: client logo on the left, an
|
|
6
|
+
* animated dotted bridge with the Checkpoint shield in the middle, and the
|
|
7
|
+
* server brand logo on the right. Communicates "{client} is connecting to
|
|
8
|
+
* {server} via Checkpoint" before the user reads any copy.
|
|
9
|
+
*
|
|
10
|
+
* Logo resolution priority:
|
|
11
|
+
* 1. explicit `clientLogoUrl` / `serverLogoUrl` attributes (operator override)
|
|
12
|
+
* 2. derived from `clientDid` (e.g. did:web:knowthat.ai:agents:claude →
|
|
13
|
+
* `https://knowthat.ai/img/agents/claude.png`)
|
|
14
|
+
* 3. logo.dev fallback when `logoDevToken` is set + a domain is derivable
|
|
15
|
+
* 4. monogram tile (first letter of name) as the last-resort placeholder
|
|
16
|
+
*
|
|
17
|
+
* Designed to be brand-agnostic: every client/server pair gets the same
|
|
18
|
+
* shape, with only the artwork swapped per deployment.
|
|
19
|
+
*
|
|
20
|
+
* @module components/consent-connector-header
|
|
21
|
+
*/
|
|
22
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
23
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
25
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
26
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.ConsentConnectorHeader = void 0;
|
|
30
|
+
const lit_1 = require("lit");
|
|
31
|
+
const decorators_js_1 = require("lit/decorators.js");
|
|
32
|
+
let ConsentConnectorHeader = class ConsentConnectorHeader extends lit_1.LitElement {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
/** Display name of the agent / client (e.g. "Claude"). */
|
|
36
|
+
this.clientName = "";
|
|
37
|
+
/** Agent DID — used for KTA-derived logo lookup when no explicit URL. */
|
|
38
|
+
this.clientDid = "";
|
|
39
|
+
/** Explicit override for the client logo. */
|
|
40
|
+
this.clientLogoUrl = "";
|
|
41
|
+
/** Display name of the server / org (e.g. "Hardware World"). */
|
|
42
|
+
this.serverName = "";
|
|
43
|
+
/** Server brand domain — used for logo.dev lookup when no explicit URL. */
|
|
44
|
+
this.serverDomain = "";
|
|
45
|
+
/** Explicit override for the server brand logo. */
|
|
46
|
+
this.serverLogoUrl = "";
|
|
47
|
+
/**
|
|
48
|
+
* Optional logo.dev publishable token. When supplied, used to fetch
|
|
49
|
+
* brand logos by domain. Falls back to monogram tile if missing or if
|
|
50
|
+
* logo.dev returns 404.
|
|
51
|
+
*/
|
|
52
|
+
this.logoDevToken = "";
|
|
53
|
+
this.clientImageOk = true;
|
|
54
|
+
this.serverImageOk = true;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Derive a logo URL for an agent DID via KTA hosting convention.
|
|
58
|
+
* `did:web:knowthat.ai:agents:claude` → `https://knowthat.ai/img/agents/claude.png`
|
|
59
|
+
*/
|
|
60
|
+
ktaLogoFromDid(did) {
|
|
61
|
+
if (!did)
|
|
62
|
+
return undefined;
|
|
63
|
+
const match = did.match(/^did:web:knowthat\.ai:agents:([a-z0-9-]+)$/i);
|
|
64
|
+
if (!match)
|
|
65
|
+
return undefined;
|
|
66
|
+
return `https://knowthat.ai/img/agents/${match[1]}.png`;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Derive a brand logo URL via logo.dev given a domain. Returns undefined
|
|
70
|
+
* when no token is configured or the domain is unparseable.
|
|
71
|
+
*/
|
|
72
|
+
logoDevLogo(domain) {
|
|
73
|
+
if (!domain || !this.logoDevToken)
|
|
74
|
+
return undefined;
|
|
75
|
+
const cleaned = domain.replace(/^https?:\/\//, "").replace(/\/.*$/, "");
|
|
76
|
+
if (!cleaned)
|
|
77
|
+
return undefined;
|
|
78
|
+
return `https://img.logo.dev/${cleaned}?token=${encodeURIComponent(this.logoDevToken)}&size=120&format=png`;
|
|
79
|
+
}
|
|
80
|
+
resolveClientLogo() {
|
|
81
|
+
if (this.clientLogoUrl)
|
|
82
|
+
return this.clientLogoUrl;
|
|
83
|
+
return this.ktaLogoFromDid(this.clientDid);
|
|
84
|
+
}
|
|
85
|
+
resolveServerLogo() {
|
|
86
|
+
if (this.serverLogoUrl)
|
|
87
|
+
return this.serverLogoUrl;
|
|
88
|
+
return this.logoDevLogo(this.serverDomain);
|
|
89
|
+
}
|
|
90
|
+
monogram(name) {
|
|
91
|
+
return (name || "?").trim().charAt(0).toUpperCase();
|
|
92
|
+
}
|
|
93
|
+
render() {
|
|
94
|
+
const clientLogo = this.resolveClientLogo();
|
|
95
|
+
const serverLogo = this.resolveServerLogo();
|
|
96
|
+
return (0, lit_1.html) `
|
|
97
|
+
<div class="tile client" aria-hidden="true">
|
|
98
|
+
${clientLogo && this.clientImageOk
|
|
99
|
+
? (0, lit_1.html) `<img
|
|
100
|
+
src="${clientLogo}"
|
|
101
|
+
alt=""
|
|
102
|
+
@error=${() => (this.clientImageOk = false)}
|
|
103
|
+
/>`
|
|
104
|
+
: (0, lit_1.html) `<span class="monogram">${this.monogram(this.clientName)}</span>`}
|
|
105
|
+
</div>
|
|
106
|
+
<div class="bridge" aria-hidden="true">
|
|
107
|
+
<span class="dots"><span></span><span></span><span></span></span>
|
|
108
|
+
<span class="shield" title="Protected by Checkpoint">
|
|
109
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
110
|
+
<path d="M12 3l8 3v5c0 4.5-3.5 8.5-8 10-4.5-1.5-8-5.5-8-10V6l8-3z" />
|
|
111
|
+
<path d="m9 12 2 2 4-4" />
|
|
112
|
+
</svg>
|
|
113
|
+
</span>
|
|
114
|
+
<span class="dots"><span></span><span></span><span></span></span>
|
|
115
|
+
</div>
|
|
116
|
+
<div class="tile server" aria-hidden="true">
|
|
117
|
+
${serverLogo && this.serverImageOk
|
|
118
|
+
? (0, lit_1.html) `<img
|
|
119
|
+
src="${serverLogo}"
|
|
120
|
+
alt=""
|
|
121
|
+
@error=${() => (this.serverImageOk = false)}
|
|
122
|
+
/>`
|
|
123
|
+
: (0, lit_1.html) `<span class="monogram">${this.monogram(this.serverName)}</span>`}
|
|
124
|
+
</div>
|
|
125
|
+
<span style="position:absolute;left:-9999px">${this.clientName || ""} connecting to ${this.serverName || ""} via Checkpoint</span>
|
|
126
|
+
`;
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
exports.ConsentConnectorHeader = ConsentConnectorHeader;
|
|
130
|
+
ConsentConnectorHeader.styles = (0, lit_1.css) `
|
|
131
|
+
:host {
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
justify-content: center;
|
|
135
|
+
gap: 18px;
|
|
136
|
+
padding: 22px 0 4px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.tile {
|
|
140
|
+
width: 56px;
|
|
141
|
+
height: 56px;
|
|
142
|
+
border-radius: 14px;
|
|
143
|
+
overflow: hidden;
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
justify-content: center;
|
|
147
|
+
flex-shrink: 0;
|
|
148
|
+
background: var(--cs-surface-card, #fff);
|
|
149
|
+
border: 1px solid var(--cs-surface-border, rgba(15, 23, 42, 0.08));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.tile.client {
|
|
153
|
+
background: var(--cs-surface-accent, #0F172A);
|
|
154
|
+
border-color: transparent;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.tile img {
|
|
158
|
+
width: 100%;
|
|
159
|
+
height: 100%;
|
|
160
|
+
object-fit: cover;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.tile .monogram {
|
|
164
|
+
width: 100%;
|
|
165
|
+
height: 100%;
|
|
166
|
+
display: flex;
|
|
167
|
+
align-items: center;
|
|
168
|
+
justify-content: center;
|
|
169
|
+
font-weight: 600;
|
|
170
|
+
font-size: 22px;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.tile.client .monogram {
|
|
174
|
+
color: var(--cs-surface-accent-text, #fff);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.tile.server .monogram {
|
|
178
|
+
color: var(--cs-text-primary, #0F172A);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.bridge {
|
|
182
|
+
display: inline-flex;
|
|
183
|
+
align-items: center;
|
|
184
|
+
gap: 8px;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.dots {
|
|
188
|
+
display: inline-flex;
|
|
189
|
+
gap: 4px;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.dots span {
|
|
193
|
+
width: 4px;
|
|
194
|
+
height: 4px;
|
|
195
|
+
border-radius: 50%;
|
|
196
|
+
background: var(--cs-text-tertiary, #94A3B8);
|
|
197
|
+
opacity: 0.55;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.shield {
|
|
201
|
+
width: 30px;
|
|
202
|
+
height: 30px;
|
|
203
|
+
border-radius: 50%;
|
|
204
|
+
background: rgba(34, 197, 94, 0.14);
|
|
205
|
+
display: inline-flex;
|
|
206
|
+
align-items: center;
|
|
207
|
+
justify-content: center;
|
|
208
|
+
color: #15803D;
|
|
209
|
+
flex-shrink: 0;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.shield svg {
|
|
213
|
+
width: 16px;
|
|
214
|
+
height: 16px;
|
|
215
|
+
}
|
|
216
|
+
`;
|
|
217
|
+
__decorate([
|
|
218
|
+
(0, decorators_js_1.property)({ type: String })
|
|
219
|
+
], ConsentConnectorHeader.prototype, "clientName", void 0);
|
|
220
|
+
__decorate([
|
|
221
|
+
(0, decorators_js_1.property)({ type: String })
|
|
222
|
+
], ConsentConnectorHeader.prototype, "clientDid", void 0);
|
|
223
|
+
__decorate([
|
|
224
|
+
(0, decorators_js_1.property)({ type: String, attribute: "client-logo-url" })
|
|
225
|
+
], ConsentConnectorHeader.prototype, "clientLogoUrl", void 0);
|
|
226
|
+
__decorate([
|
|
227
|
+
(0, decorators_js_1.property)({ type: String })
|
|
228
|
+
], ConsentConnectorHeader.prototype, "serverName", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
(0, decorators_js_1.property)({ type: String, attribute: "server-domain" })
|
|
231
|
+
], ConsentConnectorHeader.prototype, "serverDomain", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
(0, decorators_js_1.property)({ type: String, attribute: "server-logo-url" })
|
|
234
|
+
], ConsentConnectorHeader.prototype, "serverLogoUrl", void 0);
|
|
235
|
+
__decorate([
|
|
236
|
+
(0, decorators_js_1.property)({ type: String, attribute: "logo-dev-token" })
|
|
237
|
+
], ConsentConnectorHeader.prototype, "logoDevToken", void 0);
|
|
238
|
+
__decorate([
|
|
239
|
+
(0, decorators_js_1.state)()
|
|
240
|
+
], ConsentConnectorHeader.prototype, "clientImageOk", void 0);
|
|
241
|
+
__decorate([
|
|
242
|
+
(0, decorators_js_1.state)()
|
|
243
|
+
], ConsentConnectorHeader.prototype, "serverImageOk", void 0);
|
|
244
|
+
exports.ConsentConnectorHeader = ConsentConnectorHeader = __decorate([
|
|
245
|
+
(0, decorators_js_1.customElement)("consent-connector-header")
|
|
246
|
+
], ConsentConnectorHeader);
|
|
247
|
+
//# sourceMappingURL=consent-connector-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consent-connector-header.js","sourceRoot":"","sources":["../../../src/components/consent-connector-header.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;AAEH,6BAA4C;AAC5C,qDAAmE;AAG5D,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,gBAAU;IAA/C;;QACL,0DAA0D;QAC9B,eAAU,GAAG,EAAE,CAAC;QAE5C,yEAAyE;QAC7C,cAAS,GAAG,EAAE,CAAC;QAE3C,6CAA6C;QACa,kBAAa,GAAG,EAAE,CAAC;QAE7E,gEAAgE;QACpC,eAAU,GAAG,EAAE,CAAC;QAE5C,2EAA2E;QACnB,iBAAY,GAAG,EAAE,CAAC;QAE1E,mDAAmD;QACO,kBAAa,GAAG,EAAE,CAAC;QAE7E;;;;WAIG;QACsD,iBAAY,GAAG,EAAE,CAAC;QAE1D,kBAAa,GAAG,IAAI,CAAC;QACrB,kBAAa,GAAG,IAAI,CAAC;IAsKxC,CAAC;IA5EC;;;OAGG;IACK,cAAc,CAAC,GAAuB;QAC5C,IAAI,CAAC,GAAG;YAAE,OAAO,SAAS,CAAC;QAC3B,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;QACvE,IAAI,CAAC,KAAK;YAAE,OAAO,SAAS,CAAC;QAC7B,OAAO,kCAAkC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;IAC1D,CAAC;IAED;;;OAGG;IACK,WAAW,CAAC,MAA0B;QAC5C,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,YAA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