@easyv/biz-components 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index.es2.js +2 -2
- package/dist/_virtual/index.es3.js +2 -2
- package/dist/_virtual/index.es4.js +2 -2
- package/dist/components/AiMessageRender/AiMessageRender.d.ts +5 -0
- package/dist/components/AiMessageRender/AiMessageRender.es.js +42 -37
- package/dist/components/AiMessageRender/AiMessageRender.es.js.map +1 -1
- package/dist/components/AiMessageRender/index.less.es.js +197 -0
- package/dist/components/AiMessageRender/index.less.es.js.map +1 -0
- package/dist/components/ShadowDom/ShadowDom.d.ts +2 -0
- package/dist/components/ShadowDom/ShadowDom.es.js +16 -14
- package/dist/components/ShadowDom/ShadowDom.es.js.map +1 -1
- package/dist/node_modules/.pnpm/@easyv_react-icons@6.3.0/node_modules/@easyv/react-icons/dist/index.esm.es.js +64 -89
- package/dist/node_modules/.pnpm/@easyv_react-icons@6.3.0/node_modules/@easyv/react-icons/dist/index.esm.es.js.map +1 -1
- package/dist/node_modules/.pnpm/ccount@2.0.1/node_modules/ccount/index.es.js +13 -0
- package/dist/node_modules/.pnpm/ccount@2.0.1/node_modules/ccount/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/classnames@2.3.2/node_modules/classnames/index.es.js +1 -1
- package/dist/node_modules/.pnpm/escape-string-regexp@5.0.0/node_modules/escape-string-regexp/index.es.js +9 -0
- package/dist/node_modules/.pnpm/escape-string-regexp@5.0.0/node_modules/escape-string-regexp/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/longest-streak@3.1.0/node_modules/longest-streak/index.es.js +13 -0
- package/dist/node_modules/.pnpm/longest-streak@3.1.0/node_modules/longest-streak/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/markdown-table@3.0.4/node_modules/markdown-table/index.es.js +76 -0
- package/dist/node_modules/.pnpm/markdown-table@3.0.4/node_modules/markdown-table/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-find-and-replace@3.0.2/node_modules/mdast-util-find-and-replace/lib/index.es.js +71 -0
- package/dist/node_modules/.pnpm/mdast-util-find-and-replace@3.0.2/node_modules/mdast-util-find-and-replace/lib/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-gfm-autolink-literal@2.0.1/node_modules/mdast-util-gfm-autolink-literal/lib/index.es.js +131 -0
- package/dist/node_modules/.pnpm/mdast-util-gfm-autolink-literal@2.0.1/node_modules/mdast-util-gfm-autolink-literal/lib/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-gfm-footnote@2.1.0/node_modules/mdast-util-gfm-footnote/lib/index.es.js +96 -0
- package/dist/node_modules/.pnpm/mdast-util-gfm-footnote@2.1.0/node_modules/mdast-util-gfm-footnote/lib/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-gfm-strikethrough@2.0.0/node_modules/mdast-util-gfm-strikethrough/lib/index.es.js +51 -0
- package/dist/node_modules/.pnpm/mdast-util-gfm-strikethrough@2.0.0/node_modules/mdast-util-gfm-strikethrough/lib/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-gfm-table@2.0.0/node_modules/mdast-util-gfm-table/lib/index.es.js +136 -0
- package/dist/node_modules/.pnpm/mdast-util-gfm-table@2.0.0/node_modules/mdast-util-gfm-table/lib/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-gfm-task-list-item@2.0.0/node_modules/mdast-util-gfm-task-list-item/lib/index.es.js +59 -0
- package/dist/node_modules/.pnpm/mdast-util-gfm-task-list-item@2.0.0/node_modules/mdast-util-gfm-task-list-item/lib/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-gfm@3.1.0/node_modules/mdast-util-gfm/lib/index.es.js +30 -0
- package/dist/node_modules/.pnpm/mdast-util-gfm@3.1.0/node_modules/mdast-util-gfm/lib/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-phrasing@4.1.0/node_modules/mdast-util-phrasing/lib/index.es.js +31 -0
- package/dist/node_modules/.pnpm/mdast-util-phrasing@4.1.0/node_modules/mdast-util-phrasing/lib/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/blockquote.es.js +16 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/blockquote.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/break.es.js +14 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/break.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/code.es.js +45 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/code.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/definition.es.js +35 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/definition.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/emphasis.es.js +34 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/emphasis.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/heading.es.js +35 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/heading.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/html.es.js +11 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/html.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/image-reference.es.js +28 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/image-reference.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/image.es.js +34 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/image.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/index.es.js +45 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/inline-code.es.js +23 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/inline-code.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/link-reference.es.js +28 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/link-reference.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/link.es.js +51 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/link.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/list-item.es.js +23 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/list-item.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/list.es.js +36 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/list.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/paragraph.es.js +8 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/paragraph.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/root.es.js +10 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/root.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/strong.es.js +34 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/strong.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/text.es.js +7 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/text.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.es.js +10 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.es.js +12 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.es.js +19 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-bullet.es.js +12 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-bullet.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.es.js +12 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-fence.es.js +12 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-fence.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.es.js +12 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-quote.es.js +12 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-quote.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.es.js +12 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-rule.es.js +12 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-rule.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-strong.es.js +12 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-strong.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.es.js +7 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/encode-info.es.js +38 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/encode-info.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.es.js +10 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.es.js +14 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.es.js +16 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.es.js.map +1 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.es.js +16 -0
- package/dist/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.es.js.map +1 -0
- package/dist/node_modules/.pnpm/micromark-extension-gfm-autolink-literal@2.1.0/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.es.js +194 -0
- package/dist/node_modules/.pnpm/micromark-extension-gfm-autolink-literal@2.1.0/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.es.js.map +1 -0
- package/dist/node_modules/.pnpm/micromark-extension-gfm-footnote@2.1.0/node_modules/micromark-extension-gfm-footnote/lib/syntax.es.js +193 -0
- package/dist/node_modules/.pnpm/micromark-extension-gfm-footnote@2.1.0/node_modules/micromark-extension-gfm-footnote/lib/syntax.es.js.map +1 -0
- package/dist/node_modules/.pnpm/micromark-extension-gfm-strikethrough@2.1.0/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.es.js +68 -0
- package/dist/node_modules/.pnpm/micromark-extension-gfm-strikethrough@2.1.0/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.es.js.map +1 -0
- package/dist/node_modules/.pnpm/micromark-extension-gfm-table@2.1.1/node_modules/micromark-extension-gfm-table/lib/edit-map.es.js +72 -0
- package/dist/node_modules/.pnpm/micromark-extension-gfm-table@2.1.1/node_modules/micromark-extension-gfm-table/lib/edit-map.es.js.map +1 -0
- package/dist/node_modules/.pnpm/micromark-extension-gfm-table@2.1.1/node_modules/micromark-extension-gfm-table/lib/infer.es.js +24 -0
- package/dist/node_modules/.pnpm/micromark-extension-gfm-table@2.1.1/node_modules/micromark-extension-gfm-table/lib/infer.es.js.map +1 -0
- package/dist/node_modules/.pnpm/micromark-extension-gfm-table@2.1.1/node_modules/micromark-extension-gfm-table/lib/syntax.es.js +146 -0
- package/dist/node_modules/.pnpm/micromark-extension-gfm-table@2.1.1/node_modules/micromark-extension-gfm-table/lib/syntax.es.js.map +1 -0
- package/dist/node_modules/.pnpm/micromark-extension-gfm-task-list-item@2.1.0/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.es.js +46 -0
- package/dist/node_modules/.pnpm/micromark-extension-gfm-task-list-item@2.1.0/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.es.js.map +1 -0
- package/dist/node_modules/.pnpm/micromark-extension-gfm@3.0.0/node_modules/micromark-extension-gfm/index.es.js +19 -0
- package/dist/node_modules/.pnpm/micromark-extension-gfm@3.0.0/node_modules/micromark-extension-gfm/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.es.js +1 -1
- package/dist/node_modules/.pnpm/remark-gfm@4.0.1/node_modules/remark-gfm/lib/index.es.js +14 -0
- package/dist/node_modules/.pnpm/remark-gfm@4.0.1/node_modules/remark-gfm/lib/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/style-to-js@1.1.16/node_modules/style-to-js/cjs/index.es.js +1 -1
- package/dist/node_modules/.pnpm/style-to-object@1.0.8/node_modules/style-to-object/cjs/index.es.js +1 -1
- package/package.json +5 -2
- package/dist/components/AiMessageRender/index.css.es.js +0 -17
- package/dist/components/AiMessageRender/index.css.es.js.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function r(i, e) {
|
|
2
|
+
const t = String(i);
|
|
3
|
+
if (typeof e != "string")
|
|
4
|
+
throw new TypeError("Expected character");
|
|
5
|
+
let o = 0, n = t.indexOf(e);
|
|
6
|
+
for (; n !== -1; )
|
|
7
|
+
o++, n = t.indexOf(e, n + e.length);
|
|
8
|
+
return o;
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
r as ccount
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../../../../../../node_modules/.pnpm/ccount@2.0.1/node_modules/ccount/index.js"],"sourcesContent":["/**\n * Count how often a character (or substring) is used in a string.\n *\n * @param {string} value\n * Value to search in.\n * @param {string} character\n * Character (or substring) to look for.\n * @return {number}\n * Number of times `character` occurred in `value`.\n */\nexport function ccount(value, character) {\n const source = String(value)\n\n if (typeof character !== 'string') {\n throw new TypeError('Expected character')\n }\n\n let count = 0\n let index = source.indexOf(character)\n\n while (index !== -1) {\n count++\n index = source.indexOf(character, index + character.length)\n }\n\n return count\n}\n"],"names":["ccount","value","character","source","count","index"],"mappings":"AAUO,SAASA,EAAOC,GAAOC,GAAW;AACvC,QAAMC,IAAS,OAAOF,CAAK;AAE3B,MAAI,OAAOC,KAAc;AACvB,UAAM,IAAI,UAAU,oBAAoB;AAG1C,MAAIE,IAAQ,GACRC,IAAQF,EAAO,QAAQD,CAAS;AAEpC,SAAOG,MAAU;AACf,IAAAD,KACAC,IAAQF,EAAO,QAAQD,GAAWG,IAAQH,EAAU,MAAM;AAG5D,SAAOE;AACT;","x_google_ignoreList":[0]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDefaultExportFromCjs as u } from "../../../../../_virtual/_commonjsHelpers.es.js";
|
|
2
|
-
import { __module as f } from "../../../../../_virtual/index.
|
|
2
|
+
import { __module as f } from "../../../../../_virtual/index.es3.js";
|
|
3
3
|
/*!
|
|
4
4
|
Copyright (c) 2018 Jed Watson.
|
|
5
5
|
Licensed under the MIT License (MIT), see
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../../../../../../node_modules/.pnpm/escape-string-regexp@5.0.0/node_modules/escape-string-regexp/index.js"],"sourcesContent":["export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n"],"names":["escapeStringRegexp","string"],"mappings":"AAAe,SAASA,EAAmBC,GAAQ;AAClD,MAAI,OAAOA,KAAW;AACrB,UAAM,IAAI,UAAU,mBAAmB;AAKxC,SAAOA,EACL,QAAQ,uBAAuB,MAAM,EACrC,QAAQ,MAAM,OAAO;AACxB;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function f(l, t) {
|
|
2
|
+
const i = String(l);
|
|
3
|
+
let e = i.indexOf(t), n = e, o = 0, r = 0;
|
|
4
|
+
if (typeof t != "string")
|
|
5
|
+
throw new TypeError("Expected substring");
|
|
6
|
+
for (; e !== -1; )
|
|
7
|
+
e === n ? ++o > r && (r = o) : o = 1, n = e + t.length, e = i.indexOf(t, n);
|
|
8
|
+
return r;
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
f as longestStreak
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.es.js.map
|
package/dist/node_modules/.pnpm/longest-streak@3.1.0/node_modules/longest-streak/index.es.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../../../../../../node_modules/.pnpm/longest-streak@3.1.0/node_modules/longest-streak/index.js"],"sourcesContent":["/**\n * Get the count of the longest repeating streak of `substring` in `value`.\n *\n * @param {string} value\n * Content to search in.\n * @param {string} substring\n * Substring to look for, typically one character.\n * @returns {number}\n * Count of most frequent adjacent `substring`s in `value`.\n */\nexport function longestStreak(value, substring) {\n const source = String(value)\n let index = source.indexOf(substring)\n let expected = index\n let count = 0\n let max = 0\n\n if (typeof substring !== 'string') {\n throw new TypeError('Expected substring')\n }\n\n while (index !== -1) {\n if (index === expected) {\n if (++count > max) {\n max = count\n }\n } else {\n count = 1\n }\n\n expected = index + substring.length\n index = source.indexOf(substring, expected)\n }\n\n return max\n}\n"],"names":["longestStreak","value","substring","source","index","expected","count","max"],"mappings":"AAUO,SAASA,EAAcC,GAAOC,GAAW;AAC9C,QAAMC,IAAS,OAAOF,CAAK;AAC3B,MAAIG,IAAQD,EAAO,QAAQD,CAAS,GAChCG,IAAWD,GACXE,IAAQ,GACRC,IAAM;AAEV,MAAI,OAAOL,KAAc;AACvB,UAAM,IAAI,UAAU,oBAAoB;AAG1C,SAAOE,MAAU;AACf,IAAIA,MAAUC,IACR,EAAEC,IAAQC,MACZA,IAAMD,KAGRA,IAAQ,GAGVD,IAAWD,IAAQF,EAAU,QAC7BE,IAAQD,EAAO,QAAQD,GAAWG,CAAQ;AAG5C,SAAOE;AACT;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
function C(i) {
|
|
2
|
+
return i.length;
|
|
3
|
+
}
|
|
4
|
+
function L(i, f) {
|
|
5
|
+
const n = f || {}, d = (n.align || []).concat(), y = n.stringLength || C, p = [], u = [], w = [], a = [];
|
|
6
|
+
let g = 0, s = -1;
|
|
7
|
+
for (; ++s < i.length; ) {
|
|
8
|
+
const r = [], c = [];
|
|
9
|
+
let t = -1;
|
|
10
|
+
for (i[s].length > g && (g = i[s].length); ++t < i[s].length; ) {
|
|
11
|
+
const l = I(i[s][t]);
|
|
12
|
+
if (n.alignDelimiters !== !1) {
|
|
13
|
+
const o = y(l);
|
|
14
|
+
c[t] = o, (a[t] === void 0 || o > a[t]) && (a[t] = o);
|
|
15
|
+
}
|
|
16
|
+
r.push(l);
|
|
17
|
+
}
|
|
18
|
+
u[s] = r, w[s] = c;
|
|
19
|
+
}
|
|
20
|
+
let e = -1;
|
|
21
|
+
if (typeof d == "object" && "length" in d)
|
|
22
|
+
for (; ++e < g; )
|
|
23
|
+
p[e] = S(d[e]);
|
|
24
|
+
else {
|
|
25
|
+
const r = S(d);
|
|
26
|
+
for (; ++e < g; )
|
|
27
|
+
p[e] = r;
|
|
28
|
+
}
|
|
29
|
+
e = -1;
|
|
30
|
+
const z = [], x = [];
|
|
31
|
+
for (; ++e < g; ) {
|
|
32
|
+
const r = p[e];
|
|
33
|
+
let c = "", t = "";
|
|
34
|
+
r === 99 ? (c = ":", t = ":") : r === 108 ? c = ":" : r === 114 && (t = ":");
|
|
35
|
+
let l = n.alignDelimiters === !1 ? 1 : Math.max(
|
|
36
|
+
1,
|
|
37
|
+
a[e] - c.length - t.length
|
|
38
|
+
);
|
|
39
|
+
const o = c + "-".repeat(l) + t;
|
|
40
|
+
n.alignDelimiters !== !1 && (l = c.length + l + t.length, l > a[e] && (a[e] = l), x[e] = l), z[e] = o;
|
|
41
|
+
}
|
|
42
|
+
u.splice(1, 0, z), w.splice(1, 0, x), s = -1;
|
|
43
|
+
const D = [];
|
|
44
|
+
for (; ++s < u.length; ) {
|
|
45
|
+
const r = u[s], c = w[s];
|
|
46
|
+
e = -1;
|
|
47
|
+
const t = [];
|
|
48
|
+
for (; ++e < g; ) {
|
|
49
|
+
const l = r[e] || "";
|
|
50
|
+
let o = "", m = "";
|
|
51
|
+
if (n.alignDelimiters !== !1) {
|
|
52
|
+
const h = a[e] - (c[e] || 0), j = p[e];
|
|
53
|
+
j === 114 ? o = " ".repeat(h) : j === 99 ? h % 2 ? (o = " ".repeat(h / 2 + 0.5), m = " ".repeat(h / 2 - 0.5)) : (o = " ".repeat(h / 2), m = o) : m = " ".repeat(h);
|
|
54
|
+
}
|
|
55
|
+
n.delimiterStart !== !1 && !e && t.push("|"), n.padding !== !1 && // Don’t add the opening space if we’re not aligning and the cell is
|
|
56
|
+
// empty: there will be a closing space.
|
|
57
|
+
!(n.alignDelimiters === !1 && l === "") && (n.delimiterStart !== !1 || e) && t.push(" "), n.alignDelimiters !== !1 && t.push(o), t.push(l), n.alignDelimiters !== !1 && t.push(m), n.padding !== !1 && t.push(" "), (n.delimiterEnd !== !1 || e !== g - 1) && t.push("|");
|
|
58
|
+
}
|
|
59
|
+
D.push(
|
|
60
|
+
n.delimiterEnd === !1 ? t.join("").replace(/ +$/, "") : t.join("")
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
return D.join(`
|
|
64
|
+
`);
|
|
65
|
+
}
|
|
66
|
+
function I(i) {
|
|
67
|
+
return i == null ? "" : String(i);
|
|
68
|
+
}
|
|
69
|
+
function S(i) {
|
|
70
|
+
const f = typeof i == "string" ? i.codePointAt(0) : 0;
|
|
71
|
+
return f === 67 || f === 99 ? 99 : f === 76 || f === 108 ? 108 : f === 82 || f === 114 ? 114 : 0;
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
L as markdownTable
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=index.es.js.map
|
package/dist/node_modules/.pnpm/markdown-table@3.0.4/node_modules/markdown-table/index.es.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../../../../../../node_modules/.pnpm/markdown-table@3.0.4/node_modules/markdown-table/index.js"],"sourcesContent":["// To do: next major: remove.\n/**\n * @typedef {Options} MarkdownTableOptions\n * Configuration.\n */\n\n/**\n * @typedef Options\n * Configuration.\n * @property {boolean | null | undefined} [alignDelimiters=true]\n * Whether to align the delimiters (default: `true`);\n * they are aligned by default:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * Pass `false` to make them staggered:\n *\n * ```markdown\n * | Alpha | B |\n * | - | - |\n * | C | Delta |\n * ```\n * @property {ReadonlyArray<string | null | undefined> | string | null | undefined} [align]\n * How to align columns (default: `''`);\n * one style for all columns or styles for their respective columns;\n * each style is either `'l'` (left), `'r'` (right), or `'c'` (center);\n * other values are treated as `''`, which doesn’t place the colon in the\n * alignment row but does align left;\n * *only the lowercased first character is used, so `Right` is fine.*\n * @property {boolean | null | undefined} [delimiterEnd=true]\n * Whether to end each row with the delimiter (default: `true`).\n *\n * > 👉 **Note**: please don’t use this: it could create fragile structures\n * > that aren’t understandable to some markdown parsers.\n *\n * When `true`, there are ending delimiters:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there are no ending delimiters:\n *\n * ```markdown\n * | Alpha | B\n * | ----- | -----\n * | C | Delta\n * ```\n * @property {boolean | null | undefined} [delimiterStart=true]\n * Whether to begin each row with the delimiter (default: `true`).\n *\n * > 👉 **Note**: please don’t use this: it could create fragile structures\n * > that aren’t understandable to some markdown parsers.\n *\n * When `true`, there are starting delimiters:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there are no starting delimiters:\n *\n * ```markdown\n * Alpha | B |\n * ----- | ----- |\n * C | Delta |\n * ```\n * @property {boolean | null | undefined} [padding=true]\n * Whether to add a space of padding between delimiters and cells\n * (default: `true`).\n *\n * When `true`, there is padding:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there is no padding:\n *\n * ```markdown\n * |Alpha|B |\n * |-----|-----|\n * |C |Delta|\n * ```\n * @property {((value: string) => number) | null | undefined} [stringLength]\n * Function to detect the length of table cell content (optional);\n * this is used when aligning the delimiters (`|`) between table cells;\n * full-width characters and emoji mess up delimiter alignment when viewing\n * the markdown source;\n * to fix this, you can pass this function,\n * which receives the cell content and returns its “visible” size;\n * note that what is and isn’t visible depends on where the text is displayed.\n *\n * Without such a function, the following:\n *\n * ```js\n * markdownTable([\n * ['Alpha', 'Bravo'],\n * ['中文', 'Charlie'],\n * ['👩❤️👩', 'Delta']\n * ])\n * ```\n *\n * Yields:\n *\n * ```markdown\n * | Alpha | Bravo |\n * | - | - |\n * | 中文 | Charlie |\n * | 👩❤️👩 | Delta |\n * ```\n *\n * With [`string-width`](https://github.com/sindresorhus/string-width):\n *\n * ```js\n * import stringWidth from 'string-width'\n *\n * markdownTable(\n * [\n * ['Alpha', 'Bravo'],\n * ['中文', 'Charlie'],\n * ['👩❤️👩', 'Delta']\n * ],\n * {stringLength: stringWidth}\n * )\n * ```\n *\n * Yields:\n *\n * ```markdown\n * | Alpha | Bravo |\n * | ----- | ------- |\n * | 中文 | Charlie |\n * | 👩❤️👩 | Delta |\n * ```\n */\n\n/**\n * @param {string} value\n * Cell value.\n * @returns {number}\n * Cell size.\n */\nfunction defaultStringLength(value) {\n return value.length\n}\n\n/**\n * Generate a markdown\n * ([GFM](https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables))\n * table.\n *\n * @param {ReadonlyArray<ReadonlyArray<string | null | undefined>>} table\n * Table data (matrix of strings).\n * @param {Readonly<Options> | null | undefined} [options]\n * Configuration (optional).\n * @returns {string}\n * Result.\n */\nexport function markdownTable(table, options) {\n const settings = options || {}\n // To do: next major: change to spread.\n const align = (settings.align || []).concat()\n const stringLength = settings.stringLength || defaultStringLength\n /** @type {Array<number>} Character codes as symbols for alignment per column. */\n const alignments = []\n /** @type {Array<Array<string>>} Cells per row. */\n const cellMatrix = []\n /** @type {Array<Array<number>>} Sizes of each cell per row. */\n const sizeMatrix = []\n /** @type {Array<number>} */\n const longestCellByColumn = []\n let mostCellsPerRow = 0\n let rowIndex = -1\n\n // This is a superfluous loop if we don’t align delimiters, but otherwise we’d\n // do superfluous work when aligning, so optimize for aligning.\n while (++rowIndex < table.length) {\n /** @type {Array<string>} */\n const row = []\n /** @type {Array<number>} */\n const sizes = []\n let columnIndex = -1\n\n if (table[rowIndex].length > mostCellsPerRow) {\n mostCellsPerRow = table[rowIndex].length\n }\n\n while (++columnIndex < table[rowIndex].length) {\n const cell = serialize(table[rowIndex][columnIndex])\n\n if (settings.alignDelimiters !== false) {\n const size = stringLength(cell)\n sizes[columnIndex] = size\n\n if (\n longestCellByColumn[columnIndex] === undefined ||\n size > longestCellByColumn[columnIndex]\n ) {\n longestCellByColumn[columnIndex] = size\n }\n }\n\n row.push(cell)\n }\n\n cellMatrix[rowIndex] = row\n sizeMatrix[rowIndex] = sizes\n }\n\n // Figure out which alignments to use.\n let columnIndex = -1\n\n if (typeof align === 'object' && 'length' in align) {\n while (++columnIndex < mostCellsPerRow) {\n alignments[columnIndex] = toAlignment(align[columnIndex])\n }\n } else {\n const code = toAlignment(align)\n\n while (++columnIndex < mostCellsPerRow) {\n alignments[columnIndex] = code\n }\n }\n\n // Inject the alignment row.\n columnIndex = -1\n /** @type {Array<string>} */\n const row = []\n /** @type {Array<number>} */\n const sizes = []\n\n while (++columnIndex < mostCellsPerRow) {\n const code = alignments[columnIndex]\n let before = ''\n let after = ''\n\n if (code === 99 /* `c` */) {\n before = ':'\n after = ':'\n } else if (code === 108 /* `l` */) {\n before = ':'\n } else if (code === 114 /* `r` */) {\n after = ':'\n }\n\n // There *must* be at least one hyphen-minus in each alignment cell.\n let size =\n settings.alignDelimiters === false\n ? 1\n : Math.max(\n 1,\n longestCellByColumn[columnIndex] - before.length - after.length\n )\n\n const cell = before + '-'.repeat(size) + after\n\n if (settings.alignDelimiters !== false) {\n size = before.length + size + after.length\n\n if (size > longestCellByColumn[columnIndex]) {\n longestCellByColumn[columnIndex] = size\n }\n\n sizes[columnIndex] = size\n }\n\n row[columnIndex] = cell\n }\n\n // Inject the alignment row.\n cellMatrix.splice(1, 0, row)\n sizeMatrix.splice(1, 0, sizes)\n\n rowIndex = -1\n /** @type {Array<string>} */\n const lines = []\n\n while (++rowIndex < cellMatrix.length) {\n const row = cellMatrix[rowIndex]\n const sizes = sizeMatrix[rowIndex]\n columnIndex = -1\n /** @type {Array<string>} */\n const line = []\n\n while (++columnIndex < mostCellsPerRow) {\n const cell = row[columnIndex] || ''\n let before = ''\n let after = ''\n\n if (settings.alignDelimiters !== false) {\n const size =\n longestCellByColumn[columnIndex] - (sizes[columnIndex] || 0)\n const code = alignments[columnIndex]\n\n if (code === 114 /* `r` */) {\n before = ' '.repeat(size)\n } else if (code === 99 /* `c` */) {\n if (size % 2) {\n before = ' '.repeat(size / 2 + 0.5)\n after = ' '.repeat(size / 2 - 0.5)\n } else {\n before = ' '.repeat(size / 2)\n after = before\n }\n } else {\n after = ' '.repeat(size)\n }\n }\n\n if (settings.delimiterStart !== false && !columnIndex) {\n line.push('|')\n }\n\n if (\n settings.padding !== false &&\n // Don’t add the opening space if we’re not aligning and the cell is\n // empty: there will be a closing space.\n !(settings.alignDelimiters === false && cell === '') &&\n (settings.delimiterStart !== false || columnIndex)\n ) {\n line.push(' ')\n }\n\n if (settings.alignDelimiters !== false) {\n line.push(before)\n }\n\n line.push(cell)\n\n if (settings.alignDelimiters !== false) {\n line.push(after)\n }\n\n if (settings.padding !== false) {\n line.push(' ')\n }\n\n if (\n settings.delimiterEnd !== false ||\n columnIndex !== mostCellsPerRow - 1\n ) {\n line.push('|')\n }\n }\n\n lines.push(\n settings.delimiterEnd === false\n ? line.join('').replace(/ +$/, '')\n : line.join('')\n )\n }\n\n return lines.join('\\n')\n}\n\n/**\n * @param {string | null | undefined} [value]\n * Value to serialize.\n * @returns {string}\n * Result.\n */\nfunction serialize(value) {\n return value === null || value === undefined ? '' : String(value)\n}\n\n/**\n * @param {string | null | undefined} value\n * Value.\n * @returns {number}\n * Alignment.\n */\nfunction toAlignment(value) {\n const code = typeof value === 'string' ? value.codePointAt(0) : 0\n\n return code === 67 /* `C` */ || code === 99 /* `c` */\n ? 99 /* `c` */\n : code === 76 /* `L` */ || code === 108 /* `l` */\n ? 108 /* `l` */\n : code === 82 /* `R` */ || code === 114 /* `r` */\n ? 114 /* `r` */\n : 0\n}\n"],"names":["defaultStringLength","value","markdownTable","table","options","settings","align","stringLength","alignments","cellMatrix","sizeMatrix","longestCellByColumn","mostCellsPerRow","rowIndex","row","sizes","columnIndex","cell","serialize","size","toAlignment","code","before","after","lines","line"],"mappings":"AAyJA,SAASA,EAAoBC,GAAO;AAClC,SAAOA,EAAM;AACf;AAcO,SAASC,EAAcC,GAAOC,GAAS;AAC5C,QAAMC,IAAWD,KAAW,CAAA,GAEtBE,KAASD,EAAS,SAAS,CAAE,GAAE,OAAM,GACrCE,IAA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mBAAmB,MAAS,CAACW,KACxCS,EAAK,KAAK,GAAG,GAIbpB,EAAS,YAAY;AAAA;AAAA,MAGrB,EAAEA,EAAS,oBAAoB,MAASY,MAAS,QAChDZ,EAAS,mBAAmB,MAASW,MAEtCS,EAAK,KAAK,GAAG,GAGXpB,EAAS,oBAAoB,MAC/BoB,EAAK,KAAKH,CAAM,GAGlBG,EAAK,KAAKR,CAAI,GAEVZ,EAAS,oBAAoB,MAC/BoB,EAAK,KAAKF,CAAK,GAGblB,EAAS,YAAY,MACvBoB,EAAK,KAAK,GAAG,IAIbpB,EAAS,iBAAiB,MAC1BW,MAAgBJ,IAAkB,MAElCa,EAAK,KAAK,GAAG;AAAA,IAErB;AAEI,IAAAD,EAAM;AAAA,MACJnB,EAAS,iBAAiB,KACtBoB,EAAK,KAAK,EAAE,EAAE,QAAQ,OAAO,EAAE,IAC/BA,EAAK,KAAK,EAAE;AAAA,IACtB;AAAA,EACA;AAEE,SAAOD,EAAM,KAAK;AAAA,CAAI;AACxB;AAQA,SAASN,EAAUjB,GAAO;AACxB,SAAOA,KAAU,OAA8B,KAAK,OAAOA,CAAK;AAClE;AAQA,SAASmB,EAAYnB,GAAO;AAC1B,QAAMoB,IAAO,OAAOpB,KAAU,WAAWA,EAAM,YAAY,CAAC,IAAI;AAEhE,SAAOoB,MAAS,MAAgBA,MAAS,KACrC,KACAA,MAAS,MAAgBA,MAAS,MAChC,MACAA,MAAS,MAAgBA,MAAS,MAChC,MACA;AACV;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import b from "../../../../escape-string-regexp@5.0.0/node_modules/escape-string-regexp/index.es.js";
|
|
2
|
+
import { convert as E } from "../../../../unist-util-is@6.0.0/node_modules/unist-util-is/lib/index.es.js";
|
|
3
|
+
import { visitParents as I } from "../../../../unist-util-visit-parents@6.0.1/node_modules/unist-util-visit-parents/lib/index.es.js";
|
|
4
|
+
function q(e, f, a) {
|
|
5
|
+
const p = E((a || {}).ignore || []), x = R(f);
|
|
6
|
+
let d = -1;
|
|
7
|
+
for (; ++d < x.length; )
|
|
8
|
+
I(e, "text", m);
|
|
9
|
+
function m(n, s) {
|
|
10
|
+
let c = -1, t;
|
|
11
|
+
for (; ++c < s.length; ) {
|
|
12
|
+
const u = s[c], r = t ? t.children : void 0;
|
|
13
|
+
if (p(
|
|
14
|
+
u,
|
|
15
|
+
r ? r.indexOf(u) : void 0,
|
|
16
|
+
t
|
|
17
|
+
))
|
|
18
|
+
return;
|
|
19
|
+
t = u;
|
|
20
|
+
}
|
|
21
|
+
if (t)
|
|
22
|
+
return w(n, s);
|
|
23
|
+
}
|
|
24
|
+
function w(n, s) {
|
|
25
|
+
const c = s[s.length - 1], t = x[d][0], u = x[d][1];
|
|
26
|
+
let r = 0;
|
|
27
|
+
const y = c.children.indexOf(n);
|
|
28
|
+
let v = !1, l = [];
|
|
29
|
+
t.lastIndex = 0;
|
|
30
|
+
let o = t.exec(n.value);
|
|
31
|
+
for (; o; ) {
|
|
32
|
+
const h = o.index, A = {
|
|
33
|
+
index: o.index,
|
|
34
|
+
input: o.input,
|
|
35
|
+
stack: [...s, n]
|
|
36
|
+
};
|
|
37
|
+
let i = u(...o, A);
|
|
38
|
+
if (typeof i == "string" && (i = i.length > 0 ? { type: "text", value: i } : void 0), i === !1 ? t.lastIndex = h + 1 : (r !== h && l.push({
|
|
39
|
+
type: "text",
|
|
40
|
+
value: n.value.slice(r, h)
|
|
41
|
+
}), Array.isArray(i) ? l.push(...i) : i && l.push(i), r = h + o[0].length, v = !0), !t.global)
|
|
42
|
+
break;
|
|
43
|
+
o = t.exec(n.value);
|
|
44
|
+
}
|
|
45
|
+
return v ? (r < n.value.length && l.push({ type: "text", value: n.value.slice(r) }), c.children.splice(y, 1, ...l)) : l = [n], y + l.length;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function R(e) {
|
|
49
|
+
const f = [];
|
|
50
|
+
if (!Array.isArray(e))
|
|
51
|
+
throw new TypeError("Expected find and replace tuple or list of tuples");
|
|
52
|
+
const a = !e[0] || Array.isArray(e[0]) ? e : [e];
|
|
53
|
+
let g = -1;
|
|
54
|
+
for (; ++g < a.length; ) {
|
|
55
|
+
const p = a[g];
|
|
56
|
+
f.push([k(p[0]), P(p[1])]);
|
|
57
|
+
}
|
|
58
|
+
return f;
|
|
59
|
+
}
|
|
60
|
+
function k(e) {
|
|
61
|
+
return typeof e == "string" ? new RegExp(b(e), "g") : e;
|
|
62
|
+
}
|
|
63
|
+
function P(e) {
|
|
64
|
+
return typeof e == "function" ? e : function() {
|
|
65
|
+
return e;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
q as findAndReplace
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../../../../../../../node_modules/.pnpm/mdast-util-find-and-replace@3.0.2/node_modules/mdast-util-find-and-replace/lib/index.js"],"sourcesContent":["/**\n * @import {Nodes, Parents, PhrasingContent, Root, Text} from 'mdast'\n * @import {BuildVisitor, Test, VisitorResult} from 'unist-util-visit-parents'\n */\n\n/**\n * @typedef RegExpMatchObject\n * Info on the match.\n * @property {number} index\n * The index of the search at which the result was found.\n * @property {string} input\n * A copy of the search string in the text node.\n * @property {[...Array<Parents>, Text]} stack\n * All ancestors of the text node, where the last node is the text itself.\n *\n * @typedef {RegExp | string} Find\n * Pattern to find.\n *\n * Strings are escaped and then turned into global expressions.\n *\n * @typedef {Array<FindAndReplaceTuple>} FindAndReplaceList\n * Several find and replaces, in array form.\n *\n * @typedef {[Find, Replace?]} FindAndReplaceTuple\n * Find and replace in tuple form.\n *\n * @typedef {ReplaceFunction | string | null | undefined} Replace\n * Thing to replace with.\n *\n * @callback ReplaceFunction\n * Callback called when a search matches.\n * @param {...any} parameters\n * The parameters are the result of corresponding search expression:\n *\n * * `value` (`string`) — whole match\n * * `...capture` (`Array<string>`) — matches from regex capture groups\n * * `match` (`RegExpMatchObject`) — info on the match\n * @returns {Array<PhrasingContent> | PhrasingContent | string | false | null | undefined}\n * Thing to replace with.\n *\n * * when `null`, `undefined`, `''`, remove the match\n * * …or when `false`, do not replace at all\n * * …or when `string`, replace with a text node of that value\n * * …or when `Node` or `Array<Node>`, replace with those nodes\n *\n * @typedef {[RegExp, ReplaceFunction]} Pair\n * Normalized find and replace.\n *\n * @typedef {Array<Pair>} Pairs\n * All find and replaced.\n *\n * @typedef Options\n * Configuration.\n * @property {Test | null | undefined} [ignore]\n * Test for which nodes to ignore (optional).\n */\n\nimport escape from 'escape-string-regexp'\nimport {visitParents} from 'unist-util-visit-parents'\nimport {convert} from 'unist-util-is'\n\n/**\n * Find patterns in a tree and replace them.\n *\n * The algorithm searches the tree in *preorder* for complete values in `Text`\n * nodes.\n * Partial matches are not supported.\n *\n * @param {Nodes} tree\n * Tree to change.\n * @param {FindAndReplaceList | FindAndReplaceTuple} list\n * Patterns to find.\n * @param {Options | null | undefined} [options]\n * Configuration (when `find` is not `Find`).\n * @returns {undefined}\n * Nothing.\n */\nexport function findAndReplace(tree, list, options) {\n const settings = options || {}\n const ignored = convert(settings.ignore || [])\n const pairs = toPairs(list)\n let pairIndex = -1\n\n while (++pairIndex < pairs.length) {\n visitParents(tree, 'text', visitor)\n }\n\n /** @type {BuildVisitor<Root, 'text'>} */\n function visitor(node, parents) {\n let index = -1\n /** @type {Parents | undefined} */\n let grandparent\n\n while (++index < parents.length) {\n const parent = parents[index]\n /** @type {Array<Nodes> | undefined} */\n const siblings = grandparent ? grandparent.children : undefined\n\n if (\n ignored(\n parent,\n siblings ? siblings.indexOf(parent) : undefined,\n grandparent\n )\n ) {\n return\n }\n\n grandparent = parent\n }\n\n if (grandparent) {\n return handler(node, parents)\n }\n }\n\n /**\n * Handle a text node which is not in an ignored parent.\n *\n * @param {Text} node\n * Text node.\n * @param {Array<Parents>} parents\n * Parents.\n * @returns {VisitorResult}\n * Result.\n */\n function handler(node, parents) {\n const parent = parents[parents.length - 1]\n const find = pairs[pairIndex][0]\n const replace = pairs[pairIndex][1]\n let start = 0\n /** @type {Array<Nodes>} */\n const siblings = parent.children\n const index = siblings.indexOf(node)\n let change = false\n /** @type {Array<PhrasingContent>} */\n let nodes = []\n\n find.lastIndex = 0\n\n let match = find.exec(node.value)\n\n while (match) {\n const position = match.index\n /** @type {RegExpMatchObject} */\n const matchObject = {\n index: match.index,\n input: match.input,\n stack: [...parents, node]\n }\n let value = replace(...match, matchObject)\n\n if (typeof value === 'string') {\n value = value.length > 0 ? {type: 'text', value} : undefined\n }\n\n // It wasn’t a match after all.\n if (value === false) {\n // False acts as if there was no match.\n // So we need to reset `lastIndex`, which currently being at the end of\n // the current match, to the beginning.\n find.lastIndex = position + 1\n } else {\n if (start !== position) {\n nodes.push({\n type: 'text',\n value: node.value.slice(start, position)\n })\n }\n\n if (Array.isArray(value)) {\n nodes.push(...value)\n } else if (value) {\n nodes.push(value)\n }\n\n start = position + match[0].length\n change = true\n }\n\n if (!find.global) {\n break\n }\n\n match = find.exec(node.value)\n }\n\n if (change) {\n if (start < node.value.length) {\n nodes.push({type: 'text', value: node.value.slice(start)})\n }\n\n parent.children.splice(index, 1, ...nodes)\n } else {\n nodes = [node]\n }\n\n return index + nodes.length\n }\n}\n\n/**\n * Turn a tuple or a list of tuples into pairs.\n *\n * @param {FindAndReplaceList | FindAndReplaceTuple} tupleOrList\n * Schema.\n * @returns {Pairs}\n * Clean pairs.\n */\nfunction toPairs(tupleOrList) {\n /** @type {Pairs} */\n const result = []\n\n if (!Array.isArray(tupleOrList)) {\n throw new TypeError('Expected find and replace tuple or list of tuples')\n }\n\n /** @type {FindAndReplaceList} */\n // @ts-expect-error: correct.\n const list =\n !tupleOrList[0] || Array.isArray(tupleOrList[0])\n ? tupleOrList\n : [tupleOrList]\n\n let index = -1\n\n while (++index < list.length) {\n const tuple = list[index]\n result.push([toExpression(tuple[0]), toFunction(tuple[1])])\n }\n\n return result\n}\n\n/**\n * Turn a find into an expression.\n *\n * @param {Find} find\n * Find.\n * @returns {RegExp}\n * Expression.\n */\nfunction toExpression(find) {\n return typeof find === 'string' ? new RegExp(escape(find), 'g') : find\n}\n\n/**\n * Turn a replace into a function.\n *\n * @param {Replace} replace\n * Replace.\n * @returns {ReplaceFunction}\n * Function.\n */\nfunction toFunction(replace) {\n return typeof replace === 'function'\n ? replace\n : function () {\n return replace\n }\n}\n"],"names":["findAndReplace","tree","list","options","ignored","convert","pairs","toPairs","pairIndex","visitParents","visitor","node","parents","index","grandparent","parent","siblings","handler","find","replace","start","change","nodes","match","position","matchObject","value","tupleOrList","result","tuple","toExpression","toFunction","escape"],"mappings":";;;AA6EO,SAASA,EAAeC,GAAMC,GAAMC,GAAS;AAElD,QAAMC,IAAUC,GADCF,KAAW,CAAA,GACK,UAAU,CAAE,CAAA,GACvCG,IAAQC,EAAQL,CAAI;AAC1B,MAAIM,IAAY;AAEhB,SAAO,EAAEA,IAAYF,EAAM;AACzB,IAAAG,EAAaR,GAAM,QAAQS,CAAO;AAIpC,WAASA,EAAQC,GAAMC,GAAS;AAC9B,QAAIC,IAAQ,IAERC;AAEJ,WAAO,EAAED,IAAQD,EAAQ,UAAQ;AAC/B,YAAMG,IAASH,EAAQC,CAAK,GAEtBG,IAAWF,IAAcA,EAAY,WAAW;AAEtD,UACEV;AAAA,QACEW;AAAA,QACAC,IAAWA,EAAS,QAAQD,CAAM,IAAI;AAAA,QACtCD;AAAA,MACV;AAEQ;AAGF,MAAAA,IAAcC;AAAA,IACpB;AAEI,QAAID;AACF,aAAOG,EAAQN,GAAMC,CAAO;AAAA,EAElC;AAYE,WAASK,EAAQN,GAAMC,GAAS;AAC9B,UAAMG,IAASH,EAAQA,EAAQ,SAAS,CAAC,GACnCM,IAAOZ,EAAME,CAAS,EAAE,CAAC,GACzBW,IAAUb,EAAME,CAAS,EAAE,CAAC;AAClC,QAAIY,IAAQ;AAGZ,UAAMP,IADWE,EAAO,SACD,QAAQJ,CA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QAAQA,EAAY,CAAC,CAAC,IAC3CA,IACA,CAACA,CAAW;AAElB,MAAId,IAAQ;AAEZ,SAAO,EAAEA,IAAQX,EAAK,UAAQ;AAC5B,UAAM2B,IAAQ3B,EAAKW,CAAK;AACxB,IAAAe,EAAO,KAAK,CAACE,EAAaD,EAAM,CAAC,CAAC,GAAGE,EAAWF,EAAM,CAAC,CAAC,CAAC,CAAC;AAAA,EAC9D;AAEE,SAAOD;AACT;AAUA,SAASE,EAAaZ,GAAM;AAC1B,SAAO,OAAOA,KAAS,WAAW,IAAI,OAAOc,EAAOd,CAAI,GAAG,GAAG,IAAIA;AACpE;AAUA,SAASa,EAAWZ,GAAS;AAC3B,SAAO,OAAOA,KAAY,aACtBA,IACA,WAAY;AACV,WAAOA;AAAA,EACf;AACA;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { ccount as f } from "../../../../ccount@2.0.1/node_modules/ccount/index.es.js";
|
|
2
|
+
import { ok as k } from "../../../../devlop@1.1.0/node_modules/devlop/lib/default.es.js";
|
|
3
|
+
import { unicodeWhitespace as p, unicodePunctuation as d } from "../../../../micromark-util-character@2.1.1/node_modules/micromark-util-character/index.es.js";
|
|
4
|
+
import { findAndReplace as g } from "../../../../mdast-util-find-and-replace@3.0.2/node_modules/mdast-util-find-and-replace/lib/index.es.js";
|
|
5
|
+
const a = "phrasing", u = ["autolink", "link", "image", "label"];
|
|
6
|
+
function b() {
|
|
7
|
+
return {
|
|
8
|
+
transforms: [y],
|
|
9
|
+
enter: {
|
|
10
|
+
literalAutolink: w,
|
|
11
|
+
literalAutolinkEmail: s,
|
|
12
|
+
literalAutolinkHttp: s,
|
|
13
|
+
literalAutolinkWww: s
|
|
14
|
+
},
|
|
15
|
+
exit: {
|
|
16
|
+
literalAutolink: L,
|
|
17
|
+
literalAutolinkEmail: m,
|
|
18
|
+
literalAutolinkHttp: x,
|
|
19
|
+
literalAutolinkWww: A
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function I() {
|
|
24
|
+
return {
|
|
25
|
+
unsafe: [
|
|
26
|
+
{
|
|
27
|
+
character: "@",
|
|
28
|
+
before: "[+\\-.\\w]",
|
|
29
|
+
after: "[\\-.\\w]",
|
|
30
|
+
inConstruct: a,
|
|
31
|
+
notInConstruct: u
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
character: ".",
|
|
35
|
+
before: "[Ww]",
|
|
36
|
+
after: "[\\-.\\w]",
|
|
37
|
+
inConstruct: a,
|
|
38
|
+
notInConstruct: u
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
character: ":",
|
|
42
|
+
before: "[ps]",
|
|
43
|
+
after: "\\/",
|
|
44
|
+
inConstruct: a,
|
|
45
|
+
notInConstruct: u
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function w(t) {
|
|
51
|
+
this.enter({ type: "link", title: null, url: "", children: [] }, t);
|
|
52
|
+
}
|
|
53
|
+
function s(t) {
|
|
54
|
+
this.config.enter.autolinkProtocol.call(this, t);
|
|
55
|
+
}
|
|
56
|
+
function x(t) {
|
|
57
|
+
this.config.exit.autolinkProtocol.call(this, t);
|
|
58
|
+
}
|
|
59
|
+
function A(t) {
|
|
60
|
+
this.config.exit.data.call(this, t);
|
|
61
|
+
const e = this.stack[this.stack.length - 1];
|
|
62
|
+
k(e.type === "link"), e.url = "http://" + this.sliceSerialize(t);
|
|
63
|
+
}
|
|
64
|
+
function m(t) {
|
|
65
|
+
this.config.exit.autolinkEmail.call(this, t);
|
|
66
|
+
}
|
|
67
|
+
function L(t) {
|
|
68
|
+
this.exit(t);
|
|
69
|
+
}
|
|
70
|
+
function y(t) {
|
|
71
|
+
g(
|
|
72
|
+
t,
|
|
73
|
+
[
|
|
74
|
+
[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, P],
|
|
75
|
+
[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)", "gu"), E]
|
|
76
|
+
],
|
|
77
|
+
{ ignore: ["link", "linkReference"] }
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
function P(t, e, i, n, o) {
|
|
81
|
+
let l = "";
|
|
82
|
+
if (!h(o) || (/^w/i.test(e) && (i = e + i, e = "", l = "http://"), !W(i)))
|
|
83
|
+
return !1;
|
|
84
|
+
const r = _(i + n);
|
|
85
|
+
if (!r[0]) return !1;
|
|
86
|
+
const c = {
|
|
87
|
+
type: "link",
|
|
88
|
+
title: null,
|
|
89
|
+
url: l + e + r[0],
|
|
90
|
+
children: [{ type: "text", value: e + r[0] }]
|
|
91
|
+
};
|
|
92
|
+
return r[1] ? [c, { type: "text", value: r[1] }] : c;
|
|
93
|
+
}
|
|
94
|
+
function E(t, e, i, n) {
|
|
95
|
+
return (
|
|
96
|
+
// Not an expected previous character.
|
|
97
|
+
!h(n, !0) || // Label ends in not allowed character.
|
|
98
|
+
/[-\d_]$/.test(i) ? !1 : {
|
|
99
|
+
type: "link",
|
|
100
|
+
title: null,
|
|
101
|
+
url: "mailto:" + e + "@" + i,
|
|
102
|
+
children: [{ type: "text", value: e + "@" + i }]
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
function W(t) {
|
|
107
|
+
const e = t.split(".");
|
|
108
|
+
return !(e.length < 2 || e[e.length - 1] && (/_/.test(e[e.length - 1]) || !/[a-zA-Z\d]/.test(e[e.length - 1])) || e[e.length - 2] && (/_/.test(e[e.length - 2]) || !/[a-zA-Z\d]/.test(e[e.length - 2])));
|
|
109
|
+
}
|
|
110
|
+
function _(t) {
|
|
111
|
+
const e = /[!"&'),.:;<>?\]}]+$/.exec(t);
|
|
112
|
+
if (!e)
|
|
113
|
+
return [t, void 0];
|
|
114
|
+
t = t.slice(0, e.index);
|
|
115
|
+
let i = e[0], n = i.indexOf(")");
|
|
116
|
+
const o = f(t, "(");
|
|
117
|
+
let l = f(t, ")");
|
|
118
|
+
for (; n !== -1 && o > l; )
|
|
119
|
+
t += i.slice(0, n + 1), i = i.slice(n + 1), n = i.indexOf(")"), l++;
|
|
120
|
+
return [t, i];
|
|
121
|
+
}
|
|
122
|
+
function h(t, e) {
|
|
123
|
+
const i = t.input.charCodeAt(t.index - 1);
|
|
124
|
+
return (t.index === 0 || p(i) || d(i)) && // If it’s an email, the previous character should not be a slash.
|
|
125
|
+
(!e || i !== 47);
|
|
126
|
+
}
|
|
127
|
+
export {
|
|
128
|
+
b as gfmAutolinkLiteralFromMarkdown,
|
|
129
|
+
I as gfmAutolinkLiteralToMarkdown
|
|
130
|
+
};
|
|
131
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../../../../../../../node_modules/.pnpm/mdast-util-gfm-autolink-literal@2.0.1/node_modules/mdast-util-gfm-autolink-literal/lib/index.js"],"sourcesContent":["/**\n * @import {RegExpMatchObject, ReplaceFunction} from 'mdast-util-find-and-replace'\n * @import {CompileContext, Extension as FromMarkdownExtension, Handle as FromMarkdownHandle, Transform as FromMarkdownTransform} from 'mdast-util-from-markdown'\n * @import {ConstructName, Options as ToMarkdownExtension} from 'mdast-util-to-markdown'\n * @import {Link, PhrasingContent} from 'mdast'\n */\n\nimport {ccount} from 'ccount'\nimport {ok as assert} from 'devlop'\nimport {unicodePunctuation, unicodeWhitespace} from 'micromark-util-character'\nimport {findAndReplace} from 'mdast-util-find-and-replace'\n\n/** @type {ConstructName} */\nconst inConstruct = 'phrasing'\n/** @type {Array<ConstructName>} */\nconst notInConstruct = ['autolink', 'link', 'image', 'label']\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM autolink\n * literals in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM autolink literals.\n */\nexport function gfmAutolinkLiteralFromMarkdown() {\n return {\n transforms: [transformGfmAutolinkLiterals],\n enter: {\n literalAutolink: enterLiteralAutolink,\n literalAutolinkEmail: enterLiteralAutolinkValue,\n literalAutolinkHttp: enterLiteralAutolinkValue,\n literalAutolinkWww: enterLiteralAutolinkValue\n },\n exit: {\n literalAutolink: exitLiteralAutolink,\n literalAutolinkEmail: exitLiteralAutolinkEmail,\n literalAutolinkHttp: exitLiteralAutolinkHttp,\n literalAutolinkWww: exitLiteralAutolinkWww\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM autolink\n * literals in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM autolink literals.\n */\nexport function gfmAutolinkLiteralToMarkdown() {\n return {\n unsafe: [\n {\n character: '@',\n before: '[+\\\\-.\\\\w]',\n after: '[\\\\-.\\\\w]',\n inConstruct,\n notInConstruct\n },\n {\n character: '.',\n before: '[Ww]',\n after: '[\\\\-.\\\\w]',\n inConstruct,\n notInConstruct\n },\n {\n character: ':',\n before: '[ps]',\n after: '\\\\/',\n inConstruct,\n notInConstruct\n }\n ]\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterLiteralAutolink(token) {\n this.enter({type: 'link', title: null, url: '', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterLiteralAutolinkValue(token) {\n this.config.enter.autolinkProtocol.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkHttp(token) {\n this.config.exit.autolinkProtocol.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkWww(token) {\n this.config.exit.data.call(this, token)\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'link')\n node.url = 'http://' + this.sliceSerialize(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkEmail(token) {\n this.config.exit.autolinkEmail.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolink(token) {\n this.exit(token)\n}\n\n/** @type {FromMarkdownTransform} */\nfunction transformGfmAutolinkLiterals(tree) {\n findAndReplace(\n tree,\n [\n [/(https?:\\/\\/|www(?=\\.))([-.\\w]+)([^ \\t\\r\\n]*)/gi, findUrl],\n [/(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)/gu, findEmail]\n ],\n {ignore: ['link', 'linkReference']}\n )\n}\n\n/**\n * @type {ReplaceFunction}\n * @param {string} _\n * @param {string} protocol\n * @param {string} domain\n * @param {string} path\n * @param {RegExpMatchObject} match\n * @returns {Array<PhrasingContent> | Link | false}\n */\n// eslint-disable-next-line max-params\nfunction findUrl(_, protocol, domain, path, match) {\n let prefix = ''\n\n // Not an expected previous character.\n if (!previous(match)) {\n return false\n }\n\n // Treat `www` as part of the domain.\n if (/^w/i.test(protocol)) {\n domain = protocol + domain\n protocol = ''\n prefix = 'http://'\n }\n\n if (!isCorrectDomain(domain)) {\n return false\n }\n\n const parts = splitUrl(domain + path)\n\n if (!parts[0]) return false\n\n /** @type {Link} */\n const result = {\n type: 'link',\n title: null,\n url: prefix + protocol + parts[0],\n children: [{type: 'text', value: protocol + parts[0]}]\n }\n\n if (parts[1]) {\n return [result, {type: 'text', value: parts[1]}]\n }\n\n return result\n}\n\n/**\n * @type {ReplaceFunction}\n * @param {string} _\n * @param {string} atext\n * @param {string} label\n * @param {RegExpMatchObject} match\n * @returns {Link | false}\n */\nfunction findEmail(_, atext, label, match) {\n if (\n // Not an expected previous character.\n !previous(match, true) ||\n // Label ends in not allowed character.\n /[-\\d_]$/.test(label)\n ) {\n return false\n }\n\n return {\n type: 'link',\n title: null,\n url: 'mailto:' + atext + '@' + label,\n children: [{type: 'text', value: atext + '@' + label}]\n }\n}\n\n/**\n * @param {string} domain\n * @returns {boolean}\n */\nfunction isCorrectDomain(domain) {\n const parts = domain.split('.')\n\n if (\n parts.length < 2 ||\n (parts[parts.length - 1] &&\n (/_/.test(parts[parts.length - 1]) ||\n !/[a-zA-Z\\d]/.test(parts[parts.length - 1]))) ||\n (parts[parts.length - 2] &&\n (/_/.test(parts[parts.length - 2]) ||\n !/[a-zA-Z\\d]/.test(parts[parts.length - 2])))\n ) {\n return false\n }\n\n return true\n}\n\n/**\n * @param {string} url\n * @returns {[string, string | undefined]}\n */\nfunction splitUrl(url) {\n const trailExec = /[!\"&'),.:;<>?\\]}]+$/.exec(url)\n\n if (!trailExec) {\n return [url, undefined]\n }\n\n url = url.slice(0, trailExec.index)\n\n let trail = trailExec[0]\n let closingParenIndex = trail.indexOf(')')\n const openingParens = ccount(url, '(')\n let closingParens = ccount(url, ')')\n\n while (closingParenIndex !== -1 && openingParens > closingParens) {\n url += trail.slice(0, closingParenIndex + 1)\n trail = trail.slice(closingParenIndex + 1)\n closingParenIndex = trail.indexOf(')')\n closingParens++\n }\n\n return [url, trail]\n}\n\n/**\n * @param {RegExpMatchObject} match\n * @param {boolean | null | undefined} [email=false]\n * @returns {boolean}\n */\nfunction previous(match, email) {\n const code = match.input.charCodeAt(match.index - 1)\n\n return (\n (match.index === 0 ||\n unicodeWhitespace(code) ||\n unicodePunctuation(code)) &&\n // If it’s an email, the previous character should not be a slash.\n (!email || code !== 47)\n )\n}\n"],"names":["inConstruct","notInConstruct","gfmAutolinkLiteralFromMarkdown","transformGfmAutolinkLiterals","enterLiteralAutolink","enterLiteralAutolinkValue","exitLiteralAutolink","exitLiteralAutolinkEmail","exitLiteralAutolinkHttp","exitLiteralAutolinkWww","gfmAutolinkLiteralToMarkdown","token","node","assert","tree","findAndReplace","findUrl","findEmail","_","protocol","domain","path","match","prefix","previous","isCorrectDomain","parts","splitUrl","result","atext","label","url","trailExec","trail","closingParenIndex","openingParens","ccount","closingParens","email","code","unicodeWhitespace","unicodePunctuation"],"mappings":";;;;AAaA,MAAMA,I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@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ok as a } from "../../../../devlop@1.1.0/node_modules/devlop/lib/default.es.js";
|
|
2
|
+
import { normalizeIdentifier as s } from "../../../../micromark-util-normalize-identifier@2.0.1/node_modules/micromark-util-normalize-identifier/index.es.js";
|
|
3
|
+
u.peek = S;
|
|
4
|
+
function F() {
|
|
5
|
+
this.buffer();
|
|
6
|
+
}
|
|
7
|
+
function b(e) {
|
|
8
|
+
this.enter({ type: "footnoteReference", identifier: "", label: "" }, e);
|
|
9
|
+
}
|
|
10
|
+
function k() {
|
|
11
|
+
this.buffer();
|
|
12
|
+
}
|
|
13
|
+
function d(e) {
|
|
14
|
+
this.enter(
|
|
15
|
+
{ type: "footnoteDefinition", identifier: "", label: "", children: [] },
|
|
16
|
+
e
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function x(e) {
|
|
20
|
+
const n = this.resume(), t = this.stack[this.stack.length - 1];
|
|
21
|
+
a(t.type === "footnoteReference"), t.identifier = s(
|
|
22
|
+
this.sliceSerialize(e)
|
|
23
|
+
).toLowerCase(), t.label = n;
|
|
24
|
+
}
|
|
25
|
+
function D(e) {
|
|
26
|
+
this.exit(e);
|
|
27
|
+
}
|
|
28
|
+
function p(e) {
|
|
29
|
+
const n = this.resume(), t = this.stack[this.stack.length - 1];
|
|
30
|
+
a(t.type === "footnoteDefinition"), t.identifier = s(
|
|
31
|
+
this.sliceSerialize(e)
|
|
32
|
+
).toLowerCase(), t.label = n;
|
|
33
|
+
}
|
|
34
|
+
function C(e) {
|
|
35
|
+
this.exit(e);
|
|
36
|
+
}
|
|
37
|
+
function S() {
|
|
38
|
+
return "[";
|
|
39
|
+
}
|
|
40
|
+
function u(e, n, t, r) {
|
|
41
|
+
const l = t.createTracker(r);
|
|
42
|
+
let o = l.move("[^");
|
|
43
|
+
const c = t.enter("footnoteReference"), i = t.enter("reference");
|
|
44
|
+
return o += l.move(
|
|
45
|
+
t.safe(t.associationId(e), { after: "]", before: o })
|
|
46
|
+
), i(), c(), o += l.move("]"), o;
|
|
47
|
+
}
|
|
48
|
+
function R() {
|
|
49
|
+
return {
|
|
50
|
+
enter: {
|
|
51
|
+
gfmFootnoteCallString: F,
|
|
52
|
+
gfmFootnoteCall: b,
|
|
53
|
+
gfmFootnoteDefinitionLabelString: k,
|
|
54
|
+
gfmFootnoteDefinition: d
|
|
55
|
+
},
|
|
56
|
+
exit: {
|
|
57
|
+
gfmFootnoteCallString: x,
|
|
58
|
+
gfmFootnoteCall: D,
|
|
59
|
+
gfmFootnoteDefinitionLabelString: p,
|
|
60
|
+
gfmFootnoteDefinition: C
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function y(e) {
|
|
65
|
+
let n = !1;
|
|
66
|
+
return e && e.firstLineBlank && (n = !0), {
|
|
67
|
+
handlers: { footnoteDefinition: t, footnoteReference: u },
|
|
68
|
+
// This is on by default already.
|
|
69
|
+
unsafe: [{ character: "[", inConstruct: ["label", "phrasing", "reference"] }]
|
|
70
|
+
};
|
|
71
|
+
function t(r, l, o, c) {
|
|
72
|
+
const i = o.createTracker(c);
|
|
73
|
+
let f = i.move("[^");
|
|
74
|
+
const h = o.enter("footnoteDefinition"), g = o.enter("label");
|
|
75
|
+
return f += i.move(
|
|
76
|
+
o.safe(o.associationId(r), { before: f, after: "]" })
|
|
77
|
+
), g(), f += i.move("]:"), r.children && r.children.length > 0 && (i.shift(4), f += i.move(
|
|
78
|
+
(n ? `
|
|
79
|
+
` : " ") + o.indentLines(
|
|
80
|
+
o.containerFlow(r, i.current()),
|
|
81
|
+
n ? m : v
|
|
82
|
+
)
|
|
83
|
+
)), h(), f;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function v(e, n, t) {
|
|
87
|
+
return n === 0 ? e : m(e, n, t);
|
|
88
|
+
}
|
|
89
|
+
function m(e, n, t) {
|
|
90
|
+
return (t ? "" : " ") + e;
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
R as gfmFootnoteFromMarkdown,
|
|
94
|
+
y as gfmFootnoteToMarkdown
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../../../../../../../node_modules/.pnpm/mdast-util-gfm-footnote@2.1.0/node_modules/mdast-util-gfm-footnote/lib/index.js"],"sourcesContent":["/**\n * @import {\n * CompileContext,\n * Extension as FromMarkdownExtension,\n * Handle as FromMarkdownHandle\n * } from 'mdast-util-from-markdown'\n * @import {ToMarkdownOptions} from 'mdast-util-gfm-footnote'\n * @import {\n * Handle as ToMarkdownHandle,\n * Map,\n * Options as ToMarkdownExtension\n * } from 'mdast-util-to-markdown'\n * @import {FootnoteDefinition, FootnoteReference} from 'mdast'\n */\n\nimport {ok as assert} from 'devlop'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\n\nfootnoteReference.peek = footnoteReferencePeek\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteCallString() {\n this.buffer()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteCall(token) {\n this.enter({type: 'footnoteReference', identifier: '', label: ''}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteDefinitionLabelString() {\n this.buffer()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteDefinition(token) {\n this.enter(\n {type: 'footnoteDefinition', identifier: '', label: '', children: []},\n token\n )\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteCallString(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'footnoteReference')\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n node.label = label\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteCall(token) {\n this.exit(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteDefinitionLabelString(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'footnoteDefinition')\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n node.label = label\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteDefinition(token) {\n this.exit(token)\n}\n\n/** @type {ToMarkdownHandle} */\nfunction footnoteReferencePeek() {\n return '['\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {FootnoteReference} node\n */\nfunction footnoteReference(node, _, state, info) {\n const tracker = state.createTracker(info)\n let value = tracker.move('[^')\n const exit = state.enter('footnoteReference')\n const subexit = state.enter('reference')\n value += tracker.move(\n state.safe(state.associationId(node), {after: ']', before: value})\n )\n subexit()\n exit()\n value += tracker.move(']')\n return value\n}\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM footnotes\n * in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown`.\n */\nexport function gfmFootnoteFromMarkdown() {\n return {\n enter: {\n gfmFootnoteCallString: enterFootnoteCallString,\n gfmFootnoteCall: enterFootnoteCall,\n gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString,\n gfmFootnoteDefinition: enterFootnoteDefinition\n },\n exit: {\n gfmFootnoteCallString: exitFootnoteCallString,\n gfmFootnoteCall: exitFootnoteCall,\n gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString,\n gfmFootnoteDefinition: exitFootnoteDefinition\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM footnotes\n * in markdown.\n *\n * @param {ToMarkdownOptions | null | undefined} [options]\n * Configuration (optional).\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown`.\n */\nexport function gfmFootnoteToMarkdown(options) {\n // To do: next major: change default.\n let firstLineBlank = false\n\n if (options && options.firstLineBlank) {\n firstLineBlank = true\n }\n\n return {\n handlers: {footnoteDefinition, footnoteReference},\n // This is on by default already.\n unsafe: [{character: '[', inConstruct: ['label', 'phrasing', 'reference']}]\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {FootnoteDefinition} node\n */\n function footnoteDefinition(node, _, state, info) {\n const tracker = state.createTracker(info)\n let value = tracker.move('[^')\n const exit = state.enter('footnoteDefinition')\n const subexit = state.enter('label')\n value += tracker.move(\n state.safe(state.associationId(node), {before: value, after: ']'})\n )\n subexit()\n\n value += tracker.move(']:')\n\n if (node.children && node.children.length > 0) {\n tracker.shift(4)\n\n value += tracker.move(\n (firstLineBlank ? '\\n' : ' ') +\n state.indentLines(\n state.containerFlow(node, tracker.current()),\n firstLineBlank ? mapAll : mapExceptFirst\n )\n )\n }\n\n exit()\n\n return value\n }\n}\n\n/** @type {Map} */\nfunction mapExceptFirst(line, index, blank) {\n return index === 0 ? line : mapAll(line, index, blank)\n}\n\n/** @type {Map} */\nfunction mapAll(line, index, blank) {\n return (blank ? '' : ' ') + line\n}\n"],"names":["footnoteReference","footnoteReferencePeek","enterFootnoteCallString","enterFootnoteCall","token","enterFootnoteDefinitionLabelString","enterFootnoteDefinition","exitFootnoteCallString","label","node","assert","normalizeIdentifier","exitFootnoteCall","exitFootnoteDefinitionLabelString","exitFootnoteDefinition","_","state","info","tracker","value","exit","subexit","gfmFootnoteFromMarkdown","gfmFootnoteToMarkdown","options","firstLineBlank","footnoteDefinition","mapAll","mapExceptFirst","line","index","blank"],"mappings":";;AAkBAA,EAAkB,OAAOC;AAMzB,SAASC,IAA0B;AACjC,OAAK,OAAM;AACb;AAMA,SAASC,EAAkBC,GAAO;AAChC,OAAK,MAAM,EAAC,MAAM,qBAAqB,YAAY,IAAI,OAAO,GAAE,GAAGA,CAAK;AAC1E;AAMA,SAASC,IAAqC;AAC5C,OAAK,OAAM;AACb;AAMA,SAASC,EAAwBF,GA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A,SAASJ,EAAOE,GAAMC,GAAOC,GAAO;AAClC,UAAQA,IAAQ,KAAK,UAAUF;AACjC;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const h = [
|
|
2
|
+
"autolink",
|
|
3
|
+
"destinationLiteral",
|
|
4
|
+
"destinationRaw",
|
|
5
|
+
"reference",
|
|
6
|
+
"titleQuote",
|
|
7
|
+
"titleApostrophe"
|
|
8
|
+
];
|
|
9
|
+
o.peek = s;
|
|
10
|
+
function l() {
|
|
11
|
+
return {
|
|
12
|
+
canContainEols: ["delete"],
|
|
13
|
+
enter: { strikethrough: c },
|
|
14
|
+
exit: { strikethrough: a }
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function f() {
|
|
18
|
+
return {
|
|
19
|
+
unsafe: [
|
|
20
|
+
{
|
|
21
|
+
character: "~",
|
|
22
|
+
inConstruct: "phrasing",
|
|
23
|
+
notInConstruct: h
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
handlers: { delete: o }
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function c(e) {
|
|
30
|
+
this.enter({ type: "delete", children: [] }, e);
|
|
31
|
+
}
|
|
32
|
+
function a(e) {
|
|
33
|
+
this.exit(e);
|
|
34
|
+
}
|
|
35
|
+
function o(e, k, r, i) {
|
|
36
|
+
const n = r.createTracker(i), u = r.enter("strikethrough");
|
|
37
|
+
let t = n.move("~~");
|
|
38
|
+
return t += r.containerPhrasing(e, {
|
|
39
|
+
...n.current(),
|
|
40
|
+
before: t,
|
|
41
|
+
after: "~"
|
|
42
|
+
}), t += n.move("~~"), u(), t;
|
|
43
|
+
}
|
|
44
|
+
function s() {
|
|
45
|
+
return "~";
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
l as gfmStrikethroughFromMarkdown,
|
|
49
|
+
f as gfmStrikethroughToMarkdown
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../../../../../../../node_modules/.pnpm/mdast-util-gfm-strikethrough@2.0.0/node_modules/mdast-util-gfm-strikethrough/lib/index.js"],"sourcesContent":["/**\n * @typedef {import('mdast').Delete} Delete\n *\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n *\n * @typedef {import('mdast-util-to-markdown').ConstructName} ConstructName\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n */\n\n/**\n * List of constructs that occur in phrasing (paragraphs, headings), but cannot\n * contain strikethrough.\n * So they sort of cancel each other out.\n * Note: could use a better name.\n *\n * Note: keep in sync with: <https://github.com/syntax-tree/mdast-util-to-markdown/blob/8ce8dbf/lib/unsafe.js#L14>\n *\n * @type {Array<ConstructName>}\n */\nconst constructsWithoutStrikethrough = [\n 'autolink',\n 'destinationLiteral',\n 'destinationRaw',\n 'reference',\n 'titleQuote',\n 'titleApostrophe'\n]\n\nhandleDelete.peek = peekDelete\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM\n * strikethrough in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM strikethrough.\n */\nexport function gfmStrikethroughFromMarkdown() {\n return {\n canContainEols: ['delete'],\n enter: {strikethrough: enterStrikethrough},\n exit: {strikethrough: exitStrikethrough}\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM\n * strikethrough in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM strikethrough.\n */\nexport function gfmStrikethroughToMarkdown() {\n return {\n unsafe: [\n {\n character: '~',\n inConstruct: 'phrasing',\n notInConstruct: constructsWithoutStrikethrough\n }\n ],\n handlers: {delete: handleDelete}\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterStrikethrough(token) {\n this.enter({type: 'delete', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitStrikethrough(token) {\n this.exit(token)\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {Delete} node\n */\nfunction handleDelete(node, _, state, info) {\n const tracker = state.createTracker(info)\n const exit = state.enter('strikethrough')\n let value = tracker.move('~~')\n value += state.containerPhrasing(node, {\n ...tracker.current(),\n before: value,\n after: '~'\n })\n value += tracker.move('~~')\n exit()\n return value\n}\n\n/** @type {ToMarkdownHandle} */\nfunction peekDelete() {\n return '~'\n}\n"],"names":["constructsWithoutStrikethrough","handleDelete","peekDelete","gfmStrikethroughFromMarkdown","enterStrikethrough","exitStrikethrough","gfmStrikethroughToMarkdown","token","node","_","state","info","tracker","exit","value"],"mappings":"AAsBA,MAAMA,IAAiC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEAC,EAAa,OAAOC;AASb,SAASC,IAA+B;AAC7C,SAAO;AAAA,IACL,gBAAgB,CAAC,QAAQ;AAAA,IACzB,OAAO,EAAC,eAAeC,EAAkB;AAAA,IACzC,MAAM,EAAC,eAAeC,EAAiB;AAAA,EAC3C;AACA;AASO,SAASC,IAA6B;AAC3C,SAAO;AAAA,IACL,QAAQ;AAAA,MACN;AAAA,QACE,WAAW;AAAA,QACX,aAAa;AAAA,QACb,gBAAgBN;AAAA,MACxB;AAAA,IACK;AAAA,IACD,UAAU,EAAC,QAAQC,EAAY;AAAA,EACnC;AACA;AAMA,SAASG,EAAmBG,GAAO;AACjC,OAAK,MAAM,EAAC,MAAM,UAAU,UAAU,CAAE,EAAA,GAAGA,CAAK;AAClD;AAMA,SAASF,EAAkBE,GAAO;AAChC,OAAK,KAAKA,CAAK;AACjB;AAMA,SAASN,EAAaO,GAAMC,GAAGC,GAAOC,GAAM;AAC1C,QAAMC,IAAUF,EAAM,cAAcC,CAAI,GAClCE,IAAOH,EAAM,MAAM,eAAe;AACxC,MAAII,IAAQF,EAAQ,KAAK,IAAI;AAC7B,SAAAE,KAASJ,EAAM,kBAAkBF,GAAM;AAAA,IACrC,GAAGI,EAAQ,QAAS;AAAA,IACpB,QAAQE;AAAA,IACR,OAAO;AAAA,EACR,CAAA,GACDA,KAASF,EAAQ,KAAK,IAAI,GAC1BC,EAAI,GACGC;AACT;AAGA,SAASZ,IAAa;AACpB,SAAO;AACT;","x_google_ignoreList":[0]}
|