@uncinc/uncinc-react-kitchen-sink 2.5.4 → 2.6.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/Context/KitchenSinkComponentMapperContext.d.ts +3 -0
- package/dist/Context/withMapping.d.ts +3 -0
- package/dist/components/Button/index.d.ts +41 -0
- package/dist/components/CallToAction/index.d.ts +15 -0
- package/dist/components/CallToAction/index.js +43 -0
- package/dist/components/CallToAction/stories.d.ts +8 -0
- package/dist/components/CallToAction/stories.js +37 -0
- package/dist/components/CallToAction/style.scss +25 -0
- package/dist/components/Cookie/index.js +39 -40
- package/dist/components/Cookie/style.scss +18 -1
- package/dist/components/Download/index.d.ts +13 -0
- package/dist/components/Download/index.js +58 -0
- package/dist/components/Download/stories.d.ts +8 -0
- package/dist/components/Download/stories.js +28 -0
- package/dist/components/Download/stories.scss +67 -0
- package/dist/components/Image/LazyLoadWrapper/index.d.ts +10 -0
- package/dist/components/Image/Picture/index.d.ts +23 -0
- package/dist/components/Image/Picture/index.js +7 -1
- package/dist/components/Image/index.d.ts +15 -0
- package/dist/components/Image/index.js +8 -2
- package/dist/components/MediaPlayer/index.d.ts +8 -0
- package/dist/components/MediaPlayer/index.js +154 -0
- package/dist/components/MediaPlayer/stories.d.ts +12 -0
- package/dist/components/MediaPlayer/stories.js +146 -0
- package/dist/components/MediaPlayer/style.scss +7 -0
- package/dist/components/MediaPlayer/types.d.ts +24 -0
- package/dist/components/MediaPlayer/types.js +1 -0
- package/dist/components/TitleWithText/index.d.ts +8 -0
- package/dist/components/TitleWithText/index.js +28 -0
- package/dist/components/TitleWithText/stories.d.ts +8 -0
- package/dist/components/TitleWithText/stories.js +24 -0
- package/dist/components/TitleWithText/stories.scss +0 -0
- package/dist/components/WysiwygField/index.d.ts +18 -0
- package/dist/components/index.js +7 -0
- package/dist/config/constants.d.ts +15 -0
- package/dist/config/i18next/locales/en.json +12 -0
- package/dist/config/i18next/locales/nl.json +9 -0
- package/dist/custom.d.js +1 -0
- package/dist/helpers/gtm.d.ts +44 -0
- package/dist/helpers/link.d.ts +2 -0
- package/dist/index.js +49 -0
- package/dist/organisms/Downloads/index.d.ts +11 -0
- package/dist/organisms/Downloads/index.js +37 -0
- package/dist/organisms/Downloads/stories.d.ts +8 -0
- package/dist/organisms/Downloads/stories.js +43 -0
- package/dist/organisms/Downloads/stories.scss +67 -0
- package/dist/organisms/Quote/index.d.ts +18 -0
- package/dist/organisms/Quote/index.js +53 -0
- package/dist/organisms/Quote/stories.d.ts +8 -0
- package/dist/organisms/Quote/stories.js +39 -0
- package/dist/organisms/Quote/stories.scss +48 -0
- package/dist/organisms/Text/index.d.ts +15 -0
- package/dist/organisms/Text/index.js +74 -0
- package/dist/organisms/Text/stories.d.ts +8 -0
- package/dist/organisms/Text/stories.js +30 -0
- package/dist/organisms/Text/stories.scss +29 -0
- package/package.json +6 -2
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import 'videojs-vimeo-tech';
|
|
3
|
+
import 'videojs-youtube';
|
|
4
|
+
import { MediaPlayerProps } from './types';
|
|
5
|
+
import 'video.js/dist/video-js.css';
|
|
6
|
+
import './style.scss';
|
|
7
|
+
declare const MediaPlayer: React.FC<MediaPlayerProps>;
|
|
8
|
+
export default MediaPlayer;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _reactHookVideojs = require("react-hook-videojs");
|
|
10
|
+
var _reactI18next = require("react-i18next");
|
|
11
|
+
require("videojs-vimeo-tech");
|
|
12
|
+
require("videojs-youtube");
|
|
13
|
+
require("video.js/dist/video-js.css");
|
|
14
|
+
require("./style.scss");
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
20
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
22
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
23
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } // VideoJS plugins:
|
|
24
|
+
var MediaPlayer = function MediaPlayer(_ref) {
|
|
25
|
+
var src = _ref.src,
|
|
26
|
+
type = _ref.type,
|
|
27
|
+
controls = _ref.controls,
|
|
28
|
+
posterUrl = _ref.posterUrl,
|
|
29
|
+
customOptions = _ref.options,
|
|
30
|
+
captions = _ref.captions,
|
|
31
|
+
audioOnly = _ref.audioOnly,
|
|
32
|
+
notSupportedMessage = _ref.notSupportedMessage,
|
|
33
|
+
className = _ref.className,
|
|
34
|
+
onPlay = _ref.onPlay,
|
|
35
|
+
onPause = _ref.onPause,
|
|
36
|
+
onEnded = _ref.onEnded,
|
|
37
|
+
onSeeking = _ref.onSeeking,
|
|
38
|
+
onVolumeChange = _ref.onVolumeChange,
|
|
39
|
+
onFullscreenChange = _ref.onFullscreenChange,
|
|
40
|
+
onError = _ref.onError;
|
|
41
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
42
|
+
t = _useTranslation.t;
|
|
43
|
+
var classNames = (0, _classnames.default)('MediaPlayer', 'video-js', 'vjs-default-skin', 'vjs-big-play-centered', className);
|
|
44
|
+
var audioOnlyMode = (0, _react.useMemo)(function () {
|
|
45
|
+
return audioOnly || type.startsWith('audio');
|
|
46
|
+
}, [type, audioOnly]);
|
|
47
|
+
var controlBar = (0, _react.useMemo)(function () {
|
|
48
|
+
var videoJSControls = {
|
|
49
|
+
play: 'playToggle',
|
|
50
|
+
currentTime: 'currentTimeDisplay',
|
|
51
|
+
timeDivider: 'timeDivider',
|
|
52
|
+
duration: 'durationDisplay',
|
|
53
|
+
seekbar: 'progressControl',
|
|
54
|
+
captions: 'subsCapsButton',
|
|
55
|
+
volume: 'volumePanel',
|
|
56
|
+
fullscreen: 'fullscreenToggle'
|
|
57
|
+
};
|
|
58
|
+
var controlMapped = function controlMapped(control) {
|
|
59
|
+
return {
|
|
60
|
+
name: videoJSControls[control],
|
|
61
|
+
className: "MediaPlayer__control MediaPlayer__control--".concat(control)
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
if (controls === false || _typeof(controls) === 'object' && controls.length === 0) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
if (_typeof(controls) === 'object' && controls.length > 0) {
|
|
68
|
+
return {
|
|
69
|
+
children: controls.map(controlMapped)
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
children: Object.keys(videoJSControls).map(controlMapped)
|
|
74
|
+
};
|
|
75
|
+
}, [controls]);
|
|
76
|
+
|
|
77
|
+
// Can be overridden by the custom options prop.
|
|
78
|
+
var defaultOptions = {
|
|
79
|
+
controls: true,
|
|
80
|
+
aspectRatio: '16:9',
|
|
81
|
+
audioOnlyMode: audioOnlyMode,
|
|
82
|
+
fluid: true,
|
|
83
|
+
notSupportedMessage: notSupportedMessage || t('organisms.media_player.not_supported_message'),
|
|
84
|
+
techOrder: ['html5', 'youtube', 'vimeo'],
|
|
85
|
+
poster: posterUrl,
|
|
86
|
+
controlBar: controlBar,
|
|
87
|
+
sources: [{
|
|
88
|
+
src: src,
|
|
89
|
+
type: type
|
|
90
|
+
}]
|
|
91
|
+
};
|
|
92
|
+
var options = _objectSpread(_objectSpread({}, defaultOptions), customOptions);
|
|
93
|
+
var videoJS = (0, _reactHookVideojs.useVideoJS)(options);
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
95
|
+
var Video = videoJS.Video,
|
|
96
|
+
player = videoJS.player,
|
|
97
|
+
ready = videoJS.ready;
|
|
98
|
+
|
|
99
|
+
// Passing down the VideoJS events.
|
|
100
|
+
(0, _react.useEffect)(function () {
|
|
101
|
+
if (ready) {
|
|
102
|
+
if (onPlay) {
|
|
103
|
+
player.one('play', function (event) {
|
|
104
|
+
return onPlay(player, event);
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if (onPause) {
|
|
108
|
+
player.one('pause', function (event) {
|
|
109
|
+
return onPause(player, event);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
if (onEnded) {
|
|
113
|
+
player.one('ended', function (event) {
|
|
114
|
+
return onEnded(player, event);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
if (onSeeking) {
|
|
118
|
+
player.one('seeking', function (event) {
|
|
119
|
+
return onSeeking(player, event);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
if (onVolumeChange) {
|
|
123
|
+
player.one('volumechange', function (event) {
|
|
124
|
+
return onVolumeChange(player, event);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (onFullscreenChange) {
|
|
128
|
+
player.one('fullscreenchange', function (event) {
|
|
129
|
+
return onFullscreenChange(player, event);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
if (onError) {
|
|
133
|
+
player.one('error', function (event) {
|
|
134
|
+
return onError(player, event);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
// eslint-disable-next-line max-len
|
|
139
|
+
}, [onEnded, onError, onFullscreenChange, onPause, onPlay, onSeeking, onVolumeChange, player, ready]);
|
|
140
|
+
return /*#__PURE__*/_react.default.createElement(Video, {
|
|
141
|
+
className: classNames
|
|
142
|
+
}, !audioOnlyMode && captions && captions.map(function (caption) {
|
|
143
|
+
return /*#__PURE__*/_react.default.createElement("track", {
|
|
144
|
+
key: "caption:".concat(caption.language),
|
|
145
|
+
kind: "captions",
|
|
146
|
+
src: caption.src,
|
|
147
|
+
srcLang: caption.language,
|
|
148
|
+
label: caption.label || caption.language,
|
|
149
|
+
default: caption.default
|
|
150
|
+
});
|
|
151
|
+
}));
|
|
152
|
+
};
|
|
153
|
+
var _default = MediaPlayer;
|
|
154
|
+
exports.default = _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: React.FC<import("./types").MediaPlayerProps>;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const LocalVideo: (args: any) => React.JSX.Element;
|
|
8
|
+
export declare const LocalAudio: (args: any) => React.JSX.Element;
|
|
9
|
+
export declare const Youtube: (args: any) => React.JSX.Element;
|
|
10
|
+
export declare const Vimeo: (args: any) => React.JSX.Element;
|
|
11
|
+
export declare const WithCaptions: (args: any) => React.JSX.Element;
|
|
12
|
+
export declare const Advanced: (args: any) => React.JSX.Element;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.Youtube = exports.WithCaptions = exports.Vimeo = exports.LocalVideo = exports.LocalAudio = exports.Advanced = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _ = _interopRequireDefault(require("."));
|
|
10
|
+
var _nl = _interopRequireDefault(require("../../../.storybook/assets/videos/nl.vtt"));
|
|
11
|
+
var _en = _interopRequireDefault(require("../../../.storybook/assets/videos/en.vtt"));
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
18
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
19
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
20
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
22
|
+
var localVideo = 'https://www.uncinc.nl/sites/default/files/videos/unc-inc-office-film-v1.mp4';
|
|
23
|
+
var _default = {
|
|
24
|
+
title: 'Organisms/MediaPlayer',
|
|
25
|
+
component: _.default
|
|
26
|
+
};
|
|
27
|
+
exports.default = _default;
|
|
28
|
+
var LocalVideo = function LocalVideo(args) {
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement(_.default, _extends({
|
|
30
|
+
src: localVideo,
|
|
31
|
+
type: "video/mp4"
|
|
32
|
+
}, args));
|
|
33
|
+
};
|
|
34
|
+
exports.LocalVideo = LocalVideo;
|
|
35
|
+
var LocalAudio = function LocalAudio(args) {
|
|
36
|
+
return /*#__PURE__*/_react.default.createElement(_.default, _extends({
|
|
37
|
+
src: localVideo,
|
|
38
|
+
type: "audio/mp4",
|
|
39
|
+
audioOnly: true
|
|
40
|
+
}, args));
|
|
41
|
+
};
|
|
42
|
+
exports.LocalAudio = LocalAudio;
|
|
43
|
+
var Youtube = function Youtube(args) {
|
|
44
|
+
return /*#__PURE__*/_react.default.createElement(_.default, _extends({
|
|
45
|
+
src: "https://www.youtube.com/watch?v=eJHHZC46i1I",
|
|
46
|
+
type: "video/youtube"
|
|
47
|
+
}, args));
|
|
48
|
+
};
|
|
49
|
+
exports.Youtube = Youtube;
|
|
50
|
+
var Vimeo = function Vimeo(args) {
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement(_.default, _extends({
|
|
52
|
+
src: "https://vimeo.com/153783319",
|
|
53
|
+
type: "video/vimeo"
|
|
54
|
+
}, args));
|
|
55
|
+
};
|
|
56
|
+
exports.Vimeo = Vimeo;
|
|
57
|
+
var WithCaptions = function WithCaptions(args) {
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement(_.default, _extends({
|
|
59
|
+
src: localVideo,
|
|
60
|
+
type: "video/mp4",
|
|
61
|
+
captions: [{
|
|
62
|
+
src: _nl.default,
|
|
63
|
+
language: 'nl',
|
|
64
|
+
label: 'Nederlands',
|
|
65
|
+
default: true
|
|
66
|
+
}, {
|
|
67
|
+
src: _en.default,
|
|
68
|
+
language: 'en',
|
|
69
|
+
label: 'English'
|
|
70
|
+
}]
|
|
71
|
+
}, args));
|
|
72
|
+
};
|
|
73
|
+
exports.WithCaptions = WithCaptions;
|
|
74
|
+
var Advanced = function Advanced(args) {
|
|
75
|
+
var _useState = (0, _react.useState)(''),
|
|
76
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
77
|
+
status = _useState2[0],
|
|
78
|
+
setStatus = _useState2[1];
|
|
79
|
+
var _useState3 = (0, _react.useState)(0),
|
|
80
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
81
|
+
currentTime = _useState4[0],
|
|
82
|
+
setCurrentTime = _useState4[1];
|
|
83
|
+
var _useState5 = (0, _react.useState)(1),
|
|
84
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
85
|
+
volume = _useState6[0],
|
|
86
|
+
setVolume = _useState6[1];
|
|
87
|
+
var _useState7 = (0, _react.useState)(''),
|
|
88
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
89
|
+
error = _useState8[0],
|
|
90
|
+
setError = _useState8[1];
|
|
91
|
+
var message = (0, _react.useMemo)(function () {
|
|
92
|
+
switch (status) {
|
|
93
|
+
case 'playing':
|
|
94
|
+
{
|
|
95
|
+
return 'Video is currently playing';
|
|
96
|
+
}
|
|
97
|
+
case 'paused':
|
|
98
|
+
{
|
|
99
|
+
return 'Video is paused';
|
|
100
|
+
}
|
|
101
|
+
case 'ended':
|
|
102
|
+
{
|
|
103
|
+
return 'Video has ended';
|
|
104
|
+
}
|
|
105
|
+
default:
|
|
106
|
+
{
|
|
107
|
+
return 'Player is ready';
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}, [status]);
|
|
111
|
+
if (error) {
|
|
112
|
+
return /*#__PURE__*/_react.default.createElement("p", null, "The media player encountered an error: ", error);
|
|
113
|
+
}
|
|
114
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_.default, _extends({
|
|
115
|
+
src: localVideo,
|
|
116
|
+
type: "video/mp4",
|
|
117
|
+
controls: ['play', 'volume', 'seekbar', 'currentTime', 'fullscreen'],
|
|
118
|
+
posterUrl: "https://www.uncinc.nl/sites/default/files/styles/max_2000x2000/public/2022-06/20220525_unc_inc_bedrijfsrave_mr-4893.webp?itok=WRebIyrU",
|
|
119
|
+
notSupportedMessage: "This is a custom message which you see if a media file is not supported.",
|
|
120
|
+
className: "CustomizedMediaPlayer",
|
|
121
|
+
onPlay: function onPlay() {
|
|
122
|
+
return setStatus('playing');
|
|
123
|
+
},
|
|
124
|
+
onPause: function onPause() {
|
|
125
|
+
return setStatus('paused');
|
|
126
|
+
},
|
|
127
|
+
onEnded: function onEnded() {
|
|
128
|
+
return setStatus('ended');
|
|
129
|
+
},
|
|
130
|
+
onSeeking: function onSeeking(player) {
|
|
131
|
+
return setCurrentTime(player.currentTime());
|
|
132
|
+
},
|
|
133
|
+
onVolumeChange: function onVolumeChange(player) {
|
|
134
|
+
return setVolume(player.volume());
|
|
135
|
+
},
|
|
136
|
+
onError: function onError(player) {
|
|
137
|
+
return setError(player.error().message);
|
|
138
|
+
},
|
|
139
|
+
onFullscreenChange: function onFullscreenChange(player) {
|
|
140
|
+
if (player.isFullscreen()) {
|
|
141
|
+
console.log('Pssst! Secret message telling you the current video you are watching is in fullscreen.');
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}, args)), /*#__PURE__*/_react.default.createElement("p", null, message), /*#__PURE__*/_react.default.createElement("p", null, "Volume: ", Math.round(volume * 100), "%"), currentTime > 0 && /*#__PURE__*/_react.default.createElement("p", null, "Current time: ", Math.round(currentTime), "s"));
|
|
145
|
+
};
|
|
146
|
+
exports.Advanced = Advanced;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
.MediaPlayer {
|
|
2
|
+
// Somehow video.js hides this by default, so we have to force it to show up.
|
|
3
|
+
// See for more info: https://stackoverflow.com/questions/15324061/show-the-current-time-of-the-video-instead-of-the-remaining-time-on-videojs
|
|
4
|
+
.vjs-time-control {
|
|
5
|
+
display: block;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import VideoJsTypes from 'video.js';
|
|
2
|
+
export type MimeType = 'audio/3gpp' | 'audio/aac' | 'audio/flac' | 'audio/mpeg' | 'audio/mp3' | 'audio/mp4' | 'audio/ogg' | 'audio/wav' | 'audio/webm' | 'video/3gpp' | 'video/mpeg' | 'video/mpeg' | 'video/mp4' | 'video/ogg' | 'video/quicktime' | 'video/webm' | 'video/youtube' | 'video/vimeo';
|
|
3
|
+
export type Control = 'play' | 'currentTime' | 'timeDivider' | 'duration' | 'seekbar' | 'captions' | 'volume' | 'fullscreen';
|
|
4
|
+
export type VideoJSControls = {
|
|
5
|
+
[K in Control]: string;
|
|
6
|
+
};
|
|
7
|
+
export type MediaPlayerProps = {
|
|
8
|
+
src: string;
|
|
9
|
+
type: MimeType;
|
|
10
|
+
controls?: Control[] | false;
|
|
11
|
+
posterUrl?: string;
|
|
12
|
+
options?: VideoJsTypes.PlayerOptions;
|
|
13
|
+
captions?: VideoJsTypes.TextTrackOptions[];
|
|
14
|
+
audioOnly?: boolean;
|
|
15
|
+
notSupportedMessage?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
onPlay?: (player: VideoJsTypes.Player, event: VideoJsTypes.EventTarget) => void;
|
|
18
|
+
onPause?: (player: VideoJsTypes.Player, event: VideoJsTypes.EventTarget) => void;
|
|
19
|
+
onEnded?: (player: VideoJsTypes.Player, event: VideoJsTypes.EventTarget) => void;
|
|
20
|
+
onSeeking?: (player: VideoJsTypes.Player, event: VideoJsTypes.EventTarget) => void;
|
|
21
|
+
onVolumeChange?: (player: VideoJsTypes.Player, event: VideoJsTypes.EventTarget) => void;
|
|
22
|
+
onFullscreenChange?: (player: VideoJsTypes.Player, event: VideoJsTypes.EventTarget) => void;
|
|
23
|
+
onError?: (player: VideoJsTypes.Player, event: VideoJsTypes.EventTarget) => void;
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _WysiwygField = _interopRequireDefault(require("../WysiwygField"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
var TitleWithText = function TitleWithText(_ref) {
|
|
12
|
+
var title = _ref.title,
|
|
13
|
+
text = _ref.text,
|
|
14
|
+
className = _ref.className;
|
|
15
|
+
var classes = (0, _classnames.default)('TitleWithText', className);
|
|
16
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
17
|
+
className: classes
|
|
18
|
+
}, title && /*#__PURE__*/_react.default.createElement("h2", {
|
|
19
|
+
className: "TitleWithText__title"
|
|
20
|
+
}, title), /*#__PURE__*/_react.default.createElement(_WysiwygField.default, {
|
|
21
|
+
className: "TitleWithText__text",
|
|
22
|
+
property: "schema:text",
|
|
23
|
+
customElementHandler: function customElementHandler() {},
|
|
24
|
+
html: text
|
|
25
|
+
}));
|
|
26
|
+
};
|
|
27
|
+
var _default = TitleWithText;
|
|
28
|
+
exports.default = _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _ = _interopRequireDefault(require("."));
|
|
9
|
+
require("./stories.scss");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
12
|
+
var _default = {
|
|
13
|
+
title: 'Molecules/TitleWithText',
|
|
14
|
+
component: _.default
|
|
15
|
+
};
|
|
16
|
+
exports.default = _default;
|
|
17
|
+
var Default = function Default(args) {
|
|
18
|
+
var html = "<p>This is some text in a <code>WysiwygField</code> so you can put whatever you like in here.<br /><br />\n For example, a <ul><li>list</li><li>with</li><li>items</li></ul> perhaps?<br />\n Or a good old <a href='https://www.uncinc.nl' target=\"_blank\">a-tag</a>.</p>";
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement(_.default, _extends({
|
|
20
|
+
title: "This is a title",
|
|
21
|
+
text: html
|
|
22
|
+
}, args));
|
|
23
|
+
};
|
|
24
|
+
exports.Default = Default;
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default WysiwygField;
|
|
2
|
+
declare function WysiwygField({ html, customElementHandler, ...props }: {
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
html: any;
|
|
5
|
+
customElementHandler: any;
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
declare namespace WysiwygField {
|
|
8
|
+
namespace propTypes {
|
|
9
|
+
let html: PropTypes.Validator<string>;
|
|
10
|
+
let customElementHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
}
|
|
12
|
+
namespace defaultProps {
|
|
13
|
+
export function customElementHandler_1(): void;
|
|
14
|
+
export { customElementHandler_1 as customElementHandler };
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
import React from 'react';
|
|
18
|
+
import PropTypes from 'prop-types';
|
package/dist/components/index.js
CHANGED
|
@@ -87,6 +87,12 @@ Object.defineProperty(exports, "FormikWrapper", {
|
|
|
87
87
|
return _FormikWrapper.default;
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
|
+
Object.defineProperty(exports, "MediaPlayer", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function get() {
|
|
93
|
+
return _MediaPlayer.default;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
90
96
|
Object.defineProperty(exports, "WysiwygField", {
|
|
91
97
|
enumerable: true,
|
|
92
98
|
get: function get() {
|
|
@@ -95,6 +101,7 @@ Object.defineProperty(exports, "WysiwygField", {
|
|
|
95
101
|
});
|
|
96
102
|
var _Button = _interopRequireDefault(require("./Button"));
|
|
97
103
|
var _WysiwygField = _interopRequireDefault(require("./WysiwygField"));
|
|
104
|
+
var _MediaPlayer = _interopRequireDefault(require("./MediaPlayer"));
|
|
98
105
|
var _FormikWrapper = _interopRequireDefault(require("./Form/FormikWrapper"));
|
|
99
106
|
var _Checkbox = _interopRequireDefault(require("./Form/Checkbox"));
|
|
100
107
|
var _Checkboxes = _interopRequireDefault(require("./Form/Checkboxes"));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const APP_ENV: string;
|
|
2
|
+
export const __DEBUG__: boolean;
|
|
3
|
+
export const DEFAULT_LANGUAGE: "nl";
|
|
4
|
+
export const SITE_NAME: "Unc Inc";
|
|
5
|
+
export const MAPBOX_API_TOKEN: "pk.eyJ1IjoidW5jaW5jYnYiLCJhIjoiY2pxeHhxd2FlMDMyeTQzbWp1a3hleHRscCJ9.QMfmlryTLEyrSyjU7FfBiw";
|
|
6
|
+
export const IS_SERVER: boolean;
|
|
7
|
+
export const IS_CLIENT: boolean;
|
|
8
|
+
export const SCREEN_MOBILE: 0;
|
|
9
|
+
export const SCREEN_TABLET: 768;
|
|
10
|
+
export const SCREEN_NORMAL: 992;
|
|
11
|
+
export const SCREEN_WIDE: 1240;
|
|
12
|
+
export const SCREEN_HUGE: 2000;
|
|
13
|
+
export const VIEW_ACTION_REPLACE: "replace";
|
|
14
|
+
export const VIEW_ACTION_APPEND: "append";
|
|
15
|
+
export let API_URL: string;
|
|
@@ -22,5 +22,17 @@
|
|
|
22
22
|
"form": {
|
|
23
23
|
"required": "required",
|
|
24
24
|
"optional": "optional"
|
|
25
|
+
},
|
|
26
|
+
"searchkit": {
|
|
27
|
+
"reset_search": "Reconfigure search"
|
|
28
|
+
},
|
|
29
|
+
"organisms": {
|
|
30
|
+
"media_player": {
|
|
31
|
+
"not_supported_message": "The current file cannot be played."
|
|
32
|
+
},
|
|
33
|
+
"text": {
|
|
34
|
+
"read_more": "Read more",
|
|
35
|
+
"read_less": "Read less"
|
|
36
|
+
}
|
|
25
37
|
}
|
|
26
38
|
}
|
|
@@ -25,5 +25,14 @@
|
|
|
25
25
|
},
|
|
26
26
|
"searchkit": {
|
|
27
27
|
"reset_search": "Zoeken opnieuw instellen"
|
|
28
|
+
},
|
|
29
|
+
"organisms": {
|
|
30
|
+
"media_player": {
|
|
31
|
+
"not_supported_message": "Het huidige bestand kan niet worden afgespeeld."
|
|
32
|
+
},
|
|
33
|
+
"text": {
|
|
34
|
+
"read_more": "Lees meer",
|
|
35
|
+
"read_less": "Lees minder"
|
|
36
|
+
}
|
|
28
37
|
}
|
|
29
38
|
}
|
package/dist/custom.d.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export default gtm;
|
|
2
|
+
declare namespace gtm {
|
|
3
|
+
/**
|
|
4
|
+
* gtm.loaded
|
|
5
|
+
*
|
|
6
|
+
* @description
|
|
7
|
+
* Check wether google tag manager has been loaded.
|
|
8
|
+
* @return {bool}
|
|
9
|
+
* A boolean wether the GTM is loaded or not.
|
|
10
|
+
*/
|
|
11
|
+
function loaded(): bool;
|
|
12
|
+
/**
|
|
13
|
+
* gtm.register
|
|
14
|
+
*
|
|
15
|
+
* @description
|
|
16
|
+
* Register a GTM helper function, used internally in the webapp.
|
|
17
|
+
*
|
|
18
|
+
* @param {string} fn
|
|
19
|
+
* The name of the function to register.
|
|
20
|
+
* @param {function} callback
|
|
21
|
+
* The callback of the function being registered.
|
|
22
|
+
* @return {void}
|
|
23
|
+
*/
|
|
24
|
+
function register(fn: string, callback: Function): void;
|
|
25
|
+
/**
|
|
26
|
+
* gtm.push
|
|
27
|
+
*
|
|
28
|
+
* @description
|
|
29
|
+
* A wrapper function to only pusb data into the dataLayer if GTM is loaded.
|
|
30
|
+
* @param {object} data
|
|
31
|
+
* Event data to be sent to GTM.
|
|
32
|
+
* @return {array|bool}
|
|
33
|
+
* An array containing the new dataLayer result or `false`.
|
|
34
|
+
*/
|
|
35
|
+
function push(data: any): any;
|
|
36
|
+
/**
|
|
37
|
+
* gtm.attachEventListeners
|
|
38
|
+
*
|
|
39
|
+
* @description
|
|
40
|
+
* Attach event listeners related to GTM.
|
|
41
|
+
* @return {void}
|
|
42
|
+
*/
|
|
43
|
+
function attachEventListeners(): void;
|
|
44
|
+
}
|