plusui-native 0.2.44 → 0.2.47
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/package.json +4 -4
- package/templates/react/frontend/src/App.tsx +11 -11
- package/templates/react/frontend/src/main.tsx +2 -0
- package/templates/react/frontend/src/styles/filedrop.css +60 -0
- package/templates/solid/frontend/src/App.tsx +11 -11
- package/templates/solid/frontend/src/main.tsx +2 -0
- package/templates/solid/frontend/src/styles/filedrop.css +60 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plusui-native",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.47",
|
|
4
4
|
"description": "PlusUI CLI - Build C++ desktop apps modern UI ",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"semver": "^7.6.0",
|
|
28
28
|
"which": "^4.0.0",
|
|
29
29
|
"execa": "^8.0.1",
|
|
30
|
-
"plusui-native-builder": "^0.1.
|
|
31
|
-
"plusui-native-bindgen": "^0.1.
|
|
30
|
+
"plusui-native-builder": "^0.1.46",
|
|
31
|
+
"plusui-native-bindgen": "^0.1.46"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"plusui-native-bindgen": "^0.1.
|
|
34
|
+
"plusui-native-bindgen": "^0.1.46"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
@@ -19,6 +19,7 @@ function App() {
|
|
|
19
19
|
const [files, setFiles] = useState<FileInfo[]>([]);
|
|
20
20
|
const [isDragging, setIsDragging] = useState(false);
|
|
21
21
|
const [dropZoneStyle, setDropZoneStyle] = useState('');
|
|
22
|
+
const [dropAccent] = useState('#60a5fa');
|
|
22
23
|
|
|
23
24
|
useEffect(() => {
|
|
24
25
|
win.show().catch(() => {
|
|
@@ -157,19 +158,12 @@ function App() {
|
|
|
157
158
|
to prevent files from opening in the browser, allowing your FileDrop handlers to work.
|
|
158
159
|
</p>
|
|
159
160
|
|
|
160
|
-
<div
|
|
161
|
-
<label
|
|
161
|
+
<div className="filedrop-control-row">
|
|
162
|
+
<label className="filedrop-control-label">Style:</label>
|
|
162
163
|
<select
|
|
163
164
|
value={dropZoneStyle}
|
|
164
165
|
onChange={(e) => setDropZoneStyle(e.target.value)}
|
|
165
|
-
|
|
166
|
-
padding: '0.5rem',
|
|
167
|
-
borderRadius: '0.25rem',
|
|
168
|
-
border: '1px solid rgba(255,255,255,0.3)',
|
|
169
|
-
background: 'rgba(255,255,255,0.1)',
|
|
170
|
-
color: '#fff',
|
|
171
|
-
fontSize: '0.9em'
|
|
172
|
-
}}
|
|
166
|
+
className="filedrop-control-select"
|
|
173
167
|
>
|
|
174
168
|
<option value="">Default</option>
|
|
175
169
|
<option value="filedrop-compact">Compact</option>
|
|
@@ -179,7 +173,13 @@ function App() {
|
|
|
179
173
|
</select>
|
|
180
174
|
</div>
|
|
181
175
|
|
|
182
|
-
<div
|
|
176
|
+
<div
|
|
177
|
+
className={`filedrop-zone ${dropZoneStyle} ${isDragging ? 'filedrop-active' : ''}`}
|
|
178
|
+
data-dropzone="true"
|
|
179
|
+
data-filedrop-state={isDragging ? 'dragging' : 'idle'}
|
|
180
|
+
data-filedrop-style={dropZoneStyle.replace('filedrop-', '') || 'default'}
|
|
181
|
+
style={{ '--filedrop-accent': dropAccent } as React.CSSProperties}
|
|
182
|
+
>
|
|
183
183
|
<div className="filedrop-content">
|
|
184
184
|
<svg className="filedrop-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
185
185
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2}
|
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import ReactDOM from 'react-dom/client';
|
|
3
3
|
import App from './App';
|
|
4
4
|
import './styles/app.css';
|
|
5
|
+
import 'plusui-native-core/Core/Features/FileDrop/filedrop.css';
|
|
6
|
+
import './styles/filedrop.css';
|
|
5
7
|
|
|
6
8
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
7
9
|
<React.StrictMode>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
.filedrop-control-row {
|
|
2
|
+
margin-bottom: 1rem;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: 0.5rem;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.filedrop-control-label {
|
|
9
|
+
font-size: 0.9em;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.filedrop-control-select {
|
|
13
|
+
padding: 0.5rem;
|
|
14
|
+
border-radius: 0.25rem;
|
|
15
|
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
16
|
+
background: rgba(255, 255, 255, 0.1);
|
|
17
|
+
color: #fff;
|
|
18
|
+
font-size: 0.9em;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.filedrop-zone,
|
|
22
|
+
.dropzone,
|
|
23
|
+
[data-dropzone='true'] {
|
|
24
|
+
--filedrop-accent: #3b82f6;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[data-dropzone='true'][data-filedrop-state='dragging'] {
|
|
28
|
+
border-color: var(--filedrop-accent);
|
|
29
|
+
box-shadow: 0 0 0 4px color-mix(in srgb, var(--filedrop-accent) 20%, transparent);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
[data-dropzone='true'][data-filedrop-style='compact'] {
|
|
33
|
+
min-height: 120px;
|
|
34
|
+
padding: 1.5rem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[data-dropzone='true'][data-filedrop-style='inline'] {
|
|
38
|
+
min-height: 80px;
|
|
39
|
+
padding: 1rem;
|
|
40
|
+
flex-direction: row;
|
|
41
|
+
justify-content: flex-start;
|
|
42
|
+
gap: 1rem;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
[data-dropzone='true'][data-filedrop-style='inline'] .filedrop-content {
|
|
46
|
+
flex-direction: row;
|
|
47
|
+
align-items: center;
|
|
48
|
+
text-align: left;
|
|
49
|
+
gap: 0.75rem;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[data-dropzone='true'][data-filedrop-style='minimal'] {
|
|
53
|
+
border-style: solid;
|
|
54
|
+
border-width: 1px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
[data-dropzone='true'][data-filedrop-style='bold'] {
|
|
58
|
+
border-width: 3px;
|
|
59
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
|
|
60
|
+
}
|
|
@@ -19,6 +19,7 @@ function App() {
|
|
|
19
19
|
const [files, setFiles] = createSignal<FileInfo[]>([]);
|
|
20
20
|
const [isDragging, setIsDragging] = createSignal(false);
|
|
21
21
|
const [dropZoneStyle, setDropZoneStyle] = createSignal('');
|
|
22
|
+
const [dropAccent] = createSignal('#60a5fa');
|
|
22
23
|
|
|
23
24
|
onMount(() => {
|
|
24
25
|
// Setup routes
|
|
@@ -152,19 +153,12 @@ function App() {
|
|
|
152
153
|
to prevent files from opening in the browser, allowing your FileDrop handlers to work.
|
|
153
154
|
</p>
|
|
154
155
|
|
|
155
|
-
<div
|
|
156
|
-
<label
|
|
156
|
+
<div class="filedrop-control-row">
|
|
157
|
+
<label class="filedrop-control-label">Style:</label>
|
|
157
158
|
<select
|
|
158
159
|
value={dropZoneStyle()}
|
|
159
160
|
onChange={(e) => setDropZoneStyle(e.target.value)}
|
|
160
|
-
|
|
161
|
-
padding: '0.5rem',
|
|
162
|
-
'border-radius': '0.25rem',
|
|
163
|
-
border: '1px solid rgba(255,255,255,0.3)',
|
|
164
|
-
background: 'rgba(255,255,255,0.1)',
|
|
165
|
-
color: '#fff',
|
|
166
|
-
'font-size': '0.9em'
|
|
167
|
-
}}
|
|
161
|
+
class="filedrop-control-select"
|
|
168
162
|
>
|
|
169
163
|
<option value="">Default</option>
|
|
170
164
|
<option value="filedrop-compact">Compact</option>
|
|
@@ -174,7 +168,13 @@ function App() {
|
|
|
174
168
|
</select>
|
|
175
169
|
</div>
|
|
176
170
|
|
|
177
|
-
<div
|
|
171
|
+
<div
|
|
172
|
+
class={`filedrop-zone ${dropZoneStyle()} ${isDragging() ? 'filedrop-active' : ''}`}
|
|
173
|
+
data-dropzone="true"
|
|
174
|
+
data-filedrop-state={isDragging() ? 'dragging' : 'idle'}
|
|
175
|
+
data-filedrop-style={dropZoneStyle().replace('filedrop-', '') || 'default'}
|
|
176
|
+
style={{ '--filedrop-accent': dropAccent() }}
|
|
177
|
+
>
|
|
178
178
|
<div class="filedrop-content">
|
|
179
179
|
<svg class="filedrop-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
180
180
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width={2}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
.filedrop-control-row {
|
|
2
|
+
margin-bottom: 1rem;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: 0.5rem;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.filedrop-control-label {
|
|
9
|
+
font-size: 0.9em;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.filedrop-control-select {
|
|
13
|
+
padding: 0.5rem;
|
|
14
|
+
border-radius: 0.25rem;
|
|
15
|
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
16
|
+
background: rgba(255, 255, 255, 0.1);
|
|
17
|
+
color: #fff;
|
|
18
|
+
font-size: 0.9em;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.filedrop-zone,
|
|
22
|
+
.dropzone,
|
|
23
|
+
[data-dropzone='true'] {
|
|
24
|
+
--filedrop-accent: #3b82f6;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[data-dropzone='true'][data-filedrop-state='dragging'] {
|
|
28
|
+
border-color: var(--filedrop-accent);
|
|
29
|
+
box-shadow: 0 0 0 4px color-mix(in srgb, var(--filedrop-accent) 20%, transparent);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
[data-dropzone='true'][data-filedrop-style='compact'] {
|
|
33
|
+
min-height: 120px;
|
|
34
|
+
padding: 1.5rem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[data-dropzone='true'][data-filedrop-style='inline'] {
|
|
38
|
+
min-height: 80px;
|
|
39
|
+
padding: 1rem;
|
|
40
|
+
flex-direction: row;
|
|
41
|
+
justify-content: flex-start;
|
|
42
|
+
gap: 1rem;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
[data-dropzone='true'][data-filedrop-style='inline'] .filedrop-content {
|
|
46
|
+
flex-direction: row;
|
|
47
|
+
align-items: center;
|
|
48
|
+
text-align: left;
|
|
49
|
+
gap: 0.75rem;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[data-dropzone='true'][data-filedrop-style='minimal'] {
|
|
53
|
+
border-style: solid;
|
|
54
|
+
border-width: 1px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
[data-dropzone='true'][data-filedrop-style='bold'] {
|
|
58
|
+
border-width: 3px;
|
|
59
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
|
|
60
|
+
}
|