Skip to content

Add basic kerebron support#267

Merged
horner merged 4 commits into
mainfrom
feat/kerebron
Jun 13, 2026
Merged

Add basic kerebron support#267
horner merged 4 commits into
mainfrom
feat/kerebron

Conversation

@ggodlewski

@ggodlewski ggodlewski commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator
image

Copilot AI review requested due to automatic review settings June 12, 2026 15:02
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 12, 2026

Copy link
Copy Markdown

Deploying ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: afaf0f2
Status: ✅  Deploy successful!
Preview URL: https://28c5ec0d.ui-6d0.pages.dev
Branch Preview URL: https://feat-kerebron.ui-6d0.pages.dev

View logs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces initial integration of the Kerebron editor into @mieweb/ui by adding new editor wrapper components, wiring up Storybook to serve Kerebron WASM assets, and including Kerebron-provided CSS.

Changes:

  • Add new RichEditor and CodeEditor components under src/components/RichEditor/.
  • Add Kerebron CSS imports to the library base stylesheet.
  • Add Kerebron packages and Storybook static asset mapping for @kerebron/wasm assets, and export the new editor module from the main entrypoint.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/styles/base.css Imports Kerebron editor CSS into the library’s global stylesheet.
src/index.ts Exports the new RichEditor module from the main package entrypoint.
src/components/RichEditor/RichEditor.tsx Adds a Kerebron AdvancedEditorKit wrapper component with markdown preview logic.
src/components/RichEditor/CodeEditor.tsx Adds a Kerebron CodeEditorKit wrapper component.
src/components/RichEditor/RichEditor.stories.tsx Adds Storybook stories intended to demonstrate controlled editor usage.
src/components/RichEditor/index.ts Adds barrel exports for RichEditor and CodeEditor.
package.json Adds Kerebron packages (currently under devDependencies).
.storybook/main.ts Serves @kerebron/wasm assets via staticDirs at /kerebron-wasm.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/RichEditor/RichEditor.tsx Outdated
Comment thread src/components/RichEditor/RichEditor.tsx Outdated
Comment thread src/components/RichEditor/RichEditor.tsx Outdated
Comment thread src/components/RichEditor/RichEditor.tsx
Comment thread src/components/RichEditor/CodeEditor.tsx Outdated
Comment thread src/components/RichEditor/CodeEditor.tsx Outdated
Comment thread src/index.ts Outdated
Comment thread package.json Outdated
Comment thread src/styles/base.css Outdated
Comment thread src/components/RichEditor/RichEditor.tsx
@ggodlewski

Copy link
Copy Markdown
Collaborator Author
image

horner added 3 commits June 13, 2026 15:26
The @kerebron/editor, @kerebron/editor-kits, and @kerebron/wasm packages are
used in published code (src/index.ts exports RichEditor/CodeEditor and
src/styles/base.css imports their CSS), so they must be runtime dependencies
rather than devDependencies — otherwise the published @mieweb/ui package fails
to resolve them for consumers.

Also regenerates pnpm-lock.yaml (was out of sync with package.json, which was
causing the Cloudflare Pages build to fail with ERR_PNPM_OUTDATED_LOCKFILE
under --frozen-lockfile).

Verified: pnpm install --frozen-lockfile clean, storybook build succeeds.
…bpath entry

Implements the PR #267 Copilot review feedback:

- RichEditor/CodeEditor: add explicit props interfaces (value/onChange, plus
  lang for CodeEditor) and wire editor transactions to onChange. Seed initial
  content via loadDocumentText and populate the preview once on mount instead
  of waiting for the first transaction. Fixes the typecheck failure where the
  stories passed props the React.FC<{}> components didn't accept.
- RichEditor: gate the markdown-output preview behind a showPreview prop and
  render md directly (no more 'Loading...' shown for legitimately empty
  content).
- Move the Kerebron editors off the main entry to an optional subpath:
  @mieweb/ui/kerebron (src/kerebron.ts) + @mieweb/ui/kerebron.css, mirroring
  the AG Grid/DataVis pattern. Removes the @kerebron CSS from the global
  base.css and the export from src/index.ts so consumers who don't use the
  editor don't ship Kerebron's code/WASM/CSS.
- package.json: @kerebron/* are now optional peerDependencies (kept in
  devDependencies for our own build/storybook/tests); add ./kerebron and
  ./kerebron.css exports and a copy:kerebron-css build step; mark @kerebron/*
  external in tsup.
- Remove leftover '// App.tsx or MyEditor.tsx' sample-code headers.
- Add RichEditor/CodeEditor smoke tests (Kerebron module mocked).
- Storybook: load kerebron.css in preview so editor stories stay styled.

Verified: tsc clean, eslint clean, prettier clean, 200 unit tests pass,
library build + storybook build succeed, pnpm install --frozen-lockfile clean.
Copilot AI review requested due to automatic review settings June 13, 2026 19:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated 5 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment on lines +7 to +14
export interface RichEditorProps {
/** Initial markdown content to load into the editor. */
value?: string;
/** Called with the editor's markdown content whenever it changes. */
onChange?: (value: string) => void;
/** Whether to render the live markdown output preview. Defaults to `false`. */
showPreview?: boolean;
}
Comment on lines +16 to +21
const RichEditor: React.FC<RichEditorProps> = ({
value = '',
onChange,
showPreview = false,
}) => {
const editorRef = useRef<HTMLDivElement>(null);
Comment on lines +7 to +14
export interface CodeEditorProps {
/** Initial source code to load into the editor. */
value?: string;
/** Called with the editor's contents whenever they change. */
onChange?: (value: string) => void;
/** Language/grammar to use for syntax highlighting. Defaults to `typescript`. */
lang?: string;
}
Comment on lines +16 to +22
const CodeEditor: React.FC<CodeEditorProps> = ({
value = '',
onChange,
lang = 'typescript',
}) => {
const editorRef = useRef<HTMLDivElement>(null);
const editorInstance = useRef<CoreEditor | null>(null);
Comment on lines +1 to +5
import { useState } from 'react';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { RichEditor } from './RichEditor';
import { CodeEditor } from './CodeEditor';

@horner horner merged commit 7b44524 into main Jun 13, 2026
11 checks passed
@horner horner deleted the feat/kerebron branch June 13, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants