Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ausbom/typography

Package Overview
Dependencies
Maintainers
5
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ausbom/typography - npm Package Compare versions

Comparing version 0.4.6 to 0.5.0

6

lib/FontProvider.js

@@ -1,1 +0,5 @@

"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.loadFonts=exports["default"]=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable});keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(source),true).forEach(function(key){(0,_defineProperty2["default"])(target,key,source[key])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}}return target}var webFontConfig={custom:{families:["Inter:n4,n6"],urls:["https://rsms.me/inter/inter.css"]}};var FontProvider=/*#__PURE__*/function(){function FontProvider(){(0,_classCallCheck2["default"])(this,FontProvider)}(0,_createClass2["default"])(FontProvider,null,[{key:"getStatus",value:function getStatus(){return FontProvider.status}},{key:"setStatus",value:function setStatus(nextStatus){return Object.assign(FontProvider.status,_objectSpread({},nextStatus))}},{key:"checkFonts",value:function checkFonts(){var _FontProvider$getStat=FontProvider.getStatus(),active=_FontProvider$getStat.active,inactive=_FontProvider$getStat.inactive,loading=_FontProvider$getStat.loading;if(typeof Window==="undefined"){console.warn("Typography: can not load fonts, window is not defined");return false}if(inactive){return false}if(!active&&!loading){FontProvider.loadFonts()}return true}},{key:"loadFonts",value:function(){var _loadFonts=(0,_asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(){return _regenerator["default"].wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:return _context.abrupt("return",new Promise(function(resolve,reject){var WebFont=require("webfontloader");var WebFontTypographyConfig=_objectSpread({active:function active(){resolve(FontProvider.setStatus({active:true,inactive:false,loading:false}))},inactive:function inactive(){reject(FontProvider.setStatus({active:false,inactive:true,loading:false}))},loading:function loading(){FontProvider.setStatus({active:false,inactive:false,loading:true})}},webFontConfig);WebFont.load(WebFontTypographyConfig)}));case 1:case"end":return _context.stop();}}},_callee)}));function loadFonts(){return _loadFonts.apply(this,arguments)}return loadFonts}()}]);return FontProvider}();exports["default"]=FontProvider;(0,_defineProperty2["default"])(FontProvider,"status",{active:false,inactive:false,loading:false});var loadFonts=function loadFonts(){return FontProvider.loadFonts()};exports.loadFonts=loadFonts;
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.loadFonts=exports["default"]=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable});keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(source),true).forEach(function(key){(0,_defineProperty2["default"])(target,key,source[key])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}}return target}var webFontConfig={custom:{families:["Inter:n4,n6"],urls:["https://rsms.me/inter/inter.css"]}};/**
* @deprecated since version 0.4.7, use fonts from `inter-ui` npm package pre-bundled in @ausbom/typography
*/var FontProvider=/*#__PURE__*/function(){function FontProvider(){(0,_classCallCheck2["default"])(this,FontProvider)}(0,_createClass2["default"])(FontProvider,null,[{key:"getStatus",value:function getStatus(){return FontProvider.status}},{key:"setStatus",value:function setStatus(nextStatus){return Object.assign(FontProvider.status,_objectSpread({},nextStatus))}},{key:"checkFonts",value:function checkFonts(){var _FontProvider$getStat=FontProvider.getStatus(),active=_FontProvider$getStat.active,inactive=_FontProvider$getStat.inactive,loading=_FontProvider$getStat.loading;if(typeof Window==="undefined"){console.warn("Typography: can not load fonts, window is not defined");return false}if(inactive){return false}if(!active&&!loading){FontProvider.loadFonts()}return true}},{key:"loadFonts",value:function(){var _loadFonts=(0,_asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(){return _regenerator["default"].wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:console.warn("FontProvider.loadFonts()","@deprecated since version 0.4.7, use fonts from `inter-ui` npm package pre-bundled in @ausbom/typography");return _context.abrupt("return",new Promise(function(resolve,reject){var WebFont=require("webfontloader");var WebFontTypographyConfig=_objectSpread({active:function active(){resolve(FontProvider.setStatus({active:true,inactive:false,loading:false}))},inactive:function inactive(){reject(FontProvider.setStatus({active:false,inactive:true,loading:false}))},loading:function loading(){FontProvider.setStatus({active:false,inactive:false,loading:true})}},webFontConfig);WebFont.load(WebFontTypographyConfig)}));case 2:case"end":return _context.stop();}}},_callee)}));function loadFonts(){return _loadFonts.apply(this,arguments)}return loadFonts}()}]);return FontProvider}();/**
* @deprecated since version 0.4.7, use fonts from `inter-ui` npm package pre-bundled in @ausbom/typography
*/exports["default"]=FontProvider;(0,_defineProperty2["default"])(FontProvider,"status",{active:false,inactive:false,loading:false});var loadFonts=function loadFonts(){FontProvider.loadFonts()};exports.loadFonts=loadFonts;

6

package.json
{
"name": "@ausbom/typography",
"version": "0.4.6",
"version": "0.5.0",
"description": "",

@@ -42,7 +42,7 @@ "keywords": [],

"dependencies": {
"@ausbom/styles": "^0.13.0",
"@ausbom/styles": "^0.14.0",
"classnames": "^2.3.1",
"webfontloader": "1.6.28"
},
"gitHead": "fb700e0e3fdab1b33a91603366afa9bb05cfc2f2"
"gitHead": "0d927930f3ccc9deda53763261ce8238e3b16cbd"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc