Skip to content

Commit

Permalink
Making it working with Wp 6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
widoz committed Aug 20, 2023
1 parent 26ffb00 commit 1d42e0b
Show file tree
Hide file tree
Showing 5 changed files with 263 additions and 213 deletions.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
"yarn": "^1.22.19"
},
"dependencies": {
"@emotion/styled": "^11.10.5",
"@wordpress/api-fetch": "^6.21.0",
"@wordpress/components": "^23.1.0",
"@wordpress/core-data": "^6.12.0",
"@wordpress/element": "^5.1.0",
"@wordpress/i18n": "^4.24.0",
"immutable": "^4.3.0",
"react": "^18.2.0",
"react-select": "^5.7.0"
"@emotion/styled": "~11.10.5",
"@wordpress/api-fetch": "~6.21.0",
"@wordpress/components": "~23.1.0",
"@wordpress/core-data": "~6.12.0",
"@wordpress/element": "~5.1.0",
"@wordpress/i18n": "~4.24.0",
"immutable": "~4.3.0",
"react": "~18.2.0",
"react-select": "~5.7.0"
},
"scripts": {
"wp-env": "wp-env",
Expand Down
1 change: 0 additions & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ function autoload(string $projectRoot): void
return $package;
}


\add_action(
'plugins_loaded',
fn() => package()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
window.addEventListener('DOMContentLoaded', () => {
document.addEventListener('DOMContentLoaded', () => {
const { wp, entitiesSearch } = window;

const { createElement } = wp.element;
Expand All @@ -7,14 +7,14 @@ window.addEventListener('DOMContentLoaded', () => {
const { Spinner } = wp.components;

const {
PostTypesSelect,
PostTypeSelect,
useQueryViewablePostTypes,
convertPostTypesToControlOptions,
} = entitiesSearch;

// TODO Check why the object form does not work.
registerBlockType('widoz-entities-search/post-types-example-block', {
apiVersion: 3,
apiVersion: 2,
title: 'Post Types Example Block',
category: 'uncategorized',
icon: 'wordpress',
Expand All @@ -33,7 +33,7 @@ window.addEventListener('DOMContentLoaded', () => {
return createElement(
'div',
blockProps,
createElement(PostTypesSelect, {
createElement(PostTypeSelect, {
options: convertPostTypesToControlOptions(
options.records()
),
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const baseConfiguration = require('@wordpress/scripts/config/webpack.config');
const DependencyExtractionWebpackPlugin = require('@wordpress/dependency-extraction-webpack-plugin');
const path = require('path');
console.log('baseConfiguration', baseConfiguration.devtool);

module.exports = {
...baseConfiguration,
entry: './sources/js/src/index.ts',
Expand Down
Loading

0 comments on commit 1d42e0b

Please sign in to comment.