vdc-editor 0.1.299 → 0.1.300
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/lib/BulkSpellChecker-BmlLXMl7.mjs +5 -0
- package/lib/BulkSpellChecker-BmlLXMl7.mjs.map +1 -0
- package/lib/{index-CV3Exi5p.mjs → index-Bknsqug1.mjs} +10765 -10441
- package/lib/index-Bknsqug1.mjs.map +1 -0
- package/lib/src/components/editor/ReadonlyViewer.vue.d.ts +136 -0
- package/lib/src/hooks/useDarkColorOverride.d.ts +11 -0
- package/lib/src/index.d.ts +2 -1
- package/lib/src/utils/dark-color-transform.d.ts +30 -0
- package/lib/src/utils/time-highlight-html.d.ts +5 -0
- package/lib/style.css +1 -1
- package/lib/vdc-editor.mjs +11 -10
- package/lib/vdc-editor.umd.js +81 -77
- package/lib/vdc-editor.umd.js.map +1 -1
- package/package.json +1 -1
- package/lib/BulkSpellChecker-BTF5ZdaT.mjs +0 -5
- package/lib/BulkSpellChecker-BTF5ZdaT.mjs.map +0 -1
- package/lib/index-CV3Exi5p.mjs.map +0 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { EditorMode } from '../../constants';
|
|
2
|
+
import { FieldName } from '../../type';
|
|
3
|
+
|
|
4
|
+
interface ReadonlyViewerProps {
|
|
5
|
+
/** HTML 또는 JSON 컨텐츠 (본문) */
|
|
6
|
+
content: string | object;
|
|
7
|
+
/** 앵커멘트 (report 모드) */
|
|
8
|
+
comment?: string | object;
|
|
9
|
+
/** 큐시트 앵커멘트 (report 모드) */
|
|
10
|
+
commentCuesheet?: string | object;
|
|
11
|
+
/** 에디터 모드 */
|
|
12
|
+
mode?: EditorMode;
|
|
13
|
+
/** 다크 모드 */
|
|
14
|
+
dark?: boolean;
|
|
15
|
+
/** 기본 폰트 크기 */
|
|
16
|
+
fontSizeDefault?: string;
|
|
17
|
+
/** 기본 폰트 패밀리 */
|
|
18
|
+
fontFamilyDefault?: string;
|
|
19
|
+
/** 기본 폰트 굵기 */
|
|
20
|
+
fontWeightDefault?: string;
|
|
21
|
+
/** 복사 시 줄바꿈 정책 */
|
|
22
|
+
blockSeparatorPolicy?: 'paragraph' | 'line';
|
|
23
|
+
/** 시제 하이라이트 활성화 */
|
|
24
|
+
timeHighlight?: boolean;
|
|
25
|
+
/** 추가 시제 단어 정규식 */
|
|
26
|
+
additionalTimeWords?: string[];
|
|
27
|
+
/** 추가 CSS 클래스 (wrapper) */
|
|
28
|
+
contentClass?: string | string[] | Record<string, unknown>;
|
|
29
|
+
/** 에디터 영역 CSS 클래스 (기존 editor-class 호환) */
|
|
30
|
+
editorClass?: string | string[] | Record<string, unknown>;
|
|
31
|
+
/** 최소 높이 */
|
|
32
|
+
minHeight?: string | number;
|
|
33
|
+
/** 최대 높이 */
|
|
34
|
+
maxHeight?: string | number;
|
|
35
|
+
/** 자동 높이 */
|
|
36
|
+
autoHeight?: boolean;
|
|
37
|
+
/** 복사 방지 (텍스트 선택, 복사, 우클릭 차단) */
|
|
38
|
+
preventCopy?: boolean;
|
|
39
|
+
/** 멘트 숨김 */
|
|
40
|
+
hideComment?: boolean;
|
|
41
|
+
/** 필드명 라벨 - 앵커멘트 */
|
|
42
|
+
fieldNameComment?: FieldName | null;
|
|
43
|
+
/** 필드명 라벨 - 큐시트 앵커멘트 */
|
|
44
|
+
fieldNameCommentCuesheet?: FieldName | null;
|
|
45
|
+
/** 필드명 라벨 - 기사내용 */
|
|
46
|
+
fieldNameContent?: FieldName | null;
|
|
47
|
+
}
|
|
48
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ReadonlyViewerProps>, {
|
|
49
|
+
comment: string;
|
|
50
|
+
commentCuesheet: string;
|
|
51
|
+
mode: EditorMode;
|
|
52
|
+
dark: undefined;
|
|
53
|
+
fontSizeDefault: string;
|
|
54
|
+
fontFamilyDefault: string;
|
|
55
|
+
fontWeightDefault: undefined;
|
|
56
|
+
blockSeparatorPolicy: string;
|
|
57
|
+
timeHighlight: boolean;
|
|
58
|
+
additionalTimeWords: () => never[];
|
|
59
|
+
contentClass: undefined;
|
|
60
|
+
editorClass: undefined;
|
|
61
|
+
minHeight: undefined;
|
|
62
|
+
maxHeight: undefined;
|
|
63
|
+
autoHeight: boolean;
|
|
64
|
+
preventCopy: boolean;
|
|
65
|
+
hideComment: boolean;
|
|
66
|
+
fieldNameComment: null;
|
|
67
|
+
fieldNameCommentCuesheet: null;
|
|
68
|
+
fieldNameContent: null;
|
|
69
|
+
}>>, {
|
|
70
|
+
getText: () => string;
|
|
71
|
+
getSelectedText: () => string;
|
|
72
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
73
|
+
"on-change-selection": (text: string) => void;
|
|
74
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ReadonlyViewerProps>, {
|
|
75
|
+
comment: string;
|
|
76
|
+
commentCuesheet: string;
|
|
77
|
+
mode: EditorMode;
|
|
78
|
+
dark: undefined;
|
|
79
|
+
fontSizeDefault: string;
|
|
80
|
+
fontFamilyDefault: string;
|
|
81
|
+
fontWeightDefault: undefined;
|
|
82
|
+
blockSeparatorPolicy: string;
|
|
83
|
+
timeHighlight: boolean;
|
|
84
|
+
additionalTimeWords: () => never[];
|
|
85
|
+
contentClass: undefined;
|
|
86
|
+
editorClass: undefined;
|
|
87
|
+
minHeight: undefined;
|
|
88
|
+
maxHeight: undefined;
|
|
89
|
+
autoHeight: boolean;
|
|
90
|
+
preventCopy: boolean;
|
|
91
|
+
hideComment: boolean;
|
|
92
|
+
fieldNameComment: null;
|
|
93
|
+
fieldNameCommentCuesheet: null;
|
|
94
|
+
fieldNameContent: null;
|
|
95
|
+
}>>> & Readonly<{
|
|
96
|
+
"onOn-change-selection"?: ((text: string) => any) | undefined;
|
|
97
|
+
}>, {
|
|
98
|
+
mode: EditorMode;
|
|
99
|
+
maxHeight: string | number;
|
|
100
|
+
additionalTimeWords: string[];
|
|
101
|
+
minHeight: string | number;
|
|
102
|
+
comment: string | object;
|
|
103
|
+
commentCuesheet: string | object;
|
|
104
|
+
hideComment: boolean;
|
|
105
|
+
fontSizeDefault: string;
|
|
106
|
+
fontFamilyDefault: string;
|
|
107
|
+
fontWeightDefault: string;
|
|
108
|
+
dark: boolean;
|
|
109
|
+
fieldNameComment: FieldName | null;
|
|
110
|
+
fieldNameCommentCuesheet: FieldName | null;
|
|
111
|
+
fieldNameContent: FieldName | null;
|
|
112
|
+
editorClass: string | string[] | Record<string, unknown>;
|
|
113
|
+
contentClass: string | string[] | Record<string, unknown>;
|
|
114
|
+
autoHeight: boolean;
|
|
115
|
+
blockSeparatorPolicy: "paragraph" | "line";
|
|
116
|
+
timeHighlight: boolean;
|
|
117
|
+
preventCopy: boolean;
|
|
118
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
119
|
+
export default _default;
|
|
120
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
121
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
122
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
123
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
124
|
+
} : {
|
|
125
|
+
type: import('vue').PropType<T[K]>;
|
|
126
|
+
required: true;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
type __VLS_WithDefaults<P, D> = {
|
|
130
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
131
|
+
default: D[K];
|
|
132
|
+
}> : P[K];
|
|
133
|
+
};
|
|
134
|
+
type __VLS_Prettify<T> = {
|
|
135
|
+
[K in keyof T]: T[K];
|
|
136
|
+
} & {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { Editor } from '@tiptap/vue-3';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 다크모드에서 ProseMirror 에디터 내 어두운 텍스트 색상을
|
|
6
|
+
* 동적 CSS 규칙으로 밝게 오버라이드하는 composable
|
|
7
|
+
*
|
|
8
|
+
* 다크모드 감지: dark prop 또는 부모 요소의 .dark 클래스 (Tailwind darkMode: 'class')
|
|
9
|
+
* ProseMirror 문서 모델을 수정하지 않고, CSS !important로 시각적 오버라이드만 수행
|
|
10
|
+
*/
|
|
11
|
+
export declare function useDarkColorOverride(editor: Editor, isDarkProp: Ref<boolean>, isArticleEditor: Ref<boolean>, containerRef: Ref<HTMLElement | null>): void;
|
package/lib/src/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { default as ArticleEditor } from './components/editor/ArticleEditor.vue'
|
|
|
4
4
|
import { default as DigitalNewsEditor } from './components/editor/DigitalNewsEditor.vue';
|
|
5
5
|
import { default as ArticleCompareEditor } from './components/editor/ArticleCompareEditor.vue';
|
|
6
6
|
import { default as SuperViewMobileEditor } from './components/editor/SuperViewMobileEditor.vue';
|
|
7
|
+
import { default as ReadonlyViewer } from './components/editor/ReadonlyViewer.vue';
|
|
7
8
|
|
|
8
9
|
declare const SBSEditorPlugin: Plugin;
|
|
9
10
|
declare function updateSuperTextView(): void;
|
|
@@ -17,5 +18,5 @@ export type { HistoryOptions } from '@tiptap/extension-history';
|
|
|
17
18
|
export { useEditor } from '@tiptap/vue-3';
|
|
18
19
|
export type { Editor as EditorInstance } from '@tiptap/core';
|
|
19
20
|
export { enUS, koKR } from './locales';
|
|
20
|
-
export { SBSEditorPlugin, CoreEditor, ArticleEditor, DigitalNewsEditor, ArticleCompareEditor, updateSuperTextView, SuperViewMobileEditor, };
|
|
21
|
+
export { SBSEditorPlugin, CoreEditor, ArticleEditor, DigitalNewsEditor, ArticleCompareEditor, updateSuperTextView, SuperViewMobileEditor, ReadonlyViewer, };
|
|
21
22
|
export default SBSEditorPlugin;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 다크모드에서 어두운 인라인 텍스트 색상을 밝게 변환하는 유틸리티
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* CSS 색상 문자열을 RGB로 파싱
|
|
6
|
+
* 지원 형식: #RGB, #RRGGBB, #RRGGBBAA, rgb(), rgba(), named colors
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseCssColor(color: string): {
|
|
9
|
+
r: number;
|
|
10
|
+
g: number;
|
|
11
|
+
b: number;
|
|
12
|
+
} | null;
|
|
13
|
+
/**
|
|
14
|
+
* WCAG 2.0 상대 휘도 계산 (0 = 검정, 1 = 흰색)
|
|
15
|
+
*/
|
|
16
|
+
export declare function getRelativeLuminance(r: number, g: number, b: number): number;
|
|
17
|
+
/**
|
|
18
|
+
* CSS 색상이 어두운지 판별
|
|
19
|
+
*/
|
|
20
|
+
export declare function isColorDark(color: string, threshold?: number): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* 어두운 색상을 다크모드용 밝은 색상으로 변환
|
|
23
|
+
* HSL 변환 후 L < 0.5이면 L = 1 - L 로 반전
|
|
24
|
+
*/
|
|
25
|
+
export declare function lightenDarkColor(color: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* HTML 문자열 내 인라인 color 스타일에서 어두운 색상을 밝게 변환
|
|
28
|
+
* DOMParser 패턴 사용 (time-highlight-html.ts 패턴과 동일)
|
|
29
|
+
*/
|
|
30
|
+
export declare function transformDarkColorsInHtml(html: string): string;
|