roamjs-components 0.85.3 → 0.85.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/LICENSE +21 -21
- package/README.md +29 -29
- package/components/AutocompleteInput.d.ts +29 -28
- package/components/AutocompleteInput.js +132 -120
- package/components/AutocompleteInput.js.map +1 -1
- package/components/BlockErrorBoundary.d.ts +15 -15
- package/components/BlockErrorBoundary.js +27 -27
- package/components/BlockInput.d.ts +13 -13
- package/components/BlockInput.js +55 -55
- package/components/ComponentContainer.d.ts +10 -10
- package/components/ComponentContainer.js +37 -37
- package/components/ConfigPage.d.ts +35 -35
- package/components/ConfigPage.js +159 -159
- package/components/ConfigPanels/BlockPanel.d.ts +3 -3
- package/components/ConfigPanels/BlockPanel.js +42 -42
- package/components/ConfigPanels/BlocksPanel.d.ts +3 -3
- package/components/ConfigPanels/BlocksPanel.js +58 -58
- package/components/ConfigPanels/CustomPanel.d.ts +3 -3
- package/components/ConfigPanels/CustomPanel.js +24 -24
- package/components/ConfigPanels/FlagPanel.d.ts +3 -3
- package/components/ConfigPanels/FlagPanel.js +31 -31
- package/components/ConfigPanels/MultiChildPanel.d.ts +9 -9
- package/components/ConfigPanels/MultiChildPanel.js +58 -58
- package/components/ConfigPanels/MultiTextPanel.d.ts +3 -3
- package/components/ConfigPanels/MultiTextPanel.js +14 -14
- package/components/ConfigPanels/NumberPanel.d.ts +3 -3
- package/components/ConfigPanels/NumberPanel.js +25 -25
- package/components/ConfigPanels/OauthPanel.d.ts +3 -3
- package/components/ConfigPanels/OauthPanel.js +81 -81
- package/components/ConfigPanels/PagesPanel.d.ts +3 -3
- package/components/ConfigPanels/PagesPanel.js +11 -11
- package/components/ConfigPanels/SelectPanel.d.ts +3 -3
- package/components/ConfigPanels/SelectPanel.js +27 -27
- package/components/ConfigPanels/TextPanel.d.ts +3 -3
- package/components/ConfigPanels/TextPanel.js +28 -28
- package/components/ConfigPanels/TimePanel.d.ts +3 -3
- package/components/ConfigPanels/TimePanel.js +34 -34
- package/components/ConfigPanels/getBrandColors.d.ts +7 -7
- package/components/ConfigPanels/getBrandColors.js +28 -28
- package/components/ConfigPanels/types.d.ts +84 -84
- package/components/ConfigPanels/types.js +2 -2
- package/components/ConfigPanels/types.js.map +1 -1
- package/components/ConfigPanels/useSingleChildValue.d.ts +13 -13
- package/components/ConfigPanels/useSingleChildValue.js +43 -43
- package/components/CursorMenu.d.ts +21 -21
- package/components/CursorMenu.js +181 -181
- package/components/Description.d.ts +5 -5
- package/components/Description.js +16 -16
- package/components/ExtensionApiContext.d.ts +31 -31
- package/components/ExtensionApiContext.js +16 -16
- package/components/ExternalLogin.d.ts +18 -18
- package/components/ExternalLogin.js +141 -141
- package/components/Filter.d.ts +15 -15
- package/components/Filter.js +142 -142
- package/components/FormDialog.d.ts +55 -55
- package/components/FormDialog.js +217 -217
- package/components/FormDialog.js.map +1 -1
- package/components/Loading.d.ts +4 -4
- package/components/Loading.js +35 -35
- package/components/MenuItemSelect.d.ts +17 -17
- package/components/MenuItemSelect.js +23 -23
- package/components/OauthPanel.d.ts +7 -7
- package/components/OauthPanel.js +30 -30
- package/components/OauthSelect.d.ts +5 -5
- package/components/OauthSelect.js +25 -25
- package/components/PageInput.d.ts +6 -6
- package/components/PageInput.js +13 -13
- package/components/PageLink.d.ts +6 -6
- package/components/PageLink.js +31 -31
- package/components/ProgressDialog.d.ts +11 -11
- package/components/ProgressDialog.js +48 -48
- package/components/SimpleAlert.d.ts +15 -15
- package/components/SimpleAlert.js +47 -47
- package/components/Toast.d.ts +15 -15
- package/components/Toast.js +50 -50
- package/components/index.js +4 -4
- package/components/index.js.map +1 -1
- package/components.d.ts +5 -5
- package/components.js +172 -170
- package/components.js.map +1 -1
- package/date/constants.d.ts +3 -3
- package/date/constants.js +19 -19
- package/date/constants.js.map +1 -1
- package/date/index.d.ts +3 -3
- package/date/index.js +9 -9
- package/date/index.js.map +1 -1
- package/date/parseNlpDate.d.ts +5 -5
- package/date/parseNlpDate.js +226 -226
- package/date/parseNlpDate.js.map +1 -1
- package/date/parseRoamDateUid.d.ts +2 -2
- package/date/parseRoamDateUid.js +7 -7
- package/date/parseRoamDateUid.js.map +1 -1
- package/dom/addBlockCommand.d.ts +5 -5
- package/dom/addBlockCommand.js +53 -53
- package/dom/addBlockCommand.js.map +1 -1
- package/dom/addKeyboardTriggers.d.ts +11 -11
- package/dom/addKeyboardTriggers.js +38 -38
- package/dom/addKeyboardTriggers.js.map +1 -1
- package/dom/addOldRoamJSDependency.d.ts +2 -2
- package/dom/addOldRoamJSDependency.js +10 -10
- package/dom/addOldRoamJSDependency.js.map +1 -1
- package/dom/addRoamJSDependency.d.ts +2 -2
- package/dom/addRoamJSDependency.js +8 -8
- package/dom/addRoamJSDependency.js.map +1 -1
- package/dom/addScriptAsDependency.d.ts +6 -6
- package/dom/addScriptAsDependency.js +16 -16
- package/dom/addScriptAsDependency.js.map +1 -1
- package/dom/addStyle.d.ts +2 -2
- package/dom/addStyle.js +14 -14
- package/dom/addStyle.js.map +1 -1
- package/dom/constants.d.ts +1 -1
- package/dom/constants.js +4 -4
- package/dom/constants.js.map +1 -1
- package/dom/createBlockObserver.d.ts +7 -7
- package/dom/createBlockObserver.js +43 -43
- package/dom/createBlockObserver.js.map +1 -1
- package/dom/createButtonObserver.d.ts +6 -6
- package/dom/createButtonObserver.js +21 -21
- package/dom/createButtonObserver.js.map +1 -1
- package/dom/createDivObserver.d.ts +2 -2
- package/dom/createDivObserver.js +13 -13
- package/dom/createDivObserver.js.map +1 -1
- package/dom/createHTMLObserver.d.ts +8 -8
- package/dom/createHTMLObserver.js +24 -24
- package/dom/createHTMLObserver.js.map +1 -1
- package/dom/createHashtagObserver.d.ts +5 -5
- package/dom/createHashtagObserver.js +16 -16
- package/dom/createHashtagObserver.js.map +1 -1
- package/dom/createIconButton.d.ts +2 -2
- package/dom/createIconButton.js +12 -12
- package/dom/createIconButton.js.map +1 -1
- package/dom/createObserver.d.ts +2 -2
- package/dom/createObserver.js +9 -9
- package/dom/createObserver.js.map +1 -1
- package/dom/createOverlayObserver.d.ts +2 -2
- package/dom/createOverlayObserver.js +6 -6
- package/dom/createOverlayObserver.js.map +1 -1
- package/dom/createPageObserver.d.ts +2 -2
- package/dom/createPageObserver.js +34 -34
- package/dom/createPageObserver.js.map +1 -1
- package/dom/createPageTitleObserver.d.ts +6 -6
- package/dom/createPageTitleObserver.js +31 -31
- package/dom/createPageTitleObserver.js.map +1 -1
- package/dom/elToTitle.d.ts +2 -2
- package/dom/elToTitle.js +22 -22
- package/dom/elToTitle.js.map +1 -1
- package/dom/genericError.d.ts +3 -3
- package/dom/genericError.js +11 -11
- package/dom/genericError.js.map +1 -1
- package/dom/getActiveUids.d.ts +3 -3
- package/dom/getActiveUids.js +6 -6
- package/dom/getActiveUids.js.map +1 -1
- package/dom/getBlockUidFromTarget.d.ts +2 -2
- package/dom/getBlockUidFromTarget.js +33 -33
- package/dom/getBlockUidFromTarget.js.map +1 -1
- package/dom/getCurrentPageUid.d.ts +2 -2
- package/dom/getCurrentPageUid.js +8 -8
- package/dom/getCurrentPageUid.js.map +1 -1
- package/dom/getDomRefs.d.ts +2 -2
- package/dom/getDomRefs.js +12 -12
- package/dom/getDomRefs.js.map +1 -1
- package/dom/getDropUidOffset.d.ts +5 -5
- package/dom/getDropUidOffset.js +27 -27
- package/dom/getDropUidOffset.js.map +1 -1
- package/dom/getMutatedNodes.d.ts +7 -7
- package/dom/getMutatedNodes.js +11 -11
- package/dom/getMutatedNodes.js.map +1 -1
- package/dom/getPageTitleByHtmlElement.d.ts +2 -2
- package/dom/getPageTitleByHtmlElement.js +12 -12
- package/dom/getPageTitleByHtmlElement.js.map +1 -1
- package/dom/getPageTitleValueByHtmlElement.d.ts +2 -2
- package/dom/getPageTitleValueByHtmlElement.js +9 -9
- package/dom/getPageTitleValueByHtmlElement.js.map +1 -1
- package/dom/getReferenceBlockUid.d.ts +2 -2
- package/dom/getReferenceBlockUid.js +18 -18
- package/dom/getReferenceBlockUid.js.map +1 -1
- package/dom/getRoamUrl.d.ts +2 -2
- package/dom/getRoamUrl.js +4 -4
- package/dom/getRoamUrl.js.map +1 -1
- package/dom/getRoamUrlByPage.d.ts +2 -2
- package/dom/getRoamUrlByPage.js +10 -10
- package/dom/getRoamUrlByPage.js.map +1 -1
- package/dom/getUids.d.ts +3 -3
- package/dom/getUids.js +8 -8
- package/dom/getUids.js.map +1 -1
- package/dom/getUidsFromButton.d.ts +3 -3
- package/dom/getUidsFromButton.js +8 -8
- package/dom/getUidsFromButton.js.map +1 -1
- package/dom/getUidsFromId.d.ts +5 -5
- package/dom/getUidsFromId.js +15 -15
- package/dom/getUidsFromId.js.map +1 -1
- package/dom/index.d.ts +30 -30
- package/dom/index.js +63 -63
- package/dom/index.js.map +1 -1
- package/dom/parseRoamBlocksToHtml.d.ts +11 -11
- package/dom/parseRoamBlocksToHtml.js +79 -79
- package/dom/parseRoamBlocksToHtml.js.map +1 -1
- package/dom/resolveRefs.d.ts +2 -2
- package/dom/resolveRefs.js +24 -24
- package/dom/resolveRefs.js.map +1 -1
- package/events/index.d.ts +1 -1
- package/events/index.js +8 -8
- package/events/index.js.map +1 -1
- package/events/watchOnce.d.ts +3 -3
- package/events/watchOnce.js +12 -12
- package/events/watchOnce.js.map +1 -1
- package/hooks/index.d.ts +2 -2
- package/hooks/index.js +10 -10
- package/hooks/index.js.map +1 -1
- package/hooks/useArrowKeyDown.d.ts +10 -10
- package/hooks/useArrowKeyDown.js +54 -54
- package/hooks/useArrowKeyDown.js.map +1 -1
- package/hooks/useSubTree.d.ts +3 -3
- package/hooks/useSubTree.js +11 -11
- package/hooks/useSubTree.js.map +1 -1
- package/marked/index.d.ts +25 -25
- package/marked/index.js +567 -567
- package/marked/index.js.map +1 -1
- package/package.json +116 -116
- package/queries/compileDatalog.d.ts +3 -3
- package/queries/compileDatalog.js +63 -63
- package/queries/compileDatalog.js.map +1 -1
- package/queries/getAllBlockUids.d.ts +2 -2
- package/queries/getAllBlockUids.js +6 -6
- package/queries/getAllBlockUids.js.map +1 -1
- package/queries/getAllBlockUidsAndTexts.d.ts +5 -5
- package/queries/getAllBlockUidsAndTexts.js +6 -6
- package/queries/getAllBlockUidsAndTexts.js.map +1 -1
- package/queries/getAllPageNames.d.ts +2 -2
- package/queries/getAllPageNames.js +6 -6
- package/queries/getAllPageNames.js.map +1 -1
- package/queries/getAttributeValueByBlockAndName.d.ts +5 -5
- package/queries/getAttributeValueByBlockAndName.js +11 -11
- package/queries/getAttributeValueByBlockAndName.js.map +1 -1
- package/queries/getBasicTreeByParentUid.d.ts +3 -3
- package/queries/getBasicTreeByParentUid.js +13 -13
- package/queries/getBasicTreeByParentUid.js.map +1 -1
- package/queries/getBlockUidAndTextIncludingText.d.ts +5 -5
- package/queries/getBlockUidAndTextIncludingText.js +7 -7
- package/queries/getBlockUidAndTextIncludingText.js.map +1 -1
- package/queries/getBlockUidByTextOnPage.d.ts +5 -5
- package/queries/getBlockUidByTextOnPage.js +7 -7
- package/queries/getBlockUidByTextOnPage.js.map +1 -1
- package/queries/getBlockUidsAndTextsReferencingPage.d.ts +5 -5
- package/queries/getBlockUidsAndTextsReferencingPage.js +9 -9
- package/queries/getBlockUidsAndTextsReferencingPage.js.map +1 -1
- package/queries/getBlockUidsByPageTitle.d.ts +2 -2
- package/queries/getBlockUidsByPageTitle.js +8 -8
- package/queries/getBlockUidsByPageTitle.js.map +1 -1
- package/queries/getBlockUidsReferencingBlock.d.ts +2 -2
- package/queries/getBlockUidsReferencingBlock.js +4 -4
- package/queries/getBlockUidsReferencingBlock.js.map +1 -1
- package/queries/getBlockUidsReferencingPage.d.ts +2 -2
- package/queries/getBlockUidsReferencingPage.js +6 -6
- package/queries/getBlockUidsReferencingPage.js.map +1 -1
- package/queries/getBlockUidsWithParentUid.d.ts +2 -2
- package/queries/getBlockUidsWithParentUid.js +6 -6
- package/queries/getBlockUidsWithParentUid.js.map +1 -1
- package/queries/getChildrenLengthByPageUid.d.ts +2 -2
- package/queries/getChildrenLengthByPageUid.js +8 -8
- package/queries/getChildrenLengthByPageUid.js.map +1 -1
- package/queries/getChildrenLengthByParentUid.d.ts +2 -2
- package/queries/getChildrenLengthByParentUid.js +7 -7
- package/queries/getChildrenLengthByParentUid.js.map +1 -1
- package/queries/getCreateTimeByBlockUid.d.ts +2 -2
- package/queries/getCreateTimeByBlockUid.js +7 -7
- package/queries/getCreateTimeByBlockUid.js.map +1 -1
- package/queries/getCurrentUser.d.ts +2 -2
- package/queries/getCurrentUser.js +11 -11
- package/queries/getCurrentUser.js.map +1 -1
- package/queries/getCurrentUserDisplayName.d.ts +2 -2
- package/queries/getCurrentUserDisplayName.js +10 -10
- package/queries/getCurrentUserDisplayName.js.map +1 -1
- package/queries/getCurrentUserEmail.d.ts +2 -2
- package/queries/getCurrentUserEmail.js +13 -13
- package/queries/getCurrentUserEmail.js.map +1 -1
- package/queries/getCurrentUserUid.d.ts +2 -2
- package/queries/getCurrentUserUid.js +13 -13
- package/queries/getCurrentUserUid.js.map +1 -1
- package/queries/getDisplayNameByEmail.d.ts +2 -2
- package/queries/getDisplayNameByEmail.js +7 -7
- package/queries/getDisplayNameByEmail.js.map +1 -1
- package/queries/getDisplayNameByUid.d.ts +2 -2
- package/queries/getDisplayNameByUid.js +7 -7
- package/queries/getDisplayNameByUid.js.map +1 -1
- package/queries/getEditTimeByBlockUid.d.ts +2 -2
- package/queries/getEditTimeByBlockUid.js +7 -7
- package/queries/getEditTimeByBlockUid.js.map +1 -1
- package/queries/getEditedUserEmailByBlockUid.d.ts +2 -2
- package/queries/getEditedUserEmailByBlockUid.js +7 -7
- package/queries/getEditedUserEmailByBlockUid.js.map +1 -1
- package/queries/getFirstChildTextByBlockUid.d.ts +2 -2
- package/queries/getFirstChildTextByBlockUid.js +7 -7
- package/queries/getFirstChildTextByBlockUid.js.map +1 -1
- package/queries/getFirstChildUidByBlockUid.d.ts +2 -2
- package/queries/getFirstChildUidByBlockUid.js +6 -6
- package/queries/getFirstChildUidByBlockUid.js.map +1 -1
- package/queries/getFullTreeByParentUid.d.ts +3 -3
- package/queries/getFullTreeByParentUid.js +51 -51
- package/queries/getFullTreeByParentUid.js.map +1 -1
- package/queries/getLinkedPageTitlesUnderUid.d.ts +2 -2
- package/queries/getLinkedPageTitlesUnderUid.js +6 -6
- package/queries/getLinkedPageTitlesUnderUid.js.map +1 -1
- package/queries/getNthChildUidByBlockUid.d.ts +5 -5
- package/queries/getNthChildUidByBlockUid.js +7 -7
- package/queries/getNthChildUidByBlockUid.js.map +1 -1
- package/queries/getOrderByBlockUid.d.ts +2 -2
- package/queries/getOrderByBlockUid.js +7 -7
- package/queries/getOrderByBlockUid.js.map +1 -1
- package/queries/getPageTitleByBlockUid.d.ts +2 -2
- package/queries/getPageTitleByBlockUid.js +7 -7
- package/queries/getPageTitleByBlockUid.js.map +1 -1
- package/queries/getPageTitleByPageUid.d.ts +2 -2
- package/queries/getPageTitleByPageUid.js +12 -12
- package/queries/getPageTitleByPageUid.js.map +1 -1
- package/queries/getPageTitleReferencesByPageTitle.d.ts +2 -2
- package/queries/getPageTitleReferencesByPageTitle.js +6 -6
- package/queries/getPageTitleReferencesByPageTitle.js.map +1 -1
- package/queries/getPageTitlesAndBlockUidsReferencingPage.d.ts +5 -5
- package/queries/getPageTitlesAndBlockUidsReferencingPage.js +9 -9
- package/queries/getPageTitlesAndBlockUidsReferencingPage.js.map +1 -1
- package/queries/getPageTitlesAndUidsDirectlyReferencingPage.d.ts +5 -5
- package/queries/getPageTitlesAndUidsDirectlyReferencingPage.js +9 -9
- package/queries/getPageTitlesAndUidsDirectlyReferencingPage.js.map +1 -1
- package/queries/getPageTitlesReferencingBlockUid.d.ts +2 -2
- package/queries/getPageTitlesReferencingBlockUid.js +4 -4
- package/queries/getPageTitlesReferencingBlockUid.js.map +1 -1
- package/queries/getPageTitlesStartingWithPrefix.d.ts +2 -2
- package/queries/getPageTitlesStartingWithPrefix.js +6 -6
- package/queries/getPageTitlesStartingWithPrefix.js.map +1 -1
- package/queries/getPageUidByBlockUid.d.ts +2 -2
- package/queries/getPageUidByBlockUid.js +7 -7
- package/queries/getPageUidByBlockUid.js.map +1 -1
- package/queries/getPageUidByPageTitle.d.ts +2 -2
- package/queries/getPageUidByPageTitle.js +9 -9
- package/queries/getPageUidByPageTitle.js.map +1 -1
- package/queries/getPageViewType.d.ts +3 -3
- package/queries/getPageViewType.js +9 -9
- package/queries/getPageViewType.js.map +1 -1
- package/queries/getParentTextByBlockUid.d.ts +2 -2
- package/queries/getParentTextByBlockUid.js +7 -7
- package/queries/getParentTextByBlockUid.js.map +1 -1
- package/queries/getParentTextByBlockUidAndTag.d.ts +5 -5
- package/queries/getParentTextByBlockUidAndTag.js +7 -7
- package/queries/getParentTextByBlockUidAndTag.js.map +1 -1
- package/queries/getParentUidByBlockUid.d.ts +2 -2
- package/queries/getParentUidByBlockUid.js +7 -7
- package/queries/getParentUidByBlockUid.js.map +1 -1
- package/queries/getParentUidsOfBlockUid.d.ts +2 -2
- package/queries/getParentUidsOfBlockUid.js +4 -4
- package/queries/getParentUidsOfBlockUid.js.map +1 -1
- package/queries/getSettingsByEmail.d.ts +3 -3
- package/queries/getSettingsByEmail.js +7 -7
- package/queries/getSettingsByEmail.js.map +1 -1
- package/queries/getShallowTreeByParentUid.d.ts +5 -5
- package/queries/getShallowTreeByParentUid.js +9 -9
- package/queries/getShallowTreeByParentUid.js.map +1 -1
- package/queries/getTextByBlockUid.d.ts +2 -2
- package/queries/getTextByBlockUid.js +9 -9
- package/queries/getTextByBlockUid.js.map +1 -1
- package/queries/index.js +4 -4
- package/queries/index.js.map +1 -1
- package/queries/isLiveBlock.d.ts +2 -2
- package/queries/isLiveBlock.js +4 -4
- package/queries/isLiveBlock.js.map +1 -1
- package/queries/isTagOnPage.d.ts +5 -5
- package/queries/isTagOnPage.js +9 -9
- package/queries/isTagOnPage.js.map +1 -1
- package/queries/normalizePageTitle.d.ts +2 -2
- package/queries/normalizePageTitle.js +4 -4
- package/queries/normalizePageTitle.js.map +1 -1
- package/scripts/index.d.ts +1 -1
- package/scripts/index.js +26 -26
- package/scripts/index.js.map +1 -1
- package/scripts/publishToRoamDepot.d.ts +7 -7
- package/scripts/publishToRoamDepot.js +113 -113
- package/scripts/publishToRoamDepot.js.map +1 -1
- package/testing/mockRoamEnvironment.d.ts +2 -2
- package/testing/mockRoamEnvironment.js +1253 -1253
- package/testing/mockRoamEnvironment.js.map +1 -1
- package/types/index.d.ts +389 -250
- package/types/index.js +4 -4
- package/types/index.js.map +1 -1
- package/types/native.d.ts +405 -402
- package/types/native.js +4 -4
- package/types/native.js.map +1 -1
- package/types/query-builder.d.ts +10 -10
- package/types/query-builder.js +2 -2
- package/types/query-builder.js.map +1 -1
- package/types/smartblocks.d.ts +35 -35
- package/types/smartblocks.js +2 -2
- package/types/smartblocks.js.map +1 -1
- package/util/addInputSetting.d.ts +7 -7
- package/util/addInputSetting.js +25 -25
- package/util/addInputSetting.js.map +1 -1
- package/util/apiDelete.d.ts +2 -2
- package/util/apiDelete.js +6 -6
- package/util/apiDelete.js.map +1 -1
- package/util/apiGet.d.ts +2 -2
- package/util/apiGet.js +6 -6
- package/util/apiGet.js.map +1 -1
- package/util/apiPost.d.ts +2 -2
- package/util/apiPost.js +6 -6
- package/util/apiPost.js.map +1 -1
- package/util/apiPut.d.ts +2 -2
- package/util/apiPut.js +6 -6
- package/util/apiPut.js.map +1 -1
- package/util/createOverlayRender.d.ts +4 -4
- package/util/createOverlayRender.js +6 -6
- package/util/createOverlayRender.js.map +1 -1
- package/util/createTagRegex.d.ts +2 -2
- package/util/createTagRegex.js +7 -7
- package/util/createTagRegex.js.map +1 -1
- package/util/dispatchToRegistry.d.ts +3 -3
- package/util/dispatchToRegistry.js +7 -7
- package/util/dispatchToRegistry.js.map +1 -1
- package/util/env.d.ts +4 -4
- package/util/env.js +47 -47
- package/util/env.js.map +1 -1
- package/util/extensionApiContext.d.ts +29 -29
- package/util/extensionApiContext.js +17 -17
- package/util/extensionApiContext.js.map +1 -1
- package/util/extensionDeprecatedWarning.d.ts +5 -5
- package/util/extensionDeprecatedWarning.js +39 -39
- package/util/extensionDeprecatedWarning.js.map +1 -1
- package/util/extractRef.d.ts +2 -2
- package/util/extractRef.js +8 -8
- package/util/extractRef.js.map +1 -1
- package/util/extractTag.d.ts +2 -2
- package/util/extractTag.js +15 -15
- package/util/extractTag.js.map +1 -1
- package/util/focusMainWindowBlock.d.ts +2 -2
- package/util/focusMainWindowBlock.js +12 -12
- package/util/focusMainWindowBlock.js.map +1 -1
- package/util/getAuthorizationHeader.d.ts +2 -2
- package/util/getAuthorizationHeader.js +12 -12
- package/util/getAuthorizationHeader.js.map +1 -1
- package/util/getLocalStorageKey.d.ts +2 -2
- package/util/getLocalStorageKey.js +4 -4
- package/util/getLocalStorageKey.js.map +1 -1
- package/util/getOauth.d.ts +2 -2
- package/util/getOauth.js +52 -52
- package/util/getOauth.js.map +1 -1
- package/util/getOauthAccounts.d.ts +2 -2
- package/util/getOauthAccounts.js +22 -22
- package/util/getOauthAccounts.js.map +1 -1
- package/util/getRenderRoot.d.ts +2 -2
- package/util/getRenderRoot.js +18 -18
- package/util/getRenderRoot.js.map +1 -1
- package/util/getSettingIntFromTree.d.ts +7 -7
- package/util/getSettingIntFromTree.js +11 -11
- package/util/getSettingIntFromTree.js.map +1 -1
- package/util/getSettingValueFromTree.d.ts +8 -8
- package/util/getSettingValueFromTree.js +14 -14
- package/util/getSettingValueFromTree.js.map +1 -1
- package/util/getSettingValuesFromTree.d.ts +7 -7
- package/util/getSettingValuesFromTree.js +12 -12
- package/util/getSettingValuesFromTree.js.map +1 -1
- package/util/getSubTree.d.ts +8 -8
- package/util/getSubTree.js +19 -19
- package/util/getSubTree.js.map +1 -1
- package/util/getToken.d.ts +2 -2
- package/util/getToken.js +10 -10
- package/util/getToken.js.map +1 -1
- package/util/getTokenFromTree.d.ts +3 -3
- package/util/getTokenFromTree.js +4 -4
- package/util/getTokenFromTree.js.map +1 -1
- package/util/getWorkerClient.d.ts +12 -12
- package/util/getWorkerClient.js +41 -41
- package/util/getWorkerClient.js.map +1 -1
- package/util/handleBodyFetch.d.ts +3 -3
- package/util/handleBodyFetch.js +21 -21
- package/util/handleBodyFetch.js.map +1 -1
- package/util/handleFetch.d.ts +13 -13
- package/util/handleFetch.js +40 -40
- package/util/handleFetch.js.map +1 -1
- package/util/handleUrlFetch.d.ts +3 -3
- package/util/handleUrlFetch.js +19 -19
- package/util/handleUrlFetch.js.map +1 -1
- package/util/idToTitle.d.ts +2 -2
- package/util/idToTitle.js +8 -8
- package/util/idToTitle.js.map +1 -1
- package/util/index.d.ts +24 -24
- package/util/index.js +54 -54
- package/util/index.js.map +1 -1
- package/util/isControl.d.ts +2 -2
- package/util/isControl.js +4 -4
- package/util/isControl.js.map +1 -1
- package/util/localStorageGet.d.ts +2 -2
- package/util/localStorageGet.js +8 -8
- package/util/localStorageGet.js.map +1 -1
- package/util/localStorageRemove.d.ts +2 -2
- package/util/localStorageRemove.js +6 -6
- package/util/localStorageRemove.js.map +1 -1
- package/util/localStorageSet.d.ts +2 -2
- package/util/localStorageSet.js +8 -8
- package/util/localStorageSet.js.map +1 -1
- package/util/registerExperimentalMode.d.ts +6 -6
- package/util/registerExperimentalMode.js +65 -65
- package/util/registerExperimentalMode.js.map +1 -1
- package/util/registerSmartBlocksCommand.d.ts +3 -3
- package/util/registerSmartBlocksCommand.js +23 -23
- package/util/registerSmartBlocksCommand.js.map +1 -1
- package/util/removeFromRegistry.d.ts +3 -3
- package/util/removeFromRegistry.js +7 -7
- package/util/removeFromRegistry.js.map +1 -1
- package/util/renderOverlay.d.ts +12 -12
- package/util/renderOverlay.js +48 -48
- package/util/renderOverlay.js.map +1 -1
- package/util/renderWithUnmount.d.ts +4 -4
- package/util/renderWithUnmount.js +44 -44
- package/util/renderWithUnmount.js.map +1 -1
- package/util/runExtension.d.ts +11 -11
- package/util/runExtension.js +174 -174
- package/util/runExtension.js.map +1 -1
- package/util/setInputSetting.d.ts +7 -7
- package/util/setInputSetting.js +37 -37
- package/util/setInputSetting.js.map +1 -1
- package/util/setInputSettings.d.ts +7 -7
- package/util/setInputSettings.js +28 -28
- package/util/setInputSettings.js.map +1 -1
- package/util/stripUid.d.ts +3 -3
- package/util/stripUid.js +10 -10
- package/util/stripUid.js.map +1 -1
- package/util/toConfigPageName.d.ts +2 -2
- package/util/toConfigPageName.js +4 -4
- package/util/toConfigPageName.js.map +1 -1
- package/util/toFlexRegex.d.ts +2 -2
- package/util/toFlexRegex.js +4 -4
- package/util/toFlexRegex.js.map +1 -1
- package/writes/clearBlockById.d.ts +2 -2
- package/writes/clearBlockById.js +17 -17
- package/writes/clearBlockById.js.map +1 -1
- package/writes/clearBlockByUid.d.ts +2 -2
- package/writes/clearBlockByUid.js +16 -16
- package/writes/clearBlockByUid.js.map +1 -1
- package/writes/createBlock.d.ts +8 -8
- package/writes/createBlock.js +28 -28
- package/writes/createBlock.js.map +1 -1
- package/writes/createPage.d.ts +7 -7
- package/writes/createPage.js +20 -20
- package/writes/createPage.js.map +1 -1
- package/writes/deleteBlock.d.ts +2 -2
- package/writes/deleteBlock.js +10 -10
- package/writes/deleteBlock.js.map +1 -1
- package/writes/index.d.ts +8 -8
- package/writes/index.js +22 -22
- package/writes/index.js.map +1 -1
- package/writes/openBlockInSidebar.d.ts +2 -2
- package/writes/openBlockInSidebar.js +13 -13
- package/writes/openBlockInSidebar.js.map +1 -1
- package/writes/submitActions.d.ts +8 -8
- package/writes/submitActions.js +36 -36
- package/writes/submitActions.js.map +1 -1
- package/writes/updateActiveBlock.d.ts +2 -2
- package/writes/updateActiveBlock.js +17 -17
- package/writes/updateActiveBlock.js.map +1 -1
- package/writes/updateBlock.d.ts +5 -5
- package/writes/updateBlock.js +23 -23
- package/writes/updateBlock.js.map +1 -1
package/marked/index.js
CHANGED
|
@@ -1,568 +1,568 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parse = exports.parseInline = exports.lexer = exports.inlineLexer = exports.getParse = exports.getParseInline = exports.getLexer = exports.getInlineLexer = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const xregexp_1 = tslib_1.__importDefault(require("xregexp"));
|
|
6
|
-
const refractor_1 = tslib_1.__importDefault(require("refractor"));
|
|
7
|
-
const markdown_1 = tslib_1.__importDefault(require("refractor/lang/markdown"));
|
|
8
|
-
const yaml_1 = tslib_1.__importDefault(require("refractor/lang/yaml"));
|
|
9
|
-
const css_1 = tslib_1.__importDefault(require("refractor/lang/css"));
|
|
10
|
-
const bash_1 = tslib_1.__importDefault(require("refractor/lang/bash"));
|
|
11
|
-
const java_1 = tslib_1.__importDefault(require("refractor/lang/java"));
|
|
12
|
-
const rust_1 = tslib_1.__importDefault(require("refractor/lang/rust"));
|
|
13
|
-
const python_1 = tslib_1.__importDefault(require("refractor/lang/python"));
|
|
14
|
-
const csharp_1 = tslib_1.__importDefault(require("refractor/lang/csharp"));
|
|
15
|
-
const clojure_1 = tslib_1.__importDefault(require("refractor/lang/clojure"));
|
|
16
|
-
const hcl_1 = tslib_1.__importDefault(require("refractor/lang/hcl"));
|
|
17
|
-
const hast_util_to_html_1 = tslib_1.__importDefault(require("hast-util-to-html"));
|
|
18
|
-
refractor_1.default.register(markdown_1.default);
|
|
19
|
-
refractor_1.default.register(yaml_1.default);
|
|
20
|
-
refractor_1.default.register(css_1.default);
|
|
21
|
-
refractor_1.default.register(bash_1.default);
|
|
22
|
-
refractor_1.default.register(java_1.default);
|
|
23
|
-
refractor_1.default.register(rust_1.default);
|
|
24
|
-
refractor_1.default.register(python_1.default);
|
|
25
|
-
refractor_1.default.register(csharp_1.default);
|
|
26
|
-
refractor_1.default.register(clojure_1.default);
|
|
27
|
-
refractor_1.default.register(hcl_1.default);
|
|
28
|
-
const RENDERED_TODO = '<span><label class="check-container"><input type="checkbox" disabled=""><span class="checkmark"></span></label></span>';
|
|
29
|
-
const RENDERED_DONE = '<span><label class="check-container"><input type="checkbox" checked="" disabled=""><span class="checkmark"></span></label></span>';
|
|
30
|
-
const URL_REGEX = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=$]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=$,]*)/;
|
|
31
|
-
const TODO_REGEX = /^{{(?:\[\[)?TODO(?:\]\])?}}/;
|
|
32
|
-
const DONE_REGEX = /^{{(?:\[\[)?DONE(?:\]\])?}}/;
|
|
33
|
-
const IFRAME_REGEX = new RegExp(`^{{(?:\\[\\[)?iframe(?:\\]\\])?:\\s*(${URL_REGEX.source})}}`);
|
|
34
|
-
const BUTTON_REGEX = /^{{(?:\[\[)?((?:(?!}}[^}])[\w\s-/])*)(?:\]\])?(?::(.*))?}}/;
|
|
35
|
-
const TAG_REGEX = /^#?\[\[(.*?)\]\]/;
|
|
36
|
-
const BLOCK_REF_REGEX = /^\(\((.*?)\)\)/;
|
|
37
|
-
const toAlias = (r) => new RegExp(`^\\[([^\\]]*?)\\]\\(${r.source.substring(1)}\\)`);
|
|
38
|
-
const ALIAS_REGEX = toAlias(TAG_REGEX);
|
|
39
|
-
const ALIAS_REF_REGEX = toAlias(BLOCK_REF_REGEX);
|
|
40
|
-
const HASHTAG_REGEX = /^#([^\s]*)/;
|
|
41
|
-
const ATTRIBUTE_REGEX = /^(.*?)::/;
|
|
42
|
-
const BOLD_REGEX = /^\*\*(.*?)\*\*/;
|
|
43
|
-
const ITALICS_REGEX = /^__(.*?)__/;
|
|
44
|
-
const HIGHLIGHT_REGEX = /^\^\^([^^]*)\^\^/;
|
|
45
|
-
const INLINE_STOP_REGEX = /({{|\*\*([^*]+?)\*\*|__([^_]+?)__|~~([^_]+?)~~|\^\^([^^]+?)\^\^|#?\[\[(.*?)\]\]|#[^\s]|\(\(.*?\)\)|\[(.*?)\]\((.*?)\))/;
|
|
46
|
-
const HR_REGEX = /^---$/;
|
|
47
|
-
const BQ_REGEX = /^(?:>|\[\[>\]\]) (.*)$/s;
|
|
48
|
-
const TWEET_STATUS_REGEX = /\/status\/(.*?)(?:\?s=\d*)?$/;
|
|
49
|
-
const HTML_REGEXES = [BUTTON_REGEX, BLOCK_REF_REGEX, HR_REGEX];
|
|
50
|
-
const HTML_WITH_CHILD_REGEXES = [
|
|
51
|
-
{ rgx: BQ_REGEX, title: "blockquote" },
|
|
52
|
-
{ rgx: HIGHLIGHT_REGEX, title: "highlight" },
|
|
53
|
-
];
|
|
54
|
-
const CODESPAN_REGEX = new RegExp("^```([\\w]*)\n(.*)```$", "s");
|
|
55
|
-
const defaultComponents = (component, afterColon) => {
|
|
56
|
-
var _a;
|
|
57
|
-
const opts = ((_a = afterColon === null || afterColon === void 0 ? void 0 : afterColon.trim) === null || _a === void 0 ? void 0 : _a.call(afterColon)) || "";
|
|
58
|
-
switch (component) {
|
|
59
|
-
case "youtube":
|
|
60
|
-
case "video":
|
|
61
|
-
return `<div class="rm-iframe-container"><iframe src="${opts
|
|
62
|
-
.replace("youtu.be", "www.youtube.com/embed")
|
|
63
|
-
.replace("watch?v=", "embed/")
|
|
64
|
-
.replace("vimeo.com", "player.vimeo.com/video")}" class="rm-iframe rm-video-player"></iframe></div>`;
|
|
65
|
-
case "pdf":
|
|
66
|
-
return `<div class="rm-iframe-container"><iframe src="${opts}" class="rm-iframe"></iframe></div>`;
|
|
67
|
-
default:
|
|
68
|
-
return "";
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
// https://github.com/markedjs/marked/blob/d2347e9b9ae517d02138fa6a9844bd8d586acfeb/src/Tokenizer.js#L33-L59
|
|
72
|
-
function indentCodeCompensation(raw, text) {
|
|
73
|
-
const matchIndentToCode = raw.match(/^(\s+)(?:```)/);
|
|
74
|
-
if (matchIndentToCode === null) {
|
|
75
|
-
return text;
|
|
76
|
-
}
|
|
77
|
-
const indentToCode = matchIndentToCode[1];
|
|
78
|
-
return text
|
|
79
|
-
.split("\n")
|
|
80
|
-
.map((node) => {
|
|
81
|
-
const matchIndentInNode = node.match(/^\s+/);
|
|
82
|
-
if (matchIndentInNode === null) {
|
|
83
|
-
return node;
|
|
84
|
-
}
|
|
85
|
-
const [indentInNode] = matchIndentInNode;
|
|
86
|
-
if (indentInNode.length >= indentToCode.length) {
|
|
87
|
-
return node.slice(indentToCode.length);
|
|
88
|
-
}
|
|
89
|
-
return node;
|
|
90
|
-
})
|
|
91
|
-
.join("\n");
|
|
92
|
-
}
|
|
93
|
-
const context = {
|
|
94
|
-
marked: {
|
|
95
|
-
parseInline: (s) => s,
|
|
96
|
-
lastSrc: "",
|
|
97
|
-
used: false,
|
|
98
|
-
lexInline: () => [],
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
const opts = {
|
|
102
|
-
tokenizer: {
|
|
103
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
104
|
-
// @ts-ignore should accept boolean return value
|
|
105
|
-
tag(src) {
|
|
106
|
-
for (const r of HTML_REGEXES) {
|
|
107
|
-
const match = r.exec(src);
|
|
108
|
-
if (match) {
|
|
109
|
-
return {
|
|
110
|
-
type: "html",
|
|
111
|
-
raw: match[0],
|
|
112
|
-
text: match[0],
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return false;
|
|
117
|
-
},
|
|
118
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
119
|
-
// @ts-ignore should accept boolean return value
|
|
120
|
-
del(src) {
|
|
121
|
-
const match = /^~[^~]/.exec(src);
|
|
122
|
-
if (match) {
|
|
123
|
-
return {
|
|
124
|
-
type: "text",
|
|
125
|
-
raw: "~",
|
|
126
|
-
text: "~",
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
return false;
|
|
130
|
-
},
|
|
131
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
132
|
-
// @ts-ignore should accept boolean return value
|
|
133
|
-
emStrong(src) {
|
|
134
|
-
var _a, _b;
|
|
135
|
-
const match = BOLD_REGEX.exec(src);
|
|
136
|
-
if (match && ((_a = match[1]) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
137
|
-
return {
|
|
138
|
-
type: "strong",
|
|
139
|
-
raw: match[0],
|
|
140
|
-
text: match[1],
|
|
141
|
-
tokens: context.marked.lexInline(match[1]),
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
const emMatch = ITALICS_REGEX.exec(src);
|
|
145
|
-
if (emMatch && ((_b = emMatch[1]) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
146
|
-
return {
|
|
147
|
-
type: "em",
|
|
148
|
-
raw: emMatch[0],
|
|
149
|
-
text: emMatch[1],
|
|
150
|
-
tokens: context.marked.lexInline(emMatch[1]),
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
return false;
|
|
154
|
-
},
|
|
155
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
156
|
-
// @ts-ignore should accept boolean return value
|
|
157
|
-
fences(src) {
|
|
158
|
-
const newSrc = src.replace(/```$/, "\n```");
|
|
159
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
160
|
-
// @ts-ignore should accept boolean return value
|
|
161
|
-
const rules = this.rules;
|
|
162
|
-
const cap = rules.block.fences.exec(newSrc);
|
|
163
|
-
if (cap) {
|
|
164
|
-
const raw = cap[0];
|
|
165
|
-
const text = indentCodeCompensation(raw, cap[3] || "");
|
|
166
|
-
return {
|
|
167
|
-
type: "code",
|
|
168
|
-
raw,
|
|
169
|
-
lang: cap[2] ? cap[2].trim() : cap[2],
|
|
170
|
-
text,
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
return false;
|
|
174
|
-
},
|
|
175
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
176
|
-
// @ts-ignore should accept boolean return value
|
|
177
|
-
inlineText(src) {
|
|
178
|
-
var _a, _b;
|
|
179
|
-
if (src === context.marked.lastSrc) {
|
|
180
|
-
throw new Error(`Infinite loop on string ${src}`);
|
|
181
|
-
}
|
|
182
|
-
context.marked.lastSrc = src;
|
|
183
|
-
const attribute = ATTRIBUTE_REGEX.exec(src);
|
|
184
|
-
if (attribute) {
|
|
185
|
-
const raw = attribute[0];
|
|
186
|
-
const numberOfTicks = (raw.match(/([^`]`|`[^`])/g) || []).length;
|
|
187
|
-
if (numberOfTicks % 2 === 0) {
|
|
188
|
-
const page = attribute[1];
|
|
189
|
-
const href = (_a = context.pagesToHrefs) === null || _a === void 0 ? void 0 : _a.call(context, page);
|
|
190
|
-
const text = `${page}:`;
|
|
191
|
-
if (href) {
|
|
192
|
-
return {
|
|
193
|
-
type: "strong",
|
|
194
|
-
raw,
|
|
195
|
-
text,
|
|
196
|
-
tokens: [
|
|
197
|
-
{
|
|
198
|
-
type: "link",
|
|
199
|
-
raw: text,
|
|
200
|
-
text,
|
|
201
|
-
href,
|
|
202
|
-
tokens: [
|
|
203
|
-
{
|
|
204
|
-
type: "text",
|
|
205
|
-
raw: text,
|
|
206
|
-
text,
|
|
207
|
-
},
|
|
208
|
-
],
|
|
209
|
-
},
|
|
210
|
-
],
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
else {
|
|
214
|
-
return {
|
|
215
|
-
type: "strong",
|
|
216
|
-
raw,
|
|
217
|
-
text,
|
|
218
|
-
tokens: [
|
|
219
|
-
{
|
|
220
|
-
type: "text",
|
|
221
|
-
raw: text,
|
|
222
|
-
text,
|
|
223
|
-
},
|
|
224
|
-
],
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
const match = INLINE_STOP_REGEX.exec(src);
|
|
230
|
-
if (match) {
|
|
231
|
-
const raw = src.substring(0, match.index);
|
|
232
|
-
const tickMatch = raw.match(/([^`]`|`[^`])/g);
|
|
233
|
-
const numberOfTicks = (tickMatch || []).length;
|
|
234
|
-
if (numberOfTicks % 2 === 0) {
|
|
235
|
-
const index = numberOfTicks > 0 ? (_b = /`/.exec(raw)) === null || _b === void 0 ? void 0 : _b.index : match.index;
|
|
236
|
-
return {
|
|
237
|
-
type: "text",
|
|
238
|
-
raw: src.substring(0, index),
|
|
239
|
-
text: src.substring(0, index),
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
return false;
|
|
244
|
-
},
|
|
245
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
246
|
-
// @ts-ignore should accept boolean return value
|
|
247
|
-
codespan(src) {
|
|
248
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
249
|
-
// @ts-ignore should accept boolean return value
|
|
250
|
-
const cap = this.rules.inline.code.exec(src);
|
|
251
|
-
if (cap) {
|
|
252
|
-
if (cap[0].startsWith("```")) {
|
|
253
|
-
return {
|
|
254
|
-
type: "codespan",
|
|
255
|
-
raw: cap[0],
|
|
256
|
-
text: cap[0],
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
return false;
|
|
261
|
-
},
|
|
262
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
263
|
-
// @ts-ignore should accept boolean return value
|
|
264
|
-
link(src) {
|
|
265
|
-
var _a, _b, _c;
|
|
266
|
-
// hijacking link for html elements with tokens
|
|
267
|
-
for (const { rgx, title } of HTML_WITH_CHILD_REGEXES) {
|
|
268
|
-
const match = rgx.exec(src);
|
|
269
|
-
if (match) {
|
|
270
|
-
return {
|
|
271
|
-
type: "link",
|
|
272
|
-
raw: match[0],
|
|
273
|
-
text: match[1],
|
|
274
|
-
title,
|
|
275
|
-
tokens: context.marked.lexInline(match[1]),
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
if (TAG_REGEX.test(src)) {
|
|
280
|
-
const match = xregexp_1.default.matchRecursive(src, "#?\\[\\[", "\\]\\]", "i", {
|
|
281
|
-
valueNames: ["between", "left", "match", "right"],
|
|
282
|
-
});
|
|
283
|
-
const raw = match.map((m) => m.value).join("");
|
|
284
|
-
if (context.pagesToHrefs) {
|
|
285
|
-
const text = match[1].value;
|
|
286
|
-
const href = context.pagesToHrefs(text);
|
|
287
|
-
if (href) {
|
|
288
|
-
return {
|
|
289
|
-
type: "link",
|
|
290
|
-
raw,
|
|
291
|
-
href,
|
|
292
|
-
text,
|
|
293
|
-
title: `tag:${text}`,
|
|
294
|
-
tokens: context.marked.lexInline(text),
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
else {
|
|
298
|
-
return {
|
|
299
|
-
type: "text",
|
|
300
|
-
raw,
|
|
301
|
-
text,
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
else {
|
|
306
|
-
return {
|
|
307
|
-
type: "text",
|
|
308
|
-
raw,
|
|
309
|
-
text: raw,
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
const hashMatch = HASHTAG_REGEX.exec(src);
|
|
314
|
-
if (hashMatch) {
|
|
315
|
-
const raw = hashMatch[0];
|
|
316
|
-
if (context.pagesToHrefs) {
|
|
317
|
-
const text = hashMatch[1];
|
|
318
|
-
const href = context.pagesToHrefs(text);
|
|
319
|
-
if (href) {
|
|
320
|
-
return {
|
|
321
|
-
type: "link",
|
|
322
|
-
raw,
|
|
323
|
-
href,
|
|
324
|
-
text,
|
|
325
|
-
title: `tag:${text}`,
|
|
326
|
-
tokens: context.marked.lexInline(text),
|
|
327
|
-
};
|
|
328
|
-
}
|
|
329
|
-
else {
|
|
330
|
-
return {
|
|
331
|
-
type: "text",
|
|
332
|
-
raw,
|
|
333
|
-
text,
|
|
334
|
-
};
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
else {
|
|
338
|
-
return {
|
|
339
|
-
type: "text",
|
|
340
|
-
raw,
|
|
341
|
-
text: raw,
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
const aliasMatch = ALIAS_REGEX.exec(src);
|
|
346
|
-
if (aliasMatch) {
|
|
347
|
-
const raw = aliasMatch[0];
|
|
348
|
-
if (context.pagesToHrefs) {
|
|
349
|
-
const text = aliasMatch[1];
|
|
350
|
-
const href = context.pagesToHrefs(aliasMatch[2]);
|
|
351
|
-
if (href) {
|
|
352
|
-
return {
|
|
353
|
-
type: "link",
|
|
354
|
-
raw,
|
|
355
|
-
href,
|
|
356
|
-
text,
|
|
357
|
-
title: "alias",
|
|
358
|
-
tokens: context.marked.lexInline(text),
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
else {
|
|
362
|
-
return {
|
|
363
|
-
type: "text",
|
|
364
|
-
raw,
|
|
365
|
-
text,
|
|
366
|
-
};
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
else {
|
|
370
|
-
return {
|
|
371
|
-
type: "text",
|
|
372
|
-
raw,
|
|
373
|
-
text: raw,
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
const aliasRefMatch = ALIAS_REF_REGEX.exec(src);
|
|
378
|
-
if (aliasRefMatch) {
|
|
379
|
-
const raw = aliasRefMatch[0];
|
|
380
|
-
const text = aliasRefMatch[1];
|
|
381
|
-
const ref = aliasRefMatch[2];
|
|
382
|
-
const href = (_a = context.pagesToHrefs) === null || _a === void 0 ? void 0 : _a.call(context, ((_c = (_b = context.blockReferences) === null || _b === void 0 ? void 0 : _b.call(context, ref)) === null || _c === void 0 ? void 0 : _c.page) || "", ref);
|
|
383
|
-
if (href) {
|
|
384
|
-
return {
|
|
385
|
-
type: "link",
|
|
386
|
-
raw,
|
|
387
|
-
href,
|
|
388
|
-
text,
|
|
389
|
-
title: "alias",
|
|
390
|
-
tokens: context.marked.lexInline(text),
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
else {
|
|
394
|
-
return {
|
|
395
|
-
type: "text",
|
|
396
|
-
raw,
|
|
397
|
-
text,
|
|
398
|
-
};
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
return false;
|
|
402
|
-
},
|
|
403
|
-
},
|
|
404
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
405
|
-
// @ts-ignore should be optional
|
|
406
|
-
renderer: {
|
|
407
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
408
|
-
// @ts-ignore should allow false
|
|
409
|
-
link(href, title, text) {
|
|
410
|
-
var _a;
|
|
411
|
-
if (title === "alias") {
|
|
412
|
-
const html = this.link(href, null, text || "");
|
|
413
|
-
if (html) {
|
|
414
|
-
return html.replace("href=", 'class="rm-alias" href=');
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
else if (title === null || title === void 0 ? void 0 : title.startsWith("tag:")) {
|
|
418
|
-
const html = this.link(href, null, text || "");
|
|
419
|
-
if (html) {
|
|
420
|
-
return html.replace("href=", `class="rm-page-ref" data-tag="${title.substring(4)}" href=`);
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
else if (title === "highlight") {
|
|
424
|
-
return `<span class="rm-highlight">${text}</span>`;
|
|
425
|
-
}
|
|
426
|
-
else if (title === "blockquote") {
|
|
427
|
-
return `<blockquote class="rm-bq">${text}</blockquote>`;
|
|
428
|
-
}
|
|
429
|
-
else if (href.startsWith("https://twitter.com") && text === href) {
|
|
430
|
-
const tweetId = (_a = TWEET_STATUS_REGEX.exec(href)) === null || _a === void 0 ? void 0 : _a[1];
|
|
431
|
-
const options = {
|
|
432
|
-
dnt: false,
|
|
433
|
-
frame: false,
|
|
434
|
-
hideCard: false,
|
|
435
|
-
hideThread: true,
|
|
436
|
-
id: tweetId,
|
|
437
|
-
lang: "en",
|
|
438
|
-
theme: "light",
|
|
439
|
-
width: "550px",
|
|
440
|
-
};
|
|
441
|
-
if (tweetId) {
|
|
442
|
-
return `<div>
|
|
443
|
-
<iframe scrolling="no" frameborder="0" allowtransparency="true" allowfullscreen="true" class="" style="position: static; visibility: visible; width: ${options.width}; height: ${options.width}; display: block; flex-grow: 1; pointer-events: auto;" title="Twitter Tweet" src="https://platform.twitter.com/embed/Tweet.html?${new URLSearchParams(Object.fromEntries(Object.entries(options).map(([k, v]) => [k, `${v}`])))
|
|
444
|
-
.toString()
|
|
445
|
-
.replace(/&/g, "&")}" data-tweet-id="${tweetId}"></iframe>
|
|
446
|
-
<script>const cs = document.currentScript;
|
|
447
|
-
const iframe = cs.previousElementSibling;
|
|
448
|
-
const tweetId = iframe.getAttribute('data-tweet-id');
|
|
449
|
-
const renderTweet = () => {
|
|
450
|
-
const container = cs.parentElement;
|
|
451
|
-
container.style.height = '${options.width}';
|
|
452
|
-
window['twttr'].ready().then(({widgets}) =>
|
|
453
|
-
widgets.createTweetEmbed(tweetId, cs.parentElement, ${JSON.stringify(options)})).then(() => {
|
|
454
|
-
iframe.remove();
|
|
455
|
-
cs.remove();
|
|
456
|
-
container.style.height = 'unset';
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
const twttr = window['twttr']
|
|
460
|
-
if (!(twttr && twttr.ready)) {
|
|
461
|
-
var s = document.createElement('script');
|
|
462
|
-
s.setAttribute('src', "https://platform.twitter.com/widgets.js");
|
|
463
|
-
s.onload = renderTweet;
|
|
464
|
-
document.body.appendChild(s);
|
|
465
|
-
} else {
|
|
466
|
-
renderTweet()
|
|
467
|
-
}
|
|
468
|
-
</script>
|
|
469
|
-
</div>`;
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
return false;
|
|
473
|
-
},
|
|
474
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
475
|
-
// @ts-ignore should allow false
|
|
476
|
-
codespan(code) {
|
|
477
|
-
const match = CODESPAN_REGEX.exec(code);
|
|
478
|
-
if (match) {
|
|
479
|
-
const nodes = refractor_1.default.highlight(match[2], match[1]);
|
|
480
|
-
return `<pre><code class="language-${match[1]}">${(0, hast_util_to_html_1.default)(
|
|
481
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
482
|
-
//@ts-ignore
|
|
483
|
-
nodes)}</code></pre>`;
|
|
484
|
-
}
|
|
485
|
-
return false;
|
|
486
|
-
},
|
|
487
|
-
strong: (text) => `<span class="rm-bold">${text}</span>`,
|
|
488
|
-
em: (text) => `<em class="rm-italics">${text}</em>`,
|
|
489
|
-
html(text) {
|
|
490
|
-
var _a, _b, _c, _d, _e, _f;
|
|
491
|
-
if (TODO_REGEX.test(text)) {
|
|
492
|
-
return RENDERED_TODO;
|
|
493
|
-
}
|
|
494
|
-
else if (DONE_REGEX.test(text)) {
|
|
495
|
-
return RENDERED_DONE;
|
|
496
|
-
}
|
|
497
|
-
else if (HR_REGEX.test(text)) {
|
|
498
|
-
return "<hr>";
|
|
499
|
-
}
|
|
500
|
-
else if (IFRAME_REGEX.test(text)) {
|
|
501
|
-
const match = IFRAME_REGEX.exec(text);
|
|
502
|
-
return `<div class="rm-iframe-container"><iframe src="${match === null || match === void 0 ? void 0 : match[1]}" frameborder="0" class="rm-iframe"></iframe></div>`;
|
|
503
|
-
}
|
|
504
|
-
else if (HIGHLIGHT_REGEX.test(text)) {
|
|
505
|
-
const match = HIGHLIGHT_REGEX.exec(text);
|
|
506
|
-
return `<span class="rm-highlight">${match === null || match === void 0 ? void 0 : match[1]}</span>`;
|
|
507
|
-
}
|
|
508
|
-
else if (BUTTON_REGEX.test(text)) {
|
|
509
|
-
const match = ((_a = BUTTON_REGEX.exec(text)) === null || _a === void 0 ? void 0 : _a[1]) || "";
|
|
510
|
-
const afterColon = (_b = BUTTON_REGEX.exec(text)) === null || _b === void 0 ? void 0 : _b[2];
|
|
511
|
-
return (((_c = context.components) === null || _c === void 0 ? void 0 : _c.call(context, match, afterColon)) ||
|
|
512
|
-
defaultComponents(match, afterColon) ||
|
|
513
|
-
`<button class="bp3-button">${match}</button>`);
|
|
514
|
-
}
|
|
515
|
-
else if (BLOCK_REF_REGEX.test(text)) {
|
|
516
|
-
const match = ((_d = BLOCK_REF_REGEX.exec(text)) === null || _d === void 0 ? void 0 : _d[1]) || "";
|
|
517
|
-
const blockRefInfo = (_e = context.blockReferences) === null || _e === void 0 ? void 0 : _e.call(context, match);
|
|
518
|
-
if (!blockRefInfo) {
|
|
519
|
-
return text;
|
|
520
|
-
}
|
|
521
|
-
const page = blockRefInfo.page || "";
|
|
522
|
-
const blockText = context.marked.parseInline(blockRefInfo.text || "") || "";
|
|
523
|
-
if (!page)
|
|
524
|
-
return blockText;
|
|
525
|
-
const href = (_f = context.pagesToHrefs) === null || _f === void 0 ? void 0 : _f.call(context, page, match);
|
|
526
|
-
return `<a class="rm-block-ref" href="${href}">${blockText}</a>`;
|
|
527
|
-
}
|
|
528
|
-
else if (BQ_REGEX.test(text)) {
|
|
529
|
-
const match = BQ_REGEX.exec(text);
|
|
530
|
-
return `<blockquote class="rm-bq">${match === null || match === void 0 ? void 0 : match[1]}</blockquote>`;
|
|
531
|
-
}
|
|
532
|
-
else {
|
|
533
|
-
return text;
|
|
534
|
-
}
|
|
535
|
-
},
|
|
536
|
-
},
|
|
537
|
-
};
|
|
538
|
-
const contextualize = (m) => (getMethod) => (text, ctxt) => {
|
|
539
|
-
context.blockReferences = ctxt === null || ctxt === void 0 ? void 0 : ctxt.blockReferences;
|
|
540
|
-
context.pagesToHrefs = ctxt === null || ctxt === void 0 ? void 0 : ctxt.pagesToHrefs;
|
|
541
|
-
context.components = ctxt === null || ctxt === void 0 ? void 0 : ctxt.components;
|
|
542
|
-
context.marked.parseInline = m.marked.parseInline;
|
|
543
|
-
context.marked.lexInline = m.marked.Lexer.lexInline;
|
|
544
|
-
context.marked.lastSrc = "";
|
|
545
|
-
if (!context.marked.used) {
|
|
546
|
-
m.marked.use(opts);
|
|
547
|
-
context.marked.used = true;
|
|
548
|
-
}
|
|
549
|
-
return getMethod(m)(text);
|
|
550
|
-
};
|
|
551
|
-
const wrapOnce = (getMethod) => () => {
|
|
552
|
-
return (typeof window !== "undefined" && window.RoamLazy
|
|
553
|
-
? window.RoamLazy.Marked()
|
|
554
|
-
: Promise.resolve().then(() => tslib_1.__importStar(require("marked")))).then((m) => contextualize(m)(getMethod));
|
|
555
|
-
};
|
|
556
|
-
exports.getInlineLexer = wrapOnce((m) => m.marked.Lexer.lexInline);
|
|
557
|
-
exports.getLexer = wrapOnce((m) => m.marked.lexer);
|
|
558
|
-
exports.getParseInline = wrapOnce((m) => m.marked.parseInline);
|
|
559
|
-
exports.getParse = wrapOnce((m) => m.marked.parse);
|
|
560
|
-
const wrapEach = (getMethod) => (text, ctxt) => {
|
|
561
|
-
return (window.RoamLazy ? window.RoamLazy.Marked() : Promise.resolve().then(() => tslib_1.__importStar(require("marked")))).then((m) => contextualize(m)(getMethod)(text, ctxt));
|
|
562
|
-
};
|
|
563
|
-
exports.inlineLexer = wrapEach((m) => m.marked.Lexer.lexInline);
|
|
564
|
-
exports.lexer = wrapEach((m) => m.marked.lexer);
|
|
565
|
-
exports.parseInline = wrapEach((m) => m.marked.parseInline);
|
|
566
|
-
exports.parse = wrapEach((m) => m.marked.parse);
|
|
567
|
-
exports.default = wrapEach((m) => m.marked.parse);
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parse = exports.parseInline = exports.lexer = exports.inlineLexer = exports.getParse = exports.getParseInline = exports.getLexer = exports.getInlineLexer = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const xregexp_1 = tslib_1.__importDefault(require("xregexp"));
|
|
6
|
+
const refractor_1 = tslib_1.__importDefault(require("refractor"));
|
|
7
|
+
const markdown_1 = tslib_1.__importDefault(require("refractor/lang/markdown"));
|
|
8
|
+
const yaml_1 = tslib_1.__importDefault(require("refractor/lang/yaml"));
|
|
9
|
+
const css_1 = tslib_1.__importDefault(require("refractor/lang/css"));
|
|
10
|
+
const bash_1 = tslib_1.__importDefault(require("refractor/lang/bash"));
|
|
11
|
+
const java_1 = tslib_1.__importDefault(require("refractor/lang/java"));
|
|
12
|
+
const rust_1 = tslib_1.__importDefault(require("refractor/lang/rust"));
|
|
13
|
+
const python_1 = tslib_1.__importDefault(require("refractor/lang/python"));
|
|
14
|
+
const csharp_1 = tslib_1.__importDefault(require("refractor/lang/csharp"));
|
|
15
|
+
const clojure_1 = tslib_1.__importDefault(require("refractor/lang/clojure"));
|
|
16
|
+
const hcl_1 = tslib_1.__importDefault(require("refractor/lang/hcl"));
|
|
17
|
+
const hast_util_to_html_1 = tslib_1.__importDefault(require("hast-util-to-html"));
|
|
18
|
+
refractor_1.default.register(markdown_1.default);
|
|
19
|
+
refractor_1.default.register(yaml_1.default);
|
|
20
|
+
refractor_1.default.register(css_1.default);
|
|
21
|
+
refractor_1.default.register(bash_1.default);
|
|
22
|
+
refractor_1.default.register(java_1.default);
|
|
23
|
+
refractor_1.default.register(rust_1.default);
|
|
24
|
+
refractor_1.default.register(python_1.default);
|
|
25
|
+
refractor_1.default.register(csharp_1.default);
|
|
26
|
+
refractor_1.default.register(clojure_1.default);
|
|
27
|
+
refractor_1.default.register(hcl_1.default);
|
|
28
|
+
const RENDERED_TODO = '<span><label class="check-container"><input type="checkbox" disabled=""><span class="checkmark"></span></label></span>';
|
|
29
|
+
const RENDERED_DONE = '<span><label class="check-container"><input type="checkbox" checked="" disabled=""><span class="checkmark"></span></label></span>';
|
|
30
|
+
const URL_REGEX = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=$]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=$,]*)/;
|
|
31
|
+
const TODO_REGEX = /^{{(?:\[\[)?TODO(?:\]\])?}}/;
|
|
32
|
+
const DONE_REGEX = /^{{(?:\[\[)?DONE(?:\]\])?}}/;
|
|
33
|
+
const IFRAME_REGEX = new RegExp(`^{{(?:\\[\\[)?iframe(?:\\]\\])?:\\s*(${URL_REGEX.source})}}`);
|
|
34
|
+
const BUTTON_REGEX = /^{{(?:\[\[)?((?:(?!}}[^}])[\w\s-/])*)(?:\]\])?(?::(.*))?}}/;
|
|
35
|
+
const TAG_REGEX = /^#?\[\[(.*?)\]\]/;
|
|
36
|
+
const BLOCK_REF_REGEX = /^\(\((.*?)\)\)/;
|
|
37
|
+
const toAlias = (r) => new RegExp(`^\\[([^\\]]*?)\\]\\(${r.source.substring(1)}\\)`);
|
|
38
|
+
const ALIAS_REGEX = toAlias(TAG_REGEX);
|
|
39
|
+
const ALIAS_REF_REGEX = toAlias(BLOCK_REF_REGEX);
|
|
40
|
+
const HASHTAG_REGEX = /^#([^\s]*)/;
|
|
41
|
+
const ATTRIBUTE_REGEX = /^(.*?)::/;
|
|
42
|
+
const BOLD_REGEX = /^\*\*(.*?)\*\*/;
|
|
43
|
+
const ITALICS_REGEX = /^__(.*?)__/;
|
|
44
|
+
const HIGHLIGHT_REGEX = /^\^\^([^^]*)\^\^/;
|
|
45
|
+
const INLINE_STOP_REGEX = /({{|\*\*([^*]+?)\*\*|__([^_]+?)__|~~([^_]+?)~~|\^\^([^^]+?)\^\^|#?\[\[(.*?)\]\]|#[^\s]|\(\(.*?\)\)|\[(.*?)\]\((.*?)\))/;
|
|
46
|
+
const HR_REGEX = /^---$/;
|
|
47
|
+
const BQ_REGEX = /^(?:>|\[\[>\]\]) (.*)$/s;
|
|
48
|
+
const TWEET_STATUS_REGEX = /\/status\/(.*?)(?:\?s=\d*)?$/;
|
|
49
|
+
const HTML_REGEXES = [BUTTON_REGEX, BLOCK_REF_REGEX, HR_REGEX];
|
|
50
|
+
const HTML_WITH_CHILD_REGEXES = [
|
|
51
|
+
{ rgx: BQ_REGEX, title: "blockquote" },
|
|
52
|
+
{ rgx: HIGHLIGHT_REGEX, title: "highlight" },
|
|
53
|
+
];
|
|
54
|
+
const CODESPAN_REGEX = new RegExp("^```([\\w]*)\n(.*)```$", "s");
|
|
55
|
+
const defaultComponents = (component, afterColon) => {
|
|
56
|
+
var _a;
|
|
57
|
+
const opts = ((_a = afterColon === null || afterColon === void 0 ? void 0 : afterColon.trim) === null || _a === void 0 ? void 0 : _a.call(afterColon)) || "";
|
|
58
|
+
switch (component) {
|
|
59
|
+
case "youtube":
|
|
60
|
+
case "video":
|
|
61
|
+
return `<div class="rm-iframe-container"><iframe src="${opts
|
|
62
|
+
.replace("youtu.be", "www.youtube.com/embed")
|
|
63
|
+
.replace("watch?v=", "embed/")
|
|
64
|
+
.replace("vimeo.com", "player.vimeo.com/video")}" class="rm-iframe rm-video-player"></iframe></div>`;
|
|
65
|
+
case "pdf":
|
|
66
|
+
return `<div class="rm-iframe-container"><iframe src="${opts}" class="rm-iframe"></iframe></div>`;
|
|
67
|
+
default:
|
|
68
|
+
return "";
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
// https://github.com/markedjs/marked/blob/d2347e9b9ae517d02138fa6a9844bd8d586acfeb/src/Tokenizer.js#L33-L59
|
|
72
|
+
function indentCodeCompensation(raw, text) {
|
|
73
|
+
const matchIndentToCode = raw.match(/^(\s+)(?:```)/);
|
|
74
|
+
if (matchIndentToCode === null) {
|
|
75
|
+
return text;
|
|
76
|
+
}
|
|
77
|
+
const indentToCode = matchIndentToCode[1];
|
|
78
|
+
return text
|
|
79
|
+
.split("\n")
|
|
80
|
+
.map((node) => {
|
|
81
|
+
const matchIndentInNode = node.match(/^\s+/);
|
|
82
|
+
if (matchIndentInNode === null) {
|
|
83
|
+
return node;
|
|
84
|
+
}
|
|
85
|
+
const [indentInNode] = matchIndentInNode;
|
|
86
|
+
if (indentInNode.length >= indentToCode.length) {
|
|
87
|
+
return node.slice(indentToCode.length);
|
|
88
|
+
}
|
|
89
|
+
return node;
|
|
90
|
+
})
|
|
91
|
+
.join("\n");
|
|
92
|
+
}
|
|
93
|
+
const context = {
|
|
94
|
+
marked: {
|
|
95
|
+
parseInline: (s) => s,
|
|
96
|
+
lastSrc: "",
|
|
97
|
+
used: false,
|
|
98
|
+
lexInline: () => [],
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
const opts = {
|
|
102
|
+
tokenizer: {
|
|
103
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
104
|
+
// @ts-ignore should accept boolean return value
|
|
105
|
+
tag(src) {
|
|
106
|
+
for (const r of HTML_REGEXES) {
|
|
107
|
+
const match = r.exec(src);
|
|
108
|
+
if (match) {
|
|
109
|
+
return {
|
|
110
|
+
type: "html",
|
|
111
|
+
raw: match[0],
|
|
112
|
+
text: match[0],
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return false;
|
|
117
|
+
},
|
|
118
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
119
|
+
// @ts-ignore should accept boolean return value
|
|
120
|
+
del(src) {
|
|
121
|
+
const match = /^~[^~]/.exec(src);
|
|
122
|
+
if (match) {
|
|
123
|
+
return {
|
|
124
|
+
type: "text",
|
|
125
|
+
raw: "~",
|
|
126
|
+
text: "~",
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
return false;
|
|
130
|
+
},
|
|
131
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
132
|
+
// @ts-ignore should accept boolean return value
|
|
133
|
+
emStrong(src) {
|
|
134
|
+
var _a, _b;
|
|
135
|
+
const match = BOLD_REGEX.exec(src);
|
|
136
|
+
if (match && ((_a = match[1]) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
137
|
+
return {
|
|
138
|
+
type: "strong",
|
|
139
|
+
raw: match[0],
|
|
140
|
+
text: match[1],
|
|
141
|
+
tokens: context.marked.lexInline(match[1]),
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
const emMatch = ITALICS_REGEX.exec(src);
|
|
145
|
+
if (emMatch && ((_b = emMatch[1]) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
146
|
+
return {
|
|
147
|
+
type: "em",
|
|
148
|
+
raw: emMatch[0],
|
|
149
|
+
text: emMatch[1],
|
|
150
|
+
tokens: context.marked.lexInline(emMatch[1]),
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
return false;
|
|
154
|
+
},
|
|
155
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
156
|
+
// @ts-ignore should accept boolean return value
|
|
157
|
+
fences(src) {
|
|
158
|
+
const newSrc = src.replace(/```$/, "\n```");
|
|
159
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
160
|
+
// @ts-ignore should accept boolean return value
|
|
161
|
+
const rules = this.rules;
|
|
162
|
+
const cap = rules.block.fences.exec(newSrc);
|
|
163
|
+
if (cap) {
|
|
164
|
+
const raw = cap[0];
|
|
165
|
+
const text = indentCodeCompensation(raw, cap[3] || "");
|
|
166
|
+
return {
|
|
167
|
+
type: "code",
|
|
168
|
+
raw,
|
|
169
|
+
lang: cap[2] ? cap[2].trim() : cap[2],
|
|
170
|
+
text,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
return false;
|
|
174
|
+
},
|
|
175
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
176
|
+
// @ts-ignore should accept boolean return value
|
|
177
|
+
inlineText(src) {
|
|
178
|
+
var _a, _b;
|
|
179
|
+
if (src === context.marked.lastSrc) {
|
|
180
|
+
throw new Error(`Infinite loop on string ${src}`);
|
|
181
|
+
}
|
|
182
|
+
context.marked.lastSrc = src;
|
|
183
|
+
const attribute = ATTRIBUTE_REGEX.exec(src);
|
|
184
|
+
if (attribute) {
|
|
185
|
+
const raw = attribute[0];
|
|
186
|
+
const numberOfTicks = (raw.match(/([^`]`|`[^`])/g) || []).length;
|
|
187
|
+
if (numberOfTicks % 2 === 0) {
|
|
188
|
+
const page = attribute[1];
|
|
189
|
+
const href = (_a = context.pagesToHrefs) === null || _a === void 0 ? void 0 : _a.call(context, page);
|
|
190
|
+
const text = `${page}:`;
|
|
191
|
+
if (href) {
|
|
192
|
+
return {
|
|
193
|
+
type: "strong",
|
|
194
|
+
raw,
|
|
195
|
+
text,
|
|
196
|
+
tokens: [
|
|
197
|
+
{
|
|
198
|
+
type: "link",
|
|
199
|
+
raw: text,
|
|
200
|
+
text,
|
|
201
|
+
href,
|
|
202
|
+
tokens: [
|
|
203
|
+
{
|
|
204
|
+
type: "text",
|
|
205
|
+
raw: text,
|
|
206
|
+
text,
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
return {
|
|
215
|
+
type: "strong",
|
|
216
|
+
raw,
|
|
217
|
+
text,
|
|
218
|
+
tokens: [
|
|
219
|
+
{
|
|
220
|
+
type: "text",
|
|
221
|
+
raw: text,
|
|
222
|
+
text,
|
|
223
|
+
},
|
|
224
|
+
],
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
const match = INLINE_STOP_REGEX.exec(src);
|
|
230
|
+
if (match) {
|
|
231
|
+
const raw = src.substring(0, match.index);
|
|
232
|
+
const tickMatch = raw.match(/([^`]`|`[^`])/g);
|
|
233
|
+
const numberOfTicks = (tickMatch || []).length;
|
|
234
|
+
if (numberOfTicks % 2 === 0) {
|
|
235
|
+
const index = numberOfTicks > 0 ? (_b = /`/.exec(raw)) === null || _b === void 0 ? void 0 : _b.index : match.index;
|
|
236
|
+
return {
|
|
237
|
+
type: "text",
|
|
238
|
+
raw: src.substring(0, index),
|
|
239
|
+
text: src.substring(0, index),
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return false;
|
|
244
|
+
},
|
|
245
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
246
|
+
// @ts-ignore should accept boolean return value
|
|
247
|
+
codespan(src) {
|
|
248
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
249
|
+
// @ts-ignore should accept boolean return value
|
|
250
|
+
const cap = this.rules.inline.code.exec(src);
|
|
251
|
+
if (cap) {
|
|
252
|
+
if (cap[0].startsWith("```")) {
|
|
253
|
+
return {
|
|
254
|
+
type: "codespan",
|
|
255
|
+
raw: cap[0],
|
|
256
|
+
text: cap[0],
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return false;
|
|
261
|
+
},
|
|
262
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
263
|
+
// @ts-ignore should accept boolean return value
|
|
264
|
+
link(src) {
|
|
265
|
+
var _a, _b, _c;
|
|
266
|
+
// hijacking link for html elements with tokens
|
|
267
|
+
for (const { rgx, title } of HTML_WITH_CHILD_REGEXES) {
|
|
268
|
+
const match = rgx.exec(src);
|
|
269
|
+
if (match) {
|
|
270
|
+
return {
|
|
271
|
+
type: "link",
|
|
272
|
+
raw: match[0],
|
|
273
|
+
text: match[1],
|
|
274
|
+
title,
|
|
275
|
+
tokens: context.marked.lexInline(match[1]),
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (TAG_REGEX.test(src)) {
|
|
280
|
+
const match = xregexp_1.default.matchRecursive(src, "#?\\[\\[", "\\]\\]", "i", {
|
|
281
|
+
valueNames: ["between", "left", "match", "right"],
|
|
282
|
+
});
|
|
283
|
+
const raw = match.map((m) => m.value).join("");
|
|
284
|
+
if (context.pagesToHrefs) {
|
|
285
|
+
const text = match[1].value;
|
|
286
|
+
const href = context.pagesToHrefs(text);
|
|
287
|
+
if (href) {
|
|
288
|
+
return {
|
|
289
|
+
type: "link",
|
|
290
|
+
raw,
|
|
291
|
+
href,
|
|
292
|
+
text,
|
|
293
|
+
title: `tag:${text}`,
|
|
294
|
+
tokens: context.marked.lexInline(text),
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
return {
|
|
299
|
+
type: "text",
|
|
300
|
+
raw,
|
|
301
|
+
text,
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
return {
|
|
307
|
+
type: "text",
|
|
308
|
+
raw,
|
|
309
|
+
text: raw,
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
const hashMatch = HASHTAG_REGEX.exec(src);
|
|
314
|
+
if (hashMatch) {
|
|
315
|
+
const raw = hashMatch[0];
|
|
316
|
+
if (context.pagesToHrefs) {
|
|
317
|
+
const text = hashMatch[1];
|
|
318
|
+
const href = context.pagesToHrefs(text);
|
|
319
|
+
if (href) {
|
|
320
|
+
return {
|
|
321
|
+
type: "link",
|
|
322
|
+
raw,
|
|
323
|
+
href,
|
|
324
|
+
text,
|
|
325
|
+
title: `tag:${text}`,
|
|
326
|
+
tokens: context.marked.lexInline(text),
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
return {
|
|
331
|
+
type: "text",
|
|
332
|
+
raw,
|
|
333
|
+
text,
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
return {
|
|
339
|
+
type: "text",
|
|
340
|
+
raw,
|
|
341
|
+
text: raw,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
const aliasMatch = ALIAS_REGEX.exec(src);
|
|
346
|
+
if (aliasMatch) {
|
|
347
|
+
const raw = aliasMatch[0];
|
|
348
|
+
if (context.pagesToHrefs) {
|
|
349
|
+
const text = aliasMatch[1];
|
|
350
|
+
const href = context.pagesToHrefs(aliasMatch[2]);
|
|
351
|
+
if (href) {
|
|
352
|
+
return {
|
|
353
|
+
type: "link",
|
|
354
|
+
raw,
|
|
355
|
+
href,
|
|
356
|
+
text,
|
|
357
|
+
title: "alias",
|
|
358
|
+
tokens: context.marked.lexInline(text),
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
return {
|
|
363
|
+
type: "text",
|
|
364
|
+
raw,
|
|
365
|
+
text,
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
return {
|
|
371
|
+
type: "text",
|
|
372
|
+
raw,
|
|
373
|
+
text: raw,
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
const aliasRefMatch = ALIAS_REF_REGEX.exec(src);
|
|
378
|
+
if (aliasRefMatch) {
|
|
379
|
+
const raw = aliasRefMatch[0];
|
|
380
|
+
const text = aliasRefMatch[1];
|
|
381
|
+
const ref = aliasRefMatch[2];
|
|
382
|
+
const href = (_a = context.pagesToHrefs) === null || _a === void 0 ? void 0 : _a.call(context, ((_c = (_b = context.blockReferences) === null || _b === void 0 ? void 0 : _b.call(context, ref)) === null || _c === void 0 ? void 0 : _c.page) || "", ref);
|
|
383
|
+
if (href) {
|
|
384
|
+
return {
|
|
385
|
+
type: "link",
|
|
386
|
+
raw,
|
|
387
|
+
href,
|
|
388
|
+
text,
|
|
389
|
+
title: "alias",
|
|
390
|
+
tokens: context.marked.lexInline(text),
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
return {
|
|
395
|
+
type: "text",
|
|
396
|
+
raw,
|
|
397
|
+
text,
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
return false;
|
|
402
|
+
},
|
|
403
|
+
},
|
|
404
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
405
|
+
// @ts-ignore should be optional
|
|
406
|
+
renderer: {
|
|
407
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
408
|
+
// @ts-ignore should allow false
|
|
409
|
+
link(href, title, text) {
|
|
410
|
+
var _a;
|
|
411
|
+
if (title === "alias") {
|
|
412
|
+
const html = this.link(href, null, text || "");
|
|
413
|
+
if (html) {
|
|
414
|
+
return html.replace("href=", 'class="rm-alias" href=');
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
else if (title === null || title === void 0 ? void 0 : title.startsWith("tag:")) {
|
|
418
|
+
const html = this.link(href, null, text || "");
|
|
419
|
+
if (html) {
|
|
420
|
+
return html.replace("href=", `class="rm-page-ref" data-tag="${title.substring(4)}" href=`);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
else if (title === "highlight") {
|
|
424
|
+
return `<span class="rm-highlight">${text}</span>`;
|
|
425
|
+
}
|
|
426
|
+
else if (title === "blockquote") {
|
|
427
|
+
return `<blockquote class="rm-bq">${text}</blockquote>`;
|
|
428
|
+
}
|
|
429
|
+
else if (href.startsWith("https://twitter.com") && text === href) {
|
|
430
|
+
const tweetId = (_a = TWEET_STATUS_REGEX.exec(href)) === null || _a === void 0 ? void 0 : _a[1];
|
|
431
|
+
const options = {
|
|
432
|
+
dnt: false,
|
|
433
|
+
frame: false,
|
|
434
|
+
hideCard: false,
|
|
435
|
+
hideThread: true,
|
|
436
|
+
id: tweetId,
|
|
437
|
+
lang: "en",
|
|
438
|
+
theme: "light",
|
|
439
|
+
width: "550px",
|
|
440
|
+
};
|
|
441
|
+
if (tweetId) {
|
|
442
|
+
return `<div>
|
|
443
|
+
<iframe scrolling="no" frameborder="0" allowtransparency="true" allowfullscreen="true" class="" style="position: static; visibility: visible; width: ${options.width}; height: ${options.width}; display: block; flex-grow: 1; pointer-events: auto;" title="Twitter Tweet" src="https://platform.twitter.com/embed/Tweet.html?${new URLSearchParams(Object.fromEntries(Object.entries(options).map(([k, v]) => [k, `${v}`])))
|
|
444
|
+
.toString()
|
|
445
|
+
.replace(/&/g, "&")}" data-tweet-id="${tweetId}"></iframe>
|
|
446
|
+
<script>const cs = document.currentScript;
|
|
447
|
+
const iframe = cs.previousElementSibling;
|
|
448
|
+
const tweetId = iframe.getAttribute('data-tweet-id');
|
|
449
|
+
const renderTweet = () => {
|
|
450
|
+
const container = cs.parentElement;
|
|
451
|
+
container.style.height = '${options.width}';
|
|
452
|
+
window['twttr'].ready().then(({widgets}) =>
|
|
453
|
+
widgets.createTweetEmbed(tweetId, cs.parentElement, ${JSON.stringify(options)})).then(() => {
|
|
454
|
+
iframe.remove();
|
|
455
|
+
cs.remove();
|
|
456
|
+
container.style.height = 'unset';
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
const twttr = window['twttr']
|
|
460
|
+
if (!(twttr && twttr.ready)) {
|
|
461
|
+
var s = document.createElement('script');
|
|
462
|
+
s.setAttribute('src', "https://platform.twitter.com/widgets.js");
|
|
463
|
+
s.onload = renderTweet;
|
|
464
|
+
document.body.appendChild(s);
|
|
465
|
+
} else {
|
|
466
|
+
renderTweet()
|
|
467
|
+
}
|
|
468
|
+
</script>
|
|
469
|
+
</div>`;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
return false;
|
|
473
|
+
},
|
|
474
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
475
|
+
// @ts-ignore should allow false
|
|
476
|
+
codespan(code) {
|
|
477
|
+
const match = CODESPAN_REGEX.exec(code);
|
|
478
|
+
if (match) {
|
|
479
|
+
const nodes = refractor_1.default.highlight(match[2], match[1]);
|
|
480
|
+
return `<pre><code class="language-${match[1]}">${(0, hast_util_to_html_1.default)(
|
|
481
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
482
|
+
//@ts-ignore
|
|
483
|
+
nodes)}</code></pre>`;
|
|
484
|
+
}
|
|
485
|
+
return false;
|
|
486
|
+
},
|
|
487
|
+
strong: (text) => `<span class="rm-bold">${text}</span>`,
|
|
488
|
+
em: (text) => `<em class="rm-italics">${text}</em>`,
|
|
489
|
+
html(text) {
|
|
490
|
+
var _a, _b, _c, _d, _e, _f;
|
|
491
|
+
if (TODO_REGEX.test(text)) {
|
|
492
|
+
return RENDERED_TODO;
|
|
493
|
+
}
|
|
494
|
+
else if (DONE_REGEX.test(text)) {
|
|
495
|
+
return RENDERED_DONE;
|
|
496
|
+
}
|
|
497
|
+
else if (HR_REGEX.test(text)) {
|
|
498
|
+
return "<hr>";
|
|
499
|
+
}
|
|
500
|
+
else if (IFRAME_REGEX.test(text)) {
|
|
501
|
+
const match = IFRAME_REGEX.exec(text);
|
|
502
|
+
return `<div class="rm-iframe-container"><iframe src="${match === null || match === void 0 ? void 0 : match[1]}" frameborder="0" class="rm-iframe"></iframe></div>`;
|
|
503
|
+
}
|
|
504
|
+
else if (HIGHLIGHT_REGEX.test(text)) {
|
|
505
|
+
const match = HIGHLIGHT_REGEX.exec(text);
|
|
506
|
+
return `<span class="rm-highlight">${match === null || match === void 0 ? void 0 : match[1]}</span>`;
|
|
507
|
+
}
|
|
508
|
+
else if (BUTTON_REGEX.test(text)) {
|
|
509
|
+
const match = ((_a = BUTTON_REGEX.exec(text)) === null || _a === void 0 ? void 0 : _a[1]) || "";
|
|
510
|
+
const afterColon = (_b = BUTTON_REGEX.exec(text)) === null || _b === void 0 ? void 0 : _b[2];
|
|
511
|
+
return (((_c = context.components) === null || _c === void 0 ? void 0 : _c.call(context, match, afterColon)) ||
|
|
512
|
+
defaultComponents(match, afterColon) ||
|
|
513
|
+
`<button class="bp3-button">${match}</button>`);
|
|
514
|
+
}
|
|
515
|
+
else if (BLOCK_REF_REGEX.test(text)) {
|
|
516
|
+
const match = ((_d = BLOCK_REF_REGEX.exec(text)) === null || _d === void 0 ? void 0 : _d[1]) || "";
|
|
517
|
+
const blockRefInfo = (_e = context.blockReferences) === null || _e === void 0 ? void 0 : _e.call(context, match);
|
|
518
|
+
if (!blockRefInfo) {
|
|
519
|
+
return text;
|
|
520
|
+
}
|
|
521
|
+
const page = blockRefInfo.page || "";
|
|
522
|
+
const blockText = context.marked.parseInline(blockRefInfo.text || "") || "";
|
|
523
|
+
if (!page)
|
|
524
|
+
return blockText;
|
|
525
|
+
const href = (_f = context.pagesToHrefs) === null || _f === void 0 ? void 0 : _f.call(context, page, match);
|
|
526
|
+
return `<a class="rm-block-ref" href="${href}">${blockText}</a>`;
|
|
527
|
+
}
|
|
528
|
+
else if (BQ_REGEX.test(text)) {
|
|
529
|
+
const match = BQ_REGEX.exec(text);
|
|
530
|
+
return `<blockquote class="rm-bq">${match === null || match === void 0 ? void 0 : match[1]}</blockquote>`;
|
|
531
|
+
}
|
|
532
|
+
else {
|
|
533
|
+
return text;
|
|
534
|
+
}
|
|
535
|
+
},
|
|
536
|
+
},
|
|
537
|
+
};
|
|
538
|
+
const contextualize = (m) => (getMethod) => (text, ctxt) => {
|
|
539
|
+
context.blockReferences = ctxt === null || ctxt === void 0 ? void 0 : ctxt.blockReferences;
|
|
540
|
+
context.pagesToHrefs = ctxt === null || ctxt === void 0 ? void 0 : ctxt.pagesToHrefs;
|
|
541
|
+
context.components = ctxt === null || ctxt === void 0 ? void 0 : ctxt.components;
|
|
542
|
+
context.marked.parseInline = m.marked.parseInline;
|
|
543
|
+
context.marked.lexInline = m.marked.Lexer.lexInline;
|
|
544
|
+
context.marked.lastSrc = "";
|
|
545
|
+
if (!context.marked.used) {
|
|
546
|
+
m.marked.use(opts);
|
|
547
|
+
context.marked.used = true;
|
|
548
|
+
}
|
|
549
|
+
return getMethod(m)(text);
|
|
550
|
+
};
|
|
551
|
+
const wrapOnce = (getMethod) => () => {
|
|
552
|
+
return (typeof window !== "undefined" && window.RoamLazy
|
|
553
|
+
? window.RoamLazy.Marked()
|
|
554
|
+
: Promise.resolve().then(() => tslib_1.__importStar(require("marked")))).then((m) => contextualize(m)(getMethod));
|
|
555
|
+
};
|
|
556
|
+
exports.getInlineLexer = wrapOnce((m) => m.marked.Lexer.lexInline);
|
|
557
|
+
exports.getLexer = wrapOnce((m) => m.marked.lexer);
|
|
558
|
+
exports.getParseInline = wrapOnce((m) => m.marked.parseInline);
|
|
559
|
+
exports.getParse = wrapOnce((m) => m.marked.parse);
|
|
560
|
+
const wrapEach = (getMethod) => (text, ctxt) => {
|
|
561
|
+
return (window.RoamLazy ? window.RoamLazy.Marked() : Promise.resolve().then(() => tslib_1.__importStar(require("marked")))).then((m) => contextualize(m)(getMethod)(text, ctxt));
|
|
562
|
+
};
|
|
563
|
+
exports.inlineLexer = wrapEach((m) => m.marked.Lexer.lexInline);
|
|
564
|
+
exports.lexer = wrapEach((m) => m.marked.lexer);
|
|
565
|
+
exports.parseInline = wrapEach((m) => m.marked.parseInline);
|
|
566
|
+
exports.parse = wrapEach((m) => m.marked.parse);
|
|
567
|
+
exports.default = wrapEach((m) => m.marked.parse);
|
|
568
568
|
//# sourceMappingURL=index.js.map
|