@prokodo/ui 0.1.10 → 0.1.11
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/README.md +1 -0
- package/dist/_virtual/_commonjsHelpers.js +2 -0
- package/dist/_virtual/quill.js +34 -0
- package/dist/_virtual/quill2.js +4 -0
- package/dist/components/RTE/RTE.client.js +326 -0
- package/dist/components/RTE/RTE.css +253 -0
- package/dist/components/RTE/RTE.js +12 -0
- package/dist/components/RTE/RTE.lazy.js +12 -0
- package/dist/components/RTE/RTE.module.css +253 -0
- package/dist/components/RTE/RTE.module.scss.js +19 -0
- package/dist/components/RTE/RTE.server.js +19 -0
- package/dist/components/RTE/RTE.styles.js +21 -0
- package/dist/components/RTE/RTE.theme.js +4 -0
- package/dist/components/RTE/RTE.utils.js +51 -0
- package/dist/components/RTE/RTE.view.js +107 -0
- package/dist/components/RTE/index.js +4 -0
- package/dist/components/avatar/Avatar.css +1 -3
- package/dist/components/avatar/Avatar.module.css +1 -3
- package/dist/components/avatar/Avatar.view.js +30 -17
- package/dist/components/base-link/BaseLink.client.js +11 -1
- package/dist/components/button/Button.view.js +1 -0
- package/dist/components/card/Card.css +1 -1
- package/dist/components/card/Card.module.css +1 -1
- package/dist/components/chip/Chip.css +2 -2
- package/dist/components/chip/Chip.module.css +2 -2
- package/dist/components/chip/Chip.view.js +1 -1
- package/dist/components/input/Input.view.js +21 -13
- package/dist/components/rich-text/RichText.client.js +31 -0
- package/dist/components/rich-text/RichText.css +13 -1
- package/dist/components/rich-text/RichText.module.css +13 -1
- package/dist/components/rich-text/RichText.module.scss.js +2 -0
- package/dist/components/rich-text/RichText.server.js +1 -0
- package/dist/constants/project.js +1 -1
- package/dist/index.js +2 -0
- package/dist/node_modules/.pnpm/quill@2.0.3/node_modules/quill/dist/quill.js +6133 -0
- package/dist/node_modules/.pnpm/quill@2.0.3/node_modules/quill/dist/quill.snow.css.js +12 -0
- package/dist/theme.css +19 -7
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/RTE/RTE.client.d.ts +6 -0
- package/dist/types/components/RTE/RTE.d.ts +339 -0
- package/dist/types/components/RTE/RTE.lazy.d.ts +340 -0
- package/dist/types/components/RTE/RTE.model.d.ts +17 -0
- package/dist/types/components/RTE/RTE.server.d.ts +3 -0
- package/dist/types/components/RTE/RTE.styles.d.ts +1 -0
- package/dist/types/components/RTE/RTE.theme.d.ts +2 -0
- package/dist/types/components/RTE/RTE.utils.d.ts +4 -0
- package/dist/types/components/RTE/RTE.view.d.ts +11 -0
- package/dist/types/components/RTE/index.d.ts +2 -0
- package/dist/types/components/avatar/Avatar.model.d.ts +1 -1
- package/dist/types/components/input/Input.model.d.ts +13 -1
- package/dist/types/components/input/Input.view.d.ts +1 -1
- package/dist/types/components/rich-text/RichText.client.d.ts +1 -1
- package/dist/types/components/rich-text/RichText.d.ts +1 -0
- package/dist/types/components/rich-text/RichText.lazy.d.ts +1 -0
- package/dist/types/components/rich-text/RichText.model.d.ts +1 -0
- package/dist/types/helpers/validations.d.ts +2 -2
- package/dist/types/index.d.ts +1 -0
- package/package.json +7 -1
|
@@ -32,6 +32,7 @@ function InputView({
|
|
|
32
32
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
33
33
|
maxRows,
|
|
34
34
|
type = "text",
|
|
35
|
+
renderNode,
|
|
35
36
|
...rest
|
|
36
37
|
}) {
|
|
37
38
|
rest == null ? true : delete rest.onValidate;
|
|
@@ -43,6 +44,11 @@ function InputView({
|
|
|
43
44
|
const errorId = isError ? `${name}-error` : void 0;
|
|
44
45
|
const helperId = !isError && hasHelperText ? `${name}-helper` : void 0;
|
|
45
46
|
const describedBy = [errorId, helperId].filter(Boolean).join(" ") || void 0;
|
|
47
|
+
const nodeClassName = bem(
|
|
48
|
+
"input__node",
|
|
49
|
+
{ multiline: Boolean(multiline) },
|
|
50
|
+
inputClassName
|
|
51
|
+
);
|
|
46
52
|
return /* @__PURE__ */ jsxs("div", { className: bem(void 0, void 0, className), children: [
|
|
47
53
|
/* @__PURE__ */ jsxs("div", { className: bem("inner"), children: [
|
|
48
54
|
typeof label === "string" && /* @__PURE__ */ jsx(
|
|
@@ -75,7 +81,17 @@ function InputView({
|
|
|
75
81
|
},
|
|
76
82
|
inputContainerClassName
|
|
77
83
|
),
|
|
78
|
-
children:
|
|
84
|
+
children: typeof renderNode === "function" ? renderNode({
|
|
85
|
+
id: name,
|
|
86
|
+
name,
|
|
87
|
+
disabled,
|
|
88
|
+
required,
|
|
89
|
+
readOnly: rest == null ? void 0 : rest.readOnly,
|
|
90
|
+
placeholder,
|
|
91
|
+
isError,
|
|
92
|
+
describedBy,
|
|
93
|
+
nodeClassName
|
|
94
|
+
}) : Boolean(multiline) ? /* @__PURE__ */ jsx(
|
|
79
95
|
"textarea",
|
|
80
96
|
{
|
|
81
97
|
...rest,
|
|
@@ -83,18 +99,14 @@ function InputView({
|
|
|
83
99
|
"aria-describedby": describedBy,
|
|
84
100
|
"aria-invalid": isError,
|
|
85
101
|
"aria-required": required,
|
|
102
|
+
className: nodeClassName,
|
|
86
103
|
disabled,
|
|
87
104
|
id: name,
|
|
88
105
|
name,
|
|
89
106
|
placeholder,
|
|
90
107
|
required: Boolean(required),
|
|
91
108
|
rows,
|
|
92
|
-
value: value ?? ""
|
|
93
|
-
className: bem(
|
|
94
|
-
"input__node",
|
|
95
|
-
{ multiline: true },
|
|
96
|
-
inputClassName
|
|
97
|
-
)
|
|
109
|
+
value: value ?? ""
|
|
98
110
|
}
|
|
99
111
|
) : /* @__PURE__ */ jsx(
|
|
100
112
|
"input",
|
|
@@ -104,18 +116,14 @@ function InputView({
|
|
|
104
116
|
"aria-describedby": describedBy,
|
|
105
117
|
"aria-invalid": isError,
|
|
106
118
|
"aria-required": required,
|
|
119
|
+
className: nodeClassName,
|
|
107
120
|
disabled,
|
|
108
121
|
id: name,
|
|
109
122
|
name,
|
|
110
123
|
placeholder,
|
|
111
124
|
required: Boolean(required),
|
|
112
125
|
type,
|
|
113
|
-
value: value ?? ""
|
|
114
|
-
className: bem(
|
|
115
|
-
"input__node",
|
|
116
|
-
{ multiline: false },
|
|
117
|
-
inputClassName
|
|
118
|
-
)
|
|
126
|
+
value: value ?? ""
|
|
119
127
|
}
|
|
120
128
|
)
|
|
121
129
|
}
|
|
@@ -9,6 +9,7 @@ import { create } from "../../helpers/bem.js";
|
|
|
9
9
|
import { isString } from "../../helpers/validations.js";
|
|
10
10
|
import styles from "./RichText.module.scss.js";
|
|
11
11
|
import { Icon } from "../icon/Icon.js";
|
|
12
|
+
import { Image } from "../image/Image.js";
|
|
12
13
|
import { Link } from "../link/Link.js";
|
|
13
14
|
import { Headline } from "../headline/Headline.js";
|
|
14
15
|
import { AnimatedText } from "../animatedText/AnimatedText.js";
|
|
@@ -86,6 +87,7 @@ function RichTextClient({
|
|
|
86
87
|
className,
|
|
87
88
|
overrideParagraph,
|
|
88
89
|
codeTheme,
|
|
90
|
+
linkPolicy = "trusted",
|
|
89
91
|
...props
|
|
90
92
|
}) {
|
|
91
93
|
const containerRef = useRef(null);
|
|
@@ -250,6 +252,19 @@ function RichTextClient({
|
|
|
250
252
|
const href = elem.getAttribute("href") ?? "#";
|
|
251
253
|
const title = elem.getAttribute("title") ?? void 0;
|
|
252
254
|
const linkText = normalize(keyedChildren.map(renderAnimation));
|
|
255
|
+
const isHttp = /^https?:\/\//i.test(href);
|
|
256
|
+
const isExternalHttp = isHttp;
|
|
257
|
+
let target = void 0;
|
|
258
|
+
let rel = void 0;
|
|
259
|
+
if (linkPolicy === "ugc") {
|
|
260
|
+
rel = isExternalHttp ? "ugc nofollow noopener" : "ugc nofollow";
|
|
261
|
+
target = isExternalHttp ? "_blank" : void 0;
|
|
262
|
+
} else {
|
|
263
|
+
const htmlTarget = elem.getAttribute("target") ?? void 0;
|
|
264
|
+
const wantsBlank = htmlTarget === "_blank";
|
|
265
|
+
target = wantsBlank ? "_blank" : void 0;
|
|
266
|
+
rel = wantsBlank ? "noopener" : void 0;
|
|
267
|
+
}
|
|
253
268
|
return /* @__PURE__ */ jsx(
|
|
254
269
|
Link,
|
|
255
270
|
{
|
|
@@ -258,6 +273,8 @@ function RichTextClient({
|
|
|
258
273
|
className: cls,
|
|
259
274
|
href,
|
|
260
275
|
linkComponent,
|
|
276
|
+
rel,
|
|
277
|
+
target,
|
|
261
278
|
title,
|
|
262
279
|
variant: "primary",
|
|
263
280
|
children: linkText
|
|
@@ -282,6 +299,20 @@ function RichTextClient({
|
|
|
282
299
|
}
|
|
283
300
|
);
|
|
284
301
|
}
|
|
302
|
+
case "img": {
|
|
303
|
+
const existing = elem.getAttribute("class");
|
|
304
|
+
const src2 = elem.getAttribute("src");
|
|
305
|
+
const alt = elem.getAttribute("alt");
|
|
306
|
+
return /* @__PURE__ */ jsx("span", { className: bem("image__wrapper"), children: /* @__PURE__ */ jsx(
|
|
307
|
+
Image,
|
|
308
|
+
{
|
|
309
|
+
fill: true,
|
|
310
|
+
alt: alt ?? "",
|
|
311
|
+
className: [bem("image"), existing].filter(Boolean).join(" "),
|
|
312
|
+
src: src2 ?? ""
|
|
313
|
+
}
|
|
314
|
+
) });
|
|
315
|
+
}
|
|
285
316
|
case "ul": {
|
|
286
317
|
const cls = bem("ul");
|
|
287
318
|
return /* @__PURE__ */ jsx("ul", { className: cls, children: keyedChildren });
|
|
@@ -189,7 +189,6 @@ html[data-theme=dark] .prokodo-RichText__p {
|
|
|
189
189
|
text-align: inherit;
|
|
190
190
|
}
|
|
191
191
|
html[data-theme=dark] .prokodo-RichText__pre {
|
|
192
|
-
color: var(--color-grey-300);
|
|
193
192
|
background-color: var(--color-grey-50);
|
|
194
193
|
}
|
|
195
194
|
.prokodo-RichText__blockquote {
|
|
@@ -198,6 +197,19 @@ html[data-theme=dark] .prokodo-RichText__pre {
|
|
|
198
197
|
padding: 1px 1rem;
|
|
199
198
|
margin: 0;
|
|
200
199
|
}
|
|
200
|
+
.prokodo-RichText__image {
|
|
201
|
+
-o-object-fit: cover;
|
|
202
|
+
object-fit: cover;
|
|
203
|
+
border-radius: 13px;
|
|
204
|
+
}
|
|
205
|
+
.prokodo-RichText__image__wrapper {
|
|
206
|
+
position: relative;
|
|
207
|
+
display: block;
|
|
208
|
+
width: 100%;
|
|
209
|
+
height: 300px;
|
|
210
|
+
overflow: hidden;
|
|
211
|
+
border-radius: 13px;
|
|
212
|
+
}
|
|
201
213
|
.prokodo-RichText__ul, .prokodo-RichText__ol {
|
|
202
214
|
padding: 0;
|
|
203
215
|
list-style-type: none;
|
|
@@ -189,7 +189,6 @@ html[data-theme=dark] .prokodo-RichText__p {
|
|
|
189
189
|
text-align: inherit;
|
|
190
190
|
}
|
|
191
191
|
html[data-theme=dark] .prokodo-RichText__pre {
|
|
192
|
-
color: var(--color-grey-300);
|
|
193
192
|
background-color: var(--color-grey-50);
|
|
194
193
|
}
|
|
195
194
|
.prokodo-RichText__blockquote {
|
|
@@ -198,6 +197,19 @@ html[data-theme=dark] .prokodo-RichText__pre {
|
|
|
198
197
|
padding: 1px 1rem;
|
|
199
198
|
margin: 0;
|
|
200
199
|
}
|
|
200
|
+
.prokodo-RichText__image {
|
|
201
|
+
-o-object-fit: cover;
|
|
202
|
+
object-fit: cover;
|
|
203
|
+
border-radius: 13px;
|
|
204
|
+
}
|
|
205
|
+
.prokodo-RichText__image__wrapper {
|
|
206
|
+
position: relative;
|
|
207
|
+
display: block;
|
|
208
|
+
width: 100%;
|
|
209
|
+
height: 300px;
|
|
210
|
+
overflow: hidden;
|
|
211
|
+
border-radius: 13px;
|
|
212
|
+
}
|
|
201
213
|
.prokodo-RichText__ul, .prokodo-RichText__ol {
|
|
202
214
|
padding: 0;
|
|
203
215
|
list-style-type: none;
|
|
@@ -3,6 +3,8 @@ const styles = {
|
|
|
3
3
|
"prokodo-RichText__p": "prokodo-RichText__p",
|
|
4
4
|
"prokodo-RichText__pre": "prokodo-RichText__pre",
|
|
5
5
|
"prokodo-RichText__blockquote": "prokodo-RichText__blockquote",
|
|
6
|
+
"prokodo-RichText__image": "prokodo-RichText__image",
|
|
7
|
+
"prokodo-RichText__image__wrapper": "prokodo-RichText__image__wrapper",
|
|
6
8
|
"prokodo-RichText__ul": "prokodo-RichText__ul",
|
|
7
9
|
"prokodo-RichText__ol": "prokodo-RichText__ol",
|
|
8
10
|
"prokodo-RichText__li": "prokodo-RichText__li",
|
package/dist/index.js
CHANGED
|
@@ -37,6 +37,7 @@ import { ProgressBar } from "./components/progressBar/ProgressBar.js";
|
|
|
37
37
|
import { Quote } from "./components/quote/Quote.js";
|
|
38
38
|
import { Rating } from "./components/rating/Rating.js";
|
|
39
39
|
import { RichText } from "./components/rich-text/RichText.js";
|
|
40
|
+
import { RTE } from "./components/RTE/RTE.js";
|
|
40
41
|
import { Select } from "./components/select/Select.js";
|
|
41
42
|
import { SideNav } from "./components/sidenav/SideNav.js";
|
|
42
43
|
import { Skeleton } from "./components/skeleton/Skeleton.js";
|
|
@@ -83,6 +84,7 @@ export {
|
|
|
83
84
|
PostWidgetCarousel,
|
|
84
85
|
ProgressBar,
|
|
85
86
|
Quote,
|
|
87
|
+
RTE,
|
|
86
88
|
Rating,
|
|
87
89
|
RichText,
|
|
88
90
|
Select,
|