@leav/ui 1.7.0-e4c50c50 → 1.8.0-26bc59b6

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.
@@ -1,2 +1,2 @@
1
- export declare const getEmbeddedFields: (depth?: number) => any;
1
+ export declare const getEmbeddedFields: (depth?: number) => string;
2
2
  export declare const getAttributeWithEmbeddedFields: (depth: number) => import("graphql").DocumentNode;
@@ -1,5 +1,5 @@
1
1
  declare const useSearchReducer: () => {
2
2
  state: import("./_types").ISearchState;
3
- dispatch: import("react").Dispatch<import("./searchReducer").SearchAction>;
3
+ dispatch: React.Dispatch<import("./searchReducer").SearchAction>;
4
4
  };
5
5
  export default useSearchReducer;
@@ -16,14 +16,14 @@ export const useNotificationsSubscription = () => {
16
16
  if (!data?.data?.notification?.title) {
17
17
  return;
18
18
  }
19
- const { level, title, message, attachments, relatedEntities, date, displayDuration } = data.data.notification;
19
+ const { level, title, message, attachments, relatedEntities, date } = data.data.notification;
20
20
  const kitNotificationLevel = typeof KitNotification[level] === 'function' ? level : 'info';
21
21
  KitNotification[kitNotificationLevel]({
22
22
  closable: true,
23
23
  message: title,
24
24
  description: message,
25
25
  messageExtra: (_jsx(KitTypography.Text, { size: "fontSize7", children: dayjs.unix(date).format('HH:mm DD/MM/YYYY') })),
26
- duration: displayDuration === 0 ? undefined : (displayDuration ?? SUBSCRIPTION_NOTIFICATION_DURATION),
26
+ duration: SUBSCRIPTION_NOTIFICATION_DURATION,
27
27
  footer: (_jsxs(KitSpace, { direction: "horizontal", size: "xs", children: [attachments?.map(attachment => (_jsx(KitButton, { type: "secondary", onClick: () => window.open(attachment.url, '_blank'), icon: _jsx(FontAwesomeIcon, { icon: faDownload }), children: t('global.download') }, attachment.url))), relatedEntities?.map(relatedEntity => (_jsx(KitButton, { type: "secondary", onClick: () => {
28
28
  window.location.href = relatedEntity.url;
29
29
  }, children: relatedEntity.label ?? t('global.show') }, relatedEntity.url)))] })),
@@ -1 +1 @@
1
- {"version":3,"file":"useNotificationSubscription.js","sourceRoot":"","sources":["../../../../src/components/Notifications/hooks/useNotificationSubscription.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,2BAA2B,EAAC,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,eAAe,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAC/E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,UAAU,EAAC,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAC,kCAAkC,EAAC,MAAM,eAAe,CAAC;AAEjE,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,EAAE;IAC7C,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,OAAO,2BAA2B,CAAC;QAC/B,MAAM,EAAE,CAAC,EAAC,IAAI,EAAC,EAAE,EAAE;YACf,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;gBACnC,OAAO;YACX,CAAC;YACD,MAAM,EAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,EAAC,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;YAC5G,MAAM,oBAAoB,GAAG,OAAO,eAAe,CAAC,KAAK,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;YAE3F,eAAe,CAAC,oBAAoB,CAAC,CAAC;gBAClC,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,OAAO;gBACpB,YAAY,EAAE,CACV,KAAC,aAAa,CAAC,IAAI,IAAC,IAAI,EAAC,WAAW,YAC/B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,GAC3B,CACxB;gBACD,QAAQ,EAAE,eAAe,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,eAAe,IAAI,kCAAkC,CAAC;gBACrG,MAAM,EAAE,CACJ,MAAC,QAAQ,IAAC,SAAS,EAAC,YAAY,EAAC,IAAI,EAAC,IAAI,aACrC,WAAW,EAAE,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAC5B,KAAC,SAAS,IAEN,IAAI,EAAC,WAAW,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,EACpD,IAAI,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,UAAU,GAAI,YAE1C,CAAC,CAAC,iBAAiB,CAAC,IALhB,UAAU,CAAC,GAAG,CAMX,CACf,CAAC,EACD,eAAe,EAAE,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC,CACnC,KAAC,SAAS,IAEN,IAAI,EAAC,WAAW,EAChB,OAAO,EAAE,GAAG,EAAE;gCACV,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,aAAa,CAAC,GAAG,CAAC;4BAC7C,CAAC,YAEA,aAAa,CAAC,KAAK,IAAI,CAAC,CAAC,aAAa,CAAC,IANnC,aAAa,CAAC,GAAG,CAOd,CACf,CAAC,IACK,CACd;aACJ,CAAC,CAAC;QACP,CAAC;KACJ,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,eAAe,4BAA4B,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {useNotificationSubscription} from '_ui/_gqlTypes';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {KitButton, KitSpace, KitNotification, KitTypography} from 'aristid-ds';\nimport dayjs from 'dayjs';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faDownload} from '@fortawesome/free-solid-svg-icons';\nimport {SUBSCRIPTION_NOTIFICATION_DURATION} from '_ui/constants';\n\nexport const useNotificationsSubscription = () => {\n const {t} = useSharedTranslation();\n return useNotificationSubscription({\n onData: ({data}) => {\n if (!data?.data?.notification?.title) {\n return;\n }\n const {level, title, message, attachments, relatedEntities, date, displayDuration} = data.data.notification;\n const kitNotificationLevel = typeof KitNotification[level] === 'function' ? level : 'info';\n\n KitNotification[kitNotificationLevel]({\n closable: true,\n message: title,\n description: message,\n messageExtra: (\n <KitTypography.Text size=\"fontSize7\">\n {dayjs.unix(date).format('HH:mm DD/MM/YYYY')}\n </KitTypography.Text>\n ),\n duration: displayDuration === 0 ? undefined : (displayDuration ?? SUBSCRIPTION_NOTIFICATION_DURATION),\n footer: (\n <KitSpace direction=\"horizontal\" size=\"xs\">\n {attachments?.map(attachment => (\n <KitButton\n key={attachment.url}\n type=\"secondary\"\n onClick={() => window.open(attachment.url, '_blank')}\n icon={<FontAwesomeIcon icon={faDownload} />}\n >\n {t('global.download')}\n </KitButton>\n ))}\n {relatedEntities?.map(relatedEntity => (\n <KitButton\n key={relatedEntity.url}\n type=\"secondary\"\n onClick={() => {\n window.location.href = relatedEntity.url;\n }}\n >\n {relatedEntity.label ?? t('global.show')}\n </KitButton>\n ))}\n </KitSpace>\n ),\n });\n },\n });\n};\n\nexport default useNotificationsSubscription;\n"]}
1
+ {"version":3,"file":"useNotificationSubscription.js","sourceRoot":"","sources":["../../../../src/components/Notifications/hooks/useNotificationSubscription.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,2BAA2B,EAAC,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAC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CAAC,UAAU,CAAC,EAAE,CAAC,CAC5B,KAAC,SAAS,IAEN,IAAI,EAAC,WAAW,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,EACpD,IAAI,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,UAAU,GAAI,YAE1C,CAAC,CAAC,iBAAiB,CAAC,IALhB,UAAU,CAAC,GAAG,CAMX,CACf,CAAC,EACD,eAAe,EAAE,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC,CACnC,KAAC,SAAS,IAEN,IAAI,EAAC,WAAW,EAChB,OAAO,EAAE,GAAG,EAAE;gCACV,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,aAAa,CAAC,GAAG,CAAC;4BAC7C,CAAC,YAEA,aAAa,CAAC,KAAK,IAAI,CAAC,CAAC,aAAa,CAAC,IANnC,aAAa,CAAC,GAAG,CAOd,CACf,CAAC,IACK,CACd;aACJ,CAAC,CAAC;QACP,CAAC;KACJ,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,eAAe,4BAA4B,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {useNotificationSubscription} from '_ui/_gqlTypes';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {KitButton, KitSpace, KitNotification, KitTypography} from 'aristid-ds';\nimport dayjs from 'dayjs';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faDownload} from '@fortawesome/free-solid-svg-icons';\nimport {SUBSCRIPTION_NOTIFICATION_DURATION} from '_ui/constants';\n\nexport const useNotificationsSubscription = () => {\n const {t} = useSharedTranslation();\n return useNotificationSubscription({\n onData: ({data}) => {\n if (!data?.data?.notification?.title) {\n return;\n }\n const {level, title, message, attachments, relatedEntities, date} = data.data.notification;\n const kitNotificationLevel = typeof KitNotification[level] === 'function' ? level : 'info';\n\n KitNotification[kitNotificationLevel]({\n closable: true,\n message: title,\n description: message,\n messageExtra: (\n <KitTypography.Text size=\"fontSize7\">\n {dayjs.unix(date).format('HH:mm DD/MM/YYYY')}\n </KitTypography.Text>\n ),\n duration: SUBSCRIPTION_NOTIFICATION_DURATION,\n footer: (\n <KitSpace direction=\"horizontal\" size=\"xs\">\n {attachments?.map(attachment => (\n <KitButton\n key={attachment.url}\n type=\"secondary\"\n onClick={() => window.open(attachment.url, '_blank')}\n icon={<FontAwesomeIcon icon={faDownload} />}\n >\n {t('global.download')}\n </KitButton>\n ))}\n {relatedEntities?.map(relatedEntity => (\n <KitButton\n key={relatedEntity.url}\n type=\"secondary\"\n onClick={() => {\n window.location.href = relatedEntity.url;\n }}\n >\n {relatedEntity.label ?? t('global.show')}\n </KitButton>\n ))}\n </KitSpace>\n ),\n });\n },\n });\n};\n\nexport default useNotificationsSubscription;\n"]}
@@ -8,4 +8,6 @@ export declare const getExtendedAttributeDiffs: (extendedValueBefore: unknown |
8
8
  before: string | null;
9
9
  after: string | null;
10
10
  }>;
11
- export declare const getExtendedAttributeLabels: (path: string, embeddedFields: IEmbeddedField[], lang: string[], unknownAttributeLabel: string) => string[];
11
+ export declare const getExtendedAttributeLabels: (path: string, // dot separated path
12
+ embeddedFields: IEmbeddedField[], // root embedded fields
13
+ lang: string[], unknownAttributeLabel: string) => string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leav/ui",
3
- "version": "1.7.0-e4c50c50",
3
+ "version": "1.8.0-26bc59b6",
4
4
  "description": "Shared React components and hooks",
5
5
  "scripts": {
6
6
  "prepublishOnly": "yarn build",
@@ -25,7 +25,7 @@
25
25
  "repository": "https://github.com/leav-solutions/leav-engine",
26
26
  "devDependencies": {
27
27
  "@apollo/client": "3.8.1",
28
- "@babel/preset-env": "7.28.6",
28
+ "@babel/preset-env": "7.29.0",
29
29
  "@babel/preset-react": "7.28.5",
30
30
  "@graphql-codegen/add": "5.0.3",
31
31
  "@graphql-codegen/cli": "6.1.1",
@@ -57,7 +57,7 @@
57
57
  "react-router-dom": "6.22.0",
58
58
  "ts-jest": "29.4.6",
59
59
  "tsc-alias": "1.8.16",
60
- "typescript": "5.5.3",
60
+ "typescript": "5.9.3",
61
61
  "vite": "7.3.1"
62
62
  },
63
63
  "peerDependencies": {
@@ -80,7 +80,7 @@
80
80
  "@fortawesome/free-regular-svg-icons": "7.0.1",
81
81
  "@fortawesome/free-solid-svg-icons": "7.0.1",
82
82
  "@fortawesome/react-fontawesome": "3.0.2",
83
- "@leav/utils": "1.7.0",
83
+ "@leav/utils": "1.8.0",
84
84
  "@uidotdev/usehooks": "2.4.1",
85
85
  "dayjs": "^1.11.13",
86
86
  "dompurify": "3.2.4",