@mce/bigesj 0.11.4 → 0.12.1

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.js +17 -6
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1082,6 +1082,7 @@ async function convertElement(el, parent, context) {
1082
1082
  }
1083
1083
  switch (el.type) {
1084
1084
  case "image":
1085
+ meta.inCanvasIs = "Element2D";
1085
1086
  meta.inPptIs = "Picture";
1086
1087
  element.foreground = {
1087
1088
  image: await convertImageElementToUrl(el),
@@ -1121,6 +1122,7 @@ async function convertElement(el, parent, context) {
1121
1122
  }
1122
1123
  break;
1123
1124
  case "svg": {
1125
+ meta.inCanvasIs = "Element2D";
1124
1126
  meta.inPptIs = "Picture";
1125
1127
  element.foreground = {
1126
1128
  image: await convertSvgElementToUrl(el),
@@ -1129,6 +1131,7 @@ async function convertElement(el, parent, context) {
1129
1131
  break;
1130
1132
  }
1131
1133
  case "text": {
1134
+ meta.inCanvasIs = "Element2D";
1132
1135
  meta.inPptIs = "Shape";
1133
1136
  if (style.writingMode === "horizontal-tb") {
1134
1137
  style.width = Math.ceil(style.width + style.letterSpacing);
@@ -1144,6 +1147,7 @@ async function convertElement(el, parent, context) {
1144
1147
  break;
1145
1148
  }
1146
1149
  case "com":
1150
+ meta.inCanvasIs = "Element2D";
1147
1151
  meta.inPptIs = "GroupShape";
1148
1152
  element.children = (await Promise.all(
1149
1153
  el.children.map(async (child) => {
@@ -1156,11 +1160,14 @@ async function convertElement(el, parent, context) {
1156
1160
  })
1157
1161
  )).filter(Boolean);
1158
1162
  break;
1163
+ case "anim":
1164
+ meta.inCanvasIs = "Lottie2D";
1165
+ element.src = el.url;
1166
+ break;
1159
1167
  case "pic":
1160
1168
  case "mosaic":
1161
1169
  case "image_squence":
1162
1170
  case "background":
1163
- case "anim":
1164
1171
  case "legend":
1165
1172
  case "shape":
1166
1173
  case "ppt":
@@ -1206,16 +1213,20 @@ async function convertLayout(layout, isFrame = true, context) {
1206
1213
  let background;
1207
1214
  if (layout.background) {
1208
1215
  if (layout.background.color) {
1209
- background ??= {};
1210
1216
  if (isGradient(layout.background.color ?? "")) {
1211
- background.image = layout.background.color;
1217
+ background = {
1218
+ image: layout.background.color
1219
+ };
1212
1220
  } else {
1213
- background.color = layout.background.color;
1221
+ background = {
1222
+ color: layout.background.color
1223
+ };
1214
1224
  }
1215
1225
  }
1216
1226
  if (layout.background.image) {
1217
- background ??= {};
1218
- background.image = layout.background.image;
1227
+ background = {
1228
+ image: layout.background.image
1229
+ };
1219
1230
  }
1220
1231
  }
1221
1232
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mce/bigesj",
3
3
  "type": "module",
4
- "version": "0.11.4",
4
+ "version": "0.12.1",
5
5
  "description": "Plugin for mce",
6
6
  "author": "wxm",
7
7
  "license": "MIT",
@@ -48,7 +48,7 @@
48
48
  "fflate": "^0.8.2"
49
49
  },
50
50
  "devDependencies": {
51
- "mce": "0.11.4"
51
+ "mce": "0.12.1"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "mce": "^0"