Skip to content
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

2.4.0 #382

Merged
merged 2 commits into from
Dec 6, 2020
Merged

2.4.0 #382

Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 2.4.0

- Allow already injected to be reset ([#380](https://github.com/Khan/aphrodite/pull/380))
- Add TypeScript export for flushToStyleTag ([#379](https://github.com/Khan/aphrodite/pull/379))
- Make parameter typings for StyleSheet.create more typed ([#375](https://github.com/Khan/aphrodite/pull/375))
- Add a more explicit error message when someone tries to pass a plain object instead of a stylesheet into the css() method ([#349](https://github.com/Khan/aphrodite/pull/349))
- Roll up inline-style-prefixer ([#364](https://github.com/Khan/aphrodite/pull/364))
- Update inline-style-prefixer 5.0.4 → 5.1.0 ([#373](https://github.com/Khan/aphrodite/pull/373))
- Fix examples ([#367](https://github.com/Khan/aphrodite/pull/367))

# 2.3.1

- Use deep import for inline-style-prefixer ([#363](https://github.com/Khan/aphrodite/pull/363))
Expand Down
37 changes: 28 additions & 9 deletions dist/aphrodite.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,18 +256,18 @@ var importantify = function importantify(string
);
};

var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};

function unwrapExports (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x.default : x;
}

function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}

function getCjsExportFromNamespace (n) {
return n && n['default'] || n;
return n && n.default || n;
}

// Use the fastest means possible to execute a task in its own turn, with
Expand Down Expand Up @@ -1632,7 +1632,7 @@ var staticData = {
"wrapThrough": ms,
"wrapMargin": ms,
"touchAction": ms,
"textSizeAdjust": ["ms", "Webkit"],
"textSizeAdjust": wms,
"borderImage": w,
"borderImageOutset": w,
"borderImageRepeat": w,
Expand Down Expand Up @@ -2204,6 +2204,11 @@ var reset = function reset() {
isBuffering = false;
styleTag = null;
};
var resetInjectedStyle = function resetInjectedStyle(key
/* : string */
) {
delete alreadyInjected[key];
};
var startBuffering = function startBuffering() {
if (isBuffering) {
throw new Error("Cannot buffer while already buffering");
Expand Down Expand Up @@ -2242,6 +2247,12 @@ var addRenderedClassNames = function addRenderedClassNames(classNames
});
};

var isValidStyleDefinition = function isValidStyleDefinition(def
/* : Object */
) {
return "_definition" in def && "_name" in def && "_len" in def;
};

var processStyleDefinitions = function processStyleDefinitions(styleDefinitions
/* : any[] */
, classNameBits
Expand All @@ -2260,10 +2271,12 @@ var processStyleDefinitions = function processStyleDefinitions(styleDefinitions
if (Array.isArray(styleDefinitions[i])) {
// We've encountered an array, so let's recurse
length += processStyleDefinitions(styleDefinitions[i], classNameBits, definitionBits, length);
} else {
} else if (isValidStyleDefinition(styleDefinitions[i])) {
classNameBits.push(styleDefinitions[i]._name);
definitionBits.push(styleDefinitions[i]._definition);
length += styleDefinitions[i]._len;
} else {
throw new Error("Invalid Style Definition: Styles should be defined using the StyleSheet.create method.");
}
}
}
Expand Down Expand Up @@ -2463,7 +2476,9 @@ function makeExports(useImportant
},
flushToStyleTag: flushToStyleTag,
injectAndGetClassName: injectAndGetClassName,
defaultSelectorHandlers: defaultSelectorHandlers
defaultSelectorHandlers: defaultSelectorHandlers,
reset: reset,
resetInjectedStyle: resetInjectedStyle
};
}

Expand All @@ -2477,13 +2492,17 @@ var StyleSheet$1 = Aphrodite.StyleSheet,
minify = Aphrodite.minify,
flushToStyleTag$1 = Aphrodite.flushToStyleTag,
injectAndGetClassName$1 = Aphrodite.injectAndGetClassName,
defaultSelectorHandlers$1 = Aphrodite.defaultSelectorHandlers;
defaultSelectorHandlers$1 = Aphrodite.defaultSelectorHandlers,
reset$1 = Aphrodite.reset,
resetInjectedStyle$1 = Aphrodite.resetInjectedStyle;

exports.StyleSheet = StyleSheet$1;
exports.StyleSheetServer = StyleSheetServer$1;
exports.StyleSheetTestUtils = StyleSheetTestUtils$1;
exports.css = css;
exports.defaultSelectorHandlers = defaultSelectorHandlers$1;
exports.minify = minify;
exports.flushToStyleTag = flushToStyleTag$1;
exports.injectAndGetClassName = injectAndGetClassName$1;
exports.minify = minify;
exports.defaultSelectorHandlers = defaultSelectorHandlers$1;
exports.reset = reset$1;
exports.resetInjectedStyle = resetInjectedStyle$1;
35 changes: 27 additions & 8 deletions dist/aphrodite.umd.js

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

Loading