@vonaffenfels/contentful-slate-editor 1.0.5 → 1.0.11

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/contentful-slate-editor",
3
- "version": "1.0.5",
3
+ "version": "1.0.11",
4
4
  "scripts": {
5
5
  "prepublish": "yarn run build",
6
6
  "dev": "yarn run start",
@@ -89,10 +89,10 @@
89
89
  "webpack-dev-server": "^4.0.0-beta.2"
90
90
  },
91
91
  "dependencies": {
92
- "@vonaffenfels/slate-editor": "^1.0.5",
92
+ "@vonaffenfels/slate-editor": "^1.0.10",
93
93
  "webpack": "5.73.0"
94
94
  },
95
- "gitHead": "718a65757ab690aa3e2df05274a9c401ce466b6e",
95
+ "gitHead": "f4fba8f7e03159a1ac6f9136c562b8854f52ba76",
96
96
  "publishConfig": {
97
97
  "access": "public"
98
98
  }
@@ -11,8 +11,6 @@ const Field = ({sdk}) => {
11
11
  const wrapperRef = useRef();
12
12
 
13
13
  const openDialog = () => {
14
- console.log("KIENZ_DEBUG: :14 / openDialog", sdk.field.getValue());
15
-
16
14
  sdk.dialogs.openCurrentApp({
17
15
  title: 'Inhalt bearbeiten',
18
16
  width: 'fullWidth',
@@ -21,9 +19,8 @@ const Field = ({sdk}) => {
21
19
  shouldCloseOnOverlayClick: false,
22
20
  shouldCloseOnEscapePress: false,
23
21
  minHeight: 500,
24
- parameters: {value: sdk.field.getValue()},
22
+ parameters: {value: sdk.field.getValue(), portal: sdk.entry.fields.portal.getValue()},
25
23
  }).then((data) => {
26
- console.log("KIENZ_DEBUG: :26 / ANON", data);
27
24
  if (data) {
28
25
  sdk.field.setValue(data);
29
26
  }
package/src/dev.js CHANGED
@@ -1,3 +1,4 @@
1
+ import './scss/index.scss';
1
2
  import './scss/dev.scss';
2
3
  import {BaseContentfulApp} from "./index"
3
4
 
package/src/index.js CHANGED
@@ -9,16 +9,16 @@ import '@contentful/forma-36-react-components/dist/styles.css';
9
9
  import '@contentful/forma-36-fcss/dist/styles.css';
10
10
  import '@contentful/forma-36-tokens/dist/css/index.css';
11
11
  import '@vonaffenfels/slate-editor/dist/index.css';
12
- import './scss/index.scss';
13
12
 
14
13
  import EntryEditor from './components/EntryEditor';
15
14
  import Config from './components/ConfigScreen';
16
15
  import Field from './components/Field';
17
16
  import Dialog from "./components/Dialog";
18
17
 
19
- export const BaseContentfulApp = () => {
18
+ export const BaseContentfulApp = (props) => {
20
19
  init((sdk) => {
21
20
  const rootContainer = document.getElementById('root');
21
+ const RendererWrapperComponent = props.RendererWrapperComponent || (({children}) => <div>{children}</div>);
22
22
 
23
23
  const ComponentLocationSettings = [
24
24
  {
@@ -27,21 +27,21 @@ export const BaseContentfulApp = () => {
27
27
  },
28
28
  {
29
29
  location: locations.LOCATION_ENTRY_FIELD,
30
- component: <Field sdk={sdk}/>,
30
+ component: <RendererWrapperComponent sdk={sdk}><Field sdk={sdk}/></RendererWrapperComponent>,
31
31
  },
32
32
  {
33
33
  location: locations.LOCATION_ENTRY_EDITOR,
34
- component: <EntryEditor
34
+ component: <RendererWrapperComponent sdk={sdk}><EntryEditor
35
35
  sdk={sdk}
36
36
  onStorybookElementClick={element => {
37
37
  const storybookElementChangeEvent = new CustomEvent("storybookElementChange", {detail: element});
38
38
 
39
39
  window.parent.document.dispatchEvent(storybookElementChangeEvent);
40
- }}/>,
40
+ }}/></RendererWrapperComponent>,
41
41
  },
42
42
  {
43
43
  location: locations.LOCATION_DIALOG,
44
- component: <Dialog sdk={sdk}/>,
44
+ component: <RendererWrapperComponent sdk={sdk}><Dialog sdk={sdk}/></RendererWrapperComponent>,
45
45
  },
46
46
  ];
47
47
 
package/webpack.config.js CHANGED
@@ -6,6 +6,7 @@ const {readFileSync} = require("fs");
6
6
  const {CleanWebpackPlugin} = require('clean-webpack-plugin');
7
7
 
8
8
  module.exports = ({
9
+ outPath = path.resolve(__dirname, 'dist'),
9
10
  babelConfig = JSON.parse(readFileSync("../../.babelrc").toString()),
10
11
  componentImportRoot = "@vonaffenfels/slate-editor/src/dev/testComponents",
11
12
  relativePathToComponents = path.resolve(__dirname + "../../../@base/slate-editor/src/dev/testComponents"),
@@ -159,7 +160,7 @@ module.exports = ({
159
160
  libraryTarget: "umd",
160
161
  publicPath: "/",
161
162
  globalObject: "this",
162
- path: path.resolve(__dirname, 'dist'),
163
+ path: outPath,
163
164
  },
164
165
  };
165
166
  };