@kya-os/consent 0.4.0 → 0.4.2
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 +186 -22
- package/dist/bundle/index.d.ts +9 -0
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +13 -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/cjs/bundle/index.js +36 -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/components/consent-action-bar.js +97 -25
- package/dist/cjs/components/consent-action-bar.js.map +1 -1
- package/dist/cjs/components/consent-agent-header.js +7 -105
- package/dist/cjs/components/consent-agent-header.js.map +1 -1
- package/dist/cjs/components/consent-button.js +6 -1
- package/dist/cjs/components/consent-button.js.map +1 -1
- package/dist/cjs/components/consent-capabilities-screen.js +456 -117
- package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
- package/dist/cjs/components/consent-capability-card.js +159 -32
- package/dist/cjs/components/consent-capability-card.js.map +1 -1
- package/dist/cjs/components/consent-checkbox.js +7 -0
- package/dist/cjs/components/consent-checkbox.js.map +1 -1
- package/dist/cjs/components/consent-connector-header.js +262 -45
- package/dist/cjs/components/consent-connector-header.js.map +1 -1
- package/dist/cjs/components/consent-duration.js +1 -1
- package/dist/cjs/components/consent-flow-timeline.js +177 -0
- package/dist/cjs/components/consent-flow-timeline.js.map +1 -0
- package/dist/cjs/components/consent-flow.js +540 -0
- package/dist/cjs/components/consent-flow.js.map +1 -0
- package/dist/cjs/components/consent-footer.js +22 -14
- package/dist/cjs/components/consent-footer.js.map +1 -1
- package/dist/cjs/components/consent-headline.js +353 -33
- package/dist/cjs/components/consent-headline.js.map +1 -1
- package/dist/cjs/components/consent-oauth-button.js +68 -138
- package/dist/cjs/components/consent-oauth-button.js.map +1 -1
- package/dist/cjs/components/consent-otp-input.js +5 -0
- package/dist/cjs/components/consent-otp-input.js.map +1 -1
- package/dist/cjs/components/consent-phone-handoff.js +3 -3
- package/dist/cjs/components/consent-request-expiry.js +1 -1
- package/dist/cjs/components/consent-revocation-notice.js +29 -18
- package/dist/cjs/components/consent-revocation-notice.js.map +1 -1
- package/dist/cjs/components/consent-revoke.js +9 -4
- package/dist/cjs/components/consent-revoke.js.map +1 -1
- package/dist/cjs/components/consent-secured-by.js +106 -0
- package/dist/cjs/components/consent-secured-by.js.map +1 -0
- package/dist/cjs/components/consent-shell.js +1 -1
- package/dist/cjs/components/consent-terms.js +7 -0
- package/dist/cjs/components/consent-terms.js.map +1 -1
- package/dist/cjs/components/consent-wallet-check.js +26 -2
- package/dist/cjs/components/consent-wallet-check.js.map +1 -1
- package/dist/cjs/components/consent-wallet-notice.js +1 -1
- package/dist/cjs/components/consent-wallet-orb.js +1 -1
- package/dist/cjs/components/consent-wallet-signature.js +1 -1
- package/dist/cjs/components/decision-icons.js +37 -0
- package/dist/cjs/components/decision-icons.js.map +1 -0
- package/dist/cjs/components/edit-region.js +309 -0
- package/dist/cjs/components/edit-region.js.map +1 -0
- package/dist/cjs/components/flow-blocks.js +762 -0
- package/dist/cjs/components/flow-blocks.js.map +1 -0
- package/dist/cjs/components/flow-motion.js +177 -0
- package/dist/cjs/components/flow-motion.js.map +1 -0
- package/dist/cjs/components/grant-details.js +143 -0
- package/dist/cjs/components/grant-details.js.map +1 -0
- package/dist/cjs/components/grant-field-styles.js +2 -2
- package/dist/cjs/components/index.js +13 -1
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/mcp-consent.js +93 -36
- package/dist/cjs/components/mcp-consent.js.map +1 -1
- package/dist/cjs/components/preview.js +67 -0
- package/dist/cjs/components/preview.js.map +1 -0
- package/dist/cjs/components/provider-icons.js +92 -0
- package/dist/cjs/components/provider-icons.js.map +1 -0
- package/dist/cjs/constants/capabilities.js +17 -2
- package/dist/cjs/constants/capabilities.js.map +1 -1
- package/dist/cjs/copy/tokens.js +67 -24
- package/dist/cjs/copy/tokens.js.map +1 -1
- package/dist/cjs/flow/copy.js +146 -0
- package/dist/cjs/flow/copy.js.map +1 -0
- package/dist/cjs/flow/index.js +31 -0
- package/dist/cjs/flow/index.js.map +1 -0
- package/dist/cjs/flow/model.js +107 -0
- package/dist/cjs/flow/model.js.map +1 -0
- package/dist/cjs/flow/presets.js +157 -0
- package/dist/cjs/flow/presets.js.map +1 -0
- package/dist/cjs/flow/schema.js +76 -0
- package/dist/cjs/flow/schema.js.map +1 -0
- package/dist/cjs/identity/agent-identity.js +3 -2
- package/dist/cjs/identity/agent-identity.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/react/index.js +40 -2
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/cjs/styles/brand.js +385 -0
- package/dist/cjs/styles/brand.js.map +1 -0
- package/dist/cjs/styles/index.js +1 -0
- package/dist/cjs/styles/index.js.map +1 -1
- package/dist/cjs/styles/theme.js +102 -30
- package/dist/cjs/styles/theme.js.map +1 -1
- package/dist/cjs/types/capabilities.types.js +1 -2
- package/dist/cjs/types/capabilities.types.js.map +1 -1
- package/dist/cjs/types/decision.types.js +13 -0
- package/dist/cjs/types/decision.types.js.map +1 -0
- package/dist/cjs/types/edit.types.js +80 -0
- package/dist/cjs/types/edit.types.js.map +1 -0
- package/dist/cjs/types/index.js +2 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/components/consent-action-bar.d.ts +20 -1
- package/dist/components/consent-action-bar.d.ts.map +1 -1
- package/dist/components/consent-action-bar.js +97 -25
- package/dist/components/consent-action-bar.js.map +1 -1
- package/dist/components/consent-agent-header.d.ts +4 -17
- package/dist/components/consent-agent-header.d.ts.map +1 -1
- package/dist/components/consent-agent-header.js +7 -105
- package/dist/components/consent-agent-header.js.map +1 -1
- package/dist/components/consent-button.d.ts +2 -0
- package/dist/components/consent-button.d.ts.map +1 -1
- package/dist/components/consent-button.js +6 -1
- package/dist/components/consent-button.js.map +1 -1
- package/dist/components/consent-capabilities-screen.d.ts +101 -17
- package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
- package/dist/components/consent-capabilities-screen.js +457 -118
- package/dist/components/consent-capabilities-screen.js.map +1 -1
- package/dist/components/consent-capability-card.d.ts +32 -3
- package/dist/components/consent-capability-card.d.ts.map +1 -1
- package/dist/components/consent-capability-card.js +159 -32
- package/dist/components/consent-capability-card.js.map +1 -1
- package/dist/components/consent-checkbox.d.ts +2 -0
- package/dist/components/consent-checkbox.d.ts.map +1 -1
- package/dist/components/consent-checkbox.js +7 -0
- package/dist/components/consent-checkbox.js.map +1 -1
- package/dist/components/consent-connector-header.d.ts +52 -7
- package/dist/components/consent-connector-header.d.ts.map +1 -1
- package/dist/components/consent-connector-header.js +262 -45
- package/dist/components/consent-connector-header.js.map +1 -1
- package/dist/components/consent-duration.js +1 -1
- package/dist/components/consent-flow-timeline.d.ts +49 -0
- package/dist/components/consent-flow-timeline.d.ts.map +1 -0
- package/dist/components/consent-flow-timeline.js +174 -0
- package/dist/components/consent-flow-timeline.js.map +1 -0
- package/dist/components/consent-flow.d.ts +101 -0
- package/dist/components/consent-flow.d.ts.map +1 -0
- package/dist/components/consent-flow.js +504 -0
- package/dist/components/consent-flow.js.map +1 -0
- package/dist/components/consent-footer.d.ts +6 -4
- package/dist/components/consent-footer.d.ts.map +1 -1
- package/dist/components/consent-footer.js +22 -14
- package/dist/components/consent-footer.js.map +1 -1
- package/dist/components/consent-headline.d.ts +62 -16
- package/dist/components/consent-headline.d.ts.map +1 -1
- package/dist/components/consent-headline.js +352 -34
- package/dist/components/consent-headline.js.map +1 -1
- package/dist/components/consent-oauth-button.d.ts +9 -6
- package/dist/components/consent-oauth-button.d.ts.map +1 -1
- package/dist/components/consent-oauth-button.js +71 -141
- package/dist/components/consent-oauth-button.js.map +1 -1
- package/dist/components/consent-otp-input.d.ts.map +1 -1
- package/dist/components/consent-otp-input.js +5 -0
- package/dist/components/consent-otp-input.js.map +1 -1
- package/dist/components/consent-passkey.d.ts +6 -0
- package/dist/components/consent-passkey.d.ts.map +1 -1
- package/dist/components/consent-passkey.js +67 -9
- package/dist/components/consent-passkey.js.map +1 -1
- package/dist/components/consent-phone-handoff.js +3 -3
- package/dist/components/consent-request-expiry.js +1 -1
- package/dist/components/consent-revocation-notice.d.ts.map +1 -1
- package/dist/components/consent-revocation-notice.js +29 -18
- package/dist/components/consent-revocation-notice.js.map +1 -1
- package/dist/components/consent-revoke.d.ts +2 -0
- package/dist/components/consent-revoke.d.ts.map +1 -1
- package/dist/components/consent-revoke.js +9 -4
- package/dist/components/consent-revoke.js.map +1 -1
- package/dist/components/consent-secured-by.d.ts +25 -0
- package/dist/components/consent-secured-by.d.ts.map +1 -0
- package/dist/components/consent-secured-by.js +103 -0
- package/dist/components/consent-secured-by.js.map +1 -0
- package/dist/components/consent-shell.js +1 -1
- package/dist/components/consent-terms.d.ts +2 -0
- package/dist/components/consent-terms.d.ts.map +1 -1
- package/dist/components/consent-terms.js +7 -0
- package/dist/components/consent-terms.js.map +1 -1
- package/dist/components/consent-wallet-check.d.ts +8 -0
- package/dist/components/consent-wallet-check.d.ts.map +1 -1
- package/dist/components/consent-wallet-check.js +27 -3
- package/dist/components/consent-wallet-check.js.map +1 -1
- package/dist/components/consent-wallet-notice.js +1 -1
- package/dist/components/consent-wallet-orb.js +1 -1
- package/dist/components/consent-wallet-signature.js +1 -1
- package/dist/components/decision-icons.d.ts +26 -0
- package/dist/components/decision-icons.d.ts.map +1 -0
- package/dist/components/decision-icons.js +34 -0
- package/dist/components/decision-icons.js.map +1 -0
- package/dist/components/edit-region.d.ts +50 -0
- package/dist/components/edit-region.d.ts.map +1 -0
- package/dist/components/edit-region.js +305 -0
- package/dist/components/edit-region.js.map +1 -0
- package/dist/components/flow-blocks.d.ts +45 -0
- package/dist/components/flow-blocks.d.ts.map +1 -0
- package/dist/components/flow-blocks.js +755 -0
- package/dist/components/flow-blocks.js.map +1 -0
- package/dist/components/flow-motion.d.ts +41 -0
- package/dist/components/flow-motion.d.ts.map +1 -0
- package/dist/components/flow-motion.js +164 -0
- package/dist/components/flow-motion.js.map +1 -0
- package/dist/components/grant-details.d.ts +28 -0
- package/dist/components/grant-details.d.ts.map +1 -0
- package/dist/components/grant-details.js +138 -0
- package/dist/components/grant-details.js.map +1 -0
- package/dist/components/grant-field-styles.js +2 -2
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +5 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/mcp-consent.d.ts +19 -0
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +93 -36
- package/dist/components/mcp-consent.js.map +1 -1
- package/dist/components/preview.d.ts +38 -0
- package/dist/components/preview.d.ts.map +1 -0
- package/dist/components/preview.js +61 -0
- package/dist/components/preview.js.map +1 -0
- package/dist/components/provider-icons.d.ts +16 -0
- package/dist/components/provider-icons.d.ts.map +1 -0
- package/dist/components/provider-icons.js +88 -0
- package/dist/components/provider-icons.js.map +1 -0
- package/dist/consent.js +4875 -1178
- package/dist/consent.min.js +2367 -814
- package/dist/constants/capabilities.d.ts +16 -3
- package/dist/constants/capabilities.d.ts.map +1 -1
- package/dist/constants/capabilities.js +17 -2
- package/dist/constants/capabilities.js.map +1 -1
- package/dist/copy/tokens.d.ts +67 -24
- package/dist/copy/tokens.d.ts.map +1 -1
- package/dist/copy/tokens.js +67 -24
- package/dist/copy/tokens.js.map +1 -1
- package/dist/flow/copy.d.ts +31 -0
- package/dist/flow/copy.d.ts.map +1 -0
- package/dist/flow/copy.js +137 -0
- package/dist/flow/copy.js.map +1 -0
- package/dist/flow/index.d.ts +15 -0
- package/dist/flow/index.d.ts.map +1 -0
- package/dist/flow/index.js +15 -0
- package/dist/flow/index.js.map +1 -0
- package/dist/flow/model.d.ts +209 -0
- package/dist/flow/model.d.ts.map +1 -0
- package/dist/flow/model.js +103 -0
- package/dist/flow/model.js.map +1 -0
- package/dist/flow/presets.d.ts +29 -0
- package/dist/flow/presets.d.ts.map +1 -0
- package/dist/flow/presets.js +153 -0
- package/dist/flow/presets.js.map +1 -0
- package/dist/flow/schema.d.ts +127 -0
- package/dist/flow/schema.d.ts.map +1 -0
- package/dist/flow/schema.js +72 -0
- package/dist/flow/schema.js.map +1 -0
- package/dist/identity/agent-identity.d.ts +3 -2
- package/dist/identity/agent-identity.d.ts.map +1 -1
- package/dist/identity/agent-identity.js +3 -2
- package/dist/identity/agent-identity.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/react/index.d.ts +27 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +39 -1
- package/dist/react/index.js.map +1 -1
- package/dist/styles/brand.d.ts +184 -0
- package/dist/styles/brand.d.ts.map +1 -0
- package/dist/styles/brand.js +372 -0
- package/dist/styles/brand.js.map +1 -0
- 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 +76 -13
- package/dist/styles/theme.d.ts.map +1 -1
- package/dist/styles/theme.js +98 -29
- package/dist/styles/theme.js.map +1 -1
- package/dist/types/capabilities.types.d.ts +12 -14
- package/dist/types/capabilities.types.d.ts.map +1 -1
- package/dist/types/capabilities.types.js +1 -2
- package/dist/types/capabilities.types.js.map +1 -1
- package/dist/types/decision.types.d.ts +57 -0
- package/dist/types/decision.types.d.ts.map +1 -0
- package/dist/types/decision.types.js +12 -0
- package/dist/types/decision.types.js.map +1 -0
- package/dist/types/edit.types.d.ts +73 -0
- package/dist/types/edit.types.d.ts.map +1 -0
- package/dist/types/edit.types.js +76 -0
- package/dist/types/edit.types.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +10 -5
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Consent Secured By
|
|
4
|
+
*
|
|
5
|
+
* "Secured by" and the Vouched lockup, with "Know Your Agent" under its
|
|
6
|
+
* letters: what the capabilities screen draws under its card unless the host
|
|
7
|
+
* fills its `footer` slot.
|
|
8
|
+
*
|
|
9
|
+
* The lockup is drawn in `--cs-lockup` (Vouched blue in the light theme, the
|
|
10
|
+
* text color in the dark one) and named "Vouched" for screen readers.
|
|
11
|
+
*
|
|
12
|
+
* Parts: `secured-by`, `lockup` and `tagline`.
|
|
13
|
+
*
|
|
14
|
+
* @module components/consent-secured-by
|
|
15
|
+
*/
|
|
16
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
19
|
+
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;
|
|
20
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.ConsentSecuredBy = void 0;
|
|
24
|
+
const lit_1 = require("lit");
|
|
25
|
+
const decorators_js_1 = require("lit/decorators.js");
|
|
26
|
+
const tokens_js_1 = require("../copy/tokens.js");
|
|
27
|
+
/** The lockup's artwork box, and the height it is drawn at. */
|
|
28
|
+
const ARTWORK_WIDTH = 676.3;
|
|
29
|
+
const ARTWORK_HEIGHT = 272.2;
|
|
30
|
+
const LOCKUP_HEIGHT = 40;
|
|
31
|
+
/** Where the letters' baseline sits in the artwork, and where "Know Your Agent" starts. */
|
|
32
|
+
const LETTER_BASELINE = 141;
|
|
33
|
+
const TAGLINE_LEFT = 252;
|
|
34
|
+
const LOCKUP_ART = (0, lit_1.svg) `<g><path opacity=".4" d="M175.7,252.4c-3.2-5.6-6.4-11.1-9.6-16.7-1.7-3.1-3.3-6.3-5.1-9.4-3.9-6.8-7.8-13.7-11.7-20.5-2.6-4.7-5.3-9.4-7.9-14.1-.2-.3-.4-.5-.7-.9-.2.2-.4.4-.4.5-4.1,7.2-8.2,14.3-12.3,21.4-5,8.6-9.9,17.2-14.8,25.8-4.4,7.8-8.9,15.5-13.3,23.3-2,3.4-3.9,6.9-5.9,10.4h28.8-.2c5.6-9.9,11.3-19.7,16.9-29.6.3-.4.5-.7.9-1.2h0c.3.5.6.8.8,1.1,2.1,3.8,4.2,7.7,6.3,11.5,3.4,6,6.8,12,10.1,18.1h28.9l-5.6-9.9c-1.8-3.2-3.6-6.5-5.4-9.7h.2Z" /><path opacity=".6" d="M86.1,189.9H16l14.3,24.7c11.8,0,23.6-.1,35.5-.2.4,0,.8,0,1.4.2,0,.1,0,.2,0,.3h.2c-.3.5-.4.9-.6,1.2h0c-2.3,3.7-4.6,7.4-6.8,11.2-3.8,6.3-7.5,12.7-11.3,19l-.2-.3h0l14.6,25.1,6.6-11h0l.2.2c1.9-3.2,3.8-6.4,5.7-9.6,3.3-5.5,6.4-11.1,9.7-16.7,1.8-3.1,3.8-6.1,5.6-9.2,4-6.8,7.9-13.6,11.9-20.4,2.7-4.6,5.5-9.3,8.2-13.9l.3-.6h-25.2,0Z" /><path opacity=".8" d="M85,142.3c-5-8.6-9.9-17.1-14.9-25.7-4.5-7.8-9-15.5-13.5-23.2-2.8-4.8-5.6-9.6-8.4-14.4v-.2q0,0,0,0l-14.5,25.3c0,.2.2.4.4.6,6.3,10.8,12.6,21.7,19,32.5.2.4.3.8.6,1.3h-1.4c-4.3,0-8.4-.2-12.7-.3h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.8,6,7.3,13.3,11.8,21.8,13.9,3.3.8,6.8,1.2,10.5,1.3v.2c4.2,0,8.2-.4,12.2-1.6,1.5-.4,3-1,4.5-1.6,13.4-5.7,21.6-15.7,24.5-29.9,1.3-6.4,1-12.7-.9-19ZM217.1,104.3c-.5,3.5-1.7,6.7-3.8,9.5-3.9,5.2-9.2,7.6-14.1,8-11.5,0-19.8-7-21.5-17-.8-4.8-.3-9.5,1.8-13.9,2.8-5.9,7.5-9.7,14-10.9,8.5-1.7,16.5,2,20.9,9.4,2.7,4.6,3.5,9.6,2.7,14.9h0Z" /><path d="M64,52.7l8.3,14.9c1.8,3.2,3.6,6.5,5.4,9.8,3.2,5.6,6.4,11.1,9.6,16.7,1.8,3.1,3.4,6.3,5.2,9.4,3.9,6.8,7.8,13.7,11.7,20.5,2.7,4.7,5.3,9.4,7.9,14.1.2.3.4.6.7.9.2-.3.3-.4.4-.5,4.1-7.1,8.2-14.2,12.3-21.3,4.9-8.6,9.9-17.2,14.8-25.8,4.4-7.8,8.9-15.5,13.3-23.3,4.4-7.8,8.9-15.5,13.3-23.3,1.9-3.4,3.8-6.9,5.7-10.3,3.6-6.2,7.3-12.5,10.9-18.7,2.9-5,5.6-10.1,8.5-15.1.2-.3.3-.6.3-.8h-28.9s0,.1-.1.2h0c-.8,1.4-1.6,2.8-2.4,4.1-.8,1.4-1.6,2.8-2.5,4.3-1.5,2.5-2.9,5.1-4.4,7.6-1,1.7-2,3.5-3,5.2-6.3,10.9-12.4,21.9-18.7,32.9v.2c-6.2,10.9-12.4,21.8-18.7,32.7-.2.4-.5.7-.8,1.2-.3-.5-.6-.8-.8-1.1-2.1-3.8-4.2-7.7-6.3-11.5-3.8-6.8-7.6-13.6-11.4-20.4h0l-1.2-2.3v-.2h-29.1Z" />`;
|
|
35
|
+
let ConsentSecuredBy = class ConsentSecuredBy extends lit_1.LitElement {
|
|
36
|
+
render() {
|
|
37
|
+
const copy = tokens_js_1.CONSENT_COPY_TOKENS.attribution;
|
|
38
|
+
return (0, lit_1.html) `<p class="secured-by" part="secured-by">
|
|
39
|
+
<span class="label">${copy.securedBy}</span
|
|
40
|
+
><span class="lockup"
|
|
41
|
+
><svg
|
|
42
|
+
part="lockup"
|
|
43
|
+
viewBox="0 0 ${ARTWORK_WIDTH} ${ARTWORK_HEIGHT}"
|
|
44
|
+
role="img"
|
|
45
|
+
aria-label=${copy.lockup}
|
|
46
|
+
>
|
|
47
|
+
${LOCKUP_ART}</svg
|
|
48
|
+
><span class="tagline" part="tagline">${copy.tagline}</span></span
|
|
49
|
+
>
|
|
50
|
+
</p>`;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
exports.ConsentSecuredBy = ConsentSecuredBy;
|
|
54
|
+
ConsentSecuredBy.styles = (0, lit_1.css) `
|
|
55
|
+
:host {
|
|
56
|
+
display: block;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.secured-by {
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: flex-start;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
gap: 6px;
|
|
64
|
+
margin: 0;
|
|
65
|
+
font-size: 12px;
|
|
66
|
+
line-height: 16px;
|
|
67
|
+
color: var(--cs-text-tertiary, #5d6c82);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Drops "Secured by" onto the baseline of the lockup's letters. */
|
|
71
|
+
.label {
|
|
72
|
+
margin-top: calc(
|
|
73
|
+
${LOCKUP_HEIGHT}px * ${LETTER_BASELINE} / ${ARTWORK_HEIGHT} - 0.5lh -
|
|
74
|
+
0.375em
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.lockup {
|
|
79
|
+
display: grid;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.lockup > * {
|
|
83
|
+
grid-area: 1 / 1;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.lockup svg {
|
|
87
|
+
display: block;
|
|
88
|
+
height: ${LOCKUP_HEIGHT}px;
|
|
89
|
+
width: ${Math.round((ARTWORK_WIDTH * LOCKUP_HEIGHT) / ARTWORK_HEIGHT)}px;
|
|
90
|
+
fill: var(--cs-lockup, #0810fe);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.tagline {
|
|
94
|
+
align-self: end;
|
|
95
|
+
margin-left: ${Math.round((TAGLINE_LEFT * LOCKUP_HEIGHT) / ARTWORK_HEIGHT)}px;
|
|
96
|
+
white-space: nowrap;
|
|
97
|
+
font-size: 12px;
|
|
98
|
+
font-weight: 600;
|
|
99
|
+
line-height: 1;
|
|
100
|
+
color: var(--cs-text-tertiary, #5d6c82);
|
|
101
|
+
}
|
|
102
|
+
`;
|
|
103
|
+
exports.ConsentSecuredBy = ConsentSecuredBy = __decorate([
|
|
104
|
+
(0, decorators_js_1.customElement)("consent-secured-by")
|
|
105
|
+
], ConsentSecuredBy);
|
|
106
|
+
//# sourceMappingURL=consent-secured-by.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consent-secured-by.js","sourceRoot":"","sources":["../../../src/components/consent-secured-by.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;;;;;;;AAEH,6BAAiD;AACjD,qDAAkD;AAElD,iDAAwD;AAExD,+DAA+D;AAC/D,MAAM,aAAa,GAAG,KAAK,CAAC;AAC5B,MAAM,cAAc,GAAG,KAAK,CAAC;AAC7B,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,2FAA2F;AAC3F,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,YAAY,GAAG,GAAG,CAAC;AAEzB,MAAM,UAAU,GAAG,IAAA,SAAG,EAAA,2tKAA2tK,CAAC;AAG3uK,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,gBAAU;IAqDrC,MAAM;QACb,MAAM,IAAI,GAAG,+BAAmB,CAAC,WAAW,CAAC;QAC7C,OAAO,IAAA,UAAI,EAAA;4BACa,IAAI,CAAC,SAAS;;;;yBAIjB,aAAa,IAAI,cAAc;;uBAEjC,IAAI,CAAC,MAAM;;YAEtB,UAAU;gDAC0B,IAAI,CAAC,OAAO;;SAEnD,CAAC;IACR,CAAC;;AApEU,4CAAgB;AACX,uBAAM,GAAG,IAAA,SAAG,EAAA;;;;;;;;;;;;;;;;;;;UAmBpB,aAAa,QAAQ,eAAe,MAAM,cAAc;;;;;;;;;;;;;;;gBAelD,aAAa;eACd,IAAI,CAAC,KAAK,CAAC,CAAC,aAAa,GAAG,aAAa,CAAC,GAAG,cAAc,CAAC;;;;;;qBAMtD,IAAI,CAAC,KAAK,CACvB,CAAC,YAAY,GAAG,aAAa,CAAC,GAAG,cAAc,CAChD;;;;;;;GAOJ,AAlDqB,CAkDpB;2BAnDS,gBAAgB;IAD5B,IAAA,6BAAa,EAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAqE5B"}
|
|
@@ -164,7 +164,7 @@ ConsentShell.styles = (0, lit_1.css) `
|
|
|
164
164
|
.container {
|
|
165
165
|
box-sizing: border-box;
|
|
166
166
|
background: white;
|
|
167
|
-
border-radius: 20px;
|
|
167
|
+
border-radius: var(--cs-card-radius, 20px);
|
|
168
168
|
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
169
169
|
box-shadow:
|
|
170
170
|
0 20px 25px -5px rgba(0, 0, 0, 0.1),
|
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.ConsentTerms = void 0;
|
|
18
18
|
const lit_1 = require("lit");
|
|
19
19
|
const decorators_js_1 = require("lit/decorators.js");
|
|
20
|
+
const preview_js_1 = require("./preview.js");
|
|
20
21
|
const resolve_branding_js_1 = require("../resolution/resolve-branding.js");
|
|
21
22
|
/**
|
|
22
23
|
* ConsentTerms - Terms acceptance checkbox with link
|
|
@@ -42,6 +43,8 @@ const resolve_branding_js_1 = require("../resolution/resolve-branding.js");
|
|
|
42
43
|
let ConsentTerms = class ConsentTerms extends lit_1.LitElement {
|
|
43
44
|
constructor() {
|
|
44
45
|
super();
|
|
46
|
+
/** Draws as it would live; a link in its label goes nowhere, and it still ticks. */
|
|
47
|
+
this.preview = false;
|
|
45
48
|
/**
|
|
46
49
|
* Form field name. Reflected: a form reads the attribute.
|
|
47
50
|
*/
|
|
@@ -75,6 +78,7 @@ let ConsentTerms = class ConsentTerms extends lit_1.LitElement {
|
|
|
75
78
|
*/
|
|
76
79
|
this.value = "accepted";
|
|
77
80
|
this.internals = this.attachInternals();
|
|
81
|
+
(0, preview_js_1.guardPreviewNavigation)(this);
|
|
78
82
|
}
|
|
79
83
|
updated(changedProperties) {
|
|
80
84
|
if (changedProperties.has("checked") || changedProperties.has("value")) {
|
|
@@ -254,6 +258,9 @@ ConsentTerms.styles = (0, lit_1.css) `
|
|
|
254
258
|
margin-left: 0.125rem;
|
|
255
259
|
}
|
|
256
260
|
`;
|
|
261
|
+
__decorate([
|
|
262
|
+
(0, decorators_js_1.property)({ type: Boolean, reflect: true })
|
|
263
|
+
], ConsentTerms.prototype, "preview", void 0);
|
|
257
264
|
__decorate([
|
|
258
265
|
(0, decorators_js_1.property)({ type: String, reflect: true })
|
|
259
266
|
], ConsentTerms.prototype, "name", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-terms.js","sourceRoot":"","sources":["../../../src/components/consent-terms.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;AAEH,6BAAqD;AACrD,qDAA4D;AAC5D,2EAAoE;AAEpE;;;;;;;;;;;;;;;;;;;;GAoBG;AAEI,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,gBAAU;IAM1C;QACE,KAAK,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"consent-terms.js","sourceRoot":"","sources":["../../../src/components/consent-terms.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;AAEH,6BAAqD;AACrD,qDAA4D;AAC5D,6CAAsD;AACtD,2EAAoE;AAEpE;;;;;;;;;;;;;;;;;;;;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AAO,EAAE,IAAI,EAAE,CAAC;8CAC1B;AAMjB;IADC,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CACR;uBA/ER,YAAY;IADxB,IAAA,6BAAa,EAAC,eAAe,CAAC;GAClB,YAAY,CAuQxB"}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* Status, from your own check of the person's wallet:
|
|
12
12
|
*
|
|
13
|
+
* - `idle`: nothing has started yet; the dial rests, unlit (as the orb's).
|
|
13
14
|
* - `checking`: looking up this browser's wallet.
|
|
14
15
|
* - `syncing`: linking this device's wallet to the account.
|
|
15
16
|
* - `ready`: the wallet can sign.
|
|
@@ -19,6 +20,11 @@
|
|
|
19
20
|
* The orb is decoration (hidden from assistive tech); the caption is
|
|
20
21
|
* announced as it changes.
|
|
21
22
|
*
|
|
23
|
+
* Placement (`placement`): `card` (the default) puts the caption under the orb
|
|
24
|
+
* in the flow. `connector` is for the connector's `mark` slot, in place of its
|
|
25
|
+
* shield (on the capabilities screen, the `connector-mark` slot): the element
|
|
26
|
+
* is the orb's size, and the caption hangs under it on one line.
|
|
27
|
+
*
|
|
22
28
|
* Parts: `frame`, `orb` (the `consent-wallet-orb`), `caption`, and the orb's
|
|
23
29
|
* own `globe`, `dial` and `check`.
|
|
24
30
|
*
|
|
@@ -50,9 +56,11 @@ let ConsentWalletCheck = class ConsentWalletCheck extends lit_1.LitElement {
|
|
|
50
56
|
this.status = "checking";
|
|
51
57
|
/** Your own caption, in place of the status's. */
|
|
52
58
|
this.caption = "";
|
|
59
|
+
/** `card`, or `connector` in the connector's place for the shield. */
|
|
60
|
+
this.placement = "card";
|
|
53
61
|
}
|
|
54
62
|
render() {
|
|
55
|
-
const status = (0, wallet_status_js_1.
|
|
63
|
+
const status = (0, wallet_status_js_1.readWalletOrbStatus)(this.status);
|
|
56
64
|
return (0, lit_1.html) `
|
|
57
65
|
<div part="frame" class="frame">
|
|
58
66
|
<consent-wallet-orb
|
|
@@ -90,10 +98,23 @@ ConsentWalletCheck.styles = (0, lit_1.css) `
|
|
|
90
98
|
|
|
91
99
|
.caption {
|
|
92
100
|
margin: 0;
|
|
93
|
-
color: var(--cs-text-tertiary, #
|
|
101
|
+
color: var(--cs-text-tertiary, #5d6c82);
|
|
94
102
|
font-size: 12px;
|
|
95
103
|
line-height: 1.35;
|
|
96
104
|
}
|
|
105
|
+
|
|
106
|
+
:host([placement="connector"]) .frame {
|
|
107
|
+
position: relative;
|
|
108
|
+
padding: 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
:host([placement="connector"]) .caption {
|
|
112
|
+
position: absolute;
|
|
113
|
+
top: calc(100% + 6px);
|
|
114
|
+
left: 50%;
|
|
115
|
+
translate: -50% 0;
|
|
116
|
+
white-space: nowrap;
|
|
117
|
+
}
|
|
97
118
|
`;
|
|
98
119
|
__decorate([
|
|
99
120
|
(0, decorators_js_1.property)({ type: String, reflect: true })
|
|
@@ -101,6 +122,9 @@ __decorate([
|
|
|
101
122
|
__decorate([
|
|
102
123
|
(0, decorators_js_1.property)({ type: String })
|
|
103
124
|
], ConsentWalletCheck.prototype, "caption", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, decorators_js_1.property)({ type: String, reflect: true })
|
|
127
|
+
], ConsentWalletCheck.prototype, "placement", void 0);
|
|
104
128
|
exports.ConsentWalletCheck = ConsentWalletCheck = __decorate([
|
|
105
129
|
(0, decorators_js_1.customElement)("consent-wallet-check")
|
|
106
130
|
], ConsentWalletCheck);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-wallet-check.js","sourceRoot":"","sources":["../../../src/components/consent-wallet-check.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"consent-wallet-check.js","sourceRoot":"","sources":["../../../src/components/consent-wallet-check.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;;;;;;;;;AAEH,6BAA4C;AA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--cs-wallet-success, #10b981);
|
|
127
|
-
--_muted: var(--cs-wallet-muted, var(--cs-text-tertiary, #
|
|
127
|
+
--_muted: var(--cs-wallet-muted, var(--cs-text-tertiary, #5d6c82));
|
|
128
128
|
position: relative;
|
|
129
129
|
width: 100%;
|
|
130
130
|
height: 100%;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The icons the capabilities screen and a consent flow draw beside the
|
|
4
|
+
* permissions: the unverified-agent warning, a passed check, each
|
|
5
|
+
* "Permission details" row, and the flow's info, declined and granted marks.
|
|
6
|
+
* Lucide's paths (ISC), stroked in `currentColor`.
|
|
7
|
+
*
|
|
8
|
+
* @module components/decision-icons
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.decisionIcon = decisionIcon;
|
|
12
|
+
const lit_1 = require("lit");
|
|
13
|
+
const PATHS = {
|
|
14
|
+
warning: (0, lit_1.svg) `<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" /><path d="M12 9v4" /><path d="M12 17h.01" />`,
|
|
15
|
+
check: (0, lit_1.svg) `<path d="M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z" /><path d="m9 12 2 2 4-4" />`,
|
|
16
|
+
resource: (0, lit_1.svg) `<rect width="20" height="8" x="2" y="2" rx="2" ry="2" /><rect width="20" height="8" x="2" y="14" rx="2" ry="2" /><line x1="6" x2="6.01" y1="6" y2="6" /><line x1="6" x2="6.01" y1="18" y2="18" />`,
|
|
17
|
+
duration: (0, lit_1.svg) `<path d="M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5" /><path d="M16 2v4" /><path d="M8 2v4" /><path d="M3 10h5" /><path d="M17.5 17.5 16 16.3V14" /><circle cx="16" cy="16" r="6" />`,
|
|
18
|
+
budget: (0, lit_1.svg) `<path d="M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1" /><path d="M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4" />`,
|
|
19
|
+
amountLimits: (0, lit_1.svg) `<rect width="20" height="14" x="2" y="5" rx="2" /><line x1="2" x2="22" y1="10" y2="10" />`,
|
|
20
|
+
alreadyGranted: (0, lit_1.svg) `<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /><path d="M3 3v5h5" /><path d="M12 7v5l4 2" />`,
|
|
21
|
+
info: (0, lit_1.svg) `<circle cx="12" cy="12" r="10" /><path d="M12 16v-4" /><path d="M12 8h.01" />`,
|
|
22
|
+
minus: (0, lit_1.svg) `<path d="M5 12h14" />`,
|
|
23
|
+
tick: (0, lit_1.svg) `<path d="M20 6 9 17l-5-5" />`,
|
|
24
|
+
};
|
|
25
|
+
/** An icon, hidden from screen readers: the words beside it carry the meaning. */
|
|
26
|
+
function decisionIcon(name) {
|
|
27
|
+
return (0, lit_1.svg) `<svg
|
|
28
|
+
viewBox="0 0 24 24"
|
|
29
|
+
fill="none"
|
|
30
|
+
stroke="currentColor"
|
|
31
|
+
stroke-width="2"
|
|
32
|
+
stroke-linecap="round"
|
|
33
|
+
stroke-linejoin="round"
|
|
34
|
+
aria-hidden="true"
|
|
35
|
+
>${PATHS[name]}</svg>`;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=decision-icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision-icons.js","sourceRoot":"","sources":["../../../src/components/decision-icons.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAoBH,oCAUC;AA5BD,6BAAkD;AAElD,MAAM,KAAK,GAAG;IACZ,OAAO,EAAE,IAAA,SAAG,EAAA,kIAAkI;IAC9I,KAAK,EAAE,IAAA,SAAG,EAAA,wMAAwM;IAClN,QAAQ,EAAE,IAAA,SAAG,EAAA,mMAAmM;IAChN,QAAQ,EAAE,IAAA,SAAG,EAAA,wMAAwM;IACrN,MAAM,EAAE,IAAA,SAAG,EAAA,+KAA+K;IAC1L,YAAY,EAAE,IAAA,SAAG,EAAA,2FAA2F;IAC5G,cAAc,EAAE,IAAA,SAAG,EAAA,6GAA6G;IAChI,IAAI,EAAE,IAAA,SAAG,EAAA,+EAA+E;IACxF,KAAK,EAAE,IAAA,SAAG,EAAA,uBAAuB;IACjC,IAAI,EAAE,IAAA,SAAG,EAAA,8BAA8B;CAC/B,CAAC;AAIX,kFAAkF;AAClF,SAAgB,YAAY,CAAC,IAAkB;IAC7C,OAAO,IAAA,SAAG,EAAA;;;;;;;;KAQP,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Edit Regions
|
|
4
|
+
*
|
|
5
|
+
* In edit mode (`preview` and `editable` together) the words a person can
|
|
6
|
+
* change are regions: leaf spans a person types into, each named by a key
|
|
7
|
+
* from `CONSENT_EDIT_KEYS`. A region never sits inside a button, and no Lit
|
|
8
|
+
* part sits inside a region, so typing cannot disturb the template.
|
|
9
|
+
*
|
|
10
|
+
* A region holds the drawn text until it has focus. Focus swaps in its raw
|
|
11
|
+
* text from `editSource` (a template with its placeholders, say) and puts the
|
|
12
|
+
* caret at the end; leaving it draws the text again. While a region has focus
|
|
13
|
+
* a render never writes into it, so a host that writes each keystroke back
|
|
14
|
+
* moves no caret. Each change sends `consent-edit` with `{ key, value }`, and
|
|
15
|
+
* leaving a changed region sends `consent-edit-end`; focus and blur with no
|
|
16
|
+
* change send nothing. Enter and Escape leave the region, every key stays in
|
|
17
|
+
* it (so no row toggle or page shortcut sees typing), paste inserts plain
|
|
18
|
+
* text on one line, and a drop is ignored. An Enter an input method takes to
|
|
19
|
+
* accept a candidate stays with the input method.
|
|
20
|
+
*
|
|
21
|
+
* @module components/edit-region
|
|
22
|
+
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.editRegionStyles = exports.editableText = void 0;
|
|
25
|
+
exports.editRegion = editRegion;
|
|
26
|
+
const lit_1 = require("lit");
|
|
27
|
+
const directive_js_1 = require("lit/directive.js");
|
|
28
|
+
const lit_2 = require("lit");
|
|
29
|
+
const edit_types_js_1 = require("../types/edit.types.js");
|
|
30
|
+
const regions = new WeakMap();
|
|
31
|
+
/**
|
|
32
|
+
* `plaintext-only` where the browser has it, so typing and pasting make no
|
|
33
|
+
* markup; `true` elsewhere, with the paste, drop and format handlers below
|
|
34
|
+
* doing the same.
|
|
35
|
+
*/
|
|
36
|
+
let editableValue;
|
|
37
|
+
function contentEditableValue() {
|
|
38
|
+
if (editableValue)
|
|
39
|
+
return editableValue;
|
|
40
|
+
if (typeof document === "undefined")
|
|
41
|
+
return "true";
|
|
42
|
+
try {
|
|
43
|
+
const probe = document.createElement("span");
|
|
44
|
+
probe.contentEditable = "plaintext-only";
|
|
45
|
+
editableValue =
|
|
46
|
+
probe.contentEditable === "plaintext-only" ? "plaintext-only" : "true";
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// Browsers without plaintext-only throw on the assignment.
|
|
50
|
+
editableValue = "true";
|
|
51
|
+
}
|
|
52
|
+
return editableValue;
|
|
53
|
+
}
|
|
54
|
+
function hasFocus(el) {
|
|
55
|
+
const root = el.getRootNode();
|
|
56
|
+
return root.activeElement === el;
|
|
57
|
+
}
|
|
58
|
+
/** A region's text as one line, with the spaces a browser keeps visible as plain spaces. */
|
|
59
|
+
function lineOf(text) {
|
|
60
|
+
return text.replace(/ /g, " ").replace(/\s*[\r\n]+\s*/g, " ");
|
|
61
|
+
}
|
|
62
|
+
function emit(el, type, detail) {
|
|
63
|
+
el.dispatchEvent(new CustomEvent(type, {
|
|
64
|
+
detail,
|
|
65
|
+
bubbles: true,
|
|
66
|
+
composed: true,
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Puts the caret after the region's last character. Collapsing the document's
|
|
71
|
+
* selection reaches into a shadow root in every engine, where WebKit drops a
|
|
72
|
+
* range added there.
|
|
73
|
+
*/
|
|
74
|
+
function caretToEnd(el) {
|
|
75
|
+
el.ownerDocument.getSelection()?.collapse(el, el.childNodes.length);
|
|
76
|
+
}
|
|
77
|
+
/** Inserts plain text at the caret, through the editing commands where they work so undo keeps it. */
|
|
78
|
+
function insertPlainText(el, text) {
|
|
79
|
+
if (!text)
|
|
80
|
+
return;
|
|
81
|
+
const doc = el.ownerDocument;
|
|
82
|
+
if (typeof doc.execCommand === "function") {
|
|
83
|
+
try {
|
|
84
|
+
if (doc.execCommand("insertText", false, text))
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
// Fall through to inserting by hand.
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const selection = doc.getSelection();
|
|
92
|
+
if (!selection || selection.rangeCount === 0)
|
|
93
|
+
return;
|
|
94
|
+
const range = selection.getRangeAt(0);
|
|
95
|
+
if (!el.contains(range.commonAncestorContainer))
|
|
96
|
+
return;
|
|
97
|
+
range.deleteContents();
|
|
98
|
+
const node = doc.createTextNode(text);
|
|
99
|
+
range.insertNode(node);
|
|
100
|
+
range.setStartAfter(node);
|
|
101
|
+
range.collapse(true);
|
|
102
|
+
selection.removeAllRanges();
|
|
103
|
+
selection.addRange(range);
|
|
104
|
+
el.dispatchEvent(new InputEvent("input", {
|
|
105
|
+
bubbles: true,
|
|
106
|
+
composed: true,
|
|
107
|
+
inputType: "insertText",
|
|
108
|
+
data: text,
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
111
|
+
function onPointerDown(event) {
|
|
112
|
+
const state = regions.get(event.currentTarget);
|
|
113
|
+
if (state)
|
|
114
|
+
state.pointer = true;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* A press on a region whose raw text differs from its drawn text would place
|
|
118
|
+
* a caret in text that changes under it on focus. The region takes the press
|
|
119
|
+
* over instead: it focuses itself, which swaps the text and puts the caret at
|
|
120
|
+
* the end.
|
|
121
|
+
*/
|
|
122
|
+
function onMouseDown(event) {
|
|
123
|
+
const el = event.currentTarget;
|
|
124
|
+
const state = regions.get(el);
|
|
125
|
+
if (!state || event.button !== 0 || hasFocus(el))
|
|
126
|
+
return;
|
|
127
|
+
if (el.textContent === state.source)
|
|
128
|
+
return;
|
|
129
|
+
event.preventDefault();
|
|
130
|
+
state.pointer = false;
|
|
131
|
+
el.focus();
|
|
132
|
+
}
|
|
133
|
+
function onFocus(event) {
|
|
134
|
+
const el = event.currentTarget;
|
|
135
|
+
const state = regions.get(el);
|
|
136
|
+
if (!state)
|
|
137
|
+
return;
|
|
138
|
+
state.changed = false;
|
|
139
|
+
const swapped = el.textContent !== state.source;
|
|
140
|
+
if (swapped)
|
|
141
|
+
el.textContent = state.source;
|
|
142
|
+
state.value = lineOf(el.textContent ?? "");
|
|
143
|
+
// A click on drawn text that is also the raw text keeps the caret where it
|
|
144
|
+
// landed; a press that swaps the text never gets here (see onMouseDown).
|
|
145
|
+
if (swapped || !state.pointer)
|
|
146
|
+
caretToEnd(el);
|
|
147
|
+
state.pointer = false;
|
|
148
|
+
}
|
|
149
|
+
function onInput(event) {
|
|
150
|
+
const el = event.currentTarget;
|
|
151
|
+
const state = regions.get(el);
|
|
152
|
+
if (!state)
|
|
153
|
+
return;
|
|
154
|
+
// A browser keeps an emptied or replaced editing host open with a <br>,
|
|
155
|
+
// which in a one-line region would break the line.
|
|
156
|
+
for (const br of el.querySelectorAll("br"))
|
|
157
|
+
br.remove();
|
|
158
|
+
state.changed = true;
|
|
159
|
+
state.value = lineOf(el.textContent ?? "");
|
|
160
|
+
emit(el, edit_types_js_1.CONSENT_EDIT_EVENTS.edit, { key: state.key, value: state.value });
|
|
161
|
+
}
|
|
162
|
+
function onBlur(event) {
|
|
163
|
+
const el = event.currentTarget;
|
|
164
|
+
const state = regions.get(el);
|
|
165
|
+
if (!state)
|
|
166
|
+
return;
|
|
167
|
+
state.pointer = false;
|
|
168
|
+
if (el.textContent !== state.text)
|
|
169
|
+
el.textContent = state.text;
|
|
170
|
+
if (!state.changed)
|
|
171
|
+
return;
|
|
172
|
+
state.changed = false;
|
|
173
|
+
emit(el, edit_types_js_1.CONSENT_EDIT_EVENTS.end, { key: state.key, value: state.value });
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Whether a key belongs to an input method (IME) composing text. WebKit ends
|
|
177
|
+
* the composition before the Enter that accepts a candidate, so that Enter
|
|
178
|
+
* has `isComposing` false and only its 229 key code says the IME took it.
|
|
179
|
+
*/
|
|
180
|
+
function isImeKey(event) {
|
|
181
|
+
return event.isComposing || event.keyCode === 229;
|
|
182
|
+
}
|
|
183
|
+
function onKeyDown(event) {
|
|
184
|
+
event.stopPropagation();
|
|
185
|
+
if (isImeKey(event))
|
|
186
|
+
return;
|
|
187
|
+
if (event.key === "Enter" || event.key === "Escape") {
|
|
188
|
+
event.preventDefault();
|
|
189
|
+
event.currentTarget.blur();
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/** Formatting and line breaks never reach a region, whichever contenteditable value it has. */
|
|
193
|
+
function onBeforeInput(event) {
|
|
194
|
+
if (event.inputType.startsWith("format") ||
|
|
195
|
+
event.inputType === "insertParagraph" ||
|
|
196
|
+
event.inputType === "insertLineBreak") {
|
|
197
|
+
event.preventDefault();
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function onPaste(event) {
|
|
201
|
+
event.preventDefault();
|
|
202
|
+
insertPlainText(event.currentTarget, lineOf(event.clipboardData?.getData("text/plain") ?? ""));
|
|
203
|
+
}
|
|
204
|
+
function onDrop(event) {
|
|
205
|
+
event.preventDefault();
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Writes a region's drawn text, except while the region has focus: then the
|
|
209
|
+
* person's typing stays as it is, caret and all, and the text is drawn when
|
|
210
|
+
* they leave.
|
|
211
|
+
*/
|
|
212
|
+
class EditableTextDirective extends directive_js_1.Directive {
|
|
213
|
+
constructor(partInfo) {
|
|
214
|
+
super(partInfo);
|
|
215
|
+
if (partInfo.type !== directive_js_1.PartType.ELEMENT) {
|
|
216
|
+
throw new Error("editableText goes on an element, as an attribute-less binding");
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
render(_key, _text, _source) {
|
|
220
|
+
return lit_2.noChange;
|
|
221
|
+
}
|
|
222
|
+
update(part, [key, text, source]) {
|
|
223
|
+
const el = part.element;
|
|
224
|
+
const state = regions.get(el);
|
|
225
|
+
if (state) {
|
|
226
|
+
state.key = key;
|
|
227
|
+
state.text = text;
|
|
228
|
+
state.source = source;
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
regions.set(el, {
|
|
232
|
+
key,
|
|
233
|
+
text,
|
|
234
|
+
source,
|
|
235
|
+
changed: false,
|
|
236
|
+
value: text,
|
|
237
|
+
pointer: false,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
if (!hasFocus(el) && el.textContent !== text)
|
|
241
|
+
el.textContent = text;
|
|
242
|
+
return lit_2.noChange;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
/** See EditableTextDirective. */
|
|
246
|
+
exports.editableText = (0, directive_js_1.directive)(EditableTextDirective);
|
|
247
|
+
/**
|
|
248
|
+
* A region for `key`: the drawn `text`, edited as `source[key]` when the
|
|
249
|
+
* source has one. `label` is what a screen reader calls it.
|
|
250
|
+
*/
|
|
251
|
+
function editRegion(key, label, text, source) {
|
|
252
|
+
return (0, lit_1.html) `<span
|
|
253
|
+
class="edit-region"
|
|
254
|
+
data-edit-key=${key}
|
|
255
|
+
role="textbox"
|
|
256
|
+
aria-label=${label}
|
|
257
|
+
contenteditable=${contentEditableValue()}
|
|
258
|
+
spellcheck="true"
|
|
259
|
+
${(0, exports.editableText)(key, text, source?.[key] ?? text)}
|
|
260
|
+
@pointerdown=${onPointerDown}
|
|
261
|
+
@mousedown=${onMouseDown}
|
|
262
|
+
@focus=${onFocus}
|
|
263
|
+
@blur=${onBlur}
|
|
264
|
+
@keydown=${onKeyDown}
|
|
265
|
+
@beforeinput=${onBeforeInput}
|
|
266
|
+
@input=${onInput}
|
|
267
|
+
@paste=${onPaste}
|
|
268
|
+
@drop=${onDrop}
|
|
269
|
+
></span>`;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* How a region shows it can be edited. Outlines take no room, so edit mode
|
|
273
|
+
* lays out exactly as the preview does. The defaults come from the text's own
|
|
274
|
+
* color; `--cs-edit-hover-ring`, `--cs-edit-focus-ring` and `--cs-edit-wash`
|
|
275
|
+
* set them.
|
|
276
|
+
*/
|
|
277
|
+
exports.editRegionStyles = (0, lit_1.css) `
|
|
278
|
+
.edit-region {
|
|
279
|
+
cursor: text;
|
|
280
|
+
border-radius: 3px;
|
|
281
|
+
outline: 1px dashed transparent;
|
|
282
|
+
outline-offset: 2px;
|
|
283
|
+
transition:
|
|
284
|
+
outline-color 0.12s ease,
|
|
285
|
+
background-color 0.12s ease;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.edit-region:hover {
|
|
289
|
+
outline-color: var(
|
|
290
|
+
--cs-edit-hover-ring,
|
|
291
|
+
color-mix(in srgb, currentColor 45%, transparent)
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.edit-region:focus {
|
|
296
|
+
outline: 2px solid var(--cs-edit-focus-ring, currentColor);
|
|
297
|
+
background-color: var(
|
|
298
|
+
--cs-edit-wash,
|
|
299
|
+
color-mix(in srgb, currentColor 8%, transparent)
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/* An emptied region keeps room for the caret and something to click. */
|
|
304
|
+
.edit-region:empty {
|
|
305
|
+
display: inline-block;
|
|
306
|
+
min-width: 1ch;
|
|
307
|
+
}
|
|
308
|
+
`;
|
|
309
|
+
//# sourceMappingURL=edit-region.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-region.js","sourceRoot":"","sources":["../../../src/components/edit-region.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AA6QH,gCAwBC;AAnSD,6BAAqD;AACrD,mDAM0B;AAC1B,6BAA+B;AAE/B,0DAKgC;AAiBhC,MAAM,OAAO,GAAG,IAAI,OAAO,EAA4B,CAAC;AAExD;;;;GAIG;AACH,IAAI,aAAoD,CAAC;AAEzD,SAAS,oBAAoB;IAC3B,IAAI,aAAa;QAAE,OAAO,aAAa,CAAC;IACxC,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAO,MAAM,CAAC;IACnD,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC7C,KAAK,CAAC,eAAe,GAAG,gBAAgB,CAAC;QACzC,aAAa;YACX,KAAK,CAAC,eAAe,KAAK,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC;IAC3E,CAAC;IAAC,MAAM,CAAC;QACP,2DAA2D;QAC3D,aAAa,GAAG,MAAM,CAAC;IACzB,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,SAAS,QAAQ,CAAC,EAAe;IAC/B,MAAM,IAAI,GAAG,EAAE,CAAC,WAAW,EAA2B,CAAC;IACvD,OAAO,IAAI,CAAC,aAAa,KAAK,EAAE,CAAC;AACnC,CAAC;AAED,4FAA4F;AAC5F,SAAS,MAAM,CAAC,IAAY;IAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAA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