@itwin/presentation-hierarchies-react 2.0.0-alpha.57 → 2.0.0-alpha.59

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 (76) hide show
  1. package/CHANGELOG.md +184 -36
  2. package/README.md +46 -57
  3. package/lib/presentation-hierarchies-react/{stratakit/FlatTreeNode.d.ts → FlatTreeNode.d.ts} +2 -2
  4. package/lib/presentation-hierarchies-react/FlatTreeNode.d.ts.map +1 -0
  5. package/lib/presentation-hierarchies-react/{stratakit/FlatTreeNode.js → FlatTreeNode.js} +2 -3
  6. package/lib/presentation-hierarchies-react/FlatTreeNode.js.map +1 -0
  7. package/lib/presentation-hierarchies-react/{stratakit/LocalizationContext.d.ts → LocalizationContext.d.ts} +1 -1
  8. package/lib/presentation-hierarchies-react/LocalizationContext.d.ts.map +1 -0
  9. package/lib/presentation-hierarchies-react/{stratakit/LocalizationContext.js → LocalizationContext.js} +3 -4
  10. package/lib/presentation-hierarchies-react/LocalizationContext.js.map +1 -0
  11. package/lib/presentation-hierarchies-react/UseIModelTree.d.ts +2 -2
  12. package/lib/presentation-hierarchies-react/UseIModelTree.js +2 -3
  13. package/lib/presentation-hierarchies-react/UseIModelTree.js.map +1 -1
  14. package/lib/presentation-hierarchies-react/UseNodeHighlighting.js +1 -2
  15. package/lib/presentation-hierarchies-react/UseNodeHighlighting.js.map +1 -1
  16. package/lib/presentation-hierarchies-react/UseSelectionHandler.d.ts +0 -2
  17. package/lib/presentation-hierarchies-react/UseSelectionHandler.d.ts.map +1 -1
  18. package/lib/presentation-hierarchies-react/UseSelectionHandler.js +1 -2
  19. package/lib/presentation-hierarchies-react/UseSelectionHandler.js.map +1 -1
  20. package/lib/presentation-hierarchies-react/UseTree.d.ts +2 -2
  21. package/lib/presentation-hierarchies-react/UseTree.js +1 -2
  22. package/lib/presentation-hierarchies-react/UseTree.js.map +1 -1
  23. package/lib/presentation-hierarchies-react/Utils.js +1 -1
  24. package/lib/presentation-hierarchies-react/Utils.js.map +1 -1
  25. package/lib/presentation-hierarchies-react/internal/DisposePolyfill.js +2 -2
  26. package/lib/presentation-hierarchies-react/internal/DisposePolyfill.js.map +1 -1
  27. package/lib/presentation-hierarchies-react/internal/LocalizedStrings.js +1 -1
  28. package/lib/presentation-hierarchies-react/internal/TreeActions.js +1 -2
  29. package/lib/presentation-hierarchies-react/internal/TreeActions.js.map +1 -1
  30. package/lib/presentation-hierarchies-react/internal/TreeLoader.js +1 -2
  31. package/lib/presentation-hierarchies-react/internal/TreeLoader.js.map +1 -1
  32. package/lib/presentation-hierarchies-react/internal/TreeModel.d.ts +0 -2
  33. package/lib/presentation-hierarchies-react/internal/TreeModel.js +1 -1
  34. package/lib/presentation-hierarchies-react/internal/TreeModel.js.map +1 -1
  35. package/lib/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts +0 -2
  36. package/lib/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts.map +1 -1
  37. package/lib/presentation-hierarchies-react/internal/UseUnifiedSelection.js +1 -2
  38. package/lib/presentation-hierarchies-react/internal/UseUnifiedSelection.js.map +1 -1
  39. package/lib/presentation-hierarchies-react/internal/Utils.js +1 -2
  40. package/lib/presentation-hierarchies-react/internal/Utils.js.map +1 -1
  41. package/lib/presentation-hierarchies-react/stratakit/ErrorItemRenderer.d.ts +1 -1
  42. package/lib/presentation-hierarchies-react/stratakit/ErrorItemRenderer.js +2 -3
  43. package/lib/presentation-hierarchies-react/stratakit/ErrorItemRenderer.js.map +1 -1
  44. package/lib/presentation-hierarchies-react/stratakit/RootErrorRenderer.d.ts.map +1 -1
  45. package/lib/presentation-hierarchies-react/stratakit/RootErrorRenderer.js +2 -3
  46. package/lib/presentation-hierarchies-react/stratakit/RootErrorRenderer.js.map +1 -1
  47. package/lib/presentation-hierarchies-react/stratakit/TreeAction.js +1 -2
  48. package/lib/presentation-hierarchies-react/stratakit/TreeAction.js.map +1 -1
  49. package/lib/presentation-hierarchies-react/stratakit/TreeErrorRenderer.d.ts +1 -1
  50. package/lib/presentation-hierarchies-react/stratakit/TreeErrorRenderer.d.ts.map +1 -1
  51. package/lib/presentation-hierarchies-react/stratakit/TreeErrorRenderer.js +2 -3
  52. package/lib/presentation-hierarchies-react/stratakit/TreeErrorRenderer.js.map +1 -1
  53. package/lib/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.d.ts.map +1 -1
  54. package/lib/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.js +2 -3
  55. package/lib/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.js.map +1 -1
  56. package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts +0 -2
  57. package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts.map +1 -1
  58. package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.js +2 -3
  59. package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.js.map +1 -1
  60. package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts +0 -4
  61. package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts.map +1 -1
  62. package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.js +2 -3
  63. package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.js.map +1 -1
  64. package/lib/presentation-hierarchies-react/stratakit/TreeRenderer.js +2 -3
  65. package/lib/presentation-hierarchies-react/stratakit/TreeRenderer.js.map +1 -1
  66. package/lib/presentation-hierarchies-react-extract.d.ts +17 -0
  67. package/lib/presentation-hierarchies-react-extract.js +16 -0
  68. package/lib/presentation-hierarchies-react-stratakit.d.ts +8 -0
  69. package/lib/presentation-hierarchies-react-stratakit.js +8 -0
  70. package/lib/presentation-hierarchies-react.d.ts +3 -10
  71. package/lib/presentation-hierarchies-react.js +3 -11
  72. package/package.json +20 -13
  73. package/lib/presentation-hierarchies-react/stratakit/FlatTreeNode.d.ts.map +0 -1
  74. package/lib/presentation-hierarchies-react/stratakit/FlatTreeNode.js.map +0 -1
  75. package/lib/presentation-hierarchies-react/stratakit/LocalizationContext.d.ts.map +0 -1
  76. package/lib/presentation-hierarchies-react/stratakit/LocalizationContext.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { TreeNode } from "../TreeNode.js";
2
2
  import { HierarchyLevelDetails, TreeRendererProps } from "../Renderers.js";
3
- import { useErrorNodes } from "./FlatTreeNode.js";
3
+ import { useErrorNodes } from "../FlatTreeNode.js";
4
4
  import { JSX } from "react";
5
5
 
6
6
  //#region src/presentation-hierarchies-react/stratakit/ErrorItemRenderer.d.ts
@@ -1,10 +1,9 @@
1
1
  import { MAX_LIMIT_OVERRIDE } from "../internal/Utils.js";
2
- import { useTranslation } from "./LocalizationContext.js";
2
+ import { useTranslation } from "../LocalizationContext.js";
3
3
  import { c } from "react-compiler-runtime";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { unstable_ErrorRegion } from "@stratakit/structures";
6
6
  import { Anchor, Text } from "@stratakit/bricks";
7
-
8
7
  //#region src/presentation-hierarchies-react/stratakit/ErrorItemRenderer.tsx
9
8
  /**
10
9
  * Renders StrataKit `<ErrorRegion.Item />` for all supported error types:
@@ -375,7 +374,7 @@ function MessageWithLink(t0) {
375
374
  } else t6 = $[10];
376
375
  return t6;
377
376
  }
378
-
379
377
  //#endregion
380
378
  export { ErrorItemRenderer };
379
+
381
380
  //# sourceMappingURL=ErrorItemRenderer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorItemRenderer.js","names":["Anchor","Text","unstable_ErrorRegion","ErrorRegion","MAX_LIMIT_OVERRIDE","useTranslation","JSX","HierarchyLevelDetails","TreeRendererProps","TreeNode","useErrorNodes","ErrorItemRendererProps","Pick","errorNode","ReturnType","reloadTree","options","parentNodeId","scrollToNode","filterHierarchyLevel","hierarchyLevelDetails","ErrorItemRenderer","t0","$","_c","getHierarchyLevelDetails","translate","error","type","limit","resultSetSizeLimit","t1","id","setSizeLimit","onOverrideLimit","t2","t3","replace","toString","t4","t5","action","label","condition","t6","t7","t8","isFilterable","t9","t10","t11","t12","t13","hierarchyLevelDetails_0","_temp","_temp2","message","ErrorItemContainerProps","actions","MessageWithLinkProps","ErrorItemContainer","scrollToElement","filter","_temp3","map","_temp4","linkLabel","MessageWithLink","split","splitMessage","Symbol","for","display","whiteSpace","flexWrap"],"sources":["../../../src/presentation-hierarchies-react/stratakit/ErrorItemRenderer.tsx"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Anchor, Text } from \"@stratakit/bricks\";\nimport { unstable_ErrorRegion as ErrorRegion } from \"@stratakit/structures\";\nimport { MAX_LIMIT_OVERRIDE } from \"../internal/Utils.js\";\nimport { useTranslation } from \"./LocalizationContext.js\";\n\nimport type { JSX } from \"react\";\nimport type { HierarchyLevelDetails, TreeRendererProps } from \"../Renderers.js\";\nimport type { TreeNode } from \"../TreeNode.js\";\nimport type { useErrorNodes } from \"./FlatTreeNode.js\";\n\n/** @alpha */\nexport interface ErrorItemRendererProps extends Pick<TreeRendererProps, \"getHierarchyLevelDetails\"> {\n /** A node containing an error. */\n errorNode: ReturnType<typeof useErrorNodes>[number];\n /** A callback to reload a hierarchy level when an error occurs and `retry` button is clicked. */\n reloadTree: (options: { parentNodeId: string | undefined }) => void;\n /** A callback to scroll to the node associated with the error. */\n scrollToNode: (errorNode: TreeNode) => void;\n /** A callback to initiate filtering of the given hierarchy level. */\n filterHierarchyLevel?: (hierarchyLevelDetails: HierarchyLevelDetails) => void;\n}\n\n/**\n * Renders StrataKit `<ErrorRegion.Item />` for all supported error types:\n * - `ResultSetTooLarge` - renders `resultLimitExceeded` message with actions to increase limit or apply filtering\n * - `NoFilterMatches` - renders `noFilteredChildren` message with action to change filter\n * - `ChildrenLoad` - renders `failedToCreateHierarchy` message with action to retry loading\n * - `Unknown` - renders message set on error object.\n *\n * @alpha\n */\nexport function ErrorItemRenderer({\n errorNode,\n getHierarchyLevelDetails,\n filterHierarchyLevel,\n reloadTree,\n scrollToNode,\n}: ErrorItemRendererProps): JSX.Element {\n const translate = useTranslation();\n\n if (errorNode.error.type === \"ResultSetTooLarge\") {\n const limit = errorNode.error.resultSetSizeLimit;\n const onOverrideLimit = () => getHierarchyLevelDetails(errorNode.id)?.setSizeLimit(MAX_LIMIT_OVERRIDE);\n return (\n <ErrorItemContainer\n errorNode={errorNode}\n actions={[\n {\n action: () => {\n onOverrideLimit();\n },\n label: translate(\"increaseHierarchyLimit\").replace(\"{{limit}}\", MAX_LIMIT_OVERRIDE.toString()),\n condition: () => limit < MAX_LIMIT_OVERRIDE,\n },\n {\n action: () => {\n const hierarchyLevelDetails = getHierarchyLevelDetails(errorNode.id);\n hierarchyLevelDetails && filterHierarchyLevel?.(hierarchyLevelDetails);\n },\n label: translate(\"increaseHierarchyLimitWithFiltering\"),\n condition: () => !!filterHierarchyLevel && !!errorNode.isFilterable,\n },\n ]}\n message={translate(\"resultLimitExceeded\").replace(\"{{limit}}\", limit.toString())}\n scrollToElement={() => scrollToNode(errorNode)}\n />\n );\n }\n if (errorNode.error.type === \"NoFilterMatches\") {\n return (\n <ErrorItemContainer\n errorNode={errorNode}\n actions={[\n {\n action: () => {\n const hierarchyLevelDetails = getHierarchyLevelDetails(errorNode.id);\n hierarchyLevelDetails && filterHierarchyLevel?.(hierarchyLevelDetails);\n },\n label: translate(\"noFilteredChildrenChangeFilter\"),\n condition: () => true,\n },\n ]}\n message={translate(\"noFilteredChildren\")}\n scrollToElement={() => scrollToNode(errorNode)}\n />\n );\n }\n if (errorNode.error.type === \"ChildrenLoad\") {\n return (\n <ErrorItemContainer\n errorNode={errorNode}\n actions={[\n {\n action: () => reloadTree({ parentNodeId: errorNode.id }),\n label: translate(\"retry\"),\n condition: () => true,\n },\n ]}\n message={translate(\"failedToCreateHierarchy\")}\n scrollToElement={() => scrollToNode(errorNode)}\n />\n );\n }\n\n return <ErrorItemContainer errorNode={errorNode} message={errorNode.error.message} scrollToElement={() => scrollToNode(errorNode)} />;\n}\n\ntype ErrorItemContainerProps = {\n errorNode: TreeNode;\n message: string;\n actions?: { action: () => void; label: string; condition: () => boolean }[];\n} & Pick<MessageWithLinkProps, \"scrollToElement\">;\n\nfunction ErrorItemContainer({ errorNode, message, actions, scrollToElement }: ErrorItemContainerProps) {\n return (\n <ErrorRegion.Item\n message={<MessageWithLink linkLabel={errorNode.label} scrollToElement={scrollToElement} message={message} />}\n messageId={errorNode.id}\n actions={actions\n ?.filter(({ condition }) => condition())\n .map(({ label, action }) => (\n <Text key={label} variant=\"body-sm\">\n <Anchor onClick={action} render={<button />}>\n {label}\n </Anchor>\n </Text>\n ))}\n />\n );\n}\n\ninterface MessageWithLinkProps {\n scrollToElement: () => void;\n message: string;\n linkLabel?: string;\n}\n\nfunction MessageWithLink({ linkLabel, scrollToElement, message }: MessageWithLinkProps) {\n const splitMessage = message.split(\"{{node}}\", 2);\n return (\n <div style={{ display: \"flex\", whiteSpace: \"pre\", flexWrap: \"wrap\" }}>\n {splitMessage[0]}\n <Anchor onClick={scrollToElement} render={<button />}>\n {linkLabel}\n </Anchor>\n {splitMessage[1] ? splitMessage[1] : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoCA,SAAOqB,kBAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAA2B,MAAA,EAAAX,WAAAY,0BAAAN,sBAAAJ,YAAAG,iBAAAI;CAOhC,MAAAI,YAAkBrB,gBAAgB;AAElC,KAAIQ,UAASc,MAAMC,SAAU,qBAAmB;EAC9C,MAAAC,QAAchB,UAASc,MAAMG;EAAoB,IAAAC;AAAA,MAAAR,EAAA,OAAAV,UAAAmB,MAAAT,EAAA,OAAAE,0BAAA;AACzBM,cAAMN,yBAAyBZ,UAASmB,GAAkB,EAAAC,aAAC7B,mBAAmB;AAAAmB,KAAA,KAAAV,UAAAmB;AAAAT,KAAA,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A;GAAAqC,SAAW;GAAMC,YAAc;GAAKC,UAAY;GAAQ;AAAAnD,IAAA,KAAAY;OAAAA,MAAAZ,EAAA;CAAA,IAAAa;AAAA,KAAAb,EAAA,OAAA+C,OAAAC,IAAA,4BAAA,EAAA;AAExBnC,OAAA,oBAAA,aAAU;AAAAb,IAAA,KAAAa;OAAAA,MAAAb,EAAA;CAAA,IAAAgB;AAAA,KAAAhB,EAAA,OAAA2C,aAAA3C,EAAA,OAAAsC,iBAAA;AAApDtB,OAAA,oBAAC;GAAgBsB,SAAAA;GAAyB,QAAAzB;aACvC8B;IACM;AAAA3C,IAAA,KAAA2C;AAAA3C,IAAA,KAAAsC;AAAAtC,IAAA,KAAAgB;OAAAA,MAAAhB,EAAA;CACR,MAAAiB,KAAA6B,aAAY,KAAMA,aAAY,KAA9B;CAAwC,IAAAzB;AAAA,KAAArB,EAAA,OAAA8C,aAAA,MAAA9C,EAAA,OAAAgB,MAAAhB,EAAA,OAAAiB,IAAA;AAL3CI,OAAA,qBAAA;GAAY,OAAAT;;IACTkC,aAAY;IACb9B;IAGCC;;IACG;AAAAjB,IAAA,KAAA8C,aAAA;AAAA9C,IAAA,KAAAgB;AAAAhB,IAAA,KAAAiB;AAAAjB,IAAA,MAAAqB;OAAAA,MAAArB,EAAA;AAAA,QANNqB"}
