@vonaffenfels/slate-editor 1.0.72 → 1.0.74

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@vonaffenfels/slate-editor",
3
- "version": "1.0.72",
3
+ "version": "1.0.74",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -71,7 +71,7 @@
71
71
  "cssnano": "^5.0.1",
72
72
  "escape-html": "^1.0.3"
73
73
  },
74
- "gitHead": "4ea4a78911a1476352df5de28932c291bcc4770f",
74
+ "gitHead": "f7b8272c77b9ad21a9f13a8a0c6308161e8c8a91",
75
75
  "publishConfig": {
76
76
  "access": "public"
77
77
  }
@@ -47,7 +47,8 @@ export const StorybookDisplay = (props) => {
47
47
  block={element.block}
48
48
  storybookComponentLoader={storybookComponentLoader}
49
49
  storybookComponentDataLoader={storybookComponentDataLoader}
50
- attributes={{...element.attributes}}/>
50
+ attributes={{...element.attributes}}
51
+ isEditor/>
51
52
  </span>
52
53
  </ErrorBoundary>;
53
54
  } else {
@@ -66,6 +67,7 @@ const BlockComponent = ({
66
67
  storybookComponentLoader,
67
68
  storybookComponentDataLoader,
68
69
  attributes,
70
+ isEditor,
69
71
  }) => {
70
72
  const [loadedAttributes, setLoadedAttributes] = useState(attributes);
71
73
  let [LoadedComponent, setLoadedComponent] = useState(storybookComponentLoader(block));
@@ -128,6 +130,9 @@ const BlockComponent = ({
128
130
  "editor-mr-large": loadedAttributes?.margin?.right,
129
131
  "editor-mb-large": loadedAttributes?.margin?.bottom,
130
132
  "editor-ml-large": loadedAttributes?.margin?.left,
133
+ "lg:hidden": loadedAttributes?.hideOnDesktop && !isEditor,
134
+ "sm:max-lg:hidden": loadedAttributes?.hideOnTablet && !isEditor,
135
+ "max-sm:hidden": loadedAttributes?.hideOnSmartphone && !isEditor,
131
136
  })}><LoadedComponent {...loadedAttributes} /></span>;
132
137
  } else {
133
138
  return <LoadedComponent {...loadedAttributes} />;
@@ -157,9 +157,6 @@ export function Serializer({
157
157
  "mb-16": props?.attributes?.margin?.bottom,
158
158
  "ml-16": props?.attributes?.margin?.left,
159
159
  "justify-center": props?.attributes?.justifyCenter,
160
- "lg:!hidden": props?.attributes?.hideOnDesktop,
161
- "sm:max-lg:!hidden": props?.attributes?.hideOnTablet,
162
- "max-sm:!hidden": props?.attributes?.hideOnSmartphone,
163
160
  [typeProps.classNameSite + " site-width"]: !isInSlot && (props.attributes?.width === "site" || props.attributes?.width === "full"),
164
161
  [typeProps.classNameArticle + " article-width"]: !isInSlot && (props.attributes?.width === "article" || !props.attributes?.width),
165
162
  })}