@team-monolith/cds 1.67.3 → 1.68.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.
@@ -2,15 +2,15 @@
2
2
  import { Theme } from "@emotion/react";
3
3
  export declare const light: Theme;
4
4
  export declare const dark: Theme;
5
- interface CodleDesignSystemContext {
5
+ interface CdsContext {
6
6
  theme?: Theme;
7
7
  lexical?: {
8
8
  uploadByFile: (file: File) => Promise<string>;
9
9
  };
10
10
  }
11
- export declare const CodleDesignSystemContext: import("react").Context<CodleDesignSystemContext>;
12
- export default function (props: {
11
+ export declare const CdsContext: import("react").Context<CdsContext>;
12
+ export declare function CdsProvider(props: {
13
13
  children: React.ReactNode;
14
14
  fontFamily?: string;
15
- } & CodleDesignSystemContext): React.ReactElement;
15
+ } & CdsContext): React.ReactElement;
16
16
  export {};
@@ -267,9 +267,8 @@ export const dark = {
267
267
  },
268
268
  },
269
269
  };
270
- export const CodleDesignSystemContext = createContext({});
271
- // eslint-disable-next-line import/no-anonymous-default-export
272
- export default function (props) {
270
+ export const CdsContext = createContext({});
271
+ export function CdsProvider(props) {
273
272
  const muiTheme = createTheme({
274
273
  typography: {
275
274
  fontFamily: props.fontFamily,
@@ -287,5 +286,5 @@ export default function (props) {
287
286
  body {
288
287
  font-family: ${FONT.pretendard};
289
288
  }
290
- ` }), _jsx(MuiThemeProvider, Object.assign({ theme: muiTheme }, { children: _jsx(ThemeProvider, Object.assign({ theme: theme }, { children: _jsx(CodleDesignSystemContext.Provider, Object.assign({ value: props }, { children: props.children })) })) }))] }));
289
+ ` }), _jsx(MuiThemeProvider, Object.assign({ theme: muiTheme }, { children: _jsx(ThemeProvider, Object.assign({ theme: theme }, { children: _jsx(CdsContext.Provider, Object.assign({ value: props }, { children: props.children })) })) }))] }));
291
290
  }
package/dist/index.d.ts CHANGED
@@ -34,8 +34,7 @@ export * from "./components/Tooltip";
34
34
  export { default as color } from "./foundation/color";
35
35
  export { default as shadows } from "./foundation/shadows";
36
36
  export * from "./foundation/breakpoints";
37
- export { default as CodleDesignSystemProvider } from "./CodleDesignSystemProvider";
38
- export * from "./CodleDesignSystemProvider";
37
+ export * from "./CdsProvider";
39
38
  export * from "./icons";
40
39
  export * from "./icons/Custom";
41
40
  export * from "./utils/hover";
package/dist/index.js CHANGED
@@ -34,8 +34,7 @@ export * from "./components/Tooltip";
34
34
  export { default as color } from "./foundation/color";
35
35
  export { default as shadows } from "./foundation/shadows";
36
36
  export * from "./foundation/breakpoints";
37
- export { default as CodleDesignSystemProvider } from "./CodleDesignSystemProvider";
38
- export * from "./CodleDesignSystemProvider";
37
+ export * from "./CdsProvider";
39
38
  export * from "./icons";
40
39
  export * from "./icons/Custom";
41
40
  export * from "./utils/hover";
