@icvdeveloper/common-module 0.0.51 → 0.0.53

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/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "v3plus-common-module",
3
3
  "configKey": "v3plusCommonModule",
4
- "version": "0.0.51"
4
+ "version": "0.0.53"
5
5
  }
@@ -8,5 +8,6 @@ export * from "./useLogin";
8
8
  export * from "./usePresentation";
9
9
  export * from "./usePresenter";
10
10
  export * from "./usePresenters";
11
+ export * from "./useScripts";
11
12
  export * from "./useUcc";
12
13
  export * from "./useV3plusCommonModule";
@@ -8,5 +8,6 @@ export * from "./useLogin.mjs";
8
8
  export * from "./usePresentation.mjs";
9
9
  export * from "./usePresenter.mjs";
10
10
  export * from "./usePresenters.mjs";
11
+ export * from "./useScripts.mjs";
11
12
  export * from "./useUcc.mjs";
12
13
  export * from "./useV3plusCommonModule.mjs";
@@ -0,0 +1,7 @@
1
+ export type adobeLaunchFunctions = {
2
+ /**
3
+ * load script
4
+ */
5
+ loadAdobeLaunch: (scriptSrc: string) => void;
6
+ };
7
+ export declare const useAdobeLaunch: () => adobeLaunchFunctions;
@@ -0,0 +1,19 @@
1
+ import { useRouter } from "vue-router";
2
+ import { get } from "lodash-es";
3
+ export const useAdobeLaunch = () => {
4
+ const router = useRouter();
5
+ const loadAdobeLaunch = (scriptSrc) => {
6
+ let adtm = document.createElement("script");
7
+ adtm.setAttribute("src", scriptSrc);
8
+ document.head.appendChild(adtm);
9
+ router.afterEach((to, from) => {
10
+ if (get(window, "_satellite.track", false)) {
11
+ window._satellite.setDebug(true);
12
+ window._satellite.track("spaPageView");
13
+ }
14
+ });
15
+ };
16
+ return {
17
+ loadAdobeLaunch
18
+ };
19
+ };
@@ -20,7 +20,7 @@ export type UseConferenceHelpersMethods = {
20
20
  /**
21
21
  * Get conference display date.
22
22
  */
23
- getConferenceDisplayDate: (_conference?: Conference) => string;
23
+ getConferenceDisplayDate: (_conference?: Conference, showDate: boolean, showTime: boolean, showEndTime: boolean) => string;
24
24
  /**
25
25
  * Determine if show view archive button should be shown
26
26
  */
@@ -66,38 +66,61 @@ export const useConferenceHelpers = (conference) => {
66
66
  const viewNowAliasText = globalConfigValue.value("view_now_button_alias");
67
67
  return viewNowAliasText || "View Now";
68
68
  };
69
- const getConferenceDisplayDate = (_conference) => {
69
+ const getConferenceDisplayDate = (_conference, showDate = true, showTime = false, showEndTime = false) => {
70
70
  const _selectedConference = _getSelectedConference(_conference);
71
71
  const startDate = _selectedConference.start_date;
72
72
  const endDate = _selectedConference.end_date;
73
+ let returnDate = "";
73
74
  const tzFormat = pagesConfigValue.value("main.use_event_text_tz") ? " zzz" : "";
74
75
  if (isSingleDayEvent()) {
75
- const startFormat2 = "MMMM do, yyyy h:mm" + tzFormat;
76
- return formatTimezoneToLocal(
76
+ const startFormat = "MMMM do, yyyy ";
77
+ if (showDate) {
78
+ returnDate += formatTimezoneToLocal(
79
+ startDate,
80
+ startFormat,
81
+ _selectedConference.timezone
82
+ );
83
+ }
84
+ if (showTime) {
85
+ returnDate += formatTimezoneToLocal(
86
+ startDate,
87
+ "h:mm a",
88
+ _selectedConference.timezone
89
+ );
90
+ if (showEndTime) {
91
+ returnDate += " - " + formatTimezoneToLocal(
92
+ endDate,
93
+ "h:mm a",
94
+ _selectedConference.timezone
95
+ );
96
+ }
97
+ returnDate += formatTimezoneToLocal(
98
+ startDate,
99
+ tzFormat,
100
+ _selectedConference.timezone
101
+ );
102
+ }
103
+ } else if (showDate) {
104
+ let startFormat = "MMMM do";
105
+ if (format(parseISO(startDate), "yyyy") !== format(parseISO(endDate), "yyyy")) {
106
+ startFormat += ", yyyy";
107
+ }
108
+ returnDate += formatTimezoneToLocal(
77
109
  startDate,
78
- startFormat2,
110
+ startFormat,
111
+ _selectedConference.timezone
112
+ );
113
+ returnDate += " - ";
114
+ let endFormat = "do, yyyy" + tzFormat;
115
+ if (format(parseISO(startDate), "MMMM") !== format(parseISO(endDate), "MMMM") || format(parseISO(startDate), "yyyy") !== format(parseISO(endDate), "yyyy")) {
116
+ endFormat = "MMMM " + endFormat;
117
+ }
118
+ returnDate += formatTimezoneToLocal(
119
+ endDate,
120
+ endFormat,
79
121
  _selectedConference.timezone
80
122
  );
81
123
  }
82
- let startFormat = "MMMM d";
83
- if (format(parseISO(startDate), "yyyy") !== format(parseISO(endDate), "yyyy")) {
84
- startFormat += ", yyyy";
85
- }
86
- let returnDate = formatTimezoneToLocal(
87
- startDate,
88
- startFormat,
89
- _selectedConference.timezone
90
- );
91
- returnDate += " - ";
92
- let endFormat = "d, yyyy" + tzFormat;
93
- if (format(parseISO(startDate), "MMMM") !== format(parseISO(endDate), "MMMM") || format(parseISO(startDate), "yyyy") !== format(parseISO(endDate), "yyyy")) {
94
- endFormat = "MMMM " + endFormat;
95
- }
96
- returnDate += formatTimezoneToLocal(
97
- endDate,
98
- endFormat,
99
- _selectedConference.timezone
100
- );
101
124
  return returnDate;
102
125
  };
103
126
  const showViewArchiveButton = (_conference) => {
@@ -0,0 +1,7 @@
1
+ export type scriptFunctions = {
2
+ /**
3
+ * load custom scripts
4
+ */
5
+ loadScripts: (scripts: Array<string>) => void;
6
+ };
7
+ export declare const useScripts: () => scriptFunctions;
@@ -0,0 +1,12 @@
1
+ export const useScripts = () => {
2
+ const loadScripts = (scripts) => {
3
+ scripts.forEach((src) => {
4
+ let ucc = document.createElement("script");
5
+ ucc.setAttribute("src", src);
6
+ document.head.appendChild(ucc);
7
+ });
8
+ };
9
+ return {
10
+ loadScripts
11
+ };
12
+ };
@@ -29,6 +29,7 @@ export interface Global {
29
29
  captions_font: FontVariable;
30
30
  captions_text_color: ColorVariable;
31
31
  conference_photo_headers: ImageVariable;
32
+ custom_scripts: TextAreaVariable;
32
33
  custom_css: TextAreaVariable;
33
34
  enable_peer5: ToggleVariable;
34
35
  enable_text_chat: ToggleVariable;
@@ -5,6 +5,7 @@ import NProgress from "nprogress";
5
5
  import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
6
6
  import { createV3plusCommonPlugin } from "./v3plusCommonPlugin.mjs";
7
7
  import { usePortalStore } from "./store/portal.mjs";
8
+ import { useTemplateConfigsStore } from "./store/templateConfigs.mjs";
8
9
  import { useConferencesStore } from "./store/conferences.mjs";
9
10
  export default defineNuxtPlugin((nuxtApp) => {
10
11
  const { version, portalHash, apiUrl } = nuxtApp.payload.config.public.v3plusCommonModule;
@@ -37,6 +38,9 @@ export default defineNuxtPlugin((nuxtApp) => {
37
38
  });
38
39
  nuxtApp.hook("app:created", (app) => {
39
40
  const { data } = storeToRefs(usePortalStore());
41
+ const { globalConfigValue } = useTemplateConfigsStore();
42
+ let customCss = globalConfigValue("custom_css");
43
+ customCss = customCss.length > 0 ? customCss.replace(/\n/g, "") : "";
40
44
  if (data.value) {
41
45
  app.config.globalProperties.$head.addHeadObjs(
42
46
  computed(() => {
@@ -48,6 +52,12 @@ export default defineNuxtPlugin((nuxtApp) => {
48
52
  type: "image/x-icon",
49
53
  href: data.value.favicon
50
54
  }
55
+ ],
56
+ style: [
57
+ {
58
+ type: "text/css",
59
+ children: customCss
60
+ }
51
61
  ]
52
62
  };
53
63
  })
@@ -11,7 +11,7 @@ export interface TemplateConfigState {
11
11
  }
12
12
  export declare const useTemplateConfigsStore: import("pinia").StoreDefinition<"templateConfigs", TemplateConfigState, {
13
13
  globalConfigValue: (state: TemplateConfigState) => (path: GlobalConfigKey, defaultValue?: any) => any;
14
- globalConfig: (state: TemplateConfigState) => <T extends "accent_color_1" | "accent_color_2" | "accent_color_3" | "affiliate_page_button_alias" | "azure_ad_client_id" | "azure_ad_message" | "azure_ad_tenant_id" | "azure_ad_user_password" | "body_color_1" | "body_color_2" | "body_color_3" | "body_color_4" | "body_color_5" | "body_color_6" | "body_font_1" | "body_font_2" | "button_color_1" | "button_color_2" | "captions_bg_color" | "captions_font" | "captions_text_color" | "conference_photo_headers" | "custom_css" | "enable_peer5" | "enable_text_chat" | "enable_video_chat" | "external_reg_url" | "global_color_1" | "global_color_2" | "global_color_3" | "global_color_4" | "global_color_5" | "global_color_6" | "header_font_1" | "header_font_2" | "header_titles" | "heading_color_1" | "heading_color_2" | "heading_color_3" | "heading_color_4" | "heading_color_5" | "heading_color_6" | "hide_user_profile" | "html_footer" | "html_header" | "link_color" | "link_hover" | "login_disabled" | "login_disabled_user_email" | "login_disabled_user_password" | "login_process" | "login_redirect_enabled" | "muted_photo_headers" | "nav_color_1" | "nav_color_2" | "nav_color_3" | "nav_color_4" | "nav_color_5" | "paragraph_color_1" | "paragraph_color_2" | "presenter_icon_color_style" | "reg_button_alias" | "reg_button_enabled" | "secure_site_access_enabled" | "townhall_registration_enabled" | "townhall_registration_group" | "view_archive_button_alias" | "view_now_button_alias" | "view_preview_button_alias">(path: T, defaultValue?: any) => GlobalConfigKeyType<T>;
14
+ globalConfig: (state: TemplateConfigState) => <T extends "accent_color_1" | "accent_color_2" | "accent_color_3" | "affiliate_page_button_alias" | "azure_ad_client_id" | "azure_ad_message" | "azure_ad_tenant_id" | "azure_ad_user_password" | "body_color_1" | "body_color_2" | "body_color_3" | "body_color_4" | "body_color_5" | "body_color_6" | "body_font_1" | "body_font_2" | "button_color_1" | "button_color_2" | "captions_bg_color" | "captions_font" | "captions_text_color" | "conference_photo_headers" | "custom_scripts" | "custom_css" | "enable_peer5" | "enable_text_chat" | "enable_video_chat" | "external_reg_url" | "global_color_1" | "global_color_2" | "global_color_3" | "global_color_4" | "global_color_5" | "global_color_6" | "header_font_1" | "header_font_2" | "header_titles" | "heading_color_1" | "heading_color_2" | "heading_color_3" | "heading_color_4" | "heading_color_5" | "heading_color_6" | "hide_user_profile" | "html_footer" | "html_header" | "link_color" | "link_hover" | "login_disabled" | "login_disabled_user_email" | "login_disabled_user_password" | "login_process" | "login_redirect_enabled" | "muted_photo_headers" | "nav_color_1" | "nav_color_2" | "nav_color_3" | "nav_color_4" | "nav_color_5" | "paragraph_color_1" | "paragraph_color_2" | "presenter_icon_color_style" | "reg_button_alias" | "reg_button_enabled" | "secure_site_access_enabled" | "townhall_registration_enabled" | "townhall_registration_group" | "view_archive_button_alias" | "view_now_button_alias" | "view_preview_button_alias">(path: T, defaultValue?: any) => GlobalConfigKeyType<T>;
15
15
  pagesConfigValue: (state: TemplateConfigState) => (path: NestedKeyOf<Pages>, defaultValue?: any, conferenceId?: number) => any;
16
16
  }, {
17
17
  setPortalTemplateConfig(payload: any): Promise<TemplateConfig>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icvdeveloper/common-module",
3
- "version": "0.0.51",
3
+ "version": "0.0.53",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {