Skip to content

Commit 59919e8

Browse files
Merge pull request #3789 from opral/docs-v2
sitemap generation
2 parents 99a9258 + b10e166 commit 59919e8

File tree

120 files changed

+12856
-1367
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+12856
-1367
lines changed

.changeset/bright-apes-care.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@opral/markdown-wc": minor
3+
---
4+
5+
Add support for GitHub-style alert blockquotes (`> [!NOTE]`, `> [!TIP]`, `> [!IMPORTANT]`, `> [!WARNING]`, `> [!CAUTION]`). Alerts render as standard `<blockquote>` elements annotated with `data-mwc-alert`, and include a hideable `[data-mwc-alert-marker]` span for site-specific styling (e.g. `blockquote[data-mwc-alert="note"] { ... }` and `blockquote[data-mwc-alert] [data-mwc-alert-marker]{display:none}`). Add an opt-in `externalLinks` option to open absolute http(s) links in a new tab with `rel="noopener noreferrer"`. Code blocks are annotated with `data-mwc-codeblock` for consumer styling and hydration.

.changeset/curly-taxis-sell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@opral/markdown-wc": major
3+
---
4+
5+
Stop injecting default inline styles into rendered HTML and remove the `inlineStyles` option. The previous default look is now provided as a separate stylesheet at `@opral/markdown-wc/default.css`, which apps can import if they want the old styling.

packages/flashtype/src/app/import-file.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,12 @@ export async function importFile({
9292
},
9393
focus: true,
9494
});
95-
9695
}
9796

