This is a UI component dev environment for your plain AEM snippets.
4 |
5 | We've added some basic stories inside the components directory.
6 |
7 | A story is a single state of one or more UI components. You can have as many stories as you want.
8 |
9 | (Basically a story is like a visual test case.)
10 |
19 |
--------------------------------------------------------------------------------
/examples/aem-kitchen-sink/.storybook/main.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | stories: [
3 | `../stories/*.stories.*`,
4 | `../components/**/*.stories.*`,
5 | ],
6 | addons: [
7 | "@storybook/addon-a11y",
8 | "@storybook/addon-actions",
9 | "@storybook/addon-backgrounds",
10 | "@storybook/addon-events",
11 | "@storybook/addon-jest",
12 | "@storybook/addon-knobs",
13 | "@storybook/addon-links",
14 | "@storybook/addon-options",
15 | "@storybook/addon-storysource",
16 | "@storybook/addon-viewport",
17 | '@storybook/addon-docs',
18 | ]
19 | };
20 |
21 | // need to specify the additional jcrRoots from dependencies
22 | AEMRegisterJcrRoot(require('aem-sb-js-core-components/config').jcrRoots);
23 |
--------------------------------------------------------------------------------
/examples/aem-kitchen-sink/components/accordion/example_content.json:
--------------------------------------------------------------------------------
1 | {
2 | ":type": "components/accordion",
3 | "headingElement": "h3",
4 | "singleExpansion": false,
5 | "expandedItems": [],
6 | ":items": {
7 | "item_1": {
8 | ":type": "components/text",
9 | "text": "Accordion Item 1",
10 | "title": "Title 1 - Open",
11 | "textIsRich": true
12 | },
13 | "item_2": {
14 | ":type": "components/text",
15 | "text": "Accordion Item 2",
16 | "title": "Title 2",
17 | "textIsRich": true
18 | },
19 | "item_3": {
20 | ":type": "components/text",
21 | "text": "Accordion Item 3",
22 | "title": "Title 3",
23 | "textIsRich": true
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/aem/src/client/preview/decorators/decorators.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-param-reassign */
2 | import { AemMetadata } from '../types/types';
3 |
4 | export const aemMetadata = (metadata: Partial) => async (storyFn: () => any) => {
5 | const story = await storyFn();
6 | const storyMetadata = story.aemMetadata || {};
7 | metadata = metadata || {};
8 |
9 | return {
10 | ...story,
11 | aemMetadata: {
12 | components: [...(metadata.components || []), ...(storyMetadata.components || [])],
13 | decorationTag: metadata.decorationTag || storyMetadata.decorationTag || {},
14 | models: metadata.models || storyMetadata.models || {},
15 | roots: metadata.roots || storyMetadata.roots || [],
16 | },
17 | };
18 | };
19 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v1/container/new/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v2/container/new/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | app/aem/dist
2 | app/aem/node_modules
3 | node_modules
4 | dist
5 | lib/**/dll
6 | build
7 | coverage
8 | docs/public
9 | storybook-static
10 | built-storybooks
11 | lib/cli/test
12 | lib/codemod/src/transforms/__testfixtures__
13 | scripts/storage
14 | *.bundle.js
15 | *.js.map
16 | *.d.ts
17 | examples/ember-cli/.storybook/preview-head.html
18 | examples/official-storybook/tests/addon-jest.test.js
19 | examples/cra-ts-kitchen-sink/*.json
20 | examples/cra-ts-kitchen-sink/public/*
21 | examples/cra-ts-essentials/*.json
22 | examples/cra-ts-essentials/public/*
23 | examples/rax-kitchen-sink/src/document/*
24 | .yarn
25 | !.remarkrc.js
26 | !.babelrc.js
27 | !.eslintrc.js
28 | !.eslintrc-markdown.js
29 | !.jest.config.js
30 | !.storybook
31 |
32 | # Lint ignore examples for now
33 | examples
34 |
--------------------------------------------------------------------------------
/examples/aem-kitchen-sink/components/list/clientlibs/styles/list.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Adobe. All rights reserved.
3 | * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4 | * you may not use this file except in compliance with the License. You may obtain a copy
5 | * of the License at http://www.apache.org/licenses/LICENSE-2.0
6 | *
7 | * Unless required by applicable law or agreed to in writing, software distributed under
8 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific language
10 | * governing permissions and limitations under the License.
11 | */
12 | .cmp-list__item-description {
13 | display: block;
14 | margin-bottom: 8px;
15 | }
16 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/com/adobe/cq/wcm/core/components/models/Component.js:
--------------------------------------------------------------------------------
1 | import AbstractComponent from "./AbstractComponent";
2 |
3 | export default class Component extends AbstractComponent {
4 | constructor(content, context) {
5 | super(content, context)
6 | this.content = content;
7 | }
8 |
9 | /**
10 | * Name of the resource property that indicates the HTML id for the component.
11 | *
12 | * @since com.adobe.cq.wcm.core.components.models 12.8.0
13 | */
14 | static PN_ID = "id";
15 |
16 | /**
17 | * Returns the HTML id of the the component's root element
18 | *
19 | * @todo: how to implement ?
20 | *
21 | * @return HTML id of the component's root element
22 | * @since com.adobe.cq.wcm.core.components.models 12.8.0
23 | */
24 | get id() {
25 | return '';
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/accordion/v1/accordion/example_content.json:
--------------------------------------------------------------------------------
1 | {
2 | ":type": "core/wcm/components/accordion/v1/accordion",
3 | "headingElement": "h3",
4 | "singleExpansion": false,
5 | "expandedItems": [],
6 | ":items": {
7 | "item_1": {
8 | ":type": "core/wcm/components/text/v2/text",
9 | "text": "Accordion Item 1",
10 | "title": "Title 1",
11 | "textIsRich": true
12 | },
13 | "item_2": {
14 | ":type": "core/wcm/components/text/v2/text",
15 | "text": "Accordion Item 2",
16 | "title": "Title 2",
17 | "textIsRich": true
18 | },
19 | "item_3": {
20 | ":type": "core/wcm/components/text/v2/text",
21 | "text": "Accordion Item 3",
22 | "title": "Title 3",
23 | "textIsRich": true
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/v2/image/clientlibs/site/css/image.less:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 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 | /** @define image */
18 | .cmp-image__image {
19 | width: 100%;
20 | }
21 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/com/adobe/cq/wcm/core/components/models/form/Button.js:
--------------------------------------------------------------------------------
1 | export default class Button {
2 | static clazz = 'com.adobe.cq.wcm.core.components.models.form.Button';
3 |
4 | constructor(content) {
5 | this.content = content;
6 | }
7 |
8 | get id(){
9 | return this.content.id;
10 | }
11 |
12 | get title(){
13 | return this.content.title;
14 | }
15 |
16 | get name() {
17 | return this.content.name;
18 | }
19 |
20 | get value() {
21 | return this.content.value;
22 | }
23 |
24 | get type() {
25 | return this.content.type;
26 | }
27 |
28 | get helpMessage() {
29 | return this.content.helpMessage;
30 | }
31 |
32 | get exportedType() {
33 | return 'core/wcm/components/form/button/v2/button';
34 | }
35 | }
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/com/adobe/cq/wcm/core/components/models/Separator.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Defines the {@code Separator} Sling Model used for the {@code /apps/core/wcm/components/Separator} component.
3 | *
4 | * @since com.adobe.cq.wcm.core.components.models 11.0.0
5 | */
6 | export default class Separator {
7 | static clazz = 'com.adobe.cq.wcm.core.components.models.Separator';
8 |
9 | constructor(content) {
10 | this.content = content;
11 | }
12 |
13 | get id() {
14 | return this.content.id;
15 | }
16 |
17 | /**
18 | * @see ComponentExporter#getExportedType()
19 | * @since com.adobe.cq.wcm.core.components.models 12.2.0
20 | */
21 | get exportedType() {
22 | // return this.resource.getResourceType();
23 | return 'wcm/core/components/Separator/v1/Separator';
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v1/container/clientlibs/site/less/container.less:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 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 | .core-form-control {
18 | display: block;
19 | width: 100%;
20 | }
21 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "baseUrl": ".",
5 | "incremental": false,
6 | "noImplicitAny": false,
7 | "experimentalDecorators": true,
8 | "emitDecoratorMetadata": true,
9 | "jsx": "react",
10 | "module": "commonJs",
11 | "skipDefaultLibCheck": true,
12 | "skipLibCheck": true,
13 | "allowSyntheticDefaultImports": true,
14 | "esModuleInterop": true,
15 | "target": "es5",
16 | "types": ["jest"],
17 | "lib": ["es2017", "dom"],
18 | "allowJs": true
19 | },
20 | "exclude": [
21 | "**/dist",
22 | "node_modules",
23 | "**/node_modules",
24 | "**/*.spec.ts",
25 | "**/__tests__",
26 | "**/*.test.ts",
27 | "examples",
28 | "scripts",
29 | "app/aem/bin",
30 | "app/aem/standalone.js",
31 | "tsconfig.json"
32 | ]
33 | }
34 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/text/v2/text/example_content.json:
--------------------------------------------------------------------------------
1 | {
2 | "jcr:primaryType": "nt:unstructured",
3 | "jcr:title": "Custom title",
4 | "jcr:createdBy": "admin",
5 | "jcr:created": "Wed Oct 05 2016 16:28:06 GMT+0530",
6 | "constraintMessage": "The value should be a valid email address",
7 | "showHideExpression": "((givenName.equals(\"\"Referees\"\")))",
8 | "readOnly": true,
9 | "helpMessage": "Custom help/placeholder message",
10 | "required": true,
11 | "name": "Custom Name",
12 | "type": "email",
13 | "useTextarea": true,
14 | "value": "Prefilled Sample Input",
15 | "sling:resourceType": "core/wcm/components/form/text/v2/text",
16 | "requiredMessage": "please fill the field",
17 | "usePlaceholder": "true",
18 | "rows": 3,
19 | "hideTitle": true
20 | }
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/download/v1/download/clientlibs/editor/css/download.less:
--------------------------------------------------------------------------------
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 | .cq-Dialog:not([fullscreen]) .cmp-download__editor .cq-RichText-editable {
18 | height: initial;
19 | }
20 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/text/v2/text/clientlibs/site/js.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2016 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 |
19 | text.js
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/search/v1/search/clientlibs/site/js.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2017 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 |
19 | search.js
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/embed/v1/embed/clientlibs/editor/js.txt:
--------------------------------------------------------------------------------
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 | #base=js
18 |
19 | embed.js
20 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v1/container/clientlibs/site/css.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2016 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 | less/container.less
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/options/v1/options/clientlibs/editor/css.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2016 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 | less/options-dialog.less
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/v2/image/clientlibs/site/css.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2017 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=css
18 |
19 | image.less
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/search/v1/search/clientlibs/site/css.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2017 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=css
18 |
19 | search.less
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/tabs/v1/tabs/clientlibs/site/css.txt:
--------------------------------------------------------------------------------
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 | #base=css
18 |
19 | tabs.css
20 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/embed/v1/embed/clientlibs/editor/css.txt:
--------------------------------------------------------------------------------
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 | #base=css
18 |
19 | embed.less
20 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/button/v2/button/form-button.stories.js:
--------------------------------------------------------------------------------
1 | import { withKnobs, text } from '@storybook/addon-knobs';
2 |
3 | export default {
4 | title: 'AEM Form Button',
5 | decorators: [
6 | withKnobs,
7 | ],
8 | parameters: {
9 | knobs: {
10 | escapeHTML: false,
11 | },
12 | },
13 | };
14 |
15 | export const FormButtonV2 = () => {
16 | return {
17 | content: {
18 | 'name' : text('Name', 'name1'),
19 | 'value' : text('Value', 'value1'),
20 | 'type' : text('Type', 'button'),
21 | 'title' : text('Title', 'title'),
22 | 'id' : text('ID', 'button-id'),
23 | 'helpMessage' : text('Help message', 'my help message')
24 | },
25 | resourceType: 'core/wcm/components/form/button/v2/button', // todo: derive from path
26 | };
27 | };
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v1/container/clientlibs/editor/js.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2016 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 | container.js
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/carousel/v1/carousel/clientlibs/editor/js.txt:
--------------------------------------------------------------------------------
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 | #base=js
18 |
19 | carousel.js
20 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/carousel/v1/carousel/clientlibs/site/js.txt:
--------------------------------------------------------------------------------
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 | #base=js
18 |
19 | carousel.js
20 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/download/v1/download/clientlibs/editor/js.txt:
--------------------------------------------------------------------------------
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 | #base=js
18 |
19 | download.js
20 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/options/v2/options/clientlibs/editor/css.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2016 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=css
18 |
19 | options.less
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/v2/image/clientlibs/site/js.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2016 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 |
19 | polyfills.js
20 | image.js
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/navigation/v1/navigation/clientlibs/editor/js.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2017 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 |
19 | navigation.js
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/carousel/v1/carousel/clientlibs/site/css.txt:
--------------------------------------------------------------------------------
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 | #base=css
18 |
19 | carousel.less
20 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/container/v1/container/clientlibs/editor/js.txt:
--------------------------------------------------------------------------------
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 | #base=js
18 |
19 | container.js
20 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/download/v1/download/clientlibs/editor/css.txt:
--------------------------------------------------------------------------------
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 | #base=css
18 |
19 | download.less
20 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v2/container/clientlibs/editor/js.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2016 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 |
19 | container.js
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/tabs/v1/tabs/clientlibs/site/js.txt:
--------------------------------------------------------------------------------
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 | #base=js
18 |
19 | polyfills.js
20 | tabs.js
21 |
--------------------------------------------------------------------------------
/app/aem/src/client/preview/helpers/Page.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Simple AEM page implementation
3 | */
4 | export default class Page {
5 | constructor(path = '', node = {}, repo) {
6 | this.path = path;
7 | this.node = node;
8 | this.content = node['jcr:content'] || {};
9 | this.repo = repo || node;
10 | this._path = path.split('/').filter((s) => s);
11 | }
12 |
13 | getDepth() {
14 | return this._path.length;
15 | }
16 |
17 | getAbsoluteParent(level) {
18 | let node = this.repo;
19 | let idx = 0;
20 | let path = '';
21 | while (idx < level && node) {
22 | const seg = this._path[idx++];
23 | node = node[seg];
24 | path += `/${seg}`
25 | }
26 | return node ? new Page(path, node, this.repo) : null;
27 | }
28 |
29 | equals(other) {
30 | return this.path === other.path;
31 | }
32 |
33 | isHideInNav() {
34 | return !!this.content.hideInNav;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/breadcrumb/v2/breadcrumb/clientlibs/site/css.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2016 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=css
18 |
19 | breadcrumb.css
20 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/carousel/v1/carousel/clientlibs/editorhook/js.txt:
--------------------------------------------------------------------------------
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 | #base=js
18 |
19 | panelcontainer.js
20 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/embed/v1/embed/embeddable/embeddable.html:
--------------------------------------------------------------------------------
1 |
16 |
${'Embeddable' @ i18n}
--------------------------------------------------------------------------------
/examples/aem-kitchen-sink/components/person/person.stories.js:
--------------------------------------------------------------------------------
1 | import { withKnobs, text } from "@storybook/addon-knobs";
2 | import { aemMetadata } from '@storybook/aem';
3 | import PersonTemplate from './person.html';
4 |
5 | // todo: simplify; include automatically during compilation
6 |
7 | export default {
8 | title: 'Person',
9 | decorators: [
10 | withKnobs,
11 | aemMetadata({
12 | decorationTag: {
13 | cssClasses: ['person','component'],
14 | tagName: 'article'
15 | }
16 | }),
17 | ],
18 | parameters: {
19 | knobs: {
20 | escapeHTML: false,
21 | },
22 | },
23 | };
24 |
25 | export const Person = () => {
26 | return {
27 | content: {
28 | firstName: text('First Name', 'John' ),
29 | lastName: text('Last Name', 'Doe' ),
30 | },
31 | props: {
32 | 'jcr:title': 'Person Component'
33 | },
34 | template: PersonTemplate,
35 | };
36 | };
37 |
--------------------------------------------------------------------------------
/examples/aem-kitchen-sink/components/text/text.stories.mdx:
--------------------------------------------------------------------------------
1 | import { boolean, object, select, text, withKnobs } from '@storybook/addon-knobs';
2 | import { Story, Meta, Preview, Props } from '@storybook/addon-docs/blocks';
3 | import { aemMetadata, GenericModel } from '@storybook/aem';
4 | import TextTemplate from './text.html';
5 |
6 |
10 |
11 | # Text MDX test
12 |
13 |
14 | {{
15 | content: {
16 | text: text('text', 'Hello, world.' ),
17 | isRichText: boolean('isRichText', false),
18 | },
19 | template: TextTemplate,
20 | }}
21 |
22 |
23 |
24 |
25 | ## More info
26 |
27 | We want your feedback to help make this more useful! Make sure to add GitHub Issues as you need new features or find bugs.
28 | If you wan to tackle an issue, make sure to provide any additional documentation here.
29 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/embed/v1/embed/clientlibs/editor/css/embed.less:
--------------------------------------------------------------------------------
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 | // displays the type radios horizontally
18 | .cmp-embed-dialog-edit__type coral-radio { /* stylelint-disable-line */
19 | display: inline-block !important; /* stylelint-disable-line declaration-no-important */
20 | }
21 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/com/adobe/cq/wcm/core/components/models/PanelContainer.js:
--------------------------------------------------------------------------------
1 | import PanelContainerItem from './PanelContainerItem';
2 | import Container from './Container';
3 |
4 | export default class PanelContainer extends Container {
5 | /**
6 | * @protected
7 | */
8 | readItems() {
9 | // todo: the models should either be based on JCR content or content.json.
10 | // todo: eg, the accordion is using the content.json
11 | const items = Object.entries(this.content)
12 | .filter(([key, value]) => (typeof value === 'object'))
13 | .map(([key, value]) => {
14 | return new PanelContainerItem({
15 | ':name': key,
16 | ':type': value['sling:resourceType'],
17 | ...value
18 | })
19 | });
20 | // hack to provide a size property of the expected java collection.
21 | items.size = items.length;
22 | return items;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/breadcrumb/v2/breadcrumb/clientlibs/site/css/breadcrumb.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 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 | /** @define breadcrumb */
18 | .cmp-breadcrumb {
19 | display: inline-block;
20 | list-style: none;
21 | padding: 0;
22 | }
23 |
24 | .cmp-breadcrumb__item {
25 | display: inline-block;
26 | vertical-align: top;
27 | }
28 |
--------------------------------------------------------------------------------
/examples/aem-kitchen-sink/components/accordion/clientlibs/site/js/polyfills.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Element.matches()
3 | * https://developer.mozilla.org/enUS/docs/Web/API/Element/matches#Polyfill
4 | */
5 | if (!Element.prototype.matches) {
6 | Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
7 | }
8 |
9 | // eslint-disable-next-line valid-jsdoc
10 | /**
11 | * Element.closest()
12 | * https://developer.mozilla.org/enUS/docs/Web/API/Element/closest#Polyfill
13 | */
14 | if (!Element.prototype.closest) {
15 | Element.prototype.closest = function(s) {
16 | "use strict";
17 | var el = this;
18 | if (!document.documentElement.contains(el)) {
19 | return null;
20 | }
21 | do {
22 | if (el.matches(s)) {
23 | return el;
24 | }
25 | el = el.parentElement || el.parentNode;
26 | } while (el !== null && el.nodeType === 1);
27 | return null;
28 | };
29 | }
30 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/container/v1/container/example_content.json:
--------------------------------------------------------------------------------
1 | {
2 | "jcr:primaryType" : "nt:unstructured",
3 | "jcr:title" : "Container 1",
4 | "sling:resourceType": "core/wcm/components/container/v1/container",
5 | "backgroundColor": "#000000",
6 | "backgroundImageReference": "/content/dam/core-components-examples/library/sample-assets/mountain-range.jpg",
7 | "layout": "responsiveGrid",
8 | "id": "test",
9 | "item_1": {
10 | "jcr:primaryType" : "nt:unstructured",
11 | "jcr:title" : "Teaser 1",
12 | "jcr:description" : "Teaser 1 description",
13 | "sling:resourceType": "core/wcm/components/teaser/v1/teaser"
14 | },
15 | "item_2": {
16 | "jcr:primaryType" : "nt:unstructured",
17 | "jcr:title" : "Teaser 2",
18 | "jcr:description" : "Teaser 2 description",
19 | "sling:resourceType": "core/wcm/components/teaser/v1/teaser"
20 | },
21 | "item_3": {}
22 | }
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/button/v1/button/icon.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/accordion/v1/accordion/clientlibs/site/js/polyfills.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Element.matches()
3 | * https://developer.mozilla.org/enUS/docs/Web/API/Element/matches#Polyfill
4 | */
5 | if (!Element.prototype.matches) {
6 | Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
7 | }
8 |
9 | // eslint-disable-next-line valid-jsdoc
10 | /**
11 | * Element.closest()
12 | * https://developer.mozilla.org/enUS/docs/Web/API/Element/closest#Polyfill
13 | */
14 | if (!Element.prototype.closest) {
15 | Element.prototype.closest = function(s) {
16 | "use strict";
17 | var el = this;
18 | if (!document.documentElement.contains(el)) {
19 | return null;
20 | }
21 | do {
22 | if (el.matches(s)) {
23 | return el;
24 | }
25 | el = el.parentElement || el.parentNode;
26 | } while (el !== null && el.nodeType === 1);
27 | return null;
28 | };
29 | }
30 |
--------------------------------------------------------------------------------
/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/teaser/v1/teaser/pretitle.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |