@lofcz/platejs-core 53.4.7 → 53.4.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.
@@ -5,17 +5,16 @@ import { NodeApi, PathApi, createEditor } from "@platejs/slate";
5
5
  import { isDefined } from "@udecode/utils";
6
6
  import { DefaultPlaceholder, Editable, Slate, useComposing, useFocused, useReadOnly, useSelected, useSlateStatic, withReact } from "slate-react";
7
7
  import { c } from "react-compiler-runtime";
8
- import React, { useEffect, useId, useRef } from "react";
8
+ import React, { useEffect, useId, useMemo, useRef } from "react";
9
9
  import { Key, useHotkeys } from "@udecode/react-hotkeys";
10
- import { atom, atom as atom$1 } from "jotai";
11
- import { createAtomStore, useAtomStoreSet, useAtomStoreState, useAtomStoreValue, useStoreAtomState, useStoreAtomValue, useStoreAtomValue as useStoreAtomValue$1, useStoreSetAtom } from "jotai-x";
10
+ import { atom, atom as atom$1, getDefaultStore, useAtomValueRawSync, useSetAtom } from "jotai";
11
+ import { createStore } from "jotai/vanilla";
12
+ import { selectAtom, useHydrateAtoms } from "jotai/utils";
12
13
  import { createZustandStore, createZustandStore as createZustandStore$1, useStoreSelect, useStoreSelect as useStoreSelect$1, useStoreState, useStoreValue, useStoreValue as useStoreValue$1, useTracked, useTrackedStore } from "zustand-x";
13
14
  import clsx$1, { clsx } from "clsx";
14
15
  import omit from "lodash/omit.js";
15
16
  import { useDeepCompareMemo } from "use-deep-compare";
16
17
  import { useComposedRef, useStableFn } from "@udecode/react-utils";
17
- import { createStore } from "jotai/vanilla";
18
- import { selectAtom } from "jotai/utils";
19
18
  import { focusAtom } from "jotai-optics";
20
19
 
21
20
  //#region src/react/components/ContentVisibilityChunk.tsx
@@ -41,6 +40,476 @@ const ContentVisibilityChunk = (t0) => {
41
40
  return t2;
42
41
  };
43
42
 
43
+ //#endregion
44
+ //#region ../udecode/jotai-x/src/atomWithFn.ts
45
+ const wrapFn = (fnOrValue) => typeof fnOrValue === "function" ? { __fn: fnOrValue } : fnOrValue;
46
+ const unwrapFn = (wrappedFnOrValue) => wrappedFnOrValue && typeof wrappedFnOrValue === "object" && "__fn" in wrappedFnOrValue ? wrappedFnOrValue.__fn : wrappedFnOrValue;
47
+ /**
48
+ * Jotai atoms don't allow functions as values by default. This function is a
49
+ * drop-in replacement for `atom` that wraps functions in an object while
50
+ * leaving non-functions unchanged. The wrapper object should be completely
51
+ * invisible to consumers of the atom.
52
+ */
53
+ const atomWithFn = (initialValue) => {
54
+ const baseAtom = atom$1(wrapFn(initialValue));
55
+ return atom$1((get) => unwrapFn(get(baseAtom)), (_get, set, value) => set(baseAtom, wrapFn(value)));
56
+ };
57
+
58
+ //#endregion
59
+ //#region ../udecode/jotai-x/src/useHydrateStore.ts
60
+ /**
61
+ * Hydrate atoms with initial values for SSR.
62
+ */
63
+ const useHydrateStore = (atoms, initialValues, t0) => {
64
+ const $ = c(5);
65
+ let t1;
66
+ if ($[0] !== t0) {
67
+ t1 = t0 === void 0 ? {} : t0;
68
+ $[0] = t0;
69
+ $[1] = t1;
70
+ } else t1 = $[1];
71
+ const options = t1;
72
+ let nextValues;
73
+ if ($[2] !== atoms || $[3] !== initialValues) {
74
+ nextValues = [];
75
+ for (const key of Object.keys(atoms)) {
76
+ const initialValue = initialValues[key];
77
+ if (initialValue !== void 0) nextValues.push([atoms[key], initialValue]);
78
+ }
79
+ $[2] = atoms;
80
+ $[3] = initialValues;
81
+ $[4] = nextValues;
82
+ } else nextValues = $[4];
83
+ useHydrateAtoms(nextValues, options);
84
+ };
85
+ /**
86
+ * Update atoms with new values on changes.
87
+ */
88
+ const useSyncStore = (atoms, values, t0) => {
89
+ const $ = c(12);
90
+ let t1;
91
+ if ($[0] !== t0) {
92
+ t1 = t0 === void 0 ? {} : t0;
93
+ $[0] = t0;
94
+ $[1] = t1;
95
+ } else t1 = $[1];
96
+ const { skipInitialValues, store: storeOption } = t1;
97
+ let t2;
98
+ if ($[2] !== atoms) {
99
+ t2 = Object.entries(atoms);
100
+ $[2] = atoms;
101
+ $[3] = t2;
102
+ } else t2 = $[3];
103
+ const atomEntries = t2;
104
+ let t3;
105
+ if ($[4] !== atomEntries) {
106
+ t3 = atom$1(null, (_get, set, nextValues) => {
107
+ const previousValues = nextValues.previousValues;
108
+ for (const [key, writableAtom] of atomEntries) {
109
+ const value = nextValues.values[key];
110
+ if (value === void 0 || value === null) continue;
111
+ if (previousValues && Object.is(previousValues[key], value)) continue;
112
+ set(writableAtom, value);
113
+ }
114
+ });
115
+ $[4] = atomEntries;
116
+ $[5] = t3;
117
+ } else t3 = $[5];
118
+ const syncAtom = t3;
119
+ let t4;
120
+ if ($[6] !== storeOption) {
121
+ t4 = { store: storeOption };
122
+ $[6] = storeOption;
123
+ $[7] = t4;
124
+ } else t4 = $[7];
125
+ const syncValues = useSetAtom(syncAtom, t4);
126
+ const previousValuesRef = React.useRef(skipInitialValues);
127
+ let t5;
128
+ let t6;
129
+ if ($[8] !== syncValues || $[9] !== values) {
130
+ t5 = () => {
131
+ syncValues({
132
+ previousValues: previousValuesRef.current,
133
+ values
134
+ });
135
+ previousValuesRef.current = values;
136
+ };
137
+ t6 = [syncValues, values];
138
+ $[8] = syncValues;
139
+ $[9] = values;
140
+ $[10] = t5;
141
+ $[11] = t6;
142
+ } else {
143
+ t5 = $[10];
144
+ t6 = $[11];
145
+ }
146
+ React.useEffect(t5, t6);
147
+ };
148
+
149
+ //#endregion
150
+ //#region ../udecode/jotai-x/src/createAtomProvider.tsx
151
+ const getFullyQualifiedScope = (storeName, scope) => `${storeName}:${scope}`;
152
+ /**
153
+ * Context mapping store name and scope to store. The 'provider' scope is used
154
+ * to reference any provider belonging to the store, regardless of scope.
155
+ */
156
+ const PROVIDER_SCOPE = "provider";
157
+ const AtomStoreContext = React.createContext(/* @__PURE__ */ new Map());
158
+ /**
159
+ * Tries to find a store in each of the following places, in order:
160
+ * 1. The store context, matching the store name and scope
161
+ * 2. The store context, matching the store name and 'provider' scope
162
+ * 3. Otherwise, return undefined
163
+ */
164
+ const useAtomStore = (storeName, t0, t1) => {
165
+ const $ = c(4);
166
+ const scope = t0 === void 0 ? PROVIDER_SCOPE : t0;
167
+ const warnIfUndefined = t1 === void 0 ? true : t1;
168
+ const storeContext = React.useContext(AtomStoreContext);
169
+ let t2;
170
+ if ($[0] !== scope || $[1] !== storeContext || $[2] !== storeName) {
171
+ t2 = storeContext.get(getFullyQualifiedScope(storeName, scope)) ?? storeContext.get(getFullyQualifiedScope(storeName, PROVIDER_SCOPE));
172
+ $[0] = scope;
173
+ $[1] = storeContext;
174
+ $[2] = storeName;
175
+ $[3] = t2;
176
+ } else t2 = $[3];
177
+ const store = t2;
178
+ if (!store && warnIfUndefined) console.warn(`Tried to access jotai store '${storeName}' outside of a matching provider.`);
179
+ return store;
180
+ };
181
+ const HydrateAtoms = (t0) => {
182
+ const $ = c(16);
183
+ let atoms;
184
+ let children;
185
+ let initialValues;
186
+ let props;
187
+ let store;
188
+ if ($[0] !== t0) {
189
+ ({initialValues, children, store, atoms, ...props} = t0);
190
+ $[0] = t0;
191
+ $[1] = atoms;
192
+ $[2] = children;
193
+ $[3] = initialValues;
194
+ $[4] = props;
195
+ $[5] = store;
196
+ } else {
197
+ atoms = $[1];
198
+ children = $[2];
199
+ initialValues = $[3];
200
+ props = $[4];
201
+ store = $[5];
202
+ }
203
+ let t1;
204
+ if ($[6] !== initialValues || $[7] !== props) {
205
+ t1 = {
206
+ ...initialValues,
207
+ ...props
208
+ };
209
+ $[6] = initialValues;
210
+ $[7] = props;
211
+ $[8] = t1;
212
+ } else t1 = $[8];
213
+ const hydratedValues = t1;
214
+ let t2;
215
+ if ($[9] !== store) {
216
+ t2 = { store };
217
+ $[9] = store;
218
+ $[10] = t2;
219
+ } else t2 = $[10];
220
+ useHydrateStore(atoms, hydratedValues, t2);
221
+ const t3 = props;
222
+ let t4;
223
+ if ($[11] !== store || $[12] !== t3) {
224
+ t4 = {
225
+ store,
226
+ skipInitialValues: t3
227
+ };
228
+ $[11] = store;
229
+ $[12] = t3;
230
+ $[13] = t4;
231
+ } else t4 = $[13];
232
+ useSyncStore(atoms, props, t4);
233
+ let t5;
234
+ if ($[14] !== children) {
235
+ t5 = /* @__PURE__ */ React.createElement(React.Fragment, null, children);
236
+ $[14] = children;
237
+ $[15] = t5;
238
+ } else t5 = $[15];
239
+ return t5;
240
+ };
241
+ /**
242
+ * Creates a generic provider for a jotai store.
243
+ * - `initialValues`: Initial values for the store.
244
+ * - `props`: Dynamic values for the store.
245
+ */
246
+ const createAtomProvider = (storeScope, atoms, options = {}) => {
247
+ const Effect = options.effect;
248
+ return ({ store, scope, children, resetKey, ...props }) => {
249
+ const [storeState, setStoreState] = React.useState(() => store ?? createStore());
250
+ const resolvedStore = store ?? storeState;
251
+ React.useEffect(() => {
252
+ if (!store && resetKey) setStoreState(createStore());
253
+ }, [resetKey, store]);
254
+ const previousStoreContext = React.useContext(AtomStoreContext);
255
+ const storeContext = React.useMemo(() => {
256
+ const newStoreContext = new Map(previousStoreContext);
257
+ if (scope) newStoreContext.set(getFullyQualifiedScope(storeScope, scope), resolvedStore);
258
+ newStoreContext.set(getFullyQualifiedScope(storeScope, PROVIDER_SCOPE), resolvedStore);
259
+ return newStoreContext;
260
+ }, [
261
+ previousStoreContext,
262
+ resolvedStore,
263
+ scope
264
+ ]);
265
+ return /* @__PURE__ */ React.createElement(AtomStoreContext.Provider, { value: storeContext }, /* @__PURE__ */ React.createElement(HydrateAtoms, {
266
+ store: resolvedStore,
267
+ atoms,
268
+ ...props
269
+ }, !!Effect && /* @__PURE__ */ React.createElement(Effect, null), children));
270
+ };
271
+ };
272
+
273
+ //#endregion
274
+ //#region ../udecode/jotai-x/src/createAtomStore.ts
275
+ const capitalizeFirstLetter = (str = "") => str.length > 0 ? str[0].toUpperCase() + str.slice(1) : "";
276
+ const isAtom = (possibleAtom) => !!possibleAtom && typeof possibleAtom === "object" && "read" in possibleAtom && typeof possibleAtom.read === "function";
277
+ const convertScopeShorthand = (optionsOrScope = {}) => typeof optionsOrScope === "string" ? { scope: optionsOrScope } : optionsOrScope;
278
+ const identity = (x) => x;
279
+ /**
280
+ * Create an atom store from an initial value.
281
+ * Each property will have a getter and setter.
282
+ *
283
+ * @example
284
+ * const { exampleStore, useExampleStore, useExampleValue, useExampleState, useExampleSet } = createAtomStore({ count: 1, say: 'hello' }, { name: 'example' as const })
285
+ * const [count, setCount] = useExampleState()
286
+ * const say = useExampleValue('say')
287
+ * const setSay = useExampleSet('say')
288
+ * setSay('world')
289
+ * const countAtom = exampleStore.atom.count
290
+ */
291
+ const createAtomStore = (initialState, { name, effect, extend, suppressWarnings }) => {
292
+ const atomsWithoutExtend = {};
293
+ const writableAtomsWithoutExtend = {};
294
+ const atomIsWritable = {};
295
+ /**
296
+ * Constructor to generate the object returned by `useStoreApi`. Using
297
+ * prototypes is much faster than constructing a new object every time the
298
+ * hook is called.
299
+ */
300
+ function UseStoreApiFactory(options, store) {
301
+ this.options = options;
302
+ this.store = store;
303
+ }
304
+ for (const [key, atomOrValue] of Object.entries(initialState)) {
305
+ const atomConfig = isAtom(atomOrValue) ? atomOrValue : atomWithFn(atomOrValue);
306
+ atomsWithoutExtend[key] = atomConfig;
307
+ const writable = "write" in atomConfig;
308
+ atomIsWritable[key] = writable;
309
+ if (writable) writableAtomsWithoutExtend[key] = atomConfig;
310
+ }
311
+ const atoms = { ...atomsWithoutExtend };
312
+ if (extend) {
313
+ const extendedAtoms = extend(atomsWithoutExtend);
314
+ for (const [key, atomConfig] of Object.entries(extendedAtoms)) {
315
+ atoms[key] = atomConfig;
316
+ atomIsWritable[key] = "write" in atomConfig;
317
+ }
318
+ }
319
+ const useStore = (t0) => {
320
+ const $ = c(4);
321
+ let t1;
322
+ if ($[0] !== t0) {
323
+ t1 = t0 === void 0 ? {} : t0;
324
+ $[0] = t0;
325
+ $[1] = t1;
326
+ } else t1 = $[1];
327
+ const optionsOrScope = t1;
328
+ let t2;
329
+ if ($[2] !== optionsOrScope) {
330
+ t2 = convertScopeShorthand(optionsOrScope);
331
+ $[2] = optionsOrScope;
332
+ $[3] = t2;
333
+ } else t2 = $[3];
334
+ const { scope, store, warnIfNoStore: t3 } = t2;
335
+ const contextStore = useAtomStore(name, scope, !store && (t3 === void 0 ? !suppressWarnings : t3));
336
+ return store ?? contextStore;
337
+ };
338
+ const useAtomValueWithStore = (atomConfig, store, _optionsOrScope, selector, equalityFnOrDeps, deps) => {
339
+ const resolvedSelector = selector ?? identity;
340
+ const equalityFn = typeof equalityFnOrDeps === "function" ? equalityFnOrDeps : void 0;
341
+ const resolvedDeps = (typeof equalityFnOrDeps === "function" ? deps : equalityFnOrDeps) ?? [resolvedSelector, equalityFn];
342
+ const [memoizedSelector, memoizedEqualityFn] = React.useMemo(() => [resolvedSelector, equalityFn], resolvedDeps);
343
+ return useAtomValueRawSync(React.useMemo(() => memoizedSelector === identity && !memoizedEqualityFn ? atomConfig : selectAtom(atomConfig, memoizedSelector, memoizedEqualityFn), [
344
+ atomConfig,
345
+ memoizedSelector,
346
+ memoizedEqualityFn
347
+ ]), { store });
348
+ };
349
+ const getAtomWithStore = (atomConfig, store, _optionsOrScope) => (store ?? getDefaultStore()).get(atomConfig);
350
+ const useSetAtomWithStore = (atomConfig, store, _optionsOrScope) => {
351
+ const $ = c(2);
352
+ let t0;
353
+ if ($[0] !== store) {
354
+ t0 = { store };
355
+ $[0] = store;
356
+ $[1] = t0;
357
+ } else t0 = $[1];
358
+ return useSetAtom(atomConfig, t0);
359
+ };
360
+ const setAtomWithStore = (atomConfig, store, _optionsOrScope) => (...args) => (store ?? getDefaultStore()).set(atomConfig, ...args);
361
+ const useAtomStateWithStore = (atomConfig, store, _optionsOrScope) => {
362
+ const $ = c(7);
363
+ let t0;
364
+ if ($[0] !== store) {
365
+ t0 = { store };
366
+ $[0] = store;
367
+ $[1] = t0;
368
+ } else t0 = $[1];
369
+ const t1 = useAtomValueRawSync(atomConfig, t0);
370
+ let t2;
371
+ if ($[2] !== store) {
372
+ t2 = { store };
373
+ $[2] = store;
374
+ $[3] = t2;
375
+ } else t2 = $[3];
376
+ const t3 = useSetAtom(atomConfig, t2);
377
+ let t4;
378
+ if ($[4] !== t1 || $[5] !== t3) {
379
+ t4 = [t1, t3];
380
+ $[4] = t1;
381
+ $[5] = t3;
382
+ $[6] = t4;
383
+ } else t4 = $[6];
384
+ return t4;
385
+ };
386
+ const subscribeAtomWithStore = (atomConfig, store, _optionsOrScope) => (callback) => {
387
+ const resolvedStore = store ?? getDefaultStore();
388
+ const unsubscribe = resolvedStore.sub(atomConfig, () => {
389
+ callback(resolvedStore.get(atomConfig));
390
+ });
391
+ return () => unsubscribe();
392
+ };
393
+ for (const key of Object.keys(atoms)) {
394
+ const atomConfig = atoms[key];
395
+ const isWritable = atomIsWritable[key];
396
+ const capitalizedKey = capitalizeFirstLetter(key);
397
+ UseStoreApiFactory.prototype[`use${capitalizedKey}Value`] = function(selector, equalityFnOrDeps, deps) {
398
+ return useAtomValueWithStore(atomConfig, this.store, this.options, selector, equalityFnOrDeps, deps);
399
+ };
400
+ UseStoreApiFactory.prototype[`get${capitalizedKey}`] = function() {
401
+ return getAtomWithStore(atomConfig, this.store, this.options);
402
+ };
403
+ UseStoreApiFactory.prototype[`subscribe${capitalizedKey}`] = function(callback) {
404
+ return subscribeAtomWithStore(atomConfig, this.store, this.options)(callback);
405
+ };
406
+ if (isWritable) {
407
+ UseStoreApiFactory.prototype[`useSet${capitalizedKey}`] = function() {
408
+ return useSetAtomWithStore(atomConfig, this.store, this.options);
409
+ };
410
+ UseStoreApiFactory.prototype[`set${capitalizedKey}`] = function(...args) {
411
+ return setAtomWithStore(atomConfig, this.store, this.options)(...args);
412
+ };
413
+ UseStoreApiFactory.prototype[`use${capitalizedKey}State`] = function() {
414
+ return useAtomStateWithStore(atomConfig, this.store, this.options);
415
+ };
416
+ }
417
+ }
418
+ const defineUseStoreApiMethod = (methodNameWithKey, methodNameWithAtomConfig, fnWithKey, fnWithAtomConfig = fnWithKey) => {
419
+ UseStoreApiFactory.prototype[methodNameWithKey] = function(key, ...args) {
420
+ const atomConfig = atoms[key];
421
+ return fnWithKey(atomConfig, this.store, this.options, ...args);
422
+ };
423
+ UseStoreApiFactory.prototype[methodNameWithAtomConfig] = function(atomConfig, ...args) {
424
+ return fnWithAtomConfig(atomConfig, this.store, this.options, ...args);
425
+ };
426
+ };
427
+ defineUseStoreApiMethod("useValue", "useAtomValue", useAtomValueWithStore);
428
+ defineUseStoreApiMethod("get", "getAtom", getAtomWithStore);
429
+ defineUseStoreApiMethod("useSet", "useSetAtom", useSetAtomWithStore);
430
+ defineUseStoreApiMethod("set", "setAtom", (atomConfig, store, options, ...args) => setAtomWithStore(atomConfig, store, options)(...args), setAtomWithStore);
431
+ defineUseStoreApiMethod("useState", "useAtomState", useAtomStateWithStore);
432
+ defineUseStoreApiMethod("subscribe", "subscribeAtom", (atomConfig, store, options, callback) => subscribeAtomWithStore(atomConfig, store, options)(callback), subscribeAtomWithStore);
433
+ const Provider = createAtomProvider(name, writableAtomsWithoutExtend, { effect });
434
+ const storeApi = {
435
+ atom: atoms,
436
+ name
437
+ };
438
+ const useStoreApi = (options = {}) => {
439
+ const convertedOptions = convertScopeShorthand(options);
440
+ const store = useStore(convertedOptions);
441
+ return useMemo(() => new UseStoreApiFactory(convertedOptions, store), [
442
+ store,
443
+ convertedOptions.delay,
444
+ convertedOptions.scope,
445
+ convertedOptions.store,
446
+ convertedOptions.warnIfNoStore
447
+ ]);
448
+ };
449
+ const useNameState = (key, options) => {
450
+ const store = useStore(options) ?? getDefaultStore();
451
+ return useAtomStateWithStore(atoms[key], store, options);
452
+ };
453
+ const useNameValue = (key, t0, deps) => {
454
+ const $ = c(6);
455
+ let t1;
456
+ if ($[0] !== t0) {
457
+ t1 = t0 === void 0 ? {} : t0;
458
+ $[0] = t0;
459
+ $[1] = t1;
460
+ } else t1 = $[1];
461
+ let equalityFn;
462
+ let options;
463
+ let selector;
464
+ if ($[2] !== t1) {
465
+ ({equalityFn, selector, ...options} = t1);
466
+ $[2] = t1;
467
+ $[3] = equalityFn;
468
+ $[4] = options;
469
+ $[5] = selector;
470
+ } else {
471
+ equalityFn = $[3];
472
+ options = $[4];
473
+ selector = $[5];
474
+ }
475
+ const store = useStore(options) ?? getDefaultStore();
476
+ return useAtomValueWithStore(atoms[key], store, options, selector, equalityFn ?? deps, equalityFn && deps);
477
+ };
478
+ const useNameSet = (key, options) => {
479
+ const store = useStore(options) ?? getDefaultStore();
480
+ return useSetAtomWithStore(atoms[key], store, options);
481
+ };
482
+ const capitalizedName = capitalizeFirstLetter(name);
483
+ const storeApiIndex = name.length === 0 ? "store" : `${name}Store`;
484
+ return {
485
+ [`${capitalizedName}Provider`]: Provider,
486
+ [storeApiIndex]: storeApi,
487
+ [`use${capitalizedName}Store`]: useStoreApi,
488
+ [`use${capitalizedName}State`]: useNameState,
489
+ [`use${capitalizedName}Value`]: useNameValue,
490
+ [`use${capitalizedName}Set`]: useNameSet,
491
+ name
492
+ };
493
+ };
494
+ function useAtomStoreValue(store, key, selector, equalityFnOrDeps, deps) {
495
+ return store.useValue(key, selector, equalityFnOrDeps, deps);
496
+ }
497
+ function useAtomStoreSet(store, key) {
498
+ return store.useSet(key);
499
+ }
500
+ function useAtomStoreState(store, key) {
501
+ return store.useState(key);
502
+ }
503
+ function useStoreAtomValue(store, atom$2, selector, equalityFnOrDeps, deps) {
504
+ return store.useAtomValue(atom$2, selector, equalityFnOrDeps, deps);
505
+ }
506
+ function useStoreSetAtom(store, atom$2) {
507
+ return store.useSetAtom(atom$2);
508
+ }
509
+ function useStoreAtomState(store, atom$2) {
510
+ return store.useAtomState(atom$2);
511
+ }
512
+
44
513
  //#endregion
