@elementor/editor-interactions 4.0.0-667 → 4.0.0-668
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 +150 -51
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +157 -48
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
- package/src/commands/get-clipboard-elements.ts +11 -0
- package/src/commands/paste-interactions.ts +136 -0
- package/src/init.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -1129,37 +1129,135 @@ var documentElementsInteractionsProvider = createInteractionsProvider({
|
|
|
1129
1129
|
}
|
|
1130
1130
|
});
|
|
1131
1131
|
|
|
1132
|
+
// src/commands/paste-interactions.ts
|
|
1133
|
+
var import_editor_elements4 = require("@elementor/editor-elements");
|
|
1134
|
+
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
1135
|
+
var import_i18n6 = require("@wordpress/i18n");
|
|
1136
|
+
|
|
1137
|
+
// src/commands/get-clipboard-elements.ts
|
|
1138
|
+
function getClipboardElements(storageKey = "clipboard") {
|
|
1139
|
+
try {
|
|
1140
|
+
const storedData = JSON.parse(localStorage.getItem("elementor") ?? "{}");
|
|
1141
|
+
return storedData[storageKey]?.elements;
|
|
1142
|
+
} catch {
|
|
1143
|
+
return void 0;
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
// src/commands/paste-interactions.ts
|
|
1148
|
+
function isAtomicContainer(container) {
|
|
1149
|
+
const type = container?.model.get("widgetType") || container?.model.get("elType");
|
|
1150
|
+
const widgetsCache = (0, import_editor_elements4.getWidgetsCache)();
|
|
1151
|
+
const elementConfig = widgetsCache?.[type];
|
|
1152
|
+
return Boolean(elementConfig?.atomic_props_schema);
|
|
1153
|
+
}
|
|
1154
|
+
function getTitleForContainers(containers) {
|
|
1155
|
+
return containers.length > 1 ? (0, import_i18n6.__)("Elements", "elementor") : (0, import_editor_elements4.getElementLabel)(containers[0].id);
|
|
1156
|
+
}
|
|
1157
|
+
function normalizeClipboardInteractions(raw) {
|
|
1158
|
+
if (!raw) {
|
|
1159
|
+
return null;
|
|
1160
|
+
}
|
|
1161
|
+
const parsed = typeof raw === "string" ? JSON.parse(raw) : raw;
|
|
1162
|
+
if (!parsed?.items?.length) {
|
|
1163
|
+
return null;
|
|
1164
|
+
}
|
|
1165
|
+
return { version: parsed.version ?? 1, items: parsed.items };
|
|
1166
|
+
}
|
|
1167
|
+
function regenerateInteractionIds(interactions) {
|
|
1168
|
+
const cloned = structuredClone(interactions);
|
|
1169
|
+
cloned.items?.forEach((item) => {
|
|
1170
|
+
if (item.$$type === "interaction-item" && item.value) {
|
|
1171
|
+
item.value.interaction_id = createString(generateTempInteractionId());
|
|
1172
|
+
}
|
|
1173
|
+
});
|
|
1174
|
+
return cloned;
|
|
1175
|
+
}
|
|
1176
|
+
function initPasteInteractionsCommand() {
|
|
1177
|
+
const undoablePasteInteractions = (0, import_editor_v1_adapters3.undoable)(
|
|
1178
|
+
{
|
|
1179
|
+
do: ({ containers, newInteractions }) => {
|
|
1180
|
+
const pasted = regenerateInteractionIds(newInteractions);
|
|
1181
|
+
return containers.map((container) => {
|
|
1182
|
+
const elementId = container.id;
|
|
1183
|
+
const previous = (0, import_editor_elements4.getElementInteractions)(elementId);
|
|
1184
|
+
(0, import_editor_elements4.updateElementInteractions)({
|
|
1185
|
+
elementId,
|
|
1186
|
+
interactions: pasted
|
|
1187
|
+
});
|
|
1188
|
+
return { elementId, previous: previous ?? { version: 1, items: [] } };
|
|
1189
|
+
});
|
|
1190
|
+
},
|
|
1191
|
+
undo: (_, revertData) => {
|
|
1192
|
+
revertData.forEach(({ elementId, previous }) => {
|
|
1193
|
+
(0, import_editor_elements4.updateElementInteractions)({
|
|
1194
|
+
elementId,
|
|
1195
|
+
interactions: previous.items?.length ? previous : void 0
|
|
1196
|
+
});
|
|
1197
|
+
});
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1200
|
+
{
|
|
1201
|
+
title: ({ containers }) => getTitleForContainers(containers),
|
|
1202
|
+
subtitle: (0, import_i18n6.__)("Interactions Pasted", "elementor")
|
|
1203
|
+
}
|
|
1204
|
+
);
|
|
1205
|
+
(0, import_editor_v1_adapters3.__privateListenTo)((0, import_editor_v1_adapters3.commandStartEvent)("document/elements/paste-interactions"), (e) => {
|
|
1206
|
+
const args = e.args;
|
|
1207
|
+
const containers = args.containers ?? (args.container ? [args.container] : []);
|
|
1208
|
+
const storageKey = args.storageKey ?? "clipboard";
|
|
1209
|
+
if (!containers.length) {
|
|
1210
|
+
return;
|
|
1211
|
+
}
|
|
1212
|
+
const clipboardElements = getClipboardElements(storageKey);
|
|
1213
|
+
const [clipboardElement] = clipboardElements ?? [];
|
|
1214
|
+
if (!clipboardElement) {
|
|
1215
|
+
return;
|
|
1216
|
+
}
|
|
1217
|
+
const newInteractions = normalizeClipboardInteractions(clipboardElement.interactions);
|
|
1218
|
+
if (!newInteractions) {
|
|
1219
|
+
return;
|
|
1220
|
+
}
|
|
1221
|
+
const existingContainers = containers.filter((c) => (0, import_editor_elements4.getContainer)(c.id));
|
|
1222
|
+
const validContainers = existingContainers.filter(isAtomicContainer);
|
|
1223
|
+
if (!validContainers.length) {
|
|
1224
|
+
return;
|
|
1225
|
+
}
|
|
1226
|
+
undoablePasteInteractions({ containers: validContainers, newInteractions });
|
|
1227
|
+
});
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1132
1230
|
// src/components/controls/direction.tsx
|
|
1133
1231
|
var React12 = __toESM(require("react"));
|
|
1134
1232
|
var import_react11 = require("react");
|
|
1135
1233
|
var import_editor_controls6 = require("@elementor/editor-controls");
|
|
1136
1234
|
var import_icons3 = require("@elementor/icons");
|
|
1137
|
-
var
|
|
1235
|
+
var import_i18n7 = require("@wordpress/i18n");
|
|
1138
1236
|
function Direction({ value, onChange, interactionType }) {
|
|
1139
1237
|
const options = (0, import_react11.useMemo)(() => {
|
|
1140
1238
|
const isIn = interactionType === "in";
|
|
1141
1239
|
return [
|
|
1142
1240
|
{
|
|
1143
1241
|
value: "top",
|
|
1144
|
-
label: isIn ? (0,
|
|
1242
|
+
label: isIn ? (0, import_i18n7.__)("From top", "elementor") : (0, import_i18n7.__)("To top", "elementor"),
|
|
1145
1243
|
renderContent: ({ size }) => isIn ? /* @__PURE__ */ React12.createElement(import_icons3.ArrowDownSmallIcon, { fontSize: size }) : /* @__PURE__ */ React12.createElement(import_icons3.ArrowUpSmallIcon, { fontSize: size }),
|
|
1146
1244
|
showTooltip: true
|
|
1147
1245
|
},
|
|
1148
1246
|
{
|
|
1149
1247
|
value: "bottom",
|
|
1150
|
-
label: interactionType === "in" ? (0,
|
|
1248
|
+
label: interactionType === "in" ? (0, import_i18n7.__)("From bottom", "elementor") : (0, import_i18n7.__)("To bottom", "elementor"),
|
|
1151
1249
|
renderContent: ({ size }) => isIn ? /* @__PURE__ */ React12.createElement(import_icons3.ArrowUpSmallIcon, { fontSize: size }) : /* @__PURE__ */ React12.createElement(import_icons3.ArrowDownSmallIcon, { fontSize: size }),
|
|
1152
1250
|
showTooltip: true
|
|
1153
1251
|
},
|
|
1154
1252
|
{
|
|
1155
1253
|
value: "left",
|
|
1156
|
-
label: interactionType === "in" ? (0,
|
|
1254
|
+
label: interactionType === "in" ? (0, import_i18n7.__)("From left", "elementor") : (0, import_i18n7.__)("To left", "elementor"),
|
|
1157
1255
|
renderContent: ({ size }) => isIn ? /* @__PURE__ */ React12.createElement(import_icons3.ArrowRightIcon, { fontSize: size }) : /* @__PURE__ */ React12.createElement(import_icons3.ArrowLeftIcon, { fontSize: size }),
|
|
1158
1256
|
showTooltip: true
|
|
1159
1257
|
},
|
|
1160
1258
|
{
|
|
1161
1259
|
value: "right",
|
|
1162
|
-
label: interactionType === "in" ? (0,
|
|
1260
|
+
label: interactionType === "in" ? (0, import_i18n7.__)("From right", "elementor") : (0, import_i18n7.__)("To right", "elementor"),
|
|
1163
1261
|
renderContent: ({ size }) => isIn ? /* @__PURE__ */ React12.createElement(import_icons3.ArrowLeftIcon, { fontSize: size }) : /* @__PURE__ */ React12.createElement(import_icons3.ArrowRightIcon, { fontSize: size }),
|
|
1164
1262
|
showTooltip: true
|
|
1165
1263
|
}
|
|
@@ -1170,21 +1268,21 @@ function Direction({ value, onChange, interactionType }) {
|
|
|
1170
1268
|
|
|
1171
1269
|
// src/components/controls/easing.tsx
|
|
1172
1270
|
var React15 = __toESM(require("react"));
|
|
1173
|
-
var
|
|
1271
|
+
var import_i18n10 = require("@wordpress/i18n");
|
|
1174
1272
|
|
|
1175
1273
|
// src/ui/promotion-select.tsx
|
|
1176
1274
|
var React14 = __toESM(require("react"));
|
|
1177
1275
|
var import_react13 = require("react");
|
|
1178
1276
|
var import_editor_ui2 = require("@elementor/editor-ui");
|
|
1179
1277
|
var import_ui9 = require("@elementor/ui");
|
|
1180
|
-
var
|
|
1278
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
1181
1279
|
|
|
1182
1280
|
// src/ui/interactions-promotion-chip.tsx
|
|
1183
1281
|
var React13 = __toESM(require("react"));
|
|
1184
1282
|
var import_react12 = require("react");
|
|
1185
1283
|
var import_editor_ui = require("@elementor/editor-ui");
|
|
1186
1284
|
var import_ui8 = require("@elementor/ui");
|
|
1187
|
-
var
|
|
1285
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
1188
1286
|
var InteractionsPromotionChip = (0, import_react12.forwardRef)(
|
|
1189
1287
|
({ content, upgradeUrl, anchorRef }, ref) => {
|
|
1190
1288
|
const [isOpen, setIsOpen] = (0, import_react12.useState)(false);
|
|
@@ -1199,9 +1297,9 @@ var InteractionsPromotionChip = (0, import_react12.forwardRef)(
|
|
|
1199
1297
|
import_editor_ui.PromotionPopover,
|
|
1200
1298
|
{
|
|
1201
1299
|
open: isOpen,
|
|
1202
|
-
title: (0,
|
|
1300
|
+
title: (0, import_i18n8.__)("Interactions", "elementor"),
|
|
1203
1301
|
content,
|
|
1204
|
-
ctaText: (0,
|
|
1302
|
+
ctaText: (0, import_i18n8.__)("Upgrade now", "elementor"),
|
|
1205
1303
|
ctaUrl: upgradeUrl,
|
|
1206
1304
|
anchorRef,
|
|
1207
1305
|
placement: anchorRef ? "right-start" : void 0,
|
|
@@ -1263,7 +1361,7 @@ function PromotionSelect({
|
|
|
1263
1361
|
promotionRef.current?.toggle();
|
|
1264
1362
|
}
|
|
1265
1363
|
},
|
|
1266
|
-
promotionLabel ?? (0,
|
|
1364
|
+
promotionLabel ?? (0, import_i18n9.__)("PRO features", "elementor"),
|
|
1267
1365
|
/* @__PURE__ */ React14.createElement(
|
|
1268
1366
|
InteractionsPromotionChip,
|
|
1269
1367
|
{
|
|
@@ -1280,13 +1378,13 @@ function PromotionSelect({
|
|
|
1280
1378
|
|
|
1281
1379
|
// src/components/controls/easing.tsx
|
|
1282
1380
|
var EASING_OPTIONS = {
|
|
1283
|
-
easeIn: (0,
|
|
1284
|
-
easeInOut: (0,
|
|
1285
|
-
easeOut: (0,
|
|
1286
|
-
backIn: (0,
|
|
1287
|
-
backInOut: (0,
|
|
1288
|
-
backOut: (0,
|
|
1289
|
-
linear: (0,
|
|
1381
|
+
easeIn: (0, import_i18n10.__)("Ease In", "elementor"),
|
|
1382
|
+
easeInOut: (0, import_i18n10.__)("Ease In Out", "elementor"),
|
|
1383
|
+
easeOut: (0, import_i18n10.__)("Ease Out", "elementor"),
|
|
1384
|
+
backIn: (0, import_i18n10.__)("Back In", "elementor"),
|
|
1385
|
+
backInOut: (0, import_i18n10.__)("Back In Out", "elementor"),
|
|
1386
|
+
backOut: (0, import_i18n10.__)("Back Out", "elementor"),
|
|
1387
|
+
linear: (0, import_i18n10.__)("Linear", "elementor")
|
|
1290
1388
|
};
|
|
1291
1389
|
var BASE_EASINGS = ["easeIn"];
|
|
1292
1390
|
function Easing({}) {
|
|
@@ -1302,7 +1400,7 @@ function Easing({}) {
|
|
|
1302
1400
|
value: DEFAULT_VALUES.easing,
|
|
1303
1401
|
baseOptions,
|
|
1304
1402
|
disabledOptions,
|
|
1305
|
-
promotionContent: (0,
|
|
1403
|
+
promotionContent: (0, import_i18n10.__)("Upgrade to control the smoothness of the interaction.", "elementor"),
|
|
1306
1404
|
upgradeUrl: "https://go.elementor.com/go-pro-interactions-easing-modal/"
|
|
1307
1405
|
}
|
|
1308
1406
|
);
|
|
@@ -1310,12 +1408,12 @@ function Easing({}) {
|
|
|
1310
1408
|
|
|
1311
1409
|
// src/components/controls/effect.tsx
|
|
1312
1410
|
var React16 = __toESM(require("react"));
|
|
1313
|
-
var
|
|
1411
|
+
var import_i18n11 = require("@wordpress/i18n");
|
|
1314
1412
|
var EFFECT_OPTIONS = {
|
|
1315
|
-
fade: (0,
|
|
1316
|
-
slide: (0,
|
|
1317
|
-
scale: (0,
|
|
1318
|
-
custom: (0,
|
|
1413
|
+
fade: (0, import_i18n11.__)("Fade", "elementor"),
|
|
1414
|
+
slide: (0, import_i18n11.__)("Slide", "elementor"),
|
|
1415
|
+
scale: (0, import_i18n11.__)("Scale", "elementor"),
|
|
1416
|
+
custom: (0, import_i18n11.__)("Custom", "elementor")
|
|
1319
1417
|
};
|
|
1320
1418
|
var BASE_EFFECTS = ["fade", "slide", "scale"];
|
|
1321
1419
|
function Effect({ value, onChange }) {
|
|
@@ -1332,8 +1430,8 @@ function Effect({ value, onChange }) {
|
|
|
1332
1430
|
onChange,
|
|
1333
1431
|
baseOptions,
|
|
1334
1432
|
disabledOptions,
|
|
1335
|
-
promotionLabel: (0,
|
|
1336
|
-
promotionContent: (0,
|
|
1433
|
+
promotionLabel: (0, import_i18n11.__)("PRO effects", "elementor"),
|
|
1434
|
+
promotionContent: (0, import_i18n11.__)(
|
|
1337
1435
|
"Upgrade to further customize your animation with opacity, scale, move, rotate and more.",
|
|
1338
1436
|
"elementor"
|
|
1339
1437
|
),
|
|
@@ -1345,19 +1443,19 @@ function Effect({ value, onChange }) {
|
|
|
1345
1443
|
// src/components/controls/effect-type.tsx
|
|
1346
1444
|
var React17 = __toESM(require("react"));
|
|
1347
1445
|
var import_editor_controls7 = require("@elementor/editor-controls");
|
|
1348
|
-
var
|
|
1446
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
1349
1447
|
function EffectType({ value, onChange }) {
|
|
1350
1448
|
const options = [
|
|
1351
1449
|
{
|
|
1352
1450
|
value: "in",
|
|
1353
|
-
label: (0,
|
|
1354
|
-
renderContent: () => (0,
|
|
1451
|
+
label: (0, import_i18n12.__)("In", "elementor"),
|
|
1452
|
+
renderContent: () => (0, import_i18n12.__)("In", "elementor"),
|
|
1355
1453
|
showTooltip: true
|
|
1356
1454
|
},
|
|
1357
1455
|
{
|
|
1358
1456
|
value: "out",
|
|
1359
|
-
label: (0,
|
|
1360
|
-
renderContent: () => (0,
|
|
1457
|
+
label: (0, import_i18n12.__)("Out", "elementor"),
|
|
1458
|
+
renderContent: () => (0, import_i18n12.__)("Out", "elementor"),
|
|
1361
1459
|
showTooltip: true
|
|
1362
1460
|
}
|
|
1363
1461
|
];
|
|
@@ -1369,10 +1467,10 @@ var React18 = __toESM(require("react"));
|
|
|
1369
1467
|
var import_editor_controls8 = require("@elementor/editor-controls");
|
|
1370
1468
|
var import_icons4 = require("@elementor/icons");
|
|
1371
1469
|
var import_ui10 = require("@elementor/ui");
|
|
1372
|
-
var
|
|
1470
|
+
var import_i18n13 = require("@wordpress/i18n");
|
|
1373
1471
|
var REPLAY_OPTIONS = {
|
|
1374
|
-
no: (0,
|
|
1375
|
-
yes: (0,
|
|
1472
|
+
no: (0, import_i18n13.__)("No", "elementor"),
|
|
1473
|
+
yes: (0, import_i18n13.__)("Yes", "elementor")
|
|
1376
1474
|
};
|
|
1377
1475
|
var BASE_REPLAY = ["no"];
|
|
1378
1476
|
var OVERLAY_GRID = "1 / 1";
|
|
@@ -1397,7 +1495,7 @@ function Replay({ onChange, anchorRef }) {
|
|
|
1397
1495
|
return /* @__PURE__ */ React18.createElement(import_ui10.Box, { sx: { display: "grid", alignItems: "center" } }, /* @__PURE__ */ React18.createElement(import_ui10.Box, { sx: { gridArea: OVERLAY_GRID } }, /* @__PURE__ */ React18.createElement(import_editor_controls8.ToggleButtonGroupUi, { items: options, exclusive: true, onChange, value: false })), /* @__PURE__ */ React18.createElement(import_ui10.Box, { sx: { gridArea: OVERLAY_GRID, marginInlineEnd: CHIP_OFFSET, justifySelf: "end" } }, /* @__PURE__ */ React18.createElement(
|
|
1398
1496
|
InteractionsPromotionChip,
|
|
1399
1497
|
{
|
|
1400
|
-
content: (0,
|
|
1498
|
+
content: (0, import_i18n13.__)("Upgrade to run the animation every time its trigger occurs.", "elementor"),
|
|
1401
1499
|
upgradeUrl: "https://go.elementor.com/go-pro-interactions-replay-modal/",
|
|
1402
1500
|
anchorRef
|
|
1403
1501
|
}
|
|
@@ -1406,13 +1504,13 @@ function Replay({ onChange, anchorRef }) {
|
|
|
1406
1504
|
|
|
1407
1505
|
// src/components/controls/trigger.tsx
|
|
1408
1506
|
var React19 = __toESM(require("react"));
|
|
1409
|
-
var
|
|
1507
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
1410
1508
|
var TRIGGER_OPTIONS = {
|
|
1411
|
-
load: (0,
|
|
1412
|
-
scrollIn: (0,
|
|
1413
|
-
scrollOn: (0,
|
|
1414
|
-
hover: (0,
|
|
1415
|
-
click: (0,
|
|
1509
|
+
load: (0, import_i18n14.__)("Page load", "elementor"),
|
|
1510
|
+
scrollIn: (0, import_i18n14.__)("Scroll into view", "elementor"),
|
|
1511
|
+
scrollOn: (0, import_i18n14.__)("While scrolling", "elementor"),
|
|
1512
|
+
hover: (0, import_i18n14.__)("On hover", "elementor"),
|
|
1513
|
+
click: (0, import_i18n14.__)("On click", "elementor")
|
|
1416
1514
|
};
|
|
1417
1515
|
var BASE_TRIGGERS = ["load", "scrollIn"];
|
|
1418
1516
|
function Trigger({ value, onChange }) {
|
|
@@ -1429,18 +1527,18 @@ function Trigger({ value, onChange }) {
|
|
|
1429
1527
|
onChange,
|
|
1430
1528
|
baseOptions,
|
|
1431
1529
|
disabledOptions,
|
|
1432
|
-
promotionLabel: (0,
|
|
1433
|
-
promotionContent: (0,
|
|
1530
|
+
promotionLabel: (0, import_i18n14.__)("PRO triggers", "elementor"),
|
|
1531
|
+
promotionContent: (0, import_i18n14.__)("Upgrade to unlock more interactions triggers.", "elementor"),
|
|
1434
1532
|
upgradeUrl: "https://go.elementor.com/go-pro-interactions-triggers-modal/"
|
|
1435
1533
|
}
|
|
1436
1534
|
);
|
|
1437
1535
|
}
|
|
1438
1536
|
|
|
1439
1537
|
// src/hooks/on-duplicate.ts
|
|
1440
|
-
var
|
|
1441
|
-
var
|
|
1538
|
+
var import_editor_elements5 = require("@elementor/editor-elements");
|
|
1539
|
+
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
1442
1540
|
function initCleanInteractionIdsOnDuplicate() {
|
|
1443
|
-
(0,
|
|
1541
|
+
(0, import_editor_v1_adapters4.registerDataHook)("after", "document/elements/duplicate", (_args, result) => {
|
|
1444
1542
|
const containers = Array.isArray(result) ? result : [result];
|
|
1445
1543
|
containers.forEach((container) => {
|
|
1446
1544
|
cleanInteractionIdsRecursive(container.id);
|
|
@@ -1448,16 +1546,16 @@ function initCleanInteractionIdsOnDuplicate() {
|
|
|
1448
1546
|
});
|
|
1449
1547
|
}
|
|
1450
1548
|
function cleanInteractionIdsRecursive(elementId) {
|
|
1451
|
-
const container = (0,
|
|
1549
|
+
const container = (0, import_editor_elements5.getContainer)(elementId);
|
|
1452
1550
|
if (!container) {
|
|
1453
1551
|
return;
|
|
1454
1552
|
}
|
|
1455
|
-
(0,
|
|
1553
|
+
(0, import_editor_elements5.getAllDescendants)(container).forEach((element) => {
|
|
1456
1554
|
cleanInteractionIds(element.id);
|
|
1457
1555
|
});
|
|
1458
1556
|
}
|
|
1459
1557
|
function cleanInteractionIds(elementId) {
|
|
1460
|
-
const container = (0,
|
|
1558
|
+
const container = (0, import_editor_elements5.getContainer)(elementId);
|
|
1461
1559
|
if (!container) {
|
|
1462
1560
|
return;
|
|
1463
1561
|
}
|
|
@@ -1556,7 +1654,7 @@ var initInteractionsSchemaResource = (reg) => {
|
|
|
1556
1654
|
};
|
|
1557
1655
|
|
|
1558
1656
|
// src/mcp/tools/manage-element-interaction-tool.ts
|
|
1559
|
-
var
|
|
1657
|
+
var import_editor_elements6 = require("@elementor/editor-elements");
|
|
1560
1658
|
var import_schema3 = require("@elementor/schema");
|
|
1561
1659
|
var import_utils2 = require("@elementor/utils");
|
|
1562
1660
|
var EMPTY_INTERACTIONS = {
|
|
@@ -1687,7 +1785,7 @@ var initManageElementInteractionTool = (reg) => {
|
|
|
1687
1785
|
items: updatedItems
|
|
1688
1786
|
};
|
|
1689
1787
|
try {
|
|
1690
|
-
(0,
|
|
1788
|
+
(0, import_editor_elements6.updateElementInteractions)({ elementId, interactions: updatedInteractions });
|
|
1691
1789
|
} catch (error) {
|
|
1692
1790
|
throw new Error(
|
|
1693
1791
|
`Failed to update interactions for element "${elementId}": ${error instanceof Error ? error.message : "Unknown error"}`
|
|
@@ -1778,6 +1876,7 @@ function init() {
|
|
|
1778
1876
|
try {
|
|
1779
1877
|
interactionsRepository.register(documentElementsInteractionsProvider);
|
|
1780
1878
|
initCleanInteractionIdsOnDuplicate();
|
|
1879
|
+
initPasteInteractionsCommand();
|
|
1781
1880
|
registerInteractionsControl({
|
|
1782
1881
|
type: "trigger",
|
|
1783
1882
|
component: Trigger,
|