@igstack/app-catalog-frontend-core 4.0.0-alpha-20260918191401 → 4.0.0-alpha-20260919013047
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/__tests__/modules/appCatalog/utils/quickJump.test.d.ts +1 -0
- package/dist/esm/assets/grasshopper.svg.js +16 -0
- package/dist/esm/assets/grasshopper.svg.js.map +1 -0
- package/dist/esm/modules/appCatalog/hooks/useUpdateApp.d.ts +5 -0
- package/dist/esm/modules/appCatalog/ui/components/QuickJumpSection.d.ts +9 -0
- package/dist/esm/modules/appCatalog/ui/components/QuickJumpSection.js +192 -0
- package/dist/esm/modules/appCatalog/ui/components/QuickJumpSection.js.map +1 -0
- package/dist/esm/modules/appCatalog/ui/detail/AppDetails.js +3 -1
- package/dist/esm/modules/appCatalog/ui/detail/AppDetails.js.map +1 -1
- package/dist/esm/modules/appCatalog/utils/quickJump.d.ts +24 -0
- package/dist/esm/modules/appCatalog/utils/quickJump.js +25 -0
- package/dist/esm/modules/appCatalog/utils/quickJump.js.map +1 -0
- package/dist/esm/ui/checkbox.js +32 -0
- package/dist/esm/ui/checkbox.js.map +1 -0
- package/package.json +4 -4
- package/src/__tests__/modules/appCatalog/utils/quickJump.test.ts +84 -0
- package/src/assets/grasshopper.svg +114 -0
- package/src/modules/appCatalog/ui/components/QuickJumpSection.tsx +254 -0
- package/src/modules/appCatalog/ui/detail/AppDetails.tsx +8 -2
- package/src/modules/appCatalog/utils/quickJump.ts +57 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgGrasshopper = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", x: "0px", y: "0px", viewBox: "0 0 375.9 244.9", style: {
|
|
3
|
+
enableBackground: "new 0 0 375.9 244.9"
|
|
4
|
+
}, xmlSpace: "preserve", ...props }, /* @__PURE__ */ React.createElement("style", { type: "text/css" }, "\n .st0{opacity:0.05;}\n .st1{fill:#A78256;}\n .st2{fill:#8BC143;}\n .st3{fill:#25572C;}\n .st4{fill:#367F3D;}\n .st5{clip-path:url(#SVGID_00000004530938209597365300000002644174144295954342_);fill:#FFFFFF;}\n .st6{fill:#D5DA38;}\n .st7{fill:#DCB78B;}\n .st8{fill:#A68356;}\n .st9{fill:none;}\n .st10{fill:#296A35;}\n .st11{fill:#24572C;}\n .st12{fill:#56B347;}\n .st13{fill:#2E753A;}\n .st14{fill:#FFFFFF;}\n .st15{fill:#78983D;}\n .st16{fill:#38803E;}\n"), /* @__PURE__ */ React.createElement("g", { id: "Layer_4" }, /* @__PURE__ */ React.createElement("path", { className: "st0", d: "M348.07,224.58c0,13.58-76.31,16.29-168.48,13.91c-85.51-2.21-167.67-12.7-167.67-26.28 c0-13.58,75.86-16.6,168-13.55C251.54,201.04,348.07,211,348.07,224.58z" })), /* @__PURE__ */ React.createElement("g", { id: "Layer_5" }, /* @__PURE__ */ React.createElement("path", { className: "st1", d: "M191.33,63.44c-4.71-1.27-9.7,3.77-11.78,5.44c-22.75,18.26-65.08,108.22-68.32,110.8 c-2.65,2.11-12.55-4.77-26.06,6.99c-2.28,1.99,17.71-3.94,27.35,4.79c4.31,3.9,22.67-31.3,43.4-74.21 c7.89-16.33,16.66-28.67,29.37-41.6c3.95-4.02,9.74-6.99,9.13-9.83C194.07,64.16,191.67,63.53,191.33,63.44z" }), /* @__PURE__ */ React.createElement("path", { className: "st2", d: "M315.5,185.71c19.53-4.58,25.95-33.16,23.08-54.88c-3.64-27.61-17.56-34.28-34.67-33.9 c-19.88,0.44-44.11,22.97-32.88,51.46C277.76,165.5,296.2,190.24,315.5,185.71z" }), /* @__PURE__ */ React.createElement("path", { className: "st3", d: "M317.37,92.95c-1.19,0.17-6.89-0.13-6.55-0.52c16.19-18.5,39.73-46.86,55.69-73.93 c0.14-0.24,1.75,7.27-24.68,43.19C341.84,61.7,317.94,92.87,317.37,92.95z" }), /* @__PURE__ */ React.createElement("path", { className: "st4", d: "M295.82,101.2c-2.01-0.96,43.56-73.4,51-101.15c0.27-1.02-0.95,15.86-12.52,38.58 C315.28,76,306.48,92.6,301.71,101.2C301.06,102.37,297.81,102.14,295.82,101.2z" }), /* @__PURE__ */ React.createElement("g", null, /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("path", { id: "SVGID_1_", d: "M337.53,110.9c4.31-1.33,15.13,4.96,15.29,15.68c0.13,8.83-8.71,15.46-11.6,15.57 c-1.01,0.04,0.03-4.88-0.72-15.7C340.01,119.23,335.7,111.46,337.53,110.9z" })), /* @__PURE__ */ React.createElement("use", { xlinkHref: "#SVGID_1_", style: {
|
|
5
|
+
overflow: "visible",
|
|
6
|
+
fill: "#8BC143"
|
|
7
|
+
} }), /* @__PURE__ */ React.createElement("clipPath", { id: "SVGID_00000141425935757089766400000014964260461132888230_" }, /* @__PURE__ */ React.createElement("use", { xlinkHref: "#SVGID_1_", style: {
|
|
8
|
+
overflow: "visible"
|
|
9
|
+
} })), /* @__PURE__ */ React.createElement("circle", { style: {
|
|
10
|
+
clipPath: "url(#SVGID_00000141425935757089766400000014964260461132888230_)",
|
|
11
|
+
fill: "#FFFFFF"
|
|
12
|
+
}, cx: 337.66, cy: 125.78, r: 12.55 })), /* @__PURE__ */ React.createElement("path", { className: "st4", d: "M72,148.17c12.3-16.8,133.34-31.43,144.28-31.28c0.4,0.01,0.69,4.28,22.94,13.64 c2.33,0.98,10.66,4.72,16.04,13.86c2.43,4.12,4.42,10.67,4.47,15.71c0.01,1.33-56.06,5.28-103.07,4.71 C96.02,164.07,68.08,153.52,72,148.17z" }), /* @__PURE__ */ React.createElement("path", { className: "st6", d: "M113.86,186.55c-5.06-0.46-27.13-8.1-29.26-21.47c-0.61-3.81,0.35-6.85,0.8-8.08 c0.59-1.6,23.41,9.72,87.9,8.39c64.06-1.32,85.65-5.83,86.01-5.03C261.99,166.36,217.6,195.93,113.86,186.55z" }), /* @__PURE__ */ React.createElement("path", { className: "st2", d: "M223.03,117.14c0.76-3.5,10.69-5.08,18.2-5.08c8.44,0,13.29-0.15,19.65-0.89c12.74-1.48,18.97-6.96,16.62-4.53 c-9.94,10.29-9.77,18.79-8.5,32.04c1.43,14.96,14.3,27.99,13.47,28.38c-4.47,2.09-10.28,6.04-15.14,4.32 c-9.04-3.19-4.77-21.85-13.13-32.7C246.81,129.06,222,121.89,223.03,117.14z" }), /* @__PURE__ */ React.createElement("path", { d: "M282.17,152.19c-0.5,4.28,0.64,14.39,6.17,20.99c6.21,7.43,5.99,7.21,12.31,9.99c0,0,0.01,0,0.01,0 c0.38-0.14-16.24-8.73-16.42-31.1C284.23,150.94,282.22,151.73,282.17,152.19z" }), /* @__PURE__ */ React.createElement("path", { className: "st7", d: "M45.22,202.22c6.4-10.37,14.58-24.72,24.79-41.13c0,0,21.09-33.2,24.52-37.55c0,0,3.69-5.56,18.22-23.3 c0,0,2.49-3.04,9.72-9.39c3.36-2.95,4.91-4.03,7.18-4.42c2.76-0.47,6.2,0.15,8.83,1.99c0.61,0.42,1.07,0.8,1.1,0.88 c1.06,2.57,1.99,6.55-1.88,7.07c-2.91,0.39-4.38-0.83-6.43-0.18c-7.92,2.5-29.4,29.72-54.03,76.49 c-3.25,6.17-19.82,35.14-27.33,40.86c-0.17,0.13-0.66,0.66-3.12-0.63c-13.53-7.14-29.12-3.25-29.21-3.95 c-0.06-0.49,10.19-7.43,18.55-6.93C37.99,202.14,45.53,202.14,45.22,202.22z" }), /* @__PURE__ */ React.createElement("path", { className: "st7", d: "M233.42,187.34c-2.31-1.13-4.34,0.53-5.99,1.85c0,0-6.49,4.43-3.04,9.36c6.54,9.33,19.97,19.12,50.58,34.48 c6.93,3.48,15.18,1.56,14.55,0.75c-3.2-4.11-39.95-19.08-51.05-29.73c-3.94-3.78-7.05-6.27-6.02-8.78 c0.66-1.61,2.83-2.06,3.31-3.64C236.28,189.94,235.32,188.95,233.42,187.34z" }), /* @__PURE__ */ React.createElement("path", { className: "st8", d: "M263.01,192.63c-1.5-1.35-2.61-2.35-6.44,2.21c-2.22,2.64-3.78,5.85-3.24,8.5 c0.99,4.86,21.45,8.27,38.69,13.14c37.25,10.53,37.8,2.69,36.99,1.8c-0.24-0.27-25.47-3.5-49.47-9.42 c-14.27-3.52-18.08-5.91-17.15-10.56C262.86,195.91,266,195.32,263.01,192.63z" }), /* @__PURE__ */ React.createElement("path", { className: "st9", d: "M71.78,148.17c2.54-10.82,106.81-31.18,144.37-31.18c0.44,0,0.86,0.75,1.89,1.97c2.9,3.43,6.53,4.52,7.57,4.99 c6.46,2.94,19.64,8.94,26.12,15.55c3.31,3.37,7.27,9.35,8.34,20.49C235.66,168.76,67.45,166.6,71.78,148.17z" }), /* @__PURE__ */ React.createElement("path", { className: "st10", d: "M230.47,186.52c-2.04-2.62,11.48-19.13,25.95-22.56c1.88-0.45,5.96-0.11,7.34,1.93 c2.6,3.84-1.44,12.39-10.1,17.84c-8.87,5.59-16.41,9.16-17.23,8.33c-1.01-1.01-0.23-2.89-1.77-4.47 C233.1,185.98,231.17,187.41,230.47,186.52z" }), /* @__PURE__ */ React.createElement("path", { className: "st11", d: "M264.81,194.71c-1.66-0.94-1.79-3.5-3.48-3.59c-2.06-0.11-3.41,3.84-4.91,3.48c-0.82-0.2-1.3-1.54-1.33-2.37 c-0.22-6.52,3.26-20.26,6.63-23.47c2.17-2.06,3.76,2.9,8.12,3.09c3.75,0.17,11.88-5.24,13.86-3.59c2.65,2.21-2.86,8.62-3.48,9.72 C275.33,186.72,265.69,195.21,264.81,194.71z" }), /* @__PURE__ */ React.createElement("path", { className: "st12", d: "M228.92,187.2c1.07-0.44-0.94-5.63,7.67-13.25c6.51-5.76,10.78-6.24,11.82-8.56 c0.72-1.61-20.78-17.36-41.36-21.92c-11.26-2.5-61.01-55.21-63-56.21c-1.79-0.9-13.79,7.06-13.42,10.21 c0.35,2.92,13.91,9.77,35.89,27C183.86,138.07,211.31,194.44,228.92,187.2z" }), /* @__PURE__ */ React.createElement("path", { className: "st13", d: "M199.73,65.27c0.65-0.11,36.98,40.09,41.89,43.44c0.85,0.58-14.58,2.12-14.94,1.47 c-7.27-12.72-38.41-29.6-38.98-35.91C187.4,71.04,196.38,65.84,199.73,65.27z" }), /* @__PURE__ */ React.createElement("path", { className: "st14", d: "M313.18,126.49c0,8.27-6.71,14.98-14.98,14.98c-5.19,0-8.11-3.24-8.94-3.95c-0.44-0.38-6.18-4.4-6.04-11.03 c0.15-7.14,6.13-14.98,14.98-14.98C306.47,111.5,313.18,118.21,313.18,126.49z" }), /* @__PURE__ */ React.createElement("path", { d: "M339.38,121.61c-0.26-1.14,6.55,3.28,6.55,8.28c0,6.29-4.95,9.39-5.12,6.37C340.64,133.11,341.42,130.66,339.38,121.61z" }), /* @__PURE__ */ React.createElement("path", { d: "M277.61,148.06c0.1-0.43,2.35,1.42,5.98,1.9c3.27,0.43,5.79-0.08,5.77,0.07c-0.07,0.54-2.51,2.97-6.17,2.54 C278.34,152,277.5,148.53,277.61,148.06z" }), /* @__PURE__ */ React.createElement("circle", { cx: 296.71, cy: 131.43, r: 8.53 }), /* @__PURE__ */ React.createElement("path", { d: "M290.02,104.95c-4.8,1.75-12.41,8.08-11.71,9.17c1.25,1.95,17.54-5.95,17.02-8.23 C295.06,104.68,293.99,103.51,290.02,104.95z" }), /* @__PURE__ */ React.createElement("circle", { className: "st14", cx: 297.94, cy: 127.11, r: 2.21 }), /* @__PURE__ */ React.createElement("path", { className: "st15", d: "M92.76,178.11c-0.22-0.28-0.39-8.02,4-10.96c0.11-0.07,3.48-0.08,3.64-0.03c0.39,0.11-3.98,5.51-4.72,12.58 C95.63,180.22,92.86,178.23,92.76,178.11z" }), /* @__PURE__ */ React.createElement("path", { className: "st15", d: "M113.67,185.95c-0.22-0.28-1.35-14.46,3.87-15.24c0.97-0.14,3.13-0.09,2.97,0.01 c-0.35,0.21-3.53,4.43-3.45,15.73C117.06,186.98,113.77,186.07,113.67,185.95z" }), /* @__PURE__ */ React.createElement("path", { className: "st15", d: "M138.4,188.86c-0.22-0.28-3.66-13.37,0.43-15.95c0.83-0.52,3.35-0.99,3.18-0.89 c-0.35,0.21-0.78,5.37-0.7,16.67C141.32,189.22,138.49,188.98,138.4,188.86z" }), /* @__PURE__ */ React.createElement("path", { className: "st15", d: "M161.4,188.79c-0.35-0.04-5.78-13.76-1.69-16.34c0.8-0.51,3.18-1.24,3.19-1.2c0,0-0.01,0.01-0.01,0.01 c-0.23,0.15-0.44,1.64-0.63,3.7c-0.11,1.24-0.05,3.87,0.07,4.9c0.77,6.19,2.5,8.5,2.15,8.69 C163.62,188.99,162.35,188.9,161.4,188.79z" }), /* @__PURE__ */ React.createElement("path", { className: "st15", d: "M180.03,187.6c-0.35-0.04-6.32-13.45-2.23-16.03c0.8-0.51,3.18-1.24,3.19-1.2c0,0-0.5,0.13-0.5,0.13 c-0.23,0.15-0.32,1.46-0.5,3.52c-0.11,1.24,0.31,3.92,0.44,4.95c0.77,6.19,2.64,8.55,2.38,8.57 C181.95,187.6,180.97,187.71,180.03,187.6z" }), /* @__PURE__ */ React.createElement("path", { className: "st15", d: "M198.4,185.28c-0.35-0.04-8.12-13.29-4.02-15.87c0.8-0.51,2.21-1.68,2.22-1.64c0,0,0.55,0,0.55,0 c-0.23,0.15,0.04,3.79,0.14,4.39c0.22,1.23,0.93,4.64,1.74,6.57c2.39,5.76,3.39,6.47,3.13,6.49 C201.31,185.29,199.35,185.39,198.4,185.28z" })), /* @__PURE__ */ React.createElement("g", { id: "Layer_3" }, /* @__PURE__ */ React.createElement("path", { className: "st16", d: "M277.43,106.34c1.1-0.86-7.15,2.43-7.98,3.2c-7.37,6.87-7.84,21.06-5.39,31.28 c3.23,13.47,9.18,28.71,14.36,28.52c0.93-0.03,2.76-0.77,3.31-1.63c0.25-0.39-11.13-8.17-14.05-34.12 C265.92,117.99,274.28,108.78,277.43,106.34z" })));
|
|
13
|
+
export {
|
|
14
|
+
SvgGrasshopper as default
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=grasshopper.svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grasshopper.svg.js","sources":["../../../src/assets/grasshopper.svg?react"],"sourcesContent":["import * as React from \"react\";\nconst SvgGrasshopper = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", xmlnsXlink: \"http://www.w3.org/1999/xlink\", x: \"0px\", y: \"0px\", viewBox: \"0 0 375.9 244.9\", style: {\n enableBackground: \"new 0 0 375.9 244.9\"\n}, xmlSpace: \"preserve\", ...props }, /* @__PURE__ */ React.createElement(\"style\", { type: \"text/css\" }, \"\\n\t.st0{opacity:0.05;}\\n\t.st1{fill:#A78256;}\\n\t.st2{fill:#8BC143;}\\n\t.st3{fill:#25572C;}\\n\t.st4{fill:#367F3D;}\\n\t.st5{clip-path:url(#SVGID_00000004530938209597365300000002644174144295954342_);fill:#FFFFFF;}\\n\t.st6{fill:#D5DA38;}\\n\t.st7{fill:#DCB78B;}\\n\t.st8{fill:#A68356;}\\n\t.st9{fill:none;}\\n\t.st10{fill:#296A35;}\\n\t.st11{fill:#24572C;}\\n\t.st12{fill:#56B347;}\\n\t.st13{fill:#2E753A;}\\n\t.st14{fill:#FFFFFF;}\\n\t.st15{fill:#78983D;}\\n\t.st16{fill:#38803E;}\\n\"), /* @__PURE__ */ React.createElement(\"g\", { id: \"Layer_4\" }, /* @__PURE__ */ React.createElement(\"path\", { className: \"st0\", d: \"M348.07,224.58c0,13.58-76.31,16.29-168.48,13.91c-85.51-2.21-167.67-12.7-167.67-26.28 c0-13.58,75.86-16.6,168-13.55C251.54,201.04,348.07,211,348.07,224.58z\" })), /* @__PURE__ */ React.createElement(\"g\", { id: \"Layer_5\" }, /* @__PURE__ */ React.createElement(\"path\", { className: \"st1\", d: \"M191.33,63.44c-4.71-1.27-9.7,3.77-11.78,5.44c-22.75,18.26-65.08,108.22-68.32,110.8 c-2.65,2.11-12.55-4.77-26.06,6.99c-2.28,1.99,17.71-3.94,27.35,4.79c4.31,3.9,22.67-31.3,43.4-74.21 c7.89-16.33,16.66-28.67,29.37-41.6c3.95-4.02,9.74-6.99,9.13-9.83C194.07,64.16,191.67,63.53,191.33,63.44z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st2\", d: \"M315.5,185.71c19.53-4.58,25.95-33.16,23.08-54.88c-3.64-27.61-17.56-34.28-34.67-33.9 c-19.88,0.44-44.11,22.97-32.88,51.46C277.76,165.5,296.2,190.24,315.5,185.71z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st3\", d: \"M317.37,92.95c-1.19,0.17-6.89-0.13-6.55-0.52c16.19-18.5,39.73-46.86,55.69-73.93 c0.14-0.24,1.75,7.27-24.68,43.19C341.84,61.7,317.94,92.87,317.37,92.95z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st4\", d: \"M295.82,101.2c-2.01-0.96,43.56-73.4,51-101.15c0.27-1.02-0.95,15.86-12.52,38.58 C315.28,76,306.48,92.6,301.71,101.2C301.06,102.37,297.81,102.14,295.82,101.2z\" }), /* @__PURE__ */ React.createElement(\"g\", null, /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"path\", { id: \"SVGID_1_\", d: \"M337.53,110.9c4.31-1.33,15.13,4.96,15.29,15.68c0.13,8.83-8.71,15.46-11.6,15.57 c-1.01,0.04,0.03-4.88-0.72-15.7C340.01,119.23,335.7,111.46,337.53,110.9z\" })), /* @__PURE__ */ React.createElement(\"use\", { xlinkHref: \"#SVGID_1_\", style: {\n overflow: \"visible\",\n fill: \"#8BC143\"\n} }), /* @__PURE__ */ React.createElement(\"clipPath\", { id: \"SVGID_00000141425935757089766400000014964260461132888230_\" }, /* @__PURE__ */ React.createElement(\"use\", { xlinkHref: \"#SVGID_1_\", style: {\n overflow: \"visible\"\n} })), /* @__PURE__ */ React.createElement(\"circle\", { style: {\n clipPath: \"url(#SVGID_00000141425935757089766400000014964260461132888230_)\",\n fill: \"#FFFFFF\"\n}, cx: 337.66, cy: 125.78, r: 12.55 })), /* @__PURE__ */ React.createElement(\"path\", { className: \"st4\", d: \"M72,148.17c12.3-16.8,133.34-31.43,144.28-31.28c0.4,0.01,0.69,4.28,22.94,13.64 c2.33,0.98,10.66,4.72,16.04,13.86c2.43,4.12,4.42,10.67,4.47,15.71c0.01,1.33-56.06,5.28-103.07,4.71 C96.02,164.07,68.08,153.52,72,148.17z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st6\", d: \"M113.86,186.55c-5.06-0.46-27.13-8.1-29.26-21.47c-0.61-3.81,0.35-6.85,0.8-8.08 c0.59-1.6,23.41,9.72,87.9,8.39c64.06-1.32,85.65-5.83,86.01-5.03C261.99,166.36,217.6,195.93,113.86,186.55z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st2\", d: \"M223.03,117.14c0.76-3.5,10.69-5.08,18.2-5.08c8.44,0,13.29-0.15,19.65-0.89c12.74-1.48,18.97-6.96,16.62-4.53 c-9.94,10.29-9.77,18.79-8.5,32.04c1.43,14.96,14.3,27.99,13.47,28.38c-4.47,2.09-10.28,6.04-15.14,4.32 c-9.04-3.19-4.77-21.85-13.13-32.7C246.81,129.06,222,121.89,223.03,117.14z\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M282.17,152.19c-0.5,4.28,0.64,14.39,6.17,20.99c6.21,7.43,5.99,7.21,12.31,9.99c0,0,0.01,0,0.01,0 c0.38-0.14-16.24-8.73-16.42-31.1C284.23,150.94,282.22,151.73,282.17,152.19z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st7\", d: \"M45.22,202.22c6.4-10.37,14.58-24.72,24.79-41.13c0,0,21.09-33.2,24.52-37.55c0,0,3.69-5.56,18.22-23.3 c0,0,2.49-3.04,9.72-9.39c3.36-2.95,4.91-4.03,7.18-4.42c2.76-0.47,6.2,0.15,8.83,1.99c0.61,0.42,1.07,0.8,1.1,0.88 c1.06,2.57,1.99,6.55-1.88,7.07c-2.91,0.39-4.38-0.83-6.43-0.18c-7.92,2.5-29.4,29.72-54.03,76.49 c-3.25,6.17-19.82,35.14-27.33,40.86c-0.17,0.13-0.66,0.66-3.12-0.63c-13.53-7.14-29.12-3.25-29.21-3.95 c-0.06-0.49,10.19-7.43,18.55-6.93C37.99,202.14,45.53,202.14,45.22,202.22z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st7\", d: \"M233.42,187.34c-2.31-1.13-4.34,0.53-5.99,1.85c0,0-6.49,4.43-3.04,9.36c6.54,9.33,19.97,19.12,50.58,34.48 c6.93,3.48,15.18,1.56,14.55,0.75c-3.2-4.11-39.95-19.08-51.05-29.73c-3.94-3.78-7.05-6.27-6.02-8.78 c0.66-1.61,2.83-2.06,3.31-3.64C236.28,189.94,235.32,188.95,233.42,187.34z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st8\", d: \"M263.01,192.63c-1.5-1.35-2.61-2.35-6.44,2.21c-2.22,2.64-3.78,5.85-3.24,8.5 c0.99,4.86,21.45,8.27,38.69,13.14c37.25,10.53,37.8,2.69,36.99,1.8c-0.24-0.27-25.47-3.5-49.47-9.42 c-14.27-3.52-18.08-5.91-17.15-10.56C262.86,195.91,266,195.32,263.01,192.63z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st9\", d: \"M71.78,148.17c2.54-10.82,106.81-31.18,144.37-31.18c0.44,0,0.86,0.75,1.89,1.97c2.9,3.43,6.53,4.52,7.57,4.99 c6.46,2.94,19.64,8.94,26.12,15.55c3.31,3.37,7.27,9.35,8.34,20.49C235.66,168.76,67.45,166.6,71.78,148.17z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st10\", d: \"M230.47,186.52c-2.04-2.62,11.48-19.13,25.95-22.56c1.88-0.45,5.96-0.11,7.34,1.93 c2.6,3.84-1.44,12.39-10.1,17.84c-8.87,5.59-16.41,9.16-17.23,8.33c-1.01-1.01-0.23-2.89-1.77-4.47 C233.1,185.98,231.17,187.41,230.47,186.52z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st11\", d: \"M264.81,194.71c-1.66-0.94-1.79-3.5-3.48-3.59c-2.06-0.11-3.41,3.84-4.91,3.48c-0.82-0.2-1.3-1.54-1.33-2.37 c-0.22-6.52,3.26-20.26,6.63-23.47c2.17-2.06,3.76,2.9,8.12,3.09c3.75,0.17,11.88-5.24,13.86-3.59c2.65,2.21-2.86,8.62-3.48,9.72 C275.33,186.72,265.69,195.21,264.81,194.71z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st12\", d: \"M228.92,187.2c1.07-0.44-0.94-5.63,7.67-13.25c6.51-5.76,10.78-6.24,11.82-8.56 c0.72-1.61-20.78-17.36-41.36-21.92c-11.26-2.5-61.01-55.21-63-56.21c-1.79-0.9-13.79,7.06-13.42,10.21 c0.35,2.92,13.91,9.77,35.89,27C183.86,138.07,211.31,194.44,228.92,187.2z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st13\", d: \"M199.73,65.27c0.65-0.11,36.98,40.09,41.89,43.44c0.85,0.58-14.58,2.12-14.94,1.47 c-7.27-12.72-38.41-29.6-38.98-35.91C187.4,71.04,196.38,65.84,199.73,65.27z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st14\", d: \"M313.18,126.49c0,8.27-6.71,14.98-14.98,14.98c-5.19,0-8.11-3.24-8.94-3.95c-0.44-0.38-6.18-4.4-6.04-11.03 c0.15-7.14,6.13-14.98,14.98-14.98C306.47,111.5,313.18,118.21,313.18,126.49z\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M339.38,121.61c-0.26-1.14,6.55,3.28,6.55,8.28c0,6.29-4.95,9.39-5.12,6.37C340.64,133.11,341.42,130.66,339.38,121.61z\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M277.61,148.06c0.1-0.43,2.35,1.42,5.98,1.9c3.27,0.43,5.79-0.08,5.77,0.07c-0.07,0.54-2.51,2.97-6.17,2.54 C278.34,152,277.5,148.53,277.61,148.06z\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 296.71, cy: 131.43, r: 8.53 }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M290.02,104.95c-4.8,1.75-12.41,8.08-11.71,9.17c1.25,1.95,17.54-5.95,17.02-8.23 C295.06,104.68,293.99,103.51,290.02,104.95z\" }), /* @__PURE__ */ React.createElement(\"circle\", { className: \"st14\", cx: 297.94, cy: 127.11, r: 2.21 }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st15\", d: \"M92.76,178.11c-0.22-0.28-0.39-8.02,4-10.96c0.11-0.07,3.48-0.08,3.64-0.03c0.39,0.11-3.98,5.51-4.72,12.58 C95.63,180.22,92.86,178.23,92.76,178.11z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st15\", d: \"M113.67,185.95c-0.22-0.28-1.35-14.46,3.87-15.24c0.97-0.14,3.13-0.09,2.97,0.01 c-0.35,0.21-3.53,4.43-3.45,15.73C117.06,186.98,113.77,186.07,113.67,185.95z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st15\", d: \"M138.4,188.86c-0.22-0.28-3.66-13.37,0.43-15.95c0.83-0.52,3.35-0.99,3.18-0.89 c-0.35,0.21-0.78,5.37-0.7,16.67C141.32,189.22,138.49,188.98,138.4,188.86z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st15\", d: \"M161.4,188.79c-0.35-0.04-5.78-13.76-1.69-16.34c0.8-0.51,3.18-1.24,3.19-1.2c0,0-0.01,0.01-0.01,0.01 c-0.23,0.15-0.44,1.64-0.63,3.7c-0.11,1.24-0.05,3.87,0.07,4.9c0.77,6.19,2.5,8.5,2.15,8.69 C163.62,188.99,162.35,188.9,161.4,188.79z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st15\", d: \"M180.03,187.6c-0.35-0.04-6.32-13.45-2.23-16.03c0.8-0.51,3.18-1.24,3.19-1.2c0,0-0.5,0.13-0.5,0.13 c-0.23,0.15-0.32,1.46-0.5,3.52c-0.11,1.24,0.31,3.92,0.44,4.95c0.77,6.19,2.64,8.55,2.38,8.57 C181.95,187.6,180.97,187.71,180.03,187.6z\" }), /* @__PURE__ */ React.createElement(\"path\", { className: \"st15\", d: \"M198.4,185.28c-0.35-0.04-8.12-13.29-4.02-15.87c0.8-0.51,2.21-1.68,2.22-1.64c0,0,0.55,0,0.55,0 c-0.23,0.15,0.04,3.79,0.14,4.39c0.22,1.23,0.93,4.64,1.74,6.57c2.39,5.76,3.39,6.47,3.13,6.49 C201.31,185.29,199.35,185.39,198.4,185.28z\" })), /* @__PURE__ */ React.createElement(\"g\", { id: \"Layer_3\" }, /* @__PURE__ */ React.createElement(\"path\", { className: \"st16\", d: \"M277.43,106.34c1.1-0.86-7.15,2.43-7.98,3.2c-7.37,6.87-7.84,21.06-5.39,31.28 c3.23,13.47,9.18,28.71,14.36,28.52c0.93-0.03,2.76-0.77,3.31-1.63c0.25-0.39-11.13-8.17-14.05-34.12 C265.92,117.99,274.28,108.78,277.43,106.34z\" })));\nexport default SvgGrasshopper;\n"],"names":[],"mappings":";AACK,MAAC,iBAAiB,CAAC,UAA0B,sBAAM,cAAc,OAAO,EAAE,OAAO,8BAA8B,YAAY,gCAAgC,GAAG,OAAO,GAAG,OAAO,SAAS,mBAAmB,OAAO;AAAA,EACrN,kBAAkB;AACpB,GAAG,UAAU,YAAY,GAAG,MAAK,GAAoB,sBAAM,cAAc,SAAS,EAAE,MAAM,WAAU,GAAI,wcAAwc,GAAmB,sBAAM,cAAc,KAAK,EAAE,IAAI,UAAS,GAAoB,sBAAM,cAAc,QAAQ,EAAE,WAAW,OAAO,GAAG,6JAA4J,CAAE,CAAC,GAAmB,sBAAM,cAAc,KAAK,EAAE,IAAI,aAA6B,sBAAM,cAAc,QAAQ,EAAE,WAAW,OAAO,GAAG,gSAA+R,CAAE,GAAmB,sBAAM,cAAc,QAAQ,EAAE,WAAW,OAAO,GAAG,mK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79
|
}[] | undefined;
|
|
80
|
+
quickJumps?: {
|
|
81
|
+
url: string;
|
|
82
|
+
title: string;
|
|
83
|
+
identity: string;
|
|
84
|
+
}[] | undefined;
|
|
80
85
|
parentSlug?: string | undefined;
|
|
81
86
|
tier?: string | undefined;
|
|
82
87
|
aliases?: string[] | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Resource } from '@igstack/app-catalog-backend-core';
|
|
2
|
+
/**
|
|
3
|
+
* Quick Jump: paste an id, open the matching page. One column per identity the
|
|
4
|
+
* app's jumps ask for; only the identities the user keeps are rendered, the rest
|
|
5
|
+
* are one click away behind Configure.
|
|
6
|
+
*/
|
|
7
|
+
export declare function QuickJumpSection({ app }: {
|
|
8
|
+
app: Resource;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Pin, Settings2 } from "lucide-react";
|
|
3
|
+
import React__default from "react";
|
|
4
|
+
import SvgGrasshopper from "../../../../assets/grasshopper.svg.js";
|
|
5
|
+
import { cn } from "../../../../lib/utils.js";
|
|
6
|
+
import { Checkbox } from "../../../../ui/checkbox.js";
|
|
7
|
+
import { Input } from "../../../../ui/input.js";
|
|
8
|
+
import { Popover, PopoverTrigger, PopoverContent } from "../../../../ui/popover.js";
|
|
9
|
+
import { groupQuickJumps, quickJumpFieldName, buildQuickJumpUrl } from "../../utils/quickJump.js";
|
|
10
|
+
function prefsKey(slug) {
|
|
11
|
+
return `ac:quickjump:${slug}`;
|
|
12
|
+
}
|
|
13
|
+
function readPrefs(slug) {
|
|
14
|
+
try {
|
|
15
|
+
const raw = localStorage.getItem(prefsKey(slug));
|
|
16
|
+
return raw ? JSON.parse(raw) : {};
|
|
17
|
+
} catch {
|
|
18
|
+
return {};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function writePrefs(slug, prefs) {
|
|
22
|
+
try {
|
|
23
|
+
localStorage.setItem(prefsKey(slug), JSON.stringify(prefs));
|
|
24
|
+
} catch {
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function JumpButton({
|
|
28
|
+
jump,
|
|
29
|
+
value,
|
|
30
|
+
appUrl
|
|
31
|
+
}) {
|
|
32
|
+
const trimmed = value.trim();
|
|
33
|
+
const href = trimmed ? buildQuickJumpUrl(jump, trimmed, appUrl) : null;
|
|
34
|
+
return /* @__PURE__ */ jsxs(
|
|
35
|
+
"a",
|
|
36
|
+
{
|
|
37
|
+
href: href ?? void 0,
|
|
38
|
+
target: "_blank",
|
|
39
|
+
rel: "noopener noreferrer",
|
|
40
|
+
"aria-disabled": href ? void 0 : true,
|
|
41
|
+
title: href ?? `Fill in ${jump.identity} first`,
|
|
42
|
+
className: cn(
|
|
43
|
+
"group/jump flex items-center gap-2 rounded-md border px-2.5 py-1.5 text-left text-xs font-semibold transition-colors",
|
|
44
|
+
href ? "animate-button-pop bg-card shadow-sm hover:bg-accent/40" : "pointer-events-none border-dashed bg-muted text-muted-foreground opacity-70"
|
|
45
|
+
),
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1 wrap-anywhere", children: [
|
|
48
|
+
jump.title,
|
|
49
|
+
trimmed && /* @__PURE__ */ jsx("span", { className: "ml-1 font-mono", children: trimmed })
|
|
50
|
+
] }),
|
|
51
|
+
/* @__PURE__ */ jsxs(
|
|
52
|
+
"span",
|
|
53
|
+
{
|
|
54
|
+
className: cn(
|
|
55
|
+
"flex shrink-0 origin-bottom items-center gap-1 text-hopper opacity-0 transition-[opacity,transform]",
|
|
56
|
+
"group-hover/jump:-translate-x-0.5 group-hover/jump:translate-y-0.5 group-hover/jump:rotate-2 group-hover/jump:scale-y-90",
|
|
57
|
+
"group-hover/jump:opacity-100 group-focus-visible/jump:opacity-100 motion-reduce:transform-none"
|
|
58
|
+
),
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ jsx("span", { className: "text-[0.65rem] font-extrabold tracking-widest", children: "JUMP" }),
|
|
61
|
+
/* @__PURE__ */ jsx(SvgGrasshopper, { "aria-hidden": true, className: "h-5 w-auto" })
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
function QuickJumpSection({ app }) {
|
|
70
|
+
const identities = React__default.useMemo(() => groupQuickJumps(app), [app]);
|
|
71
|
+
const [prefs, setPrefs] = React__default.useState(
|
|
72
|
+
() => readPrefs(app.slug)
|
|
73
|
+
);
|
|
74
|
+
const [values, setValues] = React__default.useState({});
|
|
75
|
+
React__default.useEffect(() => {
|
|
76
|
+
setPrefs(readPrefs(app.slug));
|
|
77
|
+
setValues({});
|
|
78
|
+
}, [app.slug]);
|
|
79
|
+
if (identities.length === 0) return null;
|
|
80
|
+
const savePrefs = (next) => {
|
|
81
|
+
setPrefs(next);
|
|
82
|
+
writePrefs(app.slug, next);
|
|
83
|
+
};
|
|
84
|
+
const shown = prefs.shown ?? identities.slice(0, 1).map((i) => i.identity);
|
|
85
|
+
const visible = identities.filter((i) => shown.includes(i.identity));
|
|
86
|
+
const toggleShown = (identity) => savePrefs({
|
|
87
|
+
...prefs,
|
|
88
|
+
shown: shown.includes(identity) ? shown.filter((s) => s !== identity) : [...shown, identity]
|
|
89
|
+
});
|
|
90
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("mt-6", prefs.pinned && "order-[-1]"), children: [
|
|
91
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center gap-2", children: [
|
|
92
|
+
/* @__PURE__ */ jsx(SvgGrasshopper, { "aria-hidden": true, className: "h-[1.15rem] w-auto shrink-0" }),
|
|
93
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-medium", children: "Quick Jump" }),
|
|
94
|
+
/* @__PURE__ */ jsx(
|
|
95
|
+
"button",
|
|
96
|
+
{
|
|
97
|
+
type: "button",
|
|
98
|
+
onClick: () => savePrefs({ ...prefs, pinned: !prefs.pinned }),
|
|
99
|
+
title: prefs.pinned ? "Unpin section" : "Pin section — keep Quick Jump at the top of this card",
|
|
100
|
+
"aria-pressed": prefs.pinned ?? false,
|
|
101
|
+
className: cn(
|
|
102
|
+
"rounded-sm p-0.5 transition-opacity hover:bg-muted",
|
|
103
|
+
prefs.pinned ? "text-primary" : "text-muted-foreground opacity-50 hover:opacity-100"
|
|
104
|
+
),
|
|
105
|
+
children: /* @__PURE__ */ jsx(Pin, { className: "size-3.5" })
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
prefs.pinned && /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-primary", children: "pinned to top" }),
|
|
109
|
+
identities.length > 1 && /* @__PURE__ */ jsxs(Popover, { children: [
|
|
110
|
+
/* @__PURE__ */ jsxs(PopoverTrigger, { className: "ml-auto inline-flex items-center gap-1.5 rounded-full border border-primary/45 bg-accent/45 px-2.5 py-1 text-xs font-bold shadow-sm transition-colors hover:border-primary hover:bg-accent/80", children: [
|
|
111
|
+
/* @__PURE__ */ jsx(Settings2, { className: "size-3.5 text-primary" }),
|
|
112
|
+
"Configure (",
|
|
113
|
+
visible.length,
|
|
114
|
+
"/",
|
|
115
|
+
identities.length,
|
|
116
|
+
")"
|
|
117
|
+
] }),
|
|
118
|
+
/* @__PURE__ */ jsxs(PopoverContent, { align: "end", className: "w-64 p-1.5", children: [
|
|
119
|
+
/* @__PURE__ */ jsx("p", { className: "px-1.5 pt-0.5 pb-1.5 text-[0.7rem] text-muted-foreground", children: "Tick an ID to show it on this card." }),
|
|
120
|
+
identities.map(({ identity, jumps }) => /* @__PURE__ */ jsxs(
|
|
121
|
+
"label",
|
|
122
|
+
{
|
|
123
|
+
className: "flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1.5 text-sm hover:bg-muted",
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ jsx(
|
|
126
|
+
Checkbox,
|
|
127
|
+
{
|
|
128
|
+
checked: shown.includes(identity),
|
|
129
|
+
onCheckedChange: () => toggleShown(identity)
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
identity,
|
|
133
|
+
/* @__PURE__ */ jsx("span", { className: "ml-auto font-mono text-[0.7rem] text-muted-foreground", children: jumps.length })
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
identity
|
|
137
|
+
))
|
|
138
|
+
] })
|
|
139
|
+
] })
|
|
140
|
+
] }),
|
|
141
|
+
/* @__PURE__ */ jsx("p", { className: "mb-3 text-xs text-muted-foreground", children: "Paste an ID and open the matching page." }),
|
|
142
|
+
visible.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "No IDs shown — pick one under Configure." }) : /* @__PURE__ */ jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: visible.map(({ identity, jumps }) => {
|
|
143
|
+
const value = values[identity] ?? "";
|
|
144
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-2", children: [
|
|
145
|
+
/* @__PURE__ */ jsx(
|
|
146
|
+
"label",
|
|
147
|
+
{
|
|
148
|
+
className: "truncate text-xs font-bold",
|
|
149
|
+
htmlFor: `qj-${app.slug}-${identity}`,
|
|
150
|
+
children: identity
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
/* @__PURE__ */ jsx(
|
|
154
|
+
Input,
|
|
155
|
+
{
|
|
156
|
+
id: `qj-${app.slug}-${identity}`,
|
|
157
|
+
name: quickJumpFieldName(identity),
|
|
158
|
+
autoComplete: "on",
|
|
159
|
+
placeholder: identity,
|
|
160
|
+
className: "bg-card font-mono",
|
|
161
|
+
value,
|
|
162
|
+
onChange: (e) => setValues((v) => ({ ...v, [identity]: e.target.value })),
|
|
163
|
+
onKeyDown: (e) => {
|
|
164
|
+
const first = jumps[0];
|
|
165
|
+
if (e.key !== "Enter" || !first) return;
|
|
166
|
+
if (!e.currentTarget.value.trim()) return;
|
|
167
|
+
const url = buildQuickJumpUrl(
|
|
168
|
+
first,
|
|
169
|
+
e.currentTarget.value,
|
|
170
|
+
app.appUrl
|
|
171
|
+
);
|
|
172
|
+
if (url) window.open(url, "_blank", "noopener,noreferrer");
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
jumps.map((jump) => /* @__PURE__ */ jsx(
|
|
177
|
+
JumpButton,
|
|
178
|
+
{
|
|
179
|
+
jump,
|
|
180
|
+
value,
|
|
181
|
+
appUrl: app.appUrl
|
|
182
|
+
},
|
|
183
|
+
`${jump.title}:${jump.url}`
|
|
184
|
+
))
|
|
185
|
+
] }, identity);
|
|
186
|
+
}) })
|
|
187
|
+
] });
|
|
188
|
+
}
|
|
189
|
+
export {
|
|
190
|
+
QuickJumpSection
|
|
191
|
+
};
|
|
192
|
+
//# sourceMappingURL=QuickJumpSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuickJumpSection.js","sources":["../../../../../../src/modules/appCatalog/ui/components/QuickJumpSection.tsx"],"sourcesContent":["import type { QuickJump, Resource } from '@igstack/app-catalog-backend-core'\nimport { Pin, Settings2 } from 'lucide-react'\nimport React from 'react'\n\nimport Grasshopper from '~/assets/grasshopper.svg?react'\nimport { cn } from '~/lib/utils'\nimport { Checkbox } from '~/ui/checkbox'\nimport { Input } from '~/ui/input'\nimport { Popover, PopoverContent, PopoverTrigger } from '~/ui/popover'\nimport {\n buildQuickJumpUrl,\n groupQuickJumps,\n quickJumpFieldName,\n} from '~/modules/appCatalog/utils/quickJump'\n\n/**\n * Per-user, per-app preferences. Which identities to render and whether to hoist\n * the section to the top of the card — a browser-local display choice, so it\n * lives in localStorage rather than costing a table and an authenticated route.\n */\ninterface QuickJumpPrefs {\n /** Keep the section at the top of the app card. */\n pinned?: boolean\n /** Identity labels to render. Absent = the first identity only. */\n shown?: string[]\n}\n\nfunction prefsKey(slug: string) {\n return `ac:quickjump:${slug}`\n}\n\nfunction readPrefs(slug: string): QuickJumpPrefs {\n try {\n const raw = localStorage.getItem(prefsKey(slug))\n return raw ? (JSON.parse(raw) as QuickJumpPrefs) : {}\n } catch {\n return {}\n }\n}\n\nfunction writePrefs(slug: string, prefs: QuickJumpPrefs) {\n try {\n localStorage.setItem(prefsKey(slug), JSON.stringify(prefs))\n } catch {\n // Private mode / full quota: the session still works, just doesn't persist.\n }\n}\n\n/**\n * One jump button. Disabled until its identity has a value: greyed and dashed,\n * so the empty input above reads as the thing to do first. The green JUMP tell\n * only shows on hover — one per row is repetition, not signal.\n */\nfunction JumpButton({\n jump,\n value,\n appUrl,\n}: {\n jump: QuickJump\n value: string\n appUrl?: string\n}) {\n const trimmed = value.trim()\n const href = trimmed ? buildQuickJumpUrl(jump, trimmed, appUrl) : null\n\n return (\n <a\n href={href ?? undefined}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-disabled={href ? undefined : true}\n title={href ?? `Fill in ${jump.identity} first`}\n className={cn(\n 'group/jump flex items-center gap-2 rounded-md border px-2.5 py-1.5 text-left text-xs font-semibold transition-colors',\n href\n ? 'animate-button-pop bg-card shadow-sm hover:bg-accent/40'\n : 'pointer-events-none border-dashed bg-muted text-muted-foreground opacity-70',\n )}\n >\n <span className=\"min-w-0 flex-1 wrap-anywhere\">\n {jump.title}\n {trimmed && <span className=\"ml-1 font-mono\">{trimmed}</span>}\n </span>\n <span\n className={cn(\n 'flex shrink-0 origin-bottom items-center gap-1 text-hopper opacity-0 transition-[opacity,transform]',\n 'group-hover/jump:-translate-x-0.5 group-hover/jump:translate-y-0.5 group-hover/jump:rotate-2 group-hover/jump:scale-y-90',\n 'group-hover/jump:opacity-100 group-focus-visible/jump:opacity-100 motion-reduce:transform-none',\n )}\n >\n <span className=\"text-[0.65rem] font-extrabold tracking-widest\">\n JUMP\n </span>\n <Grasshopper aria-hidden className=\"h-5 w-auto\" />\n </span>\n </a>\n )\n}\n\n/**\n * Quick Jump: paste an id, open the matching page. One column per identity the\n * app's jumps ask for; only the identities the user keeps are rendered, the rest\n * are one click away behind Configure.\n */\nexport function QuickJumpSection({ app }: { app: Resource }) {\n const identities = React.useMemo(() => groupQuickJumps(app), [app])\n const [prefs, setPrefs] = React.useState<QuickJumpPrefs>(() =>\n readPrefs(app.slug),\n )\n const [values, setValues] = React.useState<Record<string, string>>({})\n\n // Re-read when the panel moves to another app — one key per slug.\n React.useEffect(() => {\n setPrefs(readPrefs(app.slug))\n setValues({})\n }, [app.slug])\n\n if (identities.length === 0) return null\n\n const savePrefs = (next: QuickJumpPrefs) => {\n setPrefs(next)\n writePrefs(app.slug, next)\n }\n\n const shown = prefs.shown ?? identities.slice(0, 1).map((i) => i.identity)\n const visible = identities.filter((i) => shown.includes(i.identity))\n\n const toggleShown = (identity: string) =>\n savePrefs({\n ...prefs,\n shown: shown.includes(identity)\n ? shown.filter((s) => s !== identity)\n : [...shown, identity],\n })\n\n return (\n <div className={cn('mt-6', prefs.pinned && 'order-[-1]')}>\n <div className=\"mb-2 flex items-center gap-2\">\n <Grasshopper aria-hidden className=\"h-[1.15rem] w-auto shrink-0\" />\n <h3 className=\"text-sm font-medium\">Quick Jump</h3>\n <button\n type=\"button\"\n onClick={() => savePrefs({ ...prefs, pinned: !prefs.pinned })}\n title={\n prefs.pinned\n ? 'Unpin section'\n : 'Pin section — keep Quick Jump at the top of this card'\n }\n aria-pressed={prefs.pinned ?? false}\n className={cn(\n 'rounded-sm p-0.5 transition-opacity hover:bg-muted',\n prefs.pinned\n ? 'text-primary'\n : 'text-muted-foreground opacity-50 hover:opacity-100',\n )}\n >\n <Pin className=\"size-3.5\" />\n </button>\n {prefs.pinned && (\n <span className=\"text-xs font-semibold text-primary\">\n pinned to top\n </span>\n )}\n\n {/* Nothing to configure with a single identity. */}\n {identities.length > 1 && (\n <Popover>\n <PopoverTrigger className=\"ml-auto inline-flex items-center gap-1.5 rounded-full border border-primary/45 bg-accent/45 px-2.5 py-1 text-xs font-bold shadow-sm transition-colors hover:border-primary hover:bg-accent/80\">\n <Settings2 className=\"size-3.5 text-primary\" />\n Configure ({visible.length}/{identities.length})\n </PopoverTrigger>\n <PopoverContent align=\"end\" className=\"w-64 p-1.5\">\n <p className=\"px-1.5 pt-0.5 pb-1.5 text-[0.7rem] text-muted-foreground\">\n Tick an ID to show it on this card.\n </p>\n {identities.map(({ identity, jumps }) => (\n <label\n key={identity}\n className=\"flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1.5 text-sm hover:bg-muted\"\n >\n <Checkbox\n checked={shown.includes(identity)}\n onCheckedChange={() => toggleShown(identity)}\n />\n {identity}\n <span className=\"ml-auto font-mono text-[0.7rem] text-muted-foreground\">\n {jumps.length}\n </span>\n </label>\n ))}\n </PopoverContent>\n </Popover>\n )}\n </div>\n <p className=\"mb-3 text-xs text-muted-foreground\">\n Paste an ID and open the matching page.\n </p>\n\n {visible.length === 0 ? (\n <p className=\"text-xs text-muted-foreground\">\n No IDs shown — pick one under Configure.\n </p>\n ) : (\n <div className=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {visible.map(({ identity, jumps }) => {\n const value = values[identity] ?? ''\n return (\n <div key={identity} className=\"flex min-w-0 flex-col gap-2\">\n <label\n className=\"truncate text-xs font-bold\"\n htmlFor={`qj-${app.slug}-${identity}`}\n >\n {identity}\n </label>\n <Input\n id={`qj-${app.slug}-${identity}`}\n // Namespaced per identity: the browser remembers values typed\n // for this identifier and offers them on every app using it.\n name={quickJumpFieldName(identity)}\n autoComplete=\"on\"\n placeholder={identity}\n className=\"bg-card font-mono\"\n value={value}\n onChange={(e) =>\n setValues((v) => ({ ...v, [identity]: e.target.value }))\n }\n onKeyDown={(e) => {\n const first = jumps[0]\n if (e.key !== 'Enter' || !first) return\n if (!e.currentTarget.value.trim()) return\n const url = buildQuickJumpUrl(\n first,\n e.currentTarget.value,\n app.appUrl,\n )\n if (url) window.open(url, '_blank', 'noopener,noreferrer')\n }}\n />\n {jumps.map((jump) => (\n <JumpButton\n key={`${jump.title}:${jump.url}`}\n jump={jump}\n value={value}\n appUrl={app.appUrl}\n />\n ))}\n </div>\n )\n })}\n </div>\n )}\n </div>\n )\n}\n"],"names":["Grasshopper","React"],"mappings":";;;;;;;;;AA2BA,SAAS,SAAS,MAAc;AAC9B,SAAO,gBAAgB,IAAI;AAC7B;AAEA,SAAS,UAAU,MAA8B;AAC/C,MAAI;AACF,UAAM,MAAM,aAAa,QAAQ,SAAS,IAAI,CAAC;AAC/C,WAAO,MAAO,KAAK,MAAM,GAAG,IAAuB,CAAA;AAAA,EACrD,QAAQ;AACN,WAAO,CAAA;AAAA,EACT;AACF;AAEA,SAAS,WAAW,MAAc,OAAuB;AACvD,MAAI;AACF,iBAAa,QAAQ,SAAS,IAAI,GAAG,KAAK,UAAU,KAAK,CAAC;AAAA,EAC5D,QAAQ;AAAA,EAER;AACF;AAOA,SAAS,WAAW;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,QAAM,UAAU,MAAM,KAAA;AACtB,QAAM,OAAO,UAAU,kBAAkB,MAAM,SAAS,MAAM,IAAI;AAElE,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAM,QAAQ;AAAA,MACd,QAAO;AAAA,MACP,KAAI;AAAA,MACJ,iBAAe,OAAO,SAAY;AAAA,MAClC,OAAO,QAAQ,WAAW,KAAK,QAAQ;AAAA,MACvC,WAAW;AAAA,QACT;AAAA,QACA,OACI,4DACA;AAAA,MAAA;AAAA,MAGN,UAAA;AAAA,QAAA,qBAAC,QAAA,EAAK,WAAU,gCACb,UAAA;AAAA,UAAA,KAAK;AAAA,UACL,WAAW,oBAAC,QAAA,EAAK,WAAU,kBAAkB,UAAA,QAAA,CAAQ;AAAA,QAAA,GACxD;AAAA,QACA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW;AAAA,cACT;AAAA,cACA;AAAA,cACA;AAAA,YAAA;AAAA,YAGF,UAAA;AAAA,cAAA,oBAAC,QAAA,EAAK,WAAU,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G,KAAK,KAAK,IAAI,KAAK,GAAG;AAAA,QAAA,CAKjC;AAAA,MAAA,EAAA,GAtCO,QAuCV;AAAA,IAEJ,CAAC,EAAA,CACH;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -8,6 +8,7 @@ import { Button } from "../../../../ui/button.js";
|
|
|
8
8
|
import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "../../../../ui/accordion.js";
|
|
9
9
|
import { AccessRequestSection } from "../components/AccessRequestSection.js";
|
|
10
10
|
import { AccessPrerequisiteChain } from "../components/AccessPrerequisiteChain.js";
|
|
11
|
+
import { QuickJumpSection } from "../components/QuickJumpSection.js";
|
|
11
12
|
import { useAppCatalogFilters } from "../context/AppCatalogFiltersContext.js";
|
|
12
13
|
import { PersonBadge } from "../components/PersonBadge.js";
|
|
13
14
|
import { useUser } from "../../../auth/AuthContext.js";
|
|
@@ -145,7 +146,7 @@ function AppDetails({
|
|
|
145
146
|
}) : null;
|
|
146
147
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
147
148
|
/* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col p-6", children: [
|
|
148
|
-
/* @__PURE__ */ jsx("div", { className: "border-b pb-6", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
149
|
+
/* @__PURE__ */ jsx("div", { className: "-order-2 border-b pb-6", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
149
150
|
/* @__PURE__ */ jsx(AppIcon, { app, className: "size-16" }),
|
|
150
151
|
/* @__PURE__ */ jsxs("div", { className: "-mx-3 flex-1 min-w-0", children: [
|
|
151
152
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-3", children: [
|
|
@@ -245,6 +246,7 @@ function AppDetails({
|
|
|
245
246
|
})(),
|
|
246
247
|
/* @__PURE__ */ jsx(AccessPrerequisiteChain, { resource: app, onOpenParent: onAppClick }),
|
|
247
248
|
/* @__PURE__ */ jsx(AccessRequestSection, { app, approvalMethods }),
|
|
249
|
+
/* @__PURE__ */ jsx(QuickJumpSection, { app }),
|
|
248
250
|
/* @__PURE__ */ jsxs("div", { className: "mt-6", children: [
|
|
249
251
|
/* @__PURE__ */ jsx("h3", { className: "mb-2 text-sm font-medium", children: "Description" }),
|
|
250
252
|
isAdmin ? /* @__PURE__ */ jsx(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppDetails.js","sources":["../../../../../../src/modules/appCatalog/ui/detail/AppDetails.tsx"],"sourcesContent":["import type { Resource } from '@igstack/app-catalog-backend-core'\nimport {\n AppWindow,\n CalendarPlus,\n Clock,\n ExternalLink,\n Plus,\n Trash2,\n} from 'lucide-react'\nimport React from 'react'\nimport { useHotkeys } from 'react-hotkeys-hook'\nimport { cn } from '~/lib/utils'\nimport { Badge } from '~/ui/badge'\nimport { Button } from '~/ui/button'\nimport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from '~/ui/accordion'\nimport { AccessRequestSection } from '../components/AccessRequestSection'\nimport { AccessPrerequisiteChain } from '../components/AccessPrerequisiteChain'\nimport { useAppCatalogFilters } from '../context/AppCatalogFiltersContext'\nimport { PersonBadge } from '../components/PersonBadge'\nimport { useUser } from '~/modules/auth'\nimport { InlineEditableField } from '../components/InlineEditableField'\nimport { MarkdownText } from '../components/MarkdownText'\nimport { ScreenshotGallery } from '../components/ScreenshotGallery'\nimport { useUpdateApp } from '../../hooks/useUpdateApp'\nimport { useAppCatalogContext } from '../../context/AppCatalogContext'\nimport { useAppClickHistory } from '../../hooks/useAppClickHistory'\nimport { formatRelativeTime } from '../../utils/formatRelativeTime'\nimport { TierVariantsSection } from '../components/TierVariantsSection'\nimport { SubResourcesSection } from '../components/SubResourcesSection'\nimport { getChildResources } from '../../utils/resolveHelpers'\nimport { CommentsSection } from './CommentsSection'\nimport { displayUrl } from '~/modules/appCatalog/utils/displayUrl'\n\nfunction getIconUrl(iconName: string): string {\n return `/api/icons/${iconName}`\n}\n\nfunction AppIcon({ app, className }: { app: Resource; className?: string }) {\n const [imageError, setImageError] = React.useState(false)\n\n // Use iconName from backend if available\n if (app.iconName && !imageError) {\n return (\n <div className={cn('size-12 shrink-0', className)}>\n <img\n src={getIconUrl(app.iconName)}\n alt={`${app.abbreviation || app.displayName} icon`}\n className=\"size-12 rounded-lg object-contain\"\n onError={() => setImageError(true)}\n />\n </div>\n )\n }\n\n // Fallback icon\n return (\n <div\n className={cn(\n 'flex items-center justify-center rounded-lg bg-primary/10 text-primary size-12 shrink-0',\n className,\n )}\n >\n <AppWindow className=\"size-6\" />\n </div>\n )\n}\n\nfunction AppScreenshot({ app }: { app: Resource }) {\n const [imageError, setImageError] = React.useState(false)\n const [isLoadingImage, setIsLoadingImage] = React.useState(true)\n\n // Check if app has screenshots\n const screenshotId = app.screenshotIds?.[0]\n if (!screenshotId) {\n return (\n <div className=\"w-full bg-muted/50 rounded-lg overflow-hidden flex items-center justify-center min-h-64\">\n <div className=\"w-full h-64 bg-muted/30 flex items-center justify-center text-muted-foreground text-sm\">\n No screenshot available\n </div>\n </div>\n )\n }\n\n const screenshotImageUrl = `/api/screenshots/${screenshotId}?size=512`\n\n return (\n <div className=\"w-full flex justify-center\">\n <div className=\"rounded-lg overflow-hidden inline-flex items-center justify-center min-h-64\">\n {!imageError ? (\n <img\n src={screenshotImageUrl}\n alt={`${app.abbreviation || app.displayName} screenshot`}\n className=\"h-64 object-contain\"\n onError={() => {\n setImageError(true)\n setIsLoadingImage(false)\n }}\n onLoad={() => setIsLoadingImage(false)}\n />\n ) : null}\n {(imageError || isLoadingImage) && (\n <div className=\"w-full h-64 bg-muted/30 flex items-center justify-center text-muted-foreground text-sm\">\n {isLoadingImage\n ? 'Loading screenshot...'\n : 'No screenshot available'}\n </div>\n )}\n </div>\n </div>\n )\n}\n\nfunction TiersAndSubResourcesPanel({ app }: { app: Resource }) {\n const { resources } = useAppCatalogContext()\n // #38 item C: the active catalog search term. When the user reached this app\n // by searching something that matched a child, seed the sub-resource filter\n // with it so the matched child is revealed.\n const { state: filterState } = useAppCatalogFilters()\n const appSubResources = React.useMemo(\n () => getChildResources(resources, app.slug),\n [resources, app.slug],\n )\n\n return (\n <>\n {app.tiers && app.tiers.length > 0 && (\n <div className=\"mt-6\">\n <TierVariantsSection tiers={app.tiers} />\n </div>\n )}\n {appSubResources.length > 0 && (\n <div className=\"mt-6\">\n <SubResourcesSection\n subResources={appSubResources}\n parentSlug={app.slug}\n initialSearch={filterState.searchValue}\n />\n </div>\n )}\n </>\n )\n}\n\nexport function AppDetails({\n app,\n onAppClick,\n onClosePanel,\n}: {\n app: Resource\n onAppClick?: (app: Resource) => void\n onClosePanel: () => void\n}) {\n const [isGalleryOpen, setIsGalleryOpen] = React.useState(false)\n const [galleryInitialIndex, setGalleryInitialIndex] = React.useState(0)\n const { approvalMethods, resources: allResources } = useAppCatalogContext()\n const { recordClick } = useAppClickHistory()\n const updateApp = useUpdateApp()\n const [draftSource, setDraftSource] = React.useState<string | null>(null)\n const user = useUser()\n const isAdmin = user?.isAdmin ?? false\n\n const sourceUrls: string[] =\n app.sources?.map((s) => (typeof s === 'string' ? s : s.url)) ?? []\n const displaySources =\n draftSource !== null ? [...sourceUrls, draftSource] : sourceUrls\n\n // Enter: open screenshot gallery\n useHotkeys(\n 'enter',\n () => {\n const tag = document.activeElement?.tagName\n if (\n tag === 'BUTTON' ||\n tag === 'A' ||\n tag === 'INPUT' ||\n tag === 'SELECT' ||\n tag === 'TEXTAREA'\n )\n return\n\n if (app.screenshotIds && app.screenshotIds.length > 0) {\n setGalleryInitialIndex(0)\n setIsGalleryOpen(true)\n }\n },\n { enabled: !isGalleryOpen },\n [app, isGalleryOpen],\n )\n\n // Esc: close the details panel (only when gallery is NOT open)\n useHotkeys(\n 'escape',\n () => {\n onClosePanel()\n },\n { enabled: !isGalleryOpen },\n [isGalleryOpen, onClosePanel],\n )\n\n const handleScreenshotClick = (index: number) => {\n setGalleryInitialIndex(index)\n setIsGalleryOpen(true)\n }\n\n // Find replacement app if deprecated\n const replacementApp = app.deprecated?.replacementSlug\n ? allResources.find((a) => a.slug === app.deprecated?.replacementSlug)\n : null\n\n return (\n <>\n <div className=\"flex h-full flex-col p-6\">\n {/* Icon and Title */}\n <div className=\"border-b pb-6\">\n <div className=\"flex items-center gap-3\">\n <AppIcon app={app} className=\"size-16\" />\n <div className=\"-mx-3 flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 px-3\">\n <div className=\"font-serif text-2xl font-semibold min-w-0\">\n {app.abbreviation\n ? `${app.displayName} (${app.abbreviation})`\n : app.displayName}\n </div>\n {app.deprecated && (\n <Badge\n variant={\n app.deprecated.type === 'discouraged'\n ? 'secondary'\n : 'destructive'\n }\n >\n {app.deprecated.type === 'discouraged'\n ? 'Discouraged'\n : 'Deprecated'}\n </Badge>\n )}\n </div>\n {isAdmin && (\n <div className=\"mt-1 px-3\">\n <span className=\"text-xs text-muted-foreground mr-2\">\n Slug:\n </span>\n <InlineEditableField\n value={app.slug}\n onSave={(slug) =>\n updateApp.mutate({ id: app.id, data: { slug } })\n }\n className=\"text-sm\"\n />\n </div>\n )}\n <div className=\"mt-1 px-3\">\n {isAdmin ? (\n <InlineEditableField\n value={app.appUrl ?? ''}\n onSave={(appUrl) =>\n updateApp.mutate({ id: app.id, data: { appUrl } })\n }\n placeholder=\"App URL\"\n renderView={(url) =>\n url ? (\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={() => recordClick(app.slug)}\n className=\"inline-flex items-center gap-1 rounded-md py-1 text-sm text-blue-600 hover:bg-accent/30 hover:underline dark:text-blue-400 transition-all\"\n >\n {displayUrl(url)}\n <ExternalLink className=\"size-3.5 shrink-0 opacity-40 group-hover:opacity-100 transition-opacity\" />\n </a>\n ) : (\n <span className=\"text-muted-foreground\">—</span>\n )\n }\n />\n ) : app.appUrl ? (\n <a\n href={app.appUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={() => recordClick(app.slug)}\n className=\"inline-flex items-center gap-2 rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground shadow-sm hover:bg-primary/90 transition-colors\"\n title={`Open \\u2192 ${displayUrl(app.appUrl)}`}\n aria-label={`Open ${app.displayName} in a new tab (${displayUrl(app.appUrl)})`}\n >\n <ExternalLink className=\"size-3.5 shrink-0\" />\n Open{' '}\n <span className=\"max-w-[240px] truncate text-primary-foreground/70 text-xs font-normal\">\n {displayUrl(app.appUrl)}\n </span>\n </a>\n ) : (\n <span className=\"text-muted-foreground\">—</span>\n )}\n </div>\n {/* Updated/Added metadata moved to consolidated section before Sources (#55) */}\n </div>\n </div>\n </div>\n\n {/* Deprecation/Discouraged Warning */}\n {app.deprecated &&\n (() => {\n const deprecationType = app.deprecated.type || 'deprecated'\n const isDiscouraged = deprecationType === 'discouraged'\n return (\n <div\n className={\n isDiscouraged\n ? 'mt-6 p-4 border border-yellow-500/50 rounded-lg bg-yellow-50 dark:bg-yellow-950/20'\n : 'mt-6 p-4 border border-destructive/50 rounded-lg bg-destructive/10'\n }\n >\n <h3\n className={\n isDiscouraged\n ? 'text-sm font-semibold text-yellow-700 dark:text-yellow-500 mb-2'\n : 'text-sm font-semibold text-destructive mb-2'\n }\n >\n {isDiscouraged\n ? 'Usage discouraged'\n : 'This application is deprecated'}\n </h3>\n <p className=\"text-sm text-muted-foreground mb-3\">\n {app.deprecated.comment}\n </p>\n {replacementApp && (\n <button\n type=\"button\"\n onClick={() => onAppClick?.(replacementApp)}\n className=\"text-sm font-medium text-primary hover:underline inline-flex items-center gap-1\"\n >\n View replacement: {replacementApp.displayName}\n <ExternalLink className=\"size-3\" />\n </button>\n )}\n </div>\n )\n })()}\n\n {/* Two-step access (#38 D): for a nested resource, show the parent-first\n prerequisite chain before this resource's own access instructions. */}\n <AccessPrerequisiteChain resource={app} onOpenParent={onAppClick} />\n\n {/* Access Request Section — hero of the detail, shown before description */}\n <AccessRequestSection app={app} approvalMethods={approvalMethods} />\n\n {/* Description */}\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">Description</h3>\n {isAdmin ? (\n <InlineEditableField\n value={app.description ?? ''}\n onSave={(description) =>\n updateApp.mutate({ id: app.id, data: { description } })\n }\n multiline\n placeholder=\"Description\"\n className=\"min-h-[4rem] resize-y text-sm text-muted-foreground\"\n />\n ) : app.description ? (\n <MarkdownText className=\"prose prose-sm max-w-none text-sm text-muted-foreground [&_p]:m-0\">\n {app.description}\n </MarkdownText>\n ) : (\n <p className=\"text-sm text-muted-foreground\">—</p>\n )}\n </div>\n\n {/* Screenshots - Clickable preview */}\n {app.screenshotIds && app.screenshotIds.length > 0 && (\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">\n Screenshots ({app.screenshotIds.length})\n </h3>\n <div\n className=\"cursor-pointer hover:opacity-80 transition-opacity\"\n onClick={() => handleScreenshotClick(0)}\n >\n <AppScreenshot app={app} />\n {app.screenshotIds.length > 1 && (\n <p className=\"text-xs text-muted-foreground mt-2 text-center\">\n Click to view all {app.screenshotIds.length} screenshots\n </p>\n )}\n </div>\n </div>\n )}\n\n {/* Owner — who is responsible for this resource. Distinct from the\n access approver (who decides access requests); see domain model. */}\n {app.ownerPersonSlug && (\n <div className=\"mt-6\">\n <h3 className=\"mb-1 text-sm font-medium\">Owner</h3>\n <p className=\"mb-2 text-xs text-muted-foreground\">\n Who is responsible for this resource\n </p>\n <PersonBadge slug={app.ownerPersonSlug} />\n </div>\n )}\n\n {/* Tier Variants and Sub-Resources */}\n <TiersAndSubResourcesPanel app={app} />\n\n {/* Links */}\n {app.links && app.links.length > 0 && (\n <div className=\"mt-4\">\n <h3 className=\"mb-1 text-xs font-medium text-muted-foreground\">\n Links\n </h3>\n <div className=\"space-y-0.5\">\n {app.links.map((link) => (\n <a\n key={link.url}\n href={link.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"flex items-center gap-1 text-xs text-muted-foreground hover:text-primary truncate\"\n >\n <ExternalLink className=\"size-3 shrink-0\" />\n {link.title || displayUrl(link.url)}\n </a>\n ))}\n </div>\n </div>\n )}\n\n {/* Tags */}\n {app.tags && app.tags.length > 0 && (\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">Tags</h3>\n <div className=\"flex flex-wrap gap-2\">\n {app.tags.map((tag) => (\n <Badge key={tag} variant=\"secondary\" className=\"text-xs\">\n {tag}\n </Badge>\n ))}\n </div>\n </div>\n )}\n\n {/* Teams */}\n {app.teams && app.teams.length > 0 && (\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">Teams</h3>\n <div className=\"flex flex-wrap gap-2\">\n {app.teams.map((team) => (\n <Badge key={team} variant=\"outline\" className=\"text-xs\">\n {team}\n </Badge>\n ))}\n </div>\n </div>\n )}\n\n {/* Technical information: AI-facing fields, de-emphasized/collapsed */}\n {(app.aiPrompt || app.aiMemory) && (\n <Accordion type=\"single\" collapsible className=\"mt-6\">\n <AccordionItem\n value=\"technical-info\"\n className=\"border rounded-lg px-4\"\n >\n <AccordionTrigger className=\"text-sm hover:no-underline py-3\">\n Technical information\n </AccordionTrigger>\n <AccordionContent className=\"pb-3 space-y-3\">\n {app.aiPrompt && (\n <div>\n <h4 className=\"mb-1 text-xs font-medium text-muted-foreground\">\n AI Prompt\n </h4>\n <p className=\"text-xs whitespace-pre-wrap\">\n {app.aiPrompt}\n </p>\n </div>\n )}\n {app.aiMemory && (\n <div>\n <h4 className=\"mb-1 text-xs font-medium text-muted-foreground\">\n AI Memory\n </h4>\n <p className=\"text-xs whitespace-pre-wrap\">\n {app.aiMemory}\n </p>\n </div>\n )}\n </AccordionContent>\n </AccordionItem>\n </Accordion>\n )}\n\n {/* Metadata: Added / Updated */}\n {(app.createdAt || app.freshness?.lastCheckedAt) && (\n <div className=\"mt-6 flex flex-wrap gap-x-5 gap-y-1\">\n {app.createdAt && (\n <span\n className=\"inline-flex items-center gap-1 text-xs text-muted-foreground\"\n title={app.createdAt}\n >\n <CalendarPlus className=\"size-3\" />\n Added {formatRelativeTime(app.createdAt)}\n </span>\n )}\n {app.freshness?.lastCheckedAt && (\n <span\n className=\"inline-flex items-center gap-1 text-xs text-muted-foreground\"\n title={\n app.freshness.lastContentChangeAt\n ? `Content last changed ${app.freshness.lastContentChangeAt} · last checked ${app.freshness.lastCheckedAt}`\n : `Last checked ${app.freshness.lastCheckedAt}`\n }\n >\n <Clock className=\"size-3\" />\n {/* \"Updated\" means the content changed, not that a check ran -\n entries predating the field have none, so fall back. */}\n Updated{' '}\n {formatRelativeTime(\n app.freshness.lastContentChangeAt ??\n app.freshness.lastCheckedAt,\n )}\n {app.freshness.isStale && (\n <span className=\"italic opacity-75\">\n {' '}\n · may be out of date\n </span>\n )}\n </span>\n )}\n </div>\n )}\n\n {/* Sources */}\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">Sources</h3>\n {isAdmin ? (\n <>\n <ul className=\"space-y-2\">\n {displaySources.map((url, index) => {\n const isDraft =\n draftSource !== null && index === sourceUrls.length\n return (\n <li\n key={isDraft ? 'draft' : `${index}-${url}`}\n className=\"flex items-center gap-2 text-xs\"\n >\n <span className=\"text-muted-foreground shrink-0 tabular-nums\">\n {index + 1}.\n </span>\n <InlineEditableField\n value={url}\n initialEditMode={isDraft}\n onCancel={\n isDraft ? () => setDraftSource(null) : undefined\n }\n onSave={(newUrl) => {\n if (isDraft) {\n setDraftSource(null)\n if (newUrl) {\n updateApp.mutate({\n id: app.id,\n data: { sources: [...sourceUrls, newUrl] },\n })\n }\n } else {\n const next = [...sourceUrls]\n next[index] = newUrl\n updateApp.mutate({\n id: app.id,\n data: { sources: next.filter(Boolean) },\n })\n }\n }}\n placeholder=\"https://...\"\n viewClassName=\"flex-1 min-w-0\"\n renderView={(val) =>\n val ? (\n <a\n href={val}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"hover:text-primary inline-flex items-center gap-1 truncate\"\n >\n {displayUrl(val)}\n <ExternalLink className=\"size-3 shrink-0\" />\n </a>\n ) : (\n <span className=\"text-muted-foreground\">—</span>\n )\n }\n />\n {!isDraft && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label=\"Remove source\"\n className=\"shrink-0 text-muted-foreground hover:text-destructive\"\n onClick={() => {\n const next = sourceUrls.filter(\n (_, i) => i !== index,\n )\n updateApp.mutate({\n id: app.id,\n data: { sources: next },\n })\n }}\n >\n <Trash2 className=\"size-3.5\" />\n </Button>\n )}\n </li>\n )\n })}\n </ul>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"mt-2 gap-1 text-muted-foreground\"\n onClick={() => setDraftSource('')}\n >\n <Plus className=\"size-3.5\" />\n Add source\n </Button>\n </>\n ) : (\n <ul className=\"space-y-2\">\n {sourceUrls.map((url, index) => (\n <li key={index} className=\"flex items-center gap-2 text-xs\">\n <span className=\"text-muted-foreground shrink-0 tabular-nums\">\n {index + 1}.\n </span>\n {url ? (\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"hover:text-primary inline-flex items-center gap-1 truncate\"\n >\n {displayUrl(url)}\n <ExternalLink className=\"size-3 shrink-0\" />\n </a>\n ) : (\n <span className=\"text-muted-foreground\">—</span>\n )}\n </li>\n ))}\n </ul>\n )}\n </div>\n\n {/* Freshness now shown near the header (see \"Updated …\" above). */}\n\n <CommentsSection appSlug={app.slug} />\n </div>\n\n {/* Screenshot Gallery Dialog */}\n <ScreenshotGallery\n app={app}\n screenshotIds={app.screenshotIds || []}\n open={isGalleryOpen}\n onOpenChange={setIsGalleryOpen}\n initialIndex={galleryInitialIndex}\n title={`${app.abbreviation || app.displayName} - Screenshots`}\n />\n </>\n )\n}\n"],"names":["React","_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,SAAS,WAAW,UAA0B;AAC5C,SAAO,cAAc,QAAQ;AAC/B;AAEA,SAAS,QAAQ,EAAE,KAAK,aAAoD;AAC1E,QAAM,CAAC,YAAY,aA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ACR,MAAK;AAAA,cACL,WAAU;AAAA,cACV,SAAS,MAAM,eAAe,EAAE;AAAA,cAEhC,UAAA;AAAA,gBAAA,oBAAC,MAAA,EAAK,WAAU,WAAA,CAAW;AAAA,gBAAE;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAE/B,EAAA,CACF,IAEA,oBAAC,MAAA,EAAG,WAAU,aACX,UAAA,WAAW,IAAI,CAAC,KAAK,UACpB,qBAAC,MAAA,EAAe,WAAU,mCACxB,UAAA;AAAA,UAAA,qBAAC,QAAA,EAAK,WAAU,+CACb,UAAA;AAAA,YAAA,QAAQ;AAAA,YAAE;AAAA,UAAA,GACb;AAAA,UACC,MACC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAM;AAAA,cACN,QAAO;AAAA,cACP,KAAI;AAAA,cACJ,WAAU;AAAA,cAET,UAAA;AAAA,gBAAA,WAAW,GAAG;AAAA,gBACf,oBAAC,cAAA,EAAa,WAAU,kBAAA,CAAkB;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA,IAG5C,oBAAC,QAAA,EAAK,WAAU,yBAAwB,UAAA,IAAA,CAAC;AAAA,QAAA,EAAA,GAfpC,KAiBT,CACD,EAAA,CACH;AAAA,MAAA,GAEJ;AAAA,MAIA,oBAAC,iBAAA,EAAgB,SAAS,IAAI,KAAA,CAAM;AAAA,IAAA,GACtC;AAAA,IAGA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAe,IAAI,iBAAiB,CAAA;AAAA,QACpC,MAAM;AAAA,QACN,cAAc;AAAA,QACd,cAAc;AAAA,QACd,OAAO,GAAG,IAAI,gBAAgB,IAAI,WAAW;AAAA,MAAA;AAAA,IAAA;AAAA,EAC/C,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"AppDetails.js","sources":["../../../../../../src/modules/appCatalog/ui/detail/AppDetails.tsx"],"sourcesContent":["import type { Resource } from '@igstack/app-catalog-backend-core'\nimport {\n AppWindow,\n CalendarPlus,\n Clock,\n ExternalLink,\n Plus,\n Trash2,\n} from 'lucide-react'\nimport React from 'react'\nimport { useHotkeys } from 'react-hotkeys-hook'\nimport { cn } from '~/lib/utils'\nimport { Badge } from '~/ui/badge'\nimport { Button } from '~/ui/button'\nimport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from '~/ui/accordion'\nimport { AccessRequestSection } from '../components/AccessRequestSection'\nimport { AccessPrerequisiteChain } from '../components/AccessPrerequisiteChain'\nimport { QuickJumpSection } from '../components/QuickJumpSection'\nimport { useAppCatalogFilters } from '../context/AppCatalogFiltersContext'\nimport { PersonBadge } from '../components/PersonBadge'\nimport { useUser } from '~/modules/auth'\nimport { InlineEditableField } from '../components/InlineEditableField'\nimport { MarkdownText } from '../components/MarkdownText'\nimport { ScreenshotGallery } from '../components/ScreenshotGallery'\nimport { useUpdateApp } from '../../hooks/useUpdateApp'\nimport { useAppCatalogContext } from '../../context/AppCatalogContext'\nimport { useAppClickHistory } from '../../hooks/useAppClickHistory'\nimport { formatRelativeTime } from '../../utils/formatRelativeTime'\nimport { TierVariantsSection } from '../components/TierVariantsSection'\nimport { SubResourcesSection } from '../components/SubResourcesSection'\nimport { getChildResources } from '../../utils/resolveHelpers'\nimport { CommentsSection } from './CommentsSection'\nimport { displayUrl } from '~/modules/appCatalog/utils/displayUrl'\n\nfunction getIconUrl(iconName: string): string {\n return `/api/icons/${iconName}`\n}\n\nfunction AppIcon({ app, className }: { app: Resource; className?: string }) {\n const [imageError, setImageError] = React.useState(false)\n\n // Use iconName from backend if available\n if (app.iconName && !imageError) {\n return (\n <div className={cn('size-12 shrink-0', className)}>\n <img\n src={getIconUrl(app.iconName)}\n alt={`${app.abbreviation || app.displayName} icon`}\n className=\"size-12 rounded-lg object-contain\"\n onError={() => setImageError(true)}\n />\n </div>\n )\n }\n\n // Fallback icon\n return (\n <div\n className={cn(\n 'flex items-center justify-center rounded-lg bg-primary/10 text-primary size-12 shrink-0',\n className,\n )}\n >\n <AppWindow className=\"size-6\" />\n </div>\n )\n}\n\nfunction AppScreenshot({ app }: { app: Resource }) {\n const [imageError, setImageError] = React.useState(false)\n const [isLoadingImage, setIsLoadingImage] = React.useState(true)\n\n // Check if app has screenshots\n const screenshotId = app.screenshotIds?.[0]\n if (!screenshotId) {\n return (\n <div className=\"w-full bg-muted/50 rounded-lg overflow-hidden flex items-center justify-center min-h-64\">\n <div className=\"w-full h-64 bg-muted/30 flex items-center justify-center text-muted-foreground text-sm\">\n No screenshot available\n </div>\n </div>\n )\n }\n\n const screenshotImageUrl = `/api/screenshots/${screenshotId}?size=512`\n\n return (\n <div className=\"w-full flex justify-center\">\n <div className=\"rounded-lg overflow-hidden inline-flex items-center justify-center min-h-64\">\n {!imageError ? (\n <img\n src={screenshotImageUrl}\n alt={`${app.abbreviation || app.displayName} screenshot`}\n className=\"h-64 object-contain\"\n onError={() => {\n setImageError(true)\n setIsLoadingImage(false)\n }}\n onLoad={() => setIsLoadingImage(false)}\n />\n ) : null}\n {(imageError || isLoadingImage) && (\n <div className=\"w-full h-64 bg-muted/30 flex items-center justify-center text-muted-foreground text-sm\">\n {isLoadingImage\n ? 'Loading screenshot...'\n : 'No screenshot available'}\n </div>\n )}\n </div>\n </div>\n )\n}\n\nfunction TiersAndSubResourcesPanel({ app }: { app: Resource }) {\n const { resources } = useAppCatalogContext()\n // #38 item C: the active catalog search term. When the user reached this app\n // by searching something that matched a child, seed the sub-resource filter\n // with it so the matched child is revealed.\n const { state: filterState } = useAppCatalogFilters()\n const appSubResources = React.useMemo(\n () => getChildResources(resources, app.slug),\n [resources, app.slug],\n )\n\n return (\n <>\n {app.tiers && app.tiers.length > 0 && (\n <div className=\"mt-6\">\n <TierVariantsSection tiers={app.tiers} />\n </div>\n )}\n {appSubResources.length > 0 && (\n <div className=\"mt-6\">\n <SubResourcesSection\n subResources={appSubResources}\n parentSlug={app.slug}\n initialSearch={filterState.searchValue}\n />\n </div>\n )}\n </>\n )\n}\n\nexport function AppDetails({\n app,\n onAppClick,\n onClosePanel,\n}: {\n app: Resource\n onAppClick?: (app: Resource) => void\n onClosePanel: () => void\n}) {\n const [isGalleryOpen, setIsGalleryOpen] = React.useState(false)\n const [galleryInitialIndex, setGalleryInitialIndex] = React.useState(0)\n const { approvalMethods, resources: allResources } = useAppCatalogContext()\n const { recordClick } = useAppClickHistory()\n const updateApp = useUpdateApp()\n const [draftSource, setDraftSource] = React.useState<string | null>(null)\n const user = useUser()\n const isAdmin = user?.isAdmin ?? false\n\n const sourceUrls: string[] =\n app.sources?.map((s) => (typeof s === 'string' ? s : s.url)) ?? []\n const displaySources =\n draftSource !== null ? [...sourceUrls, draftSource] : sourceUrls\n\n // Enter: open screenshot gallery\n useHotkeys(\n 'enter',\n () => {\n const tag = document.activeElement?.tagName\n if (\n tag === 'BUTTON' ||\n tag === 'A' ||\n tag === 'INPUT' ||\n tag === 'SELECT' ||\n tag === 'TEXTAREA'\n )\n return\n\n if (app.screenshotIds && app.screenshotIds.length > 0) {\n setGalleryInitialIndex(0)\n setIsGalleryOpen(true)\n }\n },\n { enabled: !isGalleryOpen },\n [app, isGalleryOpen],\n )\n\n // Esc: close the details panel (only when gallery is NOT open)\n useHotkeys(\n 'escape',\n () => {\n onClosePanel()\n },\n { enabled: !isGalleryOpen },\n [isGalleryOpen, onClosePanel],\n )\n\n const handleScreenshotClick = (index: number) => {\n setGalleryInitialIndex(index)\n setIsGalleryOpen(true)\n }\n\n // Find replacement app if deprecated\n const replacementApp = app.deprecated?.replacementSlug\n ? allResources.find((a) => a.slug === app.deprecated?.replacementSlug)\n : null\n\n return (\n <>\n <div className=\"flex h-full flex-col p-6\">\n {/* Icon and Title — always first: a pinned Quick Jump takes order -1,\n so the header claims -2 rather than being pushed below it. */}\n <div className=\"-order-2 border-b pb-6\">\n <div className=\"flex items-center gap-3\">\n <AppIcon app={app} className=\"size-16\" />\n <div className=\"-mx-3 flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 px-3\">\n <div className=\"font-serif text-2xl font-semibold min-w-0\">\n {app.abbreviation\n ? `${app.displayName} (${app.abbreviation})`\n : app.displayName}\n </div>\n {app.deprecated && (\n <Badge\n variant={\n app.deprecated.type === 'discouraged'\n ? 'secondary'\n : 'destructive'\n }\n >\n {app.deprecated.type === 'discouraged'\n ? 'Discouraged'\n : 'Deprecated'}\n </Badge>\n )}\n </div>\n {isAdmin && (\n <div className=\"mt-1 px-3\">\n <span className=\"text-xs text-muted-foreground mr-2\">\n Slug:\n </span>\n <InlineEditableField\n value={app.slug}\n onSave={(slug) =>\n updateApp.mutate({ id: app.id, data: { slug } })\n }\n className=\"text-sm\"\n />\n </div>\n )}\n <div className=\"mt-1 px-3\">\n {isAdmin ? (\n <InlineEditableField\n value={app.appUrl ?? ''}\n onSave={(appUrl) =>\n updateApp.mutate({ id: app.id, data: { appUrl } })\n }\n placeholder=\"App URL\"\n renderView={(url) =>\n url ? (\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={() => recordClick(app.slug)}\n className=\"inline-flex items-center gap-1 rounded-md py-1 text-sm text-blue-600 hover:bg-accent/30 hover:underline dark:text-blue-400 transition-all\"\n >\n {displayUrl(url)}\n <ExternalLink className=\"size-3.5 shrink-0 opacity-40 group-hover:opacity-100 transition-opacity\" />\n </a>\n ) : (\n <span className=\"text-muted-foreground\">—</span>\n )\n }\n />\n ) : app.appUrl ? (\n <a\n href={app.appUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={() => recordClick(app.slug)}\n className=\"inline-flex items-center gap-2 rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground shadow-sm hover:bg-primary/90 transition-colors\"\n title={`Open \\u2192 ${displayUrl(app.appUrl)}`}\n aria-label={`Open ${app.displayName} in a new tab (${displayUrl(app.appUrl)})`}\n >\n <ExternalLink className=\"size-3.5 shrink-0\" />\n Open{' '}\n <span className=\"max-w-[240px] truncate text-primary-foreground/70 text-xs font-normal\">\n {displayUrl(app.appUrl)}\n </span>\n </a>\n ) : (\n <span className=\"text-muted-foreground\">—</span>\n )}\n </div>\n {/* Updated/Added metadata moved to consolidated section before Sources (#55) */}\n </div>\n </div>\n </div>\n\n {/* Deprecation/Discouraged Warning */}\n {app.deprecated &&\n (() => {\n const deprecationType = app.deprecated.type || 'deprecated'\n const isDiscouraged = deprecationType === 'discouraged'\n return (\n <div\n className={\n isDiscouraged\n ? 'mt-6 p-4 border border-yellow-500/50 rounded-lg bg-yellow-50 dark:bg-yellow-950/20'\n : 'mt-6 p-4 border border-destructive/50 rounded-lg bg-destructive/10'\n }\n >\n <h3\n className={\n isDiscouraged\n ? 'text-sm font-semibold text-yellow-700 dark:text-yellow-500 mb-2'\n : 'text-sm font-semibold text-destructive mb-2'\n }\n >\n {isDiscouraged\n ? 'Usage discouraged'\n : 'This application is deprecated'}\n </h3>\n <p className=\"text-sm text-muted-foreground mb-3\">\n {app.deprecated.comment}\n </p>\n {replacementApp && (\n <button\n type=\"button\"\n onClick={() => onAppClick?.(replacementApp)}\n className=\"text-sm font-medium text-primary hover:underline inline-flex items-center gap-1\"\n >\n View replacement: {replacementApp.displayName}\n <ExternalLink className=\"size-3\" />\n </button>\n )}\n </div>\n )\n })()}\n\n {/* Two-step access (#38 D): for a nested resource, show the parent-first\n prerequisite chain before this resource's own access instructions. */}\n <AccessPrerequisiteChain resource={app} onOpenParent={onAppClick} />\n\n {/* Access Request Section — hero of the detail, shown before description */}\n <AccessRequestSection app={app} approvalMethods={approvalMethods} />\n\n {/* Quick Jump — paste an id, open the matching page. Hoists itself to\n the top of the card (flex order) when the user pins it. */}\n <QuickJumpSection app={app} />\n\n {/* Description */}\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">Description</h3>\n {isAdmin ? (\n <InlineEditableField\n value={app.description ?? ''}\n onSave={(description) =>\n updateApp.mutate({ id: app.id, data: { description } })\n }\n multiline\n placeholder=\"Description\"\n className=\"min-h-[4rem] resize-y text-sm text-muted-foreground\"\n />\n ) : app.description ? (\n <MarkdownText className=\"prose prose-sm max-w-none text-sm text-muted-foreground [&_p]:m-0\">\n {app.description}\n </MarkdownText>\n ) : (\n <p className=\"text-sm text-muted-foreground\">—</p>\n )}\n </div>\n\n {/* Screenshots - Clickable preview */}\n {app.screenshotIds && app.screenshotIds.length > 0 && (\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">\n Screenshots ({app.screenshotIds.length})\n </h3>\n <div\n className=\"cursor-pointer hover:opacity-80 transition-opacity\"\n onClick={() => handleScreenshotClick(0)}\n >\n <AppScreenshot app={app} />\n {app.screenshotIds.length > 1 && (\n <p className=\"text-xs text-muted-foreground mt-2 text-center\">\n Click to view all {app.screenshotIds.length} screenshots\n </p>\n )}\n </div>\n </div>\n )}\n\n {/* Owner — who is responsible for this resource. Distinct from the\n access approver (who decides access requests); see domain model. */}\n {app.ownerPersonSlug && (\n <div className=\"mt-6\">\n <h3 className=\"mb-1 text-sm font-medium\">Owner</h3>\n <p className=\"mb-2 text-xs text-muted-foreground\">\n Who is responsible for this resource\n </p>\n <PersonBadge slug={app.ownerPersonSlug} />\n </div>\n )}\n\n {/* Tier Variants and Sub-Resources */}\n <TiersAndSubResourcesPanel app={app} />\n\n {/* Links */}\n {app.links && app.links.length > 0 && (\n <div className=\"mt-4\">\n <h3 className=\"mb-1 text-xs font-medium text-muted-foreground\">\n Links\n </h3>\n <div className=\"space-y-0.5\">\n {app.links.map((link) => (\n <a\n key={link.url}\n href={link.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"flex items-center gap-1 text-xs text-muted-foreground hover:text-primary truncate\"\n >\n <ExternalLink className=\"size-3 shrink-0\" />\n {link.title || displayUrl(link.url)}\n </a>\n ))}\n </div>\n </div>\n )}\n\n {/* Tags */}\n {app.tags && app.tags.length > 0 && (\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">Tags</h3>\n <div className=\"flex flex-wrap gap-2\">\n {app.tags.map((tag) => (\n <Badge key={tag} variant=\"secondary\" className=\"text-xs\">\n {tag}\n </Badge>\n ))}\n </div>\n </div>\n )}\n\n {/* Teams */}\n {app.teams && app.teams.length > 0 && (\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">Teams</h3>\n <div className=\"flex flex-wrap gap-2\">\n {app.teams.map((team) => (\n <Badge key={team} variant=\"outline\" className=\"text-xs\">\n {team}\n </Badge>\n ))}\n </div>\n </div>\n )}\n\n {/* Technical information: AI-facing fields, de-emphasized/collapsed */}\n {(app.aiPrompt || app.aiMemory) && (\n <Accordion type=\"single\" collapsible className=\"mt-6\">\n <AccordionItem\n value=\"technical-info\"\n className=\"border rounded-lg px-4\"\n >\n <AccordionTrigger className=\"text-sm hover:no-underline py-3\">\n Technical information\n </AccordionTrigger>\n <AccordionContent className=\"pb-3 space-y-3\">\n {app.aiPrompt && (\n <div>\n <h4 className=\"mb-1 text-xs font-medium text-muted-foreground\">\n AI Prompt\n </h4>\n <p className=\"text-xs whitespace-pre-wrap\">\n {app.aiPrompt}\n </p>\n </div>\n )}\n {app.aiMemory && (\n <div>\n <h4 className=\"mb-1 text-xs font-medium text-muted-foreground\">\n AI Memory\n </h4>\n <p className=\"text-xs whitespace-pre-wrap\">\n {app.aiMemory}\n </p>\n </div>\n )}\n </AccordionContent>\n </AccordionItem>\n </Accordion>\n )}\n\n {/* Metadata: Added / Updated */}\n {(app.createdAt || app.freshness?.lastCheckedAt) && (\n <div className=\"mt-6 flex flex-wrap gap-x-5 gap-y-1\">\n {app.createdAt && (\n <span\n className=\"inline-flex items-center gap-1 text-xs text-muted-foreground\"\n title={app.createdAt}\n >\n <CalendarPlus className=\"size-3\" />\n Added {formatRelativeTime(app.createdAt)}\n </span>\n )}\n {app.freshness?.lastCheckedAt && (\n <span\n className=\"inline-flex items-center gap-1 text-xs text-muted-foreground\"\n title={\n app.freshness.lastContentChangeAt\n ? `Content last changed ${app.freshness.lastContentChangeAt} · last checked ${app.freshness.lastCheckedAt}`\n : `Last checked ${app.freshness.lastCheckedAt}`\n }\n >\n <Clock className=\"size-3\" />\n {/* \"Updated\" means the content changed, not that a check ran -\n entries predating the field have none, so fall back. */}\n Updated{' '}\n {formatRelativeTime(\n app.freshness.lastContentChangeAt ??\n app.freshness.lastCheckedAt,\n )}\n {app.freshness.isStale && (\n <span className=\"italic opacity-75\">\n {' '}\n · may be out of date\n </span>\n )}\n </span>\n )}\n </div>\n )}\n\n {/* Sources */}\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">Sources</h3>\n {isAdmin ? (\n <>\n <ul className=\"space-y-2\">\n {displaySources.map((url, index) => {\n const isDraft =\n draftSource !== null && index === sourceUrls.length\n return (\n <li\n key={isDraft ? 'draft' : `${index}-${url}`}\n className=\"flex items-center gap-2 text-xs\"\n >\n <span className=\"text-muted-foreground shrink-0 tabular-nums\">\n {index + 1}.\n </span>\n <InlineEditableField\n value={url}\n initialEditMode={isDraft}\n onCancel={\n isDraft ? () => setDraftSource(null) : undefined\n }\n onSave={(newUrl) => {\n if (isDraft) {\n setDraftSource(null)\n if (newUrl) {\n updateApp.mutate({\n id: app.id,\n data: { sources: [...sourceUrls, newUrl] },\n })\n }\n } else {\n const next = [...sourceUrls]\n next[index] = newUrl\n updateApp.mutate({\n id: app.id,\n data: { sources: next.filter(Boolean) },\n })\n }\n }}\n placeholder=\"https://...\"\n viewClassName=\"flex-1 min-w-0\"\n renderView={(val) =>\n val ? (\n <a\n href={val}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"hover:text-primary inline-flex items-center gap-1 truncate\"\n >\n {displayUrl(val)}\n <ExternalLink className=\"size-3 shrink-0\" />\n </a>\n ) : (\n <span className=\"text-muted-foreground\">—</span>\n )\n }\n />\n {!isDraft && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label=\"Remove source\"\n className=\"shrink-0 text-muted-foreground hover:text-destructive\"\n onClick={() => {\n const next = sourceUrls.filter(\n (_, i) => i !== index,\n )\n updateApp.mutate({\n id: app.id,\n data: { sources: next },\n })\n }}\n >\n <Trash2 className=\"size-3.5\" />\n </Button>\n )}\n </li>\n )\n })}\n </ul>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"mt-2 gap-1 text-muted-foreground\"\n onClick={() => setDraftSource('')}\n >\n <Plus className=\"size-3.5\" />\n Add source\n </Button>\n </>\n ) : (\n <ul className=\"space-y-2\">\n {sourceUrls.map((url, index) => (\n <li key={index} className=\"flex items-center gap-2 text-xs\">\n <span className=\"text-muted-foreground shrink-0 tabular-nums\">\n {index + 1}.\n </span>\n {url ? (\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"hover:text-primary inline-flex items-center gap-1 truncate\"\n >\n {displayUrl(url)}\n <ExternalLink className=\"size-3 shrink-0\" />\n </a>\n ) : (\n <span className=\"text-muted-foreground\">—</span>\n )}\n </li>\n ))}\n </ul>\n )}\n </div>\n\n {/* Freshness now shown near the header (see \"Updated …\" above). */}\n\n <CommentsSection appSlug={app.slug} />\n </div>\n\n {/* Screenshot Gallery Dialog */}\n <ScreenshotGallery\n app={app}\n screenshotIds={app.screenshotIds || []}\n open={isGalleryOpen}\n onOpenChange={setIsGalleryOpen}\n initialIndex={galleryInitialIndex}\n title={`${app.abbreviation || app.displayName} - Screenshots`}\n />\n </>\n )\n}\n"],"names":["React","_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,SAAS,WAAW,UAA0B;AAC5C,SAAO,cAAc,QAAQ;AAC/B;AAEA,SAAS,QAAQ,EAAE,KAAK,aAAoD;AAC1E,QAAM,CAAC,YAAY,aAAa,IAAIA,eAAM,SAAS,KAAK;AAGxD,MAAI,IAAI,YAAY,CAAC,YAAY;AAC/B,+BACG,OAAA,EAAI,WAAW,GAAG,oBAAoB,SAAS,GAC9C,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAK,WAAW,IAAI,QAAQ;AAAA,QAC5B,KAA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,UAAA;AAAA,QAE/B,EAAA,CACF,IAEA,oBAAC,MAAA,EAAG,WAAU,aACX,UAAA,WAAW,IAAI,CAAC,KAAK,UACpB,qBAAC,MAAA,EAAe,WAAU,mCACxB,UAAA;AAAA,UAAA,qBAAC,QAAA,EAAK,WAAU,+CACb,UAAA;AAAA,YAAA,QAAQ;AAAA,YAAE;AAAA,UAAA,GACb;AAAA,UACC,MACC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAM;AAAA,cACN,QAAO;AAAA,cACP,KAAI;AAAA,cACJ,WAAU;AAAA,cAET,UAAA;AAAA,gBAAA,WAAW,GAAG;AAAA,gBACf,oBAAC,cAAA,EAAa,WAAU,kBAAA,CAAkB;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA,IAG5C,oBAAC,QAAA,EAAK,WAAU,yBAAwB,UAAA,IAAA,CAAC;AAAA,QAAA,EAAA,GAfpC,KAiBT,CACD,EAAA,CACH;AAAA,MAAA,GAEJ;AAAA,MAIA,oBAAC,iBAAA,EAAgB,SAAS,IAAI,KAAA,CAAM;AAAA,IAAA,GACtC;AAAA,IAGA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAe,IAAI,iBAAiB,CAAA;AAAA,QACpC,MAAM;AAAA,QACN,cAAc;AAAA,QACd,cAAc;AAAA,QACd,OAAO,GAAG,IAAI,gBAAgB,IAAI,WAAW;AAAA,MAAA;AAAA,IAAA;AAAA,EAC/C,GACF;AAEJ;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { QuickJump, Resource } from '@igstack/app-catalog-backend-core';
|
|
2
|
+
/**
|
|
3
|
+
* Build a jump's target url. The whole template "engine": two placeholders,
|
|
4
|
+
* `{{baseHost}}` substituted raw (it is a url prefix) and `{{value}}` encoded
|
|
5
|
+
* exactly once. Returns null when the jump needs a host the resource does not
|
|
6
|
+
* have — the caller drops it instead of rendering a broken link.
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildQuickJumpUrl(jump: QuickJump, value: string, appUrl?: string): string | null;
|
|
9
|
+
export interface QuickJumpIdentity {
|
|
10
|
+
/** Human label, e.g. "Case Id" — also the column heading. */
|
|
11
|
+
identity: string;
|
|
12
|
+
jumps: QuickJump[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Group an app's jumps by identity, keeping first-appearance order (so company
|
|
16
|
+
* config controls the column order) and dropping jumps this app cannot build.
|
|
17
|
+
*/
|
|
18
|
+
export declare function groupQuickJumps(app: Resource): QuickJumpIdentity[];
|
|
19
|
+
/**
|
|
20
|
+
* Autofill key for an identity's input. Namespaced and derived from the label,
|
|
21
|
+
* so the same identifier autofills from history across apps — the browser gives
|
|
22
|
+
* us per-identity value history for free.
|
|
23
|
+
*/
|
|
24
|
+
export declare function quickJumpFieldName(identity: string): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function buildQuickJumpUrl(jump, value, appUrl) {
|
|
2
|
+
const needsHost = jump.url.includes("{{baseHost}}");
|
|
3
|
+
const host = (appUrl ?? "").replace(/\/+$/, "");
|
|
4
|
+
if (needsHost && !host) return null;
|
|
5
|
+
return jump.url.replaceAll("{{baseHost}}", host).replaceAll("{{value}}", encodeURIComponent(value.trim()));
|
|
6
|
+
}
|
|
7
|
+
function groupQuickJumps(app) {
|
|
8
|
+
const groups = [];
|
|
9
|
+
for (const jump of app.quickJumps ?? []) {
|
|
10
|
+
if (buildQuickJumpUrl(jump, "probe", app.appUrl) === null) continue;
|
|
11
|
+
const group = groups.find((g) => g.identity === jump.identity);
|
|
12
|
+
if (group) group.jumps.push(jump);
|
|
13
|
+
else groups.push({ identity: jump.identity, jumps: [jump] });
|
|
14
|
+
}
|
|
15
|
+
return groups;
|
|
16
|
+
}
|
|
17
|
+
function quickJumpFieldName(identity) {
|
|
18
|
+
return `qj-${identity.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "")}`;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
buildQuickJumpUrl,
|
|
22
|
+
groupQuickJumps,
|
|
23
|
+
quickJumpFieldName
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=quickJump.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quickJump.js","sources":["../../../../../src/modules/appCatalog/utils/quickJump.ts"],"sourcesContent":["import type { QuickJump, Resource } from '@igstack/app-catalog-backend-core'\n\n/**\n * Build a jump's target url. The whole template \"engine\": two placeholders,\n * `{{baseHost}}` substituted raw (it is a url prefix) and `{{value}}` encoded\n * exactly once. Returns null when the jump needs a host the resource does not\n * have — the caller drops it instead of rendering a broken link.\n */\nexport function buildQuickJumpUrl(\n jump: QuickJump,\n value: string,\n appUrl?: string,\n): string | null {\n const needsHost = jump.url.includes('{{baseHost}}')\n const host = (appUrl ?? '').replace(/\\/+$/, '')\n if (needsHost && !host) return null\n\n return jump.url\n .replaceAll('{{baseHost}}', host)\n .replaceAll('{{value}}', encodeURIComponent(value.trim()))\n}\n\nexport interface QuickJumpIdentity {\n /** Human label, e.g. \"Case Id\" — also the column heading. */\n identity: string\n jumps: QuickJump[]\n}\n\n/**\n * Group an app's jumps by identity, keeping first-appearance order (so company\n * config controls the column order) and dropping jumps this app cannot build.\n */\nexport function groupQuickJumps(app: Resource): QuickJumpIdentity[] {\n const groups: QuickJumpIdentity[] = []\n\n for (const jump of app.quickJumps ?? []) {\n if (buildQuickJumpUrl(jump, 'probe', app.appUrl) === null) continue\n\n const group = groups.find((g) => g.identity === jump.identity)\n if (group) group.jumps.push(jump)\n else groups.push({ identity: jump.identity, jumps: [jump] })\n }\n\n return groups\n}\n\n/**\n * Autofill key for an identity's input. Namespaced and derived from the label,\n * so the same identifier autofills from history across apps — the browser gives\n * us per-identity value history for free.\n */\nexport function quickJumpFieldName(identity: string): string {\n return `qj-${identity\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')}`\n}\n"],"names":[],"mappings":"AAQO,SAAS,kBACd,MACA,OACA,QACe;AACf,QAAM,YAAY,KAAK,IAAI,SAAS,cAAc;AAClD,QAAM,QAAQ,UAAU,IAAI,QAAQ,QAAQ,EAAE;AAC9C,MAAI,aAAa,CAAC,KAAM,QAAO;AAE/B,SAAO,KAAK,IACT,WAAW,gBAAgB,IAAI,EAC/B,WAAW,aAAa,mBAAmB,MAAM,KAAA,CAAM,CAAC;AAC7D;AAYO,SAAS,gBAAgB,KAAoC;AAClE,QAAM,SAA8B,CAAA;AAEpC,aAAW,QAAQ,IAAI,cAAc,CAAA,GAAI;AACvC,QAAI,kBAAkB,MAAM,SAAS,IAAI,MAAM,MAAM,KAAM;AAE3D,UAAM,QAAQ,OAAO,KAAK,CAAC,MAAM,EAAE,aAAa,KAAK,QAAQ;AAC7D,QAAI,MAAO,OAAM,MAAM,KAAK,IAAI;AAAA,QAC3B,QAAO,KAAK,EAAE,UAAU,KAAK,UAAU,OAAO,CAAC,IAAI,GAAG;AAAA,EAC7D;AAEA,SAAO;AACT;AAOO,SAAS,mBAAmB,UAA0B;AAC3D,SAAO,MAAM,SACV,YAAA,EACA,QAAQ,eAAe,GAAG,EAC1B,QAAQ,YAAY,EAAE,CAAC;AAC5B;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3
|
+
import { CheckIcon } from "lucide-react";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
function Checkbox({
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
CheckboxPrimitive.Root,
|
|
11
|
+
{
|
|
12
|
+
"data-slot": "checkbox",
|
|
13
|
+
className: cn(
|
|
14
|
+
"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
15
|
+
className
|
|
16
|
+
),
|
|
17
|
+
...props,
|
|
18
|
+
children: /* @__PURE__ */ jsx(
|
|
19
|
+
CheckboxPrimitive.Indicator,
|
|
20
|
+
{
|
|
21
|
+
"data-slot": "checkbox-indicator",
|
|
22
|
+
className: "grid place-content-center text-current transition-none",
|
|
23
|
+
children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5" })
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
Checkbox
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","sources":["../../../src/ui/checkbox.tsx"],"sourcesContent":["import * as React from 'react'\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport { CheckIcon } from 'lucide-react'\n\nimport { cn } from '~/lib/utils'\n\nfunction Checkbox({\n className,\n ...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n 'peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n}\n\nexport { Checkbox }\n"],"names":[],"mappings":";;;;AAMA,SAAS,SAAS;AAAA,EAChB;AAAA,EACA,GAAG;AACL,GAAwD;AACtD,SACE;AAAA,IAAC,kBAAkB;AAAA,IAAlB;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAC,kBAAkB;AAAA,QAAlB;AAAA,UACC,aAAU;AAAA,UACV,WAAU;AAAA,UAEV,UAAA,oBAAC,WAAA,EAAU,WAAU,WAAA,CAAW;AAAA,QAAA;AAAA,MAAA;AAAA,IAClC;AAAA,EAAA;AAGN;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@igstack/app-catalog-frontend-core",
|
|
3
|
-
"version": "4.0.0-alpha-
|
|
3
|
+
"version": "4.0.0-alpha-20260919013047",
|
|
4
4
|
"description": "Frontend core library for App Catalog",
|
|
5
5
|
"homepage": "https://github.com/lislon/app-catalog",
|
|
6
6
|
"repository": {
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"tailwindcss": "^4.1.7",
|
|
114
114
|
"tiptap-markdown": "^0.8.0",
|
|
115
115
|
"tslib": "^2.3.0",
|
|
116
|
-
"@igstack/app-catalog-shared-core": "4.0.0-alpha-
|
|
116
|
+
"@igstack/app-catalog-shared-core": "4.0.0-alpha-20260919013047"
|
|
117
117
|
},
|
|
118
118
|
"devDependencies": {
|
|
119
119
|
"@tailwindcss/vite": "^4.0.5",
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"vite-plugin-static-copy": "^3.1.4",
|
|
141
141
|
"vite-plugin-svgr": "^4.2.0",
|
|
142
142
|
"vitest": "^4.1.2",
|
|
143
|
-
"@igstack/app-catalog-backend-core": "4.0.0-alpha-
|
|
143
|
+
"@igstack/app-catalog-backend-core": "4.0.0-alpha-20260919013047"
|
|
144
144
|
},
|
|
145
145
|
"peerDependencies": {
|
|
146
146
|
"react": "19.1.2",
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"vite": "^6.3.5",
|
|
150
150
|
"vite-plugin-svgr": "^4.2.0"
|
|
151
151
|
},
|
|
152
|
-
"gitHead": "
|
|
152
|
+
"gitHead": "3f95f545d9ad53d62a4d7302b195f2d1f1d1501e",
|
|
153
153
|
"scripts": {
|
|
154
154
|
"build": "vite build",
|
|
155
155
|
"build:lenient": "vite build --mode lenient",
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { QuickJump, Resource } from '@igstack/app-catalog-backend-core'
|
|
2
|
+
import { describe, expect, it } from 'vitest'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
buildQuickJumpUrl,
|
|
6
|
+
groupQuickJumps,
|
|
7
|
+
quickJumpFieldName,
|
|
8
|
+
} from '~/modules/appCatalog/utils/quickJump'
|
|
9
|
+
|
|
10
|
+
const onHost: QuickJump = {
|
|
11
|
+
identity: 'Case Id',
|
|
12
|
+
title: 'View case',
|
|
13
|
+
url: '{{baseHost}}/app/case?id={{value}}',
|
|
14
|
+
}
|
|
15
|
+
const absolute: QuickJump = {
|
|
16
|
+
identity: 'Case Id',
|
|
17
|
+
title: 'Search the event log',
|
|
18
|
+
url: 'https://events.example.com/search?q={{value}}',
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function resource(quickJumps: QuickJump[], appUrl?: string): Resource {
|
|
22
|
+
return {
|
|
23
|
+
id: 'r1',
|
|
24
|
+
slug: 'app',
|
|
25
|
+
displayName: 'App',
|
|
26
|
+
description: '',
|
|
27
|
+
appUrl,
|
|
28
|
+
quickJumps,
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
describe('buildQuickJumpUrl', () => {
|
|
33
|
+
it("substitutes the resource's own host, without its trailing slash", () => {
|
|
34
|
+
expect(buildQuickJumpUrl(onHost, '42', 'https://app.example.com/')).toBe(
|
|
35
|
+
'https://app.example.com/app/case?id=42',
|
|
36
|
+
)
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it('drops a jump that needs a host the resource does not have', () => {
|
|
40
|
+
expect(buildQuickJumpUrl(onHost, '42', undefined)).toBeNull()
|
|
41
|
+
expect(buildQuickJumpUrl(absolute, '42', undefined)).toBe(
|
|
42
|
+
'https://events.example.com/search?q=42',
|
|
43
|
+
)
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it('encodes the typed value exactly once', () => {
|
|
47
|
+
// env-hopper ships %2540 in places — a genuine double-encode bug.
|
|
48
|
+
expect(buildQuickJumpUrl(absolute, 'a b&c@d')).toBe(
|
|
49
|
+
'https://events.example.com/search?q=a%20b%26c%40d',
|
|
50
|
+
)
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
it('trims the typed value', () => {
|
|
54
|
+
expect(buildQuickJumpUrl(absolute, ' 42\n')).toBe(
|
|
55
|
+
'https://events.example.com/search?q=42',
|
|
56
|
+
)
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
describe('groupQuickJumps', () => {
|
|
61
|
+
it('groups by identity in first-appearance order and drops unbuildable jumps', () => {
|
|
62
|
+
const app = resource([
|
|
63
|
+
absolute,
|
|
64
|
+
{ ...onHost, identity: 'Clinic Id' },
|
|
65
|
+
{ ...absolute, title: 'Second case link' },
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
expect(groupQuickJumps(app)).toEqual([
|
|
69
|
+
{
|
|
70
|
+
identity: 'Case Id',
|
|
71
|
+
jumps: [absolute, { ...absolute, title: 'Second case link' }],
|
|
72
|
+
},
|
|
73
|
+
])
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
describe('quickJumpFieldName', () => {
|
|
78
|
+
it('derives one stable autofill key per identity label', () => {
|
|
79
|
+
expect(quickJumpFieldName('Case Id')).toBe('qj-case-id')
|
|
80
|
+
expect(quickJumpFieldName('Sequencing Sample Id')).toBe(
|
|
81
|
+
'qj-sequencing-sample-id',
|
|
82
|
+
)
|
|
83
|
+
})
|
|
84
|
+
})
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 27.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 375.9 244.9" style="enable-background:new 0 0 375.9 244.9;" xml:space="preserve">
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
.st0{opacity:0.05;}
|
|
7
|
+
.st1{fill:#A78256;}
|
|
8
|
+
.st2{fill:#8BC143;}
|
|
9
|
+
.st3{fill:#25572C;}
|
|
10
|
+
.st4{fill:#367F3D;}
|
|
11
|
+
.st5{clip-path:url(#SVGID_00000004530938209597365300000002644174144295954342_);fill:#FFFFFF;}
|
|
12
|
+
.st6{fill:#D5DA38;}
|
|
13
|
+
.st7{fill:#DCB78B;}
|
|
14
|
+
.st8{fill:#A68356;}
|
|
15
|
+
.st9{fill:none;}
|
|
16
|
+
.st10{fill:#296A35;}
|
|
17
|
+
.st11{fill:#24572C;}
|
|
18
|
+
.st12{fill:#56B347;}
|
|
19
|
+
.st13{fill:#2E753A;}
|
|
20
|
+
.st14{fill:#FFFFFF;}
|
|
21
|
+
.st15{fill:#78983D;}
|
|
22
|
+
.st16{fill:#38803E;}
|
|
23
|
+
</style>
|
|
24
|
+
<g id="Layer_4">
|
|
25
|
+
<path class="st0" d="M348.07,224.58c0,13.58-76.31,16.29-168.48,13.91c-85.51-2.21-167.67-12.7-167.67-26.28
|
|
26
|
+
c0-13.58,75.86-16.6,168-13.55C251.54,201.04,348.07,211,348.07,224.58z"/>
|
|
27
|
+
</g>
|
|
28
|
+
<g id="Layer_5">
|
|
29
|
+
<path class="st1" d="M191.33,63.44c-4.71-1.27-9.7,3.77-11.78,5.44c-22.75,18.26-65.08,108.22-68.32,110.8
|
|
30
|
+
c-2.65,2.11-12.55-4.77-26.06,6.99c-2.28,1.99,17.71-3.94,27.35,4.79c4.31,3.9,22.67-31.3,43.4-74.21
|
|
31
|
+
c7.89-16.33,16.66-28.67,29.37-41.6c3.95-4.02,9.74-6.99,9.13-9.83C194.07,64.16,191.67,63.53,191.33,63.44z"/>
|
|
32
|
+
<path class="st2" d="M315.5,185.71c19.53-4.58,25.95-33.16,23.08-54.88c-3.64-27.61-17.56-34.28-34.67-33.9
|
|
33
|
+
c-19.88,0.44-44.11,22.97-32.88,51.46C277.76,165.5,296.2,190.24,315.5,185.71z"/>
|
|
34
|
+
<path class="st3" d="M317.37,92.95c-1.19,0.17-6.89-0.13-6.55-0.52c16.19-18.5,39.73-46.86,55.69-73.93
|
|
35
|
+
c0.14-0.24,1.75,7.27-24.68,43.19C341.84,61.7,317.94,92.87,317.37,92.95z"/>
|
|
36
|
+
<path class="st4" d="M295.82,101.2c-2.01-0.96,43.56-73.4,51-101.15c0.27-1.02-0.95,15.86-12.52,38.58
|
|
37
|
+
C315.28,76,306.48,92.6,301.71,101.2C301.06,102.37,297.81,102.14,295.82,101.2z"/>
|
|
38
|
+
<g>
|
|
39
|
+
<defs>
|
|
40
|
+
<path id="SVGID_1_" d="M337.53,110.9c4.31-1.33,15.13,4.96,15.29,15.68c0.13,8.83-8.71,15.46-11.6,15.57
|
|
41
|
+
c-1.01,0.04,0.03-4.88-0.72-15.7C340.01,119.23,335.7,111.46,337.53,110.9z"/>
|
|
42
|
+
</defs>
|
|
43
|
+
<use xlink:href="#SVGID_1_" style="overflow:visible;fill:#8BC143;"/>
|
|
44
|
+
<clipPath id="SVGID_00000141425935757089766400000014964260461132888230_">
|
|
45
|
+
<use xlink:href="#SVGID_1_" style="overflow:visible;"/>
|
|
46
|
+
</clipPath>
|
|
47
|
+
|
|
48
|
+
<circle style="clip-path:url(#SVGID_00000141425935757089766400000014964260461132888230_);fill:#FFFFFF;" cx="337.66" cy="125.78" r="12.55"/>
|
|
49
|
+
</g>
|
|
50
|
+
<path class="st4" d="M72,148.17c12.3-16.8,133.34-31.43,144.28-31.28c0.4,0.01,0.69,4.28,22.94,13.64
|
|
51
|
+
c2.33,0.98,10.66,4.72,16.04,13.86c2.43,4.12,4.42,10.67,4.47,15.71c0.01,1.33-56.06,5.28-103.07,4.71
|
|
52
|
+
C96.02,164.07,68.08,153.52,72,148.17z"/>
|
|
53
|
+
<path class="st6" d="M113.86,186.55c-5.06-0.46-27.13-8.1-29.26-21.47c-0.61-3.81,0.35-6.85,0.8-8.08
|
|
54
|
+
c0.59-1.6,23.41,9.72,87.9,8.39c64.06-1.32,85.65-5.83,86.01-5.03C261.99,166.36,217.6,195.93,113.86,186.55z"/>
|
|
55
|
+
<path class="st2" d="M223.03,117.14c0.76-3.5,10.69-5.08,18.2-5.08c8.44,0,13.29-0.15,19.65-0.89c12.74-1.48,18.97-6.96,16.62-4.53
|
|
56
|
+
c-9.94,10.29-9.77,18.79-8.5,32.04c1.43,14.96,14.3,27.99,13.47,28.38c-4.47,2.09-10.28,6.04-15.14,4.32
|
|
57
|
+
c-9.04-3.19-4.77-21.85-13.13-32.7C246.81,129.06,222,121.89,223.03,117.14z"/>
|
|
58
|
+
<path d="M282.17,152.19c-0.5,4.28,0.64,14.39,6.17,20.99c6.21,7.43,5.99,7.21,12.31,9.99c0,0,0.01,0,0.01,0
|
|
59
|
+
c0.38-0.14-16.24-8.73-16.42-31.1C284.23,150.94,282.22,151.73,282.17,152.19z"/>
|
|
60
|
+
<path class="st7" d="M45.22,202.22c6.4-10.37,14.58-24.72,24.79-41.13c0,0,21.09-33.2,24.52-37.55c0,0,3.69-5.56,18.22-23.3
|
|
61
|
+
c0,0,2.49-3.04,9.72-9.39c3.36-2.95,4.91-4.03,7.18-4.42c2.76-0.47,6.2,0.15,8.83,1.99c0.61,0.42,1.07,0.8,1.1,0.88
|
|
62
|
+
c1.06,2.57,1.99,6.55-1.88,7.07c-2.91,0.39-4.38-0.83-6.43-0.18c-7.92,2.5-29.4,29.72-54.03,76.49
|
|
63
|
+
c-3.25,6.17-19.82,35.14-27.33,40.86c-0.17,0.13-0.66,0.66-3.12-0.63c-13.53-7.14-29.12-3.25-29.21-3.95
|
|
64
|
+
c-0.06-0.49,10.19-7.43,18.55-6.93C37.99,202.14,45.53,202.14,45.22,202.22z"/>
|
|
65
|
+
<path class="st7" d="M233.42,187.34c-2.31-1.13-4.34,0.53-5.99,1.85c0,0-6.49,4.43-3.04,9.36c6.54,9.33,19.97,19.12,50.58,34.48
|
|
66
|
+
c6.93,3.48,15.18,1.56,14.55,0.75c-3.2-4.11-39.95-19.08-51.05-29.73c-3.94-3.78-7.05-6.27-6.02-8.78
|
|
67
|
+
c0.66-1.61,2.83-2.06,3.31-3.64C236.28,189.94,235.32,188.95,233.42,187.34z"/>
|
|
68
|
+
<path class="st8" d="M263.01,192.63c-1.5-1.35-2.61-2.35-6.44,2.21c-2.22,2.64-3.78,5.85-3.24,8.5
|
|
69
|
+
c0.99,4.86,21.45,8.27,38.69,13.14c37.25,10.53,37.8,2.69,36.99,1.8c-0.24-0.27-25.47-3.5-49.47-9.42
|
|
70
|
+
c-14.27-3.52-18.08-5.91-17.15-10.56C262.86,195.91,266,195.32,263.01,192.63z"/>
|
|
71
|
+
<path class="st9" d="M71.78,148.17c2.54-10.82,106.81-31.18,144.37-31.18c0.44,0,0.86,0.75,1.89,1.97c2.9,3.43,6.53,4.52,7.57,4.99
|
|
72
|
+
c6.46,2.94,19.64,8.94,26.12,15.55c3.31,3.37,7.27,9.35,8.34,20.49C235.66,168.76,67.45,166.6,71.78,148.17z"/>
|
|
73
|
+
<path class="st10" d="M230.47,186.52c-2.04-2.62,11.48-19.13,25.95-22.56c1.88-0.45,5.96-0.11,7.34,1.93
|
|
74
|
+
c2.6,3.84-1.44,12.39-10.1,17.84c-8.87,5.59-16.41,9.16-17.23,8.33c-1.01-1.01-0.23-2.89-1.77-4.47
|
|
75
|
+
C233.1,185.98,231.17,187.41,230.47,186.52z"/>
|
|
76
|
+
<path class="st11" d="M264.81,194.71c-1.66-0.94-1.79-3.5-3.48-3.59c-2.06-0.11-3.41,3.84-4.91,3.48c-0.82-0.2-1.3-1.54-1.33-2.37
|
|
77
|
+
c-0.22-6.52,3.26-20.26,6.63-23.47c2.17-2.06,3.76,2.9,8.12,3.09c3.75,0.17,11.88-5.24,13.86-3.59c2.65,2.21-2.86,8.62-3.48,9.72
|
|
78
|
+
C275.33,186.72,265.69,195.21,264.81,194.71z"/>
|
|
79
|
+
<path class="st12" d="M228.92,187.2c1.07-0.44-0.94-5.63,7.67-13.25c6.51-5.76,10.78-6.24,11.82-8.56
|
|
80
|
+
c0.72-1.61-20.78-17.36-41.36-21.92c-11.26-2.5-61.01-55.21-63-56.21c-1.79-0.9-13.79,7.06-13.42,10.21
|
|
81
|
+
c0.35,2.92,13.91,9.77,35.89,27C183.86,138.07,211.31,194.44,228.92,187.2z"/>
|
|
82
|
+
<path class="st13" d="M199.73,65.27c0.65-0.11,36.98,40.09,41.89,43.44c0.85,0.58-14.58,2.12-14.94,1.47
|
|
83
|
+
c-7.27-12.72-38.41-29.6-38.98-35.91C187.4,71.04,196.38,65.84,199.73,65.27z"/>
|
|
84
|
+
<path class="st14" d="M313.18,126.49c0,8.27-6.71,14.98-14.98,14.98c-5.19,0-8.11-3.24-8.94-3.95c-0.44-0.38-6.18-4.4-6.04-11.03
|
|
85
|
+
c0.15-7.14,6.13-14.98,14.98-14.98C306.47,111.5,313.18,118.21,313.18,126.49z"/>
|
|
86
|
+
<path d="M339.38,121.61c-0.26-1.14,6.55,3.28,6.55,8.28c0,6.29-4.95,9.39-5.12,6.37C340.64,133.11,341.42,130.66,339.38,121.61z"/>
|
|
87
|
+
<path d="M277.61,148.06c0.1-0.43,2.35,1.42,5.98,1.9c3.27,0.43,5.79-0.08,5.77,0.07c-0.07,0.54-2.51,2.97-6.17,2.54
|
|
88
|
+
C278.34,152,277.5,148.53,277.61,148.06z"/>
|
|
89
|
+
<circle cx="296.71" cy="131.43" r="8.53"/>
|
|
90
|
+
<path d="M290.02,104.95c-4.8,1.75-12.41,8.08-11.71,9.17c1.25,1.95,17.54-5.95,17.02-8.23
|
|
91
|
+
C295.06,104.68,293.99,103.51,290.02,104.95z"/>
|
|
92
|
+
<circle class="st14" cx="297.94" cy="127.11" r="2.21"/>
|
|
93
|
+
<path class="st15" d="M92.76,178.11c-0.22-0.28-0.39-8.02,4-10.96c0.11-0.07,3.48-0.08,3.64-0.03c0.39,0.11-3.98,5.51-4.72,12.58
|
|
94
|
+
C95.63,180.22,92.86,178.23,92.76,178.11z"/>
|
|
95
|
+
<path class="st15" d="M113.67,185.95c-0.22-0.28-1.35-14.46,3.87-15.24c0.97-0.14,3.13-0.09,2.97,0.01
|
|
96
|
+
c-0.35,0.21-3.53,4.43-3.45,15.73C117.06,186.98,113.77,186.07,113.67,185.95z"/>
|
|
97
|
+
<path class="st15" d="M138.4,188.86c-0.22-0.28-3.66-13.37,0.43-15.95c0.83-0.52,3.35-0.99,3.18-0.89
|
|
98
|
+
c-0.35,0.21-0.78,5.37-0.7,16.67C141.32,189.22,138.49,188.98,138.4,188.86z"/>
|
|
99
|
+
<path class="st15" d="M161.4,188.79c-0.35-0.04-5.78-13.76-1.69-16.34c0.8-0.51,3.18-1.24,3.19-1.2c0,0-0.01,0.01-0.01,0.01
|
|
100
|
+
c-0.23,0.15-0.44,1.64-0.63,3.7c-0.11,1.24-0.05,3.87,0.07,4.9c0.77,6.19,2.5,8.5,2.15,8.69
|
|
101
|
+
C163.62,188.99,162.35,188.9,161.4,188.79z"/>
|
|
102
|
+
<path class="st15" d="M180.03,187.6c-0.35-0.04-6.32-13.45-2.23-16.03c0.8-0.51,3.18-1.24,3.19-1.2c0,0-0.5,0.13-0.5,0.13
|
|
103
|
+
c-0.23,0.15-0.32,1.46-0.5,3.52c-0.11,1.24,0.31,3.92,0.44,4.95c0.77,6.19,2.64,8.55,2.38,8.57
|
|
104
|
+
C181.95,187.6,180.97,187.71,180.03,187.6z"/>
|
|
105
|
+
<path class="st15" d="M198.4,185.28c-0.35-0.04-8.12-13.29-4.02-15.87c0.8-0.51,2.21-1.68,2.22-1.64c0,0,0.55,0,0.55,0
|
|
106
|
+
c-0.23,0.15,0.04,3.79,0.14,4.39c0.22,1.23,0.93,4.64,1.74,6.57c2.39,5.76,3.39,6.47,3.13,6.49
|
|
107
|
+
C201.31,185.29,199.35,185.39,198.4,185.28z"/>
|
|
108
|
+
</g>
|
|
109
|
+
<g id="Layer_3">
|
|
110
|
+
<path class="st16" d="M277.43,106.34c1.1-0.86-7.15,2.43-7.98,3.2c-7.37,6.87-7.84,21.06-5.39,31.28
|
|
111
|
+
c3.23,13.47,9.18,28.71,14.36,28.52c0.93-0.03,2.76-0.77,3.31-1.63c0.25-0.39-11.13-8.17-14.05-34.12
|
|
112
|
+
C265.92,117.99,274.28,108.78,277.43,106.34z"/>
|
|
113
|
+
</g>
|
|
114
|
+
</svg>
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import type { QuickJump, Resource } from '@igstack/app-catalog-backend-core'
|
|
2
|
+
import { Pin, Settings2 } from 'lucide-react'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
5
|
+
import Grasshopper from '~/assets/grasshopper.svg?react'
|
|
6
|
+
import { cn } from '~/lib/utils'
|
|
7
|
+
import { Checkbox } from '~/ui/checkbox'
|
|
8
|
+
import { Input } from '~/ui/input'
|
|
9
|
+
import { Popover, PopoverContent, PopoverTrigger } from '~/ui/popover'
|
|
10
|
+
import {
|
|
11
|
+
buildQuickJumpUrl,
|
|
12
|
+
groupQuickJumps,
|
|
13
|
+
quickJumpFieldName,
|
|
14
|
+
} from '~/modules/appCatalog/utils/quickJump'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Per-user, per-app preferences. Which identities to render and whether to hoist
|
|
18
|
+
* the section to the top of the card — a browser-local display choice, so it
|
|
19
|
+
* lives in localStorage rather than costing a table and an authenticated route.
|
|
20
|
+
*/
|
|
21
|
+
interface QuickJumpPrefs {
|
|
22
|
+
/** Keep the section at the top of the app card. */
|
|
23
|
+
pinned?: boolean
|
|
24
|
+
/** Identity labels to render. Absent = the first identity only. */
|
|
25
|
+
shown?: string[]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function prefsKey(slug: string) {
|
|
29
|
+
return `ac:quickjump:${slug}`
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function readPrefs(slug: string): QuickJumpPrefs {
|
|
33
|
+
try {
|
|
34
|
+
const raw = localStorage.getItem(prefsKey(slug))
|
|
35
|
+
return raw ? (JSON.parse(raw) as QuickJumpPrefs) : {}
|
|
36
|
+
} catch {
|
|
37
|
+
return {}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function writePrefs(slug: string, prefs: QuickJumpPrefs) {
|
|
42
|
+
try {
|
|
43
|
+
localStorage.setItem(prefsKey(slug), JSON.stringify(prefs))
|
|
44
|
+
} catch {
|
|
45
|
+
// Private mode / full quota: the session still works, just doesn't persist.
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* One jump button. Disabled until its identity has a value: greyed and dashed,
|
|
51
|
+
* so the empty input above reads as the thing to do first. The green JUMP tell
|
|
52
|
+
* only shows on hover — one per row is repetition, not signal.
|
|
53
|
+
*/
|
|
54
|
+
function JumpButton({
|
|
55
|
+
jump,
|
|
56
|
+
value,
|
|
57
|
+
appUrl,
|
|
58
|
+
}: {
|
|
59
|
+
jump: QuickJump
|
|
60
|
+
value: string
|
|
61
|
+
appUrl?: string
|
|
62
|
+
}) {
|
|
63
|
+
const trimmed = value.trim()
|
|
64
|
+
const href = trimmed ? buildQuickJumpUrl(jump, trimmed, appUrl) : null
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<a
|
|
68
|
+
href={href ?? undefined}
|
|
69
|
+
target="_blank"
|
|
70
|
+
rel="noopener noreferrer"
|
|
71
|
+
aria-disabled={href ? undefined : true}
|
|
72
|
+
title={href ?? `Fill in ${jump.identity} first`}
|
|
73
|
+
className={cn(
|
|
74
|
+
'group/jump flex items-center gap-2 rounded-md border px-2.5 py-1.5 text-left text-xs font-semibold transition-colors',
|
|
75
|
+
href
|
|
76
|
+
? 'animate-button-pop bg-card shadow-sm hover:bg-accent/40'
|
|
77
|
+
: 'pointer-events-none border-dashed bg-muted text-muted-foreground opacity-70',
|
|
78
|
+
)}
|
|
79
|
+
>
|
|
80
|
+
<span className="min-w-0 flex-1 wrap-anywhere">
|
|
81
|
+
{jump.title}
|
|
82
|
+
{trimmed && <span className="ml-1 font-mono">{trimmed}</span>}
|
|
83
|
+
</span>
|
|
84
|
+
<span
|
|
85
|
+
className={cn(
|
|
86
|
+
'flex shrink-0 origin-bottom items-center gap-1 text-hopper opacity-0 transition-[opacity,transform]',
|
|
87
|
+
'group-hover/jump:-translate-x-0.5 group-hover/jump:translate-y-0.5 group-hover/jump:rotate-2 group-hover/jump:scale-y-90',
|
|
88
|
+
'group-hover/jump:opacity-100 group-focus-visible/jump:opacity-100 motion-reduce:transform-none',
|
|
89
|
+
)}
|
|
90
|
+
>
|
|
91
|
+
<span className="text-[0.65rem] font-extrabold tracking-widest">
|
|
92
|
+
JUMP
|
|
93
|
+
</span>
|
|
94
|
+
<Grasshopper aria-hidden className="h-5 w-auto" />
|
|
95
|
+
</span>
|
|
96
|
+
</a>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Quick Jump: paste an id, open the matching page. One column per identity the
|
|
102
|
+
* app's jumps ask for; only the identities the user keeps are rendered, the rest
|
|
103
|
+
* are one click away behind Configure.
|
|
104
|
+
*/
|
|
105
|
+
export function QuickJumpSection({ app }: { app: Resource }) {
|
|
106
|
+
const identities = React.useMemo(() => groupQuickJumps(app), [app])
|
|
107
|
+
const [prefs, setPrefs] = React.useState<QuickJumpPrefs>(() =>
|
|
108
|
+
readPrefs(app.slug),
|
|
109
|
+
)
|
|
110
|
+
const [values, setValues] = React.useState<Record<string, string>>({})
|
|
111
|
+
|
|
112
|
+
// Re-read when the panel moves to another app — one key per slug.
|
|
113
|
+
React.useEffect(() => {
|
|
114
|
+
setPrefs(readPrefs(app.slug))
|
|
115
|
+
setValues({})
|
|
116
|
+
}, [app.slug])
|
|
117
|
+
|
|
118
|
+
if (identities.length === 0) return null
|
|
119
|
+
|
|
120
|
+
const savePrefs = (next: QuickJumpPrefs) => {
|
|
121
|
+
setPrefs(next)
|
|
122
|
+
writePrefs(app.slug, next)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const shown = prefs.shown ?? identities.slice(0, 1).map((i) => i.identity)
|
|
126
|
+
const visible = identities.filter((i) => shown.includes(i.identity))
|
|
127
|
+
|
|
128
|
+
const toggleShown = (identity: string) =>
|
|
129
|
+
savePrefs({
|
|
130
|
+
...prefs,
|
|
131
|
+
shown: shown.includes(identity)
|
|
132
|
+
? shown.filter((s) => s !== identity)
|
|
133
|
+
: [...shown, identity],
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
<div className={cn('mt-6', prefs.pinned && 'order-[-1]')}>
|
|
138
|
+
<div className="mb-2 flex items-center gap-2">
|
|
139
|
+
<Grasshopper aria-hidden className="h-[1.15rem] w-auto shrink-0" />
|
|
140
|
+
<h3 className="text-sm font-medium">Quick Jump</h3>
|
|
141
|
+
<button
|
|
142
|
+
type="button"
|
|
143
|
+
onClick={() => savePrefs({ ...prefs, pinned: !prefs.pinned })}
|
|
144
|
+
title={
|
|
145
|
+
prefs.pinned
|
|
146
|
+
? 'Unpin section'
|
|
147
|
+
: 'Pin section — keep Quick Jump at the top of this card'
|
|
148
|
+
}
|
|
149
|
+
aria-pressed={prefs.pinned ?? false}
|
|
150
|
+
className={cn(
|
|
151
|
+
'rounded-sm p-0.5 transition-opacity hover:bg-muted',
|
|
152
|
+
prefs.pinned
|
|
153
|
+
? 'text-primary'
|
|
154
|
+
: 'text-muted-foreground opacity-50 hover:opacity-100',
|
|
155
|
+
)}
|
|
156
|
+
>
|
|
157
|
+
<Pin className="size-3.5" />
|
|
158
|
+
</button>
|
|
159
|
+
{prefs.pinned && (
|
|
160
|
+
<span className="text-xs font-semibold text-primary">
|
|
161
|
+
pinned to top
|
|
162
|
+
</span>
|
|
163
|
+
)}
|
|
164
|
+
|
|
165
|
+
{/* Nothing to configure with a single identity. */}
|
|
166
|
+
{identities.length > 1 && (
|
|
167
|
+
<Popover>
|
|
168
|
+
<PopoverTrigger className="ml-auto inline-flex items-center gap-1.5 rounded-full border border-primary/45 bg-accent/45 px-2.5 py-1 text-xs font-bold shadow-sm transition-colors hover:border-primary hover:bg-accent/80">
|
|
169
|
+
<Settings2 className="size-3.5 text-primary" />
|
|
170
|
+
Configure ({visible.length}/{identities.length})
|
|
171
|
+
</PopoverTrigger>
|
|
172
|
+
<PopoverContent align="end" className="w-64 p-1.5">
|
|
173
|
+
<p className="px-1.5 pt-0.5 pb-1.5 text-[0.7rem] text-muted-foreground">
|
|
174
|
+
Tick an ID to show it on this card.
|
|
175
|
+
</p>
|
|
176
|
+
{identities.map(({ identity, jumps }) => (
|
|
177
|
+
<label
|
|
178
|
+
key={identity}
|
|
179
|
+
className="flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1.5 text-sm hover:bg-muted"
|
|
180
|
+
>
|
|
181
|
+
<Checkbox
|
|
182
|
+
checked={shown.includes(identity)}
|
|
183
|
+
onCheckedChange={() => toggleShown(identity)}
|
|
184
|
+
/>
|
|
185
|
+
{identity}
|
|
186
|
+
<span className="ml-auto font-mono text-[0.7rem] text-muted-foreground">
|
|
187
|
+
{jumps.length}
|
|
188
|
+
</span>
|
|
189
|
+
</label>
|
|
190
|
+
))}
|
|
191
|
+
</PopoverContent>
|
|
192
|
+
</Popover>
|
|
193
|
+
)}
|
|
194
|
+
</div>
|
|
195
|
+
<p className="mb-3 text-xs text-muted-foreground">
|
|
196
|
+
Paste an ID and open the matching page.
|
|
197
|
+
</p>
|
|
198
|
+
|
|
199
|
+
{visible.length === 0 ? (
|
|
200
|
+
<p className="text-xs text-muted-foreground">
|
|
201
|
+
No IDs shown — pick one under Configure.
|
|
202
|
+
</p>
|
|
203
|
+
) : (
|
|
204
|
+
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
|
205
|
+
{visible.map(({ identity, jumps }) => {
|
|
206
|
+
const value = values[identity] ?? ''
|
|
207
|
+
return (
|
|
208
|
+
<div key={identity} className="flex min-w-0 flex-col gap-2">
|
|
209
|
+
<label
|
|
210
|
+
className="truncate text-xs font-bold"
|
|
211
|
+
htmlFor={`qj-${app.slug}-${identity}`}
|
|
212
|
+
>
|
|
213
|
+
{identity}
|
|
214
|
+
</label>
|
|
215
|
+
<Input
|
|
216
|
+
id={`qj-${app.slug}-${identity}`}
|
|
217
|
+
// Namespaced per identity: the browser remembers values typed
|
|
218
|
+
// for this identifier and offers them on every app using it.
|
|
219
|
+
name={quickJumpFieldName(identity)}
|
|
220
|
+
autoComplete="on"
|
|
221
|
+
placeholder={identity}
|
|
222
|
+
className="bg-card font-mono"
|
|
223
|
+
value={value}
|
|
224
|
+
onChange={(e) =>
|
|
225
|
+
setValues((v) => ({ ...v, [identity]: e.target.value }))
|
|
226
|
+
}
|
|
227
|
+
onKeyDown={(e) => {
|
|
228
|
+
const first = jumps[0]
|
|
229
|
+
if (e.key !== 'Enter' || !first) return
|
|
230
|
+
if (!e.currentTarget.value.trim()) return
|
|
231
|
+
const url = buildQuickJumpUrl(
|
|
232
|
+
first,
|
|
233
|
+
e.currentTarget.value,
|
|
234
|
+
app.appUrl,
|
|
235
|
+
)
|
|
236
|
+
if (url) window.open(url, '_blank', 'noopener,noreferrer')
|
|
237
|
+
}}
|
|
238
|
+
/>
|
|
239
|
+
{jumps.map((jump) => (
|
|
240
|
+
<JumpButton
|
|
241
|
+
key={`${jump.title}:${jump.url}`}
|
|
242
|
+
jump={jump}
|
|
243
|
+
value={value}
|
|
244
|
+
appUrl={app.appUrl}
|
|
245
|
+
/>
|
|
246
|
+
))}
|
|
247
|
+
</div>
|
|
248
|
+
)
|
|
249
|
+
})}
|
|
250
|
+
</div>
|
|
251
|
+
)}
|
|
252
|
+
</div>
|
|
253
|
+
)
|
|
254
|
+
}
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
} from '~/ui/accordion'
|
|
21
21
|
import { AccessRequestSection } from '../components/AccessRequestSection'
|
|
22
22
|
import { AccessPrerequisiteChain } from '../components/AccessPrerequisiteChain'
|
|
23
|
+
import { QuickJumpSection } from '../components/QuickJumpSection'
|
|
23
24
|
import { useAppCatalogFilters } from '../context/AppCatalogFiltersContext'
|
|
24
25
|
import { PersonBadge } from '../components/PersonBadge'
|
|
25
26
|
import { useUser } from '~/modules/auth'
|
|
@@ -215,8 +216,9 @@ export function AppDetails({
|
|
|
215
216
|
return (
|
|
216
217
|
<>
|
|
217
218
|
<div className="flex h-full flex-col p-6">
|
|
218
|
-
{/* Icon and Title
|
|
219
|
-
|
|
219
|
+
{/* Icon and Title — always first: a pinned Quick Jump takes order -1,
|
|
220
|
+
so the header claims -2 rather than being pushed below it. */}
|
|
221
|
+
<div className="-order-2 border-b pb-6">
|
|
220
222
|
<div className="flex items-center gap-3">
|
|
221
223
|
<AppIcon app={app} className="size-16" />
|
|
222
224
|
<div className="-mx-3 flex-1 min-w-0">
|
|
@@ -352,6 +354,10 @@ export function AppDetails({
|
|
|
352
354
|
{/* Access Request Section — hero of the detail, shown before description */}
|
|
353
355
|
<AccessRequestSection app={app} approvalMethods={approvalMethods} />
|
|
354
356
|
|
|
357
|
+
{/* Quick Jump — paste an id, open the matching page. Hoists itself to
|
|
358
|
+
the top of the card (flex order) when the user pins it. */}
|
|
359
|
+
<QuickJumpSection app={app} />
|
|
360
|
+
|
|
355
361
|
{/* Description */}
|
|
356
362
|
<div className="mt-6">
|
|
357
363
|
<h3 className="mb-2 text-sm font-medium">Description</h3>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { QuickJump, Resource } from '@igstack/app-catalog-backend-core'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Build a jump's target url. The whole template "engine": two placeholders,
|
|
5
|
+
* `{{baseHost}}` substituted raw (it is a url prefix) and `{{value}}` encoded
|
|
6
|
+
* exactly once. Returns null when the jump needs a host the resource does not
|
|
7
|
+
* have — the caller drops it instead of rendering a broken link.
|
|
8
|
+
*/
|
|
9
|
+
export function buildQuickJumpUrl(
|
|
10
|
+
jump: QuickJump,
|
|
11
|
+
value: string,
|
|
12
|
+
appUrl?: string,
|
|
13
|
+
): string | null {
|
|
14
|
+
const needsHost = jump.url.includes('{{baseHost}}')
|
|
15
|
+
const host = (appUrl ?? '').replace(/\/+$/, '')
|
|
16
|
+
if (needsHost && !host) return null
|
|
17
|
+
|
|
18
|
+
return jump.url
|
|
19
|
+
.replaceAll('{{baseHost}}', host)
|
|
20
|
+
.replaceAll('{{value}}', encodeURIComponent(value.trim()))
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface QuickJumpIdentity {
|
|
24
|
+
/** Human label, e.g. "Case Id" — also the column heading. */
|
|
25
|
+
identity: string
|
|
26
|
+
jumps: QuickJump[]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Group an app's jumps by identity, keeping first-appearance order (so company
|
|
31
|
+
* config controls the column order) and dropping jumps this app cannot build.
|
|
32
|
+
*/
|
|
33
|
+
export function groupQuickJumps(app: Resource): QuickJumpIdentity[] {
|
|
34
|
+
const groups: QuickJumpIdentity[] = []
|
|
35
|
+
|
|
36
|
+
for (const jump of app.quickJumps ?? []) {
|
|
37
|
+
if (buildQuickJumpUrl(jump, 'probe', app.appUrl) === null) continue
|
|
38
|
+
|
|
39
|
+
const group = groups.find((g) => g.identity === jump.identity)
|
|
40
|
+
if (group) group.jumps.push(jump)
|
|
41
|
+
else groups.push({ identity: jump.identity, jumps: [jump] })
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return groups
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Autofill key for an identity's input. Namespaced and derived from the label,
|
|
49
|
+
* so the same identifier autofills from history across apps — the browser gives
|
|
50
|
+
* us per-identity value history for free.
|
|
51
|
+
*/
|
|
52
|
+
export function quickJumpFieldName(identity: string): string {
|
|
53
|
+
return `qj-${identity
|
|
54
|
+
.toLowerCase()
|
|
55
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
56
|
+
.replace(/^-+|-+$/g, '')}`
|
|
57
|
+
}
|