@lvce-editor/renderer-process 16.0.0 → 16.2.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.
@@ -6508,6 +6508,7 @@ const getSashId = $Target => {
6508
6508
  const Backspace$1 = 'Backspace';
6509
6509
  const Tab$1 = 'Tab';
6510
6510
  const Space$1 = ' ';
6511
+ const Space2 = 'Space';
6511
6512
  const Enter$1 = 'Enter';
6512
6513
  const Escape$1 = 'Escape';
6513
6514
  const PageUp$1 = 'PageUp';
@@ -6695,6 +6696,7 @@ const getKeyCode = key => {
6695
6696
  case Enter$1:
6696
6697
  return Enter;
6697
6698
  case Space$1:
6699
+ case Space2:
6698
6700
  return Space;
6699
6701
  case PageUp$1:
6700
6702
  return PageUp;
@@ -6871,10 +6873,13 @@ const CtrlCmd = 1 << 11 >>> 0;
6871
6873
  const Shift = 1 << 10 >>> 0;
6872
6874
  const Alt = 1 << 9 >>> 0;
6873
6875
 
6874
- const normalizeKey = key => {
6876
+ const normalizeKey = (key, code) => {
6875
6877
  if (key.length === 1) {
6876
6878
  return key.toLowerCase();
6877
6879
  }
6880
+ if (key === 'Unidentified') {
6881
+ return code;
6882
+ }
6878
6883
  return key;
6879
6884
  };
6880
6885
 
@@ -6883,12 +6888,13 @@ const getKeyBindingIdentifier = event => {
6883
6888
  ctrlKey,
6884
6889
  shiftKey,
6885
6890
  altKey,
6886
- key
6891
+ key,
6892
+ code
6887
6893
  } = event;
6888
6894
  const modifierControl = ctrlKey ? CtrlCmd : 0;
6889
6895
  const modifierShift = shiftKey ? Shift : 0;
6890
6896
  const modifierAlt = altKey ? Alt : 0;
6891
- const normalizedKey = normalizeKey(key);
6897
+ const normalizedKey = normalizeKey(key, code);
6892
6898
  const keyCode = getKeyCode(normalizedKey);
6893
6899
  const identifier = modifierControl | modifierShift | modifierAlt | keyCode;
6894
6900
  return identifier;
@@ -9161,6 +9167,10 @@ const sendMultiple = commands => {
9161
9167
  // @ts-ignore
9162
9168
  setDragData(viewletId, method, ...args);
9163
9169
  break;
9170
+ case 'Viewlet.replaceChildren':
9171
+ // @ts-ignore
9172
+ replaceChildren(viewletId, method, ...args);
9173
+ break;
9164
9174
  case 'Viewlet.addCss':
9165
9175
  case 'Viewlet.setCss':
9166
9176
  case 'Css.addCssStyleSheet':
@@ -9290,6 +9300,17 @@ const append = (parentId, childId, referenceNodes) => {
9290
9300
  childInstance.factory.postAppend(childInstance.state);
9291
9301
  }
9292
9302
  };
9303
+ const replaceChildren = (parentId, childIds) => {
9304
+ const parentInstance = state$1.instances[parentId];
9305
+ const $Parent = parentInstance.state.$Viewlet;
9306
+ const $Fragment = document.createDocumentFragment();
9307
+ for (const childId of childIds) {
9308
+ const childInstance = state$1.instances[childId];
9309
+ const $Child = childInstance.state.$Viewlet;
9310
+ $Fragment.append($Child);
9311
+ }
9312
+ $Parent.replaceChildren($Fragment);
9313
+ };
9293
9314
  const appendToBody = childId => {
9294
9315
  const $Parent = document.body;
9295
9316
  const childInstance = state$1.instances[childId];
@@ -9346,6 +9367,8 @@ const getFn = command => {
9346
9367
  return setInputValues;
9347
9368
  case 'Viewlet.setProperty':
9348
9369
  return setProperty;
9370
+ case 'Viewlet.replaceChildren':
9371
+ return replaceChildren;
9349
9372
  case 'Css.addCssStyleSheet':
9350
9373
  case 'Viewlet.addCss':
9351
9374
  case 'Viewlet.setCss':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "16.0.0",
3
+ "version": "16.2.0",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "renderer-process"