@kubohiroya/turbowarp-plus-editor-layout 0.1.14 → 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(SearchBox, { viewId, section, japanese, search }),
71
- actions);
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
  }
@@ -11,6 +11,7 @@ interface StageWindowHost<Request, Target> {
11
11
  export declare function createStagePopoutHost<Request, Target extends {
12
12
  mount: HTMLElement;
13
13
  }>(host: StageWindowHost<Request, Target>, title: string): StageWindowHost<Request, Target>;
14
+ export declare function stageFullscreenLabel(locale: string, fallback: string): string;
14
15
  export declare function stageDockActionLabel(locale: string, { drawer, detached, external }: {
15
16
  drawer?: boolean;
16
17
  detached: boolean;
@@ -50,6 +50,9 @@ export function createStagePopoutHost(host, title) {
50
50
  };
51
51
  }
52
52
  const isJapanese = (locale) => /^ja(?:-|$)/i.test(locale);
53
+ export function stageFullscreenLabel(locale, fallback) {
54
+ return isJapanese(locale) ? 'ステージを全画面表示にする' : fallback;
55
+ }
53
56
  export function stageDockActionLabel(locale, { drawer, detached, external }) {
54
57
  const japanese = isJapanese(locale);
55
58
  if (detached)
@@ -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', null, isJapanese(locale) ? 'スプライト' : 'Sprite') :
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubohiroya/turbowarp-plus-editor-layout",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "Resizable panes and layout for TurboWarp Plus Editor",
5
5
  "type": "module",
6
6
  "license": "GPL-3.0-or-later",
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
- flex: 0 1 132px;
64
- min-width: 0;
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 && <SearchBox {...{viewId, section, japanese, search}} />}
123
- {actions}
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
  }
@@ -65,6 +65,10 @@ export function createStagePopoutHost<Request, Target extends {mount: HTMLElemen
65
65
 
66
66
  const isJapanese = (locale: string) => /^ja(?:-|$)/i.test(locale);
67
67
 
68
+ export function stageFullscreenLabel(locale: string, fallback: string) {
69
+ return isJapanese(locale) ? 'ステージを全画面表示にする' : fallback;
70
+ }
71
+
68
72
  export function stageDockActionLabel(locale: string, {drawer, detached, external}: {
69
73
  drawer?: boolean;
70
74
  detached: boolean;
@@ -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', null, isJapanese(locale) ? 'スプライト' : 'Sprite') :
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)