@difizen/libro-core 0.1.32 → 0.1.33

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/es/index.less CHANGED
@@ -56,13 +56,15 @@
56
56
  .libro-view-top {
57
57
  display: flex;
58
58
  align-items: center;
59
+ justify-content: space-between;
59
60
  width: 100%;
60
61
  height: 44px;
61
62
  // background-color: var(--mana-color-bg-elevated);
62
63
  border-bottom: 1px solid var(--mana-libro-toptoolbar-border-color);
63
64
 
64
65
  .libro-header-left {
65
- width: 265px;
66
+ width: 240px;
67
+ flex-shrink: 0;
66
68
 
67
69
  .mana-toolbar {
68
70
  justify-content: left;
@@ -71,13 +73,12 @@
71
73
 
72
74
  .libro-header-center {
73
75
  .mana-toolbar {
74
- justify-content: center;
76
+ justify-content: flex-start;
75
77
  }
76
78
  }
77
79
 
78
80
  .libro-header-center,
79
81
  .libro-header-right {
80
- flex: 1;
81
82
  overflow: hidden;
82
83
 
83
84
  .mana-toolbar {
@@ -122,6 +123,7 @@
122
123
 
123
124
  .libro-header-right {
124
125
  color: unset;
126
+ flex: 0 0 auto;
125
127
  }
126
128
 
127
129
  .libro-keybind-instructions-icon {
@@ -57,7 +57,7 @@ export var PauseCircleOutlined = function PauseCircleOutlined() {
57
57
  children: /*#__PURE__*/_jsxs("g", {
58
58
  id: "time-out",
59
59
  fillRule: "nonzero",
60
- fill: "#7B7B7B",
60
+ fill: "currentColor",
61
61
  children: [/*#__PURE__*/_jsx("rect", {
62
62
  id: "\u77E9\u5F62",
63
63
  fill: "#000000",
@@ -91,7 +91,7 @@ export var Reload = function Reload() {
91
91
  children: /*#__PURE__*/_jsx("g", {
92
92
  id: "2.1-kernel-\u72B6\u6001\u5C55\u793A",
93
93
  transform: "translate(-776.000000, -80.000000)",
94
- fill: "#7B7B7B",
94
+ fill: "currentColor",
95
95
  fillRule: "nonzero",
96
96
  children: /*#__PURE__*/_jsx("g", {
97
97
  id: "\u7F16\u7EC4-24",
@@ -1 +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"}
1
+ {"version":3,"file":"change-cell-to-selector.d.ts","sourceRoot":"","sources":["../../src/toolbar/change-cell-to-selector.tsx"],"names":[],"mappings":";AAgBA,OAAO,cAAc,CAAC;AAQtB,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAwCvC,CAAC;AAEF,eAAO,MAAM,cAAc,0CAA4B,CAAC"}
@@ -4,14 +4,13 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
5
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
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';
7
+ import { useInject, ToolbarInstance, getOrigin, CommandRegistry, ThemeService } from '@difizen/mana-app';
8
+ import { ConfigProvider, Select, theme } from 'antd';
9
9
  import { memo } from 'react';
10
10
  import { LibroCellService } from "../cell/index.js";
11
11
  import { NotebookCommands } from "../command/index.js";
12
12
  import "./index.less";
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
- import { Fragment as _Fragment } from "react/jsx-runtime";
15
14
  var Option = Select.Option;
16
15
  var widthStyle = {
17
16
  width: 110
@@ -24,11 +23,15 @@ export var ToolItemSelectInner = function ToolItemSelectInner() {
24
23
  var data = toolbar.currentArgs;
25
24
  var command = useInject(CommandRegistry);
26
25
  var curCell = data === null || data === void 0 ? void 0 : data[0];
26
+ var themeService = useInject(ThemeService);
27
27
  var handleChange = function handleChange(value) {
28
28
  var args = getOrigin(data) || [];
29
29
  command.executeCommand.apply(command, [NotebookCommands['ChangeCellTo'].id].concat(_toConsumableArray(args), [value]));
30
30
  };
31
- return /*#__PURE__*/_jsx(_Fragment, {
31
+ return /*#__PURE__*/_jsx(ConfigProvider, {
32
+ theme: {
33
+ algorithm: themeService.getCurrentTheme().type === 'dark' ? theme.darkAlgorithm : theme.defaultAlgorithm
34
+ },
32
35
  children: /*#__PURE__*/_jsx(Select, {
33
36
  value: curCell === null || curCell === void 0 || (_curCell$model = curCell.model) === null || _curCell$model === void 0 ? void 0 : _curCell$model.type,
34
37
  size: 'small',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-core",
3
- "version": "0.1.32",
3
+ "version": "0.1.33",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "libro",
@@ -34,10 +34,10 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@ant-design/icons": "^5.1.0",
37
- "@difizen/libro-code-editor": "^0.1.32",
38
- "@difizen/libro-common": "^0.1.32",
39
- "@difizen/libro-shared-model": "^0.1.32",
40
- "@difizen/libro-virtualized": "^0.1.32",
37
+ "@difizen/libro-code-editor": "^0.1.33",
38
+ "@difizen/libro-common": "^0.1.33",
39
+ "@difizen/libro-shared-model": "^0.1.33",
40
+ "@difizen/libro-virtualized": "^0.1.33",
41
41
  "@difizen/mana-app": "latest",
42
42
  "@difizen/mana-l10n": "latest",
43
43
  "@difizen/mana-react": "latest",
package/src/index.less CHANGED
@@ -56,13 +56,15 @@
56
56
  .libro-view-top {
57
57
  display: flex;
58
58
  align-items: center;
59
+ justify-content: space-between;
59
60
  width: 100%;
60
61
  height: 44px;
61
62
  // background-color: var(--mana-color-bg-elevated);
62
63
  border-bottom: 1px solid var(--mana-libro-toptoolbar-border-color);
63
64
 
64
65
  .libro-header-left {
65
- width: 265px;
66
+ width: 240px;
67
+ flex-shrink: 0;
66
68
 
67
69
  .mana-toolbar {
68
70
  justify-content: left;
@@ -71,13 +73,12 @@
71
73
 
72
74
  .libro-header-center {
73
75
  .mana-toolbar {
74
- justify-content: center;
76
+ justify-content: flex-start;
75
77
  }
76
78
  }
77
79
 
78
80
  .libro-header-center,
79
81
  .libro-header-right {
80
- flex: 1;
81
82
  overflow: hidden;
82
83
 
83
84
  .mana-toolbar {
@@ -122,6 +123,7 @@
122
123
 
123
124
  .libro-header-right {
124
125
  color: unset;
126
+ flex: 0 0 auto;
125
127
  }
126
128
 
127
129
  .libro-keybind-instructions-icon {
@@ -41,7 +41,7 @@ export const PauseCircleOutlined: React.FC = () => (
41
41
  xmlnsXlink="http://www.w3.org/1999/xlink"
42
42
  >
43
43
  <g id="原色" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
44
- <g id="time-out" fillRule="nonzero" fill="#7B7B7B">
44
+ <g id="time-out" fillRule="nonzero" fill="currentColor">
45
45
  <rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="20" height="20" />
46
46
  <path
47
47
  d="M10,1.25 C5.16796875,1.25 1.25,5.16796875 1.25,10 C1.25,14.8320312 5.16796875,18.75 10,18.75 C14.8320312,18.75 18.75,14.8320312 18.75,10 C18.75,5.16796875 14.8320312,1.25 10,1.25 Z M10,17.265625 C5.98828125,17.265625 2.734375,14.0117187 2.734375,10 C2.734375,5.98828125 5.98828125,2.734375 10,2.734375 C14.0117187,2.734375 17.265625,5.98828125 17.265625,10 C17.265625,14.0117187 14.0117187,17.265625 10,17.265625 Z M8.28125,6.875 L7.34375,6.875 C7.2578125,6.875 7.1875,6.9453125 7.1875,7.03125 L7.1875,12.96875 C7.1875,13.0546875 7.2578125,13.125 7.34375,13.125 L8.28125,13.125 C8.3671875,13.125 8.4375,13.0546875 8.4375,12.96875 L8.4375,7.03125 C8.4375,6.9453125 8.3671875,6.875 8.28125,6.875 Z M12.65625,6.875 L11.71875,6.875 C11.6328125,6.875 11.5625,6.9453125 11.5625,7.03125 L11.5625,12.96875 C11.5625,13.0546875 11.6328125,13.125 11.71875,13.125 L12.65625,13.125 C12.7421875,13.125 12.8125,13.0546875 12.8125,12.96875 L12.8125,7.03125 C12.8125,6.9453125 12.7421875,6.875 12.65625,6.875 Z"
@@ -65,7 +65,7 @@ export const Reload: React.FC = () => (
65
65
  <g
66
66
  id="2.1-kernel-状态展示"
67
67
  transform="translate(-776.000000, -80.000000)"
68
- fill="#7B7B7B"
68
+ fill="currentColor"
69
69
  fillRule="nonzero"
70
70
  >
71
71
  <g id="编组-24" transform="translate(637.000000, 80.000000)">
@@ -3,9 +3,10 @@ import {
3
3
  ToolbarInstance,
4
4
  getOrigin,
5
5
  CommandRegistry,
6
+ ThemeService,
6
7
  } from '@difizen/mana-app';
7
8
  import type { Toolbar } from '@difizen/mana-app';
8
- import { Select } from 'antd';
9
+ import { ConfigProvider, Select, theme } from 'antd';
9
10
  import { memo } from 'react';
10
11
 
11
12
  import type { CellMeta } from '../cell/index.js';
@@ -28,13 +29,21 @@ export const ToolItemSelectInner: React.FC = () => {
28
29
  const data = toolbar.currentArgs as LibroToolbarArags;
29
30
  const command = useInject(CommandRegistry);
30
31
  const curCell = data?.[0];
32
+ const themeService = useInject(ThemeService);
31
33
 
32
34
  const handleChange = (value: string) => {
33
35
  const args = getOrigin(data) || [];
34
36
  command.executeCommand(NotebookCommands['ChangeCellTo'].id, ...args, value);
35
37
  };
36
38
  return (
37
- <>
39
+ <ConfigProvider
40
+ theme={{
41
+ algorithm:
42
+ themeService.getCurrentTheme().type === 'dark'
43
+ ? theme.darkAlgorithm
44
+ : theme.defaultAlgorithm,
45
+ }}
46
+ >
38
47
  <Select
39
48
  value={curCell?.model?.type}
40
49
  size={'small'}
@@ -51,7 +60,7 @@ export const ToolItemSelectInner: React.FC = () => {
51
60
  );
52
61
  })}
53
62
  </Select>
54
- </>
63
+ </ConfigProvider>
55
64
  );
56
65
  };
57
66