@ones-editor/editor 3.0.3-beta.9 → 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
@@ -42628,9 +42628,6 @@ ${codeText}
42628
42628
  function initMenuItem$1(item, elem) {
42629
42629
  var _a, _b;
42630
42630
  addClass(elem, "menu-item");
42631
- if (item.className) {
42632
- addClass(elem, ...item.className.split(" "));
42633
- }
42634
42631
  if (item.element) {
42635
42632
  return;
42636
42633
  }
@@ -42706,9 +42703,6 @@ ${codeText}
42706
42703
  });
42707
42704
  }
42708
42705
  function initToolbarItem(item, elem, options) {
42709
- if (item.className) {
42710
- addClass(elem, ...item.className.split(" "));
42711
- }
42712
42706
  elem.setAttribute("data-button-id", item.id);
42713
42707
  if (options.tooltipId && item.name && !item.disableTooltip) {
42714
42708
  elem.setAttribute(`data-editor-tooltip-${options.tooltipId}`, item.name);
@@ -66964,11 +66958,9 @@ ${codeText}
66964
66958
  });
66965
66959
  return true;
66966
66960
  }
66967
- function matchBlockStyle(editor, containerId, blockIndex, offset, options) {
66968
- if ((options == null ? void 0 : options.disableHeadingShortcuts) !== true) {
66969
- if (matchHeading(editor, containerId, blockIndex, offset)) {
66970
- return true;
66971
- }
66961
+ function matchBlockStyle(editor, containerId, blockIndex, offset) {
66962
+ if (matchHeading(editor, containerId, blockIndex, offset)) {
66963
+ return true;
66972
66964
  }
66973
66965
  if (matchBlockQuote(editor, containerId, blockIndex, offset)) {
66974
66966
  return true;
@@ -67073,15 +67065,12 @@ ${codeText}
67073
67065
  return false;
67074
67066
  }
67075
67067
  class MarkdownInputHandler {
67076
- constructor(options) {
67077
- this.options = options;
67078
- }
67079
67068
  handleAfterInsertText(editor, containerId, blockIndex, offset, text2) {
67080
67069
  if (text2 === " ") {
67081
67070
  if (converterIntercept(editor, containerId)) {
67082
67071
  return false;
67083
67072
  }
67084
- if (matchBlockStyle(editor, containerId, blockIndex, offset, this.options)) {
67073
+ if (matchBlockStyle(editor, containerId, blockIndex, offset)) {
67085
67074
  return true;
67086
67075
  }
67087
67076
  if (matchTextStyle(editor, containerId, blockIndex, offset)) {
@@ -95517,8 +95506,9 @@ ${JSON.stringify(error2, null, 2)}`);
95517
95506
  }
95518
95507
  const elem = node;
95519
95508
  const refId = elem.getAttribute("data-ref-id");
95509
+ const refType = elem.getAttribute("data-ref-type");
95520
95510
  const uuid = elem.getAttribute("data-uuid");
95521
- return Boolean(refId && uuid);
95511
+ return Boolean(refType === "task" && refId && uuid);
95522
95512
  },
95523
95513
  replacement: (content, node) => {
95524
95514
  const refType = node.getAttribute("data-ref-type");
@@ -96056,7 +96046,7 @@ ${JSON.stringify(error2, null, 2)}`);
96056
96046
  }
96057
96047
  }
96058
96048
  });
96059
- editor.version = "3.0.3-beta.9";
96049
+ editor.version = "3.0.3";
96060
96050
  return editor;
96061
96051
  }
96062
96052
  function isDoc(doc2) {
@@ -96190,7 +96180,7 @@ ${JSON.stringify(error2, null, 2)}`);
96190
96180
  OnesEditorDropTarget.register(editor);
96191
96181
  OnesEditorTocProvider.register(editor);
96192
96182
  OnesEditorExclusiveBlock.register(editor);
96193
- editor.version = "3.0.3-beta.9";
96183
+ editor.version = "3.0.3";
96194
96184
  return editor;
96195
96185
  }
96196
96186
  async function showDocVersions(editor, options, serverUrl) {
@@ -96257,77 +96247,6 @@ ${JSON.stringify(error2, null, 2)}`);
96257
96247
  dialog.show(dialogOptions);
96258
96248
  return dialog;
96259
96249
  }
96260
- async function createSimpleInput(root2, docData, options) {
96261
- var _a, _b, _c, _d, _e, _f, _g, _h;
96262
- assert(logger, root2, "app does not exists");
96263
- const doc2 = isDoc(docData) ? docData : new LocalDoc(docData, {
96264
- serverUrl: options.serverUrl || ""
96265
- });
96266
- if (options.lang) {
96267
- i18n$1.setLang(options.lang);
96268
- }
96269
- Logger$2.level = (_a = options.logLevel) != null ? _a : LogLevel.DEBUG;
96270
- const editor = createEditor(root2, doc2, {
96271
- id: options.id,
96272
- scrollContainer: options == null ? void 0 : options.scrollContainer,
96273
- enableResolveComments: false,
96274
- enableComments: false,
96275
- dateTimeFormatter: options.dateTimeFormatter,
96276
- components: {
96277
- blocks: [ListBlock, ...(_c = (_b = options.components) == null ? void 0 : _b.blocks) != null ? _c : []],
96278
- commandProviders: [],
96279
- decorators: [],
96280
- embeds: [...((_d = options.components) == null ? void 0 : _d.embeds) || []],
96281
- boxes: [...((_e = options.components) == null ? void 0 : _e.boxes) || []],
96282
- insertions: [],
96283
- blockHooks: [...((_f = options.components) == null ? void 0 : _f.blockHooks) || []],
96284
- textRenders: [
96285
- ...((_g = options.components) == null ? void 0 : _g.textRenders) || []
96286
- ].filter(Boolean),
96287
- options: { ...options.componentsOptions }
96288
- },
96289
- shortcuts: [TextStyleShortcuts, DefaultShortcuts]
96290
- });
96291
- if (options.compact) {
96292
- addClass(editor.rootElement, "compact");
96293
- if (options.headingButton === false)
96294
- addClass(editor.rootElement, "no-heading-collapse");
96295
- if (options.blockMenuButton === false)
96296
- addClass(editor.rootElement, "no-block-menu");
96297
- }
96298
- editor.input.addHandler(new MarkdownInputHandler({
96299
- disableHeadingShortcuts: true
96300
- }));
96301
- editor.input.addHandler(new OnesEditorPasteHandler(editor));
96302
- editor.input.addHandler(new ListPasteHandler());
96303
- editor.doc.registerCallback(new HeadingBlockDocEvents(editor));
96304
- if (!clientType.isMobile) {
96305
- editor.addCustom("editor-tooltip", () => new OnesEditorTooltip(editor));
96306
- }
96307
- editor.addCustom("create-options", () => new OnesEditorCustomDataWrapper(editor, options));
96308
- if ((_h = options.componentsOptions) == null ? void 0 : _h.mention) {
96309
- const mentionOptions = options.componentsOptions.mention;
96310
- editor.addCustom("mention", () => new OnesEditorMention(editor, mentionOptions));
96311
- }
96312
- if (options.autoNewLine) {
96313
- editor.addCustom("auto-new-line", () => new AutoNewLine(editor));
96314
- }
96315
- editor.addListener("clickLink", (editor2, event, link2) => {
96316
- var _a2;
96317
- if ((_a2 = options == null ? void 0 : options.events) == null ? void 0 : _a2.onClickLink) {
96318
- options.events.onClickLink(editor2, event, link2);
96319
- return;
96320
- }
96321
- const href = link2.getAttribute("link") || link2.getAttribute("href");
96322
- if (href) {
96323
- if (editor2.readonly || event.ctrlKey || event.metaKey || !getParentBlock(link2)) {
96324
- window.open(href, "_blank");
96325
- }
96326
- }
96327
- });
96328
- editor.version = "3.0.3-beta.9";
96329
- return editor;
96330
- }
96331
96250
  const emojis$1 = {
96332
96251
  smileysAndPeople: [
96333
96252
  "\u{1F600}",
@@ -142231,7 +142150,6 @@ ${JSON.stringify(error2, null, 2)}`);
142231
142150
  exports2.MathMenuIcon = MathMenuIcon;
142232
142151
  exports2.MaxUserError = MaxUserError;
142233
142152
  exports2.Mention2Icon = Mention2Icon;
142234
- exports2.MentionBox = MentionBox;
142235
142153
  exports2.MentionIcon = MentionIcon;
142236
142154
  exports2.MergeCellIcon = MergeCellIcon;
142237
142155
  exports2.Mindmap = Mindmap;
@@ -142244,14 +142162,12 @@ ${JSON.stringify(error2, null, 2)}`);
142244
142162
  exports2.MoreItem = MoreItem;
142245
142163
  exports2.NextIcon = NextIcon;
142246
142164
  exports2.OnesEditorAutoSuggest = OnesEditorAutoSuggest;
142247
- exports2.OnesEditorBlockMention = OnesEditorBlockMention;
142248
142165
  exports2.OnesEditorComments = OnesEditorComments;
142249
142166
  exports2.OnesEditorCommentsRender = OnesEditorCommentsRender;
142250
142167
  exports2.OnesEditorCustomDataWrapper = OnesEditorCustomDataWrapper;
142251
142168
  exports2.OnesEditorExclusiveBlock = OnesEditorExclusiveBlock;
142252
142169
  exports2.OnesEditorHoveringBlock = OnesEditorHoveringBlock;
142253
142170
  exports2.OnesEditorIcons = index$f;
142254
- exports2.OnesEditorMention = OnesEditorMention;
142255
142171
  exports2.OnesEditorQuickMenu = OnesEditorQuickMenu;
142256
142172
  exports2.OnesEditorToc = OnesEditorToc;
142257
142173
  exports2.OnesEditorTocProvider = OnesEditorTocProvider;
@@ -142449,7 +142365,6 @@ ${JSON.stringify(error2, null, 2)}`);
142449
142365
  exports2.createSeparator = createSeparator;
142450
142366
  exports2.createSimpleBlockPosition = createSimpleBlockPosition;
142451
142367
  exports2.createSimpleDocPos = createSimpleDocPos;
142452
- exports2.createSimpleInput = createSimpleInput;
142453
142368
  exports2.createTextBlockData = createTextBlockData;
142454
142369
  exports2.createTextButton = createTextButton;
142455
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.9",
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
- }