@box/metadata-template-browser 3.1.5 → 3.1.7
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useConsumerState}from"../../contexts/hooks.js";import{t as BrowserRow}from"../../../../chunks/browser-row.js";import{messages}from"./messages.js";import{IconButton}from"@box/blueprint-web";import{useIntl}from"react-intl";import{jsx}from"react/jsx-runtime";import{ChevronRight,Folder}from"@box/blueprint-web-assets/icons/Medium";function NamespaceRow({namespace}){let{formatMessage}=useIntl(),{isDisabled}=useConsumerState();return jsx(BrowserRow,{id:namespace.fqn,leadingIcon:jsx(Folder,{}),title:namespace.displayName,trailingSlot:jsx(IconButton,{"aria-label":formatMessage(messages.navigateAriaLabel,{displayName:namespace.displayName}),disabled:isDisabled,icon:ChevronRight,size:`x-small`})})}export{NamespaceRow};
|
|
1
|
+
import{useConsumerState}from"../../contexts/hooks.js";import{t as BrowserRow}from"../../../../chunks/browser-row.js";import{messages}from"./messages.js";import{IconButton}from"@box/blueprint-web";import{useIntl}from"react-intl";import{jsx}from"react/jsx-runtime";import{ChevronRight,Folder}from"@box/blueprint-web-assets/icons/Medium";function NamespaceRow({namespace}){let{formatMessage}=useIntl(),{isDisabled}=useConsumerState();return jsx(BrowserRow,{id:namespace.fqn,leadingIcon:jsx(Folder,{}),title:namespace.displayName,trailingSlot:jsx(IconButton,{"aria-label":formatMessage(messages.navigateAriaLabel,{displayName:namespace.displayName}),disabled:isDisabled,icon:ChevronRight,size:`x-small`,type:`button`})})}export{NamespaceRow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useConsumerState}from"../../contexts/hooks.js";import{t as TemplateRowVariant}from"../../../../chunks/types.js";import{t as BrowserRow}from"../../../../chunks/browser-row.js";import{messages}from"./messages.js";import{IconButton,Text}from"@box/blueprint-web";import{useIntl}from"react-intl";import{Fragment,useCallback}from"react";import{jsx,jsxs}from"react/jsx-runtime";import{Metadata}from"@box/blueprint-web-assets/icons/Medium";import{Pencil}from"@box/blueprint-web-assets/icons/Fill";var deriveBreadcrumbPath=template=>{if(!template.ancestors||template.ancestors.length===0)return;let lastIndex=template.ancestors.length-1;return template.ancestors.map((ancestor,index)=>jsxs(Fragment,{children:[index>0&&jsx(Text,{"aria-hidden":`true`,as:`span`,color:`textOnLightSecondary`,variant:`caption`,children:` / `}),jsx(Text,{as:`span`,color:`textOnLightSecondary`,variant:index===lastIndex?`captionBold`:`caption`,children:ancestor.displayName})]},ancestor.fqn))};function TemplateRow({template,variant,onEdit}){let{formatMessage}=useIntl(),{isDisabled,appliedTemplateIds,isTemplateEditingEnabled}=useConsumerState(),isApplied=appliedTemplateIds.has(template.id),handleEditClick=useCallback(event=>{event.stopPropagation(),onEdit(template.id)},[onEdit,template.id]),isSearchVariant=variant===TemplateRowVariant.Search,showEditButton=isTemplateEditingEnabled&&!!template.canEdit;return jsx(BrowserRow,{id:template.id,isApplied,isTrailingSlotHoverOnly:showEditButton,leadingIcon:isSearchVariant?void 0:jsx(Metadata,{}),subtitle:isSearchVariant?deriveBreadcrumbPath(template):void 0,title:template.displayName,tooltipContent:isApplied?formatMessage(messages.alreadyApplied):void 0,trailingSlot:showEditButton?jsx(`div`,{onPointerDown:e=>e.stopPropagation(),children:jsx(IconButton,{"aria-label":formatMessage(messages.editAriaLabel,{displayName:template.displayName}),disabled:isDisabled,icon:Pencil,onClick:handleEditClick,size:`x-small`})}):void 0})}export{TemplateRow};
|
|
1
|
+
import{useConsumerState}from"../../contexts/hooks.js";import{t as TemplateRowVariant}from"../../../../chunks/types.js";import{t as BrowserRow}from"../../../../chunks/browser-row.js";import{messages}from"./messages.js";import{IconButton,Text}from"@box/blueprint-web";import{useIntl}from"react-intl";import{Fragment,useCallback}from"react";import{jsx,jsxs}from"react/jsx-runtime";import{Metadata}from"@box/blueprint-web-assets/icons/Medium";import{Pencil}from"@box/blueprint-web-assets/icons/Fill";var deriveBreadcrumbPath=template=>{if(!template.ancestors||template.ancestors.length===0)return;let lastIndex=template.ancestors.length-1;return template.ancestors.map((ancestor,index)=>jsxs(Fragment,{children:[index>0&&jsx(Text,{"aria-hidden":`true`,as:`span`,color:`textOnLightSecondary`,variant:`caption`,children:` / `}),jsx(Text,{as:`span`,color:`textOnLightSecondary`,variant:index===lastIndex?`captionBold`:`caption`,children:ancestor.displayName})]},ancestor.fqn))};function TemplateRow({template,variant,onEdit}){let{formatMessage}=useIntl(),{isDisabled,appliedTemplateIds,isTemplateEditingEnabled}=useConsumerState(),isApplied=appliedTemplateIds.has(template.id),handleEditClick=useCallback(event=>{event.stopPropagation(),onEdit(template.id)},[onEdit,template.id]),isSearchVariant=variant===TemplateRowVariant.Search,showEditButton=isTemplateEditingEnabled&&!!template.canEdit;return jsx(BrowserRow,{id:template.id,isApplied,isTrailingSlotHoverOnly:showEditButton,leadingIcon:isSearchVariant?void 0:jsx(Metadata,{}),subtitle:isSearchVariant?deriveBreadcrumbPath(template):void 0,title:template.displayName,tooltipContent:isApplied?formatMessage(messages.alreadyApplied):void 0,trailingSlot:showEditButton?jsx(`div`,{onPointerDown:e=>e.stopPropagation(),children:jsx(IconButton,{"aria-label":formatMessage(messages.editAriaLabel,{displayName:template.displayName}),disabled:isDisabled,icon:Pencil,onClick:handleEditClick,size:`x-small`,type:`button`})}):void 0})}export{TemplateRow};
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/metadata-template-browser",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.7",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@box/blueprint-web": "^18.
|
|
7
|
-
"@box/blueprint-web-assets": "^5.15.
|
|
6
|
+
"@box/blueprint-web": "^18.11.0",
|
|
7
|
+
"@box/blueprint-web-assets": "^5.15.1",
|
|
8
8
|
"lodash": "^4.17.15",
|
|
9
9
|
"react": "^18.0.0",
|
|
10
10
|
"react-aria-components": "1.16.0",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"react-intl": "^6.4.2"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@box/blueprint-web": "^18.
|
|
16
|
-
"@box/blueprint-web-assets": "^5.15.
|
|
15
|
+
"@box/blueprint-web": "^18.11.0",
|
|
16
|
+
"@box/blueprint-web-assets": "^5.15.1",
|
|
17
17
|
"@box/eslint-plugin-blueprint": "2.3.4",
|
|
18
|
-
"@box/storybook-utils": "1.4.
|
|
18
|
+
"@box/storybook-utils": "1.4.35",
|
|
19
19
|
"react-intl": "^6.4.2"
|
|
20
20
|
},
|
|
21
21
|
"publishConfig": {
|