@equinor/fusion-framework-react-components-bookmark 0.0.0-context-error-20240131144633

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.
Files changed (93) hide show
  1. package/CHANGELOG.md +317 -0
  2. package/LICENSE +21 -0
  3. package/dist/esm/components/Bookmark.js +61 -0
  4. package/dist/esm/components/Bookmark.js.map +1 -0
  5. package/dist/esm/components/BookmarkProvider.js +33 -0
  6. package/dist/esm/components/BookmarkProvider.js.map +1 -0
  7. package/dist/esm/components/create-bookmark/CreateBookmark.js +34 -0
  8. package/dist/esm/components/create-bookmark/CreateBookmark.js.map +1 -0
  9. package/dist/esm/components/create-bookmark/index.js +2 -0
  10. package/dist/esm/components/create-bookmark/index.js.map +1 -0
  11. package/dist/esm/components/edit-bookmark/EditBookmark.js +65 -0
  12. package/dist/esm/components/edit-bookmark/EditBookmark.js.map +1 -0
  13. package/dist/esm/components/edit-bookmark/index.js +2 -0
  14. package/dist/esm/components/edit-bookmark/index.js.map +1 -0
  15. package/dist/esm/components/filter/Filter.js +19 -0
  16. package/dist/esm/components/filter/Filter.js.map +1 -0
  17. package/dist/esm/components/import-bookmark/ImportBookmark.js +28 -0
  18. package/dist/esm/components/import-bookmark/ImportBookmark.js.map +1 -0
  19. package/dist/esm/components/import-bookmark/index.js +2 -0
  20. package/dist/esm/components/import-bookmark/index.js.map +1 -0
  21. package/dist/esm/components/loading/Loading.js +10 -0
  22. package/dist/esm/components/loading/Loading.js.map +1 -0
  23. package/dist/esm/components/messages/Message.js +45 -0
  24. package/dist/esm/components/messages/Message.js.map +1 -0
  25. package/dist/esm/components/row/MoreMenu.js +11 -0
  26. package/dist/esm/components/row/MoreMenu.js.map +1 -0
  27. package/dist/esm/components/row/Row.js +47 -0
  28. package/dist/esm/components/row/Row.js.map +1 -0
  29. package/dist/esm/components/section/Section.js +41 -0
  30. package/dist/esm/components/section/Section.js.map +1 -0
  31. package/dist/esm/components/sectionList/SectionList.js +94 -0
  32. package/dist/esm/components/sectionList/SectionList.js.map +1 -0
  33. package/dist/esm/components/shared/SharedIcon.js +28 -0
  34. package/dist/esm/components/shared/SharedIcon.js.map +1 -0
  35. package/dist/esm/hooks/index.js +2 -0
  36. package/dist/esm/hooks/index.js.map +1 -0
  37. package/dist/esm/hooks/useBookmarkGrouping.js +35 -0
  38. package/dist/esm/hooks/useBookmarkGrouping.js.map +1 -0
  39. package/dist/esm/index.js +3 -0
  40. package/dist/esm/index.js.map +1 -0
  41. package/dist/esm/utils/append-bookmark-to-uri.js +6 -0
  42. package/dist/esm/utils/append-bookmark-to-uri.js.map +1 -0
  43. package/dist/esm/utils/utils.js +7 -0
  44. package/dist/esm/utils/utils.js.map +1 -0
  45. package/dist/esm/version.js +2 -0
  46. package/dist/esm/version.js.map +1 -0
  47. package/dist/tsconfig.tsbuildinfo +1 -0
  48. package/dist/types/components/Bookmark.d.ts +2 -0
  49. package/dist/types/components/BookmarkProvider.d.ts +14 -0
  50. package/dist/types/components/create-bookmark/CreateBookmark.d.ts +4 -0
  51. package/dist/types/components/create-bookmark/index.d.ts +1 -0
  52. package/dist/types/components/edit-bookmark/EditBookmark.d.ts +5 -0
  53. package/dist/types/components/edit-bookmark/index.d.ts +1 -0
  54. package/dist/types/components/filter/Filter.d.ts +10 -0
  55. package/dist/types/components/import-bookmark/ImportBookmark.d.ts +1 -0
  56. package/dist/types/components/import-bookmark/index.d.ts +1 -0
  57. package/dist/types/components/loading/Loading.d.ts +1 -0
  58. package/dist/types/components/messages/Message.d.ts +10 -0
  59. package/dist/types/components/row/MoreMenu.d.ts +10 -0
  60. package/dist/types/components/row/Row.d.ts +17 -0
  61. package/dist/types/components/section/Section.d.ts +7 -0
  62. package/dist/types/components/sectionList/SectionList.d.ts +6 -0
  63. package/dist/types/components/shared/SharedIcon.d.ts +6 -0
  64. package/dist/types/hooks/index.d.ts +1 -0
  65. package/dist/types/hooks/useBookmarkGrouping.d.ts +14 -0
  66. package/dist/types/index.d.ts +2 -0
  67. package/dist/types/utils/append-bookmark-to-uri.d.ts +1 -0
  68. package/dist/types/utils/utils.d.ts +6 -0
  69. package/dist/types/version.d.ts +1 -0
  70. package/package.json +55 -0
  71. package/src/components/Bookmark.tsx +95 -0
  72. package/src/components/BookmarkProvider.tsx +65 -0
  73. package/src/components/create-bookmark/CreateBookmark.tsx +93 -0
  74. package/src/components/create-bookmark/index.ts +1 -0
  75. package/src/components/edit-bookmark/EditBookmark.tsx +137 -0
  76. package/src/components/edit-bookmark/index.ts +1 -0
  77. package/src/components/filter/Filter.tsx +58 -0
  78. package/src/components/import-bookmark/ImportBookmark.tsx +57 -0
  79. package/src/components/import-bookmark/index.ts +1 -0
  80. package/src/components/loading/Loading.tsx +16 -0
  81. package/src/components/messages/Message.tsx +82 -0
  82. package/src/components/row/MoreMenu.tsx +34 -0
  83. package/src/components/row/Row.tsx +92 -0
  84. package/src/components/section/Section.tsx +57 -0
  85. package/src/components/sectionList/SectionList.tsx +161 -0
  86. package/src/components/shared/SharedIcon.tsx +45 -0
  87. package/src/hooks/index.ts +1 -0
  88. package/src/hooks/useBookmarkGrouping.ts +54 -0
  89. package/src/index.ts +2 -0
  90. package/src/utils/append-bookmark-to-uri.ts +5 -0
  91. package/src/utils/utils.ts +12 -0
  92. package/src/version.ts +2 -0
  93. package/tsconfig.json +23 -0
