@techdocs/cli 0.0.0-nightly-20250105023325 → 0.0.0-nightly-20250107023211
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/CHANGELOG.md +5 -5
- package/dist/embedded-app/.config-schema.json +112 -112
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/index.html.tmpl +1 -1
- package/dist/embedded-app/static/8803.20e0d00b.chunk.js +11 -0
- package/dist/embedded-app/static/8803.20e0d00b.chunk.js.map +1 -0
- package/dist/embedded-app/static/{main.842d0cf4.js → main.449eb67c.js} +1 -1
- package/dist/embedded-app/static/{main.842d0cf4.js.map → main.449eb67c.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.842d0cf4.js → runtime.449eb67c.js} +2 -2
- package/dist/embedded-app/static/{runtime.842d0cf4.js.map → runtime.449eb67c.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.842d0cf4.js → vendor.449eb67c.js} +1 -1
- package/dist/embedded-app/static/{vendor.842d0cf4.js.map → vendor.449eb67c.js.map} +1 -1
- package/dist/package.json.cjs.js +1 -1
- package/package.json +6 -6
- package/dist/embedded-app/static/8803.2d9f247d.chunk.js +0 -11
- package/dist/embedded-app/static/8803.2d9f247d.chunk.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# @techdocs/cli
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-20250107023211
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Updated dependencies
|
|
8
|
-
- @backstage/backend-defaults@0.0.0-nightly-
|
|
9
|
-
- @backstage/catalog-model@0.0.0-nightly-
|
|
8
|
+
- @backstage/backend-defaults@0.0.0-nightly-20250107023211
|
|
9
|
+
- @backstage/catalog-model@0.0.0-nightly-20250107023211
|
|
10
10
|
- @backstage/cli-common@0.1.15
|
|
11
|
-
- @backstage/config@0.0.0-nightly-
|
|
12
|
-
- @backstage/plugin-techdocs-node@0.0.0-nightly-
|
|
11
|
+
- @backstage/config@0.0.0-nightly-20250107023211
|
|
12
|
+
- @backstage/plugin-techdocs-node@0.0.0-nightly-20250107023211
|
|
13
13
|
|
|
14
14
|
## 1.8.25-next.0
|
|
15
15
|
|
|
@@ -2675,6 +2675,53 @@
|
|
|
2675
2675
|
},
|
|
2676
2676
|
"packageName": "@backstage/plugin-auth-backend-module-auth0-provider"
|
|
2677
2677
|
},
|
|
2678
|
+
{
|
|
2679
|
+
"path": "../../plugins/auth-backend-module-bitbucket-server-provider/config.d.ts",
|
|
2680
|
+
"value": {
|
|
2681
|
+
"type": "object",
|
|
2682
|
+
"properties": {
|
|
2683
|
+
"auth": {
|
|
2684
|
+
"type": "object",
|
|
2685
|
+
"properties": {
|
|
2686
|
+
"providers": {
|
|
2687
|
+
"type": "object",
|
|
2688
|
+
"properties": {
|
|
2689
|
+
"bitbucketServer": {
|
|
2690
|
+
"visibility": "frontend",
|
|
2691
|
+
"type": "object",
|
|
2692
|
+
"additionalProperties": {
|
|
2693
|
+
"type": "object",
|
|
2694
|
+
"properties": {
|
|
2695
|
+
"clientId": {
|
|
2696
|
+
"type": "string"
|
|
2697
|
+
},
|
|
2698
|
+
"clientSecret": {
|
|
2699
|
+
"visibility": "secret",
|
|
2700
|
+
"type": "string"
|
|
2701
|
+
},
|
|
2702
|
+
"host": {
|
|
2703
|
+
"type": "string"
|
|
2704
|
+
},
|
|
2705
|
+
"callbackUrl": {
|
|
2706
|
+
"type": "string"
|
|
2707
|
+
}
|
|
2708
|
+
},
|
|
2709
|
+
"required": [
|
|
2710
|
+
"clientId",
|
|
2711
|
+
"clientSecret",
|
|
2712
|
+
"host"
|
|
2713
|
+
]
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2718
|
+
}
|
|
2719
|
+
}
|
|
2720
|
+
},
|
|
2721
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
2722
|
+
},
|
|
2723
|
+
"packageName": "@backstage/plugin-auth-backend-module-bitbucket-server-provider"
|
|
2724
|
+
},
|
|
2678
2725
|
{
|
|
2679
2726
|
"path": "../../plugins/auth-backend-module-bitbucket-provider/config.d.ts",
|
|
2680
2727
|
"value": {
|
|
@@ -2786,54 +2833,7 @@
|
|
|
2786
2833
|
"packageName": "@backstage/plugin-auth-backend-module-bitbucket-provider"
|
|
2787
2834
|
},
|
|
2788
2835
|
{
|
|
2789
|
-
"path": "../../plugins/auth-backend-module-
|
|
2790
|
-
"value": {
|
|
2791
|
-
"type": "object",
|
|
2792
|
-
"properties": {
|
|
2793
|
-
"auth": {
|
|
2794
|
-
"type": "object",
|
|
2795
|
-
"properties": {
|
|
2796
|
-
"providers": {
|
|
2797
|
-
"type": "object",
|
|
2798
|
-
"properties": {
|
|
2799
|
-
"bitbucketServer": {
|
|
2800
|
-
"visibility": "frontend",
|
|
2801
|
-
"type": "object",
|
|
2802
|
-
"additionalProperties": {
|
|
2803
|
-
"type": "object",
|
|
2804
|
-
"properties": {
|
|
2805
|
-
"clientId": {
|
|
2806
|
-
"type": "string"
|
|
2807
|
-
},
|
|
2808
|
-
"clientSecret": {
|
|
2809
|
-
"visibility": "secret",
|
|
2810
|
-
"type": "string"
|
|
2811
|
-
},
|
|
2812
|
-
"host": {
|
|
2813
|
-
"type": "string"
|
|
2814
|
-
},
|
|
2815
|
-
"callbackUrl": {
|
|
2816
|
-
"type": "string"
|
|
2817
|
-
}
|
|
2818
|
-
},
|
|
2819
|
-
"required": [
|
|
2820
|
-
"clientId",
|
|
2821
|
-
"clientSecret",
|
|
2822
|
-
"host"
|
|
2823
|
-
]
|
|
2824
|
-
}
|
|
2825
|
-
}
|
|
2826
|
-
}
|
|
2827
|
-
}
|
|
2828
|
-
}
|
|
2829
|
-
}
|
|
2830
|
-
},
|
|
2831
|
-
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
2832
|
-
},
|
|
2833
|
-
"packageName": "@backstage/plugin-auth-backend-module-bitbucket-server-provider"
|
|
2834
|
-
},
|
|
2835
|
-
{
|
|
2836
|
-
"path": "../../plugins/auth-backend-module-cloudflare-access-provider/config.d.ts",
|
|
2836
|
+
"path": "../../plugins/auth-backend-module-gcp-iap-provider/config.d.ts",
|
|
2837
2837
|
"value": {
|
|
2838
2838
|
"type": "object",
|
|
2839
2839
|
"properties": {
|
|
@@ -2843,36 +2843,16 @@
|
|
|
2843
2843
|
"providers": {
|
|
2844
2844
|
"type": "object",
|
|
2845
2845
|
"properties": {
|
|
2846
|
-
"
|
|
2847
|
-
"
|
|
2846
|
+
"gcpIap": {
|
|
2847
|
+
"description": "Configuration for the Google Cloud Platform Identity-Aware Proxy (IAP) auth provider.",
|
|
2848
2848
|
"type": "object",
|
|
2849
2849
|
"properties": {
|
|
2850
|
-
"
|
|
2851
|
-
"
|
|
2852
|
-
},
|
|
2853
|
-
"serviceTokens": {
|
|
2854
|
-
"deepVisibility": "secret",
|
|
2855
|
-
"type": "array",
|
|
2856
|
-
"items": {
|
|
2857
|
-
"type": "object",
|
|
2858
|
-
"properties": {
|
|
2859
|
-
"token": {
|
|
2860
|
-
"type": "string"
|
|
2861
|
-
},
|
|
2862
|
-
"subject": {
|
|
2863
|
-
"type": "string"
|
|
2864
|
-
}
|
|
2865
|
-
},
|
|
2866
|
-
"required": [
|
|
2867
|
-
"subject",
|
|
2868
|
-
"token"
|
|
2869
|
-
]
|
|
2870
|
-
}
|
|
2871
|
-
},
|
|
2872
|
-
"jwtHeaderName": {
|
|
2850
|
+
"audience": {
|
|
2851
|
+
"description": "The audience to use when validating incoming JWT tokens.\nSee https://backstage.io/docs/auth/google/gcp-iap-auth",
|
|
2873
2852
|
"type": "string"
|
|
2874
2853
|
},
|
|
2875
|
-
"
|
|
2854
|
+
"jwtHeader": {
|
|
2855
|
+
"description": "The name of the header to read the JWT token from, defaults to `'x-goog-iap-jwt-assertion'`.",
|
|
2876
2856
|
"type": "string"
|
|
2877
2857
|
},
|
|
2878
2858
|
"signIn": {
|
|
@@ -2882,6 +2862,30 @@
|
|
|
2882
2862
|
"type": "array",
|
|
2883
2863
|
"items": {
|
|
2884
2864
|
"anyOf": [
|
|
2865
|
+
{
|
|
2866
|
+
"type": "object",
|
|
2867
|
+
"properties": {
|
|
2868
|
+
"resolver": {
|
|
2869
|
+
"type": "string",
|
|
2870
|
+
"const": "emailMatchingUserEntityAnnotation"
|
|
2871
|
+
}
|
|
2872
|
+
},
|
|
2873
|
+
"required": [
|
|
2874
|
+
"resolver"
|
|
2875
|
+
]
|
|
2876
|
+
},
|
|
2877
|
+
{
|
|
2878
|
+
"type": "object",
|
|
2879
|
+
"properties": {
|
|
2880
|
+
"resolver": {
|
|
2881
|
+
"type": "string",
|
|
2882
|
+
"const": "idMatchingUserEntityAnnotation"
|
|
2883
|
+
}
|
|
2884
|
+
},
|
|
2885
|
+
"required": [
|
|
2886
|
+
"resolver"
|
|
2887
|
+
]
|
|
2888
|
+
},
|
|
2885
2889
|
{
|
|
2886
2890
|
"type": "object",
|
|
2887
2891
|
"properties": {
|
|
@@ -2922,11 +2926,8 @@
|
|
|
2922
2926
|
}
|
|
2923
2927
|
},
|
|
2924
2928
|
"required": [
|
|
2925
|
-
"
|
|
2929
|
+
"audience"
|
|
2926
2930
|
]
|
|
2927
|
-
},
|
|
2928
|
-
"backstageTokenExpiration": {
|
|
2929
|
-
"description": "The backstage token expiration."
|
|
2930
2931
|
}
|
|
2931
2932
|
}
|
|
2932
2933
|
}
|
|
@@ -2935,10 +2936,10 @@
|
|
|
2935
2936
|
},
|
|
2936
2937
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
2937
2938
|
},
|
|
2938
|
-
"packageName": "@backstage/plugin-auth-backend-module-
|
|
2939
|
+
"packageName": "@backstage/plugin-auth-backend-module-gcp-iap-provider"
|
|
2939
2940
|
},
|
|
2940
2941
|
{
|
|
2941
|
-
"path": "../../plugins/auth-backend-module-
|
|
2942
|
+
"path": "../../plugins/auth-backend-module-cloudflare-access-provider/config.d.ts",
|
|
2942
2943
|
"value": {
|
|
2943
2944
|
"type": "object",
|
|
2944
2945
|
"properties": {
|
|
@@ -2948,16 +2949,36 @@
|
|
|
2948
2949
|
"providers": {
|
|
2949
2950
|
"type": "object",
|
|
2950
2951
|
"properties": {
|
|
2951
|
-
"
|
|
2952
|
-
"
|
|
2952
|
+
"cfaccess": {
|
|
2953
|
+
"visibility": "frontend",
|
|
2953
2954
|
"type": "object",
|
|
2954
2955
|
"properties": {
|
|
2955
|
-
"
|
|
2956
|
-
"description": "The audience to use when validating incoming JWT tokens.\nSee https://backstage.io/docs/auth/google/gcp-iap-auth",
|
|
2956
|
+
"teamName": {
|
|
2957
2957
|
"type": "string"
|
|
2958
2958
|
},
|
|
2959
|
-
"
|
|
2960
|
-
"
|
|
2959
|
+
"serviceTokens": {
|
|
2960
|
+
"deepVisibility": "secret",
|
|
2961
|
+
"type": "array",
|
|
2962
|
+
"items": {
|
|
2963
|
+
"type": "object",
|
|
2964
|
+
"properties": {
|
|
2965
|
+
"token": {
|
|
2966
|
+
"type": "string"
|
|
2967
|
+
},
|
|
2968
|
+
"subject": {
|
|
2969
|
+
"type": "string"
|
|
2970
|
+
}
|
|
2971
|
+
},
|
|
2972
|
+
"required": [
|
|
2973
|
+
"subject",
|
|
2974
|
+
"token"
|
|
2975
|
+
]
|
|
2976
|
+
}
|
|
2977
|
+
},
|
|
2978
|
+
"jwtHeaderName": {
|
|
2979
|
+
"type": "string"
|
|
2980
|
+
},
|
|
2981
|
+
"authorizationCookieName": {
|
|
2961
2982
|
"type": "string"
|
|
2962
2983
|
},
|
|
2963
2984
|
"signIn": {
|
|
@@ -2967,30 +2988,6 @@
|
|
|
2967
2988
|
"type": "array",
|
|
2968
2989
|
"items": {
|
|
2969
2990
|
"anyOf": [
|
|
2970
|
-
{
|
|
2971
|
-
"type": "object",
|
|
2972
|
-
"properties": {
|
|
2973
|
-
"resolver": {
|
|
2974
|
-
"type": "string",
|
|
2975
|
-
"const": "emailMatchingUserEntityAnnotation"
|
|
2976
|
-
}
|
|
2977
|
-
},
|
|
2978
|
-
"required": [
|
|
2979
|
-
"resolver"
|
|
2980
|
-
]
|
|
2981
|
-
},
|
|
2982
|
-
{
|
|
2983
|
-
"type": "object",
|
|
2984
|
-
"properties": {
|
|
2985
|
-
"resolver": {
|
|
2986
|
-
"type": "string",
|
|
2987
|
-
"const": "idMatchingUserEntityAnnotation"
|
|
2988
|
-
}
|
|
2989
|
-
},
|
|
2990
|
-
"required": [
|
|
2991
|
-
"resolver"
|
|
2992
|
-
]
|
|
2993
|
-
},
|
|
2994
2991
|
{
|
|
2995
2992
|
"type": "object",
|
|
2996
2993
|
"properties": {
|
|
@@ -3031,8 +3028,11 @@
|
|
|
3031
3028
|
}
|
|
3032
3029
|
},
|
|
3033
3030
|
"required": [
|
|
3034
|
-
"
|
|
3031
|
+
"teamName"
|
|
3035
3032
|
]
|
|
3033
|
+
},
|
|
3034
|
+
"backstageTokenExpiration": {
|
|
3035
|
+
"description": "The backstage token expiration."
|
|
3036
3036
|
}
|
|
3037
3037
|
}
|
|
3038
3038
|
}
|
|
@@ -3041,7 +3041,7 @@
|
|
|
3041
3041
|
},
|
|
3042
3042
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
3043
3043
|
},
|
|
3044
|
-
"packageName": "@backstage/plugin-auth-backend-module-
|
|
3044
|
+
"packageName": "@backstage/plugin-auth-backend-module-cloudflare-access-provider"
|
|
3045
3045
|
},
|
|
3046
3046
|
{
|
|
3047
3047
|
"path": "../../plugins/auth-backend-module-github-provider/config.d.ts",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open source framework for building developer portals"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><meta name="backstage-app-mode" content="public"><script defer="defer" src="/static/runtime.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open source framework for building developer portals"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><meta name="backstage-app-mode" content="public"><script defer="defer" src="/static/runtime.449eb67c.js"></script><script defer="defer" src="/static/module-material-ui.909829ed.js"></script><script defer="defer" src="/static/module-lodash.aa647045.js"></script><script defer="defer" src="/static/module-date-fns.c633d602.js"></script><script defer="defer" src="/static/module-mui.f702282a.js"></script><script defer="defer" src="/static/module-material-table.84f30b2f.js"></script><script defer="defer" src="/static/module-react-dom.42a304d3.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.b474cfe9.js"></script><script defer="defer" src="/static/module-zod.4f2eeb8c.js"></script><script defer="defer" src="/static/module-i18next.f50c1612.js"></script><script defer="defer" src="/static/module-remix-run.ba6397c2.js"></script><script defer="defer" src="/static/vendor.449eb67c.js"></script><script defer="defer" src="/static/main.449eb67c.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
color="#5bbad5"
|
|
43
43
|
/>
|
|
44
44
|
<title><%= config.getString('app.title') %></title>
|
|
45
|
-
<meta name="backstage-app-mode" content="public"><meta name="backstage-public-path" content="<%= publicPath %>/"><script defer src="<%= publicPath %>/static/runtime.
|
|
45
|
+
<meta name="backstage-app-mode" content="public"><meta name="backstage-public-path" content="<%= publicPath %>/"><script defer src="<%= publicPath %>/static/runtime.449eb67c.js"></script><script defer src="<%= publicPath %>/static/module-material-ui.909829ed.js"></script><script defer src="<%= publicPath %>/static/module-lodash.aa647045.js"></script><script defer src="<%= publicPath %>/static/module-date-fns.c633d602.js"></script><script defer src="<%= publicPath %>/static/module-mui.f702282a.js"></script><script defer src="<%= publicPath %>/static/module-material-table.84f30b2f.js"></script><script defer src="<%= publicPath %>/static/module-react-dom.42a304d3.js"></script><script defer src="<%= publicPath %>/static/module-react-beautiful-dnd.b474cfe9.js"></script><script defer src="<%= publicPath %>/static/module-zod.4f2eeb8c.js"></script><script defer src="<%= publicPath %>/static/module-i18next.f50c1612.js"></script><script defer src="<%= publicPath %>/static/module-remix-run.ba6397c2.js"></script><script defer src="<%= publicPath %>/static/vendor.449eb67c.js"></script><script defer src="<%= publicPath %>/static/main.449eb67c.js"></script></head>
|
|
46
46
|
<body>
|
|
47
47
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
48
48
|
<div id="root"></div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[5788,8803],{70048:($,f,t)=>{t.d(f,{K:()=>l});var e=t(18690);function l(x){return(0,e.g)()}},99538:($,f,t)=>{t.d(f,{T7:()=>j,TY:()=>I,tN:()=>p});var e=t(31085),l=t(6820),x=t(25862),y=t(43836),g=t(10602),O=t(14041);const T=(0,y.tK)("entity-context"),j=u=>{const{children:v,entity:R,loading:P,error:C,refresh:A}=u,S={entity:R,loading:P,error:C,refresh:A};return(0,e.jsx)(T.Provider,{value:(0,g.B)({1:S}),children:(0,e.jsx)(x.Ig,{attributes:{...R?{entityRef:(0,l.U2)(R)}:void 0},children:v})})},L=u=>_jsx(j,{entity:u.entity,loading:!u.entity,error:void 0,refresh:void 0,children:u.children});function p(){const u=(0,y.qO)("entity-context");if(!u)throw new Error("Entity context is not available");const v=u.atVersion(1);if(!v)throw new Error("EntityContext v1 not available");if(!v.entity)throw new Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:v.entity}}function I(){const u=(0,y.qO)("entity-context");if(!u)throw new Error("Entity context is not available");const v=u.atVersion(1);if(!v)throw new Error("EntityContext v1 not available");const{entity:R,loading:P,error:C,refresh:A}=v;return{entity:R,loading:P,error:C,refresh:A}}},38803:($,f,t)=>{t.r(f),t.d(f,{EmbeddedDocsRouter:()=>z,LegacyEmbeddedDocsRouter:()=>D,Router:()=>G,isTechDocsAvailable:()=>V});var e=t(31085),l=t(14041),x=t(18690),y=t(6820),g=t(86202),O=t(39278),T=t(67289),j=t(39299),L=t(9222),p=t(82779);const I=n=>n.replace(/^\/+/,""),u=n=>n.replace(/\/+$/,"");function v(n){const{kind:o,name:a,namespace:r}=n,s=(0,L.S)(p.Oc),h=(0,L.S)(p.Ri);return(0,l.useMemo)(()=>{const i=u(s({kind:o,namespace:r,name:a})),c=u(h());return d=>{if(d.toLocaleLowerCase("en-US").startsWith(i.toLocaleLowerCase("en-US"))){const m=I(d.slice(i.length));return m.length===0||m.startsWith("#")?`${c}${m}`:`${c}/${m}`}return d}},[s,h,o,a,r])}const R=({entity:n,withSearch:o=!0})=>{let a=(0,y.sM)(n);const r=v(a);if(n.metadata.annotations?.[g.G])try{a=(0,y.KU)(n.metadata.annotations?.[g.G])}catch{}return(0,e.jsxs)(O.Wj,{entityRef:a,children:[(0,e.jsx)(j.Z,{}),(0,e.jsx)(T.p,{withSearch:o,searchResultUrlMapper:r})]})};var P=t(85788),C=t(93160),A=t(99538),S=t(10394),N=t(64947),F=t(58837),H=t(72501),Y=t(44186),U=t(77310),K=t(72072);const B=(0,F.A)(n=>({code:{borderRadius:6,margin:n.spacing(2,0),background:n.palette.type==="dark"?"#444":n.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function W(n,o){const a=o?.kind||"Component",r=o?.metadata.name||"example",s=o?.spec?.type||"website",h=o?.spec?.owner||"user:default/guest",E=`apiVersion: backstage.io/v1alpha1
|
|
2
|
+
kind: ${a}
|
|
3
|
+
metadata:
|
|
4
|
+
name: ${r}
|
|
5
|
+
annotations:${n.map(d=>`
|
|
6
|
+
${d}: value`).join("")}
|
|
7
|
+
spec:
|
|
8
|
+
type: ${s}
|
|
9
|
+
owner: ${h}`;let i=6;const c=[];return n.forEach(()=>{c.push(i),i++}),{yamlText:E,lineNumbers:c}}function Z(n,o="Component"){const a=n.length<=1;return(0,e.jsxs)(e.Fragment,{children:["The ",a?"annotation":"annotations"," ",n.map(r=>(0,e.jsx)("code",{children:r})).reduce((r,s)=>(0,e.jsxs)(e.Fragment,{children:[r,", ",s]}))," ",a?"is":"are"," missing. You need to add the"," ",a?"annotation":"annotations"," to your ",o," if you want to enable this tool."]})}function J(n){let o;try{o=(0,A.tN)().entity}catch{}const{annotation:a,readMoreUrl:r}=n,s=Array.isArray(a)?a:[a],h=r||"https://backstage.io/docs/features/software-catalog/well-known-annotations",E=B(),i=o?.kind||"Component",{yamlText:c,lineNumbers:d}=W(s,o);return(0,e.jsx)(Y.p,{missing:"field",title:"Missing Annotation",description:Z(s,i),action:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(H.A,{variant:"body1",children:["Add the annotation to your ",i," YAML as shown in the highlighted example below:"]}),(0,e.jsx)(S.A,{className:E.code,children:(0,e.jsx)(U.z,{text:c,language:"yaml",showLineNumbers:!0,highlightedNumbers:d,customStyle:{background:"inherit",fontSize:"115%"}})}),(0,e.jsx)(N.A,{color:"primary",component:K.N_,to:h,children:"Read more"})]})})}const V=n=>!!n?.metadata?.annotations?.[g.A]||!!n?.metadata?.annotations?.[g.G],G=()=>(0,e.jsxs)(x.BV,{children:[(0,e.jsx)(x.qh,{path:"/",element:(0,e.jsx)(P.TechDocsIndexPage,{})}),(0,e.jsx)(x.qh,{path:"/:namespace/:kind/:name/*",element:(0,e.jsx)(C.W,{})})]}),z=n=>{const{children:o,emptyState:a,withSearch:r=!0}=n,{entity:s}=(0,A.tN)(),h=(0,x.Ye)([{path:"/*",element:(0,e.jsx)(R,{entity:s,withSearch:r}),children:[{path:"*",element:o}]}]);return s.metadata.annotations?.[g.A]||s.metadata.annotations?.[g.G]?h:a??(0,e.jsx)(J,{annotation:[g.A]})},D=({children:n,withSearch:o=!0})=>(0,e.jsx)(z,{children:n,withSearch:o})},85788:($,f,t)=>{t.r(f),t.d(f,{TechDocsIndexPage:()=>g});var e=t(31085),l=t(14041),x=t(18690),y=t(8915);const g=O=>(0,x.P1)()||(0,e.jsx)(y.K,{...O})},93160:($,f,t)=>{t.d(f,{b:()=>G,W:()=>z});var e=t(31085),l=t(14041),x=t(18690),y=t(24504),g=t(72020),O=t(86892),T=t(67289),j=t(45061),L=t(39299),p=t(82779),I=t(70048),u=t(19402),v=t(22020),R=t(82266),P=t(64947),C=t(72427),A=t(70795),S=t(57405),N=t(16261);function F(D,n){const[o,a]=(0,l.useState)({status:"not-executed",error:void 0,result:n}),r=(0,l.useRef)(),s=(0,l.useRef)(),h=(0,N.J)({execute(...E){s.current=E;const i=D(...E);return r.current=i,a(c=>({...c,status:"loading"})),i.then(c=>{i===r.current&&a(d=>({...d,status:"success",error:void 0,result:c}))},c=>{i===r.current&&a(d=>({...d,status:"error",error:c}))}),i},reset(){a({status:"not-executed",error:void 0,result:n}),r.current=void 0,s.current=void 0}});return[o,(0,l.useMemo)(()=>({reset(){h.current.reset()},execute:(...E)=>h.current.execute(...E)}),[]),{promise:r.current,lastArgs:s.current}]}var H=t(76842),Y=t(70835);const U="/.backstage/auth/v1/cookie",K=365*24*36e5;function B(D){const{pluginId:n}=D??{},o=(0,C.gf)(A.a),a=(0,C.gf)(S.I),r=(0,l.useMemo)(()=>"BroadcastChannel"in window?new BroadcastChannel(`${n}-auth-cookie-expires-at`):null,[n]),[s,h]=F(async()=>{const d=`${await a.getBaseUrl(n)}${U}`,m=await o.fetch(`${d}`,{credentials:"include"});if(!m.ok){if(m.status===404)return{expiresAt:new Date(Date.now()+K)};throw await Y.o.fromResponse(m)}const M=await m.json();if(!M.expiresAt)throw new Error("No expiration date found in response");return M});(0,H.u)(h.execute);const E=(0,l.useCallback)(()=>{h.execute()},[h]),i=(0,l.useCallback)(c=>{const d=(1+3*Math.random())*6e4,m=Date.parse(c.expiresAt)-Date.now()-d,M=setTimeout(E,m);return()=>clearTimeout(M)},[E]);return(0,l.useEffect)(()=>{if(s.status!=="success"||!s.result)return()=>{};r?.postMessage({action:"COOKIE_REFRESH_SUCCESS",payload:s.result});let c=i(s.result);const d=m=>{const{action:M,payload:Q}=m.data;M==="COOKIE_REFRESH_SUCCESS"&&(c(),c=i(Q))};return r?.addEventListener("message",d),()=>{c(),r?.removeEventListener("message",d)}},[s,i,r]),s.status==="not-executed"?{status:"loading"}:s.status==="loading"&&!s.result?{status:"loading"}:s.status==="loading"&&s.error?{status:"loading"}:s.status==="error"&&s.error?{status:"error",error:s.error,retry:E}:{status:"success",data:s.result}}function W(D){const{children:n,...o}=D,a=(0,R.n)(),{Progress:r}=a.getComponents(),s=B(o);return s.status==="loading"?(0,e.jsx)(r,{}):s.status==="error"?(0,e.jsx)(v.b,{error:s.error,children:(0,e.jsx)(P.A,{variant:"outlined",onClick:s.retry,children:"Retry"})}):(0,e.jsx)(e.Fragment,{children:n})}var Z=t(54917),J=t(98392),V=t(50868);const G=D=>{const{withSearch:n,withHeader:o=!0}=D;return(0,e.jsxs)(y.Y,{themeId:"documentation",children:[o&&(0,e.jsx)(j.T,{}),(0,e.jsx)(L.Z,{}),(0,e.jsx)(T.p,{withSearch:n})]})},z=D=>{const n=(0,Z.A)(),o=(0,J.A)({...n,...D.overrideThemeOptions||{}}),{kind:a,name:r,namespace:s}=(0,I.K)(p.Oc),{children:h,entityRef:E={kind:a,name:r,namespace:s}}=D,i=(0,x.P1)();if(!h){const m=(i?l.Children.toArray(i.props.children):[]).flatMap(M=>M?.props?.children??[]).find(M=>!(0,u.E)(M,g.AF)&&!(0,u.E)(M,g.Wm));return(0,e.jsx)(V.A,{theme:o,children:(0,e.jsx)(W,{pluginId:"techdocs",children:(0,e.jsx)(O.R,{entityRef:E,children:m||(0,e.jsx)(G,{})})})})}return(0,e.jsx)(V.A,{theme:o,children:(0,e.jsx)(W,{pluginId:"techdocs",children:(0,e.jsx)(O.R,{entityRef:E,children:({metadata:c,entityMetadata:d,onReady:m})=>(0,e.jsx)("div",{className:"techdocs-reader-page",children:(0,e.jsx)(y.Y,{themeId:"documentation",children:h instanceof Function?h({entityRef:E,techdocsMetadataValue:c.value,entityMetadataValue:d.value,onReady:m}):h})})})})})}},39299:($,f,t)=>{t.d(f,{Z:()=>R});var e=t(31085),l=t(14041),x=t(58837),y=t(29365),g=t(75173),O=t(71677),T=t(37757),j=t(10394),L=t(9684),p=t(86892),I=t(72020),u=t(99730);const v=(0,x.A)(P=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:P.spacing(3,3,0),"@media print":{display:"none"}}})),R=P=>{const C=v(),[A,S]=(0,l.useState)(null),N=(0,l.useCallback)(W=>{S(W.currentTarget)},[]),F=(0,l.useCallback)(()=>{S(null)},[]),{entityMetadata:{value:H,loading:Y}}=(0,p.V)(),U=(0,I.YR)(),K=U.renderComponentsByLocation(u.e.Subheader),B=U.renderComponentsByLocation(u.e.Settings);return!K&&!B||Y===!1&&!H?null:(0,e.jsx)(g.A,{classes:C,...P.toolbarProps,children:(0,e.jsxs)(j.A,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[K,B?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(O.Ay,{title:"Settings",children:(0,e.jsx)(y.A,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:N,children:(0,e.jsx)(L.A,{})})}),(0,e.jsx)(T.A,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:A,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:!!A,onClose:F,keepMounted:!0,children:(0,e.jsx)("div",{children:B})})]}):null]})})}}}]);})();
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=8803.20e0d00b.chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static/8803.20e0d00b.chunk.js","mappings":"kLAwBO,SAASA,EACdC,EAAiD,CAEjD,SAAOC,EAAAA,GAAU,CACnB,C,2HCOA,MAAMC,KAAmBC,EAAAA,IACvB,gBAAgB,EAqBLC,EAAuBC,GAAAA,CAClC,KAAM,CAAEC,SAAAA,EAAUC,OAAAA,EAAQC,QAAAA,EAASC,MAAAA,EAAOC,QAAAA,CAAQ,EAAIL,EAChDM,EAAQ,CAAEJ,OAAAA,EAAQC,QAAAA,EAASC,MAAAA,EAAOC,QAAAA,CAAQ,EAGhD,SACE,OAACR,EAAiBU,SAAQ,CAACD,SAAOE,EAAAA,GAAwB,CAAE,EAAGF,CAAM,CAAC,E,YACpE,OAACG,EAAAA,GAAgBA,CACfC,WAAY,CACV,GAAIR,EAAS,CAAES,aAAWC,EAAAA,IAAmBV,CAAM,CAAE,EAAIW,MAC3D,E,SAECZ,C,IAIT,EAiBaa,EAAkBd,GAC7B,KAACD,EAAAA,CACCG,OAAQF,EAAME,OACdC,QAAS,CAASH,EAAME,OACxBE,MAAOS,OACPR,QAASQ,OACTZ,SAAUD,EAAMC,Q,GAUb,SAASc,GAAAA,CAGd,MAAMC,KAAkBC,EAAAA,IACtB,gBAAgB,EAGlB,GAAI,CAACD,EACH,MAAM,IAAIE,MAAM,iCAAiC,EAGnD,MAAMZ,EAAQU,EAAgBG,UAAU,CAAC,EACzC,GAAI,CAACb,EACH,MAAM,IAAIY,MAAM,gCAAgC,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GAAG,iCACHC,mBAAoB,KACpB5B,SAAUA,EACV6B,aAAc,CAAEC,SAAU,SAAUC,WAAY,OAAQ,EACxDC,KAAMnJ,EAAQmH,EACdiC,QAAS5B,EACT6B,YAAW,G,YAEX,OAAC5C,MAAAA,C,SAAKwB,C,QAGR,I,KAIZ,C","sources":["webpack://techdocs-cli-embedded-app/../core-plugin-api/src/routing/useRouteRefParams.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/hooks/useEntity.tsx","webpack://techdocs-cli-embedded-app/../../plugins/techdocs/src/search/hooks/useTechDocsLocation.ts","webpack://techdocs-cli-embedded-app/../../plugins/techdocs/src/EntityPageDocs.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/MissingAnnotationEmptyState/MissingAnnotationEmptyState.tsx","webpack://techdocs-cli-embedded-app/../../plugins/techdocs/src/Router.tsx","webpack://techdocs-cli-embedded-app/../../plugins/techdocs/src/home/components/TechDocsIndexPage.tsx","webpack://techdocs-cli-embedded-app/../../node_modules/@react-hookz/web/src/useAsync/index.js","webpack://techdocs-cli-embedded-app/../../plugins/auth-react/src/hooks/useCookieAuthRefresh/useCookieAuthRefresh.tsx","webpack://techdocs-cli-embedded-app/../../plugins/auth-react/src/components/CookieAuthRefreshProvider/CookieAuthRefreshProvider.tsx","webpack://techdocs-cli-embedded-app/../../plugins/techdocs/src/reader/components/TechDocsReaderPage/TechDocsReaderPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/techdocs/src/reader/components/TechDocsReaderPageSubheader/TechDocsReaderPageSubheader.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useParams } from 'react-router-dom';\nimport { RouteRef, AnyParams, SubRouteRef } from './types';\n\n/**\n * React hook for retrieving dynamic params from the current URL.\n * @param _routeRef - Ref of the current route.\n * @public\n */\nexport function useRouteRefParams<Params extends AnyParams>(\n _routeRef: RouteRef<Params> | SubRouteRef<Params>,\n): Params {\n return useParams() as Params;\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { AnalyticsContext } from '@backstage/core-plugin-api';\nimport {\n createVersionedContext,\n createVersionedValueMap,\n useVersionedContext,\n} from '@backstage/version-bridge';\nimport React, { ReactNode } from 'react';\n\n/** @public */\nexport type EntityLoadingStatus<TEntity extends Entity = Entity> = {\n entity?: TEntity;\n loading: boolean;\n error?: Error;\n refresh?: VoidFunction;\n};\n\n// This context has support for multiple concurrent versions of this package.\n// It is currently used in parallel with the old context in order to provide\n// a smooth transition, but will eventually be the only context we use.\nconst NewEntityContext = createVersionedContext<{ 1: EntityLoadingStatus }>(\n 'entity-context',\n);\n\n/**\n * Properties for the AsyncEntityProvider component.\n *\n * @public\n */\nexport interface AsyncEntityProviderProps {\n children: ReactNode;\n entity?: Entity;\n loading: boolean;\n error?: Error;\n refresh?: VoidFunction;\n}\n\n/**\n * Provides a loaded entity to be picked up by the `useEntity` hook.\n *\n * @public\n */\nexport const AsyncEntityProvider = (props: AsyncEntityProviderProps) => {\n const { children, entity, loading, error, refresh } = props;\n const value = { entity, loading, error, refresh };\n // We provide both the old and the new context, since\n // consumers might be doing things like `useContext(EntityContext)`\n return (\n <NewEntityContext.Provider value={createVersionedValueMap({ 1: value })}>\n <AnalyticsContext\n attributes={{\n ...(entity ? { entityRef: stringifyEntityRef(entity) } : undefined),\n }}\n >\n {children}\n </AnalyticsContext>\n </NewEntityContext.Provider>\n );\n};\n\n/**\n * Properties for the EntityProvider component.\n *\n * @public\n */\nexport interface EntityProviderProps {\n children: ReactNode;\n entity?: Entity;\n}\n\n/**\n * Provides an entity to be picked up by the `useEntity` hook.\n *\n * @public\n */\nexport const EntityProvider = (props: EntityProviderProps) => (\n <AsyncEntityProvider\n entity={props.entity}\n loading={!Boolean(props.entity)}\n error={undefined}\n refresh={undefined}\n children={props.children}\n />\n);\n\n/**\n * Grab the current entity from the context, throws if the entity has not yet been loaded\n * or is not available.\n *\n * @public\n */\nexport function useEntity<TEntity extends Entity = Entity>(): {\n entity: TEntity;\n} {\n const versionedHolder = useVersionedContext<{ 1: EntityLoadingStatus }>(\n 'entity-context',\n );\n\n if (!versionedHolder) {\n throw new Error('Entity context is not available');\n }\n\n const value = versionedHolder.atVersion(1);\n if (!value) {\n throw new Error('EntityContext v1 not available');\n }\n\n if (!value.entity) {\n throw new Error(\n 'useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.',\n );\n }\n\n return { entity: value.entity as TEntity };\n}\n\n/**\n * Grab the current entity from the context, provides loading state and errors, and the ability to refresh.\n *\n * @public\n */\nexport function useAsyncEntity<\n TEntity extends Entity = Entity,\n>(): EntityLoadingStatus<TEntity> {\n const versionedHolder = useVersionedContext<{ 1: EntityLoadingStatus }>(\n 'entity-context',\n );\n\n if (!versionedHolder) {\n throw new Error('Entity context is not available');\n }\n const value = versionedHolder.atVersion(1);\n if (!value) {\n throw new Error('EntityContext v1 not available');\n }\n\n const { entity, loading, error, refresh } = value;\n return { entity: entity as TEntity, loading, error, refresh };\n}\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useMemo } from 'react';\n\nimport { CompoundEntityRef } from '@backstage/catalog-model';\nimport { useRouteRef } from '@backstage/core-plugin-api';\n\nimport { rootCatalogDocsRouteRef, rootDocsRouteRef } from '../../routes';\n\nconst trimStartSlash = (path: string) => path.replace(/^\\/+/, '');\nconst trimEndSlash = (path: string) => path.replace(/\\/+$/, '');\n\n/**\n * Returns a function that takes a location to a Tech Docs entry, and returns a\n * new location, re-routed to the catalog page tab.\n *\n * @internal\n */\nexport function useEntityPageTechDocsRedirect(entityRef: CompoundEntityRef) {\n const { kind, name, namespace } = entityRef;\n\n const routeDocsRoot = useRouteRef(rootDocsRouteRef);\n const routeDocsCatalog = useRouteRef(rootCatalogDocsRouteRef);\n\n // Re-routes a /docs/:namespace/:kind/:name/* location into\n // /catalog/:namespace/:kind/:name/docs/*, while handling situations where\n // these defaults are changed.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const reRouteLocationToCatalog = useMemo(() => {\n const rootDocsPath = trimEndSlash(routeDocsRoot({ kind, namespace, name }));\n const catalogDocsPath = trimEndSlash(routeDocsCatalog());\n\n return (url: string): string => {\n if (\n url\n .toLocaleLowerCase('en-US')\n .startsWith(rootDocsPath.toLocaleLowerCase('en-US'))\n ) {\n const suffix = trimStartSlash(url.slice(rootDocsPath.length));\n return suffix.length === 0 || suffix.startsWith('#')\n ? `${catalogDocsPath}${suffix}`\n : `${catalogDocsPath}/${suffix}`;\n }\n return url;\n };\n }, [routeDocsRoot, routeDocsCatalog, kind, name, namespace]);\n\n return reRouteLocationToCatalog;\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n getCompoundEntityRef,\n parseEntityRef,\n} from '@backstage/catalog-model';\nimport { TECHDOCS_EXTERNAL_ANNOTATION } from '@backstage/plugin-techdocs-common';\n\nimport React from 'react';\nimport { TechDocsReaderPage } from './plugin';\nimport { TechDocsReaderPageContent } from './reader/components/TechDocsReaderPageContent';\nimport { TechDocsReaderPageSubheader } from './reader/components/TechDocsReaderPageSubheader';\nimport { useEntityPageTechDocsRedirect } from './search/hooks/useTechDocsLocation';\n\ntype EntityPageDocsProps = {\n entity: Entity;\n /**\n * Show or hide the content search bar, defaults to true.\n */\n withSearch?: boolean;\n};\n\nexport const EntityPageDocs = ({\n entity,\n withSearch = true,\n}: EntityPageDocsProps) => {\n let entityRef = getCompoundEntityRef(entity);\n\n const searchResultUrlMapper = useEntityPageTechDocsRedirect(entityRef);\n\n if (entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION]) {\n try {\n entityRef = parseEntityRef(\n entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION],\n );\n } catch {\n // not a fan of this but we don't care if the parseEntityRef fails\n }\n }\n\n return (\n <TechDocsReaderPage entityRef={entityRef}>\n <TechDocsReaderPageSubheader />\n <TechDocsReaderPageContent\n withSearch={withSearch}\n searchResultUrlMapper={searchResultUrlMapper}\n />\n </TechDocsReaderPage>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport React from 'react';\nimport { CodeSnippet, Link, EmptyState } from '@backstage/core-components';\nimport { Entity } from '@backstage/catalog-model';\nimport { useEntity } from '../../hooks';\n\n/** @public */\nexport type MissingAnnotationEmptyStateClassKey = 'code';\n\nconst useStyles = makeStyles(\n theme => ({\n code: {\n borderRadius: 6,\n margin: theme.spacing(2, 0),\n background:\n theme.palette.type === 'dark' ? '#444' : theme.palette.common.white,\n },\n }),\n { name: 'BackstageMissingAnnotationEmptyState' },\n);\n\nfunction generateYamlExample(\n annotations: string[],\n entity?: Entity,\n): { yamlText: string; lineNumbers: number[] } {\n const kind = entity?.kind || 'Component';\n const name = entity?.metadata.name || 'example';\n const type = entity?.spec?.type || 'website';\n const owner = entity?.spec?.owner || 'user:default/guest';\n\n const yamlText = `apiVersion: backstage.io/v1alpha1\nkind: ${kind}\nmetadata:\n name: ${name}\n annotations:${annotations.map(ann => `\\n ${ann}: value`).join('')}\nspec:\n type: ${type}\n owner: ${owner}`;\n\n let line = 6; // Line 6 is the line number that annotations are added to.\n const lineNumbers: number[] = [];\n annotations.forEach(() => {\n lineNumbers.push(line);\n line++;\n });\n\n return {\n yamlText,\n lineNumbers,\n };\n}\n\nfunction generateDescription(annotations: string[], entityKind = 'Component') {\n const isSingular = annotations.length <= 1;\n return (\n <>\n The {isSingular ? 'annotation' : 'annotations'}{' '}\n {annotations\n .map(ann => <code>{ann}</code>)\n .reduce((prev, curr) => (\n <>\n {prev}, {curr}\n </>\n ))}{' '}\n {isSingular ? 'is' : 'are'} missing. You need to add the{' '}\n {isSingular ? 'annotation' : 'annotations'} to your {entityKind} if you\n want to enable this tool.\n </>\n );\n}\n\n/**\n * @public\n * Renders an empty state when an annotation is missing from an entity.\n */\nexport function MissingAnnotationEmptyState(props: {\n annotation: string | string[];\n readMoreUrl?: string;\n}) {\n let entity: Entity | undefined;\n try {\n const entityContext = useEntity();\n entity = entityContext.entity;\n } catch (err) {\n // ignore when entity context doesnt exist\n }\n\n const { annotation, readMoreUrl } = props;\n const annotations = Array.isArray(annotation) ? annotation : [annotation];\n const url =\n readMoreUrl ||\n 'https://backstage.io/docs/features/software-catalog/well-known-annotations';\n const classes = useStyles();\n\n const entityKind = entity?.kind || 'Component';\n const { yamlText, lineNumbers } = generateYamlExample(annotations, entity);\n return (\n <EmptyState\n missing=\"field\"\n title=\"Missing Annotation\"\n description={generateDescription(annotations, entityKind)}\n action={\n <>\n <Typography variant=\"body1\">\n Add the annotation to your {entityKind} YAML as shown in the\n highlighted example below:\n </Typography>\n <Box className={classes.code}>\n <CodeSnippet\n text={yamlText}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={lineNumbers}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </Box>\n <Button color=\"primary\" component={Link} to={url}>\n Read more\n </Button>\n </>\n }\n />\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { PropsWithChildren } from 'react';\nimport { Route, Routes, useRoutes } from 'react-router-dom';\n\nimport { Entity } from '@backstage/catalog-model';\nimport { EntityPageDocs } from './EntityPageDocs';\nimport { TechDocsIndexPage } from './home/components/TechDocsIndexPage';\nimport { TechDocsReaderPage } from './reader/components/TechDocsReaderPage';\nimport {\n useEntity,\n MissingAnnotationEmptyState,\n} from '@backstage/plugin-catalog-react';\nimport {\n TECHDOCS_ANNOTATION,\n TECHDOCS_EXTERNAL_ANNOTATION,\n} from '@backstage/plugin-techdocs-common';\n\n/**\n * Helper that takes in entity and returns true/false if TechDocs is available for the entity\n *\n * @public\n */\nexport const isTechDocsAvailable = (entity: Entity) =>\n Boolean(entity?.metadata?.annotations?.[TECHDOCS_ANNOTATION]) ||\n Boolean(entity?.metadata?.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION]);\n\n/**\n * Responsible for registering routes for TechDocs, TechDocs Homepage and separate TechDocs page\n *\n * @public\n */\nexport const Router = () => {\n return (\n <Routes>\n <Route path=\"/\" element={<TechDocsIndexPage />} />\n <Route\n path=\"/:namespace/:kind/:name/*\"\n element={<TechDocsReaderPage />}\n />\n </Routes>\n );\n};\n\nexport const EmbeddedDocsRouter = (\n props: PropsWithChildren<{\n emptyState?: React.ReactElement;\n withSearch?: boolean;\n }>,\n) => {\n const { children, emptyState, withSearch = true } = props;\n const { entity } = useEntity();\n\n // Using objects instead of <Route> elements, otherwise \"outlet\" will be null on sub-pages and add-ons won't render\n const element = useRoutes([\n {\n path: '/*',\n element: <EntityPageDocs entity={entity} withSearch={withSearch} />,\n children: [\n {\n path: '*',\n element: children,\n },\n ],\n },\n ]);\n\n const projectId =\n entity.metadata.annotations?.[TECHDOCS_ANNOTATION] ||\n entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION];\n\n if (!projectId) {\n return (\n emptyState ?? (\n <MissingAnnotationEmptyState annotation={[TECHDOCS_ANNOTATION]} />\n )\n );\n }\n\n return element;\n};\n\n/**\n * Responsible for registering route to view docs on Entity page\n *\n * @public\n */\nexport const LegacyEmbeddedDocsRouter = ({\n children,\n withSearch = true,\n}: PropsWithChildren<{ withSearch?: boolean }>) => {\n // Wrap the Router to avoid exposing the emptyState prop in the non-alpha\n // public API and make it easier for us to change later.\n return <EmbeddedDocsRouter children={children} withSearch={withSearch} />;\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { useOutlet } from 'react-router-dom';\nimport { TableColumn, TableProps } from '@backstage/core-components';\nimport {\n EntityListPagination,\n EntityOwnerPickerProps,\n UserListFilterKind,\n} from '@backstage/plugin-catalog-react';\nimport { DefaultTechDocsHome } from './DefaultTechDocsHome';\nimport { DocsTableRow } from './Tables';\n\n/**\n * Props for {@link TechDocsIndexPage}\n *\n * @public\n */\nexport type TechDocsIndexPageProps = {\n initialFilter?: UserListFilterKind;\n columns?: TableColumn<DocsTableRow>[];\n actions?: TableProps<DocsTableRow>['actions'];\n ownerPickerMode?: EntityOwnerPickerProps['mode'];\n pagination?: EntityListPagination;\n};\n\nexport const TechDocsIndexPage = (props: TechDocsIndexPageProps) => {\n const outlet = useOutlet();\n\n return outlet || <DefaultTechDocsHome {...props} />;\n};\n","import { useMemo, useRef, useState } from 'react';\nimport { useSyncedRef } from '../useSyncedRef/index.js';\nexport function useAsync(asyncFn, initialValue) {\n const [state, setState] = useState({\n status: 'not-executed',\n error: undefined,\n result: initialValue,\n });\n const promiseRef = useRef();\n const argsRef = useRef();\n const methods = useSyncedRef({\n execute(...params) {\n argsRef.current = params;\n const promise = asyncFn(...params);\n promiseRef.current = promise;\n setState((s) => ({ ...s, status: 'loading' }));\n promise.then((result) => {\n if (promise === promiseRef.current) {\n setState((s) => ({ ...s, status: 'success', error: undefined, result }));\n }\n }, (error) => {\n if (promise === promiseRef.current) {\n setState((s) => ({ ...s, status: 'error', error }));\n }\n });\n return promise;\n },\n reset() {\n setState({\n status: 'not-executed',\n error: undefined,\n result: initialValue,\n });\n promiseRef.current = undefined;\n argsRef.current = undefined;\n },\n });\n return [\n state,\n useMemo(() => ({\n reset() {\n methods.current.reset();\n },\n execute: (...params) => methods.current.execute(...params),\n }), []),\n { promise: promiseRef.current, lastArgs: argsRef.current },\n ];\n}\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEffect, useCallback, useMemo } from 'react';\nimport {\n discoveryApiRef,\n fetchApiRef,\n useApi,\n} from '@backstage/core-plugin-api';\nimport { useAsync, useMountEffect } from '@react-hookz/web';\nimport { ResponseError } from '@backstage/errors';\n\nconst COOKIE_PATH = '/.backstage/auth/v1/cookie';\nconst ONE_YEAR_MS = 365 * 24 * 3600_000;\n\n/**\n * @public\n * A hook that will refresh the cookie when it is about to expire.\n * @param options - Options for configuring the refresh cookie endpoint\n */\nexport function useCookieAuthRefresh(options: {\n // The plugin id used for discovering the API origin\n pluginId: string;\n}):\n | { status: 'loading' }\n | { status: 'error'; error: Error; retry: () => void }\n | { status: 'success'; data: { expiresAt: string } } {\n const { pluginId } = options ?? {};\n const fetchApi = useApi(fetchApiRef);\n const discoveryApi = useApi(discoveryApiRef);\n\n const channel = useMemo(() => {\n return 'BroadcastChannel' in window\n ? new BroadcastChannel(`${pluginId}-auth-cookie-expires-at`)\n : null;\n }, [pluginId]);\n\n const [state, actions] = useAsync<{ expiresAt: string }>(async () => {\n const apiOrigin = await discoveryApi.getBaseUrl(pluginId);\n const requestUrl = `${apiOrigin}${COOKIE_PATH}`;\n const response = await fetchApi.fetch(`${requestUrl}`, {\n credentials: 'include',\n });\n if (!response.ok) {\n // If we get a 404 from the cookie endpoint we assume that it does not\n // exist and cookie auth is not needed. For all active tabs we don't\n // schedule another refresh for the forseeable future, but new tabs will\n // still check if cookie auth has been added to the deployment.\n // TODO(Rugvip): Once the legacy backend system is no longer supported we should remove this check\n if (response.status === 404) {\n return { expiresAt: new Date(Date.now() + ONE_YEAR_MS) };\n }\n throw await ResponseError.fromResponse(response);\n }\n const data = await response.json();\n if (!data.expiresAt) {\n throw new Error('No expiration date found in response');\n }\n return data;\n });\n\n useMountEffect(actions.execute);\n\n const retry = useCallback(() => {\n actions.execute();\n }, [actions]);\n\n const refresh = useCallback(\n (params: { expiresAt: string }) => {\n // Randomize the refreshing margin with a margin of 1-4 minutes to avoid all tabs refreshing at the same time\n // It cannot be less than 5 minutes otherwise the backend will return the same expiration date\n const margin = (1 + 3 * Math.random()) * 60000;\n const delay = Date.parse(params.expiresAt) - Date.now() - margin;\n const timeout = setTimeout(retry, delay);\n return () => clearTimeout(timeout);\n },\n [retry],\n );\n\n useEffect(() => {\n // Only schedule a refresh if we have a successful response\n if (state.status !== 'success' || !state.result) {\n return () => {};\n }\n channel?.postMessage({\n action: 'COOKIE_REFRESH_SUCCESS',\n payload: state.result,\n });\n let cancel = refresh(state.result);\n const listener = (\n event: MessageEvent<{ action: string; payload: { expiresAt: string } }>,\n ) => {\n const { action, payload } = event.data;\n if (action === 'COOKIE_REFRESH_SUCCESS') {\n cancel();\n cancel = refresh(payload);\n }\n };\n channel?.addEventListener('message', listener);\n return () => {\n cancel();\n channel?.removeEventListener('message', listener);\n };\n }, [state, refresh, channel]);\n\n // Initialising\n if (state.status === 'not-executed') {\n return { status: 'loading' };\n }\n\n // First refresh or retrying without any success before\n // Possible state transitions:\n // e.g. not-executed -> loading (first-refresh)\n // e.g. not-executed -> loading (first-refresh) -> error -> loading (manual-retry)\n if (state.status === 'loading' && !state.result) {\n return { status: 'loading' };\n }\n\n // Retrying after having succeeding at least once\n // Current state is: { status: 'loading', result: {...}, error: undefined | Error }\n // e.g. not-executed -> loading (first-refresh) -> success -> loading (scheduled-refresh) -> error -> loading (manual-retry)\n if (state.status === 'loading' && state.error) {\n return { status: 'loading' };\n }\n\n // Something went wrong during any situation of a refresh\n if (state.status === 'error' && state.error) {\n return { status: 'error', error: state.error, retry };\n }\n\n // At this point it should be safe to assume that we have a successful refresh\n return { status: 'success', data: state.result! };\n}\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ReactNode } from 'react';\nimport { ErrorPanel } from '@backstage/core-components';\nimport { useApp } from '@backstage/core-plugin-api';\nimport Button from '@material-ui/core/Button';\nimport { useCookieAuthRefresh } from '../../hooks';\n\n/**\n * @public\n * Props for the {@link CookieAuthRefreshProvider} component.\n */\nexport type CookieAuthRefreshProviderProps = {\n // The plugin ID used for discovering the API origin\n pluginId: string;\n // The children to render when the refresh is successful\n children: ReactNode;\n};\n\n/**\n * @public\n * A provider that will refresh the cookie when it is about to expire.\n */\nexport function CookieAuthRefreshProvider(\n props: CookieAuthRefreshProviderProps,\n): JSX.Element {\n const { children, ...options } = props;\n const app = useApp();\n const { Progress } = app.getComponents();\n\n const result = useCookieAuthRefresh(options);\n\n if (result.status === 'loading') {\n return <Progress />;\n }\n\n if (result.status === 'error') {\n return (\n <ErrorPanel error={result.error}>\n <Button variant=\"outlined\" onClick={result.retry}>\n Retry\n </Button>\n </ErrorPanel>\n );\n }\n\n return <>{children}</>;\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ReactNode, Children, ReactElement } from 'react';\nimport { useOutlet } from 'react-router-dom';\n\nimport { Page } from '@backstage/core-components';\nimport { CompoundEntityRef } from '@backstage/catalog-model';\nimport {\n TECHDOCS_ADDONS_WRAPPER_KEY,\n TECHDOCS_ADDONS_KEY,\n TechDocsReaderPageProvider,\n} from '@backstage/plugin-techdocs-react';\n\nimport { TechDocsReaderPageRenderFunction } from '../../../types';\n\nimport { TechDocsReaderPageContent } from '../TechDocsReaderPageContent';\nimport { TechDocsReaderPageHeader } from '../TechDocsReaderPageHeader';\nimport { TechDocsReaderPageSubheader } from '../TechDocsReaderPageSubheader';\nimport { rootDocsRouteRef } from '../../../routes';\nimport {\n getComponentData,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\n\nimport { CookieAuthRefreshProvider } from '@backstage/plugin-auth-react';\nimport { ThemeOptions } from '@material-ui/core/styles';\nimport { createTheme, ThemeProvider, useTheme } from '@material-ui/core/styles';\n\n/* An explanation for the multiple ways of customizing the TechDocs reader page\n\nPlease refer to this page on the microsite for the latest recommended approach:\nhttps://backstage.io/docs/features/techdocs/how-to-guides#how-to-customize-the-techdocs-reader-page\n\nThe <TechDocsReaderPage> component is responsible for rendering the <TechDocsReaderPageProvider> and\nits contained version of a <Page>, which in turn renders the <TechDocsReaderPageContent>.\n\nHistorically, there have been different approaches on how this <Page> can be customized, and how the\n<TechDocsReaderPageContent> inside could be exchanged for a custom implementation (which was not\npossible before). Also, the current implementation supports every scenario to avoid breaking default\nconfigurations of TechDocs.\n\nIn particular, there are 4 different TechDocs page configurations:\n\nCONFIGURATION 1: <TechDocsReaderPage> only, no children\n\n<Route path=\"/docs/:namespace/:kind/:name/*\" element={<TechDocsReaderPage />} >\n\nThis is the simplest way to use TechDocs. Only a full page is passed, assuming that it comes with\nits content inside. Since we allowed customizing it, we started providing <TechDocsReaderLayout> as\na default implementation (which contains <TechDocsReaderPageContent>).\n\nCONFIGURATION 2 (not advised): <TechDocsReaderPage> with element children\n\n<Route\n path=\"/docs/:namespace/:kind/:name/*\"\n element={\n <TechDocsReaderPage>\n {techdocsPage}\n </TechDocsReaderPage>\n }\n/>\n\nPreviously, there were two ways of passing children to <TechDocsReaderPage>: either as elements (as\nshown above), or as a render function (described below in CONFIGURATION 3). The \"techdocsPage\" is\nlocated in packages/app/src/components/techdocs and is the default implementation of the content\ninside.\n\nCONFIGURATION 3 (not advised): <TechDocsReaderPage> with render function as child\n\n<Route\n path=\"/docs/:namespace/:kind/:name/*\"\n element={\n <TechDocsReaderPage>\n {({ metadata, entityMetadata, onReady }) => (\n techdocsPage\n )}\n </TechDocsReaderPage>\n }\n/>\n\nSimilar to CONFIGURATION 2, the direct children will be passed to the <TechDocsReaderPage> but in\nthis case interpreted as render prop.\n\nCONFIGURATION 4: <TechDocsReaderPage> and provided content in <Route>\n\n<Route\n path=\"/docs/:namespace/:kind/:name/*\"\n element={<TechDocsReaderPage />}\n>\n {techDocsPage}\n <TechDocsAddons>\n <ExpandableNavigation />\n <ReportIssue />\n <TextSize />\n <LightBox />\n </TechDocsAddons>\n</Route>\n\nThis is the current state in packages/app/src/App.tsx and moved the location of children from inside\nthe element prop in the <Route> to the children of the <Route>. Then, in <TechDocsReaderPage> they\nare retrieved using the useOutlet hook from React Router.\n\nNOTE: Render functions are no longer supported in this approach.\n*/\n\n/**\n * Props for {@link TechDocsReaderLayout}\n * @public\n */\nexport type TechDocsReaderLayoutProps = {\n /**\n * Show or hide the header, defaults to true.\n */\n withHeader?: boolean;\n /**\n * Show or hide the content search bar, defaults to true.\n */\n withSearch?: boolean;\n};\n\n/**\n * Default TechDocs reader page structure composed with a header and content\n * @public\n */\nexport const TechDocsReaderLayout = (props: TechDocsReaderLayoutProps) => {\n const { withSearch, withHeader = true } = props;\n return (\n <Page themeId=\"documentation\">\n {withHeader && <TechDocsReaderPageHeader />}\n <TechDocsReaderPageSubheader />\n <TechDocsReaderPageContent withSearch={withSearch} />\n </Page>\n );\n};\n\n/**\n * @public\n */\nexport type TechDocsReaderPageProps = {\n entityRef?: CompoundEntityRef;\n children?: TechDocsReaderPageRenderFunction | ReactNode;\n overrideThemeOptions?: Partial<ThemeOptions>;\n};\n\n/**\n * An addon-aware implementation of the TechDocsReaderPage.\n *\n * @public\n */\nexport const TechDocsReaderPage = (props: TechDocsReaderPageProps) => {\n const currentTheme = useTheme();\n\n const readerPageTheme = createTheme({\n ...currentTheme,\n ...(props.overrideThemeOptions || {}),\n });\n const { kind, name, namespace } = useRouteRefParams(rootDocsRouteRef);\n const { children, entityRef = { kind, name, namespace } } = props;\n\n const outlet = useOutlet();\n\n if (!children) {\n const childrenList = outlet ? Children.toArray(outlet.props.children) : [];\n\n const grandChildren = childrenList.flatMap<ReactElement>(\n child => (child as ReactElement)?.props?.children ?? [],\n );\n\n const page: React.ReactNode = grandChildren.find(\n grandChild =>\n !getComponentData(grandChild, TECHDOCS_ADDONS_WRAPPER_KEY) &&\n !getComponentData(grandChild, TECHDOCS_ADDONS_KEY),\n );\n\n // As explained above, \"page\" is configuration 4 and <TechDocsReaderLayout> is 1\n return (\n <ThemeProvider theme={readerPageTheme}>\n <CookieAuthRefreshProvider pluginId=\"techdocs\">\n <TechDocsReaderPageProvider entityRef={entityRef}>\n {(page as JSX.Element) || <TechDocsReaderLayout />}\n </TechDocsReaderPageProvider>\n </CookieAuthRefreshProvider>\n </ThemeProvider>\n );\n }\n\n // As explained above, a render function is configuration 3 and React element is 2\n return (\n <ThemeProvider theme={readerPageTheme}>\n <CookieAuthRefreshProvider pluginId=\"techdocs\">\n <TechDocsReaderPageProvider entityRef={entityRef}>\n {({ metadata, entityMetadata, onReady }) => (\n <div className=\"techdocs-reader-page\">\n <Page themeId=\"documentation\">\n {children instanceof Function\n ? children({\n entityRef,\n techdocsMetadataValue: metadata.value,\n entityMetadataValue: entityMetadata.value,\n onReady,\n })\n : children}\n </Page>\n </div>\n )}\n </TechDocsReaderPageProvider>\n </CookieAuthRefreshProvider>\n </ThemeProvider>\n );\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { MouseEvent, useState, useCallback } from 'react';\n\nimport { makeStyles } from '@material-ui/core/styles';\nimport IconButton from '@material-ui/core/IconButton';\nimport Toolbar from '@material-ui/core/Toolbar';\nimport { ToolbarProps } from '@material-ui/core/Toolbar';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Menu from '@material-ui/core/Menu';\nimport Box from '@material-ui/core/Box';\nimport SettingsIcon from '@material-ui/icons/Settings';\n\nimport {\n TechDocsAddonLocations as locations,\n useTechDocsAddons,\n useTechDocsReaderPage,\n} from '@backstage/plugin-techdocs-react';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n gridArea: 'pageSubheader',\n flexDirection: 'column',\n minHeight: 'auto',\n padding: theme.spacing(3, 3, 0),\n '@media print': {\n display: 'none',\n },\n },\n}));\n\n/**\n * Renders the reader page subheader.\n * Please use the Tech Docs add-ons to customize it\n * @public\n */\nexport const TechDocsReaderPageSubheader = (props: {\n toolbarProps?: ToolbarProps;\n}) => {\n const classes = useStyles();\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n\n const handleClick = useCallback((event: MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n }, []);\n\n const handleClose = useCallback(() => {\n setAnchorEl(null);\n }, []);\n\n const {\n entityMetadata: { value: entityMetadata, loading: entityMetadataLoading },\n } = useTechDocsReaderPage();\n\n const addons = useTechDocsAddons();\n\n const subheaderAddons = addons.renderComponentsByLocation(\n locations.Subheader,\n );\n\n const settingsAddons = addons.renderComponentsByLocation(locations.Settings);\n\n if (!subheaderAddons && !settingsAddons) return null;\n\n // No entity metadata = 404. Don't render subheader on 404.\n if (entityMetadataLoading === false && !entityMetadata) return null;\n\n return (\n <Toolbar classes={classes} {...props.toolbarProps}>\n <Box\n display=\"flex\"\n justifyContent=\"flex-end\"\n width=\"100%\"\n flexWrap=\"wrap\"\n >\n {subheaderAddons}\n {settingsAddons ? (\n <>\n <Tooltip title=\"Settings\">\n <IconButton\n aria-controls=\"tech-docs-reader-page-settings\"\n aria-haspopup=\"true\"\n onClick={handleClick}\n >\n <SettingsIcon />\n </IconButton>\n </Tooltip>\n <Menu\n id=\"tech-docs-reader-page-settings\"\n getContentAnchorEl={null}\n anchorEl={anchorEl}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}\n open={Boolean(anchorEl)}\n onClose={handleClose}\n keepMounted\n >\n <div>{settingsAddons}</div>\n </Menu>\n </>\n ) : null}\n </Box>\n </Toolbar>\n );\n};\n"],"names":["useRouteRefParams","_routeRef","useParams","NewEntityContext","createVersionedContext","AsyncEntityProvider","props","children","entity","loading","error","refresh","value","Provider","createVersionedValueMap","AnalyticsContext","attributes","entityRef","stringifyEntityRef","undefined","EntityProvider","useEntity","versionedHolder","useVersionedContext","Error","atVersion","useAsyncEntity","trimStartSlash","path","replace","trimEndSlash","useEntityPageTechDocsRedirect","kind","name","namespace","routeDocsRoot","useRouteRef","rootDocsRouteRef","routeDocsCatalog","rootCatalogDocsRouteRef","useMemo","rootDocsPath","catalogDocsPath","url","toLocaleLowerCase","startsWith","suffix","slice","length","EntityPageDocs","withSearch","getCompoundEntityRef","searchResultUrlMapper","metadata","annotations","TECHDOCS_EXTERNAL_ANNOTATION","parseEntityRef","TechDocsReaderPage","TechDocsReaderPageSubheader","TechDocsReaderPageContent","useStyles","makeStyles","theme","code","borderRadius","margin","spacing","background","palette","type","common","white","generateYamlExample","spec","owner","yamlText","map","ann","join","line","lineNumbers","forEach","push","generateDescription","entityKind","isSingular","reduce","prev","curr","MissingAnnotationEmptyState","annotation","readMoreUrl","Array","isArray","classes","EmptyState","missing","title","description","action","Typography","variant","Box","className","CodeSnippet","text","language","showLineNumbers","highlightedNumbers","customStyle","fontSize","Button","color","component","Link","to","isTechDocsAvailable","Boolean","TECHDOCS_ANNOTATION","Router","Routes","Route","element","TechDocsIndexPage","EmbeddedDocsRouter","emptyState","useRoutes","LegacyEmbeddedDocsRouter","useOutlet","DefaultTechDocsHome","useAsync","asyncFn","initialValue","state","setState","promiseRef","argsRef","methods","useSyncedRef","params","promise","s","result","COOKIE_PATH","ONE_YEAR_MS","useCookieAuthRefresh","options","pluginId","fetchApi","useApi","fetchApiRef","discoveryApi","discoveryApiRef","channel","window","BroadcastChannel","actions","requestUrl","getBaseUrl","response","fetch","credentials","ok","status","expiresAt","Date","now","ResponseError","fromResponse","data","json","useMountEffect","execute","retry","useCallback","Math","random","delay","parse","timeout","setTimeout","clearTimeout","useEffect","postMessage","payload","cancel","listener","event","addEventListener","removeEventListener","CookieAuthRefreshProvider","app","useApp","Progress","getComponents","ErrorPanel","onClick","TechDocsReaderLayout","withHeader","Page","themeId","TechDocsReaderPageHeader","currentTheme","useTheme","readerPageTheme","createTheme","overrideThemeOptions","outlet","page","Children","toArray","flatMap","child","find","grandChild","getComponentData","TECHDOCS_ADDONS_WRAPPER_KEY","TECHDOCS_ADDONS_KEY","ThemeProvider","TechDocsReaderPageProvider","entityMetadata","onReady","div","Function","techdocsMetadataValue","entityMetadataValue","root","gridArea","flexDirection","minHeight","padding","display","anchorEl","setAnchorEl","useState","handleClick","currentTarget","handleClose","entityMetadataLoading","useTechDocsReaderPage","addons","useTechDocsAddons","subheaderAddons","renderComponentsByLocation","locations","Subheader","settingsAddons","Settings","Toolbar","toolbarProps","justifyContent","width","flexWrap","Tooltip","IconButton","aria-controls","aria-haspopup","SettingsIcon","Menu","id","getContentAnchorEl","anchorOrigin","vertical","horizontal","open","onClose","keepMounted"],"sourceRoot":""}
|
|
@@ -550,4 +550,4 @@ ${U.href}
|
|
|
550
550
|
|
|
551
551
|
Feedback:`),Rt=W?.type==="github"?(0,hs.F)($.href,"blob"):$.href,$t=Fn()(Rt),Mt=`/${$t.organization}/${$t.name}`,Ut=U.cloneNode();switch(W?.type){case"gitlab":Ut.href=`${$.origin}${Mt}/issues/new?issue[title]=${ot}&issue[description]=${Ct}`;break;case"github":Ut.href=`${$.origin}${Mt}/issues/new?title=${ot}&body=${Ct}`;break;default:return D}return pn(a.createElement(gs.A),Ut),Ut.style.paddingLeft="5px",Ut.title="Leave feedback for this page",Ut.id="git-feedback-link",U?.insertAdjacentElement("beforebegin",Ut),D};var bn=t(38097);const Sn=(0,x.A)(f=>({button:{color:f.palette.primary.light,textDecoration:"underline"}})),fs=({message:f,handleButtonClick:D,autoHideDuration:U})=>{const $=Sn(),[W,Z]=(0,a.useState)(!0),ot=()=>Z(!1);return(0,n.jsx)(bn.A,{open:W,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:U,color:"primary",onClose:ot,message:f,action:(0,n.jsx)(tt.A,{classes:{root:$.button},size:"small",onClick:()=>{ot(),D()},children:"Redirect now"})})},Nn=(f,D)=>{const $=W=>{const Z=jn(window.location.href),ot=new URL(W,Z);if(ot.hostname!==window.location.hostname){const Rt=window.location.pathname,$t=Rt.indexOf(D),Mt=Rt.slice(0,$t+D.length);return new URL(Mt,Z).href}return ot.href};return W=>{for(const Z of Array.from(W.querySelectorAll("meta")))if(Z.getAttribute("http-equiv")==="refresh"){const ot=Z.getAttribute("content")?.split("url=");if(!ot||ot.length<2)return W;const Ct=ot[1],Rt=$(Ct);if(window.location.href===Rt)return W;const $t=document.createElement("div");return pn((0,n.jsx)(fs,{message:"This TechDocs page is no longer maintained. Will automatically redirect to the designated replacement.",handleButtonClick:()=>f(Rt),autoHideDuration:3e3}),$t),document.body.appendChild($t),setTimeout(()=>{f(Rt)},3e3),W}return W}},kn=()=>f=>(setTimeout(()=>{const D=f?.querySelectorAll("li.md-nav__item--active");D.length!==0&&(D.forEach($=>{const W=$?.querySelector("input");W?.checked||W?.click()}),D[D.length-1].scrollIntoView())},200),f);var ms=t(50868),vs=t(10437),ys=t(71677),Es=t(87051),As=t(36338);const xs=(0,Es.A)(f=>({tooltip:{fontSize:"inherit",color:f.palette.text.primary,margin:0,padding:f.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(ys.Ay),Cs=()=>(0,n.jsx)(vs.A,{children:(0,n.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),bs=({text:f})=>{const[D,U]=(0,a.useState)(!1),[,$]=(0,As.A)(),W=(0,a.useCallback)(()=>{$(f),U(!0)},[f,$]),Z=(0,a.useCallback)(()=>{U(!1)},[U]);return(0,n.jsx)(xs,{title:"Copied to clipboard",placement:"left",open:D,onClose:Z,leaveDelay:1e3,children:(0,n.jsx)(It.A,{style:{color:"inherit",position:"absolute"},className:"md-clipboard md-icon",onClick:W,children:(0,n.jsx)(Cs,{})})})},Ss=f=>D=>{const U=D.querySelectorAll("pre > code");for(const $ of U){const W=$.textContent||"",Z=document.createElement("div");$?.parentElement?.prepend(Z),pn((0,n.jsx)(ms.A,{theme:f,children:(0,n.jsx)(bs,{text:W})}),Z)}return D},Os=({baseUrl:f,onClick:D})=>U=>(Array.from(U.getElementsByTagName("a")).forEach($=>{$.addEventListener("click",W=>{const ot=$.getAttribute("href");ot&&ot.startsWith(f)&&!$.hasAttribute("download")&&(W.preventDefault(),D(W,ot))})}),U),Wn=({onLoading:f,onLoaded:D})=>U=>(f(),U.addEventListener(p,function $(){D(),U.removeEventListener(p,$)}),U);function Ps(f,D){const U=new URL(D),$=`${U.origin}${U.pathname.replace(/\/$/,"")}`,W=f.replace($,"").replace(/^\/+/,""),Z=new URL(`http://localhost/${W}`);return`${Z.pathname}${Z.search}${Z.hash}`}function Kn(){const f=(0,a.useRef)((0,jt.Zp)()),U=(0,dt.gf)(G.U).getOptionalString("app.baseUrl");return(0,a.useCallback)(W=>{let Z=W;if(U)try{Z=Ps(W,U)}catch{}f.current(Z)},[U])}const zn="screen and (max-width: 76.1875em)",Ts=f=>{const D=Kn(),U=(0,Ve.A)(),$=(0,He.A)(zn),W=Ie(),Z=as(),ot=(0,X.s)(),Ct=(0,dt.gf)(_e.s),Rt=(0,dt.gf)(Ue.Y),{state:$t,path:Mt,content:Ut}=Be(),{"*":Jt=""}=(0,jt.g)(),[Gt,le]=(0,a.useState)(null),Yt=A(Gt),ce=(0,a.useCallback)(()=>{if(!Gt)return;Gt.querySelectorAll(".md-sidebar").forEach(te=>{if($)te.style.top="0px";else{const Pe=document?.querySelector(".techdocs-reader-page")?.getBoundingClientRect().top??0;let De=Gt.getBoundingClientRect().top??0;const cn=Gt.querySelector(".md-container > .md-tabs")?.getBoundingClientRect().height??0;De<Pe&&(De=Pe);const Ye=Math.max(De,0)+cn;te.style.top=`${Ye}px`;const ln=Gt.querySelector(".md-container > .md-footer")?.getBoundingClientRect().top??window.innerHeight;te.style.height=`${ln-Ye}px`}te.style.setProperty("opacity","1")})},[Gt,$]);(0,a.useEffect)(()=>(window.addEventListener("resize",ce),window.addEventListener("scroll",ce,!0),()=>{window.removeEventListener("resize",ce),window.removeEventListener("scroll",ce,!0)}),[Gt,ce]);const he=(0,a.useCallback)(()=>{if(!Gt)return;const Zt=Gt.querySelector(".md-footer");Zt&&(Zt.style.width=`${Gt.getBoundingClientRect().width}px`)},[Gt]);(0,a.useEffect)(()=>(window.addEventListener("resize",he),()=>{window.removeEventListener("resize",he)}),[Gt,he]),(0,a.useEffect)(()=>{Yt||(he(),ce())},[$t,Yt,he,ce]);const qt=(0,a.useCallback)((Zt,te)=>Cn(Zt,[W,Mn({techdocsStorageApi:Ct,entityId:f,path:te}),cs(),ds(),us(),Un(),ps(Rt),Z]),[f,Rt,Ct,W,Z]),Qt=(0,a.useCallback)(async Zt=>Cn(Zt,[Nn(D,f.name),kn(),Ss(U),Os({baseUrl:window.location.origin,onClick:(te,re)=>{const Pe=te.ctrlKey||te.metaKey,De=new URL(re),en=te.target?.innerText||re,cn=re.replace(window.location.origin,"");ot.captureEvent("click",en,{attributes:{to:cn}}),De.hash?Pe?window.open(re,"_blank"):(window.location.pathname!==De.pathname?D(re):window.history.pushState(null,document.title,De.hash),Zt?.querySelector(`[id="${De.hash.slice(1)}"]`)?.scrollIntoView()):Pe?window.open(re,"_blank"):D(re)}}),Wn({onLoading:()=>{},onLoaded:()=>{Zt.querySelector(".md-nav__title")?.removeAttribute("for")}}),Wn({onLoading:()=>{Array.from(Zt.querySelectorAll(".md-sidebar")).forEach(re=>{re.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[U,D,ot,f.name]);return(0,a.useEffect)(()=>{if(!Ut)return()=>{};let Zt=!0;return qt(Ut,Mt).then(async te=>{if(!te?.innerHTML||!Zt||Jt!==Mt)return;window.scroll({top:0});const re=await Qt(te);le(re)}),()=>{Zt=!1}},[Ut,Jt,Mt,qt,Qt]),Gt};var On=t(41883),Fe=t(72020),Oe=t(99730);const Ne=()=>{const f=(0,Fe.YR)(),{shadowRoot:D}=(0,m.V)(),U=D?.querySelector('[data-md-component="content"]'),$=D?.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let W=$?.querySelector('[data-techdocs-addons-location="primary sidebar"]');W||(W=document.createElement("div"),W.setAttribute("data-techdocs-addons-location","primary sidebar"),$?.prepend(W));const Z=D?.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let ot=Z?.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return ot||(ot=document.createElement("div"),ot.setAttribute("data-techdocs-addons-location","secondary sidebar"),Z?.prepend(ot)),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(On.A,{container:W,children:f.renderComponentsByLocation(Oe.e.PrimarySidebar)}),(0,n.jsx)(On.A,{container:U,children:f.renderComponentsByLocation(Oe.e.Content)}),(0,n.jsx)(On.A,{container:ot,children:f.renderComponentsByLocation(Oe.e.SecondarySidebar)})]})},ws=(0,x.A)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"},"@media print":{display:"none"}}}),Hn=on(f=>{const{withSearch:D=!0,searchResultUrlMapper:U,onReady:$}=f,W=ws(),{entityMetadata:{value:Z,loading:ot},entityRef:Ct,setShadowRoot:Rt}=(0,m.V)(),{state:$t}=Be(),Mt=Ts(Ct),Ut=window.location.pathname,Jt=window.location.hash,Gt=A(Mt),[le]=R([`[id="${Jt.slice(1)}"]`]);(0,a.useEffect)(()=>{Gt||(Jt?le&&le.scrollIntoView():document?.querySelector("header")?.scrollIntoView())},[Ut,Jt,le,Gt]);const Yt=(0,a.useCallback)(ce=>{Rt(ce),$ instanceof Function&&$()},[Rt,$]);return ot===!1&&!Z?(0,n.jsx)(F.M,{status:"404",statusMessage:"PAGE NOT FOUND"}):Mt?(0,n.jsx)(M.U,{children:(0,n.jsxs)(d.A,{container:!0,children:[(0,n.jsx)(d.A,{xs:12,item:!0,children:(0,n.jsx)(We,{})}),D&&(0,n.jsx)(d.A,{className:W.search,xs:"auto",item:!0,children:(0,n.jsx)(de,{entityId:Ct,entityTitle:Z?.metadata?.title,searchResultUrlMapper:U})}),(0,n.jsxs)(d.A,{xs:12,item:!0,children:[($t==="CHECKING"||Gt)&&(0,n.jsx)(J.k,{}),(0,n.jsx)(y,{element:Mt,onAppend:Yt,children:(0,n.jsx)(Ne,{})})]})]})}):(0,n.jsx)(M.U,{children:(0,n.jsx)(d.A,{container:!0,children:(0,n.jsx)(d.A,{xs:12,item:!0,children:(0,n.jsx)(We,{})})})})}),Rs=null},45061:(H,b,t)=>{"use strict";t.d(b,{T:()=>Q});var n=t(31085),a=t(14041),d=t(93285),x=t(42899),m=t(4387),h=t(13660),u=t(72020),g=t(86892),p=t(99730),v=t(67871),A=t(8859),y=t(34428),P=t(51372),T=t(58837),R=t(268),O=t(72501),j=t(72072);const F=(0,T.A)(G=>({root:{textAlign:"left"},label:{color:G.page.fontColor,fontWeight:G.typography.fontWeightBold,letterSpacing:0,fontSize:G.typography.fontSize,marginBottom:G.spacing(1)/2,lineHeight:1},value:{color:(0,R.X4)(G.page.fontColor,.8),fontSize:G.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),M=({value:G,className:ct,typographyRootComponent:lt})=>(0,n.jsx)(O.A,{component:lt??(typeof G=="string"?"p":"span"),className:ct,children:G});function J(G){const{label:ct,value:lt,url:At,contentTypograpyRootComponent:Pt}=G,Ot=F(),gt=(0,n.jsx)(M,{className:Ot.value,value:lt||"<Unknown>",typographyRootComponent:Pt});return(0,n.jsx)(x.A,{item:!0,children:(0,n.jsxs)(O.A,{component:"span",className:Ot.root,children:[(0,n.jsx)(O.A,{className:Ot.label,children:ct}),At?(0,n.jsx)(j.N_,{to:At,children:gt}):gt]})})}var V=t(69814),k=t(72427),Y=t(65461),q=t(9222),N=t(45250),dt=t(82779);const X=(0,n.jsx)(m.A,{animation:"wave",variant:"text",height:40}),Q=G=>{const{children:ct}=G,lt=(0,u.YR)(),At=(0,k.gf)(Y.U),{title:Pt,setTitle:Ot,subtitle:gt,setSubtitle:ht,entityRef:Et,metadata:{value:mt,loading:St},entityMetadata:{value:bt,loading:Dt}}=(0,g.V)();(0,a.useEffect)(()=>{mt&&(Ot(mt.site_name),ht(()=>{let{site_description:xt}=mt;return(!xt||xt==="None")&&(xt=""),xt}))},[mt,Ot,ht]);const Bt=At.getOptional("app.title")||"Backstage",It=[Pt,gt,Bt].filter(Boolean).join(" | "),{locationMetadata:ut,spec:it}=bt||{},tt=it?.lifecycle,B=bt?(0,v.t)(bt,P.vv):[],K=(0,q.S)(dt.rQ)(),rt=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(J,{label:(0,N.capitalize)(bt?.kind||"entity"),value:(0,n.jsx)(A.z,{color:"inherit",entityRef:Et,title:bt?.metadata.title,defaultKind:"Component"})}),B.length>0&&(0,n.jsx)(J,{label:"Owner",value:(0,n.jsx)(y.i,{color:"inherit",entityRefs:B,defaultKind:"group"})}),tt?(0,n.jsx)(J,{label:"Lifecycle",value:String(tt)}):null,ut&&ut.type!=="dir"&&ut.type!=="file"?(0,n.jsx)(J,{label:"",value:(0,n.jsxs)(x.A,{container:!0,direction:"column",alignItems:"center",children:[(0,n.jsx)(x.A,{style:{padding:0},item:!0,children:(0,n.jsx)(h.A,{style:{marginTop:"-25px"}})}),(0,n.jsx)(x.A,{style:{padding:0},item:!0,children:"Source"})]}),url:ut.target}):null]});return!Dt&&bt===void 0||!St&&mt===void 0?null:(0,n.jsxs)(V.Y,{type:"Documentation",typeLink:K,title:Pt||X,subtitle:gt===""?void 0:gt||X,children:[(0,n.jsx)(d.A,{titleTemplate:"%s",children:(0,n.jsx)("title",{children:It})}),rt,ct,lt.renderComponentsByLocation(p.e.Header)]})}},82779:(H,b,t)=>{"use strict";t.d(b,{Oc:()=>d,Ri:()=>x,rQ:()=>a});var n=t(34569);const a=(0,n.H)({id:"techdocs:index-page"}),d=(0,n.H)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),x=(0,n.H)({id:"techdocs:catalog-reader-view"})},27698:(H,b,t)=>{"use strict";t.r(b),t.d(b,{TechDocsSearchResultListItem:()=>v});var n=t(31085),a=t(14041),d=t(68804),x=t(5951),m=t(58837),h=t(72501),u=t(72072),g=t(70734);const p=(0,m.A)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),v=A=>{const{result:y,highlight:P,lineClamp:T=5,asListItem:R=!0,asLink:O=!0,title:j,icon:F}=A,M=p(),J=({children:Y})=>O?(0,n.jsx)(u.N_,{noTrack:!0,to:y.location,children:Y}):(0,n.jsx)(n.Fragment,{children:Y}),V=()=>{const Y=P?.fields.title?(0,n.jsx)(g.e,{text:P.fields.title,preTag:P.preTag,postTag:P.postTag}):y.title,q=P?.fields.entityTitle?(0,n.jsx)(g.e,{text:P.fields.entityTitle,preTag:P.preTag,postTag:P.postTag}):y.entityTitle,N=P?.fields.name?(0,n.jsx)(g.e,{text:P.fields.name,preTag:P.preTag,postTag:P.postTag}):y.name;return y?(0,n.jsx)(x.A,{className:M.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,n.jsx)(J,{children:j||(0,n.jsxs)(n.Fragment,{children:[Y," | ",q??N," docs"]})}),secondary:(0,n.jsx)(h.A,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:T,overflow:"hidden"},color:"textSecondary",variant:"body2",children:P?.fields.text?(0,n.jsx)(g.e,{text:P.fields.text,preTag:P.preTag,postTag:P.postTag}):y.text})}):null},k=({children:Y})=>R?(0,n.jsxs)(n.Fragment,{children:[F&&(0,n.jsx)(d.A,{children:typeof F=="function"?F(y):F}),(0,n.jsx)("div",{className:M.flexContainer,children:Y})]}):(0,n.jsx)(n.Fragment,{children:Y});return(0,n.jsx)(k,{children:(0,n.jsx)(V,{})})}},97184:(H,b,t)=>{const a=document.querySelector('meta[name="backstage-public-path"]')?.getAttribute("content");a&&(t.p=a)},86973:()=>{}},H=>{var b=n=>H(H.s=n);H.O(0,[1751,1888,5067,1678,235,6587,1975,5042,7400,4538,4121],()=>(b(97184),b(47149)));var t=H.O()}]);})();
|
|
552
552
|
|
|
553
|
-
//# sourceMappingURL=main.
|
|
553
|
+
//# sourceMappingURL=main.449eb67c.js.map
|