@@ -10,7 +10,7 @@ import { HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin";
10
10
  import { OnChangePlugin } from "@lexical/react/LexicalOnChangePlugin";
11
11
  import LexicalErrorBoundary from "@lexical/react/LexicalErrorBoundary";
12
12
  import { MarkdownShortcutPlugin } from "@lexical/react/LexicalMarkdownShortcutPlugin";
13
- import { CODLE_TRANSFORMERS } from "./plugins/MarkdownTransformers";
13
+ import { CUSTOM_TRANSFORMERS } from "./plugins/MarkdownTransformers";
14
14
  import { ListPlugin } from "@lexical/react/LexicalListPlugin";
15
15
  import { TabIndentationPlugin } from "@lexical/react/LexicalTabIndentationPlugin";
16
16
  import { HorizontalRulePlugin } from "@lexical/react/LexicalHorizontalRulePlugin";
@@ -47,7 +47,7 @@ export default function Plugins(props) {
47
47
  onChange === null || onChange === void 0 ? void 0 : onChange(editorState.toJSON());
48
48
  },
49
49
  // ignore 하지 않으면 Form에서 수정하지 않았는데 Dirty로 처리됨.
50
- ignoreSelectionChange: true }), _jsx(AutoFocusPlugin, {}), isEditable && (_jsxs(_Fragment, { children: [_jsx(TabIndentationPlugin, {}), _jsx(ComponentPickerMenuPlugin, { isSheetEnabled: isSheetEnabled, isQuizEnabled: isQuizEnabled }), _jsx(MarkdownShortcutPlugin, { transformers: CODLE_TRANSFORMERS }), _jsx(HistoryPlugin, {})] })), floatingAnchorElem && isEditable && (_jsxs(_Fragment, { children: [_jsx(ComponentAdderPlugin, { anchorElem: floatingAnchorElem, isSheetEnabled: isSheetEnabled, isQuizEnabled: isQuizEnabled }), _jsx(FloatingTextFormatToolbarPlugin, { anchorElem: floatingAnchorElem }), _jsx(FloatingLinkEditorPlugin, { anchorElem: floatingAnchorElem, isLinkEditMode: isLinkEditMode, setIsLinkEditMode: setIsLinkEditMode })] })), !isEditable && _jsx(LexicalClickableLinkPlugin, {}), _jsx(ListPlugin, {}), _jsx(HorizontalRulePlugin, {}), _jsx(ImagesPlugin, {}), _jsx(TablePlugin, {}), _jsx(LinkPlugin, {}), _jsx(ListMaxIndentLevelPlugin, { maxDepth: 5 }), _jsx(ProblemInputPlugin, {}), _jsx(ProblemSelectPlugin, {}), _jsx(LayoutPlugin, {}), _jsx(SheetSelectPlugin, {}), _jsx(SheetInputPlugin, {}), _jsx(SelfEvaluationPlugin, {})] }));
50
+ ignoreSelectionChange: true }), _jsx(AutoFocusPlugin, {}), isEditable && (_jsxs(_Fragment, { children: [_jsx(TabIndentationPlugin, {}), _jsx(ComponentPickerMenuPlugin, { isSheetEnabled: isSheetEnabled, isQuizEnabled: isQuizEnabled }), _jsx(MarkdownShortcutPlugin, { transformers: CUSTOM_TRANSFORMERS }), _jsx(HistoryPlugin, {})] })), floatingAnchorElem && isEditable && (_jsxs(_Fragment, { children: [_jsx(ComponentAdderPlugin, { anchorElem: floatingAnchorElem, isSheetEnabled: isSheetEnabled, isQuizEnabled: isQuizEnabled }), _jsx(FloatingTextFormatToolbarPlugin, { anchorElem: floatingAnchorElem }), _jsx(FloatingLinkEditorPlugin, { anchorElem: floatingAnchorElem, isLinkEditMode: isLinkEditMode, setIsLinkEditMode: setIsLinkEditMode })] })), !isEditable && _jsx(LexicalClickableLinkPlugin, {}), _jsx(ListPlugin, {}), _jsx(HorizontalRulePlugin, {}), _jsx(ImagesPlugin, {}), _jsx(TablePlugin, {}), _jsx(LinkPlugin, {}), _jsx(ListMaxIndentLevelPlugin, { maxDepth: 5 }), _jsx(ProblemInputPlugin, {}), _jsx(ProblemSelectPlugin, {}), _jsx(LayoutPlugin, {}), _jsx(SheetSelectPlugin, {}), _jsx(SheetInputPlugin, {}), _jsx(SelfEvaluationPlugin, {})] }));
51
51
  }
