@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,494 @@
|
|
|
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, _class;
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
+
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); } }
|
|
5
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
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); }
|
|
8
|
+
import { Color, ColorContribution } from '@difizen/mana-app';
|
|
9
|
+
import { singleton } from '@difizen/mana-app';
|
|
10
|
+
export var LibroColorRegistry = (_dec = singleton({
|
|
11
|
+
contrib: ColorContribution
|
|
12
|
+
}), _dec(_class = /*#__PURE__*/function () {
|
|
13
|
+
function LibroColorRegistry() {
|
|
14
|
+
_classCallCheck(this, LibroColorRegistry);
|
|
15
|
+
}
|
|
16
|
+
_createClass(LibroColorRegistry, [{
|
|
17
|
+
key: "registerColors",
|
|
18
|
+
value: function registerColors(colors) {
|
|
19
|
+
colors.register(
|
|
20
|
+
// #region antd variable
|
|
21
|
+
{
|
|
22
|
+
id: 'libro.warning.background',
|
|
23
|
+
defaults: {
|
|
24
|
+
dark: '#A9611466',
|
|
25
|
+
light: '#FFFBE6'
|
|
26
|
+
},
|
|
27
|
+
description: ''
|
|
28
|
+
}, {
|
|
29
|
+
id: 'libro.drag.hover.line.color',
|
|
30
|
+
defaults: {
|
|
31
|
+
dark: '#467DB0',
|
|
32
|
+
light: '#BFE0FF'
|
|
33
|
+
},
|
|
34
|
+
description: ''
|
|
35
|
+
}, {
|
|
36
|
+
id: 'libro.background',
|
|
37
|
+
defaults: {
|
|
38
|
+
dark: '#1f2022',
|
|
39
|
+
light: '#ffffff'
|
|
40
|
+
},
|
|
41
|
+
description: ''
|
|
42
|
+
}, {
|
|
43
|
+
id: 'libro.popover.background.color',
|
|
44
|
+
defaults: {
|
|
45
|
+
dark: '#2f3032',
|
|
46
|
+
light: '#ffffff'
|
|
47
|
+
},
|
|
48
|
+
description: ''
|
|
49
|
+
}, {
|
|
50
|
+
id: 'libro.menu.hover.color',
|
|
51
|
+
defaults: {
|
|
52
|
+
dark: '#515359',
|
|
53
|
+
light: '#EBF6FF'
|
|
54
|
+
},
|
|
55
|
+
description: ''
|
|
56
|
+
}, {
|
|
57
|
+
id: 'libro.dropdown.icon.color',
|
|
58
|
+
defaults: {
|
|
59
|
+
dark: Color.rgba(255, 255, 255, 0.3),
|
|
60
|
+
light: Color.rgba(0, 0, 0, 0.2)
|
|
61
|
+
},
|
|
62
|
+
description: ''
|
|
63
|
+
}, {
|
|
64
|
+
id: 'libro.input.background',
|
|
65
|
+
defaults: {
|
|
66
|
+
dark: '#19191B',
|
|
67
|
+
light: '#F4F6FB'
|
|
68
|
+
},
|
|
69
|
+
description: ''
|
|
70
|
+
}, {
|
|
71
|
+
id: 'libro.text.default.color',
|
|
72
|
+
defaults: {
|
|
73
|
+
dark: '#e3e4e6',
|
|
74
|
+
light: '#000000'
|
|
75
|
+
},
|
|
76
|
+
description: ''
|
|
77
|
+
}, {
|
|
78
|
+
id: 'libro.text.tertiary.color',
|
|
79
|
+
defaults: {
|
|
80
|
+
dark: '#bdc0c4',
|
|
81
|
+
light: '#B8BABA'
|
|
82
|
+
},
|
|
83
|
+
description: ''
|
|
84
|
+
}, {
|
|
85
|
+
id: 'libro.output.background',
|
|
86
|
+
defaults: {
|
|
87
|
+
dark: '#292A2D',
|
|
88
|
+
light: '#fff'
|
|
89
|
+
},
|
|
90
|
+
description: ''
|
|
91
|
+
}, {
|
|
92
|
+
id: 'libro.toptoolbar.border.color',
|
|
93
|
+
defaults: {
|
|
94
|
+
dark: Color.rgba(255, 255, 255, 0.1),
|
|
95
|
+
light: Color.rgba(0, 0, 0, 0.1)
|
|
96
|
+
},
|
|
97
|
+
description: ''
|
|
98
|
+
}, {
|
|
99
|
+
id: 'libro.toptoolbar.icon.color',
|
|
100
|
+
defaults: {
|
|
101
|
+
dark: '#BFBFBF',
|
|
102
|
+
light: '#7B7B7B'
|
|
103
|
+
},
|
|
104
|
+
description: ''
|
|
105
|
+
}, {
|
|
106
|
+
id: 'libro.toptoolbar.disabled.icon.color',
|
|
107
|
+
defaults: {
|
|
108
|
+
dark: Color.rgba(255, 255, 255, 0.3),
|
|
109
|
+
light: Color.rgba(0, 0, 0, 0.25)
|
|
110
|
+
},
|
|
111
|
+
description: ''
|
|
112
|
+
}, {
|
|
113
|
+
id: 'libro.toptoolbar.text.color',
|
|
114
|
+
defaults: {
|
|
115
|
+
dark: '#f5f5f5',
|
|
116
|
+
light: '#000000'
|
|
117
|
+
},
|
|
118
|
+
description: ''
|
|
119
|
+
}, {
|
|
120
|
+
id: 'libro.bottom.btn.background.color',
|
|
121
|
+
defaults: {
|
|
122
|
+
dark: Color.rgba(255, 255, 255, 0.04),
|
|
123
|
+
light: Color.rgba(255, 255, 255, 1)
|
|
124
|
+
},
|
|
125
|
+
description: ''
|
|
126
|
+
}, {
|
|
127
|
+
id: 'libro.bottom.btn.border.color',
|
|
128
|
+
defaults: {
|
|
129
|
+
dark: '#505559',
|
|
130
|
+
light: Color.rgba(0, 10, 26, 0.16)
|
|
131
|
+
},
|
|
132
|
+
description: ''
|
|
133
|
+
}, {
|
|
134
|
+
id: 'libro.bottom.btn.icon.color',
|
|
135
|
+
defaults: {
|
|
136
|
+
dark: '#505559',
|
|
137
|
+
light: Color.rgba(82, 89, 100, 0.85)
|
|
138
|
+
},
|
|
139
|
+
description: ''
|
|
140
|
+
}, {
|
|
141
|
+
id: 'libro.bottom.btn.text.color',
|
|
142
|
+
defaults: {
|
|
143
|
+
dark: '#E3E4E6',
|
|
144
|
+
light: Color.rgba(0, 10, 26, 0.68)
|
|
145
|
+
},
|
|
146
|
+
description: ''
|
|
147
|
+
}, {
|
|
148
|
+
id: 'libro.default.btn.background.color',
|
|
149
|
+
defaults: {
|
|
150
|
+
dark: Color.rgba(255, 255, 255, 0.1),
|
|
151
|
+
light: '#FFFFFF'
|
|
152
|
+
},
|
|
153
|
+
description: ''
|
|
154
|
+
}, {
|
|
155
|
+
id: 'libro.default.btn.text.color',
|
|
156
|
+
defaults: {
|
|
157
|
+
dark: '#E3E4E6',
|
|
158
|
+
light: Color.rgba(0, 10, 26, 0.68)
|
|
159
|
+
},
|
|
160
|
+
description: ''
|
|
161
|
+
}, {
|
|
162
|
+
id: 'libro.primary.btn.background.color',
|
|
163
|
+
defaults: {
|
|
164
|
+
dark: '#2A97FD',
|
|
165
|
+
light: '#1890FF'
|
|
166
|
+
},
|
|
167
|
+
description: ''
|
|
168
|
+
}, {
|
|
169
|
+
id: 'libro.default.btn.border.color',
|
|
170
|
+
defaults: {
|
|
171
|
+
dark: '#BDC0C4',
|
|
172
|
+
light: '#D6D8DA'
|
|
173
|
+
},
|
|
174
|
+
description: ''
|
|
175
|
+
}, {
|
|
176
|
+
id: 'libro.toolbar.menu.label.color',
|
|
177
|
+
defaults: {
|
|
178
|
+
dark: '#BDC0C4',
|
|
179
|
+
light: Color.rgba(0, 0, 0, 0.65)
|
|
180
|
+
},
|
|
181
|
+
description: ''
|
|
182
|
+
}, {
|
|
183
|
+
id: 'libro.toolbar.menu.disabled.label.color',
|
|
184
|
+
defaults: {
|
|
185
|
+
dark: '#878c93',
|
|
186
|
+
light: Color.rgba(0, 0, 0, 0.25)
|
|
187
|
+
},
|
|
188
|
+
description: ''
|
|
189
|
+
}, {
|
|
190
|
+
id: 'libro.toolbar.menu.keybind.color',
|
|
191
|
+
defaults: {
|
|
192
|
+
dark: '#878c93',
|
|
193
|
+
light: Color.rgba(0, 0, 0, 0.45)
|
|
194
|
+
},
|
|
195
|
+
description: ''
|
|
196
|
+
}, {
|
|
197
|
+
id: 'libro.sidetoolbar.icon.color',
|
|
198
|
+
defaults: {
|
|
199
|
+
dark: '#BFBFBF',
|
|
200
|
+
light: '#6982A9'
|
|
201
|
+
},
|
|
202
|
+
description: ''
|
|
203
|
+
}, {
|
|
204
|
+
id: 'libro.sidetoolbar.border.color',
|
|
205
|
+
defaults: {
|
|
206
|
+
dark: Color.rgba(255, 255, 255, 0.08),
|
|
207
|
+
light: Color.rgba(0, 0, 0, 0.1)
|
|
208
|
+
},
|
|
209
|
+
description: ''
|
|
210
|
+
}, {
|
|
211
|
+
id: 'libro.close.color',
|
|
212
|
+
defaults: {
|
|
213
|
+
dark: Color.rgba(255, 255, 255, 0.45),
|
|
214
|
+
light: Color.rgba(0, 0, 0, 0.45)
|
|
215
|
+
},
|
|
216
|
+
description: ''
|
|
217
|
+
}, {
|
|
218
|
+
id: 'libro.modal.title.color',
|
|
219
|
+
defaults: {
|
|
220
|
+
dark: '#EDEEEF',
|
|
221
|
+
light: Color.rgba(0, 0, 0, 0.85)
|
|
222
|
+
},
|
|
223
|
+
description: ''
|
|
224
|
+
}, {
|
|
225
|
+
id: 'libro.modal.content.color',
|
|
226
|
+
defaults: {
|
|
227
|
+
dark: '#e3e4e6',
|
|
228
|
+
light: '#000a1a'
|
|
229
|
+
},
|
|
230
|
+
description: ''
|
|
231
|
+
}, {
|
|
232
|
+
id: 'libro.btn.primary.background.color',
|
|
233
|
+
defaults: {
|
|
234
|
+
dark: '#2A97FD',
|
|
235
|
+
light: '#1890FF'
|
|
236
|
+
},
|
|
237
|
+
description: ''
|
|
238
|
+
}, {
|
|
239
|
+
id: 'libro.execution.count.color',
|
|
240
|
+
defaults: {
|
|
241
|
+
dark: '#8694A9',
|
|
242
|
+
light: '#6A83AA'
|
|
243
|
+
},
|
|
244
|
+
description: ''
|
|
245
|
+
}, {
|
|
246
|
+
id: 'libro.tip.font.color',
|
|
247
|
+
defaults: {
|
|
248
|
+
dark: '#D6D8DA',
|
|
249
|
+
light: Color.rgba(0, 0, 0, 0.5)
|
|
250
|
+
},
|
|
251
|
+
description: ''
|
|
252
|
+
}, {
|
|
253
|
+
id: 'libro.execution.tip.success.color',
|
|
254
|
+
defaults: {
|
|
255
|
+
dark: '#48A918',
|
|
256
|
+
light: '#0DC54E'
|
|
257
|
+
},
|
|
258
|
+
description: ''
|
|
259
|
+
}, {
|
|
260
|
+
id: 'libro.link.color',
|
|
261
|
+
defaults: {
|
|
262
|
+
dark: '#177DDC',
|
|
263
|
+
light: '#1890FF'
|
|
264
|
+
},
|
|
265
|
+
description: ''
|
|
266
|
+
}, {
|
|
267
|
+
id: 'libro.error.color',
|
|
268
|
+
defaults: {
|
|
269
|
+
dark: '#cf4c52',
|
|
270
|
+
light: '#ed1345'
|
|
271
|
+
},
|
|
272
|
+
description: ''
|
|
273
|
+
}, {
|
|
274
|
+
id: 'libro.cell.border.color',
|
|
275
|
+
defaults: {
|
|
276
|
+
dark: '#3b3c42',
|
|
277
|
+
light: '#D6DEE6'
|
|
278
|
+
},
|
|
279
|
+
description: ''
|
|
280
|
+
}, {
|
|
281
|
+
id: 'libro.cell.active.border.color',
|
|
282
|
+
defaults: {
|
|
283
|
+
dark: '#378edf',
|
|
284
|
+
light: '#3490ed'
|
|
285
|
+
},
|
|
286
|
+
description: ''
|
|
287
|
+
}, {
|
|
288
|
+
id: 'libro.cell.active.border.shadow.color',
|
|
289
|
+
defaults: {
|
|
290
|
+
dark: Color.rgba(73, 162, 250, 0.25),
|
|
291
|
+
light: Color.rgba(53, 146, 238, 0.25)
|
|
292
|
+
},
|
|
293
|
+
description: ''
|
|
294
|
+
}, {
|
|
295
|
+
id: 'libro.cell.header.content',
|
|
296
|
+
defaults: {
|
|
297
|
+
dark: '#E3E4E6',
|
|
298
|
+
light: '#545B66'
|
|
299
|
+
},
|
|
300
|
+
description: ''
|
|
301
|
+
}, {
|
|
302
|
+
id: 'libro.cell.header.title',
|
|
303
|
+
defaults: {
|
|
304
|
+
dark: '#d6d8da',
|
|
305
|
+
light: '#000a1a'
|
|
306
|
+
},
|
|
307
|
+
description: ''
|
|
308
|
+
}, {
|
|
309
|
+
id: 'libro.code.border.color',
|
|
310
|
+
defaults: {
|
|
311
|
+
dark: '#353638',
|
|
312
|
+
light: '#DCE4EC'
|
|
313
|
+
},
|
|
314
|
+
description: ''
|
|
315
|
+
}, {
|
|
316
|
+
id: 'libro.input.border.color',
|
|
317
|
+
defaults: {
|
|
318
|
+
dark: '#505559',
|
|
319
|
+
light: Color.rgba(0, 0, 0, 0.15)
|
|
320
|
+
},
|
|
321
|
+
description: ''
|
|
322
|
+
}, {
|
|
323
|
+
id: 'libro.input.background.color',
|
|
324
|
+
defaults: {
|
|
325
|
+
dark: Color.rgba(255, 255, 255, 0.04),
|
|
326
|
+
light: '#FFFFFF'
|
|
327
|
+
},
|
|
328
|
+
description: ''
|
|
329
|
+
}, {
|
|
330
|
+
id: 'libro.input.group.btn.background.color',
|
|
331
|
+
defaults: {
|
|
332
|
+
dark: Color.rgba(0, 0, 0, 0.02),
|
|
333
|
+
light: Color.rgba(0, 0, 0, 0.02)
|
|
334
|
+
},
|
|
335
|
+
description: ''
|
|
336
|
+
}, {
|
|
337
|
+
id: 'libro.table.innner.border.color',
|
|
338
|
+
defaults: {
|
|
339
|
+
dark: '#1affffff',
|
|
340
|
+
light: '#E5EBF1'
|
|
341
|
+
},
|
|
342
|
+
description: ''
|
|
343
|
+
}, {
|
|
344
|
+
id: 'libro.table.bottom.border.color',
|
|
345
|
+
defaults: {
|
|
346
|
+
dark: '#424242',
|
|
347
|
+
light: '#E2E7EC'
|
|
348
|
+
},
|
|
349
|
+
description: ''
|
|
350
|
+
}, {
|
|
351
|
+
id: 'libro.editor.keyword.color',
|
|
352
|
+
defaults: {
|
|
353
|
+
dark: '#109b67',
|
|
354
|
+
light: '#098658'
|
|
355
|
+
},
|
|
356
|
+
description: ''
|
|
357
|
+
}, {
|
|
358
|
+
id: 'libro.editor.number.color',
|
|
359
|
+
defaults: {
|
|
360
|
+
dark: '#109b67',
|
|
361
|
+
light: '#098658'
|
|
362
|
+
},
|
|
363
|
+
description: ''
|
|
364
|
+
}, {
|
|
365
|
+
id: 'libro.editor.variable.2.color',
|
|
366
|
+
defaults: {
|
|
367
|
+
dark: '#5da4ea',
|
|
368
|
+
light: '#2060A0'
|
|
369
|
+
},
|
|
370
|
+
description: ''
|
|
371
|
+
}, {
|
|
372
|
+
id: 'libro.editor.punctuation.color',
|
|
373
|
+
defaults: {
|
|
374
|
+
dark: '#5da4ea',
|
|
375
|
+
light: '#2060A0'
|
|
376
|
+
},
|
|
377
|
+
description: ''
|
|
378
|
+
}, {
|
|
379
|
+
id: 'libro.editor.property.color',
|
|
380
|
+
defaults: {
|
|
381
|
+
dark: '#5da4ea',
|
|
382
|
+
light: '#2060A0'
|
|
383
|
+
},
|
|
384
|
+
description: ''
|
|
385
|
+
}, {
|
|
386
|
+
id: 'libro.editor.operator.color',
|
|
387
|
+
defaults: {
|
|
388
|
+
dark: 'e12ee1',
|
|
389
|
+
light: '#C700C7'
|
|
390
|
+
},
|
|
391
|
+
description: ''
|
|
392
|
+
}, {
|
|
393
|
+
id: 'libro.editor.meta.color',
|
|
394
|
+
defaults: {
|
|
395
|
+
dark: '#e12ee1',
|
|
396
|
+
light: '#C700C7'
|
|
397
|
+
},
|
|
398
|
+
description: ''
|
|
399
|
+
}, {
|
|
400
|
+
id: 'libro.editor.builtin.color',
|
|
401
|
+
defaults: {
|
|
402
|
+
dark: '#109b67',
|
|
403
|
+
light: '#098658'
|
|
404
|
+
},
|
|
405
|
+
description: ''
|
|
406
|
+
}, {
|
|
407
|
+
id: 'libro.editor.variable.color',
|
|
408
|
+
defaults: {
|
|
409
|
+
dark: '#e3e4e6',
|
|
410
|
+
light: '#212121'
|
|
411
|
+
},
|
|
412
|
+
description: ''
|
|
413
|
+
}, {
|
|
414
|
+
id: 'libro.editor.def.color',
|
|
415
|
+
defaults: {
|
|
416
|
+
dark: '#187dff',
|
|
417
|
+
light: '#003cff'
|
|
418
|
+
},
|
|
419
|
+
description: ''
|
|
420
|
+
}, {
|
|
421
|
+
id: 'libro.editor.comment.color',
|
|
422
|
+
defaults: {
|
|
423
|
+
dark: '#618961',
|
|
424
|
+
light: '#406040'
|
|
425
|
+
},
|
|
426
|
+
description: ''
|
|
427
|
+
}, {
|
|
428
|
+
id: 'libro.editor.string.color',
|
|
429
|
+
defaults: {
|
|
430
|
+
dark: '#ff5b48',
|
|
431
|
+
light: '#c03030'
|
|
432
|
+
},
|
|
433
|
+
description: ''
|
|
434
|
+
}, {
|
|
435
|
+
id: 'libro.editor.activeline.color',
|
|
436
|
+
defaults: {
|
|
437
|
+
dark: Color.rgba(229, 232, 240, 0.1),
|
|
438
|
+
light: Color.rgba(229, 232, 240, 0.5)
|
|
439
|
+
},
|
|
440
|
+
description: ''
|
|
441
|
+
}, {
|
|
442
|
+
id: 'libro.editor.selectionMatch.color',
|
|
443
|
+
defaults: {
|
|
444
|
+
dark: '#99ff7780',
|
|
445
|
+
light: '#DDE6FF'
|
|
446
|
+
},
|
|
447
|
+
description: ''
|
|
448
|
+
}, {
|
|
449
|
+
id: 'libro.editor.selection.color',
|
|
450
|
+
defaults: {
|
|
451
|
+
dark: '#B4CEFF',
|
|
452
|
+
light: '#B4CEFF'
|
|
453
|
+
},
|
|
454
|
+
description: ''
|
|
455
|
+
}, {
|
|
456
|
+
id: 'libro.editor.gutter.number.color',
|
|
457
|
+
defaults: {
|
|
458
|
+
dark: '#a8aebf',
|
|
459
|
+
light: '#A4AECB'
|
|
460
|
+
},
|
|
461
|
+
description: ''
|
|
462
|
+
}, {
|
|
463
|
+
id: 'libro.editor.line.color',
|
|
464
|
+
defaults: {
|
|
465
|
+
dark: '#565C6D',
|
|
466
|
+
light: '#A4AECB'
|
|
467
|
+
},
|
|
468
|
+
description: ''
|
|
469
|
+
}, {
|
|
470
|
+
id: 'libro.editor.cursor.color',
|
|
471
|
+
defaults: {
|
|
472
|
+
dark: '#ffffff',
|
|
473
|
+
light: '#000000'
|
|
474
|
+
},
|
|
475
|
+
description: ''
|
|
476
|
+
}, {
|
|
477
|
+
id: 'libro.editor.indent.marker.bg.color',
|
|
478
|
+
defaults: {
|
|
479
|
+
dark: '#42444d',
|
|
480
|
+
light: '#d6dbeb'
|
|
481
|
+
},
|
|
482
|
+
description: ''
|
|
483
|
+
}, {
|
|
484
|
+
id: 'libro.editor.indent.marker.active.bg.color',
|
|
485
|
+
defaults: {
|
|
486
|
+
dark: '#788491',
|
|
487
|
+
light: '#9f9f9f'
|
|
488
|
+
},
|
|
489
|
+
description: ''
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
}]);
|
|
493
|
+
return LibroColorRegistry;
|
|
494
|
+
}()) || _class);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
+
import './index.less';
|
|
3
|
+
export declare const ToolItemSelectInner: React.FC;
|
|
4
|
+
export declare const ToolItemSelect: import("react").NamedExoticComponent<{}>;
|
|
5
|
+
//# sourceMappingURL=change-cell-to-selector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-cell-to-selector.d.ts","sourceRoot":"","sources":["../../src/toolbar/change-cell-to-selector.tsx"],"names":[],"mappings":";AAeA,OAAO,cAAc,CAAC;AAQtB,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAgCvC,CAAC;AAEF,eAAO,MAAM,cAAc,0CAA4B,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
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; }
|
|
7
|
+
import { useInject, ToolbarInstance, getOrigin, CommandRegistry } from '@difizen/mana-app';
|
|
8
|
+
import { Select } from 'antd';
|
|
9
|
+
import { memo } from 'react';
|
|
10
|
+
import { LibroCellService } from "../cell/index.js";
|
|
11
|
+
import { NotebookCommands } from "../command/index.js";
|
|
12
|
+
import "./index.less";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
|
+
var Option = Select.Option;
|
|
16
|
+
var widthStyle = {
|
|
17
|
+
width: 110
|
|
18
|
+
};
|
|
19
|
+
export var ToolItemSelectInner = function ToolItemSelectInner() {
|
|
20
|
+
var _curCell$model;
|
|
21
|
+
var cellService = useInject(LibroCellService);
|
|
22
|
+
var invertList = cellService.cellsMeta;
|
|
23
|
+
var toolbar = useInject(ToolbarInstance);
|
|
24
|
+
var data = toolbar.currentArgs;
|
|
25
|
+
var command = useInject(CommandRegistry);
|
|
26
|
+
var curCell = data === null || data === void 0 ? void 0 : data[0];
|
|
27
|
+
var handleChange = function handleChange(value) {
|
|
28
|
+
var args = getOrigin(data) || [];
|
|
29
|
+
command.executeCommand.apply(command, [NotebookCommands['ChangeCellTo'].id].concat(_toConsumableArray(args), [value]));
|
|
30
|
+
};
|
|
31
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
32
|
+
children: /*#__PURE__*/_jsx(Select, {
|
|
33
|
+
value: curCell === null || curCell === void 0 ? void 0 : (_curCell$model = curCell.model) === null || _curCell$model === void 0 ? void 0 : _curCell$model.type,
|
|
34
|
+
size: 'small',
|
|
35
|
+
style: widthStyle,
|
|
36
|
+
onChange: handleChange,
|
|
37
|
+
bordered: false,
|
|
38
|
+
popupClassName: "libro-cell-selector",
|
|
39
|
+
children: invertList.map(function (item) {
|
|
40
|
+
return /*#__PURE__*/_jsx(Option, {
|
|
41
|
+
value: item.type,
|
|
42
|
+
children: item.name
|
|
43
|
+
}, item.name);
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
export var ToolItemSelect = /*#__PURE__*/memo(ToolItemSelectInner);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hide-all-selector.d.ts","sourceRoot":"","sources":["../../src/toolbar/hide-all-selector.tsx"],"names":[],"mappings":";AAiBA,OAAO,cAAc,CAAC;AAEtB,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAwGtC,CAAC;AAEF,eAAO,MAAM,aAAa,0CAA2B,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
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; }
|
|
7
|
+
import { EyeInvisibleOutlined } from '@ant-design/icons';
|
|
8
|
+
import { useInject, ToolbarInstance, getOrigin, CommandRegistry } from '@difizen/mana-app';
|
|
9
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
10
|
+
import { Menu, Dropdown } from 'antd';
|
|
11
|
+
import { memo } from 'react';
|
|
12
|
+
import { ExecutableCellModel } from "../cell/index.js";
|
|
13
|
+
import { NotebookCommands } from "../command/index.js";
|
|
14
|
+
import "./index.less";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
|
+
export var HideAllSelectInner = function HideAllSelectInner() {
|
|
18
|
+
var toolbar = useInject(ToolbarInstance);
|
|
19
|
+
var data = toolbar.currentArgs;
|
|
20
|
+
// const data = useInject(ToolbarArgs) as LibroToolbarArags;
|
|
21
|
+
var command = useInject(CommandRegistry);
|
|
22
|
+
var libroView = data === null || data === void 0 ? void 0 : data[1];
|
|
23
|
+
if (!libroView) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
var handleChange = function handleChange(e) {
|
|
27
|
+
var args = getOrigin(data) || [];
|
|
28
|
+
if (e.key === 'hideAllInputs') {
|
|
29
|
+
command.executeCommand.apply(command, [NotebookCommands['HideAllCellCode'].id].concat(_toConsumableArray(args)));
|
|
30
|
+
} else if (e.key === 'hideAllOutputs') {
|
|
31
|
+
command.executeCommand.apply(command, [NotebookCommands['HideAllCellOutput'].id].concat(_toConsumableArray(args)));
|
|
32
|
+
} else if (e.key === 'hideAll') {
|
|
33
|
+
command.executeCommand.apply(command, [NotebookCommands['HideAllCellCode'].id].concat(_toConsumableArray(args)));
|
|
34
|
+
command.executeCommand.apply(command, [NotebookCommands['HideAllCellOutput'].id].concat(_toConsumableArray(args)));
|
|
35
|
+
} else if (e.key === 'showAllInputs') {
|
|
36
|
+
command.executeCommand.apply(command, [NotebookCommands['ShowAllCellCode'].id].concat(_toConsumableArray(args)));
|
|
37
|
+
} else if (e.key === 'showAllOutputs') {
|
|
38
|
+
command.executeCommand.apply(command, [NotebookCommands['ShowAllCellOutputs'].id].concat(_toConsumableArray(args)));
|
|
39
|
+
} else if (e.key === 'showAll') {
|
|
40
|
+
command.executeCommand.apply(command, [NotebookCommands['ShowAllCellCode'].id].concat(_toConsumableArray(args)));
|
|
41
|
+
command.executeCommand.apply(command, [NotebookCommands['ShowAllCellOutputs'].id].concat(_toConsumableArray(args)));
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
//只要有一个cell input是显示的,隐藏cell input的选项都生效
|
|
45
|
+
var isCodeVisiable = libroView.model.getCells().findIndex(function (item) {
|
|
46
|
+
return item.hasInputHidden === false;
|
|
47
|
+
}) > -1 ? true : false;
|
|
48
|
+
//只要有一个cell input是隐藏的,显示cell input的选项都生效
|
|
49
|
+
var isCodeHidden = libroView.model.getCells().findIndex(function (item) {
|
|
50
|
+
return item.hasInputHidden === true;
|
|
51
|
+
}) > -1 ? true : false;
|
|
52
|
+
var isOutputVisible = libroView.model.getCells().findIndex(function (item) {
|
|
53
|
+
return ExecutableCellModel.is(item.model) && item.model.hasOutputHidden === false;
|
|
54
|
+
}) > -1 ? true : false;
|
|
55
|
+
var isOutputHidden = libroView.model.getCells().findIndex(function (item) {
|
|
56
|
+
return ExecutableCellModel.is(item.model) && item.model.hasOutputHidden === true;
|
|
57
|
+
}) > -1 ? true : false;
|
|
58
|
+
var menu = /*#__PURE__*/_jsx(Menu, {
|
|
59
|
+
onClick: handleChange,
|
|
60
|
+
items: [{
|
|
61
|
+
key: 'hideAllInputs',
|
|
62
|
+
label: l10n.t('隐藏全部Code'),
|
|
63
|
+
disabled: !isCodeVisiable
|
|
64
|
+
}, {
|
|
65
|
+
key: 'hideAllOutputs',
|
|
66
|
+
label: l10n.t('隐藏全部Output'),
|
|
67
|
+
disabled: !isOutputVisible
|
|
68
|
+
}, {
|
|
69
|
+
key: 'hideAll',
|
|
70
|
+
label: l10n.t('全部隐藏'),
|
|
71
|
+
disabled: !isCodeVisiable || !isOutputVisible
|
|
72
|
+
}, {
|
|
73
|
+
key: 'showAllInputs',
|
|
74
|
+
label: l10n.t('显示全部Code'),
|
|
75
|
+
disabled: !isCodeHidden
|
|
76
|
+
}, {
|
|
77
|
+
key: 'showAllOutputs',
|
|
78
|
+
label: l10n.t('显示全部Output'),
|
|
79
|
+
disabled: !isOutputHidden
|
|
80
|
+
}, {
|
|
81
|
+
key: 'showAll',
|
|
82
|
+
label: l10n.t('全部显示'),
|
|
83
|
+
disabled: !isCodeHidden || !isOutputHidden
|
|
84
|
+
}]
|
|
85
|
+
});
|
|
86
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
87
|
+
children: /*#__PURE__*/_jsx(Dropdown, {
|
|
88
|
+
overlay: menu,
|
|
89
|
+
placement: "bottomLeft",
|
|
90
|
+
overlayClassName: "libro-hide-selector-menu",
|
|
91
|
+
children: /*#__PURE__*/_jsx(EyeInvisibleOutlined, {
|
|
92
|
+
style: {
|
|
93
|
+
fontSize: 20
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
export var HideAllSelect = /*#__PURE__*/memo(HideAllSelectInner);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/toolbar/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC"}
|