@riboseinc/paneron-registry-kit 2.2.2 → 2.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/package.json +4 -3
  2. package/types/item.d.ts +1 -0
  3. package/types/item.js +8 -0
  4. package/types/item.js.map +1 -1
  5. package/views/GenericRelatedItemView.js +89 -75
  6. package/views/GenericRelatedItemView.js.map +1 -1
  7. package/views/change-request/ChangeRequestContext.js +8 -5
  8. package/views/change-request/ChangeRequestContext.js.map +1 -1
  9. package/views/change-request/objectChangeset.d.ts +3 -1
  10. package/views/change-request/objectChangeset.js +4 -1
  11. package/views/change-request/objectChangeset.js.map +1 -1
  12. package/views/detail/ChangeRequest/index.d.ts +0 -1
  13. package/views/detail/ChangeRequest/index.js +143 -128
  14. package/views/detail/ChangeRequest/index.js.map +1 -1
  15. package/views/detail/ChangeRequest/transitions.js +14 -9
  16. package/views/detail/ChangeRequest/transitions.js.map +1 -1
  17. package/views/detail/RegisterHome/index.js +1 -1
  18. package/views/detail/RegisterHome/index.js.map +1 -1
  19. package/views/detail/RegisterItem/index.js +34 -48
  20. package/views/detail/RegisterItem/index.js.map +1 -1
  21. package/views/hooks/useItemClassConfig.d.ts +1 -2
  22. package/views/hooks/useItemClassConfig.js +1 -7
  23. package/views/hooks/useItemClassConfig.js.map +1 -1
  24. package/views/hooks/useSingleRegisterItemData.d.ts +1 -1
  25. package/views/hooks/useSingleRegisterItemData.js +4 -3
  26. package/views/hooks/useSingleRegisterItemData.js.map +1 -1
  27. package/views/index.js +34 -24
  28. package/views/index.js.map +1 -1
  29. package/views/itemPathUtils.d.ts +3 -8
  30. package/views/itemPathUtils.js +26 -1
  31. package/views/itemPathUtils.js.map +1 -1
  32. package/views/protocolRegistry.d.ts +1 -1
  33. package/views/protocolRegistry.js.map +1 -1
  34. package/views/sidebar/Browse/index.js +43 -35
  35. package/views/sidebar/Browse/index.js.map +1 -1
  36. package/views/sidebar/Registration/index.js +12 -11
  37. package/views/sidebar/Registration/index.js.map +1 -1
  38. package/views/sidebar/Search/index.js +48 -43
  39. package/views/sidebar/Search/index.js.map +1 -1
  40. package/views/util.d.ts +1 -0
  41. package/views/util.js +3 -1
  42. package/views/util.js.map +1 -1
