vue-editify 0.0.48 → 0.0.50

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <div style="padding: 100px 50px 50px 50px">
3
- <editify v-model="value" placeholder="请输入正文内容..." allow-paste-html border @change="change" :menu="menuConfig" ref="editify" height="400px" @after-render="afterRender" :paste-keep-marks="{ 'data-zip': ['span'] }" autofocus :custom-parse-node="parseNode" show-word-length></editify>
2
+ <div style="padding: 100px 50px 50px 50px; height: 100%; box-sizing: border-box">
3
+ <editify v-model="value" placeholder="请输入正文内容..." allow-paste-html @change="change" :menu="menuConfig" ref="editify" :height="'300px'" @after-render="afterRender" :paste-keep-marks="{ 'data-zip': ['span'] }" autofocus :custom-parse-node="parseNode" :show-word-length="true" :border="true"></editify>
4
4
  </div>
5
5
  </template>
6
6
  <script>
@@ -13,7 +13,7 @@ export default {
13
13
  return {
14
14
  value: ``,
15
15
  menuConfig: {
16
- mode: 'inner',
16
+ mode: 'default',
17
17
  sequence: {
18
18
  alert: 100,
19
19
  zip: 101
@@ -25,6 +25,9 @@ export default {
25
25
  sourceView: {
26
26
  show: true
27
27
  },
28
+ fullScreen: {
29
+ show: true
30
+ },
28
31
  extends: {
29
32
  zip: {
30
33
  title: '上传压缩包',
package/lib/editify.es.js CHANGED
@@ -15370,7 +15370,7 @@ const editorProps = {
15370
15370
  },
15371
15371
  //编辑内容高度
15372
15372
  height: {
15373
- type: String,
15373
+ type: [String, Boolean],
15374
15374
  default: "600px"
15375
15375
  },
15376
15376
  //是否自适应高度
@@ -16160,7 +16160,8 @@ const getMenuConfig = function(editTrans, editLocale) {
16160
16160
  video: 24,
16161
16161
  table: 25,
16162
16162
  codeBlock: 26,
16163
- sourceView: 27
16163
+ sourceView: 27,
16164
+ fullScreen: 28
16164
16165
  },
16165
16166
  //撤销按钮配置
16166
16167
  undo: {
@@ -16490,6 +16491,15 @@ const getMenuConfig = function(editTrans, editLocale) {
16490
16491
  //右侧边框是否显示
16491
16492
  rightBorder: false
16492
16493
  },
16494
+ //全屏
16495
+ fullScreen: {
16496
+ //是否显示此工具
16497
+ show: false,
16498
+ //左侧边框是否显示
16499
+ leftBorder: false,
16500
+ //右侧边框是否显示
16501
+ rightBorder: false
16502
+ },
16493
16503
  //拓展菜单,每个key表示拓展菜单的唯一名称,value是对象,包含type/title/rightBorder/leftBorder/disabled/active/width/maxHeight/options/value/hideScroll/onLayerShow/onLayerShown/onLayerHidden/onOperate/default/layer/option属性
16494
16504
  extends: {}
16495
16505
  };
@@ -17587,8 +17597,8 @@ const _hoisted_4$6 = {
17587
17597
  key: 1,
17588
17598
  class: "editify-button-options"
17589
17599
  };
17590
- const _hoisted_5$6 = ["onClick"];
17591
- const _hoisted_6$6 = {
17600
+ const _hoisted_5$5 = ["onClick"];
17601
+ const _hoisted_6$5 = {
17592
17602
  key: 1,
17593
17603
  class: "editify-button-option-flex"
17594
17604
  };
@@ -17659,14 +17669,14 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
17659
17669
  _ctx.$slots.option ? renderSlot(_ctx.$slots, "option", {
17660
17670
  key: 0,
17661
17671
  item
17662
- }, void 0, true) : (openBlock(), createElementBlock("div", _hoisted_6$6, [
17672
+ }, void 0, true) : (openBlock(), createElementBlock("div", _hoisted_6$5, [
17663
17673
  item.icon ? (openBlock(), createBlock(_component_Icon, {
17664
17674
  key: 0,
17665
17675
  value: item.icon
17666
17676
  }, null, 8, ["value"])) : createCommentVNode("", true),
17667
17677
  createElementVNode("span", null, toDisplayString(item.label), 1)
17668
17678
  ]))
17669
- ], 14, _hoisted_5$6);
17679
+ ], 14, _hoisted_5$5);
17670
17680
  }), 256))
17671
17681
  ]))
