@kubohiroya/turbowarp-plus-editor-layout 0.1.15 → 0.1.16
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.
|
@@ -51,7 +51,7 @@ function SearchBox({ viewId, section, japanese, search }) {
|
|
|
51
51
|
}
|
|
52
52
|
export function SpriteEditorToolbar({ viewId, locale, section, onSectionChange, isStage, activeGroup, search, availableSections = spriteEditorSections, propertiesInVariables = false, actions }) {
|
|
53
53
|
const japanese = /^ja(?:-|$)/i.test(locale);
|
|
54
|
-
const labels = japanese ? { code: 'コード', costumes: isStage ? '背景' : 'コスチューム', sounds: '音', variables: propertiesInVariables ? '
|
|
54
|
+
const labels = japanese ? { code: 'コード', costumes: isStage ? '背景' : 'コスチューム', sounds: '音', variables: propertiesInVariables ? '変数など' : '変数' } :
|
|
55
55
|
{ code: 'Code', costumes: isStage ? 'Backdrops' : 'Costumes', sounds: 'Sounds', variables: propertiesInVariables ? 'Properties & Variables' : 'Variables' };
|
|
56
56
|
return React.createElement("div", { className: "tw-plus-sprite-toolbar", "data-active-group": activeGroup },
|
|
57
57
|
React.createElement("div", { className: "tw-plus-sprite-toolbar-sections", role: "tablist", "aria-label": japanese ? 'スプライトの編集内容' : 'Sprite editor sections' }, availableSections.map((id, index) => React.createElement("button", { key: id, type: "button", role: "tab", id: viewId + '-section-' + id, "aria-selected": section === id, tabIndex: section === id ? 0 : -1, "aria-controls": viewId + '-content', onClick: () => onSectionChange(id), onKeyDown: event => {
|
|
@@ -67,6 +67,7 @@ export function SpriteEditorToolbar({ viewId, locale, section, onSectionChange,
|
|
|
67
67
|
} },
|
|
68
68
|
React.createElement(Icon, { kind: id }),
|
|
69
69
|
labels[id]))),
|
|
70
|
-
search && React.createElement(
|
|
71
|
-
|
|
70
|
+
(search || actions) && React.createElement("div", { className: "tw-plus-sprite-toolbar-tools" },
|
|
71
|
+
actions,
|
|
72
|
+
search && React.createElement(SearchBox, { viewId, section, japanese, search })));
|
|
72
73
|
}
|
package/dist/standard-layout.js
CHANGED
|
@@ -260,7 +260,7 @@ export function createStandardLayout(React, { styles, targetStyles, context, Lay
|
|
|
260
260
|
const { plusLayout, locale } = useContext(context);
|
|
261
261
|
const [expanded, setExpanded] = useState(false);
|
|
262
262
|
const tools = useContext(targetTools);
|
|
263
|
-
return plusLayout ? element('div', { className: styles.spriteProperties }, inEditor ? element('span',
|
|
263
|
+
return plusLayout ? element('div', { className: styles.spriteProperties }, inEditor ? element('span', { className: styles.spritePropertiesTitle }, isJapanese(locale) ? 'スプライト' : 'Sprite') :
|
|
264
264
|
element('button', {
|
|
265
265
|
type: 'button', className: styles.spritePropertiesToggle, 'aria-expanded': expanded,
|
|
266
266
|
onClick: () => setExpanded(open => !open)
|
package/package.json
CHANGED
package/src/editor.css
CHANGED
|
@@ -429,11 +429,15 @@ details.layout-menu button {
|
|
|
429
429
|
background: transparent;
|
|
430
430
|
color: inherit;
|
|
431
431
|
font: inherit;
|
|
432
|
-
font-size: 0.875rem;
|
|
433
432
|
text-align: start;
|
|
434
433
|
cursor: pointer;
|
|
435
434
|
}
|
|
436
435
|
|
|
436
|
+
.sprite-properties-title,
|
|
437
|
+
.sprite-properties-toggle {
|
|
438
|
+
font-size: 0.875rem;
|
|
439
|
+
}
|
|
440
|
+
|
|
437
441
|
.sprite-properties-content {
|
|
438
442
|
min-block-size: 0;
|
|
439
443
|
overflow: auto;
|
|
@@ -58,11 +58,18 @@
|
|
|
58
58
|
|
|
59
59
|
.tw-plus-sprite-toolbar svg { width: 16px; height: 16px; flex: none; }
|
|
60
60
|
|
|
61
|
+
.tw-plus-sprite-toolbar-tools {
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: 8px;
|
|
65
|
+
min-inline-size: 0;
|
|
66
|
+
margin-inline-start: auto;
|
|
67
|
+
}
|
|
68
|
+
|
|
61
69
|
.tw-plus-sprite-search {
|
|
62
70
|
position: relative;
|
|
63
|
-
|
|
64
|
-
min-
|
|
65
|
-
margin-inline-start: auto;
|
|
71
|
+
inline-size: 132px;
|
|
72
|
+
min-inline-size: 0;
|
|
66
73
|
}
|
|
67
74
|
|
|
68
75
|
.tw-plus-sprite-search-field { position: relative; }
|
|
@@ -98,7 +98,7 @@ function SearchBox({viewId, section, japanese, search}: {
|
|
|
98
98
|
export function SpriteEditorToolbar({viewId, locale, section, onSectionChange, isStage, activeGroup, search,
|
|
99
99
|
availableSections = spriteEditorSections, propertiesInVariables = false, actions}: SpriteEditorToolbarProps) {
|
|
100
100
|
const japanese = /^ja(?:-|$)/i.test(locale);
|
|
101
|
-
const labels = japanese ? {code: 'コード', costumes: isStage ? '背景' : 'コスチューム', sounds: '音', variables: propertiesInVariables ? '
|
|
101
|
+
const labels = japanese ? {code: 'コード', costumes: isStage ? '背景' : 'コスチューム', sounds: '音', variables: propertiesInVariables ? '変数など' : '変数'} :
|
|
102
102
|
{code: 'Code', costumes: isStage ? 'Backdrops' : 'Costumes', sounds: 'Sounds', variables: propertiesInVariables ? 'Properties & Variables' : 'Variables'};
|
|
103
103
|
return <div className="tw-plus-sprite-toolbar" data-active-group={activeGroup}>
|
|
104
104
|
<div className="tw-plus-sprite-toolbar-sections" role="tablist"
|
|
@@ -119,7 +119,9 @@ export function SpriteEditorToolbar({viewId, locale, section, onSectionChange, i
|
|
|
119
119
|
{labels[id]}
|
|
120
120
|
</button>)}
|
|
121
121
|
</div>
|
|
122
|
-
{search && <
|
|
123
|
-
|
|
122
|
+
{(search || actions) && <div className="tw-plus-sprite-toolbar-tools">
|
|
123
|
+
{actions}
|
|
124
|
+
{search && <SearchBox {...{viewId, section, japanese, search}} />}
|
|
125
|
+
</div>}
|
|
124
126
|
</div>;
|
|
125
127
|
}
|
package/src/standard-layout.ts
CHANGED
|
@@ -280,7 +280,7 @@ export function createStandardLayout(React, {styles, targetStyles, context, Layo
|
|
|
280
280
|
const [expanded, setExpanded] = useState(false);
|
|
281
281
|
const tools = useContext(targetTools);
|
|
282
282
|
return plusLayout ? element('div', {className: styles.spriteProperties},
|
|
283
|
-
inEditor ? element('span',
|
|
283
|
+
inEditor ? element('span', {className: styles.spritePropertiesTitle}, isJapanese(locale) ? 'スプライト' : 'Sprite') :
|
|
284
284
|
element('button', {
|
|
285
285
|
type: 'button', className: styles.spritePropertiesToggle, 'aria-expanded': expanded,
|
|
286
286
|
onClick: () => setExpanded(open => !open)
|