@bigbinary/neeto-molecules 1.0.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.
Files changed (45) hide show
  1. package/README.md +36 -0
  2. package/dist/BrowserSupport.cjs.js +1468 -0
  3. package/dist/BrowserSupport.js +1462 -0
  4. package/dist/Columns.cjs.js +183 -0
  5. package/dist/Columns.js +177 -0
  6. package/dist/CustomDomain.cjs.js +758 -0
  7. package/dist/CustomDomain.js +732 -0
  8. package/dist/DateRangeFilter.cjs.js +214 -0
  9. package/dist/DateRangeFilter.js +207 -0
  10. package/dist/EmailPreview.cjs.js +32409 -0
  11. package/dist/EmailPreview.js +32383 -0
  12. package/dist/ErrorPage.cjs.js +135 -0
  13. package/dist/ErrorPage.js +111 -0
  14. package/dist/IpRestriction.cjs.js +3578 -0
  15. package/dist/IpRestriction.js +3552 -0
  16. package/dist/KeyboardShortcuts.cjs.js +2212 -0
  17. package/dist/KeyboardShortcuts.js +2205 -0
  18. package/dist/LoginPage.cjs.js +598 -0
  19. package/dist/LoginPage.js +573 -0
  20. package/dist/NeetoWidget.cjs.js +86969 -0
  21. package/dist/NeetoWidget.js +86943 -0
  22. package/dist/PublishBlock.cjs.js +188 -0
  23. package/dist/PublishBlock.js +182 -0
  24. package/dist/Schedule.cjs.js +949 -0
  25. package/dist/Schedule.js +918 -0
  26. package/dist/ShareViaLink.cjs.js +1247 -0
  27. package/dist/ShareViaLink.js +1241 -0
  28. package/dist/Sidebar.cjs.js +222 -0
  29. package/dist/Sidebar.js +195 -0
  30. package/package.json +149 -0
  31. package/src/translations/en.json +244 -0
  32. package/types/BrowserSupport.d.ts +20 -0
  33. package/types/Columns.d.ts +22 -0
  34. package/types/CustomDomain.d.ts +7 -0
  35. package/types/DateRangeFilter.d.ts +17 -0
  36. package/types/EmailPreview.d.ts +11 -0
  37. package/types/ErrorPage.d.ts +8 -0
  38. package/types/IpRestriction.d.ts +5 -0
  39. package/types/KeyboardShortcuts.d.ts +21 -0
  40. package/types/LoginPage.d.ts +12 -0
  41. package/types/NeetoWidget.d.ts +17 -0
  42. package/types/PublishBlock.d.ts +20 -0
  43. package/types/Schedule.d.ts +15 -0
  44. package/types/ShareViaLink.d.ts +17 -0
  45. package/types/Sidebar.d.ts +28 -0
