@xuda.io/runtime-bundle 1.0.1418 → 1.0.1419

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.
@@ -12840,13 +12840,15 @@ func.runtime.ui.copy_runtime_state = function ($source, $target) {
12840
12840
  const xu_data_keys = Object.keys(source_data.xuData);
12841
12841
  for (let index = 0; index < xu_data_keys.length; index++) {
12842
12842
  const key = xu_data_keys[index];
12843
- target_data.xuData[key] = structuredClone(source_data.xuData[key]);
12843
+ const val = source_data.xuData[key];
12844
+ try { target_data.xuData[key] = structuredClone(val); } catch (_) { target_data.xuData[key] = val; }
12844
12845
  }
12845
12846
 
12846
12847
  const xu_attribute_keys = Object.keys(source_data.xuAttributes);
12847
12848
  for (let index = 0; index < xu_attribute_keys.length; index++) {
12848
12849
  const key = xu_attribute_keys[index];
12849
- target_data.xuAttributes[key] = structuredClone(source_data.xuAttributes[key]);
12850
+ const val = source_data.xuAttributes[key];
12851
+ try { target_data.xuAttributes[key] = structuredClone(val); } catch (_) { target_data.xuAttributes[key] = val; }
12850
12852
  }
12851
12853
  return $target;
12852
12854
  };
@@ -17640,15 +17642,22 @@ func.runtime.render.handle_legacy_xu_render = async function (options) {
17640
17642
  parent_nodeP: options.parent_nodeP,
17641
17643
  $root_container: options.$root_container,
17642
17644
  });
17643
- // Snapshot xuData before remove deletes the meta store entry (shared xu-ui-id)
17645
+ // Snapshot xuData while meta store still holds the entry
17644
17646
  const snapshot_xuData = func.runtime.ui.get_data(cloned_div).xuData;
17645
17647
  const snapshot_xuAttributes = options.nodeP.attributes || {};
17646
17648
  const xu_ui_id = func.runtime.ui.get_attr(options.$elm, 'xu-ui-id');
17647
17649
 
17648
- // Remove original element first (clears _meta_store for this xu-ui-id)
17649
- func.runtime.ui.remove(options.$elm);
17650
+ // Remove original element from DOM WITHOUT deleting _meta_store.
17651
+ // Using func.runtime.ui.remove() would call delete_meta(xu_ui_id),
17652
+ // wiping the meta entry before create_xu_render_placeholder can write it.
17653
+ // The XURENDER placeholder reuses the same xu-ui-id, so the meta entry
17654
+ // will be overwritten below — no orphaned data.
17655
+ const _elm_node = func.runtime.ui.get_first_node(options.$elm);
17656
+ if (_elm_node?.remove) {
17657
+ _elm_node.remove();
17658
+ }
17650
17659
 
17651
- // Then create XURENDER placeholder (writes fresh meta store entry)
17660
+ // Create XURENDER placeholder (overwrites meta store entry for this xu-ui-id)
17652
17661
  func.runtime.render.create_xu_render_placeholder(xu_ui_id, options.$container, {
17653
17662
  hidden: true,
17654
17663
  xuData: snapshot_xuData,
@@ -12766,13 +12766,15 @@ func.runtime.ui.copy_runtime_state = function ($source, $target) {
12766
12766
  const xu_data_keys = Object.keys(source_data.xuData);
12767
12767
  for (let index = 0; index < xu_data_keys.length; index++) {
12768
12768
  const key = xu_data_keys[index];
12769
- target_data.xuData[key] = structuredClone(source_data.xuData[key]);
12769
+ const val = source_data.xuData[key];
12770
+ try { target_data.xuData[key] = structuredClone(val); } catch (_) { target_data.xuData[key] = val; }
12770
12771
  }
12771
12772
 
12772
12773
  const xu_attribute_keys = Object.keys(source_data.xuAttributes);
12773
12774
  for (let index = 0; index < xu_attribute_keys.length; index++) {
12774
12775
  const key = xu_attribute_keys[index];
12775
- target_data.xuAttributes[key] = structuredClone(source_data.xuAttributes[key]);
12776
+ const val = source_data.xuAttributes[key];
12777
+ try { target_data.xuAttributes[key] = structuredClone(val); } catch (_) { target_data.xuAttributes[key] = val; }
12776
12778
  }
12777
12779
  return $target;
12778
12780
  };
@@ -17566,15 +17568,22 @@ func.runtime.render.handle_legacy_xu_render = async function (options) {
17566
17568
  parent_nodeP: options.parent_nodeP,
17567
17569
  $root_container: options.$root_container,
17568
17570
  });
17569
- // Snapshot xuData before remove deletes the meta store entry (shared xu-ui-id)
17571
+ // Snapshot xuData while meta store still holds the entry
17570
17572
  const snapshot_xuData = func.runtime.ui.get_data(cloned_div).xuData;
17571
17573
  const snapshot_xuAttributes = options.nodeP.attributes || {};
17572
17574
  const xu_ui_id = func.runtime.ui.get_attr(options.$elm, 'xu-ui-id');
17573
17575
 
17574
- // Remove original element first (clears _meta_store for this xu-ui-id)
17575
- func.runtime.ui.remove(options.$elm);
17576
+ // Remove original element from DOM WITHOUT deleting _meta_store.
17577
+ // Using func.runtime.ui.remove() would call delete_meta(xu_ui_id),
17578
+ // wiping the meta entry before create_xu_render_placeholder can write it.
17579
+ // The XURENDER placeholder reuses the same xu-ui-id, so the meta entry
17580
+ // will be overwritten below — no orphaned data.
17581
+ const _elm_node = func.runtime.ui.get_first_node(options.$elm);
17582
+ if (_elm_node?.remove) {
17583
+ _elm_node.remove();
17584
+ }
17576
17585
 
17577
- // Then create XURENDER placeholder (writes fresh meta store entry)
17586
+ // Create XURENDER placeholder (overwrites meta store entry for this xu-ui-id)
17578
17587
  func.runtime.render.create_xu_render_placeholder(xu_ui_id, options.$container, {
17579
17588
  hidden: true,
17580
17589
  xuData: snapshot_xuData,