diff --git a/.deployignore b/.deployignore
deleted file mode 100644
index 56180bf5..00000000
--- a/.deployignore
+++ /dev/null
@@ -1,22 +0,0 @@
-.DS_Store
-Thumbs.db
-wp-cli.local.yml
-node_modules/
-*.sql
-*.tar.gz
-*.zip
-.phpunit.result.cache
-Dockerfile
-output.log
-.github
-tests
-bin
-composer.lock
-.phpcs.xml
-phpunit.xml
-configure.php
-DOCKER_ENV
-phpunit.xml
-tests
-.phpcs
-Makefile
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
deleted file mode 100644
index 115b12e2..00000000
--- a/.github/dependabot.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-# Please see the documentation for all configuration options:
-# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
-
-version: 2
-updates:
-
- - package-ecosystem: "github-actions"
- directory: "/"
- schedule:
- interval: "weekly"
-
- - package-ecosystem: "composer"
- directory: "/"
- schedule:
- interval: "weekly"
-
- - package-ecosystem: "npm"
- directory: "/"
- schedule:
- interval: "weekly"
- day: "saturday"
- time: "09:00"
- timezone: "America/New_York"
- ignore:
- - dependency-name: "@wordpress/*"
diff --git a/.github/workflows/built-branch.yml b/.github/workflows/built-branch.yml
deleted file mode 100644
index cc534404..00000000
--- a/.github/workflows/built-branch.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-name: Create a -built branch
-
-on:
- push:
- branches:
- - main
- - develop
-
-jobs:
- built-branch:
- uses: alleyinteractive/.github/.github/workflows/built-branch.yml@main
diff --git a/.github/workflows/built-release.yml b/.github/workflows/built-release.yml
deleted file mode 100644
index 46b1ef21..00000000
--- a/.github/workflows/built-release.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-name: Built Release
-
-on:
- push:
- branches:
- - develop
- - main
- - production
-
-jobs:
- built-release:
- uses: alleyinteractive/.github/.github/workflows/built-release.yml@main
- if: ${{ github.repository != 'alleyinteractive/create-wordpress-plugin' }}
- with:
- node: 16
diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml
deleted file mode 100644
index 4adcf4ef..00000000
--- a/.github/workflows/coding-standards.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-name: Coding Standards
-
-on:
- push:
- branches:
- - develop
- pull_request:
- # Uncomment and edit the following to run on a schedule.
- # schedule:
- # - cron: '0 5 * * 0' # Run once per week at 5am UTC on Sundays.
-
-jobs:
- coding-standards:
- uses: alleyinteractive/.github/.github/workflows/php-coding-standards.yml@main
- with:
- php: '8.2'
diff --git a/.github/workflows/dependabot-auto-approve.yml b/.github/workflows/dependabot-auto-approve.yml
deleted file mode 100644
index e2119dec..00000000
--- a/.github/workflows/dependabot-auto-approve.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-name: dependabot-auto-approve
-on:
- pull_request:
-
-permissions:
- pull-requests: write
- contents: write
-
-jobs:
- dependabot:
- uses: alleyinteractive/.github/.github/workflows/dependabot-auto-approve.yml@main
diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml
deleted file mode 100644
index aaed13d4..00000000
--- a/.github/workflows/dependabot-auto-merge.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-name: dependabot-auto-merge
-on: pull_request_target
-
-permissions:
- pull-requests: write
- contents: write
-
-jobs:
- dependabot:
- uses: alleyinteractive/.github/.github/workflows/dependabot-auto-merge.yml@main
diff --git a/.github/workflows/merge-develop-to-scaffold.yml b/.github/workflows/merge-develop-to-scaffold.yml
deleted file mode 100644
index 5465956a..00000000
--- a/.github/workflows/merge-develop-to-scaffold.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-name: Merge Develop to Scaffold Branch
-
-on:
- push:
- branches:
- - develop
- - remove-scaffold
-
-jobs:
- merge-develop-to-scaffold:
- name: merge develop to scaffold
- runs-on: ubuntu-latest
-
- steps:
- - name: Merge develop to scaffold
- shell: bash
- env:
- DEVELOP_BRANCH: develop
- SCAFFOLD_BRANCH: scaffold
-
- TOKEN: ${{ secrets.GH_TOKEN }}
- run: |
- git config --global user.name "$GITHUB_ACTOR"
- git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
-
- echo "Cloning alleyinteractive/create-wordpress-plugin..."
- git clone --recursive --quiet https://$TOKEN@github.com/alleyinteractive/create-wordpress-plugin.git create-wordpress-plugin -b $SCAFFOLD_BRANCH
- cd create-wordpress-plugin
-
- git fetch origin $DEVELOP_BRANCH
- git fetch origin $SCAFFOLD_BRANCH
-
- git merge origin/$DEVELOP_BRANCH --no-edit
- git push -u origin $SCAFFOLD_BRANCH
diff --git a/.github/workflows/node-tests.yml b/.github/workflows/node-tests.yml
deleted file mode 100644
index 668b078a..00000000
--- a/.github/workflows/node-tests.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-name: Node Tests
-
-on:
- push:
- branches:
- - develop
- pull_request:
- # Uncomment and edit the following to run on a schedule.
- # schedule:
- # - cron: '15 5 * * 0' # Run once per week at 5:15am UTC on Sundays.
-
-jobs:
- node-tests:
- uses: alleyinteractive/.github/.github/workflows/node-tests.yml@main
- with:
- run-audit: true
diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml
deleted file mode 100644
index 213fbb43..00000000
--- a/.github/workflows/unit-test.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-name: Testing Suite
-
-on:
- push:
- branches:
- - develop
- pull_request:
- # Uncomment and edit the following to run on a schedule.
- # schedule:
- # - cron: '30 5 * * 0' # Run once per week at 5:30am UTC on Sundays.
-
-jobs:
- php-tests:
- strategy:
- matrix:
- php: [8.0, 8.1, 8.2]
- wordpress: ["latest"]
- uses: alleyinteractive/.github/.github/workflows/php-tests.yml@main
- with:
- php: ${{ matrix.php }}
- wordpress: ${{ matrix.wordpress }}
diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml
deleted file mode 100644
index 0cdea233..00000000
--- a/.github/workflows/update-changelog.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-name: "Update Changelog"
-
-on:
- release:
- types: [released]
-
-jobs:
- update:
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
- with:
- ref: main
-
- - name: Update Changelog
- uses: stefanzweifel/changelog-updater-action@v1
- with:
- latest-version: ${{ github.event.release.name }}
- release-notes: ${{ github.event.release.body }}
-
- - name: Commit updated CHANGELOG
- uses: stefanzweifel/git-auto-commit-action@v5
- with:
- branch: main
- commit_message: Update CHANGELOG
- file_pattern: CHANGELOG.md
diff --git a/.github/workflows/upgrade-wordpress-plugin.yml b/.github/workflows/upgrade-wordpress-plugin.yml
deleted file mode 100644
index 9fdf3c6f..00000000
--- a/.github/workflows/upgrade-wordpress-plugin.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-name: Update WordPress Plugin
-
-on:
- schedule:
- - cron: '0 6 1 * *' # Run on the first day of every month at 6am UTC.
-
-permissions:
- contents: write
- pull-requests: write
-
-jobs:
- update-plugin:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: alleyinteractive/action-update-wordpress-plugin@v1.2.1
- with:
- plugin-file: 'plugin.php'
- upgrade-npm-dependencies: "true"
diff --git a/.gitignore b/.gitignore
index a8545793..56180bf5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,26 +1,22 @@
-# Build files
-build
-vendor
-composer.lock
-node_modules
-
-# Log files
-*.log
-
-# Cache files
-.phpcs/*.json
-.phpunit.result.cache
-
-# Ignore temporary OS files
.DS_Store
-.DS_Store?
-.Spotlight-V100
-.Trashes
-ehthumbs.db
Thumbs.db
-.thumbsdb
-
-# IDE files
-*.code-workspace
-.idea
-.vscode
+wp-cli.local.yml
+node_modules/
+*.sql
+*.tar.gz
+*.zip
+.phpunit.result.cache
+Dockerfile
+output.log
+.github
+tests
+bin
+composer.lock
+.phpcs.xml
+phpunit.xml
+configure.php
+DOCKER_ENV
+phpunit.xml
+tests
+.phpcs
+Makefile
diff --git a/.phpcs.xml b/.phpcs.xml
deleted file mode 100644
index f77fbf7f..00000000
--- a/.phpcs.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
- { __('Block Title – hello from the editor!', 'wp-newsletter-builder') } -
- ); -} diff --git a/bin/create-block/templates/javascript/index.js.mustache b/bin/create-block/templates/javascript/index.js.mustache deleted file mode 100644 index 4f309fc6..00000000 --- a/bin/create-block/templates/javascript/index.js.mustache +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Registers a new block provided a unique name and an object defining its behavior. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ - */ -import { registerBlockType } from '@wordpress/blocks'; - -/** - * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. - * All files containing `style` keyword are bundled together. The code used - * gets applied both to the front of your site and to the editor. - * - * @see https://www.npmjs.com/package/@wordpress/scripts#using-css - */ -import './style.scss'; - -/** - * Internal dependencies - */ -import edit from './edit'; -{{#isStaticVariant}} -import save from './save'; -{{/isStaticVariant}} -import metadata from './block.json'; - -/** - * Every block starts by registering a new block type definition. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ - */ -registerBlockType( - metadata.name, - { - edit, - {{#isStaticVariant}} - save, - {{/isStaticVariant}} - }, -); diff --git a/bin/create-block/templates/javascript/index.scss.mustache b/bin/create-block/templates/javascript/index.scss.mustache deleted file mode 100644 index 76e79841..00000000 --- a/bin/create-block/templates/javascript/index.scss.mustache +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The following styles get applied inside the editor only. - * - * All imported CSS files are bundled into one chunk named after the entry point, - * which defaults to index.js, and thus the file created becomes index.css. - * This is for styles used only in the editor. - * - * Replace them with your own styles or remove the file completely. - */ - -.wp-block-{{namespace}}-{{slug}} { - border: 1px dotted #f00; -} diff --git a/bin/create-block/templates/javascript/save.jsx.mustache b/bin/create-block/templates/javascript/save.jsx.mustache deleted file mode 100644 index 15a1c598..00000000 --- a/bin/create-block/templates/javascript/save.jsx.mustache +++ /dev/null @@ -1,26 +0,0 @@ -{{#isStaticVariant}} -/** - * React hook that is used to mark the block wrapper element. - * It provides all the necessary props like the class name. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops - */ -import { useBlockProps } from '@wordpress/block-editor'; - -/** - * The save function defines the way in which the different attributes should - * be combined into the final markup, which is then serialized by the block - * editor into `post_content`. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save - * - * @return {WPElement} Element to render. - */ -export default function save() { - return ( -- {'{{title}} - hello from the saved content!'} -
- ); -} -{{/isStaticVariant}} diff --git a/bin/create-block/templates/javascript/style.scss.mustache b/bin/create-block/templates/javascript/style.scss.mustache deleted file mode 100644 index b76ce02b..00000000 --- a/bin/create-block/templates/javascript/style.scss.mustache +++ /dev/null @@ -1,18 +0,0 @@ -/** - * The following styles get applied both on the front of your site - * and in the editor. - * - * Imported style.css file(s) (applies to SASS and SCSS extensions) - * get bundled into one style-index.css file that is meant to be - * used both on the front-end and in the editor. - * - * Replace them with your own styles or remove the file completely. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#block-styles - */ - -.wp-block-{{namespace}}-{{slug}} { - background-color: #21759b; - color: #fff; - padding: 2px; -} diff --git a/bin/create-block/templates/typescript/edit.tsx.mustache b/bin/create-block/templates/typescript/edit.tsx.mustache deleted file mode 100644 index 060f33d4..00000000 --- a/bin/create-block/templates/typescript/edit.tsx.mustache +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Retrieves the translation of text. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ - */ -import { __ } from '@wordpress/i18n'; - -/** - * React hook that is used to mark the block wrapper element. - * It provides all the necessary props like the class name. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops - */ -import { useBlockProps } from '@wordpress/block-editor'; - -/** - * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. - * Those files can contain any CSS code that gets applied to the editor. - * - * @see https://www.npmjs.com/package/@wordpress/scripts#using-css - */ -import './index.scss'; - -/** - * The edit function describes the structure of your block in the context of the - * editor. This represents what the editor will render when the block is used. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit - * - * @return {WPElement} Element to render. - */ -export default function Edit() { - return ( -- { __('Block Title - hello from the editor!', 'wp-newsletter-builder') } -
- ); -} diff --git a/bin/create-block/templates/typescript/index.scss.mustache b/bin/create-block/templates/typescript/index.scss.mustache deleted file mode 100644 index 76e79841..00000000 --- a/bin/create-block/templates/typescript/index.scss.mustache +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The following styles get applied inside the editor only. - * - * All imported CSS files are bundled into one chunk named after the entry point, - * which defaults to index.js, and thus the file created becomes index.css. - * This is for styles used only in the editor. - * - * Replace them with your own styles or remove the file completely. - */ - -.wp-block-{{namespace}}-{{slug}} { - border: 1px dotted #f00; -} diff --git a/bin/create-block/templates/typescript/index.ts.mustache b/bin/create-block/templates/typescript/index.ts.mustache deleted file mode 100644 index 8598b1cf..00000000 --- a/bin/create-block/templates/typescript/index.ts.mustache +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Registers a new block provided a unique name and an object defining its behavior. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ - */ -import { registerBlockType } from '@wordpress/blocks'; - -/** - * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. - * All files containing `style` keyword are bundled together. The code used - * gets applied both to the front of your site and to the editor. - * - * @see https://www.npmjs.com/package/@wordpress/scripts#using-css - */ -import './style.scss'; - -/** - * Internal dependencies - */ -import edit from './edit'; -{{#isStaticVariant}} -import save from './save'; -{{/isStaticVariant}} -import metadata from './block.json'; - -/** - * Every block starts by registering a new block type definition. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ - */ -registerBlockType( - /* @ts-expect-error Provided types are inaccurate to the actual plugin API. */ - metadata, - { - apiVersion: 2, - edit, - {{#isStaticVariant}} - save, - {{/isStaticVariant}} - title: metadata.title, - }, -); diff --git a/bin/create-block/templates/typescript/save.tsx.mustache b/bin/create-block/templates/typescript/save.tsx.mustache deleted file mode 100644 index 15a1c598..00000000 --- a/bin/create-block/templates/typescript/save.tsx.mustache +++ /dev/null @@ -1,26 +0,0 @@ -{{#isStaticVariant}} -/** - * React hook that is used to mark the block wrapper element. - * It provides all the necessary props like the class name. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops - */ -import { useBlockProps } from '@wordpress/block-editor'; - -/** - * The save function defines the way in which the different attributes should - * be combined into the final markup, which is then serialized by the block - * editor into `post_content`. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save - * - * @return {WPElement} Element to render. - */ -export default function save() { - return ( -- {'{{title}} - hello from the saved content!'} -
- ); -} -{{/isStaticVariant}} diff --git a/bin/create-block/templates/typescript/style.scss.mustache b/bin/create-block/templates/typescript/style.scss.mustache deleted file mode 100644 index b76ce02b..00000000 --- a/bin/create-block/templates/typescript/style.scss.mustache +++ /dev/null @@ -1,18 +0,0 @@ -/** - * The following styles get applied both on the front of your site - * and in the editor. - * - * Imported style.css file(s) (applies to SASS and SCSS extensions) - * get bundled into one style-index.css file that is meant to be - * used both on the front-end and in the editor. - * - * Replace them with your own styles or remove the file completely. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#block-styles - */ - -.wp-block-{{namespace}}-{{slug}} { - background-color: #21759b; - color: #fff; - padding: 2px; -} diff --git a/build/blocks/index.asset.php b/build/blocks/index.asset.php new file mode 100644 index 00000000..56a6f78c --- /dev/null +++ b/build/blocks/index.asset.php @@ -0,0 +1 @@ + array(), 'version' => 'cb910f84d6beddcdcf0c'); diff --git a/build/blocks/index.css b/build/blocks/index.css new file mode 100644 index 00000000..2cb9ba77 --- /dev/null +++ b/build/blocks/index.css @@ -0,0 +1,7 @@ +.main,.mso,body{-webkit-text-size-adjust:100%;background-color:#fff;color:#000;margin:0;padding:0}figure{margin:0}figure,img{display:block}img{height:auto;line-height:100%;max-width:100%;outline:none;text-decoration:none}a img,img{border:0}.image-fix{display:block}table,td{border-collapse:collapse} +.wp-newsletter-builder-container{margin:0 auto;max-width:600px;min-width:320px;width:320px;width:calc(28000% - 167400px)}.has-text-align-left{text-align:left}.has-text-align-center{text-align:center}.has-text-align-right{text-align:right}.wp-newsletter-builder__ad{margin:30px 0}table.wrapper{background-color:#fff;min-width:320px;table-layout:fixed;width:100%}.liveintent-disclosures img{display:inline} +h2,h3,h4,h5,h6{font-family:Georgia,serif;font-weight:700;line-height:1.3}h2{font-size:26px}h3{font-size:20px}h4{font-size:18px}h5{font-size:16px}h6{font-size:14px} +.wp-block-image{margin-bottom:20px}.aligncenter>img{margin-left:auto;margin-right:auto} +p{font-family:Merriweather,Georgia,serif;font-size:16px;line-height:1.33} +.wp-block-button{font-weight:700;margin:0 auto;max-width:50%;width:-moz-max-content;width:max-content}.wp-block-button.wp-newsletter-builder__subscribe{max-width:none;text-transform:uppercase;width:100%}.wp-block-button.wp-newsletter-builder__subscribe .wp-element-button{display:block}.wp-element-button{-webkit-text-size-adjust:none;background-color:#d62827;border-radius:4px;color:#fff;display:inline-block;font-family:Verdana,sans-serif;font-size:14px;font-weight:700;line-height:24px;padding:12px;text-align:center;text-decoration:none} +.wp-block-separator,hr{background-color:#979797;border:0;height:2px;margin:30px auto;max-width:40px}.wp-block-separator.is-style-wide,hr.is-style-wide{max-width:none} diff --git a/.phpcs/.gitkeep b/build/blocks/index.js similarity index 100% rename from .phpcs/.gitkeep rename to build/blocks/index.js diff --git a/build/editor/index.asset.php b/build/editor/index.asset.php new file mode 100644 index 00000000..2d14e46b --- /dev/null +++ b/build/editor/index.asset.php @@ -0,0 +1 @@ + array(), 'version' => 'a73e01d1b0eb49b5942b'); diff --git a/build/editor/index.css b/build/editor/index.css new file mode 100644 index 00000000..2b25e957 --- /dev/null +++ b/build/editor/index.css @@ -0,0 +1 @@ +html :where(.editor-styles-wrapper) h2,html :where(.editor-styles-wrapper) h3,html :where(.editor-styles-wrapper) h4,html :where(.editor-styles-wrapper) h5,html :where(.editor-styles-wrapper) h6{font-family:Georgia,serif;font-weight:700;line-height:1.3}html :where(.editor-styles-wrapper) h2{font-size:26px}html :where(.editor-styles-wrapper) h3{font-size:20px}html :where(.editor-styles-wrapper) h4{font-size:18px}html :where(.editor-styles-wrapper) h5{font-size:16px}html :where(.editor-styles-wrapper) h6{font-size:14px}.block-editor .editor-styles-wrapper{margin:0 auto;max-width:600px;min-width:320px;width:320px;width:calc(28000% - 167400px)}.block-editor .editor-styles-wrapper .wp-block-image{margin-bottom:20px}.block-editor .editor-styles-wrapper .aligncenter>img{margin-left:auto;margin-right:auto}.block-editor .editor-styles-wrapper p{font-family:Merriweather,Georgia,serif;font-size:16px;line-height:1.33}.block-editor .editor-styles-wrapper .wp-block-button{font-weight:700;margin:0 auto;max-width:50%;width:-moz-max-content;width:max-content}.block-editor .editor-styles-wrapper .wp-block-button.wp-newsletter-builder__subscribe{max-width:none;text-transform:uppercase;width:100%}.block-editor .editor-styles-wrapper .wp-block-button.wp-newsletter-builder__subscribe .wp-element-button{display:block}.block-editor .editor-styles-wrapper .wp-element-button{-webkit-text-size-adjust:none;background-color:#d62827;border-radius:4px;color:#fff;display:inline-block;font-family:Verdana,sans-serif;font-size:14px;font-weight:700;line-height:24px;padding:12px;text-align:center;text-decoration:none}.block-editor .editor-styles-wrapper .wp-block-separator,.block-editor .editor-styles-wrapper hr{background-color:#979797;border:0;height:2px;margin:30px auto;max-width:40px}.block-editor .editor-styles-wrapper .wp-block-separator.is-style-wide,.block-editor .editor-styles-wrapper hr.is-style-wide{max-width:none} diff --git a/build/editor/index.js b/build/editor/index.js new file mode 100644 index 00000000..e69de29b diff --git a/build/email-settings/block.json b/build/email-settings/block.json new file mode 100644 index 00000000..b933b12e --- /dev/null +++ b/build/email-settings/block.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2, + "name": "wp-newsletter-builder/email-settings", + "version": "0.1.0", + "title": "Email Settings", + "category": "design", + "icon": "email", + "description": "Block to set the email subject, preview text, and list.", + "textdomain": "email-settings", + "editorScript": "file:index.js", + "editorStyle": "file:index.css", + "style": [ + "file:style-index.css" + ], + "render": "file:render.php" +} \ No newline at end of file diff --git a/build/email-settings/index.asset.php b/build/email-settings/index.asset.php new file mode 100644 index 00000000..37da29a9 --- /dev/null +++ b/build/email-settings/index.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '3ab1fcb89e35438d76a1'); diff --git a/build/email-settings/index.css b/build/email-settings/index.css new file mode 100644 index 00000000..1199faf3 --- /dev/null +++ b/build/email-settings/index.css @@ -0,0 +1 @@ +.wp-block-wp-newsletter-builder-email-settings{background-color:#eee;padding:5px} diff --git a/build/email-settings/index.js b/build/email-settings/index.js new file mode 100644 index 00000000..9d4f3a3e --- /dev/null +++ b/build/email-settings/index.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t={823:function(e,t,r){var n=window.wp.blocks,l=window.wp.element,a=window.wp.i18n,s=window.wp.components,o=window.wp.apiFetch,i=r.n(o),c=window.wp.data,d=window.wp.blockEditor,u=r(196),p=r.n(u),m=r(893);!function(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(".rmsc{--rmsc-main: #4285f4;--rmsc-hover: #f1f3f5;--rmsc-selected: #e2e6ea;--rmsc-border: #ccc;--rmsc-gray: #aaa;--rmsc-bg: #fff;--rmsc-p: 10px;--rmsc-radius: 4px;--rmsc-h: 38px}.rmsc *{box-sizing:border-box;transition:all .2s ease}.rmsc .gray{color:var(--rmsc-gray)}.rmsc .dropdown-content{position:absolute;z-index:1;top:100%;width:100%;padding-top:8px}.rmsc .dropdown-content .panel-content{overflow:hidden;border-radius:var(--rmsc-radius);background:var(--rmsc-bg);box-shadow:0 0 0 1px #0000001a,0 4px 11px #0000001a}.rmsc .dropdown-container{position:relative;outline:0;background-color:var(--rmsc-bg);border:1px solid var(--rmsc-border);border-radius:var(--rmsc-radius)}.rmsc .dropdown-container[aria-disabled=true]:focus-within{box-shadow:var(--rmsc-gray) 0 0 0 1px;border-color:var(--rmsc-gray)}.rmsc .dropdown-container:focus-within{box-shadow:var(--rmsc-main) 0 0 0 1px;border-color:var(--rmsc-main)}.rmsc .dropdown-heading{position:relative;padding:0 var(--rmsc-p);display:flex;align-items:center;width:100%;height:var(--rmsc-h);cursor:default;outline:0}.rmsc .dropdown-heading .dropdown-heading-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}.rmsc .clear-selected-button{cursor:pointer;background:none;border:0;padding:0;display:flex}.rmsc .options{max-height:260px;overflow-y:auto;margin:0;padding-left:0}.rmsc .options li{list-style:none;margin:0}.rmsc .select-item{box-sizing:border-box;cursor:pointer;display:block;padding:var(--rmsc-p);outline-offset:-1px;outline-color:var(--rmsc-primary)}.rmsc .select-item:hover{background:var(--rmsc-hover)}.rmsc .select-item.selected{background:var(--rmsc-selected)}.rmsc .no-options{padding:var(--rmsc-p);text-align:center;color:var(--rmsc-gray)}.rmsc .search{width:100%;position:relative;border-bottom:1px solid var(--rmsc-border)}.rmsc .search input{background:none;height:var(--rmsc-h);padding:0 var(--rmsc-p);width:100%;outline:0;border:0;font-size:1em}.rmsc .search input:focus{background:var(--rmsc-hover)}.rmsc .search-clear-button{cursor:pointer;position:absolute;top:0;right:0;bottom:0;background:none;border:0;padding:0 calc(var(--rmsc-p) / 2)}.rmsc .search-clear-button [hidden]{display:none}.rmsc .item-renderer{display:flex;align-items:baseline}.rmsc .item-renderer input{margin:0 5px 0 0}.rmsc .item-renderer.disabled{opacity:.5}.rmsc .spinner{animation:rotate 2s linear infinite}.rmsc .spinner .path{stroke:var(--rmsc-border);stroke-width:4px;stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}\n");var h={allItemsAreSelected:"All items are selected.",clearSearch:"Clear Search",clearSelected:"Clear Selected",noOptions:"No options",search:"Search",selectAll:"Select All",selectAllFiltered:"Select All (Filtered)",selectSomeItems:"Select...",create:"Create"},f={value:[],hasSelectAll:!0,className:"multi-select",debounceDuration:200,options:[]},b=p().createContext({}),v=({props:e,children:t})=>{let[r,n]=(0,u.useState)(e.options);return(0,u.useEffect)((()=>{n(e.options)}),[e.options]),(0,m.jsx)(b.Provider,{value:{t:t=>{var r;return(null==(r=e.overrideStrings)?void 0:r[t])||h[t]},...f,...e,options:r,setOptions:n},children:t})},w=()=>p().useContext(b),g={when:!0,eventTypes:["keydown"]};function x(e,t,r){let n=(0,u.useMemo)((()=>Array.isArray(e)?e:[e]),[e]),l=Object.assign({},g,r),{when:a,eventTypes:s}=l,o=(0,u.useRef)(t),{target:i}=l;(0,u.useEffect)((()=>{o.current=t}));let c=(0,u.useCallback)((e=>{n.some((t=>e.key===t||e.code===t))&&o.current(e)}),[n]);(0,u.useEffect)((()=>{if(a&&typeof window<"u"){let e=i?i.current:window;return s.forEach((t=>{e&&e.addEventListener(t,c)})),()=>{s.forEach((t=>{e&&e.removeEventListener(t,c)}))}}}),[a,s,n,i,t])}var y={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",SPACE:"Space"},_=()=>(0,m.jsxs)("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"dropdown-search-clear-icon gray",children:[(0,m.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,m.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),k=({checked:e,option:t,onClick:r,disabled:n})=>(0,m.jsxs)("div",{className:"item-renderer "+(n?"disabled":""),children:[(0,m.jsx)("input",{type:"checkbox",onChange:r,checked:e,tabIndex:-1,disabled:n}),(0,m.jsx)("span",{children:t.label})]}),E=({itemRenderer:e=k,option:t,checked:r,tabIndex:n,disabled:l,onSelectionChanged:a,onClick:s})=>{let o=(0,u.useRef)(),i=()=>{l||a(!r)};return x([y.ENTER,y.SPACE],(e=>{i(),e.preventDefault()}),{target:o}),(0,m.jsx)("label",{className:"select-item "+(r?"selected":""),role:"option","aria-selected":r,tabIndex:n,ref:o,children:(0,m.jsx)(e,{option:t,checked:r,onClick:e=>{i(),s(e)},disabled:l})})},S=({options:e,onClick:t,skipIndex:r})=>{let{disabled:n,value:l,onChange:a,ItemRenderer:s}=w();return(0,m.jsx)(m.Fragment,{children:e.map(((e,o)=>{let i=o+r;return(0,m.jsx)("li",{children:(0,m.jsx)(E,{tabIndex:i,option:e,onSelectionChanged:t=>((e,t)=>{n||a(t?[...l,e]:l.filter((t=>t.value!==e.value)))})(e,t),checked:!!l.find((t=>t.value===e.value)),onClick:e=>t(e,i),itemRenderer:s,disabled:e.disabled||n})},(null==e?void 0:e.key)||o)}))})},C=()=>{let{t:e,onChange:t,options:r,setOptions:n,value:l,filterOptions:a,ItemRenderer:s,disabled:o,disableSearch:i,hasSelectAll:c,ClearIcon:d,debounceDuration:p,isCreatable:h,onCreateOption:f}=w(),b=(0,u.useRef)(),v=(0,u.useRef)(),[g,k]=(0,u.useState)(""),[C,j]=(0,u.useState)(r),[N,O]=(0,u.useState)(""),[R,A]=(0,u.useState)(0),I=(0,u.useCallback)(((e,t)=>{let r;return function(...n){clearTimeout(r),r=setTimeout((()=>{e.apply(null,n)}),t)}})((e=>O(e)),p),[]),T=(0,u.useMemo)((()=>{let e=0;return i||(e+=1),c&&(e+=1),e}),[i,c]),P={label:e(g?"selectAllFiltered":"selectAll"),value:""},D=()=>{var e;O(""),k(""),null==(e=null==v?void 0:v.current)||e.focus()},L=e=>A(e);x([y.ARROW_DOWN,y.ARROW_UP],(e=>{switch(e.code){case y.ARROW_UP:B(-1);break;case y.ARROW_DOWN:B(1);break;default:return}e.stopPropagation(),e.preventDefault()}),{target:b});let W=async()=>{let e={label:g,value:g,__isNew__:!0};f&&(e=await f(g)),n([e,...r]),D(),t([...l,e])},B=e=>{let t=R+e;t=Math.max(0,t),t=Math.min(t,r.length+Math.max(T-1,0)),A(t)};(0,u.useEffect)((()=>{var e,t;null==(t=null==(e=null==b?void 0:b.current)?void 0:e.querySelector(`[tabIndex='${R}']`))||t.focus()}),[R]);let[F,H]=(0,u.useMemo)((()=>{let e=C.filter((e=>!e.disabled));return[e.every((e=>-1!==l.findIndex((t=>t.value===e.value)))),0!==e.length]}),[C,l]);(0,u.useEffect)((()=>{(async()=>a?await a(r,N):function(e,t){return t?e.filter((({label:e,value:r})=>null!=e&&null!=r&&e.toLowerCase().includes(t.toLowerCase()))):e}(r,N))().then(j)}),[N,r]);let M=(0,u.useRef)();x([y.ENTER],W,{target:M});let V=h&&g&&!C.some((e=>(null==e?void 0:e.value)===g));return(0,m.jsxs)("div",{className:"select-panel",role:"listbox",ref:b,children:[!i&&(0,m.jsxs)("div",{className:"search",children:[(0,m.jsx)("input",{placeholder:e("search"),type:"text","aria-describedby":e("search"),onChange:e=>{I(e.target.value),k(e.target.value),A(0)},onFocus:()=>{A(0)},value:g,ref:v,tabIndex:0}),(0,m.jsx)("button",{type:"button",className:"search-clear-button",hidden:!g,onClick:D,"aria-label":e("clearSearch"),children:d||(0,m.jsx)(_,{})})]}),(0,m.jsxs)("ul",{className:"options",children:[c&&H&&(0,m.jsx)(E,{tabIndex:1===T?0:1,checked:F,option:P,onSelectionChanged:e=>{let n=(e=>{let t=C.filter((e=>!e.disabled)).map((e=>e.value));if(e){let e=[...l.map((e=>e.value)),...t];return(a?C:r).filter((t=>e.includes(t.value)))}return l.filter((e=>!t.includes(e.value)))})(e);t(n)},onClick:()=>L(1),itemRenderer:s,disabled:o}),C.length?(0,m.jsx)(S,{skipIndex:T,options:C,onClick:(e,t)=>L(t)}):V?(0,m.jsx)("li",{onClick:W,className:"select-item creatable",tabIndex:1,ref:M,children:`${e("create")} "${g}"`}):(0,m.jsx)("li",{className:"no-options",children:e("noOptions")})]})]})},j=({expanded:e})=>(0,m.jsx)("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"dropdown-heading-dropdown-arrow gray",children:(0,m.jsx)("path",{d:e?"M18 15 12 9 6 15":"M6 9L12 15 18 9"})}),N=()=>{let{t:e,value:t,options:r,valueRenderer:n}=w(),l=0===t.length,a=t.length===r.length,s=n&&n(t,r);return l?(0,m.jsx)("span",{className:"gray",children:s||e("selectSomeItems")}):(0,m.jsx)("span",{children:s||(a?e("allItemsAreSelected"):t.map((e=>e.label)).join(", "))})},O=({size:e=24})=>(0,m.jsx)("span",{style:{width:e,marginRight:"0.2rem"},children:(0,m.jsx)("svg",{width:e,height:e,className:"spinner",viewBox:"0 0 50 50",style:{display:"inline",verticalAlign:"middle"},children:(0,m.jsx)("circle",{cx:"25",cy:"25",r:"20",fill:"none",className:"path"})})}),R=()=>{let{t:e,onMenuToggle:t,ArrowRenderer:r,shouldToggleOnHover:n,isLoading:l,disabled:a,onChange:s,labelledBy:o,value:i,isOpen:c,defaultIsOpen:d,ClearSelectedIcon:p,closeOnChangedValue:h}=w();(0,u.useEffect)((()=>{h&&g(!1)}),[i]);let[f,b]=(0,u.useState)(!0),[v,g]=(0,u.useState)(d),[k,E]=(0,u.useState)(!1),S=r||j,R=(0,u.useRef)();(function(e,t){let r=(0,u.useRef)(!1);(0,u.useEffect)((()=>{r.current?e():r.current=!0}),t)})((()=>{t&&t(v)}),[v]),(0,u.useEffect)((()=>{void 0===d&&"boolean"==typeof c&&(b(!1),g(c))}),[c]),x([y.ENTER,y.ARROW_DOWN,y.SPACE,y.ESCAPE],(e=>{var t;["text","button"].includes(e.target.type)&&[y.SPACE,y.ENTER].includes(e.code)||(f&&(e.code===y.ESCAPE?(g(!1),null==(t=null==R?void 0:R.current)||t.focus()):g(!0)),e.preventDefault())}),{target:R});let A=e=>{f&&n&&g(e)};return(0,m.jsxs)("div",{tabIndex:0,className:"dropdown-container","aria-labelledby":o,"aria-expanded":v,"aria-readonly":!0,"aria-disabled":a,ref:R,onFocus:()=>!k&&E(!0),onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&f&&(E(!1),g(!1))},onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),children:[(0,m.jsxs)("div",{className:"dropdown-heading",onClick:()=>{f&&g(!l&&!a&&!v)},children:[(0,m.jsx)("div",{className:"dropdown-heading-value",children:(0,m.jsx)(N,{})}),l&&(0,m.jsx)(O,{}),i.length>0&&null!==p&&(0,m.jsx)("button",{type:"button",className:"clear-selected-button",onClick:e=>{e.stopPropagation(),s([]),f&&g(!1)},disabled:a,"aria-label":e("clearSelected"),children:p||(0,m.jsx)(_,{})}),(0,m.jsx)(S,{expanded:v})]}),v&&(0,m.jsx)("div",{className:"dropdown-content",children:(0,m.jsx)("div",{className:"panel-content",children:(0,m.jsx)(C,{})})})]})},A=e=>(0,m.jsx)(v,{props:e,children:(0,m.jsx)("div",{className:`rmsc ${e.className||"multi-select"}`,children:(0,m.jsx)(R,{})})});const{newsletterBuilder:{fromNames:I=[],templates:T={}}={}}=window,P=I.map((e=>({value:e,label:e})));var D=function(e){let{contentHandler:t,typeHandler:r,imageHandler:n,templateHandler:o,fromNameHandler:c,typeValue:d,templateValue:u,fromNameValue:p}=e;const[m,h]=(0,l.useState)({});(0,l.useEffect)((()=>{Object.keys(m).length>0||i()({path:"/wp-newsletter-builder/v1/email-types"}).then((e=>{h(e)}))}),[m]),(0,l.useEffect)((()=>{p||c(I[0])}),[c,p]);const f=(e,t)=>e.label> - -
-{{/isDynamicVariant}} diff --git a/build/email-settings/style-index.css b/build/email-settings/style-index.css new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/build/email-settings/style-index.css @@ -0,0 +1 @@ + diff --git a/build/footer/block.json b/build/footer/block.json new file mode 100644 index 00000000..b1f8e4fc --- /dev/null +++ b/build/footer/block.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2, + "name": "wp-newsletter-builder/footer", + "version": "0.1.0", + "title": "Newsletter Footer", + "category": "design", + "icon": "align-wide", + "description": "Outputs the company logo, social links, address, and footer links.", + "textdomain": "footer", + "editorScript": "file:index.js", + "editorStyle": "file:index.css", + "style": [ + "file:style-index.css" + ], + "render": "file:render.php", + "attributes": { + "narrow_separator": { + "type": "boolean", + "default": false + } + } +} \ No newline at end of file diff --git a/build/footer/index.asset.php b/build/footer/index.asset.php new file mode 100644 index 00000000..4dd3f8cd --- /dev/null +++ b/build/footer/index.asset.php @@ -0,0 +1 @@ + array('wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '8e022b5b4706ead2affa'); diff --git a/build/footer/index.css b/build/footer/index.css new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/build/footer/index.css @@ -0,0 +1 @@ + diff --git a/build/footer/index.js b/build/footer/index.js new file mode 100644 index 00000000..537b76f5 --- /dev/null +++ b/build/footer/index.js @@ -0,0 +1 @@ +!function(){var e,t={168:function(e,t,r){"use strict";var n=window.wp.blocks,l=window.wp.element,i=window.wp.i18n,o=r(184),s=r.n(o),a=window.wp.blockEditor,c=window.wp.apiFetch,u=r.n(c),p=window.wp.components,w=window.wp.data,d=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"wp-newsletter-builder/footer","version":"0.1.0","title":"Newsletter Footer","category":"design","icon":"align-wide","description":"Outputs the company logo, social links, address, and footer links.","textdomain":"footer","editorScript":"file:index.ts","editorStyle":"file:index.css","style":["file:style-index.css"],"render":"file:render.php","attributes":{"narrow_separator":{"type":"boolean","default":false}}}');(0,n.registerBlockType)(d,{apiVersion:2,edit:function(e){var t,r,n,o,c,d;let{attributes:{narrow_separator:f=!1}}=e;const[m,b]=(0,l.useState)(!0),[_,g]=(0,l.useState)(),h=null!==(t=_?.facebook_url)&&void 0!==t?t:"",k=null!==(r=_?.twitter_url)&&void 0!==r?r:"",v=null!==(n=_?.instagram_url)&&void 0!==n?n:"",E=null!==(o=_?.youtube_url)&&void 0!==o?o:"",y=null!==(c=_?.image)&&void 0!==c?c:0,N=null!==(d=_?.address)&&void 0!==d?d:"";(0,l.useEffect)((()=>{_?b(!1):u()({path:"/wp-newsletter-builder/v1/footer_settings"}).then((e=>{g(e)}))}),[_]);const{media:O=null}=(0,w.useSelect)((e=>({media:y?e("core").getMedia(y):null})),[_,y]),x=O?O.source_url:"",S=O?O.alt_text:"";return(0,l.createElement)("div",(0,a.useBlockProps)(),(0,l.createElement)("hr",{className:s()("wp-block-separator","has-alpha-channel-opacity",{"is-style-wide":!f})}),m?(0,l.createElement)(p.Spinner,null):(0,l.createElement)(l.Fragment,null,h||k||v||E?(0,l.createElement)("div",{className:"wp-block-wp-newsletter-builder-footer__social-links"},h?(0,l.createElement)("span",{className:"wp-block-wp-newsletter-builder-footer__social-links__item"},(0,l.createElement)("a",{className:"wp-block-wp-newsletter-builder-footer__social-links__link",href:h},(0,l.createElement)("img",{src:"/wp-content/plugins/wp-newsletter-builder/images/facebook.png",alt:"Facebook",height:"26",width:"26"}))):null,k?(0,l.createElement)("span",{className:"wp-block-wp-newsletter-builder-footer__social-links__item"},(0,l.createElement)("a",{className:"wp-block-wp-newsletter-builder-footer__social-links__link",href:k},(0,l.createElement)("img",{src:"/wp-content/plugins/wp-newsletter-builder/images/twitter.png",alt:"Twitter",height:"26",width:"26"}))):null,v?(0,l.createElement)("span",{className:"wp-block-wp-newsletter-builder-footer__social-links__item"},(0,l.createElement)("a",{className:"wp-block-wp-newsletter-builder-footer__social-links__link",href:v},(0,l.createElement)("img",{src:"/wp-content/plugins/wp-newsletter-builder/images/instagram.png",alt:"Instagram",height:"26",width:"26"}))):null,E?(0,l.createElement)("span",{className:"wp-block-wp-newsletter-builder-footer__social-links__item"},(0,l.createElement)("a",{className:"wp-block-wp-newsletter-builder-footer__social-links__link",href:E},(0,l.createElement)("img",{src:"/wp-content/plugins/wp-newsletter-builder/images/youtube.png",alt:"YouTube",height:"26",width:"26"}))):null):null,x?(0,l.createElement)("div",{className:"wp-block-wp-newsletter-builder-footer__logo"},(0,l.createElement)("img",{src:x,alt:S,width:"300"})):null,N?(0,l.createElement)("div",{className:"wp-block-wp-newsletter-builder-footer__address"},N):null),(0,l.createElement)("div",{className:"wp-block-wp-newsletter-builder-footer__links"},(0,l.createElement)("preferences",null,(0,i.__)("Preferences","wp-newsletter-builder"))," | ",(0,l.createElement)("unsubscribe",null,(0,i.__)("Unsubscribe","wp-newsletter-builder"))))},title:d.title})},184:function(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function l(){for(var e=[],t=0;t0?c.join(","):"any",type:t});await En()({path:r,parse:!1}).then((e=>{const t=parseInt(e.headers.get("X-WP-TotalPages"),10);return n=t>s?s:t,e.json()})).then((t=>{g((e=>[...e,...t])),b(!1),(n&&n>e||e>=1&&i&&C.length>0)&&k(e+1)})).catch((e=>h(e.message)))}),[E,t,s,i,c,C.length,p]);(0,dn.useEffect)((()=>{x(u)}),[u]),(0,dn.useEffect)((()=>{E&&p<=E.length?k():g([])}),[E,k,p]);const R=e=>{v(S.current.contains(e.target))},T=e=>{"Escape"===e.key&&v(!1)};(0,dn.useEffect)((()=>(document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)))),(0,dn.useEffect)((()=>(S&&document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R))));const I=e=>{let t=[];if(C.some((t=>t.id===e.id))){const n=C.findIndex((t=>t.id===e.id));t=[...C.slice(0,n),...C.slice(n+1,C.length)]}else i?t=[...C,e]:(t=[e],v(!1));x(t),a(t)};return(0,e.jsx)("form",{className:"autocomplete__component",onSubmit:e=>e.preventDefault(),children:(0,e.jsxs)("div",{className:Zn()("components-base-control","autocomplete-base-control",n),ref:S,children:[(0,e.jsxs)("div",{"aria-expanded":y,"aria-haspopup":"listbox","aria-owns":`listbox-${d}`,className:Zn()("components-base-control__field","autocomplete-base-control__field"),role:"combobox",children:[(0,e.jsx)("label",{className:Zn()("components-base-control__label","autocomplete-base-control__label"),htmlFor:`autocomplete-${d}`,children:(0,e.jsx)("div",{children:o})}),C.length>0?(0,e.jsx)("ul",{role:"listbox","aria-labelledby":`autocomplete-${d}`,id:`selected-items-${d}`,className:Zn()("autocomplete__selection--results","autocomplete__selection-list"),children:C.map((t=>(0,e.jsx)("li",{className:"autocomplete__selection-list--item",children:(0,e.jsx)(qt.Button,{className:"autocomplete__selection-list--item--button",isSecondary:!0,isSmall:!0,onClick:()=>I(t),type:"button",children:t.title})},t.title)))}):null,(0,e.jsx)("input",{"aria-autocomplete":"list",autoComplete:"off",className:Zn()("components-text-control__input","autocomplete-text-control__input",{"autocomplete-text-control__input--working":y}),id:`autocomplete-${d}`,onChange:e=>w(e.target.value),onFocus:()=>v(!0),placeholder:l,type:"text",value:_})]}),(0,e.jsx)(mr,{emptyLabel:r,error:f,labelledById:`autocomplete-${d}`,id:`listbox-${d}`,isOpen:y,loading:A&&E,onSelect:I,options:m,selectedItems:C,threshold:p,value:E})]})})};vr.defaultProps={type:"post",className:"",emptyLabel:(0,Wt.__)("No items found","alley-scripts"),label:(0,Wt.__)("Search for items","alley-scripts"),maxPages:5,multiple:!1,placeholder:(0,Wt.__)("Search for items","alley-scripts"),subTypes:[],selected:[],threshold:3},vr.propTypes={type:o().string,className:o().string,emptyLabel:o().string,label:o().string,maxPages:o().number,multiple:o().bool,onSelect:o().func.isRequired,placeholder:o().string,subTypes:o().arrayOf(o().string),selected:o().arrayOf([o().shape({id:o().number,title:o().string})]),threshold:o().number};const Ar=vr,br=({className:t,emptyLabel:n,label:r,maxPages:o,multiple:s,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u})=>(0,e.jsx)(Ar,{type:"term",className:t,emptyLabel:n,label:r,maxPages:o,multiple:s,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u});br.defaultProps={className:"",emptyLabel:(0,Wt.__)("No terms found","alley-scripts"),label:(0,Wt.__)("Search for terms","alley-scripts"),maxPages:5,multiple:!1,placeholder:(0,Wt.__)("Search for terms","alley-scripts"),subTypes:[],selected:[],threshold:3},br.propTypes={className:o().string,emptyLabel:o().string,label:o().string,maxPages:o().number,multiple:o().bool,onSelect:o().func.isRequired,placeholder:o().string,subTypes:o().arrayOf(o().string),selected:o().arrayOf([o().shape({id:o().number,title:o().string})]),threshold:o().number};const _r=br,wr=Ut.div`
+ height: auto;
+ width: 100%;
+`,Cr=({src:t})=>(0,e.jsx)(wr,{children:(0,e.jsx)("video",{className:"edit-video-preview",controls:!0,src:t})});Cr.propTypes={src:o().string.isRequired};const xr=({className:t,onReset:n,onUpdate:r,onUpdateURL:o,value:s,valueURL:i})=>(0,e.jsx)(an,{allowedTypes:["video"],className:t,icon:"format-video",onReset:n,onUpdate:r,onUpdateURL:o,preview:Cr,value:s,valueURL:i});xr.defaultProps={className:"",onUpdateURL:null,valueURL:""},xr.propTypes={className:o().string,onReset:o().func.isRequired,onUpdate:o().func.isRequired,onUpdateURL:o().func,value:o().number.isRequired,valueURL:o().string};const Sr=xr})(),r})(),e.exports=t()},61:function(e,t,n){"use strict";var r=window.wp.blocks,o=window.wp.element,s=window.wp.i18n,i=window.wp.blockEditor,a=window.wp.data,l=n(373),c=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"wp-newsletter-builder/header","version":"0.1.0","title":"Newsletter Header","category":"design","icon":"format-image","description":"Displays the header image for a newsletter","textdomain":"header","editorScript":"file:index.ts","editorStyle":"file:index.css","style":["file:style-index.css"],"render":"file:render.php"}');(0,r.registerBlockType)(c,{apiVersion:2,edit:function(){const[e]=(0,l.usePostMeta)(),{nb_newsletter_header_img:t}=e,{media:n=null}=(0,a.useSelect)((e=>({media:t?e("core").getMedia(t):null})),[t]),r=n?n.source_url:"";return(0,o.createElement)("div",(0,i.useBlockProps)(),r?(0,o.createElement)("img",{src:r,alt:(0,s.__)("Header","wp-newsletter-builder")}):null)},title:c.title})}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var s=n[e]={exports:{}};return t[e](s,s.exports,r),s.exports}r.m=t,e=[],r.O=function(t,n,o,s){if(!n){var i=1/0;for(u=0;u 0?c.join(","):"any",type:t});await En()({path:r,parse:!1}).then((e=>{const t=parseInt(e.headers.get("X-WP-TotalPages"),10);return n=t>s?s:t,e.json()})).then((t=>{g((e=>[...e,...t])),_(!1),(n&&n>e||e>=1&&i&&C.length>0)&&k(e+1)})).catch((e=>h(e.message)))}),[E,t,s,i,c,C.length,p]);(0,dn.useEffect)((()=>{x(u)}),[u]),(0,dn.useEffect)((()=>{E&&p<=E.length?k():g([])}),[E,k,p]);const R=e=>{v(S.current.contains(e.target))},T=e=>{"Escape"===e.key&&v(!1)};(0,dn.useEffect)((()=>(document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)))),(0,dn.useEffect)((()=>(S&&document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R))));const I=e=>{let t=[];if(C.some((t=>t.id===e.id))){const n=C.findIndex((t=>t.id===e.id));t=[...C.slice(0,n),...C.slice(n+1,C.length)]}else i?t=[...C,e]:(t=[e],v(!1));x(t),a(t)};return(0,e.jsx)("form",{className:"autocomplete__component",onSubmit:e=>e.preventDefault(),children:(0,e.jsxs)("div",{className:Zn()("components-base-control","autocomplete-base-control",n),ref:S,children:[(0,e.jsxs)("div",{"aria-expanded":y,"aria-haspopup":"listbox","aria-owns":`listbox-${d}`,className:Zn()("components-base-control__field","autocomplete-base-control__field"),role:"combobox",children:[(0,e.jsx)("label",{className:Zn()("components-base-control__label","autocomplete-base-control__label"),htmlFor:`autocomplete-${d}`,children:(0,e.jsx)("div",{children:o})}),C.length>0?(0,e.jsx)("ul",{role:"listbox","aria-labelledby":`autocomplete-${d}`,id:`selected-items-${d}`,className:Zn()("autocomplete__selection--results","autocomplete__selection-list"),children:C.map((t=>(0,e.jsx)("li",{className:"autocomplete__selection-list--item",children:(0,e.jsx)($t.Button,{className:"autocomplete__selection-list--item--button",isSecondary:!0,isSmall:!0,onClick:()=>I(t),type:"button",children:t.title})},t.title)))}):null,(0,e.jsx)("input",{"aria-autocomplete":"list",autoComplete:"off",className:Zn()("components-text-control__input","autocomplete-text-control__input",{"autocomplete-text-control__input--working":y}),id:`autocomplete-${d}`,onChange:e=>w(e.target.value),onFocus:()=>v(!0),placeholder:l,type:"text",value:A})]}),(0,e.jsx)(mr,{emptyLabel:r,error:f,labelledById:`autocomplete-${d}`,id:`listbox-${d}`,isOpen:y,loading:b&&E,onSelect:I,options:m,selectedItems:C,threshold:p,value:E})]})})};vr.defaultProps={type:"post",className:"",emptyLabel:(0,Wt.__)("No items found","alley-scripts"),label:(0,Wt.__)("Search for items","alley-scripts"),maxPages:5,multiple:!1,placeholder:(0,Wt.__)("Search for items","alley-scripts"),subTypes:[],selected:[],threshold:3},vr.propTypes={type:o().string,className:o().string,emptyLabel:o().string,label:o().string,maxPages:o().number,multiple:o().bool,onSelect:o().func.isRequired,placeholder:o().string,subTypes:o().arrayOf(o().string),selected:o().arrayOf([o().shape({id:o().number,title:o().string})]),threshold:o().number};const br=vr,_r=({className:t,emptyLabel:n,label:r,maxPages:o,multiple:s,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u})=>(0,e.jsx)(br,{type:"term",className:t,emptyLabel:n,label:r,maxPages:o,multiple:s,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u});_r.defaultProps={className:"",emptyLabel:(0,Wt.__)("No terms found","alley-scripts"),label:(0,Wt.__)("Search for terms","alley-scripts"),maxPages:5,multiple:!1,placeholder:(0,Wt.__)("Search for terms","alley-scripts"),subTypes:[],selected:[],threshold:3},_r.propTypes={className:o().string,emptyLabel:o().string,label:o().string,maxPages:o().number,multiple:o().bool,onSelect:o().func.isRequired,placeholder:o().string,subTypes:o().arrayOf(o().string),selected:o().arrayOf([o().shape({id:o().number,title:o().string})]),threshold:o().number};const Ar=_r,wr=Ut.div`
+ height: auto;
+ width: 100%;
+`,Cr=({src:t})=>(0,e.jsx)(wr,{children:(0,e.jsx)("video",{className:"edit-video-preview",controls:!0,src:t})});Cr.propTypes={src:o().string.isRequired};const xr=({className:t,onReset:n,onUpdate:r,onUpdateURL:o,value:s,valueURL:i})=>(0,e.jsx)(an,{allowedTypes:["video"],className:t,icon:"format-video",onReset:n,onUpdate:r,onUpdateURL:o,preview:Cr,value:s,valueURL:i});xr.defaultProps={className:"",onUpdateURL:null,valueURL:""},xr.propTypes={className:o().string,onReset:o().func.isRequired,onUpdate:o().func.isRequired,onUpdateURL:o().func,value:o().number.isRequired,valueURL:o().string};const Sr=xr})(),r})(),e.exports=t()},372:function(e,t,n){"use strict";var r=window.wp.blocks,o=window.wp.element,s=window.wp.i18n,i=n(373),a=window.wp.data,l=window.wp.components,c=window.wp.blockEditor,u=function(e){let{featured_image:t,post_date:n,title:r}=e;return(0,o.createElement)("div",{className:"nb-post-picker-result"},(0,o.createElement)("div",{className:"nb-post-picker-result-image__container"},t?(0,o.createElement)("img",{className:"nb-post-picker-result-image",src:t,alt:""}):null),(0,o.createElement)(i.SafeHtml,{html:r,className:"nb-post-picker-result-title",tag:"div"}),(0,o.createElement)("span",{className:"nb-post-picker-result-date"},n))},p=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"wp-newsletter-builder/post","version":"0.1.0","title":"Newsletter Single Post","category":"design","icon":"admin-post","description":"Displays a post","textdomain":"post","editorScript":"file:index.ts","editorStyle":"file:index.css","style":["file:style-index.css"],"render":"file:render.php","attributes":{"postId":{"type":"number","default":0},"showImage":{"type":"boolean","default":true},"showExcerpt":{"type":"boolean","default":true},"showContent":{"type":"boolean","default":true},"showByline":{"type":"boolean","default":true},"showCta":{"type":"boolean","default":true},"showProBadge":{"type":"boolean","default":true},"order":{"type":"array","items":{"type":"string"},"default":["title","byline","image","excerpt","content","cta"]},"overrideTitle":{"type":"string","default":""},"overrideImage":{"type":"number","default":0},"overrideExcerpt":{"type":"string","default":""},"overrideContent":{"type":"string","default":""},"overrideByline":{"type":"string","default":""},"number":{"type":"number","default":null},"smallerFont":{"type":"boolean","default":false},"imgSizes":{"type":"string","default":""}}}');(0,r.registerBlockType)(p,{apiVersion:2,edit:function(e){let{attributes:{postId:t=0,showImage:n,showExcerpt:r,showContent:p,showCta:d,showByline:f,order:h,overrideTitle:m,overrideImage:g,overrideExcerpt:y,overrideContent:v,overrideByline:b,number:_,smallerFont:A},setAttributes:w}=e;const C=e=>{w({postId:e,overrideTitle:"",overrideImage:0,overrideExcerpt:"",overrideContent:""})},x=(0,a.useSelect)((e=>t?e("core").getEntityRecord("postType","post",t):null),[t]);let S=x?x.title.rendered:"";const E=x?x.content.rendered:"";let k=x?x.excerpt.raw:"",R=x?x.wp_newsletter_builder_byline:"",T=x?x.featured_media:null;S=m||S,T=g||T,k=y||k,R=b||R;const{media:I=null}=(0,a.useSelect)((e=>({media:T?e("core").getMedia(T):null})),[T]),N=I?I.source_url:"",O=E.match(/ /gi)||[],P=v||(L=O?.slice(0,2).join(""),L?L.replace(/]*?>(.*?)<\/a>/gi,"$1"):"");var L;const j=new Date;j.setMonth(j.getMonth()-3);const D=A?"post__title--small":"";return(0,o.createElement)("div",(0,c.useBlockProps)(),t&&!x?(0,o.createElement)(l.Spinner,null):null,t?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(l.Button,{variant:"primary",isDestructive:!0,onClick:()=>C(0),className:"newsletter-remove-post","aria-label":(0,s.__)("Remove Post","wp-newsletter-builder")},"X"),h.map((e=>{switch(e){case"image":return n&&N?(0,o.createElement)("div",{className:"image-container"},(0,o.createElement)("img",{src:N,alt:S})):null;case"title":return(0,o.createElement)("h2",{className:D},_?(0,o.createElement)("span",{className:"newsletter-post__number"},`${_}. `):"",(0,o.createElement)(c.RichText,{value:S,tagName:"span",onChange:e=>w({overrideTitle:e})}));case"byline":return f?(0,o.createElement)("p",{className:"post__byline"},(0,s.__)("By ","wp-newsletter-builder"),(0,o.createElement)(c.RichText,{value:R,tagName:"span",onChange:e=>w({overrideByline:e}),allowedFormats:[]})):null;case"excerpt":return r?(0,o.createElement)("div",{className:"post__dek"},(0,o.createElement)(c.RichText,{value:k,tagName:"p",multiline:!1,onChange:e=>w({overrideExcerpt:e})})):null;case"content":return p?(0,o.createElement)(c.RichText,{value:P,tagName:"div",multiline:!0,onChange:e=>w({overrideContent:e})}):null;case"cta":return d?(0,o.createElement)("div",{className:"newsletter-read-more has-text-align-center"},(0,o.createElement)("span",{className:"wp-element-button"},(0,s.__)("Read More","wp-newsletter-builder"))):null;default:return""}})),(0,o.createElement)(c.InspectorControls,null,(0,o.createElement)(l.PanelBody,{title:(0,s.__)("Post","wp-newsletter-builder"),initialOpen:!0},(0,o.createElement)(l.PanelRow,null,(0,o.createElement)(l.CheckboxControl,{label:(0,s.__)("Show image","wp-newsletter-builder"),checked:n,onChange:e=>w({showImage:e})})),(0,o.createElement)(l.PanelRow,null,(0,o.createElement)(l.CheckboxControl,{label:(0,s.__)("Show Byline","wp-newsletter-builder"),checked:f,onChange:e=>w({showByline:e})})),(0,o.createElement)(l.PanelRow,null,(0,o.createElement)(l.CheckboxControl,{label:(0,s.__)("Show dek","wp-newsletter-builder"),checked:r,onChange:e=>w({showExcerpt:e})})),(0,o.createElement)(l.PanelRow,null,(0,o.createElement)(l.CheckboxControl,{label:(0,s.__)("Show content","wp-newsletter-builder"),checked:p,onChange:e=>w({showContent:e})})),(0,o.createElement)(l.PanelRow,null,(0,o.createElement)(l.CheckboxControl,{label:(0,s.__)("Show CTA","wp-newsletter-builder"),checked:d,onChange:e=>w({showCta:e})}))),(0,o.createElement)(l.PanelBody,{title:(0,s.__)("Override Image","wp-newsletter-builder"),initialOpen:!0},(0,o.createElement)(l.PanelRow,null,(0,o.createElement)(i.ImagePicker,{value:null!=g?g:0,onUpdate:e=>{let{id:t}=e;return w({overrideImage:t})},onReset:()=>w({overrideImage:0})}))))):(0,o.createElement)("div",null,(0,o.createElement)(i.PostPicker,{onUpdate:C,allowedTypes:["post"],onReset:()=>C(0),params:{after:j.toISOString(),per_page:20},title:(0,s.__)("Please select a post","wp-newsletter-builder"),value:t,searchRender:u})))},title:p.title})}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var s=n[e]={exports:{}};return t[e](s,s.exports,r),s.exports}r.m=t,e=[],r.O=function(t,n,o,s){if(!n){var i=1/0;for(u=0;u 0?c.join(","):"any",type:t});await En()({path:r,parse:!1}).then((e=>{const t=parseInt(e.headers.get("X-WP-TotalPages"),10);return n=t>s?s:t,e.json()})).then((t=>{g((e=>[...e,...t])),_(!1),(n&&n>e||e>=1&&i&&C.length>0)&&k(e+1)})).catch((e=>h(e.message)))}),[E,t,s,i,c,C.length,p]);(0,dn.useEffect)((()=>{x(u)}),[u]),(0,dn.useEffect)((()=>{E&&p<=E.length?k():g([])}),[E,k,p]);const R=e=>{v(S.current.contains(e.target))},T=e=>{"Escape"===e.key&&v(!1)};(0,dn.useEffect)((()=>(document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)))),(0,dn.useEffect)((()=>(S&&document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R))));const I=e=>{let t=[];if(C.some((t=>t.id===e.id))){const n=C.findIndex((t=>t.id===e.id));t=[...C.slice(0,n),...C.slice(n+1,C.length)]}else i?t=[...C,e]:(t=[e],v(!1));x(t),a(t)};return(0,e.jsx)("form",{className:"autocomplete__component",onSubmit:e=>e.preventDefault(),children:(0,e.jsxs)("div",{className:Kn()("components-base-control","autocomplete-base-control",n),ref:S,children:[(0,e.jsxs)("div",{"aria-expanded":y,"aria-haspopup":"listbox","aria-owns":`listbox-${d}`,className:Kn()("components-base-control__field","autocomplete-base-control__field"),role:"combobox",children:[(0,e.jsx)("label",{className:Kn()("components-base-control__label","autocomplete-base-control__label"),htmlFor:`autocomplete-${d}`,children:(0,e.jsx)("div",{children:o})}),C.length>0?(0,e.jsx)("ul",{role:"listbox","aria-labelledby":`autocomplete-${d}`,id:`selected-items-${d}`,className:Kn()("autocomplete__selection--results","autocomplete__selection-list"),children:C.map((t=>(0,e.jsx)("li",{className:"autocomplete__selection-list--item",children:(0,e.jsx)(qt.Button,{className:"autocomplete__selection-list--item--button",isSecondary:!0,isSmall:!0,onClick:()=>I(t),type:"button",children:t.title})},t.title)))}):null,(0,e.jsx)("input",{"aria-autocomplete":"list",autoComplete:"off",className:Kn()("components-text-control__input","autocomplete-text-control__input",{"autocomplete-text-control__input--working":y}),id:`autocomplete-${d}`,onChange:e=>w(e.target.value),onFocus:()=>v(!0),placeholder:l,type:"text",value:A})]}),(0,e.jsx)(mr,{emptyLabel:r,error:f,labelledById:`autocomplete-${d}`,id:`listbox-${d}`,isOpen:y,loading:b&&E,onSelect:I,options:m,selectedItems:C,threshold:p,value:E})]})})};vr.defaultProps={type:"post",className:"",emptyLabel:(0,Wt.__)("No items found","alley-scripts"),label:(0,Wt.__)("Search for items","alley-scripts"),maxPages:5,multiple:!1,placeholder:(0,Wt.__)("Search for items","alley-scripts"),subTypes:[],selected:[],threshold:3},vr.propTypes={type:o().string,className:o().string,emptyLabel:o().string,label:o().string,maxPages:o().number,multiple:o().bool,onSelect:o().func.isRequired,placeholder:o().string,subTypes:o().arrayOf(o().string),selected:o().arrayOf([o().shape({id:o().number,title:o().string})]),threshold:o().number};const br=vr,_r=({className:t,emptyLabel:n,label:r,maxPages:o,multiple:s,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u})=>(0,e.jsx)(br,{type:"term",className:t,emptyLabel:n,label:r,maxPages:o,multiple:s,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u});_r.defaultProps={className:"",emptyLabel:(0,Wt.__)("No terms found","alley-scripts"),label:(0,Wt.__)("Search for terms","alley-scripts"),maxPages:5,multiple:!1,placeholder:(0,Wt.__)("Search for terms","alley-scripts"),subTypes:[],selected:[],threshold:3},_r.propTypes={className:o().string,emptyLabel:o().string,label:o().string,maxPages:o().number,multiple:o().bool,onSelect:o().func.isRequired,placeholder:o().string,subTypes:o().arrayOf(o().string),selected:o().arrayOf([o().shape({id:o().number,title:o().string})]),threshold:o().number};const Ar=_r,wr=Ut.div`
+ height: auto;
+ width: 100%;
+`,Cr=({src:t})=>(0,e.jsx)(wr,{children:(0,e.jsx)("video",{className:"edit-video-preview",controls:!0,src:t})});Cr.propTypes={src:o().string.isRequired};const xr=({className:t,onReset:n,onUpdate:r,onUpdateURL:o,value:s,valueURL:i})=>(0,e.jsx)(an,{allowedTypes:["video"],className:t,icon:"format-video",onReset:n,onUpdate:r,onUpdateURL:o,preview:Cr,value:s,valueURL:i});xr.defaultProps={className:"",onUpdateURL:null,valueURL:""},xr.propTypes={className:o().string,onReset:o().func.isRequired,onUpdate:o().func.isRequired,onUpdateURL:o().func,value:o().number.isRequired,valueURL:o().string};const Sr=xr})(),r})(),e.exports=t()},797:function(e,t,n){"use strict";var r=window.wp.element,o=window.wp.blocks,s=window.wp.blockEditor,i=window.wp.data,a=window.wp.i18n,l=window.wp.components,c=window.wp.url,u=window.wp.apiFetch,p=n.n(u),d=function(e){let{baseUrl:t,searchRender:n,selected:o,setSelected:s}=e;const[i,u]=(0,r.useState)(!1),[d,f]=(0,r.useState)([]),[h,m]=(0,r.useState)(!1),[g,y]=(0,r.useState)(0),[v,b]=(0,r.useState)({searchValue:"",page:1}),_=(0,r.useCallback)((async function(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function r(){let n=(0,c.addQueryArgs)(t,{page:e.page});return e.searchValue&&e.searchValue.length>2&&(n=(0,c.addQueryArgs)(n,{search:e.searchValue})),n}if(e.searchValue&&e.searchValue.length<=2)return;const o=r();u(!0);const s=await p()({path:o,parse:!1});y(parseInt(s.headers.get("X-WP-TotalPages"),10));const i=await s.json();let a=i;e.page>1&&(a=[...d,...i]),n||(f(a),u(!1))}),[d,t]);return(0,r.useEffect)((()=>{let e=!1;return h||(m(!0),_(v,e)),()=>{e=!0}}),[_,h,v]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)(l.TextControl,{value:v.searchValue,placeholder:(0,a.__)("Search...","alley-scripts"),label:(0,a.__)("Search","alley-scripts"),onChange:e=>{const t={...v,searchValue:e,page:1};b(t),_(t)}}),(0,r.createElement)("div",{className:"alley-scripts-post-picker__post-list"},d?d.map((e=>o&&o.includes(e)?null:(0,r.createElement)(l.Button,{key:e.id,className:"alley-scripts-post-picker__post",onClick:()=>s(e)},n?n(e):(0,r.createElement)("div",null,(0,r.createElement)("strong",null,e.title),(0,a.sprintf)(" (%s)",e.subtype))))):null,i?(0,r.createElement)(l.Spinner,null):null,g>0&&v.page >
-
- ="A"&&e<="Z"};function wt(e){for(var t="",n=0;n {const e={...h,page:h.page+1};m(e),g(e)},children:(0,Wt.__)("Load More","alley-scripts")})}):null]})]})},nr=({baseUrl:t,closeModal:n,modalTitle:r,onUpdate:s,searchRender:o,suppressPostIds:i=[]})=>{const[a,l]=(0,pn.useState)();return(0,e.jsxs)(qt.Modal,{isDismissible:!0,title:r,onRequestClose:n,closeButtonLabel:"Close",children:[(0,e.jsx)(tr,{baseUrl:t,selected:a??0,setSelected:l,searchRender:o,suppressPostIds:i}),(0,e.jsxs)("div",{className:"alley-scripts-post-picker__buttons",children:[(0,e.jsx)(qt.Button,{variant:"secondary",onClick:n,children:(0,Wt.__)("Cancel","alley-scripts")}),(0,e.jsx)(qt.Button,{variant:"primary",onClick:()=>{a&&(s(a),n())},disabled:!a,children:(0,Wt.__)("Select","alley-scripts")})]})]})},rr=Ut.div`
+ display: block;
+ position: relative;
+`,sr=Ut.div`
+ border: 1px solid #eee;
+ display: flex;
+ flex-direction: column;
+ margin: 5px 0;
+ padding: 0.5rem 0.75rem;
+ text-align: center;
+`,or=({allowedTypes:t,className:n,getPostType:r,modalTitle:s=(0,Wt.__)("Select Post","alley-scripts"),onReset:o,onUpdate:i,params:a={},previewRender:l,replaceText:c=(0,Wt.__)("Replace","alley-scripts"),resetText:u=(0,Wt.__)("Reset","alley-scripts"),searchEndpoint:d="/wp/v2/search",searchRender:p,selectText:f=(0,Wt.__)("Select","alley-scripts"),suppressPostIds:h=[],title:m="",value:g=0})=>{const[y,b]=(0,pn.useState)(!1),v=(0,fn.addQueryArgs)(d,{type:"post",subtype:t??"any",...a}),_=En(g,r),{featured_media:A,title:{rendered:w=""}={},type:x=""}=_||{},C=()=>{b(!0)};return 0!==g&&null===_?(0,e.jsx)(qt.Spinner,{}):(0,e.jsxs)(rr,{className:n,children:[m?(0,e.jsx)("h4",{children:m}):null,0!==g&&null!==_?(0,e.jsxs)(e.Fragment,{children:[void 0!==l?l(_):(0,e.jsx)(sr,{children:(0,e.jsx)(er,{title:w,postType:x,attachmentID:A})}),(0,e.jsxs)(qt.ButtonGroup,{children:[(0,e.jsx)(qt.Button,{variant:"secondary",onClick:o,style:{margin:"0 4px"},children:u}),(0,e.jsx)(qt.Button,{variant:"secondary",onClick:C,style:{margin:"0 4px"},children:c})]})]}):(0,e.jsx)(qt.Button,{onClick:C,variant:"secondary",children:f}),y?(0,e.jsx)(nr,{closeModal:()=>{b(!1)},baseUrl:v,modalTitle:s,onUpdate:i,searchRender:p,suppressPostIds:h}):null]})},ir=({className:t,emptyLabel:n,label:r,maxPages:s,multiple:o,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u})=>(0,e.jsx)(vr,{type:"post",className:t,emptyLabel:n,label:r,maxPages:s,multiple:o,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u});ir.defaultProps={className:"",emptyLabel:(0,Wt.__)("No posts found","alley-scripts"),label:(0,Wt.__)("Search for posts","alley-scripts"),maxPages:5,multiple:!1,placeholder:(0,Wt.__)("Search for posts","alley-scripts"),subTypes:[],selected:[],threshold:3},ir.propTypes={className:s().string,emptyLabel:s().string,label:s().string,maxPages:s().number,multiple:s().bool,onSelect:s().func.isRequired,placeholder:s().string,subTypes:s().arrayOf(s().string),selected:s().arrayOf([s().shape({id:s().number,title:s().string})]),threshold:s().number};const ar=ir,lr={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let cr;const ur=new Uint8Array(16);function dr(){if(!cr&&(cr="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!cr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return cr(ur)}const pr=[];for(let e=0;e<256;++e)pr.push((e+256).toString(16).slice(1));const fr=function(e,t,n){if(lr.randomUUID&&!t&&!e)return lr.randomUUID();const r=(e=e||{}).random||(e.rng||dr)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return pr[e[t+0]]+pr[e[t+1]]+pr[e[t+2]]+pr[e[t+3]]+"-"+pr[e[t+4]]+pr[e[t+5]]+"-"+pr[e[t+6]]+pr[e[t+7]]+"-"+pr[e[t+8]]+pr[e[t+9]]+"-"+pr[e[t+10]]+pr[e[t+11]]+pr[e[t+12]]+pr[e[t+13]]+pr[e[t+14]]+pr[e[t+15]]}(r)},hr=({emptyLabel:t,error:n,id:r,isOpen:s,labelledbyId:o,loading:i,onSelect:a,options:l,selectedItems:c,threshold:u,value:d})=>{if(!i&&(""===d||u>d.length))return null;let p="",f="";return i?(p="loading",f=(0,Wt.__)("Loading...","alley-scripts")):n?(p="error",f=n):i||0!==l.length||(p="no-posts",f=t),i||!i&&(d&&0===l.length||n)?(0,e.jsx)("div",{"aria-busy":!0,className:Zn()("autocomplete__dropdown",{"autocomplete__dropdown--is-open":s}),children:(0,e.jsx)("div",{className:Zn()("autocomplete__dropdown--notice",`autocomplete__${p}`),children:f})}):(0,e.jsx)("div",{className:Zn()("autocomplete__dropdown",{"autocomplete__dropdown--is-open":s}),children:(0,e.jsx)("ul",{role:"listbox","aria-labelledby":o,id:r,className:Zn()("autocomplete__dropdown--results","autocomplete__list"),children:l.map((t=>(0,e.jsx)("li",{className:"autocomplete__list--item",children:(0,e.jsx)(qt.Button,{onClick:()=>a(t),type:"button",disabled:c.some((e=>e.id===t.id)),isTertiary:!0,children:t.title})},t.id)))})})};hr.propTypes={emptyLabel:s().string.isRequired,error:s().string.isRequired,id:s().string.isRequired,isOpen:s().bool.isRequired,labelledbyId:s().string.isRequired,loading:s().bool.isRequired,options:s().arrayOf(s().shape({label:s().string,value:s().string})).isRequired,onSelect:s().func.isRequired,selectedItems:s().shape([]).isRequired,threshold:s().number.isRequired,value:s().string.isRequired};const mr=hr;var gr=n(458),yr={};yr.styleTagTransform=Wn(),yr.setAttributes=zn(),yr.insert=Bn().bind(null,"head"),yr.domAPI=Un(),yr.insertStyleElement=$n(),Ln()(gr.Z,yr),gr.Z&&gr.Z.locals&&gr.Z.locals;const br=({type:t,className:n,emptyLabel:r,label:s,maxPages:o,multiple:i,onSelect:a,placeholder:l,subTypes:c,selected:u,threshold:d})=>{const p=fr(),[f,h]=(0,pn.useState)(""),[m,g]=(0,pn.useState)([]),[y,b]=(0,pn.useState)(!1),[v,_]=(0,pn.useState)(!1),[A,w]=(0,pn.useState)(""),[x,C]=(0,pn.useState)([]),S=(0,pn.useRef)(),k=hn(A,750),E=(0,pn.useCallback)((async(e=1)=>{if(k.length (.*?)<\/p>/):[];n=r&&r[1]?r[1]:""}return{postId:t("id"),postStatus:t("status"),postTitle:t("title"),postExcerpt:n}}),[]),[x,C]=(0,e.useState)([]),S=""!==p,k=""!==f,E=Array.isArray(h)?h:[h],{newsletterBuilder:{breakingLists:R={}}}=window,T=x.length>0?x.map((e=>({label:e.Name,value:e.ListID}))):[],O=T.filter((e=>E.includes(e.value)));(0,e.useEffect)((()=>{x.length>0||l()({path:"/wp-newsletter-builder/v1/lists"}).then((e=>{C(e)}))}),[x]);const j=""===a||""===u||""===d||""===p&&""===A||""===f&&""===w||0===h.length;return(0,e.createElement)(r.PluginSidebar,{icon:"email-alt2",name:"nb-newsletter",title:(0,o.__)("Newsletter","wp-newsletter-builder")},(0,e.createElement)(s.PanelBody,{initialOpen:!0,title:(0,o.__)("Send Newsletter","wp-newsletter-builder")},(0,e.createElement)(L,{contentHandler:e=>{const t=(0,I.parse)(e),r=t.findIndex((e=>"wp-newsletter-builder/post"===e.name));t[r].attributes.postId=v,n({nb_breaking_content:(0,I.serialize)(t)})},typeHandler:e=>{n({nb_breaking_email_type:e})},imageHandler:e=>{n({nb_breaking_header_img:e})},typeValue:a,templateHandler:e=>{n({nb_breaking_template:e})},fromNameHandler:e=>{n({nb_breaking_from_name:e})},templateValue:u,fromNameValue:d}),(0,e.createElement)(s.TextareaControl,{label:S?(0,o.__)("Subject","wp-newsletter-builder"):(0,o.__)("Subject (linked)","wp-newsletter-builder"),placeholder:(0,o.__)("Enter subject","wp-newsletter-builder"),value:""!==p?p:A,onChange:e=>{n({nb_breaking_subject:e})}}),(0,e.createElement)(s.TextareaControl,{label:k?(0,o.__)("Preview Text","wp-newsletter-builder"):(0,o.__)("Preview Text (linked)","wp-newsletter-builder"),placeholder:(0,o.__)("Enter preview text","wp-newsletter-builder"),value:""!==f?f:w,onChange:e=>{n({nb_breaking_preview:e})}}),Object.keys(R).map((t=>{const r=R[t];return(0,e.createElement)(s.CheckboxControl,{label:r,checked:E.includes(t),onChange:e=>{const r=e?[...E,t]:E.filter((e=>e!==t));n({nb_breaking_list:r})}})})),x.length>0?(0,e.createElement)("label",{htmlFor:"wp-newsletter-builder-list"},(0,o.__)("Email List","wp-newsletter-builder"),(0,e.createElement)(N,{labelledBy:(0,o.__)("List","wp-newsletter-builder"),value:O,options:T,onChange:e=>{const t=e.map((e=>e.value));n({nb_breaking_list:t})},hasSelectAll:!1,overrideStrings:{selectSomeItems:(0,o.__)("Select Email List","wp-newsletter-builder")}})):(0,e.createElement)(s.Spinner,null),(0,e.createElement)("div",{style:{marginTop:"1rem"}},(0,e.createElement)(s.CheckboxControl,{label:"draft"===_||"auto-draft"===_?(0,o.__)("Send Newsletter on Publish","wp-newsletter-builder"):(0,o.__)("Send Newsletter on Update","wp-newsletter-builder"),checked:g&&!j,onChange:e=>{n({nb_breaking_should_send:e})},disabled:j}),a?null:(0,e.createElement)("p",{style:{color:"red"}},(0,o.__)("Header Type is Required","wp-newsletter-builder")),u?null:(0,e.createElement)("p",{style:{color:"red"}},(0,o.__)("Template is Required","wp-newsletter-builder")),d?null:(0,e.createElement)("p",{style:{color:"red"}},(0,o.__)("From Name is Required","wp-newsletter-builder")),p||A?null:(0,e.createElement)("p",{style:{color:"red"}},(0,o.__)("Subject is Required","wp-newsletter-builder")),f||w?null:(0,e.createElement)("p",{style:{color:"red"}},(0,o.__)("Preview Text is Required","wp-newsletter-builder")),0===h.length?(0,e.createElement)("p",{style:{color:"red"}},(0,o.__)("Email List is Required","wp-newsletter-builder")):null)),b?(0,e.createElement)(s.PanelBody,{initialOpen:!1,title:(0,o.__)("Sent Newsletters","wp-newsletter-builder")},b.map((t=>(0,e.createElement)(D,{postId:t,key:t})))):null)};(0,t.registerPlugin)("wp-newsletter-builder-plugin-sidebar",{icon:"shield",render:()=>(0,e.createElement)(U,null)})}()}();
\ No newline at end of file
diff --git a/build/wp-newsletter-builder-separator/index.asset.php b/build/wp-newsletter-builder-separator/index.asset.php
new file mode 100644
index 00000000..185f825f
--- /dev/null
+++ b/build/wp-newsletter-builder-separator/index.asset.php
@@ -0,0 +1 @@
+ array('wp-hooks'), 'version' => '067db236664da0d1c597');
diff --git a/build/wp-newsletter-builder-separator/index.js b/build/wp-newsletter-builder-separator/index.js
new file mode 100644
index 00000000..1bba8545
--- /dev/null
+++ b/build/wp-newsletter-builder-separator/index.js
@@ -0,0 +1 @@
+!function(){"use strict";(0,window.wp.hooks.addFilter)("blocks.registerBlockType","wp-newsletter-builder/separator",(e=>({...e,attributes:{...e.attributes,hasSeparator:{type:"boolean",default:!1},separatorIsWide:{type:"boolean",default:!1}}})))}();
\ No newline at end of file
diff --git a/configure.php b/configure.php
deleted file mode 100644
index 04b35f85..00000000
--- a/configure.php
+++ /dev/null
@@ -1,763 +0,0 @@
-#!/usr/bin/env php
-]
- * : The author name.
- *
- * [--author_email=
+
+
+
+
+
+
+
+
+
+
+
+
+ $wp_newsletter_builder_img_sizes ] ); ?>
+
+
+
+ %s
', esc_html( $wp_newsletter_builder_heading ) );
+}
+
+echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
diff --git a/build/section/style-index.css b/build/section/style-index.css
new file mode 100644
index 00000000..a61b1ce2
--- /dev/null
+++ b/build/section/style-index.css
@@ -0,0 +1 @@
+h2.wp-newsletter-builder-section__heading{color:#d62827;font-size:40px;line-height:47px;text-align:center;text-transform:uppercase}
diff --git a/build/signup-form-list/block.json b/build/signup-form-list/block.json
new file mode 100644
index 00000000..c5f5af66
--- /dev/null
+++ b/build/signup-form-list/block.json
@@ -0,0 +1,35 @@
+{
+ "$schema": "https://schemas.wp.org/trunk/block.json",
+ "apiVersion": 2,
+ "name": "wp-newsletter-builder/signup-form-list",
+ "version": "0.1.0",
+ "title": "Newsletter Signup Form List",
+ "category": "widgets",
+ "icon": "yes",
+ "description": "Child block of Newsletter Signup Form to show a single list",
+ "textdomain": "wp-newsletter-builder",
+ "editorScript": "file:index.js",
+ "render": "file:render.php",
+ "attributes": {
+ "logo": {
+ "type": "number",
+ "default": 0
+ },
+ "title": {
+ "type": "string"
+ },
+ "frequency": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "listId": {
+ "type": "string"
+ },
+ "initialChecked": {
+ "type": "boolean",
+ "default": false
+ }
+ }
+}
\ No newline at end of file
diff --git a/build/signup-form-list/index.asset.php b/build/signup-form-list/index.asset.php
new file mode 100644
index 00000000..dcef6590
--- /dev/null
+++ b/build/signup-form-list/index.asset.php
@@ -0,0 +1 @@
+ array('wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '31c534492807fee3dae3');
diff --git a/build/signup-form-list/index.js b/build/signup-form-list/index.js
new file mode 100644
index 00000000..3ae985dd
--- /dev/null
+++ b/build/signup-form-list/index.js
@@ -0,0 +1 @@
+!function(){"use strict";var e={n:function(t){var l=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(l,{a:l}),l},d:function(t,l){for(var n in l)e.o(l,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:l[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=window.wp.blocks,l=window.wp.element,n=window.wp.i18n,i=window.wp.data,r=window.wp.components,o=window.wp.blockEditor,a=window.wp.apiFetch,s=e.n(a);function c(e){let{selected:t,updateFunction:i}=e;const[o,a]=(0,l.useState)([]),c=o.length>0?(e=>{const t=e.map((e=>({label:e.Name,value:e.ListID})));return t.unshift({label:(0,n.__)("Select a list","wp-newsletter-builder"),value:""}),t})(o):[];return(0,l.useEffect)((()=>{o.length>0||s()({path:"/wp-newsletter-builder/v1/lists"}).then((e=>{a(e)}))}),[o]),(0,l.createElement)(r.SelectControl,{value:t,options:c,onChange:i})}var u=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"wp-newsletter-builder/signup-form-list","version":"0.1.0","title":"Newsletter Signup Form List","category":"widgets","icon":"yes","description":"Child block of Newsletter Signup Form to show a single list","textdomain":"wp-newsletter-builder","editorScript":"file:index.ts","render":"file:render.php","attributes":{"logo":{"type":"number","default":0},"title":{"type":"string"},"frequency":{"type":"string"},"description":{"type":"string"},"listId":{"type":"string"},"initialChecked":{"type":"boolean","default":false}}}');(0,t.registerBlockType)(u,{apiVersion:2,edit:function(e){let{attributes:{logo:t=0,title:a="",frequency:s="",description:u="",listId:d="",initialChecked:p=!1},setAttributes:w}=e;const{logoMedia:m=null}=(0,i.useSelect)((e=>({logoMedia:t?e("core").getMedia(t):null})),[t]);return(0,l.createElement)("div",(0,o.useBlockProps)(),m?(0,l.createElement)(l.Fragment,null,(0,l.createElement)(r.Button,{type:"button",onClick:()=>w({logo:null}),"aria-label":(0,n.__)("Remove Logo","wp-newsletter-builder"),isDestructive:!0,variant:"primary",className:"wp-block-wp-newsletter-builder-signup-form-list__image_delete"},"X"),(0,l.createElement)("img",{src:m.media_details?.sizes?.medium?.source_url||m.source_url,alt:(0,n.__)("Newsletter Logo","wp-newsletter-builder")})):(0,l.createElement)(o.MediaPlaceholder,{icon:"format-image",labels:{title:(0,n.__)("Image","wp-newsletter-builder"),instructions:(0,n.__)("Drag an image, upload a new one or select a file from your library.","wp-newsletter-builder")},onSelect:e=>w({logo:e.id}),accept:"image/*",allowedTypes:["image"]}),(0,l.createElement)("div",{className:"wp-block-wp-newsletter-builder-signup-form-list__content"},(0,l.createElement)(o.RichText,{tagName:"h3",value:a,onChange:e=>w({title:e}),placeholder:(0,n.__)("Title","wp-newsletter-builder")}),(0,l.createElement)(o.RichText,{tagName:"div",value:s,className:"wp-block-wp-newsletter-builder-signup-form-list__frequency",onChange:e=>w({frequency:e}),placeholder:(0,n.__)("Frequency","wp-newsletter-builder")}),(0,l.createElement)(o.RichText,{tagName:"div",value:u,className:"wp-block-wp-newsletter-builder-signup-form-list__description",onChange:e=>w({description:e}),placeholder:(0,n.__)("Description","wp-newsletter-builder")}),(0,l.createElement)(r.CheckboxControl,{checked:p,onChange:e=>w({initialChecked:e})})),(0,l.createElement)(o.InspectorControls,null,(0,l.createElement)(r.PanelBody,{title:(0,n.__)("List Settings","wp-newsletter-builder")},(0,l.createElement)(r.PanelRow,null,(0,l.createElement)(c,{selected:d,updateFunction:e=>w({listId:e})})))))},title:u.title})}();
\ No newline at end of file
diff --git a/build/signup-form-list/index.php b/build/signup-form-list/index.php
new file mode 100644
index 00000000..1a97c0ec
--- /dev/null
+++ b/build/signup-form-list/index.php
@@ -0,0 +1,21 @@
+.
+ * @param WP_Block $block_instance The instance of the WP_Block class that represents the block being rendered.
+ *
+ * @package wp-newsletter-builder
+ */
+
+$wp_newsletter_builder_title = $attributes['title'];
+$wp_newsletter_builder_frequency = $attributes['frequency'] ?? '';
+$wp_newsletter_builder_description = $attributes['description'] ?? '';
+$wp_newsletter_builder_list_id = $attributes['listId'];
+$wp_newsletter_builder_logo_id = $attributes['logo'] ?? null;
+$wp_newsletter_builder_checked = $attributes['initialChecked'] ?? false;
+$wp_newsletter_builder_checked_str = $wp_newsletter_builder_checked ? 'checked="checked"' : '';
+
+if ( empty( $wp_newsletter_builder_title ) || empty( $wp_newsletter_builder_list_id ) ) {
+ return;
+}
+?>
+0&&e[a-1][2]>i;a--)e[a]=e[a-1];e[a]=[n,o,i]},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={918:0,764:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var o,i,s=n[0],l=n[1],c=n[2],p=0;if(s.some((function(t){return 0!==e[t]}))){for(o in l)r.o(l,o)&&(r.m[o]=l[o]);if(c)var a=c(r)}for(t&&t(n);p=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),s=r+n,o=r;o=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e