@owlmeans/web-client 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { DispatcherHOC } from '@owlmeans/client-auth';
3
3
  import { useEffect } from 'react';
4
- import { useSearchParams } from 'react-router-dom';
4
+ import { useSearchParams } from 'react-router';
5
5
  import { useI18nLib } from '@owlmeans/client-i18n';
6
6
  import { AUTH_QUERY } from '@owlmeans/auth';
7
7
  import { useContext } from '../../context.js';
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/components/dispatcher/component.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;IAC3D,MAAM,CAAC,KAAK,CAAC,GAAG,eAAe,EAAE,CAAA;IACjC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAA;IAE5B,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IAE1C,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;QACnC,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAClB,MAAM,MAAM,GAA2B,EAAE,CAAA;YACzC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK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AAsC;YACrD,OAAO,EAAE,MAAM,EAAE,yBAAyB;YAC1C,cAAc,EAAE,QAAQ,EAAE,+BAA+B;YACzD,UAAU,EAAE,QAAQ,EAAE,yCAAyC;YAC/D,SAAS,EAAE,QAAQ,EAAE,8BAA8B;YACnD,UAAU,EAAE,MAAM,EAAE,6BAA6B;YACjD,aAAa,EAAE,MAAM,EAAE,6BAA6B;SACrD,YAAG,CAAC,CAAC,SAAS,CAAC,GAAO,CAAC,CAAC,CAAC,SAAS,CAAA;AACrC,CAAC,CAAC,CAAA"}
@@ -1,3 +1,4 @@
1
1
  export * from './dispatcher/index.js';
2
2
  export * from './uploader/index.js';
3
+ export * from './web-app/index.js';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA"}
@@ -1,3 +1,4 @@
1
1
  export * from './dispatcher/index.js';
2
2
  export * from './uploader/index.js';
3
+ export * from './web-app/index.js';
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { AppProps } from "@owlmeans/client";
2
+ import type { FC } from "react";
3
+ export declare const WebApp: FC<AppProps>;
4
+ //# sourceMappingURL=component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/web-app/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAGhD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE/B,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,QAAQ,CAM/B,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { I18nContext } from "@owlmeans/client-i18n";
3
+ import { App } from '@owlmeans/client';
4
+ export const WebApp = ({ context, provide, children }) => {
5
+ return _jsx(I18nContext, { config: context.cfg, children: _jsx(App, { context: context, provide: provide, children: children }) });
6
+ };
7
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/components/web-app/component.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAGtC,MAAM,CAAC,MAAM,MAAM,GAAiB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;IACrE,OAAO,KAAC,WAAW,IAAC,MAAM,EAAE,OAAO,CAAC,GAAG,YACrC,KAAC,GAAG,IAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,YACpC,QAAQ,GACL,GACM,CAAA;AAChB,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './component.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/web-app/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './component.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/web-app/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAQlD,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,SAAS,cAAc,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,uBAC7E,CAAC,KACL,CAWF,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,SAAS,cAAa,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,wBACnE,CAAA"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AASlD,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,EAClG,KAAK,CAAC,KACL,CAYF,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,SAAS,GAAG,SAAS,EAAC,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,QACnF,CAAA"}
package/build/context.js CHANGED
@@ -5,12 +5,14 @@ import { appendClientResource } from '@owlmeans/client-resource';
5
5
  import { useContext as useCtx } from '@owlmeans/client';
6
6
  import { extractPrimaryHost } from './helper.js';
7
7
  import { appendWebAuthService } from './service.js';
