iobroker.webui 1.25.2 → 1.27.0
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/README.md +11 -0
- package/io-package.json +27 -27
- package/package.json +19 -19
- package/www/dist/frontend/common/Common.globals.d.ts +2 -1
- package/www/dist/frontend/common/Runtime.d.ts +2 -2
- package/www/dist/frontend/config/IobrokerWebuiScreenEditor.js +30 -6
- package/www/dist/frontend/config/IobrokerWebuiSolutionExplorer.js +4 -4
- package/www/dist/frontend/generated/ScriptCommands.json +8 -3
- package/www/dist/frontend/helper/DialogHelper.js +7 -4
- package/www/dist/frontend/runtime/ScreenViewer.js +20 -25
- package/www/dist/frontend/scripting/IobrokerWebuiScriptSystem.js +2 -1
- package/www/index.html +1 -1
- package/www/node_modules/@adobe/css-tools/dist/index.mjs +1 -1
- package/www/node_modules/@iobroker/socket-client/dist/esm/AdminConnection.js +7 -4
- package/www/node_modules/@iobroker/socket-client/dist/esm/Connection.d.ts +82 -2
- package/www/node_modules/@iobroker/socket-client/dist/esm/Connection.js +266 -2
- package/www/node_modules/@iobroker/webcomponent-selectid-dialog/dist/iobrokerSelectId.es.js +19640 -18926
- package/www/node_modules/@iobroker/webcomponent-selectid-dialog/dist/selectIdHelper.js +3 -1
- package/www/node_modules/@iobroker/webcomponent-selectid-dialog/dist/socket.iob.js +1 -1
- package/www/node_modules/@node-projects/base-custom-webcomponent/dist/BaseCustomWebComponent.d.ts +2 -1
- package/www/node_modules/@node-projects/base-custom-webcomponent/dist/BaseCustomWebComponent.js +63 -53
- package/www/node_modules/@node-projects/base-custom-webcomponent/dist/Effect.js +2 -0
- package/www/node_modules/@node-projects/base-custom-webcomponent/dist/SignalDecorator.js +16 -0
- package/www/node_modules/@node-projects/propertygrid.webcomponent/node_modules/@node-projects/base-custom-webcomponent/dist/BaseCustomWebComponent.js +795 -0
- package/www/node_modules/@node-projects/propertygrid.webcomponent/node_modules/@node-projects/base-custom-webcomponent/dist/Debounce.js +19 -0
- package/www/node_modules/@node-projects/propertygrid.webcomponent/node_modules/@node-projects/base-custom-webcomponent/dist/DeclaritiveBaseCustomWebcomponent.js +176 -0
- package/www/node_modules/@node-projects/propertygrid.webcomponent/node_modules/@node-projects/base-custom-webcomponent/dist/DomHelper.js +96 -0
- package/www/node_modules/@node-projects/propertygrid.webcomponent/node_modules/@node-projects/base-custom-webcomponent/dist/HotModuleReplacement.js +125 -0
- package/www/node_modules/@node-projects/propertygrid.webcomponent/node_modules/@node-projects/base-custom-webcomponent/dist/LazyLoader.js +52 -0
- package/www/node_modules/@node-projects/propertygrid.webcomponent/node_modules/@node-projects/base-custom-webcomponent/dist/TouchContextMenu.js +20 -0
- package/www/node_modules/@node-projects/propertygrid.webcomponent/node_modules/@node-projects/base-custom-webcomponent/dist/TypedEvent.js +48 -0
- package/www/node_modules/@node-projects/propertygrid.webcomponent/node_modules/@node-projects/base-custom-webcomponent/dist/WeakArray.js +27 -0
- package/www/node_modules/@node-projects/propertygrid.webcomponent/node_modules/@node-projects/base-custom-webcomponent/dist/index.js +9 -0
- package/www/node_modules/@node-projects/propertygrid.webcomponent/node_modules/@node-projects/base-custom-webcomponent/jsr.json +5 -0
- package/www/node_modules/@node-projects/web-component-designer/dist/elements/helper/getBoxQuads.js +14 -15
- package/www/node_modules/@node-projects/web-component-designer/dist/elements/item/DesignItem.js +8 -41
- package/www/node_modules/@node-projects/web-component-designer/dist/elements/services/DefaultServiceBootstrap.js +2 -0
- package/www/node_modules/@node-projects/web-component-designer/dist/elements/services/ServiceContainer.js +1 -0
- package/www/node_modules/@node-projects/web-component-designer/dist/elements/services/designItemService/BaseCustomWebcomponentDesignItemService.js +2 -1
- package/www/node_modules/@node-projects/web-component-designer/dist/elements/services/designItemService/DesignItemService.js +27 -1
- package/www/node_modules/@node-projects/web-component-designer/dist/elements/services/propertiesService/services/NativeElementsPropertiesService.js +37 -0
- package/www/node_modules/@node-projects/web-component-designer/dist/elements/widgets/designerView/designerCanvas.js +2 -0
- package/www/node_modules/@node-projects/web-component-designer/dist/elements/widgets/designerView/extensions/buttons/OptionsContextMenuButton.js +29 -4
- package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/blockly/components/fields/FieldObjectId.js +6 -0
- package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/components/BindingsEditor.js +1 -1
- package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/components/SimpleScriptEditor.js +10 -0
- package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/components/VisualizationPropertyGrid.js +6 -0
- package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/helpers/BindingsHelper.js +53 -0
- package/www/node_modules/@node-projects/web-component-designer-widgets-wunderbaum/dist/widgets/WunderbaumOptions.js +2 -0
- package/www/node_modules/blockly/blockly_compressed.js +67 -67
- package/www/node_modules/blockly/blocks_compressed.js +1 -1
- package/www/node_modules/blockly/javascript_compressed.js +15 -15
- package/www/node_modules/dock-spawn-ts/lib/es5/dock-spawn-ts.js +1 -1
- package/www/node_modules/dock-spawn-ts/lib/js/DockManager.js +1 -1
- package/www/node_modules/es-module-shims/dist/es-module-shims.js +754 -628
- package/www/node_modules/long/index.js +360 -246
- package/www/node_modules/long/umd/index.js +1585 -1395
- package/www/node_modules/wunderbaum/dist/wunderbaum.css +10 -1
- package/www/node_modules/wunderbaum/dist/wunderbaum.esm.min.js +42 -42
package/README.md
CHANGED
|
@@ -133,6 +133,17 @@ runtime.html?screenName=screen2
|
|
|
133
133
|
Placeholder for next versions:
|
|
134
134
|
### __WORK IN PROGRESS__
|
|
135
135
|
-->
|
|
136
|
+
### 1.27.0 (2025-03-30)
|
|
137
|
+
- edit string in visu property grid
|
|
138
|
+
- bindings to properties did not work (in designer)
|
|
139
|
+
- html setting did not work sometimes
|
|
140
|
+
|
|
141
|
+
### 1.26.0 (2025-03-04)
|
|
142
|
+
- fix error in screenviewer
|
|
143
|
+
- update npms
|
|
144
|
+
- rename global styles
|
|
145
|
+
- allow styling of dialog
|
|
146
|
+
|
|
136
147
|
### 1.25.2 (2025-02-05)
|
|
137
148
|
- fix null error on props
|
|
138
149
|
|
package/io-package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "webui",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.27.0",
|
|
5
5
|
"titleLang": {
|
|
6
6
|
"en": "webui",
|
|
7
7
|
"de": "webui",
|
|
@@ -29,6 +29,32 @@
|
|
|
29
29
|
"zh-cn": "使用万维网传送器的高锰用户接口"
|
|
30
30
|
},
|
|
31
31
|
"news": {
|
|
32
|
+
"1.27.0": {
|
|
33
|
+
"en": "edit string in visu property grid\nbindings to properties did not work (in designer)\nhtml setting did not work sometimes",
|
|
34
|
+
"de": "string in visu-eigenschaftsgitter bearbeiten\nbindungen an eigenschaften funktionierten nicht (im designer)\nhtml einstellung funktioniert nicht manchmal",
|
|
35
|
+
"ru": "редактировать строки в сетке свойств visu\nпривязка к свойствам не сработала (в конструкторе)\nhtml-настройка иногда не работает",
|
|
36
|
+
"pt": "edit string in visu property grid\nligações a propriedades não funcionou (em designer)\nconfiguração html não funcionou às vezes",
|
|
37
|
+
"nl": "tekenreeks bewerken in visu eigenschap raster\nbindingen aan eigenschappen werkten niet (in ontwerper)\nhtml-instelling werkte soms niet",
|
|
38
|
+
"fr": "modifier la chaîne dans la grille de propriétés visu\nles fixations aux propriétés ne fonctionnaient pas (en designer)\nle réglage html ne fonctionnait pas parfois",
|
|
39
|
+
"it": "modifica stringa nella griglia di proprietà visu\nleganti a proprietà non ha funzionato (in progettista)\nhtml impostazione non ha funzionato a volte",
|
|
40
|
+
"es": "cadena de edición en la red de propiedades visu\nvinculantes para propiedades no funcionaron (en diseñador)\nhtml setting did not work sometimes",
|
|
41
|
+
"pl": "edytuj ciąg w siatce właściwości visu\nwiązania do nieruchomości nie działa (w projektancie)\nustawienia html nie działały czasami",
|
|
42
|
+
"uk": "редагувати рядок в мережі visu\nобов’язки до властивостей не працювали (у дизайнеру)\nналаштування html не працює іноді",
|
|
43
|
+
"zh-cn": "在粘着属性网格中编辑字符串\n约束属性无效( 设计者)\nhtml 设置有时行不通"
|
|
44
|
+
},
|
|
45
|
+
"1.26.0": {
|
|
46
|
+
"en": "fix error in screenviewer\nupdate npms\nrename global styles\nallow styling of dialog",
|
|
47
|
+
"de": "fehler in screenviewer beheben\naktualisierung von npms\numbenennen global styles\ndie gestaltung des dialogs ermöglichen",
|
|
48
|
+
"ru": "исправить ошибку screenviewer\nобновление npms\nпереименовать глобальные стили\nразрешить стилизацию диалога",
|
|
49
|
+
"pt": "corrigir erro no screenviewer\natualização npms\nrenomear estilos globais\npermitir o estilo de diálogo",
|
|
50
|
+
"nl": "fix error in screenviewer\nnpms bijwerken\nglobale stijlen hernoemen\nstyling van dialoogvenster toestaan",
|
|
51
|
+
"fr": "correction d'erreur dans screenviewer\nmettre à jour npms\nrenommer les styles globaux\npermettre le style de dialogue",
|
|
52
|
+
"it": "errore di correzione in screenviewer\naggiornamento npm\nrinominare gli stili globali\nconsentire lo styling di dialogo",
|
|
53
|
+
"es": "corregir error en screenviewer\nactualización npms\nrenombrar estilos globales\npermitir el estilo de diálogo",
|
|
54
|
+
"pl": "naprawić błąd w przeglądarce\nupdate npms\nzmienić nazwę stylów globalnych\numożliwić stylizację okna dialogowego",
|
|
55
|
+
"uk": "виправлено помилку в екрані\nоновлення npms\nперейменувати глобальні стилі\nдозволяє укладати діалогове вікно",
|
|
56
|
+
"zh-cn": "在屏幕查看器中修正错误\n更新 npms\n重命名全局样式\n允许对话框的样式"
|
|
57
|
+
},
|
|
32
58
|
"1.25.2": {
|
|
33
59
|
"en": "fix null error on props",
|
|
34
60
|
"de": "nullfehler auf requisiten beheben",
|
|
@@ -93,32 +119,6 @@
|
|
|
93
119
|
"pl": "pierwsze obciążenie wiązania css\nfix get box quads with slots\nfix es module shims",
|
|
94
120
|
"uk": "перше навантаження css зв'язування\nзакріпити ящик квадроцикли з слотами\nзакріпити es модуль шім",
|
|
95
121
|
"zh-cn": "首先装入 css 绑定\n固定带插槽的框形\n修补 e 模块 shims"
|
|
96
|
-
},
|
|
97
|
-
"1.24.2": {
|
|
98
|
-
"en": "revert back es module shims, leads to errors",
|
|
99
|
-
"de": "zurückkehren es modul shims, führt zu fehlern",
|
|
100
|
-
"ru": "возвращать назад эс-модульные шимы, приводит к ошибкам",
|
|
101
|
-
"pt": "reverter para trás es módulo shims, leva a erros",
|
|
102
|
-
"nl": "terug te keren es module shims, leidt tot fouten",
|
|
103
|
-
"fr": "retour du module es shims, conduit à des erreurs",
|
|
104
|
-
"it": "revert back es modulo shims, conduce a errori",
|
|
105
|
-
"es": "revert back es module shims, leads to errors",
|
|
106
|
-
"pl": "revert es module shims, prowadzi do błędów",
|
|
107
|
-
"uk": "перевернути назад es модуль шімів, призводить до помилок",
|
|
108
|
-
"zh-cn": "返回 es 模块 shims, 导致错误"
|
|
109
|
-
},
|
|
110
|
-
"1.24.1": {
|
|
111
|
-
"en": "hopefully fix package upload by changed name",
|
|
112
|
-
"de": "hoffentlich paket-upload mit geändertem namen beheben",
|
|
113
|
-
"ru": "надеюсь исправить загрузку пакета измененным именем",
|
|
114
|
-
"pt": "esperançosamente corrigir o upload do pacote por nome alterado",
|
|
115
|
-
"nl": "hopelijk pakket uploaden op gewijzigde naam repareren",
|
|
116
|
-
"fr": "j'espère corriger le téléchargement du paquet par changement de nom",
|
|
117
|
-
"it": "si spera di risolvere il pacchetto upload con il nome cambiato",
|
|
118
|
-
"es": "esperemos fijar la carga del paquete por nombre cambiado",
|
|
119
|
-
"pl": "miejmy nadzieję, że uda się naprawić przesyłkę po zmianie nazwy",
|
|
120
|
-
"uk": "сподіваємось на те, що завантаження пакету змінено",
|
|
121
|
-
"zh-cn": "希望用更改的名称修正软件包上传"
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
"icon": "logo.png",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.webui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.27.0",
|
|
4
4
|
"description": "ioBroker webui",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/backend/main.js",
|
|
@@ -44,56 +44,56 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@iobroker/adapter-core": "^3.2.3",
|
|
47
|
-
"@types/node": "^22.
|
|
47
|
+
"@types/node": "^22.13.14"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@adobe/css-tools": "4.4.
|
|
50
|
+
"@adobe/css-tools": "4.4.2",
|
|
51
51
|
"@alcalzone/release-script": "^3.8.0",
|
|
52
52
|
"@alcalzone/release-script-plugin-iobroker": "^3.7.2",
|
|
53
53
|
"@alcalzone/release-script-plugin-license": "^3.7.0",
|
|
54
54
|
"@blockly/zoom-to-fit": "^6.0.12",
|
|
55
|
-
"@iobroker/socket-client": "^4.
|
|
56
|
-
"@iobroker/testing": "^5.0.
|
|
57
|
-
"@iobroker/webcomponent-selectid-dialog": "^1.0.
|
|
58
|
-
"@node-projects/base-custom-webcomponent": "0.
|
|
55
|
+
"@iobroker/socket-client": "^4.1.0",
|
|
56
|
+
"@iobroker/testing": "^5.0.4",
|
|
57
|
+
"@iobroker/webcomponent-selectid-dialog": "^1.0.7",
|
|
58
|
+
"@node-projects/base-custom-webcomponent": "0.29.0",
|
|
59
59
|
"@node-projects/lean-he-esm": "^3.3.0",
|
|
60
60
|
"@node-projects/node-html-parser-esm": "^6.2.0",
|
|
61
61
|
"@node-projects/propertygrid.webcomponent": "^1.3.0",
|
|
62
62
|
"@node-projects/splitview.webcomponent": "^1.0.1",
|
|
63
|
-
"@node-projects/web-component-designer": "^0.1.
|
|
63
|
+
"@node-projects/web-component-designer": "^0.1.247",
|
|
64
64
|
"@node-projects/web-component-designer-codeview-monaco": "^0.1.33",
|
|
65
65
|
"@node-projects/web-component-designer-htmlparserservice-nodehtmlparser": "^0.1.11",
|
|
66
66
|
"@node-projects/web-component-designer-stylesheetservice-css-tools": "^0.1.10",
|
|
67
|
-
"@node-projects/web-component-designer-visualization-addons": "^0.1.
|
|
68
|
-
"@node-projects/web-component-designer-widgets-wunderbaum": "^0.1.
|
|
67
|
+
"@node-projects/web-component-designer-visualization-addons": "^0.1.116",
|
|
68
|
+
"@node-projects/web-component-designer-widgets-wunderbaum": "^0.1.33",
|
|
69
69
|
"@types/json-schema": "^7.0.15",
|
|
70
70
|
"@web/dev-server": "^0.4.6",
|
|
71
|
-
"blockly": "^11.2.
|
|
72
|
-
"chai": "^5.
|
|
71
|
+
"blockly": "^11.2.2",
|
|
72
|
+
"chai": "^5.2.0",
|
|
73
73
|
"chai-as-promised": "^8.0.1",
|
|
74
74
|
"construct-style-sheets-polyfill": "^3.1.0",
|
|
75
75
|
"cross-env": "^7.0.3",
|
|
76
76
|
"dayjs": "^1.11.13",
|
|
77
77
|
"del": "^8.0.0",
|
|
78
|
-
"dock-spawn-ts": "^3.
|
|
79
|
-
"es-module-shims": "
|
|
80
|
-
"eslint": "^9.
|
|
78
|
+
"dock-spawn-ts": "^3.3.0",
|
|
79
|
+
"es-module-shims": "2.0.10",
|
|
80
|
+
"eslint": "^9.23.0",
|
|
81
81
|
"esprima-next": "^6.0.3",
|
|
82
82
|
"glob-stream": "^8.0.2",
|
|
83
83
|
"gulp": "^5.0.0",
|
|
84
84
|
"gulp-git": "^2.11.0",
|
|
85
85
|
"gulp-replace": "^1.1.4",
|
|
86
|
-
"long": "^5.
|
|
86
|
+
"long": "^5.3.1",
|
|
87
87
|
"mobile-drag-drop": "^3.0.0-rc.0",
|
|
88
|
-
"mocha": "^11.0
|
|
88
|
+
"mocha": "^11.1.0",
|
|
89
89
|
"monaco-editor": "^0.50.0",
|
|
90
90
|
"nyc": "^17.1.0",
|
|
91
91
|
"sinon-chai": "^4.0.0",
|
|
92
92
|
"toastify-js": "^1.12.0",
|
|
93
93
|
"ts-node": "^10.9.2",
|
|
94
94
|
"tslib": "^2.8.1",
|
|
95
|
-
"typescript": "^5.
|
|
95
|
+
"typescript": "^5.8.2",
|
|
96
96
|
"typescript-json-schema": "^0.65.1",
|
|
97
|
-
"wunderbaum": "0.
|
|
97
|
+
"wunderbaum": "0.13.0"
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -51,8 +51,9 @@ declare var RUNTIME: {
|
|
|
51
51
|
height?: string;
|
|
52
52
|
left?: string;
|
|
53
53
|
top?: string;
|
|
54
|
+
cssClass?: string;
|
|
54
55
|
}): Promise<void>;
|
|
55
|
-
runSimpleScriptCommand<T extends import('
|
|
56
|
+
runSimpleScriptCommand<T extends import('../scripting/IobrokerWebuiScriptCommands.js').WebuiScriptCommands>(scriptCommand: T): Promise<void>;
|
|
56
57
|
getParentScreen(screen: BaseScreenViewerAndControl, parentlevel?: number): BaseScreenViewerAndControl;
|
|
57
58
|
findParent<T>(element: Element, type: new (...args: any[]) => T, predicate?: (element: Element) => boolean): T;
|
|
58
59
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { OpenDialog, OpenScreen,
|
|
1
|
+
import type { OpenDialog, OpenScreen, WebuiScriptCommands } from "../scripting/IobrokerWebuiScriptCommands.js";
|
|
2
2
|
export declare class Runtime {
|
|
3
3
|
static openScreen(config: Omit<OpenScreen, 'type'>): Promise<void>;
|
|
4
4
|
static openDialog(config: Omit<OpenDialog, 'type'>): Promise<void>;
|
|
5
|
-
static runSimpleScriptCommand<T extends
|
|
5
|
+
static runSimpleScriptCommand<T extends WebuiScriptCommands>(scriptCommand: T): Promise<void>;
|
|
6
6
|
static getParentScreen(screen: BaseScreenViewerAndControl, parentLevel?: number): BaseScreenViewerAndControl;
|
|
7
7
|
static findParent<T>(element: Element, type: new (...args: any[]) => T, predicate?: (element: Element) => boolean): T;
|
|
8
8
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseCustomWebComponentConstructorAppend, css, html } from "@node-projects/base-custom-webcomponent";
|
|
2
|
-
import { DocumentContainer, } from "@node-projects/web-component-designer";
|
|
2
|
+
import { DocumentContainer, PropertiesHelper, } from "@node-projects/web-component-designer";
|
|
3
3
|
import { iobrokerHandler } from "../common/IobrokerHandler.js";
|
|
4
4
|
export const defaultNewStyle = `:host {
|
|
5
5
|
}
|
|
@@ -117,19 +117,43 @@ export class IobrokerWebuiScreenEditor extends BaseCustomWebComponentConstructor
|
|
|
117
117
|
if (this.#bindingsEnabled != value) {
|
|
118
118
|
this.#bindingsEnabled == value;
|
|
119
119
|
if (value) {
|
|
120
|
-
this.
|
|
120
|
+
this.applyBindings();
|
|
121
121
|
}
|
|
122
122
|
else {
|
|
123
|
-
this.
|
|
124
|
-
this._styleBindings?.forEach(x => x());
|
|
123
|
+
this.removeBindings();
|
|
125
124
|
}
|
|
126
125
|
}
|
|
127
126
|
}
|
|
128
127
|
relativeBindingsPrefix = '';
|
|
129
128
|
applyBindings() {
|
|
130
129
|
this.removeBindings();
|
|
131
|
-
if (this.bindingsEnabled)
|
|
132
|
-
|
|
130
|
+
if (this.bindingsEnabled) {
|
|
131
|
+
try {
|
|
132
|
+
for (let p in this.properties) {
|
|
133
|
+
Object.defineProperty(this.documentContainer.designerView.designerCanvas.rootDesignItem.element, p, {
|
|
134
|
+
get() {
|
|
135
|
+
return this['_' + p];
|
|
136
|
+
},
|
|
137
|
+
set(newValue) {
|
|
138
|
+
if (this['_' + p] !== newValue) {
|
|
139
|
+
this['_' + p] = newValue;
|
|
140
|
+
this._bindingsRefresh(p);
|
|
141
|
+
this.documentContainer.designerView.designerCanvas.rootDesignItem.element.dispatchEvent(new CustomEvent(PropertiesHelper.camelToDashCase(p) + '-changed', { detail: { newValue } }));
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
enumerable: true,
|
|
145
|
+
configurable: true,
|
|
146
|
+
});
|
|
147
|
+
if (this.properties[p].default) {
|
|
148
|
+
this.documentContainer.designerView.designerCanvas.rootDesignItem.element['_' + p] = this.properties[p].default;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
catch (err) {
|
|
153
|
+
console.warn("applyBindings()", err);
|
|
154
|
+
}
|
|
155
|
+
this._webuiBindings = window.appShell.bindingsHelper.applyAllBindings(this.documentContainer.designerView.designerCanvas.rootDesignItem.element.shadowRoot, this.relativeBindingsPrefix, this.documentContainer.designerView.designerCanvas.rootDesignItem.element);
|
|
156
|
+
}
|
|
133
157
|
}
|
|
134
158
|
removeBindings() {
|
|
135
159
|
this._webuiBindings?.forEach(x => x());
|
|
@@ -295,20 +295,20 @@ export class IobrokerWebuiSolutionExplorer extends BaseCustomWebComponentConstru
|
|
|
295
295
|
}], event);
|
|
296
296
|
};
|
|
297
297
|
return {
|
|
298
|
-
title: 'Style',
|
|
298
|
+
title: 'Screens Style',
|
|
299
299
|
folder: false,
|
|
300
300
|
contextMenu: (e, data) => ctxMenu(e),
|
|
301
301
|
dblclick: (e, data) => {
|
|
302
|
-
window.appShell.openGlobalStyleEditor(iobrokerHandler.config.globalStyle ?? '', '
|
|
302
|
+
window.appShell.openGlobalStyleEditor(iobrokerHandler.config.globalStyle ?? '', 'screens style', 'globalStyle');
|
|
303
303
|
}
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
306
|
_createFontDeclarationsNode() {
|
|
307
307
|
return {
|
|
308
|
-
title: '
|
|
308
|
+
title: 'Global Style',
|
|
309
309
|
folder: false,
|
|
310
310
|
dblclick: (e, data) => {
|
|
311
|
-
window.appShell.openGlobalStyleEditor(iobrokerHandler.config.fontDeclarations ?? '', '
|
|
311
|
+
window.appShell.openGlobalStyleEditor(iobrokerHandler.config.fontDeclarations ?? '', 'global style', 'fontDeclarations');
|
|
312
312
|
}
|
|
313
313
|
};
|
|
314
314
|
}
|
|
@@ -489,6 +489,10 @@
|
|
|
489
489
|
"closeable": {
|
|
490
490
|
"type": "boolean"
|
|
491
491
|
},
|
|
492
|
+
"cssClass": {
|
|
493
|
+
"description": "css class to apply to dialog",
|
|
494
|
+
"type": "string"
|
|
495
|
+
},
|
|
492
496
|
"height": {
|
|
493
497
|
"type": "string"
|
|
494
498
|
},
|
|
@@ -522,6 +526,7 @@
|
|
|
522
526
|
}
|
|
523
527
|
},
|
|
524
528
|
"propertyOrder": [
|
|
529
|
+
"cssClass",
|
|
525
530
|
"type",
|
|
526
531
|
"screen",
|
|
527
532
|
"title",
|
|
@@ -973,9 +978,6 @@
|
|
|
973
978
|
{
|
|
974
979
|
"$ref": "#/definitions/OpenUrl"
|
|
975
980
|
},
|
|
976
|
-
{
|
|
977
|
-
"$ref": "#/definitions/OpenDialog"
|
|
978
|
-
},
|
|
979
981
|
{
|
|
980
982
|
"$ref": "#/definitions/CloseDialog"
|
|
981
983
|
},
|
|
@@ -1069,6 +1071,9 @@
|
|
|
1069
1071
|
{
|
|
1070
1072
|
"$ref": "#/definitions/OpenScreen"
|
|
1071
1073
|
},
|
|
1074
|
+
{
|
|
1075
|
+
"$ref": "#/definitions/OpenDialog"
|
|
1076
|
+
},
|
|
1072
1077
|
{
|
|
1073
1078
|
"$ref": "#/definitions/OpenScreenInScreenViewer"
|
|
1074
1079
|
}
|
|
@@ -3,10 +3,10 @@ export class IoBrokerWebuiDialog extends BaseCustomWebComponentConstructorAppend
|
|
|
3
3
|
container;
|
|
4
4
|
uniqueId;
|
|
5
5
|
static template = html `
|
|
6
|
-
<div id="root" class="dialog-box">
|
|
7
|
-
<h3 id="head" class="dialog-title"> </h3>
|
|
8
|
-
<a id="close" href="javascript:;" class="dialog-close" title="Close">×</a>
|
|
9
|
-
<div id="content" class="dialog-content"></div>
|
|
6
|
+
<div id="root" part="box" class="dialog-box">
|
|
7
|
+
<h3 id="head" part="head" class="dialog-title"> </h3>
|
|
8
|
+
<a id="close" part="close" href="javascript:;" class="dialog-close" title="Close">×</a>
|
|
9
|
+
<div id="content" part="content" class="dialog-content"></div>
|
|
10
10
|
</div>`;
|
|
11
11
|
static style = css `
|
|
12
12
|
#root {
|
|
@@ -146,6 +146,9 @@ export class IoBrokerWebuiDialog extends BaseCustomWebComponentConstructorAppend
|
|
|
146
146
|
if (options.closeable === false || options.closeable === true) {
|
|
147
147
|
dlg.closeable = options.closeable;
|
|
148
148
|
}
|
|
149
|
+
if (options.cssClass) {
|
|
150
|
+
dlg.className = options.cssClass;
|
|
151
|
+
}
|
|
149
152
|
document.getElementById('overlayLayer').appendChild(dlg);
|
|
150
153
|
return uniqueId;
|
|
151
154
|
}
|
|
@@ -14,6 +14,18 @@ let ScreenViewer = class ScreenViewer extends BaseCustomWebComponentConstructorA
|
|
|
14
14
|
display: block;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
*[node-projects-hide-at-run-time] {
|
|
18
|
+
display: none !important;
|
|
19
|
+
}`;
|
|
20
|
+
static styleIfFromScreen = css `
|
|
21
|
+
:host {
|
|
22
|
+
background: transparent;
|
|
23
|
+
border: none;
|
|
24
|
+
transform: none;
|
|
25
|
+
padding: 0;
|
|
26
|
+
margin: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
17
29
|
*[node-projects-hide-at-run-time] {
|
|
18
30
|
display: none !important;
|
|
19
31
|
}`;
|
|
@@ -179,39 +191,22 @@ let ScreenViewer = class ScreenViewer extends BaseCustomWebComponentConstructorA
|
|
|
179
191
|
else
|
|
180
192
|
this._rootShadow.adoptedStyleSheets = [ScreenViewer_1.style];
|
|
181
193
|
if (this._useStyleFromScreenForViewer) {
|
|
182
|
-
this.shadowRoot.adoptedStyleSheets = this._rootShadow.adoptedStyleSheets;
|
|
183
|
-
this._root.style.setProperty('background', 'transparent', 'important');
|
|
184
|
-
this._root.style.setProperty('border', 'none', 'important');
|
|
185
|
-
this._root.style.setProperty('transform', 'none', 'important');
|
|
186
|
-
this._root.style.setProperty('padding', '0', 'important');
|
|
187
|
-
this._root.style.setProperty('margin', '0', 'important');
|
|
188
|
-
this.style.setProperty('display', 'block', 'important');
|
|
189
|
-
}
|
|
190
|
-
else {
|
|
191
|
-
this.shadowRoot.adoptedStyleSheets = [];
|
|
192
|
-
this._root.style.removeProperty('background');
|
|
193
|
-
this._root.style.removeProperty('border');
|
|
194
|
-
this._root.style.removeProperty('transform');
|
|
195
|
-
this._root.style.removeProperty('padding');
|
|
196
|
-
this._root.style.removeProperty('margin');
|
|
197
|
-
this.style.removeProperty('display');
|
|
194
|
+
this.shadowRoot.adoptedStyleSheets = [ScreenViewer_1.styleIfFromScreen, ...this._rootShadow.adoptedStyleSheets];
|
|
198
195
|
}
|
|
199
196
|
let myDocument;
|
|
200
|
-
//@ts-ignore
|
|
201
197
|
if (Document.parseHTMLUnsafe && !isFirefox) {
|
|
202
|
-
|
|
203
|
-
myDocument = Document.parseHTMLUnsafe(html);
|
|
198
|
+
this._rootShadow.setHTMLUnsafe(html);
|
|
204
199
|
}
|
|
205
200
|
else {
|
|
206
201
|
//@ts-ignore
|
|
207
202
|
myDocument = new DOMParser().parseFromString(html, 'text/html', { includeShadowRoots: true });
|
|
203
|
+
const fragment = document.createDocumentFragment();
|
|
204
|
+
for (const n of myDocument.head.childNodes)
|
|
205
|
+
fragment.appendChild(n);
|
|
206
|
+
for (const n of myDocument.body.childNodes)
|
|
207
|
+
fragment.appendChild(n);
|
|
208
|
+
this._rootShadow.appendChild(fragment);
|
|
208
209
|
}
|
|
209
|
-
const fragment = document.createDocumentFragment();
|
|
210
|
-
for (const n of myDocument.head.childNodes)
|
|
211
|
-
fragment.appendChild(n);
|
|
212
|
-
for (const n of myDocument.body.childNodes)
|
|
213
|
-
fragment.appendChild(n);
|
|
214
|
-
this._rootShadow.appendChild(fragment);
|
|
215
210
|
const res = window.appShell.bindingsHelper.applyAllBindings(this._rootShadow, this.relativeSignalsPath, this);
|
|
216
211
|
if (this._iobBindings)
|
|
217
212
|
this._iobBindings.push(...res);
|
|
@@ -36,6 +36,7 @@ export class IobrokerWebuiScriptSystem extends ScriptSystem {
|
|
|
36
36
|
const title = await this.getValue(command.title, context);
|
|
37
37
|
const moveable = await this.getValue(command.moveable, context);
|
|
38
38
|
const closeable = await this.getValue(command.closeable, context);
|
|
39
|
+
const cssClass = await this.getValue(command.cssClass, context);
|
|
39
40
|
let width = await this.getValue(command.width, context);
|
|
40
41
|
let height = await this.getValue(command.height, context);
|
|
41
42
|
const left = await this.getValue(command.left, context);
|
|
@@ -47,7 +48,7 @@ export class IobrokerWebuiScriptSystem extends ScriptSystem {
|
|
|
47
48
|
width = await (await iobrokerHandler.getWebuiObject('screen', screen)).settings.width;
|
|
48
49
|
if (!height)
|
|
49
50
|
height = await (await iobrokerHandler.getWebuiObject('screen', screen)).settings.height;
|
|
50
|
-
IoBrokerWebuiDialog.openDialog({ title, content: sv, moveable, closeable, width, height, top, left });
|
|
51
|
+
IoBrokerWebuiDialog.openDialog({ title, content: sv, moveable, closeable, width, height, top, left, cssClass });
|
|
51
52
|
break;
|
|
52
53
|
}
|
|
53
54
|
default: {
|
package/www/index.html
CHANGED
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
</button>
|
|
219
219
|
<button data-command="save" title="save" disabled><img src="./node_modules/@node-projects/web-component-designer/assets/icons/save.svg"></button>
|
|
220
220
|
<div style="margin-left: 30px;">
|
|
221
|
-
webui - 1.
|
|
221
|
+
webui - 1.27.0 - 875a61d
|
|
222
222
|
</div>
|
|
223
223
|
<button style="margin-left: 30px;" data-command="paste" title="paste" disabled><img
|
|
224
224
|
src="./node_modules/@node-projects/web-component-designer/assets/icons/paste.svg"></button>
|
|
@@ -252,7 +252,7 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options)=>{
|
|
|
252
252
|
// :
|
|
253
253
|
if (!match(/^:\s*/)) return error("property missing ':'");
|
|
254
254
|
// val
|
|
255
|
-
const val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/);
|
|
255
|
+
const val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|[^)])*?\)|[^};])+)/);
|
|
256
256
|
const ret = pos({
|
|
257
257
|
type: (0, $b2e137848b48cf4f$export$9be5dd6e61d5d73a).declaration,
|
|
258
258
|
property: propValue.replace($d708735ed1303b43$var$commentre, ''),
|
|
@@ -854,12 +854,12 @@ export class AdminConnection extends Connection {
|
|
|
854
854
|
clearNotifications(host, category) {
|
|
855
855
|
return this.request({
|
|
856
856
|
executor: (resolve, reject, timeout) => {
|
|
857
|
-
this._socket.emit('sendToHost', host, 'clearNotifications', { category },
|
|
857
|
+
this._socket.emit('sendToHost', host, 'clearNotifications', { category }, result => {
|
|
858
858
|
if (timeout.elapsed) {
|
|
859
859
|
return;
|
|
860
860
|
}
|
|
861
861
|
timeout.clearTimeout();
|
|
862
|
-
resolve(
|
|
862
|
+
resolve(result);
|
|
863
863
|
});
|
|
864
864
|
},
|
|
865
865
|
});
|
|
@@ -941,7 +941,8 @@ export class AdminConnection extends Connection {
|
|
|
941
941
|
return;
|
|
942
942
|
}
|
|
943
943
|
timeout.clearTimeout();
|
|
944
|
-
|
|
944
|
+
const result = await res.json();
|
|
945
|
+
resolve(result);
|
|
945
946
|
}
|
|
946
947
|
catch (e) {
|
|
947
948
|
reject(`getCurrentSession: ${e}`);
|
|
@@ -964,7 +965,9 @@ export class AdminConnection extends Connection {
|
|
|
964
965
|
if (err) {
|
|
965
966
|
reject(err);
|
|
966
967
|
}
|
|
967
|
-
|
|
968
|
+
else {
|
|
969
|
+
resolve(namespace);
|
|
970
|
+
}
|
|
968
971
|
});
|
|
969
972
|
},
|
|
970
973
|
});
|
|
@@ -1,5 +1,59 @@
|
|
|
1
1
|
import type { ConnectionProps, LogMessage } from './ConnectionProps.js';
|
|
2
2
|
import type { EmitEventHandler, ListenEventHandler, SocketClient } from './SocketClient.js';
|
|
3
|
+
export interface OAuth2Response {
|
|
4
|
+
/** The access token */
|
|
5
|
+
access_token: string;
|
|
6
|
+
/** The time in seconds when the access token expires, e.g., 3600 for 1 hour */
|
|
7
|
+
expires_in: number;
|
|
8
|
+
/** The type of the token */
|
|
9
|
+
token_type: 'Bearer' | 'JWT';
|
|
10
|
+
/** The refresh token */
|
|
11
|
+
refresh_token: string;
|
|
12
|
+
/** The time in seconds when the refresh token expires, e.g., 600 for 10 minutes */
|
|
13
|
+
refresh_token_expires_in: number;
|
|
14
|
+
}
|
|
15
|
+
export interface StoredTokens {
|
|
16
|
+
refresh_token: string;
|
|
17
|
+
access_token: string;
|
|
18
|
+
expires_in: Date;
|
|
19
|
+
refresh_token_expires_in: Date;
|
|
20
|
+
stayLoggedIn: boolean;
|
|
21
|
+
owner: string | undefined;
|
|
22
|
+
}
|
|
23
|
+
export interface SocketACL {
|
|
24
|
+
user: `system.user.${string}` | '';
|
|
25
|
+
groups: `system.group.${string}`[];
|
|
26
|
+
object?: {
|
|
27
|
+
read: boolean;
|
|
28
|
+
list: boolean;
|
|
29
|
+
write: boolean;
|
|
30
|
+
delete: boolean;
|
|
31
|
+
};
|
|
32
|
+
state?: {
|
|
33
|
+
list: boolean;
|
|
34
|
+
read: boolean;
|
|
35
|
+
write: boolean;
|
|
36
|
+
delete: boolean;
|
|
37
|
+
create: boolean;
|
|
38
|
+
};
|
|
39
|
+
users?: {
|
|
40
|
+
create: boolean;
|
|
41
|
+
delete: boolean;
|
|
42
|
+
write: boolean;
|
|
43
|
+
};
|
|
44
|
+
other?: {
|
|
45
|
+
http: boolean;
|
|
46
|
+
execute: boolean;
|
|
47
|
+
sendto: boolean;
|
|
48
|
+
};
|
|
49
|
+
file?: {
|
|
50
|
+
list: boolean;
|
|
51
|
+
create: boolean;
|
|
52
|
+
write: boolean;
|
|
53
|
+
read: boolean;
|
|
54
|
+
delete: boolean;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
3
57
|
/** Possible progress states. */
|
|
4
58
|
export declare enum PROGRESS {
|
|
5
59
|
/** The socket is connecting. */
|
|
@@ -67,6 +121,8 @@ export declare class Connection<CustomListenEvents extends Record<keyof CustomLi
|
|
|
67
121
|
constructor(props: Partial<ConnectionProps>);
|
|
68
122
|
private applyDefaultProps;
|
|
69
123
|
private readonly props;
|
|
124
|
+
readonly connId: string;
|
|
125
|
+
private lastAccessToken;
|
|
70
126
|
private ignoreState;
|
|
71
127
|
private connected;
|
|
72
128
|
private subscribed;
|
|
@@ -79,7 +135,7 @@ export declare class Connection<CustomListenEvents extends Record<keyof CustomLi
|
|
|
79
135
|
private readonly objectsSubscribes;
|
|
80
136
|
private objects;
|
|
81
137
|
private states;
|
|
82
|
-
acl:
|
|
138
|
+
acl: SocketACL | null;
|
|
83
139
|
isSecure: boolean;
|
|
84
140
|
onReadyDone: boolean;
|
|
85
141
|
private readonly onConnectionHandlers;
|
|
@@ -96,7 +152,8 @@ export declare class Connection<CustomListenEvents extends Record<keyof CustomLi
|
|
|
96
152
|
private _instanceSubscriptions;
|
|
97
153
|
/** Cache for server requests */
|
|
98
154
|
private readonly _promises;
|
|
99
|
-
protected _authTimer:
|
|
155
|
+
protected _authTimer: ReturnType<typeof setTimeout> | null;
|
|
156
|
+
protected _refreshTimer: ReturnType<typeof setTimeout> | null;
|
|
100
157
|
protected _systemConfig?: ioBroker.SystemConfigObject;
|
|
101
158
|
/** The "system.config" object */
|
|
102
159
|
get systemConfig(): Readonly<ioBroker.SystemConfigObject> | undefined;
|
|
@@ -117,6 +174,29 @@ export declare class Connection<CustomListenEvents extends Record<keyof CustomLi
|
|
|
117
174
|
* Called internally.
|
|
118
175
|
*/
|
|
119
176
|
private onPreConnect;
|
|
177
|
+
static readTokens(): StoredTokens | null;
|
|
178
|
+
static saveTokensStatic(data: OAuth2Response, stayLoggedIn: boolean, owner?: string): void;
|
|
179
|
+
saveTokens(data: OAuth2Response, stayLoggedIn: boolean): void;
|
|
180
|
+
static deleteTokensStatic(): void;
|
|
181
|
+
/**
|
|
182
|
+
* Destroy tokens if they were created by this connection if they expired or invalid
|
|
183
|
+
*
|
|
184
|
+
* @param stayLoggedIn if stored in localStorage or in sessionStorage
|
|
185
|
+
* @param logout if logout is requested
|
|
186
|
+
*/
|
|
187
|
+
deleteTokens(stayLoggedIn: boolean, logout?: boolean): void;
|
|
188
|
+
private onAccessTokenUpdated;
|
|
189
|
+
private updateTokenExpiration;
|
|
190
|
+
private refreshTokens;
|
|
191
|
+
/**
|
|
192
|
+
* Attempts to acquire the semaphore lock.
|
|
193
|
+
*
|
|
194
|
+
* @returns True if the lock was acquired successfully; otherwise, false.
|
|
195
|
+
*/
|
|
196
|
+
acquireTokenLock(): boolean;
|
|
197
|
+
/** Releases the semaphore lock if it's owned by the given connection ID. */
|
|
198
|
+
releaseTokenLock(): void;
|
|
199
|
+
private checkAccessTokenExpire;
|
|
120
200
|
/**
|
|
121
201
|
* Checks if running in ioBroker cloud
|
|
122
202
|
*/
|