Skip to content

Commit 8ce118c

Browse files
authored
Merge branch 'master' into vsIcons
2 parents 6d46519 + 5cd77c4 commit 8ce118c

File tree

60 files changed

+6039
-69
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+6039
-69
lines changed

apps/quick-dapp-v2/.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "../../.eslintrc.json",
3+
}

apps/quick-dapp-v2/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Remix QuickDapp V2 Plugin

apps/quick-dapp-v2/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "quick-dapp-v2",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"license": "MIT",
6+
"dependencies": {
7+
"@dnd-kit/core": "^6.1.0",
8+
"@dnd-kit/sortable": "^8.0.0",
9+
"@drafish/surge-client": "^1.1.5",
10+
"cid": "multiformats/cid",
11+
"esbuild-wasm": "^0.25.12",
12+
"ethers": "^6.15.0",
13+
"ipfs-http-client": "^47.0.1"
14+
}
15+
}

apps/quick-dapp-v2/project.json

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"name": "quick-dapp-v2",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "apps/quick-dapp-v2/src",
5+
"projectType": "application",
6+
"implicitDependencies": [],
7+
"targets": {
8+
"build": {
9+
"executor": "@nrwl/webpack:webpack",
10+
"outputs": ["{options.outputPath}"],
11+
"defaultConfiguration": "development",
12+
"options": {
13+
"compiler": "babel",
14+
"outputPath": "dist/apps/quick-dapp-v2",
15+
"index": "apps/quick-dapp-v2/src/index.html",
16+
"baseHref": "./",
17+
"main": "apps/quick-dapp-v2/src/main.tsx",
18+
"polyfills": "apps/quick-dapp-v2/src/polyfills.ts",
19+
"tsConfig": "apps/quick-dapp-v2/tsconfig.app.json",
20+
"assets": ["apps/quick-dapp-v2/src/profile.json", "apps/quick-dapp-v2/src/assets/sparkling.png"],
21+
"styles": ["apps/quick-dapp-v2/src/index.css"],
22+
"scripts": [],
23+
"webpackConfig": "apps/quick-dapp-v2/webpack.config.js"
24+
},
25+
"configurations": {
26+
"development": {
27+
},
28+
"production": {
29+
}
30+
}
31+
},
32+
"lint": {
33+
"executor": "@nrwl/linter:eslint",
34+
"outputs": ["{options.outputFile}"],
35+
"options": {
36+
"lintFilePatterns": ["apps/quick-dapp-v2/**/*.ts"],
37+
"eslintConfig": "apps/quick-dapp-v2/.eslintrc"
38+
}
39+
},
40+
"install": {
41+
"executor": "nx:run-commands",
42+
"cache": false,
43+
"options": {
44+
"commands": [
45+
"cd apps/quick-dapp-v2 && yarn"
46+
],
47+
"parallel": false
48+
}
49+
},
50+
"serve": {
51+
"executor": "@nrwl/webpack:dev-server",
52+
"defaultConfiguration": "development",
53+
"options": {
54+
"buildTarget": "quick-dapp-v2:build",
55+
"hmr": true,
56+
"baseHref": "/"
57+
},
58+
"configurations": {
59+
"development": {
60+
"buildTarget": "quick-dapp-v2:build:development",
61+
"port": 2025
62+
},
63+
"production": {
64+
"buildTarget": "quick-dapp-v2:build:production"
65+
}
66+
}
67+
}
68+
},
69+
"tags": []
70+
}

apps/quick-dapp-v2/src/App.css

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
/* You can add global styles to this file, and also import other style files */
2+
3+
.item-wrapper {
4+
transform: translate3d(var(--translate-x, 0), var(--translate-y, 0), 0)
5+
scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1));
6+
transform-origin: 0 0;
7+
touch-action: manipulation;
8+
9+
&:hover {
10+
.item-remove {
11+
visibility: visible;
12+
}
13+
}
14+
}
15+
16+
.item-remove {
17+
visibility: hidden;
18+
top: 5px;
19+
right: 5px;
20+
width: 20px;
21+
height: 20px;
22+
background-color: var(--gray-dark);
23+
24+
.fas {
25+
color: var(--text-bg-mark);
26+
}
27+
}
28+
29+
.item-action {
30+
touch-action: none;
31+
outline: none !important;
32+
appearance: none;
33+
background-color: transparent;
34+
-webkit-tap-highlight-color: transparent;
35+
36+
@media (hover: hover) {
37+
&:hover {
38+
background-color: var(--bs-light);
39+
}
40+
}
41+
42+
.fas {
43+
color: var(--text-bg-mark);
44+
}
45+
}
46+
47+
.bg-light {
48+
.item-action {
49+
@media (hover: hover) {
50+
&:hover {
51+
background-color: var(--dark);
52+
}
53+
}
54+
}
55+
}
56+
57+
.container {
58+
flex-direction: column;
59+
60+
&.placeholder {
61+
justify-content: center;
62+
align-items: center;
63+
cursor: pointer;
64+
}
65+
}
66+
67+
68+
.container-header {
69+
&:hover {
70+
.container-actions > * {
71+
opacity: 1 !important;
72+
}
73+
}
74+
}
75+
76+
.container-actions {
77+
> *:first-child:not(:last-child) {
78+
opacity: 0;
79+
80+
&:focus-visible {
81+
opacity: 1;
82+
}
83+
}
84+
}
85+
86+
.instance-input {
87+
background-color: var(--custom-select) !important;
88+
font-size: 10px;
89+
}
90+
.has-args {
91+
border-top-right-radius: 0;
92+
border-bottom-right-radius: 0;
93+
}
94+
95+
.udapp_intro {
96+
overflow: hidden;
97+
text-overflow: ellipsis;
98+
display: -webkit-box;
99+
white-space: pre-wrap;
100+
-webkit-line-clamp: 2;
101+
-webkit-box-orient: vertical;
102+
}
103+
.udapp_intro:hover {
104+
-webkit-line-clamp: inherit;
105+
}
106+
.cursor_pointer {
107+
cursor: pointer;
108+
}
109+
.cursor_pointer:hover {
110+
color: var(--bs-secondary);
111+
}
112+
.custom-dropdown-items {
113+
padding: 0.25rem 0.25rem;
114+
border-radius: .25rem;
115+
background: var(--custom-select);
116+
}
117+
118+
.custom-dropdown-items a {
119+
border-radius: .25rem;
120+
text-transform: none;
121+
text-decoration: none;
122+
font-weight: normal;
123+
font-size: 0.875rem;
124+
padding: 0.25rem 0.25rem;
125+
width: auto;
126+
color: var(--text);
127+
}

