@ohmyteeth/react-native-line-flex-message-renderer 0.2.0 → 0.4.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/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -485,14 +485,14 @@ const Box = ({ layout, contents, backgroundColor, borderColor, borderWidth, corn
|
|
|
485
485
|
onPress: handleClick,
|
|
486
486
|
children: /* @__PURE__ */ jsx(ParentFlexDirectionProvider, {
|
|
487
487
|
direction: ownDirection,
|
|
488
|
-
children: contents.map((content, i) => /* @__PURE__ */ jsx(React.Fragment, { children: renderComponent(content) }, i))
|
|
488
|
+
children: contents.map((content, i) => /* @__PURE__ */ jsx(React.Fragment, { children: renderComponent(content, onClick) }, i))
|
|
489
489
|
})
|
|
490
490
|
});
|
|
491
491
|
return /* @__PURE__ */ jsx(View, {
|
|
492
492
|
style: containerStyle,
|
|
493
493
|
children: /* @__PURE__ */ jsx(ParentFlexDirectionProvider, {
|
|
494
494
|
direction: ownDirection,
|
|
495
|
-
children: contents.map((content, i) => /* @__PURE__ */ jsx(React.Fragment, { children: renderComponent(content) }, i))
|
|
495
|
+
children: contents.map((content, i) => /* @__PURE__ */ jsx(React.Fragment, { children: renderComponent(content, onClick) }, i))
|
|
496
496
|
})
|
|
497
497
|
});
|
|
498
498
|
};
|
|
@@ -569,7 +569,7 @@ const Text$1 = ({ text, contents, adjustMode, flex, margin, position, offsetTop,
|
|
|
569
569
|
style: textStyle,
|
|
570
570
|
numberOfLines,
|
|
571
571
|
ellipsizeMode: "tail",
|
|
572
|
-
children: contents.map((content, index) => /* @__PURE__ */ jsx(React.Fragment, { children: renderComponent(content) }, index))
|
|
572
|
+
children: contents.map((content, index) => /* @__PURE__ */ jsx(React.Fragment, { children: renderComponent(content, onClick) }, index))
|
|
573
573
|
})
|
|
574
574
|
})
|
|
575
575
|
});
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["Styles","Touchable","Image","RNImage","Text","RNText","Image","Text"],"sources":["../src/context/debug.tsx","../src/components/filler.tsx","../src/hooks/useParentFlexDirection.tsx","../src/components/icon.tsx","../src/containers/bubble.tsx","../src/containers/carousel.tsx","../src/renderer.tsx","../src/components/span.tsx","../src/components/button.tsx","../src/components/image.tsx","../src/components/video.tsx","../src/components/box.tsx","../src/hooks/useInheritedMarginSize.tsx","../src/components/text.tsx","../src/components/separator.tsx","../src/index.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\n\nconst DebugContext = createContext(false);\n\nexport const DebugProvider = ({ children, value }: { children: React.ReactNode; value: boolean }) => (\n <DebugContext.Provider value={value}>\n {children}\n </DebugContext.Provider>\n);\n\nexport const useDebugMode = () => {\n return useContext(DebugContext);\n}\n","import type { FillerComponent } from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { View } from \"react-native\";\nimport { useDebugMode } from \"../context/debug.js\";\n\nexport const Filler = ({ flex }: FillerComponent) => {\n const isDebugMode = useDebugMode();\n return <View style={{ flexGrow: 1, flexShrink: 0, flexBasis: 0, flex, ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}) }} />;\n};\n","import React from \"react\";\n\nconst ParentFlexDirectionContext = React.createContext<\"row\" | \"column\">(\"column\");\n\nexport const ParentFlexDirectionProvider = ({\n children,\n direction,\n}: {\n children: React.ReactNode;\n direction: \"row\" | \"column\";\n}) => {\n return <ParentFlexDirectionContext.Provider value={direction}>{children}</ParentFlexDirectionContext.Provider>;\n};\n\nexport const useParentFlexDirection = () => {\n return React.useContext(ParentFlexDirectionContext);\n};\n","import {\n getActualSize,\n getIconSize,\n getMarginSize,\n getOffset,\n type IconComponent,\n} from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { Image, View } from \"react-native\";\nimport { useParentFlexDirection } from \"../hooks/useParentFlexDirection.js\";\nimport { useDebugMode } from \"../context/debug.js\";\n\nexport const Icon = ({\n url,\n margin,\n position,\n offsetTop,\n offsetBottom,\n offsetStart,\n offsetEnd,\n size,\n scaling,\n aspectRatio,\n}: IconComponent) => {\n const parentDirection = useParentFlexDirection();\n const isDebugMode = useDebugMode();\n // getIconSize(undefined) returns undefined; without this fallback an unsized icon renders at its source's native pixel size.\n const width = getActualSize(getIconSize(size ?? \"md\"));\n const marginSize = getActualSize(getMarginSize(margin));\n\n return (\n <View\n style={{\n width,\n flexShrink: 0,\n // `margin` is space along whichever axis the parent lays siblings out on — marginTop in a\n // \"column\" parent, marginLeft in a \"row\" (horizontal/baseline) parent.\n ...(parentDirection === \"column\" ? { marginTop: marginSize } : { marginLeft: marginSize }),\n ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}),\n }}\n >\n <Image\n style={{\n aspectRatio: aspectRatio?.split(\":\").join(\"/\") ?? \"1\",\n top: getActualSize(getOffset(offsetTop)),\n bottom: getActualSize(getOffset(offsetBottom)),\n left: getActualSize(getOffset(offsetStart)),\n right: getActualSize(getOffset(offsetEnd)),\n position: position === undefined ? \"relative\" : position,\n ...(isDebugMode ? { borderColor: \"blue\", borderWidth: 1 } : {}),\n }}\n source={{ uri: url }}\n />\n </View>\n );\n};\n","import {\n renderComponent,\n type BubbleContainer,\n type ClickHandler,\n} from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { StyleSheet, TouchableOpacity, View, type StyleProp, type ViewStyle, type LayoutChangeEvent } from \"react-native\";\n\nexport const Bubble = ({\n body,\n direction,\n footer,\n header,\n hero,\n size,\n styles,\n action,\n onClick,\n containerStyle,\n onLayout,\n}: BubbleContainer & {\n onClick?: ClickHandler | undefined;\n // Native-only, not part of the Flex Message spec: lets Carousel measure every bubble's natural height\n // and stretch them all to match the tallest one, since ScrollView content doesn't do this on its own.\n containerStyle?: StyleProp<ViewStyle>;\n onLayout?: ((event: LayoutChangeEvent) => void) | undefined;\n}) => {\n const hasHero = !!hero;\n const hasFooter = !!footer;\n const hasHeader = !!header;\n const handleClick = () => {\n if (action) {\n onClick?.(action);\n }\n };\n\n const inner = {\n ...Styles.bubbleInner,\n // Only when Carousel hands us an explicit (now definite, non-percentage) height to match: without\n // this, bubbleInner stays content-sized and the extra space added below is just blank/transparent.\n ...(containerStyle !== undefined && { flexGrow: 1 }),\n ...(size === \"nano\" && Styles.nanoInner),\n ...(size === \"micro\" && Styles.microInner),\n ...(size === \"deca\" && Styles.decaInner),\n ...(size === \"hecto\" && Styles.hectoInner),\n ...(size === \"kilo\" && Styles.kiloInner),\n ...(size === \"mega\" && Styles.megaInner),\n ...(size === \"giga\" && Styles.gigaInner),\n };\n\n const Component = action ? TouchableOpacity : View;\n return (\n <Component\n style={[{ ...Styles.bubble, ...Styles[size ?? \"mega\"] }, containerStyle]}\n onPress={handleClick}\n onLayout={onLayout}\n >\n <View style={inner}>\n {header && (\n <View\n style={{\n backgroundColor: styles?.header?.backgroundColor ?? \"#fff\",\n borderBottomWidth: styles?.header?.separator ? 1 : 0,\n borderColor: styles?.header?.separatorColor ?? \"#000\",\n }}\n >\n {renderComponent(header, onClick)}\n </View>\n )}\n\n {hero && (\n <View style={{ backgroundColor: styles?.hero?.backgroundColor ?? \"#fff\" }}>\n {renderComponent(hero, onClick)}\n </View>\n )}\n\n {body && (\n <View\n style={{\n ...Styles.body,\n ...(hasHeader && !body.paddingAll && Styles.bodyWithHeader),\n // The web port zeroes this out specifically for \"micro\" bubbles (see its CSS), since a\n // micro body commonly sets its own smaller `paddingAll` — without this exception the two\n // paddings stack (this wrapper's 20px plus the body Box's own), roughly doubling the gap.\n ...(hasHero && size !== \"micro\" && Styles.bodyWithHero),\n ...(hasFooter && Styles.bodyWithFooter),\n ...(!body.paddingAll && Styles.withPadding),\n backgroundColor: styles?.body?.backgroundColor ?? \"#fff\",\n }}\n >\n {renderComponent(body, onClick)}\n </View>\n )}\n\n {footer && (\n <View\n style={{\n ...Styles.footer,\n backgroundColor: styles?.footer?.backgroundColor ?? \"#fff\",\n borderTopWidth: styles?.footer?.separator ? 1 : 0,\n borderColor: styles?.footer?.separatorColor ?? \"#000\",\n }}\n >\n {renderComponent(footer, onClick)}\n </View>\n )}\n </View>\n </Component>\n );\n};\n\nconst Styles = StyleSheet.create({\n bubble: {\n flexDirection: \"column\",\n width: \"100%\",\n },\n bubbleInner: {\n flexDirection: \"column\",\n overflow: \"hidden\",\n borderRadius: 10,\n },\n nano: {\n width: 120,\n maxWidth: 120,\n },\n nanoInner: {\n borderRadius: 10,\n },\n micro: {\n width: 160,\n maxWidth: 160,\n },\n microInner: {\n borderRadius: 10,\n },\n deca: {\n width: 220,\n maxWidth: 220,\n },\n decaInner: {\n borderRadius: 10,\n },\n hecto: {\n width: 241,\n maxWidth: 241,\n },\n hectoInner: {\n borderRadius: 10,\n },\n kilo: {\n width: 260,\n maxWidth: 260,\n },\n kiloInner: {\n borderRadius: 10,\n },\n mega: {\n width: 300,\n maxWidth: 300,\n },\n megaInner: {\n borderRadius: 17,\n },\n giga: {\n width: 340,\n maxWidth: 340,\n },\n gigaInner: {\n borderRadius: 5,\n },\n body: {\n flexGrow: 1,\n },\n withPadding: {\n padding: 20,\n },\n bodyWithHeader: {\n padding: 20,\n },\n bodyWithHero: {\n padding: 20,\n },\n bodyWithFooter: {\n paddingBottom: 10,\n },\n footer: {\n padding: 10,\n },\n});\n","import {\n type CarouselContainer,\n type ClickHandler,\n} from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { useCallback, useState } from \"react\";\nimport { ScrollView, StyleSheet, type LayoutChangeEvent } from \"react-native\";\nimport { Bubble } from \"./bubble.js\";\n\nexport const Carousel = ({ contents, onClick }: CarouselContainer & { onClick?: ClickHandler }) => {\n // `alignItems: \"stretch\"` doesn't equalize bubble heights here — ScrollView content doesn't participate\n // in cross-axis stretch the way a plain flex row does — so each bubble's natural height is measured via\n // onLayout, and once all have reported in, every bubble is pinned to the tallest one's height.\n const [heights, setHeights] = useState<Record<number, number>>({});\n const measured = Object.keys(heights).length === contents.length;\n const maxHeight = measured ? Math.max(...Object.values(heights)) : undefined;\n\n const handleLayout = useCallback((index: number, event: LayoutChangeEvent) => {\n const { height } = event.nativeEvent.layout;\n setHeights((prev) => (prev[index] === height ? prev : { ...prev, [index]: height }));\n }, []);\n\n return (\n // TODO: web uses `scroll-snap-type: x mandatory` to snap between bubbles; ScrollView has no direct\n // equivalent (would need `snapToInterval`/`snapToOffsets`, which assume a fixed bubble width per size).\n <ScrollView horizontal contentContainerStyle={Styles.carousel}>\n {contents.map((bubble, index) => (\n <Bubble\n key={index}\n {...bubble}\n onClick={onClick}\n containerStyle={maxHeight !== undefined ? { height: maxHeight } : undefined}\n onLayout={measured ? undefined : (event) => handleLayout(index, event)}\n />\n ))}\n </ScrollView>\n );\n};\n\nconst Styles = StyleSheet.create({\n carousel: {\n flexDirection: \"row\",\n columnGap: 20,\n // Not \"stretch\": that's exactly the unreliable ScrollView cross-axis stretch this component works\n // around above — leaving it on lets the very first (pre-measurement) layout pass report an inflated\n // height, which then gets locked in as the \"tallest\" bubble for everyone to match.\n alignItems: \"flex-start\",\n },\n});\n","import type {\n Action,\n BubbleContainer,\n CarouselContainer,\n} from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { useCallback, useMemo } from \"react\";\nimport { Bubble } from \"./containers/bubble.js\";\nimport { Carousel } from \"./containers/carousel.js\";\n\ntype FlexMessageRendererProps = {\n /**\n * A JSON string representing the Flex Message to be rendered.\n */\n json: string;\n\n onAction?: (action: Action) => void;\n};\n\nexport const FlexMessageRenderer = ({ json, onAction }: FlexMessageRendererProps) => {\n const data = useMemo(() => {\n return JSON.parse(json) as CarouselContainer | BubbleContainer;\n }, [json]);\n const handleClick = useCallback(\n (action?: Action) => {\n if (action) {\n onAction?.(action);\n }\n },\n [onAction],\n );\n\n switch (data.type) {\n case \"bubble\":\n return <Bubble {...data} onClick={handleClick} />;\n\n case \"carousel\":\n return <Carousel {...data} onClick={handleClick} />;\n\n default:\n throw new Error(`Unsupported Flex Message type: ${data}`);\n }\n};\n","import { getActualNumericSize, getIconSize, type SpanComponent } from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { Text } from \"react-native\";\nimport { useDebugMode } from \"../context/debug.js\";\n\nexport const Span = ({ text, color, size, weight, style, decoration }: SpanComponent) => {\n const isDebugMode = useDebugMode();\n return <Text style={{\n color,\n fontSize: getActualNumericSize(getIconSize(size)),\n fontStyle: style,\n fontWeight: weight === \"regular\" ? \"400\" : weight,\n textDecorationLine: decoration !== \"none\" ? decoration : undefined,\n ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}),\n }}>\n {text}\n </Text>;\n};\n","import {\n getActualSize,\n getButtonHeight,\n getMarginSize,\n getOffset,\n type ButtonComponent,\n type ClickHandler,\n} from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { Text, TouchableOpacity as Touchable, View } from \"react-native\";\nimport { useParentFlexDirection } from \"../hooks/useParentFlexDirection.js\";\nimport { useDebugMode } from \"../context/debug.js\";\n\nexport const Button = ({\n action,\n adjustMode,\n color,\n flex,\n gravity,\n height,\n margin,\n offsetBottom,\n offsetEnd,\n offsetStart,\n offsetTop,\n position,\n scaling,\n style,\n onClick,\n}: ButtonComponent & { onClick?: ClickHandler | undefined }) => {\n const parentDirection = useParentFlexDirection();\n const isDebugMode = useDebugMode();\n const handleClick = () => {\n if (action) {\n onClick?.(action);\n }\n };\n // LINE's default button style is \"link\" when unspecified (matches the web port's `style ?? \"link\"`).\n const resolvedStyle = style ?? \"link\";\n const textColor = resolvedStyle === \"primary\" ? \"#fff\" : resolvedStyle === \"secondary\" ? \"#111111\" : resolvedStyle === \"link\" ? \"#42659a\" : undefined;\n\n return (\n <Touchable onPress={handleClick}>\n <View\n style={{\n ...(resolvedStyle === \"primary\" ? {\n backgroundColor: \"#17c950\",\n width: \"100%\",\n paddingTop: 0,\n paddingBottom: 0,\n paddingLeft: 16,\n paddingRight: 16,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: 8,\n } : {}),\n ...(resolvedStyle === \"secondary\" ? {\n backgroundColor: \"#dcdfe5\",\n width: \"100%\",\n paddingTop: 0,\n paddingBottom: 0,\n paddingLeft: 16,\n paddingRight: 16,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: 8,\n } : {}),\n ...(resolvedStyle === \"link\" ? {\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: \"transparent\",\n } : {}),\n // \"secondary\" has no dedicated look in the web port either (its CSS class is empty) — it just\n // renders as a plain, unstyled box with default text color.\n // Only override flex sizing when `flex` is actually specified (see text.tsx/box.tsx for why).\n // flexBasis is explicitly \"auto\" (matching the web port's `flex 0 auto`, not `flex 0 0`) so the\n // explicit `height` below still wins — an explicit flexBasis otherwise overrides `height`\n // entirely for flex layout, collapsing the button whenever its parent has no space to grow into.\n ...(flex !== undefined ? { flexGrow: flex === 0 ? 0 : flex, flexShrink: 0, flexBasis: \"auto\" } : {}),\n top: getActualSize(getOffset(offsetTop)),\n bottom: getActualSize(getOffset(offsetBottom)),\n left: getActualSize(getOffset(offsetStart)),\n right: getActualSize(getOffset(offsetEnd)),\n // `margin` is space along whichever axis the parent lays siblings out on — marginTop in a\n // \"column\" parent, marginLeft in a \"row\" (horizontal/baseline) parent.\n ...(parentDirection === \"column\"\n ? { marginTop: getActualSize(getMarginSize(margin)) }\n : { marginLeft: getActualSize(getMarginSize(margin)) }),\n position: position === undefined ? \"relative\" : position,\n height: getActualSize(getButtonHeight(height)),\n // `color` should only override the style preset's background when it's actually provided —\n // otherwise this erases the \"primary\" green / makes \"link\" buttons blend into the card.\n ...(color !== undefined ? { backgroundColor: color } : {}),\n ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}),\n }}\n >\n {action.type === \"uri\" && <Text style={{ color: textColor }}>{action.label}</Text>}\n {action.type === \"postback\" && <Text style={{ color: textColor }}>{action.displayText}</Text>}\n </View>\n </Touchable>\n );\n};\n","import {\n getImageSize,\n getMarginSize,\n getOffset,\n type ImageComponent,\n type ClickHandler,\n getActualSize,\n} from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { Image as RNImage, TouchableOpacity, View } from \"react-native\";\nimport { useDebugMode } from \"../context/debug.js\";\nimport { useParentFlexDirection } from \"../hooks/useParentFlexDirection.js\";\n\nexport const Image = ({\n url,\n flex,\n position,\n margin,\n offsetTop,\n offsetBottom,\n offsetStart,\n offsetEnd,\n align,\n gravity,\n size,\n aspectRatio,\n aspectMode,\n backgroundColor,\n animated,\n action,\n onClick,\n}: ImageComponent & { onClick?: ClickHandler | undefined }) => {\n const parentDirection = useParentFlexDirection();\n const isDebugMode = useDebugMode();\n const rawWidth = getImageSize(size);\n const sizeWidth = rawWidth === \"unset\" ? undefined : getActualSize(rawWidth);\n // When `flex` is meant to grow this image within a row/column of siblings, let it fill 100% of\n // whatever space it's allocated instead of the fixed `size` width — otherwise the fixed width fights\n // the flex-grown container for space (the fixed width wins, and the image can end up misplaced or\n // fully covered by a sibling that gets laid out for the space the image should have used).\n const width = flex ? \"100%\" : sizeWidth;\n const handleClick = () => {\n if (action) {\n onClick?.(action);\n }\n };\n\n return (\n <View\n style={{\n flexDirection: \"row\",\n justifyContent: \"center\",\n // Explicit flexGrow/flexShrink, not the bare `flex` shorthand (only to avoid ambiguity — the\n // shorthand's implied flexBasis:0% is actually what we want here, unlike box.tsx/text.tsx).\n // flexBasis stays \"0\", not \"auto\": an \"auto\" basis makes RN measure this View's content to find\n // its natural size, and Image's own natural-size measurement falls back to the source asset's\n // native pixel size instead of respecting `width`, letting one image claim all of its siblings'\n // space. Basis 0 sidesteps that measurement entirely — the final size is already fully\n // determined by the explicit width/aspectRatio below regardless of the starting basis.\n ...(flex !== undefined\n ? { flexGrow: flex === 0 ? 0 : flex, flexShrink: 0, flexBasis: flex === 0 ? \"auto\" : 0 }\n : { flexShrink: 1 }),\n // Same rule as below: only force a % height when width can't drive sizing on its own — otherwise\n // this resolves against whatever definite height it finds further up and stretches the whole card.\n ...(width === undefined ? { height: \"100%\" } : {}),\n // Auto left/right margins center a naturally-sized image, but they compete with flexGrow for the\n // same leftover space — skip them when `flex` is meant to actually grow this image instead.\n // `margin` itself is space along whichever axis the parent lays siblings out on — marginTop in a\n // \"column\" parent, marginLeft in a \"row\" (horizontal/baseline) parent.\n ...(margin\n ? parentDirection === \"column\"\n ? { marginTop: getActualSize(getMarginSize(margin)) }\n : { marginLeft: getActualSize(getMarginSize(margin)) }\n : flex\n ? {}\n : { marginTop: 0, marginBottom: 0, marginRight: \"auto\", marginLeft: \"auto\" }),\n ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}),\n }}\n >\n {action ?\n <TouchableOpacity onPress={handleClick} style={width !== undefined ? { width, ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}) } : { height: \"100%\", ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}) }}>\n <RNImage\n style={{\n aspectRatio: aspectRatio?.split(\":\").join(\"/\") ?? \"1\",\n objectFit: aspectMode === \"cover\" ? \"cover\" : \"contain\",\n backgroundColor,\n position: position === undefined ? \"relative\" : position,\n top: getActualSize(getOffset(offsetTop)),\n bottom: getActualSize(getOffset(offsetBottom)),\n left: getActualSize(getOffset(offsetStart)),\n right: getActualSize(getOffset(offsetEnd)),\n ...(width !== undefined ? { width } : { height: \"auto\", width: \"100%\" }),\n ...(isDebugMode ? { borderColor: \"blue\", borderWidth: 1 } : {}),\n }}\n source={{ uri: url }}\n />\n </TouchableOpacity>\n :\n <RNImage\n style={{\n aspectRatio: aspectRatio?.split(\":\").join(\"/\") ?? \"1\",\n objectFit: aspectMode === \"cover\" ? \"cover\" : \"contain\",\n backgroundColor,\n position: position === undefined ? \"relative\" : position,\n top: getActualSize(getOffset(offsetTop)),\n bottom: getActualSize(getOffset(offsetBottom)),\n left: getActualSize(getOffset(offsetStart)),\n right: getActualSize(getOffset(offsetEnd)),\n ...(width !== undefined ? { width } : { height: \"auto\", width: \"100%\" }),\n ...(isDebugMode ? { borderColor: \"blue\", borderWidth: 1 } : {}),\n }}\n source={{ uri: url }}\n />}\n {/* Only one of width/height may be definite — the other must stay unset so aspectRatio can derive it. */}\n\n </View>\n );\n};\n","import type { VideoComponent } from \"@ohmyteeth/line-flex-message-renderer-core\";\n\nimport type { ClickHandler } from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { TouchableOpacity } from \"react-native\";\n\nexport const Video = ({\n action,\n onClick,\n}: VideoComponent & { onClick?: ClickHandler | undefined }) => {\n const handleClick = () => {\n if (action) {\n onClick?.(action);\n }\n };\n\n return <TouchableOpacity onPress={handleClick} />;\n};\n","import {\n getActualNumericSize,\n getActualSize,\n getBorderRadius,\n getBorderWidth,\n getMarginSize,\n getOffset,\n getPaddingSize,\n getSpacingSize,\n renderComponent,\n type BoxComponent,\n type ClickHandler,\n} from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport React from \"react\";\nimport { TouchableOpacity, View, type ViewStyle } from \"react-native\";\nimport { ParentFlexDirectionProvider, useParentFlexDirection } from \"../hooks/useParentFlexDirection.js\";\nimport { useDebugMode } from \"../context/debug.js\";\n\nexport const Box = ({\n layout,\n contents,\n backgroundColor,\n borderColor,\n borderWidth,\n cornerRadius,\n width,\n maxWidth,\n height,\n maxHeight,\n flex,\n spacing,\n margin,\n paddingAll,\n paddingTop,\n paddingBottom,\n paddingStart,\n paddingEnd,\n position,\n offsetTop,\n offsetBottom,\n offsetStart,\n offsetEnd,\n justifyContent,\n alignItems,\n background,\n action,\n onClick,\n}: BoxComponent & { onClick?: ClickHandler | undefined }) => {\n const handleClick = () => {\n if (action) {\n onClick?.(action);\n }\n };\n const parentDirection = useParentFlexDirection();\n const isDebugMode = useDebugMode();\n const ownDirection = layout === \"vertical\" ? \"column\" : \"row\";\n\n const containerStyle: ViewStyle = {\n ...(layout === \"baseline\"\n ? { flexDirection: \"row\", alignItems: \"baseline\", columnGap: getActualSize(getSpacingSize(spacing)) }\n : layout === \"horizontal\"\n ? { flexDirection: \"row\", columnGap: getActualSize(getSpacingSize(spacing)) }\n : { flexDirection: \"column\", rowGap: getActualSize(getSpacingSize(spacing)) }),\n // flexBasis of 0 only makes sense along the parent's main axis when that axis has a definite total to\n // distribute — true for \"row\" parents here (bubble width is always fixed), but not for \"column\"\n // parents (bubble height is always auto/content-driven). In a \"column\" parent, flexBasis:0 makes this\n // box contribute nothing to that auto-height calculation, collapsing the whole ancestor chain to 0.\n ...(flex !== undefined\n ? {\n flexGrow: flex === 0 ? 0 : flex,\n flexShrink: 0,\n flexBasis: flex === 0 || parentDirection === \"column\" ? \"auto\" : 0,\n }\n : { flexShrink: 1 }),\n width: getActualSize(width) ?? (layout === \"baseline\" ? \"100%\" : undefined),\n maxWidth: getActualSize(maxWidth),\n height: getActualSize(height),\n maxHeight: getActualSize(maxHeight),\n backgroundColor: backgroundColor ?? background?.startColor,\n borderColor,\n borderWidth: getActualNumericSize(getBorderWidth(borderWidth)),\n borderRadius: getActualNumericSize(getBorderRadius(cornerRadius)),\n // Unlike CSS, RN's borderRadius only rounds this box's own background/border — it doesn't clip\n // children to the rounded shape unless overflow is also hidden (e.g. a square image inside a\n // circular avatar box would otherwise cover the rounded corners entirely).\n ...(cornerRadius !== undefined ? { overflow: \"hidden\" } : {}),\n paddingTop: getActualSize(getPaddingSize(paddingTop)),\n paddingBottom: getActualSize(getPaddingSize(paddingBottom)),\n paddingLeft: getActualSize(getPaddingSize(paddingStart)),\n paddingRight: getActualSize(getPaddingSize(paddingEnd)),\n padding: getActualSize(getPaddingSize(paddingAll)),\n // Same rule as text.tsx: `margin` is space along whichever axis the parent lays siblings out on —\n // marginTop in a \"column\" parent, marginLeft in a \"row\" (horizontal/baseline) parent.\n ...(parentDirection === \"column\"\n ? { marginTop: getActualSize(getMarginSize(margin)) }\n : { marginLeft: getActualSize(getMarginSize(margin)) }),\n position: position === undefined ? \"relative\" : position,\n // `alignItems` here (from the JSON) must win when explicitly set, but otherwise must NOT blindly\n // override the \"baseline\" set above for `layout:\"baseline\"` — it was doing exactly that (since this\n // key appears later in the same object), silently turning every baseline row into RN's default\n // \"stretch\" instead, which stretches every child to match the tallest sibling's height.\n alignItems: alignItems ?? (layout === \"baseline\" ? \"baseline\" : undefined),\n justifyContent,\n top: getActualSize(getOffset(offsetTop)),\n bottom: getActualSize(getOffset(offsetBottom)),\n left: getActualSize(getOffset(offsetStart)),\n right: getActualSize(getOffset(offsetEnd)),\n ...(width ? { flexShrink: 0 } : {}),\n ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}),\n };\n\n if (action) {\n return (\n <TouchableOpacity style={containerStyle} onPress={handleClick}>\n <ParentFlexDirectionProvider direction={ownDirection}>\n {contents.map((content, i) => (\n <React.Fragment key={i}>{renderComponent(content)}</React.Fragment>\n ))}\n </ParentFlexDirectionProvider>\n </TouchableOpacity>\n );\n }\n\n return (\n <View style={containerStyle}>\n <ParentFlexDirectionProvider direction={ownDirection}>\n {contents.map((content, i) => (\n <React.Fragment key={i}>{renderComponent(content)}</React.Fragment>\n ))}\n </ParentFlexDirectionProvider>\n </View>\n );\n};\n","import React from \"react\";\n\nconst MarginSizeContext = React.createContext<number | undefined>(undefined);\n\nexport const MarginSizeProvider = ({ children, marginSize }: { children: React.ReactNode; marginSize: number | undefined }) => {\n return <MarginSizeContext.Provider value={marginSize}>{children}</MarginSizeContext.Provider>;\n}\n\nexport const useInheritedMarginSize = () => {\n return React.useContext(MarginSizeContext);\n};","import {\n getActualSize,\n getIconSize,\n getMarginSize,\n getOffset,\n renderComponent,\n type TextComponent,\n type ClickHandler,\n} from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport React from \"react\";\nimport { useDebugMode } from \"../context/debug.js\";\nimport { Text as RNText, TouchableOpacity, type TextStyle, type ViewStyle } from \"react-native\";\nimport { MarginSizeProvider } from \"../hooks/useInheritedMarginSize.js\";\nimport { useParentFlexDirection } from \"../hooks/useParentFlexDirection.js\";\n\nexport const Text = ({\n text,\n contents,\n adjustMode,\n flex,\n margin,\n position,\n offsetTop,\n offsetBottom,\n offsetStart,\n offsetEnd,\n size,\n scaling,\n align,\n gravity,\n wrap,\n lineSpacing,\n maxLines,\n weight,\n color,\n style,\n decoration,\n action,\n onClick,\n}: TextComponent & { onClick?: ClickHandler | undefined }) => {\n const parentDirection = useParentFlexDirection();\n const isDebugMode = useDebugMode();\n const handleClick = () => {\n if (action) {\n onClick?.(action);\n }\n };\n\n if (!text && !contents) {\n return null;\n }\n\n const marginSize = getActualSize(getMarginSize(margin)) as number | undefined;\n\n const containerStyle: ViewStyle = {\n // Only override flex sizing when `flex` is actually specified. flexBasis:0 only makes sense along a\n // \"row\" parent's main axis (bubble width is always fixed) — a \"column\" parent's height is always\n // auto/content-driven, and flexBasis:0 there makes this Text contribute nothing to that calculation,\n // collapsing the whole auto-height ancestor chain. See box.tsx for the fuller explanation.\n // No flexShrink default when `flex` is undefined (unlike box.tsx): a plain label Text (e.g. \"ITEMS\"\n // next to a right-aligned price) needs to hold its natural width so its \"align:end\" sibling below is\n // the one that shrinks to fit — making this Text shrinkable too would let both compete for the same\n // space and truncate the label.\n ...(flex !== undefined\n ? {\n flexGrow: flex === 0 ? 0 : flex,\n flexShrink: 0,\n flexBasis: flex === 0 || parentDirection === \"column\" ? \"auto\" : 0,\n }\n : {}),\n // The space `margin` describes is this Text's own gap before its previous sibling, along whichever\n // axis the parent actually lays siblings out on — marginTop in a \"column\" (vertical) parent, but\n // marginLeft in a \"row\" (horizontal/baseline) parent, matching the web port's per-direction CSS.\n ...(parentDirection === \"column\" ? { marginTop: marginSize } : { marginLeft: marginSize }),\n top: getActualSize(getOffset(offsetTop)),\n bottom: getActualSize(getOffset(offsetBottom)),\n left: getActualSize(getOffset(offsetStart)),\n right: getActualSize(getOffset(offsetEnd)),\n position: position === undefined ? \"relative\" : position,\n width: align === \"center\" || (align === \"end\" && flex !== 0) ? \"100%\" : undefined,\n // RN defaults flexShrink to 0 (web defaults to 1), so without this a \"100%\"-wide row item can't\n // shrink to fit whatever space its siblings left behind and instead overflows past the card edge.\n // Skipped when `flex` is explicitly set, since that case is already fully handled above.\n ...((align === \"center\" || align === \"end\") && flex === undefined ? { flexShrink: 1 } : {}),\n ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}),\n };\n\n // RN has a known bug where a Text with numberOfLines inside an `alignItems:\"baseline\"` row can size its\n // container to the text's full untruncated height even though the text itself renders truncated (see\n // https://github.com/facebook/react-native/issues/35276). Row/baseline labels are short by convention\n // and the \"align:end\" siblings already shrink-to-fit instead of truncating, so it's safe to just not\n // cap line count there rather than risk that bug.\n const numberOfLines = maxLines ?? (wrap || parentDirection !== \"column\" ? undefined : 1);\n\n const textStyle: TextStyle = {\n color,\n fontSize: getActualSize(getIconSize(size)) as number | undefined,\n fontStyle: style,\n fontWeight: weight === \"regular\" ? \"400\" : weight,\n textAlign: align === \"center\" ? \"center\" : align === \"end\" ? \"right\" : \"left\",\n textDecorationLine: decoration !== \"none\" ? decoration : undefined,\n ...(isDebugMode ? { borderColor: \"blue\", borderWidth: 1 } : {}),\n };\n\n if (text) {\n return (\n <TouchableOpacity style={containerStyle} onPress={handleClick}>\n <MarginSizeProvider marginSize={marginSize}>\n <RNText style={textStyle} numberOfLines={numberOfLines} ellipsizeMode=\"tail\">\n {text}\n </RNText>\n </MarginSizeProvider>\n </TouchableOpacity>\n );\n }\n\n if (contents) {\n return (\n <TouchableOpacity style={containerStyle} onPress={handleClick}>\n <MarginSizeProvider marginSize={marginSize}>\n <RNText style={textStyle} numberOfLines={numberOfLines} ellipsizeMode=\"tail\">\n {contents.map((content, index) => (\n <React.Fragment key={index}>{renderComponent(content)}</React.Fragment>\n ))}\n </RNText>\n </MarginSizeProvider>\n </TouchableOpacity>\n );\n }\n};\n","import { getActualSize, getMarginSize, type SeparatorComponent } from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { View } from \"react-native\";\nimport { useParentFlexDirection } from \"../hooks/useParentFlexDirection.js\";\nimport { useDebugMode } from \"../context/debug.js\";\n\nexport const Separator = ({ margin, color }: SeparatorComponent) => {\n const parentDirection = useParentFlexDirection();\n const isDebugMode = useDebugMode();\n\n return (\n <View\n style={{\n height: 1,\n backgroundColor: color ?? \"#d4d6da\",\n ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}),\n // `margin` is space along whichever axis the parent lays siblings out on — marginTop in a\n // \"column\" parent, marginLeft in a \"row\" (horizontal/baseline) parent.\n ...(parentDirection === \"column\"\n ? { marginTop: getActualSize(getMarginSize(margin)) }\n : { marginLeft: getActualSize(getMarginSize(margin)) }),\n }}\n />\n );\n};\n","import { registerComponents } from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { Filler } from \"./components/filler.js\";\nimport { Icon } from \"./components/icon.js\";\nimport { FlexMessageRenderer } from \"./renderer.js\";\nimport { Span } from \"./components/span.js\";\nimport { Button } from \"./components/button.js\";\nimport { Image } from \"./components/image.js\";\nimport { Video } from \"./components/video.js\";\nimport { Box } from \"./components/box.js\";\nimport { Text } from \"./components/text.js\";\nimport { Separator } from \"./components/separator.js\";\n\nregisterComponents({\n box: Box,\n button: Button,\n filler: Filler,\n icon: Icon,\n image: Image,\n separator: Separator,\n span: Span,\n text: Text,\n video: Video,\n});\n\nexport { FlexMessageRenderer };\nexport { DebugProvider, useDebugMode } from \"./context/debug.js\";"],"mappings":";;;;;AAEA,MAAM,eAAe,cAAc,KAAK;AAExC,MAAa,iBAAiB,EAAE,UAAU,YACxC,oBAAC,aAAa,UAAd;CAA8B;CAC3B;AACoB,CAAA;AAGzB,MAAa,qBAAqB;CAChC,OAAO,WAAW,YAAY;AAChC;;;ACRA,MAAa,UAAU,EAAE,WAA4B;CAEnD,OAAO,oBAAC,MAAD,EAAM,OAAO;EAAE,UAAU;EAAG,YAAY;EAAG,WAAW;EAAG;EAAM,GADlD,aACgE,IAAI;GAAE,aAAa;GAAO,aAAa;EAAE,IAAI,CAAC;CAAG,EAAI,CAAA;AAC3I;;;ACLA,MAAM,6BAA6B,MAAM,cAAgC,QAAQ;AAEjF,MAAa,+BAA+B,EAC1C,UACA,gBAII;CAC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aAC9B,oBAACC,MAAD;IAAQ,OAAO;IAA0B;IAAe,eAAc;cACnE;GACK,CAAA;EACU,CAAA;CACJ,CAAA;CAItB,IAAI,UACF,OACE,oBAAC,kBAAD;EAAkB,OAAO;EAAgB,SAAS;YAChD,oBAAC,oBAAD;GAAgC;aAC9B,oBAACA,MAAD;IAAQ,OAAO;IAA0B;IAAe,eAAc;cACnE,SAAS,KAAK,SAAS,UACtB,oBAAC,MAAM,UAAP,EAAA,UAA6B,gBAAgB,OAAO,EAAkB,GAAjD,KAAiD,CACvE;GACK,CAAA;EACU,CAAA;CACJ,CAAA;AAGxB;;;AC5HA,MAAa,aAAa,EAAE,QAAQ,YAAgC;CAClE,MAAM,kBAAkB,uBAAuB;CAC/C,MAAM,cAAc,aAAa;CAEjC,OACE,oBAAC,MAAD,EACE,OAAO;EACL,QAAQ;EACR,iBAAiB,SAAS;EAC1B,GAAI,cAAc;GAAE,aAAa;GAAO,aAAa;EAAE,IAAI,CAAC;EAG5D,GAAI,oBAAoB,WACpB,EAAE,WAAW,cAAc,cAAc,MAAM,CAAC,EAAE,IAClD,EAAE,YAAY,cAAc,cAAc,MAAM,CAAC,EAAE;CACzD,EACD,CAAA;AAEL;;;ACXA,mBAAmB;CACjB,KAAK;CACL,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,OAAOC;CACP,WAAW;CACX,MAAM;CACN,MAAMC;CACN,OAAO;AACT,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["Styles","Touchable","Image","RNImage","Text","RNText","Image","Text"],"sources":["../src/context/debug.tsx","../src/components/filler.tsx","../src/hooks/useParentFlexDirection.tsx","../src/components/icon.tsx","../src/containers/bubble.tsx","../src/containers/carousel.tsx","../src/renderer.tsx","../src/components/span.tsx","../src/components/button.tsx","../src/components/image.tsx","../src/components/video.tsx","../src/components/box.tsx","../src/hooks/useInheritedMarginSize.tsx","../src/components/text.tsx","../src/components/separator.tsx","../src/index.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\n\nconst DebugContext = createContext(false);\n\nexport const DebugProvider = ({ children, value }: { children: React.ReactNode; value: boolean }) => (\n <DebugContext.Provider value={value}>\n {children}\n </DebugContext.Provider>\n);\n\nexport const useDebugMode = () => {\n return useContext(DebugContext);\n}\n","import type { FillerComponent } from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { View } from \"react-native\";\nimport { useDebugMode } from \"../context/debug.js\";\n\nexport const Filler = ({ flex }: FillerComponent) => {\n const isDebugMode = useDebugMode();\n return <View style={{ flexGrow: 1, flexShrink: 0, flexBasis: 0, flex, ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}) }} />;\n};\n","import React from \"react\";\n\nconst ParentFlexDirectionContext = React.createContext<\"row\" | \"column\">(\"column\");\n\nexport const ParentFlexDirectionProvider = ({\n children,\n direction,\n}: {\n children: React.ReactNode;\n direction: \"row\" | \"column\";\n}) => {\n return <ParentFlexDirectionContext.Provider value={direction}>{children}</ParentFlexDirectionContext.Provider>;\n};\n\nexport const useParentFlexDirection = () => {\n return React.useContext(ParentFlexDirectionContext);\n};\n","import {\n getActualSize,\n getIconSize,\n getMarginSize,\n getOffset,\n type IconComponent,\n} from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { Image, View } from \"react-native\";\nimport { useParentFlexDirection } from \"../hooks/useParentFlexDirection.js\";\nimport { useDebugMode } from \"../context/debug.js\";\n\nexport const Icon = ({\n url,\n margin,\n position,\n offsetTop,\n offsetBottom,\n offsetStart,\n offsetEnd,\n size,\n scaling,\n aspectRatio,\n}: IconComponent) => {\n const parentDirection = useParentFlexDirection();\n const isDebugMode = useDebugMode();\n // getIconSize(undefined) returns undefined; without this fallback an unsized icon renders at its source's native pixel size.\n const width = getActualSize(getIconSize(size ?? \"md\"));\n const marginSize = getActualSize(getMarginSize(margin));\n\n return (\n <View\n style={{\n width,\n flexShrink: 0,\n // `margin` is space along whichever axis the parent lays siblings out on — marginTop in a\n // \"column\" parent, marginLeft in a \"row\" (horizontal/baseline) parent.\n ...(parentDirection === \"column\" ? { marginTop: marginSize } : { marginLeft: marginSize }),\n ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}),\n }}\n >\n <Image\n style={{\n aspectRatio: aspectRatio?.split(\":\").join(\"/\") ?? \"1\",\n top: getActualSize(getOffset(offsetTop)),\n bottom: getActualSize(getOffset(offsetBottom)),\n left: getActualSize(getOffset(offsetStart)),\n right: getActualSize(getOffset(offsetEnd)),\n position: position === undefined ? \"relative\" : position,\n ...(isDebugMode ? { borderColor: \"blue\", borderWidth: 1 } : {}),\n }}\n source={{ uri: url }}\n />\n </View>\n );\n};\n","import {\n renderComponent,\n type BubbleContainer,\n type ClickHandler,\n} from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { StyleSheet, TouchableOpacity, View, type StyleProp, type ViewStyle, type LayoutChangeEvent } from \"react-native\";\n\nexport const Bubble = ({\n body,\n direction,\n footer,\n header,\n hero,\n size,\n styles,\n action,\n onClick,\n containerStyle,\n onLayout,\n}: BubbleContainer & {\n onClick?: ClickHandler | undefined;\n // Native-only, not part of the Flex Message spec: lets Carousel measure every bubble's natural height\n // and stretch them all to match the tallest one, since ScrollView content doesn't do this on its own.\n containerStyle?: StyleProp<ViewStyle>;\n onLayout?: ((event: LayoutChangeEvent) => void) | undefined;\n}) => {\n const hasHero = !!hero;\n const hasFooter = !!footer;\n const hasHeader = !!header;\n const handleClick = () => {\n if (action) {\n onClick?.(action);\n }\n };\n\n const inner = {\n ...Styles.bubbleInner,\n // Only when Carousel hands us an explicit (now definite, non-percentage) height to match: without\n // this, bubbleInner stays content-sized and the extra space added below is just blank/transparent.\n ...(containerStyle !== undefined && { flexGrow: 1 }),\n ...(size === \"nano\" && Styles.nanoInner),\n ...(size === \"micro\" && Styles.microInner),\n ...(size === \"deca\" && Styles.decaInner),\n ...(size === \"hecto\" && Styles.hectoInner),\n ...(size === \"kilo\" && Styles.kiloInner),\n ...(size === \"mega\" && Styles.megaInner),\n ...(size === \"giga\" && Styles.gigaInner),\n };\n\n const Component = action ? TouchableOpacity : View;\n return (\n <Component\n style={[{ ...Styles.bubble, ...Styles[size ?? \"mega\"] }, containerStyle]}\n onPress={handleClick}\n onLayout={onLayout}\n >\n <View style={inner}>\n {header && (\n <View\n style={{\n backgroundColor: styles?.header?.backgroundColor ?? \"#fff\",\n borderBottomWidth: styles?.header?.separator ? 1 : 0,\n borderColor: styles?.header?.separatorColor ?? \"#000\",\n }}\n >\n {renderComponent(header, onClick)}\n </View>\n )}\n\n {hero && (\n <View style={{ backgroundColor: styles?.hero?.backgroundColor ?? \"#fff\" }}>\n {renderComponent(hero, onClick)}\n </View>\n )}\n\n {body && (\n <View\n style={{\n ...Styles.body,\n ...(hasHeader && !body.paddingAll && Styles.bodyWithHeader),\n // The web port zeroes this out specifically for \"micro\" bubbles (see its CSS), since a\n // micro body commonly sets its own smaller `paddingAll` — without this exception the two\n // paddings stack (this wrapper's 20px plus the body Box's own), roughly doubling the gap.\n ...(hasHero && size !== \"micro\" && Styles.bodyWithHero),\n ...(hasFooter && Styles.bodyWithFooter),\n ...(!body.paddingAll && Styles.withPadding),\n backgroundColor: styles?.body?.backgroundColor ?? \"#fff\",\n }}\n >\n {renderComponent(body, onClick)}\n </View>\n )}\n\n {footer && (\n <View\n style={{\n ...Styles.footer,\n backgroundColor: styles?.footer?.backgroundColor ?? \"#fff\",\n borderTopWidth: styles?.footer?.separator ? 1 : 0,\n borderColor: styles?.footer?.separatorColor ?? \"#000\",\n }}\n >\n {renderComponent(footer, onClick)}\n </View>\n )}\n </View>\n </Component>\n );\n};\n\nconst Styles = StyleSheet.create({\n bubble: {\n flexDirection: \"column\",\n width: \"100%\",\n },\n bubbleInner: {\n flexDirection: \"column\",\n overflow: \"hidden\",\n borderRadius: 10,\n },\n nano: {\n width: 120,\n maxWidth: 120,\n },\n nanoInner: {\n borderRadius: 10,\n },\n micro: {\n width: 160,\n maxWidth: 160,\n },\n microInner: {\n borderRadius: 10,\n },\n deca: {\n width: 220,\n maxWidth: 220,\n },\n decaInner: {\n borderRadius: 10,\n },\n hecto: {\n width: 241,\n maxWidth: 241,\n },\n hectoInner: {\n borderRadius: 10,\n },\n kilo: {\n width: 260,\n maxWidth: 260,\n },\n kiloInner: {\n borderRadius: 10,\n },\n mega: {\n width: 300,\n maxWidth: 300,\n },\n megaInner: {\n borderRadius: 17,\n },\n giga: {\n width: 340,\n maxWidth: 340,\n },\n gigaInner: {\n borderRadius: 5,\n },\n body: {\n flexGrow: 1,\n },\n withPadding: {\n padding: 20,\n },\n bodyWithHeader: {\n padding: 20,\n },\n bodyWithHero: {\n padding: 20,\n },\n bodyWithFooter: {\n paddingBottom: 10,\n },\n footer: {\n padding: 10,\n },\n});\n","import {\n type CarouselContainer,\n type ClickHandler,\n} from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { useCallback, useState } from \"react\";\nimport { ScrollView, StyleSheet, type LayoutChangeEvent } from \"react-native\";\nimport { Bubble } from \"./bubble.js\";\n\nexport const Carousel = ({ contents, onClick }: CarouselContainer & { onClick?: ClickHandler }) => {\n // `alignItems: \"stretch\"` doesn't equalize bubble heights here — ScrollView content doesn't participate\n // in cross-axis stretch the way a plain flex row does — so each bubble's natural height is measured via\n // onLayout, and once all have reported in, every bubble is pinned to the tallest one's height.\n const [heights, setHeights] = useState<Record<number, number>>({});\n const measured = Object.keys(heights).length === contents.length;\n const maxHeight = measured ? Math.max(...Object.values(heights)) : undefined;\n\n const handleLayout = useCallback((index: number, event: LayoutChangeEvent) => {\n const { height } = event.nativeEvent.layout;\n setHeights((prev) => (prev[index] === height ? prev : { ...prev, [index]: height }));\n }, []);\n\n return (\n // TODO: web uses `scroll-snap-type: x mandatory` to snap between bubbles; ScrollView has no direct\n // equivalent (would need `snapToInterval`/`snapToOffsets`, which assume a fixed bubble width per size).\n <ScrollView horizontal contentContainerStyle={Styles.carousel}>\n {contents.map((bubble, index) => (\n <Bubble\n key={index}\n {...bubble}\n onClick={onClick}\n containerStyle={maxHeight !== undefined ? { height: maxHeight } : undefined}\n onLayout={measured ? undefined : (event) => handleLayout(index, event)}\n />\n ))}\n </ScrollView>\n );\n};\n\nconst Styles = StyleSheet.create({\n carousel: {\n flexDirection: \"row\",\n columnGap: 20,\n // Not \"stretch\": that's exactly the unreliable ScrollView cross-axis stretch this component works\n // around above — leaving it on lets the very first (pre-measurement) layout pass report an inflated\n // height, which then gets locked in as the \"tallest\" bubble for everyone to match.\n alignItems: \"flex-start\",\n },\n});\n","import type {\n Action,\n BubbleContainer,\n CarouselContainer,\n} from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { useCallback, useMemo } from \"react\";\nimport { Bubble } from \"./containers/bubble.js\";\nimport { Carousel } from \"./containers/carousel.js\";\n\ntype FlexMessageRendererProps = {\n /**\n * A JSON string representing the Flex Message to be rendered.\n */\n json: string;\n\n onAction?: (action: Action) => void;\n};\n\nexport const FlexMessageRenderer = ({ json, onAction }: FlexMessageRendererProps) => {\n const data = useMemo(() => {\n return JSON.parse(json) as CarouselContainer | BubbleContainer;\n }, [json]);\n const handleClick = useCallback(\n (action?: Action) => {\n if (action) {\n onAction?.(action);\n }\n },\n [onAction],\n );\n\n switch (data.type) {\n case \"bubble\":\n return <Bubble {...data} onClick={handleClick} />;\n\n case \"carousel\":\n return <Carousel {...data} onClick={handleClick} />;\n\n default:\n throw new Error(`Unsupported Flex Message type: ${data}`);\n }\n};\n","import { getActualNumericSize, getIconSize, type SpanComponent } from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { Text } from \"react-native\";\nimport { useDebugMode } from \"../context/debug.js\";\n\nexport const Span = ({ text, color, size, weight, style, decoration }: SpanComponent) => {\n const isDebugMode = useDebugMode();\n return <Text style={{\n color,\n fontSize: getActualNumericSize(getIconSize(size)),\n fontStyle: style,\n fontWeight: weight === \"regular\" ? \"400\" : weight,\n textDecorationLine: decoration !== \"none\" ? decoration : undefined,\n ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}),\n }}>\n {text}\n </Text>;\n};\n","import {\n getActualSize,\n getButtonHeight,\n getMarginSize,\n getOffset,\n type ButtonComponent,\n type ClickHandler,\n} from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { Text, TouchableOpacity as Touchable, View } from \"react-native\";\nimport { useParentFlexDirection } from \"../hooks/useParentFlexDirection.js\";\nimport { useDebugMode } from \"../context/debug.js\";\n\nexport const Button = ({\n action,\n adjustMode,\n color,\n flex,\n gravity,\n height,\n margin,\n offsetBottom,\n offsetEnd,\n offsetStart,\n offsetTop,\n position,\n scaling,\n style,\n onClick,\n}: ButtonComponent & { onClick?: ClickHandler | undefined }) => {\n const parentDirection = useParentFlexDirection();\n const isDebugMode = useDebugMode();\n const handleClick = () => {\n if (action) {\n onClick?.(action);\n }\n };\n // LINE's default button style is \"link\" when unspecified (matches the web port's `style ?? \"link\"`).\n const resolvedStyle = style ?? \"link\";\n const textColor = resolvedStyle === \"primary\" ? \"#fff\" : resolvedStyle === \"secondary\" ? \"#111111\" : resolvedStyle === \"link\" ? \"#42659a\" : undefined;\n\n return (\n <Touchable onPress={handleClick}>\n <View\n style={{\n ...(resolvedStyle === \"primary\" ? {\n backgroundColor: \"#17c950\",\n width: \"100%\",\n paddingTop: 0,\n paddingBottom: 0,\n paddingLeft: 16,\n paddingRight: 16,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: 8,\n } : {}),\n ...(resolvedStyle === \"secondary\" ? {\n backgroundColor: \"#dcdfe5\",\n width: \"100%\",\n paddingTop: 0,\n paddingBottom: 0,\n paddingLeft: 16,\n paddingRight: 16,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: 8,\n } : {}),\n ...(resolvedStyle === \"link\" ? {\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: \"transparent\",\n } : {}),\n // \"secondary\" has no dedicated look in the web port either (its CSS class is empty) — it just\n // renders as a plain, unstyled box with default text color.\n // Only override flex sizing when `flex` is actually specified (see text.tsx/box.tsx for why).\n // flexBasis is explicitly \"auto\" (matching the web port's `flex 0 auto`, not `flex 0 0`) so the\n // explicit `height` below still wins — an explicit flexBasis otherwise overrides `height`\n // entirely for flex layout, collapsing the button whenever its parent has no space to grow into.\n ...(flex !== undefined ? { flexGrow: flex === 0 ? 0 : flex, flexShrink: 0, flexBasis: \"auto\" } : {}),\n top: getActualSize(getOffset(offsetTop)),\n bottom: getActualSize(getOffset(offsetBottom)),\n left: getActualSize(getOffset(offsetStart)),\n right: getActualSize(getOffset(offsetEnd)),\n // `margin` is space along whichever axis the parent lays siblings out on — marginTop in a\n // \"column\" parent, marginLeft in a \"row\" (horizontal/baseline) parent.\n ...(parentDirection === \"column\"\n ? { marginTop: getActualSize(getMarginSize(margin)) }\n : { marginLeft: getActualSize(getMarginSize(margin)) }),\n position: position === undefined ? \"relative\" : position,\n height: getActualSize(getButtonHeight(height)),\n // `color` should only override the style preset's background when it's actually provided —\n // otherwise this erases the \"primary\" green / makes \"link\" buttons blend into the card.\n ...(color !== undefined ? { backgroundColor: color } : {}),\n ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}),\n }}\n >\n {action.type === \"uri\" && <Text style={{ color: textColor }}>{action.label}</Text>}\n {action.type === \"postback\" && <Text style={{ color: textColor }}>{action.displayText}</Text>}\n </View>\n </Touchable>\n );\n};\n","import {\n getImageSize,\n getMarginSize,\n getOffset,\n type ImageComponent,\n type ClickHandler,\n getActualSize,\n} from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { Image as RNImage, TouchableOpacity, View } from \"react-native\";\nimport { useDebugMode } from \"../context/debug.js\";\nimport { useParentFlexDirection } from \"../hooks/useParentFlexDirection.js\";\n\nexport const Image = ({\n url,\n flex,\n position,\n margin,\n offsetTop,\n offsetBottom,\n offsetStart,\n offsetEnd,\n align,\n gravity,\n size,\n aspectRatio,\n aspectMode,\n backgroundColor,\n animated,\n action,\n onClick,\n}: ImageComponent & { onClick?: ClickHandler | undefined }) => {\n const parentDirection = useParentFlexDirection();\n const isDebugMode = useDebugMode();\n const rawWidth = getImageSize(size);\n const sizeWidth = rawWidth === \"unset\" ? undefined : getActualSize(rawWidth);\n // When `flex` is meant to grow this image within a row/column of siblings, let it fill 100% of\n // whatever space it's allocated instead of the fixed `size` width — otherwise the fixed width fights\n // the flex-grown container for space (the fixed width wins, and the image can end up misplaced or\n // fully covered by a sibling that gets laid out for the space the image should have used).\n const width = flex ? \"100%\" : sizeWidth;\n const handleClick = () => {\n if (action) {\n onClick?.(action);\n }\n };\n\n return (\n <View\n style={{\n flexDirection: \"row\",\n justifyContent: \"center\",\n // Explicit flexGrow/flexShrink, not the bare `flex` shorthand (only to avoid ambiguity — the\n // shorthand's implied flexBasis:0% is actually what we want here, unlike box.tsx/text.tsx).\n // flexBasis stays \"0\", not \"auto\": an \"auto\" basis makes RN measure this View's content to find\n // its natural size, and Image's own natural-size measurement falls back to the source asset's\n // native pixel size instead of respecting `width`, letting one image claim all of its siblings'\n // space. Basis 0 sidesteps that measurement entirely — the final size is already fully\n // determined by the explicit width/aspectRatio below regardless of the starting basis.\n ...(flex !== undefined\n ? { flexGrow: flex === 0 ? 0 : flex, flexShrink: 0, flexBasis: flex === 0 ? \"auto\" : 0 }\n : { flexShrink: 1 }),\n // Same rule as below: only force a % height when width can't drive sizing on its own — otherwise\n // this resolves against whatever definite height it finds further up and stretches the whole card.\n ...(width === undefined ? { height: \"100%\" } : {}),\n // Auto left/right margins center a naturally-sized image, but they compete with flexGrow for the\n // same leftover space — skip them when `flex` is meant to actually grow this image instead.\n // `margin` itself is space along whichever axis the parent lays siblings out on — marginTop in a\n // \"column\" parent, marginLeft in a \"row\" (horizontal/baseline) parent.\n ...(margin\n ? parentDirection === \"column\"\n ? { marginTop: getActualSize(getMarginSize(margin)) }\n : { marginLeft: getActualSize(getMarginSize(margin)) }\n : flex\n ? {}\n : { marginTop: 0, marginBottom: 0, marginRight: \"auto\", marginLeft: \"auto\" }),\n ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}),\n }}\n >\n {action ?\n <TouchableOpacity onPress={handleClick} style={width !== undefined ? { width, ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}) } : { height: \"100%\", ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}) }}>\n <RNImage\n style={{\n aspectRatio: aspectRatio?.split(\":\").join(\"/\") ?? \"1\",\n objectFit: aspectMode === \"cover\" ? \"cover\" : \"contain\",\n backgroundColor,\n position: position === undefined ? \"relative\" : position,\n top: getActualSize(getOffset(offsetTop)),\n bottom: getActualSize(getOffset(offsetBottom)),\n left: getActualSize(getOffset(offsetStart)),\n right: getActualSize(getOffset(offsetEnd)),\n ...(width !== undefined ? { width } : { height: \"auto\", width: \"100%\" }),\n ...(isDebugMode ? { borderColor: \"blue\", borderWidth: 1 } : {}),\n }}\n source={{ uri: url }}\n />\n </TouchableOpacity>\n :\n <RNImage\n style={{\n aspectRatio: aspectRatio?.split(\":\").join(\"/\") ?? \"1\",\n objectFit: aspectMode === \"cover\" ? \"cover\" : \"contain\",\n backgroundColor,\n position: position === undefined ? \"relative\" : position,\n top: getActualSize(getOffset(offsetTop)),\n bottom: getActualSize(getOffset(offsetBottom)),\n left: getActualSize(getOffset(offsetStart)),\n right: getActualSize(getOffset(offsetEnd)),\n ...(width !== undefined ? { width } : { height: \"auto\", width: \"100%\" }),\n ...(isDebugMode ? { borderColor: \"blue\", borderWidth: 1 } : {}),\n }}\n source={{ uri: url }}\n />}\n {/* Only one of width/height may be definite — the other must stay unset so aspectRatio can derive it. */}\n\n </View>\n );\n};\n","import type { VideoComponent } from \"@ohmyteeth/line-flex-message-renderer-core\";\n\nimport type { ClickHandler } from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { TouchableOpacity } from \"react-native\";\n\nexport const Video = ({\n action,\n onClick,\n}: VideoComponent & { onClick?: ClickHandler | undefined }) => {\n const handleClick = () => {\n if (action) {\n onClick?.(action);\n }\n };\n\n return <TouchableOpacity onPress={handleClick} />;\n};\n","import {\n getActualNumericSize,\n getActualSize,\n getBorderRadius,\n getBorderWidth,\n getMarginSize,\n getOffset,\n getPaddingSize,\n getSpacingSize,\n renderComponent,\n type BoxComponent,\n type ClickHandler,\n} from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport React from \"react\";\nimport { TouchableOpacity, View, type ViewStyle } from \"react-native\";\nimport { ParentFlexDirectionProvider, useParentFlexDirection } from \"../hooks/useParentFlexDirection.js\";\nimport { useDebugMode } from \"../context/debug.js\";\n\nexport const Box = ({\n layout,\n contents,\n backgroundColor,\n borderColor,\n borderWidth,\n cornerRadius,\n width,\n maxWidth,\n height,\n maxHeight,\n flex,\n spacing,\n margin,\n paddingAll,\n paddingTop,\n paddingBottom,\n paddingStart,\n paddingEnd,\n position,\n offsetTop,\n offsetBottom,\n offsetStart,\n offsetEnd,\n justifyContent,\n alignItems,\n background,\n action,\n onClick,\n}: BoxComponent & { onClick?: ClickHandler | undefined }) => {\n const handleClick = () => {\n if (action) {\n onClick?.(action);\n }\n };\n const parentDirection = useParentFlexDirection();\n const isDebugMode = useDebugMode();\n const ownDirection = layout === \"vertical\" ? \"column\" : \"row\";\n\n const containerStyle: ViewStyle = {\n ...(layout === \"baseline\"\n ? { flexDirection: \"row\", alignItems: \"baseline\", columnGap: getActualSize(getSpacingSize(spacing)) }\n : layout === \"horizontal\"\n ? { flexDirection: \"row\", columnGap: getActualSize(getSpacingSize(spacing)) }\n : { flexDirection: \"column\", rowGap: getActualSize(getSpacingSize(spacing)) }),\n // flexBasis of 0 only makes sense along the parent's main axis when that axis has a definite total to\n // distribute — true for \"row\" parents here (bubble width is always fixed), but not for \"column\"\n // parents (bubble height is always auto/content-driven). In a \"column\" parent, flexBasis:0 makes this\n // box contribute nothing to that auto-height calculation, collapsing the whole ancestor chain to 0.\n ...(flex !== undefined\n ? {\n flexGrow: flex === 0 ? 0 : flex,\n flexShrink: 0,\n flexBasis: flex === 0 || parentDirection === \"column\" ? \"auto\" : 0,\n }\n : { flexShrink: 1 }),\n width: getActualSize(width) ?? (layout === \"baseline\" ? \"100%\" : undefined),\n maxWidth: getActualSize(maxWidth),\n height: getActualSize(height),\n maxHeight: getActualSize(maxHeight),\n backgroundColor: backgroundColor ?? background?.startColor,\n borderColor,\n borderWidth: getActualNumericSize(getBorderWidth(borderWidth)),\n borderRadius: getActualNumericSize(getBorderRadius(cornerRadius)),\n // Unlike CSS, RN's borderRadius only rounds this box's own background/border — it doesn't clip\n // children to the rounded shape unless overflow is also hidden (e.g. a square image inside a\n // circular avatar box would otherwise cover the rounded corners entirely).\n ...(cornerRadius !== undefined ? { overflow: \"hidden\" } : {}),\n paddingTop: getActualSize(getPaddingSize(paddingTop)),\n paddingBottom: getActualSize(getPaddingSize(paddingBottom)),\n paddingLeft: getActualSize(getPaddingSize(paddingStart)),\n paddingRight: getActualSize(getPaddingSize(paddingEnd)),\n padding: getActualSize(getPaddingSize(paddingAll)),\n // Same rule as text.tsx: `margin` is space along whichever axis the parent lays siblings out on —\n // marginTop in a \"column\" parent, marginLeft in a \"row\" (horizontal/baseline) parent.\n ...(parentDirection === \"column\"\n ? { marginTop: getActualSize(getMarginSize(margin)) }\n : { marginLeft: getActualSize(getMarginSize(margin)) }),\n position: position === undefined ? \"relative\" : position,\n // `alignItems` here (from the JSON) must win when explicitly set, but otherwise must NOT blindly\n // override the \"baseline\" set above for `layout:\"baseline\"` — it was doing exactly that (since this\n // key appears later in the same object), silently turning every baseline row into RN's default\n // \"stretch\" instead, which stretches every child to match the tallest sibling's height.\n alignItems: alignItems ?? (layout === \"baseline\" ? \"baseline\" : undefined),\n justifyContent,\n top: getActualSize(getOffset(offsetTop)),\n bottom: getActualSize(getOffset(offsetBottom)),\n left: getActualSize(getOffset(offsetStart)),\n right: getActualSize(getOffset(offsetEnd)),\n ...(width ? { flexShrink: 0 } : {}),\n ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}),\n };\n\n if (action) {\n return (\n <TouchableOpacity style={containerStyle} onPress={handleClick}>\n <ParentFlexDirectionProvider direction={ownDirection}>\n {contents.map((content, i) => (\n <React.Fragment key={i}>{renderComponent(content, onClick)}</React.Fragment>\n ))}\n </ParentFlexDirectionProvider>\n </TouchableOpacity>\n );\n }\n\n return (\n <View style={containerStyle}>\n <ParentFlexDirectionProvider direction={ownDirection}>\n {contents.map((content, i) => (\n <React.Fragment key={i}>{renderComponent(content, onClick)}</React.Fragment>\n ))}\n </ParentFlexDirectionProvider>\n </View>\n );\n};\n","import React from \"react\";\n\nconst MarginSizeContext = React.createContext<number | undefined>(undefined);\n\nexport const MarginSizeProvider = ({ children, marginSize }: { children: React.ReactNode; marginSize: number | undefined }) => {\n return <MarginSizeContext.Provider value={marginSize}>{children}</MarginSizeContext.Provider>;\n}\n\nexport const useInheritedMarginSize = () => {\n return React.useContext(MarginSizeContext);\n};","import {\n getActualSize,\n getIconSize,\n getMarginSize,\n getOffset,\n renderComponent,\n type TextComponent,\n type ClickHandler,\n} from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport React from \"react\";\nimport { useDebugMode } from \"../context/debug.js\";\nimport { Text as RNText, TouchableOpacity, type TextStyle, type ViewStyle } from \"react-native\";\nimport { MarginSizeProvider } from \"../hooks/useInheritedMarginSize.js\";\nimport { useParentFlexDirection } from \"../hooks/useParentFlexDirection.js\";\n\nexport const Text = ({\n text,\n contents,\n adjustMode,\n flex,\n margin,\n position,\n offsetTop,\n offsetBottom,\n offsetStart,\n offsetEnd,\n size,\n scaling,\n align,\n gravity,\n wrap,\n lineSpacing,\n maxLines,\n weight,\n color,\n style,\n decoration,\n action,\n onClick,\n}: TextComponent & { onClick?: ClickHandler | undefined }) => {\n const parentDirection = useParentFlexDirection();\n const isDebugMode = useDebugMode();\n const handleClick = () => {\n if (action) {\n onClick?.(action);\n }\n };\n\n if (!text && !contents) {\n return null;\n }\n\n const marginSize = getActualSize(getMarginSize(margin)) as number | undefined;\n\n const containerStyle: ViewStyle = {\n // Only override flex sizing when `flex` is actually specified. flexBasis:0 only makes sense along a\n // \"row\" parent's main axis (bubble width is always fixed) — a \"column\" parent's height is always\n // auto/content-driven, and flexBasis:0 there makes this Text contribute nothing to that calculation,\n // collapsing the whole auto-height ancestor chain. See box.tsx for the fuller explanation.\n // No flexShrink default when `flex` is undefined (unlike box.tsx): a plain label Text (e.g. \"ITEMS\"\n // next to a right-aligned price) needs to hold its natural width so its \"align:end\" sibling below is\n // the one that shrinks to fit — making this Text shrinkable too would let both compete for the same\n // space and truncate the label.\n ...(flex !== undefined\n ? {\n flexGrow: flex === 0 ? 0 : flex,\n flexShrink: 0,\n flexBasis: flex === 0 || parentDirection === \"column\" ? \"auto\" : 0,\n }\n : {}),\n // The space `margin` describes is this Text's own gap before its previous sibling, along whichever\n // axis the parent actually lays siblings out on — marginTop in a \"column\" (vertical) parent, but\n // marginLeft in a \"row\" (horizontal/baseline) parent, matching the web port's per-direction CSS.\n ...(parentDirection === \"column\" ? { marginTop: marginSize } : { marginLeft: marginSize }),\n top: getActualSize(getOffset(offsetTop)),\n bottom: getActualSize(getOffset(offsetBottom)),\n left: getActualSize(getOffset(offsetStart)),\n right: getActualSize(getOffset(offsetEnd)),\n position: position === undefined ? \"relative\" : position,\n width: align === \"center\" || (align === \"end\" && flex !== 0) ? \"100%\" : undefined,\n // RN defaults flexShrink to 0 (web defaults to 1), so without this a \"100%\"-wide row item can't\n // shrink to fit whatever space its siblings left behind and instead overflows past the card edge.\n // Skipped when `flex` is explicitly set, since that case is already fully handled above.\n ...((align === \"center\" || align === \"end\") && flex === undefined ? { flexShrink: 1 } : {}),\n ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}),\n };\n\n // RN has a known bug where a Text with numberOfLines inside an `alignItems:\"baseline\"` row can size its\n // container to the text's full untruncated height even though the text itself renders truncated (see\n // https://github.com/facebook/react-native/issues/35276). Row/baseline labels are short by convention\n // and the \"align:end\" siblings already shrink-to-fit instead of truncating, so it's safe to just not\n // cap line count there rather than risk that bug.\n const numberOfLines = maxLines ?? (wrap || parentDirection !== \"column\" ? undefined : 1);\n\n const textStyle: TextStyle = {\n color,\n fontSize: getActualSize(getIconSize(size)) as number | undefined,\n fontStyle: style,\n fontWeight: weight === \"regular\" ? \"400\" : weight,\n textAlign: align === \"center\" ? \"center\" : align === \"end\" ? \"right\" : \"left\",\n textDecorationLine: decoration !== \"none\" ? decoration : undefined,\n ...(isDebugMode ? { borderColor: \"blue\", borderWidth: 1 } : {}),\n };\n\n if (text) {\n return (\n <TouchableOpacity style={containerStyle} onPress={handleClick}>\n <MarginSizeProvider marginSize={marginSize}>\n <RNText style={textStyle} numberOfLines={numberOfLines} ellipsizeMode=\"tail\">\n {text}\n </RNText>\n </MarginSizeProvider>\n </TouchableOpacity>\n );\n }\n\n if (contents) {\n return (\n <TouchableOpacity style={containerStyle} onPress={handleClick}>\n <MarginSizeProvider marginSize={marginSize}>\n <RNText style={textStyle} numberOfLines={numberOfLines} ellipsizeMode=\"tail\">\n {contents.map((content, index) => (\n <React.Fragment key={index}>{renderComponent(content, onClick)}</React.Fragment>\n ))}\n </RNText>\n </MarginSizeProvider>\n </TouchableOpacity>\n );\n }\n};\n","import { getActualSize, getMarginSize, type SeparatorComponent } from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { View } from \"react-native\";\nimport { useParentFlexDirection } from \"../hooks/useParentFlexDirection.js\";\nimport { useDebugMode } from \"../context/debug.js\";\n\nexport const Separator = ({ margin, color }: SeparatorComponent) => {\n const parentDirection = useParentFlexDirection();\n const isDebugMode = useDebugMode();\n\n return (\n <View\n style={{\n height: 1,\n backgroundColor: color ?? \"#d4d6da\",\n ...(isDebugMode ? { borderColor: \"red\", borderWidth: 1 } : {}),\n // `margin` is space along whichever axis the parent lays siblings out on — marginTop in a\n // \"column\" parent, marginLeft in a \"row\" (horizontal/baseline) parent.\n ...(parentDirection === \"column\"\n ? { marginTop: getActualSize(getMarginSize(margin)) }\n : { marginLeft: getActualSize(getMarginSize(margin)) }),\n }}\n />\n );\n};\n","import { registerComponents } from \"@ohmyteeth/line-flex-message-renderer-core\";\nimport { Filler } from \"./components/filler.js\";\nimport { Icon } from \"./components/icon.js\";\nimport { FlexMessageRenderer } from \"./renderer.js\";\nimport { Span } from \"./components/span.js\";\nimport { Button } from \"./components/button.js\";\nimport { Image } from \"./components/image.js\";\nimport { Video } from \"./components/video.js\";\nimport { Box } from \"./components/box.js\";\nimport { Text } from \"./components/text.js\";\nimport { Separator } from \"./components/separator.js\";\n\nregisterComponents({\n box: Box,\n button: Button,\n filler: Filler,\n icon: Icon,\n image: Image,\n separator: Separator,\n span: Span,\n text: Text,\n video: Video,\n});\n\nexport { FlexMessageRenderer };\nexport { DebugProvider, useDebugMode } from \"./context/debug.js\";"],"mappings":";;;;;AAEA,MAAM,eAAe,cAAc,KAAK;AAExC,MAAa,iBAAiB,EAAE,UAAU,YACxC,oBAAC,aAAa,UAAd;CAA8B;CAC3B;AACoB,CAAA;AAGzB,MAAa,qBAAqB;CAChC,OAAO,WAAW,YAAY;AAChC;;;ACRA,MAAa,UAAU,EAAE,WAA4B;CAEnD,OAAO,oBAAC,MAAD,EAAM,OAAO;EAAE,UAAU;EAAG,YAAY;EAAG,WAAW;EAAG;EAAM,GADlD,aACgE,IAAI;GAAE,aAAa;GAAO,aAAa;EAAE,IAAI,CAAC;CAAG,EAAI,CAAA;AAC3I;;;ACLA,MAAM,6BAA6B,MAAM,cAAgC,QAAQ;AAEjF,MAAa,+BAA+B,EAC1C,UACA,gBAII;CACJ,OAAO,oBAAC,2BAA2B,UAA5B;EAAqC,OAAO;EAAY;CAA8C,CAAA;AAC/G;AAEA,MAAa,+BAA+B;CAC1C,OAAO,MAAM,WAAW,0BAA0B;AACpD;;;ACLA,MAAa,QAAQ,EACnB,KACA,QACA,UACA,WACA,cACA,aACA,WACA,MACA,SACA,kBACmB;CACnB,MAAM,kBAAkB,uBAAuB;CAC/C,MAAM,cAAc,aAAa;CAEjC,MAAM,QAAQ,cAAc,YAAY,QAAQ,IAAI,CAAC;CACrD,MAAM,aAAa,cAAc,cAAc,MAAM,CAAC;CA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GACK,CAAA;EACU,CAAA;CACJ,CAAA;AAGxB;;;AC5HA,MAAa,aAAa,EAAE,QAAQ,YAAgC;CAClE,MAAM,kBAAkB,uBAAuB;CAC/C,MAAM,cAAc,aAAa;CAEjC,OACE,oBAAC,MAAD,EACE,OAAO;EACL,QAAQ;EACR,iBAAiB,SAAS;EAC1B,GAAI,cAAc;GAAE,aAAa;GAAO,aAAa;EAAE,IAAI,CAAC;EAG5D,GAAI,oBAAoB,WACpB,EAAE,WAAW,cAAc,cAAc,MAAM,CAAC,EAAE,IAClD,EAAE,YAAY,cAAc,cAAc,MAAM,CAAC,EAAE;CACzD,EACD,CAAA;AAEL;;;ACXA,mBAAmB;CACjB,KAAK;CACL,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,OAAOC;CACP,WAAW;CACX,MAAM;CACN,MAAMC;CACN,OAAO;AACT,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ohmyteeth/react-native-line-flex-message-renderer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "This is a component library for rendering LINE Flex Messages in React Native.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Oh my teeth, Co.",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@ohmyteeth/line-flex-message-renderer-core": "0.
|
|
42
|
+
"@ohmyteeth/line-flex-message-renderer-core": "0.4.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@oxfmt/binding-darwin-arm64": "^0.58.0",
|