Skip to content

Use identical version of is-mobile in stackgl modules and src code #6494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 30 additions & 44 deletions stackgl_modules/index.js
Original file line number Diff line number Diff line change
@@ -1810,6 +1810,35 @@ function BufferBigIntNotDefined() {

/***/ }),

/***/ 2321:
/***/ (function(module) {

"use strict";


module.exports = isMobile;
module.exports.isMobile = isMobile;
module.exports["default"] = isMobile;
var mobileRE = /(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i;
var notMobileRE = /CrOS/;
var tabletRE = /android|ipad|playbook|silk/i;
function isMobile(opts) {
if (!opts) opts = {};
var ua = opts.ua;
if (!ua && typeof navigator !== 'undefined') ua = navigator.userAgent;
if (ua && ua.headers && typeof ua.headers['user-agent'] === 'string') {
ua = ua.headers['user-agent'];
}
if (typeof ua !== 'string') return false;
var result = mobileRE.test(ua) && !notMobileRE.test(ua) || !!opts.tablet && tabletRE.test(ua);
if (!result && opts.tablet && opts.featureDetect && navigator && navigator.maxTouchPoints > 1 && ua.indexOf('Macintosh') !== -1 && ua.indexOf('Safari') !== -1) {
result = true;
}
return result;
}

/***/ }),

/***/ 3910:
/***/ (function(__unused_webpack_module, exports) {

@@ -20314,7 +20343,7 @@ var mouseChange = __webpack_require__(6145)
var perspective = __webpack_require__(1120)
var ortho = __webpack_require__(5268)
var createShader = __webpack_require__(8245)
var isMobile = __webpack_require__(2861)({ tablet: true, featureDetect: true })
var isMobile = __webpack_require__(2321)({ tablet: true, featureDetect: true })

module.exports = {
createScene: createScene,
@@ -30623,49 +30652,6 @@ function isSlowBuffer (obj) {
}


/***/ }),

/***/ 2861:
/***/ (function(module) {

"use strict";


module.exports = isMobile
module.exports.isMobile = isMobile
module.exports["default"] = isMobile

var mobileRE = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i

var tabletRE = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i

function isMobile (opts) {
if (!opts) opts = {}
var ua = opts.ua
if (!ua && typeof navigator !== 'undefined') ua = navigator.userAgent
if (ua && ua.headers && typeof ua.headers['user-agent'] === 'string') {
ua = ua.headers['user-agent']
}
if (typeof ua !== 'string') return false

var result = opts.tablet ? tabletRE.test(ua) : mobileRE.test(ua)

if (
!result &&
opts.tablet &&
opts.featureDetect &&
navigator &&
navigator.maxTouchPoints > 1 &&
ua.indexOf('Macintosh') !== -1 &&
ua.indexOf('Safari') !== -1
) {
result = true
}

return result
}


/***/ }),

/***/ 3596:
18 changes: 9 additions & 9 deletions stackgl_modules/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions stackgl_modules/package.json
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@
"gl-surface3d": "^1.6.0",
"glslify": "^7.1.1",
"incremental-convex-hull": "plotly/incremental-convex-hull#v1.1.0",
"is-mobile": "^3.1.1",
"matrix-camera-controller": "^2.1.4",
"ndarray": "plotly/ndarray#v1.1.0",
"ndarray-extract-contour": "plotly/ndarray-extract-contour#v1.1.0",
37 changes: 3 additions & 34 deletions stackgl_modules/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var path = require('path');
var NodePolyfillPlugin = require('node-polyfill-webpack-plugin');

var plotlyjsConfig = require('../webpack.config');

module.exports = {
target: ['web', 'es5'],
@@ -15,37 +16,5 @@ module.exports = {
optimization: {
minimize: false
},
module: {
rules: [{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
}, {
test: /\.js$/,
include: /node_modules[\\\/]buffer[\\\/]/,
use: {
loader: 'babel-loader',
options: {
babelrc: false,
configFile: false,
presets: [
'@babel/preset-env'
]
}
},
}, {
test: /\.glsl$/,
include: /node_modules/,
use: {
loader: 'raw-loader'
}
}, {
test: /\.(js|glsl)$/,
use: [
'ify-loader'
]
}]
}
module: plotlyjsConfig.module
};