@pega/cosmos-react-demos 3.0.0-dev.4.1 → 3.0.0-dev.4.2
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/AppShell/AppShell.mocks.d.ts +17 -0
- package/jsx/build/AppShell/AppShell.mocks.d.ts.map +1 -1
- package/jsx/build/AppShell/AppShell.mocks.js +15 -0
- package/jsx/build/AppShell/AppShell.mocks.js.map +1 -1
- package/jsx/build/AppShell/AppShell.stories.d.ts +2 -0
- package/jsx/build/AppShell/AppShell.stories.d.ts.map +1 -1
- package/jsx/build/AppShell/AppShell.stories.jsx +2 -17
- package/jsx/build/AppShell/AppShell.stories.jsx.map +1 -1
- package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
- package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx +2 -1
- package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx.map +1 -1
- package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts +19 -2
- package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
- package/jsx/build/FlowModeller/{FlowModeller.mocks.js → FlowModeller.mocks.jsx} +71 -7
- package/jsx/build/FlowModeller/FlowModeller.mocks.jsx.map +1 -0
- package/jsx/build/FlowModeller/FlowModeller.stories.d.ts +2 -7
- package/jsx/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
- package/jsx/build/FlowModeller/FlowModeller.stories.jsx +14 -100
- package/jsx/build/FlowModeller/FlowModeller.stories.jsx.map +1 -1
- package/jsx/build/FlowModeller/FlowModeller.styles.d.ts +2 -0
- package/jsx/build/FlowModeller/FlowModeller.styles.d.ts.map +1 -0
- package/jsx/build/FlowModeller/FlowModeller.styles.js +8 -0
- package/jsx/build/FlowModeller/FlowModeller.styles.js.map +1 -0
- package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts +2 -5
- package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -1
- package/jsx/build/ItemLibrary/LibraryPicker.stories.jsx.map +1 -1
- package/jsx/build/LifeCycle/LifeCycle.stories.d.ts +2 -4
- package/jsx/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
- package/jsx/build/LifeCycle/LifeCycle.stories.jsx.map +1 -1
- package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts +24 -0
- package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
- package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx +315 -0
- package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx.map +1 -0
- package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts +2 -7
- package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -1
- package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx +5 -180
- package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx.map +1 -1
- package/jsx/build/PageTemplates/GalleryPage.mocks.d.ts +45 -0
- package/jsx/build/PageTemplates/GalleryPage.mocks.d.ts.map +1 -0
- package/jsx/build/PageTemplates/GalleryPage.mocks.jsx +78 -0
- package/jsx/build/PageTemplates/GalleryPage.mocks.jsx.map +1 -0
- package/jsx/build/PageTemplates/GalleryPage.stories.d.ts +1 -0
- package/jsx/build/PageTemplates/GalleryPage.stories.d.ts.map +1 -1
- package/jsx/build/PageTemplates/GalleryPage.stories.jsx +3 -79
- package/jsx/build/PageTemplates/GalleryPage.stories.jsx.map +1 -1
- package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts +11 -0
- package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -0
- package/jsx/build/PageTemplates/PageTemplates.mocks.jsx +129 -0
- package/jsx/build/PageTemplates/PageTemplates.mocks.jsx.map +1 -0
- package/jsx/build/PageTemplates/PageTemplates.stories.d.ts +1 -0
- package/jsx/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
- package/jsx/build/PageTemplates/PageTemplates.stories.jsx +4 -129
- package/jsx/build/PageTemplates/PageTemplates.stories.jsx.map +1 -1
- package/jsx/build/Workbench/Workbench.stories.d.ts.map +1 -1
- package/jsx/build/Workbench/Workbench.stories.jsx +1 -9
- package/jsx/build/Workbench/Workbench.stories.jsx.map +1 -1
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts +3 -0
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts.map +1 -0
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js +13 -0
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js.map +1 -0
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts +16 -8
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts.map +1 -1
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.jsx +59 -56
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.jsx.map +1 -1
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts +5 -0
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts.map +1 -0
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.js +15 -0
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.js.map +1 -0
- package/jsx/core/Button/Button.stories.jsx +6 -6
- package/jsx/core/Button/Button.stories.jsx.map +1 -1
- package/jsx/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
- package/jsx/core/ColorPicker/ColorPicker.stories.jsx +2 -10
- package/jsx/core/ColorPicker/ColorPicker.stories.jsx.map +1 -1
- package/jsx/core/ColorPicker/ColorPicker.styles.d.ts +4 -0
- package/jsx/core/ColorPicker/ColorPicker.styles.d.ts.map +1 -0
- package/jsx/core/ColorPicker/ColorPicker.styles.js +11 -0
- package/jsx/core/ColorPicker/ColorPicker.styles.js.map +1 -0
- package/jsx/core/Configuration/Configuration.mocks.d.ts +7 -0
- package/jsx/core/Configuration/Configuration.mocks.d.ts.map +1 -0
- package/jsx/core/Configuration/Configuration.mocks.jsx +9 -0
- package/jsx/core/Configuration/Configuration.mocks.jsx.map +1 -0
- package/jsx/core/Configuration/Configuration.stories.d.ts.map +1 -1
- package/jsx/core/Configuration/Configuration.stories.jsx +2 -18
- package/jsx/core/Configuration/Configuration.stories.jsx.map +1 -1
- package/jsx/core/Configuration/Configuration.styles.d.ts +6 -0
- package/jsx/core/Configuration/Configuration.styles.d.ts.map +1 -0
- package/jsx/core/Configuration/Configuration.styles.js +12 -0
- package/jsx/core/Configuration/Configuration.styles.js.map +1 -0
- package/jsx/core/DateTime/DateTime.stories.d.ts.map +1 -1
- package/jsx/core/DateTime/DateTime.stories.jsx +1 -0
- package/jsx/core/DateTime/DateTime.stories.jsx.map +1 -1
- package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts +4 -0
- package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
- package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx +69 -1
- package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx.map +1 -1
- package/jsx/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
- package/jsx/core/FieldGroup/FieldGroupList.stories.jsx +2 -70
- package/jsx/core/FieldGroup/FieldGroupList.stories.jsx.map +1 -1
- package/jsx/core/HTML/HTML.stories.d.ts.map +1 -1
- package/jsx/core/HTML/HTML.stories.jsx +1 -1
- package/jsx/core/HTML/HTML.stories.jsx.map +1 -1
- package/jsx/core/Icon/Icon.stories.d.ts.map +1 -1
- package/jsx/core/Icon/Icon.stories.jsx +5 -27
- package/jsx/core/Icon/Icon.stories.jsx.map +1 -1
- package/jsx/core/Icon/Icon.styles.d.ts +4 -0
- package/jsx/core/Icon/Icon.styles.d.ts.map +1 -0
- package/jsx/core/Icon/Icon.styles.js +25 -0
- package/jsx/core/Icon/Icon.styles.js.map +1 -0
- package/jsx/core/IconPicker/IconPicker.stories.jsx +1 -1
- package/jsx/core/IconPicker/IconPicker.stories.jsx.map +1 -1
- package/jsx/core/Link/Link.stories.d.ts +1 -11
- package/jsx/core/Link/Link.stories.d.ts.map +1 -1
- package/jsx/core/Link/Link.stories.jsx.map +1 -1
- package/jsx/core/Number/Number.stories.d.ts.map +1 -1
- package/jsx/core/Number/Number.stories.jsx +2 -0
- package/jsx/core/Number/Number.stories.jsx.map +1 -1
- package/jsx/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
- package/jsx/core/PageTemplates/PageTemplates.stories.jsx +1 -11
- package/jsx/core/PageTemplates/PageTemplates.stories.jsx.map +1 -1
- package/jsx/core/PageTemplates/PageTemplates.styles.d.ts +1 -0
- package/jsx/core/PageTemplates/PageTemplates.styles.d.ts.map +1 -1
- package/jsx/core/PageTemplates/PageTemplates.styles.js +9 -0
- package/jsx/core/PageTemplates/PageTemplates.styles.js.map +1 -1
- package/jsx/core/Tooltip/Tooltip.stories.d.ts +2 -5
- package/jsx/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/jsx/core/Tooltip/Tooltip.stories.jsx.map +1 -1
- package/jsx/core/Tree/Tree.stories.d.ts.map +1 -1
- package/jsx/core/Tree/Tree.stories.jsx +2 -2
- package/jsx/core/Tree/Tree.stories.jsx.map +1 -1
- package/jsx/cs/Article/Article.stories.d.ts +2 -10
- package/jsx/cs/Article/Article.stories.d.ts.map +1 -1
- package/jsx/cs/Article/Article.stories.jsx.map +1 -1
- package/jsx/cs/ArticleList/ArticleList.stories.d.ts +2 -11
- package/jsx/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
- package/jsx/cs/ArticleList/ArticleList.stories.jsx.map +1 -1
- package/jsx/cs/CSCaseView/CSAppShell.stories.d.ts +2 -36
- package/jsx/cs/CSCaseView/CSAppShell.stories.d.ts.map +1 -1
- package/jsx/cs/CSCaseView/CSAppShell.stories.jsx +6 -33
- package/jsx/cs/CSCaseView/CSAppShell.stories.jsx.map +1 -1
- package/jsx/cs/CSCaseView/CSCaseView.mocks.d.ts +9 -0
- package/jsx/cs/CSCaseView/CSCaseView.mocks.d.ts.map +1 -1
- package/jsx/cs/CSCaseView/{CSCaseView.mocks.js → CSCaseView.mocks.jsx} +30 -1
- package/jsx/cs/CSCaseView/CSCaseView.mocks.jsx.map +1 -0
- package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts +2 -2
- package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -1
- package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx +4 -4
- package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx.map +1 -1
- package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +2 -8
- package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
- package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx +3 -3
- package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx.map +1 -1
- package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts +7 -6
- package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -1
- package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx +13 -5
- package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx.map +1 -1
- package/jsx/cs/InteractionTimer/InteractionTimer.mocks.d.ts +11 -0
- package/jsx/cs/InteractionTimer/InteractionTimer.mocks.d.ts.map +1 -0
- package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js +29 -0
- package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js.map +1 -0
- package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts +2 -7
- package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +1 -1
- package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx +6 -30
- package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx.map +1 -1
- package/jsx/cs/TaskManager/TaskManager.mocks.d.ts +6 -0
- package/jsx/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
- package/jsx/cs/TaskManager/TaskManager.mocks.js +7 -0
- package/jsx/cs/TaskManager/TaskManager.mocks.js.map +1 -1
- package/jsx/cs/TaskManager/TaskManager.stories.d.ts +6 -5
- package/jsx/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
- package/jsx/cs/TaskManager/TaskManager.stories.jsx +25 -29
- package/jsx/cs/TaskManager/TaskManager.stories.jsx.map +1 -1
- package/jsx/cs/TaskManager/TaskManager.styles.d.ts +3 -0
- package/jsx/cs/TaskManager/TaskManager.styles.d.ts.map +1 -0
- package/jsx/cs/TaskManager/TaskManager.styles.js +8 -0
- package/jsx/cs/TaskManager/TaskManager.styles.js.map +1 -0
- package/jsx/dnd/DragDropList/DragDropList.mocks.d.ts +15 -0
- package/jsx/dnd/DragDropList/DragDropList.mocks.d.ts.map +1 -0
- package/jsx/dnd/DragDropList/DragDropList.mocks.jsx +33 -0
- package/jsx/dnd/DragDropList/DragDropList.mocks.jsx.map +1 -0
- package/jsx/dnd/DragDropList/DragDropList.stories.d.ts +8 -9
- package/jsx/dnd/DragDropList/DragDropList.stories.d.ts.map +1 -1
- package/jsx/dnd/DragDropList/DragDropList.stories.jsx +14 -78
- package/jsx/dnd/DragDropList/DragDropList.stories.jsx.map +1 -1
- package/jsx/dnd/DragDropList/DragDropList.styles.d.ts +6 -0
- package/jsx/dnd/DragDropList/DragDropList.styles.d.ts.map +1 -0
- package/jsx/dnd/DragDropList/DragDropList.styles.js +32 -0
- package/jsx/dnd/DragDropList/DragDropList.styles.js.map +1 -0
- package/jsx/rte/Editor/Editor.mocks.d.ts +6 -0
- package/jsx/rte/Editor/Editor.mocks.d.ts.map +1 -0
- package/jsx/rte/Editor/Editor.mocks.jsx +20 -0
- package/jsx/rte/Editor/Editor.mocks.jsx.map +1 -0
- package/jsx/rte/Editor/Editor.stories.d.ts.map +1 -1
- package/jsx/rte/Editor/Editor.stories.jsx +1 -19
- package/jsx/rte/Editor/Editor.stories.jsx.map +1 -1
- package/jsx/rte/RichTextEditor/RichTextEditor.stories.d.ts +2 -3
- package/jsx/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -1
- package/jsx/rte/RichTextEditor/RichTextEditor.stories.jsx.map +1 -1
- package/jsx/social/Chat/RepeatingView.mocks.d.ts +14 -0
- package/jsx/social/Chat/RepeatingView.mocks.d.ts.map +1 -0
- package/jsx/social/Chat/RepeatingView.mocks.js +11 -0
- package/jsx/social/Chat/RepeatingView.mocks.js.map +1 -0
- package/jsx/social/Chat/RepeatingView.stories.d.ts +6 -17
- package/jsx/social/Chat/RepeatingView.stories.d.ts.map +1 -1
- package/jsx/social/Chat/RepeatingView.stories.jsx +16 -46
- package/jsx/social/Chat/RepeatingView.stories.jsx.map +1 -1
- package/jsx/social/Chat/RepeatingView.styles.d.ts +2 -0
- package/jsx/social/Chat/RepeatingView.styles.d.ts.map +1 -0
- package/jsx/social/Chat/RepeatingView.styles.js +22 -0
- package/jsx/social/Chat/RepeatingView.styles.js.map +1 -0
- package/jsx/social/Email/Email.mocks.d.ts +155 -2
- package/jsx/social/Email/Email.mocks.d.ts.map +1 -1
- package/jsx/social/Email/Email.mocks.jsx +756 -0
- package/jsx/social/Email/Email.mocks.jsx.map +1 -0
- package/jsx/social/Email/Email.stories.d.ts +14 -14
- package/jsx/social/Email/Email.stories.d.ts.map +1 -1
- package/jsx/social/Email/Email.stories.jsx +97 -411
- package/jsx/social/Email/Email.stories.jsx.map +1 -1
- package/jsx/social/Email/Email.styles.d.ts +4 -0
- package/jsx/social/Email/Email.styles.d.ts.map +1 -0
- package/jsx/social/Email/Email.styles.js +14 -0
- package/jsx/social/Email/Email.styles.js.map +1 -0
- package/jsx/social/Feed/Feed.stories.d.ts.map +1 -1
- package/jsx/social/Feed/Feed.stories.jsx +23 -18
- package/jsx/social/Feed/Feed.stories.jsx.map +1 -1
- package/jsx/social/Feed/FeedPost.stories.d.ts.map +1 -1
- package/jsx/social/Feed/FeedPost.stories.jsx +30 -20
- package/jsx/social/Feed/FeedPost.stories.jsx.map +1 -1
- package/jsx/social/Feed/FeedReply.stories.d.ts.map +1 -1
- package/jsx/social/Feed/FeedReply.stories.jsx +21 -16
- package/jsx/social/Feed/FeedReply.stories.jsx.map +1 -1
- package/jsx/work/CaseView/MobileCaseView.stories.d.ts +2 -7
- package/jsx/work/CaseView/MobileCaseView.stories.d.ts.map +1 -1
- package/jsx/work/CaseView/MobileCaseView.stories.jsx.map +1 -1
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts +45 -0
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts.map +1 -0
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.jsx +166 -0
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.jsx.map +1 -0
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +2 -6
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx +2 -174
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx.map +1 -1
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts +4 -0
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts.map +1 -0
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.js +11 -0
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.js.map +1 -0
- package/lib/build/AppShell/AppShell.mocks.d.ts +17 -0
- package/lib/build/AppShell/AppShell.mocks.d.ts.map +1 -1
- package/lib/build/AppShell/AppShell.mocks.js +16 -0
- package/lib/build/AppShell/AppShell.mocks.js.map +1 -1
- package/lib/build/AppShell/AppShell.stories.d.ts +2 -0
- package/lib/build/AppShell/AppShell.stories.d.ts.map +1 -1
- package/lib/build/AppShell/AppShell.stories.js +3 -18
- package/lib/build/AppShell/AppShell.stories.js.map +1 -1
- package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
- package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js +2 -1
- package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js.map +1 -1
- package/lib/build/FlowModeller/FlowModeller.mocks.d.ts +19 -2
- package/lib/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
- package/lib/build/FlowModeller/FlowModeller.mocks.js +58 -6
- package/lib/build/FlowModeller/FlowModeller.mocks.js.map +1 -1
- package/lib/build/FlowModeller/FlowModeller.stories.d.ts +2 -7
- package/lib/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
- package/lib/build/FlowModeller/FlowModeller.stories.js +15 -90
- package/lib/build/FlowModeller/FlowModeller.stories.js.map +1 -1
- package/lib/build/FlowModeller/FlowModeller.styles.d.ts +2 -0
- package/lib/build/FlowModeller/FlowModeller.styles.d.ts.map +1 -0
- package/lib/build/FlowModeller/FlowModeller.styles.js +8 -0
- package/lib/build/FlowModeller/FlowModeller.styles.js.map +1 -0
- package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts +2 -5
- package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -1
- package/lib/build/ItemLibrary/LibraryPicker.stories.js.map +1 -1
- package/lib/build/LifeCycle/LifeCycle.stories.d.ts +2 -4
- package/lib/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
- package/lib/build/LifeCycle/LifeCycle.stories.js.map +1 -1
- package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts +24 -0
- package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
- package/lib/build/ObjectSelect/ObjectSelect.mocks.js +136 -0
- package/lib/build/ObjectSelect/ObjectSelect.mocks.js.map +1 -1
- package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts +2 -7
- package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -1
- package/lib/build/ObjectSelect/ObjectSelect.stories.js +12 -136
- package/lib/build/ObjectSelect/ObjectSelect.stories.js.map +1 -1
- package/lib/build/PageTemplates/GalleryPage.mocks.d.ts +45 -0
- package/lib/build/PageTemplates/GalleryPage.mocks.d.ts.map +1 -0
- package/lib/build/PageTemplates/GalleryPage.mocks.js +79 -0
- package/lib/build/PageTemplates/GalleryPage.mocks.js.map +1 -0
- package/lib/build/PageTemplates/GalleryPage.stories.d.ts +1 -0
- package/lib/build/PageTemplates/GalleryPage.stories.d.ts.map +1 -1
- package/lib/build/PageTemplates/GalleryPage.stories.js +3 -79
- package/lib/build/PageTemplates/GalleryPage.stories.js.map +1 -1
- package/lib/build/PageTemplates/PageTemplates.mocks.d.ts +11 -0
- package/lib/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -0
- package/lib/build/PageTemplates/PageTemplates.mocks.js +96 -0
- package/lib/build/PageTemplates/PageTemplates.mocks.js.map +1 -0
- package/lib/build/PageTemplates/PageTemplates.stories.d.ts +1 -0
- package/lib/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
- package/lib/build/PageTemplates/PageTemplates.stories.js +5 -95
- package/lib/build/PageTemplates/PageTemplates.stories.js.map +1 -1
- package/lib/build/Workbench/Workbench.stories.d.ts.map +1 -1
- package/lib/build/Workbench/Workbench.stories.js +1 -9
- package/lib/build/Workbench/Workbench.stories.js.map +1 -1
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts +3 -0
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts.map +1 -0
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js +13 -0
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js.map +1 -0
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts +16 -8
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts.map +1 -1
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.js +56 -54
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.js.map +1 -1
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts +5 -0
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts.map +1 -0
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.js +15 -0
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.js.map +1 -0
- package/lib/core/Button/Button.stories.js +2 -2
- package/lib/core/Button/Button.stories.js.map +1 -1
- package/lib/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
- package/lib/core/ColorPicker/ColorPicker.stories.js +2 -10
- package/lib/core/ColorPicker/ColorPicker.stories.js.map +1 -1
- package/lib/core/ColorPicker/ColorPicker.styles.d.ts +4 -0
- package/lib/core/ColorPicker/ColorPicker.styles.d.ts.map +1 -0
- package/lib/core/ColorPicker/ColorPicker.styles.js +11 -0
- package/lib/core/ColorPicker/ColorPicker.styles.js.map +1 -0
- package/lib/core/Configuration/Configuration.mocks.d.ts +7 -0
- package/lib/core/Configuration/Configuration.mocks.d.ts.map +1 -0
- package/lib/core/Configuration/Configuration.mocks.js +6 -0
- package/lib/core/Configuration/Configuration.mocks.js.map +1 -0
- package/lib/core/Configuration/Configuration.stories.d.ts.map +1 -1
- package/lib/core/Configuration/Configuration.stories.js +3 -15
- package/lib/core/Configuration/Configuration.stories.js.map +1 -1
- package/lib/core/Configuration/Configuration.styles.d.ts +6 -0
- package/lib/core/Configuration/Configuration.styles.d.ts.map +1 -0
- package/lib/core/Configuration/Configuration.styles.js +12 -0
- package/lib/core/Configuration/Configuration.styles.js.map +1 -0
- package/lib/core/DateTime/DateTime.stories.d.ts.map +1 -1
- package/lib/core/DateTime/DateTime.stories.js +2 -0
- package/lib/core/DateTime/DateTime.stories.js.map +1 -1
- package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts +4 -0
- package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
- package/lib/core/FieldGroup/FieldGroupList.mocks.js +46 -2
- package/lib/core/FieldGroup/FieldGroupList.mocks.js.map +1 -1
- package/lib/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
- package/lib/core/FieldGroup/FieldGroupList.stories.js +3 -47
- package/lib/core/FieldGroup/FieldGroupList.stories.js.map +1 -1
- package/lib/core/HTML/HTML.stories.d.ts.map +1 -1
- package/lib/core/HTML/HTML.stories.js +1 -1
- package/lib/core/HTML/HTML.stories.js.map +1 -1
- package/lib/core/Icon/Icon.stories.d.ts.map +1 -1
- package/lib/core/Icon/Icon.stories.js +6 -29
- package/lib/core/Icon/Icon.stories.js.map +1 -1
- package/lib/core/Icon/Icon.styles.d.ts +4 -0
- package/lib/core/Icon/Icon.styles.d.ts.map +1 -0
- package/lib/core/Icon/Icon.styles.js +25 -0
- package/lib/core/Icon/Icon.styles.js.map +1 -0
- package/lib/core/IconPicker/IconPicker.stories.js +1 -1
- package/lib/core/IconPicker/IconPicker.stories.js.map +1 -1
- package/lib/core/Link/Link.stories.d.ts +1 -11
- package/lib/core/Link/Link.stories.d.ts.map +1 -1
- package/lib/core/Link/Link.stories.js.map +1 -1
- package/lib/core/Number/Number.stories.d.ts.map +1 -1
- package/lib/core/Number/Number.stories.js +2 -0
- package/lib/core/Number/Number.stories.js.map +1 -1
- package/lib/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
- package/lib/core/PageTemplates/PageTemplates.stories.js +1 -11
- package/lib/core/PageTemplates/PageTemplates.stories.js.map +1 -1
- package/lib/core/PageTemplates/PageTemplates.styles.d.ts +1 -0
- package/lib/core/PageTemplates/PageTemplates.styles.d.ts.map +1 -1
- package/lib/core/PageTemplates/PageTemplates.styles.js +9 -0
- package/lib/core/PageTemplates/PageTemplates.styles.js.map +1 -1
- package/lib/core/Tooltip/Tooltip.stories.d.ts +2 -5
- package/lib/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/lib/core/Tooltip/Tooltip.stories.js.map +1 -1
- package/lib/core/Tree/Tree.stories.d.ts.map +1 -1
- package/lib/core/Tree/Tree.stories.js +2 -2
- package/lib/core/Tree/Tree.stories.js.map +1 -1
- package/lib/cs/Article/Article.stories.d.ts +2 -10
- package/lib/cs/Article/Article.stories.d.ts.map +1 -1
- package/lib/cs/Article/Article.stories.js.map +1 -1
- package/lib/cs/ArticleList/ArticleList.stories.d.ts +2 -11
- package/lib/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
- package/lib/cs/ArticleList/ArticleList.stories.js.map +1 -1
- package/lib/cs/CSCaseView/CSAppShell.stories.d.ts +2 -36
- package/lib/cs/CSCaseView/CSAppShell.stories.d.ts.map +1 -1
- package/lib/cs/CSCaseView/CSAppShell.stories.js +6 -19
- package/lib/cs/CSCaseView/CSAppShell.stories.js.map +1 -1
- package/lib/cs/CSCaseView/CSCaseView.mocks.d.ts +9 -0
- package/lib/cs/CSCaseView/CSCaseView.mocks.d.ts.map +1 -1
- package/lib/cs/CSCaseView/CSCaseView.mocks.js +16 -0
- package/lib/cs/CSCaseView/CSCaseView.mocks.js.map +1 -1
- package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts +2 -2
- package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -1
- package/lib/cs/CallControlPanel/CallControlPanel.stories.js +4 -4
- package/lib/cs/CallControlPanel/CallControlPanel.stories.js.map +1 -1
- package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +2 -8
- package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
- package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js +3 -3
- package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js.map +1 -1
- package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts +7 -6
- package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -1
- package/lib/cs/InteractionNotification/InteractionNotification.stories.js +13 -5
- package/lib/cs/InteractionNotification/InteractionNotification.stories.js.map +1 -1
- package/lib/cs/InteractionTimer/InteractionTimer.mocks.d.ts +11 -0
- package/lib/cs/InteractionTimer/InteractionTimer.mocks.d.ts.map +1 -0
- package/lib/cs/InteractionTimer/InteractionTimer.mocks.js +29 -0
- package/lib/cs/InteractionTimer/InteractionTimer.mocks.js.map +1 -0
- package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts +2 -7
- package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +1 -1
- package/lib/cs/InteractionTimer/InteractionTimer.stories.js +6 -30
- package/lib/cs/InteractionTimer/InteractionTimer.stories.js.map +1 -1
- package/lib/cs/TaskManager/TaskManager.mocks.d.ts +6 -0
- package/lib/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
- package/lib/cs/TaskManager/TaskManager.mocks.js +7 -0
- package/lib/cs/TaskManager/TaskManager.mocks.js.map +1 -1
- package/lib/cs/TaskManager/TaskManager.stories.d.ts +6 -5
- package/lib/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
- package/lib/cs/TaskManager/TaskManager.stories.js +25 -29
- package/lib/cs/TaskManager/TaskManager.stories.js.map +1 -1
- package/lib/cs/TaskManager/TaskManager.styles.d.ts +3 -0
- package/lib/cs/TaskManager/TaskManager.styles.d.ts.map +1 -0
- package/lib/cs/TaskManager/TaskManager.styles.js +8 -0
- package/lib/cs/TaskManager/TaskManager.styles.js.map +1 -0
- package/lib/dnd/DragDropList/DragDropList.mocks.d.ts +15 -0
- package/lib/dnd/DragDropList/DragDropList.mocks.d.ts.map +1 -0
- package/lib/dnd/DragDropList/DragDropList.mocks.js +32 -0
- package/lib/dnd/DragDropList/DragDropList.mocks.js.map +1 -0
- package/lib/dnd/DragDropList/DragDropList.stories.d.ts +8 -9
- package/lib/dnd/DragDropList/DragDropList.stories.d.ts.map +1 -1
- package/lib/dnd/DragDropList/DragDropList.stories.js +14 -85
- package/lib/dnd/DragDropList/DragDropList.stories.js.map +1 -1
- package/lib/dnd/DragDropList/DragDropList.styles.d.ts +6 -0
- package/lib/dnd/DragDropList/DragDropList.styles.d.ts.map +1 -0
- package/lib/dnd/DragDropList/DragDropList.styles.js +32 -0
- package/lib/dnd/DragDropList/DragDropList.styles.js.map +1 -0
- package/lib/rte/Editor/Editor.mocks.d.ts +6 -0
- package/lib/rte/Editor/Editor.mocks.d.ts.map +1 -0
- package/lib/rte/Editor/Editor.mocks.js +23 -0
- package/lib/rte/Editor/Editor.mocks.js.map +1 -0
- package/lib/rte/Editor/Editor.stories.d.ts.map +1 -1
- package/lib/rte/Editor/Editor.stories.js +1 -21
- package/lib/rte/Editor/Editor.stories.js.map +1 -1
- package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts +2 -3
- package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -1
- package/lib/rte/RichTextEditor/RichTextEditor.stories.js.map +1 -1
- package/lib/social/Chat/RepeatingView.mocks.d.ts +14 -0
- package/lib/social/Chat/RepeatingView.mocks.d.ts.map +1 -0
- package/lib/social/Chat/RepeatingView.mocks.js +11 -0
- package/lib/social/Chat/RepeatingView.mocks.js.map +1 -0
- package/lib/social/Chat/RepeatingView.stories.d.ts +6 -17
- package/lib/social/Chat/RepeatingView.stories.d.ts.map +1 -1
- package/lib/social/Chat/RepeatingView.stories.js +16 -46
- package/lib/social/Chat/RepeatingView.stories.js.map +1 -1
- package/lib/social/Chat/RepeatingView.styles.d.ts +2 -0
- package/lib/social/Chat/RepeatingView.styles.d.ts.map +1 -0
- package/lib/social/Chat/RepeatingView.styles.js +22 -0
- package/lib/social/Chat/RepeatingView.styles.js.map +1 -0
- package/lib/social/Email/Email.mocks.d.ts +155 -2
- package/lib/social/Email/Email.mocks.d.ts.map +1 -1
- package/lib/social/Email/Email.mocks.js +361 -0
- package/lib/social/Email/Email.mocks.js.map +1 -1
- package/lib/social/Email/Email.stories.d.ts +14 -14
- package/lib/social/Email/Email.stories.d.ts.map +1 -1
- package/lib/social/Email/Email.stories.js +99 -427
- package/lib/social/Email/Email.stories.js.map +1 -1
- package/lib/social/Email/Email.styles.d.ts +4 -0
- package/lib/social/Email/Email.styles.d.ts.map +1 -0
- package/lib/social/Email/Email.styles.js +14 -0
- package/lib/social/Email/Email.styles.js.map +1 -0
- package/lib/social/Feed/Feed.stories.d.ts.map +1 -1
- package/lib/social/Feed/Feed.stories.js +23 -18
- package/lib/social/Feed/Feed.stories.js.map +1 -1
- package/lib/social/Feed/FeedPost.stories.d.ts.map +1 -1
- package/lib/social/Feed/FeedPost.stories.js +30 -20
- package/lib/social/Feed/FeedPost.stories.js.map +1 -1
- package/lib/social/Feed/FeedReply.stories.d.ts.map +1 -1
- package/lib/social/Feed/FeedReply.stories.js +21 -16
- package/lib/social/Feed/FeedReply.stories.js.map +1 -1
- package/lib/work/CaseView/MobileCaseView.stories.d.ts +2 -7
- package/lib/work/CaseView/MobileCaseView.stories.d.ts.map +1 -1
- package/lib/work/CaseView/MobileCaseView.stories.js.map +1 -1
- package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts +45 -0
- package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts.map +1 -0
- package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.js +165 -0
- package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.js.map +1 -0
- package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +2 -6
- package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
- package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js +2 -172
- package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js.map +1 -1
- package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts +4 -0
- package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts.map +1 -0
- package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.js +11 -0
- package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.js.map +1 -0
- package/package.json +9 -10
- package/jsx/build/FlowModeller/FlowModeller.mocks.js.map +0 -1
- package/jsx/build/ObjectSelect/ObjectSelect.mocks.js +0 -136
- package/jsx/build/ObjectSelect/ObjectSelect.mocks.js.map +0 -1
- package/jsx/cs/CSCaseView/CSCaseView.mocks.js.map +0 -1
- package/jsx/social/Email/Email.mocks.js +0 -395
- package/jsx/social/Email/Email.mocks.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Editor.mocks.d.ts","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.mocks.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,qBAAqB,CAAC;AAYxC,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,cAAc;IAMd,iBAAiB;CAOlB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import ReactDOM from 'react-dom';
|
|
2
|
+
export const label = 'Form field label';
|
|
3
|
+
const PegaCustom = ({ children }) => {
|
|
4
|
+
return (<p style={{ color: 'blue', textTransform: 'uppercase' }} dangerouslySetInnerHTML={{ __html: children }}/>);
|
|
5
|
+
};
|
|
6
|
+
export class PegaCustomElement extends HTMLElement {
|
|
7
|
+
removeElements() {
|
|
8
|
+
while (this.firstChild) {
|
|
9
|
+
this.removeChild(this.firstChild);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
connectedCallback() {
|
|
13
|
+
const inner = this.innerHTML;
|
|
14
|
+
this.removeElements();
|
|
15
|
+
const mountPoint = document.createElement('span');
|
|
16
|
+
this.appendChild(mountPoint);
|
|
17
|
+
ReactDOM.render(<PegaCustom>{inner}</PegaCustom>, mountPoint);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=Editor.mocks.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Editor.mocks.jsx","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.mocks.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,MAAM,KAAK,GAAG,kBAAkB,CAAC;AAExC,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAwB,EAAE,EAAE;IACxD,OAAO,CACL,CAAC,CAAC,CACA,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC,CAErD,uBAAuB,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAC9C,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAChD,cAAc;QACZ,OAAO,IAAI,CAAC,UAAU,EAAE;YACtB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SACnC;IACH,CAAC;IAED,iBAAiB;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC;QAC7B,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAClD,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC7B,QAAQ,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC,CAAC;IAChE,CAAC;CACF","sourcesContent":["import ReactDOM from 'react-dom';\n\nexport const label = 'Form field label';\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\nexport class 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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;;
|
|
1
|
+
{"version":3,"file":"Editor.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;;AAkBxC,wBAGU;AAEV,eAAO,MAAM,UAAU,mBAmBtB,CAAC;AAEF,eAAO,MAAM,eAAe,mBAmB3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,mBAc7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,mBA6B/B,CAAC;AAEF,eAAO,MAAM,sBAAsB,mBAkClC,CAAC;AAEF,eAAO,MAAM,6BAA6B,mBA8BzC,CAAC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { useState, useRef } from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom';
|
|
3
2
|
import { action } from '@storybook/addon-actions';
|
|
4
3
|
import { Button, Card, CardContent, CardFooter, Flex, Text, TextArea } from '@pega/cosmos-react-core';
|
|
5
4
|
import { Editor } from '@pega/cosmos-react-rte';
|
|
5
|
+
import { label, PegaCustomElement } from './Editor.mocks';
|
|
6
6
|
export default {
|
|
7
7
|
title: 'RTE/Editor',
|
|
8
8
|
component: Editor
|
|
9
9
|
};
|
|
10
|
-
const label = 'Form field label';
|
|
11
10
|
export const EditorDemo = () => {
|
|
12
11
|
const editorRef = useRef(null);
|
|
13
12
|
const onImageAdded = (image, id) => {
|
|
@@ -33,23 +32,6 @@ export const ReadonlyFormField = () => {
|
|
|
33
32
|
<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>
|
|
34
33
|
`}/>);
|
|
35
34
|
};
|
|
36
|
-
const PegaCustom = ({ children }) => {
|
|
37
|
-
return (<p style={{ color: 'blue', textTransform: 'uppercase' }} dangerouslySetInnerHTML={{ __html: children }}/>);
|
|
38
|
-
};
|
|
39
|
-
class PegaCustomElement extends HTMLElement {
|
|
40
|
-
removeElements() {
|
|
41
|
-
while (this.firstChild) {
|
|
42
|
-
this.removeChild(this.firstChild);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
connectedCallback() {
|
|
46
|
-
const inner = this.innerHTML;
|
|
47
|
-
this.removeElements();
|
|
48
|
-
const mountPoint = document.createElement('span');
|
|
49
|
-
this.appendChild(mountPoint);
|
|
50
|
-
ReactDOM.render(<PegaCustom>{inner}</PegaCustom>, mountPoint);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
35
|
export const CustomComponentDemo = () => {
|
|
54
36
|
const editorRef = useRef(null);
|
|
55
37
|
const [editor, setEditor] = useState({});
|
|
@@ -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,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,CA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C,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><img alt=\"placeholder\" src=\"http://via.placeholder.com/640x360\"/></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
|
+
{"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,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,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,eAAe;IACb,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,MAAM;CACV,CAAC;AAEV,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,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/D,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,MAAM,CACL,GAAG,CAAC,CAAC,SAAS,CAAC,CACf,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,OAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CACvE,OAAO,CAAC,CAAC,MAA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AAA,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 { 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\nimport { label, PegaCustomElement } from './Editor.mocks';\n\nexport default {\n title: 'RTE/Editor',\n component: Editor\n} as Meta;\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><img alt=\"placeholder\" src=\"http://via.placeholder.com/640x360\"/></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\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,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { Meta, Story } from '@storybook/react';
|
|
3
2
|
import { RichTextEditorProps } from '@pega/cosmos-react-rte';
|
|
4
3
|
declare const _default: Meta<import("@storybook/react").Args>;
|
|
5
4
|
export default _default;
|
|
6
5
|
export declare const RichTextEditorDemo: Story<RichTextEditorProps>;
|
|
7
|
-
export declare const RichTextEditorWithLogs:
|
|
6
|
+
export declare const RichTextEditorWithLogs: Story;
|
|
8
7
|
export declare const RichTextEditorMDDemo: Story<RichTextEditorProps>;
|
|
9
|
-
export declare const RichTextEditorHtmlParsingDemo:
|
|
8
|
+
export declare const RichTextEditorHtmlParsingDemo: Story;
|
|
10
9
|
//# sourceMappingURL=RichTextEditor.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RichTextEditor.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAa/C,OAAO,EAAkB,mBAAmB,EAAuB,MAAM,wBAAwB,CAAC;;AAIlG,wBAqBU;AAEV,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,mBAAmB,CAkDzD,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KA2CpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,mBAAmB,CAuC3D,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,KAuC3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.stories.jsx","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO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;YACP,gBAAgB;YAChB,SAAS;YACT,QAAQ;YACR,OAAO;YACP,QAAQ;YACR,OAAO;YACP,gBAAgB;YAChB,aAAa;SACd,CAAC,EAEN;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport { useState, useRef } from 'react';\n\nimport {\n Button,\n Flex,\n MenuItemProps,\n Text,\n Card,\n CardContent,\n CardFooter,\n TextArea\n} from '@pega/cosmos-react-core';\nimport { RichTextEditor, RichTextEditorProps, RichTextEditorState } from '@pega/cosmos-react-rte';\n\nimport { demoUsers } from './RichTextEditor.mocks';\n\nexport default {\n title: 'RTE/RichTextEditor',\n component: RichTextEditor,\n args: {\n label: 'Rich text editor',\n labelHidden: false,\n info: 'The rich text editor can be used in forms, comments, and documents',\n status: undefined,\n required: false,\n disabled: false,\n readOnly: false\n },\n argTypes: {\n label: { control: { type: 'text' } },\n labelHidden: { control: { type: 'boolean' } },\n info: { control: { type: 'text' } },\n status: { options: [undefined, 'success', 'warning', 'error'], control: { type: 'select' } },\n required: { control: { type: 'boolean' } },\n disabled: { control: { type: 'boolean' } },\n readOnly: { control: { type: 'boolean' } }\n }\n} as Meta;\n\nexport const RichTextEditorDemo: Story<RichTextEditorProps> = (args: RichTextEditorProps) => {\n const editorRef = useRef<RichTextEditorState>(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 const overwriteText = () => {\n editorRef.current?.insertHtml('<p>Hello world!</p>', true);\n };\n\n const insertText = () => {\n editorRef.current?.insertText('Hi mom!');\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onImageAdded={onImageAdded}\n label={args.label}\n labelHidden={args.labelHidden}\n info={args.info}\n status={args.status}\n required={args.required}\n disabled={args.disabled}\n readOnly={args.readOnly}\n defaultValue='<body><!-- I will break the RTE --><p> Life is stress free.</p><p> Life is stress free.</p></body>'\n />\n <Flex container={{ gap: 1 }}>\n <Button onClick={overwriteText}>\n Overwrite RTE value with 'Hello world!' HTML\n </Button>\n <Button onClick={insertText} label='RTE Must be focused for insert text to work'>\n Insert 'Hi mom!'\n </Button>\n </Flex>\n </Flex>\n );\n};\n\nexport const RichTextEditorWithLogs = () => {\n const editorRef = useRef<RichTextEditorState>(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 <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\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 RichTextEditorMDDemo: Story<RichTextEditorProps> = (args: RichTextEditorProps) => {\n const [users, setUsers] = useState<MenuItemProps[]>(demoUsers);\n\n const searchUsers = (event: { search: string; trigger: string }) => {\n if (event.trigger === '@') {\n setUsers(\n demoUsers.filter(user => {\n return user.primary.toLowerCase().includes(event.search.toLowerCase());\n })\n );\n }\n };\n\n return (\n <RichTextEditor\n searchTriggers={[{ trigger: '@', regex: '[a-zA-Z]*(?: [a-zA-Z]*)?' }]}\n onSearch={searchUsers}\n getSearchItemReplacement={(id: string) => {\n const item = demoUsers.find(({ id: itemId }) => itemId === id);\n\n if (!item) return undefined;\n\n return {\n markdown: `@${item.id}:${item.primary}:user:`,\n text: item.primary\n };\n }}\n menu={users.length ? { items: users } : undefined}\n autoFocus\n markdownOnly\n label={args.label}\n labelHidden={args.labelHidden}\n info={args.info}\n status={args.status}\n required={args.required}\n disabled={args.disabled}\n readOnly={args.readOnly}\n />\n );\n};\n\nexport const RichTextEditorHtmlParsingDemo = () => {\n const [html, setHtml] = useState('<p>Hello world!</p>');\n const rteRef = useRef<RichTextEditorState>(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 <RichTextEditor\n defaultValue={html}\n onImageAdded={onImageAdded}\n ref={rteRef}\n label='Rich text editor'\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n />\n </Flex>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"RichTextEditor.stories.jsx","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EACL,MAAM,EACN,IAAI,EAEJ,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,UAAU,EACV,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,O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AC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport { useState, useRef } from 'react';\n\nimport {\n Button,\n Flex,\n MenuItemProps,\n Text,\n Card,\n CardContent,\n CardFooter,\n TextArea\n} from '@pega/cosmos-react-core';\nimport { RichTextEditor, RichTextEditorProps, RichTextEditorState } from '@pega/cosmos-react-rte';\n\nimport { demoUsers } from './RichTextEditor.mocks';\n\nexport default {\n title: 'RTE/RichTextEditor',\n component: RichTextEditor,\n args: {\n label: 'Rich text editor',\n labelHidden: false,\n info: 'The rich text editor can be used in forms, comments, and documents',\n status: undefined,\n required: false,\n disabled: false,\n readOnly: false\n },\n argTypes: {\n label: { control: { type: 'text' } },\n labelHidden: { control: { type: 'boolean' } },\n info: { control: { type: 'text' } },\n status: { options: [undefined, 'success', 'warning', 'error'], control: { type: 'select' } },\n required: { control: { type: 'boolean' } },\n disabled: { control: { type: 'boolean' } },\n readOnly: { control: { type: 'boolean' } }\n }\n} as Meta;\n\nexport const RichTextEditorDemo: Story<RichTextEditorProps> = (args: RichTextEditorProps) => {\n const editorRef = useRef<RichTextEditorState>(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 const overwriteText = () => {\n editorRef.current?.insertHtml('<p>Hello world!</p>', true);\n };\n\n const insertText = () => {\n editorRef.current?.insertText('Hi mom!');\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onImageAdded={onImageAdded}\n label={args.label}\n labelHidden={args.labelHidden}\n info={args.info}\n status={args.status}\n required={args.required}\n disabled={args.disabled}\n readOnly={args.readOnly}\n defaultValue='<body><!-- I will break the RTE --><p> Life is stress free.</p><p> Life is stress free.</p></body>'\n />\n <Flex container={{ gap: 1 }}>\n <Button onClick={overwriteText}>\n Overwrite RTE value with 'Hello world!' HTML\n </Button>\n <Button onClick={insertText} label='RTE Must be focused for insert text to work'>\n Insert 'Hi mom!'\n </Button>\n </Flex>\n </Flex>\n );\n};\n\nexport const RichTextEditorWithLogs: Story = () => {\n const editorRef = useRef<RichTextEditorState>(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 <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\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 RichTextEditorMDDemo: Story<RichTextEditorProps> = (args: RichTextEditorProps) => {\n const [users, setUsers] = useState<MenuItemProps[]>(demoUsers);\n\n const searchUsers = (event: { search: string; trigger: string }) => {\n if (event.trigger === '@') {\n setUsers(\n demoUsers.filter(user => {\n return user.primary.toLowerCase().includes(event.search.toLowerCase());\n })\n );\n }\n };\n\n return (\n <RichTextEditor\n searchTriggers={[{ trigger: '@', regex: '[a-zA-Z]*(?: [a-zA-Z]*)?' }]}\n onSearch={searchUsers}\n getSearchItemReplacement={(id: string) => {\n const item = demoUsers.find(({ id: itemId }) => itemId === id);\n\n if (!item) return undefined;\n\n return {\n markdown: `@${item.id}:${item.primary}:user:`,\n text: item.primary\n };\n }}\n menu={users.length ? { items: users } : undefined}\n autoFocus\n markdownOnly\n label={args.label}\n labelHidden={args.labelHidden}\n info={args.info}\n status={args.status}\n required={args.required}\n disabled={args.disabled}\n readOnly={args.readOnly}\n />\n );\n};\n\nexport const RichTextEditorHtmlParsingDemo: Story = () => {\n const [html, setHtml] = useState('<p>Hello world!</p>');\n const rteRef = useRef<RichTextEditorState>(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 <RichTextEditor\n defaultValue={html}\n onImageAdded={onImageAdded}\n ref={rteRef}\n label='Rich text editor'\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n />\n </Flex>\n );\n};\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RepeatingViewRow } from '@pega/cosmos-react-social';
|
|
2
|
+
export interface Contact extends RepeatingViewRow {
|
|
3
|
+
name: {
|
|
4
|
+
title: string;
|
|
5
|
+
first: string;
|
|
6
|
+
last: string;
|
|
7
|
+
};
|
|
8
|
+
phone: string;
|
|
9
|
+
picture: {
|
|
10
|
+
thumbnail: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare const FetchContactsAPI: (results: number, abortController: AbortController) => Promise<Contact[]>;
|
|
14
|
+
//# sourceMappingURL=RepeatingView.mocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RepeatingView.mocks.d.ts","sourceRoot":"","sources":["../../../src/social/Chat/RepeatingView.mocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,WAAW,OAAQ,SAAQ,gBAAgB;IAC/C,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CAChC;AAED,eAAO,MAAM,gBAAgB,EAAE,CAC7B,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,eAAe,KAC7B,OAAO,CAAC,OAAO,EAAE,CAWrB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const FetchContactsAPI = (results, abortController) => {
|
|
2
|
+
return fetch(`https://randomuser.me/api?results=${results}`, {
|
|
3
|
+
signal: abortController.signal
|
|
4
|
+
})
|
|
5
|
+
.then(res => res.json())
|
|
6
|
+
.then((data) => [...data.results].map(item => ({
|
|
7
|
+
...item,
|
|
8
|
+
id: Math.floor(Math.random() * Math.floor(500000)).toString()
|
|
9
|
+
})));
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=RepeatingView.mocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RepeatingView.mocks.js","sourceRoot":"","sources":["../../../src/social/Chat/RepeatingView.mocks.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,gBAAgB,GAGH,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE;IACrD,OAAO,KAAK,CAAC,qCAAqC,OAAO,EAAE,EAAE;QAC3D,MAAM,EAAE,eAAe,CAAC,MAAM;KAC/B,CAAC;SACC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;SACvB,IAAI,CAAC,CAAC,IAAS,EAAE,EAAE,CAClB,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7B,GAAG,IAAI;QACP,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE;KAC9D,CAAC,CAAC,CACJ,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { RepeatingViewRow } from '@pega/cosmos-react-social';\n\nexport interface Contact extends RepeatingViewRow {\n name: { title: string; first: string; last: string };\n phone: string;\n picture: { thumbnail: string };\n}\n\nexport const FetchContactsAPI: (\n results: number,\n abortController: AbortController\n) => Promise<Contact[]> = (results, abortController) => {\n return fetch(`https://randomuser.me/api?results=${results}`, {\n signal: abortController.signal\n })\n .then(res => res.json())\n .then((data: any) =>\n [...data.results].map(item => ({\n ...item,\n id: Math.floor(Math.random() * Math.floor(500000)).toString()\n }))\n );\n};\n"]}
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
declare const _default:
|
|
4
|
-
title: string;
|
|
5
|
-
component: import("react").FunctionComponent<RepeatingViewProps & import("@pega/cosmos-react-core").ForwardProps>;
|
|
6
|
-
};
|
|
1
|
+
import { Meta, Story } from '@storybook/react';
|
|
2
|
+
import { RepeatingViewProps } from '@pega/cosmos-react-social';
|
|
3
|
+
declare const _default: Meta<import("@storybook/react").Args>;
|
|
7
4
|
export default _default;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
title: string;
|
|
11
|
-
first: string;
|
|
12
|
-
last: string;
|
|
13
|
-
};
|
|
14
|
-
phone: string;
|
|
15
|
-
picture: {
|
|
16
|
-
thumbnail: string;
|
|
17
|
-
};
|
|
5
|
+
interface RepeatingViewStoryProps {
|
|
6
|
+
scrollDirection: RepeatingViewProps['scrollDirection'];
|
|
18
7
|
}
|
|
19
|
-
export declare const RepeatingViewSample:
|
|
8
|
+
export declare const RepeatingViewSample: Story<RepeatingViewStoryProps>;
|
|
20
9
|
//# sourceMappingURL=RepeatingView.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RepeatingView.stories.d.ts","sourceRoot":"","sources":["../../../src/social/Chat/RepeatingView.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RepeatingView.stories.d.ts","sourceRoot":"","sources":["../../../src/social/Chat/RepeatingView.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAiB,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;;AAK9E,wBAGU;AAEV,UAAU,uBAAuB;IAC/B,eAAe,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;CACxD;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,uBAAuB,CAgF9D,CAAC"}
|
|
@@ -1,57 +1,21 @@
|
|
|
1
1
|
import { useCallback, useState, useEffect, useMemo } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { Avatar, SummaryItem } from '@pega/cosmos-react-core';
|
|
3
|
+
import { RepeatingView } from '@pega/cosmos-react-social';
|
|
4
|
+
import { StyledContactsBook } from './RepeatingView.styles';
|
|
5
|
+
import { FetchContactsAPI } from './RepeatingView.mocks';
|
|
6
6
|
export default {
|
|
7
7
|
title: 'Social/Chat/RepeatingView',
|
|
8
8
|
component: RepeatingView
|
|
9
9
|
};
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
top: 0;
|
|
16
|
-
left: 50%;
|
|
17
|
-
transform: translate(-50%, 0%);
|
|
18
|
-
z-index: 1;
|
|
19
|
-
border: 0.0625rem solid ${bdrColor};
|
|
20
|
-
background-color: ${theme.base.palette['primary-background']};
|
|
21
|
-
${StyledRepeatingViewItem} {
|
|
22
|
-
border-bottom: 0.0625rem solid ${bdrColor};
|
|
23
|
-
padding: calc(0.5 * ${theme.base.spacing});
|
|
24
|
-
}
|
|
25
|
-
`;
|
|
26
|
-
});
|
|
27
|
-
StyledContactsBook.defaultProps = defaultThemeProp;
|
|
28
|
-
const INITIAL_CHUNK_SIZE = 50;
|
|
29
|
-
const APPEND_CHUNK_SIZE = 25;
|
|
30
|
-
const FETCH_AHEAD_OFFSET = 10;
|
|
31
|
-
const TOTAL_RECORDS = Math.max(INITIAL_CHUNK_SIZE, 100);
|
|
32
|
-
function id() {
|
|
33
|
-
return Math.floor(Math.random() * Math.floor(500000)).toString();
|
|
34
|
-
}
|
|
35
|
-
const FetchContactsAPI = (results, abortController) => {
|
|
36
|
-
return fetch(`https://randomuser.me/api?results=${results}`, {
|
|
37
|
-
signal: abortController.signal
|
|
38
|
-
})
|
|
39
|
-
.then(res => res.json())
|
|
40
|
-
.then((data) => [...data.results].map(item => ({
|
|
41
|
-
...item,
|
|
42
|
-
id: id()
|
|
43
|
-
})));
|
|
44
|
-
};
|
|
45
|
-
export const RepeatingViewSample = () => {
|
|
10
|
+
export const RepeatingViewSample = (args) => {
|
|
11
|
+
const INITIAL_CHUNK_SIZE = 50;
|
|
12
|
+
const APPEND_CHUNK_SIZE = 25;
|
|
13
|
+
const FETCH_AHEAD_OFFSET = 10;
|
|
14
|
+
const TOTAL_RECORDS = Math.max(INITIAL_CHUNK_SIZE, 100);
|
|
46
15
|
const [rows, setRows] = useState({
|
|
47
16
|
data: [],
|
|
48
17
|
isLoading: true
|
|
49
18
|
});
|
|
50
|
-
const scrollDirectionOptions = {
|
|
51
|
-
'Top to bottom': 'top-to-bottom',
|
|
52
|
-
'Bottom to top': 'bottom-to-top'
|
|
53
|
-
};
|
|
54
|
-
const scrollDirection = radios('Scroll direction', scrollDirectionOptions, scrollDirectionOptions[Object.keys(scrollDirectionOptions)[0]]);
|
|
55
19
|
const abortController = useMemo(() => {
|
|
56
20
|
return new AbortController();
|
|
57
21
|
}, []);
|
|
@@ -80,11 +44,17 @@ export const RepeatingViewSample = () => {
|
|
|
80
44
|
});
|
|
81
45
|
}
|
|
82
46
|
}, [rows, setRows]);
|
|
83
|
-
return (<RepeatingView as={StyledContactsBook} loading={rows.isLoading} rows={rows.data} style={{ height: '40rem', maxHeight: '100vh' }} loadMore={loadMore} offset={rows.data.length === TOTAL_RECORDS ? -1 : rows.data.length - FETCH_AHEAD_OFFSET} scrollDirection={scrollDirection}>
|
|
47
|
+
return (<RepeatingView as={StyledContactsBook} loading={rows.isLoading} rows={rows.data} style={{ height: '40rem', maxHeight: '100vh' }} loadMore={loadMore} offset={rows.data.length === TOTAL_RECORDS ? -1 : rows.data.length - FETCH_AHEAD_OFFSET} scrollDirection={args.scrollDirection}>
|
|
84
48
|
{row => {
|
|
85
49
|
const { name: { title, first, last }, phone, picture: { thumbnail } } = row;
|
|
86
50
|
return (<SummaryItem primary={[title, first, last].join(' ')} visual={<Avatar imageSrc={thumbnail} name={[title, first, last].join(' ')} shape='circle' size='l'/>} secondary={phone}/>);
|
|
87
51
|
}}
|
|
88
52
|
</RepeatingView>);
|
|
89
53
|
};
|
|
54
|
+
RepeatingViewSample.args = {
|
|
55
|
+
scrollDirection: 'top-to-bottom'
|
|
56
|
+
};
|
|
57
|
+
RepeatingViewSample.argTypes = {
|
|
58
|
+
scrollDirection: { options: ['top-to-bottom', 'bottom-to-top'], control: { type: 'select' } }
|
|
59
|
+
};
|
|
90
60
|
//# sourceMappingURL=RepeatingView.stories.jsx.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RepeatingView.stories.jsx","sourceRoot":"","sources":["../../../src/social/Chat/RepeatingView.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,O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Ae,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAEtC;MAAA,CAAC,GAAG,CAAC,EAAE;YACL,MAAM,EACJ,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAC5B,KAAK,EACL,OAAO,EAAE,EAAE,SAAS,EAAE,EACvB,GAAG,GAAc,CAAC;YACnB,OAAO,CACL,CAAC,WAAW,CACV,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CACxC,MAAM,CAAC,CACL,CAAC,MAAM,CACL,QAAQ,CAAC,CAAC,SAAS,CAAC,CACpB,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CACrC,KAAK,CAAC,QAAQ,CACd,IAAI,CAAC,GAAG,EACR,CACH,CACD,SAAS,CAAC,CAAC,KAAK,CAAC,EACjB,CACH,CAAC;QACJ,CAAC,CACH;IAAA,EAAE,aAAa,CAAC,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,mBAAmB,CAAC,IAAI,GAAG;IACzB,eAAe,EAAE,eAAe;CACjC,CAAC;AAEF,mBAAmB,CAAC,QAAQ,GAAG;IAC7B,eAAe,EAAE,EAAE,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;CAC9F,CAAC","sourcesContent":["import { useCallback, useState, useEffect, useMemo } from 'react';\nimport { Meta, Story } from '@storybook/react';\n\nimport { Avatar, SummaryItem } from '@pega/cosmos-react-core';\nimport { RepeatingView, RepeatingViewProps } from '@pega/cosmos-react-social';\n\nimport { StyledContactsBook } from './RepeatingView.styles';\nimport { Contact, FetchContactsAPI } from './RepeatingView.mocks';\n\nexport default {\n title: 'Social/Chat/RepeatingView',\n component: RepeatingView\n} as Meta;\n\ninterface RepeatingViewStoryProps {\n scrollDirection: RepeatingViewProps['scrollDirection'];\n}\n\nexport const RepeatingViewSample: Story<RepeatingViewStoryProps> = (\n args: RepeatingViewStoryProps\n) => {\n const INITIAL_CHUNK_SIZE = 50;\n const APPEND_CHUNK_SIZE = 25;\n const FETCH_AHEAD_OFFSET = 10;\n const TOTAL_RECORDS = Math.max(INITIAL_CHUNK_SIZE, 100);\n\n const [rows, setRows] = useState<{\n data: Contact[];\n isLoading: boolean;\n }>({\n data: [],\n isLoading: true\n });\n\n const abortController = useMemo(() => {\n return new AbortController();\n }, []);\n\n useEffect(() => {\n FetchContactsAPI(INITIAL_CHUNK_SIZE, abortController).then((newRows: Contact[]) => {\n setRows(prevRows => ({\n isLoading: false,\n data: [...prevRows.data, ...newRows]\n }));\n });\n return () => {\n abortController.abort();\n };\n }, []);\n\n const loadMore = useCallback(() => {\n if (!rows.isLoading) {\n setRows(prevRows => ({\n ...prevRows,\n isLoading: true\n }));\n FetchContactsAPI(APPEND_CHUNK_SIZE, abortController).then((newRows: Contact[]) => {\n setRows(prevRows => ({\n isLoading: false,\n data: [...prevRows.data, ...newRows]\n }));\n });\n }\n }, [rows, setRows]);\n\n return (\n <RepeatingView\n as={StyledContactsBook}\n loading={rows.isLoading}\n rows={rows.data}\n style={{ height: '40rem', maxHeight: '100vh' }}\n loadMore={loadMore}\n offset={rows.data.length === TOTAL_RECORDS ? -1 : rows.data.length - FETCH_AHEAD_OFFSET}\n scrollDirection={args.scrollDirection}\n >\n {row => {\n const {\n name: { title, first, last },\n phone,\n picture: { thumbnail }\n } = row as Contact;\n return (\n <SummaryItem\n primary={[title, first, last].join(' ')}\n visual={\n <Avatar\n imageSrc={thumbnail}\n name={[title, first, last].join(' ')}\n shape='circle'\n size='l'\n />\n }\n secondary={phone}\n />\n );\n }}\n </RepeatingView>\n );\n};\n\nRepeatingViewSample.args = {\n scrollDirection: 'top-to-bottom'\n};\n\nRepeatingViewSample.argTypes = {\n scrollDirection: { options: ['top-to-bottom', 'bottom-to-top'], control: { type: 'select' } }\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RepeatingView.styles.d.ts","sourceRoot":"","sources":["../../../src/social/Chat/RepeatingView.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB,yGAgB7B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { defaultThemeProp } from '@pega/cosmos-react-core';
|
|
3
|
+
import { StyledRepeatingView, StyledRepeatingViewItem } from '@pega/cosmos-react-social';
|
|
4
|
+
export const StyledContactsBook = styled(StyledRepeatingView)(({ theme }) => {
|
|
5
|
+
const bdrColor = theme.base.palette['border-line'];
|
|
6
|
+
return css `
|
|
7
|
+
width: 25rem;
|
|
8
|
+
position: absolute;
|
|
9
|
+
top: 0;
|
|
10
|
+
left: 50%;
|
|
11
|
+
transform: translate(-50%, 0%);
|
|
12
|
+
z-index: 1;
|
|
13
|
+
border: 0.0625rem solid ${bdrColor};
|
|
14
|
+
background-color: ${theme.base.palette['primary-background']};
|
|
15
|
+
${StyledRepeatingViewItem} {
|
|
16
|
+
border-bottom: 0.0625rem solid ${bdrColor};
|
|
17
|
+
padding: calc(0.5 * ${theme.base.spacing});
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
});
|
|
21
|
+
StyledContactsBook.defaultProps = defaultThemeProp;
|
|
22
|
+
//# sourceMappingURL=RepeatingView.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RepeatingView.styles.js","sourceRoot":"","sources":["../../../src/social/Chat/RepeatingView.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEzF,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC1E,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACnD,OAAO,GAAG,CAAA;;;;;;;8BAOkB,QAAQ;wBACd,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;MAC1D,uBAAuB;uCACU,QAAQ;4BACnB,KAAK,CAAC,IAAI,CAAC,OAAO;;GAE3C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '@pega/cosmos-react-core';\nimport { StyledRepeatingView, StyledRepeatingViewItem } from '@pega/cosmos-react-social';\n\nexport const StyledContactsBook = styled(StyledRepeatingView)(({ theme }) => {\n const bdrColor = theme.base.palette['border-line'];\n return css`\n width: 25rem;\n position: absolute;\n top: 0;\n left: 50%;\n transform: translate(-50%, 0%);\n z-index: 1;\n border: 0.0625rem solid ${bdrColor};\n background-color: ${theme.base.palette['primary-background']};\n ${StyledRepeatingViewItem} {\n border-bottom: 0.0625rem solid ${bdrColor};\n padding: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledContactsBook.defaultProps = defaultThemeProp;\n"]}
|