@equinor/fusion-framework-react-components-bookmark 0.0.0-next-20230915111233
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/.turbo/turbo-build.log +4 -0
- package/CHANGELOG.md +199 -0
- package/LICENSE +21 -0
- package/dist/esm/components/Bookmark.js +39 -0
- package/dist/esm/components/Bookmark.js.map +1 -0
- package/dist/esm/components/BookmarkProvider.js +33 -0
- package/dist/esm/components/BookmarkProvider.js.map +1 -0
- package/dist/esm/components/create-bookmark/CreateBookmark.js +34 -0
- package/dist/esm/components/create-bookmark/CreateBookmark.js.map +1 -0
- package/dist/esm/components/create-bookmark/index.js +2 -0
- package/dist/esm/components/create-bookmark/index.js.map +1 -0
- package/dist/esm/components/edit-bookmark/EditBookmark.js +65 -0
- package/dist/esm/components/edit-bookmark/EditBookmark.js.map +1 -0
- package/dist/esm/components/edit-bookmark/index.js +2 -0
- package/dist/esm/components/edit-bookmark/index.js.map +1 -0
- package/dist/esm/components/filter/Filter.js +19 -0
- package/dist/esm/components/filter/Filter.js.map +1 -0
- package/dist/esm/components/import-bookmark/ImportBookmark.js +28 -0
- package/dist/esm/components/import-bookmark/ImportBookmark.js.map +1 -0
- package/dist/esm/components/import-bookmark/index.js +2 -0
- package/dist/esm/components/import-bookmark/index.js.map +1 -0
- package/dist/esm/components/loading/Loading.js +10 -0
- package/dist/esm/components/loading/Loading.js.map +1 -0
- package/dist/esm/components/row/MoreMenu.js +11 -0
- package/dist/esm/components/row/MoreMenu.js.map +1 -0
- package/dist/esm/components/row/Row.js +47 -0
- package/dist/esm/components/row/Row.js.map +1 -0
- package/dist/esm/components/section/Section.js +41 -0
- package/dist/esm/components/section/Section.js.map +1 -0
- package/dist/esm/components/sectionList/SectionList.js +103 -0
- package/dist/esm/components/sectionList/SectionList.js.map +1 -0
- package/dist/esm/components/shared/SharedIcon.js +28 -0
- package/dist/esm/components/shared/SharedIcon.js.map +1 -0
- package/dist/esm/hooks/index.js +2 -0
- package/dist/esm/hooks/index.js.map +1 -0
- package/dist/esm/hooks/useBookmarkGrouping.js +35 -0
- package/dist/esm/hooks/useBookmarkGrouping.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/utils/append-bookmark-to-uri.js +6 -0
- package/dist/esm/utils/append-bookmark-to-uri.js.map +1 -0
- package/dist/esm/utils/utils.js +7 -0
- package/dist/esm/utils/utils.js.map +1 -0
- package/dist/esm/version.js +2 -0
- package/dist/esm/version.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/components/Bookmark.d.ts +2 -0
- package/dist/types/components/BookmarkProvider.d.ts +14 -0
- package/dist/types/components/create-bookmark/CreateBookmark.d.ts +4 -0
- package/dist/types/components/create-bookmark/index.d.ts +1 -0
- package/dist/types/components/edit-bookmark/EditBookmark.d.ts +5 -0
- package/dist/types/components/edit-bookmark/index.d.ts +1 -0
- package/dist/types/components/filter/Filter.d.ts +10 -0
- package/dist/types/components/import-bookmark/ImportBookmark.d.ts +1 -0
- package/dist/types/components/import-bookmark/index.d.ts +1 -0
- package/dist/types/components/loading/Loading.d.ts +1 -0
- package/dist/types/components/row/MoreMenu.d.ts +10 -0
- package/dist/types/components/row/Row.d.ts +17 -0
- package/dist/types/components/section/Section.d.ts +7 -0
- package/dist/types/components/sectionList/SectionList.d.ts +6 -0
- package/dist/types/components/shared/SharedIcon.d.ts +6 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/useBookmarkGrouping.d.ts +14 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/utils/append-bookmark-to-uri.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +6 -0
- package/dist/types/version.d.ts +1 -0
- package/package.json +55 -0
- package/src/components/Bookmark.tsx +60 -0
- package/src/components/BookmarkProvider.tsx +65 -0
- package/src/components/create-bookmark/CreateBookmark.tsx +93 -0
- package/src/components/create-bookmark/index.ts +1 -0
- package/src/components/edit-bookmark/EditBookmark.tsx +137 -0
- package/src/components/edit-bookmark/index.ts +1 -0
- package/src/components/filter/Filter.tsx +58 -0
- package/src/components/import-bookmark/ImportBookmark.tsx +57 -0
- package/src/components/import-bookmark/index.ts +1 -0
- package/src/components/loading/Loading.tsx +16 -0
- package/src/components/row/MoreMenu.tsx +34 -0
- package/src/components/row/Row.tsx +92 -0
- package/src/components/section/Section.tsx +57 -0
- package/src/components/sectionList/SectionList.tsx +172 -0
- package/src/components/shared/SharedIcon.tsx +45 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useBookmarkGrouping.ts +54 -0
- package/src/index.ts +2 -0
- package/src/utils/append-bookmark-to-uri.ts +5 -0
- package/src/utils/utils.ts +12 -0
- package/src/version.ts +2 -0
- package/tsconfig.json +23 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
## 0.0.0-next-20230915111233
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`3896fbec3`](https://github.com/equinor/fusion-framework/commit/3896fbec3458dbe2ebd66e772465d5f89cd20658)]:
|
|
8
|
+
- @equinor/fusion-framework-react@0.0.0-next-20230915111233
|
|
9
|
+
- @equinor/fusion-framework-react-module-bookmark@0.0.0-next-20230915111233
|
|
10
|
+
|
|
11
|
+
## 0.2.6
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies []:
|
|
16
|
+
- @equinor/fusion-framework-react@5.2.7
|
|
17
|
+
- @equinor/fusion-framework-react-module-bookmark@2.0.17
|
|
18
|
+
|
|
19
|
+
## 0.2.5
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies []:
|
|
24
|
+
- @equinor/fusion-framework-react@5.2.6
|
|
25
|
+
- @equinor/fusion-framework-react-module-bookmark@2.0.16
|
|
26
|
+
|
|
27
|
+
## 0.2.4
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- [`18b70b98`](https://github.com/equinor/fusion-framework/commit/18b70b98454df296a2a06fa5281ae9b6556d9a67) Thanks [@odinr](https://github.com/odinr)! - test 3
|
|
32
|
+
|
|
33
|
+
## 0.2.3
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- [`c9b5f360`](https://github.com/equinor/fusion-framework/commit/c9b5f3605ff6ffe355eec9b709a5a6c5784355e5) Thanks [@odinr](https://github.com/odinr)! - test 2
|
|
38
|
+
|
|
39
|
+
## 0.2.2
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- [`f7db2499`](https://github.com/equinor/fusion-framework/commit/f7db249937212f876beb87d2941036f7e5f793d4) Thanks [@odinr](https://github.com/odinr)! - test release
|
|
44
|
+
|
|
45
|
+
## 0.2.1
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- [`066d843c`](https://github.com/equinor/fusion-framework/commit/066d843c88cb974150f23f4fb9e7d0b066c93594) Thanks [@odinr](https://github.com/odinr)! - fix typo in styled components
|
|
50
|
+
|
|
51
|
+
- Updated dependencies []:
|
|
52
|
+
- @equinor/fusion-framework-react-module-bookmark@2.0.15
|
|
53
|
+
- @equinor/fusion-framework-react@5.2.5
|
|
54
|
+
|
|
55
|
+
## 0.2.0
|
|
56
|
+
|
|
57
|
+
### Minor Changes
|
|
58
|
+
|
|
59
|
+
- [#1109](https://github.com/equinor/fusion-framework/pull/1109) [`7ec195d4`](https://github.com/equinor/fusion-framework/commit/7ec195d42098fec8794db13e83b71ef7753ff862) Thanks [@odinr](https://github.com/odinr)! - Removed emotion styling
|
|
60
|
+
|
|
61
|
+
issues whit conflicting package when using 3x jss frameworks (mui, styled-components, emotion)
|
|
62
|
+
|
|
63
|
+
_this might break jss class generation front-end, since classnames changes_
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- [#1109](https://github.com/equinor/fusion-framework/pull/1109) [`7ec195d4`](https://github.com/equinor/fusion-framework/commit/7ec195d42098fec8794db13e83b71ef7753ff862) Thanks [@odinr](https://github.com/odinr)! - Change packaged manager from yarn to pnpm
|
|
68
|
+
|
|
69
|
+
conflicts of `@types/react` made random outcomes when using `yarn`
|
|
70
|
+
|
|
71
|
+
this change should not affect consumer of the packages, but might conflict dependent on local package manager.
|
|
72
|
+
|
|
73
|
+
- [#1129](https://github.com/equinor/fusion-framework/pull/1129) [`f672d0bb`](https://github.com/equinor/fusion-framework/commit/f672d0bba71a7ea6cd08135778fda67ff38f3ac3) Thanks [@dependabot](https://github.com/apps/dependabot)! - build(deps): bump @equinor/eds-core-react from 0.30.0 to 0.32.4
|
|
74
|
+
|
|
75
|
+
- [#1122](https://github.com/equinor/fusion-framework/pull/1122) [`1a055b21`](https://github.com/equinor/fusion-framework/commit/1a055b21e07f84bc5d35cc891586aa9aa0bdf661) Thanks [@dependabot](https://github.com/apps/dependabot)! - Update styled-components to [^6.0.7](https://github.com/styled-components/styled-components/releases/tag/v6.0.7)
|
|
76
|
+
|
|
77
|
+
- upgraded dev deps of `@equinor/fusion-framework-react-components-bookmark` to react 18, see style-components [changelog](https://github.com/styled-components/styled-components/releases/tag/v6.0.0)
|
|
78
|
+
- removed `@types/style-components` from `@equinor/fusion-framework-react-components-bookmark`
|
|
79
|
+
|
|
80
|
+
see style-components [migration guide](https://styled-components.com/docs/faqs#what-do-i-need-to-do-to-migrate-to-v6)
|
|
81
|
+
|
|
82
|
+
- Updated dependencies [[`7ec195d4`](https://github.com/equinor/fusion-framework/commit/7ec195d42098fec8794db13e83b71ef7753ff862), [`2dccccd1`](https://github.com/equinor/fusion-framework/commit/2dccccd124fbe3cdde2132c29c27d3da9fc6f1f5), [`d276fc5d`](https://github.com/equinor/fusion-framework/commit/d276fc5d514566d05c64705076a1cb91c6a44272)]:
|
|
83
|
+
- @equinor/fusion-framework-react-module-bookmark@2.0.14
|
|
84
|
+
- @equinor/fusion-framework-react@5.2.4
|
|
85
|
+
|
|
86
|
+
## 0.1.16
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- [#1047](https://github.com/equinor/fusion-framework/pull/1047) [`1a2880d2`](https://github.com/equinor/fusion-framework/commit/1a2880d2e4c80ac5ce08f63ca3699fe77e4b565c) Thanks [@dependabot](https://github.com/apps/dependabot)! - build(deps): bump @typescript-eslint/eslint-plugin from 5.59.11 to 6.1.0
|
|
91
|
+
|
|
92
|
+
only style semantics updated
|
|
93
|
+
|
|
94
|
+
- Updated dependencies [[`1a2880d2`](https://github.com/equinor/fusion-framework/commit/1a2880d2e4c80ac5ce08f63ca3699fe77e4b565c), [`1749da29`](https://github.com/equinor/fusion-framework/commit/1749da290c98c0a43b9fdf2253dfb224e4ccdcd0)]:
|
|
95
|
+
- @equinor/fusion-framework-react@5.2.3
|
|
96
|
+
- @equinor/fusion-framework-react-module-bookmark@2.0.13
|
|
97
|
+
|
|
98
|
+
## 0.1.15
|
|
99
|
+
|
|
100
|
+
### Patch Changes
|
|
101
|
+
|
|
102
|
+
- [#958](https://github.com/equinor/fusion-framework/pull/958) [`e50acbb2`](https://github.com/equinor/fusion-framework/commit/e50acbb28ef10c83cf6e7913fa9f03ed971f0957) Thanks [@odinr](https://github.com/odinr)! - _refactor: only added missing deps for stand alone compile_
|
|
103
|
+
|
|
104
|
+
## 0.1.14
|
|
105
|
+
|
|
106
|
+
### Patch Changes
|
|
107
|
+
|
|
108
|
+
- [#946](https://github.com/equinor/fusion-framework/pull/946) [`5a160d88`](https://github.com/equinor/fusion-framework/commit/5a160d88981ddfe861d391cfefe10f54dda3d352) Thanks [@odinr](https://github.com/odinr)! - Build/update typescript to 5
|
|
109
|
+
|
|
110
|
+
## 0.1.13
|
|
111
|
+
|
|
112
|
+
### Patch Changes
|
|
113
|
+
|
|
114
|
+
- [#905](https://github.com/equinor/fusion-framework/pull/905) [`a7858a1c`](https://github.com/equinor/fusion-framework/commit/a7858a1c01542e2dc94370709f122b4b99c3219c) Thanks [@odinr](https://github.com/odinr)! - **🚧 Chore: dedupe packages**
|
|
115
|
+
|
|
116
|
+
- align all versions of typescript
|
|
117
|
+
- update types to build
|
|
118
|
+
- a couple of typecasts did not [satisfies](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#satisfies-support-in-jsdoc) and was recasted as `unknwon`, marked with `TODO`, should be fixed in future
|
|
119
|
+
|
|
120
|
+
- Updated dependencies [[`a7858a1c`](https://github.com/equinor/fusion-framework/commit/a7858a1c01542e2dc94370709f122b4b99c3219c)]:
|
|
121
|
+
- @equinor/fusion-framework-react-module-bookmark@2.0.12
|
|
122
|
+
|
|
123
|
+
## 0.1.12
|
|
124
|
+
|
|
125
|
+
### Patch Changes
|
|
126
|
+
|
|
127
|
+
- 727fb935: fix(react-module-bookmark): module can be undefined
|
|
128
|
+
|
|
129
|
+
the bookmark module might not been enable, which makes the application crash.
|
|
130
|
+
|
|
131
|
+
**TODO:**
|
|
132
|
+
|
|
133
|
+
- [ ] create a simpler hook for using bookmark
|
|
134
|
+
- [ ] create a hook for exposing the module
|
|
135
|
+
- [ ] create better documentation
|
|
136
|
+
|
|
137
|
+
- Updated dependencies [727fb935]
|
|
138
|
+
- @equinor/fusion-framework-react-module-bookmark@2.0.11
|
|
139
|
+
|
|
140
|
+
All notable changes to this project will be documented in this file.
|
|
141
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
142
|
+
|
|
143
|
+
## [0.1.11](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-react-components-bookmark@0.1.10...@equinor/fusion-framework-react-components-bookmark@0.1.11) (2023-05-24)
|
|
144
|
+
|
|
145
|
+
**Note:** Version bump only for package @equinor/fusion-framework-react-components-bookmark
|
|
146
|
+
|
|
147
|
+
## [0.1.10](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-react-components-bookmark@0.1.9...@equinor/fusion-framework-react-components-bookmark@0.1.10) (2023-05-23)
|
|
148
|
+
|
|
149
|
+
**Note:** Version bump only for package @equinor/fusion-framework-react-components-bookmark
|
|
150
|
+
|
|
151
|
+
## [0.1.9](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-react-components-bookmark@0.1.8...@equinor/fusion-framework-react-components-bookmark@0.1.9) (2023-05-22)
|
|
152
|
+
|
|
153
|
+
**Note:** Version bump only for package @equinor/fusion-framework-react-components-bookmark
|
|
154
|
+
|
|
155
|
+
## [0.1.8](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-react-components-bookmark@0.1.7...@equinor/fusion-framework-react-components-bookmark@0.1.8) (2023-05-22)
|
|
156
|
+
|
|
157
|
+
**Note:** Version bump only for package @equinor/fusion-framework-react-components-bookmark
|
|
158
|
+
|
|
159
|
+
## 0.1.7 (2023-05-22)
|
|
160
|
+
|
|
161
|
+
**Note:** Version bump only for package @equinor/fusion-framework-react-components-bookmark
|
|
162
|
+
|
|
163
|
+
## [0.1.6](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-react-components-bookmark@0.1.5...@equinor/fusion-framework-react-components-bookmark@0.1.6) (2023-05-12)
|
|
164
|
+
|
|
165
|
+
**Note:** Version bump only for package @equinor/fusion-framework-react-components-bookmark
|
|
166
|
+
|
|
167
|
+
## [0.1.5](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-react-components-bookmark@0.1.4...@equinor/fusion-framework-react-components-bookmark@0.1.5) (2023-05-11)
|
|
168
|
+
|
|
169
|
+
**Note:** Version bump only for package @equinor/fusion-framework-react-components-bookmark
|
|
170
|
+
|
|
171
|
+
## [0.1.4](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-react-components-bookmark@0.1.3...@equinor/fusion-framework-react-components-bookmark@0.1.4) (2023-05-11)
|
|
172
|
+
|
|
173
|
+
**Note:** Version bump only for package @equinor/fusion-framework-react-components-bookmark
|
|
174
|
+
|
|
175
|
+
## 0.1.3 (2023-05-10)
|
|
176
|
+
|
|
177
|
+
**Note:** Version bump only for package @equinor/fusion-framework-react-components-bookmark
|
|
178
|
+
|
|
179
|
+
## [0.1.2](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-react-components-bookmark@0.1.1...@equinor/fusion-framework-react-components-bookmark@0.1.2) (2023-05-08)
|
|
180
|
+
|
|
181
|
+
**Note:** Version bump only for package @equinor/fusion-framework-react-components-bookmark
|
|
182
|
+
|
|
183
|
+
## [0.1.1](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-react-components-bookmark@0.1.0...@equinor/fusion-framework-react-components-bookmark@0.1.1) (2023-05-05)
|
|
184
|
+
|
|
185
|
+
**Note:** Version bump only for package @equinor/fusion-framework-react-components-bookmark
|
|
186
|
+
|
|
187
|
+
## 0.1.0 (2023-04-24)
|
|
188
|
+
|
|
189
|
+
### Features
|
|
190
|
+
|
|
191
|
+
- **bookmark-component:** new bookmark component for creating and editing bookmarks initial commit ([bd3bfec](https://github.com/equinor/fusion-framework/commit/bd3bfeca877df6076ca711333d0b96a44504c888))
|
|
192
|
+
|
|
193
|
+
### Bug Fixes
|
|
194
|
+
|
|
195
|
+
- **bookmark-component:** add group by context ([20291f3](https://github.com/equinor/fusion-framework/commit/20291f3cd8284ff5b0eb2db30f9e4040a870ba70))
|
|
196
|
+
- **bookmark-component:** removed comment ([72c7147](https://github.com/equinor/fusion-framework/commit/72c7147609b229fb68576068c0f2944e5e3bbae0))
|
|
197
|
+
- **bookmark-component:** styles update, added loading spinner and update with current view' ([d5e1143](https://github.com/equinor/fusion-framework/commit/d5e1143f125410beb46a462e92591e3f9bbb809d))
|
|
198
|
+
- **bookmark:** fix linting ([17b179f](https://github.com/equinor/fusion-framework/commit/17b179fbb25243730dd65cc116c86471074faabc))
|
|
199
|
+
- pull request feedback fixes ([a0d9aa6](https://github.com/equinor/fusion-framework/commit/a0d9aa69a5ffc4e6da5061df61969d860c4be909))
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Equinor
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useBookmark } from '@equinor/fusion-framework-react-module-bookmark';
|
|
3
|
+
import { useBookmarkGrouping } from '../hooks';
|
|
4
|
+
import { BookmarkFilter } from './filter/Filter';
|
|
5
|
+
import { SectionList } from './sectionList/SectionList';
|
|
6
|
+
import { useEffect } from 'react';
|
|
7
|
+
import { Icon } from '@equinor/eds-core-react';
|
|
8
|
+
import { chevron_down, chevron_right, share, more_vertical, add } from '@equinor/eds-icons';
|
|
9
|
+
import styled from 'styled-components';
|
|
10
|
+
Icon.add({
|
|
11
|
+
chevron_down,
|
|
12
|
+
chevron_right,
|
|
13
|
+
share,
|
|
14
|
+
more_vertical,
|
|
15
|
+
add,
|
|
16
|
+
});
|
|
17
|
+
const Styled = {
|
|
18
|
+
Wrapper: styled.div `
|
|
19
|
+
padding-right: 1rem;
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
gap: 1rem;
|
|
23
|
+
`,
|
|
24
|
+
List: styled.div `
|
|
25
|
+
overflow-y: auto;
|
|
26
|
+
overflow-x: hidden;
|
|
27
|
+
height: calc((100vh - 85px) - 3rem);
|
|
28
|
+
`,
|
|
29
|
+
};
|
|
30
|
+
export const Bookmark = () => {
|
|
31
|
+
const { bookmarks, getAllBookmarks } = useBookmark();
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
getAllBookmarks();
|
|
34
|
+
}, [getAllBookmarks]);
|
|
35
|
+
const { bookmarkGroups, groupingModes, searchText, setGroupBy, setSearchText, groupByKey } = useBookmarkGrouping(bookmarks);
|
|
36
|
+
return (_jsxs(Styled.Wrapper, { children: [_jsx(BookmarkFilter, { groupBy: groupByKey, groupingModes: Object.keys(groupingModes), searchText: searchText !== null && searchText !== void 0 ? searchText : '', setGroupBy: setGroupBy, setSearchText: setSearchText }), _jsx(Styled.List, { children: _jsx(SectionList, { bookmarkGroups: bookmarkGroups }) })] }));
|
|
37
|
+
};
|
|
38
|
+
export default Bookmark;
|
|
39
|
+
//# sourceMappingURL=Bookmark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bookmark.js","sourceRoot":"","sources":["../../../src/components/Bookmark.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,iB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pB,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Snackbar } from '@equinor/eds-core-react';
|
|
3
|
+
import { useFramework } from '@equinor/fusion-framework-react';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
import { CreateBookmarkModal } from './create-bookmark';
|
|
6
|
+
import { EditBookmarkModal } from './edit-bookmark';
|
|
7
|
+
import { ImportBookmarkModal } from './import-bookmark';
|
|
8
|
+
export const BookmarkProvider = ({ children }) => {
|
|
9
|
+
const [isCreateBookmarkOpen, setIsCreateBookmarkOpen] = useState(false);
|
|
10
|
+
const [isEditBookmarkOpen, setIsEditBookmarkOpen] = useState(false);
|
|
11
|
+
const [editBookmarkId, setEditBookmarkId] = useState();
|
|
12
|
+
const [isBookmarkCopy, setIsBookmarkCopy] = useState(false);
|
|
13
|
+
const { event } = useFramework().modules;
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const subOnBookmarkOpen = event.addEventListener('onBookmarkOpen', (e) => {
|
|
16
|
+
setIsCreateBookmarkOpen(e.detail);
|
|
17
|
+
});
|
|
18
|
+
const subOnBookmarkEdit = event.addEventListener('onBookmarkEdit', (e) => {
|
|
19
|
+
setEditBookmarkId(e.detail.bookmarkId);
|
|
20
|
+
setIsEditBookmarkOpen(true);
|
|
21
|
+
});
|
|
22
|
+
const subOnBookmarkUrlCopy = event.addEventListener('onBookmarkUrlCopy', () => {
|
|
23
|
+
setIsBookmarkCopy(true);
|
|
24
|
+
});
|
|
25
|
+
return () => {
|
|
26
|
+
subOnBookmarkEdit();
|
|
27
|
+
subOnBookmarkOpen();
|
|
28
|
+
subOnBookmarkUrlCopy();
|
|
29
|
+
};
|
|
30
|
+
}, [event]);
|
|
31
|
+
return (_jsxs(_Fragment, { children: [_jsx(CreateBookmarkModal, { isOpen: isCreateBookmarkOpen, onClose: setIsCreateBookmarkOpen }), _jsx(EditBookmarkModal, { isOpen: isEditBookmarkOpen, onClose: setIsEditBookmarkOpen, bookmarkId: editBookmarkId }), _jsx(ImportBookmarkModal, {}), _jsx(Snackbar, { autoHideDuration: 2000, onClose: () => setIsBookmarkCopy(false), open: isBookmarkCopy, children: "Bookmark url copied to clipboard" }), children] }));
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=BookmarkProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BookmarkProvider.js","sourceRoot":"","sources":["../../../src/components/BookmarkProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAqB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,QAAQ,EAA8B,EAAE,EAAE;IACzE,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxE,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpE,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,EAAsB,CAAC;IAC3E,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5D,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,CAAC,OAAO,CAAC;IAEzC,SAAS,CAAC,GAAG,EAAE;QAC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@equinor/eds-core-react';
|
|
3
|
+
import { useFramework } from '@equinor/fusion-framework-react';
|
|
4
|
+
import { useBookmark } from '@equinor/fusion-framework-react-module-bookmark';
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
const StyledContent = styled(Dialog.Content) `
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: 1rem;
|
|
11
|
+
`;
|
|
12
|
+
export const CreateBookmarkModal = ({ isOpen, onClose, }) => {
|
|
13
|
+
var _a;
|
|
14
|
+
const [state, setState] = useState({
|
|
15
|
+
name: '',
|
|
16
|
+
description: '',
|
|
17
|
+
isShared: false,
|
|
18
|
+
});
|
|
19
|
+
const { current } = useFramework().modules.app;
|
|
20
|
+
const { createBookmark } = useBookmark();
|
|
21
|
+
return (_jsxs(Dialog, { style: { width: '400px' }, open: isOpen, children: [_jsx(Dialog.Header, { children: "Create bookmark" }), _jsxs(StyledContent, { children: [_jsxs("div", { children: [_jsx(Label, { htmlFor: "name", label: "Name" }), _jsx(Input, { id: "name", autoComplete: "off", value: state === null || state === void 0 ? void 0 : state.name, onChange: (event) => {
|
|
22
|
+
setState((s) => (Object.assign(Object.assign({}, s), { name: event.target.value })));
|
|
23
|
+
} })] }), _jsx("div", { children: _jsx(TextField, { id: "storybook-multiline-three", label: "Description", multiline: true, rows: 3, rowsMax: 10, onChange: (event) => {
|
|
24
|
+
setState((s) => (Object.assign(Object.assign({}, s), { description: event.target.value })));
|
|
25
|
+
} }) }), _jsxs("div", { children: [_jsx(Label, { htmlFor: "app", label: "App" }), _jsx(Input, { readOnly: true, value: ((_a = current === null || current === void 0 ? void 0 : current.manifest) === null || _a === void 0 ? void 0 : _a.name) || '' })] }), _jsx("div", { children: _jsx(Checkbox, { label: "Is Shared", checked: state.isShared, onChange: (event) => {
|
|
26
|
+
setState((s) => (Object.assign(Object.assign({}, s), { isShared: event.target.checked })));
|
|
27
|
+
} }) })] }), _jsx(Dialog.Actions, { children: _jsxs("div", { style: { display: 'flex', gap: '0.2em' }, children: [_jsx(Button, { onClick: () => onClose(false), variant: "ghost", children: "Cancel" }), _jsx(Button, { onClick: () => {
|
|
28
|
+
state &&
|
|
29
|
+
createBookmark(state).then(() => {
|
|
30
|
+
onClose(false);
|
|
31
|
+
});
|
|
32
|
+
}, children: "Create" })] }) })] }));
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=CreateBookmark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateBookmark.js","sourceRoot":"","sources":["../../../../src/components/create-bookmark/CreateBookmark.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAE5F,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAe,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;;;;CAI3C,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAChC,MAAM,EACN,OAAO,GAIV,EAAE,EAAE;;IACD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAA2D;QACzF,IAAI,EAAE,EAAE;QACR,WAAW,EAAE,EAAE;QACf,QAAQ,EAAE,KAAK;KAClB,CAAC,CAAC;IAEH,MAAM,EAAE,OAAO,EAAE,GAAG,YAAY,EAAe,CAAC,OAAO,CAAC,GAAG,CAAC;IAE5D,MAAM,EAAE,cAAc,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzC,OAAO,CACH,MAAC,MAAM,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,O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,CAAC,iCAAM,CAAC,KAAE,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,IAAG,CAAC,CAAC;4BAChE,CAAC,GACH,GACA,IACM,EAChB,KAAC,MAAM,CAAC,OAAO,cACX,eAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,aACzC,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,EAAC,OAAO,uBAE7C,EACT,KAAC,MAAM,IACH,OAAO,EAAE,GAAG,EAAE;gCACV,KAAK;oCACD,cAAc,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;wCAC5B,OAAO,CAAC,KAAK,CAAC,CAAC;oCACnB,CAAC,CAAC,CAAC;4BACX,CAAC,uBAGI,IACP,GACO,IACZ,CACZ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/create-bookmark/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Button, Checkbox, Dialog, Input, Label, TextField } from '@equinor/eds-core-react';
|
|
4
|
+
import { useFramework } from '@equinor/fusion-framework-react';
|
|
5
|
+
import { useBookmark } from '@equinor/fusion-framework-react-module-bookmark';
|
|
6
|
+
import { appendBookmarkIdToUrl } from '../../utils/append-bookmark-to-uri';
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
const Styled = {
|
|
9
|
+
Dialog: styled(Dialog) `
|
|
10
|
+
width: 500px;
|
|
11
|
+
`,
|
|
12
|
+
DialogContent: styled(Dialog.Content) `
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: 1rem;
|
|
16
|
+
`,
|
|
17
|
+
CheckboxWrapper: styled.div `
|
|
18
|
+
display: flex;
|
|
19
|
+
gap: 1rem;
|
|
20
|
+
`,
|
|
21
|
+
Actions: styled.div `
|
|
22
|
+
display: flex;
|
|
23
|
+
gap: 0.2em;
|
|
24
|
+
`,
|
|
25
|
+
};
|
|
26
|
+
export const EditBookmarkModal = ({ isOpen, onClose, bookmarkId, }) => {
|
|
27
|
+
var _a;
|
|
28
|
+
const [state, setState] = useState({
|
|
29
|
+
id: '',
|
|
30
|
+
appKey: '',
|
|
31
|
+
name: '',
|
|
32
|
+
description: '',
|
|
33
|
+
isShared: false,
|
|
34
|
+
});
|
|
35
|
+
const [updatePayload, setUpdatePayload] = useState(false);
|
|
36
|
+
const { app, event } = useFramework().modules;
|
|
37
|
+
const { current } = app;
|
|
38
|
+
const { updateBookmark, bookmarks } = useBookmark();
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
const bookmark = bookmarks.find((b) => b.id === bookmarkId);
|
|
41
|
+
if (bookmark) {
|
|
42
|
+
setState(bookmark);
|
|
43
|
+
}
|
|
44
|
+
}, [bookmarkId, bookmarks]);
|
|
45
|
+
return (_jsxs(Styled.Dialog, { open: isOpen, children: [_jsx(Dialog.Header, { children: "Edit bookmark" }), _jsxs(Styled.DialogContent, { children: [_jsxs("div", { children: [_jsx(Label, { htmlFor: "name", label: "Name" }), _jsx(Input, { id: "name", autoComplete: "off", value: state === null || state === void 0 ? void 0 : state.name, onChange: (event) => {
|
|
46
|
+
setState((s) => (Object.assign(Object.assign({}, s), { name: event.target.value })));
|
|
47
|
+
} })] }), _jsx("div", { children: _jsx(TextField, { id: "storybook-multiline-three", label: "Description", value: state === null || state === void 0 ? void 0 : state.description, multiline: true, rows: 3, rowsMax: 10, onChange: (event) => {
|
|
48
|
+
setState((s) => (Object.assign(Object.assign({}, s), { description: event.target.value })));
|
|
49
|
+
} }) }), _jsxs("div", { children: [_jsx(Label, { htmlFor: "app", label: "App" }), _jsx(Input, { readOnly: true, value: ((_a = current === null || current === void 0 ? void 0 : current.manifest) === null || _a === void 0 ? void 0 : _a.name) || '' })] }), _jsxs(Styled.CheckboxWrapper, { children: [_jsx(Checkbox, { label: "Is Shared", checked: state.isShared, onChange: (changeEvent) => {
|
|
50
|
+
if (changeEvent.target.checked) {
|
|
51
|
+
const url = appendBookmarkIdToUrl(state.id);
|
|
52
|
+
navigator.clipboard.writeText(url);
|
|
53
|
+
event.dispatchEvent('onBookmarkUrlCopy', { detail: { url } });
|
|
54
|
+
}
|
|
55
|
+
setState((s) => (Object.assign(Object.assign({}, s), { isShared: changeEvent.target.checked })));
|
|
56
|
+
} }), _jsx(Checkbox, { label: "Update bookmark with current view", checked: updatePayload, onChange: () => {
|
|
57
|
+
setUpdatePayload((s) => !s);
|
|
58
|
+
} })] })] }), _jsx(Dialog.Actions, { children: _jsxs(Styled.Actions, { children: [_jsx(Button, { onClick: () => onClose(false), variant: "ghost", children: "Cancel" }), _jsx(Button, { onClick: () => {
|
|
59
|
+
state &&
|
|
60
|
+
updateBookmark(state, { updatePayload }).then(() => {
|
|
61
|
+
onClose(false);
|
|
62
|
+
});
|
|
63
|
+
}, children: "Save" })] }) })] }));
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=EditBookmark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditBookmark.js","sourceRoot":"","sources":["../../../../src/components/edit-bookmark/EditBookmark.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAe,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAI5F,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAE,qB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AA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Search, Autocomplete } from '@equinor/eds-core-react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
const Styled = {
|
|
5
|
+
Root: styled.div `
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
`,
|
|
10
|
+
};
|
|
11
|
+
export const BookmarkFilter = ({ searchText, setGroupBy, setSearchText, groupingModes, groupBy, }) => {
|
|
12
|
+
return (_jsx(Search, { placeholder: "Search in my bookmarks", value: searchText !== null && searchText !== void 0 ? searchText : '', onChange: (e) => {
|
|
13
|
+
setSearchText(e.currentTarget.value.length ? e.currentTarget.value : null);
|
|
14
|
+
} }));
|
|
15
|
+
return (_jsxs(Styled.Root, { children: [_jsx(Search, { placeholder: "Search in my bookmarks", value: searchText !== null && searchText !== void 0 ? searchText : '', onChange: (e) => {
|
|
16
|
+
setSearchText(e.currentTarget.value.length ? e.currentTarget.value : null);
|
|
17
|
+
} }), _jsx(Autocomplete, { options: groupingModes, selectedOptions: [groupBy], multiple: false, hideClearButton: true, autoWidth: true, onOptionsChange: (changes) => setGroupBy(changes.selectedItems[0]), label: '' })] }));
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=Filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../../../src/components/filter/Filter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG/D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAUvC,MAAM,MAAM,GAAG;IACX,IAAI,EAAE,MAAM,CAAC,GAAG,CAAA;;;;KAIf;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC3B,UAAU,EACV,UAAU,EACV,aAAa,EACb,aAAa,EACb,OAAO,GACW,EAAE,EAAE;IACtB,OAAO,CACH,KAAC,MAAM,IACH,WAAW,EAAC,wBAAwB,EACpC,KAAK,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,EAAE,EACvB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;YACZ,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC/E,CAAC,GACH,CACL,CAAC;IACF,OAAO,CACH,MAAC,MAAM,CAAC,IAAI,eACR,KAAC,MAAM,IACH,WAAW,EAAC,wBAAwB,EACpC,KAAK,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,EAAE,EACvB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;oBACZ,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;gBAC/E,CAAC,GACH,EACF,KAAC,YAAY,IACT,OAAO,EAAE,aAAa,EACtB,eAAe,EAAE,CAAC,OAAO,CAAC,EAC1B,QAAQ,EAAE,KAAK,EACf,eAAe,QACf,SAAS,QACT,eAAe,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAiB,CAAC,EAClF,KAAK,EAAE,EAAE,GACX,IACQ,CACjB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Dialog } from '@equinor/eds-core-react';
|
|
3
|
+
import { useBookmark } from '@equinor/fusion-framework-react-module-bookmark';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
import styled from 'styled-components';
|
|
6
|
+
const Styled = {
|
|
7
|
+
Actions: styled.div `
|
|
8
|
+
display: flex;
|
|
9
|
+
gap: 1rem;
|
|
10
|
+
`,
|
|
11
|
+
};
|
|
12
|
+
export const ImportBookmarkModal = () => {
|
|
13
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
14
|
+
const { currentBookmark, bookmarks, addBookmarkFavorite } = useBookmark();
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!bookmarks || !currentBookmark || bookmarks.length === 0)
|
|
17
|
+
return;
|
|
18
|
+
if (bookmarks.findIndex(({ id }) => id === currentBookmark.id) === -1) {
|
|
19
|
+
setIsOpen(true);
|
|
20
|
+
}
|
|
21
|
+
}, [bookmarks, currentBookmark]);
|
|
22
|
+
return (_jsxs(Dialog, { style: { width: '600px' }, open: isOpen, children: [_jsx(Dialog.Header, { children: "Import bookmark" }), _jsxs(Dialog.Content, { children: [_jsxs("p", { children: ["This bookmark was created by ", currentBookmark === null || currentBookmark === void 0 ? void 0 : currentBookmark.createdBy.name] }), _jsx("p", { children: "Would you like to import it?" })] }), _jsx(Dialog.Actions, { children: _jsxs(Styled.Actions, { children: [_jsx(Button, { onClick: () => setIsOpen(false), variant: 'ghost', style: { width: '70px' }, children: "No" }), _jsx(Button, { onClick: () => {
|
|
23
|
+
console.log(currentBookmark === null || currentBookmark === void 0 ? void 0 : currentBookmark.id);
|
|
24
|
+
currentBookmark && addBookmarkFavorite(currentBookmark.id);
|
|
25
|
+
setIsOpen(false);
|
|
26
|
+
}, variant: "ghost", children: "Import" })] }) })] }));
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=ImportBookmark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImportBookmark.js","sourceRoot":"","sources":["../../../../src/components/import-bookmark/ImportBookmark.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,yBAAyB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AO,EAAE,OAAO,EAChB,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,mBAGnB,EACT,KAAC,MAAM,IACH,OAAO,EAAE,GAAG,EAAE;gCACV,OAAO,CAAC,GAAG,CAAC,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,EAAE,CAAC,CAAC;gCACjC,eAAe,IAAI,mBAAmB,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;gCAC3D,SAAS,CAAC,KAAK,CAAC,CAAC;4BACrB,CAAC,EACD,OAAO,EAAC,OAAO,uBAGV,IACI,GACJ,IACZ,CACZ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -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,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,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAA+B,MAAM,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAkBvC,MAAM,MAAM,GAAG;IACX,KAAK,EAAE,MAAM,CAAC,GAAG,CAAA;;;;;KAKhB;IACD,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAA;;;gCAGQ,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,iBAAiB,CAAC,GAAG;;;;;;;;;mCASnC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,kBAAkB,CAAC,GAAG;KACrE;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAA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