@icvdeveloper/common-module 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/module.json +1 -1
  3. package/dist/runtime/@types/components.d.ts +77 -0
  4. package/dist/runtime/components/core/AttendeeList.vue +386 -0
  5. package/dist/runtime/components/core/SvgIcon.vue +12 -0
  6. package/dist/runtime/components/events/ListEvents.vue +15 -2
  7. package/dist/runtime/components/media/components/CeCreditNotification.vue +137 -87
  8. package/dist/runtime/components/media/components/DocumentsPanel.vue +104 -27
  9. package/dist/runtime/components/media/components/SponsorsPanel.vue +192 -68
  10. package/dist/runtime/composables/usePusher.d.ts +15 -0
  11. package/dist/runtime/composables/usePusher.mjs +52 -0
  12. package/dist/runtime/models/attendeeList.d.ts +10 -0
  13. package/dist/runtime/models/attendeeList.mjs +0 -0
  14. package/dist/runtime/models/conference.d.ts +15 -0
  15. package/dist/runtime/models/conversation.d.ts +18 -0
  16. package/dist/runtime/models/conversation.mjs +0 -0
  17. package/dist/runtime/models/icons.d.ts +2 -0
  18. package/dist/runtime/models/pagination.d.ts +14 -0
  19. package/dist/runtime/models/pagination.mjs +1 -0
  20. package/dist/runtime/models/user.d.ts +17 -0
  21. package/dist/runtime/models/user.mjs +0 -0
  22. package/dist/runtime/plugin.mjs +1 -1
  23. package/dist/runtime/store/attendeeList.d.ts +27 -0
  24. package/dist/runtime/store/attendeeList.mjs +74 -0
  25. package/dist/runtime/store/auth.d.ts +1 -0
  26. package/dist/runtime/store/auth.mjs +21 -4
  27. package/dist/runtime/store/conversations.d.ts +10 -0
  28. package/dist/runtime/store/conversations.mjs +26 -0
  29. package/dist/runtime/store/navigationConfig.d.ts +1 -1
  30. package/dist/runtime/store/user.d.ts +7 -0
  31. package/dist/runtime/store/user.mjs +23 -0
  32. package/package.json +6 -1
  33. package/dist/runtime/components/media/components/CeCreditNotification.vue.d.ts +0 -28
  34. package/dist/runtime/components/media/components/DocumentsPanel.vue.d.ts +0 -7
  35. package/dist/runtime/components/media/components/SponsorsPanel.vue.d.ts +0 -27
@@ -1,99 +1,149 @@
1
- <template>
2
- <transition name="slide-fade">
3
- <div v-if="visible" class="flex bg-yellow-lightest shadow text-grey-darker py-6 px-10">
4
- <div class="flex-1 text-center mx-auto">
5
- <p>
6
- Time Remaining <span :class="timeRemainingClass">{{ displayFor }} seconds </span>
7
- </p>
8
- <p v-text="promptText"></p>
9
- <p>
10
- <button class="btn btn-secondary" @click="acceptClick" v-text="buttonText"></button>
11
- </p>
12
- </div>
13
- </div>
14
- </transition>
15
- </template>
1
+ <script lang="ts" setup>
2
+ import Pusher from "pusher-js";
3
+ import Echo from "laravel-echo";
4
+ import { toRefs, computed } from "vue";
5
+ import { Conference } from "../../../models/conference";
6
+ import { CeCreditPanelClassObj } from "../../../@types/components";
7
+ import { useClassBinding } from "../../../composables/useClassBinding";
8
+
9
+ type Props = {
10
+ conferenceId: number;
11
+ classObject?: CeCreditPanelClassObj;
12
+ };
13
+
14
+ const props = withDefaults(defineProps<Props>(), {
15
+ classObject: () => {
16
+ return {
17
+ container: "",
18
+ htmlElement: "",
19
+ noOverviewElement: "",
20
+ };
21
+ },
22
+ });
23
+
24
+ const { conferenceId } = toRefs(props);
25
+
26
+ const { classBinding } = useClassBinding();
27
+
28
+ const pusher = ref<any>(null);
29
+ const channel = ref<any>(null);
30
+ const displayFor = ref(0);
31
+ const promptText = ref<string | null | undefined>("");
32
+ const buttonText = ref<string | null | undefined>("");
33
+ const visible = ref(false);
34
+ const countdownLoopId = ref<any>(null);
35
+
36
+ // computed
37
+ const timeRemainingClass = computed(() => {
38
+ if (displayFor.value > 10) {
39
+ return "font-bold text-green-dark";
40
+ }
41
+ return "font-bold text-red";
42
+ });
43
+
44
+ // methods
45
+ const handleNotification = (_conference: Conference) => {
46
+ clearInterval(countdownLoopId);
47
+ window.scrollTo({ top: 0, behavior: "smooth" });
48
+ visible.value = true;
49
+ displayFor.value = _conference.ce_credit_config?.display_for || 30;
50
+ promptText.value = _conference.ce_credit_config?.prompt_text;
51
+ buttonText.value = _conference.ce_credit_config?.button_text;
52
+ countdownLoopId.value = setInterval(countdownLoop, 1000);
53
+ };
16
54
 
