@things-factory/figure-service 10.1.45 → 10.1.46

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/figure-service",
3
- "version": "10.1.45",
3
+ "version": "10.1.46",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "@things-factory:registry": "https://registry.npmjs.org"
@@ -23,15 +23,15 @@
23
23
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create ./server/migrations/migration"
24
24
  },
25
25
  "dependencies": {
26
- "@hatiolab/figure-model": "^0.1.47",
26
+ "@hatiolab/figure-model": "^0.1.48",
27
27
  "@operato/typeorm-history": "^10.0.0",
28
28
  "@things-factory/ai-client-base": "^10.1.39",
29
- "@things-factory/auth-base": "^10.1.44",
29
+ "@things-factory/auth-base": "^10.1.46",
30
30
  "@things-factory/env": "^10.1.20",
31
- "@things-factory/shell": "^10.1.44",
31
+ "@things-factory/shell": "^10.1.46",
32
32
  "graphql-scalars": "^1.22.4",
33
33
  "graphql-upload": "^15.0.2",
34
34
  "koa-router": "^7.4.0"
35
35
  },
36
- "gitHead": "d72e1fd1285797fcd7839d97a18e31f5bf076ae3"
36
+ "gitHead": "d3467cde550453f3348fed0ed6c79a12a6ba0db4"
37
37
  }
@@ -274,6 +274,23 @@ describe('figure-format — 판을 알아보는 문', () => {
274
274
  expect(`${finding!.message}${finding!.why}${finding!.how}`).not.toMatch(/come away|piece/)
275
275
  })
276
276
 
277
+ /* The server's translator is i18next with its defaults, which escape values for HTML. The panel draws text. */
278
+ it('부품 이름의 따옴표가 HTML 로 바뀌지 않는다 — 서버와 같은 i18next 로', async () => {
279
+ const i18next = require('i18next').createInstance()
280
+ await i18next.init({
281
+ lng: 'ko',
282
+ resources: { ko: { translations: KO } },
283
+ ns: ['translations'],
284
+ defaultNS: 'translations',
285
+ interpolation: { prefix: '{', suffix: '}' },
286
+ keySeparator: false
287
+ })
288
+ const finding = inspectAnySource(splitting(), null, i18next.t.bind(i18next)).findings.find(f => f.code === 'parts-split-on-resize')!
289
+
290
+ expect(finding.message).toBe("크기를 Y 로 2배로 하면 'lamp' 가 나머지에서 떨어집니다.")
291
+ expect(`${finding.message}${finding.how}`).not.toContain(''')
292
+ })
293
+
277
294
  it('번역이 없으면 영어로 답한다 — 키를 찍지 않는다', () => {
278
295
  const finding = inspectAnySource(outside()).findings.find(f => f.code === 'part-outside-occupancy')!
279
296
 
@@ -180,8 +180,13 @@ function v3Wording(violation: V3Violation, say: Say, hasParts: boolean): Pick<Ga
180
180
 
181
181
  type Say = (key: string, params: Record<string, string | number>, english: string) => string
182
182
 
183
+ /*
184
+ The sentence is shown as text, never as HTML, so the values go in as they are. i18next escapes interpolated
185
+ values by default, and the screen then showed `'lamp-in'` as `&#39;lamp-in&#39;`.
186
+ */
183
187
  function sayerOf(t?: Translate): Say {
184
- return (key, params, english) => (t ? t(key, { ...params, defaultValue: english }) : english)
188
+ return (key, params, english) =>
189
+ t ? t(key, { ...params, defaultValue: english, interpolation: { escapeValue: false } }) : english
185
190
  }
186
191
 
187
192
  export function inspectAnySource(