@ebl-vue/editor-full 2.31.44 → 2.31.45

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.
Files changed (2) hide show
  1. package/dist/index.mjs +25 -25
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1025,16 +1025,16 @@ function Q(u, t = "after") {
1025
1025
  for (i = s(u); i !== null; ) e.push(i), i = s(i);
1026
1026
  return e.length !== 0 ? e : null;
1027
1027
  }
1028
- function _(u, t = !0) {
1028
+ function I(u, t = !0) {
1029
1029
  let e = u;
1030
1030
  return u.classList.contains(k.item) && (e = u.querySelector(`.${k.itemChildren}`)), e === null ? [] : t ? Array.from(e.querySelectorAll(`:scope > .${k.item}`)) : Array.from(e.querySelectorAll(`.${k.item}`));
1031
1031
  }
1032
- function I(u) {
1032
+ function _(u) {
1033
1033
  return u.querySelector(`.${k.itemChildren}`);
1034
1034
  }
1035
1035
  function tt(u) {
1036
1036
  let t = u;
1037
- u.classList.contains(k.item) && (t = I(u)), t !== null && _(t).length === 0 && t.remove();
1037
+ u.classList.contains(k.item) && (t = _(u)), t !== null && I(t).length === 0 && t.remove();
1038
1038
  }
1039
1039
  function Y(u) {
1040
1040
  return u.querySelector(`.${k.itemContent}`);
@@ -1075,8 +1075,8 @@ class et {
1075
1075
  }, !1), "start" in this.data.meta && this.data.meta.start !== void 0 && this.changeStartWith(this.data.meta.start), "counterType" in this.data.meta && this.data.meta.counterType !== void 0 && this.changeCounters(this.data.meta.counterType), this.listWrapper;
1076
1076
  }
1077
1077
  save(t) {
1078
- const e = t != null ? t : this.listWrapper, i = (r) => _(r).map((o) => {
1079
- const a = I(o);
1078
+ const e = t != null ? t : this.listWrapper, i = (r) => I(r).map((o) => {
1079
+ const a = _(o);
1080
1080
  return { content: this.renderer.getItemContent(o), meta: this.renderer.getItemMeta(o), items: a ? i(a) : [] };
1081
1081
  }), s = e ? i(e) : [];
1082
1082
  let n = { style: this.data.style, meta: {}, items: s };
@@ -1088,9 +1088,9 @@ class et {
1088
1088
  merge(t) {
1089
1089
  const e = this.block.holder.querySelectorAll(`.${k.item}`), i = e[e.length - 1], s = Y(i);
1090
1090
  if (i === null || s === null || (s.insertAdjacentHTML("beforeend", t.items[0].content), this.listWrapper === void 0)) return;
1091
- const n = _(this.listWrapper);
1091
+ const n = I(this.listWrapper);
1092
1092
  if (n.length === 0) return;
1093
- let r = I(n[n.length - 1]);
1093
+ let r = _(n[n.length - 1]);
1094
1094
  const o = t.items.shift();
1095
1095
  o !== void 0 && (o.items.length !== 0 && (r === null && (r = this.renderer.renderWrapper(!1)), this.appendItems(o.items, r)), t.items.length > 0 && this.appendItems(t.items, this.listWrapper));
1096
1096
  }
@@ -1148,7 +1148,7 @@ class et {
1148
1148
  if (!t.parentNode || !B(t.parentNode)) return;
1149
1149
  const e = t.parentNode.closest(`.${k.item}`);
1150
1150
  if (!e) return;
1151
- let i = I(t);
1151
+ let i = _(t);
1152
1152
  if (t.parentElement === null) return;
1153
1153
  const s = Q(t);
1154
1154
  s !== null && (i === null && (i = this.renderer.renderWrapper(!1)), s.forEach((n) => {
@@ -1156,7 +1156,7 @@ class et {
1156
1156
  }), t.appendChild(i)), e.after(t), N(t, !1), tt(e);
1157
1157
  }
1158
1158
  splitList(t) {
1159
- const e = _(t), i = this.block, s = this.api.blocks.getCurrentBlockIndex();
1159
+ const e = I(t), i = this.block, s = this.api.blocks.getCurrentBlockIndex();
1160
1160
  if (e.length !== 0) {
1161
1161
  const a = e[0];
1162
1162
  this.unshiftItem(a), N(t, !1);
@@ -1177,7 +1177,7 @@ class et {
1177
1177
  const s = Y(t);
1178
1178
  let n;
1179
1179
  n = s === null ? "" : ie(s, e, i, "right", !0);
1180
- const r = I(t), o = this.renderItem(n);
1180
+ const r = _(t), o = this.renderItem(n);
1181
1181
  t == null || t.after(o), r && o.appendChild(r), N(o);
1182
1182
  }
1183
1183
  mergeItemWithPrevious(t) {
@@ -1188,7 +1188,7 @@ class et {
1188
1188
  if (!e && !s || e && !B(e)) return;
1189
1189
  let n;
1190
1190
  if (e) {
1191
- const h = _(e, !1);
1191
+ const h = I(e, !1);
1192
1192
  n = h.length !== 0 && h.length !== 0 ? h[h.length - 1] : e;
1193
1193
  } else n = s;
1194
1194
  const r = this.renderer.getItemContent(t);
@@ -1197,14 +1197,14 @@ class et {
1197
1197
  const o = Y(n);
1198
1198
  if (o === null) return;
1199
1199
  o.insertAdjacentHTML("beforeend", r);
1200
- const a = _(t);
1200
+ const a = I(t);
1201
1201
  if (a.length === 0) return t.remove(), void tt(n);
1202
- const d = e || s, l = (p = I(d)) != null ? p : this.renderer.renderWrapper(!1);
1202
+ const d = e || s, l = (p = _(d)) != null ? p : this.renderer.renderWrapper(!1);
1203
1203
  e ? a.forEach((h) => {
1204
1204
  l.appendChild(h);
1205
1205
  }) : a.forEach((h) => {
1206
1206
  l.prepend(h);
1207
- }), I(d) === null && n.appendChild(l), t.remove();
1207
+ }), _(d) === null && n.appendChild(l), t.remove();
1208
1208
  }
1209
1209
  addTab(t) {
1210
1210
  var n;
@@ -1217,14 +1217,14 @@ class et {
1217
1217
  }
1218
1218
  const i = e.previousSibling;
1219
1219
  if (i === null || !B(i)) return;
1220
- const s = I(i);
1220
+ const s = _(i);
1221
1221
  if (s)
1222
- s.appendChild(e), _(e).forEach((r) => {
1222
+ s.appendChild(e), I(e).forEach((r) => {
1223
1223
  s.appendChild(r);
1224
1224
  });
1225
1225
  else {
1226
1226
  const r = this.renderer.renderWrapper(!1);
1227
- r.appendChild(e), _(e).forEach((o) => {
1227
+ r.appendChild(e), I(e).forEach((o) => {
1228
1228
  r.appendChild(o);
1229
1229
  }), i.appendChild(r);
1230
1230
  }
@@ -1238,7 +1238,7 @@ class et {
1238
1238
  convertFirstItemToDefaultBlock() {
1239
1239
  const t = this.currentItem;
1240
1240
  if (t === null) return;
1241
- const e = _(t);
1241
+ const e = I(t);
1242
1242
  if (e.length !== 0) {
1243
1243
  const r = e[0];
1244
1244
  this.unshiftItem(r), N(t);
@@ -1714,7 +1714,7 @@ class H {
1714
1714
  return { message: !0, type: !1, alignType: !1 };
1715
1715
  }
1716
1716
  }
1717
- const _t = { orientation: !1 }, w = class w {
1717
+ const It = { orientation: !1 }, w = class w {
1718
1718
  constructor({ api: t, data: e, config: i, block: s, ...n }) {
1719
1719
  var o, a, d, l, p, h;
1720
1720
  this.wrapper = document.createElement("div"), this.DEFAULT_INDENT_KEY = "Tab", this.lastResizeTimeout = null, this.cachedMaxWidthForContent = null, this.api = t, this.block = s, !i && "settings" in n && (i = (o = n.settings) != null ? o : {}), this.config = { indentSize: 24, maxIndent: 8, minIndent: 0, multiblock: !1, autoIndent: !1, tuneName: null, orientation: "horizontal", customBlockIndentLimits: {}, handleShortcut: void 0, direction: "ltr", directionChangeHandler: null, version: "2.30", ...i != null ? i : {} }, this.changeConfigBasedOnVersionIfNeeded(), (a = this.config) != null && a.directionChangeHandler && this.config.directionChangeHandler(this.alignmentChangeListener.bind(this));
@@ -1952,7 +1952,7 @@ const _t = { orientation: !1 }, w = class w {
1952
1952
  return new DOMParser().parseFromString(t, "text/html").body.firstChild;
1953
1953
  }
1954
1954
  changeConfigBasedOnVersionIfNeeded() {
1955
- this.config.version && this.config.version < "2.27" && this.config.orientation === "vertical" && (this.config.orientation = "horizontal", _t.orientation, _t.orientation = !0);
1955
+ this.config.version && this.config.version < "2.27" && this.config.orientation === "vertical" && (this.config.orientation = "horizontal", It.orientation, It.orientation = !0);
1956
1956
  }
1957
1957
  maxWidthForContent(t) {
1958
1958
  const e = t.querySelector(`.${this.EditorCSS.content}`);
@@ -2143,12 +2143,12 @@ function x(u, t, e = {}) {
2143
2143
  for (const s in e) Object.prototype.hasOwnProperty.call(e, s) && (i[s] = e[s]);
2144
2144
  return i;
2145
2145
  }
2146
- function It(u) {
2146
+ function _t(u) {
2147
2147
  const t = u.getBoundingClientRect();
2148
2148
  return { y1: Math.floor(t.top + window.pageYOffset), x1: Math.floor(t.left + window.pageXOffset), x2: Math.floor(t.right + window.pageXOffset), y2: Math.floor(t.bottom + window.pageYOffset) };
2149
2149
  }
2150
2150
  function it(u, t) {
2151
- const e = It(u), i = It(t);
2151
+ const e = _t(u), i = _t(t);
2152
2152
  return { fromTopBorder: i.y1 - e.y1, fromLeftBorder: i.x1 - e.x1, fromRightBorder: e.x2 - i.x2, fromBottomBorder: e.y2 - i.y2 };
2153
2153
  }
2154
2154
  function Ht(u, t) {
@@ -2997,7 +2997,7 @@ const ye = { class: "ebl-editor", id: "holder" }, Se = jt({ name: "EblEditor", i
2997
2997
  let r = { blocks: [] }, o = null, a = null;
2998
2998
  const d = ["indent", "blockAlignment"];
2999
2999
  qt(() => {
3000
- o = new Xt({ minHeight: 300, holder: "holder", autofocus: !0, defaultBlock: "paragraph", placeholder: n.placeholder, tunes: d, tools: { inlineCode: F, underline: lt, Color: { class: me }, marker: { class: $ }, indent: { class: at }, alert: { class: H, inlineToolbar: !0 }, List: { class: X, inlineToolbar: !0, config: { defaultStyle: "checklist", maxLevel: 4 } }, h1: { class: re, inlineToolbar: !0 }, h2: { class: oe, inlineToolbar: !0 }, h3: { class: ae, inlineToolbar: !0 }, h4: { class: le, inlineToolbar: !0 }, h5: { class: de, inlineToolbar: !0 }, h6: { class: he, inlineToolbar: !0 }, paragraph: { class: ct, inlineToolbar: !0 }, blockAlignment: { class: ht, inlineToolbar: !0 }, code: { class: q, config: { lang: "javascript", theme: "github-dark-dimmed" } }, quote: { class: ce, inlineToolbar: !0 }, delimiter: ue, table: { class: ve, inlineToolbar: !0, config: { rows: 2, cols: 3 } }, image: { class: Z, inlineToolbar: !0, tunes: d.concat(["imageResize"]), config: { types: ".png,.jpeg,.jpg,.gif,.webp", tokenInfo: {}, endpoints: { byFile: i == null ? void 0 : i.fileUploadEndpoint }, features: { caption: !1, stretch: !1, border: !1, background: !1 } } }, imageResize: { class: be, config: { resize: !0, crop: !1 } } }, readOnly: n.readOnly, i18n: n.locale, onChange: (h, c) => {
3000
+ o = new Xt({ minHeight: 300, holder: "holder", autofocus: !0, defaultBlock: "paragraph", placeholder: n.placeholder, tunes: d, tools: { inlineCode: F, underline: lt, Color: { class: me }, marker: { class: $ }, indent: { class: at }, alert: { class: H, inlineToolbar: !0 }, List: { class: X, inlineToolbar: !0, config: { defaultStyle: "checklist", maxLevel: 4 } }, h1: { class: re, inlineToolbar: !0 }, h2: { class: oe, inlineToolbar: !0 }, h3: { class: ae, inlineToolbar: !0 }, h4: { class: le, inlineToolbar: !0 }, h5: { class: de, inlineToolbar: !0 }, h6: { class: he, inlineToolbar: !0 }, paragraph: { class: ct, inlineToolbar: !0 }, blockAlignment: { class: ht, inlineToolbar: !0 }, code: { class: q, config: { lang: "javascript", theme: "github-dark-dimmed" } }, quote: { class: ce, inlineToolbar: !0 }, delimiter: ue, table: { class: ve, inlineToolbar: !0, config: { rows: 2, cols: 3 } }, image: { class: Z, inlineToolbar: !0, tunes: d.concat(["imageResize"]), config: { types: ".png,.jpeg,.jpg,.gif,.webp", tokenInfo: n.tokenInfo, endpoints: { byFile: i == null ? void 0 : i.fileUploadEndpoint }, features: { caption: !1, stretch: !1, border: !1, background: !1 } } }, imageResize: { class: be, config: { resize: !0, crop: !1 } } }, readOnly: n.readOnly, i18n: n.locale, onChange: (h, c) => {
3001
3001
  s("onChange", h, c);
3002
3002
  }, onReady: () => {
3003
3003
  new ne("holder", n.readOnly, o, "1px solid #999"), n.data && n.data.blocks && n.data.blocks.length > 0 && (a = new ge({ editor: o, config: { debounceTimer: 200, maxLength: 100 }, onUpdate: () => {
@@ -3033,7 +3033,7 @@ for (let u in Nt) {
3033
3033
  const t = se(Nt[u]);
3034
3034
  $t.push(t);
3035
3035
  }
3036
- const Ie = { messages: { ui: { blockTunes: { toggler: { "Click to tune": "可拖拽和点击" } }, toolbar: { toolbox: { Add: "添加", Filter: "过滤", "Nothing found": "无内容" }, popover: { Filter: "过滤", "Nothing found": "无内容" } }, popover: { Filter: "筛选", "Nothing found": "未找到任何内容", "Convert to": "转化为", "Add below": "在下方插入" } }, toolNames: { Text: "段落", H1: "一级标题", H2: "二级标题", H3: "三级标题", H4: "四级标题", H5: "五级标题", H6: "六级标题", "Ordered List": "有序列表", "Unordered List": "无序列表", Checklist: "任务列表", Quote: "引用", Code: "代码块", Delimiter: "分割线", Link: "链接", Bold: "加粗", Italic: "倾斜", Alert: "高亮块", indent: "缩进", Marker: "突出显示", Color: "文本颜色", Underline: "下划线", InlineCode: "行内代码", Table: "表格", Image: "图片" }, tools: { image: { "Couldn’t upload image. Please try another.": "上传图片失败,请稍后重试。" }, table: { "Add row above": "在上面插入行", "Add row below": "在下面插入行", "Delete row": "删除行", "Add column to left": "在左边插入列", "Add column to right": "在右边插入列", "Delete column": "删除列", "With headings": "使用标题行", "Without headings": "不使用标题行" }, marker: { Marker: "突出显示" }, link: { "Add a link": "添加链接", Save: "确定", "Pasted link is not valid.": "链接地址无效" }, List: { Unordered: "无序", Ordered: "有序", Checklist: "任务列表", "Counter type": "计数器类型", Numeric: "阿拉伯数字", "Lower Roman": "小写罗马数字", "Upper Roman": "大写罗马数字", "Lower Alpha": "小写字母", "Upper Alpha": "大写字母", "Start with": "开始序号" }, paragraph: { "Enter something": "请输入内容" }, stub: { "The block can not be displayed correctly.": "该模块不能放置在这里" }, code: { "Enter your code": "输入代码", Copied: "已复制", "Unable to copy": "复制失败" }, convertTo: { "Convert to": "转化为" }, alert: { "alert-primary": "主要样式", "alert-secondary": "次要样式", "alert-info": "信息", "alert-success": "成功", "alert-warning": "警告", "alert-danger": "危险", "alert-light": "浅色", "alert-dark": "深色", "align-left": "左对齐", "align-center": "居中", "align-right": "右对齐", "Type here...": "输入内容" } }, blockTunes: { delete: { Delete: "删除", "Click to delete": "点击删除" }, moveUp: { "Move up": "向上移" }, moveDown: { "Move down": "向下移" }, filter: { Filter: "过滤" }, blockAlignment: { "left align": "左对齐", "center align": "居中对齐", "right align": "右对齐", "justify align": "两端对齐" }, indent: { "Indent right": "向右缩进", "Indent left": "向左缩进" } } } }, Ft = /* @__PURE__ */ ((u = []) => ({ version: "2.31.44", install: (t, e) => {
3036
+ const _e = { messages: { ui: { blockTunes: { toggler: { "Click to tune": "可拖拽和点击" } }, toolbar: { toolbox: { Add: "添加", Filter: "过滤", "Nothing found": "无内容" }, popover: { Filter: "过滤", "Nothing found": "无内容" } }, popover: { Filter: "筛选", "Nothing found": "未找到任何内容", "Convert to": "转化为", "Add below": "在下方插入" } }, toolNames: { Text: "段落", H1: "一级标题", H2: "二级标题", H3: "三级标题", H4: "四级标题", H5: "五级标题", H6: "六级标题", "Ordered List": "有序列表", "Unordered List": "无序列表", Checklist: "任务列表", Quote: "引用", Code: "代码块", Delimiter: "分割线", Link: "链接", Bold: "加粗", Italic: "倾斜", Alert: "高亮块", indent: "缩进", Marker: "突出显示", Color: "文本颜色", Underline: "下划线", InlineCode: "行内代码", Table: "表格", Image: "图片" }, tools: { image: { "Couldn’t upload image. Please try another.": "上传图片失败,请稍后重试。" }, table: { "Add row above": "在上面插入行", "Add row below": "在下面插入行", "Delete row": "删除行", "Add column to left": "在左边插入列", "Add column to right": "在右边插入列", "Delete column": "删除列", "With headings": "使用标题行", "Without headings": "不使用标题行" }, marker: { Marker: "突出显示" }, link: { "Add a link": "添加链接", Save: "确定", "Pasted link is not valid.": "链接地址无效" }, List: { Unordered: "无序", Ordered: "有序", Checklist: "任务列表", "Counter type": "计数器类型", Numeric: "阿拉伯数字", "Lower Roman": "小写罗马数字", "Upper Roman": "大写罗马数字", "Lower Alpha": "小写字母", "Upper Alpha": "大写字母", "Start with": "开始序号" }, paragraph: { "Enter something": "请输入内容" }, stub: { "The block can not be displayed correctly.": "该模块不能放置在这里" }, code: { "Enter your code": "输入代码", Copied: "已复制", "Unable to copy": "复制失败" }, convertTo: { "Convert to": "转化为" }, alert: { "alert-primary": "主要样式", "alert-secondary": "次要样式", "alert-info": "信息", "alert-success": "成功", "alert-warning": "警告", "alert-danger": "危险", "alert-light": "浅色", "alert-dark": "深色", "align-left": "左对齐", "align-center": "居中", "align-right": "右对齐", "Type here...": "输入内容" } }, blockTunes: { delete: { Delete: "删除", "Click to delete": "点击删除" }, moveUp: { "Move up": "向上移" }, moveDown: { "Move down": "向下移" }, filter: { Filter: "过滤" }, blockAlignment: { "left align": "左对齐", "center align": "居中对齐", "right align": "右对齐", "justify align": "两端对齐" }, indent: { "Indent right": "向右缩进", "Indent left": "向左缩进" } } } }, Ft = /* @__PURE__ */ ((u = []) => ({ version: "2.31.45", install: (t, e) => {
3037
3037
  t[pt] || (t[pt] = !0, u.forEach((i) => t.use(i)), t.provide("EblEditorSettings", e));
3038
3038
  } }))($t), He = Ft.install, Ae = Ft.version;
3039
3039
  export {
@@ -3041,5 +3041,5 @@ export {
3041
3041
  Ft as default,
3042
3042
  He as install,
3043
3043
  Ae as version,
3044
- Ie as zhCn
3044
+ _e as zhCn
3045
3045
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebl-vue/editor-full",
3
- "version": "2.31.44",
3
+ "version": "2.31.45",
4
4
  "type": "module",
5
5
  "author": "lrj525@sina.com",
6
6
  "description": "结构化编辑器",