@ndla/ui 16.2.0 → 18.0.1
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/es/Article/Article.js +3 -3
- package/es/Article/ArticleFavoritesButton.js +4 -3
- package/es/Breadcrumblist/Breadcrumblist.js +7 -7
- package/es/Frontpage/FrontpageAllSubjects.js +8 -8
- package/es/Masthead/Masthead.js +2 -3
- package/es/Masthead/MastheadAuthModal.js +8 -3
- package/es/Messages/MessageBanner.js +75 -0
- package/es/Messages/MessageBox.js +123 -0
- package/es/{MessageBox → Messages}/MessageBoxTag.js +1 -1
- package/es/{MessageBox → Messages}/index.js +3 -3
- package/es/MyNdla/Resource/Folder.js +7 -7
- package/es/MyNdla/index.js +1 -2
- package/es/Programme/Programme.js +6 -6
- package/es/Programme/ProgrammeSubjects.js +2 -2
- package/es/Resource/ListResource.js +6 -6
- package/es/Resource/resourceComponents.js +8 -8
- package/es/TagSelector/SuggestionInput.js +111 -56
- package/es/TagSelector/Suggestions.js +19 -15
- package/es/TagSelector/TagSelector.js +8 -7
- package/es/Topic/Topic.js +22 -24
- package/es/TopicMenu/TopicMenu.js +2 -4
- package/es/TreeStructure/FolderItem.js +5 -5
- package/es/TreeStructure/FolderItems.js +3 -3
- package/es/TreeStructure/TreeStructure.js +51 -73
- package/es/TreeStructure/keyboardNavigation/keyboardNavigation.js +23 -11
- package/es/index.js +2 -2
- package/es/locale/messages-en.js +9 -1
- package/es/locale/messages-nb.js +10 -2
- package/es/locale/messages-nn.js +11 -3
- package/es/locale/messages-se.js +10 -2
- package/es/locale/messages-sma.js +10 -2
- package/lib/Article/Article.js +3 -3
- package/lib/Article/ArticleFavoritesButton.js +4 -3
- package/lib/Breadcrumblist/Breadcrumblist.js +7 -7
- package/lib/Frontpage/FrontpageAllSubjects.js +9 -9
- package/lib/Masthead/Masthead.js +2 -3
- package/lib/Masthead/MastheadAuthModal.js +14 -7
- package/lib/Messages/MessageBanner.d.ts +16 -0
- package/lib/Messages/MessageBanner.js +78 -0
- package/lib/{MessageBox → Messages}/MessageBox.d.ts +6 -14
- package/lib/Messages/MessageBox.js +128 -0
- package/lib/{MessageBox → Messages}/MessageBoxTag.d.ts +0 -0
- package/lib/{MessageBox → Messages}/MessageBoxTag.js +1 -1
- package/lib/{MessageBox → Messages}/index.d.ts +3 -3
- package/lib/Messages/index.js +31 -0
- package/lib/MyNdla/Resource/Folder.js +7 -7
- package/lib/MyNdla/index.d.ts +1 -2
- package/lib/MyNdla/index.js +0 -8
- package/lib/Programme/Programme.js +6 -6
- package/lib/Programme/ProgrammeSubjects.js +3 -3
- package/lib/Resource/ListResource.js +6 -6
- package/lib/Resource/resourceComponents.js +8 -8
- package/lib/TagSelector/SuggestionInput.js +111 -57
- package/lib/TagSelector/Suggestions.js +26 -23
- package/lib/TagSelector/TagSelector.js +8 -7
- package/lib/Topic/Topic.js +22 -24
- package/lib/TopicMenu/TopicMenu.js +2 -4
- package/lib/TreeStructure/FolderItem.js +5 -5
- package/lib/TreeStructure/FolderItems.js +3 -3
- package/lib/TreeStructure/TreeStructure.js +52 -73
- package/lib/TreeStructure/TreeStructure.types.d.ts +2 -2
- package/lib/TreeStructure/keyboardNavigation/keyboardNavigation.js +23 -11
- package/lib/TreeStructure/keyboardNavigation/keyboardNavigation.types.d.ts +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +6 -13
- package/lib/locale/messages-en.d.ts +8 -0
- package/lib/locale/messages-en.js +9 -1
- package/lib/locale/messages-nb.d.ts +8 -0
- package/lib/locale/messages-nb.js +10 -2
- package/lib/locale/messages-nn.d.ts +8 -0
- package/lib/locale/messages-nn.js +11 -3
- package/lib/locale/messages-se.d.ts +8 -0
- package/lib/locale/messages-se.js +10 -2
- package/lib/locale/messages-sma.d.ts +8 -0
- package/lib/locale/messages-sma.js +10 -2
- package/package.json +13 -13
- package/src/Article/Article.tsx +1 -1
- package/src/Article/ArticleFavoritesButton.tsx +4 -3
- package/src/Breadcrumblist/Breadcrumblist.tsx +1 -1
- package/src/Frontpage/FrontpageAllSubjects.tsx +1 -1
- package/src/Masthead/Masthead.tsx +3 -6
- package/src/Masthead/MastheadAuthModal.tsx +9 -0
- package/src/Messages/MessageBanner.tsx +66 -0
- package/src/Messages/MessageBox.tsx +156 -0
- package/src/{MessageBox → Messages}/MessageBoxTag.tsx +0 -0
- package/src/{MessageBox → Messages}/index.ts +3 -3
- package/src/MyNdla/Resource/Folder.tsx +2 -2
- package/src/MyNdla/index.ts +1 -2
- package/src/Programme/Programme.tsx +1 -1
- package/src/Programme/ProgrammeSubjects.tsx +1 -1
- package/src/Resource/ListResource.tsx +1 -1
- package/src/Resource/resourceComponents.tsx +3 -0
- package/src/TagSelector/SuggestionInput.tsx +90 -24
- package/src/TagSelector/Suggestions.tsx +14 -0
- package/src/TagSelector/TagSelector.tsx +6 -4
- package/src/Topic/Topic.tsx +2 -2
- package/src/TopicMenu/TopicMenu.jsx +2 -2
- package/src/TreeStructure/FolderItem.tsx +5 -2
- package/src/TreeStructure/FolderItems.tsx +1 -1
- package/src/TreeStructure/TreeStructure.tsx +33 -35
- package/src/TreeStructure/TreeStructure.types.ts +2 -2
- package/src/TreeStructure/keyboardNavigation/keyboardNavigation.ts +7 -7
- package/src/TreeStructure/keyboardNavigation/keyboardNavigation.types.ts +1 -1
- package/src/index.ts +2 -2
- package/src/locale/messages-en.ts +10 -1
- package/src/locale/messages-nb.ts +10 -2
- package/src/locale/messages-nn.ts +11 -3
- package/src/locale/messages-se.ts +10 -2
- package/src/locale/messages-sma.ts +10 -2
- package/es/MessageBox/MessageBox.js +0 -220
- package/es/MyNdla/Navigation/VerticalNavigation.js +0 -51
- package/es/MyNdla/Navigation/index.js +0 -2
- package/lib/MessageBox/MessageBox.js +0 -234
- package/lib/MessageBox/index.js +0 -35
- package/lib/MyNdla/Navigation/VerticalNavigation.d.ts +0 -10
- package/lib/MyNdla/Navigation/VerticalNavigation.js +0 -61
- package/lib/MyNdla/Navigation/index.d.ts +0 -2
- package/lib/MyNdla/Navigation/index.js +0 -15
- package/src/MessageBox/MessageBox.tsx +0 -201
- package/src/MyNdla/Navigation/VerticalNavigation.tsx +0 -93
- package/src/MyNdla/Navigation/index.ts +0 -2
|
@@ -50,7 +50,7 @@ var traverseUpwards = function traverseUpwards(inital, setFocusedFolderId, paths
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
var keyboardNavigation = function keyboardNavigation(_ref) {
|
|
53
|
-
var _document$activeEleme, _elementWithKeyFocus$
|
|
53
|
+
var _document$activeEleme, _elementWithKeyFocus$5;
|
|
54
54
|
|
|
55
55
|
var e = _ref.e,
|
|
56
56
|
data = _ref.data,
|
|
@@ -79,7 +79,7 @@ var keyboardNavigation = function keyboardNavigation(_ref) {
|
|
|
79
79
|
if (dataId === id) {
|
|
80
80
|
elementWithKeyFocus.paths = paths;
|
|
81
81
|
elementWithKeyFocus.index = _index;
|
|
82
|
-
elementWithKeyFocus.isOpen = openFolders.
|
|
82
|
+
elementWithKeyFocus.isOpen = openFolders.includes(dataId) && childData && childData.length > 0;
|
|
83
83
|
elementWithKeyFocus.data = childData;
|
|
84
84
|
elementWithKeyFocus.parent = parent;
|
|
85
85
|
elementWithKeyFocus.parentId = parentId;
|
|
@@ -92,9 +92,11 @@ var keyboardNavigation = function keyboardNavigation(_ref) {
|
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
if (!updatePathToElementWithKeyFocus(data, [], data)) {
|
|
95
|
+
var _data$;
|
|
96
|
+
|
|
95
97
|
// Couldn't find its location in the tree.
|
|
96
98
|
// This should not happen, reset its value to root.
|
|
97
|
-
setFocusedFolderId(e.key === 'ArrowDown' ? data[0]
|
|
99
|
+
setFocusedFolderId(e.key === 'ArrowDown' ? (_data$ = data[0]) === null || _data$ === void 0 ? void 0 : _data$.id : undefined);
|
|
98
100
|
return;
|
|
99
101
|
}
|
|
100
102
|
|
|
@@ -130,7 +132,9 @@ var keyboardNavigation = function keyboardNavigation(_ref) {
|
|
|
130
132
|
}
|
|
131
133
|
|
|
132
134
|
if (!id && e.key === 'ArrowDown') {
|
|
133
|
-
|
|
135
|
+
var _data$2;
|
|
136
|
+
|
|
137
|
+
setFocusedFolderId((_data$2 = data[0]) === null || _data$2 === void 0 ? void 0 : _data$2.id);
|
|
134
138
|
return;
|
|
135
139
|
}
|
|
136
140
|
|
|
@@ -141,9 +145,13 @@ var keyboardNavigation = function keyboardNavigation(_ref) {
|
|
|
141
145
|
|
|
142
146
|
if (e.key === 'ArrowUp') {
|
|
143
147
|
if (elementWithKeyFocus.index > 0) {
|
|
148
|
+
var _elementWithKeyFocus$2;
|
|
149
|
+
|
|
144
150
|
// Move upwards to the parent folder
|
|
145
|
-
setFocusedFolderId(elementWithKeyFocus.parent ? elementWithKeyFocus.parent[elementWithKeyFocus.index - 1].id : undefined);
|
|
151
|
+
setFocusedFolderId(elementWithKeyFocus.parent ? (_elementWithKeyFocus$2 = elementWithKeyFocus.parent[elementWithKeyFocus.index - 1]) === null || _elementWithKeyFocus$2 === void 0 ? void 0 : _elementWithKeyFocus$2.id : undefined);
|
|
146
152
|
} else if (elementWithKeyFocus.paths.length > 0) {
|
|
153
|
+
var _findParent$parentsCu;
|
|
154
|
+
|
|
147
155
|
elementWithKeyFocus.paths.pop();
|
|
148
156
|
var findParent = data;
|
|
149
157
|
elementWithKeyFocus.paths.forEach(function (index) {
|
|
@@ -153,17 +161,19 @@ var keyboardNavigation = function keyboardNavigation(_ref) {
|
|
|
153
161
|
var id = _ref3.id;
|
|
154
162
|
return id === elementWithKeyFocus.parentId;
|
|
155
163
|
});
|
|
156
|
-
setFocusedFolderId(findParent[parentsCurrentIndex].id);
|
|
164
|
+
setFocusedFolderId((_findParent$parentsCu = findParent[parentsCurrentIndex]) === null || _findParent$parentsCu === void 0 ? void 0 : _findParent$parentsCu.id);
|
|
157
165
|
}
|
|
158
166
|
|
|
159
167
|
return;
|
|
160
168
|
}
|
|
161
169
|
|
|
162
170
|
if (elementWithKeyFocus.isOpen) {
|
|
163
|
-
var _elementWithKeyFocus$
|
|
171
|
+
var _elementWithKeyFocus$3;
|
|
172
|
+
|
|
173
|
+
if ((_elementWithKeyFocus$3 = elementWithKeyFocus.data) === null || _elementWithKeyFocus$3 === void 0 ? void 0 : _elementWithKeyFocus$3.length) {
|
|
174
|
+
var _elementWithKeyFocus$4;
|
|
164
175
|
|
|
165
|
-
|
|
166
|
-
setFocusedFolderId(elementWithKeyFocus.data[0].id);
|
|
176
|
+
setFocusedFolderId((_elementWithKeyFocus$4 = elementWithKeyFocus.data[0]) === null || _elementWithKeyFocus$4 === void 0 ? void 0 : _elementWithKeyFocus$4.id);
|
|
167
177
|
} else {
|
|
168
178
|
// move to next child of parent if any... need new traverse :-/
|
|
169
179
|
traverseUpwards(data, setFocusedFolderId, elementWithKeyFocus.paths, elementWithKeyFocus.index);
|
|
@@ -172,9 +182,11 @@ var keyboardNavigation = function keyboardNavigation(_ref) {
|
|
|
172
182
|
return;
|
|
173
183
|
}
|
|
174
184
|
|
|
175
|
-
if (elementWithKeyFocus.parent && elementWithKeyFocus.index < ((_elementWithKeyFocus$
|
|
185
|
+
if (elementWithKeyFocus.parent && elementWithKeyFocus.index < ((_elementWithKeyFocus$5 = elementWithKeyFocus.parent) === null || _elementWithKeyFocus$5 === void 0 ? void 0 : _elementWithKeyFocus$5.length) - 1) {
|
|
186
|
+
var _elementWithKeyFocus$6;
|
|
187
|
+
|
|
176
188
|
// Move downwards to the next child
|
|
177
|
-
setFocusedFolderId(elementWithKeyFocus.parent[elementWithKeyFocus.index + 1].id);
|
|
189
|
+
setFocusedFolderId((_elementWithKeyFocus$6 = elementWithKeyFocus.parent[elementWithKeyFocus.index + 1]) === null || _elementWithKeyFocus$6 === void 0 ? void 0 : _elementWithKeyFocus$6.id);
|
|
178
190
|
return;
|
|
179
191
|
}
|
|
180
192
|
|
|
@@ -11,7 +11,7 @@ export interface KeyboardNavigationProps {
|
|
|
11
11
|
e: React.KeyboardEvent<HTMLElement>;
|
|
12
12
|
data: FolderStructureProps[];
|
|
13
13
|
setFocusedFolderId: SetFocusedFolderId;
|
|
14
|
-
openFolders:
|
|
14
|
+
openFolders: string[];
|
|
15
15
|
onToggleOpen: (id: string) => void;
|
|
16
16
|
focusedFolderId: string | undefined;
|
|
17
17
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export { default as AuthModal } from './User';
|
|
|
45
45
|
export type { FeideGoGroup, FeideGroup, FeideOrg, FeideUserApiType, FeideMembershipType, FeideUser } from './User';
|
|
46
46
|
export { default as CreatedBy } from './CreatedBy';
|
|
47
47
|
export { default as Breadcrumblist } from './Breadcrumblist';
|
|
48
|
-
export { MessageBox, MessageBoxTag,
|
|
48
|
+
export { MessageBox, MessageBoxTag, MessageBanner } from './Messages';
|
|
49
49
|
export { ResourceBox } from './ResourceBox';
|
|
50
50
|
export { default as AudioPlayer, initAudioPlayers } from './AudioPlayer';
|
|
51
51
|
export { NavigationHeading, NavigationBox, NavigationTopicAbout } from './Navigation';
|
|
@@ -80,7 +80,7 @@ export { default as ContentPlaceholder } from './ContentPlaceholder';
|
|
|
80
80
|
export { Notion, ConceptNotion } from './Notion';
|
|
81
81
|
export type { NotionVisualElementType, ConceptNotionType } from './Notion';
|
|
82
82
|
export { BannerCard } from './BannerCard';
|
|
83
|
-
export {
|
|
83
|
+
export { Folder, FolderInput } from './MyNdla';
|
|
84
84
|
export { ListResource, BlockResource } from './Resource';
|
|
85
85
|
export type { ListResourceProps } from './Resource';
|
|
86
86
|
export type { TagType } from './TagSelector';
|
package/lib/index.js
CHANGED
|
@@ -95,7 +95,7 @@ var _exportNames = {
|
|
|
95
95
|
Breadcrumblist: true,
|
|
96
96
|
MessageBox: true,
|
|
97
97
|
MessageBoxTag: true,
|
|
98
|
-
|
|
98
|
+
MessageBanner: true,
|
|
99
99
|
ResourceBox: true,
|
|
100
100
|
AudioPlayer: true,
|
|
101
101
|
initAudioPlayers: true,
|
|
@@ -179,7 +179,6 @@ var _exportNames = {
|
|
|
179
179
|
Notion: true,
|
|
180
180
|
ConceptNotion: true,
|
|
181
181
|
BannerCard: true,
|
|
182
|
-
VerticalNavigation: true,
|
|
183
182
|
Folder: true,
|
|
184
183
|
FolderInput: true,
|
|
185
184
|
ListResource: true,
|
|
@@ -714,19 +713,19 @@ Object.defineProperty(exports, "Breadcrumblist", {
|
|
|
714
713
|
Object.defineProperty(exports, "MessageBox", {
|
|
715
714
|
enumerable: true,
|
|
716
715
|
get: function get() {
|
|
717
|
-
return
|
|
716
|
+
return _Messages.MessageBox;
|
|
718
717
|
}
|
|
719
718
|
});
|
|
720
719
|
Object.defineProperty(exports, "MessageBoxTag", {
|
|
721
720
|
enumerable: true,
|
|
722
721
|
get: function get() {
|
|
723
|
-
return
|
|
722
|
+
return _Messages.MessageBoxTag;
|
|
724
723
|
}
|
|
725
724
|
});
|
|
726
|
-
Object.defineProperty(exports, "
|
|
725
|
+
Object.defineProperty(exports, "MessageBanner", {
|
|
727
726
|
enumerable: true,
|
|
728
727
|
get: function get() {
|
|
729
|
-
return
|
|
728
|
+
return _Messages.MessageBanner;
|
|
730
729
|
}
|
|
731
730
|
});
|
|
732
731
|
Object.defineProperty(exports, "ResourceBox", {
|
|
@@ -1227,12 +1226,6 @@ Object.defineProperty(exports, "BannerCard", {
|
|
|
1227
1226
|
return _BannerCard.BannerCard;
|
|
1228
1227
|
}
|
|
1229
1228
|
});
|
|
1230
|
-
Object.defineProperty(exports, "VerticalNavigation", {
|
|
1231
|
-
enumerable: true,
|
|
1232
|
-
get: function get() {
|
|
1233
|
-
return _MyNdla.VerticalNavigation;
|
|
1234
|
-
}
|
|
1235
|
-
});
|
|
1236
1229
|
Object.defineProperty(exports, "Folder", {
|
|
1237
1230
|
enumerable: true,
|
|
1238
1231
|
get: function get() {
|
|
@@ -1361,7 +1354,7 @@ var _CreatedBy = _interopRequireDefault(require("./CreatedBy"));
|
|
|
1361
1354
|
|
|
1362
1355
|
var _Breadcrumblist = _interopRequireDefault(require("./Breadcrumblist"));
|
|
1363
1356
|
|
|
1364
|
-
var
|
|
1357
|
+
var _Messages = require("./Messages");
|
|
1365
1358
|
|
|
1366
1359
|
var _ResourceBox = require("./ResourceBox");
|
|
1367
1360
|
|
|
@@ -53,6 +53,7 @@ declare const messages: {
|
|
|
53
53
|
close: string;
|
|
54
54
|
};
|
|
55
55
|
myNdla: {
|
|
56
|
+
myNDLA: string;
|
|
56
57
|
resources: string;
|
|
57
58
|
resources_plural: string;
|
|
58
59
|
folders: string;
|
|
@@ -64,6 +65,8 @@ declare const messages: {
|
|
|
64
65
|
newFolderUnder: string;
|
|
65
66
|
myAccount: string;
|
|
66
67
|
favourites: string;
|
|
68
|
+
addToFavourites: string;
|
|
69
|
+
alreadyFavourited: string;
|
|
67
70
|
help: string;
|
|
68
71
|
more: string;
|
|
69
72
|
listView: string;
|
|
@@ -124,6 +127,10 @@ declare const messages: {
|
|
|
124
127
|
help: string;
|
|
125
128
|
};
|
|
126
129
|
treeStructure: {
|
|
130
|
+
folderChildOptions: {
|
|
131
|
+
edit: string;
|
|
132
|
+
delete: string;
|
|
133
|
+
};
|
|
127
134
|
createFolder: string;
|
|
128
135
|
newFolder: {
|
|
129
136
|
placeholder: string;
|
|
@@ -131,6 +138,7 @@ declare const messages: {
|
|
|
131
138
|
};
|
|
132
139
|
};
|
|
133
140
|
tagSelector: {
|
|
141
|
+
label: string;
|
|
134
142
|
placeholder: string;
|
|
135
143
|
removeTag: string;
|
|
136
144
|
hideAllTags: string;
|
|
@@ -29,6 +29,10 @@ var titleTemplate = ' - NDLA';
|
|
|
29
29
|
|
|
30
30
|
var messages = _objectSpread(_objectSpread({
|
|
31
31
|
treeStructure: {
|
|
32
|
+
folderChildOptions: {
|
|
33
|
+
edit: 'Edit foldername',
|
|
34
|
+
"delete": 'Delete'
|
|
35
|
+
},
|
|
32
36
|
createFolder: 'Create folder',
|
|
33
37
|
newFolder: {
|
|
34
38
|
placeholder: 'Add foldername',
|
|
@@ -36,7 +40,8 @@ var messages = _objectSpread(_objectSpread({
|
|
|
36
40
|
}
|
|
37
41
|
},
|
|
38
42
|
tagSelector: {
|
|
39
|
-
|
|
43
|
+
label: 'Add tag',
|
|
44
|
+
placeholder: 'Enter tag name',
|
|
40
45
|
removeTag: 'Remove tag {{name}}',
|
|
41
46
|
hideAllTags: 'Hide all tags',
|
|
42
47
|
showAllTags: 'Show all tags'
|
|
@@ -940,6 +945,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
940
945
|
close: 'Close fact box'
|
|
941
946
|
},
|
|
942
947
|
myNdla: {
|
|
948
|
+
myNDLA: 'My NDLA',
|
|
943
949
|
resources: '{{count}} Resource',
|
|
944
950
|
resources_plural: '{{count}} Resources',
|
|
945
951
|
folders: '{{count}} Folder',
|
|
@@ -951,6 +957,8 @@ var messages = _objectSpread(_objectSpread({
|
|
|
951
957
|
newFolderUnder: 'Create new folder under {{folderName}}',
|
|
952
958
|
myAccount: 'My account',
|
|
953
959
|
favourites: 'Favourites',
|
|
960
|
+
addToFavourites: 'Add to my favourites',
|
|
961
|
+
alreadyFavourited: 'Already in my favourites',
|
|
954
962
|
help: 'Help',
|
|
955
963
|
more: 'More options',
|
|
956
964
|
listView: 'List view',
|
|
@@ -53,6 +53,7 @@ declare const messages: {
|
|
|
53
53
|
close: string;
|
|
54
54
|
};
|
|
55
55
|
myNdla: {
|
|
56
|
+
myNDLA: string;
|
|
56
57
|
resources: string;
|
|
57
58
|
resources_plural: string;
|
|
58
59
|
folders: string;
|
|
@@ -64,6 +65,8 @@ declare const messages: {
|
|
|
64
65
|
newFolderUnder: string;
|
|
65
66
|
myAccount: string;
|
|
66
67
|
favourites: string;
|
|
68
|
+
addToFavourites: string;
|
|
69
|
+
alreadyFavourited: string;
|
|
67
70
|
help: string;
|
|
68
71
|
more: string;
|
|
69
72
|
listView: string;
|
|
@@ -124,6 +127,10 @@ declare const messages: {
|
|
|
124
127
|
help: string;
|
|
125
128
|
};
|
|
126
129
|
treeStructure: {
|
|
130
|
+
folderChildOptions: {
|
|
131
|
+
edit: string;
|
|
132
|
+
delete: string;
|
|
133
|
+
};
|
|
127
134
|
createFolder: string;
|
|
128
135
|
newFolder: {
|
|
129
136
|
placeholder: string;
|
|
@@ -131,6 +138,7 @@ declare const messages: {
|
|
|
131
138
|
};
|
|
132
139
|
};
|
|
133
140
|
tagSelector: {
|
|
141
|
+
label: string;
|
|
134
142
|
placeholder: string;
|
|
135
143
|
removeTag: string;
|
|
136
144
|
hideAllTags: string;
|
|
@@ -29,6 +29,10 @@ var titleTemplate = ' - NDLA';
|
|
|
29
29
|
|
|
30
30
|
var messages = _objectSpread(_objectSpread({
|
|
31
31
|
treeStructure: {
|
|
32
|
+
folderChildOptions: {
|
|
33
|
+
edit: 'Endre mappenavn',
|
|
34
|
+
"delete": 'Slett'
|
|
35
|
+
},
|
|
32
36
|
createFolder: 'Lag mappe',
|
|
33
37
|
newFolder: {
|
|
34
38
|
placeholder: 'Skriv navn på mappe',
|
|
@@ -36,8 +40,9 @@ var messages = _objectSpread(_objectSpread({
|
|
|
36
40
|
}
|
|
37
41
|
},
|
|
38
42
|
tagSelector: {
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
label: 'Legg til tag',
|
|
44
|
+
placeholder: 'Skriv tag navn',
|
|
45
|
+
removeTag: 'Ta vekk {{name}}',
|
|
41
46
|
hideAllTags: 'Skjul alle tagger',
|
|
42
47
|
showAllTags: 'Vis alle tagger'
|
|
43
48
|
},
|
|
@@ -940,6 +945,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
940
945
|
close: 'Lukk faktaboks'
|
|
941
946
|
},
|
|
942
947
|
myNdla: {
|
|
948
|
+
myNDLA: 'Min NDLA',
|
|
943
949
|
resources: '{{count}} ressurs',
|
|
944
950
|
resources_plural: '{{count}} ressurser',
|
|
945
951
|
folders: '{{count}} mappe',
|
|
@@ -951,6 +957,8 @@ var messages = _objectSpread(_objectSpread({
|
|
|
951
957
|
newFolderUnder: 'Lag ny mappe under {{folderName}}',
|
|
952
958
|
myAccount: 'Min konto',
|
|
953
959
|
favourites: 'Favoritter',
|
|
960
|
+
addToFavourites: 'Legg til i mine favoritter',
|
|
961
|
+
alreadyFavourited: 'Allerede lagt til i mine favoritter',
|
|
954
962
|
help: 'Hjelp',
|
|
955
963
|
more: 'Flere valg',
|
|
956
964
|
listView: 'Listevisning',
|
|
@@ -53,6 +53,7 @@ declare const messages: {
|
|
|
53
53
|
close: string;
|
|
54
54
|
};
|
|
55
55
|
myNdla: {
|
|
56
|
+
myNDLA: string;
|
|
56
57
|
resources: string;
|
|
57
58
|
resources_plural: string;
|
|
58
59
|
folders: string;
|
|
@@ -64,6 +65,8 @@ declare const messages: {
|
|
|
64
65
|
newFolderUnder: string;
|
|
65
66
|
myAccount: string;
|
|
66
67
|
favourites: string;
|
|
68
|
+
addToFavourites: string;
|
|
69
|
+
alreadyFavourited: string;
|
|
67
70
|
help: string;
|
|
68
71
|
more: string;
|
|
69
72
|
listView: string;
|
|
@@ -124,6 +127,10 @@ declare const messages: {
|
|
|
124
127
|
help: string;
|
|
125
128
|
};
|
|
126
129
|
treeStructure: {
|
|
130
|
+
folderChildOptions: {
|
|
131
|
+
edit: string;
|
|
132
|
+
delete: string;
|
|
133
|
+
};
|
|
127
134
|
createFolder: string;
|
|
128
135
|
newFolder: {
|
|
129
136
|
placeholder: string;
|
|
@@ -131,6 +138,7 @@ declare const messages: {
|
|
|
131
138
|
};
|
|
132
139
|
};
|
|
133
140
|
tagSelector: {
|
|
141
|
+
label: string;
|
|
134
142
|
placeholder: string;
|
|
135
143
|
removeTag: string;
|
|
136
144
|
hideAllTags: string;
|
|
@@ -29,15 +29,20 @@ var titleTemplate = ' - NDLA';
|
|
|
29
29
|
|
|
30
30
|
var messages = _objectSpread(_objectSpread({
|
|
31
31
|
treeStructure: {
|
|
32
|
+
folderChildOptions: {
|
|
33
|
+
edit: 'Endre mappenamn',
|
|
34
|
+
"delete": 'Slett'
|
|
35
|
+
},
|
|
32
36
|
createFolder: 'Lag mappe',
|
|
33
37
|
newFolder: {
|
|
34
|
-
placeholder: 'Skriv
|
|
38
|
+
placeholder: 'Skriv namn på mappe',
|
|
35
39
|
defaultName: 'Ny mappe'
|
|
36
40
|
}
|
|
37
41
|
},
|
|
38
42
|
tagSelector: {
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
label: 'Legg til tag',
|
|
44
|
+
placeholder: 'Skriv tag namn',
|
|
45
|
+
removeTag: 'Ta vekk {{name}}',
|
|
41
46
|
hideAllTags: 'Skjul alle tagger',
|
|
42
47
|
showAllTags: 'Vis alle tagger'
|
|
43
48
|
},
|
|
@@ -940,6 +945,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
940
945
|
close: 'Lukk faktaboks'
|
|
941
946
|
},
|
|
942
947
|
myNdla: {
|
|
948
|
+
myNDLA: 'Min NDLA',
|
|
943
949
|
resources: '{{count}} ressurs',
|
|
944
950
|
resources_plural: '{{count}} ressursar',
|
|
945
951
|
folders: '{{count}} mappe',
|
|
@@ -951,6 +957,8 @@ var messages = _objectSpread(_objectSpread({
|
|
|
951
957
|
newFolderUnder: 'Lag ny mappe under {{folderName}}',
|
|
952
958
|
myAccount: 'Min konto',
|
|
953
959
|
favourites: 'Favorittar',
|
|
960
|
+
addToFavourites: 'Legg til i mine favorittar',
|
|
961
|
+
alreadyFavourited: 'Allereie lagt til i mine favorittar',
|
|
954
962
|
help: 'Hjelp',
|
|
955
963
|
more: 'Fleire val',
|
|
956
964
|
listView: 'Listevisning',
|
|
@@ -53,6 +53,7 @@ declare const messages: {
|
|
|
53
53
|
close: string;
|
|
54
54
|
};
|
|
55
55
|
myNdla: {
|
|
56
|
+
myNDLA: string;
|
|
56
57
|
resources: string;
|
|
57
58
|
resources_plural: string;
|
|
58
59
|
folders: string;
|
|
@@ -64,6 +65,8 @@ declare const messages: {
|
|
|
64
65
|
newFolderUnder: string;
|
|
65
66
|
myAccount: string;
|
|
66
67
|
favourites: string;
|
|
68
|
+
addToFavourites: string;
|
|
69
|
+
alreadyFavourited: string;
|
|
67
70
|
help: string;
|
|
68
71
|
more: string;
|
|
69
72
|
listView: string;
|
|
@@ -124,6 +127,10 @@ declare const messages: {
|
|
|
124
127
|
help: string;
|
|
125
128
|
};
|
|
126
129
|
treeStructure: {
|
|
130
|
+
folderChildOptions: {
|
|
131
|
+
edit: string;
|
|
132
|
+
delete: string;
|
|
133
|
+
};
|
|
127
134
|
createFolder: string;
|
|
128
135
|
newFolder: {
|
|
129
136
|
placeholder: string;
|
|
@@ -131,6 +138,7 @@ declare const messages: {
|
|
|
131
138
|
};
|
|
132
139
|
};
|
|
133
140
|
tagSelector: {
|
|
141
|
+
label: string;
|
|
134
142
|
placeholder: string;
|
|
135
143
|
removeTag: string;
|
|
136
144
|
hideAllTags: string;
|
|
@@ -29,6 +29,10 @@ var titleTemplate = ' - NDLA';
|
|
|
29
29
|
|
|
30
30
|
var messages = _objectSpread(_objectSpread({
|
|
31
31
|
treeStructure: {
|
|
32
|
+
folderChildOptions: {
|
|
33
|
+
edit: 'Endre mappenavn',
|
|
34
|
+
"delete": 'Slett'
|
|
35
|
+
},
|
|
32
36
|
createFolder: 'Lag mappe',
|
|
33
37
|
newFolder: {
|
|
34
38
|
placeholder: 'Skriv navn på mappe',
|
|
@@ -36,8 +40,9 @@ var messages = _objectSpread(_objectSpread({
|
|
|
36
40
|
}
|
|
37
41
|
},
|
|
38
42
|
tagSelector: {
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
label: 'Legg til tag',
|
|
44
|
+
placeholder: 'Skriv tag navn',
|
|
45
|
+
removeTag: 'Ta vekk {{name}}',
|
|
41
46
|
hideAllTags: 'Skjul alla tags',
|
|
42
47
|
showAllTags: 'Vis alla tags'
|
|
43
48
|
},
|
|
@@ -940,6 +945,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
940
945
|
close: 'Lukk faktaboks'
|
|
941
946
|
},
|
|
942
947
|
myNdla: {
|
|
948
|
+
myNDLA: 'Min NDLA',
|
|
943
949
|
resources: '{{count}} ressurs',
|
|
944
950
|
resources_plural: '{{count}} ressurser',
|
|
945
951
|
folders: '{{count}} mappe',
|
|
@@ -951,6 +957,8 @@ var messages = _objectSpread(_objectSpread({
|
|
|
951
957
|
newFolderUnder: 'Lag ny mappe under {{folderName}}',
|
|
952
958
|
myAccount: 'Min konto',
|
|
953
959
|
favourites: 'Favoritter',
|
|
960
|
+
addToFavourites: 'Legg til i mine favoritter',
|
|
961
|
+
alreadyFavourited: 'Allerede lagt til i mine favoritter',
|
|
954
962
|
help: 'Hjelp',
|
|
955
963
|
more: 'Flere valg',
|
|
956
964
|
listView: 'Listevisning',
|
|
@@ -53,6 +53,7 @@ declare const messages: {
|
|
|
53
53
|
close: string;
|
|
54
54
|
};
|
|
55
55
|
myNdla: {
|
|
56
|
+
myNDLA: string;
|
|
56
57
|
resources: string;
|
|
57
58
|
resources_plural: string;
|
|
58
59
|
folders: string;
|
|
@@ -64,6 +65,8 @@ declare const messages: {
|
|
|
64
65
|
newFolderUnder: string;
|
|
65
66
|
myAccount: string;
|
|
66
67
|
favourites: string;
|
|
68
|
+
addToFavourites: string;
|
|
69
|
+
alreadyFavourited: string;
|
|
67
70
|
help: string;
|
|
68
71
|
more: string;
|
|
69
72
|
listView: string;
|
|
@@ -124,6 +127,10 @@ declare const messages: {
|
|
|
124
127
|
help: string;
|
|
125
128
|
};
|
|
126
129
|
treeStructure: {
|
|
130
|
+
folderChildOptions: {
|
|
131
|
+
edit: string;
|
|
132
|
+
delete: string;
|
|
133
|
+
};
|
|
127
134
|
createFolder: string;
|
|
128
135
|
newFolder: {
|
|
129
136
|
placeholder: string;
|
|
@@ -131,6 +138,7 @@ declare const messages: {
|
|
|
131
138
|
};
|
|
132
139
|
};
|
|
133
140
|
tagSelector: {
|
|
141
|
+
label: string;
|
|
134
142
|
placeholder: string;
|
|
135
143
|
removeTag: string;
|
|
136
144
|
hideAllTags: string;
|
|
@@ -29,6 +29,10 @@ var titleTemplate = ' - NDLA';
|
|
|
29
29
|
|
|
30
30
|
var messages = _objectSpread(_objectSpread({
|
|
31
31
|
treeStructure: {
|
|
32
|
+
folderChildOptions: {
|
|
33
|
+
edit: 'Endre mappenavn',
|
|
34
|
+
"delete": 'Slett'
|
|
35
|
+
},
|
|
32
36
|
createFolder: 'Lag mappe',
|
|
33
37
|
newFolder: {
|
|
34
38
|
placeholder: 'Skriv navn på mappe',
|
|
@@ -36,8 +40,9 @@ var messages = _objectSpread(_objectSpread({
|
|
|
36
40
|
}
|
|
37
41
|
},
|
|
38
42
|
tagSelector: {
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
label: 'Legg til tag',
|
|
44
|
+
placeholder: 'Skriv tag navn',
|
|
45
|
+
removeTag: 'Ta vekk {{name}}',
|
|
41
46
|
hideAllTags: 'Skjul alle tagger',
|
|
42
47
|
showAllTags: 'Vis alle tagger'
|
|
43
48
|
},
|
|
@@ -940,6 +945,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
940
945
|
close: 'Lukk faktaboks'
|
|
941
946
|
},
|
|
942
947
|
myNdla: {
|
|
948
|
+
myNDLA: 'Min NDLA',
|
|
943
949
|
resources: '{{count}} ressurs',
|
|
944
950
|
resources_plural: '{{count}} ressurser',
|
|
945
951
|
folders: '{{count}} mappe',
|
|
@@ -951,6 +957,8 @@ var messages = _objectSpread(_objectSpread({
|
|
|
951
957
|
newFolderUnder: 'Lag ny mappe under {{folderName}}',
|
|
952
958
|
myAccount: 'Min konto',
|
|
953
959
|
favourites: 'Favoritter',
|
|
960
|
+
addToFavourites: 'Legg til i mine favoritter',
|
|
961
|
+
alreadyFavourited: 'Allerede lagt til i mine favoritter',
|
|
954
962
|
help: 'Hjelp',
|
|
955
963
|
more: 'Flere valg',
|
|
956
964
|
listView: 'Listevisning',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.1",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -31,18 +31,18 @@
|
|
|
31
31
|
"types"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ndla/button": "^2.
|
|
35
|
-
"@ndla/carousel": "^1.2.
|
|
36
|
-
"@ndla/core": "^2.
|
|
34
|
+
"@ndla/button": "^2.6.0",
|
|
35
|
+
"@ndla/carousel": "^1.2.11",
|
|
36
|
+
"@ndla/core": "^2.3.0",
|
|
37
37
|
"@ndla/hooks": "^1.1.4",
|
|
38
|
-
"@ndla/icons": "^1.
|
|
39
|
-
"@ndla/licenses": "^5.0.
|
|
40
|
-
"@ndla/modal": "^1.2.
|
|
41
|
-
"@ndla/notion": "^3.1.
|
|
42
|
-
"@ndla/safelink": "^2.0.
|
|
43
|
-
"@ndla/switch": "^0.1.
|
|
44
|
-
"@ndla/tabs": "^1.1.
|
|
45
|
-
"@ndla/tooltip": "^2.1.
|
|
38
|
+
"@ndla/icons": "^1.10.0",
|
|
39
|
+
"@ndla/licenses": "^5.0.2",
|
|
40
|
+
"@ndla/modal": "^1.2.12",
|
|
41
|
+
"@ndla/notion": "^3.1.17",
|
|
42
|
+
"@ndla/safelink": "^2.0.8",
|
|
43
|
+
"@ndla/switch": "^0.1.7",
|
|
44
|
+
"@ndla/tabs": "^1.1.10",
|
|
45
|
+
"@ndla/tooltip": "^2.1.2",
|
|
46
46
|
"@ndla/util": "^3.0.0",
|
|
47
47
|
"@reach/menu-button": "^0.16.2",
|
|
48
48
|
"@reach/slider": "^0.16.0",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "841ff68015ec6032bed44a7c25eea2dfd9088a64"
|
|
85
85
|
}
|
package/src/Article/Article.tsx
CHANGED
|
@@ -24,7 +24,7 @@ import LayoutItem from '../Layout';
|
|
|
24
24
|
import ArticleHeaderWrapper from './ArticleHeaderWrapper';
|
|
25
25
|
import ArticleNotions, { NotionRelatedContent } from './ArticleNotions';
|
|
26
26
|
import ArticleAccessMessage from './ArticleAccessMessage';
|
|
27
|
-
import MessageBox from '../
|
|
27
|
+
import MessageBox from '../Messages/MessageBox';
|
|
28
28
|
import { ConceptNotionType } from '../Notion/ConceptNotion';
|
|
29
29
|
|
|
30
30
|
const classes = new BEMHelper({
|
|
@@ -23,14 +23,15 @@ export const ArticleFavoritesButton = ({ isFavorite, onToggleAddToFavorites, art
|
|
|
23
23
|
const removeFromFavoritesLabel = t('myNdla.resource.addToMyNdla');
|
|
24
24
|
const addToFavoritesLabel = t('myNdla.resource.addedToMyNdla');
|
|
25
25
|
return (
|
|
26
|
-
<Tooltip tooltip={isFavorite ?
|
|
26
|
+
<Tooltip tooltip={isFavorite ? addToFavoritesLabel : removeFromFavoritesLabel}>
|
|
27
27
|
<IconButtonDualStates
|
|
28
|
-
ariaLabelActive={
|
|
29
|
-
ariaLabelInActive={
|
|
28
|
+
ariaLabelActive={t('myNdla.addToFavourites')}
|
|
29
|
+
ariaLabelInActive={t('myNdla.alreadyFavourited')}
|
|
30
30
|
activeIcon={<Heart />}
|
|
31
31
|
inactiveIcon={<HeartOutline />}
|
|
32
32
|
active={isFavorite}
|
|
33
33
|
size="small"
|
|
34
|
+
ghostPill
|
|
34
35
|
onClick={() => onToggleAddToFavorites(articleId, !isFavorite)}
|
|
35
36
|
/>
|
|
36
37
|
</Tooltip>
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from '@ndla/icons/action';
|
|
19
19
|
import SafeLink from '@ndla/safelink';
|
|
20
20
|
import { useTranslation } from 'react-i18next';
|
|
21
|
-
import MessageBoxTag from '../
|
|
21
|
+
import MessageBoxTag from '../Messages/MessageBoxTag';
|
|
22
22
|
import { useMastheadHeight } from '../Masthead';
|
|
23
23
|
|
|
24
24
|
type WrapperProps = {
|
|
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
4
4
|
import Tabs from '@ndla/tabs';
|
|
5
5
|
import SafeLink from '@ndla/safelink';
|
|
6
6
|
import { colors, fonts, mq, breakpoints } from '@ndla/core';
|
|
7
|
-
import { MessageBox } from '../
|
|
7
|
+
import { MessageBox } from '../Messages';
|
|
8
8
|
// @ts-ignore
|
|
9
9
|
import { ToggleItem } from '../Filter';
|
|
10
10
|
|