@plone/volto 15.0.0-alpha.0 → 15.0.0-alpha.11
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/.eslintrc +1 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +7 -6
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -1
- package/.github/workflows/{core-sandbox.yml → coresandbox.yml} +1 -1
- package/.github/workflows/docs.yml +15 -55
- package/.storybook/main.js +3 -9
- package/CHANGELOG.md +140 -2
- package/CODE_OF_CONDUCT.md +0 -1
- package/COMMITLINT.md +19 -21
- package/README.md +2 -1
- package/SECURITY.md +0 -1
- package/addon-registry.js +20 -12
- package/create-addons-loader.js +1 -1
- package/cypress/support/commands.js +3 -1
- package/dist/assets.json +1 -0
- package/dist/chunks.json +571 -0
- package/dist/loadable-stats.json +2070 -0
- package/dist/public/android-chrome-192x192.png +0 -0
- package/dist/public/android-chrome-512x512.png +0 -0
- package/dist/public/apple-touch-icon.png +0 -0
- package/dist/public/favicon-16x16.png +0 -0
- package/dist/public/favicon-32x32.png +0 -0
- package/dist/public/favicon.ico +0 -0
- package/dist/public/icon.svg +13 -0
- package/dist/public/index.html.spa +34 -0
- package/dist/public/robots.txt +2 -0
- package/dist/public/site.webmanifest +19 -0
- package/dist/public/static/css/14.803b450c.chunk.css +409 -0
- package/dist/public/static/css/3.a3490306.chunk.css +2 -0
- package/dist/public/static/css/client.0ead607b.chunk.css +8 -0
- package/dist/public/static/css/plone-volto-components-manage-Widgets-DatetimeWidget.77a7ad0d.chunk.css +2 -0
- package/dist/public/static/js/0.3e794c57.chunk.js +2 -0
- package/dist/public/static/js/1.fece2b93.chunk.js +3 -0
- package/dist/public/static/js/1.fece2b93.chunk.js.LICENSE.txt +8 -0
- package/dist/public/static/js/14.803b450c.chunk.js +3 -0
- package/dist/public/static/js/14.803b450c.chunk.js.LICENSE.txt +146 -0
- package/dist/public/static/js/15.c1eb25b4.chunk.js +3 -0
- package/dist/public/static/js/15.c1eb25b4.chunk.js.LICENSE.txt +8 -0
- package/dist/public/static/js/16.70e24cba.chunk.js +2 -0
- package/dist/public/static/js/17.f03d2a82.chunk.js +2 -0
- package/dist/public/static/js/18.0f0b1dfa.chunk.js +2 -0
- package/dist/public/static/js/19.61ef8815.chunk.js +3 -0
- package/dist/public/static/js/19.61ef8815.chunk.js.LICENSE.txt +8 -0
- package/dist/public/static/js/20.6b37f925.chunk.js +2 -0
- package/dist/public/static/js/21.8704b265.chunk.js +2 -0
- package/dist/public/static/js/22.5a2b56ff.chunk.js +2 -0
- package/dist/public/static/js/23.a53c8d7b.chunk.js +2 -0
- package/dist/public/static/js/24.d44c620a.chunk.js +2 -0
- package/dist/public/static/js/25.3129d6c8.chunk.js +2 -0
- package/dist/public/static/js/26.9dfad319.chunk.js +2 -0
- package/dist/public/static/js/27.efbb318a.chunk.js +2 -0
- package/dist/public/static/js/28.b4840d60.chunk.js +2 -0
- package/dist/public/static/js/29.690d4b54.chunk.js +2 -0
- package/dist/public/static/js/3.a3490306.chunk.js +2 -0
- package/dist/public/static/js/30.5f174f94.chunk.js +2 -0
- package/dist/public/static/js/31.4a7cf109.chunk.js +2 -0
- package/dist/public/static/js/32.2247dcf7.chunk.js +2 -0
- package/dist/public/static/js/33.87874f33.chunk.js +2 -0
- package/dist/public/static/js/34.aec37d56.chunk.js +3 -0
- package/dist/public/static/js/34.aec37d56.chunk.js.LICENSE.txt +37 -0
- package/dist/public/static/js/35.73887e02.chunk.js +3 -0
- package/dist/public/static/js/35.73887e02.chunk.js.LICENSE.txt +7 -0
- package/dist/public/static/js/36.19d2e05a.chunk.js +3 -0
- package/dist/public/static/js/36.19d2e05a.chunk.js.LICENSE.txt +14 -0
- package/dist/public/static/js/37.96925a5f.chunk.js +3 -0
- package/dist/public/static/js/37.96925a5f.chunk.js.LICENSE.txt +8 -0
- package/dist/public/static/js/38.701a2e85.chunk.js +2 -0
- package/dist/public/static/js/39.4cbf0549.chunk.js +2 -0
- package/dist/public/static/js/4.bdc4a5c5.chunk.js +2 -0
- package/dist/public/static/js/6.69ba4792.chunk.js +2 -0
- package/dist/public/static/js/client.0ead607b.chunk.js +2 -0
- package/dist/public/static/js/draft-js-lib-isSoftNewlineEvent.ad4b1307.chunk.js +2 -0
- package/dist/public/static/js/moment.dfd83abb.chunk.js +2 -0
- package/dist/public/static/js/plone-volto-components-manage-Widgets-DatetimeWidget.77a7ad0d.chunk.js +2 -0
- package/dist/public/static/js/plone-volto-components-theme-View-EventView.c500936a.chunk.js +2 -0
- package/dist/public/static/js/react-dates.d94a34ee.chunk.js +2 -0
- package/dist/public/static/js/react-select.43f17559.chunk.js +2 -0
- package/dist/public/static/js/react-simple-code-editor.484ec69f.chunk.js +2 -0
- package/dist/public/static/js/runtime~client.c0921d19.js +2 -0
- package/dist/public/static/media/Logo.16e25cdf.svg +21 -0
- package/dist/public/static/media/block-image.8a4a14d5.svg +8 -0
- package/dist/public/static/media/block-maps.731e84f6.svg +7 -0
- package/dist/public/static/media/block-video.832fa3ff.svg +7 -0
- package/dist/public/static/media/default-image.9451b251.svg +13 -0
- package/dist/public/static/media/flags.9c74e172.png +0 -0
- package/dist/public/static/media/icons.022583c4.svg +320 -0
- package/dist/public/static/media/icons.06400145.ttf +0 -0
- package/dist/public/static/media/icons.dbc1ef8b.eot +0 -0
- package/dist/public/static/media/icons.df45b7de.woff +0 -0
- package/dist/server.js +2 -0
- package/docker-compose.yml +15 -10
- package/locales/ca/LC_MESSAGES/volto.po +33 -9
- package/locales/ca.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +33 -9
- package/locales/de.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +33 -9
- package/locales/en.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +33 -9
- package/locales/es.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +33 -9
- package/locales/eu.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +33 -9
- package/locales/fr.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +33 -9
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +33 -9
- package/locales/ja.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +33 -9
- package/locales/nl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +33 -9
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +33 -9
- package/locales/pt_BR.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +33 -9
- package/locales/ro.json +1 -1
- package/locales/volto.pot +34 -10
- package/logos/Logo.png +0 -0
- package/logos/volto-colorful.png +0 -0
- package/logos/volto-colorful.svg +35 -0
- package/logos/volto-guide.png +0 -0
- package/logos/volto-h-transparent.svg +6 -0
- package/logos/volto-transparent.png +0 -0
- package/logos/volto-transparent.svg +19 -0
- package/logos/volto-transparent2.svg +5 -0
- package/logos/volto-yellow.svg +29 -0
- package/logos/volto.sketch +0 -0
- package/netlify.toml +2 -0
- package/package.json +22 -12
- package/pyvenv.cfg +3 -0
- package/razzle.config.js +17 -13
- package/src/actions/language/language.js +23 -11
- package/src/actions/lazyLibraries/lazyLibraries.js +8 -4
- package/src/components/index.js +2 -0
- package/src/components/manage/Add/Add.jsx +1 -1
- package/src/components/manage/AnchorPlugin/components/LinkButton/AddLinkForm.jsx +1 -2
- package/src/components/manage/AnchorPlugin/components/LinkButton/index.jsx +15 -6
- package/src/components/manage/AnchorPlugin/index.jsx +12 -5
- package/src/components/manage/AnchorPlugin/utils/EditorUtils.js +8 -7
- package/src/components/manage/Blocks/Description/Edit.jsx +33 -19
- package/src/components/manage/Blocks/Description/Edit.test.jsx +6 -0
- package/src/components/manage/Blocks/HeroImageLeft/Edit.jsx +37 -26
- package/src/components/manage/Blocks/HeroImageLeft/Edit.test.jsx +6 -0
- package/src/components/manage/Blocks/Listing/View.jsx +1 -1
- package/src/components/manage/Blocks/Search/README.md +20 -0
- package/src/components/manage/Blocks/Search/components/CheckboxFacet.jsx +16 -3
- package/src/components/manage/Blocks/Search/components/DateRangeFacet.jsx +120 -0
- package/src/components/manage/Blocks/Search/components/DateRangeFacet.test.jsx +34 -0
- package/src/components/manage/Blocks/Search/components/DateRangeFacetFilterListEntry.jsx +39 -0
- package/src/components/manage/Blocks/Search/components/Facets.jsx +24 -25
- package/src/components/manage/Blocks/Search/components/FilterList.jsx +37 -67
- package/src/components/manage/Blocks/Search/components/FilterList.test.jsx +49 -1
- package/src/components/manage/Blocks/Search/components/SelectFacet.jsx +9 -0
- package/src/components/manage/Blocks/Search/components/SelectFacetFilterListEntry.jsx +42 -0
- package/src/components/manage/Blocks/Search/components/SelectStyling.jsx +1 -1
- package/src/components/manage/Blocks/Search/components/ToggleFacet.jsx +38 -0
- package/src/components/manage/Blocks/Search/components/ToggleFacetFilterListEntry.jsx +39 -0
- package/src/components/manage/Blocks/Search/components/base.js +52 -0
- package/src/components/manage/Blocks/Search/components/index.js +5 -0
- package/src/components/manage/Blocks/Search/hocs/withSearch.jsx +68 -27
- package/src/components/manage/Blocks/Search/schema.js +7 -4
- package/src/components/manage/Blocks/Search/utils.js +16 -0
- package/src/components/manage/Blocks/Table/Cell.jsx +40 -14
- package/src/components/manage/Blocks/Table/Cell.test.jsx +7 -1
- package/src/components/manage/Blocks/Table/Edit.jsx +7 -3
- package/src/components/manage/Blocks/Table/Edit.test.jsx +6 -0
- package/src/components/manage/Blocks/Table/View.jsx +2 -2
- package/src/components/manage/Blocks/Text/Edit.jsx +56 -14
- package/src/components/manage/Blocks/Text/Edit.test.jsx +7 -1
- package/src/components/manage/Blocks/Text/View.jsx +2 -2
- package/src/components/manage/Blocks/Title/Edit.jsx +25 -13
- package/src/components/manage/Blocks/Title/Edit.test.jsx +6 -0
- package/src/components/manage/Contents/ContentsIndexHeader.test.jsx +2 -1
- package/src/components/manage/Contents/ContentsUploadModal.jsx +3 -1
- package/src/components/manage/Multilingual/CreateTranslation.jsx +1 -1
- package/src/components/manage/Multilingual/TranslationObject.jsx +1 -1
- package/src/components/manage/Pluggable/index.js +1 -1
- package/src/components/manage/Preferences/PersonalPreferences.jsx +1 -1
- package/src/components/manage/Sidebar/Sidebar.jsx +5 -1
- package/src/components/manage/Toolbar/Toolbar.jsx +3 -1
- package/src/components/manage/UniversalLink/UniversalLink.jsx +5 -2
- package/src/components/manage/Widgets/DatetimeWidget.jsx +3 -1
- package/src/components/manage/Widgets/IdWidget.jsx +234 -0
- package/src/components/manage/Widgets/IdWidget.stories.jsx +21 -0
- package/src/components/manage/Widgets/IdWidget.test.jsx +135 -0
- package/src/components/manage/Widgets/SelectAutoComplete.jsx +2 -2
- package/src/components/manage/Widgets/UrlWidget.jsx +1 -1
- package/src/components/manage/Widgets/WysiwygWidget.jsx +45 -19
- package/src/components/manage/Widgets/WysiwygWidget.test.jsx +7 -1
- package/src/components/theme/ContactForm/ContactForm.jsx +1 -1
- package/src/components/theme/EventDetails/EventDetails.jsx +140 -0
- package/src/components/theme/EventDetails/EventDetails.test.jsx +87 -0
- package/src/components/theme/LanguageSelector/LanguageSelector.js +2 -18
- package/src/components/theme/Login/Login.jsx +3 -1
- package/src/components/theme/MultilingualRedirector/MultilingualRedirector.jsx +10 -31
- package/src/components/theme/View/EventView.jsx +62 -140
- package/src/components/theme/View/LinkView.jsx +3 -3
- package/src/components/theme/View/NewsItemView.jsx +44 -35
- package/src/components/theme/View/View.jsx +5 -1
- package/src/config/Blocks.jsx +31 -0
- package/src/config/Loadables.jsx +22 -0
- package/src/config/RichTextEditor/Blocks.jsx +25 -20
- package/src/config/RichTextEditor/Plugins.jsx +38 -31
- package/src/config/RichTextEditor/Styles.jsx +48 -44
- package/src/config/RichTextEditor/index.js +25 -0
- package/src/config/Widgets.jsx +2 -0
- package/src/config/index.js +15 -18
- package/src/helpers/Api/Api.js +20 -4
- package/src/helpers/Extensions/index.js +1 -1
- package/src/helpers/Extensions/withBlockExtensions.js +4 -0
- package/src/helpers/Extensions/withBlockExtensions.test.js +26 -1
- package/src/helpers/Url/Url.js +41 -1
- package/src/helpers/Url/Url.test.js +7 -0
- package/src/helpers/Url/urlRegex.js +7 -1
- package/src/helpers/index.js +3 -0
- package/src/middleware/api.js +35 -3
- package/src/server.jsx +20 -6
- package/src/start-client.jsx +2 -2
- package/src/store.js +1 -1
- package/test-setup-config.js +22 -7
- package/theme/themes/pastanaga/extras/blocks.less +29 -0
- package/theme/themes/pastanaga/extras/contents.less +6 -0
- package/{webpack-bundle-analyze-plugin.js → webpack-plugins/webpack-bundle-analyze-plugin.js} +0 -0
- package/{webpack-less-plugin.js → webpack-plugins/webpack-less-plugin.js} +0 -0
- package/{webpack-relative-resolver.js → webpack-plugins/webpack-relative-resolver.js} +0 -0
- package/{webpack-root-resolver.js → webpack-plugins/webpack-root-resolver.js} +0 -0
- package/{webpack-sentry-plugin.js → webpack-plugins/webpack-sentry-plugin.js} +0 -0
- package/{webpack-svg-plugin.js → webpack-plugins/webpack-svg-plugin.js} +0 -0
- package/.surgeignore +0 -2
- package/Dockerfile.slim +0 -27
- package/patches/fixprettier.patch +0 -11
- package/patches/fixstylelint.patch +0 -11
- package/src/components/manage/AnchorPlugin/utils/URLUtils.js +0 -36
- package/src/components/manage/AnchorPlugin/utils/mailRegex.js +0 -2
- package/src/components/manage/AnchorPlugin/utils/telRegex.js +0 -1
- package/src/components/manage/AnchorPlugin/utils/urlRegex.js +0 -54
- package/styleguide.config.js +0 -42
package/test-setup-config.js
CHANGED
|
@@ -18,11 +18,30 @@ import {
|
|
|
18
18
|
blockStyleFn,
|
|
19
19
|
listBlockTypes,
|
|
20
20
|
} from '@plone/volto/config/RichTextEditor/Blocks';
|
|
21
|
+
import FromHTMLCustomBlockFn from '@plone/volto/config/RichTextEditor/FromHTML';
|
|
21
22
|
import { contentIcons } from '@plone/volto/config/ContentIcons';
|
|
22
23
|
|
|
23
|
-
import FromHTMLCustomBlockFn from '@plone/volto/config/RichTextEditor/FromHTML';
|
|
24
24
|
import { controlPanelsIcons } from '@plone/volto/config/ControlPanels';
|
|
25
25
|
|
|
26
|
+
// we need to do a redefinition here because of circular import issues
|
|
27
|
+
// because draftjs-based components are not really tested, this is basically
|
|
28
|
+
// dummy code.
|
|
29
|
+
const richtextEditorSettings = (props) => {
|
|
30
|
+
return {
|
|
31
|
+
extendedBlockRenderMap,
|
|
32
|
+
blockStyleFn,
|
|
33
|
+
listBlockTypes,
|
|
34
|
+
FromHTMLCustomBlockFn,
|
|
35
|
+
// richTextEditorPlugins: plugins,
|
|
36
|
+
// richTextEditorInlineToolbarButtons: inlineToolbarButtons,
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const richtextViewSettings = {
|
|
41
|
+
ToHTMLRenderers,
|
|
42
|
+
ToHTMLOptions,
|
|
43
|
+
};
|
|
44
|
+
|
|
26
45
|
config.set('settings', {
|
|
27
46
|
apiPath: 'http://localhost:8080/Plone',
|
|
28
47
|
defaultLanguage: 'en',
|
|
@@ -30,12 +49,8 @@ config.set('settings', {
|
|
|
30
49
|
defaultPageSize: 25,
|
|
31
50
|
isMultilingual: false,
|
|
32
51
|
nonContentRoutes,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
listBlockTypes,
|
|
36
|
-
FromHTMLCustomBlockFn,
|
|
37
|
-
ToHTMLRenderers,
|
|
38
|
-
ToHTMLOptions,
|
|
52
|
+
richtextEditorSettings,
|
|
53
|
+
richtextViewSettings,
|
|
39
54
|
contentIcons: contentIcons,
|
|
40
55
|
loadables,
|
|
41
56
|
lazyBundles: {
|
|
@@ -1057,4 +1057,33 @@ body.has-toolbar.has-sidebar-collapsed .ui.wrapper > .ui.inner.block.full {
|
|
|
1057
1057
|
height: 28px !important;
|
|
1058
1058
|
}
|
|
1059
1059
|
}
|
|
1060
|
+
|
|
1061
|
+
.daterange-facet {
|
|
1062
|
+
.ui.date-input input {
|
|
1063
|
+
height: auto;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
.ui-button {
|
|
1067
|
+
margin: 0;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
.DateInput {
|
|
1071
|
+
width: 40%;
|
|
1072
|
+
min-width: 75px;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
.DateRangePickerInput_arrow_svg {
|
|
1076
|
+
margin: 0 6px;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
.DateRangePicker_picker {
|
|
1080
|
+
z-index: 10;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
.radio {
|
|
1084
|
+
display: flex;
|
|
1085
|
+
min-height: 37px;
|
|
1086
|
+
align-items: center;
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1060
1089
|
}
|
package/{webpack-bundle-analyze-plugin.js → webpack-plugins/webpack-bundle-analyze-plugin.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/.surgeignore
DELETED
package/Dockerfile.slim
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
FROM node:12-stretch-slim
|
|
2
|
-
|
|
3
|
-
RUN runDeps="openssl ca-certificates patch" \
|
|
4
|
-
&& apt-get update \
|
|
5
|
-
&& apt-get install -y --no-install-recommends $runDeps \
|
|
6
|
-
&& apt-get clean \
|
|
7
|
-
&& rm -rf /var/lib/apt/lists/*
|
|
8
|
-
|
|
9
|
-
RUN mkdir -p /opt/frontend \
|
|
10
|
-
&& chown -R node /opt/frontend
|
|
11
|
-
|
|
12
|
-
WORKDIR /opt/frontend/
|
|
13
|
-
RUN npm install -g yo @plone/generator-volto wait-on
|
|
14
|
-
|
|
15
|
-
USER node
|
|
16
|
-
RUN yo --no-insight @plone/volto --no-interactive
|
|
17
|
-
|
|
18
|
-
RUN RAZZLE_API_PATH=VOLTO_API_PATH RAZZLE_INTERNAL_API_PATH=VOLTO_INTERNAL_API_PATH yarn \
|
|
19
|
-
&& RAZZLE_API_PATH=VOLTO_API_PATH RAZZLE_INTERNAL_API_PATH=VOLTO_INTERNAL_API_PATH yarn build \
|
|
20
|
-
&& rm -rf /home/node/.cache
|
|
21
|
-
|
|
22
|
-
COPY entrypoint.sh /
|
|
23
|
-
|
|
24
|
-
EXPOSE 3000 3001 4000 4001
|
|
25
|
-
|
|
26
|
-
ENTRYPOINT ["/entrypoint.sh"]
|
|
27
|
-
CMD ["yarn", "start:prod"]
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
--- node_modules/prettier/index.js 2019-11-14 20:05:13.844000000 +0100
|
|
2
|
-
+++ index-patched.js 2019-11-15 23:35:37.326000000 +0100
|
|
3
|
-
@@ -37420,7 +37420,7 @@
|
|
4
|
-
var type$9 = "markup";
|
|
5
|
-
var group$8 = "CSS";
|
|
6
|
-
var extensions$9 = [
|
|
7
|
-
- ".less"
|
|
8
|
-
+ ".less", "overrides"
|
|
9
|
-
];
|
|
10
|
-
var tmScope$9 = "source.css.less";
|
|
11
|
-
var aceMode$9 = "less";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
--- /Users/sneridagh/Development/plone/volto/node_modules/stylelint/lib/getPostcssResult.js 2019-11-14 20:05:13.849000000 +0100
|
|
2
|
-
+++ getPostcssResult-patched.js 2019-11-16 14:27:19.985147119 +0100
|
|
3
|
-
@@ -80,6 +80,8 @@
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
syntax = dynamicRequire(syntax);
|
|
7
|
-
+ } else if (options.filePath && /\.(overrides)$/.test(options.filePath)) {
|
|
8
|
-
+ syntax = dynamicRequire('postcss-less');
|
|
9
|
-
} else if (
|
|
10
|
-
!(options.codeProcessors && options.codeProcessors.length) ||
|
|
11
|
-
(options.filePath && /\.(scss|sass|less)$/.test(options.filePath))
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import prependHttp from 'prepend-http';
|
|
2
|
-
import urlRegex from './urlRegex';
|
|
3
|
-
import mailRegex from './mailRegex';
|
|
4
|
-
import telRegex from './telRegex';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
isUrl(text) {
|
|
8
|
-
return urlRegex().test(text);
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
isMail(text) {
|
|
12
|
-
return mailRegex().test(text);
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
isTelephone(text) {
|
|
16
|
-
return telRegex().test(text);
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
normaliseMail(email) {
|
|
20
|
-
if (email.toLowerCase().startsWith('mailto:')) {
|
|
21
|
-
return email;
|
|
22
|
-
}
|
|
23
|
-
return `mailto:${email}`;
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
normalizeTelephone(tel) {
|
|
27
|
-
if (tel.toLowerCase().startsWith('tel:')) {
|
|
28
|
-
return tel;
|
|
29
|
-
}
|
|
30
|
-
return `tel:${tel}`;
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
normalizeUrl(url) {
|
|
34
|
-
return prependHttp(url);
|
|
35
|
-
},
|
|
36
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default () => /^[tel:]*[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s./0-9]*$/g;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/* eslint-disable arrow-body-style */
|
|
2
|
-
/* eslint-disable no-confusing-arrow */
|
|
3
|
-
import tlds from 'tlds';
|
|
4
|
-
|
|
5
|
-
const v4 =
|
|
6
|
-
'(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}';
|
|
7
|
-
const v6seg = '[0-9a-fA-F]{1,4}';
|
|
8
|
-
const v6 = `
|
|
9
|
-
(
|
|
10
|
-
(?:${v6seg}:){7}(?:${v6seg}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
11
|
-
(?:${v6seg}:){6}(?:${v4}|:${v6seg}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
|
|
12
|
-
(?:${v6seg}:){5}(?::${v4}|(:${v6seg}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
|
|
13
|
-
(?:${v6seg}:){4}(?:(:${v6seg}){0,1}:${v4}|(:${v6seg}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
|
|
14
|
-
(?:${v6seg}:){3}(?:(:${v6seg}){0,2}:${v4}|(:${v6seg}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
|
|
15
|
-
(?:${v6seg}:){2}(?:(:${v6seg}){0,3}:${v4}|(:${v6seg}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
|
|
16
|
-
(?:${v6seg}:){1}(?:(:${v6seg}){0,4}:${v4}|(:${v6seg}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
17
|
-
(?::((?::${v6seg}){0,5}:${v4}|(?::${v6seg}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|
18
|
-
)(%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|
19
|
-
`
|
|
20
|
-
.replace(/\s*\/\/.*$/gm, '')
|
|
21
|
-
.replace(/\n/g, '')
|
|
22
|
-
.trim();
|
|
23
|
-
|
|
24
|
-
const ipRegex = (opts) =>
|
|
25
|
-
opts && opts.exact
|
|
26
|
-
? new RegExp(`(?:^${v4}$)|(?:^${v6}$)`)
|
|
27
|
-
: new RegExp(`(?:${v4})|(?:${v6})`, 'g');
|
|
28
|
-
|
|
29
|
-
ipRegex.v4 = (opts) =>
|
|
30
|
-
opts && opts.exact ? new RegExp(`^${v4}$`) : new RegExp(v4, 'g');
|
|
31
|
-
ipRegex.v6 = (opts) =>
|
|
32
|
-
opts && opts.exact ? new RegExp(`^${v6}$`) : new RegExp(v6, 'g');
|
|
33
|
-
|
|
34
|
-
export default (_opts) => {
|
|
35
|
-
const opts = Object.assign({ strict: true }, _opts);
|
|
36
|
-
const protocol = `(?:(?:[a-z]+:)?//)${opts.strict ? '' : '?'}`;
|
|
37
|
-
const auth = '(?:\\S+(?::\\S*)?@)?';
|
|
38
|
-
const ip = ipRegex.v4().source;
|
|
39
|
-
const host = '(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)';
|
|
40
|
-
const domain =
|
|
41
|
-
'(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*';
|
|
42
|
-
const tld = `(?:\\.${
|
|
43
|
-
opts.strict
|
|
44
|
-
? '(?:[a-z\\u00a1-\\uffff]{2,})'
|
|
45
|
-
: `(?:${tlds.sort((a, b) => b.length - a.length).join('|')})`
|
|
46
|
-
})\\.?`;
|
|
47
|
-
const port = '(?::\\d{2,5})?';
|
|
48
|
-
const path = '(?:[/?#][^\\s"]*)?';
|
|
49
|
-
const regex = `(?:${protocol}|www\\.)${auth}(?:localhost|${ip}|${host}${domain}${tld})${port}${path}`;
|
|
50
|
-
|
|
51
|
-
return opts.exact
|
|
52
|
-
? new RegExp(`(?:^${regex}$)`, 'i')
|
|
53
|
-
: new RegExp(regex, 'ig');
|
|
54
|
-
};
|
package/styleguide.config.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
components: 'src/components/**/*.jsx',
|
|
3
|
-
ignore: ['**/*.test.jsx', '**/Contents/Contents*jsx', '**/Tile/Tile.jsx'],
|
|
4
|
-
verbose: true,
|
|
5
|
-
title: 'Volto Style Guide',
|
|
6
|
-
showCode: true,
|
|
7
|
-
showUsage: true,
|
|
8
|
-
sections: [
|
|
9
|
-
{
|
|
10
|
-
name: 'Introduction',
|
|
11
|
-
content: 'docs/introduction.md',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: 'Theme',
|
|
15
|
-
components: 'src/components/theme/**/*.jsx',
|
|
16
|
-
content: 'docs/theme.md',
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: 'Manage',
|
|
20
|
-
components: 'src/components/manage/**/*.jsx',
|
|
21
|
-
content: 'docs/manage.md',
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
webpackConfig: {
|
|
25
|
-
module: {
|
|
26
|
-
rules: [
|
|
27
|
-
{
|
|
28
|
-
test: /\.jsx?$/,
|
|
29
|
-
exclude: /node_modules/,
|
|
30
|
-
loader: 'babel-loader',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
test: /\.(woff|woff2|ttf|eot|svg|png|gif|jpg)(\?v=\d+\.\d+\.\d+)?$/,
|
|
34
|
-
loader: 'url-loader',
|
|
35
|
-
options: {
|
|
36
|
-
limit: 10000,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
};
|