@codecademy/codebytes 1.0.4-alpha.41a141e2a.0 → 1.0.4-alpha.4641cabd2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MonacoEditor/colorsDark.d.ts +32 -0
- package/{src/MonacoEditor/colorsDark.ts → dist/MonacoEditor/colorsDark.js} +8 -16
- package/dist/MonacoEditor/index.d.ts +8 -0
- package/dist/MonacoEditor/index.js +42 -0
- package/dist/MonacoEditor/theme.d.ts +2 -0
- package/dist/MonacoEditor/theme.js +123 -0
- package/dist/MonacoEditor/types.d.ts +1 -0
- package/dist/MonacoEditor/types.js +1 -0
- package/dist/api.d.ts +12 -0
- package/dist/api.js +41 -0
- package/dist/codeByteEditor.d.ts +4 -0
- package/dist/codeByteEditor.js +141 -0
- package/dist/consts.d.ts +23 -0
- package/dist/consts.js +34 -0
- package/dist/drawers.d.ts +6 -0
- package/dist/drawers.js +149 -0
- package/dist/editor.d.ts +15 -0
- package/dist/editor.js +194 -0
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.js +12 -0
- package/dist/helpers/useEverInView.d.ts +5 -0
- package/dist/helpers/useEverInView.js +45 -0
- package/dist/helpers/useEverInView.test.js +63 -0
- package/dist/helpers/useIntersection.d.ts +2 -0
- package/dist/helpers/useIntersection.js +42 -0
- package/dist/helpers/useIntersection.test.js +127 -0
- package/{src/index.ts → dist/index.d.ts} +0 -0
- package/dist/index.js +3 -0
- package/dist/languageSelection.d.ts +6 -0
- package/dist/languageSelection.js +22 -0
- package/dist/libs/eventTracking.d.ts +1 -0
- package/dist/libs/eventTracking.js +11 -0
- package/{src → dist}/theme.d.ts +0 -0
- package/dist/types.d.ts +22 -0
- package/dist/types.js +1 -0
- package/package.json +8 -3
- package/.eslintrc.json +0 -35
- package/CHANGELOG.md +0 -14
- package/babel.config.js +0 -22
- package/jest.config.ts +0 -21
- package/project.json +0 -52
- package/src/MonacoEditor/index.tsx +0 -56
- package/src/MonacoEditor/theme.ts +0 -65
- package/src/MonacoEditor/types.ts +0 -1
- package/src/__tests__/codebyte.test.tsx +0 -186
- package/src/__tests__/editor.test.tsx +0 -108
- package/src/__tests__/helpers.test.tsx +0 -39
- package/src/__tests__/language-selection.test.tsx +0 -14
- package/src/api.ts +0 -28
- package/src/codeByteEditor.tsx +0 -115
- package/src/consts.ts +0 -64
- package/src/drawers.tsx +0 -133
- package/src/editor.tsx +0 -162
- package/src/helpers/index.ts +0 -8
- package/src/helpers/useEverInView.test.ts +0 -29
- package/src/helpers/useEverInView.ts +0 -28
- package/src/helpers/useIntersection.test.ts +0 -87
- package/src/helpers/useIntersection.ts +0 -35
- package/src/languageSelection.tsx +0 -26
- package/src/libs/eventTracking.ts +0 -18
- package/src/types.ts +0 -30
- package/tsconfig.json +0 -27
- package/tsconfig.spec.json +0 -21
package/src/editor.tsx
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FillButton,
|
|
3
|
-
FlexBox,
|
|
4
|
-
Spinner,
|
|
5
|
-
TextButton,
|
|
6
|
-
ToolTip,
|
|
7
|
-
} from '@codecademy/gamut';
|
|
8
|
-
import { CopyIcon } from '@codecademy/gamut-icons';
|
|
9
|
-
import { UserClickData } from '@codecademy/tracking';
|
|
10
|
-
import styled from '@emotion/styled';
|
|
11
|
-
import React, { useState } from 'react';
|
|
12
|
-
|
|
13
|
-
import { postSnippet } from './api';
|
|
14
|
-
import type { LanguageOption } from './consts';
|
|
15
|
-
import { Drawers } from './drawers';
|
|
16
|
-
import { trackClick } from './helpers';
|
|
17
|
-
import { SimpleMonacoEditor } from './MonacoEditor';
|
|
18
|
-
import { CodebytesCopyFormatter } from './types';
|
|
19
|
-
|
|
20
|
-
const Output = styled.pre<{ hasError: boolean }>`
|
|
21
|
-
width: 100%;
|
|
22
|
-
height: 100%;
|
|
23
|
-
margin: 0;
|
|
24
|
-
padding: 0 1rem;
|
|
25
|
-
font-family: Monaco;
|
|
26
|
-
font-size: 0.875rem;
|
|
27
|
-
overflow: auto;
|
|
28
|
-
${({ hasError, theme }) => `
|
|
29
|
-
color: ${hasError ? theme.colors.orange : theme.colors.text};
|
|
30
|
-
background-color: ${theme.colors['navy-900']};
|
|
31
|
-
`}
|
|
32
|
-
`;
|
|
33
|
-
|
|
34
|
-
const CopyIconStyled = styled(CopyIcon)`
|
|
35
|
-
margin-right: 0.5rem;
|
|
36
|
-
`;
|
|
37
|
-
|
|
38
|
-
const DOCKER_SIGTERM = 143;
|
|
39
|
-
|
|
40
|
-
type EditorProps = {
|
|
41
|
-
hideCopyButton: boolean;
|
|
42
|
-
language: LanguageOption;
|
|
43
|
-
text: string;
|
|
44
|
-
onChange: (text: string) => void;
|
|
45
|
-
snippetsBaseUrl?: string;
|
|
46
|
-
copyFormatter?: CodebytesCopyFormatter;
|
|
47
|
-
trackingData?: Omit<UserClickData, 'target'>;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const Editor: React.FC<EditorProps> = ({
|
|
51
|
-
language,
|
|
52
|
-
text,
|
|
53
|
-
hideCopyButton,
|
|
54
|
-
onChange,
|
|
55
|
-
copyFormatter,
|
|
56
|
-
snippetsBaseUrl,
|
|
57
|
-
trackingData,
|
|
58
|
-
}) => {
|
|
59
|
-
const [output, setOutput] = useState('');
|
|
60
|
-
const [status, setStatus] = useState<'ready' | 'waiting' | 'error'>('ready');
|
|
61
|
-
const [isCodeByteCopied, setIsCodeByteCopied] = useState(false);
|
|
62
|
-
const onCopyClick = () => {
|
|
63
|
-
if (!isCodeByteCopied) {
|
|
64
|
-
navigator.clipboard
|
|
65
|
-
.writeText(copyFormatter ? copyFormatter({ text, language }) : text)
|
|
66
|
-
|
|
67
|
-
// eslint-disable-next-line no-console
|
|
68
|
-
.catch(() => console.error('Failed to copy'));
|
|
69
|
-
setIsCodeByteCopied(true);
|
|
70
|
-
trackClick('copy', trackingData);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const setErrorStatusAndOutput = (message: string) => {
|
|
75
|
-
setOutput(message);
|
|
76
|
-
setStatus('error');
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const handleSubmit = async () => {
|
|
80
|
-
if (text.trim().length === 0) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const data = {
|
|
84
|
-
language,
|
|
85
|
-
code: text,
|
|
86
|
-
};
|
|
87
|
-
setStatus('waiting');
|
|
88
|
-
setOutput('');
|
|
89
|
-
trackClick('run', trackingData);
|
|
90
|
-
|
|
91
|
-
try {
|
|
92
|
-
const response = await postSnippet(data, snippetsBaseUrl);
|
|
93
|
-
if (response.stderr.length > 0) {
|
|
94
|
-
setErrorStatusAndOutput(response.stderr);
|
|
95
|
-
} else if (response.exit_code === DOCKER_SIGTERM) {
|
|
96
|
-
setErrorStatusAndOutput(
|
|
97
|
-
'Your code took too long to return a result. Double check your code for any issues and try again!'
|
|
98
|
-
);
|
|
99
|
-
} else if (response.exit_code !== 0) {
|
|
100
|
-
setErrorStatusAndOutput('An unknown error occured.');
|
|
101
|
-
} else {
|
|
102
|
-
setOutput(response.stdout);
|
|
103
|
-
setStatus('ready');
|
|
104
|
-
}
|
|
105
|
-
} catch (error) {
|
|
106
|
-
setErrorStatusAndOutput('Error: ' + error);
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
return (
|
|
111
|
-
<>
|
|
112
|
-
<Drawers
|
|
113
|
-
leftChild={
|
|
114
|
-
<SimpleMonacoEditor
|
|
115
|
-
value={text}
|
|
116
|
-
language={language}
|
|
117
|
-
onChange={onChange}
|
|
118
|
-
/>
|
|
119
|
-
}
|
|
120
|
-
rightChild={
|
|
121
|
-
<Output hasError={status === 'error'} aria-live="polite">
|
|
122
|
-
{output}
|
|
123
|
-
</Output>
|
|
124
|
-
}
|
|
125
|
-
/>
|
|
126
|
-
<FlexBox
|
|
127
|
-
justifyContent={hideCopyButton ? 'flex-end' : 'space-between'}
|
|
128
|
-
pl={8}
|
|
129
|
-
>
|
|
130
|
-
{!hideCopyButton ? (
|
|
131
|
-
<ToolTip
|
|
132
|
-
id="codebyte-copied"
|
|
133
|
-
alignment="top-right"
|
|
134
|
-
target={
|
|
135
|
-
<TextButton
|
|
136
|
-
variant="secondary"
|
|
137
|
-
onClick={onCopyClick}
|
|
138
|
-
onBlur={() => setIsCodeByteCopied(false)}
|
|
139
|
-
data-testid="copy-codebyte-btn"
|
|
140
|
-
>
|
|
141
|
-
<CopyIconStyled aria-hidden="true" /> Copy Codebyte
|
|
142
|
-
</TextButton>
|
|
143
|
-
}
|
|
144
|
-
>
|
|
145
|
-
{isCodeByteCopied ? (
|
|
146
|
-
<span data-testid="copy-confirmation-tooltip" role="alert">
|
|
147
|
-
Copied!
|
|
148
|
-
</span>
|
|
149
|
-
) : (
|
|
150
|
-
<span data-testid="copy-prompt-tooltip">
|
|
151
|
-
Copy to your clipboard
|
|
152
|
-
</span>
|
|
153
|
-
)}
|
|
154
|
-
</ToolTip>
|
|
155
|
-
) : null}
|
|
156
|
-
<FillButton onClick={handleSubmit}>
|
|
157
|
-
{status === 'waiting' ? <Spinner /> : 'Run'}
|
|
158
|
-
</FillButton>
|
|
159
|
-
</FlexBox>
|
|
160
|
-
</>
|
|
161
|
-
);
|
|
162
|
-
};
|
package/src/helpers/index.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { renderHook } from '@testing-library/react-hooks';
|
|
2
|
-
|
|
3
|
-
import { useEverInView } from './useEverInView';
|
|
4
|
-
|
|
5
|
-
const mockUseIntersection = jest.fn();
|
|
6
|
-
|
|
7
|
-
jest.mock('./useIntersection', () => ({
|
|
8
|
-
get useIntersection() {
|
|
9
|
-
return mockUseIntersection;
|
|
10
|
-
},
|
|
11
|
-
}));
|
|
12
|
-
|
|
13
|
-
const ref = { current: null };
|
|
14
|
-
|
|
15
|
-
describe('useEverInView', () => {
|
|
16
|
-
it('returns true after inView becomes false after true', async () => {
|
|
17
|
-
mockUseIntersection.mockReturnValueOnce(null);
|
|
18
|
-
const { result, rerender } = renderHook(() => useEverInView());
|
|
19
|
-
expect(result.current).toEqual({ everInView: false, ref });
|
|
20
|
-
|
|
21
|
-
mockUseIntersection.mockReturnValueOnce({ isIntersecting: true });
|
|
22
|
-
rerender();
|
|
23
|
-
expect(result.current).toEqual({ everInView: true, ref });
|
|
24
|
-
|
|
25
|
-
mockUseIntersection.mockReturnValueOnce({ isIntersecting: false });
|
|
26
|
-
rerender();
|
|
27
|
-
expect(result.current).toEqual({ everInView: true, ref });
|
|
28
|
-
});
|
|
29
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import { useIntersection } from './useIntersection';
|
|
4
|
-
|
|
5
|
-
// Set either rootMargin or threshold for your use case. The threshold
|
|
6
|
-
// will determine the amount of the element that needs to come into the viewport
|
|
7
|
-
// before the useEverInView hook is triggered. The rootMargin will determine the
|
|
8
|
-
// size of the root element's bounding box.
|
|
9
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#intersection_observer_options
|
|
10
|
-
export const useEverInView = (rootMargin = '0px', threshold = 0.2) => {
|
|
11
|
-
const ref = useRef(null);
|
|
12
|
-
const [everInView, setEverInView] = useState(false);
|
|
13
|
-
|
|
14
|
-
const intersection = useIntersection(ref, {
|
|
15
|
-
root: null,
|
|
16
|
-
rootMargin,
|
|
17
|
-
threshold,
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const inView = intersection?.isIntersecting;
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (inView) {
|
|
23
|
-
setEverInView(true);
|
|
24
|
-
}
|
|
25
|
-
}, [inView]);
|
|
26
|
-
|
|
27
|
-
return { everInView: Boolean(everInView || inView), ref };
|
|
28
|
-
};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { act, renderHook } from '@testing-library/react-hooks/dom';
|
|
2
|
-
|
|
3
|
-
import { useIntersection } from './useIntersection';
|
|
4
|
-
|
|
5
|
-
const originalIntersectionObserver = window.IntersectionObserver;
|
|
6
|
-
const mockObserve = jest.fn();
|
|
7
|
-
const mockDisconnect = jest.fn();
|
|
8
|
-
const mockIntersectionObserver = jest.fn();
|
|
9
|
-
const mockIntersectionObserverInstance = {
|
|
10
|
-
observe: mockObserve,
|
|
11
|
-
disconnect: mockDisconnect,
|
|
12
|
-
};
|
|
13
|
-
const ref = { current: document.createElement('div') };
|
|
14
|
-
const options = {
|
|
15
|
-
root: null,
|
|
16
|
-
rootMargin: '0px',
|
|
17
|
-
threshold: 0.2,
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
beforeEach(() => {
|
|
21
|
-
mockIntersectionObserver.mockReturnValue(mockIntersectionObserverInstance);
|
|
22
|
-
window.IntersectionObserver = mockIntersectionObserver;
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
afterEach(() => {
|
|
26
|
-
window.IntersectionObserver = originalIntersectionObserver;
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
describe('useIntersection', () => {
|
|
30
|
-
test('intersection observer is not called', async () => {
|
|
31
|
-
// We render useIntersection with ref.current = null,
|
|
32
|
-
// which should prevent our hook from calling intersectionObserver.
|
|
33
|
-
const hook = renderHook(() => useIntersection({ current: null }, options));
|
|
34
|
-
expect(mockObserve).not.toHaveBeenCalled();
|
|
35
|
-
|
|
36
|
-
hook.unmount();
|
|
37
|
-
expect(mockDisconnect).not.toHaveBeenCalled();
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
test('intersection observer is called', async () => {
|
|
41
|
-
// We render useIntersection with ref.current = HTMLdivElement,
|
|
42
|
-
// which should make our hook call intersectionObserver.
|
|
43
|
-
const hook = renderHook(() => useIntersection(ref, options));
|
|
44
|
-
expect(mockObserve).toHaveBeenCalledWith(ref.current);
|
|
45
|
-
|
|
46
|
-
hook.unmount();
|
|
47
|
-
expect(mockDisconnect).toHaveBeenCalled();
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('returns the IntersectionObserverEntry from the callback', async () => {
|
|
51
|
-
const fakeIntersectionObserverEntry = {};
|
|
52
|
-
let handler: Function = () => {
|
|
53
|
-
return null;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
// We mock the insersectionObserver Implementation
|
|
57
|
-
// to grab the handler, which allows us to simulate
|
|
58
|
-
// the element getting scrolled into view.
|
|
59
|
-
mockIntersectionObserver.mockImplementationOnce((cb) => {
|
|
60
|
-
handler = cb;
|
|
61
|
-
|
|
62
|
-
return mockIntersectionObserverInstance;
|
|
63
|
-
});
|
|
64
|
-
const { result, rerender, unmount } = renderHook(() =>
|
|
65
|
-
useIntersection(ref, options)
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
// Element hasn't been scrolled into view and therefore
|
|
69
|
-
// results.current should be null.
|
|
70
|
-
expect(result.current).toBeNull();
|
|
71
|
-
|
|
72
|
-
// Simulate element being scrolled into view
|
|
73
|
-
act(() => {
|
|
74
|
-
handler([fakeIntersectionObserverEntry]);
|
|
75
|
-
});
|
|
76
|
-
expect(result.current).toEqual(fakeIntersectionObserverEntry);
|
|
77
|
-
|
|
78
|
-
// We expect the results to remain the same after a rerender
|
|
79
|
-
rerender();
|
|
80
|
-
expect(result.current).toEqual(fakeIntersectionObserverEntry);
|
|
81
|
-
|
|
82
|
-
// The results should be null after unmounting.
|
|
83
|
-
unmount();
|
|
84
|
-
rerender();
|
|
85
|
-
expect(result.current).toBeNull();
|
|
86
|
-
});
|
|
87
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { RefObject, useEffect, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
export const useIntersection = (
|
|
4
|
-
ref: RefObject<HTMLElement>,
|
|
5
|
-
options: IntersectionObserverInit
|
|
6
|
-
): IntersectionObserverEntry | null => {
|
|
7
|
-
const [
|
|
8
|
-
intersectionObserverEntry,
|
|
9
|
-
setIntersectionObserverEntry,
|
|
10
|
-
] = useState<IntersectionObserverEntry | null>(null);
|
|
11
|
-
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
if (ref.current && typeof IntersectionObserver === 'function') {
|
|
14
|
-
const handler = (entries: IntersectionObserverEntry[]) => {
|
|
15
|
-
setIntersectionObserverEntry(entries[0]);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const observer = new IntersectionObserver(handler, {
|
|
19
|
-
threshold: options.threshold,
|
|
20
|
-
root: options.root,
|
|
21
|
-
rootMargin: options.rootMargin,
|
|
22
|
-
});
|
|
23
|
-
observer.observe(ref.current);
|
|
24
|
-
|
|
25
|
-
return () => {
|
|
26
|
-
setIntersectionObserverEntry(null);
|
|
27
|
-
observer.disconnect();
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
31
|
-
return () => {};
|
|
32
|
-
}, [ref, options.threshold, options.root, options.rootMargin]);
|
|
33
|
-
|
|
34
|
-
return intersectionObserverEntry;
|
|
35
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Select, Text } from '@codecademy/gamut';
|
|
2
|
-
import { ColorMode } from '@codecademy/gamut-styles';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
|
|
5
|
-
import type { LanguageOption } from './consts';
|
|
6
|
-
import { LanguageOptions } from './consts';
|
|
7
|
-
|
|
8
|
-
export type LanguageSelectionProps = {
|
|
9
|
-
onChange: (newLanguage: LanguageOption) => void;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const LanguageSelection: React.FC<LanguageSelectionProps> = ({
|
|
13
|
-
onChange,
|
|
14
|
-
}) => {
|
|
15
|
-
return (
|
|
16
|
-
<ColorMode mode="dark" flex={1} px={16} pt={48}>
|
|
17
|
-
<Text mb={16}>Which language do you want to code in?</Text>
|
|
18
|
-
<Select
|
|
19
|
-
id="language-select"
|
|
20
|
-
aria-label="Select a language"
|
|
21
|
-
options={LanguageOptions}
|
|
22
|
-
onChange={(e) => onChange(e.target.value as LanguageOption)}
|
|
23
|
-
/>
|
|
24
|
-
</ColorMode>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { createTracker } from '@codecademy/tracking';
|
|
2
|
-
|
|
3
|
-
const IS_DEV = process.env.NODE_ENV === 'development';
|
|
4
|
-
|
|
5
|
-
// TODO: confirm tracking details and implementation DISC-447
|
|
6
|
-
const tracker = createTracker({
|
|
7
|
-
apiBaseUrl:
|
|
8
|
-
typeof window === 'undefined'
|
|
9
|
-
? 'https://www.codecademy.com'
|
|
10
|
-
: window.location.origin,
|
|
11
|
-
verbose: IS_DEV,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export const {
|
|
15
|
-
click: trackUserClick,
|
|
16
|
-
visit: trackUserVisit,
|
|
17
|
-
impression: trackUserImpression,
|
|
18
|
-
} = tracker;
|
package/src/types.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { BackgroundProps } from '@codecademy/gamut-styles';
|
|
2
|
-
import { UserClickData } from '@codecademy/tracking';
|
|
3
|
-
|
|
4
|
-
import { LanguageOption } from './consts';
|
|
5
|
-
|
|
6
|
-
export interface CodebytesChangeHandler {
|
|
7
|
-
(text: string, language: LanguageOption): void;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface CodebytesCopyFormatterParams {
|
|
11
|
-
text: string;
|
|
12
|
-
language: LanguageOption;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type CodebytesCopyFormatter = ({
|
|
16
|
-
text,
|
|
17
|
-
language,
|
|
18
|
-
}: CodebytesCopyFormatterParams) => string;
|
|
19
|
-
|
|
20
|
-
export interface CodeByteEditorProps extends Omit<BackgroundProps, 'bg'> {
|
|
21
|
-
text?: string;
|
|
22
|
-
language?: LanguageOption;
|
|
23
|
-
hideCopyButton?: boolean;
|
|
24
|
-
copyFormatter?: CodebytesCopyFormatter;
|
|
25
|
-
snippetsBaseUrl?: string;
|
|
26
|
-
onEdit?: CodebytesChangeHandler;
|
|
27
|
-
onLanguageChange?: CodebytesChangeHandler;
|
|
28
|
-
trackingData?: Omit<UserClickData, 'target'>;
|
|
29
|
-
trackFirstEdit?: boolean;
|
|
30
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "./dist",
|
|
5
|
-
"esModuleInterop": true,
|
|
6
|
-
"jsx": "react",
|
|
7
|
-
"allowJs": true,
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"noUnusedParameters": false,
|
|
10
|
-
"sourceMap": true,
|
|
11
|
-
"strictFunctionTypes": false,
|
|
12
|
-
"strictPropertyInitialization": false
|
|
13
|
-
},
|
|
14
|
-
"include": ["src/**/*.ts", "src/**/*.tsx"],
|
|
15
|
-
"exclude": [
|
|
16
|
-
"./dist",
|
|
17
|
-
"jest.config.ts",
|
|
18
|
-
"**/*.spec.ts",
|
|
19
|
-
"**/*.test.ts",
|
|
20
|
-
"**/*.spec.tsx",
|
|
21
|
-
"**/*.test.tsx",
|
|
22
|
-
"**/*.spec.js",
|
|
23
|
-
"**/*.test.js",
|
|
24
|
-
"**/*.spec.jsx",
|
|
25
|
-
"**/*.test.jsx"
|
|
26
|
-
]
|
|
27
|
-
}
|
package/tsconfig.spec.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "../../dist/out-tsc",
|
|
5
|
-
"module": "commonjs",
|
|
6
|
-
"types": ["jest", "node"]
|
|
7
|
-
},
|
|
8
|
-
"include": [
|
|
9
|
-
"jest.config.ts",
|
|
10
|
-
"**/*.test.ts",
|
|
11
|
-
"**/*.spec.ts",
|
|
12
|
-
"**/*.test.tsx",
|
|
13
|
-
"**/*.spec.tsx",
|
|
14
|
-
"**/*.test.js",
|
|
15
|
-
"**/*.spec.js",
|
|
16
|
-
"**/*.test.jsx",
|
|
17
|
-
"**/*.spec.jsx",
|
|
18
|
-
"**/*.d.ts",
|
|
19
|
-
"src/__tests__/mocks.ts"
|
|
20
|
-
]
|
|
21
|
-
}
|