@ones-editor/editor 3.0.3-beta.8 → 3.0.3

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/dist/index.d.ts CHANGED
@@ -30,7 +30,6 @@ export * from '../@ones-editor/layout-block';
30
30
  export * from '../@ones-editor/markdown-to-doc';
31
31
  export * from '../@ones-editor/html-to-doc';
32
32
  export * from '../@ones-editor/main-toolbar';
33
- export * from '../@ones-editor/mention';
34
33
  export { Popup, ManualMenu, OnesEditorAutoSuggest, tippy, ManualToolbar, ManualCloseDialog, TextColorItem, shouldFocusToEditor, FixedToolbar, } from '../@ones-editor/ui-base';
35
34
  export * from '../@ones-editor/drawio-embed';
36
35
  export * from '../@ones-editor/block-resizer';
@@ -109,4 +108,3 @@ export interface ShowDocVersionsOptions2 {
109
108
  editorOptions?: CreateOnesEditorOptions;
110
109
  }
111
110
  export declare function showDocVersions2(parent: HTMLElement, options: ShowDocVersionsOptions2): Promise<OnesEditorVersionsDialog>;
112
- export declare function createSimpleInput(root: HTMLElement, docData: DocObject | OnesEditorDoc, options: CreateLocalEditorOptions): Promise<OnesEditor>;
package/dist/index.js CHANGED
@@ -66958,11 +66958,9 @@ ${codeText}
66958
66958
  });
66959
66959
  return true;
66960
66960
  }
66961
- function matchBlockStyle(editor, containerId, blockIndex, offset, options) {
66962
- if ((options == null ? void 0 : options.disableHeadingShortcuts) !== true) {
66963
- if (matchHeading(editor, containerId, blockIndex, offset)) {
66964
- return true;
66965
- }
66961
+ function matchBlockStyle(editor, containerId, blockIndex, offset) {
66962
+ if (matchHeading(editor, containerId, blockIndex, offset)) {
66963
+ return true;
66966
66964
  }
66967
66965
  if (matchBlockQuote(editor, containerId, blockIndex, offset)) {
66968
66966
  return true;
@@ -67067,15 +67065,12 @@ ${codeText}
67067
67065
  return false;
67068
67066
  }
67069
67067
  class MarkdownInputHandler {
67070
- constructor(options) {
67071
- this.options = options;
67072
- }
67073
67068
  handleAfterInsertText(editor, containerId, blockIndex, offset, text2) {
67074
67069
  if (text2 === " ") {
67075
67070
  if (converterIntercept(editor, containerId)) {
67076
67071
  return false;
67077
67072
  }
67078
- if (matchBlockStyle(editor, containerId, blockIndex, offset, this.options)) {
67073
+ if (matchBlockStyle(editor, containerId, blockIndex, offset)) {
67079
67074
  return true;
67080
67075
  }
67081
67076
  if (matchTextStyle(editor, containerId, blockIndex, offset)) {
@@ -95511,8 +95506,9 @@ ${JSON.stringify(error2, null, 2)}`);
95511
95506
  }
95512
95507
  const elem = node;
95513
95508
  const refId = elem.getAttribute("data-ref-id");
95509
+ const refType = elem.getAttribute("data-ref-type");
95514
95510
  const uuid = elem.getAttribute("data-uuid");
95515
- return Boolean(refId && uuid);
95511
+ return Boolean(refType === "task" && refId && uuid);
95516
95512
  },
95517
95513
  replacement: (content, node) => {
95518
95514
  const refType = node.getAttribute("data-ref-type");
@@ -96050,7 +96046,7 @@ ${JSON.stringify(error2, null, 2)}`);
96050
96046
  }
96051
96047
  }
96052
96048
  });
96053
- editor.version = "3.0.3-beta.8";
96049
+ editor.version = "3.0.3";
96054
96050
  return editor;
96055
96051
  }
96056
96052
  function isDoc(doc2) {
@@ -96184,7 +96180,7 @@ ${JSON.stringify(error2, null, 2)}`);
96184
96180
  OnesEditorDropTarget.register(editor);
96185
96181
  OnesEditorTocProvider.register(editor);
96186
96182
  OnesEditorExclusiveBlock.register(editor);
96187
- editor.version = "3.0.3-beta.8";
96183
+ editor.version = "3.0.3";
96188
96184
  return editor;
96189
96185
  }
96190
96186
  async function showDocVersions(editor, options, serverUrl) {
@@ -96251,77 +96247,6 @@ ${JSON.stringify(error2, null, 2)}`);
96251
96247
  dialog.show(dialogOptions);
96252
96248
  return dialog;
96253
96249
  }
96254
- async function createSimpleInput(root2, docData, options) {
96255
- var _a, _b, _c, _d, _e, _f, _g, _h;
96256
- assert(logger, root2, "app does not exists");
96257
- const doc2 = isDoc(docData) ? docData : new LocalDoc(docData, {
96258
- serverUrl: options.serverUrl || ""
96259
- });
96260
- if (options.lang) {
96261
- i18n$1.setLang(options.lang);
96262
- }
96263
- Logger$2.level = (_a = options.logLevel) != null ? _a : LogLevel.DEBUG;
96264
- const editor = createEditor(root2, doc2, {
96265
- id: options.id,
96266
- scrollContainer: options == null ? void 0 : options.scrollContainer,
96267
- enableResolveComments: false,
96268
- enableComments: false,
96269
- dateTimeFormatter: options.dateTimeFormatter,
96270
- components: {
96271
- blocks: [ListBlock, ...(_c = (_b = options.components) == null ? void 0 : _b.blocks) != null ? _c : []],
96272
- commandProviders: [],
96273
- decorators: [],
96274
- embeds: [...((_d = options.components) == null ? void 0 : _d.embeds) || []],
96275
- boxes: [...((_e = options.components) == null ? void 0 : _e.boxes) || []],
96276
- insertions: [],
96277
- blockHooks: [...((_f = options.components) == null ? void 0 : _f.blockHooks) || []],
96278
- textRenders: [
96279
- ...((_g = options.components) == null ? void 0 : _g.textRenders) || []
96280
- ].filter(Boolean),
96281
- options: { ...options.componentsOptions }
96282
- },
96283
- shortcuts: [TextStyleShortcuts, DefaultShortcuts]
96284
- });
96285
- if (options.compact) {
96286
- addClass(editor.rootElement, "compact");
96287
- if (options.headingButton === false)
96288
- addClass(editor.rootElement, "no-heading-collapse");
96289
- if (options.blockMenuButton === false)
96290
- addClass(editor.rootElement, "no-block-menu");
96291
- }
96292
- editor.input.addHandler(new MarkdownInputHandler({
96293
- disableHeadingShortcuts: true
96294
- }));
96295
- editor.input.addHandler(new OnesEditorPasteHandler(editor));
96296
- editor.input.addHandler(new ListPasteHandler());
96297
- editor.doc.registerCallback(new HeadingBlockDocEvents(editor));
96298
- if (!clientType.isMobile) {
96299
- editor.addCustom("editor-tooltip", () => new OnesEditorTooltip(editor));
96300
- }
96301
- editor.addCustom("create-options", () => new OnesEditorCustomDataWrapper(editor, options));
96302
- if ((_h = options.componentsOptions) == null ? void 0 : _h.mention) {
96303
- const mentionOptions = options.componentsOptions.mention;
96304
- editor.addCustom("mention", () => new OnesEditorMention(editor, mentionOptions));
96305
- }
96306
- if (options.autoNewLine) {
96307
- editor.addCustom("auto-new-line", () => new AutoNewLine(editor));
96308
- }
96309
- editor.addListener("clickLink", (editor2, event, link2) => {
96310
- var _a2;
96311
- if ((_a2 = options == null ? void 0 : options.events) == null ? void 0 : _a2.onClickLink) {
96312
- options.events.onClickLink(editor2, event, link2);
96313
- return;
96314
- }
96315
- const href = link2.getAttribute("link") || link2.getAttribute("href");
96316
- if (href) {
96317
- if (editor2.readonly || event.ctrlKey || event.metaKey || !getParentBlock(link2)) {
96318
- window.open(href, "_blank");
96319
- }
96320
- }
96321
- });
96322
- editor.version = "3.0.3-beta.8";
96323
- return editor;
96324
- }
96325
96250
  const emojis$1 = {
96326
96251
  smileysAndPeople: [
96327
96252
  "\u{1F600}",
@@ -142225,7 +142150,6 @@ ${JSON.stringify(error2, null, 2)}`);
142225
142150
  exports2.MathMenuIcon = MathMenuIcon;
142226
142151
  exports2.MaxUserError = MaxUserError;
142227
142152
  exports2.Mention2Icon = Mention2Icon;
142228
- exports2.MentionBox = MentionBox;
142229
142153
  exports2.MentionIcon = MentionIcon;
142230
142154
  exports2.MergeCellIcon = MergeCellIcon;
142231
142155
  exports2.Mindmap = Mindmap;
@@ -142238,14 +142162,12 @@ ${JSON.stringify(error2, null, 2)}`);
142238
142162
  exports2.MoreItem = MoreItem;
142239
142163
  exports2.NextIcon = NextIcon;
142240
142164
  exports2.OnesEditorAutoSuggest = OnesEditorAutoSuggest;
142241
- exports2.OnesEditorBlockMention = OnesEditorBlockMention;
142242
142165
  exports2.OnesEditorComments = OnesEditorComments;
142243
142166
  exports2.OnesEditorCommentsRender = OnesEditorCommentsRender;
142244
142167
  exports2.OnesEditorCustomDataWrapper = OnesEditorCustomDataWrapper;
142245
142168
  exports2.OnesEditorExclusiveBlock = OnesEditorExclusiveBlock;
142246
142169
  exports2.OnesEditorHoveringBlock = OnesEditorHoveringBlock;
142247
142170
  exports2.OnesEditorIcons = index$f;
142248
- exports2.OnesEditorMention = OnesEditorMention;
142249
142171
  exports2.OnesEditorQuickMenu = OnesEditorQuickMenu;
142250
142172
  exports2.OnesEditorToc = OnesEditorToc;
142251
142173
  exports2.OnesEditorTocProvider = OnesEditorTocProvider;
@@ -142443,7 +142365,6 @@ ${JSON.stringify(error2, null, 2)}`);
142443
142365
  exports2.createSeparator = createSeparator;
142444
142366
  exports2.createSimpleBlockPosition = createSimpleBlockPosition;
142445
142367
  exports2.createSimpleDocPos = createSimpleDocPos;
142446
- exports2.createSimpleInput = createSimpleInput;
142447
142368
  exports2.createTextBlockData = createTextBlockData;
142448
142369
  exports2.createTextButton = createTextButton;
142449
142370
  exports2.createTextOp = createTextOp;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "3.0.3-beta.8",
3
+ "version": "3.0.3",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {
@@ -1,3 +0,0 @@
1
- export interface MarkdownInputHandlerOptions {
2
- disableHeadingShortcuts?: boolean;
3
- }