@ikas/bp-storefront 1.4.0-beta.192 → 1.4.0-beta.193

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 (47) hide show
  1. package/dist/analytics/analytics-functions/addToCart.js +1 -1
  2. package/dist/analytics/analytics-functions/completeRegistration.js +1 -1
  3. package/dist/analytics/analytics-functions/contactForm.js +1 -1
  4. package/dist/analytics/analytics-functions/createEmailSubscription.js +1 -1
  5. package/dist/analytics/analytics-functions/customerLogin.js +1 -1
  6. package/dist/analytics/analytics-functions/pageView.js +1 -1
  7. package/dist/analytics/analytics-functions/productView.js +1 -1
  8. package/dist/analytics/ikas/analytics.js +1 -1
  9. package/dist/analytics/openai/addToCart.d.ts +2 -0
  10. package/dist/analytics/openai/addToCart.js +1 -0
  11. package/dist/analytics/openai/completeRegistration.d.ts +1 -0
  12. package/dist/analytics/openai/completeRegistration.js +1 -0
  13. package/dist/analytics/openai/contactForm.d.ts +1 -0
  14. package/dist/analytics/openai/contactForm.js +1 -0
  15. package/dist/analytics/openai/initAdvancedMatching.d.ts +12 -0
  16. package/dist/analytics/openai/initAdvancedMatching.js +1 -0
  17. package/dist/analytics/openai/pageView.d.ts +1 -0
  18. package/dist/analytics/openai/pageView.js +1 -0
  19. package/dist/analytics/openai/productView.d.ts +2 -0
  20. package/dist/analytics/openai/productView.js +1 -0
  21. package/dist/analytics/openai/utils.d.ts +26 -0
  22. package/dist/analytics/openai/utils.js +1 -0
  23. package/dist/analytics/utils.d.ts +1 -0
  24. package/dist/analytics/utils.js +1 -1
  25. package/dist/ext/tslib/tslib.es6.mjs.js +1 -1
  26. package/dist/functions/api/customer/index.d.ts +5 -0
  27. package/dist/functions/api/customer/index.js +1 -1
  28. package/dist/functions/stores/cart/index.js +1 -1
  29. package/dist/functions/stores/customer/index.d.ts +149 -2
  30. package/dist/functions/stores/customer/index.js +1 -1
  31. package/dist/index.d.ts +0 -1
  32. package/dist/index.js +1 -1
  33. package/dist/packages/storefront-api/src/__api/mutations/unlinkExternalAccount.js +1 -0
  34. package/dist/packages/storefront-api/src/__api/queries/getExternalAccountLink.js +1 -0
  35. package/dist/packages/storefront-api/src/__api/queries/getMilesSmilesDetails.js +1 -0
  36. package/dist/storefront-api/src/__api/mutations/unlinkExternalAccount.d.ts +6 -0
  37. package/dist/storefront-api/src/__api/queries/getExternalAccountLink.d.ts +6 -0
  38. package/dist/storefront-api/src/__api/queries/getMilesSmilesDetails.d.ts +3 -0
  39. package/dist/storefront-api/src/__api/types/index.d.ts +18 -0
  40. package/dist/storefront-config/src/index.d.ts +2 -0
  41. package/dist/storefront-models/src/models/payment-gateway/index.d.ts +2 -0
  42. package/dist/storefront-models/src/models/storefront/index.d.ts +1 -0
  43. package/dist/utils/helper.d.ts +1 -0
  44. package/dist/utils/helper.js +1 -1
  45. package/package.json +1 -1
  46. package/dist/utils/loop-guard.d.ts +0 -43
  47. package/dist/utils/loop-guard.js +0 -1
