@dialpad/dialtone-vue 3.208.0 → 3.209.0
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/component-documentation.json +1 -1
- package/dist/lib/editor/EditorToolbarButton.cjs +1 -1
- package/dist/lib/editor/EditorToolbarButton.cjs.map +1 -1
- package/dist/lib/editor/EditorToolbarButton.js +14 -13
- package/dist/lib/editor/EditorToolbarButton.js.map +1 -1
- package/dist/lib/editor/editor.cjs +1 -1
- package/dist/lib/editor/editor.cjs.map +1 -1
- package/dist/lib/editor/editor.js +205 -188
- package/dist/lib/editor/editor.js.map +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.cjs +2 -2
- package/dist/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.js +48 -36
- package/dist/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/localization/de-DE.cjs +4 -0
- package/dist/localization/de-DE.cjs.map +1 -1
- package/dist/localization/de-DE.js +4 -0
- package/dist/localization/de-DE.js.map +1 -1
- package/dist/localization/es-LA.cjs +4 -0
- package/dist/localization/es-LA.cjs.map +1 -1
- package/dist/localization/es-LA.js +4 -0
- package/dist/localization/es-LA.js.map +1 -1
- package/dist/localization/fr-FR.cjs +4 -0
- package/dist/localization/fr-FR.cjs.map +1 -1
- package/dist/localization/fr-FR.js +4 -0
- package/dist/localization/fr-FR.js.map +1 -1
- package/dist/localization/it-IT.cjs +4 -0
- package/dist/localization/it-IT.cjs.map +1 -1
- package/dist/localization/it-IT.js +4 -0
- package/dist/localization/it-IT.js.map +1 -1
- package/dist/localization/nl-NL.cjs +4 -0
- package/dist/localization/nl-NL.cjs.map +1 -1
- package/dist/localization/nl-NL.js +4 -0
- package/dist/localization/nl-NL.js.map +1 -1
- package/dist/localization/pt-BR.cjs +4 -0
- package/dist/localization/pt-BR.cjs.map +1 -1
- package/dist/localization/pt-BR.js +4 -0
- package/dist/localization/pt-BR.js.map +1 -1
- package/dist/localization/ru-RU.cjs +4 -0
- package/dist/localization/ru-RU.cjs.map +1 -1
- package/dist/localization/ru-RU.js +4 -0
- package/dist/localization/ru-RU.js.map +1 -1
- package/dist/localization/zh-CN.cjs +4 -0
- package/dist/localization/zh-CN.cjs.map +1 -1
- package/dist/localization/zh-CN.js +4 -0
- package/dist/localization/zh-CN.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/recipes/conversation_view/editor/EditorToolbarButton.vue.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nodeViewProps as ft, NodeViewWrapper as pt, VueRenderer as je, VueNodeViewRenderer as mt, EditorContent as
|
|
1
|
+
import { nodeViewProps as ft, NodeViewWrapper as pt, VueRenderer as je, VueNodeViewRenderer as mt, EditorContent as ze, Editor as Fe } from "../../node_modules/@tiptap/vue-3.js";
|
|
2
2
|
import { isTextSelection as Ke, posToDOMRect as re, getText as We, getTextSerializersFromSchema as qe, Node as ae, nodePasteRule as Et, InputRule as Xe, mergeAttributes as st, getMarksBetween as Ye, combineTransactionSteps as Ge, getChangedRanges as Je, findChildrenInRange as Ze, Mark as Qe, nodeInputRule as tn, Extension as en } from "@tiptap/core";
|
|
3
3
|
import { Plugin as It, PluginKey as rt, NodeSelection as nn } from "@tiptap/pm/state";
|
|
4
4
|
import { CellSelection as on } from "@tiptap/pm/tables";
|
|
@@ -27,7 +27,7 @@ import ye from "../emoji/emoji.js";
|
|
|
27
27
|
import { getEmojiData as Bn, emojiRegex as Nn, stringToUnicode as Pn, codeToEmojiData as At, emojiShortCodeRegex as Un } from "../../common/emoji/index.js";
|
|
28
28
|
import Vn from "../list-item/list-item.js";
|
|
29
29
|
import gt from "../stack/stack.js";
|
|
30
|
-
import { linkRegex as jn, getPhoneNumberRegex as
|
|
30
|
+
import { linkRegex as jn, getPhoneNumberRegex as zn, warnIfUnmounted as Fn, returnFirstEl as zt } from "../../common/utils/index.js";
|
|
31
31
|
import Kn from "@tiptap/extension-image";
|
|
32
32
|
import Rt from "@tiptap/extension-mention";
|
|
33
33
|
import we from "../link/link.js";
|
|
@@ -37,7 +37,7 @@ import qn from "../input/input.js";
|
|
|
37
37
|
import Xn from "../popover/popover.js";
|
|
38
38
|
import ve from "../button/button.js";
|
|
39
39
|
import Yn from "../badge/badge.js";
|
|
40
|
-
import { RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS as
|
|
40
|
+
import { RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS as Ft, RICH_TEXT_EDITOR_OUTPUT_FORMATS as Gn, RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as Jn } from "./rich-text-editor-constants.js";
|
|
41
41
|
import Zn from "../avatar/avatar.js";
|
|
42
42
|
import Qn from "@dialpad/dialtone-icons/vue3/hash";
|
|
43
43
|
import to from "@dialpad/dialtone-icons/vue3/lock";
|
|
@@ -63,7 +63,7 @@ function Z(t, e) {
|
|
|
63
63
|
function j(t) {
|
|
64
64
|
return t.split("-")[0];
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function F(t) {
|
|
67
67
|
return t.split("-")[1];
|
|
68
68
|
}
|
|
69
69
|
function Te(t) {
|
|
@@ -81,7 +81,7 @@ function Ht(t) {
|
|
|
81
81
|
}
|
|
82
82
|
function _e(t, e, o) {
|
|
83
83
|
o === void 0 && (o = !1);
|
|
84
|
-
const n =
|
|
84
|
+
const n = F(t), i = Ht(t), s = Mt(i);
|
|
85
85
|
let r = i === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
86
86
|
return e.reference[s] > e.floating[s] && (r = vt(r)), [r, vt(r)];
|
|
87
87
|
}
|
|
@@ -106,7 +106,7 @@ function lo(t, e, o) {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
function co(t, e, o, n) {
|
|
109
|
-
const i =
|
|
109
|
+
const i = F(t);
|
|
110
110
|
let s = lo(j(t), o === "start", n);
|
|
111
111
|
return i && (s = s.map((r) => r + "-" + i), e && (s = s.concat(s.map(bt)))), s;
|
|
112
112
|
}
|
|
@@ -186,7 +186,7 @@ function Yt(t, e, o) {
|
|
|
186
186
|
y: n.y
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
|
-
switch (
|
|
189
|
+
switch (F(e)) {
|
|
190
190
|
case "start":
|
|
191
191
|
f[r] -= h * (o && u ? -1 : 1);
|
|
192
192
|
break;
|
|
@@ -329,12 +329,12 @@ const fo = async (t, e, o) => {
|
|
|
329
329
|
}, f = Ht(i), p = Mt(f), m = await r.getDimensions(u), g = f === "y", y = g ? "top" : "left", b = g ? "bottom" : "right", v = g ? "clientHeight" : "clientWidth", x = s.reference[p] + s.reference[f] - h[f] - s.floating[p], O = h[f] - s.reference[f], _ = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(u));
|
|
330
330
|
let L = _ ? _[v] : 0;
|
|
331
331
|
(!L || !await (r.isElement == null ? void 0 : r.isElement(_))) && (L = a.floating[v] || s.floating[p]);
|
|
332
|
-
const U = x / 2 - O / 2, D = L / 2 - m[p] / 2 - 1, w = G(c[y], D), E = G(c[b], D), A = w, H = L - m[p] - E, S = L / 2 - m[p] / 2 + U,
|
|
332
|
+
const U = x / 2 - O / 2, D = L / 2 - m[p] / 2 - 1, w = G(c[y], D), E = G(c[b], D), A = w, H = L - m[p] - E, S = L / 2 - m[p] / 2 + U, z = St(A, S, H), V = !l.arrow && F(i) != null && S !== z && s.reference[p] / 2 - (S < A ? w : E) - m[p] / 2 < 0, B = V ? S < A ? S - A : S - H : 0;
|
|
333
333
|
return {
|
|
334
334
|
[f]: h[f] + B,
|
|
335
335
|
data: {
|
|
336
|
-
[f]:
|
|
337
|
-
centerOffset: S -
|
|
336
|
+
[f]: z,
|
|
337
|
+
centerOffset: S - z - B,
|
|
338
338
|
...V && {
|
|
339
339
|
alignmentOffset: B
|
|
340
340
|
}
|
|
@@ -344,7 +344,7 @@ const fo = async (t, e, o) => {
|
|
|
344
344
|
}
|
|
345
345
|
});
|
|
346
346
|
function mo(t, e, o) {
|
|
347
|
-
return (t ? [...o.filter((i) =>
|
|
347
|
+
return (t ? [...o.filter((i) => F(i) === t), ...o.filter((i) => F(i) !== t)] : o.filter((i) => j(i) === i)).filter((i) => t ? F(i) === t || (e ? bt(i) !== i : !1) : !0);
|
|
348
348
|
}
|
|
349
349
|
const go = function(t) {
|
|
350
350
|
return t === void 0 && (t = {}), {
|
|
@@ -389,7 +389,7 @@ const go = function(t) {
|
|
|
389
389
|
}
|
|
390
390
|
};
|
|
391
391
|
const L = O.map((w) => {
|
|
392
|
-
const E =
|
|
392
|
+
const E = F(w.placement);
|
|
393
393
|
return [w.placement, E && d ? (
|
|
394
394
|
// Check along the mainAxis and main crossAxis side.
|
|
395
395
|
w.overflows.slice(0, 2).reduce((A, H) => A + H, 0)
|
|
@@ -401,7 +401,7 @@ const go = function(t) {
|
|
|
401
401
|
0,
|
|
402
402
|
// Aligned placements should not check their opposite crossAxis
|
|
403
403
|
// side.
|
|
404
|
-
|
|
404
|
+
F(w[0]) ? 2 : 3
|
|
405
405
|
).every((E) => E <= 0))[0]) == null ? void 0 : i[0]) || L[0][0];
|
|
406
406
|
return D !== a ? {
|
|
407
407
|
data: {
|
|
@@ -451,8 +451,8 @@ const go = function(t) {
|
|
|
451
451
|
overflows: D
|
|
452
452
|
}], !D.every((S) => S <= 0)) {
|
|
453
453
|
var E, A;
|
|
454
|
-
const S = (((E = s.flip) == null ? void 0 : E.index) || 0) + 1,
|
|
455
|
-
if (
|
|
454
|
+
const S = (((E = s.flip) == null ? void 0 : E.index) || 0) + 1, z = L[S];
|
|
455
|
+
if (z && (!(c === "alignment" ? b !== X(z) : !1) || // We leave the current main axis only if every placement on that axis
|
|
456
456
|
// overflows the main axis.
|
|
457
457
|
w.every((N) => X(N.placement) === b ? N.overflows[0] > 0 : !0)))
|
|
458
458
|
return {
|
|
@@ -461,7 +461,7 @@ const go = function(t) {
|
|
|
461
461
|
overflows: w
|
|
462
462
|
},
|
|
463
463
|
reset: {
|
|
464
|
-
placement:
|
|
464
|
+
placement: z
|
|
465
465
|
}
|
|
466
466
|
};
|
|
467
467
|
let V = (A = w.filter((B) => B.overflows[0] <= 0).sort((B, N) => B.overflows[1] - N.overflows[1])[0]) == null ? void 0 : A.placement;
|
|
@@ -589,15 +589,15 @@ const vo = function(t) {
|
|
|
589
589
|
return c.find((g) => l > g.left - f.left && l < g.right + f.right && u > g.top - f.top && u < g.bottom + f.bottom) || h;
|
|
590
590
|
if (c.length >= 2) {
|
|
591
591
|
if (X(o) === "y") {
|
|
592
|
-
const w = c[0], E = c[c.length - 1], A = j(o) === "top", H = w.top, S = E.bottom,
|
|
592
|
+
const w = c[0], E = c[c.length - 1], A = j(o) === "top", H = w.top, S = E.bottom, z = A ? w.left : E.left, V = A ? w.right : E.right, B = V - z, N = S - H;
|
|
593
593
|
return {
|
|
594
594
|
top: H,
|
|
595
595
|
bottom: S,
|
|
596
|
-
left:
|
|
596
|
+
left: z,
|
|
597
597
|
right: V,
|
|
598
598
|
width: B,
|
|
599
599
|
height: N,
|
|
600
|
-
x:
|
|
600
|
+
x: z,
|
|
601
601
|
y: H
|
|
602
602
|
};
|
|
603
603
|
}
|
|
@@ -635,7 +635,7 @@ async function To(t, e) {
|
|
|
635
635
|
placement: o,
|
|
636
636
|
platform: n,
|
|
637
637
|
elements: i
|
|
638
|
-
} = t, s = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), r = j(o), a =
|
|
638
|
+
} = t, s = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), r = j(o), a = F(o), l = X(o) === "y", u = xo.has(r) ? -1 : 1, d = s && l ? -1 : 1, c = Z(e, t);
|
|
639
639
|
let {
|
|
640
640
|
mainAxis: h,
|
|
641
641
|
crossAxis: f,
|
|
@@ -751,7 +751,7 @@ const _o = function(t) {
|
|
|
751
751
|
apply: l = () => {
|
|
752
752
|
},
|
|
753
753
|
...u
|
|
754
|
-
} = Z(t, e), d = await r.detectOverflow(e, u), c = j(i), h =
|
|
754
|
+
} = Z(t, e), d = await r.detectOverflow(e, u), c = j(i), h = F(i), f = X(i) === "y", {
|
|
755
755
|
width: p,
|
|
756
756
|
height: m
|
|
757
757
|
} = s.floating;
|
|
@@ -1054,7 +1054,7 @@ function Ae(t, e) {
|
|
|
1054
1054
|
const o = ot(t);
|
|
1055
1055
|
return o === e || !K(o) || dt(o) ? !1 : W(o).position === "fixed" || Ae(o, e);
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1057
|
+
function zo(t, e) {
|
|
1058
1058
|
const o = e.get(t);
|
|
1059
1059
|
if (o)
|
|
1060
1060
|
return o;
|
|
@@ -1067,14 +1067,14 @@ function Fo(t, e) {
|
|
|
1067
1067
|
}
|
|
1068
1068
|
return e.set(t, n), n;
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function Fo(t) {
|
|
1071
1071
|
let {
|
|
1072
1072
|
element: e,
|
|
1073
1073
|
boundary: o,
|
|
1074
1074
|
rootBoundary: n,
|
|
1075
1075
|
strategy: i
|
|
1076
1076
|
} = t;
|
|
1077
|
-
const r = [...o === "clippingAncestors" ? Tt(e) ? [] :
|
|
1077
|
+
const r = [...o === "clippingAncestors" ? Tt(e) ? [] : zo(e, this._c) : [].concat(o), n], a = r[0], l = r.reduce((u, d) => {
|
|
1078
1078
|
const c = ee(e, d, i);
|
|
1079
1079
|
return u.top = R(c.top, u.top), u.right = G(c.right, u.right), u.bottom = G(c.bottom, u.bottom), u.left = R(c.left, u.left), u;
|
|
1080
1080
|
}, ee(e, a, i));
|
|
@@ -1166,7 +1166,7 @@ function Xo(t) {
|
|
|
1166
1166
|
const Yo = {
|
|
1167
1167
|
convertOffsetParentRelativeRectToViewportRelativeRect: Bo,
|
|
1168
1168
|
getDocumentElement: Q,
|
|
1169
|
-
getClippingRect:
|
|
1169
|
+
getClippingRect: Fo,
|
|
1170
1170
|
getOffsetParent: Re,
|
|
1171
1171
|
getElementRects: qo,
|
|
1172
1172
|
getClientRects: No,
|
|
@@ -2086,7 +2086,7 @@ function Hi(t, e, o, n) {
|
|
|
2086
2086
|
for (const a of r)
|
|
2087
2087
|
a.mark.type === n && o.removeMark(a.from, a.to, n);
|
|
2088
2088
|
}
|
|
2089
|
-
const ie =
|
|
2089
|
+
const ie = zn(1, 15);
|
|
2090
2090
|
function se(t, e, o, n, i, s) {
|
|
2091
2091
|
if (!t)
|
|
2092
2092
|
return;
|
|
@@ -2249,9 +2249,9 @@ function ji(t, e, o, n, i, s) {
|
|
|
2249
2249
|
_: 1
|
|
2250
2250
|
});
|
|
2251
2251
|
}
|
|
2252
|
-
const
|
|
2252
|
+
const zi = /* @__PURE__ */ q(Vi, [["render", ji]]), Fi = Rt.extend({
|
|
2253
2253
|
addNodeView() {
|
|
2254
|
-
return mt(
|
|
2254
|
+
return mt(zi);
|
|
2255
2255
|
},
|
|
2256
2256
|
parseHTML() {
|
|
2257
2257
|
return [
|
|
@@ -2840,7 +2840,7 @@ const xs = /* @__PURE__ */ q(gs, [["render", vs]]), Ts = {
|
|
|
2840
2840
|
compatConfig: { MODE: 3 },
|
|
2841
2841
|
name: "DtRichTextEditor",
|
|
2842
2842
|
components: {
|
|
2843
|
-
EditorContent:
|
|
2843
|
+
EditorContent: ze,
|
|
2844
2844
|
BubbleMenu: Qo,
|
|
2845
2845
|
DtButton: ve,
|
|
2846
2846
|
DtStack: gt
|
|
@@ -3137,6 +3137,13 @@ const xs = /* @__PURE__ */ q(gs, [["render", vs]]), Ts = {
|
|
|
3137
3137
|
allowTables: {
|
|
3138
3138
|
type: Boolean,
|
|
3139
3139
|
default: !1
|
|
3140
|
+
},
|
|
3141
|
+
/**
|
|
3142
|
+
* Whether the input allows image resize to be introduced in the text.
|
|
3143
|
+
*/
|
|
3144
|
+
allowImageResize: {
|
|
3145
|
+
type: Boolean,
|
|
3146
|
+
default: !1
|
|
3140
3147
|
}
|
|
3141
3148
|
},
|
|
3142
3149
|
emits: [
|
|
@@ -3248,7 +3255,7 @@ const xs = /* @__PURE__ */ q(gs, [["render", vs]]), Ts = {
|
|
|
3248
3255
|
editor: null,
|
|
3249
3256
|
appendTo: () => {
|
|
3250
3257
|
var t;
|
|
3251
|
-
return (t =
|
|
3258
|
+
return (t = zt(this.$refs.editor.$el).getRootNode()) == null ? void 0 : t.querySelector("body");
|
|
3252
3259
|
},
|
|
3253
3260
|
floatingOptions: {
|
|
3254
3261
|
placement: "top-start"
|
|
@@ -3428,10 +3435,10 @@ ${this.processNodeContent(t)}
|
|
|
3428
3435
|
},
|
|
3429
3436
|
openOnClick: !1,
|
|
3430
3437
|
autolink: !0,
|
|
3431
|
-
protocols:
|
|
3438
|
+
protocols: Ft
|
|
3432
3439
|
})), this.customLink && t.push(this.getExtension(Ni, this.customLink)), this.mentionSuggestion) {
|
|
3433
3440
|
const n = { ...this.mentionSuggestion, ...us };
|
|
3434
|
-
t.push(
|
|
3441
|
+
t.push(Fi.configure({ suggestion: n }));
|
|
3435
3442
|
}
|
|
3436
3443
|
if (this.channelSuggestion) {
|
|
3437
3444
|
const n = { ...this.channelSuggestion, ...ms };
|
|
@@ -3460,7 +3467,12 @@ ${n.textContent}
|
|
|
3460
3467
|
HTMLAttributes: {
|
|
3461
3468
|
class: "d-rich-text-editor__code-block"
|
|
3462
3469
|
}
|
|
3463
|
-
})), this.allowInlineImages && t.push(Pi
|
|
3470
|
+
})), this.allowInlineImages && t.push(Pi.configure({
|
|
3471
|
+
resize: {
|
|
3472
|
+
enabled: this.allowImageResize,
|
|
3473
|
+
alwaysPreserveAspectRatio: !0
|
|
3474
|
+
}
|
|
3475
|
+
})), (this.allowFontFamily || this.allowFontColor || this.allowFontSize) && t.push(Hn.configure({
|
|
3464
3476
|
color: this.allowFontColor,
|
|
3465
3477
|
backgroundColor: !1,
|
|
3466
3478
|
fontFamily: this.allowFontFamily,
|
|
@@ -3506,11 +3518,11 @@ ${n.textContent}
|
|
|
3506
3518
|
this.destroyEditor();
|
|
3507
3519
|
},
|
|
3508
3520
|
mounted() {
|
|
3509
|
-
|
|
3521
|
+
Fn(zt(this.$el), this.$options.name), this.processValue(this.modelValue, !1);
|
|
3510
3522
|
},
|
|
3511
3523
|
methods: {
|
|
3512
3524
|
createEditor() {
|
|
3513
|
-
this.editor = new
|
|
3525
|
+
this.editor = new Fe({
|
|
3514
3526
|
autofocus: this.autoFocus,
|
|
3515
3527
|
content: this.modelValue,
|
|
3516
3528
|
editable: this.editable,
|
|
@@ -3571,7 +3583,7 @@ ${n.textContent}
|
|
|
3571
3583
|
const t = this.editor.getAttributes("link").href;
|
|
3572
3584
|
window.open(t, "_blank");
|
|
3573
3585
|
},
|
|
3574
|
-
setLink(t, e, o, n =
|
|
3586
|
+
setLink(t, e, o, n = Ft, i) {
|
|
3575
3587
|
var a, l, u;
|
|
3576
3588
|
if (!t) {
|
|
3577
3589
|
this.removeLink();
|