@@ -0,0 +1,188 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var neetoIcons = require('@bigbinary/neeto-icons');
5
+ var neetoui = require('@bigbinary/neetoui');
6
+ var reactI18next = require('react-i18next');
7
+
8
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
+
10
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
+
12
+ function _extends() {
13
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
14
+ for (var i = 1; i < arguments.length; i++) {
15
+ var source = arguments[i];
16
+ for (var key in source) {
17
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
18
+ target[key] = source[key];
19
+ }
20
+ }
21
+ }
22
+ return target;
23
+ };
24
+ return _extends.apply(this, arguments);
25
+ }
26
+
27
+ var classnames$1 = {exports: {}};
28
+
29
+ /*!
30
+ Copyright (c) 2018 Jed Watson.
31
+ Licensed under the MIT License (MIT), see
32
+ http://jedwatson.github.io/classnames
33
+ */
34
+
35
+ (function (module) {
36
+ /* global define */
37
+
38
+ (function () {
39
+
40
+ var hasOwn = {}.hasOwnProperty;
41
+
42
+ function classNames() {
43
+ var classes = [];
44
+
45
+ for (var i = 0; i < arguments.length; i++) {
46
+ var arg = arguments[i];
47
+ if (!arg) continue;
48
+
49
+ var argType = typeof arg;
50
+
51
+ if (argType === 'string' || argType === 'number') {
52
+ classes.push(arg);
53
+ } else if (Array.isArray(arg)) {
54
+ if (arg.length) {
55
+ var inner = classNames.apply(null, arg);
56
+ if (inner) {
57
+ classes.push(inner);
58
+ }
59
+ }
60
+ } else if (argType === 'object') {
61
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
62
+ classes.push(arg.toString());
63
+ continue;
64
+ }
65
+
66
+ for (var key in arg) {
67
+ if (hasOwn.call(arg, key) && arg[key]) {
68
+ classes.push(key);
69
+ }
70
+ }
71
+ }
72
+ }
73
+
74
+ return classes.join(' ');
75
+ }
76
+
77
+ if (module.exports) {
78
+ classNames.default = classNames;
79
+ module.exports = classNames;
80
+ } else {
81
+ window.classNames = classNames;
82
+ }
83
+ }());
84
+ } (classnames$1));
85
+
86
+ var classnames = classnames$1.exports;
87
+
88
+ var AlertBlock = function AlertBlock(props) {
89
+ var _useTranslation = reactI18next.useTranslation(),
90
+ t = _useTranslation.t;
91
+ return /*#__PURE__*/React__default["default"].createElement(neetoui.Alert, _extends({
92
+ "data-cy": "reset-alert",
93
+ "data-testid": "reset-alert",
94
+ submitButtonLabel: t("neetoMolecules.common.actions.reset")
95
+ }, props));
96
+ };
97
+
98
+ var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
99
+
100
+ var css = ".neeto-commons-publish-block{align-items:center;display:flex;gap:12px;justify-content:flex-end}.neeto-commons-publish-block__action-btn{align-items:center;display:inline-flex;flex-direction:row;gap:1px;justify-content:center}.neeto-commons-publish-block__action-btn>.neeto-ui-btn:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.neeto-commons-publish-block__action-btn>.neeto-ui-btn:last-child{border-bottom-left-radius:0;border-top-left-radius:0}";
101
+ n(css,{});
102
+
103
+ var ViewDraftButton = function ViewDraftButton(props) {
104
+ var _useTranslation = reactI18next.useTranslation(),
105
+ t = _useTranslation.t;
106
+ return /*#__PURE__*/React__default["default"].createElement(neetoui.Button, _extends({
107
+ "data-cy": "view-draft-button",
108
+ "data-testid": "view-draft-button",
109
+ icon: neetoIcons.ExternalLink,
110
+ style: "secondary",
111
+ target: "_blank",
112
+ tooltipProps: {
113
+ content: t("neetoMolecules.publishBlock.viewDraftVersion"),
114
+ position: "top"
115
+ }
116
+ }, props));
117
+ };
118
+ var ResetDraftButton = function ResetDraftButton(props) {
119
+ var _useTranslation2 = reactI18next.useTranslation(),
120
+ t = _useTranslation2.t;
121
+ return /*#__PURE__*/React__default["default"].createElement(neetoui.Button, _extends({
122
+ "data-cy": "draft-button",
123
+ "data-testid": "draft-button",
124
+ icon: neetoIcons.Undo,
125
+ style: "secondary",
126
+ tooltipProps: {
127
+ content: t("neetoMolecules.publishBlock.deleteDraftVersion"),
128
+ position: "top"
129
+ }
130
+ }, props));
131
+ };
132
+ var PublishButton = function PublishButton(props) {
133
+ var _useTranslation3 = reactI18next.useTranslation(),
134
+ t = _useTranslation3.t;
135
+ return /*#__PURE__*/React__default["default"].createElement(neetoui.Button, _extends({
136
+ "data-cy": "publish-button",
137
+ "data-testid": "publish-button",
138
+ label: t("neetoMolecules.common.actions.publish")
139
+ }, props));
140
+ };
141
+ var PublishPreviewButton = function PublishPreviewButton(props) {
142
+ var _useTranslation4 = reactI18next.useTranslation(),
143
+ t = _useTranslation4.t;
144
+ return /*#__PURE__*/React__default["default"].createElement(neetoui.Button, _extends({
145
+ className: classnames({
146
+ "pointer-events-none": props.disabled
147
+ }),
148
+ "data-cy": "publish-preview-button",
149
+ "data-testid": "publish-preview-button",
150
+ icon: neetoIcons.ExternalLink,
151
+ target: "_blank",
152
+ tooltipProps: {
153
+ content: t("neetoMolecules.publishBlock.viewPublishedVersion"),
154
+ position: "top"
155
+ }
156
+ }, props));
157
+ };
158
+ var PublishBlock = function PublishBlock(_ref) {
159
+ var renderDraftButtons = _ref.renderDraftButtons,
160
+ renderPublishButtons = _ref.renderPublishButtons;
161
+ var _useTranslation5 = reactI18next.useTranslation(),
162
+ t = _useTranslation5.t;
163
+ var draftBlockButtons = renderDraftButtons({
164
+ ViewDraftButton: ViewDraftButton,
165
+ ResetDraftButton: ResetDraftButton
166
+ });
167
+ return /*#__PURE__*/React__default["default"].createElement("div", {
168
+ className: "neeto-commons-publish-block"
169
+ }, draftBlockButtons && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
170
+ className: "flex items-center gap-2"
171
+ }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
172
+ className: "neeto-ui-text-gray-700",
173
+ lineHeight: "normal",
174
+ style: "body2"
175
+ }, t("neetoMolecules.common.actions.draft")), /*#__PURE__*/React__default["default"].createElement("div", {
176
+ className: "space-x-1"
177
+ }, draftBlockButtons)), /*#__PURE__*/React__default["default"].createElement("div", {
178
+ className: "neeto-ui-bg-gray-300 h-full w-px"
179
+ })), /*#__PURE__*/React__default["default"].createElement("div", {
180
+ className: "neeto-commons-publish-block__action-btn"
181
+ }, renderPublishButtons({
182
+ PublishButton: PublishButton,
183
+ PublishPreviewButton: PublishPreviewButton
184
+ })));
185
+ };
186
+ PublishBlock.Alert = AlertBlock;
187
+
188
+ module.exports = PublishBlock;
@@ -0,0 +1,182 @@
1
+ import React from 'react';
2
+ import { ExternalLink, Undo } from '@bigbinary/neeto-icons';
3
+ import { Alert, Typography, Button } from '@bigbinary/neetoui';
4
+ import { useTranslation } from 'react-i18next';
5
+
6
+ function _extends() {
7
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
8
+ for (var i = 1; i < arguments.length; i++) {
9
+ var source = arguments[i];
10
+ for (var key in source) {
11
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
12
+ target[key] = source[key];
13
+ }
14
+ }
15
+ }
16
+ return target;
17
+ };
18
+ return _extends.apply(this, arguments);
19
+ }
20
+
21
+ var classnames$1 = {exports: {}};
22
+
23
+ /*!
24
+ Copyright (c) 2018 Jed Watson.
25
+ Licensed under the MIT License (MIT), see
26
+ http://jedwatson.github.io/classnames
27
+ */
28
+
29
+ (function (module) {
30
+ /* global define */
31
+
32
+ (function () {
33
+
34
+ var hasOwn = {}.hasOwnProperty;
35
+
36
+ function classNames() {
37
+ var classes = [];
38
+
39
+ for (var i = 0; i < arguments.length; i++) {
40
+ var arg = arguments[i];
41
+ if (!arg) continue;
42
+
43
+ var argType = typeof arg;
44
+
45
+ if (argType === 'string' || argType === 'number') {
46
+ classes.push(arg);
47
+ } else if (Array.isArray(arg)) {
48
+ if (arg.length) {
49
+ var inner = classNames.apply(null, arg);
50
+ if (inner) {
51
+ classes.push(inner);
52
+ }
53
+ }
54
+ } else if (argType === 'object') {
55
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
56
+ classes.push(arg.toString());
57
+ continue;
58
+ }
59
+
60
+ for (var key in arg) {
61
+ if (hasOwn.call(arg, key) && arg[key]) {
62
+ classes.push(key);
63
+ }
64
+ }
65
+ }
66
+ }
67
+
68
+ return classes.join(' ');
69
+ }
70
+
71
+ if (module.exports) {
72
+ classNames.default = classNames;
73
+ module.exports = classNames;
74
+ } else {
75
+ window.classNames = classNames;
76
+ }
77
+ }());
78
+ } (classnames$1));
79
+
80
+ var classnames = classnames$1.exports;
81
+
82
+ var AlertBlock = function AlertBlock(props) {
83
+ var _useTranslation = useTranslation(),
84
+ t = _useTranslation.t;
85
+ return /*#__PURE__*/React.createElement(Alert, _extends({
86
+ "data-cy": "reset-alert",
87
+ "data-testid": "reset-alert",
88
+ submitButtonLabel: t("neetoMolecules.common.actions.reset")
89
+ }, props));
90
+ };
91
+
92
+ var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
93
+
94
+ var css = ".neeto-commons-publish-block{align-items:center;display:flex;gap:12px;justify-content:flex-end}.neeto-commons-publish-block__action-btn{align-items:center;display:inline-flex;flex-direction:row;gap:1px;justify-content:center}.neeto-commons-publish-block__action-btn>.neeto-ui-btn:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.neeto-commons-publish-block__action-btn>.neeto-ui-btn:last-child{border-bottom-left-radius:0;border-top-left-radius:0}";
95
+ n(css,{});
96
+
97
+ var ViewDraftButton = function ViewDraftButton(props) {
98
+ var _useTranslation = useTranslation(),
99
+ t = _useTranslation.t;
100
+ return /*#__PURE__*/React.createElement(Button, _extends({
101
+ "data-cy": "view-draft-button",
102
+ "data-testid": "view-draft-button",
103
+ icon: ExternalLink,
104
+ style: "secondary",
105
+ target: "_blank",
106
+ tooltipProps: {
107
+ content: t("neetoMolecules.publishBlock.viewDraftVersion"),
108
+ position: "top"
109
+ }
110
+ }, props));
111
+ };
112
+ var ResetDraftButton = function ResetDraftButton(props) {
113
+ var _useTranslation2 = useTranslation(),
114
+ t = _useTranslation2.t;
115
+ return /*#__PURE__*/React.createElement(Button, _extends({
116
+ "data-cy": "draft-button",
117
+ "data-testid": "draft-button",
118
+ icon: Undo,
119
+ style: "secondary",
120
+ tooltipProps: {
121
+ content: t("neetoMolecules.publishBlock.deleteDraftVersion"),
122
+ position: "top"
123
+ }
124
+ }, props));
125
+ };
126
+ var PublishButton = function PublishButton(props) {
127
+ var _useTranslation3 = useTranslation(),
128
+ t = _useTranslation3.t;
129
+ return /*#__PURE__*/React.createElement(Button, _extends({
130
+ "data-cy": "publish-button",
131
+ "data-testid": "publish-button",
132
+ label: t("neetoMolecules.common.actions.publish")
133
+ }, props));
134
+ };
135
+ var PublishPreviewButton = function PublishPreviewButton(props) {
136
+ var _useTranslation4 = useTranslation(),
137
+ t = _useTranslation4.t;
138
+ return /*#__PURE__*/React.createElement(Button, _extends({
139
+ className: classnames({
140
+ "pointer-events-none": props.disabled
141
+ }),
142
+ "data-cy": "publish-preview-button",
143
+ "data-testid": "publish-preview-button",
144
+ icon: ExternalLink,
145
+ target: "_blank",
146
+ tooltipProps: {
147
+ content: t("neetoMolecules.publishBlock.viewPublishedVersion"),
148
+ position: "top"
149
+ }
150
+ }, props));
151
+ };
152
+ var PublishBlock = function PublishBlock(_ref) {
153
+ var renderDraftButtons = _ref.renderDraftButtons,
154
+ renderPublishButtons = _ref.renderPublishButtons;
155
+ var _useTranslation5 = useTranslation(),
156
+ t = _useTranslation5.t;
157
+ var draftBlockButtons = renderDraftButtons({
158
+ ViewDraftButton: ViewDraftButton,
159
+ ResetDraftButton: ResetDraftButton
160
+ });
161
+ return /*#__PURE__*/React.createElement("div", {
162
+ className: "neeto-commons-publish-block"
163
+ }, draftBlockButtons && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
164
+ className: "flex items-center gap-2"
165
+ }, /*#__PURE__*/React.createElement(Typography, {
166
+ className: "neeto-ui-text-gray-700",
167
+ lineHeight: "normal",
168
+ style: "body2"
169
+ }, t("neetoMolecules.common.actions.draft")), /*#__PURE__*/React.createElement("div", {
170
+ className: "space-x-1"
171
+ }, draftBlockButtons)), /*#__PURE__*/React.createElement("div", {
172
+ className: "neeto-ui-bg-gray-300 h-full w-px"
173
+ })), /*#__PURE__*/React.createElement("div", {
174
+ className: "neeto-commons-publish-block__action-btn"
175
+ }, renderPublishButtons({
176
+ PublishButton: PublishButton,
177
+ PublishPreviewButton: PublishPreviewButton
178
+ })));
179
+ };
180
+ PublishBlock.Alert = AlertBlock;
181
+
182
+ export { PublishBlock as default };