@owlmeans/web-panel 0.1.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/LICENSE +21 -0
- package/README.md +1195 -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 +17 -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 +40 -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 +12 -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 +89 -0
- package/src/auth/context.ts +25 -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 +21 -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/tsconfig.json +16 -0
- package/tsconfig.tsbuildinfo +1 -0
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;AAGlD,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAG,CAa5E,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,SAAS,cAAa,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,uBAAqB,CAC7E,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
export const makeContext = (cfg) => {
|
|
7
|
+
const context = makeClientContext(cfg);
|
|
8
|
+
extractPrimaryHost(context);
|
|
9
|
+
appendWebDbService(context);
|
|
10
|
+
context.registerMiddleware(apiConfigMiddleware);
|
|
11
|
+
appendFlowService(context);
|
|
12
|
+
context.flow = () => context.service('flow');
|
|
13
|
+
context.makeContext = makeContext;
|
|
14
|
+
return context;
|
|
15
|
+
};
|
|
16
|
+
export const useContext = () => useCtx();
|
|
17
|
+
//# 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;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,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,GAA+E,EAAE,CACzG,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, ModuleOutcome, clone } from '@owlmeans/module';
|
|
6
|
+
export type { AbstractRequest } from '@owlmeans/module';
|
|
7
|
+
export { addWebService } from '@owlmeans/client-config';
|
|
8
|
+
export { module, elevate, provideRequest, stab } from '@owlmeans/client-module';
|
|
9
|
+
export type { ClientModule as Module, ClientRequest as Request } from '@owlmeans/client-module';
|
|
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,kBAAkB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAC/E,YAAY,EAAE,YAAY,IAAI,MAAM,EAAE,aAAa,IAAI,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAC/F,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC9D,YAAY,EAAE,oBAAoB,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC3E,OAAO,EAAE,aAAa,IAAI,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEpE,cAAc,6BAA6B,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAC/D,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACnE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,aAAa,EAAE,MAAM,oBAAoB,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, ModuleOutcome, clone } from '@owlmeans/module';
|
|
5
|
+
export { addWebService } from '@owlmeans/client-config';
|
|
6
|
+
export { module, elevate, provideRequest, stab } from '@owlmeans/client-module';
|
|
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,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAE/E,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAE9D,OAAO,EAAE,aAAa,IAAI,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEpE,cAAc,6BAA6B,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAG/D,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEnE,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAC7E,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AACA,mBAAmB,YAAY,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +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,2CAAuB,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,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AACnC,OAAO,cAAc,MAAM,8BAA8B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,MAAM,CAAC,MA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AAC;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;A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;IAClD,CAAC;IACD,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;IAErF,IAAI,SAAS,CAAC,KAAK,KAAK,EAAE,EAAE,CAAC;QAC3B,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;QAC9B,OAAM;IACR,CAAC;IACD,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,OAAO,CAAC,MAAM,CAA8B,UAAU,CAAC;SACxE,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAA;IAE7B,OAAO,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,GAAG,mBAAmB,CAAC,aAAa,CAAC,CAAA;IAErE,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":"tunnel-consumer.d.ts","sourceRoot":"","sources":["../../../src/auth/plugins/tunnel-consumer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAA;AAgBzF,eAAO,MAAM,sBAAsB,EAAE,4BA6CpC,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
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: () =>
|
|
35
|
+
// @TODO document reload looks a bit dirty - cause we can loose the flow
|
|
36
|
+
_jsx(Button, { label: "reset", onClick: async () => { document.location.reload(); } }), children: _jsx(Status, { error: control.error, ok: false }) });
|
|
37
|
+
}
|
|
38
|
+
return _jsx(LinearProgress, { sx: loadingStyle });
|
|
39
|
+
};
|
|
40
|
+
//# 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,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,GAAG,MAAM,mBAAmB,CAAA;AAEnC,MAAM,CAAC,MAAM,sBAAsB,GAAiC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE;IAC/G,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE;QACxB,IAAI,OAAO,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;YAC9B,O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AK,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;gBACrE,wEAAwE;gBACxE,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/useTheme.js';
|
|
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,QAAQ,MAAM,kCAAkC,CAAA;AACvD,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":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/components/form/button/component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAUvD,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CAuBjC,CAAA;AAEF,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,WAAW,CAcvC,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import MUIButton from '@mui/material/Button';
|
|
5
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
|
6
|
+
import { useFormContext } from 'react-hook-form';
|
|
7
|
+
import { useCommonI18n, useI18nApp, useI18nLib } from '@owlmeans/client-i18n';
|
|
8
|
+
import { useContext } from '@owlmeans/client';
|
|
9
|
+
import { useFormI18n, usePanelHelper } from '@owlmeans/client-panel';
|
|
10
|
+
export const Button = memo(({ label, onClick, i18n, loader, size, fullWidth, variant = 'contained' }) => {
|
|
11
|
+
const context = useContext();
|
|
12
|
+
const panel = usePanelHelper();
|
|
13
|
+
const t = useCommonI18n(i18n?.resource ?? panel.resource ?? context.cfg.service, i18n?.ns ?? panel.ns, i18n?.prefix ?? panel.prefix);
|
|
14
|
+
const appT = useI18nApp(context.cfg.service, 'buttons');
|
|
15
|
+
const libT = useI18nLib('client-panel', 'buttons');
|
|
16
|
+
label = useMemo(() => i18n?.suppress ? label : t(label, {
|
|
17
|
+
defaultValue: appT(label, { defaultValue: libT(label) })
|
|
18
|
+
}), [i18n?.suppress, label]);
|
|
19
|
+
size = size ?? 'medium';
|
|
20
|
+
const progressSize = size === 'large'
|
|
21
|
+
? 20
|
|
22
|
+
: size === 'medium' ? 16 : 14;
|
|
23
|
+
return _jsx(MUIButton, { variant: variant, size: size, fullWidth: fullWidth, startIcon: loader != null && loader.opened === true ? _jsx(CircularProgress, { size: progressSize }) : undefined, disabled: loader != null && loader.opened === true, onClick: onClick, children: label });
|
|
24
|
+
});
|
|
25
|
+
export const SubmitButton = memo((props) => {
|
|
26
|
+
let { i18n, label } = props;
|
|
27
|
+
const { handleSubmit } = useFormContext();
|
|
28
|
+
const t = useFormI18n();
|
|
29
|
+
label = label ?? 'submit';
|
|
30
|
+
const _i18n = { ...i18n };
|
|
31
|
+
_i18n.suppress = true;
|
|
32
|
+
return _jsx(Button, { ...props, label: t(label), i18n: _i18n, onClick: handleSubmit(props.onSubmit ?? props.onClick ?? (() => { console.info('Empty submit'); }), problem => console.error('Failed to submit form with error: ', problem)) });
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/components/form/button/component.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAG5B,OAAO,SAAS,MAAM,sBAAsB,CAAA;AAC5C,OAAO,gBAAgB,MAAM,gCAAgC,CAAA;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAa,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEpE,MAAM,CAAC,MAAM,MAAM,GAAoB,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,GAAG,WAAW,EAAE,EAAE,EAAE;IACvH,MAAM,OAAO,GAAG,UAAU,EAAE,CAAA;IAC5B,MAAM,KAAK,GAAG,cAAc,EAAE,CAAA;IAC9B,MAAM,CAAC,GAAG,aAAa,CACrB,IAAI,EAAE,QAAQ,IAAI,KAAK,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,EACvD,IAAI,EAAE,EAAE,IAAI,KAAK,CAAC,EAAE,EACpB,IAA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GAAG,KAAK,CAAA;IAC3B,MAAM,EAAE,YAAY,EAAE,GAAG,cAAc,EAAE,CAAA;IACzC,MAAM,CAAC,GAAG,WAAW,EAAE,CAAA;IAEvB,KAAK,GAAG,KAAK,IAAI,QAAQ,CAAA;IACzB,MAAM,KAAK,GAAsB,EAAE,GAAG,IAAI,EAAE,CAAA;IAC5C,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAA;IAErB,OAAO,KAAC,MAAM,OAAK,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,KAAK,EACpD,OAAO,EAAE,YAAY,CACnB,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA,CAAC,CAAC,CAAC,EAC3E,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,OAAO,CAAC,CACxE,GAAI,CAAA;AACT,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/button/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/form/button/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Toggleable } from '@owlmeans/client';
|
|
2
|
+
import type { I18nProps } from '@owlmeans/client-i18n';
|
|
3
|
+
export interface ButtonProps extends I18nProps {
|
|
4
|
+
size?: 'small' | 'medium' | 'large';
|
|
5
|
+
fullWidth?: boolean;
|
|
6
|
+
variant?: string;
|
|
7
|
+
label: string;
|
|
8
|
+
loader?: Toggleable;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export interface SubmitProps extends Omit<ButtonProps, "label"> {
|
|
12
|
+
label?: string;
|
|
13
|
+
onSubmit?: (data: any) => Promise<void> | void;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/form/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEtD,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;CAC/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/form/button/types.ts"],"names":[],"mappings":""}
|