8
+ import { appendWebRouter } from '@owlmeans/web-router';
8
9
  export const makeContext = (cfg) => {
9
10
  const context = makeClientContext(cfg);
10
11
  extractPrimaryHost(context);
11
12
  appendWebAuthService(context);
12
13
  appendWebDbService(context);
13
14
  appendClientResource(context, AUTH_RESOURCE);
15
+ appendWebRouter(context);
14
16
  context.makeContext = makeContext;
15
17
  return context;
16
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAEnD,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,GAAM,EACH,EAAE;IACL,MAAM,OAAO,GAAG,iBAAiB,CAAC,GAAG,CAAM,CAAA;IAC3C,kBAAkB,CAAO,OAAO,CAAC,CAAA;IAEjC,oBAAoB,CAAO,OAAO,CAAC,CAAA;IACnC,kBAAkB,CAAO,OAAO,CAAC,CAAA;IACjC,oBAAoB,CAAO,OAAO,EAAE,aAAa,CAAC,CAAA;IAElD,OAAO,CAAC,WAAW,GAAG,WAAyC,CAAA;IAE/D,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,GAA4E,EAAE,CACtG,MAAM,EAAO,CAAA"}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,GAAM,EACH,EAAE;IACL,MAAM,OAAO,GAAG,iBAAiB,CAAC,GAAG,CAAM,CAAA;IAC3C,kBAAkB,CAAO,OAAO,CAAC,CAAA;IAEjC,oBAAoB,CAAO,OAAO,CAAC,CAAA;IACnC,kBAAkB,CAAO,OAAO,CAAC,CAAA;IACjC,oBAAoB,CAAO,OAAO,EAAE,aAAa,CAAC,CAAA;IAClD,eAAe,CAAO,OAAO,CAAC,CAAA;IAE9B,OAAO,CAAC,WAAW,GAAG,WAAyC,CAAA;IAE/D,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,GAA4E,EAAE,CACtG,MAAM,EAAO,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvD,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,SAAS,cAAc,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,2BAA2B,CAAC,SAKtH,CAAA"}
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvD,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,SAKtH,CAAA"}
package/build/main.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { RenderOptions } from './types.js';
2
+ import type { AppConfig, AppContext, RenderOptions } from './types.js';
3
3
  export declare const render: (node: ReactNode, opts?: RenderOptions) => void;
4
+ export declare const renderApp: <C extends AppConfig, T extends AppContext<C>>(context: T, opts?: RenderOptions) => void;
4
5
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,eAAO,MAAM,MAAM,SAAU,SAAS,SAAS,aAAa,SAkB3D,CAAA"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAItE,eAAO,MAAM,MAAM,GAAI,MAAM,SAAS,EAAE,OAAO,aAAa,SAkB3D,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,OAAO,aAAa,SAC1C,CAAA"}
package/build/main.js CHANGED
@@ -1,5 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { createRoot, hydrateRoot } from 'react-dom/client';
2
3
  import { DEFAULT_ROOT } from './consts.js';
4
+ import { WebApp } from './components/index.js';
5
+ import { provide } from './router.js';
3
6
  export const render = (node, opts) => {
4
7
  const _callback = () => {
5
8
  const key = opts?.domId ?? DEFAULT_ROOT;
@@ -19,4 +22,5 @@ export const render = (node, opts) => {
19
22
  };
20
23
  opts?.onReady ?? true ? window.addEventListener('DOMContentLoaded', _callback) : _callback();
21
24
  };
25
+ export const renderApp = (context, opts) => render(_jsx(WebApp, { context: context, provide: provide }), opts);
22
26
  //# sourceMappingURL=main.js.map
package/build/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG1C,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,IAAe,EAAE,IAAoB,EAAE,EAAE;IAC9D,MAAM,SAAS,GAAG,GAAG,EAAE;QACrB,MAAM,GAAG,GAAG,IAAI,EAAE,KAAK,IAAI,YAAY,CAAA;QACvC,MAAM,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAA;QACzC,IAAI,IAAI,EAAE,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,uBAAuB,GAAG,EAAE,CAAC,CAAA;QAC7C,CAAC;QACD,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,mCAAmC,GAAG,EAAE,CAAC,CAAA;QAC3D,CAAC;QACD,IAAI,IAAI,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;YAC3B,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QACzB,CAAC;aAAM,CAAC;YACN,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAC/B,CAAC;IACH,CAAC,CAAA;IAED,IAAI,EAAE,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE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,CAC1G,MAAM,CAAC,KAAC,MAAM,IAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAI,EAAE,IAAI,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGtD,eAAO,MAAM,OAAO,EAAE,cAErB,CAAA"}
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAItD,eAAO,MAAM,OAAO,EAAE,cAErB,CAAA"}
package/build/router.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createBrowserRouter } from 'react-router-dom';
1
+ import { createBrowserRouter } from 'react-router';
2
2
  export const provide = (routes) => {
3
3
  return createBrowserRouter(routes);
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"router.js","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAEtD,MAAM,CAAC,MAAM,OAAO,GAAmB,CAAC,MAAM,EAAE,EAAE;IAChD,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAA;AACpC,CAAC,CAAA"}
1
+ {"version":3,"file":"router.js","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAElD,MAAM,CAAC,MAAM,OAAO,GAAmB,CAAC,MAAM,EAAE,EAAE;IAChD,OAAO,mBAAmB,CAAC,MAAuB,CAAQ,CAAA;AAC5D,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAIxD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAG3E,eAAO,MAAM,kBAAkB,WAAW,MAAM,KAAmB,WAclE,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,OAChF,CAAC,UAAS,MAAM,KACpB,CAAC,GAAG,iBAYN,CAAA"}
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAIxD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAG3E,eAAO,MAAM,kBAAkB,GAAI,QAAO,MAAsB,KAAG,WAclE,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,EACrF,KAAK,CAAC,EAAE,QAAO,MAAsB,KACpC,CAAC,GAAG,iBAYN,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/web-client",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "tsc -b",
@@ -20,38 +20,37 @@
20
20
  }