17672
17682
  ], 4)
@@ -18660,8 +18670,8 @@ const _hoisted_1$6 = {
18660
18670
  const _hoisted_2$5 = { class: "editify-toolbar-link-label" };
18661
18671
  const _hoisted_3$5 = ["placeholder"];
18662
18672
  const _hoisted_4$5 = { class: "editify-toolbar-link-footer" };
18663
- const _hoisted_5$5 = { class: "editify-toolbar-link-operations" };
18664
- const _hoisted_6$5 = ["href"];
18673
+ const _hoisted_5$4 = { class: "editify-toolbar-link-operations" };
18674
+ const _hoisted_6$4 = ["href"];
18665
18675
  function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
18666
18676
  const _component_Checkbox = resolveComponent("Checkbox");
18667
18677
  const _component_Button = resolveComponent("Button");
@@ -18710,7 +18720,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
18710
18720
  color: _ctx.$parent.color,
18711
18721
  size: 10
18712
18722
  }, null, 8, ["onChange", "modelValue", "label", "color"]),
18713
- createElementVNode("div", _hoisted_5$5, [
18723
+ createElementVNode("div", _hoisted_5$4, [
18714
18724
  createElementVNode("span", {
18715
18725
  onClick: _cache[5] || (_cache[5] = (...args) => _ctx.$parent.removeLink && _ctx.$parent.removeLink(...args))
18716
18726
  }, toDisplayString($options.$editTrans("removeLink")), 1),
@@ -18718,7 +18728,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
18718
18728
  href: $data.linkConfig.url,
18719
18729
  target: "_blank",
18720
18730
  style: normalizeStyle({ color: _ctx.$parent.color })
18721
- }, toDisplayString($options.$editTrans("viewLink")), 13, _hoisted_6$5)
18731
+ }, toDisplayString($options.$editTrans("viewLink")), 13, _hoisted_6$4)
18722
18732
  ])
18723
18733
  ])
18724
18734
  ])) : $props.type == "image" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
@@ -19445,8 +19455,8 @@ const _hoisted_1$5 = { class: "editify-link" };
19445
19455
  const _hoisted_2$4 = { class: "editify-link-label" };
19446
19456
  const _hoisted_3$4 = ["placeholder"];
19447
19457
  const _hoisted_4$4 = ["placeholder"];
19448
- const _hoisted_5$4 = { class: "editify-link-footer" };
19449
- const _hoisted_6$4 = { class: "editify-link-operations" };
19458
+ const _hoisted_5$3 = { class: "editify-link-footer" };
19459
+ const _hoisted_6$3 = { class: "editify-link-operations" };
19450
19460
  function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
19451
19461
  const _component_Checkbox = resolveComponent("Checkbox");
19452
19462
  return openBlock(), createElementBlock("div", _hoisted_1$5, [
@@ -19479,7 +19489,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
19479
19489
  { trim: true }
19480
19490
  ]
19481
19491
  ]),
