@brightspot/ui 6.5.0 → 6.6.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/README.md +5 -3
- package/dist/components/copy-to-clipboard/CopyToClipboard.d.ts +2 -2
- package/dist/components/copy-to-clipboard/CopyToClipboard.js +2 -2
- package/dist/components/copy-to-clipboard/CopyToClipboard.js.map +1 -1
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/Popover.js +1 -1
- package/dist/custom-elements.json +55 -351
- package/dist/storybook/assets/{ActionBar.stories-0ScNWOC4.js → ActionBar.stories-XlCBIXyG.js} +1 -1
- package/dist/storybook/assets/{ActionItem.stories-DXJ_yKW3.js → ActionItem.stories-CGjqkED6.js} +1 -1
- package/dist/storybook/assets/{AiSparkle.stories-Z_5khRM7.js → AiSparkle.stories-ByYrmbnK.js} +1 -1
- package/dist/storybook/assets/{Avatar.stories-C9XcQNHg.js → Avatar.stories-CLTN4Hy4.js} +1 -1
- package/dist/storybook/assets/{AvatarGroup.stories-Cdy_mkeq.js → AvatarGroup.stories-Bi0JVYQ3.js} +1 -1
- package/dist/storybook/assets/{Badge.stories-BUdXSprE.js → Badge.stories-vsmP5PE_.js} +1 -1
- package/dist/storybook/assets/{Banner.stories-D71fgNb5.js → Banner.stories-BF3ONLiN.js} +1 -1
- package/dist/storybook/assets/{Button-D7pK-2at.js → Button-B2WxPTmr.js} +1 -1
- package/dist/storybook/assets/{Button.stories-B6WKuxXx.js → Button.stories-Doz3Yo8_.js} +1 -1
- package/dist/storybook/assets/{ButtonGroup.stories-CwiRfEal.js → ButtonGroup.stories-DIHq7pCQ.js} +1 -1
- package/dist/storybook/assets/{Card.stories-CxCcO9k6.js → Card.stories-DG-Az8eK.js} +1 -1
- package/dist/storybook/assets/{Celebrate.stories-DNVFUrhg.js → Celebrate.stories-BEeOZr06.js} +1 -1
- package/dist/storybook/assets/{Checkbox.stories-SuP4ltMI.js → Checkbox.stories-lnxLmjKf.js} +1 -1
- package/dist/storybook/assets/{CircularProgress.stories-BB0twcGv.js → CircularProgress.stories-fVKhhGVs.js} +1 -1
- package/dist/storybook/assets/{ClipboardMixin.stories-DaPV19jG.js → ClipboardMixin.stories-BqFaG8rE.js} +1 -1
- package/dist/storybook/assets/{Color-6BZIO3FS-DQ34tmQu.js → Color-6BZIO3FS-CuorWr7g.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-CMFJai_a.js → Colors.stories-DKpeKvis.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-BIHfDsN0.js → CombinedEffects.stories-B7pZ5dmW.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin-Bq-OGuus.js → ComponentStatesMixin-DkTJQa4k.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-DMxDqidh.js → ComponentStatesMixin.stories-Bcy1VJUi.js} +1 -1
- package/dist/storybook/assets/{CopyToClipboard.stories-CkdYHm8U.js → CopyToClipboard.stories-BD3hmKKD.js} +10 -10
- package/dist/storybook/assets/{Debounce.stories-CZSMfS-h.js → Debounce.stories-zJt-mtTD.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-CCAvPHmY.js → DocsRenderer-LL677BLK-DjKIBL7O.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-BTqSRQiC.js → Dropdown.stories-CiTlMwEm.js} +1 -1
- package/dist/storybook/assets/{EmptyState.stories-CjIkNVv4.js → EmptyState.stories-Dls5pG7y.js} +1 -1
- package/dist/storybook/assets/{EscaAvatar.stories-ORFCzxQw.js → EscaAvatar.stories-B8ZmuMwt.js} +1 -1
- package/dist/storybook/assets/{Events.stories-DHFT6dZM.js → Events.stories-D8VQCUXQ.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-CRgKl3Ve.js → Heading.stories-BztrHfGc.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-YiQHrWPS.js → HueRipple.stories-B4MJInE3.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-Bv4QRZNL.js → Icon.stories-CnCu9IuZ.js} +1 -1
- package/dist/storybook/assets/{IconButton.stories-ErFc860x.js → IconButton.stories-yOrrDyUi.js} +1 -1
- package/dist/storybook/assets/{LinearProgress.stories-DUAAMzdt.js → LinearProgress.stories-B1C1snwy.js} +1 -1
- package/dist/storybook/assets/{Message.stories-DxJEEd1I.js → Message.stories-Y3A_sQCK.js} +1 -1
- package/dist/storybook/assets/{OnFindMixin.stories-CoKUEhb4.js → OnFindMixin.stories-DE-1wy4s.js} +1 -1
- package/dist/storybook/assets/{Pagination.stories-6k02-Zb5.js → Pagination.stories-Bh9XEgpH.js} +1 -1
- package/dist/storybook/assets/{Popover.stories-Cd7P1nw_.js → Popover.stories-B6MzfP9e.js} +4 -4
- package/dist/storybook/assets/{ReadyMixin-BL65bbm_.js → ReadyMixin-Cnogomoq.js} +1 -1
- package/dist/storybook/assets/{RovingTabindexMixin.stories-CvtQ9Om6.js → RovingTabindexMixin.stories-DZOxDEZt.js} +1 -1
- package/dist/storybook/assets/{Rtc.stories-BBmO6Ses.js → Rtc.stories-TRo3Gr0A.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-BUiypzkp.js → ScrollShadow.stories-DrPUVGrj.js} +1 -1
- package/dist/storybook/assets/{Switch.stories-BndbX0N7.js → Switch.stories-DarSjwKf.js} +1 -1
- package/dist/storybook/assets/{Tab.stories-DVMyUFjq.js → Tab.stories-B5Fzzn-a.js} +1 -1
- package/dist/storybook/assets/{Tabs.stories-BQPYcQ6j.js → Tabs.stories-DmTF3dhs.js} +1 -1
- package/dist/storybook/assets/{Throttle.stories-CKYOCVnj.js → Throttle.stories-CBsrzfNu.js} +1 -1
- package/dist/storybook/assets/{Tooltip.stories-B3DmBl8X.js → Tooltip.stories-DgEfWbGo.js} +1 -1
- package/dist/storybook/assets/{Upload.stories-nzkKN-_d.js → Upload.stories-CoewmZUt.js} +1 -1
- package/dist/storybook/assets/{UploadItem.stories-CL3oKT8D.js → UploadItem.stories-CwdlTysq.js} +1 -1
- package/dist/storybook/assets/{Welcome.stories-DfHnb5cA.js → Welcome.stories-D1xoHYEq.js} +1 -1
- package/dist/storybook/assets/{Widget.stories-CcVwc0wv.js → Widget.stories-DFR04B_J.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-CxSJYFKf.js → WithTooltip-65CFNBJE-BfZk10Ck.js} +1 -1
- package/dist/storybook/assets/{blocks-A7XjcsrR.js → blocks-B5nfR6eT.js} +5 -5
- package/dist/storybook/assets/{formatter-EIJCOSYU-BJ6Z7p9H.js → formatter-EIJCOSYU-C6x8bWLG.js} +1 -1
- package/dist/storybook/assets/if-defined-DDVGLNbR.js +1 -0
- package/dist/storybook/assets/{iframe-ChxxW2FZ.js → iframe-BcvNVHT1.js} +96 -96
- package/dist/storybook/assets/{index-ChSJHRK6.js → index-Dr3oTIW1.js} +1 -1
- package/dist/storybook/assets/{onFind-C-gvwlyW.js → onFind--Wy6mnWL.js} +1 -1
- package/dist/storybook/assets/{onFind.stories-8tPEGWhS.js → onFind.stories-Czg2i8Qa.js} +1 -1
- package/dist/storybook/assets/{onRemove.stories-CSuoNbAk.js → onRemove.stories-CdWEQ-ed.js} +1 -1
- package/dist/storybook/assets/{onVisible.stories-LFpM1FnE.js → onVisible.stories-Dt7eDczv.js} +1 -1
- package/dist/storybook/assets/{style-map-4fqj8G4H.js → style-map-DPFpFx07.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-DCcLcHdT.js → syntaxhighlighter-ED5Y7EFY-DDSBv3tE.js} +1 -1
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/project.json +1 -1
- package/dist/util/TooltipMixin.js +5 -5
- package/docs/components/ActionItem.md +0 -5
- package/docs/components/Avatar.md +0 -5
- package/docs/components/CircularProgress.md +1 -1
- package/docs/components/CopyToClipboard.md +1 -1
- package/docs/components/Dropdown.md +0 -5
- package/docs/components/IconButton.md +0 -5
- package/docs/components/LinearProgress.md +1 -1
- package/docs/components/Popover.md +1 -2
- package/docs/components/README.md +12 -0
- package/package.json +4 -2
- package/src/legacy/tool-ui/src/ContentInputGroup.css +14 -0
- package/src/legacy/tool-ui/src/Conversation.ts +4 -0
- package/src/legacy/tool-ui/src/SharePreviewCommenting.ts +20 -7
- package/src/legacy/tool-ui/src/main/webapp/dist/4374.64cf54f35a52b3018a92.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{RTEProseMirror.beb34ef615bdd5b46ab0.js → RTEProseMirror.21cf219f5059871000ac.js} +20 -16
- package/src/legacy/tool-ui/src/main/webapp/dist/{v4.fee133dfaae516995f6c.js → v4.52a6959b2399a799f794.js} +4 -4
- package/src/legacy/tool-ui/src/main/webapp/dist/{v5.450b0b8178c9222bafab.css → v5.0ef7fbc0b9bb4d1e4672.css} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{v5.c52683421261f109dd30.js → v5.e96c4c06e69cfe5bb937.js} +6 -6
- package/src/legacy/tool-ui/src/v5.ts +2 -0
- package/dist/storybook/assets/if-defined-C9mNa1xD.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/4374.37147747a254da8f5f8a.js +0 -1
- /package/src/legacy/tool-ui/src/main/webapp/dist/{RTEProseMirror.beb34ef615bdd5b46ab0.js.LICENSE.txt → RTEProseMirror.21cf219f5059871000ac.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{v4.fee133dfaae516995f6c.js.LICENSE.txt → v4.52a6959b2399a799f794.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{v5.c52683421261f109dd30.js.LICENSE.txt → v5.e96c4c06e69cfe5bb937.js.LICENSE.txt} +0 -0
|
@@ -62,11 +62,6 @@
|
|
|
62
62
|
| `fallback` | fallback | |
|
|
63
63
|
| `size` | size | |
|
|
64
64
|
| `tooltip` | tooltip | TooltipMixin |
|
|
65
|
-
| `tooltipPosition` | tooltipPosition | TooltipMixin |
|
|
66
|
-
| `tooltipDelay` | tooltipDelay | TooltipMixin |
|
|
67
|
-
| `tooltipOffset` | tooltipOffset | TooltipMixin |
|
|
68
|
-
| `tooltipNoArrow` | tooltipNoArrow | TooltipMixin |
|
|
69
|
-
| `tooltipTrigger` | tooltipTrigger | TooltipMixin |
|
|
70
65
|
| `tooltip-position` | tooltipPosition | TooltipMixin |
|
|
71
66
|
| `tooltip-delay` | tooltipDelay | TooltipMixin |
|
|
72
67
|
| `tooltip-offset` | tooltipOffset | TooltipMixin |
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
| `color` | | `ProgressColors` | `'primary'` | Color theme of the progress indicator.
Supports: black, white, primary, teal, gray, purple, rose, error, warning, success | ProgressMixin |
|
|
26
26
|
| `thickness` | | `number \| undefined` | | Stroke width of the progress indicator. | ProgressMixin |
|
|
27
27
|
| `_progress` | private | `number` | `0` | | ProgressMixin |
|
|
28
|
-
| `progress` | |
|
|
28
|
+
| `progress` | | `number` | | Progress value for determinate variant. Clamped to 0–100. | ProgressMixin |
|
|
29
29
|
| `label` | | `string \| undefined` | | Optional label text to display with the progress indicator. | ProgressMixin |
|
|
30
30
|
| `initialAnimation` | | `boolean` | `true` | Whether to animate progress from 0 to target value when component first becomes visible. | ProgressMixin |
|
|
31
31
|
| `ariaLabel` | | `string \| null` | `null` | Optional aria-label attribute for screen readers.
Describes what the progress indicator represents. | ProgressMixin |
|
|
@@ -80,11 +80,6 @@
|
|
|
80
80
|
| `stay-open-on-select` | stayOpenOnSelect | |
|
|
81
81
|
| `no-chevron` | noChevron | |
|
|
82
82
|
| `tooltip` | tooltip | TooltipMixin |
|
|
83
|
-
| `tooltipPosition` | tooltipPosition | TooltipMixin |
|
|
84
|
-
| `tooltipDelay` | tooltipDelay | TooltipMixin |
|
|
85
|
-
| `tooltipOffset` | tooltipOffset | TooltipMixin |
|
|
86
|
-
| `tooltipNoArrow` | tooltipNoArrow | TooltipMixin |
|
|
87
|
-
| `tooltipTrigger` | tooltipTrigger | TooltipMixin |
|
|
88
83
|
| `tooltip-position` | tooltipPosition | TooltipMixin |
|
|
89
84
|
| `tooltip-delay` | tooltipDelay | TooltipMixin |
|
|
90
85
|
| `tooltip-offset` | tooltipOffset | TooltipMixin |
|
|
@@ -67,11 +67,6 @@
|
|
|
67
67
|
| `destructive` | destructive | |
|
|
68
68
|
| `disabled` | disabled | |
|
|
69
69
|
| `tooltip` | tooltip | TooltipMixin |
|
|
70
|
-
| `tooltipPosition` | tooltipPosition | TooltipMixin |
|
|
71
|
-
| `tooltipDelay` | tooltipDelay | TooltipMixin |
|
|
72
|
-
| `tooltipOffset` | tooltipOffset | TooltipMixin |
|
|
73
|
-
| `tooltipNoArrow` | tooltipNoArrow | TooltipMixin |
|
|
74
|
-
| `tooltipTrigger` | tooltipTrigger | TooltipMixin |
|
|
75
70
|
| `tooltip-position` | tooltipPosition | TooltipMixin |
|
|
76
71
|
| `tooltip-delay` | tooltipDelay | TooltipMixin |
|
|
77
72
|
| `tooltip-offset` | tooltipOffset | TooltipMixin |
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
| `color` | | `ProgressColors` | `'primary'` | Color theme of the progress indicator.
Supports: black, white, primary, teal, gray, purple, rose, error, warning, success | ProgressMixin |
|
|
24
24
|
| `thickness` | | `number \| undefined` | | Stroke width of the progress indicator. | ProgressMixin |
|
|
25
25
|
| `_progress` | private | `number` | `0` | | ProgressMixin |
|
|
26
|
-
| `progress` | |
|
|
26
|
+
| `progress` | | `number` | | Progress value for determinate variant. Clamped to 0–100. | ProgressMixin |
|
|
27
27
|
| `label` | | `string \| undefined` | | Optional label text to display with the progress indicator. | ProgressMixin |
|
|
28
28
|
| `initialAnimation` | | `boolean` | `true` | Whether to animate progress from 0 to target value when component first becomes visible. | ProgressMixin |
|
|
29
29
|
| `ariaLabel` | | `string \| null` | `null` | Optional aria-label attribute for screen readers.
Describes what the progress indicator represents. | ProgressMixin |
|
|
@@ -58,11 +58,10 @@
|
|
|
58
58
|
| `trigger` | trigger | |
|
|
59
59
|
| `delay` | delay | |
|
|
60
60
|
| `offset` | offset | |
|
|
61
|
-
| `
|
|
61
|
+
| `no-arrow` | noArrow | |
|
|
62
62
|
| `inverted` | inverted | |
|
|
63
63
|
| `open` | open | |
|
|
64
64
|
| `panel-label` | panelLabel | |
|
|
65
|
-
| `no-arrow` | noArrow | |
|
|
66
65
|
|
|
67
66
|
### CSS Properties
|
|
68
67
|
|
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
This directory contains auto-generated API documentation for all Brightspot UI web components.
|
|
4
4
|
|
|
5
|
+
## Using these in a plugin
|
|
6
|
+
|
|
7
|
+
The CMS page already styles every component here, but it defines only four of the elements:
|
|
8
|
+
|
|
9
|
+
- `btu-badge`, from this library;
|
|
10
|
+
- `btu-icon`, `btu-widget` and `btu-copy-to-clipboard`, using the CMS's own legacy implementations.
|
|
11
|
+
|
|
12
|
+
Import any other element in your plugin's frontend entry, for example
|
|
13
|
+
`import '@brightspot/ui/components/card/Card.js'`, or the tag stays an undefined, inert element. That includes elements
|
|
14
|
+
your Java renders through the generated `com.brightspot.ui.dari` classes. Importing one of the four changes nothing on a
|
|
15
|
+
CMS page, because the CMS defines it first.
|
|
16
|
+
|
|
5
17
|
## Components
|
|
6
18
|
|
|
7
19
|
- [`<btu-action-bar>` - ActionBar](ActionBar.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspot/ui",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"description": "A UI library for building Brightspot CMS components.",
|
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"test:storybook": "vitest --project=storybook",
|
|
29
29
|
"test:css-bloat": "vitest run --project=css-bloat",
|
|
30
30
|
"test:combo-input": "vitest run --project=combo-input",
|
|
31
|
+
"test:cem-runtime": "vitest run --project=cem-runtime",
|
|
32
|
+
"test:dari-fixtures": "vitest run --project=dari-fixtures",
|
|
31
33
|
"check:conventions": "yarn cem && node scripts/check-conventions-all.mjs",
|
|
32
34
|
"check:conventions:fast": "node scripts/check-conventions.mjs",
|
|
33
35
|
"prepare": "husky && (cd src/legacy/tool-ui && yarn install)",
|
|
@@ -46,7 +48,7 @@
|
|
|
46
48
|
"@types/node": "^24.10.0",
|
|
47
49
|
"@types/postcss-import": "^14.0.3",
|
|
48
50
|
"@types/uuid": "^8.3.0",
|
|
49
|
-
"@vitest/browser-playwright": "^4.
|
|
51
|
+
"@vitest/browser-playwright": "^4.1.11",
|
|
50
52
|
"@wc-toolkit/storybook-helpers": "^10.0.0",
|
|
51
53
|
"autoprefixer": "10.4.21",
|
|
52
54
|
"css-loader": "^6.7.1",
|
|
@@ -77,6 +77,20 @@
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
/* Figma Character/Item Count badge: 20px pill, 100/900 shades (the plugin defaults to 50/800). */
|
|
81
|
+
.CIG-wordCountBadge {
|
|
82
|
+
@apply btu-badge-sm me-1 self-start leading-4 [--badge-px:theme(spacing.1)] [--badge-py:0];
|
|
83
|
+
|
|
84
|
+
/* Set per modifier: the plugin's color classes re-add the underline at higher specificity. */
|
|
85
|
+
&.is-error {
|
|
86
|
+
@apply btu-badge-error no-underline btu-badge-foreground-[oklch(var(--btu-theme-error-900))] btu-badge-background-[oklch(var(--btu-theme-error-100))];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&.is-warning {
|
|
90
|
+
@apply btu-badge-warning no-underline btu-badge-foreground-[oklch(var(--btu-theme-warning-900))] btu-badge-background-[oklch(var(--btu-theme-warning-100))];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
80
94
|
.CIG-help,
|
|
81
95
|
.CIG-guide,
|
|
82
96
|
.CIG-comments,
|
|
@@ -53,6 +53,7 @@ onFind(
|
|
|
53
53
|
(fieldName === postData.fieldName || fieldName === '')
|
|
54
54
|
) {
|
|
55
55
|
// Fetch updated posts and replace the posts container
|
|
56
|
+
const previewId = conversation.dataset.previewId
|
|
56
57
|
const url =
|
|
57
58
|
window.BRIGHTSPOT.web.pagePaths[
|
|
58
59
|
'com.psddev.cms.conversation.Posts'
|
|
@@ -65,6 +66,9 @@ onFind(
|
|
|
65
66
|
fieldName,
|
|
66
67
|
contextual,
|
|
67
68
|
overlayId,
|
|
69
|
+
// Carry the current preview so the server can suppress the
|
|
70
|
+
// "view shared preview" button on this preview's own comments.
|
|
71
|
+
...(previewId ? { sharedPreviewId: previewId } : {}),
|
|
68
72
|
})
|
|
69
73
|
const response = await fetch(url, {
|
|
70
74
|
credentials: 'include',
|
|
@@ -377,9 +377,19 @@ function initCommentingOverlay(sharePreview: HTMLElement) {
|
|
|
377
377
|
'wheel',
|
|
378
378
|
(e: WheelEvent) => {
|
|
379
379
|
e.preventDefault()
|
|
380
|
-
// Optimistic: update local scroll for immediate pin repositioning.
|
|
381
|
-
|
|
382
|
-
|
|
380
|
+
// Optimistic: update local scroll for immediate pin repositioning. Clamp to the
|
|
381
|
+
// document's real scroll range — the preview iframe stops at its bottom and reports
|
|
382
|
+
// no further ScrollData, so an unbounded value would keep sliding pins off-screen.
|
|
383
|
+
const maxScrollX = Math.max(0, postMessageDocWidth - overlay.clientWidth)
|
|
384
|
+
const maxScrollY = Math.max(0, postMessageDocHeight - overlay.clientHeight)
|
|
385
|
+
postMessageScrollX = Math.min(
|
|
386
|
+
maxScrollX,
|
|
387
|
+
Math.max(0, postMessageScrollX + e.deltaX),
|
|
388
|
+
)
|
|
389
|
+
postMessageScrollY = Math.min(
|
|
390
|
+
maxScrollY,
|
|
391
|
+
Math.max(0, postMessageScrollY + e.deltaY),
|
|
392
|
+
)
|
|
383
393
|
scheduleReposition()
|
|
384
394
|
postToPreview({
|
|
385
395
|
type: 'BSP.SharedPreview.ScrollBy',
|
|
@@ -478,10 +488,13 @@ function initCommentingOverlay(sharePreview: HTMLElement) {
|
|
|
478
488
|
const pin = cachedPins.find((p) => p.id === postId)
|
|
479
489
|
if (!pin || !hasScrollData) return
|
|
480
490
|
|
|
481
|
-
// Center the pin vertically in the viewport
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
491
|
+
// Center the pin vertically in the viewport, clamped to the document's real scroll
|
|
492
|
+
// range — near the bottom the preview can't scroll far enough to center the pin, so an
|
|
493
|
+
// unclamped target would overshoot and jump every pin out of place.
|
|
494
|
+
const maxScrollY = Math.max(0, postMessageDocHeight - overlay.clientHeight)
|
|
495
|
+
const targetScrollY = Math.min(
|
|
496
|
+
maxScrollY,
|
|
497
|
+
Math.max(0, pinAbsoluteY(pin) - (overlay.clientHeight || 1) / 2),
|
|
485
498
|
)
|
|
486
499
|
postToPreview({ type: 'BSP.SharedPreview.ScrollTo', top: targetScrollY })
|
|
487
500
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkbrightspot_cms=self.webpackChunkbrightspot_cms||[]).push([[4374],{82277(e){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg=="},41399(e,r,t){t.d(r,{A:()=>f});var a=t(64664),i=t.n(a),o=t(25243),n=t.n(o),s=t(20368),p=t.n(s),l=new URL(t(82277),t.b),c=n()(i()),d=p()(l);c.push([e.id,`.sp-hidden,.sp-initial{display:none}.sp-replacer{max-width:100%;position:relative;user-select:none;width:200px}[dir] .sp-replacer{cursor:pointer}[dir=ltr] .sp-replacer{padding:var(--gap-s) calc(var(--gap-s) + var(--Icon-size)) var(--gap-s) 0}[dir=rtl] .sp-replacer{padding:var(--gap-s) 0 var(--gap-s) calc(var(--gap-s) + var(--Icon-size))}.sp-replacer:before{bottom:0;content:"";height:1px;position:absolute}[dir] .sp-replacer:before{background:var(--Input-borderColor)}[dir=ltr] .sp-replacer:before,[dir=rtl] .sp-replacer:before{left:0;right:0}[dir] .sp-replacer.sp-active{background:var(--Input-focusBackground)}.sp-replacer.sp-active:before{height:2px}[dir] .sp-replacer.sp-active:before,[dir] .sp-replacer:focus:before,[dir] .sp-replacer:hover:before{background:var(--Input-focusColor)}.sp-replacer:focus .sp-dd,.sp-replacer:hover .sp-dd{color:var(--Input-focusColor)}.SearchWidget-filter .sp-replacer{width:100%}.sp-preview{overflow:hidden;text-overflow:ellipsis;user-select:none;white-space:nowrap;width:100%}.sp-preview:before{content:""}.sp-preview[data-placeholder]:after{content:attr(data-placeholder);font-style:italic}[dir=ltr] .sp-preview[data-placeholder]:after{padding-left:30px}[dir=rtl] .sp-preview[data-placeholder]:after{padding-right:30px}.sp-preview[data-color]:after{content:attr(data-color);font-style:normal}[dir=ltr] .sp-preview[data-color]:after{padding-left:30px}[dir=rtl] .sp-preview[data-color]:after{padding-right:30px}.sp-preview[data-placeholder]:not([data-color]):after{color:var(--color-gray5)}.sp-preview-inner,.sp-preview:before{height:var(--Text-height);position:absolute;top:var(--gap-s);width:var(--Text-height)}[dir] .sp-preview-inner,[dir] .sp-preview:before{border-radius:50%}[dir=ltr] .sp-preview-inner,[dir=ltr] .sp-preview:before{left:0}[dir=rtl] .sp-preview-inner,[dir=rtl] .sp-preview:before{right:0}.sp-preview:not([data-placeholder^="#"]) .sp-preview-inner.sp-clear-display:before{--Icon-fill:"FILL" 1;display:inline-block;font-family:Material Symbols Outlined;font-feature-settings:"liga";font-size:var(--Icon-size);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-style:normal;font-variation-settings:var(--Icon-fill);font-weight:400;letter-spacing:normal;line-height:1;position:relative;text-rendering:optimizeLegibility;text-transform:none;top:calc((var(--Text-height) - var(--Icon-size)) / 2);vertical-align:top;white-space:nowrap;word-wrap:normal;content:"block";font-size:var(--Text-height);top:0}[dir] .sp-preview:not([data-placeholder^="#"]) .sp-preview-inner.sp-clear-display:before{transform:var(--Icon-transform)}[dir=ltr] .sp-preview:not([data-placeholder^="#"]) .sp-preview-inner.sp-clear-display:before{direction:ltr}[dir=rtl] .sp-preview:not([data-placeholder^="#"]) .sp-preview-inner.sp-clear-display:before{direction:rtl}.sp-dd{bottom:calc(var(--gap-s) + (var(--Text-height) - var(--Icon-size)) / 2);height:var(--Icon-size);overflow:hidden;position:absolute;width:var(--Icon-size)}[dir=ltr] .sp-dd{right:var(--gap-s)}[dir=rtl] .sp-dd{left:var(--gap-s)}.sp-dd:before{--Icon-fill:"FILL" 1;display:inline-block;font-family:Material Symbols Outlined;font-feature-settings:"liga";font-size:var(--Icon-size);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-style:normal;font-variation-settings:var(--Icon-fill);font-weight:400;letter-spacing:normal;line-height:1;position:relative;text-rendering:optimizeLegibility;text-transform:none;top:calc((var(--Text-height) - var(--Icon-size)) / 2);vertical-align:top;white-space:nowrap;word-wrap:normal;content:"arrow_drop_down";top:0;transition:transform var(--time-xs)}[dir] .sp-dd:before{transform:var(--Icon-transform)}[dir=ltr] .sp-dd:before{direction:ltr}[dir=rtl] .sp-dd:before{direction:rtl}.sp-active .sp-dd:before{color:var(--Input-focusColor)}[dir=ltr] .sp-active .sp-dd:before{transform:rotate(-180deg)}[dir=rtl] .sp-active .sp-dd:before{transform:rotate(180deg)}.sp-container{width:auto;z-index:100001}[dir] .sp-container{background:var(--color-white);box-shadow:var(--shadow-3);padding:var(--gap-m)}.sp-container,.sp-container button{user-select:none}.sp-top{position:relative;width:100%}[dir] .sp-fill{padding-top:100%}.sp-color{bottom:calc(var(--gap-s) + var(--Icon-size));position:absolute;top:0}[dir=ltr] .sp-color{left:0;right:calc(var(--gap-s) + var(--Icon-size))}[dir=rtl] .sp-color{right:0;left:calc(var(--gap-s) + var(--Icon-size))}.sp-sat,.sp-val{bottom:0;position:absolute;top:0}[dir=ltr] .sp-sat,[dir=ltr] .sp-val,[dir=rtl] .sp-sat,[dir=rtl] .sp-val{left:0;right:0}[dir=ltr] .sp-sat{background-image:linear-gradient(90deg,#fff,rgba(204,154,129,0))}[dir=rtl] .sp-sat{background-image:linear-gradient(270deg,#fff,rgba(204,154,129,0))}[dir] .sp-val{background-image:linear-gradient(0deg,#000,rgba(204,154,129,0))}.sp-alpha-handle,.sp-dragger,.sp-slider{opacity:.5;position:absolute;user-select:none}[dir] .sp-alpha-handle,[dir] .sp-dragger,[dir] .sp-slider{background:var(--color-white);border:1px solid var(--color-black);cursor:pointer}.sp-dragger{height:10px;top:0;width:10px}[dir] .sp-dragger{border-radius:50%}[dir=ltr] .sp-dragger{left:0}[dir=rtl] .sp-dragger{right:0}.sp-clear{position:absolute;top:0;user-select:none}[dir=ltr] .sp-clear{right:0}[dir=rtl] .sp-clear{left:0}.sp-clear:before{--Icon-fill:"FILL" 1;display:inline-block;font-family:Material Symbols Outlined;font-feature-settings:"liga";font-size:var(--Icon-size);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-style:normal;font-variation-settings:var(--Icon-fill);font-weight:400;letter-spacing:normal;line-height:1;position:relative;text-rendering:optimizeLegibility;text-transform:none;top:calc((var(--Text-height) - var(--Icon-size)) / 2);vertical-align:top;white-space:nowrap;word-wrap:normal;content:"block"}[dir] .sp-clear:before{transform:var(--Icon-transform)}[dir=ltr] .sp-clear:before{direction:ltr}[dir=rtl] .sp-clear:before{direction:rtl}.sp-hue{bottom:calc(var(--gap-s) + var(--Icon-size));position:absolute;top:calc(var(--Icon-size) + var(--gap-s));width:var(--Icon-size)}[dir] .sp-hue{background:linear-gradient(180deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}[dir=ltr] .sp-hue{right:0}[dir=rtl] .sp-hue{left:0}.sp-slider{height:7px;top:0}[dir=ltr] .sp-slider,[dir=rtl] .sp-slider{left:-1px;right:-1px}.sp-alpha{bottom:0;display:none;height:var(--Icon-size);position:absolute;user-select:none}[dir] .sp-alpha{background:url(${d}) 50%}[dir=ltr] .sp-alpha,[dir=rtl] .sp-alpha{left:0;right:0}.sp-alpha-inner{height:100%;width:100%}.sp-alpha-handle{bottom:-1px;top:-1px;width:7px}[dir=ltr] .sp-alpha-handle{left:50%}[dir=rtl] .sp-alpha-handle{right:50%}[dir] .sp-input-container{margin:calc(0px - var(--gap-m)) 0 var(--gap-m) 0}.sp-container .sp-input{box-sizing:border-box}.sp-cancel{line-height:calc(var(--gap-s) * 2 + var(--Text-height))}[dir=ltr] .sp-cancel{float:right}[dir=rtl] .sp-cancel{float:left}.sp-palette{max-width:calc((var(--gap-s) + var(--gap-m)) * 4)}[dir=ltr] .sp-picker-container{float:left}[dir=rtl] .sp-picker-container{float:right}.sp-palette-container{position:relative}[dir=ltr] .sp-palette-container{float:right}[dir=rtl] .sp-palette-container{float:left}.sp-cf:after,.sp-cf:before{content:"";display:table}.sp-container *{box-sizing:content-box}.sp-palette .sp-thumb-el{display:block;height:var(--gap-l);position:relative;width:var(--gap-l)}[dir] .sp-palette .sp-thumb-el{cursor:pointer}[dir=ltr] .sp-palette .sp-thumb-el{float:left;margin:0 0 var(--gap-s) var(--gap-s)}[dir=rtl] .sp-palette .sp-thumb-el{float:right;margin:0 var(--gap-s) var(--gap-s) 0}.sp-alpha,.sp-preview,.sp-thumb-el{position:relative}.sp-alpha-inner,.sp-preview-inner,.sp-thumb-inner{bottom:0;display:block;position:absolute;top:0}[dir=ltr] .sp-alpha-inner,[dir=ltr] .sp-preview-inner,[dir=ltr] .sp-thumb-inner,[dir=rtl] .sp-alpha-inner,[dir=rtl] .sp-preview-inner,[dir=rtl] .sp-thumb-inner{left:0;right:0}[dir] .sp-palette .sp-thumb-inner{background-position:50% 50%;background-repeat:no-repeat}.sp-palette-button-container{display:none}`,""]);const f=7717==t.j?c:null},25243(e){e.exports=function(e){var r=[];return r.toString=function(){return this.map(function(r){var t="",a=void 0!==r[5];return r[4]&&(t+="@supports (".concat(r[4],") {")),r[2]&&(t+="@media ".concat(r[2]," {")),a&&(t+="@layer".concat(r[5].length>0?" ".concat(r[5]):""," {")),t+=e(r),a&&(t+="}"),r[2]&&(t+="}"),r[4]&&(t+="}"),t}).join("")},r.i=function(e,t,a,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var n={};if(a)for(var s=0;s<this.length;s++){var p=this[s][0];null!=p&&(n[p]=!0)}for(var l=0;l<e.length;l++){var c=[].concat(e[l]);a&&n[c[0]]||(void 0!==o&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=o),t&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=t):c[2]=t),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),r.push(c))}},r}},20368(e){e.exports=function(e,r){return r||(r={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),r.hash&&(e+=r.hash),/["'() \t\n]|(%20)/.test(e)||r.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},64664(e){e.exports=function(e){return e[1]}},34374(e,r,t){t.r(r),t.d(r,{default:()=>b});var a=t(96291),i=t.n(a),o=t(96918),n=t.n(o),s=t(77322),p=t.n(s),l=t(55800),c=t.n(l),d=t(10207),f=t.n(d),g=t(37746),h=t.n(g),v=t(41399),u={};u.styleTagTransform=h(),u.setAttributes=c(),u.insert=p().bind(null,"head"),u.domAPI=n(),u.insertStyleElement=f(),i()(v.A,u);const b=v.A&&v.A.locals?v.A.locals:void 0},96291(e){var r=[];function t(e){for(var t=-1,a=0;a<r.length;a++)if(r[a].identifier===e){t=a;break}return t}function a(e,a){for(var o={},n=[],s=0;s<e.length;s++){var p=e[s],l=a.base?p[0]+a.base:p[0],c=o[l]||0,d="".concat(l," ").concat(c);o[l]=c+1;var f=t(d),g={css:p[1],media:p[2],sourceMap:p[3],supports:p[4],layer:p[5]};if(-1!==f)r[f].references++,r[f].updater(g);else{var h=i(g,a);a.byIndex=s,r.splice(s,0,{identifier:d,updater:h,references:1})}n.push(d)}return n}function i(e,r){var t=r.domAPI(r);return t.update(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap&&r.supports===e.supports&&r.layer===e.layer)return;t.update(e=r)}else t.remove()}}e.exports=function(e,i){var o=a(e=e||[],i=i||{});return function(e){e=e||[];for(var n=0;n<o.length;n++){var s=t(o[n]);r[s].references--}for(var p=a(e,i),l=0;l<o.length;l++){var c=t(o[l]);0===r[c].references&&(r[c].updater(),r.splice(c,1))}o=p}}},77322(e){var r={};e.exports=function(e,t){var a=function(e){if(void 0===r[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}r[e]=t}return r[e]}(e);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}},10207(e){e.exports=function(e){var r=document.createElement("style");return e.setAttributes(r,e.attributes),e.insert(r,e.options),r}},55800(e,r,t){e.exports=function(e){var r=t.nc;r&&e.setAttribute("nonce",r)}},96918(e){e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var r=e.insertStyleElement(e);return{update:function(t){!function(e,r,t){var a="";t.supports&&(a+="@supports (".concat(t.supports,") {")),t.media&&(a+="@media ".concat(t.media," {"));var i=void 0!==t.layer;i&&(a+="@layer".concat(t.layer.length>0?" ".concat(t.layer):""," {")),a+=t.css,i&&(a+="}"),t.media&&(a+="}"),t.supports&&(a+="}");var o=t.sourceMap;o&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),r.styleTagTransform(a,e,r.options)}(r,e,t)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)}}}},37746(e){e.exports=function(e,r){if(r.styleSheet)r.styleSheet.cssText=e;else{for(;r.firstChild;)r.removeChild(r.firstChild);r.appendChild(document.createTextNode(e))}}}}]);
|