@mjhls/mjh-framework 1.0.397 → 1.0.399

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/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # mjh-framework v. 1.0.397
2
+ # mjh-framework v. 1.0.399
3
3
 
4
4
 
5
5
  > Foundation Framework
@@ -33,9 +33,15 @@ var FigureComponent = function FigureComponent(props) {
33
33
  openImgSrc = _useState4[0],
34
34
  setOpenImgSrc = _useState4[1];
35
35
 
36
+ if (typeof window === 'undefined') return null;
37
+
36
38
  var node = props.node,
37
39
  client = props.client,
38
40
  contextualADFlag = props.contextualADFlag;
41
+
42
+
43
+ if (!node.asset) return null;
44
+
39
45
  var caption = node.caption,
40
46
  alt = node.alt,
41
47
  blank = node.blank,
@@ -43,28 +49,23 @@ var FigureComponent = function FigureComponent(props) {
43
49
  _node$alignment = node.alignment,
44
50
  alignment = _node$alignment === undefined ? 'center' : _node$alignment,
45
51
  _node$class_name = node.class_name,
46
- class_name = _node$class_name === undefined ? 'd-block' : _node$class_name;
52
+ class_name = _node$class_name === undefined ? 'd-block' : _node$class_name,
53
+ _node$disableTextWrap = node.disableTextWrap,
54
+ disableTextWrap = _node$disableTextWrap === undefined ? false : _node$disableTextWrap;
47
55
  var _node$widthP = node.widthP,
48
56
  widthP = _node$widthP === undefined ? 'auto' : _node$widthP;
49
57
 
50
58
 
51
- if (typeof window === 'undefined') {
52
- return null;
53
- }
54
-
55
59
  var screenWidth = window.innerWidth;
56
60
 
57
61
  if (client.clientConfig && client.clientConfig.defaultImageSize && widthP === 'auto') {
58
62
  widthP = client.clientConfig.defaultImageSize;
59
63
  }
60
64
 
61
- var imageFloat = null;
65
+ var imageFloat = 'none';
62
66
  if (screenWidth > 1000) {
63
67
  var align = ['center', 'top'].includes(alignment.toLowerCase()) ? 'none' : alignment.toLowerCase();
64
68
  imageFloat = align;
65
- } else {
66
- var _align = ['center', 'top'].includes(alignment.toLowerCase()) ? 'none' : alignment.toLowerCase();
67
- imageFloat = _align;
68
69
  }
69
70
 
70
71
  var figureMargin = null;
@@ -93,24 +94,30 @@ var FigureComponent = function FigureComponent(props) {
93
94
  imageWidth = '100%';
94
95
  }
95
96
 
96
- if (!node.asset) return null;
97
+ var figureStyle = disableTextWrap ? { maxWidth: '100%' } : {
98
+ width: imageWidth,
99
+ maxWidth: '100%',
100
+ clear: 'both',
101
+ float: imageFloat,
102
+ margin: figureMargin
103
+ };
97
104
 
98
105
  return React__default.createElement(
99
106
  React__default.Fragment,
100
107
  null,
101
- imageWidth !== null && imageFloat !== null && React__default.createElement(
108
+ React__default.createElement(
102
109
  reactBootstrap.Figure,
103
- { className: '' + class_name, style: { width: imageWidth, maxWidth: '100%', clear: 'both', float: imageFloat, margin: figureMargin } },
110
+ { className: '' + class_name, style: figureStyle },
104
111
  link ? React__default.createElement(
105
112
  'a',
106
113
  { target: blank ? '_blank' : '_self', href: link },
107
- React__default.createElement(reactBootstrap.Figure.Image, { style: { width: '100%' }, className: 'figure-image', src: urlFor(node, client).url(), alt: alt && alt }),
114
+ React__default.createElement(reactBootstrap.Figure.Image, { style: { maxWidth: '100%' }, className: 'figure-image', src: urlFor(node, client).url(), alt: alt && alt }),
108
115
  caption && React__default.createElement('div', { dangerouslySetInnerHTML: { __html: '<span class=\'figure-caption\'>' + caption + '</span>' } })
109
116
  ) : React__default.createElement(
110
117
  React__default.Fragment,
111
118
  null,
112
119
  React__default.createElement(reactBootstrap.Figure.Image, {
113
- style: { width: '100%' },
120
+ style: { maxWidth: '100%', cursor: 'pointer' },
114
121
  className: 'figure-image',
115
122
  src: urlFor(node, client).url(),
116
123
  alt: alt && alt,
package/dist/cjs/index.js CHANGED
@@ -6425,7 +6425,9 @@ var Media = function Media(_ref) {
6425
6425
  alt = node.alt,
6426
6426
  className = node.class,
6427
6427
  _node$widthP = node.widthP,
6428
- widthP = _node$widthP === undefined ? 'auto' : _node$widthP;
6428
+ widthP = _node$widthP === undefined ? 'auto' : _node$widthP,
6429
+ _node$disableTextWrap = node.disableTextWrap,
6430
+ disableTextWrap = _node$disableTextWrap === undefined ? false : _node$disableTextWrap;
6429
6431
 
6430
6432
  var builder = index.imageUrlBuilder(client);
6431
6433
 
@@ -6447,49 +6449,58 @@ var Media = function Media(_ref) {
6447
6449
  }
6448
6450
  }, []);
6449
6451
 
6450
- var screenWidth = window.innerWidth;
6451
- var imageFloat = 'none';
6452
- if (screenWidth > 1000) {
6453
- var align = ['center', 'top'].includes(alignment.toLowerCase()) ? 'none' : alignment.toLowerCase();
6454
- imageFloat = align;
6455
- }
6452
+ if (!uploadDoc || !uploadDoc.asset) return null;
6456
6453
 
6457
- var imageMargin = null;
6458
- if (imageFloat === 'none') {
6459
- imageMargin = '0 auto 1rem';
6460
- }
6461
- if (imageFloat === 'left') {
6462
- imageMargin = '0 1.5rem 1.5rem 0';
6463
- }
6464
- if (imageFloat === 'right') {
6465
- imageMargin = '0 0 1.5rem 1.5rem';
6466
- }
6454
+ if (poster && poster.asset) {
6455
+ var screenWidth = window.innerWidth;
6467
6456
 
6468
- var imageWidth = null;
6469
- if (screenWidth > 1000) {
6470
- if (widthP === 'auto') {
6471
- if (imageFloat === 'none') {
6472
- imageWidth = 'auto';
6457
+ var imageFloat = 'none';
6458
+ if (screenWidth > 1000) {
6459
+ var align = ['center', 'top'].includes(alignment.toLowerCase()) ? 'none' : alignment.toLowerCase();
6460
+ imageFloat = align;
6461
+ }
6462
+
6463
+ var imageMargin = null;
6464
+ if (imageFloat === 'none') {
6465
+ imageMargin = '0 auto 1rem';
6466
+ }
6467
+ if (imageFloat === 'left') {
6468
+ imageMargin = '0 1.5rem 1.5rem 0';
6469
+ }
6470
+ if (imageFloat === 'right') {
6471
+ imageMargin = '0 0 1.5rem 1.5rem';
6472
+ }
6473
+
6474
+ var imageWidth = null;
6475
+ if (screenWidth > 1000) {
6476
+ if (widthP === 'auto') {
6477
+ if (imageFloat === 'none') {
6478
+ imageWidth = 'auto';
6479
+ } else {
6480
+ imageWidth = '30%';
6481
+ }
6473
6482
  } else {
6474
- imageWidth = '30%';
6483
+ imageWidth = widthP + '%';
6475
6484
  }
6476
6485
  } else {
6477
- imageWidth = widthP + '%';
6486
+ imageWidth = '100%';
6478
6487
  }
6479
- } else {
6480
- imageWidth = '100%';
6481
- }
6482
6488
 
6483
- if (!uploadDoc || !uploadDoc.asset) return null;
6489
+ var figureStyle = disableTextWrap ? { maxWidth: '100%' } : {
6490
+ width: imageWidth,
6491
+ maxWidth: '100%',
6492
+ clear: 'both',
6493
+ float: imageFloat,
6494
+ margin: imageMargin
6495
+ };
6484
6496
 
6485
- if (poster && poster.asset && imageFloat && imageMargin && imageWidth) {
6486
6497
  return React__default.createElement(
6487
6498
  reactBootstrap.Figure,
6488
- { className: 'd-block ' + className, style: { width: imageWidth, maxWidth: '100%', clear: 'both', float: imageFloat, margin: imageMargin } },
6499
+ { className: 'd-block ' + className, style: figureStyle },
6489
6500
  React__default.createElement(
6490
6501
  'a',
6491
6502
  { href: uploadDoc.asset.url, target: blank ? '_blank' : '_self' },
6492
- React__default.createElement(reactBootstrap.Figure.Image, _extends$2._extends({ className: 'media-image', style: { width: '100%' }, src: urlFor(poster).url() }, alt && { alt: alt })),
6503
+ React__default.createElement(reactBootstrap.Figure.Image, _extends$2._extends({ className: 'media-image', style: { maxWidth: '100%' }, src: urlFor(poster).url() }, alt && { alt: alt })),
6493
6504
  caption && React__default.createElement(
6494
6505
  reactBootstrap.Figure.Caption,
6495
6506
  { className: 'media-caption' },
@@ -14283,7 +14294,7 @@ var MultiFigure = function MultiFigure(props) {
14283
14294
  };
14284
14295
 
14285
14296
  var Figure = dynamic(function () {
14286
- return Promise.resolve().then(function () { return require('./Figure-c49ee0f8.js'); });
14297
+ return Promise.resolve().then(function () { return require('./Figure-17002404.js'); });
14287
14298
  }, { ssr: false });
14288
14299
 
14289
14300
  var checkUrlIsExternal = function checkUrlIsExternal(url) {
@@ -22288,7 +22299,9 @@ var getDocumentGroupUrl = function getDocumentGroupUrl(docGroup) {
22288
22299
  }
22289
22300
  var url = void 0;
22290
22301
  if (docGroup.path.includes('/')) {
22291
- return docGroup.path;
22302
+ console.log(docGroup);
22303
+ console.log(docGroup.path);
22304
+ return "/" + docGroup.path;
22292
22305
  }
22293
22306
 
22294
22307
  if (docGroup.parent) {
@@ -28,9 +28,15 @@ var FigureComponent = function FigureComponent(props) {
28
28
  openImgSrc = _useState4[0],
29
29
  setOpenImgSrc = _useState4[1];
30
30
 
31
+ if (typeof window === 'undefined') return null;
32
+
31
33
  var node = props.node,
32
34
  client = props.client,
33
35
  contextualADFlag = props.contextualADFlag;
36
+
37
+
38
+ if (!node.asset) return null;
39
+
34
40
  var caption = node.caption,
35
41
  alt = node.alt,
36
42
  blank = node.blank,
@@ -38,28 +44,23 @@ var FigureComponent = function FigureComponent(props) {
38
44
  _node$alignment = node.alignment,
39
45
  alignment = _node$alignment === undefined ? 'center' : _node$alignment,
40
46
  _node$class_name = node.class_name,
41
- class_name = _node$class_name === undefined ? 'd-block' : _node$class_name;
47
+ class_name = _node$class_name === undefined ? 'd-block' : _node$class_name,
48
+ _node$disableTextWrap = node.disableTextWrap,
49
+ disableTextWrap = _node$disableTextWrap === undefined ? false : _node$disableTextWrap;
42
50
  var _node$widthP = node.widthP,
43
51
  widthP = _node$widthP === undefined ? 'auto' : _node$widthP;
44
52
 
45
53
 
46
- if (typeof window === 'undefined') {
47
- return null;
48
- }
49
-
50
54
  var screenWidth = window.innerWidth;
51
55
 
52
56
  if (client.clientConfig && client.clientConfig.defaultImageSize && widthP === 'auto') {
53
57
  widthP = client.clientConfig.defaultImageSize;
54
58
  }
55
59
 
56
- var imageFloat = null;
60
+ var imageFloat = 'none';
57
61
  if (screenWidth > 1000) {
58
62
  var align = ['center', 'top'].includes(alignment.toLowerCase()) ? 'none' : alignment.toLowerCase();
59
63
  imageFloat = align;
60
- } else {
61
- var _align = ['center', 'top'].includes(alignment.toLowerCase()) ? 'none' : alignment.toLowerCase();
62
- imageFloat = _align;
63
64
  }
64
65
 
65
66
  var figureMargin = null;
@@ -88,24 +89,30 @@ var FigureComponent = function FigureComponent(props) {
88
89
  imageWidth = '100%';
89
90
  }
90
91
 
91
- if (!node.asset) return null;
92
+ var figureStyle = disableTextWrap ? { maxWidth: '100%' } : {
93
+ width: imageWidth,
94
+ maxWidth: '100%',
95
+ clear: 'both',
96
+ float: imageFloat,
97
+ margin: figureMargin
98
+ };
92
99
 
93
100
  return React__default.createElement(
94
101
  React__default.Fragment,
95
102
  null,
96
- imageWidth !== null && imageFloat !== null && React__default.createElement(
103
+ React__default.createElement(
97
104
  Figure$1,
98
- { className: '' + class_name, style: { width: imageWidth, maxWidth: '100%', clear: 'both', float: imageFloat, margin: figureMargin } },
105
+ { className: '' + class_name, style: figureStyle },
99
106
  link ? React__default.createElement(
100
107
  'a',
101
108
  { target: blank ? '_blank' : '_self', href: link },
102
- React__default.createElement(Figure$1.Image, { style: { width: '100%' }, className: 'figure-image', src: urlFor(node, client).url(), alt: alt && alt }),
109
+ React__default.createElement(Figure$1.Image, { style: { maxWidth: '100%' }, className: 'figure-image', src: urlFor(node, client).url(), alt: alt && alt }),
103
110
  caption && React__default.createElement('div', { dangerouslySetInnerHTML: { __html: '<span class=\'figure-caption\'>' + caption + '</span>' } })
104
111
  ) : React__default.createElement(
105
112
  React__default.Fragment,
106
113
  null,
107
114
  React__default.createElement(Figure$1.Image, {
108
- style: { width: '100%' },
115
+ style: { maxWidth: '100%', cursor: 'pointer' },
109
116
  className: 'figure-image',
110
117
  src: urlFor(node, client).url(),
111
118
  alt: alt && alt,
package/dist/esm/index.js CHANGED
@@ -6422,7 +6422,9 @@ var Media = function Media(_ref) {
6422
6422
  alt = node.alt,
6423
6423
  className = node.class,
6424
6424
  _node$widthP = node.widthP,
6425
- widthP = _node$widthP === undefined ? 'auto' : _node$widthP;
6425
+ widthP = _node$widthP === undefined ? 'auto' : _node$widthP,
6426
+ _node$disableTextWrap = node.disableTextWrap,
6427
+ disableTextWrap = _node$disableTextWrap === undefined ? false : _node$disableTextWrap;
6426
6428
 
6427
6429
  var builder = imageUrlBuilder(client);
6428
6430
 
@@ -6444,49 +6446,58 @@ var Media = function Media(_ref) {
6444
6446
  }
6445
6447
  }, []);
6446
6448
 
6447
- var screenWidth = window.innerWidth;
6448
- var imageFloat = 'none';
6449
- if (screenWidth > 1000) {
6450
- var align = ['center', 'top'].includes(alignment.toLowerCase()) ? 'none' : alignment.toLowerCase();
6451
- imageFloat = align;
6452
- }
6449
+ if (!uploadDoc || !uploadDoc.asset) return null;
6453
6450
 
6454
- var imageMargin = null;
6455
- if (imageFloat === 'none') {
6456
- imageMargin = '0 auto 1rem';
6457
- }
6458
- if (imageFloat === 'left') {
6459
- imageMargin = '0 1.5rem 1.5rem 0';
6460
- }
6461
- if (imageFloat === 'right') {
6462
- imageMargin = '0 0 1.5rem 1.5rem';
6463
- }
6451
+ if (poster && poster.asset) {
6452
+ var screenWidth = window.innerWidth;
6464
6453
 
6465
- var imageWidth = null;
6466
- if (screenWidth > 1000) {
6467
- if (widthP === 'auto') {
6468
- if (imageFloat === 'none') {
6469
- imageWidth = 'auto';
6454
+ var imageFloat = 'none';
6455
+ if (screenWidth > 1000) {
6456
+ var align = ['center', 'top'].includes(alignment.toLowerCase()) ? 'none' : alignment.toLowerCase();
6457
+ imageFloat = align;
6458
+ }
6459
+
6460
+ var imageMargin = null;
6461
+ if (imageFloat === 'none') {
6462
+ imageMargin = '0 auto 1rem';
6463
+ }
6464
+ if (imageFloat === 'left') {
6465
+ imageMargin = '0 1.5rem 1.5rem 0';
6466
+ }
6467
+ if (imageFloat === 'right') {
6468
+ imageMargin = '0 0 1.5rem 1.5rem';
6469
+ }
6470
+
6471
+ var imageWidth = null;
6472
+ if (screenWidth > 1000) {
6473
+ if (widthP === 'auto') {
6474
+ if (imageFloat === 'none') {
6475
+ imageWidth = 'auto';
6476
+ } else {
6477
+ imageWidth = '30%';
6478
+ }
6470
6479
  } else {
6471
- imageWidth = '30%';
6480
+ imageWidth = widthP + '%';
6472
6481
  }
6473
6482
  } else {
6474
- imageWidth = widthP + '%';
6483
+ imageWidth = '100%';
6475
6484
  }
6476
- } else {
6477
- imageWidth = '100%';
6478
- }
6479
6485
 
6480
- if (!uploadDoc || !uploadDoc.asset) return null;
6486
+ var figureStyle = disableTextWrap ? { maxWidth: '100%' } : {
6487
+ width: imageWidth,
6488
+ maxWidth: '100%',
6489
+ clear: 'both',
6490
+ float: imageFloat,
6491
+ margin: imageMargin
6492
+ };
6481
6493
 
6482
- if (poster && poster.asset && imageFloat && imageMargin && imageWidth) {
6483
6494
  return React__default.createElement(
6484
6495
  Figure$1,
6485
- { className: 'd-block ' + className, style: { width: imageWidth, maxWidth: '100%', clear: 'both', float: imageFloat, margin: imageMargin } },
6496
+ { className: 'd-block ' + className, style: figureStyle },
6486
6497
  React__default.createElement(
6487
6498
  'a',
6488
6499
  { href: uploadDoc.asset.url, target: blank ? '_blank' : '_self' },
6489
- React__default.createElement(Figure$1.Image, _extends$2({ className: 'media-image', style: { width: '100%' }, src: urlFor(poster).url() }, alt && { alt: alt })),
6500
+ React__default.createElement(Figure$1.Image, _extends$2({ className: 'media-image', style: { maxWidth: '100%' }, src: urlFor(poster).url() }, alt && { alt: alt })),
6490
6501
  caption && React__default.createElement(
6491
6502
  Figure$1.Caption,
6492
6503
  { className: 'media-caption' },
@@ -14280,7 +14291,7 @@ var MultiFigure = function MultiFigure(props) {
14280
14291
  };
14281
14292
 
14282
14293
  var Figure = dynamic(function () {
14283
- return import('./Figure-7ba30e53.js');
14294
+ return import('./Figure-bce2ae9c.js');
14284
14295
  }, { ssr: false });
14285
14296
 
14286
14297
  var checkUrlIsExternal = function checkUrlIsExternal(url) {
@@ -22285,7 +22296,9 @@ var getDocumentGroupUrl = function getDocumentGroupUrl(docGroup) {
22285
22296
  }
22286
22297
  var url = void 0;
22287
22298
  if (docGroup.path.includes('/')) {
22288
- return docGroup.path;
22299
+ console.log(docGroup);
22300
+ console.log(docGroup.path);
22301
+ return "/" + docGroup.path;
22289
22302
  }
22290
22303
 
22291
22304
  if (docGroup.parent) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.397",
3
+ "version": "1.0.399",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",