@byline/richtext-lexical 3.1.1 → 3.2.1

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.
@@ -0,0 +1 @@
1
+ export declare function cloneDeep<T>(object: T, cache?: WeakMap<any, any>): T;
@@ -4,17 +4,17 @@ import { Shimmer } from "@byline/ui/react";
4
4
  let editorBundlePromise = null;
5
5
  function loadEditorBundle() {
6
6
  if (!editorBundlePromise) editorBundlePromise = (async ()=>{
7
- const [richtextMod, defaultMod, extensionsMod, lodashMod] = await Promise.all([
7
+ const [richtextMod, defaultMod, extensionsMod, cloneDeepMod] = await Promise.all([
8
8
  import("./richtext-field.js"),
9
9
  import("./field/config/default.js"),
10
10
  import("./field/config/default-extensions.js"),
11
- import("lodash-es")
11
+ import("./field/utils/cloneDeep.js")
12
12
  ]);
13
13
  return {
14
14
  RichTextField: richtextMod.RichTextField,
15
15
  defaultEditorConfig: defaultMod.defaultEditorConfig,
16
16
  defaultExtensionsList: extensionsMod.defaultExtensionsList,
17
- cloneDeep: lodashMod.cloneDeep
17
+ cloneDeep: cloneDeepMod.cloneDeep
18
18
  };
19
19
  })();
20
20
  return editorBundlePromise;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "type": "module",
5
5
  "license": "MPL-2.0",
6
- "version": "3.1.1",
6
+ "version": "3.2.1",
7
7
  "engines": {
8
8
  "node": ">=20.9.0"
9
9
  },
@@ -74,14 +74,13 @@
74
74
  "@lexical/utils": "0.44.0",
75
75
  "classnames": "^2.5.1",
76
76
  "lexical": "0.44.0",
77
- "lodash-es": "^4.18.1",
78
77
  "npm-run-all": "^4.1.5",
79
78
  "prism-react-renderer": "^2.4.1",
80
79
  "react-error-boundary": "^6.1.1",
81
- "@byline/client": "3.1.1",
82
- "@byline/ui": "3.1.1",
83
- "@byline/core": "3.1.1",
84
- "@byline/admin": "3.1.1"
80
+ "@byline/admin": "3.2.1",
81
+ "@byline/ui": "3.2.1",
82
+ "@byline/core": "3.2.1",
83
+ "@byline/client": "3.2.1"
85
84
  },
86
85
  "peerDependencies": {
87
86
  "react": "^19.0.0",
@@ -91,8 +90,6 @@
91
90
  "@biomejs/biome": "2.4.15",
92
91
  "@rsbuild/plugin-react": "^2.0.0",
93
92
  "@rslib/core": "^0.21.5",
94
- "@types/lodash": "^4.17.24",
95
- "@types/lodash-es": "^4.17.12",
96
93
  "@types/node": "^25.9.1",
97
94
  "@types/react": "19.2.15",
98
95
  "@types/react-dom": "19.2.3",
@@ -46,17 +46,22 @@ function loadEditorBundle(): Promise<EditorBundle> {
46
46
  // the factory more than once would otherwise create parallel promises.
47
47
  if (!editorBundlePromise) {
48
48
  editorBundlePromise = (async () => {
49
- const [richtextMod, defaultMod, extensionsMod, lodashMod] = await Promise.all([
49
+ const [richtextMod, defaultMod, extensionsMod, cloneDeepMod] = await Promise.all([
50
50
  import('./richtext-field'),
51
51
  import('./field/config/default'),
52
52
  import('./field/config/default-extensions'),
53
- import('lodash-es'),
53
+ // Use the in-package cloneDeep rather than pulling the whole lodash-es
54
+ // namespace (a dynamic `import('lodash-es')` defeats tree-shaking and
55
+ // emits a ~85KB chunk shared onto unrelated bundles). The local util
56
+ // also preserves functions/classes by reference — `structuredClone`
57
+ // would throw on the Lexical node classes in the config.
58
+ import('./field/utils/cloneDeep'),
54
59
  ])
55
60
  return {
56
61
  RichTextField: richtextMod.RichTextField,
57
62
  defaultEditorConfig: defaultMod.defaultEditorConfig,
58
63
  defaultExtensionsList: extensionsMod.defaultExtensionsList,
59
- cloneDeep: lodashMod.cloneDeep,
64
+ cloneDeep: cloneDeepMod.cloneDeep,
60
65
  }
61
66
  })()
62
67
  }