Skip to content

Commit 9e89cf2

Browse files
committed
chore(deps): update dependencies
1 parent cb9ca71 commit 9e89cf2

File tree

10 files changed

+56
-56
lines changed

10 files changed

+56
-56
lines changed

bun.lockb

5.66 KB
Binary file not shown.

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import mheob from '@mheob/eslint-config';
22

33
export default mheob({
4-
ignores: ['CHANGELOG.md', 'src/languages/*'],
4+
ignores: ['.github/*', 'CHANGELOG.md', 'CONTRIBUTING.md', 'src/languages/*'],
55
});

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,33 +45,33 @@
4545
"devDependencies": {
4646
"@cspell/dict-de-de": "^4.0.0",
4747
"@mheob/commitlint-config": "^1.1.2",
48-
"@mheob/eslint-config": "^6.1.1",
48+
"@mheob/eslint-config": "^6.1.3",
4949
"@mheob/prettier-config": "^3.3.1",
50-
"@wordpress/babel-preset-default": "^8.6.0",
51-
"@wordpress/block-editor": "^14.1.0",
52-
"@wordpress/blocks": "^13.6.0",
53-
"@wordpress/components": "^28.6.0",
54-
"@wordpress/compose": "^7.6.0",
55-
"@wordpress/element": "^6.6.0",
56-
"@wordpress/i18n": "^5.6.0",
57-
"@wordpress/postcss-plugins-preset": "^5.6.0",
50+
"@wordpress/babel-preset-default": "^8.7.0",
51+
"@wordpress/block-editor": "^14.2.0",
52+
"@wordpress/blocks": "^13.7.0",
53+
"@wordpress/components": "^28.7.0",
54+
"@wordpress/compose": "^7.7.0",
55+
"@wordpress/element": "^6.7.0",
56+
"@wordpress/i18n": "^5.7.0",
57+
"@wordpress/postcss-plugins-preset": "^5.7.0",
5858
"babel-loader": "^9.1.3",
5959
"bestzip": "^2.2.1",
6060
"commitizen": "^4.3.0",
6161
"copy-webpack-plugin": "^12.0.2",
6262
"cpr": "^3.0.1",
6363
"cspell": "^8.14.2",
6464
"css-loader": "^7.1.2",
65-
"cssnano": "^7.0.5",
65+
"cssnano": "^7.0.6",
6666
"cz-git": "^1.9.4",
6767
"eslint": "^9.9.1",
6868
"husky": "^9.1.5",
69-
"lint-staged": "^15.2.9",
69+
"lint-staged": "^15.2.10",
7070
"mini-css-extract-plugin": "^2.9.1",
7171
"postcss-loader": "^8.1.1",
7272
"prettier": "^3.3.3",
7373
"rimraf": "^6.0.1",
74-
"sass": "^1.77.8",
74+
"sass": "^1.78.0",
7575
"sass-loader": "^16.0.1",
7676
"source-map-loader": "^5.0.0",
7777
"terser-webpack-plugin": "^5.3.10",

prettier.config.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import defaultConfig from '@mheob/prettier-config';
2-
31
/** @type {import('prettier').Options} */
4-
export default defaultConfig;
2+
3+
export { default } from '@mheob/prettier-config';

readme.txt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ All three variants are supported. For the "old" widgets from [fussball.de](https
3636

3737
== Frequently Asked Questions ==
3838

39-
4039
= Where can I get the website key (old version) =
4140

4241
You can get the required key from fussball.de in your widgets (<https://www.fussball.de/account.admin.widgets>). In the overview of your widget you will find the item `Website key`. This is the required character string.
@@ -47,21 +46,23 @@ You can obtain the required data from next.fussball.de in your widgets (<https:/
4746

4847
`
4948
<div
50-
class="soccer_widget"
49+
class="fussballde_widget"
5150
data-id="299e1496-abcd-abcd-1234-8880c7270477"
52-
data-type="table"
51+
data-type="table"
5352
/>
5453
`
5554

5655
= How should I write the shortcode (old variant) =
5756

58-
`[fubade api="{32-digit API}" notice="{Note}" fullWidth={iframe in full width} devtools={output of the DevTools}]` e.g. like this: `[fubade api="020EXXXXXG000000VS54XXXXXSGIXXME" notice="Standings U19" fullWidth=true devtools=false]`
59-
The fields `notice`, `fullWidth` and `devtools` are optional and do not have to be set.
57+
Like this: `[fubade api="{32-digit API}" notice="{Note}" fullWidth={iframe in full width} devtools={output of the DevTools}]`
58+
e.g. like this: `[fubade api="020EXXXXXG000000VS54XXXXXSGIXXME" notice="Standings U19" fullWidth=true devtools=false]`
59+
The fields "notice", "fullWidth" and "devtools" are optional and do not have to be set.
6060

6161
= How should I write the shortcode (new variant) =
6262

63-
`[fubade api="{36-digit data-id}" type="{data-type}" notice="{notice}" fullWidth={iframe in full width} devtools={output of the DevTools}]` e.g.`[fubade api="299e1496-abcd-abcd-1234-8880c7270477" notice="Standings U19" fullWidth=true devtools=false]`
64-
The fields `notice`, `fullWidth` and `devtools` are optional and do not have to be set.
63+
Like this: `[fubade api="{36-digit data-id}" type="{data-type}" notice="{notice}" fullWidth={iframe in full width} devtools={output of the DevTools}]`
64+
e.g.`[fubade api="299e1496-abcd-abcd-1234-8880c7270477" type="table" notice="Standings U19" fullWidth=true devtools=false]`
65+
The fields "notice", "fullWidth" and "devtools" are optional and do not have to be set.
6566

6667
= What is the `api` (old: `{32-digit API}`) =
6768

src/Blocks/fubade/index.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ registerBlockType('ifdw/fubade', {
112112
)
113113
: __('No debugging information were outputted.', 'include-fussball-de-widgets')
114114
}
115-
onChange={isDevTools => {
116-
setAttributes({ devtools: isDevTools });
115+
onChange={isDevelopmentTools => {
116+
setAttributes({ devtools: isDevelopmentTools });
117117
}}
118118
checked={devtools}
119119
label={__('Show some information for debugging', 'include-fussball-de-widgets')}
@@ -124,7 +124,7 @@ registerBlockType('ifdw/fubade', {
124124
<div className={className} key="output">
125125
<h4 className={`${className}__header`}>
126126
{__('Fussball.de Widget', 'include-fussball-de-widgets')}
127-
{typeof notice === 'undefined' || notice === '' ? '' : `: "${notice}"`}
127+
{notice === undefined || notice === '' ? '' : `: "${notice}"`}
128128
</h4>
129129

130130
<div className={`${className}__main`}>
@@ -135,7 +135,7 @@ registerBlockType('ifdw/fubade', {
135135
setAttributes({
136136
api: newApi,
137137
id: `fubade-${instanceId}-${
138-
apiLength === newApi.length ? newApi.slice(-5) : `ERROR_${Number(new Date())}`
138+
apiLength === newApi.length ? newApi.slice(-5) : `ERROR_${Date.now()}`
139139
}`,
140140
});
141141
}}
@@ -145,7 +145,7 @@ registerBlockType('ifdw/fubade', {
145145
value={api}
146146
/>
147147

148-
{typeof api !== 'undefined' && api.length === apiUUIDLength && (
148+
{api !== undefined && api.length === apiUUIDLength && (
149149
<>
150150
<label htmlFor={`${inputId}-type`}>
151151
{__('Type:', 'include-fussball-de-widgets')}
@@ -164,8 +164,7 @@ registerBlockType('ifdw/fubade', {
164164
)}
165165
</div>
166166

167-
{typeof api !== 'undefined' &&
168-
(apiLength === api.length || api.length === apiUUIDLength) ? (
167+
{api !== undefined && (apiLength === api.length || api.length === apiUUIDLength) ? (
169168
<div className={`${className}__footer`}>
170169
{__(
171170
'The widget should now be able to be displayed in the frontend.',

src/assets/js/fubade-api.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import './fubade-api.legacy.js';
1717
}
1818

1919
function initializeWidget(container) {
20-
const widgetId = container.getAttribute('data-id');
21-
const widgetType = container.getAttribute('data-type');
20+
const widgetId = container.dataset.id;
21+
const widgetType = container.dataset.type;
2222

2323
if (container && widgetId) {
2424
const iframeName = `${generateSecureRandomId(4)}_fussballde_widget-${widgetId}`;
@@ -30,7 +30,7 @@ import './fubade-api.legacy.js';
3030
iframe.setAttribute('frameborder', '0');
3131
iframe.setAttribute('scrolling', 'no');
3232

33-
container.appendChild(iframe);
33+
container.append(iframe);
3434

3535
window.addEventListener('message', function (event) {
3636
if (
@@ -47,10 +47,10 @@ import './fubade-api.legacy.js';
4747
}
4848

4949
function loadWidgets() {
50-
const containers = Array.from(document.getElementsByClassName(containerClass));
51-
containers.forEach(element => {
50+
const containers = [...document.querySelectorAll(containerClass)];
51+
for (const element of containers) {
5252
initializeWidget(element);
53-
});
53+
}
5454
}
5555

5656
if (document.readyState === 'loading') {

src/assets/js/fubade-api.legacy.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22
/* eslint-disable no-console */
33

44
window.fussballDeWidgetAPI = () => {
5-
const devTools = typeof attr !== 'undefined' && !!attr.devtools;
5+
const developmentTools = typeof attr !== 'undefined' && Boolean(attr.devtools);
66

77
window.addEventListener(
88
'message',
9-
evt => {
10-
if (devTools) {
11-
console.info('window.fussballDeWidgetAPI -> evt.data.container', evt.data.container);
9+
event => {
10+
if (developmentTools) {
11+
console.info('window.fussballDeWidgetAPI -> evt.data.container', event_.data.container);
1212
}
1313

14-
const currentIframe = document.querySelector(`#${evt.data.container} iframe`);
14+
const currentIframe = document.querySelector(`#${event_.data.container} iframe`);
1515

1616
if (!currentIframe) return;
1717

18-
if (evt.data.type === 'setHeight') {
19-
currentIframe.setAttribute('height', `${evt.data.value}px`);
18+
if (event.data.type === 'setHeight') {
19+
currentIframe.setAttribute('height', `${event_.data.value}px`);
2020
currentIframe.style.height = '';
2121
currentIframe.style.minHeight = '200px';
2222
}
2323

24-
if (evt.data.type === 'setWidth') {
24+
if (event_.data.type === 'setWidth') {
2525
if (currentIframe.getAttribute('width') !== '100%') {
26-
currentIframe.setAttribute('width', `${evt.data.value}px`);
26+
currentIframe.setAttribute('width', `${event_.data.value}px`);
2727
}
2828

2929
currentIframe.style.width = '';
@@ -47,25 +47,26 @@ window.fussballDeWidgetAPI = () => {
4747
'.et_pb_tabs_controls a, .fusion-tabs a.tab-link, .kt-tabs-title-list a, .su-spoiler-title, .vc_tta-tab a, .omsc-tabs-control a, .elementor-tab-title, .elementor-toggle',
4848
);
4949
if (tabs.length > 0) {
50-
Array.from(tabs).forEach(tab => {
50+
for (const tab of tabs) {
5151
tab.addEventListener(
5252
'click',
5353
() => {
5454
const iFrames = document.querySelectorAll('iframe');
5555
setTimeout(
56-
Array.from(iFrames).forEach(iFrame => {
56+
// eslint-disable-next-line unicorn/no-array-for-each
57+
[...iFrames].forEach(iFrame => {
5758
iFrame.src += '';
5859
}),
5960
700,
6061
);
61-
if (devTools) {
62+
if (developmentTools) {
6263
console.info('window.fussballDeWidgetAPI -> tab', tab);
6364
console.info('window.fussballDeWidgetAPI -> iFrames', iFrames);
6465
}
6566
},
6667
false,
6768
);
68-
});
69+
}
6970
}
7071
}
7172
};

tasks/cp-dev-release.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable no-console */
1+
/* eslint-disable no-console, unicorn/prevent-abbreviations */
22

33
import os from 'node:os';
44
import path from 'node:path';
@@ -11,11 +11,11 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
1111
const homedir = os.homedir();
1212

1313
const source = path.join(__dirname, '..', '/dist');
14-
const dest = path.join(
14+
const destination = path.join(
1515
homedir,
1616
'/dev/DevKinsta/public/default-test-environment/wp-content/plugins/include-fussball-de-widgets',
1717
);
1818

19-
cpr(source, dest, { deleteFirst: true }, () => {
20-
console.log(`Copy the compiled files from ${source} to ${dest}`);
19+
cpr(source, destination, { deleteFirst: true }, () => {
20+
console.log(`Copy the compiled files from ${source} to ${destination}`);
2121
});

webpack.config.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
const path = require('node:path');
22
const process = require('node:process');
33

4+
const postcssPlugins = require('@wordpress/postcss-plugins-preset');
5+
const CopyPlugin = require('copy-webpack-plugin');
46
const MiniCSSExtractPlugin = require('mini-css-extract-plugin');
57
const TerserPlugin = require('terser-webpack-plugin');
6-
const CopyPlugin = require('copy-webpack-plugin');
7-
const postcssPlugins = require('@wordpress/postcss-plugins-preset');
88

99
const isProduction = process.env.NODE_ENV === 'production';
1010

@@ -52,7 +52,7 @@ const commonConfig = {
5252
name(module, chunks, cacheGroupKey) {
5353
return `${cacheGroupKey}-${chunks[0].name}`;
5454
},
55-
test: /[\\/]style(\.module)?\.(sc|sa|c)ss$/,
55+
test: /[/\\]style(\.module)?\.(sc|sa|c)ss$/,
5656
type: 'css/mini-extract',
5757
},
5858
},

0 commit comments

Comments
 (0)