45
514
  //#region src/react/plugin/toPlatePlugin.ts
46
515
  const methodsToWrap = [
@@ -2529,7 +2998,7 @@ function useEditorPlugin(p, id) {
2529
2998
  //#region src/react/stores/plate/useEditorSelector.ts
2530
2999
  const useEditorSelector = (selector, deps, { id, equalityFn = (a, b) => a === b } = {}) => {
2531
3000
  const selectorAtom = React.useMemo(() => selectAtom(plateStore.atom.trackedEditor, ({ editor }, prev) => selector(editor, prev), equalityFn), deps);
2532
- return useStoreAtomValue$1(usePlateStore(id), selectorAtom);
3001
+ return useStoreAtomValue(usePlateStore(id), selectorAtom);
2533
3002
  };
2534
3003
 
2535
3004
  //#endregion
@@ -1,2 +1,2 @@
1
- import { $a as getEditorDOMFromHtmlString, Ao as SlateRenderElement, Ba as stripHtmlClassNames, Co as SlateRenderText, Do as pipeRenderLeafStatic, Eo as SlateRenderLeaf, Ga as getSelectedDomBlocks, Ha as isSelectOutside, Ja as getPluginDataAttributes, Ka as getRenderNodeStaticProps, Oo as pluginRenderLeafStatic, Qa as createStaticEditor, So as PlateStaticProps, To as pluginRenderTextStatic, Ua as getSelectedDomNode, Va as pipeDecorate, Wa as getSelectedDomFragment, Xa as getStaticPlugins, Ya as createStaticString, Za as ViewPlugin, _o as SerializeHtmlOptions, ao as SlateNodeProps, bo as LeafStatic, co as StyledSlateElementProps, do as useNodeAttributes, eo as SlateElement, fo as BoxStaticProps, go as SlateRenderTextProps, ho as SlateRenderNodeProps, io as SlateLeafProps, jo as pluginRenderElementStatic, ko as pipeRenderElementStatic, lo as StyledSlateLeafProps, mo as SlateRenderLeafProps, no as SlateHTMLProps, oo as SlateText, po as SlateRenderElementProps, qa as getNodeDataAttributes, ro as SlateLeaf, so as SlateTextProps, to as SlateElementProps, uo as StyledSlateTextProps, vo as serializeHtml, wo as pipeRenderTextStatic, xo as PlateStatic, yo as ElementStatic, za as stripSlateDataAttributes } from "../index-fLEDAjcC";
1
+ import { $a as getEditorDOMFromHtmlString, Ao as SlateRenderElement, Ba as stripHtmlClassNames, Co as SlateRenderText, Do as pipeRenderLeafStatic, Eo as SlateRenderLeaf, Ga as getSelectedDomBlocks, Ha as isSelectOutside, Ja as getPluginDataAttributes, Ka as getRenderNodeStaticProps, Oo as pluginRenderLeafStatic, Qa as createStaticEditor, So as PlateStaticProps, To as pluginRenderTextStatic, Ua as getSelectedDomNode, Va as pipeDecorate, Wa as getSelectedDomFragment, Xa as getStaticPlugins, Ya as createStaticString, Za as ViewPlugin, _o as SerializeHtmlOptions, ao as SlateNodeProps, bo as LeafStatic, co as StyledSlateElementProps, do as useNodeAttributes, eo as SlateElement, fo as BoxStaticProps, go as SlateRenderTextProps, ho as SlateRenderNodeProps, io as SlateLeafProps, jo as pluginRenderElementStatic, ko as pipeRenderElementStatic, lo as StyledSlateLeafProps, mo as SlateRenderLeafProps, no as SlateHTMLProps, oo as SlateText, po as SlateRenderElementProps, qa as getNodeDataAttributes, ro as SlateLeaf, so as SlateTextProps, to as SlateElementProps, uo as StyledSlateTextProps, vo as serializeHtml, wo as pipeRenderTextStatic, xo as PlateStatic, yo as ElementStatic, za as stripSlateDataAttributes } from "../index-CtgFx8a9";
2
2
  export { BoxStaticProps, ElementStatic, LeafStatic, PlateStatic, PlateStaticProps, SerializeHtmlOptions, SlateElement, SlateElementProps, SlateHTMLProps, SlateLeaf, SlateLeafProps, SlateNodeProps, SlateRenderElement, SlateRenderElementProps, SlateRenderLeaf, SlateRenderLeafProps, SlateRenderNodeProps, SlateRenderText, SlateRenderTextProps, SlateText, SlateTextProps, StyledSlateElementProps, StyledSlateLeafProps, StyledSlateTextProps, ViewPlugin, createStaticEditor, createStaticString, getEditorDOMFromHtmlString, getNodeDataAttributes, getPluginDataAttributes, getRenderNodeStaticProps, getSelectedDomBlocks, getSelectedDomFragment, getSelectedDomNode, getStaticPlugins, isSelectOutside, pipeDecorate, pipeRenderElementStatic, pipeRenderLeafStatic, pipeRenderTextStatic, pluginRenderElementStatic, pluginRenderLeafStatic, pluginRenderTextStatic, serializeHtml, stripHtmlClassNames, stripSlateDataAttributes, useNodeAttributes };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lofcz/platejs-core",
3
- "version": "53.4.7",
3
+ "version": "53.4.8",
4
4
  "description": "The core of Plate – a plugin system for slate",
5
5
  "keywords": [
6
6
  "contentEditable",
@@ -53,9 +53,8 @@
53
53
  "zustand-x": "6.2.1",
54
54
  "@platejs/slate": "npm:@lofcz/platejs-slate@53.4.6",
55
55
  "@udecode/react-hotkeys": "npm:@lofcz/udecode-react-hotkeys@52.3.6",
56
- "@udecode/react-utils": "npm:@lofcz/udecode-react-utils@52.3.4",
57
56
  "@udecode/utils": "npm:@lofcz/udecode-utils@52.3.4",
58
- "jotai-x": "npm:@lofcz/jotai-x@2.4.0"
57
+ "@udecode/react-utils": "npm:@lofcz/udecode-react-utils@52.3.4"
59
58
  },
60
59
  "peerDependencies": {
61
60
  "react": ">=18.0.0",
@@ -68,7 +67,8 @@
68
67
  "module": "./dist/index.js",
69
68
  "devDependencies": {
70
69
  "mutative": "^1.1.0",
71
- "@plate/scripts": "1.0.0"
70
+ "@plate/scripts": "1.0.0",
71
+ "jotai-x": "npm:@lofcz/jotai-x@2.4.0"
72
72
  },
73
73
  "scripts": {
74
74
  "brl": "plate-pkg p:brl",