Commit Graph

378 Commits

Author SHA1 Message Date
hypercross 4c5add2414 feat(journal): implement JournalInput with command autocomplete 2026-07-06 16:57:36 +08:00
hypercross 8284f5caee feat: add completions API and scanning logic
Implement a new completions system that scans markdown files for
dice notation and headings. The server now exposes a
`/__COMPLETIONS.json`
endpoint and automatically recomputes the completion index when
files are added, updated, or deleted.
2026-07-06 16:50:45 +08:00
hypercross 307a3c8320 refactor: extract JournalHeader from JournalPanel
Extract the header logic into a standalone `JournalHeader` component.
This new component manages the connection status display, session
dropdown for switching between sessions, and the ability to create
new sessions or disconnect.
2026-07-06 16:22:06 +08:00
hypercross 13f454de9c feat: add URL parameter syncing for session and player
Implement URL search parameter synchronization for `session` and
`player`
to allow for bookmarkable links. Added `sessionName` to the journal
stream state to support displaying human-readable session names in the
UI. Improved layout transitions and updated the JournalPanel to show
more detailed connection information.
2026-07-06 16:16:01 +08:00
hypercross 6b5fcdc051 fix(cli): use async broker creation in journal server
Use `AedesFactory.createBroker()` instead of the constructor to ensure
persistence is properly initialized before handling connections.
2026-07-06 16:01:29 +08:00
hypercross 98c4a195e8 refactor: replace websocket-stream with native ws utility
Remove the `websocket-stream` dependency in favor of
`createWebSocketStream`
from the `ws` package. This simplifies the MQTT broker setup in the
journal server and removes unnecessary transitive dependencies.

Also improve the JournalPanel UI with smoother transitions and better
visibility handling.
2026-07-06 15:53:52 +08:00
hypercross 34d647d611 feat: implement websocket-stream for journal server
Integrate `websocket-stream` to handle MQTT broker upgrades in the
CLI and add granular connection status tracking to the UI.

- Add `websocket-stream` dependency
- Update CLI to use `websocket-stream` for socket upgrades
- Enhance `journalStream` store with `connectionStatus` and
  `connectionError` states
- Add visual connection status indicators to `App` and `JournalPanel`
2026-07-06 15:38:28 +08:00
hypercross 862ba9c01b feat: simplify journal connection via WebSocket upgrade
Refactor the journal server to run over WebSockets on the existing
HTTP server instead of a separate MQTT TCP port. This removes the need
for a separate port configuration and simplifies the connection flow
by auto-connecting to the current host.

- Remove `--mqtt-port` CLI option
- Attach Aedes broker to the HTTP server via WebSocket upgrade
- Update UI to remove manual broker URL and player name inputs
- Add "Content Source" access from the sidebar
- Update JournalPanel to auto-connect to the local server
2026-07-06 15:30:21 +08:00
hypercross 53c33587fb feat(journal): implement journal UI components
Introduce a complete set of journal components including:
- JournalPanel: main container with mobile/desktop support
- ConnectionBar: MQTT connection and session management
- StreamView and StreamMessage: message log and individual message cards
- ComposePanel: message composition with type selection
- DynamicForm: recursive form generator based on Zod schemas
2026-07-06 15:06:19 +08:00
hypercross 8194438816 feat(journal): implement message registry and stream store
Implement a robust journal system featuring a type-safe message
registry and an MQTT-backed stream store.

- Add `registry.ts` to manage message type definitions, Zod schemas,
  and custom reducers.
- Implement `journalStream.ts` to manage MQTT connections, session
  lifecycle, and reactive message state.
- Add built-in message types for `narrative`, `intent`, `roll`,
  and `article`.
- Provide utilities for message validation, optimistic local updates,
  and message reversion.
2026-07-06 14:48:18 +08:00
hypercross 21f8fbcd0b feat: add MQTT journal server for session persistence
Implement a journal server that uses an Aedes MQTT broker to
persist stream messages to JSONL files and manage session metadata
via a manifest.

- Add `aedes`, `mqtt`, and `zod` dependencies
- Implement `createJournalServer` in `src/cli/journal.ts`
- Integrate journal server into the `serve` command
- Add `--mqtt-port` option to the CLI
- Add session lifecycle management (create, update, delete) via
  retained MQTT topics
2026-07-06 14:19:16 +08:00
hypercross 08389601ac style: reformat and improve CSS structure
- Add Tailwind source scanning for color utilities
- Implement icon masking support
- Reformat CSS for better readability and consistency
- Expand utility definitions into multi-line blocks
2026-07-06 13:28:01 +08:00
hyper d56e8ca23d fix(ui): Add text-black to prose elements 2026-07-03 22:11:50 +08:00
hyper 0add3f27d5 fix(layer-editor): use stable _key for drag-and-drop sorting
Add a unique `_key` to each layer config to maintain stable sortable IDs
across reorder operations. Update LayerRow to use the sortableId prop
and the `use:sortable` directive. Refactor layer-crud utilities to
generate and propagate `_key` values on creation and initialization.
2026-07-03 21:49:18 +08:00
hyper 186e3c0db6 feat(layer-editor): Stable sortable IDs, drag opacity
- Use createMemo for stable IDs to prevent re-renders
- Add opacity and transition styles during drag
- Remove "所有字段已添加" message when no available fields
2026-06-30 21:44:59 +08:00
hyper bdc06cc49a style(md-deck): Use double quotes and shrink-0 class 2026-06-30 21:35:39 +08:00
hyper b3d390dfd5 refactor(editor-panel): extract LayerRow and layer crud logic 2026-06-30 21:34:10 +08:00
hyper 42c7c9a26e feat(editor): Add dnd reordering and layer add/remove 2026-06-30 20:55:13 +08:00
hyper 9794184e98 style(file-tree): Reformat JSX and fix class name 2026-06-30 20:26:11 +08:00
hyper 53c8ce0677 feat(viewer): Add data source dialog
Introduce a dialog for switching between built-in content and a
user-selected local folder. Persist the folder handle in IndexedDB
so the selection survives page refreshes. Scan the folder for .md,
.yarn, and .csv files to build the file index.

