roamjs-components 0.86.0-alpha.3 → 0.86.1
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 -16
- package/components/BlockErrorBoundary.js +27 -27
- package/components/BlockErrorBoundary.js.map +1 -1
- package/components/BlockInput.d.ts +13 -13
- package/components/BlockInput.js +55 -55
- package/components/ComponentContainer.d.ts +10 -11
- package/components/ComponentContainer.js +37 -37
- package/components/ComponentContainer.js.map +1 -1
- 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/BlockPanel.js.map +1 -1
- package/components/ConfigPanels/BlocksPanel.d.ts +3 -3
- package/components/ConfigPanels/BlocksPanel.js +58 -58
- package/components/ConfigPanels/BlocksPanel.js.map +1 -1
- 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/OauthPanel.js.map +1 -1
- 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/CursorMenu.js.map +1 -1
- 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 +220 -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/MenuItemSelect.js.map +1 -1
- 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 -201
- 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 +120 -125
- 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 +393 -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
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const core_1 = require("@blueprintjs/core");
|
|
5
|
-
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
-
const getFirstChildUidByBlockUid_1 = tslib_1.__importDefault(require("../../queries/getFirstChildUidByBlockUid"));
|
|
7
|
-
const idToTitle_1 = tslib_1.__importDefault(require("../../util/idToTitle"));
|
|
8
|
-
const createBlock_1 = tslib_1.__importDefault(require("../../writes/createBlock"));
|
|
9
|
-
const Description_1 = tslib_1.__importDefault(require("../Description"));
|
|
10
|
-
const BlockPanel = ({ uid: initialUid, parentUid, title, defaultValue, description, }) => {
|
|
11
|
-
const containerRef = (0, react_1.useRef)(null);
|
|
12
|
-
(0, react_1.useEffect)(() => {
|
|
13
|
-
if (containerRef.current) {
|
|
14
|
-
const el = containerRef.current;
|
|
15
|
-
(initialUid
|
|
16
|
-
? Promise.resolve(initialUid)
|
|
17
|
-
: (0, createBlock_1.default)({ node: { text: title, children: [] }, parentUid }))
|
|
18
|
-
.then((formatUid) => (0, getFirstChildUidByBlockUid_1.default)(formatUid) ||
|
|
19
|
-
(0, createBlock_1.default)({
|
|
20
|
-
node: defaultValue || { text: " " },
|
|
21
|
-
parentUid: formatUid,
|
|
22
|
-
}))
|
|
23
|
-
.then((uid) => {
|
|
24
|
-
window.roamAlphaAPI.ui.components.renderBlock({
|
|
25
|
-
uid,
|
|
26
|
-
el,
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}, [containerRef, defaultValue]);
|
|
31
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
32
|
-
react_1.default.createElement(core_1.Label, null,
|
|
33
|
-
(0, idToTitle_1.default)(title),
|
|
34
|
-
react_1.default.createElement(Description_1.default, { description: description })),
|
|
35
|
-
react_1.default.createElement("div", { ref: containerRef, style: {
|
|
36
|
-
border: "1px solid #33333333",
|
|
37
|
-
padding: "8px 0",
|
|
38
|
-
borderRadius: 4,
|
|
39
|
-
} })));
|
|
40
|
-
};
|
|
41
|
-
BlockPanel.type = "block";
|
|
42
|
-
exports.default = BlockPanel;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@blueprintjs/core");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const getFirstChildUidByBlockUid_1 = tslib_1.__importDefault(require("../../queries/getFirstChildUidByBlockUid"));
|
|
7
|
+
const idToTitle_1 = tslib_1.__importDefault(require("../../util/idToTitle"));
|
|
8
|
+
const createBlock_1 = tslib_1.__importDefault(require("../../writes/createBlock"));
|
|
9
|
+
const Description_1 = tslib_1.__importDefault(require("../Description"));
|
|
10
|
+
const BlockPanel = ({ uid: initialUid, parentUid, title, defaultValue, description, }) => {
|
|
11
|
+
const containerRef = (0, react_1.useRef)(null);
|
|
12
|
+
(0, react_1.useEffect)(() => {
|
|
13
|
+
if (containerRef.current) {
|
|
14
|
+
const el = containerRef.current;
|
|
15
|
+
(initialUid
|
|
16
|
+
? Promise.resolve(initialUid)
|
|
17
|
+
: (0, createBlock_1.default)({ node: { text: title, children: [] }, parentUid }))
|
|
18
|
+
.then((formatUid) => (0, getFirstChildUidByBlockUid_1.default)(formatUid) ||
|
|
19
|
+
(0, createBlock_1.default)({
|
|
20
|
+
node: defaultValue || { text: " " },
|
|
21
|
+
parentUid: formatUid,
|
|
22
|
+
}))
|
|
23
|
+
.then((uid) => {
|
|
24
|
+
return window.roamAlphaAPI.ui.components.renderBlock({
|
|
25
|
+
uid,
|
|
26
|
+
el,
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}, [containerRef, defaultValue]);
|
|
31
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
32
|
+
react_1.default.createElement(core_1.Label, null,
|
|
33
|
+
(0, idToTitle_1.default)(title),
|
|
34
|
+
react_1.default.createElement(Description_1.default, { description: description })),
|
|
35
|
+
react_1.default.createElement("div", { ref: containerRef, style: {
|
|
36
|
+
border: "1px solid #33333333",
|
|
37
|
+
padding: "8px 0",
|
|
38
|
+
borderRadius: 4,
|
|
39
|
+
} })));
|
|
40
|
+
};
|
|
41
|
+
BlockPanel.type = "block";
|
|
42
|
+
exports.default = BlockPanel;
|
|
43
43
|
//# sourceMappingURL=BlockPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockPanel.js","sourceRoot":"","sources":["../../../src/components/ConfigPanels/BlockPanel.tsx"],"names":[],"mappings":";;;AAAA,4CAA0C;AAC1C,uDAAiD;AACjD,kHAAkF;AAClF,6EAA6C;AAC7C,mFAAmD;AACnD,yEAAyC;AAGzC,MAAM,UAAU,GAA2B,CAAC,EAC1C,GAAG,EAAE,UAAU,EACf,SAAS,EACT,KAAK,EACL,YAAY,EACZ,WAAW,GACZ,EAAE,EAAE;IACH,MAAM,YAAY,GAAG,IAAA,cAAM,EAAC,IAAI,CAAC,CAAC;IAClC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,YAAY,CAAC,OAAO,EAAE;YACxB,MAAM,EAAE,GAAG,YAAY,CAAC,OAAO,CAAC;YAChC,CAAC,UAAU;gBACT,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;gBAC7B,CAAC,CAAC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,CAClE;iBACE,IAAI,CACH,CAAC,SAAS,EAAE,EAAE,CACZ,IAAA,oCAA0B,EAAC,SAAS,CAAC;gBACrC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CAAC,UAAU,CAAC,WAAW,CAAC;oBACnD,GAAG;oBACH,EAAE;iBACH,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;SACN;IACH,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC;IACjC,OAAO,CACL;QACE,8BAAC,YAAK;YACH,IAAA,mBAAS,EAAC,KAAK,CAAC;YACjB,8BAAC,qBAAW,IAAC,WAAW,EAAE,WAAW,GAAI,CACnC;QACR,uCACE,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE;gBACL,MAAM,EAAE,qBAAqB;gBAC7B,OAAO,EAAE,OAAO;gBAChB,YAAY,EAAE,CAAC;aAChB,GACI,CACN,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,UAAU,CAAC,IAAI,GAAG,OAAO,CAAC;AAE1B,kBAAe,UAAU,CAAC","sourcesContent":["import { Label } from \"@blueprintjs/core\";\nimport React, { useRef, useEffect } from \"react\";\nimport getFirstChildUidByBlockUid from \"../../queries/getFirstChildUidByBlockUid\";\nimport idToTitle from \"../../util/idToTitle\";\nimport createBlock from \"../../writes/createBlock\";\nimport Description from \"../Description\";\nimport type { FieldPanel, BlockField } from \"./types\";\n\nconst BlockPanel: FieldPanel<BlockField> = ({\n uid: initialUid,\n parentUid,\n title,\n defaultValue,\n description,\n}) => {\n const containerRef = useRef(null);\n useEffect(() => {\n if (containerRef.current) {\n const el = containerRef.current;\n (initialUid\n ? Promise.resolve(initialUid)\n : createBlock({ node: { text: title, children: [] }, parentUid })\n )\n .then(\n (formatUid) =>\n getFirstChildUidByBlockUid(formatUid) ||\n createBlock({\n node: defaultValue || { text: \" \" },\n parentUid: formatUid,\n })\n )\n .then((uid) => {\n return window.roamAlphaAPI.ui.components.renderBlock({\n uid,\n el,\n });\n });\n }\n }, [containerRef, defaultValue]);\n return (\n <>\n <Label>\n {idToTitle(title)}\n <Description description={description} />\n </Label>\n <div\n ref={containerRef}\n style={{\n border: \"1px solid #33333333\",\n padding: \"8px 0\",\n borderRadius: 4,\n }}\n ></div>\n </>\n );\n};\n\nBlockPanel.type = \"block\";\n\nexport default BlockPanel;\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { FieldPanel, BlocksField } from "./types";
|
|
2
|
-
declare const BlocksPanel: FieldPanel<BlocksField>;
|
|
3
|
-
export default BlocksPanel;
|
|
1
|
+
import type { FieldPanel, BlocksField } from "./types";
|
|
2
|
+
declare const BlocksPanel: FieldPanel<BlocksField>;
|
|
3
|
+
export default BlocksPanel;
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const core_1 = require("@blueprintjs/core");
|
|
5
|
-
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
-
const getFirstChildUidByBlockUid_1 = tslib_1.__importDefault(require("../../queries/getFirstChildUidByBlockUid"));
|
|
7
|
-
const idToTitle_1 = tslib_1.__importDefault(require("../../util/idToTitle"));
|
|
8
|
-
const createBlock_1 = tslib_1.__importDefault(require("../../writes/createBlock"));
|
|
9
|
-
const Description_1 = tslib_1.__importDefault(require("../Description"));
|
|
10
|
-
const BlocksPanel = ({ uid: initialUid, parentUid, title, defaultValue, description, }) => {
|
|
11
|
-
const containerRef = (0, react_1.useRef)(null);
|
|
12
|
-
const [navUid, setNavUid] = (0, react_1.useState)(initialUid || parentUid);
|
|
13
|
-
(0, react_1.useEffect)(() => {
|
|
14
|
-
if (containerRef.current) {
|
|
15
|
-
const el = containerRef.current;
|
|
16
|
-
(initialUid
|
|
17
|
-
? Promise.resolve(initialUid)
|
|
18
|
-
: (0, createBlock_1.default)({ node: { text: title, children: [] }, parentUid }).then((uid) => {
|
|
19
|
-
setNavUid(uid);
|
|
20
|
-
return uid;
|
|
21
|
-
}))
|
|
22
|
-
.then((formatUid) => (0, getFirstChildUidByBlockUid_1.default)(formatUid)
|
|
23
|
-
? formatUid
|
|
24
|
-
: ((defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.length)
|
|
25
|
-
? Promise.all(defaultValue.map((node, order) => (0, createBlock_1.default)({
|
|
26
|
-
node,
|
|
27
|
-
parentUid: formatUid,
|
|
28
|
-
order,
|
|
29
|
-
})))
|
|
30
|
-
: (0, createBlock_1.default)({
|
|
31
|
-
node: { text: " " },
|
|
32
|
-
parentUid: formatUid,
|
|
33
|
-
})).then(() => formatUid))
|
|
34
|
-
.then((uid) => {
|
|
35
|
-
window.roamAlphaAPI.ui.components.renderBlock({
|
|
36
|
-
uid,
|
|
37
|
-
el,
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}, [containerRef, defaultValue, setNavUid]);
|
|
42
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
43
|
-
react_1.default.createElement(core_1.Label, null,
|
|
44
|
-
(0, idToTitle_1.default)(title),
|
|
45
|
-
react_1.default.createElement(Description_1.default, { description: description }),
|
|
46
|
-
react_1.default.createElement(core_1.Tooltip, { content: "Click here to edit these blocks directly" },
|
|
47
|
-
react_1.default.createElement(core_1.Button, { icon: "link", minimal: true, onClick: () => window.roamAlphaAPI.ui.mainWindow.openBlock({
|
|
48
|
-
block: { uid: navUid },
|
|
49
|
-
}) }))),
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@blueprintjs/core");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const getFirstChildUidByBlockUid_1 = tslib_1.__importDefault(require("../../queries/getFirstChildUidByBlockUid"));
|
|
7
|
+
const idToTitle_1 = tslib_1.__importDefault(require("../../util/idToTitle"));
|
|
8
|
+
const createBlock_1 = tslib_1.__importDefault(require("../../writes/createBlock"));
|
|
9
|
+
const Description_1 = tslib_1.__importDefault(require("../Description"));
|
|
10
|
+
const BlocksPanel = ({ uid: initialUid, parentUid, title, defaultValue, description, }) => {
|
|
11
|
+
const containerRef = (0, react_1.useRef)(null);
|
|
12
|
+
const [navUid, setNavUid] = (0, react_1.useState)(initialUid || parentUid);
|
|
13
|
+
(0, react_1.useEffect)(() => {
|
|
14
|
+
if (containerRef.current) {
|
|
15
|
+
const el = containerRef.current;
|
|
16
|
+
(initialUid
|
|
17
|
+
? Promise.resolve(initialUid)
|
|
18
|
+
: (0, createBlock_1.default)({ node: { text: title, children: [] }, parentUid }).then((uid) => {
|
|
19
|
+
setNavUid(uid);
|
|
20
|
+
return uid;
|
|
21
|
+
}))
|
|
22
|
+
.then((formatUid) => (0, getFirstChildUidByBlockUid_1.default)(formatUid)
|
|
23
|
+
? formatUid
|
|
24
|
+
: ((defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.length)
|
|
25
|
+
? Promise.all(defaultValue.map((node, order) => (0, createBlock_1.default)({
|
|
26
|
+
node,
|
|
27
|
+
parentUid: formatUid,
|
|
28
|
+
order,
|
|
29
|
+
})))
|
|
30
|
+
: (0, createBlock_1.default)({
|
|
31
|
+
node: { text: " " },
|
|
32
|
+
parentUid: formatUid,
|
|
33
|
+
})).then(() => formatUid))
|
|
34
|
+
.then((uid) => {
|
|
35
|
+
return window.roamAlphaAPI.ui.components.renderBlock({
|
|
36
|
+
uid,
|
|
37
|
+
el,
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}, [containerRef, defaultValue, setNavUid]);
|
|
42
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
43
|
+
react_1.default.createElement(core_1.Label, null,
|
|
44
|
+
(0, idToTitle_1.default)(title),
|
|
45
|
+
react_1.default.createElement(Description_1.default, { description: description }),
|
|
46
|
+
react_1.default.createElement(core_1.Tooltip, { content: "Click here to edit these blocks directly" },
|
|
47
|
+
react_1.default.createElement(core_1.Button, { icon: "link", minimal: true, onClick: () => window.roamAlphaAPI.ui.mainWindow.openBlock({
|
|
48
|
+
block: { uid: navUid },
|
|
49
|
+
}) }))),
|
|
50
50
|
react_1.default.createElement("style", null, `.roamjs-config-blocks > div > .rm-block-main {
|
|
51
51
|
display: none;
|
|
52
52
|
}
|
|
@@ -57,13 +57,13 @@ const BlocksPanel = ({ uid: initialUid, parentUid, title, defaultValue, descript
|
|
|
57
57
|
|
|
58
58
|
.roamjs-config-blocks > div > .rm-block-children {
|
|
59
59
|
margin-left: -4px;
|
|
60
|
-
}`),
|
|
61
|
-
react_1.default.createElement("div", { ref: containerRef, style: {
|
|
62
|
-
border: "1px solid #33333333",
|
|
63
|
-
padding: "8px 0",
|
|
64
|
-
borderRadius: 4,
|
|
65
|
-
}, className: "roamjs-config-blocks" })));
|
|
66
|
-
};
|
|
67
|
-
BlocksPanel.type = "blocks";
|
|
68
|
-
exports.default = BlocksPanel;
|
|
60
|
+
}`),
|
|
61
|
+
react_1.default.createElement("div", { ref: containerRef, style: {
|
|
62
|
+
border: "1px solid #33333333",
|
|
63
|
+
padding: "8px 0",
|
|
64
|
+
borderRadius: 4,
|
|
65
|
+
}, className: "roamjs-config-blocks" })));
|
|
66
|
+
};
|
|
67
|
+
BlocksPanel.type = "blocks";
|
|
68
|
+
exports.default = BlocksPanel;
|
|
69
69
|
//# sourceMappingURL=BlocksPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlocksPanel.js","sourceRoot":"","sources":["../../../src/components/ConfigPanels/BlocksPanel.tsx"],"names":[],"mappings":";;;AAAA,4CAA2D;AAC3D,uDAA2D;AAC3D,kHAAkF;AAClF,6EAA6C;AAC7C,mFAAmD;AACnD,yEAAyC;AAGzC,MAAM,WAAW,GAA4B,CAAC,EAC5C,GAAG,EAAE,UAAU,EACf,SAAS,EACT,KAAK,EACL,YAAY,EACZ,WAAW,GACZ,EAAE,EAAE;IACH,MAAM,YAAY,GAAG,IAAA,cAAM,EAAC,IAAI,CAAC,CAAC;IAClC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAA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ffect, useRef, useState } from \"react\";\nimport getFirstChildUidByBlockUid from \"../../queries/getFirstChildUidByBlockUid\";\nimport idToTitle from \"../../util/idToTitle\";\nimport createBlock from \"../../writes/createBlock\";\nimport Description from \"../Description\";\nimport type { FieldPanel, BlocksField } from \"./types\";\n\nconst BlocksPanel: FieldPanel<BlocksField> = ({\n uid: initialUid,\n parentUid,\n title,\n defaultValue,\n description,\n}) => {\n const containerRef = useRef(null);\n const [navUid, setNavUid] = useState(initialUid || parentUid);\n useEffect(() => {\n if (containerRef.current) {\n const el = containerRef.current;\n (initialUid\n ? Promise.resolve(initialUid)\n : createBlock({ node: { text: title, children: [] }, parentUid }).then(\n (uid) => {\n setNavUid(uid);\n return uid;\n }\n )\n )\n .then((formatUid) =>\n getFirstChildUidByBlockUid(formatUid)\n ? formatUid\n : (defaultValue?.length\n ? Promise.all(\n defaultValue.map((node, order) =>\n createBlock({\n node,\n parentUid: formatUid,\n order,\n })\n )\n )\n : createBlock({\n node: { text: \" \" },\n parentUid: formatUid,\n })\n ).then(() => formatUid)\n )\n .then((uid) => {\n return window.roamAlphaAPI.ui.components.renderBlock({\n uid,\n el,\n });\n });\n }\n }, [containerRef, defaultValue, setNavUid]);\n return (\n <>\n <Label>\n {idToTitle(title)}\n <Description description={description} />\n <Tooltip content={\"Click here to edit these blocks directly\"}>\n <Button\n icon={\"link\"}\n minimal\n onClick={() =>\n window.roamAlphaAPI.ui.mainWindow.openBlock({\n block: { uid: navUid },\n })\n }\n />\n </Tooltip>\n </Label>\n <style>{`.roamjs-config-blocks > div > .rm-block-main {\n display: none;\n }\n \n .roamjs-config-blocks > div > .rm-block-children > .rm-multibar {\n display: none;\n }\n \n .roamjs-config-blocks > div > .rm-block-children {\n margin-left: -4px;\n }`}</style>\n <div\n ref={containerRef}\n style={{\n border: \"1px solid #33333333\",\n padding: \"8px 0\",\n borderRadius: 4,\n }}\n className={\"roamjs-config-blocks\"}\n ></div>\n </>\n );\n};\n\nBlocksPanel.type = \"blocks\";\n\nexport default BlocksPanel;\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { FieldPanel, CustomField } from "./types";
|
|
2
|
-
declare const CustomPanel: FieldPanel<CustomField>;
|
|
3
|
-
export default CustomPanel;
|
|
1
|
+
import type { FieldPanel, CustomField } from "./types";
|
|
2
|
+
declare const CustomPanel: FieldPanel<CustomField>;
|
|
3
|
+
export default CustomPanel;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const core_1 = require("@blueprintjs/core");
|
|
5
|
-
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
-
const idToTitle_1 = tslib_1.__importDefault(require("../../util/idToTitle"));
|
|
7
|
-
const createBlock_1 = tslib_1.__importDefault(require("../../writes/createBlock"));
|
|
8
|
-
const Description_1 = tslib_1.__importDefault(require("../Description"));
|
|
9
|
-
const CustomPanel = ({ description, title, uid: inputUid, options: { component: Component }, parentUid, defaultValue = [], order, }) => {
|
|
10
|
-
const uid = (0, react_1.useMemo)(() => {
|
|
11
|
-
if (inputUid)
|
|
12
|
-
return inputUid;
|
|
13
|
-
const newUid = window.roamAlphaAPI.util.generateUID();
|
|
14
|
-
(0, createBlock_1.default)({ node: { text: title, uid: newUid }, parentUid, order });
|
|
15
|
-
return newUid;
|
|
16
|
-
}, [inputUid]);
|
|
17
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
18
|
-
react_1.default.createElement(core_1.Label, null,
|
|
19
|
-
(0, idToTitle_1.default)(title),
|
|
20
|
-
react_1.default.createElement(Description_1.default, { description: description })),
|
|
21
|
-
react_1.default.createElement(Component, { uid: uid, parentUid: parentUid, title: title, defaultValue: defaultValue })));
|
|
22
|
-
};
|
|
23
|
-
CustomPanel.type = "custom";
|
|
24
|
-
exports.default = CustomPanel;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@blueprintjs/core");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const idToTitle_1 = tslib_1.__importDefault(require("../../util/idToTitle"));
|
|
7
|
+
const createBlock_1 = tslib_1.__importDefault(require("../../writes/createBlock"));
|
|
8
|
+
const Description_1 = tslib_1.__importDefault(require("../Description"));
|
|
9
|
+
const CustomPanel = ({ description, title, uid: inputUid, options: { component: Component }, parentUid, defaultValue = [], order, }) => {
|
|
10
|
+
const uid = (0, react_1.useMemo)(() => {
|
|
11
|
+
if (inputUid)
|
|
12
|
+
return inputUid;
|
|
13
|
+
const newUid = window.roamAlphaAPI.util.generateUID();
|
|
14
|
+
(0, createBlock_1.default)({ node: { text: title, uid: newUid }, parentUid, order });
|
|
15
|
+
return newUid;
|
|
16
|
+
}, [inputUid]);
|
|
17
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
18
|
+
react_1.default.createElement(core_1.Label, null,
|
|
19
|
+
(0, idToTitle_1.default)(title),
|
|
20
|
+
react_1.default.createElement(Description_1.default, { description: description })),
|
|
21
|
+
react_1.default.createElement(Component, { uid: uid, parentUid: parentUid, title: title, defaultValue: defaultValue })));
|
|
22
|
+
};
|
|
23
|
+
CustomPanel.type = "custom";
|
|
24
|
+
exports.default = CustomPanel;
|
|
25
25
|
//# sourceMappingURL=CustomPanel.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { FieldPanel, FlagField } from "./types";
|
|
2
|
-
declare const FlagPanel: FieldPanel<FlagField>;
|
|
3
|
-
export default FlagPanel;
|
|
1
|
+
import type { FieldPanel, FlagField } from "./types";
|
|
2
|
+
declare const FlagPanel: FieldPanel<FlagField>;
|
|
3
|
+
export default FlagPanel;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const core_1 = require("@blueprintjs/core");
|
|
5
|
-
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
-
const idToTitle_1 = tslib_1.__importDefault(require("../../util/idToTitle"));
|
|
7
|
-
const Description_1 = tslib_1.__importDefault(require("../Description"));
|
|
8
|
-
const FlagPanel = ({ title, uid: initialUid, parentUid, order, description, options = {}, disabled = false, }) => {
|
|
9
|
-
const [uid, setUid] = (0, react_1.useState)(initialUid);
|
|
10
|
-
return (react_1.default.createElement(core_1.Checkbox, { checked: !!uid, disabled: disabled, onChange: (e) => {
|
|
11
|
-
var _a;
|
|
12
|
-
const { checked } = e.target;
|
|
13
|
-
if (checked) {
|
|
14
|
-
const newUid = window.roamAlphaAPI.util.generateUID();
|
|
15
|
-
window.roamAlphaAPI.createBlock({
|
|
16
|
-
block: { string: title, uid: newUid },
|
|
17
|
-
location: { order, "parent-uid": parentUid },
|
|
18
|
-
});
|
|
19
|
-
setTimeout(() => setUid(newUid), 1);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
window.roamAlphaAPI.deleteBlock({ block: { uid } });
|
|
23
|
-
setUid("");
|
|
24
|
-
}
|
|
25
|
-
(_a = options.onChange) === null || _a === void 0 ? void 0 : _a.call(options, checked, e);
|
|
26
|
-
}, labelElement: react_1.default.createElement(react_1.default.Fragment, null,
|
|
27
|
-
(0, idToTitle_1.default)(title),
|
|
28
|
-
react_1.default.createElement(Description_1.default, { description: description })) }));
|
|
29
|
-
};
|
|
30
|
-
FlagPanel.type = "flag";
|
|
31
|
-
exports.default = FlagPanel;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@blueprintjs/core");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const idToTitle_1 = tslib_1.__importDefault(require("../../util/idToTitle"));
|
|
7
|
+
const Description_1 = tslib_1.__importDefault(require("../Description"));
|
|
8
|
+
const FlagPanel = ({ title, uid: initialUid, parentUid, order, description, options = {}, disabled = false, }) => {
|
|
9
|
+
const [uid, setUid] = (0, react_1.useState)(initialUid);
|
|
10
|
+
return (react_1.default.createElement(core_1.Checkbox, { checked: !!uid, disabled: disabled, onChange: (e) => {
|
|
11
|
+
var _a;
|
|
12
|
+
const { checked } = e.target;
|
|
13
|
+
if (checked) {
|
|
14
|
+
const newUid = window.roamAlphaAPI.util.generateUID();
|
|
15
|
+
window.roamAlphaAPI.createBlock({
|
|
16
|
+
block: { string: title, uid: newUid },
|
|
17
|
+
location: { order, "parent-uid": parentUid },
|
|
18
|
+
});
|
|
19
|
+
setTimeout(() => setUid(newUid), 1);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
window.roamAlphaAPI.deleteBlock({ block: { uid } });
|
|
23
|
+
setUid("");
|
|
24
|
+
}
|
|
25
|
+
(_a = options.onChange) === null || _a === void 0 ? void 0 : _a.call(options, checked, e);
|
|
26
|
+
}, labelElement: react_1.default.createElement(react_1.default.Fragment, null,
|
|
27
|
+
(0, idToTitle_1.default)(title),
|
|
28
|
+
react_1.default.createElement(Description_1.default, { description: description })) }));
|
|
29
|
+
};
|
|
30
|
+
FlagPanel.type = "flag";
|
|
31
|
+
exports.default = FlagPanel;
|
|
32
32
|
//# sourceMappingURL=FlagPanel.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { FieldPanel, ArrayField } from "./types";
|
|
3
|
-
declare const MultiChildPanel: FieldPanel<ArrayField, {
|
|
4
|
-
InputComponent: (props: {
|
|
5
|
-
value: string;
|
|
6
|
-
setValue: (s: string) => void;
|
|
7
|
-
}) => React.ReactElement;
|
|
8
|
-
}>;
|
|
9
|
-
export default MultiChildPanel;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FieldPanel, ArrayField } from "./types";
|
|
3
|
+
declare const MultiChildPanel: FieldPanel<ArrayField, {
|
|
4
|
+
InputComponent: (props: {
|
|
5
|
+
value: string;
|
|
6
|
+
setValue: (s: string) => void;
|
|
7
|
+
}) => React.ReactElement;
|
|
8
|
+
}>;
|
|
9
|
+
export default MultiChildPanel;
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const core_1 = require("@blueprintjs/core");
|
|
5
|
-
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
-
const getShallowTreeByParentUid_1 = tslib_1.__importDefault(require("../../queries/getShallowTreeByParentUid"));
|
|
7
|
-
const idToTitle_1 = tslib_1.__importDefault(require("../../util/idToTitle"));
|
|
8
|
-
const Description_1 = tslib_1.__importDefault(require("../Description"));
|
|
9
|
-
const MultiChildPanel = ({ uid: initialUid, title, description, order, parentUid, InputComponent, }) => {
|
|
10
|
-
const [uid, setUid] = (0, react_1.useState)(initialUid);
|
|
11
|
-
const [texts, setTexts] = (0, react_1.useState)(() => uid ? (0, getShallowTreeByParentUid_1.default)(uid) : []);
|
|
12
|
-
const [value, setValue] = (0, react_1.useState)("");
|
|
13
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
14
|
-
react_1.default.createElement(core_1.Label, null,
|
|
15
|
-
(0, idToTitle_1.default)(title),
|
|
16
|
-
react_1.default.createElement(Description_1.default, { description: description }),
|
|
17
|
-
react_1.default.createElement("div", { style: { display: "flex" } },
|
|
18
|
-
react_1.default.createElement(InputComponent, { value: value, setValue: setValue }),
|
|
19
|
-
react_1.default.createElement(core_1.Button, { icon: "plus", minimal: true, disabled: !value, onClick: () => {
|
|
20
|
-
const valueUid = window.roamAlphaAPI.util.generateUID();
|
|
21
|
-
if (uid) {
|
|
22
|
-
window.roamAlphaAPI.createBlock({
|
|
23
|
-
location: { "parent-uid": uid, order: texts.length },
|
|
24
|
-
block: { string: value, uid: valueUid },
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
const newUid = window.roamAlphaAPI.util.generateUID();
|
|
29
|
-
window.roamAlphaAPI.createBlock({
|
|
30
|
-
block: { string: title, uid: newUid },
|
|
31
|
-
location: { order, "parent-uid": parentUid },
|
|
32
|
-
});
|
|
33
|
-
setTimeout(() => setUid(newUid));
|
|
34
|
-
window.roamAlphaAPI.createBlock({
|
|
35
|
-
block: { string: value, uid: valueUid },
|
|
36
|
-
location: { order: 0, "parent-uid": newUid },
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
setTexts([...texts, { text: value, uid: valueUid }]);
|
|
40
|
-
setValue("");
|
|
41
|
-
} }))),
|
|
42
|
-
texts.map((p) => (react_1.default.createElement("div", { key: p.uid, style: {
|
|
43
|
-
display: "flex",
|
|
44
|
-
alignItems: "center",
|
|
45
|
-
justifyContent: "space-between",
|
|
46
|
-
} },
|
|
47
|
-
react_1.default.createElement("span", { style: {
|
|
48
|
-
textOverflow: "ellipsis",
|
|
49
|
-
whiteSpace: "nowrap",
|
|
50
|
-
overflow: "hidden",
|
|
51
|
-
} }, p.text),
|
|
52
|
-
react_1.default.createElement(core_1.Button, { icon: "trash", minimal: true, onClick: () => {
|
|
53
|
-
window.roamAlphaAPI.deleteBlock({ block: { uid: p.uid } });
|
|
54
|
-
setTexts(texts.filter((f) => f.uid !== p.uid));
|
|
55
|
-
} }))))));
|
|
56
|
-
};
|
|
57
|
-
MultiChildPanel.type = "custom";
|
|
58
|
-
exports.default = MultiChildPanel;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@blueprintjs/core");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const getShallowTreeByParentUid_1 = tslib_1.__importDefault(require("../../queries/getShallowTreeByParentUid"));
|
|
7
|
+
const idToTitle_1 = tslib_1.__importDefault(require("../../util/idToTitle"));
|
|
8
|
+
const Description_1 = tslib_1.__importDefault(require("../Description"));
|
|
9
|
+
const MultiChildPanel = ({ uid: initialUid, title, description, order, parentUid, InputComponent, }) => {
|
|
10
|
+
const [uid, setUid] = (0, react_1.useState)(initialUid);
|
|
11
|
+
const [texts, setTexts] = (0, react_1.useState)(() => uid ? (0, getShallowTreeByParentUid_1.default)(uid) : []);
|
|
12
|
+
const [value, setValue] = (0, react_1.useState)("");
|
|
13
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
14
|
+
react_1.default.createElement(core_1.Label, null,
|
|
15
|
+
(0, idToTitle_1.default)(title),
|
|
16
|
+
react_1.default.createElement(Description_1.default, { description: description }),
|
|
17
|
+
react_1.default.createElement("div", { style: { display: "flex" } },
|
|
18
|
+
react_1.default.createElement(InputComponent, { value: value, setValue: setValue }),
|
|
19
|
+
react_1.default.createElement(core_1.Button, { icon: "plus", minimal: true, disabled: !value, onClick: () => {
|
|
20
|
+
const valueUid = window.roamAlphaAPI.util.generateUID();
|
|
21
|
+
if (uid) {
|
|
22
|
+
window.roamAlphaAPI.createBlock({
|
|
23
|
+
location: { "parent-uid": uid, order: texts.length },
|
|
24
|
+
block: { string: value, uid: valueUid },
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
const newUid = window.roamAlphaAPI.util.generateUID();
|
|
29
|
+
window.roamAlphaAPI.createBlock({
|
|
30
|
+
block: { string: title, uid: newUid },
|
|
31
|
+
location: { order, "parent-uid": parentUid },
|
|
32
|
+
});
|
|
33
|
+
setTimeout(() => setUid(newUid));
|
|
34
|
+
window.roamAlphaAPI.createBlock({
|
|
35
|
+
block: { string: value, uid: valueUid },
|
|
36
|
+
location: { order: 0, "parent-uid": newUid },
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
setTexts([...texts, { text: value, uid: valueUid }]);
|
|
40
|
+
setValue("");
|
|
41
|
+
} }))),
|
|
42
|
+
texts.map((p) => (react_1.default.createElement("div", { key: p.uid, style: {
|
|
43
|
+
display: "flex",
|
|
44
|
+
alignItems: "center",
|
|
45
|
+
justifyContent: "space-between",
|
|
46
|
+
} },
|
|
47
|
+
react_1.default.createElement("span", { style: {
|
|
48
|
+
textOverflow: "ellipsis",
|
|
49
|
+
whiteSpace: "nowrap",
|
|
50
|
+
overflow: "hidden",
|
|
51
|
+
} }, p.text),
|
|
52
|
+
react_1.default.createElement(core_1.Button, { icon: "trash", minimal: true, onClick: () => {
|
|
53
|
+
window.roamAlphaAPI.deleteBlock({ block: { uid: p.uid } });
|
|
54
|
+
setTexts(texts.filter((f) => f.uid !== p.uid));
|
|
55
|
+
} }))))));
|
|
56
|
+
};
|
|
57
|
+
MultiChildPanel.type = "custom";
|
|
58
|
+
exports.default = MultiChildPanel;
|
|
59
59
|
//# sourceMappingURL=MultiChildPanel.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { FieldPanel, MultiTextField } from "./types";
|
|
2
|
-
declare const MultiTextPanel: FieldPanel<MultiTextField>;
|
|
3
|
-
export default MultiTextPanel;
|
|
1
|
+
import type { FieldPanel, MultiTextField } from "./types";
|
|
2
|
+
declare const MultiTextPanel: FieldPanel<MultiTextField>;
|
|
3
|
+
export default MultiTextPanel;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const core_1 = require("@blueprintjs/core");
|
|
5
|
-
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const MultiChildPanel_1 = tslib_1.__importDefault(require("./MultiChildPanel"));
|
|
7
|
-
const MultiTextPanel = (props) => {
|
|
8
|
-
return (react_1.default.createElement(MultiChildPanel_1.default, Object.assign({}, props, { InputComponent: ({ value, setValue }) => {
|
|
9
|
-
var _a;
|
|
10
|
-
return (react_1.default.createElement(core_1.InputGroup, { value: value, onChange: (e) => setValue(e.target.value), placeholder: (_a = props.options) === null || _a === void 0 ? void 0 : _a.placeholder }));
|
|
11
|
-
} })));
|
|
12
|
-
};
|
|
13
|
-
MultiTextPanel.type = "multitext";
|
|
14
|
-
exports.default = MultiTextPanel;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@blueprintjs/core");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const MultiChildPanel_1 = tslib_1.__importDefault(require("./MultiChildPanel"));
|
|
7
|
+
const MultiTextPanel = (props) => {
|
|
8
|
+
return (react_1.default.createElement(MultiChildPanel_1.default, Object.assign({}, props, { InputComponent: ({ value, setValue }) => {
|
|
9
|
+
var _a;
|
|
10
|
+
return (react_1.default.createElement(core_1.InputGroup, { value: value, onChange: (e) => setValue(e.target.value), placeholder: (_a = props.options) === null || _a === void 0 ? void 0 : _a.placeholder }));
|
|
11
|
+
} })));
|
|
12
|
+
};
|
|
13
|
+
MultiTextPanel.type = "multitext";
|
|
14
|
+
exports.default = MultiTextPanel;
|
|
15
15
|
//# sourceMappingURL=MultiTextPanel.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FieldPanel, NumberField } from "./types";
|
|
2
|
-
declare const NumberPanel: FieldPanel<NumberField>;
|
|
3
|
-
export default NumberPanel;
|
|
1
|
+
import { FieldPanel, NumberField } from "./types";
|
|
2
|
+
declare const NumberPanel: FieldPanel<NumberField>;
|
|
3
|
+
export default NumberPanel;
|