@redneckz/wildless-cms-uni-blocks 0.14.141 → 0.14.143

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.
Files changed (37) hide show
  1. package/bundle/bundle.umd.js +29 -29
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/dist/ui-kit/BlockWrapper.js +3 -1
  4. package/dist/ui-kit/BlockWrapper.js.map +1 -1
  5. package/dist/ui-kit/InnerTable/InnerTableBody.js +1 -1
  6. package/dist/ui-kit/InnerTable/InnerTableBody.js.map +1 -1
  7. package/dist/ui-kit/InnerTable/renderInnerTableRow.js +4 -5
  8. package/dist/ui-kit/InnerTable/renderInnerTableRow.js.map +1 -1
  9. package/lib/common.css +1 -1
  10. package/lib/ui-kit/BlockWrapper.js +3 -1
  11. package/lib/ui-kit/BlockWrapper.js.map +1 -1
  12. package/lib/ui-kit/InnerTable/InnerTableBody.js +1 -1
  13. package/lib/ui-kit/InnerTable/InnerTableBody.js.map +1 -1
  14. package/lib/ui-kit/InnerTable/renderInnerTableRow.js +4 -5
  15. package/lib/ui-kit/InnerTable/renderInnerTableRow.js.map +1 -1
  16. package/mobile/bundle/bundle.umd.js +29 -29
  17. package/mobile/bundle/bundle.umd.min.js +1 -1
  18. package/mobile/dist/ui-kit/BlockWrapper.js +3 -1
  19. package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
  20. package/mobile/dist/ui-kit/InnerTable/InnerTableBody.js +1 -1
  21. package/mobile/dist/ui-kit/InnerTable/InnerTableBody.js.map +1 -1
  22. package/mobile/dist/ui-kit/InnerTable/renderInnerTableRow.js +4 -5
  23. package/mobile/dist/ui-kit/InnerTable/renderInnerTableRow.js.map +1 -1
  24. package/mobile/lib/common.css +1 -1
  25. package/mobile/lib/ui-kit/BlockWrapper.js +3 -1
  26. package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
  27. package/mobile/lib/ui-kit/InnerTable/InnerTableBody.js +1 -1
  28. package/mobile/lib/ui-kit/InnerTable/InnerTableBody.js.map +1 -1
  29. package/mobile/lib/ui-kit/InnerTable/renderInnerTableRow.js +4 -5
  30. package/mobile/lib/ui-kit/InnerTable/renderInnerTableRow.js.map +1 -1
  31. package/mobile/src/ui-kit/BlockWrapper.tsx +3 -1
  32. package/mobile/src/ui-kit/InnerTable/InnerTableBody.tsx +3 -3
  33. package/mobile/src/ui-kit/InnerTable/renderInnerTableRow.tsx +5 -14
  34. package/package.json +1 -1
  35. package/src/ui-kit/BlockWrapper.tsx +3 -1
  36. package/src/ui-kit/InnerTable/InnerTableBody.tsx +3 -3
  37. package/src/ui-kit/InnerTable/renderInnerTableRow.tsx +5 -14
@@ -278,6 +278,28 @@
278
278
 
279
279
  const defaultEventBus = new EventBus();
280
280
 
281
+ function useRouter() {
282
+ return useRouter._impl();
283
+ }
284
+ useRouter._impl = () => ({
285
+ isReady: false,
286
+ href: globalThis.location?.href || '/',
287
+ pathname: globalThis.location?.pathname || '/',
288
+ query: {},
289
+ push: () => {
290
+ // Do nothing
291
+ },
292
+ replace: () => {
293
+ // Do nothing
294
+ },
295
+ back: () => {
296
+ // Do nothing
297
+ },
298
+ });
299
+ useRouter.setup = (impl) => {
300
+ useRouter._impl = impl;
301
+ };
302
+
281
303
  const style = (...atoms) => atoms
282
304
  .flatMap((_) => _)
283
305
  .filter(Boolean)
@@ -292,12 +314,13 @@
292
314
  };
293
315
  const BlockWrapper = JSX(({ className, version = 'primary', isTheme = true, defaultPadding = 'p-xl', padding, block, tag = 'section', role, children, style: inlineStyles, }) => {
294
316
  const Tag = tag;
317
+ const router = useRouter();
295
318
  const [isHidden, setHidden] = useState(false);
296
319
  useEffect(() => defaultEventBus.subscribe('tab', (event) => {
297
320
  if (!event.groupName || event.groupName === block?.labelGroup) {
298
321
  setHidden(Boolean(event.label && block?.labels?.length && !block.labels.includes(event.label)));
299
322
  }
300
- }), [block]);
323
+ }), [block, router]);
301
324
  const isGroup = version && isTheme;
302
325
  return (jsx(Tag, { className: style('@container font-sans', isGroup ? 'group' : '', blockStyles[version], isHidden ? 'hidden' : '', padding || defaultPadding, className), ...(isGroup ? { 'data-ver': version } : {}), ...(block?.anchor ? { id: block.anchor } : {}), role: role, style: inlineStyles, children: children }));
303
326
  });
@@ -413,28 +436,6 @@
413
436
  : null;
414
437
  }
415
438
 
