vue-wswg-editor 0.0.12 → 0.0.13
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/README.md +23 -8
- package/dist/style.css +1 -1
- package/dist/types/components/BlockEditorFields/BlockEditorFields.vue.d.ts +1 -0
- package/dist/types/components/EditorPageRenderer/EditorPageRenderer.vue.d.ts +21 -0
- package/dist/types/components/EmptyState/EmptyState.vue.d.ts +2 -8
- package/dist/types/components/IframePreview/IframePreview.vue.d.ts +26 -0
- package/dist/types/components/IframePreview/iframeContent.d.ts +9 -0
- package/dist/types/components/IframePreview/iframePreviewApp.d.ts +36 -0
- package/dist/types/components/IframePreview/messageHandler.d.ts +55 -0
- package/dist/types/components/IframePreview/types.d.ts +77 -0
- package/dist/types/components/PageBuilderSidebar/PageBuilderSidebar.vue.d.ts +2 -0
- package/dist/types/components/PageRenderer/PageRenderer.vue.d.ts +2 -0
- package/dist/types/components/PageSettings/PageSettings.vue.d.ts +2 -0
- package/dist/types/components/{WswgJsonEditor/WswgJsonEditor.vue.d.ts → WswgPageBuilder/WswgPageBuilder.vue.d.ts} +2 -0
- package/dist/types/index.d.ts +8 -2
- package/dist/types/util/registry.d.ts +2 -0
- package/dist/types/util/theme-registry.d.ts +42 -0
- package/dist/types/util/validation.d.ts +2 -2
- package/dist/vite-plugin.js +33 -29
- package/dist/vue-wswg-editor.es.js +2723 -1897
- package/package.json +1 -2
- package/src/assets/styles/_mixins.scss +15 -0
- package/src/components/AddBlockItem/AddBlockItem.vue +13 -4
- package/src/components/BlockBrowser/BlockBrowser.vue +5 -5
- package/src/components/BlockComponent/BlockComponent.vue +23 -50
- package/src/components/BlockEditorFieldNode/BlockEditorFieldNode.vue +12 -10
- package/src/components/BlockEditorFields/BlockEditorFields.vue +24 -4
- package/src/components/BlockRepeaterFieldNode/BlockRepeaterNode.vue +9 -4
- package/src/components/BrowserNavigation/BrowserNavigation.vue +1 -1
- package/src/components/EditorPageRenderer/EditorPageRenderer.vue +641 -0
- package/src/components/EmptyState/EmptyState.vue +3 -12
- package/src/components/IframePreview/IframePreview.vue +211 -0
- package/src/components/IframePreview/iframeContent.ts +210 -0
- package/src/components/IframePreview/iframePreviewApp.ts +221 -0
- package/src/components/IframePreview/messageHandler.ts +219 -0
- package/src/components/IframePreview/types.ts +126 -0
- package/src/components/PageBlockList/PageBlockList.vue +8 -6
- package/src/components/PageBuilderSidebar/PageBuilderSidebar.vue +5 -3
- package/src/components/PageRenderer/PageRenderer.vue +9 -33
- package/src/components/PageSettings/PageSettings.vue +10 -6
- package/src/components/ResizeHandle/ResizeHandle.vue +68 -10
- package/src/components/{WswgJsonEditor/WswgJsonEditor.test.ts → WswgPageBuilder/WswgPageBuilder.test.ts} +8 -8
- package/src/components/WswgPageBuilder/WswgPageBuilder.vue +375 -0
- package/src/index.ts +10 -2
- package/src/shims.d.ts +4 -0
- package/src/types/Theme.d.ts +15 -0
- package/src/util/registry.ts +2 -2
- package/src/util/theme-registry.ts +397 -0
- package/src/util/validation.ts +102 -11
- package/src/vite-plugin.ts +8 -4
- package/types/vue-wswg-editor.d.ts +4 -0
- package/dist/types/components/PageRenderer/blockModules.d.ts +0 -3
- package/dist/types/components/PageRenderer/layoutModules.d.ts +0 -3
- package/src/components/PageRenderer/blockModules-alternative.ts.example +0 -9
- package/src/components/PageRenderer/blockModules-manual.ts.example +0 -19
- package/src/components/PageRenderer/blockModules-runtime.ts.example +0 -23
- package/src/components/PageRenderer/blockModules.ts +0 -32
- package/src/components/PageRenderer/layoutModules.ts +0 -32
- package/src/components/WswgJsonEditor/WswgJsonEditor.vue +0 -595
- /package/dist/types/components/{WswgJsonEditor/WswgJsonEditor.test.d.ts → WswgPageBuilder/WswgPageBuilder.test.d.ts} +0 -0
package/dist/vite-plugin.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
function a(
|
|
2
|
-
const
|
|
1
|
+
function a(r) {
|
|
2
|
+
const e = {
|
|
3
3
|
blocks: "\0vue-wswg-editor:blocks",
|
|
4
4
|
fields: "\0vue-wswg-editor:fields",
|
|
5
5
|
layouts: "\0vue-wswg-editor:layouts",
|
|
6
|
-
thumbnails: "\0vue-wswg-editor:thumbnails"
|
|
6
|
+
thumbnails: "\0vue-wswg-editor:thumbnails",
|
|
7
|
+
themes: "\0vue-wswg-editor:themes"
|
|
7
8
|
};
|
|
8
9
|
return {
|
|
9
10
|
name: "vue-wswg-editor-glob-plugin",
|
|
10
11
|
enforce: "pre",
|
|
11
12
|
// Run before other plugins to ensure import.meta.glob is processed correctly
|
|
12
|
-
config(
|
|
13
|
+
config(t) {
|
|
13
14
|
var l;
|
|
14
|
-
const s =
|
|
15
|
-
let
|
|
16
|
-
Array.isArray(o) ?
|
|
15
|
+
const s = t.optimizeDeps || {}, o = s.exclude;
|
|
16
|
+
let u;
|
|
17
|
+
Array.isArray(o) ? u = [...o] : typeof o == "string" ? u = [o] : u = [];
|
|
17
18
|
const n = [
|
|
18
19
|
"vue-wswg-editor",
|
|
19
20
|
"vue-wswg-editor:layouts",
|
|
20
21
|
"vue-wswg-editor:blocks",
|
|
21
22
|
"vue-wswg-editor:fields",
|
|
22
|
-
"vue-wswg-editor:thumbnails"
|
|
23
|
+
"vue-wswg-editor:thumbnails",
|
|
24
|
+
"vue-wswg-editor:themes"
|
|
23
25
|
];
|
|
24
26
|
for (const i of n)
|
|
25
|
-
|
|
27
|
+
u.includes(i) || u.push(i);
|
|
26
28
|
return {
|
|
27
29
|
optimizeDeps: {
|
|
28
30
|
...s,
|
|
29
|
-
exclude:
|
|
31
|
+
exclude: u,
|
|
30
32
|
esbuildOptions: {
|
|
31
33
|
...s.esbuildOptions,
|
|
32
34
|
plugins: [
|
|
@@ -42,31 +44,33 @@ function a(u) {
|
|
|
42
44
|
}
|
|
43
45
|
};
|
|
44
46
|
},
|
|
45
|
-
resolveId(
|
|
46
|
-
if (
|
|
47
|
-
const o =
|
|
48
|
-
if (o in
|
|
49
|
-
return
|
|
47
|
+
resolveId(t) {
|
|
48
|
+
if (t.startsWith("vue-wswg-editor:")) {
|
|
49
|
+
const o = t.replace("vue-wswg-editor:", "");
|
|
50
|
+
if (o in e)
|
|
51
|
+
return e[o];
|
|
50
52
|
}
|
|
51
|
-
if (Object.values(
|
|
52
|
-
return
|
|
53
|
+
if (Object.values(e).includes(t))
|
|
54
|
+
return t;
|
|
53
55
|
},
|
|
54
|
-
load(
|
|
55
|
-
switch (
|
|
56
|
-
case
|
|
57
|
-
return `export const modules = import.meta.glob("${
|
|
58
|
-
case
|
|
59
|
-
return `export const modules = import.meta.glob("${
|
|
60
|
-
case
|
|
61
|
-
return `export const modules = import.meta.glob("${
|
|
62
|
-
case
|
|
63
|
-
return `export const modules = import.meta.glob("${
|
|
56
|
+
load(t) {
|
|
57
|
+
switch (t) {
|
|
58
|
+
case e.layouts:
|
|
59
|
+
return `export const modules = import.meta.glob("${r.rootDir}/*/layout/**/*.vue", { eager: true });`;
|
|
60
|
+
case e.blocks:
|
|
61
|
+
return `export const modules = import.meta.glob("${r.rootDir}/*/blocks/**/*.vue", { eager: true });`;
|
|
62
|
+
case e.fields:
|
|
63
|
+
return `export const modules = import.meta.glob("${r.rootDir}/*/blocks/**/fields.ts", { eager: true });`;
|
|
64
|
+
case e.thumbnails:
|
|
65
|
+
return `export const modules = import.meta.glob(["${r.rootDir}/*/blocks/**/thumbnail.png", "${r.rootDir}/*/thumbnail.jpg", "${r.rootDir}/*/thumbnail.png"], { eager: true });`;
|
|
66
|
+
case e.themes:
|
|
67
|
+
return `export const modules = import.meta.glob("${r.rootDir}/**/theme.config.js", { eager: true });`;
|
|
64
68
|
default:
|
|
65
69
|
return;
|
|
66
70
|
}
|
|
67
71
|
},
|
|
68
|
-
transform(
|
|
69
|
-
if (Object.values(
|
|
72
|
+
transform(t, s) {
|
|
73
|
+
if (Object.values(e).includes(s))
|
|
70
74
|
return null;
|
|
71
75
|
}
|
|
72
76
|
};
|