Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 2.0.x
  • 3519543-bug--sample-entity
  • 8.x-1.x
  • 2.0.0
  • 2.0.0-alpha1
  • 2.0.0-alpha2
  • 2.0.0-alpha3
  • 2.0.0-beta1
  • 2.0.0-beta2
  • 2.0.0-beta3
  • 2.0.0-beta4
  • 2.0.0-beta5
  • 2.0.0-beta6
  • 2.0.0-rc1
  • 2.0.0-rc2
  • 2.0.1
  • 2.0.2
  • 2.0.3
  • 2.0.4
  • 8.x-1.0
  • 8.x-1.0-beta1
  • 8.x-1.0-beta2
  • 8.x-1.0-beta3
  • 8.x-1.0-beta4
  • 8.x-1.0-beta5
  • 8.x-1.0-beta6
  • 8.x-1.0-beta7
  • 8.x-1.0-rc1
  • 8.x-1.0-rc2
  • 8.x-1.1
  • 8.x-1.10
  • 8.x-1.2
  • 8.x-1.3
  • 8.x-1.4
  • 8.x-1.5
  • 8.x-1.6
  • 8.x-1.7
  • 8.x-1.8
  • 8.x-1.9
  • previous/3395953-2.0.x-add-new/2024-01-11
  • previous/3395960-2.0.x-add-new/2024-01-30
  • previous/3395960-2.0.x-add-new/2024-01-30-1
  • previous/3395960-2.0.x-add-new/2024-01-30-2
  • previous/3395960-2.0.x-test-new-context/2024-04-05-2
  • previous/3413589-2.0.0-beta1-add-alterinfocomponentinfo/2024-07-22
  • previous/3414291-2.0.0-alpha1-source-pluginsmethods/2024-02-24
  • previous/3414291-2.0.0-alpha1-source-pluginsmethods/2024-02-24-1
  • previous/3423185-2.0.0-alpha3-add-allowexpose-derivable_contexts/2024-06-24-2
  • previous/3423185-2.0.0-alpha3-add-allowexpose/2024-06-09
  • previous/3423185-2.0.0-alpha3-add-allowexpose/2024-06-15
  • previous/3423185-2.0.0-alpha3-add-allowexpose/2024-06-20
  • previous/3423185-2.0.0-alpha3-add-allowexpose/2024-06-20-1
  • previous/3423185-2.0.0-alpha3-add-allowexpose/2024-06-21
  • previous/3443441-one-block-per-component/2024-05-27
  • previous/3444770-2.0.0-beta1-componentformbuilder-make/2024-07-26
  • previous/3444770-2.0.0-beta1-componentformbuilder-make/2024-08-05
  • previous/3461566-2.0.0-beta2-ux-slots/2024-09-09-1
  • previous/3469814-2.0.0-beta2-kernel-source/2024-09-05
  • previous/3470386--2.0.0-beta2-render/2024-08-26
59 results

Target