17
- <script>
18
- import Echo from 'laravel-echo';
19
- window.Pusher = require('pusher-js');
55
+ const countdownLoop = () => {
56
+ if (displayFor.value > 0) {
57
+ displayFor.value--;
58
+ } else {
59
+ closeNotification();
60
+ }
61
+ };
62
+
63
+ const acceptClick = () => {
64
+ closeNotification();
65
+ };
20
66
 
21
- /**
22
- @todo Extract the wsHost and app ID out so that this can run in multiple environments (local, staging, production)
23
- */
24
-
67
+ const closeNotification = () => {
68
+ displayFor.value = 0;
69
+ visible.value = false;
70
+ clearInterval(countdownLoopId.value);
71
+ };
72
+
73
+ // Pusher
74
+ window.Pusher = Pusher;
25
75
  window.Echo = new Echo({
26
- key: '07Ve4MlR6FmN0Il8Wy',
27
- broadcaster: 'pusher',
28
- cluster: 'us2',
29
- wsHost: 'socket.v3plusportal.com',
76
+ key: "07Ve4MlR6FmN0Il8Wy",
77
+ broadcaster: "pusher",
78
+ cluster: "us2",
79
+ wsHost: "socket.v3plusportal.com",
30
80
  wsPort: 6001,
31
81
  wssPort: 6002,
32
82
  disableStats: false,
33
83
  encrypted: true,
34
- enabledTransports: ['ws', 'wss'],
84
+ enabledTransports: ["ws", "wss"],
35
85
  });
36
86
 
37
- export default {
38
- data() {
39
- return {
40
- pusher: null,
41
- channel: null,
42
- displayFor: 0,
43
- promptText: '',
44
- buttonText: '',
45
- visible: false,
46
- countdownLoopId: null,
47
- };
48
- },
49
- computed: {
50
- timeRemainingClass() {
51
- if (this.displayFor > 10) {
52
- return 'font-bold text-green-dark';
53
- }
54
- return 'font-bold text-red';
55
- },
56
- },
57
- props: {
58
- conferenceId: {
59
- type: Number,
60
- required: true,
61
- },
62
- },
63
- methods: {
64
- handleNotification(_conference) {
65
- clearInterval(this.countdownLoopId);
66
- window.scrollTo({ top: 0, behavior: 'smooth' });
67
- this.visible = true;
68
- this.displayFor = parseInt(_conference.ce_credit_config.display_for) || 30;
69
- this.promptText = _conference.ce_credit_config.prompt_text;
70
- this.buttonText = _conference.ce_credit_config.button_text;
71
- this.countdownLoopId = setInterval(this.countdownLoop, 1000);
72
- },
73
- countdownLoop() {
74
- if (this.displayFor > 0) {
75
- this.displayFor--;
76
- } else {
77
- this.closeNotification();
78
- }
79
- },
80
- acceptClick() {
81
- this.closeNotification();
82
- },
83
- closeNotification() {
84
- this.displayFor = 0;
85
- this.visible = false;
86
- clearInterval(this.countdownLoopId);
87
- },
88
- },
89
- created() {
90
- window.Echo.channel(`ce-notification.${this.conferenceId}`).listen('CeCreditNotification', event => {
91
- this.handleNotification(event.conference);
92
- });
93
- },
94
- };
87
+ // Lifecycle hooks
88
+ onMounted(() => {
89
+ window.Echo?.channel(`ce-notification.${conferenceId.value}`).listen(
90
+ // TODO: "window.Echo is potentially undefined."
91
+ "CeCreditNotification",
92
+ (event: any) => {
93
+ // TODO: determine 'event' type
94
+ handleNotification(event.conference);
95
+ }
96
+ );
97
+ });
95
98
  </script>
