@creatorsn/powereditor3 0.2.6 → 0.2.8
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/powereditor3.js
CHANGED
|
@@ -68452,13 +68452,16 @@ const e6 = /* @__PURE__ */ on(dge, [["render", pge]]), mge = /(\$\s|\\\(\s)$/, g
|
|
|
68452
68452
|
}
|
|
68453
68453
|
t || this.close();
|
|
68454
68454
|
},
|
|
68455
|
-
filterItems: [],
|
|
68456
|
-
loading: !1,
|
|
68457
68455
|
thisTheme: this.editor.storage.defaultStorage.theme,
|
|
68458
68456
|
thisForeground: this.editor.storage.defaultStorage.mentionItemTools.headerForeground()
|
|
68459
68457
|
};
|
|
68460
68458
|
},
|
|
68461
68459
|
watch: {
|
|
68460
|
+
thisPlaceholder(n) {
|
|
68461
|
+
n !== this.node.attrs.placeholder && this.updateAttributes({
|
|
68462
|
+
placeholder: n
|
|
68463
|
+
});
|
|
68464
|
+
},
|
|
68462
68465
|
showPopper(n) {
|
|
68463
68466
|
n && this.$nextTick(() => {
|
|
68464
68467
|
this.showPos();
|
|
@@ -68498,10 +68501,24 @@ const e6 = /* @__PURE__ */ on(dge, [["render", pge]]), mge = /(\$\s|\\\(\s)$/, g
|
|
|
68498
68501
|
} catch {
|
|
68499
68502
|
return "";
|
|
68500
68503
|
}
|
|
68504
|
+
},
|
|
68505
|
+
thisPlaceholder() {
|
|
68506
|
+
var e, t;
|
|
68507
|
+
return ((t = (e = this.editor.storage.defaultStorage.mentionItemTools) == null ? void 0 : e.placeholder) == null ? void 0 : t.call(
|
|
68508
|
+
e,
|
|
68509
|
+
this.node.attrs.currentItem,
|
|
68510
|
+
this.node.attrs.value
|
|
68511
|
+
)) || this.node.attrs.placeholder;
|
|
68512
|
+
},
|
|
68513
|
+
thisMentionList() {
|
|
68514
|
+
var n, e;
|
|
68515
|
+
return ((e = (n = this.editor.storage.defaultStorage) == null ? void 0 : n.mentionItemTools) == null ? void 0 : e.mentionList()) || [];
|
|
68501
68516
|
}
|
|
68502
68517
|
},
|
|
68503
68518
|
mounted() {
|
|
68504
|
-
this.outSideClickInit(), this.windowEventInit(),
|
|
68519
|
+
this.outSideClickInit(), this.windowEventInit(), this.thisPlaceholder !== this.node.attrs.placeholder && this.updateAttributes({
|
|
68520
|
+
placeholder: this.thisPlaceholder
|
|
68521
|
+
}), setTimeout(() => {
|
|
68505
68522
|
this.node.attrs.freeze || (this.show(), this.$refs.target.focus(), this.$refs.list.setFocus());
|
|
68506
68523
|
}, 300), this.getFilterItems(this.node.attrs.value, "");
|
|
68507
68524
|
},
|
|
@@ -68527,18 +68544,10 @@ const e6 = /* @__PURE__ */ on(dge, [["render", pge]]), mge = /(\$\s|\\\(\s)$/, g
|
|
|
68527
68544
|
}, 300));
|
|
68528
68545
|
},
|
|
68529
68546
|
async getFilterItems(n, e) {
|
|
68530
|
-
this.
|
|
68531
|
-
let t = [], r = await this.editor.storage.defaultStorage.mentionItemTools.mentionList(
|
|
68547
|
+
await this.editor.storage.defaultStorage.mentionItemTools.filterFunc(
|
|
68532
68548
|
n,
|
|
68533
68549
|
e
|
|
68534
68550
|
);
|
|
68535
|
-
for (let i of r)
|
|
68536
|
-
await this.editor.storage.defaultStorage.mentionItemTools.filterFunc(
|
|
68537
|
-
i,
|
|
68538
|
-
n,
|
|
68539
|
-
e
|
|
68540
|
-
) && t.push(i);
|
|
68541
|
-
this.filterItems = t, this.loading = !1;
|
|
68542
68551
|
},
|
|
68543
68552
|
chooseItem(n) {
|
|
68544
68553
|
this.updateAttributes({
|
|
@@ -68600,7 +68609,7 @@ function Age(n, e, t, r, i, o) {
|
|
|
68600
68609
|
class: Ye(["power-editor-mention-container", {
|
|
68601
68610
|
dark: i.thisTheme === "dark",
|
|
68602
68611
|
selected: t.selected,
|
|
68603
|
-
showing: i.showPopper &&
|
|
68612
|
+
showing: i.showPopper && o.thisMentionList.length > 0
|
|
68604
68613
|
}]),
|
|
68605
68614
|
style: ut({
|
|
68606
68615
|
"--selected-bg": o.focusForeground,
|
|
@@ -68624,10 +68633,10 @@ function Age(n, e, t, r, i, o) {
|
|
|
68624
68633
|
background: "white"
|
|
68625
68634
|
}, null, 8, ["foreground"])
|
|
68626
68635
|
], 512), [
|
|
68627
|
-
[Wt,
|
|
68636
|
+
[Wt, o.isLoading()]
|
|
68628
68637
|
]),
|
|
68629
68638
|
ae(a, {
|
|
68630
|
-
modelValue:
|
|
68639
|
+
modelValue: o.thisMentionList,
|
|
68631
68640
|
theme: i.thisTheme,
|
|
68632
68641
|
class: "power-editor-mention-popper-list-view",
|
|
68633
68642
|
ref: "list",
|
|
@@ -68663,7 +68672,7 @@ function Age(n, e, t, r, i, o) {
|
|
|
68663
68672
|
_: 1
|
|
68664
68673
|
}, 8, ["modelValue", "theme", "onChooseItem"])
|
|
68665
68674
|
], 4), [
|
|
68666
|
-
[Wt, i.showPopper &&
|
|
68675
|
+
[Wt, i.showPopper && o.thisMentionList.length > 0]
|
|
68667
68676
|
])
|
|
68668
68677
|
]),
|
|
68669
68678
|
_: 1
|
|
@@ -68699,7 +68708,7 @@ function Age(n, e, t, r, i, o) {
|
|
|
68699
68708
|
Ut(X("input", {
|
|
68700
68709
|
"onUpdate:modelValue": e[0] || (e[0] = (c) => t.node.attrs.value = c),
|
|
68701
68710
|
class: Ye(["power-editor-mention-input", [{ freeze: t.node.attrs.freeze }]]),
|
|
68702
|
-
placeholder:
|
|
68711
|
+
placeholder: o.thisPlaceholder,
|
|
68703
68712
|
readonly: t.node.attrs.freeze,
|
|
68704
68713
|
ref: "target",
|
|
68705
68714
|
title: t.node.attrs.value,
|
|
@@ -68717,7 +68726,7 @@ function Age(n, e, t, r, i, o) {
|
|
|
68717
68726
|
title: t.node.attrs.value,
|
|
68718
68727
|
class: Ye(["power-editor-mention-placeholder", [{ show: t.node.attrs.freeze }]]),
|
|
68719
68728
|
style: ut({ color: t.node.attrs.currentItem.color })
|
|
68720
|
-
}, Ze(t.node.attrs.value ? t.node.attrs.value :
|
|
68729
|
+
}, Ze(t.node.attrs.value ? t.node.attrs.value : o.thisPlaceholder), 15, Tge)
|
|
68721
68730
|
])
|
|
68722
68731
|
]),
|
|
68723
68732
|
_: 1
|
|
@@ -74775,6 +74784,7 @@ const O6 = /* @__PURE__ */ on(_ye, [["render", yye]]), vye = {
|
|
|
74775
74784
|
mentionClickCallback: () => {
|
|
74776
74785
|
console.log("mentionClickCallback");
|
|
74777
74786
|
},
|
|
74787
|
+
placeholder: () => "mention",
|
|
74778
74788
|
isLoading: () => !1,
|
|
74779
74789
|
headerForeground: () => this.foreground
|
|
74780
74790
|
};
|