slate-vue3 0.15.0 → 1.0.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.
package/README.md CHANGED
@@ -36,7 +36,7 @@
36
36
  #### 1. Install slate-vue3
37
37
 
38
38
  ```sh
39
- npm install slate-vue3 slate-history
39
+ npm install slate-vue3
40
40
  ```
41
41
 
42
42
  #### 2. Now, you can use it in vue-sfc :point_right: [**live demo**](https://guan-erjia.github.io/slate-vue3/examples/rich-text)
@@ -44,7 +44,6 @@ npm install slate-vue3 slate-history
44
44
  ```vue
45
45
  <script setup lang="ts">
46
46
  import { Slate, Editable, createReactiveEditor } from "slate-vue3";
47
- import { withHistory } from "slate-history";
48
47
 
49
48
  const initialValue = [
50
49
  {
@@ -52,7 +51,7 @@ const initialValue = [
52
51
  children: [{ text: "Let's start" }],
53
52
  },
54
53
  ];
55
- const editor = withHistory(createReactiveEditor());
54
+ const editor = createReactiveEditor();
56
55
  editor.children = initialValue;
57
56
  </script>
58
57
 
package/dist/dom.js CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as getSlateFragmentAttribute, A as HAS_BEFORE_INPUT_SUPPORT, B as IS_SAFARI_LEGACY, C as MARK_PLACEHOLDER_SYMBOL, D as NODE_TO_PARENT, E as NODE_TO_KEY, F as IS_CHROME_LEGACY, G as containsShadowAware, H as IS_WEBKIT, I as IS_EDGE_LEGACY, J as getDefaultView, K as getActiveElement, L as IS_FIREFOX, M as IS_ANDROID_CHROME_LEGACY, N as IS_APPLE, O as Key, P as IS_CHROME, Q as getSelection, R as IS_FIREFOX_LEGACY, S as IS_READ_ONLY, T as NODE_TO_INDEX, U as IS_WECHATBROWSER, V as IS_UC_MOBILE, W as closestShadowAware, X as getEditableChildAndIndex, Y as getEditableChild, Z as getPlainText, _ as EDITOR_TO_USER_SELECTION, a as Hotkeys, at as isDOMNode, b as IS_COMPOSING, c as withDOM, ct as isPlainTextOnlyPaste, et as hasShadowRoot, f as DOMEditor, g as EDITOR_TO_USER_MARKS, h as EDITOR_TO_ON_CHANGE, i as splitDecorationsByChild, it as isDOMElement, j as IS_ANDROID, k as CAN_USE_DOM, lt as isTrackedMutation, m as EDITOR_TO_KEY_TO_ELEMENT, n as isTextDecorationsEqual, nt as isBefore, o as applyStringDiff, ot as isDOMSelection, p as EDITOR_TO_ELEMENT, q as getClipboardData, r as shallowCompare, rt as isDOMComment, s as normalizeStringDiff, st as isDOMText, t as isElementDecorationsEqual, tt as isAfter, ut as normalizeDOMPoint, v as EDITOR_TO_WINDOW, w as NODE_TO_ELEMENT, x as IS_FOCUSED, y as ELEMENT_TO_NODE, z as IS_IOS } from "./slate-dom-Bhp4HdEp.js";
2
- export { CAN_USE_DOM, DOMEditor, EDITOR_TO_ELEMENT, EDITOR_TO_KEY_TO_ELEMENT, EDITOR_TO_ON_CHANGE, EDITOR_TO_USER_MARKS, EDITOR_TO_USER_SELECTION, EDITOR_TO_WINDOW, ELEMENT_TO_NODE, HAS_BEFORE_INPUT_SUPPORT, Hotkeys, IS_ANDROID, IS_ANDROID_CHROME_LEGACY, IS_APPLE, IS_CHROME, IS_CHROME_LEGACY, IS_COMPOSING, IS_EDGE_LEGACY, IS_FIREFOX, IS_FIREFOX_LEGACY, IS_FOCUSED, IS_IOS, IS_READ_ONLY, IS_SAFARI_LEGACY, IS_UC_MOBILE, IS_WEBKIT, IS_WECHATBROWSER, Key, MARK_PLACEHOLDER_SYMBOL, NODE_TO_ELEMENT, NODE_TO_INDEX, NODE_TO_KEY, NODE_TO_PARENT, applyStringDiff, closestShadowAware, containsShadowAware, getActiveElement, getClipboardData, getDefaultView, getEditableChild, getEditableChildAndIndex, getPlainText, getSelection, getSlateFragmentAttribute, hasShadowRoot, isAfter, isBefore, isDOMComment, isDOMElement, isDOMNode, isDOMSelection, isDOMText, isElementDecorationsEqual, isPlainTextOnlyPaste, isTextDecorationsEqual, isTrackedMutation, normalizeDOMPoint, normalizeStringDiff, shallowCompare, splitDecorationsByChild, withDOM };
1
+ import { $ as getSelection, A as CAN_USE_DOM, B as IS_IOS, C as MARK_PLACEHOLDER_SYMBOL, D as NODE_TO_PARENT, E as NODE_TO_KEY, F as IS_CHROME, G as closestShadowAware, H as IS_UC_MOBILE, I as IS_CHROME_LEGACY, J as getClipboardData, K as containsShadowAware, L as IS_EDGE_LEGACY, M as IS_ANDROID, N as IS_ANDROID_CHROME_LEGACY, O as PLACEHOLDER_SYMBOL, P as IS_APPLE, Q as getPlainText, R as IS_FIREFOX, S as IS_READ_ONLY, T as NODE_TO_INDEX, U as IS_WEBKIT, V as IS_SAFARI_LEGACY, W as IS_WECHATBROWSER, X as getEditableChild, Y as getDefaultView, Z as getEditableChildAndIndex, _ as EDITOR_TO_USER_SELECTION, a as Hotkeys, at as isDOMElement, b as IS_COMPOSING, c as withDOM, ct as isDOMText, dt as normalizeDOMPoint, et as getSlateFragmentAttribute, f as DOMEditor, g as EDITOR_TO_USER_MARKS, h as EDITOR_TO_ON_CHANGE, i as splitDecorationsByChild, it as isDOMComment, j as HAS_BEFORE_INPUT_SUPPORT, k as Key, lt as isPlainTextOnlyPaste, m as EDITOR_TO_KEY_TO_ELEMENT, n as isTextDecorationsEqual, nt as isAfter, o as applyStringDiff, ot as isDOMNode, p as EDITOR_TO_ELEMENT, q as getActiveElement, r as shallowCompare, rt as isBefore, s as normalizeStringDiff, st as isDOMSelection, t as isElementDecorationsEqual, tt as hasShadowRoot, ut as isTrackedMutation, v as EDITOR_TO_WINDOW, w as NODE_TO_ELEMENT, x as IS_FOCUSED, y as ELEMENT_TO_NODE, z as IS_FIREFOX_LEGACY } from "./slate-dom-cOXt9FLf.js";
2
+ export { CAN_USE_DOM, DOMEditor, EDITOR_TO_ELEMENT, EDITOR_TO_KEY_TO_ELEMENT, EDITOR_TO_ON_CHANGE, EDITOR_TO_USER_MARKS, EDITOR_TO_USER_SELECTION, EDITOR_TO_WINDOW, ELEMENT_TO_NODE, HAS_BEFORE_INPUT_SUPPORT, Hotkeys, IS_ANDROID, IS_ANDROID_CHROME_LEGACY, IS_APPLE, IS_CHROME, IS_CHROME_LEGACY, IS_COMPOSING, IS_EDGE_LEGACY, IS_FIREFOX, IS_FIREFOX_LEGACY, IS_FOCUSED, IS_IOS, IS_READ_ONLY, IS_SAFARI_LEGACY, IS_UC_MOBILE, IS_WEBKIT, IS_WECHATBROWSER, Key, MARK_PLACEHOLDER_SYMBOL, NODE_TO_ELEMENT, NODE_TO_INDEX, NODE_TO_KEY, NODE_TO_PARENT, PLACEHOLDER_SYMBOL, applyStringDiff, closestShadowAware, containsShadowAware, getActiveElement, getClipboardData, getDefaultView, getEditableChild, getEditableChildAndIndex, getPlainText, getSelection, getSlateFragmentAttribute, hasShadowRoot, isAfter, isBefore, isDOMComment, isDOMElement, isDOMNode, isDOMSelection, isDOMText, isElementDecorationsEqual, isPlainTextOnlyPaste, isTextDecorationsEqual, isTrackedMutation, normalizeDOMPoint, normalizeStringDiff, shallowCompare, splitDecorationsByChild, withDOM };
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { d as reconcileChildren, l as KEY_TO_CHUNK_TREE, u as getChunkTreeForNode } from "./slate-dom-Bhp4HdEp.js";
2
- import { C as isEventHandled, D as SLATE_USE_FOCUSED, E as SLATE_USE_ELEMENT, O as SLATE_USE_READ_ONLY, S as isDOMEventTargetInput, T as SLATE_USE_EDITOR, _ as DEFAULT_PLACEHOLDER_RENDER, a as useFocused, b as handleNativeHistoryEvents, c as useReadOnly, d as useEditor, f as Slate, g as DEFAULT_LEAF_RENDER, h as DEFAULT_ELEMENT_RENDER, i as useSelected, k as SLATE_USE_SELECTION, l as useElement, m as DEFAULT_DECORATE_FN, n as useInheritRef, o as Editable, p as DEFAULT_CHUNK_RENDER, r as useSelection, s as useComposing, t as createReactiveEditor, u as useElementIf, v as DEFAULT_SCROLL_INTO_VIEW, w as SLATE_USE_COMPOSING, x as isDOMEventHandled, y as DEFAULT_TEXT_RENDER } from "./slate-vue-BAUZN2zq.js";
1
+ import { d as reconcileChildren, l as KEY_TO_CHUNK_TREE, u as getChunkTreeForNode } from "./slate-dom-cOXt9FLf.js";
2
+ import { C as isEventHandled, D as SLATE_USE_FOCUSED, E as SLATE_USE_ELEMENT, O as SLATE_USE_READ_ONLY, S as isDOMEventTargetInput, T as SLATE_USE_EDITOR, _ as DEFAULT_PLACEHOLDER_RENDER, a as useFocused, b as handleNativeHistoryEvents, c as useReadOnly, d as useEditor, f as Slate, g as DEFAULT_LEAF_RENDER, h as DEFAULT_ELEMENT_RENDER, i as useSelected, k as SLATE_USE_SELECTION, l as useElement, m as DEFAULT_DECORATE_FN, n as useInheritRef, o as Editable, p as DEFAULT_CHUNK_RENDER, r as useSelection, s as useComposing, t as createReactiveEditor, u as useElementIf, v as DEFAULT_SCROLL_INTO_VIEW, w as SLATE_USE_COMPOSING, x as isDOMEventHandled, y as DEFAULT_TEXT_RENDER } from "./slate-vue-CluiGoan.js";
3
3
  export { DEFAULT_CHUNK_RENDER, DEFAULT_DECORATE_FN, DEFAULT_ELEMENT_RENDER, DEFAULT_LEAF_RENDER, DEFAULT_PLACEHOLDER_RENDER, DEFAULT_SCROLL_INTO_VIEW, DEFAULT_TEXT_RENDER, Editable, KEY_TO_CHUNK_TREE, SLATE_USE_COMPOSING, SLATE_USE_EDITOR, SLATE_USE_ELEMENT, SLATE_USE_FOCUSED, SLATE_USE_READ_ONLY, SLATE_USE_SELECTION, Slate, createReactiveEditor, getChunkTreeForNode, handleNativeHistoryEvents, isDOMEventHandled, isDOMEventTargetInput, isEventHandled, reconcileChildren, useComposing, useEditor, useElement, useElementIf, useFocused, useInheritRef, useReadOnly, useSelected, useSelection };
@@ -2,6 +2,8 @@ import { BaseRange, BaseText } from 'slate';
2
2
  declare module "slate" {
3
3
  interface CustomTypes {
4
4
  Text: BaseText & {
5
+ placeholder?: string;
6
+ onPlaceholderResize?: (height?: number) => void;
5
7
  [key: string]: unknown;
6
8
  };
7
9
  Range: BaseRange & {
@@ -48,7 +48,9 @@ export interface DOMEditorInterface {
48
48
  /**
49
49
  * Focus the editor.
50
50
  */
51
- focus: (editor: DOMEditor) => void;
51
+ focus: (editor: DOMEditor, options?: {
52
+ retries: number;
53
+ }) => void;
52
54
  /**
53
55
  * Return the host window of the current editor.
54
56
  */
@@ -34,4 +34,5 @@ export declare const EDITOR_TO_ON_CHANGE: WeakMap<import('slate').BaseEditor, (o
34
34
  operation?: Operation;
35
35
  }) => void>;
36
36
  export declare const EDITOR_TO_USER_MARKS: WeakMap<Editor, Partial<Text> | null>;
37
+ export declare const PLACEHOLDER_SYMBOL: string;
37
38
  export declare const MARK_PLACEHOLDER_SYMBOL: string;