@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 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
@@ -51,6 +51,10 @@ export interface CoreIframeContext {
51
51
  attribute: string;
52
52
  value: string;
53
53
  }): void;
54
+ duplicateElement(options: {
55
+ id: string;
56
+ path: string;
57
+ }): void;
54
58
  }
55
59
  export interface CoreIframeEvents {
56
60
  ready: () => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nookuio/iframe",
3
3
  "description": "",
4
- "version": "0.9.3",
4
+ "version": "0.9.4",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
7
7
  "exports": {