@ntbjs/react-components 2.0.3-rc.2 → 2.0.6

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.
@@ -9,16 +9,18 @@ const ActionButton = React__default.forwardRef(function ActionButton({
9
9
  active,
10
10
  onClick,
11
11
  actionWidthHeight,
12
+ useShadow,
12
13
  backgroundColors,
13
14
  ...props
14
15
  }, forwardedRef) {
15
16
  return React__default.createElement(ActionButton$1, _extends({
16
17
  ref: forwardedRef,
17
18
  disabled: disabled,
18
- active: active,
19
+ $active: active,
19
20
  onClick: onClick,
20
- actionWidthHeight: actionWidthHeight,
21
- backgroundColors: backgroundColors
21
+ $actionWidthHeight: actionWidthHeight,
22
+ $backgroundColors: backgroundColors,
23
+ $useShadow: useShadow
22
24
  }, props), icon);
23
25
  });
24
26
  ActionButton.propTypes = process.env.NODE_ENV !== "production" ? {
@@ -27,11 +29,13 @@ ActionButton.propTypes = process.env.NODE_ENV !== "production" ? {
27
29
  active: PropTypes.bool,
28
30
  onClick: PropTypes.func,
29
31
  backgroundColors: PropTypes.arrayOf(PropTypes.string),
30
- actionWidthHeight: PropTypes.array
32
+ actionWidthHeight: PropTypes.array,
33
+ useShadow: PropTypes.bool
31
34
  } : {};
32
35
  ActionButton.defaultProps = {
33
36
  onClick: () => {},
34
- actionWidthHeight: [40, 40]
37
+ actionWidthHeight: [40, 40],
38
+ useShadow: false
35
39
  };
36
40
 
37
41
  export { ActionButton as default };
@@ -1 +1 @@
1
- {"version":3,"file":"ActionButton.js","sources":["../../../src/components/inputs/ActionButton/ActionButton.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport * as S from './ActionButton.styled';\n\n/**\n * An action button.\n *\n * ### Import\n *\n * ``` js\n * import { ActionButton } from '@ntbjs/react-components/inputs'\n * // or\n * import ActionButton from '@ntbjs/react-components/inputs/ActionButton'\n * ```\n *\n * ### Props\n * ```\n * Pass `icon={<svg></svg>}` to display an icon.\n * Pass `disabled={true}` to disable the button.\n * Pass `active={true}` to lock the hover state of the button.\n * Pass `onClick={() => {}}` to add an on-click effect.\n * Pass `backgroundColors={[#ffffff, #000000]}` to set the background color of the button\n * ```\n */\nconst ActionButton = React.forwardRef(function ActionButton(\n { icon, disabled, active, onClick, actionWidthHeight, backgroundColors, ...props },\n forwardedRef\n) {\n return (\n <S.ActionButton\n ref={forwardedRef}\n disabled={disabled}\n active={active}\n onClick={onClick}\n actionWidthHeight={actionWidthHeight}\n backgroundColors={backgroundColors}\n {...props}\n >\n {icon}\n </S.ActionButton>\n );\n});\n\nActionButton.propTypes = {\n /**\n * Icon element – e.g: `icon={<SvgAddCircle />}`\n */\n icon: PropTypes.element.isRequired,\n /**\n * Disable the action button\n */\n disabled: PropTypes.bool,\n /**\n * Locks the hover state of the `ActionButton` – this prop only affects the visual appearance of the\n * `ActionButton`\n */\n active: PropTypes.bool,\n /**\n * On-click effect for the action button\n */\n onClick: PropTypes.func,\n /**\n * Color of the button background as an array of [darkThemeColor, lightThemeColor]\n */\n backgroundColors: PropTypes.arrayOf(PropTypes.string),\n /**\n * Width and Height of the Action Button [50, 50]\n */\n actionWidthHeight: PropTypes.array\n};\n\nActionButton.defaultProps = {\n onClick: () => {},\n actionWidthHeight: [40, 40]\n};\n\nexport default ActionButton;\n"],"names":["ActionButton","React","forwardRef","icon","disabled","active","onClick","actionWidthHeight","backgroundColors","props","forwardedRef","createElement","S","_extends","ref","propTypes","process","env","NODE_ENV","PropTypes","element","isRequired","bool","func","arrayOf","string","array","defaultProps"],"mappings":";;;;;AAwBMA,MAAAA,YAAY,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,YAAYA,CACzD;EAAEG,IAAI;EAAEC,QAAQ;EAAEC,MAAM;EAAEC,OAAO;EAAEC,iBAAiB;EAAEC,gBAAgB;EAAE,GAAGC,KAAAA;AAAM,CAAC,EAClFC,YAAY,EACZ;EACA,OACET,cAAA,CAAAU,aAAA,CAACC,cAAc,EAAAC,QAAA,CAAA;AACbC,IAAAA,GAAG,EAAEJ,YAAa;AAClBN,IAAAA,QAAQ,EAAEA,QAAS;AACnBC,IAAAA,MAAM,EAAEA,MAAO;AACfC,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,iBAAiB,EAAEA,iBAAkB;AACrCC,IAAAA,gBAAgB,EAAEA,gBAAAA;GACdC,EAAAA,KAAK,CAERN,EAAAA,IACa,CAAC,CAAA;AAErB,CAAC,EAAC;AAEFH,YAAY,CAACe,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,KAAG,YAAA,GAAA;AAIvBf,EAAAA,IAAI,EAAEgB,SAAS,CAACC,OAAO,CAACC,UAAU;EAIlCjB,QAAQ,EAAEe,SAAS,CAACG,IAAI;EAKxBjB,MAAM,EAAEc,SAAS,CAACG,IAAI;EAItBhB,OAAO,EAAEa,SAAS,CAACI,IAAI;EAIvBf,gBAAgB,EAAEW,SAAS,CAACK,OAAO,CAACL,SAAS,CAACM,MAAM,CAAC;EAIrDlB,iBAAiB,EAAEY,SAAS,CAACO,KAAAA;AAC/B,CAAC,GAAA,EAAA,CAAA;AAED1B,YAAY,CAAC2B,YAAY,GAAG;AAC1BrB,EAAAA,OAAO,EAAEA,MAAM,EAAE;AACjBC,EAAAA,iBAAiB,EAAE,CAAC,EAAE,EAAE,EAAE,CAAA;AAC5B,CAAC;;;;"}
1
+ {"version":3,"file":"ActionButton.js","sources":["../../../src/components/inputs/ActionButton/ActionButton.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport * as S from './ActionButton.styled';\n\n/**\n * An action button.\n *\n * ### Import\n *\n * ``` js\n * import { ActionButton } from '@ntbjs/react-components/inputs'\n * // or\n * import ActionButton from '@ntbjs/react-components/inputs/ActionButton'\n * ```\n *\n * ### Props\n * ```\n * Pass `icon={<svg></svg>}` to display an icon.\n * Pass `disabled={true}` to disable the button.\n * Pass `active={true}` to lock the hover state of the button.\n * Pass `onClick={() => {}}` to add an on-click effect.\n * Pass `backgroundColors={[#ffffff, #000000]}` to set the background color of the button\n * ```\n */\nconst ActionButton = React.forwardRef(function ActionButton(\n { icon, disabled, active, onClick, actionWidthHeight, useShadow, backgroundColors, ...props },\n forwardedRef\n) {\n return (\n <S.ActionButton\n ref={forwardedRef}\n disabled={disabled}\n $active={active}\n onClick={onClick}\n $actionWidthHeight={actionWidthHeight}\n $backgroundColors={backgroundColors}\n $useShadow={useShadow}\n {...props}\n >\n {icon}\n </S.ActionButton>\n );\n});\n\nActionButton.propTypes = {\n /**\n * Icon element – e.g: `icon={<SvgAddCircle />}`\n */\n icon: PropTypes.element.isRequired,\n /**\n * Disable the action button\n */\n disabled: PropTypes.bool,\n /**\n * Locks the hover state of the `ActionButton` – this prop only affects the visual appearance of the\n * `ActionButton`\n */\n active: PropTypes.bool,\n /**\n * On-click effect for the action button\n */\n onClick: PropTypes.func,\n /**\n * Color of the button background as an array of [darkThemeColor, lightThemeColor]\n */\n backgroundColors: PropTypes.arrayOf(PropTypes.string),\n /**\n * Width and Height of the Action Button [50, 50]\n */\n actionWidthHeight: PropTypes.array,\n /**\n *Use shadow for the action button\n */\n useShadow: PropTypes.bool\n};\n\nActionButton.defaultProps = {\n onClick: () => {},\n actionWidthHeight: [40, 40],\n useShadow: false\n};\n\nexport default ActionButton;\n"],"names":["ActionButton","React","forwardRef","icon","disabled","active","onClick","actionWidthHeight","useShadow","backgroundColors","props","forwardedRef","createElement","S","_extends","ref","$active","$actionWidthHeight","$backgroundColors","$useShadow","propTypes","process","env","NODE_ENV","PropTypes","element","isRequired","bool","func","arrayOf","string","array","defaultProps"],"mappings":";;;;;AAwBMA,MAAAA,YAAY,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,YAAYA,CACzD;EAAEG,IAAI;EAAEC,QAAQ;EAAEC,MAAM;EAAEC,OAAO;EAAEC,iBAAiB;EAAEC,SAAS;EAAEC,gBAAgB;EAAE,GAAGC,KAAAA;AAAM,CAAC,EAC7FC,YAAY,EACZ;EACA,OACEV,cAAA,CAAAW,aAAA,CAACC,cAAc,EAAAC,QAAA,CAAA;AACbC,IAAAA,GAAG,EAAEJ,YAAa;AAClBP,IAAAA,QAAQ,EAAEA,QAAS;AACnBY,IAAAA,OAAO,EAAEX,MAAO;AAChBC,IAAAA,OAAO,EAAEA,OAAQ;AACjBW,IAAAA,kBAAkB,EAAEV,iBAAkB;AACtCW,IAAAA,iBAAiB,EAAET,gBAAiB;AACpCU,IAAAA,UAAU,EAAEX,SAAAA;GACRE,EAAAA,KAAK,CAERP,EAAAA,IACa,CAAC,CAAA;AAErB,CAAC,EAAC;AAEFH,YAAY,CAACoB,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,KAAG,YAAA,GAAA;AAIvBpB,EAAAA,IAAI,EAAEqB,SAAS,CAACC,OAAO,CAACC,UAAU;EAIlCtB,QAAQ,EAAEoB,SAAS,CAACG,IAAI;EAKxBtB,MAAM,EAAEmB,SAAS,CAACG,IAAI;EAItBrB,OAAO,EAAEkB,SAAS,CAACI,IAAI;EAIvBnB,gBAAgB,EAAEe,SAAS,CAACK,OAAO,CAACL,SAAS,CAACM,MAAM,CAAC;EAIrDvB,iBAAiB,EAAEiB,SAAS,CAACO,KAAK;EAIlCvB,SAAS,EAAEgB,SAAS,CAACG,IAAAA;AACvB,CAAC,GAAA,EAAA,CAAA;AAED3B,YAAY,CAACgC,YAAY,GAAG;AAC1B1B,EAAAA,OAAO,EAAEA,MAAM,EAAE;AACjBC,EAAAA,iBAAiB,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;AAC3BC,EAAAA,SAAS,EAAE,KAAA;AACb,CAAC;;;;"}
@@ -2,13 +2,16 @@ import styled, { css } from 'styled-components';
2
2
  import { rgba } from 'polished';
3
3
  import { applyDefaultTheme } from '../../utils/defaultTheme.js';
4
4
 
5
- const ActionButton = styled.button.attrs(applyDefaultTheme)`
5
+ const shouldForwardProp = prop => prop !== 'theme' && !prop.startsWith('$');
6
+ const ActionButton = styled.button.withConfig({
7
+ shouldForwardProp
8
+ }).attrs(applyDefaultTheme)`
6
9
  display: inline-flex;
7
10
  justify-content: center;
8
11
  align-items: center;
9
12
  border-radius: 50%;
10
- width: ${props => `${props.actionWidthHeight[0]}px`};
11
- height: ${props => `${props.actionWidthHeight[1]}px`};
13
+ width: ${props => `${props.$actionWidthHeight[0]}px`};
14
+ height: ${props => `${props.$actionWidthHeight[1]}px`};
12
15
  border: 0;
13
16
  color: inherit;
14
17
  background-color: transparent;
@@ -20,30 +23,30 @@ const ActionButton = styled.button.attrs(applyDefaultTheme)`
20
23
  cursor: pointer;
21
24
 
22
25
  ${props => {
23
- const darkThemeBgColor = props?.backgroundColors?.[0] ?? props.theme.getColor('gray-600');
24
- const lightThemeBgColor = props?.backgroundColors?.[1] ?? props.theme.getColor('gray-200');
26
+ const darkThemeBgColor = props?.$backgroundColors?.[0] ?? props.theme.getColor('gray-600');
27
+ const lightThemeBgColor = props?.$backgroundColors?.[1] ?? props.theme.getColor('gray-200');
25
28
  return props.theme.themeProp('background-image', `radial-gradient(circle at center, ${darkThemeBgColor} 50%, transparent 51%)`, `radial-gradient(circle at center, ${lightThemeBgColor} 50%, transparent 51%)`);
26
29
  }}
27
30
 
28
31
  &:hover:not(:disabled) {
29
- background-size: ${props => Math.max(props.actionWidthHeight[0], props.actionWidthHeight[1]) * 2}px
30
- ${props => Math.max(props.actionWidthHeight[0], props.actionWidthHeight[1]) * 2}px;
32
+ background-size: ${props => Math.max(props.$actionWidthHeight[0], props.$actionWidthHeight[1]) * 2}px
33
+ ${props => Math.max(props.$actionWidthHeight[0], props.$actionWidthHeight[1]) * 2}px;
31
34
 
32
35
  svg {
33
36
  ${props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-700'))};
34
37
  }
35
38
  }
36
39
 
37
- ${props => props.active && css`
38
- background-size: ${Math.max(props.actionWidthHeight[0], props.actionWidthHeight[1]) * 2}px
39
- ${Math.max(props.actionWidthHeight[0], props.actionWidthHeight[1]) * 2}px;
40
+ ${props => props.$active && css`
41
+ background-size: ${Math.max(props.$actionWidthHeight[0], props.$actionWidthHeight[1]) * 2}px
42
+ ${Math.max(props.$actionWidthHeight[0], props.$actionWidthHeight[1]) * 2}px;
40
43
 
41
44
  svg {
42
45
  ${props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-700'))};
43
46
  }
44
47
  `}
45
48
 
46
- ${props => props.useShadow ? props.theme.themeProp('box-shadow', `0px 3px 6px ${rgba(props.theme.getColor('black'), 0.7)}`, `0px 3px 6px ${props.theme.getColor('black')}`) : null}
49
+ ${props => props.$useShadow ? props.theme.themeProp('box-shadow', `0px 3px 6px ${rgba(props.theme.getColor('black'), 0.7)}`, `0px 3px 6px ${props.theme.getColor('black')}`) : null}
47
50
 
48
51
  &:disabled {
49
52
  opacity: 0.5;
@@ -53,8 +56,8 @@ const ActionButton = styled.button.attrs(applyDefaultTheme)`
53
56
 
54
57
  svg {
55
58
  width: 100%;
56
- max-width: ${props => `${props.actionWidthHeight[0] - 15}px`};
57
- max-height: ${props => `${props.actionWidthHeight[1] - 15}px`};
59
+ max-width: ${props => `${props.$actionWidthHeight[0] - 15}px`};
60
+ max-height: ${props => `${props.$actionWidthHeight[1] - 15}px`};
58
61
  pointer-events: none;
59
62
  transition: color 250ms;
60
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ActionButton.styled.js","sources":["../../../src/components/inputs/ActionButton/ActionButton.styled.js"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { rgba } from 'polished';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nexport const ActionButton = styled.button.attrs(applyDefaultTheme)`\n display: inline-flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n width: ${props => `${props.actionWidthHeight[0]}px`};\n height: ${props => `${props.actionWidthHeight[1]}px`};\n border: 0;\n color: inherit;\n background-color: transparent;\n\n background-position: center;\n background-repeat: no-repeat;\n background-size: 0 0;\n transition: background-size 250ms ease;\n cursor: pointer;\n\n ${props => {\n const darkThemeBgColor = props?.backgroundColors?.[0] ?? props.theme.getColor('gray-600');\n const lightThemeBgColor = props?.backgroundColors?.[1] ?? props.theme.getColor('gray-200');\n return props.theme.themeProp(\n 'background-image',\n `radial-gradient(circle at center, ${darkThemeBgColor} 50%, transparent 51%)`,\n `radial-gradient(circle at center, ${lightThemeBgColor} 50%, transparent 51%)`\n );\n }}\n\n &:hover:not(:disabled) {\n background-size: ${props =>\n Math.max(props.actionWidthHeight[0], props.actionWidthHeight[1]) * 2}px\n ${props => Math.max(props.actionWidthHeight[0], props.actionWidthHeight[1]) * 2}px;\n\n svg {\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-700')\n )};\n }\n }\n\n ${props =>\n props.active &&\n css`\n background-size: ${Math.max(props.actionWidthHeight[0], props.actionWidthHeight[1]) * 2}px\n ${Math.max(props.actionWidthHeight[0], props.actionWidthHeight[1]) * 2}px;\n\n svg {\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-700')\n )};\n }\n `}\n\n ${props =>\n props.useShadow\n ? props.theme.themeProp(\n 'box-shadow',\n `0px 3px 6px ${rgba(props.theme.getColor('black'), 0.7)}`,\n `0px 3px 6px ${props.theme.getColor('black')}`\n )\n : null}\n\n &:disabled {\n opacity: 0.5;\n color: inherit;\n cursor: not-allowed;\n }\n\n svg {\n width: 100%;\n max-width: ${props => `${props.actionWidthHeight[0] - 15}px`};\n max-height: ${props => `${props.actionWidthHeight[1] - 15}px`};\n pointer-events: none;\n transition: color 250ms;\n }\n`;\n"],"names":["ActionButton","styled","button","attrs","applyDefaultTheme","props","actionWidthHeight","darkThemeBgColor","backgroundColors","theme","getColor","lightThemeBgColor","themeProp","Math","max","active","css","useShadow","rgba"],"mappings":";;;;AAIO,MAAMA,YAAY,GAAGC,MAAM,CAACC,MAAM,CAACC,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAClE;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AK,IAAI,CAAA,EAAGA,KAAK,CAACC,iBAAiB,CAAC,CAAC,CAAC,GAAG,EAAE,CAAI,EAAA,CAAA,CAAA;AACjE;AACA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"ActionButton.styled.js","sources":["../../../src/components/inputs/ActionButton/ActionButton.styled.js"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { rgba } from 'polished';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nconst shouldForwardProp = prop => prop !== 'theme' && !prop.startsWith('$');\n\nexport const ActionButton = styled.button\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: inline-flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n width: ${props => `${props.$actionWidthHeight[0]}px`};\n height: ${props => `${props.$actionWidthHeight[1]}px`};\n border: 0;\n color: inherit;\n background-color: transparent;\n\n background-position: center;\n background-repeat: no-repeat;\n background-size: 0 0;\n transition: background-size 250ms ease;\n cursor: pointer;\n\n ${props => {\n const darkThemeBgColor = props?.$backgroundColors?.[0] ?? props.theme.getColor('gray-600');\n const lightThemeBgColor = props?.$backgroundColors?.[1] ?? props.theme.getColor('gray-200');\n return props.theme.themeProp(\n 'background-image',\n `radial-gradient(circle at center, ${darkThemeBgColor} 50%, transparent 51%)`,\n `radial-gradient(circle at center, ${lightThemeBgColor} 50%, transparent 51%)`\n );\n }}\n\n &:hover:not(:disabled) {\n background-size: ${props =>\n Math.max(props.$actionWidthHeight[0], props.$actionWidthHeight[1]) * 2}px\n ${props => Math.max(props.$actionWidthHeight[0], props.$actionWidthHeight[1]) * 2}px;\n\n svg {\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-700')\n )};\n }\n }\n\n ${props =>\n props.$active &&\n css`\n background-size: ${Math.max(props.$actionWidthHeight[0], props.$actionWidthHeight[1]) * 2}px\n ${Math.max(props.$actionWidthHeight[0], props.$actionWidthHeight[1]) * 2}px;\n\n svg {\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-700')\n )};\n }\n `}\n\n ${props =>\n props.$useShadow\n ? props.theme.themeProp(\n 'box-shadow',\n `0px 3px 6px ${rgba(props.theme.getColor('black'), 0.7)}`,\n `0px 3px 6px ${props.theme.getColor('black')}`\n )\n : null}\n\n &:disabled {\n opacity: 0.5;\n color: inherit;\n cursor: not-allowed;\n }\n\n svg {\n width: 100%;\n max-width: ${props => `${props.$actionWidthHeight[0] - 15}px`};\n max-height: ${props => `${props.$actionWidthHeight[1] - 15}px`};\n pointer-events: none;\n transition: color 250ms;\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","ActionButton","styled","button","withConfig","attrs","applyDefaultTheme","props","$actionWidthHeight","darkThemeBgColor","$backgroundColors","theme","getColor","lightThemeBgColor","themeProp","Math","max","$active","css","$useShadow","rgba"],"mappings":";;;;AAIA,MAAMA,iBAAiB,GAAGC,IAAI,IAAIA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC,CAAA;AAEpE,MAAMC,YAAY,GAAGC,MAAM,CAACC,MAAM,CACtCC,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B;AACA;AACA;AACA;AACA,SAAWC,EAAAA,KAAK,IAAI,CAAGA,EAAAA,KAAK,CAACC,kBAAkB,CAAC,CAAC,CAAC,CAAI,EAAA,CAAA,CAAA;AACtD,UAAYD,EAAAA,KAAK,IAAI,CAAGA,EAAAA,KAAK,CAACC,kBAAkB,CAAC,CAAC,CAAC,CAAI,EAAA,CAAA,CAAA;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,EAAID,KAAK,IAAI;AACT,EAAA,MAAME,gBAAgB,GAAGF,KAAK,EAAEG,iBAAiB,GAAG,CAAC,CAAC,IAAIH,KAAK,CAACI,KAAK,CAAC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CAAC,EAAED,KAAK,CAACC,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAChF;AACA;AACA,QAAUD,EAAAA,KAAK,CAACI,KAAK,CAACG,SAAS,CACrB,OAAO,EACPP,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EAChCL,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CACjC,CAAC,CAAA;AACT;AACA,IAAK,CAAA,CAAA;AACL;AACA,EAAA,EAAIL,KAAK,IACLA,KAAK,CAACY,UAAU,GACZZ,KAAK,CAACI,KAAK,CAACG,SAAS,CACnB,YAAY,EACZ,CAAA,YAAA,EAAeM,IAAI,CAACb,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,CAAA,CAAE,EACzD,CAAeL,YAAAA,EAAAA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,OAAO,CAAC,CAC9C,CAAA,CAAC,GACD,IAAI,CAAA;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAiBL,EAAAA,KAAK,IAAI,CAAA,EAAGA,KAAK,CAACC,kBAAkB,CAAC,CAAC,CAAC,GAAG,EAAE,CAAI,EAAA,CAAA,CAAA;AACjE,gBAAkBD,EAAAA,KAAK,IAAI,CAAA,EAAGA,KAAK,CAACC,kBAAkB,CAAC,CAAC,CAAC,GAAG,EAAE,CAAI,EAAA,CAAA,CAAA;AAClE;AACA;AACA;AACA;;;;"}
@@ -344,21 +344,21 @@ const AssetGalleryBase = React__default.forwardRef(function AssetGalleryBase({
344
344
  extendedSelectMode: Boolean(selectedAssetKeys.length),
345
345
  onAssetSelected: onAssetSelected,
346
346
  onAssetUnselected: onAssetUnselected,
347
- $softSelected: softSelectedAssetKey === asset.key,
347
+ softSelected: softSelectedAssetKey === asset.key,
348
348
  component: component
349
349
  }) : React__default.createElement(AssetGalleryCompactCard, {
350
350
  asset: asset,
351
351
  activeSummaryCard: activeSummaryCard,
352
352
  displayIcon: displayIcon,
353
- $hasHeightAndWidth: asset.layout.hasHeightAndWidth,
354
- $collapseExtraInfo: asset.layout.width < 90,
353
+ hasHeightAndWidth: asset.layout.hasHeightAndWidth,
354
+ collapseExtraInfo: asset.layout.width < 90,
355
355
  selectable: 'selectable' in asset ? asset.selectable : selectable,
356
356
  selected: selectedAssetKeys.includes(asset.key),
357
357
  customSelectedBorder: customSelectedBorder,
358
358
  extendedSelectMode: Boolean(selectedAssetKeys.length),
359
359
  onAssetSelected: onAssetSelected,
360
360
  onAssetUnselected: onAssetUnselected,
361
- $softSelected: softSelectedAssetKey === asset.key,
361
+ softSelected: softSelectedAssetKey === asset.key,
362
362
  component: component
363
363
  }))))));
364
364
  });
@@ -1 +1 @@
1
- {"version":3,"file":"AssetGalleryBase.js","sources":["../../../../src/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport useMergedRefs from '@restart/hooks/useMergedRefs';\nimport { throttle } from 'lodash';\nimport PropTypes from 'prop-types';\nimport ResizeObserver from 'resize-observer-polyfill';\nimport { assetShape } from '../asset.propType';\nimport useIsomorphicLayoutEffect from './../../../../hooks/useIsomorphicLayoutEffect';\nimport * as S from './AssetGalleryBase.styled';\nimport AssetGalleryCompactCard from './AssetGalleryCompactCard/AssetGalleryCompactCard';\nimport AssetGalleryGridCard from './AssetGalleryGridCard/AssetGalleryGridCard';\n\nconst AssetGalleryBase = React.forwardRef(function AssetGalleryBase(\n {\n assets: assetsProp,\n activeSummaryCard,\n displayIcon,\n viewMode,\n thumbnailMaxHeight,\n selectable,\n customSelectedBorder,\n selectedAssetKeys,\n onAssetSelected,\n onAssetUnselected,\n softSelectable,\n softSelectedAssetKey,\n scrollElement: scrollElementProp,\n onAssetSoftSelectedChanged,\n component,\n ...props\n },\n forwardedRef\n) {\n // Combine forwarded ref and the local ref\n const assetGalleryDOMNode = useRef();\n const assetGalleryCompactRef = useMergedRefs(forwardedRef, assetGalleryDOMNode);\n\n const assetGalleryWidth = useRef(0);\n const minimumRowAspectRatio = useRef(0);\n\n // Calculated assets\n const calculatedAssets = useRef([]);\n const [assets, setAssets] = useState([]);\n\n // Constants\n const MAXIMUM_ROW_HEIGHT = useMemo(\n () => (viewMode === 'grid' ? 450 : thumbnailMaxHeight),\n [viewMode, thumbnailMaxHeight]\n );\n const SPACE_BETWEEN_ASSETS = 8;\n const SPACE_UNDER_ASSETS = 8;\n const PRIMARY_SCROLL_BUFFER_HEIGHT = 1500;\n const SECONDARY_SCROLL_BUFFER_HEIGHT = 500;\n const GRID_VIEW_MODE_ASSET_MIN_WIDTH = 300;\n const GRID_VIEW_MODE_ASSET_HEIGHT = 427;\n const MISSING_WIDTH_PLACEHOLDER = 1920;\n const MISSING_HEIGHT_PLACEHOLDER = 1080;\n\n const isBrowser = typeof window !== 'undefined';\n\n const scrollElement = scrollElementProp || window;\n\n // Scroll position and direction\n const previousYOffset = useRef(isBrowser ? scrollElement.pageYOffset : 0);\n const latestYOffset = useRef(isBrowser ? scrollElement.pageYOffset : 0);\n const scrollDirection = useRef('down');\n\n // Track resize changes and set the current Asset Gallery width\n useIsomorphicLayoutEffect(() => {\n if (!assetGalleryDOMNode.current) return;\n\n const throttledOnResize = throttle(onResize, 1);\n\n const resizeObserver = new ResizeObserver(throttledOnResize);\n\n resizeObserver.observe(assetGalleryDOMNode.current);\n\n function onResize(entries) {\n entries.forEach(entry => {\n // setAssetGalleryWidth(entry.contentRect.width);\n if (assetGalleryWidth.current === entry.contentRect.width) return;\n window.requestAnimationFrame(() => {\n assetGalleryWidth.current = entry.contentRect.width;\n main();\n });\n });\n }\n\n return () => {\n resizeObserver.unobserve(assetGalleryDOMNode.current);\n };\n }, [assetsProp, assetGalleryDOMNode, MAXIMUM_ROW_HEIGHT]);\n\n //Re calculate Asset Gallery when something changes `MAXIMUM_ROW_HEIGHT` or `assetsProp` changes\n useEffect(() => {\n main();\n }, [MAXIMUM_ROW_HEIGHT, assetsProp]);\n\n const main = () => {\n calculateAssetGalleryAspectRatio();\n calculateLayout();\n calculateVisibility();\n };\n\n const calculateAssetGalleryAspectRatio = () => {\n // We don't care to compute the aspect ratio if the width of the gallery is 0\n if (assetGalleryWidth.current > 0) {\n minimumRowAspectRatio.current = calculateAspectRatio(\n assetGalleryWidth.current,\n MAXIMUM_ROW_HEIGHT\n );\n }\n };\n\n // Calculate asset gallery layout\n const calculateLayout = () => {\n // Check for required attributes and omit assets that are missing the attribute\n const assetsWithoutAKey = assetsProp.filter(a => !a.key);\n if (assetsWithoutAKey.length > 0) {\n assetsProp = assetsProp.filter(a => a.key);\n assetsWithoutAKey.forEach(a =>\n console.warn(\n 'Omitted asset from the gallery because it was missing the unique `key` property.',\n a\n )\n );\n }\n\n if (viewMode === 'grid' && assetGalleryWidth.current > 0) {\n // State\n let row = []; // The list of images in the current row.\n let translateX = 0; // The current translateX value that we are at\n let translateY = 0; // The current translateY value that we are at\n const computedAssets = [];\n let lastGroup = null; // The last group that was created\n\n // Calculate how many assets we can put in a row before violating `ASSET_MIN_WIDTH`\n // but we always want minimum of 1 asset in a row\n const desiredAssetCountInRow =\n Math.floor(assetGalleryWidth.current / GRID_VIEW_MODE_ASSET_MIN_WIDTH) || 1;\n\n // Calculate the width of each asset in a row\n const desiredAssetWidth =\n assetGalleryWidth.current / desiredAssetCountInRow -\n SPACE_BETWEEN_ASSETS +\n SPACE_BETWEEN_ASSETS / desiredAssetCountInRow;\n\n assetsProp.forEach((asset, index) => {\n // Create a group label\n if (asset.group && asset.group !== lastGroup) {\n computedAssets.push({\n title: asset.group,\n key: asset.key,\n layout: {\n type: 'groupLabel',\n height: 50,\n translateX: Math.round(translateX),\n translateY: Math.round(translateY)\n }\n });\n lastGroup = asset.group;\n translateY += 50 + SPACE_UNDER_ASSETS;\n }\n\n row.push(asset);\n\n if (\n row.length === desiredAssetCountInRow ||\n index + 1 === assetsProp.length ||\n (assetsProp[index + 1]?.group && assetsProp[index + 1].group !== asset.group)\n ) {\n row.forEach(rowAsset => {\n computedAssets.push({\n ...rowAsset,\n layout: {\n type: 'asset', // Indicates that this is an asset and not a group label\n width: Math.round(desiredAssetWidth),\n height: Math.round(GRID_VIEW_MODE_ASSET_HEIGHT),\n translateX: Math.round(translateX),\n translateY: Math.round(translateY)\n }\n });\n\n translateX += desiredAssetWidth + SPACE_BETWEEN_ASSETS;\n });\n\n row = [];\n translateX = 0;\n translateY += GRID_VIEW_MODE_ASSET_HEIGHT + SPACE_UNDER_ASSETS;\n }\n });\n\n calculatedAssets.current = computedAssets;\n } else {\n if (minimumRowAspectRatio.current > 0) {\n // State\n let row = []; // The list of images in the current row.\n let translateX = 0; // The current translateX value that we are at\n let translateY = 0; // The current translateY value that we are at\n let rowAspectRatio = 0; // The aspect ratio of the row we are building\n let lastGroup = null; // The last group that was created\n\n const computedAssets = [];\n\n // Loop through all our images, building them up into rows and computing\n // the working rowAspectRatio.\n assetsProp.forEach((asset, index) => {\n // Create a group label\n if (asset.group && asset.group !== lastGroup) {\n computedAssets.push({\n title: asset.group,\n key: asset.key,\n layout: {\n type: 'groupLabel',\n height: 50,\n translateX: Math.round(translateX),\n translateY: Math.round(translateY)\n }\n });\n lastGroup = asset.group;\n translateY += 50 + SPACE_UNDER_ASSETS;\n }\n\n rowAspectRatio += calculateAspectRatio(\n asset.width || MISSING_WIDTH_PLACEHOLDER,\n asset.height || MISSING_HEIGHT_PLACEHOLDER\n );\n\n row.push(asset);\n\n // End the row if any of the conditions match\n if (\n rowAspectRatio >= minimumRowAspectRatio.current ||\n index + 1 === assetsProp.length ||\n (assetsProp[index + 1]?.group && assetsProp[index + 1].group !== asset.group)\n ) {\n // Make sure that the last row also has a reasonable height\n rowAspectRatio = Math.max(rowAspectRatio, minimumRowAspectRatio.current);\n\n // Compute this row's height.\n const totalDesiredWidthOfImages =\n assetGalleryWidth.current - SPACE_BETWEEN_ASSETS * (row.length - 1);\n const rowHeight = totalDesiredWidthOfImages / rowAspectRatio;\n\n row.forEach(rowAsset => {\n const assetWidth =\n rowHeight *\n calculateAspectRatio(\n rowAsset.width || MISSING_WIDTH_PLACEHOLDER,\n rowAsset.height || MISSING_HEIGHT_PLACEHOLDER\n );\n\n computedAssets.push({\n ...rowAsset,\n layout: {\n type: 'asset', // Indicates that this is an asset an not a group label\n width: Math.round(assetWidth),\n height: Math.round(rowHeight),\n translateX: Math.round(translateX),\n translateY: Math.round(translateY),\n hasHeightAndWidth: Boolean(rowAsset.width && rowAsset.height)\n }\n });\n\n // The next image is `SPACE_BETWEEN_ASSETS` pixels to the right of this image.\n translateX += assetWidth + SPACE_BETWEEN_ASSETS;\n });\n\n // Reset our state variables for next row.\n row = [];\n rowAspectRatio = 0;\n translateY += rowHeight + SPACE_UNDER_ASSETS;\n translateX = 0;\n }\n });\n\n calculatedAssets.current = computedAssets;\n }\n }\n };\n\n // Utility function to calculate the aspect ratio of a width and height\n function calculateAspectRatio(width, height) {\n return width / height;\n }\n\n // Calculate the total height of the gallery\n const totalGalleryHeight = useMemo(() => {\n if (assets.length === 0) {\n return 0;\n }\n\n const lastAsset = assets[assets.length - 1];\n\n if (assets.length < 8) {\n return (lastAsset.layout.translateY + lastAsset.layout.height) * 2;\n }\n\n return lastAsset.layout.translateY + lastAsset.layout.height;\n }, [assets]);\n\n useEffect(() => {\n const throttledOnScroll = throttle(onScroll, 200);\n\n scrollElement.addEventListener('scroll', throttledOnScroll, false);\n return () => scrollElement.removeEventListener('scroll', throttledOnScroll, false);\n }, [assetGalleryDOMNode, calculatedAssets]);\n\n function onScroll() {\n setScrollPositionAndDirection();\n calculateVisibility();\n }\n\n function setScrollPositionAndDirection() {\n const newYOffset = scrollElement.pageYOffset;\n previousYOffset.current = latestYOffset.current;\n latestYOffset.current = newYOffset;\n scrollDirection.current = latestYOffset.current > previousYOffset.current ? 'down' : 'up';\n }\n\n /**\n * +---------------------------+\n * | |\n * | |\n * | |\n * | |\n * + - - - - - - - - - - - - - + -------\n * | | A\n * | Secondary Buffer | SECONDARY_SCROLL_BUFFER_HEIGHT\n * | | V\n * +---------------------------+ -------\n * | | A\n * | | |\n * | | |\n * | Viewport | window.innerHeight\n * | | |\n * | | |\n * | | V\n * +---------------------------+ -------\n * | | A\n * | | |\n * | | |\n * | | |\n * | Primary Buffer | PRIMARY_SCROLL_BUFFER_HEIGHT\n * | | |\n * | | |\n * | | |\n * | | V\n * + - - - - - - - - - - - - - + -------\n * | |\n * | (Scroll direction) |\n * | | |\n * | | |\n * | V |\n * | |\n *\n */\n\n const calculateVisibility = () => {\n if (!assetGalleryDOMNode.current) return;\n\n // Get the top and bottom buffers heights.\n const bufferTop =\n scrollDirection.current === 'up'\n ? PRIMARY_SCROLL_BUFFER_HEIGHT\n : SECONDARY_SCROLL_BUFFER_HEIGHT;\n\n const bufferBottom =\n scrollDirection.current === 'up'\n ? SECONDARY_SCROLL_BUFFER_HEIGHT\n : PRIMARY_SCROLL_BUFFER_HEIGHT;\n\n const containerOffset = getOffsetTop(assetGalleryDOMNode.current);\n const scrollerHeight = scrollElement.innerHeight;\n\n const yOffset = latestYOffset.current;\n\n // This is the top of the top buffer. If the bottom of an image is above\n // this line, it will be removed.\n const minTranslateYPlusHeight = yOffset - containerOffset - bufferTop;\n\n // This is the bottom of the bottom buffer. If the top of an image is\n // below this line, it will be removed.\n const maxTranslateY = yOffset - containerOffset + scrollerHeight + bufferBottom;\n\n const finalizedAssets = calculatedAssets.current.map(asset => {\n if (\n scrollElement.self == window &&\n (asset.layout.translateY + asset.layout.height < minTranslateYPlusHeight ||\n asset.layout.translateY > maxTranslateY)\n ) {\n // Hide Image\n asset.layout.show = false;\n } else {\n // Show Image\n asset.layout.show = true;\n }\n\n return asset;\n });\n\n setAssets(finalizedAssets);\n };\n\n // Utility function that returns the distance from `elem` to the top of the page.\n // This is done by walking up the node tree, getting the offsetTop of each\n // parent node, until the top of the page.\n function getOffsetTop(elem) {\n let offsetTop = 0;\n do {\n if (!isNaN(elem.offsetTop)) {\n offsetTop += elem.offsetTop;\n }\n elem = elem.offsetParent;\n } while (elem);\n return offsetTop;\n }\n\n const handleKeyPress = useCallback(\n e => {\n function isElementVisible(el) {\n const rect = el.getBoundingClientRect(),\n vWidth = scrollElement.innerWidth || document.documentElement.clientWidth,\n vHeight = scrollElement.innerHeight || document.documentElement.clientHeight,\n efp = function (x, y) {\n return document.elementFromPoint(x, y);\n };\n\n // Return false if it's not in the viewport\n if (rect.right < 0 || rect.bottom < 0 || rect.left > vWidth || rect.top > vHeight)\n return false;\n\n // Return true if any of its four corners are visible\n return (\n el.contains(efp(rect.left, rect.top)) ||\n el.contains(efp(rect.right, rect.top)) ||\n el.contains(efp(rect.right, rect.bottom)) ||\n el.contains(efp(rect.left, rect.bottom))\n );\n }\n\n function softSelectFirstVisibleAsset() {\n const visibleAssets = assets.filter(asset => asset.layout.show);\n\n for (let i = 0; i < assetGalleryDOMNode.current.children.length; i++) {\n if (isElementVisible(assetGalleryDOMNode.current.children[i])) {\n onAssetSoftSelectedChanged(visibleAssets[i].key);\n break;\n }\n }\n }\n\n if (assets.length === 0) return;\n\n if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {\n if (softSelectedAssetKey === null) {\n softSelectFirstVisibleAsset();\n\n return;\n }\n }\n\n if (e.key === 'ArrowLeft') {\n const previousAssetIndex =\n assets.findIndex(asset => asset.key === softSelectedAssetKey) - 1;\n\n const previousAsset = assets[previousAssetIndex];\n\n if (previousAsset) {\n if (previousAsset.layout.show) {\n onAssetSoftSelectedChanged(previousAsset.key);\n } else {\n softSelectFirstVisibleAsset();\n }\n }\n\n return;\n }\n\n if (e.key === 'ArrowRight') {\n const nextAssetIndex = assets.findIndex(asset => asset.key === softSelectedAssetKey) + 1;\n\n const nextAsset = assets[nextAssetIndex];\n\n if (nextAsset) {\n if (nextAsset.layout.show) {\n onAssetSoftSelectedChanged(nextAsset.key);\n } else {\n softSelectFirstVisibleAsset();\n }\n }\n\n return;\n }\n\n if (e.key === 'Enter') {\n if (softSelectedAssetKey === null) return;\n\n if (selectedAssetKeys.includes(softSelectedAssetKey)) {\n onAssetUnselected(softSelectedAssetKey);\n } else {\n onAssetSelected(softSelectedAssetKey);\n }\n }\n },\n [\n assets,\n softSelectedAssetKey,\n onAssetSoftSelectedChanged,\n selectedAssetKeys,\n assetGalleryCompactRef\n ]\n );\n\n const handleClick = useCallback(() => {\n onAssetSoftSelectedChanged(null);\n }, []);\n\n // Add event listeners for keyboard navigation (soft select)\n useEffect(() => {\n if (softSelectable) {\n document.addEventListener('keydown', handleKeyPress);\n }\n\n return () => document.removeEventListener('keydown', handleKeyPress);\n }, [softSelectable, handleKeyPress]);\n\n useEffect(() => {\n if (softSelectable && softSelectedAssetKey !== null) {\n document.addEventListener('click', handleClick, true);\n }\n\n return () => document.removeEventListener('click', handleClick, true);\n }, [softSelectable, softSelectedAssetKey, handleClick]);\n\n return (\n <>\n <S.AssetGalleryBase\n ref={assetGalleryCompactRef}\n style={{ height: `${totalGalleryHeight}px` }}\n className={props.className}\n {...props}\n >\n {assets.map(\n asset =>\n asset.layout.show && (\n <React.Fragment key={`asset-gallery-${asset.layout.type}-${asset.key}`}>\n {asset.layout.type === 'groupLabel' && (\n <S.GroupLabel\n style={{\n transform: `translate3d(${asset.layout.translateX}px,${asset.layout.translateY}px, 0)`,\n height: `${asset.layout.height}px`\n }}\n >\n {asset.title}\n </S.GroupLabel>\n )}\n\n {asset.layout.type === 'asset' && (\n <S.AssetGalleryCardBase\n style={{\n transform: `translate3d(${asset.layout.translateX}px, ${asset.layout.translateY}px, 0)`,\n width: `${asset.layout.width}px`,\n height: `${asset.layout.height}px`,\n display: 'flex',\n justifyContent: 'center'\n }}\n >\n {viewMode === 'grid' ? (\n <AssetGalleryGridCard\n asset={asset}\n selectable={'selectable' in asset ? asset.selectable : selectable}\n selected={selectedAssetKeys.includes(asset.key)}\n customSelectedBorder={customSelectedBorder}\n extendedSelectMode={Boolean(selectedAssetKeys.length)}\n onAssetSelected={onAssetSelected}\n onAssetUnselected={onAssetUnselected}\n $softSelected={softSelectedAssetKey === asset.key}\n component={component}\n />\n ) : (\n <AssetGalleryCompactCard\n asset={asset}\n activeSummaryCard={activeSummaryCard}\n displayIcon={displayIcon}\n $hasHeightAndWidth={asset.layout.hasHeightAndWidth}\n $collapseExtraInfo={asset.layout.width < 90}\n selectable={'selectable' in asset ? asset.selectable : selectable}\n selected={selectedAssetKeys.includes(asset.key)}\n customSelectedBorder={customSelectedBorder}\n extendedSelectMode={Boolean(selectedAssetKeys.length)}\n onAssetSelected={onAssetSelected}\n onAssetUnselected={onAssetUnselected}\n $softSelected={softSelectedAssetKey === asset.key}\n component={component}\n />\n )}\n </S.AssetGalleryCardBase>\n )}\n </React.Fragment>\n )\n )}\n </S.AssetGalleryBase>\n </>\n );\n});\n\nAssetGalleryBase.propTypes = {\n /**\n * An array of assets to display in the gallery.\n */\n assets: PropTypes.arrayOf(PropTypes.shape(assetShape)),\n\n /**\n * Whether the asset gallery should render the Asset Summary Card on hover.\n */\n activeSummaryCard: PropTypes.bool,\n\n /**\n * Whether the asset gallery should display the Version Count or Verifications on default.\n */\n displayIcon: PropTypes.string,\n\n /**\n * The view mode of the gallery.\n */\n viewMode: PropTypes.oneOf(['compact', 'grid']),\n\n /**\n * The maximum height of thumbnails in the gallery. When the grid is computed the gallery will try\n * to have each row of the gallery as close to the max height as possible.\n */\n thumbnailMaxHeight: PropTypes.number,\n\n /**\n * Whether or not the asset gallery should have selectable asset cards\n */\n selectable: PropTypes.bool,\n\n /**\n * Whether or not the asset gallery should have custom borders on selected asset\n */\n customSelectedBorder: PropTypes.arrayOf(PropTypes.string),\n\n /**\n * An array containing the key of all selected assets\n */\n selectedAssetKeys: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.string),\n PropTypes.arrayOf(PropTypes.number)\n ]).isRequired,\n\n /**\n * Scrollable element to attach event listeners to. Defaults to window.\n */\n scrollElement: PropTypes.instanceOf(Element),\n\n /**\n * The callback function when an asset is selected - returns the selected asset key\n */\n onAssetSelected: PropTypes.func.isRequired,\n\n /**\n * The callback function when an asset is unselected - returns the unselected asset key\n */\n onAssetUnselected: PropTypes.func.isRequired,\n\n /**\n * Whether or not the asset gallery should have soft selectable asset cards\n */\n softSelectable: PropTypes.bool,\n\n /**\n * A value containing the key of the soft selected asset or null\n */\n softSelectedAssetKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n\n /**\n * The callback function when soft selected asset changes - returns the selected asset key or null\n */\n onAssetSoftSelectedChanged: PropTypes.func.isRequired,\n\n /**\n * A function that returns a custom component to use for the card in the gallery - The function provides\n * `asset` as its first argument\n */\n component: PropTypes.func,\n\n /**\n * Optional className\n */\n className: PropTypes.string\n};\n\nexport default AssetGalleryBase;\n"],"names":["AssetGalleryBase","React","forwardRef","assets","assetsProp","activeSummaryCard","displayIcon","viewMode","thumbnailMaxHeight","selectable","customSelectedBorder","selectedAssetKeys","onAssetSelected","onAssetUnselected","softSelectable","softSelectedAssetKey","scrollElement","scrollElementProp","onAssetSoftSelectedChanged","component","props","forwardedRef","assetGalleryDOMNode","useRef","assetGalleryCompactRef","useMergedRefs","assetGalleryWidth","minimumRowAspectRatio","calculatedAssets","setAssets","useState","MAXIMUM_ROW_HEIGHT","useMemo","SPACE_BETWEEN_ASSETS","SPACE_UNDER_ASSETS","PRIMARY_SCROLL_BUFFER_HEIGHT","SECONDARY_SCROLL_BUFFER_HEIGHT","GRID_VIEW_MODE_ASSET_MIN_WIDTH","GRID_VIEW_MODE_ASSET_HEIGHT","MISSING_WIDTH_PLACEHOLDER","MISSING_HEIGHT_PLACEHOLDER","isBrowser","window","previousYOffset","pageYOffset","latestYOffset","scrollDirection","useIsomorphicLayoutEffect","current","throttledOnResize","throttle","onResize","resizeObserver","ResizeObserver","observe","entries","forEach","entry","contentRect","width","requestAnimationFrame","main","unobserve","useEffect","calculateAssetGalleryAspectRatio","calculateLayout","calculateVisibility","calculateAspectRatio","assetsWithoutAKey","filter","a","key","length","console","warn","row","translateX","translateY","computedAssets","lastGroup","desiredAssetCountInRow","Math","floor","desiredAssetWidth","asset","index","group","push","title","layout","type","height","round","rowAsset","rowAspectRatio","max","totalDesiredWidthOfImages","rowHeight","assetWidth","hasHeightAndWidth","Boolean","totalGalleryHeight","lastAsset","throttledOnScroll","onScroll","addEventListener","removeEventListener","setScrollPositionAndDirection","newYOffset","bufferTop","bufferBottom","containerOffset","getOffsetTop","scrollerHeight","innerHeight","yOffset","minTranslateYPlusHeight","maxTranslateY","finalizedAssets","map","self","show","elem","offsetTop","isNaN","offsetParent","handleKeyPress","useCallback","e","isElementVisible","el","rect","getBoundingClientRect","vWidth","innerWidth","document","documentElement","clientWidth","vHeight","clientHeight","efp","x","y","elementFromPoint","right","bottom","left","top","contains","softSelectFirstVisibleAsset","visibleAssets","i","children","previousAssetIndex","findIndex","previousAsset","nextAssetIndex","nextAsset","includes","handleClick","createElement","Fragment","S","_extends","ref","style","className","transform","display","justifyContent","AssetGalleryGridCard","selected","extendedSelectMode","$softSelected","AssetGalleryCompactCard","$hasHeightAndWidth","$collapseExtraInfo","propTypes","process","env","NODE_ENV","PropTypes","arrayOf","shape","assetShape","bool","string","oneOf","number","oneOfType","isRequired","instanceOf","Element","func"],"mappings":";;;;;;;;;;;;AAWMA,MAAAA,gBAAgB,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,gBAAgBA,CACjE;AACEG,EAAAA,MAAM,EAAEC,UAAU;EAClBC,iBAAiB;EACjBC,WAAW;EACXC,QAAQ;EACRC,kBAAkB;EAClBC,UAAU;EACVC,oBAAoB;EACpBC,iBAAiB;EACjBC,eAAe;EACfC,iBAAiB;EACjBC,cAAc;EACdC,oBAAoB;AACpBC,EAAAA,aAAa,EAAEC,iBAAiB;EAChCC,0BAA0B;EAC1BC,SAAS;EACT,GAAGC,KAAAA;AACL,CAAC,EACDC,YAAY,EACZ;AAEA,EAAA,MAAMC,mBAAmB,GAAGC,MAAM,EAAE,CAAA;AACpC,EAAA,MAAMC,sBAAsB,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C,CAAC;EAM9CnL,kBAAkB,EAAE6K,SAAS,CAACO,MAAM;EAKpCnL,UAAU,EAAE4K,SAAS,CAACI,IAAI;EAK1B/K,oBAAoB,EAAE2K,SAAS,CAACC,OAAO,CAACD,SAAS,CAACK,MAAM,CAAC;EAKzD/K,iBAAiB,EAAE0K,SAAS,CAACQ,SAAS,CAAC,CACrCR,SAAS,CAACC,OAAO,CAACD,SAAS,CAACK,MAAM,CAAC,EACnCL,SAAS,CAACC,OAAO,CAACD,SAAS,CAACO,MAAM,CAAC,CACpC,CAAC,CAACE,UAAU;AAKb9K,EAAAA,aAAa,EAAEqK,SAAS,CAACU,UAAU,CAACC,OAAO,CAAC;AAK5CpL,EAAAA,eAAe,EAAEyK,SAAS,CAACY,IAAI,CAACH,UAAU;AAK1CjL,EAAAA,iBAAiB,EAAEwK,SAAS,CAACY,IAAI,CAACH,UAAU;EAK5ChL,cAAc,EAAEuK,SAAS,CAACI,IAAI;AAK9B1K,EAAAA,oBAAoB,EAAEsK,SAAS,CAACQ,SAAS,CAAC,CAACR,SAAS,CAACK,MAAM,EAAEL,SAAS,CAACO,MAAM,CAAC,CAAC;AAK/E1K,EAAAA,0BAA0B,EAAEmK,SAAS,CAACY,IAAI,CAACH,UAAU;EAMrD3K,SAAS,EAAEkK,SAAS,CAACY,IAAI;EAKzB3B,SAAS,EAAEe,SAAS,CAACK,MAAAA;AACvB,CAAC,GAAA,EAAA;;;;"}
1
+ {"version":3,"file":"AssetGalleryBase.js","sources":["../../../../src/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport useMergedRefs from '@restart/hooks/useMergedRefs';\nimport { throttle } from 'lodash';\nimport PropTypes from 'prop-types';\nimport ResizeObserver from 'resize-observer-polyfill';\nimport { assetShape } from '../asset.propType';\nimport useIsomorphicLayoutEffect from './../../../../hooks/useIsomorphicLayoutEffect';\nimport * as S from './AssetGalleryBase.styled';\nimport AssetGalleryCompactCard from './AssetGalleryCompactCard/AssetGalleryCompactCard';\nimport AssetGalleryGridCard from './AssetGalleryGridCard/AssetGalleryGridCard';\n\nconst AssetGalleryBase = React.forwardRef(function AssetGalleryBase(\n {\n assets: assetsProp,\n activeSummaryCard,\n displayIcon,\n viewMode,\n thumbnailMaxHeight,\n selectable,\n customSelectedBorder,\n selectedAssetKeys,\n onAssetSelected,\n onAssetUnselected,\n softSelectable,\n softSelectedAssetKey,\n scrollElement: scrollElementProp,\n onAssetSoftSelectedChanged,\n component,\n ...props\n },\n forwardedRef\n) {\n // Combine forwarded ref and the local ref\n const assetGalleryDOMNode = useRef();\n const assetGalleryCompactRef = useMergedRefs(forwardedRef, assetGalleryDOMNode);\n\n const assetGalleryWidth = useRef(0);\n const minimumRowAspectRatio = useRef(0);\n\n // Calculated assets\n const calculatedAssets = useRef([]);\n const [assets, setAssets] = useState([]);\n\n // Constants\n const MAXIMUM_ROW_HEIGHT = useMemo(\n () => (viewMode === 'grid' ? 450 : thumbnailMaxHeight),\n [viewMode, thumbnailMaxHeight]\n );\n const SPACE_BETWEEN_ASSETS = 8;\n const SPACE_UNDER_ASSETS = 8;\n const PRIMARY_SCROLL_BUFFER_HEIGHT = 1500;\n const SECONDARY_SCROLL_BUFFER_HEIGHT = 500;\n const GRID_VIEW_MODE_ASSET_MIN_WIDTH = 300;\n const GRID_VIEW_MODE_ASSET_HEIGHT = 427;\n const MISSING_WIDTH_PLACEHOLDER = 1920;\n const MISSING_HEIGHT_PLACEHOLDER = 1080;\n\n const isBrowser = typeof window !== 'undefined';\n\n const scrollElement = scrollElementProp || window;\n\n // Scroll position and direction\n const previousYOffset = useRef(isBrowser ? scrollElement.pageYOffset : 0);\n const latestYOffset = useRef(isBrowser ? scrollElement.pageYOffset : 0);\n const scrollDirection = useRef('down');\n\n // Track resize changes and set the current Asset Gallery width\n useIsomorphicLayoutEffect(() => {\n if (!assetGalleryDOMNode.current) return;\n\n const throttledOnResize = throttle(onResize, 1);\n\n const resizeObserver = new ResizeObserver(throttledOnResize);\n\n resizeObserver.observe(assetGalleryDOMNode.current);\n\n function onResize(entries) {\n entries.forEach(entry => {\n // setAssetGalleryWidth(entry.contentRect.width);\n if (assetGalleryWidth.current === entry.contentRect.width) return;\n window.requestAnimationFrame(() => {\n assetGalleryWidth.current = entry.contentRect.width;\n main();\n });\n });\n }\n\n return () => {\n resizeObserver.unobserve(assetGalleryDOMNode.current);\n };\n }, [assetsProp, assetGalleryDOMNode, MAXIMUM_ROW_HEIGHT]);\n\n //Re calculate Asset Gallery when something changes `MAXIMUM_ROW_HEIGHT` or `assetsProp` changes\n useEffect(() => {\n main();\n }, [MAXIMUM_ROW_HEIGHT, assetsProp]);\n\n const main = () => {\n calculateAssetGalleryAspectRatio();\n calculateLayout();\n calculateVisibility();\n };\n\n const calculateAssetGalleryAspectRatio = () => {\n // We don't care to compute the aspect ratio if the width of the gallery is 0\n if (assetGalleryWidth.current > 0) {\n minimumRowAspectRatio.current = calculateAspectRatio(\n assetGalleryWidth.current,\n MAXIMUM_ROW_HEIGHT\n );\n }\n };\n\n // Calculate asset gallery layout\n const calculateLayout = () => {\n // Check for required attributes and omit assets that are missing the attribute\n const assetsWithoutAKey = assetsProp.filter(a => !a.key);\n if (assetsWithoutAKey.length > 0) {\n assetsProp = assetsProp.filter(a => a.key);\n assetsWithoutAKey.forEach(a =>\n console.warn(\n 'Omitted asset from the gallery because it was missing the unique `key` property.',\n a\n )\n );\n }\n\n if (viewMode === 'grid' && assetGalleryWidth.current > 0) {\n // State\n let row = []; // The list of images in the current row.\n let translateX = 0; // The current translateX value that we are at\n let translateY = 0; // The current translateY value that we are at\n const computedAssets = [];\n let lastGroup = null; // The last group that was created\n\n // Calculate how many assets we can put in a row before violating `ASSET_MIN_WIDTH`\n // but we always want minimum of 1 asset in a row\n const desiredAssetCountInRow =\n Math.floor(assetGalleryWidth.current / GRID_VIEW_MODE_ASSET_MIN_WIDTH) || 1;\n\n // Calculate the width of each asset in a row\n const desiredAssetWidth =\n assetGalleryWidth.current / desiredAssetCountInRow -\n SPACE_BETWEEN_ASSETS +\n SPACE_BETWEEN_ASSETS / desiredAssetCountInRow;\n\n assetsProp.forEach((asset, index) => {\n // Create a group label\n if (asset.group && asset.group !== lastGroup) {\n computedAssets.push({\n title: asset.group,\n key: asset.key,\n layout: {\n type: 'groupLabel',\n height: 50,\n translateX: Math.round(translateX),\n translateY: Math.round(translateY)\n }\n });\n lastGroup = asset.group;\n translateY += 50 + SPACE_UNDER_ASSETS;\n }\n\n row.push(asset);\n\n if (\n row.length === desiredAssetCountInRow ||\n index + 1 === assetsProp.length ||\n (assetsProp[index + 1]?.group && assetsProp[index + 1].group !== asset.group)\n ) {\n row.forEach(rowAsset => {\n computedAssets.push({\n ...rowAsset,\n layout: {\n type: 'asset', // Indicates that this is an asset and not a group label\n width: Math.round(desiredAssetWidth),\n height: Math.round(GRID_VIEW_MODE_ASSET_HEIGHT),\n translateX: Math.round(translateX),\n translateY: Math.round(translateY)\n }\n });\n\n translateX += desiredAssetWidth + SPACE_BETWEEN_ASSETS;\n });\n\n row = [];\n translateX = 0;\n translateY += GRID_VIEW_MODE_ASSET_HEIGHT + SPACE_UNDER_ASSETS;\n }\n });\n\n calculatedAssets.current = computedAssets;\n } else {\n if (minimumRowAspectRatio.current > 0) {\n // State\n let row = []; // The list of images in the current row.\n let translateX = 0; // The current translateX value that we are at\n let translateY = 0; // The current translateY value that we are at\n let rowAspectRatio = 0; // The aspect ratio of the row we are building\n let lastGroup = null; // The last group that was created\n\n const computedAssets = [];\n\n // Loop through all our images, building them up into rows and computing\n // the working rowAspectRatio.\n assetsProp.forEach((asset, index) => {\n // Create a group label\n if (asset.group && asset.group !== lastGroup) {\n computedAssets.push({\n title: asset.group,\n key: asset.key,\n layout: {\n type: 'groupLabel',\n height: 50,\n translateX: Math.round(translateX),\n translateY: Math.round(translateY)\n }\n });\n lastGroup = asset.group;\n translateY += 50 + SPACE_UNDER_ASSETS;\n }\n\n rowAspectRatio += calculateAspectRatio(\n asset.width || MISSING_WIDTH_PLACEHOLDER,\n asset.height || MISSING_HEIGHT_PLACEHOLDER\n );\n\n row.push(asset);\n\n // End the row if any of the conditions match\n if (\n rowAspectRatio >= minimumRowAspectRatio.current ||\n index + 1 === assetsProp.length ||\n (assetsProp[index + 1]?.group && assetsProp[index + 1].group !== asset.group)\n ) {\n // Make sure that the last row also has a reasonable height\n rowAspectRatio = Math.max(rowAspectRatio, minimumRowAspectRatio.current);\n\n // Compute this row's height.\n const totalDesiredWidthOfImages =\n assetGalleryWidth.current - SPACE_BETWEEN_ASSETS * (row.length - 1);\n const rowHeight = totalDesiredWidthOfImages / rowAspectRatio;\n\n row.forEach(rowAsset => {\n const assetWidth =\n rowHeight *\n calculateAspectRatio(\n rowAsset.width || MISSING_WIDTH_PLACEHOLDER,\n rowAsset.height || MISSING_HEIGHT_PLACEHOLDER\n );\n\n computedAssets.push({\n ...rowAsset,\n layout: {\n type: 'asset', // Indicates that this is an asset an not a group label\n width: Math.round(assetWidth),\n height: Math.round(rowHeight),\n translateX: Math.round(translateX),\n translateY: Math.round(translateY),\n hasHeightAndWidth: Boolean(rowAsset.width && rowAsset.height)\n }\n });\n\n // The next image is `SPACE_BETWEEN_ASSETS` pixels to the right of this image.\n translateX += assetWidth + SPACE_BETWEEN_ASSETS;\n });\n\n // Reset our state variables for next row.\n row = [];\n rowAspectRatio = 0;\n translateY += rowHeight + SPACE_UNDER_ASSETS;\n translateX = 0;\n }\n });\n\n calculatedAssets.current = computedAssets;\n }\n }\n };\n\n // Utility function to calculate the aspect ratio of a width and height\n function calculateAspectRatio(width, height) {\n return width / height;\n }\n\n // Calculate the total height of the gallery\n const totalGalleryHeight = useMemo(() => {\n if (assets.length === 0) {\n return 0;\n }\n\n const lastAsset = assets[assets.length - 1];\n\n if (assets.length < 8) {\n return (lastAsset.layout.translateY + lastAsset.layout.height) * 2;\n }\n\n return lastAsset.layout.translateY + lastAsset.layout.height;\n }, [assets]);\n\n useEffect(() => {\n const throttledOnScroll = throttle(onScroll, 200);\n\n scrollElement.addEventListener('scroll', throttledOnScroll, false);\n return () => scrollElement.removeEventListener('scroll', throttledOnScroll, false);\n }, [assetGalleryDOMNode, calculatedAssets]);\n\n function onScroll() {\n setScrollPositionAndDirection();\n calculateVisibility();\n }\n\n function setScrollPositionAndDirection() {\n const newYOffset = scrollElement.pageYOffset;\n previousYOffset.current = latestYOffset.current;\n latestYOffset.current = newYOffset;\n scrollDirection.current = latestYOffset.current > previousYOffset.current ? 'down' : 'up';\n }\n\n /**\n * +---------------------------+\n * | |\n * | |\n * | |\n * | |\n * + - - - - - - - - - - - - - + -------\n * | | A\n * | Secondary Buffer | SECONDARY_SCROLL_BUFFER_HEIGHT\n * | | V\n * +---------------------------+ -------\n * | | A\n * | | |\n * | | |\n * | Viewport | window.innerHeight\n * | | |\n * | | |\n * | | V\n * +---------------------------+ -------\n * | | A\n * | | |\n * | | |\n * | | |\n * | Primary Buffer | PRIMARY_SCROLL_BUFFER_HEIGHT\n * | | |\n * | | |\n * | | |\n * | | V\n * + - - - - - - - - - - - - - + -------\n * | |\n * | (Scroll direction) |\n * | | |\n * | | |\n * | V |\n * | |\n *\n */\n\n const calculateVisibility = () => {\n if (!assetGalleryDOMNode.current) return;\n\n // Get the top and bottom buffers heights.\n const bufferTop =\n scrollDirection.current === 'up'\n ? PRIMARY_SCROLL_BUFFER_HEIGHT\n : SECONDARY_SCROLL_BUFFER_HEIGHT;\n\n const bufferBottom =\n scrollDirection.current === 'up'\n ? SECONDARY_SCROLL_BUFFER_HEIGHT\n : PRIMARY_SCROLL_BUFFER_HEIGHT;\n\n const containerOffset = getOffsetTop(assetGalleryDOMNode.current);\n const scrollerHeight = scrollElement.innerHeight;\n\n const yOffset = latestYOffset.current;\n\n // This is the top of the top buffer. If the bottom of an image is above\n // this line, it will be removed.\n const minTranslateYPlusHeight = yOffset - containerOffset - bufferTop;\n\n // This is the bottom of the bottom buffer. If the top of an image is\n // below this line, it will be removed.\n const maxTranslateY = yOffset - containerOffset + scrollerHeight + bufferBottom;\n\n const finalizedAssets = calculatedAssets.current.map(asset => {\n if (\n scrollElement.self == window &&\n (asset.layout.translateY + asset.layout.height < minTranslateYPlusHeight ||\n asset.layout.translateY > maxTranslateY)\n ) {\n // Hide Image\n asset.layout.show = false;\n } else {\n // Show Image\n asset.layout.show = true;\n }\n\n return asset;\n });\n\n setAssets(finalizedAssets);\n };\n\n // Utility function that returns the distance from `elem` to the top of the page.\n // This is done by walking up the node tree, getting the offsetTop of each\n // parent node, until the top of the page.\n function getOffsetTop(elem) {\n let offsetTop = 0;\n do {\n if (!isNaN(elem.offsetTop)) {\n offsetTop += elem.offsetTop;\n }\n elem = elem.offsetParent;\n } while (elem);\n return offsetTop;\n }\n\n const handleKeyPress = useCallback(\n e => {\n function isElementVisible(el) {\n const rect = el.getBoundingClientRect(),\n vWidth = scrollElement.innerWidth || document.documentElement.clientWidth,\n vHeight = scrollElement.innerHeight || document.documentElement.clientHeight,\n efp = function (x, y) {\n return document.elementFromPoint(x, y);\n };\n\n // Return false if it's not in the viewport\n if (rect.right < 0 || rect.bottom < 0 || rect.left > vWidth || rect.top > vHeight)\n return false;\n\n // Return true if any of its four corners are visible\n return (\n el.contains(efp(rect.left, rect.top)) ||\n el.contains(efp(rect.right, rect.top)) ||\n el.contains(efp(rect.right, rect.bottom)) ||\n el.contains(efp(rect.left, rect.bottom))\n );\n }\n\n function softSelectFirstVisibleAsset() {\n const visibleAssets = assets.filter(asset => asset.layout.show);\n\n for (let i = 0; i < assetGalleryDOMNode.current.children.length; i++) {\n if (isElementVisible(assetGalleryDOMNode.current.children[i])) {\n onAssetSoftSelectedChanged(visibleAssets[i].key);\n break;\n }\n }\n }\n\n if (assets.length === 0) return;\n\n if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {\n if (softSelectedAssetKey === null) {\n softSelectFirstVisibleAsset();\n\n return;\n }\n }\n\n if (e.key === 'ArrowLeft') {\n const previousAssetIndex =\n assets.findIndex(asset => asset.key === softSelectedAssetKey) - 1;\n\n const previousAsset = assets[previousAssetIndex];\n\n if (previousAsset) {\n if (previousAsset.layout.show) {\n onAssetSoftSelectedChanged(previousAsset.key);\n } else {\n softSelectFirstVisibleAsset();\n }\n }\n\n return;\n }\n\n if (e.key === 'ArrowRight') {\n const nextAssetIndex = assets.findIndex(asset => asset.key === softSelectedAssetKey) + 1;\n\n const nextAsset = assets[nextAssetIndex];\n\n if (nextAsset) {\n if (nextAsset.layout.show) {\n onAssetSoftSelectedChanged(nextAsset.key);\n } else {\n softSelectFirstVisibleAsset();\n }\n }\n\n return;\n }\n\n if (e.key === 'Enter') {\n if (softSelectedAssetKey === null) return;\n\n if (selectedAssetKeys.includes(softSelectedAssetKey)) {\n onAssetUnselected(softSelectedAssetKey);\n } else {\n onAssetSelected(softSelectedAssetKey);\n }\n }\n },\n [\n assets,\n softSelectedAssetKey,\n onAssetSoftSelectedChanged,\n selectedAssetKeys,\n assetGalleryCompactRef\n ]\n );\n\n const handleClick = useCallback(() => {\n onAssetSoftSelectedChanged(null);\n }, []);\n\n // Add event listeners for keyboard navigation (soft select)\n useEffect(() => {\n if (softSelectable) {\n document.addEventListener('keydown', handleKeyPress);\n }\n\n return () => document.removeEventListener('keydown', handleKeyPress);\n }, [softSelectable, handleKeyPress]);\n\n useEffect(() => {\n if (softSelectable && softSelectedAssetKey !== null) {\n document.addEventListener('click', handleClick, true);\n }\n\n return () => document.removeEventListener('click', handleClick, true);\n }, [softSelectable, softSelectedAssetKey, handleClick]);\n\n return (\n <>\n <S.AssetGalleryBase\n ref={assetGalleryCompactRef}\n style={{ height: `${totalGalleryHeight}px` }}\n className={props.className}\n {...props}\n >\n {assets.map(\n asset =>\n asset.layout.show && (\n <React.Fragment key={`asset-gallery-${asset.layout.type}-${asset.key}`}>\n {asset.layout.type === 'groupLabel' && (\n <S.GroupLabel\n style={{\n transform: `translate3d(${asset.layout.translateX}px,${asset.layout.translateY}px, 0)`,\n height: `${asset.layout.height}px`\n }}\n >\n {asset.title}\n </S.GroupLabel>\n )}\n\n {asset.layout.type === 'asset' && (\n <S.AssetGalleryCardBase\n style={{\n transform: `translate3d(${asset.layout.translateX}px, ${asset.layout.translateY}px, 0)`,\n width: `${asset.layout.width}px`,\n height: `${asset.layout.height}px`,\n display: 'flex',\n justifyContent: 'center'\n }}\n >\n {viewMode === 'grid' ? (\n <AssetGalleryGridCard\n asset={asset}\n selectable={'selectable' in asset ? asset.selectable : selectable}\n selected={selectedAssetKeys.includes(asset.key)}\n customSelectedBorder={customSelectedBorder}\n extendedSelectMode={Boolean(selectedAssetKeys.length)}\n onAssetSelected={onAssetSelected}\n onAssetUnselected={onAssetUnselected}\n softSelected={softSelectedAssetKey === asset.key}\n component={component}\n />\n ) : (\n <AssetGalleryCompactCard\n asset={asset}\n activeSummaryCard={activeSummaryCard}\n displayIcon={displayIcon}\n hasHeightAndWidth={asset.layout.hasHeightAndWidth}\n collapseExtraInfo={asset.layout.width < 90}\n selectable={'selectable' in asset ? asset.selectable : selectable}\n selected={selectedAssetKeys.includes(asset.key)}\n customSelectedBorder={customSelectedBorder}\n extendedSelectMode={Boolean(selectedAssetKeys.length)}\n onAssetSelected={onAssetSelected}\n onAssetUnselected={onAssetUnselected}\n softSelected={softSelectedAssetKey === asset.key}\n component={component}\n />\n )}\n </S.AssetGalleryCardBase>\n )}\n </React.Fragment>\n )\n )}\n </S.AssetGalleryBase>\n </>\n );\n});\n\nAssetGalleryBase.propTypes = {\n /**\n * An array of assets to display in the gallery.\n */\n assets: PropTypes.arrayOf(PropTypes.shape(assetShape)),\n\n /**\n * Whether the asset gallery should render the Asset Summary Card on hover.\n */\n activeSummaryCard: PropTypes.bool,\n\n /**\n * Whether the asset gallery should display the Version Count or Verifications on default.\n */\n displayIcon: PropTypes.string,\n\n /**\n * The view mode of the gallery.\n */\n viewMode: PropTypes.oneOf(['compact', 'grid']),\n\n /**\n * The maximum height of thumbnails in the gallery. When the grid is computed the gallery will try\n * to have each row of the gallery as close to the max height as possible.\n */\n thumbnailMaxHeight: PropTypes.number,\n\n /**\n * Whether or not the asset gallery should have selectable asset cards\n */\n selectable: PropTypes.bool,\n\n /**\n * Whether or not the asset gallery should have custom borders on selected asset\n */\n customSelectedBorder: PropTypes.arrayOf(PropTypes.string),\n\n /**\n * An array containing the key of all selected assets\n */\n selectedAssetKeys: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.string),\n PropTypes.arrayOf(PropTypes.number)\n ]).isRequired,\n\n /**\n * Scrollable element to attach event listeners to. Defaults to window.\n */\n scrollElement: PropTypes.instanceOf(Element),\n\n /**\n * The callback function when an asset is selected - returns the selected asset key\n */\n onAssetSelected: PropTypes.func.isRequired,\n\n /**\n * The callback function when an asset is unselected - returns the unselected asset key\n */\n onAssetUnselected: PropTypes.func.isRequired,\n\n /**\n * Whether or not the asset gallery should have soft selectable asset cards\n */\n softSelectable: PropTypes.bool,\n\n /**\n * A value containing the key of the soft selected asset or null\n */\n softSelectedAssetKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n\n /**\n * The callback function when soft selected asset changes - returns the selected asset key or null\n */\n onAssetSoftSelectedChanged: PropTypes.func.isRequired,\n\n /**\n * A function that returns a custom component to use for the card in the gallery - The function provides\n * `asset` as its first argument\n */\n component: PropTypes.func,\n\n /**\n * Optional className\n */\n className: PropTypes.string\n};\n\nexport default AssetGalleryBase;\n"],"names":["AssetGalleryBase","React","forwardRef","assets","assetsProp","activeSummaryCard","displayIcon","viewMode","thumbnailMaxHeight","selectable","customSelectedBorder","selectedAssetKeys","onAssetSelected","onAssetUnselected","softSelectable","softSelectedAssetKey","scrollElement","scrollElementProp","onAssetSoftSelectedChanged","component","props","forwardedRef","assetGalleryDOMNode","useRef","assetGalleryCompactRef","useMergedRefs","assetGalleryWidth","minimumRowAspectRatio","calculatedAssets","setAssets","useState","MAXIMUM_ROW_HEIGHT","useMemo","SPACE_BETWEEN_ASSETS","SPACE_UNDER_ASSETS","PRIMARY_SCROLL_BUFFER_HEIGHT","SECONDARY_SCROLL_BUFFER_HEIGHT","GRID_VIEW_MODE_ASSET_MIN_WIDTH","GRID_VIEW_MODE_ASSET_HEIGHT","MISSING_WIDTH_PLACEHOLDER","MISSING_HEIGHT_PLACEHOLDER","isBrowser","window","previousYOffset","pageYOffset","latestYOffset","scrollDirection","useIsomorphicLayoutEffect","current","throttledOnResize","throttle","onResize","resizeObserver","ResizeObserver","observe","entries","forEach","entry","contentRect","width","requestAnimationFrame","main","unobserve","useEffect","calculateAssetGalleryAspectRatio","calculateLayout","calculateVisibility","calculateAspectRatio","assetsWithoutAKey","filter","a","key","length","console","warn","row","translateX","translateY","computedAssets","lastGroup","desiredAssetCountInRow","Math","floor","desiredAssetWidth","asset","index","group","push","title","layout","type","height","round","rowAsset","rowAspectRatio","max","totalDesiredWidthOfImages","rowHeight","assetWidth","hasHeightAndWidth","Boolean","totalGalleryHeight","lastAsset","throttledOnScroll","onScroll","addEventListener","removeEventListener","setScrollPositionAndDirection","newYOffset","bufferTop","bufferBottom","containerOffset","getOffsetTop","scrollerHeight","innerHeight","yOffset","minTranslateYPlusHeight","maxTranslateY","finalizedAssets","map","self","show","elem","offsetTop","isNaN","offsetParent","handleKeyPress","useCallback","e","isElementVisible","el","rect","getBoundingClientRect","vWidth","innerWidth","document","documentElement","clientWidth","vHeight","clientHeight","efp","x","y","elementFromPoint","right","bottom","left","top","contains","softSelectFirstVisibleAsset","visibleAssets","i","children","previousAssetIndex","findIndex","previousAsset","nextAssetIndex","nextAsset","includes","handleClick","createElement","Fragment","S","_extends","ref","style","className","transform","display","justifyContent","AssetGalleryGridCard","selected","extendedSelectMode","softSelected","AssetGalleryCompactCard","collapseExtraInfo","propTypes","process","env","NODE_ENV","PropTypes","arrayOf","shape","assetShape","bool","string","oneOf","number","oneOfType","isRequired","instanceOf","Element","func"],"mappings":";;;;;;;;;;;;AAWMA,MAAAA,gBAAgB,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,gBAAgBA,CACjE;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AAAA;AACvB,CAAC,GAAA,EAAA;;;;"}
@@ -28,7 +28,7 @@ const ComputedRootComponent = ({
28
28
  asset,
29
29
  ...props
30
30
  }) => {
31
- const newProps = mapKeys(omit(props, ['theme', 'extendedSelectMode']), (_, key) => key === 'innerRef' ? 'ref' : key);
31
+ const newProps = mapKeys(omit(props, ['theme', 'extendedSelectMode', 'softSelected', '$softSelected', 'customSelectedBorder', '$customSelectedBorder', 'hasHeightAndWidth', '$hasHeightAndWidth', 'collapseExtraInfo', '$collapseExtraInfo']), (_, key) => key === 'innerRef' ? 'ref' : key);
32
32
  if (component) {
33
33
  if (!isFunction(component)) throw Error('Expected a function in component-prop');
34
34
  if (React__default.isValidElement(component(asset, newProps.children))) {
@@ -226,7 +226,7 @@ const AssetGalleryCompactCard = props => {
226
226
  });
227
227
  }
228
228
  return React__default.createElement(Figure, {
229
- hasHeightAndWidth: hasHeightAndWidth
229
+ $hasHeightAndWidth: hasHeightAndWidth
230
230
  }, previewContent, React__default.createElement(FigureOverlayBackdrop, {
231
231
  selected: selected
232
232
  }));
@@ -340,7 +340,7 @@ const AssetGalleryCompactCard = props => {
340
340
  height: '100%'
341
341
  }
342
342
  }, getReferenceProps()), React__default.createElement(OverlayBackdrop, {
343
- softSelected: softSelected,
343
+ $softSelected: softSelected,
344
344
  selected: selected
345
345
  }), asset?.actions && React__default.createElement(OverlayInfoTopActions, {
346
346
  $isOverlayHovered: isOverlayHovered
@@ -348,7 +348,7 @@ const AssetGalleryCompactCard = props => {
348
348
  actions: asset.actions,
349
349
  asset: asset
350
350
  })), React__default.createElement(OverlayInfo, null, isOverlayHovered && React__default.createElement("span", null, asset.title), React__default.createElement(OverlayInfoTop, null, React__default.createElement(OverlayInfoTopLeft, {
351
- collapseExtraInfo: collapseExtraInfo
351
+ $collapseExtraInfo: collapseExtraInfo
352
352
  }, renderBadge()), asset?.note?.title && React__default.createElement(OverlayInfoTopWarning, {
353
353
  type: asset?.note?.type
354
354
  }, React__default.createElement(SvgWarningCircle, null))), React__default.createElement(OverlayInfoBottom, null, selectable && React__default.createElement(OverlayInfoBottomSelectButton, {
@@ -356,13 +356,13 @@ const AssetGalleryCompactCard = props => {
356
356
  }, React__default.createElement(SvgCheckRectangleFilled, {
357
357
  onClick: onSelectClick
358
358
  })), React__default.createElement(OverlayInfoBottomMediaIcon, null, renderMediaBadge()))), asset.completed && React__default.createElement(OverlayCompleted, {
359
- softSelected: softSelected
359
+ $softSelected: softSelected
360
360
  }), asset.hasError && React__default.createElement(OverlayHasError, {
361
- softSelected: softSelected
361
+ $softSelected: softSelected
362
362
  }), selectable && React__default.createElement(OverlaySelected, {
363
363
  selected: selected,
364
- softSelected: softSelected,
365
- customSelectedBorder: customSelectedBorder
364
+ $softSelected: softSelected,
365
+ $customSelectedBorder: customSelectedBorder
366
366
  }), isOpen && isOverlayHovered && isMounted && activeSummaryCard && !isAnySubActionsOpened && React__default.createElement("div", _extends({
367
367
  ref: refs.setFloating,
368
368
  style: floatingStyles