Update App and Sidebar to pass file tree and heading data, and
add TypeScript declarations for the File System Access API.
2026-06-30 19:20:08 +08:00
hyper a05b0f4291 refactor(doc-data): Use static imports for doc entries 2026-06-30 18:54:34 +08:00
hyper d72d4e7bde feat(docs): add component documentation entries and refactor dialog
rendering
2026-06-30 18:47:14 +08:00
hyper 0886a406bb feat(doc-data): Add md-font component and update md-bg 2026-06-30 18:40:22 +08:00
hyper 548d6a0510 feat(md-font): Add color attribute 2026-06-30 18:37:46 +08:00
hyper fa57727abb feat(md-font): Add color prop support 2026-06-30 18:28:40 +08:00
hyper f337acd142 feat(md-bg): Add solid color background support 2026-06-30 18:24:38 +08:00
hyper 936ccb7433 chore(deps): add husky dev dependency
Update prepare script to use npx husky
2026-06-26 11:33:28 +08:00
hyper 1b51370ad0 feat(husky): Add post-merge hook and prepare script 2026-06-26 11:22:15 +08:00
hyper e4b980202e feat(doc): Add md-border entry and reformat existing props 2026-06-26 11:11:25 +08:00
hyper e861b80f57 feat(components): add md-border custom element 2026-06-26 11:10:06 +08:00
hyper 110451ae04 feat: Add command documentation dialog
Introduce a modal dialog that displays documentation for all available
markdown commands, accessible via a '?' button in the header.
2026-06-25 21:04:53 +08:00
hyper f734da6acd feat(viewer): Add md-embed component 2026-06-25 20:43:40 +08:00
hyper f19c7ff77c refactor(markdown): Replace `using` with try-finally 2026-06-25 20:33:08 +08:00
hyper 1a4ae417fe feat: Add multi-source font and style manager
Rename md-emfont to md-font with support for Google, emfont, and local
sources. Introduce article-style-manager.ts for centralized lifecycle
management of article-level styles and external stylesheet link
injection with reference counting. Refactor md-bg to use the new
manager, removing direct createEffect on article styles.
2026-06-25 20:26:34 +08:00
hypercross 771fe6a112 style: add mask properties to icon class 2026-06-16 16:40:44 +08:00
hyper a5021ff5b4 style: reformat PltPreview and fix SVG rendering
- Reformat code to use double quotes and consistent indentation
- Improve SVG path styling for travel paths and borders
- Fix layout nesting and indentation in the component template
- Add missing circle element to card index labels
2026-05-18 22:19:48 +08:00
hypercross 1582191655 feat: add custom YAML tag code block extension 2026-05-11 12:05:19 +08:00
hypercross a19d848456 refactor: remove words prop from md-emfont
Removes the `words` property from `EmfontProps` and simplifies the
URL construction by removing the font subsetting logic.
2026-05-11 11:56:22 +08:00
hypercross 4038d67ea0 feat: add md-emfont component and format code
- Add `md-emfont` custom element for dynamic font loading
- Register `md-emfont` in component index
- Reformat `Article.tsx` and `index.ts` using double quotes and
  consistent spacing
- Fix indentation in `index.html`
2026-05-11 11:25:57 +08:00
hypercross d4de95b465 refactor: fix layout for merged decks in PrintPreview
Update PrintPreview to correctly handle dimensions and layer
configurations when multiple decks are merged. Instead of using the
base store for all cards, it now maps each card to its specific
source store to ensure correct grid positioning and styling.
2026-05-05 16:46:10 +08:00
hypercross 4953d33f0f feat: implement multi-deck merging for print preview
Introduce a deck registry to track all active deck instances. This
allows users to select and merge multiple decks with matching
dimensions into a single print preview and export session.
2026-05-05 16:30:49 +08:00
hypercross d099cf5758 refactor: use npm yarn-spinner-loader package 2026-04-14 20:26:56 +08:00
hypercross 163aa8c783 refactor: move yarn-spinner-loader to external dependency 2026-04-14 16:35:18 +08:00
hypercross c110bb08b5 fix: label css typo 2026-04-09 12:35:54 +08:00
hypercross 348dff82f4 refactor: add pull-2, icon label, icon repeat 2026-04-09 12:31:07 +08:00
hypercross 2aaca2c56f fix: md-bg articlePath passing 2026-04-09 11:53:24 +08:00
hyper 385bcb16d8 fix: dev server not showing pngs 2026-04-08 19:56:44 +08:00
hyper afe2eb4af8 fix: cli file change detection now includes csv/yarn 2026-04-08 19:43:32 +08:00
hyper b09560a4e5 refactor: allow chinese layer names 2026-04-07 19:33:08 +08:00
hyper 4d1c40ed3e refactor: add support for non-png icons 2026-04-06 18:31:08 +08:00