@coorpacademy/components 11.40.18-react18.10 → 11.40.18-react18.12
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/es/atom/html/index.native.d.ts.map +1 -1
- package/es/atom/html/index.native.js +0 -1
- package/es/atom/html/index.native.js.map +1 -1
- package/es/variables/colors.d.ts +1 -1
- package/es/variables/colors.js +1 -1
- package/es/variables/colors.js.map +1 -1
- package/lib/atom/html/index.native.d.ts.map +1 -1
- package/lib/atom/html/index.native.js +0 -1
- package/lib/atom/html/index.native.js.map +1 -1
- package/lib/variables/colors.d.ts +1 -1
- package/lib/variables/colors.js +1 -1
- package/lib/variables/colors.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/html/index.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAO,SAAS,EAAE,UAAU,EAAE,SAAS,EAAsB,MAAM,cAAc,CAAC;AAqBzF,oBAAY,KAAK,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAqBF,QAAA,MAAM,IAAI,UAAW,KAAK,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/html/index.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAO,SAAS,EAAE,UAAU,EAAE,SAAS,EAAsB,MAAM,cAAc,CAAC;AAqBzF,oBAAY,KAAK,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAqBF,QAAA,MAAM,IAAI,UAAW,KAAK,sBA6IzB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -8,7 +8,6 @@ const HtmlBase = props => {
|
|
|
8
8
|
return /*#__PURE__*/React.createElement(RenderHTML, props);
|
|
9
9
|
};
|
|
10
10
|
const Html = props => {
|
|
11
|
-
console.log('v3 --> Html component, baseFontStyle.color applied to body tag');
|
|
12
11
|
const templateContext = useTemplateContext();
|
|
13
12
|
const {
|
|
14
13
|
width: contentWidth
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useCallback","useMemo","useState","View","useWindowDimensions","RenderHTML","HTML_ANCHOR_TEXT_COLOR","useTemplateContext","Text","HtmlBase","props","createElement","Html","
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useCallback","useMemo","useState","View","useWindowDimensions","RenderHTML","HTML_ANCHOR_TEXT_COLOR","useTemplateContext","Text","HtmlBase","props","createElement","Html","templateContext","width","contentWidth","isDisabledBaseFontStyleColor","disableBaseFontStyleColor","theme","children","fontSize","containerStyle","imageStyle","style","testID","anchorTextColor","isTextCentered","numberOfLines","baseFontStyle","color","colors","black","Array","isArray","styleObject","reduce","result","child","styles","p","marginVertical","textAlign","u","textDecorationLine","i","fontStyle","b","fontWeight","bold","s","tagsStyles","body","h1","h2","h3","h4","h5","h6","a","img","SpanRenderer","htmlAttribs","_children","FontRenderer","key","replace","renderers","font","span","source","html","undefined","ignoredStyles"],"sources":["../../../src/atom/html/index.native.tsx"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport {View, ViewStyle, ImageStyle, TextStyle, useWindowDimensions} from 'react-native';\nimport RenderHTML, {\n CustomRendererProps,\n MixedStyleRecord,\n RenderHTMLProps,\n TBlock\n} from 'react-native-render-html';\n\nimport {HTML_ANCHOR_TEXT_COLOR} from '../../variables/theme.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport Text from '../text/index.native';\n\ninterface CustomRenderHTMLProps extends RenderHTMLProps {\n baseFontStyle?: TextStyle;\n testID?: string;\n}\n\nconst HtmlBase = (props: CustomRenderHTMLProps) => {\n return <RenderHTML {...props} />;\n};\n\nexport type Props = {\n children: string;\n fontSize?: TextStyle['fontSize'];\n numberOfLines?: number;\n onLinkPress?: (url: string) => void;\n containerStyle?: ViewStyle;\n anchorTextColor?: string;\n imageStyle?: ImageStyle;\n style?: ViewStyle | ViewStyle[];\n testID?: string;\n isTextCentered?: boolean;\n};\n\ntype Styles = {\n p: {\n marginVertical: ViewStyle['marginVertical'];\n textAlign: TextStyle['textAlign'];\n };\n u: {\n textDecorationLine: TextStyle['textDecorationLine'];\n };\n i: {\n fontStyle: TextStyle['fontStyle'];\n };\n b: {\n fontWeight: TextStyle['fontWeight'];\n };\n s: {\n textDecorationLine: TextStyle['textDecorationLine'];\n };\n};\n\nconst Html = (props: Props) => {\n const templateContext = useTemplateContext();\n const {width: contentWidth} = useWindowDimensions();\n const [isDisabledBaseFontStyleColor, disableBaseFontStyleColor] = useState<boolean>(false);\n const {theme} = templateContext;\n const {\n children,\n fontSize,\n containerStyle,\n imageStyle,\n style,\n testID,\n anchorTextColor = HTML_ANCHOR_TEXT_COLOR,\n isTextCentered,\n numberOfLines\n } = props;\n\n let baseFontStyle: TextStyle = useMemo(\n () => ({fontSize, color: theme.colors.black}),\n [fontSize, theme]\n );\n\n if (style) {\n if (Array.isArray(style)) {\n const styleObject = style.reduce((result, child) => ({\n ...result,\n ...child\n }));\n baseFontStyle = {\n ...baseFontStyle,\n ...styleObject\n };\n } else {\n baseFontStyle = {\n ...baseFontStyle,\n ...style\n };\n }\n }\n\n // Don't use StyleSheet there, it's not a react style\n const styles: Styles = {\n p: {\n marginVertical: 0,\n textAlign: 'center'\n },\n u: {\n textDecorationLine: 'underline'\n },\n i: {\n fontStyle: 'italic'\n },\n b: {\n fontWeight: theme.fontWeight.bold\n },\n s: {\n textDecorationLine: 'line-through'\n }\n };\n\n const tagsStyles = {\n ...styles,\n body: {color: baseFontStyle.color},\n h1: {fontSize},\n h2: {fontSize},\n h3: {fontSize},\n h4: {fontSize},\n h5: {fontSize},\n h6: {fontSize},\n a: {color: anchorTextColor},\n img: imageStyle || {}\n } as MixedStyleRecord;\n\n const SpanRenderer = useCallback(\n (htmlAttribs: CustomRendererProps<TBlock>, _children: string) => (\n <Text numberOfLines={numberOfLines}>{_children}</Text>\n ),\n [numberOfLines]\n );\n\n interface HtmlAttrib extends CustomRendererProps<TBlock> {\n color?: string;\n }\n\n const FontRenderer = useCallback(\n (htmlAttribs: HtmlAttrib, _children: string) => {\n if (htmlAttribs.color) {\n disableBaseFontStyleColor(true);\n }\n\n return (\n <Text\n key={1}\n style={{\n ...baseFontStyle,\n color: htmlAttribs.color?.replace(/ /g, '')\n }}\n >\n {_children}\n </Text>\n );\n },\n [baseFontStyle]\n );\n\n const renderers = {\n font: FontRenderer,\n span: SpanRenderer\n };\n\n return (\n <View testID={testID} style={containerStyle}>\n <HtmlBase\n // to text-align center on android\n // we have to encapsulate between <p> tag\n // and use custom style define on <p>\n // definition in component style doesn't work\n source={{\n // eslint-disable-next-line no-nested-ternary\n html: isTextCentered\n ? `<p>${children}</p>`\n : numberOfLines\n ? `<span>${children}</span>`\n : `${children}`\n }}\n contentWidth={contentWidth}\n tagsStyles={tagsStyles}\n baseFontStyle={{\n ...baseFontStyle,\n color: isDisabledBaseFontStyleColor ? undefined : baseFontStyle.color\n }}\n renderers={renderers}\n // this is exceptionally for the onboarding course\n // is the only course that has a gif in the context but the img tag\n // comes with width & height attr and these makes this lib do not render the gif\n // so to avoid it, we decided to ignore these attr\n ignoredStyles={['width', 'height']}\n testID=\"html-base\"\n />\n </View>\n );\n};\n\nexport default Html;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAO,OAAO;AAC3D,SAAQC,IAAI,EAAoCC,mBAAmB,QAAO,cAAc;AACxF,OAAOC,UAAU,MAKV,0BAA0B;AAEjC,SAAQC,sBAAsB,QAAO,8BAA8B;AACnE,SAAQC,kBAAkB,QAAO,4CAA4C;AAC7E,OAAOC,IAAI,MAAM,sBAAsB;AAOvC,MAAMC,QAAQ,GAAIC,KAA4B,IAAK;EACjD,oBAAOX,KAAA,CAAAY,aAAA,CAACN,UAAU,EAAKK,KAAQ,CAAC;AAClC,CAAC;AAkCD,MAAME,IAAI,GAAIF,KAAY,IAAK;EAC7B,MAAMG,eAAe,GAAGN,kBAAkB,CAAC,CAAC;EAC5C,MAAM;IAACO,KAAK,EAAEC;EAAY,CAAC,GAAGX,mBAAmB,CAAC,CAAC;EACnD,MAAM,CAACY,4BAA4B,EAAEC,yBAAyB,CAAC,GAAGf,QAAQ,CAAU,KAAK,CAAC;EAC1F,MAAM;IAACgB;EAAK,CAAC,GAAGL,eAAe;EAC/B,MAAM;IACJM,QAAQ;IACRC,QAAQ;IACRC,cAAc;IACdC,UAAU;IACVC,KAAK;IACLC,MAAM;IACNC,eAAe,GAAGnB,sBAA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ChBC,KAAK,EAAEb,4BAA4B,GAAGuD,SAAS,GAAG3C,aAAa,CAACC;IAClE,CAAE;IACFqC,SAAS,EAAEA;IACX;IACA;IACA;IACA;IAAA;IACAM,aAAa,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAE;IACnChD,MAAM,EAAC;EAAW,CACnB,CACG,CAAC;AAEX,CAAC;AAED,eAAeZ,IAAI","ignoreList":[]}
|
package/es/variables/colors.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const COLORS: {
|
|
2
2
|
readonly cm_grey_100: "#EAEAEB";
|
|
3
3
|
readonly negative: "#F73F52";
|
|
4
|
-
readonly cm_negative_100: "#ed3436
|
|
4
|
+
readonly cm_negative_100: "#ed3436";
|
|
5
5
|
readonly cm_negative_200: "#B81400";
|
|
6
6
|
readonly cm_positive_200: "#05944F";
|
|
7
7
|
readonly white: "#FFFFFF";
|
package/es/variables/colors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","names":["COLORS","cm_grey_100","negative","cm_negative_100","cm_negative_200","cm_positive_200","white","cm_blue_50","cm_grey_400","cm_grey_500","cm_grey_700","cm_grey_800","cm_grey_150","cm_primary_blue","cm_blue_700","primary_100","primary_600","cm_yellow_400","brand","yellow_700","yellow_100","red_700","red_100","cm_violet_podcast","cm_turquoise_strong","yellow_500","neutral_75","neutral_400","neutral_500","neutral_700","cm_red_video","cm_blue_article","cm_yellow_scorm","negative_700","cm_orange_800","purple_700","purple_100","turquoise_100","pink_100","orange_100","cm_positive_500","purple_500","cm_grey_200"],"sources":["../../src/variables/colors.ts"],"sourcesContent":["export const COLORS = {\n cm_grey_100: '#EAEAEB',\n negative: '#F73F52',\n cm_negative_100: '#ed3436
|
|
1
|
+
{"version":3,"file":"colors.js","names":["COLORS","cm_grey_100","negative","cm_negative_100","cm_negative_200","cm_positive_200","white","cm_blue_50","cm_grey_400","cm_grey_500","cm_grey_700","cm_grey_800","cm_grey_150","cm_primary_blue","cm_blue_700","primary_100","primary_600","cm_yellow_400","brand","yellow_700","yellow_100","red_700","red_100","cm_violet_podcast","cm_turquoise_strong","yellow_500","neutral_75","neutral_400","neutral_500","neutral_700","cm_red_video","cm_blue_article","cm_yellow_scorm","negative_700","cm_orange_800","purple_700","purple_100","turquoise_100","pink_100","orange_100","cm_positive_500","purple_500","cm_grey_200"],"sources":["../../src/variables/colors.ts"],"sourcesContent":["export const COLORS = {\n cm_grey_100: '#EAEAEB',\n negative: '#F73F52',\n cm_negative_100: '#ed3436',\n cm_negative_200: '#B81400',\n cm_positive_200: '#05944F',\n white: '#FFFFFF',\n cm_blue_50: '#f1f6fe',\n cm_grey_400: '#9999A8',\n cm_grey_500: '#515161',\n cm_grey_700: '#1D1D2B',\n cm_grey_800: '#171721',\n cm_grey_150: '#E1E1E3',\n cm_primary_blue: '#0061FF',\n cm_blue_700: '#0042AD',\n primary_100: '#D6E6FF',\n primary_600: '#0051D6',\n cm_yellow_400: '#bd7e00',\n brand: '#00B0FF',\n yellow_700: '#A38300',\n yellow_100: '#FFF9D1',\n red_700: '#A30000',\n red_100: '#FFD1D1',\n cm_violet_podcast: '#432ba7',\n cm_turquoise_strong: '#1B7B88',\n yellow_500: '#FFCE0A',\n neutral_75: ' #F4F4F5',\n neutral_400: ' #9999A8',\n neutral_500: '#515161',\n neutral_700: '#1D1D2B',\n cm_red_video: '#E8335E',\n cm_blue_article: '#365FCD',\n cm_yellow_scorm: '#FFB800',\n negative_700: '#B81400',\n cm_orange_800: '#A32700',\n purple_700: '#2B00A3',\n purple_100: '#DDD1FF',\n turquoise_100: '#D9F4F7',\n pink_100: '#FAD6DE',\n orange_100: '#FFDCD1',\n cm_positive_500: '#35CC7F',\n purple_500: '#4B0AFF',\n cm_grey_200: '#D7D7DA'\n} as const;\n\nexport type Colors = typeof COLORS;\n"],"mappings":"AAAA,OAAO,MAAMA,MAAM,GAAG;EACpBC,WAAW,EAAE,SAAS;EACtBC,QAAQ,EAAE,SAAS;EACnBC,eAAe,EAAE,SAAS;EAC1BC,eAAe,EAAE,SAAS;EAC1BC,eAAe,EAAE,SAAS;EAC1BC,KAAK,EAAE,SAAS;EAChBC,UAAU,EAAE,SAAS;EACrBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,eAAe,EAAE,SAAS;EAC1BC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,aAAa,EAAE,SAAS;EACxBC,KAAK,EAAE,SAAS;EAChBC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,SAAS;EACrBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,iBAAiB,EAAE,SAAS;EAC5BC,mBAAmB,EAAE,SAAS;EAC9BC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,UAAU;EACtBC,WAAW,EAAE,UAAU;EACvBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,YAAY,EAAE,SAAS;EACvBC,eAAe,EAAE,SAAS;EAC1BC,eAAe,EAAE,SAAS;EAC1BC,YAAY,EAAE,SAAS;EACvBC,aAAa,EAAE,SAAS;EACxBC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,SAAS;EACrBC,aAAa,EAAE,SAAS;EACxBC,QAAQ,EAAE,SAAS;EACnBC,UAAU,EAAE,SAAS;EACrBC,eAAe,EAAE,SAAS;EAC1BC,UAAU,EAAE,SAAS;EACrBC,WAAW,EAAE;AACf,CAAU","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/html/index.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAO,SAAS,EAAE,UAAU,EAA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,KAAK,sBA6IzB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -15,7 +15,6 @@ const HtmlBase = props => {
|
|
|
15
15
|
return /*#__PURE__*/_react.default.createElement(_reactNativeRenderHtml.default, props);
|
|
16
16
|
};
|
|
17
17
|
const Html = props => {
|
|
18
|
-
console.log('v3 --> Html component, baseFontStyle.color applied to body tag');
|
|
19
18
|
const templateContext = (0, _templateContext.useTemplateContext)();
|
|
20
19
|
const {
|
|
21
20
|
width: contentWidth
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeRenderHtml","_interopRequireDefault","_theme","_templateContext","_index","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","HtmlBase","props","createElement","Html","console","log","templateContext","useTemplateContext","width","contentWidth","useWindowDimensions","isDisabledBaseFontStyleColor","disableBaseFontStyleColor","useState","theme","children","fontSize","containerStyle","imageStyle","style","testID","anchorTextColor","HTML_ANCHOR_TEXT_COLOR","isTextCentered","numberOfLines","baseFontStyle","useMemo","color","colors","black","Array","isArray","styleObject","reduce","result","child","styles","p","marginVertical","textAlign","textDecorationLine","fontStyle","b","fontWeight","bold","s","tagsStyles","body","h1","h2","h3","h4","h5","h6","img","SpanRenderer","useCallback","htmlAttribs","_children","FontRenderer","key","replace","renderers","font","span","View","source","html","undefined","ignoredStyles","_default","exports"],"sources":["../../../src/atom/html/index.native.tsx"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport {View, ViewStyle, ImageStyle, TextStyle, useWindowDimensions} from 'react-native';\nimport RenderHTML, {\n CustomRendererProps,\n MixedStyleRecord,\n RenderHTMLProps,\n TBlock\n} from 'react-native-render-html';\n\nimport {HTML_ANCHOR_TEXT_COLOR} from '../../variables/theme.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport Text from '../text/index.native';\n\ninterface CustomRenderHTMLProps extends RenderHTMLProps {\n baseFontStyle?: TextStyle;\n testID?: string;\n}\n\nconst HtmlBase = (props: CustomRenderHTMLProps) => {\n return <RenderHTML {...props} />;\n};\n\nexport type Props = {\n children: string;\n fontSize?: TextStyle['fontSize'];\n numberOfLines?: number;\n onLinkPress?: (url: string) => void;\n containerStyle?: ViewStyle;\n anchorTextColor?: string;\n imageStyle?: ImageStyle;\n style?: ViewStyle | ViewStyle[];\n testID?: string;\n isTextCentered?: boolean;\n};\n\ntype Styles = {\n p: {\n marginVertical: ViewStyle['marginVertical'];\n textAlign: TextStyle['textAlign'];\n };\n u: {\n textDecorationLine: TextStyle['textDecorationLine'];\n };\n i: {\n fontStyle: TextStyle['fontStyle'];\n };\n b: {\n fontWeight: TextStyle['fontWeight'];\n };\n s: {\n textDecorationLine: TextStyle['textDecorationLine'];\n };\n};\n\nconst Html = (props: Props) => {\n console.log('v3 --> Html component, baseFontStyle.color applied to body tag');\n const templateContext = useTemplateContext();\n const {width: contentWidth} = useWindowDimensions();\n const [isDisabledBaseFontStyleColor, disableBaseFontStyleColor] = useState<boolean>(false);\n const {theme} = templateContext;\n const {\n children,\n fontSize,\n containerStyle,\n imageStyle,\n style,\n testID,\n anchorTextColor = HTML_ANCHOR_TEXT_COLOR,\n isTextCentered,\n numberOfLines\n } = props;\n\n let baseFontStyle: TextStyle = useMemo(\n () => ({fontSize, color: theme.colors.black}),\n [fontSize, theme]\n );\n\n if (style) {\n if (Array.isArray(style)) {\n const styleObject = style.reduce((result, child) => ({\n ...result,\n ...child\n }));\n baseFontStyle = {\n ...baseFontStyle,\n ...styleObject\n };\n } else {\n baseFontStyle = {\n ...baseFontStyle,\n ...style\n };\n }\n }\n\n // Don't use StyleSheet there, it's not a react style\n const styles: Styles = {\n p: {\n marginVertical: 0,\n textAlign: 'center'\n },\n u: {\n textDecorationLine: 'underline'\n },\n i: {\n fontStyle: 'italic'\n },\n b: {\n fontWeight: theme.fontWeight.bold\n },\n s: {\n textDecorationLine: 'line-through'\n }\n };\n\n const tagsStyles = {\n ...styles,\n body: {color: baseFontStyle.color},\n h1: {fontSize},\n h2: {fontSize},\n h3: {fontSize},\n h4: {fontSize},\n h5: {fontSize},\n h6: {fontSize},\n a: {color: anchorTextColor},\n img: imageStyle || {}\n } as MixedStyleRecord;\n\n const SpanRenderer = useCallback(\n (htmlAttribs: CustomRendererProps<TBlock>, _children: string) => (\n <Text numberOfLines={numberOfLines}>{_children}</Text>\n ),\n [numberOfLines]\n );\n\n interface HtmlAttrib extends CustomRendererProps<TBlock> {\n color?: string;\n }\n\n const FontRenderer = useCallback(\n (htmlAttribs: HtmlAttrib, _children: string) => {\n if (htmlAttribs.color) {\n disableBaseFontStyleColor(true);\n }\n\n return (\n <Text\n key={1}\n style={{\n ...baseFontStyle,\n color: htmlAttribs.color?.replace(/ /g, '')\n }}\n >\n {_children}\n </Text>\n );\n },\n [baseFontStyle]\n );\n\n const renderers = {\n font: FontRenderer,\n span: SpanRenderer\n };\n\n return (\n <View testID={testID} style={containerStyle}>\n <HtmlBase\n // to text-align center on android\n // we have to encapsulate between <p> tag\n // and use custom style define on <p>\n // definition in component style doesn't work\n source={{\n // eslint-disable-next-line no-nested-ternary\n html: isTextCentered\n ? `<p>${children}</p>`\n : numberOfLines\n ? `<span>${children}</span>`\n : `${children}`\n }}\n contentWidth={contentWidth}\n tagsStyles={tagsStyles}\n baseFontStyle={{\n ...baseFontStyle,\n color: isDisabledBaseFontStyleColor ? undefined : baseFontStyle.color\n }}\n renderers={renderers}\n // this is exceptionally for the onboarding course\n // is the only course that has a gif in the context but the img tag\n // comes with width & height attr and these makes this lib do not render the gif\n // so to avoid it, we decided to ignore these attr\n ignoredStyles={['width', 'height']}\n testID=\"html-base\"\n />\n </View>\n );\n};\n\nexport default Html;\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA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jC;IAEA,oBACEzC,MAAA,CAAAW,OAAA,CAAAoB,aAAA,CAACvB,MAAA,CAAAG,OAAI;MACH8E,GAAG,EAAE,CAAE;MACPzC,KAAK,EAAE;QACL,GAAGM,aAAa;QAChBE,KAAK,EAAE8B,WAAW,CAAC9B,KAAK,EAAEkC,OAAO,CAAC,IAAI,EAAE,EAAE;MAC5C;IAAE,GAEDH,SACG,CAAC;EAEX,CAAC,EACD,CAACjC,aAAa,CAChB,CAAC;EAED,MAAMqC,SAAS,GAAG;IAChBC,IAAI,EAAEJ,YAAY;IAClBK,IAAI,EAAET;EACR,CAAC;EAED,oBACEpF,MAAA,CAAAW,OAAA,CAAAoB,aAAA,CAAC5B,YAAA,CAAA2F,IAAI;IAAC7C,MAAM,EAAEA,MAAO;IAACD,KAAK,EAAEF;EAAe,gBAC1C9C,MAAA,CAAAW,OAAA,CAAAoB,aAAA,CAACF;EACC;EACA;EACA;EACA;EAAA;IACAkE,MAAM,EAAE;MACN;MACAC,IAAI,EAAE5C,cAAc,GAChB,MAAMR,QAAQ,MAAM,GACpBS,aAAa,GACb,SAAST,QAAQ,SAAS,GAC1B,GAAGA,QAAQ;IACjB,CAAE;IACFN,YAAY,EAAEA,YAAa;IAC3BqC,UAAU,EAAEA,UAAW;IACvBrB,aAAa,EAAE;MACb,GAAGA,aAAa;MAChBE,KAAK,EAAEhB,4BAA4B,GAAGyD,SAAS,GAAG3C,aAAa,CAACE;IAClE,CAAE;IACFmC,SAAS,EAAEA;IACX;IACA;IACA;IACA;IAAA;IACAO,aAAa,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAE;IACnCjD,MAAM,EAAC;EAAW,CACnB,CACG,CAAC;AAEX,CAAC;AAAC,IAAAkD,QAAA,GAAAC,OAAA,CAAAzF,OAAA,GAEaqB,IAAI","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeRenderHtml","_interopRequireDefault","_theme","_templateContext","_index","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","HtmlBase","props","createElement","Html","templateContext","useTemplateContext","width","contentWidth","useWindowDimensions","isDisabledBaseFontStyleColor","disableBaseFontStyleColor","useState","theme","children","fontSize","containerStyle","imageStyle","style","testID","anchorTextColor","HTML_ANCHOR_TEXT_COLOR","isTextCentered","numberOfLines","baseFontStyle","useMemo","color","colors","black","Array","isArray","styleObject","reduce","result","child","styles","p","marginVertical","textAlign","textDecorationLine","fontStyle","b","fontWeight","bold","s","tagsStyles","body","h1","h2","h3","h4","h5","h6","img","SpanRenderer","useCallback","htmlAttribs","_children","FontRenderer","key","replace","renderers","font","span","View","source","html","undefined","ignoredStyles","_default","exports"],"sources":["../../../src/atom/html/index.native.tsx"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport {View, ViewStyle, ImageStyle, TextStyle, useWindowDimensions} from 'react-native';\nimport RenderHTML, {\n CustomRendererProps,\n MixedStyleRecord,\n RenderHTMLProps,\n TBlock\n} from 'react-native-render-html';\n\nimport {HTML_ANCHOR_TEXT_COLOR} from '../../variables/theme.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport Text from '../text/index.native';\n\ninterface CustomRenderHTMLProps extends RenderHTMLProps {\n baseFontStyle?: TextStyle;\n testID?: string;\n}\n\nconst HtmlBase = (props: CustomRenderHTMLProps) => {\n return <RenderHTML {...props} />;\n};\n\nexport type Props = {\n children: string;\n fontSize?: TextStyle['fontSize'];\n numberOfLines?: number;\n onLinkPress?: (url: string) => void;\n containerStyle?: ViewStyle;\n anchorTextColor?: string;\n imageStyle?: ImageStyle;\n style?: ViewStyle | ViewStyle[];\n testID?: string;\n isTextCentered?: boolean;\n};\n\ntype Styles = {\n p: {\n marginVertical: ViewStyle['marginVertical'];\n textAlign: TextStyle['textAlign'];\n };\n u: {\n textDecorationLine: TextStyle['textDecorationLine'];\n };\n i: {\n fontStyle: TextStyle['fontStyle'];\n };\n b: {\n fontWeight: TextStyle['fontWeight'];\n };\n s: {\n textDecorationLine: TextStyle['textDecorationLine'];\n };\n};\n\nconst Html = (props: Props) => {\n const templateContext = useTemplateContext();\n const {width: contentWidth} = useWindowDimensions();\n const [isDisabledBaseFontStyleColor, disableBaseFontStyleColor] = useState<boolean>(false);\n const {theme} = templateContext;\n const {\n children,\n fontSize,\n containerStyle,\n imageStyle,\n style,\n testID,\n anchorTextColor = HTML_ANCHOR_TEXT_COLOR,\n isTextCentered,\n numberOfLines\n } = props;\n\n let baseFontStyle: TextStyle = useMemo(\n () => ({fontSize, color: theme.colors.black}),\n [fontSize, theme]\n );\n\n if (style) {\n if (Array.isArray(style)) {\n const styleObject = style.reduce((result, child) => ({\n ...result,\n ...child\n }));\n baseFontStyle = {\n ...baseFontStyle,\n ...styleObject\n };\n } else {\n baseFontStyle = {\n ...baseFontStyle,\n ...style\n };\n }\n }\n\n // Don't use StyleSheet there, it's not a react style\n const styles: Styles = {\n p: {\n marginVertical: 0,\n textAlign: 'center'\n },\n u: {\n textDecorationLine: 'underline'\n },\n i: {\n fontStyle: 'italic'\n },\n b: {\n fontWeight: theme.fontWeight.bold\n },\n s: {\n textDecorationLine: 'line-through'\n }\n };\n\n const tagsStyles = {\n ...styles,\n body: {color: baseFontStyle.color},\n h1: {fontSize},\n h2: {fontSize},\n h3: {fontSize},\n h4: {fontSize},\n h5: {fontSize},\n h6: {fontSize},\n a: {color: anchorTextColor},\n img: imageStyle || {}\n } as MixedStyleRecord;\n\n const SpanRenderer = useCallback(\n (htmlAttribs: CustomRendererProps<TBlock>, _children: string) => (\n <Text numberOfLines={numberOfLines}>{_children}</Text>\n ),\n [numberOfLines]\n );\n\n interface HtmlAttrib extends CustomRendererProps<TBlock> {\n color?: string;\n }\n\n const FontRenderer = useCallback(\n (htmlAttribs: HtmlAttrib, _children: string) => {\n if (htmlAttribs.color) {\n disableBaseFontStyleColor(true);\n }\n\n return (\n <Text\n key={1}\n style={{\n ...baseFontStyle,\n color: htmlAttribs.color?.replace(/ /g, '')\n }}\n >\n {_children}\n </Text>\n );\n },\n [baseFontStyle]\n );\n\n const renderers = {\n font: FontRenderer,\n span: SpanRenderer\n };\n\n return (\n <View testID={testID} style={containerStyle}>\n <HtmlBase\n // to text-align center on android\n // we have to encapsulate between <p> tag\n // and use custom style define on <p>\n // definition in component style doesn't work\n source={{\n // eslint-disable-next-line no-nested-ternary\n html: isTextCentered\n ? `<p>${children}</p>`\n : numberOfLines\n ? `<span>${children}</span>`\n : `${children}`\n }}\n contentWidth={contentWidth}\n tagsStyles={tagsStyles}\n baseFontStyle={{\n ...baseFontStyle,\n color: isDisabledBaseFontStyleColor ? undefined : baseFontStyle.color\n }}\n renderers={renderers}\n // this is exceptionally for the onboarding course\n // is the only course that has a gif in the context but the img tag\n // comes with width & height attr and these makes this lib do not render the gif\n // so to avoid it, we decided to ignore these attr\n ignoredStyles={['width', 'height']}\n testID=\"html-base\"\n />\n </View>\n );\n};\n\nexport default Html;\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAOA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAH,sBAAA,CAAAH,OAAA;AAAwC,SAAAG,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAK,CAAA,SAAAA,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AAA,CAAAoB,aAAA,CAACF;EACC;EACA;EACA;EACA;EAAA;IACAgE,MAAM,EAAE;MACN;MACAC,IAAI,EAAE5C,cAAc,GAChB,MAAMR,QAAQ,MAAM,GACpBS,aAAa,GACb,SAAST,QAAQ,SAAS,GAC1B,GAAGA,QAAQ;IACjB,CAAE;IACFN,YAAY,EAAEA,YAAa;IAC3BqC,UAAU,EAAEA,UAAW;IACvBrB,aAAa,EAAE;MACb,GAAGA,aAAa;MAChBE,KAAK,EAAEhB,4BAA4B,GAAGyD,SAAS,GAAG3C,aAAa,CAACE;IAClE,CAAE;IACFmC,SAAS,EAAEA;IACX;IACA;IACA;IACA;IAAA;IACAO,aAAa,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAE;IACnCjD,MAAM,EAAC;EAAW,CACnB,CACG,CAAC;AAEX,CAAC;AAAC,IAAAkD,QAAA,GAAAC,OAAA,CAAAvF,OAAA,GAEaqB,IAAI","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const COLORS: {
|
|
2
2
|
readonly cm_grey_100: "#EAEAEB";
|
|
3
3
|
readonly negative: "#F73F52";
|
|
4
|
-
readonly cm_negative_100: "#ed3436
|
|
4
|
+
readonly cm_negative_100: "#ed3436";
|
|
5
5
|
readonly cm_negative_200: "#B81400";
|
|
6
6
|
readonly cm_positive_200: "#05944F";
|
|
7
7
|
readonly white: "#FFFFFF";
|
package/lib/variables/colors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","names":["COLORS","exports","cm_grey_100","negative","cm_negative_100","cm_negative_200","cm_positive_200","white","cm_blue_50","cm_grey_400","cm_grey_500","cm_grey_700","cm_grey_800","cm_grey_150","cm_primary_blue","cm_blue_700","primary_100","primary_600","cm_yellow_400","brand","yellow_700","yellow_100","red_700","red_100","cm_violet_podcast","cm_turquoise_strong","yellow_500","neutral_75","neutral_400","neutral_500","neutral_700","cm_red_video","cm_blue_article","cm_yellow_scorm","negative_700","cm_orange_800","purple_700","purple_100","turquoise_100","pink_100","orange_100","cm_positive_500","purple_500","cm_grey_200"],"sources":["../../src/variables/colors.ts"],"sourcesContent":["export const COLORS = {\n cm_grey_100: '#EAEAEB',\n negative: '#F73F52',\n cm_negative_100: '#ed3436
|
|
1
|
+
{"version":3,"file":"colors.js","names":["COLORS","exports","cm_grey_100","negative","cm_negative_100","cm_negative_200","cm_positive_200","white","cm_blue_50","cm_grey_400","cm_grey_500","cm_grey_700","cm_grey_800","cm_grey_150","cm_primary_blue","cm_blue_700","primary_100","primary_600","cm_yellow_400","brand","yellow_700","yellow_100","red_700","red_100","cm_violet_podcast","cm_turquoise_strong","yellow_500","neutral_75","neutral_400","neutral_500","neutral_700","cm_red_video","cm_blue_article","cm_yellow_scorm","negative_700","cm_orange_800","purple_700","purple_100","turquoise_100","pink_100","orange_100","cm_positive_500","purple_500","cm_grey_200"],"sources":["../../src/variables/colors.ts"],"sourcesContent":["export const COLORS = {\n cm_grey_100: '#EAEAEB',\n negative: '#F73F52',\n cm_negative_100: '#ed3436',\n cm_negative_200: '#B81400',\n cm_positive_200: '#05944F',\n white: '#FFFFFF',\n cm_blue_50: '#f1f6fe',\n cm_grey_400: '#9999A8',\n cm_grey_500: '#515161',\n cm_grey_700: '#1D1D2B',\n cm_grey_800: '#171721',\n cm_grey_150: '#E1E1E3',\n cm_primary_blue: '#0061FF',\n cm_blue_700: '#0042AD',\n primary_100: '#D6E6FF',\n primary_600: '#0051D6',\n cm_yellow_400: '#bd7e00',\n brand: '#00B0FF',\n yellow_700: '#A38300',\n yellow_100: '#FFF9D1',\n red_700: '#A30000',\n red_100: '#FFD1D1',\n cm_violet_podcast: '#432ba7',\n cm_turquoise_strong: '#1B7B88',\n yellow_500: '#FFCE0A',\n neutral_75: ' #F4F4F5',\n neutral_400: ' #9999A8',\n neutral_500: '#515161',\n neutral_700: '#1D1D2B',\n cm_red_video: '#E8335E',\n cm_blue_article: '#365FCD',\n cm_yellow_scorm: '#FFB800',\n negative_700: '#B81400',\n cm_orange_800: '#A32700',\n purple_700: '#2B00A3',\n purple_100: '#DDD1FF',\n turquoise_100: '#D9F4F7',\n pink_100: '#FAD6DE',\n orange_100: '#FFDCD1',\n cm_positive_500: '#35CC7F',\n purple_500: '#4B0AFF',\n cm_grey_200: '#D7D7DA'\n} as const;\n\nexport type Colors = typeof COLORS;\n"],"mappings":";;;;AAAO,MAAMA,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG;EACpBE,WAAW,EAAE,SAAS;EACtBC,QAAQ,EAAE,SAAS;EACnBC,eAAe,EAAE,SAAS;EAC1BC,eAAe,EAAE,SAAS;EAC1BC,eAAe,EAAE,SAAS;EAC1BC,KAAK,EAAE,SAAS;EAChBC,UAAU,EAAE,SAAS;EACrBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,eAAe,EAAE,SAAS;EAC1BC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,aAAa,EAAE,SAAS;EACxBC,KAAK,EAAE,SAAS;EAChBC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,SAAS;EACrBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,iBAAiB,EAAE,SAAS;EAC5BC,mBAAmB,EAAE,SAAS;EAC9BC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,UAAU;EACtBC,WAAW,EAAE,UAAU;EACvBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,YAAY,EAAE,SAAS;EACvBC,eAAe,EAAE,SAAS;EAC1BC,eAAe,EAAE,SAAS;EAC1BC,YAAY,EAAE,SAAS;EACvBC,aAAa,EAAE,SAAS;EACxBC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,SAAS;EACrBC,aAAa,EAAE,SAAS;EACxBC,QAAQ,EAAE,SAAS;EACnBC,UAAU,EAAE,SAAS;EACrBC,eAAe,EAAE,SAAS;EAC1BC,UAAU,EAAE,SAAS;EACrBC,WAAW,EAAE;AACf,CAAU","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "11.40.18-react18.
|
|
3
|
+
"version": "11.40.18-react18.12+474aad661",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -170,5 +170,5 @@
|
|
|
170
170
|
"last 2 versions",
|
|
171
171
|
"IE 11"
|
|
172
172
|
],
|
|
173
|
-
"gitHead": "
|
|
173
|
+
"gitHead": "474aad66116bfde4c6beb4f06df0a45739f99e59"
|
|
174
174
|
}
|