@opentiny/tiny-engine-toolbar-media 2.3.1 → 2.4.0

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/index.js CHANGED
@@ -1,15 +1,10 @@
1
1
  import "./style.css";
2
- import { resolveComponent as f, createBlock as T, openBlock as v, withCtx as c, createElementVNode as t, createCommentVNode as W, createElementBlock as I, Fragment as X, renderList as Y, normalizeClass as Z, createVNode as g, createTextVNode as D, toDisplayString as r, ref as _, computed as B, reactive as $, toRaw as ee, watch as E, watchEffect as te, onMounted as ne, onUnmounted as ie } from "vue";
2
+ import { ref as _, computed as B, reactive as X, toRaw as Y, watch as M, watchEffect as Z, onMounted as $, onUnmounted as ee, resolveComponent as f, createBlock as T, openBlock as v, withCtx as c, createElementVNode as t, createCommentVNode as W, createElementBlock as I, Fragment as te, renderList as ne, normalizeClass as ie, createVNode as g, createTextVNode as D, toDisplayString as r } from "vue";
3
3
  import { Switch as oe, Input as ae, Popover as le } from "@opentiny/vue";
4
4
  import { IconWebPlus as N } from "@opentiny/vue-icon";
5
- import { useLayout as V, useCanvas as F } from "@opentiny/tiny-engine-meta-register";
5
+ import { useLayout as V, useCanvas as A } from "@opentiny/tiny-engine-meta-register";
6
6
  import { ToolbarBase as se } from "@opentiny/tiny-engine-common";
