@nookuio/iframe 0.9.4 → 0.9.6
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/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/iframe.js +22 -34
- package/dist/iframe.mjs +22 -22
- package/dist/types.d.ts +0 -19
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const EDITOR_PAGE_PATH = "/__nooku__/editor";
|
|
5
5
|
export declare const COMPONENT_PREVIEW_PAGE_PATH = "/__nooku__/component-preview";
|
|
6
|
-
export declare const VIRTUAL_VUE_SFC_RENDERER_PAGE_PATH = "/__nooku__/virtual-sfc-
|
|
6
|
+
export declare const VIRTUAL_VUE_SFC_RENDERER_PAGE_PATH = "/__nooku__/virtual-sfc-editor";
|
|
7
7
|
export declare const IFRAME_SOURCE_NAME = "nooku-frame";
|
|
8
8
|
export declare const EDITOR_SOURCE_NAME = "nooku-editor";
|
package/dist/constants.js
CHANGED
|
@@ -6,6 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.VIRTUAL_VUE_SFC_RENDERER_PAGE_PATH = exports.IFRAME_SOURCE_NAME = exports.EDITOR_SOURCE_NAME = exports.EDITOR_PAGE_PATH = exports.COMPONENT_PREVIEW_PAGE_PATH = void 0;
|
|
7
7
|
const EDITOR_PAGE_PATH = exports.EDITOR_PAGE_PATH = `/__nooku__/editor`;
|
|
8
8
|
const COMPONENT_PREVIEW_PAGE_PATH = exports.COMPONENT_PREVIEW_PAGE_PATH = `/__nooku__/component-preview`;
|
|
9
|
-
const VIRTUAL_VUE_SFC_RENDERER_PAGE_PATH = exports.VIRTUAL_VUE_SFC_RENDERER_PAGE_PATH = `/__nooku__/virtual-sfc-
|
|
9
|
+
const VIRTUAL_VUE_SFC_RENDERER_PAGE_PATH = exports.VIRTUAL_VUE_SFC_RENDERER_PAGE_PATH = `/__nooku__/virtual-sfc-editor`;
|
|
10
10
|
const IFRAME_SOURCE_NAME = exports.IFRAME_SOURCE_NAME = "nooku-frame";
|
|
11
11
|
const EDITOR_SOURCE_NAME = exports.EDITOR_SOURCE_NAME = "nooku-editor";
|
package/dist/constants.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const EDITOR_PAGE_PATH = `/__nooku__/editor`;
|
|
2
2
|
export const COMPONENT_PREVIEW_PAGE_PATH = `/__nooku__/component-preview`;
|
|
3
|
-
export const VIRTUAL_VUE_SFC_RENDERER_PAGE_PATH = `/__nooku__/virtual-sfc-
|
|
3
|
+
export const VIRTUAL_VUE_SFC_RENDERER_PAGE_PATH = `/__nooku__/virtual-sfc-editor`;
|
|
4
4
|
export const IFRAME_SOURCE_NAME = "nooku-frame";
|
|
5
5
|
export const EDITOR_SOURCE_NAME = "nooku-editor";
|
package/dist/iframe.js
CHANGED
|
@@ -139,41 +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
|
-
},
|
|
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
|
-
});
|
|
176
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
|
+
// }
|
|
177
165
|
}, {
|
|
178
166
|
handle(handler) {
|
|
179
167
|
window.addEventListener("message", async event => {
|
package/dist/iframe.mjs
CHANGED
|
@@ -119,29 +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
|
-
},
|
|
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
|
-
});
|
|
144
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
|
+
// }
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
147
|
handle(handler) {
|
package/dist/types.d.ts
CHANGED
|
@@ -40,21 +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
|
-
duplicateElement(options: {
|
|
55
|
-
id: string;
|
|
56
|
-
path: string;
|
|
57
|
-
}): void;
|
|
58
43
|
}
|
|
59
44
|
export interface CoreIframeEvents {
|
|
60
45
|
ready: () => void;
|
|
@@ -129,8 +114,4 @@ export interface IframePageOptions {
|
|
|
129
114
|
* Component props
|
|
130
115
|
*/
|
|
131
116
|
props?: Record<string, any>;
|
|
132
|
-
/**
|
|
133
|
-
* Specifically for virtual SFC renderer page
|
|
134
|
-
*/
|
|
135
|
-
code?: string;
|
|
136
117
|
}
|