19482
- createElementVNode("div", _hoisted_5$4, [
19492
+ createElementVNode("div", _hoisted_5$3, [
19483
19493
  createVNode(_component_Checkbox, {
19484
19494
  modelValue: $data.newOpen,
19485
19495
  "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $data.newOpen = $event),
@@ -19487,7 +19497,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
19487
19497
  color: $props.color,
19488
19498
  size: 10
19489
19499
  }, null, 8, ["modelValue", "label", "color"]),
19490
- createElementVNode("div", _hoisted_6$4, [
19500
+ createElementVNode("div", _hoisted_6$3, [
19491
19501
  createElementVNode("span", {
19492
19502
  style: normalizeStyle({ color: $props.color }),
19493
19503
  onClick: _cache[7] || (_cache[7] = (...args) => $options.insertLink && $options.insertLink(...args))
@@ -19650,11 +19660,11 @@ const _hoisted_3$3 = {
19650
19660
  class: "editify-image-remote"
19651
19661
  };
19652
19662
  const _hoisted_4$3 = ["placeholder"];
19653
- const _hoisted_5$3 = {
19663
+ const _hoisted_5$2 = {
19654
19664
  key: 1,
19655
19665
  class: "editify-image-upload"
19656
19666
  };
19657
- const _hoisted_6$3 = ["multiple"];
19667
+ const _hoisted_6$2 = ["multiple"];
19658
19668
  function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
19659
19669
  const _component_Icon = resolveComponent("Icon");
19660
19670
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
@@ -19696,14 +19706,14 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
19696
19706
  onClick: _cache[5] || (_cache[5] = (...args) => $options.insertRemoteImage && $options.insertRemoteImage(...args))
19697
19707
  }, toDisplayString($options.$editTrans("insert")), 1)
19698
19708
  ], 4)
19699
- ])) : (openBlock(), createElementBlock("div", _hoisted_5$3, [
19709
+ ])) : (openBlock(), createElementBlock("div", _hoisted_5$2, [
19700
19710
  createVNode(_component_Icon, { value: "upload" }),
19701
19711
  createElementVNode("input", {
19702
19712
  multiple: $props.multiple,
19703
19713
  accept: "image/*",
19704
19714
  onChange: _cache[6] || (_cache[6] = (...args) => $options.selectFile && $options.selectFile(...args)),
19705
19715
  type: "file"
19706
- }, null, 40, _hoisted_6$3)
19716
+ }, null, 40, _hoisted_6$2)
19707
19717
  ]))
19708
19718
  ]);
19709
19719
  }
@@ -19861,11 +19871,11 @@ const _hoisted_3$2 = {
19861
19871
  class: "editify-video-remote"
19862
19872
  };
19863
19873
  const _hoisted_4$2 = ["placeholder"];
19864
- const _hoisted_5$2 = {
19874
+ const _hoisted_5$1 = {
19865
19875
  key: 1,
19866
19876
  class: "editify-video-upload"
19867
19877
  };
19868
- const _hoisted_6$2 = ["multiple"];
19878
+ const _hoisted_6$1 = ["multiple"];
19869
19879
  function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
19870
19880
  const _component_Icon = resolveComponent("Icon");
19871
19881
  return openBlock(), createElementBlock("div", _hoisted_1$3, [
@@ -19907,14 +19917,14 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
19907
19917
  onClick: _cache[5] || (_cache[5] = (...args) => $options.insertRemoteVideo && $options.insertRemoteVideo(...args))
19908
19918
  }, toDisplayString($options.$editTrans("insert")), 1)
19909
19919
  ], 4)
19910
- ])) : (openBlock(), createElementBlock("div", _hoisted_5$2, [
19920
+ ])) : (openBlock(), createElementBlock("div", _hoisted_5$1, [
19911
19921
  createVNode(_component_Icon, { value: "upload" }),
19912
19922
  createElementVNode("input", {
19913
19923
  multiple: $props.multiple,
19914
19924
  accept: "video/*",
19915
19925
  onChange: _cache[6] || (_cache[6] = (...args) => $options.selectFile && $options.selectFile(...args)),
19916
19926
  type: "file"
19917
- }, null, 40, _hoisted_6$2)
19927
+ }, null, 40, _hoisted_6$1)
19918
19928
  ]))
19919
19929
  ]);
19920
19930
  }
@@ -20009,8 +20019,8 @@ const _hoisted_3$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createEl
20009
20019
  const _hoisted_4$1 = [
20010
20020
  _hoisted_3$1
20011
20021
  ];
20012
- const _hoisted_5$1 = { class: "editify-table-footer" };
20013
- const _hoisted_6$1 = { key: 0 };
20022
+ const _hoisted_5 = { class: "editify-table-footer" };
20023
+ const _hoisted_6 = { key: 0 };
20014
20024
  const _hoisted_7 = { key: 1 };
20015
20025
  function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
20016
20026
  return openBlock(), createElementBlock("div", _hoisted_1$2, [
@@ -20027,13 +20037,13 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
20027
20037
  ]);
20028
20038
  }), 256))
20029
20039
  ]),
20030
- createElementVNode("div", _hoisted_5$1, [
20031
- $options.specification ? (openBlock(), createElementBlock("span", _hoisted_6$1, toDisplayString($options.specification.x) + " x " + toDisplayString($options.specification.y), 1)) : (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString($options.$editTrans("insertTable")), 1))
20040
+ createElementVNode("div", _hoisted_5, [
20041
+ $options.specification ? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString($options.specification.x) + " x " + toDisplayString($options.specification.y), 1)) : (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString($options.$editTrans("insertTable")), 1))
20032
20042
  ])
