@ones-editor/editor 0.0.9-beta.3 → 0.0.9-beta.5

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.js CHANGED
@@ -42247,7 +42247,7 @@ var __publicField = (obj, key, value) => {
42247
42247
  return true;
42248
42248
  }
42249
42249
  }
42250
- if (list2.level > prev.level) {
42250
+ if ((list2.level || 1) > (prev.level || 1)) {
42251
42251
  return true;
42252
42252
  }
42253
42253
  return false;
@@ -42269,7 +42269,7 @@ var __publicField = (obj, key, value) => {
42269
42269
  return true;
42270
42270
  }
42271
42271
  }
42272
- if (list2.level > next.level) {
42272
+ if ((list2.level || 1) > (next.level || 1)) {
42273
42273
  return true;
42274
42274
  }
42275
42275
  return false;
@@ -42466,7 +42466,7 @@ var __publicField = (obj, key, value) => {
42466
42466
  editor.updateBlockData(c.block, {
42467
42467
  ...oldData,
42468
42468
  groupId,
42469
- level: oldData.level - 1
42469
+ level: (oldData.level || 1) - 1
42470
42470
  });
42471
42471
  if (c.children.length) {
42472
42472
  changeChildrenGroupId(editor, c.children, oldData.groupId);
@@ -42668,7 +42668,7 @@ var __publicField = (obj, key, value) => {
42668
42668
  const oldData2 = editor.getBlockData(b);
42669
42669
  editor.updateBlockData(b, {
42670
42670
  ...oldData2,
42671
- level: oldData2.level + 1
42671
+ level: (oldData2.level || 1) + 1
42672
42672
  });
42673
42673
  });
42674
42674
  editor.doc.endBatchUpdate();
@@ -43118,7 +43118,7 @@ var __publicField = (obj, key, value) => {
43118
43118
  const listData = blockData;
43119
43119
  const { level, start, groupId } = listData;
43120
43120
  const type = getListType(listData);
43121
- blockElement.setAttribute("data-list-level", `${level}`);
43121
+ blockElement.setAttribute("data-list-level", `${level || 1}`);
43122
43122
  blockElement.setAttribute("data-list-start", `${start || 1}`);
43123
43123
  blockElement.setAttribute("data-list-group-id", `${groupId}`);
43124
43124
  blockElement.setAttribute("data-list-type", type);
@@ -71422,12 +71422,13 @@ ${data.flowchartText}
71422
71422
  FileBox
71423
71423
  ];
71424
71424
  function createHistoryEditor(root2, doc2, options) {
71425
- var _a, _b, _c;
71425
+ var _a, _b, _c, _d;
71426
+ Logger$2.level = (_a = options.logLevel) != null ? _a : LogLevel.DEBUG;
71426
71427
  const editor = createEditor(root2, doc2, {
71427
71428
  components: {
71428
- blocks: [...StandardBlocks, ...((_a = options == null ? void 0 : options.components) == null ? void 0 : _a.blocks) || []],
71429
- embeds: [...StandardEmbeds, ...((_b = options.components) == null ? void 0 : _b.embeds) || []],
71430
- boxes: [...StandardBoxes, ...((_c = options.components) == null ? void 0 : _c.boxes) || []],
71429
+ blocks: [...StandardBlocks, ...((_b = options == null ? void 0 : options.components) == null ? void 0 : _b.blocks) || []],
71430
+ embeds: [...StandardEmbeds, ...((_c = options.components) == null ? void 0 : _c.embeds) || []],
71431
+ boxes: [...StandardBoxes, ...((_d = options.components) == null ? void 0 : _d.boxes) || []],
71431
71432
  textRenders: [new BlockPaddingRender()],
71432
71433
  options: { ...options.componentsOptions }
71433
71434
  }
@@ -73123,7 +73124,7 @@ ${data.flowchartText}
73123
73124
  return doc2.toJSON !== void 0;
73124
73125
  }
73125
73126
  async function createLocalEditor(root2, docData, options) {
73126
- var _a, _b, _c, _d, _e;
73127
+ var _a, _b, _c, _d, _e, _f;
73127
73128
  assert(logger, root2, "app does not exists");
73128
73129
  const doc2 = isDoc(docData) ? docData : new LocalDoc(docData, {
73129
73130
  serverUrl: options.serverUrl || ""
@@ -73131,6 +73132,7 @@ ${data.flowchartText}
73131
73132
  if (options.lang) {
73132
73133
  i18n$1.setLang(options.lang);
73133
73134
  }
73135
+ Logger$2.level = (_a = options.logLevel) != null ? _a : LogLevel.DEBUG;
73134
73136
  const editor = createEditor(root2, doc2, {
73135
73137
  id: options.id,
73136
73138
  scrollContainer: options == null ? void 0 : options.scrollContainer,
@@ -73138,11 +73140,11 @@ ${data.flowchartText}
73138
73140
  blocks: [TableBlock, CodeBlock, CodeLineBlock, ListBlock],
73139
73141
  commandProviders: [new TableBlockCommandProvider()],
73140
73142
  decorators: [new CodeTextDecorator(), new RemoteCaretsDecorator()],
73141
- embeds: [...StandardEmbeds, ...((_a = options.components) == null ? void 0 : _a.embeds) || []],
73142
- boxes: [MathjaxBox, MentionBox, FileBox, ...((_b = options.components) == null ? void 0 : _b.boxes) || []],
73143
+ embeds: [...StandardEmbeds, ...((_b = options.components) == null ? void 0 : _b.embeds) || []],
73144
+ boxes: [MathjaxBox, MentionBox, FileBox, ...((_c = options.components) == null ? void 0 : _c.boxes) || []],
73143
73145
  insertions: [RemoteCaretsInsertion],
73144
- blockHooks: [new BlockLockerHook(), ...((_c = options.components) == null ? void 0 : _c.blockHooks) || []],
73145
- textRenders: [new OnesEditorCommentsRender(), new BlockPaddingRender(), ...((_d = options.components) == null ? void 0 : _d.textRenders) || []],
73146
+ blockHooks: [new BlockLockerHook(), ...((_d = options.components) == null ? void 0 : _d.blockHooks) || []],
73147
+ textRenders: [new OnesEditorCommentsRender(), new BlockPaddingRender(), ...((_e = options.components) == null ? void 0 : _e.textRenders) || []],
73146
73148
  options: { ...options.componentsOptions }
73147
73149
  },
73148
73150
  shortcuts: [TableShortcuts, FindReplaceShortcuts, TextStyleShortcuts, DefaultShortcuts]
@@ -73157,7 +73159,7 @@ ${data.flowchartText}
73157
73159
  readonlyTitlePlaceholder: i18n$1.t("placeholder.local.readonlyTitle"),
73158
73160
  addPlaceholderToAllCurrentEmptyBlock: true
73159
73161
  }));
73160
- editor.input.addHandler(new OnesEditorQuickMenu(editor, (_e = options.componentsOptions) == null ? void 0 : _e.quickMenu));
73162
+ editor.input.addHandler(new OnesEditorQuickMenu(editor, (_f = options.componentsOptions) == null ? void 0 : _f.quickMenu));
73161
73163
  editor.input.addHandler(new PasteSpecialHandler(editor));
73162
73164
  editor.input.addHandler(new OnesEditorPasteHandler(editor));
73163
73165
  editor.input.addHandler(new BlockLockerPasteHandler());
package/dist/types.d.ts CHANGED
@@ -74,6 +74,7 @@ export interface CreateOnesEditorOptions {
74
74
  export interface CreateLocalEditorOptions {
75
75
  id?: string;
76
76
  lang?: i18n.LANGS;
77
+ logLevel?: LogLevel;
77
78
  scrollContainer?: HTMLElement;
78
79
  components?: {
79
80
  embeds?: Embed[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "0.0.9-beta.3",
3
+ "version": "0.0.9-beta.5",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",