@griddo/ax 10.7.7 → 10.7.8

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": "@griddo/ax",
3
3
  "description": "Griddo Author Experience",
4
- "version": "10.7.7",
4
+ "version": "10.7.8",
5
5
  "authors": [
6
6
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
7
7
  "Carlos Torres <carlos.torres@secuoyas.com>",
@@ -229,5 +229,5 @@
229
229
  "publishConfig": {
230
230
  "access": "public"
231
231
  },
232
- "gitHead": "c14eebd4f92f3bb6730b17a304b3f01091a21703"
232
+ "gitHead": "d6e57153101f81796458e1bb52604319738a8ac3"
233
233
  }
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { connect } from "react-redux";
3
- import FroalaEditor from "react-froala-wysiwyg";
3
+ import FroalaEditorComponent from "react-froala-wysiwyg";
4
4
  import { decodeEntities } from "@ax/helpers";
5
5
  import { IImage, ISite, IRootState } from "@ax/types";
6
6
  import { galleryActions } from "@ax/containers/Gallery";
@@ -40,6 +40,7 @@ const Wysiwyg = (props: IWysiwygProps): JSX.Element => {
40
40
  },
41
41
  events: {
42
42
  initialized() {
43
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
43
44
  const editor: any = this;
44
45
  if (disabled) {
45
46
  setTimeout(() => {
@@ -48,12 +49,18 @@ const Wysiwyg = (props: IWysiwygProps): JSX.Element => {
48
49
  }
49
50
  },
50
51
  "image.beforeUpload": async function (images: FileList) {
52
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
51
53
  const editor: any = this;
52
- const { url } = await uploadImage(images[0], imageSite);
53
- editor.image.insert(url, true, null, editor.image.get(), null);
54
+ const response = await uploadImage(images[0], imageSite);
55
+ if (response) {
56
+ editor.image.insert(response.url, null, null, editor.image.get());
57
+ } else {
58
+ editor.image.remove(editor.image.get());
59
+ }
54
60
  return false;
55
61
  },
56
62
  blur: function () {
63
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
57
64
  const editor: any = this;
58
65
  const html = editor.html.get();
59
66
  const stripedHtml = decodeEntities(html);
@@ -66,7 +73,7 @@ const Wysiwyg = (props: IWysiwygProps): JSX.Element => {
66
73
 
67
74
  return (
68
75
  <S.EditorWrapper error={error} disabled={disabled} data-testid="wysiwyg-wrapper">
69
- <FroalaEditor tag="textarea" model={value} config={config} onModelChange={handleChange} />
76
+ <FroalaEditorComponent tag="textarea" model={value} config={config} onModelChange={handleChange} />
70
77
  </S.EditorWrapper>
71
78
  );
72
79
  };
@@ -1,6 +1,6 @@
1
1
  import { schemas, moduleCategories } from "components";
2
2
  import { sortBy } from "@ax/helpers";
3
- import { ModuleCategoryInfo } from "@ax/types";
3
+ import { ISchema, ModuleCategoryInfo } from "@ax/types";
4
4
  import { pageSchemas } from "@ax/schemas";
5
5
 
6
6
  const allSchemas = { ...schemas.all, ...pageSchemas };
@@ -54,9 +54,9 @@ const getTemplateThumbnails = (name: string, theme?: string) => {
54
54
 
55
55
  const getDataPackSchema = (name: string) => schemas.dataPacks[name];
56
56
 
57
- const getDisplayName = (component: string) => {
58
- const schema = getSchema(component);
59
- return schema?.displayName;
57
+ const getDisplayName = (component: string): string => {
58
+ const schema: ISchema = getSchema(component);
59
+ return schema?.displayName || "";
60
60
  };
61
61
 
62
62
  const getSchemaType = (component: string) => {
@@ -160,6 +160,7 @@ export interface ISchema {
160
160
  type?: string;
161
161
  configTabs: ISchemaTab[];
162
162
  schemaType: string;
163
+ displayName: string;
163
164
  }
164
165
 
165
166
  export interface ISchemaTab {