Skip to content

Commit 88adf65

Browse files
committed
Self review
1 parent c9e6f63 commit 88adf65

File tree

9 files changed

+8
-3
lines changed

9 files changed

+8
-3
lines changed
Loading
Loading
Loading

packages/bundle/src/codeHighlighter/ShikiComposer.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { CodeHighlighterComposer, type HighlightCodeFn } from 'botframework-webchat-component/internal';
12
import React, { memo, ReactNode, useEffect, useState } from 'react';
23
import { type HighlighterCore } from 'shiki';
4+
35
import createHighlighter from './shiki';
4-
import { CodeHighlighterComposer, type HighlightCodeFn } from 'botframework-webchat-component/internal';
56

67
const createHighligtCodeWithShiki =
78
(shikiHiglighter: HighlighterCore): HighlightCodeFn =>

packages/component/src/Attachment/Text/private/CodeContent.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import classNames from 'classnames';
22
import React, { Fragment, memo, ReactNode } from 'react';
3+
34
import useCodeBlockTag from '../../../providers/CustomElements/useCodeBlockTagName';
45

56
type Props = Readonly<{

packages/component/src/providers/CustomElements/CustomElementsComposer.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import mathRandom from 'math-random';
22
import React, { memo, useCallback, useMemo, type ReactNode } from 'react';
3+
4+
import useReactCodeBlockClass from './customElements/CodeBlock';
35
import { CodeBlockCopyButtonElement } from './customElements/CodeBlockCopyButton';
46
import CustomElementsContext from './private/CustomElementsContext';
5-
import useReactCodeBlockClass from './customElements/CodeBlock';
67

78
type CustomElementsComposerProps = Readonly<{
89
children?: ReactNode | undefined;

packages/component/src/providers/CustomElements/customElements/CodeBlock.ts

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ const createReactCodeBlockClass = ({
148148

149149
disconnectedCallback() {
150150
this.#controller?.abort();
151+
this.#controller = null;
151152
}
152153

153154
highlight(...args: Parameters<HighlightCodeFn>) {

packages/component/src/providers/CustomElements/customElements/CodeBlockCopyButton.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import classNames from 'classnames';
22
import React, { memo, useCallback, useState, type MouseEventHandler } from 'react';
33
import { useRefFrom } from 'use-ref-from';
44
import { useStateWithRef } from 'use-state-with-ref';
5+
56
import testIds from '../../../testIds';
67
import wrapAsCustomElement from './wrapAsCustomElement';
78

packages/component/src/providers/CustomElements/private/useUpdater.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useMemo, useRef, useCallback, type DependencyList, type RefObject } from 'react';
1+
import { useCallback, useMemo, useRef, type DependencyList, type RefObject } from 'react';
22

33
export type UpdateFn = () => any;
44
export type OnTrackFn = (cb: UpdateFn, signal: AbortSignal) => void;

0 commit comments

Comments
 (0)