@opentiny/tiny-engine-toolbar-media 2.8.0-alpha.2 → 2.8.0-alpha.4

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,9 +1,9 @@
1
1
  import "./style.css";
2
- import { useLayout as h, useCanvas as _, callEntry as V, useCompile as X } from "@opentiny/tiny-engine-meta-register";
2
+ import { useLayout as u, useCanvas as f, callEntry as _, useCompile as X } from "@opentiny/tiny-engine-meta-register";
3
3
  import { ref as q, computed as Y, reactive as ee, toRaw as te, watch as Z, watchEffect as ae, onMounted as ne, onUnmounted as ie, resolveComponent as O, createBlock as z, openBlock as L, withCtx as F, createElementVNode as o, createCommentVNode as R, createElementBlock as G, Fragment as oe, renderList as le, normalizeClass as se, createVNode as j, createTextVNode as H, toDisplayString as B } from "vue";
4
4
  import { Switch as de, Input as ce, Popover as re } from "@opentiny/vue";
5
5
  import { IconWebPlus as y } from "@opentiny/vue-icon";
6
- import { ToolbarBase as U } from "@opentiny/tiny-engine-common";
6
+ import { ToolbarBase as W } from "@opentiny/tiny-engine-common";
7
7
  const J = {
8
8
  id: "engine.toolbars.media",
9
9
  type: "toolbars",
@@ -19,7 +19,7 @@ const J = {
19
19
  TinyPopover: re,
20
20
  TinyInput: ce,
21
21
  TinySwitch: de,
22
- ToolbarBase: U
22
+ ToolbarBase: W
23
23
  },
24
24
  props: {
25
25
  data: {
@@ -40,10 +40,10 @@ const J = {
40
40
  }) {
41
41
  let l = null, t = "", s = "";
42
42
  const {
43
- layoutState: p
44
- } = h(), d = q(!1), u = q(!1), c = q(!1), {
45
- getCanvasType: x
46
- } = _().canvasApi.value, w = q((x == null ? void 0 : x()) === "absolute"), a = Y(() => h().getDimension()), r = Y(() => a.value.scale * 100), n = ee({
43
+ layoutState: x
44
+ } = u(), d = q(!1), p = q(!1), c = q(!1), {
45
+ getCanvasType: h
46
+ } = f().canvasApi.value, w = q((h == null ? void 0 : h()) === "absolute"), a = Y(() => u().getDimension()), r = Y(() => a.value.scale * 100), n = ee({
47
47
  activeIndex: 0,
48
48
  guideValue: "",
49
49
  width: "",
@@ -144,8 +144,8 @@ const J = {
144
144
  content: "此处添加的样式将适用于 480 像素及以下。",
145
145
  enContent: "styles added here will apply at 480px and down."
146
146
  }]
147
- }), C = V(() => {
148
- u.value = !1;
147
+ }), V = _(() => {
148
+ p.value = !1;
149
149
  }, {
150
150
  metaData: {
151
151
  id: "engine.toolbars.media.Main.hide"
@@ -156,35 +156,35 @@ const J = {
156
156
  timer: l,
157
157
  prevWidthVal: t,
158
158
  prevScaleVal: s,
159
- layoutState: p,
159
+ layoutState: x,
160
160
  visible: d,
161
- active: u,
161
+ active: p,
162
162
  flag: c,
163
- getCanvasType: x,
163
+ getCanvasType: h,
164
164
  isAbsolute: w,
165
165
  dimension: a,
166
166
  scale: r,
167
167
  state: n,
168
- hide: C,
169
- showTips: k,
170
- hideTips: D,
171
- showPopover: T,
172
- hidePopover: M,
168
+ hide: V,
169
+ showTips: C,
170
+ hideTips: k,
171
+ showPopover: D,
172
+ hidePopover: T,
173
173
  closePopover: g,
174
174
  mediaMap: v,
175
- setViewPort: f,
176
- activeView: W,
177
- breakpoints: I,
178
- widthChange: P,
179
- scaleChange: N,
180
- changeCanvasType: S,
181
- mode: E,
175
+ setViewPort: M,
176
+ activeView: I,
177
+ breakpoints: P,
178
+ widthChange: N,
179
+ scaleChange: S,
180
+ changeCanvasType: E,
181
+ mode: U,
182
182
  IconWebPlus: y,
183
- useLayout: h,
184
- useCanvas: _,
185
- ToolbarBase: U
183
+ useLayout: u,
184
+ useCanvas: f,
185
+ ToolbarBase: W
186
186
  })
187
- }), k = V(() => {
187
+ }), C = _(() => {
188
188
  l = setTimeout(() => {
189
189
  d.value = !0;
190
190
  }, 1e3);
@@ -198,35 +198,35 @@ const J = {
198
198
  timer: l,
199
199
  prevWidthVal: t,
200
200
  prevScaleVal: s,
201
- layoutState: p,
201
+ layoutState: x,
202
202
  visible: d,
203
- active: u,
203
+ active: p,
204
204
  flag: c,
205
- getCanvasType: x,
205
+ getCanvasType: h,
206
206
  isAbsolute: w,
207
207
  dimension: a,
208
208
  scale: r,
209
209
  state: n,
210
- hide: C,
211
- showTips: k,
212
- hideTips: D,
213
- showPopover: T,
214
- hidePopover: M,
210
+ hide: V,
211
+ showTips: C,
212
+ hideTips: k,
213
+ showPopover: D,
214
+ hidePopover: T,
215
215
  closePopover: g,
216
216
  mediaMap: v,
217
- setViewPort: f,
218
- activeView: W,
219
- breakpoints: I,
220
- widthChange: P,
221
- scaleChange: N,
222
- changeCanvasType: S,
223
- mode: E,
217
+ setViewPort: M,
218
+ activeView: I,
219
+ breakpoints: P,
220
+ widthChange: N,
221
+ scaleChange: S,
222
+ changeCanvasType: E,
223
+ mode: U,
224
224
  IconWebPlus: y,
225
- useLayout: h,
226
- useCanvas: _,
227
- ToolbarBase: U
225
+ useLayout: u,
226
+ useCanvas: f,
227
+ ToolbarBase: W
228
228
  })
229
- }), D = V(() => {
229
+ }), k = _(() => {
230
230
  d.value = !1, clearTimeout(l);
231
231
  }, {
232
232
  metaData: {
@@ -238,36 +238,36 @@ const J = {
238
238
  timer: l,
239
239
  prevWidthVal: t,
240
240
  prevScaleVal: s,
241
- layoutState: p,
241
+ layoutState: x,
242
242
  visible: d,
243
- active: u,
243
+ active: p,
244
244
  flag: c,
245
- getCanvasType: x,
245
+ getCanvasType: h,
246
246
  isAbsolute: w,
247
247
  dimension: a,
248
248
  scale: r,
249
249
  state: n,
250
- hide: C,
251
- showTips: k,
252
- hideTips: D,
253
- showPopover: T,
254
- hidePopover: M,
250
+ hide: V,
251
+ showTips: C,
252
+ hideTips: k,
253
+ showPopover: D,
254
+ hidePopover: T,
255
255
  closePopover: g,
256
256
  mediaMap: v,
257
- setViewPort: f,
258
- activeView: W,
259
- breakpoints: I,
260
- widthChange: P,
261
- scaleChange: N,
262
- changeCanvasType: S,
263
- mode: E,
257
+ setViewPort: M,
258
+ activeView: I,
259
+ breakpoints: P,
260
+ widthChange: N,
261
+ scaleChange: S,
262
+ changeCanvasType: E,
263
+ mode: U,
264
264
  IconWebPlus: y,
265
- useLayout: h,
266
- useCanvas: _,
267
- ToolbarBase: U
265
+ useLayout: u,
266
+ useCanvas: f,
267
+ ToolbarBase: W
268
268
  })
269
- }), T = V(() => {
270
- p.toolbars.visiblePopover = !0, c.value = !0;
269
+ }), D = _(() => {
270
+ x.toolbars.visiblePopover = !0, c.value = !0;
271
271
  }, {
272
272
  metaData: {
273
273
  id: "engine.toolbars.media.Main.showPopover"
@@ -278,36 +278,36 @@ const J = {
278
278
  timer: l,
279
279
  prevWidthVal: t,
280
280
  prevScaleVal: s,
281
- layoutState: p,
281
+ layoutState: x,
282
282
  visible: d,
283
- active: u,
283
+ active: p,
284
284
  flag: c,
285
- getCanvasType: x,
285
+ getCanvasType: h,
286
286
  isAbsolute: w,
287
287
  dimension: a,
288
288
  scale: r,
289
289
  state: n,
290
- hide: C,
291
- showTips: k,
292
- hideTips: D,
293
- showPopover: T,
294
- hidePopover: M,
290
+ hide: V,
291
+ showTips: C,
292
+ hideTips: k,
293
+ showPopover: D,
294
+ hidePopover: T,
295
295
  closePopover: g,
296
296
  mediaMap: v,
297
- setViewPort: f,
298
- activeView: W,
299
- breakpoints: I,
300
- widthChange: P,
301
- scaleChange: N,
302
- changeCanvasType: S,
303
- mode: E,
297
+ setViewPort: M,
298
+ activeView: I,
299
+ breakpoints: P,
300
+ widthChange: N,
301
+ scaleChange: S,
302
+ changeCanvasType: E,
303
+ mode: U,
304
304
  IconWebPlus: y,
305
- useLayout: h,
306
- useCanvas: _,
307
- ToolbarBase: U
305
+ useLayout: u,
306
+ useCanvas: f,
307
+ ToolbarBase: W
308
308
  })
309
- }), M = V(() => {
310
- p.toolbars.visiblePopover = !1, c.value = !1;
309
+ }), T = _(() => {
310
+ x.toolbars.visiblePopover = !1, c.value = !1;
311
311
  }, {
312
312
  metaData: {
313
313
  id: "engine.toolbars.media.Main.hidePopover"
@@ -318,37 +318,37 @@ const J = {
318
318
  timer: l,
319
319
  prevWidthVal: t,
320
320
  prevScaleVal: s,
321
- layoutState: p,
321
+ layoutState: x,
322
322
  visible: d,
323
- active: u,
323
+ active: p,
324
324
  flag: c,
325
- getCanvasType: x,
325
+ getCanvasType: h,
326
326
  isAbsolute: w,
327
327
  dimension: a,
328
328
  scale: r,
329
329
  state: n,
330
- hide: C,
331
- showTips: k,
332
- hideTips: D,
333
- showPopover: T,
334
- hidePopover: M,
330
+ hide: V,
331
+ showTips: C,
332
+ hideTips: k,
333
+ showPopover: D,
334
+ hidePopover: T,
335
335
  closePopover: g,
336
336
  mediaMap: v,
337
- setViewPort: f,
338
- activeView: W,
339
- breakpoints: I,
340
- widthChange: P,
341
- scaleChange: N,
342
- changeCanvasType: S,
343
- mode: E,
337
+ setViewPort: M,
338
+ activeView: I,
339
+ breakpoints: P,
340
+ widthChange: N,
341
+ scaleChange: S,
342
+ changeCanvasType: E,
343
+ mode: U,
344
344
  IconWebPlus: y,
345
- useLayout: h,
346
- useCanvas: _,
347
- ToolbarBase: U
345
+ useLayout: u,
346
+ useCanvas: f,
347
+ ToolbarBase: W
348
348
  })
349
- }), g = V((i) => {
349
+ }), g = _((i) => {
350
350
  const b = document.querySelector(".reference-text"), A = b == null ? void 0 : b.contains(i.target);
351
- b !== i.target && !A && (p.toolbars.visiblePopover = !1);
351
+ b !== i.target && !A && (x.toolbars.visiblePopover = !1);
352
352
  }, {
353
353
  metaData: {
354
354
  id: "engine.toolbars.media.Main.closePopover"
@@ -359,39 +359,39 @@ const J = {
359
359
  timer: l,
360
360
  prevWidthVal: t,
361
361
  prevScaleVal: s,
362
- layoutState: p,
362
+ layoutState: x,
363
363
  visible: d,
364
- active: u,
364
+ active: p,
365
365
  flag: c,
366
- getCanvasType: x,
366
+ getCanvasType: h,
367
367
  isAbsolute: w,
368
368
  dimension: a,
369
369
  scale: r,
370
370
  state: n,
371
- hide: C,
372
- showTips: k,
373
- hideTips: D,
374
- showPopover: T,
375
- hidePopover: M,
371
+ hide: V,
372
+ showTips: C,
373
+ hideTips: k,
374
+ showPopover: D,
375
+ hidePopover: T,
376
376
  closePopover: g,
377
377
  mediaMap: v,
378
- setViewPort: f,
379
- activeView: W,
380
- breakpoints: I,
381
- widthChange: P,
382
- scaleChange: N,
383
- changeCanvasType: S,
384
- mode: E,
378
+ setViewPort: M,
379
+ activeView: I,
380
+ breakpoints: P,
381
+ widthChange: N,
382
+ scaleChange: S,
383
+ changeCanvasType: E,
384
+ mode: U,
385
385
  IconWebPlus: y,
386
- useLayout: h,
387
- useCanvas: _,
388
- ToolbarBase: U
386
+ useLayout: u,
387
+ useCanvas: f,
388
+ ToolbarBase: W
389
389
  })
390
390
  }), v = n.media.reduce((i, b, A) => (i[b.view] = {
391
391
  ...te(b),
392
392
  index: A
393
- }, i), {}), f = V((i) => {
394
- m.isCanvas ? h().setDimension({
393
+ }, i), {}), M = _((i) => {
394
+ m.isCanvas ? u().setDimension({
395
395
  deviceType: i.view,
396
396
  width: i.width,
397
397
  minWidth: i.minWidth,
@@ -407,37 +407,28 @@ const J = {
407
407
  timer: l,
408
408
  prevWidthVal: t,
409
409
  prevScaleVal: s,
410
- layoutState: p,
411
410
  visible: d,
412
- active: u,
411
+ active: p,
413
412
  flag: c,
414
- getCanvasType: x,
415
413
  isAbsolute: w,
416
414
  dimension: a,
417
415
  scale: r,
418
416
  state: n,
419
- hide: C,
420
- showTips: k,
421
- hideTips: D,
422
- showPopover: T,
423
- hidePopover: M,
417
+ hide: V,
418
+ showTips: C,
419
+ hideTips: k,
420
+ showPopover: D,
421
+ hidePopover: T,
424
422
  closePopover: g,
425
423
  mediaMap: v,
426
- setViewPort: f,
427
- activeView: W,
428
- breakpoints: I,
429
- widthChange: P,
430
- scaleChange: N,
431
- changeCanvasType: S,
432
- mode: E,
433
424
  IconWebPlus: y,
434
- useLayout: h,
435
- useCanvas: _,
436
- ToolbarBase: U
425
+ useLayout: u,
426
+ useCanvas: f,
427
+ ToolbarBase: W
437
428
  })
438
- }), W = V((i, b) => {
429
+ }), I = _((i, b) => {
439
430
  const A = v[b];
440
- h().setDimension({
431
+ u().setDimension({
441
432
  deviceType: A.view,
442
433
  width: i ? `${i}px` : A.width,
443
434
  minWidth: A.minWidth,
@@ -453,35 +444,35 @@ const J = {
453
444
  timer: l,
454
445
  prevWidthVal: t,
455
446
  prevScaleVal: s,
456
- layoutState: p,
447
+ layoutState: x,
457
448
  visible: d,
458
- active: u,
449
+ active: p,
459
450
  flag: c,
460
- getCanvasType: x,
451
+ getCanvasType: h,
461
452
  isAbsolute: w,
462
453
  dimension: a,
463
454
  scale: r,
464
455
  state: n,
465
- hide: C,
466
- showTips: k,
467
- hideTips: D,
468
- showPopover: T,
469
- hidePopover: M,
456
+ hide: V,
457
+ showTips: C,
458
+ hideTips: k,
459
+ showPopover: D,
460
+ hidePopover: T,
470
461
  closePopover: g,
471
462
  mediaMap: v,
472
- setViewPort: f,
473
- activeView: W,
474
- breakpoints: I,
475
- widthChange: P,
476
- scaleChange: N,
477
- changeCanvasType: S,
478
- mode: E,
463
+ setViewPort: M,
464
+ activeView: I,
465
+ breakpoints: P,
466
+ widthChange: N,
467
+ scaleChange: S,
468
+ changeCanvasType: E,
469
+ mode: U,
479
470
  IconWebPlus: y,
480
- useLayout: h,
481
- useCanvas: _,
482
- ToolbarBase: U
471
+ useLayout: u,
472
+ useCanvas: f,
473
+ ToolbarBase: W
483
474
  })
484
- }), I = [{
475
+ }), P = [{
485
476
  type: "mobile",
486
477
  min: 240,
487
478
  max: 480
@@ -501,12 +492,12 @@ const J = {
501
492
  type: "mdx",
502
493
  min: 1200,
503
494
  max: 1920
504
- }], P = V((i) => {
495
+ }], N = _((i) => {
505
496
  var K;
506
497
  const b = /^\d+$/;
507
498
  String(i).match(b) ? Number(i) < 240 ? n.width = 240 : Number(i) > 1920 ? n.width = 1920 : n.width = i : n.width = t || parseInt(a.value.width, 10);
508
- const A = Number(n.width), $ = ((K = I.find((Q) => Q.min <= A && A <= Q.max)) == null ? void 0 : K.type) || "desktop";
509
- W(A, $);
499
+ const A = Number(n.width), $ = ((K = P.find((Q) => Q.min <= A && A <= Q.max)) == null ? void 0 : K.type) || "desktop";
500
+ I(A, $);
510
501
  }, {
511
502
  metaData: {
512
503
  id: "engine.toolbars.media.Main.widthChange"
@@ -517,37 +508,37 @@ const J = {
517
508
  timer: l,
518
509
  prevWidthVal: t,
519
510
  prevScaleVal: s,
520
- layoutState: p,
511
+ layoutState: x,
521
512
  visible: d,
522
- active: u,
513
+ active: p,
523
514
  flag: c,
524
- getCanvasType: x,
515
+ getCanvasType: h,
525
516
  isAbsolute: w,
526
517
  dimension: a,
527
518
  scale: r,
528
519
  state: n,
529
- hide: C,
530
- showTips: k,
531
- hideTips: D,
532
- showPopover: T,
533
- hidePopover: M,
520
+ hide: V,
521
+ showTips: C,
522
+ hideTips: k,
523
+ showPopover: D,
524
+ hidePopover: T,
534
525
  closePopover: g,
535
526
  mediaMap: v,
536
- setViewPort: f,
537
- activeView: W,
538
- breakpoints: I,
539
- widthChange: P,
540
- scaleChange: N,
541
- changeCanvasType: S,
542
- mode: E,
527
+ setViewPort: M,
528
+ activeView: I,
529
+ breakpoints: P,
530
+ widthChange: N,
531
+ scaleChange: S,
532
+ changeCanvasType: E,
533
+ mode: U,
543
534
  IconWebPlus: y,
544
- useLayout: h,
545
- useCanvas: _,
546
- ToolbarBase: U
535
+ useLayout: u,
536
+ useCanvas: f,
537
+ ToolbarBase: W
547
538
  })
548
- }), N = V((i) => {
539
+ }), S = _((i) => {
549
540
  const b = v.mdx, A = /^\d+(\.\d+)?$/;
550
- String(i).match(A) ? Number(i) > 100 ? n.scaleValue = 100 : Number(i) < 20 ? n.scaleValue = 20 : n.scaleValue = i : n.scaleValue = s || parseInt(b.scale), n.scaleValue = Number(n.scaleValue).toFixed(2), h().setDimension({
541
+ String(i).match(A) ? Number(i) > 100 ? n.scaleValue = 100 : Number(i) < 20 ? n.scaleValue = 20 : n.scaleValue = i : n.scaleValue = s || parseInt(b.scale), n.scaleValue = Number(n.scaleValue).toFixed(2), u().setDimension({
551
542
  scale: Number(n.scaleValue) / 100
552
543
  });
553
544
  }, {
@@ -560,38 +551,38 @@ const J = {
560
551
  timer: l,
561
552
  prevWidthVal: t,
562
553
  prevScaleVal: s,
563
- layoutState: p,
554
+ layoutState: x,
564
555
  visible: d,
565
- active: u,
556
+ active: p,
566
557
  flag: c,
567
- getCanvasType: x,
558
+ getCanvasType: h,
568
559
  isAbsolute: w,
569
560
  dimension: a,
570
561
  scale: r,
571
562
  state: n,
572
- hide: C,
573
- showTips: k,
574
- hideTips: D,
575
- showPopover: T,
576
- hidePopover: M,
563
+ hide: V,
564
+ showTips: C,
565
+ hideTips: k,
566
+ showPopover: D,
567
+ hidePopover: T,
577
568
  closePopover: g,
578
569
  mediaMap: v,
579
- setViewPort: f,
580
- activeView: W,
581
- breakpoints: I,
582
- widthChange: P,
583
- scaleChange: N,
584
- changeCanvasType: S,
585
- mode: E,
570
+ setViewPort: M,
571
+ activeView: I,
572
+ breakpoints: P,
573
+ widthChange: N,
574
+ scaleChange: S,
575
+ changeCanvasType: E,
576
+ mode: U,
586
577
  IconWebPlus: y,
587
- useLayout: h,
588
- useCanvas: _,
589
- ToolbarBase: U
578
+ useLayout: u,
579
+ useCanvas: f,
580
+ ToolbarBase: W
590
581
  })
591
- }), S = V((i) => {
582
+ }), E = _((i) => {
592
583
  const {
593
584
  setCanvasType: b
594
- } = _().canvasApi.value;
585
+ } = f().canvasApi.value;
595
586
  b(i ? "absolute" : "normal");
596
587
  }, {
597
588
  metaData: {
@@ -603,33 +594,33 @@ const J = {
603
594
  timer: l,
604
595
  prevWidthVal: t,
605
596
  prevScaleVal: s,
606
- layoutState: p,
597
+ layoutState: x,
607
598
  visible: d,
608
- active: u,
599
+ active: p,
609
600
  flag: c,
610
- getCanvasType: x,
601
+ getCanvasType: h,
611
602
  isAbsolute: w,
612
603
  dimension: a,
613
604
  scale: r,
614
605
  state: n,
615
- hide: C,
616
- showTips: k,
617
- hideTips: D,
618
- showPopover: T,
619
- hidePopover: M,
606
+ hide: V,
607
+ showTips: C,
608
+ hideTips: k,
609
+ showPopover: D,
610
+ hidePopover: T,
620
611
  closePopover: g,
621
612
  mediaMap: v,
622
- setViewPort: f,
623
- activeView: W,
624
- breakpoints: I,
625
- widthChange: P,
626
- scaleChange: N,
627
- changeCanvasType: S,
628
- mode: E,
613
+ setViewPort: M,
614
+ activeView: I,
615
+ breakpoints: P,
616
+ widthChange: N,
617
+ scaleChange: S,
618
+ changeCanvasType: E,
619
+ mode: U,
629
620
  IconWebPlus: y,
630
- useLayout: h,
631
- useCanvas: _,
632
- ToolbarBase: U
621
+ useLayout: u,
622
+ useCanvas: f,
623
+ ToolbarBase: W
633
624
  })
634
625
  });
635
626
  Z(() => a.value.deviceType, (i) => {
@@ -641,7 +632,7 @@ const J = {
641
632
  }), Z(() => a.value.width, (i) => {
642
633
  const b = parseInt(i, 10);
643
634
  Number.isInteger(b) && (n.width = b, t = b);
644
- }), ne(V(V(() => {
635
+ }), ne(_(_(() => {
645
636
  document.addEventListener("click", g);
646
637
  }, {
647
638
  metaData: {
@@ -653,33 +644,33 @@ const J = {
653
644
  timer: l,
654
645
  prevWidthVal: t,
655
646
  prevScaleVal: s,
656
- layoutState: p,
647
+ layoutState: x,
657
648
  visible: d,
658
- active: u,
649
+ active: p,
659
650
  flag: c,
660
- getCanvasType: x,
651
+ getCanvasType: h,
661
652
  isAbsolute: w,
662
653
  dimension: a,
663
654
  scale: r,
664
655
  state: n,
665
- hide: C,
666
- showTips: k,
667
- hideTips: D,
668
- showPopover: T,
669
- hidePopover: M,
656
+ hide: V,
657
+ showTips: C,
658
+ hideTips: k,
659
+ showPopover: D,
660
+ hidePopover: T,
670
661
  closePopover: g,
671
662
  mediaMap: v,
672
- setViewPort: f,
673
- activeView: W,
674
- breakpoints: I,
675
- widthChange: P,
676
- scaleChange: N,
677
- changeCanvasType: S,
678
- mode: E,
663
+ setViewPort: M,
664
+ activeView: I,
665
+ breakpoints: P,
666
+ widthChange: N,
667
+ scaleChange: S,
668
+ changeCanvasType: E,
669
+ mode: U,
679
670
  IconWebPlus: y,
680
- useLayout: h,
681
- useCanvas: _,
682
- ToolbarBase: U
671
+ useLayout: u,
672
+ useCanvas: f,
673
+ ToolbarBase: W
683
674
  })
684
675
  }), {
685
676
  metaData: {
@@ -691,38 +682,38 @@ const J = {
691
682
  timer: l,
692
683
  prevWidthVal: t,
693
684
  prevScaleVal: s,
694
- layoutState: p,
685
+ layoutState: x,
695
686
  visible: d,
696
- active: u,
687
+ active: p,
697
688
  flag: c,
698
- getCanvasType: x,
689
+ getCanvasType: h,
699
690
  isAbsolute: w,
700
691
  dimension: a,
701
692
  scale: r,
702
693
  state: n,
703
- hide: C,
704
- showTips: k,
705
- hideTips: D,
706
- showPopover: T,
707
- hidePopover: M,
694
+ hide: V,
695
+ showTips: C,
696
+ hideTips: k,
697
+ showPopover: D,
698
+ hidePopover: T,
708
699
  closePopover: g,
709
700
  mediaMap: v,
710
- setViewPort: f,
711
- activeView: W,
712
- breakpoints: I,
713
- widthChange: P,
714
- scaleChange: N,
715
- changeCanvasType: S,
716
- mode: E,
717
- _callEntry: V,
701
+ setViewPort: M,
702
+ activeView: I,
703
+ breakpoints: P,
704
+ widthChange: N,
705
+ scaleChange: S,
706
+ changeCanvasType: E,
707
+ mode: U,
708
+ _callEntry: _,
718
709
  _useCompile: X,
719
710
  _metaData: J,
720
711
  IconWebPlus: y,
721
- useLayout: h,
722
- useCanvas: _,
723
- ToolbarBase: U
712
+ useLayout: u,
713
+ useCanvas: f,
714
+ ToolbarBase: W
724
715
  })
725
- })), ie(V(V(() => {
716
+ })), ie(_(_(() => {
726
717
  document.removeEventListener("click", g);
727
718
  }, {
728
719
  metaData: {
@@ -734,33 +725,33 @@ const J = {
734
725
  timer: l,
735
726
  prevWidthVal: t,
736
727
  prevScaleVal: s,
737
- layoutState: p,
728
+ layoutState: x,
738
729
  visible: d,
739
- active: u,
730
+ active: p,
740
731
  flag: c,
741
- getCanvasType: x,
732
+ getCanvasType: h,
742
733
  isAbsolute: w,
743
734
  dimension: a,
744
735
  scale: r,
745
736
  state: n,
746
- hide: C,
747
- showTips: k,
748
- hideTips: D,
749
- showPopover: T,
750
- hidePopover: M,
737
+ hide: V,
738
+ showTips: C,
739
+ hideTips: k,
740
+ showPopover: D,
741
+ hidePopover: T,
751
742
  closePopover: g,
752
743
  mediaMap: v,
753
- setViewPort: f,
754
- activeView: W,
755
- breakpoints: I,
756
- widthChange: P,
757
- scaleChange: N,
758
- changeCanvasType: S,
759
- mode: E,
744
+ setViewPort: M,
745
+ activeView: I,
746
+ breakpoints: P,
747
+ widthChange: N,
748
+ scaleChange: S,
749
+ changeCanvasType: E,
750
+ mode: U,
760
751
  IconWebPlus: y,
761
- useLayout: h,
762
- useCanvas: _,
763
- ToolbarBase: U
752
+ useLayout: u,
753
+ useCanvas: f,
754
+ ToolbarBase: W
764
755
  })
765
756
  }), {
766
757
  metaData: {
@@ -772,58 +763,58 @@ const J = {
772
763
  timer: l,
773
764
  prevWidthVal: t,
774
765
  prevScaleVal: s,
775
- layoutState: p,
766
+ layoutState: x,
776
767
  visible: d,
777
- active: u,
768
+ active: p,
778
769
  flag: c,
779
- getCanvasType: x,
770
+ getCanvasType: h,
780
771
  isAbsolute: w,
781
772
  dimension: a,
782
773
  scale: r,
783
774
  state: n,
784
- hide: C,
785
- showTips: k,
786
- hideTips: D,
787
- showPopover: T,
788
- hidePopover: M,
775
+ hide: V,
776
+ showTips: C,
777
+ hideTips: k,
778
+ showPopover: D,
779
+ hidePopover: T,
789
780
  closePopover: g,
790
781
  mediaMap: v,
791
- setViewPort: f,
792
- activeView: W,
793
- breakpoints: I,
794
- widthChange: P,
795
- scaleChange: N,
796
- changeCanvasType: S,
797
- mode: E,
798
- _callEntry: V,
782
+ setViewPort: M,
783
+ activeView: I,
784
+ breakpoints: P,
785
+ widthChange: N,
786
+ scaleChange: S,
787
+ changeCanvasType: E,
788
+ mode: U,
789
+ _callEntry: _,
799
790
  _useCompile: X,
800
791
  _metaData: J,
801
792
  IconWebPlus: y,
802
- useLayout: h,
803
- useCanvas: _,
804
- ToolbarBase: U
793
+ useLayout: u,
794
+ useCanvas: f,
795
+ ToolbarBase: W
805
796
  })
806
797
  }));
807
- const E = a.value.deviceType || "desktop";
808
- return f(v[E]), {
798
+ const U = a.value.deviceType || "desktop";
799
+ return M(v[U]), {
809
800
  scale: r,
810
801
  state: n,
811
- active: u,
802
+ active: p,
812
803
  flag: c,
813
- hide: C,
814
- layoutState: p,
804
+ hide: V,
805
+ layoutState: x,
815
806
  visible: d,
816
- showTips: k,
817
- hideTips: D,
807
+ showTips: C,
808
+ hideTips: k,
818
809
  timer: l,
819
810
  dimension: a,
820
- setViewPort: f,
821
- showPopover: T,
822
- hidePopover: M,
823
- widthChange: P,
824
- scaleChange: N,
811
+ setViewPort: M,
812
+ showPopover: D,
813
+ hidePopover: T,
814
+ widthChange: N,
815
+ scaleChange: S,
825
816
  isAbsolute: w,
826
- changeCanvasType: S
817
+ changeCanvasType: E
827
818
  };
828
819
  }
829
820
  }, pe = (m, e) => {
@@ -838,8 +829,8 @@ const J = {
838
829
  class: "reference-text",
839
830
  title: "画布设置"
840
831
  }, fe = { class: "content-wrap text-content" }, _e = { class: "title text-title" }, Ve = { class: "setting" };
841
- function Ce(m, e, l, t, s, p) {
842
- const d = O("svg-icon"), u = O("tiny-popover"), c = O("tiny-input"), x = O("tiny-switch"), w = O("toolbar-base");
832
+ function Ce(m, e, l, t, s, x) {
833
+ const d = O("svg-icon"), p = O("tiny-popover"), c = O("tiny-input"), h = O("tiny-switch"), w = O("toolbar-base");
843
834
  return L(), z(w, { options: l.options }, {
844
835
  default: F(() => [
845
836
  o("div", ue, [
@@ -849,7 +840,7 @@ function Ce(m, e, l, t, s, p) {
849
840
  class: se(["icon", { active: t.state.activeIndex === r, "is-rotate": a.view === "lanMobile" }]),
850
841
  onClick: (n) => t.setViewPort(a)
851
842
  }, [
852
- j(u, {
843
+ j(p, {
853
844
  trigger: "hover",
854
845
  width: "260",
855
846
  "append-to-body": "",
@@ -868,13 +859,13 @@ function Ce(m, e, l, t, s, p) {
868
859
  o("div", null, [
869
860
  H(B(a.title) + " ", 1),
870
861
  a.subTitle ? (L(), G("span", we, [
871
- e[3] || (e[3] = H(" (")),
862
+ e[3] || (e[3] = H(" (", -1)),
872
863
  a.view === "desktop" ? (L(), z(d, {
873
864
  key: 0,
874
865
  name: "stars"
875
866
  })) : R("", !0),
876
867
  o("span", null, B(a.subTitle), 1),
877
- e[4] || (e[4] = H(") "))
868
+ e[4] || (e[4] = H(") ", -1))
878
869
  ])) : R("", !0)
879
870
  ])
880
871
  ]),
@@ -885,7 +876,7 @@ function Ce(m, e, l, t, s, p) {
885
876
  }, 1024)
886
877
  ], 10, he))), 128))
887
878
  ]),
888
- l.isCanvas ? (L(), z(u, {
879
+ l.isCanvas ? (L(), z(p, {
889
880
  key: 0,
890
881
  width: "200",
891
882
  trigger: "click",
@@ -936,7 +927,7 @@ function Ce(m, e, l, t, s, p) {
936
927
  ]),
937
928
  o("div", null, [
938
929
  e[9] || (e[9] = o("label", null, B("自由布局"), -1)),
939
- j(x, {
930
+ j(h, {
940
931
  modelValue: t.isAbsolute,
941
932
  "onUpdate:modelValue": e[2] || (e[2] = (a) => t.isAbsolute = a),
942
933
  onChange: t.changeCanvasType
@@ -952,7 +943,7 @@ function Ce(m, e, l, t, s, p) {
952
943
  _: 1
953
944
  }, 8, ["options"]);
954
945
  }
955
- const ke = /* @__PURE__ */ pe(me, [["render", Ce], ["__scopeId", "data-v-da625a27"]]), Ne = {
946
+ const ke = /* @__PURE__ */ pe(me, [["render", Ce], ["__scopeId", "data-v-bd1dda1c"]]), Ne = {
956
947
  ...J,
957
948
  entry: ke
958
949
  };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../meta.js","../index.ts"],"sourcesContent":["export default {\n id: 'engine.toolbars.media',\n type: 'toolbars',\n title: 'media',\n options: {\n icon: {\n default: ''\n },\n renderType: 'slot'\n }\n}\n","/**\n * Copyright (c) 2023 - present TinyEngine Authors.\n * Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.\n *\n * Use of this source code is governed by an MIT-style license.\n *\n * THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,\n * BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR\n * A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.\n *\n */\n\nimport entry from './src/Main.vue'\nimport metaData from './meta'\nimport './src/styles/vars.less'\n\nexport default {\n ...metaData,\n entry\n}\n"],"names":["metaData","index","entry"],"mappings":";;;;;;AAAA,MAAAA,IAAe;AAAA,EACb,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,IACP,MAAM;AAAA,MACJ,SAAS;AAAA,IACf;AAAA,IACI,YAAY;AAAA,EAChB;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uFCMAC,KAAe;AAAA,EACb,GAAGD;AAAA,EACH,OAAAE;AACF;"}
1
+ {"version":3,"file":"index.js","sources":["../meta.js","../index.ts"],"sourcesContent":["export default {\n id: 'engine.toolbars.media',\n type: 'toolbars',\n title: 'media',\n options: {\n icon: {\n default: ''\n },\n renderType: 'slot'\n }\n}\n","/**\n * Copyright (c) 2023 - present TinyEngine Authors.\n * Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.\n *\n * Use of this source code is governed by an MIT-style license.\n *\n * THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,\n * BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR\n * A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.\n *\n */\n\nimport entry from './src/Main.vue'\nimport metaData from './meta'\nimport './src/styles/vars.less'\n\nexport default {\n ...metaData,\n entry\n}\n"],"names":["metaData","index","entry"],"mappings":";;;;;;AAAA,MAAAA,IAAe;AAAA,EACb,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,IACP,MAAM;AAAA,MACJ,SAAS;AAAA,IACf;AAAA,IACI,YAAY;AAAA,EAChB;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uFCMAC,KAAe;AAAA,EACb,GAAGD;AAAA,EACH,OAAAE;AACF;"}
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .toolbar-wrap[data-v-da625a27]{display:flex;align-items:center}.toolbar-wrap .reference-text[data-v-da625a27]{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-da625a27]:last-child{margin-left:8px}.toolbar-wrap .toolbar-icon-wrap[data-v-da625a27]{display:flex;flex-wrap:nowrap;align-items:center;gap:6px}.toolbar-wrap .toolbar-icon-wrap .icon[data-v-da625a27]{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-da625a27]{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-da625a27],.toolbar-wrap .toolbar-icon-wrap .icon[data-v-da625a27]:hover{background:var(--te-toolbars-media-bg-color-active)}.toolbar-wrap .toolbar-icon-wrap .icon.active svg[data-v-da625a27]{color:var(--te-toolbars-media-text-color-checked)}.toolbar-wrap .more-setting .setting-item[data-v-da625a27]{display:flex;justify-content:space-between;padding:12px}.media-content[data-v-da625a27]{line-height:18px}.media-content .media-title[data-v-da625a27]{font-weight:600}.media-content .content[data-v-da625a27]{color:var(--te-toolbars-media-text-color-secondary)}.setting-content[data-v-da625a27]{padding:12px 8px}.content-wrap .title[data-v-da625a27]{font-weight:600;margin-bottom:16px}.content-wrap .setting[data-v-da625a27]{display:flex;flex-direction:column;gap:12px}.content-wrap .setting div[data-v-da625a27]{display:flex;align-items:center;justify-content:space-between}.content-wrap .setting div label[data-v-da625a27]{color:var(--te-toolbars-media-text-color-secondary);min-width:64px}.content-wrap .setting div[data-v-da625a27]: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-bd1dda1c]{display:flex;align-items:center}.toolbar-wrap .reference-text[data-v-bd1dda1c]{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-bd1dda1c]:last-child{margin-left:8px}.toolbar-wrap .toolbar-icon-wrap[data-v-bd1dda1c]{display:flex;flex-wrap:nowrap;align-items:center;gap:6px}.toolbar-wrap .toolbar-icon-wrap .icon[data-v-bd1dda1c]{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-bd1dda1c]{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-bd1dda1c],.toolbar-wrap .toolbar-icon-wrap .icon[data-v-bd1dda1c]:hover{background:var(--te-toolbars-media-bg-color-active)}.toolbar-wrap .toolbar-icon-wrap .icon.active svg[data-v-bd1dda1c]{color:var(--te-toolbars-media-text-color-checked)}.toolbar-wrap .more-setting .setting-item[data-v-bd1dda1c]{display:flex;justify-content:space-between;padding:12px}.media-content[data-v-bd1dda1c]{line-height:18px}.media-content .media-title[data-v-bd1dda1c]{font-weight:600}.media-content .content[data-v-bd1dda1c]{color:var(--te-toolbars-media-text-color-secondary)}.setting-content[data-v-bd1dda1c]{padding:12px 8px}.content-wrap .title[data-v-bd1dda1c]{font-weight:600;margin-bottom:16px}.content-wrap .setting[data-v-bd1dda1c]{display:flex;flex-direction:column;gap:12px}.content-wrap .setting div[data-v-bd1dda1c]{display:flex;align-items:center;justify-content:space-between}.content-wrap .setting div label[data-v-bd1dda1c]{color:var(--te-toolbars-media-text-color-secondary);min-width:64px}.content-wrap .setting div[data-v-bd1dda1c]: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.8.0-alpha.2",
3
+ "version": "2.8.0-alpha.4",
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.8.0-alpha.2",
29
- "@opentiny/tiny-engine-meta-register": "2.8.0-alpha.2"
28
+ "@opentiny/tiny-engine-common": "2.8.0-alpha.4",
29
+ "@opentiny/tiny-engine-meta-register": "2.8.0-alpha.4"
30
30
  },
31
31
  "devDependencies": {
32
- "@opentiny/tiny-engine-vite-plugin-meta-comments": "2.8.0-alpha.2",
32
+ "@opentiny/tiny-engine-vite-plugin-meta-comments": "2.8.0-alpha.4",
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": "ebef5649e85d61a77f59f0744358da34ecba8102"
42
+ "gitHead": "cdec18af768fb902af3858a94d0be2372a3e156f"
43
43
  }