@eightshift/frontend-libs-tailwind 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +37 -0
- package/.github/CODEOWNERS +1 -0
- package/.github/CONTRIBUTING.md +17 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +10 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +10 -0
- package/.github/ISSUE_TEMPLATE/question.md +10 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +11 -0
- package/.github/workflows/ci.yml +31 -0
- package/.husky/pre-commit +1 -0
- package/.prettierrc +14 -0
- package/.stylelintrc +4 -0
- package/CHANGELOG.md +13 -0
- package/CODE_OF_CONDUCT.md +76 -0
- package/LICENSE +21 -0
- package/README.md +24 -0
- package/blocks/init/assets/application-admin.js +10 -0
- package/blocks/init/assets/application.js +13 -0
- package/blocks/init/assets/images/index.js +5 -0
- package/blocks/init/assets/scripts/application-admin.js +7 -0
- package/blocks/init/assets/scripts/application.js +3 -0
- package/blocks/init/assets/scripts/theme-colors.js +39 -0
- package/blocks/init/assets/styles/application-admin.css +6 -0
- package/blocks/init/assets/styles/application.css +3 -0
- package/blocks/init/src/Blocks/assets/application-blocks-editor.js +14 -0
- package/blocks/init/src/Blocks/assets/application-blocks-frontend.js +13 -0
- package/blocks/init/src/Blocks/assets/application-blocks.js +9 -0
- package/blocks/init/src/Blocks/assets/scripts/application-blocks-editor.js +65 -0
- package/blocks/init/src/Blocks/assets/scripts/application-blocks-frontend.js +24 -0
- package/blocks/init/src/Blocks/assets/scripts/link-section-editor.js +258 -0
- package/blocks/init/src/Blocks/assets/scripts/shared.js +25 -0
- package/blocks/init/src/Blocks/assets/styles/application-blocks-editor.css +15 -0
- package/blocks/init/src/Blocks/assets/styles/application-blocks-frontend.css +12 -0
- package/blocks/init/src/Blocks/assets/styles/application-blocks.css +0 -0
- package/blocks/init/src/Blocks/assets/styles/editor/editor-overrides.css +15 -0
- package/blocks/init/src/Blocks/assets/styles/tailwind.css +34 -0
- package/blocks/init/src/Blocks/components/admin-theme-options/admin-theme-options.php +20 -0
- package/blocks/init/src/Blocks/components/admin-theme-options/assets-admin/index.js +36 -0
- package/blocks/init/src/Blocks/components/admin-theme-options/assets-admin/pages/parts.js +55 -0
- package/blocks/init/src/Blocks/components/admin-theme-options/manifest.json +5 -0
- package/blocks/init/src/Blocks/components/button/assets/index.js +22 -0
- package/blocks/init/src/Blocks/components/button/button.php +77 -0
- package/blocks/init/src/Blocks/components/button/components/button-editor.js +40 -0
- package/blocks/init/src/Blocks/components/button/components/button-options.js +135 -0
- package/blocks/init/src/Blocks/components/button/manifest.json +299 -0
- package/blocks/init/src/Blocks/components/card/card.php +42 -0
- package/blocks/init/src/Blocks/components/card/components/card-editor.js +39 -0
- package/blocks/init/src/Blocks/components/card/components/card-options.js +56 -0
- package/blocks/init/src/Blocks/components/card/manifest.json +111 -0
- package/blocks/init/src/Blocks/components/head/head.php +52 -0
- package/blocks/init/src/Blocks/components/head/manifest.json +17 -0
- package/blocks/init/src/Blocks/components/heading/components/heading-editor.js +30 -0
- package/blocks/init/src/Blocks/components/heading/components/heading-options.js +62 -0
- package/blocks/init/src/Blocks/components/heading/heading.php +45 -0
- package/blocks/init/src/Blocks/components/heading/manifest.json +76 -0
- package/blocks/init/src/Blocks/components/hero/components/hero-editor.js +42 -0
- package/blocks/init/src/Blocks/components/hero/components/hero-options.js +100 -0
- package/blocks/init/src/Blocks/components/hero/hero.php +45 -0
- package/blocks/init/src/Blocks/components/hero/manifest.json +96 -0
- package/blocks/init/src/Blocks/components/icon/components/icon-editor.js +23 -0
- package/blocks/init/src/Blocks/components/icon/components/icon-options.js +65 -0
- package/blocks/init/src/Blocks/components/icon/icon.php +34 -0
- package/blocks/init/src/Blocks/components/icon/manifest.json +1234 -0
- package/blocks/init/src/Blocks/components/image/components/image-editor.js +65 -0
- package/blocks/init/src/Blocks/components/image/components/image-options.js +111 -0
- package/blocks/init/src/Blocks/components/image/image.php +62 -0
- package/blocks/init/src/Blocks/components/image/manifest.json +125 -0
- package/blocks/init/src/Blocks/components/list/components/list-editor.js +30 -0
- package/blocks/init/src/Blocks/components/list/components/list-options.js +62 -0
- package/blocks/init/src/Blocks/components/list/list.php +32 -0
- package/blocks/init/src/Blocks/components/list/manifest.json +127 -0
- package/blocks/init/src/Blocks/components/load-more/assets/index.js +19 -0
- package/blocks/init/src/Blocks/components/load-more/assets/load-more.js +147 -0
- package/blocks/init/src/Blocks/components/load-more/components/load-more-editor.js +14 -0
- package/blocks/init/src/Blocks/components/load-more/components/load-more-options.js +18 -0
- package/blocks/init/src/Blocks/components/load-more/load-more.php +47 -0
- package/blocks/init/src/Blocks/components/load-more/manifest.json +39 -0
- package/blocks/init/src/Blocks/components/modal/assets/index.js +27 -0
- package/blocks/init/src/Blocks/components/modal/manifest.json +48 -0
- package/blocks/init/src/Blocks/components/modal/modal.php +46 -0
- package/blocks/init/src/Blocks/components/paragraph/components/paragraph-editor.js +40 -0
- package/blocks/init/src/Blocks/components/paragraph/components/paragraph-options.js +48 -0
- package/blocks/init/src/Blocks/components/paragraph/manifest.json +83 -0
- package/blocks/init/src/Blocks/components/paragraph/paragraph.php +33 -0
- package/blocks/init/src/Blocks/components/post-header/manifest.json +5 -0
- package/blocks/init/src/Blocks/components/post-header/post-header.php +24 -0
- package/blocks/init/src/Blocks/components/quote/components/quote-editor.js +53 -0
- package/blocks/init/src/Blocks/components/quote/components/quote-options.js +29 -0
- package/blocks/init/src/Blocks/components/quote/manifest.json +47 -0
- package/blocks/init/src/Blocks/components/quote/quote.php +49 -0
- package/blocks/init/src/Blocks/components/share/assets/index.js +39 -0
- package/blocks/init/src/Blocks/components/share/components/share-editor.js +25 -0
- package/blocks/init/src/Blocks/components/share/components/share-options.js +112 -0
- package/blocks/init/src/Blocks/components/share/manifest.json +72 -0
- package/blocks/init/src/Blocks/components/share/share.php +66 -0
- package/blocks/init/src/Blocks/components/tracking-before-body-end/manifest.json +5 -0
- package/blocks/init/src/Blocks/components/tracking-before-body-end/tracking-before-body-end.php +9 -0
- package/blocks/init/src/Blocks/components/tracking-head/manifest.json +5 -0
- package/blocks/init/src/Blocks/components/tracking-head/tracking-head.php +9 -0
- package/blocks/init/src/Blocks/components/video/components/video-editor.js +74 -0
- package/blocks/init/src/Blocks/components/video/components/video-options.js +280 -0
- package/blocks/init/src/Blocks/components/video/manifest.json +116 -0
- package/blocks/init/src/Blocks/components/video/video.php +72 -0
- package/blocks/init/src/Blocks/custom/accordion/accordion-block.js +15 -0
- package/blocks/init/src/Blocks/custom/accordion/accordion.php +28 -0
- package/blocks/init/src/Blocks/custom/accordion/assets/index.js +37 -0
- package/blocks/init/src/Blocks/custom/accordion/components/accordion-editor.js +17 -0
- package/blocks/init/src/Blocks/custom/accordion/components/accordion-options.js +18 -0
- package/blocks/init/src/Blocks/custom/accordion/manifest.json +32 -0
- package/blocks/init/src/Blocks/custom/accordion-item/accordion-item-block.js +19 -0
- package/blocks/init/src/Blocks/custom/accordion-item/accordion-item.php +46 -0
- package/blocks/init/src/Blocks/custom/accordion-item/components/accordion-item-editor.js +60 -0
- package/blocks/init/src/Blocks/custom/accordion-item/manifest.json +69 -0
- package/blocks/init/src/Blocks/custom/button/button-block.js +13 -0
- package/blocks/init/src/Blocks/custom/button/button.php +11 -0
- package/blocks/init/src/Blocks/custom/button/components/button-editor.js +12 -0
- package/blocks/init/src/Blocks/custom/button/components/button-options.js +12 -0
- package/blocks/init/src/Blocks/custom/button/manifest.json +18 -0
- package/blocks/init/src/Blocks/custom/card/card-block.js +13 -0
- package/blocks/init/src/Blocks/custom/card/card.php +11 -0
- package/blocks/init/src/Blocks/custom/card/components/card-editor.js +12 -0
- package/blocks/init/src/Blocks/custom/card/components/card-options.js +15 -0
- package/blocks/init/src/Blocks/custom/card/manifest.json +18 -0
- package/blocks/init/src/Blocks/custom/carousel/assets/index.js +46 -0
- package/blocks/init/src/Blocks/custom/carousel/assets/navigation.js +31 -0
- package/blocks/init/src/Blocks/custom/carousel/assets/pagination.js +39 -0
- package/blocks/init/src/Blocks/custom/carousel/carousel-block.js +21 -0
- package/blocks/init/src/Blocks/custom/carousel/carousel.php +61 -0
- package/blocks/init/src/Blocks/custom/carousel/components/carousel-editor.js +25 -0
- package/blocks/init/src/Blocks/custom/carousel/components/carousel-options.js +47 -0
- package/blocks/init/src/Blocks/custom/carousel/manifest.json +130 -0
- package/blocks/init/src/Blocks/custom/column/column-block.js +21 -0
- package/blocks/init/src/Blocks/custom/column/column-hooks.js +32 -0
- package/blocks/init/src/Blocks/custom/column/column.php +21 -0
- package/blocks/init/src/Blocks/custom/column/components/column-editor.js +19 -0
- package/blocks/init/src/Blocks/custom/column/components/column-options.js +579 -0
- package/blocks/init/src/Blocks/custom/column/manifest.json +625 -0
- package/blocks/init/src/Blocks/custom/columns/columns-block.js +20 -0
- package/blocks/init/src/Blocks/custom/columns/columns.php +21 -0
- package/blocks/init/src/Blocks/custom/columns/components/columns-editor.js +81 -0
- package/blocks/init/src/Blocks/custom/columns/components/columns-options.js +104 -0
- package/blocks/init/src/Blocks/custom/columns/manifest.json +555 -0
- package/blocks/init/src/Blocks/custom/featured-content/components/featured-content-editor.js +28 -0
- package/blocks/init/src/Blocks/custom/featured-content/components/featured-content-options.js +239 -0
- package/blocks/init/src/Blocks/custom/featured-content/featured-content-block.js +13 -0
- package/blocks/init/src/Blocks/custom/featured-content/featured-content.php +139 -0
- package/blocks/init/src/Blocks/custom/featured-content/manifest.json +131 -0
- package/blocks/init/src/Blocks/custom/featured-content/partials/cards.php +39 -0
- package/blocks/init/src/Blocks/custom/group/components/group-editor.js +8 -0
- package/blocks/init/src/Blocks/custom/group/group-block.js +14 -0
- package/blocks/init/src/Blocks/custom/group/group.php +10 -0
- package/blocks/init/src/Blocks/custom/group/manifest.json +32 -0
- package/blocks/init/src/Blocks/custom/heading/components/heading-editor.js +15 -0
- package/blocks/init/src/Blocks/custom/heading/components/heading-options.js +38 -0
- package/blocks/init/src/Blocks/custom/heading/heading-block.js +13 -0
- package/blocks/init/src/Blocks/custom/heading/heading-transforms.js +25 -0
- package/blocks/init/src/Blocks/custom/heading/heading.php +15 -0
- package/blocks/init/src/Blocks/custom/heading/manifest.json +79 -0
- package/blocks/init/src/Blocks/custom/hero/components/hero-editor.js +12 -0
- package/blocks/init/src/Blocks/custom/hero/components/hero-options.js +14 -0
- package/blocks/init/src/Blocks/custom/hero/hero-block.js +13 -0
- package/blocks/init/src/Blocks/custom/hero/hero.php +11 -0
- package/blocks/init/src/Blocks/custom/hero/manifest.json +17 -0
- package/blocks/init/src/Blocks/custom/image/components/image-editor.js +12 -0
- package/blocks/init/src/Blocks/custom/image/components/image-options.js +14 -0
- package/blocks/init/src/Blocks/custom/image/image-block.js +13 -0
- package/blocks/init/src/Blocks/custom/image/image.php +11 -0
- package/blocks/init/src/Blocks/custom/image/manifest.json +105 -0
- package/blocks/init/src/Blocks/custom/list/components/list-editor.js +14 -0
- package/blocks/init/src/Blocks/custom/list/components/list-options.js +39 -0
- package/blocks/init/src/Blocks/custom/list/list-block.js +13 -0
- package/blocks/init/src/Blocks/custom/list/list.php +15 -0
- package/blocks/init/src/Blocks/custom/list/manifest.json +58 -0
- package/blocks/init/src/Blocks/custom/map/assets/index.js +20 -0
- package/blocks/init/src/Blocks/custom/map/assets/map-controller.js +42 -0
- package/blocks/init/src/Blocks/custom/map/assets/utils.js +161 -0
- package/blocks/init/src/Blocks/custom/map/components/map-components.js +403 -0
- package/blocks/init/src/Blocks/custom/map/components/map-editor.js +56 -0
- package/blocks/init/src/Blocks/custom/map/components/map-options.js +557 -0
- package/blocks/init/src/Blocks/custom/map/manifest.json +79 -0
- package/blocks/init/src/Blocks/custom/map/map-block.js +13 -0
- package/blocks/init/src/Blocks/custom/map/map.php +52 -0
- package/blocks/init/src/Blocks/custom/map/styles.css +2 -0
- package/blocks/init/src/Blocks/custom/modal/components/modal-editor.js +90 -0
- package/blocks/init/src/Blocks/custom/modal/manifest.json +51 -0
- package/blocks/init/src/Blocks/custom/modal/modal-block.js +14 -0
- package/blocks/init/src/Blocks/custom/modal/modal.php +20 -0
- package/blocks/init/src/Blocks/custom/paragraph/components/paragraph-editor.js +41 -0
- package/blocks/init/src/Blocks/custom/paragraph/components/paragraph-options.js +38 -0
- package/blocks/init/src/Blocks/custom/paragraph/manifest.json +79 -0
- package/blocks/init/src/Blocks/custom/paragraph/paragraph-block.js +13 -0
- package/blocks/init/src/Blocks/custom/paragraph/paragraph-transforms.js +45 -0
- package/blocks/init/src/Blocks/custom/paragraph/paragraph.php +15 -0
- package/blocks/init/src/Blocks/custom/quote/components/quote-editor.js +12 -0
- package/blocks/init/src/Blocks/custom/quote/components/quote-options.js +14 -0
- package/blocks/init/src/Blocks/custom/quote/manifest.json +17 -0
- package/blocks/init/src/Blocks/custom/quote/quote-block.js +13 -0
- package/blocks/init/src/Blocks/custom/quote/quote.php +13 -0
- package/blocks/init/src/Blocks/custom/share/components/share-editor.js +6 -0
- package/blocks/init/src/Blocks/custom/share/components/share-options.js +12 -0
- package/blocks/init/src/Blocks/custom/share/manifest.json +19 -0
- package/blocks/init/src/Blocks/custom/share/share-block.js +13 -0
- package/blocks/init/src/Blocks/custom/share/share.php +11 -0
- package/blocks/init/src/Blocks/custom/site-footer/components/site-footer-editor.js +57 -0
- package/blocks/init/src/Blocks/custom/site-footer/components/site-footer-options.js +106 -0
- package/blocks/init/src/Blocks/custom/site-footer/manifest.json +73 -0
- package/blocks/init/src/Blocks/custom/site-footer/site-footer-block.js +13 -0
- package/blocks/init/src/Blocks/custom/site-footer/site-footer.php +72 -0
- package/blocks/init/src/Blocks/custom/site-navigation/assets/index.js +9 -0
- package/blocks/init/src/Blocks/custom/site-navigation/components/site-navigation-editor.js +42 -0
- package/blocks/init/src/Blocks/custom/site-navigation/components/site-navigation-options.js +73 -0
- package/blocks/init/src/Blocks/custom/site-navigation/manifest.json +77 -0
- package/blocks/init/src/Blocks/custom/site-navigation/site-navigation-block.js +13 -0
- package/blocks/init/src/Blocks/custom/site-navigation/site-navigation.php +99 -0
- package/blocks/init/src/Blocks/custom/table-of-contents/assets/index.js +58 -0
- package/blocks/init/src/Blocks/custom/table-of-contents/components/table-of-contents-editor.js +38 -0
- package/blocks/init/src/Blocks/custom/table-of-contents/components/table-of-contents-options.js +32 -0
- package/blocks/init/src/Blocks/custom/table-of-contents/manifest.json +48 -0
- package/blocks/init/src/Blocks/custom/table-of-contents/table-of-contents-block.js +13 -0
- package/blocks/init/src/Blocks/custom/table-of-contents/table-of-contents.php +31 -0
- package/blocks/init/src/Blocks/custom/video/components/video-editor.js +6 -0
- package/blocks/init/src/Blocks/custom/video/components/video-options.js +12 -0
- package/blocks/init/src/Blocks/custom/video/manifest.json +105 -0
- package/blocks/init/src/Blocks/custom/video/video-block.js +13 -0
- package/blocks/init/src/Blocks/custom/video/video.php +22 -0
- package/blocks/init/src/Blocks/manifest.json +14 -0
- package/blocks/init/src/Blocks/variations/card-simple/manifest.json +17 -0
- package/blocks/init/src/Blocks/wrapper/components/wrapper-editor.js +12 -0
- package/blocks/init/src/Blocks/wrapper/components/wrapper-options.js +348 -0
- package/blocks/init/src/Blocks/wrapper/manifest.json +450 -0
- package/blocks/init/src/Blocks/wrapper/styles-editor.css +13 -0
- package/blocks/init/src/Blocks/wrapper/styles.css +19 -0
- package/blocks/init/src/Blocks/wrapper/wrapper.js +30 -0
- package/blocks/init/src/Blocks/wrapper/wrapper.php +34 -0
- package/eslint.config.mjs +3 -0
- package/linters/base.config.mjs +81 -0
- package/linters/eslint.config.mjs +4 -0
- package/linters/ignore-gitignored.mjs +9 -0
- package/linters/stylelint.config.js +146 -0
- package/package.json +93 -0
- package/readme/packages.md +74 -0
- package/schemas/block.json +302 -0
- package/schemas/component.json +240 -0
- package/schemas/globalManifest.json +73 -0
- package/schemas/variation.json +83 -0
- package/scripts/components/block-inserter.js +70 -0
- package/scripts/components/file-picker.js +243 -0
- package/scripts/components/index.js +6 -0
- package/scripts/components/link-section-editor.js +319 -0
- package/scripts/components/media-picker.js +86 -0
- package/scripts/components/server-side-render.js +37 -0
- package/scripts/components/settings/settings.js +48 -0
- package/scripts/components/settings/use-theme-options.js +52 -0
- package/scripts/editor/attributes.js +304 -0
- package/scripts/editor/colors.js +64 -0
- package/scripts/editor/editor.js +139 -0
- package/scripts/editor/fetch.js +102 -0
- package/scripts/editor/hooks.js +44 -0
- package/scripts/editor/index.js +11 -0
- package/scripts/editor/options.js +152 -0
- package/scripts/editor/registration.js +901 -0
- package/scripts/editor/store.js +213 -0
- package/scripts/editor/tailwindcss.js +224 -0
- package/scripts/editor/utility.js +47 -0
- package/scripts/helpers/breakpoints.js +48 -0
- package/scripts/helpers/cookies.js +65 -0
- package/scripts/helpers/dynamic-import.js +19 -0
- package/scripts/helpers/index.js +11 -0
- package/scripts/index.js +22 -0
- package/scripts/plugins/index.js +3 -0
- package/scripts/plugins/yoast-seo.js +70 -0
- package/webpack/base.mjs +138 -0
- package/webpack/helpers.mjs +67 -0
- package/webpack/index.mjs +52 -0
- package/webpack/production.mjs +60 -0
- package/webpack/project.mjs +55 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "JSON schema for Eightshift components",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"$schema": {
|
|
7
|
+
"type": "string"
|
|
8
|
+
},
|
|
9
|
+
"componentName": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"pattern": "^[^\/][a-z0-9-]*$",
|
|
12
|
+
"description": "Unique identifier for the component."
|
|
13
|
+
},
|
|
14
|
+
"title": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "User-facing name of the component."
|
|
17
|
+
},
|
|
18
|
+
"description": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"description": "A short description of the component."
|
|
21
|
+
},
|
|
22
|
+
"attributes": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"description": "Source of truth for data used within the component. Check https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/ for more details.",
|
|
25
|
+
"patternProperties": {
|
|
26
|
+
"[a-zA-Z]": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"properties": {
|
|
29
|
+
"type": {
|
|
30
|
+
"description": "The type indicates the type of data that is stored by the attribute. It does not indicate where the data is stored, which is defined by the source field.\n\nA type is required, unless an enum is provided. A type can be used with an enum.\n\nNote that the validity of an object is determined by your source. For an example, see the query details below.",
|
|
31
|
+
"oneOf": [
|
|
32
|
+
{
|
|
33
|
+
"type": "string",
|
|
34
|
+
"enum": [
|
|
35
|
+
"null",
|
|
36
|
+
"boolean",
|
|
37
|
+
"object",
|
|
38
|
+
"array",
|
|
39
|
+
"string",
|
|
40
|
+
"integer",
|
|
41
|
+
"number"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"type": "array",
|
|
46
|
+
"uniqueItems": true,
|
|
47
|
+
"items": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"enum": [
|
|
50
|
+
"null",
|
|
51
|
+
"boolean",
|
|
52
|
+
"object",
|
|
53
|
+
"array",
|
|
54
|
+
"string",
|
|
55
|
+
"integer",
|
|
56
|
+
"number"
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"enum": {
|
|
63
|
+
"type": "array",
|
|
64
|
+
"description": "An attribute can be defined as one of a fixed set of values. This is specified by an enum, which contains an array of allowed values:",
|
|
65
|
+
"items": {
|
|
66
|
+
"oneOf": [
|
|
67
|
+
{
|
|
68
|
+
"type": "boolean"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"type": "number"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"type": "string"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"source": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"description": "Attribute sources are used to define how the attribute values are extracted from saved post content. They provide a mechanism to map from the saved markup to a JavaScript representation of a block.",
|
|
82
|
+
"enum": [
|
|
83
|
+
"attribute"
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
"attribute": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "Use an attribute source to extract the value from an attribute in the markup. The attribute is specified by the attribute field, which must be supplied.\n\nExample: Extract the src attribute from an image found in the block's markup."
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"required": [
|
|
92
|
+
"type"
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"additionalProperties": false
|
|
97
|
+
},
|
|
98
|
+
"example": {
|
|
99
|
+
"type": "object",
|
|
100
|
+
"description": "Sample data to showcase the component.",
|
|
101
|
+
"properties": {
|
|
102
|
+
"attributes": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"description": "Set the attribues for the block example"
|
|
105
|
+
},
|
|
106
|
+
"innerBlocks": {
|
|
107
|
+
"type": "array",
|
|
108
|
+
"description": "Set the inner blocks that should be used within the block example. The blocks should be defined as a nested array like this: \n\n [ [ 'core/heading', { content: 'This is an Example' }, [] ] ]\n\n Where each block itself is an array that contains the block name, the block attributes, and the blocks inner blocks."
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"components": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"description": "Defines components included in this component. Component attributes can be used with the 'props' function. Check https://eightshift.com/docs/basics/blocks-component-in-block/ for more info."
|
|
115
|
+
},
|
|
116
|
+
"options": {
|
|
117
|
+
"type": "object",
|
|
118
|
+
"description": "Defines common option definitions for attributes. Check https://eightshift.com/docs/basics/blocks-component-in-block/ for more info."
|
|
119
|
+
},
|
|
120
|
+
"tailwind": {
|
|
121
|
+
"type": "object",
|
|
122
|
+
"description": "Defines shared Tailwind configs for the component. 'base' sets the base classes for the main part of the component. The base is augmented by 'options' and 'combinations', if set. 'parts' can be used for static/supporting parts of the component.",
|
|
123
|
+
"properties": {
|
|
124
|
+
"base": {
|
|
125
|
+
"type": "object",
|
|
126
|
+
"description": "Base classes for the main part of the component.",
|
|
127
|
+
"properties": {
|
|
128
|
+
"twClasses": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"description": "Classnames to apply."
|
|
131
|
+
},
|
|
132
|
+
"twClassesEditor": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"description": "Editor-specific classnames to apply. Overrides 'twClasses'"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"minProperties": 1
|
|
138
|
+
},
|
|
139
|
+
"options": {
|
|
140
|
+
"type": "object",
|
|
141
|
+
"description": "Per-attribute classes, added to the base class. Key represents the attribute name.",
|
|
142
|
+
"additionalProperties": {
|
|
143
|
+
"$ref": "#/$defs/twOptionsEntry"
|
|
144
|
+
},
|
|
145
|
+
"minProperties": 1
|
|
146
|
+
},
|
|
147
|
+
"parts": {
|
|
148
|
+
"type": "object",
|
|
149
|
+
"description": "Stand-alone parts of the component, not affected by 'options' or 'combinations'. Key represents the part name.",
|
|
150
|
+
"additionalProperties": {
|
|
151
|
+
"$ref": "#/$defs/twPartEntry"
|
|
152
|
+
},
|
|
153
|
+
"minProperties": 1
|
|
154
|
+
},
|
|
155
|
+
"combinations": {
|
|
156
|
+
"type": "array",
|
|
157
|
+
"description": "Conditionally applied classes, depending on the set attribute values. Added to the base class.",
|
|
158
|
+
"items": {
|
|
159
|
+
"type": "object",
|
|
160
|
+
"properties": {
|
|
161
|
+
"attributes": {
|
|
162
|
+
"type": "object",
|
|
163
|
+
"description": "Attributes to check for the condition. Key is the attribute name, value is the attribute value (or an array of possible values) to check for.",
|
|
164
|
+
"patternProperties": {
|
|
165
|
+
"[a-zA-Z]": {
|
|
166
|
+
"anyOf": [
|
|
167
|
+
{
|
|
168
|
+
"type": "string",
|
|
169
|
+
"minLength": 1
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"type": "array",
|
|
173
|
+
"items": {
|
|
174
|
+
"type": "string",
|
|
175
|
+
"minLength": 1
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"twClasses": {
|
|
183
|
+
"type": "string",
|
|
184
|
+
"description": "Classnames to apply if all conditions match. Key is the attribute value, value is the classnames to apply."
|
|
185
|
+
},
|
|
186
|
+
"twClassesEditor": {
|
|
187
|
+
"type": "string",
|
|
188
|
+
"description": "Editor-specific classnames to apply if all conditions match. Overrides 'twClasses'. Key is the attribute value, value is the classnames to apply."
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"required": [
|
|
192
|
+
"attributes",
|
|
193
|
+
"twClasses"
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
"minLength": 1
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"minProperties": 1
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"required": [
|
|
203
|
+
"componentName",
|
|
204
|
+
"title"
|
|
205
|
+
],
|
|
206
|
+
"$defs": {
|
|
207
|
+
"twPartEntry": {
|
|
208
|
+
"type": "object",
|
|
209
|
+
"properties": {
|
|
210
|
+
"twClasses": {
|
|
211
|
+
"type": "string",
|
|
212
|
+
"description": "Classnames to apply."
|
|
213
|
+
},
|
|
214
|
+
"twClassesEditor": {
|
|
215
|
+
"type": "string",
|
|
216
|
+
"description": "Editor-specific classnames to apply. Overrides 'twClasses'."
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"twOptionsEntry": {
|
|
221
|
+
"type": "object",
|
|
222
|
+
"properties": {
|
|
223
|
+
"twClasses": {
|
|
224
|
+
"type": "object",
|
|
225
|
+
"description": "Classnames to apply. Key is the attribute value, value is the classnames to apply.",
|
|
226
|
+
"additionalProperties": {
|
|
227
|
+
"type": "string"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"twClassesEditor": {
|
|
231
|
+
"type": "object",
|
|
232
|
+
"description": "Editor-specific classnames to apply. Overrides 'twClasses'. Key is the attribute value, value is the classnames to apply.",
|
|
233
|
+
"additionalProperties": {
|
|
234
|
+
"type": "string"
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "JSON schema for Eightshift global manifest",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"$schema": {
|
|
7
|
+
"type": "string"
|
|
8
|
+
},
|
|
9
|
+
"namespace": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"pattern": "^[^\/][a-z0-9-]*$",
|
|
12
|
+
"description": "Unique string that groups all the blocks from the project. When combined with a block name, represents the fully qualified block name, e.g. 'eightshift-boilerplate/button'."
|
|
13
|
+
},
|
|
14
|
+
"background": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"pattern": "^#(?:[0-9a-fA-F]{3,4}){1,2}$",
|
|
17
|
+
"description": "Block icon background color. Can be overriden per-block."
|
|
18
|
+
},
|
|
19
|
+
"foreground": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"pattern": "^#(?:[0-9a-fA-F]{3,4}){1,2}$",
|
|
22
|
+
"description": "Block icon color. Can be overriden per-block."
|
|
23
|
+
},
|
|
24
|
+
"config": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"description": "Feature flags for core Frontend libs features.",
|
|
27
|
+
"properties": {
|
|
28
|
+
"useWrapper": {
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"description": "Set to 'false' to disable wrapper.",
|
|
31
|
+
"default": true
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"globalVariables": {
|
|
36
|
+
"type": "object",
|
|
37
|
+
"description": "Project-specific configuration options.",
|
|
38
|
+
"properties": {
|
|
39
|
+
"breakpoints": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"description": "Breakpoints to use. Value should be in 'rem'!",
|
|
42
|
+
"properties": {
|
|
43
|
+
"mobile": {
|
|
44
|
+
"type": "integer",
|
|
45
|
+
"description": "Breakpoint value for mobile size."
|
|
46
|
+
},
|
|
47
|
+
"tablet": {
|
|
48
|
+
"type": "integer",
|
|
49
|
+
"description": "Breakpoint value for tablet size."
|
|
50
|
+
},
|
|
51
|
+
"desktop": {
|
|
52
|
+
"type": "integer",
|
|
53
|
+
"description": "Breakpoint value for desktop size."
|
|
54
|
+
},
|
|
55
|
+
"large": {
|
|
56
|
+
"type": "integer",
|
|
57
|
+
"description": "Breakpoint value for large size."
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"required": [
|
|
63
|
+
"breakpoints"
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"required": [
|
|
68
|
+
"namespace",
|
|
69
|
+
"background",
|
|
70
|
+
"foreground",
|
|
71
|
+
"globalVariables"
|
|
72
|
+
]
|
|
73
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "JSON schema for Eightshift block variations",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"$schema": {
|
|
7
|
+
"type": "string"
|
|
8
|
+
},
|
|
9
|
+
"active": {
|
|
10
|
+
"type": "boolean",
|
|
11
|
+
"description": "Set to 'false' if you don't want the variation to be registered.",
|
|
12
|
+
"default": true
|
|
13
|
+
},
|
|
14
|
+
"parentName": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"pattern": "^[^\/][a-z0-9-]*$",
|
|
17
|
+
"description": "Fully qualified block name of the block this is a varation of."
|
|
18
|
+
},
|
|
19
|
+
"name": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"pattern": "^[^\/][a-z0-9-]*$",
|
|
22
|
+
"description": "Unique identifier of the variation."
|
|
23
|
+
},
|
|
24
|
+
"title": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "Display mame of the variation, shown in the Inserter, Sidebar, ..."
|
|
27
|
+
},
|
|
28
|
+
"icon": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"description": "Icon to identify the variation, shown in various places within the Block editor.",
|
|
31
|
+
"properties": {
|
|
32
|
+
"background": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "Variation icon background color. If not set, value from Global manifest is used."
|
|
35
|
+
},
|
|
36
|
+
"foreground": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "Variation icon color. If not set, value from Global manifest is used."
|
|
39
|
+
},
|
|
40
|
+
"src": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"description": "Icon source, can be either Eightshift icons ('es-' prefix), SVG strings, or Dashicon name."
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"additionalProperties": false
|
|
46
|
+
},
|
|
47
|
+
"description": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"description": "A short description of the variation, shown in a couple of places in the Block editor, e.g. options sidebar."
|
|
50
|
+
},
|
|
51
|
+
"attributes": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"description": "Attributes to set for the block variation. These attributes are merged with the parent block attributes. If the attribute is already set in the parent block, the value from the parent block is used."
|
|
54
|
+
},
|
|
55
|
+
"innerBlocks": {
|
|
56
|
+
"type": "array",
|
|
57
|
+
"description": "Inner blocks to include."
|
|
58
|
+
},
|
|
59
|
+
"example": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"description": "Data for the variation preview, shown in the Inserter when hovering over variation names.",
|
|
62
|
+
"properties": {
|
|
63
|
+
"attributes": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"description": "Preview attributes."
|
|
66
|
+
},
|
|
67
|
+
"innerBlocks": {
|
|
68
|
+
"type": "array",
|
|
69
|
+
"description": "Preview inner blocks. Should be defined as a nested array that contains the block name, attributes object, and optionally inner blocks, e.g.: \n\n [ [ 'core/heading', { content: 'This is an Example' }, [] ] ]"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"scope": {
|
|
74
|
+
"type": "array",
|
|
75
|
+
"description": "Scope where the variations is shown."
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"required": [
|
|
79
|
+
"parentName",
|
|
80
|
+
"name",
|
|
81
|
+
"title"
|
|
82
|
+
]
|
|
83
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
3
|
+
import { Inserter } from '@wordpress/block-editor';
|
|
4
|
+
import { Button } from '@eightshift/ui-components';
|
|
5
|
+
import { icons } from '@eightshift/ui-components/icons';
|
|
6
|
+
import { clsx } from '@eightshift/ui-components/utilities';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A replacement for the default Gutenberg inserter, whose styling can vary between WP versions.
|
|
10
|
+
*
|
|
11
|
+
* @component
|
|
12
|
+
* @param {Object} props - Component props.
|
|
13
|
+
* @param {string} props.clientId - Client ID of the block in which the inserter belongs.
|
|
14
|
+
* @param {boolean|string|JSX.Element} [props.label] - Label of the inserter.
|
|
15
|
+
* @param {boolean} [props.small] - If `true`, the button's size is reduced, perfect for added visual separation in hierarchical InnerBlocks.
|
|
16
|
+
* @param {string} [props.className] - Additional classes to add to the control base.
|
|
17
|
+
* @param {boolean} [props.prioritizePatterns] - Whether to show patterns before blocks in the inserter.
|
|
18
|
+
*
|
|
19
|
+
* @returns {JSX.Element} The BlockInserter component.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* <InnerBlocks renderAppender={() => <BlockInserter />} />
|
|
23
|
+
*
|
|
24
|
+
* @preserve
|
|
25
|
+
*/
|
|
26
|
+
export const BlockInserter = (props) => {
|
|
27
|
+
const {
|
|
28
|
+
clientId,
|
|
29
|
+
label,
|
|
30
|
+
small = false,
|
|
31
|
+
className,
|
|
32
|
+
prioritizePatterns = false,
|
|
33
|
+
} = props;
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Inserter
|
|
37
|
+
rootClientId={clientId}
|
|
38
|
+
prioritizePatterns={prioritizePatterns}
|
|
39
|
+
__experimentalIsQuick
|
|
40
|
+
isAppender
|
|
41
|
+
isQuick
|
|
42
|
+
renderToggle={(appenderProps) => {
|
|
43
|
+
const {
|
|
44
|
+
onToggle,
|
|
45
|
+
disabled,
|
|
46
|
+
hasSingleBlockType,
|
|
47
|
+
blockTitle,
|
|
48
|
+
} = appenderProps;
|
|
49
|
+
|
|
50
|
+
let labelText = label;
|
|
51
|
+
|
|
52
|
+
if (label === true) {
|
|
53
|
+
labelText = sprintf(__('Add %s', 'eightshift-frontend-libs'), hasSingleBlockType ? blockTitle : __('a block', 'eightshift-frontend-libs'));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<Button
|
|
58
|
+
onPress={onToggle}
|
|
59
|
+
disabled={disabled}
|
|
60
|
+
icon={icons.add}
|
|
61
|
+
size={small ? 'small' : 'default'}
|
|
62
|
+
className={clsx(className, 'es-uic-font-sans')}
|
|
63
|
+
>
|
|
64
|
+
{labelText}
|
|
65
|
+
</Button>
|
|
66
|
+
)
|
|
67
|
+
}}
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
};
|