@elementor/editor-controls 4.4.0-1124 → 4.4.0-1126
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 +8 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -16
- package/src/controls/notice-control.tsx +11 -1
package/dist/index.js
CHANGED
|
@@ -10874,9 +10874,16 @@ var markNoticeAsDismissedInSession = (dismissId) => {
|
|
|
10874
10874
|
dismissedNotices.push(dismissId);
|
|
10875
10875
|
}
|
|
10876
10876
|
};
|
|
10877
|
+
var isNoticeDismissed = (dismissId) => {
|
|
10878
|
+
if (!dismissId) {
|
|
10879
|
+
return false;
|
|
10880
|
+
}
|
|
10881
|
+
const dismissedNotices = window.elementor?.config?.user?.dismissed_editor_notices;
|
|
10882
|
+
return !!dismissedNotices?.includes(dismissId);
|
|
10883
|
+
};
|
|
10877
10884
|
var NoticeControl = createControl(
|
|
10878
10885
|
({ noticeType = "info", heading, content, dismissible, buttonText, buttonUrl }) => {
|
|
10879
|
-
const [isDismissed, setIsDismissed] = (0, import_react77.useState)(
|
|
10886
|
+
const [isDismissed, setIsDismissed] = (0, import_react77.useState)(() => isNoticeDismissed(dismissible));
|
|
10880
10887
|
if (isDismissed || !content) {
|
|
10881
10888
|
return null;
|
|
10882
10889
|
}
|