20033
20043
  ]);
20034
20044
  }
20035
20045
  const InsertTable = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-227ede65"]]);
20036
- const Menu_vue_vue_type_style_index_0_scoped_da918768_lang = "";
20046
+ const Menu_vue_vue_type_style_index_0_scoped_c952b6ed_lang = "";
20037
20047
  const _sfc_main$1 = {
20038
20048
  name: "Menu",
20039
20049
  props: {
@@ -20349,6 +20359,14 @@ const _sfc_main$1 = {
20349
20359
  rightBorder: this.config.sourceView.rightBorder,
20350
20360
  active: false,
20351
20361
  disabled: false
20362
+ },
20363
+ //全屏按钮配置
20364
+ fullScreenConfig: {
20365
+ show: this.config.fullScreen.show,
20366
+ leftBorder: this.config.fullScreen.leftBorder,
20367
+ rightBorder: this.config.fullScreen.rightBorder,
20368
+ active: false,
20369
+ disabled: false
20352
20370
  }
20353
20371
  };
20354
20372
  },
@@ -20365,11 +20383,27 @@ const _sfc_main$1 = {
20365
20383
  //菜单是否禁用
20366
20384
  menuDisabled() {
20367
20385
  return (name) => {
20368
- if (name == "sourceView") {
20386
+ if (name == "sourceView" || name == "fullScreen") {
20369
20387
  return false;
20370
20388
  }
20371
20389
  return this.$parent.isSourceView;
20372
20390
  };
20391
+ },
20392
+ //菜单模式
20393
+ menuMode() {
20394
+ if (this.$parent.isFullScreen || this.$parent.height === true) {
20395
+ if (this.config.mode == "fixed") {
20396
+ return "default";
20397
+ }
20398
+ }
20399
+ return this.config.mode;
20400
+ },
20401
+ //菜单栏是否显示边框
20402
+ menuShowBorder() {
20403
+ if (this.menuMode == "fixed") {
20404
+ return false;
20405
+ }
20406
+ return this.$parent.showBorder;
20373
20407
  }
20374
20408
  },
20375
20409
  components: {
@@ -20950,6 +20984,22 @@ const _sfc_main$1 = {
20950
20984
  () => h(Icon, { value: "source-view" })
20951
20985
  );
20952
20986
  }
20987
+ if (this.name == "fullScreen" && this.$parent.fullScreenConfig.show) {
20988
+ return h(
20989
+ Button,
20990
+ {
20991
+ ...props,
20992
+ title: this.$editTrans("fullScreen"),
20993
+ leftBorder: this.$parent.fullScreenConfig.leftBorder,
20994
+ rightBorder: this.$parent.fullScreenConfig.rightBorder,
20995
+ color: this.$parent.color,
20996
+ disabled: this.$parent.fullScreenConfig.disabled || this.disabled || this.$parent.disabled,
20997
+ active: this.$parent.fullScreenConfig.active,
20998
+ onOperate: this.$parent.handleOperate
20999
+ },
21000
+ () => h(Icon, { value: "full-screen" })
21001
+ );
21002
+ }
20953
21003
  if (obj.common.isObject(this.$parent.config.extends)) {
20954
21004
  const configuration = this.$parent.config.extends[this.name];
20955
21005
  if (configuration) {
@@ -21104,6 +21154,10 @@ const _sfc_main$1 = {
21104
21154
  if (!this.$parent.isSourceView) {
21105
21155
  this.$parent.editor.rangeRender();
21106
21156
  }
21157
+ } else if (name == "fullScreen") {
21158
+ this.$parent.isFullScreen = !this.$parent.isFullScreen;
21159
+ this.fullScreenConfig.active = this.$parent.isFullScreen;
21160
+ this.$parent.editor.rangeRender();
21107
21161
  }
21108
21162
  },
21109
21163
  //处理光标更新
@@ -21232,6 +21286,7 @@ const _sfc_main$1 = {
21232
21286
  this.codeBlockConfig.active = !!this.$parent.getCurrentParsedomElement("pre", true);
21233
21287
  this.codeBlockConfig.disabled = hasTable || hasQuote || extraDisabled("codeBlock");
21234
21288
  this.sourceViewConfig.active = this.$parent.isSourceView;
21289
+ this.fullScreenConfig.active = this.$parent.isFullScreen;
21235
21290
  }
21236
21291
  }
21237
21292
  };
