@bigbinary/neeto-molecules 4.0.100 → 4.0.102
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/ShareViaLink.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Link as Link$1, useLocation, useHistory, useRouteMatch, Switch, Route }
|
|
|
4
4
|
import ErrorPage from './ErrorPage.js';
|
|
5
5
|
import classnames from 'classnames';
|
|
6
6
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
7
|
-
import { prop, includes, __, omit } from 'ramda';
|
|
7
|
+
import { replace, prop, includes, __, omit } from 'ramda';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
9
|
import Container from './Container.js';
|
|
10
10
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -185,6 +185,7 @@ var truncatePrefix = function truncatePrefix(inputElement, prefixText) {
|
|
|
185
185
|
var maxPrefixChars = Math.max(Math.floor(prefixWidth / averageCharWidth), 5);
|
|
186
186
|
prefixElement.textContent = maxPrefixChars < prefixText.length ? "...".concat(prefixText.slice(-maxPrefixChars)) : prefixText;
|
|
187
187
|
};
|
|
188
|
+
var normalizeEditablePath = replace(/[^a-z0-9&?=._-]/gi, "");
|
|
188
189
|
|
|
189
190
|
var SOCIAL_MEDIA_OPTIONS = {
|
|
190
191
|
FACEBOOK: {
|
|
@@ -267,7 +268,8 @@ var EditURL = function EditURL(_ref) {
|
|
|
267
268
|
},
|
|
268
269
|
children: function children(_ref5) {
|
|
269
270
|
var isSubmitting = _ref5.isSubmitting,
|
|
270
|
-
dirty = _ref5.dirty
|
|
271
|
+
dirty = _ref5.dirty,
|
|
272
|
+
setFieldValue = _ref5.setFieldValue;
|
|
271
273
|
return /*#__PURE__*/jsxs(Form, {
|
|
272
274
|
children: [/*#__PURE__*/jsxs(Body, {
|
|
273
275
|
className: "flex flex-col gap-y-6",
|
|
@@ -278,7 +280,10 @@ var EditURL = function EditURL(_ref) {
|
|
|
278
280
|
maxLength: editUrlProps === null || editUrlProps === void 0 ? void 0 : editUrlProps.maxLength,
|
|
279
281
|
name: "path",
|
|
280
282
|
prefix: prefixText,
|
|
281
|
-
ref: inputRef
|
|
283
|
+
ref: inputRef,
|
|
284
|
+
onChange: function onChange(event) {
|
|
285
|
+
return setFieldValue("path", normalizeEditablePath(event.target.value));
|
|
286
|
+
}
|
|
282
287
|
}), /*#__PURE__*/jsx(Typography, {
|
|
283
288
|
className: "neeto-ui-text-gray-700",
|
|
284
289
|
lineHeight: "normal",
|