21
21
  },
22
22
  "dependencies": {
23
- "@owlmeans/auth": "^0.1.0",
24
- "@owlmeans/auth-common": "^0.1.0",
25
- "@owlmeans/client": "^0.1.0",
26
- "@owlmeans/client-auth": "^0.1.0",
27
- "@owlmeans/client-context": "^0.1.0",
28
- "@owlmeans/client-i18n": "^0.1.0",
29
- "@owlmeans/client-module": "^0.1.0",
30
- "@owlmeans/client-resource": "^0.1.0",
31
- "@owlmeans/client-route": "^0.1.0",
32
- "@owlmeans/config": "^0.1.0",
33
- "@owlmeans/context": "^0.1.0",
34
- "@owlmeans/error": "^0.1.0",
35
- "@owlmeans/i18n": "^0.1.0",
36
- "@owlmeans/route": "^0.1.0",
37
- "@owlmeans/web-db": "^0.1.0",
23
+ "@owlmeans/auth": "^0.1.1",
24
+ "@owlmeans/auth-common": "^0.1.1",
25
+ "@owlmeans/client": "^0.1.1",
26
+ "@owlmeans/client-auth": "^0.1.1",
27
+ "@owlmeans/client-context": "^0.1.1",
28
+ "@owlmeans/client-i18n": "^0.1.1",
29
+ "@owlmeans/client-module": "^0.1.1",
30
+ "@owlmeans/client-resource": "^0.1.1",
31
+ "@owlmeans/client-route": "^0.1.1",
32
+ "@owlmeans/config": "^0.1.1",
33
+ "@owlmeans/context": "^0.1.1",
34
+ "@owlmeans/error": "^0.1.1",
35
+ "@owlmeans/i18n": "^0.1.1",
36
+ "@owlmeans/route": "^0.1.1",
37
+ "@owlmeans/web-db": "^0.1.1",
38
+ "@owlmeans/web-router": "^0.1.1",
38
39
  "react-dropzone": "^14.3.5"
39
40
  },
40
41
  "peerDependencies": {
41
42
  "react": "*",
42
43
  "react-dom": "*",
43
- "react-router-dom": "*"
44
+ "react-router": "^7.*"
44
45
  },
45
46
  "devDependencies": {
46
- "@types/react": "^18.3.11",
47
- "@types/react-dom": "^18.3.0",
48
- "nodemon": "^3.1.7",
47
+ "@types/react": "^19.2.7",
48
+ "@types/react-dom": "^19.2.3",
49
+ "nodemon": "^3.1.11",
49
50
  "npm-check": "^6.0.1",
50
- "react-router-dom": "^6.26.2",
51
- "typescript": "^5.6.3"
51
+ "typescript": "^5.8.3"
52
52
  },
53
- "private": false,
54
53
  "publishConfig": {
55
54
  "access": "public"
56
55
  }
57
- }
56
+ }
@@ -1,6 +1,6 @@
1
1
  import { DispatcherHOC } from '@owlmeans/client-auth'
2
2
  import { useEffect } from 'react'
3
- import { useSearchParams } from 'react-router-dom'
3
+ import { useSearchParams } from 'react-router'
4
4
  import { useI18nLib } from '@owlmeans/client-i18n'
