Commit caac755f authored by Daniele Berardo's avatar Daniele Berardo

Merge branch 'development' into 'master'

Development (1.4.41)

See merge request !38
parents 9af0eab3 ecac8737
Pipeline #190053288 passed with stages
in 14 minutes and 9 seconds
{
"name": "@tecnojest/widget-base",
"version": "1.4.40",
"version": "1.4.41",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......@@ -5984,7 +5984,6 @@
"resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz",
"integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==",
"dev": true,
"optional": true,
"requires": {
"arr-union": "^3.1.0",
"define-property": "^0.2.5",
......@@ -5997,10 +5996,15 @@
"resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
"integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
"dev": true,
"optional": true,
"requires": {
"is-descriptor": "^0.1.0"
}
},
"isobject": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
"integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
"dev": true
}
}
},
......
{
"name": "@tecnojest/widget-base",
"author": "Tecnojest srl https://www.invidea.it",
"version": "1.4.40",
"version": "1.4.41",
"publishConfig": {
"registry": "https://npm.invidea.it"
},
......
......@@ -75,7 +75,7 @@ export default class EmbeddableWidget {
static packageJson: PackageJson = require('../package.json');
private static setClassName({ props }: { props: Props }): void {
const { className } = props.options;
const { className } = props;
EmbeddableWidget.options.className = parseClassName(className);
}
......@@ -185,8 +185,8 @@ export default class EmbeddableWidget {
const options: Options = {
...EmbeddableWidget.INITIAL_OPTIONS,
...EmbeddableWidget.options,
...defaultOptionsFromProps,
...EmbeddableWidget.options,
...this.Widget.options,
...newOptions,
};
......
......@@ -42,7 +42,6 @@ describe('React rendering', () => {
static options = {
appendFooter: false,
appendTooltip: false,
className: 'custom',
};
render() {
......@@ -52,11 +51,7 @@ describe('React rendering', () => {
render(Widget, UID);
const widget = document.getElementById('widget');
expect(widget.parentElement.className).toEqual('custom');
expect(document.querySelector('footer')).toBeFalsy();
expect(document.querySelector('#widget-base-tooltip__container')).toBeFalsy();
expect(document.querySelector('.widget-base-tooltip__container')).toBeFalsy();
});
});
......@@ -14,7 +14,7 @@ function render(Widget, uid) {
EmbeddableWidget.Engine = {
createElement: (props) => {
return <Widget {...props} />;
return <Widget {...props} className={process.env.WIDGET_MAIN_CSS_CLASS} />;
},
render: (component, el) => ReactDOM.render(component, el),
unmountComponentAtNode: (node) => ReactDOM.unmountComponentAtNode(node),
......
......@@ -179,6 +179,11 @@ const defaultConfig = {
// configFile: path.join(__dirname, '.eslintrc')
// },
// },
{
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto',
},
{
test: /\.(scss|css)$/,
exclude: excluded_css_files,
......@@ -255,7 +260,7 @@ const defaultConfig = {
},
devtool: 'source-map',
resolve: {
extensions: ['*', '.ts', '.tsx', '.js', '.jsx'],
extensions: ['*', '.mjs', '.ts', '.tsx', '.js', '.jsx'],
// https://medium.com/@penx/managing-dependencies-in-a-node-package-so-that-they-are-compatible-with-npm-link-61befa5aaca7
alias: {
react: path.resolve('./node_modules/react'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment