@riboseinc/paneron-registry-kit 2.0.0 → 2.0.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 -0
- package/README.adoc +35 -0
- package/compiled/common.js +2 -0
- package/compiled/index.js +21 -0
- package/compiled/migrations/initial.js +8 -0
- package/compiled/types/cr.js +131 -0
- package/compiled/types/index.js +8 -0
- package/compiled/types/item.js +22 -0
- package/compiled/types/proposal.js +21 -0
- package/compiled/types/register.js +25 -0
- package/compiled/types/registry.js +10 -0
- package/compiled/types/stakeholder.js +34 -0
- package/compiled/types/util.js +3 -0
- package/compiled/types/views.js +2 -0
- package/compiled/views/AnnotatedChange.js +57 -0
- package/compiled/views/BrowserCtx.js +19 -0
- package/compiled/views/FilterCriteria/CRITERIA_CONFIGURATION.js +110 -0
- package/compiled/views/FilterCriteria/criteriaGroupToQueryExpression.js +40 -0
- package/compiled/views/FilterCriteria/criteriaGroupToSummary.js +47 -0
- package/compiled/views/FilterCriteria/criteriaToNodes.js +89 -0
- package/compiled/views/FilterCriteria/index.js +75 -0
- package/compiled/views/FilterCriteria/models.js +28 -0
- package/compiled/views/FilterCriteria/mutateGroup.js +53 -0
- package/compiled/views/GenericRelatedItemView.js +147 -0
- package/compiled/views/RegisterStakeholder.js +19 -0
- package/compiled/views/RegisterVersion.js +20 -0
- package/compiled/views/SearchQuery.js +58 -0
- package/compiled/views/change-request/ChangeRequestContext.js +30 -0
- package/compiled/views/change-request/Proposals.js +185 -0
- package/compiled/views/change-request/objectChangeset.js +189 -0
- package/compiled/views/detail/ChangeRequest/Proposal.js +144 -0
- package/compiled/views/detail/ChangeRequest/index.js +140 -0
- package/compiled/views/detail/ChangeRequest/transitions.js +418 -0
- package/compiled/views/detail/CustomView/index.js +32 -0
- package/compiled/views/detail/RegisterHome/index.js +70 -0
- package/compiled/views/detail/RegisterItem/RelatedItems.d.ts +14 -0
- package/compiled/views/detail/RegisterItem/RelatedItems.js +28 -0
- package/compiled/views/detail/RegisterItem/RelatedItems.js.map +1 -0
- package/compiled/views/detail/RegisterItem/SupersedingItemMenu.js +27 -0
- package/compiled/views/detail/RegisterItem/index.js +277 -0
- package/compiled/views/detail/RegisterItem/index.js.map +1 -0
- package/compiled/views/detail/RegisterMeta/RegisterMetaForm.js +135 -0
- package/compiled/views/detail/RegisterMeta/index.js +61 -0
- package/compiled/views/detail/index.js +11 -0
- package/compiled/views/diffing/InlineDiff.js +20 -0
- package/compiled/views/diffing/StructuredDiff.js +38 -0
- package/compiled/views/hooks/useCustomView.js +14 -0
- package/compiled/views/hooks/useItemClassConfig.js +14 -0
- package/compiled/views/hooks/useItemRef.js +26 -0
- package/compiled/views/hooks/useSingleRegisterItemData.js +21 -0
- package/compiled/views/index.js +142 -0
- package/compiled/views/itemPathUtils.js +115 -0
- package/compiled/views/itemQueryUtils.js +42 -0
- package/compiled/views/protocolRegistry.js +24 -0
- package/compiled/views/sidebar/Browse/index.js +278 -0
- package/compiled/views/sidebar/Export/index.js +47 -0
- package/compiled/views/sidebar/ListItem.js +23 -0
- package/compiled/views/sidebar/Registration/index.js +114 -0
- package/compiled/views/sidebar/Search/index.js +100 -0
- package/compiled/views/sidebar/index.js +73 -0
- package/compiled/views/util.js +63 -0
- package/dependencies-local/extension-kit/SettingsContext.d.ts +8 -0
- package/dependencies-local/extension-kit/SettingsContext.js +19 -0
- package/dependencies-local/extension-kit/SettingsContext.js.map +1 -0
- package/dependencies-local/extension-kit/context.d.ts +11 -0
- package/dependencies-local/extension-kit/context.js +133 -0
- package/dependencies-local/extension-kit/context.js.map +1 -0
- package/dependencies-local/extension-kit/i18n/ContextProvider.d.ts +9 -0
- package/dependencies-local/extension-kit/i18n/ContextProvider.js +33 -0
- package/dependencies-local/extension-kit/i18n/ContextProvider.js.map +1 -0
- package/dependencies-local/extension-kit/i18n/context.d.ts +9 -0
- package/dependencies-local/extension-kit/i18n/context.js +23 -0
- package/dependencies-local/extension-kit/i18n/context.js.map +1 -0
- package/dependencies-local/extension-kit/i18n/types.d.ts +10 -0
- package/dependencies-local/extension-kit/i18n/types.js.map +1 -0
- package/dependencies-local/extension-kit/i18n/widgets.d.ts +16 -0
- package/dependencies-local/extension-kit/i18n/widgets.js +56 -0
- package/dependencies-local/extension-kit/i18n/widgets.js.map +1 -0
- package/dependencies-local/extension-kit/index.d.ts +3 -0
- package/dependencies-local/extension-kit/index.js +78 -0
- package/dependencies-local/extension-kit/index.js.map +1 -0
- package/dependencies-local/extension-kit/object-specs/index.d.ts +2 -0
- package/dependencies-local/extension-kit/object-specs/index.js +22 -0
- package/dependencies-local/extension-kit/object-specs/index.js.map +1 -0
- package/dependencies-local/extension-kit/object-specs/paneron-object.d.ts +6 -0
- package/dependencies-local/extension-kit/object-specs/paneron-object.js +161 -0
- package/dependencies-local/extension-kit/object-specs/paneron-object.js.map +1 -0
- package/dependencies-local/extension-kit/object-specs/ser-des.d.ts +31 -0
- package/dependencies-local/extension-kit/object-specs/ser-des.js +187 -0
- package/dependencies-local/extension-kit/object-specs/ser-des.js.map +1 -0
- package/dependencies-local/extension-kit/object-specs/yaml/custom-bool.d.ts +2 -0
- package/dependencies-local/extension-kit/object-specs/yaml/custom-bool.js +42 -0
- package/dependencies-local/extension-kit/object-specs/yaml/custom-bool.js.map +1 -0
- package/dependencies-local/extension-kit/object-specs/yaml/custom-timestamp.d.ts +3 -0
- package/dependencies-local/extension-kit/object-specs/yaml/custom-timestamp.js +110 -0
- package/dependencies-local/extension-kit/object-specs/yaml/custom-timestamp.js.map +1 -0
- package/dependencies-local/extension-kit/object-specs/yaml/index.d.ts +9 -0
- package/dependencies-local/extension-kit/object-specs/yaml/index.js +36 -0
- package/dependencies-local/extension-kit/object-specs/yaml/index.js.map +1 -0
- package/dependencies-local/extension-kit/object-specs/yaml/schema.d.ts +3 -0
- package/dependencies-local/extension-kit/object-specs/yaml/schema.js +26 -0
- package/dependencies-local/extension-kit/object-specs/yaml/schema.js.map +1 -0
- package/dependencies-local/extension-kit/package.json +53 -0
- package/dependencies-local/extension-kit/settings.d.ts +6 -0
- package/dependencies-local/extension-kit/settings.js +11 -0
- package/dependencies-local/extension-kit/settings.js.map +1 -0
- package/dependencies-local/extension-kit/types/binary-invocation.d.ts +31 -0
- package/dependencies-local/extension-kit/types/binary-invocation.js.map +1 -0
- package/dependencies-local/extension-kit/types/buffers.d.ts +17 -0
- package/dependencies-local/extension-kit/types/buffers.js +5 -0
- package/dependencies-local/extension-kit/types/buffers.js.map +1 -0
- package/dependencies-local/extension-kit/types/changes.d.ts +37 -0
- package/dependencies-local/extension-kit/types/changes.js +5 -0
- package/dependencies-local/extension-kit/types/changes.js.map +1 -0
- package/dependencies-local/extension-kit/types/data.d.ts +54 -0
- package/dependencies-local/extension-kit/types/data.js +5 -0
- package/dependencies-local/extension-kit/types/data.js.map +1 -0
- package/dependencies-local/extension-kit/types/dialogs.d.ts +15 -0
- package/dependencies-local/extension-kit/types/dialogs.js +5 -0
- package/dependencies-local/extension-kit/types/dialogs.js.map +1 -0
- package/dependencies-local/extension-kit/types/extension-maker.d.ts +17 -0
- package/dependencies-local/extension-kit/types/extension-maker.js +5 -0
- package/dependencies-local/extension-kit/types/extension-maker.js.map +1 -0
- package/dependencies-local/extension-kit/types/extension.d.ts +27 -0
- package/dependencies-local/extension-kit/types/extension.js +5 -0
- package/dependencies-local/extension-kit/types/extension.js.map +1 -0
- package/dependencies-local/extension-kit/types/index.d.ts +3 -0
- package/dependencies-local/extension-kit/types/index.js +41 -0
- package/dependencies-local/extension-kit/types/index.js.map +1 -0
- package/dependencies-local/extension-kit/types/indexes.d.ts +6 -0
- package/dependencies-local/extension-kit/types/indexes.js +15 -0
- package/dependencies-local/extension-kit/types/indexes.js.map +1 -0
- package/dependencies-local/extension-kit/types/migrations.d.ts +15 -0
- package/dependencies-local/extension-kit/types/migrations.js +5 -0
- package/dependencies-local/extension-kit/types/migrations.js.map +1 -0
- package/dependencies-local/extension-kit/types/object-spec.d.ts +108 -0
- package/dependencies-local/extension-kit/types/object-spec.js +23 -0
- package/dependencies-local/extension-kit/types/object-spec.js.map +1 -0
- package/dependencies-local/extension-kit/types/objects.d.ts +18 -0
- package/dependencies-local/extension-kit/types/objects.js +5 -0
- package/dependencies-local/extension-kit/types/objects.js.map +1 -0
- package/dependencies-local/extension-kit/types/progress.d.ts +5 -0
- package/dependencies-local/extension-kit/types/progress.js +5 -0
- package/dependencies-local/extension-kit/types/progress.js.map +1 -0
- package/dependencies-local/extension-kit/types/renderer.d.ts +495 -0
- package/dependencies-local/extension-kit/types/renderer.js +5 -0
- package/dependencies-local/extension-kit/types/renderer.js.map +1 -0
- package/dependencies-local/extension-kit/useDebounce.d.ts +2 -0
- package/dependencies-local/extension-kit/useDebounce.js +27 -0
- package/dependencies-local/extension-kit/useDebounce.js.map +1 -0
- package/dependencies-local/extension-kit/usePersistentStateReducer.d.ts +35 -0
- package/dependencies-local/extension-kit/usePersistentStateReducer.js +91 -0
- package/dependencies-local/extension-kit/usePersistentStateReducer.js.map +1 -0
- package/dependencies-local/extension-kit/useTimeTravelingPersistentStateReducer.d.ts +48 -0
- package/dependencies-local/extension-kit/useTimeTravelingPersistentStateReducer.js +116 -0
- package/dependencies-local/extension-kit/useTimeTravelingPersistentStateReducer.js.map +1 -0
- package/dependencies-local/extension-kit/util.d.ts +8 -0
- package/dependencies-local/extension-kit/util.js +21 -0
- package/dependencies-local/extension-kit/util.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/ErrorState.d.ts +8 -0
- package/dependencies-local/extension-kit/widgets/ErrorState.js +44 -0
- package/dependencies-local/extension-kit/widgets/ErrorState.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/Grid.d.ts +41 -0
- package/dependencies-local/extension-kit/widgets/Grid.js +213 -0
- package/dependencies-local/extension-kit/widgets/Grid.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/HelpTooltip.d.ts +18 -0
- package/dependencies-local/extension-kit/widgets/HelpTooltip.js +84 -0
- package/dependencies-local/extension-kit/widgets/HelpTooltip.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/ItemCount.d.ts +19 -0
- package/dependencies-local/extension-kit/widgets/ItemCount.js +78 -0
- package/dependencies-local/extension-kit/widgets/ItemCount.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/List.d.ts +40 -0
- package/dependencies-local/extension-kit/widgets/List.js +191 -0
- package/dependencies-local/extension-kit/widgets/List.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/Navbar.d.ts +20 -0
- package/dependencies-local/extension-kit/widgets/Navbar.js +75 -0
- package/dependencies-local/extension-kit/widgets/Navbar.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/SearchResultList.d.ts +24 -0
- package/dependencies-local/extension-kit/widgets/SearchResultList.js +201 -0
- package/dependencies-local/extension-kit/widgets/SearchResultList.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/Block.d.ts +21 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/Block.js +94 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/Block.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/BlockStateButtonGroup.d.ts +6 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/BlockStateButtonGroup.js +22 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/BlockStateButtonGroup.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/PropertyView.d.ts +28 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/PropertyView.js +148 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/PropertyView.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/index.d.ts +27 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/index.js +178 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/index.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/SuperSidebar.d.ts +13 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/SuperSidebar.js +82 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/SuperSidebar.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/context.d.ts +10 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/context.js +168 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/context.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/detail.d.ts +9 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/detail.js +66 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/detail.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/index.d.ts +33 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/index.js +204 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/index.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/types.d.ts +74 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/types.js +5 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/types.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/util.d.ts +1 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/util.js +14 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/util.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/Workspace.d.ts +38 -0
- package/dependencies-local/extension-kit/widgets/Workspace.js +99 -0
- package/dependencies-local/extension-kit/widgets/Workspace.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/panels/PanelSeparator.d.ts +12 -0
- package/dependencies-local/extension-kit/widgets/panels/PanelSeparator.js +57 -0
- package/dependencies-local/extension-kit/widgets/panels/PanelSeparator.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/panels/index.d.ts +28 -0
- package/dependencies-local/extension-kit/widgets/panels/index.js +169 -0
- package/dependencies-local/extension-kit/widgets/panels/index.js.map +1 -0
- package/dist/common.d.ts +1 -0
- package/dist/common.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/initial.d.ts +3 -0
- package/dist/migrations/initial.js.map +1 -0
- package/dist/package.json +56 -0
- package/dist/types/cr.d.ts +216 -0
- package/dist/types/cr.js.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/item.d.ts +59 -0
- package/dist/types/item.js.map +1 -0
- package/dist/types/proposal.d.ts +64 -0
- package/dist/types/proposal.js.map +1 -0
- package/dist/types/register.d.ts +18 -0
- package/dist/types/register.js.map +1 -0
- package/dist/types/registry.d.ts +15 -0
- package/dist/types/registry.js.map +1 -0
- package/dist/types/stakeholder.d.ts +58 -0
- package/dist/types/stakeholder.js.map +1 -0
- package/dist/types/util.d.ts +21 -0
- package/dist/types/util.js +5 -0
- package/dist/types/util.js.map +1 -0
- package/dist/types/views.d.ts +157 -0
- package/dist/types/views.js +5 -0
- package/dist/types/views.js.map +1 -0
- package/dist/views/AnnotatedChange.d.ts +7 -0
- package/dist/views/AnnotatedChange.js.map +1 -0
- package/dist/views/BrowserCtx.d.ts +73 -0
- package/dist/views/BrowserCtx.js.map +1 -0
- package/dist/views/FilterCriteria/CRITERIA_CONFIGURATION.d.ts +17 -0
- package/dist/views/FilterCriteria/CRITERIA_CONFIGURATION.js.map +1 -0
- package/dist/views/FilterCriteria/criteriaGroupToQueryExpression.d.ts +6 -0
- package/dist/views/FilterCriteria/criteriaGroupToQueryExpression.js.map +1 -0
- package/dist/views/FilterCriteria/criteriaGroupToSummary.d.ts +5 -0
- package/dist/views/FilterCriteria/criteriaGroupToSummary.js.map +1 -0
- package/dist/views/FilterCriteria/criteriaToNodes.d.ts +24 -0
- package/dist/views/FilterCriteria/criteriaToNodes.js.map +1 -0
- package/dist/views/FilterCriteria/index.d.ts +23 -0
- package/dist/views/FilterCriteria/index.js.map +1 -0
- package/dist/views/FilterCriteria/models.d.ts +68 -0
- package/dist/views/FilterCriteria/models.js.map +1 -0
- package/dist/views/FilterCriteria/mutateGroup.d.ts +17 -0
- package/dist/views/FilterCriteria/mutateGroup.js.map +1 -0
- package/dist/views/GenericRelatedItemView.d.ts +6 -0
- package/dist/views/GenericRelatedItemView.js.map +1 -0
- package/dist/views/RegisterStakeholder.d.ts +9 -0
- package/dist/views/RegisterStakeholder.js.map +1 -0
- package/dist/views/RegisterVersion.d.ts +9 -0
- package/dist/views/RegisterVersion.js.map +1 -0
- package/dist/views/SearchQuery.d.ts +13 -0
- package/dist/views/SearchQuery.js.map +1 -0
- package/dist/views/change-request/ChangeRequestContext.d.ts +20 -0
- package/dist/views/change-request/ChangeRequestContext.js.map +1 -0
- package/dist/views/change-request/Proposals.d.ts +21 -0
- package/dist/views/change-request/Proposals.js.map +1 -0
- package/dist/views/change-request/objectChangeset.d.ts +31 -0
- package/dist/views/change-request/objectChangeset.js.map +1 -0
- package/dist/views/detail/ChangeRequest/Proposal.d.ts +0 -0
- package/dist/views/detail/ChangeRequest/Proposal.js.map +1 -0
- package/dist/views/detail/ChangeRequest/index.d.ts +13 -0
- package/dist/views/detail/ChangeRequest/index.js.map +1 -0
- package/dist/views/detail/ChangeRequest/transitions.d.ts +28 -0
- package/dist/views/detail/ChangeRequest/transitions.js.map +1 -0
- package/dist/views/detail/CustomView/index.d.ts +13 -0
- package/dist/views/detail/CustomView/index.js.map +1 -0
- package/dist/views/detail/RegisterHome/index.d.ts +5 -0
- package/dist/views/detail/RegisterHome/index.js.map +1 -0
- package/dist/views/detail/RegisterItem/RelatedItems.d.ts +14 -0
- package/{views → dist/views}/detail/RegisterItem/RelatedItems.js +5 -5
- package/dist/views/detail/RegisterItem/RelatedItems.js.map +1 -0
- package/dist/views/detail/RegisterItem/SupersedingItemMenu.js.map +1 -0
- package/dist/views/detail/RegisterItem/index.d.ts +13 -0
- package/{views → dist/views}/detail/RegisterItem/index.js +3 -2
- package/dist/views/detail/RegisterItem/index.js.map +1 -0
- package/dist/views/detail/RegisterMeta/RegisterMetaForm.d.ts +10 -0
- package/dist/views/detail/RegisterMeta/RegisterMetaForm.js.map +1 -0
- package/dist/views/detail/RegisterMeta/index.d.ts +10 -0
- package/dist/views/detail/RegisterMeta/index.js.map +1 -0
- package/dist/views/detail/index.d.ts +1 -0
- package/dist/views/detail/index.js.map +1 -0
- package/dist/views/diffing/InlineDiff.d.ts +12 -0
- package/dist/views/diffing/InlineDiff.js.map +1 -0
- package/dist/views/diffing/StructuredDiff.d.ts +11 -0
- package/dist/views/diffing/StructuredDiff.js.map +1 -0
- package/dist/views/hooks/useCustomView.d.ts +3 -0
- package/dist/views/hooks/useCustomView.js.map +1 -0
- package/dist/views/hooks/useItemClassConfig.d.ts +3 -0
- package/dist/views/hooks/useItemClassConfig.js.map +1 -0
- package/dist/views/hooks/useItemRef.d.ts +3 -0
- package/dist/views/hooks/useItemRef.js.map +1 -0
- package/dist/views/hooks/useSingleRegisterItemData.d.ts +3 -0
- package/dist/views/hooks/useSingleRegisterItemData.js.map +1 -0
- package/dist/views/index.d.ts +7 -0
- package/dist/views/index.js.map +1 -0
- package/dist/views/itemPathUtils.d.ts +52 -0
- package/dist/views/itemPathUtils.js.map +1 -0
- package/dist/views/itemQueryUtils.d.ts +11 -0
- package/dist/views/itemQueryUtils.js.map +1 -0
- package/dist/views/protocolRegistry.d.ts +12 -0
- package/dist/views/protocolRegistry.js.map +1 -0
- package/dist/views/sidebar/Browse/index.d.ts +11 -0
- package/dist/views/sidebar/Browse/index.js.map +1 -0
- package/dist/views/sidebar/Export/index.d.ts +5 -0
- package/dist/views/sidebar/Export/index.js.map +1 -0
- package/dist/views/sidebar/ListItem.d.ts +10 -0
- package/dist/views/sidebar/ListItem.js.map +1 -0
- package/dist/views/sidebar/Registration/index.d.ts +5 -0
- package/dist/views/sidebar/Registration/index.js.map +1 -0
- package/dist/views/sidebar/Search/index.d.ts +18 -0
- package/dist/views/sidebar/Search/index.js.map +1 -0
- package/dist/views/sidebar/index.d.ts +6 -0
- package/dist/views/sidebar/index.js.map +1 -0
- package/dist/views/util.d.ts +36 -0
- package/dist/views/util.js.map +1 -0
- package/package.json +2 -1
- package/react-visual-diff.d.ts +9 -0
- package/views/detail/RegisterItem/RelatedItems.js.map +0 -1
- package/views/detail/RegisterItem/index.js.map +0 -1
- /package/{common.d.ts → compiled/common.d.ts} +0 -0
- /package/{common.js.map → compiled/common.js.map} +0 -0
- /package/{index.d.ts → compiled/index.d.ts} +0 -0
- /package/{index.js.map → compiled/index.js.map} +0 -0
- /package/{migrations → compiled/migrations}/initial.d.ts +0 -0
- /package/{migrations → compiled/migrations}/initial.js.map +0 -0
- /package/{types → compiled/types}/cr.d.ts +0 -0
- /package/{types → compiled/types}/cr.js.map +0 -0
- /package/{types → compiled/types}/index.d.ts +0 -0
- /package/{types → compiled/types}/index.js.map +0 -0
- /package/{types → compiled/types}/item.d.ts +0 -0
- /package/{types → compiled/types}/item.js.map +0 -0
- /package/{types → compiled/types}/proposal.d.ts +0 -0
- /package/{types → compiled/types}/proposal.js.map +0 -0
- /package/{types → compiled/types}/register.d.ts +0 -0
- /package/{types → compiled/types}/register.js.map +0 -0
- /package/{types → compiled/types}/registry.d.ts +0 -0
- /package/{types → compiled/types}/registry.js.map +0 -0
- /package/{types → compiled/types}/stakeholder.d.ts +0 -0
- /package/{types → compiled/types}/stakeholder.js.map +0 -0
- /package/{types → compiled/types}/util.d.ts +0 -0
- /package/{types → compiled/types}/util.js.map +0 -0
- /package/{types → compiled/types}/views.d.ts +0 -0
- /package/{types → compiled/types}/views.js.map +0 -0
- /package/{views → compiled/views}/AnnotatedChange.d.ts +0 -0
- /package/{views → compiled/views}/AnnotatedChange.js.map +0 -0
- /package/{views → compiled/views}/BrowserCtx.d.ts +0 -0
- /package/{views → compiled/views}/BrowserCtx.js.map +0 -0
- /package/{views → compiled/views}/FilterCriteria/CRITERIA_CONFIGURATION.d.ts +0 -0
- /package/{views → compiled/views}/FilterCriteria/CRITERIA_CONFIGURATION.js.map +0 -0
- /package/{views → compiled/views}/FilterCriteria/criteriaGroupToQueryExpression.d.ts +0 -0
- /package/{views → compiled/views}/FilterCriteria/criteriaGroupToQueryExpression.js.map +0 -0
- /package/{views → compiled/views}/FilterCriteria/criteriaGroupToSummary.d.ts +0 -0
- /package/{views → compiled/views}/FilterCriteria/criteriaGroupToSummary.js.map +0 -0
- /package/{views → compiled/views}/FilterCriteria/criteriaToNodes.d.ts +0 -0
- /package/{views → compiled/views}/FilterCriteria/criteriaToNodes.js.map +0 -0
- /package/{views → compiled/views}/FilterCriteria/index.d.ts +0 -0
- /package/{views → compiled/views}/FilterCriteria/index.js.map +0 -0
- /package/{views → compiled/views}/FilterCriteria/models.d.ts +0 -0
- /package/{views → compiled/views}/FilterCriteria/models.js.map +0 -0
- /package/{views → compiled/views}/FilterCriteria/mutateGroup.d.ts +0 -0
- /package/{views → compiled/views}/FilterCriteria/mutateGroup.js.map +0 -0
- /package/{views → compiled/views}/GenericRelatedItemView.d.ts +0 -0
- /package/{views → compiled/views}/GenericRelatedItemView.js.map +0 -0
- /package/{views → compiled/views}/RegisterStakeholder.d.ts +0 -0
- /package/{views → compiled/views}/RegisterStakeholder.js.map +0 -0
- /package/{views → compiled/views}/RegisterVersion.d.ts +0 -0
- /package/{views → compiled/views}/RegisterVersion.js.map +0 -0
- /package/{views → compiled/views}/SearchQuery.d.ts +0 -0
- /package/{views → compiled/views}/SearchQuery.js.map +0 -0
- /package/{views → compiled/views}/change-request/ChangeRequestContext.d.ts +0 -0
- /package/{views → compiled/views}/change-request/ChangeRequestContext.js.map +0 -0
- /package/{views → compiled/views}/change-request/Proposals.d.ts +0 -0
- /package/{views → compiled/views}/change-request/Proposals.js.map +0 -0
- /package/{views → compiled/views}/change-request/objectChangeset.d.ts +0 -0
- /package/{views → compiled/views}/change-request/objectChangeset.js.map +0 -0
- /package/{views → compiled/views}/detail/ChangeRequest/Proposal.d.ts +0 -0
- /package/{views → compiled/views}/detail/ChangeRequest/Proposal.js.map +0 -0
- /package/{views → compiled/views}/detail/ChangeRequest/index.d.ts +0 -0
- /package/{views → compiled/views}/detail/ChangeRequest/index.js.map +0 -0
- /package/{views → compiled/views}/detail/ChangeRequest/transitions.d.ts +0 -0
- /package/{views → compiled/views}/detail/ChangeRequest/transitions.js.map +0 -0
- /package/{views → compiled/views}/detail/CustomView/index.d.ts +0 -0
- /package/{views → compiled/views}/detail/CustomView/index.js.map +0 -0
- /package/{views → compiled/views}/detail/RegisterHome/index.d.ts +0 -0
- /package/{views → compiled/views}/detail/RegisterHome/index.js.map +0 -0
- /package/{views → compiled/views}/detail/RegisterItem/SupersedingItemMenu.d.ts +0 -0
- /package/{views → compiled/views}/detail/RegisterItem/SupersedingItemMenu.js.map +0 -0
- /package/{views → compiled/views}/detail/RegisterItem/index.d.ts +0 -0
- /package/{views → compiled/views}/detail/RegisterMeta/RegisterMetaForm.d.ts +0 -0
- /package/{views → compiled/views}/detail/RegisterMeta/RegisterMetaForm.js.map +0 -0
- /package/{views → compiled/views}/detail/RegisterMeta/index.d.ts +0 -0
- /package/{views → compiled/views}/detail/RegisterMeta/index.js.map +0 -0
- /package/{views → compiled/views}/detail/index.d.ts +0 -0
- /package/{views → compiled/views}/detail/index.js.map +0 -0
- /package/{views → compiled/views}/diffing/InlineDiff.d.ts +0 -0
- /package/{views → compiled/views}/diffing/InlineDiff.js.map +0 -0
- /package/{views → compiled/views}/diffing/StructuredDiff.d.ts +0 -0
- /package/{views → compiled/views}/diffing/StructuredDiff.js.map +0 -0
- /package/{views → compiled/views}/hooks/useCustomView.d.ts +0 -0
- /package/{views → compiled/views}/hooks/useCustomView.js.map +0 -0
- /package/{views → compiled/views}/hooks/useItemClassConfig.d.ts +0 -0
- /package/{views → compiled/views}/hooks/useItemClassConfig.js.map +0 -0
- /package/{views → compiled/views}/hooks/useItemRef.d.ts +0 -0
- /package/{views → compiled/views}/hooks/useItemRef.js.map +0 -0
- /package/{views → compiled/views}/hooks/useSingleRegisterItemData.d.ts +0 -0
- /package/{views → compiled/views}/hooks/useSingleRegisterItemData.js.map +0 -0
- /package/{views → compiled/views}/index.d.ts +0 -0
- /package/{views → compiled/views}/index.js.map +0 -0
- /package/{views → compiled/views}/itemPathUtils.d.ts +0 -0
- /package/{views → compiled/views}/itemPathUtils.js.map +0 -0
- /package/{views → compiled/views}/itemQueryUtils.d.ts +0 -0
- /package/{views → compiled/views}/itemQueryUtils.js.map +0 -0
- /package/{views → compiled/views}/protocolRegistry.d.ts +0 -0
- /package/{views → compiled/views}/protocolRegistry.js.map +0 -0
- /package/{views → compiled/views}/sidebar/Browse/index.d.ts +0 -0
- /package/{views → compiled/views}/sidebar/Browse/index.js.map +0 -0
- /package/{views → compiled/views}/sidebar/Export/index.d.ts +0 -0
- /package/{views → compiled/views}/sidebar/Export/index.js.map +0 -0
- /package/{views → compiled/views}/sidebar/ListItem.d.ts +0 -0
- /package/{views → compiled/views}/sidebar/ListItem.js.map +0 -0
- /package/{views → compiled/views}/sidebar/Registration/index.d.ts +0 -0
- /package/{views → compiled/views}/sidebar/Registration/index.js.map +0 -0
- /package/{views → compiled/views}/sidebar/Search/index.d.ts +0 -0
- /package/{views → compiled/views}/sidebar/Search/index.js.map +0 -0
- /package/{views → compiled/views}/sidebar/index.d.ts +0 -0
- /package/{views → compiled/views}/sidebar/index.js.map +0 -0
- /package/{views → compiled/views}/util.d.ts +0 -0
- /package/{views → compiled/views}/util.js.map +0 -0
- /package/{types/util.js → dependencies-local/extension-kit/i18n/types.js} +0 -0
- /package/{types/views.js → dependencies-local/extension-kit/types/binary-invocation.js} +0 -0
- /package/{common.js → dist/common.js} +0 -0
- /package/{index.js → dist/index.js} +0 -0
- /package/{migrations → dist/migrations}/initial.js +0 -0
- /package/{types → dist/types}/cr.js +0 -0
- /package/{types → dist/types}/index.js +0 -0
- /package/{types → dist/types}/item.js +0 -0
- /package/{types → dist/types}/proposal.js +0 -0
- /package/{types → dist/types}/register.js +0 -0
- /package/{types → dist/types}/registry.js +0 -0
- /package/{types → dist/types}/stakeholder.js +0 -0
- /package/{views → dist/views}/AnnotatedChange.js +0 -0
- /package/{views → dist/views}/BrowserCtx.js +0 -0
- /package/{views → dist/views}/FilterCriteria/CRITERIA_CONFIGURATION.js +0 -0
- /package/{views → dist/views}/FilterCriteria/criteriaGroupToQueryExpression.js +0 -0
- /package/{views → dist/views}/FilterCriteria/criteriaGroupToSummary.js +0 -0
- /package/{views → dist/views}/FilterCriteria/criteriaToNodes.js +0 -0
- /package/{views → dist/views}/FilterCriteria/index.js +0 -0
- /package/{views → dist/views}/FilterCriteria/models.js +0 -0
- /package/{views → dist/views}/FilterCriteria/mutateGroup.js +0 -0
- /package/{views → dist/views}/GenericRelatedItemView.js +0 -0
- /package/{views → dist/views}/RegisterStakeholder.js +0 -0
- /package/{views → dist/views}/RegisterVersion.js +0 -0
- /package/{views → dist/views}/SearchQuery.js +0 -0
- /package/{views → dist/views}/change-request/ChangeRequestContext.js +0 -0
- /package/{views → dist/views}/change-request/Proposals.js +0 -0
- /package/{views → dist/views}/change-request/objectChangeset.js +0 -0
- /package/{views → dist/views}/detail/ChangeRequest/Proposal.js +0 -0
- /package/{views → dist/views}/detail/ChangeRequest/index.js +0 -0
- /package/{views → dist/views}/detail/ChangeRequest/transitions.js +0 -0
- /package/{views → dist/views}/detail/CustomView/index.js +0 -0
- /package/{views → dist/views}/detail/RegisterHome/index.js +0 -0
- /package/{views/detail/RegisterItem/RelatedItems.d.ts → dist/views/detail/RegisterItem/SupersedingItemMenu.d.ts} +0 -0
- /package/{views → dist/views}/detail/RegisterItem/SupersedingItemMenu.js +0 -0
- /package/{views → dist/views}/detail/RegisterMeta/RegisterMetaForm.js +0 -0
- /package/{views → dist/views}/detail/RegisterMeta/index.js +0 -0
- /package/{views → dist/views}/detail/index.js +0 -0
- /package/{views → dist/views}/diffing/InlineDiff.js +0 -0
- /package/{views → dist/views}/diffing/StructuredDiff.js +0 -0
- /package/{views → dist/views}/hooks/useCustomView.js +0 -0
- /package/{views → dist/views}/hooks/useItemClassConfig.js +0 -0
- /package/{views → dist/views}/hooks/useItemRef.js +0 -0
- /package/{views → dist/views}/hooks/useSingleRegisterItemData.js +0 -0
- /package/{views → dist/views}/index.js +0 -0
- /package/{views → dist/views}/itemPathUtils.js +0 -0
- /package/{views → dist/views}/itemQueryUtils.js +0 -0
- /package/{views → dist/views}/protocolRegistry.js +0 -0
- /package/{views → dist/views}/sidebar/Browse/index.js +0 -0
- /package/{views → dist/views}/sidebar/Export/index.js +0 -0
- /package/{views → dist/views}/sidebar/ListItem.js +0 -0
- /package/{views → dist/views}/sidebar/Registration/index.js +0 -0
- /package/{views → dist/views}/sidebar/Search/index.js +0 -0
- /package/{views → dist/views}/sidebar/index.js +0 -0
- /package/{views → dist/views}/util.js +0 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = makeSearchResultList;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _react2 = require("@emotion/react");
|
|
11
|
+
|
|
12
|
+
var _core = require("@blueprintjs/core");
|
|
13
|
+
|
|
14
|
+
var _List = _interopRequireWildcard(require("./List"));
|
|
15
|
+
|
|
16
|
+
var _context = require("../context");
|
|
17
|
+
|
|
18
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
|
|
22
|
+
/** @jsx jsx */
|
|
23
|
+
|
|
24
|
+
/** @jsxFrag React.Fragment */
|
|
25
|
+
function makeSearchResultList(InnerItemView, getEntityInfoForObjectPath) {
|
|
26
|
+
const IndexedListItem = function ({
|
|
27
|
+
onSelect,
|
|
28
|
+
onOpen,
|
|
29
|
+
extraData,
|
|
30
|
+
itemRef: listItemRef
|
|
31
|
+
}) {
|
|
32
|
+
const {
|
|
33
|
+
useObjectPathFromFilteredIndex,
|
|
34
|
+
useObjectData
|
|
35
|
+
} = (0, _react.useContext)(_context.DatasetContext);
|
|
36
|
+
let position;
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
position = parseInt(listItemRef, 10);
|
|
40
|
+
} catch (e) {
|
|
41
|
+
position = 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const filteredObjectResp = useObjectPathFromFilteredIndex({
|
|
45
|
+
indexID: extraData.indexID,
|
|
46
|
+
position
|
|
47
|
+
});
|
|
48
|
+
const objPath = filteredObjectResp.value.objectPath;
|
|
49
|
+
const stringItemDescription = objPath ? `item at ${objPath}` : `item #${listItemRef}`;
|
|
50
|
+
const fallbackView = (0, _react2.jsx)("span", {
|
|
51
|
+
css: (0, _react2.css)`opacity: .4`
|
|
52
|
+
}, stringItemDescription);
|
|
53
|
+
const objectDataResp = useObjectData({
|
|
54
|
+
objectPaths: objPath ? [objPath] : []
|
|
55
|
+
});
|
|
56
|
+
let isUpdating = filteredObjectResp.isUpdating;
|
|
57
|
+
let itemView;
|
|
58
|
+
|
|
59
|
+
if (objPath.trim() !== '') {
|
|
60
|
+
try {
|
|
61
|
+
const objData = objectDataResp.value.data[objPath];
|
|
62
|
+
isUpdating = isUpdating || objectDataResp.isUpdating;
|
|
63
|
+
|
|
64
|
+
if (objData) {
|
|
65
|
+
itemView = (0, _react2.jsx)(InnerItemView, {
|
|
66
|
+
objectData: objData,
|
|
67
|
+
objectPath: objPath
|
|
68
|
+
});
|
|
69
|
+
} else {
|
|
70
|
+
itemView = fallbackView;
|
|
71
|
+
}
|
|
72
|
+
} catch (e) {
|
|
73
|
+
itemView = fallbackView;
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
itemView = fallbackView;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return (0, _react2.jsx)(_List.LabelledListIcon, {
|
|
80
|
+
isSelected: objPath !== '' && extraData.selectedItemPath === objPath,
|
|
81
|
+
onSelect: onSelect,
|
|
82
|
+
onOpen: onOpen,
|
|
83
|
+
contentClassName: isUpdating ? _core.Classes.SKELETON : undefined,
|
|
84
|
+
entityType: getEntityInfoForObjectPath(objPath)
|
|
85
|
+
}, itemView);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const List = (0, _List.default)(IndexedListItem);
|
|
89
|
+
|
|
90
|
+
const SearchResultList = function ({
|
|
91
|
+
queryExpression,
|
|
92
|
+
selectedItemPath,
|
|
93
|
+
onSelectItem,
|
|
94
|
+
onOpenItem,
|
|
95
|
+
keyExpression,
|
|
96
|
+
className
|
|
97
|
+
}) {
|
|
98
|
+
var _a;
|
|
99
|
+
|
|
100
|
+
const {
|
|
101
|
+
useFilteredIndex,
|
|
102
|
+
useIndexDescription,
|
|
103
|
+
getFilteredIndexPosition,
|
|
104
|
+
getObjectPathFromFilteredIndex
|
|
105
|
+
} = (0, _react.useContext)(_context.DatasetContext);
|
|
106
|
+
const [selectedIndexPos, selectIndexPos] = (0, _react.useState)(null);
|
|
107
|
+
const indexReq = useFilteredIndex({
|
|
108
|
+
queryExpression,
|
|
109
|
+
keyExpression: keyExpression ? `return ${keyExpression}` : undefined
|
|
110
|
+
});
|
|
111
|
+
const indexID = (_a = indexReq.value.indexID) !== null && _a !== void 0 ? _a : '';
|
|
112
|
+
const indexDescReq = useIndexDescription({
|
|
113
|
+
indexID
|
|
114
|
+
});
|
|
115
|
+
const itemCount = indexDescReq.value.status.objectCount; //const indexProgress = indexDescReq.value.status.progress;
|
|
116
|
+
|
|
117
|
+
(0, _react.useEffect)(() => {
|
|
118
|
+
if (selectedItemPath !== null && indexID !== '') {
|
|
119
|
+
getFilteredIndexPosition({
|
|
120
|
+
indexID,
|
|
121
|
+
objectPath: selectedItemPath
|
|
122
|
+
}).then(({
|
|
123
|
+
position
|
|
124
|
+
}) => {
|
|
125
|
+
if (selectedIndexPos !== position && position !== null) {
|
|
126
|
+
selectIndexPos(`${position}`);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}, [selectedItemPath, indexID]);
|
|
131
|
+
|
|
132
|
+
function selectItemByPosition(pos) {
|
|
133
|
+
try {
|
|
134
|
+
const position = parseInt(pos, 10);
|
|
135
|
+
getObjectPathFromFilteredIndex({
|
|
136
|
+
indexID,
|
|
137
|
+
position
|
|
138
|
+
}).then(({
|
|
139
|
+
objectPath
|
|
140
|
+
}) => {
|
|
141
|
+
if (objectPath !== selectedItemPath) {
|
|
142
|
+
onSelectItem(objectPath);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
} catch (e) {
|
|
146
|
+
console.error("Unable to select item by position");
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const extraData = {
|
|
151
|
+
indexID,
|
|
152
|
+
selectedItemPath
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
function getListData() {
|
|
156
|
+
if (indexID) {
|
|
157
|
+
const stubs = [...new Array(itemCount)].map((_, idx) => `${idx}`);
|
|
158
|
+
return {
|
|
159
|
+
items: stubs,
|
|
160
|
+
selectedItem: selectedIndexPos,
|
|
161
|
+
selectItem: pos => {
|
|
162
|
+
selectIndexPos(pos);
|
|
163
|
+
|
|
164
|
+
if (pos) {
|
|
165
|
+
selectItemByPosition(pos);
|
|
166
|
+
} else {
|
|
167
|
+
onSelectItem(null);
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
openItem: onOpenItem ? async pos => {
|
|
171
|
+
try {
|
|
172
|
+
const position = parseInt(pos, 10);
|
|
173
|
+
const itemPath = (await getObjectPathFromFilteredIndex({
|
|
174
|
+
indexID,
|
|
175
|
+
position
|
|
176
|
+
})).objectPath;
|
|
177
|
+
|
|
178
|
+
if (itemPath) {
|
|
179
|
+
onOpenItem(itemPath);
|
|
180
|
+
}
|
|
181
|
+
} catch (e) {
|
|
182
|
+
console.error("Unable to open item");
|
|
183
|
+
}
|
|
184
|
+
} : undefined,
|
|
185
|
+
itemHeight: 24,
|
|
186
|
+
padding: 0,
|
|
187
|
+
extraData
|
|
188
|
+
};
|
|
189
|
+
} else {
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return (0, _react2.jsx)(List, {
|
|
195
|
+
className: className,
|
|
196
|
+
getListData: getListData
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
return SearchResultList;
|
|
201
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchResultList.js","sourceRoot":"","sources":["../../src/widgets/SearchResultList.tsx"],"names":[],"mappings":"AAAA,eAAe;AACf,8BAA8B;AAE9B,OAAc,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAa,MAAM,mBAAmB,CAAC;AAEvD,OAAO,QAAQ,EAAE,EAAa,gBAAgB,EAAY,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAkB5C,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAE1C,aAAuE,EACvE,0BAAuF;IAIvF,MAAM,eAAe,GACrB,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE;QAC7D,MAAM,E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I,GAAG,EAAE;4BACP,oBAAoB,CAAC,GAAG,CAAC,CAAC;yBAC3B;6BAAM;4BACL,YAAY,CAAC,IAAI,CAAC,CAAC;yBACpB;oBACH,CAAC;oBACD,QAAQ,EAAE,UAAU;wBAClB,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;4BACZ,IAAI;gCACF,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gCACnC,MAAM,QAAQ,GAAG,CAAC,MAAM,8BAA8B,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;gCAC1F,IAAI,QAAQ,EAAE;oCACZ,UAAU,CAAC,QAAQ,CAAC,CAAC;iCACtB;6BACF;4BAAC,OAAO,CAAC,EAAE;gCACV,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;6BACtC;wBACH,CAAC;wBACH,CAAC,CAAC,SAAS;oBACb,UAAU,EAAE,EAAE;oBACd,OAAO,EAAE,CAAC;oBACV,SAAS;iBACV,CAAC;aACH;iBAAM;gBACL,OAAO,IAAI,CAAC;aACb;QACH,CAAC;QAED,OAAO,IAAC,IAAI,IACV,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,GAAI,CAAC;IACjC,CAAC,CAAC;IAEF,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["/** @jsx jsx */\n/** @jsxFrag React.Fragment */\n\nimport React, { useContext, useEffect, useState } from 'react';\nimport { jsx, css } from '@emotion/react';\nimport { Classes, IconProps } from '@blueprintjs/core';\n\nimport makeList, { ItemProps, LabelledListIcon, ListData } from './List';\nimport { DatasetContext } from '../context';\n\n\nexport interface SearchResultListData {\n indexID: string;\n selectedItemPath: string | null;\n}\n\ninterface SearchResultListProps {\n queryExpression: string;\n selectedItemPath: string | null;\n onSelectItem: (itemPath: string | null) => void;\n onOpenItem?: (itemPath: string) => void;\n keyExpression?: string;\n className?: string;\n}\n\n\nexport default function makeSearchResultList\n<ObjectData extends Record<string, any>>(\n InnerItemView: React.FC<{ objectData: ObjectData, objectPath: string }>,\n getEntityInfoForObjectPath: (objPath: string) => { name: string, iconProps: IconProps },\n):\nReact.FC<SearchResultListProps> {\n\n const IndexedListItem: React.FC<ItemProps<SearchResultListData>> =\n function ({ onSelect, onOpen, extraData, itemRef: listItemRef }) {\n const { useObjectPathFromFilteredIndex, useObjectData } = useContext(DatasetContext);\n\n let position: number;\n try {\n position = parseInt(listItemRef, 10);\n } catch (e) {\n position = 0;\n }\n const filteredObjectResp = useObjectPathFromFilteredIndex({\n indexID: extraData.indexID,\n position,\n });\n const objPath = filteredObjectResp.value.objectPath;\n\n const stringItemDescription = objPath ? `item at ${objPath}` : `item #${listItemRef}`;\n\n const fallbackView = <span css={css`opacity: .4`}>{stringItemDescription}</span>;\n\n const objectDataResp = useObjectData({\n objectPaths: objPath ? [objPath] : [],\n });\n\n let isUpdating: boolean = filteredObjectResp.isUpdating;\n let itemView: JSX.Element;\n\n if (objPath.trim() !== '') {\n try {\n const objData = objectDataResp.value.data[objPath] as ObjectData | null;\n isUpdating = isUpdating || objectDataResp.isUpdating;\n if (objData) {\n itemView = <InnerItemView objectData={objData} objectPath={objPath} />\n } else {\n itemView = fallbackView;\n }\n } catch (e) {\n itemView = fallbackView;\n }\n } else {\n itemView = fallbackView;\n }\n\n\n return (\n <LabelledListIcon\n isSelected={objPath !== '' && extraData.selectedItemPath === objPath}\n onSelect={onSelect}\n onOpen={onOpen}\n contentClassName={isUpdating ? Classes.SKELETON : undefined}\n entityType={getEntityInfoForObjectPath(objPath)}>\n {itemView}\n </LabelledListIcon>\n );\n };\n\n const List = makeList<SearchResultListData>(IndexedListItem);\n\n const SearchResultList: React.FC<SearchResultListProps> =\n function ({ queryExpression, selectedItemPath, onSelectItem, onOpenItem, keyExpression, className }) {\n const {\n useFilteredIndex, useIndexDescription, getFilteredIndexPosition, getObjectPathFromFilteredIndex,\n } = useContext(DatasetContext);\n\n const [selectedIndexPos, selectIndexPos] = useState<string | null>(null);\n\n const indexReq = useFilteredIndex({\n queryExpression,\n keyExpression: keyExpression\n ? `return ${keyExpression}`\n : undefined,\n });\n const indexID: string = indexReq.value.indexID ?? '';\n\n const indexDescReq = useIndexDescription({ indexID });\n const itemCount = indexDescReq.value.status.objectCount;\n //const indexProgress = indexDescReq.value.status.progress;\n useEffect(() => {\n if (selectedItemPath !== null && indexID !== '') {\n getFilteredIndexPosition({ indexID, objectPath: selectedItemPath }).\n then(({ position }) => {\n if (selectedIndexPos !== position && position !== null) {\n selectIndexPos(`${position}`);\n }\n });\n }\n }, [selectedItemPath, indexID]);\n\n function selectItemByPosition(pos: string) {\n try {\n const position = parseInt(pos, 10);\n getObjectPathFromFilteredIndex({ indexID, position }).then(({ objectPath }) => {\n if (objectPath !== selectedItemPath) {\n onSelectItem(objectPath);\n }\n });\n } catch (e) {\n console.error(\"Unable to select item by position\");\n }\n }\n\n const extraData: SearchResultListData = {\n indexID,\n selectedItemPath,\n };\n\n function getListData(): ListData<SearchResultListData> | null {\n if (indexID) {\n const stubs: string[] = [...new Array(itemCount)].map((_, idx) => `${idx}`);\n return {\n items: stubs,\n selectedItem: selectedIndexPos,\n selectItem: (pos) => {\n selectIndexPos(pos);\n if (pos) {\n selectItemByPosition(pos);\n } else {\n onSelectItem(null);\n }\n },\n openItem: onOpenItem\n ? async (pos) => {\n try {\n const position = parseInt(pos, 10);\n const itemPath = (await getObjectPathFromFilteredIndex({ indexID, position })).objectPath;\n if (itemPath) {\n onOpenItem(itemPath);\n }\n } catch (e) {\n console.error(\"Unable to open item\");\n }\n }\n : undefined,\n itemHeight: 24,\n padding: 0,\n extraData,\n };\n } else {\n return null;\n }\n }\n\n return <List\n className={className}\n getListData={getListData} />;\n };\n\n return SearchResultList;\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
/** @jsxFrag React.Fragment */
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export interface SidebarBlockConfig {
|
|
5
|
+
key: string;
|
|
6
|
+
title: string | JSX.Element;
|
|
7
|
+
content: JSX.Element;
|
|
8
|
+
nonCollapsible?: boolean;
|
|
9
|
+
collapsedByDefault?: boolean;
|
|
10
|
+
height?: number;
|
|
11
|
+
}
|
|
12
|
+
interface SidebarBlockProps {
|
|
13
|
+
block: SidebarBlockConfig;
|
|
14
|
+
onExpand?: () => void;
|
|
15
|
+
onCollapse?: () => void;
|
|
16
|
+
onCollapseOthers?: () => void;
|
|
17
|
+
expanded?: boolean;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
declare const SidebarBlock: React.FC<SidebarBlockProps>;
|
|
21
|
+
export default SidebarBlock;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _core = require("@blueprintjs/core");
|
|
9
|
+
|
|
10
|
+
var _react = require("@emotion/react");
|
|
11
|
+
|
|
12
|
+
var _BlockStateButtonGroup = _interopRequireDefault(require("./BlockStateButtonGroup"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
/** @jsx jsx */
|
|
17
|
+
|
|
18
|
+
/** @jsxFrag React.Fragment */
|
|
19
|
+
const SidebarBlock = function ({
|
|
20
|
+
expanded,
|
|
21
|
+
onExpand,
|
|
22
|
+
onCollapse,
|
|
23
|
+
onCollapseOthers,
|
|
24
|
+
block,
|
|
25
|
+
className
|
|
26
|
+
}) {
|
|
27
|
+
return (0, _react.jsx)("div", {
|
|
28
|
+
css: (0, _react.css)`
|
|
29
|
+
display: flex; flex-flow: column nowrap; background: ${_core.Colors.LIGHT_GRAY2};
|
|
30
|
+
`,
|
|
31
|
+
className: `${block.nonCollapsible !== true ? _core.Classes.ELEVATION_1 : undefined} ${className !== null && className !== void 0 ? className : ''}`
|
|
32
|
+
}, (0, _react.jsx)("div", {
|
|
33
|
+
onClick: () => {
|
|
34
|
+
expanded ? onCollapse === null || onCollapse === void 0 ? void 0 : onCollapse() : onExpand === null || onExpand === void 0 ? void 0 : onExpand();
|
|
35
|
+
},
|
|
36
|
+
css: (0, _react.css)`
|
|
37
|
+
height: 24px; overflow: hidden; background: linear-gradient(to top, ${_core.Colors.LIGHT_GRAY2}, ${_core.Colors.LIGHT_GRAY3});
|
|
38
|
+
display: flex; flex-flow: row nowrap; align-items: center;
|
|
39
|
+
font-variation-settings: 'GRAD' 600, 'opsz' 20;
|
|
40
|
+
color: ${_core.Colors.GRAY2};
|
|
41
|
+
text-shadow: 1px 1px 1px ${_core.Colors.LIGHT_GRAY5};
|
|
42
|
+
`
|
|
43
|
+
}, (0, _react.jsx)("div", {
|
|
44
|
+
css: (0, _react.css)`
|
|
45
|
+
flex: 1;
|
|
46
|
+
font-size: 90%;
|
|
47
|
+
padding: 5px 10px;
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
text-overflow: ellipsis;
|
|
51
|
+
`
|
|
52
|
+
}, block.title), onCollapse || onExpand || onCollapseOthers ? (0, _react.jsx)(_BlockStateButtonGroup.default, null, onCollapseOthers ? (0, _react.jsx)(_core.Button, {
|
|
53
|
+
minimal: true,
|
|
54
|
+
small: true,
|
|
55
|
+
icon: 'vertical-distribution',
|
|
56
|
+
title: "Collapse other blocks",
|
|
57
|
+
onClick: evt => {
|
|
58
|
+
evt.stopPropagation();
|
|
59
|
+
onCollapseOthers();
|
|
60
|
+
}
|
|
61
|
+
}) : null, onCollapse ? (0, _react.jsx)(_core.Button, {
|
|
62
|
+
minimal: true,
|
|
63
|
+
small: true,
|
|
64
|
+
icon: 'collapse-all',
|
|
65
|
+
title: "Collapse this block",
|
|
66
|
+
onClick: evt => {
|
|
67
|
+
evt.stopPropagation();
|
|
68
|
+
onCollapse();
|
|
69
|
+
}
|
|
70
|
+
}) : null, onExpand ? (0, _react.jsx)(_core.Button, {
|
|
71
|
+
minimal: true,
|
|
72
|
+
small: true,
|
|
73
|
+
icon: 'expand-all',
|
|
74
|
+
title: "Expand this block",
|
|
75
|
+
onClick: evt => {
|
|
76
|
+
evt.stopPropagation();
|
|
77
|
+
onExpand();
|
|
78
|
+
}
|
|
79
|
+
}) : null) : null), expanded ? (0, _react.jsx)("div", {
|
|
80
|
+
css: (0, _react.css)`
|
|
81
|
+
overflow-x: hidden; overflow-y: auto;
|
|
82
|
+
padding: 5px;
|
|
83
|
+
position: relative;
|
|
84
|
+
${block.height ? `height: ${block.height}px;` : ''}
|
|
85
|
+
background: ${_core.Colors.LIGHT_GRAY4};
|
|
86
|
+
flex: 1 1 auto;
|
|
87
|
+
line-height: 1.4;
|
|
88
|
+
font-size: 90%;
|
|
89
|
+
`
|
|
90
|
+
}, block.content) : null);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
var _default = SidebarBlock;
|
|
94
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Block.js","sourceRoot":"","sources":["../../../src/widgets/Sidebar/Block.tsx"],"names":[],"mappings":"AAAA,eAAe;AACf,8BAA8B;AAE9B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAwB5D,MAAM,YAAY,GAClB,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,EAAE;IAC9E,OAAO,CACL,aAAK,GAAG,EAAE,GAAG,CAAA;iEACgD,MAAM,CAAC,WAAW;SAC1E,EACD,SAAS,EAAE,GAAG,KAAK,CAAC,cAAc,KAAK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,EACzB,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,GAAG,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAA,CAAC,CAAC,GAAI;wBAC7D,CAAC,CAAC,IAAI,CACY;gBAC1B,CAAC,CAAC,IAAI,CACJ;QACL,QAAQ;YACP,CAAC,CAAC,aAAK,GAAG,EAAE,GAAG,CAAA;;;;kBAIL,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,EAAG;8BACrC,MAAM,CAAC,WAAW;;;;eAIjC,IACF,KAAK,CAAC,OAAO,CACV;YACR,CAAC,CAAC,IAAI,CACJ,CACP,CAAC;AACJ,CAAC,CAAA;AAGD,eAAe,YAAY,CAAC","sourcesContent":["/** @jsx jsx */\n/** @jsxFrag React.Fragment */\n\nimport { Button, Classes, Colors } from '@blueprintjs/core';\nimport { jsx, css } from '@emotion/react';\nimport BlockStateButtonGroup from './BlockStateButtonGroup';\nimport React from 'react';\n\n\nexport interface SidebarBlockConfig {\n key: string\n title: string | JSX.Element\n content: JSX.Element\n nonCollapsible?: boolean\n collapsedByDefault?: boolean\n height?: number // Height in pixels.\n}\n\n\ninterface SidebarBlockProps {\n block: SidebarBlockConfig\n onExpand?: () => void\n onCollapse?: () => void\n onCollapseOthers?: () => void\n expanded?: boolean\n className?: string\n}\n\n\nconst SidebarBlock: React.FC<SidebarBlockProps> =\nfunction ({ expanded, onExpand, onCollapse, onCollapseOthers, block, className }) {\n return (\n <div css={css`\n display: flex; flex-flow: column nowrap; background: ${Colors.LIGHT_GRAY2};\n `}\n className={`${block.nonCollapsible !== true ? Classes.ELEVATION_1 : undefined} ${className ?? ''}`}>\n <div\n onClick={() => { expanded ? onCollapse?.() : onExpand?.() }}\n css={css`\n height: 24px; overflow: hidden; background: linear-gradient(to top, ${Colors.LIGHT_GRAY2}, ${Colors.LIGHT_GRAY3});\n display: flex; flex-flow: row nowrap; align-items: center;\n font-variation-settings: 'GRAD' 600, 'opsz' 20;\n color: ${Colors.GRAY2};\n text-shadow: 1px 1px 1px ${Colors.LIGHT_GRAY5};\n `}>\n <div\n css={css`\n flex: 1;\n font-size: 90%;\n padding: 5px 10px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n `}>\n {block.title}\n </div>\n {onCollapse || onExpand || onCollapseOthers\n ? <BlockStateButtonGroup>\n {onCollapseOthers\n ? <Button\n minimal\n small\n icon='vertical-distribution'\n title=\"Collapse other blocks\"\n onClick={(evt) => { evt.stopPropagation(); onCollapseOthers() }} />\n : null}\n {onCollapse\n ? <Button\n minimal\n small\n icon='collapse-all'\n title=\"Collapse this block\"\n onClick={(evt) => { evt.stopPropagation(); onCollapse() }} />\n : null}\n {onExpand\n ? <Button\n minimal\n small\n icon='expand-all'\n title=\"Expand this block\"\n onClick={(evt) => { evt.stopPropagation(); onExpand() }} />\n : null}\n </BlockStateButtonGroup>\n : null}\n </div>\n {expanded\n ? <div css={css`\n overflow-x: hidden; overflow-y: auto;\n padding: 5px;\n position: relative;\n ${block.height ? `height: ${block.height}px;` : '' }\n background: ${Colors.LIGHT_GRAY4};\n flex: 1 1 auto;\n line-height: 1.4;\n font-size: 90%;\n `}>\n {block.content}\n </div>\n : null}\n </div>\n );\n}\n\n\nexport default SidebarBlock;\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _core = require("@blueprintjs/core");
|
|
11
|
+
|
|
12
|
+
/** @jsx jsx */
|
|
13
|
+
|
|
14
|
+
/** @jsxFrag React.Fragment */
|
|
15
|
+
const BlockStateButtonGroup = function (props) {
|
|
16
|
+
return (0, _react.jsx)(_core.ButtonGroup, Object.assign({
|
|
17
|
+
css: (0, _react.css)`opacity: 0.5; transform: scale(0.8) translateX(-2px); transform-origin: right;`
|
|
18
|
+
}, props));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
var _default = BlockStateButtonGroup;
|
|
22
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockStateButtonGroup.js","sourceRoot":"","sources":["../../../src/widgets/Sidebar/BlockStateButtonGroup.tsx"],"names":[],"mappings":"AAAA,eAAe;AACf,8BAA8B;AAG9B,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAoB,MAAM,mBAAmB,CAAC;AAGlE,MAAM,qBAAqB,GAA+B,UAAU,KAAK;IACvE,OAAO,IAAC,WAAW,kBACjB,GAAG,EAAE,GAAG,CAAA,gFAAgF,IACpF,KAAK,EACT,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["/** @jsx jsx */\n/** @jsxFrag React.Fragment */\n\nimport React from 'react';\nimport { jsx, css } from '@emotion/react';\nimport { ButtonGroup, ButtonGroupProps } from '@blueprintjs/core';\n\n\nconst BlockStateButtonGroup: React.FC<ButtonGroupProps> = function (props) {\n return <ButtonGroup\n css={css`opacity: 0.5; transform: scale(0.8) translateX(-2px); transform-origin: right;`}\n {...props}\n />;\n};\n\nexport default BlockStateButtonGroup;\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
/** @jsxFrag React.Fragment */
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { InputGroupProps2, HTMLSelectProps, Intent } from '@blueprintjs/core';
|
|
5
|
+
interface PropertyViewProps {
|
|
6
|
+
label: JSX.Element | string;
|
|
7
|
+
title?: string;
|
|
8
|
+
tooltip?: JSX.Element | string;
|
|
9
|
+
tooltipIntent?: Intent;
|
|
10
|
+
tooltipClassName?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const PropertyView: React.FC<PropertyViewProps>;
|
|
14
|
+
interface TextInputProps {
|
|
15
|
+
value: string;
|
|
16
|
+
onChange?: (newValue: string) => void;
|
|
17
|
+
onConfirm?: () => void;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
inputGroupProps?: InputGroupProps2;
|
|
20
|
+
validationErrors?: string[];
|
|
21
|
+
className?: string;
|
|
22
|
+
style?: React.CSSProperties;
|
|
23
|
+
}
|
|
24
|
+
export declare const TextInput: React.FC<TextInputProps>;
|
|
25
|
+
interface SelectProps extends HTMLSelectProps {
|
|
26
|
+
}
|
|
27
|
+
export declare const Select: React.FC<SelectProps>;
|
|
28
|
+
export default PropertyView;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Select = exports.TextInput = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _core = require("@blueprintjs/core");
|
|
11
|
+
|
|
12
|
+
var _popover = require("@blueprintjs/popover2");
|
|
13
|
+
|
|
14
|
+
var _HelpTooltip = _interopRequireDefault(require("../HelpTooltip"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
/** @jsx jsx */
|
|
19
|
+
|
|
20
|
+
/** @jsxFrag React.Fragment */
|
|
21
|
+
const PropertyView = function ({
|
|
22
|
+
label,
|
|
23
|
+
title,
|
|
24
|
+
tooltip,
|
|
25
|
+
tooltipIntent,
|
|
26
|
+
tooltipClassName,
|
|
27
|
+
className,
|
|
28
|
+
children
|
|
29
|
+
}) {
|
|
30
|
+
return (0, _react.jsx)("div", {
|
|
31
|
+
className: className,
|
|
32
|
+
title: title,
|
|
33
|
+
css: (0, _react.css)`
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-flow: row nowrap;
|
|
36
|
+
align-items: flex-start;
|
|
37
|
+
font-size: 12px;
|
|
38
|
+
margin-bottom: 5px;
|
|
39
|
+
`
|
|
40
|
+
}, (0, _react.jsx)("div", {
|
|
41
|
+
css: (0, _react.css)`
|
|
42
|
+
width: 40%;
|
|
43
|
+
padding-right: 10px;
|
|
44
|
+
text-align: right;
|
|
45
|
+
padding-top: 2px;
|
|
46
|
+
padding-bottom: 2px;
|
|
47
|
+
color: ${_core.Colors.GRAY1};
|
|
48
|
+
`
|
|
49
|
+
}, tooltip ? (0, _react.jsx)(_HelpTooltip.default, {
|
|
50
|
+
content: tooltip,
|
|
51
|
+
intent: tooltipIntent,
|
|
52
|
+
tooltipProps: {
|
|
53
|
+
className: tooltipClassName
|
|
54
|
+
}
|
|
55
|
+
}) : null, " ", label), (0, _react.jsx)("div", {
|
|
56
|
+
css: (0, _react.css)`
|
|
57
|
+
width: 60%;
|
|
58
|
+
word-break: break-all;
|
|
59
|
+
line-height: 1.2;
|
|
60
|
+
padding-top: 3px;
|
|
61
|
+
padding-bottom: 2px;
|
|
62
|
+
|
|
63
|
+
.bp4-input-group .bp4-input {
|
|
64
|
+
margin-top: -5px;
|
|
65
|
+
margin-bottom: -2px;
|
|
66
|
+
font-size: unset;
|
|
67
|
+
line-height: unset;
|
|
68
|
+
border-radius: 0;
|
|
69
|
+
height: 18px;
|
|
70
|
+
}
|
|
71
|
+
`
|
|
72
|
+
}, children));
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const TextInput = function ({
|
|
76
|
+
value,
|
|
77
|
+
placeholder,
|
|
78
|
+
onChange,
|
|
79
|
+
validationErrors,
|
|
80
|
+
inputGroupProps,
|
|
81
|
+
className,
|
|
82
|
+
style
|
|
83
|
+
}) {
|
|
84
|
+
const errs = validationErrors !== null && validationErrors !== void 0 ? validationErrors : [];
|
|
85
|
+
const invalid = errs.length > 0;
|
|
86
|
+
return (0, _react.jsx)(_core.InputGroup, Object.assign({
|
|
87
|
+
fill: true,
|
|
88
|
+
small: true,
|
|
89
|
+
disabled: !onChange,
|
|
90
|
+
value: value,
|
|
91
|
+
css: (0, _react.css)`${invalid && onChange ? `.bp4-input { background: mistyrose }` : ''}`,
|
|
92
|
+
placeholder: placeholder,
|
|
93
|
+
rightElement: invalid ? (0, _react.jsx)(_popover.Tooltip2, {
|
|
94
|
+
position: "right",
|
|
95
|
+
intent: "danger",
|
|
96
|
+
minimal: true,
|
|
97
|
+
content: (0, _react.jsx)(_core.UL, {
|
|
98
|
+
css: (0, _react.css)`margin: 0;`
|
|
99
|
+
}, errs.map((err, idx) => (0, _react.jsx)("li", {
|
|
100
|
+
key: idx
|
|
101
|
+
}, err)))
|
|
102
|
+
}, (0, _react.jsx)(_core.Icon, {
|
|
103
|
+
icon: "warning-sign",
|
|
104
|
+
iconSize: 10,
|
|
105
|
+
intent: "danger",
|
|
106
|
+
css: (0, _react.css)`margin-right: 5px; margin-bottom: 2.5px`
|
|
107
|
+
})) : undefined
|
|
108
|
+
}, inputGroupProps, {
|
|
109
|
+
onChange: onChange ? evt => onChange(evt.currentTarget.value) : undefined,
|
|
110
|
+
className: className,
|
|
111
|
+
style: style
|
|
112
|
+
}));
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
exports.TextInput = TextInput;
|
|
116
|
+
|
|
117
|
+
const Select = function ({
|
|
118
|
+
value,
|
|
119
|
+
options,
|
|
120
|
+
onChange,
|
|
121
|
+
large,
|
|
122
|
+
minimal,
|
|
123
|
+
fill
|
|
124
|
+
}) {
|
|
125
|
+
return (0, _react.jsx)(_core.HTMLSelect, {
|
|
126
|
+
options: options,
|
|
127
|
+
onChange: onChange,
|
|
128
|
+
disabled: !onChange,
|
|
129
|
+
value: value,
|
|
130
|
+
large: large,
|
|
131
|
+
minimal: minimal,
|
|
132
|
+
fill: fill,
|
|
133
|
+
css: (0, _react.css)`
|
|
134
|
+
margin-top: -2px;
|
|
135
|
+
& select {
|
|
136
|
+
height: 18px;
|
|
137
|
+
font-size: unset;
|
|
138
|
+
}
|
|
139
|
+
& .bp4-icon-double-caret-vertical {
|
|
140
|
+
top: 2px;
|
|
141
|
+
}
|
|
142
|
+
`
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
exports.Select = Select;
|
|
147
|
+
var _default = PropertyView;
|
|
148
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyView.js","sourceRoot":"","sources":["../../../src/widgets/Sidebar/PropertyView.tsx"],"names":[],"mappings":"AAAA,eAAe;AACf,8BAA8B;AAG9B,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,IAAI,EAAoB,UAAU,EAAE,EAAE,EAAE,UAAU,EAA2B,MAAM,mBAAmB,CAAC;AACxH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAWzC,MAAM,YAAY,GAClB,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE;IACvF,OAAO,CACL,aACI,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,CAAA;;;;;;SAMP;QACH,aAAK,GAAG,EAAE,GAAG,CAAA;;;;;;qBAME,MAAM,CAAC,KAAK;WACtB;YACF,OAAO;gBACN,CAAC,CAAC,IAAC,WAAW,IACV,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,aAAa,EACrB,YAAY,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAC7C;gBACJ,CAAC,CAAC,IAAI;YACP,GAAG;YACH,KAAK,CACF;QACN,aAAK,GAAG,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;WAeR,IACF,QAAQ,CACL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AAK,IACZ,CACH,CAAA;AACH,CAAC,CAAA;AAGD,MAAM,CAAC,MAAM,MAAM,GACnB,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE;IAC1D,OAAO,CACL,IAAC,UAAU,IACT,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,QAAQ,EACnB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAG,CAAA;;;;;;;;;OASP,GACD,CACH,CAAA;AACH,CAAC,CAAA;AAGD,eAAe,YAAY,CAAC","sourcesContent":["/** @jsx jsx */\n/** @jsxFrag React.Fragment */\n\nimport React from 'react';\nimport { jsx, css } from '@emotion/react';\nimport { Colors, Icon, InputGroupProps2, InputGroup, UL, HTMLSelect, HTMLSelectProps, Intent } from '@blueprintjs/core';\nimport { Tooltip2 } from '@blueprintjs/popover2';\nimport HelpTooltip from '../HelpTooltip';\n\n\ninterface PropertyViewProps {\n label: JSX.Element | string\n title?: string\n tooltip?: JSX.Element | string\n tooltipIntent?: Intent\n tooltipClassName?: string\n className?: string \n}\nconst PropertyView: React.FC<PropertyViewProps> =\nfunction ({ label, title, tooltip, tooltipIntent, tooltipClassName, className, children }) {\n return (\n <div\n className={className}\n title={title}\n css={css`\n display: flex;\n flex-flow: row nowrap;\n align-items: flex-start;\n font-size: 12px;\n margin-bottom: 5px;\n `}>\n <div css={css`\n width: 40%;\n padding-right: 10px;\n text-align: right;\n padding-top: 2px;\n padding-bottom: 2px;\n color: ${Colors.GRAY1};\n `}>\n {tooltip\n ? <HelpTooltip\n content={tooltip}\n intent={tooltipIntent}\n tooltipProps={{ className: tooltipClassName }}\n />\n : null}\n {\" \"}\n {label}\n </div>\n <div css={css`\n width: 60%;\n word-break: break-all;\n line-height: 1.2;\n padding-top: 3px;\n padding-bottom: 2px;\n\n .bp4-input-group .bp4-input {\n margin-top: -5px;\n margin-bottom: -2px;\n font-size: unset;\n line-height: unset;\n border-radius: 0;\n height: 18px;\n }\n `}>\n {children}\n </div>\n </div>\n );\n}\n\n\ninterface TextInputProps {\n value: string\n onChange?: (newValue: string) => void\n onConfirm?: () => void\n placeholder?: string\n inputGroupProps?: InputGroupProps2 \n validationErrors?: string[]\n className?: string\n style?: React.CSSProperties\n}\nexport const TextInput: React.FC<TextInputProps> =\nfunction ({ value, placeholder, onChange, validationErrors, inputGroupProps, className, style }) {\n const errs = validationErrors ?? [];\n const invalid = errs.length > 0;\n return (\n <InputGroup\n fill\n small\n disabled={!onChange}\n value={value}\n css={css`${invalid && onChange ? `.bp4-input { background: mistyrose }` : ''}`}\n placeholder={placeholder}\n rightElement={invalid\n ? <Tooltip2\n position=\"right\"\n intent=\"danger\"\n minimal\n content={\n <UL css={css`margin: 0;`}>\n {errs.map((err, idx) => <li key={idx}>{err}</li>)}\n </UL>\n }>\n <Icon\n icon=\"warning-sign\"\n iconSize={10}\n intent=\"danger\"\n css={css`margin-right: 5px; margin-bottom: 2.5px`}\n />\n </Tooltip2>\n : undefined}\n {...inputGroupProps}\n onChange={onChange ? (evt: React.FormEvent<HTMLInputElement>) => onChange!(evt.currentTarget.value) : undefined}\n className={className}\n style={style}\n />\n )\n}\n\ninterface SelectProps extends HTMLSelectProps {}\nexport const Select: React.FC<SelectProps> =\nfunction ({ value, options, onChange, large, minimal, fill }) {\n return (\n <HTMLSelect\n options={options}\n onChange={onChange}\n disabled={!onChange}\n value={value}\n large={large}\n minimal={minimal}\n fill={fill}\n css={css`\n margin-top: -2px;\n & select {\n height: 18px;\n font-size: unset;\n }\n & .bp4-icon-double-caret-vertical {\n top: 2px;\n }\n `}\n />\n )\n}\n\n\nexport default PropertyView;\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
/** @jsxFrag React.Fragment */
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import type { PersistentStateReducerHook } from '../../usePersistentStateReducer';
|
|
5
|
+
import { SidebarBlockConfig } from './Block';
|
|
6
|
+
interface State {
|
|
7
|
+
blockState: {
|
|
8
|
+
[blockTitle: string]: boolean;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
declare type Action = {
|
|
12
|
+
type: 'expand-all' | 'collapse-all' | 'reset-state';
|
|
13
|
+
} | {
|
|
14
|
+
type: 'collapse-one' | 'expand-one' | 'collapse-others';
|
|
15
|
+
payload: {
|
|
16
|
+
blockKey: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export interface SidebarProps {
|
|
20
|
+
stateKey: string;
|
|
21
|
+
title: string | JSX.Element;
|
|
22
|
+
blocks: SidebarBlockConfig[];
|
|
23
|
+
representsSelection?: boolean;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
declare function makeSidebar(persistentReducer: PersistentStateReducerHook<State, Action>): React.FC<SidebarProps>;
|
|
27
|
+
export default makeSidebar;
|