├── .cache
└── .gitkeep
├── .editorconfig
├── .eslintrc.js
├── .gitattributes
├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE
├── setup-node
│ └── action.yml
└── workflows
│ ├── deploy.yml
│ ├── tests-e2e.yml
│ └── tests.yml
├── .gitignore
├── .husky
└── pre-commit
├── .nvmrc
├── .prettierignore
├── .prettierrc.js
├── .stylelintignore
├── .stylelintrc.js
├── .vscode
├── extensions.json
└── settings.json
├── .wordpress-org
├── banner-1544x500.png
├── banner-772x250.png
├── icon-128x128.png
├── icon-256x256.png
├── screenshot-1.png
├── screenshot-2.png
└── screenshot-3.png
├── .wp-env.json
├── CHANGELOG.md
├── LICENSE.txt
├── README.md
├── assets
├── _variables.scss
├── admin
│ ├── index.scss
│ ├── templates
│ │ ├── index.js
│ │ └── index.scss
│ └── tools
│ │ ├── index.js
│ │ ├── index.scss
│ │ └── tools.js
├── block-builder
│ ├── 3rd
│ │ └── astra.scss
│ ├── block
│ │ ├── edit.js
│ │ ├── index.js
│ │ └── save.js
│ ├── boxes
│ │ ├── code-preview
│ │ │ ├── editor.scss
│ │ │ └── index.js
│ │ ├── code
│ │ │ ├── component-react-ace
│ │ │ │ ├── editor.scss
│ │ │ │ └── index.js
│ │ │ ├── editor.scss
│ │ │ ├── fix-css-frame.js
│ │ │ └── index.js
│ │ ├── condition
│ │ │ └── index.js
│ │ ├── controls
│ │ │ ├── control.js
│ │ │ ├── deselect-active-on-click-outside.js
│ │ │ ├── editor.scss
│ │ │ └── index.js
│ │ ├── general
│ │ │ └── index.js
│ │ ├── selected-control-settings
│ │ │ ├── editor.scss
│ │ │ ├── index.js
│ │ │ └── settings-rows
│ │ │ │ ├── control-specific-rows.js
│ │ │ │ ├── default.js
│ │ │ │ ├── group.js
│ │ │ │ ├── help.js
│ │ │ │ ├── hide-if-not-selected.js
│ │ │ │ ├── index.js
│ │ │ │ ├── label.js
│ │ │ │ ├── name.js
│ │ │ │ ├── placement.js
│ │ │ │ ├── required.js
│ │ │ │ ├── save-in-meta.js
│ │ │ │ ├── translate.js
│ │ │ │ ├── type.js
│ │ │ │ └── width.js
│ │ ├── style-variations
│ │ │ └── index.js
│ │ ├── supports-ghost-kit
│ │ │ └── index.js
│ │ ├── supports
│ │ │ └── index.js
│ │ ├── title
│ │ │ ├── editor.scss
│ │ │ └── index.js
│ │ └── wizard
│ │ │ ├── editor.scss
│ │ │ ├── icons.js
│ │ │ ├── index.js
│ │ │ └── templates.js
│ ├── index.js
│ ├── index.scss
│ ├── plugin
│ │ └── index.js
│ └── store
│ │ ├── block-data
│ │ ├── actions.js
│ │ ├── controls.js
│ │ ├── index.js
│ │ ├── reducer.js
│ │ ├── resolvers.js
│ │ └── selectors.js
│ │ └── index.js
├── components
│ ├── base-control
│ │ ├── editor.scss
│ │ └── index.js
│ ├── block-slug
│ │ ├── editor.scss
│ │ └── index.js
│ ├── box
│ │ ├── editor.scss
│ │ └── index.js
│ ├── copied
│ │ ├── editor.scss
│ │ └── index.js
│ ├── document-tabs
│ │ ├── editor.scss
│ │ └── index.js
│ ├── icon-picker
│ │ ├── editor.scss
│ │ └── index.js
│ ├── modal
│ │ ├── editor.scss
│ │ └── index.js
│ ├── preview-error-boundary
│ │ └── index.js
│ ├── preview-server-callback
│ │ ├── editor.scss
│ │ ├── index.js
│ │ └── render-block-content.js
│ ├── pro-notice
│ │ ├── editor.scss
│ │ └── index.js
│ ├── render-controls
│ │ └── index.js
│ ├── select
│ │ ├── editor.scss
│ │ ├── index.js
│ │ └── style-provider.js
│ ├── tab-panel
│ │ ├── editor.scss
│ │ └── index.js
│ └── tabs
│ │ ├── editor.scss
│ │ └── index.js
├── editor
│ ├── blocks
│ │ ├── free
│ │ │ ├── edit.js
│ │ │ ├── index.js
│ │ │ └── save.js
│ │ └── main
│ │ │ ├── edit.js
│ │ │ ├── index.js
│ │ │ └── save.js
│ ├── extensions
│ │ └── block-id.js
│ ├── index.js
│ ├── index.scss
│ ├── plugins
│ │ ├── index.js
│ │ └── remove-block-with-saved-post-meta
│ │ │ ├── index.js
│ │ │ └── index.scss
│ ├── store
│ │ ├── components
│ │ │ ├── index.js
│ │ │ └── selectors.js
│ │ ├── hooks
│ │ │ ├── index.js
│ │ │ └── selectors.js
│ │ ├── index.js
│ │ └── utils
│ │ │ ├── index.js
│ │ │ └── selectors.js
│ └── translation.js
├── hooks
│ ├── use-all-blocks
│ │ └── index.js
│ └── use-block-control-props
│ │ └── index.js
├── svg
│ ├── icon-lazyblocks-black.svg
│ └── icon-lazyblocks.svg
└── utils
│ ├── check-control-validity
│ └── index.js
│ ├── dnd-kit-custom-pointer-sensor
│ └── index.js
│ ├── get-control-type-data
│ └── index.js
│ ├── get-control-value
│ └── index.js
│ └── get-uid
│ └── index.js
├── babel.config.js
├── build
├── admin-style-rtl.css
├── admin-style.css
├── admin-templates-rtl.css
├── admin-templates.asset.php
├── admin-templates.css
├── admin-templates.js
├── admin-tools-rtl.css
├── admin-tools.asset.php
├── admin-tools.css
├── admin-tools.js
├── block-builder-astra-style-rtl.css
├── block-builder-astra-style.css
├── block-builder-rtl.css
├── block-builder.asset.php
├── block-builder.css
├── block-builder.js
├── control-checkbox-rtl.css
├── control-checkbox.asset.php
├── control-checkbox.css
├── control-checkbox.js
├── control-classic-editor-rtl.css
├── control-classic-editor.asset.php
├── control-classic-editor.css
├── control-classic-editor.js
├── control-code-editor-rtl.css
├── control-code-editor.asset.php
├── control-code-editor.css
├── control-code-editor.js
├── control-color-rtl.css
├── control-color.asset.php
├── control-color.css
├── control-color.js
├── control-date-time-rtl.css
├── control-date-time.asset.php
├── control-date-time.css
├── control-date-time.js
├── control-email-rtl.css
├── control-email.asset.php
├── control-email.css
├── control-email.js
├── control-file-rtl.css
├── control-file.asset.php
├── control-file.css
├── control-file.js
├── control-gallery-rtl.css
├── control-gallery.asset.php
├── control-gallery.css
├── control-gallery.js
├── control-image-rtl.css
├── control-image.asset.php
├── control-image.css
├── control-image.js
├── control-inner-blocks-rtl.css
├── control-inner-blocks.asset.php
├── control-inner-blocks.css
├── control-inner-blocks.js
├── control-number-rtl.css
├── control-number.asset.php
├── control-number.css
├── control-number.js
├── control-password-rtl.css
├── control-password.asset.php
├── control-password.css
├── control-password.js
├── control-radio-rtl.css
├── control-radio.asset.php
├── control-radio.css
├── control-radio.js
├── control-range-rtl.css
├── control-range.asset.php
├── control-range.css
├── control-range.js
├── control-repeater-rtl.css
├── control-repeater.asset.php
├── control-repeater.css
├── control-repeater.js
├── control-rich-text-rtl.css
├── control-rich-text.asset.php
├── control-rich-text.css
├── control-rich-text.js
├── control-select-rtl.css
├── control-select.asset.php
├── control-select.css
├── control-select.js
├── control-text-rtl.css
├── control-text.asset.php
├── control-text.css
├── control-text.js
├── control-textarea-rtl.css
├── control-textarea.asset.php
├── control-textarea.css
├── control-textarea.js
├── control-toggle-rtl.css
├── control-toggle.asset.php
├── control-toggle.css
├── control-toggle.js
├── control-undefined-rtl.css
├── control-undefined.asset.php
├── control-undefined.css
├── control-undefined.js
├── control-url-rtl.css
├── control-url.asset.php
├── control-url.css
├── control-url.js
├── editor-rtl.css
├── editor-translation.asset.php
├── editor-translation.js
├── editor.asset.php
├── editor.css
└── editor.js
├── classes
├── 3rd
│ └── class-astra.php
├── class-admin.php
├── class-assets.php
├── class-blocks.php
├── class-controls.php
├── class-deactivate-duplicate-plugin.php
├── class-deprecated.php
├── class-dummy.php
├── class-force-gutenberg.php
├── class-handlebars.php
├── class-icons.php
├── class-migration.php
├── class-rest.php
├── class-templates.php
├── class-tools.php
└── class-wpml.php
├── composer.json
├── composer.lock
├── controls
├── _base
│ └── index.php
├── checkbox
│ ├── index.php
│ └── script.js
├── classic_editor
│ ├── index.php
│ ├── script.js
│ └── tmce.js
├── code_editor
│ ├── index.php
│ └── script.js
├── color
│ ├── color-control.js
│ ├── color-palette
│ │ └── index.js
│ ├── index.php
│ └── script.js
├── date_time
│ ├── index.php
│ └── script.js
├── email
│ ├── index.php
│ └── script.js
├── file
│ ├── file-control.js
│ ├── index.php
│ └── script.js
├── gallery
│ ├── gallery-control.js
│ ├── index.php
│ └── script.js
├── image
│ ├── image-control.js
│ ├── index.php
│ └── script.js
├── inner_blocks
│ ├── index.php
│ └── script.js
├── number
│ ├── index.php
│ └── script.js
├── password
│ ├── index.php
│ └── script.js
├── radio
│ ├── index.php
│ └── script.js
├── range
│ ├── index.php
│ └── script.js
├── repeater
│ ├── index.php
│ ├── repeater-control.js
│ └── script.js
├── rich_text
│ ├── index.php
│ └── script.js
├── select
│ ├── component-choices.js
│ ├── index.php
│ └── script.js
├── text
│ ├── index.php
│ └── script.js
├── textarea
│ ├── index.php
│ └── script.js
├── toggle
│ ├── index.php
│ └── script.js
├── undefined
│ ├── index.php
│ └── script.js
└── url
│ ├── index.php
│ └── script.js
├── gulpfile.js
├── index.php
├── languages
├── lazy-blocks.json
├── lazy-blocks.pot
└── readme.md
├── lazy-blocks.php
├── lint-staged.config.js
├── package-lock.json
├── package.json
├── phpcs.xml.dist
├── phpunit.xml.dist
├── readme.txt
├── templates
└── template-not-found.php
├── tests
├── e2e
│ ├── config
│ │ ├── flaky-tests-reporter.js
│ │ └── global-setup.js
│ ├── playwright.config.js
│ ├── specs
│ │ ├── block-builder-create-block.spec.js
│ │ ├── editor-block-attribute-useBlockProps.spec.js
│ │ ├── editor-block-base-controls.spec.js
│ │ ├── editor-block-component-inner-blocks.spec.js
│ │ ├── editor-block-rendering.spec.js
│ │ ├── editor-block-repeater-control.spec.js
│ │ ├── editor-block-with-frame.spec.js
│ │ ├── initial-loading.spec.js
│ │ └── widgets-editor-blocks.spec.js
│ └── utils
│ │ ├── create-block.js
│ │ ├── create-control.js
│ │ ├── remove-all-blocks.js
│ │ └── remove-reusable-blocks.js
├── phpunit
│ ├── block-registration-test.php
│ ├── block-render-test.php
│ ├── bootstrap.php
│ └── controls
│ │ └── select-control-test.php
├── plugins
│ └── gutenberg-test-plugin-disables-the-css-animations
│ │ └── gutenberg-test-plugin-disables-the-css-animations.php
└── themes
│ ├── empty-theme-php
│ ├── footer.php
│ ├── functions.php
│ ├── header.php
│ ├── index.php
│ ├── sidebar.php
│ └── style.css
│ └── empty-theme
│ ├── functions.php
│ ├── index.php
│ ├── parts
│ └── header.html
│ ├── style.css
│ ├── templates
│ ├── category.html
│ ├── index.html
│ ├── singular.html
│ └── tag.html
│ └── theme.json
├── vendors
├── Handlebars
│ ├── Arguments.php
│ ├── Autoloader.php
│ ├── BaseString.php
│ ├── Cache.php
│ ├── Cache
│ │ ├── APC.php
│ │ ├── Disk.php
│ │ └── Dummy.php
│ ├── ChildContext.php
│ ├── Context.php
│ ├── Handlebars.php
│ ├── Helper.php
│ ├── Helper
│ │ ├── BindAttrHelper.php
│ │ ├── EachHelper.php
│ │ ├── IfHelper.php
│ │ ├── UnlessHelper.php
│ │ └── WithHelper.php
│ ├── Helpers.php
│ ├── Loader.php
│ ├── Loader
│ │ ├── ArrayLoader.php
│ │ ├── FilesystemLoader.php
│ │ ├── InlineLoader.php
│ │ └── StringLoader.php
│ ├── Parser.php
│ ├── SafeString.php
│ ├── StringWrapper.php
│ ├── Template.php
│ └── Tokenizer.php
└── date_i18n
│ └── date_i18n.js
└── webpack.config.js
/.cache/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nk-crew/lazy-blocks/61d439b600924a29fc41623c879aed23276e7c77/.cache/.gitkeep
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # editorconfig.org
2 |
3 | root = true
4 |
5 | [*]
6 | charset = utf-8
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 | indent_style = tab
11 |
12 | [*.yml]
13 | indent_style = space
14 | indent_size = 2
15 |
16 | [*.md]
17 | trim_trailing_whitespace = false
18 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: ['plugin:@wordpress/eslint-plugin/recommended'],
3 | rules: {
4 | '@wordpress/no-unsafe-wp-apis': 0,
5 | },
6 | settings: {
7 | 'import/core-modules': ['jquery'],
8 | },
9 | };
10 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Enforce Unix newlines
2 | *.css text eol=lf
3 | *.html text eol=lf
4 | *.js text eol=lf
5 | *.jsx text eol=lf
6 | *.json text eol=lf
7 | *.md text eol=lf
8 | *.php text eol=lf
9 | *.rb text eol=lf
10 | *.scss text eol=lf
11 | *.svg text eol=lf
12 | *.txt text eol=lf
13 | *.yml text eol=lf
14 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | custom: [https://www.lazyblocks.com/pro/]
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE:
--------------------------------------------------------------------------------
1 | ### Issue description:
2 |
3 |
4 | ### Lazy Blocks Version:
5 |
6 |
7 | ### WordPress Version:
8 |
9 |
10 | ### Any helpful information to reproduce the issue (screenshots, code parts)
11 |
12 |
--------------------------------------------------------------------------------
/.github/setup-node/action.yml:
--------------------------------------------------------------------------------
1 | name: 'Setup Node.js and install npm dependencies'
2 | description: 'Configure Node.js and install npm dependencies while managing all aspects of caching.'
3 | inputs:
4 | node-version:
5 | description: 'Optional. The Node.js version to use. When not specified, the version specified in .nvmrc will be used.'
6 | required: false
7 | type: string
8 |
9 | runs:
10 | using: 'composite'
11 | steps:
12 | - name: Use desired version of Node.js
13 | uses: actions/setup-node@v4
14 | with:
15 | node-version-file: '.nvmrc'
16 | node-version: ${{ inputs.node-version }}
17 | cache: npm
18 |
19 | - name: Get Node.js and npm version
20 | id: node-version
21 | run: |
22 | echo "NODE_VERSION=$(node -v)" >> $GITHUB_OUTPUT
23 | shell: bash
24 |
25 | - name: Cache node_modules
26 | id: cache-node_modules
27 | uses: actions/cache@v4
28 | with:
29 | path: '**/node_modules'
30 | key: node_modules-${{ runner.os }}-${{ steps.node-version.outputs.NODE_VERSION }}-${{ hashFiles('package-lock.json') }}
31 |
32 | - name: Install npm dependencies
33 | if: ${{ steps.cache-node_modules.outputs.cache-hit != 'true' }}
34 | run: npm ci
35 | shell: bash
36 |
37 | # On cache hit, we run the post-install script to match the native `npm ci` behavior.
38 | # An example of this is to patch `node_modules` using patch-package.
39 | - name: Post-install
40 | if: ${{ steps.cache-node_modules.outputs.cache-hit == 'true' }}
41 | run: |
42 | # Run the post-install script for the root project.
43 | npm run postinstall
44 | shell: bash
45 |
--------------------------------------------------------------------------------
/.github/workflows/deploy.yml:
--------------------------------------------------------------------------------
1 | name: Deploy to WordPress.org
2 |
3 | on:
4 | workflow_dispatch:
5 | push:
6 | tags:
7 | - 'v*'
8 |
9 | jobs:
10 | deploy:
11 | runs-on: ubuntu-latest
12 | steps:
13 | - uses: actions/checkout@v4
14 |
15 | - name: Disable xDebug - fixes PHP Fatal Error for `i18n make-pot`
16 | uses: shivammathur/setup-php@v2
17 | with:
18 | php-version: '8.1'
19 | coverage: none
20 |
21 | - name: Setup Node.js and install dependencies
22 | uses: ./.github/setup-node
23 |
24 | - name: Run Production Task
25 | run: npm run build:prod
26 |
27 | - name: Install SVN
28 | run: |
29 | sudo apt-get update
30 | sudo apt-get install subversion
31 |
32 | - name: WordPress Plugin Deploy
33 | uses: nk-o/action-wordpress-plugin-deploy@master
34 | env:
35 | SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
36 | SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
37 | SOURCE_DIR: dist-zip/lazy-blocks/
38 | SLUG: lazy-blocks
39 |
--------------------------------------------------------------------------------
/.github/workflows/tests-e2e.yml:
--------------------------------------------------------------------------------
1 | name: End-to-End Tests
2 |
3 | on:
4 | pull_request:
5 | push:
6 | branches:
7 | - master
8 | # Allow manually triggering the workflow.
9 | workflow_dispatch:
10 |
11 | # Cancels all previous workflow runs for pull requests that have not completed.
12 | concurrency:
13 | # The concurrency group contains the workflow name and the branch name for pull requests
14 | # or the commit hash for any other events.
15 | group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
16 | cancel-in-progress: true
17 |
18 | jobs:
19 | playwright:
20 | name: Playwright
21 | runs-on: ubuntu-latest
22 | if: ${{ github.repository == 'nk-crew/lazy-blocks' || github.event_name == 'pull_request' }}
23 |
24 | steps:
25 | - uses: actions/checkout@v4
26 |
27 | - name: Setup Node.js and install dependencies
28 | uses: ./.github/setup-node
29 |
30 | - name: Npm build
31 | run: npm run build
32 |
33 | - name: Install Playwright dependencies
34 | run: |
35 | npx playwright install chromium firefox webkit --with-deps
36 |
37 | - name: Install WordPress and start the server
38 | run: |
39 | npm run wp-env start
40 |
41 | - name: Run the tests
42 | run: |
43 | xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:e2e
44 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | .phpunit.result.cache
8 | /artifacts
9 | /tests/e2e/artifacts
10 |
11 | # The /.cache folder is needed for phpcs to cache results between runs, while other .cache folders must be ignored
12 | # It is not possible to re-include a file if a parent directory of that file is excluded
13 | # So, both /.cache and /.cache./.gitkeep must be re-included
14 | .cache
15 | !/.cache/
16 | /.cache/**
17 | !/.cache/.gitkeep
18 |
19 | # Coverage directory used by tools like istanbul
20 | coverage
21 |
22 | # Plugin ZIP production build
23 | dist-zip
24 |
25 | # Webpack dev build
26 | build/runtime*
27 | build/*.hot-update.json
28 | build/*.hot-update.js
29 | build/*.hot-update.js.map
30 |
31 | # Compiled binary addons (https://nodejs.org/api/addons.html)
32 | build/Release
33 |
34 | # Composer directories
35 | vendor
36 |
37 | # Custom PHPCS configs
38 | .phpcs.xml
39 | phpcs.xml
40 |
41 | # Dependency directories
42 | node_modules/
43 |
44 | # Optional npm cache directory
45 | .npm
46 |
47 | # Optional eslint cache
48 | .eslintcache
49 |
50 | # Output of `npm pack`
51 | *.tgz
52 |
53 | # Output of `wp-scripts plugin-zip`
54 | *.zip
55 |
56 | # dotenv environment variables file
57 | .env
58 |
59 | # system files
60 | .DS_Store
61 | Thumbs.db
62 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | npx lint-staged
5 |
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | 18
2 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | **/*.css
2 | **/*.scss
3 | **/*.html
4 | **/*.php
5 | **/*.yml
6 | node_modules
7 | dist
8 | build
9 | vendor
10 | vendors
11 |
--------------------------------------------------------------------------------
/.prettierrc.js:
--------------------------------------------------------------------------------
1 | module.exports = require('@wordpress/prettier-config');
2 |
--------------------------------------------------------------------------------
/.stylelintignore:
--------------------------------------------------------------------------------
1 | **/*.js
2 | **/*.jsx
3 | **/*.min.css
4 | **/*.build.css
5 | node_modules
6 | dist
7 | build
8 | vendor
9 | vendors
10 |
--------------------------------------------------------------------------------
/.stylelintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: '@wordpress/stylelint-config/scss',
3 | rules: {
4 | 'at-rule-empty-line-before': null,
5 | 'at-rule-no-unknown': null,
6 | 'comment-empty-line-before': null,
7 | 'font-weight-notation': null,
8 | 'max-line-length': null,
9 | 'no-descending-specificity': null,
10 | 'rule-empty-line-before': null,
11 | 'selector-class-pattern': null,
12 | 'value-keyword-case': null,
13 | 'scss/operator-no-unspaced': null,
14 | 'scss/selector-no-redundant-nesting-selector': null,
15 | 'scss/at-import-partial-extension': null,
16 | 'scss/no-global-function-names': null,
17 | 'scss/comment-no-empty': null,
18 | 'scss/at-extend-no-missing-placeholder': null,
19 | 'scss/operator-no-newline-after': null,
20 | 'scss/at-if-closing-brace-newline-after': null,
21 | 'scss/at-else-empty-line-before': null,
22 | 'scss/at-if-closing-brace-space-after': null,
23 | 'no-invalid-position-at-import-rule': null,
24 | },
25 | };
26 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "esbenp.prettier-vscode",
4 | "streetsidesoftware.code-spell-checker",
5 | "editorconfig.editorconfig",
6 | "dbaeumer.vscode-eslint",
7 | "stylelint.vscode-stylelint"
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "editor.defaultFormatter": null,
3 | "[javascript]": {
4 | "editor.defaultFormatter": "esbenp.prettier-vscode"
5 | },
6 | "[php]": {
7 | "editor.formatOnSave": false,
8 | "editor.defaultFormatter": null
9 | },
10 | "editor.formatOnSave": true,
11 | "scss.validate": false,
12 | "css.validate": false,
13 | "less.validate": false,
14 | "editor.codeActionsOnSave": {
15 | "source.fixAll.stylelint": "explicit"
16 | },
17 | "stylelint.validate": [
18 | "css",
19 | "scss"
20 | ],
21 | "stylelint.snippet": [
22 | "css",
23 | "scss"
24 | ],
25 | "[json]": {
26 | "editor.defaultFormatter": "esbenp.prettier-vscode"
27 | },
28 | "search.exclude": {
29 | "**/.git": true,
30 | "**/node_modules": true,
31 | "**/build": true
32 | },
33 | }
--------------------------------------------------------------------------------
/.wordpress-org/banner-1544x500.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nk-crew/lazy-blocks/61d439b600924a29fc41623c879aed23276e7c77/.wordpress-org/banner-1544x500.png
--------------------------------------------------------------------------------
/.wordpress-org/banner-772x250.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nk-crew/lazy-blocks/61d439b600924a29fc41623c879aed23276e7c77/.wordpress-org/banner-772x250.png
--------------------------------------------------------------------------------
/.wordpress-org/icon-128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nk-crew/lazy-blocks/61d439b600924a29fc41623c879aed23276e7c77/.wordpress-org/icon-128x128.png
--------------------------------------------------------------------------------
/.wordpress-org/icon-256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nk-crew/lazy-blocks/61d439b600924a29fc41623c879aed23276e7c77/.wordpress-org/icon-256x256.png
--------------------------------------------------------------------------------
/.wordpress-org/screenshot-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nk-crew/lazy-blocks/61d439b600924a29fc41623c879aed23276e7c77/.wordpress-org/screenshot-1.png
--------------------------------------------------------------------------------
/.wordpress-org/screenshot-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nk-crew/lazy-blocks/61d439b600924a29fc41623c879aed23276e7c77/.wordpress-org/screenshot-2.png
--------------------------------------------------------------------------------
/.wordpress-org/screenshot-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nk-crew/lazy-blocks/61d439b600924a29fc41623c879aed23276e7c77/.wordpress-org/screenshot-3.png
--------------------------------------------------------------------------------
/.wp-env.json:
--------------------------------------------------------------------------------
1 | {
2 | "core": null,
3 | "themes": ["./tests/themes/empty-theme"],
4 | "plugins": [
5 | ".",
6 | "./tests/plugins/gutenberg-test-plugin-disables-the-css-animations"
7 | ],
8 | "env": {
9 | "tests": {
10 | "mappings": {
11 | "wp-content/themes/empty-theme-php": "./tests/themes/empty-theme-php"
12 | }
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/assets/_variables.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress.
3 | */
4 | /* stylelint-disable-next-line scss/at-import-partial-extension */
5 | @import "../node_modules/@wordpress/base-styles/colors.native";
6 | @import "../node_modules/@wordpress/base-styles/variables";
7 |
8 | $radius: 3px !default;
9 | $radius_large: 4px !default;
10 | $radius_box: 8px !default;
11 |
12 | $color_gray_lighten_2: #fbfbfb !default;
13 | $color_gray_lighten: #f4f5f7 !default;
14 | $color_gray: #e6e8eb !default;
15 | $color_gray_darken: #dadbdd !default;
16 |
17 | $color_dark_lighten_2: #a3a5a7 !default;
18 | $color_dark_lighten: #6b6c6e !default;
19 | $color_dark: #515764 !default;
20 | $color_dark_darken: #343536 !default;
21 |
22 | $shadow: 0 5px 10px 0 rgba(0, 0, 0, 4%) !default;
23 | $shadow_small: 0 5px 10px 0 rgba(0, 0, 0, 2%) !default;
24 |
--------------------------------------------------------------------------------
/assets/admin/templates/index.scss:
--------------------------------------------------------------------------------
1 | .lzb-template-settings-panel .components-select-control select[multiple] {
2 | height: auto;
3 | padding-right: 8px;
4 |
5 | ~ .components-input-control__suffix {
6 | display: none;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/assets/admin/tools/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Styles.
3 | */
4 | import './index.scss';
5 |
6 | /**
7 | * WordPress dependencies.
8 | */
9 | import { render } from '@wordpress/element';
10 |
11 | /**
12 | * Internal dependencies
13 | */
14 | import Tools from './tools';
15 |
16 | window.addEventListener('load', () => {
17 | render( , document.querySelector('.lazyblocks-tools-page'));
18 | });
19 |
--------------------------------------------------------------------------------
/assets/admin/tools/index.scss:
--------------------------------------------------------------------------------
1 | .lazyblocks-tools-page {
2 | #normal-sortables {
3 | display: flex;
4 | flex-wrap: wrap;
5 | align-items: flex-start;
6 | justify-content: space-between;
7 |
8 | > .postbox-container {
9 | width: calc(50% - 15px);
10 |
11 | @media screen and (max-width: 782px) {
12 | width: 100%;
13 | }
14 | }
15 | }
16 |
17 | .lzb-export-select-items {
18 | padding: 12px;
19 | background-color: #f1f1f1;
20 | border: 1px solid #ccd0d4;
21 | border-radius: 4px;
22 |
23 | .components-toggle-control__label {
24 | padding-top: 3px;
25 | margin-left: 0 !important;
26 |
27 | > span {
28 | margin-top: -3px;
29 | }
30 | }
31 |
32 | .components-toggle-control > .components-base-control__field > .components-flex {
33 | align-items: start;
34 | }
35 | }
36 |
37 | .lzb-export-textarea {
38 | margin-top: 12px;
39 | }
40 |
41 | .lzb-export-textarea textarea {
42 | width: 100%;
43 | min-height: 500px;
44 | }
45 |
46 | .lzb-export-buttons {
47 | margin-top: 12px;
48 |
49 | .button {
50 | position: relative;
51 | }
52 |
53 | .button + .button {
54 | margin-left: 10px;
55 | }
56 | }
57 |
58 | .components-base-control + .components-base-control {
59 | margin-top: 10px;
60 | }
61 |
62 | .components-base-control > .components-base-control__field > .components-base-control__label {
63 | display: block;
64 | margin-bottom: 10px;
65 | font-weight: 600;
66 | }
67 |
68 | .components-toggle-control {
69 | > .components-base-control__field {
70 | display: flex;
71 | }
72 |
73 | .components-form-toggle {
74 | padding-top: 3px;
75 | }
76 |
77 | .components-form-toggle__on,
78 | .components-form-toggle__off {
79 | display: none;
80 | }
81 |
82 | .components-toggle-control__label {
83 | display: inline-flex;
84 | align-items: flex-start;
85 | margin-left: 5px;
86 | word-break: break-word;
87 |
88 | .dashicons,
89 | svg {
90 | display: flex;
91 | align-items: center;
92 | justify-content: center;
93 | width: 24px;
94 | height: 24px;
95 | margin-right: 5px;
96 | }
97 | }
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/assets/block-builder/3rd/astra.scss:
--------------------------------------------------------------------------------
1 | .post-type-lazyblocks {
2 | &.ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted,
3 | &.ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block:hover {
4 | box-shadow: none;
5 | }
6 |
7 | &.ast-separate-container .edit-post-visual-editor__content-area {
8 | padding: 0 !important;
9 | }
10 |
11 | .edit-post-visual-editor .editor-styles-wrapper > .is-root-container {
12 | padding-top: 0;
13 | }
14 |
15 | .components-panel__body .components-base-control__field {
16 | padding-top: 0;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/assets/block-builder/block/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { __ } from '@wordpress/i18n';
5 | import { registerBlockType } from '@wordpress/blocks';
6 |
7 | /**
8 | * Internal dependencies
9 | */
10 | import BlockEdit from './edit';
11 | import BlockSave from './save';
12 |
13 | /**
14 | * Block Builder
15 | */
16 | registerBlockType('lzb-block-builder/main', {
17 | apiVersion: 3,
18 | title: __('Block Builder', 'lazy-blocks'),
19 | category: 'design',
20 | supports: {
21 | html: false,
22 | className: false,
23 | customClassName: false,
24 | anchor: false,
25 | inserter: false,
26 | },
27 | edit: BlockEdit,
28 | save: BlockSave,
29 | });
30 |
--------------------------------------------------------------------------------
/assets/block-builder/block/save.js:
--------------------------------------------------------------------------------
1 | export default function BlockSave() {
2 | return null;
3 | }
4 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/code-preview/editor.scss:
--------------------------------------------------------------------------------
1 | @import "../../../variables";
2 |
3 | .lzb-block-builder .lzb-block-builder-code-preview {
4 | .lzb-block-builder-code-preview-frame {
5 | padding: 4px;
6 | border: 1px solid #ddd;
7 | border-radius: 4px;
8 | background-color: #fff;
9 | margin-bottom: 8px;
10 | }
11 |
12 | iframe {
13 | width: 100%;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/code/component-react-ace/editor.scss:
--------------------------------------------------------------------------------
1 | @import "../../../../variables";
2 |
3 | .lazyblocks-component-code-editor,
4 | .ace_autocomplete {
5 | border: 1px solid $color_gray;
6 | border-radius: 8px;
7 |
8 | // fix editor height jumping after init
9 | .ace_text-input,
10 | .ace_gutter-cell,
11 | .ace_gutter-active-line {
12 | min-height: 17px;
13 | }
14 | .ace_gutter-cell {
15 | padding-left: 10px;
16 | }
17 | .ace_gutter,
18 | .ace_gutter-layer,
19 | .ace_gutter-cell {
20 | min-width: 39px !important;
21 | }
22 |
23 | &.ace_editor {
24 | font-family: monospace !important;
25 | line-height: 1.6;
26 | border: 1px solid rgba(0, 0, 0, 7%);
27 | background-color: #fbfbfb;
28 |
29 | .ace_tooltip {
30 | padding: 6px 10px;
31 | background: none;
32 | background-color: #fff;
33 | border: 1px solid $color_gray_lighten;
34 | border-radius: $radius;
35 | box-shadow: $shadow;
36 | }
37 |
38 | // Active line.
39 | .ace_marker-layer .ace_active-line {
40 | border: none;
41 | background: #f2f2f2;
42 | }
43 |
44 | .ace_gutter {
45 | background: #f4f4f4;
46 |
47 | .ace_gutter-active-line {
48 | background-color: #e7e7e7;
49 | }
50 | }
51 |
52 | // Hide print margin line.
53 | .ace_print-margin {
54 | display: none;
55 | }
56 | }
57 | }
58 |
59 | .lazyblocks-component-code-editor {
60 | &.ace_editor {
61 | width: 100%;
62 | }
63 | }
64 |
65 | // For some reason autocompletion popover does not position correctly.
66 | // This is a workaround to fix it.
67 | .ace_autocomplete {
68 | margin-top: 65px;
69 |
70 | &[style*="bottom"] {
71 | margin-top: 0;
72 | margin-bottom: -60px;
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/code/editor.scss:
--------------------------------------------------------------------------------
1 | @import "../../../variables";
2 |
3 | .lzb-block-builder .lzb-block-builder-custom-code-settings {
4 | .components-base-control__field {
5 | margin-bottom: 0;
6 | }
7 |
8 | p.description {
9 | margin-top: 0;
10 | margin-bottom: 10px;
11 | font-family: inherit;
12 | font-size: 1em;
13 |
14 | &:last-child {
15 | margin-bottom: 0;
16 | }
17 | }
18 | }
19 |
20 | .lzb-block-builder-custom-code-dropdown-content > div {
21 | width: 276px;
22 | }
23 | .lzb-block-builder-output-code-toolbar,
24 | .lzb-block-builder-theme-template-toolbar {
25 | display: flex;
26 | align-items: center;
27 | margin-bottom: 4px;
28 |
29 | > div:first-of-type + * {
30 | margin-left: auto;
31 | }
32 | .components-button {
33 | padding: 0 7px;
34 | }
35 | }
36 |
37 | .lzb-block-builder-output-code-wrapper,
38 | .lzb-block-builder-theme-template-wrapper {
39 | padding: 4px;
40 | border: 1px solid #ddd;
41 | border-radius: 4px;
42 | background-color: #fff;
43 | margin-bottom: 8px;
44 |
45 | .components-custom-select-control {
46 | display: inline-flex;
47 | margin-bottom: 5px;
48 |
49 | .components-input-control__container,
50 | .components-input-control__container > button {
51 | background-color: transparent;
52 | }
53 | div.components-input-control__backdrop {
54 | border: none;
55 | }
56 | .components-input-control__container > button {
57 | height: 21px;
58 | padding-left: 12px;
59 | font-weight: 500;
60 |
61 | + div {
62 | min-width: 170px;
63 | }
64 |
65 | .components-custom-select-control__item {
66 | padding: 3px 10px;
67 | }
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/code/fix-css-frame.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies
3 | */
4 | import { useEffect, useRef } from '@wordpress/element';
5 |
6 | const STYLE_IDS = [
7 | 'autocompletion.css',
8 | 'snippets.css',
9 | 'error_marker.css',
10 | 'ace-tm',
11 | 'ace_editor.css',
12 | 'ace_scrollbar.css',
13 | ];
14 |
15 | export default function FixCssFrame() {
16 | const codeWrapper = useRef();
17 |
18 | // Find available styles and save it to the state.
19 | useEffect(() => {
20 | const element = codeWrapper.current;
21 |
22 | if (!element) {
23 | return;
24 | }
25 |
26 | // Don't run this fix if not inside iframe.
27 | if (element.ownerDocument === document) {
28 | return;
29 | }
30 |
31 | const documentFrame = element.ownerDocument;
32 |
33 | STYLE_IDS.forEach((id) => {
34 | const styleTag = document.getElementById(id);
35 |
36 | if (!styleTag) {
37 | return;
38 | }
39 |
40 | const frameStyleTag = documentFrame.getElementById(id);
41 |
42 | if (frameStyleTag) {
43 | return;
44 | }
45 |
46 | documentFrame.head.appendChild(styleTag.cloneNode(true));
47 | });
48 | }, [codeWrapper]);
49 |
50 | return ;
51 | }
52 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/controls/deselect-active-on-click-outside.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { useEffect, useRef } from '@wordpress/element';
5 | import { select, dispatch } from '@wordpress/data';
6 |
7 | export default function DeselectActiveControlOnClickOutside() {
8 | const ref = useRef();
9 |
10 | useEffect(() => {
11 | const element = ref.current;
12 |
13 | if (!element) {
14 | return;
15 | }
16 |
17 | const doc = element.ownerDocument;
18 |
19 | if (!doc) {
20 | return;
21 | }
22 |
23 | const maybeDeselect = (e) => {
24 | const selectedControlId = select(
25 | 'lazy-blocks/block-data'
26 | ).getSelectedControlId();
27 |
28 | if (!selectedControlId) {
29 | return;
30 | }
31 |
32 | // click outside of content.
33 | if (
34 | !e.target.closest(
35 | '.edit-post-layout__content, .editor-styles-wrapper'
36 | )
37 | ) {
38 | return;
39 | }
40 |
41 | // click on notice.
42 | if (e.target.closest('.components-notice-list')) {
43 | return;
44 | }
45 |
46 | // click on control.
47 | if (e.target.closest('.lzb-block-builder-controls-item')) {
48 | return;
49 | }
50 |
51 | // click on code box.
52 | if (e.target.closest('.lazyblocks-component-box')) {
53 | return;
54 | }
55 |
56 | // click on add control button.
57 | if (
58 | e.target.classList.contains(
59 | 'lzb-block-builder-controls-item-appender'
60 | )
61 | ) {
62 | return;
63 | }
64 |
65 | const { clearSelectedControl } = dispatch('lazy-blocks/block-data');
66 |
67 | // clear selected control.
68 | clearSelectedControl();
69 | };
70 |
71 | doc.addEventListener('click', maybeDeselect);
72 |
73 | return () => {
74 | doc.removeEventListener('click', maybeDeselect);
75 | };
76 | }, [ref]);
77 |
78 | return ;
79 | }
80 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/selected-control-settings/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Styles.
3 | */
4 | import './editor.scss';
5 |
6 | /**
7 | * WordPress dependencies.
8 | */
9 | import { __ } from '@wordpress/i18n';
10 | import { PanelBody } from '@wordpress/components';
11 | import { useSelect, useDispatch } from '@wordpress/data';
12 |
13 | /**
14 | * Internal dependencies.
15 | */
16 | import SettingsRows from './settings-rows';
17 |
18 | export default function SelectedControlSettings() {
19 | const { id, data } = useSelect((select) => {
20 | const { getSelectedControlId, getSelectedControl } = select(
21 | 'lazy-blocks/block-data'
22 | );
23 |
24 | return {
25 | id: getSelectedControlId(),
26 | data: getSelectedControl(),
27 | };
28 | }, []);
29 |
30 | const { updateControlData } = useDispatch('lazy-blocks/block-data');
31 |
32 | return (
33 |
34 | {id && data ? (
35 |
{
37 | updateControlData(optionalId || id, newData);
38 | }}
39 | data={data}
40 | id={id}
41 | />
42 | ) : (
43 |
44 | {__('Select control to see settings.', 'lazy-blocks')}
45 |
46 | )}
47 |
48 | );
49 | }
50 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/selected-control-settings/settings-rows/control-specific-rows.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { applyFilters } from '@wordpress/hooks';
5 |
6 | export default function ControlSpecificRows(props) {
7 | const result = applyFilters(
8 | `lzb.constructor.control.${props.data.type}.settings`,
9 | '',
10 | props
11 | );
12 |
13 | return applyFilters('lzb.constructor.control.settings', result, props);
14 | }
15 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/selected-control-settings/settings-rows/default.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { __ } from '@wordpress/i18n';
5 | import { PanelBody, TextControl, TextareaControl } from '@wordpress/components';
6 |
7 | export default function DefaultRow(props) {
8 | const { updateData, data } = props;
9 |
10 | let ControlType = TextControl;
11 |
12 | switch (data.type) {
13 | case 'classic_editor':
14 | case 'code_editor':
15 | case 'rich_text':
16 | case 'textarea':
17 | ControlType = TextareaControl;
18 | break;
19 | // no default
20 | }
21 |
22 | return (
23 |
24 | updateData({ default: value })}
29 | __next40pxDefaultSize
30 | __nextHasNoMarginBottom
31 | />
32 |
33 | );
34 | }
35 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/selected-control-settings/settings-rows/group.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { __ } from '@wordpress/i18n';
5 | import { PanelBody, BaseControl, SelectControl } from '@wordpress/components';
6 |
7 | export default function GroupRow(props) {
8 | const { updateData, data } = props;
9 |
10 | return (
11 |
12 |
17 |
26 | updateData({
27 | group: value,
28 | })
29 | }
30 | __next40pxDefaultSize
31 | __nextHasNoMarginBottom
32 | />
33 |
34 |
35 | );
36 | }
37 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/selected-control-settings/settings-rows/help.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { __ } from '@wordpress/i18n';
5 | import { PanelBody, TextareaControl } from '@wordpress/components';
6 |
7 | export default function HelpRow(props) {
8 | const { updateData, data } = props;
9 |
10 | return (
11 |
12 | updateData({ help: value })}
17 | __nextHasNoMarginBottom
18 | />
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/selected-control-settings/settings-rows/hide-if-not-selected.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { __ } from '@wordpress/i18n';
5 | import { PanelBody, BaseControl, ToggleControl } from '@wordpress/components';
6 |
7 | export default function HideIfNotSelectedRow(props) {
8 | const { updateData, data } = props;
9 |
10 | return (
11 |
12 |
17 |
22 | updateData({
23 | hide_if_not_selected: value ? 'true' : 'false',
24 | })
25 | }
26 | __nextHasNoMarginBottom
27 | />
28 |
29 |
30 | );
31 | }
32 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/selected-control-settings/settings-rows/label.js:
--------------------------------------------------------------------------------
1 | /**
2 | * External dependencies.
3 | */
4 | import slugify from 'slugify';
5 |
6 | /**
7 | * WordPress dependencies.
8 | */
9 | import { __ } from '@wordpress/i18n';
10 | import { PanelBody, TextControl } from '@wordpress/components';
11 |
12 | /**
13 | * Internal dependencies.
14 | */
15 | import getControlTypeData from '../../../../utils/get-control-type-data';
16 |
17 | export default function LabelRow(props) {
18 | const { updateData, data } = props;
19 |
20 | function generateUniqueName() {
21 | const { label = '', name = '' } = data;
22 |
23 | if (!label || name) {
24 | return;
25 | }
26 |
27 | updateData({
28 | name: slugify(label, {
29 | replacement: '-',
30 | lower: true,
31 | remove: /[^\w\s$0-9-*+~.$(_)#&|'"!:;@/\\]/g,
32 | }),
33 | });
34 | }
35 |
36 | const { label = '', placeholder, alongside_text: alongsideText } = data;
37 |
38 | const controlTypeData = getControlTypeData(data.type);
39 | const allowNameUpdate = controlTypeData.restrictions.name_settings;
40 |
41 | return (
42 |
43 | updateData({ label: value })}
56 | onBlur={allowNameUpdate ? generateUniqueName : () => {}}
57 | // eslint-disable-next-line jsx-a11y/no-autofocus
58 | autoFocus
59 | __next40pxDefaultSize
60 | __nextHasNoMarginBottom
61 | />
62 |
63 | );
64 | }
65 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/selected-control-settings/settings-rows/name.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { __ } from '@wordpress/i18n';
5 | import { useState, useEffect } from '@wordpress/element';
6 | import { PanelBody, TextControl, Notice } from '@wordpress/components';
7 |
8 | function checkNameSlug(slug) {
9 | return /^[A-Za-z0-9-_]*$/.test(slug);
10 | }
11 |
12 | export default function NameRow(props) {
13 | const [isNameValid, setIsNameValid] = useState(true);
14 |
15 | const { updateData, data } = props;
16 |
17 | const { name = '' } = data;
18 |
19 | useEffect(() => {
20 | const isValid = checkNameSlug(name);
21 |
22 | if (isValid !== isNameValid) {
23 | setIsNameValid(isValid);
24 | }
25 | }, [isNameValid, name]);
26 |
27 | return (
28 |
29 | updateData({ name: value })}
33 | __next40pxDefaultSize
34 | __nextHasNoMarginBottom
35 | />
36 | {!isNameValid ? (
37 |
42 | {__(
43 | 'Control name must include only alphanumeric characters, dashes or underscores. Example: my-control-name',
44 | 'lazy-blocks'
45 | )}
46 |
47 | ) : (
48 | ''
49 | )}
50 |
51 | );
52 | }
53 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/selected-control-settings/settings-rows/required.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { __ } from '@wordpress/i18n';
5 | import { PanelBody, BaseControl, ToggleControl } from '@wordpress/components';
6 |
7 | export default function RequiredRow(props) {
8 | const { updateData, data } = props;
9 |
10 | return (
11 |
12 |
17 |
22 | updateData({ required: value ? 'true' : 'false' })
23 | }
24 | __nextHasNoMarginBottom
25 | />
26 |
27 |
28 | );
29 | }
30 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/selected-control-settings/settings-rows/save-in-meta.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { __ } from '@wordpress/i18n';
5 | import {
6 | PanelBody,
7 | BaseControl,
8 | Button,
9 | ToggleControl,
10 | TextControl,
11 | } from '@wordpress/components';
12 |
13 | const { plugin_version: pluginVersion } = window.lazyblocksBlockBuilderData;
14 |
15 | export default function SaveInMetaRow(props) {
16 | const { updateData, data } = props;
17 |
18 | return (
19 |
20 |
33 | {__('How to use?', 'lazy-blocks')}
34 |
35 | }
36 | __nextHasNoMarginBottom
37 | >
38 |
42 | updateData({ save_in_meta: value ? 'true' : 'false' })
43 | }
44 | __nextHasNoMarginBottom
45 | />
46 |
47 | {data.save_in_meta === 'true' ? (
48 |
52 | updateData({ save_in_meta_name: value })
53 | }
54 | placeholder={
55 | data.name || __('Unique metabox name', 'lazy-blocks')
56 | }
57 | __next40pxDefaultSize
58 | __nextHasNoMarginBottom
59 | />
60 | ) : (
61 | ''
62 | )}
63 |
64 | );
65 | }
66 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/selected-control-settings/settings-rows/translate.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { __ } from '@wordpress/i18n';
5 | import { PanelBody, BaseControl, ToggleControl } from '@wordpress/components';
6 |
7 | export default function WPMLRow(props) {
8 | const { updateData, data } = props;
9 |
10 | return (
11 |
12 |
17 |
22 | updateData({ translate: value ? 'true' : 'false' })
23 | }
24 | __nextHasNoMarginBottom
25 | />
26 |
27 |
28 | );
29 | }
30 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/selected-control-settings/settings-rows/width.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { __ } from '@wordpress/i18n';
5 | import {
6 | PanelBody,
7 | BaseControl,
8 | ButtonGroup,
9 | Button,
10 | } from '@wordpress/components';
11 |
12 | export default function WidthRow(props) {
13 | const { updateData, data } = props;
14 |
15 | const widths = {
16 | 25: __('25%', 'lazy-blocks'),
17 | 50: __('50%', 'lazy-blocks'),
18 | 75: __('75%', 'lazy-blocks'),
19 | 100: __('100%', 'lazy-blocks'),
20 | };
21 | let thereIsActive = false;
22 |
23 | return (
24 |
25 | updateData({ width: value })}
30 | __nextHasNoMarginBottom
31 | >
32 |
33 |
34 | {Object.keys(widths).map((w) => {
35 | let isActive = w === data.width;
36 |
37 | if (!thereIsActive && isActive) {
38 | thereIsActive = isActive;
39 | }
40 |
41 | if (!thereIsActive && w === '100') {
42 | isActive = true;
43 | }
44 |
45 | return (
46 | {
51 | updateData({ width: `${w}` });
52 | }}
53 | >
54 | {widths[w]}
55 |
56 | );
57 | })}
58 |
59 |
60 |
61 | );
62 | }
63 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/style-variations/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { __ } from '@wordpress/i18n';
5 |
6 | /**
7 | * Internal dependencies.
8 | */
9 | import ComponentChoices from '../../../../controls/select/component-choices';
10 |
11 | export default function StyleVariationsSettings(props) {
12 | const { data, updateData } = props;
13 | const { styles } = data;
14 |
15 | return (
16 | updateData({ styles: val })}
28 | options={[
29 | {
30 | name: 'name',
31 | label: __('Name', 'lazy-blocks'),
32 | },
33 | {
34 | name: 'label',
35 | label: __('Label', 'lazy-blocks'),
36 | },
37 | ]}
38 | />
39 | );
40 | }
41 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/title/editor.scss:
--------------------------------------------------------------------------------
1 | @import "../../../variables";
2 |
3 | .lzb-block-builder .lzb-block-builder-title {
4 | // block title.
5 | max-width: 800px;
6 | padding: 20px 0;
7 | margin-right: auto;
8 | margin-bottom: 10px;
9 | margin-left: auto;
10 | overflow: hidden;
11 |
12 | textarea {
13 | display: block;
14 | width: 100%;
15 | font: inherit;
16 | font-size: 18px !important;
17 | font-weight: 500;
18 | border: none;
19 | outline: none;
20 | box-shadow: none;
21 | resize: none;
22 |
23 | &::placeholder {
24 | color: #ccc;
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/assets/block-builder/boxes/title/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Styles.
3 | */
4 | import './editor.scss';
5 |
6 | /**
7 | * External dependencies.
8 | */
9 | import slugify from 'slugify';
10 |
11 | /**
12 | * WordPress dependencies.
13 | */
14 | import { __ } from '@wordpress/i18n';
15 | import { useRef, useEffect } from '@wordpress/element';
16 | import { useSelect } from '@wordpress/data';
17 | import { useEntityProp } from '@wordpress/core-data';
18 |
19 | const REGEXP_NEWLINES = /[\r\n]+/g;
20 |
21 | export default function TitleSettings(props) {
22 | const textareaRef = useRef();
23 |
24 | const { data, updateData } = props;
25 | const { slug } = data;
26 |
27 | const { postType } = useSelect((select) => {
28 | const { getCurrentPostType } = select('core/editor');
29 |
30 | return {
31 | postType: getCurrentPostType(),
32 | };
33 | }, []);
34 |
35 | const [postTitle, setPostTitle] = useEntityProp(
36 | 'postType',
37 | postType,
38 | 'title'
39 | );
40 |
41 | function maybeAddSlug() {
42 | if (slug || !postTitle) {
43 | return;
44 | }
45 |
46 | const newSlug = slugify(postTitle, {
47 | replacement: '-',
48 | lower: true,
49 | remove: /[^\w\s$0-9-*+~.$(_)#&|'"!:;@/\\]/g,
50 | });
51 |
52 | updateData({
53 | slug: newSlug,
54 | });
55 | }
56 |
57 | // Set automatic height.
58 | useEffect(() => {
59 | if (textareaRef.current) {
60 | // We need to reset the height momentarily to get the correct scrollHeight for the textarea
61 | textareaRef.current.style.height = '0px';
62 | const scrollHeight = textareaRef.current.scrollHeight;
63 |
64 | // We then set the height directly, outside of the render loop
65 | // Trying to set this with state or a ref will product an incorrect value.
66 | textareaRef.current.style.height = `${scrollHeight}px`;
67 | }
68 | }, [textareaRef, postTitle]);
69 |
70 | return (
71 |
72 |
82 | );
83 | }
84 |
--------------------------------------------------------------------------------
/assets/block-builder/index.js:
--------------------------------------------------------------------------------
1 | import './index.scss';
2 | import './store';
3 | import './block';
4 | import './plugin';
5 |
--------------------------------------------------------------------------------
/assets/block-builder/store/block-data/actions.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-param-reassign */
2 | export function apiFetch(request) {
3 | return {
4 | type: 'API_FETCH',
5 | request,
6 | };
7 | }
8 |
9 | export function setBlockData(data) {
10 | // check if control is array and change it to object
11 | // unless value will not be saved.
12 | // related topic: https://wordpress.org/support/topic/controls-not-saving/
13 | if (
14 | data.controls &&
15 | typeof data.controls === 'object' &&
16 | data.controls.constructor === Array
17 | ) {
18 | data.controls = {};
19 | }
20 |
21 | return {
22 | type: 'SET_BLOCK_DATA',
23 | data,
24 | };
25 | }
26 |
27 | export function updateBlockData(data) {
28 | return {
29 | type: 'UPDATE_BLOCK_DATA',
30 | data,
31 | };
32 | }
33 |
34 | export function updateControlData(id, data) {
35 | return {
36 | type: 'UPDATE_CONTROL_DATA',
37 | id,
38 | data,
39 | };
40 | }
41 |
42 | export function addControl(data, resortId) {
43 | return {
44 | type: 'ADD_CONTROL',
45 | data,
46 | resortId,
47 | };
48 | }
49 |
50 | export function removeControl(id) {
51 | return {
52 | type: 'REMOVE_CONTROL',
53 | id,
54 | };
55 | }
56 |
57 | export function resortControl(id, newId) {
58 | return {
59 | type: 'RESORT_CONTROL',
60 | id,
61 | newId,
62 | };
63 | }
64 |
65 | export function selectControl(id) {
66 | return {
67 | type: 'SELECT_CONTROL',
68 | id,
69 | };
70 | }
71 |
72 | export function clearSelectedControl() {
73 | return {
74 | type: 'CLEAR_SELECTED_CONTROL',
75 | };
76 | }
77 |
--------------------------------------------------------------------------------
/assets/block-builder/store/block-data/controls.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import apiFetch from '@wordpress/api-fetch';
5 |
6 | export function API_FETCH({ request }) {
7 | return apiFetch(request).then((fetchedData) => {
8 | if (fetchedData && fetchedData.success && fetchedData.response) {
9 | return fetchedData.response;
10 | }
11 | return false;
12 | });
13 | }
14 |
--------------------------------------------------------------------------------
/assets/block-builder/store/block-data/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { createReduxStore, register } from '@wordpress/data';
5 |
6 | /**
7 | * Internal dependencies.
8 | */
9 | import reducer from './reducer';
10 | import * as selectors from './selectors';
11 | import * as actions from './actions';
12 | import * as controls from './controls';
13 | import * as resolvers from './resolvers';
14 |
15 | const store = createReduxStore('lazy-blocks/block-data', {
16 | reducer,
17 | selectors,
18 | actions,
19 | controls,
20 | resolvers,
21 | });
22 |
23 | register(store);
24 |
--------------------------------------------------------------------------------
/assets/block-builder/store/block-data/resolvers.js:
--------------------------------------------------------------------------------
1 | import * as actions from './actions';
2 |
3 | export function* getBlockData() {
4 | const postId = window.lazyblocksBlockBuilderData.post_id;
5 |
6 | const query = `/lazy-blocks/v1/get-block-data/?post_id=${postId}`;
7 | const data = yield actions.apiFetch({ path: query });
8 |
9 | return actions.setBlockData(data);
10 | }
11 |
--------------------------------------------------------------------------------
/assets/block-builder/store/block-data/selectors.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | // eslint-disable-next-line import/no-extraneous-dependencies
5 | import { cloneDeep } from 'lodash';
6 |
7 | /**
8 | * Internal dependencies.
9 | */
10 | import getControlTypeData from '../../../utils/get-control-type-data';
11 |
12 | export function getBlockData(state) {
13 | return state.data || {};
14 | }
15 |
16 | export function getSelectedControlId(state) {
17 | return state.selectedControlId || false;
18 | }
19 |
20 | export function getSelectedControl(state) {
21 | if (state.selectedControlId) {
22 | const blockData = state.data;
23 |
24 | if (blockData.controls && blockData.controls[state.selectedControlId]) {
25 | const controlData = getControlTypeData(
26 | blockData.controls[state.selectedControlId].type
27 | );
28 | return {
29 | ...cloneDeep(controlData),
30 | ...(controlData.attributes
31 | ? cloneDeep(controlData.attributes)
32 | : {}),
33 | ...blockData.controls[state.selectedControlId],
34 | };
35 | }
36 | }
37 | return false;
38 | }
39 |
--------------------------------------------------------------------------------
/assets/block-builder/store/index.js:
--------------------------------------------------------------------------------
1 | import './block-data';
2 |
--------------------------------------------------------------------------------
/assets/components/base-control/editor.scss:
--------------------------------------------------------------------------------
1 | @import "../../variables";
2 |
3 | .lazyblocks-component-base-control {
4 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
5 | font-size: 13px;
6 |
7 | &,
8 | * {
9 | box-sizing: border-box;
10 | }
11 |
12 | .block-editor-block-inspector & {
13 | margin-bottom: 24px;
14 |
15 | &:last-child {
16 | margin-bottom: 8px;
17 | }
18 | }
19 |
20 | .lazyblocks-component-base-control__label {
21 | display: inline-block;
22 | padding: 0;
23 | margin-bottom: calc(8px);
24 | font-size: 11px;
25 | font-weight: 500;
26 | line-height: 1.4;
27 | text-transform: uppercase;
28 | }
29 |
30 | .lazyblocks-component-base-control__help {
31 | margin-top: calc(8px);
32 | margin-bottom: revert;
33 | font-size: 12px;
34 | font-style: normal;
35 | color: rgb(117, 117, 117);
36 | }
37 |
38 | .components-base-control:has(+ .lazyblocks-component-base-control__help) {
39 | margin-bottom: 0;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/assets/components/base-control/index.js:
--------------------------------------------------------------------------------
1 | // External Dependencies
2 | import classnames from 'classnames/dedupe';
3 |
4 | // Import CSS
5 | import './editor.scss';
6 |
7 | // The reason why we created this component is simple.
8 | // Our controls support the HTML in the control `help` attributes
9 | // but it conflicts with Gutenberg, since help is wrapped to tag.
10 | export default function BaseControl(props) {
11 | const { label, help, className, children, ...allProps } = props;
12 |
13 | return (
14 |
21 | {label ? (
22 |
23 | {label}
24 |
25 | ) : null}
26 | {children}
27 | {help ? (
28 |
29 | {help}
30 |
31 | ) : null}
32 |
33 | );
34 | }
35 |
--------------------------------------------------------------------------------
/assets/components/block-slug/editor.scss:
--------------------------------------------------------------------------------
1 | @import "../../variables";
2 |
3 | .lazyblocks-component-block-slug {
4 | display: flex;
5 | align-items: flex-start;
6 |
7 | .lazyblocks-component-block-slug-prefix {
8 | position: relative;
9 | display: inline-block;
10 | max-width: 100%;
11 | text-overflow: ellipsis;
12 | overflow: hidden;
13 | white-space: nowrap;
14 | padding: 6px 8px;
15 | padding-right: 10px;
16 | height: 40px;
17 | border: 1px solid #949494;
18 | line-height: normal;
19 | color: $gray-800;
20 | background-color: $gray-100;
21 | border-top-right-radius: 0;
22 | border-bottom-right-radius: 0;
23 | transition: 0.2s background-color;
24 |
25 | &:hover:not(:disabled,[aria-disabled="true"]),
26 | &.components-button[aria-expanded="true"] {
27 | background-color: $gray-300;
28 | color: $gray-800;
29 | }
30 |
31 | // Slash after namespace.
32 | > span {
33 | position: absolute;
34 | right: 5px;
35 | }
36 | }
37 |
38 | > .components-base-control {
39 | flex: 1;
40 | margin-bottom: 0 !important;
41 |
42 | input.components-text-control__input {
43 | padding-left: 5px;
44 | padding-right: 5px;
45 | margin-left: 0;
46 | border-left: none;
47 | border-top-left-radius: 0;
48 | border-bottom-left-radius: 0;
49 | }
50 |
51 | .components-base-control__field {
52 | margin-bottom: 0;
53 | }
54 | }
55 | }
56 |
57 | .lazyblocks-component-block-slug-prefix-dropdown {
58 | max-width: 60%;
59 | }
60 | .lazyblocks-component-block-slug-prefix-dropdown-content {
61 | .components-popover__content {
62 | width: 260px;
63 | padding: 16px;
64 | }
65 |
66 | .components-tab-panel__tabs {
67 | margin-top: -16px;
68 | margin-right: -16px;
69 | margin-bottom: 16px;
70 | margin-left: -16px;
71 | }
72 |
73 | a.lazyblocks-component-pro-notice-btn {
74 | margin-bottom: 0;
75 | margin-top: 12px;
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/assets/components/block-slug/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Styles.
3 | */
4 | import './editor.scss';
5 |
6 | /**
7 | * WordPress dependencies.
8 | */
9 | import {
10 | BaseControl,
11 | Button,
12 | TextControl,
13 | Dropdown,
14 | } from '@wordpress/components';
15 |
16 | import { __ } from '@wordpress/i18n';
17 |
18 | export default function BlockSlug(props) {
19 | return (
20 |
25 |
26 |
(
35 |
40 | lazyblock
41 | /
42 |
43 | )}
44 | renderContent={() => (
45 |
62 | )}
63 | />
64 |
72 |
73 |
74 | );
75 | }
76 |
--------------------------------------------------------------------------------
/assets/components/box/editor.scss:
--------------------------------------------------------------------------------
1 | @import "../../variables";
2 |
3 | .lazyblocks-component-box {
4 | padding: 25px;
5 | background-color: #fff;
6 | border-radius: $radius_box;
7 | box-shadow: rgba(#000, 0.1) 0 1px 3px 0, rgba(#000, 0.06) 0 1px 2px 0;
8 | }
9 |
10 | .lazyblocks-component-box-no-paddings {
11 | padding: 0;
12 | }
13 |
--------------------------------------------------------------------------------
/assets/components/box/index.js:
--------------------------------------------------------------------------------
1 | // Import CSS
2 | import './editor.scss';
3 |
4 | /**
5 | * External dependencies
6 | */
7 | import classnames from 'classnames/dedupe';
8 |
9 | export default function Box({ 'no-paddings': noPaddings, children }) {
10 | return (
11 |
17 | {children}
18 |
19 | );
20 | }
21 |
--------------------------------------------------------------------------------
/assets/components/copied/editor.scss:
--------------------------------------------------------------------------------
1 | @import "../../variables";
2 |
3 | .lazyblocks-component-copied {
4 | position: absolute;
5 | bottom: 100%;
6 | left: 0;
7 | padding: 4px 6px;
8 | margin-left: 50%;
9 | color: #fff;
10 | background: #000;
11 | border-radius: 3px;
12 | opacity: 0;
13 | transform: translateY(5px) translateX(-50%);
14 | animation: 0.3s lazyblocks-component-copied linear;
15 | }
16 |
17 | @keyframes lazyblocks-component-copied {
18 | 0% {
19 | opacity: 0;
20 | transition-timing-function: ease-out;
21 | transform: translateY(5px) translateX(-50%);
22 | }
23 |
24 | 50% {
25 | opacity: 1;
26 | transform: translateY(-5px) translateX(-50%);
27 | }
28 |
29 | 100% {
30 | opacity: 0;
31 | transition-timing-function: ease-in;
32 | transform: translateY(-15px) translateX(-50%);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/assets/components/copied/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Styles.
3 | */
4 | import './editor.scss';
5 |
6 | /**
7 | * WordPress dependencies.
8 | */
9 | import { __ } from '@wordpress/i18n';
10 |
11 | export default function Copied({ children }) {
12 | return (
13 |
14 | {children || __('Copied!', 'lazy-blocks')}
15 |
16 | );
17 | }
18 |
--------------------------------------------------------------------------------
/assets/components/document-tabs/editor.scss:
--------------------------------------------------------------------------------
1 | @import "../../variables";
2 |
3 | .post-type-lazyblocks {
4 | // fixed overflow and dropdowns in editor sidebar.
5 | .edit-post-sidebar > .components-panel {
6 | min-height: 100%;
7 | }
8 |
9 | .lazyblocks-component-document-tabs .components-panel__header.edit-post-sidebar-header {
10 | display: flex;
11 | margin-bottom: -1px;
12 | background-color: #fff;
13 | padding: 0;
14 | z-index: 2;
15 |
16 | > ul {
17 | display: flex;
18 |
19 | li {
20 | margin-bottom: 0;
21 | }
22 |
23 | button {
24 | position: relative;
25 | padding: 12px 16px;
26 | height: 48px;
27 | font-weight: 500;
28 | outline: none;
29 | box-shadow: none;
30 |
31 | &.is-active::after {
32 | height: calc(1 * var(--wp-admin-border-width-focus));
33 | outline: transparent solid 2px;
34 | outline-offset: -1px;
35 | content: "";
36 | position: absolute;
37 | right: 0;
38 | bottom: 0;
39 | left: 0;
40 | pointer-events: none;
41 | background: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
42 | border-radius: 0;
43 | transition: all 0.1s linear 0s;
44 | }
45 | }
46 | }
47 | }
48 | }
49 |
50 | .lazyblocks-component-document-tabs .lazyblocks-component-document-tabs-content {
51 | .components-base-control__label {
52 | display: inline-block;
53 | margin-bottom: 8px;
54 | }
55 |
56 | .components-panel__body:first-child {
57 | margin-top: 0;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/assets/components/modal/editor.scss:
--------------------------------------------------------------------------------
1 | @import "../../variables";
2 |
3 | .lzb-component-modal {
4 | @media (min-width: 600px) {
5 | &.lzb-component-modal-size-md {
6 | min-width: 600px;
7 | max-width: 600px;
8 |
9 | // fix for Ace editor tooltips
10 | margin-left: -300px;
11 | transform: none;
12 |
13 | // position
14 | &.lzb-component-modal-position-top {
15 | top: 112px;
16 | }
17 | }
18 | }
19 |
20 | // size
21 | @media (min-width: 840px) {
22 | &.lzb-component-modal-size-lg {
23 | min-width: 800px;
24 | max-width: 800px;
25 |
26 | // fix for Ace editor tooltips
27 | margin-left: -400px;
28 | transform: none;
29 | }
30 | }
31 |
32 | // header
33 | .components-modal__header {
34 | .components-modal__icon-container svg {
35 | display: block;
36 | margin-right: 10px;
37 | }
38 |
39 | .components-modal__header-heading {
40 | font-weight: 600;
41 | }
42 | }
43 |
44 | // tab panel
45 | .lzb-component-modal-tab-panel {
46 | .components-tab-panel__tabs {
47 | margin-top: -16px;
48 | margin-right: -16px;
49 | margin-left: -16px;
50 |
51 | .lzb-control-tabs-tab {
52 | padding: 12px 16px;
53 | color: inherit;
54 |
55 | &:focus {
56 | outline: none;
57 | }
58 | }
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/assets/components/modal/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Styles.
3 | */
4 | import './editor.scss';
5 |
6 | /**
7 | * External dependencies
8 | */
9 | import classnames from 'classnames/dedupe';
10 |
11 | /**
12 | * WordPress dependencies
13 | */
14 | import { Modal } from '@wordpress/components';
15 |
16 | export default function ModalComponent(props) {
17 | let className = 'lzb-component-modal';
18 |
19 | if (props.position) {
20 | className = classnames(
21 | className,
22 | `lzb-component-modal-position-${props.position}`
23 | );
24 | }
25 |
26 | if (props.size) {
27 | className = classnames(
28 | className,
29 | `lzb-component-modal-size-${props.size}`
30 | );
31 | }
32 |
33 | className = classnames(className, props.className);
34 |
35 | return (
36 |
37 | {props.children}
38 |
39 | );
40 | }
41 |
--------------------------------------------------------------------------------
/assets/components/preview-error-boundary/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { __ } from '@wordpress/i18n';
5 | import { Component } from '@wordpress/element';
6 |
7 | class PreviewErrorBoundary extends Component {
8 | constructor(props) {
9 | super(props);
10 | this.state = { hasError: false };
11 | }
12 |
13 | static getDerivedStateFromError() {
14 | return { hasError: true };
15 | }
16 |
17 | componentDidCatch() {}
18 |
19 | render() {
20 | if (this.state.hasError) {
21 | return (
22 |
23 | {__(
24 | 'Error: Could not generate the preview.',
25 | 'lazy-blocks'
26 | )}
27 |
28 | );
29 | }
30 |
31 | return this.props.children;
32 | }
33 | }
34 | export default PreviewErrorBoundary;
35 |
--------------------------------------------------------------------------------
/assets/components/preview-server-callback/editor.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Better appender styles.
3 | */
4 | // We use these variables in order to support nested inner blocks.
5 | .wp-block:has(.lazyblock-inner-blocks),
6 | .lazyblock {
7 | --lazyblocks-appender_pointer-events: initial;
8 | --lazyblocks-appender-overlay_display: none;
9 | --lazyblocks-appender-inserter_visibility: visible;
10 | }
11 | .wp-block:has(.lazyblock-inner-blocks):not(.is-selected),
12 | .lazyblock:not(.is-selected) {
13 | --lazyblocks-appender_pointer-events: none;
14 | --lazyblocks-appender-overlay_display: block;
15 | --lazyblocks-appender-inserter_visibility: hidden;
16 | }
17 | .lazyblock-inner-blocks > .block-list-appender:only-child {
18 | pointer-events: var(--lazyblocks-appender_pointer-events);
19 |
20 | &::after {
21 | position: absolute;
22 | display: var(--lazyblocks-appender-overlay_display);
23 | top: 0;
24 | right: 0;
25 | bottom: 0;
26 | left: 0;
27 | pointer-events: none;
28 | content: "";
29 | border: 1px dashed;
30 | border-radius: 2px;
31 | }
32 |
33 | .block-editor-inserter {
34 | visibility: var(--lazyblocks-appender-inserter_visibility);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/assets/components/pro-notice/editor.scss:
--------------------------------------------------------------------------------
1 | @import "../../variables";
2 |
3 | .lazyblocks-component-pro-notice {
4 | &,
5 | > .components-base-control__field {
6 | margin-bottom: 0 !important;
7 | }
8 |
9 | .lazyblocks-component-pro-notice-btn {
10 | display: block;
11 | padding: 10px;
12 | margin-top: 5px;
13 | margin-bottom: 12px;
14 | font-size: 11px;
15 | font-weight: 500;
16 | line-height: 1.4;
17 | color: #fff;
18 | text-align: center;
19 | text-decoration: none;
20 | text-transform: uppercase;
21 | background: linear-gradient(130deg, #fa903d 0%, #d72774 100%);
22 | border-radius: 4px;
23 | transition: 0.2s transform, 0.2s box-shadow;
24 |
25 | &:hover,
26 | &:focus {
27 | box-shadow: 0 1px 3px rgba(#d72774, 30%);
28 | transform: translateY(-1px);
29 | }
30 | }
31 |
32 | ul {
33 | margin-left: 1.3em;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/assets/components/pro-notice/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Styles.
3 | */
4 | import './editor.scss';
5 |
6 | /**
7 | * WordPress dependencies.
8 | */
9 | import { __ } from '@wordpress/i18n';
10 | import { PanelBody, BaseControl } from '@wordpress/components';
11 |
12 | const { lazyblocksBlockBuilderData } = window;
13 |
14 | export default function ProNotice() {
15 | if (lazyblocksBlockBuilderData.is_pro) {
16 | return null;
17 | }
18 |
19 | return (
20 |
21 |
27 |
28 |
34 | {__('Upgrade Now', 'lazy-blocks')}
35 |
36 |
37 |
38 | {__(
39 | 'Custom block collections and slug namespaces',
40 | 'lazy-blocks'
41 | )}
42 |
43 |
44 | {__('Controls Conditional Logic', 'lazy-blocks')}
45 |
46 | {__('Panels and Dividers', 'lazy-blocks')}
47 |
48 | {__(
49 | 'Posts, Taxonomy, User Controls',
50 | 'lazy-blocks'
51 | )}
52 |
53 | {__('Blocks Preloading', 'lazy-blocks')}
54 | {__('SEO Enhancements', 'lazy-blocks')}
55 |
56 |
61 | {__('And much more…', 'lazy-blocks')}
62 |
63 |
64 |
65 |
66 |
67 |
68 | );
69 | }
70 |
--------------------------------------------------------------------------------
/assets/components/select/editor.scss:
--------------------------------------------------------------------------------
1 | @import "../../variables";
2 |
3 | .lazyblocks-component-select {
4 | input[type="text"] {
5 | min-height: 20px;
6 |
7 | &:focus {
8 | box-shadow: none;
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/assets/components/select/style-provider.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Add style provider to fix styles render inside the editor iframe.
3 | * thanks to https://github.com/WordPress/gutenberg/issues/38226#issuecomment-1492422260
4 | *
5 | * This is a copy of Gutenberg component
6 | * https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/style-provider/index.tsx
7 | */
8 | import { CacheProvider } from '@emotion/react';
9 | import createCache from '@emotion/cache';
10 | import * as uuid from 'uuid';
11 |
12 | import { useRef, useState, useEffect } from '@wordpress/element';
13 |
14 | const uuidCache = new Set();
15 | // Use a weak map so that when the container is detached it's automatically
16 | // dereferenced to avoid memory leak.
17 | const containerCacheMap = new WeakMap();
18 |
19 | const memoizedCreateCacheWithContainer = (container) => {
20 | if (containerCacheMap.has(container)) {
21 | return containerCacheMap.get(container);
22 | }
23 |
24 | // Emotion only accepts alphabetical and hyphenated keys so we just
25 | // strip the numbers from the UUID. It _should_ be fine.
26 | let key = uuid.v4().replace(/[0-9]/g, '');
27 | while (uuidCache.has(key)) {
28 | key = uuid.v4().replace(/[0-9]/g, '');
29 | }
30 | uuidCache.add(key);
31 |
32 | const cache = createCache({ container, key });
33 | containerCacheMap.set(container, cache);
34 | return cache;
35 | };
36 |
37 | function StyleProvider(props) {
38 | const { children, document } = props;
39 |
40 | if (!document) {
41 | return null;
42 | }
43 |
44 | const cache = memoizedCreateCacheWithContainer(document.head);
45 |
46 | return {children} ;
47 | }
48 |
49 | export default function StyleProviderWrapper({ children }) {
50 | const linkRef = useRef();
51 | const [ownerDocument, setOwnerDocument] = useState(document);
52 |
53 | // Run once after initial render when DOM is ready
54 | useEffect(() => {
55 | if (linkRef?.current) {
56 | setOwnerDocument(linkRef?.current?.ownerDocument);
57 | }
58 | }, [linkRef]);
59 |
60 | return (
61 | <>
62 |
63 | {children}
64 | >
65 | );
66 | }
67 |
--------------------------------------------------------------------------------
/assets/components/tab-panel/editor.scss:
--------------------------------------------------------------------------------
1 | @import "../../variables";
2 |
3 | /**
4 | * Tabs Panel Control.
5 | */
6 | .lazyblocks-control-tabs {
7 | > .components-tab-panel__tabs {
8 | display: inline-flex;
9 | flex-wrap: wrap;
10 | padding: 4px;
11 | margin-bottom: 12px;
12 | border: 1px solid #949494;
13 | border-radius: 2px;
14 | gap: 4px;
15 |
16 | // single tab
17 | > .lazyblocks-control-tabs-tab {
18 | height: auto !important;
19 | font-weight: 500;
20 | font-size: 13px;
21 | padding: 7px;
22 | margin: 0;
23 | color: #1e1e1e;
24 | cursor: pointer;
25 | background: none;
26 | border: none;
27 | border-radius: 2px;
28 | box-shadow: 0 0 0 transparent;
29 |
30 | &::before,
31 | &::after {
32 | content: none;
33 | }
34 |
35 | &.lazyblocks-control-tabs-tab-hidden:not(.is-active) {
36 | display: none;
37 | }
38 |
39 | svg {
40 | display: block;
41 | width: auto;
42 | height: 1.4em;
43 | margin-right: 0.3em;
44 | }
45 |
46 | &.is-active {
47 | position: relative;
48 | z-index: 1;
49 | background-color: #1e1e1e;
50 | color: #fff;
51 | }
52 | }
53 | }
54 |
55 | // wide
56 | &.lazyblocks-control-tabs-wide > .components-tab-panel__tabs > .lazyblocks-control-tabs-tab {
57 | flex: 1;
58 | justify-content: center;
59 | text-align: center;
60 | }
61 |
62 | .lazyblocks-control-tabs-separator {
63 | padding: 15px;
64 | margin-right: -15px;
65 | margin-left: -15px;
66 | border-top: 1px solid $color_gray;
67 |
68 | &:first-child {
69 | margin-top: -16px;
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/assets/components/tab-panel/index.js:
--------------------------------------------------------------------------------
1 | import './editor.scss';
2 |
--------------------------------------------------------------------------------
/assets/components/tabs/editor.scss:
--------------------------------------------------------------------------------
1 | @import "../../variables";
2 |
3 | .lazyblocks-component-tabs {
4 | // tabs.
5 | .components-tab-panel__tabs {
6 | display: flex;
7 | flex-wrap: wrap;
8 | padding: 0 20px;
9 |
10 | .components-button {
11 | padding: 10px 16px;
12 | margin-bottom: -1px;
13 | font-weight: 500;
14 | color: inherit;
15 | text-decoration: none;
16 | border: 1px solid transparent;
17 | border-bottom: none;
18 | border-radius: $radius_large $radius_large 0 0;
19 | box-shadow: none;
20 | opacity: 0.4;
21 | transition: 0.15s opacity, 0.15s background-color, 0.15s border-color;
22 |
23 | &:hover {
24 | opacity: 0.8;
25 | }
26 |
27 | &.is-active {
28 | background-color: #fff;
29 | border-color: rgba(0, 0, 0, 7%);
30 | opacity: 1;
31 | }
32 | }
33 | }
34 |
35 | // tabs content.
36 | .components-tab-panel__tab-content {
37 | padding: 15px 20px;
38 | background-color: #fff;
39 | border: 1px solid rgba(0, 0, 0, 7%);
40 | border-radius: $radius_large;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/assets/components/tabs/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Styles.
3 | */
4 | import './editor.scss';
5 |
6 | /**
7 | * WordPress dependencies.
8 | */
9 | import { BaseControl, TabPanel } from '@wordpress/components';
10 |
11 | export default function Tabs({ tabs, children }) {
12 | return (
13 |
14 |
15 | {children}
16 |
17 |
18 | );
19 | }
20 |
--------------------------------------------------------------------------------
/assets/editor/blocks/free/edit.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { useSelect } from '@wordpress/data';
5 | import {
6 | InnerBlocks,
7 | useBlockProps,
8 | useInnerBlocksProps,
9 | } from '@wordpress/block-editor';
10 |
11 | export default function BlockEdit({ clientId }) {
12 | const { hasChildBlocks } = useSelect(
13 | (select) => {
14 | const { getBlockOrder } = select('core/block-editor');
15 |
16 | return {
17 | hasChildBlocks: getBlockOrder(clientId).length > 0,
18 | };
19 | },
20 | [clientId]
21 | );
22 |
23 | const blockProps = useBlockProps({ className: 'lazyblocks-free' });
24 | const innerBlocksProps = useInnerBlocksProps(blockProps, {
25 | templateLock: null,
26 | renderAppender: hasChildBlocks
27 | ? undefined
28 | : InnerBlocks.ButtonBlockAppender,
29 | });
30 |
31 | return
;
32 | }
33 |
--------------------------------------------------------------------------------
/assets/editor/blocks/free/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { __ } from '@wordpress/i18n';
5 | import { registerBlockType } from '@wordpress/blocks';
6 |
7 | /**
8 | * Internal dependencies.
9 | */
10 | import BlockEdit from './edit';
11 | import BlockSave from './save';
12 |
13 | // register block.
14 | registerBlockType('lazyblock-core/free', {
15 | apiVersion: 3,
16 | title: __('Free Content', 'lazy-blocks'),
17 | description: __(
18 | 'Block used for adding blocks inside it in cases when template locked from adding blocks.',
19 | 'lazy-blocks'
20 | ),
21 | category: 'lazyblocks',
22 | supports: {
23 | html: true,
24 | customClassName: false,
25 | inserter: window.pagenow && window.pagenow === 'lazyblocks_templates',
26 | },
27 | edit: BlockEdit,
28 | save: BlockSave,
29 | });
30 |
--------------------------------------------------------------------------------
/assets/editor/blocks/free/save.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { useInnerBlocksProps } from '@wordpress/block-editor';
5 |
6 | export default function BlockSave() {
7 | const innerBlocksProps = useInnerBlocksProps.save();
8 | return innerBlocksProps.children;
9 | }
10 |
--------------------------------------------------------------------------------
/assets/editor/blocks/main/index.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-param-reassign */
2 | /**
3 | * WordPress dependencies.
4 | */
5 | import { registerBlockType } from '@wordpress/blocks';
6 |
7 | /**
8 | * Internal dependencies.
9 | */
10 | import BlockEdit from './edit';
11 | import BlockSave from './save';
12 |
13 | let options = window.lazyblocksGutenberg;
14 | if (!options || !options.blocks || !options.blocks.length) {
15 | options = {
16 | blocks: [],
17 | controls: {},
18 | };
19 | }
20 |
21 | // each registered block.
22 | options.blocks.forEach((item) => {
23 | // conditionally show for specific post type.
24 | if (item.supports.inserter && item?.condition?.length) {
25 | let preventInsertion = false;
26 | item.condition.forEach((val) => {
27 | if (window.pagenow && val === window.pagenow) {
28 | preventInsertion = true;
29 | }
30 | });
31 | item.supports.inserter = preventInsertion;
32 | }
33 |
34 | let registerIcon = '';
35 |
36 | if (item.icon && /^dashicons/.test(item.icon)) {
37 | registerIcon =
38 | item.icon.replace(/^dashicons dashicons-/, '') || 'marker';
39 | } else if (item.icon) {
40 | // eslint-disable-next-line react/no-danger
41 | registerIcon = ;
42 | }
43 |
44 | // register block.
45 | registerBlockType(item.slug, {
46 | apiVersion: 3,
47 | title: item.title || item.slug,
48 | description: item.description,
49 | icon: registerIcon,
50 | category: item.category,
51 | keywords: item.keywords,
52 | supports: item.supports,
53 |
54 | lazyblock: true,
55 |
56 | edit(props) {
57 | return ;
58 | },
59 |
60 | save: BlockSave,
61 | });
62 | });
63 |
--------------------------------------------------------------------------------
/assets/editor/blocks/main/save.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { useInnerBlocksProps } from '@wordpress/block-editor';
5 |
6 | export default function BlockSave() {
7 | const innerBlocksProps = useInnerBlocksProps.save();
8 |
9 | return innerBlocksProps.children;
10 | }
11 |
--------------------------------------------------------------------------------
/assets/editor/index.js:
--------------------------------------------------------------------------------
1 | // Internal Dependencies
2 | import './index.scss';
3 | import './store';
4 | import './blocks/free';
5 | import './blocks/main';
6 | import './extensions/block-id';
7 | import './plugins';
8 |
--------------------------------------------------------------------------------
/assets/editor/plugins/index.js:
--------------------------------------------------------------------------------
1 | import { registerPlugin } from '@wordpress/plugins';
2 | import RemoveBlockWithSavedMeta from './remove-block-with-saved-post-meta';
3 |
4 | registerPlugin('lazy-blocks-remove-block-with-saved-meta', {
5 | render: RemoveBlockWithSavedMeta,
6 | });
7 |
--------------------------------------------------------------------------------
/assets/editor/plugins/remove-block-with-saved-post-meta/index.scss:
--------------------------------------------------------------------------------
1 | .lzb-gutenberg-remove-post-meta-modal-buttons {
2 | display: flex;
3 | gap: 16px;
4 | margin-top: 26px;
5 | }
6 |
--------------------------------------------------------------------------------
/assets/editor/store/components/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { createReduxStore, register } from '@wordpress/data';
5 |
6 | /**
7 | * Internal dependencies
8 | */
9 | import * as selectors from './selectors';
10 |
11 | const store = createReduxStore('lazy-blocks/components', {
12 | selectors,
13 | reducer(state) {
14 | return state;
15 | },
16 | });
17 |
18 | register(store);
19 |
--------------------------------------------------------------------------------
/assets/editor/store/components/selectors.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Internal dependencies
3 | */
4 | import BaseControl from '../../../components/base-control';
5 | import BlockSlug from '../../../components/block-slug';
6 | import Box from '../../../components/box';
7 | import Copied from '../../../components/copied';
8 | import DocumentTabs from '../../../components/document-tabs';
9 | import IconPicker from '../../../components/icon-picker';
10 | import Modal from '../../../components/modal';
11 | import Select from '../../../components/select';
12 | import Tabs from '../../../components/tabs';
13 |
14 | export function get() {
15 | return {
16 | BaseControl,
17 | BlockSlug,
18 | Box,
19 | Copied,
20 | DocumentTabs,
21 | IconPicker,
22 | Modal,
23 | Select,
24 | Tabs,
25 | };
26 | }
27 |
--------------------------------------------------------------------------------
/assets/editor/store/hooks/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { createReduxStore, register } from '@wordpress/data';
5 |
6 | /**
7 | * Internal dependencies
8 | */
9 | import * as selectors from './selectors';
10 |
11 | const store = createReduxStore('lazy-blocks/hooks', {
12 | selectors,
13 | reducer(state) {
14 | return state;
15 | },
16 | });
17 |
18 | register(store);
19 |
--------------------------------------------------------------------------------
/assets/editor/store/hooks/selectors.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Internal dependencies
3 | */
4 | import useBlockControlProps from '../../../hooks/use-block-control-props';
5 |
6 | export function get() {
7 | return {
8 | useBlockControlProps,
9 | };
10 | }
11 |
--------------------------------------------------------------------------------
/assets/editor/store/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Internal dependencies
3 | */
4 | import './utils';
5 | import './components';
6 | import './hooks';
7 |
--------------------------------------------------------------------------------
/assets/editor/store/utils/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { createReduxStore, register } from '@wordpress/data';
5 |
6 | /**
7 | * Internal dependencies
8 | */
9 | import * as selectors from './selectors';
10 |
11 | const store = createReduxStore('lazy-blocks/utils', {
12 | selectors,
13 | reducer(state) {
14 | return state;
15 | },
16 | });
17 |
18 | register(store);
19 |
--------------------------------------------------------------------------------
/assets/editor/store/utils/selectors.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Internal dependencies
3 | */
4 | import getUID from '../../../utils/get-uid';
5 | import getControlTypeData from '../../../utils/get-control-type-data';
6 |
7 | export function get() {
8 | return {
9 | getUID,
10 | getControlTypeData,
11 | };
12 | }
13 |
--------------------------------------------------------------------------------
/assets/editor/translation.js:
--------------------------------------------------------------------------------
1 | // This script is used for JS translations only.
2 | // Check lazy-blocks.php for more info.
3 |
--------------------------------------------------------------------------------
/assets/hooks/use-all-blocks/index.js:
--------------------------------------------------------------------------------
1 | import { useCallback, useMemo } from '@wordpress/element';
2 | import { useSelect } from '@wordpress/data';
3 |
4 | /**
5 | * Custom hook to get all blocks recursively.
6 | *
7 | * @return {Function} Function to get all blocks.
8 | */
9 | function useAllBlocks() {
10 | const { allBlocks } = useSelect((select) => {
11 | const { getBlocks } = select('core/block-editor');
12 |
13 | return {
14 | allBlocks: getBlocks(),
15 | };
16 | }, []);
17 |
18 | const flattenBlocks = useCallback((blocks) => {
19 | if (!blocks?.length) {
20 | return [];
21 | }
22 |
23 | const result = [];
24 |
25 | blocks.forEach((data) => {
26 | result.push(data);
27 |
28 | if (data.innerBlocks?.length) {
29 | result.push(...flattenBlocks(data.innerBlocks));
30 | }
31 | });
32 |
33 | return result;
34 | }, []);
35 |
36 | return useMemo(() => flattenBlocks(allBlocks), [allBlocks, flattenBlocks]);
37 | }
38 |
39 | export default useAllBlocks;
40 |
--------------------------------------------------------------------------------
/assets/hooks/use-block-control-props/index.js:
--------------------------------------------------------------------------------
1 | import classnames from 'classnames/dedupe';
2 |
3 | import getControlTypeData from '../../utils/get-control-type-data';
4 |
5 | export default function useBlockControlProps(
6 | controlProps,
7 | { className, ...data } = {}
8 | ) {
9 | const controlTypeData = getControlTypeData(controlProps.data.type);
10 | const props = {
11 | label: controlTypeData.restrictions.label_settings
12 | ? controlProps.data.label
13 | : false,
14 | help: controlTypeData.restrictions.help_settings
15 | ? controlProps.data.help
16 | : false,
17 | className: classnames(
18 | `lazyblocks-control lazyblocks-control-${controlProps.data.type}`,
19 | className
20 | ),
21 | 'data-lazyblocks-control-name': controlProps.data.name,
22 | ...data,
23 | };
24 |
25 | return props;
26 | }
27 |
--------------------------------------------------------------------------------
/assets/svg/icon-lazyblocks-black.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/assets/svg/icon-lazyblocks.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/assets/utils/check-control-validity/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { applyFilters } from '@wordpress/hooks';
5 | import { __ } from '@wordpress/i18n';
6 |
7 | import getControlTypeData from '../get-control-type-data';
8 |
9 | export default function checkControlValidity(val, control) {
10 | let result = false;
11 |
12 | const controlTypeData = getControlTypeData(control.type);
13 |
14 | if (
15 | controlTypeData &&
16 | controlTypeData.restrictions.required_settings &&
17 | control.required &&
18 | control.required === 'true'
19 | ) {
20 | const isValid = val !== '' && typeof val !== 'undefined';
21 |
22 | // custom validation filter.
23 | const { valid, message } = applyFilters(
24 | 'lzb.editor.control.validate',
25 | applyFilters(
26 | `lzb.editor.control.${control.type}.validate`,
27 | { valid: isValid, message: '' },
28 | val,
29 | control
30 | ),
31 | val,
32 | control
33 | );
34 |
35 | if (!valid) {
36 | result = message || __('This control is required.', 'lazy-blocks');
37 | }
38 | }
39 |
40 | return result;
41 | }
42 |
--------------------------------------------------------------------------------
/assets/utils/get-control-type-data/index.js:
--------------------------------------------------------------------------------
1 | const { controls = {} } =
2 | window.lazyblocksBlockBuilderData || window.lazyblocksGutenberg;
3 |
4 | export default function getControlTypeData(name) {
5 | if (name && controls[name]) {
6 | return controls[name];
7 | }
8 |
9 | // Display the Undefined control if the requested control does not exists.
10 | if (controls.undefined) {
11 | return controls.undefined;
12 | }
13 |
14 | return false;
15 | }
16 |
--------------------------------------------------------------------------------
/assets/utils/get-control-value/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { applyFilters } from '@wordpress/hooks';
5 |
6 | export default function getControlValue(
7 | attributes,
8 | meta = {},
9 | lazyBlockData,
10 | control,
11 | childIndex
12 | ) {
13 | let result = attributes[control.name];
14 |
15 | // Prepare Meta control value.
16 | if (control.save_in_meta === 'true') {
17 | result = meta[control.save_in_meta_name || control.name];
18 | }
19 |
20 | // Prepare child items.
21 | if (
22 | control.child_of &&
23 | lazyBlockData.controls[control.child_of] &&
24 | childIndex > -1
25 | ) {
26 | const childs = getControlValue(
27 | attributes,
28 | meta,
29 | lazyBlockData,
30 | lazyBlockData.controls[control.child_of]
31 | );
32 |
33 | if (
34 | childs &&
35 | typeof childs[childIndex] !== 'undefined' &&
36 | typeof childs[childIndex][control.name] !== 'undefined'
37 | ) {
38 | result = childs[childIndex][control.name];
39 | }
40 | }
41 |
42 | // Filter control value.
43 | result = applyFilters(
44 | `lzb.editor.control.${control.type}.getValue`,
45 | result,
46 | control,
47 | childIndex
48 | );
49 | result = applyFilters(
50 | 'lzb.editor.control.getValue',
51 | result,
52 | control,
53 | childIndex
54 | );
55 |
56 | // Prevent rendering an undefined value, because it triggers a JS error
57 | // when change of new controls inside existing repeater.
58 | if (typeof result === 'undefined') {
59 | result = '';
60 | }
61 |
62 | return result;
63 | }
64 |
--------------------------------------------------------------------------------
/assets/utils/get-uid/index.js:
--------------------------------------------------------------------------------
1 | // generate unique id.
2 | // thanks to https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
3 | export default function getUID() {
4 | return 'xxxyxx4xxx'.replace(/[xy]/g, (c) => {
5 | // eslint-disable-next-line
6 | let r = (Math.random() * 16) | 0;
7 | // eslint-disable-next-line
8 | const v = c === 'x' ? r : (r & 0x3) | 0x8;
9 | return v.toString(16);
10 | });
11 | }
12 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ['@babel/preset-env'],
3 | plugins: [
4 | [
5 | '@babel/plugin-transform-react-jsx',
6 | {
7 | pragma: 'wp.element.createElement',
8 | pragmaFrag: 'wp.element.Fragment',
9 | },
10 | ],
11 | ['@babel/plugin-proposal-object-rest-spread'],
12 | ],
13 | };
14 |
--------------------------------------------------------------------------------
/build/admin-templates-rtl.css:
--------------------------------------------------------------------------------
1 | .lzb-template-settings-panel .components-select-control select[multiple]{height:auto;padding-right:8px}.lzb-template-settings-panel .components-select-control select[multiple]~.components-input-control__suffix{display:none}
2 |
--------------------------------------------------------------------------------
/build/admin-templates.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => 'eb3ec6aecf8698366c4c');
2 |
--------------------------------------------------------------------------------
/build/admin-templates.css:
--------------------------------------------------------------------------------
1 | .lzb-template-settings-panel .components-select-control select[multiple]{height:auto;padding-right:8px}.lzb-template-settings-panel .components-select-control select[multiple]~.components-input-control__suffix{display:none}
2 |
--------------------------------------------------------------------------------
/build/admin-tools.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-components', 'wp-element', 'wp-i18n'), 'version' => 'ef9e249564ec49e19956');
2 |
--------------------------------------------------------------------------------
/build/block-builder-astra-style-rtl.css:
--------------------------------------------------------------------------------
1 | .post-type-lazyblocks.ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted,.post-type-lazyblocks.ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block:hover{box-shadow:none}.post-type-lazyblocks.ast-separate-container .edit-post-visual-editor__content-area{padding:0!important}.post-type-lazyblocks .components-panel__body .components-base-control__field,.post-type-lazyblocks .edit-post-visual-editor .editor-styles-wrapper>.is-root-container{padding-top:0}
2 |
--------------------------------------------------------------------------------
/build/block-builder-astra-style.css:
--------------------------------------------------------------------------------
1 | .post-type-lazyblocks.ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted,.post-type-lazyblocks.ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block:hover{box-shadow:none}.post-type-lazyblocks.ast-separate-container .edit-post-visual-editor__content-area{padding:0!important}.post-type-lazyblocks .components-panel__body .components-base-control__field,.post-type-lazyblocks .edit-post-visual-editor .editor-styles-wrapper>.is-root-container{padding-top:0}
2 |
--------------------------------------------------------------------------------
/build/block-builder.asset.php:
--------------------------------------------------------------------------------
1 | array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins'), 'version' => '4fa12ee3573d3cbd50b9');
2 |
--------------------------------------------------------------------------------
/build/control-checkbox-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-checkbox.asset.php:
--------------------------------------------------------------------------------
1 | array('react', 'react-dom', 'wp-components', 'wp-compose', 'wp-hooks', 'wp-i18n'), 'version' => 'fbd2d673a6c9116b7611');
2 |
--------------------------------------------------------------------------------
/build/control-checkbox.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-classic-editor-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 | @media(min-width:600px){.lzb-component-modal.lzb-component-modal-size-md{margin-left:-300px;max-width:600px;min-width:600px;transform:none}.lzb-component-modal.lzb-component-modal-size-md.lzb-component-modal-position-top{top:112px}}@media(min-width:840px){.lzb-component-modal.lzb-component-modal-size-lg{margin-left:-400px;max-width:800px;min-width:800px;transform:none}}.lzb-component-modal .components-modal__header .components-modal__icon-container svg{display:block;margin-right:10px}.lzb-component-modal .components-modal__header .components-modal__header-heading{font-weight:600}.lzb-component-modal .lzb-component-modal-tab-panel .components-tab-panel__tabs{margin-left:-16px;margin-right:-16px;margin-top:-16px}.lzb-component-modal .lzb-component-modal-tab-panel .components-tab-panel__tabs .lzb-control-tabs-tab{color:inherit;padding:12px 16px}.lzb-component-modal .lzb-component-modal-tab-panel .components-tab-panel__tabs .lzb-control-tabs-tab:focus{outline:none}
3 |
--------------------------------------------------------------------------------
/build/control-classic-editor.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '8750294774c5eab72daf');
2 |
--------------------------------------------------------------------------------
/build/control-classic-editor.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 | @media(min-width:600px){.lzb-component-modal.lzb-component-modal-size-md{margin-left:-300px;max-width:600px;min-width:600px;transform:none}.lzb-component-modal.lzb-component-modal-size-md.lzb-component-modal-position-top{top:112px}}@media(min-width:840px){.lzb-component-modal.lzb-component-modal-size-lg{margin-left:-400px;max-width:800px;min-width:800px;transform:none}}.lzb-component-modal .components-modal__header .components-modal__icon-container svg{display:block;margin-right:10px}.lzb-component-modal .components-modal__header .components-modal__header-heading{font-weight:600}.lzb-component-modal .lzb-component-modal-tab-panel .components-tab-panel__tabs{margin-left:-16px;margin-right:-16px;margin-top:-16px}.lzb-component-modal .lzb-component-modal-tab-panel .components-tab-panel__tabs .lzb-control-tabs-tab{color:inherit;padding:12px 16px}.lzb-component-modal .lzb-component-modal-tab-panel .components-tab-panel__tabs .lzb-control-tabs-tab:focus{outline:none}
3 |
--------------------------------------------------------------------------------
/build/control-code-editor-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-code-editor.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-block-editor', 'wp-hooks'), 'version' => 'a740000ffe6d1e4a03d8');
2 |
--------------------------------------------------------------------------------
/build/control-code-editor.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-color-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-color.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-block-editor', 'wp-components', 'wp-data', 'wp-hooks', 'wp-i18n'), 'version' => '92a4443518eb382be636');
2 |
--------------------------------------------------------------------------------
/build/control-color.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-date-time-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-date-time.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-components', 'wp-date', 'wp-hooks', 'wp-i18n'), 'version' => 'a65db4110a9776bb839a');
2 |
--------------------------------------------------------------------------------
/build/control-date-time.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-email-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-email.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-components', 'wp-hooks', 'wp-i18n'), 'version' => '7c33a38811676c49ba8a');
2 |
--------------------------------------------------------------------------------
/build/control-email.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-file-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-select input[type=text]{min-height:20px}.lazyblocks-component-select input[type=text]:focus{box-shadow:none}
2 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
3 |
--------------------------------------------------------------------------------
/build/control-file.asset.php:
--------------------------------------------------------------------------------
1 | array('react', 'react-dom', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '8bb0d9b7a59c1cc44134');
2 |
--------------------------------------------------------------------------------
/build/control-file.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-select input[type=text]{min-height:20px}.lazyblocks-component-select input[type=text]:focus{box-shadow:none}
2 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
3 |
--------------------------------------------------------------------------------
/build/control-gallery-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-gallery.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-block-editor', 'wp-components', 'wp-data', 'wp-hooks', 'wp-i18n'), 'version' => 'ea5a629bfd42e3a6869e');
2 |
--------------------------------------------------------------------------------
/build/control-gallery.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-image-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-image.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-block-editor', 'wp-components', 'wp-data', 'wp-hooks', 'wp-i18n'), 'version' => '3721db39a0450ed21c62');
2 |
--------------------------------------------------------------------------------
/build/control-image.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-inner-blocks-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-inner-blocks.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-block-editor', 'wp-components', 'wp-hooks', 'wp-i18n'), 'version' => '32ec2ccec2e6e8b72058');
2 |
--------------------------------------------------------------------------------
/build/control-inner-blocks.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-number-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-number.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-components', 'wp-hooks', 'wp-i18n'), 'version' => 'ab4e3d8aec35fa89e55f');
2 |
--------------------------------------------------------------------------------
/build/control-number.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-password-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-password.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-components', 'wp-hooks', 'wp-i18n'), 'version' => 'ffe83bda9f7fe6c55c5c');
2 |
--------------------------------------------------------------------------------
/build/control-password.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-radio-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-radio.asset.php:
--------------------------------------------------------------------------------
1 | array('react', 'react-dom', 'wp-components', 'wp-compose', 'wp-hooks', 'wp-i18n'), 'version' => '8eead82b8b2d063d9063');
2 |
--------------------------------------------------------------------------------
/build/control-radio.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-range-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-range.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-components', 'wp-hooks', 'wp-i18n'), 'version' => '4744b6a1f3620fc2eb0d');
2 |
--------------------------------------------------------------------------------
/build/control-range.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-repeater-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-repeater.asset.php:
--------------------------------------------------------------------------------
1 | array('lodash', 'react', 'react-dom', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '99e4354a4620788bae6a');
2 |
--------------------------------------------------------------------------------
/build/control-repeater.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-rich-text-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-rich-text.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-block-editor', 'wp-hooks'), 'version' => '6adb415b9d3f93d242de');
2 |
--------------------------------------------------------------------------------
/build/control-rich-text.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-select-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-select.asset.php:
--------------------------------------------------------------------------------
1 | array('react', 'react-dom', 'wp-components', 'wp-compose', 'wp-hooks', 'wp-i18n'), 'version' => '1146f769f9febacd5136');
2 |
--------------------------------------------------------------------------------
/build/control-select.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-text-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-text.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-components', 'wp-hooks', 'wp-i18n'), 'version' => '6775dfdcb96a75f828e0');
2 |
--------------------------------------------------------------------------------
/build/control-text.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-textarea-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-textarea.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-components', 'wp-hooks', 'wp-i18n'), 'version' => '4f92df4b7757a8b307a8');
2 |
--------------------------------------------------------------------------------
/build/control-textarea.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-toggle-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-toggle.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-components', 'wp-hooks', 'wp-i18n'), 'version' => 'fd4552dde8432447db1a');
2 |
--------------------------------------------------------------------------------
/build/control-toggle.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-undefined-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-undefined.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-components', 'wp-hooks', 'wp-i18n'), 'version' => '7a817e3fd52a4d9e0ba1');
2 |
--------------------------------------------------------------------------------
/build/control-undefined.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-url-rtl.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/control-url.asset.php:
--------------------------------------------------------------------------------
1 | array('wp-block-editor', 'wp-element', 'wp-hooks'), 'version' => '056ff00883e7a9d075d6');
2 |
--------------------------------------------------------------------------------
/build/control-url.css:
--------------------------------------------------------------------------------
1 | .lazyblocks-component-base-control{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.lazyblocks-component-base-control,.lazyblocks-component-base-control *{box-sizing:border-box}.block-editor-block-inspector .lazyblocks-component-base-control{margin-bottom:24px}.block-editor-block-inspector .lazyblocks-component-base-control:last-child{margin-bottom:8px}.lazyblocks-component-base-control .lazyblocks-component-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;padding:0;text-transform:uppercase}.lazyblocks-component-base-control .lazyblocks-component-base-control__help{color:#757575;font-size:12px;font-style:normal;margin-bottom:revert;margin-top:8px}.lazyblocks-component-base-control .components-base-control:has(+.lazyblocks-component-base-control__help){margin-bottom:0}
2 |
--------------------------------------------------------------------------------
/build/editor-translation.asset.php:
--------------------------------------------------------------------------------
1 | array(), 'version' => '31d6cfe0d16ae931b73c');
2 |
--------------------------------------------------------------------------------
/build/editor-translation.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nk-crew/lazy-blocks/61d439b600924a29fc41623c879aed23276e7c77/build/editor-translation.js
--------------------------------------------------------------------------------
/build/editor.asset.php:
--------------------------------------------------------------------------------
1 | array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins'), 'version' => 'b67ebd920e6f7befe136');
2 |
--------------------------------------------------------------------------------
/classes/3rd/class-astra.php:
--------------------------------------------------------------------------------
1 | =8.1"
12 | },
13 | "require-dev": {
14 | "wp-coding-standards/wpcs": "^3.1",
15 | "sirbrillig/phpcs-variable-analysis": "^2.12",
16 | "phpcompatibility/phpcompatibility-wp": "^2.1",
17 | "wp-cli/i18n-command": "^2.6",
18 | "dealerdirect/phpcodesniffer-composer-installer": "^1.0",
19 | "php-parallel-lint/php-parallel-lint": "^1.4",
20 | "php-stubs/wordpress-stubs": "^6.8",
21 | "php-stubs/wordpress-tests-stubs": "^6.8",
22 | "spatie/phpunit-watcher": "^1.24",
23 | "yoast/phpunit-polyfills": "^4.0"
24 | },
25 | "scripts": {
26 | "lint": "phpcs --standard=phpcs.xml.dist",
27 | "format": "phpcbf --standard=phpcs.xml.dist --report-summary --report-source",
28 | "test": "phpunit",
29 | "test:watch": "phpunit-watcher watch < /dev/tty",
30 | "wp": "\"vendor/wp-cli/wp-cli/bin/wp\""
31 | },
32 | "config": {
33 | "allow-plugins": true
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/controls/classic_editor/script.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { addFilter } from '@wordpress/hooks';
5 |
6 | /**
7 | * Internal dependencies.
8 | */
9 | import BaseControl from '../../assets/components/base-control';
10 | import useBlockControlProps from '../../assets/hooks/use-block-control-props';
11 |
12 | import TMCE from './tmce';
13 |
14 | /**
15 | * Control render in editor.
16 | */
17 | addFilter(
18 | 'lzb.editor.control.classic_editor.render',
19 | 'lzb.editor',
20 | (render, props, blockProps) => {
21 | const uniqueKey = `${props.placement}-${blockProps.clientId}-${
22 | props.uniqueId
23 | }-${props.data.name}-${props.childIndex || 0}`;
24 |
25 | const controlProps = useBlockControlProps(props);
26 |
27 | return (
28 |
29 | {
33 | props.onChange(val);
34 | }}
35 | editorId={uniqueKey}
36 | />
37 |
38 | );
39 | }
40 | );
41 |
--------------------------------------------------------------------------------
/controls/code_editor/index.php:
--------------------------------------------------------------------------------
1 | name = 'code_editor';
21 | $this->icon = ' ';
22 | $this->type = 'string';
23 | $this->label = __( 'Code Editor', 'lazy-blocks' );
24 | $this->category = 'content';
25 | $this->restrictions = array(
26 | 'translate_settings' => true,
27 | );
28 |
29 | parent::__construct();
30 | }
31 |
32 | /**
33 | * Register assets action.
34 | */
35 | public function register_assets() {
36 | LazyBlocks_Assets::register_script( 'lazyblocks-control-code-editor', 'build/control-code-editor' );
37 | }
38 |
39 | /**
40 | * Get script dependencies.
41 | *
42 | * @return array script dependencies.
43 | */
44 | public function get_script_depends() {
45 | return array( 'lazyblocks-control-code-editor' );
46 | }
47 | }
48 |
49 | new LazyBlocks_Control_CodeEditor();
50 |
--------------------------------------------------------------------------------
/controls/code_editor/script.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { addFilter } from '@wordpress/hooks';
5 | import { PlainText } from '@wordpress/blockEditor';
6 |
7 | /**
8 | * Internal dependencies.
9 | */
10 | import BaseControl from '../../assets/components/base-control';
11 | import useBlockControlProps from '../../assets/hooks/use-block-control-props';
12 |
13 | /**
14 | * Control render in editor.
15 | */
16 | addFilter(
17 | 'lzb.editor.control.code_editor.render',
18 | 'lzb.editor',
19 | (render, props) => (
20 |
21 | {
24 | props.onChange(val);
25 | }}
26 | />
27 |
28 | )
29 | );
30 |
--------------------------------------------------------------------------------
/controls/color/color-control.js:
--------------------------------------------------------------------------------
1 | /**
2 | * External dependencies.
3 | */
4 | import classnames from 'classnames/dedupe';
5 |
6 | /**
7 | * WordPress dependencies.
8 | */
9 | import { Dropdown, Button } from '@wordpress/components';
10 |
11 | /**
12 | * Internal dependencies.
13 | */
14 | import ColorPalette from './color-palette';
15 |
16 | function ColorControl(props) {
17 | const {
18 | value,
19 | label = '',
20 | alpha = false,
21 | palette = true,
22 | onChange = () => {},
23 | } = props;
24 |
25 | return (
26 | (
35 |
42 |
46 |
47 | {label}
48 |
49 |
50 | )}
51 | renderContent={() => (
52 |
53 | {
58 | onChange(val);
59 | }}
60 | />
61 |
62 | )}
63 | />
64 | );
65 | }
66 |
67 | export default ColorControl;
68 |
--------------------------------------------------------------------------------
/controls/color/color-palette/index.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable react-hooks/rules-of-hooks */
2 | /**
3 | * WordPress dependencies.
4 | */
5 | import { ColorPalette as WPColorPalette } from '@wordpress/components';
6 | import { __experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients } from '@wordpress/block-editor';
7 | import { useSelect } from '@wordpress/data';
8 |
9 | function useColors() {
10 | // New way to get colors and gradients.
11 | if (
12 | useMultipleOriginColorsAndGradients &&
13 | useMultipleOriginColorsAndGradients()
14 | ) {
15 | return useMultipleOriginColorsAndGradients().colors;
16 | }
17 |
18 | // Old way.
19 | const { themeColors } = useSelect((select) => {
20 | const settings = select('core/block-editor').getSettings();
21 |
22 | return {
23 | themeColors: settings.colors,
24 | };
25 | });
26 |
27 | const colors = [];
28 |
29 | if (themeColors && themeColors.length) {
30 | colors.push({ name: 'Theme', colors: themeColors });
31 | }
32 |
33 | return colors;
34 | }
35 |
36 | export default function ColorPalette(props) {
37 | const { value, alpha = false, palette = true, onChange = () => {} } = props;
38 |
39 | const colors = useColors();
40 |
41 | return (
42 | {
47 | onChange(val);
48 | }}
49 | __experimentalHasMultipleOrigins
50 | __experimentalIsRenderedInSidebar
51 | />
52 | );
53 | }
54 |
--------------------------------------------------------------------------------
/controls/date_time/index.php:
--------------------------------------------------------------------------------
1 | name = 'date_time';
21 | $this->icon = ' ';
22 | $this->type = 'string';
23 | $this->label = __( 'Date Time Picker', 'lazy-blocks' );
24 | $this->category = 'advanced';
25 | $this->attributes = array(
26 | 'date_time_picker' => 'date_time',
27 | );
28 | $this->restrictions = array(
29 | 'translate_settings' => true,
30 | );
31 |
32 | parent::__construct();
33 | }
34 |
35 | /**
36 | * Register assets action.
37 | */
38 | public function register_assets() {
39 | LazyBlocks_Assets::register_script( 'lazyblocks-control-date-time', 'build/control-date-time' );
40 | }
41 |
42 | /**
43 | * Get script dependencies.
44 | *
45 | * @return array script dependencies.
46 | */
47 | public function get_script_depends() {
48 | return array( 'lazyblocks-control-date-time' );
49 | }
50 | }
51 |
52 | new LazyBlocks_Control_DateTime();
53 |
--------------------------------------------------------------------------------
/controls/email/index.php:
--------------------------------------------------------------------------------
1 | name = 'email';
21 | $this->icon = ' ';
22 | $this->type = 'string';
23 | $this->label = __( 'Email', 'lazy-blocks' );
24 | $this->attributes = array(
25 | 'placeholder' => '',
26 | 'characters_limit' => '',
27 | );
28 | $this->restrictions = array(
29 | 'translate_settings' => true,
30 | );
31 |
32 | parent::__construct();
33 | }
34 |
35 | /**
36 | * Register assets action.
37 | */
38 | public function register_assets() {
39 | LazyBlocks_Assets::register_script( 'lazyblocks-control-email', 'build/control-email' );
40 | }
41 |
42 | /**
43 | * Get script dependencies.
44 | *
45 | * @return array script dependencies.
46 | */
47 | public function get_script_depends() {
48 | return array( 'lazyblocks-control-email' );
49 | }
50 | }
51 |
52 | new LazyBlocks_Control_Email();
53 |
--------------------------------------------------------------------------------
/controls/inner_blocks/script.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { __ } from '@wordpress/i18n';
5 | import { addFilter } from '@wordpress/hooks';
6 | import { useInnerBlocksProps } from '@wordpress/block-editor';
7 | import { PanelBody, Notice, Button } from '@wordpress/components';
8 |
9 | /**
10 | * Internal dependencies.
11 | */
12 | import BaseControl from '../../assets/components/base-control';
13 |
14 | /**
15 | * Control render in editor.
16 | *
17 | * @param {Object} props - component props.
18 | *
19 | * @return {JSX} - component render.
20 | */
21 | function ComponentRender(props) {
22 | const { data } = props;
23 | const innerBlocksProps = useInnerBlocksProps({
24 | className: 'lazyblock-inner-blocks',
25 | });
26 |
27 | let result =
;
28 |
29 | // Show label in BaseControl if needed.
30 | if (data.label) {
31 | result = (
32 |
33 | {result}
34 |
35 | );
36 | }
37 |
38 | return result;
39 | }
40 |
41 | addFilter(
42 | 'lzb.editor.control.inner_blocks.render',
43 | 'lzb.editor',
44 | (render, props) => {
45 | return ;
46 | }
47 | );
48 |
49 | /**
50 | * Control settings render in block builder.
51 | */
52 | addFilter(
53 | 'lzb.constructor.control.inner_blocks.settings',
54 | 'lzb.constructor',
55 | () => {
56 | return (
57 | <>
58 |
59 |
64 |
65 | {__(
66 | 'The Inner Blocks control deprecated since v3.4.0, you should migrate to the component as this control will be removed in future plugin updates.',
67 | 'lazy-blocks'
68 | )}
69 |
70 |
75 | {__('Read More', 'lazy-blocks')}
76 |
77 |
78 |
79 | >
80 | );
81 | }
82 | );
83 |
--------------------------------------------------------------------------------
/controls/number/index.php:
--------------------------------------------------------------------------------
1 | name = 'number';
21 | $this->icon = ' ';
22 | $this->type = 'number';
23 | $this->label = __( 'Number', 'lazy-blocks' );
24 | $this->attributes = array(
25 | 'min' => '',
26 | 'max' => '',
27 | 'step' => '',
28 | 'placeholder' => '',
29 | );
30 |
31 | parent::__construct();
32 | }
33 |
34 | /**
35 | * Register assets action.
36 | */
37 | public function register_assets() {
38 | LazyBlocks_Assets::register_script( 'lazyblocks-control-number', 'build/control-number' );
39 | }
40 |
41 | /**
42 | * Get script dependencies.
43 | *
44 | * @return array script dependencies.
45 | */
46 | public function get_script_depends() {
47 | return array( 'lazyblocks-control-number' );
48 | }
49 | }
50 |
51 | new LazyBlocks_Control_Number();
52 |
--------------------------------------------------------------------------------
/controls/password/index.php:
--------------------------------------------------------------------------------
1 | name = 'password';
21 | $this->icon = ' ';
22 | $this->type = 'string';
23 | $this->label = __( 'Password', 'lazy-blocks' );
24 | $this->attributes = array(
25 | 'placeholder' => '',
26 | 'characters_limit' => '',
27 | );
28 |
29 | parent::__construct();
30 | }
31 |
32 | /**
33 | * Register assets action.
34 | */
35 | public function register_assets() {
36 | LazyBlocks_Assets::register_script( 'lazyblocks-control-password', 'build/control-password' );
37 | }
38 |
39 | /**
40 | * Get script dependencies.
41 | *
42 | * @return array script dependencies.
43 | */
44 | public function get_script_depends() {
45 | return array( 'lazyblocks-control-password' );
46 | }
47 | }
48 |
49 | new LazyBlocks_Control_Password();
50 |
--------------------------------------------------------------------------------
/controls/range/index.php:
--------------------------------------------------------------------------------
1 | name = 'range';
21 | $this->icon = ' ';
22 | $this->type = 'number';
23 | $this->label = __( 'Range', 'lazy-blocks' );
24 | $this->attributes = array(
25 | 'min' => '',
26 | 'max' => '',
27 | 'step' => '',
28 | );
29 |
30 | parent::__construct();
31 | }
32 |
33 | /**
34 | * Register assets action.
35 | */
36 | public function register_assets() {
37 | LazyBlocks_Assets::register_script( 'lazyblocks-control-range', 'build/control-range' );
38 | }
39 |
40 | /**
41 | * Get script dependencies.
42 | *
43 | * @return array script dependencies.
44 | */
45 | public function get_script_depends() {
46 | return array( 'lazyblocks-control-range' );
47 | }
48 | }
49 |
50 | new LazyBlocks_Control_Range();
51 |
--------------------------------------------------------------------------------
/controls/rich_text/index.php:
--------------------------------------------------------------------------------
1 | name = 'rich_text';
21 | $this->icon = ' ';
22 | $this->type = 'string';
23 | $this->label = __( 'Rich Text (WYSIWYG)', 'lazy-blocks' );
24 | $this->category = 'content';
25 | $this->restrictions = array(
26 | 'translate_settings' => true,
27 | );
28 |
29 | parent::__construct();
30 | }
31 |
32 | /**
33 | * Register assets action.
34 | */
35 | public function register_assets() {
36 | LazyBlocks_Assets::register_script( 'lazyblocks-control-rich-text', 'build/control-rich-text' );
37 | }
38 |
39 | /**
40 | * Get script dependencies.
41 | *
42 | * @return array script dependencies.
43 | */
44 | public function get_script_depends() {
45 | return array( 'lazyblocks-control-rich-text' );
46 | }
47 | }
48 |
49 | new LazyBlocks_Control_RichText();
50 |
--------------------------------------------------------------------------------
/controls/rich_text/script.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { addFilter } from '@wordpress/hooks';
5 | import { RichText } from '@wordpress/block-editor';
6 |
7 | /**
8 | * Internal dependencies.
9 | */
10 | import BaseControl from '../../assets/components/base-control';
11 | import useBlockControlProps from '../../assets/hooks/use-block-control-props';
12 |
13 | /**
14 | * Control render in editor.
15 | */
16 | addFilter(
17 | 'lzb.editor.control.rich_text.render',
18 | 'lzb.editor',
19 | (render, props) => (
20 |
21 | {
26 | props.onChange(val);
27 | }}
28 | />
29 |
30 | )
31 | );
32 |
--------------------------------------------------------------------------------
/controls/text/index.php:
--------------------------------------------------------------------------------
1 | name = 'text';
21 | $this->icon = ' ';
22 | $this->type = 'string';
23 | $this->label = __( 'Text', 'lazy-blocks' );
24 | $this->attributes = array(
25 | 'placeholder' => '',
26 | 'characters_limit' => '',
27 | );
28 | $this->restrictions = array(
29 | 'translate_settings' => true,
30 | );
31 |
32 | parent::__construct();
33 | }
34 |
35 | /**
36 | * Register assets action.
37 | */
38 | public function register_assets() {
39 | LazyBlocks_Assets::register_script( 'lazyblocks-control-text', 'build/control-text' );
40 | }
41 |
42 | /**
43 | * Get script dependencies.
44 | *
45 | * @return array script dependencies.
46 | */
47 | public function get_script_depends() {
48 | return array( 'lazyblocks-control-text' );
49 | }
50 | }
51 |
52 | new LazyBlocks_Control_Text();
53 |
--------------------------------------------------------------------------------
/controls/textarea/index.php:
--------------------------------------------------------------------------------
1 | name = 'textarea';
21 | $this->icon = ' ';
22 | $this->type = 'string';
23 | $this->label = __( 'Text Area', 'lazy-blocks' );
24 | $this->attributes = array(
25 | 'placeholder' => '',
26 | 'characters_limit' => '',
27 | );
28 | $this->restrictions = array(
29 | 'translate_settings' => true,
30 | );
31 |
32 | parent::__construct();
33 | }
34 |
35 | /**
36 | * Register assets action.
37 | */
38 | public function register_assets() {
39 | LazyBlocks_Assets::register_script( 'lazyblocks-control-textarea', 'build/control-textarea' );
40 | }
41 |
42 | /**
43 | * Get script dependencies.
44 | *
45 | * @return array script dependencies.
46 | */
47 | public function get_script_depends() {
48 | return array( 'lazyblocks-control-textarea' );
49 | }
50 | }
51 |
52 | new LazyBlocks_Control_TextArea();
53 |
--------------------------------------------------------------------------------
/controls/toggle/script.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { __ } from '@wordpress/i18n';
5 | import { addFilter } from '@wordpress/hooks';
6 | import { PanelBody, TextControl, ToggleControl } from '@wordpress/components';
7 |
8 | /**
9 | * Internal dependencies.
10 | */
11 | import BaseControl from '../../assets/components/base-control';
12 | import useBlockControlProps from '../../assets/hooks/use-block-control-props';
13 |
14 | /**
15 | * Control render in editor.
16 | */
17 | addFilter('lzb.editor.control.toggle.render', 'lzb.editor', (render, props) => (
18 |
19 |
25 |
26 | ));
27 |
28 | /**
29 | * Control settings render in block builder.
30 | */
31 | addFilter(
32 | 'lzb.constructor.control.toggle.settings',
33 | 'lzb.constructor',
34 | (render, props) => {
35 | const { updateData, data } = props;
36 |
37 | return (
38 | <>
39 |
40 |
48 | updateData({ alongside_text: value })
49 | }
50 | __next40pxDefaultSize
51 | __nextHasNoMarginBottom
52 | />
53 |
54 |
55 |
59 |
64 | updateData({
65 | checked: value ? 'true' : 'false',
66 | })
67 | }
68 | __nextHasNoMarginBottom
69 | />
70 |
71 |
72 | >
73 | );
74 | }
75 | );
76 |
--------------------------------------------------------------------------------
/controls/undefined/script.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { __ } from '@wordpress/i18n';
5 | import { addFilter } from '@wordpress/hooks';
6 | import { PanelBody } from '@wordpress/components';
7 |
8 | /**
9 | * Internal dependencies.
10 | */
11 | import BaseControl from '../../assets/components/base-control';
12 | import useBlockControlProps from '../../assets/hooks/use-block-control-props';
13 |
14 | /**
15 | * Control render in editor.
16 | */
17 | addFilter(
18 | 'lzb.editor.control.undefined.render',
19 | 'lzb.editor',
20 | (render, props) => {
21 | return (
22 |
25 | {__('Looks like this control does not exists.', 'lazy-blocks')}
26 |
27 | );
28 | }
29 | );
30 |
31 | /**
32 | * Control settings render in block builder.
33 | */
34 | addFilter(
35 | 'lzb.constructor.control.undefined.settings',
36 | 'lzb.constructor',
37 | () => {
38 | return (
39 |
40 | {__('Looks like this control does not exists.', 'lazy-blocks')}
41 |
42 | );
43 | }
44 | );
45 |
--------------------------------------------------------------------------------
/controls/url/index.php:
--------------------------------------------------------------------------------
1 | name = 'url';
21 | $this->icon = ' ';
22 | $this->type = 'string';
23 | $this->label = __( 'URL', 'lazy-blocks' );
24 | $this->restrictions = array(
25 | 'placement_settings' => array( 'content-fallback', 'inspector' ),
26 | 'translate_settings' => true,
27 | );
28 |
29 | parent::__construct();
30 | }
31 |
32 | /**
33 | * Register assets action.
34 | */
35 | public function register_assets() {
36 | LazyBlocks_Assets::register_script( 'lazyblocks-control-url', 'build/control-url' );
37 | }
38 |
39 | /**
40 | * Get script dependencies.
41 | *
42 | * @return array script dependencies.
43 | */
44 | public function get_script_depends() {
45 | return array( 'lazyblocks-control-url' );
46 | }
47 | }
48 |
49 | new LazyBlocks_Control_URL();
50 |
--------------------------------------------------------------------------------
/controls/url/script.js:
--------------------------------------------------------------------------------
1 | /**
2 | * External dependencies.
3 | */
4 | import shorthash from 'shorthash';
5 |
6 | /**
7 | * WordPress dependencies.
8 | */
9 | import { useState } from '@wordpress/element';
10 | import { addFilter } from '@wordpress/hooks';
11 | import { __experimentalLinkControl as LinkControl } from '@wordpress/block-editor';
12 |
13 | /**
14 | * Internal dependencies.
15 | */
16 | import BaseControl from '../../assets/components/base-control';
17 | import useBlockControlProps from '../../assets/hooks/use-block-control-props';
18 |
19 | function ComponentRender(props) {
20 | const [key, setKey] = useState(shorthash.unique(`${new Date()}`));
21 |
22 | return (
23 |
24 | {
32 | props.onChange(newURL);
33 | }}
34 | onRemove={() => {
35 | props.onChange('');
36 | setKey(shorthash.unique(`${new Date()}`));
37 | }}
38 | />
39 |
40 | );
41 | }
42 |
43 | /**
44 | * Control render in editor.
45 | */
46 | addFilter('lzb.editor.control.url.render', 'lzb.editor', (render, props) => (
47 |
48 | ));
49 |
50 | /**
51 | * Required check.
52 | * Just check for empty value. Previously we used advanced URL validation, but we can't restrict values like '#' or 'relative-url-string'.
53 | *
54 | * @param {Object} validationData
55 | * @param {number} value
56 | *
57 | * @return {Object} validation data.
58 | */
59 | function validate(validationData, value) {
60 | if (!value) {
61 | return { valid: false };
62 | }
63 |
64 | return validationData;
65 | }
66 | addFilter('lzb.editor.control.url.validate', 'lzb.editor', validate);
67 |
--------------------------------------------------------------------------------
/index.php:
--------------------------------------------------------------------------------
1 | {
6 | const files = micromatch(filenames, [
7 | '!**/.*',
8 | '!**/vendor/**/*',
9 | '!**/build/**/*',
10 | '!**/dist/**/*',
11 | ]);
12 |
13 | if (files && files.length) {
14 | return `${lint} ${files.join(' ')}`;
15 | }
16 |
17 | return [];
18 | };
19 | }
20 |
21 | module.exports = {
22 | '**/*.php': excludeVendor('composer run-script lint'),
23 | '**/*.{css,scss}': excludeVendor('wp-scripts lint-style'),
24 | '**/*.{js,jsx}': excludeVendor('wp-scripts lint-js'),
25 | };
26 |
--------------------------------------------------------------------------------
/phpunit.xml.dist:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 | ./tests/phpunit/
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/templates/template-not-found.php:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 | %1$s not found.', 'lazy-blocks' ),
20 | 'blocks/' . $template_name . '/block.php'
21 | )
22 | );
23 | ?>
24 |
25 |
--------------------------------------------------------------------------------
/tests/e2e/config/global-setup.js:
--------------------------------------------------------------------------------
1 | /**
2 | * External dependencies
3 | */
4 | // eslint-disable-next-line import/no-extraneous-dependencies
5 | import { request } from '@playwright/test';
6 |
7 | /**
8 | * WordPress dependencies
9 | */
10 | import { RequestUtils } from '@wordpress/e2e-test-utils-playwright';
11 |
12 | async function globalSetup(config) {
13 | const { storageState, baseURL } = config.projects[0].use;
14 | const storageStatePath =
15 | typeof storageState === 'string' ? storageState : undefined;
16 |
17 | const requestContext = await request.newContext({
18 | baseURL,
19 | });
20 |
21 | const requestUtils = new RequestUtils(requestContext, {
22 | storageStatePath,
23 | });
24 |
25 | // Authenticate and save the storageState to disk.
26 | await requestUtils.setupRest();
27 |
28 | // Reset the test environment before running the tests.
29 | await Promise.all([
30 | requestUtils.activateTheme('empty-theme'),
31 | // Disable this test plugin as it's conflicting with some of the tests.
32 | // We already have reduced motion enabled and Playwright will wait for most of the animations anyway.
33 | requestUtils.deactivatePlugin(
34 | 'gutenberg-test-plugin-disables-the-css-animations'
35 | ),
36 | requestUtils.deleteAllPosts(),
37 | requestUtils.deleteAllBlocks(),
38 | requestUtils.resetPreferences(),
39 | ]);
40 |
41 | await requestContext.dispose();
42 | }
43 |
44 | export default globalSetup;
45 |
--------------------------------------------------------------------------------
/tests/e2e/specs/block-builder-create-block.spec.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies
3 | */
4 | import { test, expect } from '@wordpress/e2e-test-utils-playwright';
5 | import { removeAllBlocks } from '../utils/remove-all-blocks';
6 |
7 | test.describe('block builder create block', () => {
8 | test.afterEach(async ({ requestUtils }) => {
9 | await removeAllBlocks({ requestUtils });
10 | });
11 |
12 | test('make sure editor API is available in block builder UI', async ({
13 | page,
14 | admin,
15 | }) => {
16 | // We should add this API always even when no blocks available.
17 | // It is used in the Pro plugin controls.
18 | await admin.visitAdminPage('post-new.php?post_type=lazyblocks');
19 |
20 | const apiAvailable = await page.evaluate(async () => {
21 | return !!wp.data.select('lazy-blocks/components');
22 | });
23 |
24 | await expect(apiAvailable).toEqual(true);
25 | });
26 |
27 | test('create block manually in block builder UI', async ({
28 | page,
29 | editor,
30 | admin,
31 | }) => {
32 | await admin.createNewPost({
33 | postType: 'lazyblocks',
34 | title: '',
35 | status: 'publish',
36 | });
37 |
38 | await editor.canvas.getByRole('button', { name: 'Continue' }).click();
39 |
40 | await editor.canvas
41 | .getByLabel('Title', { exact: true })
42 | .fill('Test Block');
43 |
44 | await editor.canvas.getByRole('button', { name: 'Continue' }).click();
45 |
46 | await editor.canvas.getByRole('button', { name: 'Finish' }).click();
47 |
48 | // Publish post.
49 | await page.locator('role=button[name="Publish"i]').click();
50 | await page
51 | .locator('role=region[name="Editor publish"]')
52 | .locator('role=button[name="Publish"i]')
53 | .click();
54 |
55 | await expect(page.locator('role=button[name="Save"i]')).toBeDisabled();
56 |
57 | let postID = await page.locator('input[name="post_ID"]').inputValue();
58 | postID = typeof postID === 'string' ? parseInt(postID, 10) : null;
59 |
60 | // Check for this block in the lazyblocks posts list admin.
61 | await admin.visitAdminPage('edit.php?post_type=lazyblocks');
62 |
63 | await expect(page.locator(`#post-${postID}`)).toBeVisible();
64 | });
65 | });
66 |
--------------------------------------------------------------------------------
/tests/e2e/specs/initial-loading.spec.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies
3 | */
4 | import { test, expect } from '@wordpress/e2e-test-utils-playwright';
5 |
6 | test.describe('initial loading', () => {
7 | test('should have lazy blocks in admin menu', async ({ page, admin }) => {
8 | await admin.visitAdminPage('index.php');
9 |
10 | await expect(page.locator('#menu-posts-lazyblocks')).toBeVisible();
11 | });
12 |
13 | test('should have example block added', async ({ page, admin }) => {
14 | await admin.visitAdminPage('edit.php?post_type=lazyblocks');
15 |
16 | await expect(page.locator('a:has-text("Example Block")')).toBeVisible();
17 | });
18 | });
19 |
--------------------------------------------------------------------------------
/tests/e2e/utils/create-block.js:
--------------------------------------------------------------------------------
1 | export async function createBlock({
2 | requestUtils,
3 | title,
4 | slug,
5 | description,
6 | code,
7 | codeSingleOutput,
8 | }) {
9 | const block = await requestUtils.rest({
10 | path: '/wp/v2/lazyblocks',
11 | method: 'POST',
12 | data: {
13 | status: 'publish',
14 | slug,
15 | title,
16 | },
17 | });
18 |
19 | const blockID =
20 | typeof block.id !== 'undefined' ? parseInt(block.id, 10) : null;
21 |
22 | // Add meta.
23 | await requestUtils.rest({
24 | path: '/lazy-blocks/v1/update-block-data',
25 | method: 'POST',
26 | data: {
27 | post_id: blockID,
28 | data: {
29 | slug,
30 | description: description || '',
31 | code_single_output: codeSingleOutput ? 'true' : 'false',
32 | code_frontend_html: code || '',
33 | },
34 | },
35 | });
36 |
37 | return blockID;
38 | }
39 |
--------------------------------------------------------------------------------
/tests/e2e/utils/create-control.js:
--------------------------------------------------------------------------------
1 | export async function createControl({
2 | editor,
3 | page,
4 | type,
5 | label,
6 | options,
7 | checked,
8 | placement = 'inspector',
9 | isChild = false,
10 | }) {
11 | // Create and select control.
12 | if (isChild) {
13 | await editor.canvas
14 | .locator('.lzb-block-builder-controls-item-appender')
15 | .first()
16 | .click();
17 | } else {
18 | await editor.canvas.getByLabel('Add Control').click();
19 | }
20 |
21 | await editor.canvas.getByText('(no label)').click();
22 |
23 | // Select type.
24 | await page.getByLabel('Type').click();
25 |
26 | await page.getByPlaceholder('Type to Search…').fill(type);
27 |
28 | await page.getByRole('button', { name: type, exact: true }).click();
29 |
30 | // Set label
31 | await page.getByPlaceholder('(no label)').fill(label);
32 |
33 | // Set options
34 | if (options && Array.isArray(options)) {
35 | for (let i = 0; i < options.length; i++) {
36 | await page.getByRole('button', { name: '+ Add Choice' }).click();
37 |
38 | await page
39 | .getByPlaceholder('Label')
40 | .nth(i + 1)
41 | .fill(options[i].label);
42 | await page.getByPlaceholder('Value').nth(i).fill(options[i].value);
43 | }
44 | }
45 |
46 | // Set checked
47 | if (checked) {
48 | await page.locator('#lazyblocks-control-checkbox-checked').check();
49 | }
50 |
51 | // Set placement
52 | if (placement === 'content') {
53 | await page
54 | .getByRole('button', { name: 'Content', exact: true })
55 | .click();
56 | await page
57 | .getByRole('button', { name: 'Inspector', exact: true })
58 | .click();
59 | } else if (placement === 'both') {
60 | await page
61 | .getByRole('button', { name: 'Content', exact: true })
62 | .click();
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/tests/e2e/utils/remove-all-blocks.js:
--------------------------------------------------------------------------------
1 | export async function removeAllBlocks({ requestUtils }) {
2 | // List all lazyblocks posts.
3 | const blocks = await requestUtils.rest({
4 | path: '/wp/v2/lazyblocks',
5 | params: {
6 | per_page: 100,
7 | // All possible statuses.
8 | status: 'publish,future,draft,pending,private,trash',
9 | },
10 | });
11 |
12 | // Delete all lazyblocks one by one except the Example Block.
13 | // "/wp/v2/posts" not yet supports batch requests.
14 | await Promise.all(
15 | blocks.map((block) => {
16 | // Skip Example Block.
17 | if (block?.title?.rendered === 'Example Block') {
18 | return null;
19 | }
20 |
21 | return requestUtils.rest({
22 | method: 'DELETE',
23 | path: `/wp/v2/lazyblocks/${block.id}`,
24 | params: {
25 | force: true,
26 | },
27 | });
28 | })
29 | );
30 | }
31 |
--------------------------------------------------------------------------------
/tests/e2e/utils/remove-reusable-blocks.js:
--------------------------------------------------------------------------------
1 | export async function removeReusableBlocks({ requestUtils }) {
2 | // List all `wp_block` posts.
3 | const blocks = await requestUtils.rest({
4 | path: '/wp/v2/blocks',
5 | params: {
6 | per_page: 100,
7 | // All possible statuses.
8 | status: 'publish,future,draft,pending,private,trash',
9 | },
10 | });
11 |
12 | // Delete all `wp_block` one by one.
13 | // "/wp/v2/posts" not yet supports batch requests.
14 | await Promise.all(
15 | blocks.map((block) => {
16 | return requestUtils.rest({
17 | method: 'DELETE',
18 | path: `/wp/v2/blocks/${block.id}`,
19 | params: {
20 | force: true,
21 | },
22 | });
23 | })
24 | );
25 | }
26 |
--------------------------------------------------------------------------------
/tests/plugins/gutenberg-test-plugin-disables-the-css-animations/gutenberg-test-plugin-disables-the-css-animations.php:
--------------------------------------------------------------------------------
1 |
13 |
14 |