@mrshmllw/smores-react 6.2.0 → 6.2.1
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/dist/Box/Box.d.ts
CHANGED
@@ -2,4 +2,4 @@ import { FlexProps } from '../utils/flex';
|
|
2
2
|
import { MeasureProps } from '../utils/measure';
|
3
3
|
import { MarginProps, PaddingProps } from '../utils/space';
|
4
4
|
export type BoxProps = MarginProps & PaddingProps & FlexProps & MeasureProps;
|
5
|
-
export declare const Box: import("styled-components").StyledComponent<"div", any,
|
5
|
+
export declare const Box: import("styled-components").StyledComponent<"div", any, BoxProps, never>;
|
@@ -20,18 +20,4 @@ export type RadioGroupProps<Value extends BaseValueType = BaseValueType> = {
|
|
20
20
|
export type RadioGroupElement = {
|
21
21
|
focus: VoidFunction;
|
22
22
|
};
|
23
|
-
export declare const RadioGroup: <Value extends BaseValueType = BaseValueType>(p:
|
24
|
-
options: {
|
25
|
-
visual?: string | undefined;
|
26
|
-
icon?: "link" | "filter" | "key" | "id" | "property" | "security" | "search" | "at" | "amex" | "axa" | "breakdown" | "earth" | "help-aboutus" | "injury" | "onfido" | "rac" | "renewal" | "stack" | "aa-inverted" | "accidental-damage" | "account-breakdown" | "account-mlp" | "activity-clipboard" | "add-ons" | "address-mta" | "album-audio" | "alert-engine" | "apple-pay" | "approved-file" | "breakdown-alt" | "cancel-bw" | "car-mta" | "car-repairs" | "car-replacement" | "car-usage" | "chat-bubble" | "checkout-with-text" | "circle-tick" | "claim-line" | "clipboard-check" | "close-panel" | "confused-blue" | "contact-email" | "dashboard-high" | "direct-debit" | "doc-download" | "doc-upload" | "edit-contact" | "edit-outline" | "email-filled" | "falling-items" | "file-badge-2" | "file-cabinet" | "fraud-alert" | "freezer-food" | "google-play-badge" | "help-buypolicy" | "help-center" | "help-idcheck" | "help-manage-policy" | "help-ncd" | "help-verification" | "home-excluded" | "house-tree" | "ios-store-badge" | "live-chat" | "live-chat2" | "log-out" | "manage-drivers" | "manage-policy" | "maximise-window" | "minus-circle" | "money-bag" | "money-heart" | "more-dots" | "new-window" | "no-excess" | "open-panel" | "out-of-home" | "padlock-outline" | "phone-filled" | "phone-outline" | "pin-code" | "plus-circle" | "policy-details" | "policy-doc" | "policy-docs" | "pound-bold" | "pound-filled-circle" | "pound-medium" | "pound-outline" | "pound-regular" | "question-help" | "refer-a-friend" | "reg-plate" | "renewal-line" | "repeat-charge" | "schedule-quote" | "send-message" | "shield-check" | "thumbs-up" | "tow-truck" | "trace-and-access" | "up-down" | "upload-documents" | "upload-email" | "wheel-flat" | "windscreen-repair" | "windscreen-replacement" | "aa" | "addons" | "alert" | "arrow" | "bank" | "basket" | "bicycle" | "boost" | "briefcase" | "burger" | "bullets" | "calendar" | "camera" | "cancel" | "car" | "card" | "caret" | "charge" | "chat" | "checkout" | "city" | "claim" | "clipboard" | "clock" | "collpase" | "confused" | "copy" | "crop" | "cross" | "download" | "edit" | "engine" | "europe" | "excluded" | "expand" | "facebook" | "fence" | "file" | "fire" | "flag" | "folder" | "fuel" | "globe" | "gpay" | "house" | "inbox" | "included" | "info" | "instagram" | "intercom" | "intercom2" | "iphone" | "jewellery" | "laptop" | "leaks" | "lightbulb" | "linkedin" | "location" | "marshmallow" | "mastercard" | "maximise" | "medical" | "minimise" | "minus" | "mulsanne" | "notes" | "notification" | "other" | "padlock" | "people" | "person" | "photo" | "plus" | "policy" | "premfina" | "profile" | "prohibited" | "ravelin" | "refund" | "return" | "settings" | "shield" | "shopping" | "sofa" | "storm" | "stripe" | "subsidence" | "theft" | "tick" | "training" | "trash" | "twitter" | "upload" | "vandalism" | "village" | "visa" | "warning" | "watch" | "wave" | "wellbeing" | "windscreen" | undefined;
|
27
|
-
iconPosition?: IconPosition | undefined;
|
28
|
-
label: string;
|
29
|
-
value: Value;
|
30
|
-
bodyCopy?: string | undefined;
|
31
|
-
}[];
|
32
|
-
onChange: (value: Value) => void;
|
33
|
-
onBlur?: ((e: FocusEvent<HTMLInputElement>) => void) | undefined;
|
34
|
-
value: Value;
|
35
|
-
displayType?: DisplayType | undefined;
|
36
|
-
fallbackStyle?: boolean | undefined;
|
37
|
-
} & CommonFieldProps & React.RefAttributes<HTMLInputElement>) => ReactElement | null;
|
23
|
+
export declare const RadioGroup: <Value extends BaseValueType = BaseValueType>(p: RadioGroupProps<Value> & React.RefAttributes<HTMLInputElement>) => ReactElement | null;
|
@@ -2,26 +2,26 @@ import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
3
3
|
import { Box } from '../Box';
|
4
4
|
import { theme } from '../theme';
|
5
|
-
import { RichTextPlugin } from
|
6
|
-
import { ContentEditable } from
|
7
|
-
import { LexicalComposer } from
|
8
|
-
import LexicalErrorBoundary from
|
5
|
+
import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin';
|
6
|
+
import { ContentEditable } from '@lexical/react/LexicalContentEditable';
|
7
|
+
import { LexicalComposer } from '@lexical/react/LexicalComposer';
|
8
|
+
import LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary';
|
9
9
|
import CustomAutoLinkPlugin from './plugins/AutoLinkPlugin';
|
10
|
-
import { AutoLinkNode, LinkNode } from
|
11
|
-
import { ListNode, ListItemNode } from
|
12
|
-
import { LinkPlugin } from
|
10
|
+
import { AutoLinkNode, LinkNode } from '@lexical/link';
|
11
|
+
import { ListNode, ListItemNode } from '@lexical/list';
|
12
|
+
import { LinkPlugin } from '@lexical/react/LexicalLinkPlugin';
|
13
13
|
import ToolbarPlugin from './plugins/ToolbarPlugin';
|
14
14
|
import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin';
|
15
15
|
import { ListPlugin } from '@lexical/react/LexicalListPlugin';
|
16
|
-
import { MarkdownShortcutPlugin } from
|
17
|
-
import { TRANSFORMERS } from
|
18
|
-
import { HeadingNode, QuoteNode } from
|
19
|
-
import { CodeHighlightNode, CodeNode } from
|
16
|
+
import { MarkdownShortcutPlugin } from '@lexical/react/LexicalMarkdownShortcutPlugin';
|
17
|
+
import { TRANSFORMERS } from '@lexical/markdown';
|
18
|
+
import { HeadingNode, QuoteNode } from '@lexical/rich-text';
|
19
|
+
import { CodeHighlightNode, CodeNode } from '@lexical/code';
|
20
20
|
import { $generateNodesFromDOM } from '@lexical/html';
|
21
21
|
import { $createParagraphNode, $getRoot } from 'lexical';
|
22
22
|
import DOMPurify from 'dompurify';
|
23
23
|
import { EditorUpdatePlugin } from './plugins/EditorUpdatePlugin';
|
24
|
-
export const RichTextEditor = ({ defaultValue, height, maxHeight =
|
24
|
+
export const RichTextEditor = ({ defaultValue, height, outline = false, maxHeight = '300px', onChange, ...props }) => {
|
25
25
|
const defaultEditorState = (editor) => {
|
26
26
|
const parser = new DOMParser();
|
27
27
|
const dom = parser.parseFromString(defaultValue ? DOMPurify.sanitize(defaultValue) : '<p></p>', 'text/html');
|
@@ -29,16 +29,16 @@ export const RichTextEditor = ({ defaultValue, height, maxHeight = "300px", onCh
|
|
29
29
|
const root = $getRoot();
|
30
30
|
root.clear();
|
31
31
|
nodes
|
32
|
-
.filter(node => node.__type !==
|
33
|
-
.map(node => {
|
34
|
-
if (node.__type ===
|
32
|
+
.filter((node) => node.__type !== 'linebreak')
|
33
|
+
.map((node) => {
|
34
|
+
if (node.__type === 'text') {
|
35
35
|
const paragraphNode = $createParagraphNode();
|
36
36
|
paragraphNode.append(node);
|
37
37
|
return paragraphNode;
|
38
38
|
}
|
39
39
|
return node;
|
40
40
|
})
|
41
|
-
.forEach(node => root.append(node));
|
41
|
+
.forEach((node) => root.append(node));
|
42
42
|
};
|
43
43
|
const initialConfig = {
|
44
44
|
editorState: defaultEditorState,
|
@@ -52,10 +52,10 @@ export const RichTextEditor = ({ defaultValue, height, maxHeight = "300px", onCh
|
|
52
52
|
HeadingNode,
|
53
53
|
QuoteNode,
|
54
54
|
CodeHighlightNode,
|
55
|
-
CodeNode
|
56
|
-
]
|
55
|
+
CodeNode,
|
56
|
+
],
|
57
57
|
};
|
58
|
-
return (React.createElement(Container, { ...props },
|
58
|
+
return (React.createElement(Container, { "$outline": outline, ...props },
|
59
59
|
React.createElement(Editor, { "$maxHeight": maxHeight, "$height": height },
|
60
60
|
React.createElement(LexicalComposer, { initialConfig: initialConfig },
|
61
61
|
React.createElement(ToolbarPlugin, null),
|
@@ -90,5 +90,6 @@ const Container = styled(Box) `
|
|
90
90
|
background-color: ${theme.colors.coconut};
|
91
91
|
border-radius: 16px;
|
92
92
|
padding: 12px;
|
93
|
+
${({ $outline }) => $outline && `border: 2px solid ${theme.colors.oatmeal}`}
|
93
94
|
`;
|
94
95
|
//# sourceMappingURL=RichTextEditor.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RichTextEditor.js","sourceRoot":"","sources":["../../src/RichTextEditor/RichTextEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AAEjC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,
|
1
|
+
{"version":3,"file":"RichTextEditor.js","sourceRoot":"","sources":["../../src/RichTextEditor/RichTextEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AAEjC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,oBAAoB,MAAM,qCAAqC,CAAA;AACtE,OAAO,oBAAoB,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,YAAY,E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AAC,oBAAoB,OAAG;gBACxB,oBAAC,sBAAsB,IAAC,YAAY,EAAE,YAAY,GAAI;gBACtD,oBAAC,kBAAkB,IAAC,QAAQ,EAAE,QAAQ,GAAI,CAC1B,CACX,CACC,CACb,CAAA;AACH,CAAC,CAAA;AAED,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAA0C;;;wBAG5C,KAAK,CAAC,MAAM,CAAC,KAAK;;wBAElB,KAAK,CAAC,MAAM,CAAC,OAAO;;;qBAGvB,KAAK,CAAC,MAAM,CAAC,QAAQ;kBACxB,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU;MAC1C,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,IAAI,WAAW,OAAO,EAAE;;;;;;;;CAQrD,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAuB;sBAC9B,KAAK,CAAC,MAAM,CAAC,OAAO;;;IAGtC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,IAAI,qBAAqB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE;CAC5E,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@mrshmllw/smores-react",
|
3
|
-
"version": "6.2.
|
3
|
+
"version": "6.2.1",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"description": "Collection of React components used by Marshmallow Technology",
|
6
6
|
"keywords": [
|
@@ -37,7 +37,6 @@
|
|
37
37
|
"@babel/preset-env": "^7.20.2",
|
38
38
|
"@babel/preset-react": "^7.18.6",
|
39
39
|
"@babel/preset-typescript": "^7.18.6",
|
40
|
-
"@lexical/react": "^0.13.1",
|
41
40
|
"@semantic-release/changelog": "^6.0.3",
|
42
41
|
"@semantic-release/git": "^10.0.1",
|
43
42
|
"@semantic-release/github": "^9.2.4",
|
@@ -80,6 +79,7 @@
|
|
80
79
|
"date-fns": "^2.16.1",
|
81
80
|
"dompurify": "^3.0.9",
|
82
81
|
"lexical": "^0.13.1",
|
82
|
+
"@lexical/react": "^0.13.1",
|
83
83
|
"polished": "^4.1.3"
|
84
84
|
},
|
85
85
|
"peerDependencies": {
|