@lvce-editor/renderer-process 25.2.0 → 26.0.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.
@@ -797,167 +797,92 @@ const VirtualDomElements = {
797
797
  Video: Video$1
798
798
  };
799
799
 
800
+ const elementTagMap = {
801
+ [A]: A$1,
802
+ [Article]: Article$1,
803
+ [Aside]: Aside$1,
804
+ [Audio$2]: Audio$3,
805
+ [BlockQuote]: BlockQuote$1,
806
+ [Br$1]: Br$2,
807
+ [Button]: Button$1,
808
+ [Canvas]: Canvas$1,
809
+ [Circle]: Circle$1,
810
+ [Cite]: Cite$1,
811
+ [Code$1]: Code$2,
812
+ [Col]: Col$1,
813
+ [ColGroup]: ColGroup$1,
814
+ [Data]: Data$1,
815
+ [Dd]: Dd$1,
816
+ [Defs]: Defs$1,
817
+ [Del]: Del$1,
818
+ [Div]: Div$1,
819
+ [Dl$1]: Dl$2,
820
+ [Dt$1]: Dt$2,
821
+ [Ellipse]: Ellipse$1,
822
+ [Em]: Em$1,
823
+ [Figcaption]: Figcaption$1,
824
+ [Figure]: Figure$1,
825
+ [Footer]: Footer$1,
826
+ [Form]: Form$1,
827
+ [G$1]: G$2,
828
+ [H1]: H1$1,
829
+ [H2]: H2$1,
830
+ [H3]: H3$1,
831
+ [H4]: H4$1,
832
+ [H5]: H5$1,
833
+ [H6]: H6$1,
834
+ [Head]: Head$1,
835
+ [Header]: Header$1,
836
+ [Hr]: Hr$1,
837
+ [Html]: Html$1,
838
+ [I]: I$1,
839
+ [Iframe]: Iframe$1,
840
+ [Img]: Img$1,
841
+ [Input]: Input$1,
842
+ [Ins]: Ins$1,
843
+ [Kbd]: Kbd$1,
844
+ [Label]: Label$1,
845
+ [Li$1]: Li$2,
846
+ [Line]: Line$1,
847
+ [Main]: Main$1,
848
+ [Meta]: Meta$1,
849
+ [Nav]: Nav$1,
850
+ [Ol$1]: Ol$2,
851
+ [Option]: Option$1,
852
+ [P]: P$1,
853
+ [Path]: Path$1,
854
+ [Polygon]: Polygon$1,
855
+ [Polyline]: Polyline$1,
856
+ [Pre]: Pre$1,
857
+ [Quote$2]: Quote$3,
858
+ [Rect]: Rect$1,
859
+ [Search]: Search$1,
860
+ [Section]: Section$1,
861
+ [Select]: Select$1,
862
+ [Span]: Span$1,
863
+ [Strong]: Strong$1,
864
+ [Style]: Style$1,
865
+ [Svg]: Svg$1,
866
+ [Table]: Table$1,
867
+ [TBody]: TBody$1,
868
+ [Td]: Td$1,
869
+ [TextArea]: TextArea$1,
870
+ [Tfoot]: Tfoot$1,
871
+ [Th]: Th$1,
872
+ [THead]: THead$1,
873
+ [Time]: Time$1,
874
+ [Title]: Title$1,
875
+ [Tr$1]: Tr$2,
876
+ [Ul]: Ul$1,
877
+ [Use]: Use$1,
878
+ [Video$1]: Video$2
879
+ };
800
880
  const getElementTag$1 = type => {
801
- switch (type) {
802
- case A:
803
- return A$1;
804
- case Article:
805
- return Article$1;
806
- case Aside:
807
- return Aside$1;
808
- case Audio$2:
809
- return Audio$3;
810
- case BlockQuote:
811
- return BlockQuote$1;
812
- case Br$1:
813
- return Br$2;
814
- case Button:
815
- return Button$1;
816
- case Canvas:
817
- return Canvas$1;
818
- case Circle:
819
- return Circle$1;
820
- case Cite:
821
- return Cite$1;
822
- case Code$1:
823
- return Code$2;
824
- case Col:
825
- return Col$1;
826
- case ColGroup:
827
- return ColGroup$1;
828
- case Data:
829
- return Data$1;
830
- case Dd:
831
- return Dd$1;
832
- case Defs:
833
- return Defs$1;
834
- case Del:
835
- return Del$1;
836
- case Div:
837
- return Div$1;
838
- case Dl$1:
839
- return Dl$2;
840
- case Dt$1:
841
- return Dt$2;
842
- case Ellipse:
843
- return Ellipse$1;
844
- case Em:
845
- return Em$1;
846
- case Figcaption:
847
- return Figcaption$1;
848
- case Figure:
849
- return Figure$1;
850
- case Footer:
851
- return Footer$1;
852
- case Form:
853
- return Form$1;
854
- case G$1:
855
- return G$2;
856
- case H1:
857
- return H1$1;
858
- case H2:
859
- return H2$1;
860
- case H3:
861
- return H3$1;
862
- case H4:
863
- return H4$1;
864
- case H5:
865
- return H5$1;
866
- case H6:
867
- return H6$1;
868
- case Head:
869
- return Head$1;
870
- case Header:
871
- return Header$1;
872
- case Hr:
873
- return Hr$1;
874
- case Html:
875
- return Html$1;
876
- case I:
877
- return I$1;
878
- case Iframe:
879
- return Iframe$1;
880
- case Img:
881
- return Img$1;
882
- case Input:
883
- return Input$1;
884
- case Ins:
885
- return Ins$1;
886
- case Kbd:
887
- return Kbd$1;
888
- case Label:
889
- return Label$1;
890
- case Li$1:
891
- return Li$2;
892
- case Line:
893
- return Line$1;
894
- case Main:
895
- return Main$1;
896
- case Meta:
897
- return Meta$1;
898
- case Nav:
899
- return Nav$1;
900
- case Ol$1:
901
- return Ol$2;
902
- case Option:
903
- return Option$1;
904
- case P:
905
- return P$1;
906
- case Path:
907
- return Path$1;
908
- case Polygon:
909
- return Polygon$1;
910
- case Polyline:
911
- return Polyline$1;
912
- case Pre:
913
- return Pre$1;
914
- case Quote$2:
915
- return Quote$3;
916
- case Rect:
917
- return Rect$1;
918
- case Search:
919
- return Search$1;
920
- case Section:
921
- return Section$1;
922
- case Select:
923
- return Select$1;
924
- case Span:
925
- return Span$1;
926
- case Strong:
927
- return Strong$1;
928
- case Style:
929
- return Style$1;
930
- case Svg:
931
- return Svg$1;
932
- case Table:
933
- return Table$1;
934
- case TBody:
935
- return TBody$1;
936
- case Td:
937
- return Td$1;
938
- case TextArea:
939
- return TextArea$1;
940
- case Tfoot:
941
- return Tfoot$1;
942
- case Th:
943
- return Th$1;
944
- case THead:
945
- return THead$1;
946
- case Time:
947
- return Time$1;
948
- case Title:
949
- return Title$1;
950
- case Tr$1:
951
- return Tr$2;
952
- case Ul:
953
- return Ul$1;
954
- case Use:
955
- return Use$1;
956
- case Video$1:
957
- return Video$2;
958
- default:
959
- throw new Error(`element tag not found ${type}`);
881
+ const elementTag = elementTagMap[type];
882
+ if (elementTag) {
883
+ return elementTag;
960
884
  }
885
+ throw new Error(`element tag not found ${type}`);
961
886
  };
962
887
 
963
888
  const ElementTagMap = {
@@ -1146,189 +1071,100 @@ const Quote = 93;
1146
1071
  const Star = 131;
1147
1072
  const Plus = 132;
1148
1073
 
1074
+ const keyCodeMap = {
1075
+ [Backquote$1]: Backquote,
1076
+ [Backquote2]: Backquote,
1077
+ [Backslash$1]: Backslash,
1078
+ [Backspace$1]: Backspace,
1079
+ [BracketLeft$1]: BracketLeft,
1080
+ [BracketRight$1]: BracketRight,
1081
+ [Comma$1]: Comma,
1082
+ [Delete$1]: Delete,
1083
+ [Digit0$1]: Digit0,
1084
+ [Digit1$1]: Digit1,
1085
+ [Digit2$1]: Digit2,
1086
+ [Digit3$1]: Digit3,
1087
+ [Digit4$1]: Digit4,
1088
+ [Digit5$1]: Digit5,
1089
+ [Digit6$1]: Digit6,
1090
+ [Digit7$1]: Digit7,
1091
+ [Digit8$1]: Digit8,
1092
+ [Digit9$1]: Digit9,
1093
+ [DownArrow$1]: DownArrow,
1094
+ [End$1]: End,
1095
+ [Enter$1]: Enter,
1096
+ [Equal$1]: Equal,
1097
+ [Escape$1]: Escape,
1098
+ [F1$1]: F1,
1099
+ [F10$1]: F10,
1100
+ [F11$1]: F11,
1101
+ [F12$1]: F12,
1102
+ [F13$1]: F13,
1103
+ [F14$1]: F14,
1104
+ [F15$1]: F15,
1105
+ [F16$1]: F16,
1106
+ [F17$1]: F17,
1107
+ [F18$1]: F18,
1108
+ [F19$1]: F19,
1109
+ [F2$1]: F2,
1110
+ [F20$1]: F20,
1111
+ [F21$1]: F21,
1112
+ [F22$1]: F22,
1113
+ [F23$1]: F23,
1114
+ [F24$1]: F24,
1115
+ [F3$1]: F3,
1116
+ [F4$1]: F4,
1117
+ [F5$1]: F5,
1118
+ [F6$1]: F6,
1119
+ [F7$1]: F7,
1120
+ [F8$1]: F8,
1121
+ [F9$1]: F9,
1122
+ [Home$1]: Home,
1123
+ [Insert$1]: Insert,
1124
+ [KeyA$1]: KeyA,
1125
+ [KeyB$1]: KeyB,
1126
+ [KeyC$1]: KeyC,
1127
+ [KeyD$1]: KeyD,
1128
+ [KeyE$1]: KeyE,
1129
+ [KeyF$1]: KeyF,
1130
+ [KeyG$1]: KeyG,
1131
+ [KeyH$1]: KeyH,
1132
+ [KeyI$1]: KeyI,
1133
+ [KeyJ$1]: KeyJ,
1134
+ [KeyK$1]: KeyK,
1135
+ [KeyL$1]: KeyL,
1136
+ [KeyM$1]: KeyM,
1137
+ [KeyN$1]: KeyN,
1138
+ [KeyO$1]: KeyO,
1139
+ [KeyP$1]: KeyP,
1140
+ [KeyQ$1]: KeyQ,
1141
+ [KeyR$1]: KeyR,
1142
+ [KeyS$1]: KeyS,
1143
+ [KeyT$1]: KeyT,
1144
+ [KeyU$1]: KeyU,
1145
+ [KeyV$1]: KeyV,
1146
+ [KeyW$1]: KeyW,
1147
+ [KeyX$1]: KeyX,
1148
+ [KeyY$1]: KeyY,
1149
+ [KeyZ$1]: KeyZ,
1150
+ [LeftArrow$1]: LeftArrow,
1151
+ [Minus$1]: Minus,
1152
+ [PageDown$1]: PageDown,
1153
+ [PageUp$1]: PageUp,
1154
+ [Period$1]: Period,
1155
+ [Plus$1]: Plus,
1156
+ [Quote$1]: Quote,
1157
+ [RightArrow$1]: RightArrow,
1158
+ [SemiColon$1]: SemiColon,
1159
+ [Slash$1]: Slash,
1160
+ [Space$1]: Space,
1161
+ [Space2]: Space,
1162
+ [Star$1]: Star,
1163
+ [Tab$1]: Tab,
1164
+ [UpArrow$1]: UpArrow
1165
+ };
1149
1166
  const getKeyCode = key => {
1150
- switch (key) {
1151
- case Backquote$1:
1152
- case Backquote2:
1153
- return Backquote;
1154
- case Backslash$1:
1155
- return Backslash;
1156
- case Backspace$1:
1157
- return Backspace;
1158
- case BracketLeft$1:
1159
- return BracketLeft;
1160
- case BracketRight$1:
1161
- return BracketRight;
1162
- case Comma$1:
1163
- return Comma;
1164
- case Delete$1:
1165
- return Delete;
1166
- case Digit0$1:
1167
- return Digit0;
1168
- case Digit1$1:
1169
- return Digit1;
1170
- case Digit2$1:
1171
- return Digit2;
1172
- case Digit3$1:
1173
- return Digit3;
1174
- case Digit4$1:
1175
- return Digit4;
1176
- case Digit5$1:
1177
- return Digit5;
1178
- case Digit6$1:
1179
- return Digit6;
1180
- case Digit7$1:
1181
- return Digit7;
1182
- case Digit8$1:
1183
- return Digit8;
1184
- case Digit9$1:
1185
- return Digit9;
1186
- case DownArrow$1:
1187
- return DownArrow;
1188
- case End$1:
1189
- return End;
1190
- case Enter$1:
1191
- return Enter;
1192
- case Equal$1:
1193
- return Equal;
1194
- case Escape$1:
1195
- return Escape;
1196
- case F1$1:
1197
- return F1;
1198
- case F10$1:
1199
- return F10;
1200
- case F11$1:
1201
- return F11;
1202
- case F12$1:
1203
- return F12;
1204
- case F13$1:
1205
- return F13;
1206
- case F14$1:
1207
- return F14;
1208
- case F15$1:
1209
- return F15;
1210
- case F16$1:
1211
- return F16;
1212
- case F17$1:
1213
- return F17;
1214
- case F18$1:
1215
- return F18;
1216
- case F19$1:
1217
- return F19;
1218
- case F2$1:
1219
- return F2;
1220
- case F20$1:
1221
- return F20;
1222
- case F21$1:
1223
- return F21;
1224
- case F22$1:
1225
- return F22;
1226
- case F23$1:
1227
- return F23;
1228
- case F24$1:
1229
- return F24;
1230
- case F3$1:
1231
- return F3;
1232
- case F4$1:
1233
- return F4;
1234
- case F5$1:
1235
- return F5;
1236
- case F6$1:
1237
- return F6;
1238
- case F7$1:
1239
- return F7;
1240
- case F8$1:
1241
- return F8;
1242
- case F9$1:
1243
- return F9;
1244
- case Home$1:
1245
- return Home;
1246
- case Insert$1:
1247
- return Insert;
1248
- case KeyA$1:
1249
- return KeyA;
1250
- case KeyB$1:
1251
- return KeyB;
1252
- case KeyC$1:
1253
- return KeyC;
1254
- case KeyD$1:
1255
- return KeyD;
1256
- case KeyE$1:
1257
- return KeyE;
1258
- case KeyF$1:
1259
- return KeyF;
1260
- case KeyG$1:
1261
- return KeyG;
1262
- case KeyH$1:
1263
- return KeyH;
1264
- case KeyI$1:
1265
- return KeyI;
1266
- case KeyJ$1:
1267
- return KeyJ;
1268
- case KeyK$1:
1269
- return KeyK;
1270
- case KeyL$1:
1271
- return KeyL;
1272
- case KeyM$1:
1273
- return KeyM;
1274
- case KeyN$1:
1275
- return KeyN;
1276
- case KeyO$1:
1277
- return KeyO;
1278
- case KeyP$1:
1279
- return KeyP;
1280
- case KeyQ$1:
1281
- return KeyQ;
1282
- case KeyR$1:
1283
- return KeyR;
1284
- case KeyS$1:
1285
- return KeyS;
1286
- case KeyT$1:
1287
- return KeyT;
1288
- case KeyU$1:
1289
- return KeyU;
1290
- case KeyV$1:
1291
- return KeyV;
1292
- case KeyW$1:
1293
- return KeyW;
1294
- case KeyX$1:
1295
- return KeyX;
1296
- case KeyY$1:
1297
- return KeyY;
1298
- case KeyZ$1:
1299
- return KeyZ;
1300
- case LeftArrow$1:
1301
- return LeftArrow;
1302
- case Minus$1:
1303
- return Minus;
1304
- case PageDown$1:
1305
- return PageDown;
1306
- case PageUp$1:
1307
- return PageUp;
1308
- case Period$1:
1309
- return Period;
1310
- case Plus$1:
1311
- return Plus;
1312
- case Quote$1:
1313
- return Quote;
1314
- case RightArrow$1:
1315
- return RightArrow;
1316
- case SemiColon$1:
1317
- return SemiColon;
1318
- case Slash$1:
1319
- return Slash;
1320
- case Space$1:
1321
- case Space2:
1322
- return Space;
1323
- case Star$1:
1324
- return Star;
1325
- case Tab$1:
1326
- return Tab;
1327
- case UpArrow$1:
1328
- return UpArrow;
1329
- default:
1330
- return Unknown;
1331
- }
1167
+ return keyCodeMap[key] || Unknown;
1332
1168
  };
1333
1169
 
1334
1170
  const CtrlCmd = 1 << 11 >>> 0;
@@ -4799,13 +4635,35 @@ const create$Overlay = () => {
4799
4635
  $TestOverlay.style.contain = 'strict';
4800
4636
  $TestOverlay.style.userSelect = 'text';
4801
4637
  $TestOverlay.style.color = 'black';
4638
+ $TestOverlay.style.display = 'flex';
4639
+ $TestOverlay.style.gap = '10px';
4802
4640
  return $TestOverlay;
4803
4641
  };
4804
- const showOverlay = (state, background, text) => {
4642
+ const createAction = action => {
4643
+ const $action = document.createElement('button');
4644
+ $action.textContent = action.label;
4645
+ $action.style.flexShrink = '0';
4646
+ $action.style.background = 'dodgerblue';
4647
+ $action.style.paddingLeft = '6px';
4648
+ $action.style.paddingRight = '6px';
4649
+ $action.style.color = 'white';
4650
+ $action.style.border = 'none';
4651
+ $action.style.borderRadius = '5px';
4652
+ $action.addEventListener('click', () => {
4653
+ send(action.command);
4654
+ });
4655
+ return $action;
4656
+ };
4657
+ const showOverlay = (state, background, text, actions = []) => {
4805
4658
  const $TestOverlay = create$Overlay();
4806
4659
  $TestOverlay.dataset.state = state;
4807
4660
  $TestOverlay.style.background = background;
4808
- $TestOverlay.textContent = text;
4661
+ const span = document.createElement('span');
4662
+ span.style.flex = '1';
4663
+ span.style.overflow = 'hidden';
4664
+ span.textContent = text;
4665
+ const $actions = actions.map(createAction);
4666
+ $TestOverlay.append(span, ...$actions);
4809
4667
  document.body.append($TestOverlay);
4810
4668
  };
4811
4669
  const performAction = async (locator, fnName, options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "25.2.0",
3
+ "version": "26.0.0",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "renderer-process"