@@ -12,6 +12,8 @@ export type IkasPaymentGateway = {
12
12
  description: string | null;
13
13
  logoUrl: string | null;
14
14
  masterPassClientId: string | null;
15
+ /** True when Miles&Smiles can be redeemed on this (TK_PAY) gateway. */
16
+ milesSmilesEnabled?: boolean | null;
15
17
  name: string;
16
18
  paymentGatewayProviderId: string | null;
17
19
  supportedCurrencies: string[] | null;
@@ -20,6 +20,7 @@ export type IkasStorefront = {
20
20
  analytics4Id: string | null;
21
21
  universalAnalyticsId: string | null;
22
22
  tiktokPixelId: string | null;
23
+ openAiPixelId?: string | null;
23
24
  token: string | null;
24
25
  type: IkasStorefrontType;
25
26
  metaTemplates: IkasStorefontMetaTemplates[] | null;
@@ -7,6 +7,7 @@ export declare function capitalize(value: string): string;
7
7
  export declare function tryForEach(items: any[], callback: (item: any, index: number) => void, printErrors?: boolean): void;
8
8
  export declare function formatDate(date: Date): string;
9
9
  export declare function getCookieValue(cookieName: string): string | null;
10
+ export declare function getOpenAiAttributionMetadata(): Record<string, string>;
10
11
  export declare function isClient(): boolean;
11
12
  export declare function isServer(): boolean;
12
13
  export declare function getQueryParams(): URLSearchParams | undefined;
@@ -1 +1 @@
1
- import{__spreadArray as r}from'./../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as n}from"../packages/storefront-config/src/index.js";import{reaction as t}from'./../ext/mobx/dist/mobx.esm.js';var e=function(r){return/^\+?\d+$/.test(r)},o=function(r){r=(r=r.replace(/^\s+|\s+$/g,"")).toLocaleLowerCase("tr-TR");for(var n="àáäâèéëêìíïîıòóöôùúüûñçşğ·/_,:;",t=0;t<31;t++)r=r.replace(new RegExp(n.charAt(t),"g"),"aaaaeeeeiiiiioooouuuuncsg------".charAt(t));return r=r.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")},a=function(r){return!(r.length>320)&&/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(r)};function i(r){return!!new Intl.DateTimeFormat(r,{hour:"numeric"}).format(0).match(/\s/)}function u(r,n,t){void 0===t&&(t=!1),r.forEach(function(r,e){try{n(r,e)}catch(r){t&&console.error(r)}})}function c(r){var t={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",hour12:!1},e=n.getCurrentLocale();return"undefined"!=typeof navigator?t.hour12=i(navigator.language):t.hour12=i(e),new Intl.DateTimeFormat(e,t).format(r)}function f(r){var n=document.cookie.split(";").find(function(n){return n.trim().startsWith("".concat(r,"="))});return n?n.split("=")[1]:null}function s(){return"undefined"!=typeof window}function l(){return!s()}function m(){if(s())return new URLSearchParams(location.search)}function p(){return!!s()&&(performance.getEntriesByType?"back_forward"===performance.getEntriesByType("navigation")[0].type:performance.navigation.type===performance.navigation.TYPE_BACK_FORWARD)}function g(r,n){void 0===n&&(n={arrayFormat:"comma"});for(var t=[],e=function(r,e){if(null==e)return"continue";Array.isArray(e)?"comma"===n.arrayFormat&&e.length>0?t.push("".concat(r,"=").concat(e.join(","))):e.forEach(function(n){return t.push("".concat(r,"=").concat(n))}):t.push("".concat(r,"=").concat(e))},o=0,a=Object.entries(r);o<a.length;o++){var i=a[o];e(i[0],i[1])}return t.length>0?"".concat(t.join("&")):""}function h(r){return null==r?r:JSON.parse(JSON.stringify(r))}function y(r,n){if(!r||!Array.isArray(r))return{};for(var t={},e=0,o=r;e<o.length;e++){var a=o[e],i=void 0;t[i=String("string"==typeof n?a[n]:"function"==typeof n?n(a):a)]||(t[i]=[]),t[i].push(a)}return t}function v(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return n&&Array.isArray(n)?(0===t.length&&(t=[function(r){return r}]),r([],n,!0).sort(function(r,n){for(var e=0,o=t;e<o.length;e++){var a=o[e],i=void 0,u=void 0;if("string"==typeof a?(i=r[a],u=n[a]):"function"==typeof a?(i=a(r),u=a(n)):(i=r,u=n),null!=i||null!=u){if(null==i)return 1;if(null==u)return-1;if(i<u)return-1;if(i>u)return 1}}return 0})):[]}function d(r,n){var t;return function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];clearTimeout(t),t=setTimeout(function(){return r.apply(void 0,e)},n)}}function A(r,n){return t(r,n)}export{h as cloneDeep,d as debounce,c as formatDate,f as getCookieValue,m as getQueryParams,y as groupBy,p as isBackNavigation,s as isClient,l as isServer,A as reaction,v as sortBy,o as stringToSlug,g as stringifyQueryParams,u as tryForEach,a as validateEmail,e as validatePhoneNumber};
1
+ import{__spreadArray as r,__assign as n}from'./../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as t}from"../packages/storefront-config/src/index.js";import{reaction as e}from'./../ext/mobx/dist/mobx.esm.js';var o=function(r){return/^\+?\d+$/.test(r)},a=function(r){r=(r=r.replace(/^\s+|\s+$/g,"")).toLocaleLowerCase("tr-TR");for(var n="àáäâèéëêìíïîıòóöôùúüûñçşğ·/_,:;",t=0;t<31;t++)r=r.replace(new RegExp(n.charAt(t),"g"),"aaaaeeeeiiiiioooouuuuncsg------".charAt(t));return r=r.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")},i=function(r){return!(r.length>320)&&/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(r)};function u(r){return!!new Intl.DateTimeFormat(r,{hour:"numeric"}).format(0).match(/\s/)}function c(r,n,t){void 0===t&&(t=!1),r.forEach(function(r,e){try{n(r,e)}catch(r){t&&console.error(r)}})}function f(r){var n={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",hour12:!1},e=t.getCurrentLocale();return"undefined"!=typeof navigator?n.hour12=u(navigator.language):n.hour12=u(e),new Intl.DateTimeFormat(e,n).format(r)}function s(r){var n=document.cookie.split(";").find(function(n){return n.trim().startsWith("".concat(r,"="))});return n?n.split("=")[1]:null}function l(){var r=s("__oppref"),t=s("__obref");return n(n({},r?{oppref:r}:{}),t?{obref:t}:{})}function m(){return"undefined"!=typeof window}function p(){return!m()}function g(){if(m())return new URLSearchParams(location.search)}function h(){return!!m()&&(performance.getEntriesByType?"back_forward"===performance.getEntriesByType("navigation")[0].type:performance.navigation.type===performance.navigation.TYPE_BACK_FORWARD)}function v(r,n){void 0===n&&(n={arrayFormat:"comma"});for(var t=[],e=function(r,e){if(null==e)return"continue";Array.isArray(e)?"comma"===n.arrayFormat&&e.length>0?t.push("".concat(r,"=").concat(e.join(","))):e.forEach(function(n){return t.push("".concat(r,"=").concat(n))}):t.push("".concat(r,"=").concat(e))},o=0,a=Object.entries(r);o<a.length;o++){var i=a[o];e(i[0],i[1])}return t.length>0?"".concat(t.join("&")):""}function y(r){return null==r?r:JSON.parse(JSON.stringify(r))}function d(r,n){if(!r||!Array.isArray(r))return{};for(var t={},e=0,o=r;e<o.length;e++){var a=o[e],i=void 0;t[i=String("string"==typeof n?a[n]:"function"==typeof n?n(a):a)]||(t[i]=[]),t[i].push(a)}return t}function A(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return n&&Array.isArray(n)?(0===t.length&&(t=[function(r){return r}]),r([],n,!0).sort(function(r,n){for(var e=0,o=t;e<o.length;e++){var a=o[e],i=void 0,u=void 0;if("string"==typeof a?(i=r[a],u=n[a]):"function"==typeof a?(i=a(r),u=a(n)):(i=r,u=n),null!=i||null!=u){if(null==i)return 1;if(null==u)return-1;if(i<u)return-1;if(i>u)return 1}}return 0})):[]}function _(r,n){var t;return function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];clearTimeout(t),t=setTimeout(function(){return r.apply(void 0,e)},n)}}function b(r,n){return e(r,n)}export{y as cloneDeep,_ as debounce,f as formatDate,s as getCookieValue,l as getOpenAiAttributionMetadata,g as getQueryParams,d as groupBy,h as isBackNavigation,m as isClient,p as isServer,b as reaction,A as sortBy,a as stringToSlug,v as stringifyQueryParams,c as tryForEach,i as validateEmail,o as validatePhoneNumber};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/bp-storefront",
3
- "version": "1.4.0-beta.192",
3
+ "version": "1.4.0-beta.193",
4
4
  "description": "A framework for the ikas blueprint storefronts.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
@@ -1,43 +0,0 @@
1
- /**
2
- * Guard against theme code that loops without ever yielding to the event loop.
3
- *
4
- * A MutationObserver callback that mutates the subtree it observes, a `queueMicrotask` chain, or a
5
- * `setState` inside a deps-less `useLayoutEffect` all re-queue themselves before the current task
6
- * ends, so the tab hard-freezes: no paint, no input. In the editor canvas that takes the whole
7
- * editor down with it; on a live store it takes the page down.
8
- *
9
- * The guard is installed by the HOST (storefront page entry, editor canvas) and never kills
10
- * anything: past the limit the work is DEMOTED to a macrotask. The endless loop becomes a loop that
11
- * yields, nothing is dropped, and a false positive costs a few milliseconds — which is what makes
12
- * it safe to put in front of third-party scripts too.
13
- *
14
- * Not covered, because there is nothing to intercept: `await` / promise-chain loops and plain
15
- * synchronous loops.
16
- */
17
- export declare const LOOP_GUARD_LIMIT = 1000;
18
- export declare const RENDER_LOOP_LIMIT = 100;
19
- export type LoopGuardTrip = {
20
- kind: "observer-loop" | "microtask-loop" | "render-loop";
21
- ownerName?: string;
22
- ownerId?: string;
23
- /**
24
- * Where the loop lives in the page — the observed node (observer-loop) or the component's root
25
- * (render-loop). The owner of the CODE may be a shared chunk; the DOM names the component.
26
- */
27
- element?: Element | null;
28
- };
29
- export type LoopGuardPair = [typeof MutationObserver, (callback: () => void) => void];
30
- type GuardWindow = {
31
- MutationObserver: typeof MutationObserver;
32
- MessageChannel: typeof MessageChannel;
33
- queueMicrotask: (callback: () => void) => void;
34
- setTimeout: (callback: () => void, ms: number) => unknown;
35
- };
36
- type PreactOptions = {
37
- __r?: (vnode: any) => void;
38
- };
39
- export declare function createLoopGuard(win: GuardWindow, onTrip: (trip: LoopGuardTrip) => void): {
40
- pair: (ownerName?: string, ownerId?: string) => LoopGuardPair;
41
- renders: (options: PreactOptions) => void;
42
- };
43
- export {};
@@ -1 +0,0 @@
1
- import{__extends as e}from'./../ext/tslib/tslib.es6.mjs.js';var n=1e3,t=100;function r(t,r){var o,a,i=t.MutationObserver,u=t.queueMicrotask.bind(t),c=t.setTimeout.bind(t),s=new t.MessageChannel,f=0,l=!1;s.port1.onmessage=function(){f+=1,l=!1},null===(a=(o=s.port1).unref)||void 0===a||a.call(o);var d=function(){return l||(l=!0,s.port2.postMessage(0)),f},v=0,p=function(e,n){var t=v;v=n;try{e()}finally{v=t}};return{pair:function(t,o){var a=!1;return[function(a){function i(e){var i,u=this,s=-1,f=0,l=!1;return(u=a.call(this,function(a,u){if(!l){var v=d();if(v!==s&&(s=v,f=0),(f+=1)<=n)return void e.call(u,a,u);l=!0,r({kind:"observer-loop",ownerName:t,ownerId:o,element:i})}c(function(){return e.call(u,a,u)},0)})||this).observe=function(e,n){i=1===e.nodeType?e:e.parentElement,a.prototype.observe.call(u,e,n)},u}return e(i,a),i}(i),function(e){var i=v+1;i<=n?u(function(){return p(e,i)}):(a||(a=!0,r({kind:"microtask-loop",ownerName:t,ownerId:o})),c(function(){return p(e,0)},0))}]},renders:function(e){var n=new WeakMap,t=new WeakSet,o=new WeakSet,a=e.__r;e.__r=function(e){var i=e.__c;if(i&&!t.has(i)){var u=d(),s=n.get(i);if(s&&s.epoch===u||(s={epoch:u,count:0},n.set(i,s)),s.count+=1,s.count>100){var f=[];t.add(i),i.setState=function(e,n){f.push([e,n])},o.has(i)||(o.add(i),r({kind:"render-loop",element:i.base})),c(function(){t.delete(i),delete i.setState,f.forEach(function(e){var n=e[0],t=e[1];return i.setState(n,t)})},0)}}a&&a(e)}}}}export{n as LOOP_GUARD_LIMIT,t as RENDER_LOOP_LIMIT,r as createLoopGuard};