officialblock 2.1.1 → 2.1.3

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.
@@ -1,9 +1,9 @@
1
- import { defineComponent as O, ref as w, resolveComponent as k, createBlock as f, openBlock as s, withCtx as y, createElementVNode as a, createVNode as c, createElementBlock as g, Fragment as U, renderList as D, createTextVNode as S, toDisplayString as $, normalizeStyle as B, computed as r, normalizeClass as E, createCommentVNode as H } from "vue";
2
- import { P as A, _ as N, a as Y, O as j, r as M } from "./index-QpRJyZ_6.mjs";
3
- const R = { class: "setting-content" }, F = { class: "setting-header flex items-center" }, J = { class: "setting-header flex items-center" }, L = { class: "setting-header flex items-center" }, T = { class: "setting-header flex items-center" }, W = { class: "setting-header flex items-center" }, q = { class: "preview-container" }, G = ["src"], K = {
1
+ import { defineComponent as A, ref as w, resolveComponent as g, createBlock as f, openBlock as i, withCtx as k, createElementVNode as a, createVNode as u, createElementBlock as p, Fragment as D, renderList as N, createTextVNode as B, toDisplayString as H, normalizeStyle as E, computed as d, createCommentVNode as $, normalizeClass as U } from "vue";
2
+ import { P as Y, _ as O, i as j, a as M, O as R, r as F } from "./index-CPFXI7lC.mjs";
3
+ const J = { class: "setting-content" }, L = { class: "setting-header flex items-center" }, T = { class: "setting-header flex items-center" }, W = { class: "setting-header flex items-center" }, q = { class: "setting-header flex items-center" }, G = { class: "setting-header flex items-center" }, K = { class: "setting-header flex items-center" }, Q = { class: "preview-container" }, X = ["src"], Z = {
4
4
  key: 1,
5
5
  class: "no-preview"
6
- }, Q = { class: "setting-body" }, X = { class: "setting-item" }, Z = { class: "components-content" }, _ = /* @__PURE__ */ O({
6
+ }, _ = { class: "setting-body" }, ee = { class: "setting-item" }, te = { class: "components-content" }, ae = /* @__PURE__ */ A({
7
7
  __name: "setting",
8
8
  props: {
9
9
  show: {
@@ -18,7 +18,7 @@ const R = { class: "setting-content" }, F = { class: "setting-header flex items-
18
18
  },
19
19
  emits: ["update:show"],
20
20
  setup(o, { emit: h }) {
21
- const n = o, p = w([
21
+ const n = o, v = w([
22
22
  {
23
23
  id: "preset-1",
24
24
  name: "YCCECE Background 1",
@@ -47,93 +47,99 @@ const R = { class: "setting-content" }, F = { class: "setting-header flex items-
47
47
  size: "100% auto",
48
48
  position: "right bottom"
49
49
  }
50
- ]), m = w(), u = p.value.find((i) => i.image === n.data.backgroundImage);
51
- debugger;
52
- m.value = u ? u.id : "";
53
- const v = () => {
54
- const i = p.value.find((t) => t.id === m.value);
55
- i && (n.data.backgroundImage = `${i.image}`, n.data.backgroundSize = i.size, n.data.backgroundPosition = i.position);
50
+ ]), m = w(), c = v.value.find((r) => r.image === n.data.backgroundImage);
51
+ m.value = c ? c.id : "";
52
+ const b = () => {
53
+ const r = v.value.find((t) => t.id === m.value);
54
+ r && (n.data.backgroundImage = `${r.image}`, n.data.backgroundSize = r.size, n.data.backgroundPosition = r.position);
56
55
  }, V = h, C = () => {
57
56
  V("update:show", !1);
58
57
  };
59
- return (i, t) => {
60
- const x = k("a-option"), P = k("a-select"), z = k("a-button"), b = k("a-input"), I = k("a-drawer");
61
- return s(), f(I, {
58
+ return (r, t) => {
59
+ const P = g("a-switch"), x = g("a-option"), S = g("a-select"), z = g("a-button"), y = g("a-input"), I = g("a-drawer");
60
+ return i(), f(I, {
62
61
  width: "60%",
63
62
  visible: o.show,
64
63
  footer: !1,
65
64
  onCancel: C,
66
65
  unmountOnClose: ""
67
66
  }, {
68
- title: y(() => [
69
- S($(o.data.type) + "组件编辑 ", 1)
67
+ title: k(() => [
68
+ B(H(o.data.type) + "组件编辑 ", 1)
70
69
  ]),
71
- default: y(() => [
72
- a("div", R, [
73
- a("div", F, [
74
- t[6] || (t[6] = a("span", { class: "header-title" }, "Background Preset", -1)),
75
- c(P, {
70
+ default: k(() => [
71
+ a("div", J, [
72
+ a("div", L, [
73
+ t[6] || (t[6] = a("span", { class: "header-title" }, "仅显示PC端", -1)),
74
+ u(P, {
75
+ modelValue: o.data.onlyShowPc,
76
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => o.data.onlyShowPc = e)
77
+ }, null, 8, ["modelValue"])
78
+ ]),
79
+ a("div", T, [
80
+ t[8] || (t[8] = a("span", { class: "header-title" }, "Background Preset", -1)),
81
+ u(S, {
76
82
  modelValue: m.value,
77
- "onUpdate:modelValue": t[0] || (t[0] = (e) => m.value = e),
83
+ "onUpdate:modelValue": t[1] || (t[1] = (e) => m.value = e),
78
84
  style: { width: "300px", "margin-right": "8px" }
79
85
  }, {
80
- default: y(() => [
81
- (s(!0), g(U, null, D(p.value, (e) => (s(), f(x, {
86
+ default: k(() => [
87
+ (i(!0), p(D, null, N(v.value, (e) => (i(), f(x, {
82
88
  value: e.id,
83
89
  key: e.id
84
90
  }, {
85
- default: y(() => [
86
- S($(e.name), 1)
91
+ default: k(() => [
92
+ B(H(e.name), 1)
87
93
  ]),
88
94
  _: 2
89
95
  }, 1032, ["value"]))), 128))
90
96
  ]),
91
97
  _: 1
92
98
  }, 8, ["modelValue"]),
93
- c(z, {
99
+ u(z, {
94
100
  type: "primary",
95
- onClick: v
101
+ onClick: b
96
102
  }, {
97
- default: y(() => [...t[5] || (t[5] = [
98
- S("Apply", -1)
103
+ default: k(() => [...t[7] || (t[7] = [
104
+ B("Apply", -1)
99
105
  ])]),
100
106
  _: 1
101
107
  })
102
108
  ]),
103
- a("div", J, [
104
- t[7] || (t[7] = a("span", { class: "header-title" }, "Image", -1)),
105
- c(b, {
109
+ a("div", W, [
110
+ t[9] || (t[9] = a("span", { class: "header-title" }, "Image", -1)),
111
+ u(y, {
106
112
  modelValue: o.data.backgroundImage,
107
- "onUpdate:modelValue": t[1] || (t[1] = (e) => o.data.backgroundImage = e),
113
+ "onUpdate:modelValue": t[2] || (t[2] = (e) => o.data.backgroundImage = e),
108
114
  placeholder: "图片路径",
109
115
  style: { width: "300px" }
110
116
  }, null, 8, ["modelValue"])
111
117
  ]),
112
- a("div", L, [
113
- t[8] || (t[8] = a("span", { class: "header-title" }, "Size", -1)),
114
- c(b, {
118
+ a("div", q, [
119
+ t[10] || (t[10] = a("span", { class: "header-title" }, "Size", -1)),
120
+ u(y, {
115
121
  modelValue: o.data.backgroundSize,
116
- "onUpdate:modelValue": t[2] || (t[2] = (e) => o.data.backgroundSize = e),
122
+ "onUpdate:modelValue": t[3] || (t[3] = (e) => o.data.backgroundSize = e),
117
123
  placeholder: "尺寸",
118
124
  style: { width: "300px" }
119
125
  }, null, 8, ["modelValue"])
120
126
  ]),
121
- a("div", T, [
122
- t[9] || (t[9] = a("span", { class: "header-title" }, "Position", -1)),
123
- c(b, {
127
+ a("div", G, [
128
+ t[11] || (t[11] = a("span", { class: "header-title" }, "Position", -1)),
129
+ u(y, {
124
130
  modelValue: o.data.backgroundPosition,
125
- "onUpdate:modelValue": t[3] || (t[3] = (e) => o.data.backgroundPosition = e),
131
+ "onUpdate:modelValue": t[4] || (t[4] = (e) => o.data.backgroundPosition = e),
126
132
  placeholder: "位置",
127
133
  style: { width: "300px" }
128
134
  }, null, 8, ["modelValue"])
129
135
  ]),
130
- a("div", W, [
131
- t[11] || (t[11] = a("span", { class: "header-title" }, "Preview", -1)),
132
- a("div", q, [
133
- o.data.backgroundImage ? (s(), g("img", {
136
+ a("div", K, [
137
+ t[13] || (t[13] = a("span", { class: "header-title" }, "Preview", -1)),
138
+ a("div", Q, [
139
+ o.data.backgroundImage ? (i(), p("img", {
134
140
  key: 0,
135
141
  src: o.data.backgroundImage,
136
- style: B({
142
+ style: E({
137
143
  "object-fit": o.data.backgroundSize || "cover",
138
144
  "background-position": o.data.backgroundPosition || "center center",
139
145
  width: "100%",
@@ -141,19 +147,19 @@ const R = { class: "setting-content" }, F = { class: "setting-header flex items-
141
147
  border: "1px solid #ddd"
142
148
  }),
143
149
  alt: "Background Preview"
144
- }, null, 12, G)) : (s(), g("div", K, "No preview available")),
145
- t[10] || (t[10] = a("p", { class: "preview-note" }, " A light grey background has been applied for previewing and will not be reflected on website. ", -1))
150
+ }, null, 12, X)) : (i(), p("div", Z, "No preview available")),
151
+ t[12] || (t[12] = a("p", { class: "preview-note" }, " A light grey background has been applied for previewing and will not be reflected on website. ", -1))
146
152
  ])
147
153
  ]),
148
- a("div", Q, [
149
- t[12] || (t[12] = a("div", { class: "setting-toolbar" }, [
154
+ a("div", _, [
155
+ t[14] || (t[14] = a("div", { class: "setting-toolbar" }, [
150
156
  a("h4", null, "组件")
151
157
  ], -1)),
152
- a("div", X, [
153
- a("div", Z, [
154
- c(A, {
158
+ a("div", ee, [
159
+ a("div", te, [
160
+ u(Y, {
155
161
  data: o.data.data,
156
- onUpdate: t[4] || (t[4] = (e) => o.data.data = e)
162
+ onUpdate: t[5] || (t[5] = (e) => o.data.data = e)
157
163
  }, null, 8, ["data"])
158
164
  ])
159
165
  ])
@@ -164,7 +170,7 @@ const R = { class: "setting-content" }, F = { class: "setting-header flex items-
164
170
  }, 8, ["visible"]);
165
171
  };
166
172
  }
167
- }), ee = /* @__PURE__ */ N(_, [["__scopeId", "data-v-aed41d00"]]), te = { class: "component-wrapper" }, ae = {
173
+ }), oe = /* @__PURE__ */ O(ae, [["__scopeId", "data-v-bb5b5b8c"]]), ne = { class: "component-wrapper" }, le = {
168
174
  __name: "index",
169
175
  props: {
170
176
  modelValue: {
@@ -180,99 +186,104 @@ const R = { class: "setting-content" }, F = { class: "setting-header flex items-
180
186
  },
181
187
  emits: ["update:modelValue", "handleDelete", "handleCopy", "handlePaste"],
182
188
  setup(o, { emit: h }) {
183
- const n = o, p = h, m = r(() => {
189
+ const n = o, v = h, m = d(() => {
184
190
  var e, l;
185
191
  return !((e = n.modelValue) != null && e.data) || !Array.isArray(n.modelValue.data) ? [] : (l = n.modelValue) == null ? void 0 : l.data;
186
- }), u = w(!1), v = w(!1), V = () => {
192
+ }), c = w(!1), b = w(!1), V = () => {
187
193
  var l;
188
194
  if (n.modelValue && n.modelValue.data)
189
195
  return;
190
196
  const e = {
191
- id: ((l = n.modelValue) == null ? void 0 : l.id) || M(),
197
+ id: ((l = n.modelValue) == null ? void 0 : l.id) || F(),
192
198
  //componentKey
193
199
  type: "BackgroundWrapper",
200
+ onlyShowPc: !1,
194
201
  backgroundImage: "",
195
202
  backgroundSize: "",
196
203
  backgroundPosition: "",
197
204
  data: []
198
205
  };
199
- p("update:modelValue", e);
200
- }, C = r(() => {
206
+ v("update:modelValue", e);
207
+ }, C = d(() => {
208
+ var e;
209
+ return n.isPreview ? !((e = n.modelValue) != null && e.onlyShowPc) || !j() : !0;
210
+ }), r = d(() => {
201
211
  var e;
202
212
  return ((e = n.modelValue) == null ? void 0 : e.classes) ?? null;
203
- }), i = r(() => {
213
+ }), t = d(() => {
204
214
  var e;
205
215
  return ((e = n.modelValue) == null ? void 0 : e.style) ?? null;
206
- }), t = r(() => {
216
+ }), P = d(() => {
207
217
  var e;
208
218
  return ((e = n.modelValue) == null ? void 0 : e.width) ?? null;
209
- }), x = r(() => {
219
+ }), x = d(() => {
210
220
  var e;
211
221
  return ((e = n.modelValue) == null ? void 0 : e.backgroundImage) ?? "";
212
- }), P = r(() => {
222
+ }), S = d(() => {
213
223
  var e;
214
224
  return ((e = n.modelValue) == null ? void 0 : e.backgroundColor) ?? "transparent";
215
- }), z = r(() => {
225
+ }), z = d(() => {
216
226
  var e;
217
227
  return ((e = n.modelValue) == null ? void 0 : e.backgroundSize) ?? "contain";
218
- }), b = r(() => {
228
+ }), y = d(() => {
219
229
  var e;
220
230
  return ((e = n.modelValue) == null ? void 0 : e.backgroundPosition) ?? "center";
221
- }), I = r(() => {
231
+ }), I = d(() => {
222
232
  var e;
223
233
  return ((e = n.modelValue) == null ? void 0 : e.backgroundRepeat) ?? "no-repeat";
224
234
  });
225
- return V(), (e, l) => (s(), g("div", {
226
- class: E(["background-wrapper", C.value]),
227
- style: B(i.value),
228
- onMouseover: l[3] || (l[3] = (d) => u.value = !0),
229
- onMouseout: l[4] || (l[4] = (d) => u.value = !1)
235
+ return V(), (e, l) => C.value ? (i(), p("div", {
236
+ key: 0,
237
+ class: U(["background-wrapper", r.value]),
238
+ style: E(t.value),
239
+ onMouseover: l[3] || (l[3] = (s) => c.value = !0),
240
+ onMouseout: l[4] || (l[4] = (s) => c.value = !1)
230
241
  }, [
231
242
  a("div", {
232
- class: E(t.value)
243
+ class: U(P.value)
233
244
  }, [
234
245
  a("div", {
235
246
  class: "background-wrapper__bg",
236
- style: B({
247
+ style: E({
237
248
  "background-image": `url('${x.value}')`,
238
- "background-color": `${P.value}`,
249
+ "background-color": `${S.value}`,
239
250
  "background-size": `${z.value}`,
240
- "background-position": `${b.value}`,
251
+ "background-position": `${y.value}`,
241
252
  "background-repeat": `${I.value}`
242
253
  })
243
254
  }, [
244
- (s(!0), g(U, null, D(m.value, (d, oe) => (s(), g("div", {
245
- key: d.id,
255
+ (i(!0), p(D, null, N(m.value, (s, se) => (i(), p("div", {
256
+ key: s.id,
246
257
  class: "page-item"
247
258
  }, [
248
- a("div", te, [
249
- c(Y, {
250
- type: d.type,
251
- "props-data": { modelValue: d }
259
+ a("div", ne, [
260
+ u(M, {
261
+ type: s.type,
262
+ "props-data": { modelValue: s }
252
263
  }, null, 8, ["type", "props-data"])
253
264
  ])
254
265
  ]))), 128))
255
266
  ], 4),
256
- o.isPreview ? H("", !0) : (s(), f(j, {
267
+ o.isPreview ? $("", !0) : (i(), f(R, {
257
268
  key: 0,
258
- show: u.value,
259
- "onUpdate:show": l[0] || (l[0] = (d) => u.value = d),
260
- onHandleEdit: l[1] || (l[1] = (d) => v.value = !0),
269
+ show: c.value,
270
+ "onUpdate:show": l[0] || (l[0] = (s) => c.value = s),
271
+ onHandleEdit: l[1] || (l[1] = (s) => b.value = !0),
261
272
  onHandleDelete: e.handleDelete,
262
273
  onHandleCopy: e.handleCopy,
263
274
  onHandlePaste: e.handlePaste,
264
275
  style: { top: "-20px" }
265
276
  }, null, 8, ["show", "onHandleDelete", "onHandleCopy", "onHandlePaste"]))
266
277
  ], 2),
267
- o.isPreview ? H("", !0) : (s(), f(ee, {
278
+ o.isPreview ? $("", !0) : (i(), f(oe, {
268
279
  key: 0,
269
- show: v.value,
270
- "onUpdate:show": l[2] || (l[2] = (d) => v.value = d),
280
+ show: b.value,
281
+ "onUpdate:show": l[2] || (l[2] = (s) => b.value = s),
271
282
  data: o.modelValue
272
283
  }, null, 8, ["show", "data"]))
273
- ], 38));
284
+ ], 38)) : $("", !0);
274
285
  }
275
- }, de = /* @__PURE__ */ N(ae, [["__scopeId", "data-v-6acc1a6e"]]);
286
+ }, re = /* @__PURE__ */ O(le, [["__scopeId", "data-v-b9fd2a2e"]]);
276
287
  export {
277
- de as default
288
+ re as default
278
289
  };
@@ -0,0 +1,4 @@
1
+ import { b as f } from "./index-CPFXI7lC.mjs";
2
+ export {
3
+ f as default
4
+ };