@atlasauth/embed 0.3.0 → 0.5.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/CHANGELOG.md +26 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.js +1 -0
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +2 -0
- package/dist/config.js +6 -0
- package/dist/config.js.map +1 -1
- package/dist/embed.js +2 -2
- package/dist/widget/flow.d.ts +2 -1
- package/dist/widget/flow.js +61 -5
- package/dist/widget/flow.js.map +1 -1
- package/dist/widget/forms.d.ts +3 -3
- package/dist/widget/forms.js +8 -15
- package/dist/widget/forms.js.map +1 -1
- package/dist/widget/social.js +1 -1
- package/dist/widget/social.js.map +1 -1
- package/dist/widget.d.ts +15 -1
- package/dist/widget.js +5 -0
- package/dist/widget.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @atlasauth/embed changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
Requires `@atlasauth/js` 0.9.0.
|
|
5
|
+
- **Server errors render in the app's language.** New `WidgetOptions.localization?: ErrorStrings` (a bundle from
|
|
6
|
+
`@atlasauth/localizations`, e.g. `esES`, or a flat `{ 'error.<reason>': '…' }` catalog): form and field errors
|
|
7
|
+
show the `error.<reason>` string for the error's `reason`, else the server's message.
|
|
8
|
+
- **New `WidgetOptions.locale?: string`** (markup: `data-atlas-locale` / `locale` on the element, or
|
|
9
|
+
`data-atlas-locale` on the script tag), sent as `Accept-Language` so the server localises `message`; defaults
|
|
10
|
+
to the `localization` bundle's `locale` tag. `WidgetClientOptions.locale` and `ScriptDefaults.locale` added.
|
|
11
|
+
- `AtlasWidget.errorText(error)` added.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 0.4.0
|
|
15
|
+
- **Completes a severed sign-in popup.** When the widget's page is the landing of a sign-in popup started by
|
|
16
|
+
an Atlas SDK on the same site whose `window.opener` was cut by a Cross-Origin-Opener-Policy
|
|
17
|
+
(`#atlas_popup_result=…` in the URL), the widget now calls `completeOAuthPopupLanding()` on mount: the
|
|
18
|
+
result is relayed to the opener (which redeems the ticket) and the popup closes; when no opener takes it,
|
|
19
|
+
the widget redeems the ticket itself like a redirect result (or follows the payload's `continuationUrl`).
|
|
20
|
+
This runs once per page however many widgets mount, and the fragment is scrubbed.
|
|
21
|
+
- **Hands back to the opener after a sign-in inside the popup.** After the widget redeems a redirect ticket in
|
|
22
|
+
a window named `atlas:oauth`, it calls `closeOAuthPopupAfterSignIn()`; when the opener acknowledges (or is
|
|
23
|
+
still open) the popup closes instead of navigating. Ordinary tabs are unaffected.
|
|
24
|
+
- **Changed** `exchange()` (widget flow module) resolves `boolean` — whether the ticket exchange set a session
|
|
25
|
+
(`false` in preview mode) — instead of `void`.
|
|
26
|
+
- **Changed** `EMAIL_UNAVAILABLE_MESSAGE` is now re-exported from `@atlasauth/js` (same text, same export).
|
|
27
|
+
- Requires `@atlasauth/js` 0.8.0.
|
|
28
|
+
|
|
3
29
|
## 0.3.0
|
|
4
30
|
- **The keyboard focus ring has at least 3:1 contrast.** The widget now sets
|
|
5
31
|
`--atlas-embed-color-focus-ring` to the primary when it clears 3:1 against the card and the page
|
package/dist/client.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export interface WidgetClientOptions {
|
|
|
5
5
|
/** The instance's FAPI origin, e.g. `https://accounts.acme.com`. */
|
|
6
6
|
frontendApi: string;
|
|
7
7
|
fetchImpl?: typeof fetch;
|
|
8
|
+
/** Sent as `Accept-Language` (see `FapiClientOptions.locale`). */
|
|
9
|
+
locale?: string;
|
|
8
10
|
}
|
|
9
11
|
/** A FAPI client wired for the widget: shared @atlasauth/js driver, pk in the query. */
|
|
10
12
|
export declare function createClient(options: WidgetClientOptions): FapiClient;
|
package/dist/client.js
CHANGED
|
@@ -39,6 +39,7 @@ function createClient(options) {
|
|
|
39
39
|
publishableKey: options.publishableKey,
|
|
40
40
|
baseUrl: options.frontendApi.replace(/\/$/, ''),
|
|
41
41
|
fetchImpl: widgetFetch(options.publishableKey, base),
|
|
42
|
+
locale: options.locale,
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
45
|
/** Fetch the tenant's public appearance + enabled providers/strategies. */
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;AA0CA,oCAQC;AAGD,0CAGC;AAxDD,sCAA2C;AAG3C;;;;;;;;;;;;GAYG;AACH,SAAS,WAAW,CAAC,cAAsB,EAAE,IAAkB;IAC7D,OAAO,CAAC,CAAC,KAAwB,EAAE,IAAkB,EAAE,EAAE;QACvD,MAAM,IAAI,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QAClE,IAAI,GAAQ,CAAC;QACb,IAAI,CAAC;YACH,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC3B,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE,CAAC;YAC7C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;QAC1D,CAAC;QACD,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC,CAAiB,CAAC;AACrB,CAAC;AAWD,wFAAwF;AACxF,SAAgB,YAAY,CAAC,OAA4B;IACvD,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,IAAI,KAAK,CAAC;IACxC,OAAO,IAAI,eAAU,CAAC;QACpB,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;QAC/C,SAAS,EAAE,WAAW,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC;QACpD,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;AACL,CAAC;AAED,2EAA2E;AACpE,KAAK,UAAU,eAAe,CAAC,MAAkB;IACtD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAqB,gBAAgB,CAAC,CAAC;IACxE,OAAO,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5C,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export interface ScriptDefaults {
|
|
|
12
12
|
publishableKey?: string;
|
|
13
13
|
frontendApi?: string;
|
|
14
14
|
redirect?: string;
|
|
15
|
+
/** `data-atlas-locale`: the UI language sent as `Accept-Language`. */
|
|
16
|
+
locale?: string;
|
|
15
17
|
}
|
|
16
18
|
export declare function setScriptDefaults(defaults: ScriptDefaults): void;
|
|
17
19
|
export declare function getScriptDefaults(): ScriptDefaults;
|
package/dist/config.js
CHANGED
|
@@ -24,6 +24,8 @@ function readScriptTag(script) {
|
|
|
24
24
|
out.frontendApi = d.atlasFapi;
|
|
25
25
|
if (d.atlasRedirect)
|
|
26
26
|
out.redirect = d.atlasRedirect;
|
|
27
|
+
if (d.atlasLocale)
|
|
28
|
+
out.locale = d.atlasLocale;
|
|
27
29
|
return out;
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
@@ -42,6 +44,9 @@ function optionsFromElement(el, mode) {
|
|
|
42
44
|
const options = { publishableKey, frontendApi, mode };
|
|
43
45
|
if (redirect)
|
|
44
46
|
options.redirect = redirect;
|
|
47
|
+
const locale = dataset.atlasLocale ?? attr('locale') ?? scriptDefaults.locale;
|
|
48
|
+
if (locale)
|
|
49
|
+
options.locale = locale;
|
|
45
50
|
// `data-atlas-preset="midnight"` — a design preset straight from markup. Any
|
|
46
51
|
// value is passed through; the design system ignores (and warns on) unknown ids.
|
|
47
52
|
const preset = dataset.atlasPreset ?? attr('preset');
|
|
@@ -60,6 +65,7 @@ function optionsFromApi(mode, overrides = {}) {
|
|
|
60
65
|
publishableKey,
|
|
61
66
|
frontendApi,
|
|
62
67
|
redirect: overrides.redirect ?? scriptDefaults.redirect,
|
|
68
|
+
...(overrides.locale ?? scriptDefaults.locale ? { locale: overrides.locale ?? scriptDefaults.locale } : {}),
|
|
63
69
|
mode,
|
|
64
70
|
};
|
|
65
71
|
}
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;AAqBA,8CAEC;AAED,8CAEC;AAGD,sCASC;AAOD,gDAsBC;AAGD,wCAgBC;AApED,IAAI,cAAc,GAAmB,EAAE,CAAC;AAExC,SAAgB,iBAAiB,CAAC,QAAwB;IACxD,cAAc,GAAG,QAAQ,CAAC;AAC5B,CAAC;AAED,SAAgB,iBAAiB;IAC/B,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,qEAAqE;AACrE,SAAgB,aAAa,CAAC,MAA4C;IACxE,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IACvB,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC;IACzB,MAAM,GAAG,GAAmB,EAAE,CAAC;IAC/B,IAAI,CAAC,CAAC,QAAQ;QAAE,GAAG,CAAC,cAAc,GAAG,CAAC,CAAC,QAAQ,CAAC;IAChD,IAAI,CAAC,CAAC,SAAS;QAAE,GAAG,CAAC,WAAW,GAAG,CAAC,CAAC,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