@difizen/libro-core 0.0.2-alpha.0
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/README.md +3 -0
- package/es/add-cell/index.d.ts +4 -0
- package/es/add-cell/index.d.ts.map +1 -0
- package/es/add-cell/index.js +3 -0
- package/es/add-cell/index.less +38 -0
- package/es/add-cell/libro-add-cell-module.d.ts +3 -0
- package/es/add-cell/libro-add-cell-module.d.ts.map +1 -0
- package/es/add-cell/libro-add-cell-module.js +4 -0
- package/es/add-cell/libro-add-cell-slot-contribution.d.ts +12 -0
- package/es/add-cell/libro-add-cell-slot-contribution.d.ts.map +1 -0
- package/es/add-cell/libro-add-cell-slot-contribution.js +53 -0
- package/es/add-cell/libro-add-cell-view.d.ts +21 -0
- package/es/add-cell/libro-add-cell-view.d.ts.map +1 -0
- package/es/add-cell/libro-add-cell-view.js +129 -0
- package/es/cell/index.d.ts +10 -0
- package/es/cell/index.d.ts.map +1 -0
- package/es/cell/index.js +9 -0
- package/es/cell/libro-cell-contribution.d.ts +13 -0
- package/es/cell/libro-cell-contribution.d.ts.map +1 -0
- package/es/cell/libro-cell-contribution.js +41 -0
- package/es/cell/libro-cell-model.d.ts +19 -0
- package/es/cell/libro-cell-model.d.ts.map +1 -0
- package/es/cell/libro-cell-model.js +103 -0
- package/es/cell/libro-cell-module.d.ts +10 -0
- package/es/cell/libro-cell-module.d.ts.map +1 -0
- package/es/cell/libro-cell-module.js +30 -0
- package/es/cell/libro-cell-protocol.d.ts +42 -0
- package/es/cell/libro-cell-protocol.d.ts.map +1 -0
- package/es/cell/libro-cell-protocol.js +11 -0
- package/es/cell/libro-cell-service.d.ts +28 -0
- package/es/cell/libro-cell-service.d.ts.map +1 -0
- package/es/cell/libro-cell-service.js +242 -0
- package/es/cell/libro-cell-view.d.ts +65 -0
- package/es/cell/libro-cell-view.d.ts.map +1 -0
- package/es/cell/libro-cell-view.js +191 -0
- package/es/cell/libro-edit-cell-view.d.ts +32 -0
- package/es/cell/libro-edit-cell-view.d.ts.map +1 -0
- package/es/cell/libro-edit-cell-view.js +72 -0
- package/es/cell/libro-executable-cell-model.d.ts +14 -0
- package/es/cell/libro-executable-cell-model.d.ts.map +1 -0
- package/es/cell/libro-executable-cell-model.js +7 -0
- package/es/cell/libro-executable-cell-view.d.ts +27 -0
- package/es/cell/libro-executable-cell-view.d.ts.map +1 -0
- package/es/cell/libro-executable-cell-view.js +66 -0
- package/es/cell/libro-markdown-cell-model.d.ts +9 -0
- package/es/cell/libro-markdown-cell-model.d.ts.map +1 -0
- package/es/cell/libro-markdown-cell-model.js +7 -0
- package/es/collapse-service.d.ts +36 -0
- package/es/collapse-service.d.ts.map +1 -0
- package/es/collapse-service.js +55 -0
- package/es/command/document-commands.d.ts +6 -0
- package/es/command/document-commands.d.ts.map +1 -0
- package/es/command/document-commands.js +13 -0
- package/es/command/index.d.ts +7 -0
- package/es/command/index.d.ts.map +1 -0
- package/es/command/index.js +6 -0
- package/es/command/kernel-command.d.ts +5 -0
- package/es/command/kernel-command.d.ts.map +1 -0
- package/es/command/kernel-command.js +39 -0
- package/es/command/libro-command-contribution.d.ts +14 -0
- package/es/command/libro-command-contribution.d.ts.map +1 -0
- package/es/command/libro-command-contribution.js +1751 -0
- package/es/command/libro-command-register.d.ts +22 -0
- package/es/command/libro-command-register.d.ts.map +1 -0
- package/es/command/libro-command-register.js +105 -0
- package/es/command/module.d.ts +3 -0
- package/es/command/module.d.ts.map +1 -0
- package/es/command/module.js +4 -0
- package/es/command/notebook-commands.d.ts +6 -0
- package/es/command/notebook-commands.d.ts.map +1 -0
- package/es/command/notebook-commands.js +468 -0
- package/es/components/cell-protocol.d.ts +20 -0
- package/es/components/cell-protocol.d.ts.map +1 -0
- package/es/components/cell-protocol.js +4 -0
- package/es/components/dnd-cell-item-render.d.ts +12 -0
- package/es/components/dnd-cell-item-render.d.ts.map +1 -0
- package/es/components/dnd-cell-item-render.js +253 -0
- package/es/components/dnd-component/custom-drag-layer.d.ts +9 -0
- package/es/components/dnd-component/custom-drag-layer.d.ts.map +1 -0
- package/es/components/dnd-component/custom-drag-layer.js +141 -0
- package/es/components/dnd-component/default-dnd-content.d.ts +10 -0
- package/es/components/dnd-component/default-dnd-content.d.ts.map +1 -0
- package/es/components/dnd-component/default-dnd-content.js +257 -0
- package/es/components/dnd-component/dnd-context.d.ts +3 -0
- package/es/components/dnd-component/dnd-context.d.ts.map +1 -0
- package/es/components/dnd-component/dnd-context.js +20 -0
- package/es/components/dnd-component/dnd-list.d.ts +10 -0
- package/es/components/dnd-component/dnd-list.d.ts.map +1 -0
- package/es/components/dnd-component/dnd-list.js +115 -0
- package/es/components/dnd-component/index.d.ts +5 -0
- package/es/components/dnd-component/index.d.ts.map +1 -0
- package/es/components/dnd-component/index.js +4 -0
- package/es/components/index.d.ts +6 -0
- package/es/components/index.d.ts.map +1 -0
- package/es/components/index.js +5 -0
- package/es/components/libro-component.d.ts +5 -0
- package/es/components/libro-component.d.ts.map +1 -0
- package/es/components/libro-component.js +35 -0
- package/es/components/libro-side-toolbar-menu.d.ts +21 -0
- package/es/components/libro-side-toolbar-menu.d.ts.map +1 -0
- package/es/components/libro-side-toolbar-menu.js +58 -0
- package/es/components/libro-view-header.d.ts +3 -0
- package/es/components/libro-view-header.d.ts.map +1 -0
- package/es/components/libro-view-header.js +37 -0
- package/es/configuration/libro-configuration-contribution.d.ts +5 -0
- package/es/configuration/libro-configuration-contribution.d.ts.map +1 -0
- package/es/configuration/libro-configuration-contribution.js +24 -0
- package/es/configuration/libro-configuration.d.ts +10 -0
- package/es/configuration/libro-configuration.d.ts.map +1 -0
- package/es/configuration/libro-configuration.js +81 -0
- package/es/content/index.d.ts +5 -0
- package/es/content/index.d.ts.map +1 -0
- package/es/content/index.js +4 -0
- package/es/content/libro-content-contribution.d.ts +11 -0
- package/es/content/libro-content-contribution.d.ts.map +1 -0
- package/es/content/libro-content-contribution.js +32 -0
- package/es/content/libro-content-module.d.ts +3 -0
- package/es/content/libro-content-module.d.ts.map +1 -0
- package/es/content/libro-content-module.js +5 -0
- package/es/content/libro-content-protocol.d.ts +8 -0
- package/es/content/libro-content-protocol.d.ts.map +1 -0
- package/es/content/libro-content-protocol.js +2 -0
- package/es/content/libro-content-service.d.ts +9 -0
- package/es/content/libro-content-service.d.ts.map +1 -0
- package/es/content/libro-content-service.js +35 -0
- package/es/index.d.ts +20 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +19 -0
- package/es/index.less +682 -0
- package/es/libro-context-key.d.ts +22 -0
- package/es/libro-context-key.d.ts.map +1 -0
- package/es/libro-context-key.js +80 -0
- package/es/libro-keybind-registry.d.ts +5 -0
- package/es/libro-keybind-registry.d.ts.map +1 -0
- package/es/libro-keybind-registry.js +68 -0
- package/es/libro-model.d.ts +129 -0
- package/es/libro-model.d.ts.map +1 -0
- package/es/libro-model.js +803 -0
- package/es/libro-protocol.d.ts +241 -0
- package/es/libro-protocol.d.ts.map +1 -0
- package/es/libro-protocol.js +34 -0
- package/es/libro-service.d.ts +34 -0
- package/es/libro-service.d.ts.map +1 -0
- package/es/libro-service.js +180 -0
- package/es/libro-view-tracker.d.ts +6 -0
- package/es/libro-view-tracker.d.ts.map +1 -0
- package/es/libro-view-tracker.js +13 -0
- package/es/libro-view.d.ts +151 -0
- package/es/libro-view.d.ts.map +1 -0
- package/es/libro-view.js +1963 -0
- package/es/material-from-designer.d.ts +27 -0
- package/es/material-from-designer.d.ts.map +1 -0
- package/es/material-from-designer.js +550 -0
- package/es/module.d.ts +3 -0
- package/es/module.d.ts.map +1 -0
- package/es/module.js +55 -0
- package/es/output/index.d.ts +6 -0
- package/es/output/index.d.ts.map +1 -0
- package/es/output/index.js +5 -0
- package/es/output/output-area.d.ts +51 -0
- package/es/output/output-area.d.ts.map +1 -0
- package/es/output/output-area.js +346 -0
- package/es/output/output-contribution.d.ts +11 -0
- package/es/output/output-contribution.d.ts.map +1 -0
- package/es/output/output-contribution.js +31 -0
- package/es/output/output-model.d.ts +27 -0
- package/es/output/output-model.d.ts.map +1 -0
- package/es/output/output-model.js +95 -0
- package/es/output/output-module.d.ts +3 -0
- package/es/output/output-module.d.ts.map +1 -0
- package/es/output/output-module.js +6 -0
- package/es/output/output-protocol.d.ts +130 -0
- package/es/output/output-protocol.d.ts.map +1 -0
- package/es/output/output-protocol.js +18 -0
- package/es/slot/index.d.ts +5 -0
- package/es/slot/index.d.ts.map +1 -0
- package/es/slot/index.js +4 -0
- package/es/slot/libro-slot-manager.d.ts +13 -0
- package/es/slot/libro-slot-manager.d.ts.map +1 -0
- package/es/slot/libro-slot-manager.js +57 -0
- package/es/slot/libro-slot-protocol.d.ts +19 -0
- package/es/slot/libro-slot-protocol.d.ts.map +1 -0
- package/es/slot/libro-slot-protocol.js +5 -0
- package/es/slot/libro-slot-view.d.ts +9 -0
- package/es/slot/libro-slot-view.d.ts.map +1 -0
- package/es/slot/libro-slot-view.js +81 -0
- package/es/slot/module.d.ts +3 -0
- package/es/slot/module.d.ts.map +1 -0
- package/es/slot/module.js +5 -0
- package/es/theme/libro-color-registry.d.ts +6 -0
- package/es/theme/libro-color-registry.d.ts.map +1 -0
- package/es/theme/libro-color-registry.js +494 -0
- package/es/toolbar/change-cell-to-selector.d.ts +5 -0
- package/es/toolbar/change-cell-to-selector.d.ts.map +1 -0
- package/es/toolbar/change-cell-to-selector.js +48 -0
- package/es/toolbar/hide-all-selector.d.ts +5 -0
- package/es/toolbar/hide-all-selector.d.ts.map +1 -0
- package/es/toolbar/hide-all-selector.js +99 -0
- package/es/toolbar/index.d.ts +4 -0
- package/es/toolbar/index.d.ts.map +1 -0
- package/es/toolbar/index.js +3 -0
- package/es/toolbar/index.less +59 -0
- package/es/toolbar/libro-toolbar-protocol.d.ts +4 -0
- package/es/toolbar/libro-toolbar-protocol.d.ts.map +1 -0
- package/es/toolbar/libro-toolbar-protocol.js +1 -0
- package/es/toolbar/libro-toolbar.d.ts +8 -0
- package/es/toolbar/libro-toolbar.d.ts.map +1 -0
- package/es/toolbar/libro-toolbar.js +223 -0
- package/es/toolbar/module.d.ts +3 -0
- package/es/toolbar/module.d.ts.map +1 -0
- package/es/toolbar/module.js +5 -0
- package/es/toolbar/restart-clear-outputs-contribution.d.ts +5 -0
- package/es/toolbar/restart-clear-outputs-contribution.d.ts.map +1 -0
- package/es/toolbar/restart-clear-outputs-contribution.js +23 -0
- package/es/toolbar/restart-clear-outputs-modal.d.ts +6 -0
- package/es/toolbar/restart-clear-outputs-modal.d.ts.map +1 -0
- package/es/toolbar/restart-clear-outputs-modal.js +30 -0
- package/es/toolbar/save-icon.d.ts +3 -0
- package/es/toolbar/save-icon.d.ts.map +1 -0
- package/es/toolbar/save-icon.js +54 -0
- package/es/toolbar/shutdown-contribution.d.ts +5 -0
- package/es/toolbar/shutdown-contribution.d.ts.map +1 -0
- package/es/toolbar/shutdown-contribution.js +23 -0
- package/es/toolbar/shutdown-modal.d.ts +6 -0
- package/es/toolbar/shutdown-modal.d.ts.map +1 -0
- package/es/toolbar/shutdown-modal.js +30 -0
- package/es/toolbar/side-toolar-more-select.d.ts +4 -0
- package/es/toolbar/side-toolar-more-select.d.ts.map +1 -0
- package/es/toolbar/side-toolar-more-select.js +161 -0
- package/es/typings/index.d.ts +1 -0
- package/package.json +70 -0
- package/src/add-cell/index.less +38 -0
- package/src/add-cell/index.ts +3 -0
- package/src/add-cell/libro-add-cell-module.ts +9 -0
- package/src/add-cell/libro-add-cell-slot-contribution.ts +31 -0
- package/src/add-cell/libro-add-cell-view.tsx +101 -0
- package/src/cell/README.md +14 -0
- package/src/cell/index.ts +9 -0
- package/src/cell/libro-cell-contribution.ts +38 -0
- package/src/cell/libro-cell-model.ts +61 -0
- package/src/cell/libro-cell-module.ts +40 -0
- package/src/cell/libro-cell-protocol.ts +53 -0
- package/src/cell/libro-cell-service.ts +157 -0
- package/src/cell/libro-cell-view.tsx +128 -0
- package/src/cell/libro-edit-cell-view.tsx +60 -0
- package/src/cell/libro-executable-cell-model.ts +32 -0
- package/src/cell/libro-executable-cell-view.ts +74 -0
- package/src/cell/libro-markdown-cell-model.ts +20 -0
- package/src/collapse-service.ts +69 -0
- package/src/command/document-commands.ts +18 -0
- package/src/command/index.ts +6 -0
- package/src/command/kernel-command.ts +41 -0
- package/src/command/libro-command-contribution.ts +1339 -0
- package/src/command/libro-command-register.ts +171 -0
- package/src/command/module.ts +9 -0
- package/src/command/notebook-commands.ts +498 -0
- package/src/components/cell-protocol.ts +22 -0
- package/src/components/dnd-cell-item-render.tsx +308 -0
- package/src/components/dnd-component/custom-drag-layer.tsx +145 -0
- package/src/components/dnd-component/default-dnd-content.tsx +275 -0
- package/src/components/dnd-component/dnd-context.tsx +28 -0
- package/src/components/dnd-component/dnd-list.tsx +116 -0
- package/src/components/dnd-component/index.tsx +4 -0
- package/src/components/index.ts +5 -0
- package/src/components/libro-component.tsx +30 -0
- package/src/components/libro-side-toolbar-menu.tsx +82 -0
- package/src/components/libro-view-header.tsx +33 -0
- package/src/configuration/libro-configuration-contribution.ts +29 -0
- package/src/configuration/libro-configuration.ts +88 -0
- package/src/content/index.ts +4 -0
- package/src/content/libro-content-contribution.ts +17 -0
- package/src/content/libro-content-module.ts +9 -0
- package/src/content/libro-content-protocol.ts +8 -0
- package/src/content/libro-content-service.ts +30 -0
- package/src/index.less +682 -0
- package/src/index.tsx +19 -0
- package/src/libro-context-key.ts +80 -0
- package/src/libro-keybind-registry.ts +43 -0
- package/src/libro-model.ts +614 -0
- package/src/libro-protocol.ts +322 -0
- package/src/libro-service.ts +121 -0
- package/src/libro-view-tracker.ts +9 -0
- package/src/libro-view.tsx +1399 -0
- package/src/material-from-designer.tsx +457 -0
- package/src/module.ts +90 -0
- package/src/output/index.ts +5 -0
- package/src/output/output-area.tsx +255 -0
- package/src/output/output-contribution.ts +18 -0
- package/src/output/output-model.tsx +66 -0
- package/src/output/output-module.ts +10 -0
- package/src/output/output-protocol.ts +164 -0
- package/src/slot/index.ts +4 -0
- package/src/slot/libro-slot-manager.ts +37 -0
- package/src/slot/libro-slot-protocol.ts +28 -0
- package/src/slot/libro-slot-view.tsx +51 -0
- package/src/slot/module.ts +9 -0
- package/src/theme/libro-color-registry.ts +371 -0
- package/src/toolbar/change-cell-to-selector.tsx +58 -0
- package/src/toolbar/hide-all-selector.tsx +126 -0
- package/src/toolbar/index.less +59 -0
- package/src/toolbar/index.ts +3 -0
- package/src/toolbar/libro-toolbar-protocol.ts +4 -0
- package/src/toolbar/libro-toolbar.tsx +192 -0
- package/src/toolbar/module.ts +11 -0
- package/src/toolbar/restart-clear-outputs-contribution.tsx +10 -0
- package/src/toolbar/restart-clear-outputs-modal.tsx +37 -0
- package/src/toolbar/save-icon.tsx +47 -0
- package/src/toolbar/shutdown-contribution.tsx +10 -0
- package/src/toolbar/shutdown-modal.tsx +37 -0
- package/src/toolbar/side-toolar-more-select.tsx +172 -0
- package/src/typings/index.d.ts +1 -0
|
@@ -0,0 +1,803 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _dec19, _dec20, _dec21, _dec22, _dec23, _dec24, _dec25, _dec26, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16, _descriptor17, _descriptor18, _descriptor19, _descriptor20, _descriptor21, _descriptor22, _descriptor23, _descriptor24, _descriptor25;
|
|
3
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
4
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
5
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
6
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
7
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
|
+
function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
|
|
13
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
15
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
17
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
18
|
+
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
19
|
+
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
20
|
+
/* eslint-disable @typescript-eslint/unified-signatures */
|
|
21
|
+
|
|
22
|
+
import { YNotebook, createMutex } from '@difizen/libro-shared-model';
|
|
23
|
+
import { ConfigurationService } from '@difizen/mana-app';
|
|
24
|
+
import { getOrigin } from '@difizen/mana-app';
|
|
25
|
+
import { Emitter } from '@difizen/mana-app';
|
|
26
|
+
import { inject, transient } from '@difizen/mana-app';
|
|
27
|
+
import { prop } from '@difizen/mana-app';
|
|
28
|
+
import { v4 } from 'uuid';
|
|
29
|
+
import { LibroContentService } from "./content/index.js";
|
|
30
|
+
import { isCellView, NotebookOption } from "./libro-protocol.js";
|
|
31
|
+
import { EnterEditModeWhenAddCell } from "./configuration/libro-configuration.js";
|
|
32
|
+
export var LibroModel = (_dec = transient(), _dec2 = inject(NotebookOption), _dec3 = inject(LibroContentService), _dec4 = inject(ConfigurationService), _dec5 = prop(), _dec6 = prop(), _dec7 = prop(), _dec8 = prop(), _dec9 = prop(), _dec10 = prop(), _dec11 = prop(), _dec12 = prop(), _dec13 = prop(), _dec14 = prop(), _dec15 = prop(), _dec16 = prop(), _dec17 = prop(), _dec18 = prop(), _dec19 = prop(), _dec20 = prop(), _dec21 = prop(), _dec22 = prop(), _dec23 = prop(), _dec24 = prop(), _dec25 = prop(), _dec26 = prop(), _dec(_class = (_class2 = /*#__PURE__*/function () {
|
|
33
|
+
function LibroModel() {
|
|
34
|
+
var _this = this;
|
|
35
|
+
_classCallCheck(this, LibroModel);
|
|
36
|
+
_initializerDefineProperty(this, "options", _descriptor, this);
|
|
37
|
+
_initializerDefineProperty(this, "libroContentService", _descriptor2, this);
|
|
38
|
+
_initializerDefineProperty(this, "configurationService", _descriptor3, this);
|
|
39
|
+
this.onCommandModeChangedEmitter = new Emitter();
|
|
40
|
+
this.onContentChangedEmitter = new Emitter();
|
|
41
|
+
this.id = v4();
|
|
42
|
+
/**
|
|
43
|
+
* The shared notebook model.
|
|
44
|
+
*/
|
|
45
|
+
this.sharedModel = void 0;
|
|
46
|
+
/**
|
|
47
|
+
* A mutex to update the shared model.
|
|
48
|
+
*/
|
|
49
|
+
this._modelDBMutex = createMutex();
|
|
50
|
+
_initializerDefineProperty(this, "lastClipboardInteraction", _descriptor4, this);
|
|
51
|
+
this.clipboard = void 0;
|
|
52
|
+
_initializerDefineProperty(this, "quickEditMode", _descriptor5, this);
|
|
53
|
+
_initializerDefineProperty(this, "commandMode", _descriptor6, this);
|
|
54
|
+
_initializerDefineProperty(this, "isEditMode", _descriptor7, this);
|
|
55
|
+
_initializerDefineProperty(this, "dndAreaNullEnable", _descriptor8, this);
|
|
56
|
+
_initializerDefineProperty(this, "dirty", _descriptor9, this);
|
|
57
|
+
_initializerDefineProperty(this, "readOnly", _descriptor10, this);
|
|
58
|
+
_initializerDefineProperty(this, "cells", _descriptor11, this);
|
|
59
|
+
_initializerDefineProperty(this, "active", _descriptor12, this);
|
|
60
|
+
_initializerDefineProperty(this, "activeIndex", _descriptor13, this);
|
|
61
|
+
_initializerDefineProperty(this, "hover", _descriptor14, this);
|
|
62
|
+
_initializerDefineProperty(this, "isInitialized", _descriptor15, this);
|
|
63
|
+
_initializerDefineProperty(this, "executeCount", _descriptor16, this);
|
|
64
|
+
_initializerDefineProperty(this, "mouseMode", _descriptor17, this);
|
|
65
|
+
_initializerDefineProperty(this, "selections", _descriptor18, this);
|
|
66
|
+
this.deletedCells = [];
|
|
67
|
+
this.metadata = {};
|
|
68
|
+
_initializerDefineProperty(this, "customParams", _descriptor19, this);
|
|
69
|
+
_initializerDefineProperty(this, "libroViewClass", _descriptor20, this);
|
|
70
|
+
_initializerDefineProperty(this, "canUndo", _descriptor21, this);
|
|
71
|
+
_initializerDefineProperty(this, "canRedo", _descriptor22, this);
|
|
72
|
+
/**
|
|
73
|
+
* 默认为true,可以在metadata修改
|
|
74
|
+
*/
|
|
75
|
+
_initializerDefineProperty(this, "trusted", _descriptor23, this);
|
|
76
|
+
// 字体大小
|
|
77
|
+
_initializerDefineProperty(this, "fontSize", _descriptor24, this);
|
|
78
|
+
// 主题
|
|
79
|
+
_initializerDefineProperty(this, "theme", _descriptor25, this);
|
|
80
|
+
this.cellViewCache = new Map();
|
|
81
|
+
this.nbformat_minor = 4;
|
|
82
|
+
this.nbformat = 4;
|
|
83
|
+
this.cellTypeAdaptor = void 0;
|
|
84
|
+
this.onSharedModelChanged = function (change) {
|
|
85
|
+
var _change$cellsChange;
|
|
86
|
+
var currpos = 0;
|
|
87
|
+
(_change$cellsChange = change.cellsChange) === null || _change$cellsChange === void 0 ? void 0 : _change$cellsChange.forEach(function (delta) {
|
|
88
|
+
if (delta.insert !== null && delta.insert !== undefined) {
|
|
89
|
+
var cellViews = delta.insert.map(function (cell) {
|
|
90
|
+
var view = _this.cellViewCache.get(cell.id);
|
|
91
|
+
return view;
|
|
92
|
+
});
|
|
93
|
+
_this.insertCellsView(cellViews, currpos);
|
|
94
|
+
currpos += delta.insert.length;
|
|
95
|
+
} else if (delta.delete !== null && delta.delete !== undefined) {
|
|
96
|
+
_this.removeRange(currpos, currpos + delta.delete);
|
|
97
|
+
} else if (delta.retain !== null && delta.retain !== undefined) {
|
|
98
|
+
currpos += delta.retain;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
if (_this.readOnly && !_this.isInitialized) {
|
|
102
|
+
_this.selectCell(undefined);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
_this.selectCell(_this.cells[_this.activeIndex]);
|
|
106
|
+
if (_this.cells[_this.activeIndex]) {
|
|
107
|
+
_this.scrollToView(_this.cells[_this.activeIndex]);
|
|
108
|
+
}
|
|
109
|
+
_this.configurationService.get(EnterEditModeWhenAddCell).then(function (value) {
|
|
110
|
+
if (value) {
|
|
111
|
+
if (_this.isEditMode) {
|
|
112
|
+
_this.enterEditMode();
|
|
113
|
+
} else {
|
|
114
|
+
_this.enterCommandMode();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return;
|
|
118
|
+
}).catch(function () {
|
|
119
|
+
//
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
this.toString = function () {
|
|
123
|
+
return JSON.stringify(_this.toJSON());
|
|
124
|
+
};
|
|
125
|
+
this.fromString = function (value) {
|
|
126
|
+
_this.fromJSON(JSON.parse(value));
|
|
127
|
+
};
|
|
128
|
+
this.selectCell = function (cell) {
|
|
129
|
+
var _this$active;
|
|
130
|
+
if (!cell || ((_this$active = _this.active) === null || _this$active === void 0 ? void 0 : _this$active.id) === cell.id) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
_this.active = cell;
|
|
134
|
+
cell.focus(false);
|
|
135
|
+
var index = _this.cells.findIndex(function (_cell) {
|
|
136
|
+
return _cell.id === cell.id;
|
|
137
|
+
});
|
|
138
|
+
if (index > -1) {
|
|
139
|
+
_this.activeIndex = index;
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
this.hoverCell = function (cell) {
|
|
143
|
+
_this.hover = cell;
|
|
144
|
+
};
|
|
145
|
+
this.addCell = function (cell, position, mode) {
|
|
146
|
+
_this.insertCells([cell], position, mode);
|
|
147
|
+
};
|
|
148
|
+
this.insertCells = function (cells, position, mode) {
|
|
149
|
+
// 非初始化阶段才需要自动滚动
|
|
150
|
+
if (!_this.isInitialized) {
|
|
151
|
+
_this.activeIndex = 0;
|
|
152
|
+
} else if (mode === 'above' && position !== undefined) {
|
|
153
|
+
_this.activeIndex = position;
|
|
154
|
+
} else {
|
|
155
|
+
if (position === _this.cells.length) {
|
|
156
|
+
_this.activeIndex = position;
|
|
157
|
+
} else {
|
|
158
|
+
_this.activeIndex = _this.activeIndex + cells.length;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
_this.isEditMode = true;
|
|
162
|
+
var cellData = cells.map(function (cell) {
|
|
163
|
+
_this.cellViewCache.set(cell.model.id, cell);
|
|
164
|
+
return cell.toJSON();
|
|
165
|
+
});
|
|
166
|
+
getOrigin(_this.sharedModel).transact(function () {
|
|
167
|
+
var insertIndex = position !== null && position !== void 0 ? position : _this.sharedModel.cells.length;
|
|
168
|
+
getOrigin(_this.sharedModel).insertCells(insertIndex, cellData);
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
this.invertCell = function (toAddcell, position) {
|
|
172
|
+
if (_this.activeIndex !== position) {
|
|
173
|
+
_this.activeIndex = position;
|
|
174
|
+
}
|
|
175
|
+
var cellData = [toAddcell].map(function (_cell) {
|
|
176
|
+
_this.cellViewCache.set(_cell.model.id, _cell);
|
|
177
|
+
return _cell.toJSON();
|
|
178
|
+
});
|
|
179
|
+
_this.isEditMode = true;
|
|
180
|
+
getOrigin(_this.sharedModel).transact(function () {
|
|
181
|
+
var invertIndex = position !== null && position !== void 0 ? position : _this.sharedModel.cells.length;
|
|
182
|
+
getOrigin(_this.sharedModel).deleteCell(invertIndex);
|
|
183
|
+
getOrigin(_this.sharedModel).insertCells(invertIndex, cellData);
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
this.splitCell = function (newCells, position) {
|
|
187
|
+
var newActiveIndex = position + newCells.length - 1;
|
|
188
|
+
if (_this.activeIndex !== newActiveIndex) {
|
|
189
|
+
_this.activeIndex = newActiveIndex;
|
|
190
|
+
}
|
|
191
|
+
var cellData = newCells.map(function (_cell) {
|
|
192
|
+
_this.cellViewCache.set(_cell.model.id, _cell);
|
|
193
|
+
return _cell.toJSON();
|
|
194
|
+
});
|
|
195
|
+
getOrigin(_this.sharedModel).transact(function () {
|
|
196
|
+
getOrigin(_this.sharedModel).deleteCell(position);
|
|
197
|
+
getOrigin(_this.sharedModel).insertCells(position, cellData);
|
|
198
|
+
});
|
|
199
|
+
//切分cell操作结束后进入编辑态
|
|
200
|
+
_this.enterEditMode();
|
|
201
|
+
};
|
|
202
|
+
this.insertCellsView = function (cell, position) {
|
|
203
|
+
if (position === 0) {
|
|
204
|
+
var _this$cells;
|
|
205
|
+
(_this$cells = _this.cells).unshift.apply(_this$cells, _toConsumableArray(cell));
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
if (position !== undefined) {
|
|
209
|
+
var _cells = [];
|
|
210
|
+
_this.getCells().forEach(function (_cell, index) {
|
|
211
|
+
_cells.push(_cell);
|
|
212
|
+
_cell.isAttached = true;
|
|
213
|
+
if (index + 1 === position) {
|
|
214
|
+
_cells.push.apply(_cells, _toConsumableArray(cell));
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
_this.cells = _cells;
|
|
218
|
+
} else {
|
|
219
|
+
var _this$cells2;
|
|
220
|
+
(_this$cells2 = _this.cells).push.apply(_this$cells2, _toConsumableArray(cell));
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
this.doDeleteCell = function (arg) {
|
|
224
|
+
var index = _this.toCellIndex(arg);
|
|
225
|
+
if (index !== undefined) {
|
|
226
|
+
var _cells = [];
|
|
227
|
+
_this.getCells().forEach(function (item, _index) {
|
|
228
|
+
if (index !== _index) {
|
|
229
|
+
_cells.push(item);
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
_this.cells = _cells;
|
|
233
|
+
if (index !== _this.cells.length) {
|
|
234
|
+
_this.selectCell(_this.cells[index]);
|
|
235
|
+
} else {
|
|
236
|
+
_this.selectCell(_this.cells[index - 1]);
|
|
237
|
+
}
|
|
238
|
+
return true;
|
|
239
|
+
}
|
|
240
|
+
return false;
|
|
241
|
+
};
|
|
242
|
+
this.sharedModel = YNotebook.create({
|
|
243
|
+
disableDocumentWideUndoRedo: false,
|
|
244
|
+
cellTypeAdaptor: this.cellTypeAdaptor
|
|
245
|
+
});
|
|
246
|
+
this.sharedModel.changed(this.onSharedModelChanged);
|
|
247
|
+
this.sharedModel.undoChanged(function (value) {
|
|
248
|
+
if (value !== _this.canUndo) {
|
|
249
|
+
_this.canUndo = value;
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
this.sharedModel.redoChanged(function (value) {
|
|
253
|
+
if (value !== _this.canRedo) {
|
|
254
|
+
_this.canRedo = value;
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
_createClass(LibroModel, [{
|
|
259
|
+
key: "onCommandModeChanged",
|
|
260
|
+
get: function get() {
|
|
261
|
+
return this.onCommandModeChangedEmitter.event;
|
|
262
|
+
}
|
|
263
|
+
}, {
|
|
264
|
+
key: "onContentChanged",
|
|
265
|
+
get: function get() {
|
|
266
|
+
return this.onContentChangedEmitter.event;
|
|
267
|
+
}
|
|
268
|
+
}, {
|
|
269
|
+
key: "getCells",
|
|
270
|
+
value: function getCells() {
|
|
271
|
+
return this.cells.filter(function (cell) {
|
|
272
|
+
return !!cell;
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
}, {
|
|
276
|
+
key: "canRun",
|
|
277
|
+
value: function canRun() {
|
|
278
|
+
return true;
|
|
279
|
+
}
|
|
280
|
+
}, {
|
|
281
|
+
key: "getCustomKey",
|
|
282
|
+
value: function getCustomKey(key) {
|
|
283
|
+
return this.customParams[key];
|
|
284
|
+
}
|
|
285
|
+
}, {
|
|
286
|
+
key: "setCustomKey",
|
|
287
|
+
value: function setCustomKey(key, val) {
|
|
288
|
+
this.customParams[key] = val;
|
|
289
|
+
// 备份到metadata
|
|
290
|
+
// 备份到metadata
|
|
291
|
+
this.metadata['customParams'] = this.customParams;
|
|
292
|
+
}
|
|
293
|
+
}, {
|
|
294
|
+
key: "toJSON",
|
|
295
|
+
value:
|
|
296
|
+
/**
|
|
297
|
+
* Serialize the model to JSON.
|
|
298
|
+
*/
|
|
299
|
+
function toJSON() {
|
|
300
|
+
return {
|
|
301
|
+
metadata: this.metadata,
|
|
302
|
+
nbformat_minor: this.nbformat_minor,
|
|
303
|
+
nbformat: this.nbformat,
|
|
304
|
+
cells: this.getCells().map(function (item) {
|
|
305
|
+
return item.toJSON();
|
|
306
|
+
})
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Deserialize the model from JSON.
|
|
312
|
+
*
|
|
313
|
+
* #### Notes
|
|
314
|
+
* Should emit a [contentChanged] signal.
|
|
315
|
+
*/
|
|
316
|
+
}, {
|
|
317
|
+
key: "fromJSON",
|
|
318
|
+
value: function fromJSON(value) {
|
|
319
|
+
var _this2 = this;
|
|
320
|
+
this.sharedModel.transact(function () {
|
|
321
|
+
var useId = value.nbformat === 4 && value.nbformat_minor >= 5;
|
|
322
|
+
var ycells = value.cells.map(function (cell) {
|
|
323
|
+
if (!useId) {
|
|
324
|
+
delete cell.id;
|
|
325
|
+
}
|
|
326
|
+
return cell;
|
|
327
|
+
});
|
|
328
|
+
if (!ycells.length) {
|
|
329
|
+
// Create cell when notebook is empty
|
|
330
|
+
// (non collaborative)
|
|
331
|
+
ycells.push({
|
|
332
|
+
cell_type: 'code'
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
_this2.sharedModel.insertCells(_this2.sharedModel.cells.length, ycells);
|
|
336
|
+
_this2.sharedModel.deleteCellRange(0, _this2.sharedModel.cells.length);
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* cell list change or cell content change
|
|
342
|
+
*/
|
|
343
|
+
}, {
|
|
344
|
+
key: "onChange",
|
|
345
|
+
value: function onChange() {
|
|
346
|
+
this.dirty = true;
|
|
347
|
+
this.onContentChangedEmitter.fire(true);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* override this method to load notebook from server
|
|
352
|
+
* @returns
|
|
353
|
+
*/
|
|
354
|
+
}, {
|
|
355
|
+
key: "loadNotebookContent",
|
|
356
|
+
value: function () {
|
|
357
|
+
var _loadNotebookContent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
358
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
359
|
+
while (1) switch (_context.prev = _context.next) {
|
|
360
|
+
case 0:
|
|
361
|
+
return _context.abrupt("return", this.libroContentService.loadLibroContent(this.options, this));
|
|
362
|
+
case 1:
|
|
363
|
+
case "end":
|
|
364
|
+
return _context.stop();
|
|
365
|
+
}
|
|
366
|
+
}, _callee, this);
|
|
367
|
+
}));
|
|
368
|
+
function loadNotebookContent() {
|
|
369
|
+
return _loadNotebookContent.apply(this, arguments);
|
|
370
|
+
}
|
|
371
|
+
return loadNotebookContent;
|
|
372
|
+
}()
|
|
373
|
+
}, {
|
|
374
|
+
key: "saveNotebookContent",
|
|
375
|
+
value: function () {
|
|
376
|
+
var _saveNotebookContent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
377
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
378
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
379
|
+
case 0:
|
|
380
|
+
case "end":
|
|
381
|
+
return _context2.stop();
|
|
382
|
+
}
|
|
383
|
+
}, _callee2);
|
|
384
|
+
}));
|
|
385
|
+
function saveNotebookContent() {
|
|
386
|
+
return _saveNotebookContent.apply(this, arguments);
|
|
387
|
+
}
|
|
388
|
+
return saveNotebookContent;
|
|
389
|
+
}()
|
|
390
|
+
}, {
|
|
391
|
+
key: "initialize",
|
|
392
|
+
value: function () {
|
|
393
|
+
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
394
|
+
var _this$metadata, _this$metadata3;
|
|
395
|
+
var content, _this$metadata2, _this$metadata4;
|
|
396
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
397
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
398
|
+
case 0:
|
|
399
|
+
_context3.next = 2;
|
|
400
|
+
return this.loadNotebookContent();
|
|
401
|
+
case 2:
|
|
402
|
+
content = _context3.sent;
|
|
403
|
+
this.metadata = content.metadata;
|
|
404
|
+
if ((_this$metadata = this.metadata) !== null && _this$metadata !== void 0 && _this$metadata['customParams']) {
|
|
405
|
+
this.customParams = (_this$metadata2 = this.metadata) === null || _this$metadata2 === void 0 ? void 0 : _this$metadata2['customParams'];
|
|
406
|
+
}
|
|
407
|
+
if ((_this$metadata3 = this.metadata) !== null && _this$metadata3 !== void 0 && _this$metadata3['trusted']) {
|
|
408
|
+
this.trusted = (_this$metadata4 = this.metadata) === null || _this$metadata4 === void 0 ? void 0 : _this$metadata4['trusted'];
|
|
409
|
+
}
|
|
410
|
+
this.nbformat = content.nbformat;
|
|
411
|
+
this.nbformat_minor = content.nbformat_minor;
|
|
412
|
+
return _context3.abrupt("return", content.cells.map(function (cell) {
|
|
413
|
+
return {
|
|
414
|
+
cell: cell
|
|
415
|
+
};
|
|
416
|
+
}));
|
|
417
|
+
case 9:
|
|
418
|
+
case "end":
|
|
419
|
+
return _context3.stop();
|
|
420
|
+
}
|
|
421
|
+
}, _callee3, this);
|
|
422
|
+
}));
|
|
423
|
+
function initialize() {
|
|
424
|
+
return _initialize.apply(this, arguments);
|
|
425
|
+
}
|
|
426
|
+
return initialize;
|
|
427
|
+
}()
|
|
428
|
+
}, {
|
|
429
|
+
key: "toCellIndex",
|
|
430
|
+
value: function toCellIndex(arg) {
|
|
431
|
+
var index = undefined;
|
|
432
|
+
if (typeof arg === 'number') {
|
|
433
|
+
index = arg;
|
|
434
|
+
} else if (typeof arg === 'string') {
|
|
435
|
+
index = this.cells.findIndex(function (cell) {
|
|
436
|
+
return cell.id === arg;
|
|
437
|
+
});
|
|
438
|
+
} else if (isCellView(arg)) {
|
|
439
|
+
index = this.cells.findIndex(function (cell) {
|
|
440
|
+
return cell.id === arg.id;
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
return index;
|
|
444
|
+
}
|
|
445
|
+
}, {
|
|
446
|
+
key: "scrollToView",
|
|
447
|
+
value:
|
|
448
|
+
/**
|
|
449
|
+
* 自动滚动到可视范围内
|
|
450
|
+
*/
|
|
451
|
+
function scrollToView(cell) {
|
|
452
|
+
var _target, _target2, _target7, _target7$offsetParent;
|
|
453
|
+
var target = document.getElementById(cell.id);
|
|
454
|
+
if (!target) {
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
var _targetheight = ((_target = target) === null || _target === void 0 ? void 0 : _target.offsetHeight) || 0;
|
|
458
|
+
var offsetTop = ((_target2 = target) === null || _target2 === void 0 ? void 0 : _target2.offsetTop) || 0;
|
|
459
|
+
while ((_target3 = target) !== null && _target3 !== void 0 && _target3.offsetParent && !((_target4 = target) !== null && _target4 !== void 0 && (_target4$offsetParent = _target4.offsetParent) !== null && _target4$offsetParent !== void 0 && (_target4$offsetParent2 = _target4$offsetParent.className) !== null && _target4$offsetParent2 !== void 0 && _target4$offsetParent2.includes('libro-view-content-left'))) {
|
|
460
|
+
var _target3, _target4, _target4$offsetParent, _target4$offsetParent2, _target5, _target6;
|
|
461
|
+
target = (_target5 = target) === null || _target5 === void 0 ? void 0 : _target5.offsetParent;
|
|
462
|
+
offsetTop += ((_target6 = target) === null || _target6 === void 0 ? void 0 : _target6.offsetTop) || 0;
|
|
463
|
+
}
|
|
464
|
+
if ((_target7 = target) !== null && _target7 !== void 0 && (_target7$offsetParent = _target7.offsetParent) !== null && _target7$offsetParent !== void 0 && _target7$offsetParent.parentElement && _targetheight) {
|
|
465
|
+
var _height = target.offsetParent.parentElement.clientHeight;
|
|
466
|
+
var _scrollTop = target.offsetParent.parentElement.scrollTop;
|
|
467
|
+
if (offsetTop > _scrollTop && offsetTop + _targetheight < _height + _scrollTop) {
|
|
468
|
+
// 在可视范围内就不需要滚动
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
if (offsetTop < _scrollTop) {
|
|
472
|
+
target.offsetParent.parentElement.scrollTop = offsetTop;
|
|
473
|
+
} else {
|
|
474
|
+
target.offsetParent.parentElement.scrollTop = offsetTop + _targetheight - _height + 30; // 加缓冲向上不贴底部
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}, {
|
|
479
|
+
key: "removeRange",
|
|
480
|
+
value: function removeRange(start, end) {
|
|
481
|
+
this.cells.splice(start, end - start);
|
|
482
|
+
}
|
|
483
|
+
}, {
|
|
484
|
+
key: "deleteCell",
|
|
485
|
+
value: function deleteCell(arg) {
|
|
486
|
+
var _this3 = this;
|
|
487
|
+
var index = this.toCellIndex(arg);
|
|
488
|
+
if (index === undefined) {
|
|
489
|
+
return false;
|
|
490
|
+
}
|
|
491
|
+
if (this.activeIndex === this.cells.length - 1) {
|
|
492
|
+
this.activeIndex = this.cells.length - 2;
|
|
493
|
+
} else {
|
|
494
|
+
this.activeIndex = index;
|
|
495
|
+
}
|
|
496
|
+
this.isEditMode = false;
|
|
497
|
+
getOrigin(this.sharedModel).transact(function () {
|
|
498
|
+
getOrigin(_this3.sharedModel).deleteCell(index);
|
|
499
|
+
});
|
|
500
|
+
return true;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* 删除 cell 节点
|
|
505
|
+
* @param arg id、index、cell
|
|
506
|
+
* @returns
|
|
507
|
+
*/
|
|
508
|
+
}, {
|
|
509
|
+
key: "deleteCellView",
|
|
510
|
+
value: function deleteCellView(arg) {
|
|
511
|
+
var _this$active2;
|
|
512
|
+
if (arg === ((_this$active2 = this.active) === null || _this$active2 === void 0 ? void 0 : _this$active2.id)) {
|
|
513
|
+
// 如果删除项正好是选中项,则清空active
|
|
514
|
+
this.active = undefined;
|
|
515
|
+
}
|
|
516
|
+
return this.doDeleteCell(arg);
|
|
517
|
+
}
|
|
518
|
+
}, {
|
|
519
|
+
key: "exchangeCell",
|
|
520
|
+
value: function exchangeCell(source, target) {
|
|
521
|
+
var _this4 = this;
|
|
522
|
+
var sourceIndex = this.toCellIndex(source);
|
|
523
|
+
var targetIndex = this.toCellIndex(target);
|
|
524
|
+
if (sourceIndex === undefined || targetIndex === undefined) {
|
|
525
|
+
return false;
|
|
526
|
+
}
|
|
527
|
+
this.activeIndex = targetIndex;
|
|
528
|
+
this.isEditMode = false;
|
|
529
|
+
getOrigin(this.sharedModel).transact(function () {
|
|
530
|
+
getOrigin(_this4.sharedModel).moveCell(sourceIndex, targetIndex);
|
|
531
|
+
});
|
|
532
|
+
this.activeIndex = targetIndex;
|
|
533
|
+
return true;
|
|
534
|
+
}
|
|
535
|
+
}, {
|
|
536
|
+
key: "exchangeCells",
|
|
537
|
+
value: function exchangeCells(source, targetIndex) {
|
|
538
|
+
var _this5 = this;
|
|
539
|
+
var startIndex = this.toCellIndex(source[0]);
|
|
540
|
+
var endIndex = this.toCellIndex(source[source.length - 1]);
|
|
541
|
+
if (startIndex === undefined || endIndex === undefined) {
|
|
542
|
+
return false;
|
|
543
|
+
}
|
|
544
|
+
this.isEditMode = false;
|
|
545
|
+
var cellData = source.map(function (cell) {
|
|
546
|
+
_this5.cellViewCache.set(cell.model.id, cell);
|
|
547
|
+
return cell.toJSON();
|
|
548
|
+
});
|
|
549
|
+
getOrigin(this.sharedModel).transact(function () {
|
|
550
|
+
if (targetIndex > endIndex) {
|
|
551
|
+
//往下交换cell
|
|
552
|
+
if (startIndex === _this5.activeIndex) {
|
|
553
|
+
//active在头
|
|
554
|
+
_this5.activeIndex = targetIndex - source.length;
|
|
555
|
+
} else {
|
|
556
|
+
//active在头尾
|
|
557
|
+
_this5.activeIndex = targetIndex - 1;
|
|
558
|
+
}
|
|
559
|
+
getOrigin(_this5.sharedModel).deleteCellRange(startIndex, endIndex + 1);
|
|
560
|
+
getOrigin(_this5.sharedModel).insertCells(targetIndex - source.length, cellData);
|
|
561
|
+
} else {
|
|
562
|
+
//往上交换cell
|
|
563
|
+
if (startIndex === _this5.activeIndex) {
|
|
564
|
+
//active在头
|
|
565
|
+
_this5.activeIndex = targetIndex - source.length;
|
|
566
|
+
} else {
|
|
567
|
+
//active在尾
|
|
568
|
+
_this5.activeIndex = targetIndex + 1;
|
|
569
|
+
}
|
|
570
|
+
getOrigin(_this5.sharedModel).deleteCellRange(startIndex, endIndex + 1);
|
|
571
|
+
getOrigin(_this5.sharedModel).insertCells(targetIndex, cellData);
|
|
572
|
+
}
|
|
573
|
+
});
|
|
574
|
+
return true;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* 交换 cell 节点位置
|
|
579
|
+
* @param source id、index、cell
|
|
580
|
+
* @param target id、index、cell
|
|
581
|
+
* @returns
|
|
582
|
+
*/
|
|
583
|
+
}, {
|
|
584
|
+
key: "exchangeCellView",
|
|
585
|
+
value: function exchangeCellView(source, target) {
|
|
586
|
+
var _this6 = this;
|
|
587
|
+
var sourceIndex = this.toCellIndex(source);
|
|
588
|
+
var targetIndex = this.toCellIndex(target);
|
|
589
|
+
if (sourceIndex !== undefined && targetIndex !== undefined) {
|
|
590
|
+
// 交换位置
|
|
591
|
+
var sourceItem = this.cells[sourceIndex];
|
|
592
|
+
var cells = _toConsumableArray(this.cells);
|
|
593
|
+
cells.splice(sourceIndex, 1);
|
|
594
|
+
cells.splice(targetIndex, 0, sourceItem);
|
|
595
|
+
this.cells = cells;
|
|
596
|
+
setTimeout(function () {
|
|
597
|
+
// 上下移动也需要调整可视区域范围
|
|
598
|
+
_this6.scrollToView(sourceItem);
|
|
599
|
+
}, 300);
|
|
600
|
+
return true;
|
|
601
|
+
}
|
|
602
|
+
return false;
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* 进入命令模式
|
|
606
|
+
*/
|
|
607
|
+
}, {
|
|
608
|
+
key: "enterCommandMode",
|
|
609
|
+
value: function enterCommandMode() {
|
|
610
|
+
if (this.active) {
|
|
611
|
+
this.commandMode = true;
|
|
612
|
+
this.onCommandModeChangedEmitter.fire(true);
|
|
613
|
+
this.active.blur();
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
}, {
|
|
617
|
+
key: "enterEditMode",
|
|
618
|
+
value: function enterEditMode() {
|
|
619
|
+
if (this.active) {
|
|
620
|
+
if (this.selections.length !== 0) {
|
|
621
|
+
this.selections = [];
|
|
622
|
+
}
|
|
623
|
+
this.commandMode = false;
|
|
624
|
+
this.onCommandModeChangedEmitter.fire(false);
|
|
625
|
+
this.active.focus(true);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}, {
|
|
629
|
+
key: "undo",
|
|
630
|
+
value: function undo() {
|
|
631
|
+
getOrigin(this.sharedModel).undo();
|
|
632
|
+
}
|
|
633
|
+
}, {
|
|
634
|
+
key: "redo",
|
|
635
|
+
value: function redo() {
|
|
636
|
+
getOrigin(this.sharedModel).redo();
|
|
637
|
+
}
|
|
638
|
+
}]);
|
|
639
|
+
return LibroModel;
|
|
640
|
+
}(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "options", [_dec2], {
|
|
641
|
+
configurable: true,
|
|
642
|
+
enumerable: true,
|
|
643
|
+
writable: true,
|
|
644
|
+
initializer: null
|
|
645
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "libroContentService", [_dec3], {
|
|
646
|
+
configurable: true,
|
|
647
|
+
enumerable: true,
|
|
648
|
+
writable: true,
|
|
649
|
+
initializer: null
|
|
650
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "configurationService", [_dec4], {
|
|
651
|
+
configurable: true,
|
|
652
|
+
enumerable: true,
|
|
653
|
+
writable: true,
|
|
654
|
+
initializer: null
|
|
655
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "lastClipboardInteraction", [_dec5], {
|
|
656
|
+
configurable: true,
|
|
657
|
+
enumerable: true,
|
|
658
|
+
writable: true,
|
|
659
|
+
initializer: null
|
|
660
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "quickEditMode", [_dec6], {
|
|
661
|
+
configurable: true,
|
|
662
|
+
enumerable: true,
|
|
663
|
+
writable: true,
|
|
664
|
+
initializer: function initializer() {
|
|
665
|
+
return false;
|
|
666
|
+
}
|
|
667
|
+
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "commandMode", [_dec7], {
|
|
668
|
+
configurable: true,
|
|
669
|
+
enumerable: true,
|
|
670
|
+
writable: true,
|
|
671
|
+
initializer: function initializer() {
|
|
672
|
+
return true;
|
|
673
|
+
}
|
|
674
|
+
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "isEditMode", [_dec8], {
|
|
675
|
+
configurable: true,
|
|
676
|
+
enumerable: true,
|
|
677
|
+
writable: true,
|
|
678
|
+
initializer: function initializer() {
|
|
679
|
+
return true;
|
|
680
|
+
}
|
|
681
|
+
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "dndAreaNullEnable", [_dec9], {
|
|
682
|
+
configurable: true,
|
|
683
|
+
enumerable: true,
|
|
684
|
+
writable: true,
|
|
685
|
+
initializer: function initializer() {
|
|
686
|
+
return false;
|
|
687
|
+
}
|
|
688
|
+
}), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "dirty", [_dec10], {
|
|
689
|
+
configurable: true,
|
|
690
|
+
enumerable: true,
|
|
691
|
+
writable: true,
|
|
692
|
+
initializer: function initializer() {
|
|
693
|
+
return false;
|
|
694
|
+
}
|
|
695
|
+
}), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "readOnly", [_dec11], {
|
|
696
|
+
configurable: true,
|
|
697
|
+
enumerable: true,
|
|
698
|
+
writable: true,
|
|
699
|
+
initializer: function initializer() {
|
|
700
|
+
return false;
|
|
701
|
+
}
|
|
702
|
+
}), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "cells", [_dec12], {
|
|
703
|
+
configurable: true,
|
|
704
|
+
enumerable: true,
|
|
705
|
+
writable: true,
|
|
706
|
+
initializer: function initializer() {
|
|
707
|
+
return [];
|
|
708
|
+
}
|
|
709
|
+
}), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "active", [_dec13], {
|
|
710
|
+
configurable: true,
|
|
711
|
+
enumerable: true,
|
|
712
|
+
writable: true,
|
|
713
|
+
initializer: null
|
|
714
|
+
}), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, "activeIndex", [_dec14], {
|
|
715
|
+
configurable: true,
|
|
716
|
+
enumerable: true,
|
|
717
|
+
writable: true,
|
|
718
|
+
initializer: function initializer() {
|
|
719
|
+
return 0;
|
|
720
|
+
}
|
|
721
|
+
}), _descriptor14 = _applyDecoratedDescriptor(_class2.prototype, "hover", [_dec15], {
|
|
722
|
+
configurable: true,
|
|
723
|
+
enumerable: true,
|
|
724
|
+
writable: true,
|
|
725
|
+
initializer: function initializer() {
|
|
726
|
+
return undefined;
|
|
727
|
+
}
|
|
728
|
+
}), _descriptor15 = _applyDecoratedDescriptor(_class2.prototype, "isInitialized", [_dec16], {
|
|
729
|
+
configurable: true,
|
|
730
|
+
enumerable: true,
|
|
731
|
+
writable: true,
|
|
732
|
+
initializer: function initializer() {
|
|
733
|
+
return false;
|
|
734
|
+
}
|
|
735
|
+
}), _descriptor16 = _applyDecoratedDescriptor(_class2.prototype, "executeCount", [_dec17], {
|
|
736
|
+
configurable: true,
|
|
737
|
+
enumerable: true,
|
|
738
|
+
writable: true,
|
|
739
|
+
initializer: function initializer() {
|
|
740
|
+
return 0;
|
|
741
|
+
}
|
|
742
|
+
}), _descriptor17 = _applyDecoratedDescriptor(_class2.prototype, "mouseMode", [_dec18], {
|
|
743
|
+
configurable: true,
|
|
744
|
+
enumerable: true,
|
|
745
|
+
writable: true,
|
|
746
|
+
initializer: null
|
|
747
|
+
}), _descriptor18 = _applyDecoratedDescriptor(_class2.prototype, "selections", [_dec19], {
|
|
748
|
+
configurable: true,
|
|
749
|
+
enumerable: true,
|
|
750
|
+
writable: true,
|
|
751
|
+
initializer: function initializer() {
|
|
752
|
+
return [];
|
|
753
|
+
}
|
|
754
|
+
}), _descriptor19 = _applyDecoratedDescriptor(_class2.prototype, "customParams", [_dec20], {
|
|
755
|
+
configurable: true,
|
|
756
|
+
enumerable: true,
|
|
757
|
+
writable: true,
|
|
758
|
+
initializer: function initializer() {
|
|
759
|
+
return {};
|
|
760
|
+
}
|
|
761
|
+
}), _descriptor20 = _applyDecoratedDescriptor(_class2.prototype, "libroViewClass", [_dec21], {
|
|
762
|
+
configurable: true,
|
|
763
|
+
enumerable: true,
|
|
764
|
+
writable: true,
|
|
765
|
+
initializer: function initializer() {
|
|
766
|
+
return '';
|
|
767
|
+
}
|
|
768
|
+
}), _descriptor21 = _applyDecoratedDescriptor(_class2.prototype, "canUndo", [_dec22], {
|
|
769
|
+
configurable: true,
|
|
770
|
+
enumerable: true,
|
|
771
|
+
writable: true,
|
|
772
|
+
initializer: function initializer() {
|
|
773
|
+
return false;
|
|
774
|
+
}
|
|
775
|
+
}), _descriptor22 = _applyDecoratedDescriptor(_class2.prototype, "canRedo", [_dec23], {
|
|
776
|
+
configurable: true,
|
|
777
|
+
enumerable: true,
|
|
778
|
+
writable: true,
|
|
779
|
+
initializer: function initializer() {
|
|
780
|
+
return false;
|
|
781
|
+
}
|
|
782
|
+
}), _descriptor23 = _applyDecoratedDescriptor(_class2.prototype, "trusted", [_dec24], {
|
|
783
|
+
configurable: true,
|
|
784
|
+
enumerable: true,
|
|
785
|
+
writable: true,
|
|
786
|
+
initializer: function initializer() {
|
|
787
|
+
return true;
|
|
788
|
+
}
|
|
789
|
+
}), _descriptor24 = _applyDecoratedDescriptor(_class2.prototype, "fontSize", [_dec25], {
|
|
790
|
+
configurable: true,
|
|
791
|
+
enumerable: true,
|
|
792
|
+
writable: true,
|
|
793
|
+
initializer: function initializer() {
|
|
794
|
+
return 12;
|
|
795
|
+
}
|
|
796
|
+
}), _descriptor25 = _applyDecoratedDescriptor(_class2.prototype, "theme", [_dec26], {
|
|
797
|
+
configurable: true,
|
|
798
|
+
enumerable: true,
|
|
799
|
+
writable: true,
|
|
800
|
+
initializer: function initializer() {
|
|
801
|
+
return '';
|
|
802
|
+
}
|
|
803
|
+
})), _class2)) || _class);
|