@nookuio/iframe 0.9.3 → 0.9.5
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 +22 -21
- package/dist/iframe.mjs +22 -12
- package/dist/types.d.ts +0 -11
- package/package.json +1 -1
package/dist/iframe.js
CHANGED
|
@@ -139,28 +139,29 @@ function createVueIframeClient(vueCtx, options) {
|
|
|
139
139
|
document.documentElement.classList.remove("dark");
|
|
140
140
|
document.documentElement.classList.add("light");
|
|
141
141
|
}
|
|
142
|
-
},
|
|
143
|
-
updateElementClass({
|
|
144
|
-
className,
|
|
145
|
-
id,
|
|
146
|
-
path
|
|
147
|
-
}) {
|
|
148
|
-
const selector = getSelector(path, id);
|
|
149
|
-
const elements = document.querySelectorAll(selector);
|
|
150
|
-
if (!elements?.length) return;
|
|
151
|
-
elements.forEach(elm => elm.className = className);
|
|
152
|
-
},
|
|
153
|
-
updateElementAttribute({
|
|
154
|
-
attribute,
|
|
155
|
-
value,
|
|
156
|
-
id,
|
|
157
|
-
path
|
|
158
|
-
}) {
|
|
159
|
-
const selector = getSelector(path, id);
|
|
160
|
-
const elements = document.querySelectorAll(selector);
|
|
161
|
-
if (!elements?.length) return;
|
|
162
|
-
elements.forEach(elm => elm.setAttribute(attribute, value));
|
|
163
142
|
}
|
|
143
|
+
// updateElementClass({ className, id, path }) {
|
|
144
|
+
// const selector = getSelector(path, id);
|
|
145
|
+
// const elements = document.querySelectorAll(selector);
|
|
146
|
+
// if (!elements?.length) return;
|
|
147
|
+
// elements.forEach((elm) => (elm.className = className));
|
|
148
|
+
// },
|
|
149
|
+
// updateElementAttribute({ attribute, value, id, path }) {
|
|
150
|
+
// const selector = getSelector(path, id);
|
|
151
|
+
// const elements = document.querySelectorAll(selector);
|
|
152
|
+
// if (!elements?.length) return;
|
|
153
|
+
// elements.forEach((elm) => elm.setAttribute(attribute, value));
|
|
154
|
+
// },
|
|
155
|
+
// duplicateElement({ id, path }) {
|
|
156
|
+
// const selector = getSelector(path, id);
|
|
157
|
+
// const elements = document.querySelectorAll(selector);
|
|
158
|
+
// if (!elements?.length) return;
|
|
159
|
+
// elements.forEach((elm) => {
|
|
160
|
+
// const clone = elm.cloneNode(true) as HTMLElement;
|
|
161
|
+
// clone.setAttribute('data-node-id', String(Number(clone.getAttribute('data-node-id')!) + 1));
|
|
162
|
+
// elm.parentElement?.insertBefore(clone, elm.nextSibling);
|
|
163
|
+
// });
|
|
164
|
+
// }
|
|
164
165
|
}, {
|
|
165
166
|
handle(handler) {
|
|
166
167
|
window.addEventListener("message", async event => {
|
package/dist/iframe.mjs
CHANGED
|
@@ -119,19 +119,29 @@ export function createVueIframeClient(vueCtx, options) {
|
|
|
119
119
|
document.documentElement.classList.remove("dark");
|
|
120
120
|
document.documentElement.classList.add("light");
|
|
121
121
|
}
|
|
122
|
-
},
|
|
123
|
-
updateElementClass({ className, id, path }) {
|
|
124
|
-
const selector = getSelector(path, id);
|
|
125
|
-
const elements = document.querySelectorAll(selector);
|
|
126
|
-
if (!elements?.length) return;
|
|
127
|
-
elements.forEach((elm) => elm.className = className);
|
|
128
|
-
},
|
|
129
|
-
updateElementAttribute({ attribute, value, id, path }) {
|
|
130
|
-
const selector = getSelector(path, id);
|
|
131
|
-
const elements = document.querySelectorAll(selector);
|
|
132
|
-
if (!elements?.length) return;
|
|
133
|
-
elements.forEach((elm) => elm.setAttribute(attribute, value));
|
|
134
122
|
}
|
|
123
|
+
// updateElementClass({ className, id, path }) {
|
|
124
|
+
// const selector = getSelector(path, id);
|
|
125
|
+
// const elements = document.querySelectorAll(selector);
|
|
126
|
+
// if (!elements?.length) return;
|
|
127
|
+
// elements.forEach((elm) => (elm.className = className));
|
|
128
|
+
// },
|
|
129
|
+
// updateElementAttribute({ attribute, value, id, path }) {
|
|
130
|
+
// const selector = getSelector(path, id);
|
|
131
|
+
// const elements = document.querySelectorAll(selector);
|
|
132
|
+
// if (!elements?.length) return;
|
|
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) as HTMLElement;
|
|
141
|
+
// clone.setAttribute('data-node-id', String(Number(clone.getAttribute('data-node-id')!) + 1));
|
|
142
|
+
// elm.parentElement?.insertBefore(clone, elm.nextSibling);
|
|
143
|
+
// });
|
|
144
|
+
// }
|
|
135
145
|
},
|
|
136
146
|
{
|
|
137
147
|
handle(handler) {
|
package/dist/types.d.ts
CHANGED
|
@@ -40,17 +40,6 @@ export interface CoreIframeContext {
|
|
|
40
40
|
path: string;
|
|
41
41
|
id: string;
|
|
42
42
|
}) => void;
|
|
43
|
-
updateElementClass(options: {
|
|
44
|
-
id: string;
|
|
45
|
-
path: string;
|
|
46
|
-
className: string;
|
|
47
|
-
}): void;
|
|
48
|
-
updateElementAttribute(options: {
|
|
49
|
-
id: string;
|
|
50
|
-
path: string;
|
|
51
|
-
attribute: string;
|
|
52
|
-
value: string;
|
|
53
|
-
}): void;
|
|
54
43
|
}
|
|
55
44
|
export interface CoreIframeEvents {
|
|
56
45
|
ready: () => void;
|