@operato/context 10.29.69 → 10.29.71

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/CHANGELOG.md CHANGED
@@ -3,6 +3,23 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ### [10.29.71](https://github.com/hatiolab/operato/compare/v10.29.70...v10.29.71) (2026-11-08)
7
+
8
+
9
+ ### :rocket: New Features
10
+
11
+ * **context:** one action contract for the bar and its overflow; the bar fits its room ([1e3d250](https://github.com/hatiolab/operato/commit/1e3d2508a1bb0a525aab3e9193771ba50908e0fb))
12
+
13
+
14
+
15
+ ### [10.29.70](https://github.com/hatiolab/operato/compare/v10.29.69...v10.29.70) (2026-11-07)
16
+
17
+ **Note:** Version bump only for package @operato/context
18
+
19
+
20
+
21
+
22
+
6
23
  ### [10.29.69](https://github.com/hatiolab/operato/compare/v10.29.68...v10.29.69) (2026-11-07)
7
24
 
8
25
  **Note:** Version bump only for package @operato/context
@@ -1 +1,3 @@
1
1
  export * from './styles/ox-context-toolbar-overlay-style.js';
2
+ export * from './tools/page-action.js';
3
+ export { renderPageAction, PageActionStyles } from './tools/page-action-render.js';
package/dist/src/index.js CHANGED
@@ -1,2 +1,4 @@
1
1
  export * from './styles/ox-context-toolbar-overlay-style.js';
2
+ export * from './tools/page-action.js';
3
+ export { renderPageAction, PageActionStyles } from './tools/page-action-render.js';
2
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8CAA8C,CAAA","sourcesContent":["export * from './styles/ox-context-toolbar-overlay-style.js'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8CAA8C,CAAA;AAC5D,cAAc,wBAAwB,CAAA;AACtC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA","sourcesContent":["export * from './styles/ox-context-toolbar-overlay-style.js'\nexport * from './tools/page-action.js'\nexport { renderPageAction, PageActionStyles } from './tools/page-action-render.js'\n"]}
@@ -1,30 +1,35 @@
1
1
  import '@material/web/icon/icon.js';
2
2
  import './ox-page-action-overlay-template.js';
3
3
  import { LitElement, nothing, PropertyValues } from 'lit';
4
+ import { PageAction } from './page-action.js';
4
5
  export declare class PageActionContextBar extends LitElement {
5
6
  static get styles(): import("lit").CSSResult[];
6
7
  private _route;
7
- actions: {
8
- title: string;
9
- action: () => void;
10
- icon: string;
11
- type: string;
12
- select: string[];
13
- href?: string;
14
- emphasis?: boolean;
15
- }[];
8
+ actions: PageAction[];
16
9
  private overflown;
17
10
  container?: HTMLDivElement;
18
- private overflownUpdaterThrottle;
19
- private resizeCallback;
20
- get overflownUpdater(): any;
11
+ private layoutFrame;
12
+ private resizeObserver?;
13
+ private observedParent?;
14
+ private onRunnerChange;
15
+ private onWindowResize;
21
16
  connectedCallback(): void;
22
17
  disconnectedCallback(): void;
23
18
  render(): import("lit-html").TemplateResult<1> | typeof nothing;
24
19
  renderActions(): import("lit-html").TemplateResult<1>;
25
20
  updated(changed: PropertyValues<this>): Promise<void>;
26
- /** Marks the actions that end past the room left of 「더보기」 (or past the bar, when nothing overflows). */
27
- private markOverflowed;
21
+ private scheduleLayout;
22
+ /**
23
+ * The width the bar may take: what its parent holds less the other things beside it. The bar's own width follows its
24
+ * content, so it cannot tell the room it is given (2026-11-08: 650px of actions in a 403px toolbar measured as fitting).
25
+ */
26
+ private availableWidth;
27
+ /**
28
+ * Lays out what fits. Every action is first measured at its natural width; when they all fit, nothing is hidden.
29
+ * Otherwise 「더보기」 takes the right end, the main action is always kept, and the others are kept from the right
30
+ * (next to the main action) while they fit; the rest are listed only behind 「더보기」.
31
+ */
32
+ layoutActions(): void;
28
33
  protected willUpdate(): void;
29
34
  showMore(): void;
30
35
  }
@@ -3,27 +3,39 @@ import '@material/web/icon/icon.js';
3
3
  import './ox-page-action-overlay-template.js';
4
4
  import { css, html, LitElement, nothing } from 'lit';
5
5
  import { customElement, property, query, state } from 'lit/decorators.js';
6
- import throttle from 'lodash-es/throttle.js';
7
6
  import { i18next } from '@operato/i18n';
8
7
  import { openOverlay } from '@operato/layout';
9
8
  import { RouteController } from '@operato/shell';
10
- import { sleep } from '@operato/utils';
11
9
  import { ButtonContainerStyles } from '@operato/styles';
12
10
  import { formElementHeight } from '@operato/styles/form-element-heights.js';
11
+ import { arrangePageActions, pageActionRunner } from './page-action.js';
12
+ import { PageActionStyles, renderPageAction } from './page-action-render.js';
13
+ /** The width 「더보기」 takes at the bar's right end - its icon (2rem) and padding (10px each side). */
14
+ const MORE_WIDTH = 52;
13
15
  let PageActionContextBar = class PageActionContextBar extends LitElement {
14
16
  constructor() {
15
17
  super(...arguments);
16
18
  this._route = new RouteController(this);
17
19
  this.actions = [];
18
20
  this.overflown = false;
21
+ this.layoutFrame = 0;
22
+ this.onRunnerChange = () => this.requestUpdate();
23
+ this.onWindowResize = () => this.scheduleLayout();
19
24
  }
20
25
  static get styles() {
21
26
  return [
22
27
  ButtonContainerStyles,
28
+ PageActionStyles,
23
29
  css `
24
30
  :host {
25
31
  display: flex;
26
32
  position: relative;
33
+ /*
34
+ * The bar shrinks to the room its parent gives - without this its content width wins (min-width: auto of a
35
+ * flex item that clips) and the actions are pushed out of the toolbar's left edge.
36
+ */
37
+ min-width: 0;
38
+ max-width: 100%;
27
39
  overflow-x: clip;
28
40
  overflow-y: hidden;
29
41
 
@@ -99,11 +111,38 @@ let PageActionContextBar = class PageActionContextBar extends LitElement {
99
111
 
100
112
  /*
101
113
  * An action that does not fit whole is not drawn - half a button under 「더보기」 reads as a broken one
102
- * (2026-11-05, a phone: 「게시 취소」 cut in two by the button). It keeps its place, so the width that
103
- * decides 「더보기」 stays the same, and the overlay behind 「더보기」 lists every action.
114
+ * (2026-11-05, a phone: 「게시 취소」 cut in two by the button). The overlay behind 「더보기」 lists every
115
+ * action. Which ones are kept is measured at their natural widths (layoutActions), so hiding one does not
116
+ * change the decision.
104
117
  */
105
118
  [container] > [overflowed] {
106
- visibility: hidden;
119
+ display: none;
120
+ }
121
+
122
+ [container] > * {
123
+ flex: none;
124
+ }
125
+
126
+ /* The main action is always kept; on the narrowest bar it gives up width before it gives up its place. */
127
+ [container] > [raised] {
128
+ flex: 0 1 auto;
129
+ min-width: 2.5rem;
130
+ overflow: hidden;
131
+ }
132
+
133
+ /* Destructive actions stand apart from the rest (arranged first, configurePageActions). */
134
+ [container] > [danger] + :not([danger]) {
135
+ margin-left: var(--spacing-medium);
136
+ }
137
+
138
+ :host([overflown]) [container] {
139
+ padding-right: var(--context-action-bar-more-width, 52px);
140
+ }
141
+
142
+ [more] {
143
+ box-sizing: border-box;
144
+ width: var(--context-action-bar-more-width, 52px);
145
+ text-align: center;
107
146
  }
108
147
 
109
148
  select,
@@ -118,10 +157,6 @@ let PageActionContextBar = class PageActionContextBar extends LitElement {
118
157
  font-size: var(--md-sys-typescale-label-large-size, 0.875rem);
119
158
  }
120
159
 
121
- md-icon[working] {
122
- animation: rotate 1s linear infinite;
123
- }
124
-
125
160
  @media screen and (max-width: 460px) {
126
161
  [container] {
127
162
  padding: 0;
@@ -149,32 +184,27 @@ let PageActionContextBar = class PageActionContextBar extends LitElement {
149
184
  `
150
185
  ];
151
186
  }
152
- get overflownUpdater() {
153
- if (!this.overflownUpdaterThrottle) {
154
- this.overflownUpdaterThrottle = throttle(() => {
155
- this.overflown = !!this.container && this.container.scrollWidth > this.container.clientWidth;
156
- this.markOverflowed();
157
- }, 100);
158
- }
159
- return this.overflownUpdaterThrottle;
160
- }
161
187
  connectedCallback() {
162
188
  super.connectedCallback();
163
- this.resizeCallback = () => this.overflownUpdater();
164
- window.addEventListener('resize', this.resizeCallback);
189
+ window.addEventListener('resize', this.onWindowResize);
190
+ pageActionRunner.addEventListener('change', this.onRunnerChange);
191
+ this.resizeObserver = new ResizeObserver(() => this.scheduleLayout());
165
192
  }
166
193
  disconnectedCallback() {
194
+ var _a;
167
195
  super.disconnectedCallback();
168
- window.removeEventListener('resize', this.resizeCallback);
196
+ window.removeEventListener('resize', this.onWindowResize);
197
+ pageActionRunner.removeEventListener('change', this.onRunnerChange);
198
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
199
+ this.observedParent = undefined;
200
+ cancelAnimationFrame(this.layoutFrame);
169
201
  }
170
202
  render() {
171
203
  return this.actions.length > 0
172
204
  ? html `
173
205
  <div container>${this.renderActions()}</div>
174
206
  <!--
175
- 넘친 동작들에 닿는 **유일한 길**이다. 그런데 이름이 없어 낭독기는 「more_horiz」를
176
- 읽었고, md-icon 이라 키보드 초점도 못 받았다 — 키보드만 쓰는 사람에게는 그 동작들이
177
- 아예 없는 것과 같았다.
207
+ 넘친 동작들에 닿는 **유일한 길**이다. 이름이 있어 낭독기가 읽고, 키보드 초점을 받는다.
178
208
  -->
179
209
  ${this.overflown
180
210
  ? html `
@@ -183,6 +213,7 @@ let PageActionContextBar = class PageActionContextBar extends LitElement {
183
213
  role="button"
184
214
  tabindex="0"
185
215
  title=${i18next.t('text.more-actions', { defaultValue: 'more actions' })}
216
+ aria-label=${i18next.t('text.more-actions', { defaultValue: 'more actions' })}
186
217
  @click=${this.showMore.bind(this)}
187
218
  @keydown=${(e) => {
188
219
  if (e.key !== 'Enter' && e.key !== ' ')
@@ -198,80 +229,80 @@ let PageActionContextBar = class PageActionContextBar extends LitElement {
198
229
  : nothing;
199
230
  }
200
231
  renderActions() {
201
- return html `
202
- ${this.actions.map(($action, idx) => {
203
- let { type, title, icon, action, select, href, emphasis, disabled, disabledTitle } = $action;
204
- let { raised, danger } = emphasis || {};
205
- return type == 'text'
206
- ? html ` <span @click=${action}>${title}</span> `
207
- : type == 'select' || (select && select.length > 0)
208
- ? html `
209
- <select @change=${action}>
210
- ${select.map((option) => html ` <option>${option}</option> `)}
211
- </select>
212
- `
213
- : type == 'link'
214
- ? html ` <a href=${href}>${title}</a> `
215
- : html `
216
- <button
217
- ?icon-only=${type == 'icon' || !title}
218
- ?raised=${raised}
219
- ?danger=${danger}
220
- ?disabled=${disabled}
221
- title=${disabled && disabledTitle ? disabledTitle : title || ''}
222
- @click=${async (e) => {
223
- /* all actions should be bloked for a second */
224
- const button = e.currentTarget;
225
- const iconElement = button.querySelector('md-icon');
226
- const actionConfig = this.actions[idx];
227
- if (iconElement) {
228
- icon = actionConfig.icon;
229
- actionConfig.icon = 'refresh';
230
- this.requestUpdate();
231
- iconElement.setAttribute('working', true);
232
- }
233
- button.disabled = true;
234
- try {
235
- await action();
236
- }
237
- finally {
238
- await sleep(1000); /* waiting for additionla 1 second */
239
- /* because icon can be changed after sleep, don't use closure 'icon'. */
240
- if (iconElement) {
241
- actionConfig.icon = icon;
242
- this.requestUpdate();
243
- iconElement.removeAttribute('working');
244
- }
245
- button.disabled = false;
246
- }
247
- }}
248
- >
249
- ${this.actions[idx].icon ? html `<md-icon>${this.actions[idx].icon}</md-icon>` : nothing}
250
- ${type == 'icon' || !title ? nothing : title}
251
- </button>
252
- `;
253
- })}
254
- `;
232
+ return html `${arrangePageActions(this.actions).map(({ action, role }) => renderPageAction(action, role))}`;
255
233
  }
256
234
  async updated(changed) {
257
- if (changed.has('actions')) {
258
- requestAnimationFrame(this.overflownUpdater);
259
- }
260
- /* 「더보기」 has just come or gone - the room it takes is now measurable. */
261
- if (changed.has('overflown')) {
262
- this.markOverflowed();
235
+ var _a, _b;
236
+ if (changed.has('actions'))
237
+ this.scheduleLayout();
238
+ const parent = this.parentElement;
239
+ if (parent !== this.observedParent) {
240
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
241
+ if (parent)
242
+ (_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.observe(parent);
243
+ this.observedParent = parent;
263
244
  }
264
245
  }
265
- /** Marks the actions that end past the room left of 「더보기」 (or past the bar, when nothing overflows). */
266
- markOverflowed() {
246
+ scheduleLayout() {
247
+ cancelAnimationFrame(this.layoutFrame);
248
+ this.layoutFrame = requestAnimationFrame(() => this.layoutActions());
249
+ }
250
+ /**
251
+ * The width the bar may take: what its parent holds less the other things beside it. The bar's own width follows its
252
+ * content, so it cannot tell the room it is given (2026-11-08: 650px of actions in a 403px toolbar measured as fitting).
253
+ */
254
+ availableWidth() {
255
+ const parent = this.parentElement;
256
+ if (!parent)
257
+ return this.getBoundingClientRect().width;
258
+ const style = getComputedStyle(parent);
259
+ const gap = parseFloat(style.columnGap) || 0;
260
+ const siblings = Array.from(parent.children).filter(child => child !== this && child.offsetParent !== null);
261
+ const taken = siblings.reduce((sum, child) => sum + child.getBoundingClientRect().width + gap, 0);
262
+ return parent.clientWidth - (parseFloat(style.paddingLeft) || 0) - (parseFloat(style.paddingRight) || 0) - taken;
263
+ }
264
+ /**
265
+ * Lays out what fits. Every action is first measured at its natural width; when they all fit, nothing is hidden.
266
+ * Otherwise 「더보기」 takes the right end, the main action is always kept, and the others are kept from the right
267
+ * (next to the main action) while they fit; the rest are listed only behind 「더보기」.
268
+ */
269
+ layoutActions() {
267
270
  const container = this.container;
268
271
  if (!container)
269
272
  return;
270
- const more = this.renderRoot.querySelector('[more]');
271
- const limit = (more !== null && more !== void 0 ? more : container).getBoundingClientRect()[more ? 'left' : 'right'] + 0.5;
272
- for (const child of Array.from(container.children)) {
273
- child.toggleAttribute('overflowed', this.overflown && child.getBoundingClientRect().right > limit);
273
+ const items = Array.from(container.children);
274
+ items.forEach(item => item.removeAttribute('overflowed'));
275
+ this.removeAttribute('overflown');
276
+ const style = getComputedStyle(container);
277
+ const gap = parseFloat(style.columnGap) || 0;
278
+ const padding = (parseFloat(style.paddingLeft) || 0) + (parseFloat(style.paddingRight) || 0);
279
+ const widths = items.map(item => item.getBoundingClientRect().width);
280
+ const natural = widths.reduce((sum, width) => sum + width, 0) + gap * Math.max(0, items.length - 1) + padding;
281
+ const available = this.availableWidth();
282
+ if (natural <= available + 0.5) {
283
+ this.overflown = false;
284
+ return;
285
+ }
286
+ const more = parseFloat(getComputedStyle(this).getPropertyValue('--context-action-bar-more-width')) || MORE_WIDTH;
287
+ let room = available - padding - more;
288
+ const keep = new Set();
289
+ items.forEach((item, at) => {
290
+ if (item.hasAttribute('raised')) {
291
+ keep.add(at);
292
+ room -= widths[at] + gap;
293
+ }
294
+ });
295
+ for (let at = items.length - 1; at >= 0; at--) {
296
+ if (keep.has(at))
297
+ continue;
298
+ if (widths[at] + gap > room)
299
+ break;
300
+ keep.add(at);
301
+ room -= widths[at] + gap;
274
302
  }
303
+ items.forEach((item, at) => item.toggleAttribute('overflowed', !keep.has(at)));
304
+ this.setAttribute('overflown', '');
305
+ this.overflown = true;
275
306
  }
276
307
  willUpdate() {
277
308
  const { actions, frame } = this._route.context || {};
@@ -1 +1 @@
1
- {"version":3,"file":"ox-page-action-context-bar.js","sourceRoot":"","sources":["../../../src/tools/ox-page-action-context-bar.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,sCAAsC,CAAA;AAE7C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,QAAQ,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAGpE,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,UAAU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A;QACpG,CAAC;IACH,CAAC;IAES,UAAU;QAClB,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAA;QACpD,2FAA2F;QAC3F,IAAI,KAAK;YAAE,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;;YAC/C,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAA;QAElC,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;QAC1D,CAAC;IACH,CAAC;IAED,QAAQ;QACN,WAAW,CAAC,yBAAyB,EAAE;YACrC,QAAQ,EAAE,IAAI,CAAA,qEAAqE;SACpF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAxK4B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;qDAQlB;AAES;IAAhB,KAAK,EAAE;uDAAmC;AACrB;IAArB,KAAK,CAAC,aAAa,CAAC;uDAA2B;AAnJrC,oBAAoB;IADhC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,oBAAoB,CAgThC","sourcesContent":["import '@material/web/icon/icon.js'\nimport './ox-page-action-overlay-template.js'\n\nimport { css, html, LitElement, nothing, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport throttle from 'lodash-es/throttle.js'\nimport { i18next } from '@operato/i18n'\nimport { openOverlay } from '@operato/layout'\nimport { RouteController } from '@operato/shell'\nimport { sleep } from '@operato/utils'\nimport { ButtonContainerStyles } from '@operato/styles'\nimport { formElementHeight } from '@operato/styles/form-element-heights.js'\n\n@customElement('ox-page-action-context-bar')\nexport class PageActionContextBar extends LitElement {\n static get styles() {\n return [\n ButtonContainerStyles,\n css`\n :host {\n display: flex;\n position: relative;\n overflow-x: clip;\n overflow-y: hidden;\n\n text-transform: capitalize;\n }\n\n /*\n * ── 키보드로 온 사람에게 지금 어디인지 보인다 ──────────────────────\n * 여기 있던 것은 :host *:focus { outline: none } 한 줄이다. 그런데 이 줄의 단추는 자기\n * 스타일에 이미 초점 표시를 갖고 있었다(ButtonContainerStyles 의 button &:focus-visible,\n * 2px). **그 한 줄이 그것을 이겼다** — :host *:focus 는 특정도 (0,2,0) 이고\n * button:focus-visible 은 (0,1,1) 이다. 그래서 선언은 있는데 화면에는 아무것도 안 그려졌다.\n *\n * [확인함] 2026-09-19 :3500 — 이 줄의 단추에 초점을 주고 재니 outline-style: none 이었다.\n * (그 재기는 :focus 까지만 확인한다. 키보드 초점은 합성으로 못 만든다.)\n *\n * 마우스로 누를 때 테두리가 남는 것이 싫어서 껐던 것은 맞다. 그 뜻은 :focus-visible 이\n * 정확히 낸다. 그래서 끄는 것은 **그 밖의 초점에만** 건다.\n *\n * 굵기는 3px 로 맞춘다 — Material 단추의 링이 3px 이고, 한 줄에 우리 단추와 md 단추가 함께\n * 서므로 두 표시가 같아야 한다.\n */\n :host *:focus:not(:focus-visible) {\n outline: none;\n }\n\n :host *:focus-visible {\n outline: 3px solid var(--md-sys-color-primary);\n outline-offset: 2px;\n }\n\n [container] {\n flex: 1;\n\n display: flex;\n overflow: hidden;\n gap: var(--spacing-small);\n /*\n * 초점 링이 설 자리 — 링은 단추 **밖으로 5px** 를 쓴다(3px 굵기 + 2px 띄움). 2px 이던 때는\n * 이 줄이 overflow: hidden 이라 위아래가 잘렸다. 가로로 자르는 것은 남겨 둔다 —\n * 「더보기」가 scrollWidth > clientWidth 로 넘침을 재는데 그 값이 살아 있어야 한다.\n */\n padding: 5px;\n align-items: center;\n }\n\n /*\n * The buttons end where the screen's content ends. A document screen used to stop at the\n * reading measure (1080px) and this bar followed it there through context.frame; since\n * 2026-10-05 every frame fills the window between two equal gutters (user decision, ADR in\n * operato-application/adr), so the bar spans the window like the content and no frame narrows it.\n * The frame attribute is still set — it says what the screen is — but nothing here reads it.\n */\n\n /*\n * 액션바 위에 떠 있는 오버플로 버튼 — 배경과 구분되도록 **테마와 무관하게 어두운 표면**을 유지한다.\n *\n * 이전에는 --md-sys-color-inverse-surface 를 썼는데, inverse-* 는 스펙상 \"현재 테마의 반대\"라\n * 라이트에서는 어둡지만 다크에서 밝게 반전되어 눈에 튀었다(ox-snack-bar 와 같은 부류).\n * 반투명 어두운 값을 기본으로 두면 브랜드 팔레트와 무관하게 안정적이고 .dark 패치도 불필요하다.\n */\n [more] {\n position: absolute;\n bottom: 0;\n right: 0;\n color: var(--ox-context-more-color, rgba(255, 255, 255, 0.95));\n background-color: var(--ox-context-more-background, rgba(0, 0, 0, 0.85));\n box-shadow: var(--ox-context-more-shadow, -2px 0px 2px 1px rgba(0, 0, 0, 0.2));\n padding: var(--context-action-bar-more-button-padding, 11px 10px);\n font-size: 2rem;\n z-index: 10;\n }\n\n /*\n * An action that does not fit whole is not drawn - half a button under 「더보기」 reads as a broken one\n * (2026-11-05, a phone: 「게시 취소」 cut in two by the button). It keeps its place, so the width that\n * decides 「더보기」 stays the same, and the overlay behind 「더보기」 lists every action.\n */\n [container] > [overflowed] {\n visibility: hidden;\n }\n\n select,\n input[type='text'] {\n box-sizing: border-box;\n padding: 0 var(--spacing-small);\n height: ${formElementHeight('--form-element-height-medium')};\n border: 1px solid var(--md-sys-color-outline);\n border-radius: var(--md-sys-shape-corner-small);\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-on-primary);\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n }\n\n md-icon[working] {\n animation: rotate 1s linear infinite;\n }\n\n @media screen and (max-width: 460px) {\n [container] {\n padding: 0;\n gap: 0;\n }\n\n /* 아주 좁은 화면 — 버튼을 붙여 한 덩어리로 만든다(사이 여백이 자리를 먹는다). */\n button {\n border-radius: 0;\n }\n\n button:not(:last-child) {\n border-right-width: 0;\n }\n }\n\n @keyframes rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n `\n ]\n }\n\n private _route = new RouteController(this)\n\n @property({ type: Array }) actions: {\n title: string\n action: () => void\n icon: string\n type: string\n select: string[]\n href?: string\n emphasis?: boolean\n }[] = []\n\n @state() private overflown: boolean = false\n @query('[container]') container?: HTMLDivElement\n\n private overflownUpdaterThrottle: any\n private resizeCallback: any\n\n get overflownUpdater() {\n if (!this.overflownUpdaterThrottle) {\n this.overflownUpdaterThrottle = throttle(() => {\n this.overflown = !!this.container && this.container.scrollWidth > this.container.clientWidth\n this.markOverflowed()\n }, 100)\n }\n\n return this.overflownUpdaterThrottle\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n this.resizeCallback = () => this.overflownUpdater()\n\n window.addEventListener('resize', this.resizeCallback)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n window.removeEventListener('resize', this.resizeCallback)\n }\n\n render() {\n return this.actions.length > 0\n ? html`\n <div container>${this.renderActions()}</div>\n <!--\n 넘친 동작들에 닿는 **유일한 길**이다. 그런데 이름이 없어 낭독기는 「more_horiz」를\n 읽었고, md-icon 이라 키보드 초점도 못 받았다 — 키보드만 쓰는 사람에게는 그 동작들이\n 아예 없는 것과 같았다.\n -->\n ${this.overflown\n ? html`\n <md-icon\n more\n role=\"button\"\n tabindex=\"0\"\n title=${i18next.t('text.more-actions', { defaultValue: 'more actions' })}\n @click=${this.showMore.bind(this)}\n @keydown=${(e: KeyboardEvent) => {\n if (e.key !== 'Enter' && e.key !== ' ') return\n e.preventDefault()\n this.showMore()\n }}\n >more_horiz</md-icon\n >\n `\n : html``}\n `\n : nothing\n }\n\n renderActions() {\n return html`\n ${this.actions.map(($action, idx) => {\n let { type, title, icon, action, select, href, emphasis, disabled, disabledTitle } = $action as any\n let { raised, danger } = emphasis || {}\n\n return type == 'text'\n ? html` <span @click=${action}>${title}</span> `\n : type == 'select' || (select && select.length > 0)\n ? html`\n <select @change=${action}>\n ${select.map((option: any) => html` <option>${option}</option> `)}\n </select>\n `\n : type == 'link'\n ? html` <a href=${href}>${title}</a> `\n : html`\n <button\n ?icon-only=${type == 'icon' || !title}\n ?raised=${raised}\n ?danger=${danger}\n ?disabled=${disabled}\n title=${disabled && disabledTitle ? disabledTitle : title || ''}\n @click=${async (e: MouseEvent) => {\n /* all actions should be bloked for a second */\n const button = e.currentTarget as any\n const iconElement = button.querySelector('md-icon')\n const actionConfig = this.actions[idx]\n\n if (iconElement) {\n icon = actionConfig.icon\n actionConfig.icon = 'refresh'\n this.requestUpdate()\n iconElement.setAttribute('working', true)\n }\n button.disabled = true\n\n try {\n await action()\n } finally {\n await sleep(1000) /* waiting for additionla 1 second */\n\n /* because icon can be changed after sleep, don't use closure 'icon'. */\n if (iconElement) {\n actionConfig.icon = icon\n this.requestUpdate()\n iconElement.removeAttribute('working')\n }\n button.disabled = false\n }\n }}\n >\n ${this.actions[idx].icon ? html`<md-icon>${this.actions[idx].icon}</md-icon>` : nothing}\n ${type == 'icon' || !title ? nothing : title}\n </button>\n `\n })}\n `\n }\n\n async updated(changed: PropertyValues<this>) {\n if (changed.has('actions')) {\n requestAnimationFrame(this.overflownUpdater)\n }\n /* 「더보기」 has just come or gone - the room it takes is now measurable. */\n if ((changed as Map<PropertyKey, unknown>).has('overflown')) {\n this.markOverflowed()\n }\n }\n\n /** Marks the actions that end past the room left of 「더보기」 (or past the bar, when nothing overflows). */\n private markOverflowed() {\n const container = this.container\n if (!container) return\n const more = this.renderRoot.querySelector('[more]') as HTMLElement | null\n const limit = (more ?? container).getBoundingClientRect()[more ? 'left' : 'right'] + 0.5\n for (const child of Array.from(container.children)) {\n child.toggleAttribute('overflowed', this.overflown && child.getBoundingClientRect().right > limit)\n }\n }\n\n protected willUpdate() {\n const { actions, frame } = this._route.context || {}\n /* The bar has no box of its own to measure; the attribute is what the stylesheet reads. */\n if (frame) this.setAttribute('frame', String(frame))\n else this.removeAttribute('frame')\n\n if (actions) {\n this.actions = actions.filter((action: any) => !!action)\n }\n }\n\n showMore() {\n openOverlay('context-toolbar-overlay', {\n template: html`<ox-page-action-overlay-template></ox-page-action-overlay-template>`\n })\n }\n}\n"]}
1
+ {"version":3,"file":"ox-page-action-context-bar.js","sourceRoot":"","sources":["../../../src/tools/ox-page-action-context-bar.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,sCAAsC,CAAA;AAE7C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAE3E,OAAO,EAAE,kBAAkB,EAAc,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE5E,mGAAmG;AACnG,MAAM,UAAU,GAAG,EAAE,CAAA;AAGd,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,UAAU;IAA7C;;QAoKG,WAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAA;QAEf,YAAO,GAAiB,EAAE,CAAA;QAEpC,cAAS,GAAY,KAAK,CAAA;QAGnC,gBAAW,GAAG,CAAC,CAAA;QAGf,mBAAc,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,CAAA;QAC3C,mBAAc,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,CAAA;IA4ItD,CAAC;IA1TC,MAAM,KAAK,MAA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QAAQ;QACN,WAAW,CAAC,yBAAyB,EAAE;YACrC,QAAQ,EAAE,IAAI,CAAA,qEAAqE;SACpF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AArJ4B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;qDAA2B;AAEpC;IAAhB,KAAK,EAAE;uDAAmC;AACrB;IAArB,KAAK,CAAC,aAAa,CAAC;uDAA2B;AAzKrC,oBAAoB;IADhC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,oBAAoB,CA2ThC","sourcesContent":["import '@material/web/icon/icon.js'\nimport './ox-page-action-overlay-template.js'\n\nimport { css, html, LitElement, nothing, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { i18next } from '@operato/i18n'\nimport { openOverlay } from '@operato/layout'\nimport { RouteController } from '@operato/shell'\nimport { ButtonContainerStyles } from '@operato/styles'\nimport { formElementHeight } from '@operato/styles/form-element-heights.js'\n\nimport { arrangePageActions, PageAction, pageActionRunner } from './page-action.js'\nimport { PageActionStyles, renderPageAction } from './page-action-render.js'\n\n/** The width 「더보기」 takes at the bar's right end - its icon (2rem) and padding (10px each side). */\nconst MORE_WIDTH = 52\n\n@customElement('ox-page-action-context-bar')\nexport class PageActionContextBar extends LitElement {\n static get styles() {\n return [\n ButtonContainerStyles,\n PageActionStyles,\n css`\n :host {\n display: flex;\n position: relative;\n /*\n * The bar shrinks to the room its parent gives - without this its content width wins (min-width: auto of a\n * flex item that clips) and the actions are pushed out of the toolbar's left edge.\n */\n min-width: 0;\n max-width: 100%;\n overflow-x: clip;\n overflow-y: hidden;\n\n text-transform: capitalize;\n }\n\n /*\n * ── 키보드로 온 사람에게 지금 어디인지 보인다 ──────────────────────\n * 여기 있던 것은 :host *:focus { outline: none } 한 줄이다. 그런데 이 줄의 단추는 자기\n * 스타일에 이미 초점 표시를 갖고 있었다(ButtonContainerStyles 의 button &:focus-visible,\n * 2px). **그 한 줄이 그것을 이겼다** — :host *:focus 는 특정도 (0,2,0) 이고\n * button:focus-visible 은 (0,1,1) 이다. 그래서 선언은 있는데 화면에는 아무것도 안 그려졌다.\n *\n * [확인함] 2026-09-19 :3500 — 이 줄의 단추에 초점을 주고 재니 outline-style: none 이었다.\n * (그 재기는 :focus 까지만 확인한다. 키보드 초점은 합성으로 못 만든다.)\n *\n * 마우스로 누를 때 테두리가 남는 것이 싫어서 껐던 것은 맞다. 그 뜻은 :focus-visible 이\n * 정확히 낸다. 그래서 끄는 것은 **그 밖의 초점에만** 건다.\n *\n * 굵기는 3px 로 맞춘다 — Material 단추의 링이 3px 이고, 한 줄에 우리 단추와 md 단추가 함께\n * 서므로 두 표시가 같아야 한다.\n */\n :host *:focus:not(:focus-visible) {\n outline: none;\n }\n\n :host *:focus-visible {\n outline: 3px solid var(--md-sys-color-primary);\n outline-offset: 2px;\n }\n\n [container] {\n flex: 1;\n\n display: flex;\n overflow: hidden;\n gap: var(--spacing-small);\n /*\n * 초점 링이 설 자리 — 링은 단추 **밖으로 5px** 를 쓴다(3px 굵기 + 2px 띄움). 2px 이던 때는\n * 이 줄이 overflow: hidden 이라 위아래가 잘렸다. 가로로 자르는 것은 남겨 둔다 —\n * 「더보기」가 scrollWidth > clientWidth 로 넘침을 재는데 그 값이 살아 있어야 한다.\n */\n padding: 5px;\n align-items: center;\n }\n\n /*\n * The buttons end where the screen's content ends. A document screen used to stop at the\n * reading measure (1080px) and this bar followed it there through context.frame; since\n * 2026-10-05 every frame fills the window between two equal gutters (user decision, ADR in\n * operato-application/adr), so the bar spans the window like the content and no frame narrows it.\n * The frame attribute is still set — it says what the screen is — but nothing here reads it.\n */\n\n /*\n * 액션바 위에 떠 있는 오버플로 버튼 — 배경과 구분되도록 **테마와 무관하게 어두운 표면**을 유지한다.\n *\n * 이전에는 --md-sys-color-inverse-surface 를 썼는데, inverse-* 는 스펙상 \"현재 테마의 반대\"라\n * 라이트에서는 어둡지만 다크에서 밝게 반전되어 눈에 튀었다(ox-snack-bar 와 같은 부류).\n * 반투명 어두운 값을 기본으로 두면 브랜드 팔레트와 무관하게 안정적이고 .dark 패치도 불필요하다.\n */\n [more] {\n position: absolute;\n bottom: 0;\n right: 0;\n color: var(--ox-context-more-color, rgba(255, 255, 255, 0.95));\n background-color: var(--ox-context-more-background, rgba(0, 0, 0, 0.85));\n box-shadow: var(--ox-context-more-shadow, -2px 0px 2px 1px rgba(0, 0, 0, 0.2));\n padding: var(--context-action-bar-more-button-padding, 11px 10px);\n font-size: 2rem;\n z-index: 10;\n }\n\n /*\n * An action that does not fit whole is not drawn - half a button under 「더보기」 reads as a broken one\n * (2026-11-05, a phone: 「게시 취소」 cut in two by the button). The overlay behind 「더보기」 lists every\n * action. Which ones are kept is measured at their natural widths (layoutActions), so hiding one does not\n * change the decision.\n */\n [container] > [overflowed] {\n display: none;\n }\n\n [container] > * {\n flex: none;\n }\n\n /* The main action is always kept; on the narrowest bar it gives up width before it gives up its place. */\n [container] > [raised] {\n flex: 0 1 auto;\n min-width: 2.5rem;\n overflow: hidden;\n }\n\n /* Destructive actions stand apart from the rest (arranged first, configurePageActions). */\n [container] > [danger] + :not([danger]) {\n margin-left: var(--spacing-medium);\n }\n\n :host([overflown]) [container] {\n padding-right: var(--context-action-bar-more-width, 52px);\n }\n\n [more] {\n box-sizing: border-box;\n width: var(--context-action-bar-more-width, 52px);\n text-align: center;\n }\n\n select,\n input[type='text'] {\n box-sizing: border-box;\n padding: 0 var(--spacing-small);\n height: ${formElementHeight('--form-element-height-medium')};\n border: 1px solid var(--md-sys-color-outline);\n border-radius: var(--md-sys-shape-corner-small);\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-on-primary);\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n }\n\n @media screen and (max-width: 460px) {\n [container] {\n padding: 0;\n gap: 0;\n }\n\n /* 아주 좁은 화면 — 버튼을 붙여 한 덩어리로 만든다(사이 여백이 자리를 먹는다). */\n button {\n border-radius: 0;\n }\n\n button:not(:last-child) {\n border-right-width: 0;\n }\n }\n\n @keyframes rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n `\n ]\n }\n\n private _route = new RouteController(this)\n\n @property({ type: Array }) actions: PageAction[] = []\n\n @state() private overflown: boolean = false\n @query('[container]') container?: HTMLDivElement\n\n private layoutFrame = 0\n private resizeObserver?: ResizeObserver\n private observedParent?: Element | null\n private onRunnerChange = () => this.requestUpdate()\n private onWindowResize = () => this.scheduleLayout()\n\n connectedCallback() {\n super.connectedCallback()\n window.addEventListener('resize', this.onWindowResize)\n pageActionRunner.addEventListener('change', this.onRunnerChange)\n this.resizeObserver = new ResizeObserver(() => this.scheduleLayout())\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n window.removeEventListener('resize', this.onWindowResize)\n pageActionRunner.removeEventListener('change', this.onRunnerChange)\n this.resizeObserver?.disconnect()\n this.observedParent = undefined\n cancelAnimationFrame(this.layoutFrame)\n }\n\n render() {\n return this.actions.length > 0\n ? html`\n <div container>${this.renderActions()}</div>\n <!--\n 넘친 동작들에 닿는 **유일한 길**이다. 이름이 있어 낭독기가 읽고, 키보드 초점을 받는다.\n -->\n ${this.overflown\n ? html`\n <md-icon\n more\n role=\"button\"\n tabindex=\"0\"\n title=${i18next.t('text.more-actions', { defaultValue: 'more actions' })}\n aria-label=${i18next.t('text.more-actions', { defaultValue: 'more actions' })}\n @click=${this.showMore.bind(this)}\n @keydown=${(e: KeyboardEvent) => {\n if (e.key !== 'Enter' && e.key !== ' ') return\n e.preventDefault()\n this.showMore()\n }}\n >more_horiz</md-icon\n >\n `\n : html``}\n `\n : nothing\n }\n\n renderActions() {\n return html`${arrangePageActions(this.actions).map(({ action, role }) => renderPageAction(action, role))}`\n }\n\n async updated(changed: PropertyValues<this>) {\n if (changed.has('actions')) this.scheduleLayout()\n const parent = this.parentElement\n if (parent !== this.observedParent) {\n this.resizeObserver?.disconnect()\n if (parent) this.resizeObserver?.observe(parent)\n this.observedParent = parent\n }\n }\n\n private scheduleLayout() {\n cancelAnimationFrame(this.layoutFrame)\n this.layoutFrame = requestAnimationFrame(() => this.layoutActions())\n }\n\n /**\n * The width the bar may take: what its parent holds less the other things beside it. The bar's own width follows its\n * content, so it cannot tell the room it is given (2026-11-08: 650px of actions in a 403px toolbar measured as fitting).\n */\n private availableWidth(): number {\n const parent = this.parentElement\n if (!parent) return this.getBoundingClientRect().width\n const style = getComputedStyle(parent)\n const gap = parseFloat(style.columnGap) || 0\n const siblings = Array.from(parent.children).filter(child => child !== this && (child as HTMLElement).offsetParent !== null)\n const taken = siblings.reduce((sum, child) => sum + child.getBoundingClientRect().width + gap, 0)\n return parent.clientWidth - (parseFloat(style.paddingLeft) || 0) - (parseFloat(style.paddingRight) || 0) - taken\n }\n\n /**\n * Lays out what fits. Every action is first measured at its natural width; when they all fit, nothing is hidden.\n * Otherwise 「더보기」 takes the right end, the main action is always kept, and the others are kept from the right\n * (next to the main action) while they fit; the rest are listed only behind 「더보기」.\n */\n layoutActions() {\n const container = this.container\n if (!container) return\n const items = Array.from(container.children) as HTMLElement[]\n items.forEach(item => item.removeAttribute('overflowed'))\n this.removeAttribute('overflown')\n\n const style = getComputedStyle(container)\n const gap = parseFloat(style.columnGap) || 0\n const padding = (parseFloat(style.paddingLeft) || 0) + (parseFloat(style.paddingRight) || 0)\n const widths = items.map(item => item.getBoundingClientRect().width)\n const natural = widths.reduce((sum, width) => sum + width, 0) + gap * Math.max(0, items.length - 1) + padding\n const available = this.availableWidth()\n\n if (natural <= available + 0.5) {\n this.overflown = false\n return\n }\n\n const more = parseFloat(getComputedStyle(this).getPropertyValue('--context-action-bar-more-width')) || MORE_WIDTH\n let room = available - padding - more\n const keep = new Set<number>()\n items.forEach((item, at) => {\n if (item.hasAttribute('raised')) {\n keep.add(at)\n room -= widths[at] + gap\n }\n })\n for (let at = items.length - 1; at >= 0; at--) {\n if (keep.has(at)) continue\n if (widths[at] + gap > room) break\n keep.add(at)\n room -= widths[at] + gap\n }\n items.forEach((item, at) => item.toggleAttribute('overflowed', !keep.has(at)))\n this.setAttribute('overflown', '')\n this.overflown = true\n }\n\n protected willUpdate() {\n const { actions, frame } = this._route.context || {}\n /* The bar has no box of its own to measure; the attribute is what the stylesheet reads. */\n if (frame) this.setAttribute('frame', String(frame))\n else this.removeAttribute('frame')\n\n if (actions) {\n this.actions = actions.filter((action: any) => !!action)\n }\n }\n\n showMore() {\n openOverlay('context-toolbar-overlay', {\n template: html`<ox-page-action-overlay-template></ox-page-action-overlay-template>`\n })\n }\n}\n"]}
@@ -1,8 +1,14 @@
1
1
  import '@material/web/icon/icon.js';
2
- import '@material/web/chips/assist-chip.js';
3
2
  import { LitElement } from 'lit';
3
+ /**
4
+ * 「더보기」 - every action of the page, drawn by the same renderer as the bar (page-action-render.ts): the same name,
5
+ * icon, main/danger look, disabled reason and running state. A run started here is the same run the bar shows.
6
+ */
4
7
  export declare class PageActionOverlayTemplate extends LitElement {
5
8
  static get styles(): import("lit").CSSResult[];
6
9
  private _route;
10
+ private onRunnerChange;
11
+ connectedCallback(): void;
12
+ disconnectedCallback(): void;
7
13
  render(): import("lit-html").TemplateResult<1>;
8
14
  }
@@ -1,21 +1,27 @@
1
1
  import { __decorate } from "tslib";
2
2
  import '@material/web/icon/icon.js';
3
- import '@material/web/chips/assist-chip.js';
4
3
  import { css, html, LitElement } from 'lit';
5
4
  import { customElement } from 'lit/decorators.js';
6
5
  import { RouteController } from '@operato/shell';
7
6
  import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles';
8
- import { sleep } from '@operato/utils';
9
7
  import { ContextToolbarOverlayStyle } from '../styles/ox-context-toolbar-overlay-style.js';
8
+ import { arrangePageActions, pageActionRunner } from './page-action.js';
9
+ import { PageActionStyles, renderPageAction } from './page-action-render.js';
10
+ /**
11
+ * 「더보기」 - every action of the page, drawn by the same renderer as the bar (page-action-render.ts): the same name,
12
+ * icon, main/danger look, disabled reason and running state. A run started here is the same run the bar shows.
13
+ */
10
14
  let PageActionOverlayTemplate = class PageActionOverlayTemplate extends LitElement {
11
15
  constructor() {
12
16
  super(...arguments);
13
17
  this._route = new RouteController(this);
18
+ this.onRunnerChange = () => this.requestUpdate();
14
19
  }
15
20
  static get styles() {
16
21
  return [
17
22
  ScrollbarStyles,
18
23
  ButtonContainerStyles,
24
+ PageActionStyles,
19
25
  ContextToolbarOverlayStyle,
20
26
  css `
21
27
  :host {
@@ -25,83 +31,30 @@ let PageActionOverlayTemplate = class PageActionOverlayTemplate extends LitEleme
25
31
  align-items: center;
26
32
  }
27
33
 
28
- :host *:focus {
34
+ /* The same focus mark as the bar: none for a mouse press, a ring for the keyboard. */
35
+ :host *:focus:not(:focus-visible) {
29
36
  outline: none;
30
37
  }
31
38
 
32
- md-icon[working] {
33
- animation: rotate 1s linear infinite;
34
- }
35
-
36
- md-assist-chip[icon-only] {
37
- --md-assist-chip-trailing-space: 0;
38
- }
39
-
40
- @keyframes rotate {
41
- from {
42
- transform: rotate(0deg);
43
- }
44
- to {
45
- transform: rotate(360deg);
46
- }
39
+ :host *:focus-visible {
40
+ outline: 3px solid var(--md-sys-color-primary);
41
+ outline-offset: 2px;
47
42
  }
48
43
  `
49
44
  ];
50
45
  }
46
+ connectedCallback() {
47
+ super.connectedCallback();
48
+ pageActionRunner.addEventListener('change', this.onRunnerChange);
49
+ }
50
+ disconnectedCallback() {
51
+ super.disconnectedCallback();
52
+ pageActionRunner.removeEventListener('change', this.onRunnerChange);
53
+ }
51
54
  render() {
52
55
  var _a, _b;
53
56
  const actions = ((_b = (_a = this._route.context) === null || _a === void 0 ? void 0 : _a.actions) === null || _b === void 0 ? void 0 : _b.filter((action) => !!action)) || [];
54
- return html `
55
- ${actions.map(($action, idx) => {
56
- let { type, title, icon, action, select, href, emphasis, disabled, disabledTitle } = $action;
57
- let { raised, danger } = emphasis || {};
58
- return type == 'text'
59
- ? html ` <span>${title}</span> `
60
- : type == 'select' || (select && select.length > 0)
61
- ? html `
62
- <select @change=${action}>
63
- ${select.map((option) => html ` <option>${option}</option> `)}
64
- </select>
65
- `
66
- : type == 'link'
67
- ? html ` <a href=${href}>${title}</a> `
68
- : html `
69
- <md-assist-chip
70
- ?icon-only=${type == 'icon' || !title}
71
- ?elevated=${raised}
72
- ?danger=${danger}
73
- ?disabled=${disabled}
74
- title=${disabled && disabledTitle ? disabledTitle : title || ''}
75
- label=${title}
76
- @click=${async (e) => {
77
- var _a;
78
- /* all actions should be bloked for a second */
79
- const button = e.currentTarget;
80
- const iconElement = button.querySelector('[slot="icon"]');
81
- if (iconElement) {
82
- iconElement.textContent = 'refresh';
83
- iconElement.setAttribute('working', true);
84
- }
85
- button.disabled = true;
86
- try {
87
- await action();
88
- }
89
- finally {
90
- await sleep(1000); /* waiting for additionla 1 second */
91
- /* because icon can be changed after sleep, don't use closure 'icon'. */
92
- if (iconElement) {
93
- iconElement.textContent = (_a = actions[idx]) === null || _a === void 0 ? void 0 : _a.icon;
94
- iconElement.removeAttribute('working');
95
- }
96
- button.disabled = false;
97
- }
98
- }}
99
- >
100
- <md-icon slot="icon">${icon || 'done_all'}</md-icon>
101
- </md-assist-chip>
102
- `;
103
- })}
104
- `;
57
+ return html `${arrangePageActions(actions).map(({ action, role }) => renderPageAction(action, role))}`;
105
58
  }
106
59
  };
107
60
  PageActionOverlayTemplate = __decorate([