@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
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
import type { Button } from '@fluentui/react-components';
|
|
2
|
+
import type { ComponentProps } from '@fluentui/react-components';
|
|
3
|
+
import type { ComponentState } from '@fluentui/react-components';
|
|
4
|
+
import type { ForwardRefComponent } from '@fluentui/react-components';
|
|
5
|
+
import type { OnOpenChangeData } from '@fluentui/react-components';
|
|
6
|
+
import type { OpenPopoverEvents } from '@fluentui/react-components';
|
|
7
|
+
import type { PopoverProps } from '@fluentui/react-components';
|
|
8
|
+
import type { PopoverSurface } from '@fluentui/react-components';
|
|
9
|
+
import type { PopoverSurfaceProps } from '@fluentui/react-components';
|
|
10
|
+
import type { PopoverSurfaceSlots } from '@fluentui/react-components';
|
|
11
|
+
import * as React_2 from 'react';
|
|
12
|
+
import type { Slot } from '@fluentui/react-components';
|
|
13
|
+
import type { SlotClassNames } from '@fluentui/react-components';
|
|
14
|
+
|
|
15
|
+
export declare const Citation: ForwardRefComponent<CitationProps>;
|
|
16
|
+
|
|
17
|
+
export declare const citationClassNames: SlotClassNames<CitationSlots>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Citation Props
|
|
21
|
+
*/
|
|
22
|
+
export declare type CitationProps = ComponentProps<Partial<CitationSlots>> & {
|
|
23
|
+
/**
|
|
24
|
+
* HREF to the associated `Reference`.
|
|
25
|
+
*/
|
|
26
|
+
referenceHref?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the citation is a block citation and has no built in margins.
|
|
29
|
+
* Citations are inline by default with margins to separate them from inline text.
|
|
30
|
+
*/
|
|
31
|
+
block?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Unique ID of the associated `Reference`.
|
|
34
|
+
* @deprecated No longer used.
|
|
35
|
+
*/
|
|
36
|
+
referenceId?: string;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export declare type CitationSlots = {
|
|
40
|
+
/**
|
|
41
|
+
* The root slot.
|
|
42
|
+
*/
|
|
43
|
+
root: NonNullable<Slot<'a'>>;
|
|
44
|
+
/**
|
|
45
|
+
* Popover slot. This will be displayed on hover/focus.
|
|
46
|
+
*
|
|
47
|
+
* @deprecated Use `Preview` component and `useReferenceCitationPreview` hook instead.
|
|
48
|
+
*/
|
|
49
|
+
popover?: Slot<'div'>;
|
|
50
|
+
/**
|
|
51
|
+
* PopoverSurface slot. This exposes the underlying PopoverSurface that is displayed on hover/focus.
|
|
52
|
+
*
|
|
53
|
+
* @deprecated Use `Preview` component and `useReferenceCitationPreview` hook instead.
|
|
54
|
+
*/
|
|
55
|
+
popoverSurface: Slot<typeof PopoverSurface>;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* State used in rendering Citation
|
|
60
|
+
*/
|
|
61
|
+
export declare type CitationState = ComponentState<CitationSlots> & Required<Pick<CitationProps, 'block'>> & {
|
|
62
|
+
disableAutoFocus: boolean;
|
|
63
|
+
isPopoverOpen: boolean;
|
|
64
|
+
isPopoverLocked: boolean;
|
|
65
|
+
onPopoverOpenChange: (e: OpenPopoverEvents, data: OnOpenChangeData) => void;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
declare type CopilotMode = {
|
|
69
|
+
mode?: 'canvas' | 'sidecar';
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* A "packaged Citation". A packaged Citation is a `Citation` that is
|
|
74
|
+
* pre-packaged with props set by the `useReferenceCitation` hook.
|
|
75
|
+
*
|
|
76
|
+
* @deprecated Use `useReferenceCitationPreview` hook instead.
|
|
77
|
+
*/
|
|
78
|
+
export declare type PackagedCitation = React_2.FC<PackagedCitationProps>;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* A "packaged Citation". A packaged Citation is a `Citation` that is
|
|
82
|
+
* pre-packaged with props set by the `useReferenceCitation` hook.
|
|
83
|
+
*/
|
|
84
|
+
declare type PackagedCitation_2 = React_2.FC<PackagedCitationProps_2>;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @deprecated Use `useReferenceCitationPreview` hook instead.
|
|
88
|
+
*/
|
|
89
|
+
declare type PackagedCitationPopover = React_2.FC<PackagedCitationPopoverProps>;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated Use `useReferenceCitationPreview` hook instead.
|
|
93
|
+
*/
|
|
94
|
+
declare type PackagedCitationPopoverProps = Omit<PackagedReferenceProps, 'layout'>;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Props for a "packaged Citation". A packaged Citation is a `Citation` that is
|
|
98
|
+
* pre-packaged with props set by the `useReferenceCitation` hook.
|
|
99
|
+
*
|
|
100
|
+
* @deprecated Use `useReferenceCitationPreview` hook instead.
|
|
101
|
+
*/
|
|
102
|
+
export declare type PackagedCitationProps = Omit<CitationProps, PartialCitationProps> & Partial<Pick<CitationProps, PartialCitationProps>>;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Props for a "packaged Citation". A packaged Citation is a `Citation` that is
|
|
106
|
+
* pre-packaged with props set by the `useReferenceCitation` hook.
|
|
107
|
+
*/
|
|
108
|
+
declare type PackagedCitationProps_2 = Omit<CitationProps, PartialCitationProps_2 | 'popover' | 'popoverSurface'> & Partial<Pick<CitationProps, PartialCitationProps_2>>;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* A "packaged Reference". A packaged Reference is a `Reference` that is
|
|
112
|
+
* pre-packaged with props set by the `useReferenceCitation` hook.
|
|
113
|
+
*
|
|
114
|
+
* @deprecated Use `useReferenceCitationPreview` hook instead.
|
|
115
|
+
*/
|
|
116
|
+
export declare type PackagedReference = React_2.FC<PackagedReferenceProps>;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* A "packaged Reference". A packaged Reference is a `Reference` that is
|
|
120
|
+
* pre-packaged with props set by the `useReferenceCitation` hook.
|
|
121
|
+
*/
|
|
122
|
+
declare type PackagedReference_2 = React_2.FC<PackagedReferenceProps_2>;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Props for a "packaged Reference". A packaged Reference is a `Reference` that is
|
|
126
|
+
* pre-packaged with props set by the `useReferenceCitation` hook.
|
|
127
|
+
*
|
|
128
|
+
* @deprecated Use `useReferenceCitationPreview` hook instead.
|
|
129
|
+
*/
|
|
130
|
+
export declare type PackagedReferenceProps = Omit<ReferenceProps, PartialReferenceProps> & Partial<Pick<ReferenceProps, PartialReferenceProps>>;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Props for a "packaged Reference". A packaged Reference is a `Reference` that is
|
|
134
|
+
* pre-packaged with props set by the `useReferenceCitation` hook.
|
|
135
|
+
*/
|
|
136
|
+
declare type PackagedReferenceProps_2 = Omit<ReferenceProps, PartialReferenceProps_2> & Partial<Pick<ReferenceProps, PartialReferenceProps_2>>;
|
|
137
|
+
|
|
138
|
+
declare type PartialCitationProps = 'referenceHref' | 'referenceId';
|
|
139
|
+
|
|
140
|
+
declare type PartialCitationProps_2 = 'referenceHref' | 'referenceId';
|
|
141
|
+
|
|
142
|
+
declare type PartialReferenceProps = 'citationHref' | 'index' | 'referenceId';
|
|
143
|
+
|
|
144
|
+
declare type PartialReferenceProps_2 = 'citationHref' | 'index' | 'referenceId';
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Preview Props
|
|
148
|
+
*/
|
|
149
|
+
declare type PreviewProps = PopoverProps;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* PreviewSurface Props
|
|
153
|
+
*/
|
|
154
|
+
declare type PreviewSurfaceProps = ComponentProps<PreviewSurfaceSlots> & PopoverSurfaceProps & {};
|
|
155
|
+
|
|
156
|
+
declare type PreviewSurfaceSlots = PopoverSurfaceSlots & {};
|
|
157
|
+
|
|
158
|
+
export declare const Reference: ForwardRefComponent<ReferenceProps>;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Data used to package a `Citation` and `Reference` together with
|
|
162
|
+
* the `useReferenceCitation` hook.
|
|
163
|
+
*
|
|
164
|
+
* @deprecated Use `useReferenceCitationPreview` hook instead.
|
|
165
|
+
*/
|
|
166
|
+
export declare type ReferenceCitationData = {
|
|
167
|
+
index: number;
|
|
168
|
+
referenceId?: string;
|
|
169
|
+
citationId?: string;
|
|
170
|
+
citationProps?: PackagedCitationProps;
|
|
171
|
+
referenceProps?: PackagedReferenceProps;
|
|
172
|
+
popoverProps?: PackagedCitationPopoverProps;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Data used to package a `Citation` and `Reference` together with
|
|
177
|
+
* the `useReferenceCitation` hook.
|
|
178
|
+
*/
|
|
179
|
+
declare type ReferenceCitationData_2 = {
|
|
180
|
+
index: number;
|
|
181
|
+
referenceId?: string;
|
|
182
|
+
citationId?: string;
|
|
183
|
+
citationProps?: PackagedCitationProps_2;
|
|
184
|
+
referenceProps?: PackagedReferenceProps_2;
|
|
185
|
+
previewProps?: PreviewProps;
|
|
186
|
+
previewSurfaceProps?: PreviewSurfaceProps;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export declare const referenceClassNames: SlotClassNames<ReferenceSlots>;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* ReferenceGroup component
|
|
193
|
+
* @deprecated use `useReferenceGroup` instead.
|
|
194
|
+
*/
|
|
195
|
+
export declare const ReferenceGroup: ForwardRefComponent<ReferenceGroupProps>;
|
|
196
|
+
|
|
197
|
+
export declare const referenceGroupClassNames: SlotClassNames<ReferenceGroupSlots>;
|
|
198
|
+
|
|
199
|
+
declare type ReferenceGroupContext = {
|
|
200
|
+
open?: boolean;
|
|
201
|
+
setOpen: () => void;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* ReferenceGroup Props
|
|
206
|
+
*/
|
|
207
|
+
export declare type ReferenceGroupProps = ComponentProps<Partial<ReferenceGroupSlots>, 'content'> & CopilotMode;
|
|
208
|
+
|
|
209
|
+
export declare type ReferenceGroupSlots = {
|
|
210
|
+
/**
|
|
211
|
+
* The root slot.
|
|
212
|
+
*/
|
|
213
|
+
root: NonNullable<Slot<'div'>>;
|
|
214
|
+
/**
|
|
215
|
+
* Label slot. Primary description of the group.
|
|
216
|
+
*/
|
|
217
|
+
label: NonNullable<Slot<'span'>>;
|
|
218
|
+
/**
|
|
219
|
+
* Icon slot.
|
|
220
|
+
*/
|
|
221
|
+
icon: Slot<'span'>;
|
|
222
|
+
/**
|
|
223
|
+
* Details button slot. Used to expand/collapse the group.
|
|
224
|
+
*/
|
|
225
|
+
detailsButton: NonNullable<Slot<'button'>>;
|
|
226
|
+
/**
|
|
227
|
+
* Content slot. Used to display the group's references. Visibility should be controlled by `detailsButton`.
|
|
228
|
+
*/
|
|
229
|
+
content: NonNullable<Slot<'div'>>;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* State used in rendering ReferenceGroup
|
|
234
|
+
*/
|
|
235
|
+
export declare type ReferenceGroupState = ComponentState<ReferenceGroupSlots> & Required<Pick<ReferenceGroupProps, 'mode'>> & {
|
|
236
|
+
/**
|
|
237
|
+
* State to track if the group is open or not.
|
|
238
|
+
*/
|
|
239
|
+
isOpen: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Callback used to open the group from a child.
|
|
242
|
+
* @returns void
|
|
243
|
+
*/
|
|
244
|
+
setOpen: () => void;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
export declare const ReferenceGroupToggle: ForwardRefComponent<ReferenceGroupToggleProps>;
|
|
248
|
+
|
|
249
|
+
export declare const referenceGroupToggleClassNames: SlotClassNames<ReferenceGroupToggleSlots>;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* ReferenceGroupToggle Props
|
|
253
|
+
*/
|
|
254
|
+
export declare type ReferenceGroupToggleProps = ComponentProps<ReferenceGroupToggleSlots> & {
|
|
255
|
+
isOpen?: boolean;
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
export declare type ReferenceGroupToggleSlots = {
|
|
259
|
+
root: NonNullable<Slot<'button'>>;
|
|
260
|
+
icon?: Slot<'span'>;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* State used in rendering ReferenceGroupToggle
|
|
265
|
+
*/
|
|
266
|
+
export declare type ReferenceGroupToggleState = ComponentState<ReferenceGroupToggleSlots> & Required<Pick<ReferenceGroupToggleProps, 'isOpen'>>;
|
|
267
|
+
|
|
268
|
+
export declare const ReferenceList: ForwardRefComponent<ReferenceListProps>;
|
|
269
|
+
|
|
270
|
+
export declare const referenceListClassNames: SlotClassNames<ReferenceListSlots>;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* ReferenceList Props
|
|
274
|
+
*/
|
|
275
|
+
export declare type ReferenceListProps = ComponentProps<ReferenceListSlots>;
|
|
276
|
+
|
|
277
|
+
export declare type ReferenceListSlots = {
|
|
278
|
+
/**
|
|
279
|
+
* The root slot.
|
|
280
|
+
*/
|
|
281
|
+
root: Slot<'ol'>;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* State used in rendering ReferenceList
|
|
286
|
+
*/
|
|
287
|
+
export declare type ReferenceListState = ComponentState<ReferenceListSlots>;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Reference Props
|
|
291
|
+
*/
|
|
292
|
+
export declare type ReferenceProps = ComponentProps<Partial<ReferenceSlots>> & CopilotMode & {
|
|
293
|
+
/**
|
|
294
|
+
* Numeric index associated with `Citation`.
|
|
295
|
+
*/
|
|
296
|
+
index: number;
|
|
297
|
+
/**
|
|
298
|
+
* HREF back to the `Citation` this `Reference` is associated with.
|
|
299
|
+
*/
|
|
300
|
+
citationHref?: string;
|
|
301
|
+
/**
|
|
302
|
+
* Unique ID associated with this `Reference`.
|
|
303
|
+
*/
|
|
304
|
+
referenceId?: string;
|
|
305
|
+
/**
|
|
306
|
+
* Text snippet from the reference source.
|
|
307
|
+
*/
|
|
308
|
+
excerpt?: string;
|
|
309
|
+
layout?: 'inline' | 'popover';
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
export declare type ReferenceSlots = {
|
|
313
|
+
/**
|
|
314
|
+
* The root slot.
|
|
315
|
+
*/
|
|
316
|
+
root: NonNullable<Slot<'div'>>;
|
|
317
|
+
/**
|
|
318
|
+
* Citation slot. Displays a `Citation`. Set the `null` to hide the citation.
|
|
319
|
+
*/
|
|
320
|
+
citation: Slot<'div'>;
|
|
321
|
+
/**
|
|
322
|
+
* Media slot. Used to display Avatars, Icons, etc.
|
|
323
|
+
*/
|
|
324
|
+
media: Slot<'div'>;
|
|
325
|
+
/**
|
|
326
|
+
* Actions slot.
|
|
327
|
+
*/
|
|
328
|
+
actions: Slot<'div'>;
|
|
329
|
+
/**
|
|
330
|
+
* Label slot. Primary description of the reference.
|
|
331
|
+
*/
|
|
332
|
+
label: NonNullable<Slot<'div'>>;
|
|
333
|
+
/**
|
|
334
|
+
* Sensitivity slot. Used to display a `SensitivityLabel`.
|
|
335
|
+
*/
|
|
336
|
+
sensitivity: Slot<'span'>;
|
|
337
|
+
/**
|
|
338
|
+
* @deprecated Use `sensitivity` instead.
|
|
339
|
+
* Sensitivity label slot. Displays a label indicating how sensitive the information displayed in the reference is.
|
|
340
|
+
*/
|
|
341
|
+
sensitivityLabel: Slot<'span'>;
|
|
342
|
+
/**
|
|
343
|
+
* Metadata slot. Container for `primaryText`, `secondaryText`, `tertiaryText` and `icon`.
|
|
344
|
+
*/
|
|
345
|
+
metadata: NonNullable<Slot<'div'>>;
|
|
346
|
+
/**
|
|
347
|
+
* Primary text slot. First displayed metadata text.
|
|
348
|
+
*/
|
|
349
|
+
primaryText: Slot<'span'>;
|
|
350
|
+
/**
|
|
351
|
+
* Secondary text slot. Second displayed metadata text.
|
|
352
|
+
*/
|
|
353
|
+
secondaryText: Slot<'span'>;
|
|
354
|
+
/**
|
|
355
|
+
* Tertiary text slot. Third displayed metadata text.
|
|
356
|
+
*/
|
|
357
|
+
tertiaryText: Slot<'span'>;
|
|
358
|
+
/**
|
|
359
|
+
* Icon slot. Icon displayed in metadata area.
|
|
360
|
+
*/
|
|
361
|
+
icon: Slot<'span'>;
|
|
362
|
+
/**
|
|
363
|
+
* Content slot.
|
|
364
|
+
*/
|
|
365
|
+
content: NonNullable<Slot<'div'>>;
|
|
366
|
+
/**
|
|
367
|
+
* Details button slot. Used to expand/collapse the reference.
|
|
368
|
+
*/
|
|
369
|
+
detailsButton: Slot<typeof Button>;
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* State used in rendering Reference
|
|
374
|
+
*/
|
|
375
|
+
export declare type ReferenceState = ComponentState<ReferenceSlots> & Required<Pick<ReferenceProps, 'mode' | 'layout' | 'index'>> & {
|
|
376
|
+
/**
|
|
377
|
+
* State used to renderer the `Reference` in an expanded state.
|
|
378
|
+
*/
|
|
379
|
+
isExpanded: boolean;
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Render the final JSX of Citation
|
|
384
|
+
*/
|
|
385
|
+
export declare const renderCitation_unstable: (state: CitationState) => JSX.Element;
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Render the final JSX of Reference
|
|
389
|
+
*/
|
|
390
|
+
export declare const renderReference_unstable: (state: ReferenceState) => JSX.Element;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Render the final JSX of ReferenceGroup
|
|
394
|
+
*/
|
|
395
|
+
export declare const renderReferenceGroup_unstable: (state: ReferenceGroupState, contextValues: ReferenceGroupContext) => JSX.Element;
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Render the final JSX of ReferenceGroupToggle
|
|
399
|
+
*/
|
|
400
|
+
export declare const renderReferenceGroupToggle_unstable: (state: ReferenceGroupToggleState) => JSX.Element;
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Render the final JSX of ReferenceList
|
|
404
|
+
*/
|
|
405
|
+
export declare const renderReferenceList_unstable: (state: ReferenceListState) => JSX.Element;
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Create the state required to render Citation.
|
|
409
|
+
*
|
|
410
|
+
* The returned state can be modified with hooks such as useCitationStyles_unstable,
|
|
411
|
+
* before being passed to renderCitation_unstable.
|
|
412
|
+
*
|
|
413
|
+
* @param props - props from this instance of Citation
|
|
414
|
+
* @param ref - reference to root HTMLElement of Citation
|
|
415
|
+
*/
|
|
416
|
+
export declare const useCitation_unstable: (props: CitationProps, ref: React_2.Ref<HTMLElement>) => CitationState;
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* Apply styling to the Citation slots based on the state
|
|
420
|
+
*/
|
|
421
|
+
export declare const useCitationStyles_unstable: (state: CitationState) => CitationState;
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Create the state required to render Reference.
|
|
425
|
+
*
|
|
426
|
+
* The returned state can be modified with hooks such as useReferenceStyles_unstable,
|
|
427
|
+
* before being passed to renderReference_unstable.
|
|
428
|
+
*
|
|
429
|
+
* @param props - props from this instance of Reference
|
|
430
|
+
* @param ref - reference to root HTMLElement of Reference
|
|
431
|
+
*/
|
|
432
|
+
export declare const useReference_unstable: (props: ReferenceProps, ref: React_2.Ref<HTMLElement>) => ReferenceState;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* @deprecated Use `useReferenceCitationPreview` hook instead.
|
|
436
|
+
*/
|
|
437
|
+
export declare type UseReferenceCitation = (data: ReferenceCitationData) => {
|
|
438
|
+
Citation: PackagedCitation;
|
|
439
|
+
Reference: PackagedReference;
|
|
440
|
+
Popover: PackagedCitationPopover;
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Hook to package a `Citation` and `Reference` together in an
|
|
445
|
+
* accessibly by default manner.
|
|
446
|
+
*
|
|
447
|
+
* When using citations and references, prefer using them via this
|
|
448
|
+
* hook to ensure props are wired up correctly.
|
|
449
|
+
*
|
|
450
|
+
* @deprecated Use `useReferenceCitationPreview` hook instead.
|
|
451
|
+
*/
|
|
452
|
+
export declare const useReferenceCitation: UseReferenceCitation;
|
|
453
|
+
|
|
454
|
+
export declare type UseReferenceCitationPreview = (data: ReferenceCitationData_2) => {
|
|
455
|
+
Citation: PackagedCitation_2;
|
|
456
|
+
Reference: PackagedReference_2;
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Hook to package a `Citation` and `Reference` together in an
|
|
461
|
+
* accessibly by default manner.
|
|
462
|
+
*
|
|
463
|
+
* When using citations and references, prefer using them via this
|
|
464
|
+
* hook to ensure props are wired up correctly.
|
|
465
|
+
*/
|
|
466
|
+
export declare const useReferenceCitationPreview: UseReferenceCitationPreview;
|
|
467
|
+
|
|
468
|
+
export declare type UseReferenceGroup = (props: UseReferenceGroupProps) => {
|
|
469
|
+
referenceGroupToggleProps: ReferenceGroupToggleProps;
|
|
470
|
+
referenceListProps: ReferenceListProps;
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Hook to package a `ReferenceGroupToggle` and `ReferenceList` together and
|
|
475
|
+
* maintain their `isOpen` state.
|
|
476
|
+
*
|
|
477
|
+
* When rendering a group of references, prefer to use this hook
|
|
478
|
+
* hook to ensure state is maintained correctly
|
|
479
|
+
*/
|
|
480
|
+
export declare const useReferenceGroup: UseReferenceGroup;
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Create the state required to render ReferenceGroup.
|
|
484
|
+
*
|
|
485
|
+
* The returned state can be modified with hooks such as useReferenceGroupStyles_unstable,
|
|
486
|
+
* before being passed to renderReferenceGroup_unstable.
|
|
487
|
+
*
|
|
488
|
+
* @param props - props from this instance of ReferenceGroup
|
|
489
|
+
* @param ref - reference to root HTMLElement of ReferenceGroup
|
|
490
|
+
*/
|
|
491
|
+
export declare const useReferenceGroup_unstable: (props: ReferenceGroupProps, ref: React_2.Ref<HTMLElement>) => ReferenceGroupState;
|
|
492
|
+
|
|
493
|
+
export declare type UseReferenceGroupProps = {
|
|
494
|
+
referenceListId?: string;
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Apply styling to the ReferenceGroup slots based on the state
|
|
499
|
+
*/
|
|
500
|
+
export declare const useReferenceGroupStyles_unstable: (state: ReferenceGroupState) => ReferenceGroupState;
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* Create the state required to render ReferenceGroupToggle.
|
|
504
|
+
*
|
|
505
|
+
* The returned state can be modified with hooks such as useReferenceGroupToggleStyles_unstable,
|
|
506
|
+
* before being passed to renderReferenceGroupToggle_unstable.
|
|
507
|
+
*
|
|
508
|
+
* @param props - props from this instance of ReferenceGroupToggle
|
|
509
|
+
* @param ref - reference to root HTMLElement of ReferenceGroupToggle
|
|
510
|
+
*/
|
|
511
|
+
export declare const useReferenceGroupToggle_unstable: (props: ReferenceGroupToggleProps, ref: React_2.Ref<HTMLButtonElement>) => ReferenceGroupToggleState;
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Apply styling to the ReferenceGroupToggle slots based on the state
|
|
515
|
+
*/
|
|
516
|
+
export declare const useReferenceGroupToggleStyles_unstable: (state: ReferenceGroupToggleState) => ReferenceGroupToggleState;
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Create the state required to render ReferenceList.
|
|
520
|
+
*
|
|
521
|
+
* The returned state can be modified with hooks such as useReferenceListStyles_unstable,
|
|
522
|
+
* before being passed to renderReferenceList_unstable.
|
|
523
|
+
*
|
|
524
|
+
* @param props - props from this instance of ReferenceList
|
|
525
|
+
* @param ref - reference to root HTMLElement of ReferenceList
|
|
526
|
+
*/
|
|
527
|
+
export declare const useReferenceList_unstable: (props: ReferenceListProps, ref: React_2.Ref<HTMLElement>) => ReferenceListState;
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Apply styling to the ReferenceList slots based on the state
|
|
531
|
+
*/
|
|
532
|
+
export declare const useReferenceListStyles_unstable: (state: ReferenceListState) => ReferenceListState;
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Apply styling to the Reference slots based on the state
|
|
536
|
+
*/
|
|
537
|
+
export declare const useReferenceStyles_unstable: (state: ReferenceState) => ReferenceState;
|
|
538
|
+
|
|
539
|
+
export { }
|
package/lib/Citation.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Citation.ts"],"sourcesContent":["export * from './components/Citation/index';\n"],"names":[],"mappings":"AAAA,cAAc,8BAA8B"}
|
package/lib/Reference.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Reference.ts"],"sourcesContent":["export * from './components/Reference/index';\n"],"names":[],"mappings":"AAAA,cAAc,+BAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ReferenceGroup.ts"],"sourcesContent":["export * from './components/ReferenceGroup/index';\n"],"names":[],"mappings":"AAAA,cAAc,oCAAoC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ReferenceGroupToggle.ts"],"sourcesContent":["export * from './components/ReferenceGroupToggle/index';\n"],"names":[],"mappings":"AAAA,cAAc,0CAA0C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ReferenceList.ts"],"sourcesContent":["export * from './components/ReferenceList/index';\n"],"names":[],"mappings":"AAAA,cAAc,mCAAmC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useCitation_unstable } from './useCitation';
|
|
3
|
+
import { renderCitation_unstable } from './renderCitation';
|
|
4
|
+
import { useCitationStyles_unstable } from './useCitationStyles';
|
|
5
|
+
import { useCustomStyleHook } from '@fluentui-copilot/react-provider';
|
|
6
|
+
// Citation component - TODO: add more docs
|
|
7
|
+
export const Citation = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
8
|
+
const state = useCitation_unstable(props, ref);
|
|
9
|
+
useCitationStyles_unstable(state);
|
|
10
|
+
useCustomStyleHook('useCitationStyles')(state);
|
|
11
|
+
return renderCitation_unstable(state);
|
|
12
|
+
});
|
|
13
|
+
Citation.displayName = 'Citation';
|
|
14
|
+
//# sourceMappingURL=Citation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Citation.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useCitation_unstable } from './useCitation';\nimport { renderCitation_unstable } from './renderCitation';\nimport { useCitationStyles_unstable } from './useCitationStyles';\nimport type { CitationProps } from './Citation.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\n\n// Citation component - TODO: add more docs\nexport const Citation: ForwardRefComponent<CitationProps> = React.forwardRef((props, ref) => {\n const state = useCitation_unstable(props, ref);\n\n useCitationStyles_unstable(state);\n useCustomStyleHook('useCitationStyles')(state);\n\n return renderCitation_unstable(state);\n});\n\nCitation.displayName = 'Citation';\n"],"names":["React","useCitation_unstable","renderCitation_unstable","useCitationStyles_unstable","useCustomStyleHook","Citation","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,sBAAsB;AAGjE,SAASC,kBAAkB,QAAQ,mCAAmC;AAEtE,2CAA2C;AAC3C,OAAO,MAAMC,yBAA+CL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACnF,MAAMC,QAAQR,qBAAqBM,OAAOC;IAE1CL,2BAA2BM;IAC3BL,mBAAmB,qBAAqBK;IAExC,OAAOP,wBAAwBO;AACjC,GAAG;AAEHJ,SAASK,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Citation.types.ts"],"sourcesContent":["import type {\n ComponentProps,\n ComponentState,\n OnOpenChangeData,\n OpenPopoverEvents,\n PopoverSurface,\n Slot,\n} from '@fluentui/react-components';\n\nexport type CitationSlots = {\n /**\n * The root slot.\n */\n root: NonNullable<Slot<'a'>>;\n\n /**\n * Popover slot. This will be displayed on hover/focus.\n *\n * @deprecated Use `Preview` component and `useReferenceCitationPreview` hook instead.\n */\n popover?: Slot<'div'>;\n\n /**\n * PopoverSurface slot. This exposes the underlying PopoverSurface that is displayed on hover/focus.\n *\n * @deprecated Use `Preview` component and `useReferenceCitationPreview` hook instead.\n */\n popoverSurface: Slot<typeof PopoverSurface>;\n};\n\n/**\n * Citation Props\n */\nexport type CitationProps = ComponentProps<Partial<CitationSlots>> & {\n /**\n * HREF to the associated `Reference`.\n */\n referenceHref?: string;\n\n /**\n * Whether the citation is a block citation and has no built in margins.\n * Citations are inline by default with margins to separate them from inline text.\n */\n block?: boolean;\n\n /**\n * Unique ID of the associated `Reference`.\n * @deprecated No longer used.\n */\n referenceId?: string;\n};\n\n/**\n * State used in rendering Citation\n */\nexport type CitationState = ComponentState<CitationSlots> &\n Required<Pick<CitationProps, 'block'>> & {\n disableAutoFocus: boolean;\n isPopoverOpen: boolean;\n isPopoverLocked: boolean;\n onPopoverOpenChange: (e: OpenPopoverEvents, data: OnOpenChangeData) => void;\n };\n"],"names":[],"mappings":"AAAA,WA6DI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Citation';\nexport * from './Citation.types';\nexport * from './renderCitation';\nexport * from './useCitation';\nexport * from './useCitationStyles';\n"],"names":[],"mappings":"AAAA,cAAc,aAAa;AAC3B,cAAc,mBAAmB;AACjC,cAAc,mBAAmB;AACjC,cAAc,gBAAgB;AAC9B,cAAc,sBAAsB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { Popover, PopoverTrigger, assertSlots } from '@fluentui/react-components';
|
|
3
|
+
const popoverPositioning = {
|
|
4
|
+
overflowBoundaryPadding: 4,
|
|
5
|
+
position: 'below'
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Render the final JSX of Citation
|
|
9
|
+
*/
|
|
10
|
+
export const renderCitation_unstable = state => {
|
|
11
|
+
assertSlots(state);
|
|
12
|
+
return state.popover && state.popoverSurface ? /*#__PURE__*/_jsxs(Popover, {
|
|
13
|
+
closeOnScroll: true,
|
|
14
|
+
onOpenChange: state.onPopoverOpenChange,
|
|
15
|
+
open: state.isPopoverOpen,
|
|
16
|
+
positioning: popoverPositioning,
|
|
17
|
+
size: "small",
|
|
18
|
+
trapFocus: true,
|
|
19
|
+
unstable_disableAutoFocus: state.disableAutoFocus,
|
|
20
|
+
withArrow: true,
|
|
21
|
+
children: [/*#__PURE__*/_jsx(PopoverTrigger, {
|
|
22
|
+
disableButtonEnhancement: true,
|
|
23
|
+
children: /*#__PURE__*/_jsx(state.root, {})
|
|
24
|
+
}), /*#__PURE__*/_jsx(state.popoverSurface, {
|
|
25
|
+
children: /*#__PURE__*/_jsx(state.popover, {})
|
|
26
|
+
})]
|
|
27
|
+
}) : /*#__PURE__*/_jsx(state.root, {});
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=renderCitation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderCitation.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { Popover, PopoverTrigger, assertSlots } from '@fluentui/react-components';\nimport type { PositioningProps } from '@fluentui/react-components';\nimport type { CitationState, CitationSlots } from './Citation.types';\n\nconst popoverPositioning: PositioningProps = {\n overflowBoundaryPadding: 4,\n position: 'below',\n};\n\n/**\n * Render the final JSX of Citation\n */\nexport const renderCitation_unstable = (state: CitationState) => {\n assertSlots<CitationSlots>(state);\n\n return state.popover && state.popoverSurface ? (\n <Popover\n closeOnScroll\n onOpenChange={state.onPopoverOpenChange}\n open={state.isPopoverOpen}\n positioning={popoverPositioning}\n size=\"small\"\n trapFocus\n unstable_disableAutoFocus={state.disableAutoFocus}\n withArrow\n >\n <PopoverTrigger disableButtonEnhancement>\n <state.root />\n </PopoverTrigger>\n <state.popoverSurface>\n <state.popover />\n </state.popoverSurface>\n </Popover>\n ) : (\n <state.root />\n );\n};\n"],"names":["Popover","PopoverTrigger","assertSlots","popoverPositioning","overflowBoundaryPadding","position","renderCitation_unstable","state","popover","popoverSurface","closeOnScroll","onOpenChange","onPopoverOpenChange","open","isPopoverOpen","positioning","size","trapFocus","unstable_disableAutoFocus","disableAutoFocus","withArrow","disableButtonEnhancement","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,OAAO,EAAEC,cAAc,EAAEC,WAAW,QAAQ,6BAA6B;AAIlF,MAAMC,qBAAuC;IAC3CC,yBAAyB;IACzBC,UAAU;AACZ;AAEA;;CAEC,GACD,OAAO,MAAMC,0BAA0B,CAACC;IACtCL,YAA2BK;IAE3B,OAAOA,MAAMC,OAAO,IAAID,MAAME,cAAc,iBAC1C,MAACT;QACCU,aAAa;QACbC,cAAcJ,MAAMK,mBAAmB;QACvCC,MAAMN,MAAMO,aAAa;QACzBC,aAAaZ;QACba,MAAK;QACLC,SAAS;QACTC,2BAA2BX,MAAMY,gBAAgB;QACjDC,SAAS;;0BAET,KAACnB;gBAAeoB,wBAAwB;0BACtC,cAAA,KAACd,MAAMe,IAAI;;0BAEb,KAACf,MAAME,cAAc;0BACnB,cAAA,KAACF,MAAMC,OAAO;;;uBAIlB,KAACD,MAAMe,IAAI;AAEf,EAAE"}
|