mulmocast-viewer 0.0.1

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/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # MulmoCast Viewer
2
+
3
+
4
+ ### cliでbundleを作る
5
+
6
+ ```
7
+ yarn run cli bundle scripts/foo/bar.json
8
+ ```
9
+
10
+ ### 作成したfolderをviewerのpublic以下に配置する
11
+
12
+ 重要なのは、以下のようなpathにmulmo_view.jsonが配置されているかどうかです。
13
+
14
+ ```
15
+ public/bar/mulmo_view.json
16
+ ```
17
+
18
+ ### DataListを更新する
19
+
20
+ ```
21
+ yarn run fileList
22
+ ```
23
+
24
+ ### サーバを起動する
25
+
26
+ ```
27
+ yarn run dev
28
+ ```
package/dist/i18n.d.ts ADDED
@@ -0,0 +1,76 @@
1
+ import { I18n } from 'vue-i18n';
2
+ declare const i18n: I18n<{
3
+ en: {
4
+ message: {
5
+ hello: string;
6
+ };
7
+ ui: {
8
+ common: {
9
+ noLang: string;
10
+ noMedia: string;
11
+ };
12
+ actions: {
13
+ translate: string;
14
+ generateAudio: string;
15
+ };
16
+ };
17
+ mulmoViewer: {
18
+ text: string;
19
+ audio: string;
20
+ };
21
+ project: {
22
+ productTabs: {
23
+ slide: {
24
+ autoPlay: string;
25
+ details: string;
26
+ };
27
+ };
28
+ };
29
+ languages: {
30
+ en: string;
31
+ ja: string;
32
+ zh: string;
33
+ ko: string;
34
+ es: string;
35
+ fr: string;
36
+ de: string;
37
+ };
38
+ };
39
+ ja: {
40
+ message: {
41
+ hello: string;
42
+ };
43
+ ui: {
44
+ common: {
45
+ noLang: string;
46
+ noMedia: string;
47
+ };
48
+ actions: {
49
+ translate: string;
50
+ generateAudio: string;
51
+ };
52
+ };
53
+ mulmoViewer: {
54
+ text: string;
55
+ audio: string;
56
+ };
57
+ project: {
58
+ productTabs: {
59
+ slide: {
60
+ autoPlay: string;
61
+ details: string;
62
+ };
63
+ };
64
+ };
65
+ languages: {
66
+ en: string;
67
+ ja: string;
68
+ zh: string;
69
+ ko: string;
70
+ es: string;
71
+ fr: string;
72
+ de: string;
73
+ };
74
+ };
75
+ }, {}, {}, string, false>;
76
+ export default i18n;
@@ -0,0 +1,3 @@
1
+ import { default as MulmoView } from './components/viewer.vue';
2
+ import { default as i18n } from './i18n';
3
+ export { MulmoView, i18n };
@@ -0,0 +1 @@
1
+ /*! tailwindcss v4.1.15 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.relative{position:relative}.bottom-2{bottom:calc(var(--spacing)*2)}.left-1\/2{left:50%}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.flex{display:flex}.hidden{display:none}.inline-block{display:inline-block}.table{display:table}.h-4{height:calc(var(--spacing)*4)}.h-6\!{height:calc(var(--spacing)*6)!important}.h-auto{height:auto}.max-h-\[80vh\]{max-height:80vh}.max-h-full{max-height:100%}.w-4{width:calc(var(--spacing)*4)}.w-30{width:calc(var(--spacing)*30)}.w-auto{width:auto}.w-full{width:100%}.max-w-7xl{max-width:var(--container-7xl)}.max-w-full{max-width:100%}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.resize{resize:both}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-4{gap:calc(var(--spacing)*4)}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.bg-gray-500{background-color:var(--color-gray-500)}.object-contain{object-fit:contain}.p-2{padding:calc(var(--spacing)*2)}.p-10{padding:calc(var(--spacing)*10)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.text-center{text-align:center}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-white{color:var(--color-white)}.opacity-0\!{opacity:0!important}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media(hover:hover){.hover\:bg-black\/80:hover{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.hover\:bg-black\/80:hover{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}}.hover\:bg-gray-600:hover{background-color:var(--color-gray-600)}}.disabled\:opacity-50:disabled{opacity:.5}}.mulmocast-video::-webkit-media-controls-enclosure{background-color:#00000080!important;border-radius:0!important}.mulmocast-video::-webkit-media-controls-current-time-display{-webkit-text-fill-color:#fff!important}.mulmocast-video::-webkit-media-controls-time-remaining-display{-webkit-text-fill-color:#fff!important}.mulmocast-video::-webkit-media-controls-play-button{filter:brightness(1.1)}.mulmocast-video::-webkit-media-controls-mute-button{filter:brightness(1.1)}.mulmocast-video::-webkit-media-controls-overlay-play-button{filter:brightness(1.1)}.mulmocast-video::-webkit-media-controls-fullscreen-button{filter:brightness(1.1)}.mulmocast-video::-webkit-media-controls{opacity:0;transition:opacity .3s}.mulmocast-video:hover::-webkit-media-controls{opacity:1}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}
@@ -0,0 +1,294 @@
1
+ import { defineComponent as W, ref as c, createElementBlock as m, openBlock as r, createTextVNode as j, createElementVNode as v, createCommentVNode as $, toDisplayString as R, unref as L, Fragment as G, renderList as U, computed as h, createVNode as T, withDirectives as H, createBlock as J, vShow as K } from "vue";
2
+ import { useI18n as O, createI18n as q } from "vue-i18n";
3
+ const D = async (e) => await new Promise((g) => setTimeout(g, e)), Q = { class: "items-center justify-center w-full" }, X = { key: 0 }, Y = ["src"], Z = {
4
+ key: 1,
5
+ class: "relative inline-block"
6
+ }, ee = ["src"], ae = ["src"], oe = { key: 2 }, te = ["src", "poster"], ue = {
7
+ key: 3,
8
+ class: "relative inline-block"
9
+ }, ne = ["src"], le = { key: 4 }, ie = "https://github.com/receptron/mulmocast-cli/blob/main/assets/images/mulmocast_credit.png?raw=true", M = /* @__PURE__ */ W({
10
+ __name: "page",
11
+ props: {
12
+ index: {},
13
+ videoWithAudioSource: {},
14
+ soundEffectSource: {},
15
+ videoSource: {},
16
+ imageSource: {},
17
+ audioSource: {},
18
+ text: {},
19
+ duration: {}
20
+ },
21
+ emits: ["play", "pause", "ended"],
22
+ setup(e, { expose: g, emit: P }) {
23
+ const { t: l } = O(), b = e, i = P, a = c(), o = c(), u = c(), s = c(), x = c(), S = () => {
24
+ u.value && o.value && (u.value.currentTime = o.value.currentTime, u.value.currentTime === o.value.currentTime && u.value.play()), i("play");
25
+ }, n = (d) => {
26
+ !o.value?.ended && u?.value && u.value?.pause(), console.log(d), p(d);
27
+ }, _ = () => {
28
+ !u.value?.paused && !u.value?.ended && (u.value?.currentTime ?? 0) > 0 || y();
29
+ }, E = () => {
30
+ !o.value?.paused && !o.value?.ended && (o.value?.currentTime ?? 0) > 0 || y();
31
+ }, V = () => {
32
+ i("play");
33
+ }, p = (d) => {
34
+ const k = d.target;
35
+ k.duration !== k.currentTime && i("pause");
36
+ }, y = () => {
37
+ i("ended");
38
+ };
39
+ return g({
40
+ play: async () => {
41
+ a.value && a.value.play(), o.value && o.value.play(), s.value && s.value.play(), !a.value && !o.value && !s.value && (await D((b.duration ?? 0) * 1e3), i("ended"));
42
+ }
43
+ }), (d, k) => (r(), m("div", Q, [
44
+ e.videoWithAudioSource ? (r(), m("div", X, [
45
+ v("video", {
46
+ ref_key: "videoWithAudioRef",
47
+ ref: a,
48
+ src: e.videoWithAudioSource,
49
+ class: "mulmocast-video mx-auto h-auto max-h-[80vh] w-auto object-contain",
50
+ controls: !0,
51
+ playsinline: "true",
52
+ onPlay: V,
53
+ onPause: p,
54
+ onEnded: y
55
+ }, null, 40, Y)
56
+ ])) : e.soundEffectSource || e.videoSource ? (r(), m("div", Z, [
57
+ v("video", {
58
+ ref_key: "videoRef",
59
+ ref: o,
60
+ class: "mulmocast-video mx-auto h-auto max-h-[80vh] w-auto object-contain",
61
+ src: e.soundEffectSource || e.videoSource,
62
+ controls: !0,
63
+ playsinline: "true",
64
+ onPlay: S,
65
+ onPause: n,
66
+ onEnded: _
67
+ }, null, 40, ee),
68
+ e.audioSource ? (r(), m("audio", {
69
+ key: 0,
70
+ ref_key: "audioSyncRef",
71
+ ref: u,
72
+ src: e.audioSource,
73
+ controls: !0,
74
+ class: "hidden",
75
+ onEnded: E
76
+ }, null, 40, ae)) : $("", !0)
77
+ ])) : e.audioSource ? (r(), m("div", oe, [
78
+ v("video", {
79
+ ref_key: "audioRef",
80
+ ref: s,
81
+ class: "mulmocast-video mx-auto h-auto max-h-[80vh] w-auto object-contain",
82
+ src: e.audioSource,
83
+ poster: e.imageSource ?? ie,
84
+ controls: !0,
85
+ playsinline: "true",
86
+ onPlay: V,
87
+ onPause: p,
88
+ onEnded: y
89
+ }, null, 40, te)
90
+ ])) : e.imageSource ? (r(), m("div", ue, [
91
+ v("img", {
92
+ ref_key: "imageRef",
93
+ ref: x,
94
+ src: e.imageSource,
95
+ class: "max-w-full max-h-full object-contain"
96
+ }, null, 8, ne)
97
+ ])) : (r(), m("div", le, R(L(l)("ui.common.noMedia")), 1)),
98
+ j(" " + R(e.text), 1)
99
+ ]));
100
+ }
101
+ }), se = ["value"], de = ["value"], B = /* @__PURE__ */ W({
102
+ __name: "select_language",
103
+ props: {
104
+ modelValue: {}
105
+ },
106
+ emits: ["update:modelValue"],
107
+ setup(e, { emit: g }) {
108
+ const P = ["en", "ja"], l = g, b = (i) => {
109
+ const a = i.target;
110
+ l("update:modelValue", a.value);
111
+ };
112
+ return (i, a) => (r(), m("select", {
113
+ value: e.modelValue,
114
+ onChange: b
115
+ }, [
116
+ (r(), m(G, null, U(P, (o) => v("option", {
117
+ key: o,
118
+ value: o
119
+ }, R(o), 9, de)), 64))
120
+ ], 40, se));
121
+ }
122
+ }), ce = { class: "w-full overflow-hidden" }, re = { class: "max-w-7xl mx-auto px-4" }, ve = { class: "flex items-center justify-between" }, me = ["disabled"], fe = { class: "px-4" }, ge = ["src"], he = ["disabled"], xe = /* @__PURE__ */ W({
123
+ __name: "viewer",
124
+ props: {
125
+ dataSet: {},
126
+ basePath: {},
127
+ initPage: {}
128
+ },
129
+ emits: ["updatedPage"],
130
+ setup(e, { expose: g, emit: P }) {
131
+ const l = e, b = P, i = l.dataSet?.beats?.length ?? 0, a = c(l.initPage ?? 0), o = c(!0), u = c(), s = c(), x = c("en"), S = c("ja"), n = h(() => l.dataSet?.beats[a.value]), _ = h(() => n.value?.videoWithAudioSource ? l.basePath + "/" + n.value.videoWithAudioSource : ""), E = h(() => n.value?.soundEffectSource ? l.basePath + "/" + n.value.soundEffectSource : ""), V = h(() => n.value?.videoSource ? l.basePath + "/" + n.value.videoSource : ""), p = h(() => {
132
+ const f = n.value?.audioSources?.[S.value];
133
+ return f ? l.basePath + "/" + f : "";
134
+ }), y = h(() => n.value?.imageSource ? l.basePath + "/" + n.value.imageSource : ""), C = h(() => n.value?.multiLinguals?.[x.value] ?? n.value?.text ?? ""), d = c(!1), k = () => {
135
+ d.value = !0, s.value && s.value.play();
136
+ }, I = () => {
137
+ console.log("pause"), d.value = !1, s.value && s.value.pause();
138
+ }, N = async () => {
139
+ await D(500), u.value && u.value.play();
140
+ }, F = (f) => {
141
+ a.value !== f && (a.value = f, d.value && o.value && N());
142
+ }, A = (f) => {
143
+ const t = a.value + f;
144
+ return t > -1 && t < i ? (F(t), b("updatedPage", t), !0) : !1;
145
+ }, z = () => {
146
+ console.log("end"), d.value = !1, o.value && A(1) ? N() : s.value && s.value.pause();
147
+ };
148
+ return g({
149
+ updatePage: F
150
+ }), (f, t) => (r(), m("div", ce, [
151
+ v("div", re, [
152
+ v("div", ve, [
153
+ v("button", {
154
+ class: "px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600 disabled:opacity-50",
155
+ disabled: a.value === 0,
156
+ onClick: t[0] || (t[0] = (w) => A(-1))
157
+ }, " Prev ", 8, me),
158
+ v("div", fe, [
159
+ T(M, {
160
+ ref_key: "mediaPlayer",
161
+ ref: u,
162
+ "video-with-audio-source": _.value,
163
+ "video-source": V.value,
164
+ "sound-effect-source": E.value,
165
+ "audio-source": p.value,
166
+ "image-source": y.value,
167
+ index: a.value,
168
+ text: C.value,
169
+ duration: n.value?.duration,
170
+ onPlay: k,
171
+ onPause: I,
172
+ onEnded: z
173
+ }, null, 8, ["video-with-audio-source", "video-source", "sound-effect-source", "audio-source", "image-source", "index", "text", "duration"]),
174
+ a.value + 1 < L(i) ? H((r(), J(M, {
175
+ key: 0,
176
+ data: e.dataSet?.beats[a.value + 1],
177
+ "base-path": e.basePath,
178
+ index: a.value + 1
179
+ }, null, 8, ["data", "base-path", "index"])), [
180
+ [K, !1]
181
+ ]) : $("", !0)
182
+ ]),
183
+ e.dataSet?.bgmFile ? (r(), m("audio", {
184
+ key: 0,
185
+ ref_key: "bgmRef",
186
+ ref: s,
187
+ src: e.dataSet?.bgmFile
188
+ }, null, 8, ge)) : $("", !0),
189
+ v("button", {
190
+ class: "px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600 disabled:opacity-50",
191
+ disabled: a.value >= L(i) - 1,
192
+ onClick: t[1] || (t[1] = (w) => A(1))
193
+ }, " Next ", 8, he)
194
+ ])
195
+ ]),
196
+ v("div", null, [
197
+ t[4] || (t[4] = j("Audio: ", -1)),
198
+ T(B, {
199
+ modelValue: S.value,
200
+ "onUpdate:modelValue": t[2] || (t[2] = (w) => S.value = w)
201
+ }, null, 8, ["modelValue"])
202
+ ]),
203
+ v("div", null, [
204
+ t[5] || (t[5] = j("Text: ", -1)),
205
+ T(B, {
206
+ modelValue: x.value,
207
+ "onUpdate:modelValue": t[3] || (t[3] = (w) => x.value = w)
208
+ }, null, 8, ["modelValue"])
209
+ ])
210
+ ]));
211
+ }
212
+ }), ye = {
213
+ en: {
214
+ message: {
215
+ hello: "Hello"
216
+ },
217
+ ui: {
218
+ common: {
219
+ noLang: "No language available",
220
+ noMedia: "No media available"
221
+ },
222
+ actions: {
223
+ translate: "Translate",
224
+ generateAudio: "Generate Audio"
225
+ }
226
+ },
227
+ mulmoViewer: {
228
+ text: "Text",
229
+ audio: "Audio"
230
+ },
231
+ project: {
232
+ productTabs: {
233
+ slide: {
234
+ autoPlay: "Auto Play",
235
+ details: "{current} / {pages}"
236
+ }
237
+ }
238
+ },
239
+ languages: {
240
+ en: "English",
241
+ ja: "Japanese",
242
+ zh: "Chinese",
243
+ ko: "Korean",
244
+ es: "Spanish",
245
+ fr: "French",
246
+ de: "German"
247
+ }
248
+ },
249
+ ja: {
250
+ message: {
251
+ hello: "こんにちは"
252
+ },
253
+ ui: {
254
+ common: {
255
+ noLang: "言語がありません",
256
+ noMedia: "メディアがありません"
257
+ },
258
+ actions: {
259
+ translate: "翻訳",
260
+ generateAudio: "音声を生成"
261
+ }
262
+ },
263
+ mulmoViewer: {
264
+ text: "テキスト",
265
+ audio: "音声"
266
+ },
267
+ project: {
268
+ productTabs: {
269
+ slide: {
270
+ autoPlay: "自動再生",
271
+ details: "{current} / {pages}"
272
+ }
273
+ }
274
+ },
275
+ languages: {
276
+ en: "英語",
277
+ ja: "日本語",
278
+ zh: "中国語",
279
+ ko: "韓国語",
280
+ es: "スペイン語",
281
+ fr: "フランス語",
282
+ de: "ドイツ語"
283
+ }
284
+ }
285
+ }, Se = q({
286
+ legacy: !1,
287
+ locale: "en",
288
+ fallbackLocale: "en",
289
+ messages: ye
290
+ });
291
+ export {
292
+ xe as MulmoView,
293
+ Se as i18n
294
+ };
@@ -0,0 +1 @@
1
+ (function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-i18n")):typeof define=="function"&&define.amd?define(["exports","vue","vue-i18n"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r["mulmoast-viewer"]={},r.Vue,r.VueI18n))})(this,(function(r,e,w){"use strict";const B=async t=>await new Promise(f=>setTimeout(f,t)),$={class:"items-center justify-center w-full"},R={key:0},C=["src"],L={key:1,class:"relative inline-block"},W=["src"],M=["src"],D={key:2},F=["src","poster"],I={key:3,class:"relative inline-block"},q=["src"],z={key:4},G="https://github.com/receptron/mulmocast-cli/blob/main/assets/images/mulmocast_credit.png?raw=true",N=e.defineComponent({__name:"page",props:{index:{},videoWithAudioSource:{},soundEffectSource:{},videoSource:{},imageSource:{},audioSource:{},text:{},duration:{}},emits:["play","pause","ended"],setup(t,{expose:f,emit:h}){const{t:d}=w.useI18n(),y=t,c=h,o=e.ref(),a=e.ref(),l=e.ref(),s=e.ref(),v=e.ref(),p=()=>{l.value&&a.value&&(l.value.currentTime=a.value.currentTime,l.value.currentTime===a.value.currentTime&&l.value.play()),c("play")},i=u=>{!a.value?.ended&&l?.value&&l.value?.pause(),console.log(u),k(u)},b=()=>{!l.value?.paused&&!l.value?.ended&&(l.value?.currentTime??0)>0||g()},E=()=>{!a.value?.paused&&!a.value?.ended&&(a.value?.currentTime??0)>0||g()},P=()=>{c("play")},k=u=>{const S=u.target;S.duration!==S.currentTime&&c("pause")},g=()=>{c("ended")};return f({play:async()=>{o.value&&o.value.play(),a.value&&a.value.play(),s.value&&s.value.play(),!o.value&&!a.value&&!s.value&&(await B((y.duration??0)*1e3),c("ended"))}}),(u,S)=>(e.openBlock(),e.createElementBlock("div",$,[t.videoWithAudioSource?(e.openBlock(),e.createElementBlock("div",R,[e.createElementVNode("video",{ref_key:"videoWithAudioRef",ref:o,src:t.videoWithAudioSource,class:"mulmocast-video mx-auto h-auto max-h-[80vh] w-auto object-contain",controls:!0,playsinline:"true",onPlay:P,onPause:k,onEnded:g},null,40,C)])):t.soundEffectSource||t.videoSource?(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("video",{ref_key:"videoRef",ref:a,class:"mulmocast-video mx-auto h-auto max-h-[80vh] w-auto object-contain",src:t.soundEffectSource||t.videoSource,controls:!0,playsinline:"true",onPlay:p,onPause:i,onEnded:b},null,40,W),t.audioSource?(e.openBlock(),e.createElementBlock("audio",{key:0,ref_key:"audioSyncRef",ref:l,src:t.audioSource,controls:!0,class:"hidden",onEnded:E},null,40,M)):e.createCommentVNode("",!0)])):t.audioSource?(e.openBlock(),e.createElementBlock("div",D,[e.createElementVNode("video",{ref_key:"audioRef",ref:s,class:"mulmocast-video mx-auto h-auto max-h-[80vh] w-auto object-contain",src:t.audioSource,poster:t.imageSource??G,controls:!0,playsinline:"true",onPlay:P,onPause:k,onEnded:g},null,40,F)])):t.imageSource?(e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("img",{ref_key:"imageRef",ref:v,src:t.imageSource,class:"max-w-full max-h-full object-contain"},null,8,q)])):(e.openBlock(),e.createElementBlock("div",z,e.toDisplayString(e.unref(d)("ui.common.noMedia")),1)),e.createTextVNode(" "+e.toDisplayString(t.text),1)]))}}),O=["value"],U=["value"],T=e.defineComponent({__name:"select_language",props:{modelValue:{}},emits:["update:modelValue"],setup(t,{emit:f}){const h=["en","ja"],d=f,y=c=>{const o=c.target;d("update:modelValue",o.value)};return(c,o)=>(e.openBlock(),e.createElementBlock("select",{value:t.modelValue,onChange:y},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(h,a=>e.createElementVNode("option",{key:a,value:a},e.toDisplayString(a),9,U)),64))],40,O))}}),H={class:"w-full overflow-hidden"},J={class:"max-w-7xl mx-auto px-4"},K={class:"flex items-center justify-between"},Q=["disabled"],X={class:"px-4"},Y=["src"],Z=["disabled"],ee=e.defineComponent({__name:"viewer",props:{dataSet:{},basePath:{},initPage:{}},emits:["updatedPage"],setup(t,{expose:f,emit:h}){const d=t,y=h,c=d.dataSet?.beats?.length??0,o=e.ref(d.initPage??0),a=e.ref(!0),l=e.ref(),s=e.ref(),v=e.ref("en"),p=e.ref("ja"),i=e.computed(()=>d.dataSet?.beats[o.value]),b=e.computed(()=>i.value?.videoWithAudioSource?d.basePath+"/"+i.value.videoWithAudioSource:""),E=e.computed(()=>i.value?.soundEffectSource?d.basePath+"/"+i.value.soundEffectSource:""),P=e.computed(()=>i.value?.videoSource?d.basePath+"/"+i.value.videoSource:""),k=e.computed(()=>{const m=i.value?.audioSources?.[p.value];return m?d.basePath+"/"+m:""}),g=e.computed(()=>i.value?.imageSource?d.basePath+"/"+i.value.imageSource:""),_=e.computed(()=>i.value?.multiLinguals?.[v.value]??i.value?.text??""),u=e.ref(!1),S=()=>{u.value=!0,s.value&&s.value.play()},ae=()=>{console.log("pause"),u.value=!1,s.value&&s.value.pause()},A=async()=>{await B(500),l.value&&l.value.play()},j=m=>{o.value!==m&&(o.value=m,u.value&&a.value&&A())},V=m=>{const n=o.value+m;return n>-1&&n<c?(j(n),y("updatedPage",n),!0):!1},ne=()=>{console.log("end"),u.value=!1,a.value&&V(1)?A():s.value&&s.value.pause()};return f({updatePage:j}),(m,n)=>(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("div",J,[e.createElementVNode("div",K,[e.createElementVNode("button",{class:"px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600 disabled:opacity-50",disabled:o.value===0,onClick:n[0]||(n[0]=x=>V(-1))}," Prev ",8,Q),e.createElementVNode("div",X,[e.createVNode(N,{ref_key:"mediaPlayer",ref:l,"video-with-audio-source":b.value,"video-source":P.value,"sound-effect-source":E.value,"audio-source":k.value,"image-source":g.value,index:o.value,text:_.value,duration:i.value?.duration,onPlay:S,onPause:ae,onEnded:ne},null,8,["video-with-audio-source","video-source","sound-effect-source","audio-source","image-source","index","text","duration"]),o.value+1<e.unref(c)?e.withDirectives((e.openBlock(),e.createBlock(N,{key:0,data:t.dataSet?.beats[o.value+1],"base-path":t.basePath,index:o.value+1},null,8,["data","base-path","index"])),[[e.vShow,!1]]):e.createCommentVNode("",!0)]),t.dataSet?.bgmFile?(e.openBlock(),e.createElementBlock("audio",{key:0,ref_key:"bgmRef",ref:s,src:t.dataSet?.bgmFile},null,8,Y)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600 disabled:opacity-50",disabled:o.value>=e.unref(c)-1,onClick:n[1]||(n[1]=x=>V(1))}," Next ",8,Z)])]),e.createElementVNode("div",null,[n[4]||(n[4]=e.createTextVNode("Audio: ",-1)),e.createVNode(T,{modelValue:p.value,"onUpdate:modelValue":n[2]||(n[2]=x=>p.value=x)},null,8,["modelValue"])]),e.createElementVNode("div",null,[n[5]||(n[5]=e.createTextVNode("Text: ",-1)),e.createVNode(T,{modelValue:v.value,"onUpdate:modelValue":n[3]||(n[3]=x=>v.value=x)},null,8,["modelValue"])])]))}}),te={en:{message:{hello:"Hello"},ui:{common:{noLang:"No language available",noMedia:"No media available"},actions:{translate:"Translate",generateAudio:"Generate Audio"}},mulmoViewer:{text:"Text",audio:"Audio"},project:{productTabs:{slide:{autoPlay:"Auto Play",details:"{current} / {pages}"}}},languages:{en:"English",ja:"Japanese",zh:"Chinese",ko:"Korean",es:"Spanish",fr:"French",de:"German"}},ja:{message:{hello:"こんにちは"},ui:{common:{noLang:"言語がありません",noMedia:"メディアがありません"},actions:{translate:"翻訳",generateAudio:"音声を生成"}},mulmoViewer:{text:"テキスト",audio:"音声"},project:{productTabs:{slide:{autoPlay:"自動再生",details:"{current} / {pages}"}}},languages:{en:"英語",ja:"日本語",zh:"中国語",ko:"韓国語",es:"スペイン語",fr:"フランス語",de:"ドイツ語"}}},oe=w.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:te});r.MulmoView=ee,r.i18n=oe,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})}));
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "mulmocast-viewer",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "main": "dist/mulmocast-viewer.umd.js",
7
+ "module": "dist/mulmocast-viewer.es.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/mulmocast-viewer.es.js",
13
+ "require": "./dist/mulmocast-viewer.umd.js"
14
+ },
15
+ "./style.css": "./dist/mulmocast-viewer.css"
16
+ },
17
+ "files": [
18
+ "dist/mulmocast-viewer.umd.js",
19
+ "dist/mulmocast-viewer.es.js",
20
+ "dist/mulmocast-viewer.css",
21
+ "dist/index.d.ts",
22
+ "dist/i18n.d.ts"
23
+ ],
24
+ "scripts": {
25
+ "fileList": "npx tsx batch/file_list.ts",
26
+ "dev": "vite --config vite.app.ts",
27
+ "build:app": "vue-tsc -b && vite build --config vite.app.ts",
28
+ "build:lib": "vite build --config vite.lib.ts",
29
+ "build": "yarn run build:app && yarn run build:lib",
30
+ "preview": "vite preview",
31
+ "lint": "eslint src --fix",
32
+ "format": "prettier --write \"src/**/*.{ts,vue,css,html,json}\"",
33
+ "format:check": "prettier --check \"src/**/*.{ts,vue,css,html,json}\""
34
+ },
35
+ "dependencies": {
36
+ "pinia": "^3.0.3",
37
+ "vue": "^3.5.22",
38
+ "vue-i18n": "^11.1.12",
39
+ "vue-router": "^4.6.3"
40
+ },
41
+ "devDependencies": {
42
+ "@eslint/js": "^9.38.0",
43
+ "@tailwindcss/vite": "^4.1.15",
44
+ "@types/node": "^24.9.1",
45
+ "@vitejs/plugin-vue": "^6.0.1",
46
+ "@vue/tsconfig": "^0.8.1",
47
+ "eslint": "^9.38.0",
48
+ "eslint-config-prettier": "^10.1.8",
49
+ "eslint-plugin-sonarjs": "^3.0.5",
50
+ "eslint-plugin-vue": "^10.5.1",
51
+ "globals": "^16.4.0",
52
+ "prettier": "^3.6.2",
53
+ "tailwindcss": "^4.1.15",
54
+ "typescript": "~5.9.3",
55
+ "typescript-eslint": "^8.46.2",
56
+ "vite": "^7.1.11",
57
+ "vite-plugin-dts": "^4.5.4",
58
+ "vue-eslint-parser": "^10.2.0",
59
+ "vue-tsc": "^3.1.0"
60
+ }
61
+ }