├── ui.apps ├── .eslintignore ├── .eslintrc ├── src │ └── content │ │ ├── jcr_root │ │ └── apps │ │ │ ├── contrib │ │ │ ├── wcm │ │ │ │ ├── .content.xml │ │ │ │ └── components │ │ │ │ │ ├── .content.xml │ │ │ │ │ ├── table │ │ │ │ │ ├── .content.xml │ │ │ │ │ └── v1 │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ └── table │ │ │ │ │ │ ├── _cq_htmlTag │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ ├── clientlibs │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ ├── css.txt │ │ │ │ │ │ └── style.less │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ ├── _cq_template │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ ├── sample-data │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── table.html │ │ │ │ │ │ ├── _cq_design_dialog │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ └── _cq_dialog │ │ │ │ │ │ └── .content.xml │ │ │ │ │ ├── test │ │ │ │ │ ├── .content.xml │ │ │ │ │ ├── test.html │ │ │ │ │ └── _cq_design_dialog │ │ │ │ │ │ └── .content.xml │ │ │ │ │ └── htmlcontainer │ │ │ │ │ ├── v1 │ │ │ │ │ ├── htmlcontainer │ │ │ │ │ │ ├── clientlibs │ │ │ │ │ │ │ ├── editor │ │ │ │ │ │ │ │ ├── js.txt │ │ │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ │ │ └── js │ │ │ │ │ │ │ │ │ └── htmlcontainer.js │ │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ ├── htmlcontainer.html │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ └── _cq_design_dialog │ │ │ │ │ │ │ └── .content.xml │ │ │ │ │ └── .content.xml │ │ │ │ │ └── .content.xml │ │ │ └── .content.xml │ │ │ └── .content.xml │ │ └── META-INF │ │ └── vault │ │ ├── filter.xml │ │ └── definition │ │ └── .content.xml ├── package.json └── .stylelintrc.yaml ├── bundle └── src │ ├── test │ ├── resources │ │ ├── htmlcontainer │ │ │ ├── sample.css │ │ │ ├── sample2.css │ │ │ ├── sample.js │ │ │ ├── sample2.js │ │ │ ├── sample.html │ │ │ ├── exporter-htmlcontainer2.txt │ │ │ ├── exporter-htmlcontainer.txt │ │ │ ├── test-content.json │ │ │ └── test-content2.json │ │ ├── table │ │ │ ├── test-content.csv │ │ │ ├── exporter-table.json │ │ │ └── test-content.json │ │ └── findbugs-exclude.xml │ └── java │ │ └── com │ │ └── adobe │ │ └── cq │ │ └── wcm │ │ └── contrib │ │ └── components │ │ ├── ModelsCommonsTest.java │ │ ├── models │ │ └── TestTest.java │ │ ├── internal │ │ └── services │ │ │ └── table │ │ │ ├── DefaultResourceProcessorTest.java │ │ │ └── CSVResourceProcessorTest.java │ │ ├── context │ │ └── ContribComponentsTestContext.java │ │ └── Utils.java │ └── main │ └── java │ └── com │ └── adobe │ └── cq │ └── wcm │ └── contrib │ └── components │ ├── models │ ├── package-info.java │ ├── Test.java │ ├── HTMLContainer.java │ └── Table.java │ ├── services │ └── table │ │ └── ResourceProcessor.java │ └── internal │ ├── services │ └── table │ │ ├── DefaultResourceProcessor.java │ │ └── CSVResourceProcessor.java │ └── models │ └── v1 │ └── TableImpl.java ├── webcomponents ├── example.customize │ ├── .babelrc │ ├── .eslintignore │ ├── src │ │ └── content │ │ │ ├── jcr_root │ │ │ └── apps │ │ │ │ ├── contrib │ │ │ │ ├── wcm │ │ │ │ │ ├── .content.xml │ │ │ │ │ └── example │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ └── customize │ │ │ │ │ │ └── .content.xml │ │ │ │ └── .content.xml │ │ │ │ └── .content.xml │ │ │ └── META-INF │ │ │ └── vault │ │ │ ├── filter.xml │ │ │ └── definition │ │ │ └── .content.xml │ ├── .eslintrc │ ├── tsconfig.json │ ├── ts │ │ └── index.ts │ ├── clientlib.config.js │ ├── webpack.config.js │ ├── package.json │ └── .stylelintrc.yaml ├── ui.frontend.litelement │ ├── .babelrc │ ├── .eslintignore │ ├── .eslintrc │ ├── src │ │ ├── index.ts │ │ └── components │ │ │ ├── image.ts │ │ │ ├── text.ts │ │ │ └── title.ts │ ├── tsconfig.json │ ├── clientlib.config.js │ ├── webpack.config.js │ ├── package.json │ ├── pom.xml │ └── .stylelintrc.yaml ├── ui.frontend.vanilla │ ├── .eslintignore │ ├── .eslintrc │ ├── src │ │ ├── index.js │ │ └── components │ │ │ └── title.js │ ├── webpack.config.js │ ├── package.json │ ├── clientlib.config.js │ ├── pom.xml │ └── .stylelintrc.yaml ├── ui.apps │ └── src │ │ └── content │ │ ├── jcr_root │ │ └── apps │ │ │ ├── contrib │ │ │ ├── wcm │ │ │ │ ├── .content.xml │ │ │ │ └── webcomponents │ │ │ │ │ ├── .content.xml │ │ │ │ │ ├── text │ │ │ │ │ ├── text.html │ │ │ │ │ └── .content.xml │ │ │ │ │ ├── image │ │ │ │ │ ├── .content.xml │ │ │ │ │ └── image.html │ │ │ │ │ └── title │ │ │ │ │ ├── .content.xml │ │ │ │ │ └── title.html │ │ │ └── .content.xml │ │ │ └── .content.xml │ │ └── META-INF │ │ └── vault │ │ ├── filter.xml │ │ └── definition │ │ └── .content.xml ├── README.md └── pom.xml ├── .gitignore ├── COPYRIGHT ├── README.md ├── .github └── workflows │ ├── maven-test-pull-request.yml │ └── settings.xml ├── CONTRIBUTING.md ├── .circleci └── config.yml ├── CODE_OF_CONDUCT.md └── all └── pom.xml /ui.apps/.eslintignore: -------------------------------------------------------------------------------- 1 | /node 2 | /node_modules 3 | /target 4 | -------------------------------------------------------------------------------- /bundle/src/test/resources/htmlcontainer/sample.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | color: red; 3 | } -------------------------------------------------------------------------------- /bundle/src/test/resources/htmlcontainer/sample2.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | color: red; 3 | } -------------------------------------------------------------------------------- /webcomponents/example.customize/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2017"] 3 | } -------------------------------------------------------------------------------- /webcomponents/ui.frontend.litelement/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2017"] 3 | } -------------------------------------------------------------------------------- /webcomponents/example.customize/.eslintignore: -------------------------------------------------------------------------------- 1 | /node 2 | /node_modules 3 | /target 4 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.vanilla/.eslintignore: -------------------------------------------------------------------------------- 1 | /node 2 | /node_modules 3 | /target 4 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.litelement/.eslintignore: -------------------------------------------------------------------------------- 1 | /node 2 | /node_modules 3 | /target 4 | -------------------------------------------------------------------------------- /bundle/src/test/resources/htmlcontainer/sample.js: -------------------------------------------------------------------------------- 1 | function changeColor() { 2 | let x = document.getElementById("heading"); 3 | x.style.color = "blue"; 4 | }; -------------------------------------------------------------------------------- /bundle/src/test/resources/htmlcontainer/sample2.js: -------------------------------------------------------------------------------- 1 | function changeColor() { 2 | let x = document.getElementById("heading"); 3 | x.style.color = "red"; 4 | }; -------------------------------------------------------------------------------- /bundle/src/test/resources/htmlcontainer/sample.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Hello World

