labmaker-plugin 0.0.10-dev → 0.0.11

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,10 +1,10 @@
1
- import { openBlock as s, createElementBlock as c, Fragment as u, createElementVNode as n, toDisplayString as p, normalizeClass as m, createCommentVNode as l } from "vue";
2
- const _ = (e, o) => {
3
- const t = e.__vccOpts || e;
4
- for (const [i, a] of o)
5
- t[i] = a;
6
- return t;
7
- }, g = {
1
+ import { openBlock as s, createElementBlock as o, Fragment as k, createElementVNode as r, toDisplayString as p, normalizeClass as _, createCommentVNode as l, resolveComponent as b, normalizeStyle as y, createBlock as w, withModifiers as x, withCtx as f, createTextVNode as T, createVNode as H, renderList as L } from "vue";
2
+ const g = (t, n) => {
3
+ const e = t.__vccOpts || t;
4
+ for (const [d, a] of n)
5
+ e[d] = a;
6
+ return e;
7
+ }, S = {
8
8
  props: ["custom-img"],
9
9
  data() {
10
10
  return {
@@ -13,54 +13,54 @@ const _ = (e, o) => {
13
13
  },
14
14
  computed: {},
15
15
  methods: {
16
- fileUpload(e) {
17
- const t = e.target.files[0];
18
- this.fileProcess(t);
16
+ fileUpload(t) {
17
+ const e = t.target.files[0];
18
+ this.fileProcess(e);
19
19
  },
20
- fileProcess(e) {
21
- this.imgSRC = URL.createObjectURL(e);
20
+ fileProcess(t) {
21
+ this.imgSRC = URL.createObjectURL(t);
22
22
  }
23
23
  },
24
24
  mounted() {
25
25
  }
26
- }, h = /* @__PURE__ */ n("h1", null, "File Uploader", -1), f = { class: "image-uploader" }, y = /* @__PURE__ */ n("h1", null, "File Uploader", -1), v = { class: "your-file" }, L = ["src"];
27
- function H(e, o, t, i, a, r) {
28
- return s(), c(u, null, [
29
- h,
30
- n("div", f, [
31
- y,
32
- n("input", {
33
- onChange: o[0] || (o[0] = (...d) => r.fileUpload && r.fileUpload(...d)),
26
+ }, C = /* @__PURE__ */ r("h1", null, "File Uploader", -1), F = { class: "image-uploader" }, M = /* @__PURE__ */ r("h1", null, "File Uploader", -1), I = { class: "your-file" }, V = ["src"];
27
+ function A(t, n, e, d, a, i) {
28
+ return s(), o(k, null, [
29
+ C,
30
+ r("div", F, [
31
+ M,
32
+ r("input", {
33
+ onChange: n[0] || (n[0] = (...u) => i.fileUpload && i.fileUpload(...u)),
34
34
  type: "file",
35
35
  id: "file-upload",
36
36
  name: "fileUpload",
37
37
  accept: "image/*"
38
38
  }, null, 32),
39
- n("div", v, [
40
- n("img", {
39
+ r("div", I, [
40
+ r("img", {
41
41
  src: a.imgSRC,
42
42
  alt: "",
43
43
  scrset: ""
44
- }, null, 8, L)
44
+ }, null, 8, V)
45
45
  ])
46
46
  ])
47
47
  ], 64);
48
48
  }
49
- const U = /* @__PURE__ */ _(g, [["render", H]]);
50
- const $ = {
49
+ const K = /* @__PURE__ */ g(S, [["render", A]]);
50
+ const B = {
51
51
  props: ["title"],
52
52
  data() {
53
53
  return {};
54
54
  },
55
55
  computed: {}
56
56
  };
57
- function k(e, o, t, i, a, r) {
58
- return s(), c("header", null, [
59
- n("h1", null, p(t.title), 1)
57
+ function P(t, n, e, d, a, i) {
58
+ return s(), o("header", null, [
59
+ r("h1", null, p(e.title), 1)
60
60
  ]);
61
61
  }
62
- const x = /* @__PURE__ */ _($, [["render", k]]);
63
- const b = {
62
+ const U = /* @__PURE__ */ g(B, [["render", P]]);
63
+ const W = {
64
64
  props: ["content"],
65
65
  data() {
66
66
  return {};
@@ -71,8 +71,8 @@ const b = {
71
71
  }
72
72
  },
73
73
  methods: {
74
- pixelFormat(e) {
75
- return typeof e == "number" ? e + "px" : e;
74
+ pixelFormat(t) {
75
+ return typeof t == "number" ? t + "px" : t;
76
76
  },
77
77
  checkStepper() {
78
78
  this.$store.dispatch("lastPageFocus", {});
@@ -81,38 +81,384 @@ const b = {
81
81
  mounted() {
82
82
  this.checkStepper();
83
83
  }
84
- }, S = { class: "image-container" }, C = { class: "image" }, M = ["src", "alt"], P = ["innerHTML"], T = ["innerHTML"], F = ["innerHTML"];
85
- function R(e, o, t, i, a, r) {
86
- return s(), c("div", S, [
87
- n("div", C, [
88
- n("img", {
89
- src: t.content.src,
90
- alt: t.content.alt,
91
- class: m(t.content.class)
92
- }, null, 10, M),
93
- t.content.captionHeader ? (s(), c("span", {
84
+ }, E = { class: "image-container" }, z = { class: "image" }, D = ["src", "alt"], N = ["innerHTML"], R = ["innerHTML"], O = ["innerHTML"];
85
+ function $(t, n, e, d, a, i) {
86
+ return s(), o("div", E, [
87
+ r("div", z, [
88
+ r("img", {
89
+ src: e.content.src,
90
+ alt: e.content.alt,
91
+ class: _(e.content.class)
92
+ }, null, 10, D),
93
+ e.content.captionHeader ? (s(), o("span", {
94
94
  key: 0,
95
95
  class: "captionHeader",
96
- innerHTML: t.content.captionHeader
97
- }, null, 8, P)) : l("", !0),
98
- t.content.caption ? (s(), c("span", {
96
+ innerHTML: e.content.captionHeader
97
+ }, null, 8, N)) : l("", !0),
98
+ e.content.caption ? (s(), o("span", {
99
99
  key: 1,
100
100
  class: "caption",
101
- innerHTML: t.content.caption
102
- }, null, 8, T)) : l("", !0),
103
- t.content.copyright ? (s(), c("span", {
101
+ innerHTML: e.content.caption
102
+ }, null, 8, R)) : l("", !0),
103
+ e.content.copyright ? (s(), o("span", {
104
104
  key: 2,
105
- innerHTML: t.content.copyright,
105
+ innerHTML: e.content.copyright,
106
106
  class: "copyright"
107
- }, null, 8, F)) : l("", !0)
107
+ }, null, 8, O)) : l("", !0)
108
108
  ])
109
109
  ]);
110
110
  }
111
- const I = /* @__PURE__ */ _(b, [["render", R], ["__scopeId", "data-v-6d545532"]]), E = {
112
- install: (e, o) => {
113
- e.component("special-uploader", U), e.component("lab-header", x), e.component("lab-image", I);
111
+ const j = /* @__PURE__ */ g(W, [["render", $], ["__scopeId", "data-v-6d545532"]]);
112
+ const Y = {
113
+ props: ["content"],
114
+ //moduleLessonPage
115
+ data() {
116
+ return {
117
+ showingKaltura: !1,
118
+ showingText: !1,
119
+ buttonText: !1,
120
+ hasText: !1,
121
+ video: { width: 640, height: 480 },
122
+ audio: { width: 260, height: 80 },
123
+ audioBtn: { width: 40, height: 40 },
124
+ textversionArray: {}
125
+ };
126
+ },
127
+ watch: {
128
+ content: function() {
129
+ this.tvCleaner();
130
+ }
131
+ },
132
+ computed: {
133
+ kHeight() {
134
+ if (this.content.kalturaType === "video")
135
+ if (this.content.height && this.content.height != "") {
136
+ let t = this.content.height;
137
+ return t.slice(-2) === "px" ? t.slice(0, -2) : this.content.height;
138
+ } else
139
+ return this.video.height;
140
+ else if (this.content.kalturaType === "audio")
141
+ if (this.content.height && this.content.height != "") {
142
+ let t = this.content.height;
143
+ return t.slice(-2) === "px" ? t.slice(0, -2) : this.content.height;
144
+ } else
145
+ return this.audio.height;
146
+ else if (this.content.kalturaType === "audiobtn")
147
+ return this.audioBtn.height;
148
+ },
149
+ kWidth() {
150
+ if (this.content.kalturaType === "video")
151
+ if (this.content.width && this.content.width != "") {
152
+ let t = this.content.width;
153
+ return t.slice(-2) === "px" ? t.slice(0, -2) : this.content.width;
154
+ } else
155
+ return this.video.width;
156
+ else {
157
+ if (this.content.kalturaType === "audio")
158
+ return this.audio.width;
159
+ if (this.content.kalturaType === "audiobtn")
160
+ return this.audioBtn.width;
161
+ }
162
+ }
163
+ },
164
+ methods: {
165
+ getButtonText(t) {
166
+ return t === "video" ? this.showingText ? "Show Video" : "Show Text Version" : this.showingText ? "Show Audio" : "Show Text Version";
167
+ },
168
+ textVersionCheck() {
169
+ this.content.textVersion && this.content.textVersion.length > 1 && (this.hasText = !0);
170
+ },
171
+ kalturaLoad() {
172
+ this.textVersionCheck();
173
+ },
174
+ kalturaMedia(t) {
175
+ let n = {
176
+ uiconf_id: "35766781",
177
+ partner_id: "2061901",
178
+ entry_id: "",
179
+ height: "400",
180
+ width: "640",
181
+ type: "video"
182
+ };
183
+ return n.entry_id = this.content.kalturaEntryId, this.content.kalturaType && (n.type = this.content.kalturaType), n.type === "audio" ? n.uiconf_id = "36511471" : n.type === "audiobtn" ? n.uiconf_id = "36582731" : n.type === "videocc" && (n.uiconf_id = "35766781"), this.content.standalone && this.$store.commit("setStepHold", !1), "https://cdnapisec.kaltura.com/p/" + n.partner_id + "/sp/" + n.partner_id + "00/embedIframeJs/uiconf_id/" + n.uiconf_id + "/partner_id/" + n.partner_id + "?iframeembed=true&playerId=Kaltura&entry_id=" + n.entry_id;
184
+ },
185
+ showKaltura() {
186
+ this.showingKaltura = !0;
187
+ },
188
+ showText() {
189
+ this.showingText = !this.showingText, this.buttonText = !this.buttonText;
190
+ },
191
+ tvCleaner() {
192
+ let t = document.createElement("div");
193
+ t.innerHTML = this.content.textVersion;
194
+ for (let n = 0; n < t.children.length; n++) {
195
+ let e = t.children[n];
196
+ if (e.tagName == "DIV" && e.className == "panel-default" && e.children[0].dataset.toggle)
197
+ for (let d = 0; d < e.children.length; d++) {
198
+ let a = e.children[d];
199
+ if (a.dataset.toggle == "collapse") {
200
+ let i = {
201
+ heading: a.innerHTML,
202
+ body: e.children[d + 1].innerHTML
203
+ };
204
+ this.textversionArray[n] = i;
205
+ }
206
+ }
207
+ else
208
+ this.textversionArray[n] = e.outerHTML;
209
+ }
210
+ }
211
+ },
212
+ beforeMount() {
213
+ this.kalturaLoad(), this.tvCleaner();
214
+ },
215
+ mounted() {
216
+ }
217
+ }, G = {
218
+ key: 0,
219
+ class: "textVersion"
220
+ }, J = /* @__PURE__ */ r("h1", null, "Text Version", -1), X = ["innerHTML"], q = ["src", "width", "height"], Q = ["src", "width", "height"], Z = ["src", "width", "height"], ee = {
221
+ key: 2,
222
+ class: "alert alert-danger"
223
+ };
224
+ function te(t, n, e, d, a, i) {
225
+ const u = b("el-button");
226
+ return s(), o("div", {
227
+ class: _(["kContainer", e.content.class])
228
+ }, [
229
+ e.content.textVersion && a.showingText ? (s(), o("div", G, [
230
+ J,
231
+ r("div", {
232
+ innerHTML: e.content.textVersion
233
+ }, null, 8, X)
234
+ ])) : l("", !0),
235
+ !a.showingText && e.content.kalturaEntryId ? (s(), o("div", {
236
+ key: 1,
237
+ class: "mainVersion",
238
+ style: y({ width: i.kWidth + "px", height: i.kHeight + "px" })
239
+ }, [
240
+ e.content.kalturaType == "video" && !a.showingKaltura ? (s(), o("div", {
241
+ key: 0,
242
+ class: _(["kPoster", { active: a.showingKaltura == !0 }]),
243
+ style: y({ width: i.kWidth + "px", height: i.kHeight + "px" })
244
+ }, [
245
+ r("iframe", {
246
+ onClick: n[0] || (n[0] = (...h) => i.showKaltura && i.showKaltura(...h)),
247
+ class: "videoIframe",
248
+ src: i.kalturaMedia(e.content),
249
+ width: i.kWidth + "px",
250
+ height: i.kHeight + "px",
251
+ allowfullscreen: "",
252
+ webkitallowfullscreen: "",
253
+ mozAllowFullScreen: "",
254
+ frameborder: "0"
255
+ }, null, 8, q)
256
+ ], 6)) : l("", !0),
257
+ e.content.kalturaType == "audio" ? (s(), o("div", {
258
+ key: 1,
259
+ class: _(["kAudio", { active: a.showingKaltura == !0 }]),
260
+ onClick: n[1] || (n[1] = (...h) => i.showKaltura && i.showKaltura(...h))
261
+ }, [
262
+ r("iframe", {
263
+ id: "my_iframe",
264
+ src: i.kalturaMedia(e.content),
265
+ width: i.kWidth + "px",
266
+ height: i.kHeight + "px",
267
+ allowfullscreen: "",
268
+ webkitallowfullscreen: "",
269
+ mozAllowFullScreen: "",
270
+ frameborder: "0"
271
+ }, null, 8, Q)
272
+ ], 2)) : l("", !0),
273
+ e.content.kalturaType == "audiobtn" ? (s(), o("div", {
274
+ key: 2,
275
+ class: _(["kAudiobtn", { active: a.showingKaltura == !0 }]),
276
+ onClick: n[2] || (n[2] = (...h) => i.showKaltura && i.showKaltura(...h))
277
+ }, [
278
+ r("iframe", {
279
+ src: i.kalturaMedia(e.content),
280
+ width: a.audioBtn.width + "px",
281
+ height: a.audioBtn.height + "px",
282
+ allowfullscreen: "",
283
+ webkitallowfullscreen: "",
284
+ mozAllowFullScreen: "",
285
+ frameborder: "0"
286
+ }, null, 8, Z)
287
+ ], 2)) : l("", !0)
288
+ ], 4)) : l("", !0),
289
+ e.content.kalturaEntryId == "" ? (s(), o("div", ee, "There is no Kaltura Entry ID")) : l("", !0),
290
+ e.content.textVersion ? (s(), w(u, {
291
+ key: 3,
292
+ size: "medium",
293
+ type: "primary",
294
+ "aria-label": "text version",
295
+ class: "toggleSwitch ftSwitch btn btn-primary vidText",
296
+ onClick: n[3] || (n[3] = x((h) => i.showText(e.content.kalturaType), ["stop"]))
297
+ }, {
298
+ default: f(() => [
299
+ T(p(i.getButtonText(e.content.kalturaType)), 1)
300
+ ]),
301
+ _: 1
302
+ })) : l("", !0)
303
+ ], 2);
304
+ }
305
+ const ne = /* @__PURE__ */ g(Y, [["render", te]]);
306
+ const ie = {
307
+ props: ["content"],
308
+ data() {
309
+ return {
310
+ show: !0
311
+ };
312
+ },
313
+ computed: {
314
+ getShowFeedbackAttempts() {
315
+ return this.$store.getters.getShowFeedbackAttempts;
316
+ },
317
+ feedbackHeader() {
318
+ return this.$store.getters.getShowFeedbackAttempts ? "Too many Attempts" : this.content.feedbackHeader;
319
+ },
320
+ feedbackWidth() {
321
+ return this.content.feedbackWidth ? this.content.feedbackWidth : "50%";
322
+ }
323
+ },
324
+ methods: {
325
+ feedbackClose() {
326
+ this.content.finalInstructions && this.$store.commit("updateFinishDirections", !1), this.content.instructions && this.$store.commit("updateDirections", !1), this.$store.commit("setShowFeedback", !1), this.$store.commit("setShowFeedbackAttempts", !1), this.$store.dispatch("lastPageFocus", {});
327
+ }
328
+ },
329
+ mounted() {
330
+ }
331
+ }, se = { class: "my-header" }, oe = ["id", "innerHTML"], ae = ["innerHTML"], re = { key: 1 }, ce = ["src"], le = ["innerHTML"], de = { class: "dialog-footer" };
332
+ function he(t, n, e, d, a, i) {
333
+ const u = b("el-button"), h = b("el-dialog");
334
+ return s(), w(h, {
335
+ width: i.feedbackWidth,
336
+ modelValue: a.show,
337
+ "onUpdate:modelValue": n[1] || (n[1] = (c) => a.show = c),
338
+ "before-close": i.feedbackClose
339
+ }, {
340
+ header: f(({ close: c, titleId: m, titleClass: v }) => [
341
+ r("div", se, [
342
+ r("h4", {
343
+ id: m,
344
+ class: _(v),
345
+ innerHTML: i.feedbackHeader
346
+ }, null, 10, oe)
347
+ ])
348
+ ]),
349
+ footer: f(() => [
350
+ r("span", de, [
351
+ H(u, {
352
+ size: "small",
353
+ id: "feedbackClose",
354
+ type: "primary",
355
+ onClick: n[0] || (n[0] = x((c) => i.feedbackClose(), ["stop"]))
356
+ }, {
357
+ default: f(() => [
358
+ T("Close")
359
+ ]),
360
+ _: 1
361
+ })
362
+ ])
363
+ ]),
364
+ default: f(() => [
365
+ i.getShowFeedbackAttempts ? (s(), o(k, { key: 0 }, [
366
+ e.content.feedbackAttempts ? (s(), o("p", {
367
+ key: 0,
368
+ innerHTML: e.content.feedbackAttempts
369
+ }, null, 8, ae)) : (s(), o("p", re, "You have tried too many times, the correct answer has been provided for you."))
370
+ ], 64)) : (s(), o(k, { key: 1 }, [
371
+ e.content.feedbackImage ? (s(), o("img", {
372
+ key: 0,
373
+ class: "im-ButtonImage",
374
+ src: e.content.feedbackImage,
375
+ alt: "button image"
376
+ }, null, 8, ce)) : l("", !0),
377
+ r("p", {
378
+ innerHTML: e.content.feedback
379
+ }, null, 8, le)
380
+ ], 64))
381
+ ]),
382
+ _: 1
383
+ }, 8, ["width", "modelValue", "before-close"]);
384
+ }
385
+ const ue = /* @__PURE__ */ g(ie, [["render", he]]);
386
+ const _e = {
387
+ components: {
388
+ Feedback: ue
389
+ },
390
+ inject: ["message"],
391
+ props: ["content"],
392
+ data() {
393
+ return {
394
+ dialogVisible: !1,
395
+ feedbackVisibility: [],
396
+ feedbackIndex: 0
397
+ };
398
+ },
399
+ computed: {
400
+ getLastPage() {
401
+ return !!this.$store.getters.getLastPage;
402
+ }
403
+ },
404
+ methods: {
405
+ pixelFormat(t) {
406
+ return typeof t == "number" ? t + "px" : t;
407
+ },
408
+ changePage(t, n) {
409
+ t.pageLink ? this.$store.commit("setCurrentPage", t.pageLink) : t.feedback && (this.feedbackIndex = n, this.feedbackVisibility.indexOf(n) === -1 && this.feedbackVisibility.push(n), this.$store.commit("setShowFeedback", !0), this.content.hotspots.length - 1 === this.feedbackVisibility.length - 1 && (this.$store.commit("setStepHold", !1), this.$store.commit("setStepDone", !0)), setTimeout(() => {
410
+ document.getElementById("feedbackClose") && document.getElementById("feedbackClose").focus();
411
+ }));
412
+ },
413
+ showFeedback(t) {
414
+ return !!(this.$store.getters.getShowFeedback && this.feedbackIndex === t);
415
+ }
416
+ },
417
+ beforeMount() {
418
+ this.$store.commit("setStepDone", !1), this.$store.commit("setStepHold", !0);
419
+ }
420
+ }, me = { class: "imageMarker" }, fe = ["src", "alt"], ge = { class: "hotspotArea" }, ke = ["src", "alt"], be = { class: "im-buttonText" };
421
+ function ye(t, n, e, d, a, i) {
422
+ const u = b("el-button"), h = b("Feedback");
423
+ return s(), o("div", me, [
424
+ r("img", {
425
+ src: e.content.image,
426
+ alt: e.content.imageAlt
427
+ }, null, 8, fe),
428
+ r("div", ge, [
429
+ (s(!0), o(k, null, L(e.content.hotspots, (c, m) => (s(), o(k, null, [
430
+ H(u, {
431
+ type: c.buttonType,
432
+ onClick: x((v) => i.changePage(c, m), ["stop"]),
433
+ id: "hotspot_" + m,
434
+ class: _([["is-" + c.buttonShape, { noBG: c.buttonImage }, c.class], "hotspot"]),
435
+ style: y({ top: i.pixelFormat(c.cordinatesX), left: i.pixelFormat(c.cordinatesY), width: i.pixelFormat(c.dimensionsW), height: i.pixelFormat(c.dimensionsH) }),
436
+ icon: c.buttonIcon
437
+ }, {
438
+ default: f(() => [
439
+ c.buttonImage ? (s(), o("img", {
440
+ key: 0,
441
+ class: "im-ButtonImage",
442
+ src: c.buttonImage,
443
+ alt: "image marker " + Number(m + 1)
444
+ }, null, 8, ke)) : l("", !0),
445
+ r("span", be, p(c.name), 1)
446
+ ]),
447
+ _: 2
448
+ }, 1032, ["type", "onClick", "id", "class", "style", "icon"]),
449
+ i.showFeedback(m) ? (s(), w(h, {
450
+ key: 0,
451
+ content: c
452
+ }, null, 8, ["content"])) : l("", !0)
453
+ ], 64))), 256))
454
+ ])
455
+ ]);
456
+ }
457
+ const pe = /* @__PURE__ */ g(_e, [["render", ye], ["__scopeId", "data-v-3897bfb2"]]), xe = {
458
+ install: (t, n) => {
459
+ t.component("special-uploader", K), t.component("lab-header", U), t.component("lab-image", j), t.component("lab-kaltura", ne), t.component("lab-image-marker", pe);
114
460
  }
115
461
  };
116
462
  export {
117
- E as default
463
+ xe as default
118
464
  };
@@ -1 +1 @@
1
- (function(e,a){typeof exports=="object"&&typeof module<"u"?module.exports=a(require("vue")):typeof define=="function"&&define.amd?define(["vue"],a):(e=typeof globalThis<"u"?globalThis:e||self,e.LabmakerPlugin=a(e.Vue))})(this,function(e){"use strict";const a="",r=(t,o)=>{const n=t.__vccOpts||t;for(const[s,c]of o)n[s]=c;return n},i={props:["custom-img"],data(){return{imgSRC:this.customImg}},computed:{},methods:{fileUpload(t){const n=t.target.files[0];this.fileProcess(n)},fileProcess(t){this.imgSRC=URL.createObjectURL(t)}},mounted(){}},d=e.createElementVNode("h1",null,"File Uploader",-1),_={class:"image-uploader"},m=e.createElementVNode("h1",null,"File Uploader",-1),p={class:"your-file"},u=["src"];function f(t,o,n,s,c,l){return e.openBlock(),e.createElementBlock(e.Fragment,null,[d,e.createElementVNode("div",_,[m,e.createElementVNode("input",{onChange:o[0]||(o[0]=(...x)=>l.fileUpload&&l.fileUpload(...x)),type:"file",id:"file-upload",name:"fileUpload",accept:"image/*"},null,32),e.createElementVNode("div",p,[e.createElementVNode("img",{src:c.imgSRC,alt:"",scrset:""},null,8,u)])])],64)}const h=r(i,[["render",f]]),C="",g={props:["title"],data(){return{}},computed:{}};function k(t,o,n,s,c,l){return e.openBlock(),e.createElementBlock("header",null,[e.createElementVNode("h1",null,e.toDisplayString(n.title),1)])}const y=r(g,[["render",k]]),P="",E={props:["content"],data(){return{}},computed:{getLastPage(){return!!this.$store.getters.getLastPage}},methods:{pixelFormat(t){return typeof t=="number"?t+"px":t},checkStepper(){this.$store.dispatch("lastPageFocus",{})}},mounted(){this.checkStepper()}},L={class:"image-container"},V={class:"image"},B=["src","alt"],N=["innerHTML"],H=["innerHTML"],U=["innerHTML"];function $(t,o,n,s,c,l){return e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("div",V,[e.createElementVNode("img",{src:n.content.src,alt:n.content.alt,class:e.normalizeClass(n.content.class)},null,10,B),n.content.captionHeader?(e.openBlock(),e.createElementBlock("span",{key:0,class:"captionHeader",innerHTML:n.content.captionHeader},null,8,N)):e.createCommentVNode("",!0),n.content.caption?(e.openBlock(),e.createElementBlock("span",{key:1,class:"caption",innerHTML:n.content.caption},null,8,H)):e.createCommentVNode("",!0),n.content.copyright?(e.openBlock(),e.createElementBlock("span",{key:2,innerHTML:n.content.copyright,class:"copyright"},null,8,U)):e.createCommentVNode("",!0)])])}const b=r(E,[["render",$],["__scopeId","data-v-6d545532"]]);return{install:(t,o)=>{t.component("special-uploader",h),t.component("lab-header",y),t.component("lab-image",b)}}});
1
+ (function(e,m){typeof exports=="object"&&typeof module<"u"?module.exports=m(require("vue")):typeof define=="function"&&define.amd?define(["vue"],m):(e=typeof globalThis<"u"?globalThis:e||self,e.LabmakerPlugin=m(e.Vue))})(this,function(e){"use strict";const m="",d=(n,o)=>{const t=n.__vccOpts||n;for(const[l,a]of o)t[l]=a;return t},k={props:["custom-img"],data(){return{imgSRC:this.customImg}},computed:{},methods:{fileUpload(n){const t=n.target.files[0];this.fileProcess(t)},fileProcess(n){this.imgSRC=URL.createObjectURL(n)}},mounted(){}},_=e.createElementVNode("h1",null,"File Uploader",-1),u={class:"image-uploader"},g=e.createElementVNode("h1",null,"File Uploader",-1),p={class:"your-file"},b=["src"];function y(n,o,t,l,a,i){return e.openBlock(),e.createElementBlock(e.Fragment,null,[_,e.createElementVNode("div",u,[g,e.createElementVNode("input",{onChange:o[0]||(o[0]=(...s)=>i.fileUpload&&i.fileUpload(...s)),type:"file",id:"file-upload",name:"fileUpload",accept:"image/*"},null,32),e.createElementVNode("div",p,[e.createElementVNode("img",{src:a.imgSRC,alt:"",scrset:""},null,8,b)])])],64)}const w=d(k,[["render",y]]),ce="",x={props:["title"],data(){return{}},computed:{}};function B(n,o,t,l,a,i){return e.openBlock(),e.createElementBlock("header",null,[e.createElementVNode("h1",null,e.toDisplayString(t.title),1)])}const V=d(x,[["render",B]]),se="",T={props:["content"],data(){return{}},computed:{getLastPage(){return!!this.$store.getters.getLastPage}},methods:{pixelFormat(n){return typeof n=="number"?n+"px":n},checkStepper(){this.$store.dispatch("lastPageFocus",{})}},mounted(){this.checkStepper()}},C={class:"image-container"},E={class:"image"},N=["src","alt"],S=["innerHTML"],H=["innerHTML"],L=["innerHTML"];function F(n,o,t,l,a,i){return e.openBlock(),e.createElementBlock("div",C,[e.createElementVNode("div",E,[e.createElementVNode("img",{src:t.content.src,alt:t.content.alt,class:e.normalizeClass(t.content.class)},null,10,N),t.content.captionHeader?(e.openBlock(),e.createElementBlock("span",{key:0,class:"captionHeader",innerHTML:t.content.captionHeader},null,8,S)):e.createCommentVNode("",!0),t.content.caption?(e.openBlock(),e.createElementBlock("span",{key:1,class:"caption",innerHTML:t.content.caption},null,8,H)):e.createCommentVNode("",!0),t.content.copyright?(e.openBlock(),e.createElementBlock("span",{key:2,innerHTML:t.content.copyright,class:"copyright"},null,8,L)):e.createCommentVNode("",!0)])])}const M=d(T,[["render",F],["__scopeId","data-v-6d545532"]]),de="",I={props:["content"],data(){return{showingKaltura:!1,showingText:!1,buttonText:!1,hasText:!1,video:{width:640,height:480},audio:{width:260,height:80},audioBtn:{width:40,height:40},textversionArray:{}}},watch:{content:function(){this.tvCleaner()}},computed:{kHeight(){if(this.content.kalturaType==="video")if(this.content.height&&this.content.height!=""){let n=this.content.height;return n.slice(-2)==="px"?n.slice(0,-2):this.content.height}else return this.video.height;else if(this.content.kalturaType==="audio")if(this.content.height&&this.content.height!=""){let n=this.content.height;return n.slice(-2)==="px"?n.slice(0,-2):this.content.height}else return this.audio.height;else if(this.content.kalturaType==="audiobtn")return this.audioBtn.height},kWidth(){if(this.content.kalturaType==="video")if(this.content.width&&this.content.width!=""){let n=this.content.width;return n.slice(-2)==="px"?n.slice(0,-2):this.content.width}else return this.video.width;else{if(this.content.kalturaType==="audio")return this.audio.width;if(this.content.kalturaType==="audiobtn")return this.audioBtn.width}}},methods:{getButtonText(n){return n==="video"?this.showingText?"Show Video":"Show Text Version":this.showingText?"Show Audio":"Show Text Version"},textVersionCheck(){this.content.textVersion&&this.content.textVersion.length>1&&(this.hasText=!0)},kalturaLoad(){this.textVersionCheck()},kalturaMedia(n){let o={uiconf_id:"35766781",partner_id:"2061901",entry_id:"",height:"400",width:"640",type:"video"};return o.entry_id=this.content.kalturaEntryId,this.content.kalturaType&&(o.type=this.content.kalturaType),o.type==="audio"?o.uiconf_id="36511471":o.type==="audiobtn"?o.uiconf_id="36582731":o.type==="videocc"&&(o.uiconf_id="35766781"),this.content.standalone&&this.$store.commit("setStepHold",!1),"https://cdnapisec.kaltura.com/p/"+o.partner_id+"/sp/"+o.partner_id+"00/embedIframeJs/uiconf_id/"+o.uiconf_id+"/partner_id/"+o.partner_id+"?iframeembed=true&playerId=Kaltura&entry_id="+o.entry_id},showKaltura(){this.showingKaltura=!0},showText(){this.showingText=!this.showingText,this.buttonText=!this.buttonText},tvCleaner(){let n=document.createElement("div");n.innerHTML=this.content.textVersion;for(let o=0;o<n.children.length;o++){let t=n.children[o];if(t.tagName=="DIV"&&t.className=="panel-default"&&t.children[0].dataset.toggle)for(let l=0;l<t.children.length;l++){let a=t.children[l];if(a.dataset.toggle=="collapse"){let i={heading:a.innerHTML,body:t.children[l+1].innerHTML};this.textversionArray[o]=i}}else this.textversionArray[o]=t.outerHTML}}},beforeMount(){this.kalturaLoad(),this.tvCleaner()},mounted(){}},A={key:0,class:"textVersion"},K=e.createElementVNode("h1",null,"Text Version",-1),z=["innerHTML"],P=["src","width","height"],U=["src","width","height"],W=["src","width","height"],D={key:2,class:"alert alert-danger"};function R(n,o,t,l,a,i){const s=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["kContainer",t.content.class])},[t.content.textVersion&&a.showingText?(e.openBlock(),e.createElementBlock("div",A,[K,e.createElementVNode("div",{innerHTML:t.content.textVersion},null,8,z)])):e.createCommentVNode("",!0),!a.showingText&&t.content.kalturaEntryId?(e.openBlock(),e.createElementBlock("div",{key:1,class:"mainVersion",style:e.normalizeStyle({width:i.kWidth+"px",height:i.kHeight+"px"})},[t.content.kalturaType=="video"&&!a.showingKaltura?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["kPoster",{active:a.showingKaltura==!0}]),style:e.normalizeStyle({width:i.kWidth+"px",height:i.kHeight+"px"})},[e.createElementVNode("iframe",{onClick:o[0]||(o[0]=(...c)=>i.showKaltura&&i.showKaltura(...c)),class:"videoIframe",src:i.kalturaMedia(t.content),width:i.kWidth+"px",height:i.kHeight+"px",allowfullscreen:"",webkitallowfullscreen:"",mozAllowFullScreen:"",frameborder:"0"},null,8,P)],6)):e.createCommentVNode("",!0),t.content.kalturaType=="audio"?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["kAudio",{active:a.showingKaltura==!0}]),onClick:o[1]||(o[1]=(...c)=>i.showKaltura&&i.showKaltura(...c))},[e.createElementVNode("iframe",{id:"my_iframe",src:i.kalturaMedia(t.content),width:i.kWidth+"px",height:i.kHeight+"px",allowfullscreen:"",webkitallowfullscreen:"",mozAllowFullScreen:"",frameborder:"0"},null,8,U)],2)):e.createCommentVNode("",!0),t.content.kalturaType=="audiobtn"?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["kAudiobtn",{active:a.showingKaltura==!0}]),onClick:o[2]||(o[2]=(...c)=>i.showKaltura&&i.showKaltura(...c))},[e.createElementVNode("iframe",{src:i.kalturaMedia(t.content),width:a.audioBtn.width+"px",height:a.audioBtn.height+"px",allowfullscreen:"",webkitallowfullscreen:"",mozAllowFullScreen:"",frameborder:"0"},null,8,W)],2)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),t.content.kalturaEntryId==""?(e.openBlock(),e.createElementBlock("div",D,"There is no Kaltura Entry ID")):e.createCommentVNode("",!0),t.content.textVersion?(e.openBlock(),e.createBlock(s,{key:3,size:"medium",type:"primary","aria-label":"text version",class:"toggleSwitch ftSwitch btn btn-primary vidText",onClick:o[3]||(o[3]=e.withModifiers(c=>i.showText(t.content.kalturaType),["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.getButtonText(t.content.kalturaType)),1)]),_:1})):e.createCommentVNode("",!0)],2)}const j=d(I,[["render",R]]),he="",O={props:["content"],data(){return{show:!0}},computed:{getShowFeedbackAttempts(){return this.$store.getters.getShowFeedbackAttempts},feedbackHeader(){return this.$store.getters.getShowFeedbackAttempts?"Too many Attempts":this.content.feedbackHeader},feedbackWidth(){return this.content.feedbackWidth?this.content.feedbackWidth:"50%"}},methods:{feedbackClose(){this.content.finalInstructions&&this.$store.commit("updateFinishDirections",!1),this.content.instructions&&this.$store.commit("updateDirections",!1),this.$store.commit("setShowFeedback",!1),this.$store.commit("setShowFeedbackAttempts",!1),this.$store.dispatch("lastPageFocus",{})}},mounted(){}},$={class:"my-header"},Y=["id","innerHTML"],q=["innerHTML"],G={key:1},J=["src"],X=["innerHTML"],Q={class:"dialog-footer"};function Z(n,o,t,l,a,i){const s=e.resolveComponent("el-button"),c=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(c,{width:i.feedbackWidth,modelValue:a.show,"onUpdate:modelValue":o[1]||(o[1]=r=>a.show=r),"before-close":i.feedbackClose},{header:e.withCtx(({close:r,titleId:h,titleClass:f})=>[e.createElementVNode("div",$,[e.createElementVNode("h4",{id:h,class:e.normalizeClass(f),innerHTML:i.feedbackHeader},null,10,Y)])]),footer:e.withCtx(()=>[e.createElementVNode("span",Q,[e.createVNode(s,{size:"small",id:"feedbackClose",type:"primary",onClick:o[0]||(o[0]=e.withModifiers(r=>i.feedbackClose(),["stop"]))},{default:e.withCtx(()=>[e.createTextVNode("Close")]),_:1})])]),default:e.withCtx(()=>[i.getShowFeedbackAttempts?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.content.feedbackAttempts?(e.openBlock(),e.createElementBlock("p",{key:0,innerHTML:t.content.feedbackAttempts},null,8,q)):(e.openBlock(),e.createElementBlock("p",G,"You have tried too many times, the correct answer has been provided for you."))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.content.feedbackImage?(e.openBlock(),e.createElementBlock("img",{key:0,class:"im-ButtonImage",src:t.content.feedbackImage,alt:"button image"},null,8,J)):e.createCommentVNode("",!0),e.createElementVNode("p",{innerHTML:t.content.feedback},null,8,X)],64))]),_:1},8,["width","modelValue","before-close"])}const v=d(O,[["render",Z]]),me="",ee={components:{Feedback:v},inject:["message"],props:["content"],data(){return{dialogVisible:!1,feedbackVisibility:[],feedbackIndex:0}},computed:{getLastPage(){return!!this.$store.getters.getLastPage}},methods:{pixelFormat(n){return typeof n=="number"?n+"px":n},changePage(n,o){n.pageLink?this.$store.commit("setCurrentPage",n.pageLink):n.feedback&&(this.feedbackIndex=o,this.feedbackVisibility.indexOf(o)===-1&&this.feedbackVisibility.push(o),this.$store.commit("setShowFeedback",!0),this.content.hotspots.length-1===this.feedbackVisibility.length-1&&(this.$store.commit("setStepHold",!1),this.$store.commit("setStepDone",!0)),setTimeout(()=>{document.getElementById("feedbackClose")&&document.getElementById("feedbackClose").focus()}))},showFeedback(n){return!!(this.$store.getters.getShowFeedback&&this.feedbackIndex===n)}},beforeMount(){this.$store.commit("setStepDone",!1),this.$store.commit("setStepHold",!0)}},te={class:"imageMarker"},ne=["src","alt"],oe={class:"hotspotArea"},ie=["src","alt"],ae={class:"im-buttonText"};function re(n,o,t,l,a,i){const s=e.resolveComponent("el-button"),c=e.resolveComponent("Feedback");return e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("img",{src:t.content.image,alt:t.content.imageAlt},null,8,ne),e.createElementVNode("div",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.content.hotspots,(r,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(s,{type:r.buttonType,onClick:e.withModifiers(f=>i.changePage(r,h),["stop"]),id:"hotspot_"+h,class:e.normalizeClass([["is-"+r.buttonShape,{noBG:r.buttonImage},r.class],"hotspot"]),style:e.normalizeStyle({top:i.pixelFormat(r.cordinatesX),left:i.pixelFormat(r.cordinatesY),width:i.pixelFormat(r.dimensionsW),height:i.pixelFormat(r.dimensionsH)}),icon:r.buttonIcon},{default:e.withCtx(()=>[r.buttonImage?(e.openBlock(),e.createElementBlock("img",{key:0,class:"im-ButtonImage",src:r.buttonImage,alt:"image marker "+Number(h+1)},null,8,ie)):e.createCommentVNode("",!0),e.createElementVNode("span",ae,e.toDisplayString(r.name),1)]),_:2},1032,["type","onClick","id","class","style","icon"]),i.showFeedback(h)?(e.openBlock(),e.createBlock(c,{key:0,content:r},null,8,["content"])):e.createCommentVNode("",!0)],64))),256))])])}const le=d(ee,[["render",re],["__scopeId","data-v-3897bfb2"]]);return{install:(n,o)=>{n.component("special-uploader",w),n.component("lab-header",V),n.component("lab-image",M),n.component("lab-kaltura",j),n.component("lab-image-marker",le)}}});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .image-uploader{display:flex;flex-direction:column;align-items:center;border:1px solid gray;width:53%;background-color:#cecece;margin:0 auto;height:300px;box-shadow:#0000001a 0 4px 12px}.your-file{display:flex;justify-content:center;align-items:center;margin-top:20px}img{width:80%}header{display:flex;justify-content:center;align-items:center;height:40px;margin-top:10px;margin-bottom:10px}#app .image-container[data-v-6d545532]{position:relative;display:block;margin-bottom:10px;height:100%}#app .image-container .image[data-v-6d545532]{height:100%}#app .image-container .image img[data-v-6d545532]{max-height:100%;max-width:100%}#app .image-container.copyright[data-v-6d545532],#app .image-container.captions[data-v-6d545532]{margin-bottom:20px}#app .image-container.copyright[data-v-6d545532],#app .image-container.captions[data-v-6d545532]{margin-bottom:40px}#app .image-container .captionHeader[data-v-6d545532]{font-size:20px;text-align:center;display:block;margin-bottom:10px}#app .image-container .caption[data-v-6d545532]{font-size:13px;font-style:italic;text-align:center;display:block;margin-bottom:10px}#app .image-container .copyright[data-v-6d545532]{font-size:10px;line-height:10px;margin-top:10px;text-align:center;display:block;margin-bottom:10px}
1
+ .image-uploader{display:flex;flex-direction:column;align-items:center;border:1px solid gray;width:53%;background-color:#cecece;margin:0 auto;height:300px;box-shadow:#0000001a 0 4px 12px}.your-file{display:flex;justify-content:center;align-items:center;margin-top:20px}img{width:80%}header{display:flex;justify-content:center;align-items:center;height:40px;margin-top:10px;margin-bottom:10px}#app .image-container[data-v-6d545532]{position:relative;display:block;margin-bottom:10px;height:100%}#app .image-container .image[data-v-6d545532]{height:100%}#app .image-container .image img[data-v-6d545532]{max-height:100%;max-width:100%}#app .image-container.copyright[data-v-6d545532],#app .image-container.captions[data-v-6d545532]{margin-bottom:20px}#app .image-container.copyright[data-v-6d545532],#app .image-container.captions[data-v-6d545532]{margin-bottom:40px}#app .image-container .captionHeader[data-v-6d545532]{font-size:20px;text-align:center;display:block;margin-bottom:10px}#app .image-container .caption[data-v-6d545532]{font-size:13px;font-style:italic;text-align:center;display:block;margin-bottom:10px}#app .image-container .copyright[data-v-6d545532]{font-size:10px;line-height:10px;margin-top:10px;text-align:center;display:block;margin-bottom:10px}.kContainer{position:relative;height:90%}.kContainer iframe{margin:0}.kContainer .mainVersion{margin:auto;position:relative;display:block}.kContainer .mainVersion .kAudiobtn{width:30px;height:30px;position:relative;transition:opacity .4s ease;left:50%;transform:translate(-50%)}.kContainer .mainVersion .kAudiobtn .kButton.audiobtn{position:absolute;height:30px;width:30px;background:url(//cdn.flvs.net/course_view/1_0/dist/images/kaltura_audio_button.png) 0 0 no-repeat;z-index:900;cursor:pointer}.kContainer .mainVersion .kAudio{width:260px;height:38px;position:relative;transition:opacity .4s ease;left:50%;transform:translate(-50%)}.kContainer .mainVersion .kAudio .kButton.audio{position:absolute;height:40px;width:260px;background:url(//cdn.flvs.net/course_view/1_0/dist/images/kaltura_audio_standard.png) 0 0 no-repeat;z-index:900;cursor:pointer}.kContainer .mainVersion .audioIframe,.kContainer .mainVersion .audiobtnIframe{position:relative;transition:opacity .4s ease;left:50%;transform:translate(-50%)}.kContainer .mainVersion .kPoster{position:absolute;transition:opacity .4s ease;left:50%;transform:translate(-50%)}.kContainer .mainVersion .kPoster .active{display:none;visibility:hidden}.kContainer .mainVersion .kPoster .kButton{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:url(//cdn.flvs.net/course_view/1_0/dist/images/player_big_play_button.png) 0 0 no-repeat;z-index:900;width:70px;height:53px;cursor:pointer}.kContainer .mainVersion .kPoster img{position:absolute;top:0;left:0;z-index:899;height:100%;width:100%;border:1px solid #000;max-height:100%;max-width:100%}.kContainer .mainVersion .kPoster .videoIframe{z-index:897}.kContainer .mainVersion .videoIframe{position:absolute;transition:opacity .4s ease;left:50%;transform:translate(-50%);z-index:897}.kContainer button.toggleSwitch,.kContainer button.toggleSwitchFT{margin-top:0;min-width:180px;position:relative;left:50%;transform:translate(-50%)}.kContainer .kCopyright{font-size:10px;text-align:right;width:200px;position:absolute;bottom:-30px;right:0;padding:8px}.kContainer .kCopyright.kCopyrightAudio{bottom:4px}.kContainer .largePlayBtn{display:none}.kContainer .textVersion{overflow-y:auto;height:calc(100% - 10px);margin-bottom:6px}.fade-enter-active,.fade-leave-active{transition:opacity .8s}.fade-enter,.fade-leave-to{opacity:0}.el-dialog{border-radius:6px}.el-dialog .el-dialog__header .el-dialog__title{color:#000;font-size:1.5rem}.el-dialog .el-dialog__header .el-dialog__headerbtn{top:8px;right:8px;border:1px solid #404040;border-radius:4px;background:#feec86;color:#000;font-weight:400;box-shadow:2px 2px 6px #0000004d;transition:background .5s,color .5s}.el-dialog .el-dialog__header .el-dialog__headerbtn:hover,.el-dialog .el-dialog__header .el-dialog__headerbtn:focus,.el-dialog .el-dialog__header .el-dialog__headerbtn:active{color:#404040;background:#fff;border-color:#2a2a2a}.el-dialog .el-dialog__header .el-dialog__headerbtn .el-dialog__close{color:#000;font-size:18px}.el-dialog .el-dialog__body{color:#212529;font-size:1rem;word-break:normal}#app div.imageMarker[data-v-3897bfb2]{position:relative;height:100%;border-radius:6px}#app div.imageMarker img[data-v-3897bfb2]{width:100%;max-width:100%;max-height:100%;border-radius:6px}#app div.imageMarker .hotspotArea[data-v-3897bfb2]{width:100%;height:100%;position:absolute;top:0;left:0}#app div.imageMarker .hotspotArea .el-button.hotspot[data-v-3897bfb2]{position:absolute;min-height:unset;padding:4px 4px 4px 7px;margin:unset}#app div.imageMarker .hotspotArea .el-button.hotspot.noBG[data-v-3897bfb2]{background-color:transparent}#app div.imageMarker .hotspotArea .el-button.hotspot img.im-ButtonImage[data-v-3897bfb2]{position:absolute;top:0;left:0}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "labmaker-plugin",
3
- "version": "0.0.10-dev",
3
+ "version": "0.0.11",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -21,7 +21,8 @@
21
21
  "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
22
22
  },
23
23
  "dependencies": {
24
- "vue": "^3.3.2"
24
+ "vue": "^3.3.2",
25
+ "@element-plus/icons": "^0.0.11"
25
26
  },
26
27
  "devDependencies": {
27
28
  "@vitejs/plugin-vue": "^4.2.3",