@lvce-editor/renderer-process 16.1.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.
@@ -9167,6 +9167,10 @@ const sendMultiple = commands => {
9167
9167
  // @ts-ignore
9168
9168
  setDragData(viewletId, method, ...args);
9169
9169
  break;
9170
+ case 'Viewlet.replaceChildren':
9171
+ // @ts-ignore
9172
+ replaceChildren(viewletId, method, ...args);
9173
+ break;
9170
9174
  case 'Viewlet.addCss':
9171
9175
  case 'Viewlet.setCss':
9172
9176
  case 'Css.addCssStyleSheet':
@@ -9296,6 +9300,17 @@ const append = (parentId, childId, referenceNodes) => {
9296
9300
  childInstance.factory.postAppend(childInstance.state);
9297
9301
  }
9298
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
+ };
9299
9314
  const appendToBody = childId => {
9300
9315
  const $Parent = document.body;
9301
9316
  const childInstance = state$1.instances[childId];
@@ -9352,6 +9367,8 @@ const getFn = command => {
9352
9367
  return setInputValues;
9353
9368
  case 'Viewlet.setProperty':
9354
9369
  return setProperty;
9370
+ case 'Viewlet.replaceChildren':
9371
+ return replaceChildren;
9355
9372
  case 'Css.addCssStyleSheet':
9356
9373
  case 'Viewlet.addCss':
9357
9374
  case 'Viewlet.setCss':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "16.1.0",
3
+ "version": "16.2.0",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "renderer-process"