react-iframe-bridge 0.5.1 → 0.7.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.
|
@@ -5,5 +5,5 @@ import HomeIframe from './HomeIframe';
|
|
|
5
5
|
import HomeNoSample from './HomeNoSample';
|
|
6
6
|
import HomeSamples from './HomeSamples';
|
|
7
7
|
export function Home(props) {
|
|
8
|
-
return (_jsx(HomeContextProvider, { rocUrl: props.rocUrl, database: props.database, children: _jsxs("div", { className: "flex flex-col w-screen h-screen", children: [_jsx(HomeHeader, {}), _jsxs("div", { className: "flex flex-row flex-1 mt-2 border-t border-neutral-300 ", children: [_jsxs("div", { className: "flex flex-col w-48 px-2 pt-4 space-y-3 border-r
|
|
8
|
+
return (_jsx(HomeContextProvider, { rocUrl: props.rocUrl, database: props.database, children: _jsxs("div", { className: "flex flex-col w-screen h-screen", children: [_jsx(HomeHeader, {}), _jsxs("div", { className: "flex flex-row flex-1 mt-2 border-t border-neutral-300 min-h-0", children: [_jsxs("div", { className: "flex flex-col w-48 px-2 pt-4 space-y-3 border-r border-neutral-300 overflow-auto", children: [_jsx(HomeNoSample, {}), _jsx(HomeSamples, {})] }), _jsx(HomeIframe, {})] })] }) }));
|
|
9
9
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Roc, RocDocument } from 'rest-on-couch-client';
|
|
3
3
|
import { SampleEntryContent, SampleEntryId } from '../types/db';
|
|
4
|
-
export declare function useIframeBridgeContext<PublicUserInfo = unknown>(): IframeBridgeReadyContextType<PublicUserInfo>;
|
|
4
|
+
export declare function useIframeBridgeContext<PublicUserInfo = unknown, PrivateUserInfo = unknown>(): IframeBridgeReadyContextType<PublicUserInfo, PrivateUserInfo>;
|
|
5
5
|
export declare function useIframeBridgeSample(): RocDocument<SampleEntryContent, SampleEntryId>;
|
|
6
|
-
interface IframeBridgeReadyContextTypeBase<PublicUserInfo> {
|
|
6
|
+
interface IframeBridgeReadyContextTypeBase<PublicUserInfo, PrivateUserInfo> {
|
|
7
7
|
state: 'ready';
|
|
8
8
|
data: IframeDataMessage;
|
|
9
|
-
roc: Roc<PublicUserInfo>;
|
|
9
|
+
roc: Roc<PublicUserInfo, PrivateUserInfo>;
|
|
10
10
|
}
|
|
11
|
-
interface IframeBridgeReadyContextTypeWithSample<PublicUserInfo> extends IframeBridgeReadyContextTypeBase<PublicUserInfo> {
|
|
11
|
+
interface IframeBridgeReadyContextTypeWithSample<PublicUserInfo, PrivateUserInfo> extends IframeBridgeReadyContextTypeBase<PublicUserInfo, PrivateUserInfo> {
|
|
12
12
|
hasSample: true;
|
|
13
13
|
sample: RocDocument<SampleEntryContent, SampleEntryId>;
|
|
14
14
|
}
|
|
15
|
-
interface IframeBridgeReadyContextTypeWithoutSample<PublicUserInfo> extends IframeBridgeReadyContextTypeBase<PublicUserInfo> {
|
|
15
|
+
interface IframeBridgeReadyContextTypeWithoutSample<PublicUserInfo, PrivateUserInfo> extends IframeBridgeReadyContextTypeBase<PublicUserInfo, PrivateUserInfo> {
|
|
16
16
|
hasSample: false;
|
|
17
17
|
sample: null;
|
|
18
18
|
}
|
|
19
|
-
declare type IframeBridgeReadyContextType<PublicUserInfo = unknown> = IframeBridgeReadyContextTypeWithSample<PublicUserInfo> | IframeBridgeReadyContextTypeWithoutSample<PublicUserInfo>;
|
|
19
|
+
declare type IframeBridgeReadyContextType<PublicUserInfo = unknown, PrivateUserInfo = unknown> = IframeBridgeReadyContextTypeWithSample<PublicUserInfo, PrivateUserInfo> | IframeBridgeReadyContextTypeWithoutSample<PublicUserInfo, PrivateUserInfo>;
|
|
20
20
|
interface IframeDataMessage {
|
|
21
21
|
couchDB: {
|
|
22
22
|
url: string;
|
package/lib/contexts/roc.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Roc } from 'rest-on-couch-client';
|
|
3
|
-
export declare function useRoc<PublicUserInfo = unknown>(): Roc<PublicUserInfo>;
|
|
3
|
+
export declare function useRoc<PublicUserInfo = unknown, PrivateUserInfo = unknown>(): Roc<PublicUserInfo, PrivateUserInfo>;
|
|
4
4
|
export declare function RocProvider(props: {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
url: string;
|
|
@@ -11,6 +11,6 @@ const HomeIframe_1 = __importDefault(require("./HomeIframe"));
|
|
|
11
11
|
const HomeNoSample_1 = __importDefault(require("./HomeNoSample"));
|
|
12
12
|
const HomeSamples_1 = __importDefault(require("./HomeSamples"));
|
|
13
13
|
function Home(props) {
|
|
14
|
-
return ((0, jsx_runtime_1.jsx)(HomeContext_1.HomeContextProvider, { rocUrl: props.rocUrl, database: props.database, children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col w-screen h-screen", children: [(0, jsx_runtime_1.jsx)(HomeHeader_1.default, {}), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-row flex-1 mt-2 border-t border-neutral-300 ", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col w-48 px-2 pt-4 space-y-3 border-r
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(HomeContext_1.HomeContextProvider, { rocUrl: props.rocUrl, database: props.database, children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col w-screen h-screen", children: [(0, jsx_runtime_1.jsx)(HomeHeader_1.default, {}), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-row flex-1 mt-2 border-t border-neutral-300 min-h-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col w-48 px-2 pt-4 space-y-3 border-r border-neutral-300 overflow-auto", children: [(0, jsx_runtime_1.jsx)(HomeNoSample_1.default, {}), (0, jsx_runtime_1.jsx)(HomeSamples_1.default, {})] }), (0, jsx_runtime_1.jsx)(HomeIframe_1.default, {})] })] }) }));
|
|
15
15
|
}
|
|
16
16
|
exports.Home = Home;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Roc, RocDocument } from 'rest-on-couch-client';
|
|
3
3
|
import { SampleEntryContent, SampleEntryId } from '../types/db';
|
|
4
|
-
export declare function useIframeBridgeContext<PublicUserInfo = unknown>(): IframeBridgeReadyContextType<PublicUserInfo>;
|
|
4
|
+
export declare function useIframeBridgeContext<PublicUserInfo = unknown, PrivateUserInfo = unknown>(): IframeBridgeReadyContextType<PublicUserInfo, PrivateUserInfo>;
|
|
5
5
|
export declare function useIframeBridgeSample(): RocDocument<SampleEntryContent, SampleEntryId>;
|
|
6
|
-
interface IframeBridgeReadyContextTypeBase<PublicUserInfo> {
|
|
6
|
+
interface IframeBridgeReadyContextTypeBase<PublicUserInfo, PrivateUserInfo> {
|
|
7
7
|
state: 'ready';
|
|
8
8
|
data: IframeDataMessage;
|
|
9
|
-
roc: Roc<PublicUserInfo>;
|
|
9
|
+
roc: Roc<PublicUserInfo, PrivateUserInfo>;
|
|
10
10
|
}
|
|
11
|
-
interface IframeBridgeReadyContextTypeWithSample<PublicUserInfo> extends IframeBridgeReadyContextTypeBase<PublicUserInfo> {
|
|
11
|
+
interface IframeBridgeReadyContextTypeWithSample<PublicUserInfo, PrivateUserInfo> extends IframeBridgeReadyContextTypeBase<PublicUserInfo, PrivateUserInfo> {
|
|
12
12
|
hasSample: true;
|
|
13
13
|
sample: RocDocument<SampleEntryContent, SampleEntryId>;
|
|
14
14
|
}
|
|
15
|
-
interface IframeBridgeReadyContextTypeWithoutSample<PublicUserInfo> extends IframeBridgeReadyContextTypeBase<PublicUserInfo> {
|
|
15
|
+
interface IframeBridgeReadyContextTypeWithoutSample<PublicUserInfo, PrivateUserInfo> extends IframeBridgeReadyContextTypeBase<PublicUserInfo, PrivateUserInfo> {
|
|
16
16
|
hasSample: false;
|
|
17
17
|
sample: null;
|
|
18
18
|
}
|
|
19
|
-
declare type IframeBridgeReadyContextType<PublicUserInfo = unknown> = IframeBridgeReadyContextTypeWithSample<PublicUserInfo> | IframeBridgeReadyContextTypeWithoutSample<PublicUserInfo>;
|
|
19
|
+
declare type IframeBridgeReadyContextType<PublicUserInfo = unknown, PrivateUserInfo = unknown> = IframeBridgeReadyContextTypeWithSample<PublicUserInfo, PrivateUserInfo> | IframeBridgeReadyContextTypeWithoutSample<PublicUserInfo, PrivateUserInfo>;
|
|
20
20
|
interface IframeDataMessage {
|
|
21
21
|
couchDB: {
|
|
22
22
|
url: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Roc } from 'rest-on-couch-client';
|
|
3
|
-
export declare function useRoc<PublicUserInfo = unknown>(): Roc<PublicUserInfo>;
|
|
3
|
+
export declare function useRoc<PublicUserInfo = unknown, PrivateUserInfo = unknown>(): Roc<PublicUserInfo, PrivateUserInfo>;
|
|
4
4
|
export declare function RocProvider(props: {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
url: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-iframe-bridge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "React hooks and components to work with iframe-bridge.",
|
|
5
5
|
"main": "lib-cjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"clsx": "^1.1.1",
|
|
32
32
|
"iframe-bridge": "^2.0.0",
|
|
33
33
|
"immer": "^9.0.5",
|
|
34
|
-
"rest-on-couch-client": "^5.
|
|
34
|
+
"rest-on-couch-client": "^5.1.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/react": "^17.0.16",
|