416
- function useRouter() {
417
- return useRouter._impl();
418
- }
419
- useRouter._impl = () => ({
420
- isReady: false,
421
- href: globalThis.location?.href || '/',
422
- pathname: globalThis.location?.pathname || '/',
423
- query: {},
424
- push: () => {
425
- // Do nothing
426
- },
427
- replace: () => {
428
- // Do nothing
429
- },
430
- back: () => {
431
- // Do nothing
432
- },
433
- });
434
- useRouter.setup = (impl) => {
435
- useRouter._impl = impl;
436
- };
437
-
438
439
  const dirname = (path) => path?.split('/').slice(0, -1).join('/');
439
440
 
440
441
  const isUUID = (src) => {
@@ -5673,12 +5674,11 @@
5673
5674
  }
5674
5675
  const [headerColumn, ...columns] = rowData;
5675
5676
  const columnsStyle = style('flex duration-1000 text-center', rowIdx !== 0 ? 'font-normal' : 'font-light');
5676
- return (jsxs("div", { className: "flex border-main-divider border-b border-solid h-full", children: [headerColumn?.data ? (jsx("div", { className: "w-56 min-w-56 py-lg", children: jsx(Text, { size: "text-xl", font: "font-light", children: headerColumn.data }) })) : null, jsx("div", { className: "flex flex-grow overflow-hidden", children: jsx("div", { className: columnsStyle, style: {
5677
+ return (jsxs("div", { className: "flex border-main-divider border-b border-solid h-full", children: [headerColumn?.data ? (jsx("div", { className: "whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0", children: jsx(Text, { size: "text-xl", font: "font-light", children: headerColumn.data }) })) : null, jsx("div", { className: "flex flex-grow overflow-hidden", children: jsx("div", { className: columnsStyle, style: {
5677
5678
  transform: `translateX(-${getHorizontalShift(columns, activeColumnIndex)}px)`,
5678
- }, children: columns?.map((_, i) => (jsxs("div", { className: "flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider", children: [_?.data ? (jsx(Text, { size: "text-xl", font: "font-light", children: _.data })) : null, _?.cols ? renderCols(_.cols, activeColumnIndex) : null] }, `row${i}`))) }) })] }, String(rowIdx)));
5679
+ }, children: columns?.map((_, i) => (jsxs("div", { className: "flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider", children: [_?.data ? jsx(Text, { size: "text-xl", children: _.data }) : null, _?.cols ? renderCols(_.cols, activeColumnIndex) : null] }, `row${i}`))) }) })] }, String(rowIdx)));
5679
5680
  };
5680
- const ColsColor = (isEqual = false) => `${isEqual ? 'text-secondary-text' : ''}`;
5681
- const renderCols = (cols, rowIndex) => cols?.length > 0 ? (jsx("div", { className: "flex", children: cols.map((data, i) => (jsx("div", { className: "w-20 mx-lg", children: jsx(Text, { size: "text-h6", color: ColsColor(rowIndex === 0), children: data }) }, String(i)))) })) : null;
5681
+ const renderCols = (cols, rowIndex) => cols?.length > 0 ? (jsx("div", { className: style('flex', rowIndex === 0 ? 'text-secondary-text' : ''), children: cols.map((data, i) => (jsx("div", { className: "w-20 mx-lg", children: jsx(Text, { size: "text-h6", font: "font-light", children: data }) }, String(i)))) })) : null;
5682
5682
 
5683
5683
  const InnerTableBodyItem = JSX(({ rows }) => {
5684
5684
  const rowsLength = rows?.[0]?.length ?? 0;
@@ -5697,7 +5697,7 @@
5697
5697
  const InnerTableBody = JSX(({ activeTabIndex, items }) => {
5698
5698
  return (jsx("div", { children: items.map((_, tableIdx) => {
5699
5699
  const key = `activeTabIdx:${activeTabIndex}-tableIdx:${tableIdx}`;
5700
- return (jsxs("div", { className: "w-full @container", children: [jsx("div", { className: "flex p-m bg-white @4xl:bg-gray text-center justify-center relative", children: jsx(Text, { size: "text-xl", font: "font-light", children: _.title }) }), jsx("div", { className: "w-full pl-xs overflow-hidden transition-height duration-500 ease-in-out", children: jsx("div", { className: "relative", children: jsx(InnerTableBodyItem, { rows: _.rowsData }) }) })] }, key));
5700
+ return (jsxs("div", { className: "w-full @container", children: [jsx("div", { className: "flex py-m sm:px-m bg-white @4xl:bg-gray relative", children: jsx(Text, { size: "text-xl", align: "text-left", children: _.title }) }), jsx("div", { className: "w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out", children: jsx("div", { className: "relative", children: jsx(InnerTableBodyItem, { rows: _.rowsData }) }) })] }, key));
5701
5701
  }) }));
5702
5702
  });
5703
5703
 
@@ -6033,7 +6033,7 @@
6033
6033
  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" }) }));
6034
6034
  }
6035
6035
 
6036
- const packageVersion = "0.14.140";
6036
+ const packageVersion = "0.14.142";
6037
6037
 
6038
6038
  exports.Blocks = Blocks;
6039
6039
  exports.ContentPage = ContentPage;