1
+ {"version":3,"file":"ErrorItemRenderer.js","names":["Anchor","Text","unstable_ErrorRegion","ErrorRegion","MAX_LIMIT_OVERRIDE","useTranslation","JSX","useErrorNodes","HierarchyLevelDetails","TreeRendererProps","TreeNode","ErrorItemRendererProps","Pick","errorNode","ReturnType","reloadTree","options","parentNodeId","scrollToNode","filterHierarchyLevel","hierarchyLevelDetails","ErrorItemRenderer","t0","$","_c","getHierarchyLevelDetails","translate","error","type","limit","resultSetSizeLimit","t1","id","setSizeLimit","onOverrideLimit","t2","t3","replace","toString","t4","t5","action","label","condition","t6","t7","t8","isFilterable","t9","t10","t11","t12","t13","hierarchyLevelDetails_0","_temp","_temp2","message","ErrorItemContainerProps","actions","MessageWithLinkProps","ErrorItemContainer","scrollToElement","filter","_temp3","map","_temp4","linkLabel","MessageWithLink","split","splitMessage","Symbol","for","display","whiteSpace","flexWrap"],"sources":["../../../src/presentation-hierarchies-react/stratakit/ErrorItemRenderer.tsx"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Anchor, Text } from \"@stratakit/bricks\";\nimport { unstable_ErrorRegion as ErrorRegion } from \"@stratakit/structures\";\nimport { MAX_LIMIT_OVERRIDE } from \"../internal/Utils.js\";\nimport { useTranslation } from \"../LocalizationContext.js\";\n\nimport type { JSX } from \"react\";\nimport type { useErrorNodes } from \"../FlatTreeNode.js\";\nimport type { HierarchyLevelDetails, TreeRendererProps } from \"../Renderers.js\";\nimport type { TreeNode } from \"../TreeNode.js\";\n\n/** @alpha */\nexport interface ErrorItemRendererProps extends Pick<TreeRendererProps, \"getHierarchyLevelDetails\"> {\n /** A node containing an error. */\n errorNode: ReturnType<typeof useErrorNodes>[number];\n /** A callback to reload a hierarchy level when an error occurs and `retry` button is clicked. */\n reloadTree: (options: { parentNodeId: string | undefined }) => void;\n /** A callback to scroll to the node associated with the error. */\n scrollToNode: (errorNode: TreeNode) => void;\n /** A callback to initiate filtering of the given hierarchy level. */\n filterHierarchyLevel?: (hierarchyLevelDetails: HierarchyLevelDetails) => void;\n}\n\n/**\n * Renders StrataKit `<ErrorRegion.Item />` for all supported error types:\n * - `ResultSetTooLarge` - renders `resultLimitExceeded` message with actions to increase limit or apply filtering\n * - `NoFilterMatches` - renders `noFilteredChildren` message with action to change filter\n * - `ChildrenLoad` - renders `failedToCreateHierarchy` message with action to retry loading\n * - `Unknown` - renders message set on error object.\n *\n * @alpha\n */\nexport function ErrorItemRenderer({\n errorNode,\n getHierarchyLevelDetails,\n filterHierarchyLevel,\n reloadTree,\n scrollToNode,\n}: ErrorItemRendererProps): JSX.Element {\n const translate = useTranslation();\n\n if (errorNode.error.type === \"ResultSetTooLarge\") {\n const limit = errorNode.error.resultSetSizeLimit;\n const onOverrideLimit = () => getHierarchyLevelDetails(errorNode.id)?.setSizeLimit(MAX_LIMIT_OVERRIDE);\n return (\n <ErrorItemContainer\n errorNode={errorNode}\n actions={[\n {\n action: () => {\n onOverrideLimit();\n },\n label: translate(\"increaseHierarchyLimit\").replace(\"{{limit}}\", MAX_LIMIT_OVERRIDE.toString()),\n condition: () => limit < MAX_LIMIT_OVERRIDE,\n },\n {\n action: () => {\n const hierarchyLevelDetails = getHierarchyLevelDetails(errorNode.id);\n hierarchyLevelDetails && filterHierarchyLevel?.(hierarchyLevelDetails);\n },\n label: translate(\"increaseHierarchyLimitWithFiltering\"),\n condition: () => !!filterHierarchyLevel && !!errorNode.isFilterable,\n },\n ]}\n message={translate(\"resultLimitExceeded\").replace(\"{{limit}}\", limit.toString())}\n scrollToElement={() => scrollToNode(errorNode)}\n />\n );\n }\n if (errorNode.error.type === \"NoFilterMatches\") {\n return (\n <ErrorItemContainer\n errorNode={errorNode}\n actions={[\n {\n action: () => {\n const hierarchyLevelDetails = getHierarchyLevelDetails(errorNode.id);\n hierarchyLevelDetails && filterHierarchyLevel?.(hierarchyLevelDetails);\n },\n label: translate(\"noFilteredChildrenChangeFilter\"),\n condition: () => true,\n },\n ]}\n message={translate(\"noFilteredChildren\")}\n scrollToElement={() => scrollToNode(errorNode)}\n />\n );\n }\n if (errorNode.error.type === \"ChildrenLoad\") {\n return (\n <ErrorItemContainer\n errorNode={errorNode}\n actions={[\n {\n action: () => reloadTree({ parentNodeId: errorNode.id }),\n label: translate(\"retry\"),\n condition: () => true,\n },\n ]}\n message={translate(\"failedToCreateHierarchy\")}\n scrollToElement={() => scrollToNode(errorNode)}\n />\n );\n }\n\n return <ErrorItemContainer errorNode={errorNode} message={errorNode.error.message} scrollToElement={() => scrollToNode(errorNode)} />;\n}\n\ntype ErrorItemContainerProps = {\n errorNode: TreeNode;\n message: string;\n actions?: { action: () => void; label: string; condition: () => boolean }[];\n} & Pick<MessageWithLinkProps, \"scrollToElement\">;\n\nfunction ErrorItemContainer({ errorNode, message, actions, scrollToElement }: ErrorItemContainerProps) {\n return (\n <ErrorRegion.Item\n message={<MessageWithLink linkLabel={errorNode.label} scrollToElement={scrollToElement} message={message} />}\n messageId={errorNode.id}\n actions={actions\n ?.filter(({ condition }) => condition())\n .map(({ label, action }) => (\n <Text key={label} variant=\"body-sm\">\n <Anchor onClick={action} render={<button />}>\n {label}\n </Anchor>\n </Text>\n ))}\n />\n );\n}\n\ninterface MessageWithLinkProps {\n scrollToElement: () => void;\n message: string;\n linkLabel?: string;\n}\n\nfunction MessageWithLink({ linkLabel, scrollToElement, message }: MessageWithLinkProps) {\n const splitMessage = message.split(\"{{node}}\", 2);\n return (\n <div style={{ display: \"flex\", whiteSpace: \"pre\", flexWrap: \"wrap\" }}>\n {splitMessage[0]}\n <Anchor onClick={scrollToElement} render={<button />}>\n {linkLabel}\n </Anchor>\n {splitMessage[1] ? splitMessage[1] : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAoCA,SAAOqB,kBAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAA2B,MAAA,EAAAX,WAAAY,0BAAAN,sBAAAJ,YAAAG,iBAAAI;CAOhC,MAAAI,YAAkBrB,gBAAgB;AAElC,KAAIQ,UAASc,MAAMC,SAAU,qBAAmB;EAC9C,MAAAC,QAAchB,UAASc,MAAMG;EAAoB,IAAAC;AAAA,MAAAR,EAAA,OAAAV,UAAAmB,MAAAT,EAAA,OAAAE,0BAAA;AACzBM,cAAMN,yBAAyBZ,UAASmB,GAAkB,EAAAC,aAAC7B,mBAAmB;AAAAmB,KAAA,KAAAV,UAAAmB;AAAAT,KAAA,KAAAE;AAAAF,KAAA,KAAAQ;QAAAA,MAAAR,EAAA;EAAtG,MAAAW,kBAAwBH;EAA+E,IAA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A,4BAAA,EAAA;AAEpCpC,OAAA;GAAAqC,SAAW;GAAMC,YAAc;GAAKC,UAAY;GAAQ;AAAAnD,IAAA,KAAAY;OAAAA,MAAAZ,EAAA;CAAA,IAAAa;AAAA,KAAAb,EAAA,OAAA+C,OAAAC,IAAA,4BAAA,EAAA;AAExBnC,OAAA,oBAAA,UAAA,EAAU,CAAA;AAAAb,IAAA,KAAAa;OAAAA,MAAAb,EAAA;CAAA,IAAAgB;AAAA,KAAAhB,EAAA,OAAA2C,aAAA3C,EAAA,OAAAsC,iBAAA;AAApDtB,OAAA,oBAAC,QAAD;GAAiBsB,SAAAA;GAAyB,QAAAzB;aACvC8B;GACM,CAAA;AAAA3C,IAAA,KAAA2C;AAAA3C,IAAA,KAAAsC;AAAAtC,IAAA,KAAAgB;OAAAA,MAAAhB,EAAA;CACR,MAAAiB,KAAA6B,aAAY,KAAMA,aAAY,KAA9B;CAAwC,IAAAzB;AAAA,KAAArB,EAAA,OAAA8C,aAAA,MAAA9C,EAAA,OAAAgB,MAAAhB,EAAA,OAAAiB,IAAA;AAL3CI,OAAA,qBAAA,OAAA;GAAY,OAAAT;aAAZ;IACGkC,aAAY;IACb9B;IAGCC;IACG;;AAAAjB,IAAA,KAAA8C,aAAA;AAAA9C,IAAA,KAAAgB;AAAAhB,IAAA,KAAAiB;AAAAjB,IAAA,MAAAqB;OAAAA,MAAArB,EAAA;AAAA,QANNqB"}
@@ -1 +1 @@
1
- {"version":3,"file":"RootErrorRenderer.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/RootErrorRenderer.tsx"],"mappings":";;;;;;;AAiBA;KAAY,+BAAA;;;;EAIV,KAAA,EAAO,SAAA;AAAA,IACL,sBAAA;;;AAOJ;;;iBAAgB,0BAAA,CAAA;EAA6B,KAAA;EAAO,wBAAA;EAA0B;AAAA,GAAc,+BAAA,GAAkC,GAAA,CAAI,OAAA"}
1
+ {"version":3,"file":"RootErrorRenderer.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/RootErrorRenderer.tsx"],"mappings":";;;;;;;AAkBA;KAAY,+BAAA;;;;EAIV,KAAA,EAAO,SAAA;AAAA,IACL,sBAAA;;;AAOJ;;;iBAAgB,0BAAA,CAAA;EAA6B,KAAA;EAAO,wBAAA;EAA0B;AAAA,GAAc,+BAAA,GAAkC,GAAA,CAAI,OAAA"}
@@ -1,10 +1,9 @@
1
- import { useTranslation } from "./LocalizationContext.js";
1
+ import { useTranslation } from "../LocalizationContext.js";
2
2
  import { c } from "react-compiler-runtime";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { Button, Text } from "@stratakit/bricks";
5
5
  import { Icon } from "@stratakit/foundations";
6
6
  import errorSvg from "@stratakit/icons/status-error.svg";
7
-
8
7
  //#region src/presentation-hierarchies-react/stratakit/RootErrorRenderer.tsx
