@micromag/screen-urbania-article 0.3.465 → 0.3.467

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/es/index.js CHANGED
@@ -892,7 +892,8 @@ var UrbaniaArticleCard = function UrbaniaArticleCard(_ref) {
892
892
  isStatic = _useScreenRenderConte.isStatic,
893
893
  isCapture = _useScreenRenderConte.isCapture;
894
894
  var _useViewerContext = useViewerContext(),
895
- viewerTopHeight = _useViewerContext.topHeight;
895
+ viewerTopHeight = _useViewerContext.topHeight,
896
+ viewerBottomHeight = _useViewerContext.bottomHeight;
896
897
  var _useViewerInteraction = useViewerInteraction(),
897
898
  enableInteraction = _useViewerInteraction.enableInteraction,
898
899
  disableInteraction = _useViewerInteraction.disableInteraction;
@@ -1018,11 +1019,12 @@ var UrbaniaArticleCard = function UrbaniaArticleCard(_ref) {
1018
1019
  var _ref6 = articlePreviewContentRect || {},
1019
1020
  _ref6$height = _ref6.height,
1020
1021
  articlePreviewHeight = _ref6$height === void 0 ? 0 : _ref6$height;
1022
+ var minimumVisibility = 20;
1021
1023
  var y = 100;
1022
1024
  if (current && articleOpened) {
1023
1025
  y = 0;
1024
1026
  } else if (current || isPreview) {
1025
- y = 100 - Math.max(articlePreviewHeight / height * 100, 25);
1027
+ y = 100 - Math.max(articlePreviewHeight / height * 100, minimumVisibility);
1026
1028
  }
1027
1029
  var springStyle = useSpring({
1028
1030
  from: {
@@ -1120,7 +1122,7 @@ var UrbaniaArticleCard = function UrbaniaArticleCard(_ref) {
1120
1122
  width: width,
1121
1123
  transform: !isPreview ? springStyle.y.to(function (value) {
1122
1124
  return "translateY(".concat(value, "%");
1123
- }) : 'translateY(75%)'
1125
+ }) : "translateY(".concat(100 - minimumVisibility, "%)")
1124
1126
  }
1125
1127
  }, /*#__PURE__*/React.createElement("button", Object.assign({
1126
1128
  type: "button",
@@ -1146,7 +1148,10 @@ var UrbaniaArticleCard = function UrbaniaArticleCard(_ref) {
1146
1148
  className: styles.articlePreview,
1147
1149
  ref: articlePreviewRef
1148
1150
  }, /*#__PURE__*/React.createElement("div", {
1149
- className: styles.articlePreviewInner
1151
+ className: styles.articlePreviewInner,
1152
+ style: {
1153
+ paddingBottom: current && !isPreview ? Math.max(viewerBottomHeight, 20) : null
1154
+ }
1150
1155
  }, hasTitle ? /*#__PURE__*/React.createElement(Heading, Object.assign({
1151
1156
  className: classNames([styles.articleTitle])
1152
1157
  }, title)) : null, hasAuthorName ? /*#__PURE__*/React.createElement(UrbaniaAuthor, {
package/lib/index.js CHANGED
@@ -896,7 +896,8 @@ var UrbaniaArticleCard = function UrbaniaArticleCard(_ref) {
896
896
  isStatic = _useScreenRenderConte.isStatic,
897
897
  isCapture = _useScreenRenderConte.isCapture;
898
898
  var _useViewerContext = contexts.useViewerContext(),
899
- viewerTopHeight = _useViewerContext.topHeight;
899
+ viewerTopHeight = _useViewerContext.topHeight,
900
+ viewerBottomHeight = _useViewerContext.bottomHeight;
900
901
  var _useViewerInteraction = contexts.useViewerInteraction(),
901
902
  enableInteraction = _useViewerInteraction.enableInteraction,
902
903
  disableInteraction = _useViewerInteraction.disableInteraction;
@@ -1022,11 +1023,12 @@ var UrbaniaArticleCard = function UrbaniaArticleCard(_ref) {
1022
1023
  var _ref6 = articlePreviewContentRect || {},
1023
1024
  _ref6$height = _ref6.height,
1024
1025
  articlePreviewHeight = _ref6$height === void 0 ? 0 : _ref6$height;
1026
+ var minimumVisibility = 20;
1025
1027
  var y = 100;
1026
1028
  if (current && articleOpened) {
1027
1029
  y = 0;
1028
1030
  } else if (current || isPreview) {
1029
- y = 100 - Math.max(articlePreviewHeight / height * 100, 25);
1031
+ y = 100 - Math.max(articlePreviewHeight / height * 100, minimumVisibility);
1030
1032
  }
1031
1033
  var springStyle = web.useSpring({
1032
1034
  from: {
@@ -1124,7 +1126,7 @@ var UrbaniaArticleCard = function UrbaniaArticleCard(_ref) {
1124
1126
  width: width,
1125
1127
  transform: !isPreview ? springStyle.y.to(function (value) {
1126
1128
  return "translateY(".concat(value, "%");
1127
- }) : 'translateY(75%)'
1129
+ }) : "translateY(".concat(100 - minimumVisibility, "%)")
1128
1130
  }
1129
1131
  }, /*#__PURE__*/React.createElement("button", Object.assign({
1130
1132
  type: "button",
@@ -1150,7 +1152,10 @@ var UrbaniaArticleCard = function UrbaniaArticleCard(_ref) {
1150
1152
  className: styles.articlePreview,
1151
1153
  ref: articlePreviewRef
1152
1154
  }, /*#__PURE__*/React.createElement("div", {
1153
- className: styles.articlePreviewInner
1155
+ className: styles.articlePreviewInner,
1156
+ style: {
1157
+ paddingBottom: current && !isPreview ? Math.max(viewerBottomHeight, 20) : null
1158
+ }
1154
1159
  }, hasTitle ? /*#__PURE__*/React.createElement(Heading, Object.assign({
1155
1160
  className: classNames([styles.articleTitle])
1156
1161
  }, title)) : null, hasAuthorName ? /*#__PURE__*/React.createElement(UrbaniaAuthor, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-urbania-article",
3
- "version": "0.3.465",
3
+ "version": "0.3.467",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -88,5 +88,5 @@
88
88
  "access": "public",
89
89
  "registry": "https://registry.npmjs.org/"
90
90
  },
91
- "gitHead": "5595546150eb35a0d670e00d4259fd9a43256ed6"
91
+ "gitHead": "cfe70d73184fdc05a0ab4320afc1610f2009de08"
92
92
  }