Skip to content

Commit e431d37

Browse files
committed
Allow opening app in canvas from side menu panel
1 parent df77959 commit e431d37

34 files changed

+973
-632
lines changed

.changeset/cold-shrimps-give.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@pulse-editor/shared-utils": patch
3+
"@pulse-editor/react-api": patch
4+
---
5+
6+
Revert mfversion in extension config

.changeset/pre.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"calm-rivers-march",
1919
"chatty-trains-beam",
2020
"clean-mangos-swim",
21+
"cold-shrimps-give",
2122
"cruel-waves-double",
2223
"cruel-zoos-play",
2324
"curvy-places-wash",

npm-packages/react-api/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @pulse-editor/react-api
22

3+
## 0.1.1-alpha.34
4+
5+
### Patch Changes
6+
7+
- Revert mfversion in extension config
8+
- Updated dependencies
9+
- @pulse-editor/shared-utils@0.1.1-alpha.34
10+
311
## 0.1.1-alpha.33
412

513
### Patch Changes

npm-packages/react-api/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pulse-editor/react-api",
3-
"version": "0.1.1-alpha.33",
3+
"version": "0.1.1-alpha.34",
44
"main": "dist/main.js",
55
"files": [
66
"dist"
@@ -38,7 +38,7 @@
3838
"typescript-eslint": "^8.30.1"
3939
},
4040
"peerDependencies": {
41-
"@pulse-editor/shared-utils": "0.1.1-alpha.33",
41+
"@pulse-editor/shared-utils": "0.1.1-alpha.34",
4242
"react": "^19.0.0",
4343
"react-dom": "^19.0.0"
4444
}

npm-packages/shared-utils/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @pulse-editor/shared-utils
22

3+
## 0.1.1-alpha.34
4+
5+
### Patch Changes
6+
7+
- Revert mfversion in extension config
8+
39
## 0.1.1-alpha.33
410

511
### Patch Changes

npm-packages/shared-utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pulse-editor/shared-utils",
3-
"version": "0.1.1-alpha.33",
3+
"version": "0.1.1-alpha.34",
44
"main": "dist/main.js",
55
"files": [
66
"dist"

npm-packages/shared-utils/src/types/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ export enum ExtensionTypeEnum {
116116
export type ExtensionConfig = {
117117
id: string;
118118
version: string;
119-
mfVersion: string;
120119
author?: string;
121120
displayName?: string;
122121
description?: string;

package-lock.json

Lines changed: 21 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"plugins": [
3-
"prettier-plugin-tailwindcss"
3+
"prettier-plugin-tailwindcss",
4+
"prettier-plugin-organize-imports"
45
]
56
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import ExtensionPreview from "@/components/extension/extension-preview";
2+
import { EditorContext } from "@/components/providers/editor-context-provider";
3+
import { useTabViewManager } from "@/lib/hooks/use-tab-view-manager";
4+
import { AppViewConfig } from "@/lib/types";
5+
import { useContext } from "react";
6+
import { v4 } from "uuid";
7+
8+
export default function AppExplorer() {
9+
const editorContext = useContext(EditorContext);
10+
11+
const { createAppViewInCanvasView } = useTabViewManager();
12+
13+
const extensions = editorContext?.persistSettings?.extensions ?? [];
14+
15+
const previews = extensions.map((ext, index) => (
16+
<div key={index} className="w-full h-fit">
17+
<ExtensionPreview
18+
extension={ext}
19+
isShowInstalledChip={false}
20+
isShowUninstallButton={false}
21+
isShowUseButton
22+
isShowCompatibleChip={false}
23+
onPress={(ext) => {
24+
const config: AppViewConfig = {
25+
app: ext.config.id,
26+
viewId: v4(),
27+
recommendedHeight: ext.config.recommendedHeight,
28+
recommendedWidth: ext.config.recommendedWidth,
29+
};
30+
createAppViewInCanvasView(config);
31+
}}
32+
/>
33+
</div>
34+
));
35+
36+
return (
37+
<div className="p-4 h-full">
38+
<p className="text-center">Tap or drag an extension to open it.</p>
39+
40+
<div className="mt-4 grid grid-cols-2 gap-2 h-full w-full overflow-y-auto">
41+
{previews}
42+
</div>
43+
</div>
44+
);
45+
}

0 commit comments

Comments
 (0)