vue-editify 0.1.4 → 0.1.6
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/examples/App.vue +1 -1
- package/lib/editify.es.js +36 -29
- package/lib/editify.umd.js +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/src/Editify.vue +20 -11
- package/src/components/base/Layer.vue +3 -2
- package/src/components/base/Tooltip.vue +2 -2
- package/src/index.js +1 -1
package/examples/App.vue
CHANGED
@@ -5548,7 +5548,7 @@
|
|
5548
5548
|
<div>
|
5549
5549
|
<button @click="disabled = !disabled">禁用</button>
|
5550
5550
|
</div>
|
5551
|
-
<editify v-model="value" placeholder="请输入正文内容..." allow-paste-html :menu="menuConfig" ref="editify" :paste-keep-marks="{ 'data-zip': ['span'] }" autofocus :show-word-length="true" :border="true" :disabled="disabled" @updateview="updateview" :customParseNode="customParseNode"
|
5551
|
+
<editify v-model="value" placeholder="请输入正文内容..." allow-paste-html :menu="menuConfig" ref="editify" :paste-keep-marks="{ 'data-zip': ['span'] }" autofocus :show-word-length="true" :border="true" :disabled="disabled" @updateview="updateview" :customParseNode="customParseNode"></editify>
|
5552
5552
|
</div>
|
5553
5553
|
</template>
|
5554
5554
|
<script>
|
package/lib/editify.es.js
CHANGED
@@ -16440,7 +16440,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
16440
16440
|
], 12, _hoisted_1$c);
|
16441
16441
|
}
|
16442
16442
|
const Triangle = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$d], ["__scopeId", "data-v-70b6f344"]]);
|
16443
|
-
const
|
16443
|
+
const Layer_vue_vue_type_style_index_0_scoped_b5a839e3_lang = "";
|
16444
16444
|
const _sfc_main$c = {
|
16445
16445
|
name: "Layer",
|
16446
16446
|
emits: ["update:modelValue", "show", "shown", "hidden"],
|
@@ -16694,13 +16694,13 @@ const _sfc_main$c = {
|
|
16694
16694
|
if (this.placement == "top" || this.placement == "top-start" || this.placement == "top-end") {
|
16695
16695
|
if (firstRect.top >= 0 && firstRect.top >= parentRect.top && firstRect.top >= this.$el.offsetHeight) {
|
16696
16696
|
this.realPlacement = this.placement;
|
16697
|
-
} else if (documentHeight -
|
16697
|
+
} else if (documentHeight - lastRect.bottom >= 0 && documentHeight - lastRect.bottom >= parentRect.bottom && documentHeight - lastRect.bottom >= this.$el.offsetHeight) {
|
16698
16698
|
this.realPlacement = this.placement == "top" ? "bottom" : this.placement == "top-start" ? "bottom-start" : "bottom-end";
|
16699
16699
|
}
|
16700
16700
|
} else if (this.placement == "bottom" || this.placement == "bottom-start" || this.placement == "bottom-end") {
|
16701
16701
|
if (documentHeight - lastRect.bottom >= 0 && documentHeight - lastRect.bottom >= parentRect.bottom && documentHeight - lastRect.bottom >= this.$el.offsetHeight) {
|
16702
16702
|
this.realPlacement = this.placement;
|
16703
|
-
} else if (
|
16703
|
+
} else if (firstRect.top >= 0 && firstRect.top >= parentRect.top && firstRect.top >= this.$el.offsetHeight) {
|
16704
16704
|
this.realPlacement = this.placement == "bottom" ? "top" : this.placement == "bottom-start" ? "top-start" : "top-end";
|
16705
16705
|
}
|
16706
16706
|
}
|
@@ -17069,8 +17069,8 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
17069
17069
|
_: 3
|
17070
17070
|
}, 8, ["name", "onEnter", "onAfterEnter", "onAfterLeave"]);
|
17071
17071
|
}
|
17072
|
-
const Layer = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$c], ["__scopeId", "data-v-
|
17073
|
-
const
|
17072
|
+
const Layer = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$c], ["__scopeId", "data-v-b5a839e3"]]);
|
17073
|
+
const Tooltip_vue_vue_type_style_index_0_scoped_6456f300_lang = "";
|
17074
17074
|
const _sfc_main$b = {
|
17075
17075
|
name: "Tooltip",
|
17076
17076
|
props: {
|
@@ -17115,24 +17115,23 @@ const _sfc_main$b = {
|
|
17115
17115
|
}
|
17116
17116
|
}
|
17117
17117
|
};
|
17118
|
-
const _hoisted_1$a = {
|
17119
|
-
ref: "target",
|
17120
|
-
class: "editify-tooltip-target"
|
17121
|
-
};
|
17122
|
-
const _hoisted_2$9 = { class: "editify-tooltip-content" };
|
17118
|
+
const _hoisted_1$a = { class: "editify-tooltip-content" };
|
17123
17119
|
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
17124
17120
|
const _component_Layer = resolveComponent("Layer");
|
17125
17121
|
return openBlock(), createElementBlock("div", {
|
17126
|
-
class: normalizeClass(["editify-tooltip", { block: $props.block }])
|
17127
|
-
onMouseenter: _cache[1] || (_cache[1] = (...args) => $options.showContent && $options.showContent(...args)),
|
17128
|
-
onMouseleave: _cache[2] || (_cache[2] = (...args) => $options.hideContent && $options.hideContent(...args))
|
17122
|
+
class: normalizeClass(["editify-tooltip", { block: $props.block }])
|
17129
17123
|
}, [
|
17130
|
-
createElementVNode("div",
|
17124
|
+
createElementVNode("div", {
|
17125
|
+
ref: "target",
|
17126
|
+
class: "editify-tooltip-target",
|
17127
|
+
onMouseenter: _cache[0] || (_cache[0] = (...args) => $options.showContent && $options.showContent(...args)),
|
17128
|
+
onMouseleave: _cache[1] || (_cache[1] = (...args) => $options.hideContent && $options.hideContent(...args))
|
17129
|
+
}, [
|
17131
17130
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
17132
|
-
],
|
17131
|
+
], 544),
|
17133
17132
|
createVNode(_component_Layer, {
|
17134
17133
|
modelValue: $data.show,
|
17135
|
-
"onUpdate:modelValue": _cache[
|
17134
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.show = $event),
|
17136
17135
|
node: $data.node,
|
17137
17136
|
border: "",
|
17138
17137
|
"border-color": "#000",
|
@@ -17143,13 +17142,13 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
17143
17142
|
animation: "fade"
|
17144
17143
|
}, {
|
17145
17144
|
default: withCtx(() => [
|
17146
|
-
createElementVNode("div",
|
17145
|
+
createElementVNode("div", _hoisted_1$a, toDisplayString($props.content), 1)
|
17147
17146
|
]),
|
17148
17147
|
_: 1
|
17149
17148
|
}, 8, ["modelValue", "node"])
|
17150
|
-
],
|
17149
|
+
], 2);
|
17151
17150
|
}
|
17152
|
-
const Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-
|
17151
|
+
const Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-6456f300"]]);
|
17153
17152
|
const Icon_vue_vue_type_style_index_0_scoped_5ed6cd4d_lang = "";
|
17154
17153
|
const _sfc_main$a = {
|
17155
17154
|
name: "Icon",
|
@@ -21336,7 +21335,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
21336
21335
|
], 14, _hoisted_1$1);
|
21337
21336
|
}
|
21338
21337
|
const Menu = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-25262a69"]]);
|
21339
|
-
const
|
21338
|
+
const Editify_vue_vue_type_style_index_0_scoped_7535307a_lang = "";
|
21340
21339
|
const _sfc_main = {
|
21341
21340
|
name: "editify",
|
21342
21341
|
props: { ...editorProps },
|
@@ -21353,6 +21352,8 @@ const _sfc_main = {
|
|
21353
21352
|
isModelChange: false,
|
21354
21353
|
//是否正在输入中文
|
21355
21354
|
isInputChinese: false,
|
21355
|
+
//工具条和菜单栏判定延时器
|
21356
|
+
rangeUpdateTimer: null,
|
21356
21357
|
//表格列宽拖拽记录数据
|
21357
21358
|
tableColumnResizeParams: {
|
21358
21359
|
element: null,
|
@@ -21901,14 +21902,20 @@ const _sfc_main = {
|
|
21901
21902
|
return;
|
21902
21903
|
}
|
21903
21904
|
this.dataRangeCaches = this.editor.getElementsByRange();
|
21904
|
-
if (this.
|
21905
|
-
|
21906
|
-
|
21907
|
-
|
21908
|
-
|
21909
|
-
|
21905
|
+
if (this.rangeUpdateTimer) {
|
21906
|
+
clearTimeout(this.rangeUpdateTimer);
|
21907
|
+
this.rangeUpdateTimer = null;
|
21908
|
+
}
|
21909
|
+
this.rangeUpdateTimer = setTimeout(() => {
|
21910
|
+
if (this.toolbarConfig.use || this.menuConfig.use) {
|
21911
|
+
if (this.toolbarConfig.use) {
|
21912
|
+
this.handleToolbar();
|
21913
|
+
}
|
21914
|
+
if (this.menuConfig.use) {
|
21915
|
+
this.$refs.menu.handleRangeUpdate();
|
21916
|
+
}
|
21910
21917
|
}
|
21911
|
-
}
|
21918
|
+
}, 200);
|
21912
21919
|
this.$emit("rangeupdate");
|
21913
21920
|
},
|
21914
21921
|
//编辑器粘贴html
|
@@ -22074,7 +22081,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
22074
22081
|
], 2)) : createCommentVNode("", true)
|
22075
22082
|
], 2);
|
22076
22083
|
}
|
22077
|
-
const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
22084
|
+
const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-7535307a"]]);
|
22078
22085
|
const iconfont = "";
|
22079
22086
|
const en_US = {
|
22080
22087
|
textWrapUp: "Up feed",
|
@@ -22257,7 +22264,7 @@ const i18n = (locale) => {
|
|
22257
22264
|
return translations[locale][key];
|
22258
22265
|
};
|
22259
22266
|
};
|
22260
|
-
const version = "0.1.
|
22267
|
+
const version = "0.1.6";
|
22261
22268
|
const install = (app, props) => {
|
22262
22269
|
const locale = (props ? props.locale : "zh_CN") || "zh_CN";
|
22263
22270
|
app.provide("$editTrans", i18n(locale));
|