@mindlogic-ai/logician-ui 3.2.0-alpha.5 → 4.0.0-alpha.11

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.
Files changed (88) hide show
  1. package/dist/components/Icon/_utils/createIcon.d.ts.map +1 -1
  2. package/dist/components/Icon/_utils/createIcon.js +1 -0
  3. package/dist/components/Icon/_utils/createIcon.js.map +1 -1
  4. package/dist/components/Icon/_utils/createIcon.mjs +1 -0
  5. package/dist/components/Icon/_utils/createIcon.mjs.map +1 -1
  6. package/dist/components/Loaders/PageLoader.d.ts.map +1 -1
  7. package/dist/components/Loaders/PageLoader.js +2 -2
  8. package/dist/components/Loaders/PageLoader.js.map +1 -1
  9. package/dist/components/Loaders/PageLoader.mjs +2 -2
  10. package/dist/components/Loaders/PageLoader.mjs.map +1 -1
  11. package/dist/components/Loaders/SectionLoader.d.ts.map +1 -1
  12. package/dist/components/Loaders/SectionLoader.js +2 -2
  13. package/dist/components/Loaders/SectionLoader.js.map +1 -1
  14. package/dist/components/Loaders/SectionLoader.mjs +2 -2
  15. package/dist/components/Loaders/SectionLoader.mjs.map +1 -1
  16. package/dist/components/Tag/Tag.d.ts.map +1 -1
  17. package/dist/components/Tag/Tag.js +1 -1
  18. package/dist/components/Tag/Tag.js.map +1 -1
  19. package/dist/components/Tag/Tag.mjs +1 -1
  20. package/dist/components/Tag/Tag.mjs.map +1 -1
  21. package/dist/components/Tag/Tag.styles.d.ts.map +1 -1
  22. package/dist/components/Tag/Tag.styles.js +22 -16
  23. package/dist/components/Tag/Tag.styles.js.map +1 -1
  24. package/dist/components/Tag/Tag.styles.mjs +22 -16
  25. package/dist/components/Tag/Tag.styles.mjs.map +1 -1
  26. package/dist/components/Tree/Tree.d.ts +5 -1
  27. package/dist/components/Tree/Tree.d.ts.map +1 -1
  28. package/dist/components/Tree/Tree.types.d.ts +29 -1
  29. package/dist/components/Tree/Tree.types.d.ts.map +1 -1
  30. package/dist/components/Tree/TreeBranchIndentGuide.d.ts +5 -1
  31. package/dist/components/Tree/TreeBranchIndentGuide.d.ts.map +1 -1
  32. package/dist/components/Tree/TreeBranchIndentGuide.js +107 -8
  33. package/dist/components/Tree/TreeBranchIndentGuide.js.map +1 -1
  34. package/dist/components/Tree/TreeBranchIndentGuide.mjs +107 -8
  35. package/dist/components/Tree/TreeBranchIndentGuide.mjs.map +1 -1
  36. package/dist/components/Typography/Link.d.ts.map +1 -1
  37. package/dist/components/Typography/Link.js +6 -1
  38. package/dist/components/Typography/Link.js.map +1 -1
  39. package/dist/components/Typography/Link.mjs +6 -1
  40. package/dist/components/Typography/Link.mjs.map +1 -1
  41. package/dist/index.d.ts +0 -1
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +0 -2
  44. package/dist/index.js.map +1 -1
  45. package/dist/index.mjs +0 -1
  46. package/dist/index.mjs.map +1 -1
  47. package/dist/theme/global.d.ts.map +1 -1
  48. package/dist/theme/global.js +4 -1
  49. package/dist/theme/global.js.map +1 -1
  50. package/dist/theme/global.mjs +4 -1
  51. package/dist/theme/global.mjs.map +1 -1
  52. package/dist/theme/index.d.ts +1 -1
  53. package/dist/theme/index.d.ts.map +1 -1
  54. package/dist/theme/index.js +8 -4
  55. package/dist/theme/index.js.map +1 -1
  56. package/dist/theme/index.mjs +8 -4
  57. package/dist/theme/index.mjs.map +1 -1
  58. package/package.json +1 -3
  59. package/src/components/Icon/ICON_MANAGEMENT.md +1 -0
  60. package/src/components/Icon/Icon.stories.tsx +6 -2
  61. package/src/components/Icon/_utils/createIcon.tsx +1 -0
  62. package/src/components/Loaders/PageLoader.tsx +3 -5
  63. package/src/components/Loaders/SectionLoader.tsx +3 -2
  64. package/src/components/Tag/Tag.styles.ts +22 -16
  65. package/src/components/Tag/Tag.tsx +1 -0
  66. package/src/components/Tree/Tree.GuideElbow.stories.tsx +220 -0
  67. package/src/components/Tree/Tree.types.ts +29 -1
  68. package/src/components/Tree/TreeBranchIndentGuide.test.tsx +213 -0
  69. package/src/components/Tree/TreeBranchIndentGuide.tsx +137 -11
  70. package/src/components/Typography/Link.tsx +5 -1
  71. package/src/index.ts +0 -1
  72. package/src/theme/global.ts +4 -1
  73. package/src/theme/index.ts +8 -4
  74. package/dist/components/MDXEditor/MDXEditor.d.ts +0 -6
  75. package/dist/components/MDXEditor/MDXEditor.d.ts.map +0 -1
  76. package/dist/components/MDXEditor/MDXEditor.js +0 -237
  77. package/dist/components/MDXEditor/MDXEditor.js.map +0 -1
  78. package/dist/components/MDXEditor/MDXEditor.mjs +0 -235
  79. package/dist/components/MDXEditor/MDXEditor.mjs.map +0 -1
  80. package/dist/components/MDXEditor/MDXEditor.types.d.ts +0 -7
  81. package/dist/components/MDXEditor/MDXEditor.types.d.ts.map +0 -1
  82. package/dist/components/MDXEditor/index.d.ts +0 -3
  83. package/dist/components/MDXEditor/index.d.ts.map +0 -1
  84. package/src/components/MDXEditor/MDXEditor.css +0 -40
  85. package/src/components/MDXEditor/MDXEditor.stories.tsx +0 -56
  86. package/src/components/MDXEditor/MDXEditor.tsx +0 -337
  87. package/src/components/MDXEditor/MDXEditor.types.ts +0 -7
  88. package/src/components/MDXEditor/index.ts +0 -2
