@frontify/guideline-blocks-settings 2.0.0 → 2.0.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/components/Attachments/AttachmentItem.es.js +83 -83
- package/dist/components/Attachments/AttachmentItem.es.js.map +1 -1
- package/dist/components/Attachments/Attachments.es.js +51 -54
- package/dist/components/Attachments/Attachments.es.js.map +1 -1
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js +56 -57
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +25 -25
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js +3 -3
- package/dist/components/Link/LinkInput.es.js +35 -35
- package/dist/components/Link/LinkInput.es.js.map +1 -1
- package/dist/components/Link/LinkSelector/LinkSelector.es.js +31 -31
- package/dist/components/Link/LinkSelector/LinkSelector.es.js.map +1 -1
- package/dist/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.es.js +2 -5
- package/dist/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.es.js.map +1 -1
- package/dist/components/Link/utils/getUrl.es.js +9 -15
- package/dist/components/Link/utils/getUrl.es.js.map +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.es.js +39 -39
- package/dist/components/RichTextEditor/RichTextEditor.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js +24 -25
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js +6 -6
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js +25 -25
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js +29 -33
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js +6 -6
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js +22 -23
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js +61 -63
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js +6 -6
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js +6 -7
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js +21 -21
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.es.js +15 -19
- package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +5 -5
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js +13 -13
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +23 -23
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +7 -8
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js +23 -27
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js +6 -9
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +24 -28
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +24 -28
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +24 -28
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +24 -28
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +24 -28
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +24 -28
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +24 -28
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js +25 -29
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +25 -29
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +26 -30
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +26 -30
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -1
- package/dist/guideline-blocks-settings.css +1 -0
- package/dist/helpers/customCoordinatesGetterFactory.es.js +18 -18
- package/dist/helpers/customCoordinatesGetterFactory.es.js.map +1 -1
- package/dist/hooks/useAttachments.es.js +6 -6
- package/dist/hooks/useAttachments.es.js.map +1 -1
- package/dist/index.cjs.js +7 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +0 -15
- package/dist/index.es.js +208 -208
- package/dist/index.umd.js +7 -7
- package/dist/index.umd.js.map +1 -1
- package/dist/settings/background.es.js +4 -4
- package/dist/settings/background.es.js.map +1 -1
- package/dist/settings/border.es.js +17 -17
- package/dist/settings/border.es.js.map +1 -1
- package/dist/settings/borderRadius.es.js +12 -15
- package/dist/settings/borderRadius.es.js.map +1 -1
- package/dist/settings/borderRadiusExtended.es.js +25 -28
- package/dist/settings/borderRadiusExtended.es.js.map +1 -1
- package/dist/settings/gutter.es.js +17 -20
- package/dist/settings/gutter.es.js.map +1 -1
- package/dist/settings/margin.es.js +14 -14
- package/dist/settings/margin.es.js.map +1 -1
- package/dist/settings/marginExtended.es.js +29 -29
- package/dist/settings/marginExtended.es.js.map +1 -1
- package/dist/settings/padding.es.js +14 -14
- package/dist/settings/padding.es.js.map +1 -1
- package/dist/settings/paddingExtended.es.js +28 -28
- package/dist/settings/paddingExtended.es.js.map +1 -1
- package/dist/settings/securityDownloadable.es.js +8 -11
- package/dist/settings/securityDownloadable.es.js.map +1 -1
- package/dist/utilities/color/getReadableColor.es.js +6 -6
- package/dist/utilities/color/getReadableColor.es.js.map +1 -1
- package/dist/utilities/color/isDark.es.js +4 -4
- package/dist/utilities/color/isDark.es.js.map +1 -1
- package/package.json +16 -16
- package/dist/styles.css +0 -1
|
@@ -1,51 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
constructor({ styles: l = x.imageTitle, ...s } = {}) {
|
|
10
|
-
super(a.imageTitle, {
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Plugin as r, MarkupElement as o, createPluginFactory as g, merge as u, alignmentClassnames as c, getColumnBreakClasses as p } from "@frontify/fondue/rte";
|
|
3
|
+
import { TextStyles as s, BlockStyles as T } from "../styles.es.js";
|
|
4
|
+
const y = "textstyle-imageTitle-plugin";
|
|
5
|
+
class C extends r {
|
|
6
|
+
styles = {};
|
|
7
|
+
constructor({ styles: e = T.imageTitle, ...l } = {}) {
|
|
8
|
+
super(s.imageTitle, {
|
|
11
9
|
label: "Image Title",
|
|
12
|
-
markupElement: new
|
|
13
|
-
...
|
|
14
|
-
});
|
|
15
|
-
m(this, "styles", {});
|
|
16
|
-
this.styles = l;
|
|
10
|
+
markupElement: new k(),
|
|
11
|
+
...l
|
|
12
|
+
}), this.styles = e;
|
|
17
13
|
}
|
|
18
14
|
plugins() {
|
|
19
|
-
return [
|
|
15
|
+
return [x(this.styles)];
|
|
20
16
|
}
|
|
21
17
|
}
|
|
22
|
-
class
|
|
23
|
-
constructor(e =
|
|
18
|
+
class k extends o {
|
|
19
|
+
constructor(e = y, l = a) {
|
|
24
20
|
super(e, l);
|
|
25
21
|
}
|
|
26
22
|
}
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
return /* @__PURE__ */
|
|
23
|
+
const a = ({ element: t, attributes: e, children: l, styles: m }) => {
|
|
24
|
+
const i = t.align;
|
|
25
|
+
return /* @__PURE__ */ n(
|
|
30
26
|
"p",
|
|
31
27
|
{
|
|
32
28
|
...e,
|
|
33
|
-
className:
|
|
34
|
-
style:
|
|
29
|
+
className: u([i && c[i], p(t)]),
|
|
30
|
+
style: m,
|
|
35
31
|
children: l
|
|
36
32
|
}
|
|
37
33
|
);
|
|
38
|
-
},
|
|
39
|
-
key:
|
|
34
|
+
}, x = (t) => g({
|
|
35
|
+
key: s.imageTitle,
|
|
40
36
|
isElement: !0,
|
|
41
|
-
component:
|
|
37
|
+
component: a,
|
|
42
38
|
deserializeHtml: {
|
|
43
|
-
rules: [{ validClassName:
|
|
39
|
+
rules: [{ validClassName: s.imageTitle }]
|
|
44
40
|
}
|
|
45
41
|
})({
|
|
46
|
-
component: (e) => /* @__PURE__ */
|
|
42
|
+
component: (e) => /* @__PURE__ */ n(a, { ...e, styles: t })
|
|
47
43
|
});
|
|
48
44
|
export {
|
|
49
|
-
|
|
45
|
+
C as ImageTitlePlugin
|
|
50
46
|
};
|
|
51
47
|
//# sourceMappingURL=imageTitlePlugin.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageTitlePlugin.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n MarkupElement,\n type PlatePlugin,\n Plugin,\n type PluginProps,\n type TextStyleRenderElementProps,\n alignmentClassnames,\n createPluginFactory,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue/rte';\nimport { type CSSProperties } from 'react';\n\nimport { BlockStyles, TextStyles } from '../styles';\n\nconst ID = 'textstyle-imageTitle-plugin';\n\nexport class ImageTitlePlugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.imageTitle, ...props }: PluginProps = {}) {\n super(TextStyles.imageTitle, {\n label: 'Image Title',\n markupElement: new ImageTitleMarkupElement(),\n ...props,\n });\n this.styles = styles;\n }\n\n plugins(): PlatePlugin[] {\n return [createImageTitlePlugin(this.styles)];\n }\n}\n\nclass ImageTitleMarkupElement extends MarkupElement {\n constructor(id = ID, node = ImageTitleMarkupElementNode) {\n super(id, node);\n }\n}\nconst ImageTitleMarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n return (\n <p\n {...attributes}\n className={merge([align && alignmentClassnames[align], getColumnBreakClasses(element)])}\n style={styles}\n >\n {children}\n </p>\n );\n};\n\nconst createImageTitlePlugin = (styles: CSSProperties) =>\n createPluginFactory({\n key: TextStyles.imageTitle,\n isElement: true,\n component: ImageTitleMarkupElementNode,\n deserializeHtml: {\n rules: [{ validClassName: TextStyles.imageTitle }],\n },\n })({\n component: (props: TextStyleRenderElementProps) => <ImageTitleMarkupElementNode {...props} styles={styles} />,\n });\n"],"names":["ID","ImageTitlePlugin","Plugin","styles","BlockStyles","props","TextStyles","ImageTitleMarkupElement","
|
|
1
|
+
{"version":3,"file":"imageTitlePlugin.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n MarkupElement,\n type PlatePlugin,\n Plugin,\n type PluginProps,\n type TextStyleRenderElementProps,\n alignmentClassnames,\n createPluginFactory,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue/rte';\nimport { type CSSProperties } from 'react';\n\nimport { BlockStyles, TextStyles } from '../styles';\n\nconst ID = 'textstyle-imageTitle-plugin';\n\nexport class ImageTitlePlugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.imageTitle, ...props }: PluginProps = {}) {\n super(TextStyles.imageTitle, {\n label: 'Image Title',\n markupElement: new ImageTitleMarkupElement(),\n ...props,\n });\n this.styles = styles;\n }\n\n plugins(): PlatePlugin[] {\n return [createImageTitlePlugin(this.styles)];\n }\n}\n\nclass ImageTitleMarkupElement extends MarkupElement {\n constructor(id = ID, node = ImageTitleMarkupElementNode) {\n super(id, node);\n }\n}\nconst ImageTitleMarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n return (\n <p\n {...attributes}\n className={merge([align && alignmentClassnames[align], getColumnBreakClasses(element)])}\n style={styles}\n >\n {children}\n </p>\n );\n};\n\nconst createImageTitlePlugin = (styles: CSSProperties) =>\n createPluginFactory({\n key: TextStyles.imageTitle,\n isElement: true,\n component: ImageTitleMarkupElementNode,\n deserializeHtml: {\n rules: [{ validClassName: TextStyles.imageTitle }],\n },\n })({\n component: (props: TextStyleRenderElementProps) => <ImageTitleMarkupElementNode {...props} styles={styles} />,\n });\n"],"names":["ID","ImageTitlePlugin","Plugin","styles","BlockStyles","props","TextStyles","ImageTitleMarkupElement","createImageTitlePlugin","MarkupElement","id","node","ImageTitleMarkupElementNode","element","attributes","children","align","jsx","merge","alignmentClassnames","getColumnBreakClasses","createPluginFactory"],"mappings":";;;AAiBA,MAAMA,IAAK;AAEJ,MAAMC,UAAyBC,EAAO;AAAA,EAClC,SAAwB,CAAA;AAAA,EAC/B,YAAY,EAAE,QAAAC,IAASC,EAAY,YAAY,GAAGC,EAAA,IAAuB,IAAI;AACzE,UAAMC,EAAW,YAAY;AAAA,MACzB,OAAO;AAAA,MACP,eAAe,IAAIC,EAAA;AAAA,MACnB,GAAGF;AAAA,IAAA,CACN,GACD,KAAK,SAASF;AAAA,EAClB;AAAA,EAEA,UAAyB;AACrB,WAAO,CAACK,EAAuB,KAAK,MAAM,CAAC;AAAA,EAC/C;AACJ;AAEA,MAAMD,UAAgCE,EAAc;AAAA,EAChD,YAAYC,IAAKV,GAAIW,IAAOC,GAA6B;AACrD,UAAMF,GAAIC,CAAI;AAAA,EAClB;AACJ;AACA,MAAMC,IAA8B,CAAC,EAAE,SAAAC,GAAS,YAAAC,GAAY,UAAAC,GAAU,QAAAZ,QAA0C;AAC5G,QAAMa,IAAQH,EAAQ;AACtB,SACI,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAGH;AAAA,MACJ,WAAWI,EAAM,CAACF,KAASG,EAAoBH,CAAK,GAAGI,EAAsBP,CAAO,CAAC,CAAC;AAAA,MACtF,OAAOV;AAAA,MAEN,UAAAY;AAAA,IAAA;AAAA,EAAA;AAGb,GAEMP,IAAyB,CAACL,MAC5BkB,EAAoB;AAAA,EAChB,KAAKf,EAAW;AAAA,EAChB,WAAW;AAAA,EACX,WAAWM;AAAA,EACX,iBAAiB;AAAA,IACb,OAAO,CAAC,EAAE,gBAAgBN,EAAW,YAAY;AAAA,EAAA;AAEzD,CAAC,EAAE;AAAA,EACC,WAAW,CAACD,wBAAwCO,GAAA,EAA6B,GAAGP,GAAO,QAAAF,EAAA,CAAgB;AAC/G,CAAC;"}
|
|
@@ -1,45 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
super(n.p, {
|
|
10
|
-
markupElement: new d(),
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { Plugin as c, MarkupElement as m, merge as u, alignmentClassnames as g, getColumnBreakClasses as i, createPluginFactory as P, createParagraphPlugin as y } from "@frontify/fondue/rte";
|
|
3
|
+
import { TextStyles as s, BlockStyles as h } from "../styles.es.js";
|
|
4
|
+
class A extends c {
|
|
5
|
+
styles = {};
|
|
6
|
+
constructor({ styles: e = h.p, ...r } = {}) {
|
|
7
|
+
super(s.p, {
|
|
8
|
+
markupElement: new x(),
|
|
11
9
|
label: "Body Text",
|
|
12
|
-
...
|
|
13
|
-
});
|
|
14
|
-
p(this, "styles", {});
|
|
15
|
-
this.styles = r;
|
|
10
|
+
...r
|
|
11
|
+
}), this.styles = e;
|
|
16
12
|
}
|
|
17
13
|
plugins() {
|
|
18
|
-
return [
|
|
14
|
+
return [E(this.styles)];
|
|
19
15
|
}
|
|
20
16
|
}
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
return /* @__PURE__ */
|
|
17
|
+
const k = "tw-m-0 tw-px-0 tw-py-0", a = ({ element: t, attributes: e, children: r, styles: p }) => {
|
|
18
|
+
const n = t.align, o = u([n && g[n], k, i(t)]);
|
|
19
|
+
return /* @__PURE__ */ l("p", { ...e, className: o, style: p, children: r });
|
|
24
20
|
};
|
|
25
|
-
class
|
|
26
|
-
constructor(e =
|
|
21
|
+
class x extends m {
|
|
22
|
+
constructor(e = s.p, r = a) {
|
|
27
23
|
super(e, r);
|
|
28
24
|
}
|
|
29
25
|
}
|
|
30
|
-
const
|
|
31
|
-
...
|
|
32
|
-
key:
|
|
26
|
+
const E = (t) => P({
|
|
27
|
+
...y(),
|
|
28
|
+
key: s.p,
|
|
33
29
|
isElement: !0,
|
|
34
|
-
component:
|
|
30
|
+
component: a
|
|
35
31
|
})({
|
|
36
|
-
component: (e) => /* @__PURE__ */
|
|
32
|
+
component: (e) => /* @__PURE__ */ l(a, { ...e, styles: t })
|
|
37
33
|
});
|
|
38
34
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
k as PARAGRAPH_CLASSES,
|
|
36
|
+
x as ParagraphMarkupElement,
|
|
37
|
+
a as ParagraphMarkupElementNode,
|
|
38
|
+
A as ParagraphPlugin,
|
|
39
|
+
E as createParagraphPlugin
|
|
44
40
|
};
|
|
45
41
|
//# sourceMappingURL=paragraphPlugin.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paragraphPlugin.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n MarkupElement,\n type PlatePlugin,\n Plugin,\n type PluginProps,\n type TextStyleRenderElementProps,\n alignmentClassnames,\n createParagraphPlugin as createPlateParagraphPlugin,\n createPluginFactory,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue/rte';\nimport { type CSSProperties } from 'react';\n\nimport { BlockStyles, TextStyles } from '../styles';\n\nexport class ParagraphPlugin extends Plugin {\n public styles = {};\n constructor({ styles = BlockStyles.p, ...props }: PluginProps = {}) {\n super(TextStyles.p, {\n markupElement: new ParagraphMarkupElement(),\n label: 'Body Text',\n ...props,\n });\n this.styles = styles;\n }\n\n plugins(): PlatePlugin[] {\n return [createParagraphPlugin(this.styles)];\n }\n}\n\nexport const PARAGRAPH_CLASSES = 'tw-m-0 tw-px-0 tw-py-0';\n\nexport const ParagraphMarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n const className = merge([align && alignmentClassnames[align], PARAGRAPH_CLASSES, getColumnBreakClasses(element)]);\n return (\n <p {...attributes} className={className} style={styles}>\n {children}\n </p>\n );\n};\n\nexport class ParagraphMarkupElement extends MarkupElement {\n constructor(id = TextStyles.p, node = ParagraphMarkupElementNode) {\n super(id, node);\n }\n}\n\nexport const createParagraphPlugin = (styles: CSSProperties): PlatePlugin =>\n createPluginFactory({\n ...createPlateParagraphPlugin(),\n key: TextStyles.p,\n isElement: true,\n component: ParagraphMarkupElementNode,\n })({\n component: (props: TextStyleRenderElementProps) => <ParagraphMarkupElementNode {...props} styles={styles} />,\n });\n"],"names":["ParagraphPlugin","Plugin","styles","BlockStyles","props","TextStyles","ParagraphMarkupElement","
|
|
1
|
+
{"version":3,"file":"paragraphPlugin.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n MarkupElement,\n type PlatePlugin,\n Plugin,\n type PluginProps,\n type TextStyleRenderElementProps,\n alignmentClassnames,\n createParagraphPlugin as createPlateParagraphPlugin,\n createPluginFactory,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue/rte';\nimport { type CSSProperties } from 'react';\n\nimport { BlockStyles, TextStyles } from '../styles';\n\nexport class ParagraphPlugin extends Plugin {\n public styles = {};\n constructor({ styles = BlockStyles.p, ...props }: PluginProps = {}) {\n super(TextStyles.p, {\n markupElement: new ParagraphMarkupElement(),\n label: 'Body Text',\n ...props,\n });\n this.styles = styles;\n }\n\n plugins(): PlatePlugin[] {\n return [createParagraphPlugin(this.styles)];\n }\n}\n\nexport const PARAGRAPH_CLASSES = 'tw-m-0 tw-px-0 tw-py-0';\n\nexport const ParagraphMarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n const className = merge([align && alignmentClassnames[align], PARAGRAPH_CLASSES, getColumnBreakClasses(element)]);\n return (\n <p {...attributes} className={className} style={styles}>\n {children}\n </p>\n );\n};\n\nexport class ParagraphMarkupElement extends MarkupElement {\n constructor(id = TextStyles.p, node = ParagraphMarkupElementNode) {\n super(id, node);\n }\n}\n\nexport const createParagraphPlugin = (styles: CSSProperties): PlatePlugin =>\n createPluginFactory({\n ...createPlateParagraphPlugin(),\n key: TextStyles.p,\n isElement: true,\n component: ParagraphMarkupElementNode,\n })({\n component: (props: TextStyleRenderElementProps) => <ParagraphMarkupElementNode {...props} styles={styles} />,\n });\n"],"names":["ParagraphPlugin","Plugin","styles","BlockStyles","props","TextStyles","ParagraphMarkupElement","createParagraphPlugin","PARAGRAPH_CLASSES","ParagraphMarkupElementNode","element","attributes","children","align","className","merge","alignmentClassnames","getColumnBreakClasses","MarkupElement","id","node","createPluginFactory","createPlateParagraphPlugin"],"mappings":";;;AAkBO,MAAMA,UAAwBC,EAAO;AAAA,EACjC,SAAS,CAAA;AAAA,EAChB,YAAY,EAAE,QAAAC,IAASC,EAAY,GAAG,GAAGC,EAAA,IAAuB,IAAI;AAChE,UAAMC,EAAW,GAAG;AAAA,MAChB,eAAe,IAAIC,EAAA;AAAA,MACnB,OAAO;AAAA,MACP,GAAGF;AAAA,IAAA,CACN,GACD,KAAK,SAASF;AAAA,EAClB;AAAA,EAEA,UAAyB;AACrB,WAAO,CAACK,EAAsB,KAAK,MAAM,CAAC;AAAA,EAC9C;AACJ;AAEO,MAAMC,IAAoB,0BAEpBC,IAA6B,CAAC,EAAE,SAAAC,GAAS,YAAAC,GAAY,UAAAC,GAAU,QAAAV,QAA0C;AAClH,QAAMW,IAAQH,EAAQ,OAChBI,IAAYC,EAAM,CAACF,KAASG,EAAoBH,CAAK,GAAGL,GAAmBS,EAAsBP,CAAO,CAAC,CAAC;AAChH,2BACK,KAAA,EAAG,GAAGC,GAAY,WAAAG,GAAsB,OAAOZ,GAC3C,UAAAU,GACL;AAER;AAEO,MAAMN,UAA+BY,EAAc;AAAA,EACtD,YAAYC,IAAKd,EAAW,GAAGe,IAAOX,GAA4B;AAC9D,UAAMU,GAAIC,CAAI;AAAA,EAClB;AACJ;AAEO,MAAMb,IAAwB,CAACL,MAClCmB,EAAoB;AAAA,EAChB,GAAGC,EAAA;AAAA,EACH,KAAKjB,EAAW;AAAA,EAChB,WAAW;AAAA,EACX,WAAWI;AACf,CAAC,EAAE;AAAA,EACC,WAAW,CAACL,wBAAwCK,GAAA,EAA4B,GAAGL,GAAO,QAAAF,EAAA,CAAgB;AAC9G,CAAC;"}
|
|
@@ -1,53 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
constructor({ styles: s = q.quote, ...o } = {}) {
|
|
10
|
-
super(a.quote, {
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Plugin as a, merge as m, alignmentClassnames as c, getColumnBreakClasses as i, createPluginFactory as p, MarkupElement as g } from "@frontify/fondue/rte";
|
|
3
|
+
import { TextStyles as u, BlockStyles as k } from "../styles.es.js";
|
|
4
|
+
const y = "textstyle-quote-plugin";
|
|
5
|
+
class C extends a {
|
|
6
|
+
styles = {};
|
|
7
|
+
constructor({ styles: e = k.quote, ...s } = {}) {
|
|
8
|
+
super(u.quote, {
|
|
11
9
|
label: "Quote",
|
|
12
|
-
markupElement: new
|
|
13
|
-
...
|
|
14
|
-
});
|
|
15
|
-
u(this, "styles", {});
|
|
16
|
-
this.styles = s;
|
|
10
|
+
markupElement: new d(),
|
|
11
|
+
...s
|
|
12
|
+
}), this.styles = e;
|
|
17
13
|
}
|
|
18
14
|
plugins() {
|
|
19
|
-
return [
|
|
15
|
+
return [q(this.styles)];
|
|
20
16
|
}
|
|
21
17
|
}
|
|
22
|
-
class
|
|
23
|
-
constructor(e =
|
|
18
|
+
class d extends g {
|
|
19
|
+
constructor(e = y, s = o) {
|
|
24
20
|
super(e, s);
|
|
25
21
|
}
|
|
26
22
|
}
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
return /* @__PURE__ */
|
|
23
|
+
const o = ({ element: t, attributes: e, children: s, styles: r }) => {
|
|
24
|
+
const l = t.align;
|
|
25
|
+
return /* @__PURE__ */ n(
|
|
30
26
|
"blockquote",
|
|
31
27
|
{
|
|
32
28
|
...e,
|
|
33
|
-
className:
|
|
34
|
-
style:
|
|
29
|
+
className: m([l && c[l], i(t)]),
|
|
30
|
+
style: r,
|
|
35
31
|
children: s
|
|
36
32
|
}
|
|
37
33
|
);
|
|
38
|
-
},
|
|
39
|
-
key:
|
|
34
|
+
}, q = (t) => p({
|
|
35
|
+
key: u.quote,
|
|
40
36
|
isElement: !0,
|
|
41
|
-
component:
|
|
37
|
+
component: o,
|
|
42
38
|
deserializeHtml: {
|
|
43
39
|
rules: [{ validNodeName: ["blockquote", "BLOCKQUOTE"] }]
|
|
44
40
|
}
|
|
45
41
|
})({
|
|
46
|
-
component: (e) => /* @__PURE__ */
|
|
42
|
+
component: (e) => /* @__PURE__ */ n(o, { ...e, styles: t })
|
|
47
43
|
});
|
|
48
44
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
o as QuoteMarkupElementNode,
|
|
46
|
+
C as QuotePlugin,
|
|
47
|
+
q as createQuotePlugin
|
|
52
48
|
};
|
|
53
49
|
//# sourceMappingURL=quotePlugin.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quotePlugin.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n MarkupElement,\n type PlatePlugin,\n Plugin,\n type PluginProps,\n type TextStyleRenderElementProps,\n alignmentClassnames,\n createPluginFactory,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue/rte';\nimport { type CSSProperties } from 'react';\n\nimport { BlockStyles, TextStyles } from '../styles';\n\nconst ID = 'textstyle-quote-plugin';\n\nexport class QuotePlugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.quote, ...props }: PluginProps = {}) {\n super(TextStyles.quote, {\n label: 'Quote',\n markupElement: new QuoteMarkupElement(),\n ...props,\n });\n this.styles = styles;\n }\n\n plugins(): PlatePlugin[] {\n return [createQuotePlugin(this.styles)];\n }\n}\n\nclass QuoteMarkupElement extends MarkupElement {\n constructor(id = ID, node = QuoteMarkupElementNode) {\n super(id, node);\n }\n}\n\nexport const QuoteMarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n return (\n <blockquote\n {...attributes}\n className={merge([align && alignmentClassnames[align], getColumnBreakClasses(element)])}\n style={styles}\n >\n {children}\n </blockquote>\n );\n};\n\nexport const createQuotePlugin = (styles: CSSProperties): PlatePlugin =>\n createPluginFactory({\n key: TextStyles.quote,\n isElement: true,\n component: QuoteMarkupElementNode,\n deserializeHtml: {\n rules: [{ validNodeName: ['blockquote', 'BLOCKQUOTE'] }],\n },\n })({\n component: (props: TextStyleRenderElementProps) => <QuoteMarkupElementNode {...props} styles={styles} />,\n });\n"],"names":["ID","QuotePlugin","Plugin","styles","BlockStyles","props","TextStyles","QuoteMarkupElement","
|
|
1
|
+
{"version":3,"file":"quotePlugin.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n MarkupElement,\n type PlatePlugin,\n Plugin,\n type PluginProps,\n type TextStyleRenderElementProps,\n alignmentClassnames,\n createPluginFactory,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue/rte';\nimport { type CSSProperties } from 'react';\n\nimport { BlockStyles, TextStyles } from '../styles';\n\nconst ID = 'textstyle-quote-plugin';\n\nexport class QuotePlugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.quote, ...props }: PluginProps = {}) {\n super(TextStyles.quote, {\n label: 'Quote',\n markupElement: new QuoteMarkupElement(),\n ...props,\n });\n this.styles = styles;\n }\n\n plugins(): PlatePlugin[] {\n return [createQuotePlugin(this.styles)];\n }\n}\n\nclass QuoteMarkupElement extends MarkupElement {\n constructor(id = ID, node = QuoteMarkupElementNode) {\n super(id, node);\n }\n}\n\nexport const QuoteMarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n return (\n <blockquote\n {...attributes}\n className={merge([align && alignmentClassnames[align], getColumnBreakClasses(element)])}\n style={styles}\n >\n {children}\n </blockquote>\n );\n};\n\nexport const createQuotePlugin = (styles: CSSProperties): PlatePlugin =>\n createPluginFactory({\n key: TextStyles.quote,\n isElement: true,\n component: QuoteMarkupElementNode,\n deserializeHtml: {\n rules: [{ validNodeName: ['blockquote', 'BLOCKQUOTE'] }],\n },\n })({\n component: (props: TextStyleRenderElementProps) => <QuoteMarkupElementNode {...props} styles={styles} />,\n });\n"],"names":["ID","QuotePlugin","Plugin","styles","BlockStyles","props","TextStyles","QuoteMarkupElement","createQuotePlugin","MarkupElement","id","node","QuoteMarkupElementNode","element","attributes","children","align","jsx","merge","alignmentClassnames","getColumnBreakClasses","createPluginFactory"],"mappings":";;;AAiBA,MAAMA,IAAK;AAEJ,MAAMC,UAAoBC,EAAO;AAAA,EAC7B,SAAwB,CAAA;AAAA,EAC/B,YAAY,EAAE,QAAAC,IAASC,EAAY,OAAO,GAAGC,EAAA,IAAuB,IAAI;AACpE,UAAMC,EAAW,OAAO;AAAA,MACpB,OAAO;AAAA,MACP,eAAe,IAAIC,EAAA;AAAA,MACnB,GAAGF;AAAA,IAAA,CACN,GACD,KAAK,SAASF;AAAA,EAClB;AAAA,EAEA,UAAyB;AACrB,WAAO,CAACK,EAAkB,KAAK,MAAM,CAAC;AAAA,EAC1C;AACJ;AAEA,MAAMD,UAA2BE,EAAc;AAAA,EAC3C,YAAYC,IAAKV,GAAIW,IAAOC,GAAwB;AAChD,UAAMF,GAAIC,CAAI;AAAA,EAClB;AACJ;AAEO,MAAMC,IAAyB,CAAC,EAAE,SAAAC,GAAS,YAAAC,GAAY,UAAAC,GAAU,QAAAZ,QAA0C;AAC9G,QAAMa,IAAQH,EAAQ;AACtB,SACI,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAGH;AAAA,MACJ,WAAWI,EAAM,CAACF,KAASG,EAAoBH,CAAK,GAAGI,EAAsBP,CAAO,CAAC,CAAC;AAAA,MACtF,OAAOV;AAAA,MAEN,UAAAY;AAAA,IAAA;AAAA,EAAA;AAGb,GAEaP,IAAoB,CAACL,MAC9BkB,EAAoB;AAAA,EAChB,KAAKf,EAAW;AAAA,EAChB,WAAW;AAAA,EACX,WAAWM;AAAA,EACX,iBAAiB;AAAA,IACb,OAAO,CAAC,EAAE,eAAe,CAAC,cAAc,YAAY,GAAG;AAAA,EAAA;AAE/D,CAAC,EAAE;AAAA,EACC,WAAW,CAACP,wBAAwCO,GAAA,EAAwB,GAAGP,GAAO,QAAAF,EAAA,CAAgB;AAC1G,CAAC;"}
|