@elementor/editor-global-classes 3.32.0-38 → 3.32.0-39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/capabilities.ts +1 -1
- package/src/sync-with-document-save.ts +10 -0
package/dist/index.js
CHANGED
|
@@ -1929,6 +1929,7 @@ function PopulateStore() {
|
|
|
1929
1929
|
}
|
|
1930
1930
|
|
|
1931
1931
|
// src/sync-with-document-save.ts
|
|
1932
|
+
var import_editor_current_user2 = require("@elementor/editor-current-user");
|
|
1932
1933
|
var import_editor_documents6 = require("@elementor/editor-documents");
|
|
1933
1934
|
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
1934
1935
|
var import_store22 = require("@elementor/store");
|
|
@@ -1947,6 +1948,11 @@ function syncDirtyState() {
|
|
|
1947
1948
|
}
|
|
1948
1949
|
function bindSaveAction() {
|
|
1949
1950
|
(0, import_editor_v1_adapters4.registerDataHook)("after", "document/save/save", (args) => {
|
|
1951
|
+
const user = (0, import_editor_current_user2.getCurrentUser)();
|
|
1952
|
+
const canEdit = user?.capabilities.includes(UPDATE_CLASS_CAPABILITY_KEY);
|
|
1953
|
+
if (!canEdit) {
|
|
1954
|
+
return;
|
|
1955
|
+
}
|
|
1950
1956
|
return saveGlobalClasses({
|
|
1951
1957
|
context: args.status === "publish" ? "frontend" : "preview"
|
|
1952
1958
|
});
|