diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index d7128d199..15865f074 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -376,7 +376,7 @@ ticketSchema.pre('save', async function () { ## @mieweb/ui Usage -**The component rules live in [`.github/instructions/mieweb-ui.instructions.md`](instructions/mieweb-ui.instructions.md)**, generated by `npx @mieweb/ui@0.10.0 init-agent` and applied automatically to `**/*.{ts,tsx,js,jsx}`. The same rules are mirrored into the `AGENTS.md` managed block for tools that read that convention. +**The component rules live in [`.github/instructions/mieweb-ui.instructions.md`](instructions/mieweb-ui.instructions.md)**, generated by `npx @mieweb/ui@0.11.0 init-agent` and applied automatically to `**/*.{ts,tsx,js,jsx}`. The same rules are mirrored into the `AGENTS.md` managed block for tools that read that convention. That file is the single source of truth for component selection — it ships with the library and covers the full catalog, `ButtonGroup` usage, composition slots, variants, design tokens, and theming. Do not restate its rules here; they go stale as the library moves. @@ -384,10 +384,12 @@ That file is the single source of truth for component selection — it ships wit Pin the version in that command to whatever `@mieweb/ui` the app is on, so the rules match the installed catalog. The `init-agent` CLI does not exist before 0.8.0; `npx` fetches it without installing it. -**The 0.7.3 hold is over.** The project sat on 0.7.3 because 0.8.0+ regressed the Kerebron `RichEditor` seeding the clock composer depends on. That regression is fixed as of **0.9.0** — verified by editing an existing Huddle post and confirming the editor seeds with its content, plus a full clock in/out cycle. The app is now on 0.10.0. The `SuperChat`/`SuperChatInbox` public type surface (`node_modules/@mieweb/ui/dist/components/SuperChat/index.d.ts`) is unchanged between 0.9.0 and 0.10.0 — no new reactions, replies, composer slots, or date separators — so [`docs/superchat-inbox-gaps.md`](docs/superchat-inbox-gaps.md) still applies as written. +**The 0.7.3 hold is over.** The project sat on 0.7.3 because 0.8.0+ regressed the Kerebron `RichEditor` seeding the clock composer depends on. That regression is fixed as of **0.9.0** — verified by editing an existing Huddle post and confirming the editor seeds with its content, plus a full clock in/out cycle. The app is now on 0.11.0, synced with mieweb/ui `main`. 0.11.0 adds a media view, agent and model selectors, `showHeader`, `placeholder` and `allowAttachments` to `SuperChat`, but still no reactions, replies, preview override or date separators — so [`docs/superchat-inbox-gaps.md`](docs/superchat-inbox-gaps.md) still applies as written. **The app runs a vendored `@mieweb/ui`.** It installs `vendor/mieweb-ui.tgz`, built from the `vendor/ui` submodule — a branch of mieweb/ui where the library changes TimeHuddle needs are made as an upstream PR instead of being worked around here. Build with `npm run ui:build`, pull upstream with `npm run ui:sync`; the workflow is in [`vendor/README.md`](vendor/README.md). +**Kerebron is pinned to exactly 0.8.12 and patched.** `@mieweb/ui` 0.11.0 needs `@kerebron/*` 0.8.12 or newer and asks host apps to apply its Kerebron fixes themselves, since Kerebron is a peer dependency. They live in [`patches/`](patches/README.md) and are applied on install; that README says how to keep them in step with upstream. + **Before marking any page complete, verify: does it import from `@mieweb/ui`? If not, it's not done.** ### Code Quality Checklist diff --git a/.github/instructions/mieweb-ui.instructions.md b/.github/instructions/mieweb-ui.instructions.md index b9d1d9938..20bcaaf21 100644 --- a/.github/instructions/mieweb-ui.instructions.md +++ b/.github/instructions/mieweb-ui.instructions.md @@ -22,7 +22,8 @@ When asked to create a table, data grid, or any tabular data view: ```tsx import { DataVisNitroSource, DataVisNitroGrid } from '@mieweb/ui/datavis'; -// Peer deps: npm install @mieweb/datavis datavis-ace +// Self-contained entry: @mieweb/datavis is bundled in and datavis-ace ships as +// a dependency of @mieweb/ui — no extra installs needed to use these. ``` ## Rule 2: Buttons belong in a ButtonGroup @@ -167,7 +168,19 @@ Tailwind: on Tailwind 4, add an `@source` for `@mieweb/ui` so library classes ar If JSDoc, the console, or the docs mark something deprecated (`AGGrid` today), do not use it in new code and do not suppress the warning. Use the documented replacement. -## Rule 14: When existing components do not meet the need +## Rule 14: A component that renders a collection takes it through props + +Anything that displays a list, board, calendar, timeline or inbox of records the caller owns is a **headless module**. It receives `items` / `loading` / `error` as props, hands changes back through `on*` callbacks typed `void | Promise`, and navigates through `onOpen(id)` / `getHref(id)`. + +Never fetch, subscribe, read a store, or import a router or app framework inside such a component — `meteor/*`, `next/*`, `react-router*`, `@tanstack/react-query` and `@fortawesome/*` are blocked by ESLint. Make it generic over the item type with accessor props (`getId`, `getStatus`, `getStart`, …), put domain rendering in `render*` slots, return a token _name_ for colour (never a class string), and make every user-facing string overridable through `labels`. + +Declare it with `parameters.catalog.collection: true`; `pnpm catalog:check` then requires an **Empty**, **Loading** and **Error** story. Full contract: +[component-policy → Tier 2.5](https://github.com/mieweb/ui/blob/main/lessons/component-policy.md#tier-25-headless-modules). + +Wiring one to an app's data layer — accessors, awaited mutations, `onOpen` plus `getHref`, where filter state lives: +[wiring-headless-modules.md](https://github.com/mieweb/ui/blob/main/lessons/wiring-headless-modules.md). + +## Rule 15: When existing components do not meet the need Before creating or materially extending a reusable component, read the [upstream contribution guide](https://github.com/mieweb/ui/blob/main/CONTRIBUTING.md) @@ -185,3 +198,82 @@ abstraction solely to make it contributable. Follow the repository's permissions and approval requirements for commits, pushes, and PR creation. Do not treat these instructions as authorization to publish changes. + +## Rule 16: Embedding the Ozwell assistant that acts on the page + +Two different things share the "Ozwell" name — pick deliberately: + +- **`OzwellChat` / `AIChat` (this library)** — the _chat UI shell_. You own the + transport and render messages you already have. Use it when the assistant is + part of your own product and you wire the answers yourself (see the + [Chat family](https://ui.mieweb.org/?path=/docs/modules-chat-overview--docs) + and the [Ozwell backend guide](https://github.com/mieweb/ui/blob/main/src/components/AI/OZWELL-BACKEND.md)). +- **The embedded Ozwell assistant (`@ozwell/react`, from ozwellai-api)** — a + drop-in, page-aware assistant that can **read and act on your page** through + tool calls. Use this when the user says things like "add Ozwell" or "let + Ozwell click / read / fill something on the page." + +To add the page-aware assistant to a `@mieweb/ui` app: + +- Install `@ozwell/react` alongside `@mieweb/ui`. +- Render `OzwellChat` from `@ozwell/react` and declare one tool in `tools` for + each page action the user wants Ozwell to perform (click, read, fill, …). +- Authenticate with a **site-approved agent key** (`agnt_key-…`) via + `VITE_OZWELL_AGENT_KEY`. Vite inlines every `VITE_*` value into the browser + bundle — this is **not** secret storage, so never expose a parent (`ozw_…`), + admin, or model-provider key this way; use a server-side integration when a + credential must stay private. +- Handle each call in `onToolCall(name, args, respond)`: perform the DOM action + and **always** `respond(...)`. Return `isError: true` for an unknown tool name + or a missing target, so the assistant never claims an action that did not happen. +- Follow the canonical guide — a full **Vite + MIE UI "Click Hello World"** + example — at . + +Example — let Ozwell fill a field on the page (adapt the tool to your app's own actions): + +```tsx +import { useState } from 'react'; +import { Input } from '@mieweb/ui'; +import { OzwellChat, type OzwellTool } from '@ozwell/react'; + +const tools: OzwellTool[] = [ + { + type: 'function', + function: { + name: 'set_note', + description: 'Write text into the Note field when the user asks.', + parameters: { + type: 'object', + properties: { text: { type: 'string', description: 'Text to put in the Note field' } }, + required: ['text'], + }, + }, + }, +]; + +export default function App() { + const [note, setNote] = useState(''); + return ( + <> + setNote(e.target.value)} /> + Note: {note} + { + if (name !== 'set_note' || typeof args.text !== 'string') { + respond({ isError: true, content: [{ type: 'text', text: 'Tool unavailable' }] }); + return; + } + setNote(args.text); + respond({ content: [{ type: 'text', text: `Note set to "${args.text}"` }] }); + }} + /> + + ); +} +``` + +Privacy: conversation content stays between the user and Ozwell and is never +relayed to the host page. The host receives only the tool calls it declares, +lifecycle/error events, and any data the user explicitly shares (opt-in). diff --git a/AGENTS.md b/AGENTS.md index 98821cea9..a34e9f3f5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -19,7 +19,8 @@ When asked to create a table, data grid, or any tabular data view: ```tsx import { DataVisNitroSource, DataVisNitroGrid } from '@mieweb/ui/datavis'; -// Peer deps: npm install @mieweb/datavis datavis-ace +// Self-contained entry: @mieweb/datavis is bundled in and datavis-ace ships as +// a dependency of @mieweb/ui — no extra installs needed to use these. ``` ## Rule 2: Buttons belong in a ButtonGroup @@ -164,7 +165,19 @@ Tailwind: on Tailwind 4, add an `@source` for `@mieweb/ui` so library classes ar If JSDoc, the console, or the docs mark something deprecated (`AGGrid` today), do not use it in new code and do not suppress the warning. Use the documented replacement. -## Rule 14: When existing components do not meet the need +## Rule 14: A component that renders a collection takes it through props + +Anything that displays a list, board, calendar, timeline or inbox of records the caller owns is a **headless module**. It receives `items` / `loading` / `error` as props, hands changes back through `on*` callbacks typed `void | Promise`, and navigates through `onOpen(id)` / `getHref(id)`. + +Never fetch, subscribe, read a store, or import a router or app framework inside such a component — `meteor/*`, `next/*`, `react-router*`, `@tanstack/react-query` and `@fortawesome/*` are blocked by ESLint. Make it generic over the item type with accessor props (`getId`, `getStatus`, `getStart`, …), put domain rendering in `render*` slots, return a token _name_ for colour (never a class string), and make every user-facing string overridable through `labels`. + +Declare it with `parameters.catalog.collection: true`; `pnpm catalog:check` then requires an **Empty**, **Loading** and **Error** story. Full contract: +[component-policy → Tier 2.5](https://github.com/mieweb/ui/blob/main/lessons/component-policy.md#tier-25-headless-modules). + +Wiring one to an app's data layer — accessors, awaited mutations, `onOpen` plus `getHref`, where filter state lives: +[wiring-headless-modules.md](https://github.com/mieweb/ui/blob/main/lessons/wiring-headless-modules.md). + +## Rule 15: When existing components do not meet the need Before creating or materially extending a reusable component, read the [upstream contribution guide](https://github.com/mieweb/ui/blob/main/CONTRIBUTING.md) @@ -182,4 +195,83 @@ abstraction solely to make it contributable. Follow the repository's permissions and approval requirements for commits, pushes, and PR creation. Do not treat these instructions as authorization to publish changes. + +## Rule 16: Embedding the Ozwell assistant that acts on the page + +Two different things share the "Ozwell" name — pick deliberately: + +- **`OzwellChat` / `AIChat` (this library)** — the _chat UI shell_. You own the + transport and render messages you already have. Use it when the assistant is + part of your own product and you wire the answers yourself (see the + [Chat family](https://ui.mieweb.org/?path=/docs/modules-chat-overview--docs) + and the [Ozwell backend guide](https://github.com/mieweb/ui/blob/main/src/components/AI/OZWELL-BACKEND.md)). +- **The embedded Ozwell assistant (`@ozwell/react`, from ozwellai-api)** — a + drop-in, page-aware assistant that can **read and act on your page** through + tool calls. Use this when the user says things like "add Ozwell" or "let + Ozwell click / read / fill something on the page." + +To add the page-aware assistant to a `@mieweb/ui` app: + +- Install `@ozwell/react` alongside `@mieweb/ui`. +- Render `OzwellChat` from `@ozwell/react` and declare one tool in `tools` for + each page action the user wants Ozwell to perform (click, read, fill, …). +- Authenticate with a **site-approved agent key** (`agnt_key-…`) via + `VITE_OZWELL_AGENT_KEY`. Vite inlines every `VITE_*` value into the browser + bundle — this is **not** secret storage, so never expose a parent (`ozw_…`), + admin, or model-provider key this way; use a server-side integration when a + credential must stay private. +- Handle each call in `onToolCall(name, args, respond)`: perform the DOM action + and **always** `respond(...)`. Return `isError: true` for an unknown tool name + or a missing target, so the assistant never claims an action that did not happen. +- Follow the canonical guide — a full **Vite + MIE UI "Click Hello World"** + example — at . + +Example — let Ozwell fill a field on the page (adapt the tool to your app's own actions): + +```tsx +import { useState } from 'react'; +import { Input } from '@mieweb/ui'; +import { OzwellChat, type OzwellTool } from '@ozwell/react'; + +const tools: OzwellTool[] = [ + { + type: 'function', + function: { + name: 'set_note', + description: 'Write text into the Note field when the user asks.', + parameters: { + type: 'object', + properties: { text: { type: 'string', description: 'Text to put in the Note field' } }, + required: ['text'], + }, + }, + }, +]; + +export default function App() { + const [note, setNote] = useState(''); + return ( + <> + setNote(e.target.value)} /> + Note: {note} + { + if (name !== 'set_note' || typeof args.text !== 'string') { + respond({ isError: true, content: [{ type: 'text', text: 'Tool unavailable' }] }); + return; + } + setNote(args.text); + respond({ content: [{ type: 'text', text: `Note set to "${args.text}"` }] }); + }} + /> + + ); +} +``` + +Privacy: conversation content stays between the user and Ozwell and is never +relayed to the host page. The host receives only the tool calls it declares, +lifecycle/error events, and any data the user explicitly shares (opt-in). diff --git a/Dockerfile b/Dockerfile index 0ddc2b06c..1506ee1b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,6 +40,10 @@ COPY scripts ./scripts # the file: dependency; the submodule itself isn't needed here. COPY vendor/mieweb-ui.tgz ./vendor/mieweb-ui.tgz +# Kerebron fixes the RichEditor needs, applied by the postinstall step +# (scripts/apply-patches.cjs) — see patches/README.md. +COPY patches ./patches + # Install all dependencies (dev included — needed for Vite build + Meteor). RUN npm install RUN cd meteor-backend && npm install diff --git a/package-lock.json b/package-lock.json index f15aeaba5..02d9e06fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,13 @@ { "name": "timehuddle", - "version": "1.0.6", + "version": "1.0.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "timehuddle", - "version": "1.0.6", + "version": "1.0.7", + "hasInstallScript": true, "workspaces": [ "packages/*" ], @@ -32,11 +33,11 @@ "@fortawesome/free-regular-svg-icons": "^7.3.1", "@fortawesome/free-solid-svg-icons": "^7.3.1", "@fortawesome/react-fontawesome": "^3.5.0", - "@kerebron/editor": "^0.8.9", - "@kerebron/editor-kits": "^0.8.9", - "@kerebron/extension-basic-editor": "^0.8.9", - "@kerebron/extension-yjs": "^0.8.9", - "@kerebron/wasm": "^0.8.6", + "@kerebron/editor": "0.8.12", + "@kerebron/editor-kits": "0.8.12", + "@kerebron/extension-basic-editor": "0.8.12", + "@kerebron/extension-yjs": "0.8.12", + "@kerebron/wasm": "0.8.12", "@mieweb/datavis": "^1.5.0", "@mieweb/pulsevault": "0.5.0", "@mieweb/ui": "file:vendor/mieweb-ui.tgz", @@ -103,6 +104,7 @@ "jsdom": "^29.1.0", "lint-staged": "^15.2.10", "mongodb": "^7.5.0", + "patch-package": "^8.0.1", "postcss": "^8.5.26", "postcss-cli": "^11.0.1", "postcss-loader": "^8.2.1", @@ -2513,9 +2515,9 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { @@ -2529,12 +2531,12 @@ } }, "node_modules/@kerebron/editor": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@kerebron/editor/-/editor-0.8.9.tgz", - "integrity": "sha512-hQyrKAjyFW8RF7Khfe12LApSvLTfISyg4m0jI11SPSHXJgPe/nNQGD4KoBDkS7d2M+ng72X+FxHLNmVWZtAjEA==", + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@kerebron/editor/-/editor-0.8.12.tgz", + "integrity": "sha512-MJ7DKNsHRkB4NSZw8DhdhxkUah4RAOGxNAyYoBl3katZhE2h6dUoUB+CRnU3diVNL1xqrzgyatbQc3OI7mgBFg==", "license": "MIT", "dependencies": { - "@kerebron/workspace": "0.8.9", + "@kerebron/workspace": "0.8.12", "prosemirror-model": "1.25.9", "prosemirror-state": "1.4.3", "prosemirror-transform": "1.10.4", @@ -2542,140 +2544,123 @@ } }, "node_modules/@kerebron/editor-kits": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@kerebron/editor-kits/-/editor-kits-0.8.9.tgz", - "integrity": "sha512-xCTRYeQkBjfkPSPvQc1fxV6rPwc0JwE/3x8/Q1Eb/wrHWtdcRollt0u0BMi7m0YvMZhP7b01FvZPMQAkZQ0Tcw==", - "license": "MIT", - "dependencies": { - "@kerebron/editor": "0.8.9", - "@kerebron/extension-basic-editor": "0.8.9", - "@kerebron/extension-codecrock": "0.8.9", - "@kerebron/extension-dev-toolkit": "0.8.9", - "@kerebron/extension-markdown": "0.8.9", - "@kerebron/extension-menu": "0.8.9", - "@kerebron/extension-menu-legacy": "0.8.9", - "@kerebron/extension-odt": "0.8.9", - "@kerebron/extension-tables": "0.8.9", - "@kerebron/extension-ui": "0.8.9" - } - }, - "node_modules/@kerebron/editor/node_modules/@kerebron/workspace": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@kerebron/workspace/-/workspace-0.8.9.tgz", - "integrity": "sha512-BPa9pmxZcSg0bqPY1oeG2SBxN8OV97rrHqJPhV7+1gMjvlDtdlDFui7ZwocLwVaVQw7KU5YgdQDkRSa2AFeSuQ==", - "license": "MIT" + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@kerebron/editor-kits/-/editor-kits-0.8.12.tgz", + "integrity": "sha512-1Khn/IInsBiLOH/bHaLOWkKYH76GTBburkGboxozVag2Y3sB/aLEido7QPQ49ipw2tdvDeogLMqQyZBMWS8ijA==", + "license": "MIT", + "dependencies": { + "@kerebron/editor": "0.8.12", + "@kerebron/extension-basic-editor": "0.8.12", + "@kerebron/extension-codecrock": "0.8.12", + "@kerebron/extension-dev-toolkit": "0.8.12", + "@kerebron/extension-markdown": "0.8.12", + "@kerebron/extension-menu": "0.8.12", + "@kerebron/extension-menu-legacy": "0.8.12", + "@kerebron/extension-odt": "0.8.12", + "@kerebron/extension-tables": "0.8.12", + "@kerebron/extension-ui": "0.8.12" + } }, "node_modules/@kerebron/extension-basic-editor": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@kerebron/extension-basic-editor/-/extension-basic-editor-0.8.9.tgz", - "integrity": "sha512-pGBEJkdSWCSibtFARNRd9wKH6sSDanJvcSPDwlgj53yBmzKjCLurnK9YhVhVMD/MzJxC8id0RI8oP3U22Mc2wQ==", + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@kerebron/extension-basic-editor/-/extension-basic-editor-0.8.12.tgz", + "integrity": "sha512-3TigCyAyhaXc+CeBG4oh7JW9hgCHNlnHdun0Cvwo1YkguJtpX0VWBGW4jVDc5jih9Mr6hhTVsxUe7mzd54Lo4g==", "license": "MIT", "dependencies": { - "@kerebron/editor": "0.8.9", + "@kerebron/editor": "0.8.12", "prosemirror-model": "1.25.9", "prosemirror-state": "1.4.3", "prosemirror-transform": "1.10.4", - "prosemirror-view": "1.40.0" + "prosemirror-view": "1.40.0", + "temml": "0.13.4" } }, "node_modules/@kerebron/extension-codecrock": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@kerebron/extension-codecrock/-/extension-codecrock-0.8.9.tgz", - "integrity": "sha512-l4AW621JzCCUcBd7S98gOiTSyaIbxEoH4Scv2yEyq2HBxaxO9kspZfnm65isnm1Q1mJEhEtYZ3xer48SHj02qw==", + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@kerebron/extension-codecrock/-/extension-codecrock-0.8.12.tgz", + "integrity": "sha512-rIOXPDt0ZJZTGg1AX+pU1/7qv8NSXBqARxIMxl1JiB3O1TXXE9ZfBmKCJ66xpB7wDiA+epKFVlKLV0tPACccRA==", "license": "MIT", "dependencies": { - "@kerebron/editor": "0.8.9", - "@kerebron/extension-basic-editor": "0.8.9", - "@kerebron/tree-sitter": "0.8.9", - "@kerebron/wasm": "0.8.9", - "@kerebron/workspace": "0.8.9", + "@kerebron/editor": "0.8.12", + "@kerebron/extension-basic-editor": "0.8.12", + "@kerebron/tree-sitter": "0.8.12", + "@kerebron/wasm": "0.8.12", + "@kerebron/workspace": "0.8.12", "prosemirror-model": "1.25.9", "prosemirror-state": "1.4.3", "prosemirror-view": "1.40.0" } }, - "node_modules/@kerebron/extension-codecrock/node_modules/@kerebron/workspace": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@kerebron/workspace/-/workspace-0.8.9.tgz", - "integrity": "sha512-BPa9pmxZcSg0bqPY1oeG2SBxN8OV97rrHqJPhV7+1gMjvlDtdlDFui7ZwocLwVaVQw7KU5YgdQDkRSa2AFeSuQ==", - "license": "MIT" - }, "node_modules/@kerebron/extension-dev-toolkit": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@kerebron/extension-dev-toolkit/-/extension-dev-toolkit-0.8.9.tgz", - "integrity": "sha512-XRpnS7t/3NyYKFXl2jy9OYiWhbGAje7V1xPsnKYm03sLZNw9dvkvcyE1Pv3ZHUsB/zxhiNY3SstPOo4+cr3VOg==", + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@kerebron/extension-dev-toolkit/-/extension-dev-toolkit-0.8.12.tgz", + "integrity": "sha512-T65yU9pkyHGV3UFwuY6w8dysYIB6mI1nDwjFfCCmyHaRBy9CXqh7k3UCXsJFaAErRhlRo1nKpj/Kup7gX8v0ew==", "license": "MIT", "dependencies": { - "@kerebron/editor": "0.8.9", + "@kerebron/editor": "0.8.12", "prosemirror-dev-toolkit": "1.1.8", "prosemirror-view": "1.40.0" } }, "node_modules/@kerebron/extension-markdown": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@kerebron/extension-markdown/-/extension-markdown-0.8.9.tgz", - "integrity": "sha512-1/Wx9rXKA4nXTsLW51UaOLywFzUEQa+coNsRJjcqaogF6o0toZwKSl/eE7/2enSz2arojGWJqDcrmjAimxVAvg==", + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@kerebron/extension-markdown/-/extension-markdown-0.8.12.tgz", + "integrity": "sha512-XmzXGHKcr/ASqqY6TLWX/pDlIwtQ/iKjUZg4Z6cX3za8/VRjV/77OKGooFpvInHUiXq42dJ1JNpoW39sAzTnWg==", "license": "MIT", "dependencies": { - "@kerebron/editor": "0.8.9", - "@kerebron/extension-basic-editor": "0.8.9", - "@kerebron/tree-sitter": "0.8.9", - "@kerebron/wasm": "0.8.9", - "@kerebron/workspace": "0.8.9", + "@kerebron/editor": "0.8.12", + "@kerebron/extension-basic-editor": "0.8.12", + "@kerebron/tree-sitter": "0.8.12", + "@kerebron/wasm": "0.8.12", + "@kerebron/workspace": "0.8.12", "mathml2latex": "1.1.3", "prosemirror-model": "1.25.9", "prosemirror-state": "1.4.3" } }, - "node_modules/@kerebron/extension-markdown/node_modules/@kerebron/workspace": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@kerebron/workspace/-/workspace-0.8.9.tgz", - "integrity": "sha512-BPa9pmxZcSg0bqPY1oeG2SBxN8OV97rrHqJPhV7+1gMjvlDtdlDFui7ZwocLwVaVQw7KU5YgdQDkRSa2AFeSuQ==", - "license": "MIT" - }, "node_modules/@kerebron/extension-menu": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@kerebron/extension-menu/-/extension-menu-0.8.9.tgz", - "integrity": "sha512-FJNMRbv8dCQPYjJUrkSoPokshNvzO8QwFbZYQnT+ul3fXeupbQYFugBmK1Em8rWjlUNC22aDh3gHcRsApqEm7w==", + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@kerebron/extension-menu/-/extension-menu-0.8.12.tgz", + "integrity": "sha512-EyNccG/am/P/cqEdJM322HRDK1vfLBMw0JBY8gyMPmgHZYOF8rbNRUTX+YGsDOcK4LsMjcFR5+p1gwVuXOrc1Q==", "license": "MIT", "dependencies": { - "@kerebron/editor": "0.8.9", + "@kerebron/editor": "0.8.12", "prosemirror-model": "1.25.9", "prosemirror-state": "1.4.3", "prosemirror-view": "1.40.0" } }, "node_modules/@kerebron/extension-menu-legacy": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@kerebron/extension-menu-legacy/-/extension-menu-legacy-0.8.9.tgz", - "integrity": "sha512-xEt3fjtXmh6zrRJvoukh1XWa8n7aoh1JrKXH2Js3ebWEsZoWo/vHCzNs6EfaIC/K2F6DOcrZVOcx5R7Z0zuCPg==", + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@kerebron/extension-menu-legacy/-/extension-menu-legacy-0.8.12.tgz", + "integrity": "sha512-SILHrLV2dy31VmkzHtfszxOY2fkj7WLx1hnAb8T2sDx1BNO6yzos0PjT1FSIa9D2HgjIGun+KVBvMArjC0B3IA==", "license": "MIT", "dependencies": { - "@kerebron/editor": "0.8.9", + "@kerebron/editor": "0.8.12", "prosemirror-model": "1.25.9", "prosemirror-state": "1.4.3", "prosemirror-view": "1.40.0" } }, "node_modules/@kerebron/extension-odt": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@kerebron/extension-odt/-/extension-odt-0.8.9.tgz", - "integrity": "sha512-sjmHlMzrBwgSQufHUSbe/1NmDIAr6Z0xjQnTBV552ezPidI5sp78rneKKjY70DUzlBjPkYxB31cdSEKl1CsIOw==", + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@kerebron/extension-odt/-/extension-odt-0.8.12.tgz", + "integrity": "sha512-6+ToOubvjDjj2+/IS2MF06I1/fHbdcwybR0jtHfPJX/DXcHi6J5pHosh9JO9DHst7wBph03ACT56WhJ17SVnVA==", "license": "MIT", "dependencies": { - "@kerebron/editor": "0.8.9", - "@kerebron/odt-wasm": "0.8.9", + "@kerebron/editor": "0.8.12", + "@kerebron/odt-wasm": "0.8.12", "prosemirror-model": "1.25.9", "prosemirror-state": "1.4.3" } }, "node_modules/@kerebron/extension-tables": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@kerebron/extension-tables/-/extension-tables-0.8.9.tgz", - "integrity": "sha512-gU57VFLxADskuDUrZI/TVptvhUzVbBMku6NIBe8dFDn5+IZMHqNXDYZkxuVx1G7ff1Fzi6PqMeL3cJa2Vp0ayA==", + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@kerebron/extension-tables/-/extension-tables-0.8.12.tgz", + "integrity": "sha512-WX7eo14hGUEx66fA6mi0xDAOE89Cv+VbotB/KwCY7w5JogAn/AEVriRJ8YsZNbgKJS2JjXNHD/Kmfbqx7Kq/YQ==", "license": "MIT", "dependencies": { - "@kerebron/editor": "0.8.9", + "@kerebron/editor": "0.8.12", "prosemirror-model": "1.25.9", "prosemirror-state": "1.4.3", "prosemirror-transform": "1.10.4", @@ -2683,25 +2668,25 @@ } }, "node_modules/@kerebron/extension-ui": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@kerebron/extension-ui/-/extension-ui-0.8.9.tgz", - "integrity": "sha512-6hBIaQUb3OKBT1Ikywf6VjGriiVt5QlcdbCPf0a7SkAqWrPkXGS//v5Xq9XbbCnVAt40RIHVONyQLCjF9DWmIQ==", + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@kerebron/extension-ui/-/extension-ui-0.8.12.tgz", + "integrity": "sha512-jMS+GOc+3RiWxMIkTZQr4Pun0r3+6jlcKOyc70AY0W/7wNBQRzcT054rugyafTlWUH5/CaaBYgsOCvtqbA0edQ==", "license": "MIT", "dependencies": { - "@kerebron/editor": "0.8.9", + "@kerebron/editor": "0.8.12", "prosemirror-model": "1.25.9", "prosemirror-state": "1.4.3", "prosemirror-view": "1.40.0" } }, "node_modules/@kerebron/extension-yjs": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@kerebron/extension-yjs/-/extension-yjs-0.8.9.tgz", - "integrity": "sha512-qnCEbudXaE8IQLXFKxv4R/1oUYupBRU64Vb1rc5Mu8ameOfviYt7dRlHwMh7VA2e2EX2kz11VZxGL6xGltpnQQ==", + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@kerebron/extension-yjs/-/extension-yjs-0.8.12.tgz", + "integrity": "sha512-OPRLejzKbzSk0rSeq0xYfKgRKPqVFdmwJ06yhKVPfjM2OSM0d5Jb9yx1DV4b3ciBOaijWuQ3NmUb/HMnIR/WKg==", "license": "MIT", "dependencies": { - "@kerebron/editor": "0.8.9", - "@kerebron/extension-basic-editor": "0.8.9", + "@kerebron/editor": "0.8.12", + "@kerebron/extension-basic-editor": "0.8.12", "lib0": "0.2.109", "prosemirror-model": "1.25.9", "prosemirror-state": "1.4.3", @@ -2731,29 +2716,35 @@ } }, "node_modules/@kerebron/odt-wasm": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@kerebron/odt-wasm/-/odt-wasm-0.8.9.tgz", - "integrity": "sha512-S5Krh+W4cmENneQ78MlkfRtYRi4RElJzjEuFKBu4ki0r6mWH4JU0KLO7hiPPdauHGTJb4HaEDKNG3NcBwqtZGw==", + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@kerebron/odt-wasm/-/odt-wasm-0.8.12.tgz", + "integrity": "sha512-28di15TdQvO1TWh9ooLNZw6VFtKHjKLylNGdoDJ/h5UpWmRHP+7RBTjadwncpcAgfMgGn0w0t7i5usx1LYVpKQ==", "license": "MIT" }, "node_modules/@kerebron/tree-sitter": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@kerebron/tree-sitter/-/tree-sitter-0.8.9.tgz", - "integrity": "sha512-ECeKvf+mIn1wq5JYrPovKqRUfppRXlM7uveKF/PXZbyR/lZRhIQP42yallcFIV5z+jIBmydcsZo/sqddaJOsVw==", + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@kerebron/tree-sitter/-/tree-sitter-0.8.12.tgz", + "integrity": "sha512-5z00zgr/mncW7vBh8SA+nmcaHBe7KSM1LBCvhbG21H5bA8mRb26tlxYoA8TK4jyg1EvDkkfRqzffZFTbZ8t9ag==", "license": "MIT", "dependencies": { - "web-tree-sitter": "0.26.11" + "web-tree-sitter": "0.26.12" } }, "node_modules/@kerebron/wasm": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@kerebron/wasm/-/wasm-0.8.9.tgz", - "integrity": "sha512-XzcDL9mHeD8oKla6G2+SDbZHv3qK76oF3jNgUe3czFG6J24MqWB5zfv1ty19ZA1MirxTxpfUdjnmTiMH6ToPew==", + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@kerebron/wasm/-/wasm-0.8.12.tgz", + "integrity": "sha512-NzPSwsvjxfMnpJvtnCm4TbIo2Y9fFN31XOq+VapH/UJKU+T9CGmRkRIJh7Dstxf2Nm9znifU7fAtyO9tN0RgeQ==", "license": "MIT", "dependencies": { - "@kerebron/editor": "0.8.9" + "@kerebron/editor": "0.8.12" } }, + "node_modules/@kerebron/workspace": { + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@kerebron/workspace/-/workspace-0.8.12.tgz", + "integrity": "sha512-mooXztxVBVz/jUjgY9RWe3lfDrfm/2n05FR4x1gfo0I3gp2jw/aM2EvairxAsiUkNPG+u/YVwlN/TBZRCg+TiQ==", + "license": "MIT" + }, "node_modules/@lezer/common": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.1.tgz", @@ -2975,9 +2966,9 @@ } }, "node_modules/@mieweb/ui": { - "version": "0.10.0", + "version": "0.11.0", "resolved": "file:vendor/mieweb-ui.tgz", - "integrity": "sha512-OXPGsFaD567NZQjzmuCgDde/eKGzh269s9zYUN7N4tItB13d6XX4JGSqQzzpS/dU9w/2gt4T/hrakOHqjmmmTA==", + "integrity": "sha512-nZj+hJ1Ht80cbbBqCB9/ip6GmmcBkiuYaB+o2Wr6VSzeMYJ6v8IIIHL/tkhP7RTQI7VqrIbyuQ7dBE8z5ismNw==", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE", "dependencies": { @@ -3005,16 +2996,19 @@ "node": "^20.19.0 || >=22.12.0" }, "peerDependencies": { - "@kerebron/editor": ">=0.8.6", - "@kerebron/editor-kits": ">=0.8.6", - "@kerebron/extension-basic-editor": ">=0.8.6", - "@kerebron/extension-yjs": ">=0.8.6", - "@kerebron/wasm": ">=0.8.6", + "@kerebron/editor": ">=0.8.12", + "@kerebron/editor-kits": ">=0.8.12", + "@kerebron/extension-basic-editor": ">=0.8.12", + "@kerebron/extension-yjs": ">=0.8.12", + "@kerebron/wasm": ">=0.8.12", "@mieweb/q": "1.0.0", + "@xyflow/react": ">=12.0.0", "ag-grid-community": ">=32.0.0", "ag-grid-react": ">=32.0.0", + "elkjs": ">=0.9.0", "js-yaml": ">=4.0.0", "katex": ">=0.16.0", + "leaflet": ">=1.9.0", "mermaid": ">=11.0.0", "motion": ">=12.0.0", "papaparse": ">=5.0.0", @@ -3051,18 +3045,27 @@ "@mieweb/q": { "optional": true }, + "@xyflow/react": { + "optional": true + }, "ag-grid-community": { "optional": true }, "ag-grid-react": { "optional": true }, + "elkjs": { + "optional": true + }, "js-yaml": { "optional": true }, "katex": { "optional": true }, + "leaflet": { + "optional": true + }, "mermaid": { "optional": true }, @@ -4208,9 +4211,9 @@ "license": "MIT" }, "node_modules/@sveltejs/acorn-typescript": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.11.tgz", - "integrity": "sha512-LFuZUkjJ9iF7JZye/aG5XM0SFcQ5VyL0oVX4WJ9dc0Va3R3s0OauX1BESVCb+YN/ol8TAfqGDDAQsTG627Y5kw==", + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.13.tgz", + "integrity": "sha512-wgKggnhZVL9Bfx1OaKKTrYY9BFRk6C8UAkQNUcIv1+llzYrIqy+RZm5HPKzn0NpEBvTVhTqB4kQyllZywsRBRQ==", "license": "MIT", "peer": true, "peerDependencies": { @@ -5741,7 +5744,8 @@ "version": "2.0.7", "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", - "license": "MIT" + "license": "MIT", + "optional": true }, "node_modules/@types/tus-js-client": { "version": "1.8.0", @@ -6177,6 +6181,13 @@ "node": ">=14.6" } }, + "node_modules/@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "dev": true, + "license": "BSD-2-Clause" + }, "node_modules/@zeit/schemas": { "version": "2.36.0", "resolved": "https://registry.npmjs.org/@zeit/schemas/-/schemas-2.36.0.tgz", @@ -6191,9 +6202,9 @@ "peer": true }, "node_modules/acorn": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", - "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz", + "integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==", "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -7608,6 +7619,22 @@ "node": ">=18" } }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/class-variance-authority": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.1.tgz", @@ -9615,9 +9642,9 @@ } }, "node_modules/domino": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/domino/-/domino-2.1.7.tgz", - "integrity": "sha512-3rcXhx0ixJV2nj8J0tljzejTF73A35LVVdnTQu79UAqTBFEgYPMgGtykMuu/BDqaOZphATku1ddRUn/RtqUHYQ==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/domino/-/domino-2.1.8.tgz", + "integrity": "sha512-qLkTcPRkqvifAB0bweVznkWgAu2hwin8An+HbLy0bH1ZtMyJzwXiHKMhynwR1Wq4PgBvEyg2Y749j4JJnlfDKg==", "license": "BSD-2-Clause" }, "node_modules/dompurify": { @@ -10628,9 +10655,9 @@ } }, "node_modules/esrap": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/esrap/-/esrap-2.3.0.tgz", - "integrity": "sha512-GQ/7RN8uOtEfNpzZzBMTzW9JBcX42oaSVtPzdF+6cEL8pqIL094iUpr9jzYGn4O4P/1S60dJ6izyT8F4LYARng==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/esrap/-/esrap-2.4.0.tgz", + "integrity": "sha512-CQPcneEHw/czj32uwQC52nYnax8H4SXt25FCM+LIwGZ49cMIxpOj3bP8wmzcI+Z0HIy5KkClaPhRLfCySzwHPA==", "license": "MIT", "peer": true, "dependencies": { @@ -11078,6 +11105,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/find-yarn-workspace-root": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", + "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "micromatch": "^4.0.2" + } + }, "node_modules/flat-cache": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", @@ -13304,6 +13341,26 @@ "dev": true, "license": "MIT" }, + "node_modules/json-stable-stringify": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.3.0.tgz", + "integrity": "sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "isarray": "^2.0.5", + "jsonify": "^0.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", @@ -13344,6 +13401,16 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jsonify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", + "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", + "dev": true, + "license": "Public Domain", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", @@ -13437,6 +13504,16 @@ "node": ">=0.10.0" } }, + "node_modules/klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.11" + } + }, "node_modules/kleur": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", @@ -16583,6 +16660,78 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/patch-package": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.1.tgz", + "integrity": "sha512-VsKRIA8f5uqHQ7NGhwIna6Bx6D9s/1iXlA1hthBVBEbkq+t4kXD0HHt+rJhf/Z+Ci0F/HCB2hvn0qLdLG+Qxlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@yarnpkg/lockfile": "^1.1.0", + "chalk": "^4.1.2", + "ci-info": "^3.7.0", + "cross-spawn": "^7.0.3", + "find-yarn-workspace-root": "^2.0.0", + "fs-extra": "^10.0.0", + "json-stable-stringify": "^1.0.2", + "klaw-sync": "^6.0.0", + "minimist": "^1.2.6", + "open": "^7.4.2", + "semver": "^7.5.3", + "slash": "^2.0.0", + "tmp": "^0.2.4", + "yaml": "^2.2.2" + }, + "bin": { + "patch-package": "index.js" + }, + "engines": { + "node": ">=14", + "npm": ">5" + } + }, + "node_modules/patch-package/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/patch-package/node_modules/open": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/patch-package/node_modules/slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/path-data-parser": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/path-data-parser/-/path-data-parser-0.1.0.tgz", @@ -20025,24 +20174,23 @@ } }, "node_modules/svelte": { - "version": "5.56.8", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.56.8.tgz", - "integrity": "sha512-PY8LOw7xP6c8IOiVqdo0sbbZVYhXRSfklOQLAUyGBKqjTX0wx/z4l/9J+PmBpmlLnxzEb1NqltxQ5/wZme/Cmg==", + "version": "5.57.2", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.57.2.tgz", + "integrity": "sha512-1YiPCAXT0Ct6g1vOMmSLa0Nsc3QRMvtDF32ihgglGVrugIuIK38RyDiFNXVDhtQ81TJjSO57NdMw6DyYLqSGDQ==", "license": "MIT", "peer": true, "dependencies": { - "@jridgewell/remapping": "^2.3.4", - "@jridgewell/sourcemap-codec": "^1.5.0", - "@sveltejs/acorn-typescript": "^1.0.10", - "@types/estree": "^1.0.5", - "@types/trusted-types": "^2.0.7", - "acorn": "^8.12.1", + "@jridgewell/remapping": "^2.3.5", + "@jridgewell/sourcemap-codec": "^1.6.0", + "@sveltejs/acorn-typescript": "^1.0.13", + "@types/estree": "^1.0.9", + "acorn": "^8.18.0", "aria-query": "5.3.1", "axobject-query": "^4.1.0", "clsx": "^2.1.1", - "devalue": "^5.8.1", + "devalue": "^5.9.2", "esm-env": "^1.2.1", - "esrap": "^2.2.12", + "esrap": "^2.3.6", "is-reference": "^3.0.3", "locate-character": "^3.0.0", "magic-string": "^0.30.11", @@ -20180,6 +20328,15 @@ "streamx": "^2.12.5" } }, + "node_modules/temml": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/temml/-/temml-0.13.4.tgz", + "integrity": "sha512-k1yolMBswx34Jw9hZn5Xh2/GBlwqlW+wiN7QaUYUMhSa1ypfti6rlCfSmCxWyooxH1G32C/Z+qVvgAsBOELZBQ==", + "license": "MIT", + "engines": { + "node": ">=18.13.0" + } + }, "node_modules/temp-dir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-3.0.0.tgz", @@ -21647,9 +21804,9 @@ } }, "node_modules/web-tree-sitter": { - "version": "0.26.11", - "resolved": "https://registry.npmjs.org/web-tree-sitter/-/web-tree-sitter-0.26.11.tgz", - "integrity": "sha512-Q5Dm3YTIXSXuH6FxX6RuzX2Qwpc4DPGiYMU87Wg5Z8OIStiQFiUex4zMDc0vBTw78EphaYJacncJghCHzbZptg==", + "version": "0.26.12", + "resolved": "https://registry.npmjs.org/web-tree-sitter/-/web-tree-sitter-0.26.12.tgz", + "integrity": "sha512-fvqTNZQBGUgUgfP0mHw+iHf9Yf6bRQrp0A3pSf2v/hSKxkT1beCoIWoLVmlPL7O6dmySfSb/t1aJoJvrgTRStw==", "license": "MIT" }, "node_modules/webidl-conversions": { @@ -22249,9 +22406,9 @@ } }, "node_modules/zimmerframe": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.4.tgz", - "integrity": "sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.5.tgz", + "integrity": "sha512-msJxIvYDYcoNL+PJsu+7qmpDWsYmAxTY+2TNYXXF0hzBzBk0BMecOqDOG/EckUoKCuKwObfbugIl8QpqHDXeFA==", "license": "MIT", "peer": true }, diff --git a/package.json b/package.json index 1bf881878..2c3f7ba3f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "timehuddle", - "version": "1.0.6", + "version": "1.0.7", "private": true, "workspaces": [ "packages/*" @@ -34,6 +34,7 @@ "test:all": "npm run test:unit && npm run test", "test:watch": "vitest", "prepare": "node scripts/prepare-husky.cjs", + "postinstall": "node scripts/apply-patches.cjs", "dev:mobile": "vite --host", "dev:ios": "bash scripts/dev-ios.sh", "local:ios": "bash scripts/local-ios.sh", @@ -68,11 +69,11 @@ "@fortawesome/free-regular-svg-icons": "^7.3.1", "@fortawesome/free-solid-svg-icons": "^7.3.1", "@fortawesome/react-fontawesome": "^3.5.0", - "@kerebron/editor": "^0.8.9", - "@kerebron/editor-kits": "^0.8.9", - "@kerebron/extension-basic-editor": "^0.8.9", - "@kerebron/extension-yjs": "^0.8.9", - "@kerebron/wasm": "^0.8.6", + "@kerebron/editor": "0.8.12", + "@kerebron/editor-kits": "0.8.12", + "@kerebron/extension-basic-editor": "0.8.12", + "@kerebron/extension-yjs": "0.8.12", + "@kerebron/wasm": "0.8.12", "@mieweb/datavis": "^1.5.0", "@mieweb/pulsevault": "0.5.0", "@mieweb/ui": "file:vendor/mieweb-ui.tgz", @@ -139,6 +140,7 @@ "jsdom": "^29.1.0", "lint-staged": "^15.2.10", "mongodb": "^7.5.0", + "patch-package": "^8.0.1", "postcss": "^8.5.26", "postcss-cli": "^11.0.1", "postcss-loader": "^8.2.1", diff --git a/patches/@kerebron+extension-codecrock+0.8.12.patch b/patches/@kerebron+extension-codecrock+0.8.12.patch new file mode 100644 index 000000000..e79ab01fb --- /dev/null +++ b/patches/@kerebron+extension-codecrock+0.8.12.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/@kerebron/extension-codecrock/esm/ui.js b/node_modules/@kerebron/extension-codecrock/esm/ui.js +index 279ba0013b41baa109e555f1e5fe9b55d5d18f7d..e4696ec90831fa811897728133c0be757ee48b64 100644 +--- a/node_modules/@kerebron/extension-codecrock/esm/ui.js ++++ b/node_modules/@kerebron/extension-codecrock/esm/ui.js +@@ -5,6 +5,8 @@ export function addLanguageDropDown(nodeView) { + const select = document.createElement('select'); + nodeView.dom.appendChild(select); + select.classList.add('codecrock-select'); ++ // Accessible name for the language picker (axe: select-name). ++ select.setAttribute('aria-label', 'Code language'); + for (const lang of [''].concat(nodeView.config.languageWhitelist || [])) { + const option = document.createElement('option'); + option.value = lang; diff --git a/patches/@kerebron+extension-markdown+0.8.12.patch b/patches/@kerebron+extension-markdown+0.8.12.patch new file mode 100644 index 000000000..2b5d9f564 --- /dev/null +++ b/patches/@kerebron+extension-markdown+0.8.12.patch @@ -0,0 +1,144 @@ +diff --git a/node_modules/@kerebron/extension-markdown/esm/pmToMdConverter.js b/node_modules/@kerebron/extension-markdown/esm/pmToMdConverter.js +index 0bd4e5e36caf3e94a9148ac20b757c68e0940894..8d3eaa9099343f2994ab8f11635fb31685d8d076 100644 +--- a/node_modules/@kerebron/extension-markdown/esm/pmToMdConverter.js ++++ b/node_modules/@kerebron/extension-markdown/esm/pmToMdConverter.js +@@ -372,6 +372,34 @@ export async function extPmToMdConverter(origDocument, config, schema, eventTarg + mixable: true, + expelEnclosingWhitespace: true, + }, ++ // mieweb/ui patch (mieweb/ui#536): serialize highlight, superscript ++ // and subscript as inline HTML so they survive the markdown ++ // round-trip; the tree-sitter parse side already maps these tags back ++ // onto the marks. ++ superscript: { ++ open: 'superscript_open', ++ close: 'superscript_close', ++ mixable: true, ++ expelEnclosingWhitespace: true, ++ }, ++ subscript: { ++ open: 'subscript_open', ++ close: 'subscript_close', ++ mixable: true, ++ expelEnclosingWhitespace: true, ++ }, ++ highlight: { ++ open: async (mark) => { ++ const token = new Token('highlight_open', 'mark', 1); ++ if (mark.attrs.color) { ++ token.attrSet('color', mark.attrs.color); ++ } ++ return token; ++ }, ++ close: 'highlight_close', ++ mixable: true, ++ expelEnclosingWhitespace: true, ++ }, + math: { + open: 'math_inline_open', + close: 'math_inline_close', +diff --git a/node_modules/@kerebron/extension-markdown/esm/token_handlers/inline_token_handlers.js b/node_modules/@kerebron/extension-markdown/esm/token_handlers/inline_token_handlers.js +index b9f690609ab8f219284d671d03f46c79899dd34d..6a910124c79eb49cbaf185405d821cd1b43abdea 100644 +--- a/node_modules/@kerebron/extension-markdown/esm/token_handlers/inline_token_handlers.js ++++ b/node_modules/@kerebron/extension-markdown/esm/token_handlers/inline_token_handlers.js +@@ -1,5 +1,15 @@ + import MathMl2LaTeX from 'mathml2latex'; + import { fixCharacters } from '../utils.js'; ++// mieweb/ui patch (mieweb/ui#536): escape values interpolated into ++// double-quoted HTML attributes so quote-bearing input cannot corrupt the ++// markup or inject attributes; entities decode back on re-parse. ++function escapeHtmlAttr(value) { ++ return String(value) ++ .replace(/&/g, '&') ++ .replace(/"/g, '"') ++ .replace(//g, '>'); ++} + export function escapeMarkdown(token, current) { + const markdownChars = [ + { char: '\\', escape: '\\\\' }, +@@ -194,6 +204,43 @@ export function getInlineTokensHandlers() { + ctx.current.log(token.markup || '~', token); + }, + ], ++ // mieweb/ui patch (mieweb/ui#536): emit highlight/superscript/ ++ // subscript as inline HTML — CommonMark has no syntax for them and ++ // the tree-sitter grammar cannot be extended, but its `html` branch ++ // maps these tags back onto the marks on parse. ++ 'superscript_open': [ ++ (token, ctx) => { ++ ctx.current.log('', token); ++ }, ++ ], ++ 'superscript_close': [ ++ (token, ctx) => { ++ ctx.current.log('', token); ++ }, ++ ], ++ 'subscript_open': [ ++ (token, ctx) => { ++ ctx.current.log('', token); ++ }, ++ ], ++ 'subscript_close': [ ++ (token, ctx) => { ++ ctx.current.log('', token); ++ }, ++ ], ++ 'highlight_open': [ ++ (token, ctx) => { ++ const color = token.attrGet('color'); ++ ctx.current.log(color && color !== 'yellow' ++ ? `` ++ : '', token); ++ }, ++ ], ++ 'highlight_close': [ ++ (token, ctx) => { ++ ctx.current.log('', token); ++ }, ++ ], + 'link_open': [ + (token, ctx) => { + ctx.stash('getInlineTokensHandlers.link_open'); +@@ -350,6 +397,40 @@ export function getHtmlInlineFormatTokensHandlers() { + ctx.current.log(``, token); + }, + ], ++ // mieweb/ui patch (mieweb/ui#536): same marks inside HTML contexts. ++ 'superscript_open': [ ++ (token, ctx) => { ++ ctx.current.log('', token); ++ }, ++ ], ++ 'superscript_close': [ ++ (token, ctx) => { ++ ctx.current.log('', token); ++ }, ++ ], ++ 'subscript_open': [ ++ (token, ctx) => { ++ ctx.current.log('', token); ++ }, ++ ], ++ 'subscript_close': [ ++ (token, ctx) => { ++ ctx.current.log('', token); ++ }, ++ ], ++ 'highlight_open': [ ++ (token, ctx) => { ++ const color = token.attrGet('color'); ++ ctx.current.log(color && color !== 'yellow' ++ ? `` ++ : '', token); ++ }, ++ ], ++ 'highlight_close': [ ++ (token, ctx) => { ++ ctx.current.log('', token); ++ }, ++ ], + }; + } + export function getHtmlInlineTokensHandlers() { diff --git a/patches/@kerebron+extension-menu+0.8.12.patch b/patches/@kerebron+extension-menu+0.8.12.patch new file mode 100644 index 000000000..fd3280f72 --- /dev/null +++ b/patches/@kerebron+extension-menu+0.8.12.patch @@ -0,0 +1,247 @@ +diff --git a/node_modules/@kerebron/extension-menu/esm/CustomMenuPlugin.js b/node_modules/@kerebron/extension-menu/esm/CustomMenuPlugin.js +index d630c6893dd77f148ca72cf2b137364bbce3830c..a4ee62e433dc1f429e1613e5c9bb1227e3bc7c2b 100644 +--- a/node_modules/@kerebron/extension-menu/esm/CustomMenuPlugin.js ++++ b/node_modules/@kerebron/extension-menu/esm/CustomMenuPlugin.js +@@ -38,6 +38,12 @@ export class CustomMenuView { + currentOverflowTools = []; + // Default order of tools (stored on initialization) + defaultOrder = []; ++ // Update callbacks of currently mounted items, so update() can refresh ++ // active/disabled state in place without a full render() (DOM rebuild + ++ // synchronous measurement) on every ProseMirror transaction. ++ toolUpdates = []; ++ overflowUpdates = []; ++ dropdownUpdates = []; + constructor(editorView, editor, content) { + this.editorView = editorView; + this.editor = editor; +@@ -531,6 +537,7 @@ export class CustomMenuView { + if (this.pinnedDropdownMenu) { + this.pinnedDropdownMenu.remove(); + } ++ this.dropdownUpdates = []; + const currentLevel = this.pinnedDropdownStack[this.pinnedDropdownStack.length - 1]; + const isSubmenu = this.pinnedDropdownStack.length > 1; + // Create dropdown menu +@@ -595,7 +602,10 @@ export class CustomMenuView { + } + else { + // Regular menu item +- const { dom } = subTool.element.render(this.editorView); ++ const { dom, update } = subTool.element.render(this.editorView); ++ // Apply current editor state (active/disabled) to the fresh render ++ update(this.editorView.state); ++ this.dropdownUpdates.push(update); + // Hide button's internal label + const spans = dom.querySelectorAll('span'); + spans.forEach((span) => { +@@ -617,12 +627,15 @@ export class CustomMenuView { + wrapper.appendChild(label); + // Make wrapper clickable + wrapper.addEventListener('mousedown', (e) => { +- if (e.target !== dom) { ++ // Forward only clicks outside the button subtree: a click on ++ // the button or its icon already reaches the menu handler, so ++ // redispatching would run toggle commands twice (no-op). ++ if (!dom.contains(e.target)) { + e.preventDefault(); + const mousedownEvent = new MouseEvent('mousedown', { + bubbles: true, + cancelable: true, +- view: dntShim.dntGlobalThis, ++ view: this.editorView.dom.ownerDocument.defaultView, + }); + dom.dispatchEvent(mousedownEvent); + } +@@ -665,6 +678,7 @@ export class CustomMenuView { + renderOverflowMenu() { + // Clear overflow menu + this.overflowMenu.innerHTML = ''; ++ this.overflowUpdates = []; + // Set ARIA attributes for overflow menu + this.overflowMenu.setAttribute('role', 'menu'); + this.overflowMenu.setAttribute('aria-label', 'More tools'); +@@ -740,6 +754,9 @@ export class CustomMenuView { + else { + // Regular menu item + const { dom, update } = tool.element.render(this.editorView); ++ // Apply current editor state (active/disabled) to the fresh render ++ update(this.editorView.state); ++ this.overflowUpdates.push(update); + // Hide the button's internal label to avoid duplication + const internalLabel = dom.querySelector('span'); + if (internalLabel) { +@@ -754,12 +771,15 @@ export class CustomMenuView { + wrapper.appendChild(label); + // Make the entire wrapper clickable by dispatching mousedown to the button + wrapper.addEventListener('mousedown', (e) => { +- if (e.target !== dom) { ++ // Forward only clicks outside the button subtree (see ++ // renderPinnedDropdown): avoids double command dispatch ++ // when the icon inside the button is clicked. ++ if (!dom.contains(e.target)) { + e.preventDefault(); + const mousedownEvent = new MouseEvent('mousedown', { + bubbles: true, + cancelable: true, +- view: dntShim.dntGlobalThis, ++ view: this.editorView.dom.ownerDocument.defaultView, + }); + dom.dispatchEvent(mousedownEvent); + } +@@ -771,7 +791,7 @@ export class CustomMenuView { + const mousedownEvent = new MouseEvent('mousedown', { + bubbles: true, + cancelable: true, +- view: dntShim.dntGlobalThis, ++ view: this.editorView.dom.ownerDocument.defaultView, + }); + dom.dispatchEvent(mousedownEvent); + } +@@ -839,6 +859,9 @@ export class CustomMenuView { + else { + // Regular menu item - show icon only with tooltip + const { dom, update } = tool.element.render(this.editorView); ++ // Apply current editor state (active/disabled) to the fresh render ++ update(this.editorView.state); ++ this.overflowUpdates.push(update); + // Hide any text labels, keep only icons + const spans = dom.querySelectorAll('span'); + spans.forEach((span) => { +@@ -904,22 +927,27 @@ export class CustomMenuView { + wrapper.setAttribute('data-tool-id', tool.id); + wrapper.setAttribute('draggable', 'false'); + const isDropdown = tool.element.content !== undefined; ++ let itemUpdate; + if (isDropdown) { +- const { dom } = tool.element.render(this.editorView); ++ const { dom, update } = tool.element.render(this.editorView); + const dropdownMenu = dom.querySelector('.kb-dropdown__content'); + if (dropdownMenu) { + dropdownMenu.style.display = 'none'; + } + wrapper.appendChild(dom); ++ update(this.editorView.state); ++ itemUpdate = update; + } + else { +- const { dom } = tool.element.render(this.editorView); ++ const { dom, update } = tool.element.render(this.editorView); + wrapper.appendChild(dom); ++ update(this.editorView.state); ++ itemUpdate = update; + } + // Temporarily add to toolbar to measure + this.toolbar.appendChild(wrapper); + const width = wrapper.getBoundingClientRect().width; +- renderedItems.push({ tool, wrapper, width }); ++ renderedItems.push({ tool, wrapper, width, update: itemUpdate }); + }); + // Second pass: determine which items fit + // Account for gaps between items (4px gap) and separators between groups +@@ -949,6 +977,9 @@ export class CustomMenuView { + overflowItems.push(item); + } + } ++ // Keep the visible items' update callbacks so update() can refresh ++ // their active/disabled state without a full re-render. ++ this.toolUpdates = visibleItems.map((item) => item.update); + // Clear toolbar again and re-render only visible items + this.toolbar.innerHTML = ''; + // Track previous group index for inserting separators between groups +@@ -1514,11 +1545,29 @@ export class CustomMenuView { + } + } + update(view, prevState) { +- // Re-render tools to update their state (original approach) +- // Note: This is less efficient but more reliable than storing update functions +- this.tools.forEach((tool) => { +- tool.element.render(this.editorView); +- }); ++ // Refresh mounted items' active/disabled state in place. Calling ++ // render() here would rebuild the toolbar DOM and synchronously ++ // measure every tool on each ProseMirror transaction (every ++ // keystroke/caret move). Geometry changes are already handled by ++ // the ResizeObserver in the constructor, and the overflow menu and ++ // pinned dropdowns re-render their content each time they open. ++ // storedMarks: toggling a mark at a collapsed cursor changes neither ++ // doc nor selection; marks are immutable so reference equality is ++ // the correct cheap check (a false mismatch just re-runs callbacks). ++ if (prevState && ++ prevState.doc.eq(view.state.doc) && ++ prevState.selection.eq(view.state.selection) && ++ prevState.storedMarks === view.state.storedMarks) { ++ return; ++ } ++ const state = view.state; ++ this.toolUpdates.forEach((update) => update(state)); ++ if (this.overflowMenu.style.display !== 'none') { ++ this.overflowUpdates.forEach((update) => update(state)); ++ } ++ if (this.pinnedDropdownMenu) { ++ this.dropdownUpdates.forEach((update) => update(state)); ++ } + } + destroy() { + // Clean up event listeners +diff --git a/node_modules/@kerebron/extension-menu/esm/buildMenu.js b/node_modules/@kerebron/extension-menu/esm/buildMenu.js +index 85b1f4762033ee4dc68d1c9ceaa69dbd55f746de..9abcc3ba868130cd89c6653b942a6c5d4c699af9 100644 +--- a/node_modules/@kerebron/extension-menu/esm/buildMenu.js ++++ b/node_modules/@kerebron/extension-menu/esm/buildMenu.js +@@ -220,6 +220,7 @@ export function buildMenu(editor, schema) { + title: 'Toggle bold', + run: () => editor.chain().toggleStrong().run(), + enable: (state) => editor.can().toggleStrong().run(), ++ active: (state) => markActive(state, schema.marks.strong), + icon: icons.strong, + })); + } +@@ -229,6 +230,7 @@ export function buildMenu(editor, schema) { + title: 'Toggle italic', + run: () => editor.chain().toggleItalic().run(), + enable: (state) => editor.can().toggleItalic().run(), ++ active: (state) => markActive(state, schema.marks.em), + icon: icons.em, + })); + } +@@ -252,6 +254,7 @@ export function buildMenu(editor, schema) { + title: 'Toggle underline', + run: () => editor.chain().toggleUnderline().run(), + enable: (state) => editor.can().toggleUnderline().run(), ++ active: (state) => markActive(state, schema.marks.underline), + icon: icons.underline, + })); + } +@@ -331,24 +334,32 @@ export function buildMenu(editor, schema) { + icon: icons.alignLeft, + run: () => editor.chain().setTextAlignLeft().run(), + enable: () => editor.can().setTextAlignLeft().run(), ++ active: (state) => ++ (state.selection.$from.parent.attrs.textAlign ?? 'left') === 'left', + })); + alignmentGroup.push(new MenuItem({ + title: 'Align center', + icon: icons.alignCenter, + run: () => editor.chain().setTextAlignCenter().run(), + enable: () => editor.can().setTextAlignCenter().run(), ++ active: (state) => ++ state.selection.$from.parent.attrs.textAlign === 'center', + })); + alignmentGroup.push(new MenuItem({ + title: 'Align right', + icon: icons.alignRight, + run: () => editor.chain().setTextAlignRight().run(), + enable: () => editor.can().setTextAlignRight().run(), ++ active: (state) => ++ state.selection.$from.parent.attrs.textAlign === 'right', + })); + alignmentGroup.push(new MenuItem({ + title: 'Justify', + icon: icons.alignJustify, + run: () => editor.chain().setTextAlignJustify().run(), + enable: () => editor.can().setTextAlignJustify().run(), ++ active: (state) => ++ state.selection.$from.parent.attrs.textAlign === 'justify', + })); + } + // Group 6: Insert tools (Image, Lists, HR, Table, Type) diff --git a/patches/README.md b/patches/README.md new file mode 100644 index 000000000..941e0f953 --- /dev/null +++ b/patches/README.md @@ -0,0 +1,31 @@ +# patches/ + +Fixes to `@kerebron/*` that the RichEditor needs, applied after every install by +[`patch-package`](https://github.com/ds300/patch-package) through +[`scripts/apply-patches.cjs`](../scripts/apply-patches.cjs) (`postinstall`). + +They are not written here. Each one is a copy of the patch of the same name in +[mieweb/ui's `patches/`](https://github.com/mieweb/ui/tree/main/patches), which +`@mieweb/ui` asks host apps to apply. Kerebron is a peer dependency, so the app's +copy is the one the editor runs, and a fix made only in the library never reaches it. + +| Patch | Without it | +| --------------------- | -------------------------------------------------------------------------------------- | +| `extension-menu` | The toolbar's Heading and List dropdowns do nothing, and buttons never show as pressed | +| `extension-markdown` | Highlight, superscript and subscript are dropped when a document is saved as Markdown | +| `extension-codecrock` | The code-block language picker has no accessible name | + +## Keeping them in step + +The patches target `@kerebron/*@0.8.12` exactly, which is why `package.json` pins +those packages to `0.8.12` with no `^`. `patch-package` fails the install if a +patch no longer matches its package. + +After `npm run ui:sync`, compare `vendor/ui/patches/` with this folder. Upstream's +files are in pnpm format; ours differ only in the filename +(`@kerebron++.patch`) and in each path being prefixed with +`node_modules/@kerebron//`. When upstream drops a patch because Kerebron +fixed the bug, delete it here and move the pin. + +`scripts/apply-patches.cjs` lists the patches it expects and fails the install if +one is missing, so adding, removing or renaming a patch means updating that list too. diff --git a/release-notes/1.0.7.md b/release-notes/1.0.7.md new file mode 100644 index 000000000..8012867c2 --- /dev/null +++ b/release-notes/1.0.7.md @@ -0,0 +1,30 @@ +--- +version: 1.0.7 +date: 2026-10-13 +title: A formatting toolbar that does what you clicked +--- + +The editor you write plans, wrap-ups and Huddle posts in has been brought up to +date with the latest version of the component library TimeHuddle is built on. +The visible part is the formatting toolbar, which now behaves the way it looks. + +## The toolbar keeps up with you + +- **Heading and Lists apply what you pick.** Choose "Heading 2" or a bullet list + from the toolbar and the text changes. +- **Buttons show what is on.** Bold, italic, alignment and the rest stay + highlighted while that formatting applies to where your cursor is. +- **Highlight, superscript and subscript are kept.** They used to be dropped + when a post was saved; now they come back when you open it again. + +## Easier to read + +- **Links in your own Huddle messages show up.** In light mode a link you posted + was the same colour as your message bubble, so it looked like a gap in the + sentence. It is now white and underlined, in light and dark. +- **Links inside the editor** use a colour that is readable on the dark background. +- **Code blocks** are coloured by language in both light and dark. + +## Pull requests in this release + +- The editor and the rest of the component library, updated to the latest version ([#701](https://github.com/mieweb/timehuddle/pull/701)) diff --git a/scripts/apply-patches.cjs b/scripts/apply-patches.cjs new file mode 100644 index 000000000..dc84890c4 --- /dev/null +++ b/scripts/apply-patches.cjs @@ -0,0 +1,37 @@ +#!/usr/bin/env node +/* + * Applies patches/ (patch-package) after install. + * + * The patches fix @kerebron bugs the RichEditor hits; they come from mieweb/ui's + * own patches/ folder — see patches/README.md. + * + * The only install allowed to skip is one without patch-package itself: the + * production Docker stage installs without devDependencies and only serves the + * already-built dist/. Anywhere else a missing patch, or one that no longer + * applies, fails the install — an unpatched editor breaks silently. + */ +const { execSync } = require('node:child_process'); +const { existsSync } = require('node:fs'); + +// patch-package applies whatever it finds, so a deleted file would pass +// unnoticed. Keep this list in step with patches/ (see patches/README.md). +const REQUIRED_PATCHES = [ + '@kerebron+extension-codecrock+0.8.12.patch', + '@kerebron+extension-markdown+0.8.12.patch', + '@kerebron+extension-menu+0.8.12.patch', +]; + +const bin = './node_modules/.bin/patch-package'; +if (!existsSync(bin)) { + console.log('[apply-patches] patch-package not installed (production install) – skipping.'); + process.exit(0); +} +const missing = REQUIRED_PATCHES.filter((name) => !existsSync(`./patches/${name}`)); +if (missing.length > 0) { + console.error( + `[apply-patches] missing from patches/: ${missing.join(', ')} – refusing to install without the Kerebron fixes.`, + ); + process.exit(1); +} +// --error-on-fail: outside CI patch-package exits 0 even when a patch fails. +execSync(`${bin} --error-on-fail`, { stdio: 'inherit' }); diff --git a/vendor/.ui-tarball-commit b/vendor/.ui-tarball-commit index 58d579b56..db2da4b81 100644 --- a/vendor/.ui-tarball-commit +++ b/vendor/.ui-tarball-commit @@ -1 +1 @@ -1b1c761692b43a4bb83c0a23f8d53fdfaccdef79 +650537c3a3df7c5adcbcad1eefed4cfa759e745a diff --git a/vendor/README.md b/vendor/README.md index 222f7cac8..ac81ad608 100644 --- a/vendor/README.md +++ b/vendor/README.md @@ -41,7 +41,8 @@ graph LR To pull in upstream changes: `npm run ui:sync`. It merges `mieweb/ui` `main` into the branch (a merge, so the branch never needs a force-push) and rebuilds. Then push `vendor/ui` and commit -as in step 4. +as in step 4. Check `vendor/ui/patches/` against [`patches/`](../patches/README.md) afterwards: the +app applies the library's Kerebron fixes itself. The build takes a few minutes; it is skipped when `vendor/ui` hasn't moved. `npm run ui:build -- --force` rebuilds anyway. diff --git a/vendor/mieweb-ui.tgz b/vendor/mieweb-ui.tgz index 9b0ebbb79..c31a4cf28 100644 Binary files a/vendor/mieweb-ui.tgz and b/vendor/mieweb-ui.tgz differ diff --git a/vendor/ui b/vendor/ui index 1b1c76169..650537c3a 160000 --- a/vendor/ui +++ b/vendor/ui @@ -1 +1 @@ -Subproject commit 1b1c761692b43a4bb83c0a23f8d53fdfaccdef79 +Subproject commit 650537c3a3df7c5adcbcad1eefed4cfa759e745a