@portabletext/editor 1.0.3 → 1.0.5

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": "@portabletext/editor",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Portable Text Editor made in React",
5
5
  "keywords": [
6
6
  "sanity",
@@ -45,12 +45,12 @@
45
45
  "src"
46
46
  ],
47
47
  "dependencies": {
48
+ "@portabletext/patches": "1.0.0",
48
49
  "debug": "^3.2.7",
49
50
  "is-hotkey-esm": "^1.0.0",
50
51
  "lodash": "^4.17.21",
51
52
  "slate": "0.100.0",
52
- "slate-react": "0.101.0",
53
- "@portabletext/patches": "^0.0.0"
53
+ "slate-react": "0.101.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@babel/plugin-proposal-class-properties": "^7.18.6",
@@ -1,4 +1,4 @@
1
- import {type Patch} from '@portabletext/patches/types'
1
+ import {type Patch} from '@portabletext/patches'
2
2
  import {type PortableTextBlock} from '@sanity/types'
3
3
  import {throttle} from 'lodash'
4
4
  import {
@@ -1,6 +1,5 @@
1
1
  /* eslint-disable max-nested-callbacks */
2
- import {insert, setIfMissing, unset} from '@portabletext/patches/patch-event'
3
- import {type Patch} from '@portabletext/patches/types'
2
+ import {insert, type Patch, setIfMissing, unset} from '@portabletext/patches'
4
3
  import {type Subject} from 'rxjs'
5
4
  import {
6
5
  type Descendant,
@@ -3,7 +3,7 @@
3
3
  * The undo/redo steps are rebased against incoming patches since the step occurred.
4
4
  */
5
5
 
6
- import {type Patch} from '@portabletext/patches/types'
6
+ import {type Patch} from '@portabletext/patches'
7
7
  import {DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, parsePatch} from '@sanity/diff-match-patch'
8
8
  import {type ObjectSchemaType, type PortableTextBlock} from '@sanity/types'
9
9
  import {flatten, isEqual} from 'lodash'
package/src/index.ts CHANGED
@@ -7,4 +7,4 @@ export type {PortableTextEditorProps} from './editor/PortableTextEditor'
7
7
  export {PortableTextEditor} from './editor/PortableTextEditor'
8
8
  export * from './types/editor'
9
9
  export * from './types/options'
10
- export * from '@portabletext/patches/types'
10
+ export {type Patch} from '@portabletext/patches'
@@ -1,4 +1,4 @@
1
- import {type Patch} from '@portabletext/patches/types'
1
+ import {type Patch} from '@portabletext/patches'
2
2
  import {
3
3
  type ArraySchemaType,
4
4
  type BlockDecoratorDefinition,
@@ -1,5 +1,5 @@
1
1
  import {describe, expect, test} from '@jest/globals'
2
- import {type DiffMatchPatch} from '@portabletext/patches/types'
2
+ import {type DiffMatchPatch} from '@portabletext/patches'
3
3
  import {makeDiff, makePatches, stringifyPatches} from '@sanity/diff-match-patch'
4
4
  import {
5
5
  isPortableTextSpan,
@@ -1,8 +1,9 @@
1
1
  import {beforeEach, describe, expect, it} from '@jest/globals'
2
+ import {type Patch} from '@portabletext/patches'
2
3
  import {noop} from 'lodash'
3
4
  import {createEditor, type Descendant} from 'slate'
4
5
 
5
- import {keyGenerator, type Patch, PortableTextEditor} from '../..'
6
+ import {keyGenerator, PortableTextEditor} from '../..'
6
7
  import {schemaType} from '../../editor/__tests__/PortableTextEditorTester'
7
8
  import {withPlugins} from '../../editor/plugins'
8
9
  import {createApplyPatch} from '../applyPatch'
@@ -1,12 +1,12 @@
1
1
  /* eslint-disable max-statements */
2
- import {applyAll} from '@portabletext/patches/apply'
3
2
  import {
3
+ applyAll,
4
4
  type DiffMatchPatch,
5
5
  type InsertPatch,
6
6
  type Patch,
7
7
  type SetPatch,
8
8
  type UnsetPatch,
9
- } from '@portabletext/patches/types'
9
+ } from '@portabletext/patches'
10
10
  import {
11
11
  applyPatches as diffMatchPatchApplyPatches,
12
12
  cleanupEfficiency,
@@ -1,5 +1,12 @@
1
- import {diffMatchPatch, insert, set, setIfMissing, unset} from '@portabletext/patches/patch-event'
2
- import {type InsertPosition, type Patch} from '@portabletext/patches/types'
1
+ import {
2
+ diffMatchPatch,
3
+ insert,
4
+ type InsertPosition,
5
+ type Patch,
6
+ set,
7
+ setIfMissing,
8
+ unset,
9
+ } from '@portabletext/patches'
3
10
  import {type Path, type PortableTextSpan, type PortableTextTextBlock} from '@sanity/types'
4
11
  import {get, isUndefined, omitBy} from 'lodash'
5
12
  import {
@@ -1,4 +1,4 @@
1
- import {insert, set, setIfMissing, unset} from '@portabletext/patches/patch-event'
1
+ import {insert, set, setIfMissing, unset} from '@portabletext/patches'
2
2
  import {
3
3
  isPortableTextTextBlock,
4
4
  type PortableTextBlock,