@iobroker/adapter-react-v5 3.1.34 → 3.1.35
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/Components/404.js +0 -23
- package/Components/404.js.map +1 -1
- package/Components/ColorPicker.js +6 -37
- package/Components/ColorPicker.js.map +1 -1
- package/Components/ComplexCron.js +10 -84
- package/Components/ComplexCron.js.map +1 -1
- package/Components/CustomModal.js +29 -54
- package/Components/CustomModal.js.map +1 -1
- package/Components/FileBrowser.js +15 -265
- package/Components/FileBrowser.js.map +1 -1
- package/Components/FileViewer.js +7 -68
- package/Components/FileViewer.js.map +1 -1
- package/Components/Icon.d.ts +1 -1
- package/Components/Icon.js +2 -42
- package/Components/Icon.js.map +1 -1
- package/Components/IconPicker.js +6 -28
- package/Components/IconPicker.js.map +1 -1
- package/Components/IconSelector.js +3 -55
- package/Components/IconSelector.js.map +1 -1
- package/Components/Image.js +1 -38
- package/Components/Image.js.map +1 -1
- package/Components/JsonConfigComponent/ChipInput.js +66 -197
- package/Components/JsonConfigComponent/ChipInput.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAlive.js +0 -31
- package/Components/JsonConfigComponent/ConfigAlive.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAutocomplete.js +6 -39
- package/Components/JsonConfigComponent/ConfigAutocomplete.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +6 -52
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCRON.js +5 -39
- package/Components/JsonConfigComponent/ConfigCRON.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js +4 -42
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCheckbox.js +0 -28
- package/Components/JsonConfigComponent/ConfigCheckbox.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigChip.js +4 -33
- package/Components/JsonConfigComponent/ConfigChip.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigColor.js +0 -34
- package/Components/JsonConfigComponent/ConfigColor.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCoordinates.js +0 -33
- package/Components/JsonConfigComponent/ConfigCoordinates.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCustom.js +14 -73
- package/Components/JsonConfigComponent/ConfigCustom.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigDatePicker.js +0 -25
- package/Components/JsonConfigComponent/ConfigDatePicker.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFile.js +0 -46
- package/Components/JsonConfigComponent/ConfigFile.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFileSelector.js +7 -126
- package/Components/JsonConfigComponent/ConfigFileSelector.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFunc.js +0 -34
- package/Components/JsonConfigComponent/ConfigFunc.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigGeneric.js +15 -110
- package/Components/JsonConfigComponent/ConfigGeneric.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigIP.js +2 -35
- package/Components/JsonConfigComponent/ConfigIP.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigImageUpload.js +4 -44
- package/Components/JsonConfigComponent/ConfigImageUpload.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js +1 -59
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.js +7 -40
- package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigLanguage.js +2 -42
- package/Components/JsonConfigComponent/ConfigLanguage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigNumber.js +2 -45
- package/Components/JsonConfigComponent/ConfigNumber.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigObjectId.js +6 -40
- package/Components/JsonConfigComponent/ConfigObjectId.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPanel.js +7 -91
- package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPassword.js +0 -42
- package/Components/JsonConfigComponent/ConfigPassword.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPattern.js +0 -25
- package/Components/JsonConfigComponent/ConfigPattern.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigRoom.js +0 -34
- package/Components/JsonConfigComponent/ConfigRoom.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSelect.js +4 -34
- package/Components/JsonConfigComponent/ConfigSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js +11 -67
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSendto.js +8 -91
- package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSetState.js +0 -55
- package/Components/JsonConfigComponent/ConfigSetState.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSlider.js +0 -28
- package/Components/JsonConfigComponent/ConfigSlider.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticDivider.js +0 -21
- package/Components/JsonConfigComponent/ConfigStaticDivider.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticHeader.js +0 -24
- package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticImage.js +0 -23
- package/Components/JsonConfigComponent/ConfigStaticImage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticText.js +0 -31
- package/Components/JsonConfigComponent/ConfigStaticText.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTable.js +13 -105
- package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTabs.js +2 -35
- package/Components/JsonConfigComponent/ConfigTabs.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigText.js +0 -34
- package/Components/JsonConfigComponent/ConfigText.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTextSendTo.js +0 -37
- package/Components/JsonConfigComponent/ConfigTextSendTo.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTimePicker.js +0 -25
- package/Components/JsonConfigComponent/ConfigTimePicker.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTopic.js +0 -29
- package/Components/JsonConfigComponent/ConfigTopic.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigUser.js +2 -40
- package/Components/JsonConfigComponent/ConfigUser.js.map +1 -1
- package/Components/JsonConfigComponent/index.js +5 -81
- package/Components/JsonConfigComponent/index.js.map +1 -1
- package/Components/Loader.js +2 -20
- package/Components/Loader.js.map +1 -1
- package/Components/Loaders/PT.js +2 -20
- package/Components/Loaders/PT.js.map +1 -1
- package/Components/Loaders/Vendor.js +2 -21
- package/Components/Loaders/Vendor.js.map +1 -1
- package/Components/Logo.js +6 -39
- package/Components/Logo.js.map +1 -1
- package/Components/MDUtils.js +3 -27
- package/Components/MDUtils.js.map +1 -1
- package/Components/ObjectBrowser.d.ts +1 -1
- package/Components/ObjectBrowser.js +181 -788
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/Router.js +7 -31
- package/Components/Router.js.map +1 -1
- package/Components/SaveCloseButtons.js +2 -32
- package/Components/SaveCloseButtons.js.map +1 -1
- package/Components/Schedule.js +29 -251
- package/Components/Schedule.js.map +1 -1
- package/Components/SelectWithIcon.d.ts +1 -1
- package/Components/SelectWithIcon.js +0 -48
- package/Components/SelectWithIcon.js.map +1 -1
- package/Components/SimpleCron/cron2text.js +45 -91
- package/Components/SimpleCron/cron2text.js.map +1 -1
- package/Components/SimpleCron/cronText.js +0 -6
- package/Components/SimpleCron/cronText.js.map +1 -1
- package/Components/SimpleCron/index.js +19 -102
- package/Components/SimpleCron/index.js.map +1 -1
- package/Components/SimpleCron/jquery.cron.locale.js +44 -24
- package/Components/SimpleCron/jquery.cron.locale.js.map +1 -1
- package/Components/TabContainer.js +2 -23
- package/Components/TabContainer.js.map +1 -1
- package/Components/TabContent.js +2 -22
- package/Components/TabContent.js.map +1 -1
- package/Components/TabHeader.js +1 -17
- package/Components/TabHeader.js.map +1 -1
- package/Components/TableResize.js +6 -51
- package/Components/TableResize.js.map +1 -1
- package/Components/TextWithIcon.js +0 -20
- package/Components/TextWithIcon.js.map +1 -1
- package/Components/ToggleThemeMenu.js +5 -13
- package/Components/ToggleThemeMenu.js.map +1 -1
- package/Components/TreeTable.js +4 -121
- package/Components/TreeTable.js.map +1 -1
- package/Components/UploadImage.js +17 -60
- package/Components/UploadImage.js.map +1 -1
- package/Components/Utils.js +87 -263
- package/Components/Utils.js.map +1 -1
- package/Components/copy-to-clipboard.js +16 -38
- package/Components/copy-to-clipboard.js.map +1 -1
- package/Components/withWidth.js +2 -10
- package/Components/withWidth.js.map +1 -1
- package/Connection.d.ts +1 -0
- package/Connection.js +156 -527
- package/Connection.js.map +1 -1
- package/Dialogs/ComplexCron.js +0 -34
- package/Dialogs/ComplexCron.js.map +1 -1
- package/Dialogs/Confirm.js +1 -39
- package/Dialogs/Confirm.js.map +1 -1
- package/Dialogs/Cron.js +1 -37
- package/Dialogs/Cron.js.map +1 -1
- package/Dialogs/Error.d.ts +1 -1
- package/Dialogs/Error.js +2 -29
- package/Dialogs/Error.js.map +1 -1
- package/Dialogs/FileSelect.js +2 -36
- package/Dialogs/FileSelect.js.map +1 -1
- package/Dialogs/Message.js +2 -27
- package/Dialogs/Message.js.map +1 -1
- package/Dialogs/SelectID.d.ts +1 -1
- package/Dialogs/SelectID.js +3 -40
- package/Dialogs/SelectID.js.map +1 -1
- package/Dialogs/SimpleCron.js +1 -33
- package/Dialogs/SimpleCron.js.map +1 -1
- package/Dialogs/TextInput.js +2 -34
- package/Dialogs/TextInput.js.map +1 -1
- package/GenericApp.js +54 -150
- package/GenericApp.js.map +1 -1
- package/Prompt.js +0 -2
- package/Prompt.js.map +1 -1
- package/README.md +8 -4
- package/Theme.js +7 -22
- package/Theme.js.map +1 -1
- package/i18n.d.ts +2 -0
- package/i18n.js +9 -29
- package/i18n.js.map +1 -1
- package/icons/IconAdapter.d.ts +2 -2
- package/icons/IconAdapter.js +2 -6
- package/icons/IconAdapter.js.map +1 -1
- package/icons/IconAlias.d.ts +2 -2
- package/icons/IconAlias.js +2 -6
- package/icons/IconAlias.js.map +1 -1
- package/icons/IconChannel.d.ts +2 -2
- package/icons/IconChannel.js +2 -6
- package/icons/IconChannel.js.map +1 -1
- package/icons/IconClearFilter.d.ts +2 -2
- package/icons/IconClearFilter.js +0 -5
- package/icons/IconClearFilter.js.map +1 -1
- package/icons/IconClosed.d.ts +2 -2
- package/icons/IconClosed.js +0 -5
- package/icons/IconClosed.js.map +1 -1
- package/icons/IconCopy.d.ts +2 -2
- package/icons/IconCopy.js +0 -5
- package/icons/IconCopy.js.map +1 -1
- package/icons/IconDevice.d.ts +2 -2
- package/icons/IconDevice.js +0 -5
- package/icons/IconDevice.js.map +1 -1
- package/icons/IconDocument.d.ts +2 -2
- package/icons/IconDocument.js +0 -5
- package/icons/IconDocument.js.map +1 -1
- package/icons/IconDocumentReadOnly.d.ts +2 -2
- package/icons/IconDocumentReadOnly.js +0 -5
- package/icons/IconDocumentReadOnly.js.map +1 -1
- package/icons/IconExpert.d.ts +2 -2
- package/icons/IconExpert.js +0 -5
- package/icons/IconExpert.js.map +1 -1
- package/icons/IconFx.d.ts +2 -2
- package/icons/IconFx.js +0 -5
- package/icons/IconFx.js.map +1 -1
- package/icons/IconInstance.d.ts +2 -2
- package/icons/IconInstance.js +0 -5
- package/icons/IconInstance.js.map +1 -1
- package/icons/IconLogout.d.ts +2 -2
- package/icons/IconLogout.js +0 -5
- package/icons/IconLogout.js.map +1 -1
- package/icons/IconNoIcon.d.ts +2 -2
- package/icons/IconNoIcon.js +0 -5
- package/icons/IconNoIcon.js.map +1 -1
- package/icons/IconOpen.d.ts +2 -2
- package/icons/IconOpen.js +0 -5
- package/icons/IconOpen.js.map +1 -1
- package/icons/IconState.d.ts +2 -2
- package/icons/IconState.js +0 -6
- package/icons/IconState.js.map +1 -1
- package/package.json +15 -15
package/Components/MDUtils.js
CHANGED
|
@@ -1,40 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
11
|
var _copyToClipboard = _interopRequireDefault(require("./copy-to-clipboard"));
|
|
17
|
-
|
|
18
12
|
/**
|
|
19
13
|
* Copyright 2018-2022 bluefox <dogafox@gmail.com>
|
|
20
14
|
*
|
|
21
15
|
* MIT License
|
|
22
16
|
*
|
|
23
|
-
**/
|
|
24
|
-
var MDUtils = /*#__PURE__*/function () {
|
|
17
|
+
**/var MDUtils = /*#__PURE__*/function () {
|
|
25
18
|
function MDUtils() {
|
|
26
19
|
(0, _classCallCheck2["default"])(this, MDUtils);
|
|
27
20
|
}
|
|
28
|
-
|
|
29
21
|
(0, _createClass2["default"])(MDUtils, null, [{
|
|
30
22
|
key: "text2link",
|
|
31
23
|
value: function text2link(text) {
|
|
32
24
|
var m = text.match(/\d+\.\)\s/);
|
|
33
|
-
|
|
34
25
|
if (m) {
|
|
35
26
|
text = text.replace(m[0], m[0].replace(/\s/, ' '));
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
return text.replace(/[^a-zA-Zа-яА-Я0-9]/g, '').trim().replace(/\s/g, '').toLowerCase();
|
|
39
29
|
}
|
|
40
30
|
}, {
|
|
@@ -50,21 +40,18 @@ var MDUtils = /*#__PURE__*/function () {
|
|
|
50
40
|
key: "getTitle",
|
|
51
41
|
value: function getTitle(text) {
|
|
52
42
|
var _MDUtils$extractHeade = MDUtils.extractHeader(text),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
43
|
+
body = _MDUtils$extractHeade.body,
|
|
44
|
+
header = _MDUtils$extractHeade.header;
|
|
56
45
|
if (!header.title) {
|
|
57
46
|
// remove {docsify-bla}
|
|
58
47
|
body = body.replace(/{[^}]*}/g, '');
|
|
59
48
|
body = body.trim();
|
|
60
49
|
var lines = body.replace(/\r/g, '').split('\n');
|
|
61
|
-
|
|
62
50
|
for (var i = 0; i < lines.length; i++) {
|
|
63
51
|
if (lines[i].startsWith('# ')) {
|
|
64
52
|
return lines[i].substring(2).trim();
|
|
65
53
|
}
|
|
66
54
|
}
|
|
67
|
-
|
|
68
55
|
return '';
|
|
69
56
|
} else {
|
|
70
57
|
return header.title;
|
|
@@ -74,27 +61,20 @@ var MDUtils = /*#__PURE__*/function () {
|
|
|
74
61
|
key: "extractHeader",
|
|
75
62
|
value: function extractHeader(text) {
|
|
76
63
|
var attrs = {};
|
|
77
|
-
|
|
78
64
|
if (text.substring(0, 3) === '---') {
|
|
79
65
|
var pos = text.substring(3).indexOf('\n---');
|
|
80
|
-
|
|
81
66
|
if (pos !== -1) {
|
|
82
67
|
var _header = text.substring(3, pos + 3);
|
|
83
|
-
|
|
84
68
|
var lines = _header.replace(/\r/g, '').split('\n');
|
|
85
|
-
|
|
86
69
|
lines.forEach(function (line) {
|
|
87
70
|
if (!line.trim()) {
|
|
88
71
|
return;
|
|
89
72
|
}
|
|
90
|
-
|
|
91
73
|
var pos = line.indexOf(':');
|
|
92
|
-
|
|
93
74
|
if (pos !== -1) {
|
|
94
75
|
var attr = line.substring(0, pos).trim();
|
|
95
76
|
attrs[attr] = line.substring(pos + 1).trim();
|
|
96
77
|
attrs[attr] = attrs[attr].replace(/^['"]|['"]$/g, '');
|
|
97
|
-
|
|
98
78
|
if (attrs[attr] === 'true') {
|
|
99
79
|
attrs[attr] = true;
|
|
100
80
|
} else if (attrs[attr] === 'false') {
|
|
@@ -109,7 +89,6 @@ var MDUtils = /*#__PURE__*/function () {
|
|
|
109
89
|
text = text.substring(pos + 7);
|
|
110
90
|
}
|
|
111
91
|
}
|
|
112
|
-
|
|
113
92
|
return {
|
|
114
93
|
header: attrs,
|
|
115
94
|
body: text
|
|
@@ -119,13 +98,11 @@ var MDUtils = /*#__PURE__*/function () {
|
|
|
119
98
|
key: "removeDocsify",
|
|
120
99
|
value: function removeDocsify(text) {
|
|
121
100
|
var m = text.match(/{docsify-[^}]*}/g);
|
|
122
|
-
|
|
123
101
|
if (m) {
|
|
124
102
|
m.forEach(function (doc) {
|
|
125
103
|
return text = text.replace(doc, '');
|
|
126
104
|
});
|
|
127
105
|
}
|
|
128
|
-
|
|
129
106
|
return text;
|
|
130
107
|
}
|
|
131
108
|
}, {
|
|
@@ -138,7 +115,6 @@ var MDUtils = /*#__PURE__*/function () {
|
|
|
138
115
|
}]);
|
|
139
116
|
return MDUtils;
|
|
140
117
|
}();
|
|
141
|
-
|
|
142
118
|
var _default = MDUtils;
|
|
143
119
|
exports["default"] = _default;
|
|
144
120
|
//# sourceMappingURL=MDUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MDUtils.js","names":["MDUtils","text","m","match","replace","trim","toLowerCase","url","target","window","location","open","extractHeader","body","header","title","lines","split","i","length","startsWith","substring","attrs","pos","indexOf","_header","forEach","line","attr","parseFloat","toString","doc","e","copy","stopPropagation","preventDefault"],"sources":["MDUtils.js"],"sourcesContent":["/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\nimport React from 'react';\nimport copy from './copy-to-clipboard';\n\nclass MDUtils {\n static text2link(text) {\n const m = text.match(/\\d+\\.\\)\\s/);\n if (m) {\n text = text.replace(m[0], m[0].replace(/\\s/, ' '));\n }\n\n return text.replace(/[^a-zA-Zа-яА-Я0-9]/g, '').trim().replace(/\\s/g, '').toLowerCase();\n }\n\n static openLink(url, target) {\n if (target === 'this') {\n window.location = url;\n } else {\n window.open(url, target || '_blank');\n }\n }\n\n static getTitle(text) {\n let {body, header} = MDUtils.extractHeader(text);\n if (!header.title) {\n // remove {docsify-bla}\n body = body.replace(/{[^}]*}/g, '');\n body = body.trim();\n const lines = body.replace(/\\r/g, '').split('\\n');\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].startsWith('# ')) {\n return lines[i].substring(2).trim();\n }\n }\n return '';\n } else {\n return header.title;\n }\n }\n\n static extractHeader(text) {\n const attrs = {};\n if (text.substring(0, 3) === '---') {\n const pos = text.substring(3).indexOf('\\n---');\n if (pos !== -1) {\n const _header = text.substring(3, pos + 3);\n const lines = _header.replace(/\\r/g, '').split('\\n');\n lines.forEach(line => {\n if (!line.trim()) {\n return;\n }\n const pos = line.indexOf(':');\n if (pos !== -1) {\n const attr = line.substring(0, pos).trim();\n attrs[attr] = line.substring(pos + 1).trim();\n attrs[attr] = attrs[attr].replace(/^['\"]|['\"]$/g, '');\n if (attrs[attr] === 'true') {\n attrs[attr] = true;\n } else if (attrs[attr] === 'false') {\n attrs[attr] = false;\n } else if (parseFloat(attrs[attr]).toString() === attrs[attr]) {\n attrs[attr] = parseFloat(attrs[attr]);\n }\n } else {\n attrs[line.trim()] = true;\n }\n });\n text = text.substring(pos + 7);\n }\n }\n return {header: attrs, body: text};\n }\n\n static removeDocsify(text) {\n const m = text.match(/{docsify-[^}]*}/g);\n if (m) {\n m.forEach(doc => text = text.replace(doc, ''));\n }\n return text;\n }\n\n static onCopy(e, text) {\n copy(text);\n e && e.stopPropagation();\n e && e.preventDefault();\n }\n}\n\nexport default MDUtils;"],"mappings":"
|
|
1
|
+
{"version":3,"file":"MDUtils.js","names":["MDUtils","text","m","match","replace","trim","toLowerCase","url","target","window","location","open","extractHeader","body","header","title","lines","split","i","length","startsWith","substring","attrs","pos","indexOf","_header","forEach","line","attr","parseFloat","toString","doc","e","copy","stopPropagation","preventDefault"],"sources":["MDUtils.js"],"sourcesContent":["/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\nimport React from 'react';\nimport copy from './copy-to-clipboard';\n\nclass MDUtils {\n static text2link(text) {\n const m = text.match(/\\d+\\.\\)\\s/);\n if (m) {\n text = text.replace(m[0], m[0].replace(/\\s/, ' '));\n }\n\n return text.replace(/[^a-zA-Zа-яА-Я0-9]/g, '').trim().replace(/\\s/g, '').toLowerCase();\n }\n\n static openLink(url, target) {\n if (target === 'this') {\n window.location = url;\n } else {\n window.open(url, target || '_blank');\n }\n }\n\n static getTitle(text) {\n let {body, header} = MDUtils.extractHeader(text);\n if (!header.title) {\n // remove {docsify-bla}\n body = body.replace(/{[^}]*}/g, '');\n body = body.trim();\n const lines = body.replace(/\\r/g, '').split('\\n');\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].startsWith('# ')) {\n return lines[i].substring(2).trim();\n }\n }\n return '';\n } else {\n return header.title;\n }\n }\n\n static extractHeader(text) {\n const attrs = {};\n if (text.substring(0, 3) === '---') {\n const pos = text.substring(3).indexOf('\\n---');\n if (pos !== -1) {\n const _header = text.substring(3, pos + 3);\n const lines = _header.replace(/\\r/g, '').split('\\n');\n lines.forEach(line => {\n if (!line.trim()) {\n return;\n }\n const pos = line.indexOf(':');\n if (pos !== -1) {\n const attr = line.substring(0, pos).trim();\n attrs[attr] = line.substring(pos + 1).trim();\n attrs[attr] = attrs[attr].replace(/^['\"]|['\"]$/g, '');\n if (attrs[attr] === 'true') {\n attrs[attr] = true;\n } else if (attrs[attr] === 'false') {\n attrs[attr] = false;\n } else if (parseFloat(attrs[attr]).toString() === attrs[attr]) {\n attrs[attr] = parseFloat(attrs[attr]);\n }\n } else {\n attrs[line.trim()] = true;\n }\n });\n text = text.substring(pos + 7);\n }\n }\n return {header: attrs, body: text};\n }\n\n static removeDocsify(text) {\n const m = text.match(/{docsify-[^}]*}/g);\n if (m) {\n m.forEach(doc => text = text.replace(doc, ''));\n }\n return text;\n }\n\n static onCopy(e, text) {\n copy(text);\n e && e.stopPropagation();\n e && e.preventDefault();\n }\n}\n\nexport default MDUtils;"],"mappings":";;;;;;;;;AAMA;AACA;AAPA;AACA;AACA;AACA;AACA;AACA,IALA,IASMA,OAAO;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA,OACT,mBAAiBC,IAAI,EAAE;MACnB,IAAMC,CAAC,GAAGD,IAAI,CAACE,KAAK,CAAC,WAAW,CAAC;MACjC,IAAID,CAAC,EAAE;QACHD,IAAI,GAAGA,IAAI,CAACG,OAAO,CAACF,CAAC,CAAC,CAAC,CAAC,EAAEA,CAAC,CAAC,CAAC,CAAC,CAACE,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;MAC3D;MAEA,OAAOH,IAAI,CAACG,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAACC,IAAI,EAAE,CAACD,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAACE,WAAW,EAAE;IAC1F;EAAC;IAAA;IAAA,OAED,kBAAgBC,GAAG,EAAEC,MAAM,EAAE;MACzB,IAAIA,MAAM,KAAK,MAAM,EAAE;QACnBC,MAAM,CAACC,QAAQ,GAAGH,GAAG;MACzB,CAAC,MAAM;QACHE,MAAM,CAACE,IAAI,CAACJ,GAAG,EAAEC,MAAM,IAAI,QAAQ,CAAC;MACxC;IACJ;EAAC;IAAA;IAAA,OAED,kBAAgBP,IAAI,EAAE;MAClB,4BAAqBD,OAAO,CAACY,aAAa,CAACX,IAAI,CAAC;QAA3CY,IAAI,yBAAJA,IAAI;QAAEC,MAAM,yBAANA,MAAM;MACjB,IAAI,CAACA,MAAM,CAACC,KAAK,EAAE;QACf;QACAF,IAAI,GAAGA,IAAI,CAACT,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;QACnCS,IAAI,GAAGA,IAAI,CAACR,IAAI,EAAE;QAClB,IAAMW,KAAK,GAAGH,IAAI,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+B,CAAC,EAAE/B,IAAI,EAAE;MACnB,IAAAgC,2BAAI,EAAChC,IAAI,CAAC;MACV+B,CAAC,IAAIA,CAAC,CAACE,eAAe,EAAE;MACxBF,CAAC,IAAIA,CAAC,CAACG,cAAc,EAAE;IAC3B;EAAC;EAAA;AAAA;AAAA,eAGUnC,OAAO;AAAA"}
|
|
@@ -577,7 +577,7 @@ declare namespace ObjectBrowser {
|
|
|
577
577
|
export const dialogName: PropTypes.Requireable<string>;
|
|
578
578
|
export const classes: PropTypes.Requireable<object>;
|
|
579
579
|
export const defaultFilters: PropTypes.Requireable<object>;
|
|
580
|
-
export const selected: PropTypes.Requireable<string | any[]
|
|
580
|
+
export const selected: PropTypes.Requireable<NonNullable<string | any[]>>;
|
|
581
581
|
export const onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
582
582
|
export const onFilterChanged: PropTypes.Requireable<(...args: any[]) => any>;
|
|
583
583
|
export const socket: PropTypes.Requireable<object>;
|