@operato/context 10.29.77 → 10.29.79

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,22 @@
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.79](https://github.com/hatiolab/operato/compare/v10.29.78...v10.29.79) (2026-11-10)
7
+
8
+ **Note:** Version bump only for package @operato/context
9
+
10
+
11
+
12
+
13
+
14
+ ### [10.29.78](https://github.com/hatiolab/operato/compare/v10.29.77...v10.29.78) (2026-11-10)
15
+
16
+ **Note:** Version bump only for package @operato/context
17
+
18
+
19
+
20
+
21
+
6
22
  ### [10.29.77](https://github.com/hatiolab/operato/compare/v10.29.76...v10.29.77) (2026-11-10)
7
23
 
8
24
  **Note:** Version bump only for package @operato/context
@@ -0,0 +1,2 @@
1
+ import '../src/tools/ox-page-action-context-bar.js';
2
+ import '../src/tools/ox-page-action-overlay-template.js';
@@ -0,0 +1,179 @@
1
+ import { expect, fixture } from '@open-wc/testing';
2
+ import { html } from 'lit';
3
+ import '../src/tools/ox-page-action-context-bar.js';
4
+ import '../src/tools/ox-page-action-overlay-template.js';
5
+ import { arrangePageActions, configurePageActions, pageActionRunner, roleOf } from '../src/tools/page-action.js';
6
+ const settle = async (el, rounds = 4) => {
7
+ for (let i = 0; i < rounds; i++) {
8
+ await new Promise(resolve => setTimeout(resolve, 60));
9
+ await el.updateComplete;
10
+ }
11
+ };
12
+ async function barIn(width, actions) {
13
+ const host = await fixture(html `<div style="display:flex; justify-content:flex-end; overflow:hidden; width:${width}px"><ox-page-action-context-bar .actions=${actions}></ox-page-action-context-bar></div>`);
14
+ const el = host.querySelector('ox-page-action-context-bar');
15
+ await settle(el);
16
+ return { host: host, el };
17
+ }
18
+ const LONG = [
19
+ { title: '차수 관리 열기와 아주 긴 번역 문구', action: () => { } },
20
+ { title: '거래처로 등록', action: () => { } },
21
+ { title: '실적 배분', action: () => { } },
22
+ { title: '저장', icon: 'save', action: () => { }, emphasis: { raised: true } }
23
+ ];
24
+ describe('동작 줄 — 부모 폭으로 넘침을 잰다 (F01)', () => {
25
+ for (const width of [320, 360, 390, 768]) {
26
+ it(`${width}px: 잘린 단추가 없고 주 동작이 보이며 나머지는 더보기로 닿는다`, async () => {
27
+ var _a, _b;
28
+ const { host, el } = await barIn(width, LONG);
29
+ const box = host.getBoundingClientRect();
30
+ const buttons = Array.from(el.renderRoot.querySelectorAll('[container] > button'));
31
+ const shown = buttons.filter(one => getComputedStyle(one).display !== 'none');
32
+ for (const one of shown) {
33
+ const rect = one.getBoundingClientRect();
34
+ expect(rect.left >= box.left - 0.5, `「${(_a = one.textContent) === null || _a === void 0 ? void 0 : _a.trim()}」 왼쪽이 잘렸다`).to.equal(true);
35
+ expect(rect.right <= box.right + 0.5, `「${(_b = one.textContent) === null || _b === void 0 ? void 0 : _b.trim()}」 오른쪽이 잘렸다`).to.equal(true);
36
+ }
37
+ const primary = shown.find(one => one.hasAttribute('raised'));
38
+ expect(primary, '주 동작이 보이지 않는다').to.not.equal(undefined);
39
+ if (shown.length < buttons.length) {
40
+ const more = el.renderRoot.querySelector('[more]');
41
+ expect(more, '숨은 동작이 있는데 더보기가 없다').to.not.equal(null);
42
+ expect(more.getAttribute('tabindex')).to.equal('0');
43
+ expect(more.getBoundingClientRect().right <= box.right + 0.5).to.equal(true);
44
+ for (const one of shown)
45
+ expect(one.getBoundingClientRect().right <= more.getBoundingClientRect().left + 0.5).to.equal(true);
46
+ }
47
+ });
48
+ }
49
+ it('부모가 넓어지면 숨겼던 동작을 다시 보인다', async () => {
50
+ const { host, el } = await barIn(320, LONG);
51
+ host.style.width = '1400px';
52
+ await settle(el, 6);
53
+ expect(el.renderRoot.querySelector('[more]')).to.equal(null);
54
+ expect(el.renderRoot.querySelectorAll('[container] > [overflowed]').length).to.equal(0);
55
+ });
56
+ });
57
+ describe('동작의 역할과 순서 (F02 F05)', () => {
58
+ afterEach(() => configurePageActions({ arrange: false, exclusive: false }));
59
+ it('삭제는 raised 여도 위험 보조, 저장은 주 동작이다', () => {
60
+ expect(roleOf({ title: '삭제', emphasis: { raised: true, danger: true } })).to.equal('danger');
61
+ expect(roleOf({ title: '저장', emphasis: { raised: true } })).to.equal('primary');
62
+ expect(roleOf({ title: '상신', priority: 'primary' })).to.equal('primary');
63
+ });
64
+ it('arrange: 위험 동작은 앞, 주 동작은 오른쪽 끝, 주 동작은 하나', () => {
65
+ configurePageActions({ arrange: true });
66
+ const arranged = arrangePageActions([
67
+ { title: '저장', emphasis: { raised: true } },
68
+ { title: '삭제', emphasis: { raised: true, danger: true } },
69
+ { title: '상신', emphasis: { raised: true } },
70
+ { title: '첨부' }
71
+ ]);
72
+ expect(arranged.map(one => `${one.action.title}:${one.role}`)).to.deep.equal(['삭제:danger', '저장:secondary', '첨부:secondary', '상신:primary']);
73
+ });
74
+ it('기본(arrange 없음)은 선언 순서를 그대로 둔다', () => {
75
+ const arranged = arrangePageActions([{ title: 'a', emphasis: { raised: true } }, { title: 'b', emphasis: { danger: true } }]);
76
+ expect(arranged.map(one => one.action.title)).to.deep.equal(['a', 'b']);
77
+ });
78
+ });
79
+ describe('더보기는 기본 줄과 같은 렌더러로 그린다 (F04)', () => {
80
+ it('주 동작·위험·비활성·이유·아이콘이 같다', async () => {
81
+ const actions = [
82
+ { title: '삭제', icon: 'delete', emphasis: { danger: true }, action: () => { } },
83
+ { title: '발행', action: () => { }, disabled: true, disabledTitle: '먼저 저장하세요.' },
84
+ { title: '저장', icon: 'save', emphasis: { raised: true }, action: () => { } }
85
+ ];
86
+ const { el } = await barIn(1200, actions);
87
+ const overlay = (await fixture(html `<ox-page-action-overlay-template></ox-page-action-overlay-template>`));
88
+ overlay._route = { context: { actions } };
89
+ overlay.requestUpdate();
90
+ await overlay.updateComplete;
91
+ const describe = (root) => Array.from(root.querySelectorAll('button')).map(b => {
92
+ var _a;
93
+ return ({
94
+ text: (_a = b.textContent) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, ' ').trim(),
95
+ raised: b.hasAttribute('raised'),
96
+ danger: b.hasAttribute('danger'),
97
+ ariaDisabled: b.getAttribute('aria-disabled'),
98
+ title: b.getAttribute('title')
99
+ });
100
+ });
101
+ expect(describe(overlay.renderRoot)).to.deep.equal(describe(el.renderRoot));
102
+ expect(overlay.renderRoot.querySelector('md-assist-chip')).to.equal(null);
103
+ });
104
+ });
105
+ describe('실행 상태는 공유된다 (F09)', () => {
106
+ afterEach(() => configurePageActions({ exclusive: false }));
107
+ it('같은 동작은 진행 중에 다시 시작하지 않는다 — 기본 줄과 더보기 사이에서도', async () => {
108
+ let runs = 0;
109
+ let release;
110
+ const action = { id: 'save', title: '저장', action: () => (runs++, new Promise(resolve => (release = resolve))) };
111
+ const { el } = await barIn(1200, [action]);
112
+ const button = el.renderRoot.querySelector('button');
113
+ button.click();
114
+ await el.updateComplete;
115
+ expect(button.getAttribute('aria-busy')).to.equal('true');
116
+ button.click();
117
+ pageActionRunner.run({ ...action });
118
+ expect(runs).to.equal(1);
119
+ release();
120
+ await new Promise(resolve => setTimeout(resolve, 10));
121
+ await el.updateComplete;
122
+ expect(button.getAttribute('aria-busy')).to.equal('false');
123
+ });
124
+ it('끝난 뒤 disabled 를 풀지 않는다 — 진행 중 업무 조건이 바뀌면 그 조건을 따른다', async () => {
125
+ let release;
126
+ const make = (disabled) => ({ id: 'issue', title: '발행', disabled, action: () => new Promise(resolve => (release = resolve)) });
127
+ const { el } = await barIn(1200, [make(false)]);
128
+ el.renderRoot.querySelector('button').click();
129
+ await el.updateComplete;
130
+ el.actions = [make(true)];
131
+ await el.updateComplete;
132
+ release();
133
+ await new Promise(resolve => setTimeout(resolve, 10));
134
+ await el.updateComplete;
135
+ const button = el.renderRoot.querySelector('button');
136
+ expect(button.disabled || button.getAttribute('aria-disabled') === 'true').to.equal(true);
137
+ });
138
+ it('exclusive: 한 동작이 도는 동안 다른 동작은 시작하지 않는다', async () => {
139
+ configurePageActions({ exclusive: true });
140
+ let release;
141
+ let submitted = 0;
142
+ const save = { id: 'save', title: '저장', action: () => new Promise(resolve => (release = resolve)) };
143
+ const submit = { id: 'submit', title: '상신', action: () => void submitted++ };
144
+ const { el } = await barIn(1200, [save, submit]);
145
+ const [saveButton, submitButton] = Array.from(el.renderRoot.querySelectorAll('button'));
146
+ saveButton.click();
147
+ await el.updateComplete;
148
+ expect(submitButton.disabled).to.equal(true);
149
+ submitButton.click();
150
+ expect(submitted).to.equal(0);
151
+ release();
152
+ await new Promise(resolve => setTimeout(resolve, 10));
153
+ await el.updateComplete;
154
+ expect(submitButton.disabled).to.equal(false);
155
+ });
156
+ it('group: 같은 묶음끼리만 막는다', async () => {
157
+ let release;
158
+ const a = { id: 'a', title: 'A', group: 'change', action: () => new Promise(resolve => (release = resolve)) };
159
+ const b = { id: 'b', title: 'B', group: 'change', action: () => { } };
160
+ const c = { id: 'c', title: 'C', action: () => { } };
161
+ pageActionRunner.run(a);
162
+ expect(pageActionRunner.mayRun(b)).to.equal(false);
163
+ expect(pageActionRunner.mayRun(c)).to.equal(true);
164
+ release();
165
+ await new Promise(resolve => setTimeout(resolve, 10));
166
+ expect(pageActionRunner.mayRun(b)).to.equal(true);
167
+ });
168
+ it('이유가 있는 비활성 동작은 초점을 받고 누르면 실행하지 않는다', async () => {
169
+ let runs = 0;
170
+ const { el } = await barIn(1200, [{ title: '발행', disabled: true, disabledTitle: '먼저 저장하세요.', action: () => void runs++ }]);
171
+ const button = el.renderRoot.querySelector('button');
172
+ expect(button.disabled).to.equal(false);
173
+ expect(button.getAttribute('aria-disabled')).to.equal('true');
174
+ expect(button.title).to.equal('먼저 저장하세요.');
175
+ button.click();
176
+ expect(runs).to.equal(0);
177
+ });
178
+ });
179
+ //# sourceMappingURL=action-bar-contract.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-bar-contract.test.js","sourceRoot":"","sources":["../../test/action-bar-contract.test.ts"],"names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lit'\n\nimport '../src/tools/ox-page-action-context-bar.js'\nimport '../src/tools/ox-page-action-overlay-template.js'\nimport { arrangePageActions, configurePageActions, PageAction, pageActionRunner, roleOf } from '../src/tools/page-action.js'\n\n/**\n * The page action contract (FOOTER-BUTTON-REVIEW F01 F02 F04 F05 F09 F10): the bar keeps every action reachable in the\n * room its parent gives, the main action stays, 「더보기」 draws an action as the bar does, and a run is shared.\n */\n\ntype Bar = HTMLElement & { renderRoot: ShadowRoot; updateComplete: Promise<unknown>; actions: PageAction[]; requestUpdate(): void }\n\nconst settle = async (el: Bar, rounds = 4) => {\n for (let i = 0; i < rounds; i++) {\n await new Promise(resolve => setTimeout(resolve, 60))\n await el.updateComplete\n }\n}\n\nasync function barIn(width: number, actions: PageAction[]) {\n const host = await fixture(\n html`<div style=\"display:flex; justify-content:flex-end; overflow:hidden; width:${width}px\"><ox-page-action-context-bar .actions=${actions}></ox-page-action-context-bar></div>`\n )\n const el = host.querySelector('ox-page-action-context-bar') as Bar\n await settle(el)\n return { host: host as HTMLElement, el }\n}\n\nconst LONG = [\n { title: '차수 관리 열기와 아주 긴 번역 문구', action: () => {} },\n { title: '거래처로 등록', action: () => {} },\n { title: '실적 배분', action: () => {} },\n { title: '저장', icon: 'save', action: () => {}, emphasis: { raised: true } }\n]\n\ndescribe('동작 줄 — 부모 폭으로 넘침을 잰다 (F01)', () => {\n for (const width of [320, 360, 390, 768]) {\n it(`${width}px: 잘린 단추가 없고 주 동작이 보이며 나머지는 더보기로 닿는다`, async () => {\n const { host, el } = await barIn(width, LONG)\n const box = host.getBoundingClientRect()\n const buttons = Array.from(el.renderRoot.querySelectorAll('[container] > button')) as HTMLElement[]\n const shown = buttons.filter(one => getComputedStyle(one).display !== 'none')\n for (const one of shown) {\n const rect = one.getBoundingClientRect()\n expect(rect.left >= box.left - 0.5, `「${one.textContent?.trim()}」 왼쪽이 잘렸다`).to.equal(true)\n expect(rect.right <= box.right + 0.5, `「${one.textContent?.trim()}」 오른쪽이 잘렸다`).to.equal(true)\n }\n const primary = shown.find(one => one.hasAttribute('raised'))\n expect(primary, '주 동작이 보이지 않는다').to.not.equal(undefined)\n if (shown.length < buttons.length) {\n const more = el.renderRoot.querySelector('[more]') as HTMLElement\n expect(more, '숨은 동작이 있는데 더보기가 없다').to.not.equal(null)\n expect(more.getAttribute('tabindex')).to.equal('0')\n expect(more.getBoundingClientRect().right <= box.right + 0.5).to.equal(true)\n for (const one of shown) expect(one.getBoundingClientRect().right <= more.getBoundingClientRect().left + 0.5).to.equal(true)\n }\n })\n }\n\n it('부모가 넓어지면 숨겼던 동작을 다시 보인다', async () => {\n const { host, el } = await barIn(320, LONG)\n host.style.width = '1400px'\n await settle(el, 6)\n expect(el.renderRoot.querySelector('[more]')).to.equal(null)\n expect(el.renderRoot.querySelectorAll('[container] > [overflowed]').length).to.equal(0)\n })\n})\n\ndescribe('동작의 역할과 순서 (F02 F05)', () => {\n afterEach(() => configurePageActions({ arrange: false, exclusive: false }))\n\n it('삭제는 raised 여도 위험 보조, 저장은 주 동작이다', () => {\n expect(roleOf({ title: '삭제', emphasis: { raised: true, danger: true } })).to.equal('danger')\n expect(roleOf({ title: '저장', emphasis: { raised: true } })).to.equal('primary')\n expect(roleOf({ title: '상신', priority: 'primary' })).to.equal('primary')\n })\n\n it('arrange: 위험 동작은 앞, 주 동작은 오른쪽 끝, 주 동작은 하나', () => {\n configurePageActions({ arrange: true })\n const arranged = arrangePageActions([\n { title: '저장', emphasis: { raised: true } },\n { title: '삭제', emphasis: { raised: true, danger: true } },\n { title: '상신', emphasis: { raised: true } },\n { title: '첨부' }\n ])\n expect(arranged.map(one => `${one.action.title}:${one.role}`)).to.deep.equal(['삭제:danger', '저장:secondary', '첨부:secondary', '상신:primary'])\n })\n\n it('기본(arrange 없음)은 선언 순서를 그대로 둔다', () => {\n const arranged = arrangePageActions([{ title: 'a', emphasis: { raised: true } }, { title: 'b', emphasis: { danger: true } }])\n expect(arranged.map(one => one.action.title)).to.deep.equal(['a', 'b'])\n })\n})\n\ndescribe('더보기는 기본 줄과 같은 렌더러로 그린다 (F04)', () => {\n it('주 동작·위험·비활성·이유·아이콘이 같다', async () => {\n const actions: PageAction[] = [\n { title: '삭제', icon: 'delete', emphasis: { danger: true }, action: () => {} },\n { title: '발행', action: () => {}, disabled: true, disabledTitle: '먼저 저장하세요.' },\n { title: '저장', icon: 'save', emphasis: { raised: true }, action: () => {} }\n ]\n const { el } = await barIn(1200, actions)\n const overlay = (await fixture(html`<ox-page-action-overlay-template></ox-page-action-overlay-template>`)) as Bar\n ;(overlay as any)._route = { context: { actions } }\n overlay.requestUpdate()\n await overlay.updateComplete\n const describe = (root: ShadowRoot) =>\n Array.from(root.querySelectorAll('button')).map(b => ({\n text: b.textContent?.replace(/\\s+/g, ' ').trim(),\n raised: b.hasAttribute('raised'),\n danger: b.hasAttribute('danger'),\n ariaDisabled: b.getAttribute('aria-disabled'),\n title: b.getAttribute('title')\n }))\n expect(describe(overlay.renderRoot)).to.deep.equal(describe(el.renderRoot))\n expect(overlay.renderRoot.querySelector('md-assist-chip')).to.equal(null)\n })\n})\n\ndescribe('실행 상태는 공유된다 (F09)', () => {\n afterEach(() => configurePageActions({ exclusive: false }))\n\n it('같은 동작은 진행 중에 다시 시작하지 않는다 — 기본 줄과 더보기 사이에서도', async () => {\n let runs = 0\n let release!: () => void\n const action: PageAction = { id: 'save', title: '저장', action: () => (runs++, new Promise<void>(resolve => (release = resolve))) }\n const { el } = await barIn(1200, [action])\n const button = el.renderRoot.querySelector('button') as HTMLButtonElement\n button.click()\n await el.updateComplete\n expect(button.getAttribute('aria-busy')).to.equal('true')\n button.click()\n pageActionRunner.run({ ...action })\n expect(runs).to.equal(1)\n release()\n await new Promise(resolve => setTimeout(resolve, 10))\n await el.updateComplete\n expect(button.getAttribute('aria-busy')).to.equal('false')\n })\n\n it('끝난 뒤 disabled 를 풀지 않는다 — 진행 중 업무 조건이 바뀌면 그 조건을 따른다', async () => {\n let release!: () => void\n const make = (disabled: boolean): PageAction => ({ id: 'issue', title: '발행', disabled, action: () => new Promise<void>(resolve => (release = resolve)) })\n const { el } = await barIn(1200, [make(false)])\n ;(el.renderRoot.querySelector('button') as HTMLButtonElement).click()\n await el.updateComplete\n el.actions = [make(true)]\n await el.updateComplete\n release()\n await new Promise(resolve => setTimeout(resolve, 10))\n await el.updateComplete\n const button = el.renderRoot.querySelector('button') as HTMLButtonElement\n expect(button.disabled || button.getAttribute('aria-disabled') === 'true').to.equal(true)\n })\n\n it('exclusive: 한 동작이 도는 동안 다른 동작은 시작하지 않는다', async () => {\n configurePageActions({ exclusive: true })\n let release!: () => void\n let submitted = 0\n const save: PageAction = { id: 'save', title: '저장', action: () => new Promise<void>(resolve => (release = resolve)) }\n const submit: PageAction = { id: 'submit', title: '상신', action: () => void submitted++ }\n const { el } = await barIn(1200, [save, submit])\n const [saveButton, submitButton] = Array.from(el.renderRoot.querySelectorAll('button')) as HTMLButtonElement[]\n saveButton.click()\n await el.updateComplete\n expect(submitButton.disabled).to.equal(true)\n submitButton.click()\n expect(submitted).to.equal(0)\n release()\n await new Promise(resolve => setTimeout(resolve, 10))\n await el.updateComplete\n expect(submitButton.disabled).to.equal(false)\n })\n\n it('group: 같은 묶음끼리만 막는다', async () => {\n let release!: () => void\n const a: PageAction = { id: 'a', title: 'A', group: 'change', action: () => new Promise<void>(resolve => (release = resolve)) }\n const b: PageAction = { id: 'b', title: 'B', group: 'change', action: () => {} }\n const c: PageAction = { id: 'c', title: 'C', action: () => {} }\n pageActionRunner.run(a)\n expect(pageActionRunner.mayRun(b)).to.equal(false)\n expect(pageActionRunner.mayRun(c)).to.equal(true)\n release()\n await new Promise(resolve => setTimeout(resolve, 10))\n expect(pageActionRunner.mayRun(b)).to.equal(true)\n })\n\n it('이유가 있는 비활성 동작은 초점을 받고 누르면 실행하지 않는다', async () => {\n let runs = 0\n const { el } = await barIn(1200, [{ title: '발행', disabled: true, disabledTitle: '먼저 저장하세요.', action: () => void runs++ }])\n const button = el.renderRoot.querySelector('button') as HTMLButtonElement\n expect(button.disabled).to.equal(false)\n expect(button.getAttribute('aria-disabled')).to.equal('true')\n expect(button.title).to.equal('먼저 저장하세요.')\n button.click()\n expect(runs).to.equal(0)\n })\n})\n"]}
@@ -0,0 +1 @@
1
+ import '../src/tools/ox-page-action-context-bar.js';
@@ -0,0 +1,67 @@
1
+ /* 요소끼리 비교하지 않는다 — 실패하면 chai 가 DOM 을 펼치다 러너가 멈춘다. */
2
+ import { expect, fixture } from '@open-wc/testing';
3
+ import { html } from 'lit';
4
+ import '../src/tools/ox-page-action-context-bar.js';
5
+ /**
6
+ * 키보드로 온 사람이 **지금 어디인지 보인다.**
7
+ *
8
+ * ── 무엇이 있었나 ─────────────────────────────────────────────────────────
9
+ * 이 줄의 스타일에 `:host *:focus { outline: none }` 한 줄이 있었고 대신 그릴 것이 없었다. 그래서
10
+ * **하단 동작 줄의 단추에는 초점 표시가 아예 없었다** — 모든 제품의 모든 화면에 이 줄이 선다.
11
+ * [확인함] 2026-09-19 :3500 — 단추에 초점을 주고 재니 `outline-style: none` · `box-shadow: none`.
12
+ *
13
+ * 마우스로 누를 때 테두리가 뜨는 것이 싫어서 지운 것은 맞다. 그 뜻은 `:focus-visible` 이 정확히 낸다.
14
+ *
15
+ * ── 자리도 함께 준다 ──────────────────────────────────────────────────────
16
+ * 링은 단추 **밖으로 5px** 를 쓴다(3px 굵기 + 2px 띄움). 담는 줄이 `overflow: hidden` 이고 여백이
17
+ * 2px 이던 때는 그려도 위아래가 잘렸다. 그래서 이 시험은 **그렸나**와 **설 자리가 있나**를 함께 본다.
18
+ */
19
+ const ACTIONS = [
20
+ { title: 'save', action: () => { } },
21
+ { title: 'cancel', action: () => { } }
22
+ ];
23
+ async function bar() {
24
+ const el = (await fixture(html `
25
+ <ox-page-action-context-bar .actions=${ACTIONS}></ox-page-action-context-bar>
26
+ `));
27
+ await el.updateComplete;
28
+ return el;
29
+ }
30
+ const buttonOf = (el) => el.renderRoot.querySelector('button');
31
+ describe('하단 동작 줄의 초점 표시', () => {
32
+ it('키보드로 온 초점에 테두리를 그린다', async () => {
33
+ const el = await bar();
34
+ expect(buttonOf(el), '단추가 없다').to.not.equal(null);
35
+ /*
36
+ * 브라우저는 **키를 누른 뒤의 초점**만 키보드 초점으로 본다. 합성 키는 그림자 DOM 을 못 지나므로
37
+ * (2026-09-18 에 그것으로 없는 결함을 보고했다) 여기서는 규칙이 서 있는지를 본다. 실제로 그려지는
38
+ * 것은 앱에서 잰다.
39
+ *
40
+ * **주석을 걷고 본다.** 안 그러면 이 파일이 설명으로 적은 옛 규칙이 검사를 만족시킨다 —
41
+ * 자기 산문을 세는 것이 이 집 시험의 오래된 함정이다.
42
+ */
43
+ const rules = Array.from(el.constructor.elementStyles)
44
+ .map((sheet) => { var _a; return String((_a = sheet.cssText) !== null && _a !== void 0 ? _a : ''); })
45
+ .join('\n')
46
+ .replace(/\/\*[\s\S]*?\*\//g, ' ');
47
+ /* 큰 문자열을 match 에 넣으면 실패 출력이 화면을 덮는다 — 참·거짓만 본다. */
48
+ expect(/:focus-visible\s*\{[^}]*outline:\s*3px solid/.test(rules), 'focus-visible 에 그릴 것이 없다').to.equal(true);
49
+ expect(/\*:focus\s*\{\s*outline:\s*none/.test(rules), '초점을 통째로 끄는 줄이 남아 있다').to.equal(false);
50
+ expect(/:focus:not\(:focus-visible\)\s*\{[^}]*outline:\s*none/.test(rules), '마우스 초점을 끄는 줄이 없다 — 누를 때마다 테두리가 뜬다').to.equal(true);
51
+ });
52
+ it('링이 설 자리가 있다 — 그려도 잘리면 없는 것과 같다', async () => {
53
+ const el = await bar();
54
+ const container = el.renderRoot.querySelector('[container]');
55
+ const style = getComputedStyle(container);
56
+ /* 링은 밖으로 5px 를 쓴다: 3px 굵기 + 2px 띄움. */
57
+ expect(parseFloat(style.paddingTop), '위 여백이 링보다 좁다').to.be.at.least(5);
58
+ expect(parseFloat(style.paddingBottom), '아래 여백이 링보다 좁다').to.be.at.least(5);
59
+ expect(parseFloat(style.paddingLeft), '왼쪽 여백이 링보다 좁다').to.be.at.least(5);
60
+ });
61
+ it('가로로 자르는 것은 그대로다 — 「더보기」가 넘침을 그 값으로 잰다', async () => {
62
+ const el = await bar();
63
+ const container = el.renderRoot.querySelector('[container]');
64
+ expect(getComputedStyle(container).overflowX).to.equal('hidden');
65
+ });
66
+ });
67
+ //# sourceMappingURL=action-bar-focus.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-bar-focus.test.js","sourceRoot":"","sources":["../../test/action-bar-focus.test.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE1B,OAAO,4CAA4C,CAAA;AAEnD;;;;;;;;;;;;;GAaG;AAEH,MAAM,OAAO,GAAG;IACd,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE;IACnC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE;CACtC,CAAA;AAED,KAAK,UAAU,GAAG;IAChB,MAAM,EAAE,GAAG,CAAC,MAAM,OAAO,CAAC,IAAI,CAAA;2CACW,OAAO;GAC/C,CAAC,CAA+E,CAAA;IAEjF,MAAM,EAAE,CAAC,cAAc,CAAA;IACvB,OAAO,EAAE,CAAA;AACX,CAAC;AAED,MAAM,QAAQ,GAAG,CAAC,EAA4C,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAgB,CAAA;AAEvH,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,qBAAqB,EAAE,KAAK,IAAI,EAAE;QACnC,MAAM,EAAE,GAAG,MAAM,GAAG,EAAE,CAAA;QAEtB,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC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AAa,CAAC,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAC1E,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC1E,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;QACrD,MAAM,EAAE,GAAG,MAAM,GAAG,EAAE,CAAA;QACtB,MAAM,SAAS,GAAG,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,aAAa,CAAgB,CAAA;QAE3E,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;IAClE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["/* 요소끼리 비교하지 않는다 — 실패하면 chai 가 DOM 을 펼치다 러너가 멈춘다. */\nimport { expect, fixture } from '@open-wc/testing'\nimport { html } from 'lit'\n\nimport '../src/tools/ox-page-action-context-bar.js'\n\n/**\n * 키보드로 온 사람이 **지금 어디인지 보인다.**\n *\n * ── 무엇이 있었나 ─────────────────────────────────────────────────────────\n * 이 줄의 스타일에 `:host *:focus { outline: none }` 한 줄이 있었고 대신 그릴 것이 없었다. 그래서\n * **하단 동작 줄의 단추에는 초점 표시가 아예 없었다** — 모든 제품의 모든 화면에 이 줄이 선다.\n * [확인함] 2026-09-19 :3500 — 단추에 초점을 주고 재니 `outline-style: none` · `box-shadow: none`.\n *\n * 마우스로 누를 때 테두리가 뜨는 것이 싫어서 지운 것은 맞다. 그 뜻은 `:focus-visible` 이 정확히 낸다.\n *\n * ── 자리도 함께 준다 ──────────────────────────────────────────────────────\n * 링은 단추 **밖으로 5px** 를 쓴다(3px 굵기 + 2px 띄움). 담는 줄이 `overflow: hidden` 이고 여백이\n * 2px 이던 때는 그려도 위아래가 잘렸다. 그래서 이 시험은 **그렸나**와 **설 자리가 있나**를 함께 본다.\n */\n\nconst ACTIONS = [\n { title: 'save', action: () => {} },\n { title: 'cancel', action: () => {} }\n]\n\nasync function bar() {\n const el = (await fixture(html`\n <ox-page-action-context-bar .actions=${ACTIONS}></ox-page-action-context-bar>\n `)) as HTMLElement & { renderRoot: ShadowRoot; updateComplete: Promise<unknown> }\n\n await el.updateComplete\n return el\n}\n\nconst buttonOf = (el: HTMLElement & { renderRoot: ShadowRoot }) => el.renderRoot.querySelector('button') as HTMLElement\n\ndescribe('하단 동작 줄의 초점 표시', () => {\n it('키보드로 온 초점에 테두리를 그린다', async () => {\n const el = await bar()\n\n expect(buttonOf(el), '단추가 없다').to.not.equal(null)\n\n /*\n * 브라우저는 **키를 누른 뒤의 초점**만 키보드 초점으로 본다. 합성 키는 그림자 DOM 을 못 지나므로\n * (2026-09-18 에 그것으로 없는 결함을 보고했다) 여기서는 규칙이 서 있는지를 본다. 실제로 그려지는\n * 것은 앱에서 잰다.\n *\n * **주석을 걷고 본다.** 안 그러면 이 파일이 설명으로 적은 옛 규칙이 검사를 만족시킨다 —\n * 자기 산문을 세는 것이 이 집 시험의 오래된 함정이다.\n */\n const rules = Array.from((el.constructor as any).elementStyles)\n .map((sheet: any) => String(sheet.cssText ?? ''))\n .join('\\n')\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, ' ')\n\n /* 큰 문자열을 match 에 넣으면 실패 출력이 화면을 덮는다 — 참·거짓만 본다. */\n expect(/:focus-visible\\s*\\{[^}]*outline:\\s*3px solid/.test(rules), 'focus-visible 에 그릴 것이 없다').to.equal(true)\n expect(/\\*:focus\\s*\\{\\s*outline:\\s*none/.test(rules), '초점을 통째로 끄는 줄이 남아 있다').to.equal(false)\n expect(\n /:focus:not\\(:focus-visible\\)\\s*\\{[^}]*outline:\\s*none/.test(rules),\n '마우스 초점을 끄는 줄이 없다 — 누를 때마다 테두리가 뜬다'\n ).to.equal(true)\n })\n\n it('링이 설 자리가 있다 — 그려도 잘리면 없는 것과 같다', async () => {\n const el = await bar()\n const container = el.renderRoot.querySelector('[container]') as HTMLElement\n const style = getComputedStyle(container)\n\n /* 링은 밖으로 5px 를 쓴다: 3px 굵기 + 2px 띄움. */\n expect(parseFloat(style.paddingTop), '위 여백이 링보다 좁다').to.be.at.least(5)\n expect(parseFloat(style.paddingBottom), '아래 여백이 링보다 좁다').to.be.at.least(5)\n expect(parseFloat(style.paddingLeft), '왼쪽 여백이 링보다 좁다').to.be.at.least(5)\n })\n\n it('가로로 자르는 것은 그대로다 — 「더보기」가 넘침을 그 값으로 잰다', async () => {\n const el = await bar()\n const container = el.renderRoot.querySelector('[container]') as HTMLElement\n\n expect(getComputedStyle(container).overflowX).to.equal('hidden')\n })\n})\n"]}
@@ -0,0 +1 @@
1
+ import '../src/tools/ox-page-action-context-bar.js';
@@ -0,0 +1,42 @@
1
+ import { expect, fixture } from '@open-wc/testing';
2
+ import { html } from 'lit';
3
+ import '../src/tools/ox-page-action-context-bar.js';
4
+ /**
5
+ * On a phone the actions do not all fit. 「더보기」 stands over the bar's right end, and an action that does not fit
6
+ * whole is not drawn - it was drawn cut in two under 「더보기」 (2026-11-05, 375px, the announcement view).
7
+ */
8
+ const ACTIONS = ['edit', 'read status', 'remind again', 'withdraw post', 'duplicate'].map(title => ({ title, action: () => { } }));
9
+ async function barOf(width) {
10
+ /* The bar sits in a toolbar part as wide as the room left (ox-context-toolbar #center); it measures that room. */
11
+ const host = await fixture(html `<div style="display:flex; justify-content:flex-end; width:${width}px"><ox-page-action-context-bar .actions=${ACTIONS}></ox-page-action-context-bar></div>`);
12
+ const el = host.querySelector('ox-page-action-context-bar');
13
+ /* the measure runs on the next frame, throttled; then 「더보기」 renders and the marks are taken again */
14
+ for (let i = 0; i < 4; i++) {
15
+ await new Promise(resolve => setTimeout(resolve, 150));
16
+ await el.updateComplete;
17
+ }
18
+ return el;
19
+ }
20
+ const right = (el) => el.getBoundingClientRect().right;
21
+ const left = (el) => el.getBoundingClientRect().left;
22
+ describe('하단 동작 줄이 넘칠 때', () => {
23
+ it('「더보기」 밑에 반쯤 걸린 단추는 그리지 않는다', async () => {
24
+ var _a;
25
+ const el = await barOf(260);
26
+ const more = el.renderRoot.querySelector('[more]');
27
+ expect(more, '넘치는데 「더보기」가 없다').to.not.equal(null);
28
+ const buttons = Array.from(el.renderRoot.querySelectorAll('[container] > button'));
29
+ const shown = buttons.filter(one => getComputedStyle(one).display !== 'none');
30
+ expect(shown.length, '보이는 단추가 없다').to.be.greaterThan(0);
31
+ expect(shown.length, '모두 보인다 - 넘침을 재지 못했다').to.be.lessThan(buttons.length);
32
+ for (const one of shown) {
33
+ expect(right(one) <= left(more) + 0.5, `「${(_a = one.textContent) === null || _a === void 0 ? void 0 : _a.trim()}」가 「더보기」 밑으로 들어간다`).to.equal(true);
34
+ }
35
+ });
36
+ it('넉넉하면 아무것도 감추지 않는다', async () => {
37
+ const el = await barOf(1200);
38
+ expect(el.renderRoot.querySelector('[more]')).to.equal(null);
39
+ expect(el.renderRoot.querySelectorAll('[container] > [overflowed]').length).to.equal(0);
40
+ });
41
+ });
42
+ //# sourceMappingURL=action-bar-overflow.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-bar-overflow.test.js","sourceRoot":"","sources":["../../test/action-bar-overflow.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE1B,OAAO,4CAA4C,CAAA;AAEnD;;;GAGG;AAEH,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC,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MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC,CAAA;QAC7E,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;QACvD,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAC1E,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;YACxB,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAK,CAAC,GAAG,GAAG,EAAE,IAAI,MAAA,GAAG,CAAC,WAAW,0CAAE,IAAI,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACxG,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;QACjC,MAAM,EAAE,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,CAAA;QAC5B,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC5D,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACzF,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { expect, fixture } from '@open-wc/testing'\nimport { html } from 'lit'\n\nimport '../src/tools/ox-page-action-context-bar.js'\n\n/**\n * On a phone the actions do not all fit. 「더보기」 stands over the bar's right end, and an action that does not fit\n * whole is not drawn - it was drawn cut in two under 「더보기」 (2026-11-05, 375px, the announcement view).\n */\n\nconst ACTIONS = ['edit', 'read status', 'remind again', 'withdraw post', 'duplicate'].map(title => ({ title, action: () => {} }))\n\ntype Bar = HTMLElement & { renderRoot: ShadowRoot; updateComplete: Promise<unknown> }\n\nasync function barOf(width: number) {\n /* The bar sits in a toolbar part as wide as the room left (ox-context-toolbar #center); it measures that room. */\n const host = await fixture(html`<div style=\"display:flex; justify-content:flex-end; width:${width}px\"><ox-page-action-context-bar .actions=${ACTIONS}></ox-page-action-context-bar></div>`)\n const el = host.querySelector('ox-page-action-context-bar') as Bar\n /* the measure runs on the next frame, throttled; then 「더보기」 renders and the marks are taken again */\n for (let i = 0; i < 4; i++) {\n await new Promise(resolve => setTimeout(resolve, 150))\n await el.updateComplete\n }\n return el\n}\n\nconst right = (el: Element) => el.getBoundingClientRect().right\nconst left = (el: Element) => el.getBoundingClientRect().left\n\ndescribe('하단 동작 줄이 넘칠 때', () => {\n it('「더보기」 밑에 반쯤 걸린 단추는 그리지 않는다', async () => {\n const el = await barOf(260)\n const more = el.renderRoot.querySelector('[more]')\n expect(more, '넘치는데 「더보기」가 없다').to.not.equal(null)\n\n const buttons = Array.from(el.renderRoot.querySelectorAll('[container] > button'))\n const shown = buttons.filter(one => getComputedStyle(one).display !== 'none')\n expect(shown.length, '보이는 단추가 없다').to.be.greaterThan(0)\n expect(shown.length, '모두 보인다 - 넘침을 재지 못했다').to.be.lessThan(buttons.length)\n for (const one of shown) {\n expect(right(one) <= left(more!) + 0.5, `「${one.textContent?.trim()}」가 「더보기」 밑으로 들어간다`).to.equal(true)\n }\n })\n\n it('넉넉하면 아무것도 감추지 않는다', async () => {\n const el = await barOf(1200)\n expect(el.renderRoot.querySelector('[more]')).to.equal(null)\n expect(el.renderRoot.querySelectorAll('[container] > [overflowed]').length).to.equal(0)\n })\n})\n"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,59 @@
1
+ import { expect, fixture } from '@open-wc/testing';
2
+ import { html, LitElement } from 'lit';
3
+ import { DocumentPageStyles, WorkSurfacePageStyles } from '@operato/styles';
4
+ /**
5
+ * Page frames (ADR-0060 decision 8): the frame owns spacing, width and scroll, so two screens of the
6
+ * same kind come out the same. The numbers are written out, so a change to the frame shows up here as
7
+ * a decision.
8
+ */
9
+ class DocumentScreen extends LitElement {
10
+ render() {
11
+ return html `
12
+ <div class="page">
13
+ <section class="page-section">
14
+ <header class="page-section-header"><h3>today</h3><div class="page-section-actions"><button>refresh</button></div></header>
15
+ <div class="page-card">card</div>
16
+ </section>
17
+ <section class="page-section"><header class="page-section-header"><h3>later</h3></header></section>
18
+ </div>
19
+ `;
20
+ }
21
+ }
22
+ DocumentScreen.styles = [DocumentPageStyles];
23
+ customElements.define('test-document-screen', DocumentScreen);
24
+ class WorkScreen extends LitElement {
25
+ render() {
26
+ return html `<div class="page-headroom"><button>tab</button></div><div class="page-fill" style="height: 5000px"></div>`;
27
+ }
28
+ }
29
+ WorkScreen.styles = [WorkSurfacePageStyles];
30
+ customElements.define('test-work-screen', WorkScreen);
31
+ describe('page frames', () => {
32
+ /*
33
+ * 2026-10-05: the column fills the window between two equal gutters (user decision: fill the page,
34
+ * responsive). It used to stop at 1080px on the left and leave the right side empty.
35
+ */
36
+ it('document: the column fills the window, 16 top / 16 gutters / 40 bottom, sections 24px apart, the page scrolls', async () => {
37
+ const host = await fixture(html `<div style="width: 1600px; height: 600px"><test-document-screen></test-document-screen></div>`);
38
+ const screen = host.querySelector('test-document-screen');
39
+ await screen.updateComplete;
40
+ const page = screen.shadowRoot.querySelector('.page');
41
+ const [first, second] = Array.from(screen.shadowRoot.querySelectorAll('.page-section'));
42
+ const style = getComputedStyle(page);
43
+ expect(Math.round(page.getBoundingClientRect().width)).to.equal(1600);
44
+ expect([style.paddingTop, style.paddingRight, style.paddingBottom, style.paddingLeft]).to.deep.equal(['16px', '16px', '40px', '16px']);
45
+ expect(Math.round(second.getBoundingClientRect().top - first.getBoundingClientRect().bottom)).to.equal(24);
46
+ expect(getComputedStyle(screen).overflowY).to.equal('auto');
47
+ const actions = screen.shadowRoot.querySelector('.page-section-actions');
48
+ expect(Math.round(actions.getBoundingClientRect().right)).to.equal(Math.round(page.getBoundingClientRect().right) - 16);
49
+ });
50
+ it('work surface: the content fills and scrolls inside itself, the page does not scroll', async () => {
51
+ const host = await fixture(html `<div style="height: 400px"><test-work-screen></test-work-screen></div>`);
52
+ const screen = host.querySelector('test-work-screen');
53
+ await screen.updateComplete;
54
+ expect(getComputedStyle(screen).overflow).to.equal('hidden');
55
+ expect(Math.round(screen.getBoundingClientRect().height)).to.equal(400);
56
+ expect(getComputedStyle(screen.shadowRoot.querySelector('.page-fill')).minHeight).to.equal('0px');
57
+ });
58
+ });
59
+ //# sourceMappingURL=page-frames.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-frames.test.js","sourceRoot":"","sources":["../../test/page-frames.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAEtC,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAE3E;;;;GAIG;AAEH,MAAM,cAAe,SAAQ,UAAU;IAErC,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;;;KAQV,CAAA;IACH,CAAC;;AAXM,qBAAM,GAAG,CAAC,kBAAkB,CAAC,CAAA;AAatC,cAAc,CAAC,MAAM,CAAC,sBAAsB,EAAE,cAAc,CAAC,CAAA;AAE7D,MAAM,UAAW,SAAQ,UAAU;IAEjC,MAAM;QACJ,OAAO,IAAI,CAAA,2GAA2G,CAAA;IACxH,CAAC;;AAHM,iBAAM,GAAG,CAAC,qBAAqB,CAAC,CAAA;AAKzC,cAAc,CAAC,MAAM,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAA;AAErD,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B;;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AC,aAAa,CAAC,uBAAuB,CAAgB,CAAA;QACxF,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAA;IACzH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,qFAAqF,EAAE,KAAK,IAAI,EAAE;QACnG,MAAM,IAAI,GAAG,MAAM,OAAO,CAAc,IAAI,CAAA,wEAAwE,CAAC,CAAA;QACrH,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAe,CAAA;QACnE,MAAM,MAAM,CAAC,cAAc,CAAA;QAE3B,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QAC5D,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACvE,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,UAAW,CAAC,aAAa,CAAC,YAAY,CAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACrG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { expect, fixture } from '@open-wc/testing'\nimport { html, LitElement } from 'lit'\n\nimport { DocumentPageStyles, WorkSurfacePageStyles } from '@operato/styles'\n\n/**\n * Page frames (ADR-0060 decision 8): the frame owns spacing, width and scroll, so two screens of the\n * same kind come out the same. The numbers are written out, so a change to the frame shows up here as\n * a decision.\n */\n\nclass DocumentScreen extends LitElement {\n static styles = [DocumentPageStyles]\n render() {\n return html`\n <div class=\"page\">\n <section class=\"page-section\">\n <header class=\"page-section-header\"><h3>today</h3><div class=\"page-section-actions\"><button>refresh</button></div></header>\n <div class=\"page-card\">card</div>\n </section>\n <section class=\"page-section\"><header class=\"page-section-header\"><h3>later</h3></header></section>\n </div>\n `\n }\n}\ncustomElements.define('test-document-screen', DocumentScreen)\n\nclass WorkScreen extends LitElement {\n static styles = [WorkSurfacePageStyles]\n render() {\n return html`<div class=\"page-headroom\"><button>tab</button></div><div class=\"page-fill\" style=\"height: 5000px\"></div>`\n }\n}\ncustomElements.define('test-work-screen', WorkScreen)\n\ndescribe('page frames', () => {\n /*\n * 2026-10-05: the column fills the window between two equal gutters (user decision: fill the page,\n * responsive). It used to stop at 1080px on the left and leave the right side empty.\n */\n it('document: the column fills the window, 16 top / 16 gutters / 40 bottom, sections 24px apart, the page scrolls', async () => {\n const host = await fixture<HTMLElement>(html`<div style=\"width: 1600px; height: 600px\"><test-document-screen></test-document-screen></div>`)\n const screen = host.querySelector('test-document-screen') as DocumentScreen\n await screen.updateComplete\n const page = screen.shadowRoot!.querySelector('.page') as HTMLElement\n const [first, second] = Array.from(screen.shadowRoot!.querySelectorAll('.page-section'))\n const style = getComputedStyle(page)\n\n expect(Math.round(page.getBoundingClientRect().width)).to.equal(1600)\n expect([style.paddingTop, style.paddingRight, style.paddingBottom, style.paddingLeft]).to.deep.equal(['16px', '16px', '40px', '16px'])\n expect(Math.round(second.getBoundingClientRect().top - first.getBoundingClientRect().bottom)).to.equal(24)\n expect(getComputedStyle(screen).overflowY).to.equal('auto')\n\n const actions = screen.shadowRoot!.querySelector('.page-section-actions') as HTMLElement\n expect(Math.round(actions.getBoundingClientRect().right)).to.equal(Math.round(page.getBoundingClientRect().right) - 16)\n })\n\n it('work surface: the content fills and scrolls inside itself, the page does not scroll', async () => {\n const host = await fixture<HTMLElement>(html`<div style=\"height: 400px\"><test-work-screen></test-work-screen></div>`)\n const screen = host.querySelector('test-work-screen') as WorkScreen\n await screen.updateComplete\n\n expect(getComputedStyle(screen).overflow).to.equal('hidden')\n expect(Math.round(screen.getBoundingClientRect().height)).to.equal(400)\n expect(getComputedStyle(screen.shadowRoot!.querySelector('.page-fill')!).minHeight).to.equal('0px')\n })\n})\n"]}
@@ -0,0 +1,90 @@
1
+ import { expect, fixture } from '@open-wc/testing';
2
+ import { html } from 'lit';
3
+ import { store } from '@operato/shell';
4
+ import '../src/tools/ox-page-title-bar.js';
5
+ /**
6
+ * `context.description` draws one line under the screen title (ADR-0060 decision 8). A screen that
7
+ * does not give it must look exactly as before: no line, no wrapping.
8
+ */
9
+ async function bar(context) {
10
+ store.dispatch({ type: 'UPDATE_CONTEXT', context });
11
+ const el = await fixture(html `<ox-page-title-bar></ox-page-title-bar>`);
12
+ await el.updateComplete;
13
+ await el.updateComplete;
14
+ return el;
15
+ }
16
+ describe('ox-page-title-bar description', () => {
17
+ it('draws the description under the title', async () => {
18
+ const el = await bar({ title: 'work orders', description: 'orders released to the floor today' });
19
+ const line = el.shadowRoot.querySelector('[description]');
20
+ expect(line === null || line === void 0 ? void 0 : line.textContent).to.equal('orders released to the floor today');
21
+ expect(el.hasAttribute('described')).to.equal(true);
22
+ expect(line.getBoundingClientRect().top).to.be.greaterThan(el.shadowRoot.querySelector('[titler]').getBoundingClientRect().top);
23
+ });
24
+ it('★ draws nothing more when the screen gives no description', async () => {
25
+ const el = await bar({ title: 'work orders' });
26
+ expect(el.shadowRoot.querySelector('[description]') === null).to.equal(true);
27
+ expect(el.hasAttribute('described')).to.equal(false);
28
+ });
29
+ it('leaves the description out when the screen turns the title row off', async () => {
30
+ const el = await bar({ title: 'learn', heading: false, description: 'what the platform does' });
31
+ expect(el.shadowRoot.querySelector('[description]') === null).to.equal(true);
32
+ });
33
+ });
34
+ describe('ox-page-title-bar gutter', () => {
35
+ /*
36
+ * The title's first letter stands on the same line as the page's first letter: the bar's left
37
+ * padding plus the title box's own 4px equals the page gutter. It used to be 0 + 4, and on a
38
+ * document screen the title (x214) and the content (x229) were 15px apart (2026-10-05, :4000).
39
+ */
40
+ it('puts the title text at the page gutter', async () => {
41
+ const host = await fixture(html `<div style="--ui-gutter: 16px; --spacing-small: 4px; --spacing-medium: 8px"><ox-page-title-bar></ox-page-title-bar></div>`);
42
+ store.dispatch({ type: 'UPDATE_CONTEXT', context: { title: 'maintenance' } });
43
+ const el = host.querySelector('ox-page-title-bar');
44
+ await el.updateComplete;
45
+ await el.updateComplete;
46
+ const titler = el.shadowRoot.querySelector('[titler]');
47
+ const offset = titler.getBoundingClientRect().left + parseFloat(getComputedStyle(titler).paddingLeft) - el.getBoundingClientRect().left;
48
+ expect(Math.round(offset)).to.equal(16);
49
+ });
50
+ });
51
+ describe('ox-page-title-bar narrow window', () => {
52
+ /*
53
+ * The screen's name always shows. A narrow window used to drop the title for the search pill
54
+ * (2026-10-12, operato-board); now the pill moves under the title.
55
+ */
56
+ it('★ keeps the title and puts the search pill on the next line', async () => {
57
+ var _a;
58
+ const host = await fixture(html `<div style="width: 240px"><ox-page-title-bar></ox-page-title-bar></div>`);
59
+ store.dispatch({
60
+ type: 'UPDATE_CONTEXT',
61
+ context: { title: 'scenario list', search: { handler: () => { }, placeholder: 'search scenarios by name' } }
62
+ });
63
+ const el = host.querySelector('ox-page-title-bar');
64
+ await el.updateComplete;
65
+ await el.updateComplete;
66
+ const titler = el.shadowRoot.querySelector('[titler]');
67
+ const search = el.shadowRoot.querySelector('[search]');
68
+ expect((_a = titler === null || titler === void 0 ? void 0 : titler.textContent) === null || _a === void 0 ? void 0 : _a.trim()).to.equal('scenario list');
69
+ expect(search.getBoundingClientRect().top).to.be.at.least(titler.getBoundingClientRect().bottom - 1);
70
+ expect(search.getBoundingClientRect().right).to.be.at.most(el.getBoundingClientRect().right + 1);
71
+ });
72
+ });
73
+ describe('ox-page-title-bar title style', () => {
74
+ /*
75
+ * The screen title reads like the New Board page's heading (2026-10-12): the theme gives the font
76
+ * (--context-toolbar-title) and the colour (--context-toolbar-title-color).
77
+ */
78
+ it('★ takes its font and colour from the title variables', async () => {
79
+ const host = await fixture(html `<div style="--context-toolbar-title: 600 20px sans-serif; --context-toolbar-title-color: rgb(27, 27, 27); --title-text-color: rgb(100, 85, 80)"><ox-page-title-bar></ox-page-title-bar></div>`);
80
+ store.dispatch({ type: 'UPDATE_CONTEXT', context: { title: 'board list' } });
81
+ const el = host.querySelector('ox-page-title-bar');
82
+ await el.updateComplete;
83
+ await el.updateComplete;
84
+ const style = getComputedStyle(el.shadowRoot.querySelector('[titler]'));
85
+ expect(style.fontWeight).to.equal('600');
86
+ expect(style.fontSize).to.equal('20px');
87
+ expect(style.color).to.equal('rgb(27, 27, 27)');
88
+ });
89
+ });
90
+ //# sourceMappingURL=page-title-description.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-title-description.test.js","sourceRoot":"","sources":["../../test/page-title-description.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAEtC,OAAO,mCAAmC,CAAA;AAE1C;;;GAGG;AAEH,KAAK,UAAU,GAAG,CAAC,OAAgC;IACjD,KAAK,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAS,CAAC,CAAA;IAC1D,MAAM,EAAE,GAAG,MAAM,OAAO,CAAqD,IAAI,CAAA,yCAAyC,CAAC,CAAA;IAC3H,MAAM,EAAE,CAAC,cAAc,CAAA;IACvB,MAAM,EAAE,CAAC,cAAc,CAAA;IACvB,OAAO,EAAE,CAAA;AACX,CAAC;AAED,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,EAAE,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;QACrD,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE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,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,EAAS,CAAC,CAAA;QACnF,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAuD,CAAA;QACxG,MAAM,EAAE,CAAC,cAAc,CAAA;QACvB,MAAM,EAAE,CAAC,cAAc,CAAA;QACvB,MAAM,KAAK,GAAG,gBAAgB,CAAC,EAAE,CAAC,UAAW,CAAC,aAAa,CAAC,UAAU,CAAgB,CAAC,CAAA;QAEvF,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACxC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QACvC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;IACjD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { expect, fixture } from '@open-wc/testing'\nimport { html } from 'lit'\n\nimport { store } from '@operato/shell'\n\nimport '../src/tools/ox-page-title-bar.js'\n\n/**\n * `context.description` draws one line under the screen title (ADR-0060 decision 8). A screen that\n * does not give it must look exactly as before: no line, no wrapping.\n */\n\nasync function bar(context: Record<string, unknown>) {\n store.dispatch({ type: 'UPDATE_CONTEXT', context } as any)\n const el = await fixture<HTMLElement & { updateComplete: Promise<unknown> }>(html`<ox-page-title-bar></ox-page-title-bar>`)\n await el.updateComplete\n await el.updateComplete\n return el\n}\n\ndescribe('ox-page-title-bar description', () => {\n it('draws the description under the title', async () => {\n const el = await bar({ title: 'work orders', description: 'orders released to the floor today' })\n const line = el.shadowRoot!.querySelector('[description]')\n\n expect(line?.textContent).to.equal('orders released to the floor today')\n expect(el.hasAttribute('described')).to.equal(true)\n expect(line!.getBoundingClientRect().top).to.be.greaterThan(el.shadowRoot!.querySelector('[titler]')!.getBoundingClientRect().top)\n })\n\n it('★ draws nothing more when the screen gives no description', async () => {\n const el = await bar({ title: 'work orders' })\n\n expect(el.shadowRoot!.querySelector('[description]') === null).to.equal(true)\n expect(el.hasAttribute('described')).to.equal(false)\n })\n\n it('leaves the description out when the screen turns the title row off', async () => {\n const el = await bar({ title: 'learn', heading: false, description: 'what the platform does' })\n\n expect(el.shadowRoot!.querySelector('[description]') === null).to.equal(true)\n })\n})\n\ndescribe('ox-page-title-bar gutter', () => {\n /*\n * The title's first letter stands on the same line as the page's first letter: the bar's left\n * padding plus the title box's own 4px equals the page gutter. It used to be 0 + 4, and on a\n * document screen the title (x214) and the content (x229) were 15px apart (2026-10-05, :4000).\n */\n it('puts the title text at the page gutter', async () => {\n const host = await fixture<HTMLElement>(html`<div style=\"--ui-gutter: 16px; --spacing-small: 4px; --spacing-medium: 8px\"><ox-page-title-bar></ox-page-title-bar></div>`)\n store.dispatch({ type: 'UPDATE_CONTEXT', context: { title: 'maintenance' } } as any)\n const el = host.querySelector('ox-page-title-bar') as HTMLElement & { updateComplete: Promise<unknown> }\n await el.updateComplete\n await el.updateComplete\n const titler = el.shadowRoot!.querySelector('[titler]') as HTMLElement\n const offset = titler.getBoundingClientRect().left + parseFloat(getComputedStyle(titler).paddingLeft) - el.getBoundingClientRect().left\n\n expect(Math.round(offset)).to.equal(16)\n })\n})\n\ndescribe('ox-page-title-bar narrow window', () => {\n /*\n * The screen's name always shows. A narrow window used to drop the title for the search pill\n * (2026-10-12, operato-board); now the pill moves under the title.\n */\n it('★ keeps the title and puts the search pill on the next line', async () => {\n const host = await fixture<HTMLElement>(html`<div style=\"width: 240px\"><ox-page-title-bar></ox-page-title-bar></div>`)\n store.dispatch({\n type: 'UPDATE_CONTEXT',\n context: { title: 'scenario list', search: { handler: () => {}, placeholder: 'search scenarios by name' } }\n } as any)\n const el = host.querySelector('ox-page-title-bar') as HTMLElement & { updateComplete: Promise<unknown> }\n await el.updateComplete\n await el.updateComplete\n const titler = el.shadowRoot!.querySelector('[titler]') as HTMLElement\n const search = el.shadowRoot!.querySelector('[search]') as HTMLElement\n\n expect(titler?.textContent?.trim()).to.equal('scenario list')\n expect(search.getBoundingClientRect().top).to.be.at.least(titler.getBoundingClientRect().bottom - 1)\n expect(search.getBoundingClientRect().right).to.be.at.most(el.getBoundingClientRect().right + 1)\n })\n})\n\ndescribe('ox-page-title-bar title style', () => {\n /*\n * The screen title reads like the New Board page's heading (2026-10-12): the theme gives the font\n * (--context-toolbar-title) and the colour (--context-toolbar-title-color).\n */\n it('★ takes its font and colour from the title variables', async () => {\n const host = await fixture<HTMLElement>(\n html`<div style=\"--context-toolbar-title: 600 20px sans-serif; --context-toolbar-title-color: rgb(27, 27, 27); --title-text-color: rgb(100, 85, 80)\"><ox-page-title-bar></ox-page-title-bar></div>`\n )\n store.dispatch({ type: 'UPDATE_CONTEXT', context: { title: 'board list' } } as any)\n const el = host.querySelector('ox-page-title-bar') as HTMLElement & { updateComplete: Promise<unknown> }\n await el.updateComplete\n await el.updateComplete\n const style = getComputedStyle(el.shadowRoot!.querySelector('[titler]') as HTMLElement)\n\n expect(style.fontWeight).to.equal('600')\n expect(style.fontSize).to.equal('20px')\n expect(style.color).to.equal('rgb(27, 27, 27)')\n })\n})\n"]}