@tiquo/dom-package 1.6.0 → 1.6.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 +16 -0
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +31 -5
- package/dist/index.mjs +30 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -45,6 +45,22 @@ The same public key is used across all websites in your organization; Tiquo reco
|
|
|
45
45
|
the source domain for each event and rolls `www.example.com` into `example.com`.
|
|
46
46
|
Other subdomains are tracked as separate websites.
|
|
47
47
|
|
|
48
|
+
The package prints a small Tiquo banner in the browser console once per page load
|
|
49
|
+
when it is loaded by your site. To show it on every page, import the package from
|
|
50
|
+
global client-side code that runs on every page:
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
import '@tiquo/dom-package';
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
You can also print the banner explicitly:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { printTiquoBranding } from '@tiquo/dom-package';
|
|
60
|
+
|
|
61
|
+
printTiquoBranding();
|
|
62
|
+
```
|
|
63
|
+
|
|
48
64
|
```typescript
|
|
49
65
|
// Optional custom analytics events
|
|
50
66
|
await auth.analytics?.track('booking_started', {
|
package/dist/index.d.mts
CHANGED
|
@@ -164,6 +164,8 @@ declare function getDialCode(countryCode: string): string | null;
|
|
|
164
164
|
*/
|
|
165
165
|
declare function buildPhone(countryCode: string, nationalNumber: string): string | null;
|
|
166
166
|
|
|
167
|
+
declare function printTiquoBranding(): void;
|
|
168
|
+
|
|
167
169
|
/**
|
|
168
170
|
* @tiquo/dom-package
|
|
169
171
|
*
|
|
@@ -1057,4 +1059,4 @@ declare class TiquoPhone {
|
|
|
1057
1059
|
static buildPhone: typeof buildPhone;
|
|
1058
1060
|
}
|
|
1059
1061
|
|
|
1060
|
-
export { type AuthStateChangeCallback, type CountryPhoneInfo, type CreateEnquiryCustomerData, type CreateEnquiryData, type CreateEnquiryResult, type GetBookingsOptions, type GetBookingsResult, type GetCompaniesResult, type GetCompanyColleaguesResult, type GetEnquiriesOptions, type GetEnquiriesResult, type GetOrdersOptions, type GetOrdersResult, type IframeTokenResult, type PhoneValidationResult, type ProfilePhotoUploadResult, type ProfileUpdateData, type ProfileUpdateResult, type SendOTPResult, TiquoAnalytics, type TiquoAnalyticsConfig, type TiquoAnalyticsEventOptions, TiquoAuth, type TiquoAuthConfig, TiquoAuthError, type TiquoBooking, TiquoCMS, type TiquoCMSBlock, type TiquoCMSConfig, type TiquoCMSPage, type TiquoCMSPageRequest, type TiquoCompany, type TiquoCompanyColleague, type TiquoCompanyMembership, type TiquoCompanyRelationship, type TiquoCustomer, type TiquoCustomerEmail, type TiquoCustomerPhone, type TiquoEnquiry, type TiquoOrder, type TiquoOrderItem, TiquoPhone, type TiquoReceipt, type TiquoReceiptBusiness, type TiquoReceiptCustomer, type TiquoReceiptItem, type TiquoReceiptOrder, type TiquoSession, type TiquoUser, type VerifyOTPResult, addCustomerUserId, clearCachedEmail, TiquoAuth as default, getCustomerUserIds, getPrefilledEmailFromCookie, isDashboardSession, trackCustomerPresence, useTiquoAuth };
|
|
1062
|
+
export { type AuthStateChangeCallback, type CountryPhoneInfo, type CreateEnquiryCustomerData, type CreateEnquiryData, type CreateEnquiryResult, type GetBookingsOptions, type GetBookingsResult, type GetCompaniesResult, type GetCompanyColleaguesResult, type GetEnquiriesOptions, type GetEnquiriesResult, type GetOrdersOptions, type GetOrdersResult, type IframeTokenResult, type PhoneValidationResult, type ProfilePhotoUploadResult, type ProfileUpdateData, type ProfileUpdateResult, type SendOTPResult, TiquoAnalytics, type TiquoAnalyticsConfig, type TiquoAnalyticsEventOptions, TiquoAuth, type TiquoAuthConfig, TiquoAuthError, type TiquoBooking, TiquoCMS, type TiquoCMSBlock, type TiquoCMSConfig, type TiquoCMSPage, type TiquoCMSPageRequest, type TiquoCompany, type TiquoCompanyColleague, type TiquoCompanyMembership, type TiquoCompanyRelationship, type TiquoCustomer, type TiquoCustomerEmail, type TiquoCustomerPhone, type TiquoEnquiry, type TiquoOrder, type TiquoOrderItem, TiquoPhone, type TiquoReceipt, type TiquoReceiptBusiness, type TiquoReceiptCustomer, type TiquoReceiptItem, type TiquoReceiptOrder, type TiquoSession, type TiquoUser, type VerifyOTPResult, addCustomerUserId, clearCachedEmail, TiquoAuth as default, getCustomerUserIds, getPrefilledEmailFromCookie, isDashboardSession, printTiquoBranding, trackCustomerPresence, useTiquoAuth };
|
package/dist/index.d.ts
CHANGED
|
@@ -164,6 +164,8 @@ declare function getDialCode(countryCode: string): string | null;
|
|
|
164
164
|
*/
|
|
165
165
|
declare function buildPhone(countryCode: string, nationalNumber: string): string | null;
|
|
166
166
|
|
|
167
|
+
declare function printTiquoBranding(): void;
|
|
168
|
+
|
|
167
169
|
/**
|
|
168
170
|
* @tiquo/dom-package
|
|
169
171
|
*
|
|
@@ -1057,4 +1059,4 @@ declare class TiquoPhone {
|
|
|
1057
1059
|
static buildPhone: typeof buildPhone;
|
|
1058
1060
|
}
|
|
1059
1061
|
|
|
1060
|
-
export { type AuthStateChangeCallback, type CountryPhoneInfo, type CreateEnquiryCustomerData, type CreateEnquiryData, type CreateEnquiryResult, type GetBookingsOptions, type GetBookingsResult, type GetCompaniesResult, type GetCompanyColleaguesResult, type GetEnquiriesOptions, type GetEnquiriesResult, type GetOrdersOptions, type GetOrdersResult, type IframeTokenResult, type PhoneValidationResult, type ProfilePhotoUploadResult, type ProfileUpdateData, type ProfileUpdateResult, type SendOTPResult, TiquoAnalytics, type TiquoAnalyticsConfig, type TiquoAnalyticsEventOptions, TiquoAuth, type TiquoAuthConfig, TiquoAuthError, type TiquoBooking, TiquoCMS, type TiquoCMSBlock, type TiquoCMSConfig, type TiquoCMSPage, type TiquoCMSPageRequest, type TiquoCompany, type TiquoCompanyColleague, type TiquoCompanyMembership, type TiquoCompanyRelationship, type TiquoCustomer, type TiquoCustomerEmail, type TiquoCustomerPhone, type TiquoEnquiry, type TiquoOrder, type TiquoOrderItem, TiquoPhone, type TiquoReceipt, type TiquoReceiptBusiness, type TiquoReceiptCustomer, type TiquoReceiptItem, type TiquoReceiptOrder, type TiquoSession, type TiquoUser, type VerifyOTPResult, addCustomerUserId, clearCachedEmail, TiquoAuth as default, getCustomerUserIds, getPrefilledEmailFromCookie, isDashboardSession, trackCustomerPresence, useTiquoAuth };
|
|
1062
|
+
export { type AuthStateChangeCallback, type CountryPhoneInfo, type CreateEnquiryCustomerData, type CreateEnquiryData, type CreateEnquiryResult, type GetBookingsOptions, type GetBookingsResult, type GetCompaniesResult, type GetCompanyColleaguesResult, type GetEnquiriesOptions, type GetEnquiriesResult, type GetOrdersOptions, type GetOrdersResult, type IframeTokenResult, type PhoneValidationResult, type ProfilePhotoUploadResult, type ProfileUpdateData, type ProfileUpdateResult, type SendOTPResult, TiquoAnalytics, type TiquoAnalyticsConfig, type TiquoAnalyticsEventOptions, TiquoAuth, type TiquoAuthConfig, TiquoAuthError, type TiquoBooking, TiquoCMS, type TiquoCMSBlock, type TiquoCMSConfig, type TiquoCMSPage, type TiquoCMSPageRequest, type TiquoCompany, type TiquoCompanyColleague, type TiquoCompanyMembership, type TiquoCompanyRelationship, type TiquoCustomer, type TiquoCustomerEmail, type TiquoCustomerPhone, type TiquoEnquiry, type TiquoOrder, type TiquoOrderItem, TiquoPhone, type TiquoReceipt, type TiquoReceiptBusiness, type TiquoReceiptCustomer, type TiquoReceiptItem, type TiquoReceiptOrder, type TiquoSession, type TiquoUser, type VerifyOTPResult, addCustomerUserId, clearCachedEmail, TiquoAuth as default, getCustomerUserIds, getPrefilledEmailFromCookie, isDashboardSession, printTiquoBranding, trackCustomerPresence, useTiquoAuth };
|
package/dist/index.js
CHANGED
|
@@ -31,6 +31,7 @@ __export(index_exports, {
|
|
|
31
31
|
getCustomerUserIds: () => getCustomerUserIds,
|
|
32
32
|
getPrefilledEmailFromCookie: () => getPrefilledEmailFromCookie,
|
|
33
33
|
isDashboardSession: () => isDashboardSession,
|
|
34
|
+
printTiquoBranding: () => printTiquoBranding,
|
|
34
35
|
trackCustomerPresence: () => trackCustomerPresence,
|
|
35
36
|
useTiquoAuth: () => useTiquoAuth
|
|
36
37
|
});
|
|
@@ -651,12 +652,33 @@ function buildPhone(countryCode, nationalNumber) {
|
|
|
651
652
|
return normalizePhone("+" + dc + digits);
|
|
652
653
|
}
|
|
653
654
|
|
|
654
|
-
// src/
|
|
655
|
-
var
|
|
655
|
+
// src/branding.ts
|
|
656
|
+
var BRANDING_MARKER = /* @__PURE__ */ Symbol.for("tiquo.domPackage.brandingPrinted");
|
|
657
|
+
var brandingPrinted = false;
|
|
658
|
+
function hasPrintedInRuntime() {
|
|
659
|
+
return Boolean(globalThis[BRANDING_MARKER]);
|
|
660
|
+
}
|
|
661
|
+
function markPrintedInRuntime() {
|
|
662
|
+
try {
|
|
663
|
+
Object.defineProperty(globalThis, BRANDING_MARKER, {
|
|
664
|
+
value: true,
|
|
665
|
+
configurable: false,
|
|
666
|
+
enumerable: false,
|
|
667
|
+
writable: false
|
|
668
|
+
});
|
|
669
|
+
} catch {
|
|
670
|
+
globalThis[BRANDING_MARKER] = true;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
656
673
|
function printTiquoBranding() {
|
|
657
|
-
if (
|
|
658
|
-
if (typeof window === "undefined"
|
|
659
|
-
|
|
674
|
+
if (brandingPrinted) return;
|
|
675
|
+
if (typeof window === "undefined") return;
|
|
676
|
+
if (typeof console === "undefined") return;
|
|
677
|
+
if (hasPrintedInRuntime()) {
|
|
678
|
+
brandingPrinted = true;
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
brandingPrinted = true;
|
|
660
682
|
try {
|
|
661
683
|
const art = [
|
|
662
684
|
" _ _ ",
|
|
@@ -675,9 +697,12 @@ function printTiquoBranding() {
|
|
|
675
697
|
"color:#6d28d9;font-size:11px",
|
|
676
698
|
"color:#6d28d9;font-size:11px;text-decoration:underline"
|
|
677
699
|
);
|
|
700
|
+
markPrintedInRuntime();
|
|
678
701
|
} catch {
|
|
679
702
|
}
|
|
680
703
|
}
|
|
704
|
+
|
|
705
|
+
// src/index.ts
|
|
681
706
|
printTiquoBranding();
|
|
682
707
|
var ANALYTICS_LOCATION_EVENT = "tiquo:locationchange";
|
|
683
708
|
var analyticsHistoryPatched = false;
|
|
@@ -2427,6 +2452,7 @@ var index_default = TiquoAuth;
|
|
|
2427
2452
|
getCustomerUserIds,
|
|
2428
2453
|
getPrefilledEmailFromCookie,
|
|
2429
2454
|
isDashboardSession,
|
|
2455
|
+
printTiquoBranding,
|
|
2430
2456
|
trackCustomerPresence,
|
|
2431
2457
|
useTiquoAuth
|
|
2432
2458
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -613,12 +613,33 @@ function buildPhone(countryCode, nationalNumber) {
|
|
|
613
613
|
return normalizePhone("+" + dc + digits);
|
|
614
614
|
}
|
|
615
615
|
|
|
616
|
-
// src/
|
|
617
|
-
var
|
|
616
|
+
// src/branding.ts
|
|
617
|
+
var BRANDING_MARKER = /* @__PURE__ */ Symbol.for("tiquo.domPackage.brandingPrinted");
|
|
618
|
+
var brandingPrinted = false;
|
|
619
|
+
function hasPrintedInRuntime() {
|
|
620
|
+
return Boolean(globalThis[BRANDING_MARKER]);
|
|
621
|
+
}
|
|
622
|
+
function markPrintedInRuntime() {
|
|
623
|
+
try {
|
|
624
|
+
Object.defineProperty(globalThis, BRANDING_MARKER, {
|
|
625
|
+
value: true,
|
|
626
|
+
configurable: false,
|
|
627
|
+
enumerable: false,
|
|
628
|
+
writable: false
|
|
629
|
+
});
|
|
630
|
+
} catch {
|
|
631
|
+
globalThis[BRANDING_MARKER] = true;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
618
634
|
function printTiquoBranding() {
|
|
619
|
-
if (
|
|
620
|
-
if (typeof window === "undefined"
|
|
621
|
-
|
|
635
|
+
if (brandingPrinted) return;
|
|
636
|
+
if (typeof window === "undefined") return;
|
|
637
|
+
if (typeof console === "undefined") return;
|
|
638
|
+
if (hasPrintedInRuntime()) {
|
|
639
|
+
brandingPrinted = true;
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
brandingPrinted = true;
|
|
622
643
|
try {
|
|
623
644
|
const art = [
|
|
624
645
|
" _ _ ",
|
|
@@ -637,9 +658,12 @@ function printTiquoBranding() {
|
|
|
637
658
|
"color:#6d28d9;font-size:11px",
|
|
638
659
|
"color:#6d28d9;font-size:11px;text-decoration:underline"
|
|
639
660
|
);
|
|
661
|
+
markPrintedInRuntime();
|
|
640
662
|
} catch {
|
|
641
663
|
}
|
|
642
664
|
}
|
|
665
|
+
|
|
666
|
+
// src/index.ts
|
|
643
667
|
printTiquoBranding();
|
|
644
668
|
var ANALYTICS_LOCATION_EVENT = "tiquo:locationchange";
|
|
645
669
|
var analyticsHistoryPatched = false;
|
|
@@ -2389,6 +2413,7 @@ export {
|
|
|
2389
2413
|
getCustomerUserIds,
|
|
2390
2414
|
getPrefilledEmailFromCookie,
|
|
2391
2415
|
isDashboardSession,
|
|
2416
|
+
printTiquoBranding,
|
|
2392
2417
|
trackCustomerPresence,
|
|
2393
2418
|
useTiquoAuth
|
|
2394
2419
|
};
|
package/package.json
CHANGED