una-editor 0.3.1 → 0.4.0-alpha.1
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/README.en.md +35 -0
- package/README.md +35 -0
- package/dist/{index-Dn2Q7BsK.cjs → index-BOojJ3OI.cjs} +1 -1
- package/dist/{index-CKNMJCtD.cjs → index-BgLOUmiA.cjs} +1 -1
- package/dist/{index-CjgM0d_T.js → index-Bqasoc--.js} +1 -1
- package/dist/{index-tXgg464w.cjs → index-C1gtDi3_.cjs} +1 -1
- package/dist/{index-B5GoofdY.js → index-CViNGLKc.js} +4269 -3920
- package/dist/{index-CJVNADkB.js → index-DBiGHlN0.js} +1 -1
- package/dist/{index-D1m8iO5G.cjs → index-DWNPPFdZ.cjs} +48 -48
- package/dist/{index-CU6O_K-D.js → index-DsSHtx9e.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +9 -7
- package/dist/types/components/UnaEditor.vue.d.ts +1 -1
- package/dist/types/components/UnaEditor.vue.d.ts.map +1 -1
- package/dist/types/composables/useEditor.d.ts.map +1 -1
- package/dist/types/extensions/hybridMarkdown.d.ts +4 -1
- package/dist/types/extensions/hybridMarkdown.d.ts.map +1 -1
- package/dist/types/extensions/structuredTable.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/themes/editorThemes.d.ts +13 -0
- package/dist/types/themes/editorThemes.d.ts.map +1 -0
- package/dist/types/types/editor.d.ts +141 -1
- package/dist/types/types/editor.d.ts.map +1 -1
- package/dist/una-editor.css +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as D, E as h, C as L, s as H, t as n, a as B, b as K, i as M, d as f, f as OO, c as eO, e as iO, g as aO, h as nO, N as rO, I as QO, j as d } from "./index-
|
|
1
|
+
import { L as D, E as h, C as L, s as H, t as n, a as B, b as K, i as M, d as f, f as OO, c as eO, e as iO, g as aO, h as nO, N as rO, I as QO, j as d } from "./index-CViNGLKc.js";
|
|
2
2
|
const tO = 1, Z = 194, j = 195, oO = 196, x = 197, dO = 198, sO = 199, lO = 200, TO = 2, E = 3, u = 201, SO = 24, pO = 25, qO = 49, gO = 50, PO = 55, mO = 56, $O = 57, hO = 59, cO = 60, fO = 61, XO = 62, yO = 63, zO = 65, WO = 238, vO = 71, RO = 241, kO = 242, _O = 243, xO = 244, uO = 245, UO = 246, bO = 247, VO = 248, Y = 72, GO = 249, wO = 250, ZO = 251, jO = 252, EO = 253, YO = 254, FO = 255, CO = 256, JO = 73, AO = 77, NO = 263, IO = 112, DO = 130, LO = 151, HO = 152, BO = 155, p = 10, q = 13, k = 32, c = 9, _ = 35, KO = 40, MO = 46, R = 123, U = 125, F = 39, C = 34, b = 92, Oe = 111, ee = 120, ie = 78, ae = 117, ne = 85, re = /* @__PURE__ */ new Set([
|
|
3
3
|
pO,
|
|
4
4
|
qO,
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DWNPPFdZ.cjs");exports.UnaEditor=e.UnaEditor;exports.darkEditorTheme=e.darkEditorTheme;exports.defaultLocale=e.defaultLocale;exports.defineLocale=e.defineLocale;exports.enUS=e.enUS;exports.lightEditorTheme=e.lightEditorTheme;exports.locales=e.locales;exports.version=e.version;exports.zhCN=e.zhCN;
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { U as s, n as o, o as
|
|
1
|
+
import { U as s, n as o, o as r, q as d, r as i, u as l, v as t, w as n, z as h } from "./index-CViNGLKc.js";
|
|
2
2
|
export {
|
|
3
3
|
s as UnaEditor,
|
|
4
|
-
o as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
o as darkEditorTheme,
|
|
5
|
+
r as defaultLocale,
|
|
6
|
+
d as defineLocale,
|
|
7
|
+
i as enUS,
|
|
8
|
+
l as lightEditorTheme,
|
|
9
|
+
t as locales,
|
|
10
|
+
n as version,
|
|
11
|
+
h as zhCN
|
|
10
12
|
};
|
|
@@ -20,7 +20,7 @@ declare const __VLS_export: import("vue").DefineComponent<EditorProps, EditorExp
|
|
|
20
20
|
livePreview: boolean;
|
|
21
21
|
vimMode: boolean;
|
|
22
22
|
locale: string | import("..").CustomLocale;
|
|
23
|
-
theme: "light" | "dark";
|
|
23
|
+
theme: "light" | "dark" | import("..").EditorTheme;
|
|
24
24
|
codeTheme: "auto" | import("../types/editor").CodeThemeName;
|
|
25
25
|
codeLineNumbers: boolean;
|
|
26
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnaEditor.vue.d.ts","sourceRoot":"","sources":["../../../src/components/UnaEditor.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UnaEditor.vue.d.ts","sourceRoot":"","sources":["../../../src/components/UnaEditor.vue"],"names":[],"mappings":"AA0KA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAqLlE,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;6EAKhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditor.d.ts","sourceRoot":"","sources":["../../../src/composables/useEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAsD,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"useEditor.d.ts","sourceRoot":"","sources":["../../../src/composables/useEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAsD,MAAM,kBAAkB,CAAC;AAmBlG,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAa,MAAM,iBAAiB,CAAC;AA6CvE,wBAAgB,SAAS,CACvB,SAAS,EAAE,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,EACvC,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE;IACJ,CAAC,CAAC,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9C,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACnB,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;CAClC;;;wBAoWwB,MAAM;yBAOL,UAAU,GAAG,SAAS;uBAItB,MAAM;uBAkBR,OAAO,EAAE;+BAwBC,MAAM;;;EAoDzC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type Extension } from '@codemirror/state';
|
|
2
|
+
import type { EditorThemeContent, RenderHooks } from '../types/editor';
|
|
2
3
|
export declare const remeasureEffect: import("@codemirror/state").StateEffectType<null>;
|
|
3
4
|
export declare function setupVimLogicalNavigation(): void;
|
|
4
|
-
export declare
|
|
5
|
+
export declare const HYBRID_BASE_THEME: Extension;
|
|
6
|
+
export declare function createContentTheme(content: EditorThemeContent): Extension;
|
|
7
|
+
export declare function createLivePreviewExtensions(renderHooks?: RenderHooks): Extension;
|
|
5
8
|
export declare function createCodeDecorationExtension(): Extension;
|
|
6
9
|
//# sourceMappingURL=hybridMarkdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hybridMarkdown.d.ts","sourceRoot":"","sources":["../../../src/extensions/hybridMarkdown.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,SAAS,EAAc,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"hybridMarkdown.d.ts","sourceRoot":"","sources":["../../../src/extensions/hybridMarkdown.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,SAAS,EAAc,MAAM,mBAAmB,CAAC;AAIlF,OAAO,KAAK,EACV,kBAAkB,EAOlB,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAIzB,eAAO,MAAM,eAAe,mDAA6B,CAAC;AAI1D,wBAAgB,yBAAyB,SAoDxC;AA6FD,eAAO,MAAM,iBAAiB,WAoE5B,CAAC;AAEH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,GAAG,SAAS,CAgCzE;AA01BD,wBAAgB,2BAA2B,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,SAAS,CAYhF;AA4CD,wBAAgB,6BAA6B,IAAI,SAAS,CAMzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structuredTable.d.ts","sourceRoot":"","sources":["../../../src/extensions/structuredTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+D,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAChH,OAAO,EAAc,UAAU,EAAwE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"structuredTable.d.ts","sourceRoot":"","sources":["../../../src/extensions/structuredTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+D,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAChH,OAAO,EAAc,UAAU,EAAwE,MAAM,kBAAkB,CAAC;AAkyDhI,wBAAgB,oCAAoC,CAClD,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,EACjB,OAAO,EAAE,OAAO,EAChB,QAAQ,SAAiC,GACxC,OAAO,CAiCT;AA41BD,wBAAgB,uBAAuB,IAAI,IAAI,CAG9C;AA+ED,wBAAgB,+BAA+B,IAAI,SAAS,CA2B3D;AAED,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAElF"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const version: string;
|
|
2
2
|
export { default as UnaEditor } from './components/UnaEditor.vue';
|
|
3
|
-
export type { EditorProps, EditorEvents, EditorExposed, CustomLocale, Locale, } from './types/editor';
|
|
3
|
+
export type { EditorTheme, EditorThemeContent, EditorThemeContentOverrides, EditorThemeTable, EditorProps, EditorEvents, EditorExposed, ImageRenderContext, ImageRenderResult, LinkRenderContext, LinkRenderResult, RenderHooks, CustomLocale, Locale, } from './types/editor';
|
|
4
|
+
export { darkEditorTheme, lightEditorTheme } from './themes/editorThemes';
|
|
4
5
|
export { locales, defaultLocale, defineLocale, zhCN, enUS } from './locales';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,QAAyB,CAAC;AAG9C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAGlE,YAAY,EACV,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,MAAM,GACP,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,QAAyB,CAAC;AAG9C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAGlE,YAAY,EACV,WAAW,EACX,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,MAAM,GACP,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG1E,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Extension } from '@codemirror/state';
|
|
2
|
+
import type { EditorTheme, EditorThemeContent, EditorThemeTable } from '../types/editor';
|
|
3
|
+
export interface ResolvedEditorTheme {
|
|
4
|
+
name: string;
|
|
5
|
+
type: 'light' | 'dark';
|
|
6
|
+
chrome: Extension;
|
|
7
|
+
content: EditorThemeContent;
|
|
8
|
+
table: EditorThemeTable;
|
|
9
|
+
}
|
|
10
|
+
export declare const lightEditorTheme: EditorTheme;
|
|
11
|
+
export declare const darkEditorTheme: EditorTheme;
|
|
12
|
+
export declare function resolveEditorTheme(theme: 'light' | 'dark' | EditorTheme | undefined): ResolvedEditorTheme;
|
|
13
|
+
//# sourceMappingURL=editorThemes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editorThemes.d.ts","sourceRoot":"","sources":["../../../src/themes/editorThemes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEzF,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,KAAK,EAAE,gBAAgB,CAAC;CACzB;AAED,eAAO,MAAM,gBAAgB,EAAE,WAmC9B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,WAmC7B,CAAC;AA0CF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,GAChD,mBAAmB,CAuBrB"}
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
import type { EditorView } from '@codemirror/view';
|
|
2
|
+
/**
|
|
3
|
+
* Shared document position for render hook contexts.
|
|
4
|
+
*/
|
|
5
|
+
export interface RenderHookPosition {
|
|
6
|
+
from: number;
|
|
7
|
+
to: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Inline style object accepted by render hooks.
|
|
11
|
+
*/
|
|
12
|
+
export interface RenderHookStyle {
|
|
13
|
+
[property: string]: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Dataset object accepted by render hooks.
|
|
17
|
+
*/
|
|
18
|
+
export interface RenderHookDataset {
|
|
19
|
+
[key: string]: string;
|
|
20
|
+
}
|
|
2
21
|
export type CodeThemeName = 'one-dark' | 'dracula' | 'monokai' | 'solarized-dark' | 'nord' | 'tokyo-night' | 'github-light' | 'solarized-light' | 'atom-one-light';
|
|
3
22
|
export interface CodeThemeColors {
|
|
4
23
|
background: string;
|
|
@@ -25,17 +44,138 @@ export interface CodeTheme {
|
|
|
25
44
|
type: 'light' | 'dark';
|
|
26
45
|
colors: CodeThemeColors;
|
|
27
46
|
}
|
|
47
|
+
export interface EditorThemeHeadingStyle {
|
|
48
|
+
fontSize: string;
|
|
49
|
+
fontWeight: string;
|
|
50
|
+
lineHeight: string;
|
|
51
|
+
}
|
|
52
|
+
export interface EditorThemeLinkStyle {
|
|
53
|
+
color: string;
|
|
54
|
+
textDecoration: string;
|
|
55
|
+
textUnderlineOffset: string;
|
|
56
|
+
}
|
|
57
|
+
export interface EditorThemeInlineCodeStyle {
|
|
58
|
+
backgroundColor: string;
|
|
59
|
+
borderRadius: string;
|
|
60
|
+
padding: string;
|
|
61
|
+
}
|
|
62
|
+
export interface EditorThemeBlockquoteStyle {
|
|
63
|
+
borderColor: string;
|
|
64
|
+
backgroundColor: string;
|
|
65
|
+
paddingLeft: string;
|
|
66
|
+
fontStyle: string;
|
|
67
|
+
}
|
|
68
|
+
export interface EditorThemeSyntaxMarkStyle {
|
|
69
|
+
color: string;
|
|
70
|
+
}
|
|
71
|
+
export interface EditorThemeListMarkerStyle {
|
|
72
|
+
color: string;
|
|
73
|
+
}
|
|
74
|
+
export interface EditorThemeTaskCheckboxStyle {
|
|
75
|
+
accentColor: string;
|
|
76
|
+
}
|
|
77
|
+
export interface EditorThemeContent {
|
|
78
|
+
heading1: EditorThemeHeadingStyle;
|
|
79
|
+
heading2: EditorThemeHeadingStyle;
|
|
80
|
+
heading3: EditorThemeHeadingStyle;
|
|
81
|
+
heading4: EditorThemeHeadingStyle;
|
|
82
|
+
heading5: EditorThemeHeadingStyle;
|
|
83
|
+
heading6: EditorThemeHeadingStyle;
|
|
84
|
+
link: EditorThemeLinkStyle;
|
|
85
|
+
emphasis: {
|
|
86
|
+
fontStyle: string;
|
|
87
|
+
};
|
|
88
|
+
strong: {
|
|
89
|
+
fontWeight: string;
|
|
90
|
+
};
|
|
91
|
+
inlineCode: EditorThemeInlineCodeStyle;
|
|
92
|
+
blockquote: EditorThemeBlockquoteStyle;
|
|
93
|
+
syntaxMark: EditorThemeSyntaxMarkStyle;
|
|
94
|
+
listMarker: EditorThemeListMarkerStyle;
|
|
95
|
+
taskCheckbox: EditorThemeTaskCheckboxStyle;
|
|
96
|
+
}
|
|
97
|
+
export interface EditorThemeTable {
|
|
98
|
+
headerBackground: string;
|
|
99
|
+
}
|
|
100
|
+
export interface EditorThemeContentOverrides {
|
|
101
|
+
heading1?: Partial<EditorThemeHeadingStyle>;
|
|
102
|
+
heading2?: Partial<EditorThemeHeadingStyle>;
|
|
103
|
+
heading3?: Partial<EditorThemeHeadingStyle>;
|
|
104
|
+
heading4?: Partial<EditorThemeHeadingStyle>;
|
|
105
|
+
heading5?: Partial<EditorThemeHeadingStyle>;
|
|
106
|
+
heading6?: Partial<EditorThemeHeadingStyle>;
|
|
107
|
+
link?: Partial<EditorThemeLinkStyle>;
|
|
108
|
+
emphasis?: Partial<EditorThemeContent['emphasis']>;
|
|
109
|
+
strong?: Partial<EditorThemeContent['strong']>;
|
|
110
|
+
inlineCode?: Partial<EditorThemeInlineCodeStyle>;
|
|
111
|
+
blockquote?: Partial<EditorThemeBlockquoteStyle>;
|
|
112
|
+
syntaxMark?: Partial<EditorThemeSyntaxMarkStyle>;
|
|
113
|
+
listMarker?: Partial<EditorThemeListMarkerStyle>;
|
|
114
|
+
taskCheckbox?: Partial<EditorThemeTaskCheckboxStyle>;
|
|
115
|
+
}
|
|
116
|
+
export interface EditorTheme {
|
|
117
|
+
name?: string;
|
|
118
|
+
type: 'light' | 'dark';
|
|
119
|
+
content?: EditorThemeContentOverrides;
|
|
120
|
+
table?: Partial<EditorThemeTable>;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Context passed to image render hooks.
|
|
124
|
+
*/
|
|
125
|
+
export interface ImageRenderContext {
|
|
126
|
+
src: string;
|
|
127
|
+
alt: string;
|
|
128
|
+
title?: string;
|
|
129
|
+
raw: string;
|
|
130
|
+
position: RenderHookPosition;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Partial render result returned from image render hooks.
|
|
134
|
+
*/
|
|
135
|
+
export interface ImageRenderResult {
|
|
136
|
+
src: string;
|
|
137
|
+
className?: string;
|
|
138
|
+
dataset?: RenderHookDataset;
|
|
139
|
+
style?: RenderHookStyle;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Context passed to link render hooks.
|
|
143
|
+
*/
|
|
144
|
+
export interface LinkRenderContext {
|
|
145
|
+
href: string;
|
|
146
|
+
text: string;
|
|
147
|
+
title?: string;
|
|
148
|
+
raw: string;
|
|
149
|
+
position: RenderHookPosition;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Partial render result returned from link render hooks.
|
|
153
|
+
*/
|
|
154
|
+
export interface LinkRenderResult {
|
|
155
|
+
href: string;
|
|
156
|
+
className?: string;
|
|
157
|
+
dataset?: RenderHookDataset;
|
|
158
|
+
style?: RenderHookStyle;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Optional render-time hooks for live preview elements.
|
|
162
|
+
*/
|
|
163
|
+
export interface RenderHooks {
|
|
164
|
+
image?: (context: ImageRenderContext) => Partial<ImageRenderResult> | void;
|
|
165
|
+
link?: (context: LinkRenderContext) => Partial<LinkRenderResult> | void;
|
|
166
|
+
}
|
|
28
167
|
export interface EditorProps {
|
|
29
168
|
modelValue: string;
|
|
30
169
|
lineNumbers?: boolean;
|
|
31
170
|
lineWrap?: boolean;
|
|
32
171
|
livePreview?: boolean;
|
|
172
|
+
renderHooks?: RenderHooks;
|
|
33
173
|
vimMode?: boolean;
|
|
34
174
|
locale?: string | CustomLocale;
|
|
35
175
|
placeholder?: string;
|
|
36
176
|
disabled?: boolean;
|
|
37
177
|
readonly?: boolean;
|
|
38
|
-
theme?: 'light' | 'dark';
|
|
178
|
+
theme?: 'light' | 'dark' | EditorTheme;
|
|
39
179
|
fontFamily?: string;
|
|
40
180
|
codeFontFamily?: string;
|
|
41
181
|
fontSize?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../src/types/editor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../src/types/editor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;G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AC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,YAAY,CAAC"}
|
package/dist/una-editor.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.una-editor[data-v-
|
|
1
|
+
.una-editor[data-v-dcdb2472]{width:100%;height:100%;min-height:200px;position:relative}.una-editor-fullscreen-browser[data-v-dcdb2472]{position:fixed;inset:0;z-index:9999;background:#fff}.una-editor-fullscreen-tip[data-v-dcdb2472]{position:absolute;top:20px;left:50%;transform:translate(-50%);background:#000c;color:#fff;padding:12px 24px;border-radius:8px;font-size:14px;z-index:10000;pointer-events:none;box-shadow:0 4px 12px #0000004d}.fade-enter-active[data-v-dcdb2472],.fade-leave-active[data-v-dcdb2472]{transition:opacity .3s ease}.fade-enter-from[data-v-dcdb2472],.fade-leave-to[data-v-dcdb2472]{opacity:0}
|
package/package.json
CHANGED