@coze-editor/preset-universal 0.1.0-alpha.09ffeb
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 +21 -0
- package/dist/esm/index.js +76 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/index.d.mts +31 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -0
- package/package.json +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 coze-dev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { updateWholeDecorations } from "@coze-editor/extensions";
|
|
3
|
+
import {
|
|
4
|
+
focus,
|
|
5
|
+
blur,
|
|
6
|
+
setValue,
|
|
7
|
+
getValue,
|
|
8
|
+
eventChange,
|
|
9
|
+
disableKeybindings,
|
|
10
|
+
placeholder,
|
|
11
|
+
replaceText,
|
|
12
|
+
editable,
|
|
13
|
+
readOnly,
|
|
14
|
+
fontSize,
|
|
15
|
+
eventFocus,
|
|
16
|
+
focusChangeNotifier,
|
|
17
|
+
disableKeybindingsField,
|
|
18
|
+
getCursorPosition,
|
|
19
|
+
setCursorPosition,
|
|
20
|
+
eventBlur,
|
|
21
|
+
lineWrapping,
|
|
22
|
+
eventSelectionChange,
|
|
23
|
+
height,
|
|
24
|
+
minHeight,
|
|
25
|
+
maxHeight,
|
|
26
|
+
undo,
|
|
27
|
+
redo,
|
|
28
|
+
transformTextInSelection,
|
|
29
|
+
getLineInfoAtPosition,
|
|
30
|
+
getSelection
|
|
31
|
+
} from "@coze-editor/core-plugins";
|
|
32
|
+
import {
|
|
33
|
+
option,
|
|
34
|
+
api,
|
|
35
|
+
event,
|
|
36
|
+
extension,
|
|
37
|
+
domEventHandler
|
|
38
|
+
} from "@coze-editor/core";
|
|
39
|
+
var preset = [
|
|
40
|
+
extension([disableKeybindingsField, focusChangeNotifier]),
|
|
41
|
+
option("fontSize", fontSize),
|
|
42
|
+
option("placeholder", placeholder),
|
|
43
|
+
option("readOnly", readOnly),
|
|
44
|
+
option("editable", editable),
|
|
45
|
+
option("lineWrapping", lineWrapping),
|
|
46
|
+
option("height", height),
|
|
47
|
+
option("minHeight", minHeight),
|
|
48
|
+
option("maxHeight", maxHeight),
|
|
49
|
+
api("getValue", getValue),
|
|
50
|
+
api("setValue", setValue),
|
|
51
|
+
api("replaceText", replaceText),
|
|
52
|
+
api("getCursorPosition", getCursorPosition),
|
|
53
|
+
api("setCursorPosition", setCursorPosition),
|
|
54
|
+
api("focus", focus),
|
|
55
|
+
api("blur", blur),
|
|
56
|
+
api("disableKeybindings", disableKeybindings),
|
|
57
|
+
api("updateASTDecorations", ({ view }) => () => {
|
|
58
|
+
updateWholeDecorations(view);
|
|
59
|
+
}),
|
|
60
|
+
api("undo", undo),
|
|
61
|
+
api("redo", redo),
|
|
62
|
+
api("transformTextInSelection", transformTextInSelection),
|
|
63
|
+
api("getSelection", getSelection),
|
|
64
|
+
api("getLineInfoAtPosition", getLineInfoAtPosition),
|
|
65
|
+
event("selectionChange", eventSelectionChange),
|
|
66
|
+
event("change", eventChange),
|
|
67
|
+
event("focus", eventFocus),
|
|
68
|
+
event("blur", eventBlur),
|
|
69
|
+
domEventHandler("mousedown"),
|
|
70
|
+
domEventHandler("mouseup")
|
|
71
|
+
];
|
|
72
|
+
var index_default = preset;
|
|
73
|
+
export {
|
|
74
|
+
index_default as default
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// Copyright (c) 2025 coze-dev\n// SPDX-License-Identifier: MIT\n\nimport { updateWholeDecorations } from '@coze-editor/extensions';\nimport {\n focus,\n blur,\n setValue,\n getValue,\n eventChange,\n disableKeybindings,\n placeholder,\n replaceText,\n editable,\n readOnly,\n fontSize,\n eventFocus,\n focusChangeNotifier,\n disableKeybindingsField,\n getCursorPosition,\n setCursorPosition,\n eventBlur,\n lineWrapping,\n eventSelectionChange,\n height,\n minHeight,\n maxHeight,\n undo,\n redo,\n transformTextInSelection,\n getLineInfoAtPosition,\n getSelection,\n} from '@coze-editor/core-plugins';\nimport {\n option,\n api,\n event,\n type InferEditorAPIFromPlugins,\n extension,\n domEventHandler,\n} from '@coze-editor/core';\n\nconst preset = [\n extension([disableKeybindingsField, focusChangeNotifier]),\n\n option('fontSize', fontSize),\n option('placeholder', placeholder),\n option('readOnly', readOnly),\n option('editable', editable),\n option('lineWrapping', lineWrapping),\n option('height', height),\n option('minHeight', minHeight),\n option('maxHeight', maxHeight),\n\n api('getValue', getValue),\n api('setValue', setValue),\n api('replaceText', replaceText),\n api('getCursorPosition', getCursorPosition),\n api('setCursorPosition', setCursorPosition),\n api('focus', focus),\n api('blur', blur),\n api('disableKeybindings', disableKeybindings),\n api('updateASTDecorations', ({ view }) => () => {\n updateWholeDecorations(view);\n }),\n api('undo', undo),\n api('redo', redo),\n api('transformTextInSelection', transformTextInSelection),\n api('getSelection', getSelection),\n api('getLineInfoAtPosition', getLineInfoAtPosition),\n\n event('selectionChange', eventSelectionChange),\n event('change', eventChange),\n event('focus', eventFocus),\n event('blur', eventBlur),\n domEventHandler('mousedown'),\n domEventHandler('mouseup'),\n];\n\ntype EditorAPI = InferEditorAPIFromPlugins<typeof preset>;\n\nexport default preset;\nexport type { EditorAPI };\n"],"mappings":";AAGA,SAAS,8BAA8B;AACvC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AAEP,IAAM,SAAS;AAAA,EACb,UAAU,CAAC,yBAAyB,mBAAmB,CAAC;AAAA,EAExD,OAAO,YAAY,QAAQ;AAAA,EAC3B,OAAO,eAAe,WAAW;AAAA,EACjC,OAAO,YAAY,QAAQ;AAAA,EAC3B,OAAO,YAAY,QAAQ;AAAA,EAC3B,OAAO,gBAAgB,YAAY;AAAA,EACnC,OAAO,UAAU,MAAM;AAAA,EACvB,OAAO,aAAa,SAAS;AAAA,EAC7B,OAAO,aAAa,SAAS;AAAA,EAE7B,IAAI,YAAY,QAAQ;AAAA,EACxB,IAAI,YAAY,QAAQ;AAAA,EACxB,IAAI,eAAe,WAAW;AAAA,EAC9B,IAAI,qBAAqB,iBAAiB;AAAA,EAC1C,IAAI,qBAAqB,iBAAiB;AAAA,EAC1C,IAAI,SAAS,KAAK;AAAA,EAClB,IAAI,QAAQ,IAAI;AAAA,EAChB,IAAI,sBAAsB,kBAAkB;AAAA,EAC5C,IAAI,wBAAwB,CAAC,EAAE,KAAK,MAAM,MAAM;AAC9C,2BAAuB,IAAI;AAAA,EAC7B,CAAC;AAAA,EACD,IAAI,QAAQ,IAAI;AAAA,EAChB,IAAI,QAAQ,IAAI;AAAA,EAChB,IAAI,4BAA4B,wBAAwB;AAAA,EACxD,IAAI,gBAAgB,YAAY;AAAA,EAChC,IAAI,yBAAyB,qBAAqB;AAAA,EAElD,MAAM,mBAAmB,oBAAoB;AAAA,EAC7C,MAAM,UAAU,WAAW;AAAA,EAC3B,MAAM,SAAS,UAAU;AAAA,EACzB,MAAM,QAAQ,SAAS;AAAA,EACvB,gBAAgB,WAAW;AAAA,EAC3B,gBAAgB,SAAS;AAC3B;AAIA,IAAO,gBAAQ;","names":[]}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as _codemirror_view from '@codemirror/view';
|
|
2
|
+
import * as _codemirror_state from '@codemirror/state';
|
|
3
|
+
import * as _coze_editor_core from '@coze-editor/core';
|
|
4
|
+
import { InferEditorAPIFromPlugins } from '@coze-editor/core';
|
|
5
|
+
|
|
6
|
+
declare const preset: (_coze_editor_core.ExtensionPluginSpec | _coze_editor_core.OptionPluginSpec<"fontSize", number> | _coze_editor_core.OptionPluginSpec<"placeholder", string | HTMLElement> | _coze_editor_core.OptionPluginSpec<"readOnly", boolean> | _coze_editor_core.OptionPluginSpec<"editable", boolean> | _coze_editor_core.OptionPluginSpec<"lineWrapping", boolean> | _coze_editor_core.OptionPluginSpec<"height", string | number> | _coze_editor_core.OptionPluginSpec<"minHeight", string | number> | _coze_editor_core.OptionPluginSpec<"maxHeight", string | number> | _coze_editor_core.APIPluginSpec<"getValue", [], string> | _coze_editor_core.APIPluginSpec<"setValue", [value: string], void> | _coze_editor_core.APIPluginSpec<"replaceText", [options: {
|
|
7
|
+
from: number;
|
|
8
|
+
to: number;
|
|
9
|
+
text: string;
|
|
10
|
+
cursorOffset?: number;
|
|
11
|
+
scrollIntoView?: boolean;
|
|
12
|
+
userEvent?: string;
|
|
13
|
+
}], void> | _coze_editor_core.APIPluginSpec<"getCursorPosition", [], number> | _coze_editor_core.APIPluginSpec<"setCursorPosition", [pos: number], void> | _coze_editor_core.APIPluginSpec<"focus", [], void> | _coze_editor_core.APIPluginSpec<"blur", [], void> | _coze_editor_core.APIPluginSpec<"disableKeybindings", [keys: string[]], void> | _coze_editor_core.APIPluginSpec<"updateASTDecorations", [], void> | _coze_editor_core.APIPluginSpec<"undo", [], void> | _coze_editor_core.APIPluginSpec<"redo", [], void> | _coze_editor_core.APIPluginSpec<"transformTextInSelection", [transformer: (text: string) => string | undefined], void> | _coze_editor_core.APIPluginSpec<"getSelection", [], {
|
|
14
|
+
from: number;
|
|
15
|
+
to: number;
|
|
16
|
+
anchor: number;
|
|
17
|
+
head: number;
|
|
18
|
+
}> | _coze_editor_core.APIPluginSpec<"getLineInfoAtPosition", [pos: number], _codemirror_state.Line> | _coze_editor_core.EventPluginSpec<"selectionChange", {
|
|
19
|
+
selection: {
|
|
20
|
+
from: number;
|
|
21
|
+
to: number;
|
|
22
|
+
head: number;
|
|
23
|
+
anchor: number;
|
|
24
|
+
};
|
|
25
|
+
update: _codemirror_view.ViewUpdate;
|
|
26
|
+
}> | _coze_editor_core.EventPluginSpec<"change", {
|
|
27
|
+
value: string;
|
|
28
|
+
}> | _coze_editor_core.EventPluginSpec<"focus", symbol> | _coze_editor_core.EventPluginSpec<"blur", symbol> | _coze_editor_core.DOMEventHandlerPluginSpec<"mousedown"> | _coze_editor_core.DOMEventHandlerPluginSpec<"mouseup">)[];
|
|
29
|
+
type EditorAPI = InferEditorAPIFromPlugins<typeof preset>;
|
|
30
|
+
|
|
31
|
+
export { type EditorAPI, preset as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as _codemirror_view from '@codemirror/view';
|
|
2
|
+
import * as _codemirror_state from '@codemirror/state';
|
|
3
|
+
import * as _coze_editor_core from '@coze-editor/core';
|
|
4
|
+
import { InferEditorAPIFromPlugins } from '@coze-editor/core';
|
|
5
|
+
|
|
6
|
+
declare const preset: (_coze_editor_core.ExtensionPluginSpec | _coze_editor_core.OptionPluginSpec<"fontSize", number> | _coze_editor_core.OptionPluginSpec<"placeholder", string | HTMLElement> | _coze_editor_core.OptionPluginSpec<"readOnly", boolean> | _coze_editor_core.OptionPluginSpec<"editable", boolean> | _coze_editor_core.OptionPluginSpec<"lineWrapping", boolean> | _coze_editor_core.OptionPluginSpec<"height", string | number> | _coze_editor_core.OptionPluginSpec<"minHeight", string | number> | _coze_editor_core.OptionPluginSpec<"maxHeight", string | number> | _coze_editor_core.APIPluginSpec<"getValue", [], string> | _coze_editor_core.APIPluginSpec<"setValue", [value: string], void> | _coze_editor_core.APIPluginSpec<"replaceText", [options: {
|
|
7
|
+
from: number;
|
|
8
|
+
to: number;
|
|
9
|
+
text: string;
|
|
10
|
+
cursorOffset?: number;
|
|
11
|
+
scrollIntoView?: boolean;
|
|
12
|
+
userEvent?: string;
|
|
13
|
+
}], void> | _coze_editor_core.APIPluginSpec<"getCursorPosition", [], number> | _coze_editor_core.APIPluginSpec<"setCursorPosition", [pos: number], void> | _coze_editor_core.APIPluginSpec<"focus", [], void> | _coze_editor_core.APIPluginSpec<"blur", [], void> | _coze_editor_core.APIPluginSpec<"disableKeybindings", [keys: string[]], void> | _coze_editor_core.APIPluginSpec<"updateASTDecorations", [], void> | _coze_editor_core.APIPluginSpec<"undo", [], void> | _coze_editor_core.APIPluginSpec<"redo", [], void> | _coze_editor_core.APIPluginSpec<"transformTextInSelection", [transformer: (text: string) => string | undefined], void> | _coze_editor_core.APIPluginSpec<"getSelection", [], {
|
|
14
|
+
from: number;
|
|
15
|
+
to: number;
|
|
16
|
+
anchor: number;
|
|
17
|
+
head: number;
|
|
18
|
+
}> | _coze_editor_core.APIPluginSpec<"getLineInfoAtPosition", [pos: number], _codemirror_state.Line> | _coze_editor_core.EventPluginSpec<"selectionChange", {
|
|
19
|
+
selection: {
|
|
20
|
+
from: number;
|
|
21
|
+
to: number;
|
|
22
|
+
head: number;
|
|
23
|
+
anchor: number;
|
|
24
|
+
};
|
|
25
|
+
update: _codemirror_view.ViewUpdate;
|
|
26
|
+
}> | _coze_editor_core.EventPluginSpec<"change", {
|
|
27
|
+
value: string;
|
|
28
|
+
}> | _coze_editor_core.EventPluginSpec<"focus", symbol> | _coze_editor_core.EventPluginSpec<"blur", symbol> | _coze_editor_core.DOMEventHandlerPluginSpec<"mousedown"> | _coze_editor_core.DOMEventHandlerPluginSpec<"mouseup">)[];
|
|
29
|
+
type EditorAPI = InferEditorAPIFromPlugins<typeof preset>;
|
|
30
|
+
|
|
31
|
+
export { type EditorAPI, preset as default };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/index.ts
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
|
+
default: () => index_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(index_exports);
|
|
25
|
+
var import_extensions = require("@coze-editor/extensions");
|
|
26
|
+
var import_core_plugins = require("@coze-editor/core-plugins");
|
|
27
|
+
var import_core = require("@coze-editor/core");
|
|
28
|
+
var preset = [
|
|
29
|
+
(0, import_core.extension)([import_core_plugins.disableKeybindingsField, import_core_plugins.focusChangeNotifier]),
|
|
30
|
+
(0, import_core.option)("fontSize", import_core_plugins.fontSize),
|
|
31
|
+
(0, import_core.option)("placeholder", import_core_plugins.placeholder),
|
|
32
|
+
(0, import_core.option)("readOnly", import_core_plugins.readOnly),
|
|
33
|
+
(0, import_core.option)("editable", import_core_plugins.editable),
|
|
34
|
+
(0, import_core.option)("lineWrapping", import_core_plugins.lineWrapping),
|
|
35
|
+
(0, import_core.option)("height", import_core_plugins.height),
|
|
36
|
+
(0, import_core.option)("minHeight", import_core_plugins.minHeight),
|
|
37
|
+
(0, import_core.option)("maxHeight", import_core_plugins.maxHeight),
|
|
38
|
+
(0, import_core.api)("getValue", import_core_plugins.getValue),
|
|
39
|
+
(0, import_core.api)("setValue", import_core_plugins.setValue),
|
|
40
|
+
(0, import_core.api)("replaceText", import_core_plugins.replaceText),
|
|
41
|
+
(0, import_core.api)("getCursorPosition", import_core_plugins.getCursorPosition),
|
|
42
|
+
(0, import_core.api)("setCursorPosition", import_core_plugins.setCursorPosition),
|
|
43
|
+
(0, import_core.api)("focus", import_core_plugins.focus),
|
|
44
|
+
(0, import_core.api)("blur", import_core_plugins.blur),
|
|
45
|
+
(0, import_core.api)("disableKeybindings", import_core_plugins.disableKeybindings),
|
|
46
|
+
(0, import_core.api)("updateASTDecorations", ({ view }) => () => {
|
|
47
|
+
(0, import_extensions.updateWholeDecorations)(view);
|
|
48
|
+
}),
|
|
49
|
+
(0, import_core.api)("undo", import_core_plugins.undo),
|
|
50
|
+
(0, import_core.api)("redo", import_core_plugins.redo),
|
|
51
|
+
(0, import_core.api)("transformTextInSelection", import_core_plugins.transformTextInSelection),
|
|
52
|
+
(0, import_core.api)("getSelection", import_core_plugins.getSelection),
|
|
53
|
+
(0, import_core.api)("getLineInfoAtPosition", import_core_plugins.getLineInfoAtPosition),
|
|
54
|
+
(0, import_core.event)("selectionChange", import_core_plugins.eventSelectionChange),
|
|
55
|
+
(0, import_core.event)("change", import_core_plugins.eventChange),
|
|
56
|
+
(0, import_core.event)("focus", import_core_plugins.eventFocus),
|
|
57
|
+
(0, import_core.event)("blur", import_core_plugins.eventBlur),
|
|
58
|
+
(0, import_core.domEventHandler)("mousedown"),
|
|
59
|
+
(0, import_core.domEventHandler)("mouseup")
|
|
60
|
+
];
|
|
61
|
+
var index_default = preset;
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Copyright (c) 2025 coze-dev\n// SPDX-License-Identifier: MIT\n\nimport { updateWholeDecorations } from '@coze-editor/extensions';\nimport {\n focus,\n blur,\n setValue,\n getValue,\n eventChange,\n disableKeybindings,\n placeholder,\n replaceText,\n editable,\n readOnly,\n fontSize,\n eventFocus,\n focusChangeNotifier,\n disableKeybindingsField,\n getCursorPosition,\n setCursorPosition,\n eventBlur,\n lineWrapping,\n eventSelectionChange,\n height,\n minHeight,\n maxHeight,\n undo,\n redo,\n transformTextInSelection,\n getLineInfoAtPosition,\n getSelection,\n} from '@coze-editor/core-plugins';\nimport {\n option,\n api,\n event,\n type InferEditorAPIFromPlugins,\n extension,\n domEventHandler,\n} from '@coze-editor/core';\n\nconst preset = [\n extension([disableKeybindingsField, focusChangeNotifier]),\n\n option('fontSize', fontSize),\n option('placeholder', placeholder),\n option('readOnly', readOnly),\n option('editable', editable),\n option('lineWrapping', lineWrapping),\n option('height', height),\n option('minHeight', minHeight),\n option('maxHeight', maxHeight),\n\n api('getValue', getValue),\n api('setValue', setValue),\n api('replaceText', replaceText),\n api('getCursorPosition', getCursorPosition),\n api('setCursorPosition', setCursorPosition),\n api('focus', focus),\n api('blur', blur),\n api('disableKeybindings', disableKeybindings),\n api('updateASTDecorations', ({ view }) => () => {\n updateWholeDecorations(view);\n }),\n api('undo', undo),\n api('redo', redo),\n api('transformTextInSelection', transformTextInSelection),\n api('getSelection', getSelection),\n api('getLineInfoAtPosition', getLineInfoAtPosition),\n\n event('selectionChange', eventSelectionChange),\n event('change', eventChange),\n event('focus', eventFocus),\n event('blur', eventBlur),\n domEventHandler('mousedown'),\n domEventHandler('mouseup'),\n];\n\ntype EditorAPI = InferEditorAPIFromPlugins<typeof preset>;\n\nexport default preset;\nexport type { EditorAPI };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAuC;AACvC,0BA4BO;AACP,kBAOO;AAEP,IAAM,SAAS;AAAA,MACb,uBAAU,CAAC,6CAAyB,uCAAmB,CAAC;AAAA,MAExD,oBAAO,YAAY,4BAAQ;AAAA,MAC3B,oBAAO,eAAe,+BAAW;AAAA,MACjC,oBAAO,YAAY,4BAAQ;AAAA,MAC3B,oBAAO,YAAY,4BAAQ;AAAA,MAC3B,oBAAO,gBAAgB,gCAAY;AAAA,MACnC,oBAAO,UAAU,0BAAM;AAAA,MACvB,oBAAO,aAAa,6BAAS;AAAA,MAC7B,oBAAO,aAAa,6BAAS;AAAA,MAE7B,iBAAI,YAAY,4BAAQ;AAAA,MACxB,iBAAI,YAAY,4BAAQ;AAAA,MACxB,iBAAI,eAAe,+BAAW;AAAA,MAC9B,iBAAI,qBAAqB,qCAAiB;AAAA,MAC1C,iBAAI,qBAAqB,qCAAiB;AAAA,MAC1C,iBAAI,SAAS,yBAAK;AAAA,MAClB,iBAAI,QAAQ,wBAAI;AAAA,MAChB,iBAAI,sBAAsB,sCAAkB;AAAA,MAC5C,iBAAI,wBAAwB,CAAC,EAAE,KAAK,MAAM,MAAM;AAC9C,kDAAuB,IAAI;AAAA,EAC7B,CAAC;AAAA,MACD,iBAAI,QAAQ,wBAAI;AAAA,MAChB,iBAAI,QAAQ,wBAAI;AAAA,MAChB,iBAAI,4BAA4B,4CAAwB;AAAA,MACxD,iBAAI,gBAAgB,gCAAY;AAAA,MAChC,iBAAI,yBAAyB,yCAAqB;AAAA,MAElD,mBAAM,mBAAmB,wCAAoB;AAAA,MAC7C,mBAAM,UAAU,+BAAW;AAAA,MAC3B,mBAAM,SAAS,8BAAU;AAAA,MACzB,mBAAM,QAAQ,6BAAS;AAAA,MACvB,6BAAgB,WAAW;AAAA,MAC3B,6BAAgB,SAAS;AAC3B;AAIA,IAAO,gBAAQ;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@coze-editor/preset-universal",
|
|
3
|
+
"version": "0.1.0-alpha.09ffeb",
|
|
4
|
+
"description": "preset-universal",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "fengzilong",
|
|
7
|
+
"maintainers": [],
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"**/*.css",
|
|
10
|
+
"**/*.less",
|
|
11
|
+
"**/*.sass",
|
|
12
|
+
"**/*.scss"
|
|
13
|
+
],
|
|
14
|
+
"main": "./dist/esm/index.js",
|
|
15
|
+
"module": "./dist/esm/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsup",
|
|
22
|
+
"lint": "eslint && tsc --noEmit"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@coze-editor/core": "0.1.0-alpha.09ffeb",
|
|
26
|
+
"@coze-editor/core-plugins": "0.1.0-alpha.09ffeb",
|
|
27
|
+
"@coze-editor/extensions": "0.1.0-alpha.09ffeb"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@codemirror/state": "^6.4.1",
|
|
31
|
+
"@codemirror/view": "^6.26.1",
|
|
32
|
+
"@coze-arch/ts-config": "workspace:*",
|
|
33
|
+
"@coze-editor/eslint-config": "workspace:*",
|
|
34
|
+
"@types/node": "^22",
|
|
35
|
+
"eslint": "9.14.0",
|
|
36
|
+
"tsup": "^8.0.1",
|
|
37
|
+
"typescript": "^5.8.2"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@codemirror/state": "^6.4.1",
|
|
41
|
+
"@codemirror/view": "^6.26.1"
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public",
|
|
45
|
+
"registry": "https://registry.npmjs.org"
|
|
46
|
+
},
|
|
47
|
+
"test:main": "./src/index.ts"
|
|
48
|
+
}
|