@operato/input 10.10.0 → 10.10.5

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/input",
3
3
  "description": "Webcomponents for input following open-wc recommendations",
4
4
  "author": "heartyoh@hatiolab.com",
5
- "version": "10.10.0",
5
+ "version": "10.10.5",
6
6
  "type": "module",
7
7
  "main": "dist/src/index.js",
8
8
  "module": "dist/src/index.js",
@@ -251,7 +251,7 @@
251
251
  "@material/web": "^2.0.0",
252
252
  "@operato/i18n": "^10.0.0",
253
253
  "@operato/pickr": "^10.0.0",
254
- "@operato/popup": "^10.10.0",
254
+ "@operato/popup": "^10.10.5",
255
255
  "@operato/styles": "^10.10.0",
256
256
  "@operato/utils": "^10.7.0",
257
257
  "@types/codemirror": "^5.60.5",
@@ -294,5 +294,5 @@
294
294
  "prettier --write"
295
295
  ]
296
296
  },
297
- "gitHead": "15f722c8131e5a04b5b4186ac71ada9f94ef9a4f"
297
+ "gitHead": "8459323af943b966a724dae76253d11bc013bbaa"
298
298
  }
@@ -5,39 +5,41 @@ import '../src/ox-input-background-pattern.js'
5
5
  import { registerImageSelector } from '../src/image-selector.js'
6
6
 
7
7
  /**
8
- * 그림 고르는 칸의 자리.
8
+ * The image-picking slot.
9
9
  *
10
- * ## 왜 시험이 필요한가
10
+ * ## Why this is tested
11
11
  *
12
- * `@operato/input` 이 `@operato/attachment` 를 직접 부르고 있었다. 가장 아래의 부품이 위의 기능을
13
- * 아는 모양이라 고리가 생겼고(input ▶ attachment ▶ data-grist ▶ input), 그 고리 때문에 이 package
14
- * 는 **빌드되지 않았다**(TS5055 일곱 건, noEmitOnError).
12
+ * `@operato/input` used to import `@operato/attachment` directly. The bottom layer reached for a
13
+ * feature above it, closing a cycle (input ▶ attachment ▶ data-grist ▶ input) that stopped this
14
+ * package from building — TS5055 on seven files, with `noEmitOnError`.
15
15
  *
16
- * 화살표를 뒤집으면서 두 가지가 지켜져야 한다.
16
+ * Reversing that arrow has to hold two things:
17
17
  *
18
18
  * ```
19
- * 비지 않는다 등록이 없어도 칸이 있어야 한다. 등록 안 된 custom element 는 소리 없이 빈 상자다
20
- * 값이 담긴다 어느 갈래가 그려지든 value-key 와 change 로 값이 같은 길을 지나야 한다
19
+ * never empty with nothing registered there must still be a field; an unregistered
20
+ * custom element renders as a silent empty box
21
+ * value lands either branch carries value-key and raises change, so the value takes
22
+ * the same path out
21
23
  * ```
22
24
  */
23
- describe('그림 고르는 칸은 위 layer 가 채운다', () => {
25
+ describe('image-picking field', () => {
24
26
  async function pattern(value: any = {}) {
25
27
  const el: any = await fixture(html`<ox-input-background-pattern .value=${value}></ox-input-background-pattern>`)
26
28
  await el.updateComplete
27
29
  return el
28
30
  }
29
31
 
30
- it('등록이 없으면 글자 칸이다 — 빈 자리로 두지 않는다', async () => {
32
+ it('falls back to a text box when nothing is registered', async () => {
31
33
  const el = await pattern({ image: 'https://example.com/a.png' })
32
34
 
33
35
  const field = el.renderRoot.querySelector('[value-key="image"]') as HTMLInputElement
34
36
 
35
- expect(field, '그림 칸이 아예 없다').to.exist
37
+ expect(field, 'no image field at all').to.exist
36
38
  expect(field.tagName).to.equal('INPUT')
37
- expect(field.value, '적혀 있던 주소가 칸에 실리지 않았다').to.equal('https://example.com/a.png')
39
+ expect(field.value, 'existing address did not reach the field').to.equal('https://example.com/a.png')
38
40
  })
39
41
 
40
- it('글자 칸에 적은 주소가 값으로 담긴다', async () => {
42
+ it('takes an address typed into the fallback text box', async () => {
41
43
  const el = await pattern({})
42
44
 
43
45
  const field = el.renderRoot.querySelector('[value-key="image"]') as HTMLInputElement
@@ -47,7 +49,7 @@ describe('그림 고르는 칸은 위 layer 가 채운다', () => {
47
49
  expect(el.value.image).to.equal('https://example.com/b.png')
48
50
  })
49
51
 
50
- it('그림을 가진 쪽이 자기 칸을 등록하면 그것으로 바뀐다', async () => {
52
+ it('swaps in the registered field, even when registration lands after render', async () => {
51
53
  class FakeSelector extends HTMLElement {
52
54
  value: any
53
55
  properties: any
@@ -56,7 +58,6 @@ describe('그림 고르는 칸은 위 layer 가 채운다', () => {
56
58
 
57
59
  const el = await pattern({ image: 'https://example.com/c.png' })
58
60
 
59
- /* 요소가 먼저 그려지고 등록이 나중에 와도 자리가 글자 칸으로 남아 있으면 안 된다. */
60
61
  registerImageSelector('test-image-selector')
61
62
  await el.updateComplete
62
63
 
@@ -67,7 +68,7 @@ describe('그림 고르는 칸은 위 layer 가 채운다', () => {
67
68
  expect(field.properties).to.deep.equal({ category: 'image' })
68
69
  })
69
70
 
70
- it('등록된 칸이 올린 change 도 같은 길로 값이 담긴다', async () => {
71
+ it('takes a change raised by the registered field the same way', async () => {
71
72
  registerImageSelector('test-image-selector')
72
73
 
73
74
  const el = await pattern({})