5
5
  import { AUTH_QUERY } from '@owlmeans/auth'
6
6
  import { useContext } from '../../context.js'
@@ -1,3 +1,4 @@
1
1
 
2
2
  export * from './dispatcher/index.js'
3
3
  export * from './uploader/index.js'
4
+ export * from './web-app/index.js'
@@ -0,0 +1,12 @@
1
+ import type { AppProps } from "@owlmeans/client"
2
+ import { I18nContext } from "@owlmeans/client-i18n"
3
+ import { App } from '@owlmeans/client'
4
+ import type { FC } from "react"
5
+
6
+ export const WebApp: FC<AppProps> = ({ context, provide, children }) => {
7
+ return <I18nContext config={context.cfg}>
8
+ <App context={context} provide={provide}>
9
+ {children}
10
+ </App>
11
+ </I18nContext>
12
+ }
@@ -0,0 +1,2 @@
1
+
2
+ export * from './component.js'
package/src/context.ts CHANGED
@@ -7,6 +7,7 @@ import { appendClientResource } from '@owlmeans/client-resource'
7
7
  import { useContext as useCtx } from '@owlmeans/client'
8
8
  import { extractPrimaryHost } from './helper.js'
9
9
  import { appendWebAuthService } from './service.js'
10
+ import { appendWebRouter } from '@owlmeans/web-router'
10
11
 
11
12
  export const makeContext = <C extends AppConfig = AppConfig, T extends AppContext<C> = AppContext<C>>(
12
13
  cfg: C
@@ -17,6 +18,7 @@ export const makeContext = <C extends AppConfig = AppConfig, T extends AppContex
17
18
  appendWebAuthService<C, T>(context)
18
19
  appendWebDbService<C, T>(context)
19
20
  appendClientResource<C, T>(context, AUTH_RESOURCE)
21
+ appendWebRouter<C, T>(context)
20
22
 
21
23
  context.makeContext = makeContext as typeof context.makeContext
22
24
 
package/src/main.tsx CHANGED
@@ -2,7 +2,9 @@
2
2
  import type { ReactNode } from 'react'
3
3
  import { createRoot, hydrateRoot } from 'react-dom/client'
4
4
  import { DEFAULT_ROOT } from './consts.js'
5
- import type { RenderOptions } from './types.js'
5
+ import type { AppConfig, AppContext, RenderOptions } from './types.js'
6
+ import { WebApp } from './components/index.js'
7
+ import { provide } from './router.js'
6
8
 
7
9
  export const render = (node: ReactNode, opts?: RenderOptions) => {
8
10
  const _callback = () => {
@@ -23,3 +25,6 @@ export const render = (node: ReactNode, opts?: RenderOptions) => {
23
25
 
24
26
  opts?.onReady ?? true ? window.addEventListener('DOMContentLoaded', _callback) : _callback()
25
27
  }
28
+
29
+ export const renderApp = <C extends AppConfig, T extends AppContext<C>>(context: T, opts?: RenderOptions) =>
30
+ render(<WebApp context={context} provide={provide} />, opts)
package/src/router.ts CHANGED
@@ -1,7 +1,8 @@
1
1
 
2
2
  import type { RouterProvider } from '@owlmeans/client'
3
- import { createBrowserRouter } from 'react-router-dom'
3
+ import type { RouteObject } from 'react-router'
4
+ import { createBrowserRouter } from 'react-router'
4
5
 
5
6
  export const provide: RouterProvider = (routes) => {
6
- return createBrowserRouter(routes)
7
+ return createBrowserRouter(routes as RouteObject[]) as any
7
8
  }
@@ -1 +0,0 @@
1
- {"root":["./src/consts.ts","./src/context.ts","./src/errors.ts","./src/exports.ts","./src/helper.ts","./src/i18n.ts","./src/index.ts","./src/main.tsx","./src/modules.ts","./src/router.ts","./src/service.ts","./src/types.ts","./src/components/index.ts","./src/components/dispatcher/component.tsx","./src/components/dispatcher/index.ts","./src/components/uploader/component.tsx","./src/components/uploader/image.tsx","./src/components/uploader/index.ts","./src/components/uploader/types.ts"],"version":"5.6.3"}