9897
/**
9998
* Imports content from the clipboard as a new file.
10099
*/
101-
export async function importFromClipboard(
102-
context: ViewContext,
103-
): Promise<void> {
100+
export async function importFromClipboard(context: ViewContext): Promise<void> {
104101
const content = await navigator.clipboard.readText();
105102

106103
if (!content?.trim()) {
@@ -122,9 +119,7 @@ export async function importFromClipboard(
122119
/**
123120
* Opens a file picker and imports the selected file.
124121
*/
125-
export async function importFromComputer(
126-
context: ViewContext,
127-
): Promise<void> {
122+
export async function importFromComputer(context: ViewContext): Promise<void> {
128123
const input = document.createElement("input");
129124
input.type = "file";
130125
input.accept = ".md,.txt,.markdown";

packages/flashtype/src/views/agent-view/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,9 @@ export function AgentView({ context, instance }: AgentViewProps) {
773773
<div className="w-full max-w-3xl mx-auto flex flex-col gap-4">
774774
{hasKey ? (
775775
<>
776-
{(!messages || messages.length === 0) && !pending && !pendingMessage ? (
776+
{(!messages || messages.length === 0) &&
777+
!pending &&
778+
!pendingMessage ? (
777779
<AgentEmptyState />
778780
) : (
779781
<>
@@ -796,7 +798,9 @@ export function AgentView({ context, instance }: AgentViewProps) {
796798
</div>
797799
) : null}
798800
{error ? (
799-
<div className="px-3 py-1 text-xs text-rose-500">{error}</div>
801+
<div className="px-3 py-1 text-xs text-rose-500">
802+
{error}
803+
</div>
800804
) : null}
801805
</>
802806
)}

packages/flashtype/src/views/markdown-view/components/formatting-toolbar.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ export function FormattingToolbar({ className }: { className?: string }) {
132132
const handleBlockChange = useCallback(
133133
(value: ToolbarBlockType) => {
134134
if (!editor) return;
135-
const option = TOOLBAR_BLOCK_OPTIONS.find((entry) => entry.value === value);
135+
const option = TOOLBAR_BLOCK_OPTIONS.find(
136+
(entry) => entry.value === value,
137+
);
136138
option?.apply(editor);
137139
setBlockMenuOpen(false);
138140
},

packages/flashtype/src/views/markdown-view/components/slash-command-menu.tsx

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,21 @@ import {
55
slashCommandsPluginKey,
66
type SlashCommandState,
77
} from "../editor/extensions/slash-commands";
8-
import { SLASH_BLOCK_COMMANDS, type BlockCommand } from "../editor/block-commands";
9-
10-
function filterCommands(commands: BlockCommand[], query: string): BlockCommand[] {
8+
import {
9+
SLASH_BLOCK_COMMANDS,
10+
type BlockCommand,
11+
} from "../editor/block-commands";
12+
13+
function filterCommands(
14+
commands: BlockCommand[],
15+
query: string,
16+
): BlockCommand[] {
1117
if (!query) return commands;
1218
const lowerQuery = query.toLowerCase();
1319
return commands.filter(
1420
(cmd) =>
1521
cmd.label.toLowerCase().includes(lowerQuery) ||
16-
cmd.keywords.some((kw) => kw.toLowerCase().includes(lowerQuery))
22+
cmd.keywords.some((kw) => kw.toLowerCase().includes(lowerQuery)),
1723
);
1824
}
1925

@@ -34,7 +40,7 @@ export function SlashCommandMenu() {
3440

3541
const filteredCommands = useMemo(
3642
() => filterCommands(SLASH_BLOCK_COMMANDS, slashState.query),
37-
[slashState.query]
43+
[slashState.query],
3844
);
3945

4046
// Reset selection when filtered list changes
@@ -132,14 +138,14 @@ export function SlashCommandMenu() {
132138
// Execute the command insert action
133139
command.insert(editor);
134140
},
135-
[editor]
141+
[editor],
136142
);
137143

138144
const handleItemClick = useCallback(
139145
(command: BlockCommand) => {
140146
executeCommand(command);
141147
},
142-
[executeCommand]
148+
[executeCommand],
143149
);
144150

145151
// Handle keyboard navigation
@@ -150,15 +156,15 @@ export function SlashCommandMenu() {
150156
if (event.key === "ArrowDown") {
151157
event.preventDefault();
152158
setSelectedIndex((prev) =>
153-
prev < filteredCommands.length - 1 ? prev + 1 : 0
159+
prev < filteredCommands.length - 1 ? prev + 1 : 0,
154160
);
155161
return;
156162
}
157163

158164
if (event.key === "ArrowUp") {
159165
event.preventDefault();
160166
setSelectedIndex((prev) =>
161-
prev > 0 ? prev - 1 : filteredCommands.length - 1
167+
prev > 0 ? prev - 1 : filteredCommands.length - 1,
162168
);
163169
return;
164170
}
@@ -180,13 +186,19 @@ export function SlashCommandMenu() {
180186

181187
window.addEventListener("keydown", handleKeyDown, true);
182188
return () => window.removeEventListener("keydown", handleKeyDown, true);
183-
}, [slashState.active, editor, filteredCommands, selectedIndex, executeCommand]);
189+
}, [
190+
slashState.active,
191+
editor,
192+
filteredCommands,
193+
selectedIndex,
194+
executeCommand,
195+
]);
184196

185197
// Scroll selected item into view
186198
useEffect(() => {
187199
if (!menuRef.current) return;
188200
const selectedEl = menuRef.current.querySelector(
189-
`[data-index="${selectedIndex}"]`
201+
`[data-index="${selectedIndex}"]`,
190202
);
191203
if (selectedEl) {
192204
selectedEl.scrollIntoView({ block: "nearest" });
@@ -241,11 +253,14 @@ export function SlashCommandMenu() {
241253
onMouseEnter={() => setSelectedIndex(index)}
242254
tabIndex={0}
243255
>
244-
<command.icon className="size-4 shrink-0 text-muted-foreground" aria-hidden />
256+
<command.icon
257+
className="size-4 shrink-0 text-muted-foreground"
258+
aria-hidden
259+
/>
245260
<span>{command.label}</span>
246261
</div>
247262
))}
248263
</div>,
249-
document.body
264+
document.body,
250265
);
251266
}

packages/flashtype/src/views/markdown-view/editor/block-commands.ts

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,19 @@ export const BLOCK_COMMANDS: BlockCommand[] = [
174174
}
175175
rows.push({ type: "tableRow", content: cells });
176176
}
177-
editor.chain().focus().insertContent({ type: "table", content: rows }).run();
177+
editor
178+
.chain()
179+
.focus()
180+
.insertContent({ type: "table", content: rows })
181+
.run();
178182
},
179183
},
180184
];
181185

182186
/** Block commands that can be used in the toolbar (have toggle action) */
183-
export const TOOLBAR_BLOCK_COMMANDS = BLOCK_COMMANDS.filter((cmd) => cmd.toggle);
187+
export const TOOLBAR_BLOCK_COMMANDS = BLOCK_COMMANDS.filter(
188+
(cmd) => cmd.toggle,
189+
);
184190

185191
/** All block commands for slash menu */
186192
export const SLASH_BLOCK_COMMANDS = BLOCK_COMMANDS;
@@ -214,17 +220,22 @@ const idToToolbarValue: Record<string, ToolbarBlockType> = {
214220
};
215221

216222
/** Toolbar-specific label overrides (where different from slash menu) */
217-
const toolbarLabelOverrides: Record<string, { label: string; description: string }> = {
223+
const toolbarLabelOverrides: Record<
224+
string,
225+
{ label: string; description: string }
226+
> = {
218227
codeBlock: { label: "Code", description: "Code block" },
219228
};
220229

221230
/** Block options formatted for toolbar dropdown */
222-
export const TOOLBAR_BLOCK_OPTIONS: ToolbarBlockOption[] = TOOLBAR_BLOCK_COMMANDS
223-
.filter((cmd) => idToToolbarValue[cmd.id])
224-
.map((cmd) => ({
225-
value: idToToolbarValue[cmd.id]!,
226-
label: toolbarLabelOverrides[cmd.id]?.label ?? cmd.label,
227-
description: toolbarLabelOverrides[cmd.id]?.description ?? cmd.description,
228-
icon: cmd.icon,
229-
apply: cmd.toggle!,
230-
}));
231+
export const TOOLBAR_BLOCK_OPTIONS: ToolbarBlockOption[] =
232+
TOOLBAR_BLOCK_COMMANDS.filter((cmd) => idToToolbarValue[cmd.id]).map(
233+
(cmd) => ({
234+
value: idToToolbarValue[cmd.id]!,
235+
label: toolbarLabelOverrides[cmd.id]?.label ?? cmd.label,
236+
description:
237+
toolbarLabelOverrides[cmd.id]?.description ?? cmd.description,
238+
icon: cmd.icon,
239+
apply: cmd.toggle!,
240+
}),
241+
);

packages/flashtype/src/views/markdown-view/editor/extensions/slash-commands.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ declare module "@tiptap/core" {
1313
}
1414

1515
export const slashCommandsPluginKey = new PluginKey<SlashCommandState>(
16-
"slashCommands"
16+
"slashCommands",
1717
);
1818

1919
export type SlashCommandState = {
@@ -90,7 +90,7 @@ export const SlashCommandsExtension = Extension.create<SlashCommandsOptions>({
9090
0,
9191
$from.parentOffset,
9292
undefined,
93-
"\ufffc"
93+
"\ufffc",
9494
);
9595

9696
// Find the last "/" in the text before cursor
@@ -164,7 +164,9 @@ export const SlashCommandsExtension = Extension.create<SlashCommandsOptions>({
164164
if (state?.active) {
165165
// Close the menu
166166
this.editor.view.dispatch(
167-
this.editor.state.tr.setMeta(slashCommandsPluginKey, { close: true })
167+
this.editor.state.tr.setMeta(slashCommandsPluginKey, {
168+
close: true,
169+
}),
168170
);
169171
return true;
170172
}
@@ -194,7 +196,7 @@ export const SlashCommandsExtension = Extension.create<SlashCommandsOptions>({
194196
dispatch(
195197
tr
196198
.delete(pluginState.range.from, pluginState.range.to)
197-
.setMeta(slashCommandsPluginKey, { close: true })
199+
.setMeta(slashCommandsPluginKey, { close: true }),
198200
);
199201
}
200202
return true;

packages/lix/website/.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
node_modules
2+
.DS_Store
3+
dist
4+
dist-ssr
5+
*.local
6+
src/routeTree.gen.ts
7+
count.txt
8+
.env
9+
.nitro
10+
.tanstack
11+
.wrangler
12+
.output
13+
.vinxi
14+
todos.json
15+
content/plugins/*.md
16+
!content/plugins/index.md
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"files.watcherExclude": {
3+
"**/routeTree.gen.ts": true
4+
},
5+
"search.exclude": {
6+
"**/routeTree.gen.ts": true
7+
},
8+
"files.readonlyInclude": {
9+
"**/routeTree.gen.ts": true
10+
}
11+
}

0 commit comments

Comments
 (0)