@difizen/libro-markdown-cell 0.2.29 → 0.2.31
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.
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import type { LanguageSpecRegistry } from '@difizen/libro-code-editor';
|
|
2
|
+
import { LanguageSpecContribution } from '@difizen/libro-code-editor';
|
|
1
3
|
import type { CellMeta, CellOptions, CellModel } from '@difizen/libro-core';
|
|
2
4
|
import { CellModelContribution, CellViewContribution } from '@difizen/libro-core';
|
|
3
5
|
import { MarkdownCellModelFactory } from './markdown-cell-protocol.js';
|
|
4
6
|
import { MarkdownCellView } from './markdown-cell-view.js';
|
|
5
|
-
export declare class MarkdownCellContribution implements CellModelContribution, CellViewContribution {
|
|
7
|
+
export declare class MarkdownCellContribution implements CellModelContribution, CellViewContribution, LanguageSpecContribution {
|
|
6
8
|
markdownCellModelFactory: MarkdownCellModelFactory;
|
|
7
9
|
cellMeta: CellMeta;
|
|
8
10
|
canHandle(options: CellOptions): number;
|
|
9
11
|
createModel(options: CellOptions): CellModel;
|
|
10
12
|
view: typeof MarkdownCellView;
|
|
13
|
+
registerLanguageSpec: (register: LanguageSpecRegistry) => void;
|
|
11
14
|
}
|
|
12
15
|
//# sourceMappingURL=markdown-cell-contribution.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-cell-contribution.d.ts","sourceRoot":"","sources":["../src/markdown-cell-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAGlF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,
|
|
1
|
+
{"version":3,"file":"markdown-cell-contribution.d.ts","sourceRoot":"","sources":["../src/markdown-cell-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAGlF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,qBAGa,wBACX,YAAW,qBAAqB,EAAE,oBAAoB,EAAE,wBAAwB;IAE9C,wBAAwB,EAAE,wBAAwB,CAAC;IAErF,QAAQ,EAAE,QAAQ,CAIhB;IAEF,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM;IAOvC,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS;IAK5C,IAAI,0BAAoB;IAExB,oBAAoB,aAAc,oBAAoB,UAOpD;CACH"}
|
|
@@ -8,12 +8,13 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
8
8
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
9
|
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; }
|
|
10
10
|
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.'); }
|
|
11
|
+
import { LanguageSpecContribution } from '@difizen/libro-code-editor';
|
|
11
12
|
import { CellModelContribution, CellViewContribution } from '@difizen/libro-core';
|
|
12
13
|
import { singleton, inject } from '@difizen/mana-app';
|
|
13
14
|
import { MarkdownCellModelFactory } from "./markdown-cell-protocol.js";
|
|
14
15
|
import { MarkdownCellView } from "./markdown-cell-view.js";
|
|
15
16
|
export var MarkdownCellContribution = (_dec = singleton({
|
|
16
|
-
contrib: [CellModelContribution, CellViewContribution]
|
|
17
|
+
contrib: [CellModelContribution, CellViewContribution, LanguageSpecContribution]
|
|
17
18
|
}), _dec2 = inject(MarkdownCellModelFactory), _dec(_class = (_class2 = /*#__PURE__*/function () {
|
|
18
19
|
function MarkdownCellContribution() {
|
|
19
20
|
_classCallCheck(this, MarkdownCellContribution);
|
|
@@ -24,6 +25,14 @@ export var MarkdownCellContribution = (_dec = singleton({
|
|
|
24
25
|
order: 'c'
|
|
25
26
|
};
|
|
26
27
|
this.view = MarkdownCellView;
|
|
28
|
+
this.registerLanguageSpec = function (register) {
|
|
29
|
+
register.registerLanguageSpec({
|
|
30
|
+
name: 'Markdown',
|
|
31
|
+
language: 'markdown',
|
|
32
|
+
mime: 'text/x-markdown',
|
|
33
|
+
ext: ['.md', '.markdown', '.mkd', '.sh']
|
|
34
|
+
});
|
|
35
|
+
};
|
|
27
36
|
}
|
|
28
37
|
_createClass(MarkdownCellContribution, [{
|
|
29
38
|
key: "canHandle",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-markdown-cell",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.31",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"libro",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"@types/react": "^18.2.25"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@difizen/libro-core": "^0.2.
|
|
43
|
-
"@difizen/libro-common": "^0.2.
|
|
44
|
-
"@difizen/libro-code-editor": "^0.2.
|
|
45
|
-
"@difizen/libro-markdown": "^0.2.
|
|
42
|
+
"@difizen/libro-core": "^0.2.31",
|
|
43
|
+
"@difizen/libro-common": "^0.2.31",
|
|
44
|
+
"@difizen/libro-code-editor": "^0.2.31",
|
|
45
|
+
"@difizen/libro-markdown": "^0.2.31",
|
|
46
46
|
"@difizen/mana-app": "latest",
|
|
47
47
|
"@types/markdown-it": "^12.2.3",
|
|
48
48
|
"markdown-it": "^13.0.1",
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { LanguageSpecRegistry } from '@difizen/libro-code-editor';
|
|
2
|
+
import { LanguageSpecContribution } from '@difizen/libro-code-editor';
|
|
1
3
|
import type { CellMeta, CellOptions, CellModel } from '@difizen/libro-core';
|
|
2
4
|
import { CellModelContribution, CellViewContribution } from '@difizen/libro-core';
|
|
3
5
|
import { singleton, inject } from '@difizen/mana-app';
|
|
@@ -5,9 +7,11 @@ import { singleton, inject } from '@difizen/mana-app';
|
|
|
5
7
|
import { MarkdownCellModelFactory } from './markdown-cell-protocol.js';
|
|
6
8
|
import { MarkdownCellView } from './markdown-cell-view.js';
|
|
7
9
|
|
|
8
|
-
@singleton({
|
|
10
|
+
@singleton({
|
|
11
|
+
contrib: [CellModelContribution, CellViewContribution, LanguageSpecContribution],
|
|
12
|
+
})
|
|
9
13
|
export class MarkdownCellContribution
|
|
10
|
-
implements CellModelContribution, CellViewContribution
|
|
14
|
+
implements CellModelContribution, CellViewContribution, LanguageSpecContribution
|
|
11
15
|
{
|
|
12
16
|
@inject(MarkdownCellModelFactory) markdownCellModelFactory: MarkdownCellModelFactory;
|
|
13
17
|
|
|
@@ -30,4 +34,13 @@ export class MarkdownCellContribution
|
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
view = MarkdownCellView;
|
|
37
|
+
|
|
38
|
+
registerLanguageSpec = (register: LanguageSpecRegistry) => {
|
|
39
|
+
register.registerLanguageSpec({
|
|
40
|
+
name: 'Markdown',
|
|
41
|
+
language: 'markdown',
|
|
42
|
+
mime: 'text/x-markdown',
|
|
43
|
+
ext: ['.md', '.markdown', '.mkd', '.sh'],
|
|
44
|
+
});
|
|
45
|
+
};
|
|
33
46
|
}
|