@gooddata/sdk-ui-dashboard 10.3.0-alpha.9 → 10.3.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/NOTICE +3 -3
  2. package/esm/__version.d.ts +1 -1
  3. package/esm/__version.d.ts.map +1 -1
  4. package/esm/__version.js +1 -1
  5. package/esm/__version.js.map +1 -1
  6. package/esm/presentation/widget/richText/EditModeDashboardRichText.d.ts.map +1 -1
  7. package/esm/presentation/widget/richText/EditModeDashboardRichText.js +3 -4
  8. package/esm/presentation/widget/richText/EditModeDashboardRichText.js.map +1 -1
  9. package/esm/presentation/widget/richText/ViewModeDashboardRichText.d.ts.map +1 -1
  10. package/esm/presentation/widget/richText/ViewModeDashboardRichText.js +2 -2
  11. package/esm/presentation/widget/richText/ViewModeDashboardRichText.js.map +1 -1
  12. package/esm/presentation/widget/widget/RichTextWidget/DefaultDashboardRichTextWidget.js +1 -1
  13. package/esm/presentation/widget/widget/RichTextWidget/DefaultDashboardRichTextWidget.js.map +1 -1
  14. package/esm/presentation/widget/widget/RichTextWidget/EditableDashboardRichTextWidget.js +1 -1
  15. package/esm/presentation/widget/widget/RichTextWidget/EditableDashboardRichTextWidget.js.map +1 -1
  16. package/package.json +15 -16
  17. package/styles/css/main.css +121 -72
  18. package/styles/css/main.css.map +1 -1
  19. package/styles/css/richTextWidget.css +88 -0
  20. package/styles/css/richTextWidget.css.map +1 -0
  21. package/styles/scss/main.scss +2 -1
  22. package/styles/scss/{richText.scss → richTextWidget.scss} +8 -74
  23. package/esm/presentation/widget/richText/RichText.d.ts +0 -11
  24. package/esm/presentation/widget/richText/RichText.d.ts.map +0 -1
  25. package/esm/presentation/widget/richText/RichText.js +0 -39
  26. package/esm/presentation/widget/richText/RichText.js.map +0 -1
  27. package/styles/css/richText.css +0 -145
  28. package/styles/css/richText.css.map +0 -1
@@ -5,7 +5,7 @@
5
5
  @use "@gooddata/sdk-ui-kit/styles/scss/mixins" as mx;
6
6
  @use "variables";
7
7
 
