@flamingo-stack/openframe-frontend-core 0.0.799 → 0.0.801
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/{chunk-4RK62AMV.cjs → chunk-237MLBT7.cjs} +68 -68
- package/dist/{chunk-IJGIWG6G.cjs → chunk-3W2PBWD5.cjs} +4 -4
- package/dist/{chunk-BSBCZIPQ.cjs → chunk-3YPEXJVQ.cjs} +39 -39
- package/dist/{chunk-GRNTIKPD.cjs → chunk-7E4BC3AF.cjs} +68 -51
- package/dist/{chunk-6CB3AXZM.cjs → chunk-CJSUMYTH.cjs} +30 -30
- package/dist/{chunk-PPORXZI7.cjs → chunk-CRVXQYUZ.cjs} +25 -25
- package/dist/{chunk-FDDM5Z52.cjs → chunk-DYDS2P5G.cjs} +2 -2
- package/dist/{chunk-FIKIPO4F.cjs → chunk-FAUVDMH4.cjs} +1 -1
- package/dist/{chunk-SDV335EO.cjs → chunk-FFRFKWTZ.cjs} +4 -4
- package/dist/{chunk-XJD7IZR2.cjs → chunk-FS4TVAE7.cjs} +48 -48
- package/dist/{chunk-AVAE5B2A.cjs → chunk-KVGWOJCX.cjs} +2 -2
- package/dist/{chunk-HB7FVY46.cjs → chunk-LEEBFBI4.cjs} +32 -32
- package/dist/{chunk-UFCKY7OL.cjs → chunk-LOCJD7TD.cjs} +16 -16
- package/dist/{chunk-6EDOASF4.cjs → chunk-PJMLRXAG.cjs} +11 -11
- package/dist/{chunk-TETW5NR4.cjs → chunk-PY6SPYUR.cjs} +3 -3
- package/dist/{chunk-2KEBGXA4.cjs → chunk-QAUQYQWT.cjs} +4 -4
- package/dist/{chunk-CS2KLF4O.cjs → chunk-QNIUDJAK.cjs} +13 -13
- package/dist/{chunk-B3X4J4HQ.cjs → chunk-SHOE6ATQ.cjs} +14 -14
- package/dist/{chunk-PO5IIN4S.cjs → chunk-THQKEA2T.cjs} +11 -11
- package/dist/{chunk-O6KQ64RI.cjs → chunk-UYGXJ5SQ.cjs} +2 -2
- package/dist/{chunk-3MRK7X6Z.cjs → chunk-XYPNYTCV.cjs} +3 -3
- package/dist/{chunk-ZOK4OWMJ.cjs → chunk-Y5XHMEBB.cjs} +2 -2
- package/dist/{chunk-247LDSQE.cjs → chunk-YUGX72P4.cjs} +61 -61
- package/dist/{chunk-DBRXZC2I.cjs → chunk-Z66FOMSA.cjs} +136 -129
- package/dist/{chunk-T5OCU3EL.cjs → chunk-ZPVFFPQM.cjs} +4 -4
- package/dist/{cloud-tenants-BQAVRN44.cjs → cloud-tenants-X7QHAIX2.cjs} +6 -6
- package/dist/components/case-studies/index.cjs +20 -20
- package/dist/components/chat/chat-context-picker.d.ts.map +1 -1
- package/dist/components/chat/chat-context-picker.js +16 -14
- package/dist/components/chat/index.cjs +5 -5
- package/dist/components/contact/index.cjs +7 -7
- package/dist/components/docs/index.cjs +10 -10
- package/dist/components/embeds/index.cjs +7 -7
- package/dist/components/faq/index.cjs +8 -8
- package/dist/components/features/index.cjs +6 -6
- package/dist/components/help-center-pages/index.cjs +82 -82
- package/dist/components/index.cjs +52 -52
- package/dist/components/layout/page-heading.js +1 -1
- package/dist/components/meeting-scheduler/index.cjs +38 -38
- package/dist/components/navigation/index.cjs +9 -9
- package/dist/components/onboarding-guides/index.cjs +9 -9
- package/dist/components/product-demo/index.cjs +15 -15
- package/dist/components/related-content/index.cjs +5 -5
- package/dist/components/tickets/index.cjs +13 -13
- package/dist/components/ui/fade-preview.d.ts.map +1 -1
- package/dist/components/ui/fade-preview.js +9 -2
- package/dist/components/ui/index.cjs +6 -6
- package/dist/{devices-KDT5ZGSG.cjs → devices-VBFYZVVG.cjs} +7 -7
- package/dist/{embeddable-chat-ODKTSW3C.cjs → embeddable-chat-XZDZOHFY.cjs} +62 -62
- package/dist/index.cjs +10 -10
- package/dist/{knowledge-4NLP77HP.cjs → knowledge-RJZJFD2Y.cjs} +7 -7
- package/dist/loading-standard/engine.d.mts +1 -0
- package/dist/loading-standard/engine.d.mts.map +1 -1
- package/dist/loading-standard/rule-examples.d.mts.map +1 -1
- package/dist/{logs-U6VMTY4N.cjs → logs-3WZ4GROE.cjs} +14 -14
- package/dist/{policies-TBLFBRFM.cjs → policies-E6WQEXDF.cjs} +10 -10
- package/dist/{scripts-ZMNJWX7I.cjs → scripts-JLCM42F4.cjs} +11 -11
- package/dist/{software-update-Q5AEQ4A4.cjs → software-update-BVBHAROC.cjs} +9 -9
- package/dist/utils/index.cjs +16 -1
- package/dist/utils/markdown-to-plain.d.ts.map +1 -1
- package/dist/utils/markdown-to-plain.js +16 -1
- package/package.json +1 -1
- package/src/components/chat/chat-context-picker.tsx +30 -16
- package/src/components/layout/page-heading.tsx +3 -1
- package/src/components/ui/fade-preview.tsx +13 -2
- package/src/loading-standard/engine.mjs +49 -2
- package/src/loading-standard/rule-examples.mjs +35 -3
- package/src/utils/markdown-to-plain.ts +23 -4
|
@@ -8,7 +8,7 @@ var _chunkLHV2R6QUcjs = require('./chunk-LHV2R6QU.cjs');
|
|
|
8
8
|
var _chunkFDZOE5TLcjs = require('./chunk-FDZOE5TL.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkZ66FOMSAcjs = require('./chunk-Z66FOMSA.cjs');
|
|
12
12
|
require('./chunk-DTBIIFZG.cjs');
|
|
13
13
|
require('./chunk-NG3RKTQU.cjs');
|
|
14
14
|
require('./chunk-E56LN23H.cjs');
|
|
@@ -20,10 +20,10 @@ require('./chunk-24I6RFVU.cjs');
|
|
|
20
20
|
require('./chunk-A6P6DHEZ.cjs');
|
|
21
21
|
require('./chunk-MZ4KBSH7.cjs');
|
|
22
22
|
require('./chunk-YR74H7Z3.cjs');
|
|
23
|
-
require('./chunk-
|
|
23
|
+
require('./chunk-CRVXQYUZ.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunk7E4BC3AFcjs = require('./chunk-7E4BC3AF.cjs');
|
|
27
27
|
require('./chunk-7MV23NNT.cjs');
|
|
28
28
|
require('./chunk-ZD6SZLO2.cjs');
|
|
29
29
|
require('./chunk-3NGJ7NPT.cjs');
|
|
@@ -1824,8 +1824,8 @@ require('./chunk-7DNL734S.cjs');
|
|
|
1824
1824
|
require('./chunk-WWUSFOJ7.cjs');
|
|
1825
1825
|
require('./chunk-SKI6NKOE.cjs');
|
|
1826
1826
|
require('./chunk-EWPR7662.cjs');
|
|
1827
|
-
require('./chunk-
|
|
1828
|
-
require('./chunk-
|
|
1827
|
+
require('./chunk-FFRFKWTZ.cjs');
|
|
1828
|
+
require('./chunk-FAUVDMH4.cjs');
|
|
1829
1829
|
require('./chunk-YBTORXFY.cjs');
|
|
1830
1830
|
require('./chunk-2JCY5KQL.cjs');
|
|
1831
1831
|
require('./chunk-P4B6PVSG.cjs');
|
|
@@ -1905,10 +1905,10 @@ function KnowledgeScreen(_props) {
|
|
|
1905
1905
|
const cast = _chunkLHV2R6QUcjs.useProductDemoCast.call(void 0, );
|
|
1906
1906
|
const fixture = _react.useMemo.call(void 0, () => buildKnowledgeFixture(cast), [cast]);
|
|
1907
1907
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full bg-ods-bg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1908
|
-
|
|
1908
|
+
_chunkZ66FOMSAcjs.KnowledgeBaseArticleView,
|
|
1909
1909
|
{
|
|
1910
1910
|
...fixture.article,
|
|
1911
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1911
|
+
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7E4BC3AFcjs.SimpleMarkdownRenderer, { content: fixture.content, textSize: "compact" })
|
|
1912
1912
|
}
|
|
1913
1913
|
) });
|
|
1914
1914
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.mts","sourceRoot":"","sources":["../../src/loading-standard/engine.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"engine.d.mts","sourceRoot":"","sources":["../../src/loading-standard/engine.mjs"],"names":[],"mappings":"AAwKA;;;GAGG;AACH,qDAYC;AAwiDD;;;;;;;GAOG;AACH,wCAHW,OAAO,0DACP;IAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,WAAW;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE;;;;;;IAoB9L;AAmgDD,4DAA4D;AAC5D;;aAIC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAthGG;;;;WAIG;QACH;;iBAUC;;;;;;;;;;;;;;;;;;;;;;;AAwiBL;;;;GAIG;AACH;IACE,kGAAkG;IAClG,4BAwCC;IAvCC,WAA4D;IAC5D,oBAAqB;IACrB,sBAAuB;IAWvB,sBAAuB;IACvB,0BAA2B;IAO3B,wBAA8B;IAI9B,2BAA4B;IAC5B,0BAA2B;IAC3B,gBAA8F;IAC9F,eAIC;IACD,qBAIC;IACD,qBAA6C;IAG/C,qHAAqH;IACrH,2BAIC;IAED,sBAcC;IAwCD,yFAAyF;IACzF,6BAEC;IAgBD,yGAAyG;IACzG,uDAeC;IAED,wGAAwG;IACxG;;;;;;;;aAYC;IAED,mHAAmH;IACnH,kDAYC;IA6CD;;;;OAIG;IACH,0EAyBC;IAqBD,sHAAsH;IACtH,mDA0BC;IAeD,sBAQC;IAPmB,kCAAuB;;CAQ5C;AA34BD,kCAAqC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule-examples.d.mts","sourceRoot":"","sources":["../../src/loading-standard/rule-examples.mjs"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,4BAFU,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"rule-examples.d.mts","sourceRoot":"","sources":["../../src/loading-standard/rule-examples.mjs"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,4BAFU,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAAC,CA4nB1G"}
|
|
@@ -16,7 +16,7 @@ var _chunkFDZOE5TLcjs = require('./chunk-FDZOE5TL.cjs');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkZ66FOMSAcjs = require('./chunk-Z66FOMSA.cjs');
|
|
20
20
|
require('./chunk-DTBIIFZG.cjs');
|
|
21
21
|
require('./chunk-NG3RKTQU.cjs');
|
|
22
22
|
require('./chunk-E56LN23H.cjs');
|
|
@@ -30,8 +30,8 @@ require('./chunk-MZ4KBSH7.cjs');
|
|
|
30
30
|
require('./chunk-YR74H7Z3.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
34
|
-
require('./chunk-
|
|
33
|
+
var _chunkCRVXQYUZcjs = require('./chunk-CRVXQYUZ.cjs');
|
|
34
|
+
require('./chunk-7E4BC3AF.cjs');
|
|
35
35
|
require('./chunk-7MV23NNT.cjs');
|
|
36
36
|
require('./chunk-ZD6SZLO2.cjs');
|
|
37
37
|
require('./chunk-3NGJ7NPT.cjs');
|
|
@@ -1832,8 +1832,8 @@ require('./chunk-7DNL734S.cjs');
|
|
|
1832
1832
|
require('./chunk-WWUSFOJ7.cjs');
|
|
1833
1833
|
require('./chunk-SKI6NKOE.cjs');
|
|
1834
1834
|
require('./chunk-EWPR7662.cjs');
|
|
1835
|
-
require('./chunk-
|
|
1836
|
-
require('./chunk-
|
|
1835
|
+
require('./chunk-FFRFKWTZ.cjs');
|
|
1836
|
+
require('./chunk-FAUVDMH4.cjs');
|
|
1837
1837
|
require('./chunk-YBTORXFY.cjs');
|
|
1838
1838
|
require('./chunk-2JCY5KQL.cjs');
|
|
1839
1839
|
require('./chunk-P4B6PVSG.cjs');
|
|
@@ -1886,7 +1886,7 @@ function entry(logId, minutesAgo, severity, toolType, device2, summary) {
|
|
|
1886
1886
|
id: logId,
|
|
1887
1887
|
logId,
|
|
1888
1888
|
timestamp: displayTime(_chunkFDZOE5TLcjs.demoMinutesAgo.call(void 0, minutesAgo)),
|
|
1889
|
-
status: { label: severity, variant:
|
|
1889
|
+
status: { label: severity, variant: _chunkZ66FOMSAcjs.logSeverityVariant.call(void 0, severity) },
|
|
1890
1890
|
source: { name: toolType, toolType },
|
|
1891
1891
|
device: device2,
|
|
1892
1892
|
description: { title: summary }
|
|
@@ -1958,13 +1958,13 @@ var NO_FILTERS = {};
|
|
|
1958
1958
|
var ACTION_COLUMNS = ["copy", "quickView", "open"];
|
|
1959
1959
|
var BESIDE_DRAWER_HIDDEN = [...ACTION_COLUMNS, "tool", "source"];
|
|
1960
1960
|
var logHref = () => "#";
|
|
1961
|
-
var copyAction = () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1961
|
+
var copyAction = () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZ66FOMSAcjs.LogCopyIconButton, {});
|
|
1962
1962
|
function LogsScreen({ compact = false }) {
|
|
1963
1963
|
const [dock, setDock] = _react.useState.call(void 0, null);
|
|
1964
1964
|
const selected = LOGS_FIXTURE_SELECTED;
|
|
1965
1965
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex h-full bg-ods-bg", children: [
|
|
1966
1966
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "min-w-0 flex-1 overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1967
|
-
|
|
1967
|
+
_chunkZ66FOMSAcjs.LogsPageView,
|
|
1968
1968
|
{
|
|
1969
1969
|
showHeader: false,
|
|
1970
1970
|
className: "p-[var(--spacing-system-l)]",
|
|
@@ -1972,7 +1972,7 @@ function LogsScreen({ compact = false }) {
|
|
|
1972
1972
|
onSearchChange: noop,
|
|
1973
1973
|
onOpenFilters: noop,
|
|
1974
1974
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1975
|
-
|
|
1975
|
+
_chunkZ66FOMSAcjs.LogsTableView,
|
|
1976
1976
|
{
|
|
1977
1977
|
logs: LOGS_FIXTURE_ENTRIES,
|
|
1978
1978
|
facets: LOGS_FIXTURE_FACETS,
|
|
@@ -1986,8 +1986,8 @@ function LogsScreen({ compact = false }) {
|
|
|
1986
1986
|
)
|
|
1987
1987
|
}
|
|
1988
1988
|
) }),
|
|
1989
|
-
!compact && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: setDock, className: "relative w-[calc(400px+var(--spacing-system-m))] shrink-0", children: dock && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1990
|
-
|
|
1989
|
+
!compact && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: setDock, className: "relative w-[calc(400px+var(--spacing-system-m))] shrink-0", children: dock && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZ66FOMSAcjs.AppLayoutDrawerContainerContext.Provider, { value: dock, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1990
|
+
_chunkZ66FOMSAcjs.LogDrawer,
|
|
1991
1991
|
{
|
|
1992
1992
|
docked: true,
|
|
1993
1993
|
isOpen: true,
|
|
@@ -1999,12 +1999,12 @@ function LogsScreen({ compact = false }) {
|
|
|
1999
1999
|
{ label: "Log ID", value: selected.logId },
|
|
2000
2000
|
{
|
|
2001
2001
|
label: "Source",
|
|
2002
|
-
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2002
|
+
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZ66FOMSAcjs.ToolBadge, { toolType: _chunkCRVXQYUZcjs.normalizeToolTypeWithFallback.call(void 0, selected.source.toolType) })
|
|
2003
2003
|
},
|
|
2004
|
-
{ label: "Device", value:
|
|
2004
|
+
{ label: "Device", value: _chunkZ66FOMSAcjs.logSourceLabels.call(void 0, selected.device).deviceName }
|
|
2005
2005
|
],
|
|
2006
2006
|
deviceCard: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2007
|
-
|
|
2007
|
+
_chunkZ66FOMSAcjs.DeviceCard,
|
|
2008
2008
|
{
|
|
2009
2009
|
...LOGS_FIXTURE_DEVICE,
|
|
2010
2010
|
actions: {
|
|
@@ -10,7 +10,7 @@ var _chunkFDZOE5TLcjs = require('./chunk-FDZOE5TL.cjs');
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkZ66FOMSAcjs = require('./chunk-Z66FOMSA.cjs');
|
|
14
14
|
require('./chunk-DTBIIFZG.cjs');
|
|
15
15
|
require('./chunk-NG3RKTQU.cjs');
|
|
16
16
|
require('./chunk-E56LN23H.cjs');
|
|
@@ -22,8 +22,8 @@ require('./chunk-24I6RFVU.cjs');
|
|
|
22
22
|
require('./chunk-A6P6DHEZ.cjs');
|
|
23
23
|
require('./chunk-MZ4KBSH7.cjs');
|
|
24
24
|
require('./chunk-YR74H7Z3.cjs');
|
|
25
|
-
require('./chunk-
|
|
26
|
-
require('./chunk-
|
|
25
|
+
require('./chunk-CRVXQYUZ.cjs');
|
|
26
|
+
require('./chunk-7E4BC3AF.cjs');
|
|
27
27
|
require('./chunk-7MV23NNT.cjs');
|
|
28
28
|
require('./chunk-ZD6SZLO2.cjs');
|
|
29
29
|
require('./chunk-3NGJ7NPT.cjs');
|
|
@@ -1824,8 +1824,8 @@ require('./chunk-7DNL734S.cjs');
|
|
|
1824
1824
|
require('./chunk-WWUSFOJ7.cjs');
|
|
1825
1825
|
require('./chunk-SKI6NKOE.cjs');
|
|
1826
1826
|
require('./chunk-EWPR7662.cjs');
|
|
1827
|
-
require('./chunk-
|
|
1828
|
-
require('./chunk-
|
|
1827
|
+
require('./chunk-FFRFKWTZ.cjs');
|
|
1828
|
+
require('./chunk-FAUVDMH4.cjs');
|
|
1829
1829
|
require('./chunk-YBTORXFY.cjs');
|
|
1830
1830
|
require('./chunk-2JCY5KQL.cjs');
|
|
1831
1831
|
require('./chunk-P4B6PVSG.cjs');
|
|
@@ -1891,14 +1891,14 @@ var POLICIES = [
|
|
|
1891
1891
|
policy("policy-local-admins", "No local admins", "No everyday account is a local administrator.", false, 0)
|
|
1892
1892
|
];
|
|
1893
1893
|
var POLICIES_FIXTURE = {
|
|
1894
|
-
summary:
|
|
1894
|
+
summary: _chunkZ66FOMSAcjs.computePolicySummary.call(void 0, POLICIES),
|
|
1895
1895
|
rows: POLICIES.map((item) => ({
|
|
1896
1896
|
id: item.id,
|
|
1897
1897
|
name: item.name,
|
|
1898
1898
|
description: item.description,
|
|
1899
1899
|
critical: item.critical,
|
|
1900
1900
|
severityLabel: item.critical ? "Critical" : "Low",
|
|
1901
|
-
status:
|
|
1901
|
+
status: _chunkZ66FOMSAcjs.getPolicyTableStatus.call(void 0, item),
|
|
1902
1902
|
actions: [
|
|
1903
1903
|
{ label: "Policy Details", onClick: noop },
|
|
1904
1904
|
{ label: "Delete Policy", onClick: noop }
|
|
@@ -1912,16 +1912,16 @@ var POLICIES_FIXTURE = {
|
|
|
1912
1912
|
var _jsxruntime = require('react/jsx-runtime');
|
|
1913
1913
|
function PoliciesScreen({ compact = false }) {
|
|
1914
1914
|
const table = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1915
|
-
|
|
1915
|
+
_chunkZ66FOMSAcjs.PoliciesTable,
|
|
1916
1916
|
{
|
|
1917
1917
|
rows: POLICIES_FIXTURE.rows,
|
|
1918
1918
|
rowAsLink: true,
|
|
1919
|
-
rightSlot: compact ? void 0 : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1919
|
+
rightSlot: compact ? void 0 : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZ66FOMSAcjs.DataTable.RowCount, {}),
|
|
1920
1920
|
emptyMessage: "No policies found."
|
|
1921
1921
|
}
|
|
1922
1922
|
);
|
|
1923
1923
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex h-full flex-col gap-[var(--spacing-system-l)] bg-ods-bg p-[var(--spacing-system-l)]", children: [
|
|
1924
|
-
!compact && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1924
|
+
!compact && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZ66FOMSAcjs.PolicySummaryCards, { summary: POLICIES_FIXTURE.summary, now: POLICIES_FIXTURE.now }),
|
|
1925
1925
|
table
|
|
1926
1926
|
] });
|
|
1927
1927
|
}
|
|
@@ -13,7 +13,7 @@ var _chunkFDZOE5TLcjs = require('./chunk-FDZOE5TL.cjs');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkZ66FOMSAcjs = require('./chunk-Z66FOMSA.cjs');
|
|
17
17
|
require('./chunk-DTBIIFZG.cjs');
|
|
18
18
|
require('./chunk-NG3RKTQU.cjs');
|
|
19
19
|
|
|
@@ -27,8 +27,8 @@ require('./chunk-24I6RFVU.cjs');
|
|
|
27
27
|
require('./chunk-A6P6DHEZ.cjs');
|
|
28
28
|
require('./chunk-MZ4KBSH7.cjs');
|
|
29
29
|
require('./chunk-YR74H7Z3.cjs');
|
|
30
|
-
require('./chunk-
|
|
31
|
-
require('./chunk-
|
|
30
|
+
require('./chunk-CRVXQYUZ.cjs');
|
|
31
|
+
require('./chunk-7E4BC3AF.cjs');
|
|
32
32
|
require('./chunk-7MV23NNT.cjs');
|
|
33
33
|
require('./chunk-ZD6SZLO2.cjs');
|
|
34
34
|
require('./chunk-3NGJ7NPT.cjs');
|
|
@@ -1831,8 +1831,8 @@ require('./chunk-7DNL734S.cjs');
|
|
|
1831
1831
|
require('./chunk-WWUSFOJ7.cjs');
|
|
1832
1832
|
require('./chunk-SKI6NKOE.cjs');
|
|
1833
1833
|
require('./chunk-EWPR7662.cjs');
|
|
1834
|
-
require('./chunk-
|
|
1835
|
-
require('./chunk-
|
|
1834
|
+
require('./chunk-FFRFKWTZ.cjs');
|
|
1835
|
+
require('./chunk-FAUVDMH4.cjs');
|
|
1836
1836
|
require('./chunk-YBTORXFY.cjs');
|
|
1837
1837
|
require('./chunk-2JCY5KQL.cjs');
|
|
1838
1838
|
require('./chunk-P4B6PVSG.cjs');
|
|
@@ -1995,8 +1995,8 @@ function buildScriptsFixture(cast) {
|
|
|
1995
1995
|
var _jsxruntime = require('react/jsx-runtime');
|
|
1996
1996
|
var WIDE_HIDDEN_COLUMNS = ["result", "open"];
|
|
1997
1997
|
var COMPACT_COLUMNS = [
|
|
1998
|
-
{ ...
|
|
1999
|
-
|
|
1998
|
+
{ ..._chunkZ66FOMSAcjs.EXECUTION_COLUMNS.machineId, width: "flex-1 min-w-0", hideAt: void 0 },
|
|
1999
|
+
_chunkZ66FOMSAcjs.EXECUTION_COLUMNS.status
|
|
2000
2000
|
];
|
|
2001
2001
|
var COMPACT_ROWS = 4;
|
|
2002
2002
|
var TOKEN_CLASS = {
|
|
@@ -2055,7 +2055,7 @@ function ScriptCodePicture({ script }) {
|
|
|
2055
2055
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-w-0 items-center justify-between gap-[var(--spacing-system-m)]", children: [
|
|
2056
2056
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE56LN23Hcjs.TruncateText, { variant: "h6", tone: "secondary", children: `Written by ${provenance.author} \xB7 approved by ${provenance.approver}` }),
|
|
2057
2057
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2058
|
-
|
|
2058
|
+
_chunkZ66FOMSAcjs.ScriptShellBadge,
|
|
2059
2059
|
{
|
|
2060
2060
|
value: script.shellType,
|
|
2061
2061
|
className: "shrink-0 text-ods-text-secondary text-h6",
|
|
@@ -2079,7 +2079,7 @@ function ScriptsScreen({ compact = false }) {
|
|
|
2079
2079
|
return (
|
|
2080
2080
|
// Four runs of the card's row height fill the frame; the padding is what is left round them.
|
|
2081
2081
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full overflow-hidden bg-ods-bg p-[var(--spacing-system-xsf)]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2082
|
-
|
|
2082
|
+
_chunkZ66FOMSAcjs.ScriptExecutionsTable,
|
|
2083
2083
|
{
|
|
2084
2084
|
rows: fixture.executions.slice(0, COMPACT_ROWS),
|
|
2085
2085
|
columns: COMPACT_COLUMNS,
|
|
@@ -2089,13 +2089,13 @@ function ScriptsScreen({ compact = false }) {
|
|
|
2089
2089
|
) })
|
|
2090
2090
|
);
|
|
2091
2091
|
}
|
|
2092
|
-
const renderOutput = (row) => row.id === fixture.openExecutionId ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2092
|
+
const renderOutput = (row) => row.id === fixture.openExecutionId ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZ66FOMSAcjs.ScriptExecutionResult, { result: row.result, empty: "\u2014" }) : null;
|
|
2093
2093
|
return (
|
|
2094
2094
|
// The frame's tighter padding and no header row: the output opened under a run needs the height.
|
|
2095
2095
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex h-full gap-[var(--spacing-system-m)] overflow-hidden bg-ods-bg p-[var(--spacing-system-m)]", children: [
|
|
2096
2096
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-[39%] shrink-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ScriptCodePicture, { script: fixture.script }) }),
|
|
2097
2097
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "min-w-0 flex-1 overflow-hidden", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2098
|
-
|
|
2098
|
+
_chunkZ66FOMSAcjs.ScriptExecutionsTable,
|
|
2099
2099
|
{
|
|
2100
2100
|
rows: fixture.executions,
|
|
2101
2101
|
hideColumns: WIDE_HIDDEN_COLUMNS,
|
|
@@ -15,7 +15,7 @@ var _chunkFDZOE5TLcjs = require('./chunk-FDZOE5TL.cjs');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkZ66FOMSAcjs = require('./chunk-Z66FOMSA.cjs');
|
|
19
19
|
require('./chunk-DTBIIFZG.cjs');
|
|
20
20
|
require('./chunk-NG3RKTQU.cjs');
|
|
21
21
|
|
|
@@ -29,8 +29,8 @@ require('./chunk-24I6RFVU.cjs');
|
|
|
29
29
|
require('./chunk-A6P6DHEZ.cjs');
|
|
30
30
|
require('./chunk-MZ4KBSH7.cjs');
|
|
31
31
|
require('./chunk-YR74H7Z3.cjs');
|
|
32
|
-
require('./chunk-
|
|
33
|
-
require('./chunk-
|
|
32
|
+
require('./chunk-CRVXQYUZ.cjs');
|
|
33
|
+
require('./chunk-7E4BC3AF.cjs');
|
|
34
34
|
require('./chunk-7MV23NNT.cjs');
|
|
35
35
|
require('./chunk-ZD6SZLO2.cjs');
|
|
36
36
|
require('./chunk-3NGJ7NPT.cjs');
|
|
@@ -1831,8 +1831,8 @@ require('./chunk-7DNL734S.cjs');
|
|
|
1831
1831
|
require('./chunk-WWUSFOJ7.cjs');
|
|
1832
1832
|
require('./chunk-SKI6NKOE.cjs');
|
|
1833
1833
|
require('./chunk-EWPR7662.cjs');
|
|
1834
|
-
require('./chunk-
|
|
1835
|
-
require('./chunk-
|
|
1834
|
+
require('./chunk-FFRFKWTZ.cjs');
|
|
1835
|
+
require('./chunk-FAUVDMH4.cjs');
|
|
1836
1836
|
require('./chunk-YBTORXFY.cjs');
|
|
1837
1837
|
require('./chunk-2JCY5KQL.cjs');
|
|
1838
1838
|
require('./chunk-P4B6PVSG.cjs');
|
|
@@ -1922,12 +1922,12 @@ function StaticPackageField({ value }) {
|
|
|
1922
1922
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1923
1923
|
_chunkE56LN23Hcjs.Autocomplete,
|
|
1924
1924
|
{
|
|
1925
|
-
label:
|
|
1925
|
+
label: _chunkZ66FOMSAcjs.PACKAGE_SEARCH_LABEL,
|
|
1926
1926
|
labelVariant: "large",
|
|
1927
1927
|
options: value ? [{ value: value.id, label: value.name, description: _nullishCoalesce(value.description, () => ( void 0)) }] : [],
|
|
1928
1928
|
value: _nullishCoalesce(_optionalChain([value, 'optionalAccess', _ => _.id]), () => ( null)),
|
|
1929
1929
|
onChange: noop,
|
|
1930
|
-
placeholder:
|
|
1930
|
+
placeholder: _chunkZ66FOMSAcjs.PACKAGE_SEARCH_PLACEHOLDER
|
|
1931
1931
|
}
|
|
1932
1932
|
);
|
|
1933
1933
|
}
|
|
@@ -1941,7 +1941,7 @@ function SoftwareUpdateScreen({ compact = false }) {
|
|
|
1941
1941
|
[fixture.devices, fixture.selectedIds]
|
|
1942
1942
|
);
|
|
1943
1943
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full bg-ods-bg pt-[var(--spacing-system-l)]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1944
|
-
|
|
1944
|
+
_chunkZ66FOMSAcjs.SoftwareActionForm,
|
|
1945
1945
|
{
|
|
1946
1946
|
action: fixture.action,
|
|
1947
1947
|
showHeader: false,
|
|
@@ -1953,7 +1953,7 @@ function SoftwareUpdateScreen({ compact = false }) {
|
|
|
1953
1953
|
initialValues: fixture.initialValues,
|
|
1954
1954
|
renderPackageSearch,
|
|
1955
1955
|
renderDevicePicker: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1956
|
-
|
|
1956
|
+
_chunkZ66FOMSAcjs.DeviceSelector,
|
|
1957
1957
|
{
|
|
1958
1958
|
devices: selected,
|
|
1959
1959
|
loading: false,
|
package/dist/utils/index.cjs
CHANGED
|
@@ -85458,6 +85458,21 @@ function stripInlineMarkdown(s) {
|
|
|
85458
85458
|
}
|
|
85459
85459
|
var NOT_PROSE = /* @__PURE__ */ new Set(["pre", "img"]);
|
|
85460
85460
|
var TABLE_SECTIONS = /* @__PURE__ */ new Set(["thead", "tbody", "tfoot"]);
|
|
85461
|
+
var element = (tagName, children) => ({
|
|
85462
|
+
type: "element",
|
|
85463
|
+
tagName,
|
|
85464
|
+
properties: {},
|
|
85465
|
+
children
|
|
85466
|
+
});
|
|
85467
|
+
var sectionsBreak;
|
|
85468
|
+
function toTextBreaksBetweenSections() {
|
|
85469
|
+
if (sectionsBreak === void 0) {
|
|
85470
|
+
const row = (text) => element("tr", [element("td", [{ type: "text", value: text }])]);
|
|
85471
|
+
const table = element("table", [element("thead", [row("a")]), element("tbody", [row("b")])]);
|
|
85472
|
+
sectionsBreak = hastUtilToText.toText({ type: "root", children: [table] }).includes("\n");
|
|
85473
|
+
}
|
|
85474
|
+
return sectionsBreak;
|
|
85475
|
+
}
|
|
85461
85476
|
function htmlTree(markdown) {
|
|
85462
85477
|
const mdast = mdastUtilFromMarkdown.fromMarkdown(markdown, { extensions: [micromarkExtensionGfm.gfm()], mdastExtensions: [mdastUtilGfm.gfmFromMarkdown()] });
|
|
85463
85478
|
mdastUtilNewlineToBreak.newlineToBreak(mdast);
|
|
@@ -85470,7 +85485,7 @@ function proseTree(markdown) {
|
|
|
85470
85485
|
parent.children.splice(index, 1);
|
|
85471
85486
|
return [unistUtilVisit.SKIP, index];
|
|
85472
85487
|
}
|
|
85473
|
-
if (TABLE_SECTIONS.has(node.tagName) && parent && index !== void 0) {
|
|
85488
|
+
if (TABLE_SECTIONS.has(node.tagName) && parent && index !== void 0 && !toTextBreaksBetweenSections()) {
|
|
85474
85489
|
const followedBySection = parent.children.slice(index + 1).some((sibling) => sibling.type === "element" && TABLE_SECTIONS.has(sibling.tagName));
|
|
85475
85490
|
const rows = node.children.filter(
|
|
85476
85491
|
(child) => child.type === "element" && child.tagName === "tr"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-to-plain.d.ts","sourceRoot":"","sources":["../../src/utils/markdown-to-plain.ts"],"names":[],"mappings":"AAiCA,MAAM,WAAW,sBAAsB;IACrC;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;gFAEgF;AAChF,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAMrD;
|
|
1
|
+
{"version":3,"file":"markdown-to-plain.d.ts","sourceRoot":"","sources":["../../src/utils/markdown-to-plain.ts"],"names":[],"mappings":"AAiCA,MAAM,WAAW,sBAAsB;IACrC;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;gFAEgF;AAChF,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAMrD;AA4DD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B,GAAG,MAAM,CAmBlG"}
|
|
@@ -11,6 +11,21 @@ function stripInlineMarkdown(s) {
|
|
|
11
11
|
}
|
|
12
12
|
const NOT_PROSE = /* @__PURE__ */ new Set(["pre", "img"]);
|
|
13
13
|
const TABLE_SECTIONS = /* @__PURE__ */ new Set(["thead", "tbody", "tfoot"]);
|
|
14
|
+
const element = (tagName, children) => ({
|
|
15
|
+
type: "element",
|
|
16
|
+
tagName,
|
|
17
|
+
properties: {},
|
|
18
|
+
children
|
|
19
|
+
});
|
|
20
|
+
let sectionsBreak;
|
|
21
|
+
function toTextBreaksBetweenSections() {
|
|
22
|
+
if (sectionsBreak === void 0) {
|
|
23
|
+
const row = (text) => element("tr", [element("td", [{ type: "text", value: text }])]);
|
|
24
|
+
const table = element("table", [element("thead", [row("a")]), element("tbody", [row("b")])]);
|
|
25
|
+
sectionsBreak = toText({ type: "root", children: [table] }).includes("\n");
|
|
26
|
+
}
|
|
27
|
+
return sectionsBreak;
|
|
28
|
+
}
|
|
14
29
|
function htmlTree(markdown) {
|
|
15
30
|
const mdast = fromMarkdown(markdown, { extensions: [gfm()], mdastExtensions: [gfmFromMarkdown()] });
|
|
16
31
|
newlineToBreak(mdast);
|
|
@@ -23,7 +38,7 @@ function proseTree(markdown) {
|
|
|
23
38
|
parent.children.splice(index, 1);
|
|
24
39
|
return [SKIP, index];
|
|
25
40
|
}
|
|
26
|
-
if (TABLE_SECTIONS.has(node.tagName) && parent && index !== void 0) {
|
|
41
|
+
if (TABLE_SECTIONS.has(node.tagName) && parent && index !== void 0 && !toTextBreaksBetweenSections()) {
|
|
27
42
|
const followedBySection = parent.children.slice(index + 1).some((sibling) => sibling.type === "element" && TABLE_SECTIONS.has(sibling.tagName));
|
|
28
43
|
const rows = node.children.filter(
|
|
29
44
|
(child) => child.type === "element" && child.tagName === "tr"
|
package/package.json
CHANGED
|
@@ -31,7 +31,7 @@ import { PlusIcon } from '../icons-v2-generated/signs-and-symbols/plus-icon';
|
|
|
31
31
|
import { XmarkCircleIcon } from '../icons-v2-generated/signs-and-symbols/xmark-circle-icon';
|
|
32
32
|
import { LoadingSuspense } from '../loading/loading-fallback';
|
|
33
33
|
import { Button } from '../ui/button';
|
|
34
|
-
import { LOADING_NOOP } from '../ui/loading-scope';
|
|
34
|
+
import { LOADING_NOOP, useLoadingScope } from '../ui/loading-scope';
|
|
35
35
|
import {
|
|
36
36
|
CONTEXT_BACK_BAR_CLASS,
|
|
37
37
|
CONTEXT_STATE_CLASS,
|
|
@@ -388,26 +388,16 @@ export function ChatContextPicker({
|
|
|
388
388
|
</div>
|
|
389
389
|
)}
|
|
390
390
|
>
|
|
391
|
-
<
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
fallback={
|
|
395
|
-
<ContextItemsList
|
|
396
|
-
items={[]}
|
|
397
|
-
selectedKeys={NO_SELECTED_KEYS}
|
|
398
|
-
onToggle={LOADING_NOOP}
|
|
399
|
-
atLimit={false}
|
|
400
|
-
/>
|
|
401
|
-
}
|
|
402
|
-
>
|
|
403
|
-
{config.renderItems({
|
|
391
|
+
<ContextItems
|
|
392
|
+
renderItems={config.renderItems}
|
|
393
|
+
args={{
|
|
404
394
|
type: activeType.type,
|
|
405
395
|
query: debouncedQuery,
|
|
406
396
|
selectedKeys,
|
|
407
397
|
onToggle: onToggleItem,
|
|
408
398
|
atLimit,
|
|
409
|
-
}
|
|
410
|
-
|
|
399
|
+
}}
|
|
400
|
+
/>
|
|
411
401
|
</ContextErrorBoundary>
|
|
412
402
|
)}
|
|
413
403
|
</QueryErrorResetBoundary>
|
|
@@ -417,6 +407,30 @@ export function ChatContextPicker({
|
|
|
417
407
|
);
|
|
418
408
|
}
|
|
419
409
|
|
|
410
|
+
type ContextItemsArgs = Parameters<ChatContextPickerConfig['renderItems']>[0];
|
|
411
|
+
|
|
412
|
+
/** The host-rendered items of a type, with their own boundary: in its scope the reader draws the list's skeleton rows. */
|
|
413
|
+
function ContextItems(props: { renderItems: ChatContextPickerConfig['renderItems']; args: ContextItemsArgs }) {
|
|
414
|
+
return (
|
|
415
|
+
<LoadingSuspense label="Loading items">
|
|
416
|
+
<ContextItemsReader {...props} />
|
|
417
|
+
</LoadingSuspense>
|
|
418
|
+
);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/** In a loading scope, the SAME list the host renders with no items (one page of its own skeleton rows); else the host's. */
|
|
422
|
+
function ContextItemsReader({
|
|
423
|
+
renderItems,
|
|
424
|
+
args,
|
|
425
|
+
}: {
|
|
426
|
+
renderItems: ChatContextPickerConfig['renderItems'];
|
|
427
|
+
args: ContextItemsArgs;
|
|
428
|
+
}) {
|
|
429
|
+
if (useLoadingScope())
|
|
430
|
+
return <ContextItemsList items={[]} selectedKeys={NO_SELECTED_KEYS} onToggle={LOADING_NOOP} atLimit={false} />;
|
|
431
|
+
return <>{renderItems(args)}</>;
|
|
432
|
+
}
|
|
433
|
+
|
|
420
434
|
// ===========================================================================
|
|
421
435
|
// CHIP STRIP — selected items above the input (Figma node 1:5699)
|
|
422
436
|
// ===========================================================================
|
|
@@ -393,8 +393,10 @@ function SectionHeadingSkeleton({
|
|
|
393
393
|
const layout = SECTION_HEADING_LAYOUT[level];
|
|
394
394
|
const introByBreakpoint = typeof intro === 'object' ? intro : null;
|
|
395
395
|
const introLines = typeof intro === 'number' ? intro : intro === true ? 2 : 0;
|
|
396
|
+
// The bars have no width of their own: a section's stack fills up to its own cap (640px), the width a real title and
|
|
397
|
+
// intro take, so an action at the far end wraps under it exactly where it does once loaded.
|
|
396
398
|
const stack = (
|
|
397
|
-
<div className={layout.stack} aria-hidden>
|
|
399
|
+
<div className={level === 'section' ? `${layout.stack} w-full` : layout.stack} aria-hidden>
|
|
398
400
|
{eyebrow ? (
|
|
399
401
|
<SectionEyebrow platform={platform} tone={tone}>
|
|
400
402
|
{eyebrow}
|
|
@@ -133,6 +133,9 @@ export function FadePreview({
|
|
|
133
133
|
const collapsedHeight = collapsedHeightProp ?? (itemMode ? 'auto' : 120);
|
|
134
134
|
const collapsed = itemMode && itemsHeight != null ? itemsHeight : collapsedHeight;
|
|
135
135
|
const [expanded, setExpanded] = useState(false);
|
|
136
|
+
// The counted mode's expanded height, measured when the reader opens it, so the markup carries a height to animate
|
|
137
|
+
// to (the layout effect below keeps it in step as the content grows).
|
|
138
|
+
const [openHeight, setOpenHeight] = useState<number | null>(null);
|
|
136
139
|
// Overflow is a MEASUREMENT (text wraps to the live width), so it is unknown
|
|
137
140
|
// until the first layout pass. Nothing about the block's HEIGHT depends on it:
|
|
138
141
|
// the collapsed height is in the markup and the toggle row is always
|
|
@@ -233,8 +236,13 @@ export function FadePreview({
|
|
|
233
236
|
// Fixed mode renders the collapsed height INTO the markup, so the
|
|
234
237
|
// server-rendered block is already clamped and hydration never shrinks
|
|
235
238
|
// it. The expanded value is a live DOM measurement, so the layout
|
|
236
|
-
// effect above
|
|
239
|
+
// effect above keeps it current.
|
|
237
240
|
...(fixed && !fill && !expanded ? { height: cssLength(collapsed) } : {}),
|
|
241
|
+
// The counted mode too: its collapsed max-height is in the server's markup, so a cached page is clamped in
|
|
242
|
+
// its first paint (it used to show the whole list until hydration, then collapse it).
|
|
243
|
+
...(!fixed
|
|
244
|
+
? { maxHeight: expanded && openHeight != null ? `${openHeight}px` : cssLength(collapsedHeight) }
|
|
245
|
+
: {}),
|
|
238
246
|
...(!expanded && needsFade
|
|
239
247
|
? {
|
|
240
248
|
maskImage: 'linear-gradient(to bottom, black 30%, transparent 100%)',
|
|
@@ -254,7 +262,10 @@ export function FadePreview({
|
|
|
254
262
|
variant="link"
|
|
255
263
|
size="compact"
|
|
256
264
|
noPaddingX
|
|
257
|
-
onClick={() =>
|
|
265
|
+
onClick={() => {
|
|
266
|
+
if (!expanded && contentRef.current) setOpenHeight(contentRef.current.scrollHeight);
|
|
267
|
+
setExpanded(!expanded);
|
|
268
|
+
}}
|
|
258
269
|
aria-expanded={expanded}
|
|
259
270
|
aria-hidden={showToggle ? undefined : true}
|
|
260
271
|
tabIndex={showToggle ? undefined : -1}
|