{"_id":"@c0da0523/react-native-selectable-text","name":"@c0da0523/react-native-selectable-text","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@c0da0523/react-native-selectable-text","version":"1.0.0","type":"module","description":"A library for custom text selection menus","main":"./lib/module/index.js","types":"./lib/typescript/src/index.d.ts","exports":{".":{"source":"./src/index.tsx","types":"./lib/typescript/src/index.d.ts","default":"./lib/module/index.js"},"./package.json":"./package.json"},"scripts":{"example":"yarn workspace react-native-selectable-text-example","test":"jest","typecheck":"tsc","lint":"eslint \"**/*.{js,ts,tsx}\"","clean":"del-cli android/build example/android/build example/android/app/build example/ios/build lib","prepare":"bob build","release":"release-it --only-version"},"keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/Rob117/react-native-selectable-text/react-native-selectable-text.git"},"author":{"name":"Robert Sherling","email":"5183016+Rob117@users.noreply.github.com","url":"https://github.com/Rob117/react-native-selectable-text"},"license":"MIT","bugs":{"url":"https://github.com/Rob117/react-native-selectable-text/react-native-selectable-text/issues"},"homepage":"https://github.com/Rob117/react-native-selectable-text/react-native-selectable-text#readme","publishConfig":{"registry":"https://registry.npmjs.org/"},"devDependencies":{"@commitlint/config-conventional":"^19.8.1","@eslint/compat":"^1.3.2","@eslint/eslintrc":"^3.3.1","@eslint/js":"^9.35.0","@evilmartians/lefthook":"^1.12.3","@react-native-community/cli":"20.0.1","@react-native/babel-preset":"0.81.1","@react-native/eslint-config":"^0.81.1","@release-it/conventional-changelog":"^10.0.1","@types/jest":"^29.5.14","@types/react":"^19.1.0","commitlint":"^19.8.1","del-cli":"^6.0.0","eslint":"^9.35.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","jest":"^29.7.0","prettier":"^3.6.2","react":"19.1.0","react-native":"0.81.1","react-native-builder-bob":"^0.40.13","release-it":"^19.0.4","turbo":"^2.5.6","typescript":"^5.9.2"},"peerDependencies":{"react":"*","react-native":"*"},"workspaces":["example"],"packageManager":"yarn@3.6.1","jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"commitMessage":"chore: release ${version}","tagName":"v${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":{"name":"angular"}}}},"prettier":{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false},"react-native-builder-bob":{"source":"src","output":"lib","targets":[["module",{"esm":true}],["typescript",{"project":"tsconfig.build.json"}]]},"codegenConfig":{"name":"SelectableTextViewSpec","type":"all","jsSrcsDir":"src","android":{"javaPackageName":"com.selectabletext"},"ios":{"componentProvider":{"SelectableTextView":"SelectableTextView"}}},"create-react-native-library":{"languages":"kotlin-objc","type":"fabric-view","version":"0.54.2"},"_id":"@c0da0523/react-native-selectable-text@1.0.0","gitHead":"8f732c81c9c9f0fdf5872c8fd958fc8a25823df9","_nodeVersion":"22.18.0","_npmVersion":"11.5.2","dist":{"integrity":"sha512-fEE+6jboISPDwjeqWn3hF0bSKjI37wYZUK8lPh3P5kPcw+Q+Eb17q1M8FYNHoUSzT5Sp6Zb7q4M2cH/E3CWxDw==","shasum":"c65663a8b3b503c0985e70af6d1a93d99837ca11","tarball":"https://registry.npmjs.org/@c0da0523/react-native-selectable-text/-/react-native-selectable-text-1.0.0.tgz","fileCount":28,"unpackedSize":50579,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICays09w0noArbg2gPN2mOARL+7a9MFHAMYVQtgOv36EAiEAuD2S7XhxjqEmO7/fL5lWH/pEM+9rMUvR//CN0Mr6hJY="}]},"_npmUser":{"name":"coda0523","email":"ky302511526@gmail.com"},"directories":{},"maintainers":[{"name":"coda0523","email":"ky302511526@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-native-selectable-text_1.0.0_1758264827264_0.6788847686666717"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-19T06:53:47.183Z","1.0.0":"2025-09-19T06:53:47.454Z","modified":"2025-09-19T06:53:48.284Z"},"maintainers":[{"name":"coda0523","email":"ky302511526@gmail.com"}],"description":"A library for custom text selection menus","homepage":"https://github.com/Rob117/react-native-selectable-text/react-native-selectable-text#readme","keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/Rob117/react-native-selectable-text/react-native-selectable-text.git"},"author":{"name":"Robert Sherling","email":"5183016+Rob117@users.noreply.github.com","url":"https://github.com/Rob117/react-native-selectable-text"},"bugs":{"url":"https://github.com/Rob117/react-native-selectable-text/react-native-selectable-text/issues"},"license":"MIT","readme":"Disclaimer -\n\nI tested this code in my own projects, but this code has been with heavy assistance from Claude Code. If you see a problem - submit a ticket!\n\n# react-native-selectable-text\n\nA React Native library for custom text selection menus, redesigned from the ground up for React Native 0.81.1 with full support for the new architecture (Fabric).\n\nThe `SelectableTextView` component wraps your text content and provides custom menu options that appear when users select text. It supports nested text styling and cross-platform event handling.\n\n## Features\n\n- Cross-platform support (iOS & Android)\n- Support for nested text with different styles\n- Custom menu options with callback handling\n\n## Installation\n\n```sh\nnpm install @c0da0523/react-native-selectable-text\n```\n\nFor iOS, run pod install:\n\n```sh\ncd ios && pod install\n```\n\n## Usage\n\n### Basic Example\n\n```tsx\nimport React, { useState } from 'react';\nimport { View, Text, Alert } from 'react-native';\nimport { SelectableTextView } from '@c0da0523/react-native-selectable-text';\n\nexport default function App() {\n  const handleSelection = (event) => {\n    const { chosenOption, highlightedText } = event;\n    Alert.alert(\n      'Selection Event',\n      `Option: ${chosenOption}\\nSelected Text: ${highlightedText}`\n    );\n  };\n\n  return (\n    <View>\n      <SelectableTextView\n        menuOptions={['look up', 'copy', 'share']}\n        onSelection={handleSelection}\n        style={{ margin: 20 }}\n      >\n        <Text>This is simple selectable text</Text>\n      </SelectableTextView>\n    </View>\n  );\n}\n```\n\n### Advanced Example with Nested Text Styling\n\n```jsx\n<SelectableTextView\n  menuOptions={['Action 1', 'Action 2', 'Custom Action']}\n  onSelection={handleSelection}\n  style={{ marginHorizontal: 20 }}\n>\n  <Text style={{ color: 'black', fontSize: 16 }}>\n    This text is black{' '}\n    <Text style={{ textDecorationLine: 'underline', color: 'red' }}>\n      this part is underlined and red\n    </Text>{' '}\n    and this is black again. All of it is selectable with custom menu options!\n  </Text>\n</SelectableTextView>\n```\n\n## API Reference\n\n### SelectableTextView Props\n\n| Prop          | Type                              | Required | Description                                 |\n| ------------- | --------------------------------- | -------- | ------------------------------------------- |\n| `children`    | `React.ReactNode`                 | Yes      | Text components to make selectable          |\n| `menuOptions` | `string[]`                        | Yes      | Array of menu option strings                |\n| `onSelection` | `(event: SelectionEvent) => void` | No       | Callback fired when menu option is selected |\n| `style`       | `ViewStyle`                       | No       | Style object for the container              |\n\n### SelectionEvent\n\nThe `onSelection` callback receives an event object with:\n\n```typescript\ninterface SelectionEvent {\n  chosenOption: string; // The menu option that was selected\n  highlightedText: string; // The text that was highlighted by the user\n}\n```\n\n## Requirements\n\n- React Native 0.81.1+\n- iOS 11.0+\n- Android API level 21+\n- React Native's new architecture (Fabric) enabled\n\n## Platform Differences\n\nThe library handles platform differences internally:\n\n- **iOS**: Uses direct event handlers for optimal performance\n- **Android**: Uses DeviceEventEmitter for reliable event delivery\n\nBoth platforms provide the same API and functionality.\n\n## License\n\nMIT\n\n---\n\nMade with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)\n","readmeFilename":"README.md","_rev":"1-f662e2206b0029903a18e94af7052329"}