8
- .gd-rich-text-wrapper {
8
+ .gd-rich-text-widget-wrapper {
9
9
  width: 100%;
10
10
  height: 100%;
11
11
  display: flex;
@@ -17,95 +17,29 @@
17
17
  top: 0;
18
18
  }
19
19
 
20
- .gd-rich-text-content {
21
- width: 100%;
22
- height: 100%;
20
+ .gd-rich-text-widget {
23
21
  padding: 5px;
24
22
  border-radius: variables.$gd-dashboards-content-widget-borderRadius;
25
- min-height: 0;
26
23
 
27
24
  textarea {
28
- width: 100%;
29
- height: 100%;
30
25
  background-color: var(--gd-chart-backgroundColor, var(--gd-palette-complementary-0, #fff));
31
26
  line-height: 19px;
32
27
  font-size: 14px;
33
28
  font-weight: 400;
34
29
  font-family: kit-variables.$measure_sequence_number_font;
35
30
  color: kit-variables.$gd-color-text;
36
- border: none;
37
- resize: none;
38
- outline: none;
39
- }
40
-
41
- .gd-rich-text-content-empty {
42
- width: 100%;
43
- height: 100%;
44
- display: flex;
45
- justify-content: center;
46
- align-items: center;
47
- }
48
- }
49
-
50
- .gd-rich-text-content-view {
51
- // styles for markdown elements
52
- * {
53
- margin-top: 0;
54
- color: var(--gd-palette-complementary-6, #94a1ad);
55
31
  }
56
32
 
57
- a {
58
- cursor: pointer;
59
- color: var(--gd-palette-primary-base, #14b2e2);
60
- text-decoration: none;
61
-
62
- @include mx.active-states {
63
- color: var(--gd-palette-complementary-8, #464e56);
64
- text-decoration: underline;
33
+ .gd-rich-text-content-view {
34
+ h1,
35
+ h2,
36
+ h3 {
37
+ color: var(--gd-dashboards-title-color, var(--gd-palette-complementary-8, #464e56));
65
38
  }
66
39
  }
67
-
68
- h1,
69
- h2,
70
- h3 {
71
- color: var(--gd-dashboards-title-color, var(--gd-palette-complementary-8, #464e56));
72
- font-weight: 700;
73
- text-align: left;
74
- letter-spacing: 0;
75
- }
76
-
77
- h1 {
78
- font-size: 17px;
79
- line-height: 23px;
80
- }
81
-
82
- h2 {
83
- font-size: 15px;
84
- line-height: 20px;
85
- }
86
-
87
- h3 {
88
- font-size: 14px;
89
- line-height: 19px;
90
- }
91
-
92
- p,
93
- ul,
94
- ol {
95
- font-size: 14px;
96
- font-weight: 400;
97
- line-height: 19px;
98
- letter-spacing: 0;
99
- text-align: left;
100
- }
101
-
102
- hr {
103
- border-top: 0;
104
- border-bottom: 1px solid var(--gd-palette-complementary-3, #dde4eb);
105
- }
106
40
  }
107
41
 
108
- .gd-rich-text-footer {
42
+ .gd-rich-text-widget-footer {
109
43
  padding: 0 4px;
110
44
  display: flex;
111
45
  justify-content: space-between;
@@ -1,11 +0,0 @@
1
- import React from "react";
2
- interface IRichTextProps {
3
- text: string;
4
- onChange?: (text: string) => void;
5
- editMode?: boolean;
6
- editPlaceholder?: string;
7
- emptyElement?: JSX.Element;
8
- }
9
- export declare const RichText: React.FC<IRichTextProps>;
10
- export {};
11
- //# sourceMappingURL=RichText.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RichText.d.ts","sourceRoot":"","sources":["../../../../src/presentation/widget/richText/RichText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,UAAU,cAAc;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CAC9B;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA4B7C,CAAC"}
@@ -1,39 +0,0 @@
1
- // (C) 2023-2024 GoodData Corporation
2
- import React from "react";
3
- import Markdown from "react-markdown";
4
- import cx from "classnames";
5
- const RICH_TEXT_PLACEHOLDER = `Add markdown text here...\n
6
- # Heading 1
7
- **Bold**
8
- * List
9
- [link](http://thisisalink.com)
10
- ![image](http://url/img.png)
11
- `;
12
- export const RichText = ({ text, onChange, editMode = false, editPlaceholder, emptyElement, }) => {
13
- return (React.createElement("div", { className: cx([
14
- "gd-rich-text-content",
15
- `gd-rich-text-content-${editMode ? "edit" : "view"}`,
16
- "s-rich-text",
17
- `s-rich-text-${editMode ? "edit" : "view"}`,
18
- { "gd-visible-scrollbar": !editMode },
19
- ]) }, editMode ? (React.createElement(RichTextEdit, { text: text, onChange: (updatedText) => onChange?.(updatedText), placeholder: editPlaceholder })) : (React.createElement(RichTextView, { text: text, emptyElement: emptyElement }))));
20
- };
21
- const RichTextEdit = ({ text, onChange, placeholder = RICH_TEXT_PLACEHOLDER, rows = 10, }) => {
22
- const moveCaretToEnd = (event) => {
23
- const { value } = event.target;
24
- const position = value.length;
25
- event.target.setSelectionRange(position, position);
26
- };
27
- return (React.createElement("textarea", { className: "gd-visible-scrollbar", value: text, autoFocus: true, placeholder: placeholder, onChange: (event) => onChange(event.target.value), rows: rows, onFocus: moveCaretToEnd }));
28
- };
29
- const ImageComponent = (props) => React.createElement("img", { style: { maxWidth: "100%" }, ...props });
30
- const AnchorComponent = (props) => React.createElement("a", { target: "_blank", rel: "noopener noreferrer", ...props });
31
- const RichTextView = ({ text, emptyElement }) => {
32
- // Strip all whitespace and newlines
33
- const isTextEmpty = !text?.replace(/\s/g, "");
34
- if (isTextEmpty && emptyElement) {
35
- return React.createElement("div", { className: "gd-rich-text-content-empty" }, emptyElement);
36
- }
37
- return React.createElement(Markdown, { components: { img: ImageComponent, a: AnchorComponent } }, text);
38
- };
39
- //# sourceMappingURL=RichText.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RichText.js","sourceRoot":"","sources":["../../../../src/presentation/widget/richText/RichText.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,MAAM,qBAAqB,GAAG;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,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACjD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,cAAc,GACzB,CACL,CAAC;AACN,CAAC,CAAC;AAOF,MAAM,cAAc,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,6BAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAM,KAAK,GAAI,CAAC;AAEvF,MAAM,eAAe,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,2BAAG,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,KAAK,KAAK,GAAI,CAAC;AAEnG,MAAM,YAAY,GAAiC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE;IAC1E,oCAAoC;IACpC,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAE9C,IAAI,WAAW,IAAI,YAAY,EAAE,CAAC;QAC9B,OAAO,6BAAK,SAAS,EAAC,4BAA4B,IAAE,YAAY,CAAO,CAAC;IAC5E,CAAC;IAED,OAAO,oBAAC,QAAQ,IAAC,UAAU,EAAE,EAAE,GAAG,EAAE,cAAc,EAAE,CAAC,EAAE,eAAe,EAAE,IAAG,IAAI,CAAY,CAAC;AAChG,CAAC,CAAC"}
@@ -1,145 +0,0 @@
1
- /* ==========================================================================
2
- Variables
3
- ========================================================================== */
4
- /* allow vendor prefixes and disable max length */
5
- /* allow vendor prefixes and disable max length */
6
- /* ==========================================================================
7
- Variables, mixins, silent classes etc.
8
- ========================================================================== */
9
- .gd-rich-text-wrapper {
10
- width: 100%;
11
- height: 100%;
12
- display: flex;
13
- flex-direction: column;
14
- overflow-x: hidden;
15
- overflow-y: auto;
16
- position: absolute;
17
- left: 0;
18
- top: 0;
19
- }
20
-
21
- .gd-rich-text-content {
22
- width: 100%;
23
- height: 100%;
24
- padding: 5px;
25
- border-radius: var(--gd-dashboards-content-widget-borderRadius, 15px);
26
- min-height: 0;
27
- }
28
- .gd-rich-text-content textarea {
29
- width: 100%;
30
- height: 100%;
31
- background-color: var(--gd-chart-backgroundColor, var(--gd-palette-complementary-0, #fff));
32
- line-height: 19px;
33
- font-size: 14px;
34
- font-weight: 400;
35
- font-family: menlo, monaco, consolas, "Courier New", monospace;
36
- color: var(--gd-palette-complementary-8, #464e56);
37
- border: none;
38
- resize: none;
39
- outline: none;
40
- }
41
- .gd-rich-text-content .gd-rich-text-content-empty {
42
- width: 100%;
43
- height: 100%;
44
- display: flex;
45
- justify-content: center;
46
- align-items: center;
47
- }
48
-
49
- .gd-rich-text-content-view * {
50
- margin-top: 0;
51
- color: var(--gd-palette-complementary-6, #94a1ad);
52
- }
53
- .gd-rich-text-content-view a {
54
- cursor: pointer;
55
- color: var(--gd-palette-primary-base, #14b2e2);
56
- text-decoration: none;
57
- }
58
- .gd-rich-text-content-view a:hover, .gd-rich-text-content-view a:focus, .gd-rich-text-content-view a:active {
59
- color: var(--gd-palette-complementary-8, #464e56);
60
- text-decoration: underline;
61
- }
62
- .gd-rich-text-content-view h1,
63
- .gd-rich-text-content-view h2,
64
- .gd-rich-text-content-view h3 {
65
- color: var(--gd-dashboards-title-color, var(--gd-palette-complementary-8, #464e56));
66
- font-weight: 700;
67
- text-align: left;
68
- letter-spacing: 0;
69
- }
70
- .gd-rich-text-content-view h1 {
71
- font-size: 17px;
72
- line-height: 23px;
73
- }
74
- .gd-rich-text-content-view h2 {
75
- font-size: 15px;
76
- line-height: 20px;
77
- }
78
- .gd-rich-text-content-view h3 {
79
- font-size: 14px;
80
- line-height: 19px;
81
- }
82
- .gd-rich-text-content-view p,
83
- .gd-rich-text-content-view ul,
84
- .gd-rich-text-content-view ol {
85
- font-size: 14px;
86
- font-weight: 400;
87
- line-height: 19px;
88
- letter-spacing: 0;
89
- text-align: left;
90
- }
91
- .gd-rich-text-content-view hr {
92
- border-top: 0;
93
- border-bottom: 1px solid var(--gd-palette-complementary-3, #dde4eb);
94
- }
95
-
96
- .gd-rich-text-footer {
97
- padding: 0 4px;
98
- display: flex;
99
- justify-content: space-between;
100
- flex-wrap: nowrap;
101
- overflow: hidden;
102
- height: 40px;
103
- min-height: 40px;
104
- }
105
- .gd-rich-text-footer .gd-divider {
106
- margin: 4px;
107
- height: 20px;
108
- border-left: 1px solid var(--gd-palette-complementary-3, #dde4eb);
109
- }
110
- .gd-rich-text-footer .gd-rich-text-footer-options {
111
- display: flex;
112
- flex-direction: row;
113
- flex-wrap: wrap;
114
- overflow: hidden;
115
- align-items: center;
116
- }
117
- .gd-rich-text-footer .gd-rich-text-footer-options .gd-button-link-dimmed::before {
118
- top: 6px;
119
- }
120
- .gd-rich-text-footer .gd-rich-text-footer-options .gd-button-link-dimmed:focus {
121
- color: var(--gd-palette-complementary-7, #778491);
122
- }
123
- .gd-rich-text-footer .gd-rich-text-footer-options .gd-button-link-dimmed:hover {
124
- color: var(--gd-palette-complementary-8, #464e56);
125
- }
126
- .gd-rich-text-footer .gd-rich-text-footer-options .gd-button-link-dimmed:hover::before {
127
- color: var(--gd-palette-complementary-8, #464e56);
128
- }
129
- .gd-rich-text-footer .gd-rich-text-footer-actions {
130
- display: flex;
131
- flex-direction: row;
132
- align-items: center;
133
- }
134
- .gd-rich-text-footer .gd-rich-text-footer-actions .gd-button-link.gd-button-icon-only.gd-icon-trash:hover::before {
135
- color: var(--gd-palette-error-base, #e54d42);
136
- }
137
-
138
- .gd-rich-text-widget-empty-content {
139
- display: flex;
140
- flex-direction: column;
141
- align-items: center;
142
- gap: 8px;
143
- }
144
-
145
- /*# sourceMappingURL=richText.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sourceRoot":"","sources":["../../node_modules/@gooddata/sdk-ui-kit/styles/scss/Button/_variables.scss","../../node_modules/@gooddata/sdk-ui-kit/styles/scss/mixins.scss","../../node_modules/@gooddata/sdk-ui-kit/styles/scss/Bubble/_variables.scss","../scss/richText.scss","../scss/_variables.scss","../../node_modules/@gooddata/sdk-ui-kit/styles/scss/variables.scss"],"names":[],"mappings":"AAIA;AAAA;AAAA;ACsHA;AA4DA;ACjLA;AAAA;AAAA;ACEA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA,eCuFwC;EDtFxC;;AAEA;EACI;EACA;EACA;EACA;EACA;EACA;EACA,aEgKuB;EF/JvB,OEJQ;EFKR;EACA;EACA;;AAGJ;EACI;EACA;EACA;EACA;EACA;;;AAMJ;EACI;EACA;;AAGJ;EACI;EACA;EACA;;AF2GJ;EExGQ;EACA;;AAIR;AAAA;AAAA;EAGI;EACA;EACA;EACA;;AAGJ;EACI;EACA;;AAGJ;EACI;EACA;;AAGJ;EACI;EACA;;AAGJ;AAAA;AAAA;EAGI;EACA;EACA;EACA;EACA;;AAGJ;EACI;EACA;;;AAIR;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;;AAGJ;EACI;EACA;EACA;EACA;EACA;;AAEA;EACI;;AAGJ;EACI,OHrHU;;AGwHd;EACI,OE5GI;;AF+GR;EACI,OEhHI;;AFoHZ;EACI;EACA;EACA;;AAEA;EACI,OE9FY;;;AFmGxB;EACI;EACA;EACA;EACA","file":"richText.css"}