5 | 6 | 7 | -------------------------------------------------------------------------------- /ui.apps/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "jquery": true 5 | }, 6 | "globals": { 7 | "Coral": false, 8 | "Granite": false 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /bundle/src/test/resources/table/test-content.csv: -------------------------------------------------------------------------------- 1 | email,name,gender,status 2 | test1@sample.com,test1,male,active 3 | test2@sample.com,test2,female,active 4 | test3@sample.com,test3,male,inactive 5 | test4@sample.com,test4,female,inactive 6 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /webcomponents/ui.apps/src/content/jcr_root/apps/contrib/wcm/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/table/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/table/v1/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /webcomponents/example.customize/src/content/jcr_root/apps/contrib/wcm/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /webcomponents/ui.apps/src/content/jcr_root/apps/contrib/wcm/webcomponents/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /webcomponents/example.customize/src/content/jcr_root/apps/contrib/wcm/example/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /webcomponents/example.customize/src/content/jcr_root/apps/contrib/wcm/example/customize/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /webcomponents/ui.apps/src/content/jcr_root/apps/contrib/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /webcomponents/example.customize/src/content/jcr_root/apps/contrib/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.vanilla/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "jquery": true, 5 | "es6": true 6 | }, 7 | "parserOptions": { 8 | "ecmaVersion": 2017 9 | }, 10 | "globals": { 11 | "Coral": false, 12 | "Granite": false 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/table/v1/table/_cq_htmlTag/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/test/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /webcomponents/example.customize/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "jquery": true, 5 | "es6": true 6 | }, 7 | "parserOptions": { 8 | "ecmaVersion": 2017, 9 | "sourceType": "module" 10 | }, 11 | "globals": { 12 | "Coral": false, 13 | "Granite": false 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.litelement/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "jquery": true, 5 | "es6": true 6 | }, 7 | "parserOptions": { 8 | "ecmaVersion": 2017, 9 | "sourceType": "module" 10 | }, 11 | "globals": { 12 | "Coral": false, 13 | "Granite": false 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/table/v1/table/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /webcomponents/ui.apps/src/content/jcr_root/apps/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /webcomponents/example.customize/src/content/jcr_root/apps/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/table/v1/table/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea 3 | .classpath 4 | .metadata 5 | .project 6 | .settings 7 | .externalToolBuilders 8 | maven-eclipse.xml 9 | *.swp 10 | *.iml 11 | *.ipr 12 | *.iws 13 | *.bak 14 | .vlt 15 | .DS_Store 16 | jcr.log 17 | atlassian-ide-plugin.xml 18 | .vlt-sync.log 19 | .vlt-sync-config.properties 20 | node 21 | node_modules 22 | dist 23 | /webcomponents/ui.apps/src/content/jcr_root/apps/contrib/wcm/webcomponents/clientlibs/* 24 | /webcomponents/example.customize/src/content/jcr_root/apps/contrib/wcm/example/customize/clientlibs/* 25 | -------------------------------------------------------------------------------- /bundle/src/test/resources/table/exporter-table.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "table-b6492c2cdc", 3 | "description": "This is sample Table Description", 4 | "ariaLabel": "Sample Table", 5 | "items": [], 6 | "formattedHeaderNames": [ 7 | "email", 8 | "firstName", 9 | "gender", 10 | "title" 11 | ], 12 | "dataLayerText": "This is sample Table Description", 13 | ":type": "core/wcm/components/table/v1/table", 14 | "dataLayer": { 15 | "table-b6492c2cdc": { 16 | "@type": "core/wcm/components/table/v1/table" 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/table/v1/table/_cq_template/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright 2019 Adobe 2 | 3 | Adobe holds the copyright for all the files found in this repository. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. -------------------------------------------------------------------------------- /bundle/src/test/resources/htmlcontainer/exporter-htmlcontainer2.txt: -------------------------------------------------------------------------------- 1 | 3 |

Hello World

5 | 7 | -------------------------------------------------------------------------------- /bundle/src/test/resources/htmlcontainer/exporter-htmlcontainer.txt: -------------------------------------------------------------------------------- 1 | 3 |

Hello World

5 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/table/v1/table/sample-data/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | 16 | 22 | 23 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.vanilla/src/index.js: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | "use strict"; 17 | 18 | require("./components/title.js") 19 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/table/v1/table/clientlibs/css.txt: -------------------------------------------------------------------------------- 1 | 16 | style.less 17 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/htmlcontainer/v1/htmlcontainer/clientlibs/editor/js.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright 2021 Adobe 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | ############################################################################### 16 | 17 | #base=js 18 | htmlcontainer.js 19 | -------------------------------------------------------------------------------- /bundle/src/test/resources/findbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.litelement/src/index.ts: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | "use strict"; 17 | 18 | import "./components/title"; 19 | import "./components/text"; 20 | import "./components/image"; 21 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/test/test.html: -------------------------------------------------------------------------------- 1 | 16 | This is a test: ${resource.path} - ${test.test} -------------------------------------------------------------------------------- /ui.apps/src/content/META-INF/vault/filter.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /webcomponents/ui.apps/src/content/META-INF/vault/filter.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /webcomponents/example.customize/src/content/META-INF/vault/filter.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.vanilla/webpack.config.js: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | const path = require('path'); 17 | 18 | module.exports = { 19 | entry: './src/index.js', 20 | output: { 21 | filename: 'main.js', 22 | path: path.resolve(__dirname, 'dist'), 23 | }, 24 | }; -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/htmlcontainer/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/htmlcontainer/v1/htmlcontainer/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/htmlcontainer/v1/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /webcomponents/README.md: -------------------------------------------------------------------------------- 1 | # AEM WCM Core Web Components 2 | 3 | This is a [Web Components](https://www.webcomponents.org/) implementation of [AEM WCM Core Components](https://github.com/adobe/aem-core-wcm-components) using custom elements for the markup and allowing client-side overlay of generated markup and CSS/JavaScript. 4 | 5 | The custom elements markup is defined in the [ui.apps](./ui.apps) module. 6 | 7 | The clientside Web Components are defined in: 8 | * [ui.frontend.vanilla](./ui.frontent.vanilla) - Vanilla JavaScript implementation 9 | * [ui.frontend.litelement](./ui.frontend.litelement) - [LitElement](https://lit-element.polymer-project.org/) based implementation 10 | 11 | The default implementations are packaged as clientlibs that can be included in a project, using the following categories: 12 | 13 | * `contrib.wcm.webcomponents.vanilla` - for the Vanilla Javascript implementation 14 | * `contrib.wcm.webcomponents.litelement` - for the LitElement-based implementation 15 | 16 | Individual components are exported by each module and can be imported, customized and assembled in project-specific clientlibs. -------------------------------------------------------------------------------- /webcomponents/ui.frontend.litelement/tsconfig.json: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | { 17 | "compilerOptions": { 18 | "outDir": "./dist/", 19 | "noImplicitAny": true, 20 | "target": "es2017", 21 | "module": "es2015", 22 | "jsx": "react", 23 | "allowJs": true, 24 | "experimentalDecorators": true 25 | } 26 | } -------------------------------------------------------------------------------- /bundle/src/main/java/com/adobe/cq/wcm/contrib/components/models/package-info.java: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2019 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | /** 17 | * This package defines the Sling Models exposed by the Adobe Experience Manager Contrib WCM Components Bundle. 18 | */ 19 | @Version("1.0.0") 20 | package com.adobe.cq.wcm.contrib.components.models; 21 | 22 | import org.osgi.annotation.versioning.Version; 23 | 24 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/table/v1/table/clientlibs/style.less: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Adobe 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | .cmp-table { 17 | .cmp-table__rowgroup { 18 | .cmp-table__rowgroup-row { 19 | .cmp-table__rowgroup-row-columnheader { 20 | text-transform: uppercase; 21 | background-color: #d6d6d6; 22 | } 23 | } 24 | 25 | .cmp-table__rowgroup-row-data:nth-child(even) { 26 | background-color: #f2f2f2; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ui.apps/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.adobe.cq.contrib.wcm.components.ui.apps", 3 | "version": "0.0.1-SNAPSHOT", 4 | "description": "Adobe Experience Manager WCM Components Community Contributions Apps Package", 5 | "license": "Apache-2.0", 6 | "private": false, 7 | "homepage": "https://github.com/adobe/aem-core-wcm-components-contrib", 8 | "repository": { 9 | "type": "git", 10 | "url": "https://github.com/adobe/aem-core-wcm-components-contrib" 11 | }, 12 | "scripts": { 13 | "aemfed": "aemfed -e \"**/*___jb_+(old|tmp)___\" -w \"src/content/jcr_root/\"", 14 | "eslint": "eslint .", 15 | "eslint:fix": "eslint . --fix", 16 | "lint": "npm-run-all --parallel eslint stylelint", 17 | "stylelint": "stylelint '**/*.css' '**/*.less'", 18 | "stylelint:fix": "stylelint '**/*.css' '**/*.less' --fix" 19 | }, 20 | "devDependencies": { 21 | "aemfed": "^0.1.1", 22 | "eslint": "^4.19.1", 23 | "npm-run-all": "^4.1.5", 24 | "stylelint": "^9.10.1", 25 | "stylelint-config-recommended": "^2.1.0", 26 | "stylelint-selector-bem-pattern": "^2.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /webcomponents/example.customize/tsconfig.json: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | { 17 | "compilerOptions": { 18 | "outDir": "./dist/", 19 | "noImplicitAny": true, 20 | "target": "es2017", 21 | "module": "es2015", 22 | "jsx": "react", 23 | "allowJs": true, 24 | "experimentalDecorators": true, 25 | "strictFunctionTypes": false, 26 | "strictBindCallApply": false 27 | } 28 | } -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/table/v1/table/README.md: -------------------------------------------------------------------------------- 1 | Table (v1) 2 | ==== 3 | Table component written in HTL that displays a Table from selected source. 4 | 5 | ## Features 6 | * Displays a table on the page with the Title element. 7 | * CSV file and Resource Child node support 8 | * Style System support. 9 | 10 | ### Use Object 11 | The Table component uses the `com.adobe.cq.wcm.core.components.models.Table` Sling model as its Use-object. 12 | 13 | ### Component Policy Configuration Properties 14 | The following JCR properties are used: 15 | 16 | ### Edit Dialog Properties 17 | The following configuration properties are used: 18 | 1. `./id` - defines the component HTML ID attribute. 19 | 2. `./source` - defines source resource for table content 20 | 3. `./headerNames` - defines the table headers 21 | 4. `./description` - defines title for table 22 | 23 | ## BEM Description 24 | ``` 25 | BLOCK cmp-table 26 | ELEMENT cmp-table__description 27 | ELEMENT cmp-table__rowgroup 28 | ELEMENT cmp-table__rowgroup-row-headers 29 | ELEMENT cmp-table__rowgroup-row-columnheader 30 | ELEMENT cmp-table__rowgroup-row-data 31 | ELEMENT cmp-table__rowgroup-row-cell 32 | ``` 33 | 34 | -------------------------------------------------------------------------------- /webcomponents/example.customize/ts/index.ts: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | "use strict"; 17 | 18 | import {Title} from "../../ui.frontend.litelement/src/components/title"; 19 | import {html} from "../../ui.frontend.litelement/node_modules/lit-element"; 20 | 21 | Title.prototype.render = function() { 22 | return html` 23 |
This used to be a ${this.heading} 24 | ${this.innerHTML} 25 |
26 | `; 27 | } -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/htmlcontainer/v1/htmlcontainer/clientlibs/editor/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 21 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/htmlcontainer/v1/htmlcontainer/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | -------------------------------------------------------------------------------- /ui.apps/src/content/META-INF/vault/definition/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.litelement/src/components/image.ts: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | "use strict"; 17 | import { LitElement, html, property, customElement } from "lit-element"; 18 | import { unsafeHTML } from 'lit-html/directives/unsafe-html'; 19 | 20 | @customElement("cmp-img") 21 | export class Image extends LitElement { 22 | @property() src = ""; 23 | @property() alt = ""; 24 | 25 | render() { 26 | return html`${this.alt}`; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /webcomponents/ui.apps/src/content/META-INF/vault/definition/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.litelement/src/components/text.ts: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | "use strict"; 17 | import { LitElement, html, property, customElement } from "lit-element"; 18 | import { unsafeHTML } from 'lit-html/directives/unsafe-html'; 19 | 20 | @customElement("cmp-text") 21 | export class Text extends LitElement { 22 | @property() isRichText = true; 23 | 24 | render() { 25 | const template = `

${this.innerHTML}

`; 26 | return html`${unsafeHTML(template)}`; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /webcomponents/example.customize/src/content/META-INF/vault/definition/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | -------------------------------------------------------------------------------- /webcomponents/ui.apps/src/content/jcr_root/apps/contrib/wcm/webcomponents/text/text.html: -------------------------------------------------------------------------------- 1 | 16 | ${text.text @ context = text.isRichText ? 'html' : 'text'} 20 | 21 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.litelement/src/components/title.ts: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | "use strict"; 17 | import { LitElement, html, property, customElement } from "lit-element"; 18 | import { unsafeHTML } from 'lit-html/directives/unsafe-html'; 19 | 20 | @customElement("cmp-title") 21 | export class Title extends LitElement { 22 | @property() heading = "h1"; 23 | 24 | render() { 25 | const template = `<${this.heading}>${this.innerHTML}`; 26 | return html`${unsafeHTML(template)}`; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /bundle/src/test/java/com/adobe/cq/wcm/contrib/components/ModelsCommonsTest.java: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | package com.adobe.cq.wcm.contrib.components; 17 | 18 | import com.adobe.cq.wcm.core.components.testing.AbstractModelTest; 19 | import org.junit.jupiter.api.Test; 20 | 21 | public class ModelsCommonsTest extends AbstractModelTest { 22 | 23 | @Test 24 | public void testDefaultBehaviour() throws Exception { 25 | testDefaultBehaviour(new String[] { 26 | "com.adobe.cq.wcm.contrib.components.models" 27 | }); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /webcomponents/ui.apps/src/content/jcr_root/apps/contrib/wcm/webcomponents/text/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 24 | -------------------------------------------------------------------------------- /webcomponents/ui.apps/src/content/jcr_root/apps/contrib/wcm/webcomponents/image/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 24 | -------------------------------------------------------------------------------- /webcomponents/ui.apps/src/content/jcr_root/apps/contrib/wcm/webcomponents/title/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 24 | -------------------------------------------------------------------------------- /webcomponents/ui.apps/src/content/jcr_root/apps/contrib/wcm/webcomponents/title/title.html: -------------------------------------------------------------------------------- 1 | 16 | ${title.text} 22 | 23 | -------------------------------------------------------------------------------- /webcomponents/ui.apps/src/content/jcr_root/apps/contrib/wcm/webcomponents/image/image.html: -------------------------------------------------------------------------------- 1 | 16 | 23 | 24 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/htmlcontainer/v1/htmlcontainer/htmlcontainer.html: -------------------------------------------------------------------------------- 1 | 16 |
21 | ${htmlcontainer.includes @ context='unsafe'} 22 |
23 | 24 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.vanilla/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.adobe.cq.contrib.wcm.webcomponents.ui.frontend.vanilla", 3 | "version": "0.0.1-SNAPSHOT", 4 | "description": "Adobe Experience Manager WCM Components Community Contributions Apps Package", 5 | "license": "Apache-2.0", 6 | "private": false, 7 | "homepage": "https://github.com/adobe/aem-core-wcm-components-contrib", 8 | "repository": { 9 | "type": "git", 10 | "url": "https://github.com/adobe/aem-core-wcm-components-contrib" 11 | }, 12 | "main": "index.js", 13 | "scripts": { 14 | "eslint": "eslint .", 15 | "eslint:fix": "eslint . --fix", 16 | "lint": "npm-run-all --parallel eslint stylelint", 17 | "stylelint": "stylelint '**/*.css' '**/*.less'", 18 | "stylelint:fix": "stylelint '**/*.css' '**/*.less' --fix", 19 | "sync-pom-version": "sync-pom-version", 20 | "build": "webpack && clientlib --verbose" 21 | }, 22 | "devDependencies": { 23 | "webpack": "^5.76.0", 24 | "webpack-cli": "^4.5.0", 25 | "aem-clientlib-generator": "^1.7.2", 26 | "eslint": "^4.19.1", 27 | "npm-run-all": "^4.1.5", 28 | "stylelint": "^9.10.1", 29 | "stylelint-config-recommended": "^2.1.0", 30 | "stylelint-selector-bem-pattern": "^2.0.0", 31 | "sync-pom-version-to-package": "^1.6.0" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /bundle/src/test/java/com/adobe/cq/wcm/contrib/components/models/TestTest.java: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2019 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | package com.adobe.cq.wcm.contrib.components.models; 17 | 18 | 19 | import org.junit.jupiter.api.Assertions; 20 | import org.junit.jupiter.api.Test; 21 | 22 | public class TestTest { 23 | 24 | @Test 25 | public void testAll() { 26 | com.adobe.cq.wcm.contrib.components.models.Test test = new com.adobe.cq.wcm.contrib.components.models.Test(); 27 | Assertions.assertEquals(com.adobe.cq.wcm.contrib.components.models.Test.TEST, test.getTest()); 28 | Assertions.assertEquals(com.adobe.cq.wcm.contrib.components.models.Test.RT, test.getExportedType()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.vanilla/clientlib.config.js: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | /* global 17 | module, __dirname 18 | */ 19 | module.exports = { 20 | context: __dirname, 21 | clientLibRoot: "../ui.apps/src/content/jcr_root/apps/contrib/wcm/webcomponents/clientlibs", 22 | libs: [ 23 | { 24 | name: "contrib.wcm.webcomponents.vanilla", 25 | serializationFormat: "xml", 26 | allowProxy: true, 27 | jsProcessor: ["default:none", "min:gcc;compilationLevel=whitespace"], 28 | assets: { 29 | js: [ 30 | "dist/main.js" 31 | ] 32 | } 33 | } 34 | ] 35 | }; 36 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.litelement/clientlib.config.js: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | /* global 17 | module, __dirname 18 | */ 19 | module.exports = { 20 | context: __dirname, 21 | clientLibRoot: "../ui.apps/src/content/jcr_root/apps/contrib/wcm/webcomponents/clientlibs", 22 | libs: [ 23 | { 24 | name: "contrib.wcm.webcomponents.litelement", 25 | serializationFormat: "xml", 26 | allowProxy: true, 27 | jsProcessor: ["default:none", "min:gcc;compilationLevel=whitespace"], 28 | assets: { 29 | js: [ 30 | "dist/main.js" 31 | ] 32 | } 33 | } 34 | ] 35 | }; 36 | -------------------------------------------------------------------------------- /webcomponents/example.customize/clientlib.config.js: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | /* global 17 | module, __dirname 18 | */ 19 | module.exports = { 20 | context: __dirname, 21 | clientLibRoot: "./src/content/jcr_root/apps/contrib/wcm/example/customize/clientlibs", 22 | libs: [ 23 | { 24 | name: "contrib.wcm.webcomponents.example.customize", 25 | serializationFormat: "xml", 26 | allowProxy: true, 27 | jsProcessor: ["default:none", "min:gcc;compilationLevel=whitespace;languageIn=ECMASCRIPT_2015"], 28 | assets: { 29 | js: [ 30 | "dist/main.js" 31 | ] 32 | } 33 | } 34 | ] 35 | }; 36 | -------------------------------------------------------------------------------- /bundle/src/main/java/com/adobe/cq/wcm/contrib/components/services/table/ResourceProcessor.java: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | package com.adobe.cq.wcm.contrib.components.services.table; 17 | 18 | import org.apache.sling.api.resource.Resource; 19 | import org.jetbrains.annotations.NotNull; 20 | 21 | import java.io.IOException; 22 | import java.util.List; 23 | 24 | /** 25 | * A service which process data based on mime type 26 | * 27 | * @since com.adobe.cq.wcm.core.components.services.table.ResourceProcess 12.10.0 28 | */ 29 | public interface ResourceProcessor { 30 | List> processData(@NotNull Resource resource, String[] propertyNames) throws IOException; 31 | 32 | boolean canProcess(String mimeType); 33 | } 34 | -------------------------------------------------------------------------------- /webcomponents/example.customize/webpack.config.js: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | const path = require('path'); 17 | 18 | module.exports = { 19 | entry: './ts/index.ts', 20 | module: { 21 | rules: [ 22 | { 23 | test: /\.tsx?$/, 24 | use: 'ts-loader', 25 | exclude: /node_modules/, 26 | }, 27 | ], 28 | }, 29 | resolve: { 30 | extensions: [ '.tsx', '.ts', '.js' ], 31 | }, 32 | output: { 33 | filename: 'main.js', 34 | // library: 'com.adobe.cq.contrib.wcm.webcomponents.ui.frontend.litelement', 35 | // libraryTarget: 'commonjs2', 36 | path: path.resolve(__dirname, 'dist'), 37 | }, 38 | optimization: { 39 | minimize: false 40 | } 41 | }; -------------------------------------------------------------------------------- /webcomponents/ui.frontend.litelement/webpack.config.js: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | const path = require('path'); 17 | 18 | module.exports = { 19 | entry: './src/index.ts', 20 | module: { 21 | rules: [ 22 | { 23 | test: /\.tsx?$/, 24 | use: 'ts-loader', 25 | exclude: /node_modules/, 26 | }, 27 | ], 28 | }, 29 | resolve: { 30 | extensions: [ '.tsx', '.ts', '.js' ], 31 | }, 32 | output: { 33 | filename: 'main.js', 34 | // library: 'com.adobe.cq.contrib.wcm.webcomponents.ui.frontend.litelement', 35 | // libraryTarget: 'commonjs2', 36 | path: path.resolve(__dirname, 'dist'), 37 | }, 38 | optimization: { 39 | minimize: false 40 | } 41 | }; -------------------------------------------------------------------------------- /bundle/src/main/java/com/adobe/cq/wcm/contrib/components/models/Test.java: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2019 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | package com.adobe.cq.wcm.contrib.components.models; 17 | 18 | import org.apache.sling.api.SlingHttpServletRequest; 19 | import org.apache.sling.models.annotations.Model; 20 | 21 | import com.adobe.cq.export.json.ComponentExporter; 22 | import com.fasterxml.jackson.annotation.JsonInclude; 23 | 24 | @Model(adaptables = SlingHttpServletRequest.class) 25 | public class Test implements ComponentExporter { 26 | 27 | static final String TEST = "test"; 28 | static final String RT = "contrib/wcm/components/test"; 29 | 30 | @JsonInclude 31 | public String getTest() { 32 | return TEST; 33 | } 34 | 35 | @Override 36 | public String getExportedType() { 37 | return RT; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /webcomponents/example.customize/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.adobe.cq.contrib.wcm.webcomponents.example.customize", 3 | "version": "0.0.1-SNAPSHOT", 4 | "description": "Adobe Experience Manager WCM Components Community Contributions Apps Package", 5 | "license": "Apache-2.0", 6 | "private": false, 7 | "homepage": "https://github.com/adobe/aem-core-wcm-components-contrib", 8 | "repository": { 9 | "type": "git", 10 | "url": "https://github.com/adobe/aem-core-wcm-components-contrib" 11 | }, 12 | "main": "index.js", 13 | "scripts": { 14 | "eslint": "eslint .", 15 | "eslint:fix": "eslint . --fix", 16 | "lint": "npm-run-all --parallel eslint stylelint", 17 | "stylelint": "stylelint '**/*.css' '**/*.less'", 18 | "stylelint:fix": "stylelint '**/*.css' '**/*.less' --fix", 19 | "sync-pom-version": "sync-pom-version", 20 | "build": "webpack && clientlib --verbose" 21 | }, 22 | "devDependencies": { 23 | "aem-clientlib-generator": "^1.7.2", 24 | "babel-preset-es2017": "^6.24.1", 25 | "eslint": "^4.19.1", 26 | "npm-run-all": "^4.1.5", 27 | "stylelint": "^9.10.1", 28 | "stylelint-config-recommended": "^2.1.0", 29 | "stylelint-selector-bem-pattern": "^2.0.0", 30 | "sync-pom-version-to-package": "^1.6.0", 31 | "ts-loader": "^8.0.14", 32 | "typescript": "^4.1.3", 33 | "webpack": "^5.76.0", 34 | "webpack-cli": "^4.5.0" 35 | }, 36 | "dependencies": { 37 | "lit-element": "^2.4.0" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.litelement/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.adobe.cq.contrib.wcm.webcomponents.ui.frontend.litelement", 3 | "version": "0.0.1-SNAPSHOT", 4 | "description": "Adobe Experience Manager WCM Components Community Contributions Apps Package", 5 | "license": "Apache-2.0", 6 | "private": false, 7 | "homepage": "https://github.com/adobe/aem-core-wcm-components-contrib", 8 | "repository": { 9 | "type": "git", 10 | "url": "https://github.com/adobe/aem-core-wcm-components-contrib" 11 | }, 12 | "main": "index.js", 13 | "scripts": { 14 | "eslint": "eslint .", 15 | "eslint:fix": "eslint . --fix", 16 | "lint": "npm-run-all --parallel eslint stylelint", 17 | "stylelint": "stylelint '**/*.css' '**/*.less'", 18 | "stylelint:fix": "stylelint '**/*.css' '**/*.less' --fix", 19 | "sync-pom-version": "sync-pom-version", 20 | "build": "webpack && clientlib --verbose" 21 | }, 22 | "devDependencies": { 23 | "aem-clientlib-generator": "^1.7.2", 24 | "babel-preset-es2017": "^6.24.1", 25 | "eslint": "^4.19.1", 26 | "npm-run-all": "^4.1.5", 27 | "stylelint": "^9.10.1", 28 | "stylelint-config-recommended": "^2.1.0", 29 | "stylelint-selector-bem-pattern": "^2.0.0", 30 | "sync-pom-version-to-package": "^1.6.0", 31 | "ts-loader": "^8.0.14", 32 | "typescript": "^4.1.3", 33 | "webpack": "^5.76.0", 34 | "webpack-cli": "^4.5.0" 35 | }, 36 | "dependencies": { 37 | "lit-element": "^2.4.0" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Tests](https://github.com/adobe/aem-contrib-wcm-components/actions/workflows/maven-test-pull-request.yml/badge.svg)](https://github.com/adobe/aem-contrib-wcm-components/actions/workflows/maven-test-pull-request.yml) [![codecov](https://codecov.io/gh/adobe/aem-contrib-wcm-components/branch/master/graph/badge.svg)](https://codecov.io/gh/adobe/aem-contrib-wcm-components) 2 | 3 | 4 | # AEM WCM Components - Community Contributions 5 | 6 | This repository was created to allow community contributions for AEM WCM Components to be shared and tested, before they would be integrated into the [Core Components](https://github.com/adobe/aem-core-wcm-components/). 7 | 8 | This is a good place to submit your ideas and have them reviewed by the community. It's also a good place for quick iterations. Once an idea matures and starts being used, we will consider it for inclusion into the Core Components. 9 | 10 | ## Active Projects 11 | 12 | * [React Core Component – beta proposal](https://github.com/adobe/aem-contrib-wcm-components/tree/feature/react-wrapper/react/react-core) 13 | 14 | ## Mailing List 15 | 16 | For discussions and Q&A, you can use our public mailing list hosted on [googlegroups.com](https://groups.google.com/forum/#!forum/aem-core-components-dev). 17 | You can also subscribe via Email [aem-core-components-dev+subscribe@googlegroups.com](mailto:aem-core-components-dev+subscribe@googlegroups.com). 18 | 19 | ## Contributing 20 | 21 | Contributions are welcome! Read the [Contributing Guide](CONTRIBUTING.md) for more information. 22 | 23 | ### Licensing 24 | 25 | This project is licensed under the Apache V2 License. See [LICENSE](LICENSE) for more information. 26 | 27 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.vanilla/src/components/title.js: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | "use strict"; 17 | 18 | class Title extends HTMLElement { 19 | 20 | constructor() { 21 | // Always call super first in constructor 22 | super(); 23 | 24 | // Element functionality written in here 25 | 26 | // Create a shadow root 27 | const shadow = this.attachShadow({mode: "closed"}); // sets and returns 'this.shadowRoot' 28 | 29 | shadow.append(this.markup(this.getAttribute("data-cmp-title-heading"), this.innerHTML, this.getAttribute("data-cmp-title-link"))); 30 | } 31 | 32 | // Create heading element 33 | markup(heading, text, link) { 34 | const element = document.createElement(heading || "h1"); 35 | if (link) { 36 | const link = document.createElement("a"); 37 | link.setAttribute("href", link); 38 | link.innerHTML = text; 39 | element.append(link); 40 | } else { 41 | element.innerHTML = text; 42 | } 43 | return element; 44 | } 45 | } 46 | 47 | customElements.define("cmp-title", Title); 48 | 49 | module.exports = Title; -------------------------------------------------------------------------------- /.github/workflows/maven-test-pull-request.yml: -------------------------------------------------------------------------------- 1 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | # Copyright 2021 Adobe Systems Incorporated 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 16 | 17 | name: Test (pull request) 18 | 19 | on: 20 | pull_request: 21 | workflow_dispatch: 22 | push: 23 | 24 | jobs: 25 | build: 26 | 27 | runs-on: ${{ matrix.os }} 28 | strategy: 29 | matrix: 30 | os: [ ubuntu-latest ] 31 | java: [8, 11] 32 | profile: [ '', '-Padobe-public'] 33 | 34 | steps: 35 | # Check out Git repository 36 | - name: Checkout code 37 | uses: actions/checkout@v2 38 | 39 | # Set up environment with Java and Maven 40 | - name: Setup JDK 41 | uses: actions/setup-java@v1 42 | with: 43 | java-version: ${{ matrix.java }} 44 | 45 | # Set up dependency cache 46 | - name: Cache local Maven repository 47 | uses: actions/cache@v2 48 | with: 49 | path: ~/.m2/repository 50 | key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} 51 | restore-keys: | 52 | ${{ runner.os }}-maven- 53 | 54 | # Build & Test 55 | - name: Build & Test with Maven 56 | run: mvn -B -U clean install ${{ matrix.profile }} -s ./.github/workflows/settings.xml 57 | 58 | # Run code coverage check 59 | - name: Run core coverage check 60 | run: bash <(curl -s https://codecov.io/bash) 61 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/table/v1/table/table.html: -------------------------------------------------------------------------------- 1 | 16 |
25 |
${table.description}
28 |
29 |
31 | 33 | ${headerName} 34 | 35 |
36 |
37 |
38 |
39 | 40 | ${item} 41 | 42 |
43 |
44 |
-------------------------------------------------------------------------------- /bundle/src/test/resources/table/test-content.json: -------------------------------------------------------------------------------- 1 | { 2 | "table": { 3 | "jcr:primaryType": "cq:Page", 4 | "jcr:content": { 5 | "jcr:primaryType": "cq:PageContent", 6 | "jcr:title": "Table Test", 7 | "sling:resourceType": "core/wcm/components/page/v2/page", 8 | "jcr:description": "Table description", 9 | "root": { 10 | "jcr:primaryType": "nt:unstructured", 11 | "sling:resourceType": "wcm/foundation/components/responsivegrid", 12 | "responsivegrid": { 13 | "jcr:primaryType": "nt:unstructured", 14 | "sling:resourceType": "wcm/foundation/components/responsivegrid", 15 | "table-1": { 16 | "jcr:primaryType": "nt:unstructured", 17 | "sling:resourceType": "core/wcm/components/table/v1/table", 18 | "headerNames": ["email","firstName","gender","jcr:title"], 19 | "description": "This is sample Table Description", 20 | "source": "/content/dam/test.csv", 21 | "ariaLabel": "Sample Table", 22 | "item-1": { 23 | "jcr:primaryType": "nt:unstructured", 24 | "jcr:title": "Active-1", 25 | "email": "sample1@sample.com", 26 | "firstName": "sample-1", 27 | "gender": "male", 28 | "sling:resourceType": "core/wcm/components/text/v1/text" 29 | }, 30 | "item-2": { 31 | "jcr:primaryType": "nt:unstructured", 32 | "jcr:title": "Active-2", 33 | "email": "sample2@sample.com", 34 | "firstName": "sample-2", 35 | "gender": "female", 36 | "sling:resourceType": "core/wcm/components/text/v1/text" 37 | }, 38 | "item-3": { 39 | "jcr:primaryType": "nt:unstructured", 40 | "jcr:title": "Active-3", 41 | "email": "sample3@sample.com", 42 | "firstName": "sample-3", 43 | "gender": "male", 44 | "sling:resourceType": "core/wcm/components/text/v1/text" 45 | } 46 | } 47 | } 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/table/v1/table/_cq_design_dialog/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 14 | 15 | 19 | 23 | 24 | 27 | 28 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/test/_cq_design_dialog/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 26 | 27 | 31 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /.github/workflows/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | ossrh 18 | 19 | true 20 | 21 | 22 | ossrh 23 | https://oss.sonatype.org/service/local/staging/deploy/maven2/ 24 | ossrh 25 | https://oss.sonatype.org/content/repositories/snapshots 26 | github 27 | gpg 28 | ${env.GPG_PASSPHRASE} 29 | 30 | 31 | 32 | 33 | 34 | 35 | ossrh 36 | ${env.SONATYPE_USERNAME} 37 | ${env.SONATYPE_PASSWORD} 38 | 39 | 40 | github 41 | ${env.X_GITHUB_USERNAME} 42 | ${env.X_GITHUB_PASSWORD} 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thanks for choosing to contribute! 4 | 5 | The following are a set of guidelines to follow when contributing to this project. 6 | 7 | ## Code Of Conduct 8 | 9 | This project adheres to the Adobe [code of conduct](../CODE_OF_CONDUCT.md). By participating, 10 | you are expected to uphold this code. Please report unacceptable behavior to 11 | [Grp-opensourceoffice@adobe.com](mailto:Grp-opensourceoffice@adobe.com). 12 | 13 | ## Have A Question? 14 | 15 | Start by filing an issue. The existing committers on this project work to reach 16 | consensus around project direction and issue solutions within issue threads 17 | (when appropriate). 18 | 19 | ## Contributor License Agreement 20 | 21 | All third-party contributions to this project must be accompanied by a signed contributor 22 | license agreement. This gives Adobe permission to redistribute your contributions 23 | as part of the project. [Sign our CLA](https://opensource.adobe.com/cla.html). You 24 | only need to submit an Adobe CLA one time, so if you have submitted one previously, 25 | you are good to go! 26 | 27 | ## Code Reviews 28 | 29 | All submissions should come in the form of pull requests and need to be reviewed 30 | by project committers. Read [GitHub's pull request documentation](https://help.github.com/articles/about-pull-requests/) 31 | for more information on sending pull requests. 32 | 33 | ## From Contributor To Committer 34 | 35 | We love contributions from our community! If you'd like to go a step beyond contributor 36 | and become a committer with full write access and a say in the project, you must 37 | be invited to the project. The existing committers employ an internal nomination 38 | process that must reach lazy consensus (silence is approval) before invitations 39 | are issued. If you feel you are qualified and want to get more deeply involved, 40 | feel free to reach out to existing committers to have a conversation about that. 41 | 42 | ## Security Issues 43 | 44 | Security issues shouldn't be reported on this issue tracker. Instead, [file an issue to our security experts](https://helpx.adobe.com/security/alertus.html). 45 | 46 | ## Ways of Contributing 47 | 48 | Please also review the [Core Components Contributing Guide](https://github.com/adobe/aem-core-wcm-components/blob/master/CONTRIBUTING.md#ways-of-contributing)! 49 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/htmlcontainer/v1/htmlcontainer/README.md: -------------------------------------------------------------------------------- 1 | 16 | 17 | HTML Container (v1) 18 | ==== 19 | HTML Container component written in HTL that displays the contents of the selected HTML file using the provided CSS and JS. 20 | 21 | ## Features 22 | * Allows authors to use arbitrary HTML and required CSS and JS files. 23 | * Requires the files to be placed into the DAM to enforce some element of code review and checkin (i.e. peer review before placing into the DAM). 24 | * Multiple CSS and JS files are supported, but only one HTML file is supported per HTML Container Component. 25 | * CSS files support "inline" and "reference" inclusion capability. 26 | * JS files support "async", "inline", "defer", and "reference" inclusion capability. 27 | 28 | ### Use Object 29 | The HTML Container component uses the `com.adobe.cq.wcm.contrib.components.models.HTMLContainer` Sling model as its Use-object. 30 | 31 | ### Edit dialog properties 32 | The following JCR properties are used: 33 | 34 | 1. `./includeType` - defines how CSS or JS files are included, i.e. async (JS), defer (JS), inline (CSS, JS), reference (CSS, JS). 35 | 2. `./htmlFile` - the full path to the HTML file. 36 | 3. `./fileName` - Used in multifield elements for CSS and JS tabs, the full path to the CSS, or JS file. 37 | 4. `./id` - defines the component HTML ID attribute. 38 | 39 | Error checking is provided to ensure only CSS files are included on the CSS tab, HTML files on the HTML tab, and JS files on the JS tab. 40 | 41 | Files are included in CSS, HTML, JS order with appropriate script and style tags inserted. HTML has no additional tags added. The HTML should not have head or body tags. 42 | 43 | 44 | ## Information 45 | * **Vendor**: Adobe 46 | * **Version**: v1 47 | * **Compatibility**: AEM 6.5 48 | * **Status**: community-contributed -------------------------------------------------------------------------------- /bundle/src/main/java/com/adobe/cq/wcm/contrib/components/internal/services/table/DefaultResourceProcessor.java: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | package com.adobe.cq.wcm.contrib.components.internal.services.table; 17 | 18 | import com.adobe.cq.wcm.contrib.components.services.table.ResourceProcessor; 19 | import org.apache.commons.lang3.StringUtils; 20 | import org.apache.sling.api.resource.Resource; 21 | import org.apache.sling.api.resource.ValueMap; 22 | import org.jetbrains.annotations.NotNull; 23 | import org.osgi.service.component.annotations.Component; 24 | 25 | import java.util.ArrayList; 26 | import java.util.Arrays; 27 | import java.util.List; 28 | import java.util.stream.StreamSupport; 29 | 30 | import static java.util.stream.Collectors.toList; 31 | 32 | @Component(service = ResourceProcessor.class, immediate = true) 33 | public class DefaultResourceProcessor implements ResourceProcessor { 34 | 35 | @Override 36 | public List> processData(@NotNull Resource resource, String[] headerNames) { 37 | if (!resource.hasChildren()) { 38 | return new ArrayList<>(); 39 | } 40 | 41 | return StreamSupport.stream(resource.getChildren().spliterator(), false) 42 | .map(Resource::getValueMap) 43 | .map(props -> getTableRowData(headerNames, props)) 44 | .collect(toList()); 45 | } 46 | 47 | private List getTableRowData(String[] headerNames, ValueMap props) { 48 | return Arrays.stream(headerNames) 49 | .map(headerName -> props.get(headerName, StringUtils.EMPTY)) 50 | .collect(toList()); 51 | } 52 | 53 | @Override 54 | public boolean canProcess(String mimeType) { 55 | return StringUtils.isBlank(mimeType); 56 | } 57 | } -------------------------------------------------------------------------------- /bundle/src/main/java/com/adobe/cq/wcm/contrib/components/models/HTMLContainer.java: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | package com.adobe.cq.wcm.contrib.components.models; 17 | 18 | import com.adobe.cq.wcm.core.components.models.Component; 19 | import org.jetbrains.annotations.NotNull; 20 | import org.osgi.annotation.versioning.ConsumerType; 21 | 22 | import com.adobe.cq.export.json.ComponentExporter; 23 | 24 | /** 25 | * Defines the {@code HtmlContainer} Sling Model used for the 26 | * {@code /apps/contrib/wcm/components/htmlcontainer} component. 27 | * 28 | * @since com.adobe.cq.wcm.contrib.components.models 1.0.0 29 | */ 30 | @ConsumerType 31 | public interface HTMLContainer extends Component { 32 | 33 | /** 34 | * Returns the CSS included 35 | * 36 | * @return the CSS included 37 | * @since com.adobe.cq.wcm.contrib.components.models 1.0.0 38 | */ 39 | default String getCSSIncludes() { 40 | return ""; 41 | } 42 | 43 | /** 44 | * Returns the HTML included 45 | * 46 | * @return the HTML included 47 | * @since com.adobe.cq.wcm.contrib.components.models 1.0.0 48 | */ 49 | default String getHTMLInclude() { 50 | return ""; 51 | } 52 | 53 | /** 54 | * Returns the JS included 55 | * 56 | * @return the JS included 57 | * @since com.adobe.cq.wcm.contrib.components.models 1.0.0 58 | */ 59 | default String getJSIncludes() { 60 | return ""; 61 | } 62 | 63 | default String getIncludes() { 64 | return ""; 65 | } 66 | 67 | /** 68 | * @see ComponentExporter#getExportedType() 69 | * @since com.adobe.cq.wcm.contrib.components.models 1.0.0 70 | */ 71 | @NotNull 72 | @Override 73 | default String getExportedType() { 74 | return ""; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/htmlcontainer/v1/htmlcontainer/clientlibs/editor/js/htmlcontainer.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2021 Adobe 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | /* deal with *.html */ 18 | $(window).adaptTo("foundation-registry").register("foundation.validation.validator", { 19 | selector: "[data-html-should-contain]", 20 | validate: function(el) { 21 | 22 | var shouldContain = el.getAttribute("data-html-should-contain"); //.html 23 | 24 | 25 | 26 | var input = el.value; //input added by author 27 | 28 | if (input.endsWith(shouldContain) == false ) { 29 | return "The filename should end with " + shouldContain + ". It's current value is " + el.value + "."; 30 | } 31 | } 32 | }); 33 | 34 | 35 | /* deal with *.css */ 36 | $(window).adaptTo("foundation-registry").register("foundation.validation.validator", { 37 | selector: "[data-css-should-contain]", 38 | validate: function(el) { 39 | 40 | var shouldContain = el.getAttribute("data-css-should-contain"); //.css 41 | 42 | var input = el.value; //input added by author 43 | 44 | if (input.endsWith(shouldContain) == false) { 45 | return "The filename(s) should end with " + shouldContain + ". It's current value is " + el.value + "."; 46 | } 47 | } 48 | }); 49 | 50 | 51 | 52 | /* deal with *.js */ 53 | $(window).adaptTo("foundation-registry").register("foundation.validation.validator", { 54 | selector: "[data-js-should-contain]", 55 | validate: function(el) { 56 | 57 | var shouldContain = el.getAttribute("data-js-should-contain"); //.js 58 | 59 | var input = el.value; //input added by author 60 | 61 | if (input.endsWith(shouldContain) == false) { 62 | return "The filename(s) should end with " + shouldContain + ". It's current value is " + el.value + "."; 63 | 64 | } 65 | } 66 | }); 67 | 68 | -------------------------------------------------------------------------------- /bundle/src/main/java/com/adobe/cq/wcm/contrib/components/models/Table.java: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | package com.adobe.cq.wcm.contrib.components.models; 17 | 18 | import com.adobe.cq.export.json.ComponentExporter; 19 | import com.adobe.cq.wcm.core.components.models.Component; 20 | import org.jetbrains.annotations.NotNull; 21 | 22 | import java.io.IOException; 23 | import java.util.ArrayList; 24 | import java.util.List; 25 | 26 | /** 27 | * Defines the {@code Table} Sling Model used for the {@code /apps/core/wcm/components/table} component. 28 | * 29 | * @since com.adobe.cq.wcm.core.components.models.Table 12.10.0 30 | */ 31 | public interface Table extends Component { 32 | 33 | /** 34 | * Returns formatted property names by removing jcr: from the property name. 35 | * @return table header names 36 | */ 37 | @NotNull 38 | default List getFormattedHeaderNames() { 39 | return new ArrayList<>(); 40 | } 41 | 42 | /** 43 | * Returns the table items(Rows) associated to the selected source path. 44 | * 45 | * @return All the table data (row-columns) 46 | */ 47 | @NotNull 48 | default List> getItems() throws IOException { 49 | return new ArrayList<>(); 50 | } 51 | 52 | /** 53 | * Returns Table Description 54 | * 55 | * @return business description about the table 56 | */ 57 | @NotNull 58 | default String getDescription() { 59 | return ""; 60 | } 61 | 62 | /** 63 | * Returns accessible name for the table 64 | * 65 | * @return accessible name for the table 66 | */ 67 | @NotNull 68 | default String getAriaLabel() { 69 | return ""; 70 | } 71 | 72 | /** 73 | * @see ComponentExporter#getExportedType() 74 | * @since com.adobe.cq.wcm.core.components.models 12.2.0 75 | */ 76 | @NotNull 77 | @Override 78 | default String getExportedType() { 79 | return ""; 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /webcomponents/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 4.0.0 19 | 20 | 21 | 22 | 23 | 24 | com.adobe.cq 25 | contrib.wcm.components 26 | 0.0.1-SNAPSHOT 27 | ../pom.xml 28 | 29 | 30 | 31 | 32 | 33 | contrib.wcm.webcomponents 34 | 0.0.1-SNAPSHOT 35 | pom 36 | Adobe Experience Manager WCM Web Components 37 | 38 | 39 | ui.frontend.vanilla 40 | ui.frontend.litelement 41 | ui.apps 42 | 43 | 44 | 45 | 46 | 47 | org.apache.rat 48 | apache-rat-plugin 49 | 50 | 51 | **/example.customize/** 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2018 Adobe 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # Java Maven CircleCI 2.0 configuration file 18 | # 19 | # Check https://circleci.com/docs/2.0/language-java/ for more details 20 | # 21 | version: 2 22 | jobs: 23 | build: 24 | docker: 25 | # specify the version you desire here 26 | - image: circleci/openjdk:8-jdk 27 | 28 | # Specify service dependencies here if necessary 29 | # CircleCI maintains a library of pre-built images 30 | # documented at https://circleci.com/docs/2.0/circleci-images/ 31 | # - image: circleci/postgres:9.4 32 | 33 | working_directory: ~/repo 34 | 35 | environment: 36 | # Customize the JVM maximum heap limit 37 | MAVEN_OPTS: -Xmx3200m 38 | 39 | steps: 40 | - checkout 41 | 42 | # Download and cache dependencies 43 | - restore_cache: 44 | keys: 45 | - v1-dependencies-{{ checksum "pom.xml" }} 46 | # fallback to using the latest cache if no exact match is found 47 | - v1-dependencies- 48 | 49 | # run tests! 50 | - run: mvn clean verify -B -U 51 | 52 | # save any dumps 53 | - run: 54 | name: save any dumps 55 | command: | 56 | mkdir -p ~/dumps 57 | find . -type f -regex ".*/.*\.dump" -exec cp {} ~/dumps \; 58 | find . -type f -regex ".*/.*\.dumpstream" -exec cp {} ~/dumps \; 59 | when: 60 | on_fail 61 | 62 | - store_artifacts: 63 | path: ~/dumps 64 | 65 | # save test results 66 | - run: 67 | name: save test results 68 | command: | 69 | mkdir -p ~/test-results/junit/ 70 | find . -type f -regex ".*/surefire-reports/.*" -exec cp {} ~/test-results/junit/ \; 71 | when: always 72 | 73 | - store_artifacts: 74 | path: ~/test-results/junit 75 | 76 | # generate test summary 77 | - store_test_results: 78 | path: ~/test-results 79 | 80 | - save_cache: 81 | paths: 82 | - ~/.m2 83 | key: v1-dependencies-{{ checksum "pom.xml" }} 84 | 85 | # run codecoverage check 86 | - run: bash <(curl -s https://codecov.io/bash) 87 | -------------------------------------------------------------------------------- /bundle/src/test/resources/htmlcontainer/test-content.json: -------------------------------------------------------------------------------- 1 | { 2 | "htmlcontainer": { 3 | "jcr:primaryType": "cq:Page", 4 | "jcr:content": { 5 | "jcr:primaryType": "cq:PageContent", 6 | "jcr:title": "Table Test", 7 | "sling:resourceType": "core/wcm/components/page/v2/page", 8 | "jcr:description": "Table description", 9 | "root": { 10 | "jcr:primaryType": "nt:unstructured", 11 | "sling:resourceType": "wcm/foundation/components/responsivegrid", 12 | "responsivegrid": { 13 | "jcr:primaryType": "nt:unstructured", 14 | "sling:resourceType": "wcm/foundation/components/responsivegrid", 15 | "htmlcontainer-1": { 16 | "jcr:primaryType": "nt:unstructured", 17 | "jcr:createdBy": "admin", 18 | "jcr:lastModifiedBy": "admin", 19 | "htmlFile": "/content/dam/html/sample-site/sample.html", 20 | "jcr:created": "Wed Sep 08 2021 17:38:52 GMT+0530", 21 | "jcr:lastModified": "Wed Sep 08 2021 18:11:07 GMT+0530", 22 | "sling:resourceType": "contrib/wcm/components/htmlcontainer/v1/htmlcontainer", 23 | "cssFiles": { 24 | "jcr:primaryType": "nt:unstructured", 25 | "item0": { 26 | "jcr:primaryType": "nt:unstructured", 27 | "fileName": "/content/dam/html/sample-site/sample.css", 28 | "includeType": "inline" 29 | }, 30 | "item1": { 31 | "jcr:primaryType": "nt:unstructured", 32 | "fileName": "/content/dam/html/sample-site/sample.css", 33 | "includeType": "reference" 34 | }, 35 | "item3": { 36 | "jcr:primaryType": "nt:unstructured", 37 | "fileName": "/content/dam/html/sample-site/sample2.css", 38 | "includeType": "async" 39 | } 40 | }, 41 | "jsFiles": { 42 | "jcr:primaryType": "nt:unstructured", 43 | "item0": { 44 | "jcr:primaryType": "nt:unstructured", 45 | "fileName": "/content/dam/html/sample-site/sample.js", 46 | "includeType": "inline" 47 | }, 48 | "item1": { 49 | "jcr:primaryType": "nt:unstructured", 50 | "fileName": "/content/dam/html/sample-site/sample.js", 51 | "includeType": "defer" 52 | }, 53 | "item2": { 54 | "jcr:primaryType": "nt:unstructured", 55 | "fileName": "/content/dam/html/sample-site/sample2.js", 56 | "includeType": "async" 57 | }, 58 | "item3": { 59 | "jcr:primaryType": "nt:unstructured", 60 | "fileName": "/content/dam/html/sample-site/sample2.js", 61 | "includeType": "reference" 62 | } 63 | } 64 | } 65 | } 66 | } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/htmlcontainer/v1/htmlcontainer/_cq_design_dialog/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 22 | 25 | 26 | 30 | 31 | 36 | 37 | 44 | 45 | 46 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Adobe Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at Grp-opensourceoffice@adobe.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at [http://contributor-covenant.org/version/1/4][version] 72 | 73 | [homepage]: http://contributor-covenant.org 74 | [version]: http://contributor-covenant.org/version/1/4/ -------------------------------------------------------------------------------- /bundle/src/test/resources/htmlcontainer/test-content2.json: -------------------------------------------------------------------------------- 1 | { 2 | "htmlcontainer": { 3 | "jcr:primaryType": "cq:Page", 4 | "jcr:content": { 5 | "jcr:primaryType": "cq:PageContent", 6 | "jcr:title": "Table Test", 7 | "sling:resourceType": "core/wcm/components/page/v2/page", 8 | "jcr:description": "Table description", 9 | "root": { 10 | "jcr:primaryType": "nt:unstructured", 11 | "sling:resourceType": "wcm/foundation/components/responsivegrid", 12 | "responsivegrid": { 13 | "jcr:primaryType": "nt:unstructured", 14 | "sling:resourceType": "wcm/foundation/components/responsivegrid", 15 | "htmlcontainer-1": { 16 | "jcr:primaryType": "nt:unstructured", 17 | "jcr:createdBy": "admin", 18 | "jcr:lastModifiedBy": "admin", 19 | "htmlFile": "/content/dam/html/sample-site/sample.html", 20 | "jcr:created": "Wed Sep 08 2021 17:38:52 GMT+0530", 21 | "jcr:lastModified": "Wed Sep 08 2021 18:11:07 GMT+0530", 22 | "sling:resourceType": "contrib/wcm/components/htmlcontainer/v1/htmlcontainer", 23 | "cssFiles": { 24 | "jcr:primaryType": "nt:unstructured", 25 | "item0": { 26 | "jcr:primaryType": "nt:unstructured", 27 | "fileName": "/content/dam/html/sample-site/sample.css", 28 | "includeType": "inline" 29 | }, 30 | "item1": { 31 | "jcr:primaryType": "nt:unstructured", 32 | "fileName": "/content/dam/html/sample-site/sample.css", 33 | "includeType": "reference" 34 | }, 35 | "item3": { 36 | "jcr:primaryType": "nt:unstructured", 37 | "fileName": "/content/dam/html/sample-site/sample2.css", 38 | "includeType": "async" 39 | } 40 | }, 41 | "jsFiles": { 42 | "jcr:primaryType": "nt:unstructured", 43 | "item0": { 44 | "jcr:primaryType": "nt:unstructured", 45 | "fileName": "/content/dam/html/sample-site/sample.js", 46 | "includeType": "inline" 47 | }, 48 | "item1": { 49 | "jcr:primaryType": "nt:unstructured", 50 | "includeType": "defer" 51 | }, 52 | "item2": { 53 | "jcr:primaryType": "nt:unstructured", 54 | "fileName": "/content/dam/html/sample-site/sample.js" 55 | }, 56 | "item3": { 57 | "jcr:primaryType": "nt:unstructured", 58 | "fileName": "/content/dam/html/sample-site/sample.js", 59 | "includeType": "defer" 60 | }, 61 | "item4": { 62 | "jcr:primaryType": "nt:unstructured", 63 | "fileName": "/content/dam/html/sample-site/sample2.js", 64 | "includeType": "async1" 65 | } 66 | }, 67 | "xyzFiles": { 68 | "jcr:primaryType": "nt:unstructured", 69 | "item0": { 70 | "jcr:primaryType": "nt:unstructured", 71 | "fileName": "/content/dam/html/sample-site/sample.js", 72 | "includeType": "inline" 73 | }, 74 | "item1": { 75 | "jcr:primaryType": "nt:unstructured", 76 | "includeType": "defer" 77 | }, 78 | "item2": { 79 | "jcr:primaryType": "nt:unstructured", 80 | "fileName": "/content/dam/html/sample-site/sample.js" 81 | }, 82 | "item3": { 83 | "jcr:primaryType": "nt:unstructured", 84 | "fileName": "/content/dam/html/sample-site/sample.js", 85 | "includeType": "defer" 86 | }, 87 | "item4": { 88 | "jcr:primaryType": "nt:unstructured", 89 | "fileName": "/content/dam/html/sample-site/sample2.js", 90 | "includeType": "async1" 91 | } 92 | } 93 | } 94 | } 95 | } 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /ui.apps/src/content/jcr_root/apps/contrib/wcm/components/table/v1/table/_cq_dialog/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 11 | 15 | 16 | 20 | 24 | 25 | 28 | 29 | 34 | 44 | 50 | 54 | 55 | 61 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /bundle/src/test/java/com/adobe/cq/wcm/contrib/components/internal/services/table/DefaultResourceProcessorTest.java: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | package com.adobe.cq.wcm.contrib.components.internal.services.table; 17 | 18 | import org.apache.commons.lang3.StringUtils; 19 | import org.apache.sling.api.resource.Resource; 20 | import org.apache.sling.api.resource.ValueMap; 21 | import org.junit.jupiter.api.BeforeEach; 22 | import org.junit.jupiter.api.DisplayName; 23 | import org.junit.jupiter.api.Test; 24 | import org.mockito.InjectMocks; 25 | import org.mockito.Mock; 26 | import org.mockito.MockitoAnnotations; 27 | 28 | import java.util.ArrayList; 29 | import java.util.Arrays; 30 | import java.util.Iterator; 31 | import java.util.List; 32 | import java.util.Spliterator; 33 | 34 | import static org.junit.jupiter.api.Assertions.assertEquals; 35 | import static org.junit.jupiter.api.Assertions.assertTrue; 36 | import static org.mockito.Mockito.mock; 37 | import static org.mockito.Mockito.when; 38 | 39 | class DefaultResourceProcessorTest { 40 | 41 | private static final String[] HEADER_NAMES = {"email", "name", "gender", "status"}; 42 | private static final String[] PROP_VALUES = {"test@test.com", "test", "male", "active"}; 43 | @InjectMocks 44 | private DefaultResourceProcessor defaultResourceProcessor; 45 | 46 | @Mock 47 | Resource resource; 48 | 49 | @Mock 50 | ValueMap props; 51 | 52 | @Mock 53 | Iterable iterable; 54 | 55 | @BeforeEach 56 | void setUp() { 57 | MockitoAnnotations.initMocks(this); 58 | } 59 | 60 | @Test 61 | @DisplayName("Happy path when the data is available under child nodes.") 62 | void processData() { 63 | Spliterator children = getChildrenSpliterator(); 64 | when(resource.hasChildren()).thenReturn(true); 65 | when(resource.getChildren()).thenReturn(iterable); 66 | when(iterable.spliterator()).thenReturn(children); 67 | when(props.get("email", StringUtils.EMPTY)).thenReturn("test@test.com"); 68 | when(props.get("name", StringUtils.EMPTY)).thenReturn("test"); 69 | when(props.get("gender", StringUtils.EMPTY)).thenReturn("male"); 70 | when(props.get("status", StringUtils.EMPTY)).thenReturn("active"); 71 | 72 | assertEquals(expectedOutput(), defaultResourceProcessor.processData(resource, HEADER_NAMES)); 73 | } 74 | 75 | @Test 76 | @DisplayName("When data is not available under child nodes") 77 | void processDataWithNoChildNodes() { 78 | Iterator children = getEmptyIterator(); 79 | when(resource.hasChildren()).thenReturn(false); 80 | when(resource.getChildren()).thenReturn(iterable); 81 | when(iterable.iterator()).thenReturn(children); 82 | List> rows = new ArrayList<>(); 83 | assertEquals(rows, defaultResourceProcessor.processData(resource, HEADER_NAMES)); 84 | } 85 | 86 | @Test 87 | void canProcess() { 88 | assertTrue(defaultResourceProcessor.canProcess(StringUtils.EMPTY)); 89 | } 90 | 91 | private Iterator getEmptyIterator() { 92 | final List children = new ArrayList<>(); 93 | return children.iterator(); 94 | } 95 | 96 | private Spliterator getChildrenSpliterator() { 97 | Resource child = mock(Resource.class); 98 | when(child.getValueMap()).thenReturn(props); 99 | final List children = new ArrayList<>(); 100 | children.add(child); 101 | return children.spliterator(); 102 | } 103 | 104 | private List> expectedOutput() { 105 | List> tableData = new ArrayList<>(); 106 | tableData.add(Arrays.asList(PROP_VALUES)); 107 | return tableData; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /bundle/src/main/java/com/adobe/cq/wcm/contrib/components/internal/services/table/CSVResourceProcessor.java: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | package com.adobe.cq.wcm.contrib.components.internal.services.table; 17 | 18 | import com.adobe.cq.wcm.contrib.components.services.table.ResourceProcessor; 19 | import com.day.cq.dam.api.Asset; 20 | import com.day.cq.dam.api.Rendition; 21 | import com.day.cq.dam.commons.util.DamUtil; 22 | import org.apache.sling.api.resource.Resource; 23 | import org.jetbrains.annotations.NotNull; 24 | import org.osgi.service.component.annotations.Component; 25 | 26 | import java.io.BufferedReader; 27 | import java.io.IOException; 28 | import java.io.InputStream; 29 | import java.io.InputStreamReader; 30 | import java.nio.charset.StandardCharsets; 31 | import java.util.ArrayList; 32 | import java.util.Arrays; 33 | import java.util.HashMap; 34 | import java.util.LinkedHashMap; 35 | import java.util.List; 36 | import java.util.Map; 37 | 38 | import static java.util.Objects.nonNull; 39 | 40 | @Component(service = ResourceProcessor.class, immediate = true) 41 | public class CSVResourceProcessor implements ResourceProcessor { 42 | 43 | @Override 44 | public List> processData(@NotNull Resource resource, String[] headerNames) throws IOException { 45 | List> rows = new ArrayList<>(); 46 | Asset asset = DamUtil.resolveToAsset(resource); 47 | if (nonNull(asset)) { 48 | Rendition original = asset.getOriginal(); 49 | if (nonNull(original)) { 50 | InputStream inputStream = original.getStream(); 51 | try (BufferedReader br = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) { 52 | List> lines = getRawCSVDataInList(br); 53 | // First line of csv is the name of headers 54 | final List columns = lines.get(0); 55 | Map columnIndexMap = getColumnIndexMap(columns); 56 | // Set the column header names and their indexes in the same order as header are received as input 57 | Map tableColumnsMap = new LinkedHashMap<>(); 58 | for (String headerName : headerNames) { 59 | tableColumnsMap.put(headerName, columnIndexMap.getOrDefault(headerName, -1)); 60 | } 61 | 62 | // Remove header names row from the list. 63 | lines = lines.subList(1, lines.size()); 64 | populateRowsForTable(lines, tableColumnsMap, rows); 65 | } 66 | } 67 | } 68 | return rows; 69 | } 70 | 71 | @Override 72 | public boolean canProcess(String mimeType) { 73 | return nonNull(mimeType) && mimeType.equalsIgnoreCase("text/csv"); 74 | } 75 | 76 | 77 | private void populateRowsForTable(List> lines, Map finalMap, List> rows) { 78 | for (List line : lines) { 79 | List row = new ArrayList<>(); 80 | for(Map.Entry columnIndex : finalMap.entrySet()) { 81 | row.add(line.get(columnIndex.getValue())); 82 | } 83 | rows.add(row); 84 | } 85 | } 86 | 87 | private List> getRawCSVDataInList(BufferedReader br) throws IOException { 88 | List> lines = new ArrayList<>(); 89 | String currentLine; 90 | while ((currentLine = br.readLine()) != null) { 91 | lines.add(Arrays.asList(currentLine.split(","))); 92 | } 93 | return lines; 94 | } 95 | 96 | /** 97 | * @param columns : Array of Column names. This is first row in the CSV file 98 | * @return : Returns the column name and it's index 99 | */ 100 | private Map getColumnIndexMap(List columns) { 101 | Map columnIndexMap = new HashMap<>(); 102 | for (int i = 0; i < columns.size(); i++) { 103 | columnIndexMap.put(columns.get(i), i); 104 | } 105 | return columnIndexMap; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /bundle/src/test/java/com/adobe/cq/wcm/contrib/components/internal/services/table/CSVResourceProcessorTest.java: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | package com.adobe.cq.wcm.contrib.components.internal.services.table; 17 | 18 | import com.day.cq.dam.api.Asset; 19 | import com.day.cq.dam.api.Rendition; 20 | import org.apache.sling.api.resource.Resource; 21 | import org.junit.jupiter.api.BeforeEach; 22 | import org.junit.jupiter.api.DisplayName; 23 | import org.junit.jupiter.api.Test; 24 | import org.mockito.InjectMocks; 25 | import org.mockito.Mock; 26 | import org.mockito.MockitoAnnotations; 27 | 28 | import java.io.FileInputStream; 29 | import java.io.FileNotFoundException; 30 | import java.io.IOException; 31 | import java.io.InputStream; 32 | import java.nio.file.Path; 33 | import java.nio.file.Paths; 34 | import java.util.ArrayList; 35 | import java.util.Arrays; 36 | import java.util.List; 37 | 38 | import static org.junit.jupiter.api.Assertions.assertEquals; 39 | import static org.junit.jupiter.api.Assertions.assertTrue; 40 | import static org.mockito.Mockito.when; 41 | 42 | class CSVResourceProcessorTest { 43 | 44 | private static final String[] HEADER_NAMES = {"email", "name", "gender", "status"}; 45 | 46 | private static final String[] RANDOM_HEADER_NAMES = {"name", "email", "gender"}; 47 | 48 | @InjectMocks 49 | private CSVResourceProcessor csvResourceProcessor; 50 | 51 | @Mock 52 | private Resource resource; 53 | 54 | @Mock 55 | private Asset asset; 56 | 57 | @Mock 58 | private Rendition original; 59 | 60 | @BeforeEach 61 | void setup() { 62 | MockitoAnnotations.initMocks(this); 63 | } 64 | 65 | @Test 66 | @DisplayName("When all the headers are passed in the same order, than fields are placed in csv file") 67 | void processData() throws IOException { 68 | setUpMocks(); 69 | assertEquals(expectedOutput(), csvResourceProcessor.processData(resource, HEADER_NAMES)); 70 | } 71 | 72 | private void setUpMocks() throws FileNotFoundException { 73 | when(resource.getResourceType()).thenReturn("dam:Asset"); 74 | when(resource.adaptTo(Asset.class)).thenReturn(asset); 75 | when(asset.getOriginal()).thenReturn(original); 76 | 77 | // Create input stream from csv file in resources dir 78 | InputStream inputStream = loadCSVStream(); 79 | when(original.getStream()).thenReturn(inputStream); 80 | } 81 | 82 | @Test 83 | @DisplayName("When some of the headers are passed in different order, than the headers are placed in csv file") 84 | void processDataWithScrambledHeaders() throws IOException { 85 | setUpMocks(); 86 | assertEquals(randomHeaderOutput(), csvResourceProcessor.processData(resource, RANDOM_HEADER_NAMES)); 87 | } 88 | 89 | private InputStream loadCSVStream() throws FileNotFoundException { 90 | Path resourceDirectory = Paths.get("src", "test", "resources", "table", "test-content.csv"); 91 | return new FileInputStream(resourceDirectory.toFile()); 92 | } 93 | 94 | @Test 95 | void canProcess() { 96 | assertTrue(csvResourceProcessor.canProcess("text/csv")); 97 | } 98 | 99 | private List> expectedOutput() { 100 | List> tableData = new ArrayList<>(); 101 | tableData.add(Arrays.asList("test1@sample.com", "test1", "male", "active")); 102 | tableData.add(Arrays.asList("test2@sample.com", "test2", "female", "active")); 103 | tableData.add(Arrays.asList("test3@sample.com", "test3", "male", "inactive")); 104 | tableData.add(Arrays.asList("test4@sample.com", "test4", "female", "inactive")); 105 | return tableData; 106 | } 107 | 108 | private List> randomHeaderOutput() { 109 | List> tableData = new ArrayList<>(); 110 | tableData.add(Arrays.asList("test1", "test1@sample.com", "male")); 111 | tableData.add(Arrays.asList("test2", "test2@sample.com", "female")); 112 | tableData.add(Arrays.asList("test3", "test3@sample.com", "male")); 113 | tableData.add(Arrays.asList("test4", "test4@sample.com", "female")); 114 | return tableData; 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /bundle/src/test/java/com/adobe/cq/wcm/contrib/components/context/ContribComponentsTestContext.java: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | package com.adobe.cq.wcm.contrib.components.context; 17 | 18 | import java.util.HashSet; 19 | import java.util.Map; 20 | import java.util.Set; 21 | import java.util.stream.Collectors; 22 | import java.util.stream.StreamSupport; 23 | 24 | import org.apache.commons.lang3.ArrayUtils; 25 | import org.apache.sling.api.resource.Resource; 26 | import org.apache.sling.models.impl.ResourceTypeBasedResourcePicker; 27 | import org.apache.sling.models.spi.ImplementationPicker; 28 | import org.apache.sling.testing.mock.sling.ResourceResolverType; 29 | 30 | import com.adobe.cq.export.json.SlingModelFilter; 31 | import com.adobe.cq.wcm.core.components.internal.link.DefaultPathProcessor; 32 | import com.adobe.cq.wcm.core.components.testing.MockExternalizerFactory; 33 | import com.adobe.cq.wcm.core.components.testing.MockResponsiveGrid; 34 | import com.adobe.cq.wcm.core.components.testing.MockSlingModelFilter; 35 | import com.day.cq.commons.Externalizer; 36 | import com.day.cq.wcm.api.NameConstants; 37 | import com.day.cq.wcm.msm.api.MSMNameConstants; 38 | import com.google.common.collect.ImmutableMap; 39 | import io.wcm.testing.mock.aem.junit5.AemContext; 40 | import io.wcm.testing.mock.aem.junit5.AemContextBuilder; 41 | 42 | import static org.apache.sling.testing.mock.caconfig.ContextPlugins.CACONFIG; 43 | 44 | public final class ContribComponentsTestContext { 45 | 46 | public static final String TEST_CONTENT_JSON = "/test-content.json"; 47 | 48 | private ContribComponentsTestContext() { 49 | // only static methods 50 | } 51 | 52 | private static final ImmutableMap PROPERTIES = 53 | ImmutableMap.of("resource.resolver.mapping", ArrayUtils.toArray( 54 | "/:/", 55 | "^/content/links/site1/(.+)afterSetUp(context -> { 64 | context.addModelsForClasses(MockResponsiveGrid.class); 65 | context.addModelsForPackage("com.adobe.cq.wcm.core.components.models"); 66 | context.addModelsForPackage("com.adobe.cq.wcm.core.components.internal.link"); 67 | context.registerService(SlingModelFilter.class, new MockSlingModelFilter() { 68 | private final Set IGNORED_NODE_NAMES = new HashSet() {{ 69 | add(NameConstants.NN_RESPONSIVE_CONFIG); 70 | add(MSMNameConstants.NT_LIVE_SYNC_CONFIG); 71 | add("cq:annotations"); 72 | }}; 73 | 74 | @Override 75 | public Map filterProperties(Map map) { 76 | return map; 77 | } 78 | 79 | @Override 80 | public Iterable filterChildResources(Iterable childResources) { 81 | return StreamSupport 82 | .stream(childResources.spliterator(), false) 83 | .filter(r -> !IGNORED_NODE_NAMES.contains(r.getName())) 84 | .collect(Collectors.toList()); 85 | } 86 | }); 87 | context.registerService(ImplementationPicker.class, new ResourceTypeBasedResourcePicker()); 88 | context.registerService(Externalizer.class, MockExternalizerFactory.getExternalizerService()); 89 | context.registerInjectActivateService(new DefaultPathProcessor(), ImmutableMap.of( 90 | "vanityConfig", DefaultPathProcessor.VanityConfig.ALWAYS.getValue())); 91 | } 92 | ) 93 | .build(); 94 | } 95 | } 96 | 97 | -------------------------------------------------------------------------------- /bundle/src/test/java/com/adobe/cq/wcm/contrib/components/Utils.java: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | package com.adobe.cq.wcm.contrib.components; 17 | 18 | import com.adobe.cq.wcm.core.components.internal.DataLayerConfig; 19 | import com.adobe.cq.wcm.core.components.internal.jackson.DefaultMethodSkippingModuleProvider; 20 | import com.adobe.cq.wcm.core.components.internal.jackson.PageModuleProvider; 21 | import com.fasterxml.jackson.databind.ObjectMapper; 22 | import io.wcm.testing.mock.aem.junit5.AemContext; 23 | import org.apache.commons.io.FilenameUtils; 24 | import org.apache.commons.io.IOUtils; 25 | import org.apache.sling.api.resource.Resource; 26 | import org.apache.sling.caconfig.ConfigurationBuilder; 27 | import org.mockito.Mockito; 28 | 29 | import javax.json.Json; 30 | import javax.json.JsonReader; 31 | import java.io.IOException; 32 | import java.io.InputStream; 33 | import java.io.StringWriter; 34 | import java.io.Writer; 35 | import java.nio.charset.StandardCharsets; 36 | 37 | import static org.junit.jupiter.api.Assertions.assertEquals; 38 | import static org.junit.jupiter.api.Assertions.fail; 39 | import static org.mockito.Mockito.when; 40 | 41 | public class Utils { 42 | 43 | /** 44 | * Provided a {@code model} object and an {@code expectedJsonResource} identifying a JSON file in the class path, this method will 45 | * test the JSON export of the model and compare it to the JSON object provided by the {@code expectedJsonResource}. 46 | * 47 | * @param model the Sling Model 48 | * @param expectedJsonResource the class path resource providing the expected JSON object 49 | */ 50 | public static void testJSONExport(Object model, String expectedJsonResource) { 51 | Writer writer = new StringWriter(); 52 | ObjectMapper mapper = new ObjectMapper(); 53 | PageModuleProvider pageModuleProvider = new PageModuleProvider(); 54 | mapper.registerModule(pageModuleProvider.getModule()); 55 | DefaultMethodSkippingModuleProvider defaultMethodSkippingModuleProvider = new DefaultMethodSkippingModuleProvider(); 56 | mapper.registerModule(defaultMethodSkippingModuleProvider.getModule()); 57 | try { 58 | mapper.writer().writeValue(writer, model); 59 | } catch (IOException e) { 60 | fail(String.format("Unable to generate JSON export for model %s: %s", model.getClass().getName(), e.getMessage())); 61 | } 62 | JsonReader outputReader = Json.createReader(IOUtils.toInputStream(writer.toString(), StandardCharsets.UTF_8)); 63 | InputStream is = Utils.class.getResourceAsStream(expectedJsonResource); 64 | if (is != null) { 65 | JsonReader expectedReader = Json.createReader(is); 66 | assertEquals(expectedReader.read(), outputReader.read()); 67 | } else { 68 | fail("Unable to find test file " + expectedJsonResource + "."); 69 | } 70 | IOUtils.closeQuietly(is); 71 | } 72 | 73 | /** 74 | * Provided a test base folder ({@code testBase}) and a virtual resource path ({@code testResourcePath}), this method generates the 75 | * class path resource path for the JSON files that represent the expected exporter output for a component. The returned value is 76 | * generated using the following concatenation operation: 77 | * 78 | *
 79 |      *     testBase + '/exporter-' + fileName(testResourcePath) + '.json'
 80 |      * 
81 | * 82 | * For example: 83 | *
 84 |      *     testBase = '/form/button'
 85 |      *     testResourcePath = '/content/buttons/button'
 86 |      *     output = '/form/button/exporter-button.json'
 87 |      * 
88 | * 89 | * @param testBase the test base folder (under the {@code src/test/resources} folder) 90 | * @param testResourcePath the test resource path in the virtual repository 91 | * @return the expected class path location of the JSON exporter file 92 | */ 93 | public static String getTestExporterJSONPath(String testBase, String testResourcePath) { 94 | return testBase + "/exporter-" + FilenameUtils.getName(testResourcePath) + ".json"; 95 | } 96 | 97 | /** 98 | * Sets the data layer context aware configuration of the AEM test context to enabled/disabled 99 | * 100 | * @param context The AEM test context 101 | * @param enabled {@code true} to enable the data layer, {@code false} to disable it 102 | */ 103 | public static void enableDataLayer(AemContext context, boolean enabled) { 104 | ConfigurationBuilder builder = Mockito.mock(ConfigurationBuilder.class); 105 | DataLayerConfig dataLayerConfig = Mockito.mock(DataLayerConfig.class); 106 | when(dataLayerConfig.enabled()).thenReturn(enabled); 107 | when(builder.as(DataLayerConfig.class)).thenReturn(dataLayerConfig); 108 | context.registerAdapter(Resource.class, ConfigurationBuilder.class, builder); 109 | } 110 | 111 | } 112 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.vanilla/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 4.0.0 19 | 20 | 21 | 22 | 23 | 24 | com.adobe.cq 25 | contrib.wcm.components 26 | 0.0.1-SNAPSHOT 27 | ../../pom.xml 28 | 29 | 30 | 31 | 32 | 33 | contrib.wcm.webcomponents.ui.frontend.vanilla 34 | 0.0.1-SNAPSHOT 35 | pom 36 | Adobe Experience Manager WCM Web Components - Vanilla Javascript Implementation 37 | 38 | 39 | 40 | 41 | 42 | src 43 | 44 | 45 | com.github.eirslett 46 | frontend-maven-plugin 47 | 48 | 49 | install node and npm 50 | validate 51 | 52 | install-node-and-npm 53 | 54 | 55 | ${node.version} 56 | ${npm.version} 57 | 58 | 59 | 60 | npm install 61 | validate 62 | 63 | npm 64 | 65 | 66 | 67 | lint 68 | validate 69 | 70 | npm 71 | 72 | 73 | run lint 74 | 75 | 76 | 77 | sync pom version to package.json 78 | 79 | npm 80 | 81 | 82 | run sync-pom-version 83 | 84 | 85 | 86 | npm run build 87 | 88 | npm 89 | 90 | 91 | run build 92 | 93 | 94 | 95 | 96 | 97 | org.apache.rat 98 | apache-rat-plugin 99 | 100 | 101 | 102 | **/*.eslintrc 103 | **/*.editorconfig 104 | **/*.stylelintrc.yaml 105 | **/*.eslintignore 106 | 107 | **/node/** 108 | **/node_modules/** 109 | **/dist/** 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.litelement/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 4.0.0 19 | 20 | 21 | 22 | 23 | 24 | com.adobe.cq 25 | contrib.wcm.components 26 | 0.0.1-SNAPSHOT 27 | ../../pom.xml 28 | 29 | 30 | 31 | 32 | 33 | contrib.wcm.webcomponents.ui.frontend.litelement 34 | 0.0.1-SNAPSHOT 35 | pom 36 | Adobe Experience Manager WCM Web Components - Vanilla Javascript Implementation 37 | 38 | 39 | 40 | 41 | 42 | src 43 | 44 | 45 | com.github.eirslett 46 | frontend-maven-plugin 47 | 48 | 49 | install node and npm 50 | validate 51 | 52 | install-node-and-npm 53 | 54 | 55 | ${node.version} 56 | ${npm.version} 57 | 58 | 59 | 60 | npm install 61 | validate 62 | 63 | npm 64 | 65 | 66 | 67 | lint 68 | validate 69 | 70 | npm 71 | 72 | 73 | run lint 74 | 75 | 76 | 77 | sync pom version to package.json 78 | 79 | npm 80 | 81 | 82 | run sync-pom-version 83 | 84 | 85 | 86 | npm run build 87 | 88 | npm 89 | 90 | 91 | run build 92 | 93 | 94 | 95 | 96 | 97 | org.apache.rat 98 | apache-rat-plugin 99 | 100 | 101 | 102 | **/*.eslintrc 103 | **/*.editorconfig 104 | **/*.stylelintrc.yaml 105 | **/*.eslintignore 106 | **/*.babelrc 107 | 108 | **/node/** 109 | **/node_modules/** 110 | **/dist/** 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /bundle/src/main/java/com/adobe/cq/wcm/contrib/components/internal/models/v1/TableImpl.java: -------------------------------------------------------------------------------- 1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | ~ Copyright 2021 Adobe 3 | ~ 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 | ~ you may not use this file except in compliance with the License. 6 | ~ You may obtain a copy of the License at 7 | ~ 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~ 10 | ~ Unless required by applicable law or agreed to in writing, software 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~ See the License for the specific language governing permissions and 14 | ~ limitations under the License. 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 16 | package com.adobe.cq.wcm.contrib.components.internal.models.v1; 17 | 18 | import com.adobe.cq.export.json.ComponentExporter; 19 | import com.adobe.cq.export.json.ExporterConstants; 20 | import com.adobe.cq.wcm.contrib.components.models.Table; 21 | import com.adobe.cq.wcm.contrib.components.services.table.ResourceProcessor; 22 | import com.adobe.cq.wcm.core.components.util.AbstractComponentImpl; 23 | import com.day.cq.dam.api.Asset; 24 | import com.day.cq.dam.commons.util.DamUtil; 25 | import org.apache.commons.lang3.StringUtils; 26 | import org.apache.sling.api.SlingHttpServletRequest; 27 | import org.apache.sling.api.resource.Resource; 28 | import org.apache.sling.api.resource.ResourceResolver; 29 | import org.apache.sling.models.annotations.Exporter; 30 | import org.apache.sling.models.annotations.Model; 31 | import org.apache.sling.models.annotations.Optional; 32 | import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy; 33 | import org.apache.sling.models.annotations.injectorspecific.SlingObject; 34 | import org.apache.sling.models.annotations.injectorspecific.ValueMapValue; 35 | import org.jetbrains.annotations.NotNull; 36 | import org.jetbrains.annotations.Nullable; 37 | 38 | import javax.annotation.PostConstruct; 39 | import javax.inject.Inject; 40 | import java.io.IOException; 41 | import java.util.ArrayList; 42 | import java.util.List; 43 | 44 | import static java.util.Objects.nonNull; 45 | 46 | @Model( 47 | adaptables = SlingHttpServletRequest.class, 48 | adapters = {Table.class, ComponentExporter.class}, 49 | resourceType = TableImpl.RESOURCE_TYPE 50 | ) 51 | 52 | @Exporter( 53 | name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, 54 | extensions = ExporterConstants.SLING_MODEL_EXTENSION 55 | ) 56 | public class TableImpl extends AbstractComponentImpl implements Table { 57 | 58 | public static final String RESOURCE_TYPE = "core/wcm/components/table/v1/table"; 59 | 60 | @ValueMapValue(name = "source", injectionStrategy = InjectionStrategy.REQUIRED) 61 | private String source; 62 | 63 | @ValueMapValue(name = "headerNames", injectionStrategy = InjectionStrategy.REQUIRED) 64 | private String[] headerNames; 65 | 66 | @ValueMapValue(name = "description", injectionStrategy = InjectionStrategy.OPTIONAL) 67 | private String description; 68 | 69 | @ValueMapValue(name = "ariaLabel", injectionStrategy = InjectionStrategy.OPTIONAL) 70 | private String ariaLabel; 71 | 72 | @Inject 73 | @Optional 74 | private List resourceProcessors; 75 | 76 | @SlingObject 77 | private ResourceResolver resourceResolver; 78 | 79 | private List formattedTableHeaderNames; 80 | 81 | 82 | @PostConstruct 83 | public void initModel() { 84 | formatHeaderNames(); 85 | } 86 | 87 | private String getSourceResourceMimeType(Resource sourceResource) { 88 | if (nonNull(sourceResource)) { 89 | if (DamUtil.isAsset(sourceResource)) { 90 | Asset asset = DamUtil.resolveToAsset(sourceResource); 91 | return nonNull(asset) ? asset.getMimeType() : StringUtils.EMPTY; 92 | } else { 93 | return StringUtils.EMPTY; 94 | } 95 | } 96 | return StringUtils.EMPTY; 97 | } 98 | 99 | /** 100 | * This method formats the property name to friendly names by removing jcr: prefix. Formatted 101 | * property names are used to display the headers in table. 102 | */ 103 | private void formatHeaderNames() { 104 | formattedTableHeaderNames = new ArrayList<>(); 105 | for (String propertyName : headerNames) { 106 | if (propertyName.contains("jcr:")) { 107 | formattedTableHeaderNames.add(propertyName.replace("jcr:", "")); 108 | } else { 109 | formattedTableHeaderNames.add(propertyName); 110 | } 111 | } 112 | } 113 | 114 | 115 | @Override 116 | public @NotNull List getFormattedHeaderNames() { 117 | return formattedTableHeaderNames; 118 | } 119 | 120 | 121 | @Override 122 | public @NotNull List> getItems() throws IOException { 123 | if (nonNull(resourceProcessors)) { 124 | Resource sourceResource = resourceResolver.getResource(source); 125 | if (nonNull(sourceResource)) { 126 | for (ResourceProcessor resourceProcessor : resourceProcessors) { 127 | if (resourceProcessor.canProcess(getSourceResourceMimeType(sourceResource))) { 128 | return resourceProcessor.processData(sourceResource, headerNames); 129 | } 130 | } 131 | } 132 | } 133 | return new ArrayList<>(); 134 | } 135 | 136 | @NotNull 137 | @Override 138 | public String getDescription() { 139 | return StringUtils.defaultIfEmpty(description, StringUtils.EMPTY); 140 | } 141 | 142 | @NotNull 143 | @Override 144 | public String getAriaLabel() { 145 | return StringUtils.defaultIfEmpty(ariaLabel, StringUtils.EMPTY); 146 | } 147 | 148 | @NotNull 149 | @Override 150 | public String getExportedType() { 151 | return resource.getResourceType(); 152 | } 153 | 154 | /* 155 | * DataLayerProvider implementation of field getters 156 | */ 157 | @Nullable 158 | public String getDataLayerText() { 159 | return StringUtils.defaultIfEmpty(description, StringUtils.EMPTY); 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /all/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 4.0.0 19 | 20 | 21 | 22 | 23 | 24 | contrib.wcm.components 25 | com.adobe.cq 26 | 0.0.1-SNAPSHOT 27 | ../pom.xml 28 | 29 | 30 | 31 | 32 | 33 | contrib.wcm.components.all 34 | 0.0.1-SNAPSHOT 35 | content-package 36 | 37 | Adobe Experience Manager WCM Components Community Contributions Full Package 38 | 39 | 40 | 41 | 42 | org.apache.jackrabbit 43 | filevault-package-maven-plugin 44 | true 45 | 46 | false 47 | /apps/contrib/wcm/install 48 | 49 | 50 | ${project.groupId} 51 | contrib.wcm.components.bundle 52 | /apps/contrib/wcm/install 53 | 54 | 55 | 56 | 57 | ${project.groupId} 58 | contrib.wcm.components.ui.apps 59 | true 60 | 61 | 62 | 63 | 64 | 65 | com.day.jcr.vault 66 | content-package-maven-plugin 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | autoInstallSinglePackage 77 | 78 | false 79 | 80 | 81 | 82 | 83 | com.day.jcr.vault 84 | content-package-maven-plugin 85 | 86 | 87 | install-package 88 | 89 | install 90 | 91 | 92 | http://${aem.host}:${aem.port}${aem.contextPath}/crx/packmgr/service.jsp 93 | true 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | autoInstallSinglePackagePublish 103 | 104 | false 105 | 106 | 107 | 108 | 109 | com.day.jcr.vault 110 | content-package-maven-plugin 111 | 112 | 113 | install-package-publish 114 | 115 | install 116 | 117 | 118 | http://${aem.publish.host}:${aem.publish.port}${aem.contextPath}/crx/packmgr/service.jsp 119 | true 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | ${project.groupId} 135 | contrib.wcm.components.bundle 136 | ${project.version} 137 | provided 138 | 139 | 140 | ${project.groupId} 141 | contrib.wcm.components.ui.apps 142 | ${project.version} 143 | zip 144 | provided 145 | 146 | 147 | 148 | -------------------------------------------------------------------------------- /ui.apps/.stylelintrc.yaml: -------------------------------------------------------------------------------- 1 | # enables all possible errors (https://stylelint.io/user-guide/rules/#possible-errors) 2 | extends: stylelint-config-recommended 3 | plugins: stylelint-selector-bem-pattern 4 | rules: 5 | # 6 | # limit language features (https://stylelint.io/user-guide/rules/#limit-language-features) 7 | # 8 | 9 | # color 10 | color-named: null 11 | color-no-hex: null 12 | 13 | # function 14 | function-blacklist: null 15 | function-url-no-scheme-relative: null 16 | function-url-scheme-blacklist: null 17 | function-url-scheme-whitelist: null 18 | function-whitelist: null 19 | 20 | # number 21 | number-max-precision: null 22 | 23 | # time 24 | time-min-milliseconds: null 25 | 26 | # unit 27 | unit-blacklist: null 28 | unit-whitelist: null 29 | 30 | # shorthand property 31 | shorthand-property-no-redundant-values: true 32 | 33 | # value 34 | value-no-vendor-prefix: true 35 | 36 | # custom property 37 | custom-property-pattern: null 38 | 39 | # property 40 | property-blacklist: null 41 | property-whitelist: null 42 | 43 | # declaration 44 | declaration-block-no-redundant-longhand-properties: true 45 | declaration-no-important: true 46 | declaration-property-unit-blacklist: null 47 | declaration-property-unit-whitelist: null 48 | declaration-property-value-blacklist: null 49 | declaration-property-value-whitelist: null 50 | 51 | # declaration block 52 | declaration-block-single-line-max-declarations: 1 53 | 54 | # selector 55 | selector-attribute-operator-blacklist: null 56 | selector-attribute-operator-whitelist: null 57 | selector-class-pattern: null 58 | selector-combinator-blacklist: null 59 | selector-combinator-whitelist: null 60 | selector-id-pattern: null 61 | selector-max-attribute: null 62 | selector-max-class: null 63 | selector-max-combinators: null 64 | selector-max-compound-selectors: null 65 | selector-max-empty-lines: 0 66 | selector-max-id: 0 67 | selector-max-pseudo-class: null 68 | selector-max-specificity: null 69 | selector-max-type: 0 70 | selector-max-universal: 0 71 | selector-nested-pattern: null 72 | selector-no-qualifying-type: true 73 | selector-no-vendor-prefix: true 74 | selector-pseudo-class-blacklist: null 75 | selector-pseudo-class-whitelist: null 76 | selector-pseudo-element-blacklist: null 77 | selector-pseudo-element-whitelist: null 78 | 79 | # media feature 80 | media-feature-name-blacklist: null 81 | media-feature-name-no-vendor-prefix: true 82 | media-feature-name-whitelist: null 83 | 84 | # custom media 85 | custom-media-pattern: null 86 | 87 | # @ rule 88 | at-rule-blacklist: null 89 | at-rule-no-vendor-prefix: true 90 | at-rule-whitelist: null 91 | 92 | # comment 93 | comment-word-blacklist: null 94 | 95 | # general 96 | max-nesting-depth: null 97 | no-unknown-animations: true 98 | 99 | # 100 | # stylistic (https://stylelint.io/user-guide/rules/#stylistic-issues) 101 | # 102 | 103 | # color 104 | color-hex-case: lower 105 | color-hex-length: short 106 | 107 | # font 108 | font-family-name-quotes: always-where-recommended 109 | font-weight-notation: null 110 | 111 | # function 112 | function-comma-newline-after: null 113 | function-comma-newline-before: null 114 | function-comma-space-after: always 115 | function-comma-space-before: never 116 | function-max-empty-lines: 0 117 | function-name-case: lower 118 | function-parentheses-newline-inside: null 119 | function-parentheses-space-inside: never 120 | function-url-quotes: always 121 | function-whitespace-after: always 122 | 123 | # number 124 | number-leading-zero: never 125 | number-no-trailing-zeros: true 126 | 127 | # string 128 | string-quotes: double 129 | 130 | # length 131 | length-zero-no-unit: true 132 | 133 | # unit 134 | unit-case: lower 135 | 136 | # value 137 | value-keyword-case: lower 138 | 139 | # value list 140 | value-list-comma-newline-after: null 141 | value-list-comma-newline-before: null 142 | value-list-comma-space-after: always 143 | value-list-comma-space-before: never 144 | value-list-max-empty-lines: 0 145 | 146 | # custom property 147 | custom-property-empty-line-before: null 148 | 149 | # property 150 | property-case: lower 151 | 152 | # declaration 153 | declaration-bang-space-after: never 154 | declaration-bang-space-before: always 155 | declaration-colon-newline-after: null 156 | declaration-colon-space-after: always 157 | declaration-colon-space-before: never 158 | declaration-empty-line-before: null 159 | 160 | # declaration block 161 | declaration-block-semicolon-newline-after: always-multi-line 162 | declaration-block-semicolon-newline-before: null 163 | declaration-block-semicolon-space-after: always-single-line 164 | declaration-block-semicolon-space-before: never 165 | declaration-block-trailing-semicolon: always 166 | 167 | # block 168 | block-closing-brace-empty-line-before: never 169 | block-closing-brace-newline-after: always 170 | block-closing-brace-newline-before: always-multi-line 171 | block-closing-brace-space-after: null 172 | block-closing-brace-space-before: always-single-line 173 | block-opening-brace-newline-after: always-multi-line 174 | block-opening-brace-newline-before: null 175 | block-opening-brace-space-after: always-single-line 176 | block-opening-brace-space-before: always 177 | 178 | # selector 179 | selector-attribute-brackets-space-inside: never 180 | selector-attribute-operator-space-after: never 181 | selector-attribute-operator-space-before: never 182 | selector-attribute-quotes: always 183 | selector-combinator-space-after: always 184 | selector-combinator-space-before: always 185 | selector-descendant-combinator-no-non-space: true 186 | selector-pseudo-class-case: lower 187 | selector-pseudo-class-parentheses-space-inside: never 188 | selector-pseudo-element-case: lower 189 | selector-pseudo-element-colon-notation: single 190 | selector-type-case: lower 191 | 192 | # selector list 193 | selector-list-comma-newline-after: always-multi-line 194 | selector-list-comma-newline-before: null 195 | selector-list-comma-space-after: always 196 | selector-list-comma-space-before: never 197 | 198 | # rule 199 | rule-empty-line-before: 200 | - always-multi-line 201 | - ignore: 202 | - after-comment 203 | - first-nested 204 | 205 | # media feature 206 | media-feature-colon-space-after: always 207 | media-feature-colon-space-before: never 208 | media-feature-name-case: lower 209 | media-feature-parentheses-space-inside: never 210 | media-feature-range-operator-space-after: always 211 | media-feature-range-operator-space-before: always 212 | 213 | # media query list 214 | media-query-list-comma-newline-after: null 215 | media-query-list-comma-newline-before: null 216 | media-query-list-comma-space-after: always 217 | media-query-list-comma-space-before: never 218 | 219 | # @ rule 220 | at-rule-empty-line-before: always 221 | at-rule-name-case: lower 222 | at-rule-name-newline-after: null 223 | at-rule-name-space-after: always 224 | at-rule-semicolon-newline-after: always 225 | at-rule-semicolon-space-before: never 226 | 227 | # comment 228 | comment-empty-line-before: always 229 | comment-whitespace-inside: always 230 | 231 | # general 232 | indentation: 4 233 | max-empty-lines: 1 234 | max-line-length: null 235 | no-eol-whitespace: true 236 | no-missing-end-of-source-newline: true 237 | 238 | # 239 | # plugin 240 | # 241 | plugin/selector-bem-pattern: 242 | preset: bem 243 | presetOptions: 244 | namespace: 'cmp' 245 | -------------------------------------------------------------------------------- /webcomponents/example.customize/.stylelintrc.yaml: -------------------------------------------------------------------------------- 1 | # enables all possible errors (https://stylelint.io/user-guide/rules/#possible-errors) 2 | extends: stylelint-config-recommended 3 | plugins: stylelint-selector-bem-pattern 4 | rules: 5 | # 6 | # limit language features (https://stylelint.io/user-guide/rules/#limit-language-features) 7 | # 8 | 9 | # color 10 | color-named: null 11 | color-no-hex: null 12 | 13 | # function 14 | function-blacklist: null 15 | function-url-no-scheme-relative: null 16 | function-url-scheme-blacklist: null 17 | function-url-scheme-whitelist: null 18 | function-whitelist: null 19 | 20 | # number 21 | number-max-precision: null 22 | 23 | # time 24 | time-min-milliseconds: null 25 | 26 | # unit 27 | unit-blacklist: null 28 | unit-whitelist: null 29 | 30 | # shorthand property 31 | shorthand-property-no-redundant-values: true 32 | 33 | # value 34 | value-no-vendor-prefix: true 35 | 36 | # custom property 37 | custom-property-pattern: null 38 | 39 | # property 40 | property-blacklist: null 41 | property-whitelist: null 42 | 43 | # declaration 44 | declaration-block-no-redundant-longhand-properties: true 45 | declaration-no-important: true 46 | declaration-property-unit-blacklist: null 47 | declaration-property-unit-whitelist: null 48 | declaration-property-value-blacklist: null 49 | declaration-property-value-whitelist: null 50 | 51 | # declaration block 52 | declaration-block-single-line-max-declarations: 1 53 | 54 | # selector 55 | selector-attribute-operator-blacklist: null 56 | selector-attribute-operator-whitelist: null 57 | selector-class-pattern: null 58 | selector-combinator-blacklist: null 59 | selector-combinator-whitelist: null 60 | selector-id-pattern: null 61 | selector-max-attribute: null 62 | selector-max-class: null 63 | selector-max-combinators: null 64 | selector-max-compound-selectors: null 65 | selector-max-empty-lines: 0 66 | selector-max-id: 0 67 | selector-max-pseudo-class: null 68 | selector-max-specificity: null 69 | selector-max-type: 0 70 | selector-max-universal: 0 71 | selector-nested-pattern: null 72 | selector-no-qualifying-type: true 73 | selector-no-vendor-prefix: true 74 | selector-pseudo-class-blacklist: null 75 | selector-pseudo-class-whitelist: null 76 | selector-pseudo-element-blacklist: null 77 | selector-pseudo-element-whitelist: null 78 | 79 | # media feature 80 | media-feature-name-blacklist: null 81 | media-feature-name-no-vendor-prefix: true 82 | media-feature-name-whitelist: null 83 | 84 | # custom media 85 | custom-media-pattern: null 86 | 87 | # @ rule 88 | at-rule-blacklist: null 89 | at-rule-no-vendor-prefix: true 90 | at-rule-whitelist: null 91 | 92 | # comment 93 | comment-word-blacklist: null 94 | 95 | # general 96 | max-nesting-depth: null 97 | no-unknown-animations: true 98 | 99 | # 100 | # stylistic (https://stylelint.io/user-guide/rules/#stylistic-issues) 101 | # 102 | 103 | # color 104 | color-hex-case: lower 105 | color-hex-length: short 106 | 107 | # font 108 | font-family-name-quotes: always-where-recommended 109 | font-weight-notation: null 110 | 111 | # function 112 | function-comma-newline-after: null 113 | function-comma-newline-before: null 114 | function-comma-space-after: always 115 | function-comma-space-before: never 116 | function-max-empty-lines: 0 117 | function-name-case: lower 118 | function-parentheses-newline-inside: null 119 | function-parentheses-space-inside: never 120 | function-url-quotes: always 121 | function-whitespace-after: always 122 | 123 | # number 124 | number-leading-zero: never 125 | number-no-trailing-zeros: true 126 | 127 | # string 128 | string-quotes: double 129 | 130 | # length 131 | length-zero-no-unit: true 132 | 133 | # unit 134 | unit-case: lower 135 | 136 | # value 137 | value-keyword-case: lower 138 | 139 | # value list 140 | value-list-comma-newline-after: null 141 | value-list-comma-newline-before: null 142 | value-list-comma-space-after: always 143 | value-list-comma-space-before: never 144 | value-list-max-empty-lines: 0 145 | 146 | # custom property 147 | custom-property-empty-line-before: null 148 | 149 | # property 150 | property-case: lower 151 | 152 | # declaration 153 | declaration-bang-space-after: never 154 | declaration-bang-space-before: always 155 | declaration-colon-newline-after: null 156 | declaration-colon-space-after: always 157 | declaration-colon-space-before: never 158 | declaration-empty-line-before: null 159 | 160 | # declaration block 161 | declaration-block-semicolon-newline-after: always-multi-line 162 | declaration-block-semicolon-newline-before: null 163 | declaration-block-semicolon-space-after: always-single-line 164 | declaration-block-semicolon-space-before: never 165 | declaration-block-trailing-semicolon: always 166 | 167 | # block 168 | block-closing-brace-empty-line-before: never 169 | block-closing-brace-newline-after: always 170 | block-closing-brace-newline-before: always-multi-line 171 | block-closing-brace-space-after: null 172 | block-closing-brace-space-before: always-single-line 173 | block-opening-brace-newline-after: always-multi-line 174 | block-opening-brace-newline-before: null 175 | block-opening-brace-space-after: always-single-line 176 | block-opening-brace-space-before: always 177 | 178 | # selector 179 | selector-attribute-brackets-space-inside: never 180 | selector-attribute-operator-space-after: never 181 | selector-attribute-operator-space-before: never 182 | selector-attribute-quotes: always 183 | selector-combinator-space-after: always 184 | selector-combinator-space-before: always 185 | selector-descendant-combinator-no-non-space: true 186 | selector-pseudo-class-case: lower 187 | selector-pseudo-class-parentheses-space-inside: never 188 | selector-pseudo-element-case: lower 189 | selector-pseudo-element-colon-notation: single 190 | selector-type-case: lower 191 | 192 | # selector list 193 | selector-list-comma-newline-after: always-multi-line 194 | selector-list-comma-newline-before: null 195 | selector-list-comma-space-after: always 196 | selector-list-comma-space-before: never 197 | 198 | # rule 199 | rule-empty-line-before: 200 | - always-multi-line 201 | - ignore: 202 | - after-comment 203 | - first-nested 204 | 205 | # media feature 206 | media-feature-colon-space-after: always 207 | media-feature-colon-space-before: never 208 | media-feature-name-case: lower 209 | media-feature-parentheses-space-inside: never 210 | media-feature-range-operator-space-after: always 211 | media-feature-range-operator-space-before: always 212 | 213 | # media query list 214 | media-query-list-comma-newline-after: null 215 | media-query-list-comma-newline-before: null 216 | media-query-list-comma-space-after: always 217 | media-query-list-comma-space-before: never 218 | 219 | # @ rule 220 | at-rule-empty-line-before: always 221 | at-rule-name-case: lower 222 | at-rule-name-newline-after: null 223 | at-rule-name-space-after: always 224 | at-rule-semicolon-newline-after: always 225 | at-rule-semicolon-space-before: never 226 | 227 | # comment 228 | comment-empty-line-before: always 229 | comment-whitespace-inside: always 230 | 231 | # general 232 | indentation: 4 233 | max-empty-lines: 1 234 | max-line-length: null 235 | no-eol-whitespace: true 236 | no-missing-end-of-source-newline: true 237 | 238 | # 239 | # plugin 240 | # 241 | plugin/selector-bem-pattern: 242 | preset: bem 243 | presetOptions: 244 | namespace: 'cmp' 245 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.litelement/.stylelintrc.yaml: -------------------------------------------------------------------------------- 1 | # enables all possible errors (https://stylelint.io/user-guide/rules/#possible-errors) 2 | extends: stylelint-config-recommended 3 | plugins: stylelint-selector-bem-pattern 4 | rules: 5 | # 6 | # limit language features (https://stylelint.io/user-guide/rules/#limit-language-features) 7 | # 8 | 9 | # color 10 | color-named: null 11 | color-no-hex: null 12 | 13 | # function 14 | function-blacklist: null 15 | function-url-no-scheme-relative: null 16 | function-url-scheme-blacklist: null 17 | function-url-scheme-whitelist: null 18 | function-whitelist: null 19 | 20 | # number 21 | number-max-precision: null 22 | 23 | # time 24 | time-min-milliseconds: null 25 | 26 | # unit 27 | unit-blacklist: null 28 | unit-whitelist: null 29 | 30 | # shorthand property 31 | shorthand-property-no-redundant-values: true 32 | 33 | # value 34 | value-no-vendor-prefix: true 35 | 36 | # custom property 37 | custom-property-pattern: null 38 | 39 | # property 40 | property-blacklist: null 41 | property-whitelist: null 42 | 43 | # declaration 44 | declaration-block-no-redundant-longhand-properties: true 45 | declaration-no-important: true 46 | declaration-property-unit-blacklist: null 47 | declaration-property-unit-whitelist: null 48 | declaration-property-value-blacklist: null 49 | declaration-property-value-whitelist: null 50 | 51 | # declaration block 52 | declaration-block-single-line-max-declarations: 1 53 | 54 | # selector 55 | selector-attribute-operator-blacklist: null 56 | selector-attribute-operator-whitelist: null 57 | selector-class-pattern: null 58 | selector-combinator-blacklist: null 59 | selector-combinator-whitelist: null 60 | selector-id-pattern: null 61 | selector-max-attribute: null 62 | selector-max-class: null 63 | selector-max-combinators: null 64 | selector-max-compound-selectors: null 65 | selector-max-empty-lines: 0 66 | selector-max-id: 0 67 | selector-max-pseudo-class: null 68 | selector-max-specificity: null 69 | selector-max-type: 0 70 | selector-max-universal: 0 71 | selector-nested-pattern: null 72 | selector-no-qualifying-type: true 73 | selector-no-vendor-prefix: true 74 | selector-pseudo-class-blacklist: null 75 | selector-pseudo-class-whitelist: null 76 | selector-pseudo-element-blacklist: null 77 | selector-pseudo-element-whitelist: null 78 | 79 | # media feature 80 | media-feature-name-blacklist: null 81 | media-feature-name-no-vendor-prefix: true 82 | media-feature-name-whitelist: null 83 | 84 | # custom media 85 | custom-media-pattern: null 86 | 87 | # @ rule 88 | at-rule-blacklist: null 89 | at-rule-no-vendor-prefix: true 90 | at-rule-whitelist: null 91 | 92 | # comment 93 | comment-word-blacklist: null 94 | 95 | # general 96 | max-nesting-depth: null 97 | no-unknown-animations: true 98 | 99 | # 100 | # stylistic (https://stylelint.io/user-guide/rules/#stylistic-issues) 101 | # 102 | 103 | # color 104 | color-hex-case: lower 105 | color-hex-length: short 106 | 107 | # font 108 | font-family-name-quotes: always-where-recommended 109 | font-weight-notation: null 110 | 111 | # function 112 | function-comma-newline-after: null 113 | function-comma-newline-before: null 114 | function-comma-space-after: always 115 | function-comma-space-before: never 116 | function-max-empty-lines: 0 117 | function-name-case: lower 118 | function-parentheses-newline-inside: null 119 | function-parentheses-space-inside: never 120 | function-url-quotes: always 121 | function-whitespace-after: always 122 | 123 | # number 124 | number-leading-zero: never 125 | number-no-trailing-zeros: true 126 | 127 | # string 128 | string-quotes: double 129 | 130 | # length 131 | length-zero-no-unit: true 132 | 133 | # unit 134 | unit-case: lower 135 | 136 | # value 137 | value-keyword-case: lower 138 | 139 | # value list 140 | value-list-comma-newline-after: null 141 | value-list-comma-newline-before: null 142 | value-list-comma-space-after: always 143 | value-list-comma-space-before: never 144 | value-list-max-empty-lines: 0 145 | 146 | # custom property 147 | custom-property-empty-line-before: null 148 | 149 | # property 150 | property-case: lower 151 | 152 | # declaration 153 | declaration-bang-space-after: never 154 | declaration-bang-space-before: always 155 | declaration-colon-newline-after: null 156 | declaration-colon-space-after: always 157 | declaration-colon-space-before: never 158 | declaration-empty-line-before: null 159 | 160 | # declaration block 161 | declaration-block-semicolon-newline-after: always-multi-line 162 | declaration-block-semicolon-newline-before: null 163 | declaration-block-semicolon-space-after: always-single-line 164 | declaration-block-semicolon-space-before: never 165 | declaration-block-trailing-semicolon: always 166 | 167 | # block 168 | block-closing-brace-empty-line-before: never 169 | block-closing-brace-newline-after: always 170 | block-closing-brace-newline-before: always-multi-line 171 | block-closing-brace-space-after: null 172 | block-closing-brace-space-before: always-single-line 173 | block-opening-brace-newline-after: always-multi-line 174 | block-opening-brace-newline-before: null 175 | block-opening-brace-space-after: always-single-line 176 | block-opening-brace-space-before: always 177 | 178 | # selector 179 | selector-attribute-brackets-space-inside: never 180 | selector-attribute-operator-space-after: never 181 | selector-attribute-operator-space-before: never 182 | selector-attribute-quotes: always 183 | selector-combinator-space-after: always 184 | selector-combinator-space-before: always 185 | selector-descendant-combinator-no-non-space: true 186 | selector-pseudo-class-case: lower 187 | selector-pseudo-class-parentheses-space-inside: never 188 | selector-pseudo-element-case: lower 189 | selector-pseudo-element-colon-notation: single 190 | selector-type-case: lower 191 | 192 | # selector list 193 | selector-list-comma-newline-after: always-multi-line 194 | selector-list-comma-newline-before: null 195 | selector-list-comma-space-after: always 196 | selector-list-comma-space-before: never 197 | 198 | # rule 199 | rule-empty-line-before: 200 | - always-multi-line 201 | - ignore: 202 | - after-comment 203 | - first-nested 204 | 205 | # media feature 206 | media-feature-colon-space-after: always 207 | media-feature-colon-space-before: never 208 | media-feature-name-case: lower 209 | media-feature-parentheses-space-inside: never 210 | media-feature-range-operator-space-after: always 211 | media-feature-range-operator-space-before: always 212 | 213 | # media query list 214 | media-query-list-comma-newline-after: null 215 | media-query-list-comma-newline-before: null 216 | media-query-list-comma-space-after: always 217 | media-query-list-comma-space-before: never 218 | 219 | # @ rule 220 | at-rule-empty-line-before: always 221 | at-rule-name-case: lower 222 | at-rule-name-newline-after: null 223 | at-rule-name-space-after: always 224 | at-rule-semicolon-newline-after: always 225 | at-rule-semicolon-space-before: never 226 | 227 | # comment 228 | comment-empty-line-before: always 229 | comment-whitespace-inside: always 230 | 231 | # general 232 | indentation: 4 233 | max-empty-lines: 1 234 | max-line-length: null 235 | no-eol-whitespace: true 236 | no-missing-end-of-source-newline: true 237 | 238 | # 239 | # plugin 240 | # 241 | plugin/selector-bem-pattern: 242 | preset: bem 243 | presetOptions: 244 | namespace: 'cmp' 245 | -------------------------------------------------------------------------------- /webcomponents/ui.frontend.vanilla/.stylelintrc.yaml: -------------------------------------------------------------------------------- 1 | # enables all possible errors (https://stylelint.io/user-guide/rules/#possible-errors) 2 | extends: stylelint-config-recommended 3 | plugins: stylelint-selector-bem-pattern 4 | rules: 5 | # 6 | # limit language features (https://stylelint.io/user-guide/rules/#limit-language-features) 7 | # 8 | 9 | # color 10 | color-named: null 11 | color-no-hex: null 12 | 13 | # function 14 | function-blacklist: null 15 | function-url-no-scheme-relative: null 16 | function-url-scheme-blacklist: null 17 | function-url-scheme-whitelist: null 18 | function-whitelist: null 19 | 20 | # number 21 | number-max-precision: null 22 | 23 | # time 24 | time-min-milliseconds: null 25 | 26 | # unit 27 | unit-blacklist: null 28 | unit-whitelist: null 29 | 30 | # shorthand property 31 | shorthand-property-no-redundant-values: true 32 | 33 | # value 34 | value-no-vendor-prefix: true 35 | 36 | # custom property 37 | custom-property-pattern: null 38 | 39 | # property 40 | property-blacklist: null 41 | property-whitelist: null 42 | 43 | # declaration 44 | declaration-block-no-redundant-longhand-properties: true 45 | declaration-no-important: true 46 | declaration-property-unit-blacklist: null 47 | declaration-property-unit-whitelist: null 48 | declaration-property-value-blacklist: null 49 | declaration-property-value-whitelist: null 50 | 51 | # declaration block 52 | declaration-block-single-line-max-declarations: 1 53 | 54 | # selector 55 | selector-attribute-operator-blacklist: null 56 | selector-attribute-operator-whitelist: null 57 | selector-class-pattern: null 58 | selector-combinator-blacklist: null 59 | selector-combinator-whitelist: null 60 | selector-id-pattern: null 61 | selector-max-attribute: null 62 | selector-max-class: null 63 | selector-max-combinators: null 64 | selector-max-compound-selectors: null 65 | selector-max-empty-lines: 0 66 | selector-max-id: 0 67 | selector-max-pseudo-class: null 68 | selector-max-specificity: null 69 | selector-max-type: 0 70 | selector-max-universal: 0 71 | selector-nested-pattern: null 72 | selector-no-qualifying-type: true 73 | selector-no-vendor-prefix: true 74 | selector-pseudo-class-blacklist: null 75 | selector-pseudo-class-whitelist: null 76 | selector-pseudo-element-blacklist: null 77 | selector-pseudo-element-whitelist: null 78 | 79 | # media feature 80 | media-feature-name-blacklist: null 81 | media-feature-name-no-vendor-prefix: true 82 | media-feature-name-whitelist: null 83 | 84 | # custom media 85 | custom-media-pattern: null 86 | 87 | # @ rule 88 | at-rule-blacklist: null 89 | at-rule-no-vendor-prefix: true 90 | at-rule-whitelist: null 91 | 92 | # comment 93 | comment-word-blacklist: null 94 | 95 | # general 96 | max-nesting-depth: null 97 | no-unknown-animations: true 98 | 99 | # 100 | # stylistic (https://stylelint.io/user-guide/rules/#stylistic-issues) 101 | # 102 | 103 | # color 104 | color-hex-case: lower 105 | color-hex-length: short 106 | 107 | # font 108 | font-family-name-quotes: always-where-recommended 109 | font-weight-notation: null 110 | 111 | # function 112 | function-comma-newline-after: null 113 | function-comma-newline-before: null 114 | function-comma-space-after: always 115 | function-comma-space-before: never 116 | function-max-empty-lines: 0 117 | function-name-case: lower 118 | function-parentheses-newline-inside: null 119 | function-parentheses-space-inside: never 120 | function-url-quotes: always 121 | function-whitespace-after: always 122 | 123 | # number 124 | number-leading-zero: never 125 | number-no-trailing-zeros: true 126 | 127 | # string 128 | string-quotes: double 129 | 130 | # length 131 | length-zero-no-unit: true 132 | 133 | # unit 134 | unit-case: lower 135 | 136 | # value 137 | value-keyword-case: lower 138 | 139 | # value list 140 | value-list-comma-newline-after: null 141 | value-list-comma-newline-before: null 142 | value-list-comma-space-after: always 143 | value-list-comma-space-before: never 144 | value-list-max-empty-lines: 0 145 | 146 | # custom property 147 | custom-property-empty-line-before: null 148 | 149 | # property 150 | property-case: lower 151 | 152 | # declaration 153 | declaration-bang-space-after: never 154 | declaration-bang-space-before: always 155 | declaration-colon-newline-after: null 156 | declaration-colon-space-after: always 157 | declaration-colon-space-before: never 158 | declaration-empty-line-before: null 159 | 160 | # declaration block 161 | declaration-block-semicolon-newline-after: always-multi-line 162 | declaration-block-semicolon-newline-before: null 163 | declaration-block-semicolon-space-after: always-single-line 164 | declaration-block-semicolon-space-before: never 165 | declaration-block-trailing-semicolon: always 166 | 167 | # block 168 | block-closing-brace-empty-line-before: never 169 | block-closing-brace-newline-after: always 170 | block-closing-brace-newline-before: always-multi-line 171 | block-closing-brace-space-after: null 172 | block-closing-brace-space-before: always-single-line 173 | block-opening-brace-newline-after: always-multi-line 174 | block-opening-brace-newline-before: null 175 | block-opening-brace-space-after: always-single-line 176 | block-opening-brace-space-before: always 177 | 178 | # selector 179 | selector-attribute-brackets-space-inside: never 180 | selector-attribute-operator-space-after: never 181 | selector-attribute-operator-space-before: never 182 | selector-attribute-quotes: always 183 | selector-combinator-space-after: always 184 | selector-combinator-space-before: always 185 | selector-descendant-combinator-no-non-space: true 186 | selector-pseudo-class-case: lower 187 | selector-pseudo-class-parentheses-space-inside: never 188 | selector-pseudo-element-case: lower 189 | selector-pseudo-element-colon-notation: single 190 | selector-type-case: lower 191 | 192 | # selector list 193 | selector-list-comma-newline-after: always-multi-line 194 | selector-list-comma-newline-before: null 195 | selector-list-comma-space-after: always 196 | selector-list-comma-space-before: never 197 | 198 | # rule 199 | rule-empty-line-before: 200 | - always-multi-line 201 | - ignore: 202 | - after-comment 203 | - first-nested 204 | 205 | # media feature 206 | media-feature-colon-space-after: always 207 | media-feature-colon-space-before: never 208 | media-feature-name-case: lower 209 | media-feature-parentheses-space-inside: never 210 | media-feature-range-operator-space-after: always 211 | media-feature-range-operator-space-before: always 212 | 213 | # media query list 214 | media-query-list-comma-newline-after: null 215 | media-query-list-comma-newline-before: null 216 | media-query-list-comma-space-after: always 217 | media-query-list-comma-space-before: never 218 | 219 | # @ rule 220 | at-rule-empty-line-before: always 221 | at-rule-name-case: lower 222 | at-rule-name-newline-after: null 223 | at-rule-name-space-after: always 224 | at-rule-semicolon-newline-after: always 225 | at-rule-semicolon-space-before: never 226 | 227 | # comment 228 | comment-empty-line-before: always 229 | comment-whitespace-inside: always 230 | 231 | # general 232 | indentation: 4 233 | max-empty-lines: 1 234 | max-line-length: null 235 | no-eol-whitespace: true 236 | no-missing-end-of-source-newline: true 237 | 238 | # 239 | # plugin 240 | # 241 | plugin/selector-bem-pattern: 242 | preset: bem 243 | presetOptions: 244 | namespace: 'cmp' 245 | --------------------------------------------------------------------------------