package/views/util.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/views/util.tsx"],"names":[],"mappings":"AAAA,eAAe;AACf,8BAA8B;AAE9B,iCAAiC;AACjC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAe,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAkB,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAClC,GAAW,EACX,YAAoB,EAAE;IAEtB,OAAO,GAAG,CAAC,MAAM,GAAG,SAAS;QAC3B,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG;QAC/B,CAAC,CAAC,GAAG,CAAC;AACV,CAAC;AAGD,MAAM,CAAC,MAAM,cAAc,GAA0B,UAAU,KAAK;IAClE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAE3D,OAAO,CACL,IAAC,MAAM,IACH,aAAa,EAAE,SAAS,YAAY,WAAW,EAC/C,YAAY,EAAE,GAAG,YAAY,WAAW,IACzC,KAAK,CAAC,QAAQ,CACR,CACV,CAAC;AACJ,CAAC,CAAC;AAGF,MAAM,CAAC,MAAM,kBAAkB,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AAsB,GAI9B,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;IACzC,OAAO,CACL,aAAK,GAAG,EAAE,GAAG,CAAA;;;KAGZ,EAAE,SAAS,EAAE,SAAS;QACrB,aAAK,GAAG,EAAE,GAAG,CAAA,wEAAwE,IAClF,OAAO,CACJ;QACN,aAAK,GAAG,EAAE,GAAG,CAAA;;;;;sBAKG,MAAM,CAAC,KAAK;oCACE,MAAM,CAAC,UAAU;OAC9C,IACE,IAAI,CACD,CACF,CACP,CAAA;AACH,CAAC,CAAA","sourcesContent":["/** @jsx jsx */\n/** @jsxFrag React.Fragment */\n\n//import log from 'electron-log';\nimport format from 'date-fns/format';\nimport React, { useContext } from 'react';\nimport { Helmet, HelmetProps } from 'react-helmet';\nimport { css, jsx } from '@emotion/react';\nimport { FormGroup, FormGroupProps, Colors } from '@blueprintjs/core';\nimport { DatasetContext } from '@riboseinc/paneron-extension-kit/context';\nimport type { ItemClassConfiguration, RelatedItemClassConfiguration } from '../types';\nexport { GenericRelatedItemView } from './GenericRelatedItemView';\n\n\n/**\n * Get give string truncated & with ellipsis appended\n * if its length exceeds given number of characters.\n */\nexport function maybeEllipsizeString(\n str: string,\n maxLength: number = 20,\n): string {\n return str.length > maxLength\n ? `${str.slice(0, maxLength)}…`\n : str;\n}\n\n\nexport const RegisterHelmet: React.FC<HelmetProps> = function (props) {\n const { title: datasetTitle } = useContext(DatasetContext);\n\n return (\n <Helmet\n titleTemplate={`%s in ${datasetTitle} register`}\n defaultTitle={`${datasetTitle} register`}>\n {props.children}\n </Helmet>\n );\n};\n\n\nexport const PropertyDetailView: React.FC<{\n title: FormGroupProps[\"label\"]\n secondaryTitle?: FormGroupProps[\"labelInfo\"]\n inline?: FormGroupProps[\"inline\"]\n}> = function ({ title, inline, children, secondaryTitle }) {\n return <FormGroup\n label={`${title}:`}\n labelInfo={secondaryTitle}\n css={css`&, &.bp4-inline { label.bp4-label { font-weight: bold; line-height: unset } }`}\n inline={inline}>\n {children}\n </FormGroup>;\n};\n\n\n/** Formats given date as a span with tooltip set to full ISO date & time. */\nexport const Datestamp: React.FC<{\n date: Date\n title?: string\n className?: string\n}> = function ({ date, title, className }) {\n const asString = formatDate(date);\n return <span\n className={className}\n title={`${title ? `${title}: ` : ''}${date?.toString() ?? 'N/A'}`}>\n {asString}\n </span>;\n};\n\n\n/** Foramts given date as plain text. */\nexport function formatDate(date: Date): string {\n try {\n return format(date, 'yyyy-MM-dd');\n } catch (e) {\n return `Invalid date (${e})`;\n }\n}\n\n\nexport const _getRelatedClass = (classes: Record<string, ItemClassConfiguration<any>>) => {\n return (clsID: string): RelatedItemClassConfiguration => {\n const cfg = classes[clsID];\n return {\n title: cfg.meta.title,\n // TODO: The itemView/listItemView inconsistency is annoying\n itemView: cfg.views.listItemView,\n };\n };\n};\n\n\n/**\n * Suitable for use as tab contents for TabbedWorkspace.\n * Provides top bar with actions and main content.\n */\nexport const TabContentsWithActions: React.FC<{\n actions: JSX.Element;\n main: JSX.Element;\n className?: string;\n}> = function ({ actions, main, className }) {\n return (\n <div css={css`\n position: absolute; inset: 0;\n display: flex; flex-flow: column nowrap;\n `} className={className}>\n <div css={css`flex: 0; padding: 10px; display: flex; flex-flow: row wrap; gap: 10px;`}>\n {actions}\n </div>\n <div css={css`\n position: relative;\n flex: 1;\n padding: 10px;\n overflow-y: auto;\n background: ${Colors.GRAY5};\n .bp4-dark & { background: ${Colors.DARK_GRAY2}; }\n `}>\n {main}\n </div>\n </div>\n )\n}\n"]}
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/views/util.tsx"],"names":[],"mappings":"AAAA,eAAe;AACf,8BAA8B;AAE9B,iCAAiC;AACjC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAe,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,gBAA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pB,KAAK,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,EAAE,mCAAI,KAAK,EAAE,IAClE,QAAQ,CACJ,CAAC;AACV,CAAC,CAAC;AAGF,wCAAwC;AACxC,MAAM,UAAU,UAAU,CAAC,IAAU;IACnC,IAAI;QACF,OAAO,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;KACnC;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,iBAAiB,CAAC,GAAG,CAAC;KAC9B;AACH,CAAC;AAGD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAoD,EAAE,EAAE;IACvF,OAAO,CAAC,KAAa,EAAiC,EAAE;QACtD,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC3B,OAAO;YACL,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK;YACrB,4DAA4D;YAC5D,QAAQ,EAAE,GAAG,CAAC,KAAK,CAAC,YAAY;SACjC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AAGF;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAI9B,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;IACzC,OAAO,CACL,aAAK,GAAG,EAAE,GAAG,CAAA;;;KAGZ,EAAE,SAAS,EAAE,SAAS;QACrB,aAAK,GAAG,EAAE,GAAG,CAAA,wEAAwE,IAClF,OAAO,CACJ;QACN,aAAK,GAAG,EAAE,GAAG,CAAA;;;;;sBAKG,MAAM,CAAC,KAAK;oCACE,MAAM,CAAC,UAAU;OAC9C,IACE,IAAI,CACD,CACF,CACP,CAAA;AACH,CAAC,CAAA","sourcesContent":["/** @jsx jsx */\n/** @jsxFrag React.Fragment */\n\n//import log from 'electron-log';\nimport format from 'date-fns/format';\nimport React, { useContext } from 'react';\nimport { Helmet, HelmetProps } from 'react-helmet';\nimport { css, jsx } from '@emotion/react';\nimport { FormGroup, FormGroupProps, Colors } from '@blueprintjs/core';\nimport { DatasetContext } from '@riboseinc/paneron-extension-kit/context';\nimport type { ItemClassConfiguration, RelatedItemClassConfiguration } from '../types';\nexport { GenericRelatedItemView } from './GenericRelatedItemView';\n\n\n/**\n * Get give string truncated & with ellipsis appended\n * if its length exceeds given number of characters.\n */\nexport function maybeEllipsizeString(\n str: string,\n maxLength: number = 20,\n): string {\n return str.length > maxLength\n ? `${str.slice(0, maxLength)}…`\n : str;\n}\n\n\nexport const RegisterHelmet: React.FC<HelmetProps> = function (props) {\n const { title: datasetTitle } = useContext(DatasetContext);\n\n return (\n <Helmet\n titleTemplate={`%s in ${datasetTitle} register`}\n defaultTitle={`${datasetTitle} register`}>\n {props.children}\n </Helmet>\n );\n};\n\n\nexport const PropertyDetailView: React.FC<{\n title: FormGroupProps[\"label\"]\n secondaryTitle?: FormGroupProps[\"labelInfo\"]\n inline?: FormGroupProps[\"inline\"]\n className?: string\n}> = function ({ title, secondaryTitle, inline, children, className }) {\n return (\n <FormGroup\n label={`${title}:`}\n labelInfo={secondaryTitle}\n css={css`&, &.bp4-inline { label.bp4-label { font-weight: bold; line-height: unset } }`}\n className={className}\n inline={inline}>\n {children}\n </FormGroup>\n );\n};\n\n\n/** Formats given date as a span with tooltip set to full ISO date & time. */\nexport const Datestamp: React.FC<{\n date: Date\n title?: string\n className?: string\n}> = function ({ date, title, className }) {\n const asString = formatDate(date);\n return <span\n className={className}\n title={`${title ? `${title}: ` : ''}${date?.toString() ?? 'N/A'}`}>\n {asString}\n </span>;\n};\n\n\n/** Foramts given date as plain text. */\nexport function formatDate(date: Date): string {\n try {\n return format(date, 'yyyy-MM-dd');\n } catch (e) {\n return `Invalid date (${e})`;\n }\n}\n\n\nexport const _getRelatedClass = (classes: Record<string, ItemClassConfiguration<any>>) => {\n return (clsID: string): RelatedItemClassConfiguration => {\n const cfg = classes[clsID];\n return {\n title: cfg.meta.title,\n // TODO: The itemView/listItemView inconsistency is annoying\n itemView: cfg.views.listItemView,\n };\n };\n};\n\n\n/**\n * Suitable for use as tab contents for TabbedWorkspace.\n * Provides top bar with actions and main content.\n */\nexport const TabContentsWithActions: React.FC<{\n actions: JSX.Element;\n main: JSX.Element;\n className?: string;\n}> = function ({ actions, main, className }) {\n return (\n <div css={css`\n position: absolute; inset: 0;\n display: flex; flex-flow: column nowrap;\n `} className={className}>\n <div css={css`flex: 0; padding: 10px; display: flex; flex-flow: row wrap; gap: 10px;`}>\n {actions}\n </div>\n <div css={css`\n position: relative;\n flex: 1;\n padding: 10px;\n overflow-y: auto;\n background: ${Colors.GRAY5};\n .bp4-dark & { background: ${Colors.DARK_GRAY2}; }\n `}>\n {main}\n </div>\n </div>\n )\n}\n"]}