mean | 19 |min | 20 |median | 21 |p70 | 22 |p95 | 23 |p99 | 24 |max | 25 |stdDev | 26 |
---|---|---|---|---|---|---|---|
{results.mean.toFixed(1)} | 31 |{results.min.toFixed(1)} | 32 |{results.median.toFixed(1)} | 33 |{results.p70.toFixed(1)} | 34 |{results.p95.toFixed(1)} | 35 |{results.p99.toFixed(1)} | 36 |{results.max.toFixed(1)} | 37 |{results.stdDev.toFixed(1)} | 38 |
hello
"); 10 | const contentState = ContentState.createFromBlockArray(contentBlocks); 11 | const editorState = EditorState.createWithContent(contentState); 12 | 13 | expect(shallow(
18 |
25 | {value}
26 |
27 | );
28 |
29 | export default Highlight;
30 |
--------------------------------------------------------------------------------
/examples/components/Modal.scss:
--------------------------------------------------------------------------------
1 | $easing-circ: cubic-bezier(0.075, 0.82, 0.165, 1);
2 | $color-bg-modal__overlay: rgba(0, 0, 0, 0.5);
3 | $color-bg-modal: #fff;
4 |
5 | $modal__overlay-z-index: 110;
6 | $modal-z-index: $modal__overlay-z-index + 1;
7 |
8 | $spacing-modal: 0.5rem;
9 |
10 | .modal__container--open {
11 | @include small() {
12 | overflow: hidden;
13 | }
14 | }
15 |
16 | .modal {
17 | --draftail-text-direction: 1;
18 | position: absolute;
19 | inset-inline-start: 50%;
20 | top: 25vh;
21 | min-width: 320px;
22 | transform: translate(-50%, -50%);
23 | overflow-y: auto;
24 | -webkit-overflow-scrolling: touch;
25 | z-index: $modal-z-index;
26 | background-color: $color-bg-modal;
27 | animation: modal-in 0.2s $easing-circ 0s backwards;
28 | outline: $draftail-contrast-outline-modal;
29 |
30 | &[dir="rtl"],
31 | [dir="rtl"] & {
32 | --draftail-text-direction: -1;
33 | }
34 | }
35 |
36 | .modal--exit {
37 | animation: modal-out 0.2s $easing-circ 0s forwards;
38 |
39 | .modal__content {
40 | animation: affordance-out 0.2s ease-in 0s forwards;
41 | }
42 | }
43 |
44 | .modal__overlay {
45 | position: fixed;
46 | top: 0;
47 | inset-inline-end: 0;
48 | bottom: 0;
49 | inset-inline-start: 0;
50 | background-color: $color-bg-modal__overlay;
51 | z-index: $modal__overlay-z-index;
52 | cursor: pointer;
53 | }
54 |
55 | @keyframes modal-in {
56 | 0% {
57 | opacity: 0;
58 | }
59 |
60 | 100% {
61 | opacity: 1;
62 | }
63 | }
64 |
65 | @keyframes modal-out {
66 | 0% {
67 | opacity: 1;
68 | }
69 |
70 | 100% {
71 | opacity: 0;
72 | }
73 | }
74 |
75 | @keyframes affordance-in {
76 | 0% {
77 | opacity: 0;
78 | transform: translateY(5%);
79 | }
80 |
81 | 100% {
82 | opacity: 1;
83 | transform: translateY(0);
84 | }
85 | }
86 |
87 | @keyframes affordance-out {
88 | 0% {
89 | opacity: 1;
90 | transform: translateY(0);
91 | }
92 |
93 | 100% {
94 | opacity: 0;
95 | transform: translateY(5%);
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/examples/components/Modal.test.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { shallow } from "enzyme";
3 |
4 | import Modal from "./Modal";
5 |
6 | describe("Modal", () => {
7 | it("has defaults", () => {
8 | expect(shallow(Oops. The editor just crashed.
62 |63 | Our team has been notified. You can provide us with more 64 | information if you want to. 65 |
66 |19 | Enable the{" "} 20 | 24 | Chrome DevTools FPS meter 25 | 26 |
27 | ); 28 | 29 | storiesOf("Performance", module) 30 | .add(`markov_draftjs 41`, () => ( 31 | <> 32 | {header} 33 |