@multiplatform.one/rich-text 10.1.0 → 10.1.2

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.
@@ -127,10 +127,10 @@ function PreviewBlockText(param) {
127
127
  paddingStart: ((_block_indent = block.indent) !== null && _block_indent !== void 0 ? _block_indent : 0) * 12,
128
128
  children: [prefix, block.spans.map(function(span, i) {
129
129
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Text, {
130
- color: `${span.code ? "color-12" : void 0}`,
130
+ color: span.code ? "color-12" : void 0,
131
131
  fontWeight: span.bold ? "700" : void 0,
132
132
  fontStyle: span.italic ? "italic" : void 0,
133
- backgroundColor: `${span.code ? "color-4" : void 0}`,
133
+ backgroundColor: span.code ? "color-4" : void 0,
134
134
  textDecorationLine: span.underline && span.strike ? "underline line-through" : span.underline ? "underline" : span.strike ? "line-through" : void 0,
135
135
  children: span.text
136
136
  }, i);
@@ -127,10 +127,10 @@ function PreviewBlockText(param) {
127
127
  paddingStart: ((_block_indent = block.indent) !== null && _block_indent !== void 0 ? _block_indent : 0) * 12,
128
128
  children: [prefix, block.spans.map(function(span, i) {
129
129
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Text, {
130
- color: `${span.code ? "color-12" : void 0}`,
130
+ color: span.code ? "color-12" : void 0,
131
131
  fontWeight: span.bold ? "700" : void 0,
132
132
  fontStyle: span.italic ? "italic" : void 0,
133
- backgroundColor: `${span.code ? "color-4" : void 0}`,
133
+ backgroundColor: span.code ? "color-4" : void 0,
134
134
  textDecorationLine: span.underline && span.strike ? "underline line-through" : span.underline ? "underline" : span.strike ? "line-through" : void 0,
135
135
  children: span.text
136
136
  }, i);
@@ -1 +1 @@
1
- {"version":3,"file":"RichEditor.native.js","names":[],"sources":["cjs/RichEditor.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar RichEditor_native_exports = {};\n__export(RichEditor_native_exports, {\n RichEditor: () => RichEditor\n});\nmodule.exports = __toCommonJS(RichEditor_native_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = require(\"react\");\nvar import_react_native = require(\"react-native\");\nvar import_tamagui = require(\"tamagui\");\nvar import_theme = require(\"@multiplatform.one/theme\");\nvar import_components = require(\"@multiplatform.one/components\");\nvar import_react2 = require(\"@phosphor-icons/react\");\nvar import_forms = require(\"@multiplatform.one/forms\");\nvar import_types = require(\"./types\");\nvar import_context = require(\"./context\");\nvar import_styled = require(\"./styled\");\nvar import_FixedToolbar = require(\"./toolbar/FixedToolbar\");\nvar import_preview = require(\"./preview\");\nvar import_markdown = require(\"./editor/markdown\");\nvar import_t = require(\"./shared/t\");\nfunction NativeBubbleToolbar() {\n return null;\n}\nvar TentapEditor = null;\nvar tentapLoadError = null;\ntry {\n TentapEditor = require(\"./editor/TentapEditor.native\").TentapEditor;\n} catch (err) {\n tentapLoadError = err instanceof Error ? err.message : String(err);\n console.warn(\"[RichEditor] TentapEditor failed to load:\", tentapLoadError);\n}\nfunction TentapUnavailableMessage(param) {\n var { detail } = param;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {\n gap: \"2\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"3\",\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$orange-10\",\n fontSize: 14,\n fontWeight: \"700\",\n textAlign: \"center\",\n children: (0, import_t.t)(\"Rich text editor unavailable\")\n }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$color-11\",\n fontSize: 12,\n textAlign: \"center\",\n children: detail || (0, import_t.t)(\"TentapEditor failed to load (requires @10play/tentap-editor)\")\n })\n ]\n });\n}\nfunction TentapUnavailableEditor(props) {\n var _props_minHeight;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.View, {\n minHeight: (_props_minHeight = props.minHeight) !== null && _props_minHeight !== void 0 ? _props_minHeight : 150,\n padding: \"4\",\n justifyContent: \"center\",\n alignItems: \"center\",\n backgroundColor: \"orange-2\",\n borderWidth: 1,\n borderColor: \"orange-8\",\n borderRadius: \"3\",\n accessibilityRole: \"alert\",\n \"aria-label\": (0, import_t.t)(\"Rich text editor unavailable\"),\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapUnavailableMessage, {\n detail: tentapLoadError\n })\n });\n}\nvar HEADING_STYLE = {\n heading1: {\n fontSize: 20,\n fontWeight: \"700\"\n },\n heading2: {\n fontSize: 18,\n fontWeight: \"700\"\n },\n heading3: {\n fontSize: 16,\n fontWeight: \"600\"\n },\n heading4: {\n fontSize: 15,\n fontWeight: \"600\"\n },\n heading5: {\n fontSize: 14,\n fontWeight: \"600\"\n },\n heading6: {\n fontSize: 14,\n fontWeight: \"600\"\n }\n};\nfunction PreviewBlockText(param) {\n var { block } = param;\n var _block_index, _ref, _block_indent;\n var heading = HEADING_STYLE[block.kind];\n var prefix = block.kind === \"bullet\" ? \"\\u2022 \" : block.kind === \"ordered\" ? `${(_block_index = block.index) !== null && _block_index !== void 0 ? _block_index : 1}. ` : block.kind === \"task\" ? block.checked ? \"\\u2611 \" : \"\\u2610 \" : \"\";\n var body = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.Text, {\n color: block.quote ? \"$color-11\" : \"$color-12\",\n fontSize: (_ref = heading === null || heading === void 0 ? void 0 : heading.fontSize) !== null && _ref !== void 0 ? _ref : 14,\n fontWeight: heading === null || heading === void 0 ? void 0 : heading.fontWeight,\n fontStyle: block.quote ? \"italic\" : void 0,\n lineHeight: heading ? void 0 : 20,\n numberOfLines: heading ? 2 : 4,\n // RN logical prop so the block indent flips with I18nManager in RTL\n paddingStart: ((_block_indent = block.indent) !== null && _block_indent !== void 0 ? _block_indent : 0) * 12,\n children: [\n prefix,\n block.spans.map(function(span, i) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Text, {\n color: `${span.code ? \"color-12\" : void 0}`,\n fontWeight: span.bold ? \"700\" : void 0,\n fontStyle: span.italic ? \"italic\" : void 0,\n backgroundColor: `${span.code ? \"color-4\" : void 0}`,\n textDecorationLine: span.underline && span.strike ? \"underline line-through\" : span.underline ? \"underline\" : span.strike ? \"line-through\" : void 0,\n children: span.text\n }, i);\n })\n ]\n });\n if (block.quote) {\n return (\n // RN logical props so the quote rail flips with I18nManager in RTL\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.XStack, {\n borderStartWidth: 3,\n borderStartColor: \"color-6\",\n paddingStart: \"2\",\n children: body\n })\n );\n }\n return body;\n}\nvar RichEditorImpl = /* @__PURE__ */ (0, import_react.forwardRef)(function(param, ref) {\n var { size, showToolbar = true, showBubbleToolbar: _showBubbleToolbar, fullscreen: fullscreenProp, defaultFullscreen = false, onFullscreenChange, inlineEditing = false, sections, hasError, editable = true, onStateChange, minHeight = 150, maxHeight, ...editorProps } = param;\n var _editorProps_initialContent, _editorProps_initialContent1, _editorProps_initialContent2, _editorProps_initialContent3, _editorProps_initialContent4, _knobProps_sizeToken, _editorProps_placeholder, _committed_json, _editorProps_autoFocus;\n var _knobProps_body, _knobProps_heading;\n var internalRef = (0, import_react.useRef)(null);\n var [editorState, setEditorState] = (0, import_react.useState)(import_types.defaultEditorState);\n var [internalFullscreen, setInternalFullscreen] = (0, import_react.useState)(defaultFullscreen);\n var fullscreen = fullscreenProp !== null && fullscreenProp !== void 0 ? fullscreenProp : internalFullscreen;\n var [committed, setCommitted] = (0, import_react.useState)(function() {\n var _editorProps_initialContent6, _editorProps_initialJSON;\n return {\n html: (_editorProps_initialContent6 = editorProps.initialContent) !== null && _editorProps_initialContent6 !== void 0 ? _editorProps_initialContent6 : \"\",\n json: (_editorProps_initialJSON = editorProps.initialJSON) !== null && _editorProps_initialJSON !== void 0 ? _editorProps_initialJSON : null\n };\n });\n var committedRef = (0, import_react.useRef)(committed);\n committedRef.current = committed;\n var draftHtml = (0, import_react.useRef)(null);\n var draftJson = (0, import_react.useRef)(null);\n var lastInitialContent = (0, import_react.useRef)((_editorProps_initialContent = editorProps.initialContent) !== null && _editorProps_initialContent !== void 0 ? _editorProps_initialContent : \"\");\n var lastEmitted = (0, import_react.useRef)(null);\n if (!fullscreen && ((_editorProps_initialContent1 = editorProps.initialContent) !== null && _editorProps_initialContent1 !== void 0 ? _editorProps_initialContent1 : \"\") !== lastInitialContent.current && ((_editorProps_initialContent2 = editorProps.initialContent) !== null && _editorProps_initialContent2 !== void 0 ? _editorProps_initialContent2 : \"\") !== lastEmitted.current && ((_editorProps_initialContent3 = editorProps.initialContent) !== null && _editorProps_initialContent3 !== void 0 ? _editorProps_initialContent3 : \"\") !== committedRef.current.html) {\n var _editorProps_initialContent5;\n var html = (_editorProps_initialContent5 = editorProps.initialContent) !== null && _editorProps_initialContent5 !== void 0 ? _editorProps_initialContent5 : \"\";\n committedRef.current = {\n html,\n json: null\n };\n setCommitted(committedRef.current);\n }\n lastInitialContent.current = (_editorProps_initialContent4 = editorProps.initialContent) !== null && _editorProps_initialContent4 !== void 0 ? _editorProps_initialContent4 : \"\";\n var { knobProps } = (0, import_theme.useResolvedKnobs)({\n component: \"RichEditor\",\n size\n });\n var editGlyphColor = (0, import_theme.useGlyphColor)(\"$color-11\");\n var { bodyFontFamily, headingFontFamily } = (0, import_react.useMemo)(function() {\n var _getConfig, _knobProps_body2, _knobProps_heading2;\n var fonts = (_getConfig = (0, import_tamagui.getConfig)()) === null || _getConfig === void 0 ? void 0 : _getConfig.fonts;\n var resolve = function resolve2(token) {\n var _ref;\n var _fonts_key;\n var key = (_ref = token === null || token === void 0 ? void 0 : token.replace(/^\\$/, \"\")) !== null && _ref !== void 0 ? _ref : \"body\";\n var configured = fonts === null || fonts === void 0 ? void 0 : (_fonts_key = fonts[key]) === null || _fonts_key === void 0 ? void 0 : _fonts_key.family;\n var family = typeof configured === \"string\" ? configured.trim() : void 0;\n if (family && /(?:^|,)\\s*(?:serif|sans-serif|monospace|cursive|fantasy|system-ui|ui-serif|ui-sans-serif|ui-monospace|ui-rounded)\\s*$/i.test(family)) return family;\n var fallback = Object.hasOwn(import_theme.fontCategoryStacks, key) ? import_theme.fontCategoryStacks[key] : import_theme.fontCategoryStacks[\"sans-serif\"];\n return family ? `${family}, ${fallback}` : fallback;\n };\n return {\n bodyFontFamily: resolve((_knobProps_body2 = knobProps.body) === null || _knobProps_body2 === void 0 ? void 0 : _knobProps_body2.fontFamily),\n headingFontFamily: resolve((_knobProps_heading2 = knobProps.heading) === null || _knobProps_heading2 === void 0 ? void 0 : _knobProps_heading2.fontFamily)\n };\n }, [\n (_knobProps_body = knobProps.body) === null || _knobProps_body === void 0 ? void 0 : _knobProps_body.fontFamily,\n (_knobProps_heading = knobProps.heading) === null || _knobProps_heading === void 0 ? void 0 : _knobProps_heading.fontFamily\n ]);\n var handleStateChange = (0, import_react.useCallback)(function(state) {\n setEditorState(state);\n onStateChange === null || onStateChange === void 0 ? void 0 : onStateChange(state);\n }, [\n onStateChange\n ]);\n var handleFullscreenChange = (0, import_react.useCallback)(function(next) {\n setInternalFullscreen(next);\n onFullscreenChange === null || onFullscreenChange === void 0 ? void 0 : onFullscreenChange(next);\n }, [\n onFullscreenChange\n ]);\n var openFullscreen = (0, import_react.useCallback)(function() {\n draftHtml.current = null;\n draftJson.current = null;\n handleFullscreenChange(true);\n }, [\n handleFullscreenChange\n ]);\n var { onChange, onBlur } = editorProps;\n var handleCancel = (0, import_react.useCallback)(function() {\n handleFullscreenChange(false);\n onBlur === null || onBlur === void 0 ? void 0 : onBlur();\n }, [\n handleFullscreenChange,\n onBlur\n ]);\n var handleDone = (0, import_react.useCallback)(function() {\n var html2 = draftHtml.current;\n if (html2 !== null && html2 !== committedRef.current.html) {\n committedRef.current = {\n html: html2,\n json: draftJson.current\n };\n setCommitted(committedRef.current);\n lastEmitted.current = html2;\n onChange === null || onChange === void 0 ? void 0 : onChange(html2, draftJson.current);\n }\n handleFullscreenChange(false);\n onBlur === null || onBlur === void 0 ? void 0 : onBlur();\n }, [\n handleFullscreenChange,\n onChange,\n onBlur\n ]);\n (0, import_react.useImperativeHandle)(ref, function() {\n return {\n executeCommand: function executeCommand(command, payload) {\n var _internalRef_current;\n return (_internalRef_current = internalRef.current) === null || _internalRef_current === void 0 ? void 0 : _internalRef_current.executeCommand(command, payload);\n },\n getState: function getState() {\n var _ref;\n var _internalRef_current;\n return (_ref = (_internalRef_current = internalRef.current) === null || _internalRef_current === void 0 ? void 0 : _internalRef_current.getState()) !== null && _ref !== void 0 ? _ref : import_types.defaultEditorState;\n },\n getHTML: function getHTML() {\n return internalRef.current ? internalRef.current.getHTML() || committedRef.current.html : committedRef.current.html;\n },\n getJSON: function getJSON() {\n var _internalRef_current_getJSON;\n return internalRef.current ? (_internalRef_current_getJSON = internalRef.current.getJSON()) !== null && _internalRef_current_getJSON !== void 0 ? _internalRef_current_getJSON : committedRef.current.json : committedRef.current.json;\n },\n // Native markdown serialization is best-effort (turndown needs a\n // DOM): the editor delegates and returns \"\" when unavailable.\n getMarkdown: function getMarkdown() {\n if (internalRef.current) return internalRef.current.getMarkdown();\n try {\n return (0, import_markdown.htmlToMarkdown)(committedRef.current.html);\n } catch (err) {\n console.warn(\"[RichEditor] getMarkdown unavailable on native:\", err);\n return \"\";\n }\n },\n setMarkdown: function setMarkdown(markdown) {\n var html2 = (0, import_markdown.markdownToHtml)(markdown);\n if (internalRef.current) internalRef.current.setHTML(html2);\n else {\n committedRef.current = {\n html: html2,\n json: null\n };\n setCommitted(committedRef.current);\n }\n },\n setHTML: function setHTML(html2) {\n if (internalRef.current) internalRef.current.setHTML(html2);\n else {\n committedRef.current = {\n html: html2,\n json: null\n };\n setCommitted(committedRef.current);\n }\n },\n setJSON: function setJSON(json) {\n if (internalRef.current) internalRef.current.setJSON(json);\n else {\n committedRef.current = {\n ...committedRef.current,\n json\n };\n setCommitted(committedRef.current);\n }\n },\n focus: function focus() {\n if (internalRef.current) internalRef.current.focus();\n else if (!inlineEditing && editable) openFullscreen();\n },\n blur: function blur() {\n var _internalRef_current;\n return (_internalRef_current = internalRef.current) === null || _internalRef_current === void 0 ? void 0 : _internalRef_current.blur();\n }\n };\n }, [\n inlineEditing,\n editable,\n openFullscreen\n ]);\n var cappedRadius = (0, import_forms.clampRadiusForLargeComponent)(knobProps.borderRadius.borderRadius, 4);\n var disabled = !editable;\n var sizeToken = (_knobProps_sizeToken = knobProps.sizeToken) !== null && _knobProps_sizeToken !== void 0 ? _knobProps_sizeToken : \"4\";\n var editGlyphSize = (0, import_theme.sizeRecipeForToken)(sizeToken, {\n touch: true\n }).iconSize;\n var preview = (0, import_react.useMemo)(function() {\n return (0, import_preview.parseHtmlPreview)(committed.html, 6);\n }, [\n committed.html\n ]);\n var previewEmpty = preview.blocks.length === 0;\n if (inlineEditing) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.RichEditorContext.Provider, {\n size: sizeToken,\n disabled,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.EditorFrame, {\n hasError,\n borderRadius: cappedRadius,\n borderWidth: knobProps.borderRadius.borderWidth,\n borderColor: `${hasError ? \"red-10\" : \"color-6\"}`,\n disabled,\n children: [\n showToolbar && !disabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FixedToolbar.FixedToolbar, {\n editorRef: internalRef,\n state: editorState,\n sections,\n hasError\n }),\n TentapEditor ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapEditor, {\n ref: internalRef,\n minHeight,\n maxHeight,\n bodyFontFamily,\n headingFontFamily,\n ...editorProps,\n editable,\n onStateChange: handleStateChange,\n hasError: false\n }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.View, {\n minHeight,\n padding: knobProps.panelPadding.padding,\n justifyContent: \"center\",\n alignItems: \"center\",\n backgroundColor: \"orange-2\",\n accessibilityRole: \"alert\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapUnavailableMessage, {\n detail: tentapLoadError\n })\n })\n ]\n })\n });\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_context.RichEditorContext.Provider, {\n size: sizeToken,\n disabled,\n children: [\n /*\n RN Text/YStack steal taps from Tamagui View onPress, so the preview\n open target is a core Pressable. EditorFrame stays visual-only.\n */\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Pressable, {\n onPress: disabled ? void 0 : openFullscreen,\n disabled,\n accessibilityRole: \"button\",\n accessibilityLabel: (0, import_t.t)(\"Edit rich text\"),\n style: function style(param2) {\n var { pressed } = param2;\n return {\n opacity: pressed && !disabled ? 0.85 : 1\n };\n },\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.EditorFrame, {\n hasError,\n borderRadius: cappedRadius,\n borderWidth: knobProps.borderRadius.borderWidth,\n borderColor: `${hasError ? \"red-10\" : \"color-6\"}`,\n minHeight: Math.min(minHeight, 120),\n maxHeight: maxHeight !== null && maxHeight !== void 0 ? maxHeight : 240,\n pointerEvents: \"none\",\n disabled,\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {\n padding: knobProps.panelPadding.padding,\n paddingRight: \"6\",\n gap: \"1-5\",\n flex: 1,\n children: [\n !TentapEditor && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$orange-10\",\n fontSize: 12,\n children: (0, import_t.t)(\"Editor unavailable. Tap for details.\")\n }),\n previewEmpty ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$color-10\",\n fontSize: 14,\n lineHeight: 20,\n children: (_editorProps_placeholder = editorProps.placeholder) !== null && _editorProps_placeholder !== void 0 ? _editorProps_placeholder : (0, import_t.t)(\"Start writing...\")\n }) : preview.blocks.map(function(block, i) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PreviewBlockText, {\n block\n }, i);\n }),\n preview.truncated && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$color-10\",\n fontSize: 14,\n children: \"\\u2026\"\n })\n ]\n }),\n !disabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.View, {\n position: \"absolute\",\n top: \"2-5\",\n right: \"2-5\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.PencilSimpleIcon, {\n color: editGlyphColor,\n size: editGlyphSize,\n \"aria-hidden\": true\n })\n })\n ]\n })\n }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Modal, {\n visible: fullscreen,\n animationType: \"slide\",\n presentationStyle: \"fullScreen\",\n onRequestClose: handleCancel,\n children: fullscreen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {\n flex: 1,\n backgroundColor: \"background\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.KeyboardAvoidingView, {\n style: styles.flex,\n behavior: import_react_native.Platform.OS === \"ios\" ? \"padding\" : void 0,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.SafeAreaView, {\n style: styles.flex,\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, {\n alignItems: \"center\",\n justifyContent: \"space-between\",\n paddingHorizontal: \"2\",\n paddingVertical: \"1-5\",\n borderBottomWidth: 1,\n borderBottomColor: \"color-6\",\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ActionButton, {\n kind: \"cancel\",\n onPress: handleCancel\n }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ActionButton, {\n kind: \"done\",\n onPress: handleDone\n })\n ]\n }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {\n flex: 1,\n children: TentapEditor ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapEditor, {\n ref: internalRef,\n bodyFontFamily,\n headingFontFamily,\n ...editorProps,\n initialContent: committed.html,\n initialJSON: (_committed_json = committed.json) !== null && _committed_json !== void 0 ? _committed_json : void 0,\n autoFocus: (_editorProps_autoFocus = editorProps.autoFocus) !== null && _editorProps_autoFocus !== void 0 ? _editorProps_autoFocus : true,\n editable: true,\n fill: true,\n onChange: function onChange2(html2, json) {\n draftHtml.current = html2;\n draftJson.current = json;\n },\n onStateChange: handleStateChange,\n hasError: false\n }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.View, {\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: \"4\",\n backgroundColor: \"orange-2\",\n accessibilityRole: \"alert\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapUnavailableMessage, {\n detail: tentapLoadError\n })\n })\n }),\n showToolbar && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FixedToolbar.FixedToolbar, {\n editorRef: internalRef,\n state: editorState,\n sections,\n docked: \"bottom\"\n })\n ]\n })\n })\n })\n })\n ]\n });\n});\nRichEditorImpl.displayName = \"RichEditor\";\nvar styles = import_react_native.StyleSheet.create({\n flex: {\n flex: 1\n }\n});\nvar RichEditor = (0, import_tamagui.withStaticProperties)(RichEditorImpl, {\n FixedToolbar: import_FixedToolbar.FixedToolbar,\n BubbleToolbar: NativeBubbleToolbar,\n Editor: TentapEditor !== null && TentapEditor !== void 0 ? TentapEditor : TentapUnavail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U,QAAQ,oBAAoB,KAAK,IAAI,kBAAkB,KAAK;SAChH,YAAY,yBAAyB,YAAY,eAAe,QAAQ,2BAA2B,KAAK,IAAI,yBAAyB;SACrI,UAAU;SACV,MAAM;SACN,UAAU,SAAS,UAAU,OAAO,MAAM;UACxC,UAAU,UAAU;UACpB,UAAU,UAAU;SACtB;SACA,eAAe;SACf,UAAU;QACZ,CAAC,IAAoB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,eAAe,MAAM;SACpE,MAAM;SACN,gBAAgB;SAChB,YAAY;SACZ,SAAS;SACT,iBAAiB;SACjB,mBAAmB;SACnB,UAA0B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,0BAA0B,EAC9E,QAAQ,gBACV,CAAC;QACH,CAAC;OACH,CAAC;OACD,eAA+B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,oBAAoB,cAAc;QAC3F,WAAW;QACX,OAAO;QACP;QACA,QAAQ;OACV,CAAC;MACH;KACF,CAAC;IACH,CAAC;GACH,CAAC;EACH,CAAC,CACH;CACF,CAAC;AACH,CAAC;AACD,eAAe,cAAc;AAC7B,IAAI,SAAS,oBAAoB,WAAW,OAAO,EACjD,MAAM,EACJ,MAAM,EACR,EACF,CAAC;AACD,IAAI,cAAc,GAAG,eAAe,qBAAoB,CAAE,gBAAgB;CACxE,cAAc,oBAAoB;CAClC,eAAe;CACf,QAAQ,iBAAiB,QAAQ,iBAAiB,KAAK,IAAI,eAAe;AAC5E,CAAC"}
1
+ {"version":3,"file":"RichEditor.native.js","names":[],"sources":["cjs/RichEditor.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar RichEditor_native_exports = {};\n__export(RichEditor_native_exports, {\n RichEditor: () => RichEditor\n});\nmodule.exports = __toCommonJS(RichEditor_native_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = require(\"react\");\nvar import_react_native = require(\"react-native\");\nvar import_tamagui = require(\"tamagui\");\nvar import_theme = require(\"@multiplatform.one/theme\");\nvar import_components = require(\"@multiplatform.one/components\");\nvar import_react2 = require(\"@phosphor-icons/react\");\nvar import_forms = require(\"@multiplatform.one/forms\");\nvar import_types = require(\"./types\");\nvar import_context = require(\"./context\");\nvar import_styled = require(\"./styled\");\nvar import_FixedToolbar = require(\"./toolbar/FixedToolbar\");\nvar import_preview = require(\"./preview\");\nvar import_markdown = require(\"./editor/markdown\");\nvar import_t = require(\"./shared/t\");\nfunction NativeBubbleToolbar() {\n return null;\n}\nvar TentapEditor = null;\nvar tentapLoadError = null;\ntry {\n TentapEditor = require(\"./editor/TentapEditor.native\").TentapEditor;\n} catch (err) {\n tentapLoadError = err instanceof Error ? err.message : String(err);\n console.warn(\"[RichEditor] TentapEditor failed to load:\", tentapLoadError);\n}\nfunction TentapUnavailableMessage(param) {\n var { detail } = param;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {\n gap: \"2\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"3\",\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$orange-10\",\n fontSize: 14,\n fontWeight: \"700\",\n textAlign: \"center\",\n children: (0, import_t.t)(\"Rich text editor unavailable\")\n }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$color-11\",\n fontSize: 12,\n textAlign: \"center\",\n children: detail || (0, import_t.t)(\"TentapEditor failed to load (requires @10play/tentap-editor)\")\n })\n ]\n });\n}\nfunction TentapUnavailableEditor(props) {\n var _props_minHeight;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.View, {\n minHeight: (_props_minHeight = props.minHeight) !== null && _props_minHeight !== void 0 ? _props_minHeight : 150,\n padding: \"4\",\n justifyContent: \"center\",\n alignItems: \"center\",\n backgroundColor: \"orange-2\",\n borderWidth: 1,\n borderColor: \"orange-8\",\n borderRadius: \"3\",\n accessibilityRole: \"alert\",\n \"aria-label\": (0, import_t.t)(\"Rich text editor unavailable\"),\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapUnavailableMessage, {\n detail: tentapLoadError\n })\n });\n}\nvar HEADING_STYLE = {\n heading1: {\n fontSize: 20,\n fontWeight: \"700\"\n },\n heading2: {\n fontSize: 18,\n fontWeight: \"700\"\n },\n heading3: {\n fontSize: 16,\n fontWeight: \"600\"\n },\n heading4: {\n fontSize: 15,\n fontWeight: \"600\"\n },\n heading5: {\n fontSize: 14,\n fontWeight: \"600\"\n },\n heading6: {\n fontSize: 14,\n fontWeight: \"600\"\n }\n};\nfunction PreviewBlockText(param) {\n var { block } = param;\n var _block_index, _ref, _block_indent;\n var heading = HEADING_STYLE[block.kind];\n var prefix = block.kind === \"bullet\" ? \"\\u2022 \" : block.kind === \"ordered\" ? `${(_block_index = block.index) !== null && _block_index !== void 0 ? _block_index : 1}. ` : block.kind === \"task\" ? block.checked ? \"\\u2611 \" : \"\\u2610 \" : \"\";\n var body = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.Text, {\n color: block.quote ? \"$color-11\" : \"$color-12\",\n fontSize: (_ref = heading === null || heading === void 0 ? void 0 : heading.fontSize) !== null && _ref !== void 0 ? _ref : 14,\n fontWeight: heading === null || heading === void 0 ? void 0 : heading.fontWeight,\n fontStyle: block.quote ? \"italic\" : void 0,\n lineHeight: heading ? void 0 : 20,\n numberOfLines: heading ? 2 : 4,\n // RN logical prop so the block indent flips with I18nManager in RTL\n paddingStart: ((_block_indent = block.indent) !== null && _block_indent !== void 0 ? _block_indent : 0) * 12,\n children: [\n prefix,\n block.spans.map(function(span, i) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Text, {\n color: span.code ? \"color-12\" : void 0,\n fontWeight: span.bold ? \"700\" : void 0,\n fontStyle: span.italic ? \"italic\" : void 0,\n backgroundColor: span.code ? \"color-4\" : void 0,\n textDecorationLine: span.underline && span.strike ? \"underline line-through\" : span.underline ? \"underline\" : span.strike ? \"line-through\" : void 0,\n children: span.text\n }, i);\n })\n ]\n });\n if (block.quote) {\n return (\n // RN logical props so the quote rail flips with I18nManager in RTL\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.XStack, {\n borderStartWidth: 3,\n borderStartColor: \"color-6\",\n paddingStart: \"2\",\n children: body\n })\n );\n }\n return body;\n}\nvar RichEditorImpl = /* @__PURE__ */ (0, import_react.forwardRef)(function(param, ref) {\n var { size, showToolbar = true, showBubbleToolbar: _showBubbleToolbar, fullscreen: fullscreenProp, defaultFullscreen = false, onFullscreenChange, inlineEditing = false, sections, hasError, editable = true, onStateChange, minHeight = 150, maxHeight, ...editorProps } = param;\n var _editorProps_initialContent, _editorProps_initialContent1, _editorProps_initialContent2, _editorProps_initialContent3, _editorProps_initialContent4, _knobProps_sizeToken, _editorProps_placeholder, _committed_json, _editorProps_autoFocus;\n var _knobProps_body, _knobProps_heading;\n var internalRef = (0, import_react.useRef)(null);\n var [editorState, setEditorState] = (0, import_react.useState)(import_types.defaultEditorState);\n var [internalFullscreen, setInternalFullscreen] = (0, import_react.useState)(defaultFullscreen);\n var fullscreen = fullscreenProp !== null && fullscreenProp !== void 0 ? fullscreenProp : internalFullscreen;\n var [committed, setCommitted] = (0, import_react.useState)(function() {\n var _editorProps_initialContent6, _editorProps_initialJSON;\n return {\n html: (_editorProps_initialContent6 = editorProps.initialContent) !== null && _editorProps_initialContent6 !== void 0 ? _editorProps_initialContent6 : \"\",\n json: (_editorProps_initialJSON = editorProps.initialJSON) !== null && _editorProps_initialJSON !== void 0 ? _editorProps_initialJSON : null\n };\n });\n var committedRef = (0, import_react.useRef)(committed);\n committedRef.current = committed;\n var draftHtml = (0, import_react.useRef)(null);\n var draftJson = (0, import_react.useRef)(null);\n var lastInitialContent = (0, import_react.useRef)((_editorProps_initialContent = editorProps.initialContent) !== null && _editorProps_initialContent !== void 0 ? _editorProps_initialContent : \"\");\n var lastEmitted = (0, import_react.useRef)(null);\n if (!fullscreen && ((_editorProps_initialContent1 = editorProps.initialContent) !== null && _editorProps_initialContent1 !== void 0 ? _editorProps_initialContent1 : \"\") !== lastInitialContent.current && ((_editorProps_initialContent2 = editorProps.initialContent) !== null && _editorProps_initialContent2 !== void 0 ? _editorProps_initialContent2 : \"\") !== lastEmitted.current && ((_editorProps_initialContent3 = editorProps.initialContent) !== null && _editorProps_initialContent3 !== void 0 ? _editorProps_initialContent3 : \"\") !== committedRef.current.html) {\n var _editorProps_initialContent5;\n var html = (_editorProps_initialContent5 = editorProps.initialContent) !== null && _editorProps_initialContent5 !== void 0 ? _editorProps_initialContent5 : \"\";\n committedRef.current = {\n html,\n json: null\n };\n setCommitted(committedRef.current);\n }\n lastInitialContent.current = (_editorProps_initialContent4 = editorProps.initialContent) !== null && _editorProps_initialContent4 !== void 0 ? _editorProps_initialContent4 : \"\";\n var { knobProps } = (0, import_theme.useResolvedKnobs)({\n component: \"RichEditor\",\n size\n });\n var editGlyphColor = (0, import_theme.useGlyphColor)(\"$color-11\");\n var { bodyFontFamily, headingFontFamily } = (0, import_react.useMemo)(function() {\n var _getConfig, _knobProps_body2, _knobProps_heading2;\n var fonts = (_getConfig = (0, import_tamagui.getConfig)()) === null || _getConfig === void 0 ? void 0 : _getConfig.fonts;\n var resolve = function resolve2(token) {\n var _ref;\n var _fonts_key;\n var key = (_ref = token === null || token === void 0 ? void 0 : token.replace(/^\\$/, \"\")) !== null && _ref !== void 0 ? _ref : \"body\";\n var configured = fonts === null || fonts === void 0 ? void 0 : (_fonts_key = fonts[key]) === null || _fonts_key === void 0 ? void 0 : _fonts_key.family;\n var family = typeof configured === \"string\" ? configured.trim() : void 0;\n if (family && /(?:^|,)\\s*(?:serif|sans-serif|monospace|cursive|fantasy|system-ui|ui-serif|ui-sans-serif|ui-monospace|ui-rounded)\\s*$/i.test(family)) return family;\n var fallback = Object.hasOwn(import_theme.fontCategoryStacks, key) ? import_theme.fontCategoryStacks[key] : import_theme.fontCategoryStacks[\"sans-serif\"];\n return family ? `${family}, ${fallback}` : fallback;\n };\n return {\n bodyFontFamily: resolve((_knobProps_body2 = knobProps.body) === null || _knobProps_body2 === void 0 ? void 0 : _knobProps_body2.fontFamily),\n headingFontFamily: resolve((_knobProps_heading2 = knobProps.heading) === null || _knobProps_heading2 === void 0 ? void 0 : _knobProps_heading2.fontFamily)\n };\n }, [\n (_knobProps_body = knobProps.body) === null || _knobProps_body === void 0 ? void 0 : _knobProps_body.fontFamily,\n (_knobProps_heading = knobProps.heading) === null || _knobProps_heading === void 0 ? void 0 : _knobProps_heading.fontFamily\n ]);\n var handleStateChange = (0, import_react.useCallback)(function(state) {\n setEditorState(state);\n onStateChange === null || onStateChange === void 0 ? void 0 : onStateChange(state);\n }, [\n onStateChange\n ]);\n var handleFullscreenChange = (0, import_react.useCallback)(function(next) {\n setInternalFullscreen(next);\n onFullscreenChange === null || onFullscreenChange === void 0 ? void 0 : onFullscreenChange(next);\n }, [\n onFullscreenChange\n ]);\n var openFullscreen = (0, import_react.useCallback)(function() {\n draftHtml.current = null;\n draftJson.current = null;\n handleFullscreenChange(true);\n }, [\n handleFullscreenChange\n ]);\n var { onChange, onBlur } = editorProps;\n var handleCancel = (0, import_react.useCallback)(function() {\n handleFullscreenChange(false);\n onBlur === null || onBlur === void 0 ? void 0 : onBlur();\n }, [\n handleFullscreenChange,\n onBlur\n ]);\n var handleDone = (0, import_react.useCallback)(function() {\n var html2 = draftHtml.current;\n if (html2 !== null && html2 !== committedRef.current.html) {\n committedRef.current = {\n html: html2,\n json: draftJson.current\n };\n setCommitted(committedRef.current);\n lastEmitted.current = html2;\n onChange === null || onChange === void 0 ? void 0 : onChange(html2, draftJson.current);\n }\n handleFullscreenChange(false);\n onBlur === null || onBlur === void 0 ? void 0 : onBlur();\n }, [\n handleFullscreenChange,\n onChange,\n onBlur\n ]);\n (0, import_react.useImperativeHandle)(ref, function() {\n return {\n executeCommand: function executeCommand(command, payload) {\n var _internalRef_current;\n return (_internalRef_current = internalRef.current) === null || _internalRef_current === void 0 ? void 0 : _internalRef_current.executeCommand(command, payload);\n },\n getState: function getState() {\n var _ref;\n var _internalRef_current;\n return (_ref = (_internalRef_current = internalRef.current) === null || _internalRef_current === void 0 ? void 0 : _internalRef_current.getState()) !== null && _ref !== void 0 ? _ref : import_types.defaultEditorState;\n },\n getHTML: function getHTML() {\n return internalRef.current ? internalRef.current.getHTML() || committedRef.current.html : committedRef.current.html;\n },\n getJSON: function getJSON() {\n var _internalRef_current_getJSON;\n return internalRef.current ? (_internalRef_current_getJSON = internalRef.current.getJSON()) !== null && _internalRef_current_getJSON !== void 0 ? _internalRef_current_getJSON : committedRef.current.json : committedRef.current.json;\n },\n // Native markdown serialization is best-effort (turndown needs a\n // DOM): the editor delegates and returns \"\" when unavailable.\n getMarkdown: function getMarkdown() {\n if (internalRef.current) return internalRef.current.getMarkdown();\n try {\n return (0, import_markdown.htmlToMarkdown)(committedRef.current.html);\n } catch (err) {\n console.warn(\"[RichEditor] getMarkdown unavailable on native:\", err);\n return \"\";\n }\n },\n setMarkdown: function setMarkdown(markdown) {\n var html2 = (0, import_markdown.markdownToHtml)(markdown);\n if (internalRef.current) internalRef.current.setHTML(html2);\n else {\n committedRef.current = {\n html: html2,\n json: null\n };\n setCommitted(committedRef.current);\n }\n },\n setHTML: function setHTML(html2) {\n if (internalRef.current) internalRef.current.setHTML(html2);\n else {\n committedRef.current = {\n html: html2,\n json: null\n };\n setCommitted(committedRef.current);\n }\n },\n setJSON: function setJSON(json) {\n if (internalRef.current) internalRef.current.setJSON(json);\n else {\n committedRef.current = {\n ...committedRef.current,\n json\n };\n setCommitted(committedRef.current);\n }\n },\n focus: function focus() {\n if (internalRef.current) internalRef.current.focus();\n else if (!inlineEditing && editable) openFullscreen();\n },\n blur: function blur() {\n var _internalRef_current;\n return (_internalRef_current = internalRef.current) === null || _internalRef_current === void 0 ? void 0 : _internalRef_current.blur();\n }\n };\n }, [\n inlineEditing,\n editable,\n openFullscreen\n ]);\n var cappedRadius = (0, import_forms.clampRadiusForLargeComponent)(knobProps.borderRadius.borderRadius, 4);\n var disabled = !editable;\n var sizeToken = (_knobProps_sizeToken = knobProps.sizeToken) !== null && _knobProps_sizeToken !== void 0 ? _knobProps_sizeToken : \"4\";\n var editGlyphSize = (0, import_theme.sizeRecipeForToken)(sizeToken, {\n touch: true\n }).iconSize;\n var preview = (0, import_react.useMemo)(function() {\n return (0, import_preview.parseHtmlPreview)(committed.html, 6);\n }, [\n committed.html\n ]);\n var previewEmpty = preview.blocks.length === 0;\n if (inlineEditing) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.RichEditorContext.Provider, {\n size: sizeToken,\n disabled,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.EditorFrame, {\n hasError,\n borderRadius: cappedRadius,\n borderWidth: knobProps.borderRadius.borderWidth,\n borderColor: `${hasError ? \"red-10\" : \"color-6\"}`,\n disabled,\n children: [\n showToolbar && !disabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FixedToolbar.FixedToolbar, {\n editorRef: internalRef,\n state: editorState,\n sections,\n hasError\n }),\n TentapEditor ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapEditor, {\n ref: internalRef,\n minHeight,\n maxHeight,\n bodyFontFamily,\n headingFontFamily,\n ...editorProps,\n editable,\n onStateChange: handleStateChange,\n hasError: false\n }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.View, {\n minHeight,\n padding: knobProps.panelPadding.padding,\n justifyContent: \"center\",\n alignItems: \"center\",\n backgroundColor: \"orange-2\",\n accessibilityRole: \"alert\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapUnavailableMessage, {\n detail: tentapLoadError\n })\n })\n ]\n })\n });\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_context.RichEditorContext.Provider, {\n size: sizeToken,\n disabled,\n children: [\n /*\n RN Text/YStack steal taps from Tamagui View onPress, so the preview\n open target is a core Pressable. EditorFrame stays visual-only.\n */\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Pressable, {\n onPress: disabled ? void 0 : openFullscreen,\n disabled,\n accessibilityRole: \"button\",\n accessibilityLabel: (0, import_t.t)(\"Edit rich text\"),\n style: function style(param2) {\n var { pressed } = param2;\n return {\n opacity: pressed && !disabled ? 0.85 : 1\n };\n },\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.EditorFrame, {\n hasError,\n borderRadius: cappedRadius,\n borderWidth: knobProps.borderRadius.borderWidth,\n borderColor: `${hasError ? \"red-10\" : \"color-6\"}`,\n minHeight: Math.min(minHeight, 120),\n maxHeight: maxHeight !== null && maxHeight !== void 0 ? maxHeight : 240,\n pointerEvents: \"none\",\n disabled,\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {\n padding: knobProps.panelPadding.padding,\n paddingRight: \"6\",\n gap: \"1-5\",\n flex: 1,\n children: [\n !TentapEditor && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$orange-10\",\n fontSize: 12,\n children: (0, import_t.t)(\"Editor unavailable. Tap for details.\")\n }),\n previewEmpty ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$color-10\",\n fontSize: 14,\n lineHeight: 20,\n children: (_editorProps_placeholder = editorProps.placeholder) !== null && _editorProps_placeholder !== void 0 ? _editorProps_placeholder : (0, import_t.t)(\"Start writing...\")\n }) : preview.blocks.map(function(block, i) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PreviewBlockText, {\n block\n }, i);\n }),\n preview.truncated && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$color-10\",\n fontSize: 14,\n children: \"\\u2026\"\n })\n ]\n }),\n !disabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.View, {\n position: \"absolute\",\n top: \"2-5\",\n right: \"2-5\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.PencilSimpleIcon, {\n color: editGlyphColor,\n size: editGlyphSize,\n \"aria-hidden\": true\n })\n })\n ]\n })\n }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Modal, {\n visible: fullscreen,\n animationType: \"slide\",\n presentationStyle: \"fullScreen\",\n onRequestClose: handleCancel,\n children: fullscreen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {\n flex: 1,\n backgroundColor: \"background\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.KeyboardAvoidingView, {\n style: styles.flex,\n behavior: import_react_native.Platform.OS === \"ios\" ? \"padding\" : void 0,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.SafeAreaView, {\n style: styles.flex,\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, {\n alignItems: \"center\",\n justifyContent: \"space-between\",\n paddingHorizontal: \"2\",\n paddingVertical: \"1-5\",\n borderBottomWidth: 1,\n borderBottomColor: \"color-6\",\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ActionButton, {\n kind: \"cancel\",\n onPress: handleCancel\n }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ActionButton, {\n kind: \"done\",\n onPress: handleDone\n })\n ]\n }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {\n flex: 1,\n children: TentapEditor ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapEditor, {\n ref: internalRef,\n bodyFontFamily,\n headingFontFamily,\n ...editorProps,\n initialContent: committed.html,\n initialJSON: (_committed_json = committed.json) !== null && _committed_json !== void 0 ? _committed_json : void 0,\n autoFocus: (_editorProps_autoFocus = editorProps.autoFocus) !== null && _editorProps_autoFocus !== void 0 ? _editorProps_autoFocus : true,\n editable: true,\n fill: true,\n onChange: function onChange2(html2, json) {\n draftHtml.current = html2;\n draftJson.current = json;\n },\n onStateChange: handleStateChange,\n hasError: false\n }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.View, {\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: \"4\",\n backgroundColor: \"orange-2\",\n accessibilityRole: \"alert\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapUnavailableMessage, {\n detail: tentapLoadError\n })\n })\n }),\n showToolbar && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FixedToolbar.FixedToolbar, {\n editorRef: internalRef,\n state: editorState,\n sections,\n docked: \"bottom\"\n })\n ]\n })\n })\n })\n })\n ]\n });\n});\nRichEditorImpl.displayName = \"RichEditor\";\nvar styles = import_react_native.StyleSheet.create({\n flex: {\n flex: 1\n }\n});\nvar RichEditor = (0, import_tamagui.withStaticProperties)(RichEditorImpl, {\n FixedToolbar: import_FixedToolbar.FixedToolbar,\n BubbleToolbar: NativeBubbleToolbar,\n Editor: TentapEditor !== null && TentapEditor !== void 0 ? TentapEditor : TentapUnavailableEditor\n});\n//# sourceMappingURL=RichEditor.native.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,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UACpB,UAAU,UAAU;SACtB;SACA,eAAe;SACf,UAAU;QACZ,CAAC,IAAoB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,eAAe,MAAM;SACpE,MAAM;SACN,gBAAgB;SAChB,YAAY;SACZ,SAAS;SACT,iBAAiB;SACjB,mBAAmB;SACnB,UAA0B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,0BAA0B,EAC9E,QAAQ,gBACV,CAAC;QACH,CAAC;OACH,CAAC;OACD,eAA+B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,oBAAoB,cAAc;QAC3F,WAAW;QACX,OAAO;QACP;QACA,QAAQ;OACV,CAAC;MACH;KACF,CAAC;IACH,CAAC;GACH,CAAC;EACH,CAAC,CACH;CACF,CAAC;AACH,CAAC;AACD,eAAe,cAAc;AAC7B,IAAI,SAAS,oBAAoB,WAAW,OAAO,EACjD,MAAM,EACJ,MAAM,EACR,EACF,CAAC;AACD,IAAI,cAAc,GAAG,eAAe,qBAAoB,CAAE,gBAAgB;CACxE,cAAc,oBAAoB;CAClC,eAAe;CACf,QAAQ,iBAAiB,QAAQ,iBAAiB,KAAK,IAAI,eAAe;AAC5E,CAAC"}
@@ -103,10 +103,10 @@ function PreviewBlockText(param) {
103
103
  paddingStart: ((_block_indent = block.indent) !== null && _block_indent !== void 0 ? _block_indent : 0) * 12,
104
104
  children: [prefix, block.spans.map(function(span, i) {
105
105
  return /* @__PURE__ */ jsx(Text, {
106
- color: `${span.code ? "color-12" : void 0}`,
106
+ color: span.code ? "color-12" : void 0,
107
107
  fontWeight: span.bold ? "700" : void 0,
108
108
  fontStyle: span.italic ? "italic" : void 0,
109
- backgroundColor: `${span.code ? "color-4" : void 0}`,
109
+ backgroundColor: span.code ? "color-4" : void 0,
110
110
  textDecorationLine: span.underline && span.strike ? "underline line-through" : span.underline ? "underline" : span.strike ? "line-through" : void 0,
111
111
  children: span.text
112
112
  }, i);
@@ -1 +1 @@
1
- {"version":3,"file":"RichEditor.native.js","names":["Text","TamaguiText"],"sources":["esm/RichEditor.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { forwardRef, useCallback, useImperativeHandle, useMemo, useRef, useState } from \"react\";\nimport { KeyboardAvoidingView, Modal, Platform, Pressable, SafeAreaView, StyleSheet } from \"react-native\";\nimport { Text as TamaguiText, View, XStack, YStack, getConfig, withStaticProperties } from \"tamagui\";\nimport { fontCategoryStacks, sizeRecipeForToken, useGlyphColor, useResolvedKnobs } from \"@multiplatform.one/theme\";\nimport { ActionButton, Text } from \"@multiplatform.one/components\";\nimport { PencilSimpleIcon } from \"@phosphor-icons/react\";\nimport { clampRadiusForLargeComponent } from \"@multiplatform.one/forms\";\nimport { defaultEditorState } from \"./types\";\nimport { RichEditorContext } from \"./context\";\nimport { EditorFrame } from \"./styled\";\nimport { FixedToolbar } from \"./toolbar/FixedToolbar\";\nimport { parseHtmlPreview } from \"./preview\";\nimport { htmlToMarkdown, markdownToHtml } from \"./editor/markdown\";\nimport { t } from \"./shared/t\";\nfunction NativeBubbleToolbar() {\n return null;\n}\nvar TentapEditor = null;\nvar tentapLoadError = null;\ntry {\n TentapEditor = require(\"./editor/TentapEditor.native\").TentapEditor;\n} catch (err) {\n tentapLoadError = err instanceof Error ? err.message : String(err);\n console.warn(\"[RichEditor] TentapEditor failed to load:\", tentapLoadError);\n}\nfunction TentapUnavailableMessage(param) {\n var { detail } = param;\n return /* @__PURE__ */ _jsxs(YStack, {\n gap: \"2\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"3\",\n children: [\n /* @__PURE__ */ _jsx(Text, {\n color: \"$orange-10\",\n fontSize: 14,\n fontWeight: \"700\",\n textAlign: \"center\",\n children: t(\"Rich text editor unavailable\")\n }),\n /* @__PURE__ */ _jsx(Text, {\n color: \"$color-11\",\n fontSize: 12,\n textAlign: \"center\",\n children: detail || t(\"TentapEditor failed to load (requires @10play/tentap-editor)\")\n })\n ]\n });\n}\nfunction TentapUnavailableEditor(props) {\n var _props_minHeight;\n return /* @__PURE__ */ _jsx(View, {\n minHeight: (_props_minHeight = props.minHeight) !== null && _props_minHeight !== void 0 ? _props_minHeight : 150,\n padding: \"4\",\n justifyContent: \"center\",\n alignItems: \"center\",\n backgroundColor: \"orange-2\",\n borderWidth: 1,\n borderColor: \"orange-8\",\n borderRadius: \"3\",\n accessibilityRole: \"alert\",\n \"aria-label\": t(\"Rich text editor unavailable\"),\n children: /* @__PURE__ */ _jsx(TentapUnavailableMessage, {\n detail: tentapLoadError\n })\n });\n}\nvar HEADING_STYLE = {\n heading1: {\n fontSize: 20,\n fontWeight: \"700\"\n },\n heading2: {\n fontSize: 18,\n fontWeight: \"700\"\n },\n heading3: {\n fontSize: 16,\n fontWeight: \"600\"\n },\n heading4: {\n fontSize: 15,\n fontWeight: \"600\"\n },\n heading5: {\n fontSize: 14,\n fontWeight: \"600\"\n },\n heading6: {\n fontSize: 14,\n fontWeight: \"600\"\n }\n};\nfunction PreviewBlockText(param) {\n var { block } = param;\n var _block_index, _ref, _block_indent;\n var heading = HEADING_STYLE[block.kind];\n var prefix = block.kind === \"bullet\" ? \"\\u2022 \" : block.kind === \"ordered\" ? `${(_block_index = block.index) !== null && _block_index !== void 0 ? _block_index : 1}. ` : block.kind === \"task\" ? block.checked ? \"\\u2611 \" : \"\\u2610 \" : \"\";\n var body = /* @__PURE__ */ _jsxs(Text, {\n color: block.quote ? \"$color-11\" : \"$color-12\",\n fontSize: (_ref = heading === null || heading === void 0 ? void 0 : heading.fontSize) !== null && _ref !== void 0 ? _ref : 14,\n fontWeight: heading === null || heading === void 0 ? void 0 : heading.fontWeight,\n fontStyle: block.quote ? \"italic\" : void 0,\n lineHeight: heading ? void 0 : 20,\n numberOfLines: heading ? 2 : 4,\n // RN logical prop so the block indent flips with I18nManager in RTL\n paddingStart: ((_block_indent = block.indent) !== null && _block_indent !== void 0 ? _block_indent : 0) * 12,\n children: [\n prefix,\n block.spans.map(function(span, i) {\n return /* @__PURE__ */ _jsx(TamaguiText, {\n color: `${span.code ? \"color-12\" : void 0}`,\n fontWeight: span.bold ? \"700\" : void 0,\n fontStyle: span.italic ? \"italic\" : void 0,\n backgroundColor: `${span.code ? \"color-4\" : void 0}`,\n textDecorationLine: span.underline && span.strike ? \"underline line-through\" : span.underline ? \"underline\" : span.strike ? \"line-through\" : void 0,\n children: span.text\n }, i);\n })\n ]\n });\n if (block.quote) {\n return (\n // RN logical props so the quote rail flips with I18nManager in RTL\n /* @__PURE__ */ _jsx(XStack, {\n borderStartWidth: 3,\n borderStartColor: \"color-6\",\n paddingStart: \"2\",\n children: body\n })\n );\n }\n return body;\n}\nvar RichEditorImpl = /* @__PURE__ */ forwardRef(function(param, ref) {\n var { size, showToolbar = true, showBubbleToolbar: _showBubbleToolbar, fullscreen: fullscreenProp, defaultFullscreen = false, onFullscreenChange, inlineEditing = false, sections, hasError, editable = true, onStateChange, minHeight = 150, maxHeight, ...editorProps } = param;\n var _editorProps_initialContent, _editorProps_initialContent1, _editorProps_initialContent2, _editorProps_initialContent3, _editorProps_initialContent4, _knobProps_sizeToken, _editorProps_placeholder, _committed_json, _editorProps_autoFocus;\n var _knobProps_body, _knobProps_heading;\n var internalRef = useRef(null);\n var [editorState, setEditorState] = useState(defaultEditorState);\n var [internalFullscreen, setInternalFullscreen] = useState(defaultFullscreen);\n var fullscreen = fullscreenProp !== null && fullscreenProp !== void 0 ? fullscreenProp : internalFullscreen;\n var [committed, setCommitted] = useState(function() {\n var _editorProps_initialContent6, _editorProps_initialJSON;\n return {\n html: (_editorProps_initialContent6 = editorProps.initialContent) !== null && _editorProps_initialContent6 !== void 0 ? _editorProps_initialContent6 : \"\",\n json: (_editorProps_initialJSON = editorProps.initialJSON) !== null && _editorProps_initialJSON !== void 0 ? _editorProps_initialJSON : null\n };\n });\n var committedRef = useRef(committed);\n committedRef.current = committed;\n var draftHtml = useRef(null);\n var draftJson = useRef(null);\n var lastInitialContent = useRef((_editorProps_initialContent = editorProps.initialContent) !== null && _editorProps_initialContent !== void 0 ? _editorProps_initialContent : \"\");\n var lastEmitted = useRef(null);\n if (!fullscreen && ((_editorProps_initialContent1 = editorProps.initialContent) !== null && _editorProps_initialContent1 !== void 0 ? _editorProps_initialContent1 : \"\") !== lastInitialContent.current && ((_editorProps_initialContent2 = editorProps.initialContent) !== null && _editorProps_initialContent2 !== void 0 ? _editorProps_initialContent2 : \"\") !== lastEmitted.current && ((_editorProps_initialContent3 = editorProps.initialContent) !== null && _editorProps_initialContent3 !== void 0 ? _editorProps_initialContent3 : \"\") !== committedRef.current.html) {\n var _editorProps_initialContent5;\n var html = (_editorProps_initialContent5 = editorProps.initialContent) !== null && _editorProps_initialContent5 !== void 0 ? _editorProps_initialContent5 : \"\";\n committedRef.current = {\n html,\n json: null\n };\n setCommitted(committedRef.current);\n }\n lastInitialContent.current = (_editorProps_initialContent4 = editorProps.initialContent) !== null && _editorProps_initialContent4 !== void 0 ? _editorProps_initialContent4 : \"\";\n var { knobProps } = useResolvedKnobs({\n component: \"RichEditor\",\n size\n });\n var editGlyphColor = useGlyphColor(\"$color-11\");\n var { bodyFontFamily, headingFontFamily } = useMemo(function() {\n var _getConfig, _knobProps_body2, _knobProps_heading2;\n var fonts = (_getConfig = getConfig()) === null || _getConfig === void 0 ? void 0 : _getConfig.fonts;\n var resolve = function resolve2(token) {\n var _ref;\n var _fonts_key;\n var key = (_ref = token === null || token === void 0 ? void 0 : token.replace(/^\\$/, \"\")) !== null && _ref !== void 0 ? _ref : \"body\";\n var configured = fonts === null || fonts === void 0 ? void 0 : (_fonts_key = fonts[key]) === null || _fonts_key === void 0 ? void 0 : _fonts_key.family;\n var family = typeof configured === \"string\" ? configured.trim() : void 0;\n if (family && /(?:^|,)\\s*(?:serif|sans-serif|monospace|cursive|fantasy|system-ui|ui-serif|ui-sans-serif|ui-monospace|ui-rounded)\\s*$/i.test(family)) return family;\n var fallback = Object.hasOwn(fontCategoryStacks, key) ? fontCategoryStacks[key] : fontCategoryStacks[\"sans-serif\"];\n return family ? `${family}, ${fallback}` : fallback;\n };\n return {\n bodyFontFamily: resolve((_knobProps_body2 = knobProps.body) === null || _knobProps_body2 === void 0 ? void 0 : _knobProps_body2.fontFamily),\n headingFontFamily: resolve((_knobProps_heading2 = knobProps.heading) === null || _knobProps_heading2 === void 0 ? void 0 : _knobProps_heading2.fontFamily)\n };\n }, [\n (_knobProps_body = knobProps.body) === null || _knobProps_body === void 0 ? void 0 : _knobProps_body.fontFamily,\n (_knobProps_heading = knobProps.heading) === null || _knobProps_heading === void 0 ? void 0 : _knobProps_heading.fontFamily\n ]);\n var handleStateChange = useCallback(function(state) {\n setEditorState(state);\n onStateChange === null || onStateChange === void 0 ? void 0 : onStateChange(state);\n }, [\n onStateChange\n ]);\n var handleFullscreenChange = useCallback(function(next) {\n setInternalFullscreen(next);\n onFullscreenChange === null || onFullscreenChange === void 0 ? void 0 : onFullscreenChange(next);\n }, [\n onFullscreenChange\n ]);\n var openFullscreen = useCallback(function() {\n draftHtml.current = null;\n draftJson.current = null;\n handleFullscreenChange(true);\n }, [\n handleFullscreenChange\n ]);\n var { onChange, onBlur } = editorProps;\n var handleCancel = useCallback(function() {\n handleFullscreenChange(false);\n onBlur === null || onBlur === void 0 ? void 0 : onBlur();\n }, [\n handleFullscreenChange,\n onBlur\n ]);\n var handleDone = useCallback(function() {\n var html2 = draftHtml.current;\n if (html2 !== null && html2 !== committedRef.current.html) {\n committedRef.current = {\n html: html2,\n json: draftJson.current\n };\n setCommitted(committedRef.current);\n lastEmitted.current = html2;\n onChange === null || onChange === void 0 ? void 0 : onChange(html2, draftJson.current);\n }\n handleFullscreenChange(false);\n onBlur === null || onBlur === void 0 ? void 0 : onBlur();\n }, [\n handleFullscreenChange,\n onChange,\n onBlur\n ]);\n useImperativeHandle(ref, function() {\n return {\n executeCommand: function executeCommand(command, payload) {\n var _internalRef_current;\n return (_internalRef_current = internalRef.current) === null || _internalRef_current === void 0 ? void 0 : _internalRef_current.executeCommand(command, payload);\n },\n getState: function getState() {\n var _ref;\n var _internalRef_current;\n return (_ref = (_internalRef_current = internalRef.current) === null || _internalRef_current === void 0 ? void 0 : _internalRef_current.getState()) !== null && _ref !== void 0 ? _ref : defaultEditorState;\n },\n getHTML: function getHTML() {\n return internalRef.current ? internalRef.current.getHTML() || committedRef.current.html : committedRef.current.html;\n },\n getJSON: function getJSON() {\n var _internalRef_current_getJSON;\n return internalRef.current ? (_internalRef_current_getJSON = internalRef.current.getJSON()) !== null && _internalRef_current_getJSON !== void 0 ? _internalRef_current_getJSON : committedRef.current.json : committedRef.current.json;\n },\n // Native markdown serialization is best-effort (turndown needs a\n // DOM): the editor delegates and returns \"\" when unavailable.\n getMarkdown: function getMarkdown() {\n if (internalRef.current) return internalRef.current.getMarkdown();\n try {\n return htmlToMarkdown(committedRef.current.html);\n } catch (err) {\n console.warn(\"[RichEditor] getMarkdown unavailable on native:\", err);\n return \"\";\n }\n },\n setMarkdown: function setMarkdown(markdown) {\n var html2 = markdownToHtml(markdown);\n if (internalRef.current) internalRef.current.setHTML(html2);\n else {\n committedRef.current = {\n html: html2,\n json: null\n };\n setCommitted(committedRef.current);\n }\n },\n setHTML: function setHTML(html2) {\n if (internalRef.current) internalRef.current.setHTML(html2);\n else {\n committedRef.current = {\n html: html2,\n json: null\n };\n setCommitted(committedRef.current);\n }\n },\n setJSON: function setJSON(json) {\n if (internalRef.current) internalRef.current.setJSON(json);\n else {\n committedRef.current = {\n ...committedRef.current,\n json\n };\n setCommitted(committedRef.current);\n }\n },\n focus: function focus() {\n if (internalRef.current) internalRef.current.focus();\n else if (!inlineEditing && editable) openFullscreen();\n },\n blur: function blur() {\n var _internalRef_current;\n return (_internalRef_current = internalRef.current) === null || _internalRef_current === void 0 ? void 0 : _internalRef_current.blur();\n }\n };\n }, [\n inlineEditing,\n editable,\n openFullscreen\n ]);\n var cappedRadius = clampRadiusForLargeComponent(knobProps.borderRadius.borderRadius, 4);\n var disabled = !editable;\n var sizeToken = (_knobProps_sizeToken = knobProps.sizeToken) !== null && _knobProps_sizeToken !== void 0 ? _knobProps_sizeToken : \"4\";\n var editGlyphSize = sizeRecipeForToken(sizeToken, {\n touch: true\n }).iconSize;\n var preview = useMemo(function() {\n return parseHtmlPreview(committed.html, 6);\n }, [\n committed.html\n ]);\n var previewEmpty = preview.blocks.length === 0;\n if (inlineEditing) {\n return /* @__PURE__ */ _jsx(RichEditorContext.Provider, {\n size: sizeToken,\n disabled,\n children: /* @__PURE__ */ _jsxs(EditorFrame, {\n hasError,\n borderRadius: cappedRadius,\n borderWidth: knobProps.borderRadius.borderWidth,\n borderColor: `${hasError ? \"red-10\" : \"color-6\"}`,\n disabled,\n children: [\n showToolbar && !disabled && /* @__PURE__ */ _jsx(FixedToolbar, {\n editorRef: internalRef,\n state: editorState,\n sections,\n hasError\n }),\n TentapEditor ? /* @__PURE__ */ _jsx(TentapEditor, {\n ref: internalRef,\n minHeight,\n maxHeight,\n bodyFontFamily,\n headingFontFamily,\n ...editorProps,\n editable,\n onStateChange: handleStateChange,\n hasError: false\n }) : /* @__PURE__ */ _jsx(View, {\n minHeight,\n padding: knobProps.panelPadding.padding,\n justifyContent: \"center\",\n alignItems: \"center\",\n backgroundColor: \"orange-2\",\n accessibilityRole: \"alert\",\n children: /* @__PURE__ */ _jsx(TentapUnavailableMessage, {\n detail: tentapLoadError\n })\n })\n ]\n })\n });\n }\n return /* @__PURE__ */ _jsxs(RichEditorContext.Provider, {\n size: sizeToken,\n disabled,\n children: [\n /*\n RN Text/YStack steal taps from Tamagui View onPress, so the preview\n open target is a core Pressable. EditorFrame stays visual-only.\n */\n /* @__PURE__ */ _jsx(Pressable, {\n onPress: disabled ? void 0 : openFullscreen,\n disabled,\n accessibilityRole: \"button\",\n accessibilityLabel: t(\"Edit rich text\"),\n style: function style(param2) {\n var { pressed } = param2;\n return {\n opacity: pressed && !disabled ? 0.85 : 1\n };\n },\n children: /* @__PURE__ */ _jsxs(EditorFrame, {\n hasError,\n borderRadius: cappedRadius,\n borderWidth: knobProps.borderRadius.borderWidth,\n borderColor: `${hasError ? \"red-10\" : \"color-6\"}`,\n minHeight: Math.min(minHeight, 120),\n maxHeight: maxHeight !== null && maxHeight !== void 0 ? maxHeight : 240,\n pointerEvents: \"none\",\n disabled,\n children: [\n /* @__PURE__ */ _jsxs(YStack, {\n padding: knobProps.panelPadding.padding,\n paddingRight: \"6\",\n gap: \"1-5\",\n flex: 1,\n children: [\n !TentapEditor && /* @__PURE__ */ _jsx(Text, {\n color: \"$orange-10\",\n fontSize: 12,\n children: t(\"Editor unavailable. Tap for details.\")\n }),\n previewEmpty ? /* @__PURE__ */ _jsx(Text, {\n color: \"$color-10\",\n fontSize: 14,\n lineHeight: 20,\n children: (_editorProps_placeholder = editorProps.placeholder) !== null && _editorProps_placeholder !== void 0 ? _editorProps_placeholder : t(\"Start writing...\")\n }) : preview.blocks.map(function(block, i) {\n return /* @__PURE__ */ _jsx(PreviewBlockText, {\n block\n }, i);\n }),\n preview.truncated && /* @__PURE__ */ _jsx(Text, {\n color: \"$color-10\",\n fontSize: 14,\n children: \"\\u2026\"\n })\n ]\n }),\n !disabled && /* @__PURE__ */ _jsx(View, {\n position: \"absolute\",\n top: \"2-5\",\n right: \"2-5\",\n children: /* @__PURE__ */ _jsx(PencilSimpleIcon, {\n color: editGlyphColor,\n size: editGlyphSize,\n \"aria-hidden\": true\n })\n })\n ]\n })\n }),\n /* @__PURE__ */ _jsx(Modal, {\n visible: fullscreen,\n animationType: \"slide\",\n presentationStyle: \"fullScreen\",\n onRequestClose: handleCancel,\n children: fullscreen && /* @__PURE__ */ _jsx(YStack, {\n flex: 1,\n backgroundColor: \"background\",\n children: /* @__PURE__ */ _jsx(KeyboardAvoidingView, {\n style: styles.flex,\n behavior: Platform.OS === \"ios\" ? \"padding\" : void 0,\n children: /* @__PURE__ */ _jsxs(SafeAreaView, {\n style: styles.flex,\n children: [\n /* @__PURE__ */ _jsxs(XStack, {\n alignItems: \"center\",\n justifyContent: \"space-between\",\n paddingHorizontal: \"2\",\n paddingVertical: \"1-5\",\n borderBottomWidth: 1,\n borderBottomColor: \"color-6\",\n children: [\n /* @__PURE__ */ _jsx(ActionButton, {\n kind: \"cancel\",\n onPress: handleCancel\n }),\n /* @__PURE__ */ _jsx(ActionButton, {\n kind: \"done\",\n onPress: handleDone\n })\n ]\n }),\n /* @__PURE__ */ _jsx(YStack, {\n flex: 1,\n children: TentapEditor ? /* @__PURE__ */ _jsx(TentapEditor, {\n ref: internalRef,\n bodyFontFamily,\n headingFontFamily,\n ...editorProps,\n initialContent: committed.html,\n initialJSON: (_committed_json = committed.json) !== null && _committed_json !== void 0 ? _committed_json : void 0,\n autoFocus: (_editorProps_autoFocus = editorProps.autoFocus) !== null && _editorProps_autoFocus !== void 0 ? _editorProps_autoFocus : true,\n editable: true,\n fill: true,\n onChange: function onChange2(html2, json) {\n draftHtml.current = html2;\n draftJson.current = json;\n },\n onStateChange: handleStateChange,\n hasError: false\n }) : /* @__PURE__ */ _jsx(View, {\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: \"4\",\n backgroundColor: \"orange-2\",\n accessibilityRole: \"alert\",\n children: /* @__PURE__ */ _jsx(TentapUnavailableMessage, {\n detail: tentapLoadError\n })\n })\n }),\n showToolbar && /* @__PURE__ */ _jsx(FixedToolbar, {\n editorRef: internalRef,\n state: editorState,\n sections,\n docked: \"bottom\"\n })\n ]\n })\n })\n })\n })\n ]\n });\n});\nRichEditorImpl.displayName = \"RichEditor\";\nvar styles = StyleSheet.create({\n flex: {\n flex: 1\n }\n});\nvar RichEditor = withStaticProperties(RichEditorImpl, {\n FixedToolbar,\n BubbleToolbar: NativeBubbleToolbar,\n Editor: TentapEditor !== null && TentapEditor !== void 0 ? TentapEditor : TentapUnavailableEditor\n});\nexport {\n RichEditor\n};\n//# sourceMappingURL=RichEditor.native.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAeA,SAAS,sBAAsB;CAC7B,OAAO;AACT;AACA,IAAI,eAAe;AACnB,I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M,EACJ,MAAM,EACR,EACF,CAAC;AACD,IAAI,aAAa,qBAAqB,gBAAgB;CACpD;CACA,eAAe;CACf,QAAQ,iBAAiB,QAAQ,iBAAiB,KAAK,IAAI,eAAe;AAC5E,CAAC"}
1
+ {"version":3,"file":"RichEditor.native.js","names":["Text","TamaguiText"],"sources":["esm/RichEditor.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { forwardRef, useCallback, useImperativeHandle, useMemo, useRef, useState } from \"react\";\nimport { KeyboardAvoidingView, Modal, Platform, Pressable, SafeAreaView, StyleSheet } from \"react-native\";\nimport { Text as TamaguiText, View, XStack, YStack, getConfig, withStaticProperties } from \"tamagui\";\nimport { fontCategoryStacks, sizeRecipeForToken, useGlyphColor, useResolvedKnobs } from \"@multiplatform.one/theme\";\nimport { ActionButton, Text } from \"@multiplatform.one/components\";\nimport { PencilSimpleIcon } from \"@phosphor-icons/react\";\nimport { clampRadiusForLargeComponent } from \"@multiplatform.one/forms\";\nimport { defaultEditorState } from \"./types\";\nimport { RichEditorContext } from \"./context\";\nimport { EditorFrame } from \"./styled\";\nimport { FixedToolbar } from \"./toolbar/FixedToolbar\";\nimport { parseHtmlPreview } from \"./preview\";\nimport { htmlToMarkdown, markdownToHtml } from \"./editor/markdown\";\nimport { t } from \"./shared/t\";\nfunction NativeBubbleToolbar() {\n return null;\n}\nvar TentapEditor = null;\nvar tentapLoadError = null;\ntry {\n TentapEditor = require(\"./editor/TentapEditor.native\").TentapEditor;\n} catch (err) {\n tentapLoadError = err instanceof Error ? err.message : String(err);\n console.warn(\"[RichEditor] TentapEditor failed to load:\", tentapLoadError);\n}\nfunction TentapUnavailableMessage(param) {\n var { detail } = param;\n return /* @__PURE__ */ _jsxs(YStack, {\n gap: \"2\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"3\",\n children: [\n /* @__PURE__ */ _jsx(Text, {\n color: \"$orange-10\",\n fontSize: 14,\n fontWeight: \"700\",\n textAlign: \"center\",\n children: t(\"Rich text editor unavailable\")\n }),\n /* @__PURE__ */ _jsx(Text, {\n color: \"$color-11\",\n fontSize: 12,\n textAlign: \"center\",\n children: detail || t(\"TentapEditor failed to load (requires @10play/tentap-editor)\")\n })\n ]\n });\n}\nfunction TentapUnavailableEditor(props) {\n var _props_minHeight;\n return /* @__PURE__ */ _jsx(View, {\n minHeight: (_props_minHeight = props.minHeight) !== null && _props_minHeight !== void 0 ? _props_minHeight : 150,\n padding: \"4\",\n justifyContent: \"center\",\n alignItems: \"center\",\n backgroundColor: \"orange-2\",\n borderWidth: 1,\n borderColor: \"orange-8\",\n borderRadius: \"3\",\n accessibilityRole: \"alert\",\n \"aria-label\": t(\"Rich text editor unavailable\"),\n children: /* @__PURE__ */ _jsx(TentapUnavailableMessage, {\n detail: tentapLoadError\n })\n });\n}\nvar HEADING_STYLE = {\n heading1: {\n fontSize: 20,\n fontWeight: \"700\"\n },\n heading2: {\n fontSize: 18,\n fontWeight: \"700\"\n },\n heading3: {\n fontSize: 16,\n fontWeight: \"600\"\n },\n heading4: {\n fontSize: 15,\n fontWeight: \"600\"\n },\n heading5: {\n fontSize: 14,\n fontWeight: \"600\"\n },\n heading6: {\n fontSize: 14,\n fontWeight: \"600\"\n }\n};\nfunction PreviewBlockText(param) {\n var { block } = param;\n var _block_index, _ref, _block_indent;\n var heading = HEADING_STYLE[block.kind];\n var prefix = block.kind === \"bullet\" ? \"\\u2022 \" : block.kind === \"ordered\" ? `${(_block_index = block.index) !== null && _block_index !== void 0 ? _block_index : 1}. ` : block.kind === \"task\" ? block.checked ? \"\\u2611 \" : \"\\u2610 \" : \"\";\n var body = /* @__PURE__ */ _jsxs(Text, {\n color: block.quote ? \"$color-11\" : \"$color-12\",\n fontSize: (_ref = heading === null || heading === void 0 ? void 0 : heading.fontSize) !== null && _ref !== void 0 ? _ref : 14,\n fontWeight: heading === null || heading === void 0 ? void 0 : heading.fontWeight,\n fontStyle: block.quote ? \"italic\" : void 0,\n lineHeight: heading ? void 0 : 20,\n numberOfLines: heading ? 2 : 4,\n // RN logical prop so the block indent flips with I18nManager in RTL\n paddingStart: ((_block_indent = block.indent) !== null && _block_indent !== void 0 ? _block_indent : 0) * 12,\n children: [\n prefix,\n block.spans.map(function(span, i) {\n return /* @__PURE__ */ _jsx(TamaguiText, {\n color: span.code ? \"color-12\" : void 0,\n fontWeight: span.bold ? \"700\" : void 0,\n fontStyle: span.italic ? \"italic\" : void 0,\n backgroundColor: span.code ? \"color-4\" : void 0,\n textDecorationLine: span.underline && span.strike ? \"underline line-through\" : span.underline ? \"underline\" : span.strike ? \"line-through\" : void 0,\n children: span.text\n }, i);\n })\n ]\n });\n if (block.quote) {\n return (\n // RN logical props so the quote rail flips with I18nManager in RTL\n /* @__PURE__ */ _jsx(XStack, {\n borderStartWidth: 3,\n borderStartColor: \"color-6\",\n paddingStart: \"2\",\n children: body\n })\n );\n }\n return body;\n}\nvar RichEditorImpl = /* @__PURE__ */ forwardRef(function(param, ref) {\n var { size, showToolbar = true, showBubbleToolbar: _showBubbleToolbar, fullscreen: fullscreenProp, defaultFullscreen = false, onFullscreenChange, inlineEditing = false, sections, hasError, editable = true, onStateChange, minHeight = 150, maxHeight, ...editorProps } = param;\n var _editorProps_initialContent, _editorProps_initialContent1, _editorProps_initialContent2, _editorProps_initialContent3, _editorProps_initialContent4, _knobProps_sizeToken, _editorProps_placeholder, _committed_json, _editorProps_autoFocus;\n var _knobProps_body, _knobProps_heading;\n var internalRef = useRef(null);\n var [editorState, setEditorState] = useState(defaultEditorState);\n var [internalFullscreen, setInternalFullscreen] = useState(defaultFullscreen);\n var fullscreen = fullscreenProp !== null && fullscreenProp !== void 0 ? fullscreenProp : internalFullscreen;\n var [committed, setCommitted] = useState(function() {\n var _editorProps_initialContent6, _editorProps_initialJSON;\n return {\n html: (_editorProps_initialContent6 = editorProps.initialContent) !== null && _editorProps_initialContent6 !== void 0 ? _editorProps_initialContent6 : \"\",\n json: (_editorProps_initialJSON = editorProps.initialJSON) !== null && _editorProps_initialJSON !== void 0 ? _editorProps_initialJSON : null\n };\n });\n var committedRef = useRef(committed);\n committedRef.current = committed;\n var draftHtml = useRef(null);\n var draftJson = useRef(null);\n var lastInitialContent = useRef((_editorProps_initialContent = editorProps.initialContent) !== null && _editorProps_initialContent !== void 0 ? _editorProps_initialContent : \"\");\n var lastEmitted = useRef(null);\n if (!fullscreen && ((_editorProps_initialContent1 = editorProps.initialContent) !== null && _editorProps_initialContent1 !== void 0 ? _editorProps_initialContent1 : \"\") !== lastInitialContent.current && ((_editorProps_initialContent2 = editorProps.initialContent) !== null && _editorProps_initialContent2 !== void 0 ? _editorProps_initialContent2 : \"\") !== lastEmitted.current && ((_editorProps_initialContent3 = editorProps.initialContent) !== null && _editorProps_initialContent3 !== void 0 ? _editorProps_initialContent3 : \"\") !== committedRef.current.html) {\n var _editorProps_initialContent5;\n var html = (_editorProps_initialContent5 = editorProps.initialContent) !== null && _editorProps_initialContent5 !== void 0 ? _editorProps_initialContent5 : \"\";\n committedRef.current = {\n html,\n json: null\n };\n setCommitted(committedRef.current);\n }\n lastInitialContent.current = (_editorProps_initialContent4 = editorProps.initialContent) !== null && _editorProps_initialContent4 !== void 0 ? _editorProps_initialContent4 : \"\";\n var { knobProps } = useResolvedKnobs({\n component: \"RichEditor\",\n size\n });\n var editGlyphColor = useGlyphColor(\"$color-11\");\n var { bodyFontFamily, headingFontFamily } = useMemo(function() {\n var _getConfig, _knobProps_body2, _knobProps_heading2;\n var fonts = (_getConfig = getConfig()) === null || _getConfig === void 0 ? void 0 : _getConfig.fonts;\n var resolve = function resolve2(token) {\n var _ref;\n var _fonts_key;\n var key = (_ref = token === null || token === void 0 ? void 0 : token.replace(/^\\$/, \"\")) !== null && _ref !== void 0 ? _ref : \"body\";\n var configured = fonts === null || fonts === void 0 ? void 0 : (_fonts_key = fonts[key]) === null || _fonts_key === void 0 ? void 0 : _fonts_key.family;\n var family = typeof configured === \"string\" ? configured.trim() : void 0;\n if (family && /(?:^|,)\\s*(?:serif|sans-serif|monospace|cursive|fantasy|system-ui|ui-serif|ui-sans-serif|ui-monospace|ui-rounded)\\s*$/i.test(family)) return family;\n var fallback = Object.hasOwn(fontCategoryStacks, key) ? fontCategoryStacks[key] : fontCategoryStacks[\"sans-serif\"];\n return family ? `${family}, ${fallback}` : fallback;\n };\n return {\n bodyFontFamily: resolve((_knobProps_body2 = knobProps.body) === null || _knobProps_body2 === void 0 ? void 0 : _knobProps_body2.fontFamily),\n headingFontFamily: resolve((_knobProps_heading2 = knobProps.heading) === null || _knobProps_heading2 === void 0 ? void 0 : _knobProps_heading2.fontFamily)\n };\n }, [\n (_knobProps_body = knobProps.body) === null || _knobProps_body === void 0 ? void 0 : _knobProps_body.fontFamily,\n (_knobProps_heading = knobProps.heading) === null || _knobProps_heading === void 0 ? void 0 : _knobProps_heading.fontFamily\n ]);\n var handleStateChange = useCallback(function(state) {\n setEditorState(state);\n onStateChange === null || onStateChange === void 0 ? void 0 : onStateChange(state);\n }, [\n onStateChange\n ]);\n var handleFullscreenChange = useCallback(function(next) {\n setInternalFullscreen(next);\n onFullscreenChange === null || onFullscreenChange === void 0 ? void 0 : onFullscreenChange(next);\n }, [\n onFullscreenChange\n ]);\n var openFullscreen = useCallback(function() {\n draftHtml.current = null;\n draftJson.current = null;\n handleFullscreenChange(true);\n }, [\n handleFullscreenChange\n ]);\n var { onChange, onBlur } = editorProps;\n var handleCancel = useCallback(function() {\n handleFullscreenChange(false);\n onBlur === null || onBlur === void 0 ? void 0 : onBlur();\n }, [\n handleFullscreenChange,\n onBlur\n ]);\n var handleDone = useCallback(function() {\n var html2 = draftHtml.current;\n if (html2 !== null && html2 !== committedRef.current.html) {\n committedRef.current = {\n html: html2,\n json: draftJson.current\n };\n setCommitted(committedRef.current);\n lastEmitted.current = html2;\n onChange === null || onChange === void 0 ? void 0 : onChange(html2, draftJson.current);\n }\n handleFullscreenChange(false);\n onBlur === null || onBlur === void 0 ? void 0 : onBlur();\n }, [\n handleFullscreenChange,\n onChange,\n onBlur\n ]);\n useImperativeHandle(ref, function() {\n return {\n executeCommand: function executeCommand(command, payload) {\n var _internalRef_current;\n return (_internalRef_current = internalRef.current) === null || _internalRef_current === void 0 ? void 0 : _internalRef_current.executeCommand(command, payload);\n },\n getState: function getState() {\n var _ref;\n var _internalRef_current;\n return (_ref = (_internalRef_current = internalRef.current) === null || _internalRef_current === void 0 ? void 0 : _internalRef_current.getState()) !== null && _ref !== void 0 ? _ref : defaultEditorState;\n },\n getHTML: function getHTML() {\n return internalRef.current ? internalRef.current.getHTML() || committedRef.current.html : committedRef.current.html;\n },\n getJSON: function getJSON() {\n var _internalRef_current_getJSON;\n return internalRef.current ? (_internalRef_current_getJSON = internalRef.current.getJSON()) !== null && _internalRef_current_getJSON !== void 0 ? _internalRef_current_getJSON : committedRef.current.json : committedRef.current.json;\n },\n // Native markdown serialization is best-effort (turndown needs a\n // DOM): the editor delegates and returns \"\" when unavailable.\n getMarkdown: function getMarkdown() {\n if (internalRef.current) return internalRef.current.getMarkdown();\n try {\n return htmlToMarkdown(committedRef.current.html);\n } catch (err) {\n console.warn(\"[RichEditor] getMarkdown unavailable on native:\", err);\n return \"\";\n }\n },\n setMarkdown: function setMarkdown(markdown) {\n var html2 = markdownToHtml(markdown);\n if (internalRef.current) internalRef.current.setHTML(html2);\n else {\n committedRef.current = {\n html: html2,\n json: null\n };\n setCommitted(committedRef.current);\n }\n },\n setHTML: function setHTML(html2) {\n if (internalRef.current) internalRef.current.setHTML(html2);\n else {\n committedRef.current = {\n html: html2,\n json: null\n };\n setCommitted(committedRef.current);\n }\n },\n setJSON: function setJSON(json) {\n if (internalRef.current) internalRef.current.setJSON(json);\n else {\n committedRef.current = {\n ...committedRef.current,\n json\n };\n setCommitted(committedRef.current);\n }\n },\n focus: function focus() {\n if (internalRef.current) internalRef.current.focus();\n else if (!inlineEditing && editable) openFullscreen();\n },\n blur: function blur() {\n var _internalRef_current;\n return (_internalRef_current = internalRef.current) === null || _internalRef_current === void 0 ? void 0 : _internalRef_current.blur();\n }\n };\n }, [\n inlineEditing,\n editable,\n openFullscreen\n ]);\n var cappedRadius = clampRadiusForLargeComponent(knobProps.borderRadius.borderRadius, 4);\n var disabled = !editable;\n var sizeToken = (_knobProps_sizeToken = knobProps.sizeToken) !== null && _knobProps_sizeToken !== void 0 ? _knobProps_sizeToken : \"4\";\n var editGlyphSize = sizeRecipeForToken(sizeToken, {\n touch: true\n }).iconSize;\n var preview = useMemo(function() {\n return parseHtmlPreview(committed.html, 6);\n }, [\n committed.html\n ]);\n var previewEmpty = preview.blocks.length === 0;\n if (inlineEditing) {\n return /* @__PURE__ */ _jsx(RichEditorContext.Provider, {\n size: sizeToken,\n disabled,\n children: /* @__PURE__ */ _jsxs(EditorFrame, {\n hasError,\n borderRadius: cappedRadius,\n borderWidth: knobProps.borderRadius.borderWidth,\n borderColor: `${hasError ? \"red-10\" : \"color-6\"}`,\n disabled,\n children: [\n showToolbar && !disabled && /* @__PURE__ */ _jsx(FixedToolbar, {\n editorRef: internalRef,\n state: editorState,\n sections,\n hasError\n }),\n TentapEditor ? /* @__PURE__ */ _jsx(TentapEditor, {\n ref: internalRef,\n minHeight,\n maxHeight,\n bodyFontFamily,\n headingFontFamily,\n ...editorProps,\n editable,\n onStateChange: handleStateChange,\n hasError: false\n }) : /* @__PURE__ */ _jsx(View, {\n minHeight,\n padding: knobProps.panelPadding.padding,\n justifyContent: \"center\",\n alignItems: \"center\",\n backgroundColor: \"orange-2\",\n accessibilityRole: \"alert\",\n children: /* @__PURE__ */ _jsx(TentapUnavailableMessage, {\n detail: tentapLoadError\n })\n })\n ]\n })\n });\n }\n return /* @__PURE__ */ _jsxs(RichEditorContext.Provider, {\n size: sizeToken,\n disabled,\n children: [\n /*\n RN Text/YStack steal taps from Tamagui View onPress, so the preview\n open target is a core Pressable. EditorFrame stays visual-only.\n */\n /* @__PURE__ */ _jsx(Pressable, {\n onPress: disabled ? void 0 : openFullscreen,\n disabled,\n accessibilityRole: \"button\",\n accessibilityLabel: t(\"Edit rich text\"),\n style: function style(param2) {\n var { pressed } = param2;\n return {\n opacity: pressed && !disabled ? 0.85 : 1\n };\n },\n children: /* @__PURE__ */ _jsxs(EditorFrame, {\n hasError,\n borderRadius: cappedRadius,\n borderWidth: knobProps.borderRadius.borderWidth,\n borderColor: `${hasError ? \"red-10\" : \"color-6\"}`,\n minHeight: Math.min(minHeight, 120),\n maxHeight: maxHeight !== null && maxHeight !== void 0 ? maxHeight : 240,\n pointerEvents: \"none\",\n disabled,\n children: [\n /* @__PURE__ */ _jsxs(YStack, {\n padding: knobProps.panelPadding.padding,\n paddingRight: \"6\",\n gap: \"1-5\",\n flex: 1,\n children: [\n !TentapEditor && /* @__PURE__ */ _jsx(Text, {\n color: \"$orange-10\",\n fontSize: 12,\n children: t(\"Editor unavailable. Tap for details.\")\n }),\n previewEmpty ? /* @__PURE__ */ _jsx(Text, {\n color: \"$color-10\",\n fontSize: 14,\n lineHeight: 20,\n children: (_editorProps_placeholder = editorProps.placeholder) !== null && _editorProps_placeholder !== void 0 ? _editorProps_placeholder : t(\"Start writing...\")\n }) : preview.blocks.map(function(block, i) {\n return /* @__PURE__ */ _jsx(PreviewBlockText, {\n block\n }, i);\n }),\n preview.truncated && /* @__PURE__ */ _jsx(Text, {\n color: \"$color-10\",\n fontSize: 14,\n children: \"\\u2026\"\n })\n ]\n }),\n !disabled && /* @__PURE__ */ _jsx(View, {\n position: \"absolute\",\n top: \"2-5\",\n right: \"2-5\",\n children: /* @__PURE__ */ _jsx(PencilSimpleIcon, {\n color: editGlyphColor,\n size: editGlyphSize,\n \"aria-hidden\": true\n })\n })\n ]\n })\n }),\n /* @__PURE__ */ _jsx(Modal, {\n visible: fullscreen,\n animationType: \"slide\",\n presentationStyle: \"fullScreen\",\n onRequestClose: handleCancel,\n children: fullscreen && /* @__PURE__ */ _jsx(YStack, {\n flex: 1,\n backgroundColor: \"background\",\n children: /* @__PURE__ */ _jsx(KeyboardAvoidingView, {\n style: styles.flex,\n behavior: Platform.OS === \"ios\" ? \"padding\" : void 0,\n children: /* @__PURE__ */ _jsxs(SafeAreaView, {\n style: styles.flex,\n children: [\n /* @__PURE__ */ _jsxs(XStack, {\n alignItems: \"center\",\n justifyContent: \"space-between\",\n paddingHorizontal: \"2\",\n paddingVertical: \"1-5\",\n borderBottomWidth: 1,\n borderBottomColor: \"color-6\",\n children: [\n /* @__PURE__ */ _jsx(ActionButton, {\n kind: \"cancel\",\n onPress: handleCancel\n }),\n /* @__PURE__ */ _jsx(ActionButton, {\n kind: \"done\",\n onPress: handleDone\n })\n ]\n }),\n /* @__PURE__ */ _jsx(YStack, {\n flex: 1,\n children: TentapEditor ? /* @__PURE__ */ _jsx(TentapEditor, {\n ref: internalRef,\n bodyFontFamily,\n headingFontFamily,\n ...editorProps,\n initialContent: committed.html,\n initialJSON: (_committed_json = committed.json) !== null && _committed_json !== void 0 ? _committed_json : void 0,\n autoFocus: (_editorProps_autoFocus = editorProps.autoFocus) !== null && _editorProps_autoFocus !== void 0 ? _editorProps_autoFocus : true,\n editable: true,\n fill: true,\n onChange: function onChange2(html2, json) {\n draftHtml.current = html2;\n draftJson.current = json;\n },\n onStateChange: handleStateChange,\n hasError: false\n }) : /* @__PURE__ */ _jsx(View, {\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: \"4\",\n backgroundColor: \"orange-2\",\n accessibilityRole: \"alert\",\n children: /* @__PURE__ */ _jsx(TentapUnavailableMessage, {\n detail: tentapLoadError\n })\n })\n }),\n showToolbar && /* @__PURE__ */ _jsx(FixedToolbar, {\n editorRef: internalRef,\n state: editorState,\n sections,\n docked: \"bottom\"\n })\n ]\n })\n })\n })\n })\n ]\n });\n});\nRichEditorImpl.displayName = \"RichEditor\";\nvar styles = StyleSheet.create({\n flex: {\n flex: 1\n }\n});\nvar RichEditor = withStaticProperties(RichEditorImpl, {\n FixedToolbar,\n BubbleToolbar: NativeBubbleToolbar,\n Editor: TentapEditor !== null && TentapEditor !== void 0 ? TentapEditor : TentapUnavailableEditor\n});\nexport {\n RichEditor\n};\n//# sourceMappingURL=RichEditor.native.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAeA,SAAS,sBAAsB;CAC7B,OAAO;AACT;AACA,IAAI,eAAe;AACnB,IAAI,kBAAkB;AACtB,IAAI;CACF,yBAAuB,iCAA8B,CAAC,CAAC;AACzD,SAAS,KAAK;CACZ,kBAAkB,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;CACjE,QAAQ,KAAK,6CAA6C,eAAe;AAC3E;AACA,SAAS,yBAAyB,OAAO;CACvC,IAAI,EAAE,WAAW;CACjB,OAAuB,qBAAM,QAAQ;EACnC,KAAK;EACL,YAAY;EACZ,gBAAgB;EAChB,SAAS;EACT,UAAU,CACQ,oBAAKA,QAAM;GACzB,OAAO;GACP,UAAU;GACV,YAAY;GACZ,WAAW;GACX,UAAU,EAAE,8BAA8B;EAC5C,CAAC,GACe,oBAAKA,QAAM;GACzB,OAAO;GACP,UAAU;GACV,WAAW;GACX,UAAU,UAAU,EAAE,8DAA8D;EACtF,CAAC,CACH;CACF,CAAC;AACH;AACA,SAAS,wBAAwB,OAAO;CACtC,IAAI;CACJ,OAAuB,oBAAK,MAAM;EAChC,YAAY,mBAAmB,MAAM,eAAe,QAAQ,qBAAqB,KAAK,IAAI,mBAAmB;EAC7G,SAAS;EACT,gBAAgB;EAChB,YAAY;EACZ,iBAAiB;EACjB,aAAa;EACb,aAAa;EACb,cAAc;EACd,mBAAmB;EACnB,cAAc,EAAE,8BAA8B;EAC9C,UAA0B,oBAAK,0BAA0B,EACvD,QAAQ,gBACV,CAAC;CACH,CAAC;AACH;AACA,IAAI,gBAAgB;CAClB,UAAU;EACR,UAAU;EACV,YAAY;CACd;CACA,UAAU;EACR,UAAU;EACV,YAAY;CACd;CACA,UAAU;EACR,UAAU;EACV,YAAY;CACd;CACA,UAAU;EACR,UAAU;EACV,YAAY;CACd;CACA,UAAU;EACR,UAAU;EACV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,OAAO;QACP;QACA,QAAQ;OACV,CAAC;MACH;KACF,CAAC;IACH,CAAC;GACH,CAAC;EACH,CAAC,CACH;CACF,CAAC;AACH,CAAC;AACD,eAAe,cAAc;AAC7B,IAAI,SAAS,WAAW,OAAO,EAC7B,MAAM,EACJ,MAAM,EACR,EACF,CAAC;AACD,IAAI,aAAa,qBAAqB,gBAAgB;CACpD;CACA,eAAe;CACf,QAAQ,iBAAiB,QAAQ,iBAAiB,KAAK,IAAI,eAAe;AAC5E,CAAC"}
@@ -127,10 +127,10 @@ function PreviewBlockText(param) {
127
127
  paddingStart: ((_block_indent = block.indent) !== null && _block_indent !== void 0 ? _block_indent : 0) * 12,
128
128
  children: [prefix, block.spans.map(function(span, i) {
129
129
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Text, {
130
- color: `${span.code ? "color-12" : void 0}`,
130
+ color: span.code ? "color-12" : void 0,
131
131
  fontWeight: span.bold ? "700" : void 0,
132
132
  fontStyle: span.italic ? "italic" : void 0,
133
- backgroundColor: `${span.code ? "color-4" : void 0}`,
133
+ backgroundColor: span.code ? "color-4" : void 0,
134
134
  textDecorationLine: span.underline && span.strike ? "underline line-through" : span.underline ? "underline" : span.strike ? "line-through" : void 0,
135
135
  children: span.text
136
136
  }, i);
@@ -127,10 +127,10 @@ function PreviewBlockText(param) {
127
127
  paddingStart: ((_block_indent = block.indent) !== null && _block_indent !== void 0 ? _block_indent : 0) * 12,
128
128
  children: [prefix, block.spans.map(function(span, i) {
129
129
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Text, {
130
- color: `${span.code ? "color-12" : void 0}`,
130
+ color: span.code ? "color-12" : void 0,
131
131
  fontWeight: span.bold ? "700" : void 0,
132
132
  fontStyle: span.italic ? "italic" : void 0,
133
- backgroundColor: `${span.code ? "color-4" : void 0}`,
133
+ backgroundColor: span.code ? "color-4" : void 0,
134
134
  textDecorationLine: span.underline && span.strike ? "underline line-through" : span.underline ? "underline" : span.strike ? "line-through" : void 0,
135
135
  children: span.text
136
136
  }, i);
@@ -1 +1 @@
1
- {"version":3,"file":"RichEditor.native.js","names":[],"sources":["jsx/RichEditor.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar RichEditor_native_exports = {};\n__export(RichEditor_native_exports, {\n RichEditor: () => RichEditor\n});\nmodule.exports = __toCommonJS(RichEditor_native_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = require(\"react\");\nvar import_react_native = require(\"react-native\");\nvar import_tamagui = require(\"tamagui\");\nvar import_theme = require(\"@multiplatform.one/theme\");\nvar import_components = require(\"@multiplatform.one/components\");\nvar import_react2 = require(\"@phosphor-icons/react\");\nvar import_forms = require(\"@multiplatform.one/forms\");\nvar import_types = require(\"./types\");\nvar import_context = require(\"./context\");\nvar import_styled = require(\"./styled\");\nvar import_FixedToolbar = require(\"./toolbar/FixedToolbar\");\nvar import_preview = require(\"./preview\");\nvar import_markdown = require(\"./editor/markdown\");\nvar import_t = require(\"./shared/t\");\nfunction NativeBubbleToolbar() {\n return null;\n}\nvar TentapEditor = null;\nvar tentapLoadError = null;\ntry {\n TentapEditor = require(\"./editor/TentapEditor.native\").TentapEditor;\n} catch (err) {\n tentapLoadError = err instanceof Error ? err.message : String(err);\n console.warn(\"[RichEditor] TentapEditor failed to load:\", tentapLoadError);\n}\nfunction TentapUnavailableMessage(param) {\n var { detail } = param;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {\n gap: \"2\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"3\",\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$orange-10\",\n fontSize: 14,\n fontWeight: \"700\",\n textAlign: \"center\",\n children: (0, import_t.t)(\"Rich text editor unavailable\")\n }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$color-11\",\n fontSize: 12,\n textAlign: \"center\",\n children: detail || (0, import_t.t)(\"TentapEditor failed to load (requires @10play/tentap-editor)\")\n })\n ]\n });\n}\nfunction TentapUnavailableEditor(props) {\n var _props_minHeight;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.View, {\n minHeight: (_props_minHeight = props.minHeight) !== null && _props_minHeight !== void 0 ? _props_minHeight : 150,\n padding: \"4\",\n justifyContent: \"center\",\n alignItems: \"center\",\n backgroundColor: \"orange-2\",\n borderWidth: 1,\n borderColor: \"orange-8\",\n borderRadius: \"3\",\n accessibilityRole: \"alert\",\n \"aria-label\": (0, import_t.t)(\"Rich text editor unavailable\"),\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapUnavailableMessage, {\n detail: tentapLoadError\n })\n });\n}\nvar HEADING_STYLE = {\n heading1: {\n fontSize: 20,\n fontWeight: \"700\"\n },\n heading2: {\n fontSize: 18,\n fontWeight: \"700\"\n },\n heading3: {\n fontSize: 16,\n fontWeight: \"600\"\n },\n heading4: {\n fontSize: 15,\n fontWeight: \"600\"\n },\n heading5: {\n fontSize: 14,\n fontWeight: \"600\"\n },\n heading6: {\n fontSize: 14,\n fontWeight: \"600\"\n }\n};\nfunction PreviewBlockText(param) {\n var { block } = param;\n var _block_index, _ref, _block_indent;\n var heading = HEADING_STYLE[block.kind];\n var prefix = block.kind === \"bullet\" ? \"\\u2022 \" : block.kind === \"ordered\" ? `${(_block_index = block.index) !== null && _block_index !== void 0 ? _block_index : 1}. ` : block.kind === \"task\" ? block.checked ? \"\\u2611 \" : \"\\u2610 \" : \"\";\n var body = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.Text, {\n color: block.quote ? \"$color-11\" : \"$color-12\",\n fontSize: (_ref = heading === null || heading === void 0 ? void 0 : heading.fontSize) !== null && _ref !== void 0 ? _ref : 14,\n fontWeight: heading === null || heading === void 0 ? void 0 : heading.fontWeight,\n fontStyle: block.quote ? \"italic\" : void 0,\n lineHeight: heading ? void 0 : 20,\n numberOfLines: heading ? 2 : 4,\n // RN logical prop so the block indent flips with I18nManager in RTL\n paddingStart: ((_block_indent = block.indent) !== null && _block_indent !== void 0 ? _block_indent : 0) * 12,\n children: [\n prefix,\n block.spans.map(function(span, i) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Text, {\n color: `${span.code ? \"color-12\" : void 0}`,\n fontWeight: span.bold ? \"700\" : void 0,\n fontStyle: span.italic ? \"italic\" : void 0,\n backgroundColor: `${span.code ? \"color-4\" : void 0}`,\n textDecorationLine: span.underline && span.strike ? \"underline line-through\" : span.underline ? \"underline\" : span.strike ? \"line-through\" : void 0,\n children: span.text\n }, i);\n })\n ]\n });\n if (block.quote) {\n return (\n // RN logical props so the quote rail flips with I18nManager in RTL\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.XStack, {\n borderStartWidth: 3,\n borderStartColor: \"color-6\",\n paddingStart: \"2\",\n children: body\n })\n );\n }\n return body;\n}\nvar RichEditorImpl = /* @__PURE__ */ (0, import_react.forwardRef)(function(param, ref) {\n var { size, showToolbar = true, showBubbleToolbar: _showBubbleToolbar, fullscreen: fullscreenProp, defaultFullscreen = false, onFullscreenChange, inlineEditing = false, sections, hasError, editable = true, onStateChange, minHeight = 150, maxHeight, ...editorProps } = param;\n var _editorProps_initialContent, _editorProps_initialContent1, _editorProps_initialContent2, _editorProps_initialContent3, _editorProps_initialContent4, _knobProps_sizeToken, _editorProps_placeholder, _committed_json, _editorProps_autoFocus;\n var _knobProps_body, _knobProps_heading;\n var internalRef = (0, import_react.useRef)(null);\n var [editorState, setEditorState] = (0, import_react.useState)(import_types.defaultEditorState);\n var [internalFullscreen, setInternalFullscreen] = (0, import_react.useState)(defaultFullscreen);\n var fullscreen = fullscreenProp !== null && fullscreenProp !== void 0 ? fullscreenProp : internalFullscreen;\n var [committed, setCommitted] = (0, import_react.useState)(function() {\n var _editorProps_initialContent6, _editorProps_initialJSON;\n return {\n html: (_editorProps_initialContent6 = editorProps.initialContent) !== null && _editorProps_initialContent6 !== void 0 ? _editorProps_initialContent6 : \"\",\n json: (_editorProps_initialJSON = editorProps.initialJSON) !== null && _editorProps_initialJSON !== void 0 ? _editorProps_initialJSON : null\n };\n });\n var committedRef = (0, import_react.useRef)(committed);\n committedRef.current = committed;\n var draftHtml = (0, import_react.useRef)(null);\n var draftJson = (0, import_react.useRef)(null);\n var lastInitialContent = (0, import_react.useRef)((_editorProps_initialContent = editorProps.initialContent) !== null && _editorProps_initialContent !== void 0 ? _editorProps_initialContent : \"\");\n var lastEmitted = (0, import_react.useRef)(null);\n if (!fullscreen && ((_editorProps_initialContent1 = editorProps.initialContent) !== null && _editorProps_initialContent1 !== void 0 ? _editorProps_initialContent1 : \"\") !== lastInitialContent.current && ((_editorProps_initialContent2 = editorProps.initialContent) !== null && _editorProps_initialContent2 !== void 0 ? _editorProps_initialContent2 : \"\") !== lastEmitted.current && ((_editorProps_initialContent3 = editorProps.initialContent) !== null && _editorProps_initialContent3 !== void 0 ? _editorProps_initialContent3 : \"\") !== committedRef.current.html) {\n var _editorProps_initialContent5;\n var html = (_editorProps_initialContent5 = editorProps.initialContent) !== null && _editorProps_initialContent5 !== void 0 ? _editorProps_initialContent5 : \"\";\n committedRef.current = {\n html,\n json: null\n };\n setCommitted(committedRef.current);\n }\n lastInitialContent.current = (_editorProps_initialContent4 = editorProps.initialContent) !== null && _editorProps_initialContent4 !== void 0 ? _editorProps_initialContent4 : \"\";\n var { knobProps } = (0, import_theme.useResolvedKnobs)({\n component: \"RichEditor\",\n size\n });\n var editGlyphColor = (0, import_theme.useGlyphColor)(\"$color-11\");\n var { bodyFontFamily, headingFontFamily } = (0, import_react.useMemo)(function() {\n var _getConfig, _knobProps_body2, _knobProps_heading2;\n var fonts = (_getConfig = (0, import_tamagui.getConfig)()) === null || _getConfig === void 0 ? void 0 : _getConfig.fonts;\n var resolve = function resolve2(token) {\n var _ref;\n var _fonts_key;\n var key = (_ref = token === null || token === void 0 ? void 0 : token.replace(/^\\$/, \"\")) !== null && _ref !== void 0 ? _ref : \"body\";\n var configured = fonts === null || fonts === void 0 ? void 0 : (_fonts_key = fonts[key]) === null || _fonts_key === void 0 ? void 0 : _fonts_key.family;\n var family = typeof configured === \"string\" ? configured.trim() : void 0;\n if (family && /(?:^|,)\\s*(?:serif|sans-serif|monospace|cursive|fantasy|system-ui|ui-serif|ui-sans-serif|ui-monospace|ui-rounded)\\s*$/i.test(family)) return family;\n var fallback = Object.hasOwn(import_theme.fontCategoryStacks, key) ? import_theme.fontCategoryStacks[key] : import_theme.fontCategoryStacks[\"sans-serif\"];\n return family ? `${family}, ${fallback}` : fallback;\n };\n return {\n bodyFontFamily: resolve((_knobProps_body2 = knobProps.body) === null || _knobProps_body2 === void 0 ? void 0 : _knobProps_body2.fontFamily),\n headingFontFamily: resolve((_knobProps_heading2 = knobProps.heading) === null || _knobProps_heading2 === void 0 ? void 0 : _knobProps_heading2.fontFamily)\n };\n }, [\n (_knobProps_body = knobProps.body) === null || _knobProps_body === void 0 ? void 0 : _knobProps_body.fontFamily,\n (_knobProps_heading = knobProps.heading) === null || _knobProps_heading === void 0 ? void 0 : _knobProps_heading.fontFamily\n ]);\n var handleStateChange = (0, import_react.useCallback)(function(state) {\n setEditorState(state);\n onStateChange === null || onStateChange === void 0 ? void 0 : onStateChange(state);\n }, [\n onStateChange\n ]);\n var handleFullscreenChange = (0, import_react.useCallback)(function(next) {\n setInternalFullscreen(next);\n onFullscreenChange === null || onFullscreenChange === void 0 ? void 0 : onFullscreenChange(next);\n }, [\n onFullscreenChange\n ]);\n var openFullscreen = (0, import_react.useCallback)(function() {\n draftHtml.current = null;\n draftJson.current = null;\n handleFullscreenChange(true);\n }, [\n handleFullscreenChange\n ]);\n var { onChange, onBlur } = editorProps;\n var handleCancel = (0, import_react.useCallback)(function() {\n handleFullscreenChange(false);\n onBlur === null || onBlur === void 0 ? void 0 : onBlur();\n }, [\n handleFullscreenChange,\n onBlur\n ]);\n var handleDone = (0, import_react.useCallback)(function() {\n var html2 = draftHtml.current;\n if (html2 !== null && html2 !== committedRef.current.html) {\n committedRef.current = {\n html: html2,\n json: draftJson.current\n };\n setCommitted(committedRef.current);\n lastEmitted.current = html2;\n onChange === null || onChange === void 0 ? void 0 : onChange(html2, draftJson.current);\n }\n handleFullscreenChange(false);\n onBlur === null || onBlur === void 0 ? void 0 : onBlur();\n }, [\n handleFullscreenChange,\n onChange,\n onBlur\n ]);\n (0, import_react.useImperativeHandle)(ref, function() {\n return {\n executeCommand: function executeCommand(command, payload) {\n var _internalRef_current;\n return (_internalRef_current = internalRef.current) === null || _internalRef_current === void 0 ? void 0 : _internalRef_current.executeCommand(command, payload);\n },\n getState: function getState() {\n var _ref;\n var _internalRef_current;\n return (_ref = (_internalRef_current = internalRef.current) === null || _internalRef_current === void 0 ? void 0 : _internalRef_current.getState()) !== null && _ref !== void 0 ? _ref : import_types.defaultEditorState;\n },\n getHTML: function getHTML() {\n return internalRef.current ? internalRef.current.getHTML() || committedRef.current.html : committedRef.current.html;\n },\n getJSON: function getJSON() {\n var _internalRef_current_getJSON;\n return internalRef.current ? (_internalRef_current_getJSON = internalRef.current.getJSON()) !== null && _internalRef_current_getJSON !== void 0 ? _internalRef_current_getJSON : committedRef.current.json : committedRef.current.json;\n },\n // Native markdown serialization is best-effort (turndown needs a\n // DOM): the editor delegates and returns \"\" when unavailable.\n getMarkdown: function getMarkdown() {\n if (internalRef.current) return internalRef.current.getMarkdown();\n try {\n return (0, import_markdown.htmlToMarkdown)(committedRef.current.html);\n } catch (err) {\n console.warn(\"[RichEditor] getMarkdown unavailable on native:\", err);\n return \"\";\n }\n },\n setMarkdown: function setMarkdown(markdown) {\n var html2 = (0, import_markdown.markdownToHtml)(markdown);\n if (internalRef.current) internalRef.current.setHTML(html2);\n else {\n committedRef.current = {\n html: html2,\n json: null\n };\n setCommitted(committedRef.current);\n }\n },\n setHTML: function setHTML(html2) {\n if (internalRef.current) internalRef.current.setHTML(html2);\n else {\n committedRef.current = {\n html: html2,\n json: null\n };\n setCommitted(committedRef.current);\n }\n },\n setJSON: function setJSON(json) {\n if (internalRef.current) internalRef.current.setJSON(json);\n else {\n committedRef.current = {\n ...committedRef.current,\n json\n };\n setCommitted(committedRef.current);\n }\n },\n focus: function focus() {\n if (internalRef.current) internalRef.current.focus();\n else if (!inlineEditing && editable) openFullscreen();\n },\n blur: function blur() {\n var _internalRef_current;\n return (_internalRef_current = internalRef.current) === null || _internalRef_current === void 0 ? void 0 : _internalRef_current.blur();\n }\n };\n }, [\n inlineEditing,\n editable,\n openFullscreen\n ]);\n var cappedRadius = (0, import_forms.clampRadiusForLargeComponent)(knobProps.borderRadius.borderRadius, 4);\n var disabled = !editable;\n var sizeToken = (_knobProps_sizeToken = knobProps.sizeToken) !== null && _knobProps_sizeToken !== void 0 ? _knobProps_sizeToken : \"4\";\n var editGlyphSize = (0, import_theme.sizeRecipeForToken)(sizeToken, {\n touch: true\n }).iconSize;\n var preview = (0, import_react.useMemo)(function() {\n return (0, import_preview.parseHtmlPreview)(committed.html, 6);\n }, [\n committed.html\n ]);\n var previewEmpty = preview.blocks.length === 0;\n if (inlineEditing) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.RichEditorContext.Provider, {\n size: sizeToken,\n disabled,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.EditorFrame, {\n hasError,\n borderRadius: cappedRadius,\n borderWidth: knobProps.borderRadius.borderWidth,\n borderColor: `${hasError ? \"red-10\" : \"color-6\"}`,\n disabled,\n children: [\n showToolbar && !disabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FixedToolbar.FixedToolbar, {\n editorRef: internalRef,\n state: editorState,\n sections,\n hasError\n }),\n TentapEditor ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapEditor, {\n ref: internalRef,\n minHeight,\n maxHeight,\n bodyFontFamily,\n headingFontFamily,\n ...editorProps,\n editable,\n onStateChange: handleStateChange,\n hasError: false\n }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.View, {\n minHeight,\n padding: knobProps.panelPadding.padding,\n justifyContent: \"center\",\n alignItems: \"center\",\n backgroundColor: \"orange-2\",\n accessibilityRole: \"alert\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapUnavailableMessage, {\n detail: tentapLoadError\n })\n })\n ]\n })\n });\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_context.RichEditorContext.Provider, {\n size: sizeToken,\n disabled,\n children: [\n /*\n RN Text/YStack steal taps from Tamagui View onPress, so the preview\n open target is a core Pressable. EditorFrame stays visual-only.\n */\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Pressable, {\n onPress: disabled ? void 0 : openFullscreen,\n disabled,\n accessibilityRole: \"button\",\n accessibilityLabel: (0, import_t.t)(\"Edit rich text\"),\n style: function style(param2) {\n var { pressed } = param2;\n return {\n opacity: pressed && !disabled ? 0.85 : 1\n };\n },\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.EditorFrame, {\n hasError,\n borderRadius: cappedRadius,\n borderWidth: knobProps.borderRadius.borderWidth,\n borderColor: `${hasError ? \"red-10\" : \"color-6\"}`,\n minHeight: Math.min(minHeight, 120),\n maxHeight: maxHeight !== null && maxHeight !== void 0 ? maxHeight : 240,\n pointerEvents: \"none\",\n disabled,\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {\n padding: knobProps.panelPadding.padding,\n paddingRight: \"6\",\n gap: \"1-5\",\n flex: 1,\n children: [\n !TentapEditor && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$orange-10\",\n fontSize: 12,\n children: (0, import_t.t)(\"Editor unavailable. Tap for details.\")\n }),\n previewEmpty ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$color-10\",\n fontSize: 14,\n lineHeight: 20,\n children: (_editorProps_placeholder = editorProps.placeholder) !== null && _editorProps_placeholder !== void 0 ? _editorProps_placeholder : (0, import_t.t)(\"Start writing...\")\n }) : preview.blocks.map(function(block, i) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PreviewBlockText, {\n block\n }, i);\n }),\n preview.truncated && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$color-10\",\n fontSize: 14,\n children: \"\\u2026\"\n })\n ]\n }),\n !disabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.View, {\n position: \"absolute\",\n top: \"2-5\",\n right: \"2-5\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.PencilSimpleIcon, {\n color: editGlyphColor,\n size: editGlyphSize,\n \"aria-hidden\": true\n })\n })\n ]\n })\n }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Modal, {\n visible: fullscreen,\n animationType: \"slide\",\n presentationStyle: \"fullScreen\",\n onRequestClose: handleCancel,\n children: fullscreen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {\n flex: 1,\n backgroundColor: \"background\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.KeyboardAvoidingView, {\n style: styles.flex,\n behavior: import_react_native.Platform.OS === \"ios\" ? \"padding\" : void 0,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.SafeAreaView, {\n style: styles.flex,\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, {\n alignItems: \"center\",\n justifyContent: \"space-between\",\n paddingHorizontal: \"2\",\n paddingVertical: \"1-5\",\n borderBottomWidth: 1,\n borderBottomColor: \"color-6\",\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ActionButton, {\n kind: \"cancel\",\n onPress: handleCancel\n }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ActionButton, {\n kind: \"done\",\n onPress: handleDone\n })\n ]\n }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {\n flex: 1,\n children: TentapEditor ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapEditor, {\n ref: internalRef,\n bodyFontFamily,\n headingFontFamily,\n ...editorProps,\n initialContent: committed.html,\n initialJSON: (_committed_json = committed.json) !== null && _committed_json !== void 0 ? _committed_json : void 0,\n autoFocus: (_editorProps_autoFocus = editorProps.autoFocus) !== null && _editorProps_autoFocus !== void 0 ? _editorProps_autoFocus : true,\n editable: true,\n fill: true,\n onChange: function onChange2(html2, json) {\n draftHtml.current = html2;\n draftJson.current = json;\n },\n onStateChange: handleStateChange,\n hasError: false\n }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.View, {\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: \"4\",\n backgroundColor: \"orange-2\",\n accessibilityRole: \"alert\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapUnavailableMessage, {\n detail: tentapLoadError\n })\n })\n }),\n showToolbar && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FixedToolbar.FixedToolbar, {\n editorRef: internalRef,\n state: editorState,\n sections,\n docked: \"bottom\"\n })\n ]\n })\n })\n })\n })\n ]\n });\n});\nRichEditorImpl.displayName = \"RichEditor\";\nvar styles = import_react_native.StyleSheet.create({\n flex: {\n flex: 1\n }\n});\nvar RichEditor = (0, import_tamagui.withStaticProperties)(RichEditorImpl, {\n FixedToolbar: import_FixedToolbar.FixedToolbar,\n BubbleToolbar: NativeBubbleToolbar,\n Editor: TentapEditor !== null && TentapEditor !== void 0 ? TentapEditor : TentapUnavailableEditor\n});\n//# sourceMappingURL=RichEditor.native.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,4BAA4B,CAAC;AACjC,SAAS,2BAA2B,EAClC,kBAAkB,WACpB,CAAC;AACD,OAAO,UAAU,aAAa,yBAAyB;AACvD,IAAI,qBAAqB,QAAQ,mBAAmB;AACpD,IAAI,eAAe,QAAQ,OAAO;AAClC,IAAI,sBAAsB,QAAQ,cAAc;AAChD,IAAI,iBAAiB,QAAQ,SAAS;AACtC,IAAI,eAAe,QAAQ,0BAA0B;AACrD,IAAI,oBAAoB,QAAQ,+BAA+B;AAC/D,IAAI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e,iBAAC,GAAG,mBAAmB,IAAG,CAAE,eAAe,QAAQ;QACjE,MAAM;QACN,UAAU,eAA+B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,cAAc;SACjF,KAAK;SACL;SACA;SACA,GAAG;SACH,gBAAgB,UAAU;SAC1B,cAAc,kBAAkB,UAAU,UAAU,QAAQ,oBAAoB,KAAK,IAAI,kBAAkB,KAAK;SAChH,YAAY,yBAAyB,YAAY,eAAe,QAAQ,2BAA2B,KAAK,IAAI,yBAAyB;SACrI,UAAU;SACV,MAAM;SACN,UAAU,SAAS,UAAU,OAAO,MAAM;UACxC,UAAU,UAAU;UACpB,UAAU,UAAU;SACtB;SACA,eAAe;SACf,UAAU;QACZ,CAAC,IAAoB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,eAAe,MAAM;SACpE,MAAM;SACN,gBAAgB;SAChB,YAAY;SACZ,SAAS;SACT,iBAAiB;SACjB,mBAAmB;SACnB,UAA0B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,0BAA0B,EAC9E,QAAQ,gBACV,CAAC;QACH,CAAC;OACH,CAAC;OACD,eAA+B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,oBAAoB,cAAc;QAC3F,WAAW;QACX,OAAO;QACP;QACA,QAAQ;OACV,CAAC;MACH;KACF,CAAC;IACH,CAAC;GACH,CAAC;EACH,CAAC,CACH;CACF,CAAC;AACH,CAAC;AACD,eAAe,cAAc;AAC7B,IAAI,SAAS,oBAAoB,WAAW,OAAO,EACjD,MAAM,EACJ,MAAM,EACR,EACF,CAAC;AACD,IAAI,cAAc,GAAG,eAAe,qBAAoB,CAAE,gBAAgB;CACxE,cAAc,oBAAoB;CAClC,eAAe;CACf,QAAQ,iBAAiB,QAAQ,iBAAiB,KAAK,IAAI,eAAe;AAC5E,CAAC"}
1
+ {"version":3,"file":"RichEditor.native.js","names":[],"sources":["jsx/RichEditor.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar RichEditor_native_exports = {};\n__export(RichEditor_native_exports, {\n RichEditor: () => RichEditor\n});\nmodule.exports = __toCommonJS(RichEditor_native_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = require(\"react\");\nvar import_react_native = require(\"react-native\");\nvar import_tamagui = require(\"tamagui\");\nvar import_theme = require(\"@multiplatform.one/theme\");\nvar import_components = require(\"@multiplatform.one/components\");\nvar import_react2 = require(\"@phosphor-icons/react\");\nvar import_forms = require(\"@multiplatform.one/forms\");\nvar import_types = require(\"./types\");\nvar import_context = require(\"./context\");\nvar import_styled = require(\"./styled\");\nvar import_FixedToolbar = require(\"./toolbar/FixedToolbar\");\nvar import_preview = require(\"./preview\");\nvar import_markdown = require(\"./editor/markdown\");\nvar import_t = require(\"./shared/t\");\nfunction NativeBubbleToolbar() {\n return null;\n}\nvar TentapEditor = null;\nvar tentapLoadError = null;\ntry {\n TentapEditor = require(\"./editor/TentapEditor.native\").TentapEditor;\n} catch (err) {\n tentapLoadError = err instanceof Error ? err.message : String(err);\n console.warn(\"[RichEditor] TentapEditor failed to load:\", tentapLoadError);\n}\nfunction TentapUnavailableMessage(param) {\n var { detail } = param;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {\n gap: \"2\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"3\",\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$orange-10\",\n fontSize: 14,\n fontWeight: \"700\",\n textAlign: \"center\",\n children: (0, import_t.t)(\"Rich text editor unavailable\")\n }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$color-11\",\n fontSize: 12,\n textAlign: \"center\",\n children: detail || (0, import_t.t)(\"TentapEditor failed to load (requires @10play/tentap-editor)\")\n })\n ]\n });\n}\nfunction TentapUnavailableEditor(props) {\n var _props_minHeight;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.View, {\n minHeight: (_props_minHeight = props.minHeight) !== null && _props_minHeight !== void 0 ? _props_minHeight : 150,\n padding: \"4\",\n justifyContent: \"center\",\n alignItems: \"center\",\n backgroundColor: \"orange-2\",\n borderWidth: 1,\n borderColor: \"orange-8\",\n borderRadius: \"3\",\n accessibilityRole: \"alert\",\n \"aria-label\": (0, import_t.t)(\"Rich text editor unavailable\"),\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapUnavailableMessage, {\n detail: tentapLoadError\n })\n });\n}\nvar HEADING_STYLE = {\n heading1: {\n fontSize: 20,\n fontWeight: \"700\"\n },\n heading2: {\n fontSize: 18,\n fontWeight: \"700\"\n },\n heading3: {\n fontSize: 16,\n fontWeight: \"600\"\n },\n heading4: {\n fontSize: 15,\n fontWeight: \"600\"\n },\n heading5: {\n fontSize: 14,\n fontWeight: \"600\"\n },\n heading6: {\n fontSize: 14,\n fontWeight: \"600\"\n }\n};\nfunction PreviewBlockText(param) {\n var { block } = param;\n var _block_index, _ref, _block_indent;\n var heading = HEADING_STYLE[block.kind];\n var prefix = block.kind === \"bullet\" ? \"\\u2022 \" : block.kind === \"ordered\" ? `${(_block_index = block.index) !== null && _block_index !== void 0 ? _block_index : 1}. ` : block.kind === \"task\" ? block.checked ? \"\\u2611 \" : \"\\u2610 \" : \"\";\n var body = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.Text, {\n color: block.quote ? \"$color-11\" : \"$color-12\",\n fontSize: (_ref = heading === null || heading === void 0 ? void 0 : heading.fontSize) !== null && _ref !== void 0 ? _ref : 14,\n fontWeight: heading === null || heading === void 0 ? void 0 : heading.fontWeight,\n fontStyle: block.quote ? \"italic\" : void 0,\n lineHeight: heading ? void 0 : 20,\n numberOfLines: heading ? 2 : 4,\n // RN logical prop so the block indent flips with I18nManager in RTL\n paddingStart: ((_block_indent = block.indent) !== null && _block_indent !== void 0 ? _block_indent : 0) * 12,\n children: [\n prefix,\n block.spans.map(function(span, i) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Text, {\n color: span.code ? \"color-12\" : void 0,\n fontWeight: span.bold ? \"700\" : void 0,\n fontStyle: span.italic ? \"italic\" : void 0,\n backgroundColor: span.code ? \"color-4\" : void 0,\n textDecorationLine: span.underline && span.strike ? \"underline line-through\" : span.underline ? \"underline\" : span.strike ? \"line-through\" : void 0,\n children: span.text\n }, i);\n })\n ]\n });\n if (block.quote) {\n return (\n // RN logical props so the quote rail flips with I18nManager in RTL\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.XStack, {\n borderStartWidth: 3,\n borderStartColor: \"color-6\",\n paddingStart: \"2\",\n children: body\n })\n );\n }\n return body;\n}\nvar RichEditorImpl = /* @__PURE__ */ (0, import_react.forwardRef)(function(param, ref) {\n var { size, showToolbar = true, showBubbleToolbar: _showBubbleToolbar, fullscreen: fullscreenProp, defaultFullscreen = false, onFullscreenChange, inlineEditing = false, sections, hasError, editable = true, onStateChange, minHeight = 150, maxHeight, ...editorProps } = param;\n var _editorProps_initialContent, _editorProps_initialContent1, _editorProps_initialContent2, _editorProps_initialContent3, _editorProps_initialContent4, _knobProps_sizeToken, _editorProps_placeholder, _committed_json, _editorProps_autoFocus;\n var _knobProps_body, _knobProps_heading;\n var internalRef = (0, import_react.useRef)(null);\n var [editorState, setEditorState] = (0, import_react.useState)(import_types.defaultEditorState);\n var [internalFullscreen, setInternalFullscreen] = (0, import_react.useState)(defaultFullscreen);\n var fullscreen = fullscreenProp !== null && fullscreenProp !== void 0 ? fullscreenProp : internalFullscreen;\n var [committed, setCommitted] = (0, import_react.useState)(function() {\n var _editorProps_initialContent6, _editorProps_initialJSON;\n return {\n html: (_editorProps_initialContent6 = editorProps.initialContent) !== null && _editorProps_initialContent6 !== void 0 ? _editorProps_initialContent6 : \"\",\n json: (_editorProps_initialJSON = editorProps.initialJSON) !== null && _editorProps_initialJSON !== void 0 ? _editorProps_initialJSON : null\n };\n });\n var committedRef = (0, import_react.useRef)(committed);\n committedRef.current = committed;\n var draftHtml = (0, import_react.useRef)(null);\n var draftJson = (0, import_react.useRef)(null);\n var lastInitialContent = (0, import_react.useRef)((_editorProps_initialContent = editorProps.initialContent) !== null && _editorProps_initialContent !== void 0 ? _editorProps_initialContent : \"\");\n var lastEmitted = (0, import_react.useRef)(null);\n if (!fullscreen && ((_editorProps_initialContent1 = editorProps.initialContent) !== null && _editorProps_initialContent1 !== void 0 ? _editorProps_initialContent1 : \"\") !== lastInitialContent.current && ((_editorProps_initialContent2 = editorProps.initialContent) !== null && _editorProps_initialContent2 !== void 0 ? _editorProps_initialContent2 : \"\") !== lastEmitted.current && ((_editorProps_initialContent3 = editorProps.initialContent) !== null && _editorProps_initialContent3 !== void 0 ? _editorProps_initialContent3 : \"\") !== committedRef.current.html) {\n var _editorProps_initialContent5;\n var html = (_editorProps_initialContent5 = editorProps.initialContent) !== null && _editorProps_initialContent5 !== void 0 ? _editorProps_initialContent5 : \"\";\n committedRef.current = {\n html,\n json: null\n };\n setCommitted(committedRef.current);\n }\n lastInitialContent.current = (_editorProps_initialContent4 = editorProps.initialContent) !== null && _editorProps_initialContent4 !== void 0 ? _editorProps_initialContent4 : \"\";\n var { knobProps } = (0, import_theme.useResolvedKnobs)({\n component: \"RichEditor\",\n size\n });\n var editGlyphColor = (0, import_theme.useGlyphColor)(\"$color-11\");\n var { bodyFontFamily, headingFontFamily } = (0, import_react.useMemo)(function() {\n var _getConfig, _knobProps_body2, _knobProps_heading2;\n var fonts = (_getConfig = (0, import_tamagui.getConfig)()) === null || _getConfig === void 0 ? void 0 : _getConfig.fonts;\n var resolve = function resolve2(token) {\n var _ref;\n var _fonts_key;\n var key = (_ref = token === null || token === void 0 ? void 0 : token.replace(/^\\$/, \"\")) !== null && _ref !== void 0 ? _ref : \"body\";\n var configured = fonts === null || fonts === void 0 ? void 0 : (_fonts_key = fonts[key]) === null || _fonts_key === void 0 ? void 0 : _fonts_key.family;\n var family = typeof configured === \"string\" ? configured.trim() : void 0;\n if (family && /(?:^|,)\\s*(?:serif|sans-serif|monospace|cursive|fantasy|system-ui|ui-serif|ui-sans-serif|ui-monospace|ui-rounded)\\s*$/i.test(family)) return family;\n var fallback = Object.hasOwn(import_theme.fontCategoryStacks, key) ? import_theme.fontCategoryStacks[key] : import_theme.fontCategoryStacks[\"sans-serif\"];\n return family ? `${family}, ${fallback}` : fallback;\n };\n return {\n bodyFontFamily: resolve((_knobProps_body2 = knobProps.body) === null || _knobProps_body2 === void 0 ? void 0 : _knobProps_body2.fontFamily),\n headingFontFamily: resolve((_knobProps_heading2 = knobProps.heading) === null || _knobProps_heading2 === void 0 ? void 0 : _knobProps_heading2.fontFamily)\n };\n }, [\n (_knobProps_body = knobProps.body) === null || _knobProps_body === void 0 ? void 0 : _knobProps_body.fontFamily,\n (_knobProps_heading = knobProps.heading) === null || _knobProps_heading === void 0 ? void 0 : _knobProps_heading.fontFamily\n ]);\n var handleStateChange = (0, import_react.useCallback)(function(state) {\n setEditorState(state);\n onStateChange === null || onStateChange === void 0 ? void 0 : onStateChange(state);\n }, [\n onStateChange\n ]);\n var handleFullscreenChange = (0, import_react.useCallback)(function(next) {\n setInternalFullscreen(next);\n onFullscreenChange === null || onFullscreenChange === void 0 ? void 0 : onFullscreenChange(next);\n }, [\n onFullscreenChange\n ]);\n var openFullscreen = (0, import_react.useCallback)(function() {\n draftHtml.current = null;\n draftJson.current = null;\n handleFullscreenChange(true);\n }, [\n handleFullscreenChange\n ]);\n var { onChange, onBlur } = editorProps;\n var handleCancel = (0, import_react.useCallback)(function() {\n handleFullscreenChange(false);\n onBlur === null || onBlur === void 0 ? void 0 : onBlur();\n }, [\n handleFullscreenChange,\n onBlur\n ]);\n var handleDone = (0, import_react.useCallback)(function() {\n var html2 = draftHtml.current;\n if (html2 !== null && html2 !== committedRef.current.html) {\n committedRef.current = {\n html: html2,\n json: draftJson.current\n };\n setCommitted(committedRef.current);\n lastEmitted.current = html2;\n onChange === null || onChange === void 0 ? void 0 : onChange(html2, draftJson.current);\n }\n handleFullscreenChange(false);\n onBlur === null || onBlur === void 0 ? void 0 : onBlur();\n }, [\n handleFullscreenChange,\n onChange,\n onBlur\n ]);\n (0, import_react.useImperativeHandle)(ref, function() {\n return {\n executeCommand: function executeCommand(command, payload) {\n var _internalRef_current;\n return (_internalRef_current = internalRef.current) === null || _internalRef_current === void 0 ? void 0 : _internalRef_current.executeCommand(command, payload);\n },\n getState: function getState() {\n var _ref;\n var _internalRef_current;\n return (_ref = (_internalRef_current = internalRef.current) === null || _internalRef_current === void 0 ? void 0 : _internalRef_current.getState()) !== null && _ref !== void 0 ? _ref : import_types.defaultEditorState;\n },\n getHTML: function getHTML() {\n return internalRef.current ? internalRef.current.getHTML() || committedRef.current.html : committedRef.current.html;\n },\n getJSON: function getJSON() {\n var _internalRef_current_getJSON;\n return internalRef.current ? (_internalRef_current_getJSON = internalRef.current.getJSON()) !== null && _internalRef_current_getJSON !== void 0 ? _internalRef_current_getJSON : committedRef.current.json : committedRef.current.json;\n },\n // Native markdown serialization is best-effort (turndown needs a\n // DOM): the editor delegates and returns \"\" when unavailable.\n getMarkdown: function getMarkdown() {\n if (internalRef.current) return internalRef.current.getMarkdown();\n try {\n return (0, import_markdown.htmlToMarkdown)(committedRef.current.html);\n } catch (err) {\n console.warn(\"[RichEditor] getMarkdown unavailable on native:\", err);\n return \"\";\n }\n },\n setMarkdown: function setMarkdown(markdown) {\n var html2 = (0, import_markdown.markdownToHtml)(markdown);\n if (internalRef.current) internalRef.current.setHTML(html2);\n else {\n committedRef.current = {\n html: html2,\n json: null\n };\n setCommitted(committedRef.current);\n }\n },\n setHTML: function setHTML(html2) {\n if (internalRef.current) internalRef.current.setHTML(html2);\n else {\n committedRef.current = {\n html: html2,\n json: null\n };\n setCommitted(committedRef.current);\n }\n },\n setJSON: function setJSON(json) {\n if (internalRef.current) internalRef.current.setJSON(json);\n else {\n committedRef.current = {\n ...committedRef.current,\n json\n };\n setCommitted(committedRef.current);\n }\n },\n focus: function focus() {\n if (internalRef.current) internalRef.current.focus();\n else if (!inlineEditing && editable) openFullscreen();\n },\n blur: function blur() {\n var _internalRef_current;\n return (_internalRef_current = internalRef.current) === null || _internalRef_current === void 0 ? void 0 : _internalRef_current.blur();\n }\n };\n }, [\n inlineEditing,\n editable,\n openFullscreen\n ]);\n var cappedRadius = (0, import_forms.clampRadiusForLargeComponent)(knobProps.borderRadius.borderRadius, 4);\n var disabled = !editable;\n var sizeToken = (_knobProps_sizeToken = knobProps.sizeToken) !== null && _knobProps_sizeToken !== void 0 ? _knobProps_sizeToken : \"4\";\n var editGlyphSize = (0, import_theme.sizeRecipeForToken)(sizeToken, {\n touch: true\n }).iconSize;\n var preview = (0, import_react.useMemo)(function() {\n return (0, import_preview.parseHtmlPreview)(committed.html, 6);\n }, [\n committed.html\n ]);\n var previewEmpty = preview.blocks.length === 0;\n if (inlineEditing) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.RichEditorContext.Provider, {\n size: sizeToken,\n disabled,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.EditorFrame, {\n hasError,\n borderRadius: cappedRadius,\n borderWidth: knobProps.borderRadius.borderWidth,\n borderColor: `${hasError ? \"red-10\" : \"color-6\"}`,\n disabled,\n children: [\n showToolbar && !disabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FixedToolbar.FixedToolbar, {\n editorRef: internalRef,\n state: editorState,\n sections,\n hasError\n }),\n TentapEditor ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapEditor, {\n ref: internalRef,\n minHeight,\n maxHeight,\n bodyFontFamily,\n headingFontFamily,\n ...editorProps,\n editable,\n onStateChange: handleStateChange,\n hasError: false\n }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.View, {\n minHeight,\n padding: knobProps.panelPadding.padding,\n justifyContent: \"center\",\n alignItems: \"center\",\n backgroundColor: \"orange-2\",\n accessibilityRole: \"alert\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapUnavailableMessage, {\n detail: tentapLoadError\n })\n })\n ]\n })\n });\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_context.RichEditorContext.Provider, {\n size: sizeToken,\n disabled,\n children: [\n /*\n RN Text/YStack steal taps from Tamagui View onPress, so the preview\n open target is a core Pressable. EditorFrame stays visual-only.\n */\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Pressable, {\n onPress: disabled ? void 0 : openFullscreen,\n disabled,\n accessibilityRole: \"button\",\n accessibilityLabel: (0, import_t.t)(\"Edit rich text\"),\n style: function style(param2) {\n var { pressed } = param2;\n return {\n opacity: pressed && !disabled ? 0.85 : 1\n };\n },\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.EditorFrame, {\n hasError,\n borderRadius: cappedRadius,\n borderWidth: knobProps.borderRadius.borderWidth,\n borderColor: `${hasError ? \"red-10\" : \"color-6\"}`,\n minHeight: Math.min(minHeight, 120),\n maxHeight: maxHeight !== null && maxHeight !== void 0 ? maxHeight : 240,\n pointerEvents: \"none\",\n disabled,\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {\n padding: knobProps.panelPadding.padding,\n paddingRight: \"6\",\n gap: \"1-5\",\n flex: 1,\n children: [\n !TentapEditor && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$orange-10\",\n fontSize: 12,\n children: (0, import_t.t)(\"Editor unavailable. Tap for details.\")\n }),\n previewEmpty ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$color-10\",\n fontSize: 14,\n lineHeight: 20,\n children: (_editorProps_placeholder = editorProps.placeholder) !== null && _editorProps_placeholder !== void 0 ? _editorProps_placeholder : (0, import_t.t)(\"Start writing...\")\n }) : preview.blocks.map(function(block, i) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PreviewBlockText, {\n block\n }, i);\n }),\n preview.truncated && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Text, {\n color: \"$color-10\",\n fontSize: 14,\n children: \"\\u2026\"\n })\n ]\n }),\n !disabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.View, {\n position: \"absolute\",\n top: \"2-5\",\n right: \"2-5\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.PencilSimpleIcon, {\n color: editGlyphColor,\n size: editGlyphSize,\n \"aria-hidden\": true\n })\n })\n ]\n })\n }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Modal, {\n visible: fullscreen,\n animationType: \"slide\",\n presentationStyle: \"fullScreen\",\n onRequestClose: handleCancel,\n children: fullscreen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {\n flex: 1,\n backgroundColor: \"background\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.KeyboardAvoidingView, {\n style: styles.flex,\n behavior: import_react_native.Platform.OS === \"ios\" ? \"padding\" : void 0,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.SafeAreaView, {\n style: styles.flex,\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, {\n alignItems: \"center\",\n justifyContent: \"space-between\",\n paddingHorizontal: \"2\",\n paddingVertical: \"1-5\",\n borderBottomWidth: 1,\n borderBottomColor: \"color-6\",\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ActionButton, {\n kind: \"cancel\",\n onPress: handleCancel\n }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ActionButton, {\n kind: \"done\",\n onPress: handleDone\n })\n ]\n }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {\n flex: 1,\n children: TentapEditor ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapEditor, {\n ref: internalRef,\n bodyFontFamily,\n headingFontFamily,\n ...editorProps,\n initialContent: committed.html,\n initialJSON: (_committed_json = committed.json) !== null && _committed_json !== void 0 ? _committed_json : void 0,\n autoFocus: (_editorProps_autoFocus = editorProps.autoFocus) !== null && _editorProps_autoFocus !== void 0 ? _editorProps_autoFocus : true,\n editable: true,\n fill: true,\n onChange: function onChange2(html2, json) {\n draftHtml.current = html2;\n draftJson.current = json;\n },\n onStateChange: handleStateChange,\n hasError: false\n }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.View, {\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: \"4\",\n backgroundColor: \"orange-2\",\n accessibilityRole: \"alert\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TentapUnavailableMessage, {\n detail: tentapLoadError\n })\n })\n }),\n showToolbar && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FixedToolbar.FixedToolbar, {\n editorRef: internalRef,\n state: editorState,\n sections,\n docked: \"bottom\"\n })\n ]\n })\n })\n })\n })\n ]\n });\n});\nRichEditorImpl.displayName = \"RichEditor\";\nvar styles = import_react_native.StyleSheet.create({\n flex: {\n flex: 1\n }\n});\nvar RichEditor = (0, import_tamagui.withStaticProperties)(RichEditorImpl, {\n FixedToolbar: import_FixedToolbar.FixedToolbar,\n BubbleToolbar: NativeBubbleToolbar,\n Editor: TentapEditor !== null && TentapEditor !==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kB,UAAU,UAAU,QAAQ,oBAAoB,KAAK,IAAI,kBAAkB,KAAK;SAChH,YAAY,yBAAyB,YAAY,eAAe,QAAQ,2BAA2B,KAAK,IAAI,yBAAyB;SACrI,UAAU;SACV,MAAM;SACN,UAAU,SAAS,UAAU,OAAO,MAAM;UACxC,UAAU,UAAU;UACpB,UAAU,UAAU;SACtB;SACA,eAAe;SACf,UAAU;QACZ,CAAC,IAAoB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,eAAe,MAAM;SACpE,MAAM;SACN,gBAAgB;SAChB,YAAY;SACZ,SAAS;SACT,iBAAiB;SACjB,mBAAmB;SACnB,UAA0B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,0BAA0B,EAC9E,QAAQ,gBACV,CAAC;QACH,CAAC;OACH,CAAC;OACD,eAA+B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,oBAAoB,cAAc;QAC3F,WAAW;QACX,OAAO;QACP;QACA,QAAQ;OACV,CAAC;MACH;KACF,CAAC;IACH,CAAC;GACH,CAAC;EACH,CAAC,CACH;CACF,CAAC;AACH,CAAC;AACD,eAAe,cAAc;AAC7B,IAAI,SAAS,oBAAoB,WAAW,OAAO,EACjD,MAAM,EACJ,MAAM,EACR,EACF,CAAC;AACD,IAAI,cAAc,GAAG,eAAe,qBAAoB,CAAE,gBAAgB;CACxE,cAAc,oBAAoB;CAClC,eAAe;CACf,QAAQ,iBAAiB,QAAQ,iBAAiB,KAAK,IAAI,eAAe;AAC5E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/rich-text",
3
- "version": "10.1.0",
3
+ "version": "10.1.2",
4
4
  "description": "Cross-platform rich text editor with markdown support and syntax highlighting",
5
5
  "keywords": [
6
6
  "cross-platform",
@@ -57,10 +57,10 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@10play/tentap-editor": "^1.0.1",
60
- "@multiplatform.one/components": "^10.1.0",
61
- "@multiplatform.one/forms": "^10.1.0",
62
- "@multiplatform.one/markdown": "^10.1.0",
63
- "@multiplatform.one/theme": "^10.1.0",
60
+ "@multiplatform.one/components": "^10.1.2",
61
+ "@multiplatform.one/forms": "^10.1.2",
62
+ "@multiplatform.one/markdown": "^10.1.2",
63
+ "@multiplatform.one/theme": "^10.1.2",
64
64
  "@phosphor-icons/react": "^2.1.10",
65
65
  "@tamagui/constants": "3.2.3",
66
66
  "@tamagui/linear-gradient": "3.2.3",
@@ -102,9 +102,9 @@
102
102
  "turndown": "^7.2.4"
103
103
  },
104
104
  "devDependencies": {
105
- "@multiplatform.one/config": "10.1.0",
106
- "@multiplatform.one/storybook": "10.1.0",
107
- "@multiplatform.one/test-utils": "10.1.0",
105
+ "@multiplatform.one/config": "10.1.2",
106
+ "@multiplatform.one/storybook": "10.1.2",
107
+ "@multiplatform.one/test-utils": "10.1.2",
108
108
  "@tamagui/build": "3.2.3",
109
109
  "@testing-library/jest-dom": "^7.0.1",
110
110
  "@testing-library/react": "^16.3.3",
@@ -183,10 +183,10 @@ function PreviewBlockText({ block }: { block: PreviewBlock }) {
183
183
  {block.spans.map((span, i) => (
184
184
  <TamaguiText
185
185
  key={i}
186
- color={`${span.code ? "color-12" : undefined}`}
186
+ color={span.code ? "color-12" : undefined}
187
187
  fontWeight={span.bold ? "700" : undefined}
188
188
  fontStyle={span.italic ? "italic" : undefined}
189
- backgroundColor={`${span.code ? "color-4" : undefined}`}
189
+ backgroundColor={span.code ? "color-4" : undefined}
190
190
  textDecorationLine={
191
191
  span.underline && span.strike
192
192
  ? "underline line-through"