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

@uifabric/styling

Package Overview
Dependencies
Maintainers
3
Versions
422
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uifabric/styling - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

lib/interfaces/IFabricConfig.d.ts

14

CHANGELOG.json

@@ -5,2 +5,16 @@ {

{
"version": "0.4.0",
"tag": "@uifabric/styling_v0.4.0",
"date": "Tue, 30 May 2017 20:23:45 GMT",
"comments": {
"minor": [
{
"author": "David Zearing <dzearing@microsoft.com>",
"commit": "494141224cddf73bf46e21addb9c2d8354148f67",
"comment": "Adding support for specifying `window.FabricConfig.fontBaseUrl` in order to customize where the font resources are pulled from. Leaving it blank will avoid fontface definitions from being registered."
}
]
}
},
{
"version": "0.3.0",

@@ -7,0 +21,0 @@ "tag": "@uifabric/styling_v0.3.0",

9

CHANGELOG.md
# Change Log - @uifabric/styling
This log was last generated on Tue, 30 May 2017 03:27:20 GMT and should not be manually modified.
This log was last generated on Tue, 30 May 2017 20:23:45 GMT and should not be manually modified.
## 0.4.0
Tue, 30 May 2017 20:23:45 GMT
### Minor changes
- Adding support for specifying `window.FabricConfig.fontBaseUrl` in order to customize where the font resources are pulled from. Leaving it blank will avoid fontface definitions from being registered.
## 0.3.0

@@ -6,0 +13,0 @@ Tue, 30 May 2017 03:27:20 GMT

2

dist/999a39fc-2e41-878c-eeb6-f8d33c5e46cf.manifest.json

@@ -5,3 +5,3 @@ {

"componentType": "Library",
"version": "0.2.0",
"version": "0.3.0",
"manifestVersion": 2,

@@ -8,0 +8,0 @@ "loaderConfig": {

@@ -6,4 +6,3 @@ "use strict";

// Default urls.
var DefaultFontUrl = 'https://static2.sharepointonline.com/files/fabric/assets/fonts';
var DefaultIconUrl = 'https://static2.sharepointonline.com/files/fabric/assets/icons';
var DefaultBaseUrl = 'https://static2.sharepointonline.com/files/fabric/assets';
// Fallback fonts, if specified system or web fonts are unavailable.

@@ -121,5 +120,5 @@ var FontFamilyFallbacks = "-apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif";

fontFamily: _getFontFamily(),
'-moz-osx-font-smoothing': 'grayscale',
'-ms-high-contrast-adjust': 'none',
'-webkit-font-smoothing': 'antialiased',
MozOsxFontSmoothing: 'grayscale',
MsHighContrastAdjust: 'none',
WebkitFontSmoothing: 'antialiased',
fontSize: size,

@@ -139,5 +138,5 @@ fontWeight: weight

}
function _registerFontFaceSet(fontFamily, cdnFolder, cdnFontName) {
function _registerFontFaceSet(baseUrl, fontFamily, cdnFolder, cdnFontName) {
if (cdnFontName === void 0) { cdnFontName = 'segoeui'; }
var urlBase = DefaultFontUrl + "/" + cdnFolder + "/" + cdnFontName;
var urlBase = baseUrl + "/" + cdnFolder + "/" + cdnFontName;
_registerFontFace(fontFamily, urlBase + '-light', FontWeights.light);

@@ -149,22 +148,40 @@ _registerFontFace(fontFamily, urlBase + '-semilight', FontWeights.semilight);

function _registerDefaultFontFaces() {
// Produce @font-face definitions for all supported web fonts.
_registerFontFaceSet(FontNameThai, 'leelawadeeui-thai', 'leelawadeeui');
_registerFontFaceSet(FontNameArabic, 'segoeui-arabic');
_registerFontFaceSet(FontNameCyrillic, 'segoeui-cyrillic');
_registerFontFaceSet(FontNameEastEuropean, 'segoeui-easteuropean');
_registerFontFaceSet(FontNameGreek, 'segoeui-greek');
_registerFontFaceSet(FontNameHebrew, 'segoeui-hebrew');
_registerFontFaceSet(FontNameVietnamese, 'segoeui-vietnamese');
_registerFontFaceSet(FontNameWestEuropean, 'segoeui-westeuropean');
_registerFontFaceSet(FontFamilySelawik, 'selawik', 'selawik');
// Leelawadee UI (Thai) does not have a 'light' weight, so we override
// the font-face generated above to use the 'semilight' weight instead.
_registerFontFace('Leelawadee UI Web', DefaultFontUrl + "/leelawadeeui-thai/leelawadeeui-semilight", FontWeights.light);
// Leelawadee UI (Thai) does not have a 'semibold' weight, so we override
// the font-face generated above to use the 'bold' weight instead.
_registerFontFace('Leelawadee UI Web', DefaultFontUrl + "/leelawadeeui-thai/leelawadeeui-bold", FontWeights.semibold);
_registerFontFace('FabricMDL2Icons', DefaultIconUrl + '/fabricmdl2icons', FontWeights.regular);
var baseUrl = _getFontBaseUrl();
if (baseUrl) {
var fontUrl = baseUrl + "/fonts";
var iconUrl = baseUrl + "/icons";
// Produce @font-face definitions for all supported web fonts.
_registerFontFaceSet(fontUrl, FontNameThai, 'leelawadeeui-thai', 'leelawadeeui');
_registerFontFaceSet(fontUrl, FontNameArabic, 'segoeui-arabic');
_registerFontFaceSet(fontUrl, FontNameCyrillic, 'segoeui-cyrillic');
_registerFontFaceSet(fontUrl, FontNameEastEuropean, 'segoeui-easteuropean');
_registerFontFaceSet(fontUrl, FontNameGreek, 'segoeui-greek');
_registerFontFaceSet(fontUrl, FontNameHebrew, 'segoeui-hebrew');
_registerFontFaceSet(fontUrl, FontNameVietnamese, 'segoeui-vietnamese');
_registerFontFaceSet(fontUrl, FontNameWestEuropean, 'segoeui-westeuropean');
_registerFontFaceSet(fontUrl, FontFamilySelawik, 'selawik', 'selawik');
// Leelawadee UI (Thai) does not have a 'light' weight, so we override
// the font-face generated above to use the 'semilight' weight instead.
_registerFontFace('Leelawadee UI Web', fontUrl + "/leelawadeeui-thai/leelawadeeui-semilight", FontWeights.light);
// Leelawadee UI (Thai) does not have a 'semibold' weight, so we override
// the font-face generated above to use the 'bold' weight instead.
_registerFontFace('Leelawadee UI Web', fontUrl + "/leelawadeeui-thai/leelawadeeui-bold", FontWeights.semibold);
// Register icon urls.
_registerFontFace('FabricMDL2Icons', iconUrl + "/fabricmdl2icons", FontWeights.regular);
}
}
/**
* Reads the fontBaseUrl from window.FabricConfig.fontBaseUrl or falls back to a default.
*/
function _getFontBaseUrl() {
var win = index_1.getWindow();
// tslint:disable-next-line:no-string-literal
var fabricConfig = win ? win['FabricConfig'] : undefined;
return (fabricConfig && fabricConfig.fontBaseUrl !== undefined) ? fabricConfig.fontBaseUrl : DefaultBaseUrl;
}
/**
* Register the font faces.
*/
_registerDefaultFontFaces();
//# sourceMappingURL=DefaultFontStyles.js.map
{
"files": {
"packages/styling/CHANGELOG.json": "ebfc4208353d40c4ab65d1119557362c84b01a55",
"packages/styling/CHANGELOG.md": "a4f9596629357bfbe6fa2aac8729fb5d0ebbbf41",
"packages/styling/CHANGELOG.json": "e53e015ee2b45c3cb969db1cc73b784148872cf3",
"packages/styling/CHANGELOG.md": "aa8cb1df800df235b7ecf9996288788267e2768b",
"packages/styling/README.md": "793b76a8d1e8ba29a382526c492972beea3dc535",

@@ -11,3 +11,3 @@ "packages/styling/config/api-extractor.json": "9c294e8c13388f8d28d5aa10408fc68cf74723be",

"packages/styling/index.html": "df2218fe1ab9aa3e7b2208487831f853308c9623",
"packages/styling/package.json": "d78c3753793e22ef25277e1170003c7a8ecf5a76",
"packages/styling/package.json": "8af655286ed87e98a4050e15618bc85a19db9b4f",
"packages/styling/src/classNames/AnimationClassNames.ts": "1b073c8ebeedeb817255ba6249fb1ad0cec5e37f",

@@ -39,2 +39,3 @@ "packages/styling/src/classNames/ColorClassNames.ts": "64c3d578a59208d7baf844663b61737fab24599f",

"packages/styling/src/interfaces/IAnimationStyles.ts": "edc39d6fafd02dc44c803e9d632212c70f119b8f",
"packages/styling/src/interfaces/IFabricConfig.ts": "3988edf4073c940f4375f8f1210af3b4c101bb66",
"packages/styling/src/interfaces/IFontStyles.ts": "4c6ddb9343ae8d20b34bda044bd557ee5fe9f677",

@@ -51,3 +52,3 @@ "packages/styling/src/interfaces/IPalette.ts": "73dc4e77fc4a27c8810d7f9eca2119b1812d601f",

"packages/styling/src/styles/AnimationStyles.ts": "968541748f5b0fecf0000abcf4483d54828b7437",
"packages/styling/src/styles/DefaultFontStyles.ts": "69a296e143e202d6ac779138ea84096d668b7e0a",
"packages/styling/src/styles/DefaultFontStyles.ts": "36a969bce9341c58ce658b510b1ef32efdc7c470",
"packages/styling/src/styles/DefaultPalette.ts": "68adf43165d029a3505b8ace2350ac428e781345",

@@ -70,3 +71,3 @@ "packages/styling/src/styles/IconCodes.ts": "1461a370e495b78c2815a2afc53c6ed85e183583",

".npmrc": "825c83e09df4dad076d980d1236c532d689edf75",
".travis.yml": "f03070e42cf275afd77b06260790215415ced1e8",
".travis.yml": "7927295fb720c249e50b72ac68c11188278403d2",
".vscode/launch.json": "43d411bfaede0d6857676339f267e6443724887e",

@@ -84,10 +85,5 @@ ".vscode/settings.json": "ed39f2d27033f522f08c3bc0d4ac061234e728d4",

"apps/component-demo/webpack.config.js": "3fb1f0a32ca1a71376b0261bd16dd3cc7b298c52",
"common/changes/beta-core-6_2017-04-24-19-30.json": "bda762b60a0ce05b162b6a0c5b3c1b6adf72975b",
"common/changes/detailsList-initialFocusedIndexOnMountedRows_2017-05-23-06-30.json": "aa68bc39d3d8cf08f1c1309ee21d07fc679e6dc1",
"common/changes/groupedDetailsListSelectionFixes_2017-05-18-14-34.json": "1b8a656c1aef5a8bb59a9647c040bab4e2104852",
"common/changes/introduce-prop-types_2017-05-23-04-28.json": "72e8e70b89d06edc6461e146444df7d59daed463",
"common/changes/joem-textfield-add-setSelectRange_2017-05-18-21-16.json": "0fbd6def72719b9a0bfc21fe15550025a8d0496d",
"common/changes/listimprovements_2017-05-25-23-31.json": "422a94faa0a90518eadf66ceec053f88aba55688",
"common/changes/resizegroup-optimize-shrink_2017-05-26-21-04.json": "3be096ea38bc2d9eb641a0ef447022dab724ff7f",
"common/changes/styling-updates_2017-05-27-00-02.json": "228334a892b42602ddc7c2caaeb07d42f913cf01",
"common/changes/@uifabric/styling/fontface-config_2017-05-30-18-57.json": "68ba50f3e6bb14c72a91b7a73fc8448bd2d5fd8f",
"common/changes/office-ui-fabric-react/fontface-config_2017-05-30-18-57.json": "bdac204cd2e2e65615f2859b0c8718c39921c598",
"common/changes/v-krbrow-peoplepicker-changes_2017-05-23-17-54.json": "2ee084d9e2e77a0b312a059c120f87603e3e3e92",
"common/config/rush/npm-shrinkwrap.json": "90ef2722f8972efb7e91012705a30215d35d11a3",

@@ -114,3 +110,3 @@ "common/config/rush/pinned-versions.json": "ad579bbec3fc5818c68c3783d63231ae9da5091a",

},
"arguments": "D:\\agents\\1\\_work\\22\\s\\common\\temp\\node_modules\\.bin\\gulp --color --production"
"arguments": "D:\\agents\\2\\_work\\11\\s\\common\\temp\\node_modules\\.bin\\gulp --color --production"
}
{
"name": "@uifabric/styling",
"version": "0.3.0",
"version": "0.4.0",
"description": "Defines the core Office UI Fabric styles through a JavaScript interface.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

import { IFontStyles, IRawStyle } from '../interfaces/index';
import { fontFace } from '../glamorExports';
import {
getLanguage
getLanguage,
getWindow
} from '@uifabric/utilities/lib/index';
import { IFabricConfig } from '../interfaces/IFabricConfig';
// Default urls.
const DefaultFontUrl = 'https://static2.sharepointonline.com/files/fabric/assets/fonts';
const DefaultIconUrl = 'https://static2.sharepointonline.com/files/fabric/assets/icons';
const DefaultBaseUrl = 'https://static2.sharepointonline.com/files/fabric/assets';

@@ -131,5 +132,5 @@ // Fallback fonts, if specified system or web fonts are unavailable.

fontFamily: _getFontFamily(),
'-moz-osx-font-smoothing': 'grayscale',
'-ms-high-contrast-adjust': 'none',
'-webkit-font-smoothing': 'antialiased',
MozOsxFontSmoothing: 'grayscale',
MsHighContrastAdjust: 'none',
WebkitFontSmoothing: 'antialiased',
fontSize: size,

@@ -158,2 +159,3 @@ fontWeight: weight

function _registerFontFaceSet(
baseUrl: string,
fontFamily: string,

@@ -163,3 +165,3 @@ cdnFolder: string,

): void {
const urlBase = `${DefaultFontUrl}/${cdnFolder}/${cdnFontName}`;
const urlBase = `${baseUrl}/${cdnFolder}/${cdnFontName}`;

@@ -173,24 +175,47 @@ _registerFontFace(fontFamily, urlBase + '-light', FontWeights.light);

function _registerDefaultFontFaces(): void {
// Produce @font-face definitions for all supported web fonts.
_registerFontFaceSet(FontNameThai, 'leelawadeeui-thai', 'leelawadeeui');
_registerFontFaceSet(FontNameArabic, 'segoeui-arabic');
_registerFontFaceSet(FontNameCyrillic, 'segoeui-cyrillic');
_registerFontFaceSet(FontNameEastEuropean, 'segoeui-easteuropean');
_registerFontFaceSet(FontNameGreek, 'segoeui-greek');
_registerFontFaceSet(FontNameHebrew, 'segoeui-hebrew');
_registerFontFaceSet(FontNameVietnamese, 'segoeui-vietnamese');
_registerFontFaceSet(FontNameWestEuropean, 'segoeui-westeuropean');
_registerFontFaceSet(FontFamilySelawik, 'selawik', 'selawik');
const baseUrl = _getFontBaseUrl();
// Leelawadee UI (Thai) does not have a 'light' weight, so we override
// the font-face generated above to use the 'semilight' weight instead.
_registerFontFace('Leelawadee UI Web', `${DefaultFontUrl}/leelawadeeui-thai/leelawadeeui-semilight`, FontWeights.light);
if (baseUrl) {
const fontUrl = `${baseUrl}/fonts`;
const iconUrl = `${baseUrl}/icons`;
// Leelawadee UI (Thai) does not have a 'semibold' weight, so we override
// the font-face generated above to use the 'bold' weight instead.
_registerFontFace('Leelawadee UI Web', `${DefaultFontUrl}/leelawadeeui-thai/leelawadeeui-bold`, FontWeights.semibold);
// Produce @font-face definitions for all supported web fonts.
_registerFontFaceSet(fontUrl, FontNameThai, 'leelawadeeui-thai', 'leelawadeeui');
_registerFontFaceSet(fontUrl, FontNameArabic, 'segoeui-arabic');
_registerFontFaceSet(fontUrl, FontNameCyrillic, 'segoeui-cyrillic');
_registerFontFaceSet(fontUrl, FontNameEastEuropean, 'segoeui-easteuropean');
_registerFontFaceSet(fontUrl, FontNameGreek, 'segoeui-greek');
_registerFontFaceSet(fontUrl, FontNameHebrew, 'segoeui-hebrew');
_registerFontFaceSet(fontUrl, FontNameVietnamese, 'segoeui-vietnamese');
_registerFontFaceSet(fontUrl, FontNameWestEuropean, 'segoeui-westeuropean');
_registerFontFaceSet(fontUrl, FontFamilySelawik, 'selawik', 'selawik');
_registerFontFace('FabricMDL2Icons', DefaultIconUrl + '/fabricmdl2icons', FontWeights.regular);
// Leelawadee UI (Thai) does not have a 'light' weight, so we override
// the font-face generated above to use the 'semilight' weight instead.
_registerFontFace('Leelawadee UI Web', `${fontUrl}/leelawadeeui-thai/leelawadeeui-semilight`, FontWeights.light);
// Leelawadee UI (Thai) does not have a 'semibold' weight, so we override
// the font-face generated above to use the 'bold' weight instead.
_registerFontFace('Leelawadee UI Web', `${fontUrl}/leelawadeeui-thai/leelawadeeui-bold`, FontWeights.semibold);
// Register icon urls.
_registerFontFace('FabricMDL2Icons', `${iconUrl}/fabricmdl2icons`, FontWeights.regular);
}
}
_registerDefaultFontFaces();
/**
* Reads the fontBaseUrl from window.FabricConfig.fontBaseUrl or falls back to a default.
*/
function _getFontBaseUrl(): string {
let win = getWindow();
// tslint:disable-next-line:no-string-literal
let fabricConfig: IFabricConfig = win ? win['FabricConfig'] : undefined;
return (fabricConfig && fabricConfig.fontBaseUrl !== undefined) ? fabricConfig.fontBaseUrl : DefaultBaseUrl;
}
/**
* Register the font faces.
*/
_registerDefaultFontFaces();

@@ -1534,3 +1534,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

"componentType": "Library",
"version": "0.2.0",
"version": "0.3.0",
"manifestVersion": 2,

@@ -1537,0 +1537,0 @@ "loaderConfig": {

@@ -6,3 +6,3 @@ [

"componentType": "Library",
"version": "0.2.0",
"version": "0.3.0",
"manifestVersion": 2,

@@ -9,0 +9,0 @@ "loaderConfig": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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