@kubohiroya/turbowarp-plus-editor-code-views 0.2.1 → 0.4.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/README.ja.md +25 -0
- package/README.md +25 -0
- package/dist/palette-category-visibility.d.ts +98 -0
- package/dist/palette-category-visibility.js +269 -0
- package/dist/palette-visibility-dialog.d.ts +68 -0
- package/dist/palette-visibility-dialog.js +176 -0
- package/package.json +11 -1
- package/src/palette-category-visibility.ts +311 -0
- package/src/palette-visibility-dialog.tsx +250 -0
- package/src/styles.css +197 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
import {ExtensionRow} from '@kubohiroya/turbowarp-extension-security-dialog/react';
|
|
4
|
+
import type {ExtensionMetadata} from '@kubohiroya/turbowarp-extension-security-dialog';
|
|
5
|
+
import {standardGroups, type PaletteGroupSet} from './palette-category-visibility.ts';
|
|
6
|
+
|
|
7
|
+
export interface PaletteExtension {
|
|
8
|
+
/** The extension ID, which is also its palette category ID. */
|
|
9
|
+
id: string;
|
|
10
|
+
/** What the host knows about the extension; at least its name. */
|
|
11
|
+
metadata: ExtensionMetadata;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface PaletteVisibilityChoice {
|
|
15
|
+
/** The groups to show for the target. */
|
|
16
|
+
groups: string[];
|
|
17
|
+
/** Sets added in this dialog, to keep with the project. */
|
|
18
|
+
addedSets: PaletteGroupSet[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface PaletteVisibilityDialogProps {
|
|
22
|
+
locale?: string;
|
|
23
|
+
targetName: string;
|
|
24
|
+
isStage: boolean;
|
|
25
|
+
/** The groups shown now. */
|
|
26
|
+
initial: ReadonlySet<string>;
|
|
27
|
+
/** How many blocks of each group the target's code uses. */
|
|
28
|
+
used: ReadonlyMap<string, number>;
|
|
29
|
+
extensions: readonly PaletteExtension[];
|
|
30
|
+
sets: readonly PaletteGroupSet[];
|
|
31
|
+
onApply(choice: PaletteVisibilityChoice): void;
|
|
32
|
+
onCancel(): void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const standardNames = {
|
|
36
|
+
en: {motion: 'Motion', looks: 'Looks', sound: 'Sound', events: 'Events', control: 'Control', sensing: 'Sensing',
|
|
37
|
+
operators: 'Operators', variables: 'Variables', lists: 'Lists', myBlocks: 'My Blocks'},
|
|
38
|
+
ja: {motion: '動き', looks: '見た目', sound: '音', events: 'イベント', control: '制御', sensing: '調べる',
|
|
39
|
+
operators: '演算', variables: '変数', lists: 'リスト', myBlocks: 'ブロック定義'}
|
|
40
|
+
};
|
|
41
|
+
const standardColors: Record<string, string> = {
|
|
42
|
+
motion: '#4C97FF', looks: '#9966FF', sound: '#CF63CF', events: '#FFBF00', control: '#FFAB19', sensing: '#5CB1D6',
|
|
43
|
+
operators: '#59C059', variables: '#FF8C1A', lists: '#FF661A', myBlocks: '#FF6680'
|
|
44
|
+
};
|
|
45
|
+
const messages = {
|
|
46
|
+
en: {
|
|
47
|
+
title: 'Block groups shown in the palette', sprite: (name: string) => `Sprite “${name}”`, stage: 'Stage',
|
|
48
|
+
sets: 'Applicable sets', addSet: 'Add applicable set', setName: 'Set name', add: 'Add',
|
|
49
|
+
standard: 'Standard block groups', extensions: 'Extension block groups', used: (count: number) => `In use ${count}`,
|
|
50
|
+
hiddenInUse: (count: number) => `Hidden and in use: ${count}`, cancel: 'Cancel', apply: 'Apply', close: 'Close'
|
|
51
|
+
},
|
|
52
|
+
ja: {
|
|
53
|
+
title: 'パレット内のブロックグループの表示・非表示の設定', sprite: (name: string) => `スプライト「${name}」`, stage: '背景',
|
|
54
|
+
sets: '適用可能なセット', addSet: '適用可能なセットを追加', setName: 'セットの名前', add: '追加',
|
|
55
|
+
standard: '標準のブロックグループ', extensions: '機能拡張のブロックグループ', used: (count: number) => `使用中 ${count}`,
|
|
56
|
+
hiddenInUse: (count: number) => `非表示中・使用中 ${count} 件`, cancel: 'キャンセル', apply: '適用', close: '閉じる'
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const isJapanese = (locale?: string) => /^ja(?:-|$)/i.test(locale ?? '');
|
|
60
|
+
|
|
61
|
+
interface DialogState {
|
|
62
|
+
shown: Set<string>;
|
|
63
|
+
addedSets: PaletteGroupSet[];
|
|
64
|
+
naming: boolean;
|
|
65
|
+
setName: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The screen that chooses which block groups the palette shows for one sprite or the stage: sets that
|
|
70
|
+
* switch several groups at once, the standard groups, and one row per extension drawn the same way as the
|
|
71
|
+
* extension review.
|
|
72
|
+
*/
|
|
73
|
+
export class PaletteVisibilityDialog extends React.PureComponent<PaletteVisibilityDialogProps, DialogState> {
|
|
74
|
+
constructor(props: PaletteVisibilityDialogProps) {
|
|
75
|
+
super(props);
|
|
76
|
+
this.state = {shown: new Set(props.initial), addedSets: [], naming: false, setName: ''};
|
|
77
|
+
}
|
|
78
|
+
get text() {
|
|
79
|
+
return isJapanese(this.props.locale) ? messages.ja : messages.en;
|
|
80
|
+
}
|
|
81
|
+
standard() {
|
|
82
|
+
// The stage has no motion blocks.
|
|
83
|
+
return standardGroups.filter(group => !(this.props.isStage && group === 'motion'));
|
|
84
|
+
}
|
|
85
|
+
available(groups: readonly string[]) {
|
|
86
|
+
const offered = new Set<string>([...this.standard(), ...this.props.extensions.map(extension => extension.id)]);
|
|
87
|
+
return groups.filter(group => offered.has(group));
|
|
88
|
+
}
|
|
89
|
+
toggle(group: string) {
|
|
90
|
+
this.setState(({shown}) => {
|
|
91
|
+
const next = new Set(shown);
|
|
92
|
+
if (next.has(group)) next.delete(group);
|
|
93
|
+
else next.add(group);
|
|
94
|
+
return {shown: next};
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
toggleSet(set: PaletteGroupSet) {
|
|
98
|
+
const groups = this.available(set.groups);
|
|
99
|
+
this.setState(({shown}) => {
|
|
100
|
+
const next = new Set(shown);
|
|
101
|
+
const all = groups.every(group => next.has(group));
|
|
102
|
+
for (const group of groups) {
|
|
103
|
+
if (all) next.delete(group);
|
|
104
|
+
else next.add(group);
|
|
105
|
+
}
|
|
106
|
+
return {shown: next};
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
addSet() {
|
|
110
|
+
const name = this.state.setName.trim();
|
|
111
|
+
if (!name) return;
|
|
112
|
+
const taken = new Set([...this.props.sets, ...this.state.addedSets].map(set => set.id));
|
|
113
|
+
let id = name.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '') || 'set';
|
|
114
|
+
for (let index = 2; taken.has(id); index++) id = `${id.replace(/-\d+$/, '')}-${index}`;
|
|
115
|
+
const groups = [...this.standard(), ...this.props.extensions.map(extension => extension.id)]
|
|
116
|
+
.filter(group => this.state.shown.has(group));
|
|
117
|
+
this.setState(({addedSets}) => ({addedSets: [...addedSets, {id, name, groups}], naming: false, setName: ''}));
|
|
118
|
+
}
|
|
119
|
+
apply() {
|
|
120
|
+
const order = [...this.standard(), ...this.props.extensions.map(extension => extension.id)];
|
|
121
|
+
this.props.onApply({groups: order.filter(group => this.state.shown.has(group)), addedSets: this.state.addedSets});
|
|
122
|
+
}
|
|
123
|
+
render() {
|
|
124
|
+
const {locale, targetName, isStage, used, extensions, onCancel} = this.props;
|
|
125
|
+
const {shown, naming, setName} = this.state;
|
|
126
|
+
const text = this.text;
|
|
127
|
+
const names = isJapanese(locale) ? standardNames.ja : standardNames.en;
|
|
128
|
+
const sets = [...this.props.sets, ...this.state.addedSets];
|
|
129
|
+
const hiddenInUse = [...used].filter(([group, count]) => count > 0 && !shown.has(group)).length;
|
|
130
|
+
const usedBadge = (group: string) => !shown.has(group) && (used.get(group) ?? 0) > 0 && (
|
|
131
|
+
<span className="tw-palette-visibility-used">{text.used(used.get(group)!)}</span>
|
|
132
|
+
);
|
|
133
|
+
return (
|
|
134
|
+
<div className="tw-palette-visibility">
|
|
135
|
+
<header className="tw-palette-visibility-header">
|
|
136
|
+
<div>
|
|
137
|
+
<h2>{text.title}</h2>
|
|
138
|
+
<p>{isStage ? text.stage : text.sprite(targetName)}</p>
|
|
139
|
+
</div>
|
|
140
|
+
<button type="button" className="tw-palette-visibility-close" aria-label={text.close} title={text.close}
|
|
141
|
+
onClick={onCancel}>×</button>
|
|
142
|
+
</header>
|
|
143
|
+
<section aria-label={text.sets}>
|
|
144
|
+
<h3>{text.sets}</h3>
|
|
145
|
+
<div className="tw-palette-visibility-sets">
|
|
146
|
+
{sets.map(set => {
|
|
147
|
+
const groups = this.available(set.groups);
|
|
148
|
+
const all = groups.length > 0 && groups.every(group => shown.has(group));
|
|
149
|
+
return (
|
|
150
|
+
<button key={set.id} type="button" aria-pressed={all} data-set={set.id}
|
|
151
|
+
onClick={() => this.toggleSet(set)}>{set.name}{all ? ' ✓' : ''}</button>
|
|
152
|
+
);
|
|
153
|
+
})}
|
|
154
|
+
{naming ? (
|
|
155
|
+
<span className="tw-palette-visibility-naming">
|
|
156
|
+
<input type="text" aria-label={text.setName} placeholder={text.setName} value={setName}
|
|
157
|
+
autoFocus
|
|
158
|
+
onChange={event => this.setState({setName: event.currentTarget.value})}
|
|
159
|
+
onKeyDown={event => {if (event.key === 'Enter') this.addSet();}} />
|
|
160
|
+
<button type="button" onClick={() => this.addSet()}>{text.add}</button>
|
|
161
|
+
</span>
|
|
162
|
+
) : (
|
|
163
|
+
<button type="button" className="tw-palette-visibility-add-set"
|
|
164
|
+
onClick={() => this.setState({naming: true})}>+{text.addSet}</button>
|
|
165
|
+
)}
|
|
166
|
+
</div>
|
|
167
|
+
</section>
|
|
168
|
+
<section aria-label={text.standard}>
|
|
169
|
+
<h3>{text.standard}</h3>
|
|
170
|
+
<div className="tw-palette-visibility-standard">
|
|
171
|
+
{this.standard().map(group => (
|
|
172
|
+
<label key={group} data-group={group}>
|
|
173
|
+
<input type="checkbox" checked={shown.has(group)} onChange={() => this.toggle(group)} />
|
|
174
|
+
<span className="tw-palette-visibility-swatch" style={{color: standardColors[group]}}
|
|
175
|
+
aria-hidden="true">●</span>
|
|
176
|
+
{names[group]}
|
|
177
|
+
{usedBadge(group)}
|
|
178
|
+
</label>
|
|
179
|
+
))}
|
|
180
|
+
</div>
|
|
181
|
+
</section>
|
|
182
|
+
{extensions.length > 0 && (
|
|
183
|
+
<section aria-label={text.extensions}>
|
|
184
|
+
<h3>{text.extensions}</h3>
|
|
185
|
+
<div className="twextsec-review">
|
|
186
|
+
<ul className="twextsec-rows">
|
|
187
|
+
{extensions.map(extension => (
|
|
188
|
+
<ExtensionRow
|
|
189
|
+
key={extension.id}
|
|
190
|
+
metadata={extension.metadata}
|
|
191
|
+
ids={[extension.id]}
|
|
192
|
+
locale={locale}
|
|
193
|
+
itemProps={{'data-group': extension.id}}
|
|
194
|
+
pick={{checked: shown.has(extension.id), onToggle: () => this.toggle(extension.id)}}
|
|
195
|
+
>
|
|
196
|
+
{usedBadge(extension.id)}
|
|
197
|
+
</ExtensionRow>
|
|
198
|
+
))}
|
|
199
|
+
</ul>
|
|
200
|
+
</div>
|
|
201
|
+
</section>
|
|
202
|
+
)}
|
|
203
|
+
<footer className="tw-palette-visibility-footer">
|
|
204
|
+
<span role="status">{hiddenInUse > 0 ? text.hiddenInUse(hiddenInUse) : ''}</span>
|
|
205
|
+
<span>
|
|
206
|
+
<button type="button" onClick={onCancel}>{text.cancel}</button>
|
|
207
|
+
<button type="button" className="tw-palette-visibility-apply" onClick={() => this.apply()}>
|
|
208
|
+
{text.apply}
|
|
209
|
+
</button>
|
|
210
|
+
</span>
|
|
211
|
+
</footer>
|
|
212
|
+
</div>
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/** Opens the screen as a modal `<dialog>` in `document`. Returns the function that closes it. */
|
|
218
|
+
export function openPaletteVisibilityDialog(document: Document, props: PaletteVisibilityDialogProps): () => void {
|
|
219
|
+
const dialog = document.createElement('dialog');
|
|
220
|
+
dialog.className = 'tw-palette-visibility-dialog';
|
|
221
|
+
dialog.setAttribute('aria-label', (isJapanese(props.locale) ? messages.ja : messages.en).title);
|
|
222
|
+
document.body.append(dialog);
|
|
223
|
+
let open = true;
|
|
224
|
+
const close = () => {
|
|
225
|
+
if (!open) return;
|
|
226
|
+
open = false;
|
|
227
|
+
ReactDOM.unmountComponentAtNode(dialog);
|
|
228
|
+
if (dialog.open && typeof dialog.close === 'function') dialog.close();
|
|
229
|
+
dialog.remove();
|
|
230
|
+
};
|
|
231
|
+
dialog.addEventListener('cancel', event => {
|
|
232
|
+
event.preventDefault();
|
|
233
|
+
props.onCancel();
|
|
234
|
+
close();
|
|
235
|
+
});
|
|
236
|
+
ReactDOM.render(React.createElement(PaletteVisibilityDialog, {
|
|
237
|
+
...props,
|
|
238
|
+
onApply: choice => {
|
|
239
|
+
close();
|
|
240
|
+
props.onApply(choice);
|
|
241
|
+
},
|
|
242
|
+
onCancel: () => {
|
|
243
|
+
close();
|
|
244
|
+
props.onCancel();
|
|
245
|
+
}
|
|
246
|
+
}), dialog);
|
|
247
|
+
if (typeof dialog.showModal === 'function') dialog.showModal();
|
|
248
|
+
else dialog.setAttribute('open', '');
|
|
249
|
+
return close;
|
|
250
|
+
}
|
package/src/styles.css
CHANGED
|
@@ -593,3 +593,200 @@
|
|
|
593
593
|
[data-tw-plus-hidden] {
|
|
594
594
|
display: none !important;
|
|
595
595
|
}
|
|
596
|
+
|
|
597
|
+
/* Which block groups the palette shows for one sprite or the stage. */
|
|
598
|
+
.tw-palette-visibility-dialog {
|
|
599
|
+
box-sizing: border-box;
|
|
600
|
+
width: min(36rem, calc(100% - 2rem));
|
|
601
|
+
max-height: calc(100% - 2rem);
|
|
602
|
+
padding: 0;
|
|
603
|
+
border: 1px solid var(--ui-black-transparent, #80808070);
|
|
604
|
+
border-radius: 0.75rem;
|
|
605
|
+
background: var(--ui-primary, Canvas);
|
|
606
|
+
color: var(--text-primary, CanvasText);
|
|
607
|
+
font: 0.9rem/1.4 system-ui, sans-serif;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
.tw-palette-visibility-dialog::backdrop {
|
|
611
|
+
background: #17212a80;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
.tw-palette-visibility {
|
|
615
|
+
display: flex;
|
|
616
|
+
flex-direction: column;
|
|
617
|
+
max-height: calc(100vh - 4rem);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
.tw-palette-visibility > header,
|
|
621
|
+
.tw-palette-visibility > section,
|
|
622
|
+
.tw-palette-visibility > footer {
|
|
623
|
+
padding: 0.75rem 1rem;
|
|
624
|
+
border-bottom: 1px solid var(--ui-black-transparent, #80808040);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
.tw-palette-visibility > section:last-of-type {
|
|
628
|
+
overflow: auto;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
.tw-palette-visibility-header {
|
|
632
|
+
display: flex;
|
|
633
|
+
align-items: flex-start;
|
|
634
|
+
justify-content: space-between;
|
|
635
|
+
gap: 0.75rem;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
.tw-palette-visibility-header h2 {
|
|
639
|
+
margin: 0;
|
|
640
|
+
font-size: 1rem;
|
|
641
|
+
font-weight: 500;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
.tw-palette-visibility-header p,
|
|
645
|
+
.tw-palette-visibility h3 {
|
|
646
|
+
margin: 0;
|
|
647
|
+
font-size: 0.8rem;
|
|
648
|
+
font-weight: 400;
|
|
649
|
+
opacity: 0.75;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
.tw-palette-visibility h3 {
|
|
653
|
+
margin-bottom: 0.5rem;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
.tw-palette-visibility button,
|
|
657
|
+
.tw-palette-visibility input[type="text"] {
|
|
658
|
+
padding: 0.3rem 0.6rem;
|
|
659
|
+
border: 1px solid var(--ui-black-transparent, #80808070);
|
|
660
|
+
border-radius: 0.35rem;
|
|
661
|
+
background: var(--ui-primary, Canvas);
|
|
662
|
+
color: inherit;
|
|
663
|
+
font: inherit;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
.tw-palette-visibility-close {
|
|
667
|
+
border: none !important;
|
|
668
|
+
font-size: 1.1rem !important;
|
|
669
|
+
line-height: 1;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
.tw-palette-visibility-sets {
|
|
673
|
+
display: flex;
|
|
674
|
+
flex-wrap: wrap;
|
|
675
|
+
gap: 0.4rem;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
.tw-palette-visibility-sets button[aria-pressed="true"] {
|
|
679
|
+
border-color: var(--looks-secondary, #7951d1);
|
|
680
|
+
color: var(--looks-secondary, #7951d1);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
.tw-palette-visibility-add-set {
|
|
684
|
+
border-style: dashed !important;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
.tw-palette-visibility-naming {
|
|
688
|
+
display: inline-flex;
|
|
689
|
+
gap: 0.4rem;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
.tw-palette-visibility-standard {
|
|
693
|
+
display: grid;
|
|
694
|
+
grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
|
|
695
|
+
gap: 0.35rem 0.75rem;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
.tw-palette-visibility-standard label {
|
|
699
|
+
display: flex;
|
|
700
|
+
align-items: center;
|
|
701
|
+
gap: 0.35rem;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
.tw-palette-visibility-used {
|
|
705
|
+
font-size: 0.75rem;
|
|
706
|
+
color: var(--ui-warning, #b45309);
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
.tw-palette-visibility .twextsec-rows {
|
|
710
|
+
margin: 0;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.tw-palette-visibility-footer {
|
|
714
|
+
display: flex;
|
|
715
|
+
align-items: center;
|
|
716
|
+
justify-content: space-between;
|
|
717
|
+
gap: 0.5rem;
|
|
718
|
+
border-bottom: none !important;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.tw-palette-visibility-footer > span:last-child {
|
|
722
|
+
display: flex;
|
|
723
|
+
gap: 0.5rem;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.tw-palette-visibility-apply {
|
|
727
|
+
background: var(--looks-secondary, #7951d1) !important;
|
|
728
|
+
color: white !important;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
/* The ▼ button at the end of the category menu, and the menu it opens. */
|
|
732
|
+
.tw-palette-menu-button {
|
|
733
|
+
display: inline-flex;
|
|
734
|
+
flex: none;
|
|
735
|
+
align-items: center;
|
|
736
|
+
justify-content: center;
|
|
737
|
+
width: 1.75rem;
|
|
738
|
+
height: 1.75rem;
|
|
739
|
+
margin: auto 0.25rem;
|
|
740
|
+
padding: 0;
|
|
741
|
+
border: none;
|
|
742
|
+
border-radius: 0.35rem;
|
|
743
|
+
background: transparent;
|
|
744
|
+
color: inherit;
|
|
745
|
+
font-size: 0.75rem;
|
|
746
|
+
opacity: 0.7;
|
|
747
|
+
cursor: pointer;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
.tw-palette-menu-button:hover,
|
|
751
|
+
.tw-palette-menu-button:focus-visible,
|
|
752
|
+
.tw-palette-menu-button[aria-expanded="true"] {
|
|
753
|
+
opacity: 1;
|
|
754
|
+
background: color-mix(in srgb, currentColor 12%, transparent);
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
.tw-palette-menu {
|
|
758
|
+
z-index: 1000;
|
|
759
|
+
display: flex;
|
|
760
|
+
flex-direction: column;
|
|
761
|
+
min-width: 14rem;
|
|
762
|
+
padding: 0.25rem;
|
|
763
|
+
border: 1px solid var(--ui-black-transparent, #80808070);
|
|
764
|
+
border-radius: 0.5rem;
|
|
765
|
+
background: var(--ui-primary, Canvas);
|
|
766
|
+
color: var(--text-primary, CanvasText);
|
|
767
|
+
font: 0.85rem/1.4 system-ui, sans-serif;
|
|
768
|
+
box-shadow: 0 4px 12px #0000002e;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
.tw-palette-menu [role="menuitem"] {
|
|
772
|
+
padding: 0.4rem 0.6rem;
|
|
773
|
+
border: none;
|
|
774
|
+
border-radius: 0.35rem;
|
|
775
|
+
background: transparent;
|
|
776
|
+
color: inherit;
|
|
777
|
+
font: inherit;
|
|
778
|
+
text-align: left;
|
|
779
|
+
cursor: pointer;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
.tw-palette-menu [role="menuitem"]:hover,
|
|
783
|
+
.tw-palette-menu [role="menuitem"]:focus-visible {
|
|
784
|
+
background: color-mix(in srgb, currentColor 10%, transparent);
|
|
785
|
+
outline: none;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
.tw-palette-menu [role="separator"] {
|
|
789
|
+
height: 1px;
|
|
790
|
+
margin: 0.25rem 0;
|
|
791
|
+
background: var(--ui-black-transparent, #80808040);
|
|
792
|
+
}
|