Skip to main content

DHTMLX-free PyTincture widgetset with layout, chat, card panel, and tab widgets.

Project description

wA PyTincture Widgetset (wapyt)

wapyt is a lightweight widgetset for pyTincture that avoids the commercial DHTMLX dependency used by the legacy package. It focuses on a DOM-driven layout engine and a set of first-class widgets that can be composed entirely from Python when running inside Pyodide.

Highlights

  • Theme-aware layout: Flexbox-based layout manager that mirrors the familiar LayoutConfig/CellConfig API, supports nested rows/columns, and exposes helper methods such as attach_html, collapse, toggle, hide, etc.
  • Widgets that don’t require DHTMLX: Native Chat, CardPanel, TabWidget, Sidebar, ModalWindow, and ResourceBoard implementations with the streaming/events helpers the PyTincture samples expect.
  • MainWindow wrapper: Thin helper built on top of Layout so existing apps can continue to expose a MainWindow class with no additional boilerplate.
  • PyTincture metadata: Exposes __widgetset__ = "wapyt" so the platform can auto-discover the package name/version during ***WIDGETSET*** substitution.
  • Test/demo apps: Located under tests/ to show how to embed the widgets inside PyTincture applications.

Widget Catalog

  • Layout / MainWindow: Flexbox-driven layout primitives plus a drop-in MainWindow helper that mirrors the legacy PyTincture entrypoint.
  • Chat: Streaming chat surface with agent metadata, artifact events, and helpers for incremental responses.
  • CardPanel: Searchable, template-driven card grid with add/view/action callbacks and custom renderers.
  • TabWidget: Lightweight tab host that supports badges, closable tabs, and attaching HTML or PyTincture components per tab.
  • Sidebar: Collapsible navigation rail with badges, icons, and selection events for driving the rest of your layout.
  • ModalWindow: Simple modal shell that can host arbitrary Layout instances or HTML snippets.
  • ResourceBoard: Master/detail resource explorer with selectable rows, action hooks, and optional add button wiring.

Runtime Architecture

  • Layouts and widgets are declared in Python but render as DOM nodes through the JavaScript bundles under wapyt/assets/. Each helper (e.g., Layout.add_chat) forwards config dictionaries directly to the matching JS constructor.
  • The wapyt/_runtime.py bridge exposes require_js to lazily inject JS/CSS exactly once per interpreter and create_proxy to keep Pyodide callback proxies alive for event handlers.
  • Layout cells are plain flexbox containers (wapyt/assets/layout.js + wapyt/assets/wapyt.css), so attaching raw HTML or third-party widgets is as simple as calling layout.attach_html(cell_id, markup).
  • Because everything routes through window.wapyt, you can add new widgets by dropping a JS file into wapyt/assets/, exporting a constructor, and calling require_js("MyWidget") before instantiating it from Python.

Getting Started

cd wapyt
uv venv --python 3.13 && source .venv/bin/activate
uv pip install -e .

Then run a PyTincture example pointing at this widgetset:

cd ../pytincture
uv run pytincture launch_service --modules_folder ../wA_pytincture_widgetset/tests --port 8070

Open http://localhost:8070/layout_demo in your browser to see the native layout, and swap in chat_demo / cardpanel_demo / tabs_demo to explore the specialized widgets.

Package Layout

wapyt/
  ├── chat/        # Chat widget config + wrapper
  ├── cardpanel/   # CardPanel widget config + wrapper
  ├── layout/      # Layout/MainWindow helpers
  ├── modal/       # ModalWindow + config
  ├── resourceboard/ # ResourceBoard widget + config
  ├── sidebar/     # Sidebar widget config + wrapper
  ├── tabwidget/   # Tab widget config + wrapper
  └── assets/      # JS + CSS evaluated automatically by PyTincture

Development Notes

  • The JavaScript bundles define the window.wapyt namespace and are evaluated automatically by PyTincture’s loader (see pytincture/frontend/pytincture.js).
  • Layout styles live in assets/wapyt.css; adjust tokens there to integrate with your design system.
  • The tests are intentionally small, framework-free PyTincture apps so you can copy/paste into your own projects.

License

MIT – see pyproject.toml for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wapyt-0.1.0.tar.gz (79.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wapyt-0.1.0-py3-none-any.whl (92.8 kB view details)

Uploaded Python 3

File details

Details for the file wapyt-0.1.0.tar.gz.

File metadata

  • Download URL: wapyt-0.1.0.tar.gz
  • Upload date:
  • Size: 79.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for wapyt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 759d5d8dd524e3c9ccd88e3a869b3cc6e958a3f30509bc89a6e2ad838ce1a811
MD5 de3c50daf53a15f24b7787ad101be8ca
BLAKE2b-256 f5689ad8c85909bd514678052cc1e88cc555060823f292a229efcf051b928db8

See more details on using hashes here.

File details

Details for the file wapyt-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wapyt-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 92.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for wapyt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14e6d2d2a7b71b196174acdfcddf3ea0b509a04522e3452268e269c5d04b0c55
MD5 f6f575eecc5acef32861f2928cc1dc21
BLAKE2b-256 64f7e6a846bc10a7f6b79072de00d4f040a5d204a73d309da914555d8462d6db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page