@@ -21239,8 +21294,8 @@ const _hoisted_1$1 = ["data-editify-mode"];
21239
21294
  function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
21240
21295
  const _component_MenuItem = resolveComponent("MenuItem");
21241
21296
  return openBlock(), createElementBlock("div", {
21242
- class: normalizeClass(["editify-menu", { border: _ctx.$parent.border, source: _ctx.$parent.isSourceView }]),
21243
- "data-editify-mode": $props.config.mode,
21297
+ class: normalizeClass(["editify-menu", { border: $options.menuShowBorder, source: _ctx.$parent.isSourceView && $options.menuMode == "inner", fullscreen: _ctx.$parent.isFullScreen }]),
21298
+ "data-editify-mode": $options.menuMode,
21244
21299
  style: normalizeStyle($props.config.style || "")
21245
21300
  }, [
21246
21301
  (openBlock(true), createElementBlock(Fragment, null, renderList($options.menuNames, (item) => {
@@ -21251,8 +21306,8 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
21251
21306
  }), 256))
21252
21307
  ], 14, _hoisted_1$1);
21253
21308
  }
21254
- const Menu = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-da918768"]]);
21255
- const Editify_vue_vue_type_style_index_0_scoped_3f1c784c_lang = "";
21309
+ const Menu = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-c952b6ed"]]);
21310
+ const Editify_vue_vue_type_style_index_0_scoped_ede8b39b_lang = "";
21256
21311
  const _sfc_main = {
21257
21312
  name: "editify",
21258
21313
  props: { ...editorProps },
@@ -21271,6 +21326,8 @@ const _sfc_main = {
21271
21326
  isModelChange: false,
21272
21327
  //是否代码视图
21273
21328
  isSourceView: false,
21329
+ //是否全屏
21330
+ isFullScreen: false,
21274
21331
  //是否正在输入中文
21275
21332
  isInputChinese: false,
21276
21333
  //表格列宽拖拽记录数据
@@ -21292,7 +21349,9 @@ const _sfc_main = {
21292
21349
  //rangeUpdate更新延时器
21293
21350
  updateTimer: null,
21294
21351
  //菜单栏是否可以使用标识
21295
- canUseMenu: false
21352
+ canUseMenu: false,
21353
+ //手动设定的编辑器编辑区域高度
21354
+ contentHeight: 0
21296
21355
  };
21297
21356
  },
21298
21357
  computed: {
@@ -21319,8 +21378,20 @@ const _sfc_main = {
21319
21378
  }
21320
21379
  return false;
21321
21380
  },
21381
+ //是否显示边框
21382
+ showBorder() {
21383
+ if (this.isFullScreen) {
21384
+ return false;
21385
+ }
21386
+ return this.border;
21387
+ },
21322
21388
  //编辑器样式设置
21323
21389
  contentStyle() {
21390
+ if (this.height === true || this.isFullScreen) {
21391
+ return {
21392
+ height: this.contentHeight + "px"
21393
+ };
21394
+ }
21324
21395
  return this.autoheight ? { minHeight: this.height } : { height: this.height };
21325
21396
  },
21326
21397
  //最终生效的工具栏配置
@@ -21359,6 +21430,21 @@ const _sfc_main = {
21359
21430
  this.handleToolbar();
21360
21431
  }
21361
21432
  }
21433
+ },
21434
+ //全屏切换
21435
+ isFullScreen() {
21436
+ this.$nextTick(() => {
21437
+ this.setContentHeight();
21438
+ });
21439
+ },
21440
+ //监听height为true
21441
+ height: {
21442
+ immediate: true,
21443
+ handler: function() {
21444
+ this.$nextTick(() => {
21445
+ this.setContentHeight();
21446
+ });
21447
+ }
21362
21448
  }
21363
21449
  },
