@reykjavik/hanna-react 0.10.153 → 0.10.154

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/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@
4
4
 
5
5
  - ... <!-- Add new lines here. -->
6
6
 
7
+ ## 0.10.154
8
+
9
+ _2025-06-20_
10
+
11
+ - feat: Add optional `inline` prop to `LayoutProps.customLogo`
12
+ - fix: `ImageProps.inline` should not fail to replace with an empty result
13
+
7
14
  ## 0.10.153
8
15
 
9
16
  _2025-06-19_
@@ -1,6 +1,7 @@
1
1
  export declare const renderLayoutHomeLink: (bem: string, logoLink: string, siteName?: string, customLogo?: {
2
2
  src: string;
3
3
  altText: string;
4
+ inline?: boolean;
4
5
  }) => JSX.Element;
5
6
  export declare const issueSiteNameWarningInDev: (props: {
6
7
  siteName?: string;
@@ -15,7 +15,7 @@ const renderLayoutHomeLink = (bem, logoLink, siteName, customLogo) => {
15
15
  return (react_1.default.createElement(_Link_js_1.Link, { className: `${bem}__header__homelink`, href: logoLink },
16
16
  ' ',
17
17
  react_1.default.createElement(_Image_js_1.Image, { bem: undefined, className: (0, hanna_utils_1.modifiedClass)(`${bem}__header__logo`, customLogo && 'custom'), src: (customLogo === null || customLogo === void 0 ? void 0 : customLogo.src) ||
18
- (0, assets_1.getRvkLogoUrl)(siteName ? 'reykjavik-logo-notext.svg' : 'reykjavik-logo.svg'), altText: (customLogo === null || customLogo === void 0 ? void 0 : customLogo.altText) || 'Reykjavík', inline: true }),
18
+ (0, assets_1.getRvkLogoUrl)(siteName ? 'reykjavik-logo-notext.svg' : 'reykjavik-logo.svg'), altText: (customLogo === null || customLogo === void 0 ? void 0 : customLogo.altText) || 'Reykjavík', inline: customLogo ? customLogo.inline : true }),
19
19
  ' ',
20
20
  siteName && react_1.default.createElement("span", { className: `${bem}__header__sitename` }, siteName),
21
21
  ' '));
@@ -1,6 +1,7 @@
1
1
  export declare const renderLayoutHomeLink: (bem: string, logoLink: string, siteName?: string, customLogo?: {
2
2
  src: string;
3
3
  altText: string;
4
+ inline?: boolean;
4
5
  }) => JSX.Element;
5
6
  export declare const issueSiteNameWarningInDev: (props: {
6
7
  siteName?: string;
@@ -11,7 +11,7 @@ export const renderLayoutHomeLink = (bem, logoLink, siteName, customLogo) => {
11
11
  return (React.createElement(Link, { className: `${bem}__header__homelink`, href: logoLink },
12
12
  ' ',
13
13
  React.createElement(Image, { bem: undefined, className: modifiedClass(`${bem}__header__logo`, customLogo && 'custom'), src: (customLogo === null || customLogo === void 0 ? void 0 : customLogo.src) ||
14
- getRvkLogoUrl(siteName ? 'reykjavik-logo-notext.svg' : 'reykjavik-logo.svg'), altText: (customLogo === null || customLogo === void 0 ? void 0 : customLogo.altText) || 'Reykjavík', inline: true }),
14
+ getRvkLogoUrl(siteName ? 'reykjavik-logo-notext.svg' : 'reykjavik-logo.svg'), altText: (customLogo === null || customLogo === void 0 ? void 0 : customLogo.altText) || 'Reykjavík', inline: customLogo ? customLogo.inline : true }),
15
15
  ' ',
16
16
  siteName && React.createElement("span", { className: `${bem}__header__sitename` }, siteName),
17
17
  ' '));
@@ -10,6 +10,9 @@ export const useGetSVGtext = (imageSrc, altText) => {
10
10
  useEffect(() => {
11
11
  if (imageSrc) {
12
12
  getSVGtext(imageSrc, altText).then((code) => {
13
+ if (!code) {
14
+ return;
15
+ }
13
16
  if (imageSrc === srcRef.current) {
14
17
  setInlineSvg({ imageSrc, code });
15
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reykjavik/hanna-react",
3
- "version": "0.10.153",
3
+ "version": "0.10.154",
4
4
  "author": "Reykjavík (http://www.reykjavik.is)",
5
5
  "contributors": [
6
6
  "Hugsmiðjan ehf (http://www.hugsmidjan.is)",
@@ -17,7 +17,7 @@
17
17
  "@floating-ui/react": "^0.19.2",
18
18
  "@hugsmidjan/qj": "^4.22.1",
19
19
  "@hugsmidjan/react": "^0.4.32",
20
- "@reykjavik/hanna-css": "^0.4.18",
20
+ "@reykjavik/hanna-css": "^0.4.19",
21
21
  "@reykjavik/hanna-utils": "^0.2.21",
22
22
  "@types/react-autosuggest": "^10.1.0",
23
23
  "@types/react-datepicker": "^4.8.0",
@@ -13,6 +13,9 @@ const useGetSVGtext = (imageSrc, altText) => {
13
13
  (0, react_1.useEffect)(() => {
14
14
  if (imageSrc) {
15
15
  (0, hanna_utils_1.getSVGtext)(imageSrc, altText).then((code) => {
16
+ if (!code) {
17
+ return;
18
+ }
16
19
  if (imageSrc === srcRef.current) {
17
20
  setInlineSvg({ imageSrc, code });
18
21
  }