@frontify/fondue 12.0.0-beta.229 → 12.0.0-beta.230
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/RichTextEditor/serializer/nodes/default.es.js +7 -7
- package/dist/components/RichTextEditor/serializer/nodes/default.es.js.map +1 -1
- package/dist/index.cjs.js +9 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.umd.js +10 -10
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { reactCssPropsToCss as
|
|
2
|
-
import { TextStyles as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
return r.type ===
|
|
6
|
-
}, h = (r, t
|
|
1
|
+
import { reactCssPropsToCss as p } from "../utils/reactCssPropsToCss.es.js";
|
|
2
|
+
import { TextStyles as e } from "../../Plugins/TextStylePlugin/types.es.js";
|
|
3
|
+
const y = (r, t, s, i) => {
|
|
4
|
+
const n = $(s, r.type);
|
|
5
|
+
return r.type === e.heading1 ? `<h1 class="${i}">${h(t, n)}</h1>` : r.type === e.heading2 ? `<h2 class="${i}">${h(t, n)}</h2>` : r.type === e.heading3 ? `<h3 class="${i}">${h(t, n)}</h3>` : r.type === e.heading4 ? `<h4 class="${i}">${h(t, n)}</h4>` : `<p class="${i}">${h(t, n)}</p>`;
|
|
6
|
+
}, h = (r, t) => `<span style="${t}">${r}</span>`, $ = (r, t) => t === e.heading2 || t === e.heading3 || t === e.heading4 ? p(r) : p({ display: "inline-block", ...r });
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
y as defaultNode
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=default.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/default.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { reactCssPropsToCss } from '../utils/reactCssPropsToCss';\nimport { TElement } from '@udecode/plate';\nimport { TextStyles } from '@components/RichTextEditor/Plugins/TextStylePlugin/types';\nimport { CSSProperties } from 'react';\n\nexport const defaultNode = (node: TElement, children: string, styles: CSSProperties, defaultClassNames: string) => {\n const defaultStyles =
|
|
1
|
+
{"version":3,"file":"default.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/default.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { reactCssPropsToCss } from '../utils/reactCssPropsToCss';\nimport { TElement } from '@udecode/plate';\nimport { TextStyles } from '@components/RichTextEditor/Plugins/TextStylePlugin/types';\nimport { CSSProperties } from 'react';\n\nexport const defaultNode = (node: TElement, children: string, styles: CSSProperties, defaultClassNames: string) => {\n const defaultStyles = getDefaultStyles(styles, node.type);\n\n if (node.type === TextStyles.heading1) {\n return `<h1 class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</h1>`;\n }\n if (node.type === TextStyles.heading2) {\n return `<h2 class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</h2>`;\n }\n if (node.type === TextStyles.heading3) {\n return `<h3 class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</h3>`;\n }\n if (node.type === TextStyles.heading4) {\n return `<h4 class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</h4>`;\n }\n return `<p class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</p>`;\n};\n\nconst getStyledChild = (children: string, styles: string) => `<span style=\"${styles}\">${children}</span>`;\n\nconst getDefaultStyles = (styles: CSSProperties, type: string) => {\n if (type === TextStyles.heading2 || type === TextStyles.heading3 || type === TextStyles.heading4) {\n return reactCssPropsToCss(styles);\n }\n return reactCssPropsToCss({ display: 'inline-block', ...styles });\n};\n"],"names":["defaultNode","node","children","styles","defaultClassNames","defaultStyles","getDefaultStyles","TextStyles","getStyledChild","type","reactCssPropsToCss"],"mappings":";;AAOO,MAAMA,IAAc,CAACC,GAAgBC,GAAkBC,GAAuBC,MAA8B;AAC/G,QAAMC,IAAgBC,EAAiBH,GAAQF,EAAK,IAAI;AAEpD,SAAAA,EAAK,SAASM,EAAW,WAClB,cAAcH,MAAsBI,EAAeN,GAAUG,CAAa,WAEjFJ,EAAK,SAASM,EAAW,WAClB,cAAcH,MAAsBI,EAAeN,GAAUG,CAAa,WAEjFJ,EAAK,SAASM,EAAW,WAClB,cAAcH,MAAsBI,EAAeN,GAAUG,CAAa,WAEjFJ,EAAK,SAASM,EAAW,WAClB,cAAcH,MAAsBI,EAAeN,GAAUG,CAAa,WAE9E,aAAaD,MAAsBI,EAAeN,GAAUG,CAAa;AACpF,GAEMG,IAAiB,CAACN,GAAkBC,MAAmB,gBAAgBA,MAAWD,YAElFI,IAAmB,CAACH,GAAuBM,MACzCA,MAASF,EAAW,YAAYE,MAASF,EAAW,YAAYE,MAASF,EAAW,WAC7EG,EAAmBP,CAAM,IAE7BO,EAAmB,EAAE,SAAS,gBAAgB,GAAGP,EAAQ,CAAA;"}
|