eco-vue-js 0.11.18 → 0.11.20
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/dist/components/Dropdown/utils/DropdownStyle.d.ts.map +1 -1
- package/dist/components/Dropdown/utils/DropdownStyle.js +5 -4
- package/dist/components/Input/WInput.vue.d.ts.map +1 -1
- package/dist/components/Input/WInput.vue.js +7 -6
- package/dist/components/Input/components/ContentEditable.vue.d.ts +5 -1
- package/dist/components/Input/components/ContentEditable.vue.d.ts.map +1 -1
- package/dist/components/Input/components/ContentEditable.vue2.js +10 -9
- package/dist/components/Input/models/utils.d.ts +3 -1
- package/dist/components/Input/models/utils.d.ts.map +1 -1
- package/dist/components/Input/models/utils.js +12 -6
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DropdownStyle.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/utils/DropdownStyle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;
|
1
|
+
{"version":3,"file":"DropdownStyle.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/utils/DropdownStyle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAGvD,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,KAAK,OAAO,CAAC,GAAG,SAAS,CAAA;CACvD,CAAA;AAID,oBAAY,OAAO;IACjB,GAAG,kBAAkB;IACrB,MAAM,gBAAgB;IACtB,MAAM,mBAAmB;CAC1B;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,MAAM,CAAA;CACnC,GAAG,WAAW,CAAA;AA6Df,oBAAY,OAAO;IACjB,IAAI,kBAAkB;IACtB,KAAK,gBAAgB;IACrB,MAAM,mBAAmB;CAC1B;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,mBAAmB,EAAE,CAAC,cAAc,EAAE,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;IACxE,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAA;IAC1C,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7D,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,MAAM,CAAA;CACnC,GAAG,WAAW,CAAA;AAIf;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,gBAMvB,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,gBAKvB,CAAA;AAkCF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,gBAMtB,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,gBAKtB,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,gBAGvB,CAAA;AAEF,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,eAAe,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,GAAG,CAAC,gBAAgB,CAAC,CASvH,CAAA;AAED,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,gBAAgB,GAAG,cAAc,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,GAAG,CAAC,CAItH"}
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import { markRaw } from 'vue';
|
2
2
|
import { HorizontalAlign } from '../../../utils/HorizontalAlign.js';
|
3
|
+
import { isClientSide } from '../../../utils/utils.js';
|
3
4
|
|
4
5
|
const EDGE_FACTOR = 0.66;
|
5
|
-
const BOTTOM_EDGE = window.innerHeight * EDGE_FACTOR;
|
6
|
+
const BOTTOM_EDGE = isClientSide ? window.innerHeight * EDGE_FACTOR : 0;
|
6
7
|
const BottomInner = markRaw({
|
7
8
|
isTop: false,
|
8
9
|
origin: "content-start" /* TOP */,
|
@@ -22,7 +23,7 @@ const VerticalCenter = markRaw({
|
|
22
23
|
y: (parentRect) => Math.round(parentRect.top + parentRect.height / 2),
|
23
24
|
isEdge: void 0
|
24
25
|
});
|
25
|
-
const TOP_EDGE = window.innerHeight * (1 - EDGE_FACTOR);
|
26
|
+
const TOP_EDGE = isClientSide ? window.innerHeight * (1 - EDGE_FACTOR) : 0;
|
26
27
|
const TopOuter = markRaw({
|
27
28
|
isTop: true,
|
28
29
|
origin: "content-end" /* BOTTOM */,
|
@@ -41,7 +42,7 @@ var OriginX = /* @__PURE__ */ ((OriginX2) => {
|
|
41
42
|
OriginX2["CENTER"] = "justify-center";
|
42
43
|
return OriginX2;
|
43
44
|
})(OriginX || {});
|
44
|
-
const RIGHT_EDGE = window.innerWidth * EDGE_FACTOR;
|
45
|
+
const RIGHT_EDGE = isClientSide ? window.innerWidth * EDGE_FACTOR : 0;
|
45
46
|
const RightOuter = markRaw({
|
46
47
|
verticalGetterOrder: [BottomInner, TopInner],
|
47
48
|
origin: "justify-start" /* LEFT */,
|
@@ -73,7 +74,7 @@ const Center = markRaw({
|
|
73
74
|
x: (parentRect) => Math.round(parentRect.left + parentRect.width / 2),
|
74
75
|
isEdge: void 0
|
75
76
|
});
|
76
|
-
const LEFT_EDGE = window.innerWidth * (1 - EDGE_FACTOR);
|
77
|
+
const LEFT_EDGE = isClientSide ? window.innerWidth * (1 - EDGE_FACTOR) : 0;
|
77
78
|
const LeftInner = markRaw({
|
78
79
|
verticalGetterOrder: [BottomOuter, TopOuter],
|
79
80
|
origin: "justify-end" /* RIGHT */,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInput.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInput.vue"],"names":[],"mappings":"AAoPA;AAqiBA,OAAO,KAAK,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,SAAS,CAAA;AAatD,OAAO,EAAC,KAAK,WAAW,EAAC,MAAM,gBAAgB,CAAA;yBAE9B,IAAI,SAAS,SAAS,GAAG,MAAM,EAC/C,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAoyBO,mBAAmB,CAAC,oCAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;qBAzmB7B,IAAI;oBAOL,IAAI;+BAkCS,aAAa;0BA1KlB,MAAM,QAAQ,MAAM,KAAG,IAAI;wBAN/B,WAAW;;;oBAyBf,IAAI;oBAgBJ,IAAI;MAusBgD,GAAG,IAAI;WACpE,GAAG;;uBAhEgB,GAAG;0BACA,GAAG;wBACJ,GAAG;;;YAEH,GAAG;;mCArgBF,aAAa;YAogBb,GAAG;;;YAEJ,GAAG;uBACJ,GAAG;wBACF,GAAG;uBACJ,GAAG;uBACH,GAAG;wBACF,GAAG;;;YAttB1B,oBAAoB,SAAS,4CAAa,SAAS,GAAG,IAAI;YAC1D,gBAAgB,SAAS,aAAa,GAAG,IAAI;YAC7C,aAAa,SAAS,aAAa,GAAG,IAAI;YAC1C,eAAe,SAAS,aAAa,GAAG,IAAI;YAC5C,iBAAiB,SAAS,aAAa,GAAG,IAAI;YAC9C,oBAAoB,SAAS,aAAa,GAAG,IAAI;YACjD,aAAa,GAAG,IAAI;YACpB,OAAO,SAAS,UAAU,GAAG,SAAS,GAAG,IAAI;YAC7C,MAAM,SAAS,UAAU,GAAG,IAAI;YAChC,OAAO,SAAS,UAAU,GAAG,IAAI;YACjC,WAAW,SAAS,UAAU,GAAG,IAAI;YACrC,cAAc,SAAS,UAAU,GAAG,IAAI;YACxC,cAAc,SAAS,KAAK,GAAG,IAAI;YACnC,OAAO,GAAG,IAAI;;EAmwBhB,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA/yBzE,wBA+yB4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -66,8 +66,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
66
66
|
},
|
67
67
|
emits: ["update:model-value", "keypress:enter", "keypress:up", "keypress:down", "keypress:delete", "keypress:backspace", "click:clear", "focus", "blur", "click", "mousedown", "click:suffix", "select:input", "paste"],
|
68
68
|
setup(__props, { expose: __expose, emit: __emit }) {
|
69
|
-
const InputToolbar = defineAsyncComponent(() => import('./components/InputToolbar.vue.js'));
|
70
69
|
const ContentEditable = defineAsyncComponent(() => import('./components/ContentEditable.vue.js'));
|
70
|
+
const InputToolbar = defineAsyncComponent(() => import('./components/InputToolbar.vue.js'));
|
71
71
|
const props = __props;
|
72
72
|
const emit = __emit;
|
73
73
|
const { isReadonly, isDisabled } = useComponentStates(props);
|
@@ -289,7 +289,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
289
289
|
name: "default",
|
290
290
|
fn: withCtx(() => [
|
291
291
|
createElementVNode("div", {
|
292
|
-
class: normalizeClass(["flex gap-1", {
|
292
|
+
class: normalizeClass(["flex max-w-full gap-1", {
|
293
293
|
"flex-wrap": !_ctx.seamless,
|
294
294
|
"overflow-hidden": _ctx.seamless
|
295
295
|
}])
|
@@ -297,10 +297,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
297
297
|
renderSlot(_ctx.$slots, "prefix"),
|
298
298
|
!_ctx.hideInput ? (openBlock(), createElementBlock("div", {
|
299
299
|
key: 0,
|
300
|
-
class: normalizeClass({
|
300
|
+
class: normalizeClass([{
|
301
301
|
"font-mono": _ctx.mono,
|
302
|
-
"text-secure": _ctx.textSecure && !isSecureVisible.value && _ctx.modelValue
|
303
|
-
|
302
|
+
"text-secure": _ctx.textSecure && !isSecureVisible.value && _ctx.modelValue,
|
303
|
+
"whitespace-pre": _ctx.textarea
|
304
|
+
}, "overflow-x-auto overscroll-x-contain"])
|
304
305
|
}, toDisplayString(_ctx.modelValue || _ctx.emptyValue), 3)) : createCommentVNode("", true)
|
305
306
|
], 2)
|
306
307
|
]),
|
@@ -320,7 +321,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
320
321
|
}]),
|
321
322
|
onClick: focus
|
322
323
|
}, [
|
323
|
-
_ctx.textarea && (_ctx.rich || _ctx.toolbarActions || _ctx.$slots.toolbar) ? (openBlock(), createBlock(unref(InputToolbar), {
|
324
|
+
!unref(isDisabled) && !unref(isReadonly) && _ctx.textarea && (_ctx.rich || _ctx.toolbarActions || _ctx.$slots.toolbar) ? (openBlock(), createBlock(unref(InputToolbar), {
|
324
325
|
key: 0,
|
325
326
|
list: _ctx.toolbarActions,
|
326
327
|
rich: _ctx.rich === true,
|
@@ -4,13 +4,17 @@ type __VLS_Props = {
|
|
4
4
|
placeholder: string;
|
5
5
|
maxLength: number;
|
6
6
|
textParts: TextPart[] | undefined;
|
7
|
+
readonly: boolean | undefined;
|
8
|
+
disabled: boolean | undefined;
|
7
9
|
};
|
8
10
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
9
11
|
focus: () => void;
|
10
12
|
blur: () => void;
|
11
13
|
wrapSelection: (value: WrapSelection) => void;
|
12
14
|
setCaret: (indexStart: number, indexEnd?: number) => void;
|
13
|
-
getCaret: () => import('../models/utils').CaretOffset
|
15
|
+
getCaret: () => import('../models/utils').CaretOffset & {
|
16
|
+
trail: number;
|
17
|
+
};
|
14
18
|
offsetWidth: number;
|
15
19
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
16
20
|
blur: (value: FocusEvent) => any;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ContentEditable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/components/ContentEditable.vue"],"names":[],"mappings":"AAiBA;
|
1
|
+
{"version":3,"file":"ContentEditable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/components/ContentEditable.vue"],"names":[],"mappings":"AAiBA;AA0UA,OAAO,KAAK,EAAC,QAAQ,EAAG,aAAa,EAAC,MAAM,UAAU,CAAA;AAStD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAA;IACjC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B,CAAC;;;;2BAqK4B,aAAa,KAAG,IAAI;2BATpB,MAAM,aAAa,MAAM;;;;;;;;;;;;;;;;;;AAsNvD,wBAUG"}
|
@@ -3,14 +3,16 @@ import { WrapSelectionType } from '../../../utils/utils.js';
|
|
3
3
|
import { preserveIndentation } from '../models/toolbarActions.js';
|
4
4
|
import { getCaretOffset, setCaretOffset } from '../models/utils.js';
|
5
5
|
|
6
|
-
const _hoisted_1 = ["placeholder"];
|
6
|
+
const _hoisted_1 = ["contenteditable", "placeholder"];
|
7
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
8
8
|
__name: "ContentEditable",
|
9
9
|
props: {
|
10
10
|
value: {},
|
11
11
|
placeholder: {},
|
12
12
|
maxLength: {},
|
13
|
-
textParts: {}
|
13
|
+
textParts: {},
|
14
|
+
readonly: { type: Boolean },
|
15
|
+
disabled: { type: Boolean }
|
14
16
|
},
|
15
17
|
emits: ["update:model-value", "focus", "blur", "keydown"],
|
16
18
|
setup(__props, { expose: __expose, emit: __emit }) {
|
@@ -36,9 +38,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
36
38
|
if (existingNode instanceof HTMLElement && existingNode.tagName.toLowerCase() === item.tag.toLowerCase()) {
|
37
39
|
if (existingNode.textContent !== item.value) existingNode.textContent = item.value;
|
38
40
|
if (existingNode.className !== (item.class || "")) existingNode.className = item.class || "";
|
39
|
-
|
40
|
-
|
41
|
-
existingNode.setAttribute("contenteditable", contentEditable);
|
41
|
+
if (item.edit === false && existingNode.getAttribute("contenteditable") !== "false") {
|
42
|
+
existingNode.setAttribute("contenteditable", "false");
|
42
43
|
}
|
43
44
|
} else {
|
44
45
|
const element = document.createElement(item.tag);
|
@@ -111,10 +112,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
111
112
|
const insertPlain = (text) => {
|
112
113
|
const root = elementRef.value;
|
113
114
|
if (!root) return;
|
114
|
-
const { start, end } = getCaret();
|
115
|
+
const { start, end, trail } = getCaret();
|
115
116
|
const currentText = getCurrentText();
|
116
|
-
const next = (currentText ?? "").slice(0, start) + text + ((currentText ?? "").slice(end) || " ");
|
117
|
-
const caretAfter = start + text.length;
|
117
|
+
const next = (currentText ?? "").slice(0, start) + " ".repeat(trail) + text + ((currentText ?? "").slice(end) || " ");
|
118
|
+
const caretAfter = start + text.length + trail;
|
118
119
|
emit("update:model-value", props.maxLength && next.length > props.maxLength ? next.substring(0, props.maxLength) : next);
|
119
120
|
nextTick(() => setCaret(props.maxLength ? Math.min(caretAfter, props.maxLength) : caretAfter));
|
120
121
|
};
|
@@ -237,7 +238,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
237
238
|
return (_ctx, _cache) => {
|
238
239
|
return openBlock(), createElementBlock("div", {
|
239
240
|
ref: "element",
|
240
|
-
contenteditable: "plaintext-only",
|
241
|
+
contenteditable: _ctx.readonly || _ctx.disabled ? "false" : "plaintext-only",
|
241
242
|
role: "textbox",
|
242
243
|
"aria-multiline": "true",
|
243
244
|
spellcheck: "false",
|
@@ -3,5 +3,7 @@ export type CaretOffset = {
|
|
3
3
|
end: number;
|
4
4
|
};
|
5
5
|
export declare const setCaretOffset: (parent: Element | null | undefined, indexStart: number, indexEnd: number | undefined) => void;
|
6
|
-
export declare const getCaretOffset: (parent: Element | null | undefined) => CaretOffset
|
6
|
+
export declare const getCaretOffset: (parent: Element | null | undefined) => CaretOffset & {
|
7
|
+
trail: number;
|
8
|
+
};
|
7
9
|
//# sourceMappingURL=utils.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/models/utils.ts"],"names":[],"mappings":"AAwBA,MAAM,MAAM,WAAW,GAAG;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAC,CAAA;AAEtD,eAAO,MAAM,cAAc,GAAI,QAAQ,OAAO,GAAG,IAAI,GAAG,SAAS,EAAE,YAAY,MAAM,EAAE,UAAU,MAAM,GAAG,SAAS,SAelH,CAAA;
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/models/utils.ts"],"names":[],"mappings":"AAwBA,MAAM,MAAM,WAAW,GAAG;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAC,CAAA;AAEtD,eAAO,MAAM,cAAc,GAAI,QAAQ,OAAO,GAAG,IAAI,GAAG,SAAS,EAAE,YAAY,MAAM,EAAE,UAAU,MAAM,GAAG,SAAS,SAelH,CAAA;AA6BD,eAAO,MAAM,cAAc,GAAI,QAAQ,OAAO,GAAG,IAAI,GAAG,SAAS,KAAG,WAAW,GAAG;IAAC,KAAK,EAAE,MAAM,CAAA;CAU/F,CAAA"}
|
@@ -29,28 +29,34 @@ const setCaretOffset = (parent, indexStart, indexEnd) => {
|
|
29
29
|
selection?.removeAllRanges();
|
30
30
|
selection?.addRange(range);
|
31
31
|
};
|
32
|
+
const endSpacesRegex = /\s+$/;
|
32
33
|
const getOffsetFromNode = (parent, targetNode, targetOffset, isStart) => {
|
33
34
|
if (!parent.firstChild) parent.appendChild(document.createTextNode(""));
|
34
35
|
const walker = document.createTreeWalker(parent, NodeFilter.SHOW_TEXT, null);
|
35
36
|
let node, offset = 0;
|
36
37
|
while (node = walker.nextNode()) {
|
37
38
|
if (node.parentElement?.contentEditable === "false") {
|
38
|
-
if (isStart && node === targetNode) return offset;
|
39
|
+
if (isStart && node === targetNode) return { offset, trail: 0 };
|
39
40
|
} else if (node === targetNode) {
|
40
|
-
|
41
|
+
const text = node.textContent;
|
42
|
+
if (text?.[targetOffset] === "\n") {
|
43
|
+
const trail = text.slice(0, targetOffset).match(endSpacesRegex)?.[0]?.length ?? 0;
|
44
|
+
return { offset: offset + targetOffset - trail, trail };
|
45
|
+
}
|
46
|
+
return { offset: offset + targetOffset, trail: 0 };
|
41
47
|
}
|
42
48
|
offset += node.nodeValue?.length ?? 0;
|
43
49
|
}
|
44
|
-
return offset;
|
50
|
+
return { offset, trail: 0 };
|
45
51
|
};
|
46
52
|
const getCaretOffset = (parent) => {
|
47
|
-
if (!parent) return { start: 0, end: 0 };
|
53
|
+
if (!parent) return { start: 0, end: 0, trail: 0 };
|
48
54
|
const selection = window.getSelection();
|
49
|
-
if (!selection || selection.rangeCount === 0) return { start: 0, end: 0 };
|
55
|
+
if (!selection || selection.rangeCount === 0) return { start: 0, end: 0, trail: 0 };
|
50
56
|
const range = selection.getRangeAt(0);
|
51
57
|
const start = getOffsetFromNode(parent, range.startContainer, range.startOffset, true);
|
52
58
|
const end = range.startOffset !== range.endOffset ? getOffsetFromNode(parent, range.endContainer, range.endOffset, false) : start;
|
53
|
-
return { start, end };
|
59
|
+
return { start: start.offset, end: end.offset, trail: end.trail };
|
54
60
|
};
|
55
61
|
|
56
62
|
export { getCaretOffset, setCaretOffset };
|