This commit is contained in:
21
node_modules/remark-slate-transformer/LICENSE
generated
vendored
Normal file
21
node_modules/remark-slate-transformer/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 inokawa
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
184
node_modules/remark-slate-transformer/README.md
generated
vendored
Normal file
184
node_modules/remark-slate-transformer/README.md
generated
vendored
Normal file
@@ -0,0 +1,184 @@
|
||||
# remark-slate-transformer
|
||||
|
||||
   
|
||||
|
||||
[remark](https://github.com/remarkjs/remark) plugin to transform remark syntax tree ([mdast](https://github.com/syntax-tree/mdast)) to [Slate](https://github.com/ianstormtaylor/slate) document tree, and vice versa. Made for WYSIWYG markdown editor.
|
||||
|
||||
[remark](https://github.com/remarkjs/remark) is popular markdown parser/serializer which data structure can be converted to what used in [rehype](https://github.com/rehypejs/rehype), [retext](https://github.com/retextjs/retext) and so on. [Slate](https://github.com/ianstormtaylor/slate) is fully customizable rich text editor built on [React](https://github.com/facebook/react). Connect both 2 worlds should be great...
|
||||
|
||||
## Support
|
||||
|
||||
This plugin supports slate 0.50+.
|
||||
The data structure is described [here](https://docs.slatejs.org/concepts/02-nodes).
|
||||
And also support ~0.47.9 currently, but I don't know in the future.
|
||||
|
||||
All nodes in [mdast](https://github.com/syntax-tree/mdast) syntax tree are supported, including nodes created with...
|
||||
|
||||
- [remark-gfm](https://github.com/remarkjs/remark-gfm)
|
||||
- [remark-footnotes](https://github.com/remarkjs/remark-footnotes)
|
||||
- [remark-frontmatter](https://github.com/remarkjs/remark-frontmatter)
|
||||
- `math` and `inlineMath` from [remark-math](https://github.com/remarkjs/remark-math).
|
||||
|
||||
And also have experimental support for [custom AST](https://github.com/inokawa/remark-slate-transformer#support-custom-ast).
|
||||
|
||||
## Demo
|
||||
|
||||
https://inokawa.github.io/remark-slate-transformer/
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm install remark-slate-transformer
|
||||
```
|
||||
|
||||
### Supported unified versions
|
||||
|
||||
| remark-slate-transformer | unified |
|
||||
| ------------------------ | -------- |
|
||||
| >=0.7.0 | >=10.1.0 |
|
||||
| >=0.5.0 <0.7.0 | >=10.0.0 |
|
||||
| <0.5.0 | <10.0.0 |
|
||||
|
||||
## Usage
|
||||
|
||||
### Transform remark to slate
|
||||
|
||||
#### 0.50+
|
||||
|
||||
```javascript
|
||||
import { unified } from "unified";
|
||||
import markdown from "remark-parse";
|
||||
import { remarkToSlate } from "remark-slate-transformer";
|
||||
|
||||
const processor = unified().use(markdown).use(remarkToSlate);
|
||||
|
||||
const text = "# hello world";
|
||||
|
||||
const value = processor.processSync(text).result;
|
||||
console.log(value);
|
||||
```
|
||||
|
||||
#### ~0.47.9
|
||||
|
||||
```javascript
|
||||
import { Value } from "slate";
|
||||
import { unified } from "unified";
|
||||
import markdown from "remark-parse";
|
||||
import { remarkToSlateLegacy } from "remark-slate-transformer";
|
||||
|
||||
const processor = unified().use(markdown).use(remarkToSlateLegacy);
|
||||
|
||||
const text = "# hello world";
|
||||
|
||||
const value = Value.fromJSON(processor.processSync(text).result);
|
||||
console.log(value);
|
||||
```
|
||||
|
||||
### Transform slate to remark
|
||||
|
||||
#### 0.50+
|
||||
|
||||
```javascript
|
||||
import { unified } from "unified";
|
||||
import stringify from "remark-stringify";
|
||||
import { slateToRemark } from "remark-slate-transformer";
|
||||
|
||||
const processor = unified().use(slateToRemark).use(stringify);
|
||||
|
||||
const value = ...; // value passed to slate editor
|
||||
|
||||
const ast = processor.runSync({
|
||||
type: "root",
|
||||
children: value,
|
||||
});
|
||||
const text = processor.stringify(ast);
|
||||
console.log(text);
|
||||
```
|
||||
|
||||
#### ~0.47.9
|
||||
|
||||
```javascript
|
||||
import { unified } from "unified";
|
||||
import stringify from "remark-stringify";
|
||||
import { slateToRemarkLegacy } from "remark-slate-transformer";
|
||||
|
||||
const processor = unified().use(slateToRemarkLegacy).use(stringify);
|
||||
|
||||
const value = ...; // value passed to slate editor
|
||||
|
||||
const ast = processor.runSync({
|
||||
type: "root",
|
||||
children: value.toJSON().document.nodes,
|
||||
});
|
||||
const text = processor.stringify(ast);
|
||||
console.log(text);
|
||||
```
|
||||
|
||||
### Support custom AST
|
||||
|
||||
```js
|
||||
import { unified } from "unified";
|
||||
import markdown from "remark-parse";
|
||||
import stringify from "remark-stringify";
|
||||
import { remarkToSlate, slateToRemark } from "remark-slate-transformer";
|
||||
|
||||
const text = "# hello world";
|
||||
const r2s = unified()
|
||||
.use(markdown)
|
||||
.use(remarkToSlate, {
|
||||
// If you use TypeScript, install `@types/mdast` for autocomplete.
|
||||
overrides: {
|
||||
// This overrides `type: "heading"` builder of remarkToSlate
|
||||
heading: (node, next) => ({
|
||||
type: "head",
|
||||
dep: node.depth,
|
||||
// You have to call next if the node have children
|
||||
children: next(node.children),
|
||||
}),
|
||||
// Unknown type from community plugins can be handled
|
||||
foo: (node, next) => ({ type: "foo", value: node.bar }),
|
||||
},
|
||||
});
|
||||
const value = r2s.processSync(text).result;
|
||||
console.log(value);
|
||||
|
||||
const s2r = unified()
|
||||
.use(slateToRemark, {
|
||||
overrides: {
|
||||
head: (node, next) => ({
|
||||
type: "heading",
|
||||
depth: node.dep,
|
||||
children: next(node.children),
|
||||
}),
|
||||
foo: (node, next) => ({ type: "foo", bar: node.value }),
|
||||
},
|
||||
})
|
||||
.use(stringify);
|
||||
const ast = s2r.runSync({
|
||||
type: "root",
|
||||
children: value,
|
||||
});
|
||||
const text = s2r.stringify(ast);
|
||||
console.log(text);
|
||||
```
|
||||
|
||||
### Utilities
|
||||
|
||||
Transformer utilities `mdastToSlate` and `slateToMdast` are also exported for more fine-tuned control.
|
||||
|
||||
## Contribute
|
||||
|
||||
All contributions are welcome.
|
||||
If you find a problem, feel free to create an [issue](https://github.com/inokawa/remark-slate-transformer/issues) or a [PR](https://github.com/inokawa/remark-slate-transformer/pulls).
|
||||
|
||||
### Making a Pull Request
|
||||
|
||||
1. Clone this repo.
|
||||
2. Run `npm install`.
|
||||
3. Commit your fix.
|
||||
4. Make a PR and confirm all the CI checks passed.
|
||||
|
||||
## Related projects
|
||||
|
||||
- [remark-docx](https://github.com/inokawa/remark-docx)
|
||||
- [remark-pdf](https://github.com/inokawa/remark-pdf)
|
||||
8
node_modules/remark-slate-transformer/lib/index.d.ts
generated
vendored
Normal file
8
node_modules/remark-slate-transformer/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export { default as remarkToSlate } from "./plugins/remark-to-slate";
|
||||
export type { Options as RemarkToSlateOptions } from "./plugins/remark-to-slate";
|
||||
export { default as slateToRemark } from "./plugins/slate-to-remark";
|
||||
export type { Options as SlateToRemarkOptions } from "./plugins/slate-to-remark";
|
||||
export { default as slateToRemarkLegacy } from "./plugins/slate0.47-to-remark";
|
||||
export { default as remarkToSlateLegacy } from "./plugins/remark-to-slate0.47";
|
||||
export { mdastToSlate } from "./transformers/mdast-to-slate";
|
||||
export { slateToMdast } from "./transformers/slate-to-mdast";
|
||||
820
node_modules/remark-slate-transformer/lib/index.js
generated
vendored
Normal file
820
node_modules/remark-slate-transformer/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,820 @@
|
||||
'use strict';
|
||||
|
||||
var tslib = require('tslib');
|
||||
|
||||
const unreachable = (_) => {
|
||||
throw new Error("unreachable");
|
||||
};
|
||||
|
||||
const mdastToSlate = (node, overrides) => {
|
||||
return buildSlateRoot(node, overrides);
|
||||
};
|
||||
const buildSlateRoot = (root, overrides) => {
|
||||
return convertNodes$3(root.children, {}, overrides);
|
||||
};
|
||||
const convertNodes$3 = (nodes, deco, overrides) => {
|
||||
return nodes.reduce((acc, node) => {
|
||||
acc.push(...buildSlateNode(node, deco, overrides));
|
||||
return acc;
|
||||
}, []);
|
||||
};
|
||||
const buildSlateNode = (node, deco, overrides) => {
|
||||
var _a;
|
||||
const customNode = (_a = overrides[node.type]) === null || _a === void 0 ? void 0 : _a.call(overrides, node, (children) => convertNodes$3(children, deco, overrides));
|
||||
if (customNode != null) {
|
||||
return [customNode];
|
||||
}
|
||||
switch (node.type) {
|
||||
case "paragraph":
|
||||
return [buildParagraph$1(node, deco, overrides)];
|
||||
case "heading":
|
||||
return [buildHeading$1(node, deco, overrides)];
|
||||
case "thematicBreak":
|
||||
return [buildThematicBreak$1(node)];
|
||||
case "blockquote":
|
||||
return [buildBlockquote$1(node, deco, overrides)];
|
||||
case "list":
|
||||
return [buildList$1(node, deco, overrides)];
|
||||
case "listItem":
|
||||
return [buildListItem$1(node, deco, overrides)];
|
||||
case "table":
|
||||
return [buildTable$1(node, deco, overrides)];
|
||||
case "tableRow":
|
||||
return [buildTableRow$1(node, deco, overrides)];
|
||||
case "tableCell":
|
||||
return [buildTableCell$1(node, deco, overrides)];
|
||||
case "html":
|
||||
return [buildHtml$1(node)];
|
||||
case "code":
|
||||
return [buildCode$1(node)];
|
||||
case "yaml":
|
||||
return [buildYaml$1(node)];
|
||||
case "toml":
|
||||
return [buildToml$1(node)];
|
||||
case "definition":
|
||||
return [buildDefinition$1(node)];
|
||||
case "footnoteDefinition":
|
||||
return [buildFootnoteDefinition$1(node, deco, overrides)];
|
||||
case "text":
|
||||
return [buildText(node.value, deco)];
|
||||
case "emphasis":
|
||||
case "strong":
|
||||
case "delete": {
|
||||
const { type, children } = node;
|
||||
return children.reduce((acc, n) => {
|
||||
acc.push(...buildSlateNode(n, Object.assign(Object.assign({}, deco), { [type]: true }), overrides));
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
case "inlineCode": {
|
||||
const { type, value } = node;
|
||||
return [buildText(value, Object.assign(Object.assign({}, deco), { [type]: true }))];
|
||||
}
|
||||
case "break":
|
||||
return [buildBreak$1(node)];
|
||||
case "link":
|
||||
return [buildLink$1(node, deco, overrides)];
|
||||
case "image":
|
||||
return [buildImage$1(node)];
|
||||
case "linkReference":
|
||||
return [buildLinkReference$1(node, deco, overrides)];
|
||||
case "imageReference":
|
||||
return [buildImageReference$1(node)];
|
||||
case "footnote":
|
||||
return [buildFootnote$1(node, deco, overrides)];
|
||||
case "footnoteReference":
|
||||
return [buildFootnoteReference(node)];
|
||||
case "math":
|
||||
return [buildMath$1(node)];
|
||||
case "inlineMath":
|
||||
return [buildInlineMath$1(node)];
|
||||
default:
|
||||
unreachable();
|
||||
break;
|
||||
}
|
||||
return [];
|
||||
};
|
||||
const buildParagraph$1 = ({ type, children }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
};
|
||||
};
|
||||
const buildHeading$1 = ({ type, children, depth }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
depth,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
};
|
||||
};
|
||||
const buildThematicBreak$1 = ({ type }) => {
|
||||
return {
|
||||
type,
|
||||
children: [{ text: "" }],
|
||||
};
|
||||
};
|
||||
const buildBlockquote$1 = ({ type, children }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
};
|
||||
};
|
||||
const buildList$1 = ({ type, children, ordered, start, spread }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
ordered,
|
||||
start,
|
||||
spread,
|
||||
};
|
||||
};
|
||||
const buildListItem$1 = ({ type, children, checked, spread }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children:
|
||||
// https://github.com/inokawa/remark-slate-transformer/issues/42
|
||||
// https://github.com/inokawa/remark-slate-transformer/issues/129
|
||||
children.length === 0
|
||||
? [{ text: "" }]
|
||||
: convertNodes$3(children, deco, overrides),
|
||||
checked,
|
||||
spread,
|
||||
};
|
||||
};
|
||||
const buildTable$1 = ({ type, children, align }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
align,
|
||||
};
|
||||
};
|
||||
const buildTableRow$1 = ({ type, children }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
};
|
||||
};
|
||||
const buildTableCell$1 = ({ type, children }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
};
|
||||
};
|
||||
const buildHtml$1 = ({ type, value }) => {
|
||||
return {
|
||||
type,
|
||||
children: [{ text: value }],
|
||||
};
|
||||
};
|
||||
const buildCode$1 = ({ type, value, lang, meta }) => {
|
||||
return {
|
||||
type,
|
||||
lang,
|
||||
meta,
|
||||
children: [{ text: value }],
|
||||
};
|
||||
};
|
||||
const buildYaml$1 = ({ type, value }) => {
|
||||
return {
|
||||
type,
|
||||
children: [{ text: value }],
|
||||
};
|
||||
};
|
||||
const buildToml$1 = ({ type, value }) => {
|
||||
return {
|
||||
type,
|
||||
children: [{ text: value }],
|
||||
};
|
||||
};
|
||||
const buildMath$1 = ({ type, value }) => {
|
||||
return {
|
||||
type,
|
||||
children: [{ text: value }],
|
||||
};
|
||||
};
|
||||
const buildInlineMath$1 = ({ type, value }) => {
|
||||
return {
|
||||
type,
|
||||
children: [{ text: value }],
|
||||
};
|
||||
};
|
||||
const buildDefinition$1 = ({ type, identifier, label, url, title, }) => {
|
||||
return {
|
||||
type,
|
||||
identifier,
|
||||
label,
|
||||
url,
|
||||
title,
|
||||
children: [{ text: "" }],
|
||||
};
|
||||
};
|
||||
const buildFootnoteDefinition$1 = ({ type, children, identifier, label }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
identifier,
|
||||
label,
|
||||
};
|
||||
};
|
||||
const buildText = (text, deco) => {
|
||||
return Object.assign(Object.assign({}, deco), { text });
|
||||
};
|
||||
const buildBreak$1 = ({ type }) => {
|
||||
return {
|
||||
type,
|
||||
children: [{ text: "" }],
|
||||
};
|
||||
};
|
||||
const buildLink$1 = ({ type, children, url, title }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
url,
|
||||
title,
|
||||
};
|
||||
};
|
||||
const buildImage$1 = ({ type, url, title, alt }) => {
|
||||
return {
|
||||
type,
|
||||
url,
|
||||
title,
|
||||
alt,
|
||||
children: [{ text: "" }],
|
||||
};
|
||||
};
|
||||
const buildLinkReference$1 = ({ type, children, referenceType, identifier, label }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
referenceType,
|
||||
identifier,
|
||||
label,
|
||||
};
|
||||
};
|
||||
const buildImageReference$1 = ({ type, alt, referenceType, identifier, label, }) => {
|
||||
return {
|
||||
type,
|
||||
alt,
|
||||
referenceType,
|
||||
identifier,
|
||||
label,
|
||||
children: [{ text: "" }],
|
||||
};
|
||||
};
|
||||
const buildFootnote$1 = ({ type, children }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
};
|
||||
};
|
||||
const buildFootnoteReference = ({ type, identifier, label, }) => {
|
||||
return {
|
||||
type,
|
||||
identifier,
|
||||
label,
|
||||
children: [{ text: "" }],
|
||||
};
|
||||
};
|
||||
|
||||
const plugin$3 = function ({ overrides = {}, } = {}) {
|
||||
this.Compiler = function (node) {
|
||||
return mdastToSlate(node, overrides);
|
||||
};
|
||||
};
|
||||
|
||||
const slateToMdast = (node, overrides) => {
|
||||
return buildMdastRoot(node, overrides);
|
||||
};
|
||||
const buildMdastRoot = (node, overrides) => {
|
||||
return {
|
||||
type: "root",
|
||||
children: convertNodes$2(node.children, overrides),
|
||||
};
|
||||
};
|
||||
const convertNodes$2 = (nodes, overrides) => {
|
||||
const mdastNodes = [];
|
||||
let textQueue = [];
|
||||
for (let i = 0; i <= nodes.length; i++) {
|
||||
const n = nodes[i];
|
||||
if (n && isText(n)) {
|
||||
textQueue.push(n);
|
||||
}
|
||||
else {
|
||||
mdastNodes.push(...convertTexts(textQueue));
|
||||
textQueue = [];
|
||||
if (!n)
|
||||
continue;
|
||||
const node = buildMdastNode(n, overrides);
|
||||
if (node) {
|
||||
mdastNodes.push(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
return mdastNodes;
|
||||
};
|
||||
const convertTexts = (slateTexts) => {
|
||||
const mdastTexts = [];
|
||||
const starts = [];
|
||||
let ends = [];
|
||||
let textTemp = "";
|
||||
for (let j = 0; j < slateTexts.length; j++) {
|
||||
const cur = slateTexts[j];
|
||||
textTemp += cur.text;
|
||||
const prevStarts = starts.slice();
|
||||
const prevEnds = ends.slice();
|
||||
const prev = slateTexts[j - 1];
|
||||
const next = slateTexts[j + 1];
|
||||
ends = [];
|
||||
[
|
||||
"emphasis",
|
||||
"strong",
|
||||
"delete",
|
||||
// inlineCode should be last because of the spec in mdast
|
||||
// https://github.com/inokawa/remark-slate-transformer/issues/145
|
||||
"inlineCode",
|
||||
].forEach((k) => {
|
||||
if (cur[k]) {
|
||||
if (!prev || !prev[k]) {
|
||||
starts.push(k);
|
||||
}
|
||||
if (!next || !next[k]) {
|
||||
ends.push(k);
|
||||
}
|
||||
}
|
||||
});
|
||||
const endsToRemove = starts.reduce((acc, k, kIndex) => {
|
||||
if (ends.includes(k)) {
|
||||
acc.push({ key: k, index: kIndex });
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
if (starts.length > 0) {
|
||||
let bef = "";
|
||||
let aft = "";
|
||||
if (endsToRemove.length === 1 &&
|
||||
(prevStarts.toString() !== starts.toString() ||
|
||||
// https://github.com/inokawa/remark-slate-transformer/issues/90
|
||||
(prevEnds.includes("emphasis") && ends.includes("strong"))) &&
|
||||
starts.length - endsToRemove.length === 0) {
|
||||
while (textTemp.startsWith(" ")) {
|
||||
bef += " ";
|
||||
textTemp = textTemp.slice(1);
|
||||
}
|
||||
while (textTemp.endsWith(" ")) {
|
||||
aft += " ";
|
||||
textTemp = textTemp.slice(0, -1);
|
||||
}
|
||||
}
|
||||
let res = {
|
||||
type: "text",
|
||||
value: textTemp,
|
||||
};
|
||||
textTemp = "";
|
||||
const startsReversed = starts.slice().reverse();
|
||||
startsReversed.forEach((k) => {
|
||||
switch (k) {
|
||||
case "inlineCode":
|
||||
res = {
|
||||
type: k,
|
||||
value: res.value,
|
||||
};
|
||||
break;
|
||||
case "strong":
|
||||
case "emphasis":
|
||||
case "delete":
|
||||
res = {
|
||||
type: k,
|
||||
children: [res],
|
||||
};
|
||||
break;
|
||||
default:
|
||||
unreachable();
|
||||
break;
|
||||
}
|
||||
});
|
||||
const arr = [];
|
||||
if (bef.length > 0) {
|
||||
arr.push({ type: "text", value: bef });
|
||||
}
|
||||
arr.push(res);
|
||||
if (aft.length > 0) {
|
||||
arr.push({ type: "text", value: aft });
|
||||
}
|
||||
mdastTexts.push(...arr);
|
||||
}
|
||||
if (endsToRemove.length > 0) {
|
||||
endsToRemove.reverse().forEach((e) => {
|
||||
starts.splice(e.index, 1);
|
||||
});
|
||||
}
|
||||
else {
|
||||
mdastTexts.push({ type: "text", value: textTemp });
|
||||
textTemp = "";
|
||||
}
|
||||
}
|
||||
if (textTemp) {
|
||||
mdastTexts.push({ type: "text", value: textTemp });
|
||||
textTemp = "";
|
||||
}
|
||||
return mergeTexts(mdastTexts);
|
||||
};
|
||||
const buildMdastNode = (node, overrides) => {
|
||||
var _a;
|
||||
const customNode = (_a = overrides[node.type]) === null || _a === void 0 ? void 0 : _a.call(overrides, node, (children) => convertNodes$2(children, overrides));
|
||||
if (customNode != null) {
|
||||
return customNode;
|
||||
}
|
||||
switch (node.type) {
|
||||
case "paragraph":
|
||||
return buildParagraph(node, overrides);
|
||||
case "heading":
|
||||
return buildHeading(node, overrides);
|
||||
case "thematicBreak":
|
||||
return buildThematicBreak(node);
|
||||
case "blockquote":
|
||||
return buildBlockquote(node, overrides);
|
||||
case "list":
|
||||
return buildList(node, overrides);
|
||||
case "listItem":
|
||||
return buildListItem(node, overrides);
|
||||
case "table":
|
||||
return buildTable(node, overrides);
|
||||
case "tableRow":
|
||||
return buildTableRow(node, overrides);
|
||||
case "tableCell":
|
||||
return buildTableCell(node, overrides);
|
||||
case "html":
|
||||
return buildHtml(node);
|
||||
case "code":
|
||||
return buildCode(node);
|
||||
case "yaml":
|
||||
return buildYaml(node);
|
||||
case "toml":
|
||||
return buildToml(node);
|
||||
case "definition":
|
||||
return buildDefinition(node);
|
||||
case "footnoteDefinition":
|
||||
return buildFootnoteDefinition(node, overrides);
|
||||
case "break":
|
||||
return buildBreak(node);
|
||||
case "link":
|
||||
return buildLink(node, overrides);
|
||||
case "image":
|
||||
return buildImage(node);
|
||||
case "linkReference":
|
||||
return buildLinkReference(node, overrides);
|
||||
case "imageReference":
|
||||
return buildImageReference(node);
|
||||
case "footnote":
|
||||
return buildFootnote(node, overrides);
|
||||
case "footnoteReference":
|
||||
return creatFootnoteReference(node);
|
||||
case "math":
|
||||
return buildMath(node);
|
||||
case "inlineMath":
|
||||
return buildInlineMath(node);
|
||||
default:
|
||||
unreachable();
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const isText = (node) => {
|
||||
return "text" in node;
|
||||
};
|
||||
const mergeTexts = (nodes) => {
|
||||
const res = [];
|
||||
for (const cur of nodes) {
|
||||
const last = res[res.length - 1];
|
||||
if (last && last.type === cur.type) {
|
||||
if (last.type === "text") {
|
||||
last.value += cur.value;
|
||||
}
|
||||
else if (last.type === "inlineCode") {
|
||||
last.value += cur.value;
|
||||
}
|
||||
else {
|
||||
last.children = mergeTexts(last.children.concat(cur.children));
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (cur.type === "text" && cur.value === "")
|
||||
continue;
|
||||
res.push(cur);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
};
|
||||
const buildParagraph = ({ type, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildHeading = ({ type, depth, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
depth,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildThematicBreak = ({ type, }) => {
|
||||
return {
|
||||
type,
|
||||
};
|
||||
};
|
||||
const buildBlockquote = ({ type, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildList = ({ type, ordered, start, spread, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
ordered,
|
||||
start,
|
||||
spread,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildListItem = ({ type, checked, spread, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
checked,
|
||||
spread,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildTable = ({ type, align, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
align,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildTableRow = ({ type, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildTableCell = ({ type, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildHtml = ({ type, children }) => {
|
||||
return {
|
||||
type,
|
||||
value: children[0].text,
|
||||
};
|
||||
};
|
||||
const buildCode = ({ type, lang, meta, children, }) => {
|
||||
return {
|
||||
type,
|
||||
lang,
|
||||
meta,
|
||||
value: children[0].text,
|
||||
};
|
||||
};
|
||||
const buildYaml = ({ type, children }) => {
|
||||
return {
|
||||
type,
|
||||
value: children[0].text,
|
||||
};
|
||||
};
|
||||
const buildToml = ({ type, children }) => {
|
||||
return {
|
||||
type,
|
||||
value: children[0].text,
|
||||
};
|
||||
};
|
||||
const buildDefinition = ({ type, identifier, label, url, title, }) => {
|
||||
return {
|
||||
type,
|
||||
identifier,
|
||||
label,
|
||||
url,
|
||||
title,
|
||||
};
|
||||
};
|
||||
const buildFootnoteDefinition = ({ type, identifier, label, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
identifier,
|
||||
label,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildBreak = ({ type }) => {
|
||||
return {
|
||||
type,
|
||||
};
|
||||
};
|
||||
const buildLink = ({ type, url, title, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
url,
|
||||
title,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildImage = ({ type, url, title, alt, }) => {
|
||||
return {
|
||||
type,
|
||||
url,
|
||||
title,
|
||||
alt,
|
||||
};
|
||||
};
|
||||
const buildLinkReference = ({ type, identifier, label, referenceType, children, }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
identifier,
|
||||
label,
|
||||
referenceType,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildImageReference = ({ type, identifier, label, alt, referenceType, }) => {
|
||||
return {
|
||||
type,
|
||||
identifier,
|
||||
label,
|
||||
alt,
|
||||
referenceType,
|
||||
};
|
||||
};
|
||||
const buildFootnote = ({ type, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const creatFootnoteReference = ({ type, identifier, label, }) => {
|
||||
return {
|
||||
type,
|
||||
identifier,
|
||||
label,
|
||||
};
|
||||
};
|
||||
const buildMath = ({ type, children }) => {
|
||||
return {
|
||||
type,
|
||||
value: children[0].text,
|
||||
};
|
||||
};
|
||||
const buildInlineMath = ({ type, children, }) => {
|
||||
return {
|
||||
type,
|
||||
value: children[0].text,
|
||||
};
|
||||
};
|
||||
|
||||
const plugin$2 = ({ overrides = {}, } = {}) => {
|
||||
return function (node) {
|
||||
return slateToMdast(node, overrides);
|
||||
};
|
||||
};
|
||||
|
||||
const slate047ToSlate = (nodes) => {
|
||||
return convertNodes$1(nodes);
|
||||
};
|
||||
const convertNodes$1 = (nodes) => {
|
||||
return nodes.reduce((acc, n) => {
|
||||
const node = convert$1(n);
|
||||
if (node) {
|
||||
acc.push(node);
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
};
|
||||
const convert$1 = (node) => {
|
||||
switch (node.object) {
|
||||
case "block": {
|
||||
const { type, nodes, data } = node;
|
||||
return Object.assign({ type, children: convertNodes$1(nodes) }, data);
|
||||
}
|
||||
case "inline": {
|
||||
const { type, nodes, data } = node;
|
||||
return Object.assign({ type, children: convertNodes$1(nodes) }, data);
|
||||
}
|
||||
case "text": {
|
||||
const { text = "", marks } = node;
|
||||
return Object.assign({ text }, marks === null || marks === void 0 ? void 0 : marks.reduce((acc, m) => {
|
||||
acc[m.type] = true;
|
||||
return acc;
|
||||
}, {}));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
const plugin$1 = function () {
|
||||
return function (node) {
|
||||
return slateToMdast({
|
||||
type: "root",
|
||||
children: slate047ToSlate(node.children),
|
||||
}, {});
|
||||
};
|
||||
};
|
||||
|
||||
const slateToSlate047 = (nodes) => {
|
||||
return {
|
||||
object: "value",
|
||||
document: {
|
||||
object: "document",
|
||||
nodes: convertNodes(nodes),
|
||||
},
|
||||
};
|
||||
};
|
||||
const convertNodes = (nodes) => {
|
||||
return nodes.reduce((acc, n) => {
|
||||
const node = convert(n);
|
||||
if (node) {
|
||||
acc.push(node);
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
};
|
||||
const convert = (node) => {
|
||||
if ("text" in node) {
|
||||
const { text } = node, rest = tslib.__rest(node, ["text"]);
|
||||
const marks = Object.keys(rest).reduce((acc, type) => {
|
||||
if (!rest[type])
|
||||
return acc;
|
||||
acc.push({
|
||||
object: "mark",
|
||||
type,
|
||||
});
|
||||
return acc;
|
||||
}, []);
|
||||
const res = {
|
||||
object: "text",
|
||||
text,
|
||||
marks,
|
||||
};
|
||||
return res;
|
||||
}
|
||||
switch (node.type) {
|
||||
case "paragraph":
|
||||
case "heading":
|
||||
case "blockquote":
|
||||
case "list":
|
||||
case "listItem":
|
||||
case "table":
|
||||
case "tableRow":
|
||||
case "tableCell":
|
||||
case "html":
|
||||
case "code":
|
||||
case "yaml":
|
||||
case "toml":
|
||||
case "thematicBreak":
|
||||
case "definition":
|
||||
case "break":
|
||||
case "math": {
|
||||
const { type, children } = node, rest = tslib.__rest(node, ["type", "children"]);
|
||||
const res = {
|
||||
object: "block",
|
||||
type,
|
||||
nodes: convertNodes(children),
|
||||
data: Object.assign({}, rest),
|
||||
};
|
||||
return res;
|
||||
}
|
||||
case "footnoteDefinition":
|
||||
case "link":
|
||||
case "linkReference":
|
||||
case "image":
|
||||
case "imageReference":
|
||||
case "footnote":
|
||||
case "footnoteReference":
|
||||
case "inlineMath": {
|
||||
const { type, children } = node, rest = tslib.__rest(node, ["type", "children"]);
|
||||
const res = {
|
||||
object: "inline",
|
||||
type,
|
||||
nodes: convertNodes(children),
|
||||
data: Object.assign({}, rest),
|
||||
};
|
||||
return res;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
const plugin = function () {
|
||||
this.Compiler = function (node) {
|
||||
return slateToSlate047(mdastToSlate(node, {}));
|
||||
};
|
||||
};
|
||||
|
||||
exports.mdastToSlate = mdastToSlate;
|
||||
exports.remarkToSlate = plugin$3;
|
||||
exports.remarkToSlateLegacy = plugin;
|
||||
exports.slateToMdast = slateToMdast;
|
||||
exports.slateToRemark = plugin$2;
|
||||
exports.slateToRemarkLegacy = plugin$1;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/remark-slate-transformer/lib/index.js.map
generated
vendored
Normal file
1
node_modules/remark-slate-transformer/lib/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
813
node_modules/remark-slate-transformer/lib/index.mjs
generated
vendored
Normal file
813
node_modules/remark-slate-transformer/lib/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,813 @@
|
||||
import { __rest } from 'tslib';
|
||||
|
||||
const unreachable = (_) => {
|
||||
throw new Error("unreachable");
|
||||
};
|
||||
|
||||
const mdastToSlate = (node, overrides) => {
|
||||
return buildSlateRoot(node, overrides);
|
||||
};
|
||||
const buildSlateRoot = (root, overrides) => {
|
||||
return convertNodes$3(root.children, {}, overrides);
|
||||
};
|
||||
const convertNodes$3 = (nodes, deco, overrides) => {
|
||||
return nodes.reduce((acc, node) => {
|
||||
acc.push(...buildSlateNode(node, deco, overrides));
|
||||
return acc;
|
||||
}, []);
|
||||
};
|
||||
const buildSlateNode = (node, deco, overrides) => {
|
||||
var _a;
|
||||
const customNode = (_a = overrides[node.type]) === null || _a === void 0 ? void 0 : _a.call(overrides, node, (children) => convertNodes$3(children, deco, overrides));
|
||||
if (customNode != null) {
|
||||
return [customNode];
|
||||
}
|
||||
switch (node.type) {
|
||||
case "paragraph":
|
||||
return [buildParagraph$1(node, deco, overrides)];
|
||||
case "heading":
|
||||
return [buildHeading$1(node, deco, overrides)];
|
||||
case "thematicBreak":
|
||||
return [buildThematicBreak$1(node)];
|
||||
case "blockquote":
|
||||
return [buildBlockquote$1(node, deco, overrides)];
|
||||
case "list":
|
||||
return [buildList$1(node, deco, overrides)];
|
||||
case "listItem":
|
||||
return [buildListItem$1(node, deco, overrides)];
|
||||
case "table":
|
||||
return [buildTable$1(node, deco, overrides)];
|
||||
case "tableRow":
|
||||
return [buildTableRow$1(node, deco, overrides)];
|
||||
case "tableCell":
|
||||
return [buildTableCell$1(node, deco, overrides)];
|
||||
case "html":
|
||||
return [buildHtml$1(node)];
|
||||
case "code":
|
||||
return [buildCode$1(node)];
|
||||
case "yaml":
|
||||
return [buildYaml$1(node)];
|
||||
case "toml":
|
||||
return [buildToml$1(node)];
|
||||
case "definition":
|
||||
return [buildDefinition$1(node)];
|
||||
case "footnoteDefinition":
|
||||
return [buildFootnoteDefinition$1(node, deco, overrides)];
|
||||
case "text":
|
||||
return [buildText(node.value, deco)];
|
||||
case "emphasis":
|
||||
case "strong":
|
||||
case "delete": {
|
||||
const { type, children } = node;
|
||||
return children.reduce((acc, n) => {
|
||||
acc.push(...buildSlateNode(n, Object.assign(Object.assign({}, deco), { [type]: true }), overrides));
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
case "inlineCode": {
|
||||
const { type, value } = node;
|
||||
return [buildText(value, Object.assign(Object.assign({}, deco), { [type]: true }))];
|
||||
}
|
||||
case "break":
|
||||
return [buildBreak$1(node)];
|
||||
case "link":
|
||||
return [buildLink$1(node, deco, overrides)];
|
||||
case "image":
|
||||
return [buildImage$1(node)];
|
||||
case "linkReference":
|
||||
return [buildLinkReference$1(node, deco, overrides)];
|
||||
case "imageReference":
|
||||
return [buildImageReference$1(node)];
|
||||
case "footnote":
|
||||
return [buildFootnote$1(node, deco, overrides)];
|
||||
case "footnoteReference":
|
||||
return [buildFootnoteReference(node)];
|
||||
case "math":
|
||||
return [buildMath$1(node)];
|
||||
case "inlineMath":
|
||||
return [buildInlineMath$1(node)];
|
||||
default:
|
||||
unreachable();
|
||||
break;
|
||||
}
|
||||
return [];
|
||||
};
|
||||
const buildParagraph$1 = ({ type, children }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
};
|
||||
};
|
||||
const buildHeading$1 = ({ type, children, depth }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
depth,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
};
|
||||
};
|
||||
const buildThematicBreak$1 = ({ type }) => {
|
||||
return {
|
||||
type,
|
||||
children: [{ text: "" }],
|
||||
};
|
||||
};
|
||||
const buildBlockquote$1 = ({ type, children }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
};
|
||||
};
|
||||
const buildList$1 = ({ type, children, ordered, start, spread }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
ordered,
|
||||
start,
|
||||
spread,
|
||||
};
|
||||
};
|
||||
const buildListItem$1 = ({ type, children, checked, spread }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children:
|
||||
// https://github.com/inokawa/remark-slate-transformer/issues/42
|
||||
// https://github.com/inokawa/remark-slate-transformer/issues/129
|
||||
children.length === 0
|
||||
? [{ text: "" }]
|
||||
: convertNodes$3(children, deco, overrides),
|
||||
checked,
|
||||
spread,
|
||||
};
|
||||
};
|
||||
const buildTable$1 = ({ type, children, align }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
align,
|
||||
};
|
||||
};
|
||||
const buildTableRow$1 = ({ type, children }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
};
|
||||
};
|
||||
const buildTableCell$1 = ({ type, children }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
};
|
||||
};
|
||||
const buildHtml$1 = ({ type, value }) => {
|
||||
return {
|
||||
type,
|
||||
children: [{ text: value }],
|
||||
};
|
||||
};
|
||||
const buildCode$1 = ({ type, value, lang, meta }) => {
|
||||
return {
|
||||
type,
|
||||
lang,
|
||||
meta,
|
||||
children: [{ text: value }],
|
||||
};
|
||||
};
|
||||
const buildYaml$1 = ({ type, value }) => {
|
||||
return {
|
||||
type,
|
||||
children: [{ text: value }],
|
||||
};
|
||||
};
|
||||
const buildToml$1 = ({ type, value }) => {
|
||||
return {
|
||||
type,
|
||||
children: [{ text: value }],
|
||||
};
|
||||
};
|
||||
const buildMath$1 = ({ type, value }) => {
|
||||
return {
|
||||
type,
|
||||
children: [{ text: value }],
|
||||
};
|
||||
};
|
||||
const buildInlineMath$1 = ({ type, value }) => {
|
||||
return {
|
||||
type,
|
||||
children: [{ text: value }],
|
||||
};
|
||||
};
|
||||
const buildDefinition$1 = ({ type, identifier, label, url, title, }) => {
|
||||
return {
|
||||
type,
|
||||
identifier,
|
||||
label,
|
||||
url,
|
||||
title,
|
||||
children: [{ text: "" }],
|
||||
};
|
||||
};
|
||||
const buildFootnoteDefinition$1 = ({ type, children, identifier, label }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
identifier,
|
||||
label,
|
||||
};
|
||||
};
|
||||
const buildText = (text, deco) => {
|
||||
return Object.assign(Object.assign({}, deco), { text });
|
||||
};
|
||||
const buildBreak$1 = ({ type }) => {
|
||||
return {
|
||||
type,
|
||||
children: [{ text: "" }],
|
||||
};
|
||||
};
|
||||
const buildLink$1 = ({ type, children, url, title }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
url,
|
||||
title,
|
||||
};
|
||||
};
|
||||
const buildImage$1 = ({ type, url, title, alt }) => {
|
||||
return {
|
||||
type,
|
||||
url,
|
||||
title,
|
||||
alt,
|
||||
children: [{ text: "" }],
|
||||
};
|
||||
};
|
||||
const buildLinkReference$1 = ({ type, children, referenceType, identifier, label }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
referenceType,
|
||||
identifier,
|
||||
label,
|
||||
};
|
||||
};
|
||||
const buildImageReference$1 = ({ type, alt, referenceType, identifier, label, }) => {
|
||||
return {
|
||||
type,
|
||||
alt,
|
||||
referenceType,
|
||||
identifier,
|
||||
label,
|
||||
children: [{ text: "" }],
|
||||
};
|
||||
};
|
||||
const buildFootnote$1 = ({ type, children }, deco, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$3(children, deco, overrides),
|
||||
};
|
||||
};
|
||||
const buildFootnoteReference = ({ type, identifier, label, }) => {
|
||||
return {
|
||||
type,
|
||||
identifier,
|
||||
label,
|
||||
children: [{ text: "" }],
|
||||
};
|
||||
};
|
||||
|
||||
const plugin$3 = function ({ overrides = {}, } = {}) {
|
||||
this.Compiler = function (node) {
|
||||
return mdastToSlate(node, overrides);
|
||||
};
|
||||
};
|
||||
|
||||
const slateToMdast = (node, overrides) => {
|
||||
return buildMdastRoot(node, overrides);
|
||||
};
|
||||
const buildMdastRoot = (node, overrides) => {
|
||||
return {
|
||||
type: "root",
|
||||
children: convertNodes$2(node.children, overrides),
|
||||
};
|
||||
};
|
||||
const convertNodes$2 = (nodes, overrides) => {
|
||||
const mdastNodes = [];
|
||||
let textQueue = [];
|
||||
for (let i = 0; i <= nodes.length; i++) {
|
||||
const n = nodes[i];
|
||||
if (n && isText(n)) {
|
||||
textQueue.push(n);
|
||||
}
|
||||
else {
|
||||
mdastNodes.push(...convertTexts(textQueue));
|
||||
textQueue = [];
|
||||
if (!n)
|
||||
continue;
|
||||
const node = buildMdastNode(n, overrides);
|
||||
if (node) {
|
||||
mdastNodes.push(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
return mdastNodes;
|
||||
};
|
||||
const convertTexts = (slateTexts) => {
|
||||
const mdastTexts = [];
|
||||
const starts = [];
|
||||
let ends = [];
|
||||
let textTemp = "";
|
||||
for (let j = 0; j < slateTexts.length; j++) {
|
||||
const cur = slateTexts[j];
|
||||
textTemp += cur.text;
|
||||
const prevStarts = starts.slice();
|
||||
const prevEnds = ends.slice();
|
||||
const prev = slateTexts[j - 1];
|
||||
const next = slateTexts[j + 1];
|
||||
ends = [];
|
||||
[
|
||||
"emphasis",
|
||||
"strong",
|
||||
"delete",
|
||||
// inlineCode should be last because of the spec in mdast
|
||||
// https://github.com/inokawa/remark-slate-transformer/issues/145
|
||||
"inlineCode",
|
||||
].forEach((k) => {
|
||||
if (cur[k]) {
|
||||
if (!prev || !prev[k]) {
|
||||
starts.push(k);
|
||||
}
|
||||
if (!next || !next[k]) {
|
||||
ends.push(k);
|
||||
}
|
||||
}
|
||||
});
|
||||
const endsToRemove = starts.reduce((acc, k, kIndex) => {
|
||||
if (ends.includes(k)) {
|
||||
acc.push({ key: k, index: kIndex });
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
if (starts.length > 0) {
|
||||
let bef = "";
|
||||
let aft = "";
|
||||
if (endsToRemove.length === 1 &&
|
||||
(prevStarts.toString() !== starts.toString() ||
|
||||
// https://github.com/inokawa/remark-slate-transformer/issues/90
|
||||
(prevEnds.includes("emphasis") && ends.includes("strong"))) &&
|
||||
starts.length - endsToRemove.length === 0) {
|
||||
while (textTemp.startsWith(" ")) {
|
||||
bef += " ";
|
||||
textTemp = textTemp.slice(1);
|
||||
}
|
||||
while (textTemp.endsWith(" ")) {
|
||||
aft += " ";
|
||||
textTemp = textTemp.slice(0, -1);
|
||||
}
|
||||
}
|
||||
let res = {
|
||||
type: "text",
|
||||
value: textTemp,
|
||||
};
|
||||
textTemp = "";
|
||||
const startsReversed = starts.slice().reverse();
|
||||
startsReversed.forEach((k) => {
|
||||
switch (k) {
|
||||
case "inlineCode":
|
||||
res = {
|
||||
type: k,
|
||||
value: res.value,
|
||||
};
|
||||
break;
|
||||
case "strong":
|
||||
case "emphasis":
|
||||
case "delete":
|
||||
res = {
|
||||
type: k,
|
||||
children: [res],
|
||||
};
|
||||
break;
|
||||
default:
|
||||
unreachable();
|
||||
break;
|
||||
}
|
||||
});
|
||||
const arr = [];
|
||||
if (bef.length > 0) {
|
||||
arr.push({ type: "text", value: bef });
|
||||
}
|
||||
arr.push(res);
|
||||
if (aft.length > 0) {
|
||||
arr.push({ type: "text", value: aft });
|
||||
}
|
||||
mdastTexts.push(...arr);
|
||||
}
|
||||
if (endsToRemove.length > 0) {
|
||||
endsToRemove.reverse().forEach((e) => {
|
||||
starts.splice(e.index, 1);
|
||||
});
|
||||
}
|
||||
else {
|
||||
mdastTexts.push({ type: "text", value: textTemp });
|
||||
textTemp = "";
|
||||
}
|
||||
}
|
||||
if (textTemp) {
|
||||
mdastTexts.push({ type: "text", value: textTemp });
|
||||
textTemp = "";
|
||||
}
|
||||
return mergeTexts(mdastTexts);
|
||||
};
|
||||
const buildMdastNode = (node, overrides) => {
|
||||
var _a;
|
||||
const customNode = (_a = overrides[node.type]) === null || _a === void 0 ? void 0 : _a.call(overrides, node, (children) => convertNodes$2(children, overrides));
|
||||
if (customNode != null) {
|
||||
return customNode;
|
||||
}
|
||||
switch (node.type) {
|
||||
case "paragraph":
|
||||
return buildParagraph(node, overrides);
|
||||
case "heading":
|
||||
return buildHeading(node, overrides);
|
||||
case "thematicBreak":
|
||||
return buildThematicBreak(node);
|
||||
case "blockquote":
|
||||
return buildBlockquote(node, overrides);
|
||||
case "list":
|
||||
return buildList(node, overrides);
|
||||
case "listItem":
|
||||
return buildListItem(node, overrides);
|
||||
case "table":
|
||||
return buildTable(node, overrides);
|
||||
case "tableRow":
|
||||
return buildTableRow(node, overrides);
|
||||
case "tableCell":
|
||||
return buildTableCell(node, overrides);
|
||||
case "html":
|
||||
return buildHtml(node);
|
||||
case "code":
|
||||
return buildCode(node);
|
||||
case "yaml":
|
||||
return buildYaml(node);
|
||||
case "toml":
|
||||
return buildToml(node);
|
||||
case "definition":
|
||||
return buildDefinition(node);
|
||||
case "footnoteDefinition":
|
||||
return buildFootnoteDefinition(node, overrides);
|
||||
case "break":
|
||||
return buildBreak(node);
|
||||
case "link":
|
||||
return buildLink(node, overrides);
|
||||
case "image":
|
||||
return buildImage(node);
|
||||
case "linkReference":
|
||||
return buildLinkReference(node, overrides);
|
||||
case "imageReference":
|
||||
return buildImageReference(node);
|
||||
case "footnote":
|
||||
return buildFootnote(node, overrides);
|
||||
case "footnoteReference":
|
||||
return creatFootnoteReference(node);
|
||||
case "math":
|
||||
return buildMath(node);
|
||||
case "inlineMath":
|
||||
return buildInlineMath(node);
|
||||
default:
|
||||
unreachable();
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const isText = (node) => {
|
||||
return "text" in node;
|
||||
};
|
||||
const mergeTexts = (nodes) => {
|
||||
const res = [];
|
||||
for (const cur of nodes) {
|
||||
const last = res[res.length - 1];
|
||||
if (last && last.type === cur.type) {
|
||||
if (last.type === "text") {
|
||||
last.value += cur.value;
|
||||
}
|
||||
else if (last.type === "inlineCode") {
|
||||
last.value += cur.value;
|
||||
}
|
||||
else {
|
||||
last.children = mergeTexts(last.children.concat(cur.children));
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (cur.type === "text" && cur.value === "")
|
||||
continue;
|
||||
res.push(cur);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
};
|
||||
const buildParagraph = ({ type, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildHeading = ({ type, depth, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
depth,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildThematicBreak = ({ type, }) => {
|
||||
return {
|
||||
type,
|
||||
};
|
||||
};
|
||||
const buildBlockquote = ({ type, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildList = ({ type, ordered, start, spread, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
ordered,
|
||||
start,
|
||||
spread,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildListItem = ({ type, checked, spread, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
checked,
|
||||
spread,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildTable = ({ type, align, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
align,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildTableRow = ({ type, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildTableCell = ({ type, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildHtml = ({ type, children }) => {
|
||||
return {
|
||||
type,
|
||||
value: children[0].text,
|
||||
};
|
||||
};
|
||||
const buildCode = ({ type, lang, meta, children, }) => {
|
||||
return {
|
||||
type,
|
||||
lang,
|
||||
meta,
|
||||
value: children[0].text,
|
||||
};
|
||||
};
|
||||
const buildYaml = ({ type, children }) => {
|
||||
return {
|
||||
type,
|
||||
value: children[0].text,
|
||||
};
|
||||
};
|
||||
const buildToml = ({ type, children }) => {
|
||||
return {
|
||||
type,
|
||||
value: children[0].text,
|
||||
};
|
||||
};
|
||||
const buildDefinition = ({ type, identifier, label, url, title, }) => {
|
||||
return {
|
||||
type,
|
||||
identifier,
|
||||
label,
|
||||
url,
|
||||
title,
|
||||
};
|
||||
};
|
||||
const buildFootnoteDefinition = ({ type, identifier, label, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
identifier,
|
||||
label,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildBreak = ({ type }) => {
|
||||
return {
|
||||
type,
|
||||
};
|
||||
};
|
||||
const buildLink = ({ type, url, title, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
url,
|
||||
title,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildImage = ({ type, url, title, alt, }) => {
|
||||
return {
|
||||
type,
|
||||
url,
|
||||
title,
|
||||
alt,
|
||||
};
|
||||
};
|
||||
const buildLinkReference = ({ type, identifier, label, referenceType, children, }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
identifier,
|
||||
label,
|
||||
referenceType,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const buildImageReference = ({ type, identifier, label, alt, referenceType, }) => {
|
||||
return {
|
||||
type,
|
||||
identifier,
|
||||
label,
|
||||
alt,
|
||||
referenceType,
|
||||
};
|
||||
};
|
||||
const buildFootnote = ({ type, children }, overrides) => {
|
||||
return {
|
||||
type,
|
||||
children: convertNodes$2(children, overrides),
|
||||
};
|
||||
};
|
||||
const creatFootnoteReference = ({ type, identifier, label, }) => {
|
||||
return {
|
||||
type,
|
||||
identifier,
|
||||
label,
|
||||
};
|
||||
};
|
||||
const buildMath = ({ type, children }) => {
|
||||
return {
|
||||
type,
|
||||
value: children[0].text,
|
||||
};
|
||||
};
|
||||
const buildInlineMath = ({ type, children, }) => {
|
||||
return {
|
||||
type,
|
||||
value: children[0].text,
|
||||
};
|
||||
};
|
||||
|
||||
const plugin$2 = ({ overrides = {}, } = {}) => {
|
||||
return function (node) {
|
||||
return slateToMdast(node, overrides);
|
||||
};
|
||||
};
|
||||
|
||||
const slate047ToSlate = (nodes) => {
|
||||
return convertNodes$1(nodes);
|
||||
};
|
||||
const convertNodes$1 = (nodes) => {
|
||||
return nodes.reduce((acc, n) => {
|
||||
const node = convert$1(n);
|
||||
if (node) {
|
||||
acc.push(node);
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
};
|
||||
const convert$1 = (node) => {
|
||||
switch (node.object) {
|
||||
case "block": {
|
||||
const { type, nodes, data } = node;
|
||||
return Object.assign({ type, children: convertNodes$1(nodes) }, data);
|
||||
}
|
||||
case "inline": {
|
||||
const { type, nodes, data } = node;
|
||||
return Object.assign({ type, children: convertNodes$1(nodes) }, data);
|
||||
}
|
||||
case "text": {
|
||||
const { text = "", marks } = node;
|
||||
return Object.assign({ text }, marks === null || marks === void 0 ? void 0 : marks.reduce((acc, m) => {
|
||||
acc[m.type] = true;
|
||||
return acc;
|
||||
}, {}));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
const plugin$1 = function () {
|
||||
return function (node) {
|
||||
return slateToMdast({
|
||||
type: "root",
|
||||
children: slate047ToSlate(node.children),
|
||||
}, {});
|
||||
};
|
||||
};
|
||||
|
||||
const slateToSlate047 = (nodes) => {
|
||||
return {
|
||||
object: "value",
|
||||
document: {
|
||||
object: "document",
|
||||
nodes: convertNodes(nodes),
|
||||
},
|
||||
};
|
||||
};
|
||||
const convertNodes = (nodes) => {
|
||||
return nodes.reduce((acc, n) => {
|
||||
const node = convert(n);
|
||||
if (node) {
|
||||
acc.push(node);
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
};
|
||||
const convert = (node) => {
|
||||
if ("text" in node) {
|
||||
const { text } = node, rest = __rest(node, ["text"]);
|
||||
const marks = Object.keys(rest).reduce((acc, type) => {
|
||||
if (!rest[type])
|
||||
return acc;
|
||||
acc.push({
|
||||
object: "mark",
|
||||
type,
|
||||
});
|
||||
return acc;
|
||||
}, []);
|
||||
const res = {
|
||||
object: "text",
|
||||
text,
|
||||
marks,
|
||||
};
|
||||
return res;
|
||||
}
|
||||
switch (node.type) {
|
||||
case "paragraph":
|
||||
case "heading":
|
||||
case "blockquote":
|
||||
case "list":
|
||||
case "listItem":
|
||||
case "table":
|
||||
case "tableRow":
|
||||
case "tableCell":
|
||||
case "html":
|
||||
case "code":
|
||||
case "yaml":
|
||||
case "toml":
|
||||
case "thematicBreak":
|
||||
case "definition":
|
||||
case "break":
|
||||
case "math": {
|
||||
const { type, children } = node, rest = __rest(node, ["type", "children"]);
|
||||
const res = {
|
||||
object: "block",
|
||||
type,
|
||||
nodes: convertNodes(children),
|
||||
data: Object.assign({}, rest),
|
||||
};
|
||||
return res;
|
||||
}
|
||||
case "footnoteDefinition":
|
||||
case "link":
|
||||
case "linkReference":
|
||||
case "image":
|
||||
case "imageReference":
|
||||
case "footnote":
|
||||
case "footnoteReference":
|
||||
case "inlineMath": {
|
||||
const { type, children } = node, rest = __rest(node, ["type", "children"]);
|
||||
const res = {
|
||||
object: "inline",
|
||||
type,
|
||||
nodes: convertNodes(children),
|
||||
data: Object.assign({}, rest),
|
||||
};
|
||||
return res;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
const plugin = function () {
|
||||
this.Compiler = function (node) {
|
||||
return slateToSlate047(mdastToSlate(node, {}));
|
||||
};
|
||||
};
|
||||
|
||||
export { mdastToSlate, plugin$3 as remarkToSlate, plugin as remarkToSlateLegacy, slateToMdast, plugin$2 as slateToRemark, plugin$1 as slateToRemarkLegacy };
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
node_modules/remark-slate-transformer/lib/index.mjs.map
generated
vendored
Normal file
1
node_modules/remark-slate-transformer/lib/index.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
11
node_modules/remark-slate-transformer/lib/models/mdast.d.ts
generated
vendored
Normal file
11
node_modules/remark-slate-transformer/lib/models/mdast.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { Literal } from "mdast";
|
||||
export * from "mdast";
|
||||
export * from "mdast-util-math/complex-types";
|
||||
export interface TOML extends Literal {
|
||||
type: "toml";
|
||||
}
|
||||
declare module "mdast" {
|
||||
interface FrontmatterContentMap {
|
||||
toml: TOML;
|
||||
}
|
||||
}
|
||||
7
node_modules/remark-slate-transformer/lib/models/slate.d.ts
generated
vendored
Normal file
7
node_modules/remark-slate-transformer/lib/models/slate.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type * as slate from "slate";
|
||||
export type Node = Editor | Element | Text;
|
||||
export type Editor = slate.Editor;
|
||||
export type Element = slate.Element & {
|
||||
type: string;
|
||||
};
|
||||
export type Text = slate.Text;
|
||||
9
node_modules/remark-slate-transformer/lib/plugins/remark-to-slate.d.ts
generated
vendored
Normal file
9
node_modules/remark-slate-transformer/lib/plugins/remark-to-slate.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { Plugin } from "unified";
|
||||
import type * as mdast from "../models/mdast";
|
||||
import type * as slate from "../models/slate";
|
||||
import { OverridedMdastBuilders } from "../transformers/mdast-to-slate";
|
||||
export type Options = {
|
||||
overrides?: OverridedMdastBuilders;
|
||||
};
|
||||
declare const plugin: Plugin<[Options?], mdast.Root, slate.Node[]>;
|
||||
export default plugin;
|
||||
3
node_modules/remark-slate-transformer/lib/plugins/remark-to-slate0.47.d.ts
generated
vendored
Normal file
3
node_modules/remark-slate-transformer/lib/plugins/remark-to-slate0.47.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { Plugin } from "unified";
|
||||
declare const plugin: Plugin<[]>;
|
||||
export default plugin;
|
||||
9
node_modules/remark-slate-transformer/lib/plugins/slate-to-remark.d.ts
generated
vendored
Normal file
9
node_modules/remark-slate-transformer/lib/plugins/slate-to-remark.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { Plugin } from "unified";
|
||||
import type * as mdast from "../models/mdast";
|
||||
import type * as slate from "../models/slate";
|
||||
import { OverridedSlateBuilders } from "../transformers/slate-to-mdast";
|
||||
export type Options = {
|
||||
overrides?: OverridedSlateBuilders;
|
||||
};
|
||||
declare const plugin: Plugin<[Options?], slate.Node, mdast.Root>;
|
||||
export default plugin;
|
||||
3
node_modules/remark-slate-transformer/lib/plugins/slate0.47-to-remark.d.ts
generated
vendored
Normal file
3
node_modules/remark-slate-transformer/lib/plugins/slate0.47-to-remark.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { Plugin } from "unified";
|
||||
declare const plugin: Plugin<[]>;
|
||||
export default plugin;
|
||||
197
node_modules/remark-slate-transformer/lib/transformers/mdast-to-slate/index.d.ts
generated
vendored
Normal file
197
node_modules/remark-slate-transformer/lib/transformers/mdast-to-slate/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,197 @@
|
||||
import type * as slate from "../../models/slate";
|
||||
import type * as mdast from "../../models/mdast";
|
||||
export type Decoration = Readonly<{
|
||||
[key in (mdast.Emphasis | mdast.Strong | mdast.Delete | mdast.InlineCode)["type"]]?: true;
|
||||
}>;
|
||||
export type OverridedMdastBuilders = {
|
||||
[key in mdast.Content["type"]]?: MdastBuilder<key>;
|
||||
} & ({
|
||||
[key: string]: MdastBuilder<typeof key>;
|
||||
} | {});
|
||||
export type MdastBuilder<T extends string> = (node: T extends mdast.Content["type"] ? Extract<mdast.Content, {
|
||||
type: T;
|
||||
}> : unknown, next: (children: any[]) => any) => object | undefined;
|
||||
export declare const mdastToSlate: (node: mdast.Root, overrides: OverridedMdastBuilders) => slate.Node[];
|
||||
export type Paragraph = ReturnType<typeof buildParagraph>;
|
||||
declare const buildParagraph: ({ type, children }: mdast.Paragraph, deco: Decoration, overrides: OverridedMdastBuilders) => {
|
||||
type: "paragraph";
|
||||
children: slate.Node[];
|
||||
};
|
||||
export type Heading = ReturnType<typeof buildHeading>;
|
||||
declare const buildHeading: ({ type, children, depth }: mdast.Heading, deco: Decoration, overrides: OverridedMdastBuilders) => {
|
||||
type: "heading";
|
||||
depth: 3 | 1 | 2 | 4 | 5 | 6;
|
||||
children: slate.Node[];
|
||||
};
|
||||
export type ThematicBreak = ReturnType<typeof buildThematicBreak>;
|
||||
declare const buildThematicBreak: ({ type }: mdast.ThematicBreak) => {
|
||||
type: "thematicBreak";
|
||||
children: {
|
||||
text: string;
|
||||
}[];
|
||||
};
|
||||
export type Blockquote = ReturnType<typeof buildBlockquote>;
|
||||
declare const buildBlockquote: ({ type, children }: mdast.Blockquote, deco: Decoration, overrides: OverridedMdastBuilders) => {
|
||||
type: "blockquote";
|
||||
children: slate.Node[];
|
||||
};
|
||||
export type List = ReturnType<typeof buildList>;
|
||||
declare const buildList: ({ type, children, ordered, start, spread }: mdast.List, deco: Decoration, overrides: OverridedMdastBuilders) => {
|
||||
type: "list";
|
||||
children: slate.Node[];
|
||||
ordered: boolean | null | undefined;
|
||||
start: number | null | undefined;
|
||||
spread: boolean | null | undefined;
|
||||
};
|
||||
export type ListItem = ReturnType<typeof buildListItem>;
|
||||
declare const buildListItem: ({ type, children, checked, spread }: mdast.ListItem, deco: Decoration, overrides: OverridedMdastBuilders) => {
|
||||
type: "listItem";
|
||||
children: slate.Node[];
|
||||
checked: boolean | null | undefined;
|
||||
spread: boolean | null | undefined;
|
||||
};
|
||||
export type Table = ReturnType<typeof buildTable>;
|
||||
declare const buildTable: ({ type, children, align }: mdast.Table, deco: Decoration, overrides: OverridedMdastBuilders) => {
|
||||
type: "table";
|
||||
children: slate.Node[];
|
||||
align: mdast.AlignType[] | null | undefined;
|
||||
};
|
||||
export type TableRow = ReturnType<typeof buildTableRow>;
|
||||
declare const buildTableRow: ({ type, children }: mdast.TableRow, deco: Decoration, overrides: OverridedMdastBuilders) => {
|
||||
type: "tableRow";
|
||||
children: slate.Node[];
|
||||
};
|
||||
export type TableCell = ReturnType<typeof buildTableCell>;
|
||||
declare const buildTableCell: ({ type, children }: mdast.TableCell, deco: Decoration, overrides: OverridedMdastBuilders) => {
|
||||
type: "tableCell";
|
||||
children: slate.Node[];
|
||||
};
|
||||
export type Html = ReturnType<typeof buildHtml>;
|
||||
declare const buildHtml: ({ type, value }: mdast.HTML) => {
|
||||
type: "html";
|
||||
children: {
|
||||
text: string;
|
||||
}[];
|
||||
};
|
||||
export type Code = ReturnType<typeof buildCode>;
|
||||
declare const buildCode: ({ type, value, lang, meta }: mdast.Code) => {
|
||||
type: "code";
|
||||
lang: string | null | undefined;
|
||||
meta: string | null | undefined;
|
||||
children: {
|
||||
text: string;
|
||||
}[];
|
||||
};
|
||||
export type Yaml = ReturnType<typeof buildYaml>;
|
||||
declare const buildYaml: ({ type, value }: mdast.YAML) => {
|
||||
type: "yaml";
|
||||
children: {
|
||||
text: string;
|
||||
}[];
|
||||
};
|
||||
export type Toml = ReturnType<typeof buildToml>;
|
||||
declare const buildToml: ({ type, value }: mdast.TOML) => {
|
||||
type: "toml";
|
||||
children: {
|
||||
text: string;
|
||||
}[];
|
||||
};
|
||||
export type Math = ReturnType<typeof buildMath>;
|
||||
declare const buildMath: ({ type, value }: mdast.Math) => {
|
||||
type: "math";
|
||||
children: {
|
||||
text: string;
|
||||
}[];
|
||||
};
|
||||
export type InlineMath = ReturnType<typeof buildInlineMath>;
|
||||
declare const buildInlineMath: ({ type, value }: mdast.InlineMath) => {
|
||||
type: "inlineMath";
|
||||
children: {
|
||||
text: string;
|
||||
}[];
|
||||
};
|
||||
export type Definition = ReturnType<typeof buildDefinition>;
|
||||
declare const buildDefinition: ({ type, identifier, label, url, title, }: mdast.Definition) => {
|
||||
type: "definition";
|
||||
identifier: string;
|
||||
label: string | null | undefined;
|
||||
url: string;
|
||||
title: string | null | undefined;
|
||||
children: {
|
||||
text: string;
|
||||
}[];
|
||||
};
|
||||
export type FootnoteDefinition = ReturnType<typeof buildFootnoteDefinition>;
|
||||
declare const buildFootnoteDefinition: ({ type, children, identifier, label }: mdast.FootnoteDefinition, deco: Decoration, overrides: OverridedMdastBuilders) => {
|
||||
type: "footnoteDefinition";
|
||||
children: slate.Node[];
|
||||
identifier: string;
|
||||
label: string | null | undefined;
|
||||
};
|
||||
export type Text = ReturnType<typeof buildText>;
|
||||
declare const buildText: (text: string, deco: Decoration) => {
|
||||
text: string;
|
||||
emphasis?: true;
|
||||
strong?: true;
|
||||
delete?: true;
|
||||
inlineCode?: true;
|
||||
};
|
||||
export type Break = ReturnType<typeof buildBreak>;
|
||||
declare const buildBreak: ({ type }: mdast.Break) => {
|
||||
type: "break";
|
||||
children: {
|
||||
text: string;
|
||||
}[];
|
||||
};
|
||||
export type Link = ReturnType<typeof buildLink>;
|
||||
declare const buildLink: ({ type, children, url, title }: mdast.Link, deco: Decoration, overrides: OverridedMdastBuilders) => {
|
||||
type: "link";
|
||||
children: slate.Node[];
|
||||
url: string;
|
||||
title: string | null | undefined;
|
||||
};
|
||||
export type Image = ReturnType<typeof buildImage>;
|
||||
declare const buildImage: ({ type, url, title, alt }: mdast.Image) => {
|
||||
type: "image";
|
||||
url: string;
|
||||
title: string | null | undefined;
|
||||
alt: string | null | undefined;
|
||||
children: {
|
||||
text: string;
|
||||
}[];
|
||||
};
|
||||
export type LinkReference = ReturnType<typeof buildLinkReference>;
|
||||
declare const buildLinkReference: ({ type, children, referenceType, identifier, label }: mdast.LinkReference, deco: Decoration, overrides: OverridedMdastBuilders) => {
|
||||
type: "linkReference";
|
||||
children: slate.Node[];
|
||||
referenceType: mdast.ReferenceType;
|
||||
identifier: string;
|
||||
label: string | null | undefined;
|
||||
};
|
||||
export type ImageReference = ReturnType<typeof buildImageReference>;
|
||||
declare const buildImageReference: ({ type, alt, referenceType, identifier, label, }: mdast.ImageReference) => {
|
||||
type: "imageReference";
|
||||
alt: string | null | undefined;
|
||||
referenceType: mdast.ReferenceType;
|
||||
identifier: string;
|
||||
label: string | null | undefined;
|
||||
children: {
|
||||
text: string;
|
||||
}[];
|
||||
};
|
||||
export type Footnote = ReturnType<typeof buildFootnote>;
|
||||
declare const buildFootnote: ({ type, children }: mdast.Footnote, deco: Decoration, overrides: OverridedMdastBuilders) => {
|
||||
type: "footnote";
|
||||
children: slate.Node[];
|
||||
};
|
||||
export type FootnoteReference = ReturnType<typeof buildFootnoteReference>;
|
||||
declare const buildFootnoteReference: ({ type, identifier, label, }: mdast.FootnoteReference) => {
|
||||
type: "footnoteReference";
|
||||
identifier: string;
|
||||
label: string | null | undefined;
|
||||
children: {
|
||||
text: string;
|
||||
}[];
|
||||
};
|
||||
export type SlateNode = Paragraph | Heading | ThematicBreak | Blockquote | List | ListItem | Table | TableRow | TableCell | Html | Code | Yaml | Toml | Definition | FootnoteDefinition | Text | Break | Link | Image | LinkReference | ImageReference | Footnote | FootnoteReference | Math | InlineMath;
|
||||
export {};
|
||||
7
node_modules/remark-slate-transformer/lib/transformers/slate-to-mdast/index.d.ts
generated
vendored
Normal file
7
node_modules/remark-slate-transformer/lib/transformers/slate-to-mdast/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type * as slate from "../../models/slate";
|
||||
import type * as mdast from "../../models/mdast";
|
||||
export type OverridedSlateBuilders = {
|
||||
[key: string]: SlateBuilder;
|
||||
};
|
||||
export type SlateBuilder = (node: unknown, next: (children: any[]) => any) => object | undefined;
|
||||
export declare const slateToMdast: (node: slate.Node, overrides: OverridedSlateBuilders) => mdast.Root;
|
||||
3
node_modules/remark-slate-transformer/lib/transformers/slate-to-slate0.47.d.ts
generated
vendored
Normal file
3
node_modules/remark-slate-transformer/lib/transformers/slate-to-slate0.47.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { ValueJSON } from "slate_legacy";
|
||||
import type { SlateNode } from "./mdast-to-slate";
|
||||
export declare const slateToSlate047: (nodes: SlateNode[]) => ValueJSON;
|
||||
3
node_modules/remark-slate-transformer/lib/transformers/slate0.47-to-slate.d.ts
generated
vendored
Normal file
3
node_modules/remark-slate-transformer/lib/transformers/slate0.47-to-slate.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { BlockJSON, InlineJSON, TextJSON } from "slate_legacy";
|
||||
import type * as slate from "../models/slate";
|
||||
export declare const slate047ToSlate: (nodes: (BlockJSON | InlineJSON | TextJSON)[]) => slate.Node[];
|
||||
1
node_modules/remark-slate-transformer/lib/utils.d.ts
generated
vendored
Normal file
1
node_modules/remark-slate-transformer/lib/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare const unreachable: (_: never) => never;
|
||||
15
node_modules/remark-slate-transformer/node_modules/tslib/CopyrightNotice.txt
generated
vendored
Normal file
15
node_modules/remark-slate-transformer/node_modules/tslib/CopyrightNotice.txt
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
/******************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
|
||||
12
node_modules/remark-slate-transformer/node_modules/tslib/LICENSE.txt
generated
vendored
Normal file
12
node_modules/remark-slate-transformer/node_modules/tslib/LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
164
node_modules/remark-slate-transformer/node_modules/tslib/README.md
generated
vendored
Normal file
164
node_modules/remark-slate-transformer/node_modules/tslib/README.md
generated
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
# tslib
|
||||
|
||||
This is a runtime library for [TypeScript](https://www.typescriptlang.org/) that contains all of the TypeScript helper functions.
|
||||
|
||||
This library is primarily used by the `--importHelpers` flag in TypeScript.
|
||||
When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file:
|
||||
|
||||
```ts
|
||||
var __assign = (this && this.__assign) || Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.x = {};
|
||||
exports.y = __assign({}, exports.x);
|
||||
|
||||
```
|
||||
|
||||
will instead be emitted as something like the following:
|
||||
|
||||
```ts
|
||||
var tslib_1 = require("tslib");
|
||||
exports.x = {};
|
||||
exports.y = tslib_1.__assign({}, exports.x);
|
||||
```
|
||||
|
||||
Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead.
|
||||
For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`.
|
||||
|
||||
# Installing
|
||||
|
||||
For the latest stable version, run:
|
||||
|
||||
## npm
|
||||
|
||||
```sh
|
||||
# TypeScript 3.9.2 or later
|
||||
npm install tslib
|
||||
|
||||
# TypeScript 3.8.4 or earlier
|
||||
npm install tslib@^1
|
||||
|
||||
# TypeScript 2.3.2 or earlier
|
||||
npm install tslib@1.6.1
|
||||
```
|
||||
|
||||
## yarn
|
||||
|
||||
```sh
|
||||
# TypeScript 3.9.2 or later
|
||||
yarn add tslib
|
||||
|
||||
# TypeScript 3.8.4 or earlier
|
||||
yarn add tslib@^1
|
||||
|
||||
# TypeScript 2.3.2 or earlier
|
||||
yarn add tslib@1.6.1
|
||||
```
|
||||
|
||||
## bower
|
||||
|
||||
```sh
|
||||
# TypeScript 3.9.2 or later
|
||||
bower install tslib
|
||||
|
||||
# TypeScript 3.8.4 or earlier
|
||||
bower install tslib@^1
|
||||
|
||||
# TypeScript 2.3.2 or earlier
|
||||
bower install tslib@1.6.1
|
||||
```
|
||||
|
||||
## JSPM
|
||||
|
||||
```sh
|
||||
# TypeScript 3.9.2 or later
|
||||
jspm install tslib
|
||||
|
||||
# TypeScript 3.8.4 or earlier
|
||||
jspm install tslib@^1
|
||||
|
||||
# TypeScript 2.3.2 or earlier
|
||||
jspm install tslib@1.6.1
|
||||
```
|
||||
|
||||
# Usage
|
||||
|
||||
Set the `importHelpers` compiler option on the command line:
|
||||
|
||||
```
|
||||
tsc --importHelpers file.ts
|
||||
```
|
||||
|
||||
or in your tsconfig.json:
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"importHelpers": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### For bower and JSPM users
|
||||
|
||||
You will need to add a `paths` mapping for `tslib`, e.g. For Bower users:
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "amd",
|
||||
"importHelpers": true,
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"tslib" : ["bower_components/tslib/tslib.d.ts"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For JSPM users:
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "system",
|
||||
"importHelpers": true,
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"tslib" : ["jspm_packages/npm/tslib@2.x.y/tslib.d.ts"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Deployment
|
||||
|
||||
- Choose your new version number
|
||||
- Set it in `package.json` and `bower.json`
|
||||
- Create a tag: `git tag [version]`
|
||||
- Push the tag: `git push --tags`
|
||||
- Create a [release in GitHub](https://github.com/microsoft/tslib/releases)
|
||||
- Run the [publish to npm](https://github.com/microsoft/tslib/actions?query=workflow%3A%22Publish+to+NPM%22) workflow
|
||||
|
||||
Done.
|
||||
|
||||
# Contribute
|
||||
|
||||
There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
|
||||
|
||||
* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
|
||||
* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls).
|
||||
* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript).
|
||||
* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter.
|
||||
* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
|
||||
|
||||
# Documentation
|
||||
|
||||
* [Quick tutorial](http://www.typescriptlang.org/Tutorial)
|
||||
* [Programming handbook](http://www.typescriptlang.org/Handbook)
|
||||
* [Homepage](http://www.typescriptlang.org/)
|
||||
41
node_modules/remark-slate-transformer/node_modules/tslib/SECURITY.md
generated
vendored
Normal file
41
node_modules/remark-slate-transformer/node_modules/tslib/SECURITY.md
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->
|
||||
|
||||
## Security
|
||||
|
||||
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
|
||||
|
||||
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
|
||||
|
||||
## Reporting Security Issues
|
||||
|
||||
**Please do not report security vulnerabilities through public GitHub issues.**
|
||||
|
||||
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
|
||||
|
||||
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
|
||||
|
||||
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
|
||||
|
||||
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
|
||||
|
||||
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
||||
* Full paths of source file(s) related to the manifestation of the issue
|
||||
* The location of the affected source code (tag/branch/commit or direct URL)
|
||||
* Any special configuration required to reproduce the issue
|
||||
* Step-by-step instructions to reproduce the issue
|
||||
* Proof-of-concept or exploit code (if possible)
|
||||
* Impact of the issue, including how an attacker might exploit the issue
|
||||
|
||||
This information will help us triage your report more quickly.
|
||||
|
||||
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
|
||||
|
||||
## Preferred Languages
|
||||
|
||||
We prefer all communications to be in English.
|
||||
|
||||
## Policy
|
||||
|
||||
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
|
||||
|
||||
<!-- END MICROSOFT SECURITY.MD BLOCK -->
|
||||
37
node_modules/remark-slate-transformer/node_modules/tslib/modules/index.d.ts
generated
vendored
Normal file
37
node_modules/remark-slate-transformer/node_modules/tslib/modules/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
// Note: named reexports are used instead of `export *` because
|
||||
// TypeScript itself doesn't resolve the `export *` when checking
|
||||
// if a particular helper exists.
|
||||
export {
|
||||
__extends,
|
||||
__assign,
|
||||
__rest,
|
||||
__decorate,
|
||||
__param,
|
||||
__esDecorate,
|
||||
__runInitializers,
|
||||
__propKey,
|
||||
__setFunctionName,
|
||||
__metadata,
|
||||
__awaiter,
|
||||
__generator,
|
||||
__exportStar,
|
||||
__values,
|
||||
__read,
|
||||
__spread,
|
||||
__spreadArrays,
|
||||
__spreadArray,
|
||||
__await,
|
||||
__asyncGenerator,
|
||||
__asyncDelegator,
|
||||
__asyncValues,
|
||||
__makeTemplateObject,
|
||||
__importStar,
|
||||
__importDefault,
|
||||
__classPrivateFieldGet,
|
||||
__classPrivateFieldSet,
|
||||
__classPrivateFieldIn,
|
||||
__createBinding,
|
||||
__addDisposableResource,
|
||||
__disposeResources,
|
||||
} from '../tslib.js';
|
||||
export * as default from '../tslib.js';
|
||||
68
node_modules/remark-slate-transformer/node_modules/tslib/modules/index.js
generated
vendored
Normal file
68
node_modules/remark-slate-transformer/node_modules/tslib/modules/index.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
import tslib from '../tslib.js';
|
||||
const {
|
||||
__extends,
|
||||
__assign,
|
||||
__rest,
|
||||
__decorate,
|
||||
__param,
|
||||
__esDecorate,
|
||||
__runInitializers,
|
||||
__propKey,
|
||||
__setFunctionName,
|
||||
__metadata,
|
||||
__awaiter,
|
||||
__generator,
|
||||
__exportStar,
|
||||
__createBinding,
|
||||
__values,
|
||||
__read,
|
||||
__spread,
|
||||
__spreadArrays,
|
||||
__spreadArray,
|
||||
__await,
|
||||
__asyncGenerator,
|
||||
__asyncDelegator,
|
||||
__asyncValues,
|
||||
__makeTemplateObject,
|
||||
__importStar,
|
||||
__importDefault,
|
||||
__classPrivateFieldGet,
|
||||
__classPrivateFieldSet,
|
||||
__classPrivateFieldIn,
|
||||
__addDisposableResource,
|
||||
__disposeResources,
|
||||
} = tslib;
|
||||
export {
|
||||
__extends,
|
||||
__assign,
|
||||
__rest,
|
||||
__decorate,
|
||||
__param,
|
||||
__esDecorate,
|
||||
__runInitializers,
|
||||
__propKey,
|
||||
__setFunctionName,
|
||||
__metadata,
|
||||
__awaiter,
|
||||
__generator,
|
||||
__exportStar,
|
||||
__createBinding,
|
||||
__values,
|
||||
__read,
|
||||
__spread,
|
||||
__spreadArrays,
|
||||
__spreadArray,
|
||||
__await,
|
||||
__asyncGenerator,
|
||||
__asyncDelegator,
|
||||
__asyncValues,
|
||||
__makeTemplateObject,
|
||||
__importStar,
|
||||
__importDefault,
|
||||
__classPrivateFieldGet,
|
||||
__classPrivateFieldSet,
|
||||
__classPrivateFieldIn,
|
||||
__addDisposableResource,
|
||||
__disposeResources,
|
||||
};
|
||||
export default tslib;
|
||||
3
node_modules/remark-slate-transformer/node_modules/tslib/modules/package.json
generated
vendored
Normal file
3
node_modules/remark-slate-transformer/node_modules/tslib/modules/package.json
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
47
node_modules/remark-slate-transformer/node_modules/tslib/package.json
generated
vendored
Normal file
47
node_modules/remark-slate-transformer/node_modules/tslib/package.json
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"name": "tslib",
|
||||
"author": "Microsoft Corp.",
|
||||
"homepage": "https://www.typescriptlang.org/",
|
||||
"version": "2.7.0",
|
||||
"license": "0BSD",
|
||||
"description": "Runtime library for TypeScript helper functions",
|
||||
"keywords": [
|
||||
"TypeScript",
|
||||
"Microsoft",
|
||||
"compiler",
|
||||
"language",
|
||||
"javascript",
|
||||
"tslib",
|
||||
"runtime"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/Microsoft/TypeScript/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Microsoft/tslib.git"
|
||||
},
|
||||
"main": "tslib.js",
|
||||
"module": "tslib.es6.js",
|
||||
"jsnext:main": "tslib.es6.js",
|
||||
"typings": "tslib.d.ts",
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
".": {
|
||||
"module": {
|
||||
"types": "./modules/index.d.ts",
|
||||
"default": "./tslib.es6.mjs"
|
||||
},
|
||||
"import": {
|
||||
"node": "./modules/index.js",
|
||||
"default": {
|
||||
"types": "./modules/index.d.ts",
|
||||
"default": "./tslib.es6.mjs"
|
||||
}
|
||||
},
|
||||
"default": "./tslib.js"
|
||||
},
|
||||
"./*": "./*",
|
||||
"./": "./"
|
||||
}
|
||||
}
|
||||
453
node_modules/remark-slate-transformer/node_modules/tslib/tslib.d.ts
generated
vendored
Normal file
453
node_modules/remark-slate-transformer/node_modules/tslib/tslib.d.ts
generated
vendored
Normal file
@@ -0,0 +1,453 @@
|
||||
/******************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
|
||||
/**
|
||||
* Used to shim class extends.
|
||||
*
|
||||
* @param d The derived class.
|
||||
* @param b The base class.
|
||||
*/
|
||||
export declare function __extends(d: Function, b: Function): void;
|
||||
|
||||
/**
|
||||
* Copy the values of all of the enumerable own properties from one or more source objects to a
|
||||
* target object. Returns the target object.
|
||||
*
|
||||
* @param t The target object to copy to.
|
||||
* @param sources One or more source objects from which to copy properties
|
||||
*/
|
||||
export declare function __assign(t: any, ...sources: any[]): any;
|
||||
|
||||
/**
|
||||
* Performs a rest spread on an object.
|
||||
*
|
||||
* @param t The source value.
|
||||
* @param propertyNames The property names excluded from the rest spread.
|
||||
*/
|
||||
export declare function __rest(t: any, propertyNames: (string | symbol)[]): any;
|
||||
|
||||
/**
|
||||
* Applies decorators to a target object
|
||||
*
|
||||
* @param decorators The set of decorators to apply.
|
||||
* @param target The target object.
|
||||
* @param key If specified, the own property to apply the decorators to.
|
||||
* @param desc The property descriptor, defaults to fetching the descriptor from the target object.
|
||||
* @experimental
|
||||
*/
|
||||
export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any;
|
||||
|
||||
/**
|
||||
* Creates an observing function decorator from a parameter decorator.
|
||||
*
|
||||
* @param paramIndex The parameter index to apply the decorator to.
|
||||
* @param decorator The parameter decorator to apply. Note that the return value is ignored.
|
||||
* @experimental
|
||||
*/
|
||||
export declare function __param(paramIndex: number, decorator: Function): Function;
|
||||
|
||||
/**
|
||||
* Applies decorators to a class or class member, following the native ECMAScript decorator specification.
|
||||
* @param ctor For non-field class members, the class constructor. Otherwise, `null`.
|
||||
* @param descriptorIn The `PropertyDescriptor` to use when unable to look up the property from `ctor`.
|
||||
* @param decorators The decorators to apply
|
||||
* @param contextIn The `DecoratorContext` to clone for each decorator application.
|
||||
* @param initializers An array of field initializer mutation functions into which new initializers are written.
|
||||
* @param extraInitializers An array of extra initializer functions into which new initializers are written.
|
||||
*/
|
||||
export declare function __esDecorate(ctor: Function | null, descriptorIn: object | null, decorators: Function[], contextIn: object, initializers: Function[] | null, extraInitializers: Function[]): void;
|
||||
|
||||
/**
|
||||
* Runs field initializers or extra initializers generated by `__esDecorate`.
|
||||
* @param thisArg The `this` argument to use.
|
||||
* @param initializers The array of initializers to evaluate.
|
||||
* @param value The initial value to pass to the initializers.
|
||||
*/
|
||||
export declare function __runInitializers(thisArg: unknown, initializers: Function[], value?: any): any;
|
||||
|
||||
/**
|
||||
* Converts a computed property name into a `string` or `symbol` value.
|
||||
*/
|
||||
export declare function __propKey(x: any): string | symbol;
|
||||
|
||||
/**
|
||||
* Assigns the name of a function derived from the left-hand side of an assignment.
|
||||
* @param f The function to rename.
|
||||
* @param name The new name for the function.
|
||||
* @param prefix A prefix (such as `"get"` or `"set"`) to insert before the name.
|
||||
*/
|
||||
export declare function __setFunctionName(f: Function, name: string | symbol, prefix?: string): Function;
|
||||
|
||||
/**
|
||||
* Creates a decorator that sets metadata.
|
||||
*
|
||||
* @param metadataKey The metadata key
|
||||
* @param metadataValue The metadata value
|
||||
* @experimental
|
||||
*/
|
||||
export declare function __metadata(metadataKey: any, metadataValue: any): Function;
|
||||
|
||||
/**
|
||||
* Converts a generator function into a pseudo-async function, by treating each `yield` as an `await`.
|
||||
*
|
||||
* @param thisArg The reference to use as the `this` value in the generator function
|
||||
* @param _arguments The optional arguments array
|
||||
* @param P The optional promise constructor argument, defaults to the `Promise` property of the global object.
|
||||
* @param generator The generator function
|
||||
*/
|
||||
export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any;
|
||||
|
||||
/**
|
||||
* Creates an Iterator object using the body as the implementation.
|
||||
*
|
||||
* @param thisArg The reference to use as the `this` value in the function
|
||||
* @param body The generator state-machine based implementation.
|
||||
*
|
||||
* @see [./docs/generator.md]
|
||||
*/
|
||||
export declare function __generator(thisArg: any, body: Function): any;
|
||||
|
||||
/**
|
||||
* Creates bindings for all enumerable properties of `m` on `exports`
|
||||
*
|
||||
* @param m The source object
|
||||
* @param o The `exports` object.
|
||||
*/
|
||||
export declare function __exportStar(m: any, o: any): void;
|
||||
|
||||
/**
|
||||
* Creates a value iterator from an `Iterable` or `ArrayLike` object.
|
||||
*
|
||||
* @param o The object.
|
||||
* @throws {TypeError} If `o` is neither `Iterable`, nor an `ArrayLike`.
|
||||
*/
|
||||
export declare function __values(o: any): any;
|
||||
|
||||
/**
|
||||
* Reads values from an `Iterable` or `ArrayLike` object and returns the resulting array.
|
||||
*
|
||||
* @param o The object to read from.
|
||||
* @param n The maximum number of arguments to read, defaults to `Infinity`.
|
||||
*/
|
||||
export declare function __read(o: any, n?: number): any[];
|
||||
|
||||
/**
|
||||
* Creates an array from iterable spread.
|
||||
*
|
||||
* @param args The Iterable objects to spread.
|
||||
* @deprecated since TypeScript 4.2 - Use `__spreadArray`
|
||||
*/
|
||||
export declare function __spread(...args: any[][]): any[];
|
||||
|
||||
/**
|
||||
* Creates an array from array spread.
|
||||
*
|
||||
* @param args The ArrayLikes to spread into the resulting array.
|
||||
* @deprecated since TypeScript 4.2 - Use `__spreadArray`
|
||||
*/
|
||||
export declare function __spreadArrays(...args: any[][]): any[];
|
||||
|
||||
/**
|
||||
* Spreads the `from` array into the `to` array.
|
||||
*
|
||||
* @param pack Replace empty elements with `undefined`.
|
||||
*/
|
||||
export declare function __spreadArray(to: any[], from: any[], pack?: boolean): any[];
|
||||
|
||||
/**
|
||||
* Creates an object that signals to `__asyncGenerator` that it shouldn't be yielded,
|
||||
* and instead should be awaited and the resulting value passed back to the generator.
|
||||
*
|
||||
* @param v The value to await.
|
||||
*/
|
||||
export declare function __await(v: any): any;
|
||||
|
||||
/**
|
||||
* Converts a generator function into an async generator function, by using `yield __await`
|
||||
* in place of normal `await`.
|
||||
*
|
||||
* @param thisArg The reference to use as the `this` value in the generator function
|
||||
* @param _arguments The optional arguments array
|
||||
* @param generator The generator function
|
||||
*/
|
||||
export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any;
|
||||
|
||||
/**
|
||||
* Used to wrap a potentially async iterator in such a way so that it wraps the result
|
||||
* of calling iterator methods of `o` in `__await` instances, and then yields the awaited values.
|
||||
*
|
||||
* @param o The potentially async iterator.
|
||||
* @returns A synchronous iterator yielding `__await` instances on every odd invocation
|
||||
* and returning the awaited `IteratorResult` passed to `next` every even invocation.
|
||||
*/
|
||||
export declare function __asyncDelegator(o: any): any;
|
||||
|
||||
/**
|
||||
* Creates a value async iterator from an `AsyncIterable`, `Iterable` or `ArrayLike` object.
|
||||
*
|
||||
* @param o The object.
|
||||
* @throws {TypeError} If `o` is neither `AsyncIterable`, `Iterable`, nor an `ArrayLike`.
|
||||
*/
|
||||
export declare function __asyncValues(o: any): any;
|
||||
|
||||
/**
|
||||
* Creates a `TemplateStringsArray` frozen object from the `cooked` and `raw` arrays.
|
||||
*
|
||||
* @param cooked The cooked possibly-sparse array.
|
||||
* @param raw The raw string content.
|
||||
*/
|
||||
export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray;
|
||||
|
||||
/**
|
||||
* Used to shim default and named imports in ECMAScript Modules transpiled to CommonJS.
|
||||
*
|
||||
* ```js
|
||||
* import Default, { Named, Other } from "mod";
|
||||
* // or
|
||||
* import { default as Default, Named, Other } from "mod";
|
||||
* ```
|
||||
*
|
||||
* @param mod The CommonJS module exports object.
|
||||
*/
|
||||
export declare function __importStar<T>(mod: T): T;
|
||||
|
||||
/**
|
||||
* Used to shim default imports in ECMAScript Modules transpiled to CommonJS.
|
||||
*
|
||||
* ```js
|
||||
* import Default from "mod";
|
||||
* ```
|
||||
*
|
||||
* @param mod The CommonJS module exports object.
|
||||
*/
|
||||
export declare function __importDefault<T>(mod: T): T | { default: T };
|
||||
|
||||
/**
|
||||
* Emulates reading a private instance field.
|
||||
*
|
||||
* @param receiver The instance from which to read the private field.
|
||||
* @param state A WeakMap containing the private field value for an instance.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
*
|
||||
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
|
||||
*/
|
||||
export declare function __classPrivateFieldGet<T extends object, V>(
|
||||
receiver: T,
|
||||
state: { has(o: T): boolean, get(o: T): V | undefined },
|
||||
kind?: "f"
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates reading a private static field.
|
||||
*
|
||||
* @param receiver The object from which to read the private static field.
|
||||
* @param state The class constructor containing the definition of the static field.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The descriptor that holds the static field value.
|
||||
*
|
||||
* @throws {TypeError} If `receiver` is not `state`.
|
||||
*/
|
||||
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V>(
|
||||
receiver: T,
|
||||
state: T,
|
||||
kind: "f",
|
||||
f: { value: V }
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates evaluating a private instance "get" accessor.
|
||||
*
|
||||
* @param receiver The instance on which to evaluate the private "get" accessor.
|
||||
* @param state A WeakSet used to verify an instance supports the private "get" accessor.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The "get" accessor function to evaluate.
|
||||
*
|
||||
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
|
||||
*/
|
||||
export declare function __classPrivateFieldGet<T extends object, V>(
|
||||
receiver: T,
|
||||
state: { has(o: T): boolean },
|
||||
kind: "a",
|
||||
f: () => V
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates evaluating a private static "get" accessor.
|
||||
*
|
||||
* @param receiver The object on which to evaluate the private static "get" accessor.
|
||||
* @param state The class constructor containing the definition of the static "get" accessor.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The "get" accessor function to evaluate.
|
||||
*
|
||||
* @throws {TypeError} If `receiver` is not `state`.
|
||||
*/
|
||||
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V>(
|
||||
receiver: T,
|
||||
state: T,
|
||||
kind: "a",
|
||||
f: () => V
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates reading a private instance method.
|
||||
*
|
||||
* @param receiver The instance from which to read a private method.
|
||||
* @param state A WeakSet used to verify an instance supports the private method.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The function to return as the private instance method.
|
||||
*
|
||||
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
|
||||
*/
|
||||
export declare function __classPrivateFieldGet<T extends object, V extends (...args: any[]) => unknown>(
|
||||
receiver: T,
|
||||
state: { has(o: T): boolean },
|
||||
kind: "m",
|
||||
f: V
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates reading a private static method.
|
||||
*
|
||||
* @param receiver The object from which to read the private static method.
|
||||
* @param state The class constructor containing the definition of the static method.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The function to return as the private static method.
|
||||
*
|
||||
* @throws {TypeError} If `receiver` is not `state`.
|
||||
*/
|
||||
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V extends (...args: any[]) => unknown>(
|
||||
receiver: T,
|
||||
state: T,
|
||||
kind: "m",
|
||||
f: V
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates writing to a private instance field.
|
||||
*
|
||||
* @param receiver The instance on which to set a private field value.
|
||||
* @param state A WeakMap used to store the private field value for an instance.
|
||||
* @param value The value to store in the private field.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
*
|
||||
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
|
||||
*/
|
||||
export declare function __classPrivateFieldSet<T extends object, V>(
|
||||
receiver: T,
|
||||
state: { has(o: T): boolean, set(o: T, value: V): unknown },
|
||||
value: V,
|
||||
kind?: "f"
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates writing to a private static field.
|
||||
*
|
||||
* @param receiver The object on which to set the private static field.
|
||||
* @param state The class constructor containing the definition of the private static field.
|
||||
* @param value The value to store in the private field.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The descriptor that holds the static field value.
|
||||
*
|
||||
* @throws {TypeError} If `receiver` is not `state`.
|
||||
*/
|
||||
export declare function __classPrivateFieldSet<T extends new (...args: any[]) => unknown, V>(
|
||||
receiver: T,
|
||||
state: T,
|
||||
value: V,
|
||||
kind: "f",
|
||||
f: { value: V }
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates writing to a private instance "set" accessor.
|
||||
*
|
||||
* @param receiver The instance on which to evaluate the private instance "set" accessor.
|
||||
* @param state A WeakSet used to verify an instance supports the private "set" accessor.
|
||||
* @param value The value to store in the private accessor.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The "set" accessor function to evaluate.
|
||||
*
|
||||
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
|
||||
*/
|
||||
export declare function __classPrivateFieldSet<T extends object, V>(
|
||||
receiver: T,
|
||||
state: { has(o: T): boolean },
|
||||
value: V,
|
||||
kind: "a",
|
||||
f: (v: V) => void
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates writing to a private static "set" accessor.
|
||||
*
|
||||
* @param receiver The object on which to evaluate the private static "set" accessor.
|
||||
* @param state The class constructor containing the definition of the static "set" accessor.
|
||||
* @param value The value to store in the private field.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The "set" accessor function to evaluate.
|
||||
*
|
||||
* @throws {TypeError} If `receiver` is not `state`.
|
||||
*/
|
||||
export declare function __classPrivateFieldSet<T extends new (...args: any[]) => unknown, V>(
|
||||
receiver: T,
|
||||
state: T,
|
||||
value: V,
|
||||
kind: "a",
|
||||
f: (v: V) => void
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Checks for the existence of a private field/method/accessor.
|
||||
*
|
||||
* @param state The class constructor containing the static member, or the WeakMap or WeakSet associated with a private instance member.
|
||||
* @param receiver The object for which to test the presence of the private member.
|
||||
*/
|
||||
export declare function __classPrivateFieldIn(
|
||||
state: (new (...args: any[]) => unknown) | { has(o: any): boolean },
|
||||
receiver: unknown,
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
* Creates a re-export binding on `object` with key `objectKey` that references `target[key]`.
|
||||
*
|
||||
* @param object The local `exports` object.
|
||||
* @param target The object to re-export from.
|
||||
* @param key The property key of `target` to re-export.
|
||||
* @param objectKey The property key to re-export as. Defaults to `key`.
|
||||
*/
|
||||
export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void;
|
||||
|
||||
/**
|
||||
* Adds a disposable resource to a resource-tracking environment object.
|
||||
* @param env A resource-tracking environment object.
|
||||
* @param value Either a Disposable or AsyncDisposable object, `null`, or `undefined`.
|
||||
* @param async When `true`, `AsyncDisposable` resources can be added. When `false`, `AsyncDisposable` resources cannot be added.
|
||||
* @returns The {@link value} argument.
|
||||
*
|
||||
* @throws {TypeError} If {@link value} is not an object, or if either `Symbol.dispose` or `Symbol.asyncDispose` are not
|
||||
* defined, or if {@link value} does not have an appropriate `Symbol.dispose` or `Symbol.asyncDispose` method.
|
||||
*/
|
||||
export declare function __addDisposableResource<T>(env: { stack: { value?: unknown, dispose?: Function, async: boolean }[]; error: unknown; hasError: boolean; }, value: T, async: boolean): T;
|
||||
|
||||
/**
|
||||
* Disposes all resources in a resource-tracking environment object.
|
||||
* @param env A resource-tracking environment object.
|
||||
* @returns A {@link Promise} if any resources in the environment were marked as `async` when added; otherwise, `void`.
|
||||
*
|
||||
* @throws {SuppressedError} if an error thrown during disposal would have suppressed a prior error from disposal or the
|
||||
* error recorded in the resource-tracking environment object.
|
||||
* @seealso {@link __addDisposableResource}
|
||||
*/
|
||||
export declare function __disposeResources(env: { stack: { value?: unknown, dispose?: Function, async: boolean }[]; error: unknown; hasError: boolean; }): any;
|
||||
1
node_modules/remark-slate-transformer/node_modules/tslib/tslib.es6.html
generated
vendored
Normal file
1
node_modules/remark-slate-transformer/node_modules/tslib/tslib.es6.html
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<script src="tslib.es6.js"></script>
|
||||
379
node_modules/remark-slate-transformer/node_modules/tslib/tslib.es6.js
generated
vendored
Normal file
379
node_modules/remark-slate-transformer/node_modules/tslib/tslib.es6.js
generated
vendored
Normal file
@@ -0,0 +1,379 @@
|
||||
/******************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
||||
|
||||
var extendStatics = function(d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
|
||||
export function __extends(d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
}
|
||||
|
||||
export var __assign = function() {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
}
|
||||
return __assign.apply(this, arguments);
|
||||
}
|
||||
|
||||
export function __rest(s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
export function __decorate(decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
}
|
||||
|
||||
export function __param(paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
}
|
||||
|
||||
export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
||||
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
||||
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
||||
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
||||
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
||||
var _, done = false;
|
||||
for (var i = decorators.length - 1; i >= 0; i--) {
|
||||
var context = {};
|
||||
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
||||
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
||||
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
||||
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
||||
if (kind === "accessor") {
|
||||
if (result === void 0) continue;
|
||||
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
||||
if (_ = accept(result.get)) descriptor.get = _;
|
||||
if (_ = accept(result.set)) descriptor.set = _;
|
||||
if (_ = accept(result.init)) initializers.unshift(_);
|
||||
}
|
||||
else if (_ = accept(result)) {
|
||||
if (kind === "field") initializers.unshift(_);
|
||||
else descriptor[key] = _;
|
||||
}
|
||||
}
|
||||
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
||||
done = true;
|
||||
};
|
||||
|
||||
export function __runInitializers(thisArg, initializers, value) {
|
||||
var useValue = arguments.length > 2;
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
||||
}
|
||||
return useValue ? value : void 0;
|
||||
};
|
||||
|
||||
export function __propKey(x) {
|
||||
return typeof x === "symbol" ? x : "".concat(x);
|
||||
};
|
||||
|
||||
export function __setFunctionName(f, name, prefix) {
|
||||
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
||||
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
||||
};
|
||||
|
||||
export function __metadata(metadataKey, metadataValue) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
||||
}
|
||||
|
||||
export function __awaiter(thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
}
|
||||
|
||||
export function __generator(thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
||||
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
}
|
||||
|
||||
export var __createBinding = Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
});
|
||||
|
||||
export function __exportStar(m, o) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
||||
}
|
||||
|
||||
export function __values(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
}
|
||||
|
||||
export function __read(o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export function __spread() {
|
||||
for (var ar = [], i = 0; i < arguments.length; i++)
|
||||
ar = ar.concat(__read(arguments[i]));
|
||||
return ar;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export function __spreadArrays() {
|
||||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
||||
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
||||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
||||
r[k] = a[j];
|
||||
return r;
|
||||
}
|
||||
|
||||
export function __spreadArray(to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
}
|
||||
|
||||
export function __await(v) {
|
||||
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
||||
}
|
||||
|
||||
export function __asyncGenerator(thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
||||
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
}
|
||||
|
||||
export function __asyncDelegator(o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
||||
}
|
||||
|
||||
export function __asyncValues(o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator], i;
|
||||
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
||||
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
||||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
||||
}
|
||||
|
||||
export function __makeTemplateObject(cooked, raw) {
|
||||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
||||
return cooked;
|
||||
};
|
||||
|
||||
var __setModuleDefault = Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
};
|
||||
|
||||
export function __importStar(mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
}
|
||||
|
||||
export function __importDefault(mod) {
|
||||
return (mod && mod.__esModule) ? mod : { default: mod };
|
||||
}
|
||||
|
||||
export function __classPrivateFieldGet(receiver, state, kind, f) {
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
||||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
||||
}
|
||||
|
||||
export function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
||||
if (kind === "m") throw new TypeError("Private method is not writable");
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
||||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
||||
}
|
||||
|
||||
export function __classPrivateFieldIn(state, receiver) {
|
||||
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
||||
return typeof state === "function" ? receiver === state : state.has(receiver);
|
||||
}
|
||||
|
||||
export function __addDisposableResource(env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose, inner;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
dispose = value[Symbol.asyncDispose];
|
||||
}
|
||||
if (dispose === void 0) {
|
||||
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
||||
dispose = value[Symbol.dispose];
|
||||
if (async) inner = dispose;
|
||||
}
|
||||
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
||||
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
||||
env.stack.push({ value: value, dispose: dispose, async: async });
|
||||
}
|
||||
else if (async) {
|
||||
env.stack.push({ async: true });
|
||||
}
|
||||
return value;
|
||||
|
||||
}
|
||||
|
||||
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
||||
var e = new Error(message);
|
||||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
||||
};
|
||||
|
||||
export function __disposeResources(env) {
|
||||
function fail(e) {
|
||||
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
||||
env.hasError = true;
|
||||
}
|
||||
var r, s = 0;
|
||||
function next() {
|
||||
while (r = env.stack.pop()) {
|
||||
try {
|
||||
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
||||
if (r.dispose) {
|
||||
var result = r.dispose.call(r.value);
|
||||
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
||||
}
|
||||
else s |= 1;
|
||||
}
|
||||
catch (e) {
|
||||
fail(e);
|
||||
}
|
||||
}
|
||||
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
||||
if (env.hasError) throw env.error;
|
||||
}
|
||||
return next();
|
||||
}
|
||||
|
||||
export default {
|
||||
__extends: __extends,
|
||||
__assign: __assign,
|
||||
__rest: __rest,
|
||||
__decorate: __decorate,
|
||||
__param: __param,
|
||||
__metadata: __metadata,
|
||||
__awaiter: __awaiter,
|
||||
__generator: __generator,
|
||||
__createBinding: __createBinding,
|
||||
__exportStar: __exportStar,
|
||||
__values: __values,
|
||||
__read: __read,
|
||||
__spread: __spread,
|
||||
__spreadArrays: __spreadArrays,
|
||||
__spreadArray: __spreadArray,
|
||||
__await: __await,
|
||||
__asyncGenerator: __asyncGenerator,
|
||||
__asyncDelegator: __asyncDelegator,
|
||||
__asyncValues: __asyncValues,
|
||||
__makeTemplateObject: __makeTemplateObject,
|
||||
__importStar: __importStar,
|
||||
__importDefault: __importDefault,
|
||||
__classPrivateFieldGet: __classPrivateFieldGet,
|
||||
__classPrivateFieldSet: __classPrivateFieldSet,
|
||||
__classPrivateFieldIn: __classPrivateFieldIn,
|
||||
__addDisposableResource: __addDisposableResource,
|
||||
__disposeResources: __disposeResources,
|
||||
};
|
||||
378
node_modules/remark-slate-transformer/node_modules/tslib/tslib.es6.mjs
generated
vendored
Normal file
378
node_modules/remark-slate-transformer/node_modules/tslib/tslib.es6.mjs
generated
vendored
Normal file
@@ -0,0 +1,378 @@
|
||||
/******************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
||||
|
||||
var extendStatics = function(d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
|
||||
export function __extends(d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
}
|
||||
|
||||
export var __assign = function() {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
}
|
||||
return __assign.apply(this, arguments);
|
||||
}
|
||||
|
||||
export function __rest(s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
export function __decorate(decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
}
|
||||
|
||||
export function __param(paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
}
|
||||
|
||||
export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
||||
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
||||
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
||||
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
||||
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
||||
var _, done = false;
|
||||
for (var i = decorators.length - 1; i >= 0; i--) {
|
||||
var context = {};
|
||||
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
||||
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
||||
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
||||
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
||||
if (kind === "accessor") {
|
||||
if (result === void 0) continue;
|
||||
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
||||
if (_ = accept(result.get)) descriptor.get = _;
|
||||
if (_ = accept(result.set)) descriptor.set = _;
|
||||
if (_ = accept(result.init)) initializers.unshift(_);
|
||||
}
|
||||
else if (_ = accept(result)) {
|
||||
if (kind === "field") initializers.unshift(_);
|
||||
else descriptor[key] = _;
|
||||
}
|
||||
}
|
||||
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
||||
done = true;
|
||||
};
|
||||
|
||||
export function __runInitializers(thisArg, initializers, value) {
|
||||
var useValue = arguments.length > 2;
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
||||
}
|
||||
return useValue ? value : void 0;
|
||||
};
|
||||
|
||||
export function __propKey(x) {
|
||||
return typeof x === "symbol" ? x : "".concat(x);
|
||||
};
|
||||
|
||||
export function __setFunctionName(f, name, prefix) {
|
||||
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
||||
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
||||
};
|
||||
|
||||
export function __metadata(metadataKey, metadataValue) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
||||
}
|
||||
|
||||
export function __awaiter(thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
}
|
||||
|
||||
export function __generator(thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
||||
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
}
|
||||
|
||||
export var __createBinding = Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
});
|
||||
|
||||
export function __exportStar(m, o) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
||||
}
|
||||
|
||||
export function __values(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
}
|
||||
|
||||
export function __read(o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export function __spread() {
|
||||
for (var ar = [], i = 0; i < arguments.length; i++)
|
||||
ar = ar.concat(__read(arguments[i]));
|
||||
return ar;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export function __spreadArrays() {
|
||||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
||||
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
||||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
||||
r[k] = a[j];
|
||||
return r;
|
||||
}
|
||||
|
||||
export function __spreadArray(to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
}
|
||||
|
||||
export function __await(v) {
|
||||
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
||||
}
|
||||
|
||||
export function __asyncGenerator(thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
||||
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
}
|
||||
|
||||
export function __asyncDelegator(o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
||||
}
|
||||
|
||||
export function __asyncValues(o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator], i;
|
||||
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
||||
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
||||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
||||
}
|
||||
|
||||
export function __makeTemplateObject(cooked, raw) {
|
||||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
||||
return cooked;
|
||||
};
|
||||
|
||||
var __setModuleDefault = Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
};
|
||||
|
||||
export function __importStar(mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
}
|
||||
|
||||
export function __importDefault(mod) {
|
||||
return (mod && mod.__esModule) ? mod : { default: mod };
|
||||
}
|
||||
|
||||
export function __classPrivateFieldGet(receiver, state, kind, f) {
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
||||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
||||
}
|
||||
|
||||
export function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
||||
if (kind === "m") throw new TypeError("Private method is not writable");
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
||||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
||||
}
|
||||
|
||||
export function __classPrivateFieldIn(state, receiver) {
|
||||
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
||||
return typeof state === "function" ? receiver === state : state.has(receiver);
|
||||
}
|
||||
|
||||
export function __addDisposableResource(env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose, inner;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
dispose = value[Symbol.asyncDispose];
|
||||
}
|
||||
if (dispose === void 0) {
|
||||
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
||||
dispose = value[Symbol.dispose];
|
||||
if (async) inner = dispose;
|
||||
}
|
||||
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
||||
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
||||
env.stack.push({ value: value, dispose: dispose, async: async });
|
||||
}
|
||||
else if (async) {
|
||||
env.stack.push({ async: true });
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
||||
var e = new Error(message);
|
||||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
||||
};
|
||||
|
||||
export function __disposeResources(env) {
|
||||
function fail(e) {
|
||||
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
||||
env.hasError = true;
|
||||
}
|
||||
var r, s = 0;
|
||||
function next() {
|
||||
while (r = env.stack.pop()) {
|
||||
try {
|
||||
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
||||
if (r.dispose) {
|
||||
var result = r.dispose.call(r.value);
|
||||
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
||||
}
|
||||
else s |= 1;
|
||||
}
|
||||
catch (e) {
|
||||
fail(e);
|
||||
}
|
||||
}
|
||||
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
||||
if (env.hasError) throw env.error;
|
||||
}
|
||||
return next();
|
||||
}
|
||||
|
||||
export default {
|
||||
__extends,
|
||||
__assign,
|
||||
__rest,
|
||||
__decorate,
|
||||
__param,
|
||||
__metadata,
|
||||
__awaiter,
|
||||
__generator,
|
||||
__createBinding,
|
||||
__exportStar,
|
||||
__values,
|
||||
__read,
|
||||
__spread,
|
||||
__spreadArrays,
|
||||
__spreadArray,
|
||||
__await,
|
||||
__asyncGenerator,
|
||||
__asyncDelegator,
|
||||
__asyncValues,
|
||||
__makeTemplateObject,
|
||||
__importStar,
|
||||
__importDefault,
|
||||
__classPrivateFieldGet,
|
||||
__classPrivateFieldSet,
|
||||
__classPrivateFieldIn,
|
||||
__addDisposableResource,
|
||||
__disposeResources,
|
||||
};
|
||||
1
node_modules/remark-slate-transformer/node_modules/tslib/tslib.html
generated
vendored
Normal file
1
node_modules/remark-slate-transformer/node_modules/tslib/tslib.html
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<script src="tslib.js"></script>
|
||||
429
node_modules/remark-slate-transformer/node_modules/tslib/tslib.js
generated
vendored
Normal file
429
node_modules/remark-slate-transformer/node_modules/tslib/tslib.js
generated
vendored
Normal file
@@ -0,0 +1,429 @@
|
||||
/******************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
/* global global, define, Symbol, Reflect, Promise, SuppressedError, Iterator */
|
||||
var __extends;
|
||||
var __assign;
|
||||
var __rest;
|
||||
var __decorate;
|
||||
var __param;
|
||||
var __esDecorate;
|
||||
var __runInitializers;
|
||||
var __propKey;
|
||||
var __setFunctionName;
|
||||
var __metadata;
|
||||
var __awaiter;
|
||||
var __generator;
|
||||
var __exportStar;
|
||||
var __values;
|
||||
var __read;
|
||||
var __spread;
|
||||
var __spreadArrays;
|
||||
var __spreadArray;
|
||||
var __await;
|
||||
var __asyncGenerator;
|
||||
var __asyncDelegator;
|
||||
var __asyncValues;
|
||||
var __makeTemplateObject;
|
||||
var __importStar;
|
||||
var __importDefault;
|
||||
var __classPrivateFieldGet;
|
||||
var __classPrivateFieldSet;
|
||||
var __classPrivateFieldIn;
|
||||
var __createBinding;
|
||||
var __addDisposableResource;
|
||||
var __disposeResources;
|
||||
(function (factory) {
|
||||
var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
|
||||
if (typeof define === "function" && define.amd) {
|
||||
define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); });
|
||||
}
|
||||
else if (typeof module === "object" && typeof module.exports === "object") {
|
||||
factory(createExporter(root, createExporter(module.exports)));
|
||||
}
|
||||
else {
|
||||
factory(createExporter(root));
|
||||
}
|
||||
function createExporter(exports, previous) {
|
||||
if (exports !== root) {
|
||||
if (typeof Object.create === "function") {
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
}
|
||||
else {
|
||||
exports.__esModule = true;
|
||||
}
|
||||
}
|
||||
return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };
|
||||
}
|
||||
})
|
||||
(function (exporter) {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
|
||||
__extends = function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
|
||||
__assign = Object.assign || function (t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
|
||||
__rest = function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
|
||||
__decorate = function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
|
||||
__param = function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
|
||||
__esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
||||
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
||||
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
||||
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
||||
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
||||
var _, done = false;
|
||||
for (var i = decorators.length - 1; i >= 0; i--) {
|
||||
var context = {};
|
||||
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
||||
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
||||
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
||||
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
||||
if (kind === "accessor") {
|
||||
if (result === void 0) continue;
|
||||
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
||||
if (_ = accept(result.get)) descriptor.get = _;
|
||||
if (_ = accept(result.set)) descriptor.set = _;
|
||||
if (_ = accept(result.init)) initializers.unshift(_);
|
||||
}
|
||||
else if (_ = accept(result)) {
|
||||
if (kind === "field") initializers.unshift(_);
|
||||
else descriptor[key] = _;
|
||||
}
|
||||
}
|
||||
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
||||
done = true;
|
||||
};
|
||||
|
||||
__runInitializers = function (thisArg, initializers, value) {
|
||||
var useValue = arguments.length > 2;
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
||||
}
|
||||
return useValue ? value : void 0;
|
||||
};
|
||||
|
||||
__propKey = function (x) {
|
||||
return typeof x === "symbol" ? x : "".concat(x);
|
||||
};
|
||||
|
||||
__setFunctionName = function (f, name, prefix) {
|
||||
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
||||
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
||||
};
|
||||
|
||||
__metadata = function (metadataKey, metadataValue) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
||||
};
|
||||
|
||||
__awaiter = function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
|
||||
__generator = function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
||||
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
|
||||
__exportStar = function(m, o) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
||||
};
|
||||
|
||||
__createBinding = Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
});
|
||||
|
||||
__values = function (o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
|
||||
__read = function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
|
||||
/** @deprecated */
|
||||
__spread = function () {
|
||||
for (var ar = [], i = 0; i < arguments.length; i++)
|
||||
ar = ar.concat(__read(arguments[i]));
|
||||
return ar;
|
||||
};
|
||||
|
||||
/** @deprecated */
|
||||
__spreadArrays = function () {
|
||||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
||||
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
||||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
||||
r[k] = a[j];
|
||||
return r;
|
||||
};
|
||||
|
||||
__spreadArray = function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
|
||||
__await = function (v) {
|
||||
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
||||
};
|
||||
|
||||
__asyncGenerator = function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
||||
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
|
||||
__asyncDelegator = function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
||||
};
|
||||
|
||||
__asyncValues = function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator], i;
|
||||
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
||||
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
||||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
||||
};
|
||||
|
||||
__makeTemplateObject = function (cooked, raw) {
|
||||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
||||
return cooked;
|
||||
};
|
||||
|
||||
var __setModuleDefault = Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
};
|
||||
|
||||
__importStar = function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
|
||||
__importDefault = function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
|
||||
__classPrivateFieldGet = function (receiver, state, kind, f) {
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
||||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
||||
};
|
||||
|
||||
__classPrivateFieldSet = function (receiver, state, value, kind, f) {
|
||||
if (kind === "m") throw new TypeError("Private method is not writable");
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
||||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
||||
};
|
||||
|
||||
__classPrivateFieldIn = function (state, receiver) {
|
||||
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
||||
return typeof state === "function" ? receiver === state : state.has(receiver);
|
||||
};
|
||||
|
||||
__addDisposableResource = function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose, inner;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
dispose = value[Symbol.asyncDispose];
|
||||
}
|
||||
if (dispose === void 0) {
|
||||
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
||||
dispose = value[Symbol.dispose];
|
||||
if (async) inner = dispose;
|
||||
}
|
||||
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
||||
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
||||
env.stack.push({ value: value, dispose: dispose, async: async });
|
||||
}
|
||||
else if (async) {
|
||||
env.stack.push({ async: true });
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
||||
var e = new Error(message);
|
||||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
||||
};
|
||||
|
||||
__disposeResources = function (env) {
|
||||
function fail(e) {
|
||||
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
||||
env.hasError = true;
|
||||
}
|
||||
var r, s = 0;
|
||||
function next() {
|
||||
while (r = env.stack.pop()) {
|
||||
try {
|
||||
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
||||
if (r.dispose) {
|
||||
var result = r.dispose.call(r.value);
|
||||
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
||||
}
|
||||
else s |= 1;
|
||||
}
|
||||
catch (e) {
|
||||
fail(e);
|
||||
}
|
||||
}
|
||||
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
||||
if (env.hasError) throw env.error;
|
||||
}
|
||||
return next();
|
||||
};
|
||||
|
||||
exporter("__extends", __extends);
|
||||
exporter("__assign", __assign);
|
||||
exporter("__rest", __rest);
|
||||
exporter("__decorate", __decorate);
|
||||
exporter("__param", __param);
|
||||
exporter("__esDecorate", __esDecorate);
|
||||
exporter("__runInitializers", __runInitializers);
|
||||
exporter("__propKey", __propKey);
|
||||
exporter("__setFunctionName", __setFunctionName);
|
||||
exporter("__metadata", __metadata);
|
||||
exporter("__awaiter", __awaiter);
|
||||
exporter("__generator", __generator);
|
||||
exporter("__exportStar", __exportStar);
|
||||
exporter("__createBinding", __createBinding);
|
||||
exporter("__values", __values);
|
||||
exporter("__read", __read);
|
||||
exporter("__spread", __spread);
|
||||
exporter("__spreadArrays", __spreadArrays);
|
||||
exporter("__spreadArray", __spreadArray);
|
||||
exporter("__await", __await);
|
||||
exporter("__asyncGenerator", __asyncGenerator);
|
||||
exporter("__asyncDelegator", __asyncDelegator);
|
||||
exporter("__asyncValues", __asyncValues);
|
||||
exporter("__makeTemplateObject", __makeTemplateObject);
|
||||
exporter("__importStar", __importStar);
|
||||
exporter("__importDefault", __importDefault);
|
||||
exporter("__classPrivateFieldGet", __classPrivateFieldGet);
|
||||
exporter("__classPrivateFieldSet", __classPrivateFieldSet);
|
||||
exporter("__classPrivateFieldIn", __classPrivateFieldIn);
|
||||
exporter("__addDisposableResource", __addDisposableResource);
|
||||
exporter("__disposeResources", __disposeResources);
|
||||
});
|
||||
88
node_modules/remark-slate-transformer/package.json
generated
vendored
Normal file
88
node_modules/remark-slate-transformer/package.json
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"name": "remark-slate-transformer",
|
||||
"version": "0.7.5",
|
||||
"description": "remark plugin to transform remark syntax tree (mdast) to Slate document tree, and vice versa. Made for WYSIWYG markdown editor.",
|
||||
"main": "lib/index.js",
|
||||
"module": "lib/index.mjs",
|
||||
"types": "lib/index.d.ts",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"test": "jest",
|
||||
"tsc": "tsc -p . --noEmit",
|
||||
"storybook": "storybook dev -p 6006",
|
||||
"storybook:build": "storybook build",
|
||||
"storybook:test": "concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"npm run storybook -- --quiet --no-open\" \"wait-on tcp:6006 && test-storybook\"",
|
||||
"prepublishOnly": "rimraf lib && npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/mdast": "^3.0.10",
|
||||
"mdast-util-math": "^2.0.1",
|
||||
"tslib": "^2.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.21.5",
|
||||
"@babel/preset-env": "7.21.5",
|
||||
"@babel/preset-typescript": "7.21.5",
|
||||
"@rollup/plugin-typescript": "11.1.1",
|
||||
"@storybook/addon-docs": "7.0.7",
|
||||
"@storybook/react": "7.0.7",
|
||||
"@storybook/react-vite": "7.0.7",
|
||||
"@storybook/test-runner": "0.10.0",
|
||||
"@types/slate_legacy": "npm:@types/slate@0.47.7",
|
||||
"@types/slate-react_legacy": "npm:@types/slate-react@0.22.9",
|
||||
"@types/unist": "2.0.6",
|
||||
"babel-jest": "29.0.2",
|
||||
"concurrently": "7.6.0",
|
||||
"github-markdown-css": "4.0.0",
|
||||
"jest": "29.0.2",
|
||||
"react": "18.1.0",
|
||||
"react-dom": "18.1.0",
|
||||
"react-is": "18.1.0",
|
||||
"react-syntax-highlighter": "15.5.0",
|
||||
"remark-footnotes": "4.0.1",
|
||||
"remark-frontmatter": "4.0.1",
|
||||
"remark-gfm": "3.0.1",
|
||||
"remark-math": "5.1.1",
|
||||
"remark-parse": "10.0.2",
|
||||
"remark-stringify": "10.0.3",
|
||||
"rimraf": "5.0.1",
|
||||
"rollup": "3.21.3",
|
||||
"slate": "0.93.0",
|
||||
"slate_legacy": "npm:slate@0.47.9",
|
||||
"slate-history": "0.93.0",
|
||||
"slate-react": "0.93.0",
|
||||
"slate-react_legacy": "npm:slate-react@0.22.10",
|
||||
"storybook": "^7.0.4",
|
||||
"typescript": "5.0.4",
|
||||
"unified": "10.1.2",
|
||||
"vite": "4.3.9"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"unified": ">=10.1.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/inokawa/remark-slate-transformer.git"
|
||||
},
|
||||
"keywords": [
|
||||
"unist",
|
||||
"remark",
|
||||
"mdast",
|
||||
"markdown",
|
||||
"slate",
|
||||
"react",
|
||||
"wysiwyg",
|
||||
"richtext",
|
||||
"editor"
|
||||
],
|
||||
"author": "inokawa <stratoooo-taster@yahoo.co.jp> (https://github.com/inokawa/)",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/inokawa/remark-slate-transformer/issues"
|
||||
},
|
||||
"homepage": "https://github.com/inokawa/remark-slate-transformer#readme"
|
||||
}
|
||||
Reference in New Issue
Block a user