playbook_ui_docs 14.1.0.pre.alpha.PA1477timestampkit3536 → 14.1.0.pre.alpha.PBNTR455ganttchartPOC3569
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_gantt_chart/docs/_gantt_chart_default.jsx +53 -0
- data/app/pb_kits/playbook/pb_gantt_chart/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_gantt_chart/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_preview.jsx +73 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +2 -1
- data/dist/playbook-doc.js +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73e123e1be8432b282e1f772a66dbe6eb017eaffe60858e16d6d4d41a97d0061
|
4
|
+
data.tar.gz: 4db0c1287eb444d4a2786c700d1c78ad39e53c03b874441f389c85c8766f2e16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e04a2b37567e68d256298158e40374d8fe41f8c17b03dc37bc495695eb15047a46dadcda888ad59941838cd0e670eac0c125deee73dcf2bb90159df2a46672f
|
7
|
+
data.tar.gz: c7539a4eb752013c5f3274f15338cb642eb954b482486dd86498d27dd74540a60f51079582624719e025474753bd5235f0ed3aa60d908ab882d700618d9e61f0
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { GanttChart } from "playbook-ui";
|
3
|
+
|
4
|
+
const mockOptions = {
|
5
|
+
title: {
|
6
|
+
text: "Simple Gantt Chart",
|
7
|
+
},
|
8
|
+
|
9
|
+
xAxis: [
|
10
|
+
{
|
11
|
+
min: Date.UTC(2014, 10, 17),
|
12
|
+
max: Date.UTC(2014, 10, 30),
|
13
|
+
},
|
14
|
+
],
|
15
|
+
|
16
|
+
series: [
|
17
|
+
{
|
18
|
+
name: "Project 1",
|
19
|
+
data: [
|
20
|
+
{
|
21
|
+
name: "Start prototype",
|
22
|
+
start: Date.UTC(2014, 10, 18),
|
23
|
+
end: Date.UTC(2014, 10, 25),
|
24
|
+
},
|
25
|
+
{
|
26
|
+
name: "Develop",
|
27
|
+
start: Date.UTC(2014, 10, 20),
|
28
|
+
end: Date.UTC(2014, 10, 25),
|
29
|
+
},
|
30
|
+
{
|
31
|
+
name: "Run acceptance tests",
|
32
|
+
start: Date.UTC(2014, 10, 23),
|
33
|
+
end: Date.UTC(2014, 10, 26),
|
34
|
+
},
|
35
|
+
{
|
36
|
+
name: "Test prototype",
|
37
|
+
start: Date.UTC(2014, 10, 27),
|
38
|
+
end: Date.UTC(2014, 10, 29),
|
39
|
+
},
|
40
|
+
],
|
41
|
+
},
|
42
|
+
],
|
43
|
+
};
|
44
|
+
|
45
|
+
const GanttChartDefault = (props) => (
|
46
|
+
<div>
|
47
|
+
<GanttChart customOptions={mockOptions}
|
48
|
+
{...props}
|
49
|
+
/>
|
50
|
+
</div>
|
51
|
+
);
|
52
|
+
|
53
|
+
export default GanttChartDefault;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as GanttChartDefault } from './_gantt_chart_default.jsx'
|
@@ -0,0 +1,73 @@
|
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
import { Button, Card, RichTextEditor } from 'playbook-ui'
|
3
|
+
import { useEditor, EditorContent } from "@tiptap/react"
|
4
|
+
import StarterKit from "@tiptap/starter-kit"
|
5
|
+
import Link from '@tiptap/extension-link'
|
6
|
+
|
7
|
+
|
8
|
+
const RichTextEditorAdvancedPreview = (props) => {
|
9
|
+
|
10
|
+
const editor = useEditor({
|
11
|
+
extensions: [
|
12
|
+
StarterKit,
|
13
|
+
Link
|
14
|
+
],
|
15
|
+
content: "Add text here, format it, and press \"Preview Output\" to see what your stylized output will look like on the page."
|
16
|
+
})
|
17
|
+
|
18
|
+
const [showPreview, setShowPreview] = useState(false)
|
19
|
+
const [previewText, setPreviewText] = useState(<div />)
|
20
|
+
|
21
|
+
const handleChange = () => {
|
22
|
+
if (editor) {
|
23
|
+
setPreviewText(editor.getHTML())
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
const handleClick = () => {
|
28
|
+
handleChange()
|
29
|
+
setShowPreview(true)
|
30
|
+
}
|
31
|
+
if (!editor) {
|
32
|
+
return null
|
33
|
+
}
|
34
|
+
|
35
|
+
|
36
|
+
return (
|
37
|
+
<div>
|
38
|
+
<RichTextEditor
|
39
|
+
advancedEditor={editor}
|
40
|
+
id="content-advanced-preview-editor"
|
41
|
+
onChange={handleChange}
|
42
|
+
{...props}
|
43
|
+
>
|
44
|
+
<EditorContent editor={editor}/>
|
45
|
+
</RichTextEditor>
|
46
|
+
{showPreview && (
|
47
|
+
<Card
|
48
|
+
marginTop="md"
|
49
|
+
maxWidth="md"
|
50
|
+
>
|
51
|
+
<div
|
52
|
+
className="tiptap-content"
|
53
|
+
// eslint-disable-next-line react/no-danger
|
54
|
+
dangerouslySetInnerHTML={{ __html: previewText }}
|
55
|
+
id="advanced-preview-content"
|
56
|
+
/>
|
57
|
+
</Card>
|
58
|
+
)}
|
59
|
+
{!showPreview && (
|
60
|
+
<div />
|
61
|
+
)}
|
62
|
+
<Button
|
63
|
+
id="preview-button"
|
64
|
+
marginTop="md"
|
65
|
+
onClick={handleClick}
|
66
|
+
text="Preview Output"
|
67
|
+
variant="secondary"
|
68
|
+
/>
|
69
|
+
</div>
|
70
|
+
)
|
71
|
+
}
|
72
|
+
|
73
|
+
export default RichTextEditorAdvancedPreview
|
@@ -9,4 +9,5 @@ export { default as RichTextEditorInline } from './_rich_text_editor_inline.jsx'
|
|
9
9
|
export { default as RichTextEditorPreview } from './_rich_text_editor_preview.jsx'
|
10
10
|
export { default as RichTextEditorAdvancedDefault } from './_rich_text_editor_advanced_default.jsx'
|
11
11
|
export { default as RichTextEditorMoreExtensions } from './_rich_text_editor_more_extensions.jsx'
|
12
|
-
export { default as RichTextEditorToolbarDisabled } from './_rich_text_editor_toolbar_disabled.jsx'
|
12
|
+
export { default as RichTextEditorToolbarDisabled } from './_rich_text_editor_toolbar_disabled.jsx'
|
13
|
+
export { default as RichTextEditorAdvancedPreview } from './_rich_text_editor_advanced_preview.jsx'
|