@fluentui-copilot/react-preview 0.0.0-nightly-20240426-0405-4698d75c.1 → 0.0.0-nightly-20240501-0406-278a94d6.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 +18 -3
- package/CHANGELOG.md +13 -4
- package/lib/Preview.js.map +1 -1
- package/lib/PreviewContent.js.map +1 -1
- package/lib/PreviewHeader.js.map +1 -1
- package/lib/PreviewMetadata.js.map +1 -1
- package/lib/PreviewSurface.js.map +1 -1
- package/lib/PreviewTrigger.js.map +1 -1
- package/lib/components/Preview/Preview.js.map +1 -1
- package/lib/components/Preview/Preview.types.js +3 -1
- package/lib/components/Preview/Preview.types.js.map +1 -1
- package/lib/components/Preview/index.js.map +1 -1
- package/lib/components/Preview/renderPreview.js.map +1 -1
- package/lib/components/Preview/usePreview.js.map +1 -1
- package/lib/components/PreviewContent/PreviewContent.js.map +1 -1
- package/lib/components/PreviewContent/PreviewContent.types.js +3 -1
- package/lib/components/PreviewContent/PreviewContent.types.js.map +1 -1
- package/lib/components/PreviewContent/index.js.map +1 -1
- package/lib/components/PreviewContent/renderPreviewContent.js.map +1 -1
- package/lib/components/PreviewContent/usePreviewContent.js.map +1 -1
- package/lib/components/PreviewContent/usePreviewContentStyles.js.map +1 -1
- package/lib/components/PreviewHeader/PreviewHeader.js.map +1 -1
- package/lib/components/PreviewHeader/PreviewHeader.types.js +3 -1
- package/lib/components/PreviewHeader/PreviewHeader.types.js.map +1 -1
- package/lib/components/PreviewHeader/index.js.map +1 -1
- package/lib/components/PreviewHeader/renderPreviewHeader.js.map +1 -1
- package/lib/components/PreviewHeader/usePreviewHeader.js.map +1 -1
- package/lib/components/PreviewHeader/usePreviewHeaderStyles.js.map +1 -1
- package/lib/components/PreviewMetadata/PreviewMetadata.js.map +1 -1
- package/lib/components/PreviewMetadata/PreviewMetadata.types.js +3 -1
- package/lib/components/PreviewMetadata/PreviewMetadata.types.js.map +1 -1
- package/lib/components/PreviewMetadata/index.js.map +1 -1
- package/lib/components/PreviewMetadata/renderPreviewMetadata.js.map +1 -1
- package/lib/components/PreviewMetadata/usePreviewMetadata.js.map +1 -1
- package/lib/components/PreviewMetadata/usePreviewMetadataStyles.js.map +1 -1
- package/lib/components/PreviewSurface/PreviewSurface.js.map +1 -1
- package/lib/components/PreviewSurface/PreviewSurface.types.js +3 -1
- package/lib/components/PreviewSurface/PreviewSurface.types.js.map +1 -1
- package/lib/components/PreviewSurface/index.js.map +1 -1
- package/lib/components/PreviewSurface/renderPreviewSurface.js.map +1 -1
- package/lib/components/PreviewSurface/usePreviewSurface.js.map +1 -1
- package/lib/components/PreviewSurface/usePreviewSurfaceStyles.js.map +1 -1
- package/lib/components/PreviewTrigger/PreviewTrigger.js.map +1 -1
- package/lib/components/PreviewTrigger/PreviewTrigger.types.js +3 -1
- package/lib/components/PreviewTrigger/PreviewTrigger.types.js.map +1 -1
- package/lib/components/PreviewTrigger/index.js.map +1 -1
- package/lib/components/PreviewTrigger/renderPreviewTrigger.js.map +1 -1
- package/lib/components/PreviewTrigger/usePreviewTrigger.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/previewContext.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/openedByHoverPreviewManager.js.map +1 -1
- package/lib-commonjs/Preview.js.map +1 -1
- package/lib-commonjs/PreviewContent.js.map +1 -1
- package/lib-commonjs/PreviewHeader.js.map +1 -1
- package/lib-commonjs/PreviewMetadata.js.map +1 -1
- package/lib-commonjs/PreviewSurface.js.map +1 -1
- package/lib-commonjs/PreviewTrigger.js.map +1 -1
- package/lib-commonjs/components/Preview/Preview.js.map +1 -1
- package/lib-commonjs/components/Preview/Preview.types.js +3 -1
- package/lib-commonjs/components/Preview/Preview.types.js.map +1 -1
- package/lib-commonjs/components/Preview/index.js.map +1 -1
- package/lib-commonjs/components/Preview/renderPreview.js.map +1 -1
- package/lib-commonjs/components/Preview/usePreview.js.map +1 -1
- package/lib-commonjs/components/PreviewContent/PreviewContent.js.map +1 -1
- package/lib-commonjs/components/PreviewContent/PreviewContent.types.js +3 -1
- package/lib-commonjs/components/PreviewContent/PreviewContent.types.js.map +1 -1
- package/lib-commonjs/components/PreviewContent/index.js.map +1 -1
- package/lib-commonjs/components/PreviewContent/renderPreviewContent.js.map +1 -1
- package/lib-commonjs/components/PreviewContent/usePreviewContent.js.map +1 -1
- package/lib-commonjs/components/PreviewContent/usePreviewContentStyles.js.map +1 -1
- package/lib-commonjs/components/PreviewHeader/PreviewHeader.js.map +1 -1
- package/lib-commonjs/components/PreviewHeader/PreviewHeader.types.js +3 -1
- package/lib-commonjs/components/PreviewHeader/PreviewHeader.types.js.map +1 -1
- package/lib-commonjs/components/PreviewHeader/index.js.map +1 -1
- package/lib-commonjs/components/PreviewHeader/renderPreviewHeader.js.map +1 -1
- package/lib-commonjs/components/PreviewHeader/usePreviewHeader.js.map +1 -1
- package/lib-commonjs/components/PreviewHeader/usePreviewHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/PreviewMetadata/PreviewMetadata.js.map +1 -1
- package/lib-commonjs/components/PreviewMetadata/PreviewMetadata.types.js +3 -1
- package/lib-commonjs/components/PreviewMetadata/PreviewMetadata.types.js.map +1 -1
- package/lib-commonjs/components/PreviewMetadata/index.js.map +1 -1
- package/lib-commonjs/components/PreviewMetadata/renderPreviewMetadata.js.map +1 -1
- package/lib-commonjs/components/PreviewMetadata/usePreviewMetadata.js.map +1 -1
- package/lib-commonjs/components/PreviewMetadata/usePreviewMetadataStyles.js.map +1 -1
- package/lib-commonjs/components/PreviewSurface/PreviewSurface.js.map +1 -1
- package/lib-commonjs/components/PreviewSurface/PreviewSurface.types.js +3 -1
- package/lib-commonjs/components/PreviewSurface/PreviewSurface.types.js.map +1 -1
- package/lib-commonjs/components/PreviewSurface/index.js.map +1 -1
- package/lib-commonjs/components/PreviewSurface/renderPreviewSurface.js.map +1 -1
- package/lib-commonjs/components/PreviewSurface/usePreviewSurface.js.map +1 -1
- package/lib-commonjs/components/PreviewSurface/usePreviewSurfaceStyles.js.map +1 -1
- package/lib-commonjs/components/PreviewTrigger/PreviewTrigger.js.map +1 -1
- package/lib-commonjs/components/PreviewTrigger/PreviewTrigger.types.js +3 -1
- package/lib-commonjs/components/PreviewTrigger/PreviewTrigger.types.js.map +1 -1
- package/lib-commonjs/components/PreviewTrigger/index.js.map +1 -1
- package/lib-commonjs/components/PreviewTrigger/renderPreviewTrigger.js.map +1 -1
- package/lib-commonjs/components/PreviewTrigger/usePreviewTrigger.js.map +1 -1
- package/lib-commonjs/index.js +51 -51
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/previewContext.js.map +1 -1
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/openedByHoverPreviewManager.js +3 -3
- package/lib-commonjs/utils/openedByHoverPreviewManager.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "@fluentui-copilot/react-preview",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
6
|
-
"tag": "@fluentui-copilot/react-preview_v0.0.0-nightly-
|
|
7
|
-
"version": "0.0.0-nightly-
|
|
5
|
+
"date": "Wed, 01 May 2024 04:11:56 GMT",
|
|
6
|
+
"tag": "@fluentui-copilot/react-preview_v0.0.0-nightly-20240501-0406-278a94d6.1",
|
|
7
|
+
"version": "0.0.0-nightly-20240501-0406-278a94d6.1",
|
|
8
8
|
"comments": {
|
|
9
9
|
"prerelease": [
|
|
10
10
|
{
|
|
@@ -16,6 +16,21 @@
|
|
|
16
16
|
]
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Tue, 30 Apr 2024 20:55:43 GMT",
|
|
21
|
+
"tag": "@fluentui-copilot/react-preview_v0.4.1",
|
|
22
|
+
"version": "0.4.1",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "sarah.higley@microsoft.com",
|
|
27
|
+
"package": "@fluentui-copilot/react-preview",
|
|
28
|
+
"commit": "66eba4eb0956384ecc14b2a40c5fa722680f79d8",
|
|
29
|
+
"comment": "chore: bump @fluentui/react-components to latest, 9.49.0 "
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
19
34
|
{
|
|
20
35
|
"date": "Wed, 10 Apr 2024 23:07:50 GMT",
|
|
21
36
|
"tag": "@fluentui-copilot/react-preview_v0.4.0",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
# Change Log - @fluentui-copilot/react-preview
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 01 May 2024 04:11:56 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [0.0.0-nightly-
|
|
7
|
+
## [0.0.0-nightly-20240501-0406-278a94d6.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-preview_v0.0.0-nightly-20240501-0406-278a94d6.1)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-preview_v0.4.
|
|
9
|
+
Wed, 01 May 2024 04:11:56 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-preview_v0.4.1..@fluentui-copilot/react-preview_v0.0.0-nightly-20240501-0406-278a94d6.1)
|
|
11
11
|
|
|
12
12
|
### Changes
|
|
13
13
|
|
|
14
14
|
- Release nightly ([commit](https://github.com/microsoft/fluentai/commit/not available) by fluentui-internal@service.microsoft.com)
|
|
15
15
|
|
|
16
|
+
## [0.4.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-preview_v0.4.1)
|
|
17
|
+
|
|
18
|
+
Tue, 30 Apr 2024 20:55:43 GMT
|
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-preview_v0.4.0..@fluentui-copilot/react-preview_v0.4.1)
|
|
20
|
+
|
|
21
|
+
### Patches
|
|
22
|
+
|
|
23
|
+
- chore: bump @fluentui/react-components to latest, 9.49.0 ([PR #1580](https://github.com/microsoft/fluentai/pull/1580) by sarah.higley@microsoft.com)
|
|
24
|
+
|
|
16
25
|
## [0.4.0](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-preview_v0.4.0)
|
|
17
26
|
|
|
18
27
|
Wed, 10 Apr 2024 23:07:50 GMT
|
package/lib/Preview.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Preview.ts"],"sourcesContent":["export * from './components/Preview/index';\n"],"names":[],"mappings":"AAAA,cAAc,6BAA6B"}
|
|
1
|
+
{"version":3,"sources":["Preview.ts"],"sourcesContent":["export * from './components/Preview/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,6BAA6B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PreviewContent.ts"],"sourcesContent":["export * from './components/PreviewContent/index';\n"],"names":[],"mappings":"AAAA,cAAc,oCAAoC"}
|
|
1
|
+
{"version":3,"sources":["PreviewContent.ts"],"sourcesContent":["export * from './components/PreviewContent/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,oCAAoC"}
|
package/lib/PreviewHeader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PreviewHeader.ts"],"sourcesContent":["export * from './components/PreviewHeader/index';\n"],"names":[],"mappings":"AAAA,cAAc,mCAAmC"}
|
|
1
|
+
{"version":3,"sources":["PreviewHeader.ts"],"sourcesContent":["export * from './components/PreviewHeader/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,mCAAmC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PreviewMetadata.ts"],"sourcesContent":["export * from './components/PreviewMetadata/index';\n"],"names":[],"mappings":"AAAA,cAAc,qCAAqC"}
|
|
1
|
+
{"version":3,"sources":["PreviewMetadata.ts"],"sourcesContent":["export * from './components/PreviewMetadata/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,qCAAqC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PreviewSurface.ts"],"sourcesContent":["export * from './components/PreviewSurface/index';\n"],"names":[],"mappings":"AAAA,cAAc,oCAAoC"}
|
|
1
|
+
{"version":3,"sources":["PreviewSurface.ts"],"sourcesContent":["export * from './components/PreviewSurface/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,oCAAoC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PreviewTrigger.ts"],"sourcesContent":["export * from './components/PreviewTrigger/index';\n"],"names":[],"mappings":"AAAA,cAAc,oCAAoC"}
|
|
1
|
+
{"version":3,"sources":["PreviewTrigger.ts"],"sourcesContent":["export * from './components/PreviewTrigger/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,oCAAoC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Preview.tsx"],"sourcesContent":["import type * as React from 'react';\n\nimport { usePreview_unstable } from './usePreview';\nimport { renderPreview_unstable } from './renderPreview';\nimport type { PreviewProps } from './Preview.types';\n\nexport const Preview: React.FC<PreviewProps> = props => {\n const state = usePreview_unstable(props);\n\n return renderPreview_unstable(state);\n};\n\nPreview.displayName = 'Preview';\n"],"names":["usePreview_unstable","renderPreview_unstable","Preview","props","state","displayName"],"mappings":"AAEA,SAASA,mBAAmB,QAAQ,eAAe;AACnD,SAASC,sBAAsB,QAAQ,kBAAkB;AAGzD,OAAO,MAAMC,UAAkCC,CAAAA;IAC7C,MAAMC,QAAQJ,oBAAoBG;IAElC,OAAOF,uBAAuBG;AAChC,EAAE;AAEFF,QAAQG,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["Preview.tsx"],"sourcesContent":["import type * as React from 'react';\n\nimport { usePreview_unstable } from './usePreview';\nimport { renderPreview_unstable } from './renderPreview';\nimport type { PreviewProps } from './Preview.types';\n\nexport const Preview: React.FC<PreviewProps> = props => {\n const state = usePreview_unstable(props);\n\n return renderPreview_unstable(state);\n};\n\nPreview.displayName = 'Preview';\n"],"names":["usePreview_unstable","renderPreview_unstable","Preview","props","state","displayName"],"rangeMappings":";;;;;;","mappings":"AAEA,SAASA,mBAAmB,QAAQ,eAAe;AACnD,SAASC,sBAAsB,QAAQ,kBAAkB;AAGzD,OAAO,MAAMC,UAAkCC,CAAAA;IAC7C,MAAMC,QAAQJ,oBAAoBG;IAElC,OAAOF,uBAAuBG;AAChC,EAAE;AAEFF,QAAQG,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Preview.types.ts"],"sourcesContent":["import type { PopoverProps, PopoverState } from '@fluentui/react-components';\n\n/**\n * Preview Props\n */\nexport type PreviewProps = PopoverProps;\n\n/**\n * State used in rendering Preview\n */\nexport type PreviewState = PopoverState & {\n /**\n * Whether the Preview was opened by click or keyboard and is therefore locked until intentional interaction to close it.\n */\n isPreviewLocked: boolean;\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["Preview.types.ts"],"sourcesContent":["import type { PopoverProps, PopoverState } from '@fluentui/react-components';\n\n/**\n * Preview Props\n */\nexport type PreviewProps = PopoverProps;\n\n/**\n * State used in rendering Preview\n */\nexport type PreviewState = PopoverState & {\n /**\n * Whether the Preview was opened by click or keyboard and is therefore locked until intentional interaction to close it.\n */\n isPreviewLocked: boolean;\n};\n"],"names":[],"rangeMappings":";;","mappings":"AAOA;;CAEC,GACD,WAKE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Preview';\nexport * from './Preview.types';\nexport * from './renderPreview';\nexport * from './usePreview';\n"],"names":[],"mappings":"AAAA,cAAc,YAAY;AAC1B,cAAc,kBAAkB;AAChC,cAAc,kBAAkB;AAChC,cAAc,eAAe"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Preview';\nexport * from './Preview.types';\nexport * from './renderPreview';\nexport * from './usePreview';\n"],"names":[],"rangeMappings":";;;","mappings":"AAAA,cAAc,YAAY;AAC1B,cAAc,kBAAkB;AAChC,cAAc,kBAAkB;AAChC,cAAc,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderPreview.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { renderPopover_unstable } from '@fluentui/react-components';\n\nimport { PreviewContextProvider } from '../../previewContext';\nimport type { PreviewState } from './Preview.types';\n\n/**\n * Render the final JSX of Preview\n */\nexport const renderPreview_unstable = (state: PreviewState) => {\n const {\n appearance,\n arrowRef,\n contentRef,\n inertTrapFocus,\n inline,\n isPreviewLocked,\n mountNode,\n open,\n openOnContext,\n openOnHover,\n setOpen,\n size,\n toggleOpen,\n trapFocus,\n triggerRef,\n withArrow,\n } = state;\n\n return (\n <PreviewContextProvider\n value={{\n appearance,\n arrowRef,\n contentRef,\n inertTrapFocus,\n inline,\n isPreviewLocked,\n mountNode,\n open,\n openOnContext,\n openOnHover,\n setOpen,\n size,\n toggleOpen,\n trapFocus,\n triggerRef,\n withArrow,\n }}\n >\n {renderPopover_unstable(state)}\n </PreviewContextProvider>\n );\n};\n"],"names":["React","renderPopover_unstable","PreviewContextProvider","renderPreview_unstable","state","appearance","arrowRef","contentRef","inertTrapFocus","inline","isPreviewLocked","mountNode","open","openOnContext","openOnHover","setOpen","size","toggleOpen","trapFocus","triggerRef","withArrow","value"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,sBAAsB,QAAQ,6BAA6B;AAEpE,SAASC,sBAAsB,QAAQ,uBAAuB;AAG9D;;CAEC,GACD,OAAO,MAAMC,yBAAyB,CAACC;IACrC,MAAM,EACJC,UAAU,EACVC,QAAQ,EACRC,UAAU,EACVC,cAAc,EACdC,MAAM,EACNC,eAAe,EACfC,SAAS,EACTC,IAAI,EACJC,aAAa,EACbC,WAAW,EACXC,OAAO,EACPC,IAAI,EACJC,UAAU,EACVC,SAAS,EACTC,UAAU,EACVC,SAAS,EACV,GAAGhB;IAEJ,qBACE,oBAACF;QACCmB,OAAO;YACLhB;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF;OAECnB,uBAAuBG;AAG9B,EAAE"}
|
|
1
|
+
{"version":3,"sources":["renderPreview.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { renderPopover_unstable } from '@fluentui/react-components';\n\nimport { PreviewContextProvider } from '../../previewContext';\nimport type { PreviewState } from './Preview.types';\n\n/**\n * Render the final JSX of Preview\n */\nexport const renderPreview_unstable = (state: PreviewState) => {\n const {\n appearance,\n arrowRef,\n contentRef,\n inertTrapFocus,\n inline,\n isPreviewLocked,\n mountNode,\n open,\n openOnContext,\n openOnHover,\n setOpen,\n size,\n toggleOpen,\n trapFocus,\n triggerRef,\n withArrow,\n } = state;\n\n return (\n <PreviewContextProvider\n value={{\n appearance,\n arrowRef,\n contentRef,\n inertTrapFocus,\n inline,\n isPreviewLocked,\n mountNode,\n open,\n openOnContext,\n openOnHover,\n setOpen,\n size,\n toggleOpen,\n trapFocus,\n triggerRef,\n withArrow,\n }}\n >\n {renderPopover_unstable(state)}\n </PreviewContextProvider>\n );\n};\n"],"names":["React","renderPopover_unstable","PreviewContextProvider","renderPreview_unstable","state","appearance","arrowRef","contentRef","inertTrapFocus","inline","isPreviewLocked","mountNode","open","openOnContext","openOnHover","setOpen","size","toggleOpen","trapFocus","triggerRef","withArrow","value"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,sBAAsB,QAAQ,6BAA6B;AAEpE,SAASC,sBAAsB,QAAQ,uBAAuB;AAG9D;;CAEC,GACD,OAAO,MAAMC,yBAAyB,CAACC;IACrC,MAAM,EACJC,UAAU,EACVC,QAAQ,EACRC,UAAU,EACVC,cAAc,EACdC,MAAM,EACNC,eAAe,EACfC,SAAS,EACTC,IAAI,EACJC,aAAa,EACbC,WAAW,EACXC,OAAO,EACPC,IAAI,EACJC,UAAU,EACVC,SAAS,EACTC,UAAU,EACVC,SAAS,EACV,GAAGhB;IAEJ,qBACE,oBAACF;QACCmB,OAAO;YACLhB;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF;OAECnB,uBAAuBG;AAG9B,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePreview.ts"],"sourcesContent":["import * as React from 'react';\n\nimport { Enter, Escape } from '@fluentui/keyboard-keys';\nimport {\n mergeCallbacks,\n useFluent,\n useId,\n useIsomorphicLayoutEffect,\n usePopover_unstable,\n} from '@fluentui/react-components';\nimport { useTimeout } from '@fluentui/react-utilities';\nimport type { OnOpenChangeData, OpenPopoverEvents } from '@fluentui/react-components';\n\nimport { addOpenedByHoverPreview, closeAllOpenedByHoverPreviews, removeOpenedByHoverPreview } from '../../utils';\nimport type { PreviewProps, PreviewState } from './Preview.types';\n\ntype PreviewInternalState = {\n openByClick: boolean;\n openByHoverOverTrigger: boolean;\n openByHoverOverPopover: boolean;\n openByKeyboard: boolean;\n};\n\nconst POPOVER_MOUSE_HIDE_DELAY = 500;\nconst POPOVER_KEYBOARD_HIDE_DELAY = 0;\n\nconst getDelay = (type: string): number => {\n if (type === 'focus' || type === 'blur') {\n return POPOVER_KEYBOARD_HIDE_DELAY;\n }\n\n return POPOVER_MOUSE_HIDE_DELAY;\n};\n\ntype TargetEvent<T> = React.MouseEvent<T> | React.FocusEvent<T>;\n\n/**\n * Create the state required to render Preview.\n *\n * The returned state can be modified with hooks such as usePreviewStyles_unstable,\n * before being passed to renderPreview_unstable.\n *\n * @param props - props from this instance of Preview\n * @param ref - reference to root HTMLElement of Preview\n */\nexport const usePreview_unstable = (props: PreviewProps): PreviewState => {\n const { onOpenChange, open, unstable_disableAutoFocus } = props;\n\n const children = React.Children.toArray(props.children) as React.ReactElement[];\n\n const { targetDocument } = useFluent();\n const [setTimeout, clearTimeout] = useTimeout();\n\n const [disableAutoFocus, setDisableAutoFocus] = React.useState(true);\n\n const { current: previewInternalState } = React.useRef<PreviewInternalState>({\n openByClick: false,\n openByHoverOverTrigger: false,\n openByHoverOverPopover: false,\n openByKeyboard: false,\n });\n\n const isOpen = () => {\n return (\n previewInternalState.openByClick ||\n previewInternalState.openByHoverOverTrigger ||\n previewInternalState.openByHoverOverPopover ||\n previewInternalState.openByKeyboard\n );\n };\n\n const [isPopoverOpen, setIsPopoverOpen] = React.useState(false);\n const preventDefaultClose = React.useRef(false);\n\n let popoverTrigger: React.ReactElement | undefined = undefined;\n let popoverSurface: React.ReactElement | undefined = undefined;\n if (children.length === 2) {\n popoverTrigger = children[0];\n popoverSurface = children[1];\n } else if (children.length === 1) {\n popoverSurface = children[0];\n }\n\n const popoverSurfaceId = useId('preview-surface', popoverSurface?.props.id);\n\n const closeCallback = () => {\n previewInternalState.openByClick = false;\n previewInternalState.openByHoverOverTrigger = false;\n previewInternalState.openByHoverOverPopover = false;\n previewInternalState.openByKeyboard = false;\n setIsPopoverOpen(isOpen());\n };\n\n React.useEffect(() => {\n return () => {\n // Remove all instances of the current popover from the openedByHoverPreviewManager when the component is unmounted.\n removeOpenedByHoverPreview(popoverSurfaceId);\n };\n }, [popoverSurfaceId]);\n\n if (popoverSurface && popoverTrigger) {\n const handleTriggerTargetEnter = (e: TargetEvent<HTMLSpanElement>): void => {\n previewInternalState.openByHoverOverTrigger = true;\n\n // We want to disable auto focus only if the popover is being opened by hovering over the trigger\n if (!previewInternalState.openByClick && !previewInternalState.openByKeyboard && !isPopoverOpen) {\n setDisableAutoFocus(true);\n onOpenChange?.(e, { open: true });\n closeAllOpenedByHoverPreviews(popoverSurfaceId);\n addOpenedByHoverPreview(popoverSurfaceId, closeCallback);\n }\n\n setIsPopoverOpen(isOpen());\n };\n\n const handleTriggerTargetLeave = (e: TargetEvent<HTMLSpanElement>): void => {\n previewInternalState.openByHoverOverTrigger = false;\n setTimeout(() => {\n setIsPopoverOpen(isOpen());\n\n // We want to call onOpenChange only if the popover is actually closing when leaving the trigger\n if (\n !previewInternalState.openByClick &&\n !previewInternalState.openByKeyboard &&\n !previewInternalState.openByHoverOverPopover &&\n isPopoverOpen\n ) {\n onOpenChange?.(e, { open: false });\n removeOpenedByHoverPreview(popoverSurfaceId);\n }\n }, getDelay(e.type));\n };\n\n const handleTriggerClick = (e: TargetEvent<HTMLSpanElement>): void => {\n // Setting preventDefaultClose so that onPopoverOpenChange does not apply its logic when click is on the trigger as we want to control that behavior.\n preventDefaultClose.current = true;\n\n // We set disableAutoFocus to false so that interactive elements within popover can be focused when it opens via click.\n setDisableAutoFocus(false);\n\n const tmpOpenByHoverOverTrigger = previewInternalState.openByHoverOverTrigger;\n\n // If openByKeyboard is true, then the popover was already opened via keyboard and we always want to close it.\n previewInternalState.openByClick = previewInternalState.openByKeyboard\n ? false\n : !previewInternalState.openByClick;\n previewInternalState.openByHoverOverTrigger = false;\n previewInternalState.openByHoverOverPopover = false;\n previewInternalState.openByKeyboard = false;\n\n if (!tmpOpenByHoverOverTrigger) {\n onOpenChange?.(e, { open: previewInternalState.openByClick });\n }\n\n if (!isOpen()) {\n removeOpenedByHoverPreview(popoverSurfaceId);\n }\n\n setIsPopoverOpen(isOpen());\n };\n\n const handleTriggerKeyDown = (e: React.KeyboardEvent<HTMLSpanElement>): void => {\n if (e.key === Enter) {\n clearTimeout();\n\n // Setting default prevented so that Enter key does not trigger a click event or onPopoverOpenChange.\n e.preventDefault();\n\n // We set disableAutoFocus to false so that interactive elements within popover can be focused when it opens via keyboard.\n setDisableAutoFocus(false);\n\n const tmpOpenByHoverOverTrigger = previewInternalState.openByHoverOverTrigger;\n\n // If openByClick is true, then the popover was already opened via click and we always want to close it.\n previewInternalState.openByKeyboard = previewInternalState.openByClick\n ? false\n : !previewInternalState.openByKeyboard;\n previewInternalState.openByClick = false;\n previewInternalState.openByHoverOverTrigger = false;\n previewInternalState.openByHoverOverPopover = false;\n\n if (!tmpOpenByHoverOverTrigger) {\n onOpenChange?.(e, { open: previewInternalState.openByKeyboard });\n }\n\n if (!isOpen()) {\n removeOpenedByHoverPreview(popoverSurfaceId);\n }\n\n setIsPopoverOpen(isOpen());\n }\n };\n\n const handlePopoverTargetEnter = (e: TargetEvent<HTMLDivElement>): void => {\n previewInternalState.openByHoverOverPopover = true;\n setIsPopoverOpen(isOpen());\n };\n\n const handlePopoverTargetLeave = (e: TargetEvent<HTMLDivElement>): void => {\n previewInternalState.openByHoverOverPopover = false;\n setTimeout(() => {\n setIsPopoverOpen(isOpen());\n\n // We want to call onOpenChange only if the popover is actually closing when leaving the popover\n if (\n !previewInternalState.openByClick &&\n !previewInternalState.openByKeyboard &&\n !previewInternalState.openByHoverOverTrigger\n ) {\n onOpenChange?.(e, { open: false });\n removeOpenedByHoverPreview(popoverSurfaceId);\n }\n }, getDelay(e.type));\n };\n\n popoverTrigger = React.cloneElement(popoverTrigger, {\n ...popoverTrigger.props,\n children: React.cloneElement(popoverTrigger.props.children as React.ReactElement, {\n ...popoverTrigger.props.children.props,\n onBlur: mergeCallbacks(popoverTrigger.props.children.props.onBlur, handleTriggerTargetLeave),\n onClick: mergeCallbacks(popoverTrigger.props.children.props.onClick, handleTriggerClick),\n onKeyDown: mergeCallbacks(popoverTrigger.props.children.props.onKeyDown, handleTriggerKeyDown),\n onMouseEnter: mergeCallbacks(popoverTrigger.props.children.props.onMouseEnter, handleTriggerTargetEnter),\n onMouseLeave: mergeCallbacks(popoverTrigger.props.children.props.onMouseLeave, handleTriggerTargetLeave),\n }),\n });\n\n popoverSurface = React.cloneElement(popoverSurface, {\n ...popoverSurface.props,\n 'aria-labelledby':\n popoverSurface.props['aria-labelledby'] ?? popoverSurface.props['aria-label'] ? undefined : popoverSurfaceId,\n id: popoverSurfaceId,\n onMouseEnter: mergeCallbacks(popoverSurface.props.onMouseEnter, handlePopoverTargetEnter),\n onMouseLeave: mergeCallbacks(popoverSurface.props.onMouseLeave, handlePopoverTargetLeave),\n onFocus: mergeCallbacks(popoverSurface.props.onFocus, handlePopoverTargetEnter),\n });\n }\n\n // Hitting Escape key 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 trigger or popover.\n useIsomorphicLayoutEffect(() => {\n if (isPopoverOpen) {\n const onDocumentKeyDown = (e: KeyboardEvent) => {\n const openedByHover = !previewInternalState.openByClick && !previewInternalState.openByKeyboard;\n\n if (openedByHover && e.key === Escape) {\n clearTimeout();\n\n // We set state back to its default if the Escape key has been pressed\n setDisableAutoFocus(true);\n closeCallback();\n removeOpenedByHoverPreview(popoverSurfaceId);\n\n onOpenChange?.(e as unknown as OpenPopoverEvents, { open: false });\n\n e.stopPropagation();\n }\n };\n\n targetDocument?.addEventListener('keydown', onDocumentKeyDown, { capture: true });\n\n return () => {\n targetDocument?.removeEventListener('keydown', onDocumentKeyDown, { capture: true });\n };\n }\n }, [targetDocument, isPopoverOpen]);\n\n const onPopoverOpenChange = (e: OpenPopoverEvents, data: OnOpenChangeData): void => {\n if (!preventDefaultClose.current) {\n // We set all open state to false if preventDefaultClose was not set to true and the popover is closing.\n if (!data.open) {\n clearTimeout();\n closeCallback();\n removeOpenedByHoverPreview(popoverSurfaceId);\n }\n\n onOpenChange?.(e, data);\n }\n\n preventDefaultClose.current = false;\n };\n\n let resolvedChildren = children as [JSX.Element, JSX.Element] | JSX.Element;\n if (popoverSurface) {\n if (popoverTrigger) {\n resolvedChildren = [popoverTrigger, popoverSurface];\n } else {\n resolvedChildren = popoverSurface;\n }\n }\n\n const popoverState = usePopover_unstable({\n ...props,\n children: resolvedChildren,\n onOpenChange: onPopoverOpenChange,\n open: open ?? isPopoverOpen,\n unstable_disableAutoFocus: unstable_disableAutoFocus ?? disableAutoFocus,\n });\n\n return {\n ...popoverState,\n isPreviewLocked: previewInternalState.openByClick || previewInternalState.openByKeyboard,\n };\n};\n"],"names":["React","Enter","Escape","mergeCallbacks","useFluent","useId","useIsomorphicLayoutEffect","usePopover_unstable","useTimeout","addOpenedByHoverPreview","closeAllOpenedByHoverPreviews","removeOpenedByHoverPreview","POPOVER_MOUSE_HIDE_DELAY","POPOVER_KEYBOARD_HIDE_DELAY","getDelay","type","usePreview_unstable","props","onOpenChange","open","unstable_disableAutoFocus","children","Children","toArray","targetDocument","setTimeout","clearTimeout","disableAutoFocus","setDisableAutoFocus","useState","current","previewInternalState","useRef","openByClick","openByHoverOverTrigger","openByHoverOverPopover","openByKeyboard","isOpen","isPopoverOpen","setIsPopoverOpen","preventDefaultClose","popoverTrigger","undefined","popoverSurface","length","popoverSurfaceId","id","closeCallback","useEffect","handleTriggerTargetEnter","e","handleTriggerTargetLeave","handleTriggerClick","tmpOpenByHoverOverTrigger","handleTriggerKeyDown","key","preventDefault","handlePopoverTargetEnter","handlePopoverTargetLeave","cloneElement","onBlur","onClick","onKeyDown","onMouseEnter","onMouseLeave","onFocus","onDocumentKeyDown","openedByHover","stopPropagation","addEventListener","capture","removeEventListener","onPopoverOpenChange","data","resolvedChildren","popoverState","isPreviewLocked"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,KAAK,EAAEC,MAAM,QAAQ,0BAA0B;AACxD,SACEC,cAAc,EACdC,SAAS,EACTC,KAAK,EACLC,yBAAyB,EACzBC,mBAAmB,QACd,6BAA6B;AACpC,SAASC,UAAU,QAAQ,4BAA4B;AAGvD,SAASC,uBAAuB,EAAEC,6BAA6B,EAAEC,0BAA0B,QAAQ,cAAc;AAUjH,MAAMC,2BAA2B;AACjC,MAAMC,8BAA8B;AAEpC,MAAMC,WAAW,CAACC;IAChB,IAAIA,SAAS,WAAWA,SAAS,QAAQ;QACvC,OAAOF;IACT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pBmB;oBACApC,2BAA2BkC;oBAE3B3B,yBAAAA,mCAAAA,aAAegC,GAAmC;wBAAE/B,MAAM;oBAAM;oBAEhE+B,EAAEkB,eAAe;gBACnB;YACF;YAEA5C,2BAAAA,qCAAAA,eAAgB6C,gBAAgB,CAAC,WAAWH,mBAAmB;gBAAEI,SAAS;YAAK;YAE/E,OAAO;gBACL9C,2BAAAA,qCAAAA,eAAgB+C,mBAAmB,CAAC,WAAWL,mBAAmB;oBAAEI,SAAS;gBAAK;YACpF;QACF;IACF,GAAG;QAAC9C;QAAgBc;KAAc;IAElC,MAAMkC,sBAAsB,CAACtB,GAAsBuB;QACjD,IAAI,CAACjC,oBAAoBV,OAAO,EAAE;YAChC,wGAAwG;YACxG,IAAI,CAAC2C,KAAKtD,IAAI,EAAE;gBACdO;gBACAqB;gBACApC,2BAA2BkC;YAC7B;YAEA3B,yBAAAA,mCAAAA,aAAegC,GAAGuB;QACpB;QAEAjC,oBAAoBV,OAAO,GAAG;IAChC;IAEA,IAAI4C,mBAAmBrD;IACvB,IAAIsB,gBAAgB;QAClB,IAAIF,gBAAgB;YAClBiC,mBAAmB;gBAACjC;gBAAgBE;aAAe;QACrD,OAAO;YACL+B,mBAAmB/B;QACrB;IACF;IAEA,MAAMgC,eAAepE,oBAAoB;QACvC,GAAGU,KAAK;QACRI,UAAUqD;QACVxD,cAAcsD;QACdrD,MAAMA,iBAAAA,kBAAAA,OAAQmB;QACdlB,2BAA2BA,sCAAAA,uCAAAA,4BAA6BO;IAC1D;IAEA,OAAO;QACL,GAAGgD,YAAY;QACfC,iBAAiB7C,qBAAqBE,WAAW,IAAIF,qBAAqBK,cAAc;IAC1F;AACF,EAAE"}
|
|
1
|
+
{"version":3,"sources":["usePreview.ts"],"sourcesContent":["import * as React from 'react';\n\nimport { Enter, Escape } from '@fluentui/keyboard-keys';\nimport {\n mergeCallbacks,\n useFluent,\n useId,\n useIsomorphicLayoutEffect,\n usePopover_unstable,\n} from '@fluentui/react-components';\nimport { useTimeout } from '@fluentui/react-utilities';\nimport type { OnOpenChangeData, OpenPopoverEvents } from '@fluentui/react-components';\n\nimport { addOpenedByHoverPreview, closeAllOpenedByHoverPreviews, removeOpenedByHoverPreview } from '../../utils';\nimport type { PreviewProps, PreviewState } from './Preview.types';\n\ntype PreviewInternalState = {\n openByClick: boolean;\n openByHoverOverTrigger: boolean;\n openByHoverOverPopover: boolean;\n openByKeyboard: boolean;\n};\n\nconst POPOVER_MOUSE_HIDE_DELAY = 500;\nconst POPOVER_KEYBOARD_HIDE_DELAY = 0;\n\nconst getDelay = (type: string): number => {\n if (type === 'focus' || type === 'blur') {\n return POPOVER_KEYBOARD_HIDE_DELAY;\n }\n\n return POPOVER_MOUSE_HIDE_DELAY;\n};\n\ntype TargetEvent<T> = React.MouseEvent<T> | React.FocusEvent<T>;\n\n/**\n * Create the state required to render Preview.\n *\n * The returned state can be modified with hooks such as usePreviewStyles_unstable,\n * before being passed to renderPreview_unstable.\n *\n * @param props - props from this instance of Preview\n * @param ref - reference to root HTMLElement of Preview\n */\nexport const usePreview_unstable = (props: PreviewProps): PreviewState => {\n const { onOpenChange, open, unstable_disableAutoFocus } = props;\n\n const children = React.Children.toArray(props.children) as React.ReactElement[];\n\n const { targetDocument } = useFluent();\n const [setTimeout, clearTimeout] = useTimeout();\n\n const [disableAutoFocus, setDisableAutoFocus] = React.useState(true);\n\n const { current: previewInternalState } = React.useRef<PreviewInternalState>({\n openByClick: false,\n openByHoverOverTrigger: false,\n openByHoverOverPopover: false,\n openByKeyboard: false,\n });\n\n const isOpen = () => {\n return (\n previewInternalState.openByClick ||\n previewInternalState.openByHoverOverTrigger ||\n previewInternalState.openByHoverOverPopover ||\n previewInternalState.openByKeyboard\n );\n };\n\n const [isPopoverOpen, setIsPopoverOpen] = React.useState(false);\n const preventDefaultClose = React.useRef(false);\n\n let popoverTrigger: React.ReactElement | undefined = undefined;\n let popoverSurface: React.ReactElement | undefined = undefined;\n if (children.length === 2) {\n popoverTrigger = children[0];\n popoverSurface = children[1];\n } else if (children.length === 1) {\n popoverSurface = children[0];\n }\n\n const popoverSurfaceId = useId('preview-surface', popoverSurface?.props.id);\n\n const closeCallback = () => {\n previewInternalState.openByClick = false;\n previewInternalState.openByHoverOverTrigger = false;\n previewInternalState.openByHoverOverPopover = false;\n previewInternalState.openByKeyboard = false;\n setIsPopoverOpen(isOpen());\n };\n\n React.useEffect(() => {\n return () => {\n // Remove all instances of the current popover from the openedByHoverPreviewManager when the component is unmounted.\n removeOpenedByHoverPreview(popoverSurfaceId);\n };\n }, [popoverSurfaceId]);\n\n if (popoverSurface && popoverTrigger) {\n const handleTriggerTargetEnter = (e: TargetEvent<HTMLSpanElement>): void => {\n previewInternalState.openByHoverOverTrigger = true;\n\n // We want to disable auto focus only if the popover is being opened by hovering over the trigger\n if (!previewInternalState.openByClick && !previewInternalState.openByKeyboard && !isPopoverOpen) {\n setDisableAutoFocus(true);\n onOpenChange?.(e, { open: true });\n closeAllOpenedByHoverPreviews(popoverSurfaceId);\n addOpenedByHoverPreview(popoverSurfaceId, closeCallback);\n }\n\n setIsPopoverOpen(isOpen());\n };\n\n const handleTriggerTargetLeave = (e: TargetEvent<HTMLSpanElement>): void => {\n previewInternalState.openByHoverOverTrigger = false;\n setTimeout(() => {\n setIsPopoverOpen(isOpen());\n\n // We want to call onOpenChange only if the popover is actually closing when leaving the trigger\n if (\n !previewInternalState.openByClick &&\n !previewInternalState.openByKeyboard &&\n !previewInternalState.openByHoverOverPopover &&\n isPopoverOpen\n ) {\n onOpenChange?.(e, { open: false });\n removeOpenedByHoverPreview(popoverSurfaceId);\n }\n }, getDelay(e.type));\n };\n\n const handleTriggerClick = (e: TargetEvent<HTMLSpanElement>): void => {\n // Setting preventDefaultClose so that onPopoverOpenChange does not apply its logic when click is on the trigger as we want to control that behavior.\n preventDefaultClose.current = true;\n\n // We set disableAutoFocus to false so that interactive elements within popover can be focused when it opens via click.\n setDisableAutoFocus(false);\n\n const tmpOpenByHoverOverTrigger = previewInternalState.openByHoverOverTrigger;\n\n // If openByKeyboard is true, then the popover was already opened via keyboard and we always want to close it.\n previewInternalState.openByClick = previewInternalState.openByKeyboard\n ? false\n : !previewInternalState.openByClick;\n previewInternalState.openByHoverOverTrigger = false;\n previewInternalState.openByHoverOverPopover = false;\n previewInternalState.openByKeyboard = false;\n\n if (!tmpOpenByHoverOverTrigger) {\n onOpenChange?.(e, { open: previewInternalState.openByClick });\n }\n\n if (!isOpen()) {\n removeOpenedByHoverPreview(popoverSurfaceId);\n }\n\n setIsPopoverOpen(isOpen());\n };\n\n const handleTriggerKeyDown = (e: React.KeyboardEvent<HTMLSpanElement>): void => {\n if (e.key === Enter) {\n clearTimeout();\n\n // Setting default prevented so that Enter key does not trigger a click event or onPopoverOpenChange.\n e.preventDefault();\n\n // We set disableAutoFocus to false so that interactive elements within popover can be focused when it opens via keyboard.\n setDisableAutoFocus(false);\n\n const tmpOpenByHoverOverTrigger = previewInternalState.openByHoverOverTrigger;\n\n // If openByClick is true, then the popover was already opened via click and we always want to close it.\n previewInternalState.openByKeyboard = previewInternalState.openByClick\n ? false\n : !previewInternalState.openByKeyboard;\n previewInternalState.openByClick = false;\n previewInternalState.openByHoverOverTrigger = false;\n previewInternalState.openByHoverOverPopover = false;\n\n if (!tmpOpenByHoverOverTrigger) {\n onOpenChange?.(e, { open: previewInternalState.openByKeyboard });\n }\n\n if (!isOpen()) {\n removeOpenedByHoverPreview(popoverSurfaceId);\n }\n\n setIsPopoverOpen(isOpen());\n }\n };\n\n const handlePopoverTargetEnter = (e: TargetEvent<HTMLDivElement>): void => {\n previewInternalState.openByHoverOverPopover = true;\n setIsPopoverOpen(isOpen());\n };\n\n const handlePopoverTargetLeave = (e: TargetEvent<HTMLDivElement>): void => {\n previewInternalState.openByHoverOverPopover = false;\n setTimeout(() => {\n setIsPopoverOpen(isOpen());\n\n // We want to call onOpenChange only if the popover is actually closing when leaving the popover\n if (\n !previewInternalState.openByClick &&\n !previewInternalState.openByKeyboard &&\n !previewInternalState.openByHoverOverTrigger\n ) {\n onOpenChange?.(e, { open: false });\n removeOpenedByHoverPreview(popoverSurfaceId);\n }\n }, getDelay(e.type));\n };\n\n popoverTrigger = React.cloneElement(popoverTrigger, {\n ...popoverTrigger.props,\n children: React.cloneElement(popoverTrigger.props.children as React.ReactElement, {\n ...popoverTrigger.props.children.props,\n onBlur: mergeCallbacks(popoverTrigger.props.children.props.onBlur, handleTriggerTargetLeave),\n onClick: mergeCallbacks(popoverTrigger.props.children.props.onClick, handleTriggerClick),\n onKeyDown: mergeCallbacks(popoverTrigger.props.children.props.onKeyDown, handleTriggerKeyDown),\n onMouseEnter: mergeCallbacks(popoverTrigger.props.children.props.onMouseEnter, handleTriggerTargetEnter),\n onMouseLeave: mergeCallbacks(popoverTrigger.props.children.props.onMouseLeave, handleTriggerTargetLeave),\n }),\n });\n\n popoverSurface = React.cloneElement(popoverSurface, {\n ...popoverSurface.props,\n 'aria-labelledby':\n popoverSurface.props['aria-labelledby'] ?? popoverSurface.props['aria-label'] ? undefined : popoverSurfaceId,\n id: popoverSurfaceId,\n onMouseEnter: mergeCallbacks(popoverSurface.props.onMouseEnter, handlePopoverTargetEnter),\n onMouseLeave: mergeCallbacks(popoverSurface.props.onMouseLeave, handlePopoverTargetLeave),\n onFocus: mergeCallbacks(popoverSurface.props.onFocus, handlePopoverTargetEnter),\n });\n }\n\n // Hitting Escape key 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 trigger or popover.\n useIsomorphicLayoutEffect(() => {\n if (isPopoverOpen) {\n const onDocumentKeyDown = (e: KeyboardEvent) => {\n const openedByHover = !previewInternalState.openByClick && !previewInternalState.openByKeyboard;\n\n if (openedByHover && e.key === Escape) {\n clearTimeout();\n\n // We set state back to its default if the Escape key has been pressed\n setDisableAutoFocus(true);\n closeCallback();\n removeOpenedByHoverPreview(popoverSurfaceId);\n\n onOpenChange?.(e as unknown as OpenPopoverEvents, { open: false });\n\n e.stopPropagation();\n }\n };\n\n targetDocument?.addEventListener('keydown', onDocumentKeyDown, { capture: true });\n\n return () => {\n targetDocument?.removeEventListener('keydown', onDocumentKeyDown, { capture: true });\n };\n }\n }, [targetDocument, isPopoverOpen]);\n\n const onPopoverOpenChange = (e: OpenPopoverEvents, data: OnOpenChangeData): void => {\n if (!preventDefaultClose.current) {\n // We set all open state to false if preventDefaultClose was not set to true and the popover is closing.\n if (!data.open) {\n clearTimeout();\n closeCallback();\n removeOpenedByHoverPreview(popoverSurfaceId);\n }\n\n onOpenChange?.(e, data);\n }\n\n preventDefaultClose.current = false;\n };\n\n let resolvedChildren = children as [JSX.Element, JSX.Element] | JSX.Element;\n if (popoverSurface) {\n if (popoverTrigger) {\n resolvedChildren = [popoverTrigger, popoverSurface];\n } else {\n resolvedChildren = popoverSurface;\n }\n }\n\n const popoverState = usePopover_unstable({\n ...props,\n children: resolvedChildren,\n onOpenChange: onPopoverOpenChange,\n open: open ?? isPopoverOpen,\n unstable_disableAutoFocus: unstable_disableAutoFocus ?? disableAutoFocus,\n });\n\n return {\n ...popoverState,\n isPreviewLocked: previewInternalState.openByClick || previewInternalState.openByKeyboard,\n };\n};\n"],"names":["React","Enter","Escape","mergeCallbacks","useFluent","useId","useIsomorphicLayoutEffect","usePopover_unstable","useTimeout","addOpenedByHoverPreview","closeAllOpenedByHoverPreviews","removeOpenedByHoverPreview","POPOVER_MOUSE_HIDE_DELAY","POPOVER_KEYBOARD_HIDE_DELAY","getDelay","type","usePreview_unstable","props","onOpenChange","open","unstable_disableAutoFocus","children","Children","toArray","targetDocument","setTimeout","clearTimeout","disableAutoFocus","setDisableAutoFocus","useState","current","previewInternalState","useRef","openByClick","openByHoverOverTrigger","openByHoverOverPopover","openByKeyboard","isOpen","isPopoverOpen","setIsPopoverOpen","preventDefaultClose","popoverTrigger","undefined","popoverSurface","length","popoverSurfaceId","id","closeCallback","useEffect","handleTriggerTargetEnter","e","handleTriggerTargetLeave","handleTriggerClick","tmpOpenByHoverOverTrigger","handleTriggerKeyDown","key","preventDefault","handlePopoverTargetEnter","handlePopoverTargetLeave","cloneElement","onBlur","onClick","onKeyDown","onMouseEnter","onMouseLeave","onFocus","onDocumentKeyDown","openedByHover","stopPropagation","addEventListener","capture","removeEventListener","onPopoverOpenChange","data","resolvedChildren","popoverState","isPreviewLocked"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,KAAK,EAAEC,MAAM,QAAQ,0BAA0B;AACxD,SACEC,cAAc,EACdC,SAAS,EACTC,KAAK,EACLC,yBAAyB,EACzBC,mBAAmB,QACd,6BAA6B;AACpC,SAASC,UAAU,QAAQ,4BAA4B;AAGvD,SAASC,uBAAuB,EAAEC,6BAA6B,EAAEC,0BAA0B,QAAQ,cAAc;AAUjH,MAAMC,2BAA2B;AACjC,MAAMC,8BAA8B;AAEpC,MAAMC,WAAW,CAACC;IAChB,IAAIA,SAAS,WAAWA,SAAS,QAAQ;QACvC,OAAOF;IACT;IAEA,OAAOD;AACT;AAIA;;;;;;;;CAQC,GACD,OAAO,MAAMI,sBAAsB,CAACC;IAClC,MAAM,EAAEC,YAAY,EAAEC,IAAI,EAAEC,yBAAyB,EAAE,GAAGH;IAE1D,MAAMI,WAAWrB,MAAMsB,QAAQ,CAACC,OAAO,CAACN,MAAMI,QAAQ;IAEtD,MAAM,EAAEG,cAAc,EAAE,GAAGpB;IAC3B,MAAM,CAACqB,YAAYC,aAAa,GAAGlB;IAEnC,MAAM,CAACmB,kBAAkBC,oBAAoB,GAAG5B,MAAM6B,QAAQ,CAAC;I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AAMkC,sBAAsB,CAACtB,GAAsBuB;QACjD,IAAI,CAACjC,oBAAoBV,OAAO,EAAE;YAChC,wGAAwG;YACxG,IAAI,CAAC2C,KAAKtD,IAAI,EAAE;gBACdO;gBACAqB;gBACApC,2BAA2BkC;YAC7B;YAEA3B,yBAAAA,mCAAAA,aAAegC,GAAGuB;QACpB;QAEAjC,oBAAoBV,OAAO,GAAG;IAChC;IAEA,IAAI4C,mBAAmBrD;IACvB,IAAIsB,gBAAgB;QAClB,IAAIF,gBAAgB;YAClBiC,mBAAmB;gBAACjC;gBAAgBE;aAAe;QACrD,OAAO;YACL+B,mBAAmB/B;QACrB;IACF;IAEA,MAAMgC,eAAepE,oBAAoB;QACvC,GAAGU,KAAK;QACRI,UAAUqD;QACVxD,cAAcsD;QACdrD,MAAMA,iBAAAA,kBAAAA,OAAQmB;QACdlB,2BAA2BA,sCAAAA,uCAAAA,4BAA6BO;IAC1D;IAEA,OAAO;QACL,GAAGgD,YAAY;QACfC,iBAAiB7C,qBAAqBE,WAAW,IAAIF,qBAAqBK,cAAc;IAC1F;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PreviewContent.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePreviewContent_unstable } from './usePreviewContent';\nimport { renderPreviewContent_unstable } from './renderPreviewContent';\nimport { usePreviewContentStyles_unstable } from './usePreviewContentStyles';\nimport type { PreviewContentProps } from './PreviewContent.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\nexport const PreviewContent: ForwardRefComponent<PreviewContentProps> = React.forwardRef((props, ref) => {\n const state = usePreviewContent_unstable(props, ref);\n\n usePreviewContentStyles_unstable(state);\n return renderPreviewContent_unstable(state);\n});\n\nPreviewContent.displayName = 'PreviewContent';\n"],"names":["React","usePreviewContent_unstable","renderPreviewContent_unstable","usePreviewContentStyles_unstable","PreviewContent","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,4BAA4B;AAI7E,OAAO,MAAMC,+BAA2DJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQP,2BAA2BK,OAAOC;IAEhDJ,iCAAiCK;IACjC,OAAON,8BAA8BM;AACvC,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["PreviewContent.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePreviewContent_unstable } from './usePreviewContent';\nimport { renderPreviewContent_unstable } from './renderPreviewContent';\nimport { usePreviewContentStyles_unstable } from './usePreviewContentStyles';\nimport type { PreviewContentProps } from './PreviewContent.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\nexport const PreviewContent: ForwardRefComponent<PreviewContentProps> = React.forwardRef((props, ref) => {\n const state = usePreviewContent_unstable(props, ref);\n\n usePreviewContentStyles_unstable(state);\n return renderPreviewContent_unstable(state);\n});\n\nPreviewContent.displayName = 'PreviewContent';\n"],"names":["React","usePreviewContent_unstable","renderPreviewContent_unstable","usePreviewContentStyles_unstable","PreviewContent","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,4BAA4B;AAI7E,OAAO,MAAMC,+BAA2DJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQP,2BAA2BK,OAAOC;IAEhDJ,iCAAiCK;IACjC,OAAON,8BAA8BM;AACvC,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PreviewContent.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type PreviewContentSlots = {\n root: NonNullable<Slot<'div'>>;\n};\n\n/**\n * PreviewContent Props\n */\nexport type PreviewContentProps = ComponentProps<PreviewContentSlots>;\n\n/**\n * State used in rendering PreviewContent\n */\nexport type PreviewContentState = ComponentState<PreviewContentSlots>;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["PreviewContent.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type PreviewContentSlots = {\n root: NonNullable<Slot<'div'>>;\n};\n\n/**\n * PreviewContent Props\n */\nexport type PreviewContentProps = ComponentProps<PreviewContentSlots>;\n\n/**\n * State used in rendering PreviewContent\n */\nexport type PreviewContentState = ComponentState<PreviewContentSlots>;\n"],"names":[],"rangeMappings":";;","mappings":"AAWA;;CAEC,GACD,WAAsE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './PreviewContent';\nexport * from './PreviewContent.types';\nexport * from './renderPreviewContent';\nexport * from './usePreviewContent';\nexport * from './usePreviewContentStyles';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,sBAAsB;AACpC,cAAc,4BAA4B"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './PreviewContent';\nexport * from './PreviewContent.types';\nexport * from './renderPreviewContent';\nexport * from './usePreviewContent';\nexport * from './usePreviewContentStyles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,sBAAsB;AACpC,cAAc,4BAA4B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderPreviewContent.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { PreviewContentState, PreviewContentSlots } from './PreviewContent.types';\n\n/**\n * Render the final JSX of PreviewContent\n */\nexport const renderPreviewContent_unstable = (state: PreviewContentState) => {\n assertSlots<PreviewContentSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderPreviewContent_unstable","state","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AAGzD;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAACC;IAC5CF,YAAiCE;IAEjC,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
|
|
1
|
+
{"version":3,"sources":["renderPreviewContent.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { PreviewContentState, PreviewContentSlots } from './PreviewContent.types';\n\n/**\n * Render the final JSX of PreviewContent\n */\nexport const renderPreviewContent_unstable = (state: PreviewContentState) => {\n assertSlots<PreviewContentSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderPreviewContent_unstable","state","root"],"rangeMappings":";;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AAGzD;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAACC;IAC5CF,YAAiCE;IAEjC,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePreviewContent.ts"],"sourcesContent":["import type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-components';\nimport type { PreviewContentProps, PreviewContentState } from './PreviewContent.types';\n\n/**\n * Create the state required to render PreviewContent.\n *\n * The returned state can be modified with hooks such as usePreviewContentStyles_unstable,\n * before being passed to renderPreviewContent_unstable.\n *\n * @param props - props from this instance of PreviewContent\n * @param ref - reference to root HTMLElement of PreviewContent\n */\nexport const usePreviewContent_unstable = (\n props: PreviewContentProps,\n ref: React.Ref<HTMLDivElement>,\n): PreviewContentState => {\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["getIntrinsicElementProps","slot","usePreviewContent_unstable","props","ref","components","root","always","elementType"],"mappings":"AACA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,6BAA6B;AAG5E;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,OAAO;QACLC,YAAY;YACVC,MAAM;QACR;QACAA,MAAML,KAAKM,MAAM,CACfP,yBAAyB,OAAO;YAC9BI;YACA,GAAGD,KAAK;QACV,IACA;YAAEK,aAAa;QAAM;IAEzB;AACF,EAAE"}
|
|
1
|
+
{"version":3,"sources":["usePreviewContent.ts"],"sourcesContent":["import type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-components';\nimport type { PreviewContentProps, PreviewContentState } from './PreviewContent.types';\n\n/**\n * Create the state required to render PreviewContent.\n *\n * The returned state can be modified with hooks such as usePreviewContentStyles_unstable,\n * before being passed to renderPreviewContent_unstable.\n *\n * @param props - props from this instance of PreviewContent\n * @param ref - reference to root HTMLElement of PreviewContent\n */\nexport const usePreviewContent_unstable = (\n props: PreviewContentProps,\n ref: React.Ref<HTMLDivElement>,\n): PreviewContentState => {\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["getIntrinsicElementProps","slot","usePreviewContent_unstable","props","ref","components","root","always","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":"AACA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,6BAA6B;AAG5E;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,OAAO;QACLC,YAAY;YACVC,MAAM;QACR;QACAA,MAAML,KAAKM,MAAM,CACfP,yBAAyB,OAAO;YAC9BI;YACA,GAAGD,KAAK;QACV,IACA;YAAEK,aAAa;QAAM;IAEzB;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePreviewContentStyles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { PreviewContentSlots, PreviewContentState } from './PreviewContent.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const previewContentClassNames: SlotClassNames<PreviewContentSlots> = {\n root: 'fai-PreviewContent',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = makeResetStyles({\n color: tokens.colorNeutralForeground3,\n display: 'flex',\n flexDirection: 'column',\n ...shorthands.padding(tokens.spacingVerticalS, tokens.spacingHorizontalS),\n rowGap: tokens.spacingVerticalXS,\n wordBreak: 'break-word',\n\n ...typographyStyles.caption1,\n});\n\n/**\n * Apply styling to the PreviewContent slots based on the state\n */\nexport const usePreviewContentStyles_unstable = (state: PreviewContentState): PreviewContentState => {\n const rootBaseClassName = useRootBaseClassName();\n\n state.root.className = mergeClasses(previewContentClassNames.root, rootBaseClassName, state.root.className);\n\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","shorthands","tokens","typographyStyles","previewContentClassNames","root","useRootBaseClassName","color","colorNeutralForeground3","display","flexDirection","padding","spacingVerticalS","spacingHorizontalS","rowGap","spacingVerticalXS","wordBreak","caption1","usePreviewContentStyles_unstable","state","rootBaseClassName","className"],"mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,EAAEC,UAAU,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,6BAA6B;AAIjH,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,uBAAuBP,gBAAgB;IAC3CQ,OAAOL,OAAOM,uBAAuB;IACrCC,SAAS;IACTC,eAAe;IACf,GAAGT,WAAWU,OAAO,CAACT,OAAOU,gBAAgB,EAAEV,OAAOW,kBAAkB,CAAC;IACzEC,QAAQZ,OAAOa,iBAAiB;IAChCC,WAAW;IAEX,GAAGb,iBAAiBc,QAAQ;AAC9B;AAEA;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAACC;IAC/C,MAAMC,oBAAoBd;IAE1Ba,MAAMd,IAAI,CAACgB,SAAS,GAAGrB,aAAaI,yBAAyBC,IAAI,EAAEe,mBAAmBD,MAAMd,IAAI,CAACgB,SAAS;IAE1G,OAAOF;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["usePreviewContentStyles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { PreviewContentSlots, PreviewContentState } from './PreviewContent.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const previewContentClassNames: SlotClassNames<PreviewContentSlots> = {\n root: 'fai-PreviewContent',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = makeResetStyles({\n color: tokens.colorNeutralForeground3,\n display: 'flex',\n flexDirection: 'column',\n ...shorthands.padding(tokens.spacingVerticalS, tokens.spacingHorizontalS),\n rowGap: tokens.spacingVerticalXS,\n wordBreak: 'break-word',\n\n ...typographyStyles.caption1,\n});\n\n/**\n * Apply styling to the PreviewContent slots based on the state\n */\nexport const usePreviewContentStyles_unstable = (state: PreviewContentState): PreviewContentState => {\n const rootBaseClassName = useRootBaseClassName();\n\n state.root.className = mergeClasses(previewContentClassNames.root, rootBaseClassName, state.root.className);\n\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","shorthands","tokens","typographyStyles","previewContentClassNames","root","useRootBaseClassName","color","colorNeutralForeground3","display","flexDirection","padding","spacingVerticalS","spacingHorizontalS","rowGap","spacingVerticalXS","wordBreak","caption1","usePreviewContentStyles_unstable","state","rootBaseClassName","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,EAAEC,UAAU,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,6BAA6B;AAIjH,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,uBAAuBP,gBAAgB;IAC3CQ,OAAOL,OAAOM,uBAAuB;IACrCC,SAAS;IACTC,eAAe;IACf,GAAGT,WAAWU,OAAO,CAACT,OAAOU,gBAAgB,EAAEV,OAAOW,kBAAkB,CAAC;IACzEC,QAAQZ,OAAOa,iBAAiB;IAChCC,WAAW;IAEX,GAAGb,iBAAiBc,QAAQ;AAC9B;AAEA;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAACC;IAC/C,MAAMC,oBAAoBd;IAE1Ba,MAAMd,IAAI,CAACgB,SAAS,GAAGrB,aAAaI,yBAAyBC,IAAI,EAAEe,mBAAmBD,MAAMd,IAAI,CAACgB,SAAS;IAE1G,OAAOF;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PreviewHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePreviewHeader_unstable } from './usePreviewHeader';\nimport { renderPreviewHeader_unstable } from './renderPreviewHeader';\nimport { usePreviewHeaderStyles_unstable } from './usePreviewHeaderStyles';\nimport type { PreviewHeaderProps } from './PreviewHeader.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\nexport const PreviewHeader: ForwardRefComponent<PreviewHeaderProps> = React.forwardRef((props, ref) => {\n const state = usePreviewHeader_unstable(props, ref);\n\n usePreviewHeaderStyles_unstable(state);\n return renderPreviewHeader_unstable(state);\n});\n\nPreviewHeader.displayName = 'PreviewHeader';\n"],"names":["React","usePreviewHeader_unstable","renderPreviewHeader_unstable","usePreviewHeaderStyles_unstable","PreviewHeader","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,4BAA4B,QAAQ,wBAAwB;AACrE,SAASC,+BAA+B,QAAQ,2BAA2B;AAI3E,OAAO,MAAMC,8BAAyDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,QAAQP,0BAA0BK,OAAOC;IAE/CJ,gCAAgCK;IAChC,OAAON,6BAA6BM;AACtC,GAAG;AAEHJ,cAAcK,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["PreviewHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePreviewHeader_unstable } from './usePreviewHeader';\nimport { renderPreviewHeader_unstable } from './renderPreviewHeader';\nimport { usePreviewHeaderStyles_unstable } from './usePreviewHeaderStyles';\nimport type { PreviewHeaderProps } from './PreviewHeader.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\nexport const PreviewHeader: ForwardRefComponent<PreviewHeaderProps> = React.forwardRef((props, ref) => {\n const state = usePreviewHeader_unstable(props, ref);\n\n usePreviewHeaderStyles_unstable(state);\n return renderPreviewHeader_unstable(state);\n});\n\nPreviewHeader.displayName = 'PreviewHeader';\n"],"names":["React","usePreviewHeader_unstable","renderPreviewHeader_unstable","usePreviewHeaderStyles_unstable","PreviewHeader","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,4BAA4B,QAAQ,wBAAwB;AACrE,SAASC,+BAA+B,QAAQ,2BAA2B;AAI3E,OAAO,MAAMC,8BAAyDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,QAAQP,0BAA0BK,OAAOC;IAE/CJ,gCAAgCK;IAChC,OAAON,6BAA6BM;AACtC,GAAG;AAEHJ,cAAcK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PreviewHeader.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type PreviewHeaderSlots = {\n root: NonNullable<Slot<'div'>>;\n\n /**\n * Actions slot.\n */\n actions: Slot<'div'>;\n\n /**\n * Citation slot. Displays a `Citation`. Set to `null` to hide the citation.\n */\n citation: Slot<'span'>;\n\n /**\n * Label slot. Primary description of the preview.\n */\n label: NonNullable<Slot<'span'>>;\n\n /**\n * Media slot. Used to display Avatars, Icons, etc.\n */\n media: Slot<'div'>;\n};\n\n/**\n * PreviewHeader Props\n */\nexport type PreviewHeaderProps = ComponentProps<Partial<PreviewHeaderSlots>>;\n\n/**\n * State used in rendering PreviewHeader\n */\nexport type PreviewHeaderState = ComponentState<PreviewHeaderSlots>;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["PreviewHeader.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type PreviewHeaderSlots = {\n root: NonNullable<Slot<'div'>>;\n\n /**\n * Actions slot.\n */\n actions: Slot<'div'>;\n\n /**\n * Citation slot. Displays a `Citation`. Set to `null` to hide the citation.\n */\n citation: Slot<'span'>;\n\n /**\n * Label slot. Primary description of the preview.\n */\n label: NonNullable<Slot<'span'>>;\n\n /**\n * Media slot. Used to display Avatars, Icons, etc.\n */\n media: Slot<'div'>;\n};\n\n/**\n * PreviewHeader Props\n */\nexport type PreviewHeaderProps = ComponentProps<Partial<PreviewHeaderSlots>>;\n\n/**\n * State used in rendering PreviewHeader\n */\nexport type PreviewHeaderState = ComponentState<PreviewHeaderSlots>;\n"],"names":[],"rangeMappings":";;","mappings":"AA+BA;;CAEC,GACD,WAAoE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './PreviewHeader';\nexport * from './PreviewHeader.types';\nexport * from './renderPreviewHeader';\nexport * from './usePreviewHeader';\nexport * from './usePreviewHeaderStyles';\n"],"names":[],"mappings":"AAAA,cAAc,kBAAkB;AAChC,cAAc,wBAAwB;AACtC,cAAc,wBAAwB;AACtC,cAAc,qBAAqB;AACnC,cAAc,2BAA2B"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './PreviewHeader';\nexport * from './PreviewHeader.types';\nexport * from './renderPreviewHeader';\nexport * from './usePreviewHeader';\nexport * from './usePreviewHeaderStyles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,kBAAkB;AAChC,cAAc,wBAAwB;AACtC,cAAc,wBAAwB;AACtC,cAAc,qBAAqB;AACnC,cAAc,2BAA2B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderPreviewHeader.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { PreviewHeaderState, PreviewHeaderSlots } from './PreviewHeader.types';\n\n/**\n * Render the final JSX of PreviewHeader\n */\nexport const renderPreviewHeader_unstable = (state: PreviewHeaderState) => {\n assertSlots<PreviewHeaderSlots>(state);\n\n return (\n <state.root>\n {state.citation && <state.citation />}\n {state.media && <state.media />}\n <state.label />\n {state.actions && <state.actions />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderPreviewHeader_unstable","state","root","citation","media","label","actions"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AAGzD;;CAEC,GACD,OAAO,MAAMC,+BAA+B,CAACC;IAC3CF,YAAgCE;IAEhC,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,QAAQ,kBAAI,KAACF,MAAME,QAAQ;YACjCF,MAAMG,KAAK,kBAAI,KAACH,MAAMG,KAAK;0BAC5B,KAACH,MAAMI,KAAK;YACXJ,MAAMK,OAAO,kBAAI,KAACL,MAAMK,OAAO;;;AAGtC,EAAE"}
|
|
1
|
+
{"version":3,"sources":["renderPreviewHeader.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { PreviewHeaderState, PreviewHeaderSlots } from './PreviewHeader.types';\n\n/**\n * Render the final JSX of PreviewHeader\n */\nexport const renderPreviewHeader_unstable = (state: PreviewHeaderState) => {\n assertSlots<PreviewHeaderSlots>(state);\n\n return (\n <state.root>\n {state.citation && <state.citation />}\n {state.media && <state.media />}\n <state.label />\n {state.actions && <state.actions />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderPreviewHeader_unstable","state","root","citation","media","label","actions"],"rangeMappings":";;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AAGzD;;CAEC,GACD,OAAO,MAAMC,+BAA+B,CAACC;IAC3CF,YAAgCE;IAEhC,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,QAAQ,kBAAI,KAACF,MAAME,QAAQ;YACjCF,MAAMG,KAAK,kBAAI,KAACH,MAAMG,KAAK;0BAC5B,KAACH,MAAMI,KAAK;YACXJ,MAAMK,OAAO,kBAAI,KAACL,MAAMK,OAAO;;;AAGtC,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePreviewHeader.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, mergeClasses, slot, useId } from '@fluentui/react-components';\nimport { previewHeaderExtraClassNames } from './usePreviewHeaderStyles';\nimport type { PreviewHeaderProps, PreviewHeaderState } from './PreviewHeader.types';\n\n/**\n * Create the state required to render PreviewHeader.\n *\n * The returned state can be modified with hooks such as usePreviewHeaderStyles_unstable,\n * before being passed to renderPreviewHeader_unstable.\n *\n * @param props - props from this instance of PreviewHeader\n * @param ref - reference to root HTMLElement of PreviewHeader\n */\nexport const usePreviewHeader_unstable = (\n props: PreviewHeaderProps,\n ref: React.Ref<HTMLDivElement>,\n): PreviewHeaderState => {\n const { actions, children, citation, label, media } = props;\n\n const mediaId = useId('media');\n\n const state: PreviewHeaderState = {\n components: {\n root: 'div',\n actions: 'div',\n citation: 'span',\n label: 'span',\n media: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n actions: slot.optional(actions, { elementType: 'div' }),\n citation: slot.optional(citation, { elementType: 'span' }),\n label: slot.always(label, {\n defaultProps: {\n children,\n },\n elementType: 'span',\n }),\n media: slot.optional(media, {\n defaultProps: {\n id: mediaId,\n },\n elementType: 'div',\n }),\n };\n\n if (state.media?.id) {\n state.label['aria-describedby'] = state.label['aria-describedby']?.concat(state.media.id) ?? state.media.id;\n }\n\n if (state.media && React.isValidElement<HTMLElement>(state.media.children)) {\n state.media.children = React.cloneElement(state.media.children, {\n className: mergeClasses(state.media.children.props.className, previewHeaderExtraClassNames.mediaChild),\n });\n }\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","mergeClasses","slot","useId","previewHeaderExtraClassNames","usePreviewHeader_unstable","props","ref","state","actions","children","citation","label","media","mediaId","components","root","always","elementType","optional","defaultProps","id","concat","isValidElement","cloneElement","className","mediaChild"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,YAAY,EAAEC,IAAI,EAAEC,KAAK,QAAQ,6BAA6B;AACjG,SAASC,4BAA4B,QAAQ,2BAA2B;AAGxE;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;QAqCIC;IAnCJ,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGP;IAEtD,MAAMQ,UAAUX,MAAM;IAEtB,MAAMK,QAA4B;QAChCO,YAAY;YACVC,MAAM;YACNP,SAAS;YACTE,UAAU;YACVC,OAAO;YACPC,OAAO;QACT;QACAG,MAAMd,KAAKe,MAAM,CACfjB,yBAAyB,OAAO;YAC9BO;YACA,GAAGD,KAAK;QACV,IACA;YAAEY,aAAa;QAAM;QAEvBT,SAASP,KAAKiB,QAAQ,CAACV,SAAS;YAAES,aAAa;QAAM;QACrDP,UAAUT,KAAKiB,QAAQ,CAACR,UAAU;YAAEO,aAAa;QAAO;QACxDN,OAAOV,KAAKe,MAAM,CAACL,OAAO;YACxBQ,cAAc;gBACZV;YACF;YACAQ,aAAa;QACf;QACAL,OAAOX,KAAKiB,QAAQ,CAACN,OAAO;YAC1BO,cAAc;gBACZC,IAAIP;YACN;YACAI,aAAa;QACf;IACF;IAEA,KAAIV,eAAAA,MAAMK,KAAK,cAAXL,mCAAAA,aAAaa,EAAE,EAAE;YACeb;YAAAA;QAAlCA,MAAMI,KAAK,CAAC,mBAAmB,GAAGJ,CAAAA,uCAAAA,+BAAAA,MAAMI,KAAK,CAAC,mBAAmB,cAA/BJ,mDAAAA,6BAAiCc,MAAM,CAACd,MAAMK,KAAK,CAACQ,EAAE,eAAtDb,iDAAAA,sCAA2DA,MAAMK,KAAK,CAACQ,EAAE;IAC7G;IAEA,IAAIb,MAAMK,KAAK,IAAId,MAAMwB,cAAc,CAAcf,MAAMK,KAAK,CAACH,QAAQ,GAAG;QAC1EF,MAAMK,KAAK,CAACH,QAAQ,GAAGX,MAAMyB,YAAY,CAAChB,MAAMK,KAAK,CAACH,QAAQ,EAAE;YAC9De,WAAWxB,aAAaO,MAAMK,KAAK,CAACH,QAAQ,CAACJ,KAAK,CAACmB,SAAS,EAAErB,6BAA6BsB,UAAU;QACvG;IACF;IAEA,OAAOlB;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["usePreviewHeader.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, mergeClasses, slot, useId } from '@fluentui/react-components';\nimport { previewHeaderExtraClassNames } from './usePreviewHeaderStyles';\nimport type { PreviewHeaderProps, PreviewHeaderState } from './PreviewHeader.types';\n\n/**\n * Create the state required to render PreviewHeader.\n *\n * The returned state can be modified with hooks such as usePreviewHeaderStyles_unstable,\n * before being passed to renderPreviewHeader_unstable.\n *\n * @param props - props from this instance of PreviewHeader\n * @param ref - reference to root HTMLElement of PreviewHeader\n */\nexport const usePreviewHeader_unstable = (\n props: PreviewHeaderProps,\n ref: React.Ref<HTMLDivElement>,\n): PreviewHeaderState => {\n const { actions, children, citation, label, media } = props;\n\n const mediaId = useId('media');\n\n const state: PreviewHeaderState = {\n components: {\n root: 'div',\n actions: 'div',\n citation: 'span',\n label: 'span',\n media: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n actions: slot.optional(actions, { elementType: 'div' }),\n citation: slot.optional(citation, { elementType: 'span' }),\n label: slot.always(label, {\n defaultProps: {\n children,\n },\n elementType: 'span',\n }),\n media: slot.optional(media, {\n defaultProps: {\n id: mediaId,\n },\n elementType: 'div',\n }),\n };\n\n if (state.media?.id) {\n state.label['aria-describedby'] = state.label['aria-describedby']?.concat(state.media.id) ?? state.media.id;\n }\n\n if (state.media && React.isValidElement<HTMLElement>(state.media.children)) {\n state.media.children = React.cloneElement(state.media.children, {\n className: mergeClasses(state.media.children.props.className, previewHeaderExtraClassNames.mediaChild),\n });\n }\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","mergeClasses","slot","useId","previewHeaderExtraClassNames","usePreviewHeader_unstable","props","ref","state","actions","children","citation","label","media","mediaId","components","root","always","elementType","optional","defaultProps","id","concat","isValidElement","cloneElement","className","mediaChild"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,YAAY,EAAEC,IAAI,EAAEC,KAAK,QAAQ,6BAA6B;AACjG,SAASC,4BAA4B,QAAQ,2BAA2B;AAGxE;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;QAqCIC;IAnCJ,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,K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eaderStyles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { PreviewHeaderSlots, PreviewHeaderState } from './PreviewHeader.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const previewHeaderClassNames: SlotClassNames<PreviewHeaderSlots> = {\n root: 'fai-PreviewHeader',\n actions: 'fai-PreviewHeader__actions',\n citation: 'fai-PreviewHeader__citation',\n label: 'fai-PreviewHeader__label',\n media: 'fai-PreviewHeader__media',\n};\n\nexport const previewHeaderExtraClassNames = {\n mediaChild: 'fai-PreviewHeader__mediaChild',\n};\n\nconst labelFontSize = typographyStyles.caption1Strong.fontSize;\nconst labelLineHeight = typographyStyles.caption1Strong.lineHeight;\n\nconst useActionsBaseClassName = makeResetStyles({\n gridArea: 'actions',\n justifySelf: 'end',\n});\n\nconst useCitationBaseClassName = makeResetStyles({\n gridArea: 'citation',\n});\n\nconst useLabelBaseClassName = makeResetStyles({\n alignSelf: 'start',\n display: '-webkit-box',\n gridArea: 'label',\n overflowY: 'hidden',\n // 16px is the height of the tallest element within the preview header\n paddingTop: `calc((16px / 2) - (${labelLineHeight} - ${labelFontSize}))`,\n wordBreak: 'break-word',\n\n '-webkit-box-orient': 'vertical',\n '-webkit-line-clamp': '2',\n\n ...typographyStyles.caption1Strong,\n});\n\nconst useMediaBaseClassName = makeResetStyles({\n gridArea: 'media',\n height: '16px',\n lineHeight: 0,\n width: '16px',\n\n [`> .${previewHeaderExtraClassNames.mediaChild}`]: {\n height: '16px',\n width: '16px',\n },\n});\n\nconst useRootBaseClassName = makeResetStyles({\n alignItems: 'center',\n columnGap: tokens.spacingHorizontalXS,\n display: 'grid',\n gridTemplateAreas: `\n \"citation media label actions\"\n \". . label .\"\n `,\n gridTemplateColumns: 'min-content 16px 1fr min-content',\n gridTemplateRows: '24px auto',\n});\n\n/**\n * Apply styling to the PreviewHeader slots based on the state\n */\nexport const usePreviewHeaderStyles_unstable = (state: PreviewHeaderState): PreviewHeaderState => {\n const actionsBaseClassName = useActionsBaseClassName();\n const citationBaseClassName = useCitationBaseClassName();\n const labelBaseClassName = useLabelBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const rootBaseClassName = useRootBaseClassName();\n\n state.root.className = mergeClasses(previewHeaderClassNames.root, rootBaseClassName, state.root.className);\n\n if (state.actions) {\n state.actions.className = mergeClasses(\n previewHeaderClassNames.actions,\n actionsBaseClassName,\n state.actions.className,\n );\n }\n\n if (state.citation) {\n state.citation.className = mergeClasses(\n previewHeaderClassNames.citation,\n citationBaseClassName,\n state.citation.className,\n );\n }\n\n state.label.className = mergeClasses(previewHeaderClassNames.label, labelBaseClassName, state.label.className);\n\n if (state.media) {\n state.media.className = mergeClasses(previewHeaderClassNames.media, mediaBaseClassName, state.media.className);\n }\n\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","tokens","typographyStyles","previewHeaderClassNames","root","actions","citation","label","media","previewHeaderExtraClassNames","mediaChild","labelFontSize","caption1Strong","fontSize","labelLineHeight","lineHeight","useActionsBaseClassName","gridArea","justifySelf","useCitationBaseClassName","useLabelBaseClassName","alignSelf","display","overflowY","paddingTop","wordBreak","useMediaBaseClassName","height","width","useRootBaseClassName","alignItems","columnGap","spacingHorizontalXS","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","usePreviewHeaderStyles_unstable","state","actionsBaseClassName","citationBaseClassName","labelBaseClassName","mediaBaseClassName","rootBaseClassName","className"],"mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,6BAA6B;AAIrG,OAAO,MAAMC,0BAA8D;IACzEC,MAAM;IACNC,SAAS;IACTC,UAAU;IACVC,OAAO;IACPC,OAAO;AACT,EAAE;AAEF,OAAO,MAAMC,+BAA+B;IAC1CC,YAAY;AACd,EAAE;AAEF,MAAMC,gBAAgBT,iBAAiBU,cAAc,CAACC,QAAQ;AAC9D,MAAMC,kBAAkBZ,iBAAiBU,cAAc,CAACG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,QAAQ,CAACqC,SAAS,GAAG3C,aACzBG,wBAAwBG,QAAQ,EAChCiC,uBACAF,MAAM/B,QAAQ,CAACqC,SAAS;IAE5B;IAEAN,MAAM9B,KAAK,CAACoC,SAAS,GAAG3C,aAAaG,wBAAwBI,KAAK,EAAEiC,oBAAoBH,MAAM9B,KAAK,CAACoC,SAAS;IAE7G,IAAIN,MAAM7B,KAAK,EAAE;QACf6B,MAAM7B,KAAK,CAACmC,SAAS,GAAG3C,aAAaG,wBAAwBK,KAAK,EAAEiC,oBAAoBJ,MAAM7B,KAAK,CAACmC,SAAS;IAC/G;IAEA,OAAON;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["usePreviewHeaderStyles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { PreviewHeaderSlots, PreviewHeaderState } from './PreviewHeader.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const previewHeaderClassNames: SlotClassNames<PreviewHeaderSlots> = {\n root: 'fai-PreviewHeader',\n actions: 'fai-PreviewHeader__actions',\n citation: 'fai-PreviewHeader__citation',\n label: 'fai-PreviewHeader__label',\n media: 'fai-PreviewHeader__media',\n};\n\nexport const previewHeaderExtraClassNames = {\n mediaChild: 'fai-PreviewHeader__mediaChild',\n};\n\nconst labelFontSize = typographyStyles.caption1Strong.fontSize;\nconst labelLineHeight = typographyStyles.caption1Strong.lineHeight;\n\nconst useActionsBaseClassName = makeResetStyles({\n gridArea: 'actions',\n justifySelf: 'end',\n});\n\nconst useCitationBaseClassName = makeResetStyles({\n gridArea: 'citation',\n});\n\nconst useLabelBaseClassName = makeResetStyles({\n alignSelf: 'start',\n display: '-webkit-box',\n gridArea: 'label',\n overflowY: 'hidden',\n // 16px is the height of the tallest element within the preview header\n paddingTop: `calc((16px / 2) - (${labelLineHeight} - ${labelFontSize}))`,\n wordBreak: 'break-word',\n\n '-webkit-box-orient': 'vertical',\n '-webkit-line-clamp': '2',\n\n ...typographyStyles.caption1Strong,\n});\n\nconst useMediaBaseClassName = makeResetStyles({\n gridArea: 'media',\n height: '16px',\n lineHeight: 0,\n width: '16px',\n\n [`> .${previewHeaderExtraClassNames.mediaChild}`]: {\n height: '16px',\n width: '16px',\n },\n});\n\nconst useRootBaseClassName = makeResetStyles({\n alignItems: 'center',\n columnGap: tokens.spacingHorizontalXS,\n display: 'grid',\n gridTemplateAreas: `\n \"citation media label actions\"\n \". . label .\"\n `,\n gridTemplateColumns: 'min-content 16px 1fr min-content',\n gridTemplateRows: '24px auto',\n});\n\n/**\n * Apply styling to the PreviewHeader slots based on the state\n */\nexport const usePreviewHeaderStyles_unstable = (state: PreviewHeaderState): PreviewHeaderState => {\n const actionsBaseClassName = useActionsBaseClassName();\n const citationBaseClassName = useCitationBaseClassName();\n const labelBaseClassName = useLabelBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const rootBaseClassName = useRootBaseClassName();\n\n state.root.className = mergeClasses(previewHeaderClassNames.root, rootBaseClassName, state.root.className);\n\n if (state.actions) {\n state.actions.className = mergeClasses(\n previewHeaderClassNames.actions,\n actionsBaseClassName,\n state.actions.className,\n );\n }\n\n if (state.citation) {\n state.citation.className = mergeClasses(\n previewHeaderClassNames.citation,\n citationBaseClassName,\n state.citation.className,\n );\n }\n\n state.label.className = mergeClasses(previewHeaderClassNames.label, labelBaseClassName, state.label.className);\n\n if (state.media) {\n state.media.className = mergeClasses(previewHeaderClassNames.media, mediaBaseClassName, state.media.className);\n }\n\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","tokens","typographyStyles","previewHeaderClassNames","root","actions","citation","label","media","previewHeaderExtraClassNames","mediaChild","labelFontSize","caption1Strong","fontSize","labelLineHeight","lineHeight","useActionsBaseClassName","gridArea","justifySelf","useCitationBaseClassName","useLabelBaseClassName","alignSelf","display","overflowY","paddingTop","wordBreak","useMediaBaseClassName","height","width","useRootBaseClassName","alignItems","columnGap","spacingHorizontalXS","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","usePreviewHeaderStyles_unstable","state","actionsBaseClassName","citationBaseClassName","labelBaseClassName","mediaBaseClassName","rootBaseClassName","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,6BAA6B;AAIrG,OAAO,MAAMC,0BAA8D;IACzEC,MAAM;IACNC,SAAS;IACTC,UAAU;IACVC,OAAO;IACPC,OAAO;AACT,EAAE;AAEF,OAAO,MAAMC,+BAA+B;IAC1CC,YAAY;AACd,EAAE;AAEF,MAAMC,gBAAgBT,iBAAiBU,cAAc,CAACC,QAAQ;AAC9D,MAAMC,kBAAkBZ,iBAAiBU,cAAc,CAACG,UAAU;AAElE,MAAMC,0BAA0BjB,gBAAgB;IAC9CkB,UAAU;IACVC,aAAa;AACf;AAEA,MAAMC,2BAA2BpB,gBAAgB;IAC/CkB,UAAU;AACZ;AAEA,MAAMG,wBAAwBrB,gBAAgB;IAC5CsB,WAAW;IACXC,SAAS;IACTL,UAAU;IACVM,WAAW;IACX,sEAAsE;IACtEC,YAAY,CAAC,mBAAmB,EAAEV,gBAAgB,GAAG,EAAEH,cAAc,EAAE,CAAC;IACxEc,WAAW;IAEX,sBAAsB;IACtB,sBAAsB;IAEtB,GAAGvB,iBAAiBU,cAAc;AACpC;AAEA,MAAMc,wBAAwB3B,gBAAgB;IAC5CkB,UAAU;IACVU,QAAQ;IACRZ,YAAY;IACZa,OAAO;IAEP,CAAC,CAAC,GAAG,EAAEnB,6BAA6BC,UAAU,CAAC,CAAC,CAAC,EAAE;QACjDiB,QAAQ;QACRC,OAAO;IACT;AACF;AAEA,MAAMC,uBAAuB9B,gBAAgB;IAC3C+B,YAAY;IACZC,WAAW9B,OAAO+B,mBAAmB;IACrCV,SAAS;IACTW,mBAAmB,CAAC;;;IAGlB,CAAC;IACHC,qBAAqB;IACrBC,kBAAkB;AACpB;AAEA;;CAEC,GACD,OAAO,MAAMC,kCAAkC,CAACC;IAC9C,MAAMC,uBAAuBtB;IAC7B,MAAMuB,wBAAwBpB;IAC9B,MAAMqB,qBAAqBpB;IAC3B,MAAMqB,qBAAqBf;IAC3B,MAAMgB,oBAAoBb;IAE1BQ,MAAMjC,IAAI,CAACuC,SAAS,GAAG3C,aAAaG,wBAAwBC,IAAI,EAAEsC,mBAAmBL,MAAMjC,IAAI,CAACuC,SAAS;IAEzG,IAAIN,MAAMhC,OAAO,EAAE;QACjBgC,MAAMhC,OAAO,CAACsC,SAAS,GAAG3C,aACxBG,wBAAwBE,OAAO,EAC/BiC,sBACAD,MAAMhC,OAAO,CAACsC,SAAS;IAE3B;IAEA,IAAIN,MAAM/B,QAAQ,EAAE;QAClB+B,MAAM/B,QAAQ,CAACqC,SAAS,GAAG3C,aACzBG,wBAAwBG,QAAQ,EAChCiC,uBACAF,MAAM/B,QAAQ,CAACqC,SAAS;IAE5B;IAEAN,MAAM9B,KAAK,CAACoC,SAAS,GAAG3C,aAAaG,wBAAwBI,KAAK,EAAEiC,oBAAoBH,MAAM9B,KAAK,CAACoC,SAAS;IAE7G,IAAIN,MAAM7B,KAAK,EAAE;QACf6B,MAAM7B,KAAK,CAACmC,SAAS,GAAG3C,aAAaG,wBAAwBK,KAAK,EAAEiC,oBAAoBJ,MAAM7B,KAAK,CAACmC,SAAS;IAC/G;IAEA,OAAON;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PreviewMetadata.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePreviewMetadata_unstable } from './usePreviewMetadata';\nimport { renderPreviewMetadata_unstable } from './renderPreviewMetadata';\nimport { usePreviewMetadataStyles_unstable } from './usePreviewMetadataStyles';\nimport type { PreviewMetadataProps } from './PreviewMetadata.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\nexport const PreviewMetadata: ForwardRefComponent<PreviewMetadataProps> = React.forwardRef((props, ref) => {\n const state = usePreviewMetadata_unstable(props, ref);\n\n usePreviewMetadataStyles_unstable(state);\n return renderPreviewMetadata_unstable(state);\n});\n\nPreviewMetadata.displayName = 'PreviewMetadata';\n"],"names":["React","usePreviewMetadata_unstable","renderPreviewMetadata_unstable","usePreviewMetadataStyles_unstable","PreviewMetadata","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,8BAA8B,QAAQ,0BAA0B;AACzE,SAASC,iCAAiC,QAAQ,6BAA6B;AAI/E,OAAO,MAAMC,gCAA6DJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACjG,MAAMC,QAAQP,4BAA4BK,OAAOC;IAEjDJ,kCAAkCK;IAClC,OAAON,+BAA+BM;AACxC,GAAG;AAEHJ,gBAAgBK,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["PreviewMetadata.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePreviewMetadata_unstable } from './usePreviewMetadata';\nimport { renderPreviewMetadata_unstable } from './renderPreviewMetadata';\nimport { usePreviewMetadataStyles_unstable } from './usePreviewMetadataStyles';\nimport type { PreviewMetadataProps } from './PreviewMetadata.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\nexport const PreviewMetadata: ForwardRefComponent<PreviewMetadataProps> = React.forwardRef((props, ref) => {\n const state = usePreviewMetadata_unstable(props, ref);\n\n usePreviewMetadataStyles_unstable(state);\n return renderPreviewMetadata_unstable(state);\n});\n\nPreviewMetadata.displayName = 'PreviewMetadata';\n"],"names":["React","usePreviewMetadata_unstable","renderPreviewMetadata_unstable","usePreviewMetadataStyles_unstable","PreviewMetadata","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,8BAA8B,QAAQ,0BAA0B;AACzE,SAASC,iCAAiC,QAAQ,6BAA6B;AAI/E,OAAO,MAAMC,gCAA6DJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACjG,MAAMC,QAAQP,4BAA4BK,OAAOC;IAEjDJ,kCAAkCK;IAClC,OAAON,+BAA+BM;AACxC,GAAG;AAEHJ,gBAAgBK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PreviewMetadata.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type PreviewMetadataSlots = {\n root: Slot<'div'>;\n\n /**\n * Icon slot in the metadata displayed after all text.\n */\n icon: Slot<'span'>;\n\n /**\n * First text displayed in the metadata.\n */\n primaryText: Slot<'span'>;\n\n /**\n * Second text displayed in the metadata.\n */\n secondaryText: Slot<'span'>;\n\n /**\n * Third text displayed in the metadata.\n */\n tertiaryText: Slot<'span'>;\n};\n\n/**\n * PreviewMetadata Props\n */\nexport type PreviewMetadataProps = ComponentProps<Partial<PreviewMetadataSlots>>;\n\n/**\n * State used in rendering PreviewMetadata\n */\nexport type PreviewMetadataState = ComponentState<PreviewMetadataSlots>;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["PreviewMetadata.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type PreviewMetadataSlots = {\n root: Slot<'div'>;\n\n /**\n * Icon slot in the metadata displayed after all text.\n */\n icon: Slot<'span'>;\n\n /**\n * First text displayed in the metadata.\n */\n primaryText: Slot<'span'>;\n\n /**\n * Second text displayed in the metadata.\n */\n secondaryText: Slot<'span'>;\n\n /**\n * Third text displayed in the metadata.\n */\n tertiaryText: Slot<'span'>;\n};\n\n/**\n * PreviewMetadata Props\n */\nexport type PreviewMetadataProps = ComponentProps<Partial<PreviewMetadataSlots>>;\n\n/**\n * State used in rendering PreviewMetadata\n */\nexport type PreviewMetadataState = ComponentState<PreviewMetadataSlots>;\n"],"names":[],"rangeMappings":";;","mappings":"AA+BA;;CAEC,GACD,WAAwE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './PreviewMetadata';\nexport * from './PreviewMetadata.types';\nexport * from './renderPreviewMetadata';\nexport * from './usePreviewMetadata';\nexport * from './usePreviewMetadataStyles';\n"],"names":[],"mappings":"AAAA,cAAc,oBAAoB;AAClC,cAAc,0BAA0B;AACxC,cAAc,0BAA0B;AACxC,cAAc,uBAAuB;AACrC,cAAc,6BAA6B"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './PreviewMetadata';\nexport * from './PreviewMetadata.types';\nexport * from './renderPreviewMetadata';\nexport * from './usePreviewMetadata';\nexport * from './usePreviewMetadataStyles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,oBAAoB;AAClC,cAAc,0BAA0B;AACxC,cAAc,0BAA0B;AACxC,cAAc,uBAAuB;AACrC,cAAc,6BAA6B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderPreviewMetadata.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { PreviewMetadataState, PreviewMetadataSlots } from './PreviewMetadata.types';\n\n/**\n * Render the final JSX of PreviewMetadata\n */\nexport const renderPreviewMetadata_unstable = (state: PreviewMetadataState) => {\n assertSlots<PreviewMetadataSlots>(state);\n\n return (\n <state.root>\n {state.primaryText && <state.primaryText />}\n {state.secondaryText && <state.secondaryText />}\n {state.tertiaryText && <state.tertiaryText />}\n {state.icon && <state.icon />}\n {state.root.children}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderPreviewMetadata_unstable","state","root","primaryText","secondaryText","tertiaryText","icon","children"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AAGzD;;CAEC,GACD,OAAO,MAAMC,iCAAiC,CAACC;IAC7CF,YAAkCE;IAElC,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,WAAW,kBAAI,KAACF,MAAME,WAAW;YACvCF,MAAMG,aAAa,kBAAI,KAACH,MAAMG,aAAa;YAC3CH,MAAMI,YAAY,kBAAI,KAACJ,MAAMI,YAAY;YACzCJ,MAAMK,IAAI,kBAAI,KAACL,MAAMK,IAAI;YACzBL,MAAMC,IAAI,CAACK,QAAQ;;;AAG1B,EAAE"}
|
|
1
|
+
{"version":3,"sources":["renderPreviewMetadata.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { PreviewMetadataState, PreviewMetadataSlots } from './PreviewMetadata.types';\n\n/**\n * Render the final JSX of PreviewMetadata\n */\nexport const renderPreviewMetadata_unstable = (state: PreviewMetadataState) => {\n assertSlots<PreviewMetadataSlots>(state);\n\n return (\n <state.root>\n {state.primaryText && <state.primaryText />}\n {state.secondaryText && <state.secondaryText />}\n {state.tertiaryText && <state.tertiaryText />}\n {state.icon && <state.icon />}\n {state.root.children}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderPreviewMetadata_unstable","state","root","primaryText","secondaryText","tertiaryText","icon","children"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AAGzD;;CAEC,GACD,OAAO,MAAMC,iCAAiC,CAACC;IAC7CF,YAAkCE;IAElC,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,WAAW,kBAAI,KAACF,MAAME,WAAW;YACvCF,MAAMG,aAAa,kBAAI,KAACH,MAAMG,aAAa;YAC3CH,MAAMI,YAAY,kBAAI,KAACJ,MAAMI,YAAY;YACzCJ,MAAMK,IAAI,kBAAI,KAACL,MAAMK,IAAI;YACzBL,MAAMC,IAAI,CAACK,QAAQ;;;AAG1B,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePreviewMetadata.ts"],"sourcesContent":["import type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-components';\nimport type { PreviewMetadataProps, PreviewMetadataState } from './PreviewMetadata.types';\n\n/**\n * Create the state required to render PreviewMetadata.\n *\n * The returned state can be modified with hooks such as usePreviewMetadataStyles_unstable,\n * before being passed to renderPreviewMetadata_unstable.\n *\n * @param props - props from this instance of PreviewMetadata\n * @param ref - reference to root HTMLElement of PreviewMetadata\n */\nexport const usePreviewMetadata_unstable = (\n props: PreviewMetadataProps,\n ref: React.Ref<HTMLDivElement>,\n): PreviewMetadataState => {\n const { icon, primaryText, secondaryText, tertiaryText } = props;\n\n return {\n components: {\n root: 'div',\n icon: 'span',\n primaryText: 'span',\n secondaryText: 'span',\n tertiaryText: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n icon: slot.optional(icon, { elementType: 'span' }),\n primaryText: slot.optional(primaryText, { elementType: 'span' }),\n secondaryText: slot.optional(secondaryText, { elementType: 'span' }),\n tertiaryText: slot.optional(tertiaryText, { elementType: 'span' }),\n };\n};\n"],"names":["getIntrinsicElementProps","slot","usePreviewMetadata_unstable","props","ref","icon","primaryText","secondaryText","tertiaryText","components","root","always","elementType","optional"],"mappings":"AACA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,6BAA6B;AAG5E;;;;;;;;CAQC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEA,MAAM,EAAEC,IAAI,EAAEC,WAAW,EAAEC,aAAa,EAAEC,YAAY,EAAE,GAAGL;IAE3D,OAAO;QACLM,YAAY;YACVC,MAAM;YACNL,MAAM;YACNC,aAAa;YACbC,eAAe;YACfC,cAAc;QAChB;QACAE,MAAMT,KAAKU,MAAM,CACfX,yBAAyB,OAAO;YAC9BI;YACA,GAAGD,KAAK;QACV,IACA;YAAES,aAAa;QAAM;QAEvBP,MAAMJ,KAAKY,QAAQ,CAACR,MAAM;YAAEO,aAAa;QAAO;QAChDN,aAAaL,KAAKY,QAAQ,CAACP,aAAa;YAAEM,aAAa;QAAO;QAC9DL,eAAeN,KAAKY,QAAQ,CAACN,eAAe;YAAEK,aAAa;QAAO;QAClEJ,cAAcP,KAAKY,QAAQ,CAACL,cAAc;YAAEI,aAAa;QAAO;IAClE;AACF,EAAE"}
|
|
1
|
+
{"version":3,"sources":["usePreviewMetadata.ts"],"sourcesContent":["import type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-components';\nimport type { PreviewMetadataProps, PreviewMetadataState } from './PreviewMetadata.types';\n\n/**\n * Create the state required to render PreviewMetadata.\n *\n * The returned state can be modified with hooks such as usePreviewMetadataStyles_unstable,\n * before being passed to renderPreviewMetadata_unstable.\n *\n * @param props - props from this instance of PreviewMetadata\n * @param ref - reference to root HTMLElement of PreviewMetadata\n */\nexport const usePreviewMetadata_unstable = (\n props: PreviewMetadataProps,\n ref: React.Ref<HTMLDivElement>,\n): PreviewMetadataState => {\n const { icon, primaryText, secondaryText, tertiaryText } = props;\n\n return {\n components: {\n root: 'div',\n icon: 'span',\n primaryText: 'span',\n secondaryText: 'span',\n tertiaryText: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n icon: slot.optional(icon, { elementType: 'span' }),\n primaryText: slot.optional(primaryText, { elementType: 'span' }),\n secondaryText: slot.optional(secondaryText, { elementType: 'span' }),\n tertiaryText: slot.optional(tertiaryText, { elementType: 'span' }),\n };\n};\n"],"names":["getIntrinsicElementProps","slot","usePreviewMetadata_unstable","props","ref","icon","primaryText","secondaryText","tertiaryText","components","root","always","elementType","optional"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AACA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,6BAA6B;AAG5E;;;;;;;;CAQC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEA,MAAM,EAAEC,IAAI,EAAEC,WAAW,EAAEC,aAAa,EAAEC,YAAY,EAAE,GAAGL;IAE3D,OAAO;QACLM,YAAY;YACVC,MAAM;YACNL,MAAM;YACNC,aAAa;YACbC,eAAe;YACfC,cAAc;QAChB;QACAE,MAAMT,KAAKU,MAAM,CACfX,yBAAyB,OAAO;YAC9BI;YACA,GAAGD,KAAK;QACV,IACA;YAAES,aAAa;QAAM;QAEvBP,MAAMJ,KAAKY,QAAQ,CAACR,MAAM;YAAEO,aAAa;QAAO;QAChDN,aAAaL,KAAKY,QAAQ,CAACP,aAAa;YAAEM,aAAa;QAAO;QAC9DL,eAAeN,KAAKY,QAAQ,CAACN,eAAe;YAAEK,aAAa;QAAO;QAClEJ,cAAcP,KAAKY,QAAQ,CAACL,cAAc;YAAEI,aAAa;QAAO;IAClE;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePreviewMetadataStyles.ts"],"sourcesContent":["import {\n makeResetStyles,\n makeStyles,\n mergeClasses,\n shorthands,\n tokens,\n typographyStyles,\n} from '@fluentui/react-components';\nimport type { PreviewMetadataSlots, PreviewMetadataState } from './PreviewMetadata.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const previewMetadataClassNames: SlotClassNames<PreviewMetadataSlots> = {\n root: 'fai-PreviewMetadata',\n icon: 'fai-PreviewMetadata__icon',\n primaryText: 'fai-PreviewMetadata__primaryText',\n secondaryText: 'fai-PreviewMetadata__secondaryText',\n tertiaryText: 'fai-PreviewMetadata__tertiaryText',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n ...typographyStyles.caption2,\n});\n\nconst useIconBaseClassName = makeResetStyles({\n marginLeft: tokens.spacingHorizontalSNudge,\n verticalAlign: 'middle',\n});\n\nconst useTextStyles = makeStyles({\n subsequentText: {\n marginLeft: `calc(${tokens.spacingHorizontalSNudge} * 2)`,\n position: 'relative',\n\n '&::before': {\n ...shorthands.borderLeft(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke2),\n content: '\"\"',\n display: 'block',\n height: typographyStyles.caption2.fontSize,\n left: `calc(-1 * ${tokens.spacingHorizontalSNudge})`,\n position: 'absolute',\n top: `calc((${typographyStyles.caption2.lineHeight} - ${typographyStyles.caption2.fontSize}) / 2)`,\n },\n },\n});\n\n/**\n * Apply styling to the PreviewMetadata slots based on the state\n */\nexport const usePreviewMetadataStyles_unstable = (state: PreviewMetadataState): PreviewMetadataState => {\n const rootBaseClassName = useRootBaseClassName();\n const iconBaseClassName = useIconBaseClassName();\n const textStyles = useTextStyles();\n\n state.root.className = mergeClasses(previewMetadataClassNames.root, rootBaseClassName, state.root.className);\n\n if (state.icon) {\n state.icon.className = mergeClasses(previewMetadataClassNames.icon, iconBaseClassName, state.icon.className);\n }\n\n let isSubsequentAfterText = false;\n\n if (state.primaryText) {\n state.primaryText.className = mergeClasses(previewMetadataClassNames.primaryText, state.primaryText.className);\n isSubsequentAfterText = true;\n }\n\n if (state.secondaryText) {\n state.secondaryText.className = mergeClasses(\n previewMetadataClassNames.secondaryText,\n isSubsequentAfterText && textStyles.subsequentText,\n state.secondaryText.className,\n );\n isSubsequentAfterText = true;\n }\n\n if (state.tertiaryText) {\n state.tertiaryText.className = mergeClasses(\n previewMetadataClassNames.tertiaryText,\n isSubsequentAfterText && textStyles.subsequentText,\n state.tertiaryText.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","shorthands","tokens","typographyStyles","previewMetadataClassNames","root","icon","primaryText","secondaryText","tertiaryText","useRootBaseClassName","caption2","useIconBaseClassName","marginLeft","spacingHorizontalSNudge","verticalAlign","useTextStyles","subsequentText","position","borderLeft","strokeWidthThin","colorNeutralStroke2","content","display","height","fontSize","left","top","lineHeight","usePreviewMetadataStyles_unstable","state","rootBaseClassName","iconBaseClassName","textStyles","className","isSubsequentAf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E0B,mBAAmBF,MAAMxB,IAAI,CAAC4B,SAAS;IAC7G;IAEA,IAAIC,wBAAwB;IAE5B,IAAIL,MAAMvB,WAAW,EAAE;QACrBuB,MAAMvB,WAAW,CAAC2B,SAAS,GAAGlC,aAAaI,0BAA0BG,WAAW,EAAEuB,MAAMvB,WAAW,CAAC2B,SAAS;QAC7GC,wBAAwB;IAC1B;IAEA,IAAIL,MAAMtB,aAAa,EAAE;QACvBsB,MAAMtB,aAAa,CAAC0B,SAAS,GAAGlC,aAC9BI,0BAA0BI,aAAa,EACvC2B,yBAAyBF,WAAWhB,cAAc,EAClDa,MAAMtB,aAAa,CAAC0B,SAAS;QAE/BC,wBAAwB;IAC1B;IAEA,IAAIL,MAAMrB,YAAY,EAAE;QACtBqB,MAAMrB,YAAY,CAACyB,SAAS,GAAGlC,aAC7BI,0BAA0BK,YAAY,EACtC0B,yBAAyBF,WAAWhB,cAAc,EAClDa,MAAMrB,YAAY,CAACyB,SAAS;IAEhC;IAEA,OAAOJ;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["usePreviewMetadataStyles.ts"],"sourcesContent":["import {\n makeResetStyles,\n makeStyles,\n mergeClasses,\n shorthands,\n tokens,\n typographyStyles,\n} from '@fluentui/react-components';\nimport type { PreviewMetadataSlots, PreviewMetadataState } from './PreviewMetadata.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const previewMetadataClassNames: SlotClassNames<PreviewMetadataSlots> = {\n root: 'fai-PreviewMetadata',\n icon: 'fai-PreviewMetadata__icon',\n primaryText: 'fai-PreviewMetadata__primaryText',\n secondaryText: 'fai-PreviewMetadata__secondaryText',\n tertiaryText: 'fai-PreviewMetadata__tertiaryText',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n ...typographyStyles.caption2,\n});\n\nconst useIconBaseClassName = makeResetStyles({\n marginLeft: tokens.spacingHorizontalSNudge,\n verticalAlign: 'middle',\n});\n\nconst useTextStyles = makeStyles({\n subsequentText: {\n marginLeft: `calc(${tokens.spacingHorizontalSNudge} * 2)`,\n position: 'relative',\n\n '&::before': {\n ...shorthands.borderLeft(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke2),\n content: '\"\"',\n display: 'block',\n height: typographyStyles.caption2.fontSize,\n left: `calc(-1 * ${tokens.spacingHorizontalSNudge})`,\n position: 'absolute',\n top: `calc((${typographyStyles.caption2.lineHeight} - ${typographyStyles.caption2.fontSize}) / 2)`,\n },\n },\n});\n\n/**\n * Apply styling to the PreviewMetadata slots based on the state\n */\nexport const usePreviewMetadataStyles_unstable = (state: PreviewMetadataState): PreviewMetadataState => {\n const rootBaseClassName = useRootBaseClassName();\n const iconBaseClassName = useIconBaseClassName();\n const textStyles = useTextStyles();\n\n state.root.className = mergeClasses(previewMetadataClassNames.root, rootBaseClassName, state.root.className);\n\n if (state.icon) {\n state.icon.className = mergeClasses(previewMetadataClassNames.icon, iconBaseClassName, state.icon.className);\n }\n\n let isSubsequentAfterText = false;\n\n if (state.primaryText) {\n state.primaryText.className = mergeClasses(previewMetadataClassNames.primaryText, state.primaryText.className);\n isSubsequentAfterText = true;\n }\n\n if (state.secondaryText) {\n state.secondaryText.className = mergeClasses(\n previewMetadataClassNames.secondaryText,\n isSubsequentAfterText && textStyles.subsequentText,\n state.secondaryText.className,\n );\n isSubsequentAfterText = true;\n }\n\n if (state.tertiaryText) {\n state.tertiaryText.className = mergeClasses(\n previewMetadataClassNames.tertiaryText,\n isSubsequentAfterText && textStyles.subsequentText,\n state.tertiaryText.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","shorthands","tokens","typographyStyles","previewMetadataClassNames","root","icon","primaryText","secondaryText","tertiaryText","useRootBaseClassName","caption2","useIconBaseClassName","marginLeft","spacingHorizontalSNudge","verticalAlign","useTextStyles","subsequentText","position","borderLeft","strokeWidthThin","colorNeutralStroke2","content","display","height","fontSize","left","top","lineHeight","usePreviewMetadataStyles_unstable","state","rootBaseClassName","iconBaseClassName","textStyles","className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,IAAI,EAAE;QACdwB,MAAMxB,IAAI,CAAC4B,SAAS,GAAGlC,aAAaI,0BAA0BE,IAAI,EAAE0B,mBAAmBF,MAAMxB,IAAI,CAAC4B,SAAS;IAC7G;IAEA,IAAIC,wBAAwB;IAE5B,IAAIL,MAAMvB,WAAW,EAAE;QACrBuB,MAAMvB,WAAW,CAAC2B,SAAS,GAAGlC,aAAaI,0BAA0BG,WAAW,EAAEuB,MAAMvB,WAAW,CAAC2B,SAAS;QAC7GC,wBAAwB;IAC1B;IAEA,IAAIL,MAAMtB,aAAa,EAAE;QACvBsB,MAAMtB,aAAa,CAAC0B,SAAS,GAAGlC,aAC9BI,0BAA0BI,aAAa,EACvC2B,yBAAyBF,WAAWhB,cAAc,EAClDa,MAAMtB,aAAa,CAAC0B,SAAS;QAE/BC,wBAAwB;IAC1B;IAEA,IAAIL,MAAMrB,YAAY,EAAE;QACtBqB,MAAMrB,YAAY,CAACyB,SAAS,GAAGlC,aAC7BI,0BAA0BK,YAAY,EACtC0B,yBAAyBF,WAAWhB,cAAc,EAClDa,MAAMrB,YAAY,CAACyB,SAAS;IAEhC;IAEA,OAAOJ;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PreviewSurface.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePreviewSurface_unstable } from './usePreviewSurface';\nimport { renderPreviewSurface_unstable } from './renderPreviewSurface';\nimport { usePreviewSurfaceStyles_unstable } from './usePreviewSurfaceStyles';\nimport type { PreviewSurfaceProps } from './PreviewSurface.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\nexport const PreviewSurface: ForwardRefComponent<PreviewSurfaceProps> = React.forwardRef((props, ref) => {\n const state = usePreviewSurface_unstable(props, ref);\n\n usePreviewSurfaceStyles_unstable(state);\n\n return renderPreviewSurface_unstable(state);\n});\n\nPreviewSurface.displayName = 'PreviewSurface';\n"],"names":["React","usePreviewSurface_unstable","renderPreviewSurface_unstable","usePreviewSurfaceStyles_unstable","PreviewSurface","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,4BAA4B;AAI7E,OAAO,MAAMC,+BAA2DJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQP,2BAA2BK,OAAOC;IAEhDJ,iCAAiCK;IAEjC,OAAON,8BAA8BM;AACvC,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["PreviewSurface.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePreviewSurface_unstable } from './usePreviewSurface';\nimport { renderPreviewSurface_unstable } from './renderPreviewSurface';\nimport { usePreviewSurfaceStyles_unstable } from './usePreviewSurfaceStyles';\nimport type { PreviewSurfaceProps } from './PreviewSurface.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\nexport const PreviewSurface: ForwardRefComponent<PreviewSurfaceProps> = React.forwardRef((props, ref) => {\n const state = usePreviewSurface_unstable(props, ref);\n\n usePreviewSurfaceStyles_unstable(state);\n\n return renderPreviewSurface_unstable(state);\n});\n\nPreviewSurface.displayName = 'PreviewSurface';\n"],"names":["React","usePreviewSurface_unstable","renderPreviewSurface_unstable","usePreviewSurfaceStyles_unstable","PreviewSurface","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,4BAA4B;AAI7E,OAAO,MAAMC,+BAA2DJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQP,2BAA2BK,OAAOC;IAEhDJ,iCAAiCK;IAEjC,OAAON,8BAA8BM;AACvC,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PreviewSurface.types.ts"],"sourcesContent":["import type {\n ComponentProps,\n ComponentState,\n PopoverSurfaceProps,\n PopoverSurfaceSlots,\n PopoverSurfaceState,\n} from '@fluentui/react-components';\n\nexport type PreviewSurfaceSlots = PopoverSurfaceSlots & {};\n\n/**\n * PreviewSurface Props\n */\nexport type PreviewSurfaceProps = ComponentProps<PreviewSurfaceSlots> & PopoverSurfaceProps & {};\n\n/**\n * State used in rendering PreviewSurface\n */\nexport type PreviewSurfaceState = ComponentState<PreviewSurfaceSlots> & PopoverSurfaceState & {};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["PreviewSurface.types.ts"],"sourcesContent":["import type {\n ComponentProps,\n ComponentState,\n PopoverSurfaceProps,\n PopoverSurfaceSlots,\n PopoverSurfaceState,\n} from '@fluentui/react-components';\n\nexport type PreviewSurfaceSlots = PopoverSurfaceSlots & {};\n\n/**\n * PreviewSurface Props\n */\nexport type PreviewSurfaceProps = ComponentProps<PreviewSurfaceSlots> & PopoverSurfaceProps & {};\n\n/**\n * State used in rendering PreviewSurface\n */\nexport type PreviewSurfaceState = ComponentState<PreviewSurfaceSlots> & PopoverSurfaceState & {};\n"],"names":[],"rangeMappings":";;","mappings":"AAeA;;CAEC,GACD,WAAiG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './PreviewSurface';\nexport * from './PreviewSurface.types';\nexport * from './renderPreviewSurface';\nexport * from './usePreviewSurface';\nexport * from './usePreviewSurfaceStyles';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,sBAAsB;AACpC,cAAc,4BAA4B"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './PreviewSurface';\nexport * from './PreviewSurface.types';\nexport * from './renderPreviewSurface';\nexport * from './usePreviewSurface';\nexport * from './usePreviewSurfaceStyles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,sBAAsB;AACpC,cAAc,4BAA4B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderPreviewSurface.tsx"],"sourcesContent":["import { renderPopoverSurface_unstable } from '@fluentui/react-components';\nimport type { PreviewSurfaceState } from './PreviewSurface.types';\n\n/**\n * Render the final JSX of PreviewSurface\n */\nexport const renderPreviewSurface_unstable = (state: PreviewSurfaceState): React.ReactElement => {\n return renderPopoverSurface_unstable(state);\n};\n"],"names":["renderPopoverSurface_unstable","renderPreviewSurface_unstable","state"],"mappings":"AAAA,SAASA,6BAA6B,QAAQ,6BAA6B;AAG3E;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAACC;IAC5C,OAAOF,8BAA8BE;AACvC,EAAE"}
|
|
1
|
+
{"version":3,"sources":["renderPreviewSurface.tsx"],"sourcesContent":["import { renderPopoverSurface_unstable } from '@fluentui/react-components';\nimport type { PreviewSurfaceState } from './PreviewSurface.types';\n\n/**\n * Render the final JSX of PreviewSurface\n */\nexport const renderPreviewSurface_unstable = (state: PreviewSurfaceState): React.ReactElement => {\n return renderPopoverSurface_unstable(state);\n};\n"],"names":["renderPopoverSurface_unstable","renderPreviewSurface_unstable","state"],"rangeMappings":";;;;;","mappings":"AAAA,SAASA,6BAA6B,QAAQ,6BAA6B;AAG3E;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAACC;IAC5C,OAAOF,8BAA8BE;AACvC,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePreviewSurface.ts"],"sourcesContent":["import type * as React from 'react';\nimport { usePopoverSurface_unstable } from '@fluentui/react-components';\nimport type { PreviewSurfaceProps, PreviewSurfaceState } from './PreviewSurface.types';\n\n// If you add JSX to this file, be sure to change the file type to .tsx\n\n/**\n * Create the state required to render PreviewSurface.\n *\n * The returned state can be modified with hooks such as usePreviewSurfaceStyles_unstable,\n * before being passed to renderPreviewSurface_unstable.\n *\n * @param props - props from this instance of PreviewSurface\n * @param ref - reference to root HTMLElement of PreviewSurface\n */\nexport const usePreviewSurface_unstable = (\n props: PreviewSurfaceProps,\n ref: React.Ref<HTMLDivElement>,\n): PreviewSurfaceState => {\n return usePopoverSurface_unstable(props, ref);\n};\n"],"names":["usePopoverSurface_unstable","usePreviewSurface_unstable","props","ref"],"mappings":"AACA,SAASA,0BAA0B,QAAQ,6BAA6B;AAGxE,uEAAuE;AAEvE;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,OAAOH,2BAA2BE,OAAOC;AAC3C,EAAE"}
|
|
1
|
+
{"version":3,"sources":["usePreviewSurface.ts"],"sourcesContent":["import type * as React from 'react';\nimport { usePopoverSurface_unstable } from '@fluentui/react-components';\nimport type { PreviewSurfaceProps, PreviewSurfaceState } from './PreviewSurface.types';\n\n// If you add JSX to this file, be sure to change the file type to .tsx\n\n/**\n * Create the state required to render PreviewSurface.\n *\n * The returned state can be modified with hooks such as usePreviewSurfaceStyles_unstable,\n * before being passed to renderPreviewSurface_unstable.\n *\n * @param props - props from this instance of PreviewSurface\n * @param ref - reference to root HTMLElement of PreviewSurface\n */\nexport const usePreviewSurface_unstable = (\n props: PreviewSurfaceProps,\n ref: React.Ref<HTMLDivElement>,\n): PreviewSurfaceState => {\n return usePopoverSurface_unstable(props, ref);\n};\n"],"names":["usePopoverSurface_unstable","usePreviewSurface_unstable","props","ref"],"rangeMappings":";;;;;;;;;;;;","mappings":"AACA,SAASA,0BAA0B,QAAQ,6BAA6B;AAGxE,uEAAuE;AAEvE;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,OAAOH,2BAA2BE,OAAOC;AAC3C,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePreviewSurfaceStyles.ts"],"sourcesContent":["import {\n makeStyles,\n mergeClasses,\n shorthands,\n tokens,\n usePopoverSurfaceStyles_unstable,\n} from '@fluentui/react-components';\nimport type { PreviewSurfaceSlots, PreviewSurfaceState } from './PreviewSurface.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const previewSurfaceClassNames: SlotClassNames<PreviewSurfaceSlots> = {\n root: 'fai-PreviewSurface',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootStyles = makeStyles({\n base: {\n maxWidth: '256px',\n ...shorthands.padding(tokens.spacingVerticalXS, tokens.spacingHorizontalXS),\n },\n});\n\n/**\n * Apply styling to the PreviewSurface slots based on the state\n */\nexport const usePreviewSurfaceStyles_unstable = (state: PreviewSurfaceState): PreviewSurfaceState => {\n const rootStyles = useRootStyles();\n\n state.root.className = mergeClasses(previewSurfaceClassNames.root, rootStyles.base, state.root.className);\n\n usePopoverSurfaceStyles_unstable(state);\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","shorthands","tokens","usePopoverSurfaceStyles_unstable","previewSurfaceClassNames","root","useRootStyles","base","maxWidth","padding","spacingVerticalXS","spacingHorizontalXS","usePreviewSurfaceStyles_unstable","state","rootStyles","className"],"mappings":"AAAA,SACEA,UAAU,EACVC,YAAY,EACZC,UAAU,EACVC,MAAM,EACNC,gCAAgC,QAC3B,6BAA6B;AAIpC,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,gBAAgBP,WAAW;IAC/BQ,MAAM;QACJC,UAAU;QACV,GAAGP,WAAWQ,OAAO,CAACP,OAAOQ,iBAAiB,EAAER,OAAOS,mBAAmB,CAAC;IAC7E;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAACC;IAC/C,MAAMC,aAAaR;IAEnBO,MAAMR,IAAI,CAACU,SAAS,GAAGf,aAAaI,yBAAyBC,IAAI,EAAES,WAAWP,IAAI,EAAEM,MAAMR,IAAI,CAACU,SAAS;IAExGZ,iCAAiCU;IAEjC,OAAOA;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["usePreviewSurfaceStyles.ts"],"sourcesContent":["import {\n makeStyles,\n mergeClasses,\n shorthands,\n tokens,\n usePopoverSurfaceStyles_unstable,\n} from '@fluentui/react-components';\nimport type { PreviewSurfaceSlots, PreviewSurfaceState } from './PreviewSurface.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const previewSurfaceClassNames: SlotClassNames<PreviewSurfaceSlots> = {\n root: 'fai-PreviewSurface',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootStyles = makeStyles({\n base: {\n maxWidth: '256px',\n ...shorthands.padding(tokens.spacingVerticalXS, tokens.spacingHorizontalXS),\n },\n});\n\n/**\n * Apply styling to the PreviewSurface slots based on the state\n */\nexport const usePreviewSurfaceStyles_unstable = (state: PreviewSurfaceState): PreviewSurfaceState => {\n const rootStyles = useRootStyles();\n\n state.root.className = mergeClasses(previewSurfaceClassNames.root, rootStyles.base, state.root.className);\n\n usePopoverSurfaceStyles_unstable(state);\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","shorthands","tokens","usePopoverSurfaceStyles_unstable","previewSurfaceClassNames","root","useRootStyles","base","maxWidth","padding","spacingVerticalXS","spacingHorizontalXS","usePreviewSurfaceStyles_unstable","state","rootStyles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,UAAU,EACVC,YAAY,EACZC,UAAU,EACVC,MAAM,EACNC,gCAAgC,QAC3B,6BAA6B;AAIpC,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,gBAAgBP,WAAW;IAC/BQ,MAAM;QACJC,UAAU;QACV,GAAGP,WAAWQ,OAAO,CAACP,OAAOQ,iBAAiB,EAAER,OAAOS,mBAAmB,CAAC;IAC7E;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAACC;IAC/C,MAAMC,aAAaR;IAEnBO,MAAMR,IAAI,CAACU,SAAS,GAAGf,aAAaI,yBAAyBC,IAAI,EAAES,WAAWP,IAAI,EAAEM,MAAMR,IAAI,CAACU,SAAS;IAExGZ,iCAAiCU;IAEjC,OAAOA;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PreviewTrigger.tsx"],"sourcesContent":["import type * as React from 'react';\n\nimport { usePreviewTrigger_unstable } from './usePreviewTrigger';\nimport { renderPreviewTrigger_unstable } from './renderPreviewTrigger';\nimport type { PreviewTriggerProps } from './PreviewTrigger.types';\n\nexport const PreviewTrigger: React.FC<PreviewTriggerProps> = props => {\n const state = usePreviewTrigger_unstable(props);\n\n return renderPreviewTrigger_unstable(state);\n};\n\nPreviewTrigger.displayName = 'PreviewTrigger';\n"],"names":["usePreviewTrigger_unstable","renderPreviewTrigger_unstable","PreviewTrigger","props","state","displayName"],"mappings":"AAEA,SAASA,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AAGvE,OAAO,MAAMC,iBAAgDC,CAAAA;IAC3D,MAAMC,QAAQJ,2BAA2BG;IAEzC,OAAOF,8BAA8BG;AACvC,EAAE;AAEFF,eAAeG,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["PreviewTrigger.tsx"],"sourcesContent":["import type * as React from 'react';\n\nimport { usePreviewTrigger_unstable } from './usePreviewTrigger';\nimport { renderPreviewTrigger_unstable } from './renderPreviewTrigger';\nimport type { PreviewTriggerProps } from './PreviewTrigger.types';\n\nexport const PreviewTrigger: React.FC<PreviewTriggerProps> = props => {\n const state = usePreviewTrigger_unstable(props);\n\n return renderPreviewTrigger_unstable(state);\n};\n\nPreviewTrigger.displayName = 'PreviewTrigger';\n"],"names":["usePreviewTrigger_unstable","renderPreviewTrigger_unstable","PreviewTrigger","props","state","displayName"],"rangeMappings":";;;;;;","mappings":"AAEA,SAASA,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AAGvE,OAAO,MAAMC,iBAAgDC,CAAAA;IAC3D,MAAMC,QAAQJ,2BAA2BG;IAEzC,OAAOF,8BAA8BG;AACvC,EAAE;AAEFF,eAAeG,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PreviewTrigger.types.ts"],"sourcesContent":["import type { PopoverTriggerChildProps, PopoverTriggerProps, PopoverTriggerState } from '@fluentui/react-components';\n\n/**\n * PreviewTrigger Props\n */\nexport type PreviewTriggerProps = PopoverTriggerProps & {};\n\n/**\n * State used in rendering PreviewTrigger\n */\nexport type PreviewTriggerState = PopoverTriggerState & {};\n\n/**\n * Props that are passed to the child of the PreviewTrigger when cloned to ensure correct behavior for the Preview.\n */\nexport type PreviewTriggerChildProps = PopoverTriggerChildProps & {};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["PreviewTrigger.types.ts"],"sourcesContent":["import type { PopoverTriggerChildProps, PopoverTriggerProps, PopoverTriggerState } from '@fluentui/react-components';\n\n/**\n * PreviewTrigger Props\n */\nexport type PreviewTriggerProps = PopoverTriggerProps & {};\n\n/**\n * State used in rendering PreviewTrigger\n */\nexport type PreviewTriggerState = PopoverTriggerState & {};\n\n/**\n * Props that are passed to the child of the PreviewTrigger when cloned to ensure correct behavior for the Preview.\n */\nexport type PreviewTriggerChildProps = PopoverTriggerChildProps & {};\n"],"names":[],"rangeMappings":";;","mappings":"AAYA;;CAEC,GACD,WAAqE"}
|