Metadata-Version: 2.4
Name: bazaar-contrib-server
Version: 0.3.0rc15
Summary: The Bazaar Compute server: the shell modules put their pages in, and its themes
License-Expression: Apache-2.0
License-File: LICENSE
Requires-Dist: bazaar-core~=0.3.0rc1
Requires-Dist: bazaar-contrib-http~=0.3.0rc1
Requires-Dist: bazaar-contrib-schema~=0.3.0rc1
Requires-Dist: bazaar-contrib-storage~=0.3.0rc1
Requires-Dist: bazaar-contrib-server-database~=0.3.0rc1
Requires-Dist: bazaar-contrib-server-migrations~=0.3.0rc2
Requires-Dist: jinja2>=3.1.6
Requires-Dist: markdown-it-py>=4.2.0
Requires-Dist: markupsafe>=3.0.0
Requires-Dist: pydantic>=2.12.0
Requires-Dist: pygments>=2.20.0
Requires-Dist: python-multipart>=0.0.32
Requires-Dist: starlette>=0.48.0
Requires-Dist: tzdata>=2024.1 ; sys_platform == 'win32'
Requires-Python: >=3.15
Project-URL: Repository, https://github.com/open-bazaar/contrib-server
Description-Content-Type: text/markdown

# bazaar-contrib-server

The Bazaar Compute server itself: the shell around every module, with its sidebar, settings page and update bus, and two themes, the night market and the morning market.

```toml
[[contribs]]
package = "bazaar-contrib-server~=0.3.0rc3"
[[contribs.enabled]]
entry = "server"
[[contribs.enabled]]
entry = "server-theme-night"
[[contribs.enabled]]
entry = "server-theme-day"
```

A contrib accepts `SERVER` to serve its pages and API in the shell, and `THEME` to bring a theme. Pages answer once a login contrib such as `bazaar-contrib-server-access` is enabled.

A module with a long list can load the shared `window-list.js` asset:

```html
<script src="{{ asset('window-list.js', 'server') }}"></script>
<div data-window-list=".row">
  <!-- Direct child rows, followed by the module's usual htmx paging link. -->
</div>
```

The list keeps the loaded rows' HTML and measured heights, mounting only the
viewport and nearby rows. Its scroll container may be the list itself or a
scrolling ancestor. Give the list `overflow-anchor: none`; the component holds
the row being read when measurements change. Keep row spacing inside each row or in its vertical margins, so its measured
height includes that spacing.

The module keeps its paging URLs and triggers. Prepended and appended pages
are taken in after the htmx swap; replacing a list releases the previous measurements and observers.
The bubbling `bazaar:window` event lets the page mark its current selection when
rows are restored.

For a live message list, `data-window-follow` keeps the newest content in view
while the reader is at the bottom. Remove it while there are newer pages to
load. The page can use `element.windowList.items` for the loaded rows in order;
each item's `data` holds its row's data attributes, including message cursors.
`windowList.rows` maps those items to their currently mounted elements.
`windowList.scrollTo(item)` centers a search hit and holds it as images load,
until the reader scrolls; `windowList.scrollTo(item, "end")` returns to the
newest content. The `bazaar:window` event also lets a message list update date
headings from adjacent loaded items when rows are restored.
