@haluo/biz 2.0.36 → 2.0.38

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/haluo-biz.js CHANGED
@@ -5012,7 +5012,7 @@ const _sfc_main = {
5012
5012
  this.initData();
5013
5013
  },
5014
5014
  async parseHtml(html, essayPicRelVOList) {
5015
- var _a;
5015
+ var _a, _b, _c, _d;
5016
5016
  const div = document.createElement("div");
5017
5017
  div.innerHTML = html;
5018
5018
  const frag = document.createDocumentFragment();
@@ -5025,8 +5025,8 @@ const _sfc_main = {
5025
5025
  await this.parseArticle(node);
5026
5026
  } else if (node.tagName.toLowerCase() === "halo-good") {
5027
5027
  this.parseGood(node);
5028
- } else if (node.classList.contains("halo-img-content")) {
5029
- const img = node.querySelector("img");
5028
+ } else if (node.classList.contains("halo-img-content") || node.classList.contains("halo-modify-content")) {
5029
+ const img = node.querySelector("img") || node.querySelector("modify");
5030
5030
  node.setAttribute("tabindex", -1);
5031
5031
  node.setAttribute("draggable", true);
5032
5032
  node.setAttribute("contenteditable", false);
@@ -5035,18 +5035,25 @@ const _sfc_main = {
5035
5035
  const desc = img.dataset.desc;
5036
5036
  img.style.margin = "0";
5037
5037
  const seamlessFlag = ((_a = JSON.parse(img.getAttribute("data"))) == null ? void 0 : _a.seamlessFlag) || "0";
5038
+ const paintCopyable = ((_b = JSON.parse(img.getAttribute("data"))) == null ? void 0 : _b.paintCopyable) || "0";
5039
+ const id = ((_c = JSON.parse(img.getAttribute("data"))) == null ? void 0 : _c.id) || "";
5038
5040
  if (essayPicRelVOList) {
5039
5041
  const arr = img.src.split("/");
5040
- const id = arr[arr.length - 1];
5041
- img.src = essayPicRelVOList.find(
5042
- (obj) => obj.id === String(id)
5043
- ).url;
5042
+ const id2 = arr[arr.length - 1];
5043
+ let url = (_d = essayPicRelVOList.find(
5044
+ (obj) => obj.id === String(id2)
5045
+ )) == null ? void 0 : _d.url;
5046
+ if (url) {
5047
+ img.src = url;
5048
+ }
5044
5049
  }
5045
5050
  this.insertImgOperateBtns(
5046
5051
  this.editor,
5047
5052
  {
5048
5053
  content: desc,
5049
- seamlessFlag
5054
+ seamlessFlag,
5055
+ paintCopyable,
5056
+ id
5050
5057
  },
5051
5058
  nodes.length === i
5052
5059
  ).forEach((child) => {
@@ -5011,7 +5011,7 @@
5011
5011
  this.initData();
5012
5012
  },
5013
5013
  async parseHtml(html, essayPicRelVOList) {
5014
- var _a;
5014
+ var _a, _b, _c, _d;
5015
5015
  const div = document.createElement("div");
5016
5016
  div.innerHTML = html;
5017
5017
  const frag = document.createDocumentFragment();
@@ -5024,8 +5024,8 @@
5024
5024
  await this.parseArticle(node);
5025
5025
  } else if (node.tagName.toLowerCase() === "halo-good") {
5026
5026
  this.parseGood(node);
5027
- } else if (node.classList.contains("halo-img-content")) {
5028
- const img = node.querySelector("img");
5027
+ } else if (node.classList.contains("halo-img-content") || node.classList.contains("halo-modify-content")) {
5028
+ const img = node.querySelector("img") || node.querySelector("modify");
5029
5029
  node.setAttribute("tabindex", -1);
5030
5030
  node.setAttribute("draggable", true);
5031
5031
  node.setAttribute("contenteditable", false);
@@ -5034,18 +5034,25 @@
5034
5034
  const desc = img.dataset.desc;
5035
5035
  img.style.margin = "0";
5036
5036
  const seamlessFlag = ((_a = JSON.parse(img.getAttribute("data"))) == null ? void 0 : _a.seamlessFlag) || "0";
5037
+ const paintCopyable = ((_b = JSON.parse(img.getAttribute("data"))) == null ? void 0 : _b.paintCopyable) || "0";
5038
+ const id = ((_c = JSON.parse(img.getAttribute("data"))) == null ? void 0 : _c.id) || "";
5037
5039
  if (essayPicRelVOList) {
5038
5040
  const arr = img.src.split("/");
5039
- const id = arr[arr.length - 1];
5040
- img.src = essayPicRelVOList.find(
5041
- (obj) => obj.id === String(id)
5042
- ).url;
5041
+ const id2 = arr[arr.length - 1];
5042
+ let url = (_d = essayPicRelVOList.find(
5043
+ (obj) => obj.id === String(id2)
5044
+ )) == null ? void 0 : _d.url;
5045
+ if (url) {
5046
+ img.src = url;
5047
+ }
5043
5048
  }
5044
5049
  this.insertImgOperateBtns(
5045
5050
  this.editor,
5046
5051
  {
5047
5052
  content: desc,
5048
- seamlessFlag
5053
+ seamlessFlag,
5054
+ paintCopyable,
5055
+ id
5049
5056
  },
5050
5057
  nodes.length === i
5051
5058
  ).forEach((child) => {
package/dist/style.css CHANGED
@@ -788,6 +788,86 @@
788
788
  .editor #editor-content .halo-img-content .upload-fail {
789
789
  filter: brightness(0.5);
790
790
  }
791
+ .editor #editor-content .halo-modify-content {
792
+ position: relative;
793
+ text-align: center;
794
+ outline: none;
795
+ }
796
+ .editor #editor-content .halo-modify-content .img-loading,
797
+ .editor #editor-content .halo-modify-content .img-fail {
798
+ position: absolute;
799
+ display: flex;
800
+ align-items: center;
801
+ justify-content: center;
802
+ top: 0;
803
+ width: 440px;
804
+ height: 100%;
805
+ left: 50%;
806
+ transform: translateX(-50%);
807
+ line-height: 25px;
808
+ font-size: 18px;
809
+ z-index: 1;
810
+ opacity: 0.9;
811
+ color: #fff;
812
+ -webkit-user-select: none;
813
+ -moz-user-select: none;
814
+ -ms-user-select: none;
815
+ user-select: none;
816
+ }
817
+ .editor #editor-content .halo-modify-content .img-loading .img-loading-icon,
818
+ .editor #editor-content .halo-modify-content .img-fail .img-loading-icon {
819
+ width: 74px;
820
+ margin-left: 40px;
821
+ }
822
+ .editor #editor-content .halo-modify-content .img-loading .img-loading-tip,
823
+ .editor #editor-content .halo-modify-content .img-fail .img-loading-tip {
824
+ position: relative;
825
+ left: -60px;
826
+ top: 2px;
827
+ }
828
+ .editor #editor-content .halo-modify-content .img-again {
829
+ position: absolute;
830
+ left: 175px;
831
+ bottom: 60px;
832
+ font-size: 14px;
833
+ font-weight: 400;
834
+ color: #fff;
835
+ z-index: 1;
836
+ left: 50%;
837
+ transform: translateX(-50%);
838
+ width: 90px;
839
+ line-height: 32px;
840
+ height: 32px;
841
+ border-radius: 4px;
842
+ background: rgba(0, 0, 0, 0.5);
843
+ -webkit-user-select: none;
844
+ -moz-user-select: none;
845
+ -ms-user-select: none;
846
+ user-select: none;
847
+ cursor: pointer;
848
+ }
849
+ .editor #editor-content .halo-modify-content .img-replace {
850
+ display: none;
851
+ }
852
+ .editor #editor-content .halo-modify-content .desc-input-wrap {
853
+ display: none;
854
+ }
855
+ .editor #editor-content .halo-modify-content .img-delete {
856
+ display: none;
857
+ }
858
+ .editor #editor-content .halo-modify-content .halo-modify-area {
859
+ display: inline-block;
860
+ width: 440px;
861
+ min-height: 150px;
862
+ margin: 5px 0;
863
+ }
864
+ .editor #editor-content .halo-modify-content .halo-modify-area:focus {
865
+ outline: 2px solid #1a74ff;
866
+ }
867
+ .editor #editor-content .halo-modify-content .no-upload,
868
+ .editor #editor-content .halo-modify-content .upload-fail {
869
+ filter: brightness(0.5);
870
+ }
791
871
  .editor #editor-content .halo-select {
792
872
  outline: 2px solid #1a74ff;
793
873
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@haluo/biz",
3
3
  "description": "rich text",
4
- "version": "2.0.36",
4
+ "version": "2.0.38",
5
5
  "type": "module",
6
6
  "module": "./dist/haluo-biz.js",
7
7
  "main": "./dist/haluo-biz.umd.cjs",
@@ -19,7 +19,8 @@
19
19
  "dev": "vite",
20
20
  "build": "vue-tsc --noEmit && vite build",
21
21
  "build:watch": "vue-tsc --noEmit && vite build --watch",
22
- "preview": "vite preview"
22
+ "preview": "vite preview",
23
+ "pub": "npm publish"
23
24
  },
24
25
  "dependencies": {
25
26
  "element-plus": "^2.2.28",