@things-factory/figure-ui 10.1.5 → 10.1.7

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.
Files changed (79) hide show
  1. package/client/graphql/index.ts +36 -3
  2. package/client/modeller/figure-animations.ts +712 -0
  3. package/client/modeller/figure-ask.ts +5 -5
  4. package/client/modeller/figure-canvas.ts +1 -1
  5. package/client/modeller/figure-capabilities.ts +372 -0
  6. package/client/modeller/figure-history-panel.ts +171 -18
  7. package/client/modeller/figure-inspector.ts +439 -76
  8. package/client/modeller/figure-parts.ts +15 -15
  9. package/client/modeller/figure-preview.ts +2 -2
  10. package/client/modeller/figure-report.ts +102 -37
  11. package/client/modeller/figure-settings.ts +20 -20
  12. package/client/modeller/figure-side.ts +91 -15
  13. package/client/modeller/figure-source.test.ts +15 -1
  14. package/client/modeller/figure-source.ts +31 -15
  15. package/client/modeller/figure-thumbnail.ts +49 -4
  16. package/client/modeller/maturity.ts +10 -10
  17. package/client/pages/figure-list-page.ts +204 -66
  18. package/client/pages/figure-modeller-page.ts +158 -42
  19. package/client/types.ts +31 -0
  20. package/client/viewparts/figure-thumb.ts +250 -0
  21. package/dist-client/graphql/index.d.ts +8 -1
  22. package/dist-client/graphql/index.js +33 -3
  23. package/dist-client/graphql/index.js.map +1 -1
  24. package/dist-client/modeller/figure-animations.d.ts +93 -0
  25. package/dist-client/modeller/figure-animations.js +655 -0
  26. package/dist-client/modeller/figure-animations.js.map +1 -0
  27. package/dist-client/modeller/figure-ask.js +5 -5
  28. package/dist-client/modeller/figure-ask.js.map +1 -1
  29. package/dist-client/modeller/figure-canvas.js +1 -1
  30. package/dist-client/modeller/figure-canvas.js.map +1 -1
  31. package/dist-client/modeller/figure-capabilities.d.ts +42 -0
  32. package/dist-client/modeller/figure-capabilities.js +344 -0
  33. package/dist-client/modeller/figure-capabilities.js.map +1 -0
  34. package/dist-client/modeller/figure-history-panel.d.ts +15 -1
  35. package/dist-client/modeller/figure-history-panel.js +165 -18
  36. package/dist-client/modeller/figure-history-panel.js.map +1 -1
  37. package/dist-client/modeller/figure-inspector.d.ts +98 -0
  38. package/dist-client/modeller/figure-inspector.js +425 -75
  39. package/dist-client/modeller/figure-inspector.js.map +1 -1
  40. package/dist-client/modeller/figure-parts.js +15 -15
  41. package/dist-client/modeller/figure-parts.js.map +1 -1
  42. package/dist-client/modeller/figure-preview.js +2 -2
  43. package/dist-client/modeller/figure-preview.js.map +1 -1
  44. package/dist-client/modeller/figure-report.d.ts +18 -1
  45. package/dist-client/modeller/figure-report.js +105 -37
  46. package/dist-client/modeller/figure-report.js.map +1 -1
  47. package/dist-client/modeller/figure-settings.js +19 -19
  48. package/dist-client/modeller/figure-settings.js.map +1 -1
  49. package/dist-client/modeller/figure-side.d.ts +24 -0
  50. package/dist-client/modeller/figure-side.js +94 -14
  51. package/dist-client/modeller/figure-side.js.map +1 -1
  52. package/dist-client/modeller/figure-source.d.ts +15 -8
  53. package/dist-client/modeller/figure-source.js +16 -7
  54. package/dist-client/modeller/figure-source.js.map +1 -1
  55. package/dist-client/modeller/figure-thumbnail.js +40 -4
  56. package/dist-client/modeller/figure-thumbnail.js.map +1 -1
  57. package/dist-client/modeller/maturity.js +10 -10
  58. package/dist-client/modeller/maturity.js.map +1 -1
  59. package/dist-client/pages/figure-list-page.d.ts +11 -4
  60. package/dist-client/pages/figure-list-page.js +201 -63
  61. package/dist-client/pages/figure-list-page.js.map +1 -1
  62. package/dist-client/pages/figure-modeller-page.d.ts +33 -0
  63. package/dist-client/pages/figure-modeller-page.js +156 -42
  64. package/dist-client/pages/figure-modeller-page.js.map +1 -1
  65. package/dist-client/tsconfig.tsbuildinfo +1 -1
  66. package/dist-client/types.d.ts +29 -0
  67. package/dist-client/types.js.map +1 -1
  68. package/dist-client/viewparts/figure-thumb.d.ts +29 -0
  69. package/dist-client/viewparts/figure-thumb.js +242 -0
  70. package/dist-client/viewparts/figure-thumb.js.map +1 -0
  71. package/dist-server/tsconfig.tsbuildinfo +1 -1
  72. package/package.json +6 -5
  73. package/test/i18n-prefix-guard.test.ts +171 -0
  74. package/test/korean-register-guard.test.ts +83 -0
  75. package/translations/en.json +351 -264
  76. package/translations/ja.json +276 -264
  77. package/translations/ko.json +351 -264
  78. package/translations/ms.json +276 -264
  79. package/translations/zh.json +276 -264
