@elementor/editor-responsive 0.10.6 → 0.11.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/CHANGELOG.md +6 -0
- package/dist/index.d.mts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +57 -237
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -236
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -7
- package/src/hooks/__tests__/{use-breakpoints-actions.test.tsx → use-activate-breakpoint.test.ts} +5 -5
- package/src/hooks/__tests__/use-active-breakpoint.test.ts +50 -0
- package/src/hooks/__tests__/use-breakpoints.test.ts +90 -0
- package/src/hooks/use-activate-breakpoint.ts +9 -0
- package/src/hooks/use-active-breakpoint.ts +12 -0
- package/src/hooks/use-breakpoints.ts +46 -8
- package/src/index.ts +4 -2
- package/src/types.ts +16 -27
- package/src/components/__tests__/breakpoints-switcher.test.tsx +0 -125
- package/src/components/breakpoints-switcher.tsx +0 -113
- package/src/hooks/__tests__/use-breakpoints.test.tsx +0 -84
- package/src/hooks/use-breakpoints-actions.ts +0 -13
- package/src/init.ts +0 -27
- package/src/store/index.ts +0 -46
- package/src/store/selectors.ts +0 -27
- package/src/sync/__tests__/sync-store.test.ts +0 -162
- package/src/sync/sync-store.ts +0 -70
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.11.0](https://github.com/elementor/elementor-packages/compare/@elementor/editor-responsive@0.10.6...@elementor/editor-responsive@0.11.0) (2024-07-18)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **editor-responsive:** separate data and ui [EDS-272] ([#206](https://github.com/elementor/elementor-packages/issues/206)) ([a5a24cc](https://github.com/elementor/elementor-packages/commit/a5a24cc8abed5f5a9b1523436e1c63f24a202198))
|
|
11
|
+
|
|
6
12
|
## [0.10.6](https://github.com/elementor/elementor-packages/compare/@elementor/editor-responsive@0.10.5...@elementor/editor-responsive@0.10.6) (2024-07-16)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @elementor/editor-responsive
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,17 @@
|
|
|
1
|
+
type BreakpointId = 'widescreen' | 'desktop' | 'laptop' | 'tablet_extra' | 'tablet' | 'mobile_extra' | 'mobile';
|
|
2
|
+
type BreakpointSize = number;
|
|
3
|
+
type BreakpointLabel = string;
|
|
4
|
+
type Breakpoint = {
|
|
5
|
+
id: BreakpointId;
|
|
6
|
+
label: BreakpointLabel;
|
|
7
|
+
width?: BreakpointSize;
|
|
8
|
+
type?: 'min-width' | 'max-width';
|
|
9
|
+
};
|
|
1
10
|
|
|
2
|
-
|
|
11
|
+
declare function useBreakpoints(): Breakpoint[];
|
|
12
|
+
|
|
13
|
+
declare function useActiveBreakpoint(): BreakpointId | null;
|
|
14
|
+
|
|
15
|
+
declare function useActivateBreakpoint(): (breakpoint: BreakpointId) => Promise<any>;
|
|
16
|
+
|
|
17
|
+
export { Breakpoint, BreakpointId, BreakpointSize, useActivateBreakpoint, useActiveBreakpoint, useBreakpoints };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,17 @@
|
|
|
1
|
+
type BreakpointId = 'widescreen' | 'desktop' | 'laptop' | 'tablet_extra' | 'tablet' | 'mobile_extra' | 'mobile';
|
|
2
|
+
type BreakpointSize = number;
|
|
3
|
+
type BreakpointLabel = string;
|
|
4
|
+
type Breakpoint = {
|
|
5
|
+
id: BreakpointId;
|
|
6
|
+
label: BreakpointLabel;
|
|
7
|
+
width?: BreakpointSize;
|
|
8
|
+
type?: 'min-width' | 'max-width';
|
|
9
|
+
};
|
|
1
10
|
|
|
2
|
-
|
|
11
|
+
declare function useBreakpoints(): Breakpoint[];
|
|
12
|
+
|
|
13
|
+
declare function useActiveBreakpoint(): BreakpointId | null;
|
|
14
|
+
|
|
15
|
+
declare function useActivateBreakpoint(): (breakpoint: BreakpointId) => Promise<any>;
|
|
16
|
+
|
|
17
|
+
export { Breakpoint, BreakpointId, BreakpointSize, useActivateBreakpoint, useActiveBreakpoint, useBreakpoints };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
8
10
|
var __copyProps = (to, from, except, desc) => {
|
|
9
11
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
12
|
for (let key of __getOwnPropNames(from))
|
|
@@ -13,262 +15,80 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
13
15
|
}
|
|
14
16
|
return to;
|
|
15
17
|
};
|
|
16
|
-
var
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
19
|
|
|
25
|
-
// src/
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var slice = (0, import_store.__createSlice)({
|
|
32
|
-
name: "breakpoints",
|
|
33
|
-
initialState,
|
|
34
|
-
reducers: {
|
|
35
|
-
init(state, action) {
|
|
36
|
-
state.activeId = action.payload.activeId;
|
|
37
|
-
state.entities = normalizeEntities(action.payload.entities);
|
|
38
|
-
},
|
|
39
|
-
activateBreakpoint(state, action) {
|
|
40
|
-
if (state.entities[action.payload]) {
|
|
41
|
-
state.activeId = action.payload;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
useActivateBreakpoint: () => useActivateBreakpoint,
|
|
24
|
+
useActiveBreakpoint: () => useActiveBreakpoint,
|
|
25
|
+
useBreakpoints: () => useBreakpoints
|
|
45
26
|
});
|
|
46
|
-
|
|
47
|
-
return entities.reduce(
|
|
48
|
-
(acc, breakpoint) => {
|
|
49
|
-
return {
|
|
50
|
-
...acc,
|
|
51
|
-
[breakpoint.id]: breakpoint
|
|
52
|
-
};
|
|
53
|
-
},
|
|
54
|
-
{}
|
|
55
|
-
);
|
|
56
|
-
}
|
|
27
|
+
module.exports = __toCommonJS(src_exports);
|
|
57
28
|
|
|
58
|
-
// src/
|
|
59
|
-
var import_store3 = require("@elementor/store");
|
|
60
|
-
var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
29
|
+
// src/hooks/use-breakpoints.ts
|
|
61
30
|
var import_i18n = require("@wordpress/i18n");
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
function syncInitialization() {
|
|
67
|
-
const { init: init2 } = slice.actions;
|
|
68
|
-
(0, import_editor_v1_adapters.__privateListenTo)((0, import_editor_v1_adapters.v1ReadyEvent)(), () => {
|
|
69
|
-
(0, import_store3.__dispatch)(
|
|
70
|
-
init2({
|
|
71
|
-
entities: getBreakpoints(),
|
|
72
|
-
activeId: getActiveBreakpoint()
|
|
73
|
-
})
|
|
74
|
-
);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
function syncOnChange() {
|
|
78
|
-
const { activateBreakpoint } = slice.actions;
|
|
79
|
-
(0, import_editor_v1_adapters.__privateListenTo)(deviceModeChangeEvent(), () => {
|
|
80
|
-
const activeBreakpoint = getActiveBreakpoint();
|
|
81
|
-
(0, import_store3.__dispatch)(activateBreakpoint(activeBreakpoint));
|
|
82
|
-
});
|
|
31
|
+
var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
32
|
+
function useBreakpoints() {
|
|
33
|
+
return (0, import_editor_v1_adapters.__privateUseListenTo)((0, import_editor_v1_adapters.v1ReadyEvent)(), getBreakpoints);
|
|
83
34
|
}
|
|
84
35
|
function getBreakpoints() {
|
|
85
36
|
const { breakpoints } = window.elementor?.config?.responsive || {};
|
|
86
|
-
if (!breakpoints) {
|
|
37
|
+
if (!breakpoints || Object.entries(breakpoints).length === 0) {
|
|
87
38
|
return [];
|
|
88
39
|
}
|
|
89
|
-
const
|
|
90
|
-
|
|
40
|
+
const minWidth = [];
|
|
41
|
+
const maxWidth = [];
|
|
42
|
+
const defaults = [
|
|
43
|
+
// Desktop breakpoint is not included in V1 config.
|
|
44
|
+
{ id: "desktop", label: (0, import_i18n.__)("Desktop", "elementor") }
|
|
45
|
+
];
|
|
46
|
+
Object.entries(breakpoints).forEach(([id, v1Breakpoint]) => {
|
|
47
|
+
if (!v1Breakpoint.is_enabled) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const breakpoint = {
|
|
91
51
|
id,
|
|
92
|
-
label,
|
|
93
|
-
width: value,
|
|
94
|
-
type: direction === "min" ? "min-width" : "max-width"
|
|
52
|
+
label: v1Breakpoint.label,
|
|
53
|
+
width: v1Breakpoint.value,
|
|
54
|
+
type: v1Breakpoint.direction === "min" ? "min-width" : "max-width"
|
|
95
55
|
};
|
|
56
|
+
if (!breakpoint.width) {
|
|
57
|
+
defaults.push(breakpoint);
|
|
58
|
+
} else if (breakpoint.type === "min-width") {
|
|
59
|
+
minWidth.push(breakpoint);
|
|
60
|
+
} else if (breakpoint.type === "max-width") {
|
|
61
|
+
maxWidth.push(breakpoint);
|
|
62
|
+
}
|
|
96
63
|
});
|
|
97
|
-
entities.push({
|
|
98
|
-
id: "desktop",
|
|
99
|
-
label: (0, import_i18n.__)("Desktop", "elementor")
|
|
100
|
-
});
|
|
101
|
-
return entities;
|
|
102
|
-
}
|
|
103
|
-
function getActiveBreakpoint() {
|
|
104
|
-
const extendedWindow = window;
|
|
105
|
-
return extendedWindow.elementor?.channels?.deviceMode?.request?.("currentMode") || null;
|
|
106
|
-
}
|
|
107
|
-
function deviceModeChangeEvent() {
|
|
108
|
-
return (0, import_editor_v1_adapters.windowEvent)("elementor/device-mode/change");
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// src/init.ts
|
|
112
|
-
var import_editor_app_bar = require("@elementor/editor-app-bar");
|
|
113
|
-
|
|
114
|
-
// src/components/breakpoints-switcher.tsx
|
|
115
|
-
var React = __toESM(require("react"));
|
|
116
|
-
var import_i18n2 = require("@wordpress/i18n");
|
|
117
|
-
|
|
118
|
-
// src/hooks/use-breakpoints.ts
|
|
119
|
-
var import_store5 = require("@elementor/store");
|
|
120
|
-
|
|
121
|
-
// src/store/selectors.ts
|
|
122
|
-
var import_store4 = require("@elementor/store");
|
|
123
|
-
var selectEntities = (state) => state.breakpoints.entities;
|
|
124
|
-
var selectActiveId = (state) => state.breakpoints.activeId;
|
|
125
|
-
var selectActiveBreakpoint = (0, import_store4.__createSelector)(
|
|
126
|
-
selectEntities,
|
|
127
|
-
selectActiveId,
|
|
128
|
-
(entities, activeId) => activeId && entities[activeId] ? entities[activeId] : null
|
|
129
|
-
);
|
|
130
|
-
var selectSortedBreakpoints = (0, import_store4.__createSelector)(selectEntities, (entities) => {
|
|
131
64
|
const byWidth = (a, b) => {
|
|
132
65
|
return a.width && b.width ? b.width - a.width : 0;
|
|
133
66
|
};
|
|
134
|
-
const all = Object.values(entities);
|
|
135
|
-
const defaults = all.filter((breakpoint) => !breakpoint.width);
|
|
136
|
-
const minWidth = all.filter((breakpoint) => breakpoint.type === "min-width");
|
|
137
|
-
const maxWidth = all.filter((breakpoint) => breakpoint.type === "max-width");
|
|
138
67
|
return [...minWidth.sort(byWidth), ...defaults, ...maxWidth.sort(byWidth)];
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
// src/hooks/use-breakpoints.ts
|
|
142
|
-
function useBreakpoints() {
|
|
143
|
-
const all = (0, import_store5.__useSelector)(selectSortedBreakpoints);
|
|
144
|
-
const active = (0, import_store5.__useSelector)(selectActiveBreakpoint);
|
|
145
|
-
return {
|
|
146
|
-
all,
|
|
147
|
-
active
|
|
148
|
-
};
|
|
149
68
|
}
|
|
150
69
|
|
|
151
|
-
// src/
|
|
152
|
-
var import_ui = require("@elementor/ui");
|
|
153
|
-
var import_icons = require("@elementor/icons");
|
|
154
|
-
|
|
155
|
-
// src/hooks/use-breakpoints-actions.ts
|
|
156
|
-
var import_react = require("react");
|
|
70
|
+
// src/hooks/use-active-breakpoint.ts
|
|
157
71
|
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
158
|
-
function
|
|
159
|
-
|
|
160
|
-
return (0, import_editor_v1_adapters2.__privateRunCommand)("panel/change-device-mode", { device });
|
|
161
|
-
}, []);
|
|
162
|
-
return {
|
|
163
|
-
activate
|
|
164
|
-
};
|
|
72
|
+
function useActiveBreakpoint() {
|
|
73
|
+
return (0, import_editor_v1_adapters2.__privateUseListenTo)((0, import_editor_v1_adapters2.windowEvent)("elementor/device-mode/change"), getActiveBreakpoint);
|
|
165
74
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
const { all, active } = useBreakpoints();
|
|
170
|
-
const { activate } = useBreakpointsActions();
|
|
171
|
-
if (!all.length || !active) {
|
|
172
|
-
return null;
|
|
173
|
-
}
|
|
174
|
-
const onChange = (_, value) => {
|
|
175
|
-
const extendedWindow = window;
|
|
176
|
-
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
177
|
-
if (config) {
|
|
178
|
-
extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.responsiveControls, {
|
|
179
|
-
location: config.locations.topBar,
|
|
180
|
-
secondaryLocation: config.secondaryLocations.responsiveControls,
|
|
181
|
-
trigger: config.triggers.click,
|
|
182
|
-
element: config.elements.buttonIcon,
|
|
183
|
-
mode: value
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
activate(value);
|
|
187
|
-
};
|
|
188
|
-
return /* @__PURE__ */ React.createElement(
|
|
189
|
-
import_ui.Tabs,
|
|
190
|
-
{
|
|
191
|
-
textColor: "inherit",
|
|
192
|
-
indicatorColor: "secondary",
|
|
193
|
-
value: active.id,
|
|
194
|
-
onChange,
|
|
195
|
-
"aria-label": (0, import_i18n2.__)("Switch Device", "elementor"),
|
|
196
|
-
sx: {
|
|
197
|
-
"& .MuiTabs-indicator": {
|
|
198
|
-
backgroundColor: "text.primary"
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
all.map(({ id, label, type, width }) => {
|
|
203
|
-
const Icon = iconsMap[id];
|
|
204
|
-
const title = labelsMap[type || "default"].replace("%s", label).replace("%d", width?.toString() || "");
|
|
205
|
-
return /* @__PURE__ */ React.createElement(
|
|
206
|
-
import_ui.Tab,
|
|
207
|
-
{
|
|
208
|
-
value: id,
|
|
209
|
-
key: id,
|
|
210
|
-
"aria-label": title,
|
|
211
|
-
icon: /* @__PURE__ */ React.createElement(Tooltip, { title }, /* @__PURE__ */ React.createElement(Icon, null)),
|
|
212
|
-
sx: { minWidth: "auto" },
|
|
213
|
-
"data-testid": `switch-device-to-${id}`
|
|
214
|
-
}
|
|
215
|
-
);
|
|
216
|
-
})
|
|
217
|
-
);
|
|
218
|
-
}
|
|
219
|
-
function Tooltip(props) {
|
|
220
|
-
return /* @__PURE__ */ React.createElement(
|
|
221
|
-
import_ui.Tooltip,
|
|
222
|
-
{
|
|
223
|
-
PopperProps: {
|
|
224
|
-
sx: {
|
|
225
|
-
"&.MuiTooltip-popper .MuiTooltip-tooltip.MuiTooltip-tooltipPlacementBottom": {
|
|
226
|
-
mt: 2.5
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
},
|
|
230
|
-
...props
|
|
231
|
-
}
|
|
232
|
-
);
|
|
75
|
+
function getActiveBreakpoint() {
|
|
76
|
+
const extendedWindow = window;
|
|
77
|
+
return extendedWindow.elementor?.channels?.deviceMode?.request?.("currentMode") || null;
|
|
233
78
|
}
|
|
234
|
-
var iconsMap = {
|
|
235
|
-
widescreen: import_icons.WidescreenIcon,
|
|
236
|
-
desktop: import_icons.DesktopIcon,
|
|
237
|
-
laptop: import_icons.LaptopIcon,
|
|
238
|
-
tablet_extra: import_icons.TabletLandscapeIcon,
|
|
239
|
-
tablet: import_icons.TabletPortraitIcon,
|
|
240
|
-
mobile_extra: import_icons.MobileLandscapeIcon,
|
|
241
|
-
mobile: import_icons.MobilePortraitIcon
|
|
242
|
-
};
|
|
243
|
-
var labelsMap = {
|
|
244
|
-
default: "%s",
|
|
245
|
-
// translators: %s: Breakpoint label, %d: Breakpoint size.
|
|
246
|
-
"min-width": (0, import_i18n2.__)("%s (%dpx and up)", "elementor"),
|
|
247
|
-
// translators: %s: Breakpoint label, %d: Breakpoint size.
|
|
248
|
-
"max-width": (0, import_i18n2.__)("%s (up to %dpx)", "elementor")
|
|
249
|
-
};
|
|
250
79
|
|
|
251
|
-
// src/
|
|
252
|
-
var
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
(0, import_store7.__registerSlice)(slice);
|
|
259
|
-
syncStore();
|
|
260
|
-
}
|
|
261
|
-
function registerAppBarUI() {
|
|
262
|
-
(0, import_editor_app_bar.injectIntoResponsive)({
|
|
263
|
-
id: "responsive-breakpoints-switcher",
|
|
264
|
-
component: BreakpointsSwitcher,
|
|
265
|
-
options: {
|
|
266
|
-
priority: 20
|
|
267
|
-
// After document indication.
|
|
268
|
-
}
|
|
269
|
-
});
|
|
80
|
+
// src/hooks/use-activate-breakpoint.ts
|
|
81
|
+
var import_react = require("react");
|
|
82
|
+
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
83
|
+
function useActivateBreakpoint() {
|
|
84
|
+
return (0, import_react.useCallback)((breakpoint) => {
|
|
85
|
+
return (0, import_editor_v1_adapters3.__privateRunCommand)("panel/change-device-mode", { device: breakpoint });
|
|
86
|
+
}, []);
|
|
270
87
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
88
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
89
|
+
0 && (module.exports = {
|
|
90
|
+
useActivateBreakpoint,
|
|
91
|
+
useActiveBreakpoint,
|
|
92
|
+
useBreakpoints
|
|
93
|
+
});
|
|
274
94
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/store/index.ts","../src/sync/sync-store.ts","../src/init.ts","../src/components/breakpoints-switcher.tsx","../src/hooks/use-breakpoints.ts","../src/store/selectors.ts","../src/hooks/use-breakpoints-actions.ts","../src/index.ts"],"sourcesContent":["import { __createSlice, PayloadAction } from '@elementor/store';\nimport { Breakpoint, BreakpointId } from '../types';\n\nexport type State = {\n\tentities: Record< BreakpointId, Breakpoint >;\n\tactiveId: BreakpointId | null;\n};\nconst initialState: State = {\n\tentities: {} as State[ 'entities' ],\n\tactiveId: null,\n};\n\nexport const slice = __createSlice( {\n\tname: 'breakpoints',\n\tinitialState,\n\treducers: {\n\t\tinit(\n\t\t\tstate,\n\t\t\taction: PayloadAction< {\n\t\t\t\tentities: Breakpoint[];\n\t\t\t\tactiveId: State[ 'activeId' ];\n\t\t\t} >\n\t\t) {\n\t\t\tstate.activeId = action.payload.activeId;\n\t\t\tstate.entities = normalizeEntities( action.payload.entities );\n\t\t},\n\n\t\tactivateBreakpoint( state, action: PayloadAction< BreakpointId > ) {\n\t\t\tif ( state.entities[ action.payload ] ) {\n\t\t\t\tstate.activeId = action.payload;\n\t\t\t}\n\t\t},\n\t},\n} );\n\nfunction normalizeEntities( entities: Breakpoint[] ) {\n\treturn entities.reduce(\n\t\t( acc, breakpoint ) => {\n\t\t\treturn {\n\t\t\t\t...acc,\n\t\t\t\t[ breakpoint.id ]: breakpoint,\n\t\t\t};\n\t\t},\n\t\t{} as State[ 'entities' ]\n\t);\n}\n","import { slice } from '../store';\nimport { __dispatch } from '@elementor/store';\nimport { Breakpoint, ExtendedWindow } from '../types';\nimport { __privateListenTo as listenTo, v1ReadyEvent, windowEvent } from '@elementor/editor-v1-adapters';\nimport { __ } from '@wordpress/i18n';\n\nexport default function syncStore() {\n\tsyncInitialization();\n\tsyncOnChange();\n}\n\nfunction syncInitialization() {\n\tconst { init } = slice.actions;\n\n\tlistenTo( v1ReadyEvent(), () => {\n\t\t__dispatch(\n\t\t\tinit( {\n\t\t\t\tentities: getBreakpoints(),\n\t\t\t\tactiveId: getActiveBreakpoint(),\n\t\t\t} )\n\t\t);\n\t} );\n}\n\nfunction syncOnChange() {\n\tconst { activateBreakpoint } = slice.actions;\n\n\tlistenTo( deviceModeChangeEvent(), () => {\n\t\tconst activeBreakpoint = getActiveBreakpoint();\n\n\t\t__dispatch( activateBreakpoint( activeBreakpoint ) );\n\t} );\n}\n\nfunction getBreakpoints() {\n\tconst { breakpoints } = ( window as unknown as ExtendedWindow ).elementor?.config?.responsive || {};\n\n\tif ( ! breakpoints ) {\n\t\treturn [];\n\t}\n\n\tconst entities = Object.entries( breakpoints )\n\t\t.filter( ( [ , breakpoint ] ) => breakpoint.is_enabled )\n\t\t.map( ( [ id, { value, direction, label } ] ) => {\n\t\t\treturn {\n\t\t\t\tid,\n\t\t\t\tlabel,\n\t\t\t\twidth: value,\n\t\t\t\ttype: direction === 'min' ? 'min-width' : 'max-width',\n\t\t\t} as Breakpoint;\n\t\t} );\n\n\t// Desktop breakpoint is not included in V1 config.\n\tentities.push( {\n\t\tid: 'desktop',\n\t\tlabel: __( 'Desktop', 'elementor' ),\n\t} );\n\n\treturn entities;\n}\n\nfunction getActiveBreakpoint() {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn extendedWindow.elementor?.channels?.deviceMode?.request?.( 'currentMode' ) || null;\n}\n\nfunction deviceModeChangeEvent() {\n\treturn windowEvent( 'elementor/device-mode/change' );\n}\n","import { slice } from './store';\nimport syncStore from './sync/sync-store';\nimport { injectIntoResponsive } from '@elementor/editor-app-bar';\nimport BreakpointsSwitcher from './components/breakpoints-switcher';\nimport { __registerSlice } from '@elementor/store';\n\nexport default function init() {\n\tinitStore();\n\n\tregisterAppBarUI();\n}\n\nfunction initStore() {\n\t__registerSlice( slice );\n\n\tsyncStore();\n}\n\nfunction registerAppBarUI() {\n\tinjectIntoResponsive( {\n\t\tid: 'responsive-breakpoints-switcher',\n\t\tcomponent: BreakpointsSwitcher,\n\t\toptions: {\n\t\t\tpriority: 20, // After document indication.\n\t\t},\n\t} );\n}\n","import * as React from 'react';\nimport { __ } from '@wordpress/i18n';\nimport { BreakpointId, ExtendedWindow } from '../types';\nimport useBreakpoints from '../hooks/use-breakpoints';\nimport { Tab, Tabs, Tooltip as BaseTooltip, TooltipProps } from '@elementor/ui';\nimport {\n\tDesktopIcon,\n\tTabletPortraitIcon,\n\tMobilePortraitIcon,\n\tWidescreenIcon,\n\tLaptopIcon,\n\tTabletLandscapeIcon,\n\tMobileLandscapeIcon,\n} from '@elementor/icons';\nimport useBreakpointsActions from '../hooks/use-breakpoints-actions';\n\nexport default function BreakpointsSwitcher() {\n\tconst { all, active } = useBreakpoints();\n\tconst { activate } = useBreakpointsActions();\n\n\tif ( ! all.length || ! active ) {\n\t\treturn null;\n\t}\n\n\tconst onChange = ( _: unknown, value: BreakpointId ) => {\n\t\tconst extendedWindow = window as unknown as ExtendedWindow;\n\t\tconst config = extendedWindow?.elementor?.editorEvents?.config;\n\n\t\tif ( config ) {\n\t\t\textendedWindow.elementor.editorEvents.dispatchEvent( config.names.topBar.responsiveControls, {\n\t\t\t\tlocation: config.locations.topBar,\n\t\t\t\tsecondaryLocation: config.secondaryLocations.responsiveControls,\n\t\t\t\ttrigger: config.triggers.click,\n\t\t\t\telement: config.elements.buttonIcon,\n\t\t\t\tmode: value,\n\t\t\t} );\n\t\t}\n\n\t\tactivate( value );\n\t};\n\n\treturn (\n\t\t<Tabs\n\t\t\ttextColor=\"inherit\"\n\t\t\tindicatorColor=\"secondary\"\n\t\t\tvalue={ active.id }\n\t\t\tonChange={ onChange }\n\t\t\taria-label={ __( 'Switch Device', 'elementor' ) }\n\t\t\tsx={ {\n\t\t\t\t'& .MuiTabs-indicator': {\n\t\t\t\t\tbackgroundColor: 'text.primary',\n\t\t\t\t},\n\t\t\t} }\n\t\t>\n\t\t\t{ all.map( ( { id, label, type, width } ) => {\n\t\t\t\tconst Icon = iconsMap[ id ];\n\n\t\t\t\tconst title = labelsMap[ type || 'default' ]\n\t\t\t\t\t.replace( '%s', label )\n\t\t\t\t\t.replace( '%d', width?.toString() || '' );\n\n\t\t\t\treturn (\n\t\t\t\t\t<Tab\n\t\t\t\t\t\tvalue={ id }\n\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\taria-label={ title }\n\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t<Tooltip title={ title }>\n\t\t\t\t\t\t\t\t<Icon />\n\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsx={ { minWidth: 'auto' } }\n\t\t\t\t\t\tdata-testid={ `switch-device-to-${ id }` }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Tabs>\n\t);\n}\n\nfunction Tooltip( props: TooltipProps ) {\n\treturn (\n\t\t<BaseTooltip\n\t\t\tPopperProps={ {\n\t\t\t\tsx: {\n\t\t\t\t\t'&.MuiTooltip-popper .MuiTooltip-tooltip.MuiTooltip-tooltipPlacementBottom': {\n\t\t\t\t\t\tmt: 2.5,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t} }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nconst iconsMap = {\n\twidescreen: WidescreenIcon,\n\tdesktop: DesktopIcon,\n\tlaptop: LaptopIcon,\n\ttablet_extra: TabletLandscapeIcon,\n\ttablet: TabletPortraitIcon,\n\tmobile_extra: MobileLandscapeIcon,\n\tmobile: MobilePortraitIcon,\n};\n\nconst labelsMap = {\n\tdefault: '%s',\n\t// translators: %s: Breakpoint label, %d: Breakpoint size.\n\t'min-width': __( '%s (%dpx and up)', 'elementor' ),\n\n\t// translators: %s: Breakpoint label, %d: Breakpoint size.\n\t'max-width': __( '%s (up to %dpx)', 'elementor' ),\n} as const;\n","import { __useSelector as useSelector } from '@elementor/store';\nimport { selectActiveBreakpoint, selectSortedBreakpoints } from '../store/selectors';\n\nexport default function useBreakpoints() {\n\tconst all = useSelector( selectSortedBreakpoints );\n\tconst active = useSelector( selectActiveBreakpoint );\n\n\treturn {\n\t\tall,\n\t\tactive,\n\t};\n}\n","import { slice } from './index';\nimport { Breakpoint } from '../types';\nimport { __createSelector, SliceState } from '@elementor/store';\n\ntype State = SliceState< typeof slice >;\n\nexport const selectEntities = ( state: State ) => state.breakpoints.entities;\nexport const selectActiveId = ( state: State ) => state.breakpoints.activeId;\n\nexport const selectActiveBreakpoint = __createSelector( selectEntities, selectActiveId, ( entities, activeId ) =>\n\tactiveId && entities[ activeId ] ? entities[ activeId ] : null\n);\n\nexport const selectSortedBreakpoints = __createSelector( selectEntities, ( entities ) => {\n\tconst byWidth = ( a: Breakpoint, b: Breakpoint ) => {\n\t\treturn a.width && b.width ? b.width - a.width : 0;\n\t};\n\n\tconst all = Object.values( entities );\n\n\tconst defaults = all.filter( ( breakpoint ) => ! breakpoint.width ); // AKA Desktop.\n\tconst minWidth = all.filter( ( breakpoint ) => breakpoint.type === 'min-width' );\n\tconst maxWidth = all.filter( ( breakpoint ) => breakpoint.type === 'max-width' );\n\n\t// Sort by size, big to small.\n\treturn [ ...minWidth.sort( byWidth ), ...defaults, ...maxWidth.sort( byWidth ) ];\n} );\n","import { useCallback } from 'react';\nimport { BreakpointId } from '../types';\nimport { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';\n\nexport default function useBreakpointsActions() {\n\tconst activate = useCallback( ( device: BreakpointId ) => {\n\t\treturn runCommand( 'panel/change-device-mode', { device } );\n\t}, [] );\n\n\treturn {\n\t\tactivate,\n\t};\n}\n","import init from './init';\n\ninit();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mBAA6C;AAO7C,IAAM,eAAsB;AAAA,EAC3B,UAAU,CAAC;AAAA,EACX,UAAU;AACX;AAEO,IAAM,YAAQ,4BAAe;AAAA,EACnC,MAAM;AAAA,EACN;AAAA,EACA,UAAU;AAAA,IACT,KACC,OACA,QAIC;AACD,YAAM,WAAW,OAAO,QAAQ;AAChC,YAAM,WAAW,kBAAmB,OAAO,QAAQ,QAAS;AAAA,IAC7D;AAAA,IAEA,mBAAoB,OAAO,QAAwC;AAClE,UAAK,MAAM,SAAU,OAAO,OAAQ,GAAI;AACvC,cAAM,WAAW,OAAO;AAAA,MACzB;AAAA,IACD;AAAA,EACD;AACD,CAAE;AAEF,SAAS,kBAAmB,UAAyB;AACpD,SAAO,SAAS;AAAA,IACf,CAAE,KAAK,eAAgB;AACtB,aAAO;AAAA,QACN,GAAG;AAAA,QACH,CAAE,WAAW,EAAG,GAAG;AAAA,MACpB;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AACD;;;AC5CA,IAAAA,gBAA2B;AAE3B,gCAAyE;AACzE,kBAAmB;AAEJ,SAAR,YAA6B;AACnC,qBAAmB;AACnB,eAAa;AACd;AAEA,SAAS,qBAAqB;AAC7B,QAAM,EAAE,MAAAC,MAAK,IAAI,MAAM;AAEvB,gCAAAC,uBAAU,wCAAa,GAAG,MAAM;AAC/B;AAAA,MACC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,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,QAAQ;AACT;AAEA,IAAM,YAAY;AAAA,EACjB,SAAS;AAAA;AAAA,EAET,iBAAa,iBAAI,oBAAoB,WAAY;AAAA;AAAA,EAGjD,iBAAa,iBAAI,mBAAmB,WAAY;AACjD;;;AD5GA,IAAAC,gBAAgC;AAEjB,SAAR,OAAwB;AAC9B,YAAU;AAEV,mBAAiB;AAClB;AAEA,SAAS,YAAY;AACpB,qCAAiB,KAAM;AAEvB,YAAU;AACX;AAEA,SAAS,mBAAmB;AAC3B,kDAAsB;AAAA,IACrB,IAAI;AAAA,IACJ,WAAW;AAAA,IACX,SAAS;AAAA,MACR,UAAU;AAAA;AAAA,IACX;AAAA,EACD,CAAE;AACH;;;AKxBA,KAAK;","names":["import_store","init","listenTo","import_i18n","import_store","import_store","useSelector","import_editor_v1_adapters","runCommand","BaseTooltip","import_store"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/hooks/use-breakpoints.ts","../src/hooks/use-active-breakpoint.ts","../src/hooks/use-activate-breakpoint.ts"],"sourcesContent":["export { useBreakpoints } from './hooks/use-breakpoints';\nexport { useActiveBreakpoint } from './hooks/use-active-breakpoint';\nexport { useActivateBreakpoint } from './hooks/use-activate-breakpoint';\n\nexport type { BreakpointId, BreakpointSize, Breakpoint } from './types';\n","import { __ } from '@wordpress/i18n';\nimport { Breakpoint, BreakpointId, ExtendedWindow } from '../types';\nimport { v1ReadyEvent, __privateUseListenTo as useListenTo } from '@elementor/editor-v1-adapters';\n\nexport function useBreakpoints() {\n\treturn useListenTo( v1ReadyEvent(), getBreakpoints );\n}\n\nfunction getBreakpoints() {\n\tconst { breakpoints } = ( window as unknown as ExtendedWindow ).elementor?.config?.responsive || {};\n\n\tif ( ! breakpoints || Object.entries( breakpoints ).length === 0 ) {\n\t\treturn [];\n\t}\n\n\tconst minWidth: Breakpoint[] = [];\n\tconst maxWidth: Breakpoint[] = [];\n\n\tconst defaults: Breakpoint[] = [\n\t\t// Desktop breakpoint is not included in V1 config.\n\t\t{ id: 'desktop', label: __( 'Desktop', 'elementor' ) },\n\t];\n\n\tObject.entries( breakpoints ).forEach( ( [ id, v1Breakpoint ] ) => {\n\t\tif ( ! v1Breakpoint.is_enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst breakpoint: Breakpoint = {\n\t\t\tid: id as BreakpointId,\n\t\t\tlabel: v1Breakpoint.label,\n\t\t\twidth: v1Breakpoint.value,\n\t\t\ttype: v1Breakpoint.direction === 'min' ? 'min-width' : 'max-width',\n\t\t};\n\n\t\tif ( ! breakpoint.width ) {\n\t\t\tdefaults.push( breakpoint );\n\t\t} else if ( breakpoint.type === 'min-width' ) {\n\t\t\tminWidth.push( breakpoint );\n\t\t} else if ( breakpoint.type === 'max-width' ) {\n\t\t\tmaxWidth.push( breakpoint );\n\t\t}\n\t} );\n\n\tconst byWidth = ( a: Breakpoint, b: Breakpoint ) => {\n\t\treturn a.width && b.width ? b.width - a.width : 0;\n\t};\n\n\treturn [ ...minWidth.sort( byWidth ), ...defaults, ...maxWidth.sort( byWidth ) ];\n}\n","import { __privateUseListenTo as useListenTo, windowEvent } from '@elementor/editor-v1-adapters';\nimport { BreakpointId, ExtendedWindow } from '../types';\n\nexport function useActiveBreakpoint(): BreakpointId | null {\n\treturn useListenTo( windowEvent( 'elementor/device-mode/change' ), getActiveBreakpoint );\n}\n\nfunction getActiveBreakpoint() {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn extendedWindow.elementor?.channels?.deviceMode?.request?.( 'currentMode' ) || null;\n}\n","import { useCallback } from 'react';\nimport { BreakpointId } from '../types';\nimport { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';\n\nexport function useActivateBreakpoint() {\n\treturn useCallback( ( breakpoint: BreakpointId ) => {\n\t\treturn runCommand( 'panel/change-device-mode', { device: breakpoint } );\n\t}, [] );\n}\n"],"m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