@moonbase.sh/storefront 2.2.1 → 2.4.0

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 CHANGED
@@ -50,11 +50,22 @@ When you import from npm (`import Moonbase from '@moonbase.sh/storefront'`), `se
50
50
  The CDN loader recognises an `?mb_version=` query parameter for opting into a non-default storefront build on a per-page-load basis. This is intended for testing pre-release changes on a live merchant site without changing the embed code.
51
51
 
52
52
  - `?mb_version=next` — loads the latest `@next` snapshot from `/storefront/next/moonbase.js`
53
+ - `?mb_version=pr-<N>` — loads the snapshot from a labeled PR `<N>` from `/storefront/pr-<N>/moonbase.js` (only present while the PR carries the `release-snapshot` label)
53
54
  - `?mb_version=2.1.0` — pins to a specific published version from `/storefront/<version>/moonbase.js`
54
55
  - `?mb_version=latest` or omitted — loads the current stable release (default)
55
56
 
56
57
  Don't use this to pin a production embed to a specific version — pin the `<script src>` URL instead.
57
58
 
59
+ ## Host page requirements
60
+
61
+ The widget renders directly into the host page's DOM and inherits its viewport. For the widget to render correctly on mobile, the host page should declare a standard responsive viewport:
62
+
63
+ ```html
64
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
65
+ ```
66
+
67
+ Hosts that ship a fixed-width legacy mobile viewport (for example Wix's classic mobile sites use `<meta name="viewport" content="width=320, user-scalable=yes">`) cause the browser to upscale every CSS pixel on the page. The widget auto-detects this and counter-scales itself with CSS `zoom` to remain readable; opt out with `disableViewportCompensation: true` if you want the widget to match the host's upscaled density. On Wix specifically, mounting the widget into a contained element via `target` is also an option — it switches the drawer from a viewport overlay to an in-flow component and sidesteps the upscale entirely.
68
+
58
69
  ## Trigger intents
59
70
 
60
71
  Use intent methods to open specific views or execute actions:
@@ -322,6 +322,13 @@ declare interface MoonbaseOptions {
322
322
  cards: 'outlined' | 'shadow' | 'white';
323
323
  };
324
324
  target: HTMLElement | undefined;
325
+ /**
326
+ * When the host page declares a fixed-width mobile viewport (e.g. Wix's
327
+ * legacy `<meta name="viewport" content="width=320, ...">`), the browser
328
+ * upscales every CSS pixel to fit the device. Set this to `true` to opt out
329
+ * of the widget's automatic counter-scaling and match the host's density.
330
+ */
331
+ disableViewportCompensation: boolean;
325
332
  }
326
333
 
327
334
  export declare const urlKey: InjectionKey<string>;