@zohodesk/dot 1.0.0-temp-197.2 → 1.0.0-temp-197.3
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/es/form/fields/TextEditor/TextEditor.js +5 -15
- package/es/form/fields/TextEditor/props/defaultProps.js +1 -0
- package/es/v1/form/fields/TextEditor/TextEditor.js +7 -16
- package/es/v1/form/fields/TextEditor/props/defaultProps.js +1 -0
- package/lib/form/fields/TextEditor/TextEditor.js +5 -15
- package/lib/form/fields/TextEditor/props/defaultProps.js +1 -0
- package/lib/v1/form/fields/TextEditor/TextEditor.js +7 -16
- package/lib/v1/form/fields/TextEditor/props/defaultProps.js +1 -0
- package/package.json +1 -1
|
@@ -224,18 +224,6 @@ export default class TextEditor extends Component {
|
|
|
224
224
|
global.editor[id] = editorObj;
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
const css = `pre {white-space: pre-wrap}, ${customCSS}`,
|
|
228
|
-
head = editorObj.doc.head || editorObj.doc.getElementsByTagName('head')[0],
|
|
229
|
-
style = document.createElement('style');
|
|
230
|
-
style.type = 'text/css';
|
|
231
|
-
|
|
232
|
-
if (style.styleSheet) {
|
|
233
|
-
style.styleSheet.cssText = css;
|
|
234
|
-
} else {
|
|
235
|
-
style.appendChild(editorObj.doc.createTextNode(css));
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
head.appendChild(style);
|
|
239
227
|
editorCallback && editorCallback(editorObj);
|
|
240
228
|
const iframe = selectn('iframe.contentDocument.body', editorObj) || null;
|
|
241
229
|
const iframeHead = selectn('iframe.contentDocument.head', editorObj) || null;
|
|
@@ -251,9 +239,11 @@ export default class TextEditor extends Component {
|
|
|
251
239
|
iframe.classList.add('scroll');
|
|
252
240
|
}
|
|
253
241
|
|
|
254
|
-
let
|
|
255
|
-
|
|
256
|
-
|
|
242
|
+
let customStyleTag = document.createElement('style');
|
|
243
|
+
const customizedCSS = `pre {white-space: pre-wrap} ${customCSS}`;
|
|
244
|
+
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')}`;
|
|
245
|
+
customStyleTag.innerText = `${customizedCSS} ${fontCSS}`;
|
|
246
|
+
iframeHead.appendChild(customStyleTag);
|
|
257
247
|
}
|
|
258
248
|
}
|
|
259
249
|
|
|
@@ -203,7 +203,8 @@ export default class TextEditor extends Component {
|
|
|
203
203
|
let {
|
|
204
204
|
editorCallback,
|
|
205
205
|
getRef,
|
|
206
|
-
isCustomScroll
|
|
206
|
+
isCustomScroll,
|
|
207
|
+
customCSS
|
|
207
208
|
} = this.props;
|
|
208
209
|
this.setState({
|
|
209
210
|
isEditorLoad: true,
|
|
@@ -218,18 +219,6 @@ export default class TextEditor extends Component {
|
|
|
218
219
|
global.editor[id] = editorObj;
|
|
219
220
|
}
|
|
220
221
|
|
|
221
|
-
const css = 'pre {white-space: pre-wrap}',
|
|
222
|
-
head = editorObj.doc.head || editorObj.doc.getElementsByTagName('head')[0],
|
|
223
|
-
style = document.createElement('style');
|
|
224
|
-
style.type = 'text/css';
|
|
225
|
-
|
|
226
|
-
if (style.styleSheet) {
|
|
227
|
-
style.styleSheet.cssText = css;
|
|
228
|
-
} else {
|
|
229
|
-
style.appendChild(editorObj.doc.createTextNode(css));
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
head.appendChild(style);
|
|
233
222
|
editorCallback && editorCallback(editorObj);
|
|
234
223
|
const iframe = selectn('iframe.contentDocument.body', editorObj) || null;
|
|
235
224
|
const iframeHead = selectn('iframe.contentDocument.head', editorObj) || null;
|
|
@@ -245,9 +234,11 @@ export default class TextEditor extends Component {
|
|
|
245
234
|
iframe.classList.add('scroll');
|
|
246
235
|
}
|
|
247
236
|
|
|
248
|
-
let
|
|
249
|
-
|
|
250
|
-
|
|
237
|
+
let customStyleTag = document.createElement('style');
|
|
238
|
+
const customizedCSS = `pre {white-space: pre-wrap} ${customCSS}`;
|
|
239
|
+
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')}`;
|
|
240
|
+
customStyleTag.innerText = `${customizedCSS} ${fontCSS}`;
|
|
241
|
+
iframeHead.appendChild(customStyleTag);
|
|
251
242
|
}
|
|
252
243
|
}
|
|
253
244
|
|
|
@@ -269,18 +269,6 @@ var TextEditor = /*#__PURE__*/function (_Component) {
|
|
|
269
269
|
global.editor[id] = editorObj;
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
-
var css = "pre {white-space: pre-wrap}, ".concat(customCSS),
|
|
273
|
-
head = editorObj.doc.head || editorObj.doc.getElementsByTagName('head')[0],
|
|
274
|
-
style = document.createElement('style');
|
|
275
|
-
style.type = 'text/css';
|
|
276
|
-
|
|
277
|
-
if (style.styleSheet) {
|
|
278
|
-
style.styleSheet.cssText = css;
|
|
279
|
-
} else {
|
|
280
|
-
style.appendChild(editorObj.doc.createTextNode(css));
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
head.appendChild(style);
|
|
284
272
|
editorCallback && editorCallback(editorObj);
|
|
285
273
|
var iframe = (0, _selectn["default"])('iframe.contentDocument.body', editorObj) || null;
|
|
286
274
|
var iframeHead = (0, _selectn["default"])('iframe.contentDocument.head', editorObj) || null;
|
|
@@ -298,9 +286,11 @@ var TextEditor = /*#__PURE__*/function (_Component) {
|
|
|
298
286
|
iframe.classList.add('scroll');
|
|
299
287
|
}
|
|
300
288
|
|
|
301
|
-
var
|
|
302
|
-
|
|
303
|
-
|
|
289
|
+
var customStyleTag = document.createElement('style');
|
|
290
|
+
var customizedCSS = "pre {white-space: pre-wrap} ".concat(customCSS);
|
|
291
|
+
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')}";
|
|
292
|
+
customStyleTag.innerText = "".concat(customizedCSS, " ").concat(fontCSS);
|
|
293
|
+
iframeHead.appendChild(customStyleTag);
|
|
304
294
|
}
|
|
305
295
|
}
|
|
306
296
|
}, {
|
|
@@ -251,7 +251,8 @@ var TextEditor = /*#__PURE__*/function (_Component) {
|
|
|
251
251
|
var _this$props5 = this.props,
|
|
252
252
|
editorCallback = _this$props5.editorCallback,
|
|
253
253
|
getRef = _this$props5.getRef,
|
|
254
|
-
isCustomScroll = _this$props5.isCustomScroll
|
|
254
|
+
isCustomScroll = _this$props5.isCustomScroll,
|
|
255
|
+
customCSS = _this$props5.customCSS;
|
|
255
256
|
this.setState({
|
|
256
257
|
isEditorLoad: true,
|
|
257
258
|
isEditorShow: true
|
|
@@ -263,18 +264,6 @@ var TextEditor = /*#__PURE__*/function (_Component) {
|
|
|
263
264
|
global.editor[id] = editorObj;
|
|
264
265
|
}
|
|
265
266
|
|
|
266
|
-
var css = 'pre {white-space: pre-wrap}',
|
|
267
|
-
head = editorObj.doc.head || editorObj.doc.getElementsByTagName('head')[0],
|
|
268
|
-
style = document.createElement('style');
|
|
269
|
-
style.type = 'text/css';
|
|
270
|
-
|
|
271
|
-
if (style.styleSheet) {
|
|
272
|
-
style.styleSheet.cssText = css;
|
|
273
|
-
} else {
|
|
274
|
-
style.appendChild(editorObj.doc.createTextNode(css));
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
head.appendChild(style);
|
|
278
267
|
editorCallback && editorCallback(editorObj);
|
|
279
268
|
var iframe = (0, _selectn["default"])('iframe.contentDocument.body', editorObj) || null;
|
|
280
269
|
var iframeHead = (0, _selectn["default"])('iframe.contentDocument.head', editorObj) || null;
|
|
@@ -292,9 +281,11 @@ var TextEditor = /*#__PURE__*/function (_Component) {
|
|
|
292
281
|
iframe.classList.add('scroll');
|
|
293
282
|
}
|
|
294
283
|
|
|
295
|
-
var
|
|
296
|
-
|
|
297
|
-
|
|
284
|
+
var customStyleTag = document.createElement('style');
|
|
285
|
+
var customizedCSS = "pre {white-space: pre-wrap} ".concat(customCSS);
|
|
286
|
+
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')}";
|
|
287
|
+
customStyleTag.innerText = "".concat(customizedCSS, " ").concat(fontCSS);
|
|
288
|
+
iframeHead.appendChild(customStyleTag);
|
|
298
289
|
}
|
|
299
290
|
}
|
|
300
291
|
}, {
|