@bagelink/blox 1.15.49 → 1.15.53
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/{PreviewApp-0gXN2w30.js → PreviewApp-BrpFk5Ud.js} +1 -1
- package/dist/{PreviewApp-wx1ot38P.cjs → PreviewApp-C6NyDvt7.cjs} +1 -1
- package/dist/PreviewApp.vue.d.ts.map +1 -1
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-DrFY0fJ1.js → PreviewApp.vue_vue_type_style_index_0_lang-weDpp7Uy.js} +52 -25
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-CS0XgXZ9.cjs → PreviewApp.vue_vue_type_style_index_0_lang-y8aUlctU.cjs} +52 -25
- package/dist/PreviewRenderer.d.ts +11 -0
- package/dist/PreviewRenderer.d.ts.map +1 -1
- package/dist/bridge.d.ts +21 -0
- package/dist/bridge.d.ts.map +1 -1
- package/dist/{core-D99Qcs4W.js → core-CIFcs9Cn.js} +1 -1
- package/dist/{core-D_aG0Ax6.cjs → core-ZJ2VPvQb.cjs} +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +3 -3
- package/dist/ssg/index.cjs +1 -1
- package/dist/ssg/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-
|
|
3
|
+
const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-y8aUlctU.cjs");
|
|
4
4
|
exports.default = PreviewApp_vue_vue_type_style_index_0_lang._sfc_main;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewApp.vue.d.ts","sourceRoot":"","sources":["../src/PreviewApp.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"PreviewApp.vue.d.ts","sourceRoot":"","sources":["../src/PreviewApp.vue"],"names":[],"mappings":";AA6RA,wBAMG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, inject, ref, h, provide, onMounted, onUnmounted, openBlock, createElementBlock, createVNode, unref, nextTick } from "vue";
|
|
2
|
-
import { B as BLOX_REGISTRY_KEY, u as useLocale } from "./core-
|
|
2
|
+
import { B as BLOX_REGISTRY_KEY, u as useLocale } from "./core-CIFcs9Cn.js";
|
|
3
3
|
function sendToEditor(msg) {
|
|
4
4
|
window.parent.postMessage(msg, "*");
|
|
5
5
|
}
|
|
@@ -21,6 +21,11 @@ const PreviewRenderer = defineComponent({
|
|
|
21
21
|
hoveredIndex: {
|
|
22
22
|
type: Number,
|
|
23
23
|
default: null
|
|
24
|
+
},
|
|
25
|
+
/** Block types that are global/shared (nav, footer, …) — highlighted distinctly. */
|
|
26
|
+
globalBlockTypes: {
|
|
27
|
+
type: Array,
|
|
28
|
+
default: () => []
|
|
24
29
|
}
|
|
25
30
|
},
|
|
26
31
|
setup(props) {
|
|
@@ -29,6 +34,15 @@ const PreviewRenderer = defineComponent({
|
|
|
29
34
|
function onBlockClick(index) {
|
|
30
35
|
sendToEditor({ type: "BLOX_BLOCK_CLICK", index });
|
|
31
36
|
}
|
|
37
|
+
function onBlockContextMenu(index, event) {
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
sendToEditor({
|
|
40
|
+
type: "BLOX_BLOCK_CONTEXTMENU",
|
|
41
|
+
index,
|
|
42
|
+
x: event.clientX,
|
|
43
|
+
y: event.clientY
|
|
44
|
+
});
|
|
45
|
+
}
|
|
32
46
|
function onBlockEnter(index) {
|
|
33
47
|
localHovered.value = index;
|
|
34
48
|
sendToEditor({ type: "BLOX_BLOCK_HOVER", index });
|
|
@@ -37,29 +51,24 @@ const PreviewRenderer = defineComponent({
|
|
|
37
51
|
localHovered.value = null;
|
|
38
52
|
sendToEditor({ type: "BLOX_BLOCK_HOVER", index: null });
|
|
39
53
|
}
|
|
54
|
+
const REGULAR = { solid: "#6366f1", rgb: "99, 102, 241" };
|
|
55
|
+
const GLOBAL = { solid: "#f59e0b", rgb: "245, 158, 11" };
|
|
40
56
|
const wrapperStyle = { position: "relative", cursor: "pointer" };
|
|
41
|
-
const
|
|
57
|
+
const overlayBaseFor = (rgb) => ({
|
|
42
58
|
position: "absolute",
|
|
43
59
|
inset: "0",
|
|
44
|
-
zIndex: "
|
|
60
|
+
zIndex: "2147483646",
|
|
45
61
|
pointerEvents: "auto",
|
|
46
|
-
transition: "box-shadow 0.12s, background 0.12s"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
const overlaySelected = {
|
|
54
|
-
...overlayBase,
|
|
55
|
-
boxShadow: "inset 0 0 0 3px #6366f1",
|
|
56
|
-
background: "rgba(99, 102, 241, 0.06)"
|
|
57
|
-
};
|
|
58
|
-
const labelBase = {
|
|
62
|
+
transition: "box-shadow 0.12s, background 0.12s",
|
|
63
|
+
boxShadow: "none",
|
|
64
|
+
background: "transparent",
|
|
65
|
+
"--blox-rgb": rgb
|
|
66
|
+
});
|
|
67
|
+
const labelBaseFor = (palette) => ({
|
|
59
68
|
position: "absolute",
|
|
60
69
|
top: "0",
|
|
61
70
|
left: "0",
|
|
62
|
-
zIndex: "
|
|
71
|
+
zIndex: "2147483647",
|
|
63
72
|
padding: "2px 8px",
|
|
64
73
|
fontSize: "11px",
|
|
65
74
|
fontFamily: "system-ui, sans-serif",
|
|
@@ -69,11 +78,10 @@ const PreviewRenderer = defineComponent({
|
|
|
69
78
|
textTransform: "uppercase",
|
|
70
79
|
pointerEvents: "none",
|
|
71
80
|
whiteSpace: "nowrap",
|
|
72
|
-
color:
|
|
73
|
-
background:
|
|
81
|
+
color: palette.solid,
|
|
82
|
+
background: `rgba(${palette.rgb}, 0.12)`,
|
|
74
83
|
borderBottomRightRadius: "4px"
|
|
75
|
-
};
|
|
76
|
-
const labelSelected = { ...labelBase, color: "#fff", background: "#6366f1" };
|
|
84
|
+
});
|
|
77
85
|
return () => h(
|
|
78
86
|
"div",
|
|
79
87
|
{ class: "blox-preview-canvas" },
|
|
@@ -83,7 +91,18 @@ const PreviewRenderer = defineComponent({
|
|
|
83
91
|
const isSelected = props.selectedIndex === i;
|
|
84
92
|
const isHovered = (props.hoveredIndex === i || localHovered.value === i) && !isSelected;
|
|
85
93
|
const { label } = definition.schema;
|
|
86
|
-
const
|
|
94
|
+
const isGlobal = props.globalBlockTypes.includes(block.type);
|
|
95
|
+
const palette = isGlobal ? GLOBAL : REGULAR;
|
|
96
|
+
const overlayStyle = { ...overlayBaseFor(palette.rgb) };
|
|
97
|
+
if (isSelected) {
|
|
98
|
+
overlayStyle.boxShadow = `inset 0 0 0 3px ${palette.solid}`;
|
|
99
|
+
overlayStyle.background = `rgba(${palette.rgb}, 0.06)`;
|
|
100
|
+
} else if (isHovered) {
|
|
101
|
+
overlayStyle.boxShadow = `inset 0 0 0 2px rgba(${palette.rgb}, 0.5)`;
|
|
102
|
+
overlayStyle.background = `rgba(${palette.rgb}, 0.04)`;
|
|
103
|
+
}
|
|
104
|
+
const labelBase = labelBaseFor(palette);
|
|
105
|
+
const labelStyle = isSelected ? { ...labelBase, color: "#fff", background: palette.solid } : labelBase;
|
|
87
106
|
return [
|
|
88
107
|
h(
|
|
89
108
|
"div",
|
|
@@ -94,6 +113,9 @@ const PreviewRenderer = defineComponent({
|
|
|
94
113
|
"onClick": () => {
|
|
95
114
|
onBlockClick(i);
|
|
96
115
|
},
|
|
116
|
+
"onContextmenu": (e) => {
|
|
117
|
+
onBlockContextMenu(i, e);
|
|
118
|
+
},
|
|
97
119
|
"onMouseenter": () => {
|
|
98
120
|
onBlockEnter(i);
|
|
99
121
|
},
|
|
@@ -102,7 +124,7 @@ const PreviewRenderer = defineComponent({
|
|
|
102
124
|
[
|
|
103
125
|
h(definition.component, { ...definition.schema.defaults, ...block.props }),
|
|
104
126
|
h("div", { style: overlayStyle }),
|
|
105
|
-
(isSelected || isHovered) && h("div", { style:
|
|
127
|
+
(isSelected || isHovered) && h("div", { style: labelStyle }, label)
|
|
106
128
|
]
|
|
107
129
|
)
|
|
108
130
|
];
|
|
@@ -120,6 +142,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
120
142
|
const contexts = ref({});
|
|
121
143
|
const selectedIndex = ref(null);
|
|
122
144
|
const hoveredIndex = ref(null);
|
|
145
|
+
const globalBlockTypes = ref([]);
|
|
123
146
|
provide("contexts", contexts);
|
|
124
147
|
let heightObserver = null;
|
|
125
148
|
function onMessage(event) {
|
|
@@ -149,6 +172,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
149
172
|
case "BLOX_HOVER_BLOCK":
|
|
150
173
|
hoveredIndex.value = msg.index;
|
|
151
174
|
break;
|
|
175
|
+
case "BLOX_SET_GLOBAL_BLOCKS":
|
|
176
|
+
globalBlockTypes.value = msg.types ?? [];
|
|
177
|
+
break;
|
|
152
178
|
case "BLOX_SCROLL_TOP":
|
|
153
179
|
window.scrollTo(0, 0);
|
|
154
180
|
break;
|
|
@@ -193,8 +219,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
193
219
|
createVNode(unref(PreviewRenderer), {
|
|
194
220
|
blocks: blocks.value,
|
|
195
221
|
"selected-index": selectedIndex.value,
|
|
196
|
-
"hovered-index": hoveredIndex.value
|
|
197
|
-
|
|
222
|
+
"hovered-index": hoveredIndex.value,
|
|
223
|
+
"global-block-types": globalBlockTypes.value
|
|
224
|
+
}, null, 8, ["blocks", "selected-index", "hovered-index", "global-block-types"])
|
|
198
225
|
]);
|
|
199
226
|
};
|
|
200
227
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const vue = require("vue");
|
|
3
|
-
const core = require("./core-
|
|
3
|
+
const core = require("./core-ZJ2VPvQb.cjs");
|
|
4
4
|
function sendToEditor(msg) {
|
|
5
5
|
window.parent.postMessage(msg, "*");
|
|
6
6
|
}
|
|
@@ -22,6 +22,11 @@ const PreviewRenderer = vue.defineComponent({
|
|
|
22
22
|
hoveredIndex: {
|
|
23
23
|
type: Number,
|
|
24
24
|
default: null
|
|
25
|
+
},
|
|
26
|
+
/** Block types that are global/shared (nav, footer, …) — highlighted distinctly. */
|
|
27
|
+
globalBlockTypes: {
|
|
28
|
+
type: Array,
|
|
29
|
+
default: () => []
|
|
25
30
|
}
|
|
26
31
|
},
|
|
27
32
|
setup(props) {
|
|
@@ -30,6 +35,15 @@ const PreviewRenderer = vue.defineComponent({
|
|
|
30
35
|
function onBlockClick(index) {
|
|
31
36
|
sendToEditor({ type: "BLOX_BLOCK_CLICK", index });
|
|
32
37
|
}
|
|
38
|
+
function onBlockContextMenu(index, event) {
|
|
39
|
+
event.preventDefault();
|
|
40
|
+
sendToEditor({
|
|
41
|
+
type: "BLOX_BLOCK_CONTEXTMENU",
|
|
42
|
+
index,
|
|
43
|
+
x: event.clientX,
|
|
44
|
+
y: event.clientY
|
|
45
|
+
});
|
|
46
|
+
}
|
|
33
47
|
function onBlockEnter(index) {
|
|
34
48
|
localHovered.value = index;
|
|
35
49
|
sendToEditor({ type: "BLOX_BLOCK_HOVER", index });
|
|
@@ -38,29 +52,24 @@ const PreviewRenderer = vue.defineComponent({
|
|
|
38
52
|
localHovered.value = null;
|
|
39
53
|
sendToEditor({ type: "BLOX_BLOCK_HOVER", index: null });
|
|
40
54
|
}
|
|
55
|
+
const REGULAR = { solid: "#6366f1", rgb: "99, 102, 241" };
|
|
56
|
+
const GLOBAL = { solid: "#f59e0b", rgb: "245, 158, 11" };
|
|
41
57
|
const wrapperStyle = { position: "relative", cursor: "pointer" };
|
|
42
|
-
const
|
|
58
|
+
const overlayBaseFor = (rgb) => ({
|
|
43
59
|
position: "absolute",
|
|
44
60
|
inset: "0",
|
|
45
|
-
zIndex: "
|
|
61
|
+
zIndex: "2147483646",
|
|
46
62
|
pointerEvents: "auto",
|
|
47
|
-
transition: "box-shadow 0.12s, background 0.12s"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
const overlaySelected = {
|
|
55
|
-
...overlayBase,
|
|
56
|
-
boxShadow: "inset 0 0 0 3px #6366f1",
|
|
57
|
-
background: "rgba(99, 102, 241, 0.06)"
|
|
58
|
-
};
|
|
59
|
-
const labelBase = {
|
|
63
|
+
transition: "box-shadow 0.12s, background 0.12s",
|
|
64
|
+
boxShadow: "none",
|
|
65
|
+
background: "transparent",
|
|
66
|
+
"--blox-rgb": rgb
|
|
67
|
+
});
|
|
68
|
+
const labelBaseFor = (palette) => ({
|
|
60
69
|
position: "absolute",
|
|
61
70
|
top: "0",
|
|
62
71
|
left: "0",
|
|
63
|
-
zIndex: "
|
|
72
|
+
zIndex: "2147483647",
|
|
64
73
|
padding: "2px 8px",
|
|
65
74
|
fontSize: "11px",
|
|
66
75
|
fontFamily: "system-ui, sans-serif",
|
|
@@ -70,11 +79,10 @@ const PreviewRenderer = vue.defineComponent({
|
|
|
70
79
|
textTransform: "uppercase",
|
|
71
80
|
pointerEvents: "none",
|
|
72
81
|
whiteSpace: "nowrap",
|
|
73
|
-
color:
|
|
74
|
-
background:
|
|
82
|
+
color: palette.solid,
|
|
83
|
+
background: `rgba(${palette.rgb}, 0.12)`,
|
|
75
84
|
borderBottomRightRadius: "4px"
|
|
76
|
-
};
|
|
77
|
-
const labelSelected = { ...labelBase, color: "#fff", background: "#6366f1" };
|
|
85
|
+
});
|
|
78
86
|
return () => vue.h(
|
|
79
87
|
"div",
|
|
80
88
|
{ class: "blox-preview-canvas" },
|
|
@@ -84,7 +92,18 @@ const PreviewRenderer = vue.defineComponent({
|
|
|
84
92
|
const isSelected = props.selectedIndex === i;
|
|
85
93
|
const isHovered = (props.hoveredIndex === i || localHovered.value === i) && !isSelected;
|
|
86
94
|
const { label } = definition.schema;
|
|
87
|
-
const
|
|
95
|
+
const isGlobal = props.globalBlockTypes.includes(block.type);
|
|
96
|
+
const palette = isGlobal ? GLOBAL : REGULAR;
|
|
97
|
+
const overlayStyle = { ...overlayBaseFor(palette.rgb) };
|
|
98
|
+
if (isSelected) {
|
|
99
|
+
overlayStyle.boxShadow = `inset 0 0 0 3px ${palette.solid}`;
|
|
100
|
+
overlayStyle.background = `rgba(${palette.rgb}, 0.06)`;
|
|
101
|
+
} else if (isHovered) {
|
|
102
|
+
overlayStyle.boxShadow = `inset 0 0 0 2px rgba(${palette.rgb}, 0.5)`;
|
|
103
|
+
overlayStyle.background = `rgba(${palette.rgb}, 0.04)`;
|
|
104
|
+
}
|
|
105
|
+
const labelBase = labelBaseFor(palette);
|
|
106
|
+
const labelStyle = isSelected ? { ...labelBase, color: "#fff", background: palette.solid } : labelBase;
|
|
88
107
|
return [
|
|
89
108
|
vue.h(
|
|
90
109
|
"div",
|
|
@@ -95,6 +114,9 @@ const PreviewRenderer = vue.defineComponent({
|
|
|
95
114
|
"onClick": () => {
|
|
96
115
|
onBlockClick(i);
|
|
97
116
|
},
|
|
117
|
+
"onContextmenu": (e) => {
|
|
118
|
+
onBlockContextMenu(i, e);
|
|
119
|
+
},
|
|
98
120
|
"onMouseenter": () => {
|
|
99
121
|
onBlockEnter(i);
|
|
100
122
|
},
|
|
@@ -103,7 +125,7 @@ const PreviewRenderer = vue.defineComponent({
|
|
|
103
125
|
[
|
|
104
126
|
vue.h(definition.component, { ...definition.schema.defaults, ...block.props }),
|
|
105
127
|
vue.h("div", { style: overlayStyle }),
|
|
106
|
-
(isSelected || isHovered) && vue.h("div", { style:
|
|
128
|
+
(isSelected || isHovered) && vue.h("div", { style: labelStyle }, label)
|
|
107
129
|
]
|
|
108
130
|
)
|
|
109
131
|
];
|
|
@@ -121,6 +143,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
121
143
|
const contexts = vue.ref({});
|
|
122
144
|
const selectedIndex = vue.ref(null);
|
|
123
145
|
const hoveredIndex = vue.ref(null);
|
|
146
|
+
const globalBlockTypes = vue.ref([]);
|
|
124
147
|
vue.provide("contexts", contexts);
|
|
125
148
|
let heightObserver = null;
|
|
126
149
|
function onMessage(event) {
|
|
@@ -150,6 +173,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
150
173
|
case "BLOX_HOVER_BLOCK":
|
|
151
174
|
hoveredIndex.value = msg.index;
|
|
152
175
|
break;
|
|
176
|
+
case "BLOX_SET_GLOBAL_BLOCKS":
|
|
177
|
+
globalBlockTypes.value = msg.types ?? [];
|
|
178
|
+
break;
|
|
153
179
|
case "BLOX_SCROLL_TOP":
|
|
154
180
|
window.scrollTo(0, 0);
|
|
155
181
|
break;
|
|
@@ -194,8 +220,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
194
220
|
vue.createVNode(vue.unref(PreviewRenderer), {
|
|
195
221
|
blocks: blocks.value,
|
|
196
222
|
"selected-index": selectedIndex.value,
|
|
197
|
-
"hovered-index": hoveredIndex.value
|
|
198
|
-
|
|
223
|
+
"hovered-index": hoveredIndex.value,
|
|
224
|
+
"global-block-types": globalBlockTypes.value
|
|
225
|
+
}, null, 8, ["blocks", "selected-index", "hovered-index", "global-block-types"])
|
|
199
226
|
]);
|
|
200
227
|
};
|
|
201
228
|
}
|
|
@@ -13,6 +13,11 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
13
13
|
type: PropType<number | null>;
|
|
14
14
|
default: null;
|
|
15
15
|
};
|
|
16
|
+
/** Block types that are global/shared (nav, footer, …) — highlighted distinctly. */
|
|
17
|
+
globalBlockTypes: {
|
|
18
|
+
type: PropType<string[]>;
|
|
19
|
+
default: () => string[];
|
|
20
|
+
};
|
|
16
21
|
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
17
22
|
[key: string]: any;
|
|
18
23
|
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
@@ -28,10 +33,16 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
28
33
|
type: PropType<number | null>;
|
|
29
34
|
default: null;
|
|
30
35
|
};
|
|
36
|
+
/** Block types that are global/shared (nav, footer, …) — highlighted distinctly. */
|
|
37
|
+
globalBlockTypes: {
|
|
38
|
+
type: PropType<string[]>;
|
|
39
|
+
default: () => string[];
|
|
40
|
+
};
|
|
31
41
|
}>> & Readonly<{}>, {
|
|
32
42
|
blocks: Block[];
|
|
33
43
|
selectedIndex: number | null;
|
|
34
44
|
hoveredIndex: number | null;
|
|
45
|
+
globalBlockTypes: string[];
|
|
35
46
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
36
47
|
export default _default;
|
|
37
48
|
//# sourceMappingURL=PreviewRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewRenderer.d.ts","sourceRoot":"","sources":["../src/PreviewRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;;;cAatB,QAAQ,CAAC,KAAK,EAAE,CAAC;uBACnB,KAAK,EAAE;;;cAGJ,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC;;;;cAIvB,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC
|
|
1
|
+
{"version":3,"file":"PreviewRenderer.d.ts","sourceRoot":"","sources":["../src/PreviewRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;;;cAatB,QAAQ,CAAC,KAAK,EAAE,CAAC;uBACnB,KAAK,EAAE;;;cAGJ,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC;;;;cAIvB,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC;;;IAGxC,oFAAoF;;cAEpE,QAAQ,CAAC,MAAM,EAAE,CAAC;uBACpB,MAAM,EAAE;;;;;;cAdN,QAAQ,CAAC,KAAK,EAAE,CAAC;uBACnB,KAAK,EAAE;;;cAGJ,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC;;;;cAIvB,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC;;;IAGxC,oFAAoF;;cAEpE,QAAQ,CAAC,MAAM,EAAE,CAAC;uBACpB,MAAM,EAAE;;;;;;;;AAlBxB,wBA8HE"}
|
package/dist/bridge.d.ts
CHANGED
|
@@ -29,6 +29,15 @@ export type EditorMessage = {
|
|
|
29
29
|
} | {
|
|
30
30
|
type: 'BLOX_SCROLL_TOP';
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Tells the preview which block types are global/shared (e.g. nav, footer).
|
|
34
|
+
* The preview renders their selection/hover overlay in a distinct color so
|
|
35
|
+
* it's clear editing them affects every page.
|
|
36
|
+
*/
|
|
37
|
+
| {
|
|
38
|
+
type: 'BLOX_SET_GLOBAL_BLOCKS';
|
|
39
|
+
types: string[];
|
|
40
|
+
}
|
|
32
41
|
/**
|
|
33
42
|
* Tells the preview that a global/shared block's content changed (e.g. the
|
|
34
43
|
* editor saved the nav or footer singleton). Global block components should
|
|
@@ -48,6 +57,18 @@ export type PreviewMessage = {
|
|
|
48
57
|
} | {
|
|
49
58
|
type: 'BLOX_BLOCK_HOVER';
|
|
50
59
|
index: number | null;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Right-click on a block in the preview. `x`/`y` are the pointer position
|
|
63
|
+
* relative to the iframe viewport; the editor maps them to its own
|
|
64
|
+
* coordinate space (accounting for the iframe offset + zoom) to open a
|
|
65
|
+
* context menu.
|
|
66
|
+
*/
|
|
67
|
+
| {
|
|
68
|
+
type: 'BLOX_BLOCK_CONTEXTMENU';
|
|
69
|
+
index: number;
|
|
70
|
+
x: number;
|
|
71
|
+
y: number;
|
|
51
72
|
} | {
|
|
52
73
|
type: 'BLOX_HEIGHT';
|
|
53
74
|
height: number;
|
package/dist/bridge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAEzD,MAAM,WAAW,eAAe;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,gBAAgB,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAMD,MAAM,MAAM,aAAa,GACpB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,eAAe,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,MAAM,EAAE,KAAK,EAAE,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GACnD;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAClD;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE;AA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.addRoute({
|
|
405
405
|
path: "/_blox_preview",
|
|
406
|
-
component: () => import("./PreviewApp-
|
|
406
|
+
component: () => import("./PreviewApp-BrpFk5Ud.js"),
|
|
407
407
|
beforeEnter: () => window.parent !== window ? true : "/"
|
|
408
408
|
});
|
|
409
409
|
router.addRoute({ path: "/:pathMatch(.*)*", component: _sfc_main$1 });
|
|
@@ -404,7 +404,7 @@ class BloxInstance {
|
|
|
404
404
|
}
|
|
405
405
|
router.addRoute({
|
|
406
406
|
path: "/_blox_preview",
|
|
407
|
-
component: () => Promise.resolve().then(() => require("./PreviewApp-
|
|
407
|
+
component: () => Promise.resolve().then(() => require("./PreviewApp-C6NyDvt7.cjs")),
|
|
408
408
|
beforeEnter: () => window.parent !== window ? true : "/"
|
|
409
409
|
});
|
|
410
410
|
router.addRoute({ path: "/:pathMatch(.*)*", component: _sfc_main$1 });
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const core = require("./core-
|
|
4
|
-
const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-
|
|
3
|
+
const core = require("./core-ZJ2VPvQb.cjs");
|
|
4
|
+
const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-y8aUlctU.cjs");
|
|
5
5
|
const vue = require("vue");
|
|
6
6
|
const vueRouter = require("vue-router");
|
|
7
7
|
const pinia = require("pinia");
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as BLOX_LOCALE_STRATEGY_KEY, u as useLocale, c as createBlox } from "./core-
|
|
2
|
-
import { b, d, _, P, e, l, r } from "./core-
|
|
3
|
-
import { _ as _2, P as P2, s, a } from "./PreviewApp.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import { a as BLOX_LOCALE_STRATEGY_KEY, u as useLocale, c as createBlox } from "./core-CIFcs9Cn.js";
|
|
2
|
+
import { b, d, _, P, e, l, r } from "./core-CIFcs9Cn.js";
|
|
3
|
+
import { _ as _2, P as P2, s, a } from "./PreviewApp.vue_vue_type_style_index_0_lang-weDpp7Uy.js";
|
|
4
4
|
import { ref, onMounted, onUnmounted, inject, computed, createApp, markRaw } from "vue";
|
|
5
5
|
import { useRouter } from "vue-router";
|
|
6
6
|
import { createPinia } from "pinia";
|
package/dist/ssg/index.cjs
CHANGED
|
@@ -26,7 +26,7 @@ const prerender = require("../prerender-DH6Arhpk.cjs");
|
|
|
26
26
|
const ssg_client = require("./client.cjs");
|
|
27
27
|
const pinia = require("pinia");
|
|
28
28
|
const vue = require("vue");
|
|
29
|
-
const core = require("../core-
|
|
29
|
+
const core = require("../core-ZJ2VPvQb.cjs");
|
|
30
30
|
async function renderBloxSsgPage(options) {
|
|
31
31
|
const {
|
|
32
32
|
url,
|
package/dist/ssg/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { BLOX_STATE_WINDOW_KEY, BLOX_COLLECTIONS_WINDOW_KEY, BLOX_WEBSITE_ID_WIN
|
|
|
4
4
|
import { getCollectionCache, getEmbeddedWebsiteId, installBloxStateCache, installCollectionCache } from "./client.mjs";
|
|
5
5
|
import { createPinia } from "pinia";
|
|
6
6
|
import { createSSRApp, markRaw } from "vue";
|
|
7
|
-
import { c as createBlox } from "../core-
|
|
7
|
+
import { c as createBlox } from "../core-CIFcs9Cn.js";
|
|
8
8
|
async function renderBloxSsgPage(options) {
|
|
9
9
|
const {
|
|
10
10
|
url,
|
package/package.json
CHANGED