@difizen/libro-lab 0.1.8 → 0.1.10
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/editor-viewer/code-editor-open-handler.js +1 -1
- package/es/editor-viewer/code-editor-viewer.js +8 -6
- package/es/layout/protocol.d.ts +1 -0
- package/es/layout/protocol.d.ts.map +1 -1
- package/es/layout/side-tab-view.d.ts +1 -0
- package/es/layout/side-tab-view.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/editor-viewer/code-editor-open-handler.ts +1 -1
- package/src/editor-viewer/code-editor-viewer.tsx +4 -4
|
@@ -50,7 +50,7 @@ export var CodeEditorViewerOpenHandler = (_dec = singleton({
|
|
|
50
50
|
_createClass(CodeEditorViewerOpenHandler, [{
|
|
51
51
|
key: "canHandle",
|
|
52
52
|
value: function canHandle(uri, options) {
|
|
53
|
-
if (uri.scheme === 'file' && !['.tar', '.zip', '.7z', '.gz', 'rar'].includes(uri.path.ext)) {
|
|
53
|
+
if (uri.scheme === 'file' && !['.tar', '.zip', '.7z', '.gz', '.rar', '.whl'].includes(uri.path.ext)) {
|
|
54
54
|
return 100;
|
|
55
55
|
}
|
|
56
56
|
return Priority.IDLE;
|
|
@@ -133,8 +133,10 @@ export var CodeEditorViewer = (_dec = transient(), _dec2 = view(CodeEditorViewer
|
|
|
133
133
|
key: "onViewMount",
|
|
134
134
|
value: function () {
|
|
135
135
|
var _onViewMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
136
|
-
var _this$languageSpec
|
|
137
|
-
_this$languageSpec,
|
|
136
|
+
var _this$languageSpec,
|
|
137
|
+
_this$languageSpec$be,
|
|
138
|
+
_this$languageSpec2,
|
|
139
|
+
_this$languageSpec3,
|
|
138
140
|
_this2 = this;
|
|
139
141
|
var content, editorPorvider, uri, options;
|
|
140
142
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
@@ -150,7 +152,7 @@ export var CodeEditorViewer = (_dec = transient(), _dec2 = view(CodeEditorViewer
|
|
|
150
152
|
return getOrigin(this.fileService).read(this.filePath);
|
|
151
153
|
case 4:
|
|
152
154
|
content = _context3.sent;
|
|
153
|
-
if (!(typeof content !== 'string'
|
|
155
|
+
if (!(typeof content !== 'string')) {
|
|
154
156
|
_context3.next = 7;
|
|
155
157
|
break;
|
|
156
158
|
}
|
|
@@ -166,19 +168,19 @@ export var CodeEditorViewer = (_dec = transient(), _dec2 = view(CodeEditorViewer
|
|
|
166
168
|
return MonacoEnvironment.init();
|
|
167
169
|
case 11:
|
|
168
170
|
_context3.next = 13;
|
|
169
|
-
return (_this$languageSpec
|
|
171
|
+
return (_this$languageSpec = this.languageSpec) === null || _this$languageSpec === void 0 || (_this$languageSpec$be = _this$languageSpec.beforeEditorInit) === null || _this$languageSpec$be === void 0 ? void 0 : _this$languageSpec$be.call(_this$languageSpec);
|
|
170
172
|
case 13:
|
|
171
173
|
editorPorvider = MonacoEnvironment.container.get(EditorProvider);
|
|
172
174
|
uri = MonacoUri.from({
|
|
173
175
|
scheme: LibroLabE2URIScheme,
|
|
174
|
-
path: "".concat(this.filePath).concat(this.languageSpec.ext[0])
|
|
176
|
+
path: "".concat(this.filePath).concat((_this$languageSpec2 = this.languageSpec) === null || _this$languageSpec2 === void 0 ? void 0 : _this$languageSpec2.ext[0])
|
|
175
177
|
});
|
|
176
178
|
options = {
|
|
177
179
|
/**
|
|
178
180
|
* language ia an uri:
|
|
179
181
|
*/
|
|
180
182
|
theme: 'libro-light',
|
|
181
|
-
language: this.languageSpec.language || 'markdown',
|
|
183
|
+
language: ((_this$languageSpec3 = this.languageSpec) === null || _this$languageSpec3 === void 0 ? void 0 : _this$languageSpec3.language) || 'markdown',
|
|
182
184
|
uri: uri,
|
|
183
185
|
value: content
|
|
184
186
|
};
|
package/es/layout/protocol.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/layout/protocol.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;;;;;;;;;CAS/B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AAE/C,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/layout/protocol.tsx"],"names":[],"mappings":";AAAA,eAAO,MAAM,mBAAmB;;;;;;;;;CAS/B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AAE/C,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side-tab-view.d.ts","sourceRoot":"","sources":["../../src/layout/side-tab-view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAiB,MAAM,mBAAmB,CAAC;AAI/D,qBAEa,mBAAoB,SAAQ,WAAW;IACzC,gBAAgB,IAAI,GAAG,CAAC,OAAO;CAGzC"}
|
|
1
|
+
{"version":3,"file":"side-tab-view.d.ts","sourceRoot":"","sources":["../../src/layout/side-tab-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAiB,MAAM,mBAAmB,CAAC;AAI/D,qBAEa,mBAAoB,SAAQ,WAAW;IACzC,gBAAgB,IAAI,GAAG,CAAC,OAAO;CAGzC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-lab",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"libro",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@ant-design/icons": "^5.1.0",
|
|
37
|
-
"@difizen/libro-core": "^0.1.
|
|
38
|
-
"@difizen/libro-jupyter": "^0.1.
|
|
39
|
-
"@difizen/libro-kernel": "^0.1.
|
|
40
|
-
"@difizen/libro-prompt-cell": "^0.1.
|
|
41
|
-
"@difizen/libro-terminal": "^0.1.
|
|
42
|
-
"@difizen/libro-toc": "^0.1.
|
|
43
|
-
"@difizen/libro-cofine-editor-core": "^0.1.
|
|
37
|
+
"@difizen/libro-core": "^0.1.10",
|
|
38
|
+
"@difizen/libro-jupyter": "^0.1.10",
|
|
39
|
+
"@difizen/libro-kernel": "^0.1.10",
|
|
40
|
+
"@difizen/libro-prompt-cell": "^0.1.10",
|
|
41
|
+
"@difizen/libro-terminal": "^0.1.10",
|
|
42
|
+
"@difizen/libro-toc": "^0.1.10",
|
|
43
|
+
"@difizen/libro-cofine-editor-core": "^0.1.10",
|
|
44
44
|
"@difizen/mana-app": "latest",
|
|
45
45
|
"@difizen/mana-react": "latest",
|
|
46
46
|
"classnames": "^2.3.2",
|
|
@@ -66,6 +66,6 @@
|
|
|
66
66
|
"coverage:jest": "jest --coverage",
|
|
67
67
|
"lint": ": Note: lint task is delegated to lint:* scripts",
|
|
68
68
|
"lint:eslint": "eslint src",
|
|
69
|
-
"
|
|
69
|
+
"typecheck:tsc": "tsc --noEmit"
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -16,7 +16,7 @@ export class CodeEditorViewerOpenHandler extends NavigatableViewOpenHandler<Code
|
|
|
16
16
|
canHandle(uri: URI, options?: ViewOpenHandlerOptions) {
|
|
17
17
|
if (
|
|
18
18
|
uri.scheme === 'file' &&
|
|
19
|
-
!['.tar', '.zip', '.7z', '.gz', 'rar'].includes(uri.path.ext)
|
|
19
|
+
!['.tar', '.zip', '.7z', '.gz', '.rar', '.whl'].includes(uri.path.ext)
|
|
20
20
|
) {
|
|
21
21
|
return 100;
|
|
22
22
|
}
|
|
@@ -111,7 +111,7 @@ export class CodeEditorViewer extends BaseView implements NavigatableView, Savea
|
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
const content = await getOrigin(this.fileService).read(this.filePath);
|
|
114
|
-
if (typeof content !== 'string'
|
|
114
|
+
if (typeof content !== 'string') {
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
if (!this.codeRef || !this.codeRef.current) {
|
|
@@ -119,13 +119,13 @@ export class CodeEditorViewer extends BaseView implements NavigatableView, Savea
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
await MonacoEnvironment.init();
|
|
122
|
-
await this.languageSpec
|
|
122
|
+
await this.languageSpec?.beforeEditorInit?.();
|
|
123
123
|
const editorPorvider =
|
|
124
124
|
MonacoEnvironment.container.get<EditorProvider>(EditorProvider);
|
|
125
125
|
|
|
126
126
|
const uri = MonacoUri.from({
|
|
127
127
|
scheme: LibroLabE2URIScheme,
|
|
128
|
-
path: `${this.filePath}${this.languageSpec
|
|
128
|
+
path: `${this.filePath}${this.languageSpec?.ext[0]}`,
|
|
129
129
|
});
|
|
130
130
|
|
|
131
131
|
const options: MonacoEditorOptions = {
|
|
@@ -133,7 +133,7 @@ export class CodeEditorViewer extends BaseView implements NavigatableView, Savea
|
|
|
133
133
|
* language ia an uri:
|
|
134
134
|
*/
|
|
135
135
|
theme: 'libro-light',
|
|
136
|
-
language: this.languageSpec
|
|
136
|
+
language: this.languageSpec?.language || 'markdown',
|
|
137
137
|
uri,
|
|
138
138
|
value: content,
|
|
139
139
|
};
|