iobroker.mywebui 1.42.5 → 1.42.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.mywebui",
3
- "version": "1.42.5",
3
+ "version": "1.42.6",
4
4
  "description": "ioBroker mywebui - Custom edited mywebui by gokturk413 with 3D Editor",
5
5
  "type": "module",
6
6
  "main": "dist/backend/main.js",
@@ -27,10 +27,6 @@ export class IobrokerWebui3DScreenEditor extends BaseCustomWebComponentConstruct
27
27
  </div>
28
28
  </div>
29
29
  <div id="viewport" style="flex:1;background:#333;position:relative;overflow:hidden;"></div>
30
- <div id="rightPanel" style="width:300px;background:#1e1e1e;border-left:1px solid #444;overflow:auto;">
31
- <div style="padding:10px;font-weight:bold;color:#aaa;border-bottom:1px solid #444;">Properties</div>
32
- <div id="propertyPanel" style="padding:10px;"></div>
33
- </div>
34
30
  </div>
35
31
  </div>
36
32
  `;
@@ -246,9 +242,6 @@ export class IobrokerWebui3DScreenEditor extends BaseCustomWebComponentConstruct
246
242
 
247
243
  // Update scene tree
248
244
  this.updateSceneTree();
249
-
250
- // Update property panel
251
- this.updatePropertyPanel();
252
245
  }
253
246
 
254
247
  loadAsset(asset) {
@@ -370,7 +363,6 @@ export class IobrokerWebui3DScreenEditor extends BaseCustomWebComponentConstruct
370
363
  });
371
364
 
372
365
  console.log('✅ Selected:', obj.userData.assetData.name);
373
- this.updatePropertyPanel();
374
366
  }
375
367
 
376
368
  updateSceneTree() {
@@ -119,8 +119,69 @@ export class IobrokerWebuiSolutionExplorer extends BaseCustomWebComponentConstru
119
119
  try {
120
120
  let screenName = prompt("New " + type + " Name:");
121
121
  if (screenName) {
122
- const defaultScript = type === 'control' ? defaultNewControlScript : null;
123
- window.appShell.openScreenEditor((dir ?? '') + '/' + screenName, type, '', defaultNewStyle, defaultScript, {});
122
+ if (type === '3dscreen') {
123
+ // Create new 3D screen with default scene
124
+ const defaultScene = {
125
+ id: 'scene_' + Date.now().toString(36),
126
+ name: screenName,
127
+ version: '1.0',
128
+ createdAt: new Date().toISOString(),
129
+ modifiedAt: new Date().toISOString(),
130
+ assets: [],
131
+ lights: [
132
+ {
133
+ id: 'ambient_light',
134
+ name: 'Ambient Light',
135
+ type: 'ambient',
136
+ color: '#ffffff',
137
+ intensity: 0.6
138
+ },
139
+ {
140
+ id: 'directional_light',
141
+ name: 'Directional Light',
142
+ type: 'directional',
143
+ color: '#ffffff',
144
+ intensity: 0.8,
145
+ position: { x: 10, y: 10, z: 10 },
146
+ castShadow: true
147
+ }
148
+ ],
149
+ camera: {
150
+ position: { x: 10, y: 10, z: 10 },
151
+ target: { x: 0, y: 0, z: 0 },
152
+ fov: 75
153
+ },
154
+ grid: {
155
+ visible: true,
156
+ size: 20,
157
+ divisions: 20,
158
+ colorCenterLine: '#888888',
159
+ colorGrid: '#444444'
160
+ },
161
+ axes: {
162
+ visible: true,
163
+ size: 5
164
+ },
165
+ settings: {
166
+ backgroundColor: '#333333',
167
+ enableControls: true,
168
+ enableRaycasting: true,
169
+ shadowsEnabled: true,
170
+ antialiasing: true
171
+ },
172
+ edits: {
173
+ ops: []
174
+ }
175
+ };
176
+ await iobrokerHandler.saveObject('3dscreen', (dir ?? '') + '/' + screenName, defaultScene);
177
+ // Open the 3D editor
178
+ const editor = document.createElement('iobroker-webui-3dscreen-editor');
179
+ editor.setAttribute('scene-name', screenName);
180
+ window.appShell.openDialog(editor, { x: 50, y: 50, width: 1200, height: 800 });
181
+ } else {
182
+ const defaultScript = type === 'control' ? defaultNewControlScript : null;
183
+ window.appShell.openScreenEditor((dir ?? '') + '/' + screenName, type, '', defaultNewStyle, defaultScript, {});
184
+ }
124
185
  }
125
186
  }
126
187
  catch (err) {