21364
21450
  mounted() {
@@ -21368,7 +21454,10 @@ const _sfc_main = {
21368
21454
  obj.event.on(document.documentElement, `mousemove.editify_${this.uid}`, this.documentMouseMove);
21369
21455
  obj.event.on(document.documentElement, `mouseup.editify_${this.uid}`, this.documentMouseUp);
21370
21456
  obj.event.on(document.documentElement, `click.editify_${this.uid}`, this.documentClick);
21371
- obj.event.on(window, `resize.editify_${this.uid}`, this.setVideoHeight);
21457
+ obj.event.on(window, `resize.editify_${this.uid}`, () => {
21458
+ this.setVideoHeight();
21459
+ this.setContentHeight();
21460
+ });
21372
21461
  },
21373
21462
  methods: {
21374
21463
  //初始创建编辑器
@@ -21675,7 +21764,7 @@ const _sfc_main = {
21675
21764
  if (this.disabled) {
21676
21765
  return;
21677
21766
  }
21678
- if (this.border && this.color) {
21767
+ if (this.border && this.color && !this.isFullScreen) {
21679
21768
  this.$refs.body.style.borderColor = "";
21680
21769
  this.$refs.body.style.boxShadow = "";
21681
21770
  if (this.menuConfig.use) {
@@ -21690,7 +21779,7 @@ const _sfc_main = {
21690
21779
  if (this.disabled) {
21691
21780
  return;
21692
21781
  }
21693
- if (this.border && this.color) {
21782
+ if (this.border && this.color && !this.isFullScreen) {
21694
21783
  this.$refs.body.style.borderColor = this.color;
21695
21784
  const rgb = obj.color.hex2rgb(this.color);
21696
21785
  if (this.menuConfig.use && this.menuConfig.mode == "inner") {
@@ -21851,6 +21940,22 @@ const _sfc_main = {
21851
21940
  video.style.height = video.offsetWidth / this.videoRatio + "px";
21852
21941
  });
21853
21942
  },
21943
+ //设置编辑器主体高度
21944
+ setContentHeight() {
21945
+ if (this.height === true || this.isFullScreen) {
21946
+ let height = this.$el.offsetHeight;
21947
+ if (this.menuConfig.use) {
21948
+ height -= this.$refs.menu.$el.offsetHeight;
21949
+ }
21950
+ if (this.showWordLength) {
21951
+ height -= this.$refs.footer.offsetHeight;
21952
+ }
21953
+ if (this.$refs.menu.menuMode == "default") {
21954
+ height -= 10;
21955
+ }
21956
+ this.contentHeight = height - 2;
21957
+ }
21958
+ },
21854
21959
  //api:光标设置到文档底部
21855
21960
  collapseToEnd() {
21856
21961
  if (this.disabled) {
@@ -22852,19 +22957,16 @@ const _sfc_main = {
22852
22957
  this.editor.destroy();
22853
22958
  }
22854
22959
  };
22855
- const _hoisted_1 = { class: "editify" };
22856
- const _hoisted_2 = ["data-editify-uid"];
22857
- const _hoisted_3 = ["data-editify-placeholder"];
22858
- const _hoisted_4 = ["value"];
22859
- const _hoisted_5 = {
22860
- key: 1,
22861
- class: "editify-footer"
22862
- };
22863
- const _hoisted_6 = { class: "editify-footer-words" };
22960
+ const _hoisted_1 = ["data-editify-uid"];
22961
+ const _hoisted_2 = ["data-editify-placeholder"];
22962
+ const _hoisted_3 = ["value"];
22963
+ const _hoisted_4 = { class: "editify-footer-words" };
22864
22964
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
22865
22965
  const _component_Menu = resolveComponent("Menu");
22866
22966
  const _component_Toolbar = resolveComponent("Toolbar");
22867
- return openBlock(), createElementBlock("div", _hoisted_1, [
22967
+ return openBlock(), createElementBlock("div", {
22968
+ class: normalizeClass(["editify", { fullheight: _ctx.height === true && !$data.isFullScreen, fullscreen: $data.isFullScreen }])
22969
+ }, [
22868
22970
  $options.menuConfig.use ? (openBlock(), createBlock(_component_Menu, {
22869
22971
  key: 0,
22870
22972
  config: $options.menuConfig,
@@ -22874,7 +22976,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
22874
22976
  }, null, 8, ["config", "disabled", "color"])) : createCommentVNode("", true),
22875
22977
  createElementVNode("div", {
22876
22978
  ref: "body",
22877
- class: normalizeClass(["editify-body", { border: _ctx.border, menu_inner: $options.menuConfig.use && $options.menuConfig.mode == "inner" }]),
22979
+ class: normalizeClass(["editify-body", { border: $options.showBorder, menu_inner: $options.menuConfig.use && $options.menuConfig.mode == "inner" }]),
22878
22980
  "data-editify-uid": $setup.uid
22879
22981
  }, [
22880
22982
  createElementVNode("div", {
@@ -22886,13 +22988,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
22886
22988
  onCompositionstart: _cache[2] || (_cache[2] = ($event) => $data.isInputChinese = true),
22887
22989
  onCompositionend: _cache[3] || (_cache[3] = ($event) => $data.isInputChinese = false),
22888
22990
  "data-editify-placeholder": _ctx.placeholder
22889
- }, null, 46, _hoisted_3),
22991
+ }, null, 46, _hoisted_2),
22890
22992
  $data.isSourceView ? (openBlock(), createElementBlock("textarea", {
22891
22993
  key: 0,
22892
22994
  value: $options.value,
22893
22995
  readonly: "",
22894
22996
  class: "editify-source"
22895
- }, null, 8, _hoisted_4)) : createCommentVNode("", true),
22997
+ }, null, 8, _hoisted_3)) : createCommentVNode("", true),
22896
22998
  createVNode(_component_Toolbar, {
22897
22999
  ref: "toolbar",
22898
23000
  modelValue: $data.toolbarOptions.show,
@@ -22901,13 +23003,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
22901
23003
  type: $data.toolbarOptions.type,
22902
23004
  config: $options.toolbarConfig
22903
23005
  }, null, 8, ["modelValue", "node", "type", "config"])
22904
- ], 10, _hoisted_2),
22905
- _ctx.showWordLength ? (openBlock(), createElementBlock("div", _hoisted_5, [
22906
- createElementVNode("div", _hoisted_6, toDisplayString($options.$editTrans("totalWordCount")) + toDisplayString($options.textValue.length), 1)
22907
- ])) : createCommentVNode("", true)
22908
- ]);
23006
+ ], 10, _hoisted_1),
23007
+ _ctx.showWordLength ? (openBlock(), createElementBlock("div", {
23008
+ key: 1,
23009
+ class: normalizeClass(["editify-footer", { fullscreen: $data.isFullScreen && !$data.isSourceView }]),
23010
+ ref: "footer"
23011
+ }, [
23012
+ createElementVNode("div", _hoisted_4, toDisplayString($options.$editTrans("totalWordCount")) + toDisplayString($options.textValue.length), 1)
23013
+ ], 2)) : createCommentVNode("", true)
23014
+ ], 2);
22909
23015
  }
22910
- const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-3f1c784c"]]);
23016
+ const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-ede8b39b"]]);
22911
23017
  const iconfont = "";
22912
23018
  const en_US = {
22913
23019
  textWrapUp: "Up feed",
@@ -22992,7 +23098,8 @@ const en_US = {
22992
23098
  alignRight: "Align right",
22993
23099
  alignJustify: "Align justify",
22994
23100
  defaultLineHeight: "Default",
22995
- auto: "auto"
23101
+ auto: "auto",
23102
+ fullScreen: "Full screen"
22996
23103
  };
22997
23104
  const zh_CN = {
22998
23105
  textWrapUp: "向上换行",
@@ -23077,7 +23184,8 @@ const zh_CN = {
23077
23184
  alignRight: "右对齐",
23078
23185
  alignJustify: "两端对齐",
23079
23186
  defaultLineHeight: "默认行高",
23080
- auto: "自适应"
23187
+ auto: "自适应",
23188
+ fullScreen: "全屏"
23081
23189
  };
23082
23190
  const translations = {
23083
23191
  zh_CN,
@@ -23088,7 +23196,7 @@ const i18n = (locale) => {
23088
23196
  return translations[locale][key];
23089
23197
  };
23090
23198
  };
23091
- const version = "0.0.48";
23199
+ const version = "0.0.50";
23092
23200
  const install = (app, props) => {
23093
23201
  const locale = (props ? props.locale : "zh_CN") || "zh_CN";
23094
23202
  app.provide("$editTrans", i18n(locale));