@fluentui-copilot/react-reference 0.0.0-nightly-20240313-0404-8abc883d.1
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.json +943 -0
- package/CHANGELOG.md +281 -0
- package/LICENSE +23 -0
- package/README.md +5 -0
- package/dist/index.d.ts +539 -0
- package/lib/Citation.js +2 -0
- package/lib/Citation.js.map +1 -0
- package/lib/Reference.js +2 -0
- package/lib/Reference.js.map +1 -0
- package/lib/ReferenceGroup.js +2 -0
- package/lib/ReferenceGroup.js.map +1 -0
- package/lib/ReferenceGroupToggle.js +2 -0
- package/lib/ReferenceGroupToggle.js.map +1 -0
- package/lib/ReferenceList.js +2 -0
- package/lib/ReferenceList.js.map +1 -0
- package/lib/components/Citation/Citation.js +14 -0
- package/lib/components/Citation/Citation.js.map +1 -0
- package/lib/components/Citation/Citation.types.js +2 -0
- package/lib/components/Citation/Citation.types.js.map +1 -0
- package/lib/components/Citation/index.js +6 -0
- package/lib/components/Citation/index.js.map +1 -0
- package/lib/components/Citation/renderCitation.js +29 -0
- package/lib/components/Citation/renderCitation.js.map +1 -0
- package/lib/components/Citation/useCitation.js +191 -0
- package/lib/components/Citation/useCitation.js.map +1 -0
- package/lib/components/Citation/useCitationStyles.js +44 -0
- package/lib/components/Citation/useCitationStyles.js.map +1 -0
- package/lib/components/Reference/Reference.js +14 -0
- package/lib/components/Reference/Reference.js.map +1 -0
- package/lib/components/Reference/Reference.types.js +2 -0
- package/lib/components/Reference/Reference.types.js.map +1 -0
- package/lib/components/Reference/index.js +6 -0
- package/lib/components/Reference/index.js.map +1 -0
- package/lib/components/Reference/renderReference.js +16 -0
- package/lib/components/Reference/renderReference.js.map +1 -0
- package/lib/components/Reference/useReference.js +197 -0
- package/lib/components/Reference/useReference.js.map +1 -0
- package/lib/components/Reference/useReferenceStyles.js +253 -0
- package/lib/components/Reference/useReferenceStyles.js.map +1 -0
- package/lib/components/ReferenceGroup/ReferenceGroup.js +19 -0
- package/lib/components/ReferenceGroup/ReferenceGroup.js.map +1 -0
- package/lib/components/ReferenceGroup/ReferenceGroup.types.js +2 -0
- package/lib/components/ReferenceGroup/ReferenceGroup.types.js.map +1 -0
- package/lib/components/ReferenceGroup/index.js +6 -0
- package/lib/components/ReferenceGroup/index.js.map +1 -0
- package/lib/components/ReferenceGroup/renderReferenceGroup.js +21 -0
- package/lib/components/ReferenceGroup/renderReferenceGroup.js.map +1 -0
- package/lib/components/ReferenceGroup/useReferenceGroup.js +104 -0
- package/lib/components/ReferenceGroup/useReferenceGroup.js.map +1 -0
- package/lib/components/ReferenceGroup/useReferenceGroupContextValues.js +10 -0
- package/lib/components/ReferenceGroup/useReferenceGroupContextValues.js.map +1 -0
- package/lib/components/ReferenceGroup/useReferenceGroupStyles.js +50 -0
- package/lib/components/ReferenceGroup/useReferenceGroupStyles.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.js +12 -0
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js +2 -0
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/index.js +6 -0
- package/lib/components/ReferenceGroupToggle/index.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/renderReferenceGroupToggle.js +12 -0
- package/lib/components/ReferenceGroupToggle/renderReferenceGroupToggle.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js +40 -0
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js +20 -0
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js.map +1 -0
- package/lib/components/ReferenceList/ReferenceList.js +14 -0
- package/lib/components/ReferenceList/ReferenceList.js.map +1 -0
- package/lib/components/ReferenceList/ReferenceList.types.js +2 -0
- package/lib/components/ReferenceList/ReferenceList.types.js.map +1 -0
- package/lib/components/ReferenceList/index.js +6 -0
- package/lib/components/ReferenceList/index.js.map +1 -0
- package/lib/components/ReferenceList/renderReferenceList.js +10 -0
- package/lib/components/ReferenceList/renderReferenceList.js.map +1 -0
- package/lib/components/ReferenceList/useReferenceList.js +30 -0
- package/lib/components/ReferenceList/useReferenceList.js.map +1 -0
- package/lib/components/ReferenceList/useReferenceListStyles.js +17 -0
- package/lib/components/ReferenceList/useReferenceListStyles.js.map +1 -0
- package/lib/context/ReferenceGroupContext.js +11 -0
- package/lib/context/ReferenceGroupContext.js.map +1 -0
- package/lib/hooks/index.js +4 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/useReferenceCitation.js +77 -0
- package/lib/hooks/useReferenceCitation.js.map +1 -0
- package/lib/hooks/useReferenceCitationPreview.js +128 -0
- package/lib/hooks/useReferenceCitationPreview.js.map +1 -0
- package/lib/hooks/useReferenceGroup.js +40 -0
- package/lib/hooks/useReferenceGroup.js.map +1 -0
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -0
- package/lib-commonjs/Citation.js +7 -0
- package/lib-commonjs/Citation.js.map +1 -0
- package/lib-commonjs/Reference.js +7 -0
- package/lib-commonjs/Reference.js.map +1 -0
- package/lib-commonjs/ReferenceGroup.js +7 -0
- package/lib-commonjs/ReferenceGroup.js.map +1 -0
- package/lib-commonjs/ReferenceGroupToggle.js +7 -0
- package/lib-commonjs/ReferenceGroupToggle.js.map +1 -0
- package/lib-commonjs/ReferenceList.js +7 -0
- package/lib-commonjs/ReferenceList.js.map +1 -0
- package/lib-commonjs/components/Citation/Citation.js +23 -0
- package/lib-commonjs/components/Citation/Citation.js.map +1 -0
- package/lib-commonjs/components/Citation/Citation.types.js +5 -0
- package/lib-commonjs/components/Citation/Citation.types.js.map +1 -0
- package/lib-commonjs/components/Citation/index.js +11 -0
- package/lib-commonjs/components/Citation/index.js.map +1 -0
- package/lib-commonjs/components/Citation/renderCitation.js +38 -0
- package/lib-commonjs/components/Citation/renderCitation.js.map +1 -0
- package/lib-commonjs/components/Citation/useCitation.js +185 -0
- package/lib-commonjs/components/Citation/useCitation.js.map +1 -0
- package/lib-commonjs/components/Citation/useCitationStyles.js +100 -0
- package/lib-commonjs/components/Citation/useCitationStyles.js.map +1 -0
- package/lib-commonjs/components/Reference/Reference.js +23 -0
- package/lib-commonjs/components/Reference/Reference.js.map +1 -0
- package/lib-commonjs/components/Reference/Reference.types.js +5 -0
- package/lib-commonjs/components/Reference/Reference.types.js.map +1 -0
- package/lib-commonjs/components/Reference/index.js +11 -0
- package/lib-commonjs/components/Reference/index.js.map +1 -0
- package/lib-commonjs/components/Reference/renderReference.js +40 -0
- package/lib-commonjs/components/Reference/renderReference.js.map +1 -0
- package/lib-commonjs/components/Reference/useReference.js +201 -0
- package/lib-commonjs/components/Reference/useReference.js.map +1 -0
- package/lib-commonjs/components/Reference/useReferenceStyles.js +454 -0
- package/lib-commonjs/components/Reference/useReferenceStyles.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/ReferenceGroup.js +25 -0
- package/lib-commonjs/components/ReferenceGroup/ReferenceGroup.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/ReferenceGroup.types.js +5 -0
- package/lib-commonjs/components/ReferenceGroup/ReferenceGroup.types.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/index.js +11 -0
- package/lib-commonjs/components/ReferenceGroup/index.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/renderReferenceGroup.js +33 -0
- package/lib-commonjs/components/ReferenceGroup/renderReferenceGroup.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroup.js +103 -0
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroup.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroupContextValues.js +23 -0
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroupContextValues.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroupStyles.js +75 -0
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroupStyles.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js +21 -0
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js +5 -0
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/index.js +11 -0
- package/lib-commonjs/components/ReferenceGroupToggle/index.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/renderReferenceGroupToggle.js +21 -0
- package/lib-commonjs/components/ReferenceGroupToggle/renderReferenceGroupToggle.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js +39 -0
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js +39 -0
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/ReferenceList.js +23 -0
- package/lib-commonjs/components/ReferenceList/ReferenceList.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/ReferenceList.types.js +5 -0
- package/lib-commonjs/components/ReferenceList/ReferenceList.types.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/index.js +11 -0
- package/lib-commonjs/components/ReferenceList/index.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/renderReferenceList.js +16 -0
- package/lib-commonjs/components/ReferenceList/renderReferenceList.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/useReferenceList.js +30 -0
- package/lib-commonjs/components/ReferenceList/useReferenceList.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/useReferenceListStyles.js +36 -0
- package/lib-commonjs/components/ReferenceList/useReferenceListStyles.js.map +1 -0
- package/lib-commonjs/context/ReferenceGroupContext.js +29 -0
- package/lib-commonjs/context/ReferenceGroupContext.js.map +1 -0
- package/lib-commonjs/hooks/index.js +15 -0
- package/lib-commonjs/hooks/index.js.map +1 -0
- package/lib-commonjs/hooks/useReferenceCitation.js +78 -0
- package/lib-commonjs/hooks/useReferenceCitation.js.map +1 -0
- package/lib-commonjs/hooks/useReferenceCitationPreview.js +141 -0
- package/lib-commonjs/hooks/useReferenceCitationPreview.js.map +1 -0
- package/lib-commonjs/hooks/useReferenceGroup.js +49 -0
- package/lib-commonjs/hooks/useReferenceGroup.js.map +1 -0
- package/lib-commonjs/index.js +103 -0
- package/lib-commonjs/index.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ReferenceGroupToggle.js"],"sourcesContent":["export * from './components/ReferenceGroupToggle/index';\n//# sourceMappingURL=ReferenceGroupToggle.js.map"],"names":[],"mappings":";;;;;uBAAc;CACd,gDAAgD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ReferenceList.js"],"sourcesContent":["export * from './components/ReferenceList/index';\n//# sourceMappingURL=ReferenceList.js.map"],"names":[],"mappings":";;;;;uBAAc;CACd,yCAAyC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "Citation", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return Citation;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _useCitation = require("./useCitation");
|
|
14
|
+
const _renderCitation = require("./renderCitation");
|
|
15
|
+
const _useCitationStyles = require("./useCitationStyles");
|
|
16
|
+
const _reactprovider = require("@fluentui-copilot/react-provider");
|
|
17
|
+
const Citation = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
18
|
+
const state = (0, _useCitation.useCitation_unstable)(props, ref);
|
|
19
|
+
(0, _useCitationStyles.useCitationStyles_unstable)(state);
|
|
20
|
+
(0, _reactprovider.useCustomStyleHook)('useCitationStyles')(state);
|
|
21
|
+
return (0, _renderCitation.renderCitation_unstable)(state);
|
|
22
|
+
});
|
|
23
|
+
Citation.displayName = 'Citation'; //# sourceMappingURL=Citation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Citation.js"],"sourcesContent":["import * as React from 'react';\nimport { useCitation_unstable } from './useCitation';\nimport { renderCitation_unstable } from './renderCitation';\nimport { useCitationStyles_unstable } from './useCitationStyles';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\n// Citation component - TODO: add more docs\nexport const Citation = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useCitation_unstable(props, ref);\n useCitationStyles_unstable(state);\n useCustomStyleHook('useCitationStyles')(state);\n return renderCitation_unstable(state);\n});\nCitation.displayName = 'Citation';\n//# sourceMappingURL=Citation.js.map"],"names":["Citation","React","forwardRef","props","ref","state","useCitation_unstable","useCitationStyles_unstable","useCustomStyleHook","renderCitation_unstable","displayName"],"mappings":";;;;+BAMaA;;;eAAAA;;;;iEANU;6BACc;gCACG;mCACG;+BACR;AAE5B,MAAMA,WAAW,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC5D,MAAMC,QAAQC,IAAAA,iCAAoB,EAACH,OAAOC;IAC1CG,IAAAA,6CAA0B,EAACF;IAC3BG,IAAAA,iCAAkB,EAAC,qBAAqBH;IACxC,OAAOI,IAAAA,uCAAuB,EAACJ;AACjC;AACAL,SAASU,WAAW,GAAG,YACvB,oCAAoC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Citation.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=Citation.types.js.map"],"names":[],"mappings":";;;;CACA,0CAA0C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
|
6
|
+
_export_star._(require("./Citation"), exports);
|
|
7
|
+
_export_star._(require("./Citation.types"), exports);
|
|
8
|
+
_export_star._(require("./renderCitation"), exports);
|
|
9
|
+
_export_star._(require("./useCitation"), exports);
|
|
10
|
+
_export_star._(require("./useCitationStyles"), exports);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './Citation';\nexport * from './Citation.types';\nexport * from './renderCitation';\nexport * from './useCitation';\nexport * from './useCitationStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA;CACd,iCAAiC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderCitation_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return renderCitation_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
12
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
13
|
+
const popoverPositioning = {
|
|
14
|
+
overflowBoundaryPadding: 4,
|
|
15
|
+
position: 'below'
|
|
16
|
+
};
|
|
17
|
+
const renderCitation_unstable = (state)=>{
|
|
18
|
+
(0, _reactcomponents.assertSlots)(state);
|
|
19
|
+
return state.popover && state.popoverSurface ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_reactcomponents.Popover, {
|
|
20
|
+
closeOnScroll: true,
|
|
21
|
+
onOpenChange: state.onPopoverOpenChange,
|
|
22
|
+
open: state.isPopoverOpen,
|
|
23
|
+
positioning: popoverPositioning,
|
|
24
|
+
size: "small",
|
|
25
|
+
trapFocus: true,
|
|
26
|
+
unstable_disableAutoFocus: state.disableAutoFocus,
|
|
27
|
+
withArrow: true,
|
|
28
|
+
children: [
|
|
29
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reactcomponents.PopoverTrigger, {
|
|
30
|
+
disableButtonEnhancement: true,
|
|
31
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {})
|
|
32
|
+
}),
|
|
33
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.popoverSurface, {
|
|
34
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.popover, {})
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {});
|
|
38
|
+
}; //# sourceMappingURL=renderCitation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderCitation.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { Popover, PopoverTrigger, assertSlots } from '@fluentui/react-components';\nconst popoverPositioning = {\n overflowBoundaryPadding: 4,\n position: 'below'\n};\n/**\n * Render the final JSX of Citation\n */\nexport const renderCitation_unstable = state => {\n assertSlots(state);\n return state.popover && state.popoverSurface ? /*#__PURE__*/_jsxs(Popover, {\n closeOnScroll: true,\n onOpenChange: state.onPopoverOpenChange,\n open: state.isPopoverOpen,\n positioning: popoverPositioning,\n size: \"small\",\n trapFocus: true,\n unstable_disableAutoFocus: state.disableAutoFocus,\n withArrow: true,\n children: [/*#__PURE__*/_jsx(PopoverTrigger, {\n disableButtonEnhancement: true,\n children: /*#__PURE__*/_jsx(state.root, {})\n }), /*#__PURE__*/_jsx(state.popoverSurface, {\n children: /*#__PURE__*/_jsx(state.popover, {})\n })]\n }) : /*#__PURE__*/_jsx(state.root, {});\n};\n//# sourceMappingURL=renderCitation.js.map"],"names":["renderCitation_unstable","popoverPositioning","overflowBoundaryPadding","position","state","assertSlots","popover","popoverSurface","_jsxs","Popover","closeOnScroll","onOpenChange","onPopoverOpenChange","open","isPopoverOpen","positioning","size","trapFocus","unstable_disableAutoFocus","disableAutoFocus","withArrow","children","_jsx","PopoverTrigger","disableButtonEnhancement","root"],"mappings":";;;;+BASaA;;;eAAAA;;;4BAT8B;iCACU;AACrD,MAAMC,qBAAqB;IACzBC,yBAAyB;IACzBC,UAAU;AACZ;AAIO,MAAMH,0BAA0BI,CAAAA;IACrCC,IAAAA,4BAAW,EAACD;IACZ,OAAOA,MAAME,OAAO,IAAIF,MAAMG,cAAc,GAAG,WAAW,GAAEC,IAAAA,gBAAK,EAACC,wBAAO,EAAE;QACzEC,eAAe;QACfC,cAAcP,MAAMQ,mBAAmB;QACvCC,MAAMT,MAAMU,aAAa;QACzBC,aAAad;QACbe,MAAM;QACNC,WAAW;QACXC,2BAA2Bd,MAAMe,gBAAgB;QACjDC,WAAW;QACXC,UAAU;YAAC,WAAW,GAAEC,IAAAA,eAAI,EAACC,+BAAc,EAAE;gBAC3CC,0BAA0B;gBAC1BH,UAAU,WAAW,GAAEC,IAAAA,eAAI,EAAClB,MAAMqB,IAAI,EAAE,CAAC;YAC3C;YAAI,WAAW,GAAEH,IAAAA,eAAI,EAAClB,MAAMG,cAAc,EAAE;gBAC1Cc,UAAU,WAAW,GAAEC,IAAAA,eAAI,EAAClB,MAAME,OAAO,EAAE,CAAC;YAC9C;SAAG;IACL,KAAK,WAAW,GAAEgB,IAAAA,eAAI,EAAClB,MAAMqB,IAAI,EAAE,CAAC;AACtC,GACA,0CAA0C"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useCitation_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useCitation_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
14
|
+
const _keyboardkeys = require("@fluentui/keyboard-keys");
|
|
15
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
16
|
+
const _reactpreview = require("@fluentui-copilot/react-preview");
|
|
17
|
+
const POPOVER_MOUSE_HIDE_DELAY = 500;
|
|
18
|
+
const POPOVER_KEYBOARD_HIDE_DELAY = 0;
|
|
19
|
+
const getDelay = (type)=>{
|
|
20
|
+
if (type === 'focus' || type === 'blur') {
|
|
21
|
+
return POPOVER_KEYBOARD_HIDE_DELAY;
|
|
22
|
+
}
|
|
23
|
+
return POPOVER_MOUSE_HIDE_DELAY;
|
|
24
|
+
};
|
|
25
|
+
const useCitation_unstable = (props, ref)=>{
|
|
26
|
+
const { popover, popoverSurface, referenceHref, block = false, ...otherProps } = props;
|
|
27
|
+
const { targetDocument } = (0, _reactcomponents.useFluent)();
|
|
28
|
+
const [setTimeout, clearTimeout] = (0, _reactutilities.useTimeout)();
|
|
29
|
+
const popoverId = (0, _reactcomponents.useId)('citation-popover-');
|
|
30
|
+
const [disableAutoFocus, setDisableAutoFocus] = _react.useState(true);
|
|
31
|
+
const { current: citationInternalState } = _react.useRef({
|
|
32
|
+
openByClick: false,
|
|
33
|
+
openByHoverOverCitation: false,
|
|
34
|
+
openByHoverOverPopover: false,
|
|
35
|
+
openByKeyboard: false
|
|
36
|
+
});
|
|
37
|
+
const isOpen = ()=>{
|
|
38
|
+
return citationInternalState.openByClick || citationInternalState.openByHoverOverCitation || citationInternalState.openByHoverOverPopover || citationInternalState.openByKeyboard;
|
|
39
|
+
};
|
|
40
|
+
const [isPopoverOpen, setIsPopoverOpen] = _react.useState(false);
|
|
41
|
+
const preventDefaultClose = _react.useRef(false);
|
|
42
|
+
const handleCitationTargetEnter = (e)=>{
|
|
43
|
+
citationInternalState.openByHoverOverCitation = true;
|
|
44
|
+
// We want to disable auto focus only if the popover is being opened by hovering over the citation
|
|
45
|
+
if (!citationInternalState.openByClick && !citationInternalState.openByKeyboard) {
|
|
46
|
+
setDisableAutoFocus(true);
|
|
47
|
+
}
|
|
48
|
+
setIsPopoverOpen(isOpen());
|
|
49
|
+
};
|
|
50
|
+
const handleCitationTargetLeave = (e)=>{
|
|
51
|
+
citationInternalState.openByHoverOverCitation = false;
|
|
52
|
+
setTimeout(()=>{
|
|
53
|
+
setIsPopoverOpen(isOpen());
|
|
54
|
+
}, getDelay(e.type));
|
|
55
|
+
};
|
|
56
|
+
const handleCitationClick = (e)=>{
|
|
57
|
+
// Setting preventDefaultClose so that onPopoverOpenChange does not apply its logic when click is on the citation as we want to control that behavior.
|
|
58
|
+
preventDefaultClose.current = true;
|
|
59
|
+
// We set disableAutoFocus to false so that interactive elements within popover can be focused when it opens via click.
|
|
60
|
+
setDisableAutoFocus(false);
|
|
61
|
+
// If openByKeyboard is true, then the popover was already opened via keyboard and we always want to close it.
|
|
62
|
+
citationInternalState.openByClick = citationInternalState.openByKeyboard ? false : !citationInternalState.openByClick;
|
|
63
|
+
citationInternalState.openByHoverOverCitation = false;
|
|
64
|
+
citationInternalState.openByHoverOverPopover = false;
|
|
65
|
+
citationInternalState.openByKeyboard = false;
|
|
66
|
+
setIsPopoverOpen(isOpen());
|
|
67
|
+
};
|
|
68
|
+
const handleCitationKeyDown = (e)=>{
|
|
69
|
+
if (e.key === _keyboardkeys.Enter) {
|
|
70
|
+
clearTimeout();
|
|
71
|
+
// Setting default prevented so the enter key does not trigger a click event or onPopoverOpenChange.
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
// We set disableAutoFocus to false so that interactive elements within popover can be focused when it opens via keyboard.
|
|
74
|
+
setDisableAutoFocus(false);
|
|
75
|
+
// If openByClick is true, then the popover was already opened via click and we always want to close it.
|
|
76
|
+
citationInternalState.openByKeyboard = citationInternalState.openByClick ? false : !citationInternalState.openByKeyboard;
|
|
77
|
+
citationInternalState.openByClick = false;
|
|
78
|
+
citationInternalState.openByHoverOverCitation = false;
|
|
79
|
+
citationInternalState.openByHoverOverPopover = false;
|
|
80
|
+
setIsPopoverOpen(isOpen());
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
const handlePopoverTargetEnter = (e)=>{
|
|
84
|
+
citationInternalState.openByHoverOverPopover = true;
|
|
85
|
+
setIsPopoverOpen(isOpen());
|
|
86
|
+
};
|
|
87
|
+
const handlePopoverTargetLeave = (e)=>{
|
|
88
|
+
citationInternalState.openByHoverOverPopover = false;
|
|
89
|
+
setTimeout(()=>{
|
|
90
|
+
setIsPopoverOpen(isOpen());
|
|
91
|
+
}, getDelay(e.type));
|
|
92
|
+
};
|
|
93
|
+
const onPopoverOpenChange = (e, data)=>{
|
|
94
|
+
if (!data.open) {
|
|
95
|
+
// We set all open state to false if preventDefaultClose was not set to true
|
|
96
|
+
if (!preventDefaultClose.current) {
|
|
97
|
+
clearTimeout();
|
|
98
|
+
citationInternalState.openByClick = false;
|
|
99
|
+
citationInternalState.openByHoverOverCitation = false;
|
|
100
|
+
citationInternalState.openByHoverOverPopover = false;
|
|
101
|
+
citationInternalState.openByKeyboard = false;
|
|
102
|
+
// use isOpen if managing owned popover, otherwise use data.open
|
|
103
|
+
const open = popover ? isOpen() : data.open;
|
|
104
|
+
setIsPopoverOpen(open);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
preventDefaultClose.current = false;
|
|
108
|
+
};
|
|
109
|
+
// hitting escape should close the popover if it was opened by hover
|
|
110
|
+
// this is necessary to attach to the document because focus is likely not within the citation or popover
|
|
111
|
+
(0, _reactcomponents.useIsomorphicLayoutEffect)(()=>{
|
|
112
|
+
if (isPopoverOpen) {
|
|
113
|
+
const onDocumentKeyDown = (e)=>{
|
|
114
|
+
const openedByHover = !citationInternalState.openByClick && !citationInternalState.openByKeyboard;
|
|
115
|
+
if (openedByHover && e.key === _keyboardkeys.Escape) {
|
|
116
|
+
clearTimeout();
|
|
117
|
+
// We set state back to its default if the Escape key has been pressed
|
|
118
|
+
setDisableAutoFocus(true);
|
|
119
|
+
citationInternalState.openByClick = false;
|
|
120
|
+
citationInternalState.openByHoverOverCitation = false;
|
|
121
|
+
citationInternalState.openByHoverOverPopover = false;
|
|
122
|
+
citationInternalState.openByKeyboard = false;
|
|
123
|
+
setIsPopoverOpen(isOpen());
|
|
124
|
+
e.stopPropagation();
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.addEventListener('keydown', onDocumentKeyDown, {
|
|
128
|
+
capture: true
|
|
129
|
+
});
|
|
130
|
+
return ()=>{
|
|
131
|
+
targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.removeEventListener('keydown', onDocumentKeyDown, {
|
|
132
|
+
capture: true
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
}, [
|
|
137
|
+
targetDocument,
|
|
138
|
+
isPopoverOpen
|
|
139
|
+
]);
|
|
140
|
+
const isPopoverLocked = (0, _reactpreview.usePreviewContext_unstable)((ctx)=>ctx.isPreviewLocked) && props['aria-expanded'] || citationInternalState.openByClick || citationInternalState.openByKeyboard;
|
|
141
|
+
const state = {
|
|
142
|
+
block,
|
|
143
|
+
disableAutoFocus,
|
|
144
|
+
isPopoverOpen,
|
|
145
|
+
isPopoverLocked,
|
|
146
|
+
onPopoverOpenChange,
|
|
147
|
+
components: {
|
|
148
|
+
root: 'a',
|
|
149
|
+
popover: 'div',
|
|
150
|
+
popoverSurface: _reactcomponents.PopoverSurface
|
|
151
|
+
},
|
|
152
|
+
root: _reactcomponents.slot.always((0, _reactcomponents.getNativeElementProps)('a', {
|
|
153
|
+
ref,
|
|
154
|
+
href: referenceHref,
|
|
155
|
+
role: null,
|
|
156
|
+
'aria-expanded': null,
|
|
157
|
+
...otherProps
|
|
158
|
+
}), {
|
|
159
|
+
elementType: 'a'
|
|
160
|
+
}),
|
|
161
|
+
popover: _reactcomponents.slot.optional(popover, {
|
|
162
|
+
elementType: 'div'
|
|
163
|
+
}),
|
|
164
|
+
popoverSurface: _reactcomponents.slot.optional(popoverSurface, {
|
|
165
|
+
defaultProps: {
|
|
166
|
+
id: popoverId,
|
|
167
|
+
'aria-labelledby': popoverId
|
|
168
|
+
},
|
|
169
|
+
elementType: _reactcomponents.PopoverSurface,
|
|
170
|
+
renderByDefault: true
|
|
171
|
+
})
|
|
172
|
+
};
|
|
173
|
+
// attach popover handling events only if a popover is present
|
|
174
|
+
if (state.popover) {
|
|
175
|
+
state.root.onMouseEnter = (0, _reactcomponents.mergeCallbacks)(state.root.onMouseEnter, handleCitationTargetEnter);
|
|
176
|
+
state.root.onMouseLeave = (0, _reactcomponents.mergeCallbacks)(state.root.onMouseLeave, handleCitationTargetLeave);
|
|
177
|
+
state.root.onBlur = (0, _reactcomponents.mergeCallbacks)(state.root.onBlur, handleCitationTargetLeave);
|
|
178
|
+
state.root.onClick = (0, _reactcomponents.mergeCallbacks)(state.root.onClick, handleCitationClick);
|
|
179
|
+
state.root.onKeyDown = (0, _reactcomponents.mergeCallbacks)(state.root.onKeyDown, handleCitationKeyDown);
|
|
180
|
+
state.popover.onMouseEnter = (0, _reactcomponents.mergeCallbacks)(state.popover.onMouseEnter, handlePopoverTargetEnter);
|
|
181
|
+
state.popover.onMouseLeave = (0, _reactcomponents.mergeCallbacks)(state.popover.onMouseLeave, handlePopoverTargetLeave);
|
|
182
|
+
state.popover.onFocus = (0, _reactcomponents.mergeCallbacks)(state.popover.onFocus, handlePopoverTargetEnter);
|
|
183
|
+
}
|
|
184
|
+
return state;
|
|
185
|
+
}; //# sourceMappingURL=useCitation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useCitation.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, PopoverSurface, mergeCallbacks, slot, useFluent, useId, useIsomorphicLayoutEffect } from '@fluentui/react-components';\nimport { Enter, Escape } from '@fluentui/keyboard-keys';\nimport { useTimeout } from '@fluentui/react-utilities';\nimport { usePreviewContext_unstable } from '@fluentui-copilot/react-preview';\nconst POPOVER_MOUSE_HIDE_DELAY = 500;\nconst POPOVER_KEYBOARD_HIDE_DELAY = 0;\nconst getDelay = type => {\n if (type === 'focus' || type === 'blur') {\n return POPOVER_KEYBOARD_HIDE_DELAY;\n }\n return POPOVER_MOUSE_HIDE_DELAY;\n};\n/**\n * Create the state required to render Citation.\n *\n * The returned state can be modified with hooks such as useCitationStyles_unstable,\n * before being passed to renderCitation_unstable.\n *\n * @param props - props from this instance of Citation\n * @param ref - reference to root HTMLElement of Citation\n */\nexport const useCitation_unstable = (props, ref) => {\n const {\n popover,\n popoverSurface,\n referenceHref,\n block = false,\n ...otherProps\n } = props;\n const {\n targetDocument\n } = useFluent();\n const [setTimeout, clearTimeout] = useTimeout();\n const popoverId = useId('citation-popover-');\n const [disableAutoFocus, setDisableAutoFocus] = React.useState(true);\n const {\n current: citationInternalState\n } = React.useRef({\n openByClick: false,\n openByHoverOverCitation: false,\n openByHoverOverPopover: false,\n openByKeyboard: false\n });\n const isOpen = () => {\n return citationInternalState.openByClick || citationInternalState.openByHoverOverCitation || citationInternalState.openByHoverOverPopover || citationInternalState.openByKeyboard;\n };\n const [isPopoverOpen, setIsPopoverOpen] = React.useState(false);\n const preventDefaultClose = React.useRef(false);\n const handleCitationTargetEnter = e => {\n citationInternalState.openByHoverOverCitation = true;\n // We want to disable auto focus only if the popover is being opened by hovering over the citation\n if (!citationInternalState.openByClick && !citationInternalState.openByKeyboard) {\n setDisableAutoFocus(true);\n }\n setIsPopoverOpen(isOpen());\n };\n const handleCitationTargetLeave = e => {\n citationInternalState.openByHoverOverCitation = false;\n setTimeout(() => {\n setIsPopoverOpen(isOpen());\n }, getDelay(e.type));\n };\n const handleCitationClick = e => {\n // Setting preventDefaultClose so that onPopoverOpenChange does not apply its logic when click is on the citation as we want to control that behavior.\n preventDefaultClose.current = true;\n // We set disableAutoFocus to false so that interactive elements within popover can be focused when it opens via click.\n setDisableAutoFocus(false);\n // If openByKeyboard is true, then the popover was already opened via keyboard and we always want to close it.\n citationInternalState.openByClick = citationInternalState.openByKeyboard ? false : !citationInternalState.openByClick;\n citationInternalState.openByHoverOverCitation = false;\n citationInternalState.openByHoverOverPopover = false;\n citationInternalState.openByKeyboard = false;\n setIsPopoverOpen(isOpen());\n };\n const handleCitationKeyDown = e => {\n if (e.key === Enter) {\n clearTimeout();\n // Setting default prevented so the enter key does not trigger a click event or onPopoverOpenChange.\n e.preventDefault();\n // We set disableAutoFocus to false so that interactive elements within popover can be focused when it opens via keyboard.\n setDisableAutoFocus(false);\n // If openByClick is true, then the popover was already opened via click and we always want to close it.\n citationInternalState.openByKeyboard = citationInternalState.openByClick ? false : !citationInternalState.openByKeyboard;\n citationInternalState.openByClick = false;\n citationInternalState.openByHoverOverCitation = false;\n citationInternalState.openByHoverOverPopover = false;\n setIsPopoverOpen(isOpen());\n }\n };\n const handlePopoverTargetEnter = e => {\n citationInternalState.openByHoverOverPopover = true;\n setIsPopoverOpen(isOpen());\n };\n const handlePopoverTargetLeave = e => {\n citationInternalState.openByHoverOverPopover = false;\n setTimeout(() => {\n setIsPopoverOpen(isOpen());\n }, getDelay(e.type));\n };\n const onPopoverOpenChange = (e, data) => {\n if (!data.open) {\n // We set all open state to false if preventDefaultClose was not set to true\n if (!preventDefaultClose.current) {\n clearTimeout();\n citationInternalState.openByClick = false;\n citationInternalState.openByHoverOverCitation = false;\n citationInternalState.openByHoverOverPopover = false;\n citationInternalState.openByKeyboard = false;\n // use isOpen if managing owned popover, otherwise use data.open\n const open = popover ? isOpen() : data.open;\n setIsPopoverOpen(open);\n }\n }\n preventDefaultClose.current = false;\n };\n // hitting escape should close the popover if it was opened by hover\n // this is necessary to attach to the document because focus is likely not within the citation or popover\n useIsomorphicLayoutEffect(() => {\n if (isPopoverOpen) {\n const onDocumentKeyDown = e => {\n const openedByHover = !citationInternalState.openByClick && !citationInternalState.openByKeyboard;\n if (openedByHover && e.key === Escape) {\n clearTimeout();\n // We set state back to its default if the Escape key has been pressed\n setDisableAutoFocus(true);\n citationInternalState.openByClick = false;\n citationInternalState.openByHoverOverCitation = false;\n citationInternalState.openByHoverOverPopover = false;\n citationInternalState.openByKeyboard = false;\n setIsPopoverOpen(isOpen());\n e.stopPropagation();\n }\n };\n targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.addEventListener('keydown', onDocumentKeyDown, {\n capture: true\n });\n return () => {\n targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.removeEventListener('keydown', onDocumentKeyDown, {\n capture: true\n });\n };\n }\n }, [targetDocument, isPopoverOpen]);\n const isPopoverLocked = usePreviewContext_unstable(ctx => ctx.isPreviewLocked) && props['aria-expanded'] || citationInternalState.openByClick || citationInternalState.openByKeyboard;\n const state = {\n block,\n disableAutoFocus,\n isPopoverOpen,\n isPopoverLocked,\n onPopoverOpenChange,\n components: {\n root: 'a',\n popover: 'div',\n popoverSurface: PopoverSurface\n },\n root: slot.always(getNativeElementProps('a', {\n ref,\n href: referenceHref,\n role: null,\n 'aria-expanded': null,\n ...otherProps\n }), {\n elementType: 'a'\n }),\n popover: slot.optional(popover, {\n elementType: 'div'\n }),\n popoverSurface: slot.optional(popoverSurface, {\n defaultProps: {\n id: popoverId,\n 'aria-labelledby': popoverId\n },\n elementType: PopoverSurface,\n renderByDefault: true\n })\n };\n // attach popover handling events only if a popover is present\n if (state.popover) {\n state.root.onMouseEnter = mergeCallbacks(state.root.onMouseEnter, handleCitationTargetEnter);\n state.root.onMouseLeave = mergeCallbacks(state.root.onMouseLeave, handleCitationTargetLeave);\n state.root.onBlur = mergeCallbacks(state.root.onBlur, handleCitationTargetLeave);\n state.root.onClick = mergeCallbacks(state.root.onClick, handleCitationClick);\n state.root.onKeyDown = mergeCallbacks(state.root.onKeyDown, handleCitationKeyDown);\n state.popover.onMouseEnter = mergeCallbacks(state.popover.onMouseEnter, handlePopoverTargetEnter);\n state.popover.onMouseLeave = mergeCallbacks(state.popover.onMouseLeave, handlePopoverTargetLeave);\n state.popover.onFocus = mergeCallbacks(state.popover.onFocus, handlePopoverTargetEnter);\n }\n return state;\n};\n//# sourceMappingURL=useCitation.js.map"],"names":["useCitation_unstable","POPOVER_MOUSE_HIDE_DELAY","POPOVER_KEYBOARD_HIDE_DELAY","getDelay","type","props","ref","popover","popoverSurface","referenceHref","block","otherProps","targetDocument","useFluent","setTimeout","clearTimeout","useTimeout","popoverId","useId","disableAutoFocus","setDisableAutoFocus","React","useState","current","citationInternalState","useRef","openByClick","openByHoverOverCitation","openByHoverOverPopover","openByKeyboard","isOpen","isPopoverOpen","setIsPopoverOpen","preventDefaultClose","handleCitationTargetEnter","e","handleCitationTargetLeave","handleCitationClick","handleCitationKeyDown","key","Enter","preventDefault","handlePopoverTargetEnter","handlePopoverTargetLeave","onPopoverOpenChange","data","open","useIsomorphicLayoutEffect","onDocumentKeyDown","openedByHover","Escape","stopPropagation","addEventListener","capture","removeEventListener","isPopoverLocked","usePreviewContext_unstable","ctx","isPreviewLocked","state","components","root","PopoverSurface","slot","always","getNativeElementProps","href","role","elementType","optional","defaultProps","id","renderByDefault","onMouseEnter","mergeCallbacks","onMouseLeave","onBlur","onClick","onKeyDown","onFocus"],"mappings":"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"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
citationClassNames: function() {
|
|
13
|
+
return citationClassNames;
|
|
14
|
+
},
|
|
15
|
+
useCitationStyles_unstable: function() {
|
|
16
|
+
return useCitationStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const citationClassNames = {
|
|
21
|
+
root: 'fai-Citation',
|
|
22
|
+
popover: 'fai-Citation__popover',
|
|
23
|
+
popoverSurface: 'fai-Citation__popoverSurface'
|
|
24
|
+
};
|
|
25
|
+
const useCitationBaseClassName = (0, _reactcomponents.__resetStyles)("rad2akz", "r1hx2d32", [
|
|
26
|
+
".rad2akz{display:inline-flex;justify-content:center;box-sizing:border-box;align-items:center;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase100);font-weight:var(--fontWeightSemibold);line-height:var(--lineHeightBase100);color:var(--colorNeutralForeground2);border:var(--strokeWidthThin) solid var(--colorNeutralStroke2);min-width:14px;height:14px;vertical-align:calc((var(--lineHeightBase100) - var(--fontSizeBase100)) / 2);border-radius:var(--borderRadiusMedium);text-decoration:none;margin-left:var(--spacingHorizontalXXS);margin-right:var(--spacingHorizontalXXS);}",
|
|
27
|
+
".rad2akz:hover{cursor:pointer;color:var(--colorBrandForeground2Hover);border-color:var(--colorBrandStroke2Hover);background-color:var(--colorBrandBackground2Hover);}",
|
|
28
|
+
".rad2akz:hover:active{cursor:pointer;color:var(--colorBrandForeground2Pressed);border-color:var(--colorBrandStroke2Pressed);background-color:var(--colorBrandBackground2Pressed);}",
|
|
29
|
+
".r1hx2d32{display:inline-flex;justify-content:center;box-sizing:border-box;align-items:center;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase100);font-weight:var(--fontWeightSemibold);line-height:var(--lineHeightBase100);color:var(--colorNeutralForeground2);border:var(--strokeWidthThin) solid var(--colorNeutralStroke2);min-width:14px;height:14px;vertical-align:calc((var(--lineHeightBase100) - var(--fontSizeBase100)) / 2);border-radius:var(--borderRadiusMedium);text-decoration:none;margin-right:var(--spacingHorizontalXXS);margin-left:var(--spacingHorizontalXXS);}",
|
|
30
|
+
".r1hx2d32:hover{cursor:pointer;color:var(--colorBrandForeground2Hover);border-color:var(--colorBrandStroke2Hover);background-color:var(--colorBrandBackground2Hover);}",
|
|
31
|
+
".r1hx2d32:hover:active{cursor:pointer;color:var(--colorBrandForeground2Pressed);border-color:var(--colorBrandStroke2Pressed);background-color:var(--colorBrandBackground2Pressed);}"
|
|
32
|
+
]);
|
|
33
|
+
const useCitationRootStyles = (0, _reactcomponents.__styles)({
|
|
34
|
+
isBlock: {
|
|
35
|
+
mc9l5x: "f22iagw",
|
|
36
|
+
Frg6f3: [
|
|
37
|
+
"f1tyq0we",
|
|
38
|
+
"f11qmguv"
|
|
39
|
+
],
|
|
40
|
+
t21cq0: [
|
|
41
|
+
"f11qmguv",
|
|
42
|
+
"f1tyq0we"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
isPopoverLocked: {
|
|
46
|
+
sj55zd: "fkjhhq2",
|
|
47
|
+
g2u3we: "f1nbqb3e",
|
|
48
|
+
h3c5rm: [
|
|
49
|
+
"fah3j9v",
|
|
50
|
+
"f56crja"
|
|
51
|
+
],
|
|
52
|
+
B9xav0g: "fef4ti1",
|
|
53
|
+
zhjwy3: [
|
|
54
|
+
"f56crja",
|
|
55
|
+
"fah3j9v"
|
|
56
|
+
],
|
|
57
|
+
De3pzq: "f16xkysk",
|
|
58
|
+
Bi91k9c: "fbszb7v",
|
|
59
|
+
Bgoe8wy: "ftxwbyd",
|
|
60
|
+
Bwzppfd: [
|
|
61
|
+
"f1p7dilp",
|
|
62
|
+
"f15x2k42"
|
|
63
|
+
],
|
|
64
|
+
oetu4i: "fegdlwn",
|
|
65
|
+
gg5e9n: [
|
|
66
|
+
"f15x2k42",
|
|
67
|
+
"f1p7dilp"
|
|
68
|
+
],
|
|
69
|
+
Jwef8y: "f121v1wq"
|
|
70
|
+
}
|
|
71
|
+
}, {
|
|
72
|
+
d: [
|
|
73
|
+
".f22iagw{display:flex;}",
|
|
74
|
+
".f1tyq0we{margin-left:0;}",
|
|
75
|
+
".f11qmguv{margin-right:0;}",
|
|
76
|
+
".fkjhhq2{color:var(--colorBrandForeground2Pressed);}",
|
|
77
|
+
".f1nbqb3e{border-top-color:var(--colorBrandStroke2Pressed);}",
|
|
78
|
+
".fah3j9v{border-right-color:var(--colorBrandStroke2Pressed);}",
|
|
79
|
+
".f56crja{border-left-color:var(--colorBrandStroke2Pressed);}",
|
|
80
|
+
".fef4ti1{border-bottom-color:var(--colorBrandStroke2Pressed);}",
|
|
81
|
+
".f16xkysk{background-color:var(--colorBrandBackground2);}"
|
|
82
|
+
],
|
|
83
|
+
h: [
|
|
84
|
+
".fbszb7v:hover{color:var(--colorBrandForeground2Pressed);}",
|
|
85
|
+
".ftxwbyd:hover{border-top-color:var(--colorBrandStroke2Pressed);}",
|
|
86
|
+
".f1p7dilp:hover{border-right-color:var(--colorBrandStroke2Pressed);}",
|
|
87
|
+
".f15x2k42:hover{border-left-color:var(--colorBrandStroke2Pressed);}",
|
|
88
|
+
".fegdlwn:hover{border-bottom-color:var(--colorBrandStroke2Pressed);}",
|
|
89
|
+
".f121v1wq:hover{background-color:var(--colorBrandBackground2);}"
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
const useCitationStyles_unstable = (state)=>{
|
|
93
|
+
const rootBaseClassName = useCitationBaseClassName();
|
|
94
|
+
const rootStyles = useCitationRootStyles();
|
|
95
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(citationClassNames.root, state.isPopoverLocked && rootStyles.isPopoverLocked, state.block && rootStyles.isBlock, rootBaseClassName, state.root.className);
|
|
96
|
+
if (state.popover) {
|
|
97
|
+
state.popover.className = (0, _reactcomponents.mergeClasses)(citationClassNames.popover, state.popover.className);
|
|
98
|
+
}
|
|
99
|
+
return state;
|
|
100
|
+
}; //# sourceMappingURL=useCitationStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useCitationStyles.js"],"sourcesContent":["import { __resetStyles, __styles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';\nexport const citationClassNames = {\n root: 'fai-Citation',\n popover: 'fai-Citation__popover',\n popoverSurface: 'fai-Citation__popoverSurface'\n};\nconst useCitationBaseClassName = __resetStyles(\"rad2akz\", \"r1hx2d32\", [\".rad2akz{display:inline-flex;justify-content:center;box-sizing:border-box;align-items:center;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase100);font-weight:var(--fontWeightSemibold);line-height:var(--lineHeightBase100);color:var(--colorNeutralForeground2);border:var(--strokeWidthThin) solid var(--colorNeutralStroke2);min-width:14px;height:14px;vertical-align:calc((var(--lineHeightBase100) - var(--fontSizeBase100)) / 2);border-radius:var(--borderRadiusMedium);text-decoration:none;margin-left:var(--spacingHorizontalXXS);margin-right:var(--spacingHorizontalXXS);}\", \".rad2akz:hover{cursor:pointer;color:var(--colorBrandForeground2Hover);border-color:var(--colorBrandStroke2Hover);background-color:var(--colorBrandBackground2Hover);}\", \".rad2akz:hover:active{cursor:pointer;color:var(--colorBrandForeground2Pressed);border-color:var(--colorBrandStroke2Pressed);background-color:var(--colorBrandBackground2Pressed);}\", \".r1hx2d32{display:inline-flex;justify-content:center;box-sizing:border-box;align-items:center;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase100);font-weight:var(--fontWeightSemibold);line-height:var(--lineHeightBase100);color:var(--colorNeutralForeground2);border:var(--strokeWidthThin) solid var(--colorNeutralStroke2);min-width:14px;height:14px;vertical-align:calc((var(--lineHeightBase100) - var(--fontSizeBase100)) / 2);border-radius:var(--borderRadiusMedium);text-decoration:none;margin-right:var(--spacingHorizontalXXS);margin-left:var(--spacingHorizontalXXS);}\", \".r1hx2d32:hover{cursor:pointer;color:var(--colorBrandForeground2Hover);border-color:var(--colorBrandStroke2Hover);background-color:var(--colorBrandBackground2Hover);}\", \".r1hx2d32:hover:active{cursor:pointer;color:var(--colorBrandForeground2Pressed);border-color:var(--colorBrandStroke2Pressed);background-color:var(--colorBrandBackground2Pressed);}\"]);\nconst useCitationRootStyles = __styles({\n isBlock: {\n mc9l5x: \"f22iagw\",\n Frg6f3: [\"f1tyq0we\", \"f11qmguv\"],\n t21cq0: [\"f11qmguv\", \"f1tyq0we\"]\n },\n isPopoverLocked: {\n sj55zd: \"fkjhhq2\",\n g2u3we: \"f1nbqb3e\",\n h3c5rm: [\"fah3j9v\", \"f56crja\"],\n B9xav0g: \"fef4ti1\",\n zhjwy3: [\"f56crja\", \"fah3j9v\"],\n De3pzq: \"f16xkysk\",\n Bi91k9c: \"fbszb7v\",\n Bgoe8wy: \"ftxwbyd\",\n Bwzppfd: [\"f1p7dilp\", \"f15x2k42\"],\n oetu4i: \"fegdlwn\",\n gg5e9n: [\"f15x2k42\", \"f1p7dilp\"],\n Jwef8y: \"f121v1wq\"\n }\n}, {\n d: [\".f22iagw{display:flex;}\", \".f1tyq0we{margin-left:0;}\", \".f11qmguv{margin-right:0;}\", \".fkjhhq2{color:var(--colorBrandForeground2Pressed);}\", \".f1nbqb3e{border-top-color:var(--colorBrandStroke2Pressed);}\", \".fah3j9v{border-right-color:var(--colorBrandStroke2Pressed);}\", \".f56crja{border-left-color:var(--colorBrandStroke2Pressed);}\", \".fef4ti1{border-bottom-color:var(--colorBrandStroke2Pressed);}\", \".f16xkysk{background-color:var(--colorBrandBackground2);}\"],\n h: [\".fbszb7v:hover{color:var(--colorBrandForeground2Pressed);}\", \".ftxwbyd:hover{border-top-color:var(--colorBrandStroke2Pressed);}\", \".f1p7dilp:hover{border-right-color:var(--colorBrandStroke2Pressed);}\", \".f15x2k42:hover{border-left-color:var(--colorBrandStroke2Pressed);}\", \".fegdlwn:hover{border-bottom-color:var(--colorBrandStroke2Pressed);}\", \".f121v1wq:hover{background-color:var(--colorBrandBackground2);}\"]\n});\n/**\n * Apply styling to the Citation slots based on the state\n */\nexport const useCitationStyles_unstable = state => {\n const rootBaseClassName = useCitationBaseClassName();\n const rootStyles = useCitationRootStyles();\n state.root.className = mergeClasses(citationClassNames.root, state.isPopoverLocked && rootStyles.isPopoverLocked, state.block && rootStyles.isBlock, rootBaseClassName, state.root.className);\n if (state.popover) {\n state.popover.className = mergeClasses(citationClassNames.popover, state.popover.className);\n }\n return state;\n};\n//# sourceMappingURL=useCitationStyles.js.map"],"names":["citationClassNames","useCitationStyles_unstable","root","popover","popoverSurface","useCitationBaseClassName","__resetStyles","useCitationRootStyles","__styles","isBlock","mc9l5x","Frg6f3","t21cq0","isPopoverLocked","sj55zd","g2u3we","h3c5rm","B9xav0g","zhjwy3","De3pzq","Bi91k9c","Bgoe8wy","Bwzppfd","oetu4i","gg5e9n","Jwef8y","d","h","state","rootBaseClassName","rootStyles","className","mergeClasses","block"],"mappings":";;;;;;;;;;;IACaA,kBAAkB;eAAlBA;;IAiCAC,0BAA0B;eAA1BA;;;iCAlC+E;AACrF,MAAMD,qBAAqB;IAChCE,MAAM;IACNC,SAAS;IACTC,gBAAgB;AAClB;AACA,MAAMC,2BAA2BC,IAAAA,8BAAa,EAAC,WAAW,YAAY;IAAC;IAA0kB;IAAyK;IAAsL;IAA2kB;IAA0K;CAAsL;AAC35D,MAAMC,wBAAwBC,IAAAA,yBAAQ,EAAC;IACrCC,SAAS;QACPC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAW;QAChCC,QAAQ;YAAC;YAAY;SAAW;IAClC;IACAC,iBAAiB;QACfC,QAAQ;QACRC,QAAQ;QACRC,QAAQ;YAAC;YAAW;SAAU;QAC9BC,SAAS;QACTC,QAAQ;YAAC;YAAW;SAAU;QAC9BC,QAAQ;QACRC,SAAS;QACTC,SAAS;QACTC,SAAS;YAAC;YAAY;SAAW;QACjCC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAW;QAChCC,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;QAA2B;QAA6B;QAA8B;QAAwD;QAAgE;QAAiE;QAAgE;QAAkE;KAA4D;IACjdC,GAAG;QAAC;QAA8D;QAAqE;QAAwE;QAAuE;QAAwE;KAAkE;AACla;AAIO,MAAM1B,6BAA6B2B,CAAAA;IACxC,MAAMC,oBAAoBxB;IAC1B,MAAMyB,aAAavB;IACnBqB,MAAM1B,IAAI,CAAC6B,SAAS,GAAGC,IAAAA,6BAAY,EAAChC,mBAAmBE,IAAI,EAAE0B,MAAMf,eAAe,IAAIiB,WAAWjB,eAAe,EAAEe,MAAMK,KAAK,IAAIH,WAAWrB,OAAO,EAAEoB,mBAAmBD,MAAM1B,IAAI,CAAC6B,SAAS;IAC5L,IAAIH,MAAMzB,OAAO,EAAE;QACjByB,MAAMzB,OAAO,CAAC4B,SAAS,GAAGC,IAAAA,6BAAY,EAAChC,mBAAmBG,OAAO,EAAEyB,MAAMzB,OAAO,CAAC4B,SAAS;IAC5F;IACA,OAAOH;AACT,GACA,6CAA6C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "Reference", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return Reference;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _useReference = require("./useReference");
|
|
14
|
+
const _renderReference = require("./renderReference");
|
|
15
|
+
const _useReferenceStyles = require("./useReferenceStyles");
|
|
16
|
+
const _reactprovider = require("@fluentui-copilot/react-provider");
|
|
17
|
+
const Reference = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
18
|
+
const state = (0, _useReference.useReference_unstable)(props, ref);
|
|
19
|
+
(0, _useReferenceStyles.useReferenceStyles_unstable)(state);
|
|
20
|
+
(0, _reactprovider.useCustomStyleHook)('useReferenceStyles')(state);
|
|
21
|
+
return (0, _renderReference.renderReference_unstable)(state);
|
|
22
|
+
});
|
|
23
|
+
Reference.displayName = 'Reference'; //# sourceMappingURL=Reference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Reference.js"],"sourcesContent":["import * as React from 'react';\nimport { useReference_unstable } from './useReference';\nimport { renderReference_unstable } from './renderReference';\nimport { useReferenceStyles_unstable } from './useReferenceStyles';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\n// Reference component - TODO: add more docs\nexport const Reference = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useReference_unstable(props, ref);\n useReferenceStyles_unstable(state);\n useCustomStyleHook('useReferenceStyles')(state);\n return renderReference_unstable(state);\n});\nReference.displayName = 'Reference';\n//# sourceMappingURL=Reference.js.map"],"names":["Reference","React","forwardRef","props","ref","state","useReference_unstable","useReferenceStyles_unstable","useCustomStyleHook","renderReference_unstable","displayName"],"mappings":";;;;+BAMaA;;;eAAAA;;;;iEANU;8BACe;iCACG;oCACG;+BACT;AAE5B,MAAMA,YAAY,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC7D,MAAMC,QAAQC,IAAAA,mCAAqB,EAACH,OAAOC;IAC3CG,IAAAA,+CAA2B,EAACF;IAC5BG,IAAAA,iCAAkB,EAAC,sBAAsBH;IACzC,OAAOI,IAAAA,yCAAwB,EAACJ;AAClC;AACAL,UAAUU,WAAW,GAAG,aACxB,qCAAqC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Reference.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=Reference.types.js.map"],"names":[],"mappings":";;;;CACA,2CAA2C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
|
6
|
+
_export_star._(require("./Reference"), exports);
|
|
7
|
+
_export_star._(require("./Reference.types"), exports);
|
|
8
|
+
_export_star._(require("./renderReference"), exports);
|
|
9
|
+
_export_star._(require("./useReference"), exports);
|
|
10
|
+
_export_star._(require("./useReferenceStyles"), exports);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './Reference';\nexport * from './Reference.types';\nexport * from './renderReference';\nexport * from './useReference';\nexport * from './useReferenceStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA;CACd,iCAAiC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderReference_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return renderReference_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
12
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
13
|
+
const renderReference_unstable = (state)=>{
|
|
14
|
+
(0, _reactcomponents.assertSlots)(state);
|
|
15
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
|
|
16
|
+
children: [
|
|
17
|
+
state.citation && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.citation, {}),
|
|
18
|
+
state.media && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.media, {}),
|
|
19
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.label, {}),
|
|
20
|
+
state.actions && /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.actions, {
|
|
21
|
+
children: [
|
|
22
|
+
state.actions.children,
|
|
23
|
+
state.detailsButton && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.detailsButton, {})
|
|
24
|
+
]
|
|
25
|
+
}),
|
|
26
|
+
state.sensitivityLabel && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.sensitivityLabel, {}),
|
|
27
|
+
state.sensitivity && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.sensitivity, {}),
|
|
28
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(state.metadata, {
|
|
29
|
+
children: [
|
|
30
|
+
state.primaryText && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.primaryText, {}),
|
|
31
|
+
state.secondaryText && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.secondaryText, {}),
|
|
32
|
+
state.tertiaryText && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.tertiaryText, {}),
|
|
33
|
+
state.icon && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.icon, {}),
|
|
34
|
+
state.metadata.children
|
|
35
|
+
]
|
|
36
|
+
}),
|
|
37
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.content, {})
|
|
38
|
+
]
|
|
39
|
+
});
|
|
40
|
+
}; //# sourceMappingURL=renderReference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderReference.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-components';\n/**\n * Render the final JSX of Reference\n */\nexport const renderReference_unstable = state => {\n assertSlots(state);\n return /*#__PURE__*/_jsxs(state.root, {\n children: [state.citation && /*#__PURE__*/_jsx(state.citation, {}), state.media && /*#__PURE__*/_jsx(state.media, {}), /*#__PURE__*/_jsx(state.label, {}), state.actions && /*#__PURE__*/_jsxs(state.actions, {\n children: [state.actions.children, state.detailsButton && /*#__PURE__*/_jsx(state.detailsButton, {})]\n }), state.sensitivityLabel && /*#__PURE__*/_jsx(state.sensitivityLabel, {}), state.sensitivity && /*#__PURE__*/_jsx(state.sensitivity, {}), /*#__PURE__*/_jsxs(state.metadata, {\n children: [state.primaryText && /*#__PURE__*/_jsx(state.primaryText, {}), state.secondaryText && /*#__PURE__*/_jsx(state.secondaryText, {}), state.tertiaryText && /*#__PURE__*/_jsx(state.tertiaryText, {}), state.icon && /*#__PURE__*/_jsx(state.icon, {}), state.metadata.children]\n }), /*#__PURE__*/_jsx(state.content, {})]\n });\n};\n//# sourceMappingURL=renderReference.js.map"],"names":["renderReference_unstable","state","assertSlots","_jsxs","root","children","citation","_jsx","media","label","actions","detailsButton","sensitivityLabel","sensitivity","metadata","primaryText","secondaryText","tertiaryText","icon","content"],"mappings":";;;;+BAKaA;;;eAAAA;;;4BAL8B;iCACf;AAIrB,MAAMA,2BAA2BC,CAAAA;IACtCC,IAAAA,4BAAW,EAACD;IACZ,OAAO,WAAW,GAAEE,IAAAA,gBAAK,EAACF,MAAMG,IAAI,EAAE;QACpCC,UAAU;YAACJ,MAAMK,QAAQ,IAAI,WAAW,GAAEC,IAAAA,eAAI,EAACN,MAAMK,QAAQ,EAAE,CAAC;YAAIL,MAAMO,KAAK,IAAI,WAAW,GAAED,IAAAA,eAAI,EAACN,MAAMO,KAAK,EAAE,CAAC;YAAI,WAAW,GAAED,IAAAA,eAAI,EAACN,MAAMQ,KAAK,EAAE,CAAC;YAAIR,MAAMS,OAAO,IAAI,WAAW,GAAEP,IAAAA,gBAAK,EAACF,MAAMS,OAAO,EAAE;gBAC5ML,UAAU;oBAACJ,MAAMS,OAAO,CAACL,QAAQ;oBAAEJ,MAAMU,aAAa,IAAI,WAAW,GAAEJ,IAAAA,eAAI,EAACN,MAAMU,aAAa,EAAE,CAAC;iBAAG;YACvG;YAAIV,MAAMW,gBAAgB,IAAI,WAAW,GAAEL,IAAAA,eAAI,EAACN,MAAMW,gBAAgB,EAAE,CAAC;YAAIX,MAAMY,WAAW,IAAI,WAAW,GAAEN,IAAAA,eAAI,EAACN,MAAMY,WAAW,EAAE,CAAC;YAAI,WAAW,GAAEV,IAAAA,gBAAK,EAACF,MAAMa,QAAQ,EAAE;gBAC7KT,UAAU;oBAACJ,MAAMc,WAAW,IAAI,WAAW,GAAER,IAAAA,eAAI,EAACN,MAAMc,WAAW,EAAE,CAAC;oBAAId,MAAMe,aAAa,IAAI,WAAW,GAAET,IAAAA,eAAI,EAACN,MAAMe,aAAa,EAAE,CAAC;oBAAIf,MAAMgB,YAAY,IAAI,WAAW,GAAEV,IAAAA,eAAI,EAACN,MAAMgB,YAAY,EAAE,CAAC;oBAAIhB,MAAMiB,IAAI,IAAI,WAAW,GAAEX,IAAAA,eAAI,EAACN,MAAMiB,IAAI,EAAE,CAAC;oBAAIjB,MAAMa,QAAQ,CAACT,QAAQ;iBAAC;YACzR;YAAI,WAAW,GAAEE,IAAAA,eAAI,EAACN,MAAMkB,OAAO,EAAE,CAAC;SAAG;IAC3C;AACF,GACA,2CAA2C"}
|