52
52
  const ScrollArea = styled.div `
53
53
  min-height: 150px;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  import { useContext, useRef } from "react";
12
- import { Button, CodleDesignSystemContext } from "../../..";
12
+ import { Button, CdsContext } from "../../..";
13
13
  import { UploadLineIcon } from "../../../icons";
14
14
  import styled from "@emotion/styled";
15
15
  /**
@@ -20,7 +20,7 @@ import styled from "@emotion/styled";
20
20
  export function FileSelectInput(props) {
21
21
  const { onChange, accept } = props;
22
22
  const inputRef = useRef(null);
23
- const cdsContext = useContext(CodleDesignSystemContext);
23
+ const cdsContext = useContext(CdsContext);
24
24
  return (_jsxs(_Fragment, { children: [_jsx(Button, { fullWidth: true, color: "grey", size: "medium", label: "\uD30C\uC77C \uC120\uD0DD\uD558\uAE30", onClick: () => {
25
25
  var _a;
26
26
  (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
@@ -1,6 +1,6 @@
1
1
  import { createEditor } from "lexical";
2
2
  import { $convertToMarkdownString } from "@lexical/markdown";
3
- import { CODLE_TRANSFORMERS } from "./plugins/MarkdownTransformers";
3
+ import { CUSTOM_TRANSFORMERS } from "./plugins/MarkdownTransformers";
4
4
  import { nodes } from "./nodes";
5
5
  export function convertToMarkdown(serializedLexical, transformers) {
6
6
  // Create a Lexical editor instance
@@ -15,7 +15,7 @@ export function convertToMarkdown(serializedLexical, transformers) {
15
15
  // Convert the Lexical editor state to Markdown string
16
16
  let markdown = "";
17
17
  editor.update(() => {
18
- markdown = $convertToMarkdownString(transformers !== null && transformers !== void 0 ? transformers : CODLE_TRANSFORMERS);
18
+ markdown = $convertToMarkdownString(transformers !== null && transformers !== void 0 ? transformers : CUSTOM_TRANSFORMERS);
19
19
  });
20
20
  return markdown;
21
21
  }
@@ -10,5 +10,5 @@ export declare const HR: ElementTransformer;
10
10
  export declare const IMAGE: TextMatchTransformer;
11
11
  export declare const TABLE: ElementTransformer;
12
12
  export declare const IMAGE_LLM: TextMatchTransformer;
13
- export declare const CODLE_TRANSFORMERS: Array<Transformer>;
13
+ export declare const CUSTOM_TRANSFORMERS: Array<Transformer>;
14
14
  export declare const LLM_TRANSFORMERS: Array<Transformer>;
@@ -71,7 +71,7 @@ export const TABLE = {
71
71
  for (const cell of row.getChildren()) {
72
72
  // It's TableCellNode so it's just to make flow happy
73
73
  if ($isTableCellNode(cell)) {
74
- rowOutput.push($convertToMarkdownString(CODLE_TRANSFORMERS, cell).replace(/\n/g, "\\n"));
74
+ rowOutput.push($convertToMarkdownString(CUSTOM_TRANSFORMERS, cell).replace(/\n/g, "\\n"));
75
75
  if (cell.__headerState === TableCellHeaderStates.ROW) {
76
76
  isHeaderRow = true;
77
77
  }
@@ -164,7 +164,7 @@ function getTableColumnsSize(table) {
164
164
  const createTableCell = (textContent) => {
165
165
  textContent = textContent.replace(/\\n/g, "\n");
166
166
  const cell = $createTableCellNode(TableCellHeaderStates.NO_STATUS);
167
- $convertFromMarkdownString(textContent, CODLE_TRANSFORMERS, cell);
167
+ $convertFromMarkdownString(textContent, CUSTOM_TRANSFORMERS, cell);
168
168
  return cell;
169
169
  };
170
170
  const mapToTableCells = (textContent) => {
@@ -211,7 +211,7 @@ export const IMAGE_LLM = {
211
211
  trigger: ")",
212
212
  type: "text-match",
213
213
  };
214
- export const CODLE_TRANSFORMERS = [
214
+ export const CUSTOM_TRANSFORMERS = [
215
215
  TABLE,
216
216
  HR,
217
217
  IMAGE,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "1.67.3",
3
+ "version": "1.68.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,