chaeditor 0.1.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/LICENSE.txt +21 -0
- package/README.ko.md +250 -0
- package/README.md +242 -0
- package/dist/core.cjs +1034 -0
- package/dist/core.d.mts +347 -0
- package/dist/core.d.ts +347 -0
- package/dist/core.mjs +988 -0
- package/dist/default-host.cjs +243 -0
- package/dist/default-host.d.mts +52 -0
- package/dist/default-host.d.ts +52 -0
- package/dist/default-host.mjs +239 -0
- package/dist/default-markdown-primitive-registry-B3PGEkqs.d.mts +12 -0
- package/dist/default-markdown-primitive-registry-CqzwhHj2.d.ts +12 -0
- package/dist/image-upload-kind-BJqItE_C.d.mts +18 -0
- package/dist/image-upload-kind-BJqItE_C.d.ts +18 -0
- package/dist/index.cjs +8736 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.mjs +8668 -0
- package/dist/markdown-editor-B1qvE40Z.d.mts +460 -0
- package/dist/markdown-editor-Ce6DpnQk.d.ts +460 -0
- package/dist/markdown-primitive-contract-BXsqbKwY.d.mts +124 -0
- package/dist/markdown-primitive-contract-BXsqbKwY.d.ts +124 -0
- package/dist/panda-primitives.cjs +1299 -0
- package/dist/panda-primitives.d.mts +21127 -0
- package/dist/panda-primitives.d.ts +21127 -0
- package/dist/panda-primitives.mjs +1285 -0
- package/dist/react.cjs +8558 -0
- package/dist/react.d.mts +35 -0
- package/dist/react.d.ts +35 -0
- package/dist/react.mjs +8531 -0
- package/dist/toolbar-preset-B9ttTEol.d.ts +236 -0
- package/dist/toolbar-preset-DIsQN390.d.mts +236 -0
- package/package.json +151 -0
- package/recipes/host-presets/README.md +16 -0
- package/recipes/host-presets/emotion-host-preset.tsx.template +109 -0
- package/recipes/host-presets/styled-components-host-preset.tsx.template +102 -0
- package/recipes/host-presets/tailwind-host-preset.tsx.template +116 -0
- package/recipes/host-presets/vanilla-extract-host-preset.tsx.template +116 -0
- package/styled-system/styles.css +3370 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import 'chaeditor/styles.css';
|
|
2
|
+
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
|
|
5
|
+
import { createChaeditorThemeVars } from 'chaeditor/core';
|
|
6
|
+
import {
|
|
7
|
+
Button,
|
|
8
|
+
Input,
|
|
9
|
+
MarkdownEditor,
|
|
10
|
+
Modal,
|
|
11
|
+
Popover,
|
|
12
|
+
Textarea,
|
|
13
|
+
Tooltip,
|
|
14
|
+
} from 'chaeditor/react';
|
|
15
|
+
|
|
16
|
+
const themeScope = css({
|
|
17
|
+
...createChaeditorThemeVars({
|
|
18
|
+
primary: '#0f766e',
|
|
19
|
+
primarySubtle: '#ccfbf1',
|
|
20
|
+
surface: '#f8fafc',
|
|
21
|
+
surfaceMuted: '#ecfeff',
|
|
22
|
+
text: '#0f172a',
|
|
23
|
+
textSubtle: '#475569',
|
|
24
|
+
sansFont: 'var(--app-font-sans), system-ui, sans-serif',
|
|
25
|
+
monoFont: "var(--font-d2coding), 'D2Coding', monospace",
|
|
26
|
+
}),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const hostButton = css({
|
|
30
|
+
background: '#ccfbf1',
|
|
31
|
+
borderColor: '#0f766e',
|
|
32
|
+
borderRadius: 20,
|
|
33
|
+
boxShadow: '0 1px 3px rgba(15, 23, 42, 0.12)',
|
|
34
|
+
color: '#0f172a',
|
|
35
|
+
fontWeight: 600,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const hostField = css({
|
|
39
|
+
background: '#ecfeff',
|
|
40
|
+
borderColor: '#0f766e',
|
|
41
|
+
borderRadius: 20,
|
|
42
|
+
color: '#0f172a',
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const hostPopoverPanel = css({
|
|
46
|
+
background: '#fff',
|
|
47
|
+
borderColor: '#0f766e',
|
|
48
|
+
borderRadius: 24,
|
|
49
|
+
boxShadow: '0 24px 48px rgba(15, 23, 42, 0.18)',
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const hostModalFrame = css({
|
|
53
|
+
background: '#fff',
|
|
54
|
+
borderColor: '#0f766e',
|
|
55
|
+
borderRadius: 28,
|
|
56
|
+
boxShadow: '0 24px 48px rgba(15, 23, 42, 0.24)',
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const hostModalBackdrop = css({
|
|
60
|
+
background: 'rgba(15, 23, 42, 0.55)',
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const hostTooltip = css({
|
|
64
|
+
background: '#0f766e',
|
|
65
|
+
borderColor: '#0f766e',
|
|
66
|
+
color: '#fff',
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const HostButton = props => <Button {...props} className={hostButton} />;
|
|
70
|
+
|
|
71
|
+
const HostInput = props => <Input {...props} className={hostField} />;
|
|
72
|
+
|
|
73
|
+
const HostTextarea = props => <Textarea {...props} className={hostField} />;
|
|
74
|
+
|
|
75
|
+
const HostPopover = props => (
|
|
76
|
+
<Popover
|
|
77
|
+
{...props}
|
|
78
|
+
panelClassName={hostPopoverPanel}
|
|
79
|
+
triggerClassName={hostButton}
|
|
80
|
+
/>
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
const HostModal = props => (
|
|
84
|
+
<Modal
|
|
85
|
+
{...props}
|
|
86
|
+
backdropClassName={hostModalBackdrop}
|
|
87
|
+
frameClassName={hostModalFrame}
|
|
88
|
+
/>
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
const HostTooltip = props => <Tooltip {...props} contentClassName={hostTooltip} />;
|
|
92
|
+
|
|
93
|
+
export const EmotionHostEditorPreset = () => (
|
|
94
|
+
<div css={themeScope}>
|
|
95
|
+
<MarkdownEditor
|
|
96
|
+
contentType="article"
|
|
97
|
+
onChange={() => {}}
|
|
98
|
+
primitiveRegistry={{
|
|
99
|
+
Button: HostButton,
|
|
100
|
+
Input: HostInput,
|
|
101
|
+
Modal: HostModal,
|
|
102
|
+
Popover: HostPopover,
|
|
103
|
+
Textarea: HostTextarea,
|
|
104
|
+
Tooltip: HostTooltip,
|
|
105
|
+
}}
|
|
106
|
+
value=""
|
|
107
|
+
/>
|
|
108
|
+
</div>
|
|
109
|
+
);
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import 'chaeditor/styles.css';
|
|
2
|
+
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
|
|
5
|
+
import { createChaeditorThemeVars } from 'chaeditor/core';
|
|
6
|
+
import {
|
|
7
|
+
Button,
|
|
8
|
+
Input,
|
|
9
|
+
MarkdownEditor,
|
|
10
|
+
Modal,
|
|
11
|
+
Popover,
|
|
12
|
+
Textarea,
|
|
13
|
+
Tooltip,
|
|
14
|
+
} from 'chaeditor/react';
|
|
15
|
+
|
|
16
|
+
const EditorThemeScope = styled.div(
|
|
17
|
+
createChaeditorThemeVars({
|
|
18
|
+
primary: '#0f766e',
|
|
19
|
+
primarySubtle: '#ccfbf1',
|
|
20
|
+
surface: '#f8fafc',
|
|
21
|
+
surfaceMuted: '#ecfeff',
|
|
22
|
+
text: '#0f172a',
|
|
23
|
+
textSubtle: '#475569',
|
|
24
|
+
sansFont: 'var(--app-font-sans), system-ui, sans-serif',
|
|
25
|
+
monoFont: "var(--font-d2coding), 'D2Coding', monospace",
|
|
26
|
+
}),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const HostButton = styled(Button)`
|
|
30
|
+
background: #ccfbf1;
|
|
31
|
+
border-color: #0f766e;
|
|
32
|
+
border-radius: 20px;
|
|
33
|
+
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
|
|
34
|
+
color: #0f172a;
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
const HostInput = styled(Input)`
|
|
39
|
+
background: #ecfeff;
|
|
40
|
+
border-color: #0f766e;
|
|
41
|
+
border-radius: 20px;
|
|
42
|
+
color: #0f172a;
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
const HostTextarea = styled(Textarea)`
|
|
46
|
+
background: #ecfeff;
|
|
47
|
+
border-color: #0f766e;
|
|
48
|
+
border-radius: 24px;
|
|
49
|
+
color: #0f172a;
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
const HostPopoverPanel = styled.div`
|
|
53
|
+
background: #fff;
|
|
54
|
+
border: 1px solid #0f766e;
|
|
55
|
+
border-radius: 24px;
|
|
56
|
+
box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
const HostModalFrameClass = 'host-modal-frame';
|
|
60
|
+
const HostModalBackdropClass = 'host-modal-backdrop';
|
|
61
|
+
const HostTooltipClass = 'host-tooltip';
|
|
62
|
+
|
|
63
|
+
const HostPopover = props => (
|
|
64
|
+
<Popover
|
|
65
|
+
{...props}
|
|
66
|
+
panelClassName={`${HostPopoverPanel.styledComponentId} ${props.panelClassName ?? ''}`.trim()}
|
|
67
|
+
triggerClassName={`${HostButton.styledComponentId} ${props.triggerClassName ?? ''}`.trim()}
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const HostModal = props => (
|
|
72
|
+
<Modal
|
|
73
|
+
{...props}
|
|
74
|
+
backdropClassName={`${HostModalBackdropClass} ${props.backdropClassName ?? ''}`.trim()}
|
|
75
|
+
frameClassName={`${HostModalFrameClass} ${props.frameClassName ?? ''}`.trim()}
|
|
76
|
+
/>
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
const HostTooltip = props => (
|
|
80
|
+
<Tooltip
|
|
81
|
+
{...props}
|
|
82
|
+
contentClassName={`${HostTooltipClass} ${props.contentClassName ?? ''}`.trim()}
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
export const StyledComponentsHostEditorPreset = () => (
|
|
87
|
+
<EditorThemeScope>
|
|
88
|
+
<MarkdownEditor
|
|
89
|
+
contentType="article"
|
|
90
|
+
onChange={() => {}}
|
|
91
|
+
primitiveRegistry={{
|
|
92
|
+
Button: HostButton,
|
|
93
|
+
Input: HostInput,
|
|
94
|
+
Modal: HostModal,
|
|
95
|
+
Popover: HostPopover,
|
|
96
|
+
Textarea: HostTextarea,
|
|
97
|
+
Tooltip: HostTooltip,
|
|
98
|
+
}}
|
|
99
|
+
value=""
|
|
100
|
+
/>
|
|
101
|
+
</EditorThemeScope>
|
|
102
|
+
);
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import 'chaeditor/styles.css';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
Input,
|
|
6
|
+
MarkdownEditor,
|
|
7
|
+
Modal,
|
|
8
|
+
Popover,
|
|
9
|
+
Textarea,
|
|
10
|
+
Tooltip,
|
|
11
|
+
} from 'chaeditor/react';
|
|
12
|
+
|
|
13
|
+
const HostButton = props => (
|
|
14
|
+
<Button
|
|
15
|
+
{...props}
|
|
16
|
+
className={[
|
|
17
|
+
'rounded-xl border border-teal-700 bg-teal-50 font-semibold text-teal-950 shadow-sm',
|
|
18
|
+
props.className ?? '',
|
|
19
|
+
]
|
|
20
|
+
.join(' ')
|
|
21
|
+
.trim()}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const HostInput = props => (
|
|
26
|
+
<Input
|
|
27
|
+
{...props}
|
|
28
|
+
className={[
|
|
29
|
+
'rounded-xl border border-teal-700 bg-cyan-50 text-slate-950 placeholder:text-slate-500',
|
|
30
|
+
props.className ?? '',
|
|
31
|
+
]
|
|
32
|
+
.join(' ')
|
|
33
|
+
.trim()}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const HostTextarea = props => (
|
|
38
|
+
<Textarea
|
|
39
|
+
{...props}
|
|
40
|
+
className={[
|
|
41
|
+
'rounded-2xl border border-teal-700 bg-cyan-50 text-slate-950 placeholder:text-slate-500',
|
|
42
|
+
props.className ?? '',
|
|
43
|
+
]
|
|
44
|
+
.join(' ')
|
|
45
|
+
.trim()}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const HostPopover = props => (
|
|
50
|
+
<Popover
|
|
51
|
+
{...props}
|
|
52
|
+
panelClassName={['rounded-2xl border border-teal-700 bg-white shadow-xl', props.panelClassName ?? '']
|
|
53
|
+
.join(' ')
|
|
54
|
+
.trim()}
|
|
55
|
+
triggerClassName={[
|
|
56
|
+
'rounded-xl border border-teal-700 bg-teal-50 text-teal-950',
|
|
57
|
+
props.triggerClassName ?? '',
|
|
58
|
+
]
|
|
59
|
+
.join(' ')
|
|
60
|
+
.trim()}
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
const HostModal = props => (
|
|
65
|
+
<Modal
|
|
66
|
+
{...props}
|
|
67
|
+
backdropClassName={['bg-slate-950/55', props.backdropClassName ?? ''].join(' ').trim()}
|
|
68
|
+
frameClassName={[
|
|
69
|
+
'rounded-[28px] border border-teal-700 bg-white shadow-2xl',
|
|
70
|
+
props.frameClassName ?? '',
|
|
71
|
+
]
|
|
72
|
+
.join(' ')
|
|
73
|
+
.trim()}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const HostTooltip = props => (
|
|
78
|
+
<Tooltip
|
|
79
|
+
{...props}
|
|
80
|
+
contentClassName={[
|
|
81
|
+
'rounded-lg border border-teal-700 bg-teal-700 text-white shadow-lg',
|
|
82
|
+
props.contentClassName ?? '',
|
|
83
|
+
]
|
|
84
|
+
.join(' ')
|
|
85
|
+
.trim()}
|
|
86
|
+
/>
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
export const TailwindHostEditorPreset = () => (
|
|
90
|
+
<div
|
|
91
|
+
className={[
|
|
92
|
+
'[--chaeditor-color-primary:#0f766e]',
|
|
93
|
+
'[--chaeditor-color-primary-subtle:#ccfbf1]',
|
|
94
|
+
'[--chaeditor-color-surface:#f8fafc]',
|
|
95
|
+
'[--chaeditor-color-surface-muted:#ecfeff]',
|
|
96
|
+
'[--chaeditor-color-text:#0f172a]',
|
|
97
|
+
'[--chaeditor-color-text-subtle:#475569]',
|
|
98
|
+
'[--chaeditor-font-sans:var(--app-font-sans),system-ui,sans-serif]',
|
|
99
|
+
'[--chaeditor-font-mono:var(--font-d2coding),D2Coding,monospace]',
|
|
100
|
+
].join(' ')}
|
|
101
|
+
>
|
|
102
|
+
<MarkdownEditor
|
|
103
|
+
contentType="article"
|
|
104
|
+
onChange={() => {}}
|
|
105
|
+
primitiveRegistry={{
|
|
106
|
+
Button: HostButton,
|
|
107
|
+
Input: HostInput,
|
|
108
|
+
Modal: HostModal,
|
|
109
|
+
Popover: HostPopover,
|
|
110
|
+
Textarea: HostTextarea,
|
|
111
|
+
Tooltip: HostTooltip,
|
|
112
|
+
}}
|
|
113
|
+
value=""
|
|
114
|
+
/>
|
|
115
|
+
</div>
|
|
116
|
+
);
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import 'chaeditor/styles.css';
|
|
2
|
+
|
|
3
|
+
import { style } from '@vanilla-extract/css';
|
|
4
|
+
|
|
5
|
+
import { createChaeditorThemeVars } from 'chaeditor/core';
|
|
6
|
+
import {
|
|
7
|
+
Button,
|
|
8
|
+
Input,
|
|
9
|
+
MarkdownEditor,
|
|
10
|
+
Modal,
|
|
11
|
+
Popover,
|
|
12
|
+
Textarea,
|
|
13
|
+
Tooltip,
|
|
14
|
+
} from 'chaeditor/react';
|
|
15
|
+
|
|
16
|
+
const themeScope = style({
|
|
17
|
+
vars: createChaeditorThemeVars({
|
|
18
|
+
primary: '#0f766e',
|
|
19
|
+
primarySubtle: '#ccfbf1',
|
|
20
|
+
surface: '#f8fafc',
|
|
21
|
+
surfaceMuted: '#ecfeff',
|
|
22
|
+
text: '#0f172a',
|
|
23
|
+
textSubtle: '#475569',
|
|
24
|
+
sansFont: 'var(--app-font-sans), system-ui, sans-serif',
|
|
25
|
+
monoFont: "var(--font-d2coding), 'D2Coding', monospace",
|
|
26
|
+
}),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const hostButton = style({
|
|
30
|
+
background: '#ccfbf1',
|
|
31
|
+
borderColor: '#0f766e',
|
|
32
|
+
borderRadius: 20,
|
|
33
|
+
boxShadow: '0 1px 3px rgba(15, 23, 42, 0.12)',
|
|
34
|
+
color: '#0f172a',
|
|
35
|
+
fontWeight: 600,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const hostField = style({
|
|
39
|
+
background: '#ecfeff',
|
|
40
|
+
borderColor: '#0f766e',
|
|
41
|
+
borderRadius: 20,
|
|
42
|
+
color: '#0f172a',
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const hostTextarea = style({
|
|
46
|
+
background: '#ecfeff',
|
|
47
|
+
borderColor: '#0f766e',
|
|
48
|
+
borderRadius: 24,
|
|
49
|
+
color: '#0f172a',
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const hostPopoverPanel = style({
|
|
53
|
+
background: '#fff',
|
|
54
|
+
border: '1px solid #0f766e',
|
|
55
|
+
borderRadius: 24,
|
|
56
|
+
boxShadow: '0 24px 48px rgba(15, 23, 42, 0.18)',
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const hostModalFrame = style({
|
|
60
|
+
background: '#fff',
|
|
61
|
+
border: '1px solid #0f766e',
|
|
62
|
+
borderRadius: 28,
|
|
63
|
+
boxShadow: '0 24px 48px rgba(15, 23, 42, 0.24)',
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const hostModalBackdrop = style({
|
|
67
|
+
background: 'rgba(15, 23, 42, 0.55)',
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const hostTooltip = style({
|
|
71
|
+
background: '#0f766e',
|
|
72
|
+
border: '1px solid #0f766e',
|
|
73
|
+
color: '#fff',
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const HostButton = props => <Button {...props} className={hostButton} />;
|
|
77
|
+
|
|
78
|
+
const HostInput = props => <Input {...props} className={hostField} />;
|
|
79
|
+
|
|
80
|
+
const HostTextarea = props => <Textarea {...props} className={hostTextarea} />;
|
|
81
|
+
|
|
82
|
+
const HostPopover = props => (
|
|
83
|
+
<Popover
|
|
84
|
+
{...props}
|
|
85
|
+
panelClassName={hostPopoverPanel}
|
|
86
|
+
triggerClassName={hostButton}
|
|
87
|
+
/>
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
const HostModal = props => (
|
|
91
|
+
<Modal
|
|
92
|
+
{...props}
|
|
93
|
+
backdropClassName={hostModalBackdrop}
|
|
94
|
+
frameClassName={hostModalFrame}
|
|
95
|
+
/>
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
const HostTooltip = props => <Tooltip {...props} contentClassName={hostTooltip} />;
|
|
99
|
+
|
|
100
|
+
export const VanillaExtractHostEditorPreset = () => (
|
|
101
|
+
<div className={themeScope}>
|
|
102
|
+
<MarkdownEditor
|
|
103
|
+
contentType="article"
|
|
104
|
+
onChange={() => {}}
|
|
105
|
+
primitiveRegistry={{
|
|
106
|
+
Button: HostButton,
|
|
107
|
+
Input: HostInput,
|
|
108
|
+
Modal: HostModal,
|
|
109
|
+
Popover: HostPopover,
|
|
110
|
+
Textarea: HostTextarea,
|
|
111
|
+
Tooltip: HostTooltip,
|
|
112
|
+
}}
|
|
113
|
+
value=""
|
|
114
|
+
/>
|
|
115
|
+
</div>
|
|
116
|
+
);
|