Select target project
  • project/ui_patterns
  • issue/ui_patterns-3290197
  • issue/ui_patterns-3311088
  • issue/ui_patterns-3311340
  • issue/ui_patterns-3311342
  • issue/ui_patterns-3311471
  • issue/ui_patterns-3314293
  • issue/ui_patterns-3313689
  • issue/ui_patterns-3314463
  • issue/ui_patterns-3318269
  • issue/ui_patterns-3314998
  • issue/ui_patterns-3316487
  • issue/ui_patterns-3311455
  • issue/ui_patterns-3314789
  • issue/ui_patterns-3326826
  • issue/ui_patterns-3315661
  • issue/ui_patterns-3311452
  • issue/ui_patterns-3315533
  • issue/ui_patterns-3315660
  • issue/ui_patterns-3311464
  • issue/ui_patterns-3328272
  • issue/ui_patterns-3333738
  • issue/ui_patterns-3342949
  • issue/ui_patterns-3335833
  • issue/ui_patterns-3341073
  • issue/ui_patterns-3311480
  • issue/ui_patterns-3348852
  • issue/ui_patterns-3342390
  • issue/ui_patterns-3349076
  • issue/ui_patterns-3349077
  • issue/ui_patterns-3349079
  • issue/ui_patterns-3353287
  • issue/ui_patterns-3353289
  • issue/ui_patterns-3347891
  • issue/ui_patterns-3351682
  • issue/ui_patterns-3336970
  • issue/ui_patterns-3406383
  • issue/ui_patterns-3371032
  • issue/ui_patterns-3369867
  • issue/ui_patterns-3377457
  • issue/ui_patterns-3381188
  • issue/ui_patterns-3383762
  • issue/ui_patterns-3344405
  • issue/ui_patterns-3395953
  • issue/ui_patterns-3395963
  • issue/ui_patterns-3395960
  • issue/ui_patterns-3410258
  • issue/ui_patterns-3424696
  • issue/ui_patterns-3441490
  • issue/ui_patterns-3413043
  • issue/ui_patterns-3413703
  • issue/ui_patterns-3414116
  • issue/ui_patterns-3414363
  • issue/ui_patterns-3414293
  • issue/ui_patterns-3414774
  • issue/ui_patterns-3417517
  • issue/ui_patterns-3382718
  • issue/ui_patterns-3420517
  • issue/ui_patterns-3420628
  • issue/ui_patterns-3420653
  • issue/ui_patterns-3421484
  • issue/ui_patterns-3421688
  • issue/ui_patterns-3414291
  • issue/ui_patterns-3438996
  • issue/ui_patterns-3438998
  • issue/ui_patterns-3427538
  • issue/ui_patterns-3441326
  • issue/ui_patterns-3446471
  • issue/ui_patterns-3438952
  • issue/ui_patterns-3438432
  • issue/ui_patterns-3437218
  • issue/ui_patterns-3435188
  • issue/ui_patterns-3435827
  • issue/ui_patterns-3441484
  • issue/ui_patterns-3439414
  • issue/ui_patterns-3440202
  • issue/ui_patterns-3440319
  • issue/ui_patterns-3440310
  • issue/ui_patterns-3440278
  • issue/ui_patterns-3438949
  • issue/ui_patterns-3395959
  • issue/ui_patterns-3441987
  • issue/ui_patterns-3440441
  • issue/ui_patterns-3439407
  • issue/ui_patterns-3444348
  • issue/ui_patterns-3437250
  • issue/ui_patterns-3445079
  • issue/ui_patterns-3447833
  • issue/ui_patterns-3443441
  • issue/ui_patterns-3444716
  • issue/ui_patterns-3449932
  • issue/ui_patterns-3444711
  • issue/ui_patterns-3444822
  • issue/ui_patterns-3447985
  • issue/ui_patterns-3452751
  • issue/ui_patterns-3450015
  • issue/ui_patterns-3423185
  • issue/ui_patterns-3444768
  • issue/ui_patterns-3447902
  • issue/ui_patterns-3453793
  • issue/ui_patterns-3454499
  • issue/ui_patterns-3454615
  • issue/ui_patterns-3455076
  • issue/ui_patterns-3455074
  • issue/ui_patterns-3395954
  • issue/ui_patterns-3360373
  • issue/ui_patterns-3438360
  • issue/ui_patterns-3455951
  • issue/ui_patterns-3456083
  • issue/ui_patterns-3456295
  • issue/ui_patterns-3456335
  • issue/ui_patterns-3456484
  • issue/ui_patterns-3457273
  • issue/ui_patterns-3457505
  • issue/ui_patterns-3457620
  • issue/ui_patterns-3456571
  • issue/ui_patterns-3458364
  • issue/ui_patterns-3413609
  • issue/ui_patterns-3459187
  • issue/ui_patterns-3459271
  • issue/ui_patterns-3413589
  • issue/ui_patterns-3459741
  • issue/ui_patterns-3459113
  • issue/ui_patterns-3462312
  • issue/ui_patterns-3462329
  • issue/ui_patterns-3452481
  • issue/ui_patterns-3462505
  • issue/ui_patterns-3460800
  • issue/ui_patterns-3460784
  • issue/ui_patterns-3461858
  • issue/ui_patterns-3462504
  • issue/ui_patterns-3444770
  • issue/ui_patterns-3461579
  • issue/ui_patterns-3461274
  • issue/ui_patterns-3461277
  • issue/ui_patterns-3462818
  • issue/ui_patterns-3464287
  • issue/ui_patterns-3464288
  • issue/ui_patterns-3464291
  • issue/ui_patterns-3464290
  • issue/ui_patterns-3464289
  • issue/ui_patterns-3464879
  • issue/ui_patterns-3441232
  • issue/ui_patterns-3465262
  • issue/ui_patterns-3465264
  • issue/ui_patterns-3464894
  • issue/ui_patterns-3465432
  • issue/ui_patterns-3465453
  • issue/ui_patterns-3465497
  • issue/ui_patterns-3465517
  • issue/ui_patterns-3465488
  • issue/ui_patterns-3465524
  • issue/ui_patterns-3465764
  • issue/ui_patterns-3465821
  • issue/ui_patterns-3465823
  • issue/ui_patterns-3463153
  • issue/ui_patterns-3466385
  • issue/ui_patterns-3466495
  • issue/ui_patterns-3466381
  • issue/ui_patterns-3464630
  • issue/ui_patterns-3466958
  • issue/ui_patterns-3467219
  • issue/ui_patterns-3467398
  • issue/ui_patterns-3467411
  • issue/ui_patterns-3467502
  • issue/ui_patterns-3467653
  • issue/ui_patterns-3461566
  • issue/ui_patterns-3467825
  • issue/ui_patterns-3466359
  • issue/ui_patterns-3466353
  • issue/ui_patterns-3469814
  • issue/ui_patterns-3469665
  • issue/ui_patterns-3470386
  • issue/ui_patterns-3470231
  • issue/ui_patterns-3469808
  • issue/ui_patterns-3471426
  • issue/ui_patterns-3471587
  • issue/ui_patterns-3462146
  • issue/ui_patterns-3455354
  • issue/ui_patterns-3473038
  • issue/ui_patterns-3472571
  • issue/ui_patterns-3467655
  • issue/ui_patterns-3467652
  • issue/ui_patterns-3473344
  • issue/ui_patterns-3473372
  • issue/ui_patterns-3473393
  • issue/ui_patterns-3473412
  • issue/ui_patterns-3462737
  • issue/ui_patterns-3473021
  • issue/ui_patterns-3473621
  • issue/ui_patterns-3456072
  • issue/ui_patterns-3469805
  • issue/ui_patterns-3473804
  • issue/ui_patterns-3473346
  • issue/ui_patterns-3464869
  • issue/ui_patterns-3474113
  • issue/ui_patterns-3474140
  • issue/ui_patterns-3474141
  • issue/ui_patterns-3474137
  • issue/ui_patterns-3474892
  • issue/ui_patterns-3475282
  • issue/ui_patterns-3475564
  • issue/ui_patterns-3475574
  • issue/ui_patterns-3474822
  • issue/ui_patterns-3475857
  • issue/ui_patterns-3474641
  • issue/ui_patterns-3473852
  • issue/ui_patterns-3475163
  • issue/ui_patterns-3467657
  • issue/ui_patterns-3475962
  • issue/ui_patterns-3476246
  • issue/ui_patterns-3476469
  • issue/ui_patterns-3440293
  • issue/ui_patterns-3477106
  • issue/ui_patterns-3477296
  • issue/ui_patterns-3477573
  • issue/ui_patterns-3477625
  • issue/ui_patterns-3467656
  • issue/ui_patterns-3477702
  • issue/ui_patterns-3477419
  • issue/ui_patterns-3478622
  • issue/ui_patterns-3478655
  • issue/ui_patterns-3478648
  • issue/ui_patterns-3479095
  • issue/ui_patterns-3477287
  • issue/ui_patterns-3479850
  • issue/ui_patterns-3480474
  • issue/ui_patterns-3479656
  • issue/ui_patterns-3480553
  • issue/ui_patterns-3478657
  • issue/ui_patterns-3481051
  • issue/ui_patterns-3481405
  • issue/ui_patterns-3481479
  • issue/ui_patterns-3481896
  • issue/ui_patterns-3482208
  • issue/ui_patterns-3483508
  • issue/ui_patterns-3483939
  • issue/ui_patterns-3483489
  • issue/ui_patterns-3485290
  • issue/ui_patterns-3485497
  • issue/ui_patterns-3485900
  • issue/ui_patterns-3486050
  • issue/ui_patterns-3485895
  • issue/ui_patterns-3486547
  • issue/ui_patterns-3483496
  • issue/ui_patterns-3462325
  • issue/ui_patterns-3383544
  • issue/ui_patterns-3449653
  • issue/ui_patterns-3487819
  • issue/ui_patterns-3484830
  • issue/ui_patterns-3488044
  • issue/ui_patterns-3488166
  • issue/ui_patterns-3488167
  • issue/ui_patterns-3488582
  • issue/ui_patterns-3477890
  • issue/ui_patterns-3481540
  • issue/ui_patterns-3488879
  • issue/ui_patterns-3490387
  • issue/ui_patterns-3489973
  • issue/ui_patterns-3490599
  • issue/ui_patterns-3490615
  • issue/ui_patterns-3490696
  • issue/ui_patterns-3490733
  • issue/ui_patterns-3473889
  • issue/ui_patterns-3491238
  • issue/ui_patterns-3491369
  • issue/ui_patterns-3491536
  • issue/ui_patterns-3491560
  • issue/ui_patterns-3487818
  • issue/ui_patterns-3492211
  • issue/ui_patterns-3474511
  • issue/ui_patterns-3437220
  • issue/ui_patterns-3481491
  • issue/ui_patterns-3490872
  • issue/ui_patterns-3492962
  • issue/ui_patterns-3483831
  • issue/ui_patterns-3494404
  • issue/ui_patterns-3494336
  • issue/ui_patterns-3472993
  • issue/ui_patterns-3490873
  • issue/ui_patterns-3494794
  • issue/ui_patterns-3494338
  • issue/ui_patterns-3490476
  • issue/ui_patterns-3494949
  • issue/ui_patterns-3491705
  • issue/ui_patterns-3490150
  • issue/ui_patterns-3487548
  • issue/ui_patterns-3493134
  • issue/ui_patterns-3495847
  • issue/ui_patterns-3495982
  • issue/ui_patterns-3498128
  • issue/ui_patterns-3498184
  • issue/ui_patterns-3496114
  • issue/ui_patterns-3496111
  • issue/ui_patterns-3497683
  • issue/ui_patterns-3498428
  • issue/ui_patterns-3499625
  • issue/ui_patterns-3498456
  • issue/ui_patterns-3495984
  • issue/ui_patterns-3498137
  • issue/ui_patterns-3500243
  • issue/ui_patterns-3499983
  • issue/ui_patterns-3500669
  • issue/ui_patterns-3500244
  • issue/ui_patterns-3498496
  • issue/ui_patterns-3501430
  • issue/ui_patterns-3501400
  • issue/ui_patterns-3501914
  • issue/ui_patterns-3502069
  • issue/ui_patterns-3502079
  • issue/ui_patterns-3502916
  • issue/ui_patterns-3503141
  • issue/ui_patterns-3504119
  • issue/ui_patterns-3504351
  • issue/ui_patterns-3504811
  • issue/ui_patterns-3504857
  • issue/ui_patterns-3506138
  • issue/ui_patterns-3506145
  • issue/ui_patterns-3508054
  • issue/ui_patterns-3507007
  • issue/ui_patterns-3508463
  • issue/ui_patterns-3510560
  • issue/ui_patterns-3510596
  • issue/ui_patterns-3511027
  • issue/ui_patterns-3511112
  • issue/ui_patterns-3511203
  • issue/ui_patterns-3512018
  • issue/ui_patterns-3511397
  • issue/ui_patterns-3512477
  • issue/ui_patterns-3511351
  • issue/ui_patterns-3513456
  • issue/ui_patterns-3513546
  • issue/ui_patterns-3513568
  • issue/ui_patterns-3513653
  • issue/ui_patterns-3514270
  • issue/ui_patterns-3514800
  • issue/ui_patterns-3514886
  • issue/ui_patterns-3488418
  • issue/ui_patterns-3515500
  • issue/ui_patterns-3516308
  • issue/ui_patterns-3516369
  • issue/ui_patterns-3508748
  • issue/ui_patterns-3517343
  • issue/ui_patterns-3517621
  • issue/ui_patterns-3517724
  • issue/ui_patterns-3517695
  • issue/ui_patterns-3518099
  • issue/ui_patterns-3519282
  • issue/ui_patterns-3519517
  • issue/ui_patterns-3519543
  • issue/ui_patterns-3519934
  • issue/ui_patterns-3506207
  • issue/ui_patterns-3523040
  • issue/ui_patterns-3517651
  • issue/ui_patterns-3524637
  • issue/ui_patterns-3496209
  • issue/ui_patterns-3525442
  • issue/ui_patterns-3525566
  • issue/ui_patterns-3525646
  • issue/ui_patterns-3525775
  • issue/ui_patterns-3525803
  • issue/ui_patterns-3525836
  • issue/ui_patterns-3523756
  • issue/ui_patterns-3526747
  • issue/ui_patterns-3419974