7
- const de = (h, n) => {
8
- const d = h.__vccOpts || h;
9
- for (const [i, p] of n)
10
- d[i] = p;
11
- return d;
12
- }, re = {
7
+ const de = {
13
8
  components: {
14
9
  TinyPopover: le,
15
10
  TinyInput: ae,
@@ -32,7 +27,7 @@ const de = (h, n) => {
32
27
  },
33
28
  setup(h, { emit: n }) {
34
29
  let d = null, i = "", p = "";
35
- const { layoutState: w } = V(), u = _(!1), b = _(!1), m = _(!1), { getCanvasType: y } = F().canvasApi.value, C = _((y == null ? void 0 : y()) === "absolute"), o = B(() => V().getDimension()), x = B(() => o.value.scale * 100), a = $({
30
+ const { layoutState: w } = V(), u = _(!1), b = _(!1), m = _(!1), { getCanvasType: y } = A().canvasApi.value, C = _((y == null ? void 0 : y()) === "absolute"), o = B(() => V().getDimension()), x = B(() => o.value.scale * 100), a = X({
36
31
  activeIndex: 0,
37
32
  guideValue: "",
38
33
  width: "",
@@ -164,7 +159,7 @@ const de = (h, n) => {
164
159
  }, P = (e) => {
165
160
  const l = document.querySelector(".reference-text"), s = l == null ? void 0 : l.contains(e.target);
166
161
  l !== e.target && !s && (w.toolbars.visiblePopover = !1);
167
- }, k = a.media.reduce((e, l, s) => (e[l.view] = { ...ee(l), index: s }, e), {}), S = (e) => {
162
+ }, k = a.media.reduce((e, l, s) => (e[l.view] = { ...Y(l), index: s }, e), {}), E = (e) => {
168
163
  h.isCanvas ? V().setDimension({
169
164
  deviceType: e.view,
170
165
  width: e.width,
@@ -186,10 +181,10 @@ const de = (h, n) => {
186
181
  { type: "desktop", min: 992, max: 1200 },
187
182
  { type: "mdx", min: 1200, max: 1920 }
188
183
  ], G = (e) => {
189
- var M;
184
+ var F;
190
185
  const l = /^\d+$/;
191
186
  String(e).match(l) ? Number(e) < 240 ? a.width = 240 : Number(e) > 1920 ? a.width = 1920 : a.width = e : a.width = i || parseInt(o.value.width, 10);
192
- const s = Number(a.width), Q = ((M = R.find((A) => A.min <= s && s <= A.max)) == null ? void 0 : M.type) || "desktop";
187
+ const s = Number(a.width), Q = ((F = R.find((S) => S.min <= s && s <= S.max)) == null ? void 0 : F.type) || "desktop";
193
188
  z(s, Q);
194
189
  }, H = (e) => {
195
190
  const l = k.mdx, s = /^\d+(\.\d+)?$/;
@@ -197,30 +192,30 @@ const de = (h, n) => {
197
192
  scale: Number(a.scaleValue) / 100
198
193
  });
199
194
  }, J = (e) => {
200
- const { setCanvasType: l } = F().canvasApi.value;
195
+ const { setCanvasType: l } = A().canvasApi.value;
201
196
  l(e ? "absolute" : "normal");
202
197
  };
203
- E(
198
+ M(
204
199
  () => o.value.deviceType,
205
200
  (e) => {
206
201
  a.activeIndex = k[e].index, a.readonly = e !== "mdx";
207
202
  },
208
203
  { immediate: !0 }
209
- ), te(() => {
204
+ ), Z(() => {
210
205
  a.scaleValue = x.value.toFixed(2), p = x.value;
211
- }), E(
206
+ }), M(
212
207
  () => o.value.width,
213
208
  (e) => {
214
209
  const l = parseInt(e, 10);
215
210
  Number.isInteger(l) && (a.width = l, i = l);
216
211
  }
217
- ), ne(() => {
212
+ ), $(() => {
218
213
  document.addEventListener("click", P);
219
- }), ie(() => {
214
+ }), ee(() => {
220
215
  document.removeEventListener("click", P);
221
216
  });
222
217
  const K = o.value.deviceType || "desktop";
223
- return S(k[K]), {
218
+ return E(k[K]), {
224
219
  scale: x,
225
220
  state: a,
226
221
  active: b,
@@ -232,7 +227,7 @@ const de = (h, n) => {
232
227
  hideTips: U,
233
228
  timer: d,
234
229
  dimension: o,
235
- setViewPort: S,
230
+ setViewPort: E,
236
231
  showPopover: j,
237
232
  hidePopover: q,
238
233
  widthChange: G,
@@ -241,6 +236,11 @@ const de = (h, n) => {
241
236
  changeCanvasType: J
242
237
  };
243
238
  }
239
+ }, re = (h, n) => {
240
+ const d = h.__vccOpts || h;
241
+ for (const [i, p] of n)
242
+ d[i] = p;
243
+ return d;
244
244
  }, ce = { class: "toolbar-wrap" }, pe = { class: "toolbar-icon-wrap" }, ue = ["onClick"], me = { class: "media-content" }, xe = { class: "media-title" }, ve = {
245
245
  key: 0,
246
246
  class: "sub-title"
@@ -254,9 +254,9 @@ function ge(h, n, d, i, p, w) {
254
254
  default: c(() => [
255
255
  t("div", ce, [
256
256
  t("div", pe, [
257
- (v(!0), I(X, null, Y(i.state.media, (o, x) => (v(), I("span", {
257
+ (v(!0), I(te, null, ne(i.state.media, (o, x) => (v(), I("span", {
258
258
  key: x,
259
- class: Z(["icon", { active: i.state.activeIndex === x, "is-rotate": o.view === "lanMobile" }]),
259
+ class: ie(["icon", { active: i.state.activeIndex === x, "is-rotate": o.view === "lanMobile" }]),
260
260
  onClick: (a) => i.setViewPort(o)
261
261
  }, [
262
262
  g(b, {
@@ -362,7 +362,7 @@ function ge(h, n, d, i, p, w) {
362
362
  _: 1
363
363
  }, 8, ["options"]);
364
364
  }
365
- const Ve = /* @__PURE__ */ de(re, [["render", ge], ["__scopeId", "data-v-d5d5a44d"]]), ke = {
365
+ const Ve = /* @__PURE__ */ re(de, [["render", ge], ["__scopeId", "data-v-9173161d"]]), ke = {
366
366
  id: "engine.toolbars.media",
367
367
  type: "toolbars",
368
368
  title: "media",
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .toolbar-wrap[data-v-d5d5a44d]{display:flex;align-items:center}.toolbar-wrap .reference-text[data-v-d5d5a44d]{cursor:pointer;height:var(--base-top-panel-height);line-height:var(--base-top-panel-height);padding:0 7px;color:var(--te-toolbars-media-text-color-secondary);display:inline-block}.toolbar-wrap .reference-text>span[data-v-d5d5a44d]:last-child{margin-left:8px}.toolbar-wrap .toolbar-icon-wrap[data-v-d5d5a44d]{display:flex;flex-wrap:nowrap;align-items:center;gap:6px}.toolbar-wrap .toolbar-icon-wrap .icon[data-v-d5d5a44d]{width:24px;height:24px;display:inline-flex;justify-content:center;align-items:center;border-radius:4px}.toolbar-wrap .toolbar-icon-wrap .icon svg[data-v-d5d5a44d]{cursor:pointer;color:var(--te-toolbars-media-text-color-primary);outline:none;width:18px;height:18px;margin-top:-.5px}.toolbar-wrap .toolbar-icon-wrap .icon.active[data-v-d5d5a44d],.toolbar-wrap .toolbar-icon-wrap .icon[data-v-d5d5a44d]:hover{background:var(--te-toolbars-media-bg-color-active)}.toolbar-wrap .toolbar-icon-wrap .icon.active svg[data-v-d5d5a44d]{color:var(--te-toolbars-media-text-color-checked)}.toolbar-wrap .more-setting .setting-item[data-v-d5d5a44d]{display:flex;justify-content:space-between;padding:12px}.media-content[data-v-d5d5a44d]{line-height:18px}.media-content .media-title[data-v-d5d5a44d]{font-weight:600}.media-content .content[data-v-d5d5a44d]{color:var(--te-toolbars-media-text-color-secondary)}.setting-content[data-v-d5d5a44d]{padding:12px 8px}.content-wrap .title[data-v-d5d5a44d]{font-weight:600;margin-bottom:16px}.content-wrap .setting[data-v-d5d5a44d]{display:flex;flex-direction:column;gap:12px}.content-wrap .setting div[data-v-d5d5a44d]{display:flex;align-items:center;justify-content:space-between}.content-wrap .setting div label[data-v-d5d5a44d]{color:var(--te-toolbars-media-text-color-secondary);min-width:64px}.content-wrap .setting div[data-v-d5d5a44d]:last-child{justify-content:flex-start}:root{--te-toolbars-media-text-color-secondary: var(--te-common-text-secondary);--te-toolbars-media-text-color-primary: var(--te-common-text-primary);--te-toolbars-media-text-color-checked: var(--te-common-text-checked);--te-toolbars-media-bg-color-active: var(--te-common-bg-prompt)}
1
+ .toolbar-wrap[data-v-9173161d]{display:flex;align-items:center}.toolbar-wrap .reference-text[data-v-9173161d]{cursor:pointer;height:var(--base-top-panel-height);line-height:var(--base-top-panel-height);padding:0 7px;color:var(--te-toolbars-media-text-color-secondary);display:inline-block}.toolbar-wrap .reference-text>span[data-v-9173161d]:last-child{margin-left:8px}.toolbar-wrap .toolbar-icon-wrap[data-v-9173161d]{display:flex;flex-wrap:nowrap;align-items:center;gap:6px}.toolbar-wrap .toolbar-icon-wrap .icon[data-v-9173161d]{width:24px;height:24px;display:inline-flex;justify-content:center;align-items:center;border-radius:4px}.toolbar-wrap .toolbar-icon-wrap .icon svg[data-v-9173161d]{cursor:pointer;color:var(--te-toolbars-media-text-color-primary);outline:none;width:18px;height:18px;margin-top:-.5px}.toolbar-wrap .toolbar-icon-wrap .icon.active[data-v-9173161d],.toolbar-wrap .toolbar-icon-wrap .icon[data-v-9173161d]:hover{background:var(--te-toolbars-media-bg-color-active)}.toolbar-wrap .toolbar-icon-wrap .icon.active svg[data-v-9173161d]{color:var(--te-toolbars-media-text-color-checked)}.toolbar-wrap .more-setting .setting-item[data-v-9173161d]{display:flex;justify-content:space-between;padding:12px}.media-content[data-v-9173161d]{line-height:18px}.media-content .media-title[data-v-9173161d]{font-weight:600}.media-content .content[data-v-9173161d]{color:var(--te-toolbars-media-text-color-secondary)}.setting-content[data-v-9173161d]{padding:12px 8px}.content-wrap .title[data-v-9173161d]{font-weight:600;margin-bottom:16px}.content-wrap .setting[data-v-9173161d]{display:flex;flex-direction:column;gap:12px}.content-wrap .setting div[data-v-9173161d]{display:flex;align-items:center;justify-content:space-between}.content-wrap .setting div label[data-v-9173161d]{color:var(--te-toolbars-media-text-color-secondary);min-width:64px}.content-wrap .setting div[data-v-9173161d]:last-child{justify-content:flex-start}:root{--te-toolbars-media-text-color-secondary: var(--te-common-text-secondary);--te-toolbars-media-text-color-primary: var(--te-common-text-primary);--te-toolbars-media-text-color-checked: var(--te-common-text-checked);--te-toolbars-media-bg-color-active: var(--te-common-bg-prompt)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/tiny-engine-toolbar-media",
3
- "version": "2.3.1",
3
+ "version": "2.4.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -25,11 +25,11 @@
25
25
  "license": "MIT",
26
26
  "homepage": "https://opentiny.design/tiny-engine",
27
27
  "dependencies": {
28
- "@opentiny/tiny-engine-common": "2.3.1",
29
- "@opentiny/tiny-engine-meta-register": "2.3.0"
28
+ "@opentiny/tiny-engine-common": "2.4.0",
29
+ "@opentiny/tiny-engine-meta-register": "2.4.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@opentiny/tiny-engine-vite-plugin-meta-comments": "2.3.0",
32
+ "@opentiny/tiny-engine-vite-plugin-meta-comments": "2.4.0",
33
33
  "@vitejs/plugin-vue": "^5.1.2",
34
34
  "@vitejs/plugin-vue-jsx": "^4.0.1",
35
35
  "vite": "^5.4.2"
@@ -39,5 +39,5 @@
39
39
  "@opentiny/vue-icon": "^3.20.0",
40
40
  "vue": "^3.4.15"
41
41
  },
42
- "gitHead": "9eb2dbacfdb9fd9648b66621d6340ac502efd4b3"
42
+ "gitHead": "477aa411da11a4f95712e3e5c251d97cae23f4ad"
43
43
  }