Skip to content

Commit 0ee96e3

Browse files
Copilothotlong
andcommitted
Changes before error encountered
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent ce69191 commit 0ee96e3

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

packages/plugin-charts/src/AdvancedChartImpl.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ import {
1919
ChartConfig
2020
} from './ChartContainerImpl';
2121

22+
// Default color fallback for chart series
23+
const DEFAULT_CHART_COLOR = 'hsl(var(--chart-1))';
24+
2225
export interface AdvancedChartImplProps {
2326
chartType?: 'bar' | 'line' | 'area';
2427
data?: Array<Record<string, any>>;
@@ -60,7 +63,7 @@ export default function AdvancedChartImpl({
6063
<ChartTooltip content={<ChartTooltipContent />} />
6164
<ChartLegend content={<ChartLegendContent />} />
6265
{series.map((s: any) => {
63-
const color = config[s.dataKey]?.color || 'hsl(var(--chart-1))';
66+
const color = config[s.dataKey]?.color || DEFAULT_CHART_COLOR;
6467

6568
if (chartType === 'bar') {
6669
return <Bar key={s.dataKey} dataKey={s.dataKey} fill={color} radius={4} />;

packages/plugin-kanban/src/KanbanImpl.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,12 @@ export default function KanbanBoard({ columns, onCardMove, className }: KanbanBo
197197
const activeCards = [...activeColumn.cards]
198198
const overCards = [...overColumn.cards]
199199
const activeIndex = activeCards.findIndex((c) => c.id === activeId)
200-
const overIndex = overId === overColumn.id ? overCards.length : overCards.findIndex((c) => c.id === overId)
200+
201+
// Calculate target index: if dropping on column itself, append to end; otherwise insert at card position
202+
const isDroppingOnColumn = overId === overColumn.id
203+
const overIndex = isDroppingOnColumn
204+
? overCards.length
205+
: overCards.findIndex((c) => c.id === overId)
201206

202207
const [movedCard] = activeCards.splice(activeIndex, 1)
203208
overCards.splice(overIndex, 0, movedCard)

packages/plugin-markdown/src/MarkdownImpl.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ export default function MarkdownImpl({ content, className }: MarkdownImplProps)
5252
<ReactMarkdown
5353
remarkPlugins={[remarkGfm]}
5454
rehypePlugins={[rehypeSanitize]}
55+
// Additional security: only allow safe elements
56+
// This provides defense-in-depth beyond rehype-sanitize
57+
disallowedElements={['script', 'style', 'iframe', 'object', 'embed']}
58+
unwrapDisallowed={true}
5559
>
5660
{content}
5761
</ReactMarkdown>

0 commit comments

Comments
 (0)