@moonbase.sh/storefront 2.2.0 → 2.3.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 +10 -0
- package/dist/moonbase.d.ts +7 -0
- package/dist/moonbase.js +4762 -4678
- package/dist/moonbase.umd.cjs +15 -15
- package/dist-loader/moonbase.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,6 +55,16 @@ The CDN loader recognises an `?mb_version=` query parameter for opting into a no
|
|
|
55
55
|
|
|
56
56
|
Don't use this to pin a production embed to a specific version — pin the `<script src>` URL instead.
|
|
57
57
|
|
|
58
|
+
## Host page requirements
|
|
59
|
+
|
|
60
|
+
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:
|
|
61
|
+
|
|
62
|
+
```html
|
|
63
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
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.
|
|
67
|
+
|
|
58
68
|
## Trigger intents
|
|
59
69
|
|
|
60
70
|
Use intent methods to open specific views or execute actions:
|
package/dist/moonbase.d.ts
CHANGED
|
@@ -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>;
|