@owlmeans/mui-panel 0.1.3
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/LICENSE +21 -0
- package/README.md +96 -0
- package/build/.gitkeep +0 -0
- package/build/auth/context.d.ts +5 -0
- package/build/auth/context.d.ts.map +1 -0
- package/build/auth/context.js +19 -0
- package/build/auth/context.js.map +1 -0
- package/build/auth/exports.d.ts +25 -0
- package/build/auth/exports.d.ts.map +1 -0
- package/build/auth/exports.js +19 -0
- package/build/auth/exports.js.map +1 -0
- package/build/auth/index.d.ts +5 -0
- package/build/auth/index.d.ts.map +1 -0
- package/build/auth/index.js +4 -0
- package/build/auth/index.js.map +1 -0
- package/build/auth/modules.d.ts +2 -0
- package/build/auth/modules.d.ts.map +1 -0
- package/build/auth/modules.js +4 -0
- package/build/auth/modules.js.map +1 -0
- package/build/auth/plugins/basic-ed25519.d.ts +3 -0
- package/build/auth/plugins/basic-ed25519.d.ts.map +1 -0
- package/build/auth/plugins/basic-ed25519.js +40 -0
- package/build/auth/plugins/basic-ed25519.js.map +1 -0
- package/build/auth/plugins/exports.d.ts +4 -0
- package/build/auth/plugins/exports.d.ts.map +1 -0
- package/build/auth/plugins/exports.js +4 -0
- package/build/auth/plugins/exports.js.map +1 -0
- package/build/auth/plugins/index.d.ts +6 -0
- package/build/auth/plugins/index.d.ts.map +1 -0
- package/build/auth/plugins/index.js +10 -0
- package/build/auth/plugins/index.js.map +1 -0
- package/build/auth/plugins/re-captcha.d.ts +3 -0
- package/build/auth/plugins/re-captcha.d.ts.map +1 -0
- package/build/auth/plugins/re-captcha.js +51 -0
- package/build/auth/plugins/re-captcha.js.map +1 -0
- package/build/auth/plugins/tunnel-consumer.d.ts +3 -0
- package/build/auth/plugins/tunnel-consumer.d.ts.map +1 -0
- package/build/auth/plugins/tunnel-consumer.js +38 -0
- package/build/auth/plugins/tunnel-consumer.js.map +1 -0
- package/build/auth/types.d.ts +10 -0
- package/build/auth/types.d.ts.map +1 -0
- package/build/auth/types.js +2 -0
- package/build/auth/types.js.map +1 -0
- package/build/components/block.d.ts +4 -0
- package/build/components/block.d.ts.map +1 -0
- package/build/components/block.js +15 -0
- package/build/components/block.js.map +1 -0
- package/build/components/button/index.d.ts +3 -0
- package/build/components/button/index.d.ts.map +1 -0
- package/build/components/button/index.js +2 -0
- package/build/components/button/index.js.map +1 -0
- package/build/components/button/selector.d.ts +4 -0
- package/build/components/button/selector.d.ts.map +1 -0
- package/build/components/button/selector.js +8 -0
- package/build/components/button/selector.js.map +1 -0
- package/build/components/button/types.d.ts +7 -0
- package/build/components/button/types.d.ts.map +1 -0
- package/build/components/button/types.js +2 -0
- package/build/components/button/types.js.map +1 -0
- package/build/components/form/button/component.d.ts +5 -0
- package/build/components/form/button/component.d.ts.map +1 -0
- package/build/components/form/button/component.js +34 -0
- package/build/components/form/button/component.js.map +1 -0
- package/build/components/form/button/index.d.ts +3 -0
- package/build/components/form/button/index.d.ts.map +1 -0
- package/build/components/form/button/index.js +3 -0
- package/build/components/form/button/index.js.map +1 -0
- package/build/components/form/button/types.d.ts +15 -0
- package/build/components/form/button/types.d.ts.map +1 -0
- package/build/components/form/button/types.js +2 -0
- package/build/components/form/button/types.js.map +1 -0
- package/build/components/form/component.d.ts +4 -0
- package/build/components/form/component.d.ts.map +1 -0
- package/build/components/form/component.js +59 -0
- package/build/components/form/component.js.map +1 -0
- package/build/components/form/index.d.ts +3 -0
- package/build/components/form/index.d.ts.map +1 -0
- package/build/components/form/index.js +2 -0
- package/build/components/form/index.js.map +1 -0
- package/build/components/form/text/component.d.ts +4 -0
- package/build/components/form/text/component.d.ts.map +1 -0
- package/build/components/form/text/component.js +34 -0
- package/build/components/form/text/component.js.map +1 -0
- package/build/components/form/text/index.d.ts +3 -0
- package/build/components/form/text/index.d.ts.map +1 -0
- package/build/components/form/text/index.js +3 -0
- package/build/components/form/text/index.js.map +1 -0
- package/build/components/form/text/types.d.ts +11 -0
- package/build/components/form/text/types.d.ts.map +1 -0
- package/build/components/form/text/types.js +2 -0
- package/build/components/form/text/types.js.map +1 -0
- package/build/components/form/types.d.ts +6 -0
- package/build/components/form/types.d.ts.map +1 -0
- package/build/components/form/types.js +2 -0
- package/build/components/form/types.js.map +1 -0
- package/build/components/helper.d.ts +6 -0
- package/build/components/helper.d.ts.map +1 -0
- package/build/components/helper.js +70 -0
- package/build/components/helper.js.map +1 -0
- package/build/components/index.d.ts +14 -0
- package/build/components/index.d.ts.map +1 -0
- package/build/components/index.js +13 -0
- package/build/components/index.js.map +1 -0
- package/build/components/layout/component.d.ts +4 -0
- package/build/components/layout/component.d.ts.map +1 -0
- package/build/components/layout/component.js +6 -0
- package/build/components/layout/component.js.map +1 -0
- package/build/components/layout/index.d.ts +3 -0
- package/build/components/layout/index.d.ts.map +1 -0
- package/build/components/layout/index.js +3 -0
- package/build/components/layout/index.js.map +1 -0
- package/build/components/layout/types.d.ts +4 -0
- package/build/components/layout/types.d.ts.map +1 -0
- package/build/components/layout/types.js +2 -0
- package/build/components/layout/types.js.map +1 -0
- package/build/components/link.d.ts +4 -0
- package/build/components/link.d.ts.map +1 -0
- package/build/components/link.js +27 -0
- package/build/components/link.js.map +1 -0
- package/build/components/panel-app/component.d.ts +4 -0
- package/build/components/panel-app/component.d.ts.map +1 -0
- package/build/components/panel-app/component.js +11 -0
- package/build/components/panel-app/component.js.map +1 -0
- package/build/components/panel-app/index.d.ts +3 -0
- package/build/components/panel-app/index.d.ts.map +1 -0
- package/build/components/panel-app/index.js +3 -0
- package/build/components/panel-app/index.js.map +1 -0
- package/build/components/panel-app/types.d.ts +6 -0
- package/build/components/panel-app/types.d.ts.map +1 -0
- package/build/components/panel-app/types.js +2 -0
- package/build/components/panel-app/types.js.map +1 -0
- package/build/components/status.d.ts +4 -0
- package/build/components/status.d.ts.map +1 -0
- package/build/components/status.js +19 -0
- package/build/components/status.js.map +1 -0
- package/build/components/text.d.ts +4 -0
- package/build/components/text.d.ts.map +1 -0
- package/build/components/text.js +9 -0
- package/build/components/text.js.map +1 -0
- package/build/components/types.d.ts +32 -0
- package/build/components/types.d.ts.map +1 -0
- package/build/components/types.js +2 -0
- package/build/components/types.js.map +1 -0
- package/build/components/uploader/image.d.ts +4 -0
- package/build/components/uploader/image.d.ts.map +1 -0
- package/build/components/uploader/image.js +24 -0
- package/build/components/uploader/image.js.map +1 -0
- package/build/components/uploader/index.d.ts +2 -0
- package/build/components/uploader/index.d.ts.map +1 -0
- package/build/components/uploader/index.js +2 -0
- package/build/components/uploader/index.js.map +1 -0
- package/build/components/uploader/types.d.ts +5 -0
- package/build/components/uploader/types.d.ts.map +1 -0
- package/build/components/uploader/types.js +2 -0
- package/build/components/uploader/types.js.map +1 -0
- package/build/context.d.ts +4 -0
- package/build/context.d.ts.map +1 -0
- package/build/context.js +12 -0
- package/build/context.js.map +1 -0
- package/build/exports.d.ts +19 -0
- package/build/exports.d.ts.map +1 -0
- package/build/exports.js +17 -0
- package/build/exports.js.map +1 -0
- package/build/index.d.ts +8 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +7 -0
- package/build/index.js.map +1 -0
- package/build/main.d.ts +5 -0
- package/build/main.d.ts.map +1 -0
- package/build/main.js +14 -0
- package/build/main.js.map +1 -0
- package/build/modules.d.ts +2 -0
- package/build/modules.d.ts.map +1 -0
- package/build/modules.js +4 -0
- package/build/modules.js.map +1 -0
- package/build/types.d.ts +9 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +2 -0
- package/build/types.js.map +1 -0
- package/package.json +95 -0
- package/src/auth/context.ts +27 -0
- package/src/auth/exports.ts +29 -0
- package/src/auth/index.ts +5 -0
- package/src/auth/modules.ts +5 -0
- package/src/auth/plugins/basic-ed25519.tsx +57 -0
- package/src/auth/plugins/exports.ts +4 -0
- package/src/auth/plugins/index.ts +15 -0
- package/src/auth/plugins/re-captcha.tsx +73 -0
- package/src/auth/plugins/tunnel-consumer.tsx +65 -0
- package/src/auth/types.ts +11 -0
- package/src/components/block.tsx +27 -0
- package/src/components/button/index.ts +3 -0
- package/src/components/button/selector.tsx +16 -0
- package/src/components/button/types.ts +7 -0
- package/src/components/form/button/component.tsx +53 -0
- package/src/components/form/button/index.ts +3 -0
- package/src/components/form/button/types.ts +16 -0
- package/src/components/form/component.tsx +101 -0
- package/src/components/form/index.ts +3 -0
- package/src/components/form/text/component.tsx +45 -0
- package/src/components/form/text/index.ts +3 -0
- package/src/components/form/text/types.ts +11 -0
- package/src/components/form/types.ts +6 -0
- package/src/components/helper.ts +79 -0
- package/src/components/index.ts +17 -0
- package/src/components/layout/component.tsx +7 -0
- package/src/components/layout/index.ts +3 -0
- package/src/components/layout/types.ts +4 -0
- package/src/components/link.tsx +34 -0
- package/src/components/panel-app/component.tsx +20 -0
- package/src/components/panel-app/index.ts +3 -0
- package/src/components/panel-app/types.ts +6 -0
- package/src/components/status.tsx +23 -0
- package/src/components/text.tsx +14 -0
- package/src/components/types.ts +35 -0
- package/src/components/uploader/image.tsx +31 -0
- package/src/components/uploader/index.ts +2 -0
- package/src/components/uploader/types.ts +6 -0
- package/src/context.ts +18 -0
- package/src/exports.ts +22 -0
- package/src/index.ts +9 -0
- package/src/main.tsx +19 -0
- package/src/modules.ts +5 -0
- package/src/types.ts +11 -0
- package/tests/smoke.spec.ts +24 -0
- package/tsconfig.json +11 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OwlMeans Common — Fullstack typescript framework
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @owlmeans/mui-panel
|
|
2
|
+
|
|
3
|
+
MUI + React Router base for OwlMeans web apps — `makeContext`, panel/form components, and hand-picked re-exports for app-side modules.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
- `makeContext(cfg)` / `useContext()` — base web context with API config middleware and flow service wired in
|
|
8
|
+
- `render(context, theme?, opts?)` — entry-point renderer that wraps the app with MUI theme and i18n
|
|
9
|
+
- `modules` — base module declarations for auth panel screens
|
|
10
|
+
- Components and form primitives in `./components`
|
|
11
|
+
- Re-exports from sibling packages: `module`, `route`, `frontend`, `handler`, `elevate`, `useNavigate`, `useI18nApp`, `HOME`, `BASE`, `ROOT`, `GUEST`, `flow`, `configureFlows`, `CAUTHEN_FLOW_ENTER`, `Dispatcher`, `appendWebAuthService`, `addWebService`, etc.
|
|
12
|
+
- Inherits all `@owlmeans/client-panel` exports (`ClientForm`, `InputCtrl`, `ActionCtrl`, …)
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
bun add @owlmeans/mui-panel
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
Build the app context on top of `web-panel`:
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import {
|
|
26
|
+
useContext as useBasicContext,
|
|
27
|
+
makeContext as makeBasicContext
|
|
28
|
+
} from '@owlmeans/mui-panel'
|
|
29
|
+
import { appendOidcGuard } from '@owlmeans/mui-oidc-rp'
|
|
30
|
+
|
|
31
|
+
export const makeContext = <C extends Config, T extends Context<C>>(cfg: C): T => {
|
|
32
|
+
const context = makeBasicContext<C, T>(cfg) as T
|
|
33
|
+
appendOidcGuard<C, T>(context)
|
|
34
|
+
context.makeContext = makeContext as typeof context.makeContext
|
|
35
|
+
return context
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const useContext = useBasicContext
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Compose your modules over the base set:
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
import { modules as baseModules } from '@owlmeans/mui-panel'
|
|
45
|
+
|
|
46
|
+
export const modules = [...baseModules, ...appModules]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Use the re-exported helpers in screens:
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import { HOME, useI18nApp, useNavigate } from '@owlmeans/mui-panel'
|
|
53
|
+
|
|
54
|
+
const t = useI18nApp('manager-web')
|
|
55
|
+
const navigate = useNavigate()
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Render the app:
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { render } from '@owlmeans/mui-panel'
|
|
62
|
+
import { theme } from './theme'
|
|
63
|
+
|
|
64
|
+
render(context, theme)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## API
|
|
68
|
+
|
|
69
|
+
### `makeContext<C, T>(cfg): T`
|
|
70
|
+
|
|
71
|
+
Creates a web context: registers `apiConfigMiddleware`, the flow service, and adds `context.flow()` accessor.
|
|
72
|
+
|
|
73
|
+
### `useContext<C, T>(): T`
|
|
74
|
+
|
|
75
|
+
React hook returning the current context.
|
|
76
|
+
|
|
77
|
+
### `render<C, T>(context, theme?, opts?)`
|
|
78
|
+
|
|
79
|
+
Mounts the React tree using the configured theme and i18n detector.
|
|
80
|
+
|
|
81
|
+
### `modules`
|
|
82
|
+
|
|
83
|
+
Base module declarations for auth panel screens.
|
|
84
|
+
|
|
85
|
+
### Re-exports
|
|
86
|
+
|
|
87
|
+
Cherry-picked APIs from `@owlmeans/client`, `@owlmeans/client-context`, `@owlmeans/client-module`, `@owlmeans/client-route`, `@owlmeans/client-config`, `@owlmeans/client-auth`, `@owlmeans/client-i18n`, `@owlmeans/web-client`, `@owlmeans/web-flow`, `@owlmeans/route`, `@owlmeans/module`, `@owlmeans/auth`, `@owlmeans/i18n`, `@owlmeans/flow`, `@owlmeans/config`, `@owlmeans/context`. See `src/exports.ts` for the full list.
|
|
88
|
+
|
|
89
|
+
Plus full re-export of [`@owlmeans/client-panel`](../client-panel).
|
|
90
|
+
|
|
91
|
+
## Related Packages
|
|
92
|
+
|
|
93
|
+
- [`@owlmeans/web-client`](../web-client) — provides `render` and the underlying web context
|
|
94
|
+
- [`@owlmeans/client-panel`](../client-panel) — cross-platform form/panel primitives re-exported here
|
|
95
|
+
- [`@owlmeans/web-flow`](../web-flow) — flow service registered by `makeContext`
|
|
96
|
+
- [`@owlmeans/mui-oidc-rp`](../mui-oidc-rp) — typically chained on top of this `makeContext`
|
package/build/.gitkeep
ADDED
|
File without changes
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AppConfig as Config, AppContext as Context } from '@owlmeans/web-client';
|
|
2
|
+
import { AppConfig, AppContext } from './types.js';
|
|
3
|
+
export declare const makeContext: <C extends Config, T extends Context<C>>(cfg: C) => T;
|
|
4
|
+
export declare const useContext: <C extends AppConfig = AppConfig, T extends AppContext<C> = AppContext<C>>() => T;
|
|
5
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/auth/context.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,IAAI,MAAM,EAAE,UAAU,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACtF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAIlD,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAG,CAc5E,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,OAAK,CAC9E,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { makeClientContext } from '@owlmeans/client';
|
|
2
|
+
import { appendWebDbService } from '@owlmeans/web-db';
|
|
3
|
+
import { apiConfigMiddleware } from '@owlmeans/api-config-client';
|
|
4
|
+
import { extractPrimaryHost, useContext as useCtx } from '@owlmeans/web-client';
|
|
5
|
+
import { appendFlowService } from '@owlmeans/web-flow';
|
|
6
|
+
import { appendWebRouter } from '@owlmeans/web-router';
|
|
7
|
+
export const makeContext = (cfg) => {
|
|
8
|
+
const context = makeClientContext(cfg);
|
|
9
|
+
extractPrimaryHost(context);
|
|
10
|
+
appendWebDbService(context);
|
|
11
|
+
appendWebRouter(context);
|
|
12
|
+
context.registerMiddleware(apiConfigMiddleware);
|
|
13
|
+
appendFlowService(context);
|
|
14
|
+
context.flow = () => context.service('flow');
|
|
15
|
+
context.makeContext = makeContext;
|
|
16
|
+
return context;
|
|
17
|
+
};
|
|
18
|
+
export const useContext = () => useCtx();
|
|
19
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/auth/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,kBAAkB,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAG/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAyC,GAAM,EAAK,EAAE;IAC/E,MAAM,OAAO,GAAG,iBAAiB,CAAC,GAAG,CAAM,CAAA;IAC3C,kBAAkB,CAAO,OAAO,CAAC,CAAA;IAEjC,kBAAkB,CAAO,OAAO,CAAC,CAAA;IACjC,eAAe,CAAO,OAAO,CAAC,CAAA;IAC9B,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAE/C,iBAAiB,CAAO,OAAO,CAAC,CAAC;IAChC,OAA4C,CAAC,IAAI,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAElF,OAAO,CAAC,WAAW,GAAG,WAAyC,CAAA;IAE/D,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,GAAgF,EAAE,CAC1G,MAAM,EAAkB,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export { handler, useModule, useValue, useNavigate } from '@owlmeans/client';
|
|
2
|
+
export type { Navigator } from '@owlmeans/client';
|
|
3
|
+
export { config } from '@owlmeans/client-context';
|
|
4
|
+
export { service } from '@owlmeans/config';
|
|
5
|
+
export { guard, parent, EntrypointOutcome, clone } from '@owlmeans/entrypoint';
|
|
6
|
+
export type { AbstractRequest } from '@owlmeans/entrypoint';
|
|
7
|
+
export { addWebService } from '@owlmeans/client-config';
|
|
8
|
+
export { entrypoint, elevate, provideRequest, stab } from '@owlmeans/client-entrypoint';
|
|
9
|
+
export type { ClientEntrypoint as Module, ClientRequest as Request } from '@owlmeans/client-entrypoint';
|
|
10
|
+
export { route as croute } from '@owlmeans/client-route';
|
|
11
|
+
export { route, frontend, RouteMethod } from '@owlmeans/route';
|
|
12
|
+
export type { ResolvedServiceRoute as ServiceRoute } from '@owlmeans/route';
|
|
13
|
+
export { DEFAULT_ALIAS as DAUTH_GUARD } from '@owlmeans/client-auth';
|
|
14
|
+
export { CAUTHEN } from '@owlmeans/auth';
|
|
15
|
+
export { AppType, HOME, ROOT, BASE, GUEST } from '@owlmeans/context';
|
|
16
|
+
export * from '@owlmeans/client-panel/auth';
|
|
17
|
+
export { AuthenticationHOC } from '@owlmeans/client-auth/manager';
|
|
18
|
+
export { render } from '../main.js';
|
|
19
|
+
export { DISPATCHER, AuthenticationType } from '@owlmeans/auth';
|
|
20
|
+
export type { AuthToken } from '@owlmeans/auth';
|
|
21
|
+
export { DEFAULT_ALIAS as FLOW_ALIAS } from '@owlmeans/client-flow';
|
|
22
|
+
export type { FlowService } from '@owlmeans/web-flow';
|
|
23
|
+
export { QUERY_PARAM as FLOW_PARAM, SERVICE_PARAM } from '@owlmeans/web-flow';
|
|
24
|
+
export { flow, configureFlows } from '@owlmeans/flow';
|
|
25
|
+
//# sourceMappingURL=exports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../src/auth/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC5E,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,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CAAA;AAC7E,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { handler, useModule, useValue, useNavigate } from '@owlmeans/client';
|
|
2
|
+
export { config } from '@owlmeans/client-context';
|
|
3
|
+
export { service } from '@owlmeans/config';
|
|
4
|
+
export { guard, parent, EntrypointOutcome, clone } from '@owlmeans/entrypoint';
|
|
5
|
+
export { addWebService } from '@owlmeans/client-config';
|
|
6
|
+
export { entrypoint, elevate, provideRequest, stab } from '@owlmeans/client-entrypoint';
|
|
7
|
+
export { route as croute } from '@owlmeans/client-route';
|
|
8
|
+
export { route, frontend, RouteMethod } from '@owlmeans/route';
|
|
9
|
+
export { DEFAULT_ALIAS as DAUTH_GUARD } from '@owlmeans/client-auth';
|
|
10
|
+
export { CAUTHEN } from '@owlmeans/auth';
|
|
11
|
+
export { AppType, HOME, ROOT, BASE, GUEST } from '@owlmeans/context';
|
|
12
|
+
export * from '@owlmeans/client-panel/auth';
|
|
13
|
+
export { AuthenticationHOC } from '@owlmeans/client-auth/manager';
|
|
14
|
+
export { render } from '../main.js';
|
|
15
|
+
export { DISPATCHER, AuthenticationType } from '@owlmeans/auth';
|
|
16
|
+
export { DEFAULT_ALIAS as FLOW_ALIAS } from '@owlmeans/client-flow';
|
|
17
|
+
export { QUERY_PARAM as FLOW_PARAM, SERVICE_PARAM } from '@owlmeans/web-flow';
|
|
18
|
+
export { flow, configureFlows } from '@owlmeans/flow';
|
|
19
|
+
//# sourceMappingURL=exports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../src/auth/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE5E,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,OAAO,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1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAEA,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/auth/modules.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,mDAAuB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules.js","sourceRoot":"","sources":["../../src/auth/modules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,uCAAuC,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,6BAA6B,CAAA;AAE/D,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basic-ed25519.d.ts","sourceRoot":"","sources":["../../../src/auth/plugins/basic-ed25519.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAyB,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AAclG,eAAO,MAAM,wBAAwB,EAAE,sBAoBtC,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Ed22519BasicAuthUIPluginFormSchema as Schema } from '@owlmeans/client-panel/auth/plugins';
|
|
3
|
+
import { AuthenticationStage, DISPATCHER } from '@owlmeans/auth';
|
|
4
|
+
import { Form } from '../../components/form/index.js';
|
|
5
|
+
import { TextInput } from '../../components/form/text/index.js';
|
|
6
|
+
import { useCallback } from 'react';
|
|
7
|
+
import LinearProgress from '@mui/material/LinearProgress';
|
|
8
|
+
import { BlockScaling } from '@owlmeans/client-panel';
|
|
9
|
+
import { useContext } from '@owlmeans/web-client';
|
|
10
|
+
export const Ed22519BasicAuthUIPlugin = ({ type, stage, control }) => {
|
|
11
|
+
const context = useContext();
|
|
12
|
+
const submit = useCallback(createSubmit(context, control), [type]);
|
|
13
|
+
const Content = useCallback(() => {
|
|
14
|
+
switch (stage) {
|
|
15
|
+
case AuthenticationStage.Authenticate:
|
|
16
|
+
return ['entityId', 'address', 'privateKey'].map(name => _jsx(TextInput, { name: name, label: true }, name));
|
|
17
|
+
default:
|
|
18
|
+
return _jsx(LinearProgress, {});
|
|
19
|
+
}
|
|
20
|
+
}, [stage]);
|
|
21
|
+
return _jsx(Form, { decorate: true, name: "basic-ed25519", horizontal: BlockScaling.Wide, i18n: { ns: 'lib', resource: 'client-panel-auth' }, validation: Schema, onSubmit: submit, children: _jsx(Content, {}) });
|
|
22
|
+
};
|
|
23
|
+
const createSubmit = (context, control) => async (data) => {
|
|
24
|
+
const token = await control.authenticate({
|
|
25
|
+
entityId: data.entityId,
|
|
26
|
+
userId: data.address,
|
|
27
|
+
credential: data.privateKey
|
|
28
|
+
});
|
|
29
|
+
if (token.token === '') {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const [url] = await context.module(DISPATCHER)
|
|
33
|
+
.call({ query: token });
|
|
34
|
+
control.setStage?.(control.stage = AuthenticationStage.Authenticated);
|
|
35
|
+
// Give some time - that is really not cenessary - actually we need
|
|
36
|
+
// to do it on the layout finished its stuff.
|
|
37
|
+
// @TODO fix it for react native (we need some other solution for redirects context indepedent)
|
|
38
|
+
setTimeout(() => window.location.href = url, 100);
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=basic-ed25519.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basic-ed25519.js","sourceRoot":"","sources":["../../../src/auth/plugins/basic-ed25519.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,kCAAkC,IAAI,MAAM,EAAE,MAAM,qCAAqC,CAAA;AAClG,OAAO,EAA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G,GACN,CAAA;AACT,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,OAAmB,EAAE,OAA8B,EAAE,EAAE,CAAC,KAAK,EAAE,IAAc,EAAE,EAAE;IACrG,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC;QACvC,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,MAAM,EAAE,IAAI,CAAC,OAAO;QACpB,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAC,CAAA;IAEF,IAAI,KAAK,CAAC,KAAK,KAAK,EAAE,EAAE,CAAC;QACvB,OAAM;IACR,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,OAAO,CAAC,MAAM,CAAoC,UAAU,CAAC;SAC9E,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;IAEzB,OAAO,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,GAAG,mBAAmB,CAAC,aAAa,CAAC,CAAA;IACrE,oEAAoE;IACpE,6CAA6C;IAC7C,+FAA+F;IAC/F,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,GAAG,EAAE,GAAG,CAAC,CAAA;AACnD,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/auth/plugins/exports.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../../src/auth/plugins/exports.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ClientAuthType } from '@owlmeans/client-auth/manager';
|
|
2
|
+
import type { AuthenticationPlugin } from '@owlmeans/client-auth/manager/plugins';
|
|
3
|
+
export declare const plugins: {
|
|
4
|
+
[type: ClientAuthType]: AuthenticationPlugin;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/plugins/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA0B,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAYjF,eAAO,MAAM,OAAO,EAAE;IAAE,CAAC,IAAI,EAAE,cAAc,GAAG,oBAAoB,CAAA;CAAiB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AuthenticationType } from '@owlmeans/auth';
|
|
2
|
+
import { Ed22519BasicAuthUIPlugin } from './basic-ed25519.js';
|
|
3
|
+
import { ReCaptchaAuthUIPlugin } from './re-captcha.js';
|
|
4
|
+
import { TunnelConsumerUIPlugin } from './tunnel-consumer.js';
|
|
5
|
+
import { plugins as basicPlugins } from '@owlmeans/client-auth/manager';
|
|
6
|
+
basicPlugins[AuthenticationType.BasicEd25519].Renderer = Ed22519BasicAuthUIPlugin;
|
|
7
|
+
basicPlugins[AuthenticationType.ReCaptcha].Renderer = ReCaptchaAuthUIPlugin;
|
|
8
|
+
basicPlugins[AuthenticationType.WalletConsumer].Renderer = TunnelConsumerUIPlugin;
|
|
9
|
+
export const plugins = basicPlugins;
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/plugins/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAE7D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEvE,YAAY,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC,QAAQ,GAAG,wBAAwB,CAAA;AACjF,YAAY,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC,QAAQ,GAAG,qBAAqB,CAAA;AAC3E,YAAY,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC,QAAQ,GAAG,sBAAgD,CAAA;AAE3G,MAAM,CAAC,MAAM,OAAO,GAAqD,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"re-captcha.d.ts","sourceRoot":"","sources":["../../../src/auth/plugins/re-captcha.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyB,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AAiBlG,eAAO,MAAM,qBAAqB,EAAE,sBAkCnC,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import LinearProgress from '@mui/material/LinearProgress';
|
|
3
|
+
import { AuthenticationStage, AuthorizationError, CMOD_RECAPTCHA, DISPATCHER, GUEST_ID } from '@owlmeans/auth';
|
|
4
|
+
import { useValue } from '@owlmeans/client';
|
|
5
|
+
import { PLUGINS } from '@owlmeans/client-context';
|
|
6
|
+
import ReCAPTCHA from 'react-google-recaptcha';
|
|
7
|
+
import { useCallback, useState } from 'react';
|
|
8
|
+
import { PanelContext } from '@owlmeans/client-panel';
|
|
9
|
+
import { Text } from '../../components/text.js';
|
|
10
|
+
import Stack from '@mui/material/Stack';
|
|
11
|
+
import Box from '@mui/material/Box';
|
|
12
|
+
import { useContext } from '@owlmeans/web-client';
|
|
13
|
+
export const ReCaptchaAuthUIPlugin = ({ stage, control }) => {
|
|
14
|
+
const context = useContext();
|
|
15
|
+
const [loading, setLoading] = useState(true);
|
|
16
|
+
const config = useValue(() => context.getConfigResource(PLUGINS).get(CMOD_RECAPTCHA), []);
|
|
17
|
+
const finish = useCallback(createFinish(context, control), []);
|
|
18
|
+
const style = {
|
|
19
|
+
maxWidth: { xs: '100%', sm: '100%', md: '50%' }
|
|
20
|
+
};
|
|
21
|
+
const loadingStyle = {
|
|
22
|
+
width: { xs: '100%', sm: '100%', md: '50%' }
|
|
23
|
+
};
|
|
24
|
+
const content = () => {
|
|
25
|
+
switch (config?.value != null ? stage : null) {
|
|
26
|
+
case AuthenticationStage.Authenticate:
|
|
27
|
+
return _jsxs(Stack, { direction: "column", sx: style, justifyContent: "center", alignItems: "center", children: [_jsx(Text, { name: "guideline", center: true }), _jsx(Box, { sx: { pt: 2 }, children: _jsx(ReCAPTCHA, { sitekey: config?.value ?? '', onChange: finish, asyncScriptOnLoad: () => setLoading(false) }) })] });
|
|
28
|
+
default:
|
|
29
|
+
return _jsx(LinearProgress, { sx: loadingStyle });
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
return _jsx(PanelContext, { ns: "lib", prefix: "re-captcha", resource: "client-panel-auth", children: _jsxs(Stack, { direction: "column", justifyContent: "center", alignItems: "center", children: [content(), loading && _jsx(LinearProgress, { sx: loadingStyle })] }) });
|
|
33
|
+
};
|
|
34
|
+
const createFinish = (context, control) => async (token) => {
|
|
35
|
+
if (token == null) {
|
|
36
|
+
throw new AuthorizationError('re-captcha-token');
|
|
37
|
+
}
|
|
38
|
+
const authToken = await control.authenticate({ credential: token, userId: GUEST_ID });
|
|
39
|
+
if (authToken.token === '') {
|
|
40
|
+
console.timeLog('empty token');
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const [url] = await context.module(DISPATCHER)
|
|
44
|
+
.call({ query: authToken });
|
|
45
|
+
control.setStage?.(control.stage = AuthenticationStage.Authenticated);
|
|
46
|
+
// Give some time - that is really not cenessary - actually we need
|
|
47
|
+
// to do it on the layout finished its stuff.
|
|
48
|
+
// @TODO fix it for react native (we need some other solution for redirects context indepedent)
|
|
49
|
+
setTimeout(() => window.location.href = url, 100);
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=re-captcha.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"re-captcha.js","sourceRoot":"","sources":["../../../src/auth/plugins/re-captcha.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,MAAM,8BAA8B,CAAA;AACzD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9G,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,SAAS,MAAM,wBAAwB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAC/C,OAAO,KAAK,MAAM,qBAAqB,CAAA;AACvC,OAAO,GAAG,MAAM,mBAAmB,CAAA;AAGnC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAGjD,MAAM,CAAC,MAAM,qBAAqB,GAA2B,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;IAClF,MAAM,OAAO,GAAG,UAAU,EAAE,CAAA;IAC5B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC5C,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,cAAc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AAsB,EAAE,4BA6CpC,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import LinearProgress from '@mui/material/LinearProgress';
|
|
3
|
+
import { AuthenticationStage } from '@owlmeans/auth';
|
|
4
|
+
import { PinSchema } from '@owlmeans/client-auth/manager/plugins';
|
|
5
|
+
import { Form } from '../../components/form/component.js';
|
|
6
|
+
import { TextInput } from '../../components/form/text/component.js';
|
|
7
|
+
// import { Text } from '../../components/text.js'
|
|
8
|
+
import { useMemo } from 'react';
|
|
9
|
+
import { EnvelopeKind, makeEnvelopeModel } from '@owlmeans/basic-envelope';
|
|
10
|
+
import { Block } from '../../components/block.js';
|
|
11
|
+
import { BlockScaling } from '@owlmeans/client-panel';
|
|
12
|
+
import { Status } from '../../components/status.js';
|
|
13
|
+
import { useTheme } from '@mui/material/styles';
|
|
14
|
+
import { Button } from '../../components/form/button/component.js';
|
|
15
|
+
import { QRCodeCanvas } from 'qrcode.react';
|
|
16
|
+
import Box from '@mui/material/Box';
|
|
17
|
+
export const TunnelConsumerUIPlugin = ({ type, stage, control, params, submit }) => {
|
|
18
|
+
const rely = useMemo(() => {
|
|
19
|
+
if (control.allowance == null) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return makeEnvelopeModel(makeEnvelopeModel(control.allowance.challenge, EnvelopeKind.Wrap).message(true), EnvelopeKind.Wrap).message();
|
|
23
|
+
}, [stage]);
|
|
24
|
+
const theme = useTheme();
|
|
25
|
+
const prefix = "prefix" in params ? params.prefix : "";
|
|
26
|
+
const i18n = { ns: "lib", resource: 'client-panel-auth' };
|
|
27
|
+
const loadingStyle = {
|
|
28
|
+
width: { xs: '100%', sm: '100%', md: '50%' }
|
|
29
|
+
};
|
|
30
|
+
switch (stage) {
|
|
31
|
+
case AuthenticationStage.Authenticate:
|
|
32
|
+
return _jsxs(Form, { decorate: true, name: type, validation: PinSchema, onSubmit: submit, i18n: i18n, children: [_jsx(Box, { width: "fit-content", margin: "auto", children: rely?.token != null && _jsx(QRCodeCanvas, { size: 256, value: `${prefix}${rely?.token ?? ""}`, fgColor: theme.palette.primary.dark, bgColor: theme.palette.background.paper }) }), _jsx(TextInput, { name: "pin", label: true, hint: true })] });
|
|
33
|
+
case AuthenticationStage.Error:
|
|
34
|
+
return _jsx(Block, { horizontal: BlockScaling.Half, i18n: i18n, Actions: () => _jsx(Button, { label: "reset", onClick: async () => { document.location.reload(); } }), children: _jsx(Status, { error: control.error, ok: false }) });
|
|
35
|
+
}
|
|
36
|
+
return _jsx(LinearProgress, { sx: loadingStyle });
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=tunnel-consumer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tunnel-consumer.js","sourceRoot":"","sources":["../../../src/auth/plugins/tunnel-consumer.tsx"],"names":[],"mappings":";AAAA,OAAO,cAAc,MAAM,8BAA8B,CAAA;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAGpD,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAA;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAA;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACnE,kDAAkD;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAA;AAClE,OAAO,EAAE,YAAY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AAI,IAAI,KAAC,YAAY,IAAC,IAAI,EAAE,GAAG,EAC7C,KAAK,EAAE,GAAG,MAAM,GAAG,IAAI,EAAE,KAAK,IAAI,EAAE,EAAE,EACtC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EACnC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,GACvC,GACE,EAEN,KAAC,SAAS,IAAC,IAAI,EAAC,KAAK,EAAC,KAAK,QAAC,IAAI,SAAG,IAC9B,CAAA;QACT,KAAK,mBAAmB,CAAC,KAAK;YAC5B,OAAO,KAAC,KAAK,IAAC,UAAU,EAAE,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAErE,KAAC,MAAM,IAAC,KAAK,EAAC,OAAO,EAAC,OAAO,EAAE,KAAK,IAAI,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAA,CAAC,CAAC,GAAI,YAK7E,KAAC,MAAM,IAAC,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,EAAE,KAAK,GAAI,GACrC,CAAA;IACZ,CAAC;IAED,OAAO,KAAC,cAAc,IAAC,EAAE,EAAE,YAAY,GAAI,CAAA;AAC7C,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ClientConfig } from '@owlmeans/client-context';
|
|
2
|
+
import type { ClientContext } from '@owlmeans/client';
|
|
3
|
+
import type { WithFlowConfig } from '@owlmeans/flow';
|
|
4
|
+
import type { FlowService } from '@owlmeans/web-flow';
|
|
5
|
+
export interface AppConfig extends ClientConfig, WithFlowConfig {
|
|
6
|
+
}
|
|
7
|
+
export interface AppContext<C extends AppConfig = AppConfig> extends ClientContext<C> {
|
|
8
|
+
flow: () => FlowService;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/auth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAErD,MAAM,WAAW,SAAU,SAAQ,YAAY,EAAE,cAAc;CAC9D;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC;IACnF,IAAI,EAAE,MAAM,WAAW,CAAA;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/auth/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src/components/block.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAS5C,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CAehC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import Card from '@mui/material/Card';
|
|
4
|
+
import CardContent from '@mui/material/CardContent';
|
|
5
|
+
import { PanelContext, usePanelHelper } from '@owlmeans/client-panel';
|
|
6
|
+
import { useTheme } from '@mui/material/styles';
|
|
7
|
+
import CardActions from '@mui/material/CardActions';
|
|
8
|
+
import { scalingToStyles } from './helper.js';
|
|
9
|
+
export const Block = ({ children, horizontal, vertical, Actions, i18n, styles }) => {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
const style = useMemo(() => scalingToStyles(horizontal, vertical, theme), [horizontal]);
|
|
12
|
+
const panelProps = { ...usePanelHelper(), ...i18n };
|
|
13
|
+
return _jsx(PanelContext, { ...panelProps, children: _jsxs(Card, { sx: { ...style, ...styles }, children: [_jsx(CardContent, { children: children }), Actions != null && _jsx(CardActions, { sx: { flexDirection: "row", justifyContent: "flex-end", pr: 2, pb: 2 }, children: _jsx(Actions, {}) })] }) });
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.js","sourceRoot":"","sources":["../../src/components/block.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,IAAI,MAAM,oBAAoB,CAAA;AACrC,OAAO,WAAW,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAErE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,WAAW,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C,MAAM,CAAC,MAAM,KAAK,GAAmB,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;IACjG,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IAExB,MAAM,KAAK,GAAY,OAAO,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAA;IAEhG,MAAM,UAAU,GAAG,EAAE,GAAG,cAAc,EAAE,EAAE,GAAG,IAAI,EAAE,CAAA;IAEnD,OAAO,KAAC,YAAY,OAAK,UAAU,YACjC,MAAC,IAAI,IAAC,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,EAAa,aAC1C,KAAC,WAAW,cAAE,QAAQ,GAAe,EACpC,OAAO,IAAI,IAAI,IAAI,KAAC,WAAW,IAAC,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,YACrG,KAAC,OAAO,KAAG,GACC,IACT,GACM,CAAA;AACjB,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/button/index.ts"],"names":[],"mappings":"AACA,cAAc,eAAe,CAAA;AAC7B,mBAAmB,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/button/index.ts"],"names":[],"mappings":"AACA,cAAc,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector.d.ts","sourceRoot":"","sources":["../../../src/components/button/selector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG/C,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,aAAa,CAS5C,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import ButtonGroup from '@mui/material/ButtonGroup';
|
|
3
|
+
import { Button } from '../form/button/component.js';
|
|
4
|
+
export const ButtonSelector = ({ name, options, current, onSelect }) => {
|
|
5
|
+
const prefix = name != null ? `${name}.` : '';
|
|
6
|
+
return _jsx(ButtonGroup, { children: options.map(option => _jsx(Button, { label: `${prefix}${option}`, onClick: () => onSelect?.(option), variant: current === option ? 'contained' : 'outlined' }, option)) });
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector.js","sourceRoot":"","sources":["../../../src/components/button/selector.tsx"],"names":[],"mappings":";AACA,OAAO,WAAW,MAAM,2BAA2B,CAAA;AAGnD,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAA;AAEpD,MAAM,CAAC,MAAM,cAAc,GAAsB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;IACxF,MAAM,MAAM,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;IAC7C,OAAO,KAAC,WAAW,cAChB,OAAO,CAAC,GAAG,CACV,MAAM,CAAC,EAAE,CAAC,KAAC,MAAM,IAAc,KAAK,EAAE,GAAG,MAAM,GAAG,MAAM,EAAE,EACxD,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,EACjC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,IAFjC,MAAM,CAE+B,CAC7D,GACW,CAAA;AAChB,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/button/types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,GAAG;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,CAAC,CAAA;IACV,OAAO,EAAE,CAAC,EAAE,CAAA;IACZ,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAA;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/button/types.ts"],"names":[],"mappings":""}
|