@opendesign-plus-test/components 0.0.1-rc.212 → 0.0.1-rc.213

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,6 +1,7 @@
1
1
  export interface OPlusConfigProviderPropsT {
2
2
  locale?: string;
3
3
  theme?: 'light' | 'dark';
4
+ emptyImg?: string;
4
5
  }
5
6
  declare function __VLS_template(): {
6
7
  attrs: Partial<{}>;
@@ -7,13 +7,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "OPlusConfigProvider",
8
8
  props: {
9
9
  locale: { default: "zh" },
10
- theme: { default: "light" }
10
+ theme: { default: "light" },
11
+ emptyImg: {}
11
12
  },
12
13
  setup(__props) {
13
14
  const props = __props;
14
15
  const globalConfig = {
15
16
  locale: computed(() => unref(props.locale)),
16
- theme: computed(() => unref(props.theme))
17
+ theme: computed(() => unref(props.theme)),
18
+ emptyImg: computed(() => unref(props.emptyImg))
17
19
  };
18
20
  provide(configProviderInjectKey, globalConfig);
19
21
  return (_ctx, _cache) => {
@@ -1,12 +1,12 @@
1
- .hover-icon-rotate .o-icon[data-v-b1d492a5] {
1
+ .hover-icon-rotate .o-icon[data-v-4381b83c] {
2
2
  transition: all var(--o-duration-m1) var(--o-easing-standard-in);
3
3
  }
4
4
  @media (hover: hover) {
5
- .hover-icon-rotate:hover .o-icon[data-v-b1d492a5] {
5
+ .hover-icon-rotate:hover .o-icon[data-v-4381b83c] {
6
6
  transform: rotate(-180deg);
7
7
  }
8
8
  }
9
- .o-empty[data-v-b1d492a5] {
9
+ .o-empty[data-v-4381b83c] {
10
10
  width: 100%;
11
11
  height: 100%;
12
12
  display: flex;
@@ -17,43 +17,43 @@
17
17
  --result-desc-gap: var(--o-gap-4);
18
18
  }
19
19
  @media (min-width: 1201px) and (max-width: 1680px) {
20
- .o-empty[data-v-b1d492a5] {
20
+ .o-empty[data-v-4381b83c] {
21
21
  --result-image-width: 200px;
22
22
  --result-image-height: 175px;
23
23
  --result-desc-gap: var(--o-gap-3);
24
24
  }
25
25
  }
26
26
  @media (max-width: 1200px) {
27
- .o-empty[data-v-b1d492a5] {
27
+ .o-empty[data-v-4381b83c] {
28
28
  --result-image-width: 160px;
29
29
  --result-image-height: 140px;
30
30
  --result-desc-gap: var(--o-gap-2);
31
31
  }
32
32
  }
33
- .o-empty[data-v-b1d492a5] .o-result-description {
33
+ .o-empty[data-v-4381b83c] .o-result-description {
34
34
  font-size: 14px;
35
35
  line-height: 22px;
36
36
  }
37
37
  @media (min-width: 1201px) and (max-width: 1680px) {
38
- .o-empty[data-v-b1d492a5] .o-result-description {
38
+ .o-empty[data-v-4381b83c] .o-result-description {
39
39
  font-size: 14px;
40
40
  line-height: 18px;
41
41
  }
42
42
  }
43
43
  @media (min-width: 841px) and (max-width: 1200px) {
44
- .o-empty[data-v-b1d492a5] .o-result-description {
44
+ .o-empty[data-v-4381b83c] .o-result-description {
45
45
  font-size: 12px;
46
46
  line-height: 18px;
47
47
  }
48
48
  }
49
49
  @media (min-width: 601px) and (max-width: 840px) {
50
- .o-empty[data-v-b1d492a5] .o-result-description {
50
+ .o-empty[data-v-4381b83c] .o-result-description {
51
51
  font-size: 12px;
52
52
  line-height: 18px;
53
53
  }
54
54
  }
55
55
  @media (max-width: 600px) {
56
- .o-empty[data-v-b1d492a5] .o-result-description {
56
+ .o-empty[data-v-4381b83c] .o-result-description {
57
57
  font-size: 12px;
58
58
  line-height: 18px;
59
59
  }
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./OEmpty.vue2.mjs";
2
2
  import './OEmpty.css';
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const OEmpty = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b1d492a5"]]);
4
+ const OEmpty = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4381b83c"]]);
5
5
  export {
6
6
  OEmpty as default
7
7
  };
@@ -1,7 +1,8 @@
1
- import { defineComponent, computed, openBlock, createBlock, unref, withCtx, renderSlot, createElementVNode } from "vue";
1
+ import { defineComponent, inject, computed, openBlock, createBlock, unref, withCtx, renderSlot, createElementVNode } from "vue";
2
2
  import { OResult } from "@opensig/opendesign";
3
3
  import { useTheme } from "../../shared/theme.mjs";
4
4
  import { useI18n } from "../../i18n/index.mjs";
5
+ import { configProviderInjectKey } from "../../shared/provide.mjs";
5
6
  import emptyImgLight from "./404.png.mjs";
6
7
  import emptyImgDark from "./404_dark.png.mjs";
7
8
  const _hoisted_1 = ["src"];
@@ -15,7 +16,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
15
16
  const props = __props;
16
17
  const { isDark } = useTheme();
17
18
  const { t } = useI18n();
18
- const emptyImage = computed(() => props.img || (isDark.value ? emptyImgDark : emptyImgLight));
19
+ const configProvider = inject(configProviderInjectKey);
20
+ const emptyImage = computed(() => {
21
+ return props.img || (configProvider == null ? void 0 : configProvider.emptyImg.value) || (isDark.value ? emptyImgDark : emptyImgLight);
22
+ });
19
23
  return (_ctx, _cache) => {
20
24
  return openBlock(), createBlock(unref(OResult), {
21
25
  class: "o-empty",
@@ -51,9 +51,6 @@
51
51
  .o-meeting-playback .left-card {
52
52
  width: 60%;
53
53
  }
54
- .o-meeting-playback .left-card:only-child {
55
- width: 100%;
56
- }
57
54
  @media (max-width: 840px) {
58
55
  .o-meeting-playback .left-card {
59
56
  width: 100%;
@@ -63,6 +60,7 @@
63
60
  display: flex;
64
61
  align-items: center;
65
62
  justify-content: space-between;
63
+ gap: var(--o-r-gap-5);
66
64
  }
67
65
  .o-meeting-playback .left-card .video-header .video-title {
68
66
  font-weight: 500;
@@ -95,6 +93,7 @@
95
93
  }
96
94
  .o-meeting-playback .left-card .video-header .o-select {
97
95
  width: 150px;
96
+ flex-shrink: 0;
98
97
  }
99
98
  .o-meeting-playback .left-card .video-content {
100
99
  margin-top: var(--o-gap-5);
@@ -380,8 +380,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
380
380
  }, 8, ["class"])
381
381
  ])
382
382
  ], 512),
383
- captionsList.value.length ? (openBlock(), createElementBlock("div", {
384
- key: 0,
383
+ createElementVNode("div", {
385
384
  class: "right-card card-wrapper",
386
385
  style: normalizeStyle({
387
386
  height: rightHeight.value
@@ -397,7 +396,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
397
396
  ]),
398
397
  _: 3
399
398
  }, 8, ["captions", "trackIdx", "instance"])
400
- ], 4)) : createCommentVNode("", true)
399
+ ], 4)
401
400
  ]);
402
401
  };
403
402
  }
@@ -551,6 +551,9 @@
551
551
  .o-meeting-playback-subtitles .o-tab .o-row {
552
552
  margin-top: 0;
553
553
  }
554
+ .o-meeting-playback-subtitles .playback-empty {
555
+ height: 100%;
556
+ }
554
557
  @media (max-width: 840px) {
555
558
  .o-meeting-playback-subtitles .captions-tab .captions-scroller {
556
559
  max-height: 600px;
@@ -1,4 +1,4 @@
1
- import { defineComponent, computed, ref, watch, nextTick, onMounted, onUnmounted, openBlock, createElementBlock, createElementVNode, createVNode, unref, withKeys, withModifiers, withCtx, toDisplayString, createCommentVNode, Fragment, renderList, createBlock, createTextVNode, normalizeClass, withDirectives, renderSlot } from "vue";
1
+ import { defineComponent, computed, useId, ref, watch, nextTick, onMounted, onUnmounted, openBlock, createElementBlock, createElementVNode, createVNode, unref, withKeys, withModifiers, withCtx, toDisplayString, createCommentVNode, Fragment, renderList, createBlock, createTextVNode, normalizeClass, withDirectives, renderSlot } from "vue";
2
2
  import { OInput, OIcon, ODivider, OTab, OTabPane, OScroller, ORow, OCol } from "@opensig/opendesign";
3
3
  import { ElSelect, ElOption, ElCheckbox } from "element-plus";
4
4
  import "element-plus/es/components/select/style/css";
@@ -11,6 +11,7 @@ import IconChevronUp from "../../../_virtual/icon-chevron-up.mjs";
11
11
  import IconClose from "../../../_virtual/icon-close.mjs";
12
12
  import IconSpeaker from "../../../_virtual/icon-speaker.mjs";
13
13
  import { useDebounceFn } from "@vueuse/core";
14
+ import OEmpty from "../../empty/OEmpty.vue.mjs";
14
15
  import { useI18n } from "../../../i18n/index.mjs";
15
16
  import { buildVueDompurifyHTMLDirective } from "vue-dompurify-html";
16
17
  const _hoisted_1 = { class: "o-meeting-playback-subtitles" };
@@ -26,7 +27,10 @@ const _hoisted_7 = { class: "num" };
26
27
  const _hoisted_8 = { class: "speaker" };
27
28
  const _hoisted_9 = { class: "start-time" };
28
29
  const _hoisted_10 = { class: "text" };
29
- const _hoisted_11 = { key: 1 };
30
+ const _hoisted_11 = {
31
+ key: 1,
32
+ class: "playback-empty"
33
+ };
30
34
  const _sfc_main = /* @__PURE__ */ defineComponent({
31
35
  __name: "OMeetingPlaybackSubtitles",
32
36
  props: {
@@ -39,6 +43,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
39
43
  const props = __props;
40
44
  const { t } = useI18n();
41
45
  const currentIndex = computed(() => props.trackIdx);
46
+ const scrollerDomId = useId();
47
+ const getScrollerContainer = () => document.querySelector(`#${scrollerDomId} > .o-scroller-container`);
42
48
  const scrollContainer = ref();
43
49
  const wheelVisible = ref(false);
44
50
  const handleScroll = () => {
@@ -88,14 +94,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
88
94
  };
89
95
  onMounted(() => {
90
96
  var _a;
91
- scrollContainer.value = document.querySelector("#captionsScrollDom > .o-scroller-container");
97
+ scrollContainer.value = getScrollerContainer();
92
98
  (_a = scrollContainer.value) == null ? void 0 : _a.addEventListener("wheel", handleScroll);
93
99
  });
94
100
  watch(
95
101
  () => computedCaptions.value,
96
102
  () => {
97
103
  var _a;
98
- scrollContainer.value = document.querySelector("#captionsScrollDom > .o-scroller-container");
104
+ scrollContainer.value = getScrollerContainer();
99
105
  (_a = scrollContainer.value) == null ? void 0 : _a.addEventListener("wheel", handleScroll);
100
106
  }
101
107
  );
@@ -359,7 +365,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
359
365
  default: withCtx(() => [
360
366
  computedCaptions.value.length ? (openBlock(), createBlock(unref(OScroller), {
361
367
  key: 0,
362
- id: "captionsScrollDom",
368
+ id: unref(scrollerDomId),
363
369
  class: "captions-scroller",
364
370
  "show-type": "hover",
365
371
  size: "small",
@@ -408,8 +414,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
408
414
  })
409
415
  ]),
410
416
  _: 1
411
- })) : (openBlock(), createElementBlock("div", _hoisted_11, [
412
- renderSlot(_ctx.$slots, "empty")
417
+ }, 8, ["id"])) : (openBlock(), createElementBlock("div", _hoisted_11, [
418
+ renderSlot(_ctx.$slots, "empty", {}, () => [
419
+ createVNode(OEmpty)
420
+ ])
413
421
  ]))
414
422
  ]),
415
423
  _: 3
@@ -1,10 +1,11 @@
1
- import { defineComponent, ref, watch, onMounted, onUnmounted, openBlock, createElementBlock, createElementVNode, normalizeClass, toDisplayString, createCommentVNode, nextTick } from "vue";
1
+ import { defineComponent, ref, useId, watch, onMounted, onUnmounted, openBlock, createElementBlock, createElementVNode, normalizeClass, unref, toDisplayString, createCommentVNode } from "vue";
2
2
  import videojs from "../../../_virtual/video.js/dist/video.es.js.mjs";
3
3
  import '../../../_virtual/video.js/dist/video-js.css';
4
4
  import { transformTime } from "../utils.mjs";
5
5
  import defaultPoster from "../../../assets/meeting/transparent.png.mjs";
6
6
  const _hoisted_1 = { class: "o-meeting-playback-video" };
7
- const _hoisted_2 = {
7
+ const _hoisted_2 = ["id"];
8
+ const _hoisted_3 = {
8
9
  key: 0,
9
10
  class: "poster-title"
10
11
  };
@@ -23,8 +24,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
23
24
  setup(__props, { expose: __expose, emit: __emit }) {
24
25
  const props = __props;
25
26
  const timer = ref();
26
- const colHeight = ref();
27
27
  const playerRef = ref();
28
+ const playerId = useId();
28
29
  const emits = __emit;
29
30
  const speakerMenuVisible = ref(false);
30
31
  const closeSpeakerMenu = () => {
@@ -96,50 +97,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
96
97
  );
97
98
  const loaded = ref(false);
98
99
  const playStatus = ref("init");
99
- const updateSource = () => {
100
- const player = playerRef.value;
101
- if (!player || !props.src) return;
102
- player.src(props.src);
103
- player.poster(props.poster || defaultPoster);
104
- const oldTracks = player.remoteTextTracks();
105
- for (let i = oldTracks.length - 1; i >= 0; i--) {
106
- player.removeRemoteTextTrack(oldTracks[i]);
107
- }
108
- if (props.vtt) {
109
- player.addRemoteTextTrack({
110
- kind: "subtitles",
111
- src: props.vtt,
112
- srclang: "zh",
113
- label: "中文",
114
- default: false
115
- });
116
- const textTracks = player.textTracks();
117
- for (let i = 0; i < textTracks.length; i++) {
118
- const textTrack = textTracks[i];
119
- textTrack == null ? void 0 : textTrack.addEventListener("cuechange", () => {
120
- handleCue(textTrack);
121
- });
122
- }
123
- }
124
- playStatus.value = "init";
125
- checkedSpeakers.value = [];
126
- syncSubtitleBtn(player);
127
- };
128
- const syncSubtitleBtn = (player) => {
129
- var _a, _b;
130
- const btn = (_b = (_a = player.controlBar) == null ? void 0 : _a.getChild) == null ? void 0 : _b.call(_a, "SubtitleToggleButton");
131
- if (!btn) return;
132
- if (props.vtt) {
133
- btn.show();
134
- } else {
135
- btn.hide();
136
- btn.removeClass("vjs-subtitle-showing");
137
- btn.addClass("vjs-subtitle-hidden");
138
- }
139
- };
140
100
  const videoInit = async () => {
141
101
  if (!props.src) return;
142
- const player = videojs("playerId", {
102
+ const player = videojs(playerId, {
143
103
  controls: true,
144
104
  autoplay: false,
145
105
  preload: "auto",
@@ -172,9 +132,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
172
132
  }
173
133
  }
174
134
  });
175
- playerRef.value = player;
176
135
  emits("getInstance", player);
177
- updateSource();
136
+ player.src(props.src);
137
+ player.addRemoteTextTrack({
138
+ kind: "subtitles",
139
+ src: props.vtt,
140
+ srclang: "zh",
141
+ label: "中文",
142
+ default: false
143
+ });
178
144
  loaded.value = true;
179
145
  class CustomSubsCapsButton extends videojs.getComponent("Button") {
180
146
  constructor(player2, options) {
@@ -202,11 +168,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
202
168
  }
203
169
  }
204
170
  }
205
- videojs.registerComponent("SubtitleToggleButton", CustomSubsCapsButton);
206
- if (!player.controlBar.children_.some((v) => v.name_ === "SubtitleToggleButton")) {
207
- player.controlBar.addChild("SubtitleToggleButton", {}, 8);
171
+ if (props.vtt) {
172
+ const subtitleToggleName = `SubtitleToggleButton-${playerId}`;
173
+ videojs.registerComponent(subtitleToggleName, CustomSubsCapsButton);
174
+ if (!player.controlBar.children_.some((v) => v.name_ === subtitleToggleName)) {
175
+ player.controlBar.addChild(subtitleToggleName, {}, 8);
176
+ }
208
177
  }
209
- syncSubtitleBtn(player);
178
+ const textTracks = player == null ? void 0 : player.textTracks().tracks_;
179
+ textTracks.forEach((textTrack) => {
180
+ textTrack == null ? void 0 : textTrack.addEventListener("cuechange", () => {
181
+ handleCue(textTrack);
182
+ });
183
+ });
210
184
  player.on("play", () => {
211
185
  playStatus.value = "playing";
212
186
  });
@@ -218,35 +192,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
218
192
  });
219
193
  emits("setTrackIdx", idx);
220
194
  });
221
- player.on("loadedmetadata", () => {
195
+ player.one("loadedmetadata", () => {
222
196
  emits("getDuration", player.duration());
223
197
  });
224
- nextTick(() => {
225
- const container = document.getElementsByClassName("o-meeting-playback-video")[0];
226
- colHeight.value = container.offsetHeight;
227
- });
198
+ playerRef.value = player;
228
199
  };
229
200
  onMounted(() => {
230
201
  videoInit();
231
202
  document.addEventListener("click", closeSpeakerMenu);
232
203
  });
233
204
  watch(
234
- () => [props.src, props.vtt, props.poster],
205
+ () => props.src,
235
206
  () => {
236
- if (!playerRef.value) {
237
- videoInit();
238
- } else {
239
- updateSource();
240
- }
207
+ videoInit();
241
208
  }
242
209
  );
243
210
  onUnmounted(() => {
244
211
  var _a;
245
- if (playerRef.value) {
246
- playerRef.value.dispose();
247
- } else {
248
- (_a = props == null ? void 0 : props.instance) == null ? void 0 : _a.dispose();
249
- }
212
+ (_a = props == null ? void 0 : props.instance) == null ? void 0 : _a.dispose();
250
213
  document.removeEventListener("click", closeSpeakerMenu);
251
214
  });
252
215
  __expose({
@@ -264,11 +227,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
264
227
  [playStatus.value]: true
265
228
  }])
266
229
  }, [
267
- _cache[0] || (_cache[0] = createElementVNode("video", {
230
+ createElementVNode("video", {
268
231
  class: "video-js",
269
- id: "playerId"
270
- }, null, -1)),
271
- __props.posterTitle ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(__props.posterTitle), 1)) : createCommentVNode("", true)
232
+ id: unref(playerId)
233
+ }, null, 8, _hoisted_2),
234
+ __props.posterTitle ? (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(__props.posterTitle), 1)) : createCommentVNode("", true)
272
235
  ], 2)
273
236
  ]);
274
237
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendesign-plus-test/components",
3
- "version": "0.0.1-rc.212",
3
+ "version": "0.0.1-rc.213",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",