@heycater/qualification-funnel 1.3.4 → 1.3.6

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/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import { default as default_2 } from 'react';
2
2
 
3
3
  export declare type FunnelMode = 'embedded' | 'fullscreen';
4
4
 
5
- export declare function QualificationFunnel({ apiEndpoint, googleMapsApiKey, locale, storageKey, onBackground, highlightColor, mode, onCancel, }: QualificationFunnelProps): default_2.JSX.Element | null;
5
+ export declare function QualificationFunnel({ apiEndpoint, googleMapsApiKey, locale, storageKey, onBackground, highlightColor, mode, onCancel, assetBaseUrl, }: QualificationFunnelProps): default_2.JSX.Element | null;
6
6
 
7
7
  export declare interface QualificationFunnelProps {
8
8
  apiEndpoint?: string;
@@ -13,6 +13,7 @@ export declare interface QualificationFunnelProps {
13
13
  highlightColor?: 'primary' | 'secondary';
14
14
  mode?: FunnelMode;
15
15
  onCancel?: () => void;
16
+ assetBaseUrl?: string;
16
17
  }
17
18
 
18
19
  export { }
package/dist/index.esm.js CHANGED
@@ -4316,6 +4316,9 @@ const DEFAULT_CONFIG = {
4316
4316
  mode: "embedded"
4317
4317
  };
4318
4318
  let assetsBaseUrl = null;
4319
+ function setAssetsBaseUrl(url) {
4320
+ assetsBaseUrl = url.replace(/\/$/, "");
4321
+ }
4319
4322
  function getAssetUrl(path) {
4320
4323
  if (assetsBaseUrl === null) {
4321
4324
  assetsBaseUrl = detectAssetsBaseUrl();
@@ -9479,7 +9482,7 @@ const EmbeddedQuestionLayout = ({
9479
9482
  /* @__PURE__ */ jsxs(
9480
9483
  WrapperBox$1,
9481
9484
  {
9482
- position: isFullscreen ? "inherit" : isMobile ? "inherit" : "absolute",
9485
+ position: "inherit",
9483
9486
  width: "100%",
9484
9487
  flexGrow: 1,
9485
9488
  display: "flex",
@@ -29438,6 +29441,7 @@ const fetchRatings = async () => {
29438
29441
  }
29439
29442
  return ratings;
29440
29443
  };
29444
+ const DEFAULT_ASSET_BASE_URL = "https://cdn.jsdelivr.net/npm/@heycater/qualification-funnel@latest/dist";
29441
29445
  function QualificationFunnel({
29442
29446
  apiEndpoint = "https://api.heycater.com/graphql",
29443
29447
  googleMapsApiKey = "",
@@ -29446,18 +29450,20 @@ function QualificationFunnel({
29446
29450
  onBackground = "light",
29447
29451
  highlightColor = "primary",
29448
29452
  mode = "embedded",
29449
- onCancel
29453
+ onCancel,
29454
+ assetBaseUrl = DEFAULT_ASSET_BASE_URL
29450
29455
  }) {
29451
29456
  const [ratings, setRatings] = useState(null);
29452
29457
  const [initialized, setInitialized] = useState(false);
29453
29458
  useEffect(() => {
29459
+ setAssetsBaseUrl(assetBaseUrl);
29454
29460
  initConfig({
29455
29461
  graphqlEndpoint: apiEndpoint,
29456
29462
  googleMapsApiKey,
29457
29463
  locale: locale2
29458
29464
  });
29459
29465
  setInitialized(true);
29460
- }, [apiEndpoint, googleMapsApiKey, locale2]);
29466
+ }, [apiEndpoint, googleMapsApiKey, locale2, assetBaseUrl]);
29461
29467
  useEffect(() => {
29462
29468
  if (initialized) {
29463
29469
  fetchRatings().then(setRatings).catch(console.error);