@performant-software/semantic-components 0.5.16-beta.3 → 0.5.16-beta.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@performant-software/semantic-components",
3
- "version": "0.5.16-beta.3",
3
+ "version": "0.5.16-beta.4",
4
4
  "description": "A package of shared components based on the Semantic UI Framework.",
5
5
  "license": "MIT",
6
6
  "main": "./build/index.js",
@@ -12,7 +12,7 @@
12
12
  "build": "webpack --mode production && flow-copy-source -v src types"
13
13
  },
14
14
  "dependencies": {
15
- "@performant-software/shared-components": "^0.5.16-beta.3",
15
+ "@performant-software/shared-components": "^0.5.16-beta.4",
16
16
  "@react-google-maps/api": "^2.8.1",
17
17
  "axios": "^0.26.1",
18
18
  "i18next": "^19.4.4",
@@ -33,7 +33,7 @@
33
33
  "react-dom": ">= 16.13.1 < 18.0.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@performant-software/webpack-config": "^0.5.16-beta.3",
36
+ "@performant-software/webpack-config": "^0.5.16-beta.4",
37
37
  "flow-copy-source": "^2.0.9",
38
38
  "less": "^4.1.2",
39
39
  "less-loader": "^11.0.0",
@@ -2,16 +2,18 @@
2
2
 
3
3
  import React, { useState, type Node } from 'react';
4
4
  import { Button } from 'semantic-ui-react';
5
+ import _ from 'underscore';
5
6
  import i18n from '../i18n/i18n';
6
7
  import IIIFModal from './IIIFModal';
7
8
  import LazyMedia from './LazyMedia';
8
9
 
9
10
  type Props = {
10
11
  children?: Node,
11
- manifest?: string
12
+ manifest?: string,
13
+ options?: any
12
14
  };
13
15
 
14
- const LazyIIIF = (props: Props) => {
16
+ const LazyIIIF = ({ manifest, options = {}, ...props }: Props) => {
15
17
  const [modal, setModal] = useState(false);
16
18
 
17
19
  return (
@@ -19,7 +21,7 @@ const LazyIIIF = (props: Props) => {
19
21
  <LazyMedia
20
22
  {...props}
21
23
  >
22
- { props.manifest && (
24
+ { manifest && (
23
25
  <Button
24
26
  content={i18n.t('Common.buttons.open')}
25
27
  icon='images outline'
@@ -30,11 +32,9 @@ const LazyIIIF = (props: Props) => {
30
32
  </LazyMedia>
31
33
  { modal && (
32
34
  <IIIFModal
33
- manifestId={props.manifest}
35
+ manifestId={manifest}
34
36
  onClose={() => setModal(false)}
35
- options={{
36
- showIIIFBadge: false
37
- }}
37
+ options={_.defaults(options, { showIIIFBadge: false })}
38
38
  />
39
39
  )}
40
40
  </>
@@ -2,16 +2,18 @@
2
2
 
3
3
  import React, { useState, type Node } from 'react';
4
4
  import { Button } from 'semantic-ui-react';
5
+ import _ from 'underscore';
5
6
  import i18n from '../i18n/i18n';
6
7
  import IIIFModal from './IIIFModal';
7
8
  import LazyMedia from './LazyMedia';
8
9
 
9
10
  type Props = {
10
11
  children?: Node,
11
- manifest?: string
12
+ manifest?: string,
13
+ options?: any
12
14
  };
13
15
 
14
- const LazyIIIF = (props: Props) => {
16
+ const LazyIIIF = ({ manifest, options = {}, ...props }: Props) => {
15
17
  const [modal, setModal] = useState(false);
16
18
 
17
19
  return (
@@ -19,7 +21,7 @@ const LazyIIIF = (props: Props) => {
19
21
  <LazyMedia
20
22
  {...props}
21
23
  >
22
- { props.manifest && (
24
+ { manifest && (
23
25
  <Button
24
26
  content={i18n.t('Common.buttons.open')}
25
27
  icon='images outline'
@@ -30,11 +32,9 @@ const LazyIIIF = (props: Props) => {
30
32
  </LazyMedia>
31
33
  { modal && (
32
34
  <IIIFModal
33
- manifestId={props.manifest}
35
+ manifestId={manifest}
34
36
  onClose={() => setModal(false)}
35
- options={{
36
- showIIIFBadge: false
37
- }}
37
+ options={_.defaults(options, { showIIIFBadge: false })}
38
38
  />
39
39
  )}
40
40
  </>