@redneckz/wildless-cms-uni-blocks 0.14.78 → 0.14.79

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.
@@ -4417,11 +4417,12 @@
4417
4417
  };
4418
4418
 
4419
4419
  const LinkDocItem = JSX(({ icon, text, href, target, fileFormat, fileSize }) => {
4420
- const prefix = fileFormat || fileSize ? ',' : '';
4420
+ const prefix = fileSize && fileFormat ? ',' : '';
4421
4421
  const size = fileSize ?? '';
4422
4422
  const format = fileFormat ? String(fileFormat) : '';
4423
- return (jsxs("a", { className: "flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main", role: "link", href: href, target: target, children: [icon, text ? (jsxs(Text, { size: "text-l", font: "font-light", children: [text, jsx(Text, { color: "text-secondary-text", children: href && `${size} ${prefix} ${format}` })] })) : null] }));
4423
+ return (jsxs("a", { className: "flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main", role: "link", href: href, target: target, children: [icon, text ? (jsxs(Text, { size: "text-l", font: "font-light", children: [text, " ", addSpace(size, format), jsx(Text, { color: "text-secondary-text", children: href && `${size + prefix + format}` })] })) : null] }));
4424
4424
  });
4425
+ const addSpace = (size, format) => (size || format ? jsx("span", { children: ",\u00A0" }) : '');
4425
4426
 
4426
4427
  const linkIconStyle = 'min-w-6 min-h-6';
4427
4428
 
@@ -4443,9 +4444,16 @@
4443
4444
  const fileSize = docBlockDef?.docType === 'Attachment'
4444
4445
  ? formatBytes(docBlockDef?.attachment?.fileSize || 0)
4445
4446
  : docBlockDef?.fileSize;
4446
- const fileFormat = docBlockDef?.docType !== 'Attachment' ? docBlockDef?.fileFormat : '';
4447
+ const fileFormat = docBlockDef?.docType === 'Attachment' ? getExtFromHref(href) : docBlockDef?.fileFormat;
4447
4448
  return (jsx("div", { role: "listitem", children: jsx(LinkDocItem, { text: docBlockDef?.text, target: docBlockDef?.target, href: href, fileFormat: fileFormat, fileSize: fileSize, icon: icon ? jsx(Img, { className: linkIconStyle, image: icon, width: "24", height: "24" }) : null }) }, String(i)));
4448
4449
  };
4450
+ const getExtFromHref = (href) => {
4451
+ if (!href) {
4452
+ return '';
4453
+ }
4454
+ const index = href.lastIndexOf('.');
4455
+ return index !== -1 ? href.substring(index + 1) : '';
4456
+ };
4449
4457
 
4450
4458
  const MobileAppTile = JSX(({ className, padding, align = 'text-left', buttons = [], description, image, items, qr, additionalDescription = '', title = 'Мобильное приложение', version = 'primary', ...rest }) => {
4451
4459
  const containerStyle = version === 'secondary' ? 'p-m min-w-32' : 'min-w-24';
@@ -5759,7 +5767,7 @@
5759
5767
  return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-3xl sticky bottom-0 pointer-events-auto" }) }));
5760
5768
  }
5761
5769
 
5762
- const packageVersion = "0.14.77";
5770
+ const packageVersion = "0.14.78";
5763
5771
 
5764
5772
  exports.Blocks = Blocks;
5765
5773
  exports.ContentPage = ContentPage;