5htp-core 0.4.9-94 → 0.4.9-96

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "5htp-core",
3
3
  "description": "Convenient TypeScript framework designed for Performance and Productivity.",
4
- "version": "0.4.9-94",
4
+ "version": "0.4.9-96",
5
5
  "author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
6
6
  "repository": "git://github.com/gaetanlegac/5htp-core.git",
7
7
  "license": "MIT",
@@ -182,7 +182,7 @@ pre {
182
182
  }
183
183
 
184
184
  code {
185
- padding: @spacing @readingMargin;
185
+ //padding: @spacing @readingMargin;
186
186
  text-align: left;
187
187
  font-size: 1rem;
188
188
  line-height: 2em;
@@ -135,8 +135,6 @@ export default ({
135
135
  if (size !== undefined)
136
136
  className += ' ' + size;
137
137
 
138
- if (type === 'secondary')
139
- className += ' bg white';
140
138
  if (type !== undefined)
141
139
  className += type === 'link' ? type : (' bg ' + type);
142
140
 
@@ -205,7 +205,7 @@ export default ({ value, setValue, props }: {
205
205
 
206
206
  {isMaxLength && <MaxLengthPlugin maxLength={30} />}
207
207
  <DragDropPaste />
208
- <AutoFocusPlugin />
208
+ {props.preview && <AutoFocusPlugin />}
209
209
  <ClearEditorPlugin />
210
210
  <ComponentPickerPlugin />
211
211
  <EmojiPickerPlugin />
@@ -66,10 +66,10 @@ export default (props: Props & InputBaseProps<string>) => {
66
66
  if (RichEditorUtils.active && RichEditorUtils.active?.title !== title)
67
67
  RichEditorUtils.active.close();
68
68
 
69
- // Set active editor
69
+ // Set active Editor
70
70
  RichEditorUtils.active = {
71
71
  title,
72
- close: () => setIsPreview(true)
72
+ close: () => preview ? setIsPreview(true) : null
73
73
  }
74
74
 
75
75
  // Load editor component if not alreayd done
@@ -27,12 +27,10 @@
27
27
  color: rgb(101, 103, 107);
28
28
  font-weight: 700;
29
29
  margin: 0;
30
- text-transform: uppercase;
31
30
  }
32
31
  .PlaygroundEditorTheme__h3 {
33
32
  font-size: 12px;
34
33
  margin: 0;
35
- text-transform: uppercase;
36
34
  }
37
35
  .PlaygroundEditorTheme__indent {
38
36
  --lexical-indent-base-value: 40px;
@@ -449,6 +449,9 @@ Logs: ${this.config.enable ? `<br/>` + this.logsToHTML(report.logs) : 'Logs coll
449
449
 
450
450
  public jsonToHTML( json: unknown ): string {
451
451
 
452
+ if (!json)
453
+ return 'No data';
454
+
452
455
  const coloredJson = highlight(
453
456
  JSON.stringify(json, null, 4),
454
457
  { language: 'json', ignoreIllegals: true }
@@ -461,6 +464,9 @@ Logs: ${this.config.enable ? `<br/>` + this.logsToHTML(report.logs) : 'Logs coll
461
464
 
462
465
  public printHtml( html: string ): string {
463
466
 
467
+ if (!html)
468
+ return 'No data';
469
+
464
470
  // Preserve spaces
465
471
  html = html
466
472
  .replace(/\t/g, '&nbsp;&nbsp;&nbsp;&nbsp;')