@iobroker/json-config 9.1.2 → 10.0.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"src/","sources":["JsonConfigComponent/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAwB,IAAI,EAAiD,MAAM,0BAA0B,CAAC;AAKrH,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,IAAI,MAAM,mBAAmB,CAAC;AAErC,+FAA+F;AAC/F,iGAAiG;AACjG,gGAAgG;AAChG,2EAA2E;AAC3E,IAAI,CAAC,kBAAkB,CAAC;IACpB,EAAE;IACF,EAAE;IACF,EAAE;IACF,EAAE;IACF,EAAE;IACF,EAAE;IACF,EAAE;IACF,EAAE;IACF,EAAE;IACF,EAAE;IACF,OAAO,EAAE,IAAI;CAChB,CAAC,CAAC;AAEH,sEAAsE;AACtE,MAAM,sBAAsB,GAAG,KAAK,CAAC;AAErC,MAAM,MAAM,GAAwC;IACh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AC,GAAG,EAAE,CAAC;QACxC,CAAC;aAAM,IAAI,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;YACxC,OAAO,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC1C,CAAC;IACL,CAAC,CAAC;IAEF,MAAM;QACF,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC7C,OAAO,oBAAC,cAAc,OAAG,CAAC;QAC9B,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,KAAK,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;YACpD,IAAI,CAAC,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;YAChD,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAClD,CAAC;QAED,OAAO,CACH,6BACI,KAAK,EAAE;gBACH,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;gBACpF,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK;gBACnB,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;aAC7B,IAEA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CACjC,CACT,CAAC;IACN,CAAC;CACJ;AAED,eAAe,mBAAmB,CAAC","sourcesContent":["import React, { Component, type JSX } from 'react';\n\nimport { LinearProgress } from '@mui/material';\n\nimport { type AdminConnection, I18n, type ThemeName, type ThemeType, type IobTheme } from '@iobroker/gui-components';\n\nimport type { BackEndCommand, ConfigItemPanel, ConfigItemTabs, JsonConfigContext, JsonConfigHostInfo } from '../types';\nimport type ConfigGeneric from './ConfigGeneric';\nimport { type DeviceManagerPropsProps, type ConfigGenericProps } from './ConfigGeneric';\nimport ConfigTabs from './ConfigTabs';\nimport ConfigPanel from './ConfigPanel';\nimport { StatePool } from './statePool';\n\nimport de from './i18n/de.json';\nimport en from './i18n/en.json';\nimport ru from './i18n/ru.json';\nimport pt from './i18n/pt.json';\nimport nl from './i18n/nl.json';\nimport fr from './i18n/fr.json';\nimport it from './i18n/it.json';\nimport es from './i18n/es.json';\nimport pl from './i18n/pl.json';\nimport uk from './i18n/uk.json';\nimport zhCn from './i18n/zh-cn.json';\n\n// Register the `jc_*` translations when this module is loaded, NOT when the component is first\n// constructed. `JsonConfig` renders its own toolbar (the export/import buttons) before it mounts\n// `JsonConfigComponent` as a child, so a constructor-based registration came too late and those\n// labels rendered as raw keys such as `jc_Import settings from JSON file`.\nI18n.extendTranslations({\n en,\n de,\n ru,\n pt,\n nl,\n fr,\n it,\n es,\n pl,\n uk,\n 'zh-cn': zhCn,\n});\n\n/** Timeout for the request of the docker information from the host */\nconst DOCKER_INFO_TIMEOUT_MS = 3_000;\n\nconst styles: Record<string, React.CSSProperties> = {\n root: {\n width: '100%',\n height: '100%',\n // The root panel or the tabs must use the whole available height\n display: 'flex',\n flexDirection: 'column',\n },\n};\n\ninterface JsonConfigComponentProps {\n socket: AdminConnection;\n themeName: ThemeName;\n themeType: ThemeType;\n adapterName: string;\n instance: number;\n isFloatComma: boolean;\n dateFormat: string;\n imagePrefix?: string;\n schema: ConfigItemTabs | ConfigItemPanel;\n common?: Record<string, any>;\n data: Record<string, any>;\n updateData?: number;\n onError: (error: boolean) => void;\n onChange?: (data: Record<string, any> | null, changed: boolean | undefined, saveConfig: boolean) => void;\n /** Backend request to refresh data */\n onBackEndCommand?: (command?: BackEndCommand) => void;\n custom?: boolean;\n onValueChange?: (attr: string, value: any, saveConfig: boolean) => void;\n embedded?: boolean;\n multiEdit?: boolean;\n instanceObj?: ioBroker.InstanceObject;\n customObj?: ioBroker.Object;\n customs?: Record<string, typeof ConfigGeneric>;\n DeviceManager?: React.FC<DeviceManagerPropsProps>;\n style?: React.CSSProperties;\n theme: IobTheme;\n expertMode?: boolean;\n withoutSaveButtons?: boolean;\n /** User can provide their own components for specific input fields */\n customComponents?: { [componentType: string]: typeof ConfigGeneric<ConfigGenericProps, any> };\n}\n\ninterface JsonConfigComponentState {\n originalData: string;\n changed: boolean;\n errors: Record<string, string>;\n systemConfig: ioBroker.SystemConfigCommon | null;\n hostInfo: JsonConfigHostInfo | null;\n updateData?: number;\n alive: boolean;\n commandRunning: boolean;\n schema: ConfigItemTabs | ConfigItemPanel;\n}\n\nexport class JsonConfigComponent extends Component<JsonConfigComponentProps, JsonConfigComponentState> {\n private readonly forceUpdateHandlers: Record<string, (data: any) => void>;\n private errorTimeout: ReturnType<typeof setTimeout> | null = null;\n private errorCached: Record<string, string> | null = null;\n private oContext: JsonConfigContext | undefined;\n private cachedObjects: Record<string, ioBroker.Object | null> = {};\n /** Subscriptions of the elements, that use the `dependsOnStates` attribute */\n private readonly statePool: StatePool;\n constructor(props: JsonConfigComponentProps) {\n super(props);\n\n this.statePool = new StatePool(props.socket);\n\n this.state = {\n originalData: JSON.stringify(this.props.data),\n changed: false,\n errors: {},\n updateData: this.props.updateData || 0,\n systemConfig: null,\n hostInfo: null,\n alive: false,\n commandRunning: false,\n schema: JSON.parse(JSON.stringify(this.props.schema)),\n };\n\n this.forceUpdateHandlers = {};\n\n this.buildDependencies(this.state.schema);\n\n void this.readData().catch(error => console.error(`Cannot read data: ${error}`));\n }\n\n static getDerivedStateFromProps(\n props: JsonConfigComponentProps,\n state: JsonConfigComponentState,\n ): Partial<JsonConfigComponentState> | null {\n if (props.updateData !== state.updateData) {\n return {\n updateData: props.updateData,\n originalData: JSON.stringify(props.data),\n schema: JSON.parse(JSON.stringify(props.schema)),\n };\n }\n return null;\n }\n\n static async loadI18n(\n socket: AdminConnection,\n i18n: boolean | string | Record<string, Record<ioBroker.Languages, string>> | undefined,\n adapterName: string,\n ): Promise<string> {\n if (i18n === true || (i18n && typeof i18n === 'string')) {\n const lang = I18n.getLanguage();\n const path = typeof i18n === 'string' ? i18n : 'i18n';\n let exists = await socket.fileExists(`${adapterName}.admin`, `${path}/${lang}.json`);\n let fileName;\n if (exists) {\n fileName = `${path}/${lang}.json`;\n } else {\n exists = await socket.fileExists(`${adapterName}.admin`, `${path}/${lang}/translations.json`);\n if (exists) {\n fileName = `${path}/${lang}/translations.json`;\n } else if (lang !== 'en') {\n // fallback to english\n exists = await socket.fileExists(`${adapterName}.admin`, `${path}/en.json`);\n if (exists) {\n fileName = `${path}/en.json`;\n } else {\n exists = await socket.fileExists(`${adapterName}.admin`, `${path}/en/translations.json`);\n if (exists) {\n fileName = `${path}/en/translations.json`;\n }\n }\n }\n }\n\n if (fileName) {\n const jsonFile = await socket.readFile(`${adapterName}.admin`, fileName);\n let jsonStr: string;\n if (jsonFile.file !== undefined) {\n jsonStr = jsonFile.file;\n } else {\n // @ts-expect-error deprecated\n jsonStr = jsonFile;\n }\n\n try {\n const json = JSON.parse(jsonStr);\n // apply file to I18n\n I18n.extendTranslations(json, lang);\n } catch (e) {\n console.error(`Cannot parse language file \"${adapterName}.admin/${fileName}: ${e}`);\n return '';\n }\n return fileName;\n }\n console.warn(`Cannot find i18n for ${adapterName} / ${fileName}`);\n return '';\n }\n if (i18n && typeof i18n === 'object') {\n I18n.extendTranslations(i18n);\n return '';\n }\n return '';\n }\n\n componentWillUnmount(): void {\n // Release the subscriptions of all elements, that used `dependsOnStates`\n this.statePool.destroy();\n }\n\n onCommandRunning = (commandRunning: boolean): void => this.setState({ commandRunning });\n\n async readData(): Promise<void> {\n let systemConfig: ioBroker.SystemConfigObject | undefined;\n try {\n if (this.props.socket.getCompactSystemConfig) {\n systemConfig = await this.props.socket.getCompactSystemConfig();\n } else {\n systemConfig = ((await this.getCachedObject('system.config')) || undefined) as\n ioBroker.SystemConfigObject | undefined;\n }\n const state = await this.props.socket.getState(\n `system.adapter.${this.props.adapterName}.${this.props.instance}.alive`,\n );\n this.setState(\n {\n systemConfig: systemConfig?.common || ({} as ioBroker.SystemConfigCommon),\n hostInfo: await this.readHostInfo(),\n alive: !!state?.val,\n },\n () => {\n this.updateContext(true);\n if (!this.props.custom) {\n void this.props.socket.subscribeState(\n `system.adapter.${this.props.adapterName}.${this.props.instance}.alive`,\n this.onAlive,\n );\n }\n },\n );\n } catch (error) {\n console.error(`Cannot read system config: ${error}`);\n }\n }\n\n /**\n * Read the information about the host, on which the configured instance runs.\n *\n * The object `system.host.X` is used and not the message `getHostInfo`, because the object can be read\n * even if the host is not running. The result is used for the `os`/`notOs` attributes and for the\n * `_os`, `_arch` and `_host` variables in the JS functions.\n *\n * Only the docker state cannot be read from the object, so it will be requested from the running host,\n * but only if the configuration really uses it.\n *\n * @returns information about the host. The properties are empty if the host could not be read\n */\n async readHostInfo(): Promise<JsonConfigHostInfo> {\n const hostName: string | undefined =\n (this.props.common?.host as string | undefined) || this.props.instanceObj?.common?.host;\n\n const hostObj = hostName\n ? ((await this.getCachedObject(`system.host.${hostName}`)) as ioBroker.HostObject | null)\n : null;\n\n const hostInfo: JsonConfigHostInfo = {\n id: hostName || '',\n os: hostObj?.native?.os?.platform || '',\n osType: hostObj?.native?.os?.type || '',\n arch: hostObj?.native?.os?.arch || '',\n release: hostObj?.native?.os?.release || '',\n nodeVersion: hostObj?.native?.process?.versions?.node || '',\n controllerVersion: hostObj?.common?.installedVersion || '',\n };\n\n if (hostName && JsonConfigComponent.usesDocker(this.props.schema)) {\n try {\n // If the host is not running, the request would only run into the timeout\n const aliveState = await this.props.socket.getState(`system.host.${hostName}.alive`);\n if (aliveState?.val !== false) {\n const info = await this.props.socket.getHostInfoShort(hostName, false, DOCKER_INFO_TIMEOUT_MS);\n if (info) {\n // Older js-controllers do not deliver `dockerInformation`, but `Platform` is 'docker' then\n hostInfo.docker = info.dockerInformation?.isDocker ?? info.Platform === 'docker';\n if (info.dockerInformation?.isOfficial) {\n hostInfo.dockerVersion = info.dockerInformation.officialVersion;\n }\n }\n }\n } catch (e) {\n // The host does not answer or the user has no rights => the docker state stays unknown\n console.warn(`Cannot read the docker information of ${hostName}: ${e as Error}`);\n }\n }\n\n return hostInfo;\n }\n\n /**\n * Check if the configuration uses the docker state of the host.\n *\n * The docker state can only be requested from a running host, so this request will only be done if\n * the `docker` attribute or the `_host.docker` variable is really used in the configuration.\n *\n * @param schema the configuration schema\n * @returns true if the docker state must be read\n */\n static usesDocker(schema: ConfigItemTabs | ConfigItemPanel): boolean {\n const str = JSON.stringify(schema);\n return str.includes('\"docker\":') || str.includes('_host.docker');\n }\n\n onAlive = (_id: string, state?: ioBroker.State | null): void => {\n if (!!state?.val !== this.state.alive) {\n this.setState({ alive: !!state?.val });\n }\n };\n\n onChange = (\n attrOrData: string | Record<string, any> | undefined,\n value: any,\n cb?: () => void,\n saveConfig?: boolean,\n ): void => {\n if (this.props.onValueChange) {\n this.props.onValueChange(attrOrData as string, value, !!saveConfig);\n cb?.();\n } else if (attrOrData && this.props.onChange) {\n const newState: Partial<JsonConfigComponentState> = {\n changed: JSON.stringify(attrOrData) !== this.state.originalData,\n };\n\n this.setState(newState as JsonConfigComponentState, () => {\n this.props.onChange?.(attrOrData as Record<string, any>, !!newState.changed, !!saveConfig);\n cb?.();\n });\n } else if (saveConfig) {\n this.props.onChange?.(null, undefined, saveConfig);\n }\n };\n\n onError = (attr?: string, error?: string): void => {\n this.errorCached = this.errorCached || JSON.parse(JSON.stringify(this.state.errors));\n const errors = this.errorCached;\n if (errors && attr) {\n if (error) {\n errors[attr] = error;\n } else {\n delete errors[attr];\n }\n }\n\n if (this.errorTimeout) {\n clearTimeout(this.errorTimeout);\n this.errorTimeout = null;\n }\n if (JSON.stringify(errors) !== JSON.stringify(this.state.errors)) {\n this.errorTimeout = setTimeout(\n () =>\n this.setState({ errors: this.errorCached || {} }, () => {\n this.errorTimeout = null;\n this.errorCached = null;\n this.props.onError(!!Object.keys(this.state.errors).length);\n }),\n 50,\n );\n } else {\n this.errorCached = null;\n }\n };\n\n flatten(schema: Record<string, any>, _list?: Record<string, any>): Record<string, any> {\n _list = _list || {};\n if (schema.items) {\n Object.keys(schema.items).forEach(attr => {\n _list[attr] = schema.items[attr];\n this.flatten(schema.items[attr], _list);\n });\n }\n\n return _list;\n }\n\n buildDependencies(schema: ConfigItemTabs | ConfigItemPanel): void {\n const attrs = this.flatten(schema as Record<string, any>);\n Object.keys(attrs).forEach(attr => {\n if (attrs[attr].confirm?.alsoDependsOn) {\n attrs[attr].confirm?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].confirmDependsOn = attrs[dep].confirmDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n if (depObj.confirm) {\n depObj.confirm.cancel = 'Undo';\n }\n\n attrs[dep].confirmDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].onChange?.alsoDependsOn) {\n attrs[attr].onChange?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].onChangeDependsOn = attrs[dep].onChangeDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n\n attrs[dep].onChangeDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].hidden?.alsoDependsOn) {\n attrs[attr].hidden?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].hiddenDependsOn = attrs[dep].hiddenDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n\n attrs[dep].hiddenDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].label?.alsoDependsOn) {\n attrs[attr].label?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].labelDependsOn = attrs[dep].labelDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n\n attrs[dep].labelDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].help?.alsoDependsOn) {\n attrs[attr].help?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].helpDependsOn = attrs[dep].helpDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n\n attrs[dep].helpDependsOn.push(depObj);\n }\n });\n }\n });\n }\n\n getCachedObject = async (id: string): Promise<ioBroker.Object | null> => {\n if (this.cachedObjects[id] !== undefined) {\n return this.cachedObjects[id];\n }\n try {\n this.cachedObjects[id] = (await this.props.socket.getObject(id)) ?? null;\n } catch (e) {\n console.error(e);\n this.cachedObjects[id] = null;\n }\n return this.cachedObjects[id];\n };\n\n updateContext(forceUpdate?: boolean): void {\n this.oContext = {\n DeviceManager: this.props.DeviceManager,\n adapterName: this.props.adapterName,\n changeLanguage: this.changeLanguage,\n common: this.props.common,\n customs: this.props.customs,\n dateFormat: this.props.dateFormat,\n embedded: this.props.embedded,\n forceUpdate: this.forceAttrUpdate,\n imagePrefix: this.props.imagePrefix,\n instance: this.props.instance,\n instanceObj: this.props.instanceObj,\n isFloatComma: this.props.isFloatComma,\n multiEdit: this.props.multiEdit,\n onBackEndCommand: this.props.onBackEndCommand,\n onCommandRunning: this.onCommandRunning,\n onValueChange: this.props.onValueChange,\n registerOnForceUpdate: this.registerOnForceUpdate,\n socket: this.props.socket,\n systemConfig: this.state.systemConfig,\n theme: this.props.theme,\n // could be changed dynamically\n themeType: this.props.themeType,\n _themeName: this.props.themeName,\n updateData: this.state.updateData,\n getCachedObject: this.getCachedObject,\n hostInfo: this.state.hostInfo || undefined,\n subscribeStates: this.statePool.subscribe,\n unsubscribeStates: this.statePool.unsubscribe,\n getStateValue: this.statePool.getValue,\n } as JsonConfigContext;\n\n if (forceUpdate) {\n this.forceUpdate();\n }\n }\n\n renderItem(item: ConfigItemTabs | ConfigItemPanel): JSX.Element | null {\n if (!this.oContext) {\n return null;\n }\n if (item.type === 'tabs') {\n return (\n <ConfigTabs\n withoutSaveButtons={this.props.withoutSaveButtons}\n oContext={this.oContext}\n alive={this.state.alive}\n changed={this.state.changed}\n commandRunning={this.state.commandRunning}\n common={this.props.common}\n custom={this.props.custom}\n customObj={this.props.customObj}\n data={this.props.data}\n onChange={this.onChange}\n onError={(attr, error) => this.onError(attr, error)}\n originalData={JSON.parse(this.state.originalData)}\n root\n schema={item}\n expertMode={this.props.expertMode}\n themeName={this.props.themeName}\n customComponents={this.props.customComponents}\n />\n );\n }\n if (\n item.type === 'panel' ||\n // @ts-expect-error type could be empty\n !item.type\n ) {\n return (\n <ConfigPanel\n withoutSaveButtons={this.props.withoutSaveButtons}\n oContext={this.oContext}\n alive={this.state.alive}\n changed={this.state.changed}\n commandRunning={this.state.commandRunning}\n common={this.props.common}\n custom={this.props.custom}\n customObj={this.props.customObj}\n data={this.props.data}\n expertMode={this.props.expertMode}\n index={1000}\n isParentTab={!this.props.embedded && !this.props.withoutSaveButtons}\n onChange={this.onChange}\n onError={(attr, error) => this.onError(attr, error)}\n originalData={JSON.parse(this.state.originalData)}\n root\n schema={item}\n themeName={this.props.themeName}\n customComponents={this.props.customComponents}\n />\n );\n }\n console.error(`Unknown item type in root: ${JSON.stringify(item)}`);\n\n return null;\n }\n\n changeLanguage = (): void => {\n this.forceUpdate();\n };\n\n forceAttrUpdate = (attr: string | string[], data: any): void => {\n if (Array.isArray(attr)) {\n attr.forEach(a => this.forceUpdateHandlers[a] && this.forceUpdateHandlers[a](data));\n } else if (this.forceUpdateHandlers[attr]) {\n this.forceUpdateHandlers[attr](data);\n }\n };\n\n registerOnForceUpdate = (attr: string, cb?: ((data: any) => void) | null): void => {\n if (cb) {\n this.forceUpdateHandlers[attr] = cb;\n } else if (this.forceUpdateHandlers[attr]) {\n delete this.forceUpdateHandlers[attr];\n }\n };\n\n render(): JSX.Element {\n if (!this.state.systemConfig || !this.oContext) {\n return <LinearProgress />;\n }\n\n if (this.oContext._themeName !== this.props.themeName) {\n this.oContext._themeName = this.props.themeName;\n setTimeout(() => this.updateContext(true), 0);\n }\n\n return (\n <div\n style={{\n ...(!this.props.embedded || this.props.withoutSaveButtons ? styles.root : undefined),\n ...this.props.style,\n ...this.state.schema.style,\n }}\n >\n {this.renderItem(this.state.schema)}\n </div>\n );\n }\n}\n\nexport default JsonConfigComponent;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"src/","sources":["JsonConfigComponent/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAwB,IAAI,EAAiD,MAAM,0BAA0B,CAAC;AAMrH,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC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D,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAClD,CAAC;QAED,OAAO,CACH,6BACI,KAAK,EAAE;gBACH,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;gBACpF,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK;gBACnB,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;aAC7B,IAEA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CACjC,CACT,CAAC;IACN,CAAC;CACJ;AAED,eAAe,mBAAmB,CAAC","sourcesContent":["import React, { Component, type JSX } from 'react';\n\nimport { LinearProgress } from '@mui/material';\n\nimport { type AdminConnection, I18n, type ThemeName, type ThemeType, type IobTheme } from '@iobroker/gui-components';\n\nimport type { BackEndCommand, ConfigItemPanel, ConfigItemTabs, JsonConfigContext, JsonConfigHostInfo } from '../types';\nimport type ConfigGeneric from './ConfigGeneric';\nimport { type DeviceManagerPropsProps, type ConfigGenericProps } from './ConfigGeneric';\nimport type { AceEditorComponent } from './wrapper/Components/Editor';\nimport ConfigTabs from './ConfigTabs';\nimport ConfigPanel from './ConfigPanel';\nimport { StatePool } from './statePool';\n\nimport de from './i18n/de.json';\nimport en from './i18n/en.json';\nimport ru from './i18n/ru.json';\nimport pt from './i18n/pt.json';\nimport nl from './i18n/nl.json';\nimport fr from './i18n/fr.json';\nimport it from './i18n/it.json';\nimport es from './i18n/es.json';\nimport pl from './i18n/pl.json';\nimport uk from './i18n/uk.json';\nimport zhCn from './i18n/zh-cn.json';\n\n// Register the `jc_*` translations when this module is loaded, NOT when the component is first\n// constructed. `JsonConfig` renders its own toolbar (the export/import buttons) before it mounts\n// `JsonConfigComponent` as a child, so a constructor-based registration came too late and those\n// labels rendered as raw keys such as `jc_Import settings from JSON file`.\nI18n.extendTranslations({\n en,\n de,\n ru,\n pt,\n nl,\n fr,\n it,\n es,\n pl,\n uk,\n 'zh-cn': zhCn,\n});\n\n/** Timeout for the request of the docker information from the host */\nconst DOCKER_INFO_TIMEOUT_MS = 3_000;\n\nconst styles: Record<string, React.CSSProperties> = {\n root: {\n width: '100%',\n height: '100%',\n // The root panel or the tabs must use the whole available height\n display: 'flex',\n flexDirection: 'column',\n },\n};\n\ninterface JsonConfigComponentProps {\n socket: AdminConnection;\n themeName: ThemeName;\n themeType: ThemeType;\n adapterName: string;\n instance: number;\n isFloatComma: boolean;\n dateFormat: string;\n imagePrefix?: string;\n schema: ConfigItemTabs | ConfigItemPanel;\n common?: Record<string, any>;\n data: Record<string, any>;\n updateData?: number;\n onError: (error: boolean) => void;\n onChange?: (data: Record<string, any> | null, changed: boolean | undefined, saveConfig: boolean) => void;\n /** Backend request to refresh data */\n onBackEndCommand?: (command?: BackEndCommand) => void;\n custom?: boolean;\n onValueChange?: (attr: string, value: any, saveConfig: boolean) => void;\n embedded?: boolean;\n multiEdit?: boolean;\n instanceObj?: ioBroker.InstanceObject;\n customObj?: ioBroker.Object;\n customs?: Record<string, typeof ConfigGeneric>;\n DeviceManager?: React.FC<DeviceManagerPropsProps>;\n /**\n * Code editor for the items `jsonEditor`, `yamlEditor` and the copy dialog of `sendTo`.\n *\n * `AceEditor` from `react-ace`, with the modes `json`, `json5`, `yaml` and the themes\n * `clouds_midnight`, `chrome` registered. It is handed in so that this library does not pull the\n * whole `ace-builds` into every bundle that uses it. Without it the editors are text areas.\n */\n AceEditor?: AceEditorComponent;\n style?: React.CSSProperties;\n theme: IobTheme;\n expertMode?: boolean;\n withoutSaveButtons?: boolean;\n /** User can provide their own components for specific input fields */\n customComponents?: { [componentType: string]: typeof ConfigGeneric<ConfigGenericProps, any> };\n}\n\ninterface JsonConfigComponentState {\n originalData: string;\n changed: boolean;\n errors: Record<string, string>;\n systemConfig: ioBroker.SystemConfigCommon | null;\n hostInfo: JsonConfigHostInfo | null;\n updateData?: number;\n alive: boolean;\n commandRunning: boolean;\n schema: ConfigItemTabs | ConfigItemPanel;\n}\n\nexport class JsonConfigComponent extends Component<JsonConfigComponentProps, JsonConfigComponentState> {\n private readonly forceUpdateHandlers: Record<string, (data: any) => void>;\n private errorTimeout: ReturnType<typeof setTimeout> | null = null;\n private errorCached: Record<string, string> | null = null;\n private oContext: JsonConfigContext | undefined;\n private cachedObjects: Record<string, ioBroker.Object | null> = {};\n /** Subscriptions of the elements, that use the `dependsOnStates` attribute */\n private readonly statePool: StatePool;\n constructor(props: JsonConfigComponentProps) {\n super(props);\n\n this.statePool = new StatePool(props.socket);\n\n this.state = {\n originalData: JSON.stringify(this.props.data),\n changed: false,\n errors: {},\n updateData: this.props.updateData || 0,\n systemConfig: null,\n hostInfo: null,\n alive: false,\n commandRunning: false,\n schema: JSON.parse(JSON.stringify(this.props.schema)),\n };\n\n this.forceUpdateHandlers = {};\n\n this.buildDependencies(this.state.schema);\n\n void this.readData().catch(error => console.error(`Cannot read data: ${error}`));\n }\n\n static getDerivedStateFromProps(\n props: JsonConfigComponentProps,\n state: JsonConfigComponentState,\n ): Partial<JsonConfigComponentState> | null {\n if (props.updateData !== state.updateData) {\n return {\n updateData: props.updateData,\n originalData: JSON.stringify(props.data),\n schema: JSON.parse(JSON.stringify(props.schema)),\n };\n }\n return null;\n }\n\n static async loadI18n(\n socket: AdminConnection,\n i18n: boolean | string | Record<string, Record<ioBroker.Languages, string>> | undefined,\n adapterName: string,\n ): Promise<string> {\n if (i18n === true || (i18n && typeof i18n === 'string')) {\n const lang = I18n.getLanguage();\n const path = typeof i18n === 'string' ? i18n : 'i18n';\n let exists = await socket.fileExists(`${adapterName}.admin`, `${path}/${lang}.json`);\n let fileName;\n if (exists) {\n fileName = `${path}/${lang}.json`;\n } else {\n exists = await socket.fileExists(`${adapterName}.admin`, `${path}/${lang}/translations.json`);\n if (exists) {\n fileName = `${path}/${lang}/translations.json`;\n } else if (lang !== 'en') {\n // fallback to english\n exists = await socket.fileExists(`${adapterName}.admin`, `${path}/en.json`);\n if (exists) {\n fileName = `${path}/en.json`;\n } else {\n exists = await socket.fileExists(`${adapterName}.admin`, `${path}/en/translations.json`);\n if (exists) {\n fileName = `${path}/en/translations.json`;\n }\n }\n }\n }\n\n if (fileName) {\n const jsonFile = await socket.readFile(`${adapterName}.admin`, fileName);\n let jsonStr: string;\n if (jsonFile.file !== undefined) {\n jsonStr = jsonFile.file;\n } else {\n // @ts-expect-error deprecated\n jsonStr = jsonFile;\n }\n\n try {\n const json = JSON.parse(jsonStr);\n // apply file to I18n\n I18n.extendTranslations(json, lang);\n } catch (e) {\n console.error(`Cannot parse language file \"${adapterName}.admin/${fileName}: ${e}`);\n return '';\n }\n return fileName;\n }\n console.warn(`Cannot find i18n for ${adapterName} / ${fileName}`);\n return '';\n }\n if (i18n && typeof i18n === 'object') {\n I18n.extendTranslations(i18n);\n return '';\n }\n return '';\n }\n\n componentWillUnmount(): void {\n // Release the subscriptions of all elements, that used `dependsOnStates`\n this.statePool.destroy();\n }\n\n onCommandRunning = (commandRunning: boolean): void => this.setState({ commandRunning });\n\n async readData(): Promise<void> {\n let systemConfig: ioBroker.SystemConfigObject | undefined;\n try {\n if (this.props.socket.getCompactSystemConfig) {\n systemConfig = await this.props.socket.getCompactSystemConfig();\n } else {\n systemConfig = ((await this.getCachedObject('system.config')) || undefined) as\n ioBroker.SystemConfigObject | undefined;\n }\n const state = await this.props.socket.getState(\n `system.adapter.${this.props.adapterName}.${this.props.instance}.alive`,\n );\n this.setState(\n {\n systemConfig: systemConfig?.common || ({} as ioBroker.SystemConfigCommon),\n hostInfo: await this.readHostInfo(),\n alive: !!state?.val,\n },\n () => {\n this.updateContext(true);\n if (!this.props.custom) {\n void this.props.socket.subscribeState(\n `system.adapter.${this.props.adapterName}.${this.props.instance}.alive`,\n this.onAlive,\n );\n }\n },\n );\n } catch (error) {\n console.error(`Cannot read system config: ${error}`);\n }\n }\n\n /**\n * Read the information about the host, on which the configured instance runs.\n *\n * The object `system.host.X` is used and not the message `getHostInfo`, because the object can be read\n * even if the host is not running. The result is used for the `os`/`notOs` attributes and for the\n * `_os`, `_arch` and `_host` variables in the JS functions.\n *\n * Only the docker state cannot be read from the object, so it will be requested from the running host,\n * but only if the configuration really uses it.\n *\n * @returns information about the host. The properties are empty if the host could not be read\n */\n async readHostInfo(): Promise<JsonConfigHostInfo> {\n const hostName: string | undefined =\n (this.props.common?.host as string | undefined) || this.props.instanceObj?.common?.host;\n\n const hostObj = hostName\n ? ((await this.getCachedObject(`system.host.${hostName}`)) as ioBroker.HostObject | null)\n : null;\n\n const hostInfo: JsonConfigHostInfo = {\n id: hostName || '',\n os: hostObj?.native?.os?.platform || '',\n osType: hostObj?.native?.os?.type || '',\n arch: hostObj?.native?.os?.arch || '',\n release: hostObj?.native?.os?.release || '',\n nodeVersion: hostObj?.native?.process?.versions?.node || '',\n controllerVersion: hostObj?.common?.installedVersion || '',\n };\n\n if (hostName && JsonConfigComponent.usesDocker(this.props.schema)) {\n try {\n // If the host is not running, the request would only run into the timeout\n const aliveState = await this.props.socket.getState(`system.host.${hostName}.alive`);\n if (aliveState?.val !== false) {\n const info = await this.props.socket.getHostInfoShort(hostName, false, DOCKER_INFO_TIMEOUT_MS);\n if (info) {\n // Older js-controllers do not deliver `dockerInformation`, but `Platform` is 'docker' then\n hostInfo.docker = info.dockerInformation?.isDocker ?? info.Platform === 'docker';\n if (info.dockerInformation?.isOfficial) {\n hostInfo.dockerVersion = info.dockerInformation.officialVersion;\n }\n }\n }\n } catch (e) {\n // The host does not answer or the user has no rights => the docker state stays unknown\n console.warn(`Cannot read the docker information of ${hostName}: ${e as Error}`);\n }\n }\n\n return hostInfo;\n }\n\n /**\n * Check if the configuration uses the docker state of the host.\n *\n * The docker state can only be requested from a running host, so this request will only be done if\n * the `docker` attribute or the `_host.docker` variable is really used in the configuration.\n *\n * @param schema the configuration schema\n * @returns true if the docker state must be read\n */\n static usesDocker(schema: ConfigItemTabs | ConfigItemPanel): boolean {\n const str = JSON.stringify(schema);\n return str.includes('\"docker\":') || str.includes('_host.docker');\n }\n\n onAlive = (_id: string, state?: ioBroker.State | null): void => {\n if (!!state?.val !== this.state.alive) {\n this.setState({ alive: !!state?.val });\n }\n };\n\n onChange = (\n attrOrData: string | Record<string, any> | undefined,\n value: any,\n cb?: () => void,\n saveConfig?: boolean,\n ): void => {\n if (this.props.onValueChange) {\n this.props.onValueChange(attrOrData as string, value, !!saveConfig);\n cb?.();\n } else if (attrOrData && this.props.onChange) {\n const newState: Partial<JsonConfigComponentState> = {\n changed: JSON.stringify(attrOrData) !== this.state.originalData,\n };\n\n this.setState(newState as JsonConfigComponentState, () => {\n this.props.onChange?.(attrOrData as Record<string, any>, !!newState.changed, !!saveConfig);\n cb?.();\n });\n } else if (saveConfig) {\n this.props.onChange?.(null, undefined, saveConfig);\n }\n };\n\n onError = (attr?: string, error?: string): void => {\n this.errorCached = this.errorCached || JSON.parse(JSON.stringify(this.state.errors));\n const errors = this.errorCached;\n if (errors && attr) {\n if (error) {\n errors[attr] = error;\n } else {\n delete errors[attr];\n }\n }\n\n if (this.errorTimeout) {\n clearTimeout(this.errorTimeout);\n this.errorTimeout = null;\n }\n if (JSON.stringify(errors) !== JSON.stringify(this.state.errors)) {\n this.errorTimeout = setTimeout(\n () =>\n this.setState({ errors: this.errorCached || {} }, () => {\n this.errorTimeout = null;\n this.errorCached = null;\n this.props.onError(!!Object.keys(this.state.errors).length);\n }),\n 50,\n );\n } else {\n this.errorCached = null;\n }\n };\n\n flatten(schema: Record<string, any>, _list?: Record<string, any>): Record<string, any> {\n _list = _list || {};\n if (schema.items) {\n Object.keys(schema.items).forEach(attr => {\n _list[attr] = schema.items[attr];\n this.flatten(schema.items[attr], _list);\n });\n }\n\n return _list;\n }\n\n buildDependencies(schema: ConfigItemTabs | ConfigItemPanel): void {\n const attrs = this.flatten(schema as Record<string, any>);\n Object.keys(attrs).forEach(attr => {\n if (attrs[attr].confirm?.alsoDependsOn) {\n attrs[attr].confirm?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].confirmDependsOn = attrs[dep].confirmDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n if (depObj.confirm) {\n depObj.confirm.cancel = 'Undo';\n }\n\n attrs[dep].confirmDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].onChange?.alsoDependsOn) {\n attrs[attr].onChange?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].onChangeDependsOn = attrs[dep].onChangeDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n\n attrs[dep].onChangeDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].hidden?.alsoDependsOn) {\n attrs[attr].hidden?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].hiddenDependsOn = attrs[dep].hiddenDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n\n attrs[dep].hiddenDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].label?.alsoDependsOn) {\n attrs[attr].label?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].labelDependsOn = attrs[dep].labelDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n\n attrs[dep].labelDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].help?.alsoDependsOn) {\n attrs[attr].help?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].helpDependsOn = attrs[dep].helpDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n\n attrs[dep].helpDependsOn.push(depObj);\n }\n });\n }\n });\n }\n\n getCachedObject = async (id: string): Promise<ioBroker.Object | null> => {\n if (this.cachedObjects[id] !== undefined) {\n return this.cachedObjects[id];\n }\n try {\n this.cachedObjects[id] = (await this.props.socket.getObject(id)) ?? null;\n } catch (e) {\n console.error(e);\n this.cachedObjects[id] = null;\n }\n return this.cachedObjects[id];\n };\n\n updateContext(forceUpdate?: boolean): void {\n this.oContext = {\n DeviceManager: this.props.DeviceManager,\n AceEditor: this.props.AceEditor,\n adapterName: this.props.adapterName,\n changeLanguage: this.changeLanguage,\n common: this.props.common,\n customs: this.props.customs,\n dateFormat: this.props.dateFormat,\n embedded: this.props.embedded,\n forceUpdate: this.forceAttrUpdate,\n imagePrefix: this.props.imagePrefix,\n instance: this.props.instance,\n instanceObj: this.props.instanceObj,\n isFloatComma: this.props.isFloatComma,\n multiEdit: this.props.multiEdit,\n onBackEndCommand: this.props.onBackEndCommand,\n onCommandRunning: this.onCommandRunning,\n onValueChange: this.props.onValueChange,\n registerOnForceUpdate: this.registerOnForceUpdate,\n socket: this.props.socket,\n systemConfig: this.state.systemConfig,\n theme: this.props.theme,\n // could be changed dynamically\n themeType: this.props.themeType,\n _themeName: this.props.themeName,\n updateData: this.state.updateData,\n getCachedObject: this.getCachedObject,\n hostInfo: this.state.hostInfo || undefined,\n subscribeStates: this.statePool.subscribe,\n unsubscribeStates: this.statePool.unsubscribe,\n getStateValue: this.statePool.getValue,\n } as JsonConfigContext;\n\n if (forceUpdate) {\n this.forceUpdate();\n }\n }\n\n renderItem(item: ConfigItemTabs | ConfigItemPanel): JSX.Element | null {\n if (!this.oContext) {\n return null;\n }\n if (item.type === 'tabs') {\n return (\n <ConfigTabs\n withoutSaveButtons={this.props.withoutSaveButtons}\n oContext={this.oContext}\n alive={this.state.alive}\n changed={this.state.changed}\n commandRunning={this.state.commandRunning}\n common={this.props.common}\n custom={this.props.custom}\n customObj={this.props.customObj}\n data={this.props.data}\n onChange={this.onChange}\n onError={(attr, error) => this.onError(attr, error)}\n originalData={JSON.parse(this.state.originalData)}\n root\n schema={item}\n expertMode={this.props.expertMode}\n themeName={this.props.themeName}\n customComponents={this.props.customComponents}\n />\n );\n }\n if (\n item.type === 'panel' ||\n // @ts-expect-error type could be empty\n !item.type\n ) {\n return (\n <ConfigPanel\n withoutSaveButtons={this.props.withoutSaveButtons}\n oContext={this.oContext}\n alive={this.state.alive}\n changed={this.state.changed}\n commandRunning={this.state.commandRunning}\n common={this.props.common}\n custom={this.props.custom}\n customObj={this.props.customObj}\n data={this.props.data}\n expertMode={this.props.expertMode}\n index={1000}\n isParentTab={!this.props.embedded && !this.props.withoutSaveButtons}\n onChange={this.onChange}\n onError={(attr, error) => this.onError(attr, error)}\n originalData={JSON.parse(this.state.originalData)}\n root\n schema={item}\n themeName={this.props.themeName}\n customComponents={this.props.customComponents}\n />\n );\n }\n console.error(`Unknown item type in root: ${JSON.stringify(item)}`);\n\n return null;\n }\n\n changeLanguage = (): void => {\n this.forceUpdate();\n };\n\n forceAttrUpdate = (attr: string | string[], data: any): void => {\n if (Array.isArray(attr)) {\n attr.forEach(a => this.forceUpdateHandlers[a] && this.forceUpdateHandlers[a](data));\n } else if (this.forceUpdateHandlers[attr]) {\n this.forceUpdateHandlers[attr](data);\n }\n };\n\n registerOnForceUpdate = (attr: string, cb?: ((data: any) => void) | null): void => {\n if (cb) {\n this.forceUpdateHandlers[attr] = cb;\n } else if (this.forceUpdateHandlers[attr]) {\n delete this.forceUpdateHandlers[attr];\n }\n };\n\n render(): JSX.Element {\n if (!this.state.systemConfig || !this.oContext) {\n return <LinearProgress />;\n }\n\n if (this.oContext._themeName !== this.props.themeName) {\n this.oContext._themeName = this.props.themeName;\n setTimeout(() => this.updateContext(true), 0);\n }\n\n return (\n <div\n style={{\n ...(!this.props.embedded || this.props.withoutSaveButtons ? styles.root : undefined),\n ...this.props.style,\n ...this.state.schema.style,\n }}\n >\n {this.renderItem(this.state.schema)}\n </div>\n );\n }\n}\n\nexport default JsonConfigComponent;\n"]}
@@ -1,10 +1,43 @@
1
- import { type JSX } from 'react';
2
- import 'ace-builds/src-min-noconflict/mode-json';
3
- import 'ace-builds/src-min-noconflict/mode-json5';
4
- import 'ace-builds/src-min-noconflict/mode-yaml';
5
- import 'ace-builds/src-min-noconflict/theme-clouds_midnight';
6
- import 'ace-builds/src-min-noconflict/theme-chrome';
7
- import 'ace-builds/src-min-noconflict/ext-language_tools';
1
+ import React, { type JSX } from 'react';
2
+ /**
3
+ * What the code editor of the host has to accept.
4
+ *
5
+ * Described here and not imported from `react-ace`, so that neither this library nor anything that
6
+ * bundles it needs that package - not even for the types. `AceEditor` fulfils it as it is.
7
+ */
8
+ export interface AceEditorProps {
9
+ style?: React.CSSProperties;
10
+ /** `object` because ace also takes a mode instance, this library only passes names */
11
+ mode?: string | object;
12
+ theme?: string;
13
+ width?: string;
14
+ height?: string;
15
+ name?: string;
16
+ value?: string;
17
+ defaultValue?: string;
18
+ /** ace also takes a CSS size like `12pt`, this library only passes numbers */
19
+ fontSize?: number | string;
20
+ readOnly?: boolean;
21
+ showPrintMargin?: boolean;
22
+ showGutter?: boolean;
23
+ highlightActiveLine?: boolean;
24
+ onChange?: (newValue: string) => void;
25
+ setOptions?: Record<string, any>;
26
+ editorProps?: Record<string, any>;
27
+ }
28
+ /**
29
+ * The code editor of the host, in practice `AceEditor` from `react-ace`.
30
+ *
31
+ * It is handed in and not imported, because `react-ace` brings the whole `ace-builds` with it -
32
+ * thousands of files and several megabytes. Everything that bundles this library would carry them
33
+ * along, every custom component of every adapter included, although only three of the sixty config
34
+ * items ever show an editor. The admin has the editor anyway, so it hands it in.
35
+ *
36
+ * The host registers what the editor is used with here: the modes `json`, `json5` and `yaml`, and
37
+ * the themes `clouds_midnight` and `chrome`. Without an editor the fields fall back to a plain text
38
+ * area, so nothing becomes unreadable or unwritable.
39
+ */
40
+ export type AceEditorComponent = React.ComponentType<AceEditorProps>;
8
41
  interface EditorProps {
9
42
  fontSize?: number;
10
43
  value?: string;
@@ -15,6 +48,8 @@ interface EditorProps {
15
48
  themeType: string;
16
49
  editValueMode?: boolean;
17
50
  error?: boolean;
51
+ /** Editor of the host. Without it the text area below is used. */
52
+ AceEditor?: AceEditorComponent;
18
53
  }
19
54
  export default function Editor(props: EditorProps): JSX.Element;
20
55
  export {};
@@ -1,16 +1,5 @@
1
1
  import React from 'react';
2
- import AceEditor from 'react-ace';
3
- import 'ace-builds/src-min-noconflict/mode-json';
4
- import 'ace-builds/src-min-noconflict/mode-json5';
5
- import 'ace-builds/src-min-noconflict/mode-yaml';
6
- // The `worker-*` files are web worker scripts: they bail out immediately when loaded in a window
7
- // (`if (typeof e.window != 'undefined' && e.document) return;`), so importing them here never did
8
- // anything. As ES modules `this` is `undefined` instead of the global, which made them throw
9
- // "Cannot read properties of undefined (reading 'window')" and blocked the whole app from starting.
10
- // Ace loads its workers over `ace.config.setModuleUrl()` when they are actually wanted.
11
- import 'ace-builds/src-min-noconflict/theme-clouds_midnight';
12
- import 'ace-builds/src-min-noconflict/theme-chrome';
13
- import 'ace-builds/src-min-noconflict/ext-language_tools';
2
+ import { TextField } from '@mui/material';
14
3
  const styles = {
15
4
  jsonError: {
16
5
  border: '1px solid red',
@@ -20,9 +9,24 @@ const styles = {
20
9
  border: '1px solid #00000000',
21
10
  minHeight: 200,
22
11
  },
12
+ fallback: {
13
+ width: '100%',
14
+ height: '100%',
15
+ },
23
16
  };
24
17
  export default function Editor(props) {
25
- return (React.createElement(AceEditor, { style: props.error === true ? styles.jsonError : props.error === false ? styles.jsonNoError : undefined, mode: props.mode || 'json', width: "100%", height: "100%", showPrintMargin: props.editValueMode, showGutter: props.editValueMode, highlightActiveLine: props.editValueMode, defaultValue: props.defaultValue, theme: props.themeType === 'dark' ? 'clouds_midnight' : 'chrome', value: props.value, readOnly: !props.onChange, onChange: newValue => props.onChange?.(newValue), name: props.name || 'UNIQUE_ID_OF_DIV1', fontSize: props.fontSize || 14, setOptions: {
18
+ const style = props.error === true ? styles.jsonError : props.error === false ? styles.jsonNoError : undefined;
19
+ if (!props.AceEditor) {
20
+ // no editor from the host: a text area is not comfortable, but nothing is lost with it
21
+ return (React.createElement(TextField, { variant: "outlined", style: { ...styles.fallback, ...style }, slotProps: {
22
+ htmlInput: {
23
+ style: { fontFamily: 'monospace', fontSize: props.fontSize || 14 },
24
+ spellCheck: false,
25
+ },
26
+ }, multiline: true, fullWidth: true, error: props.error === true, value: props.value ?? props.defaultValue ?? '', onChange: e => props.onChange?.(e.target.value), disabled: !props.onChange, name: props.name }));
27
+ }
28
+ const AceEditor = props.AceEditor;
29
+ return (React.createElement(AceEditor, { style: style, mode: props.mode || 'json', width: "100%", height: "100%", showPrintMargin: props.editValueMode, showGutter: props.editValueMode, highlightActiveLine: props.editValueMode, defaultValue: props.defaultValue, theme: props.themeType === 'dark' ? 'clouds_midnight' : 'chrome', value: props.value, readOnly: !props.onChange, onChange: newValue => props.onChange?.(newValue), name: props.name || 'UNIQUE_ID_OF_DIV1', fontSize: props.fontSize || 14, setOptions: {
26
30
  enableBasicAutocompletion: true,
27
31
  enableLiveAutocompletion: true,
28
32
  enableSnippets: true,
@@ -1 +1 @@
1
- {"version":3,"file":"Editor.js","sourceRoot":"src/","sources":["JsonConfigComponent/wrapper/Components/Editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,yCAAyC,CAAC;AACjD,OAAO,0CAA0C,CAAC;AAClD,OAAO,yCAAyC,CAAC;AACjD,iGAAiG;AACjG,kGAAkG;AAClG,6FAA6F;AAC7F,oGAAoG;AACpG,wFAAwF;AACxF,OAAO,qDAAqD,CAAC;AAC7D,OAAO,4CAA4C,CAAC;AACpD,OAAO,kDAAkD,CAAC;AAE1D,MAAM,MAAM,GAAwC;IAChD,SAAS,EAAE;QACP,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,GAAG;KACjB;IACD,WAAW,EAAE;QACT,MAAM,EAAE,qBAAqB;QAC7B,SAAS,EAAE,GAAG;KACjB;CACJ,CAAC;AAcF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAkB;IAC7C,OAAO,CACH,oBAAC,SAAS,IACN,KAAK,EAAE,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EACvG,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,MAAM,EAC1B,KAAK,EAAC,MAAM,EACZ,MAAM,EAAC,MAAM,EACb,eAAe,EAAE,KAAK,CAAC,aAAa,EACpC,UAAU,EAAE,KAAK,CAAC,aAAa,EAC/B,mBAAmB,EAAE,KAAK,CAAC,aAAa,EACxC,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,KAAK,EAAE,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,QAAQ,EAChE,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,QAAQ,EAAE,CAAC,KAAK,CAAC,QAAQ,EACzB,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAChD,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,mBAAmB,EACvC,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE,EAC9B,UAAU,EAAE;YACR,yBAAyB,EAAE,IAAI;YAC/B,wBAAwB,EAAE,IAAI;YAC9B,cAAc,EAAE,IAAI;YAEpB,eAAe,EAAE,KAAK,CAAC,aAAa;YACpC,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;SAC/C,EACD,WAAW,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,GACxC,CACL,CAAC;AACN,CAAC","sourcesContent":["import React, { type JSX } from 'react';\n\nimport AceEditor from 'react-ace';\nimport 'ace-builds/src-min-noconflict/mode-json';\nimport 'ace-builds/src-min-noconflict/mode-json5';\nimport 'ace-builds/src-min-noconflict/mode-yaml';\n// The `worker-*` files are web worker scripts: they bail out immediately when loaded in a window\n// (`if (typeof e.window != 'undefined' && e.document) return;`), so importing them here never did\n// anything. As ES modules `this` is `undefined` instead of the global, which made them throw\n// \"Cannot read properties of undefined (reading 'window')\" and blocked the whole app from starting.\n// Ace loads its workers over `ace.config.setModuleUrl()` when they are actually wanted.\nimport 'ace-builds/src-min-noconflict/theme-clouds_midnight';\nimport 'ace-builds/src-min-noconflict/theme-chrome';\nimport 'ace-builds/src-min-noconflict/ext-language_tools';\n\nconst styles: Record<string, React.CSSProperties> = {\n jsonError: {\n border: '1px solid red',\n minHeight: 200,\n },\n jsonNoError: {\n border: '1px solid #00000000',\n minHeight: 200,\n },\n};\n\ninterface EditorProps {\n fontSize?: number;\n value?: string;\n defaultValue?: string;\n mode?: 'json' | 'css' | 'html' | 'json5' | 'yaml';\n name: string;\n onChange?: (newValue: string) => void;\n themeType: string;\n editValueMode?: boolean; // flag that indicates the \"value edit mode\"\n error?: boolean;\n}\n\nexport default function Editor(props: EditorProps): JSX.Element {\n return (\n <AceEditor\n style={props.error === true ? styles.jsonError : props.error === false ? styles.jsonNoError : undefined}\n mode={props.mode || 'json'}\n width=\"100%\"\n height=\"100%\"\n showPrintMargin={props.editValueMode}\n showGutter={props.editValueMode}\n highlightActiveLine={props.editValueMode}\n defaultValue={props.defaultValue}\n theme={props.themeType === 'dark' ? 'clouds_midnight' : 'chrome'}\n value={props.value}\n readOnly={!props.onChange}\n onChange={newValue => props.onChange?.(newValue)}\n name={props.name || 'UNIQUE_ID_OF_DIV1'}\n fontSize={props.fontSize || 14}\n setOptions={{\n enableBasicAutocompletion: true,\n enableLiveAutocompletion: true,\n enableSnippets: true,\n\n showLineNumbers: props.editValueMode,\n tabSize: props.editValueMode ? 2 : undefined,\n }}\n editorProps={{ $blockScrolling: true }}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"Editor.js","sourceRoot":"src/","sources":["JsonConfigComponent/wrapper/Components/Editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AA2C1C,MAAM,MAAM,GAAwC;IAChD,SAAS,EAAE;QACP,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,GAAG;KACjB;IACD,WAAW,EAAE;QACT,MAAM,EAAE,qBAAqB;QAC7B,SAAS,EAAE,GAAG;KACjB;IACD,QAAQ,EAAE;QACN,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;KACjB;CACJ,CAAC;AAgBF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAkB;IAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,KAAK,KAAK,C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Q,EAChE,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,QAAQ,EAAE,CAAC,KAAK,CAAC,QAAQ,EACzB,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAChD,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,mBAAmB,EACvC,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE,EAC9B,UAAU,EAAE;YACR,yBAAyB,EAAE,IAAI;YAC/B,wBAAwB,EAAE,IAAI;YAC9B,cAAc,EAAE,IAAI;YAEpB,eAAe,EAAE,KAAK,CAAC,aAAa;YACpC,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;SAC/C,EACD,WAAW,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,GACxC,CACL,CAAC;AACN,CAAC","sourcesContent":["import React, { type JSX } from 'react';\n\nimport { TextField } from '@mui/material';\n\n/**\n * What the code editor of the host has to accept.\n *\n * Described here and not imported from `react-ace`, so that neither this library nor anything that\n * bundles it needs that package - not even for the types. `AceEditor` fulfils it as it is.\n */\nexport interface AceEditorProps {\n style?: React.CSSProperties;\n /** `object` because ace also takes a mode instance, this library only passes names */\n mode?: string | object;\n theme?: string;\n width?: string;\n height?: string;\n name?: string;\n value?: string;\n defaultValue?: string;\n /** ace also takes a CSS size like `12pt`, this library only passes numbers */\n fontSize?: number | string;\n readOnly?: boolean;\n showPrintMargin?: boolean;\n showGutter?: boolean;\n highlightActiveLine?: boolean;\n onChange?: (newValue: string) => void;\n setOptions?: Record<string, any>;\n editorProps?: Record<string, any>;\n}\n\n/**\n * The code editor of the host, in practice `AceEditor` from `react-ace`.\n *\n * It is handed in and not imported, because `react-ace` brings the whole `ace-builds` with it -\n * thousands of files and several megabytes. Everything that bundles this library would carry them\n * along, every custom component of every adapter included, although only three of the sixty config\n * items ever show an editor. The admin has the editor anyway, so it hands it in.\n *\n * The host registers what the editor is used with here: the modes `json`, `json5` and `yaml`, and\n * the themes `clouds_midnight` and `chrome`. Without an editor the fields fall back to a plain text\n * area, so nothing becomes unreadable or unwritable.\n */\nexport type AceEditorComponent = React.ComponentType<AceEditorProps>;\n\nconst styles: Record<string, React.CSSProperties> = {\n jsonError: {\n border: '1px solid red',\n minHeight: 200,\n },\n jsonNoError: {\n border: '1px solid #00000000',\n minHeight: 200,\n },\n fallback: {\n width: '100%',\n height: '100%',\n },\n};\n\ninterface EditorProps {\n fontSize?: number;\n value?: string;\n defaultValue?: string;\n mode?: 'json' | 'css' | 'html' | 'json5' | 'yaml';\n name: string;\n onChange?: (newValue: string) => void;\n themeType: string;\n editValueMode?: boolean; // flag that indicates the \"value edit mode\"\n error?: boolean;\n /** Editor of the host. Without it the text area below is used. */\n AceEditor?: AceEditorComponent;\n}\n\nexport default function Editor(props: EditorProps): JSX.Element {\n const style = props.error === true ? styles.jsonError : props.error === false ? styles.jsonNoError : undefined;\n\n if (!props.AceEditor) {\n // no editor from the host: a text area is not comfortable, but nothing is lost with it\n return (\n <TextField\n variant=\"outlined\"\n style={{ ...styles.fallback, ...style }}\n slotProps={{\n htmlInput: {\n style: { fontFamily: 'monospace', fontSize: props.fontSize || 14 },\n spellCheck: false,\n },\n }}\n multiline\n fullWidth\n error={props.error === true}\n value={props.value ?? props.defaultValue ?? ''}\n onChange={e => props.onChange?.(e.target.value)}\n disabled={!props.onChange}\n name={props.name}\n />\n );\n }\n\n const AceEditor = props.AceEditor;\n\n return (\n <AceEditor\n style={style}\n mode={props.mode || 'json'}\n width=\"100%\"\n height=\"100%\"\n showPrintMargin={props.editValueMode}\n showGutter={props.editValueMode}\n highlightActiveLine={props.editValueMode}\n defaultValue={props.defaultValue}\n theme={props.themeType === 'dark' ? 'clouds_midnight' : 'chrome'}\n value={props.value}\n readOnly={!props.onChange}\n onChange={newValue => props.onChange?.(newValue)}\n name={props.name || 'UNIQUE_ID_OF_DIV1'}\n fontSize={props.fontSize || 14}\n setOptions={{\n enableBasicAutocompletion: true,\n enableLiveAutocompletion: true,\n enableSnippets: true,\n\n showLineNumbers: props.editValueMode,\n tabSize: props.editValueMode ? 2 : undefined,\n }}\n editorProps={{ $blockScrolling: true }}\n />\n );\n}\n"]}
package/build/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import JsonConfigComponent from './JsonConfigComponent';
3
3
  import ConfigPanel from './JsonConfigComponent/ConfigPanel';
4
4
  import ConfigGeneric from './JsonConfigComponent/ConfigGeneric';
5
5
  export type { DeviceManagerPropsProps, ConfigGenericProps, ConfigGenericState, } from './JsonConfigComponent/ConfigGeneric';
6
+ export type { AceEditorComponent } from './JsonConfigComponent/wrapper/Components/Editor';
6
7
  export type { ConfigItemType, ConfigItemConfirmData, ConfigItem, ConfigItemAlive, ConfigItemSelectOption, ConfigItemPanel, ConfigItemPattern, ConfigItemChip, ConfigItemComponent, ConfigItemTabs, ConfigItemText, ConfigItemColor, ConfigItemCheckbox, ConfigItemNumber, ConfigItemQrCode, ConfigItemQrCodeSendTo, ConfigItemPassword, ConfigItemObjectId, ConfigItemSlider, ConfigItemTopic, ConfigItemIP, ConfigItemUser, ConfigItemStaticDivider, ConfigItemStaticHeader, ConfigItemStaticImage, ConfigItemStaticText, ConfigItemRoom, ConfigItemFunc, ConfigItemSelect, ConfigItemAutocomplete, ConfigItemSetState, ConfigItemAutocompleteSendTo, ConfigItemAccordion, ConfigItemDivider, ConfigItemHeader, ConfigItemCoordinates, ConfigItemCustom, ConfigItemDatePicker, ConfigItemDeviceManager, ConfigItemLanguage, ConfigItemPort, ConfigItemImageSendTo, ConfigItemSendTo, ConfigItemState, ConfigItemTextSendTo, ConfigItemSelectSendTo, ConfigItemTable, ConfigItemTimePicker, ConfigItemCertCollection, ConfigItemCRON, ConfigItemCertificateSelect, ConfigItemCredentialSelect, ConfigItemLicense, ConfigItemCertificates, ConfigItemCheckLicense, ConfigItemUUID, ConfigItemJsonEditor, ConfigItemYamlEditor, ConfigItemInterface, ConfigItemImageUpload, ConfigItemInstanceSelect, ConfigItemFile, ConfigItemFileSelector, ConfigItemAny, BackEndCommandType, BackEndCommandGeneric, BackEndCommandNoOperation, BackEndCommandRefresh, BackEndCommandOpenLink, BackEndCommandMessage, BackEndCommand, } from './types';
7
8
  export { GUI_API_GENERATION, checkGuiApiCompatibility, type GuiApiVerdict } from './JsonConfigComponent/guiApiGate';
8
9
  export { JsonConfig, JsonConfigComponent, ConfigPanel, ConfigGeneric };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"src/","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,WAAW,MAAM,mCAAmC,CAAC;AAC5D,OAAO,aAAa,MAAM,qCAAqC,CAAC;AAkFhE,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAsB,MAAM,kCAAkC,CAAC;AAEpH,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import JsonConfig from './JsonConfig';\nimport JsonConfigComponent from './JsonConfigComponent';\nimport ConfigPanel from './JsonConfigComponent/ConfigPanel';\nimport ConfigGeneric from './JsonConfigComponent/ConfigGeneric';\n\nexport type {\n DeviceManagerPropsProps,\n ConfigGenericProps,\n ConfigGenericState,\n} from './JsonConfigComponent/ConfigGeneric';\n\nexport type {\n ConfigItemType,\n ConfigItemConfirmData,\n ConfigItem,\n ConfigItemAlive,\n ConfigItemSelectOption,\n ConfigItemPanel,\n ConfigItemPattern,\n ConfigItemChip,\n ConfigItemComponent,\n ConfigItemTabs,\n ConfigItemText,\n ConfigItemColor,\n ConfigItemCheckbox,\n ConfigItemNumber,\n ConfigItemQrCode,\n ConfigItemQrCodeSendTo,\n ConfigItemPassword,\n ConfigItemObjectId,\n ConfigItemSlider,\n ConfigItemTopic,\n ConfigItemIP,\n ConfigItemUser,\n ConfigItemStaticDivider,\n ConfigItemStaticHeader,\n ConfigItemStaticImage,\n ConfigItemStaticText,\n ConfigItemRoom,\n ConfigItemFunc,\n ConfigItemSelect,\n ConfigItemAutocomplete,\n ConfigItemSetState,\n ConfigItemAutocompleteSendTo,\n ConfigItemAccordion,\n ConfigItemDivider,\n ConfigItemHeader,\n ConfigItemCoordinates,\n ConfigItemCustom,\n ConfigItemDatePicker,\n ConfigItemDeviceManager,\n ConfigItemLanguage,\n ConfigItemPort,\n ConfigItemImageSendTo,\n ConfigItemSendTo,\n ConfigItemState,\n ConfigItemTextSendTo,\n ConfigItemSelectSendTo,\n ConfigItemTable,\n ConfigItemTimePicker,\n ConfigItemCertCollection,\n ConfigItemCRON,\n ConfigItemCertificateSelect,\n ConfigItemCredentialSelect,\n ConfigItemLicense,\n ConfigItemCertificates,\n ConfigItemCheckLicense,\n ConfigItemUUID,\n ConfigItemJsonEditor,\n ConfigItemYamlEditor,\n ConfigItemInterface,\n ConfigItemImageUpload,\n ConfigItemInstanceSelect,\n ConfigItemFile,\n ConfigItemFileSelector,\n ConfigItemAny,\n BackEndCommandType,\n BackEndCommandGeneric,\n BackEndCommandNoOperation,\n BackEndCommandRefresh,\n BackEndCommandOpenLink,\n BackEndCommandMessage,\n BackEndCommand,\n} from './types';\n\nexport { GUI_API_GENERATION, checkGuiApiCompatibility, type GuiApiVerdict } from './JsonConfigComponent/guiApiGate';\n\nexport { JsonConfig, JsonConfigComponent, ConfigPanel, ConfigGeneric };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"src/","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,WAAW,MAAM,mCAAmC,CAAC;AAC5D,OAAO,aAAa,MAAM,qCAAqC,CAAC;AAoFhE,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAsB,MAAM,kCAAkC,CAAC;AAEpH,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import JsonConfig from './JsonConfig';\nimport JsonConfigComponent from './JsonConfigComponent';\nimport ConfigPanel from './JsonConfigComponent/ConfigPanel';\nimport ConfigGeneric from './JsonConfigComponent/ConfigGeneric';\n\nexport type {\n DeviceManagerPropsProps,\n ConfigGenericProps,\n ConfigGenericState,\n} from './JsonConfigComponent/ConfigGeneric';\n\nexport type { AceEditorComponent } from './JsonConfigComponent/wrapper/Components/Editor';\n\nexport type {\n ConfigItemType,\n ConfigItemConfirmData,\n ConfigItem,\n ConfigItemAlive,\n ConfigItemSelectOption,\n ConfigItemPanel,\n ConfigItemPattern,\n ConfigItemChip,\n ConfigItemComponent,\n ConfigItemTabs,\n ConfigItemText,\n ConfigItemColor,\n ConfigItemCheckbox,\n ConfigItemNumber,\n ConfigItemQrCode,\n ConfigItemQrCodeSendTo,\n ConfigItemPassword,\n ConfigItemObjectId,\n ConfigItemSlider,\n ConfigItemTopic,\n ConfigItemIP,\n ConfigItemUser,\n ConfigItemStaticDivider,\n ConfigItemStaticHeader,\n ConfigItemStaticImage,\n ConfigItemStaticText,\n ConfigItemRoom,\n ConfigItemFunc,\n ConfigItemSelect,\n ConfigItemAutocomplete,\n ConfigItemSetState,\n ConfigItemAutocompleteSendTo,\n ConfigItemAccordion,\n ConfigItemDivider,\n ConfigItemHeader,\n ConfigItemCoordinates,\n ConfigItemCustom,\n ConfigItemDatePicker,\n ConfigItemDeviceManager,\n ConfigItemLanguage,\n ConfigItemPort,\n ConfigItemImageSendTo,\n ConfigItemSendTo,\n ConfigItemState,\n ConfigItemTextSendTo,\n ConfigItemSelectSendTo,\n ConfigItemTable,\n ConfigItemTimePicker,\n ConfigItemCertCollection,\n ConfigItemCRON,\n ConfigItemCertificateSelect,\n ConfigItemCredentialSelect,\n ConfigItemLicense,\n ConfigItemCertificates,\n ConfigItemCheckLicense,\n ConfigItemUUID,\n ConfigItemJsonEditor,\n ConfigItemYamlEditor,\n ConfigItemInterface,\n ConfigItemImageUpload,\n ConfigItemInstanceSelect,\n ConfigItemFile,\n ConfigItemFileSelector,\n ConfigItemAny,\n BackEndCommandType,\n BackEndCommandGeneric,\n BackEndCommandNoOperation,\n BackEndCommandRefresh,\n BackEndCommandOpenLink,\n BackEndCommandMessage,\n BackEndCommand,\n} from './types';\n\nexport { GUI_API_GENERATION, checkGuiApiCompatibility, type GuiApiVerdict } from './JsonConfigComponent/guiApiGate';\n\nexport { JsonConfig, JsonConfigComponent, ConfigPanel, ConfigGeneric };\n"]}
package/build/types.d.ts CHANGED
@@ -8,6 +8,7 @@ import type {
8
8
  ThemeName,
9
9
  } from '@iobroker/gui-components';
10
10
  import type { ConfigGeneric, DeviceManagerPropsProps } from './JsonConfigComponent/ConfigGeneric';
11
+ import type { AceEditorComponent } from './JsonConfigComponent/wrapper/Components/Editor';
11
12
 
12
13
  declare module '@mui/material/Button' {
13
14
  interface ButtonPropsColorOverrides {
@@ -964,6 +965,13 @@ export interface ConfigItemState extends ConfigItem {
964
965
  options?: (string | ConfigItemSelectOption)[];
965
966
  /** Number of decimal places to display for numeric values in text/html mode */
966
967
  digits?: number;
968
+ /**
969
+ * Write the value as acknowledged. A control writes a command by default (`false`), so that the
970
+ * adapter reacts to it.
971
+ */
972
+ ack?: boolean;
973
+ /** Highlight line on mouse over */
974
+ highlight?: boolean;
967
975
  }
968
976
 
969
977
  export interface ConfigItemTextSendTo extends Omit<ConfigItem, 'data'> {
@@ -1316,6 +1324,8 @@ export type JsonConfigContext = {
1316
1324
  _themeName: ThemeName;
1317
1325
 
1318
1326
  DeviceManager?: React.FC<DeviceManagerPropsProps>;
1327
+ /** Code editor of the host, see `AceEditorComponent`. Without it the editors are text areas. */
1328
+ AceEditor?: AceEditorComponent;
1319
1329
  changeLanguage?: () => void;
1320
1330
  customs?: Record<string, typeof ConfigGeneric>;
1321
1331
  embedded?: boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iobroker/json-config",
3
3
  "description": "This package contains the ioBroker JSON config UI components",
4
- "version": "9.1.2",
4
+ "version": "10.0.1",
5
5
  "author": {
6
6
  "name": "bluefox",
7
7
  "email": "dogafox@gmail.com"
@@ -38,40 +38,40 @@
38
38
  "dependencies": {
39
39
  "@emotion/react": "^11.14.0",
40
40
  "@emotion/styled": "^11.14.1",
41
- "@iobroker/gui-components": "^10.2.1",
41
+ "@iobroker/gui-components": "^10.2.3",
42
42
  "@module-federation/runtime": "^2.9.0",
43
43
  "@mui/icons-material": "^9.4.0",
44
44
  "@mui/material": "^9.4.0",
45
- "@mui/x-date-pickers": "^9.12.0",
45
+ "@mui/x-date-pickers": "^9.13.0",
46
46
  "crypto-js": "^4.2.0",
47
47
  "json5": "^2.2.3",
48
- "react": "^19.2.8",
49
- "react-ace": "^15.0.0",
50
- "react-dom": "^19.2.8",
48
+ "react": "^19.3.0",
49
+ "react-dom": "^19.3.0",
51
50
  "react-dropzone": "^20.1.1",
52
51
  "react-qr-code": "^2.2.0",
53
- "yaml": "^2.9.0"
52
+ "yaml": "^2.9.1"
54
53
  },
55
54
  "devDependencies": {
56
55
  "@alcalzone/release-script": "^5.2.1",
57
56
  "@alcalzone/release-script-plugin-license": "^5.2.2",
58
- "@iobroker/build-tools": "^3.0.1",
57
+ "@iobroker/build-tools": "^3.0.3",
59
58
  "@iobroker/eslint-config": "^2.3.4",
60
59
  "@iobroker/types": "^7.2.2",
61
60
  "@types/crypto-js": "^4.2.2",
62
61
  "@types/node": "^26.4.0",
63
- "@types/react": "^19.2.18",
64
- "@types/react-dom": "^19.2.5",
62
+ "@types/react": "^19.3.0",
63
+ "@types/react-dom": "^19.3.0",
65
64
  "ajv": "^8.20.0",
66
65
  "date-fns": "^4.4.0",
67
- "tsc-alias": "^1.9.3",
66
+ "react-ace": "^15.0.0",
67
+ "tsc-alias": "^1.9.5",
68
68
  "typescript": "~6.0.3"
69
69
  },
70
70
  "overrides": {
71
- "react": "^19.2.8",
72
- "react-dom": "^19.2.8",
73
- "@types/react": "^19.2.18",
74
- "@types/react-dom": "^19.2.5"
71
+ "react": "^19.3.0",
72
+ "react-dom": "^19.3.0",
73
+ "@types/react": "^19.3.0",
74
+ "@types/react-dom": "^19.3.0"
75
75
  },
76
76
  "files": [
77
77
  "build/",