96
99
 
97
- <style scoped>
100
+ <template>
101
+ <transition name="slide-fade">
102
+ <div
103
+ v-if="visible"
104
+ :class="
105
+ classBinding(
106
+ classObject,
107
+ 'container',
108
+ 'flex bg-yellow-lightest shadow text-grey-darker py-6 px-10'
109
+ )
110
+ "
111
+ >
112
+ <div
113
+ :class="
114
+ classBinding(
115
+ classObject,
116
+ 'containerInner',
117
+ 'flex-1 text-center mx-auto'
118
+ )
119
+ "
120
+ >
121
+ <p :class="classBinding(classObject, 'timeRemaining', '')">
122
+ Time Remaining
123
+ <span
124
+ :class="[
125
+ classBinding(classObject, 'timeInSeconds', ''),
126
+ timeRemainingClass,
127
+ ]"
128
+ >{{ displayFor }} seconds
129
+ </span>
130
+ </p>
131
+ <p
132
+ :class="classBinding(classObject, 'promptText', '')"
133
+ v-text="promptText"
134
+ ></p>
135
+ <p :class="classBinding(classObject, 'buttonContainer', '')">
136
+ <button
137
+ :class="
138
+ classBinding(classObject, 'acceptButton', 'btn btn-secondary')
139
+ "
140
+ @click="acceptClick"
141
+ v-text="buttonText"
142
+ ></button>
143
+ </p>
144
+ </div>
145
+ </div>
146
+ </transition>
147
+ </template>
98
148
 
99
- </style>
149
+ <style lang="scss" scoped></style>
@@ -1,36 +1,113 @@
1
+ <script lang="ts" setup>
2
+ import { toRefs, computed } from "vue";
3
+ import { Presentation } from "../../../models/conference";
4
+ import { Document } from "../../../models/document";
5
+ import { DocumentsPanelClassObj } from "../../../@types/components";
6
+ import { useClassBinding } from "../../../composables/useClassBinding";
7
+
8
+ type Props = {
9
+ presentation: Presentation;
10
+ classObject?: DocumentsPanelClassObj;
11
+ };
12
+ const props = withDefaults(defineProps<Props>(), {
13
+ classObject: () => {
14
+ return {
15
+ container: "",
16
+ documentList: "",
17
+ listElement: "",
18
+ lastElement: "",
19
+ elementLink: "",
20
+ elementText: "",
21
+ elementDescription: "",
22
+ noDocumentsElement: "",
23
+ noDocumentsText: "",
24
+ };
25
+ },
26
+ });
27
+
28
+ const { presentation } = toRefs(props);
29
+ const { classBinding } = useClassBinding();
30
+
31
+ const documentArray = computed((): Array<Document> | null => {
32
+ return presentation.value.documents ? presentation.value.documents : null;
33
+ });
34
+ </script>
35
+
1
36
  <template>
