@vonaffenfels/contentful-slate-editor 1.0.50 → 1.0.52

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.50",
3
+ "version": "1.0.52",
4
4
  "scripts": {
5
5
  "prepublish": "yarn run build",
6
6
  "dev": "yarn run start",
@@ -46,7 +46,8 @@
46
46
  "tailwindcss": "3.3.2",
47
47
  "url-loader": "^4.1.1",
48
48
  "webpack-cli": "^4.6.0",
49
- "webpack-dev-server": "^4.0.0-beta.2"
49
+ "webpack-dev-server": "^4.0.0-beta.2",
50
+ "webpack-watch-files-plugin": "^1.2.1"
50
51
  },
51
52
  "devDependencies": {
52
53
  "@babel/core": "^7.20.12",
@@ -86,13 +87,14 @@
86
87
  "tailwindcss": "3.3.2",
87
88
  "url-loader": "^4.1.1",
88
89
  "webpack-cli": "^4.6.0",
89
- "webpack-dev-server": "^4.0.0-beta.2"
90
+ "webpack-dev-server": "^4.0.0-beta.2",
91
+ "webpack-watch-files-plugin": "^1.2.1"
90
92
  },
91
93
  "dependencies": {
92
- "@vonaffenfels/slate-editor": "^1.0.49",
94
+ "@vonaffenfels/slate-editor": "^1.0.52",
93
95
  "webpack": "5.88.2"
94
96
  },
95
- "gitHead": "800ba160fefb3a90d11d3836b3946d52f2ba0ba6",
97
+ "gitHead": "41eb9767f8c80645382c0d77eae03bcefaac6fe4",
96
98
  "publishConfig": {
97
99
  "access": "public"
98
100
  }
@@ -92,12 +92,6 @@ const EditorField = ({
92
92
  return detatchValueChangeHandler;
93
93
  }, [portal, locale]);
94
94
 
95
- const fakeActiveContent = {};
96
- for (let field in entrySdk.fields) {
97
- fakeActiveContent.sys = entrySdk.getSys();
98
- fakeActiveContent[field] = entrySdk.fields[field].getValue();
99
- }
100
-
101
95
  const executeLoader = async (block, attributes) => {
102
96
  let loaderResult = {};
103
97
 
@@ -5,6 +5,7 @@ import Renderer from "@vonaffenfels/slate-editor/dist/Renderer";
5
5
  import componentLoader from "@vonaffenfels/slate-editor/componentLoader.js";
6
6
 
7
7
  const FIELD_HEIGHT = 300;
8
+ let _interval;
8
9
 
9
10
  const Field = ({
10
11
  sdk,
@@ -42,7 +43,8 @@ const Field = ({
42
43
  const handleValueChanged = value => {
43
44
  setValue(value);
44
45
 
45
- setInterval(() => {
46
+ clearInterval(_interval);
47
+ _interval = setInterval(() => {
46
48
  if (wrapperRef.current) {
47
49
  sdk.window.updateHeight(wrapperRef.current.clientHeight);
48
50
  }
package/webpack.config.js CHANGED
@@ -4,6 +4,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
4
4
  const webpack = require("webpack");
5
5
  const {readFileSync} = require("fs");
6
6
  const {CleanWebpackPlugin} = require('clean-webpack-plugin');
7
+ const slateEditorBase = require.resolve("@vonaffenfels/slate-editor").replace("index.js", "");
7
8
 
8
9
  module.exports = ({
9
10
  outPath = path.resolve(__dirname, 'dist'),
@@ -19,6 +20,15 @@ module.exports = ({
19
20
  },
20
21
  transpilePaths = [],
21
22
  }) => {
23
+
24
+
25
+ let fullTranspilePaths = [
26
+ path.resolve(__dirname, 'src'),
27
+ relativePathToComponents,
28
+ ...transpilePaths,
29
+ slateEditorBase,
30
+ ]
31
+
22
32
  return {
23
33
  mode: 'production',
24
34
  entry: {index: './src/index.js'},
@@ -58,11 +68,7 @@ module.exports = ({
58
68
  },
59
69
  {
60
70
  test: /\.js$/,
61
- include: [
62
- path.resolve(__dirname, 'src'),
63
- relativePathToComponents,
64
- ...transpilePaths,
65
- ],
71
+ include: fullTranspilePaths,
66
72
  use: [
67
73
  {
68
74
  loader: 'babel-loader',
@@ -72,11 +78,7 @@ module.exports = ({
72
78
  },
73
79
  {
74
80
  test: /\.s[ac]ss$/i,
75
- include: [
76
- path.resolve(__dirname, 'src', 'scss'),
77
- relativePathToComponents,
78
- ...transpilePaths,
79
- ],
81
+ include: fullTranspilePaths,
80
82
  use: [
81
83
  "style-loader",
82
84
  {
@@ -158,9 +160,8 @@ module.exports = ({
158
160
  new CleanWebpackPlugin(),
159
161
  new HtmlWebpackPlugin({template: path.join(__dirname, 'src', 'index.html')}),
160
162
  new MiniCssExtractPlugin({}),
161
- new webpack.DefinePlugin({
162
- 'process.env': JSON.stringify(process.env),
163
- 'process': JSON.stringify({env: process.env}),
163
+ new webpack.ProvidePlugin({
164
+ process: 'process/browser.js',
164
165
  }),
165
166
  ],
166
167
  resolve: {
@@ -180,5 +181,8 @@ module.exports = ({
180
181
  globalObject: "this",
181
182
  path: outPath,
182
183
  },
184
+ snapshot: {
185
+ managedPaths: [],
186
+ },
183
187
  };
184
188
  };