@dialpad/dialtone-vue 3.219.1 → 3.219.2
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/components/collapsible/collapsible.vue.d.ts.map +1 -1
- package/dist/components/popover/popover.vue.d.ts.map +1 -1
- package/dist/components/rich_text_editor/rich_text_editor.vue.d.ts +9 -0
- package/dist/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/dialtone-vue.cjs +1 -1
- package/dist/dialtone-vue.js +2 -2
- package/dist/lib/collapsible/collapsible.cjs +1 -1
- package/dist/lib/collapsible/collapsible.cjs.map +1 -1
- package/dist/lib/collapsible/collapsible.js +5 -2
- package/dist/lib/collapsible/collapsible.js.map +1 -1
- package/dist/lib/editor/editor.cjs +1 -1
- package/dist/lib/editor/editor.js +1 -1
- package/dist/lib/message-input/index.cjs +1 -1
- package/dist/lib/message-input/index.js +1 -1
- package/dist/lib/message-input/message-input.cjs +1 -1
- package/dist/lib/message-input/message-input.js +1 -1
- package/dist/lib/popover/popover.cjs +1 -1
- package/dist/lib/popover/popover.cjs.map +1 -1
- package/dist/lib/popover/popover.js +9 -3
- package/dist/lib/popover/popover.js.map +1 -1
- package/dist/lib/rich-text-editor/index.cjs +1 -1
- package/dist/lib/rich-text-editor/index.js +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.cjs +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/{message_input-15gar4iy.js → message_input-BssxPs1B.js} +2 -2
- package/dist/{message_input-15gar4iy.js.map → message_input-BssxPs1B.js.map} +1 -1
- package/dist/{message_input-C9OkeBcE.cjs → message_input-Bw5RZHOI.cjs} +2 -2
- package/dist/{message_input-C9OkeBcE.cjs.map → message_input-Bw5RZHOI.cjs.map} +1 -1
- package/dist/recipes/conversation_view/editor/editor.vue.d.ts +9 -0
- package/dist/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/message_input/message_input.vue.d.ts +9 -0
- package/dist/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/{rich_text_editor-DfniiQVS.cjs → rich_text_editor-BE49FAdX.cjs} +4 -2
- package/dist/{rich_text_editor-DfniiQVS.cjs.map → rich_text_editor-BE49FAdX.cjs.map} +1 -1
- package/dist/{rich_text_editor-jVEuSPUG.js → rich_text_editor-BtvmJUw1.js} +41 -5
- package/dist/{rich_text_editor-jVEuSPUG.js.map → rich_text_editor-BtvmJUw1.js.map} +1 -1
- package/package.json +10 -5
|
@@ -2558,6 +2558,10 @@ var Vi = {
|
|
|
2558
2558
|
type: Boolean,
|
|
2559
2559
|
default: !1
|
|
2560
2560
|
},
|
|
2561
|
+
allowTextAlign: {
|
|
2562
|
+
type: Boolean,
|
|
2563
|
+
default: !0
|
|
2564
|
+
},
|
|
2561
2565
|
allowImageResize: {
|
|
2562
2566
|
type: Boolean,
|
|
2563
2567
|
default: !1
|
|
@@ -2656,9 +2660,41 @@ var Vi = {
|
|
|
2656
2660
|
}
|
|
2657
2661
|
}));
|
|
2658
2662
|
}
|
|
2659
|
-
return this.allowVariable && e.push(Ei.configure({ variableItems: this.variableItems })), e.push(Jr), e.push(nt.configure({ types: ["paragraph"] })), this.allowCode && e.push(Be), this.allowCodeblock && e.push(ze.extend({
|
|
2660
|
-
|
|
2661
|
-
|
|
2663
|
+
return this.allowVariable && e.push(Ei.configure({ variableItems: this.variableItems })), e.push(Jr), this.allowTextAlign && e.push(nt.configure({ types: ["paragraph"] })), this.allowCode && e.push(Be), this.allowCodeblock && e.push(ze.extend({
|
|
2664
|
+
renderText({ node: e, pos: t, range: n }) {
|
|
2665
|
+
let r = n?.from ?? 0, i = n?.to ?? t + e.nodeSize;
|
|
2666
|
+
if (r <= t && i >= t + e.nodeSize) return `\`\`\`\n${e.textContent}\n\`\`\``;
|
|
2667
|
+
let a = Math.max(0, r - t - 1), o = Math.min(e.textContent.length, i - t - 1);
|
|
2668
|
+
return e.textContent.slice(a, o);
|
|
2669
|
+
},
|
|
2670
|
+
addCommands() {
|
|
2671
|
+
return {
|
|
2672
|
+
...this.parent?.(),
|
|
2673
|
+
toggleCodeBlock: (e = {}) => ({ state: t, chain: n, commands: r }) => {
|
|
2674
|
+
let i = t.schema.nodes[this.name], { $from: a } = t.selection;
|
|
2675
|
+
if (a.parent.type === i) {
|
|
2676
|
+
let e = t.schema.nodes.paragraph, r = a.parent.textContent.split("\n"), i = a.before(), o = a.parent;
|
|
2677
|
+
return n().command(({ tr: n }) => {
|
|
2678
|
+
let a = r.map((n) => e.create({}, n ? [t.schema.text(n)] : []));
|
|
2679
|
+
return n.replaceWith(i, i + o.nodeSize, a), !0;
|
|
2680
|
+
}).run();
|
|
2681
|
+
}
|
|
2682
|
+
let { from: o, to: s } = t.selection, c = [];
|
|
2683
|
+
if (t.doc.nodesBetween(o, s, (e, t) => {
|
|
2684
|
+
if (e.isTextblock) return c.push({
|
|
2685
|
+
node: e,
|
|
2686
|
+
pos: t
|
|
2687
|
+
}), !1;
|
|
2688
|
+
}), c.length <= 1) return r.setNode(this.name, e);
|
|
2689
|
+
let l = c.map(({ node: e }) => e.textContent).join("\n"), u = c[0].pos, d = c[c.length - 1], f = d.pos + d.node.nodeSize;
|
|
2690
|
+
return n().command(({ tr: n }) => {
|
|
2691
|
+
let r = l.length ? [t.schema.text(l)] : [];
|
|
2692
|
+
return n.replaceWith(u, f, i.create(e, r)), !0;
|
|
2693
|
+
}).run();
|
|
2694
|
+
}
|
|
2695
|
+
};
|
|
2696
|
+
}
|
|
2697
|
+
}).configure({ HTMLAttributes: { class: "d-rich-text-editor__code-block" } })), this.allowInlineImages && e.push(oi.configure({ resize: {
|
|
2662
2698
|
enabled: this.allowImageResize,
|
|
2663
2699
|
alwaysPreserveAspectRatio: !0
|
|
2664
2700
|
} })), (this.allowFontFamily || this.allowFontColor || this.allowFontSize || this.allowBackgroundColor || this.allowLineHeight) && (e.push(ct.configure({
|
|
@@ -2728,7 +2764,7 @@ var Vi = {
|
|
|
2728
2764
|
return this.processPasteData(e, r, i);
|
|
2729
2765
|
},
|
|
2730
2766
|
transformPastedHTML(e) {
|
|
2731
|
-
return e.replace(/(<\/\w+>)((<br \/>)+)/g, "$2$
|
|
2767
|
+
return e.replace(/<hr[^>]*\/?>/gi, "<p><br></p>").replace(/(<\/\w+>)((<br \/>)+)/g, "$2$1");
|
|
2732
2768
|
}
|
|
2733
2769
|
}
|
|
2734
2770
|
}), this.addEditorListeners();
|
|
@@ -2953,4 +2989,4 @@ var Gi = /* @__PURE__ */ i(Hi, [["render", Wi]]);
|
|
|
2953
2989
|
//#endregion
|
|
2954
2990
|
export { Gi as t };
|
|
2955
2991
|
|
|
2956
|
-
//# sourceMappingURL=rich_text_editor-
|
|
2992
|
+
//# sourceMappingURL=rich_text_editor-BtvmJUw1.js.map
|