@expo/webpack-pwa-manifest-plugin
Version:
Generates a progressive web app (PWA) manifest.json from a React Native app.json
58 lines • 1.87 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const Errors_1 = require("../Errors");
// CSS can target this with https://developer.mozilla.org/en-US/docs/Web/CSS/@media/display-mode
const VALID_DISPLAY_TYPES = [
/**
* Opens the web application without any browser UI and takes up the entirety of the available display area.
* Fallback to: `standalone`
*/
'fullscreen',
/**
* Opens the web app to look and feel like a standalone native app. The app runs in its own window, separate from the browser, and hides standard browser UI elements like the URL bar, etc.
* Fallback to: `minimal-ui`
*/
'standalone',
/**
* This mode is similar to fullscreen, but provides the user with some means to access a minimal set of UI elements for controlling navigation (i.e., back, forward, reload, etc).
* > Note: Only supported by Chrome on mobile.
* Fallback to: `browser`
*/
'minimal-ui',
/**
* A standard browser experience.
*/
'browser',
];
const presets = {
dir: ['ltr', 'rtl', 'auto'],
orientation: [
'any',
'natural',
'landscape',
'landscape-primary',
'landscape-secondary',
'portrait',
'portrait-primary',
'portrait-secondary',
'omit',
],
display: VALID_DISPLAY_TYPES,
crossorigin: ['anonymous', 'use-credentials'],
};
function hasPreset(key, value) {
// @ts-ignore
return presets[key].includes(value);
}
function default_1(config, ...properties) {
if (!config)
return;
for (let property of properties) {
let value = config[property];
if (value && !hasPreset(property, value)) {
throw new Errors_1.PresetError(property, value);
}
}
}
exports.default = default_1;
//# sourceMappingURL=Presets.js.map
;