2
- <div v-if="documentArray && documentArray.length > 0" class="py-4 px-4 text-base md:text-md lg:text-lg leading-normal">
3
- <ul class="list-reset">
4
- <li v-for="(document, index) in documentArray" :key="index" class="py-2" :class="{'border-b-2 contrast-border' : index !== documentArray.length-1}">
5
- <!-- fix file image -->
6
- <!--<img src="/images/pdf.svg" class="inline-block icon" />-->
7
- <a :href="document.url" class="no-underline font-semibold text-sm md:text-base" target="_blank">
8
- <p class="leading-tight mb-0">
9
- {{document.name}}
10
- </p>
11
- </a>
12
- <p v-if="document.description" class="mt-2 mb-6">{{document.description}}</p>
37
+ <div
38
+ v-if="documentArray && documentArray.length > 0"
39
+ :class="
40
+ classBinding(
41
+ classObject,
42
+ 'container',
43
+ 'py-4 px-4 text-base md:text-md lg:text-lg leading-normal'
44
+ )
45
+ "
46
+ >
47
+ <ul :class="classBinding(classObject, 'documentList', 'list-reset')">
48
+ <li
49
+ v-for="(document, index) in documentArray"
50
+ :key="index"
51
+ :class="[
52
+ index == documentArray.length - 1
53
+ ? classBinding(classObject, 'lastElement', 'py-2')
54
+ : classBinding(
55
+ classObject,
56
+ 'listElement',
57
+ 'py-2 border-b-2 contrast-border'
58
+ ),
59
+ ]"
60
+ >
61
+ <!-- fix file image -->
62
+ <!--<img src="/images/pdf.svg" class="inline-block icon" />-->
63
+ <a
64
+ :href="document.url"
65
+ :class="
66
+ classBinding(
67
+ classObject,
68
+ 'elementLink',
69
+ 'no-underline font-semibold text-sm md:text-base'
70
+ )
71
+ "
72
+ target="_blank"
73
+ >
74
+ <p
75
+ :class="
76
+ classBinding(classObject, 'elementText', 'leading-tight mb-0')
77
+ "
78
+ >
79
+ {{ document.name }}
80
+ </p>
81
+ </a>
82
+ <p
83
+ v-if="document.description"
84
+ :class="classBinding(classObject, 'elementDescription', 'mt-2 mb-6')"
85
+ >
86
+ {{ document.description }}
87
+ </p>
13
88
  </li>
14
89
  </ul>
15
90
  </div>
16
- <div v-else class="text-grey-800 px-2 py-4">
17
- <p class="text-base leading-normal font-light">There are no documents associated with this presentation.</p>
91
+ <div
92
+ v-else
93
+ :class="
94
+ classBinding(classObject, 'noDocumentsElement', 'text-grey-800 px-2 py-4')
95
+ "
96
+ >
97
+ <p
98
+ :class="
99
+ classBinding(
100
+ classObject,
101
+ 'noDocumentsText',
102
+ 'text-base leading-normal font-light'
103
+ )
104
+ "
105
+ >
106
+ There are no documents associated with this presentation.
107
+ </p>
18
108
  </div>
19
109
  </template>
20
110
 
21
- <script>
22
- export default {
23
- data() {
24
- return {};
25
- },
26
- computed: {
27
- documentArray() {
28
- return this.$parent.currentPresentation.documents;
29
- }
30
- }
31
- };
32
- </script>
33
-
34
111
  <style scoped>
