Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

illusion615/PCF-Universal-Textbox-Fluent

Repository files navigation

PCF Universal Textbox Fluent

A PowerApps Component Framework (PCF) virtual control that renders Markdown, JSON, and HTML content using Fluent UI React v9. Designed for both Model-Driven and Canvas apps with built-in support for Mermaid diagrams, KaTeX math, syntax highlighting, and interactive JSON editing.

Features

  • Multiple Text Formats — Markdown, JSON, HTML, Rich Text, and Plain Text
  • JSON Form View — Edit JSON data through auto-generated, type-aware form controls
  • Fluent UI v9 — Native Microsoft design language, consistent with Power Platform
  • Mermaid Diagrams — Flowcharts, sequence diagrams, Gantt charts rendered inline
  • KaTeX Math — Inline and block mathematical expressions
  • Syntax Highlighting — 190+ languages via highlight.js
  • Image Modal — Click-to-zoom with keyboard navigation
  • Debug Mode — Inspect rendered HTML output for troubleshooting
  • Responsive — Adapts to container dimensions and display context
  • Accessible — ARIA labels and full keyboard support

Screenshots

View Preview
Markdown Markdown View
JSON Tree JSON View
JSON Form JSON Edit View
HTML HTML View
Canvas App Canvas App Integration
Model-Driven App Model Driven App Integration

Quick Start

Option 1: Pre-built Solution

  1. Download the latest .zip from Releases
  2. Import the managed solution into your Power Platform environment
  3. Add the control to your form or canvas app

Option 2: Build from Source

git clone https://github.com/illusion615/PCF-Universal-Textbox-Fluent.git
cd PCF-Universal-Textbox-Fluent
npm install
npm run build
npm run rebuild

Project Structure

PCF-Universal-Textbox-Fluent/
├── docs/ # Documentation
│ ├── ARCHITECTURE.md # System architecture and design
│ ├── DEVELOPMENT.md # Development guide
│ ├── DEPLOYMENT.md # Deployment and troubleshooting
│ ├── API.md # API reference
│ └── TODO.md # Roadmap and known issues
├── UniversalTextbox/ # Control source
│ ├── index.ts # PCF control class
│ ├── UniversalTextboxComponent.tsx # Main React component
│ ├── UniversalTextboxComponent.css # Styles
│ ├── Icons.tsx # Inline SVG icons
│ ├── ControlManifest.Input.xml # PCF manifest
│ ├── components/ # Shared UI components
│ │ ├── FormField.tsx # Type-aware form field
│ │ ├── NestedObject.tsx # Nested object renderer
│ │ └── ArrayTable.tsx # Array table display
│ ├── renderers/ # Content renderers
│ │ └── JsonFormRenderer.tsx # JSON Form renderer
│ └── generated/ # Auto-generated types
├── UniversalTextboxFluentSolution/ # Solution packaging
├── screenshots/ # Documentation images
├── types/ # TypeScript declarations
├── CHANGELOG.md # Version history
└── webpack.config.js # Build configuration

Configuration

Control Properties

Property Type Description Default
Text Text Bound text field Required
Text Type Enum Markdown (1), JSON (2), HTML (3) Markdown
Display Mode Enum View (1), Edit (2), View and Edit (3) View
Show Type Selector Boolean Runtime format switching false
Debug Mode Boolean Show rendered HTML source false
Height Whole.None Control height in px (MDA) 400
Font Size Text Custom font size
Background Color Text Custom background color
Line Height Text Custom line height

Markdown

  • Mermaid diagrams via fenced mermaid code blocks
  • LaTeX math: $...$ inline, $$...$$ block
  • Syntax-highlighted code blocks (190+ languages)
  • GitHub Flavored Markdown tables
  • Embedded HTML

JSON Viewer

  • Collapsible tree with type-colored values
  • Root level expanded by default
  • Array item counts and indexed navigation
  • Graceful error display for malformed JSON

JSON Form View

  • Auto-generated controls: text inputs, spin buttons, checkboxes, date pickers
  • Collapsible nested objects with visual grouping
  • Array rendering as tables or nested views
  • Toggleable label position (left / top)

Interactive Features

  • One-click copy with visual feedback (checkmark / dismiss icon)
  • Click-to-zoom image modal with keyboard controls
  • Live editing with auto-resize textarea
  • Debug overlay for HTML inspection

Documentation

Document Description
Architecture System design, component structure, data flow
Development Setup, coding standards, contribution guide
Deployment Installation, configuration, troubleshooting
API Reference Properties, components, renderer interfaces
Roadmap Known issues and planned features

Development

Prerequisites

  • Node.js 14+
  • PowerApps CLI
  • Visual Studio Code (recommended)

Commands

npm run start # Development server
npm run start:watch # Watch mode
npm run build # Production build
npm run rebuild # Package solution
npm run lint:fix # Lint and auto-fix
npm run clean # Remove build artifacts

Deployment

Requirements

  • Power Platform environment with PCF enabled
  • System Administrator or System Customizer role
  • Attachment size limit set to 100 MB or higher (see Deployment Guide)

Steps

  1. Download the managed solution from Releases
  2. Import into your Power Platform environment
  3. Configure control properties on forms or canvas apps
  4. Verify rendering in the target environment

Note: The bundle includes Mermaid, KaTeX, and highlight.js. If import fails due to size, increase the environment attachment limit. See Deployment Guide for details.

Technology Stack

Layer Technology
Framework PowerApps Component Framework (PCF)
Frontend React 16.14.0, TypeScript 4.9.5
UI Library Fluent UI React v9.46.2
Build Webpack 5, Terser, CSS minimizer
Rendering markdown-it, Mermaid, KaTeX, highlight.js

Browser Support

Chrome 80+ / Firefox 74+ / Safari 13+ / Edge 80+

Optimization

  • Code splitting with separate vendor chunks
  • Tree shaking and dead code elimination
  • Lazy initialization for Mermaid and KaTeX
  • Minified production output

Contributing

Contributions are welcome. See the Development Guide for setup and coding standards.

  1. Fork the repository
  2. Create a feature branch
  3. Implement changes with documentation updates
  4. Submit a pull request

Roadmap

v1.4.1 (Current)

  • JSON Form View with type-aware editing
  • Runtime type selector
  • Copy button with status feedback
  • Mermaid diagrams, KaTeX math, syntax highlighting
  • Image modal with zoom
  • Collapsible JSON tree viewer
  • MDA height configuration
  • Inline SVG icons
  • CSS isolation (no style leakage)

Planned

  • Rich text editor integration
  • Custom theme support
  • Export functionality

See TODO.md for the full roadmap.

Support

License

MIT — see LICENSE for details.


About

The PCF component built with Fluent UI React v9 to display various types of text data, including markdown, Json and html.

Resources

License

Stars

Watchers

Forks

Packages

Contributors

AltStyle によって変換されたページ (->オリジナル) /