apps/quick-dapp-v2/src/App.tsx

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import React, { useEffect, useReducer, useState } from 'react';
2+
import { IntlProvider } from 'react-intl'
3+
import CreateInstance from './components/CreateInstance';
4+
import EditInstance from './components/EditInstance';
5+
import EditHtmlTemplate from './components/EditHtmlTemplate';
6+
import DeployPanel from './components/DeployPanel';
7+
import LoadingScreen from './components/LoadingScreen';
8+
import { appInitialState, appReducer } from './reducers/state';
9+
import {
10+
connectRemix,
11+
initDispatch,
12+
updateState,
13+
selectTheme,
14+
} from './actions';
15+
import { AppContext } from './contexts';
16+
import remixClient from './remix-client';
17+
import './App.css';
18+
19+
function App(): JSX.Element {
20+
const [locale, setLocale] = useState<{code: string; messages: any}>({
21+
code: 'en',
22+
messages: null,
23+
})
24+
const [appState, dispatch] = useReducer(appReducer, appInitialState);
25+
const { isAiLoading } = appState;
26+
27+
useEffect(() => {
28+
updateState(appState);
29+
}, [appState]);
30+
useEffect(() => {
31+
initDispatch(dispatch);
32+
updateState(appState);
33+
connectRemix().then(() => {
34+
remixClient.call('theme', 'currentTheme').then((theme: any) => {
35+
selectTheme(theme.name);
36+
});
37+
remixClient.on('theme', 'themeChanged', (theme: any) => {
38+
selectTheme(theme.name);
39+
});
40+
// @ts-ignore
41+
remixClient.call('locale', 'currentLocale').then((locale: any) => {
42+
setLocale(locale)
43+
})
44+
// @ts-ignore
45+
remixClient.on('locale', 'localeChanged', (locale: any) => {
46+
setLocale(locale)
47+
})
48+
// @ts-ignore
49+
remixClient.on('ai-dapp-generator', 'generationProgress', (progress: any) => {
50+
if (progress.status === 'started') {
51+
dispatch({ type: 'SET_AI_LOADING', payload: true });
52+
}
53+
});
54+
// @ts-ignore
55+
remixClient.on('ai-dapp-generator', 'dappGenerated', () => {
56+
dispatch({ type: 'SET_AI_LOADING', payload: false });
57+
});
58+
// @ts-ignore
59+
remixClient.on('ai-dapp-generator', 'dappUpdated', () => {
60+
dispatch({ type: 'SET_AI_LOADING', payload: false });
61+
});
62+
});
63+
}, []);
64+
return (
65+
<AppContext.Provider
66+
value={{
67+
dispatch,
68+
appState,
69+
}}
70+
>
71+
<IntlProvider locale={locale.code} messages={locale.messages}>
72+
{appState.instance.htmlTemplate ? (
73+
<div className="container-fluid pt-3">
74+
<EditHtmlTemplate />
75+
</div>
76+
) : Object.keys(appState.instance.abi).length > 0 ? (
77+
<div className="row m-0 pt-3">
78+
<EditInstance />
79+
<DeployPanel />
80+
</div>
81+
) : (
82+
<div className="row m-0 pt-3">
83+
<CreateInstance isAiLoading={isAiLoading} />
84+
</div>
85+
)}
86+
<LoadingScreen />
87+
</IntlProvider>
88+
</AppContext.Provider>
89+
);
90+
}
91+
92+
export default App;

0 commit comments

Comments
 (0)