@nookuio/iframe 0.9.3 → 0.9.4
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/iframe.js +13 -0
- package/dist/iframe.mjs +10 -0
- package/dist/types.d.ts +4 -0
- package/package.json +1 -1
package/dist/iframe.js
CHANGED
|
@@ -160,6 +160,19 @@ function createVueIframeClient(vueCtx, options) {
|
|
|
160
160
|
const elements = document.querySelectorAll(selector);
|
|
161
161
|
if (!elements?.length) return;
|
|
162
162
|
elements.forEach(elm => elm.setAttribute(attribute, value));
|
|
163
|
+
},
|
|
164
|
+
duplicateElement({
|
|
165
|
+
id,
|
|
166
|
+
path
|
|
167
|
+
}) {
|
|
168
|
+
const selector = getSelector(path, id);
|
|
169
|
+
const elements = document.querySelectorAll(selector);
|
|
170
|
+
if (!elements?.length) return;
|
|
171
|
+
elements.forEach(elm => {
|
|
172
|
+
const clone = elm.cloneNode(true);
|
|
173
|
+
clone.setAttribute("data-node-id", String(Number(clone.getAttribute("data-node-id")) + 1));
|
|
174
|
+
elm.parentElement?.appendChild(clone);
|
|
175
|
+
});
|
|
163
176
|
}
|
|
164
177
|
}, {
|
|
165
178
|
handle(handler) {
|
package/dist/iframe.mjs
CHANGED
|
@@ -131,6 +131,16 @@ export function createVueIframeClient(vueCtx, options) {
|
|
|
131
131
|
const elements = document.querySelectorAll(selector);
|
|
132
132
|
if (!elements?.length) return;
|
|
133
133
|
elements.forEach((elm) => elm.setAttribute(attribute, value));
|
|
134
|
+
},
|
|
135
|
+
duplicateElement({ id, path }) {
|
|
136
|
+
const selector = getSelector(path, id);
|
|
137
|
+
const elements = document.querySelectorAll(selector);
|
|
138
|
+
if (!elements?.length) return;
|
|
139
|
+
elements.forEach((elm) => {
|
|
140
|
+
const clone = elm.cloneNode(true);
|
|
141
|
+
clone.setAttribute("data-node-id", String(Number(clone.getAttribute("data-node-id")) + 1));
|
|
142
|
+
elm.parentElement?.appendChild(clone);
|
|
143
|
+
});
|
|
134
144
|
}
|
|
135
145
|
},
|
|
136
146
|
{
|
package/dist/types.d.ts
CHANGED