@atlasauth/angular 0.1.3 → 0.2.1
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 +8 -8
- package/dist/README.md +11 -11
- package/dist/esm2022/lib/appearance.mjs +36 -1
- package/dist/esm2022/lib/atlas.service.mjs +36 -5
- package/dist/esm2022/lib/directives/atlas-root.directive.mjs +21 -8
- package/dist/fesm2022/atlasauth-angular.mjs +89 -12
- package/dist/fesm2022/atlasauth-angular.mjs.map +1 -1
- package/dist/lib/appearance.d.ts +27 -2
- package/dist/lib/atlas.service.d.ts +16 -3
- package/dist/lib/directives/atlas-root.directive.d.ts +6 -0
- package/package.json +3 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { OnDestroy, Signal } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { FapiClient, type ProviderToken } from '@atlasauth/js';
|
|
3
|
+
import { FapiClient, type ProviderToken, type SignOutOptions } from '@atlasauth/js';
|
|
4
4
|
import { type ProtectCondition } from '@atlasauth/authz';
|
|
5
|
-
import { type Appearance } from './appearance';
|
|
5
|
+
import { type Appearance, type AppearanceRender, type InstanceDesign } from './appearance';
|
|
6
6
|
import { type Catalog } from './i18n';
|
|
7
7
|
import type { AtlasOrganizationMembership, AtlasSession, AtlasUser, AuthStatus, SessionClaims } from './types';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
@@ -80,6 +80,19 @@ export declare class AtlasService implements OnDestroy {
|
|
|
80
80
|
get frontendApi(): string;
|
|
81
81
|
/** Tokens as CSS custom properties, for a host element to inherit. */
|
|
82
82
|
appearanceVariables(): Record<string, string>;
|
|
83
|
+
/**
|
|
84
|
+
* The full appearance render for a root element: inline variables, the
|
|
85
|
+
* `data-atlas-*` attributes and the design stylesheet. Pass the dashboard
|
|
86
|
+
* design (from {@link loadInstanceDesign}) to layer code overrides on it —
|
|
87
|
+
* the same semantics as `@atlasauth/react`.
|
|
88
|
+
*/
|
|
89
|
+
appearanceRender(instanceDesign?: InstanceDesign | null): AppearanceRender;
|
|
90
|
+
/**
|
|
91
|
+
* The design configured in the Atlas dashboard (`GET /v1/appearance`), or null
|
|
92
|
+
* when there is none, it cannot be read, or the app opted out with
|
|
93
|
+
* `appearance.instanceDesign: false`.
|
|
94
|
+
*/
|
|
95
|
+
loadInstanceDesign(): Promise<InstanceDesign | null>;
|
|
83
96
|
/** A fresh {@link FapiClient} for driving a sign-in/sign-up flow. */
|
|
84
97
|
createFapiClient(): FapiClient;
|
|
85
98
|
/**
|
|
@@ -98,7 +111,7 @@ export declare class AtlasService implements OnDestroy {
|
|
|
98
111
|
/** Imperative `has()` — the same evaluation `*atlasProtect` renders on. */
|
|
99
112
|
has(condition: ProtectCondition): boolean;
|
|
100
113
|
/** Revoke the current session server-side and drop all local auth state. */
|
|
101
|
-
signOut(): Promise<void>;
|
|
114
|
+
signOut(options?: SignOutOptions): Promise<void>;
|
|
102
115
|
/**
|
|
103
116
|
* Switch the active organization (or `null` for the personal account). The
|
|
104
117
|
* new token carries the new org claims, so the app's permission checks update
|
|
@@ -15,11 +15,17 @@ import * as i0 from "@angular/core";
|
|
|
15
15
|
* <router-outlet></router-outlet>
|
|
16
16
|
* </div>
|
|
17
17
|
* ```
|
|
18
|
+
*
|
|
19
|
+
* With a design (a code-level `appearance.preset` / `appearance.design`, or
|
|
20
|
+
* the dashboard design, fetched in the browser) the host also gets the stable
|
|
21
|
+
* `data-atlas-*` attributes and the design stylesheet is added to `<head>` once.
|
|
18
22
|
*/
|
|
19
23
|
export declare class AtlasRootDirective implements OnInit {
|
|
20
24
|
private readonly atlas;
|
|
21
25
|
private readonly el;
|
|
22
26
|
private readonly renderer;
|
|
27
|
+
private readonly document;
|
|
28
|
+
private readonly platformId;
|
|
23
29
|
ngOnInit(): void;
|
|
24
30
|
static ɵfac: i0.ɵɵFactoryDeclaration<AtlasRootDirective, never>;
|
|
25
31
|
static ɵdir: i0.ɵɵDirectiveDeclaration<AtlasRootDirective, "[atlasRoot]", never, {}, {}, never, never, true, never>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/angular",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Official Angular SDK for Atlas — the Angular peer of @atlasauth/react.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "./dist/fesm2022/atlas-angular.mjs",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"sideEffects": false,
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"tslib": "^2.6.3",
|
|
22
|
-
"@atlasauth/
|
|
22
|
+
"@atlasauth/design": "0.1.0",
|
|
23
|
+
"@atlasauth/js": "0.5.0",
|
|
23
24
|
"@atlasauth/authz": "0.1.1"
|
|
24
25
|
},
|
|
25
26
|
"peerDependencies": {
|