@worktile/theia 3.0.0-next.6 → 3.0.2
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/bundles/worktile-theia.umd.js +85 -94
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/core/utils/index.d.ts +1 -1
- package/core/utils/merge-array.d.ts +1 -0
- package/esm2015/core/create-plugin.js +3 -2
- package/esm2015/core/utils/flatten-deep-plugins.js +3 -2
- package/esm2015/core/utils/get-plugin-options.js +2 -2
- package/esm2015/core/utils/get-plugin.js +2 -3
- package/esm2015/core/utils/index.js +2 -2
- package/esm2015/core/utils/merge-array.js +18 -0
- package/esm2015/core/utils/merge-deep-plugins.js +1 -3
- package/esm2015/core/utils/merge-options.js +5 -3
- package/esm2015/core/with-theia.js +2 -2
- package/esm2015/editor.component.js +3 -2
- package/esm2015/interfaces/plugins/plugins.js +1 -1
- package/esm2015/plugins/autoformat/autoformat.plugin.js +1 -1
- package/esm2015/plugins/index.js +2 -2
- package/esm2015/plugins/table/components/table.component.js +5 -4
- package/esm2015/plugins/todo-item/todo-item.component.js +8 -2
- package/esm2015/queries/get-insert-elements-path.js +23 -52
- package/esm2015/transforms/insert-elements.js +2 -2
- package/fesm2015/worktile-theia.js +64 -74
- package/fesm2015/worktile-theia.js.map +1 -1
- package/interfaces/plugins/plugins.d.ts +3 -0
- package/package.json +1 -1
- package/plugins/autoformat/autoformat.plugin.d.ts +1 -1
- package/plugins/index.d.ts +1 -1
- package/plugins/table/components/table.component.d.ts +2 -2
- package/plugins/todo-item/todo-item.component.d.ts +1 -0
- package/queries/get-insert-elements-path.d.ts +5 -2
- package/styles/editor.scss +5 -0
- package/core/utils/get-plugin-by-key.d.ts +0 -2
- package/esm2015/core/utils/get-plugin-by-key.js +0 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('slate-angular'), require('ngx-tethys/core'), require('is-hotkey'), require('slate'), require('slate-history'), require('rxjs'), require('ngx-tethys/popover'), require('ngx-tethys/icon'), require('ngx-tethys/input'), require('@atinc/selene'), require('lodash'), require('ngx-tethys/util'), require('@angular/cdk/overlay'), require('marked'), require('ngx-tethys/alert'), require('rxjs/operators'), require('ngx-tethys/uploader'), require('@angular/platform-browser'), require('ngx-tethys/progress'), require('ngx-tethys/nav'), require('ngx-tethys/tooltip'), require('ng-codemirror'), require('ngx-tethys/notify'), require('ngx-tethys/action-menu'), require('ngx-tethys/switch'), require('ngx-tethys/resizable'), require('is-url'), require('ngx-tethys/button'), require('ngx-tethys/form'), require('ngx-tethys/shared'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@worktile/theia', ['exports', '@angular/core', '@angular/common', '@angular/forms', 'slate-angular', 'ngx-tethys/core', 'is-hotkey', 'slate', 'slate-history', 'rxjs', 'ngx-tethys/popover', 'ngx-tethys/icon', 'ngx-tethys/input', '@atinc/selene', 'lodash', 'ngx-tethys/util', '@angular/cdk/overlay', 'marked', 'ngx-tethys/alert', 'rxjs/operators', 'ngx-tethys/uploader', '@angular/platform-browser', 'ngx-tethys/progress', 'ngx-tethys/nav', 'ngx-tethys/tooltip', 'ng-codemirror', 'ngx-tethys/notify', 'ngx-tethys/action-menu', 'ngx-tethys/switch', 'ngx-tethys/resizable', 'is-url', 'ngx-tethys/button', 'ngx-tethys/form', 'ngx-tethys/shared', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.worktile = global.worktile || {}, global.worktile.theia = {}), global.ng.core, global.ng.common, global.ng.forms, global.i1, global.core, global.isHotkey, global.slate, global.slateHistory, global.rxjs, global.i1$1, global.i4, global.i5, global.selene, global._lodash, global.util, global.ng.cdk.overlay, global.marked, global.i1$2, global.rxjs.operators, global.uploader, global.ng.platformBrowser, global.i6, global.i3, global.i5$1, global.i8, global.i1$
|
|
5
|
-
})(this, (function (exports, i0, i10, i4$1, i1, core, isHotkey, slate, slateHistory, rxjs, i1$1, i4, i5, selene, _lodash, util, i2, marked, i1$2, operators, uploader, i1$
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('slate-angular'), require('ngx-tethys/core'), require('is-hotkey'), require('slate'), require('slate-history'), require('rxjs'), require('ngx-tethys/popover'), require('ngx-tethys/icon'), require('ngx-tethys/input'), require('@atinc/selene'), require('lodash'), require('ngx-tethys/util'), require('@angular/cdk/overlay'), require('marked'), require('ngx-tethys'), require('ngx-tethys/alert'), require('rxjs/operators'), require('ngx-tethys/uploader'), require('@angular/platform-browser'), require('ngx-tethys/progress'), require('ngx-tethys/nav'), require('ngx-tethys/tooltip'), require('ng-codemirror'), require('ngx-tethys/notify'), require('ngx-tethys/action-menu'), require('ngx-tethys/switch'), require('ngx-tethys/resizable'), require('is-url'), require('ngx-tethys/button'), require('ngx-tethys/form'), require('ngx-tethys/shared'), require('@angular/cdk/coercion'), require('@angular/cdk/portal'), require('ngx-tethys/list'), require('ngx-tethys/autocomplete'), require('ngx-tethys/avatar'), require('ngx-tethys/select')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@worktile/theia', ['exports', '@angular/core', '@angular/common', '@angular/forms', 'slate-angular', 'ngx-tethys/core', 'is-hotkey', 'slate', 'slate-history', 'rxjs', 'ngx-tethys/popover', 'ngx-tethys/icon', 'ngx-tethys/input', '@atinc/selene', 'lodash', 'ngx-tethys/util', '@angular/cdk/overlay', 'marked', 'ngx-tethys', 'ngx-tethys/alert', 'rxjs/operators', 'ngx-tethys/uploader', '@angular/platform-browser', 'ngx-tethys/progress', 'ngx-tethys/nav', 'ngx-tethys/tooltip', 'ng-codemirror', 'ngx-tethys/notify', 'ngx-tethys/action-menu', 'ngx-tethys/switch', 'ngx-tethys/resizable', 'is-url', 'ngx-tethys/button', 'ngx-tethys/form', 'ngx-tethys/shared', '@angular/cdk/coercion', '@angular/cdk/portal', 'ngx-tethys/list', 'ngx-tethys/autocomplete', 'ngx-tethys/avatar', 'ngx-tethys/select'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.worktile = global.worktile || {}, global.worktile.theia = {}), global.ng.core, global.ng.common, global.ng.forms, global.i1, global.core, global.isHotkey, global.slate, global.slateHistory, global.rxjs, global.i1$1, global.i4, global.i5, global.selene, global._lodash, global.util, global.ng.cdk.overlay, global.marked, global.i1$2, global.i1$3, global.rxjs.operators, global.uploader, global.ng.platformBrowser, global.i6, global.i3, global.i5$1, global.i8, global.i1$5, global.i2$1, global.i5$2, global.i9, global.isUrl, global.i1$6, global.i2$2, global.i5$3, global.ng.cdk.coercion, global.ng.cdk.portal, global.i1$7, global.autocomplete, global.avatar, global.select));
|
|
5
|
+
})(this, (function (exports, i0, i10, i4$1, i1, core, isHotkey, slate, slateHistory, rxjs, i1$1, i4, i5, selene, _lodash, util, i2, marked, i1$2, i1$3, operators, uploader, i1$4, i6, i3, i5$1, i8, i1$5, i2$1, i5$2, i9, isUrl, i1$6, i2$2, i5$3, coercion, portal, i1$7, autocomplete, avatar, select) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -35,21 +35,21 @@
|
|
|
35
35
|
var _lodash__namespace = /*#__PURE__*/_interopNamespace(_lodash);
|
|
36
36
|
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
37
37
|
var marked__default = /*#__PURE__*/_interopDefaultLegacy(marked);
|
|
38
|
-
var i1__namespace$
|
|
39
|
-
var i1__namespace$
|
|
38
|
+
var i1__namespace$6 = /*#__PURE__*/_interopNamespace(i1$2);
|
|
39
|
+
var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$3);
|
|
40
|
+
var i1__namespace$3 = /*#__PURE__*/_interopNamespace(i1$4);
|
|
40
41
|
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
41
42
|
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
42
43
|
var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
|
|
43
44
|
var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
|
|
44
|
-
var i1__namespace$4 = /*#__PURE__*/_interopNamespace(i1$
|
|
45
|
+
var i1__namespace$4 = /*#__PURE__*/_interopNamespace(i1$5);
|
|
45
46
|
var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
|
|
46
47
|
var i5__namespace$2 = /*#__PURE__*/_interopNamespace(i5$2);
|
|
47
48
|
var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
|
|
48
49
|
var isUrl__default = /*#__PURE__*/_interopDefaultLegacy(isUrl);
|
|
49
|
-
var i1__namespace$5 = /*#__PURE__*/_interopNamespace(i1$
|
|
50
|
+
var i1__namespace$5 = /*#__PURE__*/_interopNamespace(i1$6);
|
|
50
51
|
var i2__namespace$2 = /*#__PURE__*/_interopNamespace(i2$2);
|
|
51
52
|
var i5__namespace$3 = /*#__PURE__*/_interopNamespace(i5$3);
|
|
52
|
-
var i1__namespace$6 = /*#__PURE__*/_interopNamespace(i1$6);
|
|
53
53
|
var i1__namespace$7 = /*#__PURE__*/_interopNamespace(i1$7);
|
|
54
54
|
|
|
55
55
|
/*! *****************************************************************************
|
|
@@ -1410,7 +1410,7 @@
|
|
|
1410
1410
|
if (!plugins)
|
|
1411
1411
|
return;
|
|
1412
1412
|
plugins.forEach(function (plugin) {
|
|
1413
|
-
var p = plugin;
|
|
1413
|
+
var p = _.cloneDeep(plugin);
|
|
1414
1414
|
if (!p.options)
|
|
1415
1415
|
p.options = {};
|
|
1416
1416
|
if (!p.nestedStructureByKey)
|
|
@@ -1425,28 +1425,41 @@
|
|
|
1425
1425
|
return (_a = editor === null || editor === void 0 ? void 0 : editor.plugins) !== null && _a !== void 0 ? _a : [];
|
|
1426
1426
|
};
|
|
1427
1427
|
|
|
1428
|
-
var
|
|
1429
|
-
var plugins = {};
|
|
1430
|
-
if (editor === null || editor === void 0 ? void 0 : editor.pluginsByKey) {
|
|
1431
|
-
return editor.pluginsByKey;
|
|
1432
|
-
}
|
|
1433
|
-
return plugins;
|
|
1434
|
-
};
|
|
1428
|
+
var getPlugin = function (editor, key) { return editor.pluginsByKey[key]; };
|
|
1435
1429
|
|
|
1436
|
-
var
|
|
1430
|
+
var getPluginOptions = function (editor, key) { var _a, _b; return (_b = (_a = getPlugin(editor, key)) === null || _a === void 0 ? void 0 : _a.options) !== null && _b !== void 0 ? _b : {}; };
|
|
1437
1431
|
|
|
1438
|
-
var
|
|
1432
|
+
var mergeArray = function (origin, source) {
|
|
1433
|
+
if (!Array.isArray(source))
|
|
1434
|
+
return source;
|
|
1435
|
+
var _loop_1 = function (i) {
|
|
1436
|
+
var value = source[i];
|
|
1437
|
+
if (util.isObject(value) && (value === null || value === void 0 ? void 0 : value.key) && origin.some(function (item) { return (item === null || item === void 0 ? void 0 : item.key) === (value === null || value === void 0 ? void 0 : value.key); })) {
|
|
1438
|
+
var index = origin.findIndex(function (item) { return (item === null || item === void 0 ? void 0 : item.key) === (value === null || value === void 0 ? void 0 : value.key); });
|
|
1439
|
+
origin[index] = Object.assign(Object.assign({}, origin[index]), value);
|
|
1440
|
+
return "continue";
|
|
1441
|
+
}
|
|
1442
|
+
if (origin.includes(source[i]))
|
|
1443
|
+
return "continue";
|
|
1444
|
+
origin.push(source[i]);
|
|
1445
|
+
};
|
|
1446
|
+
for (var i = 0; i < source.length; i++) {
|
|
1447
|
+
_loop_1(i);
|
|
1448
|
+
}
|
|
1449
|
+
return origin;
|
|
1450
|
+
};
|
|
1439
1451
|
|
|
1440
1452
|
var mergeOptions = function (plugin, override) {
|
|
1441
1453
|
var options = plugin.options;
|
|
1442
1454
|
var newOptions = {};
|
|
1443
1455
|
for (var option in options) {
|
|
1444
|
-
if (Array.isArray(options[option])) {
|
|
1445
|
-
newOptions[option] =
|
|
1456
|
+
if (Array.isArray(options[option]) && override.options[option]) {
|
|
1457
|
+
newOptions[option] = mergeArray(options[option], override.options[option]);
|
|
1446
1458
|
continue;
|
|
1447
1459
|
}
|
|
1448
1460
|
if (util.isObject(options[option])) {
|
|
1449
1461
|
newOptions[option] = _.assign(options[option], override.options[option]);
|
|
1462
|
+
continue;
|
|
1450
1463
|
}
|
|
1451
1464
|
newOptions[option] = override.options[option] ? override.options[option] : options[option];
|
|
1452
1465
|
}
|
|
@@ -1470,7 +1483,6 @@
|
|
|
1470
1483
|
newPlugins.forEach(function (p) {
|
|
1471
1484
|
if (editor.pluginsByKey[p.key]) {
|
|
1472
1485
|
mergeOptions(p, plugin.overrideByKey[p.key]);
|
|
1473
|
-
editor.pluginsByKey[p.key] = _.defaultsDeep(p, plugin.overrideByKey[p.key]);
|
|
1474
1486
|
}
|
|
1475
1487
|
});
|
|
1476
1488
|
}
|
|
@@ -1512,7 +1524,7 @@
|
|
|
1512
1524
|
// withOverridesByKey
|
|
1513
1525
|
flattenDeepPlugins(e, plugins);
|
|
1514
1526
|
// mount pluginsByKey
|
|
1515
|
-
pluginsByKey(e, plugins);
|
|
1527
|
+
pluginsByKey(e, e.plugins);
|
|
1516
1528
|
// mount nestedStructureByKey
|
|
1517
1529
|
nestedStructureByKey(e, e.plugins);
|
|
1518
1530
|
// merge plugin to pluginByKey
|
|
@@ -1523,7 +1535,7 @@
|
|
|
1523
1535
|
|
|
1524
1536
|
var createPluginFactory = function (defaultPlugin) { return function (override, overrideByKey) {
|
|
1525
1537
|
if (overrideByKey === void 0) { overrideByKey = {}; }
|
|
1526
|
-
return defaultPlugin;
|
|
1538
|
+
return _.cloneDeep(defaultPlugin);
|
|
1527
1539
|
}; };
|
|
1528
1540
|
|
|
1529
1541
|
var toolbarInitialize = function (toolbarItems, global, inline, quick) {
|
|
@@ -2374,69 +2386,36 @@
|
|
|
2374
2386
|
return false;
|
|
2375
2387
|
var _b = __read(anchorBlockEntry(editor), 2), anchorBlockPath = _b[1];
|
|
2376
2388
|
var currentNodePath = anchorBlockPath.slice(0, parentEntry[1].length + 1);
|
|
2377
|
-
var illegalParentEntry =
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
at: parentEntry[1],
|
|
2383
|
-
match: function (n) { return n.type && !allowParentTypes.includes(n.type); }
|
|
2384
|
-
});
|
|
2385
|
-
if (_illegalParentEntry) {
|
|
2386
|
-
var childType = editor.nestedStructureByKey[_illegalParentEntry[0].type];
|
|
2387
|
-
if (!childType) {
|
|
2388
|
-
illegalParentEntry = _illegalParentEntry;
|
|
2389
|
-
}
|
|
2390
|
-
if (allowParentTypes.includes(childType)) {
|
|
2391
|
-
var rootKey_1 = findNestedStructureRootType(editor, _illegalParentEntry[0].type, '');
|
|
2392
|
-
parentEntry =
|
|
2393
|
-
parentEntry &&
|
|
2394
|
-
slate.Editor.above(editor, {
|
|
2395
|
-
mode: 'lowest',
|
|
2396
|
-
at: parentEntry[1],
|
|
2397
|
-
match: function (n) { return n.type && n.type === rootKey_1; }
|
|
2398
|
-
});
|
|
2399
|
-
}
|
|
2400
|
-
else {
|
|
2401
|
-
parentEntry = _illegalParentEntry;
|
|
2402
|
-
}
|
|
2403
|
-
}
|
|
2404
|
-
else {
|
|
2405
|
-
return "break";
|
|
2406
|
-
}
|
|
2407
|
-
};
|
|
2408
|
-
// 循环获取最外层的不可插入节点
|
|
2409
|
-
while (true) {
|
|
2410
|
-
var state_1 = _loop_1();
|
|
2411
|
-
if (state_1 === "break")
|
|
2412
|
-
break;
|
|
2413
|
-
}
|
|
2389
|
+
var illegalParentEntry = slate.Editor.above(editor, {
|
|
2390
|
+
mode: 'highest',
|
|
2391
|
+
at: parentEntry[1],
|
|
2392
|
+
match: function (n) { return n.type && !isAllowParentTypes(editor, n.type, allowParentTypes); }
|
|
2393
|
+
});
|
|
2414
2394
|
// 获取不可插入节点的根层节点
|
|
2415
2395
|
if (illegalParentEntry) {
|
|
2416
|
-
var rootKey_2 = findNestedStructureRootType(editor, illegalParentEntry[0].type, '');
|
|
2417
|
-
if (rootKey_2 && illegalParentEntry[0].type !== rootKey_2) {
|
|
2418
|
-
illegalParentEntry = slate.Editor.above(editor, {
|
|
2419
|
-
mode: 'lowest',
|
|
2420
|
-
at: parentEntry[1],
|
|
2421
|
-
match: function (n) { return n.type && n.type === rootKey_2; }
|
|
2422
|
-
});
|
|
2423
|
-
}
|
|
2424
2396
|
currentNodePath = illegalParentEntry && illegalParentEntry[1];
|
|
2425
2397
|
}
|
|
2426
2398
|
return currentNodePath && slate.Path.next(currentNodePath);
|
|
2427
2399
|
};
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
var
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2400
|
+
var isAllowParentTypes = function (editor, targetType, allowParentTypes) {
|
|
2401
|
+
var existChildType = isNestedStructureParentType(editor, targetType);
|
|
2402
|
+
var leafType = existChildType && findNestedStructureLeafType(editor, targetType);
|
|
2403
|
+
return allowParentTypes.includes(targetType) || allowParentTypes.includes(leafType);
|
|
2404
|
+
};
|
|
2405
|
+
var isNestedStructureParentType = function (editor, type) {
|
|
2406
|
+
for (var key in editor.nestedStructureByKey) {
|
|
2407
|
+
if (key === type) {
|
|
2408
|
+
return true;
|
|
2409
|
+
}
|
|
2436
2410
|
}
|
|
2437
|
-
|
|
2438
|
-
|
|
2411
|
+
return false;
|
|
2412
|
+
};
|
|
2413
|
+
var findNestedStructureLeafType = function (editor, target) {
|
|
2414
|
+
var leafType = editor.nestedStructureByKey[target];
|
|
2415
|
+
while (leafType && editor.nestedStructureByKey[leafType]) {
|
|
2416
|
+
leafType = editor.nestedStructureByKey[leafType];
|
|
2439
2417
|
}
|
|
2418
|
+
return leafType;
|
|
2440
2419
|
};
|
|
2441
2420
|
|
|
2442
2421
|
var isContainNestedType = function (editor, types) {
|
|
@@ -2530,7 +2509,7 @@
|
|
|
2530
2509
|
if (slate.Range.isExpanded(editor.selection)) {
|
|
2531
2510
|
slate.Editor.deleteFragment(editor);
|
|
2532
2511
|
}
|
|
2533
|
-
var type = !
|
|
2512
|
+
var type = !i1$2.isArray(elements) ? elements.type : elements[0].type; // 后期处理复制粘贴需要修改
|
|
2534
2513
|
var allowParentTypes = ((_a = getPluginOptions(editor, type)) === null || _a === void 0 ? void 0 : _a.allowParentTypes) || [];
|
|
2535
2514
|
var insertNodePath = getInsertElementsPath(editor, allowParentTypes);
|
|
2536
2515
|
var _b = __read(anchorBlockEntry(editor), 2), anchorBlock = _b[0], anchorBlockPath = _b[1];
|
|
@@ -4792,6 +4771,13 @@
|
|
|
4792
4771
|
_this.checkItemClass = true;
|
|
4793
4772
|
return _this;
|
|
4794
4773
|
}
|
|
4774
|
+
Object.defineProperty(TheTodoItemComponent.prototype, "checkItemSelectable", {
|
|
4775
|
+
get: function () {
|
|
4776
|
+
return this.editableWithReadonly && this.readonly;
|
|
4777
|
+
},
|
|
4778
|
+
enumerable: false,
|
|
4779
|
+
configurable: true
|
|
4780
|
+
});
|
|
4795
4781
|
Object.defineProperty(TheTodoItemComponent.prototype, "level", {
|
|
4796
4782
|
get: function () {
|
|
4797
4783
|
var _a;
|
|
@@ -4820,7 +4806,7 @@
|
|
|
4820
4806
|
return TheTodoItemComponent;
|
|
4821
4807
|
}(TheBaseElementComponent));
|
|
4822
4808
|
TheTodoItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheTodoItemComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: TheContextService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
4823
|
-
TheTodoItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheTodoItemComponent, selector: "div[theTodoItem]", host: { properties: { "class.the-temp-check-item": "this.checkItemClass", "attr.the-level": "this.level" } }, usesInheritance: true, ngImport: i0__namespace, template: "\n <span contenteditable=\"false\" class=\"todo-item-status\">\n <input #checkbox type=\"checkbox\" [checked]=\"element.checked\" (click)=\"onCheck(checkbox.checked)\" />\n </span>\n <span><slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children></span>\n ", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
|
|
4809
|
+
TheTodoItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheTodoItemComponent, selector: "div[theTodoItem]", host: { properties: { "class.the-temp-check-item": "this.checkItemClass", "class.the-todo-item-selectable": "this.checkItemSelectable", "attr.the-level": "this.level" } }, usesInheritance: true, ngImport: i0__namespace, template: "\n <span contenteditable=\"false\" class=\"todo-item-status\">\n <input #checkbox type=\"checkbox\" [checked]=\"element.checked\" (click)=\"onCheck(checkbox.checked)\" />\n </span>\n <span><slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children></span>\n ", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
|
|
4824
4810
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheTodoItemComponent, decorators: [{
|
|
4825
4811
|
type: i0.Component,
|
|
4826
4812
|
args: [{
|
|
@@ -4830,6 +4816,9 @@
|
|
|
4830
4816
|
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: TheContextService }]; }, propDecorators: { checkItemClass: [{
|
|
4831
4817
|
type: i0.HostBinding,
|
|
4832
4818
|
args: ['class.the-temp-check-item']
|
|
4819
|
+
}], checkItemSelectable: [{
|
|
4820
|
+
type: i0.HostBinding,
|
|
4821
|
+
args: ['class.the-todo-item-selectable']
|
|
4833
4822
|
}], level: [{
|
|
4834
4823
|
type: i0.HostBinding,
|
|
4835
4824
|
args: ['attr.the-level']
|
|
@@ -10256,6 +10245,7 @@
|
|
|
10256
10245
|
if (this.readonly)
|
|
10257
10246
|
return;
|
|
10258
10247
|
event.stopPropagation();
|
|
10248
|
+
event.preventDefault();
|
|
10259
10249
|
if (!this.isInTable) {
|
|
10260
10250
|
var path = TheEditor.findPath(this.editor, this.element);
|
|
10261
10251
|
slate.Transforms.select(this.editor, path);
|
|
@@ -10316,10 +10306,10 @@
|
|
|
10316
10306
|
});
|
|
10317
10307
|
});
|
|
10318
10308
|
};
|
|
10319
|
-
TheTableComponent.prototype.
|
|
10309
|
+
TheTableComponent.prototype.trackByFnRowControls = function (index) {
|
|
10320
10310
|
return index;
|
|
10321
10311
|
};
|
|
10322
|
-
TheTableComponent.prototype.
|
|
10312
|
+
TheTableComponent.prototype.trackByFnColControls = function (index) {
|
|
10323
10313
|
return index;
|
|
10324
10314
|
};
|
|
10325
10315
|
TheTableComponent.prototype.ngOnDestroy = function () {
|
|
@@ -10340,7 +10330,7 @@
|
|
|
10340
10330
|
provide: TheTableToken,
|
|
10341
10331
|
useExisting: TheTableComponent
|
|
10342
10332
|
}
|
|
10343
|
-
], viewQueries: [{ propertyName: "tableWrapper", first: true, predicate: ["tableWrapper"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "theTableElement", first: true, predicate: ["theTable"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "tbodyElement", first: true, predicate: ["tbody"], descendants: true, read: i0.ElementRef, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<!-- \u7C7B\u540D the-temp-*: \u4E34\u65F6\u89E3\u51B3\u56E0\u53D7portal\u5F71\u54CD\u8868\u683C\u6837\u5F0F\u95EE\u9898\uFF0C\u540E\u671F\u6539\u56DEthe-* -->\n<div\n class=\"the-temp-table-container\"\n theColumnResize\n [ngClass]=\"{\n 'the-temp-table-with-controls': isInTable,\n 'the-temp-numbered-column-container': element?.options?.numberedColumn,\n 'the-temp-table-selection-hide': tableStore.isCellSelecting || tableStore.isRightClicking\n }\"\n>\n <div\n class=\"the-temp-table-row-controls-wrapper\"\n [ngClass]=\"{\n 'the-temp-table-focus': isInTable\n }\"\n >\n <div\n class=\"the-temp-table-corner-controls\"\n [ngClass]=\"{\n visible: !readonly && isInTable,\n active: isSelectedAllCell,\n dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0\n }\"\n >\n <div class=\"the-temp-table-corner-button\" (mousedown)=\"onSelectTable($event)\"></div>\n <div class=\"the-temp-table-corner-controls-insert-row-marker\">\n <the-table-insert-mark type=\"row\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n <div class=\"the-temp-table-corner-controls-insert-column-marker\">\n <the-table-insert-mark type=\"column\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n </div>\n <div class=\"the-temp-table-row-controls\">\n <div class=\"the-temp-table-row-controls-inner\">\n <div\n class=\"the-temp-table-row-controls-button-wrap\"\n *ngFor=\"let control of rowControls; let i = index; trackBy:
|
|
10333
|
+
], viewQueries: [{ propertyName: "tableWrapper", first: true, predicate: ["tableWrapper"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "theTableElement", first: true, predicate: ["theTable"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "tbodyElement", first: true, predicate: ["tbody"], descendants: true, read: i0.ElementRef, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<!-- \u7C7B\u540D the-temp-*: \u4E34\u65F6\u89E3\u51B3\u56E0\u53D7portal\u5F71\u54CD\u8868\u683C\u6837\u5F0F\u95EE\u9898\uFF0C\u540E\u671F\u6539\u56DEthe-* -->\n<div\n class=\"the-temp-table-container\"\n theColumnResize\n [ngClass]=\"{\n 'the-temp-table-with-controls': isInTable,\n 'the-temp-numbered-column-container': element?.options?.numberedColumn,\n 'the-temp-table-selection-hide': tableStore.isCellSelecting || tableStore.isRightClicking\n }\"\n>\n <div\n class=\"the-temp-table-row-controls-wrapper\"\n [ngClass]=\"{\n 'the-temp-table-focus': isInTable\n }\"\n >\n <div\n class=\"the-temp-table-corner-controls\"\n [ngClass]=\"{\n visible: !readonly && isInTable,\n active: isSelectedAllCell,\n dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0\n }\"\n >\n <div class=\"the-temp-table-corner-button\" (mousedown)=\"onSelectTable($event)\"></div>\n <div class=\"the-temp-table-corner-controls-insert-row-marker\">\n <the-table-insert-mark type=\"row\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n <div class=\"the-temp-table-corner-controls-insert-column-marker\">\n <the-table-insert-mark type=\"column\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n </div>\n <div class=\"the-temp-table-row-controls\">\n <div class=\"the-temp-table-row-controls-inner\">\n <div\n class=\"the-temp-table-row-controls-button-wrap\"\n *ngFor=\"let control of rowControls; let i = index; trackBy: trackByFnRowControls\"\n [ngClass]=\"{\n active: tableStore.selectedRowsIndex.includes(control.rowIndex),\n dangerous: tableStore.dangerousRowsIndex.includes(control.rowIndex) && tableStore.dangerousCells.length > 0\n }\"\n >\n <ng-container *ngIf=\"!readonly && isInTable && !element?.options?.numberedColumn\">\n <button\n (mousedown)=\"onRowMouseDown($event, control.rowIndex)\"\n type=\"button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n class=\"the-temp-table-row-controls-button the-temp-table-controls-button\"\n ></button>\n </ng-container>\n <ng-container *ngIf=\"element?.options?.numberedColumn\">\n <div\n [contentEditable]=\"false\"\n contenteditable=\"false\"\n (mousedown)=\"onRowMouseDown($event, control.rowIndex)\"\n class=\"the-temp-table-numbered-controls-button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n >\n <p class=\"row-number d-flex align-items-center\">{{ i + 1 }}</p>\n </div>\n </ng-container>\n <the-table-insert-mark type=\"row\" [at]=\"control.rowIndex + 1\" [tableStore]=\"tableStore\"> </the-table-insert-mark>\n </div>\n </div>\n </div>\n </div>\n <div class=\"the-temp-table-wrapper\" #tableWrapper [ngClass]=\"{ 'the-temp-table-numbered': element?.options?.numberedColumn }\">\n <table class=\"the-temp-table\" #theTable [ngClass]=\"{ 'the-temp-table-with-controls': isInTable }\">\n <colgroup *ngIf=\"columns\">\n <col *ngFor=\"let col of columns\" [ngStyle]=\"{ width: col.width + 'px' }\" />\n </colgroup>\n <thead>\n <tr class=\"the-temp-table-col-controls-wrapper\">\n <th\n class=\"the-temp-table-col-controls\"\n [ngClass]=\"{\n active: tableStore.selectedColumnsIndex.includes(i),\n dangerous: tableStore.dangerousColumnsIndex.includes(i) && tableStore.dangerousCells.length > 0\n }\"\n (mousedown)=\"onColMouseDown($event, i)\"\n *ngFor=\"let control of colControls; let i = index; trackBy: trackByFnColControls\"\n >\n <the-table-insert-mark *ngIf=\"isInTable\" type=\"column\" [at]=\"i + 1\" [tableStore]=\"tableStore\">\n </the-table-insert-mark>\n </th>\n </tr>\n </thead>\n <tbody #tbody>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"> </slate-children>\n </tbody>\n </table>\n </div>\n</div>\n", components: [{ type: TheInsertMarkComponent, selector: "the-table-insert-mark", inputs: ["type", "at", "tableStore"] }, { type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }], directives: [{ type: TheColumnResizeDirective, selector: "div[theColumnResize]" }, { type: i10__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
10344
10334
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheTableComponent, decorators: [{
|
|
10345
10335
|
type: i0.Component,
|
|
10346
10336
|
args: [{
|
|
@@ -13363,7 +13353,7 @@
|
|
|
13363
13353
|
]
|
|
13364
13354
|
});
|
|
13365
13355
|
|
|
13366
|
-
var internalPlugins = [
|
|
13356
|
+
var internalPlugins = function () { return [
|
|
13367
13357
|
createTheHistoryPlugin(),
|
|
13368
13358
|
createAutoInsertDataPlugin(),
|
|
13369
13359
|
createRemoveEmptyPlugin(),
|
|
@@ -13398,7 +13388,7 @@
|
|
|
13398
13388
|
createDeserializeMdPlugin(),
|
|
13399
13389
|
createQuickInsertPlugin(),
|
|
13400
13390
|
createInlineCodePlugin()
|
|
13401
|
-
];
|
|
13391
|
+
]; };
|
|
13402
13392
|
|
|
13403
13393
|
var HOTKEYS = {
|
|
13404
13394
|
'mod+b': exports.MarkTypes.bold,
|
|
@@ -14223,7 +14213,8 @@
|
|
|
14223
14213
|
TheEditorComponent.prototype.initialize = function () {
|
|
14224
14214
|
var _this = this;
|
|
14225
14215
|
var _a, _b;
|
|
14226
|
-
var
|
|
14216
|
+
var defaultPlugins = internalPlugins();
|
|
14217
|
+
var plugins = __spreadArray(__spreadArray([], __read(defaultPlugins)), __read(this.thePlugins));
|
|
14227
14218
|
this.editor = withTheia(slateHistory.withHistory(i1.withAngular(slate.createEditor(), CLIPBOARD_FORMAT_KEY)), plugins);
|
|
14228
14219
|
this.generateDecorate();
|
|
14229
14220
|
this.editor.disabled = (_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.disabled;
|
|
@@ -14650,9 +14641,9 @@
|
|
|
14650
14641
|
i2$1.ThyActionMenuModule,
|
|
14651
14642
|
i5.ThyInputModule,
|
|
14652
14643
|
select.ThySelectModule,
|
|
14653
|
-
i1$
|
|
14654
|
-
i1$
|
|
14655
|
-
i1$
|
|
14644
|
+
i1$6.ThyButtonModule,
|
|
14645
|
+
i1$5.ThyNotifyModule,
|
|
14646
|
+
i1$3.ThyAlertModule,
|
|
14656
14647
|
i9.ThyResizableModule,
|
|
14657
14648
|
i5$2.ThySwitchModule
|
|
14658
14649
|
];
|
|
@@ -14751,9 +14742,9 @@
|
|
|
14751
14742
|
i2$1.ThyActionMenuModule,
|
|
14752
14743
|
i5.ThyInputModule,
|
|
14753
14744
|
select.ThySelectModule,
|
|
14754
|
-
i1$
|
|
14755
|
-
i1$
|
|
14756
|
-
i1$
|
|
14745
|
+
i1$6.ThyButtonModule,
|
|
14746
|
+
i1$5.ThyNotifyModule,
|
|
14747
|
+
i1$3.ThyAlertModule,
|
|
14757
14748
|
i9.ThyResizableModule,
|
|
14758
14749
|
i5$2.ThySwitchModule, i8.CodemirrorModule, TheColumnSizeModule], exports: [TheEditorComponent, TheToolbarComponent, TheToolbarDropdownComponent, TheToolbarItemComponent, TheDefaultElementComponent] });
|
|
14759
14750
|
TheEditorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheEditorModule, providers: [
|
|
@@ -14931,7 +14922,6 @@
|
|
|
14931
14922
|
exports.getElementWidth = getElementWidth;
|
|
14932
14923
|
exports.getEndBlock = getEndBlock;
|
|
14933
14924
|
exports.getPlugin = getPlugin;
|
|
14934
|
-
exports.getPluginByKey = getPluginByKey;
|
|
14935
14925
|
exports.getPluginOptions = getPluginOptions;
|
|
14936
14926
|
exports.getPlugins = getPlugins;
|
|
14937
14927
|
exports.getRowsTotalHeight = getRowsTotalHeight;
|
|
@@ -14944,6 +14934,7 @@
|
|
|
14944
14934
|
exports.internalPlugins = internalPlugins;
|
|
14945
14935
|
exports.isCleanEmptyParagraph = isCleanEmptyParagraph;
|
|
14946
14936
|
exports.isPureEmptyParagraph = isPureEmptyParagraph;
|
|
14937
|
+
exports.mergeArray = mergeArray;
|
|
14947
14938
|
exports.mergeDeepPlugins = mergeDeepPlugins;
|
|
14948
14939
|
exports.mergeElementOptions = mergeElementOptions;
|
|
14949
14940
|
exports.mergeOptions = mergeOptions;
|