@redvars/peacock 4.2.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BaseField-_unSNU5x.js → BaseField-CHBcjVc2.js} +3 -3
- package/dist/{BaseField-_unSNU5x.js.map → BaseField-CHBcjVc2.js.map} +1 -1
- package/dist/{BaseInput-DtZH0fPJ.js → BaseInput-DZp2O8Gh.js} +2 -2
- package/dist/{BaseInput-DtZH0fPJ.js.map → BaseInput-DZp2O8Gh.js.map} +1 -1
- package/dist/ai-badge.js +2 -2
- package/dist/ai-summary.js +2 -2
- package/dist/alert.js +2 -2
- package/dist/anchor-nav.js +2 -2
- package/dist/app-shell.js +2 -2
- package/dist/assistant-panel.js +2 -2
- package/dist/assistant-step.js +2 -2
- package/dist/assistant-steps.js +2 -2
- package/dist/avatar-group.js +2 -2
- package/dist/banner.js +2 -2
- package/dist/{base-progress-D7Nmfh1s.js → base-progress-CKQ32Ruw.js} +2 -2
- package/dist/{base-progress-D7Nmfh1s.js.map → base-progress-CKQ32Ruw.js.map} +1 -1
- package/dist/bottom-sheet.js +2 -2
- package/dist/breadcrumb.js +2 -2
- package/dist/calendar.js +2 -2
- package/dist/{canvas-base-CWQ4rQ2s.js → canvas-base-BoKef3yr.js} +2 -2
- package/dist/{canvas-base-CWQ4rQ2s.js.map → canvas-base-BoKef3yr.js.map} +1 -1
- package/dist/carousel.js +644 -0
- package/dist/carousel.js.map +1 -0
- package/dist/{cartesian-chart-CS5yRLfE.js → cartesian-chart-DqZxnoG1.js} +2 -2
- package/dist/{cartesian-chart-CS5yRLfE.js.map → cartesian-chart-DqZxnoG1.js.map} +1 -1
- package/dist/{cb-group-base-CO30uFQZ.js → cb-group-base-Bf7iOIGS.js} +2 -2
- package/dist/{cb-group-base-CO30uFQZ.js.map → cb-group-base-Bf7iOIGS.js.map} +1 -1
- package/dist/cb-group.js +3 -3
- package/dist/cb-rule.js +3 -3
- package/dist/chart-area.js +4 -4
- package/dist/chart-bar.js +4 -4
- package/dist/{chart-base-C_XKVyhf.js → chart-base-ByCJM_9C.js} +2 -2
- package/dist/{chart-base-C_XKVyhf.js.map → chart-base-ByCJM_9C.js.map} +1 -1
- package/dist/chart-doughnut.js +3 -3
- package/dist/chart-line.js +4 -4
- package/dist/chart-pie.js +3 -3
- package/dist/chat-event.js +2 -2
- package/dist/chat-message.js +2 -2
- package/dist/chat-thread.js +2 -2
- package/dist/checkbox-group.js +3 -3
- package/dist/checkbox.js +3 -3
- package/dist/chip-set.js +2 -2
- package/dist/chip.js +2 -2
- package/dist/circular-progress.js +3 -3
- package/dist/citation.js +2 -2
- package/dist/code-editor.js +3 -3
- package/dist/code-highlighter.js +2 -2
- package/dist/color-field.js +4 -4
- package/dist/color-picker.js +2 -2
- package/dist/command-palette.js +2 -2
- package/dist/comment-composer.js +24 -12
- package/dist/comment-composer.js.map +1 -1
- package/dist/condition-builder.js +3 -3
- package/dist/confirm-dialog.js +2 -2
- package/dist/copy-button.js +2 -2
- package/dist/currency-field.js +4 -4
- package/dist/custom-elements-jsdocs.json +936 -56
- package/dist/custom-elements.json +3486 -554
- package/dist/date-field.js +5 -5
- package/dist/date-picker.js +2 -2
- package/dist/date-range-field.js +5 -5
- package/dist/datetime-field.js +5 -5
- package/dist/dependency-map.js +3 -3
- package/dist/description-item.js +2 -2
- package/dist/description-list.js +2 -2
- package/dist/{diagram-Va096vj9.js → diagram-Cnrj-4y3.js} +2 -2
- package/dist/{diagram-Va096vj9.js.map → diagram-Cnrj-4y3.js.map} +1 -1
- package/dist/diagram-controls.js +2 -2
- package/dist/diagram-minimap.js +2 -2
- package/dist/diagram.js +4 -4
- package/dist/diff-viewer.js +2 -2
- package/dist/discussion-activity.js +2 -2
- package/dist/discussion-comment.js +2 -2
- package/dist/discussion.js +4 -4
- package/dist/{document-editor-Dc8JeFVB.js → document-editor-C8ThjDQ7.js} +22 -10
- package/dist/{document-editor-Dc8JeFVB.js.map → document-editor-C8ThjDQ7.js.map} +1 -1
- package/dist/document-editor.js +3 -3
- package/dist/draft-card.js +2 -2
- package/dist/erd.js +3 -3
- package/dist/file-upload.js +3 -3
- package/dist/filter-bar.js +2 -2
- package/dist/flow.js +4 -4
- package/dist/form.js +2 -2
- package/dist/{generative-view-BKlcuujw.js → generative-view-CQ8-g1wY.js} +2 -2
- package/dist/{generative-view-BKlcuujw.js.map → generative-view-CQ8-g1wY.js.map} +1 -1
- package/dist/generative-view.js +3 -3
- package/dist/highlight-Be0wu7kh.js +252 -0
- package/dist/highlight-Be0wu7kh.js.map +1 -0
- package/dist/highlight.js +6 -0
- package/dist/highlight.js.map +1 -0
- package/dist/html-editor.js +29 -12
- package/dist/html-editor.js.map +1 -1
- package/dist/{i18n-controller-DJHsE1YH.js → i18n-controller-DLJcJ5gO.js} +2 -2
- package/dist/{i18n-controller-DJHsE1YH.js.map → i18n-controller-DLJcJ5gO.js.map} +1 -1
- package/dist/image.js +2 -2
- package/dist/index.js +26 -16
- package/dist/index.js.map +1 -1
- package/dist/inline-edit.js +2 -2
- package/dist/input.js +3 -3
- package/dist/json-viewer.js +2 -2
- package/dist/kanban.js +2 -2
- package/dist/kbd.js +2 -2
- package/dist/linear-progress.js +3 -3
- package/dist/listbox.js +2 -2
- package/dist/loader-full.js +19 -9
- package/dist/loader-full.js.map +1 -1
- package/dist/loader.js +46 -9
- package/dist/loader.js.map +1 -1
- package/dist/markdown-editor.js +29 -12
- package/dist/markdown-editor.js.map +1 -1
- package/dist/mention-input.js +4 -4
- package/dist/modal.js +2 -2
- package/dist/navigation-bar.js +2 -2
- package/dist/navigation-drawer.js +2 -2
- package/dist/navigation-rail.js +2 -2
- package/dist/notification-center.js +2 -2
- package/dist/number-field.js +4 -4
- package/dist/page-header.js +2 -2
- package/dist/pagination.js +2 -2
- package/dist/password-field.js +4 -4
- package/dist/password-rules.js +2 -2
- package/dist/phone-field.js +4 -4
- package/dist/{picker-field-CUI05sWc.js → picker-field-B5xOFc3-.js} +3 -3
- package/dist/{picker-field-CUI05sWc.js.map → picker-field-B5xOFc3-.js.map} +1 -1
- package/dist/pin-input.js +4 -4
- package/dist/presence-indicator.js +2 -2
- package/dist/prompt-input.js +24 -12
- package/dist/prompt-input.js.map +1 -1
- package/dist/radio.js +3 -3
- package/dist/rating.js +3 -3
- package/dist/redvars-loader.js +2 -2
- package/dist/relative-time.js +2 -2
- package/dist/resizable-panels.js +2 -2
- package/dist/{rich-text-input-N_hqnXej.js → rich-text-input-C4B9D6oD.js} +21 -18
- package/dist/rich-text-input-C4B9D6oD.js.map +1 -0
- package/dist/{schema-Dy0z-80u.js → schema-CPhNrjrx.js} +2 -2
- package/dist/{schema-Dy0z-80u.js.map → schema-CPhNrjrx.js.map} +1 -1
- package/dist/search.js +3 -3
- package/dist/select.js +4 -4
- package/dist/side-sheet.js +2 -2
- package/dist/signature-pad.js +3 -3
- package/dist/site-footer-group.js +142 -0
- package/dist/site-footer-group.js.map +1 -0
- package/dist/site-footer.js +338 -0
- package/dist/site-footer.js.map +1 -0
- package/dist/site-header.js +774 -0
- package/dist/site-header.js.map +1 -0
- package/dist/site-nav-group.js +123 -0
- package/dist/site-nav-group.js.map +1 -0
- package/dist/site-nav-link.js +321 -0
- package/dist/site-nav-link.js.map +1 -0
- package/dist/site-nav-menu.js +506 -0
- package/dist/site-nav-menu.js.map +1 -0
- package/dist/site-nav-shared-BDR2HG8e.js +23 -0
- package/dist/site-nav-shared-BDR2HG8e.js.map +1 -0
- package/dist/slider.js +3 -3
- package/dist/snackbar.js +2 -2
- package/dist/sparkline.js +2 -2
- package/dist/split-button.js +2 -2
- package/dist/src/__internal/i18n/strings.d.ts +24 -1
- package/dist/src/__internal/rich-text/rich-text-input.d.ts +6 -1
- package/dist/src/carousel/carousel.d.ts +135 -0
- package/dist/src/carousel/index.d.ts +1 -0
- package/dist/src/highlight/highlight.d.ts +56 -0
- package/dist/src/highlight/index.d.ts +2 -0
- package/dist/src/highlight/matches.d.ts +9 -0
- package/dist/src/html-editor/html-editor.d.ts +5 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/markdown-editor/markdown-editor.d.ts +5 -0
- package/dist/src/site-footer/index.d.ts +2 -0
- package/dist/src/site-footer/site-footer-group.d.ts +34 -0
- package/dist/src/site-footer/site-footer.d.ts +74 -0
- package/dist/src/site-header/index.d.ts +4 -0
- package/dist/src/site-header/site-header.d.ts +170 -0
- package/dist/src/site-header/site-nav-group.d.ts +32 -0
- package/dist/src/site-header/site-nav-link.d.ts +65 -0
- package/dist/src/site-header/site-nav-menu.d.ts +104 -0
- package/dist/src/site-header/site-nav-shared.d.ts +13 -0
- package/dist/src/video/index.d.ts +2 -0
- package/dist/src/video/video-source.d.ts +12 -0
- package/dist/src/video/video.d.ts +80 -0
- package/dist/stat.js +2 -2
- package/dist/status-indicator.js +2 -2
- package/dist/step.js +2 -2
- package/dist/stepper.js +2 -2
- package/dist/{strings-DnYjGbbc.js → strings-MXyrGrNs.js} +28 -2
- package/dist/strings-MXyrGrNs.js.map +1 -0
- package/dist/svg.js +2 -2
- package/dist/switch.js +3 -3
- package/dist/table.js +2 -2
- package/dist/test/carousel.test.d.ts +1 -0
- package/dist/test/highlight.test.d.ts +1 -0
- package/dist/test/site-footer.test.d.ts +1 -0
- package/dist/test/site-header.test.d.ts +1 -0
- package/dist/test/video.test.d.ts +1 -0
- package/dist/textarea.js +4 -4
- package/dist/time-field.js +5 -5
- package/dist/time-picker.js +2 -2
- package/dist/timeline-item.js +2 -2
- package/dist/timeline.js +2 -2
- package/dist/{toggle-base-CXmFSp3b.js → toggle-base-I1wE_fVe.js} +2 -2
- package/dist/{toggle-base-CXmFSp3b.js.map → toggle-base-I1wE_fVe.js.map} +1 -1
- package/dist/tour.js +2 -2
- package/dist/transfer-list.js +3 -3
- package/dist/tree-chart.js +3 -3
- package/dist/tree-item.js +2 -2
- package/dist/tree.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typing-indicator.js +2 -2
- package/dist/url-field.js +4 -4
- package/dist/user-menu.js +2 -2
- package/dist/video-IwNmHyft.js +509 -0
- package/dist/video-IwNmHyft.js.map +1 -0
- package/dist/video.js +12 -0
- package/dist/video.js.map +1 -0
- package/dist/virtual-list.js +2 -2
- package/dist/workflow-timeline.js +2 -2
- package/dist/workflow.js +3 -3
- package/dist/workspace-switcher.js +2 -2
- package/package.json +1 -1
- package/readme.md +5 -0
- package/src/__internal/i18n/strings.ts +31 -1
- package/src/__internal/rich-text/editor-chrome.scss +27 -10
- package/src/__internal/rich-text/rich-text-input.ts +17 -16
- package/src/carousel/carousel.scss +124 -0
- package/src/carousel/carousel.ts +547 -0
- package/src/carousel/index.ts +1 -0
- package/src/highlight/highlight.scss +25 -0
- package/src/highlight/highlight.ts +123 -0
- package/src/highlight/index.ts +2 -0
- package/src/highlight/matches.ts +94 -0
- package/src/html-editor/html-editor.ts +5 -0
- package/src/index.ts +18 -0
- package/src/loader.ts +36 -0
- package/src/markdown-editor/markdown-editor.ts +5 -0
- package/src/site-footer/index.ts +2 -0
- package/src/site-footer/site-footer-group.scss +53 -0
- package/src/site-footer/site-footer-group.ts +52 -0
- package/src/site-footer/site-footer.scss +171 -0
- package/src/site-footer/site-footer.ts +151 -0
- package/src/site-header/index.ts +8 -0
- package/src/site-header/site-header.scss +238 -0
- package/src/site-header/site-header.ts +565 -0
- package/src/site-header/site-nav-group.scss +29 -0
- package/src/site-header/site-nav-group.ts +57 -0
- package/src/site-header/site-nav-link.scss +154 -0
- package/src/site-header/site-nav-link.ts +140 -0
- package/src/site-header/site-nav-menu.scss +182 -0
- package/src/site-header/site-nav-menu.ts +336 -0
- package/src/site-header/site-nav-shared.ts +27 -0
- package/src/video/index.ts +2 -0
- package/src/video/video-source.ts +80 -0
- package/src/video/video.scss +183 -0
- package/src/video/video.ts +246 -0
- package/dist/rich-text-input-N_hqnXej.js.map +0 -1
- package/dist/strings-DnYjGbbc.js.map +0 -1
|
@@ -3,11 +3,11 @@ import { n } from './property-B2TG3KEE.js';
|
|
|
3
3
|
import { r } from './state-BCeDVCI9.js';
|
|
4
4
|
import { e } from './query-CHb9Ft_d.js';
|
|
5
5
|
import { e as e$1 } from './class-map-NDIkZErE.js';
|
|
6
|
-
import { I as I18nController } from './i18n-controller-
|
|
6
|
+
import { I as I18nController } from './i18n-controller-DLJcJ5gO.js';
|
|
7
7
|
import { M as MenuTriggerController } from './menu-trigger-controller-CEJq1ugC.js';
|
|
8
8
|
import './base-Cl6v8-BZ.js';
|
|
9
9
|
import './directive-ZPhl09Yt.js';
|
|
10
|
-
import './strings-
|
|
10
|
+
import './strings-MXyrGrNs.js';
|
|
11
11
|
import './locale-DEsJZCQG.js';
|
|
12
12
|
|
|
13
13
|
var css_248z = i`* {
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -161,6 +161,8 @@ Every component below ships in 4.0, except the [AI](#ai) group, which arrives in
|
|
|
161
161
|
|
|
162
162
|
[App shell](https://peacock.redvars.com/components/app-shell) `wc-app-shell` ·
|
|
163
163
|
[App bar](https://peacock.redvars.com/components/app-bar) `wc-app-bar` ·
|
|
164
|
+
[Site header](https://peacock.redvars.com/components/site-header) `wc-site-header` ·
|
|
165
|
+
[Site footer](https://peacock.redvars.com/components/site-footer) `wc-site-footer` ·
|
|
164
166
|
[Page header](https://peacock.redvars.com/components/page-header) `wc-page-header` ·
|
|
165
167
|
[Container](https://peacock.redvars.com/components/container) `wc-container` ·
|
|
166
168
|
[Stack](https://peacock.redvars.com/components/stack) `wc-stack` ·
|
|
@@ -267,6 +269,9 @@ Every component below ships in 4.0, except the [AI](#ai) group, which arrives in
|
|
|
267
269
|
[Diff viewer](https://peacock.redvars.com/components/diff-viewer) `wc-diff-viewer` ·
|
|
268
270
|
[Code highlighter](https://peacock.redvars.com/components/code-highlighter) `wc-code-highlighter` ·
|
|
269
271
|
[Number counter](https://peacock.redvars.com/components/number-counter) `wc-number-counter` ·
|
|
272
|
+
[Carousel](https://peacock.redvars.com/components/carousel) `wc-carousel` ·
|
|
273
|
+
[Video](https://peacock.redvars.com/components/video) `wc-video` ·
|
|
274
|
+
[Highlight](https://peacock.redvars.com/components/highlight) `wc-highlight` ·
|
|
270
275
|
[Image](https://peacock.redvars.com/components/image) `wc-image` ·
|
|
271
276
|
SVG `wc-svg` ·
|
|
272
277
|
[Icon](https://peacock.redvars.com/components/icon) `wc-icon` ·
|
|
@@ -15,7 +15,6 @@ export const defaultStrings = {
|
|
|
15
15
|
disabled: 'Disabled',
|
|
16
16
|
readOnly: 'Read only',
|
|
17
17
|
dragToReorder: 'Drag to reorder',
|
|
18
|
-
readOnlyTag: 'Read Only',
|
|
19
18
|
|
|
20
19
|
// ── Intents (alert, notification) ────────────────────────────────────────
|
|
21
20
|
intentNote: 'Note',
|
|
@@ -126,6 +125,37 @@ export const defaultStrings = {
|
|
|
126
125
|
previewTitle: (title: string): string => `Preview: ${title}`,
|
|
127
126
|
svgPreview: 'SVG preview',
|
|
128
127
|
|
|
128
|
+
// ── Carousel and video ───────────────────────────────────────────────────
|
|
129
|
+
/** Spoken role of a carousel, read as "Testimonials, carousel". */
|
|
130
|
+
carouselRole: 'carousel',
|
|
131
|
+
/** Spoken role of each slide, read as "2 of 5, slide". */
|
|
132
|
+
carouselSlideRole: 'slide',
|
|
133
|
+
/** Name of each slide, for example "2 of 5". */
|
|
134
|
+
carouselSlideLabel: (position: string, total: string): string =>
|
|
135
|
+
`${position} of ${total}`,
|
|
136
|
+
previousSlide: 'Previous slide',
|
|
137
|
+
nextSlide: 'Next slide',
|
|
138
|
+
/** The autoplay button while slides rotate. */
|
|
139
|
+
stopSlideRotation: 'Stop slide rotation',
|
|
140
|
+
/** The autoplay button while slides are still. */
|
|
141
|
+
startSlideRotation: 'Start slide rotation',
|
|
142
|
+
/** Name of the group of picker buttons. */
|
|
143
|
+
chooseSlide: 'Choose slide',
|
|
144
|
+
/** A picker button, for example "Slide 2 of 5" or "Slides 4 to 6 of 9". */
|
|
145
|
+
carouselPicker: (first: string, last: string, total: string): string =>
|
|
146
|
+
first === last
|
|
147
|
+
? `Slide ${first} of ${total}`
|
|
148
|
+
: `Slides ${first} to ${last} of ${total}`,
|
|
149
|
+
/** The counter shown instead of pickers when there are many pages, for example "3 of 9". */
|
|
150
|
+
carouselCounter: (page: string, total: string): string =>
|
|
151
|
+
`${page} of ${total}`,
|
|
152
|
+
/** Name of a video without `label`. */
|
|
153
|
+
video: 'Video',
|
|
154
|
+
/** The play button of a video, for example "Play: Build a portal in ten minutes". */
|
|
155
|
+
playVideo: (label: string): string => `Play: ${label}`,
|
|
156
|
+
videoFromYouTube: 'Plays from YouTube (no cookies)',
|
|
157
|
+
videoFromVimeo: 'Plays from Vimeo',
|
|
158
|
+
|
|
129
159
|
// ── Navigation ───────────────────────────────────────────────────────────
|
|
130
160
|
navigation: 'Navigation',
|
|
131
161
|
mainNavigation: 'Main navigation',
|
|
@@ -85,6 +85,22 @@
|
|
|
85
85
|
flex: 1;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
// Shown with `show-readonly-badge` while the editor is read-only or disabled, as on
|
|
89
|
+
// wc-code-editor.
|
|
90
|
+
.read-only-badge {
|
|
91
|
+
display: inline-flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
gap: var(--spacing-050, 0.25rem);
|
|
94
|
+
padding: 0 var(--spacing-100, 0.5rem);
|
|
95
|
+
color: var(--color-on-surface-variant);
|
|
96
|
+
|
|
97
|
+
@include mixin.get-typography(label-small);
|
|
98
|
+
|
|
99
|
+
wc-icon {
|
|
100
|
+
--icon-size: 0.875rem;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
88
104
|
// ── Editing area ──────────────────────────────────────────────────────────
|
|
89
105
|
|
|
90
106
|
.editor-area {
|
|
@@ -192,9 +208,17 @@
|
|
|
192
208
|
border-radius: 0;
|
|
193
209
|
}
|
|
194
210
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
211
|
+
// Disabled dims the toolbar and the text, as on wc-code-editor. Read-only keeps full contrast:
|
|
212
|
+
// the text is still meant to be read.
|
|
213
|
+
:host([disabled]) {
|
|
214
|
+
.toolbar,
|
|
215
|
+
.editor-area {
|
|
216
|
+
opacity: var(--state-disabled-content-opacity, 0.38);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.editor-area {
|
|
220
|
+
cursor: not-allowed;
|
|
221
|
+
}
|
|
198
222
|
}
|
|
199
223
|
|
|
200
224
|
:host([readonly]) .editor-area {
|
|
@@ -211,13 +235,6 @@
|
|
|
211
235
|
padding-block: var(--spacing-100, 0.5rem);
|
|
212
236
|
}
|
|
213
237
|
|
|
214
|
-
.state-tag {
|
|
215
|
-
position: absolute;
|
|
216
|
-
inset-block-start: var(--spacing-050, 0.25rem);
|
|
217
|
-
inset-inline-end: var(--spacing-050, 0.25rem);
|
|
218
|
-
z-index: 1;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
238
|
// ── Anchors for popups ────────────────────────────────────────────────────
|
|
222
239
|
|
|
223
240
|
.slash-anchor,
|
|
@@ -108,6 +108,10 @@ export default abstract class RichTextInput
|
|
|
108
108
|
@property({ type: Boolean, attribute: 'hide-toolbar' })
|
|
109
109
|
hideToolbar = false;
|
|
110
110
|
|
|
111
|
+
/** Shows a "Read only" badge in the toolbar while the editor is read-only or disabled. Not shown with `hide-toolbar`. */
|
|
112
|
+
@property({ type: Boolean, attribute: 'show-readonly-badge' })
|
|
113
|
+
showReadonlyBadge = false;
|
|
114
|
+
|
|
111
115
|
/** Maximum number of characters of text. Typing stops there, and a count shows below. */
|
|
112
116
|
@property({ type: Number, attribute: 'maxlength' })
|
|
113
117
|
maxlength?: number;
|
|
@@ -638,17 +642,29 @@ export default abstract class RichTextInput
|
|
|
638
642
|
if (!this.sourceView) event.preventDefault();
|
|
639
643
|
};
|
|
640
644
|
|
|
645
|
+
/**
|
|
646
|
+
* The toolbar. A read-only or disabled editor shows no formatting tools, which could do
|
|
647
|
+
* nothing: only View source, and the "Read only" badge with `show-readonly-badge`.
|
|
648
|
+
*/
|
|
641
649
|
private renderToolbar() {
|
|
642
650
|
if (this.hideToolbar) return nothing;
|
|
643
651
|
const { editor, i18n } = this;
|
|
652
|
+
const locked = this.disabled || this.readonly;
|
|
644
653
|
return html`<wc-toolbar
|
|
645
654
|
class="toolbar"
|
|
646
655
|
variant="flat"
|
|
647
656
|
aria-label=${i18n.t('formattingToolbar')}
|
|
648
657
|
@mousedown=${this.keepSelection}
|
|
649
658
|
>
|
|
650
|
-
${editor && !this.sourceView
|
|
659
|
+
${editor && !this.sourceView && !locked
|
|
660
|
+
? this.renderTools(editor)
|
|
661
|
+
: nothing}
|
|
651
662
|
<span class="toolbar-spacer" aria-hidden="true"></span>
|
|
663
|
+
${locked && this.showReadonlyBadge
|
|
664
|
+
? html`<span class="read-only-badge">
|
|
665
|
+
<wc-icon name="lock"></wc-icon>${i18n.t('readOnly')}
|
|
666
|
+
</span>`
|
|
667
|
+
: nothing}
|
|
652
668
|
<wc-icon-button
|
|
653
669
|
class="tool source-toggle"
|
|
654
670
|
variant="text"
|
|
@@ -666,20 +682,6 @@ export default abstract class RichTextInput
|
|
|
666
682
|
</wc-toolbar>`;
|
|
667
683
|
}
|
|
668
684
|
|
|
669
|
-
protected renderStateTag() {
|
|
670
|
-
if (this.disabled) {
|
|
671
|
-
return html`<wc-tag class="state-tag" intent="danger"
|
|
672
|
-
>${this.i18n.t('disabled')}</wc-tag
|
|
673
|
-
>`;
|
|
674
|
-
}
|
|
675
|
-
if (this.readonly) {
|
|
676
|
-
return html`<wc-tag class="state-tag" intent="danger"
|
|
677
|
-
>${this.i18n.t('readOnlyTag')}</wc-tag
|
|
678
|
-
>`;
|
|
679
|
-
}
|
|
680
|
-
return nothing;
|
|
681
|
-
}
|
|
682
|
-
|
|
683
685
|
/** The count below the field, with `maxlength`. */
|
|
684
686
|
private textCount(): string {
|
|
685
687
|
const max = this.maxlength;
|
|
@@ -773,7 +775,6 @@ export default abstract class RichTextInput
|
|
|
773
775
|
></wc-code-editor>
|
|
774
776
|
</div>`
|
|
775
777
|
: nothing}
|
|
776
|
-
${this.renderStateTag()}
|
|
777
778
|
</div>
|
|
778
779
|
</wc-field>
|
|
779
780
|
${this.renderPopups()}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
@use '../../scss/mixin';
|
|
2
|
+
|
|
3
|
+
@include mixin.base-styles;
|
|
4
|
+
|
|
5
|
+
:host {
|
|
6
|
+
display: block;
|
|
7
|
+
min-inline-size: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.carousel {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
gap: var(--spacing-200);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.track {
|
|
17
|
+
// The fallback keeps the slide width calculation valid on a page without the tokens.
|
|
18
|
+
--_gap: var(--carousel-gap, var(--spacing-200, 1rem));
|
|
19
|
+
|
|
20
|
+
display: flex;
|
|
21
|
+
gap: var(--_gap);
|
|
22
|
+
overflow-x: auto;
|
|
23
|
+
overscroll-behavior-x: contain;
|
|
24
|
+
scroll-snap-type: x mandatory;
|
|
25
|
+
scrollbar-width: none;
|
|
26
|
+
|
|
27
|
+
&::-webkit-scrollbar {
|
|
28
|
+
display: none;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
::slotted(*) {
|
|
33
|
+
flex: 0 0
|
|
34
|
+
calc((100% - (var(--_per-view) - 1) * var(--_gap)) / var(--_per-view));
|
|
35
|
+
min-inline-size: 0;
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
scroll-snap-align: start;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// ── Controls ──────────────────────────────────────────────────────────────
|
|
41
|
+
|
|
42
|
+
.controls {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
gap: var(--spacing-150);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.chevron:dir(rtl) {
|
|
50
|
+
transform: scaleX(-1);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.pickers {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: var(--spacing-050);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// The dot is small, the button around it is a 24px target.
|
|
60
|
+
.picker {
|
|
61
|
+
@include mixin.reset-button-styles;
|
|
62
|
+
|
|
63
|
+
position: relative;
|
|
64
|
+
display: grid;
|
|
65
|
+
place-items: center;
|
|
66
|
+
inline-size: 1.5rem;
|
|
67
|
+
block-size: 1.5rem;
|
|
68
|
+
border-radius: var(--shape-corner-full);
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
|
|
71
|
+
&::before {
|
|
72
|
+
content: '';
|
|
73
|
+
inline-size: 0.625rem;
|
|
74
|
+
block-size: 0.625rem;
|
|
75
|
+
border-radius: var(--shape-corner-full);
|
|
76
|
+
background-color: var(--color-outline-variant);
|
|
77
|
+
transition:
|
|
78
|
+
inline-size var(--duration-short4) var(--easing-standard),
|
|
79
|
+
background-color var(--duration-short4) var(--easing-standard);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&:hover::before {
|
|
83
|
+
background-color: var(--color-outline);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&.current {
|
|
87
|
+
inline-size: 2rem;
|
|
88
|
+
|
|
89
|
+
&::before {
|
|
90
|
+
inline-size: 1.5rem;
|
|
91
|
+
background-color: var(--color-primary);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&:focus-visible {
|
|
96
|
+
outline: 2px solid var(--color-primary);
|
|
97
|
+
outline-offset: 0;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.counter {
|
|
102
|
+
@include mixin.get-typography(label-large);
|
|
103
|
+
|
|
104
|
+
min-inline-size: 4rem;
|
|
105
|
+
color: var(--color-on-surface-variant);
|
|
106
|
+
text-align: center;
|
|
107
|
+
font-variant-numeric: tabular-nums;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@media (prefers-reduced-motion: reduce) {
|
|
111
|
+
.picker::before {
|
|
112
|
+
transition: none;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@media (forced-colors: active) {
|
|
117
|
+
.picker::before {
|
|
118
|
+
background-color: ButtonText;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.picker.current::before {
|
|
122
|
+
background-color: Highlight;
|
|
123
|
+
}
|
|
124
|
+
}
|