@peers-app/peers-ui 0.11.1 → 0.11.2
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/dist/components/tabs.d.ts +1 -0
- package/dist/components/tabs.js +2 -3
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/screens/packages/package-info.js +6 -2
- package/dist/screens/packages/package-new-local.js +1 -1
- package/dist/system-apps/index.js +0 -1
- package/dist/ui-router/routes-loader.d.ts +0 -1
- package/package.json +3 -3
- package/src/components/tabs.tsx +10 -8
- package/src/index.tsx +4 -1
- package/src/screens/packages/package-info.tsx +11 -4
- package/src/screens/packages/package-new-local.tsx +1 -1
- package/src/system-apps/index.ts +0 -1
|
@@ -5,6 +5,7 @@ interface ITabsProps {
|
|
|
5
5
|
content: JSX.Element;
|
|
6
6
|
active?: true;
|
|
7
7
|
}[];
|
|
8
|
+
contentClassName?: string;
|
|
8
9
|
}
|
|
9
10
|
export declare const Tabs: (props: ITabsProps) => React.JSX.Element;
|
|
10
11
|
export declare const ScreenTabBody: (props: React.PropsWithChildren) => React.JSX.Element;
|
package/dist/components/tabs.js
CHANGED
|
@@ -58,10 +58,9 @@ const Tabs = (props) => {
|
|
|
58
58
|
return (react_1.default.createElement("li", { key: tab.name + iTab, className: "nav-item" },
|
|
59
59
|
react_1.default.createElement("a", { href: "#", className: "nav-link " + (activeTab.name === tab.name ? 'active' : ''), onClick: evt => (evt.preventDefault(), setActiveTab(tab)) }, tab.name)));
|
|
60
60
|
})),
|
|
61
|
-
react_1.default.createElement("
|
|
62
|
-
tabs.map((tab, iTab) => {
|
|
61
|
+
react_1.default.createElement("div", { className: "tab-content " + (props.contentClassName ?? 'mt-3') }, tabs.map((tab, iTab) => {
|
|
63
62
|
return (react_1.default.createElement("div", { key: tab.name + iTab, hidden: activeTab.name !== tab.name }, tab.content));
|
|
64
|
-
})));
|
|
63
|
+
}))));
|
|
65
64
|
};
|
|
66
65
|
exports.Tabs = Tabs;
|
|
67
66
|
const ScreenTabBody = (props) => {
|
package/dist/index.d.ts
CHANGED
|
@@ -2,3 +2,6 @@ export * from "./screens/events/cron";
|
|
|
2
2
|
export * from "./tabs-layout/tabs-layout";
|
|
3
3
|
export * from "./components/voice-indicator";
|
|
4
4
|
export * from "./components/chat-overlay";
|
|
5
|
+
export * from "./components/sortable-list";
|
|
6
|
+
export * from "./components/tabs";
|
|
7
|
+
export * from "./components/markdown-editor/editor-inline";
|
package/dist/index.js
CHANGED
|
@@ -18,3 +18,6 @@ __exportStar(require("./screens/events/cron"), exports);
|
|
|
18
18
|
__exportStar(require("./tabs-layout/tabs-layout"), exports);
|
|
19
19
|
__exportStar(require("./components/voice-indicator"), exports);
|
|
20
20
|
__exportStar(require("./components/chat-overlay"), exports);
|
|
21
|
+
__exportStar(require("./components/sortable-list"), exports);
|
|
22
|
+
__exportStar(require("./components/tabs"), exports);
|
|
23
|
+
__exportStar(require("./components/markdown-editor/editor-inline"), exports);
|
|
@@ -17,6 +17,10 @@ const PackageInfo = (props) => {
|
|
|
17
17
|
const [versionFollowRange] = (0, hooks_1.useObservable)(pkg.qs.versionFollowRange);
|
|
18
18
|
const [followVersionTags] = (0, hooks_1.useObservable)(pkg.qs.followVersionTags);
|
|
19
19
|
const [deviceTag] = (0, hooks_1.useObservable)(deviceVersionTagVar);
|
|
20
|
+
const localPathVar = (0, peers_sdk_1.groupDeviceVar)(`packageLocalPath_${pkg.packageId}`, {
|
|
21
|
+
defaultValue: `${peers_sdk_1.packagesRootDir}/${pkg.name}`,
|
|
22
|
+
});
|
|
23
|
+
const [localPath, setLocalPath] = (0, hooks_1.useObservable)(localPathVar);
|
|
20
24
|
const [deviceTagDraft, setDeviceTagDraft] = react_1.default.useState(deviceTag || '');
|
|
21
25
|
const savingRef = react_1.default.useRef(false);
|
|
22
26
|
react_1.default.useEffect(() => {
|
|
@@ -101,9 +105,9 @@ const PackageInfo = (props) => {
|
|
|
101
105
|
react_1.default.createElement("small", null,
|
|
102
106
|
react_1.default.createElement(tooltip_1.Tooltip, { markdownContent: `The local path to the directory containing the package. This will open in VS Code if it's installed otherwise this will open in your native file system` }),
|
|
103
107
|
react_1.default.createElement("button", { className: "btn btn-sm btn-link", onClick: () => {
|
|
104
|
-
peers_sdk_1.rpcServerCalls.openPackage(
|
|
108
|
+
peers_sdk_1.rpcServerCalls.openPackage(localPath || peers_sdk_1.packagesRootDir);
|
|
105
109
|
} }, "Open Local"))),
|
|
106
|
-
react_1.default.createElement(
|
|
110
|
+
react_1.default.createElement("input", { type: "text", className: "form-control mb-3 p-0 ps-2", placeholder: "~/peers/packages/my-package", value: localPath || '', onChange: e => setLocalPath(e.target.value) })),
|
|
107
111
|
pkg.remoteRepo && (react_1.default.createElement("div", { className: "mt-2" },
|
|
108
112
|
react_1.default.createElement("small", null,
|
|
109
113
|
"Source URL:",
|
|
@@ -63,7 +63,7 @@ const PackageNewLocal = () => {
|
|
|
63
63
|
const pkg = await (0, peers_sdk_1.Packages)().get(packageId);
|
|
64
64
|
if (pkg) {
|
|
65
65
|
(0, globals_1.mainContentPath)(`packages/${packageId}`);
|
|
66
|
-
peers_sdk_1.rpcServerCalls.openPackage(
|
|
66
|
+
peers_sdk_1.rpcServerCalls.openPackage(packageLocation || packageLocationDefault);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peers-app/peers-ui",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/peers-app/peers-ui.git"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"test:coverage": "jest --coverage"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@peers-app/peers-sdk": "^0.11.
|
|
29
|
+
"@peers-app/peers-sdk": "^0.11.2",
|
|
30
30
|
"bootstrap": "^5.3.3",
|
|
31
31
|
"react": "^18.0.0",
|
|
32
32
|
"react-dom": "^18.0.0"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@babel/preset-react": "^7.24.1",
|
|
38
38
|
"@babel/preset-typescript": "^7.27.1",
|
|
39
39
|
"@electron/rebuild": "^3.6.0",
|
|
40
|
-
"@peers-app/peers-sdk": "0.11.
|
|
40
|
+
"@peers-app/peers-sdk": "0.11.2",
|
|
41
41
|
"@testing-library/dom": "^10.4.0",
|
|
42
42
|
"@testing-library/jest-dom": "^6.6.3",
|
|
43
43
|
"@testing-library/react": "^16.3.0",
|
package/src/components/tabs.tsx
CHANGED
|
@@ -7,6 +7,7 @@ interface ITabsProps {
|
|
|
7
7
|
content: JSX.Element,
|
|
8
8
|
active?: true
|
|
9
9
|
}[];
|
|
10
|
+
contentClassName?: string;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
let lastActive = '';
|
|
@@ -47,14 +48,15 @@ export const Tabs = (props: ITabsProps) => {
|
|
|
47
48
|
)
|
|
48
49
|
})}
|
|
49
50
|
</ul>
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
<div className={"tab-content " + (props.contentClassName ?? 'mt-3')}>
|
|
52
|
+
{tabs.map((tab, iTab) => {
|
|
53
|
+
return (
|
|
54
|
+
<div key={tab.name + iTab} hidden={activeTab.name !== tab.name}>
|
|
55
|
+
{tab.content}
|
|
56
|
+
</div>
|
|
57
|
+
)
|
|
58
|
+
})}
|
|
59
|
+
</div>
|
|
58
60
|
</>
|
|
59
61
|
)
|
|
60
62
|
}
|
package/src/index.tsx
CHANGED
|
@@ -4,4 +4,7 @@ export * from "./screens/events/cron";
|
|
|
4
4
|
export * from "./tabs-layout/tabs-layout";
|
|
5
5
|
|
|
6
6
|
export * from "./components/voice-indicator";
|
|
7
|
-
export * from "./components/chat-overlay";
|
|
7
|
+
export * from "./components/chat-overlay";
|
|
8
|
+
export * from "./components/sortable-list";
|
|
9
|
+
export * from "./components/tabs";
|
|
10
|
+
export * from "./components/markdown-editor/editor-inline";
|
|
@@ -17,6 +17,11 @@ export const PackageInfo = (props: {
|
|
|
17
17
|
const [followVersionTags] = useObservable(pkg.qs.followVersionTags);
|
|
18
18
|
const [deviceTag] = useObservable(deviceVersionTagVar);
|
|
19
19
|
|
|
20
|
+
const localPathVar = groupDeviceVar<string>(`packageLocalPath_${pkg.packageId}`, {
|
|
21
|
+
defaultValue: `${packagesRootDir}/${pkg.name}`,
|
|
22
|
+
});
|
|
23
|
+
const [localPath, setLocalPath] = useObservable(localPathVar);
|
|
24
|
+
|
|
20
25
|
const [deviceTagDraft, setDeviceTagDraft] = React.useState(deviceTag || '');
|
|
21
26
|
const savingRef = React.useRef(false);
|
|
22
27
|
|
|
@@ -101,15 +106,17 @@ export const PackageInfo = (props: {
|
|
|
101
106
|
<button
|
|
102
107
|
className="btn btn-sm btn-link"
|
|
103
108
|
onClick={() => {
|
|
104
|
-
rpcServerCalls.openPackage(
|
|
109
|
+
rpcServerCalls.openPackage(localPath || packagesRootDir);
|
|
105
110
|
}}
|
|
106
111
|
>Open Local</button>
|
|
107
112
|
</small>
|
|
108
113
|
</small>
|
|
109
|
-
<
|
|
110
|
-
|
|
114
|
+
<input
|
|
115
|
+
type="text"
|
|
111
116
|
className="form-control mb-3 p-0 ps-2"
|
|
112
|
-
|
|
117
|
+
placeholder="~/peers/packages/my-package"
|
|
118
|
+
value={localPath || ''}
|
|
119
|
+
onChange={e => setLocalPath(e.target.value)}
|
|
113
120
|
/>
|
|
114
121
|
</div>
|
|
115
122
|
|
|
@@ -35,7 +35,7 @@ export const PackageNewLocal = () => {
|
|
|
35
35
|
const pkg = await Packages().get(packageId);
|
|
36
36
|
if (pkg) {
|
|
37
37
|
mainContentPath(`packages/${packageId}`);
|
|
38
|
-
rpcServerCalls.openPackage(
|
|
38
|
+
rpcServerCalls.openPackage(packageLocation || packageLocationDefault);
|
|
39
39
|
}
|
|
40
40
|
} catch (err) {
|
|
41
41
|
confirm('Error creating package: ' + err);
|