365 results
Select Git revision
  • 3311471-detect-all-theme
  • 8.x-1.x
  • 86-library-module
  • 8.x-1.0
  • 8.x-1.0-beta1
  • 8.x-1.0-beta2
  • 8.x-1.0-beta3
  • 8.x-1.0-beta4
  • 8.x-1.0-beta5
  • 8.x-1.0-beta6
  • 8.x-1.0-beta7
  • 8.x-1.0-rc1
  • 8.x-1.0-rc2
  • 8.x-1.1
  • 8.x-1.2
  • 8.x-1.3
  • previous/3311471-detect-all-theme/2022-12-09
  • previous/3311471-detect-all-theme/2022-12-13
  • previous/3311471-detect-all-theme/2022-12-13-1
19 results
Show changes
Commits on Source (593)
Showing
with 944 additions and 535 deletions
behaviours
coveooss
ctahref
hotwire
htmx
canonicalizer
canonicalized
coloris
contextful
corge
criticals
daisyui
dsfr
endsandbox
favourite
getattr
grault
kint
maxcontains
mincontains
pdureau
proptype
pymdownx
recursivity
sameas
sdc's
spottable
subcomponent
toolset
uswds
vincentlanglet
merge_prefix=
issues=false
vendor
behat.yml
tests/drupal
composer.lock
docs/_build
.DS_Store
**/.DS_Store
# https://git.drupalcode.org/project/gitlab_templates/
include:
- project: $_GITLAB_TEMPLATES_REPO
ref: $_GITLAB_TEMPLATES_REF
file:
- "/includes/include.drupalci.main.yml"
- "/includes/include.drupalci.variables.yml"
- "/includes/include.drupalci.workflows.yml"
.skip-phpmd-rule: &skip-phpmd-rule
if: '$SKIP_PHPMD == "1"'
when: never
.phpmd-base:
stage: validate
rules:
- !reference [.opt-in-current-rule]
- *skip-phpmd-rule
- !reference [.php-files-exist-rule]
needs:
- composer
before_script:
- curl -fsSL https://phpmd.org/static/latest/phpmd.phar -o vendor/bin/phpmd
- chmod +x vendor/bin/phpmd
script:
- php --version
- vendor/bin/phpmd --version
- vendor/bin/phpmd $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME gitlab $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME/.phpmd.xml --exclude 'tests/*,**/tests/*' > phpmd-quality-report.json || true
- vendor/bin/phpmd $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME text $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME/.phpmd.xml --exclude 'tests/*,**/tests/*'
allow_failure: false
artifacts:
expose_as: phpmd
when: always
expire_in: 6 mos
reports:
codequality: phpmd-quality-report.json
name: artifacts-$CI_PIPELINE_ID-$CI_JOB_NAME_SLUG
paths:
- phpmd-quality-report.json
.twig-lint-base:
stage: validate
before_script:
- composer require --dev vincentlanglet/twig-cs-fixer
script:
- vendor/bin/twig-cs-fixer lint --config=$_WEB_ROOT/modules/custom/$CI_PROJECT_NAME/.twig-cs-fixer.php $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME
rules:
- changes:
- "**/*.twig"
- if: '$CI_PIPELINE_SOURCE == "push"'
allow_failure: false
artifacts:
expose_as: twig-lint
when: always
expire_in: 6 mos
reports:
codequality: twig-lint-quality-report.xml
name: artifacts-$CI_PIPELINE_ID-$CI_JOB_NAME_SLUG
paths:
- twig-lint-quality-report.xml
.prettier-lint-base:
stage: validate
script:
- echo "Prettier version $(${CI_PROJECT_DIR}/${_WEB_ROOT}/core/node_modules/.bin/prettier --version)"
- ${CI_PROJECT_DIR}/${_WEB_ROOT}/core/node_modules/.bin/prettier --check ${CI_PROJECT_DIR}/docs/
rules:
- changes:
- "docs/*.md"
- "docs/**/*.md"
allow_failure: false
artifacts:
expose_as: prettier-lint
when: always
expire_in: 6 mos
reports:
codequality: prettier-lint-quality-report.xml
name: artifacts-$CI_PIPELINE_ID-$CI_JOB_NAME_SLUG
paths:
- prettier-lint-quality-report.xml
phpmd:
extends: .phpmd-base
twig-lint:
extends: .twig-lint-base
prettier-lint:
extends: .prettier-lint-base
composer-lint:
allow_failure: false
cspell:
allow_failure: false
variables:
_CSPELL_IGNORE_PATHS: '**/tests/fixtures/config/*.yml, **/tests/fixtures/*.yml'
eslint:
allow_failure: false
phpcs:
allow_failure: false
phpstan:
allow_failure: false
phpunit:
allow_failure: false
variables:
_PHPUNIT_EXTRA: ''
<?xml version="1.0"?>
<ruleset name="UI Patterns PHPMD Rules"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0
http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="
http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
UI Patterns PHPMD Rules
</description>
<!-- Import the entire unused code rule set -->
<rule ref="rulesets/unusedcode.xml" />
<!--
Import the entire cyclomatic complexity rule and
customize the rule configuration.
-->
<rule ref="rulesets/codesize.xml/CyclomaticComplexity">
</rule>
</ruleset>
2.2.2
language: php
php:
# Temporarily disable 5.6 build
# - 5.6
- 7.0
env:
global:
- PATH=$PATH:/home/travis/.composer/vendor/bin
install:
- composer self-update
- composer install --prefer-dist
- ./vendor/bin/phpcs --config-set installed_paths ../../drupal/coder/coder_sniffer
- ./vendor/bin/phpcs --config-set show_progress 1
before_script:
# Start PhantomJS server.
- phantomjs --webdriver=4444 > /dev/null &
# Set sendmail so drush doesn't throw an error during site install.
- echo "sendmail_path=`which true`" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'`
# Create database.
- mysql -e 'create database drupal'
# Install Drupal 8 target site.
- cd tests
- composer install --prefer-dist
- ./vendor/bin/drush si standard -y --db-url=mysql://travis:@127.0.0.1/drupal
# Test latest commit on current branch.
- git clone --branch=$TRAVIS_BRANCH https://github.com/$TRAVIS_REPO_SLUG.git modules/ui_patterns
- ./vendor/bin/drush en ui_patterns_test -y
# Run Drush web server.
- ./vendor/bin/drush --debug runserver :8888 > ~/debug.txt 2>&1 &
- sleep 4s
- chmod -R ug+w sites
script:
- cd $TRAVIS_BUILD_DIR
- composer phpcs
- cd tests
- ./vendor/bin/phpunit
- ./vendor/bin/behat
notifications:
email: false
<?php
$ruleset = new TwigCsFixer\Ruleset\Ruleset();
// Add a default standard.
$ruleset->addStandard(new TwigCsFixer\Standard\TwigCsFixer());
// Add some specific rules.
$ruleset->addRule(new TwigCsFixer\Rules\File\FileExtensionRule());
$config = new TwigCsFixer\Config\Config();
$config->setRuleset($ruleset);
return $config;
# Change Log
## [Unreleased](https://github.com/nuvoleweb/ui_patterns/tree/HEAD)
[Full Changelog](https://github.com/nuvoleweb/ui_patterns/compare/8.x-1.0-beta6...HEAD)
- Improve "use:" property processing \#83 [\#84](https://github.com/nuvoleweb/ui_patterns/pull/84) ([ademarco](https://github.com/ademarco))
## [8.x-1.0-beta6](https://github.com/nuvoleweb/ui_patterns/tree/8.x-1.0-beta6) (2017-03-19)
[Full Changelog](https://github.com/nuvoleweb/ui_patterns/compare/8.x-1.0-beta5...8.x-1.0-beta6)
- Allow multiple sources to be mapped to the same destination \#81 [\#82](https://github.com/nuvoleweb/ui_patterns/pull/82) ([ademarco](https://github.com/ademarco))
- Use TypedData API to define and validate pattern definitions \#78 [\#79](https://github.com/nuvoleweb/ui_patterns/pull/79) ([ademarco](https://github.com/ademarco))
- Make patterns actual objects \#71 [\#72](https://github.com/nuvoleweb/ui_patterns/pull/72) ([ademarco](https://github.com/ademarco))
- Refactor tests \#69 [\#70](https://github.com/nuvoleweb/ui_patterns/pull/70) ([ademarco](https://github.com/ademarco))
- Refactor pattern plugins to use derivatives \#66 [\#68](https://github.com/nuvoleweb/ui_patterns/pull/68) ([ademarco](https://github.com/ademarco))
- Add pattern layout hook suggestions \#63 [\#64](https://github.com/nuvoleweb/ui_patterns/pull/64) ([ademarco](https://github.com/ademarco))
## [8.x-1.0-beta5](https://github.com/nuvoleweb/ui_patterns/tree/8.x-1.0-beta5) (2017-02-08)
[Full Changelog](https://github.com/nuvoleweb/ui_patterns/compare/8.x-1.0-beta4...8.x-1.0-beta5)
- Support preview views UI \#54 [\#60](https://github.com/nuvoleweb/ui_patterns/pull/60) ([ademarco](https://github.com/ademarco))
- Recursion \(max function nesting level\) \#53 [\#59](https://github.com/nuvoleweb/ui_patterns/pull/59) ([ademarco](https://github.com/ademarco))
- Allow libraries to be defined on pattern definitions \#34 [\#52](https://github.com/nuvoleweb/ui_patterns/pull/52) ([ademarco](https://github.com/ademarco))
- fixed a broken sentence. [\#47](https://github.com/nuvoleweb/ui_patterns/pull/47) ([Grienauer](https://github.com/Grienauer))
## [8.x-1.0-beta4](https://github.com/nuvoleweb/ui_patterns/tree/8.x-1.0-beta4) (2017-01-28)
[Full Changelog](https://github.com/nuvoleweb/ui_patterns/compare/8.x-1.0-beta3...8.x-1.0-beta4)
- Add example theme \#29 [\#46](https://github.com/nuvoleweb/ui_patterns/pull/46) ([ademarco](https://github.com/ademarco))
- Allow preview values to be empty \#43 [\#45](https://github.com/nuvoleweb/ui_patterns/pull/45) ([ademarco](https://github.com/ademarco))
- Add Twig function to render patterns in templates \#38 [\#41](https://github.com/nuvoleweb/ui_patterns/pull/41) ([ademarco](https://github.com/ademarco))
- Add hashes to preview render arrays recursively \#39 [\#40](https://github.com/nuvoleweb/ui_patterns/pull/40) ([aleksip](https://github.com/aleksip))
- Add a Gitter chat badge to README.md [\#30](https://github.com/nuvoleweb/ui_patterns/pull/30) ([gitter-badger](https://github.com/gitter-badger))
## [8.x-1.0-beta3](https://github.com/nuvoleweb/ui_patterns/tree/8.x-1.0-beta3) (2017-01-25)
[Full Changelog](https://github.com/nuvoleweb/ui_patterns/compare/8.x-1.0-beta2...8.x-1.0-beta3)
- \[IMPORTANT\] Rename pattern theme prefix from "pattern\_\_" to "pattern\_" \#36 [\#37](https://github.com/nuvoleweb/ui_patterns/pull/37) ([ademarco](https://github.com/ademarco))
- Add theme hook suggestions \#31 [\#32](https://github.com/nuvoleweb/ui_patterns/pull/32) ([ademarco](https://github.com/ademarco))
## [8.x-1.0-beta2](https://github.com/nuvoleweb/ui_patterns/tree/8.x-1.0-beta2) (2017-01-23)
[Full Changelog](https://github.com/nuvoleweb/ui_patterns/compare/8.x-1.0-beta1...8.x-1.0-beta2)
- Improve pattern definition validation \#20 [\#27](https://github.com/nuvoleweb/ui_patterns/pull/27) ([ademarco](https://github.com/ademarco))
- Improve documentation \#25 [\#26](https://github.com/nuvoleweb/ui_patterns/pull/26) ([ademarco](https://github.com/ademarco))
- Allow Twig namespaces in pattern definitions in order to override pattern template file \#14 [\#24](https://github.com/nuvoleweb/ui_patterns/pull/24) ([ademarco](https://github.com/ademarco))
- Support for finding templates in subfolders \#16 [\#23](https://github.com/nuvoleweb/ui_patterns/pull/23) ([ademarco](https://github.com/ademarco))
- Allow multiple pattern definition files \#15 [\#22](https://github.com/nuvoleweb/ui_patterns/pull/22) ([aleksip](https://github.com/aleksip))
- Provide Display Suite field template plugin \#7 [\#21](https://github.com/nuvoleweb/ui_patterns/pull/21) ([ademarco](https://github.com/ademarco))
- Add a new pattern render element \#12 [\#19](https://github.com/nuvoleweb/ui_patterns/pull/19) ([ademarco](https://github.com/ademarco))
- Integrate patterns with views \#8 [\#18](https://github.com/nuvoleweb/ui_patterns/pull/18) ([ademarco](https://github.com/ademarco))
- Add mapping source plugin \#5 [\#11](https://github.com/nuvoleweb/ui_patterns/pull/11) ([ademarco](https://github.com/ademarco))
## [8.x-1.0-beta1](https://github.com/nuvoleweb/ui_patterns/tree/8.x-1.0-beta1) (2017-01-09)
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\ No newline at end of file
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
# UI Patterns
# UI Patterns 2.x
[![Join the chat at https://gitter.im/nuvoleweb/ui_patterns](https://badges.gitter.im/nuvoleweb/ui_patterns.svg)](https://gitter.im/nuvoleweb/ui_patterns?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/nuvoleweb/ui_patterns.svg?branch=8.x-1.x)](https://travis-ci.org/nuvoleweb/ui_patterns)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nuvoleweb/ui_patterns/badges/quality-score.png?b=8.x-1.x)](https://scrutinizer-ci.com/g/nuvoleweb/ui_patterns/?branch=8.x-1.x)
[![Documentation Status](https://readthedocs.org/projects/ui-patterns/badge/?version=8.x-1.x)](http://ui-patterns.readthedocs.io/en/8.x-1.x/?badge=8.x-1.x)
Expose SDC components as Drupal plugins and use them seamlessly in Drupal development and site-building.
Define and expose self-contained UI patterns as Drupal plugins and use them seamlessly as drop-in templates for
[panels](https://www.drupal.org/project/panels), [field groups](https://www.drupal.org/project/field_group), views,
[Display Suite](https://www.drupal.org/project/ds) view modes and field templates.
The module generates a pattern library page to be used as documentation for content editors or as a showcase for
business and clients.
The UI Patterns module also integrates with with tools like [PatternLab](http://patternlab.io/) or modules like
[Component Libraries](https://www.drupal.org/project/components) thanks to
[definition overrides](http://ui-patterns.readthedocs.io/en/8.x-1.x/content/patterns-definition.html#override-patterns-behavior).
![Showcase page example](https://raw.githubusercontent.com/nuvoleweb/ui_patterns/8.x-1.x/docs/images/pattern-library.png)
Components are reusable, nestable, guided by clear standards, and can be assembled together to build any number of applications. Examples: card, button, slider, pager, menu, toast...
## Project overview
The UI Patterns project provides 5 modules:
The UI Patterns project provides 3 "toolset" modules:
- **UI Patterns**: the main module, its purpose is to expose patterns to the Drupal rendering system and provide a pattern library overview page, available at `/patterns`. [Learn more](http://ui-patterns.readthedocs.io/en/8.x-1.x/content/patterns-definition.html)
- **UI Patterns Field Group**: allows to use patterns to format field groups provided by the [Field group](https://www.drupal.org/project/field_group) module. [Learn more](http://ui-patterns.readthedocs.io/en/8.x-1.x/content/field-group.html)
- **UI Patterns Layouts**: allows to use patterns as layouts provided by the [Layout plugin](https://www.drupal.org/project/layout_plugin) module. This allows patterns to be used on [Display Suite](https://www.drupal.org/project/ds) view modes or on [panels](https://www.drupal.org/project/panels) out of the box. [Learn more](http://ui-patterns.readthedocs.io/en/8.x-1.x/content/layout-plugin.html)
- **UI Patterns Display Suite**: allows to use patterns to format [Display Suite](https://www.drupal.org/project/ds) field templates. [Learn more](http://ui-patterns.readthedocs.io/en/8.x-1.x/content/field-templates.html)
- **UI Patterns Views**: allows to use patterns as Views row templates. [Learn more](http://ui-patterns.readthedocs.io/en/8.x-1.x/content/views.html)
- **UI Patterns**: the main module, based on Drupal Core SDC API, with some extra features and quality-of-life improvements
- **UI Patterns Library**: generates a pattern library page available at `/admin/appearance/ui/components`
to be used as documentation for content editors or as a showcase for business. Use this module if you don't plan to
use more advanced component library systems such as Storybook, PatternLab or Fractal.
- **UI Patterns Legacy**: Load your UI Patterns 1.x components inside UI Patterns 2.x
## Try it out!
Download and install the [Bootstrap Patterns](https://github.com/nuvoleweb/bootstrap_patterns) theme on a vanilla Drupal
8 installation to quickly try out the UI Patterns module.
4 "integration" modules:
- **UI Patterns Layouts**: allows to use components as layouts. This allows patterns to be used with Layout Builder,
[Display Suite](https://www.drupal.org/project/ds) or [Layout Paragraphs](https://www.drupal.org/project/layout_paragraphs)
out of the box.
- **UI Patterns Blocks**: allows to use components as Blocks plugins.
- **UI Patterns Field Formatters**: allows to use components as Field Formatters plugins.
- **UI Patterns Views**: allows to use components as Views styles or Views rows plugins.
## Documentation
Documentation is hosted on [Read the Docs](https://readthedocs.org/) and available [here](http://ui-patterns.readthedocs.io/en/8.x-1.x).
To build the documentation make sure you setup your environment by following
[these instructions](http://read-the-docs.readthedocs.io/en/latest/getting_started.html) first.
After setting up your environment run:
```
$ cd docs
$ make html
```
The documentation is then available at ``./docs/_build/html/index.html``.
If you want to contribute documentation you can setup and auto-compile that will watch for documentation changes by running:
Documentation is available [here](https://www.drupal.org/docs/contributed-modules/ui-patterns).
```
$ make livehtml
```
## Testing
You can then preview the compiled documentation at ``http://127.0.0.1:8000``.
### Performance testing
UI Patterns uses [Gander](https://www.drupal.org/docs/develop/automated-testing/performance-tests) to automate performance measuring.
We suggest to use ddev with the [Gander Addon](https://github.com/tag1consulting/ddev-gander) to view render results.
{
"name": "drupal/ui_patterns",
"description": "Define and expose self-contained UI components and use them seamlessly in development and site-building.",
"license": "GPL-2.0-or-later",
"type": "drupal-module",
"description": "UI Patterns.",
"keywords": ["drupal", "web", "ui"],
"minimum-stability": "stable",
"license": "GPL-2.0+",
"authors": [
{
"name": "Nuvole Web",
"email": "info@nuvole.org"
}
],
"prefer-stable": true,
"require-dev": {
"drupal/coder": "8.2.8"
},
"scripts": {
"post-install-cmd": [
"./vendor/bin/phpcs --config-set installed_paths ../../drupal/coder/coder_sniffer",
"./vendor/bin/phpcs --config-set show_progress 1",
"cp ./tests/scripts/pre-push.sh .git/hooks/pre-push && chmod +x .git/hooks/pre-push"
],
"post-update-cmd": [
"./vendor/bin/phpcs --config-set installed_paths ../../drupal/coder/coder_sniffer",
"./vendor/bin/phpcs --config-set show_progress 1",
"cp ./tests/scripts/pre-push.sh .git/hooks/pre-push && chmod +x .git/hooks/pre-push"
],
"phpcs": "./vendor/bin/phpcs --standard=Drupal,DrupalPractice ./src ./tests/src ./modules --ignore=./modules/ui_patterns_test",
"phpcbf": "./vendor/bin/phpcbf --standard=Drupal,DrupalPractice ./src ./tests/src ./modules --ignore=./modules/ui_patterns_test"
"require": {
"justinrainbow/json-schema": "5.*"
}
}
ui_patterns_component:
type: mapping
label: 'Component configuration'
constraints:
FullyValidatable: ~
mapping:
component_id:
type: string
label: 'Component ID'
nullable: true
variant_id:
type: ui_patterns_prop
nullable: true
label: 'Variant ID'
# @todo make a mechanism that will check the props keys depending on the
# the component ID. And so maybe convert into mapping.
props:
type: sequence
label: 'Props'
sequence:
type: ui_patterns_prop
label: 'Prop'
# @todo make a mechanism that will check the slots keys depending on the
# the component ID. And so maybe convert into mapping.
slots:
type: sequence
label: 'Slots'
sequence:
type: ui_patterns_slot
label: 'Slot'
ui_patterns_prop:
type: mapping
label: 'Prop'
mapping:
source_id:
type: string
label: 'Prop source ID'
source:
type: ui_patterns_source.[%parent.source_id]
label: 'Prop source configuration'
ui_patterns_slot:
type: mapping
label: 'Slot'
mapping:
sources:
type: sequence
label: 'Slot sources'
sequence:
type: ui_patterns_slot_source
label: 'Slot source'
ui_patterns_slot_source:
type: mapping
label: 'Slot source'
mapping:
source_id:
type: string
label: 'Slot source ID'
source:
type: ui_patterns_source.[%parent.source_id]
label: 'Slot source configuration'
_weight:
type: string
label: 'Slot source weight'
ui_patterns_source.checkbox:
type: mapping
label: 'Source: checkbox'
mapping:
value:
type: boolean
label: 'Checkbox value'
ui_patterns_source.attribute:
type: mapping
label: 'Source: attribute'
mapping:
value:
type: boolean
label: 'Attribute value'
ui_patterns_source.path:
type: mapping
label: 'Source: Path'
mapping:
value:
type: path
label: 'Path value'
ui_patterns_source.url:
type: mapping
label: 'Source: URL'
mapping:
value:
type: uri
label: 'URL value'
ui_patterns_source.textfield:
type: mapping
label: 'Source: Textfield'
mapping:
value:
type: string
label: 'String value'
ui_patterns_source.select:
type: mapping
label: 'Source: Select'
mapping:
value:
type: string
label: 'Select value'
ui_patterns_source.selects:
type: mapping
label: 'Source: Selects'
mapping:
value:
type: sequence
label: 'Selects value'
sequence:
type: string
label: 'Values'
ui_patterns_source.attributes:
type: mapping
label: 'Source: Attributes'
mapping:
value:
type: string
label: 'Attribute value'
ui_patterns_source.attributes_class:
type: mapping
label: 'Source: Attributes Class'
mapping:
value:
type: string
label: 'Attributes Class value'
ui_patterns_source.list_textarea:
type: mapping
label: 'Source: List Text area'
mapping:
value:
type: string
label: 'Source List Text area values'
ui_patterns_source.number:
type: mapping
label: 'Source: Number'
mapping:
value:
type: string
label: 'Number value'
ui_patterns_source.wysiwyg:
type: mapping
label: 'Source: WYSIWYG'
mapping:
value:
type: text_format
label: 'WYSIWYG value'
ui_patterns_source.component:
type: mapping
label: 'Source: Component'
mapping:
component:
type: ui_patterns_component
ui_patterns_source.checkboxes:
type: mapping
label: 'Source: Checkboxes'
mapping:
value:
type: sequence
label: 'Selects value'
sequence:
type: string
label: 'Select Item Value'
ui_patterns_source.entity_link:
type: mapping
label: 'Source: Entity Link'
mapping:
template:
type: string
ui_patterns_source.menu:
type: mapping
label: 'Source: Menu'
mapping:
menu:
type: string
label: 'Menu Name'
level:
type: string
label: 'Entry Level'
depth:
type: string
label: 'Menu depth'
ui_patterns_source.token:
type: mapping
label: 'Source: Token'
mapping:
value:
type: string
label: 'Token value'
ui_patterns_source.field_property:*:*:*:
type: mapping
label: 'Source: Field Property'
mapping:
type:
type: string
label: 'Field Property type'
# block uses dynamic subkeys not under a specific key.
# The configuration looks like:
# plugin_id: block_id
# block_id:
# config_1: #
# I cant find a solution to handle this correct. Sequences would work
# if the the block_id key would be under an extra key. Something like config.block_id
ui_patterns_source.block:
type: ignore
# Same here ui_patterns_source.block
ui_patterns_source.entity_field:
type: ignore
# This source uses a dynamic subkey.
# The configuration looks like:
# source_id: entity_reference
# source:
# derivable_context: 'context:id'
# 'context:id':
ui_patterns_source.entity_reference:
type: ignore
# Component form
The biggest feature of UI Patterns is the generation of forms from the components definition:
| From component definition.... | ... to component form |
| --------------------------------- | ----------------------- |
| ![](images/bs-alert-example.webp) | ![](images/form-1.webp) |
Those forms will be shown everywhere a component is used:
- [as blocks](1-as-block.md)
- [as layouts](1-as-block.md)
- [in field formatters](1-as-block.md)
- [in views](1-as-block.md)
- ...
## Data sources
Values are taken from sources:
- "Widgets": simple form elements storing directly the data filled by the user. For example, a `textfield` for a string or a `checkbox` for a boolean.
- Sources retrieving data from Drupal API: they can be context agnostic (ex: a menu for links) or context specific (ex: the title field for a string)
- Context switchers: They don't retrieve data but they give access to other data sources. For example, the author fields from an article content.
If there is only a single source available, the source form is directly displayed:
![](images/sources-1.webp)
If there are at least 2, a source selector is shown:
![](images/sources-2.webp)
Some sources doesn't have a form, selecting the source is enough:
![](images/sources-3.webp)
### Data sources from other prop types
Sources are available according to the prop type:
- the breadcrumb for `links` props
- an entity link for `url` props
- a WYSIWYG for slots
However, sources from other prop types are also available when the data can be converted from the more specific to the less specific:
![](images/converted.webp)
For example:
- An URL data source can be used in a string prop because every URL is also a string. However, a string data source can't be used in an URL prop because not every string is an URL
- A string data source can be used in a slot because every string is also a renderable. However, a free renderable source (like ViewField) can't be used in an string prop because not every renderable is a string.
## Context
Sometimes sources require another object in order to retrieve the data. This is known as context.
Some source doesn't need a context and are site wide, for example:
- All “widgets” which are source plugins with only direct input: Textfield, Select, Checkbox…
- List of all menus
- The breadcrumb
-
Some sources need a context:
| Context | Source | Prop type |
| -------------- | --------------- | --------- |
| Content entity | Entity link | URL |
| Field | Field formatter | Slot |
| Field | Field label | String |
| Field item | Field prop : \* | (many) |
| View | View title | String |
| View | View rows | Slot |
| View | View field | Slot |
Some sources need a context and are switching the context instead of providing data:
| Initial context | Source | New context |
| --------------- | ------------------- | -------------- |
| Content entity | Data from a field | Field |
| Content entity | Referenced entities | Content entity |
| Reference field | Field prop: entity | Content entity |
## Variant selector
Some components have variants, a list of different "look" of the component. Variants doesn't change the model or the meaning of the component, only the look.
![](images/variant-1.webp)
## Slots
SDC components are made of slots & props:
- **Slots**: “areas” for free renderables only, like Drupal blocks or other SDC components for example.
- **Props**: strictly typed data only, for some UI logic in the template.
You can draw the slots areas in a component screenshot:
![](images/slots-vs-props.webp)
For each slots, its is possible to add one or many sources:
![](images/slot-1.webp)
For example:
- "Component": nest another SDC component in the slot.
- "Block": add a Drupal block plugin
- "Wysiwyg": a simple text editor, using the text formats defined in your site.
Other modules can add other sources. For example, "Icon" in this screenshot is brought by https://www.drupal.org/project/ui_icons
Once a source is added, it can be configured and we can add more because the selector is still present:
![](images/slot-2.webp)
Sources can be reordered inside a slot.
Using the "Component" source, we have access to the embedded component slots and we can nest data:
![](images/slot-3.webp)
## Props
A bit like the form for slots with 2 main differences:
- We don’t allow multiple items, so we can replace the source but not add some (and of course no reordering)
- The default source form is already loaded.
![](images/props-1.webp)
The available sources are varying according to both:
- the prop type. Each prop as a type, which is related to its JSON schema typing, but not exactly the same. You can check what type has a prop in the [component library](../2-authors/1-stories-and-library.md). A prop without a type is not displayed in the form.
- the context, as explained before.
# Using a component as a Drupal block
You need to activate `ui_patterns_blocks` sub-module.
Blocks are boxes of content rendered into an area, or region, of a web page (such as "User Login" or "Who's online") that can be displayed in regions (such as footer or sidebar) on your page or content display.
## In Block Layout (`/admin/structure/block`)
Every UI component is a Drupal block plugin, available in the "Place block" modal:
![](images/block-1.webp)
For example, to assign any component in the Header region, click on "Place Block" button and choose the component to be placed in this particular region.
The component is configurable as an usual block plugin, with the [Component form](3.0-component-form.md) alongside the block title, the visibility settings and the block placement:
![](images/block-2.webp)
### Contextual data sources
There is no specific context here. Only the generic data sources are available.
## In Layout Builder
Drupal's Layout Builder allows content editors and site builders to create visual layouts for displaying content. Users can customize how content is arranged on a single page, across types of content, or even create custom landing pages with an easy to use drag-and-drop interface.
The Layout Builder provides the ability to drag and drop site-wide blocks and content fields into regions within a given layout.
![](images/block-3.webp)
Component props are available in the sidebar as block settings:
![](images/block-4.webp)
### Contextual data sources
| Context | Source | Prop type | Description |
| -------------- | ------------------- | --------- | ------------------------------------------ |
| Content entity | Data from a field | | Switch to a Field context. |
| Content entity | Entity link | URL |
| Content entity | Referenced entities | | Switch to an other Content entity context. |
# Using a component as a layout
You need to activate `ui_patterns_layouts` sub-module.
## Layout plugins
SDC components have a model quite similar to Drupal layout plugins:
- Component slots are layout plugin regions
- Component props are layout plugin settings
## In Layout Builder
Drupal's Layout Builder allows content editors and site builders to create visual layouts for displaying content. Users can customize how content is arranged on a single page, across types of content, or even create custom landing pages with an easy to use drag-and-drop interface.
The Layout Builder provides the ability to drag and drop site-wide blocks and content fields into regions within a given layout.
Each section can contain content arranged in a certain layout. Each UI component is exposed as a layout plugin:
![](images/layout-1.webp)
If a component has a `thumbnail.webp`, it will be shown in the layouts list:
![](images/layout-3.webp)
Section configuration is a [Component form](3.0-component-form.md), without the slots because slots are directly managed by Layout Builder as regions of the layout:
![](images/layout-2.webp)
### Contextual data sources
There is no UI Patterns sources for slots here because slots are directly managed by Layout Builder as regions. So, only Drupal blocks plugins are available.
| Context | Source | Prop type | Description |
| -------------- | ------------------- | --------- | ------------------------------------------ |
| Content entity | Data from a field | | Switch to a Field context. |
| Content entity | Entity link | URL |
| Content entity | Referenced entities | | Switch to an other Content entity context. |
# Using a component in field formatters
Field Formatters are Drupal plugins formatting the output of a content field. For example:
- Date field formatted as "... time ago"
- Date field formatted with a custom date format
- Entity reference field formatted as label
- Entity reference field formatted as a rendered entity
- ...
There are 2 field formatters provided by `ui_patterns_field_formatters` sub-module:
- **Component per item**: Each item will be displayed as a component.
- **Component**: Available only for multi-valued fields. The full field is displayed as a component.
## In Manage Display
Manage display manages the way your content is displayed on the frontend.
The UI Patterns field formatters are available in the format select list, for every fields,
![](images/formatter-1.webp)
Once selected, the field formatters are configurable as usual field formatters, with the UI Patterns 2's [Component form](3.0-component-form.md)
![](images/formatter-2.webp)
### Contextual data sources
| Context | Source | Prop type | Description |
| --------------- | ------------------- | --------- | ------------------------------------------ |
| Field | Field formatter | Slot |
| Field | Field label | String |
| Field | Field prop: \* | (many) |
| Reference field | Field prop: entity | | Switch to a Content entity context. |
| Content entity | Data from a field | | Switch to a Field context. |
| Content entity | Entity link | URL |
| Content entity | Referenced entities | | Switch to an other Content entity context. |
## In Layout Builder
Drupal's Layout Builder allows content editors and site builders to create visual layouts for displaying content. Users can customize how content is arranged on a single page, across types of content, or even create custom landing pages with an easy to use drag-and-drop interface.
Fields are available as blocks:
![](images/formatter-3.webp)
Once selected, the field formatters are configurable as usual field formatters, with the UI Patterns 2's [Component form](3.0-component-form.md):
![](images/formatter-4.webp)
### Contextual data sources
| Context | Source | Prop type | Description |
| --------------- | ------------------- | --------- | ------------------------------------------ |
| Field | Field formatter | Slot |
| Field | Field label | String |
| Field | Field prop : \* | (many) |
| Reference field | Field prop: entity | | Switch to a Content entity context. |
| Content entity | Data from a field | | Switch to a Field context. |
| Content entity | Entity link | URL |
| Content entity | Referenced entities | | Switch to an other Content entity context. |
## In Views
Drupal Views is both:
- a query builder: fetch content from the database, with filters, sorts and grouping.
- a display builder: present the results as lists, galleries, tables, maps, graphs, reports...
If your display accepts fields, the field formatters are available:
![](images/formatter-5.webp)
Once selected, the field formatters are configurable as usual field formatters, with the UI Patterns 2's [Component form](3.0-component-form.md):
![](images/formatter-6.webp)
### Contextual data sources
| Context | Source | Prop type | Description |
| --------------- | ------------------- | --------- | ------------------------------------------ |
| Field | Field formatter | Slot |
| Field | Field label | String |
| Field | Field prop: \* | (many) |
| Reference field | Field prop: entity | | Switch to a Content entity context. |
| Content entity | Data from a field | | Switch to a Field context. |
| Content entity | Entity link | URL |
| Content entity | Referenced entities | | Switch to an other Content entity context. |
# Using a component with Views
Drupal Views is both:
- a query builder: fetch content from the database, with filters, sorts and grouping.
- a display builder: present the results as lists, galleries, tables, maps, graphs, reports...
You need to activate `ui_patterns_views` sub-module.
## View style plugin
To build the display around the results:
- the table and not the rows
- the slider and not the slides
- the map and not the points of interest
- the mosaic and not the pictures
### Steps
Pick "Component" in the modal:
![](images/views-1.webp)
Select the component and fill the configuration form:
[Component form](3.0-component-form.md)
![](images/views-2.webp)
### Contextual data sources
| Context | Source | Prop type | Description |
| ------- | ---------- | --------- | ----------- |
| View | View title | String |
| View | View rows | Slot |
## View row plugin
To build the display of each result:
- the rows instead of the table
- the sliders instead of the slides
- the point of interests instead of the map
- the pictures instead of the mosaic
Pick "Component" in the modal:
![](images/views-3.webp)
Select the component and fill the configuration form:
![](images/views-4.webp)
### Contextual data sources
| Context | Source | Prop type | Description |
| -------------- | ------------------- | --------- | ------------------------------------------ |
| View row | View title | String |
| View row | View field | Slot |
| Content entity | Data from a field | | Switch to a Field context. |
| Content entity | Entity link | URL |
| Content entity | Referenced entities | | Switch to an other Content entity context. |
# Using a component in Drupal templates
## Presenter templates
Presenter templates are standard Drupal templates that:
- transform data received from Drupal
- use Twig [include()](http://twig.sensiolabs.org/doc/function/include.html) function to include one or more components and pass the transformed data.
- should be totally free of markup
- use [theme suggestions](https://www.drupal.org/docs/8/theming/twig/twig-template-naming-conventions) to plug itself to data model
For example, a “normal” template has markup:
```twig
{% if subtitle %}
<h3 class="callout__subtitle">{{ subtitle }}</h3>
{% endif %}
```
But a presenter template has only a call to a component (and sometimes a bit of logic):
```twig
{{ include('my_theme:menu', {
'items': items,
'attributes': attributes.addClass('bg-primary'),
}, with_context=false)}}
```
Examples of presenter templates can be found on those folders:
- https://git.drupalcode.org/project/ui_suite_bootstrap/-/tree/5.1.x/templates
- https://git.drupalcode.org/project/ui_suite_daisyui/-/tree/4.0.x/templates
- https://git.drupalcode.org/project/ui_suite_dsfr/-/tree/1.1.x/templates
- https://git.drupalcode.org/project/ui_suite_material/-/tree/2.0.x/templates
- https://git.drupalcode.org/project/ui_suite_uswds/-/tree/4.0.x/templates
More about presenter templates:
- https://www.aleksip.net/presenting-component-projects (May 2016)
- https://www.mediacurrent.com/blog/accommodating-drupal-your-components/ (Broken link)
### Don’t use presenter templates when site building is possible
Presenter templates are a clever trick, however they hurt the site building because everything which is normally set in the display settings by the site builder has to be done in a Twig file by the developer.
However, there are some cases when site building is not easily possible. For examples:
- rendering a menu. Menu are config entities without configurable displays.
- rendering a content entity where the configurable display has no admin UI.
🚫 Don't do presenter templates when display building is available:
- Node: `/admin/structure/types/manage/{bundle}/display`
- BlockContent: `/admin/structure/block/block-content/manage/{bundle}/display`
- Comment: `/admin/structure/comment/manage/{bundle}/display`
- Media: `/admin/structure/media/manage/{bundle}/display`
- Taxonomy Term: `/admin/structure/taxonomy/manage/{bundle}/overview/display`
- User: `/admin/config/people/accounts/display`
- Views
✅ Presenter templates are OK for renderables without display building:
- Page layout: `page.html.twig` and `region.html.twig`
- Menu config entity: `menu.html.twig`
- ...
### Slots & props
Most of those templates have distinct variables for data to send to slots or props.
For example, in `node.html.twig`:
- `node` variable has the typed data to send to props
- `content` has the renderable data to send to slots
Other example, in `user.html.twig`:
- `user` variable has the typed data to send to props
- `content` has the renderable data to send to slots
## Clean default templates
Even without doing presenter templates, template overriding can be useful to clean some cruft from templates provided by core or contrib modules.
The node.html.twig template is a good example, because it carries a lot of legacy junk, like a title base field display condition based on view mode name (!) and a poor man submitted by.
It is better to keep those templates as lean as possible, and to push the complexity to layouts and other display modes plugins.
For example:
- `field.html.twig`
- `block.html.twig`
- `node.html.twig`
- `taxonomy-term.html.twig`
- `media.html.twig`
- `comment.html.twig`
- ...
Those templates content can be replaced by:
```twig
{% if attributes.storage() %}
<div{{ attributes }}>
{% endif %}
{{ content }}
{% if attributes.storage() %}
</div>
{% endif %}
```
Or sometimes, by more complex stuff like:
```twig
{% if attributes.storage() %}
<div{{ attributes }}>
{% endif %}
{{ title_prefix }}
{{ title_suffix }}
{{ content }}
{% if attributes.storage() %}
<div{{ content_attributes }}>
{% endif %}
{{ content }}
{% if attributes.storage() %}
</div>
{% endif %}
{% if attributes.storage() %}
</div>
{% endif %}
```
Some markup of components or some utilities style expect specific markup with direct children like flex feature. Currently when trying to use those components in lists the wrappers inside templates like field.html.twig and node.html.twig will interfere with the expected markup. So sometimes even the wrappers need to be removed with templates override.
Use the <a href="https://www.drupal.org/project/entity_vdts" rel="nofollow">Entity View Display Template Suggestions module</a> to be able to remove the wrapper of some entity displays. If the theme provides templates with bare minimum markup like just the "content" variable printed, for content entities with the module you will be able to remove the wrapper with configuration.