@bigbinary/neeto-molecules 1.3.9 → 1.3.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.
Files changed (119) hide show
  1. package/dist/NavigationHeader.js +6 -6
  2. package/dist/NavigationHeader.js.map +1 -1
  3. package/dist/PublishBlock.js +1 -1
  4. package/dist/PublishBlock.js.map +1 -1
  5. package/dist/cjs/Breadcrumbs.js +51 -0
  6. package/dist/cjs/Breadcrumbs.js.map +1 -0
  7. package/dist/cjs/BrowserSupport.js +426 -0
  8. package/dist/cjs/BrowserSupport.js.map +1 -0
  9. package/dist/cjs/Builder.js +712 -0
  10. package/dist/cjs/Builder.js.map +1 -0
  11. package/dist/cjs/CalendarView.js +549 -0
  12. package/dist/cjs/CalendarView.js.map +1 -0
  13. package/dist/cjs/Codeblock.js +251 -0
  14. package/dist/cjs/Codeblock.js.map +1 -0
  15. package/dist/cjs/Columns.js +248 -0
  16. package/dist/cjs/Columns.js.map +1 -0
  17. package/dist/cjs/ConfirmationModal.js +120 -0
  18. package/dist/cjs/ConfirmationModal.js.map +1 -0
  19. package/dist/cjs/Container.js +1218 -0
  20. package/dist/cjs/Container.js.map +1 -0
  21. package/dist/cjs/CopyToClipboardButton.js +215 -0
  22. package/dist/cjs/CopyToClipboardButton.js.map +1 -0
  23. package/dist/cjs/CustomDomain.js +743 -0
  24. package/dist/cjs/CustomDomain.js.map +1 -0
  25. package/dist/cjs/CustomDomainDashboard.js +2348 -0
  26. package/dist/cjs/CustomDomainDashboard.js.map +1 -0
  27. package/dist/cjs/DateFormat.js +53 -0
  28. package/dist/cjs/DateFormat.js.map +1 -0
  29. package/dist/cjs/DateRangeFilter.js +236 -0
  30. package/dist/cjs/DateRangeFilter.js.map +1 -0
  31. package/dist/cjs/DocumentEditor.js +283 -0
  32. package/dist/cjs/DocumentEditor.js.map +1 -0
  33. package/dist/cjs/DownloadMobileAppCallout.js +45 -0
  34. package/dist/cjs/DownloadMobileAppCallout.js.map +1 -0
  35. package/dist/cjs/DynamicVariables.js +189 -0
  36. package/dist/cjs/DynamicVariables.js.map +1 -0
  37. package/dist/cjs/EmailForm.js +2057 -0
  38. package/dist/cjs/EmailForm.js.map +1 -0
  39. package/dist/cjs/EmailPreview.js +1319 -0
  40. package/dist/cjs/EmailPreview.js.map +1 -0
  41. package/dist/cjs/ErrorPage.js +188 -0
  42. package/dist/cjs/ErrorPage.js.map +1 -0
  43. package/dist/cjs/Header.js +179 -0
  44. package/dist/cjs/Header.js.map +1 -0
  45. package/dist/cjs/IconPicker.js +324 -0
  46. package/dist/cjs/IconPicker.js.map +1 -0
  47. package/dist/cjs/ImageWithFallback.js +188 -0
  48. package/dist/cjs/ImageWithFallback.js.map +1 -0
  49. package/dist/cjs/InlineInput.js +734 -0
  50. package/dist/cjs/InlineInput.js.map +1 -0
  51. package/dist/cjs/IntegrationCard.js +400 -0
  52. package/dist/cjs/IntegrationCard.js.map +1 -0
  53. package/dist/cjs/IntegrationDisconnectAlert.js +89 -0
  54. package/dist/cjs/IntegrationDisconnectAlert.js.map +1 -0
  55. package/dist/cjs/IntegrationWalkthroughModal.js +50 -0
  56. package/dist/cjs/IntegrationWalkthroughModal.js.map +1 -0
  57. package/dist/cjs/IpRestriction.js +683 -0
  58. package/dist/cjs/IpRestriction.js.map +1 -0
  59. package/dist/cjs/KeyboardShortcuts.js +370 -0
  60. package/dist/cjs/KeyboardShortcuts.js.map +1 -0
  61. package/dist/cjs/LoginPage.js +620 -0
  62. package/dist/cjs/LoginPage.js.map +1 -0
  63. package/dist/cjs/MenuBar.js +1468 -0
  64. package/dist/cjs/MenuBar.js.map +1 -0
  65. package/dist/cjs/Metadata.js +215 -0
  66. package/dist/cjs/Metadata.js.map +1 -0
  67. package/dist/cjs/MoreDropdown.js +210 -0
  68. package/dist/cjs/MoreDropdown.js.map +1 -0
  69. package/dist/cjs/NavigationHeader.js +867 -0
  70. package/dist/cjs/NavigationHeader.js.map +1 -0
  71. package/dist/cjs/NeetoWidget.js +1078 -0
  72. package/dist/cjs/NeetoWidget.js.map +1 -0
  73. package/dist/cjs/PageLoader.js +159 -0
  74. package/dist/cjs/PageLoader.js.map +1 -0
  75. package/dist/cjs/PhoneNumber.js +492 -0
  76. package/dist/cjs/PhoneNumber.js.map +1 -0
  77. package/dist/cjs/PublishBlock.js +165 -0
  78. package/dist/cjs/PublishBlock.js.map +1 -0
  79. package/dist/cjs/PublishYourItem.js +1239 -0
  80. package/dist/cjs/PublishYourItem.js.map +1 -0
  81. package/dist/cjs/Rename.js +625 -0
  82. package/dist/cjs/Rename.js.map +1 -0
  83. package/dist/cjs/ResponsiveDevicePicker.js +200 -0
  84. package/dist/cjs/ResponsiveDevicePicker.js.map +1 -0
  85. package/dist/cjs/Schedule.js +1130 -0
  86. package/dist/cjs/Schedule.js.map +1 -0
  87. package/dist/cjs/Scrollable.js +129 -0
  88. package/dist/cjs/Scrollable.js.map +1 -0
  89. package/dist/cjs/Search.js +217 -0
  90. package/dist/cjs/Search.js.map +1 -0
  91. package/dist/cjs/Security.js +1930 -0
  92. package/dist/cjs/Security.js.map +1 -0
  93. package/dist/cjs/SendToFields.js +353 -0
  94. package/dist/cjs/SendToFields.js.map +1 -0
  95. package/dist/cjs/Settings.js +492 -0
  96. package/dist/cjs/Settings.js.map +1 -0
  97. package/dist/cjs/ShareViaEmail.js +2005 -0
  98. package/dist/cjs/ShareViaEmail.js.map +1 -0
  99. package/dist/cjs/ShareViaLink.js +729 -0
  100. package/dist/cjs/ShareViaLink.js.map +1 -0
  101. package/dist/cjs/Sidebar.js +930 -0
  102. package/dist/cjs/Sidebar.js.map +1 -0
  103. package/dist/cjs/SubHeader.js +224 -0
  104. package/dist/cjs/SubHeader.js.map +1 -0
  105. package/dist/cjs/SuffixedInput.js +216 -0
  106. package/dist/cjs/SuffixedInput.js.map +1 -0
  107. package/dist/cjs/TableWrapper.js +33 -0
  108. package/dist/cjs/TableWrapper.js.map +1 -0
  109. package/dist/cjs/Taxonomy.js +2125 -0
  110. package/dist/cjs/Taxonomy.js.map +1 -0
  111. package/dist/cjs/ThemeSidebar.js +2052 -0
  112. package/dist/cjs/ThemeSidebar.js.map +1 -0
  113. package/dist/cjs/TimeFormat.js +55 -0
  114. package/dist/cjs/TimeFormat.js.map +1 -0
  115. package/dist/cjs/TimezoneMismatchModal.js +176 -0
  116. package/dist/cjs/TimezoneMismatchModal.js.map +1 -0
  117. package/dist/cjs/ToggleFeatureCard.js +330 -0
  118. package/dist/cjs/ToggleFeatureCard.js.map +1 -0
  119. package/package.json +2 -1
