├── .yarnrc ├── cli ├── bin │ └── sba ├── tsconfig.json ├── src │ ├── cmds │ │ ├── version.ts │ │ ├── stories │ │ │ └── templates │ │ │ │ └── stories-render.ts │ │ └── package │ │ │ └── index.ts │ └── utils │ │ ├── error.ts │ │ ├── log.ts │ │ ├── getDirectories.ts │ │ ├── createPage.ts │ │ ├── componentList.js │ │ ├── xmlToJSONCleanup.ts │ │ ├── getChoicesFromDirectories.ts │ │ ├── fetchFromAEM.ts │ │ ├── createPageJCRContent.ts │ │ ├── getEditDialog.ts │ │ ├── getCQTemplate.ts │ │ ├── toCamelCase.ts │ │ └── index.ts └── package.json ├── app └── aem │ ├── src │ ├── client │ │ ├── preview.ts │ │ ├── preview │ │ │ ├── globals.ts │ │ │ ├── helpers │ │ │ │ ├── __tests__ │ │ │ │ │ └── ResourceResolver.spec.ts │ │ │ │ ├── Page.js │ │ │ │ ├── ComponentLoader.ts │ │ │ │ └── model-proxy.js │ │ │ ├── decorators │ │ │ │ └── decorators.ts │ │ │ └── types │ │ │ │ └── types.ts │ │ └── index.ts │ ├── server │ │ ├── index.ts │ │ ├── build.ts │ │ └── options.ts │ └── typings.d.ts │ ├── bin │ ├── index.js │ └── build.js │ ├── tsconfig.json │ ├── standalone.js │ └── README.md ├── examples └── aem-kitchen-sink │ ├── components │ ├── list │ │ ├── clientlibs │ │ │ ├── css.txt │ │ │ └── styles │ │ │ │ └── list.css │ │ ├── list.html │ │ ├── .content.xml │ │ ├── list.stories.js │ │ └── item.html │ ├── accordion │ │ ├── clientlibs │ │ │ ├── site │ │ │ │ ├── css.txt │ │ │ │ ├── js.txt │ │ │ │ ├── .content.xml │ │ │ │ ├── css │ │ │ │ │ └── accordion.css │ │ │ │ └── js │ │ │ │ │ └── polyfills.js │ │ │ └── .content.xml │ │ ├── .content.xml │ │ ├── accordion.stories.js │ │ └── example_content.json │ ├── text │ │ ├── .content.xml │ │ ├── text.html │ │ ├── text.stories.mdx │ │ └── text.stories.js │ ├── globals │ │ ├── .content.xml │ │ └── gobals.stories.js │ ├── person │ │ ├── person.html │ │ └── person.stories.js │ └── aemtext │ │ ├── .content.xml │ │ └── aemtext.stories.js │ ├── stories │ ├── welcome.stories.js │ ├── welcome.css │ └── welcome.html │ ├── models │ └── person.js │ └── .storybook │ ├── main.js │ └── preview.js ├── aem-sb-js-core-components ├── src │ ├── com │ │ └── adobe │ │ │ └── cq │ │ │ └── wcm │ │ │ └── core │ │ │ └── components │ │ │ └── models │ │ │ ├── AbstractComponent.js │ │ │ ├── PanelContainerItem.js │ │ │ ├── Button.js │ │ │ ├── Component.js │ │ │ ├── form │ │ │ └── Button.js │ │ │ ├── Separator.js │ │ │ ├── PanelContainer.js │ │ │ ├── ProgressBar.js │ │ │ └── Tabs.js │ ├── jcr_root │ │ └── apps │ │ │ └── core │ │ │ └── wcm │ │ │ └── components │ │ │ ├── accordion │ │ │ └── v1 │ │ │ │ └── accordion │ │ │ │ ├── clientlibs │ │ │ │ ├── site │ │ │ │ │ ├── css.txt │ │ │ │ │ ├── js.txt │ │ │ │ │ ├── .content.xml │ │ │ │ │ ├── css │ │ │ │ │ │ └── accordion.css │ │ │ │ │ └── js │ │ │ │ │ │ └── polyfills.js │ │ │ │ └── .content.xml │ │ │ │ ├── .content.xml │ │ │ │ ├── accordion.stories.js │ │ │ │ └── example_content.json │ │ │ ├── image │ │ │ ├── v2 │ │ │ │ ├── image │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── clientlibs │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ └── site │ │ │ │ │ │ │ ├── js │ │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ │ ├── css │ │ │ │ │ │ │ └── image.less │ │ │ │ │ │ │ ├── css.txt │ │ │ │ │ │ │ └── js.txt │ │ │ │ │ ├── .content.xml │ │ │ │ │ ├── image.stories.js │ │ │ │ │ └── example_content.json │ │ │ │ └── .content.xml │ │ │ └── .content.xml │ │ │ ├── separator │ │ │ ├── v1 │ │ │ │ ├── separator │ │ │ │ │ ├── example_content.json │ │ │ │ │ ├── .content.xml │ │ │ │ │ ├── separator.stories.js │ │ │ │ │ └── separator.html │ │ │ │ └── .content.xml │ │ │ └── .content.xml │ │ │ ├── button │ │ │ ├── .content.xml │ │ │ └── v1 │ │ │ │ ├── .content.xml │ │ │ │ └── button │ │ │ │ ├── example_content.json │ │ │ │ ├── button.stories.js │ │ │ │ ├── icon.html │ │ │ │ └── .content.xml │ │ │ ├── embed │ │ │ ├── .content.xml │ │ │ └── v1 │ │ │ │ ├── embed │ │ │ │ ├── example_content3.json │ │ │ │ ├── clientlibs │ │ │ │ │ ├── .content.xml │ │ │ │ │ └── editor │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ ├── js.txt │ │ │ │ │ │ ├── css.txt │ │ │ │ │ │ └── css │ │ │ │ │ │ └── embed.less │ │ │ │ ├── example_content1.json │ │ │ │ ├── embeddable │ │ │ │ │ ├── .content.xml │ │ │ │ │ ├── youtube │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ └── youtube.html │ │ │ │ │ └── embeddable.html │ │ │ │ ├── example_content2.json │ │ │ │ └── .content.xml │ │ │ │ └── .content.xml │ │ │ ├── form │ │ │ ├── .content.xml │ │ │ ├── button │ │ │ │ ├── .content.xml │ │ │ │ └── v2 │ │ │ │ │ ├── button │ │ │ │ │ ├── clientlibs │ │ │ │ │ │ └── .content.xml │ │ │ │ │ ├── .content.xml │ │ │ │ │ ├── example_content.json │ │ │ │ │ ├── form-button.stories.js │ │ │ │ │ └── button.html │ │ │ │ │ └── .content.xml │ │ │ ├── hidden │ │ │ │ ├── .content.xml │ │ │ │ ├── v1 │ │ │ │ │ ├── .content.xml │ │ │ │ │ └── hidden │ │ │ │ │ │ ├── _cq_htmlTag │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ ├── example_content.json │ │ │ │ │ │ └── hidden.html │ │ │ │ └── v2 │ │ │ │ │ ├── .content.xml │ │ │ │ │ └── hidden │ │ │ │ │ ├── example_content.json │ │ │ │ │ ├── .content.xml │ │ │ │ │ └── hidden.html │ │ │ ├── options │ │ │ │ ├── .content.xml │ │ │ │ ├── v1 │ │ │ │ │ ├── options │ │ │ │ │ │ ├── clientlibs │ │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ │ └── editor │ │ │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ │ │ └── css.txt │ │ │ │ │ │ ├── _cq_editConfig.xml │ │ │ │ │ │ ├── _cq_htmlTag │ │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ ├── example_content_radio.json │ │ │ │ │ │ ├── example_content_dropdown.json │ │ │ │ │ │ ├── example_content_local_source.json │ │ │ │ │ │ └── example_content_checkbox.json │ │ │ │ │ └── .content.xml │ │ │ │ └── v2 │ │ │ │ │ ├── options │ │ │ │ │ ├── clientlibs │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ └── editor │ │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ │ └── css.txt │ │ │ │ │ ├── .content.xml │ │ │ │ │ └── example_content.json │ │ │ │ │ └── .content.xml │ │ │ ├── text │ │ │ │ ├── .content.xml │ │ │ │ └── v2 │ │ │ │ │ ├── text │ │ │ │ │ ├── clientlibs │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ └── site │ │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ │ └── js.txt │ │ │ │ │ ├── .content.xml │ │ │ │ │ ├── text.stories.js │ │ │ │ │ └── example_content.json │ │ │ │ │ └── .content.xml │ │ │ └── container │ │ │ │ ├── .content.xml │ │ │ │ ├── v1 │ │ │ │ ├── container │ │ │ │ │ ├── clientlibs │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ ├── editor │ │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ │ └── js.txt │ │ │ │ │ │ └── site │ │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ │ ├── less │ │ │ │ │ │ │ └── container.less │ │ │ │ │ │ │ └── css.txt │ │ │ │ │ ├── _cq_htmlTag │ │ │ │ │ │ └── .content.xml │ │ │ │ │ ├── _cq_template │ │ │ │ │ │ └── .content.xml │ │ │ │ │ ├── _cq_editConfig.xml │ │ │ │ │ ├── .content.xml │ │ │ │ │ └── new │ │ │ │ │ │ └── .content.xml │ │ │ │ └── .content.xml │ │ │ │ └── v2 │ │ │ │ ├── container │ │ │ │ ├── clientlibs │ │ │ │ │ ├── .content.xml │ │ │ │ │ └── editor │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ └── js.txt │ │ │ │ ├── _cq_template │ │ │ │ │ └── .content.xml │ │ │ │ ├── example_content.json │ │ │ │ ├── _cq_editConfig.xml │ │ │ │ ├── .content.xml │ │ │ │ └── new │ │ │ │ │ └── .content.xml │ │ │ │ └── .content.xml │ │ │ ├── tabs │ │ │ ├── .content.xml │ │ │ └── v1 │ │ │ │ ├── tabs │ │ │ │ ├── clientlibs │ │ │ │ │ ├── .content.xml │ │ │ │ │ └── site │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ ├── css.txt │ │ │ │ │ │ ├── js.txt │ │ │ │ │ │ └── css │ │ │ │ │ │ └── tabs.css │ │ │ │ ├── .content.xml │ │ │ │ ├── tabs.stories.js │ │ │ │ └── _cq_editConfig.xml │ │ │ │ └── .content.xml │ │ │ ├── teaser │ │ │ ├── .content.xml │ │ │ └── v1 │ │ │ │ ├── .content.xml │ │ │ │ └── teaser │ │ │ │ ├── .content.xml │ │ │ │ ├── pretitle.html │ │ │ │ ├── image.html │ │ │ │ ├── description.html │ │ │ │ ├── action.html │ │ │ │ ├── actions.html │ │ │ │ ├── teaser.stories.js │ │ │ │ └── title.html │ │ │ ├── title │ │ │ ├── .content.xml │ │ │ └── v2 │ │ │ │ ├── .content.xml │ │ │ │ └── title │ │ │ │ ├── .content.xml │ │ │ │ ├── example_content.json │ │ │ │ └── title.stories.js │ │ │ ├── breadcrumb │ │ │ ├── .content.xml │ │ │ └── v2 │ │ │ │ ├── breadcrumb │ │ │ │ ├── clientlibs │ │ │ │ │ ├── .content.xml │ │ │ │ │ └── site │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ ├── css.txt │ │ │ │ │ │ └── css │ │ │ │ │ │ └── breadcrumb.css │ │ │ │ ├── .content.xml │ │ │ │ ├── example_content.json │ │ │ │ └── breadcrumb.stories.js │ │ │ │ └── .content.xml │ │ │ ├── carousel │ │ │ ├── .content.xml │ │ │ └── v1 │ │ │ │ ├── carousel │ │ │ │ ├── clientlibs │ │ │ │ │ ├── .content.xml │ │ │ │ │ ├── site │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ ├── js.txt │ │ │ │ │ │ └── css.txt │ │ │ │ │ ├── editor │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ └── js.txt │ │ │ │ │ └── editorhook │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ └── js.txt │ │ │ │ ├── .content.xml │ │ │ │ ├── _cq_editConfig.xml │ │ │ │ └── example_content.json │ │ │ │ └── .content.xml │ │ │ ├── container │ │ │ ├── .content.xml │ │ │ └── v1 │ │ │ │ ├── container │ │ │ │ ├── clientlibs │ │ │ │ │ ├── .content.xml │ │ │ │ │ └── editor │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ └── js.txt │ │ │ │ ├── example_content.json │ │ │ │ ├── responsiveGrid.html │ │ │ │ ├── allowedcomponents.html │ │ │ │ └── new │ │ │ │ │ └── .content.xml │ │ │ │ └── .content.xml │ │ │ ├── download │ │ │ ├── .content.xml │ │ │ └── v1 │ │ │ │ ├── .content.xml │ │ │ │ └── download │ │ │ │ ├── clientlibs │ │ │ │ ├── .content.xml │ │ │ │ └── editor │ │ │ │ │ ├── .content.xml │ │ │ │ │ ├── css │ │ │ │ │ └── download.less │ │ │ │ │ ├── js.txt │ │ │ │ │ └── css.txt │ │ │ │ ├── .content.xml │ │ │ │ ├── _cq_editConfig.xml │ │ │ │ └── example_content.json │ │ │ ├── progressbar │ │ │ ├── .content.xml │ │ │ └── v1 │ │ │ │ ├── .content.xml │ │ │ │ └── progressbar │ │ │ │ ├── example_content.json │ │ │ │ ├── .content.xml │ │ │ │ └── progressbar.stories.js │ │ │ ├── search │ │ │ ├── v1 │ │ │ │ ├── search │ │ │ │ │ ├── clientlibs │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ └── site │ │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ │ ├── js.txt │ │ │ │ │ │ │ └── css.txt │ │ │ │ │ ├── example_content.json │ │ │ │ │ ├── itemTemplate.html │ │ │ │ │ └── .content.xml │ │ │ │ └── .content.xml │ │ │ └── .content.xml │ │ │ ├── list │ │ │ └── v2 │ │ │ │ └── list │ │ │ │ ├── example_content.json │ │ │ │ ├── list.stories.js │ │ │ │ ├── .content.xml │ │ │ │ ├── list.html │ │ │ │ └── item.html │ │ │ ├── text │ │ │ └── v2 │ │ │ │ └── text │ │ │ │ ├── .content.xml │ │ │ │ ├── text.html │ │ │ │ ├── README.md │ │ │ │ └── text.stories.js │ │ │ ├── commons │ │ │ └── v1 │ │ │ │ └── templates.html │ │ │ └── navigation │ │ │ ├── v1 │ │ │ ├── navigation │ │ │ │ ├── clientlibs │ │ │ │ │ ├── editor │ │ │ │ │ │ ├── js.txt │ │ │ │ │ │ └── .content.xml │ │ │ │ │ └── .content.xml │ │ │ │ ├── group.html │ │ │ │ ├── itemContent.html │ │ │ │ └── .content.xml │ │ │ └── .content.xml │ │ │ └── .content.xml │ └── example-content │ │ └── lava-into-ocean.jpeg ├── config.js ├── index.js ├── README.md ├── .storybook │ ├── main.js │ └── preview.js └── components.js ├── .prettierrc ├── lerna.json ├── .gitignore ├── scripts ├── tsc.js ├── watch-tsc.js └── compile-tsc.js ├── .github └── PULL_REQUEST_TEMPLATE.md ├── jest.config.js ├── .eslintignore ├── tsconfig.json ├── LICENSE └── .eslintrc.js /.yarnrc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cli/bin/sba: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('../dist')() 3 | -------------------------------------------------------------------------------- /app/aem/src/client/preview.ts: -------------------------------------------------------------------------------- 1 | // empty file to get prepare script working 2 | -------------------------------------------------------------------------------- /app/aem/bin/index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | require('../dist/server'); 4 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/list/clientlibs/css.txt: -------------------------------------------------------------------------------- 1 | styles/list.css 2 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/accordion/clientlibs/site/css.txt: -------------------------------------------------------------------------------- 1 | #base=css 2 | accordion.css 3 | -------------------------------------------------------------------------------- /app/aem/src/client/preview/globals.ts: -------------------------------------------------------------------------------- 1 | import { window } from 'global'; 2 | 3 | window.STORYBOOK_ENV = 'AEM'; 4 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/accordion/clientlibs/site/js.txt: -------------------------------------------------------------------------------- 1 | #base=js 2 | polyfills.js 3 | accordion.js 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/com/adobe/cq/wcm/core/components/models/AbstractComponent.js: -------------------------------------------------------------------------------- 1 | export default class AbstractComponent { 2 | } -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/accordion/v1/accordion/clientlibs/site/css.txt: -------------------------------------------------------------------------------- 1 | #base=css 2 | accordion.css 3 | -------------------------------------------------------------------------------- /app/aem/src/server/index.ts: -------------------------------------------------------------------------------- 1 | import { buildDev } from '@storybook/core/server'; 2 | import options from './options'; 3 | 4 | buildDev(options); 5 | -------------------------------------------------------------------------------- /app/aem/bin/build.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | process.env.NODE_ENV = process.env.NODE_ENV || 'production'; 4 | require('../dist/server/build'); 5 | -------------------------------------------------------------------------------- /app/aem/src/server/build.ts: -------------------------------------------------------------------------------- 1 | import { buildStatic } from '@storybook/core/server'; 2 | import options from './options'; 3 | 4 | buildStatic(options); 5 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "tabWidth": 2, 4 | "bracketSpacing": true, 5 | "trailingComma": "es5", 6 | "singleQuote": true 7 | } 8 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | module.exports = { 3 | jcrRoots: path.resolve(__dirname, 'src/jcr_root'), 4 | } 5 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/accordion/v1/accordion/clientlibs/site/js.txt: -------------------------------------------------------------------------------- 1 | #base=js 2 | polyfills.js 3 | accordion.js 4 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "npmClient": "yarn", 3 | "useWorkspaces": true, 4 | "registry": "https://registry.npmjs.org", 5 | "version": "independent" 6 | } 7 | -------------------------------------------------------------------------------- /cli/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "./src" 5 | }, 6 | "include": ["src/**/**/*"] 7 | } 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | app/aem/dist 3 | **/dist 4 | yarn.lock 5 | .cache 6 | ts3.5 7 | **/yarn-error.log 8 | .vscode/ 9 | .coverage/ 10 | storybook-static/ -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/example-content/lava-into-ocean.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/storybookjs/aem/HEAD/aem-sb-js-core-components/src/example-content/lava-into-ocean.jpeg -------------------------------------------------------------------------------- /aem-sb-js-core-components/index.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | models: require('./models.js'), 5 | components: require('./components.js'), 6 | }; 7 | -------------------------------------------------------------------------------- /app/aem/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | declare module '@storybook/core/*'; 2 | declare module 'global'; 3 | 4 | // will be provided by the webpack define plugin 5 | declare var NODE_ENV: string | undefined; 6 | -------------------------------------------------------------------------------- /cli/src/cmds/version.ts: -------------------------------------------------------------------------------- 1 | import { getInstalledVersion, log } from '../utils'; 2 | 3 | export const versionCommand = async args => { 4 | log(`Installed Version: ${getInstalledVersion()}`); 5 | }; 6 | -------------------------------------------------------------------------------- /cli/src/utils/error.ts: -------------------------------------------------------------------------------- 1 | export const error = (message, exit) => { 2 | /* eslint-disable no-console */ 3 | console.error(message); 4 | /* eslint-disable no-unused-expressions */ 5 | exit && process.exit(1); 6 | }; 7 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/README.md: -------------------------------------------------------------------------------- 1 | # AEM Core Components 2 | 3 | More or less a copy of the components in https://github.com/adobe/aem-core-wcm-components, 4 | with use classes suitable for javascript and example stories. 5 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/v2/image/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/storybookjs/aem/HEAD/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/v2/image/icon.png -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/separator/v1/separator/example_content.json: -------------------------------------------------------------------------------- 1 | { 2 | "jcr:primaryType" : "nt:unstructured", 3 | "sling:resourceType": "core/wcm/components/separator/v1/separator" 4 | } -------------------------------------------------------------------------------- /app/aem/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "./src", 5 | "types": ["webpack-env"], 6 | "allowJs": true 7 | }, 8 | "include": ["src/**/*"] 9 | } 10 | -------------------------------------------------------------------------------- /cli/src/utils/log.ts: -------------------------------------------------------------------------------- 1 | import chalk from 'chalk'; 2 | 3 | export const log = (...args) => { 4 | const sbaem = chalk.rgb(255, 71, 133).bold('[sba]'); 5 | /* eslint-disable no-console */ 6 | console.log(`${sbaem}`, ...args); 7 | }; 8 | -------------------------------------------------------------------------------- /scripts/tsc.js: -------------------------------------------------------------------------------- 1 | const { tscfy } = require('./compile-tsc'); 2 | 3 | tscfy({ 4 | watch: false, 5 | silent: false, 6 | // eslint-disable-next-line no-console 7 | errorCallback: () => console.error('Failed to compile ts'), 8 | }); 9 | -------------------------------------------------------------------------------- /scripts/watch-tsc.js: -------------------------------------------------------------------------------- 1 | const { tscfy } = require('./compile-tsc'); 2 | 3 | tscfy({ 4 | watch: true, 5 | silent: false, 6 | // eslint-disable-next-line no-console 7 | errorCallback: () => console.error('Failed to compile ts'), 8 | }); 9 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/accordion/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/button/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/embed/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/tabs/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/teaser/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/title/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /cli/src/utils/getDirectories.ts: -------------------------------------------------------------------------------- 1 | import { readdirSync } from 'fs'; 2 | 3 | export const getDirectories = source => { 4 | return readdirSync(source, { withFileTypes: true }) 5 | .filter(dirent => dirent.isDirectory()) 6 | .map(dirent => dirent.name); 7 | }; 8 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/breadcrumb/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/carousel/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/container/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/download/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/download/v1/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/button/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/hidden/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/options/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/text/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/progressbar/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/separator/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/embed/v1/embed/example_content3.json: -------------------------------------------------------------------------------- 1 | { 2 | "jcr:primaryType": "nt:unstructured", 3 | "sling:resourceType": "core/wcm/components/embed/v1/embed", 4 | "type": "html", 5 | "html": "
html
" 6 | } -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/progressbar/v1/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/progressbar/v1/progressbar/example_content.json: -------------------------------------------------------------------------------- 1 | { 2 | "jcr:primaryType" : "nt:unstructured", 3 | "completed" : 75, 4 | "sling:resourceType": "core/wcm/components/progressbar/v1/progressbar" 5 | } -------------------------------------------------------------------------------- /app/aem/src/client/preview/helpers/__tests__/ResourceResolver.spec.ts: -------------------------------------------------------------------------------- 1 | import ResourceResolver from '../ResourceResolver'; 2 | 3 | describe('ResourceResolver first test', () => { 4 | it('Should be truthy', () => { 5 | expect(ResourceResolver).toBeTruthy(); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/embed/v1/embed/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/v2/image/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/search/v1/search/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/tabs/v1/tabs/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/carousel/v1/carousel/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/download/v1/download/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/embed/v1/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/button/v2/button/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/text/v2/text/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/v2/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/tabs/v1/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/title/v2/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | </jcr:root> 6 | -------------------------------------------------------------------------------- /app/aem/standalone.js: -------------------------------------------------------------------------------- 1 | const build = require('@storybook/core/standalone'); 2 | const frameworkOptions = require('./dist/server/options').default; 3 | 4 | async function buildStandalone(options) { 5 | return build(options, frameworkOptions); 6 | } 7 | 8 | module.exports = buildStandalone; 9 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/accordion/v1/accordion/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="sling:Folder"/> 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/breadcrumb/v2/breadcrumb/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="sling:Folder"/> 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/button/v1/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured"> 4 | <button/> 5 | </jcr:root> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/container/v1/container/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="sling:Folder"/> 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/embed/v1/embed/example_content1.json: -------------------------------------------------------------------------------- 1 | { 2 | "jcr:primaryType": "nt:unstructured", 3 | "sling:resourceType": "core/wcm/components/embed/v1/embed", 4 | "type": "url", 5 | "url": "https://www.youtube.com/embed/vpdcMZnYCko" 6 | } -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/options/v1/options/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="sling:Folder"/> 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/options/v2/options/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="sling:Folder"/> 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/text/v2/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured"> 4 | <text/> 5 | </jcr:root> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/v2/image/clientlibs/site/js/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="sling:Folder"/> 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/teaser/v1/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured"> 4 | <teaser/> 5 | </jcr:root> 6 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/text/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:description="Text Component" 4 | jcr:primaryType="cq:Component" 5 | jcr:title="Text" 6 | /> 7 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/stories/welcome.stories.js: -------------------------------------------------------------------------------- 1 | import './welcome.css'; 2 | import welcome from './welcome.html'; 3 | 4 | export default { 5 | title: 'Welcome', 6 | }; 7 | 8 | export const Welcome = async () => { 9 | return { 10 | template: await welcome 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/breadcrumb/v2/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured"> 4 | <breadcrumb/> 5 | </jcr:root> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/carousel/v1/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured"> 4 | <carousel/> 5 | </jcr:root> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/button/v2/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured"> 4 | <button/> 5 | </jcr:root> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v1/container/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="sling:Folder"/> 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v2/container/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="sling:Folder"/> 4 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/hidden/v1/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured"> 4 | <hidden/> 5 | </jcr:root> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/hidden/v2/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured"> 4 | <hidden/> 5 | </jcr:root> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/options/v1/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured"> 4 | <options/> 5 | </jcr:root> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/options/v2/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured"> 4 | <options/> 5 | </jcr:root> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/separator/v1/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured"> 4 | <separator/> 5 | </jcr:root> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/container/v1/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured"> 4 | <container/> 5 | </jcr:root> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v1/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured"> 4 | <container/> 5 | </jcr:root> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v2/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured"> 4 | <container/> 5 | </jcr:root> 6 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/globals/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:description="Globals Component" 4 | jcr:primaryType="cq:Component" 5 | jcr:title="Globals" 6 | /> 7 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/list/list.html: -------------------------------------------------------------------------------- 1 | <ul data-sly-use.list="List" 2 | data-sly-list.item="${list.items}" 3 | data-sly-use.itemTemplate="item.html" 4 | class="cmp-list"> 5 | <li class="cmp-list__item" data-sly-call="${itemTemplate.item @ list = list, item = item}"></li> 6 | </ul> 7 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/options/v1/options/_cq_editConfig.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:EditConfig" 4 | dialogLayout="fullscreen"/> 5 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/person/person.html: -------------------------------------------------------------------------------- 1 | <div data-sly-use.personModel="person"> 2 | <dl> 3 | <dt>First Name:</dt><dd>${personModel.firstName}</dd> 4 | <dt>Last Name:</dt><dd>${personModel.lastName}</dd> 5 | <dt>Full Name:</dt><dd>${personModel.fullName}</dd> 6 | </dl> 7 | </div> 8 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/text/text.html: -------------------------------------------------------------------------------- 1 | <div data-sly-use.textModel="Text" 2 | data-sly-test.text="${textModel.text}" 3 | class="cmp-text"> 4 | <p class="cmp-text__paragraph" 5 | data-sly-unwrap="${textModel.isRichText}">${text @ context = textModel.isRichText ? 'html' : 'text'}</p> 6 | </div> 7 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/embed/v1/embed/embeddable/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:Component" 4 | jcr:title="Embeddable" 5 | componentGroup=".hidden"/> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/embed/v1/embed/clientlibs/editor/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:ClientLibraryFolder" 4 | categories="[core.wcm.components.embed.v1.editor]"/> 5 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/hidden/v1/hidden/_cq_htmlTag/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured" 4 | class="visible"/> 5 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/accordion/clientlibs/site/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:ClientLibraryFolder" 4 | allowProxy="{Boolean}true" 5 | categories="[core.wcm.components.accordion.v1]"/> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/container/v1/container/clientlibs/editor/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:ClientLibraryFolder" 4 | categories="[core.wcm.components.container.v1.editor]"/> 5 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Issue: 2 | 3 | ## What I did 4 | 5 | ## How to test 6 | 7 | - Is this testable with Jest or Chromatic screenshots? 8 | - Does this need a new example in the kitchen sink apps? 9 | - Does this need an update to the documentation? 10 | 11 | If your answer is yes to any of these, please make sure to include it in your PR. 12 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/options/v1/options/clientlibs/editor/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:ClientLibraryFolder" 4 | categories="[core.wcm.components.form.options.v1.editor]"/> 5 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/options/v2/options/clientlibs/editor/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:ClientLibraryFolder" 4 | categories="[core.wcm.components.form.options.v2.editor]"/> 5 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/embed/v1/embed/example_content2.json: -------------------------------------------------------------------------------- 1 | { 2 | "jcr:primaryType": "nt:unstructured", 3 | "sling:resourceType": "core/wcm/components/embed/v1/embed", 4 | "type": "embeddable", 5 | "embeddableResourceType": "core/wcm/components/embed/v1/embed/embeddable/youtube", 6 | "youtubeId": "2R2gb0MKJlo" 7 | } -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v1/container/clientlibs/editor/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:ClientLibraryFolder" 4 | categories="[core.wcm.components.form.container.v1.editor]"/> 5 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v2/container/clientlibs/editor/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:ClientLibraryFolder" 4 | categories="[core.wcm.components.form.container.v2.editor]"/> 5 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/list/v2/list/example_content.json: -------------------------------------------------------------------------------- 1 | { 2 | ":type": "core/wcm/components/list/v2/list", 3 | ":items": { 4 | "item_1": { 5 | "title": "item 1" 6 | }, 7 | "item_2": { 8 | "title": "item 2" 9 | }, 10 | "item_3": { 11 | "title": "item 3" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/list/v2/list/list.stories.js: -------------------------------------------------------------------------------- 1 | import content from './example_content'; 2 | 3 | export default { 4 | title: 'AEM List' 5 | }; 6 | 7 | export const List = () => { 8 | return { 9 | content, 10 | resourceType: 'core/wcm/components/list/v2/list', // todo: derive from path 11 | }; 12 | }; 13 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/v2/image/clientlibs/site/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:ClientLibraryFolder" 4 | allowProxy="{Boolean}true" 5 | categories="[core.wcm.components.image.v2]"/> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/tabs/v1/tabs/clientlibs/site/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:ClientLibraryFolder" 4 | allowProxy="{Boolean}true" 5 | categories="[core.wcm.components.tabs.v1]"/> 6 | -------------------------------------------------------------------------------- /app/aem/src/client/index.ts: -------------------------------------------------------------------------------- 1 | export { 2 | storiesOf, 3 | setAddon, 4 | addDecorator, 5 | addParameters, 6 | configure, 7 | getStorybook, 8 | forceReRender, 9 | raw, 10 | aemMetadata, 11 | modelProxy, 12 | GenericModel, 13 | } from './preview/index'; 14 | 15 | if (module && module.hot && module.hot.decline) { 16 | module.hot.decline(); 17 | } 18 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/aemtext/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:Component" 4 | jcr:title="AEM Text" 5 | sling:resourceSuperType="core/wcm/components/text/v2/text"/> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/search/v1/search/clientlibs/site/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:ClientLibraryFolder" 4 | allowProxy="{Boolean}true" 5 | categories="[core.wcm.components.search.v1]"/> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/carousel/v1/carousel/clientlibs/site/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:ClientLibraryFolder" 4 | allowProxy="{Boolean}true" 5 | categories="[core.wcm.components.carousel.v1]"/> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v1/container/_cq_htmlTag/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured" 4 | class="cmp cmp-form" 5 | cq:tagName="div"/> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/options/v1/options/_cq_htmlTag/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured" 4 | class="cmp cmp-options" 5 | cq:tagName="div"/> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/text/v2/text/clientlibs/site/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:ClientLibraryFolder" 4 | allowProxy="{Boolean}true" 5 | categories="[core.wcm.components.form.text.v2]"/> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/accordion/v1/accordion/clientlibs/site/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:ClientLibraryFolder" 4 | allowProxy="{Boolean}true" 5 | categories="[core.wcm.components.accordion.v1]"/> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/breadcrumb/v2/breadcrumb/clientlibs/site/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:ClientLibraryFolder" 4 | allowProxy="{Boolean}true" 5 | categories="[core.wcm.components.breadcrumb.v2]"/> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/carousel/v1/carousel/clientlibs/editor/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:ClientLibraryFolder" 4 | categories="[core.wcm.components.carousel.v1.editor]" 5 | dependencies="[jquery]"/> 6 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/list/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="textBulleted" 4 | jcr:description="Configurable collection of items or content" 5 | jcr:primaryType="cq:Component" 6 | jcr:title="List (v2)" 7 | componentGroup=".core-wcm"/> 8 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/text/v2/text/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="textLeft" 4 | jcr:description="Rich Text Section" 5 | jcr:primaryType="cq:Component" 6 | jcr:title="Text (v2)" 7 | componentGroup=".core-wcm"/> 8 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/title/v2/title/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="text" 4 | jcr:description="Section Heading" 5 | jcr:primaryType="cq:Component" 6 | jcr:title="Title (v2)" 7 | componentGroup=".core-wcm"/> 8 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/button/v1/button/example_content.json: -------------------------------------------------------------------------------- 1 | { 2 | "jcr:primaryType" : "nt:unstructured", 3 | "jcr:title" : "Adobe", 4 | "sling:resourceType": "core/wcm/components/button/v1/button", 5 | "link" : "https://www.adobe.com", 6 | "icon" : "adobe", 7 | "text" : "Hello world" 8 | } -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v1/container/clientlibs/site/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:ClientLibraryFolder" 4 | allowProxy="{Boolean}true" 5 | categories="[core.wcm.components.form.container.v1]"/> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v1/container/_cq_template/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured"> 4 | <cq:responsive jcr:primaryType="nt:unstructured"/> 5 | </jcr:root> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v2/container/_cq_template/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured"> 4 | <cq:responsive jcr:primaryType="nt:unstructured"/> 5 | </jcr:root> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/commons/v1/templates.html: -------------------------------------------------------------------------------- 1 | <sly data-sly-template.placeholder="${@ isEmpty, classAppend, emptyTextAppend}"> 2 | <div data-sly-test="${(wcmmode.edit || wcmmode.preview) && isEmpty}" 3 | class="cq-placeholder ${classAppend}" 4 | data-emptytext="${component.properties.jcr:title}${emptyTextAppend && ' - '}${emptyTextAppend}"></div> 5 | </sly> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/hidden/v2/hidden/example_content.json: -------------------------------------------------------------------------------- 1 | { 2 | "jcr:primaryType": "nt:unstructured", 3 | "jcr:createdBy": "admin", 4 | "jcr:lastModifiedBy": "admin", 5 | "jcr:created": "Wed Oct 05 2016 16:28:03 GMT+0530", 6 | "jcr:lastModified": "Thu Oct 06 2016 12:47:08 GMT+0530", 7 | "sling:resourceType": "core/wcm/components/form/hidden/v2/hidden" 8 | } -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/list/v2/list/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="textBulleted" 4 | jcr:description="Configurable collection of items or content" 5 | jcr:primaryType="cq:Component" 6 | jcr:title="List (v2)" 7 | componentGroup=".core-wcm"/> 8 | -------------------------------------------------------------------------------- /cli/src/utils/createPage.ts: -------------------------------------------------------------------------------- 1 | import { fetchFromAEM } from './fetchFromAEM'; 2 | 3 | export const createPage = async config => { 4 | const response = await fetchFromAEM({ 5 | url: `${config.aemContentPath}/${config.component.name}?jcr:primaryType=cq:Page`, 6 | method: 'POST', 7 | errorMessage: 'Error creating page:', 8 | }); 9 | 10 | if (await response.ok) return true; 11 | return false; 12 | }; 13 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/accordion/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="panel" 4 | cq:isContainer="{Boolean}true" 5 | jcr:description="Displays content as an accordion" 6 | jcr:primaryType="cq:Component" 7 | jcr:title="Accordion (v1)" 8 | componentGroup=".core-wcm"/> 9 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/embed/v1/embed/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="asset" 4 | jcr:description="Embed a third-party widget or safe free-form HTML." 5 | jcr:primaryType="cq:Component" 6 | jcr:title="Embed (v1)" 7 | componentGroup=".core-wcm"/> 8 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/text/v2/text/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="type" 4 | jcr:description="Allows visitors to enter text information" 5 | jcr:primaryType="cq:Component" 6 | jcr:title="Form Text (v2)" 7 | componentGroup=".core-wcm-form"/> 8 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/progressbar/v1/progressbar/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="progressbar" 4 | jcr:description="Displays a progress bar." 5 | jcr:primaryType="cq:Component" 6 | jcr:title="Progress Bar (v1)" 7 | componentGroup=".core-wcm"/> 8 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/button/v2/button/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="button" 4 | jcr:description="Allows visitors to interact with the form" 5 | jcr:primaryType="cq:Component" 6 | jcr:title="Form Button (v2)" 7 | componentGroup=".core-wcm-form"/> 8 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/options/v1/options/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="select" 4 | jcr:description="Allows visitors to select available options" 5 | jcr:primaryType="cq:Component" 6 | jcr:title="Form Options (v1)" 7 | componentGroup=".core-wcm-form"/> 8 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/options/v2/options/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="select" 4 | jcr:description="Allows visitors to select available options" 5 | jcr:primaryType="cq:Component" 6 | jcr:title="Form Options (v2)" 7 | componentGroup=".core-wcm-form"/> 8 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/options/v2/options/example_content.json: -------------------------------------------------------------------------------- 1 | { 2 | "jcr:primaryType" : "nt:unstructured", 3 | "jcr:createdBy" : "admin", 4 | "jcr:lastModifiedBy": "admin", 5 | "jcr:created" : "Wed Nov 02 2016 15:32:37 GMT+0100", 6 | "jcr:lastModified" : "Wed Nov 09 2016 14:50:06 GMT+0100", 7 | "sling:resourceType": "core/wcm/components/form/options/v2/options" 8 | } -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/separator/v1/separator/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="separator" 4 | jcr:description="Displays a horizontal rule for separating content" 5 | jcr:primaryType="cq:Component" 6 | jcr:title="Separator (v1)" 7 | componentGroup=".core-wcm"/> 8 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/download/v1/download/clientlibs/editor/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:ClientLibraryFolder" 4 | categories="[core.wcm.components.download.v1.editor]" 5 | dependencies="[jquery,core.wcm.components.commons.v1.editor.checkboxTextfieldTuple]"/> 6 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/hidden/v1/hidden/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="viewOff" 4 | jcr:description="Allows form owner to add hidden data to the form" 5 | jcr:primaryType="cq:Component" 6 | jcr:title="Form Hidden (v1)" 7 | componentGroup=".core-wcm-form"/> 8 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/hidden/v2/hidden/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="viewOff" 4 | jcr:description="Allows form owner to add hidden data to the form" 5 | jcr:primaryType="cq:Component" 6 | jcr:title="Form Hidden (v2)" 7 | componentGroup=".core-wcm-form"/> 8 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v2/container/example_content.json: -------------------------------------------------------------------------------- 1 | { 2 | "jcr:primaryType" : "nt:unstructured", 3 | "jcr:createdBy" : "admin", 4 | "jcr:lastModifiedBy": "admin", 5 | "jcr:created" : "Wed Oct 05 2016 16:49:14 GMT+0530", 6 | "jcr:lastModified" : "Wed Oct 05 2016 16:49:14 GMT+0530", 7 | "sling:resourceType": "core/wcm/components/form/container/v2/container" 8 | } -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/tabs/v1/tabs/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="multiple" 4 | cq:isContainer="{Boolean}true" 5 | jcr:description="Displays content as a list of tabs" 6 | jcr:primaryType="cq:Component" 7 | jcr:title="Tabs (v1)" 8 | componentGroup=".core-wcm"/> 9 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/accordion/v1/accordion/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="panel" 4 | cq:isContainer="{Boolean}true" 5 | jcr:description="Displays content as an accordion" 6 | jcr:primaryType="cq:Component" 7 | jcr:title="Accordion (v1)" 8 | componentGroup=".core-wcm"/> 9 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v1/container/_cq_editConfig.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:EditConfig"> 4 | <cq:listeners 5 | jcr:primaryType="cq:EditListenersConfig" 6 | afterchildinsert="REFRESH_SELF" 7 | afterchilddelete="REFRESH_SELF"/> 8 | </jcr:root> 9 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v2/container/_cq_editConfig.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:EditConfig"> 4 | <cq:listeners 5 | jcr:primaryType="cq:EditListenersConfig" 6 | afterchilddelete="REFRESH_SELF" 7 | afterchildinsert="REFRESH_SELF"/> 8 | </jcr:root> 9 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/breadcrumb/v2/breadcrumb/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="breadcrumbNavigation" 4 | jcr:description="Displays the position of the current page within the site hierarchy" 5 | jcr:primaryType="cq:Component" 6 | jcr:title="Breadcrumb (v2)" 7 | componentGroup=".core-wcm"/> 8 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/embed/v1/embed/embeddable/youtube/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:Component" 4 | jcr:title="YouTube" 5 | sling:resourceSuperType="core/wcm/components/embed/v1/embed/embeddable" 6 | componentGroup=".hidden"/> 7 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/carousel/v1/carousel/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="imageCarousel" 4 | cq:isContainer="{Boolean}true" 5 | jcr:description="Cycles through a list of generic content items" 6 | jcr:primaryType="cq:Component" 7 | jcr:title="Carousel (v1)" 8 | componentGroup=".core-wcm"/> 9 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/carousel/v1/carousel/clientlibs/editorhook/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:ClientLibraryFolder" 4 | allowProxy="{Boolean}true" 5 | categories="[core.wcm.components.carousel.editor.hook.v1,cq.authoring.editor.hook]" 6 | dependencies="[cq.authoring.editor.core]"/> 7 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/download/v1/download/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="download" 4 | jcr:description="Displays a downloadable DAM asset with optional title, description, metadata and action text." 5 | jcr:primaryType="cq:Component" 6 | jcr:title="Download (v1)" 7 | componentGroup=".core-wcm"/> 8 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/title/v2/title/example_content.json: -------------------------------------------------------------------------------- 1 | { 2 | "jcr:primaryType" : "nt:unstructured", 3 | "jcr:createdBy" : "admin", 4 | "linkURL" : "https://www.adobe.com", 5 | "jcr:lastModifiedBy": "admin", 6 | "jcr:created" : "Wed Jan 13 2016 15:58:25 GMT+0100", 7 | "jcr:lastModified" : "Wed Jan 13 2016 16:14:51 GMT+0100", 8 | "sling:resourceType": "core/wcm/components/title/v2/title" 9 | } -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/accordion/clientlibs/site/css/accordion.css: -------------------------------------------------------------------------------- 1 | /* This was converted to css to show a basic example - we can include less/scss in other files */ 2 | 3 | .cmp-accordion__header { 4 | margin: 0; 5 | } 6 | .cmp-accordion__button { 7 | display: block; 8 | width: 100%; 9 | text-align: left; 10 | } 11 | .cmp-accordion__panel--hidden { 12 | display: none; 13 | } 14 | .cmp-accordion__panel--expanded { 15 | display: block; 16 | } 17 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/v2/image/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="image" 4 | jcr:description="Smart Adaptive Image" 5 | jcr:primaryType="cq:Component" 6 | jcr:title="Image (v2)" 7 | sling:resourceSuperType="core/wcm/components/image" 8 | componentGroup=".core-wcm"/> 9 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/globals/gobals.stories.js: -------------------------------------------------------------------------------- 1 | import { withKnobs, text } from "@storybook/addon-knobs"; 2 | import { aemMetadata } from '@storybook/aem'; 3 | import Template from './globals.html'; 4 | 5 | export default { 6 | title: 'Globals', 7 | decorators: [ 8 | withKnobs, 9 | ], 10 | }; 11 | 12 | export const Globals = () => { 13 | return { 14 | content: { 15 | text: text('text', 'Hello, world.' ), 16 | }, 17 | template: Template, 18 | }; 19 | }; 20 | -------------------------------------------------------------------------------- /app/aem/README.md: -------------------------------------------------------------------------------- 1 | # Storybook for AEM 2 | 3 | --- 4 | 5 | Storybook for AEM is a UI development environment for your plain AEM snippets. 6 | With it, you can visualize different states of your UI components and develop them interactively. 7 | 8 | ![Storybook Screenshot](https://github.com/storybookjs/storybook/blob/master/media/storybook-intro.gif) 9 | 10 | Storybook runs outside of your app. 11 | So you can develop UI components in isolation without worrying about app specific dependencies and requirements. 12 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/accordion/v1/accordion/clientlibs/site/css/accordion.css: -------------------------------------------------------------------------------- 1 | /* This was converted to css to show a basic example - we can include less/scss in other files */ 2 | 3 | .cmp-accordion__header { 4 | margin: 0; 5 | } 6 | .cmp-accordion__button { 7 | display: block; 8 | width: 100%; 9 | text-align: left; 10 | } 11 | .cmp-accordion__panel--hidden { 12 | display: none; 13 | } 14 | .cmp-accordion__panel--expanded { 15 | display: block; 16 | } 17 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/hidden/v1/hidden/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 | "name": "Custom_Name", 8 | "id": "hidden-field-id", 9 | "value": "Custom value", 10 | "sling:resourceType": "core/wcm/components/form/hidden/v1/hidden" 11 | } -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/search/v1/search/example_content.json: -------------------------------------------------------------------------------- 1 | { 2 | "jcr:primaryType" : "nt:unstructured", 3 | "jcr:createdBy" : "admin", 4 | "placeholder" : "Suche starten", 5 | "navigationRoot" : "/content/de/search", 6 | "jcr:lastModifiedBy": "admin", 7 | "jcr:created" : "Thu Aug 03 2017 20:50:40 GMT+0200", 8 | "jcr:lastModified" : "Thu Aug 03 2017 22:42:00 GMT+0200", 9 | "sling:resourceType": "core/wcm/components/search/v1/search" 10 | } -------------------------------------------------------------------------------- /cli/src/utils/componentList.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { readdirSync } = require('fs'); 3 | 4 | export const componentList = (componentType, config) => 5 | readdirSync(componentType, { withFileTypes: true }) 6 | .filter(dirent => dirent.isDirectory()) 7 | .map(dirent => ({ 8 | type: path.basename(componentType), 9 | relativePath: path.join(componentType, dirent.name), 10 | resourceType: path.relative(config.appsPath, path.join(componentType, dirent.name)), 11 | name: dirent.name, 12 | })); 13 | -------------------------------------------------------------------------------- /cli/src/utils/xmlToJSONCleanup.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-param-reassign */ 2 | export const xmlToJSONCleanup = json => { 3 | Object.keys(json).forEach(key => { 4 | // Remove all xmlns keys, they aren't allowed in the POST call 5 | if (key.includes('xmlns')) delete json[key]; 6 | // Fix the styleIds so they work 7 | if (key === 'cq:styleIds') json[key] = json[key].replace(/\[|\]/g, '').split(','); 8 | // Recursively cleanup 9 | if (typeof json[key] === 'object') xmlToJSONCleanup(json[key]); 10 | }); 11 | 12 | return json; 13 | }; 14 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/list/v2/list/list.html: -------------------------------------------------------------------------------- 1 | <ul data-sly-use.list="com.adobe.cq.wcm.core.components.models.List" 2 | data-sly-list.item="${list.listItems}" 3 | data-sly-use.template="core/wcm/components/commons/v1/templates.html" 4 | data-sly-use.itemTemplate="item.html" 5 | class="cmp-list"> 6 | <li class="cmp-list__item" data-sly-call="${itemTemplate.item @ list = list, item = item}"></li> 7 | </ul> 8 | <sly data-sly-call="${template.placeholder @ isEmpty=list.listItems.size == 0, classAppend='cmp-list'}"></sly> 9 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/text/v2/text/text.html: -------------------------------------------------------------------------------- 1 | <div data-sly-use.textModel="com.adobe.cq.wcm.core.components.models.Text" 2 | data-sly-use.templates="core/wcm/components/commons/v1/templates.html" 3 | data-sly-test.text="${textModel.text}" 4 | class="cmp-text"> 5 | <p class="cmp-text__paragraph" 6 | data-sly-unwrap="${textModel.isRichText}">${text @ context = textModel.isRichText ? 'html' : 'text'}</p> 7 | </div> 8 | <sly data-sly-call="${templates.placeholder @ isEmpty = !text, classAppend='cmp-text'}"></sly> 9 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/text/v2/text/text.stories.js: -------------------------------------------------------------------------------- 1 | import { withKnobs, text, boolean } from "@storybook/addon-knobs"; 2 | import content from './example_content'; 3 | 4 | export default { 5 | title: 'AEM Form Text', 6 | decorators: [ 7 | withKnobs 8 | ], 9 | parameters: { 10 | knobs: { 11 | escapeHTML: false, 12 | }, 13 | }, 14 | }; 15 | 16 | export const Text = () => { 17 | return { 18 | content, 19 | resourceType: 'core/wcm/components/form/text/v2/text', // todo: derive from path 20 | }; 21 | }; -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/stories/welcome.css: -------------------------------------------------------------------------------- 1 | .main { 2 | padding: 15px; 3 | line-height: 1.4; 4 | font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif; 5 | background-color: #ffffff; 6 | } 7 | 8 | h1 { 9 | color: rebeccapurple; 10 | } 11 | 12 | .logo { 13 | width: 256px; 14 | margin: 15px; 15 | } 16 | 17 | .code { 18 | font-size: 15px; 19 | font-weight: 600; 20 | padding: 2px 5px; 21 | border: 1px solid #eae9e9; 22 | border-radius: 4px; 23 | background-color: #f3f2f2; 24 | color: #3a3a3a; 25 | } 26 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/list/list.stories.js: -------------------------------------------------------------------------------- 1 | import { withKnobs, boolean } from "@storybook/addon-knobs"; 2 | import exampleContent from './example_content'; 3 | import ListTemplate from './list.html'; 4 | 5 | export default { 6 | title: 'List', 7 | decorators: [ 8 | withKnobs, 9 | ], 10 | }; 11 | 12 | export const List = () => { 13 | return { 14 | content: { 15 | ...exampleContent, 16 | showDescription: boolean('showDescription', false), 17 | linkItems: boolean('linkItems', false), 18 | }, 19 | template: ListTemplate, 20 | }; 21 | }; 22 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/com/adobe/cq/wcm/core/components/models/PanelContainerItem.js: -------------------------------------------------------------------------------- 1 | import ListItem from './ListItem'; 2 | 3 | export default class PanelContainerItem extends ListItem { 4 | 5 | static PN_PANEL_TITLE = "cq:panelTitle"; 6 | 7 | get title() { 8 | return this.content[PanelContainerItem.PN_PANEL_TITLE] 9 | || this.content['jcr:title'] 10 | || super.title; 11 | } 12 | 13 | /** 14 | * @todo: implement correctly ? 15 | */ 16 | get data() { 17 | return { 18 | json: '', 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/tabs/v1/tabs/tabs.stories.js: -------------------------------------------------------------------------------- 1 | import { aemMetadata } from '@storybook/aem'; 2 | import content from './example_content'; 3 | 4 | export default { 5 | title: 'AEM Tabs', 6 | decorators: [ 7 | aemMetadata({ 8 | decorationTag: { 9 | cssClasses: ['tabs','component'], 10 | tagName: 'article' 11 | } 12 | }), 13 | ] 14 | }; 15 | 16 | export const Tabs = () => { 17 | return { 18 | content, 19 | resourceType: 'core/wcm/components/tabs/v1/tabs', // todo: derive from path 20 | }; 21 | }; 22 | -------------------------------------------------------------------------------- /cli/src/utils/getChoicesFromDirectories.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | import { getDirectories } from './getDirectories'; 3 | 4 | const cwd = process.cwd(); 5 | 6 | export const getChoicesFromDirectories = (config, directoryPath) => { 7 | const directories = getDirectories( 8 | path.resolve(cwd, config.projectRoot, config.relativeProjectRoot, directoryPath) 9 | ); 10 | const choices = []; 11 | 12 | directories.forEach(directory => { 13 | choices.push({ 14 | title: directory, 15 | value: directory, 16 | }); 17 | }); 18 | 19 | return choices; 20 | }; 21 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/separator/v1/separator/separator.stories.js: -------------------------------------------------------------------------------- 1 | import { withKnobs, text } from "@storybook/addon-knobs"; 2 | 3 | export default { 4 | title: 'AEM Separator', 5 | decorators: [ 6 | withKnobs 7 | ], 8 | parameters: { 9 | knobs: { 10 | escapeHTML: false, 11 | }, 12 | }, 13 | }; 14 | 15 | export const Separator = () => { 16 | return { 17 | content: { 18 | id: text('id', 'unique-id'), 19 | }, 20 | resourceType: 'core/wcm/components/separator/v1/separator', // todo: derive from path 21 | }; 22 | }; 23 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/tabs/v1/tabs/_cq_editConfig.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:EditConfig"> 4 | <cq:listeners 5 | jcr:primaryType="cq:EditListenersConfig" 6 | afterchilddelete="CQ.CoreComponents.panelcontainer.v1.AFTER_CHILD_DELETE" 7 | afterchildinsert="CQ.CoreComponents.panelcontainer.v1.AFTER_CHILD_INSERT" 8 | afterchildmove="CQ.CoreComponents.panelcontainer.v1.AFTER_CHILD_MOVE"/> 9 | </jcr:root> 10 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/carousel/v1/carousel/_cq_editConfig.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:EditConfig"> 4 | <cq:listeners 5 | jcr:primaryType="cq:EditListenersConfig" 6 | afterchilddelete="CQ.CoreComponents.panelcontainer.v1.AFTER_CHILD_DELETE" 7 | afterchildinsert="CQ.CoreComponents.panelcontainer.v1.AFTER_CHILD_INSERT" 8 | afterchildmove="CQ.CoreComponents.panelcontainer.v1.AFTER_CHILD_MOVE"/> 9 | </jcr:root> 10 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/models/person.js: -------------------------------------------------------------------------------- 1 | import { GenericModel } from '@storybook/aem'; 2 | 3 | /** 4 | * Defines the {@code Person} Sling Model used for the {@code /xmp/components/person} component. 5 | * 6 | * Note that it extends the `GenericModel` which automatically exports all properties defined in the 7 | * content. 8 | */ 9 | export default class Person extends GenericModel { 10 | /** 11 | * Full name of the person, composed of first and last name. 12 | * @returns {string} 13 | */ 14 | get fullName() { 15 | return `${this.content.firstName} ${this.content.lastName}` 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | cacheDirectory: '.cache/jest', 3 | clearMocks: true, 4 | collectCoverageFrom: ['app/**/*.{js,jsx,ts,tsx}'], 5 | coverageDirectory: '.coverage', 6 | coveragePathIgnorePatterns: ['/node_modules/'], 7 | moduleFileExtensions: ['js', 'json', 'ts', 'node'], 8 | roots: ['<rootDir>/app'], 9 | testEnvironment: 'node', 10 | testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[tj]s?(x)'], 11 | testPathIgnorePatterns: ['/node_modules/'], 12 | transform: { 13 | '^.+\\.(ts|tsx)$': 'ts-jest', 14 | }, 15 | transformIgnorePatterns: ['/node_modules/'], 16 | }; 17 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v1/container/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="form" 4 | cq:isContainer="{Boolean}true" 5 | jcr:description="Components Container allowing visitors to submit information" 6 | jcr:primaryType="cq:Component" 7 | jcr:title="Form Container (v1)" 8 | sling:resourceSuperType="wcm/foundation/components/responsivegrid" 9 | componentGroup=".core-wcm-form"/> 10 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v2/container/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="form" 4 | cq:isContainer="{Boolean}true" 5 | jcr:description="Components Container allowing visitors to submit information" 6 | jcr:primaryType="cq:Component" 7 | jcr:title="Form Container (v2)" 8 | sling:resourceSuperType="wcm/foundation/components/responsivegrid" 9 | componentGroup=".core-wcm-form"/> 10 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/.storybook/main.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | stories: [ 3 | `../src/jcr_root/apps/core/wcm/components/**/*.stories.*`, 4 | ], 5 | addons: [ 6 | "@storybook/addon-docs", 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 | ] 18 | }; 19 | 20 | AEMRegisterJcrRoot(require('../config').jcrRoots); -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/accordion/v1/accordion/accordion.stories.js: -------------------------------------------------------------------------------- 1 | import { aemMetadata } from '@storybook/aem'; 2 | import content from './example_content'; 3 | 4 | export default { 5 | title: 'AEM Accordion', 6 | decorators: [ 7 | aemMetadata({ 8 | decorationTag: { 9 | cssClasses: ['accordion','component'], 10 | tagName: 'article' 11 | } 12 | }), 13 | ] 14 | }; 15 | 16 | export const Accordion = () => { 17 | return { 18 | content, 19 | resourceType: 'core/wcm/components/accordion/v1/accordion', // todo: derive from path 20 | }; 21 | }; 22 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/list/item.html: -------------------------------------------------------------------------------- 1 | <template data-sly-template.item="${@ list, item}"> 2 | <article> 3 | <a class="cmp-list__item-link" href="${item.URL}" data-sly-unwrap="${!list.linkItems}"> 4 | <span class="cmp-list__item-title">${item.title}</span> 5 | <span data-sly-test="${list.showModificationDate}" 6 | class="cmp-list__item-date">${list.dateFormatString @format=item.lastModified}</span> 7 | </a> 8 | <span data-sly-test="${list.showDescription}" class="cmp-list__item-description">${item.description}</span> 9 | </article> 10 | </template> 11 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/.storybook/preview.js: -------------------------------------------------------------------------------- 1 | import { addParameters, addDecorator } from '@storybook/client-api'; 2 | import { withA11y } from '@storybook/addon-a11y'; 3 | import { aemMetadata } from '@storybook/aem'; 4 | import meta from '..'; 5 | 6 | addDecorator(withA11y); 7 | addDecorator(aemMetadata(meta)); 8 | 9 | addParameters({ 10 | a11y: { 11 | config: {}, 12 | options: { 13 | checks: { 'color-contrast': { options: { noScroll: true } } }, 14 | restoreScroll: true, 15 | }, 16 | }, 17 | options: { 18 | showRoots: true, 19 | }, 20 | docs: { 21 | iframeHeight: '200px', 22 | }, 23 | }); 24 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/teaser/v1/teaser/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | cq:icon="card" 4 | jcr:description="Teaser block allowing a combination of an image, title, rich text description and actions/links" 5 | jcr:primaryType="cq:Component" 6 | jcr:title="Teaser (v1)" 7 | sling:resourceSuperType="core/wcm/components/image" 8 | imageDelegate="core/wcm/components/image/v2/image" 9 | componentGroup=".core-wcm"/> 10 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/download/v1/download/_cq_editConfig.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="cq:EditConfig"> 4 | <cq:dropTargets jcr:primaryType="nt:unstructured"> 5 | <file 6 | jcr:primaryType="cq:DropTargetConfig" 7 | accept="[.*]" 8 | groups="[media]" 9 | propertyName="./fileReference"/> 10 | </cq:dropTargets> 11 | </jcr:root> 12 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/com/adobe/cq/wcm/core/components/models/Button.js: -------------------------------------------------------------------------------- 1 | export default class Button { 2 | static clazz = 'com.adobe.cq.wcm.core.components.models.Button'; 3 | 4 | constructor(content) { 5 | this.content = content; 6 | } 7 | 8 | get text(){ 9 | return this.content.text; 10 | } 11 | 12 | get icon(){ 13 | return this.content.icon; 14 | } 15 | 16 | get link() { 17 | return this.content.link; 18 | } 19 | 20 | get data() { 21 | return {}; 22 | } 23 | 24 | get exportedType() { 25 | return 'wcm/core/components/button/v1/button'; 26 | } 27 | } -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/list/v2/list/item.html: -------------------------------------------------------------------------------- 1 | <template data-sly-template.item="${@ list, item}"> 2 | <article> 3 | <a class="cmp-list__item-link" href="${item.URL}" data-sly-unwrap="${!list.linkItems}"> 4 | <span class="cmp-list__item-title">${item.title}</span> 5 | <span data-sly-test="${list.showModificationDate}" 6 | class="cmp-list__item-date">${list.dateFormatString @format=item.lastModified}</span> 7 | </a> 8 | <span data-sly-test="${list.showDescription}" class="cmp-list__item-description">${item.description}</span> 9 | </article> 10 | </template> 11 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/button/v1/button/button.stories.js: -------------------------------------------------------------------------------- 1 | import { withKnobs, text } from "@storybook/addon-knobs"; 2 | 3 | export default { 4 | title: 'AEM Button', 5 | decorators: [ 6 | withKnobs 7 | ], 8 | parameters: { 9 | knobs: { 10 | escapeHTML: false, 11 | }, 12 | }, 13 | }; 14 | 15 | export const Button = () => { 16 | return { 17 | content: { 18 | link: text('Link', 'https://www.adobe.com'), 19 | icon: text('Icon', 'adobe'), 20 | text: text('Text', 'Hello world'), 21 | }, 22 | resourceType: 'core/wcm/components/button/v1/button', // todo: derive from path 23 | }; 24 | }; 25 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/v2/image/image.stories.js: -------------------------------------------------------------------------------- 1 | import { withKnobs, text } from "@storybook/addon-knobs"; 2 | import content from './example_content'; 3 | 4 | import exampleImage from '../.././../../../../../../example-content/lava-into-ocean.jpeg'; 5 | content.src = exampleImage; 6 | 7 | export default { 8 | title: 'AEM Image', 9 | decorators: [ 10 | withKnobs, 11 | ], 12 | }; 13 | 14 | export const Image = () => { 15 | return { 16 | content: { 17 | ...content, 18 | title: text('title', content.title), 19 | }, 20 | resourceType: 'core/wcm/components/image/v2/image', // todo: derive from path 21 | }; 22 | }; 23 | -------------------------------------------------------------------------------- /cli/src/utils/fetchFromAEM.ts: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | import base64 from 'base-64'; 3 | import { log } from './index'; 4 | 5 | export const fetchFromAEM = async config => { 6 | const errorMessage = config.errorMessage || 'Error Fetching from AEM'; 7 | const url = 8 | config.url.indexOf('http://localhost:4502') !== -1 9 | ? config.url 10 | : `http://localhost:4502${config.url}`; 11 | const response = await fetch(url, { 12 | method: config.method, 13 | headers: { 14 | Authorization: `Basic ${base64.encode(`admin:admin`)}`, 15 | }, 16 | body: config.body || null, 17 | }).catch(error => log(errorMessage, error)); 18 | 19 | return response; 20 | }; 21 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/title/v2/title/title.stories.js: -------------------------------------------------------------------------------- 1 | import { withKnobs, text, select, boolean } from "@storybook/addon-knobs"; 2 | 3 | export default { 4 | title: 'AEM Title', 5 | decorators: [ 6 | withKnobs, 7 | ], 8 | }; 9 | 10 | export const Title = () => { 11 | return { 12 | content: { 13 | text: text('text', 'Example Title' ), 14 | type: select('type', [null, 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'], null), 15 | linkURL: text('linkURL', 'https://storybook.js.org/' ), 16 | linkDisabled: boolean('linkDisabled'), 17 | }, 18 | resourceType: 'core/wcm/components/title/v2/title', // todo: derive from path 19 | }; 20 | }; 21 | -------------------------------------------------------------------------------- /cli/src/utils/createPageJCRContent.ts: -------------------------------------------------------------------------------- 1 | import { fetchFromAEM } from './fetchFromAEM'; 2 | 3 | export const createPageJCRContent = async config => { 4 | const params = [ 5 | `jcr:primaryType=cq:PageContent`, 6 | `sling:resourceType=${config.aemContentDefaultPageResourceType}`, 7 | `title=${config.component.name}`, 8 | `cq:template=${config.aemContentDefaultPageTemplate}`, 9 | ]; 10 | 11 | const response = await fetchFromAEM({ 12 | url: `${config.aemContentPath}/${config.component.name}/jcr:content?${params.join('&')}`, 13 | method: 'POST', 14 | errorMessage: 'Error creating JCR:Content:', 15 | }); 16 | 17 | if (await response.ok) return true; 18 | return false; 19 | }; 20 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/accordion/accordion.stories.js: -------------------------------------------------------------------------------- 1 | import exampleContent from './example_content'; 2 | import { aemMetadata } from '@storybook/aem'; 3 | 4 | export default { 5 | title: 'Accordion', 6 | decorators: [ 7 | aemMetadata({ 8 | decorationTag: { 9 | cssClasses: ['accordion','component'], 10 | tagName: 'article' 11 | } 12 | }), 13 | ] 14 | }; 15 | 16 | export const Accordion = () => { 17 | return { 18 | content: exampleContent, 19 | // this example just specifies the resource type and let's the renderer automatically load 20 | // the correct HTL template and render it, 21 | resourceType: 'components/accordion', 22 | }; 23 | }; 24 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/button/v2/button/example_content.json: -------------------------------------------------------------------------------- 1 | { 2 | "cq:lastModified" : "Wed Jun 29 2016 14:20:45 GMT+0200", 3 | "cq:lastModifiedBy" : "admin", 4 | "jcr:created" : "Mon Jul 18 2016 14:30:46 GMT+0200", 5 | "jcr:createdBy" : "admin", 6 | "jcr:primaryType" : "nt:unstructured", 7 | "sling:resourceType" : "core/wcm/components/form/button/v2/button/v2/button", 8 | "jcr:title" : "button title", 9 | "name" : "name1", 10 | "value" : "value1", 11 | "type" : "button", 12 | "id" : "button-id", 13 | "helpMessage" : "my help message" 14 | } -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/breadcrumb/v2/breadcrumb/example_content.json: -------------------------------------------------------------------------------- 1 | { 2 | "content": { 3 | "jcr:content": { 4 | "jcr:title": "Site", 5 | "hideInNav": true 6 | }, 7 | "en": { 8 | "jcr:content": { 9 | "jcr:title": "English" 10 | }, 11 | "products": { 12 | "jcr:content": { 13 | "jcr:title": "Products" 14 | }, 15 | "outdoor": { 16 | "jcr:content": { 17 | "jcr:title": "Outdoor" 18 | }, 19 | "hiking": { 20 | "jcr:content": { 21 | "jcr:title": "Hiking" 22 | } 23 | } 24 | } 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/progressbar/v1/progressbar/progressbar.stories.js: -------------------------------------------------------------------------------- 1 | import {withKnobs, number} from "@storybook/addon-knobs"; 2 | 3 | export default { 4 | title: 'AEM Progress Bar', 5 | decorators: [ 6 | withKnobs, 7 | ], 8 | parameters: { 9 | knobs: { 10 | escapeHTML: false, 11 | }, 12 | }, 13 | }; 14 | 15 | export const ProgressBar = () => { 16 | return { 17 | content: { 18 | completed: number('completed', 75, { 19 | range: true, 20 | min: 0, 21 | max: 100, 22 | step: 1, 23 | }), 24 | }, 25 | resourceType: 'core/wcm/components/progressbar/v1/progressbar', // todo: derive from path 26 | }; 27 | }; 28 | -------------------------------------------------------------------------------- /app/aem/src/server/options.ts: -------------------------------------------------------------------------------- 1 | // tslint:disable-next-line: no-var-requires 2 | const packageJson = require('../../package.json'); 3 | 4 | /** 5 | * The following code exposes the global AEMRegisterJcrRoot function in order for components 6 | * to be able to register their project roots. 7 | */ 8 | const jcrRoots = []; 9 | 10 | // todo: add current project's CWD as project root !?! 11 | 12 | global['AEMRegisterJcrRoot'] = (root) => { 13 | if (Array.isArray(root)) { 14 | jcrRoots.push(...root); 15 | } else { 16 | jcrRoots.push(root); 17 | } 18 | }; 19 | 20 | export default { 21 | packageJson, 22 | framework: 'aem', 23 | frameworkPresets: [require.resolve('./framework-preset-aem.js')], 24 | jcrRoots, 25 | }; 26 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/stories/welcome.html: -------------------------------------------------------------------------------- 1 | <div class="main"> 2 | <h1>Welcome to Storybook for AEM</h1> 3 | <p>This is a UI component dev environment for your plain AEM snippets.</p> 4 | <p> 5 | We've added some basic stories inside the <code class="code">components</code> directory. 6 | <br /> 7 | A story is a single state of one or more UI components. You can have as many stories as you want. 8 | <br /> 9 | (Basically a story is like a visual test case.) 10 | </p> 11 | <p> 12 | Have a look at the 13 | <a class="link" href="https://storybook.js.org/basics/writing-stories" target="_blank"> 14 | Writing Stories 15 | </a> 16 | section in our documentation. 17 | </p> 18 | </div> 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<AemMetadata>) => 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 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:description="New Paragraph - Form Container (v1) - HTL" 4 | jcr:primaryType="cq:Component" 5 | jcr:title="New Paragraph - Form Container Component (v1)" 6 | sling:resourceSuperType="wcm/foundation/components/parsys/newpar" 7 | cq:deprecated="Core Components 2.8.0" 8 | cq:deprecatedReason="The Form Container now uses the responsive grid new component by default, overriding this in a proxy will not have an effect." 9 | componentGroup=".hidden"/> 10 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/container/v2/container/new/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:description="New Paragraph - Form Container (v2) - HTL" 4 | jcr:primaryType="cq:Component" 5 | jcr:title="New Paragraph - Form Container Component (v2)" 6 | sling:resourceSuperType="wcm/foundation/components/parsys/newpar" 7 | cq:deprecated="Core Components 2.8.0" 8 | cq:deprecatedReason="The Form Container now uses the responsive grid new component by default, overriding this in a proxy will not have an effect." 9 | componentGroup=".hidden"/> 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 | <!--/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 | <div>${'Embeddable' @ i18n}</div> -------------------------------------------------------------------------------- /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 | <Meta 7 | title="Text-MDX" 8 | decorators={[withKnobs]} 9 | /> 10 | 11 | # Text MDX test 12 | <Preview> 13 | <Story name="Text - MDX"> 14 | {{ 15 | content: { 16 | text: text('text', 'Hello, world.' ), 17 | isRichText: boolean('isRichText', false), 18 | }, 19 | template: TextTemplate, 20 | }} 21 | </Story> 22 | </Preview> 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 | <!--/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 | <sly data-sly-template.icon="${@ icon}"> 17 | <span data-sly-test="${icon}" class="cmp-button__icon cmp-button__icon--${icon}"></span> 18 | </sly> 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 | <!--/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 | <sly data-sly-template.pretitle="${@ teaser}"> 17 | <div class="cmp-teaser__pretitle" data-sly-test.pretitle="${teaser.pretitle}">${pretitle}</div> 18 | </sly> 19 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/search/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | ~ Copyright 2017 Adobe 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. 16 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> 17 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 18 | jcr:primaryType="sling:Folder"/> 19 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/navigation/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | ~ Copyright 2017 Adobe 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. 16 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> 17 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 18 | jcr:primaryType="sling:Folder"/> 19 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/teaser/v1/teaser/image.html: -------------------------------------------------------------------------------- 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 | <sly data-sly-template.image="${@ teaser}"> 17 | <div class="cmp-teaser__image" data-sly-test="${teaser.imageResource}" data-sly-resource="${teaser.imageResource}"></div> 18 | </sly> 19 | -------------------------------------------------------------------------------- /cli/src/utils/getEditDialog.ts: -------------------------------------------------------------------------------- 1 | import * as fs from 'fs'; 2 | import * as path from 'path'; 3 | import xml2json from 'xml2json'; 4 | import { log, parseEditDialog, xmlToJSONCleanup } from './index'; 5 | 6 | export const getEditDialog = config => { 7 | log('getEditDialog:'); 8 | 9 | const cqDialogPath = path.resolve( 10 | process.cwd(), 11 | config.projectRoot, 12 | config.relativeProjectRoot, 13 | config.componentPath, 14 | config.componentType, 15 | config.component, 16 | `_cq_dialog`, 17 | `.content.xml` 18 | ); 19 | try { 20 | const xml = fs.readFileSync(cqDialogPath, 'utf-8'); 21 | 22 | if (!xml) { 23 | log(`There was no _cq_dialog/.content.xml. Skipping default content.`); 24 | return false; 25 | } 26 | const json = xmlToJSONCleanup(JSON.parse(xml2json.toJson(xml))); 27 | return parseEditDialog(json, null); 28 | } catch (e) { 29 | log( 30 | `There was an error reading the _cq_dialog/.content.xml for the '${config.component}' component`, 31 | e 32 | ); 33 | return false; 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/teaser/v1/teaser/description.html: -------------------------------------------------------------------------------- 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 | <sly data-sly-template.description="${@ teaser}"> 17 | <div class="cmp-teaser__description" data-sly-test.description="${teaser.description}">${description @ context="html"}</div> 18 | </sly> 19 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/navigation/v1/navigation/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | ~ Copyright 2017 Adobe 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. 16 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> 17 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 18 | jcr:primaryType="sling:Folder"/> 19 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/search/v1/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | ~ Copyright 2017 Adobe 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. 16 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> 17 | <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 18 | jcr:primaryType="nt:unstructured"> 19 | <search/> 20 | </jcr:root> 21 | -------------------------------------------------------------------------------- /app/aem/src/client/preview/types/types.ts: -------------------------------------------------------------------------------- 1 | import { StoryFn } from '@storybook/addons'; 2 | 3 | export interface IStorybookStory { 4 | name: string; 5 | render: () => any; 6 | } 7 | 8 | export interface IStorybookSection { 9 | kind: string; 10 | stories: IStorybookStory[]; 11 | } 12 | 13 | export interface ShowErrorArgs { 14 | title: string; 15 | description: string; 16 | } 17 | 18 | export interface DecorationTag { 19 | cssClasses?: string[]; 20 | tagName?: string; 21 | } 22 | 23 | export interface AemMetadata { 24 | components?: any[]; 25 | decorationTag?: DecorationTag; 26 | models: any; 27 | roots?: string[]; 28 | } 29 | 30 | export interface RenderMainArgs { 31 | storyFn: () => StoryFn<StoryFnAemReturnType>; 32 | selectedKind: string; 33 | selectedStory: string; 34 | showMain: () => void; 35 | showError: (args: ShowErrorArgs) => void; 36 | forceRender: boolean; 37 | } 38 | 39 | export interface StoryFnAemReturnType { 40 | content?: any; 41 | resourceLoaderPath?: string; 42 | template?: any; 43 | wcmmode?: any; 44 | aemMetadata?: AemMetadata; 45 | } 46 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/separator/v1/separator/separator.html: -------------------------------------------------------------------------------- 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 | <div data-sly-use.component="com.adobe.cq.wcm.core.components.models.Component" 17 | id="${component.id}" 18 | class="cmp-separator"> 19 | <hr class="cmp-separator__horizontal-rule"/> 20 | </div> -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/navigation/v1/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | ~ Copyright 2017 Adobe 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. 16 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> 17 | <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 18 | jcr:primaryType="nt:unstructured"> 19 | <navigation/> 20 | </jcr:root> 21 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/aemtext/aemtext.stories.js: -------------------------------------------------------------------------------- 1 | import { withKnobs, text, boolean } from "@storybook/addon-knobs"; 2 | import { aemMetadata, GenericModel } from '@storybook/aem'; 3 | 4 | export default { 5 | title: 'AEM Text', 6 | decorators: [ 7 | withKnobs, 8 | aemMetadata({ 9 | decorationTag: { 10 | cssClasses: ['text','component'], 11 | tagName: 'article' 12 | } 13 | }), 14 | ], 15 | parameters: { 16 | knobs: { 17 | escapeHTML: false, 18 | }, 19 | }, 20 | }; 21 | 22 | export const Text = () => { 23 | return { 24 | content: { 25 | text: text('text', 'Hello, world.' ), 26 | isRichText: boolean('isRichText', false), 27 | }, 28 | resourceType: 'components/aemtext', 29 | }; 30 | }; 31 | 32 | export const RichText = () => { 33 | return { 34 | content: { 35 | text: text('text', '<h1>Hello, world.</h1>' ), 36 | isRichText: boolean('isRichText', true), 37 | }, 38 | resourceType: 'components/aemtext', 39 | aemMetadata: { 40 | decorationTag: null 41 | }, 42 | }; 43 | }; 44 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/components/text/text.stories.js: -------------------------------------------------------------------------------- 1 | import { withKnobs, text, boolean } from "@storybook/addon-knobs"; 2 | import { aemMetadata, GenericModel } from '@storybook/aem'; 3 | import TextTemplate from './text.html'; 4 | 5 | export default { 6 | title: 'Text', 7 | decorators: [ 8 | withKnobs, 9 | aemMetadata({ 10 | decorationTag: { 11 | cssClasses: ['text','component'], 12 | tagName: 'article' 13 | } 14 | }), 15 | ], 16 | parameters: { 17 | knobs: { 18 | escapeHTML: false, 19 | }, 20 | }, 21 | }; 22 | 23 | export const Text = () => { 24 | return { 25 | content: { 26 | text: text('text', 'Hello, world.' ), 27 | isRichText: boolean('isRichText', false), 28 | }, 29 | template: TextTemplate, 30 | }; 31 | }; 32 | 33 | export const RichText = () => { 34 | return { 35 | content: { 36 | text: text('text', '<h1>Hello, world.</h1>' ), 37 | isRichText: boolean('isRichText', true), 38 | }, 39 | template: TextTemplate, 40 | aemMetadata: { 41 | decorationTag: null 42 | }, 43 | }; 44 | }; 45 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/com/adobe/cq/wcm/core/components/models/ProgressBar.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Defines the {@code Text} Sling Model used for the {@code /apps/core/wcm/components/text} component. 3 | * 4 | * @since com.adobe.cq.wcm.core.components.models 11.0.0 5 | */ 6 | export default class Text { 7 | static clazz = 'com.adobe.cq.wcm.core.components.models.ProgressBar'; 8 | 9 | constructor(content) { 10 | this.content = content; 11 | } 12 | 13 | get completed() { 14 | if (this.content.completed < 0) { 15 | return 0; 16 | } 17 | if (this.content.completed > 100) { 18 | return 100; 19 | } 20 | return this.content.completed; 21 | } 22 | 23 | get remaining() { 24 | return 100 - this.completed; 25 | } 26 | 27 | /** 28 | * @see ComponentExporter#getExportedType() 29 | * @since com.adobe.cq.wcm.core.components.models 12.2.0 30 | */ 31 | get exportedType() { 32 | // return this.resource.getResourceType(); 33 | return 'wcm/core/components/progressbar/v1/progressbar'; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /cli/src/utils/getCQTemplate.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | import * as fs from 'fs'; 3 | import xml2json from 'xml2json'; 4 | import { log, xmlToJSONCleanup } from './index'; 5 | 6 | export const getCQTemplate = async config => { 7 | const cqTemplatePath = path.resolve( 8 | process.cwd(), 9 | config.component.relativePath, 10 | `_cq_template.xml` 11 | ); 12 | 13 | try { 14 | const xml = fs.readFileSync(cqTemplatePath, 'utf-8'); 15 | 16 | if (!xml) { 17 | log(`There was no _cq_template.xml file. Skipping default content.`); 18 | return false; 19 | } 20 | const json = JSON.parse(xml2json.toJson(xml))['jcr:root']; 21 | // Add the sling:resourceType so that the component can be created 22 | json['sling:resourceType'] = config.component.resourceType; 23 | 24 | return xmlToJSONCleanup(json); 25 | } catch { 26 | // This is not an error scenario. It is okay to not have a _cq_template. 27 | log( 28 | `No _cq_template.xml found for the '${config.component.name}' component. Default content will be generated.` 29 | ); 30 | return false; 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/text/v2/text/README.md: -------------------------------------------------------------------------------- 1 | Text (v2) 2 | ==== 3 | Text component written in HTL that provides a section of rich text. 4 | 5 | ## Features 6 | 7 | * In-place editing 8 | * Rich text editor 9 | * Styles 10 | 11 | ### Use Object 12 | The Title component uses the `com.adobe.cq.wcm.core.components.models.Text` Sling model as its Use-object. The current implementation reads 13 | the following resource properties: 14 | 15 | 1. `./text` - the actual text to be rendered 16 | 2. `./textIsRich` - flag determining if the rendered text is rich or not, useful for applying the correct HTL display context 17 | 18 | ## BEM Description 19 | ``` 20 | BLOCK cmp-text 21 | ELEMENT cmp-text__paragraph 22 | ``` 23 | 24 | ## Information 25 | * **Vendor**: Adobe 26 | * **Version**: v2 27 | * **Compatibility**: AEM 6.3 28 | * **Status**: production-ready 29 | * **Documentation**: [https://www.adobe.com/go/aem\_cmp\_text\_v2](https://www.adobe.com/go/aem_cmp_text_v2) 30 | * **Component Library**: [https://www.adobe.com/go/aem\_cmp\_library\_text](https://www.adobe.com/go/aem_cmp_library_text) 31 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/search/v1/search/itemTemplate.html: -------------------------------------------------------------------------------- 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 | <script data-cmp-hook-search="itemTemplate" type="x-template"> 17 | <a class="cmp-search__item" data-cmp-hook-search="item"> 18 | <span class="cmp-search__item-title" data-cmp-hook-search="itemTitle"></span> 19 | </a> 20 | </script> -------------------------------------------------------------------------------- /app/aem/src/client/preview/helpers/ComponentLoader.ts: -------------------------------------------------------------------------------- 1 | export default class ComponentLoader { 2 | private components: any; 3 | 4 | constructor(components: any) { 5 | this.components = components || []; 6 | } 7 | 8 | /** 9 | * Resolves the component for the given resource type. 10 | * @param {string} type Resource type 11 | * @return {object} component info or {@code null}. 12 | */ 13 | resolve(type: string): any { 14 | if (!type) { 15 | return null; 16 | } 17 | return this.components.find(c => c.resourceType === type); 18 | } 19 | 20 | /** 21 | * Resolves the HTL script for the given resource type, respecting the `sling:resourceSuperType` 22 | * property. 23 | * 24 | * @param {string} type Resource Type. 25 | * @return {function} the script function or {@code null} 26 | */ 27 | resolveScript(type: string): Function { 28 | const component = this.resolve(type); 29 | if (!component) { 30 | return null; 31 | } 32 | if (component.module) { 33 | return component.module; 34 | } 35 | return this.resolveScript(component.properties['sling:resourceSuperType']); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /cli/src/utils/toCamelCase.ts: -------------------------------------------------------------------------------- 1 | // util function to convert the input to string type 2 | function convertToString(input: any) { 3 | if (input) { 4 | if (typeof input === 'string') { 5 | return input; 6 | } 7 | return String(input); 8 | } 9 | return ''; 10 | } 11 | 12 | // convert string to words 13 | function toWords(input: any) { 14 | const convertedInput = convertToString(input); 15 | const regex = /[A-Z\xC0-\xD6\xD8-\xDE]?[a-z\xDF-\xF6\xF8-\xFF]+|[A-Z\xC0-\xD6\xD8-\xDE]+(?![a-z\xDF-\xF6\xF8-\xFF])|\d+/g; 16 | return convertedInput.match(regex); 17 | } 18 | 19 | // convert the input array to camel case 20 | export function toCamelCase(input: any) { 21 | const inputArray = toWords(input); 22 | let result = ''; 23 | /* eslint-disable no-plusplus */ 24 | for (let i = 0; i < inputArray.length; i++) { 25 | const currentStr = inputArray[i]; 26 | let tempStr = currentStr.toLowerCase(); 27 | if (i !== 0) { 28 | // convert first letter to upper case (the word is in lowercase) 29 | tempStr = tempStr.substr(0, 1).toUpperCase() + tempStr.substr(1); 30 | } 31 | result += tempStr; 32 | } 33 | return result; 34 | } 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020 Adobe and @storybook/aem contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/carousel/v1/carousel/example_content.json: -------------------------------------------------------------------------------- 1 | { 2 | "jcr:primaryType" : "nt:unstructured", 3 | "sling:resourceType": "core/wcm/components/carousel/v1/carousel", 4 | "autoplay" : "true", 5 | "delay" : "7000", 6 | "autopauseDisabled" : "true", 7 | "item_1": { 8 | "jcr:primaryType" : "nt:unstructured", 9 | "jcr:title" : "Teaser 1", 10 | "jcr:description" : "Teaser 1 description", 11 | "sling:resourceType": "core/wcm/components/teaser/v1/teaser" 12 | }, 13 | "item_2": { 14 | "jcr:primaryType" : "nt:unstructured", 15 | "jcr:title" : "Teaser 2", 16 | "jcr:description" : "Teaser 2 description", 17 | "sling:resourceType": "core/wcm/components/teaser/v1/teaser" 18 | }, 19 | "item_3": { 20 | "cq:panelTitle" : "Carousel Panel 3", 21 | "jcr:primaryType" : "nt:unstructured", 22 | "jcr:title" : "Teaser 3", 23 | "jcr:description" : "Teaser 3 description", 24 | "sling:resourceType": "core/wcm/components/teaser/v1/teaser" 25 | } 26 | } -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/button/v2/button/button.html: -------------------------------------------------------------------------------- 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 | <button data-sly-use.button="com.adobe.cq.wcm.core.components.models.form.Button" 17 | type="${button.type}" 18 | id="${button.id}" 19 | class="cmp-form-button" 20 | name="${button.name}" 21 | value="${button.value}">${button.title}</button> 22 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/teaser/v1/teaser/action.html: -------------------------------------------------------------------------------- 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 | <sly data-sly-template.action="${@ action}"> 17 | <a class="cmp-teaser__action-link" href="${action.URL}" 18 | id="${action.id}" 19 | data-cmp-data-layer="${action.data.json}" 20 | data-cmp-clickable="${action.data ? true : false}">${action.title}</a> 21 | </sly> 22 | -------------------------------------------------------------------------------- /examples/aem-kitchen-sink/.storybook/preview.js: -------------------------------------------------------------------------------- 1 | import { addParameters, addDecorator } from '@storybook/client-api'; 2 | import { withA11y } from '@storybook/addon-a11y'; 3 | import { aemMetadata, GenericModel } from '@storybook/aem'; 4 | 5 | import AEMCoreComponents from 'aem-sb-js-core-components'; 6 | 7 | addDecorator(withA11y); 8 | addDecorator(aemMetadata({ 9 | components: [ 10 | require('../components/accordion/.content.xml'), 11 | require('../components/list/.content.xml'), 12 | require('../components/text/.content.xml'), 13 | require('../components/aemtext/.content.xml'), 14 | ...AEMCoreComponents.components, 15 | ], 16 | models: { 17 | 'Accordion': GenericModel, 18 | 'Text': GenericModel, 19 | 'List': GenericModel, 20 | 'person': require('../models/person'), 21 | ...AEMCoreComponents.models, 22 | } 23 | })); 24 | 25 | addParameters({ 26 | a11y: { 27 | config: {}, 28 | options: { 29 | checks: { 'color-contrast': { options: { noScroll: true } } }, 30 | restoreScroll: true, 31 | }, 32 | }, 33 | options: { 34 | showRoots: true, 35 | }, 36 | docs: { 37 | iframeHeight: '200px', 38 | }, 39 | }); 40 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/options/v1/options/example_content_radio.json: -------------------------------------------------------------------------------- 1 | { 2 | "jcr:primaryType": "nt:unstructured", 3 | "jcr:createdBy": "admin", 4 | "jcr:lastModifiedBy": "admin", 5 | "jcr:created": "Wed Nov 02 2016 15:32:37 GMT+0100", 6 | "name": "name1", 7 | "jcr:title": "jcr:title1", 8 | "helpMessage" : "helpMessage1", 9 | "type" : "radio", 10 | "jcr:lastModified": "Wed Nov 09 2016 14:50:06 GMT+0100", 11 | "sling:resourceType": "core/wcm/components/form/options", 12 | "items": { 13 | "jcr:primaryType": "nt:unstructured", 14 | "item0": { 15 | "jcr:primaryType": "nt:unstructured", 16 | "text": "t1", 17 | "value": "v1", 18 | "selected": "true", 19 | "disabled": "true" 20 | }, 21 | "item1": { 22 | "jcr:primaryType": "nt:unstructured", 23 | "text": "t2", 24 | "value": "v2", 25 | "selected": "true" 26 | }, 27 | "item2": { 28 | "jcr:primaryType": "nt:unstructured", 29 | "text": "t3", 30 | "value": "v3" 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/button/v1/button/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | ~ Copyright 2019 Adobe 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. 16 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> 17 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 18 | cq:icon="button" 19 | jcr:description="Button" 20 | jcr:primaryType="cq:Component" 21 | jcr:title="Button (v1)" 22 | componentGroup=".core-wcm"/> 23 | -------------------------------------------------------------------------------- /cli/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@storybook/aem-cli", 3 | "version": "0.0.11", 4 | "description": "CLI tool for Storybook AEM", 5 | "main": "dist/index.js", 6 | "homepage": "https://github.com/storybookjs/aem/cli", 7 | "bugs": { 8 | "url": "https://github.com/storybookjs/aem/issues" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "directory": "cli" 13 | }, 14 | "license": "MIT", 15 | "files": [ 16 | "dist/**/*", 17 | "README.md" 18 | ], 19 | "scripts": { 20 | "prepare": "node ../scripts/prepare.js" 21 | }, 22 | "bin": { 23 | "sba": "bin/sba" 24 | }, 25 | "keywords": [ 26 | "storybook", 27 | "aem", 28 | "cli" 29 | ], 30 | "dependencies": { 31 | "base-64": "^0.1.0", 32 | "chalk": "^4.0.0", 33 | "form-data": "^3.0.0", 34 | "node-fetch": "^2.6.0", 35 | "npm": "^6.14.4", 36 | "prompts": "^2.3.2", 37 | "unzipper": "^0.10.10", 38 | "xml2json": "^0.12.0", 39 | "zip-promise": "^1.1.1", 40 | "js-beautify": "^1.11.0", 41 | "title-case": "^3.0.2" 42 | }, 43 | "devDependencies": { 44 | "typescript": "^3.8.3" 45 | }, 46 | "publishConfig": { 47 | "access": "public" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/options/v1/options/example_content_dropdown.json: -------------------------------------------------------------------------------- 1 | { 2 | "jcr:primaryType": "nt:unstructured", 3 | "jcr:createdBy": "admin", 4 | "jcr:lastModifiedBy": "admin", 5 | "jcr:created": "Wed Nov 02 2016 15:32:37 GMT+0100", 6 | "name": "name1", 7 | "jcr:title": "jcr:title1", 8 | "helpMessage" : "helpMessage1", 9 | "type" : "drop-down", 10 | "jcr:lastModified": "Wed Nov 09 2016 14:50:06 GMT+0100", 11 | "sling:resourceType": "core/wcm/components/form/options", 12 | "items": { 13 | "jcr:primaryType": "nt:unstructured", 14 | "item0": { 15 | "jcr:primaryType": "nt:unstructured", 16 | "text": "t1", 17 | "value": "v1", 18 | "selected": "true", 19 | "disabled": "true" 20 | }, 21 | "item1": { 22 | "jcr:primaryType": "nt:unstructured", 23 | "text": "t2", 24 | "value": "v2", 25 | "selected": "true" 26 | }, 27 | "item2": { 28 | "jcr:primaryType": "nt:unstructured", 29 | "text": "t3", 30 | "value": "v3" 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/navigation/v1/navigation/clientlibs/editor/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | ~ Copyright 2017 Adobe 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. 16 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> 17 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 18 | jcr:primaryType="cq:ClientLibraryFolder" 19 | categories="[core.wcm.components.navigation.v1.editor]" 20 | dependencies="[jquery]"/> 21 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/navigation/v1/navigation/group.html: -------------------------------------------------------------------------------- 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 | <template data-sly-template.group="${@ items='The navigation items for the current level'}" data-sly-use.itemTemplate="item.html"> 17 | <ul class="cmp-navigation__group" data-sly-list="${items}"> 18 | <sly data-sly-call="${itemTemplate.item @ item=item}"></sly> 19 | </ul> 20 | </template> 21 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/text/v2/text/text.stories.js: -------------------------------------------------------------------------------- 1 | import { withKnobs, text, boolean } from "@storybook/addon-knobs"; 2 | import { aemMetadata } from '@storybook/aem'; 3 | 4 | export default { 5 | title: 'AEM Text', 6 | decorators: [ 7 | withKnobs, 8 | aemMetadata({ 9 | decorationTag: { 10 | cssClasses: ['text','component'], 11 | tagName: 'article' 12 | } 13 | }), 14 | ], 15 | parameters: { 16 | knobs: { 17 | escapeHTML: false, 18 | }, 19 | }, 20 | }; 21 | 22 | export const Text = () => { 23 | return { 24 | content: { 25 | text: text('text', 'Hello, world.' ), 26 | isRichText: boolean('isRichText', false), 27 | }, 28 | resourceType: 'core/wcm/components/text/v2/text', // todo: derive from path 29 | }; 30 | }; 31 | 32 | export const RichText = () => { 33 | return { 34 | content: { 35 | text: text('text', '<h1>Hello, world.</h1>' ), 36 | isRichText: boolean('isRichText', true), 37 | }, 38 | resourceType: 'core/wcm/components/text/v2/text', // todo: derive from path 39 | aemMetadata: { 40 | decorationTag: null 41 | }, 42 | }; 43 | }; 44 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/search/v1/search/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | ~ Copyright 2017 Adobe 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. 16 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> 17 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 18 | cq:icon="search" 19 | jcr:description="Full-text search" 20 | jcr:primaryType="cq:Component" 21 | jcr:title="Quick Search (v1)" 22 | componentGroup=".core-wcm"/> 23 | -------------------------------------------------------------------------------- /cli/src/cmds/stories/templates/stories-render.ts: -------------------------------------------------------------------------------- 1 | import ImportConfig from './import-config'; 2 | 3 | export default ({ 4 | imports, 5 | storyRoot, 6 | componentName, 7 | cssClasses, 8 | tagName, 9 | stories, 10 | onlyAppendNewStories, 11 | }: { 12 | imports: Array<ImportConfig>; 13 | storyRoot: string; 14 | componentName: string; 15 | cssClasses; 16 | tagName: string; 17 | stories; 18 | onlyAppendNewStories: boolean; 19 | }) => `${ 20 | !onlyAppendNewStories 21 | ? ` 22 | /** 23 | * Storybook stories for the carousel component 24 | */ 25 | 26 | ${imports.map(importConfig => importConfig.render()).join('\n')} 27 | 28 | export default { 29 | title: '${storyRoot ? `${storyRoot}/` : ''}${componentName}', 30 | decorators: [ 31 | aemMetadata({ 32 | decorationTag: { 33 | cssClasses: [ ${cssClasses 34 | .map(cssClass => (cssClass.wrap ? `'${cssClass.text}'` : cssClass.text)) 35 | .join(',')} ], 36 | tagName: '${tagName}' 37 | } 38 | }) 39 | ], 40 | }; 41 | ` 42 | : '' 43 | } 44 | ${stories.map(story => story.render()).join('\n\n')} 45 | `; 46 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/download/v1/download/example_content.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | 4 | "jcr:primaryType": "nt:unstructured", 5 | "jcr:createdBy": "admin", 6 | "jcr:lastModifiedBy": "admin", 7 | "inline": "true", 8 | "fileName": "Download_Test_PDF.pdf", 9 | "jcr:title": "Download", 10 | "jcr:created": "Thu Oct 18 2018 16:50:44 GMT-0700", 11 | "jcr:lastModified": "Thu Oct 18 2018 16:50:44 GMT-0700", 12 | "sling:resourceType": "core/wcm/components/download/v1/download", 13 | "titleFromAsset": "true", 14 | "textIsRich": "true", 15 | "actionText": "Download", 16 | "jcr:description" : "Description", 17 | "file": { 18 | "jcr:primaryType": "nt:file", 19 | "jcr:createdBy": "admin", 20 | "jcr:created": "Thu Oct 18 2018 16:50:44 GMT-0700", 21 | "jcr:content": { 22 | "jcr:primaryType": "nt:resource", 23 | "jcr:lastModifiedBy": "admin", 24 | "jcr:mimeType": "application/pdf", 25 | "jcr:lastModified": "Thu Oct 18 2018 16:50:44 GMT-0700", 26 | ":jcr:data": 150654, 27 | "jcr:uuid": "1927d32d-fc6c-4046-85d1-d0c3c87d4449" 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/v2/image/example_content.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "image-f4b958f398", 3 | "alt": "Lava flowing into the ocean", 4 | "title": "Lava flowing into the ocean", 5 | "src": "/content/core-components-examples/library/page-authoring/image/_jcr_content/root/responsivegrid/demo_554582955/component/image.coreimg.jpeg/1591933259488/lava-into-ocean.jpeg", 6 | "uuid": "0f54e1b5-535b-45f7-a46b-35abb19dd6bc", 7 | "widths": [], 8 | "lazyEnabled": false, 9 | ":type": "core/wcm/components/image/v2/image", 10 | "dataLayer": { 11 | "image-f4b958f398": { 12 | "image": { 13 | "repo:id": "0f54e1b5-535b-45f7-a46b-35abb19dd6bc", 14 | "@type": "image/jpeg", 15 | "xdm:tags": [], 16 | "repo:modifyDate": "2020-06-12T03:40:59Z", 17 | "repo:path": "/content/dam/core-components-examples/library/sample-assets/lava-into-ocean.jpg" 18 | }, 19 | "@type": "core/wcm/components/image/v2/image", 20 | "dc:title": "Lava flowing into the ocean", 21 | "repo:modifyDate": "2019-01-22T17:31:15Z" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/teaser/v1/teaser/actions.html: -------------------------------------------------------------------------------- 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 | <sly data-sly-template.actions="${@ teaser}"> 17 | <div class="cmp-teaser__action-container" data-sly-test="${teaser.actionsEnabled}" data-sly-list="${teaser.actions}" data-sly-use.actionTemplate="action.html"> 18 | <sly data-sly-call="${actionTemplate.action @ action=item}"></sly> 19 | </div> 20 | </sly> 21 | -------------------------------------------------------------------------------- /app/aem/src/client/preview/helpers/model-proxy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * HTL use class that instantiates the respective story model. 3 | */ 4 | class ModelProxy { 5 | constructor(id) { 6 | this.id = id; 7 | } 8 | 9 | /** 10 | * Called by the htlengine runtime when a script uses the data-sly-call plugin. 11 | * @param {object} context The runtime globals 12 | * @returns A use-class like instance or object. 13 | */ 14 | async use(context) { 15 | const { content, models = {} } = context; 16 | let model = models[this.id]; 17 | if (!model) { 18 | throw Error(`no such model: ${this.id}`); 19 | } 20 | if (model.default) { 21 | model = model.default; 22 | } 23 | // eslint-disable-next-line new-cap 24 | return new model(content, context); 25 | } 26 | } 27 | 28 | /** 29 | * A simple proxy that passes the respective Module id to the model proxy. 30 | * @param {string} id Module Id. 31 | * @returns {ModelProxy} A ModelProxy class. 32 | */ 33 | export function modelProxy(id) { 34 | return new Proxy(ModelProxy, { 35 | construct(target, argArray, newTarget) { 36 | // eslint-disable-next-line new-cap 37 | return new target(id); 38 | }, 39 | }); 40 | } 41 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/navigation/v1/navigation/itemContent.html: -------------------------------------------------------------------------------- 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 | <template data-sly-template.itemContent="${@ item='The navigation item'}"> 18 | <a href="${item.URL}" title="${item.title}" aria-current="${item.active && 'page'}" 19 | data-cmp-clickable="${item.data ? true : false}" 20 | class="cmp-navigation__item-link">${item.title}</a> 21 | </template> 22 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/com/adobe/cq/wcm/core/components/models/Tabs.js: -------------------------------------------------------------------------------- 1 | import PanelContainer from './PanelContainer'; 2 | 3 | /** 4 | * Defines the {@code Tabs} Sling Model used for the {@code /apps/core/wcm/components/tabs} component. 5 | * 6 | * @since com.adobe.cq.wcm.core.components.models 12.5.0 7 | */ 8 | export default class Tabs extends PanelContainer { 9 | static clazz = 'com.adobe.cq.wcm.core.components.models.Tabs'; 10 | 11 | constructor(content) { 12 | super(content); 13 | } 14 | 15 | /** 16 | * Returns the default active item 17 | * 18 | * @return The default active item 19 | * @since com.adobe.cq.wcm.core.components.models 12.5.0 20 | */ 21 | get activeItem() { 22 | return this.content.activeItem || null; 23 | } 24 | 25 | /** 26 | * Returns an accessibility label that describes the tabs. 27 | * 28 | * @return an accessibility label for tabs 29 | * @since com.adobe.cq.wcm.core.components.models 12.9.0 30 | */ 31 | get accessibilityLabel() { 32 | return this.content.accessibilityLabel || null; 33 | } 34 | 35 | /** 36 | * @todo: implement correctly ? 37 | */ 38 | get data() { 39 | return { 40 | json: '', 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/breadcrumb/v2/breadcrumb/breadcrumb.stories.js: -------------------------------------------------------------------------------- 1 | import { aemMetadata } from '@storybook/aem'; 2 | import { withKnobs, number, boolean } from "@storybook/addon-knobs"; 3 | import content from './example_content'; 4 | 5 | export default { 6 | title: 'AEM Breadcrumb', 7 | decorators: [ 8 | withKnobs, 9 | aemMetadata({ 10 | decorationTag: { 11 | cssClasses: ['breadcrumb','component'], 12 | tagName: 'article' 13 | } 14 | }), 15 | ] 16 | }; 17 | 18 | export const Breadcrumb = () => { 19 | // this is kind of a hack, since in AEM the breadcrumb is included in the header w/o a backing content 20 | // and/or it is styled with the designer: todo: verify how this is usually done 21 | content.startLevel = number('startLevel', 1, { 22 | range: true, 23 | min: 0, 24 | max: 10, 25 | step: 1, 26 | }); 27 | content.showHidden = boolean('showHidden'); 28 | content.hideCurrent = boolean('hideCurrent'); 29 | 30 | return { 31 | resourceLoaderPath: '/content/en/products/outdoor/hiking', 32 | content, 33 | resourceType: 'core/wcm/components/breadcrumb/v2/breadcrumb', // todo: derive from path 34 | }; 35 | }; 36 | -------------------------------------------------------------------------------- /scripts/compile-tsc.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | const fs = require('fs'); 3 | const path = require('path'); 4 | const shell = require('shelljs'); 5 | 6 | function getCommand(watch) { 7 | const tsc = path.join(__dirname, '..', 'node_modules', '.bin', 'tsc'); 8 | 9 | const args = [`--outDir ./dist`, '--listEmittedFiles true', '--allowjs true']; 10 | 11 | if (watch) { 12 | args.push('-w'); 13 | } 14 | 15 | return `${tsc} ${args.join(' ')}`; 16 | } 17 | 18 | function handleExit(code, stderr, errorCallback) { 19 | if (code !== 0) { 20 | if (errorCallback && typeof errorCallback === 'function') { 21 | errorCallback(stderr); 22 | } 23 | shell.exit(code); 24 | } 25 | } 26 | 27 | function tscfy(options = {}) { 28 | const { watch = false, silent = false, errorCallback } = options; 29 | const tsConfigFile = 'tsconfig.json'; 30 | 31 | if (!fs.existsSync(tsConfigFile)) { 32 | if (!silent) { 33 | console.log(`No ${tsConfigFile}`); 34 | } 35 | return; 36 | } 37 | 38 | const command = getCommand(watch); 39 | const { code, stderr } = shell.exec(command, { silent }); 40 | 41 | handleExit(code, stderr, errorCallback); 42 | } 43 | 44 | module.exports = { 45 | tscfy, 46 | }; 47 | -------------------------------------------------------------------------------- /cli/src/cmds/package/index.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | import prompts from 'prompts'; 3 | import { error } from '../../utils'; 4 | import { install } from './install'; 5 | import { exportPackage } from './export'; 6 | 7 | const ARG_INSTALL = 'install'; 8 | const ARG_EXPORT = 'export'; 9 | const CHOICE_INSTALL = 'CHOICE_INSTALL'; 10 | const CHOICE_EXPORT = 'CHOICE_EXPORT'; 11 | 12 | export async function packageCommand(args, config) { 13 | if (args.includes(ARG_INSTALL)) install(args, config); 14 | else if (args.includes(ARG_EXPORT)) exportPackage(args, config); 15 | else { 16 | // Ask questions to see what they want to do 17 | const response = await prompts({ 18 | type: 'autocomplete', 19 | name: 'operation', 20 | message: [ 21 | 'Do you want to install content into AEM from Code?', 22 | ' Or export content from AEM into the codebase?', 23 | ].join('\n'), 24 | choices: [ 25 | { title: 'Install', value: CHOICE_INSTALL }, 26 | { title: 'Export', value: CHOICE_EXPORT }, 27 | ], 28 | }); 29 | if (response.operation === CHOICE_INSTALL) install(args, config); 30 | if (response.operation === CHOICE_EXPORT) exportPackage(args, config); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/components.js: -------------------------------------------------------------------------------- 1 | // todo: generate automatically 2 | module.exports = [ 3 | require('./src/jcr_root/apps/core/wcm/components/accordion/v1/accordion/.content.xml'), 4 | require('./src/jcr_root/apps/core/wcm/components/breadcrumb/v2/breadcrumb/.content.xml'), 5 | require('./src/jcr_root/apps/core/wcm/components/button/v1/button/.content.xml'), 6 | require('./src/jcr_root/apps/core/wcm/components/list/v2/list/.content.xml'), 7 | require('./src/jcr_root/apps/core/wcm/components/image/v2/image/.content.xml'), 8 | require('./src/jcr_root/apps/core/wcm/components/text/v2/text/.content.xml'), 9 | require('./src/jcr_root/apps/core/wcm/components/title/v2/title/.content.xml'), 10 | require('./src/jcr_root/apps/core/wcm/components/teaser/v1/teaser/.content.xml'), 11 | require('./src/jcr_root/apps/core/wcm/components/progressbar/v1/progressbar/.content.xml'), 12 | require('./src/jcr_root/apps/core/wcm/components/separator/v1/separator/.content.xml'), 13 | require('./src/jcr_root/apps/core/wcm/components/form/button/v2/button/.content.xml'), 14 | require('./src/jcr_root/apps/core/wcm/components/form/text/v2/text/.content.xml'), 15 | require('./src/jcr_root/apps/core/wcm/components/tabs/v1/tabs/.content.xml'), 16 | ]; 17 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/container/v1/container/responsiveGrid.html: -------------------------------------------------------------------------------- 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 | <template data-sly-template.responsiveGrid="${ @ container}"> 17 | <div id="${container.id}" 18 | class="cmp-container" 19 | style="${container.backgroundStyle @ context='styleString'}"> 20 | <sly data-sly-resource="${resource @ resourceType='wcm/foundation/components/responsivegrid'}"></sly> 21 | </div> 22 | </template> -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/navigation/v1/navigation/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | ~ Copyright 2017 Adobe 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. 16 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> 17 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 18 | cq:icon="compass" 19 | jcr:description="Collects a list of pages to display in a navigation tree." 20 | jcr:primaryType="cq:Component" 21 | jcr:title="Navigation (v1)" 22 | componentGroup=".core-wcm"/> 23 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/tabs/v1/tabs/clientlibs/site/css/tabs.css: -------------------------------------------------------------------------------- 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 | .cmp-tabs__tablist { 18 | display: flex; 19 | flex-wrap: wrap; 20 | padding-left: 0; 21 | list-style: none; 22 | } 23 | 24 | .cmp-tabs__tab { 25 | box-sizing: border-box; 26 | border-bottom: 1px solid transparent; 27 | padding: .5rem 1rem; 28 | cursor: pointer; 29 | } 30 | 31 | .cmp-tabs__tab--active { 32 | border-color: inherit; 33 | } 34 | 35 | .cmp-tabs__tabpanel { 36 | display: none; 37 | } 38 | 39 | .cmp-tabs__tabpanel--active { 40 | display: block; 41 | } 42 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/teaser/v1/teaser/teaser.stories.js: -------------------------------------------------------------------------------- 1 | import { withKnobs, text, boolean, select } from "@storybook/addon-knobs"; 2 | import content from './example_content'; 3 | 4 | import exampleImage from '../.././../../../../../../example-content/lava-into-ocean.jpeg'; 5 | content[":items"].dummyImage.src = exampleImage; 6 | 7 | export default { 8 | title: 'AEM Teaser', 9 | decorators: [ 10 | withKnobs, 11 | ], 12 | parameters: { 13 | knobs: { 14 | escapeHTML: false, 15 | }, 16 | }, 17 | }; 18 | 19 | export const Teaser = () => { 20 | return { 21 | content: { 22 | ...content, 23 | title: text('title', content.title), 24 | pretitle: text('pretitle', content.pretitle), 25 | description: text('description', content.description), 26 | titleType: select('titleType', [null, 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'], null), 27 | actionsEnabled: boolean('actionsEnabled', content.actionsEnabled), 28 | titleLinkHidden: boolean('titleLinkHidden', content.titleLinkHidden), 29 | imageLinkHidden: boolean('imageLinkHidden', content.imageLinkHidden), 30 | }, 31 | resourceType: 'core/wcm/components/teaser/v1/teaser', // todo: derive from path 32 | }; 33 | }; 34 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: ['@storybook/eslint-config-storybook'], 4 | overrides: [ 5 | { 6 | files: [ 7 | '**/__tests__/**', 8 | '**/__testfixtures__/**', 9 | '**/*.test.*', 10 | '**/*.stories.*', 11 | '**/storyshots/**/stories/**', 12 | 'docs/src/new-components/lib/StoryLinkWrapper.js', 13 | 'docs/src/stories/**', 14 | ], 15 | rules: { 16 | '@typescript-eslint/no-empty-function': 'off', 17 | 'import/no-extraneous-dependencies': 'off', 18 | }, 19 | }, 20 | { files: '**/.storybook/config.js', rules: { 'global-require': 'off' } }, 21 | { 22 | files: ['**/*.stories.*'], 23 | rules: { 24 | 'no-console': 'off', 25 | }, 26 | }, 27 | { 28 | files: ['**/*.tsx', '**/*.ts'], 29 | rules: { 30 | 'react/prop-types': 'off', // we should use types 31 | 'no-dupe-class-members': 'off', // this is called overloads in typescript 32 | }, 33 | }, 34 | { 35 | files: ['**/*.d.ts'], 36 | rules: { 37 | 'vars-on-top': 'off', 38 | 'no-var': 'off', // this is how typescript works 39 | 'spaced-comment': 'off', 40 | }, 41 | }, 42 | ], 43 | }; 44 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/container/v1/container/allowedcomponents.html: -------------------------------------------------------------------------------- 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 | <template data-sly-template.allowedcomponents="${@ title, components}"> 17 | <div data-text="${title}" 18 | class="aem-AllowedComponent--title"></div> 19 | <sly data-sly-repeat.comp="${components}" 20 | data-sly-resource="${comp.path @ resourceType=comp.resourceType, decorationTagName='div', cssClassName=comp.cssClass}"></sly> 21 | </template> 22 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/container/v1/container/new/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | ~ Copyright 2019 Adobe 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. 16 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> 17 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 18 | jcr:primaryType="cq:Component" 19 | jcr:title="New Component - Container" 20 | sling:resourceSuperType="wcm/foundation/components/parsys/newpar" 21 | componentGroup=".hidden"/> 22 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/teaser/v1/teaser/title.html: -------------------------------------------------------------------------------- 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 | <sly data-sly-template.title="${@ teaser}"> 17 | <h2 class="cmp-teaser__title" data-sly-test.title="${teaser.title}" data-sly-element="${teaser.titleType}"> 18 | <a class="cmp-teaser__title-link" href="${teaser.linkURL}" 19 | data-sly-unwrap="${!teaser.linkURL || teaser.titleLinkHidden}" 20 | data-cmp-clickable="${teaser.data ? true : false}">${title}</a> 21 | </h2> 22 | </sly> 23 | -------------------------------------------------------------------------------- /cli/src/utils/index.ts: -------------------------------------------------------------------------------- 1 | import { componentList } from './componentList'; 2 | import { createPage } from './createPage'; 3 | import { createPageJCRContent } from './createPageJCRContent'; 4 | import { createStories } from './createStories'; 5 | import { error } from './error'; 6 | import { fetchFromAEM } from './fetchFromAEM'; 7 | import { getChoicesFromDirectories } from './getChoicesFromDirectories'; 8 | import { getCQTemplate } from './getCQTemplate'; 9 | import { getConfig } from './getConfig'; 10 | import { getDirectories } from './getDirectories'; 11 | import { getEditDialog } from './getEditDialog'; 12 | import { log } from './log'; 13 | import { parseEditDialog } from './parseEditDialog'; 14 | import { toCamelCase } from './toCamelCase'; 15 | import { getLatestVersion, getInstalledVersion, checkVersion } from './versionCheck'; 16 | import { xmlToJSONCleanup } from './xmlToJSONCleanup'; 17 | 18 | export { 19 | componentList, 20 | createPage, 21 | createPageJCRContent, 22 | createStories, 23 | error, 24 | fetchFromAEM, 25 | getChoicesFromDirectories, 26 | getCQTemplate, 27 | getConfig, 28 | getDirectories, 29 | getEditDialog, 30 | log, 31 | parseEditDialog, 32 | toCamelCase, 33 | getLatestVersion, 34 | getInstalledVersion, 35 | checkVersion, 36 | xmlToJSONCleanup, 37 | }; 38 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/options/v1/options/example_content_local_source.json: -------------------------------------------------------------------------------- 1 | { 2 | "jcr:primaryType" : "nt:unstructured", 3 | "jcr:createdBy" : "admin", 4 | "jcr:lastModifiedBy": "admin", 5 | "jcr:created" : "Wed Nov 02 2016 15:32:37 GMT+0100", 6 | "name" : "local-name", 7 | "jcr:title" : "local-title", 8 | "helpMessage" : "local-helpMessage", 9 | "type" : "checkbox", 10 | "jcr:lastModified" : "Wed Nov 09 2016 14:50:06 GMT+0100", 11 | "sling:resourceType": "core/wcm/components/form/options", 12 | "source" : "local", 13 | "items" : { 14 | "jcr:primaryType": "nt:unstructured", 15 | "item0" : { 16 | "jcr:primaryType": "nt:unstructured", 17 | "text" : "local-item1-name", 18 | "value" : "local-item1-value", 19 | "selected" : "true", 20 | "disabled" : "false" 21 | }, 22 | "item1" : { 23 | "jcr:primaryType": "nt:unstructured", 24 | "text" : "local-item2-name", 25 | "value" : "local-item2-value", 26 | "selected" : "false", 27 | "disabled" : "true" 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/hidden/v1/hidden/hidden.html: -------------------------------------------------------------------------------- 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 | <input data-sly-use.field="com.adobe.cq.wcm.core.components.models.form.Field" 17 | data-sly-use.templates="core/wcm/components/commons/v1/templates.html" 18 | data-sly-set.appendText="${field.name && 'name='}${field.name}${field.value && ' | value='}${field.value}" 19 | data-sly-call="${templates.placeholder @ isEmpty = true, classAppend, emptyTextAppend = appendText}" 20 | type="hidden" id="${field.id}" name="${field.name}" value="${field.value}" /> 21 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/hidden/v2/hidden/hidden.html: -------------------------------------------------------------------------------- 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 | <input data-sly-use.field="com.adobe.cq.wcm.core.components.models.form.Field" 17 | data-sly-use.templates="core/wcm/components/commons/v1/templates.html" 18 | data-sly-set.appendText="${field.name && 'name='}${field.name}${field.value && ' | value='}${field.value}" 19 | data-sly-call="${templates.placeholder @ isEmpty = true, classAppend, emptyTextAppend = appendText}" 20 | type="hidden" id="${field.id}" name="${field.name}" value="${field.value}" /> 21 | -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/form/options/v1/options/example_content_checkbox.json: -------------------------------------------------------------------------------- 1 | { 2 | "jcr:primaryType" : "nt:unstructured", 3 | "jcr:createdBy" : "admin", 4 | "jcr:lastModifiedBy": "admin", 5 | "jcr:created" : "Wed Nov 02 2016 15:32:37 GMT+0100", 6 | "name" : "name1", 7 | "jcr:title" : "jcr:title1", 8 | "helpMessage" : "helpMessage1", 9 | "type" : "checkbox", 10 | "jcr:lastModified" : "Wed Nov 09 2016 14:50:06 GMT+0100", 11 | "sling:resourceType": "core/wcm/components/form/options", 12 | "items" : { 13 | "jcr:primaryType": "nt:unstructured", 14 | "item0" : { 15 | "jcr:primaryType": "nt:unstructured", 16 | "text" : "t1", 17 | "value" : "v1", 18 | "selected" : "true", 19 | "disabled" : "true" 20 | }, 21 | "item1" : { 22 | "jcr:primaryType": "nt:unstructured", 23 | "text" : "t2", 24 | "value" : "v2", 25 | "selected" : "true" 26 | }, 27 | "item2" : { 28 | "jcr:primaryType": "nt:unstructured", 29 | "text" : "t3", 30 | "value" : "v3" 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/embed/v1/embed/embeddable/youtube/youtube.html: -------------------------------------------------------------------------------- 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 | <iframe data-sly-test="${properties.youtubeVideoId}" 17 | width="${properties.youtubeWidth || '100%' @ context='scriptString'}" 18 | height="${properties.youtubeHeight || 390 @ context='scriptString'}" 19 | src="${'https://www.youtube.com/embed/{0}?origin={1}://{2}' @ format=[properties.youtubeVideoId, request.scheme, request.serverName]}" 20 | frameborder="0" 21 | allowfullscreen 22 | aria-label="${'YouTube Video' @ i18n}"></iframe> 23 | --------------------------------------------------------------------------------