9
8
  /**
10
9
  * A component that renders root node error state.
@@ -180,7 +179,7 @@ function _temp3(t0) {
180
179
  const { condition } = t0;
181
180
  return condition();
182
181
  }
183
-
184
182
  //#endregion
185
183
  export { StrataKitRootErrorRenderer };
184
+
186
185
  //# sourceMappingURL=RootErrorRenderer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RootErrorRenderer.js","names":["Button","Text","Icon","errorSvg","useTranslation","JSX","RootErrorRendererProps","ErrorInfo","StrataKitRootErrorRendererProps","error","StrataKitRootErrorRenderer","t0","$","_c","getHierarchyLevelDetails","reloadTree","translate","type","t1","undefined","setSizeLimit","onOverrideLimit","t2","resultSetSizeLimit","replace","toString","t3","t4","action","label","condition","_temp","t5","parentNodeId","state","_temp2","RootErrorContainerProps","message","actions","RootErrorContainer","Symbol","for","height","display","flexDirection","justifyContent","alignItems","gap","textAlign","filter","_temp3","map","_temp4","t6"],"sources":["../../../src/presentation-hierarchies-react/stratakit/RootErrorRenderer.tsx"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Button, Text } from \"@stratakit/bricks\";\nimport { Icon } from \"@stratakit/foundations\";\nimport errorSvg from \"@stratakit/icons/status-error.svg\";\nimport { useTranslation } from \"./LocalizationContext.js\";\n\nimport type { JSX } from \"react\";\nimport type { RootErrorRendererProps } from \"../Renderers.js\";\nimport type { ErrorInfo } from \"../TreeNode.js\";\n\n/**\n * @alpha\n */\nexport type StrataKitRootErrorRendererProps = {\n /**\n * Root error to be displayed\n */\n error: ErrorInfo;\n} & RootErrorRendererProps;\n\n/**\n * A component that renders root node error state.\n *\n * @alpha\n */\nexport function StrataKitRootErrorRenderer({ error, getHierarchyLevelDetails, reloadTree }: StrataKitRootErrorRendererProps): JSX.Element {\n const translate = useTranslation();\n\n if (error.type === \"ResultSetTooLarge\") {\n const onOverrideLimit = () => getHierarchyLevelDetails(undefined)?.setSizeLimit(\"unbounded\");\n return (\n <RootErrorContainer\n message={translate(\"rootResultLimitExceeded\").replace(\"{{limit}}\", error.resultSetSizeLimit.toString())}\n actions={[\n {\n action: onOverrideLimit,\n label: translate(\"increaseHierarchyLimitToUnlimited\"),\n condition: () => true,\n },\n ]}\n />\n );\n }\n\n return (\n <RootErrorContainer\n message={translate(\"failedToCreateRootHierarchy\")}\n actions={[\n {\n action: () => reloadTree({ parentNodeId: undefined, state: \"reset\" }),\n label: translate(\"retry\"),\n condition: () => true,\n },\n ]}\n />\n );\n}\n\ninterface RootErrorContainerProps {\n message: string;\n actions?: { action: () => void; label: string; condition: () => boolean }[];\n}\n\nfunction RootErrorContainer({ actions, message }: RootErrorContainerProps) {\n return (\n <div style={{ height: \"100%\", display: \"flex\", flexDirection: \"column\", justifyContent: \"center\", alignItems: \"center\", gap: \"0.5rem\" }}>\n <Icon href={errorSvg} size=\"large\" />\n <Text variant={\"body-sm\"} style={{ textAlign: \"center\" }}>\n {message}\n </Text>\n {actions\n ?.filter(({ condition }) => condition())\n .map((action) => {\n return (\n <Button key={action.label} onClick={() => action.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kB;GAAQC,YAAc;GAAQC,KAAO;GAAU;AACrIzB,OAAA,oBAAC;GAAWnB,MAAAA;GAAe,MAAA;IAAU;AAAAS,IAAA,KAAAM;AAAAN,IAAA,KAAAU;QAAA;AAAAJ,OAAAN,EAAA;AAAAU,OAAAV,EAAA;;CAAA,IAAAc;AAAA,KAAAd,EAAA,OAAA4B,OAAAC,IAAA,4BAAA,EAAA;AACJf,OAAA,EAAAsB,WAAa,UAAU;AAAApC,IAAA,KAAAc;OAAAA,MAAAd,EAAA;CAAA,IAAAe;AAAA,KAAAf,EAAA,OAAAyB,SAAA;AAAxDV,OAAA,oBAAC;GAAc,SAAA;GAAkB,OAAAD;aAC9BW;IACI;AAAAzB,IAAA,KAAAyB;AAAAzB,IAAA,KAAAe;OAAAA,MAAAf,EAAA;CAAA,IAAAoB;AAAA,KAAApB,EAAA,OAAA0B,SAAA;AACNN,OAAAM,SAAOW,OACGC,OACL,CAAAC,IAACC,OAMH;AAAAxC,IAAA,KAAA0B;AAAA1B,IAAA,KAAAoB;OAAAA,MAAApB,EAAA;CAAA,IAAAyC;AAAA,KAAAzC,EAAA,OAAAe,MAAAf,EAAA,OAAAoB,IAAA;AAbNqB,OAAA,qBAAA;GAAY,OAAAnC;;IACVI;IACAK;IAGCK;;IASG;AAAApB,IAAA,KAAAe;AAAAf,IAAA,KAAAoB;AAAApB,IAAA,KAAAyC;OAAAA,MAAAzC,EAAA;AAAA,QAdNyC;;AAFJ,SAAAD,OAAAxB,QAAA;AAAA,QAWY,oBAAC;EAAmC,eAAMA,OAAMA,QAAQ;YACrDA,OAAMC;IADID,OAAMC,MAEV;;AAbrB,SAAAqB,OAAAvC,IAAA;CAQkB,MAAA,EAAAmB,cAAAnB;AAAa,QAAKmB,WAAW"}
1
+ {"version":3,"file":"RootErrorRenderer.js","names":["Button","Text","Icon","useTranslation","errorSvg","JSX","RootErrorRendererProps","ErrorInfo","StrataKitRootErrorRendererProps","error","StrataKitRootErrorRenderer","t0","$","_c","getHierarchyLevelDetails","reloadTree","translate","type","t1","undefined","setSizeLimit","onOverrideLimit","t2","resultSetSizeLimit","replace","toString","t3","t4","action","label","condition","_temp","t5","parentNodeId","state","_temp2","RootErrorContainerProps","message","actions","RootErrorContainer","Symbol","for","height","display","flexDirection","justifyContent","alignItems","gap","textAlign","filter","_temp3","map","_temp4","t6"],"sources":["../../../src/presentation-hierarchies-react/stratakit/RootErrorRenderer.tsx"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Button, Text } from \"@stratakit/bricks\";\nimport { Icon } from \"@stratakit/foundations\";\nimport { useTranslation } from \"../LocalizationContext.js\";\n\nimport errorSvg from \"@stratakit/icons/status-error.svg\";\n\nimport type { JSX } from \"react\";\nimport type { RootErrorRendererProps } from \"../Renderers.js\";\nimport type { ErrorInfo } from \"../TreeNode.js\";\n\n/**\n * @alpha\n */\nexport type StrataKitRootErrorRendererProps = {\n /**\n * Root error to be displayed\n */\n error: ErrorInfo;\n} & RootErrorRendererProps;\n\n/**\n * A component that renders root node error state.\n *\n * @alpha\n */\nexport function StrataKitRootErrorRenderer({ error, getHierarchyLevelDetails, reloadTree }: StrataKitRootErrorRendererProps): JSX.Element {\n const translate = useTranslation();\n\n if (error.type === \"ResultSetTooLarge\") {\n const onOverrideLimit = () => getHierarchyLevelDetails(undefined)?.setSizeLimit(\"unbounded\");\n return (\n <RootErrorContainer\n message={translate(\"rootResultLimitExceeded\").replace(\"{{limit}}\", error.resultSetSizeLimit.toString())}\n actions={[\n {\n action: onOverrideLimit,\n label: translate(\"increaseHierarchyLimitToUnlimited\"),\n condition: () => true,\n },\n ]}\n />\n );\n }\n\n return (\n <RootErrorContainer\n message={translate(\"failedToCreateRootHierarchy\")}\n actions={[\n {\n action: () => reloadTree({ parentNodeId: undefined, state: \"reset\" }),\n label: translate(\"retry\"),\n condition: () => true,\n },\n ]}\n />\n );\n}\n\ninterface RootErrorContainerProps {\n message: string;\n actions?: { action: () => void; label: string; condition: () => boolean }[];\n}\n\nfunction RootErrorContainer({ actions, message }: RootErrorContainerProps) {\n return (\n <div style={{ height: \"100%\", display: \"flex\", flexDirection: \"column\", justifyContent: \"center\", alignItems: \"center\", gap: \"0.5rem\" }}>\n <Icon href={errorSvg} size=\"large\" />\n <Text variant={\"body-sm\"} style={{ textAlign: \"center\" }}>\n {message}\n </Text>\n {actions\n ?.filter(({ condition }) => condition())\n .map((action) => {\n return (\n <Button key={action.label} onClick={() => action.action()}>\n {action.label}\n </Button>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA8BA,SAAOU,2BAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAAoC,MAAA,EAAAJ,OAAAK,0BAAAC,eAAAJ;CACzC,MAAAK,YAAkBb,gBAAgB;AAElC,KAAIM,MAAKQ,SAAU,qBAAmB;EAAA,IAAAC;AAAA,MAAAN,EAAA,OAAAE,0BAAA;AACZI,cAAMJ,yBAAyBK,KAAAA,EAAwB,EAAAC,aAAC,YAAY;AAAAR,KAAA,KAAAE;AAAAF,KAAA,KAAAM;QAAAA,MAAAN,EAAA;EAA5F,MAAAS,kBAAwBH;EAAqE,IAAAI;AAAA,MAAAV,EAAA,OAAAH,MAAAc,sBAAAX,EAAA,OAAAI,WAAA;AAGhFM,QAAAN,UAAU,0BAA0B,CAAAQ,QAAS,aAAaf,MAAKc,mBAAmBE,UAAW,CAAC;AAAAb,KAAA,KAAAH,MAAAc;AAAAX,KAAA,KAAAI;AAAAJ,KAAA,KAAAU;QAAAA,MAAAV,EAAA;EAAA,IAAAc;AAAA,MAAAd,EAAA,OAAAI,WAAA;AAI5FU,QAAAV,UAAU,oCAAoC;AAAAJ,KAAA,KAAAI;AAAAJ,KAAA,KAAAc;QAAAA,MAAAd,EAAA;EAAA,IAAAe;AAAA,MAAAf,EAAA,OAAAS,mBAAAT,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G;;AAAApB,IAAA,KAAAe;AAAAf,IAAA,KAAAoB;AAAApB,IAAA,KAAAyC;OAAAA,MAAAzC,EAAA;AAAA,QAdNyC;;AAFJ,SAAAD,OAAAxB,QAAA;AAAA,QAWY,oBAAC,QAAD;EAAoC,eAAMA,OAAMA,QAAQ;YACrDA,OAAMC;EACA,EAFID,OAAMC,MAEV;;AAbrB,SAAAqB,OAAAvC,IAAA;CAQkB,MAAA,EAAAmB,cAAAnB;AAAa,QAAKmB,WAAW"}
@@ -2,7 +2,6 @@ import { c } from "react-compiler-runtime";
2
2
  import { memo } from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { DropdownMenu, Tree } from "@stratakit/structures";
5
-
6
5
  //#region src/presentation-hierarchies-react/stratakit/TreeAction.tsx
7
6
  /**
8
7
  * Base component used to render tree actions. It is designed to allow rendering same action in different contexts: inline, dropdown, context menu.
@@ -83,7 +82,7 @@ const TreeActionBase = memo(function TreeActionBase(t0) {
83
82
  } else t3 = $[14];
84
83
  return t3;
85
84
  });
86
-
87
85
  //#endregion
88
86
  export { TreeActionBase };
87
+
89
88
  //# sourceMappingURL=TreeAction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreeAction.js","names":["memo","DropdownMenu","Tree","ComponentProps","NamedExoticComponent","TreeActionBaseAttributes","variant","hide","TreeActionBaseProps","ItemAction","TreeActionBase","t0","$","_c","actionProps","dot","t1","visible","undefined","t2","t3"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeAction.tsx"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { memo } from \"react\";\nimport { DropdownMenu, Tree } from \"@stratakit/structures\";\n\nimport type { ComponentProps, NamedExoticComponent } from \"react\";\n\n/**\n * Attributes used to decide how to render tree actions. They allow to differentiate action style based on the context\n * where that action is used.\n * @alpha\n */\nexport interface TreeActionBaseAttributes {\n /**\n * Specifies action variant supported by tree nodes:\n *\n * - \"default\" - standard action displayed in the dropdown menu accessible through the ellipsis button on the node.\n * - \"inline\" - actions displayed directly on the tree node.\n * - \"context-menu\" - actions displayed in the context menu opened by right-clicking the tree node.\n */\n variant?: \"default\" | \"inline\" | \"context-menu\";\n /**\n * Indicates that the actions is not applicable for current tree node and should be hidden.\n * When set to true, the action will not be rendered at all.\n */\n hide?: boolean;\n}\n\n/** @alpha */\nexport type TreeActionBaseProps = ComponentProps<typeof Tree.ItemAction> & TreeActionBaseAttributes;\n\n/**\n * Base component used to render tree actions. It is designed to allow rendering same action in different contexts: inline, dropdown, context menu.\n * Should be used together with `StrataKitTreeNodeRenderer` and returned from `getInlineActions`, `getMenuActions` and `getContextMenuActions` callbacks.\n *\n * When implementing custom action that returns this component, make sure to forward `TreeActionBaseAttributes` props to it. Example:\n *\n * ```tsx\n * interface MyCustomTreeActionProps extends TreeActionBaseAttributes {\n * myProp: string\n * }\n *\n * function MyCustomTreeAction({ myProp, ...attributes }: MyCustomTreeActionProps) {\n * // custom button logic goes here\n * return <TreeActionBase {...attributes} icon={...} onClick={...} />\n * }\n * ```\n *\n * @alpha\n */\nexport const TreeActionBase: NamedExoticComponent<TreeActionBaseProps> = memo(function TreeActionBase({\n hide,\n variant = \"default\",\n dot,\n visible,\n ...actionProps\n}: TreeActionBaseProps) {\n if (hide) {\n return variant === \"inline\" ? <Tree.ItemAction {...actionProps} visible={false} /> : undefined;\n }\n\n if (variant === \"context-menu\") {\n return <DropdownMenu.Item {...actionProps} />;\n }\n\n return <Tree.ItemAction {...actionProps} dot={dot} visible={variant === \"inline\" ? visible : undefined} />;\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAaU,iBAA4DV,KAAK,SAAAU,eAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAR;CAAA,IAAAS;CAAA,IAAAC;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ponent","TreeActionBaseAttributes","variant","hide","TreeActionBaseProps","ItemAction","TreeActionBase","t0","$","_c","actionProps","dot","t1","visible","undefined","t2","t3"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeAction.tsx"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { memo } from \"react\";\nimport { DropdownMenu, Tree } from \"@stratakit/structures\";\n\nimport type { ComponentProps, NamedExoticComponent } from \"react\";\n\n/**\n * Attributes used to decide how to render tree actions. They allow to differentiate action style based on the context\n * where that action is used.\n * @alpha\n */\nexport interface TreeActionBaseAttributes {\n /**\n * Specifies action variant supported by tree nodes:\n *\n * - \"default\" - standard action displayed in the dropdown menu accessible through the ellipsis button on the node.\n * - \"inline\" - actions displayed directly on the tree node.\n * - \"context-menu\" - actions displayed in the context menu opened by right-clicking the tree node.\n */\n variant?: \"default\" | \"inline\" | \"context-menu\";\n /**\n * Indicates that the actions is not applicable for current tree node and should be hidden.\n * When set to true, the action will not be rendered at all.\n */\n hide?: boolean;\n}\n\n/** @alpha */\nexport type TreeActionBaseProps = ComponentProps<typeof Tree.ItemAction> & TreeActionBaseAttributes;\n\n/**\n * Base component used to render tree actions. It is designed to allow rendering same action in different contexts: inline, dropdown, context menu.\n * Should be used together with `StrataKitTreeNodeRenderer` and returned from `getInlineActions`, `getMenuActions` and `getContextMenuActions` callbacks.\n *\n * When implementing custom action that returns this component, make sure to forward `TreeActionBaseAttributes` props to it. Example:\n *\n * ```tsx\n * interface MyCustomTreeActionProps extends TreeActionBaseAttributes {\n * myProp: string\n * }\n *\n * function MyCustomTreeAction({ myProp, ...attributes }: MyCustomTreeActionProps) {\n * // custom button logic goes here\n * return <TreeActionBase {...attributes} icon={...} onClick={...} />\n * }\n * ```\n *\n * @alpha\n */\nexport const TreeActionBase: NamedExoticComponent<TreeActionBaseProps> = memo(function TreeActionBase({\n hide,\n variant = \"default\",\n dot,\n visible,\n ...actionProps\n}: TreeActionBaseProps) {\n if (hide) {\n return variant === \"inline\" ? <Tree.ItemAction {...actionProps} visible={false} /> : undefined;\n }\n\n if (variant === \"context-menu\") {\n return <DropdownMenu.Item {...actionProps} />;\n }\n\n return <Tree.ItemAction {...actionProps} dot={dot} visible={variant === \"inline\" ? visible : undefined} />;\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAaU,iBAA4DV,KAAK,SAAAU,eAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAR;CAAA,IAAAS;CAAA,IAAAC;AAAA,KAAAL,EAAA,OAAAD,IAAA;AAAwB,GAAA,CAAAJ,MAAAD,SAAAU,IAAAD,KAAAE,YAAAH,eAAAH;AAMhFC,IAAA,KAAAD;AAAAC,IAAA,KAAAE;AAAAF,IAAA,KAAAG;AAAAH,IAAA,KAAAL;AAAAK,IAAA,KAAAI;AAAAJ,IAAA,KAAAK;QAAA;AAAAH,gBAAAF,EAAA;AAAAG,QAAAH,EAAA;AAAAL,SAAAK,EAAA;AAAAI,OAAAJ,EAAA;AAAAK,YAAAL,EAAA;;CAJpB,MAAAN,UAAAU,OAAAE,KAAAA,IAAA,YAAAF;AAKA,KAAIT,MAAI;EAAA,IAAAY;AAAA,MAAAP,EAAA,OAAAE,eAAAF,EAAA,OAAAN,SAAA;AACCa,QAAAb,YAAY,WAAW,oBAAA,KAAA,YAAA;IAAA,GAAqBQ;IAAsB,SAAA;IAAqB,CAAA,GAAvFI,KAAAA;AAAuFN,KAAA,KAAAE;AAAAF,KAAA,KAAAN;AAAAM,KAAA,KAAAO;QAAAA,MAAAP,EAAA;AAAA,SAAvFO;;AAGT,KAAIb,YAAY,gBAAc;EAAA,IAAAa;AAAA,MAAAP,EAAA,OAAAE,aAAA;AACrBK,QAAA,oBAAA,aAAA,MAAA,EAAA,GAAuBL,aAAe,CAAA;AAAAF,KAAA,KAAAE;AAAAF,KAAA,MAAAO;QAAAA,MAAAP,EAAA;AAAA,SAAtCO;;CAGmD,MAAAA,KAAAb,YAAY,WAAZW,UAAAC,KAAAA;CAA0C,IAAAE;AAAA,KAAAR,EAAA,QAAAE,eAAAF,EAAA,QAAAG,OAAAH,EAAA,QAAAO,IAAA;AAA/FC,OAAA,oBAAA,KAAA,YAAA;GAAA,GAAqBN;GAAkBC;GAAc,SAAAI;GAA8C,CAAA;AAAAP,IAAA,MAAAE;AAAAF,IAAA,MAAAG;AAAAH,IAAA,MAAAO;AAAAP,IAAA,MAAAQ;OAAAA,MAAAR,EAAA;AAAA,QAAnGQ;EACP"}
@@ -1,4 +1,4 @@
1
- import { useErrorNodes } from "./FlatTreeNode.js";
1
+ import { useErrorNodes } from "../FlatTreeNode.js";
2
2
  import { ErrorItemRendererProps } from "./ErrorItemRenderer.js";
3
3
  import { JSX, ReactElement } from "react";
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"TreeErrorRenderer.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeErrorRenderer.tsx"],"mappings":";;;;;;;AAYuD;;;UAO7C,yBAAA;EAOI;;;;EAFZ,SAAA;EAAA;EAEA,UAAA,EAAY,UAAA,QAAkB,aAAA;EAAlB;EAEZ,WAAA,IAAe,KAAA,EAAO,sBAAA,KAA2B,YAAA;AAAA;;KAIvC,sBAAA,GAAyB,yBAAA,GAA4B,IAAA,CAAK,sBAAA;;;;AAAtE;;;iBAQgB,iBAAA,CAAA;EAAoB,SAAA;EAAW,UAAA;EAAY,WAAA;EAAA,GAAgB;AAAA,GAA0B,sBAAA,GAAyB,GAAA,CAAI,OAAA"}
1
+ {"version":3,"file":"TreeErrorRenderer.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeErrorRenderer.tsx"],"mappings":";;;;;;;AAYqE;;;UAO3D,yBAAA;EAOI;;;;EAFZ,SAAA;EAAA;EAEA,UAAA,EAAY,UAAA,QAAkB,aAAA;EAAlB;EAEZ,WAAA,IAAe,KAAA,EAAO,sBAAA,KAA2B,YAAA;AAAA;;KAIvC,sBAAA,GAAyB,yBAAA,GAA4B,IAAA,CAAK,sBAAA;;;;AAAtE;;;iBAQgB,iBAAA,CAAA;EAAoB,SAAA;EAAW,UAAA;EAAY,WAAA;EAAA,GAAgB;AAAA,GAA0B,sBAAA,GAAyB,GAAA,CAAI,OAAA"}
@@ -1,10 +1,9 @@
1
- import { useTranslation } from "./LocalizationContext.js";
1
+ import { useTranslation } from "../LocalizationContext.js";
2
2
  import { ErrorItemRenderer } from "./ErrorItemRenderer.js";
3
3
  import { c } from "react-compiler-runtime";
4
4
  import { cloneElement } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import { unstable_ErrorRegion } from "@stratakit/structures";
7
-
8
7
  //#region src/presentation-hierarchies-react/stratakit/TreeErrorRenderer.tsx
9
8
  /**
10
9
  * A component that renders error display dropdown using the `unstable_ErrorRegion` component from `@stratakit/structures`.
@@ -58,7 +57,7 @@ function TreeErrorRenderer(t0) {
58
57
  } else t4 = $[10];
59
58
  return t4;
60
59
  }
61
-
62
60
  //#endregion
63
61
  export { TreeErrorRenderer };
62
+
64
63
  //# sourceMappingURL=TreeErrorRenderer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreeErrorRenderer.js","names":["cloneElement","unstable_ErrorRegion","ErrorRegion","ErrorItemRenderer","useTranslation","JSX","ReactElement","ErrorItemRendererProps","useErrorNodes","TreeErrorRendererOwnProps","treeLabel","errorNodes","ReturnType","renderError","props","TreeErrorRendererProps","Omit","TreeErrorRenderer","t0","$","_c","errorItemRendererProps","translate","errorItems","map","errorNode","errorRendererProps","key","id","t1","Symbol","for","width","t2","replace","t3","length","toString","t4"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeErrorRenderer.tsx"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { cloneElement } from \"react\";\nimport { unstable_ErrorRegion as ErrorRegion } from \"@stratakit/structures\";\nimport { ErrorItemRenderer } from \"./ErrorItemRenderer.js\";\nimport { useTranslation } from \"./LocalizationContext.js\";\n\nimport type { JSX, ReactElement } from \"react\";\nimport type { ErrorItemRendererProps } from \"./ErrorItemRenderer.js\";\nimport type { useErrorNodes } from \"./FlatTreeNode.js\";\n\n/**\n * Interface containing building blocks for `TreeErrorRenderer`.\n *\n * @alpha\n */\ninterface TreeErrorRendererOwnProps {\n /**\n * A user friendly display label of the tree. Should be unique within the consuming application,\n * as it's used for creating a unique accessible label for the error region.\n */\n treeLabel: string;\n /** List of error nodes to render errors for. */\n errorNodes: ReturnType<typeof useErrorNodes>;\n /** Callback to render custom error messages. Component should be wrapped in `unstable_ErrorRegion.Item` from `@stratakit/structures` package. */\n renderError?: (props: ErrorItemRendererProps) => ReactElement;\n}\n\n/** @alpha */\nexport type TreeErrorRendererProps = TreeErrorRendererOwnProps & Omit<ErrorItemRendererProps, \"errorNode\">;\n\n/**\n * A component that renders error display dropdown using the `unstable_ErrorRegion` component from `@stratakit/structures`.\n * As input, the component uses a list of `ErrorNode` objects, which are generally created using the `useErrorNodes` hook.\n *\n * @alpha\n */\nexport function TreeErrorRenderer({ treeLabel, errorNodes, renderError, ...errorItemRendererProps }: TreeErrorRendererProps): JSX.Element {\n const translate = useTranslation();\n const errorItems = errorNodes.map((errorNode) => {\n const errorRendererProps: ErrorItemRendererProps = {\n errorNode,\n ...errorItemRendererProps,\n };\n\n if (renderError) {\n return cloneElement(renderError(errorRendererProps), { key: errorNode.id });\n }\n\n return <ErrorItemRenderer key={errorNode.id} {...errorRendererProps} />;\n });\n\n return (\n <ErrorRegion.Root\n style={{ width: \"100%\" }}\n aria-label={translate(\"issuesForTree\").replace(\"{{tree_label}}\", treeLabel)}\n label={errorNodes.length === 0 ? translate(\"noIssuesFound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A;AAHtJG,OAAA,oBAAA,qBAAA;GACS,OAAAT;GACK,cAAAI;GACL,OAAAE;GACAZ,OAAAA;IACP;AAAAJ,IAAA,KAAAI;AAAAJ,IAAA,KAAAc;AAAAd,IAAA,KAAAgB;AAAAhB,IAAA,MAAAmB;OAAAA,MAAAnB,EAAA;AAAA,QALFmB"}
1
+ {"version":3,"file":"TreeErrorRenderer.js","names":["cloneElement","unstable_ErrorRegion","ErrorRegion","useTranslation","ErrorItemRenderer","JSX","ReactElement","useErrorNodes","ErrorItemRendererProps","TreeErrorRendererOwnProps","treeLabel","errorNodes","ReturnType","renderError","props","TreeErrorRendererProps","Omit","TreeErrorRenderer","t0","$","_c","errorItemRendererProps","translate","errorItems","map","errorNode","errorRendererProps","key","id","t1","Symbol","for","width","t2","replace","t3","length","toString","t4"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeErrorRenderer.tsx"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { cloneElement } from \"react\";\nimport { unstable_ErrorRegion as ErrorRegion } from \"@stratakit/structures\";\nimport { useTranslation } from \"../LocalizationContext.js\";\nimport { ErrorItemRenderer } from \"./ErrorItemRenderer.js\";\n\nimport type { JSX, ReactElement } from \"react\";\nimport type { useErrorNodes } from \"../FlatTreeNode.js\";\nimport type { ErrorItemRendererProps } from \"./ErrorItemRenderer.js\";\n\n/**\n * Interface containing building blocks for `TreeErrorRenderer`.\n *\n * @alpha\n */\ninterface TreeErrorRendererOwnProps {\n /**\n * A user friendly display label of the tree. Should be unique within the consuming application,\n * as it's used for creating a unique accessible label for the error region.\n */\n treeLabel: string;\n /** List of error nodes to render errors for. */\n errorNodes: ReturnType<typeof useErrorNodes>;\n /** Callback to render custom error messages. Component should be wrapped in `unstable_ErrorRegion.Item` from `@stratakit/structures` package. */\n renderError?: (props: ErrorItemRendererProps) => ReactElement;\n}\n\n/** @alpha */\nexport type TreeErrorRendererProps = TreeErrorRendererOwnProps & Omit<ErrorItemRendererProps, \"errorNode\">;\n\n/**\n * A component that renders error display dropdown using the `unstable_ErrorRegion` component from `@stratakit/structures`.\n * As input, the component uses a list of `ErrorNode` objects, which are generally created using the `useErrorNodes` hook.\n *\n * @alpha\n */\nexport function TreeErrorRenderer({ treeLabel, errorNodes, renderError, ...errorItemRendererProps }: TreeErrorRendererProps): JSX.Element {\n const translate = useTranslation();\n const errorItems = errorNodes.map((errorNode) => {\n const errorRendererProps: ErrorItemRendererProps = {\n errorNode,\n ...errorItemRendererProps,\n };\n\n if (renderError) {\n return cloneElement(renderError(errorRendererProps), { key: errorNode.id });\n }\n\n return <ErrorItemRenderer key={errorNode.id} {...errorRendererProps} />;\n });\n\n return (\n <ErrorRegion.Root\n style={{ width: \"100%\" }}\n aria-label={translate(\"issuesForTree\").replace(\"{{tree_label}}\", treeLabel)}\n label={errorNodes.length === 0 ? translate(\"noIssuesFound\") : translate(\"issuesFound\").replace(\"{{number_of_issues}}\", errorNodes.length.toString())}\n items={errorItems}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAwCA,SAAOiB,kBAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAA2B,MAAA,EAAAV,WAAAC,YAAAE,aAAA,GAAAQ,2BAAAH;CAChC,MAAAI,YAAkBnB,gBAAgB;CAClC,MAAAoB,aAAmBZ,WAAUa,KAAKC,cAAA;EAChC,MAAAC,qBAAmD;GAAAD;GAAA,GAE9CJ;GACJ;AAED,MAAIR,YAAW,QACNb,aAAaa,YAAYa,mBAAmB,EAAE,EAAAC,KAAOF,UAASG,IAAK,CAAC;AAC5E,SAEM,oBAAC,mBAAD,EAAoC,GAAMF,oBAAsB,EAAxCD,UAASG,GAA+B;GACvE;CAAC,IAAAC;AAAA,KAAAV,EAAA,OAAAW,OAAAC,IAAA,4BAAA,EAAA;AAIQF,OAAA,EAAAG,OAAS,QAAQ;AAAAb,IAAA,KAAAU;OAAAA,MAAAV,EAAA;CAAA,IAAAc;AAAA,KAAAd,EAAA,OAAAG,aAAAH,EAAA,OAAAT,WAAA;AACZuB,OAAAX,UAAU,gBAAgB,CAAAY,QAAS,kBAAkBxB,UAAU;AAAAS,IAAA,KAAAG;AAAAH,IAAA,KAAAT;AAAAS,IAAA,KAAAc;OAAAA,MAAAd,EAAA;CAAA,IAAAgB;AAAA,KAAAhB,EAAA,OAAAR,WAAAyB,UAAAjB,EAAA,OAAAG,WAAA;AACpEa,OAAAxB,WAAUyB,WAAY,IAAId,UAAU,gBAAyG,GAAtFA,UAAU,cAAc,CAAAY,QAAS,wBAAwBvB,WAAUyB,OAAOC,UAAW,CAAC;AAAAlB,IAAA,KAAAR,WAAAyB;AAAAjB,IAAA,KAAAG;AAAAH,IAAA,KAAAgB;OAAAA,MAAAhB,EAAA;CAAA,IAAAmB;AAAA,KAAAnB,EAAA,OAAAI,cAAAJ,EAAA,OAAAc,MAAAd,EAAA,OAAAgB,IAAA;AAHtJG,OAAA,oBAAA,qBAAA,MAAA;GACS,OAAAT;GACK,cAAAI;GACL,OAAAE;GACAZ,OAAAA;GACP,CAAA;AAAAJ,IAAA,KAAAI;AAAAJ,IAAA,KAAAc;AAAAd,IAAA,KAAAgB;AAAAhB,IAAA,MAAAmB;OAAAA,MAAAnB,EAAA;AAAA,QALFmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"TreeNodeFilterAction.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.tsx"],"mappings":";;;;;;;KAgBK,yBAAA;EAAA;;;EAIH,QAAA,IAAY,qBAAA,EAAuB,qBAAA;AAAA,IACjC,wBAAA,GACF,IAAA,CAAK,iBAAA;;;;;;;;;;;cAYM,oBAAA,EAAsB,oBAAA,CAAqB,yBAAA;EAA8B,IAAA,EAAM,QAAA;AAAA"}
1
+ {"version":3,"file":"TreeNodeFilterAction.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.tsx"],"mappings":";;;;;;;KAiBK,yBAAA;EAAA;;;EAIH,QAAA,IAAY,qBAAA,EAAuB,qBAAA;AAAA,IACjC,wBAAA,GACF,IAAA,CAAK,iBAAA;;;;;;;;;;;cAYM,oBAAA,EAAsB,oBAAA,CAAqB,yBAAA;EAA8B,IAAA,EAAM,QAAA;AAAA"}
@@ -1,10 +1,9 @@
1
- import { useTranslation } from "./LocalizationContext.js";
1
+ import { useTranslation } from "../LocalizationContext.js";
2
2
  import { TreeActionBase } from "./TreeAction.js";
3
3
  import { c } from "react-compiler-runtime";
4
4
  import { memo } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import filterSvg from "@stratakit/icons/filter.svg";
7
-
8
7
  //#region src/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.tsx
9
8
  /**
10
9
  * React component that renders a filter action for a tree item.
@@ -86,7 +85,7 @@ const TreeNodeFilterAction = memo(function TreeNodeFilterAction(t0) {
86
85
  } else t7 = $[19];
87
86
  return t7;
88
87
  });
89
-
90
88
  //#endregion
91
89
  export { TreeNodeFilterAction };
90
+
92
91
  //# sourceMappingURL=TreeNodeFilterAction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreeNodeFilterAction.js","names":["memo","useCallback","filterSvg","useTranslation","TreeActionBase","NamedExoticComponent","HierarchyLevelDetails","TreeRendererProps","TreeNode","TreeActionBaseAttributes","TreeNodeFilterActionProps","onFilter","hierarchyLevelDetails","Pick","TreeNodeFilterAction","node","t0","$","_c","actionAttributes","getHierarchyLevelDetails","translate","t1","filterHierarchyLevel","t2","filterHierarchyLevelActiveDescription","t3","id","handleClick","t4","isFiltered","undefined","t5","t6","isFilterable","t7"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.tsx"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { memo, useCallback } from \"react\";\nimport filterSvg from \"@stratakit/icons/filter.svg\";\nimport { useTranslation } from \"./LocalizationContext.js\";\nimport { TreeActionBase } from \"./TreeAction.js\";\n\nimport type { NamedExoticComponent } from \"react\";\nimport type { HierarchyLevelDetails, TreeRendererProps } from \"../Renderers.js\";\nimport type { TreeNode } from \"../TreeNode.js\";\nimport type { TreeActionBaseAttributes } from \"./TreeAction.js\";\n\n/** @alpha */\ntype TreeNodeFilterActionProps = {\n /**\n * Action to perform when the filter button is clicked for this node.\n */\n onFilter?: (hierarchyLevelDetails: HierarchyLevelDetails) => void;\n} & TreeActionBaseAttributes &\n Pick<TreeRendererProps, \"getHierarchyLevelDetails\">;\n\n/**\n * React component that renders a filter action for a tree item.\n *\n * The action calls the `onFilter` callback prop when clicked.\n *\n * @see `getMenuActions`, `getInlineActions`, `getContextMenuActions` props of `TreeRenderer` to add this action\n * to tree items.\n *\n * @alpha\n */\nexport const TreeNodeFilterAction: NamedExoticComponent<TreeNodeFilterActionProps & { node: TreeNode }> = memo(function TreeNodeFilterAction({\n node,\n onFilter,\n getHierarchyLevelDetails,\n ...actionAttributes\n}: TreeNodeFilterActionProps & { node: TreeNode }) {\n const translate = useTranslation();\n const filterHierarchyLevel = translate(\"filterHierarchyLevel\");\n const filterHierarchyLevelActiveDescription = translate(\"filterHierarchyLevelActiveDescription\");\n\n const handleClick = useCallback(() => {\n const hierarchyLevelDetails = getHierarchyLevelDetails(node.id);\n hierarchyLevelDetails && onFilter?.(hierarchyLevelDetails);\n }, [node, getHierarchyLevelDetails, onFilter]);\n\n return (\n <TreeActionBase\n {...actionAttributes}\n label={filterHierarchyLevel}\n onClick={handleClick}\n icon={filterSvg}\n visible={node.isFiltered ? true : undefined}\n dot={node.isFiltered ? filterHierarchyLevelActiveDescription : undefined}\n hide={!onFilter || !node.isFilterable}\n />\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkCA,MAAac,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AAAC;AAAA,KAAAlB,EAAA,QAAAE,oBAAAF,EAAA,QAAAM,wBAAAN,EAAA,QAAAW,eAAAX,EAAA,QAAAY,MAAAZ,EAAA,QAAAe,MAAAf,EAAA,QAAAgB,IAAA;AAPvCE,OAAA,oBAAC;GAAc,GACThB;GACGI,OAAAA;GACEK,SAAAA;GACH1B,MAAAA;GACG,SAAA2B;GACJ,KAAAG;GACC,MAAAC;IACN;AAAAhB,IAAA,MAAAE;AAAAF,IAAA,MAAAM;AAAAN,IAAA,MAAAW;AAAAX,IAAA,MAAAY;AAAAZ,IAAA,MAAAe;AAAAf,IAAA,MAAAgB;AAAAhB,IAAA,MAAAkB;OAAAA,MAAAlB,EAAA;AAAA,QARFkB;EAUF"}
1
+ {"version":3,"file":"TreeNodeFilterAction.js","names":["memo","useCallback","useTranslation","TreeActionBase","filterSvg","NamedExoticComponent","HierarchyLevelDetails","TreeRendererProps","TreeNode","TreeActionBaseAttributes","TreeNodeFilterActionProps","onFilter","hierarchyLevelDetails","Pick","TreeNodeFilterAction","node","t0","$","_c","actionAttributes","getHierarchyLevelDetails","translate","t1","filterHierarchyLevel","t2","filterHierarchyLevelActiveDescription","t3","id","handleClick","t4","isFiltered","undefined","t5","t6","isFilterable","t7"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.tsx"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { memo, useCallback } from \"react\";\nimport { useTranslation } from \"../LocalizationContext.js\";\nimport { TreeActionBase } from \"./TreeAction.js\";\n\nimport filterSvg from \"@stratakit/icons/filter.svg\";\n\nimport type { NamedExoticComponent } from \"react\";\nimport type { HierarchyLevelDetails, TreeRendererProps } from \"../Renderers.js\";\nimport type { TreeNode } from \"../TreeNode.js\";\nimport type { TreeActionBaseAttributes } from \"./TreeAction.js\";\n\n/** @alpha */\ntype TreeNodeFilterActionProps = {\n /**\n * Action to perform when the filter button is clicked for this node.\n */\n onFilter?: (hierarchyLevelDetails: HierarchyLevelDetails) => void;\n} & TreeActionBaseAttributes &\n Pick<TreeRendererProps, \"getHierarchyLevelDetails\">;\n\n/**\n * React component that renders a filter action for a tree item.\n *\n * The action calls the `onFilter` callback prop when clicked.\n *\n * @see `getMenuActions`, `getInlineActions`, `getContextMenuActions` props of `TreeRenderer` to add this action\n * to tree items.\n *\n * @alpha\n */\nexport const TreeNodeFilterAction: NamedExoticComponent<TreeNodeFilterActionProps & { node: TreeNode }> = memo(function TreeNodeFilterAction({\n node,\n onFilter,\n getHierarchyLevelDetails,\n ...actionAttributes\n}: TreeNodeFilterActionProps & { node: TreeNode }) {\n const translate = useTranslation();\n const filterHierarchyLevel = translate(\"filterHierarchyLevel\");\n const filterHierarchyLevelActiveDescription = translate(\"filterHierarchyLevelActiveDescription\");\n\n const handleClick = useCallback(() => {\n const hierarchyLevelDetails = getHierarchyLevelDetails(node.id);\n hierarchyLevelDetails && onFilter?.(hierarchyLevelDetails);\n }, [node, getHierarchyLevelDetails, onFilter]);\n\n return (\n <TreeActionBase\n {...actionAttributes}\n label={filterHierarchyLevel}\n onClick={handleClick}\n icon={filterSvg}\n visible={node.isFiltered ? true : undefined}\n dot={node.isFiltered ? filterHierarchyLevelActiveDescription : undefined}\n hide={!onFilter || !node.isFilterable}\n />\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AAmCA,MAAac,uBAA6Fd,KAAK,SAAAc,qBAAAE,IAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL;CAAA,IAAAJ;AAAA,KAAAM,EAAA,OAAAD,IAAA;AAA8B,GAAA,CAAAD,MAAAJ,UAAAS,6BAAAD,oBAAAH;AAK5FC,IAAA,KAAAD;AAAAC,IAAA,KAAAE;AAAAF,IAAA,KAAAG;AAAAH,IAAA,KAAAF;AAAAE,IAAA,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MAAAE;AAAAF,IAAA,MAAAM;AAAAN,IAAA,MAAAW;AAAAX,IAAA,MAAAY;AAAAZ,IAAA,MAAAe;AAAAf,IAAA,MAAAgB;AAAAhB,IAAA,MAAAkB;OAAAA,MAAAlB,EAAA;AAAA,QARFkB;EAUF"}
@@ -1,8 +1,6 @@
1
1
  import { TreeNode } from "../TreeNode.js";
2
2
  import { TreeActionBaseAttributes } from "./TreeAction.js";
3
3
  import { NamedExoticComponent, PropsWithChildren } from "react";
4
- import "react/jsx-runtime";
5
-
6
4
  //#region src/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts
7
5
  /**
8
6
  * React component that renders a rename action for a tree item.
@@ -1 +1 @@
1
- {"version":3,"file":"TreeNodeRenameAction.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.tsx"],"mappings":";;;;;;;;;AAyBA;;;;;;;;cAAa,oBAAA,EAAsB,oBAAA,CAAqB,wBAAA;EAA6B,IAAA,EAAM,QAAA;AAAA;;UAkB1E,oBAAA;EAlBkF;AAkBnG;;;EAKE,cAAA,GAAiB,QAAA;EACjB,mBAAA;EACA,QAAA,IAAY,QAAA;AAAA"}
1
+ {"version":3,"file":"TreeNodeRenameAction.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.tsx"],"mappings":";;;;;;;AA0BA;;;;;;;;cAAa,oBAAA,EAAsB,oBAAA,CAAqB,wBAAA;EAA6B,IAAA,EAAM,QAAA;AAAA;;UAkB1E,oBAAA;EAlBkF;AAkBnG;;;EAKE,cAAA,GAAiB,QAAA;EACjB,mBAAA;EACA,QAAA,IAAY,QAAA;AAAA"}
@@ -1,10 +1,9 @@
1
- import { useTranslation } from "./LocalizationContext.js";
1
+ import { useTranslation } from "../LocalizationContext.js";
2
2
  import { TreeActionBase } from "./TreeAction.js";
3
3
  import { c } from "react-compiler-runtime";
4
4
  import { createContext, memo, useContext, useState } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import renameSvg from "@stratakit/icons/rename.svg";
7
-
8
7
  //#region src/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.tsx
9
8
  /**
10
9
  * React component that renders a rename action for a tree item.
@@ -150,7 +149,7 @@ function useTreeNodeRenameContextValue(t0) {
150
149
  } else t4 = $[8];
151
150
  return t4;
152
151
  }
153
-
154
152
  //#endregion
155
153
  export { TreeNodeRenameAction, TreeNodeRenameContextProvider, useTreeNodeRenameContext, useTreeNodeRenameContextValue };
154
+
156
155
  //# sourceMappingURL=TreeNodeRenameAction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreeNodeRenameAction.js","names":["createContext","memo","useCallback","useContext","useMemo","useState","renameSvg","useTranslation","TreeActionBase","NamedExoticComponent","PropsWithChildren","TreeNode","TreeActionBaseAttributes","TreeNodeRenameAction","node","t0","$","_c","actionAttributes","translate","context","useTreeNodeRenameContext","t1","rename","t2","canRename","startRename","t3","handleClick","t4","t5","TreeNodeEditingProps","onLabelChanged","newLabel","labelValidationHint","validate","RenameParameters","nodeId","commit","TreeNodeRenameContext","renameParameters","cancelRename","treeNodeRenameContext","undefined","TreeNodeRenameContextProvider","value","children","useTreeNodeRenameContextValue","getEditingProps","setRenameParameters","id","Symbol","for","node_0"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.tsx"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { createContext, memo, useCallback, useContext, useMemo, useState } from \"react\";\nimport renameSvg from \"@stratakit/icons/rename.svg\";\nimport { useTranslation } from \"./LocalizationContext.js\";\nimport { TreeActionBase } from \"./TreeAction.js\";\n\nimport type { NamedExoticComponent, PropsWithChildren } from \"react\";\nimport type { TreeNode } from \"../TreeNode.js\";\nimport type { TreeActionBaseAttributes } from \"./TreeAction.js\";\n\n/**\n * React component that renders a rename action for a tree item.\n *\n * The tree component must have `getEditingProps.onLabelChanged` prop set to enable renaming functionality. When\n * rename is completed, the `onLabelChanged` function is called to make the actual data update.\n *\n * @see `getMenuActions`, `getInlineActions`, `getContextMenuActions` props of `TreeRenderer` to add this action\n * to tree items.\n *\n * @alpha\n */\nexport const TreeNodeRenameAction: NamedExoticComponent<TreeActionBaseAttributes & { node: TreeNode }> = memo(function TreeNodeRenameAction({\n node,\n ...actionAttributes\n}: TreeActionBaseAttributes & { node: TreeNode }) {\n const translate = useTranslation();\n const context = useTreeNodeRenameContext();\n const rename = translate(\"rename\");\n\n const canRename = context?.canRename(node) ?? false;\n const startRename = context?.startRename;\n const handleClick = useCallback(() => {\n startRename?.(node);\n }, [startRename, node]);\n\n return <TreeActionBase {...actionAttributes} label={rename} onClick={handleClick} icon={renameSvg} hide={!canRename} />;\n});\n\n/** @alpha */\nexport interface TreeNodeEditingProps {\n /**\n * A callback that is invoked when node label is changed. Should be used together\n * with `<TreeNodeRenameAction />` to enter label editing mode.\n */\n onLabelChanged: (newLabel: string) => void;\n labelValidationHint?: string;\n validate?: (newLabel: string) => boolean;\n}\n\n/** @internal */\nexport interface RenameParameters {\n nodeId: string;\n commit: (newLabel: string) => void;\n labelValidationHint?: string;\n validate?: (newLabel: string) => boolean;\n}\n\ninterface TreeNodeRenameContext {\n renameParameters?: RenameParameters;\n startRename: (node: TreeNode) => void;\n canRename: (node: TreeNode) => boolean;\n cancelRename: () => void;\n}\n\nconst treeNodeRenameContext = createContext<TreeNodeRenameContext | undefined>(undefined);\n\n/** @internal */\nexport const useTreeNodeRenameContext = () => {\n return useContext(treeNodeRenameContext);\n};\n\n/** @internal */\nexport function TreeNodeRenameContextProvider({ value, children }: PropsWithChildren<{ value: TreeNodeRenameContext }>) {\n return <treeNodeRenameContext.Provider value={value}>{children}</treeNodeRenameContext.Provider>;\n}\n\n/** @internal */\nexport function useTreeNodeRenameContextValue({ getEditingProps }: { getEditingProps?: (node: TreeNode) => TreeNodeEditingProps | undefined }) {\n const [renameParameters, setRenameParameters] = useState<RenameParameters | undefined>(undefined);\n\n const startRename = useCallback(\n (node: TreeNode) => {\n const { onLabelChanged, labelValidationHint, validate } = getEditingProps?.(node) ?? {};\n if (onLabelChanged) {\n setRenameParameters({\n nodeId: node.id,\n commit: (newLabel) => {\n onLabelChanged(newLabel);\n setRenameParameters(undefined);\n },\n labelValidationHint,\n validate,\n });\n }\n },\n [getEditingProps],\n );\n\n const cancelRename = useCallback(() => {\n setRenameParameters(undefined);\n }, []);\n\n const canRename = useCallback(\n (node: TreeNode) => {\n return getEditingProps?.(node)?.onLabelChanged !== undefined;\n },\n [getEditingProps],\n );\n\n return useMemo(\n () => ({\n renameParameters,\n cancelRename,\n startRename,\n canRename,\n }),\n [renameParameters, canRename, startRename, cancelRename],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,MAAaa,uBAA4FZ,KAAK,SAAAY,qBAAAE,IAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAAA,IAAAC;CAAA,IAAAJ;AAAA,KAAAE,EAAA,OAAAD,IAAA;AAA8B,GAAA,CAAAD,SAAAI,oBAAAH;AAG5FC,IAAA,KAAAD;AAAAC,IAAA,KAAAE;AAAAF,IAAA,KAAAF;QAAA;AAAAI,qBAAAF,EAAA;AAAAF,SAAAE,EAAA;;CAC9C,MAAAG,YAAkBZ,gBAAgB;CAClC,MAAAa,UAAgBC,0BAA0B;CAAC,IAAAC;AAAA,KAAAN,EAAA,OAAAG,WAAA;AAC5BG,OAAAH,UAAU,SAAS;AAAAH,IAAA,KAAAG;AAAAH,IAAA,KAAAM;OAAAA,MAAAN,EAAA;CAAlC,MAAAO,SAAeD;CAAoB,IAAAE;AAAA,KAAAR,EAAA,OAAAI,WAAAJ,EAAA,OAAAF,MAAA;AAEjBU,OAAAJ,SAAOK,UAAYX,KAAc,IAAjC;AAAiCE,IAAA,KAAAI;AAAAJ,IAAA,KAAAF;AAAAE,IAAA,KAAAQ;OAA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sC,OAAU;CAAC,IAAArB;AAAA,KAAAN,EAAA,OAAAgC,iBAAA;AAGhG1B,QAAAR,SAAA;GACE,MAAA,EAAAkB,gBAAAE,qBAAAC,aAA0Da,kBAAkBlC,KAAW,IAA7B,EAA6B;AACvF,OAAIkB,eACFiB,qBAAoB;IAAAZ,QACVvB,KAAIoC;IAAGZ,SACPL,aAAA;AACND,oBAAeC,SAAS;AACxBgB,yBAAoBN,OAAU;;IAC/BT;IAAAC;IAGF,CAAC;;AAELnB,IAAA,KAAAgC;AAAAhC,IAAA,KAAAM;OAAAA,MAAAN,EAAA;CAdH,MAAAU,cAAoBJ;CAgBlB,IAAAE;AAAA,KAAAR,EAAA,OAAAmC,OAAAC,IAAA,4BAAA,EAAA;AAE+B5B,aAAA;AAC/ByB,uBAAoBN,OAAU;;AAC/B3B,IAAA,KAAAQ;OAAAA,MAAAR,EAAA;CAFD,MAAAyB,eAAqBjB;CAEd,IAAAG;AAAA,KAAAX,EAAA,OAAAgC,iBAAA;AAGLrB,QAAA0B,WACSL,kBAAkBlC,OAAqB,EAAAkB,mBAAKW;AACpD3B,IAAA,KAAAgC;AAAAhC,IAAA,KAAAW;OAAAA,MAAAX,EAAA;CAHH,MAAAS,YAAkBE;CAKhB,IAAAE;AAAA,KAAAb,EAAA,OAAAS,aAAAT,EAAA,OAAAwB,oBAAAxB,EAAA,OAAAU,aAAA;AAGOG,OAAA;GAAAW;GAAAC;GAAAf;GAAAD;GAKN;AAAAT,IAAA,KAAAS;AAAAT,IAAA,KAAAwB;AAAAxB,IAAA,KAAAU;AAAAV,IAAA,KAAAa;OAAAA,MAAAb,EAAA;AAAA,QALMa"}
1
+ {"version":3,"file":"TreeNodeRenameAction.js","names":["createContext","memo","useCallback","useContext","useMemo","useState","useTranslation","TreeActionBase","renameSvg","NamedExoticComponent","PropsWithChildren","TreeNode","TreeActionBaseAttributes","TreeNodeRenameAction","node","t0","$","_c","actionAttributes","translate","context","useTreeNodeRenameContext","t1","rename","t2","canRename","startRename","t3","handleClick","t4","t5","TreeNodeEditingProps","onLabelChanged","newLabel","labelValidationHint","validate","RenameParameters","nodeId","commit","TreeNodeRenameContext","renameParameters","cancelRename","treeNodeRenameContext","undefined","TreeNodeRenameContextProvider","value","children","useTreeNodeRenameContextValue","getEditingProps","setRenameParameters","id","Symbol","for","node_0"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.tsx"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { createContext, memo, useCallback, useContext, useMemo, useState } from \"react\";\nimport { useTranslation } from \"../LocalizationContext.js\";\nimport { TreeActionBase } from \"./TreeAction.js\";\n\nimport renameSvg from \"@stratakit/icons/rename.svg\";\n\nimport type { NamedExoticComponent, PropsWithChildren } from \"react\";\nimport type { TreeNode } from \"../TreeNode.js\";\nimport type { TreeActionBaseAttributes } from \"./TreeAction.js\";\n\n/**\n * React component that renders a rename action for a tree item.\n *\n * The tree component must have `getEditingProps.onLabelChanged` prop set to enable renaming functionality. When\n * rename is completed, the `onLabelChanged` function is called to make the actual data update.\n *\n * @see `getMenuActions`, `getInlineActions`, `getContextMenuActions` props of `TreeRenderer` to add this action\n * to tree items.\n *\n * @alpha\n */\nexport const TreeNodeRenameAction: NamedExoticComponent<TreeActionBaseAttributes & { node: TreeNode }> = memo(function TreeNodeRenameAction({\n node,\n ...actionAttributes\n}: TreeActionBaseAttributes & { node: TreeNode }) {\n const translate = useTranslation();\n const context = useTreeNodeRenameContext();\n const rename = translate(\"rename\");\n\n const canRename = context?.canRename(node) ?? false;\n const startRename = context?.startRename;\n const handleClick = useCallback(() => {\n startRename?.(node);\n }, [startRename, node]);\n\n return <TreeActionBase {...actionAttributes} label={rename} onClick={handleClick} icon={renameSvg} hide={!canRename} />;\n});\n\n/** @alpha */\nexport interface TreeNodeEditingProps {\n /**\n * A callback that is invoked when node label is changed. Should be used together\n * with `<TreeNodeRenameAction />` to enter label editing mode.\n */\n onLabelChanged: (newLabel: string) => void;\n labelValidationHint?: string;\n validate?: (newLabel: string) => boolean;\n}\n\n/** @internal */\nexport interface RenameParameters {\n nodeId: string;\n commit: (newLabel: string) => void;\n labelValidationHint?: string;\n validate?: (newLabel: string) => boolean;\n}\n\ninterface TreeNodeRenameContext {\n renameParameters?: RenameParameters;\n startRename: (node: TreeNode) => void;\n canRename: (node: TreeNode) => boolean;\n cancelRename: () => void;\n}\n\nconst treeNodeRenameContext = createContext<TreeNodeRenameContext | undefined>(undefined);\n\n/** @internal */\nexport const useTreeNodeRenameContext = () => {\n return useContext(treeNodeRenameContext);\n};\n\n/** @internal */\nexport function TreeNodeRenameContextProvider({ value, children }: PropsWithChildren<{ value: TreeNodeRenameContext }>) {\n return <treeNodeRenameContext.Provider value={value}>{children}</treeNodeRenameContext.Provider>;\n}\n\n/** @internal */\nexport function useTreeNodeRenameContextValue({ getEditingProps }: { getEditingProps?: (node: TreeNode) => TreeNodeEditingProps | undefined }) {\n const [renameParameters, setRenameParameters] = useState<RenameParameters | undefined>(undefined);\n\n const startRename = useCallback(\n (node: TreeNode) => {\n const { onLabelChanged, labelValidationHint, validate } = getEditingProps?.(node) ?? {};\n if (onLabelChanged) {\n setRenameParameters({\n nodeId: node.id,\n commit: (newLabel) => {\n onLabelChanged(newLabel);\n setRenameParameters(undefined);\n },\n labelValidationHint,\n validate,\n });\n }\n },\n [getEditingProps],\n );\n\n const cancelRename = useCallback(() => {\n setRenameParameters(undefined);\n }, []);\n\n const canRename = useCallback(\n (node: TreeNode) => {\n return getEditingProps?.(node)?.onLabelChanged !== undefined;\n },\n [getEditingProps],\n );\n\n return useMemo(\n () => ({\n renameParameters,\n cancelRename,\n startRename,\n canRename,\n }),\n [renameParameters, canRename, startRename, cancelRename],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,MAAaa,uBAA4FZ,KAAK,SAAAY,qB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;OAAAA,MAAAR,EAAA;CAFD,MAAAyB,eAAqBjB;CAEd,IAAAG;AAAA,KAAAX,EAAA,OAAAgC,iBAAA;AAGLrB,QAAA0B,WACSL,kBAAkBlC,OAAqB,EAAAkB,mBAAKW,KAAAA;AACpD3B,IAAA,KAAAgC;AAAAhC,IAAA,KAAAW;OAAAA,MAAAX,EAAA;CAHH,MAAAS,YAAkBE;CAKhB,IAAAE;AAAA,KAAAb,EAAA,OAAAS,aAAAT,EAAA,OAAAwB,oBAAAxB,EAAA,OAAAU,aAAA;AAGOG,OAAA;GAAAW;GAAAC;GAAAf;GAAAD;GAKN;AAAAT,IAAA,KAAAS;AAAAT,IAAA,KAAAwB;AAAAxB,IAAA,KAAAU;AAAAV,IAAA,KAAAa;OAAAA,MAAAb,EAAA;AAAA,QALMa"}
@@ -1,9 +1,5 @@
1
- import "../TreeNode.js";
2
- import "../Renderers.js";
3
1
  import { ComponentPropsWithoutRef, FC, ReactNode, RefAttributes } from "react";
4
2
  import { Tree } from "@stratakit/structures";
5
- import "./TreeNodeRenderer.css";
6
-
7
3
  //#region src/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts
8
4
  /** @alpha */
9
5
  type StrataKitTreeItemProps = Omit<ComponentPropsWithoutRef<typeof Tree.Item>, "actions" | "inlineActions" | "expanded" | "onExpandedChange" | "icon" | "unstable_decorations" | "error"> & {
@@ -1 +1 @@
1
- {"version":3,"file":"TreeNodeRenderer.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeRenderer.tsx"],"mappings":";;;;;;;;KA6CY,sBAAA,GAAyB,IAAA,CACnC,wBAAA,QAAgC,IAAA,CAAK,IAAA;;;;;EAOrC,WAAA,GAAc,SAAA;AAAA"}
1
+ {"version":3,"file":"TreeNodeRenderer.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeRenderer.tsx"],"mappings":";;;;KA8CY,sBAAA,GAAyB,IAAA,CACnC,wBAAA,QAAgC,IAAA,CAAK,IAAA;;;;;EAOrC,WAAA,GAAc,SAAA;AAAA"}
@@ -1,4 +1,4 @@
1
- import { useTranslation } from "./LocalizationContext.js";
1
+ import { useTranslation } from "../LocalizationContext.js";
2
2
  import { TreeActionBase } from "./TreeAction.js";
3
3
  import { useTreeNodeRenameContext } from "./TreeNodeRenameAction.js";
4
4
  import { c } from "react-compiler-runtime";
@@ -10,7 +10,6 @@ import "./TreeNodeRenderer.css";
10
10
  import checkmarkSvg from "@stratakit/icons/checkmark.svg";
11
11
  import dismissSvg from "@stratakit/icons/dismiss.svg";
12
12
  import refreshSvg from "@stratakit/icons/refresh.svg";
13
-
14
13
  //#region src/presentation-hierarchies-react/stratakit/TreeNodeRenderer.tsx
15
14
  /**
16
15
  * A component that renders a given `TreeNode` using the `Tree.Item` component from `@stratakit/structures`.
@@ -529,7 +528,7 @@ function LabelEditor(t0) {
529
528
  function injectActionVariant(actions, variant) {
530
529
  return actions.filter((action) => isValidElement(action)).map((action) => cloneElement(action, { variant }));
531
530
  }
532
-
533
531
  //#endregion
534
532
  export { PlaceholderNode, StrataKitTreeNodeRenderer };
533
+
535
534
  //# sourceMappingURL=TreeNodeRenderer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreeNodeRenderer.js","names":["cloneElement","forwardRef","isValidElement","memo","useCallback","useEffect","useId","useMemo","useRef","useState","Description","IconButton","Spinner","Text","TextBox","checkmarkSvg","dismissSvg","refreshSvg","DropdownMenu","unstable_Popover","Popover","Tree","useTranslation","TreeActionBase","useTreeNodeRenameContext","ComponentPropsWithoutRef","FC","PropsWithRef","ReactNode","RefAttributes","TreeRendererProps","TreeNode","TreeActionBaseAttributes","TreeNodeRendererOwnProps","Pick","node","menuActions","inlineActions","contextMenuActions","StrataKitTreeItemProps","Omit","Item","decorations","TreeNodeRendererProps","StrataKitTreeNodeRenderer","HTMLElement","HierarchyNode","props","forwardedRef","$","_c","expandNode","reloadTree","treeItemProps","translate","renameContext","contextMenuProps","setContextMenuProps","undefined","label","t0","bb0","error","type","t1","t2","id","parentNodeId","state","t3","injectActionVariant","inlineActionItems","bb1","menuActionItems","bb2","isNodeExpandable","children","length","isExpanded","expanded","renameParameters","cancelRename","t4","commit","t5","labelValidationHint","t6","validate","t7","labelEditor","t8","nodeId","t9","t10","t11","t12","e","onContextMenu","preventDefault","actions","position","x","clientX","y","clientY","t13","t14","t15","t16","Symbol","for","open","t17","t18","top","left","t19","t20","t21","t22","PlaceholderNode","LabelEditor","initialLabel","onChange","onCancel","inputRef","newLabelValue","setNewLabelValue","hasError","setHasError","handleLabelChange","cancelLabelChange","current","focus","select","canRename","inputId","width","event","target","value","event_0","key","display","variant","filter","action","map"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeRenderer.tsx"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport \"./TreeNodeRenderer.css\";\n\nimport { cloneElement, forwardRef, isValidElement, memo, useCallback, useEffect, useId, useMemo, useRef, useState } from \"react\";\nimport { Description, IconButton, Spinner, Text, TextBox } from \"@stratakit/bricks\";\nimport checkmarkSvg from \"@stratakit/icons/checkmark.svg\";\nimport dismissSvg from \"@stratakit/icons/dismiss.svg\";\nimport refreshSvg from \"@stratakit/icons/refresh.svg\";\nimport { DropdownMenu, unstable_Popover as Popover, Tree } from \"@stratakit/structures\";\nimport { useTranslation } from \"./LocalizationContext.js\";\nimport { TreeActionBase } from \"./TreeAction.js\";\nimport { useTreeNodeRenameContext } from \"./TreeNodeRenameAction.js\";\n\nimport type { ComponentPropsWithoutRef, FC, PropsWithRef, ReactNode, RefAttributes } from \"react\";\nimport type { TreeRendererProps } from \"../Renderers.js\";\nimport type { TreeNode } from \"../TreeNode.js\";\nimport type { TreeActionBaseAttributes } from \"./TreeAction.js\";\n\n/** @internal */\ninterface TreeNodeRendererOwnProps extends Pick<TreeRendererProps, \"expandNode\" | \"reloadTree\"> {\n /** Node that is rendered. */\n node: TreeNode;\n /**\n * Menu actions for tree item.\n * Must be an array of `<TreeActionBase />` or `<Divider />` elements.\n */\n menuActions?: ReactNode[];\n /**\n * Inline actions for tree item.\n * Must be an array of `<TreeActionBase />` elements.\n * Max 2 items.\n */\n inlineActions?: ReactNode[];\n /**\n * Context menu actions for tree item.\n * Must be an array of `<TreeActionBase />` or `<Divider />` elements.\n */\n contextMenuActions?: ReactNode[];\n}\n\n/** @alpha */\nexport type StrataKitTreeItemProps = Omit<\n ComponentPropsWithoutRef<typeof Tree.Item>,\n \"actions\" | \"inlineActions\" | \"expanded\" | \"onExpandedChange\" | \"icon\" | \"unstable_decorations\" | \"error\"\n> & {\n /**\n * Used to render elements between expander and label.\n * E.g. icons, color picker, etc.\n */\n decorations?: ReactNode;\n};\n\n/** @internal */\nexport type TreeNodeRendererProps = StrataKitTreeItemProps & TreeNodeRendererOwnProps;\n\n/**\n * A component that renders a given `TreeNode` using the `Tree.Item` component from `@stratakit/structures`.\n *\n * @internal\n */\nexport const StrataKitTreeNodeRenderer: FC<PropsWithRef<TreeNodeRendererProps & RefAttributes<HTMLElement>>> = memo(\n forwardRef<HTMLElement, TreeNodeRendererProps>(function HierarchyNode(props, forwardedRef) {\n const { node, decorations, inlineActions, menuActions, contextMenuActions, expandNode, reloadTree, ...treeItemProps } = props;\n const translate = useTranslation();\n const renameContext = useTreeNodeRenameContext();\n const [contextMenuProps, setContextMenuProps] = useState<{ position: { x: number; y: number }; actions: ReactNode[] } | undefined>(undefined);\n\n const label = treeItemProps.label ?? node.label;\n const inlineActionItems = useMemo(() => {\n if (node.error !== undefined && node.error.type === \"ChildrenLoad\") {\n return [\n <TreeActionBase\n key=\"retry\"\n label={translate(\"retry\")}\n onClick={() => reloadTree({ parentNodeId: node.id, state: \"reset\" })}\n visible={true}\n icon={refreshSvg}\n variant=\"inline\"\n />,\n ];\n }\n if (!inlineActions) {\n return undefined;\n }\n return injectActionVariant(inlineActions, \"inline\");\n }, [node, inlineActions, translate, reloadTree]);\n\n const menuActionItems = useMemo(() => {\n if (!menuActions) {\n return undefined;\n }\n return injectActionVariant(menuActions, \"default\");\n }, [menuActions]);\n\n const expanded = useMemo(() => {\n if (node.error && (node.error.type !== \"Unknown\" || !node.error.isNodeExpandable)) {\n return undefined;\n }\n\n // this is a leaf node\n if (node.children !== true && node.children.length === 0) {\n return undefined;\n }\n\n return node.isExpanded;\n }, [node]);\n\n const { renameParameters, cancelRename } = renameContext ?? {};\n const labelEditor = (\n <LabelEditor\n initialLabel={node.label}\n onChange={renameParameters?.commit}\n onCancel={cancelRename}\n labelValidationHint={renameParameters?.labelValidationHint}\n validate={renameParameters?.validate}\n />\n );\n\n return (\n <>\n <Popover content={labelEditor} placement=\"bottom\" open={renameParameters?.nodeId === node.id} setOpen={cancelRename} unmountOnHide>\n <Tree.Item\n {...treeItemProps}\n ref={forwardedRef}\n label={label}\n expanded={expanded}\n onExpandedChange={useCallback(\n (isExpanded: boolean) => {\n expandNode(node.id, isExpanded);\n },\n [node, expandNode],\n )}\n inlineActions={inlineActionItems}\n actions={menuActionItems}\n unstable_decorations={decorations}\n error={node.error ? node.error.id : undefined}\n onContextMenu={(e) => {\n if (treeItemProps.onContextMenu) {\n treeItemProps.onContextMenu(e);\n }\n\n if (!contextMenuActions) {\n return;\n }\n\n e.preventDefault();\n const actions = injectActionVariant(contextMenuActions, \"context-menu\");\n if (actions.length === 0) {\n return;\n }\n\n setContextMenuProps({\n position: {\n x: e.clientX,\n y: e.clientY,\n },\n actions,\n });\n }}\n />\n </Popover>\n <DropdownMenu.Provider\n open={contextMenuProps !== undefined}\n setOpen={(open) => {\n if (!open) {\n setContextMenuProps(undefined);\n }\n }}\n key={`${node.id}-${contextMenuProps?.position.x ?? \"\"}-${contextMenuProps?.position.y ?? \"\"}`}\n >\n {contextMenuProps ? (\n <DropdownMenu.Button style={{ position: \"fixed\", top: contextMenuProps.position.y, left: contextMenuProps.position.x }} render={<div />} />\n ) : null}\n {/* `autoFocus` prop is coming from ariakit and is not native HTML `autoFocus` prop. */}\n {/* `focusable` is needed for `autoFocus` to work. StrataKit exposes only `autoFocus` and does not set `focusable` internally. */}\n {/* eslint-disable jsx-a11y/no-autofocus */}\n {/* @ts-expect-error focusable is passed through */}\n <DropdownMenu.Content focusable autoFocus={true}>\n {contextMenuProps?.actions}\n </DropdownMenu.Content>\n </DropdownMenu.Provider>\n </>\n );\n }),\n);\n\nexport const PlaceholderNode: FC<\n PropsWithRef<Pick<StrataKitTreeItemProps, \"style\" | \"aria-level\" | \"aria-posinset\" | \"aria-setsize\"> & RefAttributes<HTMLElement>>\n> = memo(\n forwardRef<HTMLElement, Pick<StrataKitTreeItemProps, \"style\" | \"aria-level\" | \"aria-posinset\" | \"aria-setsize\">>(function PlaceholderNode(\n { ...props },\n forwardedRef,\n ) {\n const translate = useTranslation();\n return (\n <Tree.Item {...props} ref={forwardedRef} label={translate(\"loading\")} unstable_decorations={<Spinner size={\"small\"} title={translate(\"loading\")} />} />\n );\n }),\n);\n\nfunction LabelEditor({\n initialLabel,\n labelValidationHint,\n onChange,\n onCancel,\n validate,\n}: {\n initialLabel: string;\n labelValidationHint?: string;\n onChange?: (newLabel: string) => void;\n onCancel?: () => void;\n validate?: (newLabel: string) => boolean;\n}) {\n const translate = useTranslation();\n const inputRef = useRef<HTMLInputElement>(null);\n const [newLabelValue, setNewLabelValue] = useState(initialLabel);\n const [hasError, setHasError] = useState<boolean>(false);\n const handleLabelChange = () => {\n if (validate && !validate(newLabelValue)) {\n setHasError(true);\n return;\n }\n\n if (initialLabel !== newLabelValue) {\n onChange?.(newLabelValue);\n return;\n }\n onCancel?.();\n };\n\n const cancelLabelChange = () => {\n setNewLabelValue(initialLabel);\n onCancel?.();\n };\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n inputRef.current.select();\n }\n }, []);\n\n const canRename = newLabelValue && newLabelValue !== initialLabel && !hasError;\n const inputId = useId();\n\n return (\n <div key={initialLabel} className=\"phr-node-label-editor\">\n <div className=\"phr-node-label-editor-input-row\">\n <TextBox.Root style={{ width: \"100%\" }} className={hasError ? \"with-error\" : undefined}>\n <TextBox.Input\n id={inputId}\n ref={inputRef}\n aria-label={translate(\"newLabel\")}\n value={newLabelValue}\n onChange={(event) => {\n setNewLabelValue(event.target.value);\n setHasError(false);\n }}\n onKeyUp={(event) => {\n if (event.key === \"Enter\") {\n handleLabelChange();\n } else if (event.key === \"Escape\") {\n cancelLabelChange();\n }\n }}\n />\n </TextBox.Root>\n <IconButton icon={dismissSvg} label={translate(\"cancel\")} onClick={cancelLabelChange} />\n <IconButton icon={checkmarkSvg} label={translate(\"confirm\")} onClick={handleLabelChange} disabled={!canRename} />\n </div>\n {labelValidationHint !== undefined ? (\n <Description id={inputId} tone={hasError ? \"critical\" : \"neutral\"} style={{ display: \"flex\" }}>\n <Text variant=\"caption-lg\">{labelValidationHint}</Text>\n </Description>\n ) : undefined}\n </div>\n );\n}\n\nfunction injectActionVariant(actions: ReactNode[], variant: TreeActionBaseAttributes[\"variant\"]) {\n return actions\n .filter((action) => isValidElement<TreeActionBaseAttributes>(action))\n .map((action) => cloneElement<TreeActionBaseAttributes>(action, { variant }));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgEA,MAAa4C,4BAAkGzC,KAC7GF,WAA+C,SAAA6C,cAAAC,OAAAC,cAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAAA,IAAAZ;CAAA,IAAAI;CAAA,IAAAS;CAAA,IAAAd;CAAA,IAAAD;CAAA,IAAAD;CAAA,IAAAiB;CAAA,IAAAC;AAAA,KAAAJ,EAAA,OAAAF,OAAA;AAC7C,GAAA,CAAAZ,MAAAO,aAAAL,eAAAD,aAAAE,oBAAAa,YAAAC,eAAAC,iBAAwHN;AAAME,IAAA,KAAAF;AAAAE,IAAA,KAAAX;AAAAW,IAAA,KAAAP;AAAAO,IAAA,KAAAE;AAAAF,IAAA,KAAAZ;AAAAY,I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B3B,SACvB,oBAAC;GAAgB8E,IAAAA;GAAe,MAAAR,WAAA,aAAA;GAA0C,OAAA,EAAAe,SAAW,QAAO;aAC1F,oBAAC;IAAa,SAAA;cAAc1D;KAC9B;IACW,GAJZ3B;AAIYT,IAAA,MAAA+E;AAAA/E,IAAA,MAAAuF;AAAAvF,IAAA,MAAAoC;AAAApC,IAAA,MAAAgE;OAAAA,OAAAhE,EAAA;CAAA,IAAAmE;AAAA,KAAAnE,EAAA,QAAAyE,gBAAAzE,EAAA,QAAA+D,OAAA/D,EAAA,QAAAgE,KAAA;AA5BfG,QAAA,qBAAA;GAAkC,WAAA;cAChCJ,KAuBCC;KAxBOS,aA6BJ;AAAAzE,IAAA,MAAAyE;AAAAzE,IAAA,MAAA+D;AAAA/D,IAAA,MAAAgE;AAAAhE,IAAA,MAAAmE;OAAAA,OAAAnE,EAAA;AAAA,QA7BNmE;;AAiCJ,SAAS9C,oBAAoB6B,SAAsB6C,SAA8C;AAC/F,QAAO7C,QACJ8C,QAAQC,WAAWhJ,eAAyCgJ,OAAO,CAAC,CACpEC,KAAKD,WAAWlJ,aAAuCkJ,QAAQ,EAAEF,SAAS,CAAC,CAAC"}
1
+ {"version":3,"file":"TreeNodeRenderer.js","names":["cloneElement","forwardRef","isValidElement","memo","useCallback","useEffect","useId","useMemo","useRef","useState","Description","IconButton","Spinner","Text","TextBox","DropdownMenu","unstable_Popover","Popover","Tree","useTranslation","TreeActionBase","useTreeNodeRenameContext","checkmarkSvg","dismissSvg","refreshSvg","ComponentPropsWithoutRef","FC","PropsWithRef","ReactNode","RefAttributes","TreeRendererProps","TreeNode","TreeActionBaseAttributes","TreeNodeRendererOwnProps","Pick","node","menuActions","inlineActions","contextMenuActions","StrataKitTreeItemProps","Omit","Item","decorations","TreeNodeRendererProps","StrataKitTreeNodeRenderer","HTMLElement","HierarchyNode","props","forwardedRef","$","_c","expandNode","reloadTree","treeItemProps","translate","renameContext","contextMenuProps","setContextMenuProps","undefined","label","t0","bb0","error","type","t1","t2","id","parentNodeId","state","t3","injectActionVariant","inlineActionItems","bb1","menuActionItems","bb2","isNodeExpandable","children","length","isExpanded","expanded","renameParameters","cancelRename","t4","commit","t5","labelValidationHint","t6","validate","t7","labelEditor","t8","nodeId","t9","t10","t11","t12","e","onContextMenu","preventDefault","actions","position","x","clientX","y","clientY","t13","t14","t15","t16","Symbol","for","open","t17","t18","top","left","t19","t20","t21","t22","PlaceholderNode","LabelEditor","initialLabel","onChange","onCancel","inputRef","newLabelValue","setNewLabelValue","hasError","setHasError","handleLabelChange","cancelLabelChange","current","focus","select","canRename","inputId","width","event","target","value","event_0","key","display","variant","filter","action","map"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeRenderer.tsx"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport \"./TreeNodeRenderer.css\";\n\nimport { cloneElement, forwardRef, isValidElement, memo, useCallback, useEffect, useId, useMemo, useRef, useState } from \"react\";\nimport { Description, IconButton, Spinner, Text, TextBox } from \"@stratakit/bricks\";\nimport { DropdownMenu, unstable_Popover as Popover, Tree } from \"@stratakit/structures\";\nimport { useTranslation } from \"../LocalizationContext.js\";\nimport { TreeActionBase } from \"./TreeAction.js\";\nimport { useTreeNodeRenameContext } from \"./TreeNodeRenameAction.js\";\n\nimport checkmarkSvg from \"@stratakit/icons/checkmark.svg\";\nimport dismissSvg from \"@stratakit/icons/dismiss.svg\";\nimport refreshSvg from \"@stratakit/icons/refresh.svg\";\n\nimport type { ComponentPropsWithoutRef, FC, PropsWithRef, ReactNode, RefAttributes } from \"react\";\nimport type { TreeRendererProps } from \"../Renderers.js\";\nimport type { TreeNode } from \"../TreeNode.js\";\nimport type { TreeActionBaseAttributes } from \"./TreeAction.js\";\n\n/** @internal */\ninterface TreeNodeRendererOwnProps extends Pick<TreeRendererProps, \"expandNode\" | \"reloadTree\"> {\n /** Node that is rendered. */\n node: TreeNode;\n /**\n * Menu actions for tree item.\n * Must be an array of `<TreeActionBase />` or `<Divider />` elements.\n */\n menuActions?: ReactNode[];\n /**\n * Inline actions for tree item.\n * Must be an array of `<TreeActionBase />` elements.\n * Max 2 items.\n */\n inlineActions?: ReactNode[];\n /**\n * Context menu actions for tree item.\n * Must be an array of `<TreeActionBase />` or `<Divider />` elements.\n */\n contextMenuActions?: ReactNode[];\n}\n\n/** @alpha */\nexport type StrataKitTreeItemProps = Omit<\n ComponentPropsWithoutRef<typeof Tree.Item>,\n \"actions\" | \"inlineActions\" | \"expanded\" | \"onExpandedChange\" | \"icon\" | \"unstable_decorations\" | \"error\"\n> & {\n /**\n * Used to render elements between expander and label.\n * E.g. icons, color picker, etc.\n */\n decorations?: ReactNode;\n};\n\n/** @internal */\nexport type TreeNodeRendererProps = StrataKitTreeItemProps & TreeNodeRendererOwnProps;\n\n/**\n * A component that renders a given `TreeNode` using the `Tree.Item` component from `@stratakit/structures`.\n *\n * @internal\n */\nexport const StrataKitTreeNodeRenderer: FC<PropsWithRef<TreeNodeRendererProps & RefAttributes<HTMLElement>>> = memo(\n forwardRef<HTMLElement, TreeNodeRendererProps>(function HierarchyNode(props, forwardedRef) {\n const { node, decorations, inlineActions, menuActions, contextMenuActions, expandNode, reloadTree, ...treeItemProps } = props;\n const translate = useTranslation();\n const renameContext = useTreeNodeRenameContext();\n const [contextMenuProps, setContextMenuProps] = useState<{ position: { x: number; y: number }; actions: ReactNode[] } | undefined>(undefined);\n\n const label = treeItemProps.label ?? node.label;\n const inlineActionItems = useMemo(() => {\n if (node.error !== undefined && node.error.type === \"ChildrenLoad\") {\n return [\n <TreeActionBase\n key=\"retry\"\n label={translate(\"retry\")}\n onClick={() => reloadTree({ parentNodeId: node.id, state: \"reset\" })}\n visible={true}\n icon={refreshSvg}\n variant=\"inline\"\n />,\n ];\n }\n if (!inlineActions) {\n return undefined;\n }\n return injectActionVariant(inlineActions, \"inline\");\n }, [node, inlineActions, translate, reloadTree]);\n\n const menuActionItems = useMemo(() => {\n if (!menuActions) {\n return undefined;\n }\n return injectActionVariant(menuActions, \"default\");\n }, [menuActions]);\n\n const expanded = useMemo(() => {\n if (node.error && (node.error.type !== \"Unknown\" || !node.error.isNodeExpandable)) {\n return undefined;\n }\n\n // this is a leaf node\n if (node.children !== true && node.children.length === 0) {\n return undefined;\n }\n\n return node.isExpanded;\n }, [node]);\n\n const { renameParameters, cancelRename } = renameContext ?? {};\n const labelEditor = (\n <LabelEditor\n initialLabel={node.label}\n onChange={renameParameters?.commit}\n onCancel={cancelRename}\n labelValidationHint={renameParameters?.labelValidationHint}\n validate={renameParameters?.validate}\n />\n );\n\n return (\n <>\n <Popover content={labelEditor} placement=\"bottom\" open={renameParameters?.nodeId === node.id} setOpen={cancelRename} unmountOnHide>\n <Tree.Item\n {...treeItemProps}\n ref={forwardedRef}\n label={label}\n expanded={expanded}\n onExpandedChange={useCallback(\n (isExpanded: boolean) => {\n expandNode(node.id, isExpanded);\n },\n [node, expandNode],\n )}\n inlineActions={inlineActionItems}\n actions={menuActionItems}\n unstable_decorations={decorations}\n error={node.error ? node.error.id : undefined}\n onContextMenu={(e) => {\n if (treeItemProps.onContextMenu) {\n treeItemProps.onContextMenu(e);\n }\n\n if (!contextMenuActions) {\n return;\n }\n\n e.preventDefault();\n const actions = injectActionVariant(contextMenuActions, \"context-menu\");\n if (actions.length === 0) {\n return;\n }\n\n setContextMenuProps({\n position: {\n x: e.clientX,\n y: e.clientY,\n },\n actions,\n });\n }}\n />\n </Popover>\n <DropdownMenu.Provider\n open={contextMenuProps !== undefined}\n setOpen={(open) => {\n if (!open) {\n setContextMenuProps(undefined);\n }\n }}\n key={`${node.id}-${contextMenuProps?.position.x ?? \"\"}-${contextMenuProps?.position.y ?? \"\"}`}\n >\n {contextMenuProps ? (\n <DropdownMenu.Button style={{ position: \"fixed\", top: contextMenuProps.position.y, left: contextMenuProps.position.x }} render={<div />} />\n ) : null}\n {/* `autoFocus` prop is coming from ariakit and is not native HTML `autoFocus` prop. */}\n {/* `focusable` is needed for `autoFocus` to work. StrataKit exposes only `autoFocus` and does not set `focusable` internally. */}\n {/* eslint-disable jsx-a11y/no-autofocus */}\n {/* @ts-expect-error focusable is passed through */}\n <DropdownMenu.Content focusable autoFocus={true}>\n {contextMenuProps?.actions}\n </DropdownMenu.Content>\n </DropdownMenu.Provider>\n </>\n );\n }),\n);\n\nexport const PlaceholderNode: FC<\n PropsWithRef<Pick<StrataKitTreeItemProps, \"style\" | \"aria-level\" | \"aria-posinset\" | \"aria-setsize\"> & RefAttributes<HTMLElement>>\n> = memo(\n forwardRef<HTMLElement, Pick<StrataKitTreeItemProps, \"style\" | \"aria-level\" | \"aria-posinset\" | \"aria-setsize\">>(function PlaceholderNode(\n { ...props },\n forwardedRef,\n ) {\n const translate = useTranslation();\n return (\n <Tree.Item {...props} ref={forwardedRef} label={translate(\"loading\")} unstable_decorations={<Spinner size={\"small\"} title={translate(\"loading\")} />} />\n );\n }),\n);\n\nfunction LabelEditor({\n initialLabel,\n labelValidationHint,\n onChange,\n onCancel,\n validate,\n}: {\n initialLabel: string;\n labelValidationHint?: string;\n onChange?: (newLabel: string) => void;\n onCancel?: () => void;\n validate?: (newLabel: string) => boolean;\n}) {\n const translate = useTranslation();\n const inputRef = useRef<HTMLInputElement>(null);\n const [newLabelValue, setNewLabelValue] = useState(initialLabel);\n const [hasError, setHasError] = useState<boolean>(false);\n const handleLabelChange = () => {\n if (validate && !validate(newLabelValue)) {\n setHasError(true);\n return;\n }\n\n if (initialLabel !== newLabelValue) {\n onChange?.(newLabelValue);\n return;\n }\n onCancel?.();\n };\n\n const cancelLabelChange = () => {\n setNewLabelValue(initialLabel);\n onCancel?.();\n };\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n inputRef.current.select();\n }\n }, []);\n\n const canRename = newLabelValue && newLabelValue !== initialLabel && !hasError;\n const inputId = useId();\n\n return (\n <div key={initialLabel} className=\"phr-node-label-editor\">\n <div className=\"phr-node-label-editor-input-row\">\n <TextBox.Root style={{ width: \"100%\" }} className={hasError ? \"with-error\" : undefined}>\n <TextBox.Input\n id={inputId}\n ref={inputRef}\n aria-label={translate(\"newLabel\")}\n value={newLabelValue}\n onChange={(event) => {\n setNewLabelValue(event.target.value);\n setHasError(false);\n }}\n onKeyUp={(event) => {\n if (event.key === \"Enter\") {\n handleLabelChange();\n } else if (event.key === \"Escape\") {\n cancelLabelChange();\n }\n }}\n />\n </TextBox.Root>\n <IconButton icon={dismissSvg} label={translate(\"cancel\")} onClick={cancelLabelChange} />\n <IconButton icon={checkmarkSvg} label={translate(\"confirm\")} onClick={handleLabelChange} disabled={!canRename} />\n </div>\n {labelValidationHint !== undefined ? (\n <Description id={inputId} tone={hasError ? \"critical\" : \"neutral\"} style={{ display: \"flex\" }}>\n <Text variant=\"caption-lg\">{labelValidationHint}</Text>\n </Description>\n ) : undefined}\n </div>\n );\n}\n\nfunction injectActionVariant(actions: ReactNode[], variant: TreeActionBaseAttributes[\"variant\"]) {\n return actions\n .filter((action) => isValidElement<TreeActionBaseAttributes>(action))\n .map((action) => cloneElement<TreeActionBaseAttributes>(action, { variant }));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiEA,MAAa4C,4BAAkGzC,KAC7GF,WAA+C,SAAA6C,cAAAC,OAAAC,cAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAAA,IAAAZ;CAAA,IAAAI;CAAA,IAAAS;CAAA,IAAAd;CAAA,IAAAD;CAAA,IAAAD;CAAA,IAAAiB;CAAA,IAAAC;AAAA,KAAAJ,EAAA,OAAAF,OAAA;AAC7C,GAAA,CAAAZ,MAAAO,aAAAL,eAAAD,aAAAE,oBAAAa,YAAAC,eAAAC,iBAAwHN;AAAME,IAAA,KAAAF;AAAAE,IAAA,KAAAX;AAAAW,IAAA,KAAAP;AAAAO,IAAA,KAAAE;AAAAF,IAAA,KAAAZ;AAAAY,IAAA,KAAAb;AA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