@@ -0,0 +1,2 @@
1
+ export * from './ImportBookmark';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/import-bookmark/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { CircularProgress } from '@equinor/eds-core-react';
3
+ export const Loading = () => (_jsx("div", { style: {
4
+ display: 'flex',
5
+ alignItems: 'center',
6
+ justifyContent: 'center',
7
+ height: '100%',
8
+ width: '100%',
9
+ }, children: _jsx(CircularProgress, {}) }));
10
+ //# sourceMappingURL=Loading.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Loading.js","sourceRoot":"","sources":["../../../../src/components/loading/Loading.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,CACzB,cACI,KAAK,EAAE;QACH,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;KAChB,YAED,KAAC,gBAAgB,KAAG,GAClB,CACT,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Icon, Typography } from '@equinor/eds-core-react';
3
+ import { tokens } from '@equinor/eds-tokens';
4
+ import styled from 'styled-components';
5
+ import { error_outlined, file_description } from '@equinor/eds-icons';
6
+ const getMessageType = (type) => {
7
+ switch (type) {
8
+ case 'Error':
9
+ return { color: tokens.colors.interactive.danger__resting.hex, icon: error_outlined };
10
+ case 'Info':
11
+ return { color: tokens.colors.interactive.primary__resting.hex, icon: error_outlined };
12
+ case 'Warning':
13
+ return { color: tokens.colors.interactive.warning__resting.hex, icon: error_outlined };
14
+ case 'NoContent':
15
+ return {
16
+ color: tokens.colors.interactive.primary__resting.hex,
17
+ icon: file_description,
18
+ };
19
+ default:
20
+ return undefined;
21
+ }
22
+ };
23
+ const Styles = {
24
+ Wrapper: styled.div `
25
+ width: 100%;
26
+ height: 100%;
27
+ display: flex;
28
+ flex-direction: column;
29
+ align-items: center;
30
+ gap: 1rem;
31
+ justify-content: center;
32
+ `,
33
+ Content: styled.div `
34
+ display: flex;
35
+ flex-direction: column;
36
+ align-items: center;
37
+ gap: 0.5rem;
38
+ justify-content: center;
39
+ `,
40
+ };
41
+ export const Message = ({ title, type = 'Info', color, children, }) => {
42
+ const currentType = getMessageType(type);
43
+ return (_jsxs(Styles.Wrapper, { children: [_jsx(Icon, { "data-testid": "icon", size: 40, color: (currentType === null || currentType === void 0 ? void 0 : currentType.color) || color || tokens.colors.text.static_icons__tertiary.hex, data: (currentType === null || currentType === void 0 ? void 0 : currentType.icon) || error_outlined }), _jsxs(Styles.Content, { children: [_jsx(Typography, { color: tokens.colors.text.static_icons__default.hex, variant: 'h3', "aria-label": `Title for ${type} message`, children: title }), _jsx(Typography, { children: children && children })] })] }));
44
+ };
45
+ //# sourceMappingURL=Message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Message.js","sourceRoot":"","sources":["../../../../src/components/messages/Message.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItE,MAAM,cAAc,GAAG,CAAC,IAAwB,EAAE,EAAE;IAChD,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,OAAO;YACR,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,GAAG,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;QAC1F,KAAK,MAAM;YACP,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;QAC3F,KAAK,SAAS;YACV,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;QAC3F,KAAK,WAAW;YACZ,OAAO;gBACH,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,GAAG;gBACrD,IAAI,EAAE,gBAAgB;aACzB,CAAC;QACN;YACI,OAAO,SAAS,CAAC;IACzB,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG;IACX,OAAO,EAAE,MAAM,CAAC,GAAG,CAAA;;;;;;;;KAQlB;IACD,OAAO,EAAE,MAAM,CAAC,GAAG,CAAA;;;;;;KAMlB;CACJ,CAAC;AASF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EACpB,KAAK,EACL,IAAI,GAAG,MAAM,EACb,KAAK,EACL,QAAQ,GACsB,EAAE,EAAE;IAClC,MAAM,WAAW,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IACzC,OAAO,CACH,MAAC,MAAM,CAAC,OAAO,eACX,KAAC,IAAI,mBACW,MAAM,EAClB,IAAI,EAAE,EAAE,EACR,KAAK,EAAE,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,KAAI,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,GAAG,EACnF,IAAI,EAAE,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,KAAI,cAAc,GAC3C,EACF,MAAC,MAAM,CAAC,OAAO,eACX,KAAC,UAAU,IACP,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,EACnD,OAAO,EAAE,IAAI,gBACD,aAAa,IAAI,UAAU,YAEtC,KAAK,GACG,EAEb,KAAC,UAAU,cAAE,QAAQ,IAAI,QAAQ,GAAc,IAClC,IACJ,CACpB,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { Menu } from '@equinor/eds-core-react';
3
+ export const MoreMenu = ({ pRef, onClose, open, options }) => {
4
+ return (_jsx(Menu, { open: open, anchorEl: pRef.current, children: options.map(({ onClick, name, disabled, Icon }) => (_jsx(Menu.Item, { disabled: disabled, onClick: (e) => {
5
+ e.stopPropagation();
6
+ e.preventDefault();
7
+ onClick();
8
+ onClose();
9
+ }, children: _jsxs(_Fragment, { children: [Icon && Icon, name] }) }, name))) }));
10
+ };
11
+ //# sourceMappingURL=MoreMenu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MoreMenu.js","sourceRoot":"","sources":["../../../../src/components/row/MoreMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAW/C,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAa,EAAE,EAAE;IACpE,OAAO,CACH,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,YACnC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAChD,KAAC,IAAI,CAAC,IAAI,IACN,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gBACX,CAAC,CAAC,eAAe,EAAE,CAAC;gBACpB,CAAC,CAAC,cAAc,EAAE,CAAC;gBACnB,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,CAAC;YACd,CAAC,YAGD,8BACK,IAAI,IAAI,IAAI,EACZ,IAAI,IACN,IALE,IAAI,CAMD,CACf,CAAC,GACC,CACV,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Icon, Typography } from '@equinor/eds-core-react';
3
+ import { tokens } from '@equinor/eds-tokens';
4
+ import { useOutsideClick } from '@equinor/eds-utils';
5
+ import { useBookmark } from '@equinor/fusion-framework-react-module-bookmark';
6
+ import { useRef } from 'react';
7
+ import { MoreMenu } from './MoreMenu';
8
+ import styled from 'styled-components';
9
+ const Styled = {
10
+ Icons: styled.div `
11
+ display: flex;
12
+ flex-direction: row;
13
+ gap: 0.2em;
14
+ align-items: center;
15
+ `,
16
+ ListItem: styled.div `
17
+ cursor: pointer;
18
+ &:hover {
19
+ background-color: ${tokens.colors.ui.background__light.hex};
20
+ }
21
+
22
+ display: flex;
23
+ align-items: center;
24
+ height: 32px;
25
+ min-height: 32px;
26
+ max-height: 32px;
27
+ justify-content: space-between;
28
+ border-bottom: 1px solid ${tokens.colors.ui.background__medium.hex};
29
+ `,
30
+ };
31
+ export const Row = ({ name, menuOptions, children, id, menuOpen, onMenuOpen }) => {
32
+ const pRef = useRef(null);
33
+ const { setCurrentBookmark } = useBookmark();
34
+ useOutsideClick(pRef.current, () => onMenuOpen(''));
35
+ return (_jsxs(Styled.ListItem, { onClick: (e) => {
36
+ e.preventDefault();
37
+ e.stopPropagation();
38
+ setCurrentBookmark(id);
39
+ }, children: [_jsx(Typography, { children: name }), _jsxs(Styled.Icons, { children: [children, !!(menuOptions === null || menuOptions === void 0 ? void 0 : menuOptions.length) && (_jsx(Icon, { name: "more_vertical", onClick: (e) => {
40
+ e.preventDefault();
41
+ e.stopPropagation();
42
+ onMenuOpen(id);
43
+ }, color: tokens.colors.interactive.primary__resting.hex, ref: pRef })), _jsx(MoreMenu, { open: menuOpen, options: menuOptions, onClose: () => {
44
+ onMenuOpen('');
45
+ }, pRef: pRef })] })] }));
46
+ };
47
+ //# sourceMappingURL=Row.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Row.js","sourceRoot":"","sources":["../../../../src/components/row/Row.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAA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EAAE;4BACX,CAAC,CAAC,cAAc,EAAE,CAAC;4BACnB,CAAC,CAAC,eAAe,EAAE,CAAC;4BACpB,UAAU,CAAC,EAAE,CAAC,CAAC;wBACnB,CAAC,EACD,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,GAAG,EACrD,GAAG,EAAE,IAAkD,GACzD,CACL,EAED,KAAC,QAAQ,IACL,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,GAAG,EAAE;4BACV,UAAU,CAAC,EAAE,CAAC,CAAC;wBACnB,CAAC,EACD,IAAI,EAAE,IAAI,GACZ,IACS,IACD,CACrB,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Button, Icon, Typography } from '@equinor/eds-core-react';
4
+ import { chevron_down, chevron_right } from '@equinor/eds-icons';
5
+ import { tokens } from '@equinor/eds-tokens';
6
+ import styled from 'styled-components';
7
+ const Styled = {
8
+ Button: styled(Button) `
9
+ width: 100%;
10
+ padding: 0;
11
+ padding-top: 0.5rem;
12
+ margin-bottom: 0.5rem;
13
+ display: flex;
14
+ justify-content: space-between;
15
+ align-items: center;
16
+ background: none;
17
+ border: none;
18
+ color: ${tokens.colors.infographic.primary__moss_green_100.hex};
19
+ cursor: pointer;
20
+ :hover {
21
+ background: none;
22
+ }
23
+ `,
24
+ List: styled.ol `
25
+ margin-left: 0.7rem;
26
+ padding-left: 1rem;
27
+ display: flex;
28
+ flex-direction: column;
29
+ gap: 1rem;
30
+ border-left: 1px solid ${tokens.colors.infographic.primary__moss_green_100.hex};
31
+ `,
32
+ };
33
+ Icon.add({
34
+ chevron_down,
35
+ chevron_right,
36
+ });
37
+ export const Section = ({ children, name }) => {
38
+ const [isExpanded, setIsExpanded] = useState(true);
39
+ return (_jsxs("div", { children: [_jsxs(Styled.Button, { variant: "ghost", onClick: () => setIsExpanded((s) => !s), children: [_jsx(Icon, { name: isExpanded ? chevron_down.name : chevron_right.name }), _jsx(Typography, { variant: "h6", children: name })] }), isExpanded && _jsx(Styled.List, { children: children })] }));
40
+ };
41
+ //# sourceMappingURL=Section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Section.js","sourceRoot":"","sources":["../../../../src/components/section/Section.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,MAAM,GAAG;IACX,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;;;;;;;;;;iBAUT,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,uBAAuB,CAAC,GAAG;;;;;KAKjE;IACD,IAAI,EAAE,MAAM,CAAC,EAAE,CAAA;;;;;;iCAMc,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,uBAAuB,CAAC,GAAG;KACjF;CACJ,CAAC;AAEF,IAAI,CAAC,GAAG,CAAC;IACL,YAAY;IACZ,aAAa;CAChB,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAgB,EAAE,EAAE;IACxD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEnD,OAAO,CACH,0BACI,MAAC,MAAM,CAAC,MAAM,IAAC,OAAO,EAAC,OAAO,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,aAClE,KAAC,IAAI,IAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,GAAI,EACnE,KAAC,UAAU,IAAC,OAAO,EAAC,IAAI,YAAE,IAAI,GAAc,IAChC,EACf,UAAU,IAAI,KAAC,MAAM,CAAC,IAAI,cAAE,QAAQ,GAAe,IAClD,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,94 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Icon } from '@equinor/eds-core-react';
3
+ import { Row } from '../row/Row';
4
+ import { Section } from '../section/Section';
5
+ import { SharedIcon } from '../shared/SharedIcon';
6
+ import { useBookmark } from '@equinor/fusion-framework-react-module-bookmark';
7
+ import { useCurrentUser } from '@equinor/fusion-framework-react/hooks';
8
+ import { useCallback, useState } from 'react';
9
+ import { delete_to_trash, share, edit, close, update } from '@equinor/eds-icons';
10
+ import { useFramework } from '@equinor/fusion-framework-react';
11
+ import { appendBookmarkIdToUrl } from '../../utils/append-bookmark-to-uri';
12
+ import { filterEmptyGroups, sortByName, toHumanReadable } from '../../utils/utils';
13
+ Icon.add({
14
+ delete_to_trash,
15
+ edit,
16
+ share,
17
+ close,
18
+ update,
19
+ });
20
+ export const SectionList = ({ bookmarkGroups }) => {
21
+ const { deleteBookmarkById, getCurrentAppKey, updateBookmark, removeBookmarkFavorite } = useBookmark();
22
+ const user = useCurrentUser();
23
+ const [isMenuByIdOpen, setIsMenuByIdOpen] = useState('');
24
+ const { event } = useFramework().modules;
25
+ const editBookmark = useCallback((bookmarkId) => {
26
+ event.dispatchEvent('onBookmarkEdit', { detail: { bookmarkId } });
27
+ }, [event]);
28
+ const shareBookmark = useCallback((bookmark) => {
29
+ if (!bookmark.isShared) {
30
+ const url = appendBookmarkIdToUrl(bookmark.id);
31
+ navigator.clipboard.writeText(url);
32
+ event.dispatchEvent('onBookmarkUrlCopy', { detail: { url } });
33
+ }
34
+ updateBookmark(Object.assign(Object.assign({}, bookmark), { isShared: !bookmark.isShared }));
35
+ }, [event, updateBookmark]);
36
+ const updateBookmarkWithCurrentView = useCallback((bookmark) => {
37
+ updateBookmark(Object.assign({}, bookmark), { updatePayload: true });
38
+ }, [updateBookmark]);
39
+ const createMenuOptions = (bookmark) => createBookmarkActions(bookmark, deleteBookmarkById, editBookmark, shareBookmark, removeBookmarkFavorite, updateBookmarkWithCurrentView, getCurrentAppKey(), user === null || user === void 0 ? void 0 : user.localAccountId);
40
+ return (_jsx(_Fragment, { children: bookmarkGroups.filter(filterEmptyGroups).map(({ groupingProperty, values }) => (_jsx(Section, { name: toHumanReadable(groupingProperty), children: values.sort(sortByName).map((b) => (_jsx(Row, { menuOptions: createMenuOptions(b), name: b.name, id: b.id, menuOpen: isMenuByIdOpen === b.id, onMenuOpen: (id) => {
41
+ setIsMenuByIdOpen(id);
42
+ }, children: b.isShared && (_jsx(SharedIcon, { createdById: b.createdBy.azureUniqueId, createdBy: b.createdBy.name })) }, b.id))) }, groupingProperty))) }));
43
+ };
44
+ function createBookmarkActions(bookmark, deleteBookmarkById, editBookmark, shareBookmark, removeBookmarkFavorite, updateBookmarkWithCurrentView, appKey, localAccountId) {
45
+ if (bookmark.createdBy.azureUniqueId === localAccountId) {
46
+ return [
47
+ {
48
+ name: 'Edit',
49
+ disabled: appKey !== bookmark.appKey,
50
+ onClick: () => {
51
+ editBookmark(bookmark.id);
52
+ },
53
+ Icon: _jsx(Icon, { name: "edit" }),
54
+ },
55
+ {
56
+ name: 'Update with current view',
57
+ disabled: appKey !== bookmark.appKey,
58
+ onClick: () => {
59
+ updateBookmarkWithCurrentView(bookmark);
60
+ },
61
+ Icon: _jsx(Icon, { name: "update" }),
62
+ },
63
+ {
64
+ name: 'Remove',
65
+ disabled: false,
66
+ onClick: () => {
67
+ deleteBookmarkById(bookmark.id);
68
+ },
69
+ Icon: _jsx(Icon, { name: "delete_to_trash" }),
70
+ },
71
+ {
72
+ name: bookmark.isShared ? 'Unshare' : 'Share',
73
+ disabled: false,
74
+ onClick: () => {
75
+ shareBookmark(bookmark);
76
+ },
77
+ Icon: _jsx(Icon, { name: "share" }),
78
+ },
79
+ ];
80
+ }
81
+ else {
82
+ return [
83
+ {
84
+ name: 'Unfavourite',
85
+ disabled: false,
86
+ onClick: () => {
87
+ removeBookmarkFavorite(bookmark.id);
88
+ },
89
+ Icon: _jsx(Icon, { name: "close" }),
90
+ },
91
+ ];
92
+ }
93
+ }
94
+ //# sourceMappingURL=SectionList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SectionList.js","sourceRoot":"","sources":["../../../../src/components/sectionList/SectionList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE/C,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEnF,IAAI,CAAC,GAAG,CAAC;IACL,eAAe;IACf,IAAI;IACJ,KAAK;IACL,KAAK;IACL,MAAM;CACT,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC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AAI,EAAC,OAAO,GAAG;aAC9B;SACJ,CAAC;IACN,CAAC;AACL,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { Icon } from '@equinor/eds-core-react';
3
+ import { tokens } from '@equinor/eds-tokens';
4
+ import { useFramework } from '@equinor/fusion-framework-react';
5
+ import styled from 'styled-components';
6
+ const Styled = {
7
+ Row: styled.div `
8
+ display: flex;
9
+ align-items: center;
10
+ gap: 0.2em;
11
+ `,
12
+ CreatedBy: styled.p `
13
+ font-size: 12px;
14
+ font-weight: 500;
15
+ line-height: 16px;
16
+ letter-spacing: 0em;
17
+ text-align: right;
18
+ `,
19
+ };
20
+ export const SharedIcon = ({ createdBy, createdById }) => {
21
+ var _a;
22
+ const myId = (_a = useFramework().modules.auth.defaultAccount) === null || _a === void 0 ? void 0 : _a.localAccountId;
23
+ const isMe = createdById === myId;
24
+ return (_jsxs(Styled.Row, { children: [!isMe && _jsxs(Styled.CreatedBy, { children: ["shared by ", createdBy] }), _jsx(Icon, { name: "share", color: isMe
25
+ ? tokens.colors.interactive.primary__resting.hex
26
+ : tokens.colors.interactive.disabled__border.hex })] }));
27
+ };
28
+ //# sourceMappingURL=SharedIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SharedIcon.js","sourceRoot":"","sources":["../../../../src/components/shared/SharedIcon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,MAAM,GAAG;IACX,GAAG,EAAE,MAAM,CAAC,GAAG,CAAA;;;;KAId;IACD,SAAS,EAAE,MAAM,CAAC,CAAC,CAAA;;;;;;KAMlB;CACJ,CAAC;AAOF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,SAAS,EAAE,WAAW,EAAmB,EAAE,EAAE;;IACtE,MAAM,IAAI,GAAG,MAAA,YAAY,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,0CAAE,cAAc,CAAC;IAExE,MAAM,IAAI,GAAG,WAAW,KAAK,IAAI,CAAC;IAElC,OAAO,CACH,MAAC,MAAM,CAAC,GAAG,eACN,CAAC,IAAI,IAAI,MAAC,MAAM,CAAC,SAAS,6BAAY,SAAS,IAAoB,EACpE,KAAC,IAAI,IACD,IAAI,EAAC,OAAO,EACZ,KAAK,EACD,IAAI;oBACA,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,GAAG;oBAChD,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,GAAG,GAE1D,IACO,CAChB,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './useBookmarkGrouping';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { useState } from 'react';
2
+ const groupingModes = {
3
+ 'Group by app': (item) => item.appKey,
4
+ 'Created by': (item) => item.createdBy.name,
5
+ 'Group by Context': (item) => { var _a, _b; return (_b = (_a = item === null || item === void 0 ? void 0 : item.context) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : 'Unknown'; },
6
+ };
7
+ export const useBookmarkGrouping = (bookmarks) => {
8
+ const [searchText, setSearchText] = useState(null);
9
+ const [groupByKey, setGroupBy] = useState('Group by app');
10
+ const bookmarkGroups = groupBy(bookmarks || [], groupingModes[groupByKey], searchText, 'name');
11
+ return {
12
+ setGroupBy,
13
+ setSearchText,
14
+ searchText,
15
+ bookmarkGroups,
16
+ groupingModes,
17
+ groupByKey,
18
+ };
19
+ };
20
+ const groupBy = (array, getKey, searchText, field) => {
21
+ var _a;
22
+ return ((_a = array === null || array === void 0 ? void 0 : array.map(getKey).filter((v, i, a) => a.indexOf(v) === i).map((groupingProperty) => ({
23
+ groupingProperty,
24
+ values: array
25
+ .filter((s) => getKey(s) === groupingProperty)
26
+ .filter((s) => {
27
+ const fieldData = s[field];
28
+ if (typeof fieldData === 'string' && searchText) {
29
+ return fieldData.includes(searchText);
30
+ }
31
+ return true;
32
+ }),
33
+ }))) !== null && _a !== void 0 ? _a : []);
34
+ };
35
+ //# sourceMappingURL=useBookmarkGrouping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBookmarkGrouping.js","sourceRoot":"","sources":["../../../src/hooks/useBookmarkGrouping.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIjC,MAAM,aAAa,GAAsD;IACrE,cAAc,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM;IAC/C,YAAY,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI;IACrD,kBAAkB,EAAE,CAAC,IAAc,EAAE,EAAE,eAAC,OAAA,MAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,0CAAE,IAAI,mCAAI,SAAS,CAAA,EAAA;CAClE,CAAC;AAEX,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,SAAsB,EAAE,EAAE;IAC1D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAElE,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG,QAAQ,CAA6B,cAAc,CAAC,CAAC;IAEtF,MAAM,cAAc,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,EAAE,aAAa,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAE/F,OAAO;QACH,UAAU;QACV,aAAa;QACb,UAAU;QACV,cAAc;QACd,aAAa;QACb,UAAU;KACb,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CACZ,KAAU,EACV,MAA2B,EAC3B,UAAyB,EACzB,KAAc,EAChB,EAAE;;IACA,OAAO,CACH,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CACC,GAAG,CAAC,MAAM,EACX,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EACtC,GAAG,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;QACxB,gBAAgB;QAChB,MAAM,EAAE,KAAK;aACR,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,gBAAgB,CAAC;aAC7C,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;YACV,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;YAC3B,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,UAAU,EAAE,CAAC;gBAC9C,OAAO,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;YAC1C,CAAC;YAED,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC;KACT,CAAC,CAAC,mCAAI,EAAE,CAChB,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Bookmark } from './components/Bookmark';
2
+ export { BookmarkProvider } from './components/BookmarkProvider';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC"}
@@ -0,0 +1,6 @@
1
+ export const appendBookmarkIdToUrl = (id) => {
2
+ const url = new URL(window.location.toString());
3
+ url.searchParams.set('bookmarkId', id);
4
+ return url.toString();
5
+ };
6
+ //# sourceMappingURL=append-bookmark-to-uri.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"append-bookmark-to-uri.js","sourceRoot":"","sources":["../../../src/utils/append-bookmark-to-uri.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EAAU,EAAU,EAAE;IACxD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IACvC,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AAC1B,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export const filterEmptyGroups = (i) => i.values.length;
2
+ export const sortByName = (a, b) => a.name.localeCompare(b.name);
3
+ export const toHumanReadable = (val) => val
4
+ .split('-')
5
+ .map((s) => `${s[0].toUpperCase()}${s.slice(1)}`)
6
+ .join(' ');
7
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAyB,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;AAChF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAW,EAAE,CAAW,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAGrF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,EAAE,CAC3C,GAAG;KACE,KAAK,CAAC,GAAG,CAAC;KACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;KAChD,IAAI,CAAC,GAAG,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const version = '0.3.5';
2
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}