This project is a Text plugin based on Next.js and Teable, designed for displaying and managing text content within Teable, supporting complete Markdown editing and viewing functionality.
- 📝 Text viewing and editing functionality
- ⚡️ Integrated Teable plugin development environment
- 🌈 Multi-theme support (light/dark)
- 🌍 Internationalization (i18n) support (English/Chinese)
- 🪄 Easy to extend and customize
- 💾 Text storage with configurable API
- 📏 Content length validation (128KB max)
- 🎯 Horizontal alignment controls (left/center/right)
- 🔌 View, Dashboard, Panel Three Plugin Modes
- Next.js
- @teable/core
- @teable/sdk
- @teable/openapi
- @teable/ui-lib
- @teable/next-themes
- @tanstack/react-query
Before using this plugin, you have to modify the baseURL in src/hooks/useTextStorage.ts to your self host server address.
For example:
config.baseURL = 'https://your-api-server.com/api';npm installSee the configuration section above before proceeding.
npm run devVisit http://localhost:3000 to view the app.
npm run buildnpm startsrc/app/page.tsx: App entry, integrates i18n, environment, theme, etc.src/app/Main.tsx: Main business entry, integrates Teable SDK, theme, QueryClientsrc/components/TextViewer.tsx: Main text viewing componentsrc/components/TextConfig.tsx: Text configuration componentsrc/components/TextPages.tsx: Text pages managementsrc/hooks/useTextStorage.ts: Text storage hook with API configuration⚠️ Requires baseURL configurationsrc/utils/storageApi.ts: Storage API utilitiessrc/components/context/EnvProvider.tsx: Injects environment variablessrc/components/context/I18nProvider.tsx: Internationalization supportsrc/components/context/TextProvider.tsx: Text context provider
The EnvProvider component automatically reads plugin parameters (such as lang, baseId, pluginId, etc.) from the URL, no manual configuration required.
This plugin requires an external API server for text storage and retrieval. Make sure your API server:
- Is accessible from the configured baseURL
- Supports the required endpoints for text operations
- Handles CORS properly if hosted on a different domain
- The plugin uses React Query for data fetching and caching
- All text operations are handled through the storage API
- The UI is responsive and supports both light and dark themes
- Internationalization is supported with English and Chinese translations
- Content length is limited to 128KB (131,072 characters) for performance
- Real-time character count and validation feedback
- Horizontal alignment applies to text, images, and lists in markdown content
