@nmorph/nmorph-ui-kit 3.0.21 → 3.0.23

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@nmorph/nmorph-ui-kit",
3
3
  "type": "module",
4
4
  "private": false,
5
- "version": "3.0.21",
5
+ "version": "3.0.23",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -1 +0,0 @@
1
- .nmorph-media-tile{position:relative;display:flex;justify-content:center;align-items:center;box-sizing:border-box;min-width:0;overflow:hidden;background:var(--nmorph-main-color);border:none;border-radius:var(--default-border-radius);box-shadow:var(--nmorph-shadow-inset)}.nmorph-media-tile.nmorph-media-tile--video{aspect-ratio:16/9}.nmorph-media-tile.nmorph-media-tile--fill{width:100%;height:100%;aspect-ratio:auto}.nmorph-media-tile .nmorph-media-tile__video{width:100%;height:100%;object-fit:cover}.nmorph-media-tile.nmorph-media-tile--contain .nmorph-media-tile__video{object-fit:contain}.nmorph-media-tile.nmorph-media-tile--mirrored .nmorph-media-tile__video{transform:scaleX(-1)}.nmorph-media-tile .nmorph-media-tile__fallback{display:flex;flex-direction:column;gap:var(--indentation-02);justify-content:center;align-items:center;width:100%;height:100%;padding:var(--indentation-04);color:var(--nmorph-text-color);text-align:center}.nmorph-media-tile .nmorph-media-tile__initials{display:flex;justify-content:center;align-items:center;width:72px;height:72px;color:var(--nmorph-focus-text-color);font-weight:var(--font-weight-bold);font-size:var(--nmorph-typography-title-large-font-size);background:var(--nmorph-accent-color);border-radius:var(--border-radius-circular)}.nmorph-media-tile .nmorph-media-tile__name,.nmorph-media-tile .nmorph-media-tile__error-text{max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.nmorph-media-tile .nmorph-media-tile__error-text{color:var(--nmorph-error-text-color);font-size:var(--nmorph-typography-body-small-font-size);line-height:var(--nmorph-typography-body-small-line-height)}.nmorph-media-tile .nmorph-media-tile__status{position:absolute;right:var(--indentation-03);bottom:var(--indentation-03);display:flex;gap:var(--indentation-02)}.nmorph-media-tile .nmorph-media-tile__status-item{color:var(--nmorph-text-color)}.nmorph-media-tile .nmorph-media-tile__status-item .nmorph-button__content{width:28px;min-width:28px;height:24px;min-height:24px;padding:0;color:currentColor;background:color-mix(in srgb,var(--nmorph-main-color) 86%,transparent);border-color:color-mix(in srgb,currentColor 35%,transparent);border-radius:var(--default-border-radius)}.nmorph-media-tile.nmorph-media-tile--selected{outline:2px solid var(--nmorph-accent-color)}.nmorph-media-tile.nmorph-media-tile--speaking{outline:3px solid var(--nmorph-success-text-color)}.nmorph-media-tile.nmorph-media-tile--error{outline:2px solid var(--nmorph-error-text-color)}.nmorph-media-tile.nmorph-media-tile--plain{border:var(--nmorph-plain-border);box-shadow:none}.nmorph-media-tile.nmorph-media-tile--screen-sharing{box-shadow:0 0 0 2px var(--nmorph-success-text-color)}
@@ -1,139 +0,0 @@
1
- import './NmorphMediaTile.css';
2
- import d from "./NmorphMediaTile.vue2.js";
3
- import { openBlock as e, createElementBlock as a, normalizeClass as m, withDirectives as p, createElementVNode as c, vShow as _, createCommentVNode as r, createBlock as i, withCtx as n, createVNode as l, toDisplayString as t, renderSlot as h } from "vue";
4
- /* empty css */
5
- import f from "../../../_virtual/_plugin-vue_export-helper.js";
6
- const v = ["src", "muted", "autoplay", "playsinline"], y = ["muted", "autoplay"], k = {
7
- key: 1,
8
- class: "nmorph-media-tile__fallback"
9
- }, b = {
10
- key: 2,
11
- class: "nmorph-media-tile__initials"
12
- }, N = {
13
- key: 3,
14
- class: "nmorph-media-tile__name"
15
- }, u = {
16
- key: 4,
17
- class: "nmorph-media-tile__error-text"
18
- }, g = {
19
- key: 2,
20
- class: "nmorph-media-tile__status"
21
- };
22
- function S(s, x, V, o, w, B) {
23
- return e(), a(
24
- "div",
25
- {
26
- class: m(o.modifiers)
27
- },
28
- [
29
- p(c("video", {
30
- ref: "videoRef",
31
- class: "nmorph-media-tile__video",
32
- src: o.videoSrc,
33
- muted: o.videoMuted,
34
- autoplay: o.props.autoplay,
35
- playsinline: o.props.playsinline
36
- }, null, 8, v), [
37
- [_, o.videoVisible && !o.props.loading]
38
- ]),
39
- o.needsSeparateAudioOutput ? (e(), a("audio", {
40
- key: 0,
41
- ref: "audioRef",
42
- class: "nmorph-media-tile__audio",
43
- muted: o.props.muted,
44
- autoplay: o.props.autoplay,
45
- preload: "auto"
46
- }, null, 8, y)) : r("v-if", !0),
47
- o.props.showFallback && (!o.videoVisible || o.props.loading) ? (e(), a("div", k, [
48
- o.props.loading ? (e(), i(o.NmorphIcon, {
49
- key: 0,
50
- class: "nmorph-media-tile__loader",
51
- size: "large"
52
- }, {
53
- default: n(() => [
54
- l(o.NmorphIconLoaderDots)
55
- ]),
56
- _: 1
57
- /* STABLE */
58
- })) : o.props.avatarSrc ? (e(), i(o.NmorphAvatar, {
59
- key: 1,
60
- src: o.props.avatarSrc,
61
- name: o.props.name,
62
- size: 72,
63
- design: "plain"
64
- }, null, 8, ["src", "name"])) : (e(), a(
65
- "div",
66
- b,
67
- t(o.fallbackLabel),
68
- 1
69
- /* TEXT */
70
- )),
71
- o.props.name ? (e(), a(
72
- "span",
73
- N,
74
- t(o.props.name),
75
- 1
76
- /* TEXT */
77
- )) : r("v-if", !0),
78
- o.props.error && o.props.errorText ? (e(), a(
79
- "span",
80
- u,
81
- t(o.props.errorText),
82
- 1
83
- /* TEXT */
84
- )) : r("v-if", !0)
85
- ])) : r("v-if", !0),
86
- o.props.showStatus ? (e(), a("div", g, [
87
- o.props.micMuted ? (e(), i(o.NmorphButton, {
88
- key: 0,
89
- class: "nmorph-media-tile__status-item",
90
- design: "plain",
91
- borderless: "",
92
- tabindex: -1,
93
- "aria-label": "Microphone muted"
94
- }, {
95
- "icon-only": n(() => [
96
- l(o.NmorphIconMute)
97
- ]),
98
- _: 1
99
- /* STABLE */
100
- })) : r("v-if", !0),
101
- o.props.videoOff ? (e(), i(o.NmorphButton, {
102
- key: 1,
103
- class: "nmorph-media-tile__status-item",
104
- design: "plain",
105
- borderless: "",
106
- tabindex: -1,
107
- "aria-label": "Video off"
108
- }, {
109
- "icon-only": n(() => [
110
- l(o.NmorphIconVideoCameraOff)
111
- ]),
112
- _: 1
113
- /* STABLE */
114
- })) : r("v-if", !0),
115
- o.props.screenSharing ? (e(), i(o.NmorphButton, {
116
- key: 2,
117
- class: "nmorph-media-tile__status-item",
118
- design: "plain",
119
- borderless: "",
120
- tabindex: -1,
121
- "aria-label": "Screen sharing"
122
- }, {
123
- "icon-only": n(() => [
124
- l(o.NmorphIconShare)
125
- ]),
126
- _: 1
127
- /* STABLE */
128
- })) : r("v-if", !0)
129
- ])) : r("v-if", !0),
130
- h(s.$slots, "overlay")
131
- ],
132
- 2
133
- /* CLASS */
134
- );
135
- }
136
- const z = /* @__PURE__ */ f(d, [["render", S], ["__file", "/home/runner/work/nmorph/nmorph/library/src/components/data/nmorph-media-tile/NmorphMediaTile.vue"]]);
137
- export {
138
- z as default
139
- };
@@ -1,139 +0,0 @@
1
- import './NmorphMediaTile.css';
2
- import { defineComponent as _, ref as m, computed as t, watch as I } from "vue";
3
- import { useModifiers as E } from "../../../utils/create-modifiers.js";
4
- import L from "../../../assets/icons/video-camera-off.svg.js";
5
- import A from "../../../assets/icons/share.svg.js";
6
- import C from "../../../assets/icons/mute.svg.js";
7
- import x from "../../basic/nmorph-icon/NmorphIcon.vue.js";
8
- import w from "../../basic/nmorph-button/NmorphButton.vue.js";
9
- import R from "../nmorph-avatar/NmorphAvatar.vue.js";
10
- import D from "../../../assets/icons/loader.svg.js";
11
- const W = /* @__PURE__ */ _({
12
- __name: "NmorphMediaTile",
13
- props: {
14
- design: { type: null, required: !1, default: "nmorph" },
15
- aspect: { type: String, required: !1, default: "video" },
16
- src: { type: String, required: !1, default: "" },
17
- srcObject: { type: null, required: !1, default: null },
18
- sinkId: { type: String, required: !1, default: void 0 },
19
- fit: { type: String, required: !1, default: "cover" },
20
- mirrored: { type: Boolean, required: !1, default: !1 },
21
- muted: { type: Boolean, required: !1, default: !0 },
22
- autoplay: { type: Boolean, required: !1, default: !0 },
23
- playsinline: { type: Boolean, required: !1, default: !0 },
24
- name: { type: String, required: !1, default: "" },
25
- avatarSrc: { type: String, required: !1, default: "" },
26
- loading: { type: Boolean, required: !1, default: !1 },
27
- showFallback: { type: Boolean, required: !1, default: !0 },
28
- showStatus: { type: Boolean, required: !1, default: !0 },
29
- micMuted: { type: Boolean, required: !1, default: !1 },
30
- videoOff: { type: Boolean, required: !1, default: !1 },
31
- screenSharing: { type: Boolean, required: !1, default: !1 },
32
- speaking: { type: Boolean, required: !1, default: !1 },
33
- selected: { type: Boolean, required: !1, default: !1 },
34
- error: { type: Boolean, required: !1, default: !1 },
35
- errorText: { type: String, required: !1, default: "" }
36
- },
37
- setup(j, { expose: N }) {
38
- const e = j, o = m(null), i = m(null), u = m({
39
- audio: 0,
40
- video: 0
41
- }), y = t(() => !!(e.src || e.srcObject)), h = (r) => !r || typeof r.getAudioTracks != "function" ? [] : r.getAudioTracks(), g = (r) => !r || typeof r.getVideoTracks != "function" ? [] : r.getVideoTracks(), d = (r) => {
42
- u.value = {
43
- audio: h(r).length,
44
- video: g(r).length
45
- };
46
- }, k = t(() => typeof e.srcObject?.getVideoTracks == "function"), S = t(() => u.value.video > 0), O = t(
47
- () => !!(e.src || e.srcObject && (!k.value || S.value))
48
- ), s = t(() => y.value && O.value && !e.videoOff && !e.error), n = t(() => !!(e.srcObject && !e.muted && !e.error)), b = t(() => e.muted || n.value), T = t(() => s.value && e.src ? e.src : void 0), q = t(
49
- () => e.name.split(/\s+/).filter(Boolean).slice(0, 2).map((r) => r[0]?.toUpperCase()).join("")
50
- ), M = t(() => q.value || e.name || "?"), V = t(
51
- () => E({
52
- "nmorph-media-tile": [
53
- e.design,
54
- e.aspect,
55
- e.fit,
56
- e.mirrored && "mirrored",
57
- e.selected && "selected",
58
- e.speaking && "speaking",
59
- e.error && "error",
60
- e.videoOff && "video-off",
61
- e.screenSharing && "screen-sharing",
62
- e.loading && "loading"
63
- ]
64
- })
65
- ), c = (r) => {
66
- if (!r || e.sinkId === void 0) return;
67
- const a = r;
68
- typeof a.setSinkId == "function" && a.setSinkId(e.sinkId).catch(() => {
69
- });
70
- }, f = (r) => {
71
- console.warn("[NmorphMediaTile] media autoplay failed", r);
72
- }, p = (r) => {
73
- if (!r || !e.autoplay) return;
74
- let a;
75
- try {
76
- a = r.play();
77
- } catch (v) {
78
- f(v);
79
- return;
80
- }
81
- a && typeof a.catch == "function" && a.catch(f);
82
- };
83
- I(
84
- () => e.srcObject,
85
- (r, a, v) => {
86
- if (d(r), !r || typeof r.addEventListener != "function" || typeof r.removeEventListener != "function")
87
- return;
88
- const l = () => d(r);
89
- r.addEventListener("addtrack", l), r.addEventListener("removetrack", l), v(() => {
90
- r.removeEventListener("addtrack", l), r.removeEventListener("removetrack", l);
91
- });
92
- },
93
- { immediate: !0 }
94
- ), I(
95
- () => [
96
- e.srcObject,
97
- e.sinkId,
98
- e.autoplay,
99
- e.videoOff,
100
- e.error,
101
- s.value,
102
- n.value,
103
- b.value,
104
- o.value,
105
- i.value
106
- ],
107
- () => {
108
- if (o.value) {
109
- const r = e.srcObject;
110
- o.value.srcObject !== r && (o.value.srcObject = r), c(o.value), e.autoplay && r && !e.videoOff && !e.error && p(o.value);
111
- }
112
- if (i.value) {
113
- const r = n.value ? e.srcObject : null;
114
- i.value.srcObject !== r && (i.value.srcObject = r), c(i.value), e.autoplay && n.value && p(i.value);
115
- }
116
- },
117
- { immediate: !0, flush: "post" }
118
- ), N({ videoRef: o });
119
- const B = { props: e, videoRef: o, audioRef: i, srcObjectTrackCount: u, hasMediaSource: y, getAudioTracks: h, getVideoTracks: g, updateSrcObjectTrackCount: d, canInspectVideoTracks: k, hasVideoTracks: S, hasVideoSource: O, videoVisible: s, needsSeparateAudioOutput: n, videoMuted: b, videoSrc: T, initials: q, fallbackLabel: M, modifiers: V, setMediaElementSinkId: c, logMediaPlaybackError: f, playMediaElement: p, get NmorphAvatar() {
120
- return R;
121
- }, get NmorphButton() {
122
- return w;
123
- }, get NmorphIcon() {
124
- return x;
125
- }, get NmorphIconLoaderDots() {
126
- return D;
127
- }, get NmorphIconMute() {
128
- return C;
129
- }, get NmorphIconShare() {
130
- return A;
131
- }, get NmorphIconVideoCameraOff() {
132
- return L;
133
- } };
134
- return Object.defineProperty(B, "__isScriptSetup", { enumerable: !1, value: !0 }), B;
135
- }
136
- });
137
- export {
138
- W as default
139
- };
@@ -1,40 +0,0 @@
1
- import { INmorphMediaTileProps } from './types';
2
- import { DefineComponent, Ref, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
- import { NmorphMediaTileFit, NmorphMediaTileAspect } from '../..';
4
- declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphMediaTileProps, {
5
- videoRef: Ref<HTMLVideoElement, HTMLVideoElement>;
6
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<INmorphMediaTileProps> & Readonly<{}>, {
7
- name: string;
8
- design: "nmorph" | "plain";
9
- loading: boolean;
10
- error: boolean;
11
- src: string;
12
- fit: NmorphMediaTileFit;
13
- errorText: string;
14
- muted: boolean;
15
- playsinline: boolean;
16
- autoplay: boolean;
17
- aspect: NmorphMediaTileAspect;
18
- srcObject: MediaStream;
19
- sinkId: string;
20
- mirrored: boolean;
21
- avatarSrc: string;
22
- showFallback: boolean;
23
- showStatus: boolean;
24
- micMuted: boolean;
25
- videoOff: boolean;
26
- screenSharing: boolean;
27
- speaking: boolean;
28
- selected: boolean;
29
- }, {}, {}, {}, string, ComponentProvideOptions, true, {
30
- videoRef: HTMLVideoElement;
31
- audioRef: HTMLAudioElement;
32
- }, HTMLDivElement>, {
33
- overlay?(_: {}): any;
34
- }>;
35
- export default _default;
36
- type __VLS_WithTemplateSlots<T, S> = T & {
37
- new (): {
38
- $slots: S;
39
- };
40
- };
@@ -1,30 +0,0 @@
1
- import { NmorphElementDesignType } from '../../../types';
2
- export type NmorphMediaTileFit = 'cover' | 'contain';
3
- export type NmorphMediaTileAspect = 'video' | 'fill';
4
- export interface INmorphMediaTileProps {
5
- design?: NmorphElementDesignType;
6
- aspect?: NmorphMediaTileAspect;
7
- src?: string;
8
- srcObject?: MediaStream | null;
9
- sinkId?: string;
10
- fit?: NmorphMediaTileFit;
11
- mirrored?: boolean;
12
- muted?: boolean;
13
- autoplay?: boolean;
14
- playsinline?: boolean;
15
- name?: string;
16
- avatarSrc?: string;
17
- loading?: boolean;
18
- showFallback?: boolean;
19
- showStatus?: boolean;
20
- micMuted?: boolean;
21
- videoOff?: boolean;
22
- screenSharing?: boolean;
23
- speaking?: boolean;
24
- selected?: boolean;
25
- error?: boolean;
26
- errorText?: string;
27
- }
28
- export interface INmorphMediaTileExpose {
29
- videoRef: HTMLVideoElement | null;
30
- }