@lvce-editor/about-view 7.26.0 → 7.28.0

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.
@@ -602,6 +602,9 @@ const restoreExistingError = (error, currentStack) => {
602
602
  };
603
603
  const restoreMethodNotFoundError = (error, currentStack) => {
604
604
  const restoredError = new JsonRpcError(error.message);
605
+ Object.assign(restoredError, {
606
+ code: error.code
607
+ });
605
608
  const parentStack = getParentStack(error);
606
609
  setStack(restoredError, `${parentStack}${NewLine$1}${currentStack}`);
607
610
  return restoredError;
@@ -621,9 +624,13 @@ const applyDataProperties = (restoredError, error) => {
621
624
  // @ts-ignore
622
625
  restoredError.codeFrame = error.data.codeFrame;
623
626
  }
624
- if (error.data.code) {
627
+ if (typeof error.data.code === 'string' || typeof error.data.code === 'number') {
625
628
  // @ts-ignore
626
- restoredError.code = error.data.code;
629
+ Object.defineProperty(restoredError, 'code', {
630
+ configurable: true,
631
+ value: error.data.code,
632
+ writable: true
633
+ });
627
634
  }
628
635
  if (error.data.type) {
629
636
  // @ts-ignore
@@ -644,7 +651,14 @@ const applyDirectProperties = (restoredError, error) => {
644
651
  }
645
652
  };
646
653
  const restoreMessageError = (error, _currentStack) => {
647
- const restoredError = constructError(error.message, error.type, error.name);
654
+ const restoredError = constructError(error.message, error.type || error.data?.type, error.name);
655
+ if (typeof error.code === 'string' || typeof error.code === 'number') {
656
+ Object.defineProperty(restoredError, 'code', {
657
+ configurable: true,
658
+ value: error.code,
659
+ writable: true
660
+ });
661
+ }
648
662
  if (error.data) {
649
663
  applyDataProperties(restoredError, error);
650
664
  } else {
@@ -723,9 +737,9 @@ const getErrorProperty = (error, prettyError) => {
723
737
  return {
724
738
  code: Custom,
725
739
  data: {
726
- code: prettyError.code,
740
+ code: prettyError.code ?? error?.code,
727
741
  codeFrame: prettyError.codeFrame,
728
- name: prettyError.name,
742
+ name: prettyError.name ?? error?.name,
729
743
  stack: getStack(prettyError),
730
744
  type: getErrorType(prettyError)
731
745
  },
@@ -760,7 +774,12 @@ const getErrorResponseSimple = (id, error) => {
760
774
  return {
761
775
  error: {
762
776
  code: Custom,
763
- data: error,
777
+ data: error instanceof Error ? {
778
+ ...error,
779
+ code: 'code' in error ? error.code : undefined,
780
+ stack: error.stack,
781
+ type: error.name
782
+ } : error,
764
783
  // @ts-ignore
765
784
  message: error.message
766
785
  },
@@ -1121,174 +1140,10 @@ const create$2 = rpcId => {
1121
1140
  };
1122
1141
  };
1123
1142
 
1124
- const Audio = 0;
1125
1143
  const Button$1 = 1;
1126
- const Col = 2;
1127
- const ColGroup = 3;
1128
1144
  const Div = 4;
1129
- const H1 = 5;
1130
- const Input = 6;
1131
- const Kbd = 7;
1132
- const Span = 8;
1133
- const Table = 9;
1134
- const TBody = 10;
1135
- const Td = 11;
1136
1145
  const Text = 12;
1137
- const Th = 13;
1138
- const THead = 14;
1139
- const Tr = 15;
1140
- const I = 16;
1141
- const Img = 17;
1142
- const Root = 0;
1143
- const Ins = 20;
1144
- const Del = 21;
1145
- const H2 = 22;
1146
- const H3 = 23;
1147
- const H4 = 24;
1148
- const H5 = 25;
1149
- const H6 = 26;
1150
- const Article = 27;
1151
- const Aside = 28;
1152
- const Footer = 29;
1153
- const Header = 30;
1154
- const Nav = 40;
1155
- const Section = 41;
1156
- const Search = 42;
1157
- const Dd = 43;
1158
- const Dl = 44;
1159
- const Figcaption = 45;
1160
- const Figure = 46;
1161
- const Hr = 47;
1162
- const Li = 48;
1163
- const Ol = 49;
1164
- const P = 50;
1165
- const Pre = 51;
1166
- const A = 53;
1167
- const Abbr = 54;
1168
1146
  const Br = 55;
1169
- const Cite = 56;
1170
- const Data = 57;
1171
- const Time = 58;
1172
- const Tfoot = 59;
1173
- const Ul = 60;
1174
- const Video = 61;
1175
- const TextArea = 62;
1176
- const Select = 63;
1177
- const Option = 64;
1178
- const Code = 65;
1179
- const Label = 66;
1180
- const Dt = 67;
1181
- const Iframe = 68;
1182
- const Main = 69;
1183
- const Strong = 70;
1184
- const Em = 71;
1185
- const Style = 72;
1186
- const Html = 73;
1187
- const Head = 74;
1188
- const Title = 75;
1189
- const Meta = 76;
1190
- const Canvas = 77;
1191
- const Form = 78;
1192
- const BlockQuote = 79;
1193
- const Quote = 80;
1194
- const Circle = 81;
1195
- const Defs = 82;
1196
- const Ellipse = 83;
1197
- const G = 84;
1198
- const Line = 85;
1199
- const Path = 86;
1200
- const Polygon = 87;
1201
- const Polyline = 88;
1202
- const Rect = 89;
1203
- const Svg = 90;
1204
- const Use = 91;
1205
- const Reference = 100;
1206
-
1207
- const VirtualDomElements = {
1208
- __proto__: null,
1209
- A,
1210
- Abbr,
1211
- Article,
1212
- Aside,
1213
- Audio,
1214
- BlockQuote,
1215
- Br,
1216
- Button: Button$1,
1217
- Canvas,
1218
- Circle,
1219
- Cite,
1220
- Code,
1221
- Col,
1222
- ColGroup,
1223
- Data,
1224
- Dd,
1225
- Defs,
1226
- Del,
1227
- Div,
1228
- Dl,
1229
- Dt,
1230
- Ellipse,
1231
- Em,
1232
- Figcaption,
1233
- Figure,
1234
- Footer,
1235
- Form,
1236
- G,
1237
- H1,
1238
- H2,
1239
- H3,
1240
- H4,
1241
- H5,
1242
- H6,
1243
- Head,
1244
- Header,
1245
- Hr,
1246
- Html,
1247
- I,
1248
- Iframe,
1249
- Img,
1250
- Input,
1251
- Ins,
1252
- Kbd,
1253
- Label,
1254
- Li,
1255
- Line,
1256
- Main,
1257
- Meta,
1258
- Nav,
1259
- Ol,
1260
- Option,
1261
- P,
1262
- Path,
1263
- Polygon,
1264
- Polyline,
1265
- Pre,
1266
- Quote,
1267
- Rect,
1268
- Reference,
1269
- Root,
1270
- Search,
1271
- Section,
1272
- Select,
1273
- Span,
1274
- Strong,
1275
- Style,
1276
- Svg,
1277
- TBody,
1278
- THead,
1279
- Table,
1280
- Td,
1281
- Text,
1282
- TextArea,
1283
- Tfoot,
1284
- Th,
1285
- Time,
1286
- Title,
1287
- Tr,
1288
- Ul,
1289
- Use,
1290
- Video
1291
- };
1292
1147
 
1293
1148
  const TargetName = 'event.target.name';
1294
1149
 
@@ -1752,8 +1607,6 @@ const text = data => {
1752
1607
  };
1753
1608
  };
1754
1609
 
1755
- new Set(Object.values(VirtualDomElements));
1756
-
1757
1610
  const FocusAbout = 4;
1758
1611
 
1759
1612
  const getKeyBindings = () => {
@@ -2301,20 +2154,22 @@ const True = 'true';
2301
2154
 
2302
2155
  const Dialog = 'dialog';
2303
2156
 
2157
+ const buttonClassName$1 = mergeClassNames(Button, ButtonPrimary);
2304
2158
  const getPrimaryButtonVirtualDom = (message, name) => {
2305
2159
  return [{
2306
2160
  childCount: 1,
2307
- className: mergeClassNames(Button, ButtonPrimary),
2161
+ className: buttonClassName$1,
2308
2162
  name,
2309
2163
  onClick: HandleClickButton,
2310
2164
  type: Button$1
2311
2165
  }, text(message)];
2312
2166
  };
2313
2167
 
2168
+ const buttonClassName = mergeClassNames(Button, ButtonSecondary);
2314
2169
  const getSecondaryButtonVirtualDom = (message, name) => {
2315
2170
  return [{
2316
2171
  childCount: 1,
2317
- className: mergeClassNames(Button, ButtonSecondary),
2172
+ className: buttonClassName,
2318
2173
  name,
2319
2174
  onClick: HandleClickButton,
2320
2175
  type: Button$1
@@ -2330,6 +2185,7 @@ const joinBySpace = (...items) => {
2330
2185
 
2331
2186
  const Focusable = -1;
2332
2187
 
2188
+ const infoIconClassName = mergeClassNames(DialogIcon$1, DialogInfoIcon, MaskIcon, MaskIconInfo);
2333
2189
  const dialogToolBarRow = {
2334
2190
  childCount: 1,
2335
2191
  className: DialogToolBarRow,
@@ -2380,7 +2236,7 @@ const getDialogVirtualDom = (content, closeMessage, infoMessage, okMessage, copy
2380
2236
  }, closeIcon, dialogMessageRow, {
2381
2237
  ariaLabel: infoMessage,
2382
2238
  childCount: 0,
2383
- className: mergeClassNames(DialogIcon$1, DialogInfoIcon, MaskIcon, MaskIconInfo),
2239
+ className: infoIconClassName,
2384
2240
  id: DialogIcon,
2385
2241
  type: Div
2386
2242
  }, dialogContentRight, dialogHeading, text(productName), ...content, dialogButtonsRow, ...getSecondaryButtonVirtualDom(okMessage, Ok$1), ...getPrimaryButtonVirtualDom(copyMessage, Copy$1)];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/about-view",
3
- "version": "7.26.0",
3
+ "version": "7.28.0",
4
4
  "description": "About View Worker",
5
5
  "keywords": [
6
6
  "about-view"