@zohodesk/dot 1.0.0-temp-197.4 → 1.0.0-temp-197.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/es/form/fields/TextEditor/TextEditor.js +8 -7
- package/es/form/fields/TextEditor/props/defaultProps.js +1 -5
- package/es/form/fields/TextEditor/props/propTypes.js +1 -1
- package/es/v1/form/fields/TextEditor/TextEditor.js +8 -7
- package/es/v1/form/fields/TextEditor/props/defaultProps.js +1 -5
- package/es/v1/form/fields/TextEditor/props/propTypes.js +2 -0
- package/lib/form/fields/TextEditor/TextEditor.js +11 -7
- package/lib/form/fields/TextEditor/props/defaultProps.js +1 -5
- package/lib/form/fields/TextEditor/props/propTypes.js +1 -1
- package/lib/v1/form/fields/TextEditor/TextEditor.js +11 -7
- package/lib/v1/form/fields/TextEditor/props/defaultProps.js +1 -5
- package/lib/v1/form/fields/TextEditor/props/propTypes.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ In this Library, we Provide Some Basic Components to Build Your Application
|
|
|
9
9
|
- `allowedFileExtensions: ["jpeg", "jpg", "png", "gif", "bmp", "ico"]`
|
|
10
10
|
- `fileNameMaxCharacters: 200,`
|
|
11
11
|
- `fileSizeMaxBytes: 3 * 1024 * 1024`
|
|
12
|
-
- `
|
|
12
|
+
- `customInitOption` prop added, using this can initialize the editor details.
|
|
13
13
|
- `customCSS` prop suppported to customize the style to apply for editor, it adds css in style tag.
|
|
14
14
|
- In `handleUpload` method reverted the `TicketReply` editor specific case handle.
|
|
15
15
|
|
|
@@ -60,7 +60,7 @@ export default class TextEditor extends Component {
|
|
|
60
60
|
initCallback,
|
|
61
61
|
handleAlertMessage,
|
|
62
62
|
needInlineAttachment,
|
|
63
|
-
|
|
63
|
+
customInitOption
|
|
64
64
|
} = this.props;
|
|
65
65
|
|
|
66
66
|
if (id && global.ZohoDeskEditor) {
|
|
@@ -92,7 +92,7 @@ export default class TextEditor extends Component {
|
|
|
92
92
|
htmlVersion: '<!Doctype html>'
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
-
if (!
|
|
95
|
+
if (!customInitOption) {
|
|
96
96
|
if (!ZohoDeskEditor_Init.init) {
|
|
97
97
|
global.editorInitialize && global.editorInitialize();
|
|
98
98
|
}
|
|
@@ -102,7 +102,7 @@ export default class TextEditor extends Component {
|
|
|
102
102
|
|
|
103
103
|
defaultObj = Object.assign(defaultObj, editorOptions);
|
|
104
104
|
const globalEditor = global.ZohoDeskEditor;
|
|
105
|
-
globalEditor && typeof globalEditor.create == 'function' && globalEditor.create(defaultObj,
|
|
105
|
+
globalEditor && typeof globalEditor.create == 'function' && globalEditor.create(defaultObj, customInitOption);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -241,9 +241,10 @@ export default class TextEditor extends Component {
|
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
let customStyleTag = document.createElement('style');
|
|
244
|
+
customStyleTag.type = 'text/css';
|
|
244
245
|
const customizedCSS = `pre {white-space: pre-wrap} ${customCSS}`;
|
|
245
246
|
const fontCSS = `@font-face {font-family: 'ZohoPuviRegular';src: url('https://static.zohocdn.com/zohofonts/zohopuvi/4.0/Zoho_Puvi_Regular.woff2') format('woff2');font-style: normal;font-weight: normal;text-rendering: optimizeLegibility;font-display: swap}@font-face {font-family: Regular;src: url('https://static.zohocdn.com/webfonts/lato2regular/font.woff2') format('woff2');font-weight: 400;font-style: normal;font-display: swap}@font-face {font-family: 'RobotoRegular';font-weight: 400;font-style: normal;font-display: swa;src: url('https://static.zohocdn.com/webfonts/robotoregular/font.woff2')}`;
|
|
246
|
-
customStyleTag.
|
|
247
|
+
customStyleTag.textContent = `${customizedCSS} ${fontCSS}`;
|
|
247
248
|
iframeHead.appendChild(customStyleTag);
|
|
248
249
|
}
|
|
249
250
|
}
|
|
@@ -263,9 +264,9 @@ export default class TextEditor extends Component {
|
|
|
263
264
|
fileNameLimitExceed
|
|
264
265
|
} = i18nKeys;
|
|
265
266
|
const {
|
|
266
|
-
allowedFileExtensions,
|
|
267
|
-
fileNameMaxCharacters,
|
|
268
|
-
fileSizeMaxBytes
|
|
267
|
+
allowedFileExtensions = ["jpeg", "jpg", "png", "gif", "bmp", "ico"],
|
|
268
|
+
fileNameMaxCharacters = 200,
|
|
269
|
+
fileSizeMaxBytes = 3 * 1024 * 1024
|
|
269
270
|
} = inlineImageProps;
|
|
270
271
|
|
|
271
272
|
if (!isFileNameSizeInvalid(file.name, fileNameMaxCharacters)) {
|
|
@@ -11,9 +11,5 @@ export const defaultProps = {
|
|
|
11
11
|
isReadOnly: false,
|
|
12
12
|
dataSelectorId: 'textEditor',
|
|
13
13
|
customCSS: '',
|
|
14
|
-
inlineImageProps: {
|
|
15
|
-
allowedFileExtensions: ["jpeg", "jpg", "png", "gif", "bmp", "ico"],
|
|
16
|
-
fileNameMaxCharacters: 200,
|
|
17
|
-
fileSizeMaxBytes: 3 * 1024 * 1024
|
|
18
|
-
}
|
|
14
|
+
inlineImageProps: {}
|
|
19
15
|
};
|
|
@@ -43,7 +43,7 @@ export const propTypes = {
|
|
|
43
43
|
isEditorDefaultOpen: PropTypes.bool,
|
|
44
44
|
toggleEdit: PropTypes.func,
|
|
45
45
|
dataSelectorId: PropTypes.string,
|
|
46
|
-
|
|
46
|
+
customInitOption: PropTypes.object,
|
|
47
47
|
customCSS: PropTypes.string,
|
|
48
48
|
inlineImageProps: PropTypes.shape({
|
|
49
49
|
allowedFileExtensions: PropTypes.array,
|
|
@@ -60,7 +60,7 @@ export default class TextEditor extends Component {
|
|
|
60
60
|
initCallback,
|
|
61
61
|
handleAlertMessage,
|
|
62
62
|
needInlineAttachment,
|
|
63
|
-
|
|
63
|
+
customInitOption
|
|
64
64
|
} = this.props;
|
|
65
65
|
|
|
66
66
|
if (id && global.ZohoDeskEditor) {
|
|
@@ -92,7 +92,7 @@ export default class TextEditor extends Component {
|
|
|
92
92
|
htmlVersion: '<!Doctype html>'
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
-
if (!
|
|
95
|
+
if (!customInitOption) {
|
|
96
96
|
if (!ZohoDeskEditor_Init.init) {
|
|
97
97
|
global.editorInitialize && global.editorInitialize();
|
|
98
98
|
}
|
|
@@ -102,7 +102,7 @@ export default class TextEditor extends Component {
|
|
|
102
102
|
|
|
103
103
|
defaultObj = Object.assign(defaultObj, editorOptions);
|
|
104
104
|
const globalEditor = global.ZohoDeskEditor;
|
|
105
|
-
globalEditor && typeof globalEditor.create == 'function' && globalEditor.create(defaultObj,
|
|
105
|
+
globalEditor && typeof globalEditor.create == 'function' && globalEditor.create(defaultObj, customInitOption);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -241,9 +241,10 @@ export default class TextEditor extends Component {
|
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
let customStyleTag = document.createElement('style');
|
|
244
|
+
customStyleTag.type = 'text/css';
|
|
244
245
|
const customizedCSS = `pre {white-space: pre-wrap} ${customCSS}`;
|
|
245
246
|
const fontCSS = `@font-face {font-family: 'ZohoPuviRegular';src: url('https://static.zohocdn.com/zohofonts/zohopuvi/4.0/Zoho_Puvi_Regular.woff2') format('woff2');font-style: normal;font-weight: normal;text-rendering: optimizeLegibility;font-display: swap}@font-face {font-family: Regular;src: url('https://static.zohocdn.com/webfonts/lato2regular/font.woff2') format('woff2');font-weight: 400;font-style: normal;font-display: swap}@font-face {font-family: 'RobotoRegular';font-weight: 400;font-style: normal;font-display: swa;src: url('https://static.zohocdn.com/webfonts/robotoregular/font.woff2')}`;
|
|
246
|
-
customStyleTag.
|
|
247
|
+
customStyleTag.textContent = `${customizedCSS} ${fontCSS}`;
|
|
247
248
|
iframeHead.appendChild(customStyleTag);
|
|
248
249
|
}
|
|
249
250
|
}
|
|
@@ -263,9 +264,9 @@ export default class TextEditor extends Component {
|
|
|
263
264
|
fileNameLimitExceed
|
|
264
265
|
} = i18nKeys;
|
|
265
266
|
const {
|
|
266
|
-
allowedFileExtensions,
|
|
267
|
-
fileNameMaxCharacters,
|
|
268
|
-
fileSizeMaxBytes
|
|
267
|
+
allowedFileExtensions = ["jpeg", "jpg", "png", "gif", "bmp", "ico"],
|
|
268
|
+
fileNameMaxCharacters = 200,
|
|
269
|
+
fileSizeMaxBytes = 3 * 1024 * 1024
|
|
269
270
|
} = inlineImageProps;
|
|
270
271
|
|
|
271
272
|
if (!isFileNameSizeInvalid(file.name, fileNameMaxCharacters)) {
|
|
@@ -11,9 +11,5 @@ export const defaultProps = {
|
|
|
11
11
|
isReadOnly: false,
|
|
12
12
|
dataSelectorId: 'textEditor',
|
|
13
13
|
customCSS: '',
|
|
14
|
-
inlineImageProps: {
|
|
15
|
-
allowedFileExtensions: ["jpeg", "jpg", "png", "gif", "bmp", "ico"],
|
|
16
|
-
fileNameMaxCharacters: 200,
|
|
17
|
-
fileSizeMaxBytes: 3 * 1024 * 1024
|
|
18
|
-
}
|
|
14
|
+
inlineImageProps: {}
|
|
19
15
|
};
|
|
@@ -43,6 +43,8 @@ export const propTypes = {
|
|
|
43
43
|
isEditorDefaultOpen: PropTypes.bool,
|
|
44
44
|
toggleEdit: PropTypes.func,
|
|
45
45
|
dataSelectorId: PropTypes.string,
|
|
46
|
+
customInitOption: PropTypes.object,
|
|
47
|
+
customCSS: PropTypes.string,
|
|
46
48
|
inlineImageProps: PropTypes.shape({
|
|
47
49
|
allowedFileExtensions: PropTypes.array,
|
|
48
50
|
fileNameMaxCharacters: PropTypes.number,
|
|
@@ -113,7 +113,7 @@ var TextEditor = /*#__PURE__*/function (_Component) {
|
|
|
113
113
|
initCallback = _this$props.initCallback,
|
|
114
114
|
handleAlertMessage = _this$props.handleAlertMessage,
|
|
115
115
|
needInlineAttachment = _this$props.needInlineAttachment,
|
|
116
|
-
|
|
116
|
+
customInitOption = _this$props.customInitOption;
|
|
117
117
|
|
|
118
118
|
if (id && global.ZohoDeskEditor) {
|
|
119
119
|
var defaultObj = {
|
|
@@ -144,7 +144,7 @@ var TextEditor = /*#__PURE__*/function (_Component) {
|
|
|
144
144
|
htmlVersion: '<!Doctype html>'
|
|
145
145
|
};
|
|
146
146
|
|
|
147
|
-
if (!
|
|
147
|
+
if (!customInitOption) {
|
|
148
148
|
if (!ZohoDeskEditor_Init.init) {
|
|
149
149
|
global.editorInitialize && global.editorInitialize();
|
|
150
150
|
}
|
|
@@ -154,7 +154,7 @@ var TextEditor = /*#__PURE__*/function (_Component) {
|
|
|
154
154
|
|
|
155
155
|
defaultObj = Object.assign(defaultObj, editorOptions);
|
|
156
156
|
var globalEditor = global.ZohoDeskEditor;
|
|
157
|
-
globalEditor && typeof globalEditor.create == 'function' && globalEditor.create(defaultObj,
|
|
157
|
+
globalEditor && typeof globalEditor.create == 'function' && globalEditor.create(defaultObj, customInitOption);
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
}, {
|
|
@@ -288,9 +288,10 @@ var TextEditor = /*#__PURE__*/function (_Component) {
|
|
|
288
288
|
}
|
|
289
289
|
|
|
290
290
|
var customStyleTag = document.createElement('style');
|
|
291
|
+
customStyleTag.type = 'text/css';
|
|
291
292
|
var customizedCSS = "pre {white-space: pre-wrap} ".concat(customCSS);
|
|
292
293
|
var fontCSS = "@font-face {font-family: 'ZohoPuviRegular';src: url('https://static.zohocdn.com/zohofonts/zohopuvi/4.0/Zoho_Puvi_Regular.woff2') format('woff2');font-style: normal;font-weight: normal;text-rendering: optimizeLegibility;font-display: swap}@font-face {font-family: Regular;src: url('https://static.zohocdn.com/webfonts/lato2regular/font.woff2') format('woff2');font-weight: 400;font-style: normal;font-display: swap}@font-face {font-family: 'RobotoRegular';font-weight: 400;font-style: normal;font-display: swa;src: url('https://static.zohocdn.com/webfonts/robotoregular/font.woff2')}";
|
|
293
|
-
customStyleTag.
|
|
294
|
+
customStyleTag.textContent = "".concat(customizedCSS, " ").concat(fontCSS);
|
|
294
295
|
iframeHead.appendChild(customStyleTag);
|
|
295
296
|
}
|
|
296
297
|
}
|
|
@@ -307,9 +308,12 @@ var TextEditor = /*#__PURE__*/function (_Component) {
|
|
|
307
308
|
fileSizeLimitExceed = i18nKeys.fileSizeLimitExceed,
|
|
308
309
|
fileEmptyError = i18nKeys.fileEmptyError,
|
|
309
310
|
fileNameLimitExceed = i18nKeys.fileNameLimitExceed;
|
|
310
|
-
var
|
|
311
|
-
|
|
312
|
-
|
|
311
|
+
var _inlineImageProps$all = inlineImageProps.allowedFileExtensions,
|
|
312
|
+
allowedFileExtensions = _inlineImageProps$all === void 0 ? ["jpeg", "jpg", "png", "gif", "bmp", "ico"] : _inlineImageProps$all,
|
|
313
|
+
_inlineImageProps$fil = inlineImageProps.fileNameMaxCharacters,
|
|
314
|
+
fileNameMaxCharacters = _inlineImageProps$fil === void 0 ? 200 : _inlineImageProps$fil,
|
|
315
|
+
_inlineImageProps$fil2 = inlineImageProps.fileSizeMaxBytes,
|
|
316
|
+
fileSizeMaxBytes = _inlineImageProps$fil2 === void 0 ? 3 * 1024 * 1024 : _inlineImageProps$fil2;
|
|
313
317
|
|
|
314
318
|
if (!(0, _editorUtils.isFileNameSizeInvalid)(file.name, fileNameMaxCharacters)) {
|
|
315
319
|
if (file.size != 0) {
|
|
@@ -17,10 +17,6 @@ var defaultProps = {
|
|
|
17
17
|
isReadOnly: false,
|
|
18
18
|
dataSelectorId: 'textEditor',
|
|
19
19
|
customCSS: '',
|
|
20
|
-
inlineImageProps: {
|
|
21
|
-
allowedFileExtensions: ["jpeg", "jpg", "png", "gif", "bmp", "ico"],
|
|
22
|
-
fileNameMaxCharacters: 200,
|
|
23
|
-
fileSizeMaxBytes: 3 * 1024 * 1024
|
|
24
|
-
}
|
|
20
|
+
inlineImageProps: {}
|
|
25
21
|
};
|
|
26
22
|
exports.defaultProps = defaultProps;
|
|
@@ -53,7 +53,7 @@ var propTypes = {
|
|
|
53
53
|
isEditorDefaultOpen: _propTypes["default"].bool,
|
|
54
54
|
toggleEdit: _propTypes["default"].func,
|
|
55
55
|
dataSelectorId: _propTypes["default"].string,
|
|
56
|
-
|
|
56
|
+
customInitOption: _propTypes["default"].object,
|
|
57
57
|
customCSS: _propTypes["default"].string,
|
|
58
58
|
inlineImageProps: _propTypes["default"].shape({
|
|
59
59
|
allowedFileExtensions: _propTypes["default"].array,
|
|
@@ -113,7 +113,7 @@ var TextEditor = /*#__PURE__*/function (_Component) {
|
|
|
113
113
|
initCallback = _this$props.initCallback,
|
|
114
114
|
handleAlertMessage = _this$props.handleAlertMessage,
|
|
115
115
|
needInlineAttachment = _this$props.needInlineAttachment,
|
|
116
|
-
|
|
116
|
+
customInitOption = _this$props.customInitOption;
|
|
117
117
|
|
|
118
118
|
if (id && global.ZohoDeskEditor) {
|
|
119
119
|
var defaultObj = {
|
|
@@ -144,7 +144,7 @@ var TextEditor = /*#__PURE__*/function (_Component) {
|
|
|
144
144
|
htmlVersion: '<!Doctype html>'
|
|
145
145
|
};
|
|
146
146
|
|
|
147
|
-
if (!
|
|
147
|
+
if (!customInitOption) {
|
|
148
148
|
if (!ZohoDeskEditor_Init.init) {
|
|
149
149
|
global.editorInitialize && global.editorInitialize();
|
|
150
150
|
}
|
|
@@ -154,7 +154,7 @@ var TextEditor = /*#__PURE__*/function (_Component) {
|
|
|
154
154
|
|
|
155
155
|
defaultObj = Object.assign(defaultObj, editorOptions);
|
|
156
156
|
var globalEditor = global.ZohoDeskEditor;
|
|
157
|
-
globalEditor && typeof globalEditor.create == 'function' && globalEditor.create(defaultObj,
|
|
157
|
+
globalEditor && typeof globalEditor.create == 'function' && globalEditor.create(defaultObj, customInitOption);
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
}, {
|
|
@@ -288,9 +288,10 @@ var TextEditor = /*#__PURE__*/function (_Component) {
|
|
|
288
288
|
}
|
|
289
289
|
|
|
290
290
|
var customStyleTag = document.createElement('style');
|
|
291
|
+
customStyleTag.type = 'text/css';
|
|
291
292
|
var customizedCSS = "pre {white-space: pre-wrap} ".concat(customCSS);
|
|
292
293
|
var fontCSS = "@font-face {font-family: 'ZohoPuviRegular';src: url('https://static.zohocdn.com/zohofonts/zohopuvi/4.0/Zoho_Puvi_Regular.woff2') format('woff2');font-style: normal;font-weight: normal;text-rendering: optimizeLegibility;font-display: swap}@font-face {font-family: Regular;src: url('https://static.zohocdn.com/webfonts/lato2regular/font.woff2') format('woff2');font-weight: 400;font-style: normal;font-display: swap}@font-face {font-family: 'RobotoRegular';font-weight: 400;font-style: normal;font-display: swa;src: url('https://static.zohocdn.com/webfonts/robotoregular/font.woff2')}";
|
|
293
|
-
customStyleTag.
|
|
294
|
+
customStyleTag.textContent = "".concat(customizedCSS, " ").concat(fontCSS);
|
|
294
295
|
iframeHead.appendChild(customStyleTag);
|
|
295
296
|
}
|
|
296
297
|
}
|
|
@@ -307,9 +308,12 @@ var TextEditor = /*#__PURE__*/function (_Component) {
|
|
|
307
308
|
fileSizeLimitExceed = i18nKeys.fileSizeLimitExceed,
|
|
308
309
|
fileEmptyError = i18nKeys.fileEmptyError,
|
|
309
310
|
fileNameLimitExceed = i18nKeys.fileNameLimitExceed;
|
|
310
|
-
var
|
|
311
|
-
|
|
312
|
-
|
|
311
|
+
var _inlineImageProps$all = inlineImageProps.allowedFileExtensions,
|
|
312
|
+
allowedFileExtensions = _inlineImageProps$all === void 0 ? ["jpeg", "jpg", "png", "gif", "bmp", "ico"] : _inlineImageProps$all,
|
|
313
|
+
_inlineImageProps$fil = inlineImageProps.fileNameMaxCharacters,
|
|
314
|
+
fileNameMaxCharacters = _inlineImageProps$fil === void 0 ? 200 : _inlineImageProps$fil,
|
|
315
|
+
_inlineImageProps$fil2 = inlineImageProps.fileSizeMaxBytes,
|
|
316
|
+
fileSizeMaxBytes = _inlineImageProps$fil2 === void 0 ? 3 * 1024 * 1024 : _inlineImageProps$fil2;
|
|
313
317
|
|
|
314
318
|
if (!(0, _editorUtils.isFileNameSizeInvalid)(file.name, fileNameMaxCharacters)) {
|
|
315
319
|
if (file.size != 0) {
|
|
@@ -17,10 +17,6 @@ var defaultProps = {
|
|
|
17
17
|
isReadOnly: false,
|
|
18
18
|
dataSelectorId: 'textEditor',
|
|
19
19
|
customCSS: '',
|
|
20
|
-
inlineImageProps: {
|
|
21
|
-
allowedFileExtensions: ["jpeg", "jpg", "png", "gif", "bmp", "ico"],
|
|
22
|
-
fileNameMaxCharacters: 200,
|
|
23
|
-
fileSizeMaxBytes: 3 * 1024 * 1024
|
|
24
|
-
}
|
|
20
|
+
inlineImageProps: {}
|
|
25
21
|
};
|
|
26
22
|
exports.defaultProps = defaultProps;
|
|
@@ -53,6 +53,8 @@ var propTypes = {
|
|
|
53
53
|
isEditorDefaultOpen: _propTypes["default"].bool,
|
|
54
54
|
toggleEdit: _propTypes["default"].func,
|
|
55
55
|
dataSelectorId: _propTypes["default"].string,
|
|
56
|
+
customInitOption: _propTypes["default"].object,
|
|
57
|
+
customCSS: _propTypes["default"].string,
|
|
56
58
|
inlineImageProps: _propTypes["default"].shape({
|
|
57
59
|
allowedFileExtensions: _propTypes["default"].array,
|
|
58
60
|
fileNameMaxCharacters: _propTypes["default"].number,
|