@pega/cosmos-react-demos 3.0.0-dev.2.1 → 3.0.0-dev.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts +6 -0
- package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -0
- package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx +64 -0
- package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx.map +1 -0
- package/jsx/build/DynamicContentEditor/FieldSelector.d.ts +11 -0
- package/jsx/build/DynamicContentEditor/FieldSelector.d.ts.map +1 -0
- package/jsx/build/DynamicContentEditor/FieldSelector.jsx +80 -0
- package/jsx/build/DynamicContentEditor/FieldSelector.jsx.map +1 -0
- package/jsx/core/AppShell/AppShell.stories.jsx +1 -1
- package/jsx/core/AppShell/AppShell.stories.jsx.map +1 -1
- package/jsx/core/Card/Card.stories.jsx +1 -1
- package/jsx/core/Card/Card.stories.jsx.map +1 -1
- package/jsx/core/Checkbox/Checkbox.stories.jsx +1 -1
- package/jsx/core/Checkbox/Checkbox.stories.jsx.map +1 -1
- package/jsx/core/Currency/Currency.stories.d.ts +5 -2
- package/jsx/core/Currency/Currency.stories.d.ts.map +1 -1
- package/jsx/core/Currency/Currency.stories.jsx +30 -12
- package/jsx/core/Currency/Currency.stories.jsx.map +1 -1
- package/jsx/core/Form/Form.stories.jsx +2 -2
- package/jsx/core/Form/Form.stories.jsx.map +1 -1
- package/jsx/core/Modal/Modal.stories.d.ts.map +1 -1
- package/jsx/core/Modal/Modal.stories.jsx +29 -43
- package/jsx/core/Modal/Modal.stories.jsx.map +1 -1
- package/jsx/core/Number/Number.stories.d.ts +3 -3
- package/jsx/core/Number/Number.stories.d.ts.map +1 -1
- package/jsx/core/Number/Number.stories.jsx +14 -10
- package/jsx/core/Number/Number.stories.jsx.map +1 -1
- package/jsx/core/PageTemplates/PageTemplates.stories.d.ts +5 -3
- package/jsx/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
- package/jsx/core/PageTemplates/PageTemplates.stories.jsx +102 -26
- package/jsx/core/PageTemplates/PageTemplates.stories.jsx.map +1 -1
- package/jsx/core/RadioButton/RadioButton.stories.jsx +1 -1
- package/jsx/core/RadioButton/RadioButton.stories.jsx.map +1 -1
- package/jsx/core/Rating/Rating.stories.jsx +1 -1
- package/jsx/core/Rating/Rating.stories.jsx.map +1 -1
- package/jsx/core/Sentiment/Sentiment.stories.jsx +4 -4
- package/jsx/core/Sentiment/Sentiment.stories.jsx.map +1 -1
- package/jsx/core/Table/Table.mocks.d.ts +6 -0
- package/jsx/core/Table/Table.mocks.d.ts.map +1 -1
- package/jsx/core/Table/Table.mocks.jsx +134 -0
- package/jsx/core/Table/Table.mocks.jsx.map +1 -1
- package/jsx/core/Table/Table.stories.jsx +2 -2
- package/jsx/core/Table/Table.stories.jsx.map +1 -1
- package/jsx/rte/Editor/Editor.stories.jsx +1 -1
- package/jsx/rte/Editor/Editor.stories.jsx.map +1 -1
- package/jsx/social/Email/Email.mocks.d.ts +19 -2
- package/jsx/social/Email/Email.mocks.d.ts.map +1 -1
- package/jsx/social/Email/Email.mocks.js +48 -1
- package/jsx/social/Email/Email.mocks.js.map +1 -1
- package/jsx/social/Email/Email.stories.d.ts +1 -1
- package/jsx/social/Email/Email.stories.d.ts.map +1 -1
- package/jsx/social/Email/Email.stories.jsx +57 -14
- package/jsx/social/Email/Email.stories.jsx.map +1 -1
- package/jsx/work/Details/Details.stories.jsx +3 -3
- package/jsx/work/Details/Details.stories.jsx.map +1 -1
- package/jsx/work/Stakeholders/Stakeholders.mocks.jsx +1 -1
- package/jsx/work/Stakeholders/Stakeholders.mocks.jsx.map +1 -1
- package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts +6 -0
- package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -0
- package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js +48 -0
- package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js.map +1 -0
- package/lib/build/DynamicContentEditor/FieldSelector.d.ts +14 -0
- package/lib/build/DynamicContentEditor/FieldSelector.d.ts.map +1 -0
- package/lib/build/DynamicContentEditor/FieldSelector.js +81 -0
- package/lib/build/DynamicContentEditor/FieldSelector.js.map +1 -0
- package/lib/core/AppShell/AppShell.stories.js +1 -1
- package/lib/core/AppShell/AppShell.stories.js.map +1 -1
- package/lib/core/Card/Card.stories.js +1 -1
- package/lib/core/Card/Card.stories.js.map +1 -1
- package/lib/core/Checkbox/Checkbox.stories.js +1 -1
- package/lib/core/Checkbox/Checkbox.stories.js.map +1 -1
- package/lib/core/Currency/Currency.stories.d.ts +5 -2
- package/lib/core/Currency/Currency.stories.d.ts.map +1 -1
- package/lib/core/Currency/Currency.stories.js +30 -12
- package/lib/core/Currency/Currency.stories.js.map +1 -1
- package/lib/core/Form/Form.stories.js +2 -2
- package/lib/core/Form/Form.stories.js.map +1 -1
- package/lib/core/Modal/Modal.stories.d.ts.map +1 -1
- package/lib/core/Modal/Modal.stories.js +14 -14
- package/lib/core/Modal/Modal.stories.js.map +1 -1
- package/lib/core/Number/Number.stories.d.ts +3 -3
- package/lib/core/Number/Number.stories.d.ts.map +1 -1
- package/lib/core/Number/Number.stories.js +14 -10
- package/lib/core/Number/Number.stories.js.map +1 -1
- package/lib/core/PageTemplates/PageTemplates.stories.d.ts +5 -3
- package/lib/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
- package/lib/core/PageTemplates/PageTemplates.stories.js +91 -23
- package/lib/core/PageTemplates/PageTemplates.stories.js.map +1 -1
- package/lib/core/RadioButton/RadioButton.stories.js +1 -1
- package/lib/core/RadioButton/RadioButton.stories.js.map +1 -1
- package/lib/core/Rating/Rating.stories.js +1 -1
- package/lib/core/Rating/Rating.stories.js.map +1 -1
- package/lib/core/Sentiment/Sentiment.stories.js +2 -2
- package/lib/core/Sentiment/Sentiment.stories.js.map +1 -1
- package/lib/core/Table/Table.mocks.d.ts +6 -0
- package/lib/core/Table/Table.mocks.d.ts.map +1 -1
- package/lib/core/Table/Table.mocks.js +134 -0
- package/lib/core/Table/Table.mocks.js.map +1 -1
- package/lib/core/Table/Table.stories.js +2 -2
- package/lib/core/Table/Table.stories.js.map +1 -1
- package/lib/rte/Editor/Editor.stories.js +1 -1
- package/lib/rte/Editor/Editor.stories.js.map +1 -1
- package/lib/social/Email/Email.mocks.d.ts +19 -2
- package/lib/social/Email/Email.mocks.d.ts.map +1 -1
- package/lib/social/Email/Email.mocks.js +48 -1
- package/lib/social/Email/Email.mocks.js.map +1 -1
- package/lib/social/Email/Email.stories.d.ts +1 -1
- package/lib/social/Email/Email.stories.d.ts.map +1 -1
- package/lib/social/Email/Email.stories.js +40 -14
- package/lib/social/Email/Email.stories.js.map +1 -1
- package/lib/work/Details/Details.stories.js +3 -3
- package/lib/work/Details/Details.stories.js.map +1 -1
- package/lib/work/Stakeholders/Stakeholders.mocks.js +1 -1
- package/lib/work/Stakeholders/Stakeholders.mocks.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.stories.jsx","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAe,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAE7D,eAAe;IACb,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,MAAM;CACV,CAAC;AAEV,MAAM,KAAK,GAAG,kBAAkB,CAAC;AAEjC,MA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AAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,CACnE;;UACF,EAAE,MAAM,CACV;QAAA,EAAE,UAAU,CACd;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,MAAM,CACL,YAAY,CAAC,CAAC,IAAI,CAAC,CACnB,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,GAAG,CAAC,CAAC,MAAM,CAAC,CACZ,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,OAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,EAEhG;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta } from '@storybook/react';\nimport { useState, useRef } from 'react';\nimport ReactDOM from 'react-dom';\nimport { action } from '@storybook/addon-actions';\nimport { Editor as TinymceEditor } from 'tinymce';\n\nimport {\n Button,\n Card,\n CardContent,\n CardFooter,\n Flex,\n Text,\n TextArea\n} from '@pega/cosmos-react-core';\nimport { EditorState, Editor } from '@pega/cosmos-react-rte';\n\nexport default {\n title: 'RTE/Editor',\n component: Editor\n} as Meta;\n\nconst label = 'Form field label';\n\nexport const EditorDemo = () => {\n const editorRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'images', 'links']}\n onFocus={action('Editor focused')}\n onBlur={action('Editor blurred')}\n onImageAdded={onImageAdded}\n defaultValue='<body><p>Hi mom <a href=\"https://google.com\">link</a></p></body>'\n />\n );\n};\n\nexport const EmptyEditorDemo = () => {\n const editorRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'images', 'links']}\n onImageAdded={onImageAdded}\n onFocus={action('Editor has focus')}\n onBlur={action('Editor has blurred')}\n placeholder='Type some stuff in here'\n />\n );\n};\n\nexport const ReadonlyFormField = () => {\n return (\n <Editor\n label={label}\n readOnly\n defaultValue={`<article class=\"main-page-content\" lang=\"en-US\"><h1>HTML: HyperText Markup Language</h1><div><p><strong>HTML</strong> (HyperText Markup Language) is the most basic building block of the Web. It defines the meaning and structure of web content. Other technologies besides HTML are generally used to describe a web page's appearance/presentation (<a href=\"/en-US/docs/Web/CSS\">CSS</a>) or functionality/behavior (<a href=\"/en-US/docs/Web/JavaScript\">JavaScript</a>).</p>\n <p>\"Hypertext\" refers to links that connect web pages to one another, either within a single website or between websites. Links are a fundamental aspect of the Web. By uploading content to the Internet and linking it to pages created by other people, you become an active participant in the World Wide Web.</p>\n <p>HTML uses \"markup\" to annotate text, images, and other content for display in a Web browser. HTML markup includes special \"elements\" such as <a href=\"/en-US/docs/Web/HTML/Element/head\"><code><head></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/title\"><code><title></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/body\"><code><body></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/header\"><code><header></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/footer\"><code><footer></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/article\"><code><article></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/section\"><code><section></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/p\"><code><p></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/div\"><code><div></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/span\"><code><span></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/img\"><code><img></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/aside\"><code><aside></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/audio\"><code><audio></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/canvas\"><code><canvas></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/datalist\"><code><datalist></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/details\"><code><details></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/embed\"><code><embed></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/nav\"><code><nav></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/output\"><code><output></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/progress\"><code><progress></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/video\"><code><video></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/ul\"><code><ul></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/ol\"><code><ol></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/li\"><code><li></code></a> and many others.</p>\n <p>An HTML element is set off from other text in a document by \"tags\", which consist of the element name surrounded by \"<code><</code>\" and \"<code>></code>\". The name of an element inside a tag is case insensitive. That is, it can be written in uppercase, lowercase, or a mixture. For example, the <code><title></code> tag can be written as <code><Title></code>, <code><TITLE></code>, or in any other way.</p>\n\n <div id=\"on-github\" class=\"on-github\"><h3>Found a problem with this page?</h3><ul><li><a href=\"https://github.com/mdn/content/edit/main/files/en-us/web/html/index.md\" title=\"You're going to need to sign in to GitHub first (Opens in a new tab)\" target=\"_blank\" rel=\"noopener noreferrer\">Edit on <b>GitHub</b></a></li><li><a href=\"https://github.com/mdn/content/blob/main/files/en-us/web/html/index.md\" title=\"Folder: en-us/web/html (Opens in a new tab)\" target=\"_blank\" rel=\"noopener noreferrer\">Source on <b>GitHub</b></a></li><li><a href=\"https://github.com/mdn/content/issues/new?body=MDN+URL%3A+https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTML%0A%0A%23%23%23%23+What+information+was+incorrect%2C+unhelpful%2C+or+incomplete%3F%0A%0A%0A%23%23%23%23+Specific+section+or+headline%3F%0A%0A%0A%23%23%23%23+What+did+you+expect+to+see%3F%0A%0A%0A%23%23%23%23+Did+you+test+this%3F+If+so%2C+how%3F%0A%0A%0A%3C%21--+Do+not+make+changes+below+this+line+--%3E%0A%3Cdetails%3E%0A%3Csummary%3EMDN+Content+page+report+details%3C%2Fsummary%3E%0A%0A*+Folder%3A+%60en-us%2Fweb%2Fhtml%60%0A*+MDN+URL%3A+https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTML%0A*+GitHub+URL%3A+https%3A%2F%2Fgithub.com%2Fmdn%2Fcontent%2Fblob%2Fmain%2Ffiles%2Fen-us%2Fweb%2Fhtml%2Findex.md%0A*+Last+commit%3A+https%3A%2F%2Fgithub.com%2Fmdn%2Fcontent%2Fcommit%2F775662998e66813a612e3ff27e02f2ada867bc17%0A*+Document+last+modified%3A+2021-10-03T00%3A01%3A51.000Z%0A%0A%3C%2Fdetails%3E&title=Issue+with+%22HTML%3A+HyperText+Markup+Language%22%3A+%28short+summary+here+please%29&labels=needs-triage%2CContent%3AHTML\" title=\"This will take you to https://github.com/mdn/content to file a new issue\" target=\"_blank\" rel=\"noopener noreferrer\">Report a problem with this content on <b>GitHub</b></a></li><li>Want to fix the problem yourself? See <a href=\"https://github.com/mdn/content/blob/main/README.md\" target=\"_blank\" rel=\"noopener noreferrer\">our Contribution guide</a>.</li></ul></div>\n `}\n />\n );\n};\n\nconst PegaCustom = ({ children }: { children: string }) => {\n return (\n <p\n style={{ color: 'blue', textTransform: 'uppercase' }}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{ __html: children }}\n />\n );\n};\n\nclass PegaCustomElement extends HTMLElement {\n removeElements() {\n while (this.firstChild) {\n this.removeChild(this.firstChild);\n }\n }\n\n connectedCallback() {\n const inner = this.innerHTML;\n this.removeElements();\n const mountPoint = document.createElement('span');\n this.appendChild(mountPoint);\n ReactDOM.render(<PegaCustom>{inner}</PegaCustom>, mountPoint);\n }\n}\n\nexport const CustomComponentDemo = () => {\n const editorRef = useRef<EditorState>(null);\n const [editor, setEditor] = useState({} as TinymceEditor);\n\n const onCustomAction = () => {\n editor.insertContent('<pega-custom>Inserted from toolbar</pega-custom>');\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'links', 'images']}\n defaultValue='<body><p>Hi mom <a href=\"https://google.com\">link</a></p><pega-custom>Hello from custom element.</pega-custom><p>hi</p></body>'\n customComponents={[{ customElement: PegaCustomElement, name: 'pega-custom' }]}\n customActions={[\n {\n icon: 'pega',\n text: 'Insert a custom element',\n onMouseDown: () => {\n onCustomAction();\n }\n }\n ]}\n onInit={initializedEditor => {\n setEditor(initializedEditor);\n }}\n />\n );\n};\n\nexport const RichTextEditorWithLogs = () => {\n const editorRef = useRef<EditorState>(null);\n const [content, setContent] = useState<string | undefined>();\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n const showContent = (type: 'html' | 'plain_text' | 'rich_text') => {\n if (type === 'html') setContent(editorRef.current?.getHtml());\n else if (type === 'plain_text') setContent(editorRef.current?.getPlainText());\n else if (type === 'rich_text') setContent(editorRef.current?.getRichText());\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Editor\n ref={editorRef}\n toolbar={['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation']}\n onImageAdded={onImageAdded}\n label='Rich text editor with logs'\n info='Click on the buttons below to show the different formatted outputs of the RTE'\n />\n\n <Flex container={{ gap: 1 }}>\n <Button onClick={() => showContent('html')}>Show HTML</Button>\n <Button onClick={() => showContent('plain_text')}>Show plain text</Button>\n <Button onClick={() => showContent('rich_text')}>Show rich text</Button>\n </Flex>\n\n <Text>{content}</Text>\n </Flex>\n );\n};\n\nexport const RichTextEditorHtmlParsingDemo = () => {\n const [html, setHtml] = useState('<p>Hello world!</p>');\n const rteRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n rteRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Card>\n <CardContent>\n <TextArea value={html} onChange={e => setHtml(e.target.value)} />\n </CardContent>\n <CardFooter>\n <Button onClick={() => rteRef.current?.insertHtml(html.trim(), true)}>\n Overwrite RTE with new HTML\n </Button>\n </CardFooter>\n </Card>\n <Editor\n defaultValue={html}\n onImageAdded={onImageAdded}\n ref={rteRef}\n label={label}\n toolbar={['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation']}\n />\n </Flex>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Editor.stories.jsx","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAe,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAE7D,eAAe;IACb,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,MAAM;CACV,CAAC;AAEV,MAAM,KAAK,GAAG,kBAAkB,CAAC;AAEjC,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,MAAM,SAAS,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAE5C,MAAM,YAAY,GAAG,CAAC,KAAW,EAAE,EAAU,EAAE,EAAE;QAC/C,MAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACvC,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,IAAI,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AAC,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,EAEhG;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta } from '@storybook/react';\nimport { useState, useRef } from 'react';\nimport ReactDOM from 'react-dom';\nimport { action } from '@storybook/addon-actions';\nimport { Editor as TinymceEditor } from 'tinymce';\n\nimport {\n Button,\n Card,\n CardContent,\n CardFooter,\n Flex,\n Text,\n TextArea\n} from '@pega/cosmos-react-core';\nimport { EditorState, Editor } from '@pega/cosmos-react-rte';\n\nexport default {\n title: 'RTE/Editor',\n component: Editor\n} as Meta;\n\nconst label = 'Form field label';\n\nexport const EditorDemo = () => {\n const editorRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'images', 'links']}\n onFocus={action('Editor focused')}\n onBlur={action('Editor blurred')}\n onImageAdded={onImageAdded}\n defaultValue='<body><p>Hi mom <a href=\"https://google.com\">link</a></p></body>'\n />\n );\n};\n\nexport const EmptyEditorDemo = () => {\n const editorRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'images', 'links']}\n onImageAdded={onImageAdded}\n onFocus={action('Editor has focus')}\n onBlur={action('Editor has blurred')}\n placeholder='Type some stuff in here'\n />\n );\n};\n\nexport const ReadonlyFormField = () => {\n return (\n <Editor\n label={label}\n readOnly\n defaultValue={`<article class=\"main-page-content\" lang=\"en-US\"><h1>HTML: HyperText Markup Language</h1><div><p><strong>HTML</strong> (HyperText Markup Language) is the most basic building block of the Web. It defines the meaning and structure of web content. Other technologies besides HTML are generally used to describe a web page's appearance/presentation (<a href=\"/en-US/docs/Web/CSS\">CSS</a>) or functionality/behavior (<a href=\"/en-US/docs/Web/JavaScript\">JavaScript</a>).</p>\n <p>\"Hypertext\" refers to links that connect web pages to one another, either within a single website or between websites. Links are a fundamental aspect of the Web. By uploading content to the Internet and linking it to pages created by other people, you become an active participant in the World Wide Web.</p>\n <p>HTML uses \"markup\" to annotate text, images, and other content for display in a Web browser. HTML markup includes special \"elements\" such as <a href=\"/en-US/docs/Web/HTML/Element/head\"><code><head></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/title\"><code><title></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/body\"><code><body></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/header\"><code><header></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/footer\"><code><footer></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/article\"><code><article></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/section\"><code><section></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/p\"><code><p></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/div\"><code><div></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/span\"><code><span></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/img\"><code><img></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/aside\"><code><aside></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/audio\"><code><audio></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/canvas\"><code><canvas></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/datalist\"><code><datalist></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/details\"><code><details></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/embed\"><code><embed></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/nav\"><code><nav></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/output\"><code><output></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/progress\"><code><progress></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/video\"><code><video></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/ul\"><code><ul></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/ol\"><code><ol></code></a>, <a href=\"/en-US/docs/Web/HTML/Element/li\"><code><li></code></a> and many others.</p>\n <p>An HTML element is set off from other text in a document by \"tags\", which consist of the element name surrounded by \"<code><</code>\" and \"<code>></code>\". The name of an element inside a tag is case insensitive. That is, it can be written in uppercase, lowercase, or a mixture. For example, the <code><title></code> tag can be written as <code><Title></code>, <code><TITLE></code>, or in any other way.</p>\n\n <div id=\"on-github\" class=\"on-github\"><h3>Found a problem with this page?</h3><ul><li><a href=\"https://github.com/mdn/content/edit/main/files/en-us/web/html/index.md\" title=\"You're going to need to sign in to GitHub first (Opens in a new tab)\" target=\"_blank\" rel=\"noopener noreferrer\">Edit on <b>GitHub</b></a></li><li><a href=\"https://github.com/mdn/content/blob/main/files/en-us/web/html/index.md\" title=\"Folder: en-us/web/html (Opens in a new tab)\" target=\"_blank\" rel=\"noopener noreferrer\">Source on <b>GitHub</b></a></li><li><a href=\"https://github.com/mdn/content/issues/new?body=MDN+URL%3A+https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTML%0A%0A%23%23%23%23+What+information+was+incorrect%2C+unhelpful%2C+or+incomplete%3F%0A%0A%0A%23%23%23%23+Specific+section+or+headline%3F%0A%0A%0A%23%23%23%23+What+did+you+expect+to+see%3F%0A%0A%0A%23%23%23%23+Did+you+test+this%3F+If+so%2C+how%3F%0A%0A%0A%3C%21--+Do+not+make+changes+below+this+line+--%3E%0A%3Cdetails%3E%0A%3Csummary%3EMDN+Content+page+report+details%3C%2Fsummary%3E%0A%0A*+Folder%3A+%60en-us%2Fweb%2Fhtml%60%0A*+MDN+URL%3A+https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTML%0A*+GitHub+URL%3A+https%3A%2F%2Fgithub.com%2Fmdn%2Fcontent%2Fblob%2Fmain%2Ffiles%2Fen-us%2Fweb%2Fhtml%2Findex.md%0A*+Last+commit%3A+https%3A%2F%2Fgithub.com%2Fmdn%2Fcontent%2Fcommit%2F775662998e66813a612e3ff27e02f2ada867bc17%0A*+Document+last+modified%3A+2021-10-03T00%3A01%3A51.000Z%0A%0A%3C%2Fdetails%3E&title=Issue+with+%22HTML%3A+HyperText+Markup+Language%22%3A+%28short+summary+here+please%29&labels=needs-triage%2CContent%3AHTML\" title=\"This will take you to https://github.com/mdn/content to file a new issue\" target=\"_blank\" rel=\"noopener noreferrer\">Report a problem with this content on <b>GitHub</b></a></li><li>Want to fix the problem yourself? See <a href=\"https://github.com/mdn/content/blob/main/README.md\" target=\"_blank\" rel=\"noopener noreferrer\">our Contribution guide</a>.</li></ul></div>\n `}\n />\n );\n};\n\nconst PegaCustom = ({ children }: { children: string }) => {\n return (\n <p\n style={{ color: 'blue', textTransform: 'uppercase' }}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{ __html: children }}\n />\n );\n};\n\nclass PegaCustomElement extends HTMLElement {\n removeElements() {\n while (this.firstChild) {\n this.removeChild(this.firstChild);\n }\n }\n\n connectedCallback() {\n const inner = this.innerHTML;\n this.removeElements();\n const mountPoint = document.createElement('span');\n this.appendChild(mountPoint);\n ReactDOM.render(<PegaCustom>{inner}</PegaCustom>, mountPoint);\n }\n}\n\nexport const CustomComponentDemo = () => {\n const editorRef = useRef<EditorState>(null);\n const [editor, setEditor] = useState({} as TinymceEditor);\n\n const onCustomAction = () => {\n editor.insertContent('<pega-custom>Inserted from toolbar</pega-custom>');\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'links', 'images']}\n defaultValue='<body><p>Hi mom <a href=\"https://google.com\">link</a></p><p>hi <pega-custom>Hello from custom element.</pega-custom></p></body>'\n customComponents={[{ customElement: PegaCustomElement, name: 'pega-custom' }]}\n customActions={[\n {\n icon: 'pega',\n text: 'Insert a custom element',\n onMouseDown: () => {\n onCustomAction();\n }\n }\n ]}\n onInit={initializedEditor => {\n setEditor(initializedEditor);\n }}\n />\n );\n};\n\nexport const RichTextEditorWithLogs = () => {\n const editorRef = useRef<EditorState>(null);\n const [content, setContent] = useState<string | undefined>();\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n const showContent = (type: 'html' | 'plain_text' | 'rich_text') => {\n if (type === 'html') setContent(editorRef.current?.getHtml());\n else if (type === 'plain_text') setContent(editorRef.current?.getPlainText());\n else if (type === 'rich_text') setContent(editorRef.current?.getRichText());\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Editor\n ref={editorRef}\n toolbar={['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation']}\n onImageAdded={onImageAdded}\n label='Rich text editor with logs'\n info='Click on the buttons below to show the different formatted outputs of the RTE'\n />\n\n <Flex container={{ gap: 1 }}>\n <Button onClick={() => showContent('html')}>Show HTML</Button>\n <Button onClick={() => showContent('plain_text')}>Show plain text</Button>\n <Button onClick={() => showContent('rich_text')}>Show rich text</Button>\n </Flex>\n\n <Text>{content}</Text>\n </Flex>\n );\n};\n\nexport const RichTextEditorHtmlParsingDemo = () => {\n const [html, setHtml] = useState('<p>Hello world!</p>');\n const rteRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n rteRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Card>\n <CardContent>\n <TextArea value={html} onChange={e => setHtml(e.target.value)} />\n </CardContent>\n <CardFooter>\n <Button onClick={() => rteRef.current?.insertHtml(html.trim(), true)}>\n Overwrite RTE with new HTML\n </Button>\n </CardFooter>\n </Card>\n <Editor\n defaultValue={html}\n onImageAdded={onImageAdded}\n ref={rteRef}\n label={label}\n toolbar={['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation']}\n />\n </Flex>\n );\n};\n"]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldValueListProps } from '@pega/cosmos-react-core';
|
|
2
|
+
import { EmailComposerProps, EntityListProps } from '@pega/cosmos-react-social';
|
|
2
3
|
export declare const emailBodyContent = "<div>Hi, <br /> <br /><div>Can you please change my address in the SSN.</div> <br /> <br />Regards, <br />Sara Davis </div>";
|
|
3
4
|
export declare const emailAttachments: EmailComposerProps['attachments'];
|
|
4
5
|
export declare const participants: EmailComposerProps['participants'];
|
|
5
6
|
export declare const toParticipants: string[];
|
|
6
7
|
export declare const ccParticipants: string[];
|
|
7
8
|
export declare const bccParticipants: string[];
|
|
8
|
-
export declare const
|
|
9
|
+
export declare const EntityListMockData: EntityListProps['content'];
|
|
9
10
|
export declare const EmailMockData: {
|
|
10
11
|
emails: {
|
|
11
12
|
'Sara Davis': {
|
|
@@ -83,4 +84,20 @@ export declare const EmailMockData: {
|
|
|
83
84
|
content: string;
|
|
84
85
|
}[];
|
|
85
86
|
};
|
|
87
|
+
export declare const viewAnalysisEmailHeaderMock: FieldValueListProps['fields'];
|
|
88
|
+
export declare const topicListMock: ({
|
|
89
|
+
id: string;
|
|
90
|
+
primary: string;
|
|
91
|
+
secondary: {
|
|
92
|
+
indicator: string;
|
|
93
|
+
value: string;
|
|
94
|
+
};
|
|
95
|
+
} | {
|
|
96
|
+
id: string;
|
|
97
|
+
primary: string;
|
|
98
|
+
secondary: {
|
|
99
|
+
indicator: string;
|
|
100
|
+
value?: undefined;
|
|
101
|
+
};
|
|
102
|
+
})[];
|
|
86
103
|
//# sourceMappingURL=Email.mocks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.mocks.d.ts","sourceRoot":"","sources":["../../../src/social/Email/Email.mocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAa,
|
|
1
|
+
{"version":3,"file":"Email.mocks.d.ts","sourceRoot":"","sources":["../../../src/social/Email/Email.mocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAa,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE3F,eAAO,MAAM,gBAAgB,gIACkG,CAAC;AAEhI,eAAO,MAAM,gBAAgB,EAAE,kBAAkB,CAAC,aAAa,CAS9D,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,kBAAkB,CAAC,cAAc,CAgC3D,CAAC;AAEF,eAAO,MAAM,cAAc,UAEiC,CAAC;AAC7D,eAAO,MAAM,cAAc,UAEiC,CAAC;AAC7D,eAAO,MAAM,eAAe,UAEgC,CAAC;AAE7D,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAAC,SAAS,CAsLzD,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8GzB,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,mBAAmB,CAAC,QAAQ,CAarE,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;IAgCzB,CAAC"}
|
|
@@ -51,7 +51,7 @@ export const ccParticipants = participants
|
|
|
51
51
|
export const bccParticipants = participants
|
|
52
52
|
.slice(4, 9)
|
|
53
53
|
.map((participant) => participant.emailAddress);
|
|
54
|
-
export const
|
|
54
|
+
export const EntityListMockData = [
|
|
55
55
|
{
|
|
56
56
|
name: 'Ticket number',
|
|
57
57
|
value: [
|
|
@@ -345,4 +345,51 @@ export const EmailMockData = {
|
|
|
345
345
|
}
|
|
346
346
|
]
|
|
347
347
|
};
|
|
348
|
+
export const viewAnalysisEmailHeaderMock = [
|
|
349
|
+
{
|
|
350
|
+
name: 'Sender email',
|
|
351
|
+
value: 'robert.stanton@hotmail.com'
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
name: 'Sender name',
|
|
355
|
+
value: 'Robert stanton'
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
name: 'Subject',
|
|
359
|
+
value: 'I have a quick question on travel'
|
|
360
|
+
}
|
|
361
|
+
];
|
|
362
|
+
export const topicListMock = [
|
|
363
|
+
{
|
|
364
|
+
id: '1',
|
|
365
|
+
primary: 'Missing ticket',
|
|
366
|
+
secondary: {
|
|
367
|
+
indicator: 'Confidence',
|
|
368
|
+
value: '50%'
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
id: '2',
|
|
373
|
+
primary: 'Missing baggage',
|
|
374
|
+
secondary: {
|
|
375
|
+
indicator: 'Confidence',
|
|
376
|
+
value: '80%'
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
id: '3',
|
|
381
|
+
primary: 'Ticket booking',
|
|
382
|
+
secondary: {
|
|
383
|
+
indicator: 'Confidence',
|
|
384
|
+
value: '30%'
|
|
385
|
+
}
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
id: '4',
|
|
389
|
+
primary: 'Language',
|
|
390
|
+
secondary: {
|
|
391
|
+
indicator: 'Confidence'
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
];
|
|
348
395
|
//# sourceMappingURL=Email.mocks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.mocks.js","sourceRoot":"","sources":["../../../src/social/Email/Email.mocks.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAC3B,6HAA6H,CAAC;AAEhI,MAAM,CAAC,MAAM,gBAAgB,GAAsC;IACjE;QACE,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,GAAG;KACd;IACD;QACE,IAAI,EAAE,UAAU;QAChB,SAAS,EAAE,iDAAiD;KAC7D;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GA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,OAAO,EAAE,2CAA2C;SACrD;QACD;YACE,EAAE,EAAE,WAAW;YACf,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,iCAAiC;SAC3C;QACD;YACE,EAAE,EAAE,cAAc;YAClB,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,cAAc;SACxB;KACF;CACF,CAAC","sourcesContent":["import { EmailComposerProps, EmailUser, ViewAnalysisProps } from '@pega/cosmos-react-social';\n\nexport const emailBodyContent =\n '<div>Hi, <br /> <br /><div>Can you please change my address in the SSN.</div> <br /> <br />Regards, <br />Sara Davis </div>';\n\nexport const emailAttachments: EmailComposerProps['attachments'] = [\n {\n name: 'Policy.doc',\n progress: 100\n },\n {\n name: 'E-Ticket',\n thumbnail: 'https://pbs.twimg.com/media/ENNN5PAXkAE-hag.jpg'\n }\n];\n\nexport const participants: EmailComposerProps['participants'] = [\n { emailAddress: 'Vernon.Lee@example.com', fullName: 'Vernon Lee', shortName: 'Vernon' },\n { emailAddress: 'Eula.Morales@example.com', fullName: 'Eula Morales', shortName: 'Eula' },\n { emailAddress: 'Paul.Smith@example.com', fullName: 'Paul Smith', shortName: 'Paul' },\n { emailAddress: 'Frank.Walker@example.com', fullName: 'Frank Walker', shortName: 'Frank' },\n { emailAddress: 'Edward.Green@example.com', fullName: 'Edward Green', shortName: 'Edward' },\n { emailAddress: 'John.Smith@example.com', fullName: 'John Smith', shortName: 'John' },\n { emailAddress: 'Olivia.Cockburn@example.com', fullName: 'Olivia Cockburn', shortName: 'Olivia' },\n { emailAddress: 'Peter.Hernandez@example.com', fullName: 'Peter Hernandez', shortName: 'Peter' },\n { emailAddress: 'Helena.Johnson@example.com', fullName: 'Helena Johnson', shortName: 'Helena' },\n {\n emailAddress: 'Katheryn.Hudson@example.com',\n fullName: 'Katheryn Hudson',\n shortName: 'Katheryn'\n },\n { emailAddress: 'Mia.Hershel@example.com', fullName: 'Mia Hershel', shortName: 'Mia' },\n { emailAddress: 'Ann.Mitchell@example.com', fullName: 'Ann Mitchell', shortName: 'Ann' },\n { emailAddress: 'Rafael.Bottom@example.com', fullName: 'Rafael Bottom', shortName: 'Rafael' },\n {\n emailAddress: 'Christopher.Gatsby@example.com',\n fullName: 'Christopher Gatsby',\n shortName: 'Christopher'\n },\n { emailAddress: 'Julianne.Moore@example.com', fullName: 'Julianne Moore', shortName: 'Julianne' },\n { emailAddress: 'Emily.Stone@example.com', fullName: 'Emily Stone', shortName: 'Emily' },\n { emailAddress: 'Richard.Wiles@example.com', fullName: 'Richard Wiles', shortName: 'Richard' },\n { emailAddress: 'Ella.Connor@example.com', fullName: 'Ella Connor', shortName: 'Ella' },\n { emailAddress: 'Robyn.Fenton@example.com', fullName: 'Robyn Fenton', shortName: 'Robyn' },\n { emailAddress: 'Lucille.Hale@example.com', fullName: 'Lucille Hale', shortName: 'Lucille' },\n { emailAddress: 'Angelina.Pitt@example.com', fullName: 'Angelina Pitt', shortName: 'Angelina' },\n { emailAddress: 'Tanya.Robinson@example.com', fullName: 'Tanya Robinson', shortName: 'Tanya' },\n { emailAddress: 'Laura.Horowitz@example.com', fullName: 'Laura Horowitz', shortName: 'Laura' }\n];\n\nexport const toParticipants = participants\n .slice(1, 3)\n .map((participant: EmailUser) => participant.emailAddress);\nexport const ccParticipants = participants\n .slice(9, 11)\n .map((participant: EmailUser) => participant.emailAddress);\nexport const bccParticipants = participants\n .slice(4, 9)\n .map((participant: EmailUser) => participant.emailAddress);\n\nexport const ViewAnalysisMockData: ViewAnalysisProps['content'] = [\n {\n name: 'Ticket number',\n value: [\n {\n id: '1',\n entity: {\n value: '7546383',\n type: 'system',\n name: 'Ticket number',\n variant: 3\n }\n },\n {\n id: '2',\n entity: {\n value: '7546383',\n type: 'system',\n name: 'Ticket number',\n variant: 3,\n icon: 'paper-clip'\n }\n }\n ]\n },\n {\n name: 'Name',\n value: [\n {\n id: '1',\n entity: {\n value: 'Robert stanton',\n type: 'system',\n name: 'Name',\n variant: 1\n }\n },\n {\n id: '2',\n entity: {\n value: 'Sara Davis',\n type: 'system',\n name: 'Name',\n variant: 1\n }\n },\n {\n id: '3',\n entity: {\n value: 'Cindy',\n type: 'system',\n name: 'Name',\n variant: 1\n }\n },\n {\n id: '4',\n entity: {\n value: 'Dean',\n type: 'system',\n name: 'Name',\n variant: 1\n }\n },\n {\n id: '5',\n entity: {\n value: 'Joe Stevens',\n type: 'system',\n name: 'Name',\n variant: 1\n }\n }\n ]\n },\n {\n name: 'Email',\n value: [\n {\n id: '1',\n entity: {\n value: 'robert.stanton@example.com',\n type: 'system',\n name: 'Email',\n variant: 2\n }\n },\n {\n id: '2',\n entity: {\n value: 'robert.stanton@example.com',\n type: 'system',\n name: 'Email',\n variant: 2,\n icon: 'paper-clip'\n }\n },\n {\n id: '3',\n entity: {\n value: 'cindy.turner@example.com',\n type: 'system',\n name: 'Email',\n variant: 2\n }\n },\n {\n id: '4',\n entity: {\n value: 'dean.thomas@example.com',\n type: 'system',\n name: 'Email',\n variant: 2\n }\n },\n {\n id: '5',\n entity: {\n value: 'joe.stevens@example.com',\n type: 'system',\n name: 'Email',\n variant: 2\n }\n }\n ]\n },\n {\n name: 'Date',\n value: [\n {\n id: '1',\n entity: {\n value: 'Dec 5,2021 9.05 AM',\n type: 'system',\n name: 'Date',\n variant: 4\n }\n }\n ]\n },\n {\n name: 'Flight Number',\n value: [\n {\n id: '1',\n entity: {\n value: 'FL-JK-403',\n type: 'system',\n name: 'Flight Number',\n variant: 5\n }\n }\n ]\n },\n {\n name: 'Address',\n value: [\n {\n id: '1',\n entity: {\n value: 'Nagercoil,Hyderabad',\n type: 'system',\n name: 'Address',\n variant: 15\n }\n }\n ]\n },\n {\n name: 'Location',\n value: [\n {\n id: '1',\n entity: {\n value: 'Hyderabad',\n type: 'system',\n name: 'Location',\n variant: 8\n }\n }\n ]\n }\n];\n\nexport const EmailMockData = {\n emails: {\n 'Sara Davis': {\n fullName: 'Sara Davis',\n shortName: 'Sara',\n emailAddress: 'saraConnor@example.com'\n },\n 'John Brown': {\n fullName: 'John Brown',\n shortName: 'John',\n emailAddress: 'john@example.com'\n },\n 'Hugh Phillips': {\n fullName: 'Hugh Phillips',\n shortName: 'Hugh',\n emailAddress: 'Hugh@example.com'\n },\n 'Laura Stevens': {\n fullName: 'Laura Stevens',\n shortName: 'Laura',\n emailAddress: 'laurastevens@example.com',\n avatarProps: {\n icon: 'headset'\n }\n },\n 'Joe Stevens': {\n fullName: 'Joe Stevens',\n shortName: 'Joe',\n emailAddress: 'Joe@example.com'\n },\n 'Adam Gillchrist': {\n fullName: 'Adam Gillchrist',\n shortName: 'Adam',\n emailAddress: 'adam@example.com'\n },\n 'John Paul': {\n fullName: 'John, Paul',\n shortName: 'Paul',\n emailAddress: 'John.Paul@example.com'\n },\n 'Oran Jacob': {\n fullName: 'Oran, Jacob',\n shortName: 'Jacob',\n emailAddress: 'jacob@example.com'\n },\n 'Tyson Mike': {\n fullName: 'Tyson, Mike',\n shortName: 'Mike',\n emailAddress: 'mike@example.com'\n },\n 'John Cent': {\n fullName: 'John, Cent',\n shortName: 'John',\n emailAddress: 'John.cena@example.com'\n },\n 'Mystery Rey': {\n fullName: 'Mystery, Rey',\n shortName: 'Rey',\n emailAddress: 'rey619@example.com'\n },\n 'Anton, Randy': {\n fullName: 'Anton, Randy',\n shortName: 'Randy',\n emailAddress: 'Randy.ortan@example.com'\n }\n },\n suggestedReplies: [\n {\n id: 'thank-you',\n title: 'Thank you',\n content: 'Thank you'\n },\n {\n id: 'clarification',\n title: 'Clarification',\n content: 'Can you please provide more clarification'\n },\n {\n id: 'apologies',\n title: 'Apologies',\n content: 'Apologies for the inconvenience'\n },\n {\n id: 'we_will_help',\n title: 'We will help',\n content: 'We will help'\n }\n ],\n emailBodyTemplates: [\n {\n id: 'thank-you',\n title: 'Thank you',\n content: 'Thank you'\n },\n {\n id: 'clarification',\n title: 'Clarification',\n content: 'Can you please provide more clarification'\n },\n {\n id: 'apologies',\n title: 'Apologies',\n content: 'Apologies for the inconvenience'\n },\n {\n id: 'we_will_help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AK,EAAE,KAAK;SACb;KACF;IACD;QACE,EAAE,EAAE,GAAG;QACP,OAAO,EAAE,UAAU;QACnB,SAAS,EAAE;YACT,SAAS,EAAE,YAAY;SACxB;KACF;CACF,CAAC","sourcesContent":["import { FieldValueListProps } from '@pega/cosmos-react-core';\nimport { EmailComposerProps, EmailUser, EntityListProps } from '@pega/cosmos-react-social';\n\nexport const emailBodyContent =\n '<div>Hi, <br /> <br /><div>Can you please change my address in the SSN.</div> <br /> <br />Regards, <br />Sara Davis </div>';\n\nexport const emailAttachments: EmailComposerProps['attachments'] = [\n {\n name: 'Policy.doc',\n progress: 100\n },\n {\n name: 'E-Ticket',\n thumbnail: 'https://pbs.twimg.com/media/ENNN5PAXkAE-hag.jpg'\n }\n];\n\nexport const participants: EmailComposerProps['participants'] = [\n { emailAddress: 'Vernon.Lee@example.com', fullName: 'Vernon Lee', shortName: 'Vernon' },\n { emailAddress: 'Eula.Morales@example.com', fullName: 'Eula Morales', shortName: 'Eula' },\n { emailAddress: 'Paul.Smith@example.com', fullName: 'Paul Smith', shortName: 'Paul' },\n { emailAddress: 'Frank.Walker@example.com', fullName: 'Frank Walker', shortName: 'Frank' },\n { emailAddress: 'Edward.Green@example.com', fullName: 'Edward Green', shortName: 'Edward' },\n { emailAddress: 'John.Smith@example.com', fullName: 'John Smith', shortName: 'John' },\n { emailAddress: 'Olivia.Cockburn@example.com', fullName: 'Olivia Cockburn', shortName: 'Olivia' },\n { emailAddress: 'Peter.Hernandez@example.com', fullName: 'Peter Hernandez', shortName: 'Peter' },\n { emailAddress: 'Helena.Johnson@example.com', fullName: 'Helena Johnson', shortName: 'Helena' },\n {\n emailAddress: 'Katheryn.Hudson@example.com',\n fullName: 'Katheryn Hudson',\n shortName: 'Katheryn'\n },\n { emailAddress: 'Mia.Hershel@example.com', fullName: 'Mia Hershel', shortName: 'Mia' },\n { emailAddress: 'Ann.Mitchell@example.com', fullName: 'Ann Mitchell', shortName: 'Ann' },\n { emailAddress: 'Rafael.Bottom@example.com', fullName: 'Rafael Bottom', shortName: 'Rafael' },\n {\n emailAddress: 'Christopher.Gatsby@example.com',\n fullName: 'Christopher Gatsby',\n shortName: 'Christopher'\n },\n { emailAddress: 'Julianne.Moore@example.com', fullName: 'Julianne Moore', shortName: 'Julianne' },\n { emailAddress: 'Emily.Stone@example.com', fullName: 'Emily Stone', shortName: 'Emily' },\n { emailAddress: 'Richard.Wiles@example.com', fullName: 'Richard Wiles', shortName: 'Richard' },\n { emailAddress: 'Ella.Connor@example.com', fullName: 'Ella Connor', shortName: 'Ella' },\n { emailAddress: 'Robyn.Fenton@example.com', fullName: 'Robyn Fenton', shortName: 'Robyn' },\n { emailAddress: 'Lucille.Hale@example.com', fullName: 'Lucille Hale', shortName: 'Lucille' },\n { emailAddress: 'Angelina.Pitt@example.com', fullName: 'Angelina Pitt', shortName: 'Angelina' },\n { emailAddress: 'Tanya.Robinson@example.com', fullName: 'Tanya Robinson', shortName: 'Tanya' },\n { emailAddress: 'Laura.Horowitz@example.com', fullName: 'Laura Horowitz', shortName: 'Laura' }\n];\n\nexport const toParticipants = participants\n .slice(1, 3)\n .map((participant: EmailUser) => participant.emailAddress);\nexport const ccParticipants = participants\n .slice(9, 11)\n .map((participant: EmailUser) => participant.emailAddress);\nexport const bccParticipants = participants\n .slice(4, 9)\n .map((participant: EmailUser) => participant.emailAddress);\n\nexport const EntityListMockData: EntityListProps['content'] = [\n {\n name: 'Ticket number',\n value: [\n {\n id: '1',\n entity: {\n value: '7546383',\n type: 'system',\n name: 'Ticket number',\n variant: 3\n }\n },\n {\n id: '2',\n entity: {\n value: '7546383',\n type: 'system',\n name: 'Ticket number',\n variant: 3,\n icon: 'paper-clip'\n }\n }\n ]\n },\n {\n name: 'Name',\n value: [\n {\n id: '1',\n entity: {\n value: 'Robert stanton',\n type: 'system',\n name: 'Name',\n variant: 1\n }\n },\n {\n id: '2',\n entity: {\n value: 'Sara Davis',\n type: 'system',\n name: 'Name',\n variant: 1\n }\n },\n {\n id: '3',\n entity: {\n value: 'Cindy',\n type: 'system',\n name: 'Name',\n variant: 1\n }\n },\n {\n id: '4',\n entity: {\n value: 'Dean',\n type: 'system',\n name: 'Name',\n variant: 1\n }\n },\n {\n id: '5',\n entity: {\n value: 'Joe Stevens',\n type: 'system',\n name: 'Name',\n variant: 1\n }\n }\n ]\n },\n {\n name: 'Email',\n value: [\n {\n id: '1',\n entity: {\n value: 'robert.stanton@example.com',\n type: 'system',\n name: 'Email',\n variant: 2\n }\n },\n {\n id: '2',\n entity: {\n value: 'robert.stanton@example.com',\n type: 'system',\n name: 'Email',\n variant: 2,\n icon: 'paper-clip'\n }\n },\n {\n id: '3',\n entity: {\n value: 'cindy.turner@example.com',\n type: 'system',\n name: 'Email',\n variant: 2\n }\n },\n {\n id: '4',\n entity: {\n value: 'dean.thomas@example.com',\n type: 'system',\n name: 'Email',\n variant: 2\n }\n },\n {\n id: '5',\n entity: {\n value: 'joe.stevens@example.com',\n type: 'system',\n name: 'Email',\n variant: 2\n }\n }\n ]\n },\n {\n name: 'Date',\n value: [\n {\n id: '1',\n entity: {\n value: 'Dec 5,2021 9.05 AM',\n type: 'system',\n name: 'Date',\n variant: 4\n }\n }\n ]\n },\n {\n name: 'Flight Number',\n value: [\n {\n id: '1',\n entity: {\n value: 'FL-JK-403',\n type: 'system',\n name: 'Flight Number',\n variant: 5\n }\n }\n ]\n },\n {\n name: 'Address',\n value: [\n {\n id: '1',\n entity: {\n value: 'Nagercoil,Hyderabad',\n type: 'system',\n name: 'Address',\n variant: 15\n }\n }\n ]\n },\n {\n name: 'Location',\n value: [\n {\n id: '1',\n entity: {\n value: 'Hyderabad',\n type: 'system',\n name: 'Location',\n variant: 8\n }\n }\n ]\n }\n];\n\nexport const EmailMockData = {\n emails: {\n 'Sara Davis': {\n fullName: 'Sara Davis',\n shortName: 'Sara',\n emailAddress: 'saraConnor@example.com'\n },\n 'John Brown': {\n fullName: 'John Brown',\n shortName: 'John',\n emailAddress: 'john@example.com'\n },\n 'Hugh Phillips': {\n fullName: 'Hugh Phillips',\n shortName: 'Hugh',\n emailAddress: 'Hugh@example.com'\n },\n 'Laura Stevens': {\n fullName: 'Laura Stevens',\n shortName: 'Laura',\n emailAddress: 'laurastevens@example.com',\n avatarProps: {\n icon: 'headset'\n }\n },\n 'Joe Stevens': {\n fullName: 'Joe Stevens',\n shortName: 'Joe',\n emailAddress: 'Joe@example.com'\n },\n 'Adam Gillchrist': {\n fullName: 'Adam Gillchrist',\n shortName: 'Adam',\n emailAddress: 'adam@example.com'\n },\n 'John Paul': {\n fullName: 'John, Paul',\n shortName: 'Paul',\n emailAddress: 'John.Paul@example.com'\n },\n 'Oran Jacob': {\n fullName: 'Oran, Jacob',\n shortName: 'Jacob',\n emailAddress: 'jacob@example.com'\n },\n 'Tyson Mike': {\n fullName: 'Tyson, Mike',\n shortName: 'Mike',\n emailAddress: 'mike@example.com'\n },\n 'John Cent': {\n fullName: 'John, Cent',\n shortName: 'John',\n emailAddress: 'John.cena@example.com'\n },\n 'Mystery Rey': {\n fullName: 'Mystery, Rey',\n shortName: 'Rey',\n emailAddress: 'rey619@example.com'\n },\n 'Anton, Randy': {\n fullName: 'Anton, Randy',\n shortName: 'Randy',\n emailAddress: 'Randy.ortan@example.com'\n }\n },\n suggestedReplies: [\n {\n id: 'thank-you',\n title: 'Thank you',\n content: 'Thank you'\n },\n {\n id: 'clarification',\n title: 'Clarification',\n content: 'Can you please provide more clarification'\n },\n {\n id: 'apologies',\n title: 'Apologies',\n content: 'Apologies for the inconvenience'\n },\n {\n id: 'we_will_help',\n title: 'We will help',\n content: 'We will help'\n }\n ],\n emailBodyTemplates: [\n {\n id: 'thank-you',\n title: 'Thank you',\n content: 'Thank you'\n },\n {\n id: 'clarification',\n title: 'Clarification',\n content: 'Can you please provide more clarification'\n },\n {\n id: 'apologies',\n title: 'Apologies',\n content: 'Apologies for the inconvenience'\n },\n {\n id: 'we_will_help',\n title: 'We will help',\n content: 'We will help'\n }\n ]\n};\n\nexport const viewAnalysisEmailHeaderMock: FieldValueListProps['fields'] = [\n {\n name: 'Sender email',\n value: 'robert.stanton@hotmail.com'\n },\n {\n name: 'Sender name',\n value: 'Robert stanton'\n },\n {\n name: 'Subject',\n value: 'I have a quick question on travel'\n }\n];\n\nexport const topicListMock = [\n {\n id: '1',\n primary: 'Missing ticket',\n secondary: {\n indicator: 'Confidence',\n value: '50%'\n }\n },\n {\n id: '2',\n primary: 'Missing baggage',\n secondary: {\n indicator: 'Confidence',\n value: '80%'\n }\n },\n {\n id: '3',\n primary: 'Ticket booking',\n secondary: {\n indicator: 'Confidence',\n value: '30%'\n }\n },\n {\n id: '4',\n primary: 'Language',\n secondary: {\n indicator: 'Confidence'\n }\n }\n];\n"]}
|
|
@@ -6,7 +6,7 @@ declare const _default: {
|
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
8
|
export declare const email: () => JSX.Element;
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const ViewAnalysis: () => JSX.Element;
|
|
10
10
|
export declare const emailEntities: () => JSX.Element;
|
|
11
11
|
export declare const emailConversation: () => JSX.Element;
|
|
12
12
|
export declare const EmailComposerDemo: () => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.stories.d.ts","sourceRoot":"","sources":["../../../src/social/Email/Email.stories.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Email.stories.d.ts","sourceRoot":"","sources":["../../../src/social/Email/Email.stories.tsx"],"names":[],"mappings":";AAgCA,OAAO,EASL,UAAU,EAIX,MAAM,2BAA2B,CAAC;;;;;AAiBnC,wBAGE;AAwOF,eAAO,MAAM,KAAK,mBA4CjB,CAAC;AAMF,eAAO,MAAM,YAAY,mBAqCxB,CAAC;AAYF,eAAO,MAAM,aAAa,mBAyFzB,CAAC;AAaF,eAAO,MAAM,iBAAiB,mBA2C7B,CAAC;AAaF,eAAO,MAAM,iBAAiB,mBAmF7B,CAAC;AAYF,eAAO,MAAM,SAAS;;;;;;;CA0NrB,CAAC;AAqBF,eAAO,MAAM,oBAAoB,mBA8BhC,CAAC;AAgPF,eAAO,MAAM,oBAAoB;;;;;CAyDhC,CAAC"}
|
|
@@ -2,10 +2,10 @@ import { useState, useRef, useContext, createRef } from 'react';
|
|
|
2
2
|
import { action } from '@storybook/addon-actions';
|
|
3
3
|
import { array, boolean } from '@storybook/addon-knobs';
|
|
4
4
|
import styled, { css } from 'styled-components';
|
|
5
|
-
import { Card, CardContent, createUID, MenuButton, Icon, registerIcon, hasProp, Flex, Button, ModalManagerContext, Modal, menuHelpers, defaultThemeProp } from '@pega/cosmos-react-core';
|
|
5
|
+
import { Card, CardContent, createUID, MenuButton, Icon, registerIcon, hasProp, Flex, Button, ModalManagerContext, Modal, menuHelpers, defaultThemeProp, CardHeader, Text, SummaryList, Grid, FieldValueList, StyledLabel } from '@pega/cosmos-react-core';
|
|
6
6
|
import * as filterIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/filter.icon';
|
|
7
|
-
import { Email, EmailConversation, EmailComposer, EmailShell, EmailSummaryItem, EmailSummaryList,
|
|
8
|
-
import { bccParticipants, ccParticipants, emailBodyContent, participants, toParticipants, emailAttachments,
|
|
7
|
+
import { Email, EmailConversation, EmailComposer, EmailShell, EmailSummaryItem, EmailSummaryList, EntityList } from '@pega/cosmos-react-social';
|
|
8
|
+
import { bccParticipants, ccParticipants, emailBodyContent, participants, toParticipants, emailAttachments, EntityListMockData, EmailMockData, viewAnalysisEmailHeaderMock, topicListMock } from './Email.mocks';
|
|
9
9
|
registerIcon(filterIcon);
|
|
10
10
|
export default {
|
|
11
11
|
title: 'Social/Email',
|
|
@@ -17,6 +17,12 @@ const handleExternalEntry = (filterValue) => {
|
|
|
17
17
|
const matched = filterValue.match(pattern);
|
|
18
18
|
return !!matched?.input;
|
|
19
19
|
};
|
|
20
|
+
const templates = mockEmailBodyTemplates.map(({ id, title }) => {
|
|
21
|
+
return {
|
|
22
|
+
id,
|
|
23
|
+
title
|
|
24
|
+
};
|
|
25
|
+
});
|
|
20
26
|
const baseComposerProps = {
|
|
21
27
|
participants,
|
|
22
28
|
externalValidator: handleExternalEntry,
|
|
@@ -31,7 +37,7 @@ const baseComposerProps = {
|
|
|
31
37
|
onCancel: () => {
|
|
32
38
|
action('cancelled email composing');
|
|
33
39
|
},
|
|
34
|
-
templates
|
|
40
|
+
templates
|
|
35
41
|
};
|
|
36
42
|
var LaunchAction;
|
|
37
43
|
(function (LaunchAction) {
|
|
@@ -82,34 +88,37 @@ const emailActions = (<MenuButton text='Email actions' variant='simple' icon='mo
|
|
|
82
88
|
}
|
|
83
89
|
]
|
|
84
90
|
}}/>);
|
|
85
|
-
const emailDemoActions = (create, subject) => {
|
|
91
|
+
const emailDemoActions = (create, subject, onTemplateChange) => {
|
|
86
92
|
const id = createUID();
|
|
87
93
|
return (<MenuButton text='Email actions' variant='simple' icon='more' iconOnly menu={{
|
|
88
94
|
items: [
|
|
89
95
|
{
|
|
90
|
-
id,
|
|
96
|
+
id: createUID(),
|
|
91
97
|
primary: 'Reply',
|
|
92
98
|
onClick: () => launchEmailComposer(id, LaunchAction.REPLY, {
|
|
93
99
|
...baseComposerProps,
|
|
100
|
+
onTemplateChange,
|
|
94
101
|
responseType: 'reply',
|
|
95
102
|
subject: `Re-${subject}` || ''
|
|
96
103
|
}, create)
|
|
97
104
|
},
|
|
98
105
|
{
|
|
99
|
-
id,
|
|
106
|
+
id: createUID(),
|
|
100
107
|
primary: 'Reply all',
|
|
101
108
|
onClick: () => launchEmailComposer(id, LaunchAction.REPLYALL, {
|
|
102
109
|
...baseComposerProps,
|
|
110
|
+
onTemplateChange,
|
|
103
111
|
responseType: 'replyAll',
|
|
104
112
|
cc: [],
|
|
105
113
|
subject: `Re-${subject}` || ''
|
|
106
114
|
}, create)
|
|
107
115
|
},
|
|
108
116
|
{
|
|
109
|
-
id,
|
|
117
|
+
id: createUID(),
|
|
110
118
|
primary: 'Forward',
|
|
111
119
|
onClick: () => launchEmailComposer(id, LaunchAction.FORWARD, {
|
|
112
120
|
...baseComposerProps,
|
|
121
|
+
onTemplateChange,
|
|
113
122
|
responseType: 'forward',
|
|
114
123
|
subject: `Fw-${subject}` || ''
|
|
115
124
|
}, create)
|
|
@@ -172,14 +181,37 @@ export const email = () => {
|
|
|
172
181
|
const StyledViewAnalysis = styled.div `
|
|
173
182
|
width: 18rem;
|
|
174
183
|
`;
|
|
175
|
-
export const
|
|
176
|
-
const content = ViewAnalysisMockData;
|
|
184
|
+
export const ViewAnalysis = () => {
|
|
177
185
|
const headerProps = {
|
|
178
186
|
icon: 'list-number',
|
|
179
187
|
text: 'Entities'
|
|
180
188
|
};
|
|
189
|
+
const itemsToRender = topicListMock.map(items => {
|
|
190
|
+
return {
|
|
191
|
+
...items,
|
|
192
|
+
primary: <StyledLabel>{items.primary}</StyledLabel>,
|
|
193
|
+
secondary: (<Flex container={{ direction: 'row', justify: 'between' }}>
|
|
194
|
+
<Text variant='primary'>{items.secondary.indicator}</Text>
|
|
195
|
+
<StyledLabel>{items.secondary.value}</StyledLabel>
|
|
196
|
+
</Flex>)
|
|
197
|
+
};
|
|
198
|
+
});
|
|
181
199
|
return (<StyledViewAnalysis>
|
|
182
|
-
<
|
|
200
|
+
<Grid container={{ rowGap: 2 }}>
|
|
201
|
+
<EntityList header={headerProps} content={EntityListMockData}/>
|
|
202
|
+
|
|
203
|
+
<Card>
|
|
204
|
+
<CardHeader container={{ alignItems: 'center', gap: 1 }}>
|
|
205
|
+
<Icon name='document-doc'/>
|
|
206
|
+
<Text variant='h3'>Email header</Text>
|
|
207
|
+
</CardHeader>
|
|
208
|
+
<CardContent>
|
|
209
|
+
<FieldValueList fields={viewAnalysisEmailHeaderMock} variant='stacked'/>
|
|
210
|
+
</CardContent>
|
|
211
|
+
</Card>
|
|
212
|
+
|
|
213
|
+
<SummaryList name='Topics' icon='headline' items={itemsToRender} noItemsText='No items'/>
|
|
214
|
+
</Grid>
|
|
183
215
|
</StyledViewAnalysis>);
|
|
184
216
|
};
|
|
185
217
|
export const emailEntities = () => {
|
|
@@ -287,13 +319,17 @@ export const emailConversation = () => {
|
|
|
287
319
|
export const EmailComposerDemo = () => {
|
|
288
320
|
const fileUploadInputRef = useRef(null);
|
|
289
321
|
const [attachments, setAttachments] = useState(emailAttachments);
|
|
322
|
+
const onTemplateChange = id => {
|
|
323
|
+
const selectedTemplate = mockEmailBodyTemplates.find(template => template.id === id);
|
|
324
|
+
return selectedTemplate?.content;
|
|
325
|
+
};
|
|
290
326
|
return (<Card style={{ width: '30rem' }}>
|
|
291
327
|
<CardContent>
|
|
292
328
|
<EmailComposer onSend={action('On Send')} onCancel={action('On cancel')} externalValidator={handleExternalEntry} participants={participants} to={{
|
|
293
329
|
reply: [participants[7].emailAddress],
|
|
294
330
|
replyAll: toParticipants,
|
|
295
331
|
forward: []
|
|
296
|
-
}} cc={ccParticipants} bcc={bccParticipants} responseType='reply' subject='Request: Pause service' templates={
|
|
332
|
+
}} cc={ccParticipants} bcc={bccParticipants} responseType='reply' subject='Request: Pause service' templates={templates} onTemplateChange={onTemplateChange} bodyContent='Hi, Hope you are doing well' onImageAdded={action('On Image added')} attachments={attachments.map(attachment => {
|
|
297
333
|
return {
|
|
298
334
|
...attachment,
|
|
299
335
|
onDelete: name => {
|
|
@@ -330,6 +366,10 @@ export const EmailComposerDemo = () => {
|
|
|
330
366
|
</Card>);
|
|
331
367
|
};
|
|
332
368
|
export const EmailDemo = ({ hideSuggestions }) => {
|
|
369
|
+
const onTemplateChange = id => {
|
|
370
|
+
const selectedTemplate = mockEmailBodyTemplates.find(template => template.id === id);
|
|
371
|
+
return selectedTemplate?.content;
|
|
372
|
+
};
|
|
333
373
|
const actions = array('Actions', ['Transfer', 'End conversation']).map(name => ({
|
|
334
374
|
primary: name,
|
|
335
375
|
id: name,
|
|
@@ -375,12 +415,13 @@ export const EmailDemo = ({ hideSuggestions }) => {
|
|
|
375
415
|
subject: 'Pause service'
|
|
376
416
|
}
|
|
377
417
|
].map(emailData => {
|
|
378
|
-
const emailActionItems = emailDemoActions(create, emailData.subject);
|
|
418
|
+
const emailActionItems = emailDemoActions(create, emailData.subject, onTemplateChange);
|
|
379
419
|
return {
|
|
380
420
|
...emailData,
|
|
381
421
|
onReply: id => {
|
|
382
422
|
launchEmailComposer(id, LaunchAction.REPLY, {
|
|
383
423
|
...baseComposerProps,
|
|
424
|
+
onTemplateChange,
|
|
384
425
|
externalValidator: handleExternalEntry,
|
|
385
426
|
responseType: 'reply',
|
|
386
427
|
subject: `Re-${emailData.subject}` || ''
|
|
@@ -389,6 +430,7 @@ export const EmailDemo = ({ hideSuggestions }) => {
|
|
|
389
430
|
onForward: id => {
|
|
390
431
|
launchEmailComposer(id, LaunchAction.FORWARD, {
|
|
391
432
|
...baseComposerProps,
|
|
433
|
+
onTemplateChange,
|
|
392
434
|
externalValidator: handleExternalEntry,
|
|
393
435
|
responseType: 'forward',
|
|
394
436
|
subject: `Fw-${emailData.subject}` || ''
|
|
@@ -400,9 +442,10 @@ export const EmailDemo = ({ hideSuggestions }) => {
|
|
|
400
442
|
...baseComposerProps,
|
|
401
443
|
externalValidator: handleExternalEntry,
|
|
402
444
|
responseType: 'reply',
|
|
445
|
+
onTemplateChange,
|
|
403
446
|
subject: suggestion?.title || '',
|
|
404
447
|
bodyContent: suggestion ? suggestion.content : '',
|
|
405
|
-
|
|
448
|
+
defaultTemplateId: suggestion?.id
|
|
406
449
|
}, create);
|
|
407
450
|
},
|
|
408
451
|
actions: emailActionItems,
|