mol_jsx_lib 0.0.59 → 0.0.62

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.
package/node.js CHANGED
@@ -828,7 +828,7 @@ var $;
828
828
  function $mol_jsx(Elem, props, ...childNodes) {
829
829
  const id = props && props.id || '';
830
830
  const guid = id ? $.$mol_jsx_prefix ? $.$mol_jsx_prefix + '/' + id : id : $.$mol_jsx_prefix;
831
- const crumbs_self = id ? $.$mol_jsx_crumbs.replace(/([^ ]+)/, `$1_${id}`) : $.$mol_jsx_crumbs;
831
+ const crumbs_self = id ? $.$mol_jsx_crumbs.replace(/(\S+)/g, `$1_${id.replace(/\/.*/i, '')}`) : $.$mol_jsx_crumbs;
832
832
  if (Elem && $.$mol_jsx_booked) {
833
833
  if ($.$mol_jsx_booked.has(id)) {
834
834
  $mol_fail(new Error(`JSX already has tag with id ${JSON.stringify(guid)}`));
@@ -904,7 +904,11 @@ var $;
904
904
  $mol_dom_render_children(node, [].concat(...childNodes));
905
905
  if (!Elem)
906
906
  return node;
907
+ if (guid)
908
+ node.id = guid;
907
909
  for (const key in props) {
910
+ if (key === 'id')
911
+ continue;
908
912
  if (typeof props[key] === 'string') {
909
913
  ;
910
914
  node.setAttribute(key, props[key]);
@@ -921,8 +925,6 @@ var $;
921
925
  node[key] = props[key];
922
926
  }
923
927
  }
924
- if (guid)
925
- node.id = guid;
926
928
  if ($.$mol_jsx_crumbs)
927
929
  node.className = (props?.['class'] ? props['class'] + ' ' : '') + crumbs_self;
928
930
  return node;