@@ -0,0 +1,236 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var dayjs = require('dayjs');
5
+ var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
6
+ var neetoui = require('@bigbinary/neetoui');
7
+ var ramda = require('ramda');
8
+ var reactI18next = require('react-i18next');
9
+ var i18next = require('i18next');
10
+
11
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
+
13
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
14
+ var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
15
+
16
+ function _arrayWithHoles(arr) {
17
+ if (Array.isArray(arr)) return arr;
18
+ }
19
+
20
+ function _iterableToArrayLimit(r, l) {
21
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
22
+ if (null != t) {
23
+ var e,
24
+ n,
25
+ i,
26
+ u,
27
+ a = [],
28
+ f = !0,
29
+ o = !1;
30
+ try {
31
+ if (i = (t = t.call(r)).next, 0 === l) {
32
+ if (Object(t) !== t) return;
33
+ f = !1;
34
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
35
+ } catch (r) {
36
+ o = !0, n = r;
37
+ } finally {
38
+ try {
39
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
40
+ } finally {
41
+ if (o) throw n;
42
+ }
43
+ }
44
+ return a;
45
+ }
46
+ }
47
+
48
+ function _arrayLikeToArray(arr, len) {
49
+ if (len == null || len > arr.length) len = arr.length;
50
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
51
+ return arr2;
52
+ }
53
+
54
+ function _unsupportedIterableToArray(o, minLen) {
55
+ if (!o) return;
56
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
57
+ var n = Object.prototype.toString.call(o).slice(8, -1);
58
+ if (n === "Object" && o.constructor) n = o.constructor.name;
59
+ if (n === "Map" || n === "Set") return Array.from(o);
60
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
61
+ }
62
+
63
+ function _nonIterableRest() {
64
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
65
+ }
66
+
67
+ function _slicedToArray(arr, i) {
68
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
69
+ }
70
+
71
+ var quarterOfYear = require("dayjs/plugin/quarterOfYear");
72
+ dayjs__default["default"].extend(quarterOfYear);
73
+ var defaultTimePeriodOptions = function defaultTimePeriodOptions() {
74
+ var today = dayjs__default["default"]().startOf("day");
75
+ var startOfLastWeek = today.subtract(7, "day").startOf("week");
76
+ var endOfLastWeek = today.subtract(7, "day").endOf("week");
77
+ var lastMonthStart = today.subtract(1, "month").startOf("month");
78
+ var lastMonthEnd = today.subtract(1, "month").endOf("month");
79
+ var thisQuarterStart = dayjs__default["default"]().startOf("quarter");
80
+ var thisQuarterEnd = dayjs__default["default"]().endOf("quarter");
81
+ var lastQuarterStart = dayjs__default["default"]().subtract(1, "quarter").startOf("quarter");
82
+ var lastQuarterEnd = dayjs__default["default"]().subtract(1, "quarter").endOf("quarter");
83
+ var startOfLastYear = dayjs__default["default"]().subtract(1, "year").startOf("year");
84
+ var endOfLastYear = dayjs__default["default"]().subtract(1, "year").endOf("year");
85
+ var startOfYear = dayjs__default["default"]().startOf("year");
86
+ var endOfYear = dayjs__default["default"]().endOf("year");
87
+ var startOf24Hours = dayjs__default["default"]().subtract(24, "hour");
88
+ var now = dayjs__default["default"]();
89
+ var startOfLast7Days = dayjs__default["default"]().subtract(7, "day");
90
+ var startOfWeek = dayjs__default["default"]().startOf("week");
91
+ var startOfLast30Days = dayjs__default["default"]().subtract(30, "day");
92
+ var startOfMonth = today.startOf("month");
93
+ return [{
94
+ label: i18next.t("neetoMolecules.dateRangeFilter.timePeriodOptions.allTime"),
95
+ value: {
96
+ startDate: null,
97
+ endDate: null,
98
+ rangeType: "all"
99
+ }
100
+ }, {
101
+ label: i18next.t("neetoMolecules.dateRangeFilter.timePeriodOptions.last24Hours"),
102
+ value: {
103
+ startDate: startOf24Hours,
104
+ endDate: now,
105
+ rangeType: "hours"
106
+ }
107
+ }, {
108
+ label: i18next.t("neetoMolecules.dateRangeFilter.timePeriodOptions.last7Days"),
109
+ value: {
110
+ startDate: startOfLast7Days,
111
+ endDate: now,
112
+ rangeType: "days"
113
+ }
114
+ }, {
115
+ label: i18next.t("neetoMolecules.dateRangeFilter.timePeriodOptions.thisWeek"),
116
+ value: {
117
+ startDate: startOfWeek,
118
+ endDate: now,
119
+ rangeType: "week"
120
+ }
121
+ }, {
122
+ label: i18next.t("neetoMolecules.dateRangeFilter.timePeriodOptions.lastWeek"),
123
+ value: {
124
+ startDate: startOfLastWeek,
125
+ endDate: endOfLastWeek,
126
+ rangeType: "week"
127
+ }
128
+ }, {
129
+ label: i18next.t("neetoMolecules.dateRangeFilter.timePeriodOptions.last30Days"),
130
+ value: {
131
+ startDate: startOfLast30Days,
132
+ endDate: now,
133
+ rangeType: "days"
134
+ }
135
+ }, {
136
+ label: i18next.t("neetoMolecules.dateRangeFilter.timePeriodOptions.thisMonth"),
137
+ value: {
138
+ startDate: startOfMonth,
139
+ endDate: now,
140
+ rangeType: "month"
141
+ }
142
+ }, {
143
+ label: i18next.t("neetoMolecules.dateRangeFilter.timePeriodOptions.lastMonth"),
144
+ value: {
145
+ startDate: lastMonthStart,
146
+ endDate: lastMonthEnd,
147
+ rangeType: "month"
148
+ }
149
+ }, {
150
+ label: i18next.t("neetoMolecules.dateRangeFilter.timePeriodOptions.thisQuarter"),
151
+ value: {
152
+ startDate: thisQuarterStart,
153
+ endDate: thisQuarterEnd,
154
+ rangeType: "quarter"
155
+ }
156
+ }, {
157
+ label: i18next.t("neetoMolecules.dateRangeFilter.timePeriodOptions.lastQuarter"),
158
+ value: {
159
+ startDate: lastQuarterStart,
160
+ endDate: lastQuarterEnd,
161
+ rangeType: "quarter"
162
+ }
163
+ }, {
164
+ label: i18next.t("neetoMolecules.dateRangeFilter.timePeriodOptions.thisYear"),
165
+ value: {
166
+ startDate: startOfYear,
167
+ endDate: endOfYear,
168
+ rangeType: "year"
169
+ }
170
+ }, {
171
+ label: i18next.t("neetoMolecules.dateRangeFilter.timePeriodOptions.lastYear"),
172
+ value: {
173
+ startDate: startOfLastYear,
174
+ endDate: endOfLastYear,
175
+ rangeType: "year"
176
+ }
177
+ }, {
178
+ label: i18next.t("neetoMolecules.dateRangeFilter.timePeriodOptions.customDuration"),
179
+ value: "custom"
180
+ }];
181
+ };
182
+
183
+ var DateRangeFilter = function DateRangeFilter(_ref) {
184
+ var _timePeriod$value, _timePeriod$value2, _globalProps$user;
185
+ var timePeriodOptions = _ref.timePeriodOptions,
186
+ timePeriod = _ref.timePeriod,
187
+ setTimePeriod = _ref.setTimePeriod;
188
+ var _useTranslation = reactI18next.useTranslation(),
189
+ t = _useTranslation.t;
190
+ var customDurationLabel = t("neetoMolecules.dateRangeFilter.timePeriodOptions.customDuration");
191
+ var isCustom = timePeriod.label === customDurationLabel;
192
+ var startDate = (_timePeriod$value = timePeriod.value) === null || _timePeriod$value === void 0 ? void 0 : _timePeriod$value.startDate;
193
+ var endDate = (_timePeriod$value2 = timePeriod.value) === null || _timePeriod$value2 === void 0 ? void 0 : _timePeriod$value2.endDate;
194
+ var requiredDateFormat = initializers.globalProps === null || initializers.globalProps === void 0 ? void 0 : (_globalProps$user = initializers.globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.dateFormat;
195
+ return /*#__PURE__*/React__default["default"].createElement("div", {
196
+ className: "flex flex-wrap gap-3",
197
+ "data-testid": "date-range-filter"
198
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
199
+ className: "w-40"
200
+ }, /*#__PURE__*/React__default["default"].createElement(neetoui.Select, {
201
+ required: true,
202
+ getOptionValue: ramda.prop("label"),
203
+ options: timePeriodOptions || defaultTimePeriodOptions(),
204
+ strategy: "fixed",
205
+ value: timePeriod,
206
+ onChange: function onChange(option) {
207
+ return setTimePeriod(option);
208
+ }
209
+ })), isCustom && /*#__PURE__*/React__default["default"].createElement("div", {
210
+ className: "max-w-sm flex-grow",
211
+ "data-testid": "date-range-filter-custom-duration-picker"
212
+ }, /*#__PURE__*/React__default["default"].createElement(neetoui.DatePicker, {
213
+ autoFocus: true,
214
+ className: "w-full",
215
+ dateFormat: requiredDateFormat,
216
+ picker: "date",
217
+ type: "range",
218
+ defaultValue: [startDate ? dayjs__default["default"](startDate) : null, endDate ? dayjs__default["default"](endDate) : null],
219
+ onChange: function onChange(_ref2) {
220
+ var _ref3 = _slicedToArray(_ref2, 2),
221
+ startDate = _ref3[0],
222
+ endDate = _ref3[1];
223
+ setTimePeriod({
224
+ label: customDurationLabel,
225
+ value: {
226
+ startDate: startDate,
227
+ endDate: endDate,
228
+ rangeType: "custom"
229
+ }
230
+ });
231
+ }
232
+ })));
233
+ };
234
+
235
+ module.exports = DateRangeFilter;
236
+ //# sourceMappingURL=DateRangeFilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateRangeFilter.js","sources":["../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../../src/components/DateRangeFilter/utils.js","../../src/components/DateRangeFilter/index.jsx"],"sourcesContent":["export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","import dayjs from \"dayjs\";\nimport { t } from \"i18next\";\n\nconst quarterOfYear = require(\"dayjs/plugin/quarterOfYear\");\n\ndayjs.extend(quarterOfYear);\n\nexport const defaultTimePeriodOptions = () => {\n const today = dayjs().startOf(\"day\");\n const startOfLastWeek = today.subtract(7, \"day\").startOf(\"week\");\n\n const endOfLastWeek = today.subtract(7, \"day\").endOf(\"week\");\n const lastMonthStart = today.subtract(1, \"month\").startOf(\"month\");\n const lastMonthEnd = today.subtract(1, \"month\").endOf(\"month\");\n const thisQuarterStart = dayjs().startOf(\"quarter\");\n const thisQuarterEnd = dayjs().endOf(\"quarter\");\n const lastQuarterStart = dayjs().subtract(1, \"quarter\").startOf(\"quarter\");\n const lastQuarterEnd = dayjs().subtract(1, \"quarter\").endOf(\"quarter\");\n const startOfLastYear = dayjs().subtract(1, \"year\").startOf(\"year\");\n const endOfLastYear = dayjs().subtract(1, \"year\").endOf(\"year\");\n const startOfYear = dayjs().startOf(\"year\");\n const endOfYear = dayjs().endOf(\"year\");\n\n const startOf24Hours = dayjs().subtract(24, \"hour\");\n const now = dayjs();\n const startOfLast7Days = dayjs().subtract(7, \"day\");\n const startOfWeek = dayjs().startOf(\"week\");\n const startOfLast30Days = dayjs().subtract(30, \"day\");\n const startOfMonth = today.startOf(\"month\");\n\n return [\n {\n label: t(\"neetoMolecules.dateRangeFilter.timePeriodOptions.allTime\"),\n value: { startDate: null, endDate: null, rangeType: \"all\" },\n },\n {\n label: t(\"neetoMolecules.dateRangeFilter.timePeriodOptions.last24Hours\"),\n value: { startDate: startOf24Hours, endDate: now, rangeType: \"hours\" },\n },\n {\n label: t(\"neetoMolecules.dateRangeFilter.timePeriodOptions.last7Days\"),\n value: {\n startDate: startOfLast7Days,\n endDate: now,\n rangeType: \"days\",\n },\n },\n {\n label: t(\"neetoMolecules.dateRangeFilter.timePeriodOptions.thisWeek\"),\n value: { startDate: startOfWeek, endDate: now, rangeType: \"week\" },\n },\n {\n label: t(\"neetoMolecules.dateRangeFilter.timePeriodOptions.lastWeek\"),\n value: {\n startDate: startOfLastWeek,\n endDate: endOfLastWeek,\n rangeType: \"week\",\n },\n },\n {\n label: t(\"neetoMolecules.dateRangeFilter.timePeriodOptions.last30Days\"),\n value: {\n startDate: startOfLast30Days,\n endDate: now,\n rangeType: \"days\",\n },\n },\n {\n label: t(\"neetoMolecules.dateRangeFilter.timePeriodOptions.thisMonth\"),\n value: { startDate: startOfMonth, endDate: now, rangeType: \"month\" },\n },\n {\n label: t(\"neetoMolecules.dateRangeFilter.timePeriodOptions.lastMonth\"),\n value: {\n startDate: lastMonthStart,\n endDate: lastMonthEnd,\n rangeType: \"month\",\n },\n },\n {\n label: t(\"neetoMolecules.dateRangeFilter.timePeriodOptions.thisQuarter\"),\n value: {\n startDate: thisQuarterStart,\n endDate: thisQuarterEnd,\n rangeType: \"quarter\",\n },\n },\n {\n label: t(\"neetoMolecules.dateRangeFilter.timePeriodOptions.lastQuarter\"),\n value: {\n startDate: lastQuarterStart,\n endDate: lastQuarterEnd,\n rangeType: \"quarter\",\n },\n },\n {\n label: t(\"neetoMolecules.dateRangeFilter.timePeriodOptions.thisYear\"),\n value: { startDate: startOfYear, endDate: endOfYear, rangeType: \"year\" },\n },\n {\n label: t(\"neetoMolecules.dateRangeFilter.timePeriodOptions.lastYear\"),\n value: {\n startDate: startOfLastYear,\n endDate: endOfLastYear,\n rangeType: \"year\",\n },\n },\n {\n label: t(\n \"neetoMolecules.dateRangeFilter.timePeriodOptions.customDuration\"\n ),\n value: \"custom\",\n },\n ];\n};\n","import React from \"react\";\n\nimport dayjs from \"dayjs\";\nimport { globalProps } from \"neetocommons/initializers\";\nimport { Select, DatePicker } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { prop } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { defaultTimePeriodOptions } from \"./utils\";\n\nconst DateRangeFilter = ({ timePeriodOptions, timePeriod, setTimePeriod }) => {\n const { t } = useTranslation();\n\n const customDurationLabel = t(\n \"neetoMolecules.dateRangeFilter.timePeriodOptions.customDuration\"\n );\n const isCustom = timePeriod.label === customDurationLabel;\n const startDate = timePeriod.value?.startDate;\n const endDate = timePeriod.value?.endDate;\n const requiredDateFormat = globalProps?.user?.dateFormat;\n\n return (\n <div className=\"flex flex-wrap gap-3\" data-testid=\"date-range-filter\">\n <div className=\"w-40\">\n <Select\n required\n getOptionValue={prop(\"label\")}\n options={timePeriodOptions || defaultTimePeriodOptions()}\n strategy=\"fixed\"\n value={timePeriod}\n onChange={option => setTimePeriod(option)}\n />\n </div>\n {isCustom && (\n <div\n className=\"max-w-sm flex-grow\"\n data-testid=\"date-range-filter-custom-duration-picker\"\n >\n <DatePicker\n autoFocus\n className=\"w-full\"\n dateFormat={requiredDateFormat}\n picker=\"date\"\n type=\"range\"\n defaultValue={[\n startDate ? dayjs(startDate) : null,\n endDate ? dayjs(endDate) : null,\n ]}\n onChange={([startDate, endDate]) => {\n setTimePeriod({\n label: customDurationLabel,\n value: { startDate, endDate, rangeType: \"custom\" },\n });\n }}\n />\n </div>\n )}\n </div>\n );\n};\n\nDateRangeFilter.propTypes = {\n /**\n * An array of objects that can be passed to the component which can be used to override default filter options.\n */\n timePeriodOptions: PropTypes.arrayOf(\n PropTypes.shape({ label: PropTypes.string, value: PropTypes.object })\n ),\n /**\n * The state corresponding to the currently selected date range filter.\n */\n timePeriod: PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.object,\n }),\n /**\n * The setter method for `timePeriod` state.\n */\n setTimePeriod: PropTypes.func,\n};\n\nexport default DateRangeFilter;\n"],"names":["arrayLikeToArray","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","quarterOfYear","require","dayjs","extend","defaultTimePeriodOptions","today","startOf","startOfLastWeek","subtract","endOfLastWeek","endOf","lastMonthStart","lastMonthEnd","thisQuarterStart","thisQuarterEnd","lastQuarterStart","lastQuarterEnd","startOfLastYear","endOfLastYear","startOfYear","endOfYear","startOf24Hours","now","startOfLast7Days","startOfWeek","startOfLast30Days","startOfMonth","label","t","value","startDate","endDate","rangeType","DateRangeFilter","_ref","_timePeriod$value","_timePeriod$value2","_globalProps$user","timePeriodOptions","timePeriod","setTimePeriod","_useTranslation","useTranslation","customDurationLabel","isCustom","requiredDateFormat","globalProps","user","dateFormat","React","createElement","className","Select","required","getOptionValue","prop","options","strategy","onChange","option","DatePicker","autoFocus","picker","type","defaultValue","_ref2","_ref3","_slicedToArray"],"mappings":";;;;;;;;;;;;;;;AAAe,SAAS,eAAe,CAAC,GAAG,EAAE;AAC7C,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC;AACrC;;ACFe,SAAS,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE;AACpD,EAAE,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,IAAI,GAAG,WAAW,IAAI,OAAO,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC;AACnG,EAAE,IAAI,IAAI,IAAI,CAAC,EAAE;AACjB,IAAI,IAAI,CAAC;AACT,MAAM,CAAC;AACP,MAAM,CAAC;AACP,MAAM,CAAC;AACP,MAAM,CAAC,GAAG,EAAE;AACZ,MAAM,CAAC,GAAG,CAAC,CAAC;AACZ,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACb,IAAI,IAAI;AACR,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE;AAC7C,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO;AACpC,QAAQ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AAA,eAEtDF,yBAAA,CAAAC,aAAA,CAACU,kBAAU,EAAA;IACTC,SAAS,EAAA,IAAA;AACTV,IAAAA,SAAS,EAAC,QAAQ;AAClBH,IAAAA,UAAU,EAAEH,kBAAmB;AAC/BiB,IAAAA,MAAM,EAAC,MAAM;AACbC,IAAAA,IAAI,EAAC,OAAO;AACZC,IAAAA,YAAY,EAAE,CACZlC,SAAS,GAAG5B,yBAAK,CAAC4B,SAAS,CAAC,GAAG,IAAI,EACnCC,OAAO,GAAG7B,yBAAK,CAAC6B,OAAO,CAAC,GAAG,IAAI,CAC/B;AACF2B,IAAAA,QAAQ,EAAE,SAAAA,QAAAO,CAAAA,KAAA,EAA0B;AAAA,MAAA,IAAAC,KAAA,GAAAC,cAAA,CAAAF,KAAA,EAAA,CAAA,CAAA;AAAxBnC,QAAAA,SAAS,GAAAoC,KAAA,CAAA,CAAA,CAAA;AAAEnC,QAAAA,OAAO,GAAAmC,KAAA,CAAA,CAAA,CAAA,CAAA;AAC5B1B,MAAAA,aAAa,CAAC;AACZb,QAAAA,KAAK,EAAEgB,mBAAmB;AAC1Bd,QAAAA,KAAK,EAAE;AAAEC,UAAAA,SAAS,EAATA,SAAS;AAAEC,UAAAA,OAAO,EAAPA,OAAO;AAAEC,UAAAA,SAAS,EAAE,QAAA;AAAS,SAAA;AACnD,OAAC,CAAC,CAAA;AACJ,KAAA;GACD,CACE,CAEJ,CAAC,CAAA;AAEV;;;;"}
@@ -0,0 +1,283 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var classNames = require('classnames');
5
+ var neetoCist = require('@bigbinary/neeto-cist');
6
+ var neetoEditor = require('@bigbinary/neeto-editor');
7
+ var neetoui = require('@bigbinary/neetoui');
8
+ var formik$1 = require('@bigbinary/neetoui/formik');
9
+ var reactI18next = require('react-i18next');
10
+ var formik = require('formik');
11
+ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
12
+
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
+
15
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
+ var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
17
+
18
+ function _extends() {
19
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
20
+ for (var i = 1; i < arguments.length; i++) {
21
+ var source = arguments[i];
22
+ for (var key in source) {
23
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
24
+ target[key] = source[key];
25
+ }
26
+ }
27
+ }
28
+ return target;
29
+ };
30
+ return _extends.apply(this, arguments);
31
+ }
32
+
33
+ function _typeof(o) {
34
+ "@babel/helpers - typeof";
35
+
36
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
37
+ return typeof o;
38
+ } : function (o) {
39
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
40
+ }, _typeof(o);
41
+ }
42
+
43
+ function _toPrimitive(input, hint) {
44
+ if (_typeof(input) !== "object" || input === null) return input;
45
+ var prim = input[Symbol.toPrimitive];
46
+ if (prim !== undefined) {
47
+ var res = prim.call(input, hint || "default");
48
+ if (_typeof(res) !== "object") return res;
49
+ throw new TypeError("@@toPrimitive must return a primitive value.");
50
+ }
51
+ return (hint === "string" ? String : Number)(input);
52
+ }
53
+
54
+ function _toPropertyKey(arg) {
55
+ var key = _toPrimitive(arg, "string");
56
+ return _typeof(key) === "symbol" ? key : String(key);
57
+ }
58
+
59
+ function _defineProperty(obj, key, value) {
60
+ key = _toPropertyKey(key);
61
+ if (key in obj) {
62
+ Object.defineProperty(obj, key, {
63
+ value: value,
64
+ enumerable: true,
65
+ configurable: true,
66
+ writable: true
67
+ });
68
+ } else {
69
+ obj[key] = value;
70
+ }
71
+ return obj;
72
+ }
73
+
74
+ function _arrayWithHoles(arr) {
75
+ if (Array.isArray(arr)) return arr;
76
+ }
77
+
78
+ function _iterableToArrayLimit(r, l) {
79
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
80
+ if (null != t) {
81
+ var e,
82
+ n,
83
+ i,
84
+ u,
85
+ a = [],
86
+ f = !0,
87
+ o = !1;
88
+ try {
89
+ if (i = (t = t.call(r)).next, 0 === l) {
90
+ if (Object(t) !== t) return;
91
+ f = !1;
92
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
93
+ } catch (r) {
94
+ o = !0, n = r;
95
+ } finally {
96
+ try {
97
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
98
+ } finally {
99
+ if (o) throw n;
100
+ }
101
+ }
102
+ return a;
103
+ }
104
+ }
105
+
106
+ function _arrayLikeToArray(arr, len) {
107
+ if (len == null || len > arr.length) len = arr.length;
108
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
109
+ return arr2;
110
+ }
111
+
112
+ function _unsupportedIterableToArray(o, minLen) {
113
+ if (!o) return;
114
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
115
+ var n = Object.prototype.toString.call(o).slice(8, -1);
116
+ if (n === "Object" && o.constructor) n = o.constructor.name;
117
+ if (n === "Map" || n === "Set") return Array.from(o);
118
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
119
+ }
120
+
121
+ function _nonIterableRest() {
122
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
123
+ }
124
+
125
+ function _slicedToArray(arr, i) {
126
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
127
+ }
128
+
129
+ var EDITOR_ADDONS = ["highlight", "emoji", "video-upload", "code-block", "block-quote", "image-upload", "image-upload-unsplash", "divider", "video-embed", "undo", "redo", "table"];
130
+ var DEFAULT_EDITOR_PROPS = {
131
+ isCharacterCountActive: true,
132
+ isMenuIndependent: true,
133
+ addons: []
134
+ };
135
+
136
+ 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}}
137
+
138
+ var css = ".neeto-molecules-document__wrapper .neeto-molecules-document__container{margin:0 auto;max-width:768px!important}.neeto-molecules-document__wrapper .neeto-molecules-document-editor__menubar{position:sticky;top:0;width:100%;z-index:20}.neeto-molecules-document__wrapper .neeto-molecules-document__title{margin:24px 0 0;width:100%}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input{padding:0!important}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea{color:rgb(var(--neeto-ui-black));font-size:42px;font-weight:700;line-height:48px;max-height:none;resize:none}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea::-moz-placeholder{color:rgb(var(--neeto-ui-gray-300))}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea::placeholder{color:rgb(var(--neeto-ui-gray-300))}.neeto-molecules-document__wrapper .neeto-molecules-editor-content__error{margin:12px auto}.neeto-molecules-document__wrapper .ProseMirror{max-height:none;overflow-y:hidden}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu{background-color:rgb(var(--neeto-ui-gray-100));border:thin solid rgb(var(--neeto-ui-gray-200));border-left:none;border-right:none}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper{margin:0 auto;max-width:768px;padding:4px 8px}.neeto-molecules-document__wrapper .editor-content__wrapper{border:none!important;padding:12px 16px 0!important;width:100%!important}.neeto-molecules-document__wrapper .editor-content-attachments{border:none;margin:12px auto 0;max-width:768px!important;padding-left:16px;padding-right:16px}.neeto-molecules-document__wrapper .editor-content-attachments--no-attachments{display:none!important}.neeto-molecules-document__wrapper .neeto-editor-character-count{margin:0 auto;max-width:768px!important;padding-left:16px;padding-right:16px}.neeto-molecules-document__wrapper .ne-attachments__wrapper{width:100%}.editor-content__wrapper.neeto-editor{padding:0 16px}.editor-content__wrapper.neeto-editor h1{font-size:var(--neeto-ui-text-h1);margin:2rem 0 .25rem}.editor-content__wrapper.neeto-editor h2{font-size:var(--neeto-ui-text-h2);margin:1.5rem 0 .25rem}.editor-content__wrapper.neeto-editor h3{font-size:var(--neeto-ui-text-h3);margin:1rem 0 .25rem}.editor-content__wrapper.neeto-editor h4{font-size:var(--neeto-ui-text-h4);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h5{font-size:var(--neeto-ui-text-h5);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h6{font-size:var(--neeto-ui-text-h6);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h1,.editor-content__wrapper.neeto-editor h2,.editor-content__wrapper.neeto-editor h3,.editor-content__wrapper.neeto-editor h4,.editor-content__wrapper.neeto-editor h5,.editor-content__wrapper.neeto-editor h6{font-weight:var(--neeto-ui-font-semibold)}.editor-content__wrapper.neeto-editor p{font-size:var(--neeto-ui-text-body1);line-height:var(--neeto-ui-leading-normal)}.editor-content__wrapper.neeto-editor ol,.editor-content__wrapper.neeto-editor ul{margin-bottom:1rem;padding-left:24px}.editor-content__wrapper.neeto-editor ol li,.editor-content__wrapper.neeto-editor ul li{margin-bottom:.5rem}.editor-content__wrapper.neeto-editor ol li p,.editor-content__wrapper.neeto-editor ul li p{margin-bottom:0}.editor-content__wrapper.neeto-editor ol li:last-child,.editor-content__wrapper.neeto-editor ul li:last-child{margin-bottom:.5rem}.editor-content__wrapper.neeto-editor .neeto-editor-table{margin:8px 0 0}.editor-content__wrapper.neeto-editor .neeto-editor-table table{border-radius:0}.editor-content__wrapper.neeto-editor .neeto-editor-table p{margin-bottom:0}.editor-content__wrapper.neeto-editor .neeto-editor-table .neeto-editor-table__add-column,.editor-content__wrapper.neeto-editor .neeto-editor-table .neeto-editor-table__add-row{visibility:hidden}.editor-content__wrapper.neeto-editor .neeto-editor-table:hover .neeto-editor-table__add-column,.editor-content__wrapper.neeto-editor .neeto-editor-table:hover .neeto-editor-table__add-row{visibility:visible}ins{background-color:#c1f4cb!important;text-decoration:none!important}del{background-color:#faa!important}";
139
+ n(css,{});
140
+
141
+ var useEditor = function useEditor(_ref) {
142
+ var onContentChange = _ref.onContentChange,
143
+ editorContentFieldName = _ref.editorContentFieldName,
144
+ setAttachments = _ref.setAttachments,
145
+ onAttachmentChange = _ref.onAttachmentChange,
146
+ onTitleChange = _ref.onTitleChange,
147
+ titleFieldName = _ref.titleFieldName,
148
+ editorRef = _ref.editorRef;
149
+ var _useFormikContext = formik.useFormikContext(),
150
+ setFieldValue = _useFormikContext.setFieldValue,
151
+ errors = _useFormikContext.errors;
152
+ var handleContentChange = function handleContentChange(content) {
153
+ setFieldValue(editorContentFieldName, content);
154
+ onContentChange === null || onContentChange === void 0 ? void 0 : onContentChange(content);
155
+ };
156
+ var handleAttachmentChange = function handleAttachmentChange(attachments) {
157
+ setAttachments(attachments);
158
+ setFieldValue("attachments", attachments);
159
+ onAttachmentChange === null || onAttachmentChange === void 0 ? void 0 : onAttachmentChange(attachments);
160
+ };
161
+ var handleTitleChange = function handleTitleChange(event) {
162
+ var title = event.target.value;
163
+ setFieldValue(titleFieldName, title);
164
+ onTitleChange === null || onTitleChange === void 0 ? void 0 : onTitleChange(title);
165
+ };
166
+ var titleHotkeyRef = reactUtils.useHotKeys("return", function () {
167
+ var _editorRef$current, _editorRef$current$ed, _editorRef$current$ed2;
168
+ return (_editorRef$current = editorRef.current) === null || _editorRef$current === void 0 ? void 0 : (_editorRef$current$ed = _editorRef$current.editor) === null || _editorRef$current$ed === void 0 ? void 0 : (_editorRef$current$ed2 = _editorRef$current$ed.commands) === null || _editorRef$current$ed2 === void 0 ? void 0 : _editorRef$current$ed2.focus();
169
+ }, {
170
+ mode: "scoped"
171
+ });
172
+ return {
173
+ handleContentChange: handleContentChange,
174
+ handleAttachmentChange: handleAttachmentChange,
175
+ handleTitleChange: handleTitleChange,
176
+ titleHotkeyRef: titleHotkeyRef,
177
+ errors: errors
178
+ };
179
+ };
180
+
181
+ 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; }
182
+ 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; }
183
+ var getUniqueAttachments = function getUniqueAttachments(attachments) {
184
+ var uniqueAttachments = attachments === null || attachments === void 0 ? void 0 : attachments.reduce(function (uniqueAttachments, attachment) {
185
+ return _objectSpread$1(_objectSpread$1({}, uniqueAttachments), {}, _defineProperty({}, attachment.signedId, attachment));
186
+ }, {});
187
+ return Object.values(uniqueAttachments || {});
188
+ };
189
+
190
+ 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; }
191
+ 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; }
192
+ var Editor = function Editor(_ref) {
193
+ var initialAttachments = _ref.attachments,
194
+ onContentChange = _ref.onContentChange,
195
+ onAttachmentChange = _ref.onAttachmentChange,
196
+ onTitleChange = _ref.onTitleChange,
197
+ _ref$getTitleRef = _ref.getTitleRef,
198
+ getTitleRef = _ref$getTitleRef === void 0 ? neetoCist.noop : _ref$getTitleRef,
199
+ _ref$getEditorRef = _ref.getEditorRef,
200
+ getEditorRef = _ref$getEditorRef === void 0 ? neetoCist.noop : _ref$getEditorRef,
201
+ menuClassName = _ref.menuClassName,
202
+ _ref$editorContentFie = _ref.editorContentFieldName,
203
+ editorContentFieldName = _ref$editorContentFie === void 0 ? "htmlContent" : _ref$editorContentFie,
204
+ _ref$titleFieldName = _ref.titleFieldName,
205
+ titleFieldName = _ref$titleFieldName === void 0 ? "title" : _ref$titleFieldName,
206
+ _ref$editorProps = _ref.editorProps,
207
+ editorProps = _ref$editorProps === void 0 ? DEFAULT_EDITOR_PROPS : _ref$editorProps,
208
+ _ref$titleProps = _ref.titleProps,
209
+ titleProps = _ref$titleProps === void 0 ? {} : _ref$titleProps;
210
+ var _useTranslation = reactI18next.useTranslation(),
211
+ t = _useTranslation.t;
212
+ var titleRef = React.useRef();
213
+ var editorRef = React.useRef();
214
+ var _useState = React.useState(function () {
215
+ return getUniqueAttachments(initialAttachments);
216
+ }),
217
+ _useState2 = _slicedToArray(_useState, 2),
218
+ attachments = _useState2[0],
219
+ setAttachments = _useState2[1];
220
+ var _useEditor = useEditor({
221
+ onContentChange: onContentChange,
222
+ editorContentFieldName: editorContentFieldName,
223
+ setAttachments: setAttachments,
224
+ onAttachmentChange: onAttachmentChange,
225
+ onTitleChange: onTitleChange,
226
+ titleFieldName: titleFieldName,
227
+ editorRef: editorRef
228
+ }),
229
+ handleContentChange = _useEditor.handleContentChange,
230
+ handleAttachmentChange = _useEditor.handleAttachmentChange,
231
+ handleTitleChange = _useEditor.handleTitleChange,
232
+ titleHotkeyRef = _useEditor.titleHotkeyRef,
233
+ errors = _useEditor.errors;
234
+ var setTitleRef = function setTitleRef(node) {
235
+ titleHotkeyRef.current = node;
236
+ getTitleRef(node);
237
+ titleRef.current = node;
238
+ };
239
+ var setEditorRef = function setEditorRef(node) {
240
+ getEditorRef(node);
241
+ editorRef.current = node;
242
+ };
243
+ return /*#__PURE__*/React__default["default"].createElement("div", {
244
+ className: "neeto-molecules-document__wrapper",
245
+ "data-testid": "document-editor-container"
246
+ }, /*#__PURE__*/React__default["default"].createElement(neetoEditor.FormikEditor, _extends({
247
+ attachmentsClassName: "editor-content-attachments",
248
+ className: "h-full w-full",
249
+ contentClassName: "editor-content__wrapper neeto-molecules-document__container",
250
+ "data-cy": "neeto-molecules-document-content-text-area",
251
+ error: undefined,
252
+ name: editorContentFieldName,
253
+ ref: setEditorRef,
254
+ menuClassName: classNames__default["default"]("neeto-molecules-document-editor__menubar", menuClassName)
255
+ }, _objectSpread({
256
+ attachments: attachments
257
+ }, editorProps), {
258
+ addons: EDITOR_ADDONS.concat(editorProps.addons || []),
259
+ onChange: handleContentChange,
260
+ onChangeAttachments: handleAttachmentChange
261
+ }), /*#__PURE__*/React__default["default"].createElement("div", {
262
+ className: "neeto-molecules-document__container px-4"
263
+ }, /*#__PURE__*/React__default["default"].createElement(formik$1.Textarea, _extends({
264
+ nakedTextarea: true,
265
+ className: "neeto-molecules-document__title",
266
+ "data-cy": "neeto-molecules-document-title-text-field",
267
+ name: titleFieldName,
268
+ ref: setTitleRef,
269
+ rows: 1,
270
+ placeholder: titleProps.placeholder || t("neetoMolecules.documentEditor.title"),
271
+ onChange: handleTitleChange,
272
+ onKeyDown: function onKeyDown(e) {
273
+ return e.key === "Enter" && !e.shiftKey && e.preventDefault();
274
+ }
275
+ }, titleProps)), errors[editorContentFieldName] && /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
276
+ className: "neeto-ui-input__error neeto-molecules-editor-content__error",
277
+ "data-cy": "articles-content-input-error",
278
+ style: "body3"
279
+ }, errors[editorContentFieldName]))));
280
+ };
281
+
282
+ module.exports = Editor;
283
+ //# sourceMappingURL=DocumentEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentEditor.js","sources":["../../node_modules/@babel/runtime/helpers/esm/extends.js","../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../../src/components/DocumentEditor/constants.js","../../node_modules/rollup-plugin-styles/dist/runtime/inject-css.js","../../src/components/DocumentEditor/hooks/useEditor.js","../../src/components/DocumentEditor/utils.js","../../src/components/DocumentEditor/index.jsx"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export const EDITOR_ADDONS = [\n \"highlight\",\n \"emoji\",\n \"video-upload\",\n \"code-block\",\n \"block-quote\",\n \"image-upload\",\n \"image-upload-unsplash\",\n \"divider\",\n \"video-embed\",\n \"undo\",\n \"redo\",\n \"table\",\n];\n\nexport const DEFAULT_EDITOR_PROPS = {\n isCharacterCountActive: true,\n isMenuIndependent: true,\n addons: [],\n};\n","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}}export{n as default};\n","import { useFormikContext } from \"formik\";\nimport { useHotKeys } from \"neetocommons/react-utils\";\n\nconst useEditor = ({\n onContentChange,\n editorContentFieldName,\n setAttachments,\n onAttachmentChange,\n onTitleChange,\n titleFieldName,\n editorRef,\n}) => {\n const { setFieldValue, errors } = useFormikContext();\n\n const handleContentChange = content => {\n setFieldValue(editorContentFieldName, content);\n onContentChange?.(content);\n };\n\n const handleAttachmentChange = attachments => {\n setAttachments(attachments);\n setFieldValue(\"attachments\", attachments);\n onAttachmentChange?.(attachments);\n };\n\n const handleTitleChange = event => {\n const title = event.target.value;\n setFieldValue(titleFieldName, title);\n onTitleChange?.(title);\n };\n\n const titleHotkeyRef = useHotKeys(\n \"return\",\n () => editorRef.current?.editor?.commands?.focus(),\n { mode: \"scoped\" }\n );\n\n return {\n handleContentChange,\n handleAttachmentChange,\n handleTitleChange,\n titleHotkeyRef,\n errors,\n };\n};\n\nexport default useEditor;\n","export const getUniqueAttachments = attachments => {\n const uniqueAttachments = attachments?.reduce(\n (uniqueAttachments, attachment) => ({\n ...uniqueAttachments,\n [attachment.signedId]: attachment,\n }),\n {}\n );\n\n return Object.values(uniqueAttachments || {});\n};\n","import React, { useRef, useState } from \"react\";\n\nimport classNames from \"classnames\";\nimport { noop } from \"neetocist\";\nimport { FormikEditor } from \"neetoeditor\";\nimport { Typography } from \"neetoui\";\nimport { Textarea } from \"neetoui/formik\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { DEFAULT_EDITOR_PROPS, EDITOR_ADDONS } from \"./constants\";\nimport \"./editor.scss\";\nimport useEditor from \"./hooks/useEditor\";\nimport { getUniqueAttachments } from \"./utils\";\n\nconst Editor = ({\n attachments: initialAttachments,\n onContentChange,\n onAttachmentChange,\n onTitleChange,\n getTitleRef = noop,\n getEditorRef = noop,\n menuClassName,\n editorContentFieldName = \"htmlContent\",\n titleFieldName = \"title\",\n editorProps = DEFAULT_EDITOR_PROPS,\n titleProps = {},\n}) => {\n const { t } = useTranslation();\n\n const titleRef = useRef();\n const editorRef = useRef();\n\n const [attachments, setAttachments] = useState(() =>\n getUniqueAttachments(initialAttachments)\n );\n\n const {\n handleContentChange,\n handleAttachmentChange,\n handleTitleChange,\n titleHotkeyRef,\n errors,\n } = useEditor({\n onContentChange,\n editorContentFieldName,\n setAttachments,\n onAttachmentChange,\n onTitleChange,\n titleFieldName,\n editorRef,\n });\n\n const setTitleRef = node => {\n titleHotkeyRef.current = node;\n getTitleRef(node);\n titleRef.current = node;\n };\n\n const setEditorRef = node => {\n getEditorRef(node);\n editorRef.current = node;\n };\n\n return (\n <div\n className=\"neeto-molecules-document__wrapper\"\n data-testid=\"document-editor-container\"\n >\n <FormikEditor\n attachmentsClassName=\"editor-content-attachments\"\n className=\"h-full w-full\"\n contentClassName=\"editor-content__wrapper neeto-molecules-document__container\"\n data-cy=\"neeto-molecules-document-content-text-area\"\n error={undefined}\n name={editorContentFieldName}\n ref={setEditorRef}\n menuClassName={classNames(\n \"neeto-molecules-document-editor__menubar\",\n menuClassName\n )}\n {...{ attachments, ...editorProps }}\n addons={EDITOR_ADDONS.concat(editorProps.addons || [])}\n onChange={handleContentChange}\n onChangeAttachments={handleAttachmentChange}\n >\n <div className=\"neeto-molecules-document__container px-4\">\n <Textarea\n nakedTextarea\n className=\"neeto-molecules-document__title\"\n data-cy=\"neeto-molecules-document-title-text-field\"\n name={titleFieldName}\n ref={setTitleRef}\n rows={1}\n placeholder={\n titleProps.placeholder || t(\"neetoMolecules.documentEditor.title\")\n }\n onChange={handleTitleChange}\n onKeyDown={e =>\n e.key === \"Enter\" && !e.shiftKey && e.preventDefault()\n }\n {...titleProps}\n />\n {errors[editorContentFieldName] && (\n <Typography\n className=\"neeto-ui-input__error neeto-molecules-editor-content__error\"\n data-cy=\"articles-content-input-error\"\n style=\"body3\"\n >\n {errors[editorContentFieldName]}\n </Typography>\n )}\n </div>\n </FormikEditor>\n </div>\n );\n};\n\nEditor.propTypes = {\n /**\n * List of initial attachments.\n */\n attachments: PropTypes.arrayOf(\n PropTypes.shape({\n contentType: PropTypes.string,\n filename: PropTypes.string,\n signedId: PropTypes.string,\n url: PropTypes.string,\n })\n ),\n /**\n * Callback that will be triggered when the editor content changes.\n * This function is not throttled.\n */\n onContentChange: PropTypes.func,\n /**\n * Callback that will be triggered when the attachments changes.\n */\n onAttachmentChange: PropTypes.func,\n /**\n * Callback that will be triggered when the article title changes.\n */\n onTitleChange: PropTypes.func,\n /**\n * This function will be called with the title node reference.\n */\n getTitleRef: PropTypes.func,\n /**\n * This function will be called with editor reference.\n */\n getEditorRef: PropTypes.func,\n /**\n * Formik field name of the editor. The default value is `htmlContent`.\n */\n editorContentFieldName: PropTypes.string,\n /**\n * Formik field name of the title. The default value is `title`.\n */\n titleFieldName: PropTypes.string,\n /**\n * These props will be passed down to the editor component.\n */\n editorProps: PropTypes.object,\n /**\n * These props will be passed down to the title text area component.\n */\n titleProps: PropTypes.object,\n /**\n * A prop to pass class names to the editor menubar.\n */\n menuClassName: PropTypes.string,\n};\n\nexport default Editor;\n"],"names":["toPrimitive","toPropertyKey","arrayLikeToArray","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","EDITOR_ADDONS","DEFAULT_EDITOR_PROPS","isCharacterCountActive","isMenuIndependent","addons","useEditor","_ref","onContentChange","editorContentFieldName","setAttachments","onAttachmentChange","onTitleChange","titleFieldName","editorRef","_useFormikContext","useFormikContext","setFieldValue","errors","handleContentChange","content","handleAttachmentChange","attachments","handleTitleChange","event","title","target","value","titleHotkeyRef","useHotKeys","_editorRef$current","_editorRef$current$ed","_editorRef$current$ed2","current","editor","commands","focus","mode","getUniqueAttachments","uniqueAttachments","reduce","attachment","_objectSpread","_defineProperty","signedId","Object","values","Editor","initialAttachments","_ref$getTitleRef","getTitleRef","noop","_ref$getEditorRef","getEditorRef","menuClassName","_ref$editorContentFie","_ref$titleFieldName","_ref$editorProps","editorProps","_ref$titleProps","titleProps","_useTranslation","useTranslation","t","titleRef","useRef","_useState","useState","_useState2","_slicedToArray","_useEditor","setTitleRef","node","setEditorRef","React","createElement","className","FormikEditor","_extends","attachmentsClassName","contentClassName","error","undefined","name","ref","classNames","concat","onChange","onChangeAttachments","Textarea","nakedTextarea","rows","placeholder","onKeyDown","e","key","shiftKey","preventDefault","Typography","style"],"mappings":";;;;;;;;;;;;;;;;;AAAe,SAAS,QAAQ,GAAG;AACnC,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,MAAM,EAAE;AACtE,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC/C,MAAM,IAAI,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAChC,MAAM,KAAK,IAAI,GAAG,IAAI,MAAM,EAAE;AAC9B,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE;AAC/D,UAAU,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACpC,SAAS;AACT,OAAO;AACP,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG,CAAC;AACJ,EAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACzC;;ACbe,SAAS,OAAO,CAAC,CAAC,EAAE;AACnC,EAAE,yBAAyB,CAAC;AAC5B;AACA,EAAE,OAAO,OAAO,GAAG,UAAU,IAAI,OAAO,MAAM,IAAI,QAAQ,IAAI,OAAO,MAAM,CAAC,QAAQ,GAAG,UAAU,CAAC,EAAE;AACpG,IAAI,OAAO,OAAO,CAAC,CAAC;AACpB,GAAG,G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