@pontive/pontkit-core 1.53.0 → 1.54.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
CHANGED
|
@@ -36664,7 +36664,7 @@
|
|
|
36664
36664
|
},
|
|
36665
36665
|
{
|
|
36666
36666
|
"kind": "class",
|
|
36667
|
-
"description": "# FlowWidget: the base of `<pont-signin>` / `<pont-signup>`\n\n```ts\nimport { Auth } from \"@pontive/oidc-client\";\nimport { dispatchFlowState } from \"@pontive/pontkit-core\";\n\nAuth.configure({ …, onFlowStateChange: dispatchFlowState });\ndocument.querySelector(\"pont-signin\")!.client = Auth;\n```\n\n```html\n<pont-signin data-pont-flow-widget data-slot=\"flow-widget\" data-state=\"screen\">\n <pont-layout>…the current screen…</pont-layout>\n</pont-signin>\n```\n\nIt **starts the flow** (`client.startLoginflow(flowId)`, after\n`client.whenConfigured()` when the client has one), renders **one\n`pont-layout`** with the screen, the client, the branding entitlements and\nthe flow's localised messages, and keeps it current:\n\n- each request's next screen is rendered by the layout itself;\n- asynchronous changes arrive through `dispatchFlowState` (see above): a new\n `render_spec`, new `messages`, or `flow_continued_elsewhere`, which shows\n \"You continued in another tab\" with a \"Continue here instead\" link\n (`continue_here`, handled by the SDK);\n- \"Start again\" in the layout (`pont-layout-restart`), or `restart()`,\n starts the flow over;\n- a flow that fails to start shows the error in the layout, restartable.\n\nUntil the first screen arrives it shows a spinner (`data-state=\"loading\"`).\n\nNesting `pont-layout` in a kit template is the allow-listed case (docs/10\n§5 rule 6): the layout is the stateful flow host, one per widget.\n\nInside a `<pont-provider>` it needs nothing: the provider's client\n(`pont:client`), branding entitlements (`pont:branding`) and login hint\n(`pont:login-hint`) are used unless the widget is given its own.",
|
|
36667
|
+
"description": "# FlowWidget: the base of `<pont-signin>` / `<pont-signup>`\n\n```ts\nimport { Auth } from \"@pontive/oidc-client\";\nimport { dispatchFlowState } from \"@pontive/pontkit-core\";\n\nAuth.configure({ …, onFlowStateChange: dispatchFlowState });\ndocument.querySelector(\"pont-signin\")!.client = Auth;\n```\n\n```html\n<pont-signin data-pont-flow-widget data-slot=\"flow-widget\" data-state=\"screen\">\n <pont-layout>…the current screen…</pont-layout>\n</pont-signin>\n```\n\nIt **starts the flow** (`client.startLoginflow(flowId)`, after\n`client.whenConfigured()` when the client has one), renders **one\n`pont-layout`** with the screen, the client, the branding entitlements and\nthe flow's localised messages, and keeps it current:\n\n- each request's next screen is rendered by the layout itself;\n- asynchronous changes arrive through `dispatchFlowState` (see above): a new\n `render_spec`, new `messages`, or `flow_continued_elsewhere`, which shows\n \"You continued in another tab\" with a \"Continue here instead\" link\n (`continue_here`, handled by the SDK);\n- \"Start again\" in the layout (`pont-layout-restart`), or `restart()`,\n starts the flow over;\n- a flow that fails to start shows the error in the layout, restartable unless\n starting again cannot help (`final`: a stopped instance, a scope the app does\n not allow).\n\nUntil the first screen arrives it shows a spinner (`data-state=\"loading\"`).\n\nNesting `pont-layout` in a kit template is the allow-listed case (docs/10\n§5 rule 6): the layout is the stateful flow host, one per widget.\n\nInside a `<pont-provider>` it needs nothing: the provider's client\n(`pont:client`), branding entitlements (`pont:branding`) and login hint\n(`pont:login-hint`) are used unless the widget is given its own.",
|
|
36668
36668
|
"name": "FlowWidget",
|
|
36669
36669
|
"members": [
|
|
36670
36670
|
{
|
|
@@ -40246,7 +40246,7 @@
|
|
|
40246
40246
|
}
|
|
40247
40247
|
}
|
|
40248
40248
|
],
|
|
40249
|
-
"description": "a cancelled or timed-out WebAuthn prompt (`NotAllowedError` / `AbortError`) → passkey_cancelled\n- `instance_unavailable` → the refusal's own sentence, kept for the page (rememberUnavailable); not restartable\n- `invalid_scope` (a flow start asking for a scope the app does not allow) → scope_not_allowed\n- 409 → the code's message, else the server's sentence, else flow_ended; restartable\n- no response at all (NETWORK_ERROR / TIMEOUT) → connection_failed\n- 429 → too_many_attempts; ≥ 500 → server_error\n- anything else → the code's message, else the server's sentence, else generic_error\n\nText comes from `messages` when given (a set a caller holds), else the\npage-wide message table (core/messages.ts), else English. \"The code's\nmessage\" is the text for the refusal's `error.code` when the kit has one:\nthat text is localised (branding-svc), the server's own is English only, so\nthe server's sentence (without a leading code, serverSentence) is the\nfallback for a code the kit has no message for."
|
|
40249
|
+
"description": "a cancelled or timed-out WebAuthn prompt (`NotAllowedError` / `AbortError`) → passkey_cancelled\n- `instance_unavailable` → the refusal's own sentence, kept for the page (rememberUnavailable); not restartable, final\n- `invalid_scope` (a flow start asking for a scope the app does not allow) → scope_not_allowed; final\n- 409 → the code's message, else the server's sentence, else flow_ended; restartable\n- no response at all (NETWORK_ERROR / TIMEOUT) → connection_failed\n- 429 → too_many_attempts; ≥ 500 → server_error\n- anything else → the code's message, else the server's sentence, else generic_error\n\nText comes from `messages` when given (a set a caller holds), else the\npage-wide message table (core/messages.ts), else English. \"The code's\nmessage\" is the text for the refusal's `error.code` when the kit has one:\nthat text is localised (branding-svc), the server's own is English only, so\nthe server's sentence (without a leading code, serverSentence) is the\nfallback for a code the kit has no message for."
|
|
40250
40250
|
},
|
|
40251
40251
|
{
|
|
40252
40252
|
"kind": "function",
|
package/dist/index.mjs
CHANGED
|
@@ -9054,7 +9054,7 @@ function vh(s, t = {}) {
|
|
|
9054
9054
|
if (typeof DOMException < "u" && s instanceof DOMException && (s.name === "NotAllowedError" || s.name === "AbortError"))
|
|
9055
9055
|
return { message: e("passkey_cancelled"), restartable: !1 };
|
|
9056
9056
|
const { status: n, code: r, message: a } = xm(s);
|
|
9057
|
-
return r === lt ? (Em(a), { message: c(lt), restartable: !1, unavailable: !0 }) : r === Ob ? { message: e("scope_not_allowed"), restartable: !1 } : n === Pb ? { message: i(r, a) ?? e("flow_ended"), restartable: !0 } : n === void 0 && (r === "NETWORK_ERROR" || r === "TIMEOUT") ? { message: e("connection_failed"), restartable: !1 } : n === 429 ? { message: e("too_many_attempts"), restartable: !1 } : n !== void 0 && n >= 500 ? { message: e("server_error"), restartable: !1 } : { message: i(r, a) ?? e("generic_error"), restartable: !1 };
|
|
9057
|
+
return r === lt ? (Em(a), { message: c(lt), restartable: !1, unavailable: !0, final: !0 }) : r === Ob ? { message: e("scope_not_allowed"), restartable: !1, final: !0 } : n === Pb ? { message: i(r, a) ?? e("flow_ended"), restartable: !0 } : n === void 0 && (r === "NETWORK_ERROR" || r === "TIMEOUT") ? { message: e("connection_failed"), restartable: !1 } : n === 429 ? { message: e("too_many_attempts"), restartable: !1 } : n !== void 0 && n >= 500 ? { message: e("server_error"), restartable: !1 } : { message: i(r, a) ?? e("generic_error"), restartable: !1 };
|
|
9058
9058
|
}
|
|
9059
9059
|
function Db(s, t) {
|
|
9060
9060
|
var e;
|
|
@@ -9419,7 +9419,7 @@ const rp = 5e3, Ze = class Ze extends y {
|
|
|
9419
9419
|
i != null && i.messages && this.receiveMessages(i.messages), typeof (i == null ? void 0 : i.render_spec) == "string" && (this.renderSpec = i.render_spec);
|
|
9420
9420
|
} catch (e) {
|
|
9421
9421
|
console.error(`[pont] <${this.localName}>: starting the flow failed:`, e), this.started = !1, this.renderSpec = "<pont-block></pont-block>";
|
|
9422
|
-
const { message: i,
|
|
9422
|
+
const { message: i, final: n } = vh(e, this.messages);
|
|
9423
9423
|
this.startError = { message: i, restartable: !n };
|
|
9424
9424
|
} finally {
|
|
9425
9425
|
this.starting = !1;
|
|
@@ -12971,10 +12971,12 @@ function Km(s, t, e) {
|
|
|
12971
12971
|
return r === "invalid_scope" ? e && !Kn.some((a) => e.includes(a)) ? {
|
|
12972
12972
|
message: c("billing_app_unavailable"),
|
|
12973
12973
|
retry: !1,
|
|
12974
|
+
final: !0,
|
|
12974
12975
|
hint: `${n} this app can't manage billing: it does not request the billing scopes. To enable the element, ${Ep}`
|
|
12975
12976
|
} : {
|
|
12976
12977
|
message: c("billing_app_unavailable"),
|
|
12977
12978
|
retry: !1,
|
|
12979
|
+
final: !0,
|
|
12978
12980
|
hint: `${n} the management token holds no billing scope. The app may not allow ${Kn.join(" or ")}, or the session was signed in before they were requested. ${Ep}`
|
|
12979
12981
|
} : r === "invalid_target" || r === "INVALID_REQUEST" || s instanceof Q && s.code === "INVALID_REQUEST" ? {
|
|
12980
12982
|
message: c("billing_app_unavailable"),
|
|
@@ -13465,7 +13467,7 @@ const Tp = "pont_checkout_session", el = ["country", "line1", "line2", "city", "
|
|
|
13465
13467
|
i = void 0;
|
|
13466
13468
|
}
|
|
13467
13469
|
const n = Km(t, "pont-checkout", i);
|
|
13468
|
-
n.hint && console.warn(n.hint), this.problem = { ...n, restart: e && !this.session }, this.phase = "problem";
|
|
13470
|
+
n.hint && console.warn(n.hint), this.problem = { ...n, restart: e && !this.session && !n.final }, this.phase = "problem";
|
|
13469
13471
|
}
|
|
13470
13472
|
async load(t = !1) {
|
|
13471
13473
|
const e = ++this.loadSeq;
|