@dejwcake/craftable 0.1.10 → 2.0.1

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 (127) hide show
  1. package/README.md +117 -3
  2. package/dist/buildMatchPatternFn-BV4I8r8j.js +63 -0
  3. package/dist/buildMatchPatternFn-T5KjFTBQ.cjs +1 -0
  4. package/dist/craftable.css +2 -0
  5. package/dist/cs-B5QMxFrl.js +682 -0
  6. package/dist/cs-MAoetkhe.cjs +1 -0
  7. package/dist/de-BlQ2ZKmc.js +526 -0
  8. package/dist/de-BoVLAn6U.cjs +1 -0
  9. package/dist/en-US-BLvEnhs4.js +443 -0
  10. package/dist/en-US-Dz8vkDZ_.cjs +1 -0
  11. package/dist/en-US-X9gX759i.cjs +1 -0
  12. package/dist/es-DBHDeXHI.cjs +1 -0
  13. package/dist/es-YEqfkBY2.js +437 -0
  14. package/dist/fr-B7MHC2AN.js +407 -0
  15. package/dist/fr-DLs3QoNB.cjs +1 -0
  16. package/dist/hu-BKZPI9jH.cjs +1 -0
  17. package/dist/hu-reoJgNxD.js +425 -0
  18. package/dist/index.cjs +1 -0
  19. package/dist/index.mjs +3922 -0
  20. package/dist/isSameWeek-CC6GX_zp.js +40 -0
  21. package/dist/isSameWeek-Mctj6Tdj.cjs +1 -0
  22. package/dist/pl-B5A0Rjp7.js +628 -0
  23. package/dist/pl-BMyrOO-Q.cjs +1 -0
  24. package/dist/sk-B7JF2MoV.cjs +1 -0
  25. package/dist/sk-Btro3W4S.js +602 -0
  26. package/package.json +68 -40
  27. package/scripts/publish-components.js +118 -0
  28. package/scss/_images.scss +1 -1
  29. package/scss/_variables.scss +13 -6
  30. package/scss/app.scss +4 -4
  31. package/scss/overrides/_alerts.scss +0 -2
  32. package/scss/overrides/_badges.scss +1 -17
  33. package/scss/overrides/_buttons.scss +64 -7
  34. package/scss/overrides/_cards.scss +4 -51
  35. package/scss/overrides/_checkboxes.scss +54 -59
  36. package/scss/overrides/_forms.scss +270 -176
  37. package/scss/overrides/_index.scss +18 -18
  38. package/scss/overrides/_keyframes.scss +6 -4
  39. package/scss/overrides/_layout.scss +24 -30
  40. package/scss/overrides/_media-wysiwyg.scss +9 -111
  41. package/scss/overrides/_modal.scss +0 -18
  42. package/scss/overrides/_multiselect.scss +63 -7
  43. package/scss/overrides/_nav.scss +55 -33
  44. package/scss/overrides/_notifications.scss +6 -1
  45. package/scss/overrides/_pagination.scss +3 -3
  46. package/scss/overrides/_sidebar.scss +84 -0
  47. package/scss/overrides/_tables.scss +52 -37
  48. package/scss/overrides/_text.scss +1 -3
  49. package/scss/overrides/_wysiwyg.scss +151 -48
  50. package/scss/styles/_auth.scss +32 -37
  51. package/scss/styles/_custom.scss +44 -1
  52. package/scss/styles/_index.scss +4 -4
  53. package/scss/styles/_legacy.scss +5 -81
  54. package/scss/styles/_others.scss +232 -337
  55. package/scss/vendor/_index.scss +5 -4
  56. package/src/auth/ActivationError.vue +23 -0
  57. package/src/auth/ActivationForm.vue +69 -0
  58. package/src/auth/ForgotPasswordForm.vue +74 -0
  59. package/src/auth/LoginForm.vue +107 -0
  60. package/src/auth/ResetPasswordForm.vue +122 -0
  61. package/src/components/ConfirmModal.vue +65 -0
  62. package/src/components/UserDetailTooltip.vue +88 -0
  63. package/src/components/form/CkeditorEditor.vue +205 -0
  64. package/src/components/form/FormCheckbox.vue +29 -0
  65. package/src/components/form/FormDatePicker.vue +52 -0
  66. package/src/components/form/FormEmail.vue +17 -0
  67. package/src/components/form/FormInput.vue +31 -0
  68. package/src/components/form/FormLocalizedInput.vue +47 -0
  69. package/src/components/form/FormLocalizedWysiwyg.vue +55 -0
  70. package/src/components/form/FormLocalizedWysiwygSimple.vue +55 -0
  71. package/src/components/form/FormMultiSelect.vue +36 -0
  72. package/src/components/form/FormPasswordConfirm.vue +49 -0
  73. package/src/components/form/FormSelect.vue +35 -0
  74. package/src/components/form/FormSubmit.vue +13 -0
  75. package/src/components/form/FormTagInput.vue +36 -0
  76. package/src/components/form/FormTextarea.vue +31 -0
  77. package/src/components/form/FormWysiwyg.vue +31 -0
  78. package/src/components/form/FormWysiwygSimple.vue +31 -0
  79. package/src/components/form/LocalizationBar.vue +90 -0
  80. package/src/components/form/MediaUpload.vue +317 -0
  81. package/src/components/form/TiptapEditor.vue +238 -0
  82. package/src/components/listing/BulkCheckboxHeader.vue +18 -0
  83. package/src/components/listing/BulkCheckboxRow.vue +21 -0
  84. package/src/components/listing/BulkOperationsBar.vue +41 -0
  85. package/src/components/listing/DeleteButton.vue +46 -0
  86. package/src/components/listing/EditButton.vue +17 -0
  87. package/src/components/listing/EmptyState.vue +25 -0
  88. package/src/components/listing/ListingHeader.vue +24 -0
  89. package/src/components/listing/Pagination.vue +158 -0
  90. package/src/components/listing/PerPage.vue +15 -0
  91. package/src/components/listing/PublishedAtColumn.vue +226 -0
  92. package/src/components/listing/Search.vue +81 -0
  93. package/src/components/listing/Sortable.vue +28 -0
  94. package/src/components/listing/ToggleSwitch.vue +47 -0
  95. package/src/composables/useAdmin.js +39 -0
  96. package/src/composables/useBaseAuth.js +81 -0
  97. package/src/composables/useBaseForm.js +265 -0
  98. package/src/composables/useBaseListing.js +316 -0
  99. package/src/composables/useResponsiveColumns.js +62 -0
  100. package/src/index.js +63 -0
  101. package/src/translation/TranslationListing.vue +230 -0
  102. package/src/translation/modals/TranslationEditModal.vue +86 -0
  103. package/src/translation/modals/TranslationExportModal.vue +74 -0
  104. package/src/translation/modals/TranslationImportModal.vue +255 -0
  105. package/src/ui/index.js +99 -0
  106. package/src/utils/ckeditorHelpers.js +36 -0
  107. package/src/utils/dateFnsLocale.js +24 -0
  108. package/src/utils/dateFormatters.js +30 -0
  109. package/src/utils/mediaProps.js +14 -0
  110. package/src/utils/notify.js +22 -0
  111. package/dist/admin/Admin.js +0 -42
  112. package/dist/auth/Form.js +0 -15
  113. package/dist/base-components/Form/BaseForm.js +0 -395
  114. package/dist/base-components/Form/BaseUpload.js +0 -188
  115. package/dist/base-components/Form/bootstrap.js +0 -21
  116. package/dist/base-components/Listing/BaseListing.js +0 -454
  117. package/dist/base-components/Listing/components/Pagination.js +0 -105
  118. package/dist/base-components/Listing/components/Sortable.js +0 -48
  119. package/dist/base-components/Listing/components/UserDetailTooltip.js +0 -55
  120. package/dist/index.js +0 -70
  121. package/dist/overrides/trumbowyg.edit-embed-template.js +0 -72
  122. package/dist/overrides/trumbowyg.reupload.js +0 -146
  123. package/dist/overrides/trumbowyg.template.js +0 -67
  124. package/dist/translation/Form.js +0 -15
  125. package/dist/translation/Listing.js +0 -283
  126. package/dist/ui/index.js +0 -33
  127. package/scss/overrides/_switches.scss +0 -25
