UNPKG

repoweaver

Version:

A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies

1 lines 16.3 kB
{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/objectSpread2\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"writingDirection\"];\nimport { atomic, classic, inline } from \"./compiler\";\nimport { createSheet } from \"./dom\";\nimport { localizeStyle } from 'styleq/transform-localize-style';\nimport { preprocess } from \"./preprocess\";\nimport { styleq } from 'styleq';\nimport { validate } from \"./validate\";\nimport canUseDOM from \"../../modules/canUseDom\";\nvar staticStyleMap = new WeakMap();\nvar sheet = createSheet();\nvar defaultPreprocessOptions = {\n shadow: true,\n textShadow: true\n};\nfunction customStyleq(styles, options) {\n if (options === void 0) {\n options = {};\n }\n var _options = options,\n writingDirection = _options.writingDirection,\n preprocessOptions = _objectWithoutPropertiesLoose(_options, _excluded);\n var isRTL = writingDirection === 'rtl';\n return styleq.factory({\n transform: function transform(style) {\n var compiledStyle = staticStyleMap.get(style);\n if (compiledStyle != null) {\n return localizeStyle(compiledStyle, isRTL);\n }\n return preprocess(style, _objectSpread(_objectSpread({}, defaultPreprocessOptions), preprocessOptions));\n }\n })(styles);\n}\nfunction insertRules(compiledOrderedRules) {\n compiledOrderedRules.forEach(function (_ref) {\n var rules = _ref[0],\n order = _ref[1];\n if (sheet != null) {\n rules.forEach(function (rule) {\n sheet.insert(rule, order);\n });\n }\n });\n}\nfunction compileAndInsertAtomic(style) {\n var _atomic = atomic(preprocess(style, defaultPreprocessOptions)),\n compiledStyle = _atomic[0],\n compiledOrderedRules = _atomic[1];\n insertRules(compiledOrderedRules);\n return compiledStyle;\n}\nfunction compileAndInsertReset(style, key) {\n var _classic = classic(style, key),\n compiledStyle = _classic[0],\n compiledOrderedRules = _classic[1];\n insertRules(compiledOrderedRules);\n return compiledStyle;\n}\nvar absoluteFillObject = {\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n};\nvar absoluteFill = create({\n x: _objectSpread({}, absoluteFillObject)\n}).x;\nfunction create(styles) {\n Object.keys(styles).forEach(function (key) {\n var styleObj = styles[key];\n if (styleObj != null && styleObj.$$css !== true) {\n var compiledStyles;\n if (key.indexOf('$raw') > -1) {\n compiledStyles = compileAndInsertReset(styleObj, key.split('$raw')[0]);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n validate(styleObj);\n styles[key] = Object.freeze(styleObj);\n }\n compiledStyles = compileAndInsertAtomic(styleObj);\n }\n staticStyleMap.set(styleObj, compiledStyles);\n }\n });\n return styles;\n}\nfunction compose(style1, style2) {\n if (process.env.NODE_ENV !== 'production') {\n var len = arguments.length;\n if (len > 2) {\n var readableStyles = Array.prototype.slice.call(arguments).map(function (a) {\n return flatten(a);\n });\n throw new Error(\"StyleSheet.compose() only accepts 2 arguments, received \" + len + \": \" + JSON.stringify(readableStyles));\n }\n }\n return [style1, style2];\n}\nfunction flatten() {\n for (var _len = arguments.length, styles = new Array(_len), _key = 0; _key < _len; _key++) {\n styles[_key] = arguments[_key];\n }\n var flatArray = styles.flat(Infinity);\n var result = {};\n for (var i = 0; i < flatArray.length; i++) {\n var style = flatArray[i];\n if (style != null && typeof style === 'object') {\n Object.assign(result, style);\n }\n }\n return result;\n}\nfunction getSheet() {\n return {\n id: sheet.id,\n textContent: sheet.getTextContent()\n };\n}\nfunction StyleSheet(styles, options) {\n if (options === void 0) {\n options = {};\n }\n var isRTL = options.writingDirection === 'rtl';\n var styleProps = customStyleq(styles, options);\n if (Array.isArray(styleProps) && styleProps[1] != null) {\n styleProps[1] = inline(styleProps[1], isRTL);\n }\n return styleProps;\n}\nStyleSheet.absoluteFill = absoluteFill;\nStyleSheet.absoluteFillObject = absoluteFillObject;\nStyleSheet.create = create;\nStyleSheet.compose = compose;\nStyleSheet.flatten = flatten;\nStyleSheet.getSheet = getSheet;\nStyleSheet.hairlineWidth = 1;\nif (canUseDOM && window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {\n window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle = StyleSheet.flatten;\n}\nvar stylesheet = StyleSheet;\nexport default stylesheet;","map":{"version":3,"names":["_objectSpread","_objectWithoutPropertiesLoose","_excluded","atomic","classic","inline","createSheet","localizeStyle","preprocess","styleq","validate","canUseDOM","staticStyleMap","WeakMap","sheet","defaultPreprocessOptions","shadow","textShadow","customStyleq","styles","options","_options","writingDirection","preprocessOptions","isRTL","factory","transform","style","compiledStyle","get","insertRules","compiledOrderedRules","forEach","_ref","rules","order","rule","insert","compileAndInsertAtomic","_atomic","compileAndInsertReset","key","_classic","absoluteFillObject","position","left","right","top","bottom","absoluteFill","create","x","Object","keys","styleObj","$$css","compiledStyles","indexOf","split","process","env","NODE_ENV","freeze","set","compose","style1","style2","len","arguments","length","readableStyles","Array","prototype","slice","call","map","a","flatten","Error","JSON","stringify","_len","_key","flatArray","flat","Infinity","result","i","assign","getSheet","id","textContent","getTextContent","StyleSheet","styleProps","isArray","hairlineWidth","window","__REACT_DEVTOOLS_GLOBAL_HOOK__","resolveRNStyle","stylesheet"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-web/dist/exports/StyleSheet/index.js"],"sourcesContent":["import _objectSpread from \"@babel/runtime/helpers/objectSpread2\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"writingDirection\"];\n/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nimport { atomic, classic, inline } from './compiler';\nimport { createSheet } from './dom';\nimport { localizeStyle } from 'styleq/transform-localize-style';\nimport { preprocess } from './preprocess';\nimport { styleq } from 'styleq';\nimport { validate } from './validate';\nimport canUseDOM from '../../modules/canUseDom';\nvar staticStyleMap = new WeakMap();\nvar sheet = createSheet();\nvar defaultPreprocessOptions = {\n shadow: true,\n textShadow: true\n};\nfunction customStyleq(styles, options) {\n if (options === void 0) {\n options = {};\n }\n var _options = options,\n writingDirection = _options.writingDirection,\n preprocessOptions = _objectWithoutPropertiesLoose(_options, _excluded);\n var isRTL = writingDirection === 'rtl';\n return styleq.factory({\n transform(style) {\n var compiledStyle = staticStyleMap.get(style);\n if (compiledStyle != null) {\n return localizeStyle(compiledStyle, isRTL);\n }\n return preprocess(style, _objectSpread(_objectSpread({}, defaultPreprocessOptions), preprocessOptions));\n }\n })(styles);\n}\nfunction insertRules(compiledOrderedRules) {\n compiledOrderedRules.forEach(_ref => {\n var rules = _ref[0],\n order = _ref[1];\n if (sheet != null) {\n rules.forEach(rule => {\n sheet.insert(rule, order);\n });\n }\n });\n}\nfunction compileAndInsertAtomic(style) {\n var _atomic = atomic(preprocess(style, defaultPreprocessOptions)),\n compiledStyle = _atomic[0],\n compiledOrderedRules = _atomic[1];\n insertRules(compiledOrderedRules);\n return compiledStyle;\n}\nfunction compileAndInsertReset(style, key) {\n var _classic = classic(style, key),\n compiledStyle = _classic[0],\n compiledOrderedRules = _classic[1];\n insertRules(compiledOrderedRules);\n return compiledStyle;\n}\n\n/* ----- API ----- */\n\nvar absoluteFillObject = {\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n};\nvar absoluteFill = create({\n x: _objectSpread({}, absoluteFillObject)\n}).x;\n\n/**\n * create\n */\nfunction create(styles) {\n Object.keys(styles).forEach(key => {\n var styleObj = styles[key];\n // Only compile at runtime if the style is not already compiled\n if (styleObj != null && styleObj.$$css !== true) {\n var compiledStyles;\n if (key.indexOf('$raw') > -1) {\n compiledStyles = compileAndInsertReset(styleObj, key.split('$raw')[0]);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n validate(styleObj);\n styles[key] = Object.freeze(styleObj);\n }\n compiledStyles = compileAndInsertAtomic(styleObj);\n }\n staticStyleMap.set(styleObj, compiledStyles);\n }\n });\n return styles;\n}\n\n/**\n * compose\n */\nfunction compose(style1, style2) {\n if (process.env.NODE_ENV !== 'production') {\n /* eslint-disable prefer-rest-params */\n var len = arguments.length;\n if (len > 2) {\n var readableStyles = [...arguments].map(a => flatten(a));\n throw new Error(\"StyleSheet.compose() only accepts 2 arguments, received \" + len + \": \" + JSON.stringify(readableStyles));\n }\n /* eslint-enable prefer-rest-params */\n /*\n console.warn(\n 'StyleSheet.compose(a, b) is deprecated; use array syntax, i.e., [a,b].'\n );\n */\n }\n return [style1, style2];\n}\n\n/**\n * flatten\n */\nfunction flatten() {\n for (var _len = arguments.length, styles = new Array(_len), _key = 0; _key < _len; _key++) {\n styles[_key] = arguments[_key];\n }\n var flatArray = styles.flat(Infinity);\n var result = {};\n for (var i = 0; i < flatArray.length; i++) {\n var style = flatArray[i];\n if (style != null && typeof style === 'object') {\n // $FlowFixMe\n Object.assign(result, style);\n }\n }\n return result;\n}\n\n/**\n * getSheet\n */\nfunction getSheet() {\n return {\n id: sheet.id,\n textContent: sheet.getTextContent()\n };\n}\n\n/**\n * resolve\n */\n\nfunction StyleSheet(styles, options) {\n if (options === void 0) {\n options = {};\n }\n var isRTL = options.writingDirection === 'rtl';\n var styleProps = customStyleq(styles, options);\n if (Array.isArray(styleProps) && styleProps[1] != null) {\n styleProps[1] = inline(styleProps[1], isRTL);\n }\n return styleProps;\n}\nStyleSheet.absoluteFill = absoluteFill;\nStyleSheet.absoluteFillObject = absoluteFillObject;\nStyleSheet.create = create;\nStyleSheet.compose = compose;\nStyleSheet.flatten = flatten;\nStyleSheet.getSheet = getSheet;\n// `hairlineWidth` is not implemented using screen density as browsers may\n// round sub-pixel values down to `0`, causing the line not to be rendered.\nStyleSheet.hairlineWidth = 1;\nif (canUseDOM && window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {\n window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle = StyleSheet.flatten;\n}\nvar stylesheet = StyleSheet;\nexport default stylesheet;"],"mappings":"AAAA,OAAOA,aAAa,MAAM,sCAAsC;AAChE,OAAOC,6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