diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index eb1505278..000000000
--- a/.babelrc
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "env": {
- "production": {
- "plugins": [
- ["react-remove-properties", {"properties": ["data-test"]}]
- ]
- }
- },
- "presets": [
- [
- "@babel/preset-env",
- {
- "targets": { "esmodules": true },
- "useBuiltIns": "usage",
- "corejs": "3.23.4"
- }
- ],
- "@babel/preset-react"
- ],
- "plugins": [
- "@babel/plugin-syntax-dynamic-import",
- "@babel/plugin-proposal-object-rest-spread",
- "@babel/plugin-proposal-class-properties"
- ]
-}
diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 000000000..0f1616700
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,4 @@
+.cache
+build
+node_modules
+vendor
\ No newline at end of file
diff --git a/.eslintrc b/.eslintrc
deleted file mode 100644
index 66e2ab81b..000000000
--- a/.eslintrc
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "parser": "@babel/eslint-parser",
- "extends": ["standard", "standard-jsx", "standard-react"],
- "globals": {
- "GFPDF": false,
- "Backbone": false,
- "jQuery": false,
- "gfpdf_migration_multisite_ids": false,
- "gf_vars": false,
- "tinyMCE": false,
- "gform": false,
- "ConditionalLogic": false,
- "GetFirstRuleField": false,
- "ToggleConditionalLogic": false,
- "GetRuleValuesDropDown": false,
- "QTags": false,
- "switchEditors": false,
- "getUserSetting": false,
- "wp": false,
- "gfMergeTagsObj": false,
- "form": false,
- "gform_initialize_tooltips": false,
- "_": false,
- "ClipboardJS": false
- },
- "ignorePatterns": ["versionCompare.js"]
-}
diff --git a/.eslintrc.js b/.eslintrc.js
new file mode 100644
index 000000000..57657cb06
--- /dev/null
+++ b/.eslintrc.js
@@ -0,0 +1,35 @@
+module.exports = {
+ root: true,
+ extends: [
+ 'plugin:@wordpress/eslint-plugin/recommended',
+ 'plugin:jest/recommended',
+ ],
+ globals: {
+ GFPDF: 'readonly',
+ Backbone: 'readonly',
+ jQuery: 'readonly',
+ gfpdf_migration_multisite_ids: 'readonly',
+ gf_vars: 'readonly',
+ tinyMCE: 'readonly',
+ gform: 'readonly',
+ ConditionalLogic: 'readonly',
+ GetFirstRuleField: 'readonly',
+ ToggleConditionalLogic: 'readonly',
+ GetRuleValuesDropDown: 'readonly',
+ QTags: 'readonly',
+ switchEditors: 'readonly',
+ getUserSetting: 'readonly',
+ wp: 'readonly',
+ gfMergeTagsObj: 'readonly',
+ form: 'readonly',
+ gform_initialize_tooltips: 'readonly',
+ _: 'readonly',
+ ClipboardJS: 'readonly',
+ },
+ rules: {
+ 'no-alert': 'off',
+ 'jest/no-done-callback': 'off',
+ camelcase: 'off',
+ 'jsdoc/empty-tags': ['off', { tags: ['package'] }],
+ },
+};
diff --git a/.github/README.md b/.github/README.md
index f483493b3..15058c16b 100644
--- a/.github/README.md
+++ b/.github/README.md
@@ -25,11 +25,11 @@ The Docker setup will create a fully functional development environment preconfi
1. Clone the repository using `git clone https://github.com/GravityPDF/gravity-pdf/` from the terminal
2. Copy and rename `.env.example` to `.env`, then replace `00000000000000000000000000000000` with a valid Gravity Forms license key
-3. Run `yarn && yarn build:production`
-4. Start Docker and then run `yarn env:install` to setup the local development environment
+3. Run `composer install`
+3. Run `yarn && yarn start`
5. Access a local development site at `http://localhost:8888` with the login `admin` and `password`.
-If you shut down Docker and want to fire up the environment later, use `yarn wp-env start`. You can reset the database back to its original state with `yarn wp-env clean all`. When all else fails, delete everything and start again with `yarn wp-env destroy`.
+You can reset the database back to its original state with `yarn wp-env clean all`. When all else fails, delete everything and start again with `yarn wp-env destroy`.
[See the WordPress Developer Handbook for more details about managing the docker environment](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/#wp-env-run-container-command).
@@ -39,26 +39,21 @@ X-Debug is enabled by default for step debugging and profiling. If you need to [
### Switch PHP Versions
-The default version that will be configured is PHP8.0. If you want to change this you can adjust the `phpVersion` value in the `.wp-env.json` file and then stop and start the environment with `yarn wp-env start`.
-
-## Setup without Docker
-
-If you would rather use your own development environment, you can build Gravity PDF using the following commands.
-
-1. Clone the repository using `git clone https://github.com/GravityPDF/gravity-pdf/`
-1. Run `yarn && yarn build:production`
-1. Run `composer install`
-1. Run `composer run prefix`
+The default version that will be configured is PHP8.3. If you want to change this you can adjust the `phpVersion` value in the `.wp-env.json` file and then stop and start the environment with `yarn wp-env start`.
## Building JavaScript
-If you are making changes to any of the JavaScript or CSS, run `yarn build:dev` to ensure the files automatically gets built when you make changes on the file system.
+If you are making changes to any of the JavaScript or CSS, run `yarn dev` to ensure the files automatically gets built when you make changes on the file system.
## Linting
-To lint your JS code use `yarn lint:js`, and to try automatically fix it use `yarn lint:js:fix`.
+To lint your:
+
+1. JS code using `yarn lint:js`
+2. CSS code using `yarn lint:css`
+3. PHP code using `composer lint`
-To lint your PHP code, use `composer lint`, and to try automatically fix it use `composer lint:fix`.
+You can auto-fix many issues with `yarn format` and `composer lint:fix`.
## Automated Tests
diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml
index 503cec4d9..bf67e2707 100644
--- a/.github/workflows/coding-standards.yml
+++ b/.github/workflows/coding-standards.yml
@@ -47,7 +47,7 @@ jobs:
- name: Install Composer dependencies
run: |
- composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction
+ composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction --no-scripts
echo "${PWD}/vendor/bin" >> $GITHUB_PATH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml
index d07660a94..996ffb7a7 100644
--- a/.github/workflows/end-to-end-tests.yml
+++ b/.github/workflows/end-to-end-tests.yml
@@ -81,16 +81,23 @@ jobs:
php -i
locale -a
- - name: Install Dependencies
+ - name: Install Composer dependencies
+ run: |
+ composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction --no-scripts
+ echo "${PWD}/vendor/bin" >> $GITHUB_PATH
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Install JS Dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install
- name: Build Gravity PDF
- run: yarn build:production
+ run: yarn build
- name: Install / Setup Gravity PDF + WordPress
run: |
- yarn env:install
+ yarn wp-env start
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/phpunit.tests.yml b/.github/workflows/phpunit.tests.yml
index 6c5afcd54..bc9fdfa24 100644
--- a/.github/workflows/phpunit.tests.yml
+++ b/.github/workflows/phpunit.tests.yml
@@ -89,7 +89,7 @@ jobs:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
- ${{ runner.os }}-yarn-
+ ${{ runner.os }}-yarn-
- name: Log debug information
run: |
@@ -103,21 +103,28 @@ jobs:
php -i
locale -a
- - name: Install Dependencies
+ - name: Install Composer dependencies
run: |
- yarn
+ composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction --no-scripts
+ echo "${PWD}/vendor/bin" >> $GITHUB_PATH
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Install JS Dependencies
+ if: steps.cache-nodemodules.outputs.cache-hit != 'true'
+ run: yarn install
- name: Install / Setup Gravity PDF + WordPress
if: ${{ ! matrix.report }}
run: |
- yarn env:install
+ yarn wp-env start
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install / Setup Gravity PDF + WordPress
if: ${{ matrix.report }}
run: |
- PHP_ENABLE_XDEBUG=true yarn env:install
+ PHP_ENABLE_XDEBUG=true yarn wp-env start
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.gitignore b/.gitignore
index 204666ed5..0a56b4743 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,11 +29,7 @@ node_modules/*
*.iws
## Plugin-specific files:
-*.min.css
-*.min.js
-chunk-*.js
-*.map
-dist/*
+build/assets/*
# Unit tests
/tmp
@@ -44,6 +40,7 @@ dist/*
# Coverage report
/coverage
/screenshots
+/artifacts
# Others
_notes
diff --git a/.nvmrc b/.nvmrc
index 19c7bdba7..2edeafb09 100644
--- a/.nvmrc
+++ b/.nvmrc
@@ -1 +1 @@
-16
\ No newline at end of file
+20
\ No newline at end of file
diff --git a/.php-scoper/monolog.php b/.php-scoper/monolog.php
index 5d9690909..2e5ced6ce 100644
--- a/.php-scoper/monolog.php
+++ b/.php-scoper/monolog.php
@@ -5,9 +5,6 @@
use Isolated\Symfony\Component\Finder\Finder;
$path = './';
-if ( isset( $_SERVER['argv'][0] ) ) {
- $path = dirname( $_SERVER['argv'][0] ) . '/';
-}
return [
diff --git a/.php-scoper/mpdf.php b/.php-scoper/mpdf.php
index e69781a49..a0e039f94 100644
--- a/.php-scoper/mpdf.php
+++ b/.php-scoper/mpdf.php
@@ -5,9 +5,6 @@
use Isolated\Symfony\Component\Finder\Finder;
$path = './';
-if ( isset( $_SERVER['argv'][0] ) ) {
- $path = dirname( $_SERVER['argv'][0] ) . '/';
-}
return [
@@ -71,7 +68,7 @@ function( string $filePath, string $prefix, string $content ): string {
];
if ( in_array( basename( $filePath ), $files, true ) ) {
- $content = str_replace( "\\$prefix\\Psr\\Log\\LoggerInterface", '', $content );
+ $content = str_replace( '(LoggerInterface ', '(', $content );
}
/* Global polyfills */
diff --git a/.php-scoper/querypath.php b/.php-scoper/querypath.php
index 675887f92..20d957f5d 100644
--- a/.php-scoper/querypath.php
+++ b/.php-scoper/querypath.php
@@ -5,9 +5,6 @@
use Isolated\Symfony\Component\Finder\Finder;
$path = './';
-if ( isset( $_SERVER['argv'][0] ) ) {
- $path = dirname( $_SERVER['argv'][0] ) . '/';
-}
return [
@@ -37,11 +34,6 @@
*/
'patchers' => [
function( string $filePath, string $prefix, string $content ): string {
-
- if ( basename( $filePath ) === 'DOMTraverser.php' ) {
- $content = str_replace( "\\$prefix\SPLObjectStorage", '\SPLObjectStorage', $content );
- }
-
return str_replace(
"'\\\\QueryPath\\\\",
"'\\\\$prefix\\\\QueryPath\\\\",
diff --git a/.php-scoper/upload.php b/.php-scoper/upload.php
index 4c77fb462..fcf4d407d 100644
--- a/.php-scoper/upload.php
+++ b/.php-scoper/upload.php
@@ -5,9 +5,6 @@
use Isolated\Symfony\Component\Finder\Finder;
$path = './';
-if ( isset( $_SERVER['argv'][0] ) ) {
- $path = dirname( $_SERVER['argv'][0] ) . '/';
-}
return [
diff --git a/.php-scoper/url-signer.php b/.php-scoper/url-signer.php
index 63543977c..7007b0b56 100644
--- a/.php-scoper/url-signer.php
+++ b/.php-scoper/url-signer.php
@@ -5,9 +5,6 @@
use Isolated\Symfony\Component\Finder\Finder;
$path = './';
-if ( isset( $_SERVER['argv'][0] ) ) {
- $path = dirname( $_SERVER['argv'][0] ) . '/';
-}
return [
diff --git a/.testcaferc.js b/.testcaferc.js
index 1eb9d8af9..9a2384c1b 100644
--- a/.testcaferc.js
+++ b/.testcaferc.js
@@ -7,13 +7,13 @@ module.exports = {
skipJsErrors: true,
screenshots: {
takeOnFails: true,
- fullPage: true,
+ fullPage: true
},
hooks: {
test: {
before: async t => {
await t.useRole(admin)
}
- },
- },
-}
\ No newline at end of file
+ }
+ }
+}
diff --git a/.wp-env.json b/.wp-env.json
index 4291e28bc..a23dd9ef8 100644
--- a/.wp-env.json
+++ b/.wp-env.json
@@ -2,16 +2,22 @@
"core": "https://wordpress.org/latest.zip",
"phpVersion": "8.3",
"plugins": [
- "gravityforms/gravityformscli"
+ "gravityforms/gravityformscli",
+ "."
],
+ "lifecycleScripts": {
+ "afterStart": "bash bin/install.sh"
+ },
"mappings": {
- "wp-content/plugins/gravity-pdf": "."
+ "wp-cli.yml": "./tools/wp-env/wp-cli.yml",
+ "wp-content/mu-plugins": "./tools/mu-plugins"
},
"env": {
"tests": {
"plugins": [
"gravityforms/gravityformscli",
- "GravityPDF/gravity-pdf-test-suite"
+ "GravityPDF/gravity-pdf-test-suite",
+ "."
],
"config": {
"WP_DEBUG": true,
diff --git a/babel.config.js b/babel.config.js
new file mode 100644
index 000000000..cfccf6082
--- /dev/null
+++ b/babel.config.js
@@ -0,0 +1,35 @@
+const { hasArgInCLI } = require( '@wordpress/scripts/utils' );
+const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
+
+const isProduction = defaultConfig.mode === 'production';
+const hasReactFastRefresh = hasArgInCLI( '--hot' ) && ! isProduction;
+
+module.exports = ( api ) => {
+ api.cache.using( () => process.env.NODE_ENV === 'production' );
+
+ const plugins = [
+ 'babel-plugin-inline-json-import',
+ '@babel/plugin-transform-modules-commonjs',
+ ];
+
+ if ( hasReactFastRefresh ) {
+ plugins.push( 'react-refresh/babel' );
+ }
+
+ if ( isProduction ) {
+ plugins.push(
+ ...[
+ [
+ 'react-remove-properties',
+ { properties: [ 'data-test' ] },
+ ],
+ 'transform-react-remove-prop-types',
+ ]
+ );
+ }
+
+ return {
+ presets: [ '@wordpress/babel-preset-default' ],
+ plugins,
+ };
+};
diff --git a/bin/build-wp.sh b/bin/build-wp.sh
index c603fa5a1..377eda745 100755
--- a/bin/build-wp.sh
+++ b/bin/build-wp.sh
@@ -22,10 +22,14 @@ tar -zxf ${PACKAGE_DIR}/package.tar.gz --directory ${PACKAGE_DIR} && rm -f ${PAC
# Run Composer
yarn install --cwd ${PACKAGE_DIR}
-yarn --cwd ${PACKAGE_DIR} build:production
-composer install --no-dev --prefer-dist --optimize-autoloader --working-dir ${PACKAGE_DIR}
+yarn --cwd ${PACKAGE_DIR} build
-PLUGIN_DIR="$PACKAGE_DIR/" bash ./bin/vendor-prefix.sh
+# Install all dependencies (including dev)
+# Prefix will run as post-install command script - Requires php-scoper from dev dependencies
+composer install --prefer-dist --working-dir ${PACKAGE_DIR}
+
+# Run vendor cleanup - Ensures that there's no dev dependencies on production
+PLUGIN_DIR="$PACKAGE_DIR" bash ./bin/vendor-cleanup.sh
# Cleanup Node JS
rm -f -R ${PACKAGE_DIR}/node_modules
diff --git a/bin/build.sh b/bin/build.sh
index 3afb15a91..10c7b3360 100755
--- a/bin/build.sh
+++ b/bin/build.sh
@@ -22,10 +22,14 @@ tar -zxf ${PACKAGE_DIR}/package.tar.gz --directory ${PACKAGE_DIR} && rm -f ${PAC
# Run Composer
yarn install --cwd ${PACKAGE_DIR}
-yarn --cwd ${PACKAGE_DIR} build:production
-composer install --no-dev --prefer-dist --optimize-autoloader --working-dir ${PACKAGE_DIR}
+yarn --cwd ${PACKAGE_DIR} build
-PLUGIN_DIR="$PACKAGE_DIR/" bash ./bin/vendor-prefix.sh
+# Install all dependencies (including dev)
+# Prefix will run as post-install command script - Requires php-scoper from dev dependencies
+composer install --prefer-dist --working-dir ${PACKAGE_DIR}
+
+# Run vendor cleanup - Ensures that there's no dev dependencies on production
+PLUGIN_DIR="$PACKAGE_DIR" bash ./bin/vendor-cleanup.sh
# Cleanup Node JS
rm -f -R ${PACKAGE_DIR}/node_modules
diff --git a/bin/install-database.sh b/bin/install-database.sh
index 99f8456aa..40edc59fe 100755
--- a/bin/install-database.sh
+++ b/bin/install-database.sh
@@ -1,5 +1,4 @@
#!/usr/bin/env bash
npm run wp-env run tests-cli wp option add freshinstall yes
-npm run wp-env run tests-cli wp user create editor editor@test.com -- --role=editor --user_pass=password --quiet
-npm run wp-env run tests-cli wp rewrite structure '/%postname%/'
\ No newline at end of file
+npm run wp-env run tests-cli wp user create editor editor@test.com -- --role=editor --user_pass=password --quiet
\ No newline at end of file
diff --git a/bin/install-gravityforms.sh b/bin/install-gravityforms.sh
index 3b49536a9..c6081dc14 100755
--- a/bin/install-gravityforms.sh
+++ b/bin/install-gravityforms.sh
@@ -1,7 +1,5 @@
#!/usr/bin/env bash
-GF_LICENSE="${GF_LICENSE:=$1}"
-
# Add new variables / override existing if .env file exists
if [ -f ".env" ]; then
set -a
@@ -10,10 +8,6 @@ if [ -f ".env" ]; then
fi
# Install in both development + test environments
-npm run wp-env run cli wp gf install -- -- --key=$GF_LICENSE --activate --force --version=beta
-npm run wp-env run tests-cli wp gf install -- -- --key=$GF_LICENSE --activate --force --version=beta
-
-# Install add-ons in the test environment
-npm run wp-env run tests-cli wp gf install gravityformspolls -- --key=$GF_LICENSE --activate --force
-npm run wp-env run tests-cli wp gf install gravityformsquiz -- --key=$GF_LICENSE --activate --force
-npm run wp-env run tests-cli wp gf install gravityformssurvey -- --key=$GF_LICENSE --activate --force
\ No newline at end of file
+# --version=beta is not currently supported by add-ons.
+npm run wp-env run cli wp gf install -- -- --key=$GF_LICENSE --activate --force --version=latest
+npm run wp-env run tests-cli wp gf install -- -- --key=$GF_LICENSE --activate --force --version=latest
\ No newline at end of file
diff --git a/bin/install-post-actions.sh b/bin/install-post-actions.sh
new file mode 100644
index 000000000..912908a19
--- /dev/null
+++ b/bin/install-post-actions.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+# Install add-ons in the test environment
+npm run wp-env run tests-cli wp gf install gravityformspolls -- --key=$GF_LICENSE --activate --force
+npm run wp-env run tests-cli wp gf install gravityformsquiz -- --key=$GF_LICENSE --activate --force
+npm run wp-env run tests-cli wp gf install gravityformssurvey -- --key=$GF_LICENSE --activate --force
diff --git a/bin/install.sh b/bin/install.sh
index a7e31801a..421b8fdab 100755
--- a/bin/install.sh
+++ b/bin/install.sh
@@ -11,14 +11,16 @@ fi
# Install Gravity PDF Dependencies
composer install
-composer run prefix
+# this is triggers as post install script
+# composer run prefix
+# disable for now as it loops the installation
# Start local environment
-if [[ $PHP_ENABLE_XDEBUG ]]; then
- npm run wp-env start -- --upgrade --xdebug=debug,coverage
-else
- npm run wp-env start -- --upgrade
-fi
+#if [[ $PHP_ENABLE_XDEBUG ]]; then
+# npm run wp-env start -- --upgrade --xdebug=debug,coverage
+#else
+# npm run wp-env start -- --upgrade
+#fi
echo "Install Gravity Forms..."
bash ./bin/install-gravityforms.sh
diff --git a/bin/json-payload.sh b/bin/json-payload.sh
index f146438f2..40f96ef80 100644
--- a/bin/json-payload.sh
+++ b/bin/json-payload.sh
@@ -11,12 +11,12 @@ if [[ -z "$2" ]]; then
fi
# Ensure the payload folder exists
-mkdir -p dist/payload
+mkdir -p build/payload
# Basic Authentication
# $3 is a username/password combo
if [[ -z "$3" ]]; then
- curl -f -L $1 -o dist/payload/$2
+ curl -f -L $1 -o build/payload/$2
else
- curl -f -u "$3" -L $1 -o dist/payload/$2
+ curl -f -u "$3" -L $1 -o build/payload/$2
fi
\ No newline at end of file
diff --git a/bin/vendor-cleanup.sh b/bin/vendor-cleanup.sh
new file mode 100644
index 000000000..62d9136ef
--- /dev/null
+++ b/bin/vendor-cleanup.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+if [ -z "$PLUGIN_DIR" ]; then
+ PLUGIN_DIR=""
+fi
+
+COMPOSER="composer"
+
+# Temporarily remove post-install script to avoid re-execution
+COMPOSER_JSON="${PLUGIN_DIR}/composer.json"
+jq 'del(.scripts["post-install-cmd"])' "${COMPOSER_JSON}" > "${COMPOSER_JSON}.tmp" && mv "${COMPOSER_JSON}.tmp" "${COMPOSER_JSON}"
+
+# Reinstall with only production dependencies without triggering post-install script
+rm -r -f ${PLUGIN_DIR}/vendor
+composer install --no-dev --prefer-dist --working-dir ${PLUGIN_DIR}
+
+# Restore post-install script
+jq '.scripts["post-install-cmd"] = "bash ./bin/vendor-prefix.sh"' "${COMPOSER_JSON}" > "${COMPOSER_JSON}.tmp" && mv "${COMPOSER_JSON}.tmp" "${COMPOSER_JSON}"
+
+VENDOR_DIRECTORIES=(
+ "monolog"
+ "spatie"
+ "league"
+ "masterminds"
+ "mpdf"
+ "setasign"
+ "myclabs"
+ "gravitypdf"
+)
+
+for dir in "${VENDOR_DIRECTORIES[@]}";
+do
+ rm -r -f "${PLUGIN_DIR}/vendor/${dir}"
+done
+
+eval "$COMPOSER dump-autoload --optimize --working-dir ${PLUGIN_DIR}"
diff --git a/bin/vendor-prefix.sh b/bin/vendor-prefix.sh
index b09488a6a..342323f9b 100644
--- a/bin/vendor-prefix.sh
+++ b/bin/vendor-prefix.sh
@@ -8,12 +8,6 @@ if [ -z "$PLUGIN_DIR" ]; then
PLUGIN_DIR="./"
fi
-if [[ ! -f "${PLUGIN_DIR}php-scoper.phar" ]]; then
- curl -L https://github.com/humbug/php-scoper/releases/download/0.14.1/php-scoper.phar -o ${PLUGIN_DIR}php-scoper.phar
-fi
-
-chmod -R 777 "${PLUGIN_DIR}vendor"
-
PHP="php"
COMPOSER="composer"
@@ -22,23 +16,23 @@ mkdir "${PLUGIN_DIR}vendor_prefixed"
touch "${PLUGIN_DIR}vendor_prefixed/.gitkeep"
# Monolog
-eval "$PHP ${PLUGIN_DIR}php-scoper.phar add-prefix --output-dir=${PLUGIN_DIR}vendor_prefixed/monolog --config=${PLUGIN_DIR}.php-scoper/monolog.php -n -vvv"
+eval "$PHP ${PLUGIN_DIR}vendor/bin/php-scoper add-prefix --output-dir=${PLUGIN_DIR}vendor_prefixed/monolog --config=${PLUGIN_DIR}.php-scoper/monolog.php -n -vvv"
eval "rm -Rf ${PLUGIN_DIR}vendor/monolog"
# URL Signer
-eval "$PHP ${PLUGIN_DIR}php-scoper.phar add-prefix --output-dir=${PLUGIN_DIR}vendor_prefixed --config=${PLUGIN_DIR}.php-scoper/url-signer.php -n -vvv"
+eval "$PHP ${PLUGIN_DIR}vendor/bin/php-scoper add-prefix --output-dir=${PLUGIN_DIR}vendor_prefixed --config=${PLUGIN_DIR}.php-scoper/url-signer.php -n -vvv"
eval "rm -Rf ${PLUGIN_DIR}vendor/spatie"
eval "rm -Rf ${PLUGIN_DIR}vendor/league"
# Querypath
-eval "$PHP ${PLUGIN_DIR}php-scoper.phar add-prefix --output-dir=${PLUGIN_DIR}vendor_prefixed --config=${PLUGIN_DIR}.php-scoper/querypath.php -n -vvv"
+eval "$PHP ${PLUGIN_DIR}vendor/bin/php-scoper add-prefix --output-dir=${PLUGIN_DIR}vendor_prefixed --config=${PLUGIN_DIR}.php-scoper/querypath.php -n -vvv"
eval "rm -Rf ${PLUGIN_DIR}vendor/masterminds"
# Codeguy
-eval "$PHP ${PLUGIN_DIR}php-scoper.phar add-prefix --output-dir=${PLUGIN_DIR}vendor_prefixed/gravitypdf/upload --config=${PLUGIN_DIR}.php-scoper/upload.php -n -vvv"
+eval "$PHP ${PLUGIN_DIR}vendor/bin/php-scoper add-prefix --output-dir=${PLUGIN_DIR}vendor_prefixed/gravitypdf/upload --config=${PLUGIN_DIR}.php-scoper/upload.php -n -vvv"
# Mpdf
-eval "$PHP ${PLUGIN_DIR}php-scoper.phar add-prefix --output-dir=${PLUGIN_DIR}vendor_prefixed --config=${PLUGIN_DIR}.php-scoper/mpdf.php -n -vvv"
+eval "$PHP ${PLUGIN_DIR}vendor/bin/php-scoper add-prefix --output-dir=${PLUGIN_DIR}vendor_prefixed --config=${PLUGIN_DIR}.php-scoper/mpdf.php -n -vvv"
eval "rm -Rf ${PLUGIN_DIR}vendor/mpdf"
eval "rm -Rf ${PLUGIN_DIR}vendor/setasign"
eval "rm -Rf ${PLUGIN_DIR}vendor/myclabs"
diff --git a/dist/payload/core-fonts.json b/build/payload/core-fonts.json
similarity index 100%
rename from dist/payload/core-fonts.json
rename to build/payload/core-fonts.json
diff --git a/composer.json b/composer.json
index e6f7dd805..e6b6ad3f1 100644
--- a/composer.json
+++ b/composer.json
@@ -6,7 +6,8 @@
"lint": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs",
"lint:fix": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf",
"lint:compat": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --standard=phpcompat.xml.dist",
- "prefix": "bash ./bin/vendor-prefix.sh"
+ "prefix": "bash ./bin/vendor-prefix.sh",
+ "post-install-cmd": "@composer prefix"
},
"config": {
"preferred-install": "dist",
@@ -39,7 +40,8 @@
"phpcompatibility/phpcompatibility-wp": "*",
"roave/security-advisories": "dev-master",
"yoast/phpunit-polyfills": "^3.0",
- "wp-phpunit/wp-phpunit": "^6.4"
+ "wp-phpunit/wp-phpunit": "^6.4",
+ "humbug/php-scoper": "^0.15.0"
},
"autoload": {
"psr-4": {
diff --git a/composer.lock b/composer.lock
index 7f7010403..9dc742a86 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "5c19d9d7fef8e66c105ac41e8aa93b3d",
+ "content-hash": "28609387dfffdcfbe9cffa18d352e69c",
"packages": [
{
"name": "gravitypdf/querypath",
@@ -456,16 +456,16 @@
},
{
"name": "monolog/monolog",
- "version": "2.9.3",
+ "version": "2.10.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
- "reference": "a30bfe2e142720dfa990d0a7e573997f5d884215"
+ "reference": "5cf826f2991858b54d5c3809bee745560a1042a7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Seldaek/monolog/zipball/a30bfe2e142720dfa990d0a7e573997f5d884215",
- "reference": "a30bfe2e142720dfa990d0a7e573997f5d884215",
+ "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5cf826f2991858b54d5c3809bee745560a1042a7",
+ "reference": "5cf826f2991858b54d5c3809bee745560a1042a7",
"shasum": ""
},
"require": {
@@ -542,7 +542,7 @@
],
"support": {
"issues": "https://github.com/Seldaek/monolog/issues",
- "source": "https://github.com/Seldaek/monolog/tree/2.9.3"
+ "source": "https://github.com/Seldaek/monolog/tree/2.10.0"
},
"funding": [
{
@@ -554,7 +554,7 @@
"type": "tidelift"
}
],
- "time": "2024-04-12T20:52:51+00:00"
+ "time": "2024-11-12T12:43:37+00:00"
},
{
"name": "mpdf/mpdf",
@@ -1147,6 +1147,79 @@
}
],
"packages-dev": [
+ {
+ "name": "composer/package-versions-deprecated",
+ "version": "1.11.99.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/package-versions-deprecated.git",
+ "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b4f54f74ef3453349c24a845d22392cd31e65f1d",
+ "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d",
+ "shasum": ""
+ },
+ "require": {
+ "composer-plugin-api": "^1.1.0 || ^2.0",
+ "php": "^7 || ^8"
+ },
+ "replace": {
+ "ocramius/package-versions": "1.11.99"
+ },
+ "require-dev": {
+ "composer/composer": "^1.9.3 || ^2.0@dev",
+ "ext-zip": "^1.13",
+ "phpunit/phpunit": "^6.5 || ^7"
+ },
+ "type": "composer-plugin",
+ "extra": {
+ "class": "PackageVersions\\Installer",
+ "branch-alias": {
+ "dev-master": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "PackageVersions\\": "src/PackageVersions"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Marco Pivetta",
+ "email": "ocramius@gmail.com"
+ },
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be"
+ }
+ ],
+ "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)",
+ "support": {
+ "issues": "https://github.com/composer/package-versions-deprecated/issues",
+ "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.5"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2022-01-17T14:14:24+00:00"
+ },
{
"name": "dealerdirect/phpcodesniffer-composer-installer",
"version": "v1.0.0",
@@ -1295,6 +1368,135 @@
],
"time": "2022-12-30T00:15:36+00:00"
},
+ {
+ "name": "humbug/php-scoper",
+ "version": "0.15.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/humbug/php-scoper.git",
+ "reference": "98c92f2ec5e12756d59ce04dfad34f9fce6c19c3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/humbug/php-scoper/zipball/98c92f2ec5e12756d59ce04dfad34f9fce6c19c3",
+ "reference": "98c92f2ec5e12756d59ce04dfad34f9fce6c19c3",
+ "shasum": ""
+ },
+ "require": {
+ "composer/package-versions-deprecated": "^1.8",
+ "jetbrains/phpstorm-stubs": "^2020.2",
+ "nikic/php-parser": "^4.0",
+ "php": "^7.3 || ^8.0",
+ "symfony/console": "^3.2 || ^4.0",
+ "symfony/filesystem": "^3.2 || ^4.0",
+ "symfony/finder": "^3.2 || ^4.0"
+ },
+ "require-dev": {
+ "bamarni/composer-bin-plugin": "^1.1",
+ "humbug/box": "^3.11",
+ "phpspec/prophecy-phpunit": "^2.0",
+ "phpunit/phpunit": "^9.0"
+ },
+ "bin": [
+ "bin/php-scoper"
+ ],
+ "type": "library",
+ "extra": {
+ "bamarni-bin": {
+ "bin-links": false
+ },
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "files": [
+ "src/functions.php",
+ "src/json.php"
+ ],
+ "psr-4": {
+ "Humbug\\PhpScoper\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@gmail.com"
+ },
+ {
+ "name": "Théo Fidry",
+ "email": "theo.fidry@gmail.com"
+ },
+ {
+ "name": "Pádraic Brady",
+ "email": "padraic.brady@gmail.com"
+ }
+ ],
+ "description": "Prefixes all PHP namespaces in a file or directory.",
+ "support": {
+ "issues": "https://github.com/humbug/php-scoper/issues",
+ "source": "https://github.com/humbug/php-scoper/tree/0.15.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/theofidry",
+ "type": "github"
+ }
+ ],
+ "time": "2021-05-10T20:50:20+00:00"
+ },
+ {
+ "name": "jetbrains/phpstorm-stubs",
+ "version": "v2020.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/JetBrains/phpstorm-stubs.git",
+ "reference": "daf8849db40acded37b13231a291c7536922955b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/JetBrains/phpstorm-stubs/zipball/daf8849db40acded37b13231a291c7536922955b",
+ "reference": "daf8849db40acded37b13231a291c7536922955b",
+ "shasum": ""
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "^2.16",
+ "nikic/php-parser": "dev-master",
+ "php": "^8.0",
+ "phpdocumentor/reflection-docblock": "dev-master",
+ "phpunit/phpunit": "^9"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "PhpStormStubsMap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "Apache-2.0"
+ ],
+ "description": "PHP runtime & extensions header files for PhpStorm",
+ "homepage": "https://www.jetbrains.com/phpstorm",
+ "keywords": [
+ "autocomplete",
+ "code",
+ "inference",
+ "inspection",
+ "jetbrains",
+ "phpstorm",
+ "stubs",
+ "type"
+ ],
+ "support": {
+ "source": "https://github.com/JetBrains/phpstorm-stubs/tree/v2020.3"
+ },
+ "time": "2020-11-24T13:58:53+00:00"
+ },
{
"name": "nikic/php-parser",
"version": "v4.19.4",
@@ -2261,18 +2463,66 @@
],
"time": "2024-09-19T10:50:18+00:00"
},
+ {
+ "name": "psr/container",
+ "version": "1.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/container.git",
+ "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf",
+ "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Container\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common Container Interface (PHP FIG PSR-11)",
+ "homepage": "https://github.com/php-fig/container",
+ "keywords": [
+ "PSR-11",
+ "container",
+ "container-interface",
+ "container-interop",
+ "psr"
+ ],
+ "support": {
+ "issues": "https://github.com/php-fig/container/issues",
+ "source": "https://github.com/php-fig/container/tree/1.1.1"
+ },
+ "time": "2021-03-05T17:36:06+00:00"
+ },
{
"name": "roave/security-advisories",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git",
- "reference": "e63317470a1b96346be224a68f9e64567e1001c3"
+ "reference": "9f1d9b2460cdd0422e8cfd58763bf3156ad7f487"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/e63317470a1b96346be224a68f9e64567e1001c3",
- "reference": "e63317470a1b96346be224a68f9e64567e1001c3",
+ "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/9f1d9b2460cdd0422e8cfd58763bf3156ad7f487",
+ "reference": "9f1d9b2460cdd0422e8cfd58763bf3156ad7f487",
"shasum": ""
},
"conflict": {
@@ -2318,6 +2568,7 @@
"azuracast/azuracast": "<0.18.3",
"backdrop/backdrop": "<1.27.3|>=1.28,<1.28.2",
"backpack/crud": "<3.4.9",
+ "backpack/filemanager": "<3.0.9",
"bacula-web/bacula-web": "<8.0.0.0-RC2-dev",
"badaso/core": "<2.7",
"bagisto/bagisto": "<2.1",
@@ -2381,7 +2632,7 @@
"contao/managed-edition": "<=1.5",
"corveda/phpsandbox": "<1.3.5",
"cosenary/instagram": "<=2.3",
- "craftcms/cms": "<4.6.2|>=5,<=5.2.2",
+ "craftcms/cms": "<=4.12.6.1|>=5,<=5.4.7.1",
"croogo/croogo": "<4",
"cuyz/valinor": "<0.12",
"czim/file-handling": "<1.5|>=2,<2.3",
@@ -2591,7 +2842,7 @@
"lara-zeus/artemis": ">=1,<=1.0.6",
"lara-zeus/dynamic-dashboard": ">=3,<=3.0.1",
"laravel/fortify": "<1.11.1",
- "laravel/framework": "<6.20.44|>=7,<7.30.6|>=8,<8.75",
+ "laravel/framework": "<6.20.45|>=7,<7.30.7|>=8,<8.83.28|>=9,<9.52.17|>=10,<10.48.23|>=11,<11.31",
"laravel/laravel": ">=5.4,<5.4.22",
"laravel/reverb": "<1.4",
"laravel/socialite": ">=1,<2.0.10",
@@ -2649,7 +2900,7 @@
"mojo42/jirafeau": "<4.4",
"mongodb/mongodb": ">=1,<1.9.2",
"monolog/monolog": ">=1.8,<1.12",
- "moodle/moodle": "<4.3.6|>=4.4.0.0-beta,<4.4.2",
+ "moodle/moodle": "<4.3.6|>=4.4,<4.4.4",
"mos/cimage": "<0.7.19",
"movim/moxl": ">=0.8,<=0.10",
"movingbytes/social-network": "<=1.2.1",
@@ -2697,7 +2948,7 @@
"openmage/magento-lts": "<20.10.1",
"opensolutions/vimbadmin": "<=3.0.15",
"opensource-workshop/connect-cms": "<1.7.2|>=2,<2.3.2",
- "orchid/platform": ">=9,<9.4.4|>=14.0.0.0-alpha4,<14.5",
+ "orchid/platform": ">=8,<14.43",
"oro/calendar-bundle": ">=4.2,<=4.2.6|>=5,<=5.0.6|>=5.1,<5.1.1",
"oro/commerce": ">=4.1,<5.0.11|>=5.1,<5.1.1",
"oro/crm": ">=1.7,<1.7.4|>=3.1,<4.1.17|>=4.2,<4.2.7",
@@ -2887,7 +3138,7 @@
"symfony/error-handler": ">=4.4,<4.4.4|>=5,<5.0.4",
"symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1",
"symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7|>=5.3.14,<5.3.15|>=5.4.3,<5.4.4|>=6.0.3,<6.0.4",
- "symfony/http-client": ">=4.3,<5.4.46|>=6,<6.4.14|>=7,<7.1.7",
+ "symfony/http-client": ">=4.3,<5.4.47|>=6,<6.4.15|>=7,<7.1.8",
"symfony/http-foundation": "<5.4.46|>=6,<6.4.14|>=7,<7.1.7",
"symfony/http-kernel": ">=2,<4.4.50|>=5,<5.4.20|>=6,<6.0.20|>=6.1,<6.1.12|>=6.2,<6.2.6",
"symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13",
@@ -2905,9 +3156,9 @@
"symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<3.4.49|>=4,<4.4.24|>=5,<5.2.9",
"symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11",
"symfony/security-guard": ">=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8",
- "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7|>=5.1,<5.2.8|>=5.3,<5.3.2|>=5.4,<5.4.31|>=6,<6.3.8",
+ "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7|>=5.1,<5.2.8|>=5.3,<5.4.47|>=6,<6.4.15|>=7,<7.1.8",
"symfony/serializer": ">=2,<2.0.11|>=4.1,<4.4.35|>=5,<5.3.12",
- "symfony/symfony": "<5.4.46|>=6,<6.4.14|>=7,<7.1.7",
+ "symfony/symfony": "<5.4.47|>=6,<6.4.15|>=7,<7.1.8",
"symfony/translation": ">=2,<2.0.17",
"symfony/twig-bridge": ">=2,<4.4.51|>=5,<5.4.31|>=6,<6.3.8",
"symfony/ux-autocomplete": "<2.11.2",
@@ -2963,7 +3214,7 @@
"ua-parser/uap-php": "<3.8",
"uasoft-indonesia/badaso": "<=2.9.7",
"unisharp/laravel-filemanager": "<2.6.4",
- "unopim/unopim": "<0.1.4",
+ "unopim/unopim": "<0.1.5",
"userfrosting/userfrosting": ">=0.3.1,<4.6.3",
"usmanhalalit/pixie": "<1.0.3|>=2,<2.0.2",
"uvdesk/community-skeleton": "<=1.1.1",
@@ -3099,7 +3350,7 @@
"type": "tidelift"
}
],
- "time": "2024-11-07T19:04:57+00:00"
+ "time": "2024-11-13T19:05:18+00:00"
},
{
"name": "sebastian/cli-parser",
@@ -4066,16 +4317,16 @@
},
{
"name": "squizlabs/php_codesniffer",
- "version": "3.10.3",
+ "version": "3.11.0",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
- "reference": "62d32998e820bddc40f99f8251958aed187a5c9c"
+ "reference": "70c08f8d20c0eb4fe56f26644dd94dae76a7f450"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c",
- "reference": "62d32998e820bddc40f99f8251958aed187a5c9c",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/70c08f8d20c0eb4fe56f26644dd94dae76a7f450",
+ "reference": "70c08f8d20c0eb4fe56f26644dd94dae76a7f450",
"shasum": ""
},
"require": {
@@ -4142,7 +4393,687 @@
"type": "open_collective"
}
],
- "time": "2024-09-18T10:38:58+00:00"
+ "time": "2024-11-12T09:53:29+00:00"
+ },
+ {
+ "name": "symfony/console",
+ "version": "v4.4.49",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/console.git",
+ "reference": "33fa45ffc81fdcc1ca368d4946da859c8cdb58d9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/console/zipball/33fa45ffc81fdcc1ca368d4946da859c8cdb58d9",
+ "reference": "33fa45ffc81fdcc1ca368d4946da859c8cdb58d9",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1.3",
+ "symfony/polyfill-mbstring": "~1.0",
+ "symfony/polyfill-php73": "^1.8",
+ "symfony/polyfill-php80": "^1.16",
+ "symfony/service-contracts": "^1.1|^2"
+ },
+ "conflict": {
+ "psr/log": ">=3",
+ "symfony/dependency-injection": "<3.4",
+ "symfony/event-dispatcher": "<4.3|>=5",
+ "symfony/lock": "<4.4",
+ "symfony/process": "<3.3"
+ },
+ "provide": {
+ "psr/log-implementation": "1.0|2.0"
+ },
+ "require-dev": {
+ "psr/log": "^1|^2",
+ "symfony/config": "^3.4|^4.0|^5.0",
+ "symfony/dependency-injection": "^3.4|^4.0|^5.0",
+ "symfony/event-dispatcher": "^4.3",
+ "symfony/lock": "^4.4|^5.0",
+ "symfony/process": "^3.4|^4.0|^5.0",
+ "symfony/var-dumper": "^4.3|^5.0"
+ },
+ "suggest": {
+ "psr/log": "For using the console logger",
+ "symfony/event-dispatcher": "",
+ "symfony/lock": "",
+ "symfony/process": ""
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Console\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Eases the creation of beautiful and testable command line interfaces",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/console/tree/v4.4.49"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2022-11-05T17:10:16+00:00"
+ },
+ {
+ "name": "symfony/deprecation-contracts",
+ "version": "v2.5.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/deprecation-contracts.git",
+ "reference": "80d075412b557d41002320b96a096ca65aa2c98d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d",
+ "reference": "80d075412b557d41002320b96a096ca65aa2c98d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
+ }
+ },
+ "autoload": {
+ "files": [
+ "function.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "A generic function and convention to trigger deprecation notices",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2023-01-24T14:02:46+00:00"
+ },
+ {
+ "name": "symfony/filesystem",
+ "version": "v4.4.42",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/filesystem.git",
+ "reference": "815412ee8971209bd4c1eecd5f4f481eacd44bf5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/815412ee8971209bd4c1eecd5f4f481eacd44bf5",
+ "reference": "815412ee8971209bd4c1eecd5f4f481eacd44bf5",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1.3",
+ "symfony/polyfill-ctype": "~1.8",
+ "symfony/polyfill-php80": "^1.16"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Filesystem\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Provides basic utilities for the filesystem",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/filesystem/tree/v4.4.42"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2022-05-20T08:49:14+00:00"
+ },
+ {
+ "name": "symfony/finder",
+ "version": "v4.4.44",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/finder.git",
+ "reference": "66bd787edb5e42ff59d3523f623895af05043e4f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/66bd787edb5e42ff59d3523f623895af05043e4f",
+ "reference": "66bd787edb5e42ff59d3523f623895af05043e4f",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1.3",
+ "symfony/polyfill-php80": "^1.16"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Finder\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Finds files and directories via an intuitive fluent interface",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/finder/tree/v4.4.44"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2022-07-29T07:35:46+00:00"
+ },
+ {
+ "name": "symfony/polyfill-ctype",
+ "version": "v1.31.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-ctype.git",
+ "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638",
+ "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2"
+ },
+ "provide": {
+ "ext-ctype": "*"
+ },
+ "suggest": {
+ "ext-ctype": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Ctype\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Gert de Pagter",
+ "email": "BackEndTea@gmail.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for ctype functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "ctype",
+ "polyfill",
+ "portable"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-09-09T11:45:10+00:00"
+ },
+ {
+ "name": "symfony/polyfill-mbstring",
+ "version": "v1.31.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-mbstring.git",
+ "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341",
+ "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2"
+ },
+ "provide": {
+ "ext-mbstring": "*"
+ },
+ "suggest": {
+ "ext-mbstring": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Mbstring\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for the Mbstring extension",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "mbstring",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-09-09T11:45:10+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php73",
+ "version": "v1.31.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php73.git",
+ "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb",
+ "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php73\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-09-09T11:45:10+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php80",
+ "version": "v1.31.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php80.git",
+ "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
+ "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php80\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Ion Bazan",
+ "email": "ion.bazan@gmail.com"
+ },
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-09-09T11:45:10+00:00"
+ },
+ {
+ "name": "symfony/service-contracts",
+ "version": "v2.5.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/service-contracts.git",
+ "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a2329596ddc8fd568900e3fc76cba42489ecc7f3",
+ "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "psr/container": "^1.1",
+ "symfony/deprecation-contracts": "^2.1|^3"
+ },
+ "conflict": {
+ "ext-psr": "<1.1|>=2"
+ },
+ "suggest": {
+ "symfony/service-implementation": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Contracts\\Service\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Generic abstractions related to writing services",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "abstractions",
+ "contracts",
+ "decoupling",
+ "interfaces",
+ "interoperability",
+ "standards"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/service-contracts/tree/v2.5.3"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2023-04-21T15:04:16+00:00"
},
{
"name": "theseer/tokenizer",
@@ -4262,16 +5193,16 @@
},
{
"name": "wp-phpunit/wp-phpunit",
- "version": "6.6.2",
+ "version": "6.7.0",
"source": {
"type": "git",
"url": "https://github.com/wp-phpunit/wp-phpunit.git",
- "reference": "7a1d3a2150033a3d3e19de40aa5b2ef2fee36bc3"
+ "reference": "2ed55b450c10f6850c44531bed7d86aceba2f842"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/wp-phpunit/wp-phpunit/zipball/7a1d3a2150033a3d3e19de40aa5b2ef2fee36bc3",
- "reference": "7a1d3a2150033a3d3e19de40aa5b2ef2fee36bc3",
+ "url": "https://api.github.com/repos/wp-phpunit/wp-phpunit/zipball/2ed55b450c10f6850c44531bed7d86aceba2f842",
+ "reference": "2ed55b450c10f6850c44531bed7d86aceba2f842",
"shasum": ""
},
"type": "library",
@@ -4306,7 +5237,7 @@
"issues": "https://github.com/wp-phpunit/issues",
"source": "https://github.com/wp-phpunit/wp-phpunit"
},
- "time": "2024-07-17T01:13:44+00:00"
+ "time": "2024-11-13T01:22:47+00:00"
},
{
"name": "yoast/phpunit-polyfills",
@@ -4382,9 +5313,9 @@
"platform": {
"php": ">=7.3"
},
- "platform-dev": {},
+ "platform-dev": [],
"platform-overrides": {
"php": "7.3.0"
},
- "plugin-api-version": "2.6.0"
+ "plugin-api-version": "2.3.0"
}
diff --git a/jest.config.js b/jest.config.js
index 9512b989b..12173d52e 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -1,27 +1,23 @@
module.exports = {
- clearMocks: true,
- collectCoverageFrom: [
- 'src/assets/js/react/**/*.{js,jsx}',
- '!src/assets/js/react/api/*.{js,jsx}',
- '!src/assets/js/react/store/*.{js,jsx}',
- '!src/assets/js/react/utilities/versionCompare.{js,jsx}'
- ],
- roots: [
- './tests/js-unit'
- ],
- transform: {
- '^.+\\.js?$': 'babel-jest'
- },
- coverageThreshold: {
- global: {
- branches: 75,
- functions: 75,
- lines: 75,
- statements: 75
- }
- },
- setupFiles: [
- './tests/js-unit/setupTests.js'
- ],
- testEnvironment: 'jsdom'
-}
\ No newline at end of file
+ clearMocks: true,
+ collectCoverageFrom: [
+ 'src/assets/js/react/**/*.{js,jsx}',
+ '!src/assets/js/react/api/*.{js,jsx}',
+ '!src/assets/js/react/store/*.{js,jsx}',
+ '!src/assets/js/react/utilities/versionCompare.{js,jsx}',
+ ],
+ roots: [ './tests/js-unit' ],
+ transform: {
+ '^.+\\.js?$': 'babel-jest',
+ },
+ coverageThreshold: {
+ global: {
+ branches: 75,
+ functions: 75,
+ lines: 75,
+ statements: 75,
+ },
+ },
+ setupFilesAfterEnv: [ './tests/js-unit/setupTests.js' ],
+ testEnvironment: 'jsdom',
+};
diff --git a/package.json b/package.json
index 561528a9e..b60e4d47c 100644
--- a/package.json
+++ b/package.json
@@ -2,53 +2,48 @@
"name": "gravity-pdf",
"private": true,
"dependencies": {
- "algoliasearch": "^4.13.1",
+ "@ffmpeg-installer/ffmpeg": "^1.1.0",
+ "algoliasearch": "^5.10.2",
"classnames": "^2.3.1",
"core-js": "^3.23.4",
+ "history": "^5.3.0",
"lodash.debounce": "^4.0.8",
"object-to-formdata": "^4.4.2",
"prop-types": "^15.8.1",
- "react": "^17.0.2",
- "react-dom": "^17.0.2",
+ "react": "^18.3.1",
+ "react-dom": "^18.3.1",
"react-dropzone": "^14.2.2",
- "react-instantsearch": "^7.0.0",
- "react-redux": "^8.0.2",
- "react-router": "^5.2.0",
- "react-router-dom": "^5.2.0",
- "redux": "^4.2.0",
+ "react-instantsearch": "^7.13.6",
+ "react-redux": "^9.1.2",
+ "react-router": "^6.27.0",
+ "react-router-dom": "^6.27.0",
+ "redux": "^5.0.1",
"redux-saga": "^1.1.3",
"redux-watch": "^1.2.0",
- "reselect": "^4.1.6",
- "sprintf-js": "^1.1.2",
- "superagent": "^9.0.0"
+ "reselect": "^5.1.1",
+ "sprintf-js": "^1.1.2"
},
"devDependencies": {
- "@babel/cli": "^7.18.6",
"@babel/core": "^7.18.6",
- "@babel/eslint-parser": "^7.18.2",
- "@babel/preset-env": "^7.18.6",
- "@babel/preset-react": "^7.18.6",
- "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
- "@wordpress/env": "^9.0.0",
+ "@cfaester/enzyme-adapter-react-18": "^0.8.0",
+ "@playwright/test": "^1.49.0",
+ "@redux-devtools/extension": "^3.3.0",
+ "@wordpress/babel-preset-default": "^8.11.0",
+ "@wordpress/env": "^10.10.0",
+ "@wordpress/eslint-plugin": "^21.4.0",
+ "@wordpress/scripts": "^30.4.0",
"babel-jest": "^29.7.0",
"babel-loader": "^9.1.3",
- "babel-plugin-istanbul": "^6.1.1",
+ "babel-plugin-inline-json-import": "^0.3.2",
+ "babel-plugin-istanbul": "^7.0.0",
"babel-plugin-react-remove-properties": "^0.3.0",
+ "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"cross-env": "^7.0.3",
- "css-loader": "^6.7.1",
- "css-minimizer-webpack-plugin": "^5.0.1",
+ "css-loader": "7.1.2",
+ "css-minimizer-webpack-plugin": "7.0.0",
"dotenv": "^16.0.1",
"enzyme": "^3.11.0",
- "eslint": "^8.52.0",
- "eslint-config-standard": "^17.0",
- "eslint-config-standard-jsx": "^11.0.0",
- "eslint-config-standard-react": "^13.0.0",
- "eslint-plugin-import": "^2.26.0",
- "eslint-plugin-n": "^16.2.0",
- "eslint-plugin-node": "^11.1.0",
- "eslint-plugin-promise": "^6.0.0",
- "eslint-plugin-react": "^7.30.1",
- "eslint-plugin-react-hooks": "^4.6.0",
+ "eslint": "^8",
"file-loader": "^6.2.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
@@ -56,21 +51,30 @@
"jquery": "^3.6.0",
"json-loader": "^0.5.7",
"mini-css-extract-plugin": "^2.6.1",
- "redux-devtools-extension": "^2.13.9",
+ "prettier": "^3.3.3",
+ "react-refresh": "^0.14.2",
"redux-mock-store": "^1.5.4",
"sass": "^1.53.0",
- "sass-loader": "^13.0.2",
+ "sass-loader": "^16.0.2",
"standard": "^17.0.0",
"terser-webpack-plugin": "^5.3.3",
- "testcafe": "^3.0",
+ "testcafe": "^3.7.0",
+ "typescript": "^5.6.3",
"url-loader": "^4.1.1",
"webpack": "^5.73.0",
"webpack-cli": "^5.1.0",
- "webpack-merge": "^5.8.0"
+ "webpack-merge": "^6.0.1"
},
"scripts": {
- "lint:js": "eslint \"src/assets/js/**/*.js\"",
- "lint:js:fix": "eslint \"src/assets/js/**/*.js\" --fix",
+ "start": "yarn run wp-env start && yarn run dev:hot",
+ "dev": "WP_DEVTOOL=inline-source-map wp-scripts start --webpack-src-dir=./src/assets/js",
+ "dev:hot": "yarn run dev --hot",
+ "dev:build": "yarn run dev --no-watch",
+ "build": "wp-scripts build --webpack-src-dir=./src/assets/js --webpack-no-externals",
+ "wp-env": "wp-env",
+ "format": "wp-scripts format ./src/assets ./tests/js-unit && yarn run lint:js --fix && yarn run lint:css --fix",
+ "lint:css": "wp-scripts lint-style ./src/assets/**/*.scss ./src/assets/**/*.pcss",
+ "lint:js": "wp-scripts lint-js ./src/assets/js ./tests/js-unit",
"test:e2e": "cross-env NODE_ENV=test testcafe chrome",
"test:e2e:headless": "cross-env NODE_ENV=test testcafe chrome:headless",
"test:e2e:watch": "cross-env NODE_ENV=test testcafe chrome -L",
@@ -79,10 +83,13 @@
"test:js": "jest --verbose",
"test:js:coverage": "jest --coverage --verbose",
"test:js:watch": "jest --watchAll",
- "prebuild:core-fonts": "bash bin/json-payload.sh https://api.github.com/repos/GravityPDF/mpdf-core-fonts/contents/ core-fonts.json",
- "build:dev": "cross-env NODE_ENV=development webpack --watch",
- "build:production": "cross-env NODE_ENV=production webpack",
- "wp-env": "wp-env",
- "env:install": "bash bin/install.sh"
+ "prebuild:core-fonts": "bash bin/json-payload.sh https://api.github.com/repos/GravityPDF/mpdf-core-fonts/contents/ core-fonts.json"
+ },
+ "wp-env": {
+ "plugin-dir": "gravity-pdf",
+ "plugin-name": "Gravity PDF"
+ },
+ "resolutions": {
+ "cheerio": "1.0.0-rc.10"
}
}
diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index 81b7f6129..ce7691a9c 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -99,4 +99,6 @@
' + msg + '
') + const $elm = $('' + msg + '
'); - if (error === true) { - $elm.addClass('error') - } else { - $elm.addClass('updated') - } + if (error === true) { + $elm.addClass('error'); + } else { + $elm.addClass('updated'); + } - $('.wrap > h2').after($elm) + $('.wrap > h2').after($elm); - setTimeout(function () { - $elm.slideUp() - }, timeout) + setTimeout(function () { + $elm.slideUp(); + }, timeout); } diff --git a/src/assets/js/admin/helper/spinner.js b/src/assets/js/admin/helper/spinner.js index c68225cb5..75695cba1 100644 --- a/src/assets/js/admin/helper/spinner.js +++ b/src/assets/js/admin/helper/spinner.js @@ -1,6 +1,14 @@ -import $ from 'jquery' +import $ from 'jquery'; -export function spinner (classname) { - const $spinner = $('') - return $spinner +export function spinner(classname) { + const $spinner = $( + '' + ); + return $spinner; } diff --git a/src/assets/js/admin/settings/common/doColorPicker.js b/src/assets/js/admin/settings/common/doColorPicker.js index 2ba00dea7..1e4dbf190 100644 --- a/src/assets/js/admin/settings/common/doColorPicker.js +++ b/src/assets/js/admin/settings/common/doColorPicker.js @@ -1,15 +1,18 @@ -import $ from 'jquery' +import $ from 'jquery'; /** * Check if a Gravity PDF color picker field is present and initialise - * @return void + * * @since 4.0 */ -export function doColorPicker () { - $('.gfpdf-color-picker').each(function () { - $(this).wpColorPicker({ - width: 300 - }) - $(this).parents('.wp-picker-container').find('.wp-color-result').addClass('ed_button') - }) +export function doColorPicker() { + $('.gfpdf-color-picker').each(function () { + $(this).wpColorPicker({ + width: 300, + }); + $(this) + .parents('.wp-picker-container') + .find('.wp-color-result') + .addClass('ed_button'); + }); } diff --git a/src/assets/js/admin/settings/common/doUploadListener.js b/src/assets/js/admin/settings/common/doUploadListener.js index 1589c31ad..77ac0a8f5 100644 --- a/src/assets/js/admin/settings/common/doUploadListener.js +++ b/src/assets/js/admin/settings/common/doUploadListener.js @@ -1,47 +1,50 @@ -import $ from 'jquery' +import $ from 'jquery'; /** * Rich Media Uploader * JS Pulled straight from Easy Digital Download's admin-scripts.js - * @return void + * * @since 4.0 */ -export function doUploadListener () { - // WP 3.5+ uploader - let fileFrame - window.formfield = '' - - $('body').off('click', '.gfpdf_settings_upload_button').on('click', '.gfpdf_settings_upload_button', function (e) { - e.preventDefault() - - const $button = $(this) - window.formfield = $(this).prev() - - /* If the media frame already exists, reopen it. */ - if (fileFrame) { - fileFrame.open() - return - } - - /* Create the media frame. */ - fileFrame = wp.media.frames.file_frame = wp.media({ - title: $button.data('uploader-title'), - button: { - text: $button.data('uploader-button-text') - }, - multiple: false - }) - - /* When a file is selected, run a callback. */ - fileFrame.on('select', function () { - const selection = fileFrame.state().get('selection') - selection.each(function (attachment) { - attachment = attachment.toJSON() - window.formfield.val(attachment.url).trigger('change') - }) - }) - - /* Finally, open the modal */ - fileFrame.open() - }) +export function doUploadListener() { + // WP 3.5+ uploader + let fileFrame; + window.formfield = ''; + + $('body') + .off('click', '.gfpdf_settings_upload_button') + .on('click', '.gfpdf_settings_upload_button', function (e) { + e.preventDefault(); + + window.formfield = $(this).prev(); + + /* If the media frame already exists, reopen it. */ + if (fileFrame) { + fileFrame.open(); + return; + } + + const $button = $(this); + + /* Create the media frame. */ + fileFrame = wp.media.frames.file_frame = wp.media({ + title: $button.data('uploader-title'), + button: { + text: $button.data('uploader-button-text'), + }, + multiple: false, + }); + + /* When a file is selected, run a callback. */ + fileFrame.on('select', function () { + const selection = fileFrame.state().get('selection'); + selection.each(function (attachment) { + attachment = attachment.toJSON(); + window.formfield.val(attachment.url).trigger('change'); + }); + }); + + /* Finally, open the modal */ + fileFrame.open(); + }); } diff --git a/src/assets/js/admin/settings/common/dynamicTemplateFields/doMergetags.js b/src/assets/js/admin/settings/common/dynamicTemplateFields/doMergetags.js index df113644c..296d2317e 100644 --- a/src/assets/js/admin/settings/common/dynamicTemplateFields/doMergetags.js +++ b/src/assets/js/admin/settings/common/dynamicTemplateFields/doMergetags.js @@ -1,27 +1,40 @@ -import $ from 'jquery' +import $ from 'jquery'; /** * Remove any existing merge tags and reinitialise - * @return void + * * @since 4.0 */ -export function doMergetags () { - if (window.gfMergeTags && typeof form !== 'undefined' && $('#gfpdf-fieldset-gfpdf_form_settings_template .merge-tag-support').length >= 0) { - /* Initialise */ - $('#gfpdf-fieldset-gfpdf_form_settings_template .merge-tag-support').each(function () { - new gfMergeTagsObj(form, $(this)) // eslint-disable-line - }) +export function doMergetags() { + if ( + window.gfMergeTags && + typeof form !== 'undefined' && + $('#gfpdf-fieldset-gfpdf_form_settings_template .merge-tag-support') + .length >= 0 + ) { + /* Initialise */ + $( + '#gfpdf-fieldset-gfpdf_form_settings_template .merge-tag-support' + ).each(function () { + new gfMergeTagsObj( form, $( this ) ); // eslint-disable-line + }); - /* Wrap merge tag selectors with new GF2.5 markup */ - $('#gfpdf-fieldset-gfpdf_form_settings_template .gform-settings-field').each(function () { - $(this) - .find('.merge-tag-support, .merge-tag-support + span') - .wrapAll('') + /* Wrap merge tag selectors with new GF2.5 markup */ + $( + '#gfpdf-fieldset-gfpdf_form_settings_template .gform-settings-field' + ).each(function () { + $(this) + .find('.merge-tag-support, .merge-tag-support + span') + .wrapAll( + '' + ); - $(this) - .find('.all-merge-tags.textarea') - .parent() - .wrapAll('') - }) - } + $(this) + .find('.all-merge-tags.textarea') + .parent() + .wrapAll( + '' + ); + }); + } } diff --git a/src/assets/js/admin/settings/common/dynamicTemplateFields/loadTinyMCEEditor.js b/src/assets/js/admin/settings/common/dynamicTemplateFields/loadTinyMCEEditor.js index cd3c28388..88c50afdd 100644 --- a/src/assets/js/admin/settings/common/dynamicTemplateFields/loadTinyMCEEditor.js +++ b/src/assets/js/admin/settings/common/dynamicTemplateFields/loadTinyMCEEditor.js @@ -1,54 +1,72 @@ -import $ from 'jquery' +import $ from 'jquery'; /** * Initialises AJAX-loaded wp_editor TinyMCE containers for use - * @param Array editors The DOM element IDs to parse - * @param Object settings The TinyMCE settings to use - * @return void + * @param { Array