@bigbinary/neeto-tags-frontend 2.0.2 → 2.1.0
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/dist/NeetoTags.js +1505 -0
- package/dist/NeetoTags.js.map +1 -0
- package/dist/TagsComponent.js +329 -0
- package/dist/TagsComponent.js.map +1 -0
- package/dist/{index.cjs.js → cjs/NeetoTags.js} +58 -608
- package/dist/cjs/NeetoTags.js.map +1 -0
- package/dist/cjs/TagsComponent.js +345 -0
- package/dist/cjs/TagsComponent.js.map +1 -0
- package/dist/cjs/index.js +62 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/utils.js +15 -0
- package/dist/cjs/utils.js.map +1 -0
- package/dist/defineProperty-e90a259c.js +43 -0
- package/dist/defineProperty-e90a259c.js.map +1 -0
- package/dist/defineProperty-f3094d6c.js +45 -0
- package/dist/defineProperty-f3094d6c.js.map +1 -0
- package/dist/index.js +51 -2042
- package/dist/index.js.map +1 -1
- package/dist/inject-css-1ae98bac.js +64 -0
- package/dist/inject-css-1ae98bac.js.map +1 -0
- package/dist/inject-css-b9fd625c.js +59 -0
- package/dist/inject-css-b9fd625c.js.map +1 -0
- package/dist/useTagsApi-dd5d0ddd.js +143 -0
- package/dist/useTagsApi-dd5d0ddd.js.map +1 -0
- package/dist/useTagsApi-f9fc52a2.js +158 -0
- package/dist/useTagsApi-f9fc52a2.js.map +1 -0
- package/dist/utils.js +7 -0
- package/dist/utils.js.map +1 -0
- package/package.json +23 -11
- package/dist/index.cjs.js.map +0 -1
|
@@ -0,0 +1,1505 @@
|
|
|
1
|
+
import { _ as _defineProperty } from './defineProperty-e90a259c.js';
|
|
2
|
+
import { _ as _arrayLikeToArray, a as _unsupportedIterableToArray, b as _slicedToArray, n } from './inject-css-b9fd625c.js';
|
|
3
|
+
import { useRef, useState, useMemo, createElement } from 'react';
|
|
4
|
+
import { useHistory, Switch, Route } from 'react-router-dom';
|
|
5
|
+
import { showThumbsUpToastr, buildUrl, getQueryParams } from '@bigbinary/neeto-commons-frontend/utils';
|
|
6
|
+
import { noop, isPresent, existsById, removeById } from '@bigbinary/neeto-cist';
|
|
7
|
+
import { DEFAULT_PAGE_INDEX, DEFAULT_PAGE_SIZE, PLURAL, SINGULAR } from '@bigbinary/neeto-commons-frontend/constants';
|
|
8
|
+
import { useFuncDebounce, handleMetaClick, useQueryParams, withT } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
9
|
+
import { buildFiltersFromURL, Bar } from '@bigbinary/neeto-filters-frontend';
|
|
10
|
+
import Container from '@bigbinary/neeto-molecules/Container';
|
|
11
|
+
import SubHeader from '@bigbinary/neeto-molecules/SubHeader';
|
|
12
|
+
import Alert from '@bigbinary/neetoui/Alert';
|
|
13
|
+
import Typography from '@bigbinary/neetoui/Typography';
|
|
14
|
+
import { mergeLeft, pluck, isEmpty } from 'ramda';
|
|
15
|
+
import { useTranslation, Trans } from 'react-i18next';
|
|
16
|
+
import { P as PANE_TYPES, u as useUpdateTag, a as useCreateTag, I as INITIAL_TAG_VALUES, b as useFetchTags, c as useDeleteTag, d as useMergeTags, q as queryClient } from './useTagsApi-dd5d0ddd.js';
|
|
17
|
+
import Tab from '@bigbinary/neetoui/Tab';
|
|
18
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
19
|
+
import { t } from 'i18next';
|
|
20
|
+
import * as yup from 'yup';
|
|
21
|
+
import NeetoHeader from '@bigbinary/neeto-molecules/Header';
|
|
22
|
+
import Button from '@bigbinary/neetoui/Button';
|
|
23
|
+
import Pane from '@bigbinary/neetoui/Pane';
|
|
24
|
+
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
25
|
+
import Form from '@bigbinary/neetoui/formik/Form';
|
|
26
|
+
import Input from '@bigbinary/neetoui/formik/Input';
|
|
27
|
+
import Textarea from '@bigbinary/neetoui/formik/Textarea';
|
|
28
|
+
import TableWrapper from '@bigbinary/neeto-molecules/TableWrapper';
|
|
29
|
+
import NeetoUITable from '@bigbinary/neetoui/Table';
|
|
30
|
+
import NoData from '@bigbinary/neetoui/NoData';
|
|
31
|
+
import MenuHorizontal from '@bigbinary/neeto-icons/MenuHorizontal';
|
|
32
|
+
import Dropdown from '@bigbinary/neetoui/Dropdown';
|
|
33
|
+
import Tag from '@bigbinary/neetoui/Tag';
|
|
34
|
+
import NeetoUITagMergeIcon from '@bigbinary/neeto-icons/Merge';
|
|
35
|
+
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
36
|
+
import classNames from 'classnames';
|
|
37
|
+
import Check from '@bigbinary/neeto-icons/Check';
|
|
38
|
+
import Input$1 from '@bigbinary/neetoui/Input';
|
|
39
|
+
import Modal from '@bigbinary/neetoui/Modal';
|
|
40
|
+
import { QueryClientProvider } from '@tanstack/react-query';
|
|
41
|
+
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
|
42
|
+
import '@bigbinary/neetoui/Toastr';
|
|
43
|
+
import 'axios';
|
|
44
|
+
|
|
45
|
+
function _arrayWithoutHoles(arr) {
|
|
46
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function _iterableToArray(iter) {
|
|
50
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function _nonIterableSpread() {
|
|
54
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function _toConsumableArray(arr) {
|
|
58
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
var Menu$1 = function Menu(_ref) {
|
|
62
|
+
var tagTypes = _ref.tagTypes,
|
|
63
|
+
tagType = _ref.tagType,
|
|
64
|
+
setTagType = _ref.setTagType;
|
|
65
|
+
return /*#__PURE__*/jsx(Tab, {
|
|
66
|
+
className: "mb-6",
|
|
67
|
+
children: Object.values(tagTypes).map(function (tag) {
|
|
68
|
+
return /*#__PURE__*/jsx(Tab.Item, {
|
|
69
|
+
active: tagType.id === tag.id,
|
|
70
|
+
description: tag.description,
|
|
71
|
+
onClick: function onClick() {
|
|
72
|
+
setTagType(tag);
|
|
73
|
+
},
|
|
74
|
+
children: tag.label
|
|
75
|
+
}, tag.id);
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
var TAG_NAME_MAX_LENGTH = 50;
|
|
81
|
+
var TAG_DESCRIPTION_ROW_LENGTH = 3;
|
|
82
|
+
var TAG_DESCRIPTION_MAX_LENGTH = 255;
|
|
83
|
+
var TAG_SCHEMA = yup.object().shape({
|
|
84
|
+
name: yup.string().typeError(t("neetoTags.validation.nameMustBeString")).required(t("neetoTags.validation.nameRequired")).max(TAG_NAME_MAX_LENGTH, t("neetoTags.validation.nameMaxLength", {
|
|
85
|
+
length: TAG_NAME_MAX_LENGTH
|
|
86
|
+
})),
|
|
87
|
+
description: yup.string().typeError(t("neetoTags.validation.descriptionMustBeString")).nullable().max(TAG_DESCRIPTION_MAX_LENGTH, t("neetoTags.validation.descriptionMaxLength", {
|
|
88
|
+
length: TAG_DESCRIPTION_MAX_LENGTH
|
|
89
|
+
}))
|
|
90
|
+
});
|
|
91
|
+
var TAGS_FORMIK_PROPS = {
|
|
92
|
+
validateOnBlur: true,
|
|
93
|
+
validateOnChange: true,
|
|
94
|
+
validationSchema: TAG_SCHEMA
|
|
95
|
+
};
|
|
96
|
+
var DEFAULT_FILTERS = {
|
|
97
|
+
page: DEFAULT_PAGE_INDEX,
|
|
98
|
+
pageSize: DEFAULT_PAGE_SIZE,
|
|
99
|
+
sortBy: "",
|
|
100
|
+
orderBy: ""
|
|
101
|
+
};
|
|
102
|
+
var NEETO_FILTERS = [{
|
|
103
|
+
key: "name",
|
|
104
|
+
label: t("neetoTags.common.name"),
|
|
105
|
+
node: "name",
|
|
106
|
+
type: "text"
|
|
107
|
+
}];
|
|
108
|
+
|
|
109
|
+
var Header = function Header(_ref) {
|
|
110
|
+
var breadcrumbs = _ref.breadcrumbs,
|
|
111
|
+
title = _ref.title,
|
|
112
|
+
_ref$tagsMergable = _ref.tagsMergable,
|
|
113
|
+
tagsMergable = _ref$tagsMergable === void 0 ? false : _ref$tagsMergable,
|
|
114
|
+
setPaneType = _ref.setPaneType,
|
|
115
|
+
setSelectedTag = _ref.setSelectedTag,
|
|
116
|
+
_ref$goToFirstPage = _ref.goToFirstPage,
|
|
117
|
+
goToFirstPage = _ref$goToFirstPage === void 0 ? noop : _ref$goToFirstPage,
|
|
118
|
+
_ref$tagsPath = _ref.tagsPath,
|
|
119
|
+
tagsPath = _ref$tagsPath === void 0 ? "" : _ref$tagsPath,
|
|
120
|
+
data = _ref.data,
|
|
121
|
+
_ref$showFilters = _ref.showFilters,
|
|
122
|
+
showFilters = _ref$showFilters === void 0 ? true : _ref$showFilters;
|
|
123
|
+
var _useTranslation = useTranslation(),
|
|
124
|
+
t = _useTranslation.t;
|
|
125
|
+
var history = useHistory();
|
|
126
|
+
var resetPage = useFuncDebounce(function () {
|
|
127
|
+
return goToFirstPage();
|
|
128
|
+
});
|
|
129
|
+
return /*#__PURE__*/jsx(NeetoHeader, {
|
|
130
|
+
breadcrumbs: breadcrumbs,
|
|
131
|
+
title: title || t("neetoTags.common.tag", PLURAL),
|
|
132
|
+
actionBlock: /*#__PURE__*/jsxs(Fragment, {
|
|
133
|
+
children: [tagsMergable && /*#__PURE__*/jsx(Button, {
|
|
134
|
+
"data-cy": "neeto-tags-merge-tags-button",
|
|
135
|
+
disabled: (data === null || data === void 0 ? void 0 : data.tags.length) < PLURAL.count,
|
|
136
|
+
label: t("neetoTags.common.mergeTag", PLURAL),
|
|
137
|
+
style: "secondary",
|
|
138
|
+
onClick: handleMetaClick(history, "".concat(tagsPath, "/merge"))
|
|
139
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
140
|
+
"data-cy": "add-new-tag-button",
|
|
141
|
+
label: t("neetoTags.common.addNewTag", SINGULAR),
|
|
142
|
+
onClick: function onClick() {
|
|
143
|
+
setSelectedTag(null);
|
|
144
|
+
setPaneType(PANE_TYPES.CREATE);
|
|
145
|
+
}
|
|
146
|
+
})]
|
|
147
|
+
}),
|
|
148
|
+
searchProps: showFilters && {
|
|
149
|
+
"data-cy": "neeto-tags-search-text-input-field",
|
|
150
|
+
onChange: resetPage,
|
|
151
|
+
placeholder: t("neetoTags.placeholder.searchTags")
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
var useTagsForm = function useTagsForm(_ref) {
|
|
157
|
+
var createTags = _ref.createTags,
|
|
158
|
+
goToFirstPage = _ref.goToFirstPage,
|
|
159
|
+
isEdit = _ref.isEdit,
|
|
160
|
+
onClose = _ref.onClose,
|
|
161
|
+
tagType = _ref.tagType,
|
|
162
|
+
updateTags = _ref.updateTags;
|
|
163
|
+
var tagModification = isEdit ? useUpdateTag : useCreateTag;
|
|
164
|
+
var tagOperation = isEdit ? updateTags : createTags;
|
|
165
|
+
var _tagModification = tagModification(),
|
|
166
|
+
mutate = _tagModification.mutate,
|
|
167
|
+
isSubmitting = _tagModification.isPending;
|
|
168
|
+
var handleSubmit = function handleSubmit(values, _ref2) {
|
|
169
|
+
var _values$description;
|
|
170
|
+
var resetForm = _ref2.resetForm;
|
|
171
|
+
values.description = values === null || values === void 0 || (_values$description = values.description) === null || _values$description === void 0 ? void 0 : _values$description.trim();
|
|
172
|
+
var tagData = {
|
|
173
|
+
payload: {
|
|
174
|
+
tag: values
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
tagData.url = tagType.url;
|
|
178
|
+
if (isEdit) {
|
|
179
|
+
tagData.id = values.id;
|
|
180
|
+
}
|
|
181
|
+
mutate(tagData, {
|
|
182
|
+
onSuccess: function onSuccess() {
|
|
183
|
+
var _tagOperation$onSucce;
|
|
184
|
+
!isEdit && goToFirstPage();
|
|
185
|
+
tagOperation === null || tagOperation === void 0 || (_tagOperation$onSucce = tagOperation.onSuccess) === null || _tagOperation$onSucce === void 0 || _tagOperation$onSucce.callback();
|
|
186
|
+
onClose();
|
|
187
|
+
},
|
|
188
|
+
onError: function onError() {
|
|
189
|
+
resetForm();
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
return {
|
|
194
|
+
handleSubmit: handleSubmit,
|
|
195
|
+
isSubmitting: isSubmitting
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
200
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
201
|
+
var ManageTags = function ManageTags(_ref) {
|
|
202
|
+
var createTags = _ref.createTags,
|
|
203
|
+
goToFirstPage = _ref.goToFirstPage,
|
|
204
|
+
onClose = _ref.onClose,
|
|
205
|
+
tag = _ref.tag,
|
|
206
|
+
tagType = _ref.tagType,
|
|
207
|
+
type = _ref.type,
|
|
208
|
+
updateTags = _ref.updateTags;
|
|
209
|
+
var _useTranslation = useTranslation(),
|
|
210
|
+
t = _useTranslation.t;
|
|
211
|
+
var isEdit = type === PANE_TYPES.EDIT;
|
|
212
|
+
var initialValues = isEdit ? tag : INITIAL_TAG_VALUES;
|
|
213
|
+
var inputReference = useRef(null);
|
|
214
|
+
var _useTagsForm = useTagsForm({
|
|
215
|
+
createTags: createTags,
|
|
216
|
+
goToFirstPage: goToFirstPage,
|
|
217
|
+
isEdit: isEdit,
|
|
218
|
+
onClose: onClose,
|
|
219
|
+
tagType: tagType,
|
|
220
|
+
updateTags: updateTags
|
|
221
|
+
}),
|
|
222
|
+
handleSubmit = _useTagsForm.handleSubmit,
|
|
223
|
+
isSubmitting = _useTagsForm.isSubmitting;
|
|
224
|
+
return /*#__PURE__*/jsxs(Pane, {
|
|
225
|
+
onClose: onClose,
|
|
226
|
+
initialFocusRef: inputReference,
|
|
227
|
+
isOpen: !!type,
|
|
228
|
+
children: [/*#__PURE__*/jsx(Pane.Header, {
|
|
229
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
230
|
+
style: "h2",
|
|
231
|
+
weight: "semibold",
|
|
232
|
+
children: isEdit ? t("neetoTags.common.editTag") : t("neetoTags.common.addNewTag", SINGULAR)
|
|
233
|
+
})
|
|
234
|
+
}), /*#__PURE__*/jsxs(Form, {
|
|
235
|
+
formikProps: _objectSpread$5(_objectSpread$5({}, TAGS_FORMIK_PROPS), {}, {
|
|
236
|
+
initialValues: initialValues,
|
|
237
|
+
onSubmit: handleSubmit
|
|
238
|
+
}),
|
|
239
|
+
children: [/*#__PURE__*/jsx(Pane.Body, {
|
|
240
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
241
|
+
className: "neeto-ui-flex neeto-ui-w-full neeto-ui-flex-col neeto-ui-gap-4",
|
|
242
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
243
|
+
required: true,
|
|
244
|
+
unlimitedChars: true,
|
|
245
|
+
"data-cy": "tag-name-text-field",
|
|
246
|
+
label: t("neetoTags.common.name"),
|
|
247
|
+
maxLength: TAG_NAME_MAX_LENGTH,
|
|
248
|
+
name: "name",
|
|
249
|
+
ref: inputReference
|
|
250
|
+
}), /*#__PURE__*/jsx(Textarea, {
|
|
251
|
+
unlimitedChars: true,
|
|
252
|
+
"data-cy": "tag-description-text-area",
|
|
253
|
+
label: t("neetoTags.common.description"),
|
|
254
|
+
maxLength: TAG_DESCRIPTION_MAX_LENGTH,
|
|
255
|
+
name: "description",
|
|
256
|
+
rows: TAG_DESCRIPTION_ROW_LENGTH
|
|
257
|
+
})]
|
|
258
|
+
})
|
|
259
|
+
}), /*#__PURE__*/jsx(Pane.Footer, {
|
|
260
|
+
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
261
|
+
isSubmitting: isSubmitting,
|
|
262
|
+
cancelButtonProps: {
|
|
263
|
+
"data-cy": "neeto-tags-manage-tag-cancel-button",
|
|
264
|
+
onClick: onClose
|
|
265
|
+
},
|
|
266
|
+
submitButtonProps: {
|
|
267
|
+
"data-cy": "neeto-tags-manage-tag-submit-button"
|
|
268
|
+
}
|
|
269
|
+
})
|
|
270
|
+
})]
|
|
271
|
+
})]
|
|
272
|
+
});
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
var Menu = Dropdown.Menu,
|
|
276
|
+
MenuItem = Dropdown.MenuItem;
|
|
277
|
+
var renderDropdownButton = function renderDropdownButton(_ref) {
|
|
278
|
+
var _ref$handleEdit = _ref.handleEdit,
|
|
279
|
+
handleEdit = _ref$handleEdit === void 0 ? noop : _ref$handleEdit,
|
|
280
|
+
_ref$handleDelete = _ref.handleDelete,
|
|
281
|
+
handleDelete = _ref$handleDelete === void 0 ? noop : _ref$handleDelete,
|
|
282
|
+
_ref$tag = _ref.tag,
|
|
283
|
+
tag = _ref$tag === void 0 ? {} : _ref$tag;
|
|
284
|
+
return /*#__PURE__*/jsx("div", {
|
|
285
|
+
onClick: function onClick(e) {
|
|
286
|
+
return e.stopPropagation();
|
|
287
|
+
},
|
|
288
|
+
children: /*#__PURE__*/jsx(Dropdown, {
|
|
289
|
+
autoWidth: true,
|
|
290
|
+
buttonProps: {
|
|
291
|
+
style: "text"
|
|
292
|
+
},
|
|
293
|
+
icon: MenuHorizontal,
|
|
294
|
+
position: "bottom-end",
|
|
295
|
+
strategy: "fixed",
|
|
296
|
+
children: /*#__PURE__*/jsxs(Menu, {
|
|
297
|
+
children: [/*#__PURE__*/jsx(MenuItem.Button, {
|
|
298
|
+
"data-cy": "tags-edit-button",
|
|
299
|
+
onClick: function onClick() {
|
|
300
|
+
return handleEdit(tag);
|
|
301
|
+
},
|
|
302
|
+
children: t("neetoTags.button.edit")
|
|
303
|
+
}), /*#__PURE__*/jsx(MenuItem.Button, {
|
|
304
|
+
"data-cy": "tags-delete-button",
|
|
305
|
+
onClick: function onClick() {
|
|
306
|
+
return handleDelete(tag);
|
|
307
|
+
},
|
|
308
|
+
children: t("neetoTags.button.delete")
|
|
309
|
+
})]
|
|
310
|
+
})
|
|
311
|
+
})
|
|
312
|
+
});
|
|
313
|
+
};
|
|
314
|
+
var renderColumnData = function renderColumnData(handleEdit, handleDelete) {
|
|
315
|
+
var columns = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
316
|
+
return [{
|
|
317
|
+
title: t("neetoTags.common.name"),
|
|
318
|
+
dataIndex: "name",
|
|
319
|
+
key: "name",
|
|
320
|
+
width: "400px",
|
|
321
|
+
render: function render(name, tag) {
|
|
322
|
+
return /*#__PURE__*/jsxs("div", {
|
|
323
|
+
className: "neeto-tags-table__column",
|
|
324
|
+
children: [/*#__PURE__*/jsx(Tag, {
|
|
325
|
+
label: name,
|
|
326
|
+
style: "secondary"
|
|
327
|
+
}), renderDropdownButton({
|
|
328
|
+
handleEdit: handleEdit,
|
|
329
|
+
handleDelete: handleDelete,
|
|
330
|
+
tag: tag
|
|
331
|
+
})]
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
}, {
|
|
335
|
+
title: t("neetoTags.common.description"),
|
|
336
|
+
dataIndex: "description",
|
|
337
|
+
key: "description",
|
|
338
|
+
width: "400px",
|
|
339
|
+
render: function render(description) {
|
|
340
|
+
return description || "-";
|
|
341
|
+
}
|
|
342
|
+
}].concat(_toConsumableArray(columns));
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
346
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
347
|
+
var Table = function Table(_ref) {
|
|
348
|
+
var _data$tags;
|
|
349
|
+
var data = _ref.data,
|
|
350
|
+
filters = _ref.filters,
|
|
351
|
+
handleDelete = _ref.handleDelete,
|
|
352
|
+
handleEdit = _ref.handleEdit,
|
|
353
|
+
handleOnChange = _ref.handleOnChange,
|
|
354
|
+
isLoading = _ref.isLoading,
|
|
355
|
+
onTagRowClick = _ref.onTagRowClick,
|
|
356
|
+
primaryButtonProps = _ref.primaryButtonProps,
|
|
357
|
+
tagType = _ref.tagType,
|
|
358
|
+
noDataProps = _ref.noDataProps;
|
|
359
|
+
var _useTranslation = useTranslation(),
|
|
360
|
+
t = _useTranslation.t;
|
|
361
|
+
if (!isLoading && !(data !== null && data !== void 0 && (_data$tags = data.tags) !== null && _data$tags !== void 0 && _data$tags.length)) {
|
|
362
|
+
return /*#__PURE__*/jsx("div", {
|
|
363
|
+
className: "ntm-empty-state",
|
|
364
|
+
"data-cy": "empty-state-container",
|
|
365
|
+
children: /*#__PURE__*/jsx(NoData, _objectSpread$4(_objectSpread$4({}, _objectSpread$4({
|
|
366
|
+
primaryButtonProps: primaryButtonProps
|
|
367
|
+
}, noDataProps)), {}, {
|
|
368
|
+
title: t("neetoTags.title.noTagsToShow")
|
|
369
|
+
}))
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
return /*#__PURE__*/jsx(TableWrapper, {
|
|
373
|
+
hasPagination: (data === null || data === void 0 ? void 0 : data.totalCount) > filters.pageSize,
|
|
374
|
+
children: /*#__PURE__*/jsx(NeetoUITable, {
|
|
375
|
+
fixedHeight: true,
|
|
376
|
+
allowRowClick: !!onTagRowClick,
|
|
377
|
+
columnData: renderColumnData(handleEdit, handleDelete, tagType.columns),
|
|
378
|
+
currentPageNumber: filters.page,
|
|
379
|
+
defaultPageSize: filters.pageSize,
|
|
380
|
+
loading: isLoading,
|
|
381
|
+
paginationProps: {
|
|
382
|
+
showSizeChanger: false
|
|
383
|
+
},
|
|
384
|
+
rowData: data === null || data === void 0 ? void 0 : data.tags,
|
|
385
|
+
rowSelection: false,
|
|
386
|
+
scroll: {
|
|
387
|
+
x: "100%"
|
|
388
|
+
},
|
|
389
|
+
totalCount: data === null || data === void 0 ? void 0 : data.totalCount,
|
|
390
|
+
onChange: handleOnChange,
|
|
391
|
+
onRowClick: function onRowClick(event, record, rowIndex) {
|
|
392
|
+
return onTagRowClick({
|
|
393
|
+
event: event,
|
|
394
|
+
tag: record,
|
|
395
|
+
rowIndex: rowIndex
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
})
|
|
399
|
+
});
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
403
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
404
|
+
var Dashboard = function Dashboard(_ref) {
|
|
405
|
+
var breadcrumbs = _ref.breadcrumbs,
|
|
406
|
+
title = _ref.title,
|
|
407
|
+
createTags = _ref.createTags,
|
|
408
|
+
deleteTags = _ref.deleteTags,
|
|
409
|
+
displayMenu = _ref.displayMenu,
|
|
410
|
+
onTagRowClick = _ref.onTagRowClick,
|
|
411
|
+
_ref$tagsMergable = _ref.tagsMergable,
|
|
412
|
+
tagsMergable = _ref$tagsMergable === void 0 ? false : _ref$tagsMergable,
|
|
413
|
+
tagsPath = _ref.tagsPath,
|
|
414
|
+
tagType = _ref.tagType,
|
|
415
|
+
updateTags = _ref.updateTags,
|
|
416
|
+
setTagType = _ref.setTagType,
|
|
417
|
+
tagTypes = _ref.tagTypes,
|
|
418
|
+
_ref$noDataProps = _ref.noDataProps,
|
|
419
|
+
noDataProps = _ref$noDataProps === void 0 ? {} : _ref$noDataProps;
|
|
420
|
+
var history = useHistory();
|
|
421
|
+
var queryParams = useQueryParams();
|
|
422
|
+
var _queryParams$searchTe = queryParams.searchTerm,
|
|
423
|
+
searchTerm = _queryParams$searchTe === void 0 ? "" : _queryParams$searchTe;
|
|
424
|
+
var searchKeywordProps = {
|
|
425
|
+
node: "name",
|
|
426
|
+
value: searchTerm,
|
|
427
|
+
key: "search_term"
|
|
428
|
+
};
|
|
429
|
+
var _useState = useState(null),
|
|
430
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
431
|
+
selectedTag = _useState2[0],
|
|
432
|
+
setSelectedTag = _useState2[1];
|
|
433
|
+
var _useState3 = useState(null),
|
|
434
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
435
|
+
paneType = _useState4[0],
|
|
436
|
+
setPaneType = _useState4[1];
|
|
437
|
+
var _useState5 = useState(false),
|
|
438
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
439
|
+
isDeleteAlertOpen = _useState6[0],
|
|
440
|
+
setIsDeleteAlertOpen = _useState6[1];
|
|
441
|
+
var _useState7 = useState(DEFAULT_FILTERS),
|
|
442
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
443
|
+
filters = _useState8[0],
|
|
444
|
+
setFilters = _useState8[1];
|
|
445
|
+
var _useState9 = useState(false),
|
|
446
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
447
|
+
isFiltersPaneOpen = _useState10[0],
|
|
448
|
+
setIsFiltersPaneOpen = _useState10[1];
|
|
449
|
+
var _useState11 = useState(buildFiltersFromURL([].concat(_toConsumableArray(NEETO_FILTERS), [searchKeywordProps]))),
|
|
450
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
451
|
+
neetoFilters = _useState12[0],
|
|
452
|
+
setNeetoFilters = _useState12[1];
|
|
453
|
+
var _useFetchTags = useFetchTags(_objectSpread$3({
|
|
454
|
+
url: tagType.url,
|
|
455
|
+
neetoFilters: neetoFilters
|
|
456
|
+
}, filters)),
|
|
457
|
+
data = _useFetchTags.data,
|
|
458
|
+
isLoading = _useFetchTags.isLoading;
|
|
459
|
+
var _useTranslation = useTranslation(),
|
|
460
|
+
t = _useTranslation.t;
|
|
461
|
+
var primaryButtonProps = {
|
|
462
|
+
"data-cy": "add-new-tag-button",
|
|
463
|
+
label: t("neetoTags.common.addNewTag", SINGULAR),
|
|
464
|
+
onClick: function onClick() {
|
|
465
|
+
setSelectedTag(null);
|
|
466
|
+
setPaneType(PANE_TYPES.CREATE);
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
var handleEdit = function handleEdit(tag) {
|
|
470
|
+
setSelectedTag(tag);
|
|
471
|
+
setPaneType(PANE_TYPES.EDIT);
|
|
472
|
+
};
|
|
473
|
+
var handleDelete = function handleDelete(tag) {
|
|
474
|
+
setSelectedTag(tag);
|
|
475
|
+
setIsDeleteAlertOpen(true);
|
|
476
|
+
};
|
|
477
|
+
var handleAlertClose = function handleAlertClose() {
|
|
478
|
+
setIsDeleteAlertOpen(false);
|
|
479
|
+
setSelectedTag(null);
|
|
480
|
+
};
|
|
481
|
+
var handleOnChange = function handleOnChange(_ref2, _, _ref3) {
|
|
482
|
+
var page = _ref2.current;
|
|
483
|
+
var sortBy = _ref3.field,
|
|
484
|
+
orderBy = _ref3.order;
|
|
485
|
+
return setFilters(mergeLeft({
|
|
486
|
+
page: page,
|
|
487
|
+
sortBy: orderBy && sortBy,
|
|
488
|
+
orderBy: orderBy
|
|
489
|
+
}));
|
|
490
|
+
};
|
|
491
|
+
var _useDeleteTag = useDeleteTag(),
|
|
492
|
+
mutate = _useDeleteTag.mutate,
|
|
493
|
+
isDeletingTag = _useDeleteTag.isPending;
|
|
494
|
+
var handleConfirmDelete = function handleConfirmDelete() {
|
|
495
|
+
var payload = {
|
|
496
|
+
url: tagType.url,
|
|
497
|
+
id: selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.id
|
|
498
|
+
};
|
|
499
|
+
var isNotDeleting = !isDeletingTag && isDeleteAlertOpen;
|
|
500
|
+
isNotDeleting && mutate(payload, {
|
|
501
|
+
onSuccess: function onSuccess() {
|
|
502
|
+
var _data$tags, _deleteTags$onSuccess;
|
|
503
|
+
setIsDeleteAlertOpen(false);
|
|
504
|
+
if ((data === null || data === void 0 || (_data$tags = data.tags) === null || _data$tags === void 0 ? void 0 : _data$tags.length) === 1) {
|
|
505
|
+
setFilters(mergeLeft({
|
|
506
|
+
page: filters.page - 1
|
|
507
|
+
}));
|
|
508
|
+
}
|
|
509
|
+
deleteTags === null || deleteTags === void 0 || (_deleteTags$onSuccess = deleteTags.onSuccess) === null || _deleteTags$onSuccess === void 0 || _deleteTags$onSuccess.callback();
|
|
510
|
+
// @ts-ignore
|
|
511
|
+
showThumbsUpToastr();
|
|
512
|
+
}
|
|
513
|
+
});
|
|
514
|
+
};
|
|
515
|
+
var handleFiltersChange = function handleFiltersChange(filters) {
|
|
516
|
+
history.push(buildUrl(window.location.pathname, mergeLeft({
|
|
517
|
+
page: DEFAULT_PAGE_INDEX
|
|
518
|
+
}, queryParams)));
|
|
519
|
+
setNeetoFilters(filters);
|
|
520
|
+
};
|
|
521
|
+
var resetPage = function resetPage() {
|
|
522
|
+
return setFilters(mergeLeft({
|
|
523
|
+
page: DEFAULT_PAGE_INDEX
|
|
524
|
+
}));
|
|
525
|
+
};
|
|
526
|
+
var showFilters = isPresent(neetoFilters) || (data === null || data === void 0 ? void 0 : data.totalCount) > 0;
|
|
527
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
528
|
+
children: [/*#__PURE__*/jsxs(Container, {
|
|
529
|
+
children: [/*#__PURE__*/jsx(Header, {
|
|
530
|
+
breadcrumbs: breadcrumbs,
|
|
531
|
+
data: data,
|
|
532
|
+
displayMenu: displayMenu,
|
|
533
|
+
setPaneType: setPaneType,
|
|
534
|
+
setSelectedTag: setSelectedTag,
|
|
535
|
+
showFilters: showFilters,
|
|
536
|
+
tagsMergable: tagsMergable,
|
|
537
|
+
tagsPath: tagsPath,
|
|
538
|
+
title: title,
|
|
539
|
+
goToFirstPage: resetPage
|
|
540
|
+
}), showFilters && /*#__PURE__*/jsx(SubHeader, {
|
|
541
|
+
leftActionBlock: /*#__PURE__*/jsx(Typography, {
|
|
542
|
+
className: "neeto-ui-gray-800",
|
|
543
|
+
"data-cy": "neeto-tags-filtered-tags-count-text",
|
|
544
|
+
style: "h4",
|
|
545
|
+
weight: "semibold",
|
|
546
|
+
children: t("neetoTags.helper.tagWithCount", {
|
|
547
|
+
count: (data === null || data === void 0 ? void 0 : data.totalCount) || 0,
|
|
548
|
+
type: (tagType === null || tagType === void 0 ? void 0 : tagType.label) || ""
|
|
549
|
+
})
|
|
550
|
+
}),
|
|
551
|
+
rightActionBlock: /*#__PURE__*/jsx(SubHeader.RightBlock, {
|
|
552
|
+
filterProps: {
|
|
553
|
+
columns: NEETO_FILTERS,
|
|
554
|
+
isOpen: isFiltersPaneOpen,
|
|
555
|
+
setIsOpen: setIsFiltersPaneOpen,
|
|
556
|
+
onChange: handleFiltersChange,
|
|
557
|
+
keyword: searchKeywordProps
|
|
558
|
+
}
|
|
559
|
+
})
|
|
560
|
+
}), /*#__PURE__*/jsx(Bar, {
|
|
561
|
+
columns: NEETO_FILTERS,
|
|
562
|
+
isOpen: isFiltersPaneOpen,
|
|
563
|
+
keyword: searchKeywordProps,
|
|
564
|
+
onChange: handleFiltersChange
|
|
565
|
+
}), displayMenu && /*#__PURE__*/jsx(Menu$1, {
|
|
566
|
+
setTagType: setTagType,
|
|
567
|
+
tagType: tagType,
|
|
568
|
+
tagTypes: tagTypes
|
|
569
|
+
}), /*#__PURE__*/jsx(Table, {
|
|
570
|
+
data: data,
|
|
571
|
+
filters: filters,
|
|
572
|
+
handleDelete: handleDelete,
|
|
573
|
+
handleEdit: handleEdit,
|
|
574
|
+
handleOnChange: handleOnChange,
|
|
575
|
+
isLoading: isLoading,
|
|
576
|
+
noDataProps: noDataProps,
|
|
577
|
+
onTagRowClick: onTagRowClick,
|
|
578
|
+
primaryButtonProps: primaryButtonProps,
|
|
579
|
+
tagType: tagType
|
|
580
|
+
})]
|
|
581
|
+
}), /*#__PURE__*/jsx(ManageTags, {
|
|
582
|
+
createTags: createTags,
|
|
583
|
+
tagType: tagType,
|
|
584
|
+
updateTags: updateTags,
|
|
585
|
+
goToFirstPage: resetPage,
|
|
586
|
+
tag: selectedTag,
|
|
587
|
+
type: paneType,
|
|
588
|
+
onClose: function onClose() {
|
|
589
|
+
return setPaneType(null);
|
|
590
|
+
}
|
|
591
|
+
}), /*#__PURE__*/jsx(Alert, {
|
|
592
|
+
cancelButtonLabel: t("neetoTags.button.cancel"),
|
|
593
|
+
isOpen: isDeleteAlertOpen,
|
|
594
|
+
isSubmitting: isDeletingTag,
|
|
595
|
+
submitButtonLabel: t("neetoTags.button.delete"),
|
|
596
|
+
title: t("neetoTags.alert.title.deleteTag"),
|
|
597
|
+
message: /*#__PURE__*/jsx(Trans, {
|
|
598
|
+
i18nKey: "neetoTags.alert.message.deleteTag_",
|
|
599
|
+
values: {
|
|
600
|
+
name: selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.name
|
|
601
|
+
}
|
|
602
|
+
}),
|
|
603
|
+
onClose: handleAlertClose,
|
|
604
|
+
onSubmit: handleConfirmDelete
|
|
605
|
+
})]
|
|
606
|
+
});
|
|
607
|
+
};
|
|
608
|
+
|
|
609
|
+
var NO_DATA_PRIMARY_BUTTON_PROPS = {
|
|
610
|
+
"data-cy": "neeto-tags-go-back-button",
|
|
611
|
+
size: "small",
|
|
612
|
+
label: t("neetoTags.button.goBack")
|
|
613
|
+
};
|
|
614
|
+
|
|
615
|
+
var getListType = function getListType(_ref) {
|
|
616
|
+
var _ref$destinationTags = _ref.destinationTags,
|
|
617
|
+
destinationTags = _ref$destinationTags === void 0 ? [] : _ref$destinationTags,
|
|
618
|
+
_ref$isSource = _ref.isSource,
|
|
619
|
+
isSource = _ref$isSource === void 0 ? false : _ref$isSource,
|
|
620
|
+
_ref$sourceTags = _ref.sourceTags,
|
|
621
|
+
sourceTags = _ref$sourceTags === void 0 ? [] : _ref$sourceTags;
|
|
622
|
+
return isSource ? {
|
|
623
|
+
label: t("neetoTags.title.selectSourceTag", SINGULAR),
|
|
624
|
+
value: "source",
|
|
625
|
+
tagIds: pluck("id", sourceTags),
|
|
626
|
+
counterTagIds: pluck("id", destinationTags)
|
|
627
|
+
} : {
|
|
628
|
+
label: t("neetoTags.title.selectDestinationTag", SINGULAR),
|
|
629
|
+
value: "destination",
|
|
630
|
+
tagIds: pluck("id", destinationTags),
|
|
631
|
+
counterTagIds: pluck("id", sourceTags)
|
|
632
|
+
};
|
|
633
|
+
};
|
|
634
|
+
var orderBySourceTags = function orderBySourceTags(tags, sourceTags) {
|
|
635
|
+
var withoutSourceTags = tags.filter(function (tag) {
|
|
636
|
+
return sourceTags.every(function (sourceTag) {
|
|
637
|
+
return sourceTag.id !== tag.id;
|
|
638
|
+
});
|
|
639
|
+
});
|
|
640
|
+
return [].concat(_toConsumableArray(sourceTags), _toConsumableArray(withoutSourceTags));
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
var List = function List(_ref) {
|
|
644
|
+
var _ref$isSource = _ref.isSource,
|
|
645
|
+
isSource = _ref$isSource === void 0 ? false : _ref$isSource,
|
|
646
|
+
_ref$destinationTags = _ref.destinationTags,
|
|
647
|
+
destinationTags = _ref$destinationTags === void 0 ? [] : _ref$destinationTags,
|
|
648
|
+
onSelect = _ref.onSelect,
|
|
649
|
+
_ref$sourceTags = _ref.sourceTags,
|
|
650
|
+
sourceTags = _ref$sourceTags === void 0 ? [] : _ref$sourceTags,
|
|
651
|
+
_ref$tagList = _ref.tagList,
|
|
652
|
+
tagList = _ref$tagList === void 0 ? [] : _ref$tagList;
|
|
653
|
+
var _useTranslation = useTranslation(),
|
|
654
|
+
t = _useTranslation.t;
|
|
655
|
+
var _useState = useState(""),
|
|
656
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
657
|
+
searchTerm = _useState2[0],
|
|
658
|
+
setSearchTerm = _useState2[1];
|
|
659
|
+
var listType = useMemo(function () {
|
|
660
|
+
return getListType({
|
|
661
|
+
destinationTags: destinationTags,
|
|
662
|
+
isSource: isSource,
|
|
663
|
+
sourceTags: sourceTags
|
|
664
|
+
});
|
|
665
|
+
}, [isSource, sourceTags, destinationTags] // eslint-disable-line react-hooks/exhaustive-deps
|
|
666
|
+
);
|
|
667
|
+
|
|
668
|
+
var filteredTags = orderBySourceTags(tagList, sourceTags).filter(function (tag) {
|
|
669
|
+
var _tag$name;
|
|
670
|
+
return tag === null || tag === void 0 || (_tag$name = tag.name) === null || _tag$name === void 0 || (_tag$name = _tag$name.toLowerCase()) === null || _tag$name === void 0 ? void 0 : _tag$name.includes(searchTerm.toLowerCase().trim());
|
|
671
|
+
});
|
|
672
|
+
return /*#__PURE__*/jsxs("div", {
|
|
673
|
+
className: "neeto-tags-merge__list neeto-tags-border neeto-ui-border-gray-300 neeto-ui-shadow-xs neeto-ui-rounded-lg neeto-ui-flex neeto-ui-flex-col p-3 md:p-4 lg:p-6",
|
|
674
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
675
|
+
className: "neeto-ui-mb-3",
|
|
676
|
+
style: "h4",
|
|
677
|
+
children: listType.label
|
|
678
|
+
}), /*#__PURE__*/jsx(Input$1, {
|
|
679
|
+
"data-cy": "neeto-tags-merge-".concat(listType.value, "-search-text-input-field"),
|
|
680
|
+
placeholder: t("neetoTags.placeholder.searchTags"),
|
|
681
|
+
value: searchTerm,
|
|
682
|
+
onChange: function onChange(e) {
|
|
683
|
+
return setSearchTerm(e.target.value);
|
|
684
|
+
}
|
|
685
|
+
}), /*#__PURE__*/jsx("div", {
|
|
686
|
+
className: "neeto-tags-merge__items",
|
|
687
|
+
"data-cy": "neeto-tags-merge-".concat(listType.value, "-tags-list"),
|
|
688
|
+
children: filteredTags.map(function (tag) {
|
|
689
|
+
var selectedTagIds = listType.tagIds.includes(tag.id);
|
|
690
|
+
var selectedCounterTags = listType.counterTagIds.includes(tag.id);
|
|
691
|
+
return /*#__PURE__*/jsxs("div", {
|
|
692
|
+
"data-cy": "neeto-tags-merge-".concat(listType.value, "-tags"),
|
|
693
|
+
className: classNames("neeto-ui-flex neeto-ui-justify-between neeto-ui-items-center neeto-tags-border neeto-ui-border-white neeto-ui-p-2 neeto-ui-rounded-lg neeto-ui-mt-2 neeto-ui-cursor-pointer", {
|
|
694
|
+
"neeto-ui-bg-pastel-blue neeto-ui-border-primary-600": selectedTagIds,
|
|
695
|
+
"hover:neeto-ui-bg-gray-100": !selectedTagIds,
|
|
696
|
+
"neeto-ui-cursor-not-allowed neeto-ui-bg-gray-100 neeto-ui-text-gray-500": selectedCounterTags
|
|
697
|
+
}),
|
|
698
|
+
onClick: function onClick() {
|
|
699
|
+
return !selectedCounterTags && onSelect(tag, listType.value);
|
|
700
|
+
},
|
|
701
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
702
|
+
children: tag.name
|
|
703
|
+
}), selectedTagIds && /*#__PURE__*/jsx(Check, {
|
|
704
|
+
size: 18
|
|
705
|
+
})]
|
|
706
|
+
}, tag.id);
|
|
707
|
+
})
|
|
708
|
+
})]
|
|
709
|
+
});
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
713
|
+
|
|
714
|
+
function getDefaultExportFromCjs (x) {
|
|
715
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
function commonjsRequire(path) {
|
|
719
|
+
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
var pluralize$1 = {exports: {}};
|
|
723
|
+
|
|
724
|
+
/* global define */
|
|
725
|
+
pluralize$1.exports;
|
|
726
|
+
|
|
727
|
+
(function (module, exports) {
|
|
728
|
+
(function (root, pluralize) {
|
|
729
|
+
/* istanbul ignore else */
|
|
730
|
+
if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {
|
|
731
|
+
// Node.
|
|
732
|
+
module.exports = pluralize();
|
|
733
|
+
} else {
|
|
734
|
+
// Browser global.
|
|
735
|
+
root.pluralize = pluralize();
|
|
736
|
+
}
|
|
737
|
+
})(commonjsGlobal, function () {
|
|
738
|
+
// Rule storage - pluralize and singularize need to be run sequentially,
|
|
739
|
+
// while other rules can be optimized using an object for instant lookups.
|
|
740
|
+
var pluralRules = [];
|
|
741
|
+
var singularRules = [];
|
|
742
|
+
var uncountables = {};
|
|
743
|
+
var irregularPlurals = {};
|
|
744
|
+
var irregularSingles = {};
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* Sanitize a pluralization rule to a usable regular expression.
|
|
748
|
+
*
|
|
749
|
+
* @param {(RegExp|string)} rule
|
|
750
|
+
* @return {RegExp}
|
|
751
|
+
*/
|
|
752
|
+
function sanitizeRule (rule) {
|
|
753
|
+
if (typeof rule === 'string') {
|
|
754
|
+
return new RegExp('^' + rule + '$', 'i');
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
return rule;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* Pass in a word token to produce a function that can replicate the case on
|
|
762
|
+
* another word.
|
|
763
|
+
*
|
|
764
|
+
* @param {string} word
|
|
765
|
+
* @param {string} token
|
|
766
|
+
* @return {Function}
|
|
767
|
+
*/
|
|
768
|
+
function restoreCase (word, token) {
|
|
769
|
+
// Tokens are an exact match.
|
|
770
|
+
if (word === token) return token;
|
|
771
|
+
|
|
772
|
+
// Lower cased words. E.g. "hello".
|
|
773
|
+
if (word === word.toLowerCase()) return token.toLowerCase();
|
|
774
|
+
|
|
775
|
+
// Upper cased words. E.g. "WHISKY".
|
|
776
|
+
if (word === word.toUpperCase()) return token.toUpperCase();
|
|
777
|
+
|
|
778
|
+
// Title cased words. E.g. "Title".
|
|
779
|
+
if (word[0] === word[0].toUpperCase()) {
|
|
780
|
+
return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
// Lower cased words. E.g. "test".
|
|
784
|
+
return token.toLowerCase();
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* Interpolate a regexp string.
|
|
789
|
+
*
|
|
790
|
+
* @param {string} str
|
|
791
|
+
* @param {Array} args
|
|
792
|
+
* @return {string}
|
|
793
|
+
*/
|
|
794
|
+
function interpolate (str, args) {
|
|
795
|
+
return str.replace(/\$(\d{1,2})/g, function (match, index) {
|
|
796
|
+
return args[index] || '';
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* Replace a word using a rule.
|
|
802
|
+
*
|
|
803
|
+
* @param {string} word
|
|
804
|
+
* @param {Array} rule
|
|
805
|
+
* @return {string}
|
|
806
|
+
*/
|
|
807
|
+
function replace (word, rule) {
|
|
808
|
+
return word.replace(rule[0], function (match, index) {
|
|
809
|
+
var result = interpolate(rule[1], arguments);
|
|
810
|
+
|
|
811
|
+
if (match === '') {
|
|
812
|
+
return restoreCase(word[index - 1], result);
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
return restoreCase(match, result);
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
* Sanitize a word by passing in the word and sanitization rules.
|
|
821
|
+
*
|
|
822
|
+
* @param {string} token
|
|
823
|
+
* @param {string} word
|
|
824
|
+
* @param {Array} rules
|
|
825
|
+
* @return {string}
|
|
826
|
+
*/
|
|
827
|
+
function sanitizeWord (token, word, rules) {
|
|
828
|
+
// Empty string or doesn't need fixing.
|
|
829
|
+
if (!token.length || uncountables.hasOwnProperty(token)) {
|
|
830
|
+
return word;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
var len = rules.length;
|
|
834
|
+
|
|
835
|
+
// Iterate over the sanitization rules and use the first one to match.
|
|
836
|
+
while (len--) {
|
|
837
|
+
var rule = rules[len];
|
|
838
|
+
|
|
839
|
+
if (rule[0].test(word)) return replace(word, rule);
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
return word;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* Replace a word with the updated word.
|
|
847
|
+
*
|
|
848
|
+
* @param {Object} replaceMap
|
|
849
|
+
* @param {Object} keepMap
|
|
850
|
+
* @param {Array} rules
|
|
851
|
+
* @return {Function}
|
|
852
|
+
*/
|
|
853
|
+
function replaceWord (replaceMap, keepMap, rules) {
|
|
854
|
+
return function (word) {
|
|
855
|
+
// Get the correct token and case restoration functions.
|
|
856
|
+
var token = word.toLowerCase();
|
|
857
|
+
|
|
858
|
+
// Check against the keep object map.
|
|
859
|
+
if (keepMap.hasOwnProperty(token)) {
|
|
860
|
+
return restoreCase(word, token);
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
// Check against the replacement map for a direct word replacement.
|
|
864
|
+
if (replaceMap.hasOwnProperty(token)) {
|
|
865
|
+
return restoreCase(word, replaceMap[token]);
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
// Run all the rules against the word.
|
|
869
|
+
return sanitizeWord(token, word, rules);
|
|
870
|
+
};
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* Check if a word is part of the map.
|
|
875
|
+
*/
|
|
876
|
+
function checkWord (replaceMap, keepMap, rules, bool) {
|
|
877
|
+
return function (word) {
|
|
878
|
+
var token = word.toLowerCase();
|
|
879
|
+
|
|
880
|
+
if (keepMap.hasOwnProperty(token)) return true;
|
|
881
|
+
if (replaceMap.hasOwnProperty(token)) return false;
|
|
882
|
+
|
|
883
|
+
return sanitizeWord(token, token, rules) === token;
|
|
884
|
+
};
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
/**
|
|
888
|
+
* Pluralize or singularize a word based on the passed in count.
|
|
889
|
+
*
|
|
890
|
+
* @param {string} word The word to pluralize
|
|
891
|
+
* @param {number} count How many of the word exist
|
|
892
|
+
* @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)
|
|
893
|
+
* @return {string}
|
|
894
|
+
*/
|
|
895
|
+
function pluralize (word, count, inclusive) {
|
|
896
|
+
var pluralized = count === 1
|
|
897
|
+
? pluralize.singular(word) : pluralize.plural(word);
|
|
898
|
+
|
|
899
|
+
return (inclusive ? count + ' ' : '') + pluralized;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* Pluralize a word.
|
|
904
|
+
*
|
|
905
|
+
* @type {Function}
|
|
906
|
+
*/
|
|
907
|
+
pluralize.plural = replaceWord(
|
|
908
|
+
irregularSingles, irregularPlurals, pluralRules
|
|
909
|
+
);
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* Check if a word is plural.
|
|
913
|
+
*
|
|
914
|
+
* @type {Function}
|
|
915
|
+
*/
|
|
916
|
+
pluralize.isPlural = checkWord(
|
|
917
|
+
irregularSingles, irregularPlurals, pluralRules
|
|
918
|
+
);
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* Singularize a word.
|
|
922
|
+
*
|
|
923
|
+
* @type {Function}
|
|
924
|
+
*/
|
|
925
|
+
pluralize.singular = replaceWord(
|
|
926
|
+
irregularPlurals, irregularSingles, singularRules
|
|
927
|
+
);
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* Check if a word is singular.
|
|
931
|
+
*
|
|
932
|
+
* @type {Function}
|
|
933
|
+
*/
|
|
934
|
+
pluralize.isSingular = checkWord(
|
|
935
|
+
irregularPlurals, irregularSingles, singularRules
|
|
936
|
+
);
|
|
937
|
+
|
|
938
|
+
/**
|
|
939
|
+
* Add a pluralization rule to the collection.
|
|
940
|
+
*
|
|
941
|
+
* @param {(string|RegExp)} rule
|
|
942
|
+
* @param {string} replacement
|
|
943
|
+
*/
|
|
944
|
+
pluralize.addPluralRule = function (rule, replacement) {
|
|
945
|
+
pluralRules.push([sanitizeRule(rule), replacement]);
|
|
946
|
+
};
|
|
947
|
+
|
|
948
|
+
/**
|
|
949
|
+
* Add a singularization rule to the collection.
|
|
950
|
+
*
|
|
951
|
+
* @param {(string|RegExp)} rule
|
|
952
|
+
* @param {string} replacement
|
|
953
|
+
*/
|
|
954
|
+
pluralize.addSingularRule = function (rule, replacement) {
|
|
955
|
+
singularRules.push([sanitizeRule(rule), replacement]);
|
|
956
|
+
};
|
|
957
|
+
|
|
958
|
+
/**
|
|
959
|
+
* Add an uncountable word rule.
|
|
960
|
+
*
|
|
961
|
+
* @param {(string|RegExp)} word
|
|
962
|
+
*/
|
|
963
|
+
pluralize.addUncountableRule = function (word) {
|
|
964
|
+
if (typeof word === 'string') {
|
|
965
|
+
uncountables[word.toLowerCase()] = true;
|
|
966
|
+
return;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
// Set singular and plural references for the word.
|
|
970
|
+
pluralize.addPluralRule(word, '$0');
|
|
971
|
+
pluralize.addSingularRule(word, '$0');
|
|
972
|
+
};
|
|
973
|
+
|
|
974
|
+
/**
|
|
975
|
+
* Add an irregular word definition.
|
|
976
|
+
*
|
|
977
|
+
* @param {string} single
|
|
978
|
+
* @param {string} plural
|
|
979
|
+
*/
|
|
980
|
+
pluralize.addIrregularRule = function (single, plural) {
|
|
981
|
+
plural = plural.toLowerCase();
|
|
982
|
+
single = single.toLowerCase();
|
|
983
|
+
|
|
984
|
+
irregularSingles[single] = plural;
|
|
985
|
+
irregularPlurals[plural] = single;
|
|
986
|
+
};
|
|
987
|
+
|
|
988
|
+
/**
|
|
989
|
+
* Irregular rules.
|
|
990
|
+
*/
|
|
991
|
+
[
|
|
992
|
+
// Pronouns.
|
|
993
|
+
['I', 'we'],
|
|
994
|
+
['me', 'us'],
|
|
995
|
+
['he', 'they'],
|
|
996
|
+
['she', 'they'],
|
|
997
|
+
['them', 'them'],
|
|
998
|
+
['myself', 'ourselves'],
|
|
999
|
+
['yourself', 'yourselves'],
|
|
1000
|
+
['itself', 'themselves'],
|
|
1001
|
+
['herself', 'themselves'],
|
|
1002
|
+
['himself', 'themselves'],
|
|
1003
|
+
['themself', 'themselves'],
|
|
1004
|
+
['is', 'are'],
|
|
1005
|
+
['was', 'were'],
|
|
1006
|
+
['has', 'have'],
|
|
1007
|
+
['this', 'these'],
|
|
1008
|
+
['that', 'those'],
|
|
1009
|
+
// Words ending in with a consonant and `o`.
|
|
1010
|
+
['echo', 'echoes'],
|
|
1011
|
+
['dingo', 'dingoes'],
|
|
1012
|
+
['volcano', 'volcanoes'],
|
|
1013
|
+
['tornado', 'tornadoes'],
|
|
1014
|
+
['torpedo', 'torpedoes'],
|
|
1015
|
+
// Ends with `us`.
|
|
1016
|
+
['genus', 'genera'],
|
|
1017
|
+
['viscus', 'viscera'],
|
|
1018
|
+
// Ends with `ma`.
|
|
1019
|
+
['stigma', 'stigmata'],
|
|
1020
|
+
['stoma', 'stomata'],
|
|
1021
|
+
['dogma', 'dogmata'],
|
|
1022
|
+
['lemma', 'lemmata'],
|
|
1023
|
+
['schema', 'schemata'],
|
|
1024
|
+
['anathema', 'anathemata'],
|
|
1025
|
+
// Other irregular rules.
|
|
1026
|
+
['ox', 'oxen'],
|
|
1027
|
+
['axe', 'axes'],
|
|
1028
|
+
['die', 'dice'],
|
|
1029
|
+
['yes', 'yeses'],
|
|
1030
|
+
['foot', 'feet'],
|
|
1031
|
+
['eave', 'eaves'],
|
|
1032
|
+
['goose', 'geese'],
|
|
1033
|
+
['tooth', 'teeth'],
|
|
1034
|
+
['quiz', 'quizzes'],
|
|
1035
|
+
['human', 'humans'],
|
|
1036
|
+
['proof', 'proofs'],
|
|
1037
|
+
['carve', 'carves'],
|
|
1038
|
+
['valve', 'valves'],
|
|
1039
|
+
['looey', 'looies'],
|
|
1040
|
+
['thief', 'thieves'],
|
|
1041
|
+
['groove', 'grooves'],
|
|
1042
|
+
['pickaxe', 'pickaxes'],
|
|
1043
|
+
['passerby', 'passersby']
|
|
1044
|
+
].forEach(function (rule) {
|
|
1045
|
+
return pluralize.addIrregularRule(rule[0], rule[1]);
|
|
1046
|
+
});
|
|
1047
|
+
|
|
1048
|
+
/**
|
|
1049
|
+
* Pluralization rules.
|
|
1050
|
+
*/
|
|
1051
|
+
[
|
|
1052
|
+
[/s?$/i, 's'],
|
|
1053
|
+
[/[^\u0000-\u007F]$/i, '$0'],
|
|
1054
|
+
[/([^aeiou]ese)$/i, '$1'],
|
|
1055
|
+
[/(ax|test)is$/i, '$1es'],
|
|
1056
|
+
[/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],
|
|
1057
|
+
[/(e[mn]u)s?$/i, '$1s'],
|
|
1058
|
+
[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],
|
|
1059
|
+
[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],
|
|
1060
|
+
[/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],
|
|
1061
|
+
[/(seraph|cherub)(?:im)?$/i, '$1im'],
|
|
1062
|
+
[/(her|at|gr)o$/i, '$1oes'],
|
|
1063
|
+
[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],
|
|
1064
|
+
[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],
|
|
1065
|
+
[/sis$/i, 'ses'],
|
|
1066
|
+
[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],
|
|
1067
|
+
[/([^aeiouy]|qu)y$/i, '$1ies'],
|
|
1068
|
+
[/([^ch][ieo][ln])ey$/i, '$1ies'],
|
|
1069
|
+
[/(x|ch|ss|sh|zz)$/i, '$1es'],
|
|
1070
|
+
[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],
|
|
1071
|
+
[/\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],
|
|
1072
|
+
[/(pe)(?:rson|ople)$/i, '$1ople'],
|
|
1073
|
+
[/(child)(?:ren)?$/i, '$1ren'],
|
|
1074
|
+
[/eaux$/i, '$0'],
|
|
1075
|
+
[/m[ae]n$/i, 'men'],
|
|
1076
|
+
['thou', 'you']
|
|
1077
|
+
].forEach(function (rule) {
|
|
1078
|
+
return pluralize.addPluralRule(rule[0], rule[1]);
|
|
1079
|
+
});
|
|
1080
|
+
|
|
1081
|
+
/**
|
|
1082
|
+
* Singularization rules.
|
|
1083
|
+
*/
|
|
1084
|
+
[
|
|
1085
|
+
[/s$/i, ''],
|
|
1086
|
+
[/(ss)$/i, '$1'],
|
|
1087
|
+
[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, '$1fe'],
|
|
1088
|
+
[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],
|
|
1089
|
+
[/ies$/i, 'y'],
|
|
1090
|
+
[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],
|
|
1091
|
+
[/\b(mon|smil)ies$/i, '$1ey'],
|
|
1092
|
+
[/\b((?:tit)?m|l)ice$/i, '$1ouse'],
|
|
1093
|
+
[/(seraph|cherub)im$/i, '$1'],
|
|
1094
|
+
[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],
|
|
1095
|
+
[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],
|
|
1096
|
+
[/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],
|
|
1097
|
+
[/(test)(?:is|es)$/i, '$1is'],
|
|
1098
|
+
[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],
|
|
1099
|
+
[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],
|
|
1100
|
+
[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],
|
|
1101
|
+
[/(alumn|alg|vertebr)ae$/i, '$1a'],
|
|
1102
|
+
[/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],
|
|
1103
|
+
[/(matr|append)ices$/i, '$1ix'],
|
|
1104
|
+
[/(pe)(rson|ople)$/i, '$1rson'],
|
|
1105
|
+
[/(child)ren$/i, '$1'],
|
|
1106
|
+
[/(eau)x?$/i, '$1'],
|
|
1107
|
+
[/men$/i, 'man']
|
|
1108
|
+
].forEach(function (rule) {
|
|
1109
|
+
return pluralize.addSingularRule(rule[0], rule[1]);
|
|
1110
|
+
});
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* Uncountable rules.
|
|
1114
|
+
*/
|
|
1115
|
+
[
|
|
1116
|
+
// Singular words with no plurals.
|
|
1117
|
+
'adulthood',
|
|
1118
|
+
'advice',
|
|
1119
|
+
'agenda',
|
|
1120
|
+
'aid',
|
|
1121
|
+
'aircraft',
|
|
1122
|
+
'alcohol',
|
|
1123
|
+
'ammo',
|
|
1124
|
+
'analytics',
|
|
1125
|
+
'anime',
|
|
1126
|
+
'athletics',
|
|
1127
|
+
'audio',
|
|
1128
|
+
'bison',
|
|
1129
|
+
'blood',
|
|
1130
|
+
'bream',
|
|
1131
|
+
'buffalo',
|
|
1132
|
+
'butter',
|
|
1133
|
+
'carp',
|
|
1134
|
+
'cash',
|
|
1135
|
+
'chassis',
|
|
1136
|
+
'chess',
|
|
1137
|
+
'clothing',
|
|
1138
|
+
'cod',
|
|
1139
|
+
'commerce',
|
|
1140
|
+
'cooperation',
|
|
1141
|
+
'corps',
|
|
1142
|
+
'debris',
|
|
1143
|
+
'diabetes',
|
|
1144
|
+
'digestion',
|
|
1145
|
+
'elk',
|
|
1146
|
+
'energy',
|
|
1147
|
+
'equipment',
|
|
1148
|
+
'excretion',
|
|
1149
|
+
'expertise',
|
|
1150
|
+
'firmware',
|
|
1151
|
+
'flounder',
|
|
1152
|
+
'fun',
|
|
1153
|
+
'gallows',
|
|
1154
|
+
'garbage',
|
|
1155
|
+
'graffiti',
|
|
1156
|
+
'hardware',
|
|
1157
|
+
'headquarters',
|
|
1158
|
+
'health',
|
|
1159
|
+
'herpes',
|
|
1160
|
+
'highjinks',
|
|
1161
|
+
'homework',
|
|
1162
|
+
'housework',
|
|
1163
|
+
'information',
|
|
1164
|
+
'jeans',
|
|
1165
|
+
'justice',
|
|
1166
|
+
'kudos',
|
|
1167
|
+
'labour',
|
|
1168
|
+
'literature',
|
|
1169
|
+
'machinery',
|
|
1170
|
+
'mackerel',
|
|
1171
|
+
'mail',
|
|
1172
|
+
'media',
|
|
1173
|
+
'mews',
|
|
1174
|
+
'moose',
|
|
1175
|
+
'music',
|
|
1176
|
+
'mud',
|
|
1177
|
+
'manga',
|
|
1178
|
+
'news',
|
|
1179
|
+
'only',
|
|
1180
|
+
'personnel',
|
|
1181
|
+
'pike',
|
|
1182
|
+
'plankton',
|
|
1183
|
+
'pliers',
|
|
1184
|
+
'police',
|
|
1185
|
+
'pollution',
|
|
1186
|
+
'premises',
|
|
1187
|
+
'rain',
|
|
1188
|
+
'research',
|
|
1189
|
+
'rice',
|
|
1190
|
+
'salmon',
|
|
1191
|
+
'scissors',
|
|
1192
|
+
'series',
|
|
1193
|
+
'sewage',
|
|
1194
|
+
'shambles',
|
|
1195
|
+
'shrimp',
|
|
1196
|
+
'software',
|
|
1197
|
+
'species',
|
|
1198
|
+
'staff',
|
|
1199
|
+
'swine',
|
|
1200
|
+
'tennis',
|
|
1201
|
+
'traffic',
|
|
1202
|
+
'transportation',
|
|
1203
|
+
'trout',
|
|
1204
|
+
'tuna',
|
|
1205
|
+
'wealth',
|
|
1206
|
+
'welfare',
|
|
1207
|
+
'whiting',
|
|
1208
|
+
'wildebeest',
|
|
1209
|
+
'wildlife',
|
|
1210
|
+
'you',
|
|
1211
|
+
/pok[eé]mon$/i,
|
|
1212
|
+
// Regexes.
|
|
1213
|
+
/[^aeiou]ese$/i, // "chinese", "japanese"
|
|
1214
|
+
/deer$/i, // "deer", "reindeer"
|
|
1215
|
+
/fish$/i, // "fish", "blowfish", "angelfish"
|
|
1216
|
+
/measles$/i,
|
|
1217
|
+
/o[iu]s$/i, // "carnivorous"
|
|
1218
|
+
/pox$/i, // "chickpox", "smallpox"
|
|
1219
|
+
/sheep$/i
|
|
1220
|
+
].forEach(pluralize.addUncountableRule);
|
|
1221
|
+
|
|
1222
|
+
return pluralize;
|
|
1223
|
+
});
|
|
1224
|
+
} (pluralize$1, pluralize$1.exports));
|
|
1225
|
+
|
|
1226
|
+
var pluralizeExports = pluralize$1.exports;
|
|
1227
|
+
var pluralize = /*@__PURE__*/getDefaultExportFromCjs(pluralizeExports);
|
|
1228
|
+
|
|
1229
|
+
var MergeAlert = withT(function (_ref) {
|
|
1230
|
+
var t = _ref.t,
|
|
1231
|
+
_ref$destinationTags = _ref.destinationTags,
|
|
1232
|
+
destinationTags = _ref$destinationTags === void 0 ? [] : _ref$destinationTags,
|
|
1233
|
+
handleSubmit = _ref.handleSubmit,
|
|
1234
|
+
_ref$isSubmitting = _ref.isSubmitting,
|
|
1235
|
+
isSubmitting = _ref$isSubmitting === void 0 ? false : _ref$isSubmitting,
|
|
1236
|
+
setShowModal = _ref.setShowModal,
|
|
1237
|
+
_ref$showModal = _ref.showModal,
|
|
1238
|
+
showModal = _ref$showModal === void 0 ? false : _ref$showModal,
|
|
1239
|
+
_ref$sourceTags = _ref.sourceTags,
|
|
1240
|
+
sourceTags = _ref$sourceTags === void 0 ? [] : _ref$sourceTags,
|
|
1241
|
+
_ref$tagType = _ref.tagType,
|
|
1242
|
+
tagType = _ref$tagType === void 0 ? "" : _ref$tagType;
|
|
1243
|
+
return /*#__PURE__*/jsxs(Modal, {
|
|
1244
|
+
isOpen: showModal,
|
|
1245
|
+
onClose: function onClose() {
|
|
1246
|
+
return setShowModal(false);
|
|
1247
|
+
},
|
|
1248
|
+
children: [/*#__PURE__*/jsx(Modal.Header, {
|
|
1249
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
1250
|
+
id: "dialog1Title",
|
|
1251
|
+
style: "h2",
|
|
1252
|
+
children: t("neetoTags.common.mergeTag", PLURAL)
|
|
1253
|
+
})
|
|
1254
|
+
}), /*#__PURE__*/jsx(Modal.Body, {
|
|
1255
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
1256
|
+
lineHeight: "normal",
|
|
1257
|
+
style: "body2",
|
|
1258
|
+
children: /*#__PURE__*/jsx(Trans, {
|
|
1259
|
+
i18nKey: "neetoTags.helper.mergeTagsMessage",
|
|
1260
|
+
values: {
|
|
1261
|
+
count: sourceTags.length,
|
|
1262
|
+
sourceTags: pluck("name", sourceTags),
|
|
1263
|
+
destinationTag: pluck("name", destinationTags),
|
|
1264
|
+
entities: pluralize(tagType.label.toLowerCase())
|
|
1265
|
+
}
|
|
1266
|
+
})
|
|
1267
|
+
})
|
|
1268
|
+
}), /*#__PURE__*/jsxs(Modal.Footer, {
|
|
1269
|
+
className: "space-x-2",
|
|
1270
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
1271
|
+
"data-cy": "neeto-tags-merge-cancel-button",
|
|
1272
|
+
label: t("neetoTags.button.cancel"),
|
|
1273
|
+
style: "tertiary",
|
|
1274
|
+
onClick: function onClick() {
|
|
1275
|
+
return setShowModal(false);
|
|
1276
|
+
}
|
|
1277
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
1278
|
+
"data-cy": "neeto-tags-merge-proceed-button",
|
|
1279
|
+
disabled: isSubmitting,
|
|
1280
|
+
label: t("neetoTags.button.proceed"),
|
|
1281
|
+
loading: isSubmitting,
|
|
1282
|
+
onClick: handleSubmit
|
|
1283
|
+
})]
|
|
1284
|
+
})]
|
|
1285
|
+
});
|
|
1286
|
+
});
|
|
1287
|
+
|
|
1288
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1289
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1290
|
+
var Merge = function Merge(_ref) {
|
|
1291
|
+
var _data$tags;
|
|
1292
|
+
var breadcrumbs = _ref.breadcrumbs,
|
|
1293
|
+
mergeTags = _ref.mergeTags,
|
|
1294
|
+
tagsPath = _ref.tagsPath,
|
|
1295
|
+
tagType = _ref.tagType;
|
|
1296
|
+
var _useState = useState([]),
|
|
1297
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1298
|
+
sourceTags = _useState2[0],
|
|
1299
|
+
setSourceTags = _useState2[1];
|
|
1300
|
+
var _useState3 = useState([]),
|
|
1301
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
1302
|
+
destinationTags = _useState4[0],
|
|
1303
|
+
setDestinationTags = _useState4[1];
|
|
1304
|
+
var _useState5 = useState(false),
|
|
1305
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
1306
|
+
isModalOpen = _useState6[0],
|
|
1307
|
+
setIsModalOpen = _useState6[1];
|
|
1308
|
+
var isMergeButtonDisabled = isEmpty(sourceTags) || isEmpty(destinationTags);
|
|
1309
|
+
var _useTranslation = useTranslation(),
|
|
1310
|
+
t = _useTranslation.t;
|
|
1311
|
+
var _useFetchTags = useFetchTags({
|
|
1312
|
+
url: tagType.url
|
|
1313
|
+
}),
|
|
1314
|
+
data = _useFetchTags.data,
|
|
1315
|
+
isLoading = _useFetchTags.isLoading;
|
|
1316
|
+
var _useMergeTags = useMergeTags(),
|
|
1317
|
+
mutate = _useMergeTags.mutate,
|
|
1318
|
+
isSubmitting = _useMergeTags.isPending;
|
|
1319
|
+
var primaryButtonProps = _objectSpread$2(_objectSpread$2({}, NO_DATA_PRIMARY_BUTTON_PROPS), {}, {
|
|
1320
|
+
to: tagsPath
|
|
1321
|
+
});
|
|
1322
|
+
var updatedBreadcrumbs = useMemo(function () {
|
|
1323
|
+
return [].concat(_toConsumableArray(breadcrumbs), [{
|
|
1324
|
+
text: t("neetoTags.common.mergeTag", PLURAL)
|
|
1325
|
+
}]);
|
|
1326
|
+
}, [breadcrumbs]);
|
|
1327
|
+
var getTagState = function getTagState(type) {
|
|
1328
|
+
return {
|
|
1329
|
+
tags: type === "source" ? sourceTags : destinationTags,
|
|
1330
|
+
setTags: type === "source" ? setSourceTags : setDestinationTags
|
|
1331
|
+
};
|
|
1332
|
+
};
|
|
1333
|
+
var handleOnTagSelect = function handleOnTagSelect(tag, type) {
|
|
1334
|
+
var _getTagState = getTagState(type),
|
|
1335
|
+
tags = _getTagState.tags,
|
|
1336
|
+
setTags = _getTagState.setTags;
|
|
1337
|
+
var isTagPresent = existsById(tag.id, tags);
|
|
1338
|
+
var filteredTags = type === "source" ? [].concat(_toConsumableArray(tags), [tag]) : [tag];
|
|
1339
|
+
if (isTagPresent) {
|
|
1340
|
+
filteredTags = removeById(tag.id, tags);
|
|
1341
|
+
}
|
|
1342
|
+
setTags(filteredTags);
|
|
1343
|
+
};
|
|
1344
|
+
var handleSubmit = function handleSubmit() {
|
|
1345
|
+
var payload = {
|
|
1346
|
+
tags: {
|
|
1347
|
+
primary_id: pluck("id", destinationTags),
|
|
1348
|
+
secondary_id: pluck("id", sourceTags)
|
|
1349
|
+
}
|
|
1350
|
+
};
|
|
1351
|
+
mutate({
|
|
1352
|
+
url: tagType.url,
|
|
1353
|
+
payload: payload
|
|
1354
|
+
}, {
|
|
1355
|
+
onSuccess: function onSuccess() {
|
|
1356
|
+
var _mergeTags$onSuccess;
|
|
1357
|
+
setDestinationTags([]);
|
|
1358
|
+
setSourceTags([]);
|
|
1359
|
+
mergeTags === null || mergeTags === void 0 || (_mergeTags$onSuccess = mergeTags.onSuccess) === null || _mergeTags$onSuccess === void 0 || _mergeTags$onSuccess.callback();
|
|
1360
|
+
setIsModalOpen(false);
|
|
1361
|
+
}
|
|
1362
|
+
});
|
|
1363
|
+
};
|
|
1364
|
+
if (isLoading) {
|
|
1365
|
+
return /*#__PURE__*/jsx("div", {
|
|
1366
|
+
className: "neeto-ui-w-full neeto-ui-h-screen",
|
|
1367
|
+
children: /*#__PURE__*/jsx(PageLoader, {})
|
|
1368
|
+
});
|
|
1369
|
+
}
|
|
1370
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1371
|
+
className: "neeto-ui-w-full",
|
|
1372
|
+
children: [/*#__PURE__*/jsxs(Container, {
|
|
1373
|
+
isHeaderFixed: true,
|
|
1374
|
+
children: [/*#__PURE__*/jsx(NeetoHeader, {
|
|
1375
|
+
breadcrumbs: updatedBreadcrumbs,
|
|
1376
|
+
title: t("neetoTags.common.mergeTag", PLURAL),
|
|
1377
|
+
actionBlock: /*#__PURE__*/jsx(Button, {
|
|
1378
|
+
"data-cy": "neeto-tags-merge-button",
|
|
1379
|
+
disabled: isMergeButtonDisabled,
|
|
1380
|
+
label: t("neetoTags.button.merge"),
|
|
1381
|
+
onClick: function onClick() {
|
|
1382
|
+
setIsModalOpen(true);
|
|
1383
|
+
}
|
|
1384
|
+
})
|
|
1385
|
+
}), !(data !== null && data !== void 0 && (_data$tags = data.tags) !== null && _data$tags !== void 0 && _data$tags.length) ? /*#__PURE__*/jsx("div", {
|
|
1386
|
+
className: "ntm-empty-state",
|
|
1387
|
+
"data-cy": "empty-state-container",
|
|
1388
|
+
children: /*#__PURE__*/jsx(NoData, {
|
|
1389
|
+
primaryButtonProps: primaryButtonProps,
|
|
1390
|
+
title: t("neetoTags.noTagsToShow")
|
|
1391
|
+
})
|
|
1392
|
+
}) : /*#__PURE__*/jsx("div", {
|
|
1393
|
+
className: "neeto-tags-merge__wrapper",
|
|
1394
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
1395
|
+
className: "neeto-tags-merge__container",
|
|
1396
|
+
children: [/*#__PURE__*/jsx(List, {
|
|
1397
|
+
destinationTags: destinationTags,
|
|
1398
|
+
sourceTags: sourceTags,
|
|
1399
|
+
isSource: true,
|
|
1400
|
+
tagList: data === null || data === void 0 ? void 0 : data.tags,
|
|
1401
|
+
onSelect: handleOnTagSelect
|
|
1402
|
+
}), /*#__PURE__*/jsx(NeetoUITagMergeIcon, {
|
|
1403
|
+
className: "neeto-ui-self-center neeto-ui-text-gray-600 mx-1 md:mx-4 lg:mx-6",
|
|
1404
|
+
size: 24
|
|
1405
|
+
}), /*#__PURE__*/jsx(List, {
|
|
1406
|
+
destinationTags: destinationTags,
|
|
1407
|
+
sourceTags: sourceTags,
|
|
1408
|
+
isSource: false,
|
|
1409
|
+
tagList: data === null || data === void 0 ? void 0 : data.tags,
|
|
1410
|
+
onSelect: handleOnTagSelect
|
|
1411
|
+
})]
|
|
1412
|
+
})
|
|
1413
|
+
})]
|
|
1414
|
+
}), /*#__PURE__*/jsx(MergeAlert, {
|
|
1415
|
+
destinationTags: destinationTags,
|
|
1416
|
+
handleSubmit: handleSubmit,
|
|
1417
|
+
isSubmitting: isSubmitting,
|
|
1418
|
+
sourceTags: sourceTags,
|
|
1419
|
+
tagType: tagType,
|
|
1420
|
+
setShowModal: setIsModalOpen,
|
|
1421
|
+
showModal: isModalOpen
|
|
1422
|
+
})]
|
|
1423
|
+
});
|
|
1424
|
+
};
|
|
1425
|
+
|
|
1426
|
+
var getCurrentTagType = function getCurrentTagType() {
|
|
1427
|
+
var tagTypes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
1428
|
+
var _getQueryParams = getQueryParams(),
|
|
1429
|
+
tagLabel = _getQueryParams.view;
|
|
1430
|
+
var requiredTagType = tagTypes.find(function (tagType) {
|
|
1431
|
+
var _tagType$label;
|
|
1432
|
+
return (tagType === null || tagType === void 0 || (_tagType$label = tagType.label) === null || _tagType$label === void 0 ? void 0 : _tagType$label.toLowerCase()) === tagLabel;
|
|
1433
|
+
});
|
|
1434
|
+
return requiredTagType || tagTypes[0];
|
|
1435
|
+
};
|
|
1436
|
+
var createRoutes = function createRoutes(path) {
|
|
1437
|
+
return [{
|
|
1438
|
+
component: Merge,
|
|
1439
|
+
exact: true,
|
|
1440
|
+
path: "".concat(path, "/merge")
|
|
1441
|
+
}, {
|
|
1442
|
+
component: Dashboard,
|
|
1443
|
+
exact: true,
|
|
1444
|
+
path: path || ""
|
|
1445
|
+
}];
|
|
1446
|
+
};
|
|
1447
|
+
|
|
1448
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1449
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1450
|
+
var withReactQuery = function withReactQuery(Component) {
|
|
1451
|
+
var QueryWrapper = function QueryWrapper(props) {
|
|
1452
|
+
return /*#__PURE__*/jsxs(QueryClientProvider, {
|
|
1453
|
+
client: queryClient,
|
|
1454
|
+
children: [/*#__PURE__*/jsx(Component, _objectSpread$1({}, props)), /*#__PURE__*/jsx(ReactQueryDevtools, {
|
|
1455
|
+
initialIsOpen: false,
|
|
1456
|
+
position: "bottom"
|
|
1457
|
+
})]
|
|
1458
|
+
});
|
|
1459
|
+
};
|
|
1460
|
+
return QueryWrapper;
|
|
1461
|
+
};
|
|
1462
|
+
|
|
1463
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1464
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1465
|
+
var Tags = function Tags(_ref) {
|
|
1466
|
+
var config = _ref.config;
|
|
1467
|
+
var tagTypes = config.tagTypes,
|
|
1468
|
+
_config$displayMenu = config.displayMenu,
|
|
1469
|
+
displayMenu = _config$displayMenu === void 0 ? true : _config$displayMenu;
|
|
1470
|
+
var _useState = useState(getCurrentTagType(tagTypes)),
|
|
1471
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1472
|
+
tagType = _useState2[0],
|
|
1473
|
+
setTagType = _useState2[1];
|
|
1474
|
+
var routes = createRoutes(config.tagsPath);
|
|
1475
|
+
return /*#__PURE__*/jsx(Switch, {
|
|
1476
|
+
children: routes.map(function (_ref2) {
|
|
1477
|
+
var exact = _ref2.exact,
|
|
1478
|
+
path = _ref2.path,
|
|
1479
|
+
Component = _ref2.component;
|
|
1480
|
+
return /*#__PURE__*/createElement(Route, {
|
|
1481
|
+
exact: exact,
|
|
1482
|
+
path: path,
|
|
1483
|
+
key: path
|
|
1484
|
+
}, /*#__PURE__*/jsx(Component, _objectSpread({}, _objectSpread(_objectSpread({}, config), {}, {
|
|
1485
|
+
displayMenu: displayMenu,
|
|
1486
|
+
setTagType: setTagType,
|
|
1487
|
+
tagType: tagType
|
|
1488
|
+
}))));
|
|
1489
|
+
})
|
|
1490
|
+
});
|
|
1491
|
+
};
|
|
1492
|
+
var Tags$1 = withReactQuery(Tags);
|
|
1493
|
+
|
|
1494
|
+
var css = ".ntm-empty-state{height:100%;margin:auto;width:100%}.ntm-empty-state,.ntm-empty-state__image{align-items:center;display:flex;justify-content:center}.ntm-empty-state__image{margin-left:0 auto 4rem auto}.ntm-empty-state__title{font-size:1.25rem;line-height:1.75rem;margin-bottom:1rem;text-align:center}.ntm-empty-state__description{margin-bottom:1.5rem;text-align:center}.ntm-empty-state__action-block{display:flex;justify-content:center}.neeto-tags-table__wrapper{height:calc(100vh - var(--neeto-molecules-main-header-with-breadcrumbs-height) - var(--neeto-molecules-sub-header-height) - var(--neeto-molecules-sub-header-bottom-margin));padding:0 24px;width:100%}.neeto-tags-table__column{align-items:center;display:flex;gap:.5rem;justify-content:space-between}.neeto-tags-card-title-block:hover p{color:rgb(var(--neeto-ui-accent-800))!important}.neeto-tags-merge__wrapper{height:calc(100vh - var(--neeto-molecules-main-header-with-breadcrumbs-height));margin:0 auto;max-width:1200px;padding:0 24px 24px;width:100%}.neeto-tags-merge__wrapper .neeto-tags-merge__container{display:flex;flex-direction:row;height:100%;justify-content:space-between;width:100%}.neeto-tags-merge__wrapper .neeto-tags-merge__container .neeto-tags-merge__list{width:48%}.neeto-tags-merge__wrapper .neeto-tags-merge__container .neeto-tags-merge__list .neeto-tags-merge__items{height:calc(100vh - var(--neeto-molecules-main-header-height) - 120px);overflow-y:auto;padding-top:12px}@media screen and (min-width:768px){.neeto-tags-merge__wrapper .neeto-tags-merge__container .neeto-tags-merge__list .neeto-tags-merge__items{padding-top:16px}}.neeto-tags-border{border-width:thin}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3NyYy9zdHlsZXNoZWV0cy9jb21wb25lbnRzL19lbXB0eS1zdGF0ZS5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3JjL3N0eWxlc2hlZXRzL21haW4uc2NzcyIsImFwcC9qYXZhc2NyaXB0L3NyYy9zdHlsZXNoZWV0cy9wYWdlcy9fZGFzaGJvYXJkLnNjc3MiLCJhcHAvamF2YXNjcmlwdC9zcmMvc3R5bGVzaGVldHMvcGFnZXMvX21lcmdlLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsaUJBSUUsV0FBQSxDQUVBLFdBQUEsQ0FEQSxVQ0VGLENEQ0UseUNBTkEsa0JBQUEsQ0FEQSxZQUFBLENBRUEsc0JD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tbmVldG8tbW9sZWN1bGVzLW1haW4taGVhZGVyLWhlaWdodCkgLSAxMjBweCk7XG4gICAgICAgIHBhZGRpbmctdG9wOiAxMnB4O1xuICAgICAgICBAbWVkaWEgc2NyZWVuIGFuZCAobWluLXdpZHRoOiA3NjhweCkge1xuICAgICAgICAgIHBhZGRpbmctdG9wOiAxNnB4O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG59XG5cbi5uZWV0by10YWdzLWJvcmRlciB7XG4gIGJvcmRlci13aWR0aDogdGhpbjtcbn1cbiJdfQ== */";
|
|
1495
|
+
n(css,{});
|
|
1496
|
+
|
|
1497
|
+
var App = function App(_ref) {
|
|
1498
|
+
var config = _ref.config;
|
|
1499
|
+
return /*#__PURE__*/jsx(Tags$1, {
|
|
1500
|
+
config: config
|
|
1501
|
+
});
|
|
1502
|
+
};
|
|
1503
|
+
|
|
1504
|
+
export { App as default };
|
|
1505
|
+
//# sourceMappingURL=NeetoTags.js.map
|