@@ -4,6 +4,7 @@ import { client } from '@operato/graphql'
4
4
  import type {
5
5
  Figure,
6
6
  FigureFinding,
7
+ FigureInspection,
7
8
  FigureListResult,
8
9
  FigurePatch,
9
10
  FigureProposal,
@@ -37,8 +38,10 @@ function unwrap<T>(response: { data?: Record<string, unknown>; errors?: readonly
37
38
  /**
38
39
  * 목록에 필요한 필드만 가져온다 — `source` 는 무겁고 목록에서 쓰지 않는다.
39
40
  *
40
- * `score`·`triangles` 함께 받는 이유는 카드에 그것을 보여 주기 때문이다. 저작자가
41
- * 목록에서 「이 Figure 무거운가」를 바로 알아야 한다.
41
+ * **`thumbnail` 여기 없다.** base64 문자열이라 목록 응답에 실으면 카탈로그를 열 때마다 그림
42
+ * 전부가 다시 오고(표본 14개 227KB), data URL 은 브라우저가 캐시하지 못한다. 그림은 주소로
43
+ * 부른다(`figure-thumbnail` 라우트). 대신 `thumbnailUpdatedAt` 을 받는다 — 그림이 있나 없나를
44
+ * 그것으로 알고, 판을 가리는 값으로도 쓴다.
42
45
  */
43
46
  const FIGURE_LIST_FIELDS = `
44
47
  id
@@ -46,12 +49,12 @@ const FIGURE_LIST_FIELDS = `
46
49
  name
47
50
  description
48
51
  category
52
+ tags
49
53
  state
50
54
  version
51
55
  score
52
56
  triangles
53
57
  groups
54
- thumbnail
55
58
  thumbnailUpdatedAt
56
59
  updatedAt
57
60
  updater { id name }
@@ -259,6 +262,36 @@ export async function revertFigureVersion(id: string, version: number): Promise<
259
262
  return unwrap<SaveResult>(response, 'revertFigureVersion')
260
263
  }
261
264
 
265
+ /**
266
+ * 발행해도 되나 — **누르기 전에** 묻는다.
267
+ *
268
+ * 막는 것은 서버의 `releaseFigure` 이고 이것은 이유를 미리 보여 주기 위한 것이다. 허가증이
269
+ * 아니므로 이 답이 통과라 해도 발행은 다시 판정을 받는다.
270
+ */
271
+ export async function inspectFigure(id: string): Promise<FigureInspection> {
272
+ const response = await client.query({
273
+ query: gql`
274
+ query InspectFigure($id: String!) {
275
+ inspectFigure(id: $id) {
276
+ blocked
277
+ findings {
278
+ code
279
+ message
280
+ why
281
+ how
282
+ at
283
+ blocking
284
+ }
285
+ }
286
+ }
287
+ `,
288
+ variables: { id },
289
+ fetchPolicy: 'network-only'
290
+ })
291
+
292
+ return unwrap<FigureInspection>(response, 'inspectFigure')
293
+ }
294
+
262
295
  /** 발행된 판들 — 최근 것부터 열 개. */
263
296
  export async function fetchFigureVersions(id: string): Promise<FigureVersion[]> {
264
297
  const response = await client.query({