apostrophe 4.6.1 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/main.yml +1 -1
- package/CHANGELOG.md +39 -1
- package/lib/big-upload-client.js +100 -0
- package/modules/@apostrophecms/admin-bar/ui/apos/components/TheAposAdminBar.vue +5 -3
- package/modules/@apostrophecms/admin-bar/ui/apos/components/TheAposAdminBarLocale.vue +6 -3
- package/modules/@apostrophecms/admin-bar/ui/apos/components/TheAposAdminBarUser.vue +4 -1
- package/modules/@apostrophecms/admin-bar/ui/apos/components/TheAposContextBar.vue +24 -16
- package/modules/@apostrophecms/admin-bar/ui/apos/components/TheAposContextTitle.vue +1 -0
- package/modules/@apostrophecms/admin-bar/ui/apos/components/TheAposSavingIndicator.vue +7 -5
- package/modules/@apostrophecms/area/index.js +5 -2
- package/modules/@apostrophecms/area/ui/apos/components/AposAreaContextualMenu.vue +20 -12
- package/modules/@apostrophecms/area/ui/apos/components/AposAreaExpandedMenu.vue +11 -7
- package/modules/@apostrophecms/area/ui/apos/components/AposAreaMenu.vue +20 -12
- package/modules/@apostrophecms/area/ui/apos/components/AposAreaMenuItem.vue +3 -1
- package/modules/@apostrophecms/area/ui/apos/components/AposAreaWidget.vue +15 -11
- package/modules/@apostrophecms/attachment/index.js +4 -2
- package/modules/@apostrophecms/command-menu/ui/apos/components/AposCommandMenuKey.vue +28 -24
- package/modules/@apostrophecms/command-menu/ui/apos/components/AposCommandMenuShortcut.vue +17 -11
- package/modules/@apostrophecms/doc/index.js +22 -19
- package/modules/@apostrophecms/doc-type/index.js +6 -2
- package/modules/@apostrophecms/doc-type/ui/apos/components/AposDocEditor.vue +9 -5
- package/modules/@apostrophecms/doc-type/ui/apos/components/AposDocLocalePicker.vue +10 -5
- package/modules/@apostrophecms/doc-type/ui/apos/logic/AposDocContextMenu.js +12 -0
- package/modules/@apostrophecms/http/index.js +19 -3
- package/modules/@apostrophecms/http/lib/big-upload-middleware.js +251 -0
- package/modules/@apostrophecms/i18n/i18n/de.json +1 -1
- package/modules/@apostrophecms/i18n/i18n/en.json +9 -1
- package/modules/@apostrophecms/i18n/i18n/es.json +1 -1
- package/modules/@apostrophecms/i18n/i18n/fr.json +1 -1
- package/modules/@apostrophecms/i18n/i18n/it.json +1 -1
- package/modules/@apostrophecms/i18n/i18n/pt-BR.json +1 -1
- package/modules/@apostrophecms/i18n/i18n/sk.json +1 -1
- package/modules/@apostrophecms/i18n/index.js +3 -0
- package/modules/@apostrophecms/i18n/ui/apos/components/AposI18nLocalize.vue +30 -16
- package/modules/@apostrophecms/i18n/ui/apos/components/AposI18nLocalizeErrors.vue +7 -5
- package/modules/@apostrophecms/image/ui/apos/components/AposImageCropper.vue +5 -1
- package/modules/@apostrophecms/image/ui/apos/components/AposImageRelationshipEditor.vue +10 -6
- package/modules/@apostrophecms/image/ui/apos/components/AposMediaManager.vue +40 -18
- package/modules/@apostrophecms/image/ui/apos/components/AposMediaManagerDisplay.vue +35 -25
- package/modules/@apostrophecms/image/ui/apos/components/AposMediaManagerEditor.vue +11 -5
- package/modules/@apostrophecms/image/ui/apos/components/AposMediaManagerSelections.vue +15 -9
- package/modules/@apostrophecms/image/ui/apos/components/AposMediaUploader.vue +39 -31
- package/modules/@apostrophecms/job/index.js +1 -1
- package/modules/@apostrophecms/login/ui/apos/components/AposLoginForm.vue +9 -7
- package/modules/@apostrophecms/login/ui/apos/components/TheAposLogin.vue +17 -13
- package/modules/@apostrophecms/login/ui/apos/components/TheAposLoginHeader.vue +30 -20
- package/modules/@apostrophecms/modal/ui/apos/components/AposDocsManagerToolbar.vue +5 -0
- package/modules/@apostrophecms/modal/ui/apos/components/AposModal.vue +4 -1
- package/modules/@apostrophecms/modal/ui/apos/components/AposModalBreadcrumbs.vue +8 -4
- package/modules/@apostrophecms/modal/ui/apos/components/AposModalConfirm.vue +14 -8
- package/modules/@apostrophecms/modal/ui/apos/components/AposModalShareDraft.vue +32 -22
- package/modules/@apostrophecms/modal/ui/apos/components/AposModalTabs.vue +16 -14
- package/modules/@apostrophecms/modal/ui/apos/components/AposWidgetModalTabs.vue +16 -14
- package/modules/@apostrophecms/notification/ui/apos/components/AposNotification.vue +93 -91
- package/modules/@apostrophecms/page/index.js +482 -13
- package/modules/@apostrophecms/page/ui/apos/components/AposPagesManager.vue +43 -23
- package/modules/@apostrophecms/page/ui/apos/logic/AposPagesManager.js +248 -156
- package/modules/@apostrophecms/permission/ui/apos/components/AposPermissionGrid.vue +9 -5
- package/modules/@apostrophecms/piece-type/index.js +7 -7
- package/modules/@apostrophecms/piece-type/ui/apos/components/AposDocsManager.vue +92 -36
- package/modules/@apostrophecms/rich-text-widget/ui/apos/components/AposRichTextWidgetEditor.vue +30 -24
- package/modules/@apostrophecms/rich-text-widget/ui/apos/components/AposTiptapDivider.vue +4 -2
- package/modules/@apostrophecms/rich-text-widget/ui/apos/components/AposTiptapLink.vue +2 -1
- package/modules/@apostrophecms/rich-text-widget/ui/apos/components/AposTiptapMarks.vue +5 -3
- package/modules/@apostrophecms/rich-text-widget/ui/apos/components/AposTiptapStyles.vue +5 -3
- package/modules/@apostrophecms/rich-text-widget/ui/apos/components/AposTiptapTable.vue +5 -2
- package/modules/@apostrophecms/schema/index.js +26 -5
- package/modules/@apostrophecms/schema/lib/addFieldTypes.js +42 -9
- package/modules/@apostrophecms/schema/ui/apos/components/AposInputColor.vue +4 -2
- package/modules/@apostrophecms/schema/ui/apos/components/AposInputRange.vue +8 -4
- package/modules/@apostrophecms/schema/ui/apos/components/AposInputRelationship.vue +6 -4
- package/modules/@apostrophecms/schema/ui/apos/components/AposInputSlug.vue +5 -3
- package/modules/@apostrophecms/schema/ui/apos/components/AposInputWrapper.vue +19 -13
- package/modules/@apostrophecms/schema/ui/apos/components/AposSearchList.vue +6 -2
- package/modules/@apostrophecms/schema/ui/apos/components/AposSubform.vue +6 -4
- package/modules/@apostrophecms/schema/ui/apos/logic/AposInputSlug.js +28 -25
- package/modules/@apostrophecms/schema/ui/apos/scss/AposInputArray.scss +13 -7
- package/modules/@apostrophecms/settings/ui/apos/components/AposSettingsManager.vue +11 -6
- package/modules/@apostrophecms/translation/ui/apos/components/AposTranslationIndicator.vue +5 -3
- package/modules/@apostrophecms/ui/ui/apos/components/AposAvatar.vue +14 -12
- package/modules/@apostrophecms/ui/ui/apos/components/AposButton.vue +14 -11
- package/modules/@apostrophecms/ui/ui/apos/components/AposButtonSplit.vue +7 -3
- package/modules/@apostrophecms/ui/ui/apos/components/AposCellContextMenu.vue +4 -2
- package/modules/@apostrophecms/ui/ui/apos/components/AposCombo.vue +23 -17
- package/modules/@apostrophecms/ui/ui/apos/components/AposContextMenu.vue +25 -10
- package/modules/@apostrophecms/ui/ui/apos/components/AposContextMenuDialog.vue +7 -5
- package/modules/@apostrophecms/ui/ui/apos/components/AposContextMenuItem.vue +10 -8
- package/modules/@apostrophecms/ui/ui/apos/components/AposEmptyState.vue +9 -5
- package/modules/@apostrophecms/ui/ui/apos/components/AposFile.vue +9 -6
- package/modules/@apostrophecms/ui/ui/apos/components/AposIndicator.vue +5 -0
- package/modules/@apostrophecms/ui/ui/apos/components/AposLoadingBlock.vue +3 -1
- package/modules/@apostrophecms/ui/ui/apos/components/AposLocale.vue +3 -1
- package/modules/@apostrophecms/ui/ui/apos/components/AposLocalePicker.vue +11 -9
- package/modules/@apostrophecms/ui/ui/apos/components/AposMinMaxCount.vue +5 -3
- package/modules/@apostrophecms/ui/ui/apos/components/AposPager.vue +4 -2
- package/modules/@apostrophecms/ui/ui/apos/components/AposPagerDots.vue +8 -6
- package/modules/@apostrophecms/ui/ui/apos/components/AposSlat.vue +25 -17
- package/modules/@apostrophecms/ui/ui/apos/components/AposSlatList.vue +5 -9
- package/modules/@apostrophecms/ui/ui/apos/components/AposSubformPreview.vue +10 -6
- package/modules/@apostrophecms/ui/ui/apos/components/AposTag.vue +9 -7
- package/modules/@apostrophecms/ui/ui/apos/components/AposTagApply.vue +8 -4
- package/modules/@apostrophecms/ui/ui/apos/components/AposTagList.vue +4 -2
- package/modules/@apostrophecms/ui/ui/apos/components/AposTagListItem.vue +7 -5
- package/modules/@apostrophecms/ui/ui/apos/components/AposToggle.vue +16 -0
- package/modules/@apostrophecms/ui/ui/apos/components/AposTree.vue +3 -1
- package/modules/@apostrophecms/ui/ui/apos/components/AposTreeRows.vue +11 -9
- package/modules/@apostrophecms/ui/ui/apos/mixins/AposArchiveMixin.js +2 -2
- package/modules/@apostrophecms/ui/ui/apos/mixins/AposPublishMixin.js +6 -6
- package/modules/@apostrophecms/ui/ui/apos/scss/global/_inputs.scss +30 -22
- package/modules/@apostrophecms/ui/ui/apos/scss/global/_theme.scss +22 -18
- package/modules/@apostrophecms/ui/ui/apos/scss/global/_tooltips.scss +18 -15
- package/modules/@apostrophecms/ui/ui/apos/scss/mixins/_input_mixins.scss +8 -6
- package/modules/@apostrophecms/ui/ui/apos/scss/mixins/_mixins.scss +3 -1
- package/modules/@apostrophecms/ui/ui/apos/scss/mixins/_theme_mixins.scss +34 -19
- package/modules/@apostrophecms/ui/ui/apos/scss/mixins/_type_mixins.scss +3 -1
- package/modules/@apostrophecms/ui/ui/apos/utils/index.js +140 -51
- package/modules/@apostrophecms/widget-type/index.js +3 -2
- package/modules/@apostrophecms/widget-type/ui/apos/mixins/AposWidgetMixin.js +5 -1
- package/package.json +5 -6
- package/test/big-upload.js +111 -0
- package/test/change-doc-ids.js +60 -1
- package/test/pages.js +488 -0
- package/test/schemas.js +327 -0
- package/test/utils.js +266 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.7.0 (2024-09-05)
|
|
4
|
+
|
|
5
|
+
### Adds
|
|
6
|
+
|
|
7
|
+
* To aid debugging, when a file extension is unacceptable as an Apostrophe attachment the rejected extension is now printed as part of the error message.
|
|
8
|
+
* The new `big-upload-client` module can now be used to upload very large files to any route that uses the new `big-upload-middleware`.
|
|
9
|
+
* Add option `skipReplace` for `apos.doc.changeDocIds` method to skip the replacing of the "old" document in the database.
|
|
10
|
+
* The `@apostrophecms/i18n` module now exposes a `locales` HTTP GET API to aid in implementation of native apps for localized sites.
|
|
11
|
+
* Context menus can be supplied a `menuId` so that interested components can listen to their opening/closing.
|
|
12
|
+
* Allow to set mode in `AposWidget` component through props.
|
|
13
|
+
* Add batch operations to pages.
|
|
14
|
+
* Add shortcuts to pages manager.
|
|
15
|
+
* Add `replaces` (boolean, `false` by default) option to the context operation definition (registered via `apos.doc.addContextOperation()`) to allow the operation to require a replace confirmation before being executed. The user confirmation results in the Editor modal being closed and the operation being executed. The operation is not executed if the user cancels the confirmation.
|
|
16
|
+
|
|
17
|
+
### Changes
|
|
18
|
+
|
|
19
|
+
* Wait for notify before navigating to a new page.
|
|
20
|
+
* Send also `checkedTypes` via the pages body toolbar operations (e.g. 'batch') to the modal.
|
|
21
|
+
|
|
22
|
+
### Fixes
|
|
23
|
+
|
|
24
|
+
* Fix link to pages in rich-text not showing UI to select page during edit.
|
|
25
|
+
* Bumps `uploadfs` dependency to ensure `.tar.gz`, `.tgz` and `.gz` files uploaded to S3 download without double-gzipping.
|
|
26
|
+
This resolves the issue for new uploads.
|
|
27
|
+
* Registering duplicate icon is no longer breaking the build.
|
|
28
|
+
* Fix widget focus state so that the in-context Add Content menu stays visible during animation
|
|
29
|
+
* Fix UI of areas in schemas so that their context menus are layered overtop sibling schema fields UI
|
|
30
|
+
* Fix unhandled promise rejections and guard against potential memory leaks, remove 3rd party `debounce-async` dependency
|
|
31
|
+
* Adds an option to center the context menu arrow on the button icon. Sets this new option on some context menus in the admin UI.
|
|
32
|
+
* Fixes the update function of `AposSlatLists` so that elements are properly reordered on drag
|
|
33
|
+
|
|
3
34
|
## 4.6.1 (2024-08-26)
|
|
4
35
|
|
|
5
36
|
### Fixes
|
|
@@ -13,11 +44,18 @@
|
|
|
13
44
|
### Adds
|
|
14
45
|
|
|
15
46
|
* Add a locale switcher in pieces and pages editor modals. This is available for localized documents only, and allows you to switch between locales for the same document.
|
|
16
|
-
The locale can be
|
|
47
|
+
The locale can be switched at only one level, meaning that sub documents of a document that already switched locale will not be able to switch locale itself.
|
|
17
48
|
* Adds visual focus states and keyboard handlers for engaging with areas and widgets in-context
|
|
49
|
+
* Adds method `simulateRelationshipsFromStorage` method in schema module.
|
|
50
|
+
This method populates the relationship field with just enough information to allow convert to accept it. It does not fully fetch the related documents. It does the opposite of prepareForStorage.
|
|
51
|
+
* A new options object has been added to the convert method.
|
|
52
|
+
Setting the `fetchRelationships` option to false will prevent convert from actually fetching relationships to check which related documents currently exist.
|
|
53
|
+
The shape of the relationship field is still validated.
|
|
18
54
|
|
|
19
55
|
### Changes
|
|
20
56
|
|
|
57
|
+
* Refactors Admin UI SASS to eliminate deprecation warnings from declarations coming after nested rules.
|
|
58
|
+
* Bumps the sass-loader version and adds a webpack option to suppress mixed declaration deprecation warnings to be removed when all modules are updated.
|
|
21
59
|
* Add `title` and `_url` to select all projection.
|
|
22
60
|
* Display `Select all` message on all pages in the manager modal.
|
|
23
61
|
* Refresh `checked` in manager modal after archive action.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// Upload files in 4MB chunks, well under the typical
|
|
2
|
+
// proxy server limit on POST size
|
|
3
|
+
|
|
4
|
+
const defaultChunkSize = 1024 * 1024 * 4;
|
|
5
|
+
|
|
6
|
+
// Used to upload very large files, large enough that they
|
|
7
|
+
// might exceed the max body size or max uploaded file size
|
|
8
|
+
// configured on a proxy server, etc.
|
|
9
|
+
//
|
|
10
|
+
// `options` is required and may contain a `files` object
|
|
11
|
+
// property containing HTML5 `File` objects. It will become
|
|
12
|
+
// `req.files` on the receiving end, just like with more typical
|
|
13
|
+
// file upload middleware.
|
|
14
|
+
//
|
|
15
|
+
// `qs` and `body` become `req.query` and `req.body` on the
|
|
16
|
+
// receiving end. You may use them for non-file parameters.
|
|
17
|
+
//
|
|
18
|
+
// An existing query string in `url` is NOT supported. Use `qs`.
|
|
19
|
+
//
|
|
20
|
+
// The receiving route must use the `self.apos.http.bigUploadMiddleware`
|
|
21
|
+
// function to obtain the middleware and it must be a `post` route.
|
|
22
|
+
//
|
|
23
|
+
// The query parameter `aposBigUpload` is reserved for internal use.
|
|
24
|
+
//
|
|
25
|
+
// If a `progress` function is supplied, it is periodically invoked
|
|
26
|
+
// with a proportion (between 0.0 and 1.0) as the upload progresses.
|
|
27
|
+
// Be aware the receiving end will typically do quite a bit of processing
|
|
28
|
+
// after that.
|
|
29
|
+
//
|
|
30
|
+
// If `chunkSize` is specified (in bytes) it is used instead of the usual
|
|
31
|
+
// 4MB. The chunk size should be big enough for efficiency but small
|
|
32
|
+
// enough to avoid proxy server POST limits.
|
|
33
|
+
//
|
|
34
|
+
// For testing and server-side use an `http` object and a `FormData` constructor
|
|
35
|
+
// may be specified otherwise the standard Apostrophe `apos.http` object
|
|
36
|
+
// and the browser's `FormData` are used.
|
|
37
|
+
|
|
38
|
+
module.exports = async (url, options) => {
|
|
39
|
+
const chunkSize = options.chunkSize || defaultChunkSize;
|
|
40
|
+
const http = options.http || window.apos?.http;
|
|
41
|
+
const progress = options.progress || (n => {});
|
|
42
|
+
const files = options.files || [];
|
|
43
|
+
const info = {};
|
|
44
|
+
let totalBytes = 0;
|
|
45
|
+
let sentBytes = 0;
|
|
46
|
+
for (const [ param, file ] of Object.entries(files)) {
|
|
47
|
+
totalBytes += file.size;
|
|
48
|
+
info[param] = {
|
|
49
|
+
name: file.name,
|
|
50
|
+
size: file.size,
|
|
51
|
+
chunks: Math.ceil(file.size / chunkSize)
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const { id } = await http.post(url, {
|
|
55
|
+
qs: {
|
|
56
|
+
aposBigUpload: {
|
|
57
|
+
type: 'start'
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
body: {
|
|
61
|
+
files: info
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
let n = 0;
|
|
65
|
+
for (const file of Object.values(files)) {
|
|
66
|
+
const { size } = file;
|
|
67
|
+
let chunk = 0;
|
|
68
|
+
for (let offset = 0; (offset < size); offset += chunkSize) {
|
|
69
|
+
const formData = new FormData();
|
|
70
|
+
const thisChunkSize = Math.min(chunkSize, size - offset);
|
|
71
|
+
formData.append('chunk', file.slice(offset, offset + thisChunkSize));
|
|
72
|
+
await http.post(url, {
|
|
73
|
+
qs: {
|
|
74
|
+
aposBigUpload: {
|
|
75
|
+
type: 'chunk',
|
|
76
|
+
id,
|
|
77
|
+
n,
|
|
78
|
+
chunk
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
body: formData
|
|
82
|
+
});
|
|
83
|
+
sentBytes += thisChunkSize;
|
|
84
|
+
progress(sentBytes / totalBytes);
|
|
85
|
+
chunk++;
|
|
86
|
+
}
|
|
87
|
+
n++;
|
|
88
|
+
}
|
|
89
|
+
const result = await http.post(url, {
|
|
90
|
+
qs: {
|
|
91
|
+
aposBigUpload: {
|
|
92
|
+
type: 'end',
|
|
93
|
+
id
|
|
94
|
+
},
|
|
95
|
+
...options.qs
|
|
96
|
+
},
|
|
97
|
+
body: options.body
|
|
98
|
+
});
|
|
99
|
+
return result;
|
|
100
|
+
};
|
|
@@ -107,9 +107,11 @@ export default {
|
|
|
107
107
|
:deep(.apos-admin-bar__control-set) {
|
|
108
108
|
@include type-base;
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
& {
|
|
111
|
+
display: flex;
|
|
112
|
+
width: 100%;
|
|
113
|
+
height: 100%;
|
|
114
|
+
}
|
|
113
115
|
}
|
|
114
116
|
|
|
115
117
|
.apos-admin-bar__user {
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
identifier="localePickerTrigger"
|
|
6
6
|
:button="button"
|
|
7
7
|
:unpadded="true"
|
|
8
|
+
:center-on-icon="true"
|
|
8
9
|
menu-placement="bottom-end"
|
|
9
10
|
@open="open"
|
|
10
11
|
@close="isOpen = false"
|
|
@@ -162,9 +163,11 @@ export default {
|
|
|
162
163
|
&:deep(.apos-button__label) {
|
|
163
164
|
@include type-small;
|
|
164
165
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
& {
|
|
167
|
+
color: var(--a-primary);
|
|
168
|
+
font-weight: var(--a-weight-bold);
|
|
169
|
+
letter-spacing: 1px;
|
|
170
|
+
}
|
|
168
171
|
}
|
|
169
172
|
}
|
|
170
173
|
</style>
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
class="apos-admin-user"
|
|
4
4
|
:button="button"
|
|
5
5
|
:menu="items"
|
|
6
|
+
:center-on-icon="true"
|
|
6
7
|
menu-placement="bottom-end"
|
|
7
8
|
@item-clicked="emitEvent"
|
|
8
9
|
>
|
|
@@ -57,7 +58,9 @@ export default {
|
|
|
57
58
|
:deep(.apos-button) {
|
|
58
59
|
@include type-base;
|
|
59
60
|
|
|
60
|
-
|
|
61
|
+
& {
|
|
62
|
+
color: var(--a-text-primary);
|
|
63
|
+
}
|
|
61
64
|
}
|
|
62
65
|
|
|
63
66
|
:deep(.apos-context-menu__popup) {
|
|
@@ -615,7 +615,7 @@ export default {
|
|
|
615
615
|
body: {},
|
|
616
616
|
busy: true
|
|
617
617
|
});
|
|
618
|
-
apos.notify('apostrophe:restoredPrevious', {
|
|
618
|
+
await apos.notify('apostrophe:restoredPrevious', {
|
|
619
619
|
type: 'success',
|
|
620
620
|
dismiss: true
|
|
621
621
|
});
|
|
@@ -720,14 +720,18 @@ export default {
|
|
|
720
720
|
async updateDraftIsEditable() {
|
|
721
721
|
if (this.context.aposLocale && this.context.aposLocale.endsWith('published') && !this.context._edit) {
|
|
722
722
|
// A contributor might be able to edit the draft
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
723
|
+
try {
|
|
724
|
+
const draftContext = await apos.http.get(`${this.action}/${this.context._id}`, {
|
|
725
|
+
busy: true,
|
|
726
|
+
qs: {
|
|
727
|
+
aposMode: 'draft',
|
|
728
|
+
aposLocale: this.context.aposLocale.split(':')[0]
|
|
729
|
+
}
|
|
730
|
+
});
|
|
731
|
+
this.draftIsEditable = draftContext && draftContext._edit;
|
|
732
|
+
} catch (e) {
|
|
733
|
+
console.error(e);
|
|
734
|
+
}
|
|
731
735
|
}
|
|
732
736
|
},
|
|
733
737
|
async getPublished() {
|
|
@@ -735,13 +739,17 @@ export default {
|
|
|
735
739
|
const manuallyPublished = moduleOptions.localized && !this.autopublish;
|
|
736
740
|
if (manuallyPublished && this.context.lastPublishedAt) {
|
|
737
741
|
const action = window.apos.modules[this.context.type].action;
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
742
|
+
try {
|
|
743
|
+
const doc = await apos.http.get(`${action}/${this.context._id}`, {
|
|
744
|
+
busy: true,
|
|
745
|
+
qs: {
|
|
746
|
+
aposMode: 'published'
|
|
747
|
+
}
|
|
748
|
+
});
|
|
749
|
+
return doc;
|
|
750
|
+
} catch (error) {
|
|
751
|
+
console.error(error);
|
|
752
|
+
}
|
|
745
753
|
}
|
|
746
754
|
return null;
|
|
747
755
|
},
|
|
@@ -122,11 +122,13 @@ export default {
|
|
|
122
122
|
.apos-admin-bar__status {
|
|
123
123
|
@include type-help;
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
& {
|
|
126
|
+
position: relative;
|
|
127
|
+
margin-left: 7.5px;
|
|
128
|
+
opacity: 1;
|
|
129
|
+
color: var(--a-base-2);
|
|
130
|
+
transition: opacity 200ms;
|
|
131
|
+
}
|
|
130
132
|
|
|
131
133
|
&.apos-is-hidden {
|
|
132
134
|
opacity: 0;
|
|
@@ -294,12 +294,15 @@ module.exports = {
|
|
|
294
294
|
// options to sanitize against. Thus h5 can be legal
|
|
295
295
|
// in one rich text widget and not in another.
|
|
296
296
|
//
|
|
297
|
+
// The `convertOptions` parameter allows to pass options
|
|
298
|
+
// to the convert method to alter them.
|
|
299
|
+
//
|
|
297
300
|
// If any errors occur sanitizing the individual widgets,
|
|
298
301
|
// an array of errors with `path` and `error` properties
|
|
299
302
|
// is thrown.
|
|
300
303
|
//
|
|
301
304
|
// Returns a new array of sanitized items.
|
|
302
|
-
async sanitizeItems(req, items, options) {
|
|
305
|
+
async sanitizeItems(req, items, options, convertOptions = {}) {
|
|
303
306
|
options = options || {};
|
|
304
307
|
const result = [];
|
|
305
308
|
const errors = [];
|
|
@@ -322,7 +325,7 @@ module.exports = {
|
|
|
322
325
|
}
|
|
323
326
|
let newItem;
|
|
324
327
|
try {
|
|
325
|
-
newItem = await manager.sanitize(req, item, widgetOptions);
|
|
328
|
+
newItem = await manager.sanitize(req, item, widgetOptions, convertOptions);
|
|
326
329
|
newItem._id = self.apos.launder.id(item._id) || self.apos.util.generateId();
|
|
327
330
|
} catch (e) {
|
|
328
331
|
if (Array.isArray(e)) {
|
|
@@ -299,10 +299,12 @@ export default {
|
|
|
299
299
|
@include apos-button-reset();
|
|
300
300
|
@include type-base;
|
|
301
301
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
302
|
+
& {
|
|
303
|
+
box-sizing: border-box;
|
|
304
|
+
width: 100%;
|
|
305
|
+
padding: 5px 20px;
|
|
306
|
+
color: var(--a-base-1);
|
|
307
|
+
}
|
|
306
308
|
|
|
307
309
|
&:hover,
|
|
308
310
|
&:focus {
|
|
@@ -335,11 +337,13 @@ export default {
|
|
|
335
337
|
.apos-area-menu__group-label {
|
|
336
338
|
@include apos-button-reset();
|
|
337
339
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
340
|
+
& {
|
|
341
|
+
display: flex;
|
|
342
|
+
box-sizing: border-box;
|
|
343
|
+
justify-content: space-between;
|
|
344
|
+
width: 100%;
|
|
345
|
+
padding: 10px 20px;
|
|
346
|
+
}
|
|
343
347
|
|
|
344
348
|
&:hover {
|
|
345
349
|
cursor: pointer;
|
|
@@ -354,7 +358,9 @@ export default {
|
|
|
354
358
|
.apos-area-menu__group-chevron {
|
|
355
359
|
@include apos-transition();
|
|
356
360
|
|
|
357
|
-
|
|
361
|
+
& {
|
|
362
|
+
transform: rotate(90deg);
|
|
363
|
+
}
|
|
358
364
|
}
|
|
359
365
|
|
|
360
366
|
.apos-area-menu__group-chevron.apos-is-active {
|
|
@@ -375,8 +381,10 @@ export default {
|
|
|
375
381
|
.apos-area-menu__items--accordion {
|
|
376
382
|
@include apos-transition($duration:0.3s);
|
|
377
383
|
|
|
378
|
-
|
|
379
|
-
|
|
384
|
+
& {
|
|
385
|
+
overflow: hidden;
|
|
386
|
+
max-height: 0;
|
|
387
|
+
}
|
|
380
388
|
}
|
|
381
389
|
|
|
382
390
|
.apos-area-menu__items--accordion.apos-is-active {
|
|
@@ -256,10 +256,12 @@ export default {
|
|
|
256
256
|
.apos-widget {
|
|
257
257
|
@include type-base;
|
|
258
258
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
259
|
+
& {
|
|
260
|
+
padding: 0;
|
|
261
|
+
border: none;
|
|
262
|
+
background: none;
|
|
263
|
+
text-align: inherit;
|
|
264
|
+
}
|
|
263
265
|
|
|
264
266
|
.apos-widget__preview {
|
|
265
267
|
transition: opacity 250ms ease-in-out;
|
|
@@ -316,9 +318,11 @@ export default {
|
|
|
316
318
|
.apos-widget__help {
|
|
317
319
|
@include type-base;
|
|
318
320
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
321
|
+
& {
|
|
322
|
+
margin-top: 0;
|
|
323
|
+
line-height: var(--a-line-tall);
|
|
324
|
+
text-align: left;
|
|
325
|
+
}
|
|
322
326
|
}
|
|
323
327
|
|
|
324
328
|
.apos-widget__help {
|
|
@@ -118,10 +118,12 @@ export default {
|
|
|
118
118
|
@include apos-button-reset();
|
|
119
119
|
@include type-base;
|
|
120
120
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
& {
|
|
122
|
+
box-sizing: border-box;
|
|
123
|
+
width: 100%;
|
|
124
|
+
padding: 5px 20px;
|
|
125
|
+
color: var(--a-base-1);
|
|
126
|
+
}
|
|
125
127
|
|
|
126
128
|
&:hover,
|
|
127
129
|
&:focus {
|
|
@@ -154,11 +156,13 @@ export default {
|
|
|
154
156
|
.apos-area-menu__group-label {
|
|
155
157
|
@include apos-button-reset();
|
|
156
158
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
& {
|
|
160
|
+
display: flex;
|
|
161
|
+
box-sizing: border-box;
|
|
162
|
+
justify-content: space-between;
|
|
163
|
+
width: 100%;
|
|
164
|
+
padding: 10px 20px;
|
|
165
|
+
}
|
|
162
166
|
|
|
163
167
|
&:hover {
|
|
164
168
|
cursor: pointer;
|
|
@@ -173,7 +177,9 @@ export default {
|
|
|
173
177
|
.apos-area-menu__group-chevron {
|
|
174
178
|
@include apos-transition();
|
|
175
179
|
|
|
176
|
-
|
|
180
|
+
& {
|
|
181
|
+
transform: rotate(90deg);
|
|
182
|
+
}
|
|
177
183
|
}
|
|
178
184
|
|
|
179
185
|
.apos-area-menu__group-chevron.apos-is-active {
|
|
@@ -194,8 +200,10 @@ export default {
|
|
|
194
200
|
.apos-area-menu__items--accordion {
|
|
195
201
|
@include apos-transition($duration:0.3s);
|
|
196
202
|
|
|
197
|
-
|
|
198
|
-
|
|
203
|
+
& {
|
|
204
|
+
overflow: hidden;
|
|
205
|
+
max-height: 0;
|
|
206
|
+
}
|
|
199
207
|
}
|
|
200
208
|
|
|
201
209
|
.apos-area-menu__items--accordion.apos-is-active {
|
|
@@ -785,23 +785,27 @@ export default {
|
|
|
785
785
|
.apos-area-widget__breadcrumbs {
|
|
786
786
|
@include apos-list-reset();
|
|
787
787
|
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
788
|
+
& {
|
|
789
|
+
display: flex;
|
|
790
|
+
align-items: center;
|
|
791
|
+
margin: 0 0 8px;
|
|
792
|
+
padding: 4px 6px;
|
|
793
|
+
background-color: var(--a-background-primary);
|
|
794
|
+
border: 1px solid var(--a-primary-transparent-50);
|
|
795
|
+
border-radius: 8px;
|
|
796
|
+
}
|
|
795
797
|
}
|
|
796
798
|
|
|
797
799
|
.apos-area-widget__breadcrumb,
|
|
798
800
|
.apos-area-widget__breadcrumb :deep(.apos-button__content) {
|
|
799
801
|
@include type-help;
|
|
800
802
|
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
803
|
+
& {
|
|
804
|
+
padding: 2px;
|
|
805
|
+
white-space: nowrap;
|
|
806
|
+
color: var(--a-base-1);
|
|
807
|
+
transition: background-color 300ms var(--a-transition-timing-bounce);
|
|
808
|
+
}
|
|
805
809
|
}
|
|
806
810
|
|
|
807
811
|
.apos-area-widget__breadcrumbs:hover .apos-area-widget__breadcrumb,
|
|
@@ -278,7 +278,8 @@ module.exports = {
|
|
|
278
278
|
if (correctedExtensions) {
|
|
279
279
|
const message = req.t('apostrophe:fileTypeNotAccepted', {
|
|
280
280
|
// i18next has no built-in support for interpolating an array argument
|
|
281
|
-
extensions: correctedExtensions.join(req.t('apostrophe:listJoiner'))
|
|
281
|
+
extensions: correctedExtensions.join(req.t('apostrophe:listJoiner')),
|
|
282
|
+
extension: dbInfo.extension
|
|
282
283
|
});
|
|
283
284
|
throw self.apos.error('invalid', message);
|
|
284
285
|
}
|
|
@@ -398,7 +399,8 @@ module.exports = {
|
|
|
398
399
|
if (!group) {
|
|
399
400
|
const accepted = _.union(_.map(self.fileGroups, 'extensions')).flat();
|
|
400
401
|
throw self.apos.error('invalid', req.t('apostrophe:fileTypeNotAccepted', {
|
|
401
|
-
extensions: accepted.join(req.t('apostrophe:listJoiner'))
|
|
402
|
+
extensions: accepted.join(req.t('apostrophe:listJoiner')),
|
|
403
|
+
extension
|
|
402
404
|
}));
|
|
403
405
|
}
|
|
404
406
|
|
|
@@ -58,21 +58,23 @@ export default {
|
|
|
58
58
|
.apos-command-menu-key {
|
|
59
59
|
@include type-small;
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
61
|
+
& {
|
|
62
|
+
display: inline-flex;
|
|
63
|
+
box-sizing: border-box;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
width: $spacing-double;
|
|
67
|
+
height: $spacing-double;
|
|
68
|
+
margin-left: $spacing-half;
|
|
69
|
+
padding: 3px $spacing-half;
|
|
70
|
+
border: 1px solid var(--a-base-7);
|
|
71
|
+
border-bottom: 2px solid var(--a-base-7);
|
|
72
|
+
color: var(--a-base-1);
|
|
73
|
+
background: linear-gradient(180deg, var(--a-base-10) 0%, var(--a-base-9) 100%);
|
|
74
|
+
border-radius: 3px;
|
|
75
|
+
border-color: var(--a-base-7);
|
|
76
|
+
font-weight: 600;
|
|
77
|
+
}
|
|
76
78
|
|
|
77
79
|
&.apos-command-menu-key-auto {
|
|
78
80
|
width: auto;
|
|
@@ -82,15 +84,17 @@ export default {
|
|
|
82
84
|
.apos-command-menu-text {
|
|
83
85
|
@include type-small;
|
|
84
86
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
& {
|
|
88
|
+
display: inline-flex;
|
|
89
|
+
box-sizing: border-box;
|
|
90
|
+
align-items: center;
|
|
91
|
+
justify-content: center;
|
|
92
|
+
width: auto;
|
|
93
|
+
height: $spacing-double;
|
|
94
|
+
margin-left: $spacing-half;
|
|
95
|
+
padding: 3px 2px;
|
|
96
|
+
color: var(--a-base-1);
|
|
97
|
+
}
|
|
94
98
|
}
|
|
95
99
|
|
|
96
100
|
</style>
|