@@ -1,337 +0,0 @@
1
- 'use client';
2
-
3
- import { forwardRef, useImperativeHandle, useRef, useState } from 'react';
4
- import { Box, useToken } from '@chakra-ui/react';
5
- import {
6
- BlockTypeSelect,
7
- BoldItalicUnderlineToggles,
8
- CodeToggle,
9
- diffSourcePlugin,
10
- DiffSourceToggleWrapper,
11
- headingsPlugin,
12
- imagePlugin,
13
- InsertTable,
14
- InsertThematicBreak,
15
- linkPlugin,
16
- listsPlugin,
17
- ListsToggle,
18
- markdownShortcutPlugin,
19
- MDXEditor as Editor,
20
- MDXEditorMethods,
21
- MDXEditorProps as BaseEditorProps,
22
- quotePlugin,
23
- Separator,
24
- tablePlugin,
25
- thematicBreakPlugin,
26
- toolbarPlugin,
27
- UndoRedo,
28
- } from '@mdxeditor/editor';
29
-
30
- import '@mdxeditor/editor/style.css';
31
- import './MDXEditor.css';
32
-
33
- import type { MDXEditorProps } from './MDXEditor.types';
34
-
35
- export const MDXEditor = forwardRef<
36
- BaseEditorProps & MDXEditorMethods,
37
- MDXEditorProps
38
- >(({ containerProps, autoFocus = true, onError, ...rest }, ref) => {
39
- const [error, setError] = useState<string | null>(null);
40
-
41
- // Resolve theme tokens to actual values
42
- const [space1, space2, space4] = useToken('spacing', ['1', '2', '4']);
43
- const [radiusSm] = useToken('radii', ['sm']);
44
-
45
- // 내부적으로 Editor 인스턴스를 참조하기 위한 로컬 ref
46
- const editorRef = useRef<BaseEditorProps & MDXEditorMethods>(null);
47
-
48
- // 부모 컴포넌트로 전달된 ref가 editorRef를 바라보도록 연결
49
- useImperativeHandle(ref, () => editorRef.current!, []);
50
-
51
- const handleContainerClick = (e: React.MouseEvent) => {
52
- // Only focus if clicking on the container itself, not on toolbar and table elements
53
- const target = e.target as HTMLElement;
54
- const isToolbarClick = target.closest('.mdxeditor-toolbar');
55
- const isTableClick = target.closest('table');
56
- const isPopupClick = target.closest('.mdxeditor-popup-container');
57
-
58
- if (!isToolbarClick && !isTableClick && !isPopupClick) {
59
- editorRef.current?.focus();
60
- }
61
- };
62
-
63
- return (
64
- <Box
65
- width="100%"
66
- height="100%"
67
- borderWidth="1px"
68
- borderRadius="lg"
69
- overflow="hidden"
70
- onClick={handleContainerClick}
71
- cursor="text"
72
- {...containerProps}
73
- css={{
74
- /**
75
- * Chakra v3 css prop styling notes:
76
- *
77
- * 1. All nested selectors require '&' prefix (e.g., '& .class', '& h1')
78
- * 2. Use full CSS property names (background, padding) instead of Chakra
79
- * shorthand props (bg, p) in nested selectors
80
- * 3. Color values must be resolved via useToken(), not token strings
81
- * 4. Font sizes use responsive objects: { base: '2.4em', md: '3em' }
82
- * 5. List styles must be explicitly defined (listStyleType, etc.)
83
- *
84
- * These requirements differ from v2's sx prop, which was more implicit.
85
- * v3 prioritizes performance and explicitness over automatic handling.
86
- */
87
- ...containerProps?.css,
88
- '& .mdxeditor': {
89
- width: '100%',
90
- minHeight: '300px',
91
- height: '100%',
92
- background: 'var(--chakra-colors-bg-surface)',
93
- display: 'flex',
94
- flexDirection: 'column',
95
- },
96
- '& .mdxeditor-toolbar': {
97
- display: 'flex',
98
- gap: space2,
99
- padding: space2,
100
- borderBottomWidth: '1px',
101
- background: 'var(--chakra-colors-bg-subtle)',
102
- flexShrink: 0,
103
- cursor: 'default',
104
- },
105
- // Toolbar icons. mdxeditor colors its toolbar svgs with its own
106
- // `--baseTextContrast` (its internal slate scale), which doesn't follow
107
- // our color mode — in dark mode they stay near-black (#1c2024) and all
108
- // but vanish against the dark toolbar. Flip them onto the semantic
109
- // foreground token so they track light/dark like the editor body text.
110
- '& .mdxeditor-toolbar svg': {
111
- color: 'var(--chakra-colors-fg-default)',
112
- },
113
- // Disabled toolbar buttons (e.g. undo/redo with nothing to undo) — keep
114
- // them dimmed but still mode-aware, instead of mdxeditor's light-only
115
- // border color.
116
- '& .mdxeditor-toolbar [data-disabled] svg': {
117
- color: 'var(--chakra-colors-fg-subtle)',
118
- },
119
- // Hover / pressed / toggled-on backgrounds. mdxeditor paints these with
120
- // `--baseBgActive` (its slate scale), which also doesn't track the color
121
- // mode — in dark mode it goes light-grey, so the now-light icons sit on a
122
- // light fill and disappear on hover and when a format is active. Flip the
123
- // fill onto the semantic hover token so it stays mode-aware.
124
- '& .mdxeditor-toolbar button:hover, & .mdxeditor-toolbar button[data-state="on"], & .mdxeditor-toolbar button:active':
125
- {
126
- background: 'var(--chakra-colors-bg-muted)',
127
- },
128
- // Block-type select trigger in the toolbar — mdxeditor themes it with
129
- // its own vars (left white), so flip it onto the semantic surface.
130
- '& [class*="_selectTrigger_"]': {
131
- background: 'var(--chakra-colors-bg-surface)',
132
- color: 'var(--chakra-colors-fg-default)',
133
- },
134
- // Target the root contenteditable wrapper
135
- '& [class*="_rootContentEditableWrapper_"]': {
136
- flex: 1,
137
- display: 'flex',
138
- flexDirection: 'column',
139
- minHeight: 0,
140
- height: '100%',
141
- overflow: 'auto',
142
- },
143
- // Target the actual contenteditable element
144
- '& [contenteditable="true"]': {
145
- flex: 1,
146
- minHeight: '100%',
147
- outline: 'none',
148
- },
149
- // Target any intermediate wrapper elements
150
- '& [class*="_contentEditable_"]': {
151
- flex: 1,
152
- display: 'flex',
153
- flexDirection: 'column',
154
- },
155
- '& .content-editable': {
156
- padding: space4,
157
- color: 'var(--chakra-colors-fg-default)',
158
- display: 'flex',
159
- flexDirection: 'column',
160
- gap: radiusSm,
161
- flex: 1,
162
- height: '100%',
163
-
164
- '& h1, & h2, & h3, & h4, & h5': {
165
- marginBottom: '2px',
166
- fontWeight: 'bold',
167
- },
168
-
169
- '& h1:not(:first-child), & h2:not(:first-child), & h3:not(:first-child), & h4:not(:first-child)':
170
- {
171
- marginTop: space1,
172
- },
173
-
174
- /**
175
- * Font sizes - Cannot be tokenized due to responsive objects
176
- *
177
- * Unlike spacing/radii/colors, fontSize values here are responsive objects
178
- * { base: '2.4em', md: '3em' } which cannot be stored as regular tokens
179
- * in Chakra v3. Only textStyles support responsive values, but we cannot
180
- * extract just the fontSize from textStyles using useToken().
181
- *
182
- * These values match theme/index.ts textStyles exactly and must be
183
- * manually synchronized when updating the theme:
184
- * - h1: { base: '2.4em', md: '3em' }
185
- * - h2: { base: '2em', md: '2.5em' }
186
- * - h3: { base: '1.5em', md: '1.75em' }
187
- * - h4: { base: '1.25em', md: '1.44em' }
188
- * - h5: { base: '1.1em', md: '1.2em' }
189
- */
190
- '& h1': {
191
- fontSize: { base: '2.4em', md: '3em' },
192
- },
193
- '& h2': {
194
- fontSize: { base: '2em', md: '2.5em' },
195
- },
196
- '& h3': {
197
- fontSize: { base: '1.5em', md: '1.75em' },
198
- },
199
- '& h4': {
200
- fontSize: { base: '1.25em', md: '1.44em' },
201
- },
202
- '& h5': {
203
- fontSize: { base: '1.1em', md: '1.2em' },
204
- },
205
-
206
- /**
207
- * List styling - IMPORTANT: v3 requires explicit list-style properties
208
- *
209
- * In Chakra v2, the `sx` prop automatically preserved browser default list styles.
210
- * In Chakra v3, the `css` prop is more explicit and performant, but requires
211
- * manual specification of list styles to override MDXEditor's CSS resets.
212
- *
213
- * Required properties:
214
- * - listStyleType: 'disc' (ul) or 'decimal' (ol) - Shows bullets/numbers
215
- * - listStylePosition: 'outside' - Places markers outside content box
216
- * - display: 'list-item' (on li) - Ensures proper list item rendering
217
- *
218
- * Why this changed: v3 optimized for speed by removing automatic style inference,
219
- * requiring more explicit style declarations.
220
- */
221
- '& ul': {
222
- marginTop: space2,
223
- paddingInlineStart: space4,
224
- listStyleType: 'disc',
225
- listStylePosition: 'outside',
226
- },
227
-
228
- '& ol': {
229
- marginTop: space2,
230
- paddingInlineStart: space4,
231
- listStyleType: 'decimal',
232
- listStylePosition: 'outside',
233
- },
234
-
235
- '& li': {
236
- lineHeight: '1.5',
237
- marginBottom: space2,
238
- display: 'list-item',
239
- },
240
-
241
- '& blockquote': {
242
- borderLeftWidth: '4px',
243
- borderLeftColor: 'var(--chakra-colors-primary-light)',
244
- background: 'var(--chakra-colors-primary-lighter)',
245
- paddingLeft: space4,
246
- paddingBlock: space2,
247
- marginBlock: space4,
248
- color: 'var(--chakra-colors-fg-muted)',
249
- },
250
-
251
- '& a': {
252
- color: 'var(--chakra-colors-primary-main)',
253
- textDecoration: 'underline',
254
- },
255
-
256
- '& code': {
257
- fontFamily: 'mono',
258
- background: 'var(--chakra-colors-bg-muted)',
259
- paddingInline: space1,
260
- borderRadius: radiusSm,
261
-
262
- '& span': {
263
- background: 'transparent',
264
- },
265
- },
266
- },
267
- '& .mdxeditor-diff-source-wrapper': {
268
- overflow: 'auto',
269
- },
270
- }}
271
- >
272
- <Editor
273
- ref={editorRef}
274
- contentEditableClassName="content-editable"
275
- overlayContainer={
276
- typeof document !== 'undefined' ? document.body : undefined
277
- }
278
- autoFocus={autoFocus}
279
- onError={({ error }) => {
280
- setError(error);
281
- onError?.(error);
282
- }}
283
- plugins={[
284
- headingsPlugin({
285
- allowedHeadingLevels: [2, 3, 4, 5],
286
- }),
287
- linkPlugin(),
288
- listsPlugin(),
289
- imagePlugin(),
290
- quotePlugin(),
291
- thematicBreakPlugin(),
292
- markdownShortcutPlugin(),
293
- tablePlugin(),
294
- diffSourcePlugin(),
295
- toolbarPlugin({
296
- toolbarContents: () => (
297
- <>
298
- <UndoRedo />
299
-
300
- <Separator />
301
-
302
- <BoldItalicUnderlineToggles />
303
- <CodeToggle />
304
-
305
- <Separator />
306
-
307
- <ListsToggle />
308
-
309
- <Separator />
310
-
311
- <BlockTypeSelect />
312
-
313
- <Separator />
314
-
315
- <InsertTable />
316
-
317
- <InsertThematicBreak />
318
-
319
- {/* <CreateLink />
320
- <InsertImage /> */}
321
-
322
- {error && (
323
- <DiffSourceToggleWrapper options={['rich-text', 'source']}>
324
- <></>
325
- </DiffSourceToggleWrapper>
326
- )}
327
- </>
328
- ),
329
- }),
330
- ]}
331
- {...rest}
332
- />
333
- </Box>
334
- );
335
- });
336
-
337
- MDXEditor.displayName = 'MDXEditor';
@@ -1,7 +0,0 @@
1
- import { BoxProps } from '@chakra-ui/react';
2
- import { MDXEditorProps as BaseEditorProps } from '@mdxeditor/editor';
3
-
4
- export interface MDXEditorProps extends Omit<BaseEditorProps, 'onError'> {
5
- containerProps?: BoxProps;
6
- onError?: (error: string) => void;
7
- }
@@ -1,2 +0,0 @@
1
- export * from './MDXEditor';
2
- export * from './MDXEditor.types';