@intlayer/design-system 6.1.4 → 6.1.6-canary.0
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/.vite/manifest.json +19 -14
- package/dist/Form-CriPBaZk.js.map +1 -1
- package/dist/Form-DJrUK3mm.cjs.map +1 -1
- package/dist/components/Accordion/Accordion.cjs +51 -15
- package/dist/components/Accordion/Accordion.cjs.map +1 -1
- package/dist/components/Accordion/Accordion.d.ts +44 -5
- package/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion/Accordion.mjs +52 -16
- package/dist/components/Accordion/Accordion.mjs.map +1 -1
- package/dist/components/Avatar/index.cjs +114 -31
- package/dist/components/Avatar/index.cjs.map +1 -1
- package/dist/components/Avatar/index.d.ts +46 -2
- package/dist/components/Avatar/index.d.ts.map +1 -1
- package/dist/components/Avatar/index.mjs +115 -32
- package/dist/components/Avatar/index.mjs.map +1 -1
- package/dist/components/Badge/index.cjs +88 -9
- package/dist/components/Badge/index.cjs.map +1 -1
- package/dist/components/Badge/index.d.ts +80 -2
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Badge/index.mjs +89 -10
- package/dist/components/Badge/index.mjs.map +1 -1
- package/dist/components/Breadcrumb/index.cjs +124 -59
- package/dist/components/Breadcrumb/index.cjs.map +1 -1
- package/dist/components/Breadcrumb/index.d.ts +89 -5
- package/dist/components/Breadcrumb/index.d.ts.map +1 -1
- package/dist/components/Breadcrumb/index.mjs +124 -59
- package/dist/components/Breadcrumb/index.mjs.map +1 -1
- package/dist/components/Button/Button.cjs +44 -25
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.d.ts +95 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.mjs +44 -25
- package/dist/components/Button/Button.mjs.map +1 -1
- package/dist/components/ClickOutsideDiv/index.cjs +38 -7
- package/dist/components/ClickOutsideDiv/index.cjs.map +1 -1
- package/dist/components/ClickOutsideDiv/index.d.ts +13 -0
- package/dist/components/ClickOutsideDiv/index.d.ts.map +1 -1
- package/dist/components/ClickOutsideDiv/index.mjs +39 -8
- package/dist/components/ClickOutsideDiv/index.mjs.map +1 -1
- package/dist/components/Container/index.cjs +2 -0
- package/dist/components/Container/index.cjs.map +1 -1
- package/dist/components/Container/index.d.ts +42 -0
- package/dist/components/Container/index.d.ts.map +1 -1
- package/dist/components/Container/index.mjs +2 -0
- package/dist/components/Container/index.mjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditor.cjs +80 -33
- package/dist/components/ContentEditor/ContentEditor.cjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditor.d.ts +29 -0
- package/dist/components/ContentEditor/ContentEditor.d.ts.map +1 -1
- package/dist/components/ContentEditor/ContentEditor.mjs +80 -33
- package/dist/components/ContentEditor/ContentEditor.mjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditorInput.cjs +58 -31
- package/dist/components/ContentEditor/ContentEditorInput.cjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditorInput.d.ts +33 -0
- package/dist/components/ContentEditor/ContentEditorInput.d.ts.map +1 -1
- package/dist/components/ContentEditor/ContentEditorInput.mjs +58 -31
- package/dist/components/ContentEditor/ContentEditorInput.mjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.cjs +58 -30
- package/dist/components/ContentEditor/ContentEditorTextArea.cjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.d.ts +35 -0
- package/dist/components/ContentEditor/ContentEditorTextArea.d.ts.map +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.mjs +59 -31
- package/dist/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
- package/dist/components/ContentEditor/index.cjs +4 -0
- package/dist/components/ContentEditor/index.cjs.map +1 -1
- package/dist/components/ContentEditor/index.d.ts +2 -0
- package/dist/components/ContentEditor/index.d.ts.map +1 -1
- package/dist/components/ContentEditor/index.mjs +5 -1
- package/dist/components/ContentEditor/index.mjs.map +1 -1
- package/dist/components/ContentSelector/ContentSelector.cjs +9 -1
- package/dist/components/ContentSelector/ContentSelector.cjs.map +1 -1
- package/dist/components/ContentSelector/ContentSelector.d.ts +167 -0
- package/dist/components/ContentSelector/ContentSelector.d.ts.map +1 -1
- package/dist/components/ContentSelector/ContentSelector.mjs +9 -1
- package/dist/components/ContentSelector/ContentSelector.mjs.map +1 -1
- package/dist/components/CopyButton/index.cjs +23 -8
- package/dist/components/CopyButton/index.cjs.map +1 -1
- package/dist/components/CopyButton/index.d.ts +78 -0
- package/dist/components/CopyButton/index.d.ts.map +1 -1
- package/dist/components/CopyButton/index.mjs +23 -8
- package/dist/components/CopyButton/index.mjs.map +1 -1
- package/dist/components/CopyToClipboard/index.cjs +58 -22
- package/dist/components/CopyToClipboard/index.cjs.map +1 -1
- package/dist/components/CopyToClipboard/index.d.ts +68 -2
- package/dist/components/CopyToClipboard/index.d.ts.map +1 -1
- package/dist/components/CopyToClipboard/index.mjs +59 -23
- package/dist/components/CopyToClipboard/index.mjs.map +1 -1
- package/dist/components/DropDown/index.cjs +6 -4
- package/dist/components/DropDown/index.cjs.map +1 -1
- package/dist/components/DropDown/index.d.ts +92 -15
- package/dist/components/DropDown/index.d.ts.map +1 -1
- package/dist/components/DropDown/index.mjs +6 -4
- package/dist/components/DropDown/index.mjs.map +1 -1
- package/dist/components/EditableField/EditableFieldInput.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldInput.d.ts +38 -0
- package/dist/components/EditableField/EditableFieldInput.d.ts.map +1 -1
- package/dist/components/EditableField/EditableFieldInput.mjs.map +1 -1
- package/dist/components/EditableField/EditableFieldLayout.cjs +10 -2
- package/dist/components/EditableField/EditableFieldLayout.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldLayout.d.ts.map +1 -1
- package/dist/components/EditableField/EditableFieldLayout.mjs +10 -2
- package/dist/components/EditableField/EditableFieldLayout.mjs.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.d.ts +42 -0
- package/dist/components/EditableField/EditableFieldTextArea.d.ts.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
- package/dist/components/ExpandCollapse/ExpandCollapse.cjs.map +1 -1
- package/dist/components/ExpandCollapse/ExpandCollapse.d.ts +58 -0
- package/dist/components/ExpandCollapse/ExpandCollapse.d.ts.map +1 -1
- package/dist/components/ExpandCollapse/ExpandCollapse.mjs.map +1 -1
- package/dist/components/Footer/index.cjs.map +1 -1
- package/dist/components/Footer/index.d.ts +101 -0
- package/dist/components/Footer/index.d.ts.map +1 -1
- package/dist/components/Footer/index.mjs.map +1 -1
- package/dist/components/Form/elements/MultiselectElement.d.ts.map +1 -1
- package/dist/components/Form/elements/SelectElement.d.ts.map +1 -1
- package/dist/components/Form/elements/SwitchSelectorElement.d.ts.map +1 -1
- package/dist/components/Headers/index.cjs.map +1 -1
- package/dist/components/Headers/index.d.ts +69 -2
- package/dist/components/Headers/index.d.ts.map +1 -1
- package/dist/components/Headers/index.mjs.map +1 -1
- package/dist/components/HeightResizer/index.cjs +10 -7
- package/dist/components/HeightResizer/index.cjs.map +1 -1
- package/dist/components/HeightResizer/index.d.ts +89 -0
- package/dist/components/HeightResizer/index.d.ts.map +1 -1
- package/dist/components/HeightResizer/index.mjs +10 -7
- package/dist/components/HeightResizer/index.mjs.map +1 -1
- package/dist/components/IDE/MarkDownRender.cjs +2 -2
- package/dist/components/IDE/MarkDownRender.cjs.map +1 -1
- package/dist/components/IDE/MarkDownRender.d.ts.map +1 -1
- package/dist/components/IDE/MarkDownRender.mjs +2 -2
- package/dist/components/IDE/MarkDownRender.mjs.map +1 -1
- package/dist/components/InformationTag/index.cjs.map +1 -1
- package/dist/components/InformationTag/index.d.ts +72 -0
- package/dist/components/InformationTag/index.d.ts.map +1 -1
- package/dist/components/InformationTag/index.mjs.map +1 -1
- package/dist/components/KeyboardScreenAdapter/index.cjs.map +1 -1
- package/dist/components/KeyboardScreenAdapter/index.d.ts +100 -0
- package/dist/components/KeyboardScreenAdapter/index.d.ts.map +1 -1
- package/dist/components/KeyboardScreenAdapter/index.mjs.map +1 -1
- package/dist/components/Label/index.cjs +25 -3
- package/dist/components/Label/index.cjs.map +1 -1
- package/dist/components/Label/index.d.ts +65 -1
- package/dist/components/Label/index.d.ts.map +1 -1
- package/dist/components/Label/index.mjs +26 -4
- package/dist/components/Label/index.mjs.map +1 -1
- package/dist/components/Link/Link.cjs.map +1 -1
- package/dist/components/Link/Link.d.ts +169 -0
- package/dist/components/Link/Link.d.ts.map +1 -1
- package/dist/components/Link/Link.mjs.map +1 -1
- package/dist/components/Loader/index.cjs.map +1 -1
- package/dist/components/Loader/index.d.ts +82 -11
- package/dist/components/Loader/index.d.ts.map +1 -1
- package/dist/components/Loader/index.mjs.map +1 -1
- package/dist/components/Loader/spinner.cjs.map +1 -1
- package/dist/components/Loader/spinner.d.ts +56 -0
- package/dist/components/Loader/spinner.d.ts.map +1 -1
- package/dist/components/Loader/spinner.mjs.map +1 -1
- package/dist/components/MarkDownRender/MarkDownRender.cjs +3 -3
- package/dist/components/MarkDownRender/MarkDownRender.cjs.map +1 -1
- package/dist/components/MarkDownRender/MarkDownRender.d.ts +148 -1
- package/dist/components/MarkDownRender/MarkDownRender.d.ts.map +1 -1
- package/dist/components/MarkDownRender/MarkDownRender.mjs +2 -2
- package/dist/components/MarkDownRender/MarkDownRender.mjs.map +1 -1
- package/dist/components/MarkDownRender/{processer.cjs → processor.cjs} +307 -107
- package/dist/components/MarkDownRender/processor.cjs.map +1 -0
- package/dist/components/MarkDownRender/{processer.d.ts → processor.d.ts} +1 -1
- package/dist/components/MarkDownRender/processor.d.ts.map +1 -0
- package/dist/components/MarkDownRender/{processer.mjs → processor.mjs} +307 -107
- package/dist/components/MarkDownRender/processor.mjs.map +1 -0
- package/dist/components/MaxHeightSmoother/index.cjs.map +1 -1
- package/dist/components/MaxHeightSmoother/index.d.ts +152 -0
- package/dist/components/MaxHeightSmoother/index.d.ts.map +1 -1
- package/dist/components/MaxHeightSmoother/index.mjs.map +1 -1
- package/dist/components/Modal/Modal.cjs +5 -0
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.d.ts +81 -3
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.mjs +5 -0
- package/dist/components/Modal/Modal.mjs.map +1 -1
- package/dist/components/Navbar/Burger.cjs.map +1 -1
- package/dist/components/Navbar/Burger.d.ts +54 -0
- package/dist/components/Navbar/Burger.d.ts.map +1 -1
- package/dist/components/Navbar/Burger.mjs.map +1 -1
- package/dist/components/Navbar/DesktopNavbar.cjs.map +1 -1
- package/dist/components/Navbar/DesktopNavbar.d.ts +78 -0
- package/dist/components/Navbar/DesktopNavbar.d.ts.map +1 -1
- package/dist/components/Navbar/DesktopNavbar.mjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.cjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.d.ts +88 -0
- package/dist/components/Navbar/MobileNavbar.d.ts.map +1 -1
- package/dist/components/Navbar/MobileNavbar.mjs.map +1 -1
- package/dist/components/Navbar/index.cjs.map +1 -1
- package/dist/components/Navbar/index.d.ts +69 -0
- package/dist/components/Navbar/index.d.ts.map +1 -1
- package/dist/components/Navbar/index.mjs.map +1 -1
- package/dist/components/Navbar/useNavigation.cjs +8 -1
- package/dist/components/Navbar/useNavigation.cjs.map +1 -1
- package/dist/components/Navbar/useNavigation.d.ts +83 -0
- package/dist/components/Navbar/useNavigation.d.ts.map +1 -1
- package/dist/components/Navbar/useNavigation.mjs +8 -1
- package/dist/components/Navbar/useNavigation.mjs.map +1 -1
- package/dist/components/Pattern/DotPattern.cjs.map +1 -1
- package/dist/components/Pattern/DotPattern.d.ts +101 -0
- package/dist/components/Pattern/DotPattern.d.ts.map +1 -1
- package/dist/components/Pattern/DotPattern.mjs.map +1 -1
- package/dist/components/Pattern/GridPattern.cjs.map +1 -1
- package/dist/components/Pattern/GridPattern.d.ts +114 -0
- package/dist/components/Pattern/GridPattern.d.ts.map +1 -1
- package/dist/components/Pattern/GridPattern.mjs.map +1 -1
- package/dist/components/Pattern/SpotLight.cjs.map +1 -1
- package/dist/components/Pattern/SpotLight.d.ts +125 -0
- package/dist/components/Pattern/SpotLight.d.ts.map +1 -1
- package/dist/components/Pattern/SpotLight.mjs.map +1 -1
- package/dist/components/Popover/index.cjs +10 -10
- package/dist/components/Popover/index.cjs.map +1 -1
- package/dist/components/Popover/index.d.ts +110 -15
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.mjs +10 -10
- package/dist/components/Popover/index.mjs.map +1 -1
- package/dist/components/PressableSpan/PressableSpan.cjs +22 -5
- package/dist/components/PressableSpan/PressableSpan.cjs.map +1 -1
- package/dist/components/PressableSpan/PressableSpan.d.ts +105 -3
- package/dist/components/PressableSpan/PressableSpan.d.ts.map +1 -1
- package/dist/components/PressableSpan/PressableSpan.mjs +22 -5
- package/dist/components/PressableSpan/PressableSpan.mjs.map +1 -1
- package/dist/components/RightDrawer/RightDrawer.cjs.map +1 -1
- package/dist/components/RightDrawer/RightDrawer.d.ts +182 -0
- package/dist/components/RightDrawer/RightDrawer.d.ts.map +1 -1
- package/dist/components/RightDrawer/RightDrawer.mjs.map +1 -1
- package/dist/components/RightDrawer/isElementAtTopAndNotCovered.cjs.map +1 -1
- package/dist/components/RightDrawer/isElementAtTopAndNotCovered.d.ts +44 -0
- package/dist/components/RightDrawer/isElementAtTopAndNotCovered.d.ts.map +1 -1
- package/dist/components/RightDrawer/isElementAtTopAndNotCovered.mjs.map +1 -1
- package/dist/components/RightDrawer/useRightDrawerStore.cjs.map +1 -1
- package/dist/components/RightDrawer/useRightDrawerStore.d.ts +102 -0
- package/dist/components/RightDrawer/useRightDrawerStore.d.ts.map +1 -1
- package/dist/components/RightDrawer/useRightDrawerStore.mjs.map +1 -1
- package/dist/components/Select/Multiselect.cjs.map +1 -1
- package/dist/components/Select/Multiselect.d.ts +125 -18
- package/dist/components/Select/Multiselect.d.ts.map +1 -1
- package/dist/components/Select/Multiselect.mjs.map +1 -1
- package/dist/components/Select/Select.cjs.map +1 -1
- package/dist/components/Select/Select.d.ts +214 -7
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.mjs.map +1 -1
- package/dist/components/SwitchSelector/index.cjs.map +1 -1
- package/dist/components/SwitchSelector/index.d.ts +157 -8
- package/dist/components/SwitchSelector/index.d.ts.map +1 -1
- package/dist/components/SwitchSelector/index.mjs.map +1 -1
- package/dist/components/Table/Table.cjs.map +1 -1
- package/dist/components/Table/Table.d.ts +184 -0
- package/dist/components/Table/Table.d.ts.map +1 -1
- package/dist/components/Table/Table.mjs.map +1 -1
- package/dist/components/Tag/index.cjs.map +1 -1
- package/dist/components/Tag/index.d.ts +223 -0
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.mjs.map +1 -1
- package/dist/components/TextArea/AutoSizeTextArea.cjs.map +1 -1
- package/dist/components/TextArea/AutoSizeTextArea.d.ts +91 -0
- package/dist/components/TextArea/AutoSizeTextArea.d.ts.map +1 -1
- package/dist/components/TextArea/AutoSizeTextArea.mjs.map +1 -1
- package/dist/components/TextArea/AutocompleteTextArea.cjs.map +1 -1
- package/dist/components/TextArea/AutocompleteTextArea.d.ts +145 -0
- package/dist/components/TextArea/AutocompleteTextArea.d.ts.map +1 -1
- package/dist/components/TextArea/AutocompleteTextArea.mjs.map +1 -1
- package/dist/components/TextArea/TextArea.cjs.map +1 -1
- package/dist/components/TextArea/TextArea.d.ts +74 -0
- package/dist/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/components/TextArea/TextArea.mjs.map +1 -1
- package/dist/components/Toaster/Toast.cjs +4 -0
- package/dist/components/Toaster/Toast.cjs.map +1 -1
- package/dist/components/Toaster/Toast.d.ts +148 -2
- package/dist/components/Toaster/Toast.d.ts.map +1 -1
- package/dist/components/Toaster/Toast.mjs +4 -0
- package/dist/components/Toaster/Toast.mjs.map +1 -1
- package/dist/components/Toaster/Toaster.cjs.map +1 -1
- package/dist/components/Toaster/Toaster.d.ts +42 -0
- package/dist/components/Toaster/Toaster.d.ts.map +1 -1
- package/dist/components/Toaster/Toaster.mjs.map +1 -1
- package/dist/components/Toaster/useToast.cjs.map +1 -1
- package/dist/components/Toaster/useToast.d.ts +199 -2
- package/dist/components/Toaster/useToast.d.ts.map +1 -1
- package/dist/components/Toaster/useToast.mjs.map +1 -1
- package/dist/components/WithResizer/index.cjs.map +1 -1
- package/dist/components/WithResizer/index.d.ts +143 -0
- package/dist/components/WithResizer/index.d.ts.map +1 -1
- package/dist/components/WithResizer/index.mjs.map +1 -1
- package/dist/components/index.cjs +2 -2
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.mjs +4 -4
- package/dist/components/index.mjs.map +1 -1
- package/dist/hooks/reactQuery.cjs +2 -1
- package/dist/hooks/reactQuery.cjs.map +1 -1
- package/dist/hooks/reactQuery.d.ts +1 -1
- package/dist/hooks/reactQuery.d.ts.map +1 -1
- package/dist/hooks/reactQuery.mjs +2 -1
- package/dist/hooks/reactQuery.mjs.map +1 -1
- package/dist/hooks/useHorizontalSwipe.cjs +4 -4
- package/dist/hooks/useHorizontalSwipe.cjs.map +1 -1
- package/dist/hooks/useHorizontalSwipe.d.ts.map +1 -1
- package/dist/hooks/useHorizontalSwipe.mjs +4 -4
- package/dist/hooks/useHorizontalSwipe.mjs.map +1 -1
- package/dist/utils/image.cjs +30 -0
- package/dist/utils/image.cjs.map +1 -0
- package/dist/utils/image.d.ts +37 -0
- package/dist/utils/image.d.ts.map +1 -0
- package/dist/utils/image.mjs +30 -0
- package/dist/utils/image.mjs.map +1 -0
- package/package.json +20 -19
- package/dist/components/MarkDownRender/processer.cjs.map +0 -1
- package/dist/components/MarkDownRender/processer.d.ts.map +0 -1
- package/dist/components/MarkDownRender/processer.mjs.map +0 -1
- package/dist/utils/capitalize.cjs +0 -10
- package/dist/utils/capitalize.cjs.map +0 -1
- package/dist/utils/capitalize.d.ts +0 -2
- package/dist/utils/capitalize.d.ts.map +0 -1
- package/dist/utils/capitalize.mjs +0 -10
- package/dist/utils/capitalize.mjs.map +0 -1
|
@@ -353,6 +353,7 @@ const parseTableAlignCapture = (alignCapture) => {
|
|
|
353
353
|
return "left";
|
|
354
354
|
};
|
|
355
355
|
const parseTableRow = (source, parse, state, tableOutput) => {
|
|
356
|
+
const start = performance.now();
|
|
356
357
|
const prevInTable = state.inTable;
|
|
357
358
|
state.inTable = true;
|
|
358
359
|
let cells = [[]];
|
|
@@ -377,6 +378,12 @@ const parseTableRow = (source, parse, state, tableOutput) => {
|
|
|
377
378
|
});
|
|
378
379
|
flush();
|
|
379
380
|
state.inTable = prevInTable;
|
|
381
|
+
const duration = performance.now() - start;
|
|
382
|
+
if (duration > 1) {
|
|
383
|
+
console.log(
|
|
384
|
+
`parseTableRow: ${duration.toFixed(3)}ms, source length: ${source.length}, cells count: ${cells.length}`
|
|
385
|
+
);
|
|
386
|
+
}
|
|
380
387
|
return cells;
|
|
381
388
|
};
|
|
382
389
|
const parseTableAlign = (source) => {
|
|
@@ -384,10 +391,18 @@ const parseTableAlign = (source) => {
|
|
|
384
391
|
return alignText.map(parseTableAlignCapture);
|
|
385
392
|
};
|
|
386
393
|
const parseTableCells = (source, parse, state) => {
|
|
394
|
+
const start = performance.now();
|
|
387
395
|
const rowsText = source.trim().split("\n");
|
|
388
|
-
|
|
396
|
+
const result = rowsText.map((rowText) => {
|
|
389
397
|
return parseTableRow(rowText, parse, state, true);
|
|
390
398
|
});
|
|
399
|
+
const duration = performance.now() - start;
|
|
400
|
+
if (duration > 1) {
|
|
401
|
+
console.log(
|
|
402
|
+
`parseTableCells: ${duration.toFixed(3)}ms, source length: ${source.length}, rows count: ${rowsText.length}`
|
|
403
|
+
);
|
|
404
|
+
}
|
|
405
|
+
return result;
|
|
391
406
|
};
|
|
392
407
|
const parseTable = (capture, parse, state) => {
|
|
393
408
|
state.inline = true;
|
|
@@ -418,6 +433,7 @@ const normalizeAttributeKey = (key) => {
|
|
|
418
433
|
return key;
|
|
419
434
|
};
|
|
420
435
|
const parseStyleAttribute = (styleString) => {
|
|
436
|
+
const start = performance.now();
|
|
421
437
|
const styles = [];
|
|
422
438
|
let buffer = "";
|
|
423
439
|
let inUrl = false;
|
|
@@ -464,9 +480,16 @@ const parseStyleAttribute = (styleString) => {
|
|
|
464
480
|
styles.push([key, value]);
|
|
465
481
|
}
|
|
466
482
|
}
|
|
483
|
+
const duration = performance.now() - start;
|
|
484
|
+
if (duration > 1) {
|
|
485
|
+
console.log(
|
|
486
|
+
`parseStyleAttribute: ${duration.toFixed(3)}ms, styleString length: ${styleString.length}, styles count: ${styles.length}`
|
|
487
|
+
);
|
|
488
|
+
}
|
|
467
489
|
return styles;
|
|
468
490
|
};
|
|
469
491
|
const trimLeadingWhitespaceOutsideFences = (text, whitespace) => {
|
|
492
|
+
const start = performance.now();
|
|
470
493
|
if (!whitespace) return text;
|
|
471
494
|
const lines = text.split("\n");
|
|
472
495
|
let inFence = false;
|
|
@@ -496,7 +519,14 @@ const trimLeadingWhitespaceOutsideFences = (text, whitespace) => {
|
|
|
496
519
|
}
|
|
497
520
|
return line.startsWith(whitespace) ? line.slice(whitespace.length) : line;
|
|
498
521
|
});
|
|
499
|
-
|
|
522
|
+
const result = out.join("\n");
|
|
523
|
+
const duration = performance.now() - start;
|
|
524
|
+
if (duration > 1) {
|
|
525
|
+
console.log(
|
|
526
|
+
`trimLeadingWhitespaceOutsideFences: ${duration.toFixed(3)}ms, text length: ${text.length}, lines count: ${lines.length}`
|
|
527
|
+
);
|
|
528
|
+
}
|
|
529
|
+
return result;
|
|
500
530
|
};
|
|
501
531
|
const attributeValueToJSXPropValue = (tag, key, value, sanitizeUrlFn) => {
|
|
502
532
|
if (key === "style") {
|
|
@@ -528,9 +558,18 @@ const attributeValueToJSXPropValue = (tag, key, value, sanitizeUrlFn) => {
|
|
|
528
558
|
return value;
|
|
529
559
|
};
|
|
530
560
|
const normalizeWhitespace = (source) => {
|
|
531
|
-
|
|
561
|
+
const start = performance.now();
|
|
562
|
+
const result = source.replace(CR_NEWLINE_R, "\n").replace(FORMFEED_R, "").replace(TAB_R, " ");
|
|
563
|
+
const duration = performance.now() - start;
|
|
564
|
+
if (duration > 1) {
|
|
565
|
+
console.log(
|
|
566
|
+
`normalizeWhitespace: ${duration.toFixed(3)}ms, source length: ${source.length}`
|
|
567
|
+
);
|
|
568
|
+
}
|
|
569
|
+
return result;
|
|
532
570
|
};
|
|
533
571
|
const parserFor = (rules) => {
|
|
572
|
+
const start = performance.now();
|
|
534
573
|
var ruleList = Object.keys(rules);
|
|
535
574
|
if (define_process_env_default.NODE_ENV !== "production") {
|
|
536
575
|
ruleList.forEach((type) => {
|
|
@@ -546,6 +585,7 @@ const parserFor = (rules) => {
|
|
|
546
585
|
return rules[a]._order - rules[b]._order || (a < b ? -1 : 1);
|
|
547
586
|
});
|
|
548
587
|
const nestedParse = (source, state = {}) => {
|
|
588
|
+
const parseStart = performance.now();
|
|
549
589
|
var result = [];
|
|
550
590
|
state.prevCapture = state.prevCapture || "";
|
|
551
591
|
if (source.trim()) {
|
|
@@ -558,10 +598,24 @@ const parserFor = (rules) => {
|
|
|
558
598
|
i++;
|
|
559
599
|
continue;
|
|
560
600
|
}
|
|
601
|
+
const matchStart = performance.now();
|
|
561
602
|
var capture = rule._match(source, state);
|
|
603
|
+
const matchDuration = performance.now() - matchStart;
|
|
604
|
+
if (matchDuration > 1) {
|
|
605
|
+
console.log(
|
|
606
|
+
`${ruleType}._match: ${matchDuration.toFixed(3)}ms, source length: ${source.length}`
|
|
607
|
+
);
|
|
608
|
+
}
|
|
562
609
|
if (capture && capture[0]) {
|
|
563
610
|
source = source.substring(capture[0].length);
|
|
611
|
+
const ruleParseStart = performance.now();
|
|
564
612
|
const parsedAny = rule._parse(capture, nestedParse, state);
|
|
613
|
+
const ruleParseDuration = performance.now() - ruleParseStart;
|
|
614
|
+
if (ruleParseDuration > 1) {
|
|
615
|
+
console.log(
|
|
616
|
+
`${ruleType}._parse: ${ruleParseDuration.toFixed(3)}ms, capture length: ${capture[0].length}`
|
|
617
|
+
);
|
|
618
|
+
}
|
|
565
619
|
state.prevCapture += capture[0];
|
|
566
620
|
if (!parsedAny.type)
|
|
567
621
|
parsedAny.type = ruleType;
|
|
@@ -573,8 +627,20 @@ const parserFor = (rules) => {
|
|
|
573
627
|
}
|
|
574
628
|
}
|
|
575
629
|
state.prevCapture = "";
|
|
630
|
+
const parseDuration = performance.now() - parseStart;
|
|
631
|
+
if (parseDuration > 1) {
|
|
632
|
+
console.log(
|
|
633
|
+
`nestedParse: ${parseDuration.toFixed(3)}ms, source length: ${source.length}, result count: ${result.length}`
|
|
634
|
+
);
|
|
635
|
+
}
|
|
576
636
|
return result;
|
|
577
637
|
};
|
|
638
|
+
const duration = performance.now() - start;
|
|
639
|
+
if (duration > 1) {
|
|
640
|
+
console.log(
|
|
641
|
+
`parserFor: ${duration.toFixed(3)}ms, rules count: ${ruleList.length}`
|
|
642
|
+
);
|
|
643
|
+
}
|
|
578
644
|
return (source, state) => nestedParse(normalizeWhitespace(source), state);
|
|
579
645
|
};
|
|
580
646
|
const allowInline = (fn) => {
|
|
@@ -631,6 +697,7 @@ const sanitizer = (input) => {
|
|
|
631
697
|
};
|
|
632
698
|
const unescape = (rawString) => rawString ? rawString.replace(UNESCAPE_R, "$1") : rawString;
|
|
633
699
|
const parseInline = (parse, children, state) => {
|
|
700
|
+
const start = performance.now();
|
|
634
701
|
const isCurrentlyInline = state.inline ?? false;
|
|
635
702
|
const isCurrentlySimple = state.simple ?? false;
|
|
636
703
|
state.inline = true;
|
|
@@ -638,9 +705,16 @@ const parseInline = (parse, children, state) => {
|
|
|
638
705
|
const result = parse(children, state);
|
|
639
706
|
state.inline = isCurrentlyInline;
|
|
640
707
|
state.simple = isCurrentlySimple;
|
|
708
|
+
const duration = performance.now() - start;
|
|
709
|
+
if (duration > 1) {
|
|
710
|
+
console.log(
|
|
711
|
+
`parseInline: ${duration.toFixed(3)}ms, children length: ${children.length}, result count: ${result.length}`
|
|
712
|
+
);
|
|
713
|
+
}
|
|
641
714
|
return result;
|
|
642
715
|
};
|
|
643
716
|
const parseSimpleInline = (parse, children, state) => {
|
|
717
|
+
const start = performance.now();
|
|
644
718
|
const isCurrentlyInline = state.inline ?? false;
|
|
645
719
|
const isCurrentlySimple = state.simple ?? false;
|
|
646
720
|
state.inline = false;
|
|
@@ -648,13 +722,26 @@ const parseSimpleInline = (parse, children, state) => {
|
|
|
648
722
|
const result = parse(children, state);
|
|
649
723
|
state.inline = isCurrentlyInline;
|
|
650
724
|
state.simple = isCurrentlySimple;
|
|
725
|
+
const duration = performance.now() - start;
|
|
726
|
+
if (duration > 1) {
|
|
727
|
+
console.log(
|
|
728
|
+
`parseSimpleInline: ${duration.toFixed(3)}ms, children length: ${children.length}, result count: ${result.length}`
|
|
729
|
+
);
|
|
730
|
+
}
|
|
651
731
|
return result;
|
|
652
732
|
};
|
|
653
733
|
const parseBlock = (parse, children, state = {}) => {
|
|
734
|
+
const start = performance.now();
|
|
654
735
|
const isCurrentlyInline = state.inline || false;
|
|
655
736
|
state.inline = false;
|
|
656
737
|
const result = parse(children, state);
|
|
657
738
|
state.inline = isCurrentlyInline;
|
|
739
|
+
const duration = performance.now() - start;
|
|
740
|
+
if (duration > 1) {
|
|
741
|
+
console.log(
|
|
742
|
+
`parseBlock: ${duration.toFixed(3)}ms, children length: ${children.length}, result count: ${result.length}`
|
|
743
|
+
);
|
|
744
|
+
}
|
|
658
745
|
return result;
|
|
659
746
|
};
|
|
660
747
|
const parseCaptureInline = (capture, parse, state) => {
|
|
@@ -665,34 +752,56 @@ const parseCaptureInline = (capture, parse, state) => {
|
|
|
665
752
|
const captureNothing = () => ({});
|
|
666
753
|
const renderNothing = () => null;
|
|
667
754
|
const reactFor = (render) => (ast, state = {}) => {
|
|
755
|
+
const start = performance.now();
|
|
668
756
|
const patchedRender = (ast2, state2 = {}) => reactFor(render)(ast2, state2);
|
|
669
757
|
if (Array.isArray(ast)) {
|
|
670
758
|
const oldKey = state.key;
|
|
671
|
-
const
|
|
759
|
+
const result2 = [];
|
|
672
760
|
let lastWasString = false;
|
|
673
761
|
for (let i = 0; i < ast.length; i++) {
|
|
674
762
|
state.key = i;
|
|
675
763
|
const nodeOut = patchedRender(ast[i], state);
|
|
676
764
|
const isString = typeof nodeOut === "string";
|
|
677
765
|
if (isString && lastWasString) {
|
|
678
|
-
|
|
766
|
+
result2[result2.length - 1] = result2[result2.length - 1] + nodeOut;
|
|
679
767
|
} else if (nodeOut !== null) {
|
|
680
|
-
|
|
768
|
+
result2.push(nodeOut);
|
|
681
769
|
}
|
|
682
770
|
lastWasString = isString;
|
|
683
771
|
}
|
|
684
772
|
state.key = oldKey;
|
|
685
|
-
|
|
773
|
+
const duration2 = performance.now() - start;
|
|
774
|
+
if (duration2 > 1) {
|
|
775
|
+
console.log(
|
|
776
|
+
`reactFor (array): ${duration2.toFixed(3)}ms, ast length: ${ast.length}`
|
|
777
|
+
);
|
|
778
|
+
}
|
|
779
|
+
return result2;
|
|
686
780
|
}
|
|
687
|
-
|
|
781
|
+
const result = render(
|
|
688
782
|
ast,
|
|
689
783
|
patchedRender,
|
|
690
784
|
state
|
|
691
785
|
);
|
|
786
|
+
const duration = performance.now() - start;
|
|
787
|
+
if (duration > 1) {
|
|
788
|
+
console.log(
|
|
789
|
+
`reactFor (single): ${duration.toFixed(3)}ms, ast type: ${ast.type}`
|
|
790
|
+
);
|
|
791
|
+
}
|
|
792
|
+
return result;
|
|
692
793
|
};
|
|
693
794
|
const createRenderer = (rules, userRender) => (ast, render, state) => {
|
|
795
|
+
const start = performance.now();
|
|
694
796
|
const renderer = rules[ast.type]._render;
|
|
695
|
-
|
|
797
|
+
const result = userRender ? userRender(() => renderer?.(ast, render, state), ast, render, state) : renderer?.(ast, render, state);
|
|
798
|
+
const duration = performance.now() - start;
|
|
799
|
+
if (duration > 1) {
|
|
800
|
+
console.log(
|
|
801
|
+
`createRenderer: ${duration.toFixed(3)}ms, ast type: ${ast.type}, hasUserRender: ${!!userRender}`
|
|
802
|
+
);
|
|
803
|
+
}
|
|
804
|
+
return result;
|
|
696
805
|
};
|
|
697
806
|
const cx = (...args) => args.filter(Boolean).join(" ");
|
|
698
807
|
const get = (src, path, fb) => {
|
|
@@ -736,7 +845,9 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
736
845
|
];
|
|
737
846
|
const containsBlockSyntax = (input) => {
|
|
738
847
|
const cleaned = input.replace(TRIM_STARTING_NEWLINES, "");
|
|
739
|
-
|
|
848
|
+
const slice = cleaned.length > 2048 ? cleaned.slice(0, 2048) : cleaned;
|
|
849
|
+
const syntaxes = options.disableParsingRawHTML ? [...NON_PARAGRAPH_BLOCK_SYNTAXES, PARAGRAPH_R, CUSTOM_COMPONENT_R] : BLOCK_SYNTAXES;
|
|
850
|
+
return syntaxes.some((r) => r.test(slice));
|
|
740
851
|
};
|
|
741
852
|
const matchParagraph = (source, state) => {
|
|
742
853
|
if (state.inline || state.simple || state.inHTML && source.indexOf("\n\n") === -1 && state.prevCapture?.indexOf("\n\n") === -1) {
|
|
@@ -774,90 +885,17 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
774
885
|
);
|
|
775
886
|
};
|
|
776
887
|
const compile = (input) => {
|
|
777
|
-
|
|
778
|
-
const
|
|
779
|
-
const lines = src.split(/\r?\n/);
|
|
780
|
-
const out = [];
|
|
781
|
-
let i = 0;
|
|
782
|
-
let insideTabsDepth = 0;
|
|
783
|
-
while (i < lines.length) {
|
|
784
|
-
const line = lines[i];
|
|
785
|
-
if (/<\s*Tabs[>\s]/.test(line)) {
|
|
786
|
-
insideTabsDepth++;
|
|
787
|
-
}
|
|
788
|
-
if (/<\s*\/\s*Tabs\s*>/.test(line)) {
|
|
789
|
-
insideTabsDepth = Math.max(0, insideTabsDepth - 1);
|
|
790
|
-
}
|
|
791
|
-
if (!insideTabsDepth) {
|
|
792
|
-
const headingMatch = line.match(/^#{5}\s+(.+?)\s*$/);
|
|
793
|
-
if (headingMatch) {
|
|
794
|
-
const collected = [];
|
|
795
|
-
const captureSection = (startIndex) => {
|
|
796
|
-
let j2 = startIndex;
|
|
797
|
-
const buf = [];
|
|
798
|
-
while (j2 < lines.length) {
|
|
799
|
-
const l = lines[j2];
|
|
800
|
-
if (/^#{1,5}\s+/.test(l)) break;
|
|
801
|
-
if (/<\s*Tabs[>\s]/.test(l)) insideTabsDepth++;
|
|
802
|
-
if (/<\s*\/\s*Tabs\s*>/.test(l))
|
|
803
|
-
insideTabsDepth = Math.max(0, insideTabsDepth - 1);
|
|
804
|
-
buf.push(l);
|
|
805
|
-
j2++;
|
|
806
|
-
}
|
|
807
|
-
return {
|
|
808
|
-
content: buf.join("\n").replace(/\n+$/, "\n"),
|
|
809
|
-
endIndex: j2
|
|
810
|
-
};
|
|
811
|
-
};
|
|
812
|
-
let j = i;
|
|
813
|
-
while (j < lines.length) {
|
|
814
|
-
const h2 = lines[j].match(/^#{5}\s+(.+?)\s*$/);
|
|
815
|
-
if (!h2) break;
|
|
816
|
-
const hLabel = h2[1].trim();
|
|
817
|
-
const { content, endIndex } = captureSection(j + 1);
|
|
818
|
-
collected.push({
|
|
819
|
-
label: hLabel,
|
|
820
|
-
value: hLabel.toLowerCase(),
|
|
821
|
-
content
|
|
822
|
-
});
|
|
823
|
-
j = endIndex;
|
|
824
|
-
if (!lines[j]?.startsWith("#####")) break;
|
|
825
|
-
}
|
|
826
|
-
if (collected.length >= 2) {
|
|
827
|
-
const defaultTab = (collected.find((t) => t.value === "intlayer") ?? collected[0]).value;
|
|
828
|
-
out.push(`<Tabs defaultTab="${defaultTab}">`);
|
|
829
|
-
const order = ["intlayer", "next-intl", "next-i18next"];
|
|
830
|
-
for (const key of order) {
|
|
831
|
-
const item = collected.find((c) => c.value === key);
|
|
832
|
-
if (!item) continue;
|
|
833
|
-
out.push(
|
|
834
|
-
` <TabItem label="${item.label}" value="${item.value}">`
|
|
835
|
-
);
|
|
836
|
-
const inner = item.content.replace(/^\n+|\n+$/g, "");
|
|
837
|
-
out.push(inner);
|
|
838
|
-
out.push(" </TabItem>");
|
|
839
|
-
}
|
|
840
|
-
out.push("</Tabs>");
|
|
841
|
-
i = j;
|
|
842
|
-
continue;
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
out.push(line);
|
|
847
|
-
i++;
|
|
848
|
-
}
|
|
849
|
-
return out.join("\n");
|
|
850
|
-
};
|
|
851
|
-
input = transformFrameworkH5GroupsToTabs(input);
|
|
888
|
+
const start = performance.now();
|
|
889
|
+
const result = input.replace(FRONT_MATTER_R, "");
|
|
852
890
|
let inline = false;
|
|
853
891
|
if (options.forceInline) {
|
|
854
892
|
inline = true;
|
|
855
893
|
} else if (!options.forceBlock) {
|
|
856
|
-
inline = SHOULD_RENDER_AS_BLOCK_R.test(
|
|
894
|
+
inline = SHOULD_RENDER_AS_BLOCK_R.test(result) === false;
|
|
857
895
|
}
|
|
858
896
|
const arr = emitter(
|
|
859
897
|
parser(
|
|
860
|
-
inline ?
|
|
898
|
+
inline ? result : `${trimEnd(result).replace(TRIM_STARTING_NEWLINES, "")}
|
|
861
899
|
|
|
862
900
|
`,
|
|
863
901
|
{
|
|
@@ -869,6 +907,12 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
869
907
|
arr.pop();
|
|
870
908
|
}
|
|
871
909
|
if (options.wrapper === null) {
|
|
910
|
+
const duration2 = performance.now() - start;
|
|
911
|
+
if (duration2 > 1) {
|
|
912
|
+
console.log(
|
|
913
|
+
`compile: ${duration2.toFixed(3)}ms, input length: ${input.length}, inline: ${inline}`
|
|
914
|
+
);
|
|
915
|
+
}
|
|
872
916
|
return arr;
|
|
873
917
|
}
|
|
874
918
|
const wrapper = options.wrapper ?? (inline ? "span" : "div");
|
|
@@ -878,16 +922,35 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
878
922
|
} else if (arr.length === 1) {
|
|
879
923
|
jsx3 = arr[0];
|
|
880
924
|
if (typeof jsx3 === "string") {
|
|
925
|
+
const duration2 = performance.now() - start;
|
|
926
|
+
if (duration2 > 1) {
|
|
927
|
+
console.log(
|
|
928
|
+
`compile: ${duration2.toFixed(3)}ms, input length: ${input.length}, inline: ${inline}`
|
|
929
|
+
);
|
|
930
|
+
}
|
|
881
931
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: jsx3 }, "outer");
|
|
882
932
|
} else {
|
|
933
|
+
const duration2 = performance.now() - start;
|
|
934
|
+
if (duration2 > 1) {
|
|
935
|
+
console.log(
|
|
936
|
+
`compile: ${duration2.toFixed(3)}ms, input length: ${input.length}, inline: ${inline}`
|
|
937
|
+
);
|
|
938
|
+
}
|
|
883
939
|
return jsx3;
|
|
884
940
|
}
|
|
885
941
|
} else {
|
|
886
942
|
jsx3 = null;
|
|
887
943
|
}
|
|
944
|
+
const duration = performance.now() - start;
|
|
945
|
+
if (duration > 1) {
|
|
946
|
+
console.log(
|
|
947
|
+
`compile: ${duration.toFixed(3)}ms, input length: ${input.length}, inline: ${inline}`
|
|
948
|
+
);
|
|
949
|
+
}
|
|
888
950
|
return createElementFn(wrapper, { key: "outer" }, jsx3);
|
|
889
951
|
};
|
|
890
952
|
const attrStringToMap = (tag, str) => {
|
|
953
|
+
const start = performance.now();
|
|
891
954
|
if (!str || !str.trim()) {
|
|
892
955
|
return null;
|
|
893
956
|
}
|
|
@@ -895,7 +958,7 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
895
958
|
if (!attributes) {
|
|
896
959
|
return null;
|
|
897
960
|
}
|
|
898
|
-
|
|
961
|
+
const result = attributes.reduce((map, raw) => {
|
|
899
962
|
const delimiterIdx = raw.indexOf("=");
|
|
900
963
|
if (delimiterIdx !== -1) {
|
|
901
964
|
const key = normalizeAttributeKey(raw.slice(0, delimiterIdx)).trim();
|
|
@@ -916,6 +979,13 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
916
979
|
}
|
|
917
980
|
return map;
|
|
918
981
|
}, {});
|
|
982
|
+
const duration = performance.now() - start;
|
|
983
|
+
if (duration > 1) {
|
|
984
|
+
console.log(
|
|
985
|
+
`attrStringToMap: ${duration.toFixed(3)}ms, str length: ${str.length}, attributes count: ${attributes.length}`
|
|
986
|
+
);
|
|
987
|
+
}
|
|
988
|
+
return result;
|
|
919
989
|
};
|
|
920
990
|
if (define_process_env_default.NODE_ENV !== "production") {
|
|
921
991
|
if (typeof markdown !== "string") {
|
|
@@ -941,15 +1011,24 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
941
1011
|
_match: blockRegex(BLOCKQUOTE_R),
|
|
942
1012
|
_order: Priority.HIGH,
|
|
943
1013
|
_parse(capture, parse, state) {
|
|
1014
|
+
const start = performance.now();
|
|
944
1015
|
const matchAlert = capture[0].replace(BLOCKQUOTE_TRIM_LEFT_MULTILINE_R, "").match(BLOCKQUOTE_ALERT_R);
|
|
945
1016
|
const alert = matchAlert?.[1];
|
|
946
1017
|
const content = matchAlert?.[2] ?? "";
|
|
947
|
-
|
|
1018
|
+
const result = {
|
|
948
1019
|
alert,
|
|
949
1020
|
children: parse(content, state)
|
|
950
1021
|
};
|
|
1022
|
+
const duration = performance.now() - start;
|
|
1023
|
+
if (duration > 1) {
|
|
1024
|
+
console.log(
|
|
1025
|
+
`blockQuote._parse: ${duration.toFixed(3)}ms, capture length: ${capture[0].length}`
|
|
1026
|
+
);
|
|
1027
|
+
}
|
|
1028
|
+
return result;
|
|
951
1029
|
},
|
|
952
1030
|
_render(node, _output, state = {}) {
|
|
1031
|
+
const start = performance.now();
|
|
953
1032
|
const props = {
|
|
954
1033
|
key: state?.key
|
|
955
1034
|
};
|
|
@@ -963,7 +1042,18 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
963
1042
|
tag: "header"
|
|
964
1043
|
});
|
|
965
1044
|
}
|
|
966
|
-
|
|
1045
|
+
const result = h(
|
|
1046
|
+
"blockquote",
|
|
1047
|
+
props,
|
|
1048
|
+
_output(node.children, state)
|
|
1049
|
+
);
|
|
1050
|
+
const duration = performance.now() - start;
|
|
1051
|
+
if (duration > 1) {
|
|
1052
|
+
console.log(
|
|
1053
|
+
`blockQuote._render: ${duration.toFixed(3)}ms, children count: ${node.children.length}, has alert: ${!!node.alert}`
|
|
1054
|
+
);
|
|
1055
|
+
}
|
|
1056
|
+
return result;
|
|
967
1057
|
}
|
|
968
1058
|
},
|
|
969
1059
|
[RuleType.breakLine]: {
|
|
@@ -998,24 +1088,32 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
998
1088
|
};
|
|
999
1089
|
},
|
|
1000
1090
|
_render(node, _output, state = {}) {
|
|
1091
|
+
const start = performance.now();
|
|
1001
1092
|
const attrs = { ...node.attrs ?? {} };
|
|
1002
1093
|
const langClass = node.lang ? `lang-${node.lang}` : "lang-plaintext";
|
|
1003
1094
|
attrs.className = attrs.className ? `${attrs.className} ${langClass}` : langClass;
|
|
1004
1095
|
if (node.lang && !attrs.lang) attrs.lang = node.lang;
|
|
1005
|
-
|
|
1096
|
+
const result = h(
|
|
1006
1097
|
"pre",
|
|
1007
1098
|
{ key: state.key },
|
|
1008
1099
|
h("code", attrs, node.text)
|
|
1009
1100
|
);
|
|
1101
|
+
const duration = performance.now() - start;
|
|
1102
|
+
if (duration > 1) {
|
|
1103
|
+
console.log(
|
|
1104
|
+
`codeBlock._render: ${duration.toFixed(3)}ms, text length: ${node.text.length}, lang: ${node.lang || "none"}`
|
|
1105
|
+
);
|
|
1106
|
+
}
|
|
1107
|
+
return result;
|
|
1010
1108
|
}
|
|
1011
1109
|
},
|
|
1012
1110
|
[RuleType.codeFenced]: {
|
|
1013
1111
|
_qualify: ["```", "~~~"],
|
|
1014
1112
|
_match: blockRegex(CODE_BLOCK_FENCED_R),
|
|
1015
1113
|
_order: Priority.MAX,
|
|
1016
|
-
_parse(capture
|
|
1114
|
+
_parse(capture) {
|
|
1017
1115
|
const rawText = capture[4];
|
|
1018
|
-
const text =
|
|
1116
|
+
const text = rawText;
|
|
1019
1117
|
return {
|
|
1020
1118
|
// if capture[3] it's additional metadata
|
|
1021
1119
|
attrs: attrStringToMap("code", capture[3] ?? ""),
|
|
@@ -1035,7 +1133,15 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
1035
1133
|
};
|
|
1036
1134
|
},
|
|
1037
1135
|
_render(node, _output, state = {}) {
|
|
1038
|
-
|
|
1136
|
+
const start = performance.now();
|
|
1137
|
+
const result = h("code", { key: state.key }, node.text);
|
|
1138
|
+
const duration = performance.now() - start;
|
|
1139
|
+
if (duration > 1) {
|
|
1140
|
+
console.log(
|
|
1141
|
+
`codeInline._render: ${duration.toFixed(3)}ms, text length: ${node.text.length}`
|
|
1142
|
+
);
|
|
1143
|
+
}
|
|
1144
|
+
return result;
|
|
1039
1145
|
}
|
|
1040
1146
|
},
|
|
1041
1147
|
/**
|
|
@@ -1103,18 +1209,34 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
1103
1209
|
),
|
|
1104
1210
|
_order: Priority.HIGH,
|
|
1105
1211
|
_parse(capture, parse, state) {
|
|
1106
|
-
|
|
1212
|
+
const start = performance.now();
|
|
1213
|
+
const result = {
|
|
1107
1214
|
children: parseInline(parse, capture[2], state),
|
|
1108
1215
|
id: slug(capture[2], slugify),
|
|
1109
1216
|
level: capture[1].length
|
|
1110
1217
|
};
|
|
1218
|
+
const duration = performance.now() - start;
|
|
1219
|
+
if (duration > 1) {
|
|
1220
|
+
console.log(
|
|
1221
|
+
`heading._parse: ${duration.toFixed(3)}ms, capture length: ${capture[0].length}, level: ${capture[1].length}`
|
|
1222
|
+
);
|
|
1223
|
+
}
|
|
1224
|
+
return result;
|
|
1111
1225
|
},
|
|
1112
1226
|
_render(node, _output, state = {}) {
|
|
1113
|
-
|
|
1227
|
+
const start = performance.now();
|
|
1228
|
+
const result = h(
|
|
1114
1229
|
`h${node.level}`,
|
|
1115
1230
|
{ id: node.id, key: state.key },
|
|
1116
1231
|
_output(node.children, state)
|
|
1117
1232
|
);
|
|
1233
|
+
const duration = performance.now() - start;
|
|
1234
|
+
if (duration > 1) {
|
|
1235
|
+
console.log(
|
|
1236
|
+
`heading._render: ${duration.toFixed(3)}ms, level: ${node.level}, children count: ${node.children.length}, id: ${node.id}`
|
|
1237
|
+
);
|
|
1238
|
+
}
|
|
1239
|
+
return result;
|
|
1118
1240
|
}
|
|
1119
1241
|
},
|
|
1120
1242
|
[RuleType.headingSetext]: {
|
|
@@ -1129,7 +1251,13 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
1129
1251
|
}
|
|
1130
1252
|
},
|
|
1131
1253
|
[RuleType.htmlBlock]: {
|
|
1132
|
-
_qualify:
|
|
1254
|
+
_qualify: (source) => {
|
|
1255
|
+
if (options.disableParsingRawHTML) return false;
|
|
1256
|
+
if (source[0] !== "<") return false;
|
|
1257
|
+
if (!/^<([a-z][a-z0-9:-]*)\b/.test(source)) return false;
|
|
1258
|
+
const tag = source.match(/^<([a-z][a-z0-9:-]*)\b/)?.[1];
|
|
1259
|
+
return tag ? source.indexOf(`</${tag}>`) !== -1 : false;
|
|
1260
|
+
},
|
|
1133
1261
|
/**
|
|
1134
1262
|
* find the first matching end tag and process the interior
|
|
1135
1263
|
*/
|
|
@@ -1166,15 +1294,27 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
1166
1294
|
return ast;
|
|
1167
1295
|
},
|
|
1168
1296
|
_render(node, _output, state = {}) {
|
|
1169
|
-
|
|
1297
|
+
const start = performance.now();
|
|
1298
|
+
const result = h(
|
|
1170
1299
|
node.tag,
|
|
1171
1300
|
{ key: state.key, ...node.attrs ?? {} },
|
|
1172
1301
|
node.text ?? (node.children ? _output(node.children, state) : "")
|
|
1173
1302
|
);
|
|
1303
|
+
const duration = performance.now() - start;
|
|
1304
|
+
if (duration > 1) {
|
|
1305
|
+
console.log(
|
|
1306
|
+
`htmlBlock._render: ${duration.toFixed(3)}ms, tag: ${node.tag}, has text: ${!!node.text}, has children: ${!!node.children}`
|
|
1307
|
+
);
|
|
1308
|
+
}
|
|
1309
|
+
return result;
|
|
1174
1310
|
}
|
|
1175
1311
|
},
|
|
1176
1312
|
[RuleType.htmlSelfClosing]: {
|
|
1177
|
-
_qualify:
|
|
1313
|
+
_qualify: (source) => {
|
|
1314
|
+
if (options.disableParsingRawHTML) return false;
|
|
1315
|
+
if (source[0] !== "<") return false;
|
|
1316
|
+
return /^<([a-zA-Z][a-zA-Z0-9:]*)[\s>/]/.test(source);
|
|
1317
|
+
},
|
|
1178
1318
|
/**
|
|
1179
1319
|
* find the first matching end tag and process the interior
|
|
1180
1320
|
*/
|
|
@@ -1188,10 +1328,18 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
1188
1328
|
};
|
|
1189
1329
|
},
|
|
1190
1330
|
_render(node, _output, state = {}) {
|
|
1191
|
-
|
|
1331
|
+
const start = performance.now();
|
|
1332
|
+
const result = h(node.tag, {
|
|
1192
1333
|
key: state.key,
|
|
1193
1334
|
...node.attrs ?? {}
|
|
1194
1335
|
});
|
|
1336
|
+
const duration = performance.now() - start;
|
|
1337
|
+
if (duration > 1) {
|
|
1338
|
+
console.log(
|
|
1339
|
+
`htmlSelfClosing._render: ${duration.toFixed(3)}ms, tag: ${node.tag}`
|
|
1340
|
+
);
|
|
1341
|
+
}
|
|
1342
|
+
return result;
|
|
1195
1343
|
}
|
|
1196
1344
|
},
|
|
1197
1345
|
[RuleType.htmlComment]: {
|
|
@@ -1379,9 +1527,27 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
1379
1527
|
[RuleType.paragraph]: {
|
|
1380
1528
|
_match: allowInline(matchParagraph),
|
|
1381
1529
|
_order: Priority.LOW,
|
|
1382
|
-
_parse
|
|
1530
|
+
_parse(capture, parse, state) {
|
|
1531
|
+
const start = performance.now();
|
|
1532
|
+
const result = parseCaptureInline(capture, parse, state);
|
|
1533
|
+
const duration = performance.now() - start;
|
|
1534
|
+
if (duration > 1) {
|
|
1535
|
+
console.log(
|
|
1536
|
+
`paragraph._parse: ${duration.toFixed(3)}ms, capture length: ${capture[0].length}`
|
|
1537
|
+
);
|
|
1538
|
+
}
|
|
1539
|
+
return result;
|
|
1540
|
+
},
|
|
1383
1541
|
_render(node, _output, state = {}) {
|
|
1384
|
-
|
|
1542
|
+
const start = performance.now();
|
|
1543
|
+
const result = /* @__PURE__ */ jsxRuntime.jsx("p", { children: _output(node.children, state) }, state.key);
|
|
1544
|
+
const duration = performance.now() - start;
|
|
1545
|
+
if (duration > 1) {
|
|
1546
|
+
console.log(
|
|
1547
|
+
`paragraph._render: ${duration.toFixed(3)}ms, children count: ${node.children.length}`
|
|
1548
|
+
);
|
|
1549
|
+
}
|
|
1550
|
+
return result;
|
|
1385
1551
|
}
|
|
1386
1552
|
},
|
|
1387
1553
|
[RuleType.ref]: {
|
|
@@ -1446,10 +1612,21 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
1446
1612
|
_qualify: ["|"],
|
|
1447
1613
|
_match: blockRegex(NP_TABLE_R),
|
|
1448
1614
|
_order: Priority.HIGH,
|
|
1449
|
-
_parse
|
|
1615
|
+
_parse(capture, parse, state) {
|
|
1616
|
+
const start = performance.now();
|
|
1617
|
+
const result = parseTable(capture, parse, state);
|
|
1618
|
+
const duration = performance.now() - start;
|
|
1619
|
+
if (duration > 1) {
|
|
1620
|
+
console.log(
|
|
1621
|
+
`table._parse: ${duration.toFixed(3)}ms, capture length: ${capture[0].length}`
|
|
1622
|
+
);
|
|
1623
|
+
}
|
|
1624
|
+
return result;
|
|
1625
|
+
},
|
|
1450
1626
|
_render(node, _output, state = {}) {
|
|
1627
|
+
const start = performance.now();
|
|
1451
1628
|
const table = node;
|
|
1452
|
-
|
|
1629
|
+
const result = h(
|
|
1453
1630
|
"table",
|
|
1454
1631
|
{ key: state.key },
|
|
1455
1632
|
h(
|
|
@@ -1485,6 +1662,13 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
1485
1662
|
)
|
|
1486
1663
|
)
|
|
1487
1664
|
);
|
|
1665
|
+
const duration = performance.now() - start;
|
|
1666
|
+
if (duration > 1) {
|
|
1667
|
+
console.log(
|
|
1668
|
+
`table._render: ${duration.toFixed(3)}ms, header count: ${table.header.length}, rows count: ${table.cells.length}`
|
|
1669
|
+
);
|
|
1670
|
+
}
|
|
1671
|
+
return result;
|
|
1488
1672
|
}
|
|
1489
1673
|
},
|
|
1490
1674
|
[RuleType.text]: {
|
|
@@ -1524,7 +1708,15 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
1524
1708
|
};
|
|
1525
1709
|
},
|
|
1526
1710
|
_render(node, _output, state = {}) {
|
|
1527
|
-
|
|
1711
|
+
const start = performance.now();
|
|
1712
|
+
const result = /* @__PURE__ */ jsxRuntime.jsx("strong", { children: _output(node.children, state) }, state.key);
|
|
1713
|
+
const duration = performance.now() - start;
|
|
1714
|
+
if (duration > 1) {
|
|
1715
|
+
console.log(
|
|
1716
|
+
`textBolded._render: ${duration.toFixed(3)}ms, children count: ${node.children.length}`
|
|
1717
|
+
);
|
|
1718
|
+
}
|
|
1719
|
+
return result;
|
|
1528
1720
|
}
|
|
1529
1721
|
},
|
|
1530
1722
|
[RuleType.textEmphasized]: {
|
|
@@ -1542,7 +1734,15 @@ const compiler = (markdown = "", options = {}) => {
|
|
|
1542
1734
|
};
|
|
1543
1735
|
},
|
|
1544
1736
|
_render(node, _output, state = {}) {
|
|
1545
|
-
|
|
1737
|
+
const start = performance.now();
|
|
1738
|
+
const result = /* @__PURE__ */ jsxRuntime.jsx("em", { children: _output(node.children, state) }, state.key);
|
|
1739
|
+
const duration = performance.now() - start;
|
|
1740
|
+
if (duration > 1) {
|
|
1741
|
+
console.log(
|
|
1742
|
+
`textEmphasized._render: ${duration.toFixed(3)}ms, children count: ${node.children.length}`
|
|
1743
|
+
);
|
|
1744
|
+
}
|
|
1745
|
+
return result;
|
|
1546
1746
|
}
|
|
1547
1747
|
},
|
|
1548
1748
|
[RuleType.textEscaped]: {
|
|
@@ -1616,4 +1816,4 @@ exports.RuleType = RuleType;
|
|
|
1616
1816
|
exports.compiler = compiler;
|
|
1617
1817
|
exports.sanitizer = sanitizer;
|
|
1618
1818
|
exports.slugify = slugify;
|
|
1619
|
-
//# sourceMappingURL=
|
|
1819
|
+
//# sourceMappingURL=processor.cjs.map
|