35
112
  .document-grid {
36
113
  display: grid;
@@ -49,4 +126,4 @@ export default {
49
126
  .icon {
50
127
  width: 30px;
51
128
  }
52
- </style>
129
+ </style>
@@ -1,76 +1,200 @@
1
+ <script lang="ts" setup>
2
+ import { toRefs } from "vue";
3
+ import { Presentation, Sponsor } from "../../../models/conference";
4
+ import { SponsorsPanelClassObj } from "../../../@types/components";
5
+ import { useClassBinding } from "../../../composables/useClassBinding";
6
+
7
+ type Props = {
8
+ // sponsorType: string;
9
+ presentation: Presentation;
10
+ classObject?: SponsorsPanelClassObj;
11
+ };
12
+ const props = withDefaults(defineProps<Props>(), {
13
+ classObject: () => {
14
+ return {
15
+ container: "",
16
+ sessionSponsorsContainer: "",
17
+ sessionSponsorsHeader: "",
18
+ sessionSponsorsInner: "",
19
+ sessionSponsor: "",
20
+ sponsorLink: "",
21
+ sponsorImage: "",
22
+ trackSponsorsContainer: "",
23
+ trackSponsorsHeader: "",
24
+ trackSponsorsInner: "",
25
+ trackSponsor: "",
26
+ trackLink: "",
27
+ trackImage: "",
28
+ noSponsorsElement: "",
29
+ noSponsorsText: "",
30
+ };
31
+ },
32
+ });
33
+
34
+ const { presentation } = toRefs(props);
35
+ const { classBinding } = useClassBinding();
36
+
37
+ const sponsorsArray = ref<Array<Sponsor> | undefined>(
38
+ presentation.value.sponsors
39
+ );
40
+ // TODO: presentation.tracks too likely to be undefined to reliably set on mount
41
+ const trackSponsorsArray = ref<Array<Sponsor> | undefined>([]);
42
+
43
+ watch(presentation, (_newPresentation: Presentation) => {
44
+ if (_newPresentation.sponsors) {
45
+ sponsorsArray.value = _newPresentation.sponsors;
46
+ }
47
+ if (_newPresentation.tracks) {
48
+ trackSponsorsArray.value = _newPresentation.tracks[0]?.sponsors;
49
+ }
50
+ });
51
+ </script>
52
+
1
53
  <template>
2
- <div>
3
- <div v-if="sponsorsArray.length > 0" class="text-grey-800 px-4 py-4" :class="trackSponsorsArray.length > 0 ? 'border-b border-light-grey' : ''">
4
- <div class="mb-4">
5
- <!-- Session Sponsors -->
6
- <h3 class="primary-link text-lg text-center mb-3">Session Sponsors</h3>
7
- <div class="flex flex-row md:flex-col flex-wrap">
8
- <div v-for="(sponsor, index) in sponsorsArray" :key="index" class="flex-1 mx-4 my-2 md:mx-0 self-center">
9
- <a :href="sponsor.website" target="_blank" class="block mx-auto">
10
- <img :src="sponsor.photo" class="block mx-auto" />
11
- </a>
12
- </div>
13
- </div>
14
- </div>
54
+ <div :class="classBinding(classObject, 'container', '')">
55
+ <div
56
+ v-if="sponsorsArray != undefined && sponsorsArray.length > 0"
57
+ :class="[
58
+ classBinding(
59
+ classObject,
60
+ 'sessionSponsorsContainer',
61
+ 'text-grey-800 px-4 py-4 mb-4'
62
+ ),
63
+ trackSponsorsArray != undefined && trackSponsorsArray.length > 0
64
+ ? 'border-b border-light-grey'
65
+ : '',
66
+ ]"
67
+ >
68
+ <!-- Session Sponsors -->
69
+ <h3
70
+ :class="
71
+ classBinding(
72
+ classObject,
73
+ 'sessionSponsorsHeader',
74
+ 'primary-link text-lg text-center mb-3'
75
+ )
76
+ "
77
+ >
78
+ Session Sponsors
79
+ </h3>
80
+ <div
81
+ :class="
82
+ classBinding(
83
+ classObject,
84
+ 'sessionSponsorsInner',
85
+ 'flex flex-row md:flex-col flex-wrap'
86
+ )
87
+ "
88
+ >
89
+ <div
90
+ v-for="(sponsor, index) in sponsorsArray"
91
+ :key="index"
92
+ :class="
93
+ classBinding(
94
+ classObject,
95
+ 'sessionSponsor',
96
+ 'flex-1 mx-4 my-2 md:mx-0 self-center'
97
+ )
98
+ "
99
+ >
100
+ <a
101
+ :href="sponsor.website"
102
+ target="_blank"
103
+ :class="classBinding(classObject, 'sponsorLink', 'block mx-auto')"
104
+ >
105
+ <img
106
+ :src="sponsor.photo"
107
+ :class="
108
+ classBinding(classObject, 'sponsorImage', 'block mx-auto')
109
+ "
110
+ />
111
+ </a>
15
112
  </div>
16
- <div v-if="trackSponsorsArray.length > 0" class="text-grey-800 px-4 py-4">
17
- <div class="mb-4">
18
- <!-- Session Sponsors -->
19
- <h3 class="primary-link text-lg text-center mb-3">Track Sponsors</h3>
20
- <div class="flex flex-row md:flex-col flex-wrap">
21
- <div v-for="(sponsor, index) in trackSponsorsArray" :key="index" class="flex-1 mx-4 my-2 md:mx-0 self-center">
22
- <a :href="sponsor.website" target="_blank" class="block mx-auto">
23
- <img :src="sponsor.photo" class="block mx-auto" />
24
- </a>
25
- </div>
26
- </div>
27
- </div>
28
- </div>
29
- <div v-if="!sponsorsArray.length && !trackSponsorsArray.length" class="text-grey-800 px-2 py-4">
30
- <p class="text-base leading-normal font-light">There are no sponsors associated with this presentation.</p>
113
+ </div>
114
+ </div>
115
+ <div
116
+ v-if="trackSponsorsArray != undefined && trackSponsorsArray.length > 0"
117
+ :class="
118
+ classBinding(
119
+ classObject,
120
+ 'trackSponsorsContainer',
121
+ 'text-grey-800 px-4 py-4 mb-4'
122
+ )
123
+ "
124
+ >
125
+ <!-- Session Sponsors -->
126
+ <h3
127
+ :class="
128
+ classBinding(
129
+ classObject,
130
+ 'trackSponsorsHeader',
131
+ 'primary-link text-lg text-center mb-3'
132
+ )
133
+ "
134
+ >
135
+ Track Sponsors
136
+ </h3>
137
+ <div
138
+ :class="
139
+ classBinding(
140
+ classObject,
141
+ 'trackSponsorsInner',
142
+ 'flex flex-row md:flex-col flex-wrap'
143
+ )
144
+ "
145
+ >
146
+ <div
147
+ v-for="(sponsor, index) in trackSponsorsArray"
148
+ :key="index"
149
+ :class="
150
+ classBinding(
151
+ classObject,
152
+ 'trackSponsor',
153
+ 'flex-1 mx-4 my-2 md:mx-0 self-center'
154
+ )
155
+ "
156
+ >
157
+ <a
158
+ :href="sponsor.website"
159
+ target="_blank"
160
+ :class="classBinding(classObject, 'trackLink', 'block mx-auto')"
161
+ >
162
+ <img
163
+ :src="sponsor.photo"
164
+ :class="classBinding(classObject, 'trackImage', 'block mx-auto')"
165
+ />
166
+ </a>
31
167
  </div>
168
+ </div>
169
+ </div>
170
+ <div
171
+ v-if="
172
+ (sponsorsArray == undefined && trackSponsorsArray == undefined) ||
173
+ (!sponsorsArray?.length && !trackSponsorsArray?.length)
174
+ "
175
+ :class="
176
+ classBinding(
177
+ classObject,
178
+ 'noSponsorsElement',
179
+ 'text-grey-800 px-2 py-4'
180
+ )
181
+ "
182
+ >
183
+ <p
184
+ :class="
185
+ classBinding(
186
+ classObject,
187
+ 'noSponsorsText',
188
+ 'text-base leading-normal font-light'
189
+ )
190
+ "
191
+ >
192
+ There are no sponsors associated with this presentation.
193
+ </p>
32
194
  </div>
195
+ </div>
33
196
  </template>
34
197
 
35
- <script>
36
- export default {
37
- data() {
38
- return {
39
- sponsorsArray: [],
40
- trackSponsorsArray: []
41
- };
42
- },
43
- props: {
44
- sponsorType: {
45
- type: String
46
- },
47
- currentPresentation: {
48
- type: Object,
49
- default: () => {
50
- return {};
51
- }
52
- },
53
- },
54
- computed: {
55
- },
56
- methods: {
57
- },
58
- watch: {
59
- currentPresentation: {
60
- immediate: true,
61
- handler (currentPres) {
62
- if(currentPres.sponsors) {
63
- this.sponsorsArray = currentPres.sponsors;
64
- }
65
- if(currentPres.tracks) {
66
- this.trackSponsorsArray = currentPres.tracks[0].sponsors;
67
- }
68
- }
69
- }
70
- }
71
- }
72
- </script>
73
-
74
198
  <style scoped>
75
199
  .sponsor-grid {
76
200
  display: grid;
@@ -82,4 +206,4 @@ export default {
82
206
  align-self: center;
83
207
  justify-self: center;
84
208
  }
85
- </style>
209
+ </style>
@@ -0,0 +1,15 @@
1
+ import Pusher from "pusher-js";
2
+ import Echo from "laravel-echo";
3
+ declare global {
4
+ interface Window {
5
+ Echo?: Echo;
6
+ Pusher: typeof Pusher;
7
+ }
8
+ }
9
+ export type usePusherMethods = {
10
+ /**
11
+ * Join the Pusher presence channel to be detected as online
12
+ */
13
+ joinPresenceChannel(): void;
14
+ };
15
+ export declare const usePusher: () => usePusherMethods;