@pontive/pontkit-core 1.34.1 → 1.36.0
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/catalog.json +1 -1
- package/custom-elements.json +1 -1
- package/dist/pont2/core/attrs.d.ts +7 -0
- package/dist/pont2/core/design-mode.d.ts +37 -0
- package/dist/pont2/core/index.d.ts +3 -0
- package/dist/pont2/core/messages.d.ts +71 -0
- package/dist/pont2/core/url.d.ts +19 -0
- package/dist/pont2/index.mjs +1841 -1513
- package/dist/pont2/index.mjs.map +1 -1
- package/dist/pont2/kit/auth-button/auth-button.d.ts +5 -0
- package/dist/pont2/kit/auth-field/auth-field.d.ts +12 -2
- package/dist/pont2/kit/auth-field/password-field.d.ts +4 -1
- package/dist/pont2/kit/consent/consent-api.d.ts +53 -0
- package/dist/pont2/kit/consent/consent.d.ts +83 -0
- package/dist/pont2/kit/container/container.d.ts +3 -0
- package/dist/pont2/kit/countdown/countdown.d.ts +2 -2
- package/dist/pont2/kit/flow-widget/flow-widget.d.ts +37 -6
- package/dist/pont2/kit/index.d.ts +1 -0
- package/dist/pont2/kit/layout/flow-error.d.ts +24 -1
- package/dist/pont2/kit/layout/layout.d.ts +31 -3
- package/dist/pont2/kit/link/link.d.ts +43 -4
- package/dist/pont2/kit/logo/logo.d.ts +3 -0
- package/dist/pont2/kit/provider-field/provider-field.d.ts +10 -1
- package/dist/pont2/migration/legacy-markup.d.ts +36 -0
- package/dist/pont2/styles.css +61 -2
- package/package.json +1 -1
|
@@ -19,4 +19,11 @@ declare class AttrsDirective extends Directive {
|
|
|
19
19
|
export declare const attrs: (_attrs: AttrMap) => import('lit-html/directive.js').DirectiveResult<typeof AttrsDirective>;
|
|
20
20
|
/** Imperative twin of `attrs()`, for code that holds a node rather than a template. */
|
|
21
21
|
export declare function applyAttrs(el: Element, map: AttrMap, previous?: Iterable<string>): void;
|
|
22
|
+
/**
|
|
23
|
+
* A list attribute: a JSON array (`["google","github"]`, the form the platform's
|
|
24
|
+
* resolve pass writes for `providers` and `identifiers`) or space/comma-separated
|
|
25
|
+
* words (`google github`), as authors write them. Non-string JSON items become
|
|
26
|
+
* strings; anything unparsable is an empty list.
|
|
27
|
+
*/
|
|
28
|
+
export declare function parseList(value: string | null | undefined): string[];
|
|
22
29
|
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ReactiveElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* # Design mode: the element is on the screen designer's canvas
|
|
4
|
+
*
|
|
5
|
+
* Resolution (turning an app's providers into buttons, narrowing identifiers,
|
|
6
|
+
* injecting the brand logo) happens at serve time, on the server. The designer
|
|
7
|
+
* has no app to resolve against, so an element placed there in its normal,
|
|
8
|
+
* bare authored form would render its empty state: an empty provider grid, a
|
|
9
|
+
* broken logo. That isn't neutral; it tells the author the element is broken.
|
|
10
|
+
*
|
|
11
|
+
* In design mode an element renders a **representative example** of itself
|
|
12
|
+
* instead (pontive-spec 17 §1). It must not prune itself, inject real
|
|
13
|
+
* configuration, or substitute `{{placeholders}}` (pont2 never does). Ported
|
|
14
|
+
* from the legacy `designModeContext` (migration tracker F-32).
|
|
15
|
+
*
|
|
16
|
+
* `pont2-layout` provides it (`design-mode`), which is how the dashboard's
|
|
17
|
+
* widget builder drives it. Its key is `pont2:design-mode`.
|
|
18
|
+
*
|
|
19
|
+
* Design mode is an authoring signal only: it never touches the branding
|
|
20
|
+
* entitlement (the watermark), which has no override at all.
|
|
21
|
+
*/
|
|
22
|
+
export declare const designModeContext: {
|
|
23
|
+
__context__: boolean;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Reads design mode for one element. An explicit `design-mode` attribute on the
|
|
27
|
+
* element wins (`design-mode` or `design-mode="true"` on; `design-mode="false"`
|
|
28
|
+
* off), so a story or a standalone demo can show the design rendering without a
|
|
29
|
+
* layout. Otherwise the nearest provider decides.
|
|
30
|
+
*/
|
|
31
|
+
export declare class DesignModeController {
|
|
32
|
+
private readonly host;
|
|
33
|
+
private consumer;
|
|
34
|
+
constructor(host: ReactiveElement);
|
|
35
|
+
/** Whether the element should render its design-mode example. */
|
|
36
|
+
get active(): boolean;
|
|
37
|
+
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
export * from './host-element';
|
|
2
2
|
export * from './form-control';
|
|
3
3
|
export * from './attrs';
|
|
4
|
+
export * from './design-mode';
|
|
4
5
|
export * from './ids';
|
|
5
6
|
export * from './events';
|
|
6
7
|
export * from './icons';
|
|
8
|
+
export * from './messages';
|
|
7
9
|
export * from './names';
|
|
10
|
+
export * from './url';
|
|
8
11
|
export * from './controllers/roving-focus';
|
|
9
12
|
export * from './controllers/action';
|
|
10
13
|
export * from './controllers/copy';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* # The kit's own words: a message table (decision D8 of the migration plan)
|
|
4
|
+
*
|
|
5
|
+
* Text no render spec carries, which a kit element writes itself: a connection
|
|
6
|
+
* error, "Start again", the password toggle's and the spinner's labels. The
|
|
7
|
+
* sign-in runtime sends it with every flow response, already in the flow's
|
|
8
|
+
* language and the instance's wording (branding-svc `pkg/message`, the codes
|
|
9
|
+
* marked Client; the SDK exposes them as `messages` on start results and flow
|
|
10
|
+
* events). Whatever receives a set calls `setMessages`, and every place that
|
|
11
|
+
* would write English reads `msg(code)` instead.
|
|
12
|
+
*
|
|
13
|
+
* English is the fallback. It is only needed before the page has heard from the
|
|
14
|
+
* server, for example when a flow fails to start because the network is down.
|
|
15
|
+
* Once a set has arrived it is kept, so a later failure that never reaches the
|
|
16
|
+
* server is still worded in the page's language.
|
|
17
|
+
*
|
|
18
|
+
* The table is **page-wide**, as in the legacy kit (`src/i18n/messages.ts`,
|
|
19
|
+
* ported, carry-over §2): every widget on a page speaks the same language, and
|
|
20
|
+
* a set one widget receives (or a stopped instance's refusal, §6) applies to all.
|
|
21
|
+
* Elements that render `msg()` add a `MessagesController`, so text that arrives
|
|
22
|
+
* after they first rendered reaches them.
|
|
23
|
+
*
|
|
24
|
+
* The account widgets' codes (carry-over §3) join this table when they are
|
|
25
|
+
* built (migration tracker I-2, W-7…W-10).
|
|
26
|
+
*/
|
|
27
|
+
export declare const KIT_MESSAGES_EN: {
|
|
28
|
+
readonly connection_failed: "We couldn't reach the server. Check your connection and try again.";
|
|
29
|
+
readonly too_many_attempts: "Too many attempts. Try again later.";
|
|
30
|
+
readonly server_error: "Something went wrong on our side. Please try again.";
|
|
31
|
+
readonly instance_unavailable: "This app isn't available right now.";
|
|
32
|
+
readonly generic_error: "Something went wrong. Please try again.";
|
|
33
|
+
readonly flow_ended: "This sign-in could not be completed.";
|
|
34
|
+
readonly passkey_cancelled: "The passkey request was cancelled or timed out. Please try again.";
|
|
35
|
+
readonly start_again: "Start again";
|
|
36
|
+
readonly continued_elsewhere_title: "You continued in another tab";
|
|
37
|
+
readonly continued_elsewhere_subtitle: "You can close this one.";
|
|
38
|
+
readonly continue_here: "Continue here instead";
|
|
39
|
+
readonly show_password: "Show password";
|
|
40
|
+
readonly hide_password: "Hide password";
|
|
41
|
+
readonly loading: "Loading";
|
|
42
|
+
};
|
|
43
|
+
export type KitMessageCode = keyof typeof KIT_MESSAGES_EN;
|
|
44
|
+
/**
|
|
45
|
+
* Records a set the server sent. Sets merge (a flow response and, later, the
|
|
46
|
+
* widget-messages read carry different codes for the same language). An empty or
|
|
47
|
+
* missing set changes nothing: a response without one says nothing about the
|
|
48
|
+
* language having changed.
|
|
49
|
+
*/
|
|
50
|
+
export declare function setMessages(messages?: Record<string, string> | null, locale?: string): void;
|
|
51
|
+
/**
|
|
52
|
+
* The text for a code in the language the page was last served in. A code
|
|
53
|
+
* outside the kit's table needs a `fallback`; without one, the code itself is
|
|
54
|
+
* returned (visible, rather than an empty string).
|
|
55
|
+
*/
|
|
56
|
+
export declare function msg(code: KitMessageCode): string;
|
|
57
|
+
export declare function msg(code: string, fallback: string): string;
|
|
58
|
+
/** The language the page was last served in, for formatting; undefined until the server has said. */
|
|
59
|
+
export declare function currentLocale(): string | undefined;
|
|
60
|
+
/** Calls `listener` whenever a set arrives. Returns the unsubscribe. */
|
|
61
|
+
export declare function onMessagesChanged(listener: () => void): () => void;
|
|
62
|
+
/** Forgets every set. For tests and stories. */
|
|
63
|
+
export declare function resetMessages(): void;
|
|
64
|
+
/** Re-renders its host whenever a set arrives. Add it to every element that renders `msg()`. */
|
|
65
|
+
export declare class MessagesController implements ReactiveController {
|
|
66
|
+
private readonly host;
|
|
67
|
+
private unsubscribe?;
|
|
68
|
+
constructor(host: ReactiveControllerHost);
|
|
69
|
+
hostConnected(): void;
|
|
70
|
+
hostDisconnected(): void;
|
|
71
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URLs a kit element may navigate to or link to.
|
|
3
|
+
*
|
|
4
|
+
* Render specs and attributes are data, so an `href` or a redirect target can
|
|
5
|
+
* be anything, including `javascript:` or `data:`. Every element that turns
|
|
6
|
+
* one into navigation (`pont2-link[href]`, `pont2-countdown[redirect-url]`)
|
|
7
|
+
* goes through `safeUrl` and treats `null` as "don't navigate".
|
|
8
|
+
*/
|
|
9
|
+
/** Resolves `raw` against `base` (the page) and accepts only http(s); otherwise `null`. */
|
|
10
|
+
export declare function safeUrl(raw: string | null | undefined, base?: string): string | null;
|
|
11
|
+
/**
|
|
12
|
+
* Stricter than `safeUrl`: an **absolute** http(s) URL with a host, or `null`.
|
|
13
|
+
* For links to pages outside the flow (`pont2-external-link`), whose href is
|
|
14
|
+
* usually a server placeholder filled from the app's settings
|
|
15
|
+
* (`{{consent_privacy_policy_url}}`): empty, still a placeholder, relative or
|
|
16
|
+
* a code-running scheme must not become a link. The legacy
|
|
17
|
+
* `safeExternalHref`, ported.
|
|
18
|
+
*/
|
|
19
|
+
export declare function safeExternalUrl(raw: unknown): string | null;
|