@@ -1,283 +0,0 @@
1
- 'use strict';
2
-
3
- var _vue = require('vue');
4
-
5
- var _vue2 = _interopRequireDefault(_vue);
6
-
7
- var _BaseListing = require('../base-components/Listing/BaseListing');
8
-
9
- var _BaseListing2 = _interopRequireDefault(_BaseListing);
10
-
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
-
13
- $(document).ready(function ($) {
14
- $(document).on('click', '.close_button', function (e) {
15
- $(this).closest('.show').removeClass('show');
16
- });
17
-
18
- $(document).on('click', '.dropdown-menu.dropdown-menu-dont-auto-close', function (e) {
19
- e.stopPropagation();
20
- });
21
- });
22
-
23
- _vue2.default.component('translation-listing', {
24
-
25
- mixins: [_BaseListing2.default],
26
-
27
- props: {
28
- label: {
29
- type: String,
30
- default: function _default() {
31
- return 'All groups';
32
- }
33
- },
34
- stepCount: {
35
- type: Number,
36
- default: function _default() {
37
- return 3;
38
- }
39
- },
40
- locales: {}
41
- },
42
-
43
- data: function data() {
44
- var exportMultiselect = {};
45
- Object.values(this.locales).forEach(function (value) {
46
- exportMultiselect[value] = true;
47
- });
48
- return {
49
- templateChecked: false,
50
- exportMultiselect: exportMultiselect,
51
- languagesToExport: this.locales,
52
- importLanguage: '',
53
- file: null,
54
- onlyMissing: false,
55
- currentStep: 1,
56
- scanning: false,
57
- filters: {
58
- group: null
59
- },
60
- translationId: null,
61
- translationDefault: '',
62
- numberOfSuccessfullyImportedTranslations: 0,
63
- numberOfSuccessfullyUpdatedTranslations: 0,
64
- numberOfFoundTranslations: 0,
65
- numberOfTranslationsToReview: 0,
66
- translationsToImport: null,
67
- translations: {},
68
- importedFile: null
69
- };
70
- },
71
-
72
- watch: {
73
- exportMultiselect: {
74
- handler: function handler(newVal, oldVal) {
75
- var _this = this;
76
-
77
- this.languagesToExport = [];
78
-
79
- Object.keys(newVal).forEach(function (key) {
80
- if (newVal[key]) {
81
- _this.languagesToExport.push(key);
82
- }
83
- });
84
- },
85
-
86
- deep: true
87
- }
88
- },
89
- computed: {
90
- filteredGroup: function filteredGroup() {
91
- return this.filters.group === null ? this.label : this.filters.group;
92
- },
93
- lastStep: function lastStep() {
94
- return this.currentStep === this.stepCount;
95
- }
96
- },
97
- methods: {
98
- rescan: function rescan(url) {
99
- var _this2 = this;
100
-
101
- this.scanning = true;
102
- axios.post(url).then(function (response) {
103
- _this2.scanning = false;
104
- _this2.loadData(true);
105
- }, function (error) {
106
- _this2.scanning = false;
107
- _this2.$notify({ type: 'error', title: 'Error!', text: 'An error has occured.' });
108
- });
109
- },
110
- filterGroup: function filterGroup(group) {
111
- this.filters.group = group;
112
- this.loadData(true);
113
- },
114
- resetGroup: function resetGroup() {
115
- this.filters.group = null;
116
- this.loadData(true);
117
- },
118
- editTranslation: function editTranslation(item) {
119
- this.$modal.show('edit-translation', item);
120
- },
121
- showImport: function showImport() {
122
- this.$modal.show('import-translation');
123
- },
124
- showExport: function showExport() {
125
- this.$modal.show('export-translation');
126
- },
127
- nextStep: function nextStep() {
128
- var _this3 = this;
129
-
130
- if (this.currentStep === 1) {
131
- return this.$validator.validateAll().then(function (result) {
132
- if (!result) {
133
- _this3.$notify({ type: 'error', title: 'Error!', text: 'The form contains invalid fields.' });
134
- return false;
135
- }
136
-
137
- var url = '/admin/translations/import';
138
- var formData = new FormData();
139
-
140
- formData.append('fileImport', _this3.file);
141
- formData.append('importLanguage', _this3.importLanguage);
142
- formData.append('onlyMissing', _this3.onlyMissing);
143
-
144
- axios.post(url, formData, {
145
- headers: {
146
- 'Content-Type': 'multipart/form-data'
147
- }
148
- }).then(function (response) {
149
- if (response.data.hasOwnProperty('numberOfImportedTranslations') && response.data.hasOwnProperty('numberOfUpdatedTranslations')) {
150
- _this3.currentStep = 3;
151
- _this3.numberOfSuccessfullyImportedTranslations = response.data.numberOfImportedTranslations;
152
- _this3.numberOfSuccessfullyUpdatedTranslations = response.data.numberOfUpdatedTranslations;
153
- _this3.loadData();
154
- } else {
155
- _this3.currentStep = 2;
156
- _this3.numberOfFoundTranslations = Object.keys(response.data).length;
157
- _this3.translationsToImport = response.data;
158
-
159
- for (var i = 0; i < _this3.translationsToImport.length; i++) {
160
- if (_this3.translationsToImport[i].hasOwnProperty('has_conflict')) {
161
- if (_this3.translationsToImport[i].has_conflict) {
162
- _this3.numberOfTranslationsToReview++;
163
- }
164
- }
165
- }
166
- }
167
- }, function (error) {
168
- if (error.response.data === "Wrong syntax in your import") _this3.$notify({ type: 'error', title: 'Error!', text: 'Wrong syntax in your import.' });else if (error.response.data === "Unsupported file type") _this3.$notify({ type: 'error', title: 'Error!', text: 'Unsupported file type.' });else _this3.$notify({ type: 'error', title: 'Error!', text: 'An error has occured.' });
169
- });
170
- });
171
- } else if (this.currentStep === 2) {
172
- return this.$validator.validateAll().then(function (result) {
173
- if (!result) {
174
- _this3.$notify({ type: 'error', title: 'Error!', text: 'The form contains invalid fields.' });
175
- return false;
176
- }
177
-
178
- for (var i = 0; i < _this3.translationsToImport.length; i++) {
179
- if (_this3.translationsToImport[i].hasOwnProperty('checkedCurrent')) {
180
- if (_this3.translationsToImport[i].checkedCurrent) {
181
- _this3.translationsToImport[i][_this3.importLanguage.toLowerCase()] = _this3.translationsToImport[i].current_value;
182
- }
183
- }
184
- }
185
-
186
- var url = '/admin/translations/import/conflicts';
187
- var data = {
188
- importLanguage: _this3.importLanguage,
189
- resolvedTranslations: _this3.translationsToImport
190
- };
191
-
192
- axios.post(url, data).then(function (response) {
193
- _this3.currentStep = 3;
194
- _this3.numberOfSuccessfullyImportedTranslations = response.data.numberOfImportedTranslations;
195
- _this3.numberOfSuccessfullyUpdatedTranslations = response.data.numberOfUpdatedTranslations;
196
- _this3.loadData();
197
- }, function (error) {
198
- _this3.$notify({ type: 'error', title: 'Error!', text: 'An error has occured.' });
199
- });
200
- });
201
- }
202
- },
203
- previousStep: function previousStep() {
204
- this.currentStep--;
205
- },
206
- beforeModalOpen: function beforeModalOpen(_ref) {
207
- var params = _ref.params;
208
-
209
- this.translationId = params.id;
210
- this.translationDefault = params.key;
211
- this.translations = {};
212
- var _iteratorNormalCompletion = true;
213
- var _didIteratorError = false;
214
- var _iteratorError = undefined;
215
-
216
- try {
217
- for (var _iterator = Object.keys(params.text)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
218
- var key = _step.value;
219
-
220
- this.translations[key] = params.text[key];
221
- }
222
- } catch (err) {
223
- _didIteratorError = true;
224
- _iteratorError = err;
225
- } finally {
226
- try {
227
- if (!_iteratorNormalCompletion && _iterator.return) {
228
- _iterator.return();
229
- }
230
- } finally {
231
- if (_didIteratorError) {
232
- throw _iteratorError;
233
- }
234
- }
235
- }
236
- },
237
- onSubmit: function onSubmit() {
238
- var _this4 = this;
239
-
240
- var url = '/admin/translations/' + this.translationId;
241
- var data = {
242
- text: this.translations
243
- };
244
-
245
- axios.post(url, data).then(function (response) {
246
- _this4.$modal.hide('edit-translation');
247
- _this4.$notify({ type: 'success', title: 'Success!', text: 'Item successfully changed.' });
248
- _this4.loadData();
249
- }, function (error) {
250
- _this4.$notify({ type: 'error', title: 'Error!', text: 'An error has occured.' });
251
- });
252
- },
253
- onSubmitExport: function onSubmitExport() {
254
- var _this5 = this;
255
-
256
- return this.$validator.validateAll().then(function (result) {
257
- if (!result) {
258
- _this5.$notify({ type: 'error', title: 'Error!', text: 'The form contains invalid fields.' });
259
- return false;
260
- }
261
-
262
- var data = {
263
- exportLanguages: _this5.languagesToExport
264
- };
265
-
266
- var url = '/admin/translations/export?' + $.param(data);
267
- window.location = url;
268
- _this5.$modal.hide('export-translation');
269
- });
270
- },
271
- handleImportFileUpload: function handleImportFileUpload(e) {
272
- this.file = this.$refs.file.files[0];
273
- this.importedFile = e.target.files[0];
274
- },
275
- onCloseImportModal: function onCloseImportModal() {
276
- this.currentStep = 1;
277
- this.importedFile = '';
278
- this.importLanguage = '';
279
- this.onlyMissing = false;
280
- this.translationsToImport = null;
281
- }
282
- }
283
- });
package/dist/ui/index.js DELETED
@@ -1,33 +0,0 @@
1
- 'use strict';
2
-
3
- require('popper.js');
4
-
5
- require('bootstrap');
6
-
7
- require('@coreui/coreui');
8
-
9
- $(function () {
10
- // spinner buttons
11
- $('.btn-spinner').on('click', function (e) {
12
- if (!(e.shiftKey || e.ctrlKey || e.metaKey)) {
13
- $(this).css({ 'pointer-events': 'none' });
14
- $(this).find('i').removeClass().addClass('fa fa-spinner');
15
- }
16
- });
17
-
18
- // dropdown Menu
19
- $('.dropdown-toggle').on('click', function () {
20
- $(this).parent().toggleClass('open');
21
- });
22
- $('.dropdown-item').on('click', function () {
23
- $(this).closest('.open').removeClass('open');
24
- });
25
- $('.dropdown-menu').on('mouseleave', function () {
26
- $(this).parent('.dropdown').removeClass('open');
27
- });
28
-
29
- // remove empty nav titles when no children there
30
- $('.nav-title').filter(function () {
31
- return !$(this).next().hasClass('nav-item');
32
- }).hide();
33
- });
@@ -1,25 +0,0 @@
1
- @use "../variables" as *;
2
-
3
- .switch-success .switch-input:checked + .switch-slider,
4
- .switch-success > .switch-input:checked ~ .switch-label {
5
- background: $success !important;
6
- border-color: $success;
7
- }
8
-
9
- .switch-danger .switch-input:checked + .switch-slider,
10
- .switch-danger > .switch-input:checked ~ .switch-label {
11
- background: $danger !important;
12
- border-color: $danger;
13
- }
14
-
15
- .switch-info .switch-input:checked + .switch-slider,
16
- .switch-info > .switch-input:checked ~ .switch-label {
17
- background: $primary !important;
18
- border-color: $primary;
19
- }
20
-
21
- .switch-warning .switch-input:checked + .switch-slider,
22
- .switch-warning > .switch-input:checked ~ .switch-label {
23
- background: $warning !important;
24
- border-color: $warning;
25
- }